Search in sources :

Example 1 with Monarch

use of mage.designations.Monarch in project mage by magefree.

the class GameImpl method setMonarchId.

@Override
public void setMonarchId(Ability source, UUID monarchId) {
    if (monarchId.equals(getMonarchId())) {
        // Nothing happens if you're already the monarch
        return;
    }
    if (replaceEvent(GameEvent.getEvent(GameEvent.EventType.BECOME_MONARCH, monarchId, source, monarchId))) {
        return;
    }
    if (getMonarchId() == null) {
        getState().addDesignation(new Monarch(), this, monarchId);
    }
    Player newMonarch = getPlayer(monarchId);
    if (newMonarch != null) {
        getState().setMonarchId(monarchId);
        informPlayers(newMonarch.getLogName() + " is the monarch");
        fireEvent(new GameEvent(GameEvent.EventType.BECOMES_MONARCH, monarchId, source, monarchId));
    }
}
Also used : TargetPlayer(mage.target.TargetPlayer) Player(mage.players.Player) Monarch(mage.designations.Monarch)

Aggregations

Monarch (mage.designations.Monarch)1 Player (mage.players.Player)1 TargetPlayer (mage.target.TargetPlayer)1