Exemplo n.º 1
0
 /**
  * Applies an effect to the unit.
  *
  * @param effect the effect to apply
  */
 public void applyEffect(Effect effect) {
   effects.add(effect);
   attack += effect.attackChange();
   baseCountdown += effect.baseCountdownChange();
   health += effect.healthChange();
   maximumHealth += effect.healthChange();
   baseMove += effect.baseMoveChange();
   if (effect.untargetable()) {
     targetable = false;
   }
 }
Exemplo n.º 2
0
 /** Applies all the unit's effects to it. */
 public void applyAllEffects() {
   for (Effect effect : effects) {
     attack += effect.attackChange();
     baseCountdown += effect.baseCountdownChange();
     health += effect.healthChange();
     maximumHealth += effect.healthChange();
     baseMove += effect.baseMoveChange();
     if (effect.untargetable()) {
       targetable = false;
     }
   }
 }