mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Merge branch 'master' into 'master'
Fixed Cryptoplasm, added some simple AI logic to it. See merge request core-developers/forge!1145
This commit is contained in:
@@ -142,6 +142,10 @@ public class CloneAi extends SpellAbilityAi {
|
||||
CardCollection valid = CardLists.getValidCards(sa.getHostCard().getController().getCardsIn(ZoneType.Battlefield), sa.getParam("ValidTgts"), sa.getHostCard().getController(), sa.getHostCard());
|
||||
sa.getTargets().add(ComputerUtilCard.getBestCreatureAI(valid));
|
||||
return true;
|
||||
} else if ("CloneBestCreature".equals(sa.getParam("AILogic"))) {
|
||||
CardCollection valid = CardLists.getValidCards(sa.getHostCard().getController().getGame().getCardsIn(ZoneType.Battlefield), sa.getParam("ValidTgts"), sa.getHostCard().getController(), sa.getHostCard());
|
||||
sa.getTargets().add(ComputerUtilCard.getBestCreatureAI(valid));
|
||||
return true;
|
||||
}
|
||||
|
||||
// Default:
|
||||
@@ -157,7 +161,14 @@ public class CloneAi extends SpellAbilityAi {
|
||||
*/
|
||||
@Override
|
||||
public boolean confirmAction(Player player, SpellAbility sa, PlayerActionConfirmMode mode, String message) {
|
||||
// Didn't confirm in the original code
|
||||
if (sa.hasParam("AILogic") && sa.usesTargeting() && sa.isTargetNumberValid()) {
|
||||
// Had a special logic for it and managed to target, so confirm if viable
|
||||
if ("CloneBestCreature".equals(sa.getParam("AILogic"))) {
|
||||
return ComputerUtilCard.evaluateCreature(sa.getTargets().getFirstTargetedCard()) > ComputerUtilCard.evaluateCreature(sa.getHostCard());
|
||||
}
|
||||
}
|
||||
|
||||
// Currently doesn't confirm anything that's not defined by AI logic
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ Types:Creature Shapeshifter
|
||||
PT:2/2
|
||||
# Make Svars for granting abilities and triggers on clones distinct to avoid SVars getting overwritten when cloning a clone
|
||||
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ CryptoplasmCopy | OptionalDecider$ You | TriggerDescription$ At the beginning of your upkeep, you may have CARDNAME become a copy of another target creature. If you do, CARDNAME gains this ability.
|
||||
SVar:CryptoplasmCopy:DB$ Clone | ValidTgts$ Creature.Other | TgtPrompt$ Select another target creature to copy. | Optional$ True | GainThisAbility$ True
|
||||
AI:RemoveDeck:All
|
||||
SVar:CryptoplasmCopy:DB$ Clone | ValidTgts$ Creature.Other | TgtPrompt$ Select another target creature to copy. | Optional$ True | GainThisAbility$ True | AddSVars$ CryptoplasmCopy | AILogic$ CloneBestCreature
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/cryptoplasm.jpg
|
||||
Oracle:At the beginning of your upkeep, you may have Cryptoplasm become a copy of another target creature. If you do, Cryptoplasm gains this ability.
|
||||
|
||||
Reference in New Issue
Block a user