RevealAi: fixed for Miracle

This commit is contained in:
Hanmac
2016-12-07 06:14:48 +00:00
parent 4cf2d22c76
commit ce64f9b541

View File

@@ -16,7 +16,24 @@ public class RevealAi extends RevealAiBase {
@Override @Override
protected boolean checkApiLogic(final Player ai, final SpellAbility sa) { protected boolean checkApiLogic(final Player ai, final SpellAbility sa) {
// we can reuse this function here...
final boolean bFlag = revealHandTargetAI(ai, sa/* , true, false */);
if (!bFlag) {
return false;
}
final Random r = MyRandom.getRandom();
boolean randomReturn = r.nextFloat() <= Math.pow(.667, sa.getActivationsThisTurn() + 1);
if (SpellAbilityAi.playReusable(ai, sa)) {
randomReturn = true;
}
return randomReturn;
}
@Override
protected boolean doTriggerAINoCost(Player ai, SpellAbility sa, boolean mandatory) {
// logic to see if it should reveal Mircacle Card // logic to see if it should reveal Mircacle Card
if (sa.hasParam("MiracleCost")) { if (sa.hasParam("MiracleCost")) {
final Card c = sa.getHostCard(); final Card c = sa.getHostCard();
@@ -37,25 +54,6 @@ public class RevealAi extends RevealAiBase {
return false; return false;
} }
// we can reuse this function here...
final boolean bFlag = revealHandTargetAI(ai, sa/*, true, false*/);
if (!bFlag) {
return false;
}
final Random r = MyRandom.getRandom();
boolean randomReturn = r.nextFloat() <= Math.pow(.667, sa.getActivationsThisTurn() + 1);
if (SpellAbilityAi.playReusable(ai, sa)) {
randomReturn = true;
}
return randomReturn;
}
@Override
protected boolean doTriggerAINoCost(Player ai, SpellAbility sa, boolean mandatory) {
if (!revealHandTargetAI(ai, sa/*, false, mandatory*/)) { if (!revealHandTargetAI(ai, sa/*, false, mandatory*/)) {
return false; return false;
} }