mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
* Hellrider, Raid Bombardment, Myr Battlesphere and Mage Slayer - Fixed that the triggered damage is dealt to defending player also if a planeswalker was attacked.
This commit is contained in:
parent
ec65c89267
commit
5323e79415
4 changed files with 7 additions and 5 deletions
|
@ -94,9 +94,9 @@ class MageSlayerEffect extends OneShotEffect {
|
|||
Permanent equipment = game.getPermanent(source.getSourceId());
|
||||
if (equipment != null && equipment.getAttachedTo() != null) {
|
||||
int power = game.getPermanent(equipment.getAttachedTo()).getPower().getValue();
|
||||
UUID defendingPlayerId = game.getCombat().getDefenderId(equipment.getAttachedTo());
|
||||
UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(equipment.getAttachedTo(), game);
|
||||
if (defendingPlayerId != null) {
|
||||
game.getPlayer(defendingPlayerId).damage(power, id, game, false, true);
|
||||
game.getPlayer(defendingPlayerId).damage(power, source.getSourceId(), game, false, true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,7 +91,8 @@ class HellriderTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) {
|
||||
Permanent source = game.getPermanent(event.getSourceId());
|
||||
if (source != null && source.getControllerId().equals(controllerId)) {
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(event.getSourceId(), game);
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(defendingPlayerId));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,7 +87,8 @@ class RaidBombardmentTriggeredAbility extends TriggeredAbilityImpl {
|
|||
Permanent attacker = game.getPermanent(event.getSourceId());
|
||||
if (attacker != null) {
|
||||
if (attacker.getPower().getValue() <= 2) {
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(attacker.getId(), game);
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(defendingPlayerId));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ class MyrBattlesphereEffect extends OneShotEffect {
|
|||
// boost effect
|
||||
game.addEffect(new BoostSourceEffect(tappedAmount, 0, Duration.EndOfTurn), source);
|
||||
// damage to defender
|
||||
UUID defenderId = game.getCombat().getDefenderId(source.getSourceId());
|
||||
UUID defenderId = game.getCombat().getDefendingPlayerId(source.getSourceId(), game);
|
||||
Player defender = game.getPlayer(defenderId);
|
||||
if (defender != null) {
|
||||
defender.damage(tappedAmount, source.getSourceId(), game, false, true);
|
||||
|
|
Loading…
Reference in a new issue