mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
Update AiController.java (#5863)
* Update AiController.java Add RepParams for AddCounter * Update check with new required params --------- Co-authored-by: TRT <>
This commit is contained in:
@@ -529,6 +529,12 @@ public class AiController {
|
||||
repParams.put(AbilityKey.Destination, ZoneType.Battlefield);
|
||||
repParams.put(AbilityKey.Source, land);
|
||||
|
||||
// add Params for AddCounter Replacements
|
||||
GameEntityCounterTable table = new GameEntityCounterTable();
|
||||
repParams.put(AbilityKey.EffectOnly, true);
|
||||
repParams.put(AbilityKey.CounterTable, table);
|
||||
repParams.put(AbilityKey.CounterMap, table.column(land));
|
||||
|
||||
boolean foundTapped = false;
|
||||
for (ReplacementEffect re : player.getGame().getReplacementHandler().getReplacementList(ReplacementType.Moved, repParams, ReplacementLayer.Other)) {
|
||||
SpellAbility reSA = re.ensureAbility();
|
||||
|
||||
@@ -39,6 +39,7 @@ import forge.game.CardTraitPredicates;
|
||||
import forge.game.Game;
|
||||
import forge.game.GameActionUtil;
|
||||
import forge.game.GameEntity;
|
||||
import forge.game.GameEntityCounterTable;
|
||||
import forge.game.GameObject;
|
||||
import forge.game.GameType;
|
||||
import forge.game.ability.AbilityKey;
|
||||
@@ -3307,6 +3308,11 @@ public class ComputerUtil {
|
||||
repParams.put(AbilityKey.CardLKI, c);
|
||||
repParams.put(AbilityKey.Origin, c.getLastKnownZone().getZoneType());
|
||||
repParams.put(AbilityKey.Destination, ZoneType.Battlefield);
|
||||
// add Params for AddCounter Replacements
|
||||
GameEntityCounterTable table = new GameEntityCounterTable();
|
||||
repParams.put(AbilityKey.EffectOnly, true);
|
||||
repParams.put(AbilityKey.CounterTable, table);
|
||||
repParams.put(AbilityKey.CounterMap, table.column(c));
|
||||
List<ReplacementEffect> list = c.getGame().getReplacementHandler().getReplacementList(ReplacementType.Moved, repParams, ReplacementLayer.CantHappen);
|
||||
return !list.isEmpty();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user