*Added CheckThirdSVar and CheckFourthSVar and accompanying parameters to StaticAbility.

This commit is contained in:
Hellfish
2012-01-05 10:57:23 +00:00
parent 85827a2ad1
commit aeda402d78

View File

@@ -469,6 +469,34 @@ public class StaticAbility {
}
}
if (this.mapParams.containsKey("CheckThirdSVar")) {
final int sVar = AbilityFactory.calculateAmount(this.hostCard, this.mapParams.get("CheckThirdSVar"), null);
String comparator = "GE1";
if (this.mapParams.containsKey("ThirdSVarCompare")) {
comparator = this.mapParams.get("ThirdSVarCompare");
}
final String svarOperator = comparator.substring(0, 2);
final String svarOperand = comparator.substring(2);
final int operandValue = AbilityFactory.calculateAmount(this.hostCard, svarOperand, null);
if (!AllZoneUtil.compare(sVar, svarOperator, operandValue)) {
return false;
}
}
if (this.mapParams.containsKey("CheckFourthSVar")) {
final int sVar = AbilityFactory.calculateAmount(this.hostCard, this.mapParams.get("CheckFourthSVar"), null);
String comparator = "GE1";
if (this.mapParams.containsKey("FourthSVarCompare")) {
comparator = this.mapParams.get("FourthSVarCompare");
}
final String svarOperator = comparator.substring(0, 2);
final String svarOperand = comparator.substring(2);
final int operandValue = AbilityFactory.calculateAmount(this.hostCard, svarOperand, null);
if (!AllZoneUtil.compare(sVar, svarOperator, operandValue)) {
return false;
}
}
return true;
}