Exemplo n.º 1
0
 @Override
 public void onTurnEnd(final BattleEngine be) {
   if (pony.isKO()) return;
   if (be.getWeather().get() == Weather.DARK) {
     int healed = pony.increaseHpPerc(12.5f);
     if (be.getBattleTask() != null) {
       be.getBattleTask()
           .sendB(
               be.getAlly(),
               "|damage|ally|"
                   + healed
                   + "|"
                   + pony.getNickname()
                   + " gains health in DARK weather!");
       be.getBattleTask()
           .sendB(
               be.getOpp(),
               "|damage|opp|"
                   + healed
                   + "|Opponent "
                   + pony.getNickname()
                   + " gains health in DARK weather!");
     }
   }
 }
Exemplo n.º 2
0
  @Override
  public void onTurnEnd(final BattleEngine be) {
    // only trigger if ponies on both side are alive
    if (be.getDefender() == null
        || be.getDefender().isFainted()
        || be.getAttacker() == null
        || be.getAttacker().isFainted()) {
      return;
    }
    for (EffectDealer ed : be.getTeam(side).getActivePony().getEffectDealers())
      if (ed.ignoreSecondaryDamage()) return;
    int dmg = be.getTeam(side).getActivePony().damagePerc(12.5f);
    Connection ally = be.getConnection(side), opp = be.getConnection(side == 1 ? 2 : 1);
    be.getTeam(side == 1 ? 2 : 1).getActivePony().increaseHp(dmg);
    if (be.getBattleTask() != null) {
      be.getBattleTask()
          .sendB(
              ally,
              "|anim|opp|name=Fade|sprite=energyball_small.png|transparent=(b)true"
                  + "|fadeOut=(b)true|initialPoint=opp|finalPoint=ally|nodelay=true");
      be.getBattleTask()
          .sendB(
              opp,
              "|anim|opp|name=Fade|sprite=energyball_small.png|transparent=(b)true"
                  + "|fadeOut=(b)true|initialPoint=ally|finalPoint=opp|nodelay=true");
      be.getBattleTask()
          .sendB(
              ally,
              "|damage|ally|"
                  + dmg
                  + "|"
                  + be.getTeam(side).getActivePony().getNickname()
                  + "'s health is sapped by "
                  + name
                  + "!");
      be.getBattleTask()
          .sendB(
              opp,
              "|damage|opp|"
                  + dmg
                  + "|"
                  + be.getTeam(side).getActivePony().getNickname()
                  + "'s health is sapped by "
                  + name
                  + "!");

      be.getBattleTask().sendB(ally, "|damage|opp|-" + dmg);
      be.getBattleTask().sendB(opp, "|damage|ally|-" + dmg);
    }
  }