mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
added CheckSVar support to SpellAbility_Condition
This commit is contained in:
@@ -98,6 +98,15 @@ public class SpellAbility_Condition extends SpellAbility_Variables {
|
||||
if(params.containsKey("ConditionManaSpent")) {
|
||||
setManaSpent(params.get("ConditionManaSpent"));
|
||||
}
|
||||
|
||||
if (params.containsKey("CheckSVar")) {
|
||||
setSvarToCheck(params.get("CheckSVar"));
|
||||
}
|
||||
if (params.containsKey("SVarCompare")) {
|
||||
setSvarOperator(params.get("SVarCompare").substring(0, 2));
|
||||
setSvarOperand(params.get("SVarCompare").substring(2));
|
||||
}
|
||||
|
||||
}//setConditions
|
||||
|
||||
/**
|
||||
@@ -210,6 +219,15 @@ public class SpellAbility_Condition extends SpellAbility_Variables {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (svarToCheck != null) {
|
||||
int svarValue = AbilityFactory.calculateAmount(sa.getSourceCard(), svarToCheck, sa);
|
||||
int operandValue = AbilityFactory.calculateAmount(sa.getSourceCard(), svarOperand, sa);
|
||||
|
||||
if (!AllZoneUtil.compare(svarValue, svarOperator, operandValue))
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user