mirror of
https://github.com/correl/mage.git
synced 2025-01-13 19:11:33 +00:00
Updated Decorated Griffin's prevention effect.
This commit is contained in:
parent
79d46c71c6
commit
3642d40548
1 changed files with 2 additions and 18 deletions
|
@ -76,7 +76,7 @@ public class DecoratedGriffin extends CardImpl {
|
|||
class DecoratedGriffinPreventEffect extends PreventionEffectImpl {
|
||||
|
||||
public DecoratedGriffinPreventEffect() {
|
||||
super(Duration.EndOfTurn);
|
||||
super(Duration.EndOfTurn, 1, false, true);
|
||||
this.staticText = "Prevent the next 1 damage that would be dealt to you this turn";
|
||||
}
|
||||
|
||||
|
@ -94,25 +94,9 @@ class DecoratedGriffinPreventEffect extends PreventionEffectImpl {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE,
|
||||
source.getControllerId(), source.getSourceId(), source.getControllerId(), event.getAmount(), false);
|
||||
if (!game.replaceEvent(preventEvent)) {
|
||||
int damage = event.getAmount();
|
||||
if (damage > 0) {
|
||||
event.setAmount(damage - 1);
|
||||
this.used = true;
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE,
|
||||
source.getControllerId(), source.getSourceId(), source.getControllerId(), 1));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (!this.used && super.applies(event, source, game) && event.getTargetId().equals(source.getControllerId())) {
|
||||
if (super.applies(event, source, game) && event.getTargetId().equals(source.getControllerId())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue