コード例 #1
0
    async def use(self):
        """
        `coroutine`

        Add a stack to all active acid debuff on the enemy team.

        --

        Return : str
        """

        # init
        move = Move_displayer()
        effect_checker = Effect_checker(self.caster)
        has_unity = False

        acid_ref = await effect_checker.get_effect(1, self.client, self.ctx,
                                                   self.caster, self.team_a,
                                                   self.team_b)

        unity_ref = await effect_checker.get_effect(2, self.client, self.ctx,
                                                    self.caster, self.team_a,
                                                    self.team_b)

        # check if there is a unity buff in the team a
        for ally in self.team_a:
            await asyncio.sleep(0)

            unity_checker = Effect_checker(ally)
            unity = await unity_checker.get_buff(unity_ref)

            if (unity != None):
                has_unity = True
                break

        # now increase the stack of acids
        for enemy in self.team_b:
            await asyncio.sleep(0)

            acid_checker = Effect_checker(enemy)
            acid = await acid_checker.get_debuff(acid_ref)

            if (acid != None):
                await acid.add_stack()

        # set up the move display
        _move = await move.get_new_move()

        _move["name"] = self.name
        _move["icon"] = self.icon
        _move["ki"] = True

        _move = await move.effect_move(_move)

        return (_move)
コード例 #2
0
    async def apply(self):
        """
        `coroutine`

        Add the two stacks to the carrier.

        --

        Return : None
        """

        # init
        if not self.triggered:
            effect_checker = Effect_checker(self.carrier)
            triple_ref = await effect_checker.get_effect(
                6, self.client, self.ctx, self.carrier, self.team_a,
                self.team_b)

            # check if the target already has the buff
            has_triple = await effect_checker.get_buff(triple_ref)

            if (has_triple != None):
                # add 2 stacks
                has_triple.stack += 2

            else:  # doesn't have triple
                triple_ref.stack = 2
                self.carrier.bonus.append(triple_ref)

            self.triggered = True

        return
コード例 #3
0
    async def apply(self):
        """
        `coroutine`

        Applies a buff that makes the carrier gain 5 % of its allied Saibaiman ki power.

        --

        Return : None
        """

        # init
        effect_checker = Effect_checker(self.carrier)
        gather_ref = await effect_checker.get_effect(
            7,
            self.client,
            self.ctx,
            self.carrier,
            self.team_a,
            self.team_b
        )
        
        # check if the target has the buff
        has_gather = await effect_checker.get_buff(gather_ref)

        if(has_gather != None):  # pass, don't re add the buff
            pass 

        else:  # add the buff
            self.carrier.bonus.append(gather_ref)
        
        return
コード例 #4
0
    async def on_remove(self):
        """
        Reset all the acid effects. (Duration and max stacks)
        """

        # now retrieve all the acid effects
        # team b because we reset the effect in the enemy team
        for character in self.team_b:
            await asyncio.sleep(0)

            # init the checker
            checker = Effect_checker(character)
            acid_ref = await checker.get_effect(1, self.client, self.ctx,
                                                character, self.team_a,
                                                self.team_b)
            acid_active = await checker.get_debuff(acid_ref)

            # now reset
            if (acid_active != None):
                # duration
                acid_active.initial_duration = acid_ref.initial_duration
                if (acid_active.duration > acid_ref.initial_duration):
                    acid_active.duration = acid_ref.initial_duration

                # stack
                acid_active.max_stack = acid_ref.max_stack
                if (acid_active.stack > acid_ref.max_stack):
                    acid_active.stack = acid_ref.max_stack

        return
コード例 #5
0
    async def apply(self):
        """
        Applies 2 stacks of acid on the enemy team.
        """

        for enemy in self.team_b:
            await asyncio.sleep(0)

            effect_checker = Effect_checker(enemy)
            acid_ref = await effect_checker.get_effect(1, self.client,
                                                       self.ctx, enemy,
                                                       self.team_a,
                                                       self.team_b)

            # check if the target has acid
            has_acid = await effect_checker.get_debuff(acid_ref)

            if (has_acid !=
                    None):  # add 2 stack of acid to the current acid effect
                await has_acid.add_stack()
                await has_acid.add_stack()

            else:
                await acid_ref.add_stack()
                await acid_ref.add_stack()

        return
コード例 #6
0
    async def apply(self):
        """
        `coroutine`

        Reduces the carrier's spirit amount by 2 %.

        --

        Return : None
        """

        # init
        effect_checker = Effect_checker(self.carrier)
        reduction = int(0.02 * self.carrier.defense.spirit)  # get 2 % of the carrier's spirit
        acid_ref = await effect_checker.get_effect(
            1,
            self.client,
            self.ctx,
            self.carrier,
            self.team_a,
            self.team_b
        )

        carrier_acid = await effect_checker.get_debuff(acid_ref)

        if(carrier_acid != None):
            reduction = int(reduction * carrier_acid.stack)
        
        # reduce the spirit of the carrier
        self.carrier.defense.spirit -= reduction

        return
コード例 #7
0
    async def apply(self):
        """
        `coroutine`

        Add the Red Saibaiman's passive to all the allied Saibaiman.

        --

        Return : None
        """

        # init
        effect_checker = Effect_checker(self.carrier)
        passive_ref = await effect_checker.get_effect(
            10,
            self.client,
            self.ctx,
            self.carrier,
            self.team_a,
            self.team_b
        )

        # add the passive to all the allied saibaiman
        for ally in self.team_a:
            await asyncio.sleep(0)

            if ally.info.id in self.saibaiman_list:
                effect_checker = Effect_checker(ally)
                has_power = await effect_checker.get_buff(passive_ref)

            if(has_power == None):
                new_power = await effect_checker.get_effect(
                    10,
                    self.client,
                    self.ctx,
                    ally,
                    self.team_a,
                    self.team_b
                )
            
                ally.bonus.append(new_power)
        
        return
コード例 #8
0
    async def apply(self):
        """
        `coroutine`

        Heals up the carrier for each acid stacks active on the enemy team.

        -- 

        Return : None
        """

        # init
        checker = Effect_checker(None)
        acid_stacks = 0
        # we don't need to pass the target as we just want to get the acid.id (None)
        acid = await checker.get_effect(1, self.client, self.ctx, self.carrier,
                                        self.team_a, self.team_b)

        # check the enemy team
        for character in self.team_b:
            await asyncio.sleep(0)

            # check if the target has the acid effect on it
            checker = Effect_checker(character)
            _acid = await checker.get_debuff(acid)

            if (_acid != None):
                # count the stacks
                acid_stacks += _acid.stack

                # improve the debuff
                _acid.max_stack = 5
                _acid.initial_duration = 5

        # now heal the carrier
        if (acid_stacks > 0):
            heal = int(acid_stacks * (0.1 * self.carrier.damage.ki_max))
            self.carrier.health.current += heal
            await self.carrier.health.health_limit()

        return
コード例 #9
0
ファイル: acid.py プロジェクト: RvstFyth/discordballz
    async def use(self):
        """
        `coroutine`

        Inflicts damage and applies a dot to the target.

        --

        Return : str
        """

        # init
        await self.caster.posture.change_posture("attacking")

        move = Move_displayer()
        calculator = Damage_calculator(self.caster, self.target)
        checker = Effect_checker(self.target)

        # get the damage
        damage = randint(self.caster.damage.ki_min, self.caster.damage.ki_max)
        damage = int(damage *
                     0.25)  # the ability inflicts only 25 % of the ki damage
        damage = await calculator.ki_damage(damage,
                                            critable=True,
                                            dodgable=True)

        # define move info
        _move = await move.get_new_move()

        _move["name"] = self.name
        _move["icon"] = self.icon
        _move["damage"] = damage["calculated"]
        _move["critical"] = damage["critical"]
        _move["dodge"] = damage["dodge"]
        _move["ki"] = True

        _move = await move.offensive_move(_move)

        # inflict damage
        await self.target.receive_damage(damage["calculated"])

        # add a stack of acid on the target
        _acid = Dot_acid(self.client, self.ctx, self.target, self.team_a,
                         self.team_b)

        await _acid.add_stack()

        return (_move)
コード例 #10
0
    async def use(self):
        """
        `coroutine`

        Applies the Unity is strenght buff on all the allied Saibaimen.

        --

        Return : str
        """

        # init
        await self.caster.posture.change_posture("attacking")
        move = Move_displayer()

        # applies the buff on the team
        for character in self.team_a:
            await asyncio.sleep(0)
            # init
            checker = Effect_checker(character)
            unity_buff = await checker.get_effect(2, self.client, self.ctx,
                                                  character, self.team_a,
                                                  self.team_b)

            ally_buff = None  # check if the ally already has the Unity is strenght active

            character.bonus.append(unity_buff)
            if character.info.id in self.saibaimen:
                # if the ally is a saibaimen
                # applies the buff
                ally_buff = await checker.get_buff(unity_buff)

                if (ally_buff !=
                        None):  # if the ally has the buff, reset duration
                    ally_buff.duration = unity_buff.initial_duration

                else:  # otherwise, add the buff
                    character.bonus.append(unity_buff)

        # setup the move display
        display = await move.get_new_move()
        display["name"] = self.name
        display["icon"] = self.icon
        display["ki"] = True

        display = await move.effect_move(display)

        return (display)
コード例 #11
0
    async def use(self):
        """
        `coroutine`

        Applies the Pilaf Barrier buff on the caster.

        --

        Return : str
        """

        # init
        # change the posture
        move = Move_displayer()
        _move = await move.get_new_move()

        effect_checker = Effect_checker(self.caster)
        barrier_ref = await effect_checker.get_effect(
            5,
            self.client,
            self.ctx,
            self.caster,
            self.team_a,
            self.team_b
        )

        await self.caster.posture.change_posture("defending")

        # first check if the target (caster) already have the buff active
        has_barrier = await effect_checker.get_buff(barrier_ref)

        if(has_barrier != None):
            # just reset the duration
            has_barrier.duration = has_barrier.initial_duration
        
        else:  # if the target doesn't have the buff
            self.caster.bonus.append(barrier_ref)

        # set cooldown
        self.cooldown = 3

        # define the move
        _move["name"] = self.name
        _move["icon"] = self.icon
        
        _move = await move.effect_move(_move)

        return(_move)
コード例 #12
0
    async def use(self):
        """
        `coroutine`

        Consums one stack of Triple pilots to recover health

        --

        Return : str
        """

        # init
        move = Move_displayer()
        heal = 0

        effect_checker = Effect_checker(self.caster)
        triple_ref = await effect_checker.get_effect(6, self.client, self.ctx,
                                                     self.caster, self.team_a,
                                                     self.team_b)

        # check if the caster has the triple pilots buff
        has_triple = await effect_checker.get_buff(triple_ref)

        if (has_triple != None):
            if (has_triple.stack > 0):
                # consum a stack
                has_triple.stack -= 1

                # restore health
                heal = int((30 * self.caster.health.maximum) / 100)
                self.caster.health.current += heal
                await self.caster.health.health_limit()

            if (has_triple.stack <=
                    0):  # the caster doesn't have triple pilots stacks anymore
                self.caster.bonus.remove(has_triple)

        # set up the move
        _move = await move.get_new_move()

        _move["name"], _move["icon"] = self.name, self.icon
        _move = await move.effect_move(_move)

        if (heal > 0):
            _move += f"__Heal__ : **+{heal:,}** :hearts:"

        return (_move)
コード例 #13
0
    async def apply(self):
        """
        Applies the Power charge bonus to the carrier
        """

        # init
        effect_checker = Effect_checker(self.carrier)
        power_ref = await effect_checker.get_effect(10, self.client, self.ctx,
                                                    self.carrier, self.team_a,
                                                    self.team_b)

        # check if the target already has the bonus
        has_power = await effect_checker.get_buff(power_ref)

        if (has_power == None):  # doesn't has the buff, add it
            self.carrier.bonus.append(power_ref)

        return
コード例 #14
0
    async def use(self):
        """
        `coroutine`

        Performs a sequence attack against any enemy

        --

        Return : str
        """

        # init
        await self.caster.posture.change_posture("attacking")

        move = Move_displayer()
        calculator = Damage_calculator(self.caster, self.target)
        checker = Effect_checker(self.target)

        # get the damage
        damage = randint(self.caster.damage.physical_min, self.caster.damage.physical_max)
        damage = await calculator.physical_damage(
            damage,
            critable = True,
            dodgable = True
        )

        # define move info
        _move = await move.get_new_move()

        _move["name"] = self.name
        _move["icon"] = self.icon
        _move["damage"] = damage["calculated"]
        _move["critical"] = damage["critical"]
        _move["dodge"] = damage["dodge"]
        _move["physical"] = True

        _move = await move.offensive_move(_move)

        # inflict damage
        await self.target.receive_damage(damage["calculated"])

        return(_move)
コード例 #15
0
    async def apply(self):
        """
        Add on_death bonus.
        """

        effect_checker = Effect_checker(self.carrier)
        last_will_ref = await effect_checker.get_effect(
            8, self.client, self.ctx, self.carrier, self.team_a, self.team_b)

        # check if the carrier has the buff or not
        has_last_will = False

        for on_death in self.carrier.on_death:
            await asyncio.sleep(0)

            if (on_death.id == last_will_ref.id):
                has_last_will = True

        if not has_last_will:  # if the target doesn't have last will
            self.carrier.on_death.append(last_will_ref)
            self.triggered = True

        return
コード例 #16
0
ファイル: syphon.py プロジェクト: RvstFyth/discordballz
    async def use(self):
        """
        `coroutine`

        See class description.

        --

        Return : str
        """

        # init
        move = Move_displayer()
        effect_checker = Effect_checker(self.target)
        damager = Damage_calculator(self.caster, self.target)

        missing_health = self.target.health.maximum - self.target.health.current
        roll_damage = randint(self.caster.damage.ki_min, self.caster.damage.ki_max)
        damage_done = await damager.ki_damage(
            roll_damage,
            dodgable = True,
            critable = True
        )

        # init the damage done
        damage_done["calculated"] = int(damage_done["calculated"] * 0.1)

        # special effect
        if not damage_done["dodge"]:  # if the damage has not been dodged
            # check if the target has acid stack active on it
            acid = await effect_checker.get_effect(
                1,
                self.client,
                self.ctx,
                self.target,
                self.team_a,
                self.team_b
            )

            has_acid = await effect_checker.get_debuff(acid)

            if(has_acid != None):
                damage_done["calculated"] += int(((2 * missing_health)/100) * has_acid.stack)
                
                # remove the acid debuff to the target
                # consums it
                self.target.malus.remove(has_acid)
            
            else:  # doesn't have acid active on it
                pass
        
        # deal damage to the target
        await self.target.receive_damage(damage_done["calculated"])
        
        # heal the caster
        # of 50 % of damage done
        healing = int(damage_done["calculated"] / 2)
        self.caster.health.current += healing
        await self.caster.health.health_limit()

        # setting up the move    
        _move = await move.get_new_move()
        _move["name"] = self.name
        _move["icon"] = self.icon
        _move["damage"] = damage_done["calculated"]
        _move["critical"] = damage_done["critical"]
        _move["dodge"] = damage_done["dodge"]
        _move["ki"] = True

        _move = await move.offensive_move(_move)

        # healing display
        if(healing > 0):
            _move += f"__Heal__ : +**{healing}** :hearts:\n"

        return(_move)
コード例 #17
0
    async def use(self):
        """
        `coroutine`

        Applies the Paralyzing debuff on the target.

        If the target already has the debuff : reset the duration

        --

        Return : str
        """

        # init
        effect_checker = Effect_checker(self.target)
        move = Move_displayer()
        _move = ""

        has_paralyzing = None
        has_acid = None

        # effect reference
        acid_ref = await effect_checker.get_effect(1, self.client, self.ctx,
                                                   self.target, self.team_a,
                                                   self.team_b)

        paralyzing_ref = await effect_checker.get_effect(
            4, self.client, self.ctx, self.target, self.team_a, self.team_b)

        # set up the move
        _move = await move.get_new_move()

        _move["name"] = self.name
        _move["icon"] = self.icon
        _move["ki"] = True

        _move = await move.effect_move(_move)

        # check if the target has acid stack active
        has_acid = await effect_checker.get_debuff(acid_ref)

        if (has_acid != None):
            # get the amount of acid's stack the target has
            acid_stack = has_acid.stack

            # check if the target has 3 or more active stacks
            if (acid_stack >= 3):
                # check if the target has an active paralyzing burns
                has_paralyzing = await effect_checker.get_debuff(paralyzing_ref
                                                                 )

                if (has_paralyzing != None):
                    # reset the duration
                    if (acid_stack == 3):
                        has_paralyzing.initial_duration = 2
                        has_paralyzing.duration = has_paralyzing.initial_duration

                    elif (acid_stack > 3):
                        has_paralyzing.initial_duration = 4
                        has_paralyzing.duration = has_paralyzing.initial_duration

                else:  # the target doesn't have paralyzing burns active on it
                    # set the duration of the stun
                    if (acid_stack == 3):
                        paralyzing_ref.initial_duration = 2
                        paralyzing_ref.duration = paralyzing_ref.initial_duration

                    elif (acid_stack > 3):
                        paralyzing_ref.initial_duration = 4
                        paralyzing_ref.duration = paralyzing_ref.initial_duration

                    # apply the debuff on the target
                    self.target.malus.append(paralyzing_ref)

                # consums all the acid stacks
                self.target.malus.remove(has_acid)

            else:  # the target has less that 3 acid stacks
                pass

        else:
            # the target doesn't have acid stack, don't do nothing
            pass

        return (_move)
コード例 #18
0
ファイル: dot_acid.py プロジェクト: RvstFyth/discordballz
    async def add_stack(self):
        # init
        checker = Effect_checker(self.target)
        unity = False

        _acid = await checker.get_effect(1, self.client, self.ctx, self.target,
                                         self.team_a, self.team_b)

        # check if the target already has acid on it
        has_acid = await checker.get_debuff(self)

        # look for someone in the team_a who has the unity is strength buff
        for ally in self.team_a:
            await asyncio.sleep(0)

            # get the character
            checker = Effect_checker(ally)

            unity_buff = await checker.get_effect(2, self.client, self.ctx,
                                                  ally, self.team_a,
                                                  self.team_b)

            if (ally != None):
                if ally.info.id in self.saibaiman_id:
                    _unity = await checker.get_buff(unity_buff)

                    if (_unity != None):  # if someone has the buff active
                        unity = True
                        break

        # increase acid stack
        # get existing acid stack
        if (has_acid != None):  # if the target already has the effect on it
            _acid = has_acid
            self.target.malus.remove(_acid)

            # increase only if the max stack hasn't been reached
            if (_acid.stack < _acid.max_stack):
                if (unity):  # if an ally has the unity buff
                    _acid.stack += 2

                    if (_acid.stack > _acid.max_stack):
                        _acid.stack = _acid.max_stack

                    _acid.duration = _acid.initial_duration

                else:  # if no unity in the team
                    _acid.stack += 1
                    _acid.duration = _acid.initial_duration

            _acid.duration = _acid.initial_duration

            # add or re-add the malus
            self.target.malus.append(_acid)

        else:  # if the target doesn't have acid on it
            if (unity):
                _acid.stack = 2
                _acid.initial_duration = 5

                await _acid.set_damage()

            else:
                _acid.stack = 1

                await _acid.set_damage()

            # add or re-add the malus
            self.target.malus.append(_acid)

        return
コード例 #19
0
    async def use(self):
        """
        `coroutine`

        Inflicts 50 % of the caster's ki damage to the target.

        If the target has at least 3 stacks of acid, splashes it onto all of the target's team members.

        Applies the Acid explosion debuff that increases the ki damages that they take by 2 %.

        --

        Return : str
        """

        # init
        move = Move_displayer()
        effect_checker = Effect_checker(self.target)
        damage_calculator = Damage_calculator(self.caster, self.target)

        # debuff
        acid_ref = await effect_checker.get_effect(1, self.client, self.ctx,
                                                   self.target, self.team_a,
                                                   self.team_b)

        explosion_ref = await effect_checker.get_effect(
            3, self.client, self.ctx, self.target, self.team_a, self.team_b)

        # set the damage
        damage = randint(self.caster.damage.ki_min, self.caster.damage.ki_max)
        damage /= 2  # 50 % of the ki damage
        damage = await damage_calculator.ki_damage(damage, critable=True)

        # check if the target has acid
        has_acid = await effect_checker.get_debuff(acid_ref)

        if (has_acid != None):  # the target has an acid dot active on it
            # now check if the target has at least 3 stacks of acid
            if (has_acid.stack >= 3):
                # spread the dot onto the enemy members

                for unit in self.team_b:
                    await asyncio.sleep(0)

                    # init
                    effect_checker = Effect_checker(unit)

                    # check if the unit has acid stack
                    unit_has_acid = await effect_checker.get_debuff(acid_ref)

                    if (unit_has_acid != None):
                        await unit_has_acid.add_stack()
                        unit_has_acid.duration = unit_has_acid.initial_duration

                    else:  # the unit doesn't have acid active on it
                        # create a new acid instance for the target
                        unit_acid = await effect_checker.get_effect(
                            1, self.client, self.ctx, unit, self.team_a,
                            self.team_b)
                        # applies the new acid instance
                        await unit_acid.add_stack()

        # now check if the target already have explosion debuff active
        has_explosion = await effect_checker.get_debuff(explosion_ref)

        if (has_explosion != None):
            # reset the duration
            has_explosion.duration = has_explosion.initial_duration

        else:
            self.target.malus.append(explosion_ref)

        # setting up the move display
        _move = await move.get_new_move()

        _move["name"] = self.name
        _move["icon"] = self.icon
        _move["damage"] = damage["calculated"]
        _move["critical"] = damage["critical"]
        _move["dodge"] = damage["dodge"]
        _move["ki"] = True

        _move = await move.offensive_move(_move)

        return (_move)