mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- The AI will now use Multikicker for Permanents.
This commit is contained in:
@@ -29,6 +29,7 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
|
||||
|
||||
import com.esotericsoftware.minlog.Log;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Predicate;
|
||||
@@ -713,6 +714,21 @@ public class AiController {
|
||||
}
|
||||
}
|
||||
|
||||
if (sa.hasParam("Announce") && sa.getParam("Announce").startsWith("Multikicker")) {
|
||||
//String announce = sa.getParam("Announce");
|
||||
ManaCost mkCost = sa.getMultiKickerManaCost();
|
||||
ManaCost mCost = sa.getPayCosts().getTotalMana();
|
||||
for (int i = 0; i < 10; i++) {
|
||||
mCost = ManaCost.combine(mCost, mkCost);
|
||||
ManaCostBeingPaid mcbp = new ManaCostBeingPaid(mCost);
|
||||
if (!ComputerUtilMana.canPayManaCost(mcbp, sa, player)) {
|
||||
card.setKickerMagnitude(i);
|
||||
break;
|
||||
}
|
||||
card.setKickerMagnitude(i+1);
|
||||
}
|
||||
}
|
||||
|
||||
// Prevent the computer from summoning Ball Lightning type creatures after attacking
|
||||
if (card.hasSVar("EndOfTurnLeavePlay")
|
||||
&& (game.getPhaseHandler().isPlayerTurn(player.getOpponent())
|
||||
|
||||
@@ -959,10 +959,11 @@ public class ComputerUtilMana {
|
||||
* @return ManaCost
|
||||
*/
|
||||
static ManaCostBeingPaid calculateManaCost(final SpellAbility sa, final boolean test, final int extraMana) {
|
||||
Card card = sa.getHostCard();
|
||||
ZoneType castFromBackup = null;
|
||||
if (test && sa.isSpell()) {
|
||||
castFromBackup = sa.getHostCard().getCastFrom();
|
||||
sa.getHostCard().setCastFrom(sa.getHostCard().getZone().getZoneType());
|
||||
castFromBackup = card.getCastFrom();
|
||||
sa.getHostCard().setCastFrom(card.getZone().getZoneType());
|
||||
}
|
||||
|
||||
Cost payCosts = sa.getPayCosts();
|
||||
@@ -976,9 +977,8 @@ public class ComputerUtilMana {
|
||||
ManaCostBeingPaid cost = new ManaCostBeingPaid(mana, restriction);
|
||||
ManaCostAdjustment.adjust(cost, sa, null, test);
|
||||
|
||||
final Card card = sa.getHostCard();
|
||||
// Tack xMana Payments into mana here if X is a set value
|
||||
if ((sa.getPayCosts() != null) && (cost.getXcounter() > 0 || extraMana > 0)) {
|
||||
if (sa.getPayCosts() != null && (cost.getXcounter() > 0 || extraMana > 0)) {
|
||||
int manaToAdd = 0;
|
||||
if (test && extraMana > 0) {
|
||||
final int multiplicator = Math.max(cost.getXcounter(), 1);
|
||||
@@ -1005,6 +1005,14 @@ public class ComputerUtilMana {
|
||||
}
|
||||
}
|
||||
|
||||
int timesMultikicked = card.getKickerMagnitude();
|
||||
if (timesMultikicked > 0 && sa.hasParam("Announce") && sa.getParam("Announce").startsWith("Multikicker")) {
|
||||
ManaCost mkCost = sa.getMultiKickerManaCost();
|
||||
for (int i = 0; i < timesMultikicked; i++) {
|
||||
cost.addManaCost(mkCost);
|
||||
}
|
||||
}
|
||||
|
||||
if (test && sa.isSpell()) {
|
||||
sa.getHostCard().setCastFrom(castFromBackup);
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@ ManaCost:2 R
|
||||
Types:Sorcery
|
||||
A:SP$ DamageAll | Cost$ 2 R | NumDmg$ X | ValidCards$ Creature | ValidDescription$ each creature. | References$ X | SpellDescription$ Converge — CARDNAME deals X damage to each creature, where X is the number of colors of mana spent to cast CARDNAME.
|
||||
SVar:X:Count$Converge
|
||||
SVar:RemAIDeck:True
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/radiant_flames.jpg
|
||||
Oracle:Converge — Radiant Flames deals X damage to each creature, where X is the number of colors of mana spent to cast Radiant Flames.
|
||||
|
||||
Reference in New Issue
Block a user