mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
Remove redundant checks
This commit is contained in:
@@ -25,7 +25,6 @@ public enum AbilityKey {
|
|||||||
AttackedTarget("AttackedTarget"),
|
AttackedTarget("AttackedTarget"),
|
||||||
Blocker("Blocker"),
|
Blocker("Blocker"),
|
||||||
Blockers("Blockers"),
|
Blockers("Blockers"),
|
||||||
CastOrCopy("CastOrCopy"),
|
|
||||||
CastSA("CastSA"),
|
CastSA("CastSA"),
|
||||||
CastSACMC("CastSACMC"),
|
CastSACMC("CastSACMC"),
|
||||||
Card("Card"),
|
Card("Card"),
|
||||||
|
|||||||
@@ -80,32 +80,6 @@ public class TriggerSpellAbilityCastOrCopy extends Trigger {
|
|||||||
final Card cast = spellAbility.getHostCard();
|
final Card cast = spellAbility.getHostCard();
|
||||||
final Game game = cast.getGame();
|
final Game game = cast.getGame();
|
||||||
final SpellAbilityStackInstance si = game.getStack().getInstanceFromSpellAbility(spellAbility);
|
final SpellAbilityStackInstance si = game.getStack().getInstanceFromSpellAbility(spellAbility);
|
||||||
String castOrCopy = (String) runParams.get(AbilityKey.CastOrCopy);
|
|
||||||
|
|
||||||
// Specific checks for trigger types
|
|
||||||
if (castOrCopy.equals("Copy")) {
|
|
||||||
if (this.getMode().equals(TriggerType.AbilityCast) ||
|
|
||||||
this.getMode().equals(TriggerType.SpellAbilityCast) ||
|
|
||||||
this.getMode().equals(TriggerType.SpellCast)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (castOrCopy.equals("Cast")) {
|
|
||||||
if (this.getMode().equals(TriggerType.SpellAbilityCopy) ||
|
|
||||||
this.getMode().equals(TriggerType.SpellCopy)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (spellAbility.isSpell()) {
|
|
||||||
if (this.getMode().equals(TriggerType.AbilityCast)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else if (spellAbility.isAbility()) {
|
|
||||||
if (this.getMode().equals(TriggerType.SpellCast) ||
|
|
||||||
this.getMode().equals(TriggerType.SpellCopy) ||
|
|
||||||
this.getMode().equals(TriggerType.SpellCastOrCopy)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hasParam("ActivatedOnly")) {
|
if (hasParam("ActivatedOnly")) {
|
||||||
if (spellAbility.isTrigger()) {
|
if (spellAbility.isTrigger()) {
|
||||||
|
|||||||
@@ -301,7 +301,6 @@ public class MagicStack /* extends MyObservable */ implements Iterable<SpellAbil
|
|||||||
runParams.put(AbilityKey.CurrentStormCount, thisTurnCast.size());
|
runParams.put(AbilityKey.CurrentStormCount, thisTurnCast.size());
|
||||||
runParams.put(AbilityKey.CurrentCastSpells, Lists.newArrayList(thisTurnCast));
|
runParams.put(AbilityKey.CurrentCastSpells, Lists.newArrayList(thisTurnCast));
|
||||||
if (!sp.isCopied()) {
|
if (!sp.isCopied()) {
|
||||||
runParams.put(AbilityKey.CastOrCopy, "Cast");
|
|
||||||
// Run SpellAbilityCast triggers
|
// Run SpellAbilityCast triggers
|
||||||
game.getTriggerHandler().runTrigger(TriggerType.SpellAbilityCast, runParams, true);
|
game.getTriggerHandler().runTrigger(TriggerType.SpellAbilityCast, runParams, true);
|
||||||
|
|
||||||
@@ -334,7 +333,6 @@ public class MagicStack /* extends MyObservable */ implements Iterable<SpellAbil
|
|||||||
game.getTriggerHandler().runTrigger(TriggerType.Crewed, runParams, false);
|
game.getTriggerHandler().runTrigger(TriggerType.Crewed, runParams, false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
runParams.put(AbilityKey.CastOrCopy, "Copy");
|
|
||||||
// Run Copy triggers
|
// Run Copy triggers
|
||||||
if (sp.isSpell()) {
|
if (sp.isSpell()) {
|
||||||
game.getTriggerHandler().runTrigger(TriggerType.SpellCopy, runParams, false);
|
game.getTriggerHandler().runTrigger(TriggerType.SpellCopy, runParams, false);
|
||||||
|
|||||||
Reference in New Issue
Block a user