public int GetEnergy(HeroEnergyName _energyName) { switch (_energyName) { case HeroEnergyName.Death: return deathEnergy; } return 0; }
public int GetEnergy(HeroEnergyName _energyName) { switch (_energyName) { case HeroEnergyName.Strength: return strength; case HeroEnergyName.Light: return holyLight; } return 0; }
public void AddEnergy(HeroEnergyName _energyName, int _energyAmount) { if(_energyAmount < 0) return; switch (_energyName) { case HeroEnergyName.Death: deathEnergy += _energyAmount; break; } if (deathEnergy > MAX_DEATH_ENERGY) deathEnergy = MAX_DEATH_ENERGY; }
public void CostEnergy(HeroEnergyName _energyName, int _energyAmount) { if (_energyAmount < 0) return; switch (_energyName) { case HeroEnergyName.Death: deathEnergy -= _energyAmount; break; } if (deathEnergy < 0) deathEnergy = 0; }
public void CostEnergy(HeroEnergyName _energyName, int _energyAmount) { if (_energyAmount < 0) return; switch (_energyName) { case HeroEnergyName.Strength: strength -= _energyAmount; if (strength < 0) strength = 0; break; case HeroEnergyName.Light: holyLight -= _energyAmount; if (holyLight < 0) holyLight = 0; break; } }
public void AddEnergy(HeroEnergyName _energyName, int _energyAmount) { if (_energyAmount < 0) return; switch (_energyName) { case HeroEnergyName.Strength: strength += _energyAmount; if (strength > MAX_STRENGTH) strength = MAX_STRENGTH; break; case HeroEnergyName.Light: holyLight += _energyAmount; if (holyLight > MAX_HOLY_LIGHT) holyLight = MAX_HOLY_LIGHT; break; } }
public void CostEnergy(HeroEnergyName _energyName, int _cost) { if (_cost < 0) { Debug.LogError("Cost Must Be Positive"); return; } if (_energyName == HeroEnergyName.NotDefined) { Debug.LogError("Energy Name NotDefined"); } heroEnergyStrategy.CostEnergy(_energyName, _cost); //if (energy < _cost) //{ // Debug.LogError("Not Enough Energy"); // return; //} //energy -= _cost; }
public void AddEnergy(HeroEnergyName _energyName, int _addValue) { if (_addValue < 0) { Debug.LogError("Mana Added Must Be Positive"); return; } if (_energyName == HeroEnergyName.NotDefined) { Debug.LogError("Energy Name NotDefined"); } heroEnergyStrategy.AddEnergy(_energyName, _addValue); //mana += _addValue; }
//public int HeroHP(){ // if(hero != null) return hero.Health; // else return 0; //} //public void CostMana(int _cost) //{ // if (_cost < 0) // { // Debug.LogError("Cost Must Be Positive"); // return; // } // if (mana < _cost) // { // Debug.LogError("Not Enough Mana"); // return; // } // mana -= _cost; //} public int GetEnergy(HeroEnergyName _energyName) { return heroEnergyStrategy.GetEnergy(_energyName); }