mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
Merge branch 'sentry-bug-fixes' into 'master'
Sentry bug fixes See merge request core-developers/forge!948
This commit is contained in:
@@ -1484,22 +1484,24 @@ public class AiController {
|
||||
boolean hasLeyline1 = false;
|
||||
SpellAbility saGemstones = null;
|
||||
|
||||
for(int i = 0; i < result.size(); i++) {
|
||||
SpellAbility sa = result.get(i);
|
||||
|
||||
List<SpellAbility> toRemove = Lists.newArrayList();
|
||||
for(SpellAbility sa : result) {
|
||||
String srcName = sa.getHostCard().getName();
|
||||
if ("Gemstone Caverns".equals(srcName)) {
|
||||
if (saGemstones == null)
|
||||
saGemstones = sa;
|
||||
else
|
||||
result.remove(i--);
|
||||
toRemove.add(sa);
|
||||
} else if ("Leyline of Singularity".equals(srcName)) {
|
||||
if (!hasLeyline1)
|
||||
hasLeyline1 = true;
|
||||
else
|
||||
result.remove(i--);
|
||||
toRemove.add(sa);
|
||||
}
|
||||
}
|
||||
for(SpellAbility sa : toRemove) {
|
||||
result.remove(sa);
|
||||
}
|
||||
|
||||
// Play them last
|
||||
if (saGemstones != null) {
|
||||
|
||||
@@ -798,16 +798,18 @@ public class GameAction {
|
||||
public boolean visit(final Card c) {
|
||||
// need to get Card from preList if able
|
||||
final Card co = preList.get(c);
|
||||
for (int i = 0; i < co.getStaticAbilities().size(); i++) {
|
||||
final StaticAbility stAb = co.getStaticAbilities().get(i);
|
||||
List<StaticAbility> toRemove = Lists.newArrayList();
|
||||
for (StaticAbility stAb : co.getStaticAbilities()) {
|
||||
if (stAb.getMapParams().get("Mode").equals("Continuous")) {
|
||||
staticAbilities.add(stAb);
|
||||
}
|
||||
if (stAb.isTemporary()) {
|
||||
co.removeStaticAbility(stAb);
|
||||
i--;
|
||||
toRemove.add(stAb);
|
||||
}
|
||||
}
|
||||
for (StaticAbility stAb : toRemove) {
|
||||
co.removeStaticAbility(stAb);
|
||||
}
|
||||
if (!co.getStaticCommandList().isEmpty()) {
|
||||
staticList.add(co);
|
||||
}
|
||||
@@ -851,8 +853,8 @@ public class GameAction {
|
||||
}
|
||||
|
||||
for (final Card c : staticList) {
|
||||
for (int i = 0; i < c.getStaticCommandList().size(); i++) {
|
||||
final Object[] staticCheck = c.getStaticCommandList().get(i);
|
||||
List<Object[]> toRemove = Lists.newArrayList();
|
||||
for (Object[] staticCheck : c.getStaticCommandList()) {
|
||||
final String leftVar = (String) staticCheck[0];
|
||||
final String rightVar = (String) staticCheck[1];
|
||||
final Card affected = (Card) staticCheck[2];
|
||||
@@ -863,11 +865,13 @@ public class GameAction {
|
||||
final int operandValue = AbilityUtils.calculateAmount(c, svarOperand, null);
|
||||
if (Expressions.compare(sVar, svarOperator, operandValue)) {
|
||||
((GameCommand) staticCheck[3]).run();
|
||||
c.getStaticCommandList().remove(i);
|
||||
i--;
|
||||
toRemove.add(staticCheck);
|
||||
affectedCards.add(c);
|
||||
}
|
||||
}
|
||||
for (Object[] staticCheck : c.getStaticCommandList()) {
|
||||
c.getStaticCommandList().remove(staticCheck);
|
||||
}
|
||||
}
|
||||
// Exclude cards in hidden zones from update
|
||||
Iterator<Card> it = affectedCards.iterator();
|
||||
|
||||
@@ -309,13 +309,15 @@ public class ReplacementHandler {
|
||||
game.forEachCardInGame(new Visitor<Card>() {
|
||||
@Override
|
||||
public boolean visit(Card c) {
|
||||
for (int i = 0; i < c.getReplacementEffects().size(); i++) {
|
||||
ReplacementEffect rep = c.getReplacementEffects().get(i);
|
||||
List<ReplacementEffect> toRemove = Lists.newArrayList();
|
||||
for (ReplacementEffect rep : c.getReplacementEffects()) {
|
||||
if (rep.isTemporary()) {
|
||||
c.removeReplacementEffect(rep);
|
||||
i--;
|
||||
toRemove.add(rep);
|
||||
}
|
||||
}
|
||||
for (ReplacementEffect rep : toRemove) {
|
||||
c.removeReplacementEffect(rep);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user