mirror of
https://github.com/correl/mage.git
synced 2024-11-14 11:09:31 +00:00
parent
63be7589ae
commit
3a0324557a
1 changed files with 14 additions and 4 deletions
|
@ -57,14 +57,24 @@ class TributeToTheWorldTreeEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
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) {
|
||||
return false;
|
||||
}
|
||||
if (permanent.getPower().getValue() < 3) {
|
||||
|
||||
int power = permanent.getPower().getValue();
|
||||
if (power < 3) {
|
||||
return permanent.addCounters(CounterType.P1P1.createInstance(2), source, game);
|
||||
}
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
return player != null && player.drawCards(1, source, game) > 0;
|
||||
else {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
return player != null && player.drawCards(1, source, game) > 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue