- MoJhoSto: somewhat more varied AI strategy when deciding between Momir and Jhoira. Also, don't spam Jhoira instant copying ability all the time.

This commit is contained in:
Agetian
2018-04-19 23:06:05 +03:00
parent 13b058ed1b
commit da9543e426
3 changed files with 20 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ import forge.card.ColorSet;
import forge.card.MagicColor;
import forge.card.mana.ManaCost;
import forge.game.Game;
import forge.game.GameType;
import forge.game.ability.AbilityFactory;
import forge.game.ability.AbilityUtils;
import forge.game.ability.ApiType;
@@ -43,6 +44,7 @@ import forge.game.staticability.StaticAbility;
import forge.game.trigger.Trigger;
import forge.game.zone.ZoneType;
import forge.util.Aggregates;
import forge.util.MyRandom;
import forge.util.TextUtil;
import forge.util.maps.LinkedHashMapToAmount;
import forge.util.maps.MapToAmount;
@@ -778,6 +780,13 @@ public class SpecialCardAi {
if (source.getGame().getPhaseHandler().getPhase().isBefore(PhaseType.MAIN1)) {
return false;
}
// In MoJhoSto, prefer Jhoira sorcery ability from time to time
if (source.getGame().getRules().hasAppliedVariant(GameType.MoJhoSto)
&& ai.getLandsInPlay().size() >= 3 && MyRandom.percentTrue(50)) {
return false;
}
// Set PayX here to maximum value.
int tokenSize = ComputerUtilMana.determineLeftoverMana(sa, ai);

View File

@@ -5,6 +5,7 @@ import forge.ai.*;
import forge.card.CardStateName;
import forge.card.CardTypeView;
import forge.game.Game;
import forge.game.GameType;
import forge.game.ability.AbilityUtils;
import forge.game.card.Card;
import forge.game.card.CardCollection;
@@ -16,6 +17,7 @@ import forge.game.spellability.Spell;
import forge.game.spellability.SpellAbility;
import forge.game.spellability.TargetRestrictions;
import forge.game.zone.ZoneType;
import forge.util.MyRandom;
import java.util.List;
@@ -54,6 +56,14 @@ public class PlayAi extends SpellAbilityAi {
if ("ReplaySpell".equals(logic)) {
return ComputerUtil.targetPlayableSpellCard(ai, cards, sa, sa.hasParam("WithoutManaCost"));
} else if ("JhoiraAvatarInstant".equals(logic)) {
if (game.getRules().hasAppliedVariant(GameType.MoJhoSto)) {
// Some additional logic for MoJhoSto: don't spam activate the Instant copying ability all the time
// Can probably be improved, but as random as MoJhoSto already is, probably not a huge deal for now
if (MyRandom.percentTrue(80)) {
return false;
}
}
}
if (source != null && source.hasKeyword("Hideaway") && source.hasRemembered()) {

View File

@@ -2,7 +2,7 @@ Name:Jhoira of the Ghitu Avatar
ManaCost:no cost
Types:Vanguard
HandLifeModifier:+1/+0
A:AB$ Play | Cost$ 3 Discard<1/Card> | ActivationZone$ Command | AnySupportedCard$ Instant | RandomCopied$ True | RandomNum$ 3 | ChoiceNum$ 1 | CopyCard$ True | WithoutManaCost$ True | SpellDescription$ Copy three instant cards chosen at random. You may cast one of the copies without paying its mana cost.
A:AB$ Play | Cost$ 3 Discard<1/Card> | ActivationZone$ Command | AnySupportedCard$ Instant | RandomCopied$ True | RandomNum$ 3 | ChoiceNum$ 1 | CopyCard$ True | WithoutManaCost$ True | AILogic$ JhoiraAvatarInstant | SpellDescription$ Copy three instant cards chosen at random. You may cast one of the copies without paying its mana cost.
A:AB$ Play | Cost$ 3 Discard<1/Card> | ActivationZone$ Command | AnySupportedCard$ Sorcery | RandomCopied$ True | RandomNum$ 3 | ChoiceNum$ 1 | CopyCard$ True | WithoutManaCost$ True | SorcerySpeed$ True | SpellDescription$ Copy three sorcery cards chosen at random. You may cast one of the copies without paying its mana cost. Activate this ability only any time you could cast a sorcery.
SVar:Picture:https://downloads.cardforge.org/images/cards/VAN/Jhoira of the Ghitu Avatar.full.jpg
Oracle:Hand +1, life +0\n{3}, Discard a card: Copy three instant cards chosen at random. You may cast one of the copies without paying its mana cost.\n{3}, Discard a card: Copy three sorcery cards chosen at random. You may cast one of the copies without paying its mana cost. Activate this ability only any time you could cast a sorcery.