mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
Monarch command zone effect: support multiple arts/sets
This commit is contained in:
@@ -743,9 +743,9 @@ public class Game {
|
||||
if (p != null && p.isMonarch()) {
|
||||
// if the player who lost was the Monarch, someone else will be the monarch
|
||||
if(p.equals(getPhaseHandler().getPlayerTurn())) {
|
||||
getAction().becomeMonarch(getNextPlayerAfter(p));
|
||||
getAction().becomeMonarch(getNextPlayerAfter(p), null);
|
||||
} else {
|
||||
getAction().becomeMonarch(getPhaseHandler().getPlayerTurn());
|
||||
getAction().becomeMonarch(getPhaseHandler().getPlayerTurn(), null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1768,7 +1768,7 @@ public class GameAction {
|
||||
}
|
||||
}
|
||||
|
||||
public void becomeMonarch(final Player p) {
|
||||
public void becomeMonarch(final Player p, final String set) {
|
||||
final Player previous = game.getMonarch();
|
||||
if (p == null || p.equals(previous))
|
||||
return;
|
||||
@@ -1776,7 +1776,7 @@ public class GameAction {
|
||||
if (previous != null)
|
||||
previous.removeMonarchEffect();
|
||||
|
||||
p.createMonarchEffect();
|
||||
p.createMonarchEffect(set);
|
||||
game.setMonarch(p);
|
||||
|
||||
// Run triggers
|
||||
|
||||
@@ -27,11 +27,12 @@ public class BecomeMonarchEffect extends SpellAbilityEffect {
|
||||
public void resolve(SpellAbility sa) {
|
||||
final TargetRestrictions tgt = sa.getTargetRestrictions();
|
||||
// TODO: improve ai and fix corner cases
|
||||
final String set = sa.getHostCard().getSetCode();
|
||||
|
||||
for (final Player p : getTargetPlayers(sa)) {
|
||||
if ((tgt == null) || p.canBeTargetedBy(sa)) {
|
||||
if (!p.hasKeyword("You can’t become the monarch this turn.")) {
|
||||
p.getGame().getAction().becomeMonarch(p);
|
||||
p.getGame().getAction().becomeMonarch(p, set);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3170,12 +3170,17 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
return equals(game.getMonarch());
|
||||
}
|
||||
|
||||
public void createMonarchEffect() {
|
||||
public void createMonarchEffect(final String set) {
|
||||
final PlayerZone com = getZone(ZoneType.Command);
|
||||
if (monarchEffect == null) {
|
||||
monarchEffect = new Card(game.nextCardId(), null, game);
|
||||
monarchEffect.setOwner(this);
|
||||
if (set != null) {
|
||||
monarchEffect.setImageKey("t:monarch_" + set.toLowerCase());
|
||||
monarchEffect.setSetCode(set);
|
||||
} else {
|
||||
monarchEffect.setImageKey("t:monarch");
|
||||
}
|
||||
monarchEffect.setName("The Monarch");
|
||||
monarchEffect.addType("Effect");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user