Skip to content

Commit

Permalink
Merge branch 'Bloodmallet:dev' into df4-frost
Browse files Browse the repository at this point in the history
  • Loading branch information
Khazakdk authored Apr 23, 2024
2 parents d9c2479 + 6cc8b90 commit 9d76411
Show file tree
Hide file tree
Showing 8 changed files with 263 additions and 15 deletions.
2 changes: 1 addition & 1 deletion bloodytools/simulations/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def get_additional_talent_paths(
except EmptyFileError:
custom_profile = False

profile_name = "T" + self.settings.tier
profile_name = self.settings.tier
if custom_profile:
profile_name = "custom profile"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ Coil Single Target:

Disease:
- talents=BwPAAAAAAAAAAAAAAAAAAAAAAAAIkkQiIRESSECJJJRAAAAAAAAAgCJRISSaAAkIFRSSikE
- trinket1=pips_emerald_friendship_badge,id=207168,bonus_id=7187/1520

Busting_Sores:
- talents=BwPAAAAAAAAAAAAAAAAAAAAAAAAiQSCJiEJISEikkIRAAAAAAAAAgCJRkkkkCAAJSTkkkIJA
- trinket1=pips_emerald_friendship_badge,id=207168,bonus_id=7187/1520
10 changes: 6 additions & 4 deletions bloodytools/simulations/tier_set_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,16 @@ def add_simulation_data(
"set_bonus=tier29_4pc=0",
"set_bonus=tier30_2pc=0",
"set_bonus=tier30_4pc=0",
"set_bonus=tier31_2pc=0",
"set_bonus=tier31_4pc=0",
],
"2p": [
"set_bonus=tier30_2pc=1",
"set_bonus=tier30_4pc=0",
"set_bonus=tier32_2pc=1",
"set_bonus=tier32_4pc=0",
],
"4p": [
"set_bonus=tier30_2pc=1",
"set_bonus=tier30_4pc=1",
"set_bonus=tier32_2pc=1",
"set_bonus=tier32_4pc=1",
],
}

Expand Down
6 changes: 3 additions & 3 deletions bloodytools/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class Config:
iterations: str = "60000"
keep_files: bool = False
# affects trinkets
max_ilevel: int = 496
max_ilevel: int = 528
# affects trinkets
min_ilevel: int = 447
min_ilevel: int = 480
pretty: bool = False
profileset_work_threads: str = "2"
ptr: str = "0"
Expand All @@ -55,7 +55,7 @@ class Config:
talent_permutations: bool = False
target_error: typing.Dict[str, str] = dataclasses.field(default_factory=dict)
threads: str = ""
tier: str = "31"
tier: str = "DF4"
use_raidbots: bool = False
write_humanreadable_secondary_distribution_file: bool = False
apikey: str = ""
Expand Down
210 changes: 206 additions & 4 deletions bloodytools/utils/profile_extraction.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import dataclasses
import enum
import logging
import os
import re
Expand All @@ -10,6 +12,198 @@
logger = logging.getLogger(__name__)


class CharacterSource(enum.Enum):
SIMULATIONCRAFT = enum.auto()
CUSTOM_PROFILE = enum.auto()
FALLBACK_PROFILE = enum.auto()


class ItemSlot(enum.Enum):
HEAD = "head"
NECK = "neck"
SHOULDERS = "shoulders"
BACK = "back"
CHEST = "chest"
WRISTS = "wrists"
HANDS = "hands"
WAIST = "waist"
LEGS = "legs"
FEET = "feet"
FINGER_1 = "finger1"
FINGER_2 = "finger2"
TRINKET_1 = "trinket1"
TRINKET_2 = "trinket2"
MAIN_HAND = "main_hand"
OFF_HAND = "off_hand"
NONE = "none"


class NotAnItemLineError(Exception):
pass


@dataclasses.dataclass
class Item:
slot: ItemSlot
slot_alternative_names: typing.List[str]

item_id: int
bonus_id: typing.List[int]
enchant: str
ilevel: int
gem_id: typing.List[int]
enchant_id: int
crafted_stats: typing.List[int]
drop_level: int

@staticmethod
def from_simc_string(simc_string: str) -> "Item":
simc_string = simc_string.strip()

# drop comments
simc_string = simc_string.split("#")[0]

if not simc_string:
raise NotAnItemLineError(
"Empty line found (comments were dropped beforehand)."
)

slot: typing.Union[None, ItemSlot] = None
alternative_slot_names: typing.Dict[ItemSlot, str] = {
ItemSlot.SHOULDERS: "shoulder",
ItemSlot.WRISTS: "wrist",
}
for slot_option in ItemSlot:
if (
simc_string.startswith(slot_option.value)
or slot_option in alternative_slot_names
and simc_string.startswith(alternative_slot_names[slot_option])
):
slot = slot_option

if not slot:
raise NotAnItemLineError("ItemSlot not found in line")

# dropping slot information
simc_parts = simc_string.split(",")[1:]

empty_item = Item(
slot=slot,
slot_alternative_names=[],
item_id=-1,
bonus_id=[],
enchant="",
ilevel=-1,
gem_id=[],
enchant_id=-1,
crafted_stats=[],
drop_level=-1,
)
for part in simc_parts:
# ! stop the implementation! the actual goal is to ensure only one profile is printed in profilesets. head over there
pass

return empty_item


@dataclasses.dataclass
class HeadItem(Item):
slot = ItemSlot.HEAD


@dataclasses.dataclass
class NeckItem(Item):
slot = ItemSlot.NECK


@dataclasses.dataclass
class ShouldersItem(Item):
slot = ItemSlot.SHOULDERS


@dataclasses.dataclass
class BackItem(Item):
slot = ItemSlot.BACK


@dataclasses.dataclass
class ChestItem(Item):
slot = ItemSlot.CHEST


@dataclasses.dataclass
class WristsItem(Item):
slot = ItemSlot.WRISTS


@dataclasses.dataclass
class HandsItem(Item):
slot = ItemSlot.HANDS


@dataclasses.dataclass
class WaistItem(Item):
slot = ItemSlot.WAIST


@dataclasses.dataclass
class LegsItem(Item):
slot = ItemSlot.LEGS


@dataclasses.dataclass
class FeetItem(Item):
slot = ItemSlot.FEET


@dataclasses.dataclass
class Finger1Item(Item):
slot = ItemSlot.FINGER_1


@dataclasses.dataclass
class Finger2Item(Item):
slot = ItemSlot.FINGER_2


@dataclasses.dataclass
class Trinket1Item(Item):
slot = ItemSlot.TRINKET_1


@dataclasses.dataclass
class Trinket2Item(Item):
slot = ItemSlot.TRINKET_2


@dataclasses.dataclass
class MainHandItem(Item):
slot = ItemSlot.MAIN_HAND


@dataclasses.dataclass
class OffHandItem(Item):
slot = ItemSlot.OFF_HAND


@dataclasses.dataclass
class CharacterProfile:
source: str
path: str

# character
class_str: str
level: str
race: str
role: str
spec: str

# items
back: BackItem
chest: ChestItem
feet: FeetItem


class EmptyFileError(Exception):
pass

Expand All @@ -23,13 +217,21 @@ class SpecMismatchError(Exception):


def _get_tier_directory_name(tier: str) -> str:
"""PreRaids vs TierXX"""
return "PreRaids" if tier == "PR" else f"Tier{tier}"
"""
SimulationCraft switched to expansion + season count as names
old:PreRaids vs TierXX
"""
return tier


def _get_tier_file_name_part(tier: str) -> str:
"""PR vs TXX"""
return "PR" if "PR" in str(tier) else f"T{tier}"
"""
SimulationCraft switched to expansion + season count as names
PR vs TXX
"""
return tier


def _get_simc_profile_file_name(tier: str, wow_spec: WowSpec) -> str:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
deathknight=DF4_Death_Knight_Unholy
level=70
race=human
role=attack
position=back
spec=unholy
talents=BwPAAAAAAAAAAAAAAAAAAAAAAAAIIJRiIRESSECJJJRAAAAAAAAAgSSSICAAIJhUSkkkIJA

head=piercing_gaze_of_the_risen_nightmare,id=217223,bonus_id=10359/1488/10884/6935,gem_id=192988,enchant=incandescent_essence
neck=torc_of_passed_time,id=201759,bonus_id=10249/10359/9405/8932/8960/8782,gem_id=192964/192964/192964,crafted_stats=32/36
shoulders=skewers_of_the_risen_nightmare,id=217225,bonus_id=10359/1488/10884
back=voice_of_the_silent_star,id=204465,bonus_id=10359/1495/10884
chest=breastplate_of_soaring_terror,id=193753,bonus_id=10359/1488/10884,enchant=waking_stats_3
wrists=primal_molten_vambraces,id=190502,bonus_id=10249/10359/9405/8932/6935/8960,gem_id=192964,crafted_stats=36/40
hands=thorns_of_the_risen_nightmare,id=217222,bonus_id=10359/1488/10884
waist=recycled_golemskin_waistguard,id=204400,bonus_id=10359/1488/10884/6935,gem_id=192964,enchant=shadowed_belt_clasp_3
legs=greaves_of_the_risen_nightmare,id=217224,bonus_id=10359/1488/10884,enchant=lambent_armor_kit_3
feet=fused_obsidian_sabatons,id=207156,bonus_id=10359/1488/10884
finger1=seal_of_diurnas_chosen,id=195480,bonus_id=10359/1488/10884/6935,gem_id=192964,enchant=devotion_of_versatility_3
finger2=seal_of_filial_duty,id=195526,bonus_id=10359/1495/10884/6935,gem_id=192964,enchant=devotion_of_haste_3
trinket1=mirror_of_fractured_tomorrows,id=207581,bonus_id=10359/1481
trinket2=neltharions_call_to_suffering,id=204211,bonus_id=10359/1495/10884
main_hand=fyralath_the_dreamrender,id=206448,bonus_id=1507/10884,enchant=rune_of_the_fallen_crusader
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
deathknight=DF4_Death_Knight_Unholy
level=70
race=human
role=attack
position=back
spec=unholy
talents=BwPAAAAAAAAAAAAAAAAAAAAAAAAIkkQiIRESSECJJJRAAAAAAAAAgCJRISSaAASIFRSSikE

head=piercing_gaze_of_the_risen_nightmare,id=217223,bonus_id=10359/1488/10884/6935,gem_id=192988,enchant=incandescent_essence
neck=torc_of_passed_time,id=201759,bonus_id=10249/10359/9405/8932/8960/8782,gem_id=192964/192964/192964,crafted_stats=32/36
shoulders=skewers_of_the_risen_nightmare,id=217225,bonus_id=10359/1488/10884
back=voice_of_the_silent_star,id=204465,bonus_id=10359/1495/10884
chest=breastplate_of_soaring_terror,id=193753,bonus_id=10359/1488/10884,enchant=waking_stats_3
wrists=primal_molten_vambraces,id=190502,bonus_id=10249/10359/9405/8932/6935/8960,gem_id=192964,crafted_stats=36/40
hands=thorns_of_the_risen_nightmare,id=217222,bonus_id=10359/1488/10884
waist=recycled_golemskin_waistguard,id=204400,bonus_id=10359/1488/10884/6935,gem_id=192964,enchant=shadowed_belt_clasp_3
legs=greaves_of_the_risen_nightmare,id=217224,bonus_id=10359/1488/10884,enchant=lambent_armor_kit_3
feet=fused_obsidian_sabatons,id=207156,bonus_id=10359/1488/10884
finger1=seal_of_diurnas_chosen,id=195480,bonus_id=10359/1488/10884/6935,gem_id=192964,enchant=devotion_of_versatility_3
finger2=seal_of_filial_duty,id=195526,bonus_id=10359/1495/10884/6935,gem_id=192964,enchant=devotion_of_haste_3
trinket1=mirror_of_fractured_tomorrows,id=207581,bonus_id=10359/1481
trinket2=neltharions_call_to_suffering,id=204211,bonus_id=10359/1495/10884
main_hand=fyralath_the_dreamrender,id=206448,bonus_id=1507/10884,enchant=rune_of_the_fallen_crusader
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Lib with World of Warcraft game data for simulations and some input checks for SimulationCraft.
simc-support~=10.2.0.0
simc-support~=10.2.6.0
requests
# load special cases
pyyaml

0 comments on commit 9d76411

Please sign in to comment.