mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
TriggerEnlist: add Param for Goblin Morale Sergeant
This commit is contained in:
@@ -63,6 +63,7 @@ public enum AbilityKey {
|
||||
DividedShieldAmount("DividedShieldAmount"),
|
||||
EchoPaid("EchoPaid"),
|
||||
EffectOnly("EffectOnly"),
|
||||
Enlisted("Enlisted"),
|
||||
Exploited("Exploited"),
|
||||
Explorer("Explorer"),
|
||||
ExtraTurn("ExtraTurn"),
|
||||
|
||||
@@ -79,6 +79,7 @@ public class CostEnlist extends CostPartWithTrigger {
|
||||
payTrig.addRemembered(targetCard);
|
||||
|
||||
final Map<AbilityKey, Object> runParams = AbilityKey.mapFromCard(payTrig.getHostCard());
|
||||
runParams.put(AbilityKey.Enlisted, targetCard);
|
||||
targetCard.getGame().getTriggerHandler().runTrigger(TriggerType.Enlisted, runParams, false);
|
||||
return targetCard;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,10 @@ import forge.game.trigger.TriggerHandler;
|
||||
import forge.game.trigger.TriggerType;
|
||||
|
||||
public abstract class CostPartWithTrigger extends CostPartWithList {
|
||||
/**
|
||||
* Serializables need a version ID.
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public CostPartWithTrigger(final String amount, final String type, final String description) {
|
||||
super(amount, type, description);
|
||||
|
||||
@@ -27,12 +27,15 @@ public class TriggerEnlisted extends Trigger {
|
||||
if (!matchesValidParam("ValidCard", runParams.get(AbilityKey.Card))) {
|
||||
return false;
|
||||
}
|
||||
if (!matchesValidParam("ValidEnlisted", runParams.get(AbilityKey.Enlisted))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTriggeringObjects(SpellAbility sa, Map<AbilityKey, Object> runParams) {
|
||||
sa.setTriggeringObjectsFrom(runParams, AbilityKey.Card);
|
||||
sa.setTriggeringObjectsFrom(runParams, AbilityKey.Card, AbilityKey.Enlisted);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user