Package org.pokenet.server.battle.mechanics

Examples of org.pokenet.server.battle.mechanics.StatMultiplier


    m_stat = new int[6];
    m_multiplier = new StatMultiplier[m_stat.length];
    if (reset) removeStatusEffects(true);
    for (int i = 0; i < m_stat.length; ++i) {
      m_stat[i] = m_mech.calculateStat(this, i);
      m_multiplier[i] = new StatMultiplier(false);
    }
    if (reset) m_hp = m_stat[S_HP];
  }
View Full Code Here


   * Calculate this pokemon's stats.
   */
  private void initialise() throws StatException {
    // Recreate transient members.
    m_movesLearning = new ArrayList<String>();
    m_accuracy = new StatMultiplier(true);
    m_evasion = new StatMultiplier(true);
    m_statuses = new ArrayList<StatusEffect>();
    m_pp = new int[4];
    m_maxPp = new int[m_pp.length];
    m_fainted = false;
    m_field = null;
View Full Code Here

  public StatMultiplier getMultiplier(int i) throws StatException {
    if (i < m_multiplier.length) {
      if (m_multiplier == null) {
        m_multiplier = new StatMultiplier[m_stat.length];
      }
      if (m_multiplier[i] == null) m_multiplier[i] = new StatMultiplier(false);
      if (i < 0) throw new StatException();
      if (i < 6) return m_multiplier[i];
      if (i == S_ACCURACY) return m_accuracy;
      if (i == S_EVASION) return m_evasion;
    }
View Full Code Here

  public int getStat(int i) {
    if (m_multiplier == null) {
      m_multiplier = new StatMultiplier[m_stat.length];
    }
    if (m_multiplier[i] == null) m_multiplier[i] = new StatMultiplier(false);
    if ((i < 0) || (i > 5)) throw new StatException();
    // Consider stat modifications.
    return getStat(i, m_multiplier[i].getMultiplier());
  }
View Full Code Here

    if (hasNeg || getEvTotal() > 510) {
      for (int i = 0; i < 6; i++) {
        setEv(i, 0);
      }
    }
    m_accuracy = new StatMultiplier(true);
    m_evasion = new StatMultiplier(true);
    m_statuses = new ArrayList<StatusEffect>();
    m_movesLearning = new ArrayList<String>();
    /*
     * m_pp = new int[4]; m_maxPp = new int[4]; m_ppUp = new int[4];
     */
 
View Full Code Here

              user.getField().showMessage(target.getName() + eff.getDescription());
              break;
            }
          }
        } else if (mech.attemptHit(this, user, target)) {
          StatMultiplier mul = target.getMultiplier(Pokemon.S_DEFENCE);
          double value = mul.getSecondaryMultiplier();
          mul.setSecondaryMultiplier(value / 2.0);
          damage = mech.calculateDamage(this, user, target);
          mul.setSecondaryMultiplier(value);
          target.changeHealth(-damage);
        }
        user.faint();
        return damage;
      }
View Full Code Here

     public boolean apply(Pokemon p) {
        if (m_applied[p.getParty()] || !(m_applied[p.getParty()] = hasEffects(p.getField())))
            return true;
        
        if (p.hasAbility("Snow Cloak")) {
            StatMultiplier mul = p.getMultiplier(Pokemon.S_EVASION);
            mul.increaseMultiplier();
        }
        setTypes(p, new PokemonType[] { PokemonType.T_ICE }, true);
        return true;
    }
View Full Code Here

    public void unapply(Pokemon p) {
        if (!m_applied[p.getParty()])
            return;
        m_applied[p.getParty()] = false;
        if (p.hasAbility("Snow Cloak")) {
            StatMultiplier mul = p.getMultiplier(Pokemon.S_EVASION);
            mul.decreaseMultiplier();
        }
        setTypes(p, null, false);
    }
View Full Code Here

   
    private void flowerGift(Pokemon p, boolean increase) {
        if (!p.hasAbility("Flower Gift")) {
            return;
        }
        StatMultiplier multiplier = p.getMultiplier(Pokemon.S_ATTACK);
        if (increase) multiplier.increaseMultiplier();
        else multiplier.decreaseMultiplier();
       
        multiplier = p.getMultiplier(Pokemon.S_SPDEFENCE);
        if (increase) multiplier.increaseMultiplier();
        else multiplier.decreaseMultiplier();
    }
View Full Code Here

     */       
    public boolean apply(Pokemon p) {
        if (m_applied[p.getParty()] || !(m_applied[p.getParty()] = hasEffects(p.getField())))
            return true;
        if (p.hasAbility("Sand Veil")) {
            StatMultiplier mul = p.getMultiplier(Pokemon.S_EVASION);
            mul.increaseMultiplier();
        }
        if ((p.getField().getMechanics() instanceof JewelMechanics) && p.isType(PokemonType.T_ROCK)) {
            p.getMultiplier(Pokemon.S_SPDEFENCE).multiplyBy(1.5);
        }
        return true;
View Full Code Here

TOP

Related Classes of org.pokenet.server.battle.mechanics.StatMultiplier

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.