Пример #1
0
 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)
Пример #2
0
 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
Пример #3
0
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)
Пример #4
0
    def oninit(self, adv):
        super().oninit(adv)
        adv.styx_spirit = 0
        adv.csd_buff = SingleActionBuff('d_compounding_sd', 0.0, -1, 's',
                                        'buff')

        def add_csd(e):
            if not adv.csd_buff.get():
                adv.csd_buff.set(min(2.00, adv.csd_buff.get() + 0.50))
                adv.csd_buff.on()
            else:
                adv.csd_buff.value(min(2.00, adv.csd_buff.get() + 0.50))

        csd_timer = Timer(add_csd, 15, True).on()

        def add_spirit(e):
            if e.index == 3:
                adv.styx_spirit = min(3, adv.styx_spirit + 1)
                log('dx_spirit', adv.styx_spirit)

        adv.Event('dx').listener(add_spirit)

        def reset_spirit(e):
            adv.styx_spirit = 0

        adv.Event('ds').listener(reset_spirit)
        adv.Event('dragon_end').listener(reset_spirit)
Пример #5
0
    def oninit(self, adv):
        super().oninit(adv)
        adv.styx_spirit = 0
        adv.csd_buff = SingleActionBuff("d_compounding_sd", 0.0, -1, "s",
                                        "buff")

        def add_csd(e):
            if not adv.csd_buff.get():
                adv.csd_buff.set(min(2.00, adv.csd_buff.get() + 0.50))
                adv.csd_buff.on()
            else:
                adv.csd_buff.value(min(2.00, adv.csd_buff.get() + 0.50))

        csd_timer = Timer(add_csd, 15, True).on()

        def add_spirit(e):
            if e.index == 3:
                adv.styx_spirit = min(3, adv.styx_spirit + 1)
                log("dx_spirit", adv.styx_spirit)

        Event("dx").listener(add_spirit)

        def reset_spirit(e):
            adv.styx_spirit = 0

        Event("ds").listener(reset_spirit)
        Event("dragon_end").listener(reset_spirit)
Пример #6
0
 def oninit(self, adv):
     super().oninit(adv)
     adv.trickery = Gala_Cat_Sith.MAX_TRICKERY
     if not adv.nihilism:
         self.thit = 0
         self.trickery_buff = SingleActionBuff("d_trickery_buff", 1.80, 1,
                                               "s", "buff").on()
         self.l_hit = Event("hit").listener(self.combo_trickery)
Пример #7
0
 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)
Пример #8
0
    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)
Пример #9
0
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