Package org.jpokemon.pokemon

Examples of org.jpokemon.pokemon.ConditionEffect


  private void applyEndOfRoundEffects() {
    for (Slot slot : this) {
      // Condition effects
      for (Iterator<ConditionEffect> conditionEffectIterator = slot.leader().getConditionEffects().iterator(); conditionEffectIterator.hasNext();) {
        ConditionEffect conditionEffect = conditionEffectIterator.next();

        if (Math.random() <= conditionEffect.persistanceChance()) {
          log(slot.leader().name() + conditionEffect.getPersistanceMessage());

          if (conditionEffect.damagePercentage() > 0) {
            int damage = (int) (slot.leader().maxHealth() * conditionEffect.damagePercentage());
            slot.leader().takeDamage(damage);
            log(slot.leader().name() + " took " + damage + " damage!");
          }
        }
        else {
          log(slot.leader().name() + conditionEffect.getDissipationMessage());
          conditionEffectIterator.remove();
        }
      }

      // Slot effects
View Full Code Here

TOP

Related Classes of org.jpokemon.pokemon.ConditionEffect

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.