Exemplo n.º 1
0
    protected IEnumerator CastMagicMovingObjectRoutine(MovingObject obj)
    {
        playerAttacking = true;

        StartCoroutine(obj.CastMagic <MovingObject>());
        do
        {
            yield return(null);
        } while (obj.waitAttackingProcess);

        playerAttacking = false;
    }
Exemplo n.º 2
0
    public IEnumerator UseEffect(MovingObject owner)
    {
        isWaitAnimation = true;

        MessageWindow.instance.ConOut(owner.Status.Name + "は" + Profile.Name + "を使った!\n");
        yield return(new WaitForSeconds(0.5f));

        if (Profile.UseEffectTypeValue == ItemProfile.ItemType.NoEffect)
        {
            MessageWindow.instance.ConOut("しかし何も起きなかった…\n");
            Node.UsableTime--;
        }

        if (Profile.UseEffectTypeValue == ItemProfile.ItemType.RecoverLife)
        {
            MessageWindow.instance.ConOut("HPが" + Profile.EffectValue + "回復した!\n");
            owner.RecoverLife(Profile.EffectValue);
            Node.UsableTime--;
        }

        if (Profile.UseEffectTypeValue == ItemProfile.ItemType.GainFood)
        {
            MessageWindow.instance.ConOut("お腹が膨れた!\n");
            Node.UsableTime--;
        }

        if (Profile.UseEffectTypeValue == ItemProfile.ItemType.CastMagic)
        {
            owner.UseMagic = Profile.MagicID;
            StartCoroutine(owner.CastMagic <MovingObject>());
            do
            {
                yield return(null);
            } while (owner.waitAttackingProcess);
            Node.UsableTime--;
        }

        if (owner.GetComponent <Player>())
        {
            owner.GetComponent <Player>().GainFood(Profile.GainFoodValue);
        }

        yield return(new WaitForSeconds(0.5f));

        isWaitAnimation = false;
    }