Examples of PokemonMove


Examples of org.pokenet.server.battle.mechanics.moves.PokemonMove

    calculateStats(true);

    for (int i = 0; i < m_move.length; ++i) {
      if (m_move[i] != null) {
        m_move[i] = (MoveListEntry) m_move[i].clone();
        PokemonMove move = m_move[i].getMove();
        if (move != null) {
          m_maxPp[i] = m_pp[i] = move.getPp() * (5 + m_ppUp[i]) / 5;
        }
      }
    }
  }
View Full Code Here

Examples of org.pokenet.server.battle.mechanics.moves.PokemonMove

    m_firstTurn = true;
    // Inform PokemonMoves that their potential user is switching in.
    for (int i = 0; i < m_move.length; ++i) {
      MoveListEntry entry = m_move[i];
      if (entry != null) {
        PokemonMove move = entry.getMove();
        if (move != null) {
          move.switchIn(this);
        }
      }
    }
    // Inform status effects.
    int size = m_statuses.size();
View Full Code Here

Examples of org.pokenet.server.battle.mechanics.moves.PokemonMove

    }
    if ((i >= m_move.length) || (m_move[i] == null)) return 0;
    if (m_pp[i] == 0) return 0;

    MoveListEntry entry = m_move[i];
    PokemonMove move = m_move[i].getMove();

    final int cost = (target.hasAbility("Pressure") && move.isAttack()) ? 2 : 1;
    m_pp[i] -= cost;
    if (m_pp[i] < 0) m_pp[i] = 0;

    int ret = useMove(entry, target);
    m_lastMove = entry;
View Full Code Here

Examples of org.pokenet.server.battle.mechanics.moves.PokemonMove

  /**
   * Use a a move from the move list (so its name is known and displayed).
   */
  public int useMove(MoveListEntry move, Pokemon target) {
    PokemonMove pmove = move.getMove();
    move = getTransformedMove(move, false);
    if (move != null) {
      if (target != this) {
        if ((move = target.getTransformedMove(move, true)) == null) { return 0; }
      }
View Full Code Here

Examples of org.pokenet.server.battle.mechanics.moves.PokemonMove

     int move = turn.getId();

     MoveListEntry entry = psource.getMove(move);
     if (entry == null) return;
     PokemonMove theMove = entry.getMove();

     if (psource.isImmobilised(theMove.getStatusException())) {
       return;
     }

     Pokemon ptarget = m_pokemon[target][m_active[target]];
     if (theMove.isAttack() && ptarget.isFainted()) {
       informUseMove(psource, entry.getName());
       showMessage("But there was no target!");
       return;
     }
     psource.useMove(move, ptarget);
View Full Code Here

Examples of org.pokenet.server.battle.mechanics.moves.PokemonMove

     for (int i = 0; i < active.length; ++i) {
       BattleTurn turn = move[i];
       if (turn == null)
         continue;
       if (turn.isMoveTurn()) {
         PokemonMove pokemonMove = turn.getMove(active[i]);
         if (pokemonMove != null) {
           pokemonMove.beginTurn(move, i, active[i]);
         }
       }
     }

     for (int i = 0; i < active.length; ++i) {
View Full Code Here

Examples of org.pokenet.server.battle.mechanics.moves.PokemonMove

         return -1;
       if (m_turn == null)
         return 1;
       if (m_turn.isMoveTurn() && comp.m_turn.isMoveTurn()) {
         int p1 = 0, p2 = 0;
         PokemonMove m1 = m_turn.getMove(m_poke);
         if (m1 != null) {
           p1 = m1.getPriority();
         }
         PokemonMove m2 = comp.m_turn.getMove(comp.m_poke);
         if (m2 != null) {
           p2 = m2.getPriority();
         }
         if (p1 > p2) return -1;
         if (p2 > p1) return 1;
         return compareSpeed(m_poke, comp.m_poke);
       }
View Full Code Here

Examples of org.pokenet.server.battle.mechanics.moves.PokemonMove

        pokemon.calculateStats(true);
        pokemon.reinitialise();
        pokemon.setIsFainted(false);
        for(int i = 0; i < pokemon.getMoves().length; i++) {
          if(pokemon.getMoves()[i] != null) {
            PokemonMove move = pokemon.getMoves()[i].getMove();
            pokemon.setPp(i, move.getPp() * (5 + pokemon.getPpUpCount(i)) / 5);
            pokemon.setMaxPP(i, move.getPp() * (5 + pokemon.getPpUpCount(i)) / 5);
          }
        }
      }
    }
    m_tcpSession.write("cH");
View Full Code Here

Examples of org.pokenet.server.battle.mechanics.moves.PokemonMove

     */
    public MoveListEntry getTransformedMove(Pokemon poke, MoveListEntry entry) {
        if (!hasEffects(poke.getField()))
            return entry;
       
        PokemonMove move = entry.getMove();
        PokemonType type = move.getType();
        String name = entry.getName();
        if (type.equals(PokemonType.T_WATER)) {
            move.setPower((int)((double)move.getPower() * 1.5));
        } else if (type.equals(PokemonType.T_FIRE)) {
            move.setPower((int)((double)move.getPower() / 2.0));
        } else if (name.equals("Weather Ball")) {
            move.setPower(100);
            move.setType(PokemonType.T_WATER);
        } else if (name.equals("Moonlight") || name.equals("Morning Sun") || name.equals("Synthesis")) {
            StatusMove statusMove = (StatusMove)move;
            // Assume that the first effect is the PercentEffect!
            PercentEffect perc = (PercentEffect)statusMove.getEffects()[0];
            perc.setPercent(1.0/3.0);
View Full Code Here

Examples of org.pokenet.server.battle.mechanics.moves.PokemonMove

     */
    public MoveListEntry getTransformedMove(Pokemon poke, MoveListEntry entry) {
        if (!hasEffects(poke.getField()))
            return entry;
       
        PokemonMove move = entry.getMove();
        String name = entry.getName();
        if (name.equals("Solarbeam")) {
            if (move instanceof StatusMove) {
                StatusMove statusMove = (StatusMove)move;
                ChargeEffect charge = (ChargeEffect)statusMove.getEffects()[0];
                charge.getMove().getMove().setPower(60);
            }
        } else if (name.equals("Weather Ball")) {
            move.setPower(100);
            move.setType(PokemonType.T_ICE);
        } else if (name.equals("Moonlight") || name.equals("Morning Sun") || name.equals("Synthesis")) {
            StatusMove statusMove = (StatusMove)move;
            // Assume that the first effect is the PercentEffect!
            PercentEffect perc = (PercentEffect)statusMove.getEffects()[0];
            perc.setPercent(1.0/3.0);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.