* Ondu Rising - Fixed that the attacking creatures did not get lifelink.

This commit is contained in:
LevelX2 2015-09-20 09:25:25 +02:00
parent 84757f132c
commit 5a8ca36916
4 changed files with 83 additions and 6 deletions

View file

@ -927,15 +927,15 @@ public class Combat implements Serializable, Copyable<Combat> {
}
}
public boolean declareAttacker(UUID attackerId, UUID defenderId, UUID playerId, Game game) {
Permanent attacker = game.getPermanent(attackerId);
public boolean declareAttacker(UUID creatureId, UUID defenderId, UUID playerId, Game game) {
Permanent attacker = game.getPermanent(creatureId);
if (!attacker.getAbilities().containsKey(VigilanceAbility.getInstance().getId())) {
if (!attacker.isTapped()) {
attacker.tap(game);
}
}
if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.DECLARE_ATTACKER, defenderId, attackerId, playerId))) {
return addAttackerToCombat(attackerId, defenderId, game);
if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.DECLARE_ATTACKER, defenderId, creatureId, playerId))) {
return addAttackerToCombat(creatureId, defenderId, game);
}
return false;
}

View file

@ -154,6 +154,12 @@ public class GameEvent implements Serializable {
COUNTER,
COUNTERED,
DECLARING_ATTACKERS, DECLARED_ATTACKERS,
/* DECLARE_ATTACKER
REPLACE EVENT - can be used to replace attack declaration
targetId id of the defending player or planeswalker attacked
sourceId id of the attacking creature
playerId player defining the attacking creatures
*/
DECLARE_ATTACKER,
/* ATTACKER_DECLARED
targetId id of the defending player or planeswalker attacked