mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
Debuff: with keyword changes, directly remove of keywords is not needed anymore, let changed keywords handle that
This commit is contained in:
@@ -68,7 +68,6 @@ public class DebuffEffect extends SpellAbilityEffect {
|
|||||||
final long timestamp = game.getNextTimestamp();
|
final long timestamp = game.getNextTimestamp();
|
||||||
|
|
||||||
for (final Card tgtC : getTargetCards(sa)) {
|
for (final Card tgtC : getTargetCards(sa)) {
|
||||||
final List<String> hadIntrinsic = Lists.newArrayList();
|
|
||||||
final List<String> addedKW = Lists.newArrayList();
|
final List<String> addedKW = Lists.newArrayList();
|
||||||
final List<String> removedKW = Lists.newArrayList();
|
final List<String> removedKW = Lists.newArrayList();
|
||||||
if (tgtC.isInPlay() && tgtC.canBeTargetedBy(sa)) {
|
if (tgtC.isInPlay() && tgtC.canBeTargetedBy(sa)) {
|
||||||
@@ -104,12 +103,6 @@ public class DebuffEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tgtC.getCurrentState().hasIntrinsicKeyword(kw)) {
|
|
||||||
hadIntrinsic.add(kw);
|
|
||||||
}
|
|
||||||
tgtC.removeIntrinsicKeyword(kw);
|
|
||||||
tgtC.removeAllExtrinsicKeyword(kw);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Split "Protection from all colors" into extra Protection from <color>
|
// Split "Protection from all colors" into extra Protection from <color>
|
||||||
@@ -120,11 +113,6 @@ public class DebuffEffect extends SpellAbilityEffect {
|
|||||||
for(byte col : MagicColor.WUBRG) {
|
for(byte col : MagicColor.WUBRG) {
|
||||||
allColorsProtect.add("Protection from " + MagicColor.toLongString(col).toLowerCase());
|
allColorsProtect.add("Protection from " + MagicColor.toLongString(col).toLowerCase());
|
||||||
}
|
}
|
||||||
if (tgtC.getCurrentState().hasIntrinsicKeyword(allColors)) {
|
|
||||||
hadIntrinsic.add(allColors);
|
|
||||||
}
|
|
||||||
tgtC.removeIntrinsicKeyword(allColors);
|
|
||||||
tgtC.removeAllExtrinsicKeyword(allColors);
|
|
||||||
allColorsProtect.removeAll(kws);
|
allColorsProtect.removeAll(kws);
|
||||||
addedKW.addAll(allColorsProtect);
|
addedKW.addAll(allColorsProtect);
|
||||||
removedKW.add(allColors);
|
removedKW.add(allColors);
|
||||||
@@ -144,11 +132,6 @@ public class DebuffEffect extends SpellAbilityEffect {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (tgtC.getCurrentState().hasIntrinsicKeyword(allColors)) {
|
|
||||||
hadIntrinsic.add(allColors);
|
|
||||||
}
|
|
||||||
tgtC.removeIntrinsicKeyword(allColors);
|
|
||||||
tgtC.removeAllExtrinsicKeyword(allColors);
|
|
||||||
addedKW.addAll(allColorsProtect);
|
addedKW.addAll(allColorsProtect);
|
||||||
removedKW.add(allColors);
|
removedKW.add(allColors);
|
||||||
}
|
}
|
||||||
@@ -163,11 +146,6 @@ public class DebuffEffect extends SpellAbilityEffect {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
tgtC.removeChangedCardKeywords(timestamp);
|
tgtC.removeChangedCardKeywords(timestamp);
|
||||||
if (tgtC.isInPlay()) {
|
|
||||||
for (final String kw : hadIntrinsic) {
|
|
||||||
tgtC.addIntrinsicKeyword(kw);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user