Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions docs/Adventure/Console-and-cheats.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To scroll the console window, click and drag the text box.
| give gold 1000 | Give 1000 gold |
| give shards 1000 | Give 1000 shards |
| give print lea 232 | Add an alpha (LEA set code) black lotus (232 collector number) |
| give item <item name or code?> | Adds an in game item such as leather boots |
| give item <item id> | Adds an in game item such as leather boots |
| give set sld | Give 4 copies of every card in the Secret Lair Drop (set code SLD), flagged as having no sell value |
| give nosell card forest | Gives a forest with no sell value |
| give boosters leb | Add a booster from beta (LEB set code) |
Expand All @@ -21,10 +21,10 @@ To scroll the console window, click and drag the text box.
| give card forest | Adds a forest to your inventory |
| debug collision | Displays bounding boxes around entities |
| debug map | TODO |
| debug off | Turns off previously enable debugging |
| debug off | Turns off debugging |
| teleport to 6000 5000 | Moves you 6000 tiles east and 5000 tiles north from the left bottom corner |
| fullHeal | Returns your health back to baseline |
| sprint 100 | Increases your speed for 100 seconds |
| sprint 100 | Increases your speed for 100 seconds |
| setColorId R | Sets the player color identity; Probably used for testing and shops |
| clearnosell | Clears the no sell value flag from all cards you own that are not used in a deck |
| remove enemy abc | Remove the enemy from the map with the map ID abc |
Expand All @@ -34,10 +34,12 @@ To scroll the console window, click and drag the text box.
| resetQuests | Resets the world quests. In progress quests are not abandonned or reset including dungeons. Does not reroll abandoned quests. Not really sure what this does. |
| hide 100 | Enemies do not chase you for 100 seconds |
| fly 100 | You can walk over obstacles for 100 seconds |
| crack | Cracks a random item you are wearing |
| crack | Cracks a random item you are wearing |
| spawn enemy Sliver | Spawns a Sliver on your screen |
| listPOI | Prints all locations in terminal output stream as ID-type pairings |
| leave | Gets you out of the current town/dungeon/cave |
| dumpEnemyColorIdentity | Prints all enemies, their colour affinity and deck name to terminal output |
| heal | Recover your full health |
| dumpEnemyDeckColors | Prints all decks available to enemies and their affinities |
| reset map | Reset the current map (not overworld) after you exit it |
| exit | Close the console |
Original file line number Diff line number Diff line change
Expand Up @@ -535,5 +535,14 @@ private ConsoleCommandInterpreter() {
InnScene.replaceLocalEvent(eventFormat, eventCardBlock);
return "Replaced local event with " + eventFormat.name() + " - " + eventCardBlock.getName();
});
registerCommand(new String[]{"reset", "map"}, s -> {
if(!MapStage.getInstance().isInMap()) {
return "Can only be used in maps.";
}

MapStage.getInstance().clearOnExit();

return "Exit the map to reset it.";
});
}
}
14 changes: 11 additions & 3 deletions forge-gui-mobile/src/forge/adventure/stage/MapStage.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class MapStage extends GameStage {
private boolean isLoadingMatch = false;
private boolean isPlayerLeavingDungeon = false;
//private HashMap<String, Byte> mapFlags = new HashMap<>(); //Stores local map flags. These aren't available outside this map.

private boolean mustClearOnExit = false;

//Map properties.
//These maps are defined as embedded properties within the Tiled maps.
Expand All @@ -82,8 +82,6 @@ public class MapStage extends GameStage {
float defaultSpriteSize = 16f;
float navMapSize = defaultSpriteSize * collisionWidthMod;



public boolean canEscape() {
return !preventEscape;
} //Check if escape is possible.
Expand Down Expand Up @@ -761,6 +759,11 @@ public InnScene findLocalInn() {
}

public boolean exitDungeon(boolean defeated, boolean defeatedByBoss) {
if (mustClearOnExit) {
mustClearOnExit = false;
changes.clearDeletedObjects();
}

AdventureQuestController.instance().updateQuestsLeave();
clearIsInMap();
AdventureQuestController.instance().showQuestDialogs(this);
Expand Down Expand Up @@ -1082,6 +1085,7 @@ private void showRewardScene(Array<Reward> rewards) {
}

boolean started = false;

public void beginDuel(EnemySprite mob) {
if (mob == null) return;
mob.clearCollisionHeight();
Expand Down Expand Up @@ -1251,4 +1255,8 @@ private void selectPreviousDialogButton() {
}
}
}

public void clearOnExit() {
mustClearOnExit = true;
}
}