예제 #1
0
    //Reverse the effect of this StatEffect
    //  Pre: PKMNEntity effected is not null and is active in the game
    //  Post: Reverses all of the effects using the reciprocal of the factor
    public void reverseEffect(PKMNEntity effected)
    {
        for (int i = 0; i < statsEffected.Length; i++)
        {
            int curStat = statsEffected[i];

            if (curStat < BaseStat.BASE_STATS_LENGTH)
            {
                effected.changeStat(1 / statFactor[i], statsEffected[i]);
            }
            else
            {
                effected.poisonUnit(-1 * statFactor[i]);
            }
        }
    }
예제 #2
0
    //Applies stat effect to effected entity
    //  Pre: PKMNEntity Effected is not null
    //  Post: PKMNEntity stats are changed in accordance with statsEffected
    public void applyEffect(PKMNEntity effected)
    {
        effected.addStatQ(this);

        for (int i = 0; i < statsEffected.Length; i++)
        {
            int curStat = statsEffected[i];

            if (curStat < BaseStat.BASE_STATS_LENGTH)
            {
                effected.changeStat(statFactor[i], statsEffected[i]);
            }
            else
            {
                effected.poisonUnit(statFactor[i]);
            }
        }
    }
예제 #3
0
    //Revert effects method: reverses stat effect on enemies with target tag
    public void revertEffects(Collider2D effected)
    {
        PKMNEntity effectedEntity = effected.GetComponent <PKMNEntity>();

        effectedEntity.changeStat(1 / statFactor, statType);
    }
예제 #4
0
    //Upon exiting tile, reverse slow on entity
    void OnTriggerExit2D(Collider2D collider) {
        PKMNEntity fighter = collider.GetComponent<PKMNEntity>();

        if(fighter != null)
            fighter.changeStat(1 / slowFactor, BaseStat.SPEED);
    }