Examples of MoveListEntry


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

    /**
     * Return whether a given move deals special damage.
     * In Diamond/Pearl, this is based on the move, not its type.
     */
    public boolean isMoveSpecial(PokemonMove move) {
        MoveListEntry entry = move.getMoveListEntry();
        if (entry == null) {
            return move.getType().isSpecial();
        }
        Boolean b = (Boolean)m_moves.get(entry.getName());
        if (b == null) {
            System.out.println("Warning: no move type entry for " + entry.getName() + "!");
            return move.getType().isSpecial();
        }
        return b.booleanValue();
    }
View Full Code Here

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

    /*
     * Get moves learned by levelling up
     */
    for (int i = 1; i <= level; i++) {
      if (ps.getLevelMoves().containsKey(i)) {
        MoveListEntry m = moveList.getMove(ps.getLevelMoves().get(i));
        boolean exists = false;
        /* Check if this move is already in the list of possible moves */
        for (int j = 0; j < possibleMoves.size(); j++) {
          if (possibleMoves.get(j) != null
              && possibleMoves.get(j).getName() != null && m != null
              && m.getName() != null
              && possibleMoves.get(j).getName().equalsIgnoreCase(m.getName())) {
            exists = true;
            break;
          }
        }
        /* If the move is not already in the list, add it to the list */
        if (!exists) possibleMoves.add(m);
      }
    }
    /*
     * possibleMoves sometimes has null moves stored in it, get rid of them
     */
    for (int i = 0; i < possibleMoves.size(); i++) {
      if (possibleMoves.get(i) == null) possibleMoves.remove(i);
    }
    possibleMoves.trimToSize();
    /*
     * Now the store the final set of moves for the Pokemon
     */
    if (possibleMoves.size() <= 4) {
      for (int i = 0; i < possibleMoves.size(); i++) {
        moves[i] = possibleMoves.get(i);
      }
    } else {
      MoveListEntry m = null;
      for (int i = 0; i < 4; i++) {
        if (possibleMoves.size() == 0) {
          moves[i] = null;
        } else {
          m = possibleMoves.get(random.nextInt(possibleMoves.size()));
View Full Code Here

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

    m_mech.validateHiddenStats(this);
    PokemonSpeciesData speciesData = data.getSpeciesData();
    Set<String> set = new HashSet<String>();
    int moveCount = 0;
    for (int i = 0; i < m_move.length; ++i) {
      MoveListEntry move = m_move[i];
      if (move != null) {
        ++moveCount;
        String name = move.getName();
        if (set.contains(name)) { throw new ValidationException(
        "This pokemon learns two of the same move."); }
        set.add(name);
        if (!canLearn(speciesData, name)) { throw new ValidationException(
            "This pokemon cannot learn " + name + "."); }
View Full Code Here

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

    // No iterator - it will freak out if switchIn() adds new statuses.
    m_lastMove = null;
    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);
        }
      }
    }
View Full Code Here

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

   * moves.
   */
  public StatusEffect getVetoingEffect(int idx) throws MoveQueueException {
    if ((idx < 0) || (idx >= m_move.length)) { throw new MoveQueueException(
    "No such move."); }
    MoveListEntry entry = m_move[idx];
    if (entry == null) { throw new MoveQueueException("No such move."); }
    synchronized (m_statuses) {
      Iterator<StatusEffect> i = m_statuses.iterator();
      while (i.hasNext()) {
        StatusEffect j = i.next();
View Full Code Here

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

  /**
   * Use one of this pokemon's intrinsic moves.
   */
  public int useMove(int i, Pokemon target) {
    if (i == -1) {
      MoveListEntry move = BattleField.getStruggle();
      int ret = useMove(move, target);
      m_lastMove = move;
      m_firstTurn = false;
      return ret;
    }
    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;
View Full Code Here

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

     psource.executeTurn(turn);

     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.MoveListEntry

        if (possibleMoves.size() <= 4) {
                for (int i = 0; i < possibleMoves.size(); i++) {
                        moves[i] = possibleMoves.get(i);
                }
        } else {
          MoveListEntry m = null;
                for (int i = 0; i < 4; i++) {
                        if (possibleMoves.size() == 0) {
                            moves[i] = null;
                        } else {
                          while(m == null) {
View Full Code Here

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

     */
    public PokemonMove getMove(Pokemon poke) {
        if (!m_useMove) {
            return null;
        }
        MoveListEntry entry = poke.getMove(m_id);
        if (entry == null) {
            return null;
        }
        return entry.getMove();
    }
View Full Code Here

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

                StatusMove statusMove = (StatusMove)move;
                ChargeEffect charge = (ChargeEffect)statusMove.getEffects()[0];
                charge.setTurns(2);
            }
        } else if (name.equals("Thunder")) {
            return new MoveListEntry("Thunder", new StatusMove(
                PokemonType.T_ELECTRIC, 120, 0.7, 10, new StatusEffect[] {
                    new ParalysisEffect()
                    },
                new boolean[] { false },
                new double[] { 0.3 }
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.