コード例 #1
0
 void Start()
 {
     m_waterTimer = m_startWaterTimer;
     m_ph         = 0;
     m_phBar.transform.position = m_phMeter.transform.position;
     m_potionSlot = GetComponent <PotionScript>();
 }
コード例 #2
0
 private void States_OnDrink(PotionScript potion)
 {
     for (int i = 0; i < zombies.Count; i++)
     {
         if (zombies[i].gameObject.activeSelf)
         {
             zombies[i].states.rpg.StartCoroutine(
                 zombies[i].states.rpg.PotionEffect(
                     potion.potionType.index,
                     potion.potionType.value,
                     potion.potionType.duration));
         }
     }
 }
コード例 #3
0
 void Start()
 {
     //Set this gameObject and it's position
     m_potion = this.gameObject;
     m_potion.transform.SetParent(m_canvas.transform);
     //Gettinng Components
     m_controller   = GetComponent <WaterControl>();
     m_manager      = GameObject.FindGameObjectWithTag("Manager");
     m_potionScript = m_manager.GetComponent <PotionScript>();
     //fill lists
     if (m_isPositive)
     {
         m_potionScript.m_PpotionList.Add(gameObject);
         m_potion.SetActive(false);
     }
     else
     {
         m_potionScript.m_NpotionList.Add(gameObject);
         m_potion.SetActive(false);
     }
 }
コード例 #4
0
    /// <summary>
    /// Put All Actions here
    /// </summary>
    /// <returns></returns>
    string TriggerAction()
    {
        string actionAnimation = null;

        if (rpg.currentWeapon != null)
        {
            if (fire1)
            {
                fire1            = false;
                isJumpAttackBool = true; // gravity applies when jump attack
                if (attComboIndex < rpg.currentWeapon.MoveSet.fire1.Count && attComboIndex >= 0)
                {
                    PerformActionWithCurve(rpg.currentWeapon.MoveSet.fire1[attComboIndex], ref actionAnimation, ref isInAction);
                }

                if (attComboIndex < rpg.currentWeapon.MoveSet.fire1.Count - 1)
                {
                    attComboIndex++;
                }
                else
                {
                    attComboIndex = 0;
                }
            }

            if (fire2)
            {
                fire2            = false;
                isJumpAttackBool = true; // gravity applies when jump attack
                PerformActionWithCurve(rpg.currentWeapon.MoveSet.fire2, ref actionAnimation, ref isInAction);
            }

            if (fire3)
            {
                fire3            = false;
                isJumpAttackBool = true; // gravity applies when jump attack
                PerformActionWithCurve(rpg.currentWeapon.MoveSet.fire3, ref actionAnimation, ref isInAction);
            }


            if (aimFire && animator.GetBool("canAimAttack"))
            {
                aimFire          = false;
                isJumpAttackBool = true;
                PerformActionWithCurve(rpg.currentWeapon.MoveSet.fire4, ref actionAnimation, ref isSlowMove);

                //actionAnimation = "Mage Summoning";
            }
        }
        else
        {
            fire1   = false;
            fire2   = false;
            fire3   = false;
            aimFire = false;
        }


        if (fireSpecial > -1)
        {
            if (fireSpecial < specialAttacks.Count)
            {
                PerformActionWithCurve(specialAttacks[fireSpecial], ref actionAnimation, ref isInAction);
                fireSpecial = -1;
            }
        }


        if (point)
        {
            point = false;
            PerformActionWithCurve(pointAction, ref actionAnimation, ref isSlowMove);
        }

        if (isPickUp)
        {
            isPickUp = false;
            PerformActionWithCurve(pickUp, ref actionAnimation, ref isInAction);
        }

        if (dodge && !isDodge)
        {
            dodge    = false;
            dodgeDir = moveDirection;
            isDodge  = true;
            PerformActionWithCurve(dodgeAction, ref actionAnimation, ref isInAction);
        }


        if (drink &&
            havePotion &&
            potionHand != null &&
            !isSlowMove)
        {
            drink = false;
            PerformActionWithCurve(drinkPotion, ref actionAnimation, ref isSlowMove);
            currentPotion = rpg.potions[potionIndex].Dequeue();
            OnDrink(currentPotion);
            currentPotion.UsePotion(this);
        }

        if (followMe)
        {
            followMe = false;
            aem.FollowMe();
            if (GameMasterScript.Instance.audioSource != null)
            {
                GameMasterScript.Instance.audioSource.PlayOneShot(shoutFollowMe, 0.7f);
            }
        }

        return(actionAnimation);
    }