mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
MKM: innocent_bystander.txt + support (#4577)
This commit is contained in:
@@ -7,6 +7,7 @@ import forge.game.card.Card;
|
|||||||
import forge.game.card.CardCollection;
|
import forge.game.card.CardCollection;
|
||||||
import forge.game.card.CardUtil;
|
import forge.game.card.CardUtil;
|
||||||
import forge.game.spellability.SpellAbility;
|
import forge.game.spellability.SpellAbility;
|
||||||
|
import forge.util.Expressions;
|
||||||
import forge.util.Localizer;
|
import forge.util.Localizer;
|
||||||
|
|
||||||
public class TriggerDamageDoneOnce extends Trigger {
|
public class TriggerDamageDoneOnce extends Trigger {
|
||||||
@@ -24,18 +25,25 @@ public class TriggerDamageDoneOnce extends Trigger {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasParam("ValidSource")) {
|
|
||||||
final Map<Card, Integer> damageMap = (Map<Card, Integer>) runParams.get(AbilityKey.DamageMap);
|
|
||||||
|
|
||||||
if (getDamageAmount(damageMap) <= 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!matchesValidParam("ValidTarget", runParams.get(AbilityKey.DamageTarget))) {
|
if (!matchesValidParam("ValidTarget", runParams.get(AbilityKey.DamageTarget))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final int damageAmount = getDamageAmount((Map<Card, Integer>) runParams.get(AbilityKey.DamageMap));
|
||||||
|
|
||||||
|
if (hasParam("ValidSource")) {
|
||||||
|
if (damageAmount <= 0) return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasParam("DamageAmount")) {
|
||||||
|
final String fullParam = getParam("DamageAmount");
|
||||||
|
|
||||||
|
final String operator = fullParam.substring(0, 2);
|
||||||
|
final int operand = Integer.parseInt(fullParam.substring(2));
|
||||||
|
|
||||||
|
if (!Expressions.compare(damageAmount, operator, operand)) return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
Name:Innocent Bystander
|
||||||
|
ManaCost:1 R
|
||||||
|
Types:Creature Goblin Citizen
|
||||||
|
PT:2/1
|
||||||
|
T:Mode$ DamageDoneOnce | ValidTarget$ Card.Self | DamageAmount$ GE3 | Execute$ TrigInvestigate | TriggerZones$ Battlefield | TriggerDescription$ Whenever CARDNAME is dealt 3 or more damage, investigate. (Create a Clue token. It's an artifact with "{2}, Sacrifice this artifact: Draw a card.")
|
||||||
|
SVar:TrigInvestigate:DB$ Investigate
|
||||||
|
DeckHas:Ability$Token|Investigate|Sacrifice & Type$Artifact|Clue
|
||||||
|
Oracle:Whenever Innocent Bystander is dealt 3 or more damage, investigate. (Create a Clue token. It's an artifact with "{2}, Sacrifice this artifact: Draw a card.")
|
||||||
Reference in New Issue
Block a user