Examples of changeHealth()


Examples of org.pokenet.server.battle.Pokemon.changeHealth()

                          hpBoost = 50;
                          poke.changeHealth(hpBoost);
                          message = "You used Super Potion on "+poke.getName()+"/nThe Super Potion restored 50 HP";
                  } else if(i.getId()==3) { //Hyper Potion
                          hpBoost = 200;
                          poke.changeHealth(hpBoost);
                          message = "You used Hyper Potion on "+poke.getName()+"/nThe Hyper Potion restored 200 HP";
                  } else if(i.getId()==4) {//Max Potion
                          poke.changeHealth(poke.getRawStat(0));
                          message = "You used Max Potion on "+poke.getName()+"/nThe Max Potion restored All HP";
                  } else {
View Full Code Here

Examples of org.pokenet.server.battle.Pokemon.changeHealth()

                  } else if(i.getId()==3) { //Hyper Potion
                          hpBoost = 200;
                          poke.changeHealth(hpBoost);
                          message = "You used Hyper Potion on "+poke.getName()+"/nThe Hyper Potion restored 200 HP";
                  } else if(i.getId()==4) {//Max Potion
                          poke.changeHealth(poke.getRawStat(0));
                          message = "You used Max Potion on "+poke.getName()+"/nThe Max Potion restored All HP";
                  } else {
                          return false;
                  }
          if (!p.isBattling()) {
View Full Code Here

Examples of org.pokenet.server.battle.Pokemon.changeHealth()

                        else
                          p.getTcpSession().write("Ii" + message);
                        return true;
                    } else if(i.getId() == 206) { //Oran Berry
                      String message = poke.getName()+" ate the Oran Berry/nThe Oran Berry restored 10HP";
                      poke.changeHealth(10);
                        if(!p.isBattling()) {
                          p.getTcpSession().write("Ph" + data[0] + poke.getHealth());
                          p.getTcpSession().write("Ii" + message);
                        }
                        else
View Full Code Here

Examples of org.pokenet.server.battle.Pokemon.changeHealth()

                        else
                             p.getTcpSession().write("Ii" + message);
                        return true;
                    } else if(i.getId() == 209) { //Sitrus Berry
                      String message = poke.getName()+" ate the Sitrus Berry/nThe Sitrus Berry restored 30HP";
                        poke.changeHealth(30);
                        if(!p.isBattling()) {
                            p.getTcpSession().write("Ph" + data[0] + poke.getHealth());
                          p.getTcpSession().write("Ii" + message);
                        }
                        else
View Full Code Here

Examples of org.pokenet.server.battle.Pokemon.changeHealth()

    m_moves.add(new MoveListEntry("U-turn",
        new PokemonMove(PokemonType.T_BUG, 70, 1.0, 20) {
      public int use(BattleMechanics mech, Pokemon user, Pokemon target) {
        int damage = mech.calculateDamage(this, user, target);
        target.changeHealth(-damage);

        int party = user.getParty();
        BattleField field = user.getField();
        if (field.getAliveCount(party) > 1) {
          field.requestAndWaitForSwitch(party);
View Full Code Here

Examples of org.pokenet.server.battle.Pokemon.changeHealth()

          return 0;
        }
        user.faint();
        field.requestAndWaitForSwitch(party);
        target = field.getActivePokemon()[party];
        target.changeHealth(target.getStat(Pokemon.S_HP));
        for (int i = 0; i < 4; ++i) {
          MoveListEntry entry = target.getMove(i);
          if (entry != null) {
            PokemonMove move = entry.getMove();
            if (move != null) {
View Full Code Here

Examples of org.pokenet.server.battle.Pokemon.changeHealth()

        int power = 51 * target.getStat(Pokemon.S_SPEED) /
        user.getStat(Pokemon.S_SPEED) / 2;
        if (power > 150) power = 150;
        setPower(getPower() * power / 100);
        int damage = mech.calculateDamage(this, user, target);
        target.changeHealth(-damage);
        setPower(100);
        return damage;
      }
    }
    ));
View Full Code Here

Examples of org.pokenet.server.battle.Pokemon.changeHealth()

          target.removeStatus(StatusEffect.SPECIAL_EFFECT_LOCK);
          user.getField().showMessage(target.getName() + " woke up!");
        }
        int damage = mech.calculateDamage(this, user, target);
        setPower(power);
        target.changeHealth(-damage);
        return damage;
      }
    }
    ));
View Full Code Here

Examples of org.pokenet.server.battle.Pokemon.changeHealth()

        new PokemonMove(PokemonType.T_NORMAL, 35, 0.9, 10) {
      public int use(BattleMechanics mech, Pokemon user, Pokemon target) {
        int damage = 0;
        for (int i = 0; i < 2; ++i) {
          final int partial = mech.calculateDamage(this, user, target);
          target.changeHealth(-partial);
          damage += partial;
        }
        user.getField().showMessage("Hit 2 time(s)!");
        return damage;
      }
View Full Code Here

Examples of org.pokenet.server.battle.Pokemon.changeHealth()

            (((double)target.getHealth())
                / ((double)target.getStat(Pokemon.S_HP))));

        setPower(power);
        int damage = mech.calculateDamage(this, user, target);
        target.changeHealth(-damage);
        return damage;
      }
      public boolean isAttack() {
        return true;
      }
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.