mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +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")) {
|
if(params.containsKey("ConditionManaSpent")) {
|
||||||
setManaSpent(params.get("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
|
}//setConditions
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -211,6 +220,15 @@ public class SpellAbility_Condition extends SpellAbility_Variables {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user