- Battletide Alchemist will no longer ask the player when the AI makes test runs.

This commit is contained in:
Sloth
2013-03-04 21:18:02 +00:00
parent 58fc1ae52a
commit ba4241e455
6 changed files with 18 additions and 18 deletions

View File

@@ -8002,7 +8002,7 @@ public class Card extends GameEntity implements Comparable<Card> {
* *
* @param damage * @param damage
* a int. * a int.
* @param possiblePrvenetion * @param possiblePrevention
* a int. * a int.
* @param source * @param source
* a {@link forge.Card} object. * a {@link forge.Card} object.
@@ -8010,7 +8010,7 @@ public class Card extends GameEntity implements Comparable<Card> {
* a boolean. * a boolean.
* @return a int. * @return a int.
*/ */
public final int staticDamagePrevention(final int damage, final int possiblePrvenetion, final Card source, public final int staticDamagePrevention(final int damage, final int possiblePrevention, final Card source,
final boolean isCombat) { final boolean isCombat) {
if (Singletons.getModel().getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noPrevention)) { if (Singletons.getModel().getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noPrevention)) {
@@ -8047,9 +8047,9 @@ public class Card extends GameEntity implements Comparable<Card> {
} }
} }
int restDamage = damage - possiblePrvenetion; int restDamage = damage - possiblePrevention;
restDamage = this.staticDamagePrevention(restDamage, source, isCombat); restDamage = this.staticDamagePrevention(restDamage, source, isCombat, true);
return restDamage; return restDamage;
} }
@@ -8070,7 +8070,7 @@ public class Card extends GameEntity implements Comparable<Card> {
* @return a int. * @return a int.
*/ */
@Override @Override
public final int staticDamagePrevention(final int damageIn, final Card source, final boolean isCombat) { public final int staticDamagePrevention(final int damageIn, final Card source, final boolean isCombat, final boolean isTest) {
if (Singletons.getModel().getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noPrevention)) { if (Singletons.getModel().getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noPrevention)) {
return damageIn; return damageIn;
@@ -8138,7 +8138,7 @@ public class Card extends GameEntity implements Comparable<Card> {
for (final Card ca : Singletons.getModel().getGame().getCardsIn(ZoneType.listValueOf("Battlefield,Command"))) { for (final Card ca : Singletons.getModel().getGame().getCardsIn(ZoneType.listValueOf("Battlefield,Command"))) {
final ArrayList<StaticAbility> staticAbilities = ca.getStaticAbilities(); final ArrayList<StaticAbility> staticAbilities = ca.getStaticAbilities();
for (final StaticAbility stAb : staticAbilities) { for (final StaticAbility stAb : staticAbilities) {
restDamage = stAb.applyAbility("PreventDamage", source, this, restDamage, isCombat); restDamage = stAb.applyAbility("PreventDamage", source, this, restDamage, isCombat, isTest);
} }
} }
@@ -8198,7 +8198,7 @@ public class Card extends GameEntity implements Comparable<Card> {
return 0; return 0;
} }
restDamage = this.staticDamagePrevention(restDamage, source, isCombat); restDamage = this.staticDamagePrevention(restDamage, source, isCombat, false);
if (restDamage == 0) { if (restDamage == 0) {
return 0; return 0;

View File

@@ -139,7 +139,7 @@ public abstract class GameEntity extends MyObservable {
* a boolean. * a boolean.
* @return a int. * @return a int.
*/ */
public int staticDamagePrevention(final int damage, final Card source, final boolean isCombat) { public int staticDamagePrevention(final int damage, final Card source, final boolean isCombat, final boolean isTest) {
return 0; return 0;
} }

View File

@@ -253,12 +253,12 @@ public class StaticAbility {
* the target * the target
* @param in * @param in
* the in * the in
* @param b * @param isCombat
* the b * the b
* @return the int * @return the int
*/ */
public final int applyAbility(final String mode, final Card source, final GameEntity target, final int in, public final int applyAbility(final String mode, final Card source, final GameEntity target, final int in,
final boolean b) { final boolean isCombat, final boolean isTest) {
// don't apply the ability if it hasn't got the right mode // don't apply the ability if it hasn't got the right mode
if (!this.params.get("Mode").equals(mode)) { if (!this.params.get("Mode").equals(mode)) {
@@ -270,7 +270,7 @@ public class StaticAbility {
} }
if (mode.equals("PreventDamage")) { if (mode.equals("PreventDamage")) {
return StaticAbilityPreventDamage.applyPreventDamageAbility(this, source, target, in, b); return StaticAbilityPreventDamage.applyPreventDamageAbility(this, source, target, in, isCombat, isTest);
} }
return in; return in;

View File

@@ -44,7 +44,7 @@ public class StaticAbilityPreventDamage {
* @return the int * @return the int
*/ */
public static int applyPreventDamageAbility(final StaticAbility stAb, final Card source, final GameEntity target, public static int applyPreventDamageAbility(final StaticAbility stAb, final Card source, final GameEntity target,
final int damage, final boolean isCombat) { final int damage, final boolean isCombat, final boolean isTest) {
final HashMap<String, String> params = stAb.getMapParams(); final HashMap<String, String> params = stAb.getMapParams();
final Card hostCard = stAb.getHostCard(); final Card hostCard = stAb.getHostCard();
int restDamage = damage; int restDamage = damage;
@@ -71,7 +71,7 @@ public class StaticAbilityPreventDamage {
return restDamage; return restDamage;
} }
if (params.containsKey("Optional")) { //Assume if param is present it should be optional if (!isTest && params.containsKey("Optional")) { //Assume if param is present it should be optional
final String logic = params.containsKey("AILogic") ? params.get("AILogic") : ""; final String logic = params.containsKey("AILogic") ? params.get("AILogic") : "";
final String message = "Apply the effect of " + hostCard + "?"; final String message = "Apply the effect of " + hostCard + "?";
boolean confirmed = hostCard.getController().getController().confirmStaticApplication(hostCard, target, logic, message); boolean confirmed = hostCard.getController().getController().confirmStaticApplication(hostCard, target, logic, message);

View File

@@ -1857,7 +1857,7 @@ public class ComputerUtilCombat {
} }
} }
restDamage = target.staticDamagePrevention(restDamage, source, isCombat); restDamage = target.staticDamagePrevention(restDamage, source, isCombat, true);
return restDamage; return restDamage;
} }
@@ -1882,7 +1882,7 @@ public class ComputerUtilCombat {
int restDamage = damage; int restDamage = damage;
restDamage = target.staticReplaceDamage(restDamage, source, isCombat); restDamage = target.staticReplaceDamage(restDamage, source, isCombat);
restDamage = target.staticDamagePrevention(restDamage, source, isCombat); restDamage = target.staticDamagePrevention(restDamage, source, isCombat, true);
return restDamage; return restDamage;
} }

View File

@@ -672,7 +672,7 @@ public abstract class Player extends GameEntity implements Comparable<Player> {
* @return a int. * @return a int.
*/ */
@Override @Override
public final int staticDamagePrevention(final int damage, final Card source, final boolean isCombat) { public final int staticDamagePrevention(final int damage, final Card source, final boolean isCombat, final boolean isTest) {
if (Singletons.getModel().getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noPrevention)) { if (Singletons.getModel().getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noPrevention)) {
return damage; return damage;
@@ -709,7 +709,7 @@ public abstract class Player extends GameEntity implements Comparable<Player> {
for (final Card ca : game.getCardsIn(ZoneType.listValueOf("Battlefield,Command"))) { for (final Card ca : game.getCardsIn(ZoneType.listValueOf("Battlefield,Command"))) {
final ArrayList<StaticAbility> staticAbilities = ca.getStaticAbilities(); final ArrayList<StaticAbility> staticAbilities = ca.getStaticAbilities();
for (final StaticAbility stAb : staticAbilities) { for (final StaticAbility stAb : staticAbilities) {
restDamage = stAb.applyAbility("PreventDamage", source, this, restDamage, isCombat); restDamage = stAb.applyAbility("PreventDamage", source, this, restDamage, isCombat, isTest);
} }
} }
@@ -884,7 +884,7 @@ public abstract class Player extends GameEntity implements Comparable<Player> {
return 0; return 0;
} }
restDamage = this.staticDamagePrevention(restDamage, source, isCombat); restDamage = this.staticDamagePrevention(restDamage, source, isCombat, false);
if (restDamage >= this.getPreventNextDamage()) { if (restDamage >= this.getPreventNextDamage()) {
restDamage = restDamage - this.getPreventNextDamage(); restDamage = restDamage - this.getPreventNextDamage();