mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Dev Mode: added a new function "Remove Card from Game", which allows to completely remove a card from the game in case it was added previously by mistake.
This commit is contained in:
@@ -42,6 +42,8 @@ public interface IDevModeCheats {
|
||||
*/
|
||||
void exileCardsFromBattlefield();
|
||||
|
||||
void removeCardsFromGame();
|
||||
|
||||
void addCardToBattlefield();
|
||||
|
||||
void riggedPlanarRoll();
|
||||
@@ -113,6 +115,9 @@ public interface IDevModeCheats {
|
||||
@Override
|
||||
public void addCardToExile() {
|
||||
}
|
||||
@Override
|
||||
public void removeCardsFromGame() {
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
@@ -2199,6 +2199,42 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see forge.player.IDevModeCheats#exileCardsFromBattlefield()
|
||||
*/
|
||||
@Override
|
||||
public void removeCardsFromGame() {
|
||||
final Player p = game.getPlayer(getGui().oneOrNone("Remove card(s) belonging to which player?",
|
||||
PlayerView.getCollection(game.getPlayers())));
|
||||
if (p == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final String zone = getGui().one("Remove card(s) from which zone?",
|
||||
Arrays.asList("Hand", "Battlefield", "Library", "Graveyard", "Exile"));
|
||||
|
||||
final CardCollection selection;
|
||||
|
||||
CardCollectionView cards = p.getCardsIn(ZoneType.smartValueOf(zone));
|
||||
selection = game.getCardList(getGui().many("Choose cards to remove from game", "Removed", 0, -1,
|
||||
CardView.getCollection(cards), null));
|
||||
|
||||
if (selection != null && selection.size() > 0) {
|
||||
for (Card c : selection) {
|
||||
if (c == null) {
|
||||
continue;
|
||||
}
|
||||
c.ceaseToExist();
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(p).append(" removes ").append(c).append(" from game due to Dev Cheats.");
|
||||
game.getGameLog().add(GameLogEntryType.ZONE_CHANGE, sb.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user