def oninit(self, adv): super().oninit(adv) from core.advbase import Selfbuff, Event, Timer self.csd_buff = Selfbuff('d_compounding_sd', 0.0, -1, 's', 'buff').on() self.csd_stack = 0 self.csd_timer = Timer(self.add_csd, 15, True).on() Event('s').listener(self.reset_csd)
def on(self, name, rate, duration=None): p = super().on(name, rate, duration) if p: # from core.advbase import Debuff # Debuff('{}_bog'.format(name),-0.5*p,self.duration,1,'att','bog').on() from core.advbase import Selfbuff buff = Selfbuff('{}_bog'.format(name), 0.5 * p, self.duration, 'att', 'bog') buff.bufftime = buff.nobufftime buff.on() return p
def on(self, name, rate, duration=None): self.event.source = name p = super().on(name, rate, duration) if p: # from core.advbase import Debuff # Debuff('{}_bog'.format(name),-0.5*p,self.duration,1,'att','bog').on() from core.advbase import Selfbuff bog = Selfbuff('{}_bog'.format(name), 0.5 * p, self.duration, 'att', 'bog').no_bufftime() bog.bufftype = 'bog' bog.on() return p
def oninit(self, adv, afrom=None): from core.advbase import Selfbuff, Spdbuff self.atk_buff = Selfbuff(f'{self.name}_att',self.att,-1,'att','passive') self.spd_buff = Spdbuff(f'{self.name}_spd',self.spd,-1) def l_cas_buff(e): if e.hp <= 30: self.atk_buff.on() self.spd_buff.on() else: self.atk_buff.off() self.spd_buff.off() adv.Event('hp').listener(l_cas_buff)
def dmg_before(self, name): hpold = self.hp super().dmg_before(name) if self.ro_charges > 0 and hpold > 30 and self.hp < 30: Selfbuff('resilient_offense',0.10, -1).on() self.comment += ' {}s'.format(round(now())) self.ro_charges -= 1
def oninit(self, adv): super().oninit(adv) from core.advbase import Selfbuff, Timer self.flower_buffs = { idx: Selfbuff(f'sakuya_flower_{idx}', *args) for idx, args in self.flower_buff_values.items() } self.flower_stack = 0 self.add_flower() Timer(self.add_flower, 60, True).on()
class Crisis_Att_Spd(Ability): BUFF_LEVEL = { 2: (0.15, 0.10), 3: (0.20, 0.10) } def __init__(self, name, lvl): self.att, self.spd = Crisis_Att_Spd.BUFF_LEVEL[lvl] super().__init__(name) def oninit(self, adv, afrom=None): from core.advbase import Selfbuff, Spdbuff self.atk_buff = Selfbuff(f'{self.name}_att',self.att,-1,'att','passive') self.spd_buff = Spdbuff(f'{self.name}_spd',self.spd,-1) def l_cas_buff(e): if e.hp <= 30: self.atk_buff.on() self.spd_buff.on() else: self.atk_buff.off() self.spd_buff.off() adv.Event('hp').listener(l_cas_buff)
class Styx(DragonBase): ele = 'water' att = 125 a = [] dragonform = { 'act': 'c3 c3 c3 s', 'dx1.dmg': 1.80, 'dx1.startup': 15 / 60.0, # c1 frames 'dx1.hit': 1, 'dx2.dmg': 1.95, 'dx2.startup': 48 / 60.0, # c2 frames 'dx2.hit': 1, 'dx3.dmg': 0.84, 'dx3.startup': 46 / 60.0, # c3 frames 'dx3.recovery': 55 / 60.0, # recovery 'dx3.hit': 1, 'ds.dmg': 0, 'ds.recovery': 150 / 60, # skill frames 'ds.hit': 0, 'dodge.startup': 40 / 60, # dodge frames } csd_stack = 0 def ds_proc(self): # 7 10 13 16 spirit = self.adv.dragonform.act_sum[self.count_from:].count('c3') dmg = self.adv.dmg_make('ds', 0.90 * spirit * 3 + 7, 's') self.adv.hits += spirit * 3 + 7 self.count_from = len(self.adv.dragonform.act_sum) return dmg def oninit(self, adv): super().oninit(adv) from core.advbase import Selfbuff, Event, Timer self.csd_buff = Selfbuff('d_compounding_sd', 0.0, -1, 's', 'buff').on() self.csd_stack = 0 self.csd_timer = Timer(self.add_csd, 15, True).on() self.count_from = 0 Event('s').listener(self.reset_csd) def add_csd(self, t): self.csd_stack = min(self.csd_stack + 1, 4) self.update_csd() def reset_csd(self, e): if self.csd_stack > 0 and e.name in self.csd_buff.modifier._static.damage_sources or ( hasattr(e, 'damage') and e.damage): self.csd_stack = 0 self.update_csd() def update_csd(self): self.csd_buff.off() if self.csd_stack > 0: self.csd_buff.value(0.50 * self.csd_stack) self.csd_buff.on()
def ds_proc(self): from core.advbase import Selfbuff dmg = self.adv.dmg_make('ds', 7.50, 's') Selfbuff('ds', 0.20, 20, 'att', 'buff').on() return dmg