forked from External/mage
Using unique/special new event type for taking special actions and special mana payment(fixes #6753).
This commit is contained in:
parent
08d9e8cfa0
commit
75c4ff7d8e
9 changed files with 45 additions and 6 deletions
|
|
@ -1378,11 +1378,11 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
|
||||
protected boolean specialAction(SpecialAction action, Game game) {
|
||||
//20091005 - 114
|
||||
if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.ACTIVATE_ABILITY,
|
||||
if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.TAKE_SPECIAL_ACTION,
|
||||
action.getId(), action.getSourceId(), getId()))) {
|
||||
int bookmark = game.bookmarkState();
|
||||
if (action.activate(game, false)) {
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.ACTIVATED_ABILITY,
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.TAKEN_SPECIAL_ACTION,
|
||||
action.getId(), action.getSourceId(), getId()));
|
||||
if (!game.isSimulation()) {
|
||||
game.informPlayers(getLogName() + action.getGameLogMessage(game));
|
||||
|
|
@ -1397,7 +1397,29 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
protected boolean specialManaPayment(SpecialAction action, Game game) {
|
||||
//20091005 - 114
|
||||
if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.TAKE_SPECIAL_MANA_PAYMENT,
|
||||
action.getId(), action.getSourceId(), getId()))) {
|
||||
int bookmark = game.bookmarkState();
|
||||
if (action.activate(game, false)) {
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.TAKEN_SPECIAL_MANA_PAYMENT,
|
||||
action.getId(), action.getSourceId(), getId()));
|
||||
if (!game.isSimulation()) {
|
||||
game.informPlayers(getLogName() + action.getGameLogMessage(game));
|
||||
}
|
||||
if (action.resolve(game)) {
|
||||
game.removeBookmark(bookmark);
|
||||
resetStoredBookmark(game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
restoreState(bookmark, action.getRule(), game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean activateAbility(ActivatedAbility ability, Game game) {
|
||||
if (ability == null) {
|
||||
|
|
@ -1445,6 +1467,9 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
case SPECIAL_ACTION:
|
||||
result = specialAction((SpecialAction) ability.copy(), game);
|
||||
break;
|
||||
case SPECIAL_MANA_PAYMENT:
|
||||
result = specialManaPayment((SpecialAction) ability.copy(), game);
|
||||
break;
|
||||
case MANA:
|
||||
result = playManaAbility((ActivatedManaAbilityImpl) ability.copy(), game);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue