コード例 #1
0
ファイル: Unit.java プロジェクト: GOTFCodingTeam/GOTFgit
 /**
  * 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;
   }
 }
コード例 #2
0
ファイル: Unit.java プロジェクト: GOTFCodingTeam/GOTFgit
 /** 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;
     }
   }
 }