public void StartMoveEffect(MoveEffects attack)
    {
        switch (attack)
        {
        case MoveEffects.Amplifier:
            audioManager.PlaySoundEffect(SoundEffects.Amplify);
            break;

        case MoveEffects.CrazyStand:
            audioManager.PlaySoundEffect(SoundEffects.CrazyStand);
            break;

        case MoveEffects.Rhythm:
            audioManager.PlaySoundEffect(SoundEffects.Rhythm);
            break;

        case MoveEffects.Stomp:
            audioManager.PlaySoundEffect(SoundEffects.Stomp);
            break;
        }
        if (!movesActive[attack])
        {
            movesActive[attack] = true;

            Image moveImage = activeMovesObject.transform.Find(attack.ToString()).GetComponent <Image>();

            moveImage.transform.DOScale(0f, 0f);
            moveImage.DOFade(1.0f, encounterConstants.moveEffectDuration);
            moveImage.transform.DOScale(1.0f, encounterConstants.moveEffectDuration).SetEase(Ease.InOutBack);
        }
    }
Example #2
0
    IEnumerator RunMoveEffects(MoveEffects Effects, Pokemon source, Pokemon target, MoveTarget moveTarget)
    {
        var effects = Effects;

        if (effects.Boosts != null)
        {
            if (moveTarget == MoveTarget.Self)
            {
                source.ApplyBoosts(effects.Boosts);
            }
            else
            {
                target.ApplyBoosts(effects.Boosts);
            }
        }

        if (effects.Status != StatusID.none)
        {
            target.SetStatus(effects.Status);
        }

        if (effects.VolatileStatus != StatusID.none)
        {
            target.SetVolatileStatus(effects.VolatileStatus);
        }
        yield return(ShowStatChanges(source));

        yield return(ShowStatChanges(target));
    }
Example #3
0
    //moved this out of Runmove as there will hopefully be a lot of stats changes in here in the future
    IEnumerator RunMoveEffects(MoveEffects effects, Creature source, Creature target, MoveTarget moveTarget)
    {
        //var effects = move.Base.Effects;

        //stat boosting
        if (effects.Boosts != null)
        {
            //see if the move is targeting what creature, self boost or decline on enemy
            if (moveTarget == MoveTarget.self)
            {
                source.ApplyBoosts(effects.Boosts);
            }
            else
            {
                target.ApplyBoosts(effects.Boosts);
            }
        }

        //check if this move will cause a status condition
        if (effects.Status != ConditionsID.none)
        {
            target.SetStatus(effects.Status);
        }

        //check if this move will cause a Volitilestatus condition
        if (effects.VolitileStatus != ConditionsID.none)
        {
            target.SetVolitileStatus(effects.VolitileStatus);
        }

        //now we apply the boost we show the status function to either
        yield return(ShowStatusChanges(source));

        yield return(ShowStatusChanges(target));
    }
Example #4
0
    IEnumerator RunMoveEffects(MoveEffects effects, Animal source, Animal target, MoveTarget moveTarget)
    {
        // Stat Boosting
        if (effects.Boosts != null)
        {
            if (moveTarget == MoveTarget.Self)
            {
                source.ApplyBoosts(effects.Boosts);
            }
            else
            {
                target.ApplyBoosts(effects.Boosts);
            }
        }

        //Status Conditions
        if (effects.Status != ConditionID.none)
        {
            target.SetStatus(effects.Status);
        }

        //VolatileStatus Conditions
        if (effects.VolatileStatus != ConditionID.none)
        {
            target.SetVolatileStatus(effects.VolatileStatus);
        }

        yield return(ShowStatusChanges(source));

        yield return(ShowStatusChanges(target));
    }
Example #5
0
    private IEnumerator RunMoveEffects(MoveEffects moveEffects, Monster source, Monster target, MoveTarget moveTarget)
    {
        // Stat Boosting
        if (moveEffects.StatBoosts != null)
        {
            if (moveTarget == MoveTarget.Self)
            {
                source.ApplyStatBoosts(moveEffects.StatBoosts);
            }
            else
            {
                target.ApplyStatBoosts(moveEffects.StatBoosts);
            }
        }

        // Status Condition
        if (moveEffects.Status != ConditionID.None)
        {
            target.SetStatus(moveEffects.Status);
        }

        // Volatile Status Condition
        if (moveEffects.VolatileStatus != ConditionID.None)
        {
            target.SetVolatileStatus(moveEffects.VolatileStatus);
        }

        yield return(ShowStatusChanges(source));

        yield return(ShowStatusChanges(target));
    }
Example #6
0
        private IEnumerator UseMoveEffects(MoveEffects effects, MonsterObj attackingMonster, MonsterObj defendingMonster,
                                           MoveTarget moveTarget)
        {
            // Handle any stat changes.
            if (effects.StatChanges != null)
            {
                if (moveTarget == MoveTarget.Self)
                {
                    attackingMonster.ApplyStatChanges(effects.StatChanges);
                }
                else
                {
                    defendingMonster.ApplyStatChanges(effects.StatChanges);
                }
            }

            // Handle any status conditions.
            if (effects.Status != ConditionID.None)
            {
                defendingMonster.SetStatus(effects.Status);
            }

            // Handle any volatile status conditions.
            if (effects.VolatileStatus != ConditionID.None)
            {
                defendingMonster.SetVolatileStatus(effects.VolatileStatus);
            }

            yield return(ShowStatusChanges(attackingMonster));

            yield return(ShowStatusChanges(defendingMonster));
        }
Example #7
0
    IEnumerator RuneMoveEffects(MoveEffects effects, Pokemon source, Pokemon target, MoveTarget moveTarget) //Creating a function of the Effects move, so we'll call it easyly
    {
        if (effects.Boosts != null)                                                                         //Call for stat boost
        {
            if (moveTarget == MoveTarget.Self)
            {
                source.ApplyBoosts(effects.Boosts);
            }
            else
            {
                target.ApplyBoosts(effects.Boosts);
            }
        }

        //Check from the dictionnary if there are any status condition, and call for status
        if (effects.Status != ConditionID.none)
        {
            target.SetStatus(effects.Status);
        }
        //Same with volatile status
        if (effects.VolatileStatus != ConditionID.none)
        {
            target.SetVolatileStatus(effects.VolatileStatus);
        }

        yield return(ShowStatusChanges(source));

        yield return(ShowStatusChanges(target));
    }
 public PlayerMove(string nameI, string descriptionI, float scoreI, float hypeRateI, int turnLockI, MoveEffects effectI, Color colorI)
 {
     name        = nameI;
     description = descriptionI;
     score       = scoreI;
     hypeRate    = hypeRateI;
     turnLock    = turnLockI;
     effect      = effectI;
     currentLock = 0;
     moveColor   = colorI;
 }
    public void StopMoveEffect(MoveEffects attack)
    {
        if (movesActive[attack])
        {
            audioManager.PlaySoundEffect(SoundEffects.SetFailure);
            movesActive[attack] = false;

            Image moveImage = activeMovesObject.transform.Find(attack.ToString()).GetComponent <Image>();

            moveImage.DOFade(0.0f, encounterConstants.moveEffectDuration);
            moveImage.transform.DOScale(0.0f, encounterConstants.moveEffectDuration).SetEase(Ease.InOutBack);
        }
    }
    public void AnimateEffectAction(MoveEffects attack)
    {
        audioManager.PlaySoundEffect(SoundEffects.MenuSelect);
        if (movesActive[attack])
        {
            Image moveImage = activeMovesObject.transform.Find(attack.ToString()).GetComponent <Image>();
            animateMoveEffects.Complete();

            animateMoveEffects             = DOTween.Sequence();
            moveImage.transform.localScale = Vector3.one;
            moveImage.color = Color.white;

            animateMoveEffects.Insert(0f, moveImage.transform.DOScale(1.2f, encounterConstants.moveAnimateDuration).SetLoops(2, LoopType.Yoyo).SetEase(Ease.InOutBack));
            animateMoveEffects.Insert(0f, moveImage.DOColor(encounterConstants.effectAnimateColor, encounterConstants.moveAnimateDuration).SetLoops(2, LoopType.Yoyo));
        }
    }
    /*
     * Metodo encargado de gestionar los efectos secundarios de los ataques, como bajadas de stats o estados alterados
     */
    IEnumerator RunMoveEffects(MoveEffects effects, Pokemon source, Pokemon target, MoveTarget moveTarget)
    {
        //Boosts
        if (effects.Boosts != null) //de momento solo contemplamos los ataques de estado que implican boosts
        {
            if (moveTarget == MoveTarget.Self)
            {
                source.ApplyBoosts(effects.Boosts);
            }
            else if (moveTarget == MoveTarget.Foe)
            {
                target.ApplyBoosts(effects.Boosts);
            }
        }

        //Status conditions
        if (effects.Status != ConditionID.none)
        {
            //TODO: Estamos suponiendo que el target del status es el enemigo y no uno mismo
            EffectResult result = target.SetStatus(effects.Status);

            if (result == EffectResult.AlreadyOne)
            {
                yield return(dialogBox.TypeDialog($"{source.CurrentMove.Base.Name} had no effect!"));
            }
            else if (result == EffectResult.Inmune)
            {
                yield return(dialogBox.TypeDialog($"{target.Base.Name} it's inmune!"));
            }
        }

        //Volatile Status conditions
        if (effects.VolatileStatus != ConditionID.none)
        {
            //TODO: Estamos suponiendo que el target del status es el enemigo y no uno mismo
            target.SetVolatileStatus(effects.VolatileStatus);
        }

        //Mostramos en el dialogo las bajadas y subidas de stats de ambos pokemons
        yield return(ShowStatusChanges(source));

        yield return(ShowStatusChanges(target));
    }