示例#1
0
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()
示例#2
0
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)