public FighterManagerState(TeamManagingGameState tgs, Fighter f) { this.tgs = tgs; this.f = f; name = f.getName(); traits[0] = "Remaining: " + f.getAvailiblePoints(); traits[1] = "Health: " + String.valueOf(f.getMaxHealth()) + " >"; traits[2] = "Attack: " + String.valueOf(f.getAttack()) + " >"; traits[3] = "Magic: " + String.valueOf(f.getMagicPower()) + " >"; traits[4] = "Speed: " + String.valueOf(f.getSpeed()) + " >"; for (int i = 0; i < abilities.length; i++) { if (f.getAbilities()[i] != null) { abilities[i] = f.getAbilities()[i].getName() + ": " + f.getAbilities()[i].getDescription(); } } remainingPoints = f.getAvailiblePoints(); }
@Override public void setRt(boolean b) { if (b) { if (currentIndex != 5) { boolean pointUsed = false; if (remainingPoints > 0) { switch (currentIndex) { case 1: f.levelHealth(); pointUsed = true; traits[0] = "Health < " + String.valueOf(f.getMaxHealth()) + " >"; break; case 2: f.levelAttack(); ; pointUsed = true; break; case 3: f.levelMagic(); ; pointUsed = true; break; case 4: f.levelSpeed(); ; pointUsed = true; break; } if (pointUsed) { remainingPoints--; f.usePoint(); } } traits[0] = "Remaining: " + f.getAvailiblePoints(); traits[1] = "Health: " + String.valueOf(f.getMaxHealth()) + " >"; traits[2] = "Attack: " + String.valueOf(f.getAttack()) + " >"; traits[3] = "Magic: " + String.valueOf(f.getMagicPower()) + " >"; traits[4] = "Speed: " + String.valueOf(f.getSpeed()) + " >"; } } }