mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 20:59:14 -08: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());
|
Permanent equipment = game.getPermanent(source.getSourceId());
|
||||||
if (equipment != null && equipment.getAttachedTo() != null) {
|
if (equipment != null && equipment.getAttachedTo() != null) {
|
||||||
int power = game.getPermanent(equipment.getAttachedTo()).getPower().getValue();
|
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) {
|
if (defendingPlayerId != null) {
|
||||||
game.getPlayer(defendingPlayerId).damage(power, id, game, false, true);
|
game.getPlayer(defendingPlayerId).damage(power, source.getSourceId(), game, false, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,8 @@ class HellriderTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) {
|
if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) {
|
||||||
Permanent source = game.getPermanent(event.getSourceId());
|
Permanent source = game.getPermanent(event.getSourceId());
|
||||||
if (source != null && source.getControllerId().equals(controllerId)) {
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,8 @@ class RaidBombardmentTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
Permanent attacker = game.getPermanent(event.getSourceId());
|
Permanent attacker = game.getPermanent(event.getSourceId());
|
||||||
if (attacker != null) {
|
if (attacker != null) {
|
||||||
if (attacker.getPower().getValue() <= 2) {
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ class MyrBattlesphereEffect extends OneShotEffect {
|
||||||
// boost effect
|
// boost effect
|
||||||
game.addEffect(new BoostSourceEffect(tappedAmount, 0, Duration.EndOfTurn), source);
|
game.addEffect(new BoostSourceEffect(tappedAmount, 0, Duration.EndOfTurn), source);
|
||||||
// damage to defender
|
// damage to defender
|
||||||
UUID defenderId = game.getCombat().getDefenderId(source.getSourceId());
|
UUID defenderId = game.getCombat().getDefendingPlayerId(source.getSourceId(), game);
|
||||||
Player defender = game.getPlayer(defenderId);
|
Player defender = game.getPlayer(defenderId);
|
||||||
if (defender != null) {
|
if (defender != null) {
|
||||||
defender.damage(tappedAmount, source.getSourceId(), game, false, true);
|
defender.damage(tappedAmount, source.getSourceId(), game, false, true);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue