def test_get_cast_query_spells(self): #inputs spells = [WowSpell(spell_id=101), WowSpell(spell_id=102)] # run and test q = self.actor.get_cast_query(spells) assert q == "type='cast' and ability.id in (101,102)"
def test_get_buff_query_spells(self): #inputs spells = [WowSpell(spell_id=101), WowSpell(spell_id=102)] expected = "type in ('applybuff','removebuff','applydebuff','removedebuff') and ability.id in (101,102)" # run and test q = self.actor.get_buff_query(spells) assert q == expected
def setUp(self): self.boss = warcraftlogs_boss.Boss() # setup an example boss self.example_boss = mock.MagicMock() self.example_boss.spells = [ WowSpell(spell_id=101), WowSpell(spell_id=102) ] self.example_boss.buffs = [ WowSpell(spell_id=201), WowSpell(spell_id=202) ]
def add_buff(self, spell_id, **kwargs) -> WowSpell: kwargs.setdefault("spell_type", self.full_name_slug) spell = WowSpell(spell_id=spell_id, **kwargs) self.buffs.append(spell) return spell
def add_spell(self, **kwargs): kwargs.setdefault("color", self.color) kwargs.setdefault("spell_type", self.name_slug) spell = WowSpell(**kwargs) self.spells.append(spell) return spell
def add_debuff(self, spell: WowSpell = None, **kwargs): if not spell: kwargs.setdefault("color", self.color) kwargs.setdefault("spell_type", self.name_slug) spell = WowSpell(**kwargs) self.debuffs.append(spell)
def add_spell(self, spell: WowSpell = None, **kwargs): if not spell: kwargs.setdefault("color", self.wow_class.color) kwargs.setdefault("spell_type", self.full_name_slug) spell = WowSpell(**kwargs) self.spells.append(spell) # Important to keep a ref in memory return spell
def add_buff(self, spell: WowSpell = None, **kwargs): if not spell: kwargs.setdefault("color", self.wow_class.color) kwargs.setdefault("spell_type", self.full_name_slug) spell = WowSpell(**kwargs) self.buffs.append(spell) return spell
def setUp(self): self.player = warcraftlogs_actor.Player( spec_slug=MOCK_SPEC.full_name_slug ) self.spells = [WowSpell(spell_id=101)] self.cast_query_patch = mock.patch("lorgs.models.warcraftlogs_actor.BaseActor.get_cast_query") self.cast_query_mock = self.cast_query_patch.start() self.cast_query_mock.return_value = "CAST_QUERY" self.buff_query_patch = mock.patch("lorgs.models.warcraftlogs_actor.BaseActor.get_buff_query") self.buff_query_mock = self.buff_query_patch.start() self.buff_query_mock.return_value = "BUFF_QUERY"
def add_event( self, **kwargs ): # event_type, spell_id, name: str, icon: str, duration: int = 0): kwargs.setdefault("event_type", "cast") # track the event (for query) self.events.append(kwargs) # dedicated "stop" event, for events with non static timers.. eg: intermissions end_event = kwargs.get("until", {}) if end_event: self.events.append(end_event) # spell instance used for UI things kwargs.setdefault("spell_type", self.full_name_slug) spell = WowSpell(**kwargs) spell.specs = [self] self.event_spells.append(spell)
# DRUID_BALANCE = WowSpec(role=RDPS, wow_class=DRUID, name="Balance") DRUID_FERAL = WowSpec(role=MDPS, wow_class=DRUID, name="Feral") DRUID_GUARDIAN = WowSpec(role=TANK, wow_class=DRUID, name="Guardian") DRUID_RESTORATION = WowSpec(role=HEAL, wow_class=DRUID, name="Restoration", short_name="Resto") ################################################################################ # Spells # DRUID.add_spell( spell_id=323764, cooldown=60, duration=4, color=COL_NF, name="Convoke the Spirits", icon="ability_ardenweald_druid.jpg") DRUID.add_spell( spell_id=323546, cooldown=180, duration=20, color=COL_VENTR, name="Ravenous Frenzy", icon="ability_revendreth_druid.jpg", show=False) # Defensives DRUID.add_spell( spell_id=22812, cooldown=60, duration=12, name="Barkskin", icon="spell_nature_stoneclawtotem.jpg", show=False) BEAR_FORM = WowSpell(spell_id=5487, name="Bear Form", icon="ability_racial_bearform.jpg", show=False) BEAR_FORM.spell_type = DRUID.name_slug BEAR_FORM.color = DRUID.color DRUID_BALANCE.add_buff(BEAR_FORM) DRUID_FERAL.add_buff(BEAR_FORM) DRUID_RESTORATION.add_buff(BEAR_FORM) # Offensive DRUID_BALANCE.add_spell( spell_id=194223, cooldown=180, duration=20, name="Celestial Alignment", icon="spell_nature_natureguardian.jpg") DRUID_BALANCE.add_spell( spell_id=102560, cooldown=180, duration=30, name="Incarnation: Chosen of Elune", icon="spell_druid_incarnation.jpg") DRUID_BALANCE.add_spell( spell_id=205636, cooldown=60, duration=10, name="Force of Nature", icon="ability_druid_forceofnature.jpg", show=False) DRUID_BALANCE.add_spell( spell_id=202770, cooldown=60, duration=8, name="Fury of Elune", icon="ability_druid_dreamstate.jpg", show=False) DRUID_FERAL.add_spell( spell_id=106951, cooldown=180, duration=15, name="Berserk", icon="ability_druid_berserk.jpg") DRUID_FERAL.add_spell( spell_id=58984, cooldown=120, color="#999999", name="Shadowmeld ", icon="ability_ambush.jpg", show=False)
def test_spell_ids(): spells = [WowSpell(spell_id=5), WowSpell(spell_id=3), WowSpell(spell_id=10)] result = WowSpell.spell_ids(spells) assert result == [3, 5, 10]
def test_is_healing_cooldown__other(): spell = WowSpell(spell_id=5) assert spell.is_healing_cooldown() == True
def test_is_healing_cooldown__personal(): spell = WowSpell(spell_id=5, spell_type=WowSpell.TYPE_PERSONAL) assert spell.is_healing_cooldown() == False
def test_is_healing_cooldown__item_spell(): spell = WowSpell(spell_id=5, spell_type=WowSpell.TYPE_TRINKET) assert spell.is_healing_cooldown() == False
def test_is_item_spell__false(): spell = WowSpell(spell_id=5) assert spell.is_item_spell() == False
def add_cast(self, **kwargs) -> WowSpell: kwargs.setdefault("spell_type", self.full_name_slug) spell = WowSpell(**kwargs) self.spells.append(spell) return spell
icon="spell_shadow_summonfelguard.jpg") WARLOCK_DEMONOLOGY.add_spell(spell_id=264119, cooldown=45, duration=15, color="#69b851", name="Summon Vilefiend", icon="inv_argusfelstalkermount.jpg") WARLOCK_DEMONOLOGY.add_spell(spell_id=267217, cooldown=180, duration=15, name="Nether Portal", icon="inv_netherportal.jpg") WARLOCK_DESTRUCTION.add_spell(spell_id=1122, cooldown=180, duration=30, color="#91c45a", name="Summon Infernal", icon="spell_shadow_summoninfernal.jpg") WARLOCK_DESTRUCTION.add_spell(spell_id=113858, cooldown=120, duration=20, color="#c35ec4", name="Dark Soul: Instability", icon="spell_warlock_soulburn.jpg") # Additional Spells (not tracked) SOULSTONE_RESURRECTION = WowSpell(spell_id=95750, name="Soulstone", icon="spell_shadow_soulgem.jpg")
from lorgs.data.classes import * from lorgs.models.wow_spell import WowSpell, EventType maxilvl = "&ilvl=278" mythic = "&bonus=6646" TYPE_TRINKET = WowSpell.TYPE_TRINKET ######################################################################################################################## #### Dungeons #### RUBY = WowSpell(spell_type=TYPE_TRINKET, spell_id=345801, cooldown=120, duration=15, color="#c23636", name="Soulletting Ruby", icon="inv_jewelcrafting_livingruby_01.jpg", wowhead_data=f"item=178809{mythic}{maxilvl}") POWER_CRYSTAL = WowSpell(spell_type=TYPE_TRINKET, spell_id=329831, cooldown=90, duration=15, color="#955fc7", name="Overwhelming Power Crystal", icon="spell_mage_focusingcrystal.jpg", wowhead_data=f"item=179342{mythic}{maxilvl}") # Dungeon IQD = WowSpell(spell_type=TYPE_TRINKET, spell_id=330323,
icon="ability_deathknight_pillaroffrost.jpg", show=False) DEATHKNIGHT_FROST.add_spell(spell_id=46585, cooldown=120, duration=60, color="#c7ba28", name="Raise Dead", icon="inv_pet_ghoul.jpg", show=False) DEATHKNIGHT_FROST.add_spell(spell_id=47568, cooldown=120, duration=20, color="#88e8f2", name="Empower Rune Weapon", icon="inv_sword_62.jpg") DEATHKNIGHT_FROST.add_spell(spell_id=152279, cooldown=120, duration=30, color="#52abff", name="Breath of Sindragosa", icon="spell_deathknight_breathofsindragosa.jpg") DEATHKNIGHT_FROST.add_spell(spell_id=279302, cooldown=180, name="Frostwyrm's Fury", icon="achievement_boss_sindragosa.jpg") # Additional Spells (not tracked) RAISE_ALLY = WowSpell(spell_id=61999, name="Raise Ally", icon="spell_shadow_deadofnight.jpg")
def test_spell_ids_str(): spells = [WowSpell(spell_id=5), WowSpell(spell_id=3), WowSpell(spell_id=10)] result = WowSpell.spell_ids_str(spells) assert result == "3,5,10"
show=False) # Defensive MONK.add_spell(spell_id=122278, cooldown=120, duration=10, color="#fcba03", name="Dampen Harm", icon="ability_monk_dampenharm.jpg", show=False) # MW and WW get a reduced CD with rank2 FORT_BREW = WowSpell(spell_type=MONK.name_slug, spell_id=243435, cooldown=180, duration=15, color="#ffb145", name="Fortifying Brew", icon="ability_monk_fortifyingale_new.jpg", show=False) DIFFUSE = WowSpell(spell_type=MONK.name_slug, spell_id=122783, cooldown=90, duration=6, color=MONK.color, name="Diffuse Magic", icon="spell_monk_diffusemagic.jpg", show=False) MONK_MISTWEAVER.add_spells(FORT_BREW, DIFFUSE) MONK_WINDWALKER.add_spells(FORT_BREW, DIFFUSE)
def test_is_item_spell__true(): spell = WowSpell(spell_id=5, spell_type=WowSpell.TYPE_TRINKET) assert spell.is_item_spell() == True