mirror of
https://github.com/correl/mage.git
synced 2024-11-14 19:19:32 +00:00
* Fixed a problem that the AI did not care for maximum allowed mana payment for X mana costs.
This commit is contained in:
parent
dc3e47e045
commit
b7fa942b10
2 changed files with 8 additions and 6 deletions
|
@ -1312,6 +1312,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
if (numAvailable < 0) {
|
||||
numAvailable = 0;
|
||||
}
|
||||
if (numAvailable > max) {
|
||||
numAvailable = max;
|
||||
}
|
||||
return numAvailable;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.abilities.common;
|
||||
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
|
@ -39,14 +38,14 @@ import mage.target.targetpointer.FixedTarget;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class GainLifeControllerTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
private boolean setTargetPointer;
|
||||
|
||||
public GainLifeControllerTriggeredAbility(Effect effect, boolean optional) {
|
||||
this(effect, optional, false);
|
||||
}
|
||||
|
||||
|
||||
public GainLifeControllerTriggeredAbility(Effect effect, boolean optional, boolean setTargetPointer) {
|
||||
super(Zone.BATTLEFIELD, effect, optional);
|
||||
this.setTargetPointer = setTargetPointer;
|
||||
|
@ -72,8 +71,8 @@ public class GainLifeControllerTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (event.getPlayerId().equals(this.getControllerId())) {
|
||||
if (setTargetPointer) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
|
||||
effect.setValue("gainedLife", event.getAmount());
|
||||
effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
|
||||
effect.setValue("gainedLife", event.getAmount());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -83,7 +82,7 @@ public class GainLifeControllerTriggeredAbility extends TriggeredAbilityImpl {
|
|||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return new StringBuilder("Whenever you gain life, ").append(super.getRule()).toString() ;
|
||||
return new StringBuilder("Whenever you gain life, ").append(super.getRule()).toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue