mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 02:08:00 +00:00
allow for -AffectedX and other variations
This commit is contained in:
@@ -1746,12 +1746,12 @@ public class ComputerUtilCard {
|
|||||||
int att = 0;
|
int att = 0;
|
||||||
if (stAb.hasParam("AddPower")) {
|
if (stAb.hasParam("AddPower")) {
|
||||||
String addP = stAb.getParam("AddPower");
|
String addP = stAb.getParam("AddPower");
|
||||||
att = AbilityUtils.calculateAmount(addP.startsWith("Affected") ? vCard : c, addP, stAb, true);
|
att = AbilityUtils.calculateAmount(addP.contains("Affected") ? vCard : c, addP, stAb, true);
|
||||||
}
|
}
|
||||||
int def = 0;
|
int def = 0;
|
||||||
if (stAb.hasParam("AddToughness")) {
|
if (stAb.hasParam("AddToughness")) {
|
||||||
String addT = stAb.getParam("AddToughness");
|
String addT = stAb.getParam("AddToughness");
|
||||||
def = AbilityUtils.calculateAmount(addT.startsWith("Affected") ? vCard : c, addT, stAb, true);
|
def = AbilityUtils.calculateAmount(addT.contains("Affected") ? vCard : c, addT, stAb, true);
|
||||||
}
|
}
|
||||||
vCard.addPTBoost(att, def, c.getTimestamp(), stAb.getId());
|
vCard.addPTBoost(att, def, c.getTimestamp(), stAb.getId());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -684,10 +684,10 @@ public final class StaticAbilityContinuous {
|
|||||||
if (layer == StaticAbilityLayer.SETPT) {
|
if (layer == StaticAbilityLayer.SETPT) {
|
||||||
if ((setPower != null) || (setToughness != null)) {
|
if ((setPower != null) || (setToughness != null)) {
|
||||||
// non CharacteristicDefining
|
// non CharacteristicDefining
|
||||||
if (setP.startsWith("Affected")) {
|
if (setP.contains("Affected")) {
|
||||||
setPower = AbilityUtils.calculateAmount(affectedCard, setP, stAb, true);
|
setPower = AbilityUtils.calculateAmount(affectedCard, setP, stAb, true);
|
||||||
}
|
}
|
||||||
if (setT.startsWith("Affected")) {
|
if (setT.contains("Affected")) {
|
||||||
setToughness = AbilityUtils.calculateAmount(affectedCard, setT, stAb, true);
|
setToughness = AbilityUtils.calculateAmount(affectedCard, setT, stAb, true);
|
||||||
}
|
}
|
||||||
affectedCard.addNewPT(setPower, setToughness,
|
affectedCard.addNewPT(setPower, setToughness,
|
||||||
@@ -697,10 +697,10 @@ public final class StaticAbilityContinuous {
|
|||||||
|
|
||||||
// add P/T bonus
|
// add P/T bonus
|
||||||
if (layer == StaticAbilityLayer.MODIFYPT) {
|
if (layer == StaticAbilityLayer.MODIFYPT) {
|
||||||
if (addP.startsWith("Affected")) {
|
if (addP.contains("Affected")) {
|
||||||
powerBonus = AbilityUtils.calculateAmount(affectedCard, addP, stAb, true);
|
powerBonus = AbilityUtils.calculateAmount(affectedCard, addP, stAb, true);
|
||||||
}
|
}
|
||||||
if (addT.startsWith("Affected")) {
|
if (addT.contains("Affected")) {
|
||||||
toughnessBonus = AbilityUtils.calculateAmount(affectedCard, addT, stAb, true);
|
toughnessBonus = AbilityUtils.calculateAmount(affectedCard, addT, stAb, true);
|
||||||
}
|
}
|
||||||
affectedCard.addPTBoost(powerBonus, toughnessBonus, se.getTimestamp(), stAb.getId());
|
affectedCard.addPTBoost(powerBonus, toughnessBonus, se.getTimestamp(), stAb.getId());
|
||||||
|
|||||||
Reference in New Issue
Block a user