Esempio n. 1
0
 protected void SetMotionAndDurationAndUseHPSP(AAnimal myself)
 {
     myself.UseHPSP(HPCost, SPCost, HPPercentCost, SPPercentCost);
     myself.GetAnimator().SetInteger("ActionCode", actioncode);
     myself.StartCoroutine(myself.DoingAction(duration));
 }
Esempio n. 2
0
    public void Charge(AAnimal myself)
    {
        if (Charged) { }
        else
        {
            if (IsCharging) { }
            else
            {
                SetParamsNeedAnimal(myself);
                chargeCount++;
                myself.GetAnimator().SetInteger("ActionCode", actioncode);
                if (ChargeCount >= ChargeLimit)
                {
                    charged = true;
                    GameObject ef = (GameObject)Instantiate(Resources.Load("Prefabs/Effects/Utilities/Charged"), myself.nextPOS + Vector3.up, Quaternion.identity);
                    ef.GetComponent<EffectManager>().Go();
                    Debug.Log("Charged!");
                }
                else if (ChargeCount % ChargeSpan == 0) { ChargingAction(myself); }
                if (ChargeCount == 1) { }
                else { myself.UseHPSP(HPCost, SPCost, HPPercentCost, SPPercentCost); }

                StartCoroutine(chargedCD(CastTime));
            }
        }
    }
Esempio n. 3
0
    public override void Action(AAnimal myself)
    {
        duration = 0.0f;
        runRouteForReal = new Vector3[runStep];
        spCost = 1 * runStep;
        float speed = 1.0f;
        if (myself.MovementSpeed * myself.MovementBurst == 0) { }
        else { speed = myself.MovementSpeed * myself.MovementBurst; }

        for (int i = 1; i <= runRouteForReal.Length; i++)
        {
            duration += runLength[i] / speed;
            runRouteForReal[i - 1] = runRouteForCalc[i];
        }

        myself.POS = myself.nextPOS;
        myself.nextPOS = runRouteForReal[runStep - 1];
        if (runRouteForReal.Length == 1)
        {
            iTween.MoveTo(myself.gameObject,
                iTween.Hash("position", runRouteForReal[0], "time", duration, "easetype", "linear"));
        }
        else
        {
            iTween.MoveTo(myself.gameObject,
                iTween.Hash("path", runRouteForReal, "time", duration, "easetype", "linear"));
        }
        myself.GetAnimator().SetFloat("Speed", speed);
        myself.GetAnimator().SetInteger("ActionCode", actioncode);
        myself.UseHPSP(HPCost, SPCost, HPPercentCost, SPPercentCost);
        myself.StartCoroutine(myself.DoingAction(duration));
    }