mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
Merge branch 'donate' into 'master'
Donate refactor See merge request core-developers/forge!6177
This commit is contained in:
@@ -26,6 +26,7 @@ import com.google.common.collect.Lists;
|
|||||||
|
|
||||||
import forge.ai.ComputerUtilCard;
|
import forge.ai.ComputerUtilCard;
|
||||||
import forge.ai.ComputerUtilCombat;
|
import forge.ai.ComputerUtilCombat;
|
||||||
|
import forge.ai.SpecialCardAi;
|
||||||
import forge.ai.SpellAbilityAi;
|
import forge.ai.SpellAbilityAi;
|
||||||
import forge.game.Game;
|
import forge.game.Game;
|
||||||
import forge.game.ability.AbilityUtils;
|
import forge.game.ability.AbilityUtils;
|
||||||
@@ -296,6 +297,13 @@ public class ControlGainAi extends SpellAbilityAi {
|
|||||||
@Override
|
@Override
|
||||||
public boolean chkAIDrawback(SpellAbility sa, final Player ai) {
|
public boolean chkAIDrawback(SpellAbility sa, final Player ai) {
|
||||||
final Game game = ai.getGame();
|
final Game game = ai.getGame();
|
||||||
|
|
||||||
|
// Special card logic that is processed elsewhere
|
||||||
|
if (sa.getParam("AILogic").equals("DonateTargetPerm")) {
|
||||||
|
// Donate step 2 - target a donatable permanent.
|
||||||
|
return SpecialCardAi.Donate.considerDonatingPermanent(ai, sa);
|
||||||
|
}
|
||||||
|
|
||||||
if (!sa.usesTargeting()) {
|
if (!sa.usesTargeting()) {
|
||||||
if (sa.hasParam("AllValid")) {
|
if (sa.hasParam("AllValid")) {
|
||||||
CardCollectionView tgtCards = CardLists.filterControlledBy(game.getCardsIn(ZoneType.Battlefield), ai.getOpponents());
|
CardCollectionView tgtCards = CardLists.filterControlledBy(game.getCardsIn(ZoneType.Battlefield), ai.getOpponents());
|
||||||
|
|||||||
@@ -451,9 +451,6 @@ public class PumpAi extends PumpAiBase {
|
|||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (sa.getParam("AILogic").equals("DonateTargetPerm")) {
|
|
||||||
// Donate step 2 - target a donatable permanent.
|
|
||||||
return SpecialCardAi.Donate.considerDonatingPermanent(ai, sa);
|
|
||||||
} else if (sa.getParam("AILogic").equals("SacOneEach")) {
|
} else if (sa.getParam("AILogic").equals("SacOneEach")) {
|
||||||
// each player sacrifices one permanent, e.g. Vaevictis, Asmadi the Dire - grab the worst for allied and
|
// each player sacrifices one permanent, e.g. Vaevictis, Asmadi the Dire - grab the worst for allied and
|
||||||
// the best for opponents
|
// the best for opponents
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
Name:Donate
|
Name:Donate
|
||||||
ManaCost:2 U
|
ManaCost:2 U
|
||||||
Types:Sorcery
|
Types:Sorcery
|
||||||
A:SP$ Pump | Cost$ 2 U | ValidTgts$ Player | TgtPrompt$ Select target player | SubAbility$ D1 | AILogic$ DonateTargetPlayer | RememberObjects$ Targeted | SpellDescription$ Target player gains control of target permanent you control. | StackDescription$ None
|
A:SP$ Pump | ValidTgts$ Player | TgtPrompt$ Select target player | SubAbility$ DBGiveControl | AILogic$ DonateTargetPlayer | SpellDescription$ Target player gains control of target permanent you control. | StackDescription$ None
|
||||||
SVar:D1:DB$ Pump | ValidTgts$ Permanent.YouCtrl | TgtPrompt$ Select target permanent you control | SubAbility$ D2 | AILogic$ DonateTargetPerm | StackDescription$ None
|
SVar:DBGiveControl:DB$ GainControl | ValidTgts$ Permanent.YouCtrl | TgtPrompt$ Select target permanent you control | Defined$ Targeted | NewController$ ParentTarget | AILogic$ DonateTargetPerm
|
||||||
SVar:D2:DB$ GainControl | Defined$ Targeted | NewController$ Remembered | SubAbility$ D3
|
|
||||||
SVar:D3:DB$ Cleanup | ClearRemembered$ True
|
|
||||||
AI:RemoveDeck:Random
|
AI:RemoveDeck:Random
|
||||||
SVar:DoNotDiscardIfAble:TRUE
|
SVar:DoNotDiscardIfAble:TRUE
|
||||||
Oracle:Target player gains control of target permanent you control.
|
Oracle:Target player gains control of target permanent you control.
|
||||||
|
|||||||
Reference in New Issue
Block a user