Examples of HealthChangeMessage


Examples of org.pokenet.server.network.message.battle.HealthChangeMessage

  @Override
  public void informPokemonHealthChanged(Pokemon poke, int change) {
    if (m_player != null) {
      if (getActivePokemon()[0] == poke) {
        TcpProtocolHandler.writeMessage(m_player.getTcpSession(),
            new HealthChangeMessage(0, change));
      } else if (getActivePokemon()[1] == poke) {
        TcpProtocolHandler.writeMessage(m_player.getTcpSession(),
            new HealthChangeMessage(1, change));
      } else {
        int index = getPokemonPartyIndex(0, poke);
        if (index > -1) {
          m_player.getTcpSession().write(
              "Ph" + String.valueOf(index) + poke.getHealth());
View Full Code Here

Examples of org.pokenet.server.network.message.battle.HealthChangeMessage

  @Override
  public void informPokemonHealthChanged(Pokemon poke, int change) {
    if (m_players != null && poke != null) {
      if (poke.compareTo(getActivePokemon()[0]) == 0) {
        TcpProtocolHandler.writeMessage(m_players[0].getTcpSession(),
            new HealthChangeMessage(0 , change));
        TcpProtocolHandler.writeMessage(m_players[1].getTcpSession(),
            new HealthChangeMessage(1 , change));
      } else if(poke.compareTo(getActivePokemon()[1]) == 0) {
        TcpProtocolHandler.writeMessage(m_players[1].getTcpSession(),
            new HealthChangeMessage(0 , change));
        TcpProtocolHandler.writeMessage(m_players[0].getTcpSession(),
            new HealthChangeMessage(1 , change));
      } else {
        int index = getPokemonPartyIndex(0, poke);
        if(index > -1) {
          m_players[0].getTcpSession().write("Ph" + String.valueOf(index) + poke.getHealth());
          //TODO: Add support for enemy pokemon healing for pokemon in pokeballs
View Full Code Here

Examples of org.pokenet.server.network.message.battle.HealthChangeMessage

  @Override
  public void informPokemonHealthChanged(Pokemon poke, int change) {
    if (m_player != null) {
      if (getActivePokemon()[0] == poke) {
        TcpProtocolHandler.writeMessage(m_player.getTcpSession(),
            new HealthChangeMessage(0 , change));
      } else if(getActivePokemon()[1] == poke) {
        TcpProtocolHandler.writeMessage(m_player.getTcpSession(),
            new HealthChangeMessage(1 , change));
      } else {
        int index = getPokemonPartyIndex(0, poke);
        if(index > -1) {
          m_player.getTcpSession().write("Ph" + String.valueOf(index) + poke.getHealth());
          return;
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.