Ejemplo n.º 1
0
 public void setHealthTaken(float value)
 {
     if (classNum == 4)
     {
         TakeHealthWeapon thw = (TakeHealthWeapon)getUnlockEquippedWithType <TakeHealthWeapon>();
         thw.healthTaken = (float)value;
     }
 }
Ejemplo n.º 2
0
 public float getHealthTaken()
 {
     if (classNum == 4)
     {
         TakeHealthWeapon thw = (TakeHealthWeapon)getUnlockEquippedWithType <TakeHealthWeapon>();
         return(thw.healthTaken);
     }
     return(0f);
 }
Ejemplo n.º 3
0
    void updateHud()
    {
        for (int i = 0; i < UnlocksEquipped.Length; i++)
        {
            if (UnlocksEquipped [i] != null && UnlocksEquipped[i].getHudType() == "Cooldown" && UnlocksEquipped[i].hudElement != null)
            {
                UnlocksEquipped [i].setCharge();
            }
            if (UnlocksEquipped [i] is TakeHealthWeapon && GetComponent <PlayerMove>().hudElement != null)
            {
                // Render "Health Taken"
                TakeHealthWeapon thw = (TakeHealthWeapon)UnlocksEquipped [i];
                if (thw.healthTaken >= TakeHealthWeapon.healthTakenReq)
                {
                    // Can use "ultimate" / "ubercharge"
                    GetComponent <PlayerMove>().hudElement.GetComponent <Text>().color = Color.green;
                    GetComponent <PlayerMove>().hudElement.GetComponent <Text>().text  = "(" + OptionsMenu.getBindString(OptionsMenu.binds[OptionsMenu.ULTIMATE_ABILITY]) + ") Health Taken: " + Mathf.FloorToInt(thw.healthTaken);
                }
                else
                {
                    GetComponent <PlayerMove>().hudElement.GetComponent <Text>().color = Color.yellow;
                    GetComponent <PlayerMove>().hudElement.GetComponent <Text>().text  = "Health Taken: " + Mathf.FloorToInt(thw.healthTaken);
                }
            }
        }
        // Phase shift (isn't an unlock) OR speed bost (isn't an unlock)
        if ((classNum == 0 || classNum == 3) && GetComponent <PlayerMove>().hudElement != null)
        {
            GetComponent <PlayerMove>().setCharge(classNum);

            if (GetComponent <PlayerMove> ().hudElement2 != null)
            {
                GetComponent <PlayerMove> ().hudElement2.transform.Find("Armor").GetComponent <Text> ().text = "Armor" + " (" + OptionsMenu.getBindString(OptionsMenu.binds[OptionsMenu.MAIN_ABILITY]) + ")";
                PlacePlayerMade.setCharge(GetComponent <PlayerMove> ().hudElement2, GetComponent <PlayerMove> ().isArmorOn, 1f);
                if (GetComponent <PlayerMove> ().isArmorOn == 0)
                {
                    GetComponent <PlayerMove> ().hudElement2.GetComponent <Image> ().color = new Color(0f, 0.7f, 0f);
                }
                else
                {
                    GetComponent <PlayerMove> ().hudElement2.GetComponent <Image> ().color = new Color(133f / 255f, 133f / 255f, 133f / 255f);
                }
            }
        }
    }