mirror of
https://github.com/magefree/mage.git
synced 2025-12-30 07:22:03 -08:00
fix for issue 22 + fix for planeswalker damage redirection
This commit is contained in:
parent
c90193a4eb
commit
9c3ff863e8
49 changed files with 636 additions and 182 deletions
|
|
@ -103,7 +103,7 @@ class VengefulRebirthEffect extends OneShotEffect<VengefulRebirthEffect> {
|
|||
if (!card.getCardType().contains(CardType.LAND)) {
|
||||
Permanent permanent = game.getPermanent(source.getTargets().get(1).getTargets().get(0));
|
||||
if (permanent != null) {
|
||||
permanent.damage(damage, source.getSourceId(), game, true);
|
||||
permanent.damage(damage, source.getSourceId(), game, true, false);
|
||||
return true;
|
||||
}
|
||||
Player targetPlayer = game.getPlayer(source.getTargets().get(1).getTargets().get(0));
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class EarthquakeEffect extends OneShotEffect<EarthquakeEffect> {
|
|||
int amount = source.getManaCosts().getVariableCosts().get(0).getAmount();
|
||||
|
||||
for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) {
|
||||
permanent.damage(amount, source.getId(), game, true);
|
||||
permanent.damage(amount, source.getId(), game, true, false);
|
||||
}
|
||||
for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class FireballEffect extends OneShotEffect<FireballEffect> {
|
|||
for (UUID targetId: source.getTargets().get(0).getTargets()) {
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent != null) {
|
||||
permanent.damage(damagePer, source.getSourceId(), game, true);
|
||||
permanent.damage(damagePer, source.getSourceId(), game, true, false);
|
||||
}
|
||||
else {
|
||||
Player player = game.getPlayer(targetId);
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ class MasterOfTheWildHuntEffect extends OneShotEffect<MasterOfTheWildHuntEffect>
|
|||
if (target != null && game.getBattlefield().countAll(filter, source.getControllerId()) > 0) {
|
||||
for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId())) {
|
||||
permanent.tap(game);
|
||||
target.damage(permanent.getToughness().getValue(), permanent.getId(), game, true);
|
||||
target.damage(permanent.getToughness().getValue(), permanent.getId(), game, true, false);
|
||||
wolves.add(permanent.getId());
|
||||
}
|
||||
Player player = game.getPlayer(target.getControllerId());
|
||||
|
|
|
|||
|
|
@ -39,9 +39,7 @@ import mage.abilities.common.SimpleActivatedAbility;
|
|||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.BoostControlledEffect;
|
||||
import mage.abilities.effects.common.GainAbilityControlledEffect;
|
||||
import mage.abilities.effects.common.GainAbilityTargetEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.keyword.UnblockableAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ class ChandrasOutrageEffect extends OneShotEffect<ChandrasOutrageEffect> {
|
|||
if (permanent != null) {
|
||||
Player player = game.getPlayer(permanent.getControllerId());
|
||||
if (player != null) {
|
||||
permanent.damage(4, source.getSourceId(), game, true);
|
||||
permanent.damage(4, source.getSourceId(), game, true, false);
|
||||
player.damage(2, source.getSourceId(), game, false, true);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ import mage.abilities.effects.common.BoostSourceEffect;
|
|||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.DamagedPlayerEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
|
||||
|
|
@ -90,9 +91,12 @@ class ChandrasSpitfireAbility extends TriggeredAbilityImpl<ChandrasSpitfireAbili
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == EventType.NONCOMBAT_DAMAGED_PLAYER && game.getOpponents(controllerId).contains(event.getTargetId()) && game.getTurn().getStepType() != PhaseStep.COMBAT_DAMAGE) {
|
||||
trigger(game, this.controllerId);
|
||||
return true;
|
||||
if (event instanceof DamagedPlayerEvent) {
|
||||
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
|
||||
if (!damageEvent.isCombatDamage() && game.getOpponents(controllerId).contains(event.getTargetId())) {
|
||||
trigger(game, this.controllerId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class CorruptEffect extends OneShotEffect<CorruptEffect> {
|
|||
int damageDealt = amount;
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
damageDealt = permanent.damage(amount, source.getSourceId(), game, true);
|
||||
damageDealt = permanent.damage(amount, source.getSourceId(), game, true, false);
|
||||
}
|
||||
else {
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
|
|
|
|||
|
|
@ -107,8 +107,8 @@ class CyclopsGladiatorEffect extends OneShotEffect<CyclopsGladiatorEffect> {
|
|||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||
Permanent cyclops = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null && cyclops != null) {
|
||||
permanent.damage(cyclops.getPower().getValue(), cyclops.getId(), game, true);
|
||||
cyclops.damage(permanent.getPower().getValue(), permanent.getId(), game, true);
|
||||
permanent.damage(cyclops.getPower().getValue(), cyclops.getId(), game, true, false);
|
||||
cyclops.damage(permanent.getPower().getValue(), permanent.getId(), game, true, false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class FlingEffect extends OneShotEffect<FlingEffect> {
|
|||
if (amount > 0) {
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.damage(amount, source.getSourceId(), game, true);
|
||||
permanent.damage(amount, source.getSourceId(), game, true, false);
|
||||
return true;
|
||||
}
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ class VengefulArchonEffect extends PreventionEffectImpl<VengefulArchonEffect> {
|
|||
|
||||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
if (source.getManaCosts().getVariableCosts().size() > 0)
|
||||
amount = source.getManaCosts().getVariableCosts().get(0).getAmount();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ class SearingBlazeEffect extends OneShotEffect<SearingBlazeEffect> {
|
|||
player.damage(3, source.getId(), game, false, true);
|
||||
}
|
||||
if (creature != null) {
|
||||
creature.damage(3, source.getId(), game, true);
|
||||
creature.damage(3, source.getId(), game, true, false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
@ -140,7 +140,7 @@ class SearingBlazeEffect extends OneShotEffect<SearingBlazeEffect> {
|
|||
player.damage(1, source.getId(), game, false, true);
|
||||
}
|
||||
if (creature != null) {
|
||||
creature.damage(1, source.getId(), game, true);
|
||||
creature.damage(1, source.getId(), game, true, false);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue