mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Merge branch 'master' into 'master'
- Fix logic in DamageDealAi, update logic for Chandra, Fire of Kaladesh. See merge request core-developers/forge!664
This commit is contained in:
@@ -481,10 +481,11 @@ public class DamageDealAi extends DamageAiBase {
|
|||||||
final PhaseHandler phase = game.getPhaseHandler();
|
final PhaseHandler phase = game.getPhaseHandler();
|
||||||
final boolean divided = sa.hasParam("DividedAsYouChoose");
|
final boolean divided = sa.hasParam("DividedAsYouChoose");
|
||||||
final boolean oppTargetsChoice = sa.hasParam("TargetingPlayer");
|
final boolean oppTargetsChoice = sa.hasParam("TargetingPlayer");
|
||||||
|
final String logic = sa.getParamOrDefault("AILogic", "");
|
||||||
|
|
||||||
Player enemy = ComputerUtil.getOpponentFor(ai);
|
Player enemy = ComputerUtil.getOpponentFor(ai);
|
||||||
|
|
||||||
if ("PowerDmg".equals(sa.getParam("AILogic"))) {
|
if ("PowerDmg".equals(logic)) {
|
||||||
// check if it is better to target the player instead, the original target is already set in PumpAi.pumpTgtAI()
|
// check if it is better to target the player instead, the original target is already set in PumpAi.pumpTgtAI()
|
||||||
if (tgt.canTgtCreatureAndPlayer() && this.shouldTgtP(ai, sa, dmg, noPrevention)){
|
if (tgt.canTgtCreatureAndPlayer() && this.shouldTgtP(ai, sa, dmg, noPrevention)){
|
||||||
sa.resetTargets();
|
sa.resetTargets();
|
||||||
@@ -504,11 +505,11 @@ public class DamageDealAi extends DamageAiBase {
|
|||||||
TargetChoices tcs = sa.getTargets();
|
TargetChoices tcs = sa.getTargets();
|
||||||
|
|
||||||
// Do not use if would kill self
|
// Do not use if would kill self
|
||||||
if (("SelfDamage".equals(sa.getParam("AILogic"))) && (ai.getLife() <= Integer.parseInt(source.getSVar("SelfDamageAmount")))) {
|
if (("SelfDamage".equals(logic)) && (ai.getLife() <= Integer.parseInt(source.getSVar("SelfDamageAmount")))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("ChoiceBurn".equals(sa.getParam("AILogic"))) {
|
if ("ChoiceBurn".equals(logic)) {
|
||||||
// do not waste burns on player if other choices are present
|
// do not waste burns on player if other choices are present
|
||||||
if (this.shouldTgtP(ai, sa, dmg, noPrevention)) {
|
if (this.shouldTgtP(ai, sa, dmg, noPrevention)) {
|
||||||
tcs.add(enemy);
|
tcs.add(enemy);
|
||||||
@@ -517,7 +518,7 @@ public class DamageDealAi extends DamageAiBase {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ("Polukranos".equals(sa.getParam("AILogic"))) {
|
if ("Polukranos".equals(logic)) {
|
||||||
int dmgTaken = 0;
|
int dmgTaken = 0;
|
||||||
CardCollection humCreatures = enemy.getCreaturesInPlay();
|
CardCollection humCreatures = enemy.getCreaturesInPlay();
|
||||||
Card lastTgt = null;
|
Card lastTgt = null;
|
||||||
@@ -681,7 +682,7 @@ public class DamageDealAi extends DamageAiBase {
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else if ("OppAtTenLife".equals(sa.getParam("AILogic"))) {
|
} else if ("OppAtTenLife".equals(logic)) {
|
||||||
for (final Player p : ai.getOpponents()) {
|
for (final Player p : ai.getOpponents()) {
|
||||||
if (sa.canTarget(p) && p.getLife() == 10 && tcs.getNumTargeted() < tgt.getMaxTargets(source, sa)) {
|
if (sa.canTarget(p) && p.getLife() == 10 && tcs.getNumTargeted() < tgt.getMaxTargets(source, sa)) {
|
||||||
tcs.add(p);
|
tcs.add(p);
|
||||||
@@ -690,9 +691,10 @@ public class DamageDealAi extends DamageAiBase {
|
|||||||
}
|
}
|
||||||
// TODO: Improve Damage, we shouldn't just target the player just
|
// TODO: Improve Damage, we shouldn't just target the player just
|
||||||
// because we can
|
// because we can
|
||||||
else if (sa.canTarget(enemy)) {
|
if (sa.canTarget(enemy) && tcs.getNumTargeted() < tgt.getMaxTargets(source, sa)) {
|
||||||
if (((phase.is(PhaseType.END_OF_TURN) && phase.getNextTurn().equals(ai))
|
if (((phase.is(PhaseType.END_OF_TURN) && phase.getNextTurn().equals(ai))
|
||||||
|| (SpellAbilityAi.isSorcerySpeed(sa) && phase.is(PhaseType.MAIN2))
|
|| (SpellAbilityAi.isSorcerySpeed(sa) && phase.is(PhaseType.MAIN2))
|
||||||
|
|| ("PingAfterAttack".equals(logic) && phase.getPhase().isAfter(PhaseType.COMBAT_DECLARE_ATTACKERS) && phase.isPlayerTurn(ai))
|
||||||
|| sa.getPayCosts() == null || immediately
|
|| sa.getPayCosts() == null || immediately
|
||||||
|| this.shouldTgtP(ai, sa, dmg, noPrevention)) &&
|
|| this.shouldTgtP(ai, sa, dmg, noPrevention)) &&
|
||||||
(!avoidTargetP(ai, sa))) {
|
(!avoidTargetP(ai, sa))) {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ Types:Legendary Creature Human Shaman
|
|||||||
PT:2/2
|
PT:2/2
|
||||||
T:Mode$ SpellCast | ValidCard$ Card.Red | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigUntap | TriggerDescription$ Whenever you cast a red spell, untap CARDNAME.
|
T:Mode$ SpellCast | ValidCard$ Card.Red | ValidActivatingPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigUntap | TriggerDescription$ Whenever you cast a red spell, untap CARDNAME.
|
||||||
SVar:TrigUntap:DB$ Untap | Defined$ Self
|
SVar:TrigUntap:DB$ Untap | Defined$ Self
|
||||||
A:AB$ DealDamage | Cost$ T | ValidTgts$ Player,Planeswalker | TgtPrompt$ Select target player or planeswalker | NumDmg$ 1 | References$ X | SubAbility$ DBTransform | SpellDescription$ CARDNAME deals 1 damage to target player or planeswalker. If CARDNAME has dealt 3 or more damage this turn, exile her, then return her to the battlefield transformed under her owner's control.
|
A:AB$ DealDamage | Cost$ T | ValidTgts$ Player,Planeswalker | TgtPrompt$ Select target player or planeswalker | NumDmg$ 1 | References$ X | SubAbility$ DBTransform | AILogic$ PingAfterAttack | SpellDescription$ CARDNAME deals 1 damage to target player or planeswalker. If CARDNAME has dealt 3 or more damage this turn, exile her, then return her to the battlefield transformed under her owner's control.
|
||||||
SVar:DBTransform:DB$ ChangeZone | Origin$ Battlefield | Destination$ Exile | RememberChanged$ True | SubAbility$ DBReturn | ConditionCheckSVar$ X | ConditionSVarCompare$ GE3 | References$ X | StackDescription$ If CARDNAME has dealt 3 or more damage this turn, exile her, then return her to the battlefield transformed under her owner's control.
|
SVar:DBTransform:DB$ ChangeZone | Origin$ Battlefield | Destination$ Exile | RememberChanged$ True | SubAbility$ DBReturn | ConditionCheckSVar$ X | ConditionSVarCompare$ GE3 | References$ X | StackDescription$ If CARDNAME has dealt 3 or more damage this turn, exile her, then return her to the battlefield transformed under her owner's control.
|
||||||
SVar:DBReturn:DB$ ChangeZone | Defined$ Remembered | Origin$ Exile | Destination$ Battlefield | Transformed$ True | WithCounters$ LOYALTY_4 | SubAbility$ DBCleanup | StackDescription$
|
SVar:DBReturn:DB$ ChangeZone | Defined$ Remembered | Origin$ Exile | Destination$ Battlefield | Transformed$ True | WithCounters$ LOYALTY_4 | SubAbility$ DBCleanup | StackDescription$
|
||||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||||
|
|||||||
Reference in New Issue
Block a user