mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- Attempt to fix another crash based on getAbility of RepeatEachEffect (Experimental Kraj)
This commit is contained in:
@@ -46,7 +46,7 @@ public class DelayedTriggerAi extends SpellAbilityAi {
|
|||||||
@Override
|
@Override
|
||||||
protected boolean canPlayAI(Player ai, SpellAbility sa) {
|
protected boolean canPlayAI(Player ai, SpellAbility sa) {
|
||||||
final String svarName = sa.getParam("Execute");
|
final String svarName = sa.getParam("Execute");
|
||||||
final SpellAbility trigsa = AbilityFactory.getAbility(sa.getHostCard().getSVar(svarName), sa.getHostCard());
|
final SpellAbility trigsa = AbilityFactory.getAbility(sa.getSVar(svarName), sa.getHostCard());
|
||||||
trigsa.setActivatingPlayer(ai);
|
trigsa.setActivatingPlayer(ai);
|
||||||
return AiPlayDecision.WillPlay == ((PlayerControllerAi)ai.getController()).getAi().canPlaySa(trigsa);
|
return AiPlayDecision.WillPlay == ((PlayerControllerAi)ai.getController()).getAi().canPlaySa(trigsa);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,6 +166,10 @@ public final class AbilityFactory {
|
|||||||
spellAbility.setSVar(mapParams.get("Execute"), hostCard.getSVar(mapParams.get("Execute")));
|
spellAbility.setSVar(mapParams.get("Execute"), hostCard.getSVar(mapParams.get("Execute")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (api == ApiType.RepeatEach) {
|
||||||
|
spellAbility.setSVar(mapParams.get("RepeatSubAbility"), hostCard.getSVar(mapParams.get("RepeatSubAbility")));
|
||||||
|
}
|
||||||
|
|
||||||
if (mapParams.containsKey("PreventionSubAbility")) {
|
if (mapParams.containsKey("PreventionSubAbility")) {
|
||||||
spellAbility.setSVar(mapParams.get("PreventionSubAbility"), hostCard.getSVar(mapParams.get("PreventionSubAbility")));
|
spellAbility.setSVar(mapParams.get("PreventionSubAbility"), hostCard.getSVar(mapParams.get("PreventionSubAbility")));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class RepeatEachEffect extends SpellAbilityEffect {
|
|||||||
Card source = sa.getHostCard();
|
Card source = sa.getHostCard();
|
||||||
|
|
||||||
// setup subability to repeat
|
// setup subability to repeat
|
||||||
final SpellAbility repeat = AbilityFactory.getAbility(sa.getHostCard().getSVar(sa.getParam("RepeatSubAbility")), source);
|
final SpellAbility repeat = AbilityFactory.getAbility(sa.getSVar(sa.getParam("RepeatSubAbility")), source);
|
||||||
repeat.setActivatingPlayer(sa.getActivatingPlayer());
|
repeat.setActivatingPlayer(sa.getActivatingPlayer());
|
||||||
((AbilitySub) repeat).setParent(sa);
|
((AbilitySub) repeat).setParent(sa);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user