mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Merge pull request #2326 from tool4ever/agrusfix
Fix Agrus Kos free target selection for triggers
This commit is contained in:
@@ -1090,7 +1090,7 @@ public class PlayerControllerAi extends PlayerController {
|
|||||||
@Override
|
@Override
|
||||||
public void orderAndPlaySimultaneousSa(List<SpellAbility> activePlayerSAs) {
|
public void orderAndPlaySimultaneousSa(List<SpellAbility> activePlayerSAs) {
|
||||||
for (final SpellAbility sa : getAi().orderPlaySa(activePlayerSAs)) {
|
for (final SpellAbility sa : getAi().orderPlaySa(activePlayerSAs)) {
|
||||||
if (sa.isTrigger()) {
|
if (sa.isTrigger() && !sa.isCopied()) {
|
||||||
if (prepareSingleSa(sa.getHostCard(), sa, true)) {
|
if (prepareSingleSa(sa.getHostCard(), sa, true)) {
|
||||||
ComputerUtil.playStack(sa, player, getGame());
|
ComputerUtil.playStack(sa, player, getGame());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -738,11 +738,7 @@ public class DamageDealAi extends DamageAiBase {
|
|||||||
dump = true;
|
dump = true;
|
||||||
}
|
}
|
||||||
final int assignedDamage = dump ? dmg : ComputerUtilCombat.getEnoughDamageToKill(c, dmg, source, false, noPrevention);
|
final int assignedDamage = dump ? dmg : ComputerUtilCombat.getEnoughDamageToKill(c, dmg, source, false, noPrevention);
|
||||||
if (assignedDamage <= dmg) {
|
sa.addDividedAllocation(c, Math.min(assignedDamage, dmg));
|
||||||
sa.addDividedAllocation(c, assignedDamage);
|
|
||||||
} else {
|
|
||||||
sa.addDividedAllocation(c, dmg);
|
|
||||||
}
|
|
||||||
dmg = dmg - assignedDamage;
|
dmg = dmg - assignedDamage;
|
||||||
if (dmg <= 0) {
|
if (dmg <= 0) {
|
||||||
break;
|
break;
|
||||||
@@ -752,10 +748,12 @@ public class DamageDealAi extends DamageAiBase {
|
|||||||
}
|
}
|
||||||
} else if ("OppAtTenLife".equals(logic)) {
|
} 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.size() < tgt.getMaxTargets(source, sa)) {
|
if (sa.canTarget(p) && p.getLife() == 10) {
|
||||||
tcs.add(p);
|
tcs.add(p);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
// TODO: Improve Damage, we shouldn't just target the player just because we can
|
// TODO: Improve Damage, we shouldn't just target the player just because we can
|
||||||
if (sa.canTarget(enemy) && tcs.size() < tgt.getMaxTargets(source, sa)) {
|
if (sa.canTarget(enemy) && tcs.size() < tgt.getMaxTargets(source, sa)) {
|
||||||
|
|||||||
@@ -1965,17 +1965,6 @@ public class AbilityUtils {
|
|||||||
|
|
||||||
} // end ctb != null
|
} // end ctb != null
|
||||||
|
|
||||||
if (sq[0].contains("OppsAtLifeTotal")) {
|
|
||||||
final int lifeTotal = calculateAmount(c, sq[1], ctb);
|
|
||||||
int number = 0;
|
|
||||||
for (final Player opp : player.getOpponents()) {
|
|
||||||
if (opp.getLife() == lifeTotal) {
|
|
||||||
number++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return doXMath(number, expr, c, ctb);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Count$SearchedLibrary.<DefinedPlayer>
|
//Count$SearchedLibrary.<DefinedPlayer>
|
||||||
if (sq[0].contains("SearchedLibrary")) {
|
if (sq[0].contains("SearchedLibrary")) {
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
|
|||||||
@@ -3,6 +3,4 @@ ManaCost:3 R
|
|||||||
Types:Instant
|
Types:Instant
|
||||||
A:SP$ DealDamage | Cost$ 3 R | ValidTgts$ Player | TgtPrompt$ Select target player | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ10 | NumDmg$ 10 | AILogic$ OppAtTenLife | SpellDescription$ If target player has exactly 10 life, CARDNAME deals 10 damage to that player.
|
A:SP$ DealDamage | Cost$ 3 R | ValidTgts$ Player | TgtPrompt$ Select target player | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ10 | NumDmg$ 10 | AILogic$ OppAtTenLife | SpellDescription$ If target player has exactly 10 life, CARDNAME deals 10 damage to that player.
|
||||||
SVar:X:TargetedPlayer$LifeTotal
|
SVar:X:TargetedPlayer$LifeTotal
|
||||||
SVar:Y:Count$OppsAtLifeTotal.10
|
|
||||||
SVar:NeedsToPlayVar:Y GE1
|
|
||||||
Oracle:If target player has exactly 10 life, Hidetsugu's Second Rite deals 10 damage to that player.
|
Oracle:If target player has exactly 10 life, Hidetsugu's Second Rite deals 10 damage to that player.
|
||||||
|
|||||||
@@ -1946,7 +1946,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
|||||||
}
|
}
|
||||||
for (int i = orderedSAs.size() - 1; i >= 0; i--) {
|
for (int i = orderedSAs.size() - 1; i >= 0; i--) {
|
||||||
final SpellAbility next = orderedSAs.get(i);
|
final SpellAbility next = orderedSAs.get(i);
|
||||||
if (next.isTrigger()) {
|
if (next.isTrigger() && !next.isCopied()) {
|
||||||
HumanPlay.playSpellAbility(this, player, next);
|
HumanPlay.playSpellAbility(this, player, next);
|
||||||
} else {
|
} else {
|
||||||
if (next.isCopied()) {
|
if (next.isCopied()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user