class Gala_Cat_Sith(DragonBase): MAX_TRICKERY = 14 def oninit(self, adv): super().oninit(adv) adv.trickery = Gala_Cat_Sith.MAX_TRICKERY threshold = 25 self.trickery_buff = SingleActionBuff('d_trickery_buff', 1.80, 1, 's', 'buff').on() def add_trickery(t): adv.trickery = min(adv.trickery+t, Gala_Cat_Sith.MAX_TRICKERY) log('debug', 'trickery', f'+{t}', adv.trickery, adv.hits) def check_trickery(e=None): if adv.trickery > 0 and not self.trickery_buff.get(): adv.trickery -= 1 log('debug', 'trickery', '-1', adv.trickery) self.trickery_buff.on() def shift_end_trickery(e=None): if not adv.dragonform.is_dragondrive: add_trickery(8) adv.Event('dragon_end').listener(shift_end_trickery) if adv.condition('always connect hits'): add_combo_o = adv.add_combo self.thit = 0 def add_combo(name='#'): result = add_combo_o(name) n_thit = adv.hits // threshold if n_thit > self.thit: add_trickery(1) self.thit = n_thit check_trickery() return result adv.add_combo = add_combo
class Damaged_Buff(BuffingAbility): def __init__(self, name, value, duration=15, cooldown=5): super().__init__(name, value, duration, cooldown) def oninit(self, adv, afrom=None): if adv.nihilism: return from core.modifier import SingleActionBuff if self.buff_args[1] == "fs": self.damaged_buff = SingleActionBuff(*self.buff_args) def l_damaged_buff(e): if e.delta < 0 and e.source != "dot": self.damaged_buff.on() else: def l_damaged_buff(e): if e.delta < 0 and e.source != "dot" and adv.is_set_cd( afrom, self.cooldown): adv.Buff(*self.buff_args).on() adv.Event("hp").listener(l_damaged_buff)
class Damaged_Buff(BuffingAbility): def oninit(self, adv, afrom=None): from core.modifier import SingleActionBuff self.damaged_buff = SingleActionBuff(*self.buff_args) def l_damaged_buff(e): if e.delta < 0: self.damaged_buff.on() adv.Event('hp').listener(l_damaged_buff)
class Damaged_Buff(BuffingAbility): def oninit(self, adv, afrom=None): from core.modifier import SingleActionBuff if self.buff_args[1] == 'fs': self.damaged_buff = SingleActionBuff(*self.buff_args) def l_damaged_buff(e): if e.delta < 0: self.damaged_buff.on() else: self.is_cd = False def cd_end(t): self.is_cd = False def l_damaged_buff(e): if not self.is_cd and e.delta < 0: adv.Buff(*self.buff_args).on() self.is_cd = True adv.Timer(cd_end).on(5) # ycass adv.Event('hp').listener(l_damaged_buff)
class Gala_Cat_Sith(DragonBase): MAX_TRICKERY = 14 def oninit(self, adv): super().oninit(adv) adv.trickery = Gala_Cat_Sith.MAX_TRICKERY if not adv.nihilism: threshold = 25 self.trickery_buff = SingleActionBuff("d_trickery_buff", 1.80, 1, "s", "buff").on() def add_trickery(t): adv.trickery = min(adv.trickery + t, Gala_Cat_Sith.MAX_TRICKERY) log("debug", "trickery", f"+{t}", adv.trickery, adv.hits) def check_trickery(e=None): if adv.trickery > 0 and not self.trickery_buff.get(): adv.trickery -= 1 log("debug", "trickery", "-1", adv.trickery) self.trickery_buff.on() def shift_end_trickery(e=None): if not adv.dragonform.is_dragondrive: add_trickery(8) Event("dragon_end").listener(shift_end_trickery) if adv.condition("always connect hits"): add_combo_o = adv.add_combo self.thit = 0 def add_combo(name="#"): result = add_combo_o(name) n_thit = adv.hits // threshold if n_thit > self.thit: add_trickery(1) self.thit = n_thit check_trickery() return result adv.add_combo = add_combo