Ejemplo n.º 1
0
 public void UpdateCharacterStatus()
 {
     for (int i = 0; i < 4; i++)
     {
         if (gameMaster.playerParty[i].charName != "na")
         {
             characterPanels[i].panel.gameObject.SetActive(true);
             characterPanels[i].portrait.sprite   = gameMaster.playerParty[i].portrait;
             characterPanels[i].charName.text     = gameMaster.playerParty[i].charName;
             characterPanels[i].charType.text     = "Type: " + gameMaster.playerParty[i].charType + " " + gameMaster.playerParty[i].charSubtype;
             characterPanels[i].charHp.text       = "HP: " + gameMaster.playerParty[i].currentHP.ToString() + "/" + gameMaster.playerParty[i].maxHP.ToString();
             characterPanels[i].charMp.text       = "MP: " + gameMaster.playerParty[i].currentMP.ToString() + "/" + gameMaster.playerParty[i].maxMP.ToString();
             characterPanels[i].charLvl.text      = "Lvl: " + gameMaster.playerParty[i].charLevel.ToString();
             characterPanels[i].charToNext.text   = "To Next: " + (gameMaster.CalculateTotalExpNeeded(gameMaster.playerParty[i].charLevel) - gameMaster.playerParty[i].charExp).ToString();
             characterPanels[i].charTotalExp.text = "Total Exp: " + gameMaster.playerParty[i].charExp.ToString();
             if (gameMaster.playerParty[i].statusEffects.Count == 0)
             {
                 characterPanels[i].charStatus.text = "Status: Normal";
             }
             else
             {
                 string statusString = "Status: ";
                 for (int k = 0; k < gameMaster.playerParty[i].statusEffects.Count; k++)
                 {
                     statusString += gameMaster.playerParty[i].statusEffects[k].effectType;
                     if (k != gameMaster.playerParty[i].statusEffects.Count - 1)
                     {
                         statusString += ", ";
                     }
                 }
                 characterPanels[i].charStatus.text = statusString;
             }
         }
         else
         {
             characterPanels[i].panel.gameObject.SetActive(false);
         }
     }
 }