rewrote enum comparisons, iterator to removeIf, added some stream and filters

This commit is contained in:
ingmargoudt 2017-02-11 22:37:00 +01:00
parent 05e5ca3c78
commit 3a152ab3d6
41 changed files with 178 additions and 239 deletions

View file

@ -11,7 +11,6 @@ import mage.game.Game;
import mage.game.events.GameEvent;
/**
*
* @author LevelX2
*/
public class DealsDamageToOneOrMoreCreaturesTriggeredAbility extends DealsDamageToACreatureTriggeredAbility {
@ -28,7 +27,8 @@ public class DealsDamageToOneOrMoreCreaturesTriggeredAbility extends DealsDamage
public boolean checkTrigger(GameEvent event, Game game) {
if (super.checkTrigger(event, game)) {
// check that combat damage does only once trigger also if multiple creatures were damaged because they block or were blocked by source
if (game.getTurn().getStepType().equals(PhaseStep.COMBAT_DAMAGE) || game.getTurn().getStepType().equals(PhaseStep.FIRST_COMBAT_DAMAGE)) {
if (game.getTurn().getStepType() == PhaseStep.COMBAT_DAMAGE
|| game.getTurn().getStepType() == PhaseStep.FIRST_COMBAT_DAMAGE) {
String stepHash = (String) game.getState().getValue("damageStep" + getOriginalId());
String newStepHash = game.getStep().getType().toString() + game.getTurnNum();
if (stepHash == null || !newStepHash.equals(stepHash)) {