simplified the damage code of Quietus Spike

This commit is contained in:
slapshot5
2012-01-29 21:08:18 +00:00
parent b21c798c83
commit fa10715ae3

View File

@@ -917,41 +917,18 @@ public final class GameActionUtil {
* a {@link forge.Card} object. * a {@link forge.Card} object.
*/ */
private static void playerCombatDamageLoseHalfLifeUp(final Card c) { private static void playerCombatDamageLoseHalfLifeUp(final Card c) {
final Player player = c.getController(); final Player player = c.getController().getOpponent();
final Player opponent = player.getOpponent();
final Card fCard = c;
if (c.getNetAttack() > 0) { if (c.getNetAttack() > 0) {
final Ability ability2 = new Ability(c, "0") { final Ability ability2 = new Ability(c, "0") {
@Override @Override
public void resolve() { public void resolve() {
int x = 0; int x = (int) Math.ceil(player.getLife() / 2.0);
int y = 0; player.loseLife(x, c);
if (player.isHuman()) {
y = (AllZone.getComputerPlayer().getLife() % 2);
if (!(y == 0)) {
y = 1;
} else {
y = 0;
}
x = (AllZone.getComputerPlayer().getLife() / 2) + y;
} else {
y = (AllZone.getHumanPlayer().getLife() % 2);
if (!(y == 0)) {
y = 1;
} else {
y = 0;
}
x = (AllZone.getHumanPlayer().getLife() / 2) + y;
}
opponent.loseLife(x, fCard);
} }
}; // ability2 }; // ability2
final StringBuilder sb = new StringBuilder(); final StringBuilder sb = new StringBuilder();
sb.append(c.getName()).append(" - ").append(opponent); sb.append(c.getName()).append(" - ").append(player);
sb.append(" loses half his or her life, rounded up."); sb.append(" loses half his or her life, rounded up.");
ability2.setStackDescription(sb.toString()); ability2.setStackDescription(sb.toString());