Renown - Fixed that the check if the creature is already renown was not implemted as intervening if clause.

This commit is contained in:
LevelX2 2015-06-24 15:31:07 +02:00
parent 72408a7f52
commit 26e03d6c0f

View file

@ -48,6 +48,11 @@ public class RenownAbility extends TriggeredAbilityImpl {
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
}
@Override
public boolean checkInterveningIfClause(Game game) {
return getSourceObject(game) != null && !((Permanent)getSourceObject(game)).isRenown();
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return event.getSourceId().equals(getSourceId())
@ -83,7 +88,7 @@ class BecomeRenownSourceEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null && !permanent.isRenown() && source instanceof RenownAbility) {
if (permanent != null && source instanceof RenownAbility) {
game.informPlayers(permanent.getLogName() + " is now renown");
int renownValue = ((RenownAbility) source).getRenownValue();
// handle renown = X