コード例 #1
0
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
コード例 #2
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