mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
tests for reported bug Rabid Elephant. typo fixes
This commit is contained in:
parent
ae66db20ad
commit
eb9747d0d1
4 changed files with 54 additions and 8 deletions
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package org.mage.test.cards.triggers;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
|
||||
*/
|
||||
public class BecomesBlockedTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* Reported bug:
|
||||
* There's something wrong with how Rabid Elephant is getting his +2/+2 bonus,
|
||||
* it doesn't last until end of turn, but seems to be removed right after the blockers step.
|
||||
*/
|
||||
@Test
|
||||
public void testRabidElephant() {
|
||||
|
||||
// {4}{G}
|
||||
// Whenever Rabid Elephant becomes blocked, it gets +2/+2 until end of turn for each creature blocking it.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Rabid Elephant", 1); // 3/4
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Savannah Lions", 1); // 2/1
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Hill Giant", 1); // 3/3
|
||||
|
||||
attack(1, playerA, "Rabid Elephant");
|
||||
block(1, playerB, "Savannah Lions", "Rabid Elephant");
|
||||
//block(1, playerB, "Hill Giant", "Rabid Elephant");
|
||||
|
||||
// test passes if PhaseStep ends at DECLARE_BLOCKERS
|
||||
//setStopAt(1, PhaseStep.DECLARE_BLOCKERS);
|
||||
setStopAt(1, PhaseStep.COMBAT_DAMAGE);
|
||||
execute();
|
||||
|
||||
// blocked by 2 creatures, so gets +2/+2 twice, making it 7/8
|
||||
assertPowerToughness(playerA, "Rabid Elephant", 3, 4);
|
||||
}
|
||||
}
|
||||
|
|
@ -38,21 +38,21 @@ import mage.game.Game;
|
|||
public class MultipliedValue implements DynamicValue {
|
||||
|
||||
private final DynamicValue value;
|
||||
private final int multplier;
|
||||
private final int multiplier;
|
||||
|
||||
public MultipliedValue(DynamicValue value, int multiplier) {
|
||||
this.value = value.copy();
|
||||
this.multplier = multiplier;
|
||||
this.multiplier = multiplier;
|
||||
}
|
||||
|
||||
MultipliedValue(final MultipliedValue dynamicValue) {
|
||||
this.value = dynamicValue.value.copy();
|
||||
this.multplier = dynamicValue.multplier;
|
||||
this.multiplier = dynamicValue.multiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
return multplier * value.calculate(game, sourceAbility, effect);
|
||||
return multiplier * value.calculate(game, sourceAbility, effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -63,10 +63,10 @@ public class MultipliedValue implements DynamicValue {
|
|||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (multplier == 2) {
|
||||
if (multiplier == 2) {
|
||||
sb.append("twice ");
|
||||
} else {
|
||||
sb.append(multplier).append(" * ");
|
||||
sb.append(multiplier).append(" * ");
|
||||
}
|
||||
return sb.append(value.toString()).toString();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,8 +50,9 @@ public class BlockedCreatureCount implements DynamicValue {
|
|||
this(message, false);
|
||||
}
|
||||
|
||||
public BlockedCreatureCount(String message, boolean beyondTheFist) {
|
||||
public BlockedCreatureCount(String message, boolean beyondTheFirst) {
|
||||
this.message = message;
|
||||
this.beyondTheFirst = beyondTheFirst;
|
||||
}
|
||||
|
||||
public BlockedCreatureCount(final BlockedCreatureCount dynamicValue) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue