* Some minot code clean up.

This commit is contained in:
LevelX2 2020-07-24 12:08:08 +02:00
parent 653a2dd7b2
commit a90dbd8533
2 changed files with 17 additions and 27 deletions

View file

@ -1,6 +1,6 @@
package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
@ -19,18 +19,11 @@ import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.stack.StackObject;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetadjustment.TargetAdjuster;
import mage.target.targetpointer.FixedTarget;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
* @author LevelX2
*/
@ -80,16 +73,15 @@ class SatyrFiredancerTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
boolean controlledBy = isControlledBy(game.getControllerId(event.getSourceId()));
if (!controlledBy) {
if (!isControlledBy(game.getControllerId(event.getSourceId()))) {
return false;
}
MageObject damageSource = game.getObject(event.getSourceId());
if (damageSource == null) {
return false;
}
UUID damageTarget = event.getTargetId();
if (!game.getOpponents(getControllerId()).contains(damageTarget)) {
UUID damageTargetId = event.getTargetId();
if (!game.getOpponents(getControllerId()).contains(damageTargetId)) {
return false;
}
MageObject sourceObject = game.getObject(event.getSourceId());
@ -97,7 +89,7 @@ class SatyrFiredancerTriggeredAbility extends TriggeredAbilityImpl {
return false;
}
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(damageTarget)); // used by adjust targets
effect.setTargetPointer(new FixedTarget(damageTargetId)); // used by adjust targets
effect.setValue("damage", event.getAmount());
}
return true;

View file

@ -1,4 +1,3 @@
package org.mage.test.cards.abilities.oneshot.damage;
import mage.constants.PhaseStep;
@ -11,7 +10,6 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
*
* @author LevelX2
*/
public class SatyrFiredancerTest extends CardTestPlayerBase {
@Test
@ -57,7 +55,6 @@ public class SatyrFiredancerTest extends CardTestPlayerBase {
assertPermanentCount(playerB, "Silvercoat Lion", 1);
}
@Test
public void testDamageFromOtherCreature() {
// Whenever an instant or sorcery spell you control deals damage to an opponent, Satyr Firedancer deals that much damage to target creature that player controls.
@ -82,6 +79,7 @@ public class SatyrFiredancerTest extends CardTestPlayerBase {
playerC = createPlayer(currentGame, playerC, "PlayerC");
addCard(Zone.BATTLEFIELD, playerA, "Satyr Firedancer", 1);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
// Price of Progress deals damage to each player equal to twice the number of nonbasic lands that player controls.
addCard(Zone.HAND, playerA, "Price of Progress", 1);
addCard(Zone.BATTLEFIELD, playerB, "Taiga", 1);