mirror of
https://github.com/correl/mage.git
synced 2024-11-24 19:19:56 +00:00
parent
63be7589ae
commit
3a0324557a
1 changed files with 14 additions and 4 deletions
|
@ -57,14 +57,24 @@ class TributeToTheWorldTreeEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent permanent = (Permanent) getValue("permanentEnteringBattlefield");
|
Permanent permanentEntering = (Permanent) getValue("permanentEnteringBattlefield");
|
||||||
|
if (permanentEntering == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// We need to ask the game for the actualized object for the entering permanent.
|
||||||
|
Permanent permanent = game.getPermanent(permanentEntering.getId());
|
||||||
if (permanent == null) {
|
if (permanent == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (permanent.getPower().getValue() < 3) {
|
|
||||||
|
int power = permanent.getPower().getValue();
|
||||||
|
if (power < 3) {
|
||||||
return permanent.addCounters(CounterType.P1P1.createInstance(2), source, game);
|
return permanent.addCounters(CounterType.P1P1.createInstance(2), source, game);
|
||||||
}
|
}
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
else {
|
||||||
return player != null && player.drawCards(1, source, game) > 0;
|
Player player = game.getPlayer(source.getControllerId());
|
||||||
|
return player != null && player.drawCards(1, source, game) > 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue