mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- The AI will now play auras more often.
- Improved the AI of AF Pump with Defined parameter.
This commit is contained in:
@@ -5,7 +5,7 @@ Text:no text
|
|||||||
K:Enchant creature
|
K:Enchant creature
|
||||||
A:SP$ Attach | Cost$ W | ValidTgts$ Creature | AILogic$ Curse
|
A:SP$ Attach | Cost$ W | ValidTgts$ Creature | AILogic$ Curse
|
||||||
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddHiddenKeyword$ HIDDEN CARDNAME can't block. & HIDDEN CARDNAME's activated abilities can't be activated. | Description$ Enchanted creature can't block and its activated abilities can't be activated.
|
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddHiddenKeyword$ HIDDEN CARDNAME can't block. & HIDDEN CARDNAME's activated abilities can't be activated. | Description$ Enchanted creature can't block and its activated abilities can't be activated.
|
||||||
A:AB$ Pump | Cost$ S | Defined$ Enchanted | KW$ Defender | SpellDescription$ Enchanted creature gains defender until end of turn.
|
A:AB$ Pump | Cost$ S | Defined$ Enchanted | KW$ Defender | IsCurse$ True | SpellDescription$ Enchanted creature gains defender until end of turn.
|
||||||
# AI can now use snow mana to pay for activated abilities.
|
# AI can now use snow mana to pay for activated abilities.
|
||||||
SVar:RemRandomDeck:True
|
SVar:RemRandomDeck:True
|
||||||
SVar:Rarity:Common
|
SVar:Rarity:Common
|
||||||
|
|||||||
@@ -929,7 +929,7 @@ public class AbilityFactoryAttach {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
chance &= r.nextFloat() <= .75;
|
chance &= r.nextFloat() <= .9;
|
||||||
|
|
||||||
return chance;
|
return chance;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -518,23 +518,48 @@ public class AbilityFactoryPump {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final boolean givesKws = !this.keywords.get(0).equals("none");
|
||||||
|
String[] kwPump = { "none" };
|
||||||
|
if (givesKws) {
|
||||||
|
kwPump = this.keywords.toArray(new String[this.keywords.size()]);
|
||||||
|
}
|
||||||
|
final String[] keywords = kwPump;
|
||||||
|
|
||||||
// when this happens we need to expand AI to consider if its ok for
|
// when this happens we need to expand AI to consider if its ok for
|
||||||
// everything?
|
// everything?
|
||||||
for (final Card card : cards) {
|
for (final Card card : cards) {
|
||||||
// TODO: if AI doesn't control Card and Pump is a Curse, than
|
final Random r = MyRandom.getRandom();
|
||||||
// maybe use?
|
|
||||||
|
// Don't add duplicate keywords
|
||||||
|
final boolean hKW = card.hasAnyKeyword(keywords);
|
||||||
|
if (givesKws && hKW) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.abilityFactory.isCurse()) {
|
||||||
|
if (card.getController().isComputer()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (AllZone.getPhaseHandler().isPlayerTurn(AllZone.getComputerPlayer())
|
||||||
|
&& this.keywords.contains("Defender")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (AllZone.getPhaseHandler().isPlayerTurn(AllZone.getHumanPlayer())
|
||||||
|
&& this.keywords.contains("HIDDEN CARDNAME can't block.")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return (r.nextFloat() <= Math.pow(.6667, activations));
|
||||||
|
}
|
||||||
if (((card.getNetDefense() + defense) > 0) && (!card.hasAnyKeyword(this.keywords))) {
|
if (((card.getNetDefense() + defense) > 0) && (!card.hasAnyKeyword(this.keywords))) {
|
||||||
if (card.hasSickness() && this.keywords.contains("Haste")) {
|
if (card.hasSickness() && this.keywords.contains("Haste")) {
|
||||||
return true;
|
return true;
|
||||||
} else if (card.hasSickness() ^ this.keywords.contains("Haste")) {
|
} else if (card.hasSickness() ^ this.keywords.contains("Haste")) {
|
||||||
return false;
|
return false;
|
||||||
} else if (this.hostCard.equals(card)) {
|
} else if (this.hostCard.equals(card)) {
|
||||||
final Random r = MyRandom.getRandom();
|
|
||||||
if (r.nextFloat() <= Math.pow(.6667, activations)) {
|
if (r.nextFloat() <= Math.pow(.6667, activations)) {
|
||||||
return CardFactoryUtil.doesCreatureAttackAI(card) && !sa.getPayCosts().getTap();
|
return CardFactoryUtil.doesCreatureAttackAI(card) && !sa.getPayCosts().getTap();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
final Random r = MyRandom.getRandom();
|
|
||||||
return (r.nextFloat() <= Math.pow(.6667, activations));
|
return (r.nextFloat() <= Math.pow(.6667, activations));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user