From d27f5cea98e042d5838756c2b82410f03f3fc1eb Mon Sep 17 00:00:00 2001
From: nhaar <38634785+nhaar@users.noreply.github.com>
Date: Thu, 12 Sep 2024 20:36:24 -0300
Subject: [PATCH] Version 5 (#9)
* create base for new config system
* add more helper functions for handling config
* fix oversight with read_config_with_default not returning proper if setting default
* repurpose global.debug variable for config
* create base for the new debug keybind system
* change how config is read and loaded to avoid opening file too much
* add function for checking if debug keybind is active
* update function calls of old active feature key to new debug keybind checker
* remove screenshot from the game's debug check
* fix config function not calling global variable
* add hitbox as a debug keybind
* add new "basic" options
* add base for new rng rigging system
* add new other keybind base system
* change a few practice modes to have internal API
* add internal api for snowgrave plot
* changed party selector API (potentially broken since untested)
* change ch1 mashing stat display API
* change room warping API
* change timer variables to be config driven
* change split preset system to work with new config
* refix battle timer and clean up segment timer
* fix splits timer to work with new system
* implement first timer part of new menu
* reintegrate splits preset creator
* add debug keybinds base options
* add misc keybinds menu
* add basic item giver
* add basic party selector to menu
* add plot warp to menu
* add snowgrave plot warp to menu
* add room warp with typing room name
* improvements to room search
* fix numbers in room search
* improve saves browsing and readd feature
* make color ui menu work in new config
* remove dead code
* fix vanilla debug checks for ch1
* redesign how mod options disables keybinds
* debug mode persistance fixed
* add ui color for scrollbar
* improved scrollbar function
* fix bug with the font in mod options
* fix special instructions
* remove dead code
* fix split preset highlighting
* improve split creator
* add proper unkillable code for boss practice mode
* add reset default keybinds functionality
* nearly finish item selector
* rename "game flags" to more descriptive name
* change the locking for game data on savefiles
* add chapter select check for room warping
* add menu descriptions and proper scrolling
* add description to the majority of options
* final mod option fixes
* more survey program compatibility
* add misc options in the menu
* fix missing name
* fix misplaced break
* fix scrolling not being quite right
* update mod version
* adding enumeration
* remove descriptions from preset creation instructions
* add survey program split preset compatibility
* update readme
---
README.md | 14 +-
src/main.csx | 170 ----
.../events/gml_Object_DEVICE_NAMER_Draw_0.gml | 2 +-
.../events/gml_Object_obj_writer_Draw_0.gml | 2 +-
.../gml_Object_obj_writer_SP_Draw_0.gml | 2 +-
.../IGT/events/o_bq_whitefade_Step_0.gml | 2 +-
.../obj_castlefront_event_SP_Step_0.gml | 2 +-
.../IGT/events/obj_ch2_city08_Step_0.gml | 2 +-
.../IGT/events/obj_ch2_scene11a_Alarm_3.gml | 2 +-
.../events/obj_darkdoorevent_SP_Step_0.gml | 2 +-
.../IGT/events/obj_king_boss_SP_Other_20.gml | 2 +-
.../events/obj_musical_battle_end_Draw_0.gml | 2 +-
.../IGT/events/obj_prisonevent_SP_Step_0.gml | 2 +-
.../IGT/events/obj_shortcut_door_Step_0.gml | 10 -
src/mod/all_chapters/IGT/igt.gml | 265 +++---
src/mod/all_chapters/IGT/obj_IGT_Create_0.gml | 110 +--
src/mod/all_chapters/IGT/obj_IGT_Draw_64.gml | 98 ++-
src/mod/all_chapters/IGT/obj_IGT_Step_0.gml | 114 +--
src/mod/all_chapters/IGT/presets.gml | 169 ++++
.../boss_practice/boss_practice.gml | 40 +
.../obj_battlecontroller_DUPE_Create_0.gml | 8 +
.../obj_boss_practice_Step_0.gml | 35 +-
.../boundary_boxes/boundary_boxes.gml | 12 +-
src/mod/all_chapters/config/config.gml | 126 +++
.../debug/gml_GlobalScript_scr_gamestart.gml | 11 +
.../config/debug_keybinds/debug_keybinds.gml | 237 +++++
.../all_chapters/config/options/options.gml | 107 +++
.../config/other_keybinds/other_keybinds.gml | 86 ++
src/mod/all_chapters/config/rng/rng.gml | 47 +
.../crit_practice/crit_practice.gml | 19 +
.../obj_crit_practice_Step_0.gml | 25 +-
.../obj_battlecontroller_Draw_0.gml | 2 +-
.../obj_battlecontroller_SP_Draw_0.gml | 2 +-
.../gamemaker_savestates.gml | 4 +-
...bj_gamemaker_savestate_handler_Draw_64.gml | 20 +-
src/mod/all_chapters/get_items/get_items.gml | 250 ------
src/mod/all_chapters/get_items/items.gml | 192 ++++
.../obj_darkcontroller_DUPE_Step_0.gml | 5 -
.../gif_recording/obj_time_Draw_77.gml | 10 +-
.../gif_recording/obj_time_ch1_Draw_64.gml | 2 +-
.../gif_recording/obj_time_ch1_Draw_77.gml | 39 +-
src/mod/all_chapters/init/init.gml | 15 +-
.../gml_Object_DEVICE_NAMER_Draw_0.gml | 2 +-
.../keybinds/obj_battlecontroller_Step_0.gml | 4 +-
.../keybinds/obj_ch2_scene31_Step_0.gml | 4 +-
.../keybinds/obj_mainchara_Step_0.gml | 4 +-
.../vanilla/obj_darkcontroller_Step_0.gml | 6 +-
.../vanilla/obj_overworldc_SP_Step_0.gml | 12 +-
.../vanilla/obj_overworldc_Step_0.gml | 6 +-
src/mod/all_chapters/labels/mod_version.gml | 4 +-
.../obj_darkcontroller_DUPE_Step_0.gml | 2 +-
.../misc/clear_sounds/clear_sounds.gml | 2 +-
.../gml_GlobalScript_scr_gamestart.gml | 12 -
.../misc/debug_toggle/debug_toggle.gml | 44 -
.../misc/reset_tempflags/reset_tempflags.gml | 2 +-
.../misc/room_warper/room_warper.gml | 29 +-
src/mod/all_chapters/misc/set_constants.gml | 2 -
.../misc/speedup_key/obj_time_DUPE_Step_1.gml | 20 +-
src/mod/all_chapters/noclip/noclip.gml | 2 +-
.../omnipresent/obj_omnipresent_Step_0.gml | 8 +-
.../feature_selector/feature_selector.gml | 243 ------
.../option_menu/obj_mod_options_Create_0.gml | 49 +-
.../option_menu/obj_mod_options_Draw_64.gml | 820 +++++++++++++-----
.../obj_options_watcher_Create_0.gml | 3 -
.../obj_options_watcher_Step_0.gml | 10 +-
.../all_chapters/option_menu/option_menu.gml | 791 ++++++++++++-----
.../obj_darkcontroller_Create_0.gml | 3 -
.../obj_darkcontroller_SP_Create_0.gml | 7 -
.../obj_darkcontroller_SP_Step_0.gml | 58 --
.../obj_darkcontroller_Step_0.gml | 92 --
.../party_selector/party_selector.gml | 89 +-
.../player_options/player_options.gml | 103 +--
src/mod/all_chapters/plotwarp/plotwarp.gml | 26 -
.../position_cache/position_cache.gml | 2 +-
.../obj_ch2_scene19c_spelling_bee_Step_0.gml | 2 +-
.../obj_checkers_enemy_SP_Step_0.gml | 2 +-
src/mod/all_chapters/room_warp/room_warp.gml | 54 ++
src/mod/all_chapters/saves/saves.gml | 21 +-
.../all_chapters/time_manip/time_manip.gml | 2 +-
.../obj_battlecontroller_DUPE_Step_0.gml | 2 +-
.../user_segments/user_segments.gml | 161 ----
src/mod/all_chapters/utils/utils.gml | 42 +
src/mod/ch1/ch1_mashing/ch1_mashing.gml | 8 +
.../ch1/ch1_mashing/obj_time_SP_Create_0.gml | 8 +-
.../ch1/ch1_mashing/obj_time_SP_Draw_64.gml | 8 +-
.../ch1_wakeup_mash/obj_time_SP_Draw_64.gml | 2 +-
.../obj_battlecontroller_SP_Step_0.gml | 4 +-
.../obj_darkcontroller_SP_Step_0.gml | 20 +-
.../obj_mainchara_SP_Step_0.gml | 4 +-
.../debug/gml_GlobalScript_scr_debug_ch1.gml | 10 +
.../obj_battlecontroller_SP_Draw_0.gml | 2 +-
.../misc/screenshot/obj_time_SP_Step_1.gml | 30 +-
src/mod/ch1/tadytext/obj_time_SP_Create_0.gml | 3 +
src/mod/ch1/tadytext/obj_time_SP_Draw_64.gml | 2 +-
.../obj_npc_musical_door_Draw_64.gml | 2 +-
.../obj_rouxls_simtown_Draw_0.gml | 16 +-
.../ch2/rouxls_practice/obj_time_Create_0.gml | 2 +-
.../ch2/rouxls_practice/rouxls_practice.gml | 6 +
.../side_action/obj_darkcontroller_Step_0.gml | 18 -
.../obj_darkcontroller_Step_0.gml | 43 -
src/mod/ch2/snowgrave_plot/snowgrave_plot.gml | 32 +
101 files changed, 3014 insertions(+), 2219 deletions(-)
delete mode 100644 src/mod/all_chapters/IGT/events/obj_shortcut_door_Step_0.gml
create mode 100644 src/mod/all_chapters/IGT/presets.gml
create mode 100644 src/mod/all_chapters/boss_practice/obj_battlecontroller_DUPE_Create_0.gml
create mode 100644 src/mod/all_chapters/config/config.gml
create mode 100644 src/mod/all_chapters/config/debug/gml_GlobalScript_scr_gamestart.gml
create mode 100644 src/mod/all_chapters/config/debug_keybinds/debug_keybinds.gml
create mode 100644 src/mod/all_chapters/config/options/options.gml
create mode 100644 src/mod/all_chapters/config/other_keybinds/other_keybinds.gml
create mode 100644 src/mod/all_chapters/config/rng/rng.gml
delete mode 100644 src/mod/all_chapters/get_items/get_items.gml
create mode 100644 src/mod/all_chapters/get_items/items.gml
delete mode 100644 src/mod/all_chapters/get_items/obj_darkcontroller_DUPE_Step_0.gml
delete mode 100644 src/mod/all_chapters/misc/debug_init/gml_GlobalScript_scr_gamestart.gml
delete mode 100644 src/mod/all_chapters/misc/debug_toggle/debug_toggle.gml
delete mode 100644 src/mod/all_chapters/option_menu/feature_selector/feature_selector.gml
delete mode 100644 src/mod/all_chapters/option_menu/obj_options_watcher_Create_0.gml
delete mode 100644 src/mod/all_chapters/party_selector/obj_darkcontroller_SP_Create_0.gml
delete mode 100644 src/mod/all_chapters/party_selector/obj_darkcontroller_SP_Step_0.gml
delete mode 100644 src/mod/all_chapters/party_selector/obj_darkcontroller_Step_0.gml
create mode 100644 src/mod/all_chapters/room_warp/room_warp.gml
delete mode 100644 src/mod/all_chapters/user_segments/user_segments.gml
create mode 100644 src/mod/ch1/ch1_mashing/ch1_mashing.gml
create mode 100644 src/mod/ch1/debug/gml_GlobalScript_scr_debug_ch1.gml
create mode 100644 src/mod/ch2/rouxls_practice/rouxls_practice.gml
delete mode 100644 src/mod/ch2/side_action/obj_darkcontroller_Step_0.gml
delete mode 100644 src/mod/ch2/snowgrave_plot/obj_darkcontroller_Step_0.gml
create mode 100644 src/mod/ch2/snowgrave_plot/snowgrave_plot.gml
diff --git a/README.md b/README.md
index 031a185..88244ed 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,17 @@
-# Keucher Mod
+Keucher Mod is a DELTARUNE speedrun practice mod
-Keucher Mod, created by Keucher, is a DELTARUNE speedrun practice mod.
+# Installation
+
+1. Download [the latest version of the mod](https://github.com/nhaar/keucher-mod/releases/latest). In the `assets` section, choose the patch you will use
+2. Choose the ROM patcher you prefer, if you don't have any, [this one is recommended](https://www.marcrobledo.com/RomPatcher.js/)
+3. For the "ROM file", select the `data.win` from your DELTARUNE game files.
+4. For the "Patch file", select the patch appropriate for your DELTARUNE version.
+5. Apply the patch, and save the generated file as `data.win` in the game folder, and the mod will be installed
# Contributing
See the [wiki](https://github.com/nhaar/keucher-mod/wiki) for how to contribute
+
+# Credits
+
+This repository started on version 4 of Keucher Mod which is based on version 3, which was primarily done by Keucher, with added help from Ocean Bagel
\ No newline at end of file
diff --git a/src/main.csx b/src/main.csx
index d44e9bc..4c792d5 100644
--- a/src/main.csx
+++ b/src/main.csx
@@ -108,176 +108,6 @@ class KeucherModLoader : UMPLoader
}
return objects.Select(s => $"gml_Object_obj_{s}_Create_0").ToList();
}
-
- // convention: UMP enums use screaming snake case for enum names and snake case for enum values
-
- public enum FEATURE_STATE
- {
- never,
- always,
- debug
- }
-
- public enum KEYBINDING
- {
- save = 0,
- load = 1,
- reload = 2,
- speed = 3,
- gif = 4,
- next_room = 5,
- previous_room = 6,
- heal = 7,
- instant_win = 8,
- toggle_tp = 9,
- toggle_debug = 10,
- stop_sounds = 11,
- reset_tempflags = 12,
- warp_room = 13,
- toggle_hitboxes = 14,
- make_visible = 15,
- snowgrave_plot = 16,
- change_party = 17,
- side_action = 18,
- no_clip = 19,
- get_item = 20,
- plot_warp = 21,
- igt_mode = 22,
- igt_room = 23,
- toggle_timer = 24,
- reset_timer = 25,
- store_savestate = 26,
- load_savestate = 27,
- toggle_crit_mode = 28,
- toggle_pattern_mode = 29,
- next_crit_pattern = 30,
- previous_crit_pattern = 31,
- toggle_rouxls = 32,
- next_house_pattern = 33,
- previous_house_pattern = 34,
- toggle_boss = 35,
- next_boss_attack = 36,
- previous_boss_attack = 37,
- screenshot = 38
- }
-
- public enum OPTION_STATE
- {
- default_state,
- ///
- /// For the option that shows all features
- ///
- features,
- ///
- /// For the options of a single feature
- ///
- single_feature,
- keybind_assign,
- splits,
- split_assign,
- split_creator,
- split_pick,
- general_options,
- ui_colors,
- color_picker,
- ///
- /// In this state, the save files are displayed
- ///
- saves
- }
-
- public enum DEFAULT_OPTION
- {
- feature,
- current_split,
- create_split,
- timer_precision,
- options,
- ///
- /// Option that allows to browse saves
- ///
- saves
- }
-
- public enum BUTTON_STATE
- {
- none,
- hover,
- press,
- highlight
- }
-
- ///
- /// The state of the boundary box visibility
- ///
- public enum BOUNDARY_BOX_STATE
- {
- ///
- /// No boundary boxes are visible
- ///
- none,
- ///
- /// Only the boundary boxes of the doors are visible
- ///
- doors,
- ///
- /// All boundary boxes are visible
- ///
- doors_and_walls
- }
-
- public enum GENERAL_OPTION
- {
- ui_colors
- }
-
- public enum UI_ELEMENT
- {
- background,
- button,
- text,
- border,
- button_hover,
- button_press,
- button_highlight
- }
-
- public enum COLOR_PICKER_OPTION
- {
- rgb,
- hex
- }
-
- ///
- /// Different modes for the IGT
- ///
- public enum IGT_MODE
- {
- ///
- /// IGT is not watching for anything
- ///
- none,
- ///
- /// IGT watches for the room to change
- ///
- room_by_room,
- ///
- /// IGT watches for start of battle, splits every turn
- ///
- battle,
- ///
- /// IGT watches for the segment to start and end
- ///
- segment,
- ///
- /// IGT watches for the room to change or for battle to end and start
- ///
- room_and_battle,
- ///
- /// Same as room and battle with some extra triggers
- ///
- room_battle_extra
- }
}
void BuildMod (DeltaruneVersion version)
diff --git a/src/mod/all_chapters/IGT/events/gml_Object_DEVICE_NAMER_Draw_0.gml b/src/mod/all_chapters/IGT/events/gml_Object_DEVICE_NAMER_Draw_0.gml
index 9461fcc..e5eab42 100644
--- a/src/mod/all_chapters/IGT/events/gml_Object_DEVICE_NAMER_Draw_0.gml
+++ b/src/mod/all_chapters/IGT/events/gml_Object_DEVICE_NAMER_Draw_0.gml
@@ -3,5 +3,5 @@
/// BEFORE
snd_play(snd_dtrans_lw)
/// CODE
-global.current_event = "ch2start"
+global.current_event = "ch2_start"
/// END
\ No newline at end of file
diff --git a/src/mod/all_chapters/IGT/events/gml_Object_obj_writer_Draw_0.gml b/src/mod/all_chapters/IGT/events/gml_Object_obj_writer_Draw_0.gml
index cc511d8..daf6e7f 100644
--- a/src/mod/all_chapters/IGT/events/gml_Object_obj_writer_Draw_0.gml
+++ b/src/mod/all_chapters/IGT/events/gml_Object_obj_writer_Draw_0.gml
@@ -10,6 +10,6 @@ This patch is for having a way to split when going to bed in Chapter 2.
/// CODE
if (mystring == "\\E1* ... they're already asleep.../%" || mystring == "\\E1* …ふたりとも もう& ねむってしまったのね。/%")
{
- global.current_event = "ch2sleep"
+ global.current_event = "ch2_sleep"
}
/// END
\ No newline at end of file
diff --git a/src/mod/all_chapters/IGT/events/gml_Object_obj_writer_SP_Draw_0.gml b/src/mod/all_chapters/IGT/events/gml_Object_obj_writer_SP_Draw_0.gml
index ecaca50..a6f5463 100644
--- a/src/mod/all_chapters/IGT/events/gml_Object_obj_writer_SP_Draw_0.gml
+++ b/src/mod/all_chapters/IGT/events/gml_Object_obj_writer_SP_Draw_0.gml
@@ -10,6 +10,6 @@ This patch is for having a way to split when going to bed in Chapter 1.
/// CODE
if (mystring == "* (You decided to go to bed.)/%" || mystring == "* (ねむることにした)/%")
{
- global.current_event = "ch1sleep"
+ global.current_event = "ch1_sleep"
}
/// END
\ No newline at end of file
diff --git a/src/mod/all_chapters/IGT/events/o_bq_whitefade_Step_0.gml b/src/mod/all_chapters/IGT/events/o_bq_whitefade_Step_0.gml
index 3c9e757..4557c6c 100644
--- a/src/mod/all_chapters/IGT/events/o_bq_whitefade_Step_0.gml
+++ b/src/mod/all_chapters/IGT/events/o_bq_whitefade_Step_0.gml
@@ -3,5 +3,5 @@
/// AFTER
snd_play(snd_explosion)
/// CODE
-global.current_event = "gigaend"
+global.current_event = "ch2_gigaend"
/// END
\ No newline at end of file
diff --git a/src/mod/all_chapters/IGT/events/obj_castlefront_event_SP_Step_0.gml b/src/mod/all_chapters/IGT/events/obj_castlefront_event_SP_Step_0.gml
index 004256f..cfd114d 100644
--- a/src/mod/all_chapters/IGT/events/obj_castlefront_event_SP_Step_0.gml
+++ b/src/mod/all_chapters/IGT/events/obj_castlefront_event_SP_Step_0.gml
@@ -7,5 +7,5 @@ snd_play_ch1(snd_hurt1_ch1)
snd_play(snd_hurt1)
#endif
/// CODE
-global.current_event = "captured"
+global.current_event = "ch1_captured"
/// END
\ No newline at end of file
diff --git a/src/mod/all_chapters/IGT/events/obj_ch2_city08_Step_0.gml b/src/mod/all_chapters/IGT/events/obj_ch2_city08_Step_0.gml
index a63a68b..60f0cf2 100644
--- a/src/mod/all_chapters/IGT/events/obj_ch2_city08_Step_0.gml
+++ b/src/mod/all_chapters/IGT/events/obj_ch2_city08_Step_0.gml
@@ -3,5 +3,5 @@
/// AFTER
c_wait(70)
/// CODE
-global.current_event = "city2end"
+global.current_event = "ch2_city2end"
/// END
\ No newline at end of file
diff --git a/src/mod/all_chapters/IGT/events/obj_ch2_scene11a_Alarm_3.gml b/src/mod/all_chapters/IGT/events/obj_ch2_scene11a_Alarm_3.gml
index 813f9e7..4381a06 100644
--- a/src/mod/all_chapters/IGT/events/obj_ch2_scene11a_Alarm_3.gml
+++ b/src/mod/all_chapters/IGT/events/obj_ch2_scene11a_Alarm_3.gml
@@ -1,3 +1,3 @@
/// IMPORT .ignore ifndef DEMO
-global.current_event = "cyberend"
+global.current_event = "ch2_cyberend"
diff --git a/src/mod/all_chapters/IGT/events/obj_darkdoorevent_SP_Step_0.gml b/src/mod/all_chapters/IGT/events/obj_darkdoorevent_SP_Step_0.gml
index 6a212c0..eb3fd08 100644
--- a/src/mod/all_chapters/IGT/events/obj_darkdoorevent_SP_Step_0.gml
+++ b/src/mod/all_chapters/IGT/events/obj_darkdoorevent_SP_Step_0.gml
@@ -2,5 +2,5 @@
/// AFTER
image_index = 1
/// CODE
-global.current_event = "doorslam"
+global.current_event = "ch1_ct_doorslam"
/// END
\ No newline at end of file
diff --git a/src/mod/all_chapters/IGT/events/obj_king_boss_SP_Other_20.gml b/src/mod/all_chapters/IGT/events/obj_king_boss_SP_Other_20.gml
index c039a00..df3189a 100644
--- a/src/mod/all_chapters/IGT/events/obj_king_boss_SP_Other_20.gml
+++ b/src/mod/all_chapters/IGT/events/obj_king_boss_SP_Other_20.gml
@@ -1,4 +1,4 @@
/// PATCH
/// PREPEND
-global.current_event = "kingdefeat"
+global.current_event = "ch1_kingdefeat"
/// END
\ No newline at end of file
diff --git a/src/mod/all_chapters/IGT/events/obj_musical_battle_end_Draw_0.gml b/src/mod/all_chapters/IGT/events/obj_musical_battle_end_Draw_0.gml
index ed57ec6..ece26b2 100644
--- a/src/mod/all_chapters/IGT/events/obj_musical_battle_end_Draw_0.gml
+++ b/src/mod/all_chapters/IGT/events/obj_musical_battle_end_Draw_0.gml
@@ -3,5 +3,5 @@
/// BEFORE
for (i = 0; i < 20; i++)
/// CODE
-global.current_event = "djsend"
+global.current_event = "ch2_djsend"
/// END
\ No newline at end of file
diff --git a/src/mod/all_chapters/IGT/events/obj_prisonevent_SP_Step_0.gml b/src/mod/all_chapters/IGT/events/obj_prisonevent_SP_Step_0.gml
index ce6e893..f9791f2 100644
--- a/src/mod/all_chapters/IGT/events/obj_prisonevent_SP_Step_0.gml
+++ b/src/mod/all_chapters/IGT/events/obj_prisonevent_SP_Step_0.gml
@@ -2,5 +2,5 @@
/// AFTER
global.plot = 156
/// CODE
-global.current_event = "escaped"
+global.current_event = "ch1_escaped"
/// END
\ No newline at end of file
diff --git a/src/mod/all_chapters/IGT/events/obj_shortcut_door_Step_0.gml b/src/mod/all_chapters/IGT/events/obj_shortcut_door_Step_0.gml
deleted file mode 100644
index b1b4b3b..0000000
--- a/src/mod/all_chapters/IGT/events/obj_shortcut_door_Step_0.gml
+++ /dev/null
@@ -1,10 +0,0 @@
-/// PATCH .ignore ifndef DEMO
-
-// for splitting only AFTER mauswheel
-/// AFTER
-room_goto(door_destination)
-/// CODE
-// TO-DO: figure out what this was even for and adapt it
-// if (obj_IGT.igt_mode == 3 && obj_IGT.current_split == global.SPLIT_mansion && global.plot == 55)
-// obj_IGT.segment_start_room = 168
-/// END
\ No newline at end of file
diff --git a/src/mod/all_chapters/IGT/igt.gml b/src/mod/all_chapters/IGT/igt.gml
index 5078e5e..13827fc 100644
--- a/src/mod/all_chapters/IGT/igt.gml
+++ b/src/mod/all_chapters/IGT/igt.gml
@@ -18,7 +18,7 @@ function set_igt_splits_info(split_status)
// reset split and TP info
// TO-DO: Check why TP must be reset here and in boss practice
- for (i = 0; i < 20; i++)
+ for (var i = 0; i < 20; i++)
{
obj_IGT.split_times[i] = -2
obj_IGT.turn_graze[i] = 0
@@ -34,7 +34,6 @@ function set_igt_splits_info(split_status)
// this is the option for resetting the timer
if (split_status == 0)
{
- obj_IGT.hide_timer = false
obj_IGT.start_time = get_timer()
obj_IGT.last_transition_time = obj_IGT.start_time
obj_IGT.time_lock_value = obj_IGT.start_time
@@ -42,12 +41,6 @@ function set_igt_splits_info(split_status)
obj_IGT.time_since_last_transition = 0
obj_IGT.current_instruction = 0
}
- // this option is for changing the IGT mode
- if (split_status == 1)
- {
- obj_IGT.start_time = 0
- obj_IGT.igt_mode = (obj_IGT.igt_mode + 1) % #IGT_MODE.#length
- }
if i_ex(obj_IGT)
{
with (obj_IGT)
@@ -63,45 +56,14 @@ function set_igt_splits_info(split_status)
}
}
}
- // split status 2 is the automatic call
if (split_status != 2)
{
- switch obj_IGT.igt_mode
- {
- case #IGT_MODE.none:
- __splitsText = "No"
- obj_IGT.segment_start_room = 0
- break
- case #IGT_MODE.room_by_room:
- __splitsText = "Room-by-room"
- break
- case #IGT_MODE.battle:
- __splitsText = "Battle"
- for (var i = 0; i < 20; i++)
- {
- obj_IGT.split_times[i] = -2
- }
- break
- case #IGT_MODE.segment:
- __splitsText = "Segment with"
- update_splits()
- break
- case #IGT_MODE.room_and_battle:
- __splitsText = "Room & Battle"
- break
- case #IGT_MODE.room_battle_extra:
- __splitsText = "Room & Battle & More"
- break
- }
+ init_timer_mode();
}
if (split_status == 0)
{
show_temp_message("Timer reset")
}
- else if (split_status == 1)
- {
- show_temp_message(string(__splitsText) + " splits selected")
- }
if (split_status == 2)
{
show_temp_message("Max splits reached - splits reset")
@@ -110,7 +72,8 @@ function set_igt_splits_info(split_status)
function update_splits()
{
- obj_IGT.segment_start_room = obj_IGT.split_start_room
+ var instruction = read_json_value(global.presets, get_current_preset(), "instructions");
+ obj_IGT.segment_split_number = ds_map_size(instruction) - 1;
for (var i = 0; i < obj_IGT.segment_split_number; i++)
{
obj_IGT.split_times[i] = 0
@@ -127,83 +90,6 @@ function igt_reset_transition_time()
obj_IGT.time_since_last_transition = 0
}
-function set_all_instructions()
-{
- global.ALL_INSTRUCTIONS = create_array
- (
-#if DEMO
- "PLACE_CONTACT_ch1",
-#endif
-#if SURVEY_PROGRAM
- "PLACE_CONTACT",
-#endif
- "ch1introend",
-#if DEMO
- "room_krisroom_ch1",
- "room_dark1_ch1",
- "room_dark1a_ch1",
- "room_castle_outskirts_ch1",
-#endif
-#if SURVEY_PROGRAM
- "room_castle_outskirts",
- "room_dark1_ch1",
- "room_dark1a_ch1",
- "room_castle_outskirts_ch1",
-#endif
- "doorslam",
-#if DEMO
- "room_field_start_ch1",
- "room_field_puzzle1_ch1",
- "room_field_shop1_ch1",
- "room_field_checkers4_ch1",
- "room_forest_savepoint1_ch1",
- "room_forest_afterthrash2_ch1",
-#endif
-#if SURVEY_PROGRAM
- "room_field_start",
- "room_field_puzzle1",
- "room_field_shop1",
- "room_field_checkers4",
- "room_forest_savepoint1",
- "room_forest_afterthrash2",
-#endif
- "captured",
- "escaped",
-#if DEMO
- "room_cc_prisonlancer_ch1",
-#endif
-#if SURVEY_PROGRAM
- "room_cc_prisonlancer",
-#endif
- "kingdefeat",
-#if DEMO
- "room_krishallway_ch1",
-#endif
-#if SURVEY_PROGRAM
- "room_krishallway",
-#endif
- "ch1sleep",
-#if DEMO
- "ch2start",
- "room_dw_cyber_intro_1",
- "djsend",
- "cyberend",
- "room_dw_city_intro",
- "room_dw_city_traffic_4",
- "room_dw_mansion_krisroom",
- "city2end",
- "room_dw_mansion_fire_paintings",
- "room_dw_mansion_acid_tunnel",
- "room_dw_mansion_acid_tunnel_exit",
- "room_dw_mansion_top",
- "room_dw_mansion_top_post",
- "gigaend",
- "room_torhouse",
- "ch2sleep"
-#endif
- )
-}
-
/*
Updates times assuming a "transition" occured in this frame (normally used for room transitions, also for leaving/enter battle sometimes)
@@ -213,4 +99,147 @@ function update_transition_time(current_frame_time)
{
time_since_last_transition = current_frame_time - last_transition_time
last_transition_time = current_frame_time
+}
+
+/* Get array of all special (non room, non battle) instructions */
+function get_all_special_instructions()
+{
+ return create_array(
+ "ch1_introend",
+ "ch1_ct_doorslam",
+ "ch1_captured",
+ "ch1_escaped",
+ "ch1_kingdefeat",
+ "ch1_sleep",
+ "ch2_start",
+ "ch2_djsend",
+ "ch2_cyberend",
+ "ch2_city2end",
+ "ch2_gigaend",
+ "ch2_sleep"
+ );
+}
+
+function get_special_instruction_name(instruction)
+{
+ switch (instruction)
+ {
+ case "ch1_introend": return "At the end of the VESSEL CREATION";
+ case "ch1_ct_doorslam": return "When the Castle Down door is closed";
+ case "ch1_captured": return "Getting captured in Chapter 1";
+ case "ch1_escaped": return "Escape prison in Chapter 1";
+ case "ch1_kingdefeat": return "Finish King fight";
+ case "ch1_sleep": return "Sleeping in Chapter 1 (TIME END)";
+ case "ch2_start": return "Press YES in Chapter 2 naming";
+ case "ch2_djsend": return "End DJs fight";
+ case "ch2_cyberend": return "White fadeout in Cyber Field end";
+ case "ch2_city2end": return "Black screen in City end";
+ case "ch2_gigaend": return "End Giga Queen";
+ case "ch2_sleep": return "Sleeping in Chapter 2 (TIME END)";
+ default:
+ show_message("Unknown special instruction: " + instruction);
+ e += "crash";
+ }
+}
+
+/* Initialize timer variables */
+function init_timer_options()
+{
+ // variable keeps track of the IGT timer mode
+ // modes: "segment", "battle", "splits"
+ read_config_with_default("segment", "timer_mode");
+ read_config_with_default(true, "timer_room_split");
+ read_config_with_default(false, "timer_battle_split");
+ read_config_with_default(3, "timer_precision");
+ var instructions = get_all_special_instructions();
+ var size = array_length(instructions);
+ for (var i = 0; i < size; i++)
+ {
+ read_config_with_default(false, "timer_special_" + instructions[i]);
+ }
+}
+
+function change_to_timer_segment_mode()
+{
+ update_config_value("segment", "timer_mode");
+}
+
+function change_to_timer_battle_mode()
+{
+ update_config_value("battle", "timer_mode");
+ for (var i = 0; i < 20; i++)
+ {
+ obj_IGT.split_times[i] = -2;
+ }
+}
+
+function change_to_timer_splits_mode()
+{
+ update_config_value("splits", "timer_mode");
+ update_splits();
+}
+
+function get_timer_mode()
+{
+ return read_config_value("timer_mode");
+}
+
+/* Get whether or not splitting at end of rooms in segment-by-segment is on */
+function get_segment_room_status()
+{
+ return read_config_value("timer_room_split");
+}
+/* Get whether or not splitting at start/end of battles in segment-by-segment is on */
+function get_segment_battle_status()
+{
+ return read_config_value("timer_battle_split");
+}
+
+/* Get whether or not splitting at a special instruction in segment-by-segment is on */
+function get_segment_special_status(instruction)
+{
+ return read_config_value("timer_special_" + instruction);
+}
+
+function init_timer_mode()
+{
+ if (get_timer_mode() == "battle")
+ {
+ change_to_timer_battle_mode();
+ }
+ else if (get_timer_mode() == "splits")
+ {
+ change_to_timer_splits_mode();
+ }
+}
+
+function reset_battle_display()
+{
+ // battle mode variables
+ // splittext is an array for each split (to-do: clarify)
+ // turn_graze stores the amount grazed in each split/turn?
+ // tp_end is how much tp one had at the end of the turn
+ for (i = 0; i < 20; i += 1)
+ {
+ obj_IGT.splittext[i] = "";
+ obj_IGT.turn_graze[i] = 0;
+ obj_IGT.tp_end[i] = 0;
+ obj_IGT.grazeOriginal[i] = 0;
+ obj_IGT.TPstart[i] = 0;
+ obj_IGT.turn_count = -1;
+ obj_IGT.split_times[i] = -2;
+ }
+}
+
+/* Function ensures compatibility with ch1 rooms in survey program */
+function parse_room_name(instruction)
+{
+ var parsed = instruction;
+#if SURVEY_PROGRAM
+ if (string_pos("ch1", instruction) > 0)
+ {
+ parsed = string_copy(instruction, 1, string_length(instruction) - 4);
+ }
+#endif
+ return parsed;
}
\ No newline at end of file
diff --git a/src/mod/all_chapters/IGT/obj_IGT_Create_0.gml b/src/mod/all_chapters/IGT/obj_IGT_Create_0.gml
index 3dc3bd1..dc91fe8 100644
--- a/src/mod/all_chapters/IGT/obj_IGT_Create_0.gml
+++ b/src/mod/all_chapters/IGT/obj_IGT_Create_0.gml
@@ -5,115 +5,57 @@ global.chapter = 0
global.fighting = 0
global.mnfight = 0
+read_config_with_default(false, "timer_on");
+
// split_times stores the times for each of the current splits
-// by default, it's set to -2, which is the same as "not set"
-for (i = 0; i < 20; i += 1)
- split_times[i] = -2
+// by default, it's set to -2, which is the same as "this split is not meant to be used"
+for (var i = 0; i < 20; i++)
+{
+ split_times[i] = -2;
+}
// store the room that starts the current segment
-segment_start_room = -1
-
-// variable keeps track of the IGT timer mode
-igt_mode = #IGT_MODE.none
-
-// should be `true` if the timer is invisible, `false` if it is visible
-hide_timer = false
+segment_start_room = -1;
// the time the timer started
-start_time = 0
+start_time = 0;
// the time the last transition took place
-last_transition_time = 0
+last_transition_time = 0;
// the room player was in the previous frame
-previous_room = 0
+previous_room = 0;
// for the current splits
-attempt_count = 0
+attempt_count = 0;
// delineates time between each room
-time_since_last_transition = 0
+time_since_last_transition = 0;
// variable used to lock the timer if it's equal to `start_time`
-time_lock_value = 0
+time_lock_value = 0;
-// should be `0` if crit practice is off, and `1` if it's on
-// TO-DO: Move unrelated variable initialization
-global.ambyu_practice = 0
-
-// splittext is an array for each split
-// turn_graze stores the amount grazed in each split/turn?
-// TO-DO: What exactly is `tp_end`?
-for (i = 0; i < 20; i += 1)
-{
- splittext[i] = ""
- turn_graze[i] = 0
- tp_end[i] = 0
-}
+// used for init
+reset_battle_display();
// TO-DO: Move unrelated savestate functionality to a separate file
global.savestateLoad = 0
// flag to signify whether or not the player is in a battle
-battle_started = false
+battle_started = false;
// flag to signify whether or not the player is in a fight turn
-turn_started = false
+turn_started = false;
// TO-DO: check what exactly this is
-turn_count = -1
-
-// TO-DO: check what this flag does
-global.flag[48] = 0
+turn_count = -1;
// total time in frames saved from grazing in a turn
-global.grazeSubtracted = 0
-
-// should be `1` if boss practice is on, `0` otherwise
-// TO-DO: Move unrelated boss practice variable initialization
-global.bossPractice = 0
-
-// current turn being practiced in boss practice
-global.bossTurn = 0
-
-// text for the current boss practice turn
-global.bossText = ""
-
-// No idea wtf these are for, somehow related to choosing Berdly and Starwalker with H
-// TO-DO: Move this unrelated initialization and ask Keucher wtf this is
-global.krerdlyMode = 0
-global.theOriginal = 0
-
-// Related to viewing hitboxes
-// TO-DO: Move unrelated hitbox variable initialization
-global.bboxVisible = 0
-
-// related to savestates. Move out of this file
-global.currentSlotSelected = 0
-
-// for plotwarps. Why is it a string?
-warpNumber = "69"
-
-// unsure exactly what, savestate related
-slotWasSelected = -1
-
-// unsure exactly what
-splitNumber = 0
-
-// on the naming screen
-ch2start = 0
+global.grazeSubtracted = 0;
// unsure and why is it a number?
turntext = 0
-// this is like the 6th time I see this code block
-// TO-DO: Refactor and understand why it shows up in each case
-for (i = 0; i < 20; i++)
-{
- grazeOriginal[i] = 0
- TPstart[i] = 0
-}
-
// I believe it's time in current turn
thisTurn = 0
lastTurn = 0
@@ -121,16 +63,22 @@ lastTurn = 0
// initialize variables used to room tracking
previous_room = room
-// boolean, for the IGT
+// boolean, for the IGT, except it is "2" if the timer is finished, but not reset
global.timerIsRunning = 0
// poor naming here, in the future should change
// split -> segment
// instruction -> split
-current_split = -1
split_start_room = 0
segment_split_number = 0
current_instruction = 0
-global.current_event = ""
\ No newline at end of file
+global.current_event = ""
+
+// time for after a run is finished
+global.final_time = 0
+
+init_timer_mode();
+
+contimer = 0;
\ No newline at end of file
diff --git a/src/mod/all_chapters/IGT/obj_IGT_Draw_64.gml b/src/mod/all_chapters/IGT/obj_IGT_Draw_64.gml
index 3555319..74e6944 100644
--- a/src/mod/all_chapters/IGT/obj_IGT_Draw_64.gml
+++ b/src/mod/all_chapters/IGT/obj_IGT_Draw_64.gml
@@ -1,6 +1,6 @@
/// IMPORT
-if (!is_feature_active("timer"))
+if (!read_config_value("timer_on"))
return;
xx = 640
@@ -9,16 +9,37 @@ yy = 0
draw_set_font(fnt_main)
draw_set_color(c_white)
-// if in room-by-room mode or room&battle
-if (igt_mode == #IGT_MODE.room_by_room || igt_mode == #IGT_MODE.room_and_battle || igt_mode == #IGT_MODE.room_battle_extra)
+var current_frame_time = get_timer()
+
+// split segment on room
+if (get_timer_mode() == "segment" && get_segment_room_status())
+{
runningtimer = time_since_last_transition
+}
else
- runningtimer = last_transition_time - start_time
+{
+ if (global.timerIsRunning == 1)
+ {
+ runningtimer = last_transition_time - start_time;
+ contimer = current_frame_time - start_time;
+ }
+ else if (global.timerIsRunning == 0)
+ {
+ runningtimer = 0;
+ contimer = 0;
+ }
+ else if (global.timerIsRunning == 2)
+ {
+ runningtimer = global.final_time;
+ contimer = global.final_time;
+ }
+}
-// timer text
-text = hide_timer ? "" : to_readable_time(runningtimer)
+// timer texts
+text = to_readable_time(runningtimer)
+conText = to_readable_time(contimer)
-if (igt_mode == #IGT_MODE.battle || igt_mode == #IGT_MODE.segment)
+if (get_timer_mode() == "battle" || get_timer_mode() == "splits")
{
// iterating over all splits
var total = 0
@@ -32,10 +53,11 @@ if (igt_mode == #IGT_MODE.battle || igt_mode == #IGT_MODE.segment)
runningtimer = 0
// -2 means split is not defined for this mode
// POSSIBLE TO-DO: add break after finding first undefined?
+ // to-do: This way of doing it every frame is more resource intensive than needed, might be interesting to optimize it (so far has not shown to be necessary)
if (split_times[i] != -2)
{
- splittext[i] = to_readable_time(runningtimer)
- if (igt_mode == #IGT_MODE.battle)
+ splittext[i] = to_readable_time(runningtimer)
+ if (get_timer_mode() == "battle")
{
// TO-DO: figure out what each of these statements represent
// but as a group it's to see if is in battle
@@ -43,7 +65,6 @@ if (igt_mode == #IGT_MODE.battle || igt_mode == #IGT_MODE.segment)
(
turn_graze[i + 1] != 0 ||
tp_end[i + 1] != 0 ||
- battle_started ||
turn_count > i
)
splittext[i] += ", " + string(tp_end[i + 1]) + "tp, " + string(turn_graze[i + 1]) + "f"
@@ -52,22 +73,23 @@ if (igt_mode == #IGT_MODE.battle || igt_mode == #IGT_MODE.segment)
}
}
-// what's conText?
-draw_set_halign(fa_right)
-draw_text(xx - 10, yy + 5, conText)
-draw_set_halign(fa_left)
-
-if ((start_time == 0 || start_time == time_lock_value) && igt_mode != #IGT_MODE.room_by_room && igt_mode != #IGT_MODE.room_and_battle && igt_mode != #IGT_MODE.room_battle_extra)
+if ((start_time == 0 || start_time == time_lock_value) && get_timer_mode() != "segment")
{
draw_set_color(c_gray)
global.timerIsRunning = 0
}
-else
- global.timerIsRunning = 1
+
+// main timer
+var main_timer = get_timer_mode() == "segment" ? text : conText;
+
+draw_set_halign(fa_right)
+draw_text(xx - 10, yy + 5, main_timer)
+draw_set_halign(fa_left)
+
// drawing the main timer text
// first is for not room-by-room, other is room-by-room
-if ((igt_mode == #IGT_MODE.battle || igt_mode == #IGT_MODE.segment) && !hide_timer)
+if (get_timer_mode() == "battle" || get_timer_mode() == "splits")
{
for (var i = 0; i < 20; i++)
{
@@ -75,30 +97,26 @@ if ((igt_mode == #IGT_MODE.battle || igt_mode == #IGT_MODE.segment) && !hide_tim
draw_text(xx - 10, yy + 17, text)
if (splittext[i] != "")
draw_text(xx - 10, yy + 34 + i * 12, splittext[i])
- if (igt_mode == #IGT_MODE.battle)
- draw_text
- (
- xx - 10, yy + 51 + turn_count * 12,
- string(global.grazeSubtracted / 30) + "s (" + string(global.grazeSubtracted) + "f)"
- )
- else
- {
- var height = igt_mode == #IGT_MODE.segment ? segment_split_number : 0
- draw_text(xx - 10, yy + 51 + height * 12, string(attempt_count))
+ draw_set_halign(fa_left)
}
- draw_set_halign(fa_left)
+ draw_set_halign(fa_right)
+ if (get_timer_mode() == "battle")
+ draw_text
+ (
+ xx - 10, yy + 51 + turn_count * 12,
+ string(global.grazeSubtracted / 30) + "s (" + string(global.grazeSubtracted) + "f)"
+ )
+ else
+ {
+ var height = get_timer_mode() == "splits" ? segment_split_number : 0
+ draw_text(xx - 10, yy + 51 + height * 12, string(attempt_count))
}
+ draw_set_halign(fa_left)
}
else
{
- draw_set_halign(fa_right)
- draw_text(xx - 10, yy + 17, text)
- if (!hide_timer)
- draw_text(xx - 10, yy + 34, string(attempt_count))
-
- draw_set_halign(fa_left)
+ // draw_set_halign(fa_right)
+ // draw_text(xx - 10, yy + 17, text)
+ // draw_text(xx - 10, yy + 34, string(attempt_count))
+ // draw_set_halign(fa_left)
}
-
-// switching timer mode
-if keyboard_check_pressed(get_bound_key(#KEYBINDING.igt_mode))
- set_igt_splits_info(1)
diff --git a/src/mod/all_chapters/IGT/obj_IGT_Step_0.gml b/src/mod/all_chapters/IGT/obj_IGT_Step_0.gml
index 380c1bd..d180188 100644
--- a/src/mod/all_chapters/IGT/obj_IGT_Step_0.gml
+++ b/src/mod/all_chapters/IGT/obj_IGT_Step_0.gml
@@ -3,23 +3,15 @@
// a variable to keep track of whether the time has been updated already, to avoid duplicates between room by room and battle
var updated_already = false
-if (!is_feature_active("timer"))
+if (!read_config_value("timer_on"))
return;
-
var current_frame_time = get_timer()
// warn player when max splits reached
if (split_times[19] != -2)
set_igt_splits_info(2)
-// what exactly is this timer for?
-contimer = current_frame_time - start_time
-if hide_timer
- conText = ""
-else
- conText = to_readable_time(contimer)
-
// room updating
if (previous_room != room)
{
@@ -29,7 +21,7 @@ if (previous_room != room)
}
// battle updating, if in rooom & battle mode, toggle transition when fight ends or starts
-if ((igt_mode == #IGT_MODE.room_and_battle || igt_mode == #IGT_MODE.room_battle_extra) && global.fighting != battle_started)
+if ((get_timer_mode() == "segment" && get_segment_battle_status()) && global.fighting != battle_started)
{
if (!updated_already)
{
@@ -38,25 +30,18 @@ if ((igt_mode == #IGT_MODE.room_and_battle || igt_mode == #IGT_MODE.room_battle_
}
// updating thigns related to battle
-if (igt_mode == #IGT_MODE.battle)
+if (get_timer_mode() == "battle")
{
// first: setting everything up when entering battle
if (global.fighting && !battle_started)
{
+ global.timerIsRunning = 1;
start_time = current_frame_time
last_transition_time = current_frame_time
lastTurn = current_frame_time
thisTurn = 0
turn_count = -1
- // TO-DO: figure why here and group this pattern again
- for (i = 0; i < 20; i += 1)
- {
- split_times[i] = -2
- turn_graze[i] = 0
- tp_end[i] = 0
- grazeOriginal[i] = 0
- TPstart[i] = 0
- }
+ reset_battle_display();
global.grazeSubtracted = 0
}
// TO-DO: properly document all these cases
@@ -70,9 +55,9 @@ if (igt_mode == #IGT_MODE.battle)
// ending turn? or end battle?
if (!global.fighting && battle_started)
{
- turn_count++
last_transition_time = current_frame_time
- thisTurn = current_frame_time - start_time
+ global.final_time = current_frame_time - start_time;
+ global.timerIsRunning = 2;
}
// ending turn?
if (global.mnfight != 2 && turn_started)
@@ -89,91 +74,56 @@ if (igt_mode == #IGT_MODE.battle)
if (thisTurn != 0 && split_times[turn_count] == -2)
split_times[turn_count] = thisTurn + start_time
}
-else if (igt_mode == #IGT_MODE.segment && current_split >= 0)
+else if (get_timer_mode() == "splits" && get_current_preset() >= 0)
{
if (current_instruction <= segment_split_number)
{
- var instruction = read_json_value(global.splits_json, current_split, "instructions", current_instruction)
- if (instruction == room_get_name(room) || global.current_event = instruction)
+ var instruction = read_json_value(global.presets, get_current_preset(), "instructions", current_instruction)
+ if (parse_room_name(instruction) == room_get_name(room) || global.current_event = instruction)
{
if (current_instruction == 0)
{
start_time = current_frame_time
attempt_count++
+ global.timerIsRunning = 1;
}
else
{
split_times[current_instruction - 1] = current_frame_time
}
current_instruction++
+ if (current_instruction > segment_split_number)
+ {
+ global.final_time = current_frame_time - start_time;
+ global.timerIsRunning = 2;
+ }
}
global.current_event = ""
}
}
-else if (igt_mode == #IGT_MODE.room_battle_extra)
+// only go if there is an event
+else if (get_timer_mode() == "segment" && global.current_event != "")
{
- if (global.current_event == "ch1introend" || global.current_event == "ch2start" || global.current_event == "ch2sleep" || global.current_event == "ch1sleep" || global.current_event == "doorslam")
+ var instructions = get_all_special_instructions();
+ var size = array_length(instructions)
+ for (var i = 0; i < size; i++)
{
- update_transition_time(current_frame_time)
- global.current_event = ""
+ if (global.current_event == instructions[i])
+ {
+ if (get_segment_special_status(global.current_event))
+ {
+ update_transition_time(current_frame_time);
+ global.current_event = "";
+ }
+ break;
+ }
}
}
-
-// custom room timer
-if keyboard_check_pressed(get_bound_key(#KEYBINDING.igt_room))
-{
- segment_start_room = get_integer("What room number would you like the timer to start in?", room)
- attempt_count = 0
-}
-
-// hide timer
-if keyboard_check_pressed(get_bound_key(#KEYBINDING.toggle_timer))
-{
- hide_timer = hide_timer ? false : true
-}
-
// reset timer
-if keyboard_check_pressed(get_bound_key(#KEYBINDING.reset_timer))
- set_igt_splits_info(0)
-if (detected_active_feature_key(#KEYBINDING.plot_warp, "plotwarp"))
+if pressed_other_keybind("reset_timer")
{
- var plot_warp_number = 10
- var first_plot_warp = 3
-
- for (var i = 0; i < plot_warp_number; i++)
- {
- if (keyboard_check_pressed(ord(string(i))))
- {
- if (global.chapter == 1)
- {
- switch (i)
- {
- case 3: plotwarp("ch1_wake_up"); break
- case 4: plotwarp("field_start"); break
- case 5: plotwarp("checkerboard_start"); break
- case 6: plotwarp("forest_start"); break
- case 7: plotwarp("post_vs_lancer"); break
- case 8: plotwarp("post_escape"); break
- case 9: plotwarp("king"); break
- }
- }
- else if (global.chapter == 2)
- {
- switch (i)
- {
- case 3: plotwarp("post_arcade"); break
- case 4: plotwarp("city_start"); break
- case 5: plotwarp("city_dj_save"); break
- case 6: plotwarp("city_post_berdly"); break
- case 7: plotwarp("mansion_start"); break
- case 8: plotwarp("acid_lake_start"); break
- case 9: plotwarp("acid_lake_exit"); break
- }
- }
- break
- }
- }
+ set_igt_splits_info(0);
}
// update battle started tracker for next frame (must be at the end to delay the previous checks)
diff --git a/src/mod/all_chapters/IGT/presets.gml b/src/mod/all_chapters/IGT/presets.gml
new file mode 100644
index 0000000..eddfb4d
--- /dev/null
+++ b/src/mod/all_chapters/IGT/presets.gml
@@ -0,0 +1,169 @@
+/// FUNCTIONS
+
+function init_split_presets()
+{
+
+ global.presets_json = global.mod_dir + "/presets.json";
+ if (!file_exists(global.presets_json))
+ {
+ var file = file_text_open_write(global.presets_json);
+ file_text_write_string(file, "{}");
+ file_text_close(file);
+ }
+
+ global.presets = scr_84_load_map_json(global.presets_json);
+ read_config_with_default(-1, "timer_current_preset");
+}
+
+function save_split_presets()
+{
+ save_json(global.presets_json, global.presets);
+}
+
+function create_split_preset(instructions, name)
+{
+ var preset = ds_map_create();
+ ds_map_add_map(preset, "instructions", instructions);
+ ds_map_set(preset, "name", name);
+ var size = ds_map_size(global.presets);
+ ds_map_add_map(global.presets, string(size), preset);
+ save_split_presets();
+}
+
+function delete_split_preset(index)
+{
+ var size = ds_map_size(global.presets);
+ if (index < size)
+ {
+ ds_map_delete(global.presets, string(index));
+ for (var i = index + 1; i < size; i++)
+ {
+ ds_map_add_map(global.presets, string(i - 1), ds_map_read(global.presets, string(i)));
+ ds_map_delete(global.presets, string(i));
+ }
+ }
+ save_split_presets();
+}
+
+function set_current_preset(index)
+{
+ update_config_value(index, "timer_current_preset");
+}
+
+function get_current_preset()
+{
+ return read_config_value("timer_current_preset");
+}
+
+/* Get instruction name, regardless of being room or special */
+function get_instruction_name(instruction)
+{
+ name = undefined;
+ // all available chapters
+ for (var i = 1; i < 3; i++)
+ {
+ name = get_descriptive_room_name(i, instruction);
+ if (name != undefined)
+ {
+ break;
+ }
+ }
+ if (name == undefined)
+ {
+ name = get_special_instruction_name(instruction);
+ }
+ return name;
+}
+
+function get_chapter_rooms(chapter)
+{
+ if (chapter == 1)
+ {
+ return create_array(
+ "PLACE_CONTACT_ch1",
+ "room_krisroom_ch1",
+ "room_dark1_ch1",
+ "room_dark1a_ch1",
+ "room_castle_outskirts_ch1",
+ "room_field_start_ch1",
+ "room_field_puzzle1_ch1",
+ "room_field_shop1_ch1",
+ "room_field_checkers4_ch1",
+ "room_forest_savepoint1_ch1",
+ "room_forest_afterthrash2_ch1",
+ "room_cc_prisonlancer_ch1",
+ "room_krishallway_ch1"
+ );
+ }
+ else if (chapter == 2)
+ {
+ return create_array(
+ "room_dw_cyber_intro_1",
+ "room_dw_city_intro",
+ "room_dw_city_traffic_4",
+ "room_dw_mansion_krisroom",
+ "room_dw_mansion_fire_paintings",
+ "room_dw_mansion_acid_tunnel",
+ "room_dw_mansion_acid_tunnel_exit",
+ "room_dw_mansion_top",
+ "room_dw_mansion_top_post",
+ "room_torhouse"
+ );
+ }
+}
+
+function get_battles()
+{
+ return create_array(
+ "obj_king_boss_ch1"
+ );
+}
+
+function get_descriptive_room_name(chapter, roomname)
+{
+ if (chapter == 1)
+ {
+ switch (roomname)
+ {
+ case "PLACE_CONTACT_ch1": return "Start Chapter 1";
+ case "room_krisroom_ch1": return "Chapter 1 - Kris' Room";
+ case "room_dark1_ch1": return "Chapter 1 Dark World - First Room";
+ case "room_dark1a_ch1": return "Chapter 1 Dark World - First Savepoint";
+ case "room_castle_outskirts_ch1": return "Chapter 1 - Get up after cliff";
+ case "room_field_start_ch1": return "Field - Great Door";
+ case "room_field_puzzle1_ch1": return "Field - First Puzzle";
+ case "room_field_shop1_ch1": return "Field - Outside Shop";
+ case "room_field_checkers4_ch1": return "Checkerboard - First Room";
+ case "room_forest_savepoint1_ch1": return "Forest - Entrance";
+ case "room_forest_afterthrash2_ch1": return "Forest - After Susie/Lancer";
+ case "room_cc_prisonlancer_ch1": return "Castle - Cell Hallway";
+ case "room_krishallway_ch1": return "Chapter 1 - Kris' Hallway";
+ }
+ }
+ else if (chapter == 2)
+ {
+ switch (roomname)
+ {
+ case "room_dw_cyber_intro_1":
+ return "Cyber Field - First Room";
+ case "room_dw_city_intro":
+ return "Cyber City - Garbage Dump";
+ case "room_dw_city_traffic_4":
+ return "Cyber City - Traffic After Berdly";
+ case "room_dw_mansion_krisroom":
+ return "Queen's Mansion - Kris's Room";
+ case "room_dw_mansion_fire_paintings":
+ return "Queen's Mansion - Fire Paintings Room";
+ case "room_dw_mansion_acid_tunnel":
+ return "Queen's Mansion - Acid Tunnel Entrance";
+ case "room_dw_mansion_acid_tunnel_exit":
+ return "Queen's Mansion - Acid Tunnel Exit";
+ case "room_dw_mansion_top":
+ return "Queen's Mansion - Giga Queen Room (before fight)";
+ case "room_dw_mansion_top_post":
+ return "Queen's Mansion - Giga Queen Room (after fight)";
+ case "room_torhouse":
+ return "Chapter 2 - Kris' House - Kitchen";
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/mod/all_chapters/boss_practice/boss_practice.gml b/src/mod/all_chapters/boss_practice/boss_practice.gml
index caea951..264e756 100644
--- a/src/mod/all_chapters/boss_practice/boss_practice.gml
+++ b/src/mod/all_chapters/boss_practice/boss_practice.gml
@@ -20,6 +20,7 @@ function start_boss_practice()
{
instance_create(0, 0, obj_boss_practice)
}
+
// object_index from the calling object
obj_boss_practice.boss_obj = object_index
@@ -125,4 +126,43 @@ function reset_graze_condition()
global.tension = 0
global.inv = -1
}
+}
+
+function toggle_boss_practice(on)
+{
+ if (on)
+ {
+ global.bossPractice = true
+ global.bossTurn = 0
+ make_player_unkillable();
+ }
+ else
+ {
+ global.bossPractice = false
+ reset_defense_stats();
+ }
+}
+
+function make_player_unkillable()
+{
+ // making the player unkillable
+ // to-do: This is not a great way to do it, make the bullets themselves not do any damage instead!
+ for (i = 0; i < 3; i++)
+ {
+ global.battledf[i] = 999
+ }
+}
+
+function reset_defense_stats()
+{
+ // manually give the proper DF values back
+ // iterate chars
+ for (var i = 0; i < 3; i++)
+ {
+ global.battledf[i] =
+ global.df[global.char[i]] +
+ global.itemdf[global.char[i]][0] +
+ global.itemdf[global.char[i]][1] +
+ global.itemdf[global.char[i]][2]
+ }
}
\ No newline at end of file
diff --git a/src/mod/all_chapters/boss_practice/obj_battlecontroller_DUPE_Create_0.gml b/src/mod/all_chapters/boss_practice/obj_battlecontroller_DUPE_Create_0.gml
new file mode 100644
index 0000000..a7c061d
--- /dev/null
+++ b/src/mod/all_chapters/boss_practice/obj_battlecontroller_DUPE_Create_0.gml
@@ -0,0 +1,8 @@
+/// PATCH
+
+/// APPEND
+if (global.bossPractice)
+{
+ make_player_unkillable();
+}
+/// END
\ No newline at end of file
diff --git a/src/mod/all_chapters/boss_practice/obj_boss_practice_Step_0.gml b/src/mod/all_chapters/boss_practice/obj_boss_practice_Step_0.gml
index ba42bd0..e406ca3 100644
--- a/src/mod/all_chapters/boss_practice/obj_boss_practice_Step_0.gml
+++ b/src/mod/all_chapters/boss_practice/obj_boss_practice_Step_0.gml
@@ -6,46 +6,15 @@ if (boss_obj != 0 && !i_ex(boss_obj))
instance_destroy()
}
-// toggle practice mode
-if pressed_active_feature_key(#KEYBINDING.toggle_boss, "boss-practice")
-{
- if (!global.bossPractice)
- {
- global.bossPractice = true
- global.bossTurn = 0
- // making the player unkillable
- for (i = 0; i < 3; i++)
- {
- global.battledf[i] = 999
- }
- show_temp_message("Boss attack practice mode enabled")
- }
- else
- {
- global.bossPractice = 0
- // manually give the proper DF values back
- // iterate chars
- for (var i = 0; i < 3; i++)
- {
- global.battledf[i] =
- global.df[global.char[i]] +
- global.itemdf[global.char[i]][0] +
- global.itemdf[global.char[i]][1] +
- global.itemdf[global.char[i]][2]
- }
- show_temp_message("Boss attack practice mode disabled")
- }
-}
-
if (global.bossPractice)
{
// changing the boss turn
var increment = 0
- if keyboard_check_pressed(get_bound_key(#KEYBINDING.next_boss_attack))
+ if pressed_other_keybind("next_boss_attack")
{
increment = 1
}
- else if keyboard_check_pressed(get_bound_key(#KEYBINDING.previous_boss_attack))
+ else if pressed_other_keybind("previous_boss_attack")
{
increment = -1
}
diff --git a/src/mod/all_chapters/boundary_boxes/boundary_boxes.gml b/src/mod/all_chapters/boundary_boxes/boundary_boxes.gml
index 8b328a5..a4a58e1 100644
--- a/src/mod/all_chapters/boundary_boxes/boundary_boxes.gml
+++ b/src/mod/all_chapters/boundary_boxes/boundary_boxes.gml
@@ -5,10 +5,14 @@ Toggle boundary boxes visibility
*/
function toggle_boundary_boxes()
{
- if pressed_active_feature_key(#KEYBINDING.toggle_hitboxes, "boundary-box")
+ if pressed_active_debug_keybind("hitboxes")
{
- global.bboxVisible = wrap_around(global.bboxVisible + 1, 0, #BOUNDARY_BOX_STATE.#length - 1)
- if (global.bboxVisible == #BOUNDARY_BOX_STATE.none)
+ global.bboxVisible = wrap_around(global.bboxVisible + 1, 0, 2);
+
+ // 0: none
+ // 1: doors
+ // 2: doors and walls
+ if (global.bboxVisible == 0)
{
update_doors_visibility(false)
update_walls_visibility(false)
@@ -18,7 +22,7 @@ function toggle_boundary_boxes()
{
update_doors_visibility(true)
show_temp_message("visible: doors")
- if (global.bboxVisible == #BOUNDARY_BOX_STATE.doors_and_walls)
+ if (global.bboxVisible == 2)
{
update_walls_visibility(true)
show_temp_message("visible: doors and walls")
diff --git a/src/mod/all_chapters/config/config.gml b/src/mod/all_chapters/config/config.gml
new file mode 100644
index 0000000..ea08762
--- /dev/null
+++ b/src/mod/all_chapters/config/config.gml
@@ -0,0 +1,126 @@
+/// FUNCTIONS
+
+function init_config()
+{
+ global.mod_dir = "keucher_mod_v5";
+ global.config_path = global.mod_dir + "/config.json";
+ var first_time = !directory_exists(working_directory + global.mod_dir);
+ if (first_time)
+ {
+ show_message("Welcome to Keucher Mod!
+
+This mod contains many features to speedrun the game. You will need some time learn all the features useful to you, but as a starter, you should know that pressing the mouse's \"Right Button\" will open the game menu. There, you can look at all the features, learn what they do, enable the ones you want or not. You can also look at the value for all the keybinds, and reassign them as you wish.
+
+Happy running!");
+ directory_create(global.mod_dir);
+ var config = create_json_with_pairs();
+ save_json(global.config_path, config);
+ }
+
+ global.config = scr_84_load_map_json(global.config_path);
+ global.debug = read_config_with_default(true, "debug");
+ init_debug_keybinds();
+ init_options();
+ init_rng_options();
+ init_other_keybinds();
+ init_timer_options();
+ init_split_presets();
+ init_ui_colors();
+
+ // should be `0` if crit practice is off, and `1` if it's on
+ global.ambyu_practice = 0;
+
+ // should be `1` if boss practice is on, `0` otherwise
+ global.bossPractice = 0;
+
+ // current turn being practiced in boss practice
+ global.bossTurn = 0;
+
+ // text for the current boss practice turn
+ global.bossText = "";
+
+ // No idea wtf these are for, somehow related to choosing Berdly and Starwalker with H
+ // TO-DO: Move this unrelated initialization and ask Keucher wtf this is
+ global.krerdlyMode = 0
+ global.theOriginal = 0
+
+ // Related to viewing hitboxes
+ // TO-DO: Move unrelated hitbox variable initialization
+ global.bboxVisible = 0
+
+ // related to savestates. Move out of this file
+ global.currentSlotSelected = 0
+
+ // unsure exactly what, savestate related
+ slotWasSelected = -1
+
+ global.rurus_random = 1
+ global.mash_practice_mode = 0
+ global.tadytext_mode = 0
+}
+
+/*
+Args: value, ...path
+
+eg. update_config_value(1, "key", "key2")
+*/
+function update_config_value()
+{
+ if (argument_count < 2)
+ {
+ return undefined;
+ }
+
+ var value = argument0;
+ var cur = global.config;
+ var i = 1;
+ while(i < argument_count - 1)
+ {
+ cur = read_json_value(cur, argument[i]);
+ i++;
+ }
+ var last_key = argument[i];
+ ds_map_set(cur, last_key, value);
+ save_json(global.config_path, global.config);
+}
+
+/* Args: ...path */
+function read_config_value()
+{
+ var cur = global.config;
+ for (var i = 0; i < argument_count - 1; i++)
+ {
+ cur = read_json_value(cur, argument[i]);
+ if (is_undefined(cur))
+ {
+ return undefined;
+ }
+ }
+ return read_json_value(cur, argument[argument_count - 1]);
+}
+
+function read_config_with_default()
+{
+ var cur = global.config;
+ for (var i = 1; i < argument_count - 1; i++)
+ {
+ var prev = cur;
+ cur = read_json_value(cur, argument[i]);
+ if (is_undefined(cur))
+ {
+ ds_map_set(prev, argument[i], ds_map_create());
+ cur = read_config_value(prev, argument[i]);
+ }
+ }
+ var value = read_json_value(cur, argument[argument_count - 1]);
+ if is_undefined(value)
+ {
+ ds_map_set(cur, argument[argument_count - 1], argument0);
+ save_json(global.config_path, global.config);
+ return argument0;
+ }
+ else
+ {
+ return value;
+ }
+}
\ No newline at end of file
diff --git a/src/mod/all_chapters/config/debug/gml_GlobalScript_scr_gamestart.gml b/src/mod/all_chapters/config/debug/gml_GlobalScript_scr_gamestart.gml
new file mode 100644
index 0000000..36015bb
--- /dev/null
+++ b/src/mod/all_chapters/config/debug/gml_GlobalScript_scr_gamestart.gml
@@ -0,0 +1,11 @@
+/// PATCH
+
+// this variable is initialized by the mod instead
+/// REPLACE
+#if DEMO
+global.debug = 0
+#elsif SURVEY_PROGRAM
+global.debug = false
+#endif
+/// CODE
+/// END
\ No newline at end of file
diff --git a/src/mod/all_chapters/config/debug_keybinds/debug_keybinds.gml b/src/mod/all_chapters/config/debug_keybinds/debug_keybinds.gml
new file mode 100644
index 0000000..ee88ae9
--- /dev/null
+++ b/src/mod/all_chapters/config/debug_keybinds/debug_keybinds.gml
@@ -0,0 +1,237 @@
+/// FUNCTIONS
+
+/* List of all debug keybind names */
+function get_debug_keybinds()
+{
+ return create_array(
+ "save_menu",
+ "load_file",
+ "restart_room",
+ "store_savestate",
+ "load_savestate",
+ "speedup",
+ "slowdown",
+ "gif",
+ "next_room",
+ "previous_room",
+ "heal_party",
+ "instant_win",
+ "tp_toggle",
+ "stop_sound",
+ "reset_tempflags",
+ "make_visible",
+ "srn_action",
+ "noclip",
+ "screenshot",
+ "hitboxes"
+ );
+}
+
+/* Returns the default key for a debug keybind */
+function get_debug_keybind_default(name)
+{
+ switch (name)
+ {
+ case "save_menu": return ord("S");
+ case "load_file": return ord("L");
+ case "restart_room": return ord("R");
+ case "store_savestate": return ord("Q");
+ case "load_savestate": return ord("E");
+ case "speedup": return ord("À");
+ case "slowdown": return ord("-");
+ case "gif": return ord("G");
+ case "next_room": return vk_insert;
+ case "previous_room": return vk_delete;
+ case "heal_party": return vk_f2;
+ case "instant_win": return vk_f5;
+ case "tp_toggle": return vk_f3;
+ case "stop_sound": return vk_f11;
+ case "reset_tempflags": return vk_f12;
+ case "make_visible": return ord("I");
+ case "srn_action": return ord("J");
+ case "noclip": return ord("K");
+ case "screenshot": return vk_f10;
+ case "hitboxes": return ord("V");
+ default:
+ show_message("Error occured: could not find keybind named \"" + name + "\"");
+ e += "crash";
+ }
+}
+
+function get_debug_keybind_descriptive_name(name)
+{
+ switch (name)
+ {
+ case "save_menu": return "Open Save Menu";
+ case "load_file": return "Load Save File";
+ case "restart_room": return "Restart Room";
+ case "store_savestate": return "Store Savestate";
+ case "load_savestate": return "Load Savestate";
+ case "speedup": return "Speedup";
+ case "slowdown": return "Slowdown";
+ case "gif": return "Record GIF";
+ case "next_room": return "Warp to Next Room";
+ case "previous_room": return "Warp to Previous Room";
+ case "heal_party": return "Heal Party in Battle";
+ case "instant_win": return "Instant Win Battle";
+ case "tp_toggle": return "Set TP to max/min";
+ case "stop_sound": return "Stop All Sounds";
+ case "reset_tempflags": return "Reset Tempflags";
+ case "make_visible": return "Make Kris Visible";
+ case "srn_action": return "Toggle S/R/N-Act";
+ case "noclip": return "Toggle Noclip";
+ case "screenshot": return "Take Screenshot";
+ case "hitboxes": return "Show Hitboxes";
+ default:
+ show_message("Error occured: could not find keybind named \"" + name + "\"");
+ e += "crash";
+ }
+}
+
+function get_debug_keybind_description(name)
+{
+ switch (name)
+ {
+ case "save_menu":
+ return "When pressed, will open the menu where you can save\nIt also gives you movement";
+ case "load_file":
+ return "When pressed, your currently selected file will be load\nIt will not work if you don't have any file saved to this slot";
+ case "restart_room":
+ return "When pressed, the room will be restart";
+ case "store_savestate":
+ return "When pressed, you will save the current state as a savestate\nYou may change the savestate slot by pressing the numbers";
+ case "load_savestate":
+ return "When pressed, you will load the current selected savestate slot\nSavestates don't always work! The game may break, specially in battles";
+ case "speedup":
+ return "When pressed, the game will speed up by 5x of normal speed";
+ case "slowdown":
+ return "When pressed, the game will be slowed down by 3x of normal speed";
+ case "gif":
+ return "When pressed, a GIF will start recording, or it will stop recording the current GIF";
+ case "next_room":
+ return "When pressed, you will warp to the next room in the game's order";
+ case "previous_room":
+ return "When pressed, you will warp to the previous room in the game's order";
+ case "heal_party":
+ return "When pressed during battle, your party will be healed";
+ case "instant_win":
+ return "When pressed during battle, the battle ends instantly";
+ case "tp_toggle":
+ return "When pressed, TP will go to 100% TP, or if at maximum, it will go to 0% TP";
+ case "stop_sound":
+ return "When pressed, all sounds will be canceled";
+ case "reset_tempflags":
+ return "When pressed, temporary flags will be reset\nYou will need to restart the room you are in if it uses temp flags";
+ case "make_visible":
+ return "When pressed, Kris will become visible if they are invisible";
+ case "srn_action":
+ return "When pressed, S/R/N-Act will be enabled/disabled";
+ case "noclip":
+ return "When pressed, no clip will be enabled/disabled";
+ case "screenshot":
+ return "When pressed, you can take a screenshot (Chapter 1 only)";
+ case "hitboxes":
+ return "When pressed, you can see some hitboxes in the room\nPress twice to see even more hitboxes";
+ default:
+ show_message("Error occured: could not find keybind named \"" + name + "\"");
+ e += "crash";
+ }
+}
+
+function set_all_debug_keybinds_default()
+{
+ var keybinds = get_debug_keybinds();
+ var size = array_length(keybinds);
+
+ for (var i = 0; i < size; i++)
+ {
+ set_debug_keybind_key(keybinds[i], get_debug_keybind_default(keybinds[i]));
+ }
+}
+
+/* Initializes all keybinds in the config file */
+function init_debug_keybinds()
+{
+ global.debug_keybinds_on = true;
+
+ var keybinds = get_debug_keybinds();
+ var size = array_length(keybinds);
+ for (var i = 0; i < size; i++)
+ {
+ read_config_with_default(get_debug_keybind_default(keybinds[i]), "debug_keybind_" + keybinds[i]);
+ read_config_with_default("debug", "debug_keybind_state_" + keybinds[i]);
+ }
+}
+
+// returns the internal value, not beautified
+function get_debug_keybind_key(name)
+{
+ return read_config_value("debug_keybind_" + name);
+}
+
+function get_debug_keybind_state(name)
+{
+ return read_config_value("debug_keybind_state_" + name);
+}
+
+function set_debug_keybind_state(name, value)
+{
+ update_config_value(value, "debug_keybind_state_" + name);
+}
+
+function set_debug_keybind_key(name, value)
+{
+ update_config_value(value, "debug_keybind_" + name);
+}
+
+function get_debug_keybind_from_index(index)
+{
+ var keybinds = get_debug_keybinds();
+ return keybinds[index];
+}
+
+/* Checkes if a debug keybind was pressed and is active */
+function pressed_active_debug_keybind(name)
+{
+ if (!global.debug_keybinds_on)
+ {
+ return false;
+ }
+ var key = get_debug_keybind_key(name);
+ if (!keyboard_check_pressed(key))
+ {
+ return false;
+ }
+
+ var state = get_debug_keybind_state(name);
+ if (state == "debug")
+ {
+ return global.debug;
+ }
+ return state;
+}
+
+function get_default_keybinds_using_key(key)
+{
+ var keybinds = get_debug_keybinds();
+ var size = array_length(keybinds);
+ var keybinds_using;
+ var found = 0;
+ for (var i = 0; i < size; i++)
+ {
+ var name = keybinds[i];
+ var keybind_key = get_debug_keybind_key(name);
+ if (key == keybind_key)
+ {
+ keybinds_using[found] = name;
+ found++;
+ }
+ }
+
+ if (found == 0)
+ {
+ return create_array();
+ }
+
+ return keybinds_using;
+}
\ No newline at end of file
diff --git a/src/mod/all_chapters/config/options/options.gml b/src/mod/all_chapters/config/options/options.gml
new file mode 100644
index 0000000..51b48b2
--- /dev/null
+++ b/src/mod/all_chapters/config/options/options.gml
@@ -0,0 +1,107 @@
+/// FUNCTIONS
+
+/* List of all option names */
+function get_options()
+{
+ return create_array(
+ "mercy_percentage_ch1",
+ "hp_display",
+ "doorwarp_indicator",
+ "wakeup_mash_display",
+ "position_save_caching"
+ );
+}
+
+function get_option_default(name)
+{
+ switch (name)
+ {
+ case "mercy_percentage_ch1":
+ return "debug";
+ case "hp_display":
+ return "debug";
+ case "doorwarp_indicator":
+ return "debug";
+ case "wakeup_mash_display":
+ return "debug";
+ case "position_save_caching":
+ return false;
+ default:
+ show_message("Unknown option name: " + name);
+ e += "crash";
+ }
+}
+
+function get_option_button_text(name)
+{
+ switch (name)
+ {
+ case "mercy_percentage_ch1":
+ return "Mercy Percentages in Chapter 1";
+ case "hp_display":
+ return "Display HP number for enemies";
+ case "doorwarp_indicator":
+ return "Display doorwarp indicator";
+ case "wakeup_mash_display":
+ return "Display wake up mash stats";
+ case "position_save_caching":
+ return "Use position caching for saves";
+ default:
+ show_message("Unknown option name: " + name);
+ e += "crash";
+ }
+}
+
+function get_option_button_desc(name)
+{
+ switch (name)
+ {
+ case "mercy_percentage_ch1":
+ return "In Chapter 1, mercy percentages don't normally show\nWith this, they will display";
+ case "hp_display":
+ return "In battle, the exact current and total HP from enemies will display";
+ case "doorwarp_indicator":
+ return "If in the doorwarp room, in the top left corner a red square will be present\nOnce the square is green, it means doorwarp is possible";
+ case "wakeup_mash_display":
+ return "In the sequence at the start of Chapter 1 where you mash the arrow keys\nDisplay stats for how well you are doing";
+ case "position_save_caching":
+ return "When this is enabled, saving and loading will remember what position you saved in\nOnly works during the current session, will sometimes be out of bounds";
+ default:
+ show_message("Unknown option name: " + name);
+ e += "crash";
+ }
+}
+
+/* Initializes all options in the config file */
+function init_options()
+{
+ var options = get_options();
+ var size = array_length(options);
+ for (var i = 0; i < size; i++)
+ {
+ var name = options[i];
+ var default_value = get_option_default(name);
+ read_config_with_default(default_value, "option_" + name);
+ }
+}
+
+function set_option_value(name, value)
+{
+ update_config_value(value, "option_" + name);
+}
+
+function read_option_value(name)
+{
+ return read_config_value("option_" + name);
+}
+
+/* Checkes if an option is active */
+function is_option_active(name)
+{
+ var state = read_option_value(name);
+ if (state == "debug")
+ {
+ return global.debug;
+ }
+ return state;
+}
\ No newline at end of file
diff --git a/src/mod/all_chapters/config/other_keybinds/other_keybinds.gml b/src/mod/all_chapters/config/other_keybinds/other_keybinds.gml
new file mode 100644
index 0000000..368e456
--- /dev/null
+++ b/src/mod/all_chapters/config/other_keybinds/other_keybinds.gml
@@ -0,0 +1,86 @@
+/// FUNCTIONS
+
+/* List of all debug keybind names */
+function get_other_keybinds()
+{
+ return create_array(
+ "pattern_mode",
+ "next_crit_pattern",
+ "previous_crit_pattern",
+ "next_house_pattern",
+ "previous_house_pattern",
+ "next_boss_attack",
+ "previous_boss_attack",
+ "reset_mash_stat",
+ "reset_timer"
+ );
+}
+
+/* Returns the default key for a misc keybind */
+function get_other_keybind_default(name)
+{
+ switch (name)
+ {
+ case "pattern_mode": return vk_tab;
+ case "next_crit_pattern": return vk_pageup;
+ case "previous_crit_pattern": return vk_pagedown;
+ case "next_house_pattern": return vk_pageup;
+ case "previous_house_pattern": return vk_pagedown;
+ case "next_boss_attack": return vk_pageup;
+ case "previous_boss_attack": return vk_pagedown;
+ case "reset_mash_stat": return vk_tab;
+ case "reset_timer": return vk_f9;
+ default:
+ show_message("Error occured: could not find misc keybind named \"" + name + "\"");
+ e += "crash";
+ }
+}
+
+function get_other_keybind_descriptive_name(name)
+{
+ switch (name)
+ {
+ case "pattern_mode": return "Change to crit pattern mode";
+ case "next_crit_pattern": return "Change to next crit pattern";
+ case "previous_crit_pattern": return "Change to previous crit pattern";
+ case "next_house_pattern": return "Change to next house pattern";
+ case "previous_house_pattern": return "Change to previous house pattern";
+ case "next_boss_attack": return "Change to next boss attack";
+ case "previous_boss_attack": return "Change to previous boss attack";
+ case "reset_mash_stat": return "Reset Chapter 1 Mashing stats";
+ case "reset_timer": return "Reset Timer";
+ default:
+ show_message("Error occured: could not find misc keybind named \"" + name + "\"");
+ e += "crash";
+ }
+}
+
+/* Initializes all keybinds in the config file */
+function init_other_keybinds()
+{
+ var keybinds = get_other_keybinds();
+ var size = array_length(keybinds);
+ for (var i = 0; i < size; i++)
+ {
+ read_config_with_default(get_other_keybind_default(keybinds[i]), "other_keybind_" + keybinds[i]);
+ }
+}
+
+/* Checkes if a debug keybind was pressed and is active */
+function pressed_other_keybind(name)
+{
+ var key = read_config_value("other_keybind_" + name);
+ return keyboard_check_pressed(key);
+}
+
+function reset_all_other_keybinds_default()
+{
+ var keybinds = get_other_keybinds();
+ var size = array_length(keybinds);
+
+ for (var i = 0; i < size; i++)
+ {
+ var name = keybinds[i];
+ update_config_value(get_other_keybind_default(name), "other_keybind_" + name);
+ }
+}
\ No newline at end of file
diff --git a/src/mod/all_chapters/config/rng/rng.gml b/src/mod/all_chapters/config/rng/rng.gml
new file mode 100644
index 0000000..128e111
--- /dev/null
+++ b/src/mod/all_chapters/config/rng/rng.gml
@@ -0,0 +1,47 @@
+/// FUNCTIONS
+
+/* List of all rng option names */
+function get_rng_options()
+{
+ return create_array(
+ "susie_death",
+ "spelling_bee"
+ );
+}
+
+/* Returns the options for a given rng option, the first in the array is the default option */
+function get_rng_option_options(name)
+{
+ switch (name)
+ {
+ case "susie_death": return create_array(false, true);
+ case "spelling_bee": return create_array(false, true);
+ default:
+ show_message("Error occured: could not find rng option named \"" + name + "\"");
+ e += "crash";
+ }
+}
+
+
+/* Initializes all rng options in the config file */
+function init_rng_options()
+{
+ var options = get_rng_options();
+ var size = array_length(options);
+ for (var i = 0; i < size; i++)
+ {
+ var available_options = get_rng_option_options(options[i])
+ var default_option = available_options[0];
+ read_config_with_default(default_option, "rng_" + options[i]);
+ }
+}
+
+function read_rng_value(option)
+{
+ return read_config_value("rng_" + option);
+}
+
+function update_rng_value(option, value)
+{
+ update_config_value(value, "rng_" + option);
+}
\ No newline at end of file
diff --git a/src/mod/all_chapters/crit_practice/crit_practice.gml b/src/mod/all_chapters/crit_practice/crit_practice.gml
index 23e9f90..36fec8e 100644
--- a/src/mod/all_chapters/crit_practice/crit_practice.gml
+++ b/src/mod/all_chapters/crit_practice/crit_practice.gml
@@ -86,4 +86,23 @@ function update_end_turn_crit_stats()
global.maxdamage = 0
global.attackse++
}
+}
+
+function toggle_crit_practice(on)
+{
+ if (on)
+ {
+ global.ambyu_practice = true
+ // make enemy unkillable, if we are turning it on inside battle
+ global.monsterhp[0] = 40000000
+ }
+ else
+ {
+ global.ambyu_practice = false
+ }
+}
+
+function toggle_pattern_mode(on)
+{
+ global.random_pattern = on;
}
\ No newline at end of file
diff --git a/src/mod/all_chapters/crit_practice/obj_crit_practice_Step_0.gml b/src/mod/all_chapters/crit_practice/obj_crit_practice_Step_0.gml
index fa14c38..44caceb 100644
--- a/src/mod/all_chapters/crit_practice/obj_crit_practice_Step_0.gml
+++ b/src/mod/all_chapters/crit_practice/obj_crit_practice_Step_0.gml
@@ -12,31 +12,10 @@ if (!i_ex(obj_placeholderenemy))
instance_destroy()
}
-// toggle crit practice
-if pressed_active_feature_key(#KEYBINDING.toggle_crit_mode, "crit-practice")
-{
- if (!global.ambyu_practice)
- {
- global.ambyu_practice = true
- // make enemy unkillable
- global.monsterhp[0] = 40000000
- }
- else
- {
- global.ambyu_practice = false
- }
-}
-
-// toggle random pattern mode
-if keyboard_check_pressed(get_bound_key(#KEYBINDING.toggle_pattern_mode))
-{
- global.random_pattern = global.random_pattern ? false : true
-}
-
// changing current selected pattern
-if (keyboard_check_pressed(get_bound_key(#KEYBINDING.next_crit_pattern)) || keyboard_check_pressed(get_bound_key(#KEYBINDING.previous_crit_pattern)))
+if (pressed_other_keybind("next_crit_pattern") || pressed_other_keybind("previous_crit_pattern"))
{
- if keyboard_check_pressed(get_bound_key(#KEYBINDING.previous_crit_pattern))
+ if pressed_other_keybind("previous_crit_pattern")
{
global.crit_pattern--
}
diff --git a/src/mod/all_chapters/enemy_health/obj_battlecontroller_Draw_0.gml b/src/mod/all_chapters/enemy_health/obj_battlecontroller_Draw_0.gml
index fd87049..28b7f49 100644
--- a/src/mod/all_chapters/enemy_health/obj_battlecontroller_Draw_0.gml
+++ b/src/mod/all_chapters/enemy_health/obj_battlecontroller_Draw_0.gml
@@ -4,7 +4,7 @@
/// AFTER
draw_text_transformed((xx + 424), (yy + 380 + i * 30), ((string(ceil(global.monsterhp[i] / global.monstermaxhp[i] * 100))) + "%"), 1, 0.5, 0)
/// CODE
-if (is_feature_active("enemy-hp"))
+if (is_option_active("hp_display"))
{
draw_exact_health(i)
}
diff --git a/src/mod/all_chapters/enemy_health/obj_battlecontroller_SP_Draw_0.gml b/src/mod/all_chapters/enemy_health/obj_battlecontroller_SP_Draw_0.gml
index 949a979..a9ad2a1 100644
--- a/src/mod/all_chapters/enemy_health/obj_battlecontroller_SP_Draw_0.gml
+++ b/src/mod/all_chapters/enemy_health/obj_battlecontroller_SP_Draw_0.gml
@@ -15,7 +15,7 @@ draw_rectangle
xx + 420, yy + 380 + i * 30,
xx + 420 + global.monsterhp[i] / global.monstermaxhp[i] * 80, yy + 380 + i * 30 + 15, false
)
-if (is_feature_active("enemy-hp"))
+if (is_option_active("hp_display"))
{
// Percentage just like in ch2
draw_set_color(c_white)
diff --git a/src/mod/all_chapters/gamemaker_savestates/gamemaker_savestates.gml b/src/mod/all_chapters/gamemaker_savestates/gamemaker_savestates.gml
index e299e92..8624a04 100644
--- a/src/mod/all_chapters/gamemaker_savestates/gamemaker_savestates.gml
+++ b/src/mod/all_chapters/gamemaker_savestates/gamemaker_savestates.gml
@@ -5,7 +5,7 @@ function savestate_load_check (chapter)
// check if savestate load or file load
var savestate
var _ssslot
- if pressed_active_feature_key(#KEYBINDING.load_savestate, "gamemaker-savestate")
+ if pressed_active_debug_keybind("load_savestate")
{
savestate = "ss_"
_ssslot = ""
@@ -25,7 +25,7 @@ function savestate_save_check(argument0)
var savestate
var _ssslot
// check if saving savestate or saving file
- if pressed_active_feature_key(#KEYBINDING.store_savestate, "gamemaker-savestate")
+ if pressed_active_debug_keybind("store_savestate")
{
save_global_variables()
savestate = "ss_"
diff --git a/src/mod/all_chapters/gamemaker_savestates/obj_gamemaker_savestate_handler_Draw_64.gml b/src/mod/all_chapters/gamemaker_savestates/obj_gamemaker_savestate_handler_Draw_64.gml
index 84d6fd0..0d3c261 100644
--- a/src/mod/all_chapters/gamemaker_savestates/obj_gamemaker_savestate_handler_Draw_64.gml
+++ b/src/mod/all_chapters/gamemaker_savestates/obj_gamemaker_savestate_handler_Draw_64.gml
@@ -6,24 +6,24 @@
// below is savestate related, move to a separate script
draw_set_color(c_white)
slotWasSelected = -1
-for (var i = ord("0"); i < 58; i++)
+if (global.debug_keybinds_on)
{
- if keyboard_check_pressed(i)
+ for (var i = ord("0"); i < 58; i++)
{
- if (!keyboard_check(get_bound_key(#KEYBINDING.plot_warp)) && !keyboard_check(get_bound_key(#KEYBINDING.snowgrave_plot)))
+ if keyboard_check_pressed(i)
{
slotWasSelected = i - 48
}
}
-}
-if (slotWasSelected != -1)
-{
- global.currentSlotSelected = slotWasSelected
- show_temp_message("File " + string(global.filechoice) + ", slot " + string(global.currentSlotSelected) + " selected")
+ if (slotWasSelected != -1)
+ {
+ global.currentSlotSelected = slotWasSelected
+ show_temp_message("File " + string(global.filechoice) + ", slot " + string(global.currentSlotSelected) + " selected")
+ }
}
// saving savestates
-if pressed_active_feature_key(#KEYBINDING.store_savestate, "gamemaker-savestate")
+if pressed_active_debug_keybind("store_savestate")
{
#if DEMO
if (global.chapter == 2)
@@ -45,7 +45,7 @@ if pressed_active_feature_key(#KEYBINDING.store_savestate, "gamemaker-savestate"
show_temp_message("File " + string(global.filechoice) + ", slot " + string(global.currentSlotSelected) + " saved")
}
// loading savestate
-if pressed_active_feature_key(#KEYBINDING.load_savestate, "gamemaker-savestate")
+if pressed_active_debug_keybind("load_savestate")
{
#if DEMO
if (global.chapter == 2)
diff --git a/src/mod/all_chapters/get_items/get_items.gml b/src/mod/all_chapters/get_items/get_items.gml
deleted file mode 100644
index 7810dd6..0000000
--- a/src/mod/all_chapters/get_items/get_items.gml
+++ /dev/null
@@ -1,250 +0,0 @@
-/// FUNCTIONS
-
-function get_items()
-{
- if pressed_active_feature_key(#KEYBINDING.get_item, "get-item")
- {
- if (global.flag[48] == 0)
- {
-#if DEMO
- if (global.chapter == 1)
- {
- scr_itemget_ch1(6)
- scr_armorget_ch1(4)
- scr_armorget_ch1(5)
- scr_armorget_ch1(7)
- scr_weaponget_ch1(5)
- scr_weaponget_ch1(6)
- scr_weaponget_ch1(7)
- scr_weaponget_ch1(9)
- }
- else
- {
- scr_itemget(27)
- scr_itemget(28)
- scr_itemget(29)
- scr_armorget(1)
- scr_armorget(1)
- scr_armorget(1)
- scr_armorget(1)
- scr_armorget(3)
- scr_armorget(5)
- scr_armorget(7)
- scr_armorget(14)
- scr_armorget(20)
- scr_armorget(20)
- scr_armorget(20)
- scr_armorget(20)
- scr_armorget(21)
- scr_armorget(22)
- scr_weaponget(5)
- scr_weaponget(6)
- scr_weaponget(7)
- scr_weaponget(9)
- scr_weaponget(11)
- scr_weaponget(13)
- scr_weaponget(16)
- scr_weaponget(17)
- scr_weaponget(19)
- scr_weaponget(21)
- scr_weaponget(22)
- }
-#endif
-#if SURVEY_PROGRAM
- scr_itemget(6)
- scr_armorget(4)
- scr_armorget(5)
- scr_armorget(7)
- scr_weaponget(5)
- scr_weaponget(6)
- scr_weaponget(7)
- scr_weaponget(9)
-#endif
- global.flag[48] = 1
- show_temp_message("items given")
- }
- else
- {
- var itemType = get_string("What type of item? (enter 'item', 'armor', 'weapon', 'key', or 'money')", "")
- if (itemType != "")
- {
- if (itemType == "money" || itemType == "item" || itemType == "armor" || itemType == "weapon" || itemType == "key")
- {
- var get_message = ""
- var type_name = itemType
- if (itemType == "money")
- {
- get_message = "How much money to add?"
- }
- else
- {
- if (itemType == "key")
- {
- type_name = "key item"
- }
- get_message = "What is the " + type_name + "'s ID?"
- }
-
- var user_input = get_integer(get_message, "")
-
- if (itemType == "money")
- {
- if is_real(user_input)
- {
- if (user_input > 0)
- {
- global.gold += user_input
- }
- else
- {
- show_message("Fine, I guess I WON'T give you any money >:(")
- }
- }
- else
- {
- show_message("That's not a number :')")
- }
- }
- else
- {
- max_id = 0
-#if DEMO
- if (global.chapter == 1)
- {
-#endif
- switch itemType
- {
- case "item":
- {
- max_id = 15
- break
- }
- case "armor":
- {
- max_id = 7
- break
- }
- case "weapon":
- {
- max_id = 10
- break
- }
- case "key":
- {
- max_id = 7
- break
- }
- }
-#if DEMO
- }
- else
- {
- switch itemType
- {
- case "item":
- {
- max_id = 33
- break
- }
- case "armor":
- {
- max_id = 22
- break
- }
- case "weapon":
- {
- max_id = 22
- break
- }
- case "key":
- {
- max_id = 15
- break
- }
- }
- }
- #endif
- if (user_input > 0)
- {
- if (user_input <= max_id || (user_input == 13 && itemType == "key" && global.chapter == 1))
- {
-#if DEMO
- if (global.chapter == 1)
- {
- switch itemType
- {
- case "item":
- {
- scr_itemget_ch1(user_input)
- break
- }
- case "armor":
- {
- scr_armorget_ch1(user_input)
- break
- }
- case "weapon":
- {
- scr_weaponget_ch1(user_input)
- break
- }
- case "key":
- {
- scr_keyitemget_ch1(user_input)
- break
- }
- }
- }
- else
- {
-#endif
- switch itemType
- {
- case "item":
- {
- scr_itemget(user_input)
- break
- }
- case "armor":
- {
- scr_armorget(user_input)
- break
- }
- case "weapon":
- {
- scr_weaponget(user_input)
- break
- }
- case "key":
- {
- scr_keyitemget(user_input)
- break
- }
- }
-#if DEMO
- }
-#endif
- }
- else
- {
- show_message("That's not a valid " + type_name + " :')")
- }
- }
- else
- {
- show_message("Fine, I guess I WON'T give you the " + type_name + " >:(")
- }
- }
- }
- else
- {
- show_message("That's not how you spell 'item', 'armor', 'weapon', 'key', or 'money' :')")
- }
- }
- else
- {
- show_message("Fine, I guess I WON'T give you anything then >:(")
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/mod/all_chapters/get_items/items.gml b/src/mod/all_chapters/get_items/items.gml
new file mode 100644
index 0000000..e0712d8
--- /dev/null
+++ b/src/mod/all_chapters/get_items/items.gml
@@ -0,0 +1,192 @@
+/// FUNCTIONS
+
+function get_weapon_ids()
+{
+ var ch = get_current_chapter();
+ if (ch == 1)
+ {
+ return get_range_array(1, 10);
+ }
+ else if (ch == 2)
+ {
+ return get_range_array(1, 22);
+ }
+
+ return create_array();
+}
+
+function get_weapon_name(weapon_id)
+{
+ switch (weapon_id)
+ {
+ case 1: return "Wood Blade";
+ case 2: return "Mane Ax";
+ case 3: return "Red Scarf";
+ case 4: return "Everybody Weapon";
+ case 5: return "Spookysword";
+ case 6: return "Brave Ax";
+ case 7: return "Devilsknife";
+ case 8: return "Trefoil";
+ case 9: return "Ragger";
+ case 10: return "Dainty Scarf";
+ case 11: return "Twisted Sword";
+ case 12: return "Snow Ring";
+ case 13: return "Thorn Ring";
+ case 14: return "Bounce Blade";
+ case 15: return "Cheer Scarf";
+ case 16: return "Mecha Saber";
+ case 17: return "Auto Axe";
+ case 18: return "Fiber Scarf";
+ case 19: return "Ragger2";
+ case 20: return "Broken Sword";
+ case 21: return "Puppet Scarf";
+ case 22: return "Freeze Ring";
+ }
+}
+
+function get_armor_ids()
+{
+ var ch = get_current_chapter();
+ if (ch == 1)
+ {
+ return get_range_array(1, 10);
+ }
+ else if (ch == 2)
+ {
+ return get_range_array(1, 22);
+ }
+
+ return create_array();
+}
+
+function get_armor_name(armor_id)
+{
+ switch (armor_id)
+ {
+ case 1: return "Amber Card";
+ case 2: return "Dice Brace";
+ case 3: return "Pink Ribbon";
+ case 4: return "White Ribbon";
+ case 5: return "Iron Shackle";
+ case 6: return "Mouse Token";
+ case 7: return "Jevilstail";
+ case 8: return "Silver Card";
+ case 9: return "Twin Ribbon";
+ case 10: return "Glow Wrist";
+ case 11: return "Chain Mail";
+ case 12: return "B.ShotBowtie";
+ case 13: return "SpikeBand";
+ case 14: return "Silver Watch";
+ case 15: return "Tension Bow";
+ case 16: return "Mannequin";
+ case 17: return "Dark Gold Band";
+ case 18: return "Sky Mantle";
+ case 19: return "Spike Shackle";
+ case 20: return "Frayed Bowtie";
+ case 21: return "Dealmaker";
+ case 22: return "Royal Pin";
+ }
+}
+
+function get_consumable_ids()
+{
+ var ch = get_current_chapter();
+ if (ch == 1)
+ {
+ return get_range_array(1, 15);
+ }
+ else if (ch == 2)
+ {
+ return get_range_array(1, 33);
+ }
+
+ return create_array();
+}
+
+function get_consumable_name(consumable_id)
+{
+ switch (consumable_id)
+ {
+ case 1: return "Dark Candy";
+ case 2: return "Revive Mint";
+ case 3: return "Glowshard";
+ case 4: return "Manual";
+ case 5: return "Broken Cake (Unused)";
+ case 6: return "Top Cake";
+ case 7: return "Spin Cake";
+ case 8: return "Darkburger";
+ case 9: return "Lancer Cookie";
+ case 10: return "Giga Salad";
+ case 11: return "Clubswich";
+ case 12: return "Hearts Donut";
+ case 13: return "Choco Diamond";
+ case 14: return "FavSandwich";
+ case 15: return "Rouxls Roux"
+ case 16: return "CD Bagel";
+ case 17: return "Mannequin (Unused)";
+ case 18: return "Kris Tea";
+ case 19: return "Noelle Tea";
+ case 20: return "Ralsei Tea";
+ case 21: return "Susie Tea";
+ case 22: return "DD-Burger";
+ case 23: return "Light Candy";
+ case 24: return "Butler Juice";
+ case 25: return "Spaghetti Code";
+ case 26: return "Java Cookie";
+ case 27: return "Tension Bit";
+ case 28: return "Tension Gem";
+ case 29: return "Tension Max";
+ case 30: return "Revive Dust";
+ case 31: return "Revive Brite";
+ case 32: return "S. POISON";
+ case 33: return "Dog Dollar";
+ }
+}
+
+function get_weapon_any_chapter(weapon_id)
+{
+#if DEMO
+ if (global.chapter == 1)
+ {
+ scr_weaponget_ch1(weapon_id);
+ }
+ else if (global.chapter == 2)
+ {
+ scr_weaponget(weapon_id);
+ }
+#elsif SURVEY_PROGRAM
+ scr_weaponget(weapon_id);
+#endif
+}
+
+function get_armor_any_chapter(armor_id)
+{
+#if DEMO
+ if (global.chapter == 1)
+ {
+ scr_armorget_ch1(armor_id);
+ }
+ else if (global.chapter == 2)
+ {
+ scr_armorget(armor_id);
+ }
+#elsif SURVEY_PROGRAM
+ scr_armorget(armor_id);
+#endif
+}
+
+function get_consumable_any_chapter(item_id)
+{
+#if DEMO
+ if (global.chapter == 1)
+ {
+ scr_itemget_ch1(item_id);
+ }
+ else if (global.chapter == 2)
+ {
+ scr_itemget(item_id);
+ }
+#elsif SURVEY_PROGRAM
+ scr_itemget(item_id);
+#endif
+}
\ No newline at end of file
diff --git a/src/mod/all_chapters/get_items/obj_darkcontroller_DUPE_Step_0.gml b/src/mod/all_chapters/get_items/obj_darkcontroller_DUPE_Step_0.gml
deleted file mode 100644
index 4a9a8b8..0000000
--- a/src/mod/all_chapters/get_items/obj_darkcontroller_DUPE_Step_0.gml
+++ /dev/null
@@ -1,5 +0,0 @@
-/// PATCH
-// entry point for getting all items/specific one
-/// APPEND
-get_items()
-/// END
\ No newline at end of file
diff --git a/src/mod/all_chapters/gif_recording/obj_time_Draw_77.gml b/src/mod/all_chapters/gif_recording/obj_time_Draw_77.gml
index 7450530..8b7aac1 100644
--- a/src/mod/all_chapters/gif_recording/obj_time_Draw_77.gml
+++ b/src/mod/all_chapters/gif_recording/obj_time_Draw_77.gml
@@ -1,21 +1,15 @@
/// PATCH .ignore ifndef DEMO
-/// REPLACE
-if scr_debug()
-/// CODE
-if is_feature_active("gif")
-/// END
-
/// REPLACE
if (keyboard_check_pressed(ord("G")) && (!keyboard_check(vk_control)) && gif_recording == 0)
/// CODE
-if (keyboard_check_pressed(get_bound_key(#KEYBINDING.gif)) && gif_recording == false)
+if (pressed_active_debug_keybind("gif") && gif_recording == false)
/// END
/// REPLACE
if keyboard_check_released(ord("G"))
/// CODE
-if keyboard_check_pressed(get_bound_key(#KEYBINDING.gif))
+if pressed_active_debug_keybind("gif")
/// END
/// REPLACE
diff --git a/src/mod/all_chapters/gif_recording/obj_time_ch1_Draw_64.gml b/src/mod/all_chapters/gif_recording/obj_time_ch1_Draw_64.gml
index 0960e35..8bee3d2 100644
--- a/src/mod/all_chapters/gif_recording/obj_time_ch1_Draw_64.gml
+++ b/src/mod/all_chapters/gif_recording/obj_time_ch1_Draw_64.gml
@@ -1,6 +1,6 @@
/// PATCH .ignore ifndef DEMO
/// PREPEND
-if (is_feature_active("gif") && gif_recording)
+if (gif_recording)
{
draw_set_color(c_red)
draw_set_font(fnt_main)
diff --git a/src/mod/all_chapters/gif_recording/obj_time_ch1_Draw_77.gml b/src/mod/all_chapters/gif_recording/obj_time_ch1_Draw_77.gml
index b960c41..3ea045d 100644
--- a/src/mod/all_chapters/gif_recording/obj_time_ch1_Draw_77.gml
+++ b/src/mod/all_chapters/gif_recording/obj_time_ch1_Draw_77.gml
@@ -4,30 +4,27 @@
// adding it to ch1
/// PREPEND
-if is_feature_active("gif")
+if (pressed_active_debug_keybind("gif") && gif_recording == false)
{
- if (keyboard_check_pressed(get_bound_key(#KEYBINDING.gif)) && gif_recording == false)
+ gif_recording = true
+ gif_timer = 0
+ gif_date = ((((((((((string(date_get_year(date_current_datetime())) + "_") + string(date_get_month(date_current_datetime()))) + "_") + string(date_get_day(date_current_datetime()))) + "_") + string(date_get_hour(date_current_datetime()))) + "_") + string(date_get_minute(date_current_datetime()))) + "_") + string(date_get_second(date_current_datetime())))
+}
+if gif_recording
+{
+ var gif_release = 0
+ if pressed_active_debug_keybind("gif")
+ gif_release = 1
+ if (gif_timer == 0)
+ gif_image = gif_open(640, 480)
+ else if (gif_timer < 1350 && gif_release == 0)
+ gif_add_surface(gif_image, application_surface, 3.3333333333333335)
+ else
{
- gif_recording = true
+ gif_save(gif_image, (("game_" + gif_date) + ".gif"))
gif_timer = 0
- gif_date = ((((((((((string(date_get_year(date_current_datetime())) + "_") + string(date_get_month(date_current_datetime()))) + "_") + string(date_get_day(date_current_datetime()))) + "_") + string(date_get_hour(date_current_datetime()))) + "_") + string(date_get_minute(date_current_datetime()))) + "_") + string(date_get_second(date_current_datetime())))
- }
- if gif_recording
- {
- var gif_release = 0
- if keyboard_check_pressed(get_bound_key(#KEYBINDING.gif))
- gif_release = 1
- if (gif_timer == 0)
- gif_image = gif_open(640, 480)
- else if (gif_timer < 1350 && gif_release == 0)
- gif_add_surface(gif_image, application_surface, 3.3333333333333335)
- else
- {
- gif_save(gif_image, (("game_" + gif_date) + ".gif"))
- gif_timer = 0
- gif_recording = false
- }
- gif_timer++
+ gif_recording = false
}
+ gif_timer++
}
/// END
\ No newline at end of file
diff --git a/src/mod/all_chapters/init/init.gml b/src/mod/all_chapters/init/init.gml
index 6ab276e..4bb8b3e 100644
--- a/src/mod/all_chapters/init/init.gml
+++ b/src/mod/all_chapters/init/init.gml
@@ -3,19 +3,8 @@
function init()
{
set_constants()
- var first_time = !directory_exists(working_directory + "keucher_mod");
- if (first_time)
- {
- show_message("Welcome to Keucher Mod!
-
-This mod contains many features to speedrun the game. You will need some time learn all the features useful to you, but as a starter, you should know that pressing the mouse's \"Right Button\" will open the game menu. There, you can look at all the features, learn what they do, enable the ones you want or not. You can also look at the value for all the keybinds, and reassign them as you wish.
-
-Happy running!")
- }
- directory_create("keucher_mod")
- init_keybinds()
- init_user_ils()
- init_player_options()
+ init_config();
+ init_room_names()
var omnipresent_instances = create_array
(
diff --git a/src/mod/all_chapters/keybinds/gml_Object_DEVICE_NAMER_Draw_0.gml b/src/mod/all_chapters/keybinds/gml_Object_DEVICE_NAMER_Draw_0.gml
index fa17765..1a9d538 100644
--- a/src/mod/all_chapters/keybinds/gml_Object_DEVICE_NAMER_Draw_0.gml
+++ b/src/mod/all_chapters/keybinds/gml_Object_DEVICE_NAMER_Draw_0.gml
@@ -3,5 +3,5 @@
/// REPLACE
if (scr_debug() && keyboard_check_pressed(ord("R")))
/// CODE
-if pressed_active_feature_key(#KEYBINDING.reload, "restart")
+if pressed_active_debug_keybind("restart_room")
/// END
\ No newline at end of file
diff --git a/src/mod/all_chapters/keybinds/obj_battlecontroller_Step_0.gml b/src/mod/all_chapters/keybinds/obj_battlecontroller_Step_0.gml
index 2515289..36b4142 100644
--- a/src/mod/all_chapters/keybinds/obj_battlecontroller_Step_0.gml
+++ b/src/mod/all_chapters/keybinds/obj_battlecontroller_Step_0.gml
@@ -24,9 +24,9 @@
/// END
/// APPEND
-if pressed_active_feature_key(#KEYBINDING.heal, "party-heal")
+if pressed_active_debug_keybind("heal_party")
scr_debug_fullheal()
-if pressed_active_feature_key(#KEYBINDING.instant_win, "win-battle")
+if pressed_active_debug_keybind("instant_win")
{
if (global.chapter == 2 && instance_exists(o_boxingqueen))
{
diff --git a/src/mod/all_chapters/keybinds/obj_ch2_scene31_Step_0.gml b/src/mod/all_chapters/keybinds/obj_ch2_scene31_Step_0.gml
index c00f729..5ad1132 100644
--- a/src/mod/all_chapters/keybinds/obj_ch2_scene31_Step_0.gml
+++ b/src/mod/all_chapters/keybinds/obj_ch2_scene31_Step_0.gml
@@ -5,11 +5,11 @@
/// BEFORE
keytimer++
/// CODE
-global.are_keybinds_on = false
+global.debug_keybinds_on = false
/// END
/// BEFORE
con = 0
/// CODE
-global.are_keybinds_on = true
+global.debug_keybinds_on = true
/// END
\ No newline at end of file
diff --git a/src/mod/all_chapters/keybinds/obj_mainchara_Step_0.gml b/src/mod/all_chapters/keybinds/obj_mainchara_Step_0.gml
index 8d29bef..776c3a0 100644
--- a/src/mod/all_chapters/keybinds/obj_mainchara_Step_0.gml
+++ b/src/mod/all_chapters/keybinds/obj_mainchara_Step_0.gml
@@ -3,11 +3,11 @@
// WARNING: compilation issues. Only use append
/// APPEND
-if pressed_active_feature_key(#KEYBINDING.next_room, "room-warp")
+if pressed_active_debug_keybind("next_room")
{
room_goto_next()
}
-if pressed_active_feature_key(#KEYBINDING.previous_room, "room-warp")
+if pressed_active_debug_keybind("previous_room")
{
room_goto_previous()
}
diff --git a/src/mod/all_chapters/keybinds/vanilla/obj_darkcontroller_Step_0.gml b/src/mod/all_chapters/keybinds/vanilla/obj_darkcontroller_Step_0.gml
index 4015f66..f7325fa 100644
--- a/src/mod/all_chapters/keybinds/vanilla/obj_darkcontroller_Step_0.gml
+++ b/src/mod/all_chapters/keybinds/vanilla/obj_darkcontroller_Step_0.gml
@@ -18,15 +18,15 @@ if scr_debug()
}
}
/// CODE
-if pressed_active_feature_key(#KEYBINDING.save, "save-file")
+if pressed_active_debug_keybind("save_menu")
{
instance_create(0, 0, obj_savemenu)
}
-if pressed_active_feature_key(#KEYBINDING.load, "save-load")
+if pressed_active_debug_keybind("load_file")
{
scr_load()
}
-if (pressed_active_feature_key(#KEYBINDING.reload, "restart"))
+if (pressed_active_debug_keybind("restart_room"))
{
if keyboard_check(vk_backspace)
{
diff --git a/src/mod/all_chapters/keybinds/vanilla/obj_overworldc_SP_Step_0.gml b/src/mod/all_chapters/keybinds/vanilla/obj_overworldc_SP_Step_0.gml
index 0027788..388951e 100644
--- a/src/mod/all_chapters/keybinds/vanilla/obj_overworldc_SP_Step_0.gml
+++ b/src/mod/all_chapters/keybinds/vanilla/obj_overworldc_SP_Step_0.gml
@@ -14,11 +14,11 @@ if scr_debug_ch1()
game_restart_true_ch1()
}
/// CODE
-if pressed_active_feature_key(#KEYBINDING.save, "save-file")
+if pressed_active_debug_keybind("save_menu")
instance_create_ch1(0, 0, obj_savemenu_ch1)
-if pressed_active_feature_key(#KEYBINDING.load, "save-load")
+if pressed_active_debug_keybind("load_file")
scr_load_ch1()
-if pressed_active_feature_key(#KEYBINDING.reload, "restart")
+if pressed_active_debug_keybind("restart_room")
{
if keyboard_check(vk_backspace)
{
@@ -48,15 +48,15 @@ if scr_debug()
}
/// CODE
// to-do: a bit redudant? possibly refactor
-if pressed_active_feature_key(#KEYBINDING.save, "save-file")
+if pressed_active_debug_keybind("save_menu")
{
instance_create(0, 0, obj_savemenu)
}
-if pressed_active_feature_key(#KEYBINDING.load, "save-load")
+if pressed_active_debug_keybind("load_file")
{
scr_load()
}
-if pressed_active_feature_key(#KEYBINDING.reload, "restart")
+if pressed_active_debug_keybind("restart_room")
{
if keyboard_check(vk_backspace)
{
diff --git a/src/mod/all_chapters/keybinds/vanilla/obj_overworldc_Step_0.gml b/src/mod/all_chapters/keybinds/vanilla/obj_overworldc_Step_0.gml
index e238736..8883561 100644
--- a/src/mod/all_chapters/keybinds/vanilla/obj_overworldc_Step_0.gml
+++ b/src/mod/all_chapters/keybinds/vanilla/obj_overworldc_Step_0.gml
@@ -19,11 +19,11 @@ if scr_debug()
}
}
/// CODE
-if pressed_active_feature_key(#KEYBINDING.save, "save-file")
+if pressed_active_debug_keybind("save_menu")
instance_create(0, 0, obj_savemenu)
-if pressed_active_feature_key(#KEYBINDING.load, "save-load")
+if pressed_active_debug_keybind("load_file")
scr_load()
-if pressed_active_feature_key(#KEYBINDING.reload, "restart")
+if pressed_active_debug_keybind("restart_room")
{
if keyboard_check(vk_backspace)
{
diff --git a/src/mod/all_chapters/labels/mod_version.gml b/src/mod/all_chapters/labels/mod_version.gml
index d4b8ca9..df3125a 100644
--- a/src/mod/all_chapters/labels/mod_version.gml
+++ b/src/mod/all_chapters/labels/mod_version.gml
@@ -3,8 +3,8 @@
function get_mod_version()
{
#if SURVEY_PROGRAM
- return "4.6.1-SP"
+ return "5.0.0-SP"
#else
- return "4.6.0-DEMO";
+ return "5.0.0-DEMO";
#endif
}
\ No newline at end of file
diff --git a/src/mod/all_chapters/make_visible/obj_darkcontroller_DUPE_Step_0.gml b/src/mod/all_chapters/make_visible/obj_darkcontroller_DUPE_Step_0.gml
index 30faf36..758c02f 100644
--- a/src/mod/all_chapters/make_visible/obj_darkcontroller_DUPE_Step_0.gml
+++ b/src/mod/all_chapters/make_visible/obj_darkcontroller_DUPE_Step_0.gml
@@ -1,7 +1,7 @@
/// PATCH
/// APPEND
// toggle visible in Ch1
-if pressed_active_feature_key(#KEYBINDING.make_visible, "visible")
+if pressed_active_debug_keybind("make_visible")
{
global.interact = 0
var mainchara = get_object_implicit_chapter("obj_mainchara")
diff --git a/src/mod/all_chapters/misc/clear_sounds/clear_sounds.gml b/src/mod/all_chapters/misc/clear_sounds/clear_sounds.gml
index 5448c60..4168926 100644
--- a/src/mod/all_chapters/misc/clear_sounds/clear_sounds.gml
+++ b/src/mod/all_chapters/misc/clear_sounds/clear_sounds.gml
@@ -2,7 +2,7 @@
function clear_all_sounds()
{
- if pressed_active_feature_key(#KEYBINDING.stop_sounds, "stop-sounds")
+ if pressed_active_debug_keybind("stop_sound")
{
#if DEMO
if (global.chapter == 1)
diff --git a/src/mod/all_chapters/misc/debug_init/gml_GlobalScript_scr_gamestart.gml b/src/mod/all_chapters/misc/debug_init/gml_GlobalScript_scr_gamestart.gml
deleted file mode 100644
index 3b15c2b..0000000
--- a/src/mod/all_chapters/misc/debug_init/gml_GlobalScript_scr_gamestart.gml
+++ /dev/null
@@ -1,12 +0,0 @@
-/// PATCH
-
-// need patch so that debug isn't changed to something other than the player's choice
-/// REPLACE
-#if DEMO
-global.debug = 0
-#else
-global.debug = false
-#endif
-/// CODE
-global.debug = read_json_value(global.player_options, "debug")
-/// END
\ No newline at end of file
diff --git a/src/mod/all_chapters/misc/debug_toggle/debug_toggle.gml b/src/mod/all_chapters/misc/debug_toggle/debug_toggle.gml
deleted file mode 100644
index 534fa8b..0000000
--- a/src/mod/all_chapters/misc/debug_toggle/debug_toggle.gml
+++ /dev/null
@@ -1,44 +0,0 @@
-/// FUNCTIONS
-
-function toggle_debug()
-{
- if (pressed_active_feature_key(#KEYBINDING.toggle_debug, "debug-toggle"))
- {
- var debug
- // debug toggle
-#if DEMO
- if (global.chapter == 1)
- {
- if scr_debug_ch1()
- {
- obj_debugcontroller_ch1.debug = false
- show_temp_message("Debug disabled")
- }
- else
- {
- obj_debugcontroller_ch1.debug = true
- show_temp_message("Debug enabled")
- }
- debug = scr_debug_ch1()
- }
- else
- {
-#endif
- if global.debug
- {
- global.debug = false
- show_temp_message("Debug disabled")
- }
- else
- {
- global.debug = true
- show_temp_message("Debug enabled")
- }
- debug = global.debug
-#if DEMO
- }
-#endif
- ds_map_set(global.player_options, "debug", debug)
- save_player_options()
- }
-}
\ No newline at end of file
diff --git a/src/mod/all_chapters/misc/reset_tempflags/reset_tempflags.gml b/src/mod/all_chapters/misc/reset_tempflags/reset_tempflags.gml
index 627534f..d75e349 100644
--- a/src/mod/all_chapters/misc/reset_tempflags/reset_tempflags.gml
+++ b/src/mod/all_chapters/misc/reset_tempflags/reset_tempflags.gml
@@ -3,7 +3,7 @@
function reset_tempflags()
{
// reset tempflags
- if pressed_active_feature_key(#KEYBINDING.reset_tempflags, "reset-flags")
+ if pressed_active_debug_keybind("reset_tempflags")
{
for (i = 0; i < 100; i += 1)
global.tempflag[i] = 0
diff --git a/src/mod/all_chapters/misc/room_warper/room_warper.gml b/src/mod/all_chapters/misc/room_warper/room_warper.gml
index a2c3852..de37609 100644
--- a/src/mod/all_chapters/misc/room_warper/room_warper.gml
+++ b/src/mod/all_chapters/misc/room_warper/room_warper.gml
@@ -1,18 +1,25 @@
/// FUNCTIONS
-// room warper
-function enable_room_warper()
+function warp_to_battleroom()
{
- if pressed_active_feature_key(#KEYBINDING.warp_room, "choose-room")
- {
- var warp = get_integer("Enter the ID of the room to warp to.", "")
- global.interact = 0
+
+ // free movement and set darkworld
+ // TO-DO: I've seen this sort of pattern before. Group in function?
+ global.darkzone = true
+ global.interact = 0
#if DEMO
- if (global.chapter == 1)
- snd_free_all_ch1()
- else if (global.chapter == 2)
+ if (global.chapter == 1)
+ {
+ // TO-DO: group room_goto and snd_free_all in function
+ snd_free_all_ch1()
+ room_goto(room_battletest_ch1)
+ }
+ else if (global.chapter == 2)
+ {
#endif
- snd_free_all()
- room_goto(warp)
+ snd_free_all()
+ room_goto(room_battletest)
+#if DEMO
}
+#endif
}
\ No newline at end of file
diff --git a/src/mod/all_chapters/misc/set_constants.gml b/src/mod/all_chapters/misc/set_constants.gml
index ee0a40d..f8bc0b4 100644
--- a/src/mod/all_chapters/misc/set_constants.gml
+++ b/src/mod/all_chapters/misc/set_constants.gml
@@ -3,7 +3,5 @@
function set_constants()
{
set_crit_patterns()
- set_all_instructions()
- global.feature_info = set_feature_info()
}
diff --git a/src/mod/all_chapters/misc/speedup_key/obj_time_DUPE_Step_1.gml b/src/mod/all_chapters/misc/speedup_key/obj_time_DUPE_Step_1.gml
index 573bfca..9077f24 100644
--- a/src/mod/all_chapters/misc/speedup_key/obj_time_DUPE_Step_1.gml
+++ b/src/mod/all_chapters/misc/speedup_key/obj_time_DUPE_Step_1.gml
@@ -15,23 +15,13 @@
#endif
/// APPEND
-if (keyboard_check_pressed(get_bound_key(#KEYBINDING.speed)))
+if (pressed_active_debug_keybind("speedup"))
{
-if (room_speed == 30)
-{
-
- if (keyboard_check(vk_control) && is_feature_active("slowdown"))
- {
- room_speed = 10
- }
- else if is_feature_active("speedup")
- {
- room_speed = 150
- }
+ room_speed = room_speed == 150 ? 30 : 150;
}
-else
+
+if (pressed_active_debug_keybind("slowdown"))
{
- room_speed = 30
-}
+ room_speed = room_speed == 10 ? 30 : 10;
}
/// END
\ No newline at end of file
diff --git a/src/mod/all_chapters/noclip/noclip.gml b/src/mod/all_chapters/noclip/noclip.gml
index a4f5400..07705e3 100644
--- a/src/mod/all_chapters/noclip/noclip.gml
+++ b/src/mod/all_chapters/noclip/noclip.gml
@@ -3,7 +3,7 @@
// toggle noclip
function toggle_noclip()
{
- if pressed_active_feature_key(#KEYBINDING.no_clip, "toggle-noclip")
+ if pressed_active_debug_keybind("noclip")
{
var mainchara = get_object_implicit_chapter("obj_mainchara")
if (mainchara.mask_index != spr_i_am_the_joker)
diff --git a/src/mod/all_chapters/omnipresent/obj_omnipresent_Step_0.gml b/src/mod/all_chapters/omnipresent/obj_omnipresent_Step_0.gml
index 18a9b93..b22c520 100644
--- a/src/mod/all_chapters/omnipresent/obj_omnipresent_Step_0.gml
+++ b/src/mod/all_chapters/omnipresent/obj_omnipresent_Step_0.gml
@@ -1,11 +1,5 @@
/// IMPORT
-toggle_debug()
-
-warp_to_battleroom()
-
clear_all_sounds()
-reset_tempflags()
-
-enable_room_warper()
\ No newline at end of file
+reset_tempflags()
\ No newline at end of file
diff --git a/src/mod/all_chapters/option_menu/feature_selector/feature_selector.gml b/src/mod/all_chapters/option_menu/feature_selector/feature_selector.gml
deleted file mode 100644
index c2f8ef6..0000000
--- a/src/mod/all_chapters/option_menu/feature_selector/feature_selector.gml
+++ /dev/null
@@ -1,243 +0,0 @@
-/// FUNCTIONS
-
-function get_feature_options()
-{
- length = array_length(global.feature_info)
- button_amount = length / global.feature_info_group_length
- for (var i = 0; i < length; i += global.feature_info_group_length)
- {
- var feature_value = read_json_value(global.player_options, "feature-options", global.feature_info[i])
- var feature_state = ""
- switch (feature_value)
- {
- case #FEATURE_STATE.always:
- feature_state = "ALWAYS"
- break;
- case #FEATURE_STATE.never:
- feature_state = "NEVER"
- break;
- case #FEATURE_STATE.debug:
- feature_state = "DEBUG ONLY"
- break;
- }
- var button_number = i / global.feature_info_group_length
- button_text[button_number] = string(button_number + 1) + " - " + global.feature_info[i + global.feature_info_name_index]
- }
-
- options_state = #OPTION_STATE.features
-}
-
-/*
-Gets the options for editting a single feature
-Args:
-feature_id - The id used in the files for the feature
-feature_index - The index of the feature in the feature_info array
-*/
-function get_single_feature_options(feature_id, feature_index)
-{
- var feature_value = read_json_value(global.player_options, "feature-options", feature_id)
- var feature_state = ""
- switch (feature_value)
- {
- case #FEATURE_STATE.always:
- feature_state = "ALWAYS"
- break;
- case #FEATURE_STATE.never:
- feature_state = "NEVER"
- break;
- case #FEATURE_STATE.debug:
- feature_state = "DEBUG ONLY"
- break;
- }
- options_state = #OPTION_STATE.single_feature
-
- // initialize the static buttons
- get_buttons_from_pair_array(
- 0, "INFO",
- 1, "State: " + feature_state,
- );
-
- // dynamically add keybinds for this feature
- var keybind_array = global.feature_info[feature_index * global.feature_info_group_length + global.feature_info_keybinds_index]
- var keybind_count = array_length(keybind_array)
- for (var i = 0; i < keybind_count; i++)
- {
- var keybind_index = keybind_array[i]
- var key_id = read_json_value(global.mod_keybinds, keybind_index);
- var keybind_name = read_json_value(global.keybinding_info, keybind_index, "name")
- var keybind_value = read_json_value(global.keybinding_info, keybind_index, )
- button_text[button_amount] = "KEYBIND: " + keybind_name + " [" + get_key_name(key_id) + "]"
- button_amount++
- }
-}
-
-/*
-Get the options for editting a single keybind
-Args:
-keybind_id - The id used in the files for the keybind (comes from the enum)
-*/
-function get_keybind_assign_options(keybind_id)
-{
- // update obj_mod_options variable
- current_keybind = keybind_id;
-
- var keybind_info = read_json_value(global.keybinding_info, keybind_id);
- var key_id = read_json_value(global.mod_keybinds, keybind_id);
-
- get_buttons_from_pair_array(
- 0, "KEYBIND: " + read_json_value(keybind_info, "name"),
- 1, "Value: [" + get_key_name(key_id) + "]",
- 2, "Set Value"
- );
-
- options_state = #OPTION_STATE.keybind_assign
-}
-
-function set_feature_info()
-{
- set_keybinding_info()
- global.feature_info_group_length = 5
- // this array groups "group length" values together for each feature, in order:
- // string id for id, the button text and the default state
-
- // index variables for keeping track of what value is each
- global.feature_info_id_index = 0
- global.feature_info_name_index = 1
- global.feature_info_state_index = 2
- global.feature_info_info_index = 3
- global.feature_info_keybinds_index = 4
- return create_array
- (
- "save-file", "Opening save menu", #FEATURE_STATE.debug, "Allows to open the save menu at any point", create_array(#KEYBINDING.save),
- "save-load", "Loading save file", #FEATURE_STATE.debug, "Allows to load a save at any moment", create_array(#KEYBINDING.load),
- "restart", "Restarting the room", #FEATURE_STATE.debug, "Allows to reload the room", create_array(#KEYBINDING.reload),
- "ch1-mercy-percentage", "Show mercy percentages in Chapter 1", #FEATURE_STATE.always, "In Chapter 1, mercy percentages like the Chapter 2 ones will show up", create_array(),
- "enemy-hp", "Display current and max HP of enemies", #FEATURE_STATE.always, "The exact HP number will be displayed in battles", create_array(),
- "doorwarp-square", "Show doorwarp indicator", #FEATURE_STATE.always, "When doing doorwarp, you must wait an amount of time after the bagel cutscene ends, otherwise you won't be able to overflow. This will display a square in the top left of the screen that is red, and becomes green when it's OK to mash the textbox and get the overflow.", create_array(),
- "susie-death", "Always target Susie in K. Round", #FEATURE_STATE.always, "Susie will perish 100% of the time", create_array(),
- "spelling-bee", "Always get optimal spelling bee word", #FEATURE_STATE.always, "Get optimal spelling bee words, 4 letters for Japanese and 5 letters for English", create_array(),
- "plotwarp", "Activate the plotwarp keybinds", #FEATURE_STATE.debug, "Allows to use plotwarps", create_array(#KEYBINDING.plot_warp),
- "crit-practice", "Crit practice mode", #FEATURE_STATE.debug, "In crit practice mode, the first enemy of the debug room (ambyu-lance in Chapter2) will have no attacks, so you can keep attacking infinitely with practically no downtime\n\nThis feature must be toggled through the keybinding\n\nYou can also practice a specific crit pattern with pattern mode. This means the crit pattern won't be random but always the same, and you can choose which one to use with the previou and next keys", create_array(#KEYBINDING.toggle_crit_mode, #KEYBINDING.toggle_pattern_mode, #KEYBINDING.next_crit_pattern, #KEYBINDING.previous_crit_pattern),
- "rouxls-practice", "Toggle Rouxls Kaard practice mode", #FEATURE_STATE.debug, "In this practice mode, you can make it so Rouxl's (first) house conquering pattern is always the same, and you can change through all the possible ones so you can practice them", create_array(#KEYBINDING.toggle_rouxls, #KEYBINDING.next_house_pattern, #KEYBINDING.previous_house_pattern),
- "boss-practice", "Boss Practice mode", #FEATURE_STATE.debug, "In boss practice mode, King, Queen, Jevil and Spamton NEO will eternally repeat the current selected attack. You can change the attack with the previous and next keybinds", create_array(#KEYBINDING.toggle_boss, #KEYBINDING.next_boss_attack, #KEYBINDING.previous_boss_attack),
- "timer", "Enable IGT", #FEATURE_STATE.always, "With this option, IGT will be available\n\nIGT has several mods, you can swap through the different ones using the MODE keybind\n\nYou can reset the timer with the keybind\n\nYou can hide the timer, without turning it off with the timer toggle\n\nYou can set a room that the timer will watch to start in", create_array(#KEYBINDING.igt_mode, #KEYBINDING.reset_timer, #KEYBINDING.toggle_timer, #KEYBINDING.igt_room),
- "gamemaker-savestate", "Enable Savestates", #FEATURE_STATE.always, "Savestates can be used. They are different from the game saves and they try to take an exact snapshot of everything that is happening.\n\nHOWEVER: They are a legacy gamemaker feature and don't work well anymore. It works sometimes for DELTARUNE, but won't always work, it breaks specially in fights. Giga Queen is the only fight that works somehow.", create_array(#KEYBINDING.store_savestate, #KEYBINDING.load_savestate),
- "speedup", "Enable speedup keybind", #FEATURE_STATE.debug, "With this keybind you can speed up the game to be very fast!", create_array(#KEYBINDING.speed),
- "slowdown", "Enable slowdown keybind", #FEATURE_STATE.never, "With this keybind you can slow down the game to be very slow! It works by pressing the speedup keybind while holding CTRL", create_array(),
- "gif", "Enable GIF recording", #FEATURE_STATE.debug, "You can record a gif. The gif will be saved in the game files.", create_array(#KEYBINDING.gif),
- "room-warp", "Enable warping to next and previous rooms", #FEATURE_STATE.debug, "You can warp to the neighboring rooms", create_array(#KEYBINDING.next_room, #KEYBINDING.previous_room),
- "party-heal", "Enable healing party in battle", #FEATURE_STATE.debug, "You can heal the party, during a battle", create_array(#KEYBINDING.heal),
- "win-battle", "Enable instant battle win keybind", #FEATURE_STATE.debug, "Instantly wins a battle. Keep in mind it may have different effects to finishing some battles in regards to specific flags or other things.", create_array(#KEYBINDING.instant_win),
- "tp-toggle", "Enable TP toggle", #FEATURE_STATE.debug, "With the TP toggle you can empty or full your TP bar", create_array(#KEYBINDING.toggle_tp),
- "debug-toggle", "Enable debug toggle", #FEATURE_STATE.always, "Allows to disable and enable DEBUG mode, which gives many vanilla debug features and allows to use your own defined debug features", create_array(#KEYBINDING.toggle_debug),
- "stop-sounds", "Enable stop sounds keybind", #FEATURE_STATE.debug, "With the keybind you can mute all ongoing sounds", create_array(#KEYBINDING.stop_sounds),
- "reset-flags", "Enable reset tempflags keybind", #FEATURE_STATE.debug, "Allows to reset tempflags for a room. Tempflags are used for things that don't save through a savefile but influence cutscenes and other things, eg. Spamton NEO becoming easier each time you die.", create_array(#KEYBINDING.reset_tempflags),
- "choose-room", "Enable warp to room keybind", #FEATURE_STATE.debug, "With this you can warp to a specific room", create_array(#KEYBINDING.warp_room),
- "boundary-box", "Enable boundary box viewer toggle", #FEATURE_STATE.debug, "With this you can look at the hitboxes of things like walls and other things", create_array(#KEYBINDING.toggle_hitboxes),
- "visible", "Enable toggle for making character visible and give movement", #FEATURE_STATE.debug, "With this you can make your character visible in cutscenes where it is invisible. It also gives them movement", create_array(#KEYBINDING.make_visible),
- "snowgrave-plot", "Enable key for setting Snowgrave plot", #FEATURE_STATE.debug, "You can progress your snowgrave plot pressing the plot keybind + a number.", create_array(#KEYBINDING.snowgrave_plot),
- "change-party", "Enable party changer", #FEATURE_STATE.debug, "Change the party", create_array(#KEYBINDING.change_party),
- "side-action", "Enable toggle for S/R/N actions", #FEATURE_STATE.debug, "Toggles the ability to use S/R/N actions", create_array(),
- "toggle-noclip", "Enable toggle noclip", #FEATURE_STATE.debug, "Toggles noclip", create_array(#KEYBINDING.no_clip),
- "get-item", "Enable key for getting all weapons", #FEATURE_STATE.debug, "Get all items when pressing the keybind", create_array(#KEYBINDING.get_item),
- "show-wp-mash", "Display mash stats for the Wrist Protector", #FEATURE_STATE.never, "In Chapter 1, show the mashing stats for the Wrist Protector", create_array(),
- "show-wake-mash", "Display mash stats for the sequence where you get up at the start of Chapter 1", #FEATURE_STATE.debug, "In the first dark world room, where you must mash your arrow keys, you can take a look at the mashing stats", create_array(),
- "screenshot", "Screenshot (Ch1)", #FEATURE_STATE.debug, "A native debug feature that allows for taking screenshots in Chapter 1", create_array(#KEYBINDING.screenshot),
- "tadytext", "TadyText Practice", #FEATURE_STATE.never, "With this practice mode, you have extra information for practicing TadyText.", create_array(),
- "position-cache", "Cache Position", #FEATURE_STATE.never, "When this is toggled, saving in a room with Kris will lead into also caching the position they were in the room, so everytime you load they will return to that position. This only persists until you close the game.", create_array()
- );
-}
-
-/*
-Helper to be used by set_keybinding_info, creates a map with the keys "default", "name", and "info"
-Args:
-default_key - The default key for the keybind
-name - The name of the keybind
-info - The info for the keybind
-*/
-function create_keybinding_data(default_key, name, info)
-{
- return create_json_with_pairs("default", default_key, "name", name, "info", info)
-
-}
-
-/*
-Creates the constant map that holds all the keybinding info
-*/
-function set_keybinding_info()
-{
- global.keybinding_info = create_json_with_pairs(
- #KEYBINDING.save, create_keybinding_data(ord("S"), "Open Save Prompt", "Open the save prompt"),
- #KEYBINDING.load, create_keybinding_data(ord("L"), "Load Save", ""),
- #KEYBINDING.reload, create_keybinding_data(ord("R"), "Reload Room", ""),
- #KEYBINDING.speed, create_keybinding_data(ord("À"), "Toggle Game Speed", ""),
- #KEYBINDING.gif, create_keybinding_data(ord("G"), "Toggle Gif Recording", ""),
- #KEYBINDING.next_room, create_keybinding_data(vk_insert, "Warp to the next room", ""),
- #KEYBINDING.previous_room, create_keybinding_data(vk_delete, "Warp to the previous room", ""),
- #KEYBINDING.heal, create_keybinding_data(vk_f2, "Heal Party", ""),
- #KEYBINDING.instant_win, create_keybinding_data(vk_f5, "Instant Win Battle", ""),
- #KEYBINDING.toggle_tp, create_keybinding_data(vk_f10, "Toggle TP max or min", ""),
- #KEYBINDING.toggle_debug, create_keybinding_data(vk_f3, "Toggle debug mode on / off", ""),
- #KEYBINDING.stop_sounds, create_keybinding_data(vk_f11, "Stop all sounds being played", ""),
- #KEYBINDING.reset_tempflags, create_keybinding_data(vk_f12, "Reset all tempflags", ""),
- #KEYBINDING.warp_room, create_keybinding_data(vk_end, "Warp to room by ID", ""),
- #KEYBINDING.toggle_hitboxes, create_keybinding_data(ord("U"), "Toggle boundary box visibility", ""),
- #KEYBINDING.make_visible, create_keybinding_data(ord("I"), "Free movement and make visible", ""),
- #KEYBINDING.snowgrave_plot, create_keybinding_data(ord("O"), "Snowgrave plot setter", ""),
- #KEYBINDING.change_party, create_keybinding_data(ord("H"), "Change party setup", ""),
- #KEYBINDING.side_action, create_keybinding_data(ord("J"), "Toggle side actions", ""),
- #KEYBINDING.no_clip, create_keybinding_data(ord("K"), "Toggle no clip", ""),
- #KEYBINDING.get_item, create_keybinding_data(ord("N"), "Get items", ""),
- #KEYBINDING.plot_warp, create_keybinding_data(ord("D"), "Plot warp button", ""),
- #KEYBINDING.igt_mode, create_keybinding_data(vk_f6, "Change IGT mode", ""),
- #KEYBINDING.igt_room, create_keybinding_data(vk_f7, "Set timer start room", ""),
- #KEYBINDING.toggle_timer, create_keybinding_data(vk_f8, "Toggle timer visibility", ""),
- #KEYBINDING.reset_timer, create_keybinding_data(vk_f9, "Reset timer", ""),
- #KEYBINDING.store_savestate, create_keybinding_data(ord("Q"), "Store Savestate", ""),
- #KEYBINDING.load_savestate, create_keybinding_data(ord("E"), "Load Savestate", ""),
- #KEYBINDING.toggle_crit_mode, create_keybinding_data(ord("P"), "Toggle Crit Mode", ""),
- #KEYBINDING.toggle_pattern_mode, create_keybinding_data(vk_tab, "Toggle Pattern Mode", ""),
- #KEYBINDING.next_crit_pattern, create_keybinding_data(vk_pageup, "Next Crit Pattern", ""),
- #KEYBINDING.previous_crit_pattern, create_keybinding_data(vk_pagedown, "Previous Crit Pattern", ""),
- #KEYBINDING.toggle_rouxls, create_keybinding_data(ord("P"), "Toggle Rouxls Kaard", ""),
- #KEYBINDING.next_house_pattern, create_keybinding_data(vk_pageup, "Next House Pattern", ""),
- #KEYBINDING.previous_house_pattern, create_keybinding_data(vk_pagedown, "Previous House Pattern", ""),
- #KEYBINDING.toggle_boss, create_keybinding_data(ord("P"), "Toggle Boss Practice", ""),
- #KEYBINDING.next_boss_attack, create_keybinding_data(vk_pageup, "Next Boss Attack", ""),
- #KEYBINDING.previous_boss_attack, create_keybinding_data(vk_pagedown, "Previous Boss Attack", ""),
- #KEYBINDING.screenshot, create_keybinding_data(vk_f10, "Screenshots (in CH1)", "")
- );
-}
-
-function is_feature_active(feature_id)
-{
- var feature_value = read_json_value(global.player_options, "feature-options", feature_id)
- switch (feature_value)
- {
- case #FEATURE_STATE.always:
- return true
- case #FEATURE_STATE.never:
- return false
- case #FEATURE_STATE.debug:
-#if DEMO
- if (global.chapter == 1)
- {
- return scr_debug_ch1();
- }
- return global.debug;
-#endif
-#if SURVEY_PROGRAM
- return scr_debug()
-#endif
- }
-}
-
-function pressed_active_feature_key(key, feature)
-{
- return global.are_keybinds_on && keyboard_check_pressed(get_bound_key(key)) && is_feature_active(feature)
-}
-
-function detected_active_feature_key(key, feature)
-{
- return global.are_keybinds_on && keyboard_check(get_bound_key(key)) && is_feature_active(feature)
-}
\ No newline at end of file
diff --git a/src/mod/all_chapters/option_menu/obj_mod_options_Create_0.gml b/src/mod/all_chapters/option_menu/obj_mod_options_Create_0.gml
index 17c1a2a..050acc1 100644
--- a/src/mod/all_chapters/option_menu/obj_mod_options_Create_0.gml
+++ b/src/mod/all_chapters/option_menu/obj_mod_options_Create_0.gml
@@ -1,20 +1,44 @@
/// IMPORT
button_amount = 0
-button_state[100] = #BUTTON_STATE.none
-button_text[100] = 0
+
+// rooms are what take up most of it
+INIT_BUTTON_AMOUNT = 1000;
+
+// button states
+// "none"
+// "press"
+// "hover"
+// "highlight"
+button_state[INIT_BUTTON_AMOUNT] = "none"
+button_text[INIT_BUTTON_AMOUNT] = 0
+
+use_enumeration = false;
+
+// Description at the top
+menu_desc = "";
+
+// Currently displayed hover description
+menu_hover_desc = "";
+
+// Saves the descriptions when hovering the i-th index button
+hover_desc[INIT_BUTTON_AMOUNT] = "";
// variable that tracks the current option menu
-options_state = #OPTION_STATE.default_state
+options_state = "default"
scroll_ypos = 0
scroll_dragging = false
scroll_dragging_y = 0
-current_keybind = 0
+// keep track of the index of the keybind being currently edited
+current_keybind_index = 0;
// whether or not waiting for player to press a key
-setting_keybind = false
+setting_keybind = false;
+
+// true if setting keybind is for debug keybind, false if for misc keybind
+setting_debug = true;
// to keep track of the current feature being edited, if any
current_feature = undefined
@@ -25,4 +49,17 @@ get_default_mod_options()
global.current_created_preset = undefined
// saves the current ui element being targeted for change
-current_ui_element = undefined
\ No newline at end of file
+current_ui_element = undefined
+
+// check if are in the room warp options (search for key inputs)
+typing_room = false;
+room_query = "";
+pressing_room_query = false;
+
+// how long between frames we have been pressing the same key
+key_current_cooldown = 0;
+KEY_COOLDOWN = 60;
+
+// save progress for when scrolling such that there is
+// a constant distance between top of scroll bar and mouse pos
+scroll_top_delta = 0;
\ No newline at end of file
diff --git a/src/mod/all_chapters/option_menu/obj_mod_options_Draw_64.gml b/src/mod/all_chapters/option_menu/obj_mod_options_Draw_64.gml
index 74bfe0e..ad1157f 100644
--- a/src/mod/all_chapters/option_menu/obj_mod_options_Draw_64.gml
+++ b/src/mod/all_chapters/option_menu/obj_mod_options_Draw_64.gml
@@ -1,5 +1,8 @@
/// IMPORT
+draw_set_font(fnt_main)
+draw_set_color(c_white)
+
real_mouse_x = device_mouse_x_to_gui(0)
real_mouse_y = device_mouse_y_to_gui(0)
@@ -13,10 +16,29 @@ view_width = 640
view_height = 480
#endif
+// empty by default, will fill it if hovering a button
+menu_hover_desc = "";
+
+menu_desc_height = min(100, 0.1 * view_height);
+
+hover_desc_height = min(100, 0.1 * view_height);
+hover_desc_start_y = view_height - hover_desc_height;
+
padding = 10
button_height = 32
scroll_width = 16
+// the y-coordinate in which buttons can start showing up
+visible_min_y = menu_desc_height;
+
+// the y-coordinate in which buttons must stop showing up
+visible_max_y = view_height - hover_desc_height;
+
+// the total amount of pixels all buttons take up in y-direction
+buttons_delta_y = button_amount * (button_height + padding) + padding;
+
+buttons_visible_delta_y = (visible_max_y - visible_min_y);
+
button_start_x = padding
button_end_x = view_width - padding - scroll_width
@@ -27,10 +49,21 @@ draw_rectangle(0, 0, view_width, view_height, true)
// scroll wheel related coordinates
// highest y value reached by the BUTTONS
-max_y = padding + button_height + (button_amount - 1) * (button_height + padding)
-scroll_height = view_height * min(1, view_height / max_y)
-scroll_ypos = clamp(scroll_ypos, 0, max(max_y, view_height) - view_height)
-min_y = - scroll_ypos / view_height * max_y
+max_y = buttons_delta_y
+scroll_height = buttons_visible_delta_y * min(1, buttons_visible_delta_y / buttons_delta_y);
+
+var mouse_wheel_delta = 30;
+if (mouse_wheel_up())
+{
+ scroll_ypos -= mouse_wheel_delta;
+}
+if (mouse_wheel_down())
+{
+ scroll_ypos += mouse_wheel_delta;
+}
+
+scroll_ypos = clamp(scroll_ypos, visible_min_y, visible_max_y - scroll_height)
+min_y = visible_min_y - buttons_delta_y / buttons_visible_delta_y * (scroll_ypos - visible_min_y)
scroll_start_x = button_end_x + 5
scroll_start_y = scroll_ypos
scroll_end_x = view_width
@@ -43,31 +76,90 @@ if setting_keybind
if (keyboard_key != 0)
{
var target_key = keyboard_key
- var keybinds_using = get_keybinds_assigned(target_key);
- var using_total = array_length_1d(keybinds_using);
- var is_ok = true
- if (using_total > 0)
+
+ if (setting_debug)
{
- var message = "It seems other keybinds are already assigned to this key:\n";
- for (var i = 0; i < using_total; i++)
+ var keybinds_using = get_default_keybinds_using_key(target_key);
+ var using_total = array_length(keybinds_using);
+ var is_ok = true
+ if (using_total > 0)
{
- var key_name = read_json_value(global.keybinding_info, keybinds_using[i], "name");
- message += "\n* " + key_name;
+ var message = "It seems other keybinds are already assigned to this key:\n";
+ for (var i = 0; i < using_total; i++)
+ {
+ var key_name = keybinds_using[i];
+ message += "\n* " + get_debug_keybind_descriptive_name(key_name);
+ }
+ is_ok = show_question(message + "\n\nIs this OKAY?");
}
- is_ok = show_question(message + "\n\nIs this OKAY?");
+
+ if (is_ok)
+ {
+ set_debug_keybind_key(get_debug_keybind_from_index(current_keybind_index), target_key);
+ }
+ setting_keybind = false;
+ get_single_debug_keybind_mod_options(current_keybind_index);
+ }
+ else
+ {
+ var keybinds = get_other_keybinds();
+ update_config_value(target_key, "other_keybind_" + keybinds[current_keybind_index]);
+ setting_keybind = false;
+ get_misc_keybinds_mod_options();
}
- // turning it back on
- global.are_keybinds_on = true
- setting_keybind = false
-
- if (is_ok)
+ }
+}
+// this block takes care of when you are typing room name for room warp
+else if typing_room
+{
+ if (keyboard_key != 0)
+ {
+ key_current_cooldown++;
+ if (keyboard_key == pressing_room_query)
{
- ds_map_set(global.mod_keybinds, string(current_keybind), target_key)
- save_keybinds()
+ if (key_current_cooldown > KEY_COOLDOWN)
+ {
+ pressing_room_query = 0;
+ }
}
- get_keybind_assign_options(current_keybind)
-
+ else
+ {
+ var is_letter = keyboard_key >= ord("A") && keyboard_key <= ord("Z");
+ var is_underscore = keyboard_key == 189;
+ var is_digits = keyboard_key >= ord("0") && keyboard_key <= ord("9");
+ var shift_press = keyboard_check(vk_shift);
+ pressing_room_query = keyboard_key; // avoid multiple registers
+ if (is_letter || (is_underscore && shift_press) || is_digits)
+ {
+
+ var char_pressed = ""
+ if (is_underscore)
+ {
+ char_pressed = "_"
+ }
+ else
+ {
+ // supporting lower and upper case
+ char_pressed = chr(keyboard_key + (((shift_press && is_letter) || !is_letter) ? 0 : 32));
+ }
+ room_query += char_pressed;
+ get_room_warp_mod_options();
+ }
+ else if (keyboard_key == 8)
+ {
+ room_query = keyboard_check(vk_control) ?
+ "" :
+ string_copy(room_query, 1, string_length(room_query) - 1)
+
+ get_room_warp_mod_options()
+ }
+ }
+ }
+ else
+ {
+ key_current_cooldown = 0;
+ pressing_room_query = keyboard_key
}
}
@@ -80,8 +172,7 @@ if (scroll_dragging)
}
else
{
- scroll_ypos += mouse_y - scroll_dragging_y
- scroll_dragging_y = mouse_y
+ scroll_ypos = clamp(real_mouse_y - scroll_top_delta, visible_min_y, visible_max_y - scroll_height)
}
}
// if can initiate dragging scroll
@@ -90,21 +181,22 @@ if point_in_rectangle(real_mouse_x, real_mouse_y, scroll_start_x, scroll_start_y
if (mouse_check_button_pressed(mb_left))
{
scroll_dragging = true
- scroll_dragging_y = mouse_y
+ scroll_dragging_y = real_mouse_y
+ scroll_top_delta = real_mouse_y - scroll_start_y;
}
}
// drawing the actual buttons
-draw_set_color(read_ui_color("button"))
+draw_set_color(read_ui_color("scrollbar"))
draw_rectangle(scroll_start_x, scroll_start_y, scroll_end_x, scroll_end_y, false)
for (var i = 0; i < button_amount; i++)
{
- button_start_y = min_y + padding + i * (button_height + padding) - scroll_ypos
- button_end_y = min_y + padding + button_height + i * (button_height + padding) - scroll_ypos
+ button_start_y = min_y + padding + i * (button_height + padding)
+ button_end_y = min_y + padding + button_height + i * (button_height + padding)
- if (button_start_y > view_hport || button_end_y < view_yport)
+ if (button_start_y > visible_max_y || button_end_y < visible_min_y)
{
continue
}
@@ -114,124 +206,166 @@ for (var i = 0; i < button_amount; i++)
if (mouse_check_button_pressed(mb_left))
{
- button_state[i] = #BUTTON_STATE.press
+ button_state[i] = "press"
}
// handle clicking button
- else if (button_state[i] == #BUTTON_STATE.press)
+ else if (button_state[i] == "press")
{
if (mouse_check_button_released(mb_left))
{
- button_state[i] = #BUTTON_STATE.hover
+ button_state[i] = "hover"
switch (options_state)
{
- case #OPTION_STATE.default_state:
+ case "default":
switch (i)
{
- case #DEFAULT_OPTION.current_split:
- get_split_mod_options()
- break
- case #DEFAULT_OPTION.create_split:
- get_split_create_options()
+ // Debug mode
+ case 0:
+ global.debug = global.debug ? false : true;
+ update_config_value(global.debug, "debug");
+ get_default_mod_options();
break
- case #DEFAULT_OPTION.timer_precision:
- precision = get_integer("Enter timer precision", read_json_value(global.player_options, "timer-precision"))
- ds_map_set(global.player_options, "timer-precision", clamp(precision, 1, 6))
- save_player_options()
+ // Timer
+ case 1:
+ get_timer_mod_options();
break
- case #DEFAULT_OPTION.options:
- get_player_options()
+ // Practice Modes
+ case 2:
+ get_practice_mode_mod_options();
break
- case #DEFAULT_OPTION.feature:
- get_feature_options()
+ // RNG
+ case 3:
+ get_rng_settings_mod_options()
break
- case #DEFAULT_OPTION.saves:
+ // debug keybinds
+ case 4:
+ get_debug_keybinds_mod_options();
+ break;
+ // other keybinds
+ case 5:
+ get_misc_keybinds_mod_options();
+ break;
+ // misc options
+ case 6:
+ get_misc_options_mod_options();
+ break;
+ // flags
+ case 7:
+ get_game_flags_mod_optins();
+ break;
+ // room warp
+ case 8:
+ room_query = "";
+ get_warps_mod_options();
+ break;
+ // saves
+ case 9:
var saves_dir = get_save_dir(false);
if directory_exists(saves_dir)
{
- load_save_buttons(saves_dir);
+ load_save_buttons("/");
}
else
{
show_message("No save folders detected!\n\nTo save custom saves, you can go to your DELTARUNE save folder and add a \"saves\" folder. There, you can add sub folders and saves in whichever way you wish to organize your savefiles.");
}
break
+ // ui colors
+ case 10:
+ get_ui_colors_options();
+ break;
}
break
- case #OPTION_STATE.keybind_assign:
- // get info
+ case "timer":
+ // Timer ON/OFF
if (i == 0)
{
- var keybind_info = read_json_value(global.keybinding_info, current_keybind, "info")
- show_message(keybind_info)
+ update_config_value(read_config_value("timer_on") ? false : true, "timer_on");
+ get_timer_mod_options();
+ }
+ // Timer Mode
+ else if (i == 1)
+ {
+ get_timer_mode_mod_options();
}
- // setting new value
+ // segment-segment options
else if (i == 2)
{
- global.are_keybinds_on = false
- setting_keybind = true
- // update text
- button_text[1] = "Press any key..."
+ get_timer_segment_mod_options();
+ }
+ // split preset options
+ else if (i == 3)
+ {
+ get_split_preset_mod_options();
+ }
+ // timer precision
+ else if (i == 4)
+ {
+ var precision = get_integer("Enter timer precision", read_config_value("timer_precision"));
+ update_config_value(clamp(precision, 1, 6), "timer_precision");
}
break
- case #OPTION_STATE.splits:
- get_split_assign_options(i)
- break
- case #OPTION_STATE.split_assign:
- // warp
+ case "timer_mode":
+ // segment-by-segment
+ if (i == 0)
+ {
+ change_to_timer_segment_mode();
+ }
+ // battle
+ else if (i == 1)
+ {
+ change_to_timer_battle_mode();
+ }
+ // splits
+ else if (i == 2)
+ {
+ change_to_timer_splits_mode();
+ }
+ get_timer_mod_options();
+ break;
+ case "timer_segment":
+ // room-by-room
+ if (i == 0)
+ {
+ update_config_value(get_segment_room_status() ? false : true, "timer_room_split");
+ }
+ // battle
+ else if (i == 1)
+ {
+ update_config_value(get_segment_battle_status() ? false : true, "timer_battle_split");
+ }
+ else
+ {
+ var instructions = get_all_special_instructions();
+ var instruction = instructions[i - 2];
+ update_config_value(get_segment_special_status(instruction) ? false : true, "timer_special_" + instruction);
+ }
+ get_timer_segment_mod_options();
+ break;
+ case "timer_preset_options":
+ // Pick Preset
if (i == 1)
{
- plotwarp(read_json_value(global.splits_json, selected_split, "warp"))
- // switch (selected_split)
- // {
- // case global.SPLIT_field_hopes_dreams:
- // plotwarp(1)
- // break
- // case global.SPLIT_checkerboard:
- // plotwarp(2)
- // break
- // case global.SPLIT_forest:
- // plotwarp(3)
- // break
- // case global.SPLIT_escape_castle:
- // plotwarp(4)
- // break
- // case global.SPLIT_castle_and_king:
- // plotwarp(5)
- // break
- // case global.SPLIT_city_one:
- // plotwarp(1)
- // break
- // case global.SPLIT_city_heights:
- // plotwarp(3)
- // break
- // case global.SPLIT_mansion:
- // plotwarp(4)
- // break
- // case global.SPLIT_acid_lake:
- // plotwarp(5)
- // break
- // case global.SPLIT_queen_and_giga:
- // plotwarp(6)
- // break
- // }
- }
- // set split
+ get_pick_preset_mod_options();
+ }
+ // Create Preset
else if (i == 2)
{
- obj_IGT.current_split = selected_split
- get_split_assign_options(selected_split)
- obj_IGT.split_start_room = start_room
- obj_IGT.segment_split_number = split_count
- update_splits()
+ get_create_preset_mod_options();
}
- break
- case #OPTION_STATE.split_creator:
+ break;
+ case "pick_split_preset":
+ set_current_preset(i);
+ update_splits();
+ get_split_preset_mod_options();
+ break;
+ case "create_split_preset":
switch (i)
{
// reset preset
case 0:
global.current_created_preset = undefined
- get_split_create_options()
+ get_create_preset_mod_options()
break
// creating preset
case 1:
@@ -244,99 +378,349 @@ for (var i = 0; i < button_amount; i++)
}
else if (instruction_count < 2)
{
- show_message("You must have at least 2 instructions: Start and Finish")
+ show_message("You must have at least 2 instructions: Start and Finish");
}
else
{
- ds_map_add(global.current_created_preset, "id", sha1_string_utf8(string(get_timer()) + name))
- ds_map_add_map(global.splits_json, string(ds_map_size(global.splits_json)), global.current_created_preset)
- save_json("keucher_mod/userils.json", global.splits_json)
- global.current_created_preset = undefined
- instance_destroy()
+ create_split_preset(instructions, name);
+ close_mod_options();
}
break
- case 2:
- // apparently deprecated for non debug, but using it anyways
+ case 2: // pick name
var name = get_string("Enter name for preset", "")
if (ds_map_exists(global.current_created_preset, "name"))
ds_map_replace(global.current_created_preset, "name", name)
else
ds_map_add(global.current_created_preset, "name", name)
- get_split_create_options()
+ get_create_preset_mod_options()
break
- case 3:
- get_split_pick_options()
+ case 3: // add split
+ get_split_pick_mod_options()
break
}
break
- case #OPTION_STATE.split_pick:
- var instructions = read_json_value(global.current_created_preset, "instructions")
- var length = ds_map_size(instructions)
- ds_map_add(instructions, string(length), global.ALL_INSTRUCTIONS[i])
- get_split_create_options()
- break
- case #OPTION_STATE.general_options:
+ case "pick_split_1":
+ // Rooms
+ if (i == 0)
+ {
+ get_room_splits_mod_options();
+ }
+ // Events
+ else if (i == 1)
+ {
+ get_event_splits_mod_options();
+ }
+ break;
+ case "pick_room_chapter":
+ get_rooms_in_chapter_mod_options(i + 1);
+ break;
+ case "pick_split_room":
+ case "pick_split_event":
+ var instruction;
+ if (options_state == "pick_split_room")
+ {
+ var rooms = get_chapter_rooms(global.picking_room_from_chapter);
+ instruction = rooms[i];
+ }
+ else if (options_state == "pick_split_event")
+ {
+ var events = get_all_special_instructions();
+ instruction = events[i];
+ }
+ var instructions = read_json_value(global.current_created_preset, "instructions");
+ var length = ds_map_size(instructions);
+ ds_map_add(instructions, string(length), instruction);
+ get_create_preset_mod_options();
+ break;
+ case "practice_modes":
switch (i)
{
- case #GENERAL_OPTION.ui_colors:
- get_ui_colors_options()
- break
+ //boss practice
+ case 0:
+ toggle_boss_practice(!global.bossPractice);
+ break;
+ // crit practice
+ case 1:
+ global.ambyu_practice = global.ambyu_practice ? false : true;
+ break;
+ // rouxls practice
+ case 2:
+ global.rurus_random = global.rurus_random ? false : true;
+ break;
+ // ch1 mashing stats
+ case 3:
+ global.tadytext_mode = global.tadytext_mode ? false : true;
+ break;
+ // tadytext
+ case 4:
+ global.mash_practice_mode = global.mash_practice_mode ? false : true;
+ break;
}
- break
- case #OPTION_STATE.features:
- // can get id based on index because we're drawing based on that order
- var feature_name = global.feature_info[i * global.feature_info_group_length]
- current_feature = feature_name
- current_feature_index = i
- get_single_feature_options(feature_name, i)
- break
- case #OPTION_STATE.single_feature:
- // show info
- if (i == 0)
+ get_practice_mode_mod_options();
+ break;
+ case "rng_settings":
+ // susie death
+ if (i == 0)
+ {
+ update_rng_value("susie_death", read_rng_value("susie_death") ? false : true);
+ }
+ // spelling bee
+ else if (i == 1)
+ {
+ update_rng_value("spelling_bee", read_rng_value("spelling_bee") ? false : true);
+ }
+ get_rng_settings_mod_options();
+ break;
+ case "debug_keybinds":
+ // reset all keybinds
+ if (i == 0)
+ {
+ set_all_debug_keybinds_default();
+ get_debug_keybinds_mod_options();
+ }
+ else
+ {
+ // - 1 to discount the first one which is reset all keybinds
+ get_single_debug_keybind_mod_options(i - 1);
+ }
+ break;
+ case "debug_keybind":
+ // Change state
+ if (i == 1)
+ {
+ var keybinds = get_debug_keybinds();
+ var name = keybinds[current_keybind_index]
+ var cur_state = get_debug_keybind_state(name);
+ if (cur_state == "debug")
+ {
+ set_debug_keybind_state(name, false);
+ }
+ else if (cur_state)
+ {
+ set_debug_keybind_state(name, "debug");
+ }
+ else
{
- // the + 3 is to access the information about feature
- var feature_info = global.feature_info[current_feature_index * global.feature_info_group_length + global.feature_info_info_index]
- show_message(feature_info)
+ set_debug_keybind_state(name, true);
}
- // toggle feature state
- else if (i == 1)
+ get_single_debug_keybind_mod_options(current_keybind_index);
+ }
+ // listen for keybind
+ else if (i == 2)
+ {
+ setting_keybind = true;
+ get_single_debug_keybind_mod_options(current_keybind_index);
+ }
+ break;
+ case "other_keybinds":
+ if (i == 0)
+ {
+ reset_all_other_keybinds_default();
+ get_misc_keybinds_mod_options();
+ }
+ else
+ {
+ get_misc_keybinds_mod_options(i);
+ }
+ break;
+ case "game_flags":
+ if (loaded_savefile())
+ {
+ switch (i)
{
- var feature_map = read_json_value(global.player_options, "feature-options")
- var current_value = read_json_value(feature_map, current_feature)
- switch (current_value)
+ // items
+ case 0:
+ get_item_selector();
+ break;
+ // party selector
+ case 1:
+ get_party_selector_mod_options();
+ break;
+ // plot warp
+ case 2:
+ get_plot_warp_mod_options();
+ break;
+ // snowgrave plot
+ case 3:
+ get_snowgrave_plot_mod_options();
+ break;
+ }
+ }
+ break;
+ case "item_selector_intro":
+ switch (i)
+ {
+ // weapons
+ case 0:
+ get_weapons_selector_mod_options();
+ break;
+ case 1:
+ get_armors_selector_mod_options();
+ break;
+ case 2:
+ get_consumables_selector_mod_options();
+ break;
+ }
+ break;
+ case "weapon_selector":
+ var weapons = get_weapon_ids();
+ get_weapon_any_chapter(weapons[i]);
+ break;
+ case "armor_selector":
+ var armors = get_armor_ids();
+ get_armor_any_chapter(armors[i]);
+ break;
+ case "consumable_selector":
+ var consumables = get_consumable_ids();
+ get_consumable_any_chapter(consumables[i]);
+ break;
+ case "party_selector":
+ switch (i)
+ {
+ // kris
+ case 0:
+ build_party_from_options(create_array());
+ break;
+ // kris + susie
+ case 1:
+ build_party_from_options(create_array("susie"));
+ break;
+ // kris + ralsei
+ case 2:
+ build_party_from_options(create_array("ralsei"));
+ break;
+ // kris + susie + ralsei
+ case 3:
+ build_party_from_options(create_array("susie", "ralsei"));
+ break;
+ // kris + noelle
+ case 4:
+ build_party_from_options(create_array("noelle"));
+ break;
+ // custom
+ case 5:
+ var member2 = get_user_input_character(2);
+ var member3 = get_user_input_character(3);
+
+ var party;
+ var cur = 0;
+ if (member2 != "")
+ {
+ party[cur] = member2;
+ cur++;
+ }
+ if (member3 != "")
{
- case #FEATURE_STATE.never:
- current_value = #FEATURE_STATE.debug
- break
- case #FEATURE_STATE.debug:
- current_value = #FEATURE_STATE.always
- break
- case #FEATURE_STATE.always:
- current_value = #FEATURE_STATE.never
- break
+ party[cur] = member3;
+ cur++;
}
- ds_map_set(feature_map, current_feature, current_value)
- save_player_options()
- get_single_feature_options(current_feature, current_feature_index)
+ build_party_from_options(party);
+ break;
+ }
+ close_mod_options();
+ break;
+ case "plot_warp":
+ var ch = get_current_chapter();
+ if (ch == 1)
+ {
+ switch (i)
+ {
+ case 0:
+ plotwarp("ch1_wake_up");
+ break;
+ case 1:
+ plotwarp("field_start");
+ break;
+ case 2:
+ plotwarp("checkerboard_start");
+ break;
+ case 3:
+ plotwarp("forest_start");
+ break;
+ case 4:
+ plotwarp("post_vs_lancer");
+ break;
+ case 5:
+ plotwarp("post_escape");
+ break;
+ case 6:
+ plotwarp("king");
+ break;
}
- // keybinds, if any exist, are dinamically created
- else
+ }
+ else if (ch == 2)
+ {
+ switch (i)
{
- var keybind_array = global.feature_info[current_feature_index * global.feature_info_group_length + global.feature_info_keybinds_index]
- // 2 just to account the first two buttons
- // couldn't fint a way to make this magic number be more dynamic
- current_keybind = keybind_array[i - 2]
- get_keybind_assign_options(current_keybind)
+ case 0:
+ plotwarp("post_arcade");
+ break;
+ case 1:
+ plotwarp("city_start");
+ break;
+ case 2:
+ plotwarp("city_dj_save");
+ break;
+ case 3:
+ plotwarp("city_post_berdly");
+ break;
+ case 4:
+ plotwarp("mansion_start");
+ break;
+ case 5:
+ plotwarp("acid_lake_start");
+ break;
+ case 6:
+ plotwarp("acid_lake_exit");
+ break;
}
- break
- case #OPTION_STATE.ui_colors:
+ }
+ break;
+ case "snowgrave_plot":
+#if DEMO
+ if (instance_exists(obj_mainchara) && global.chapter == 2)
+ {
+ set_snowgrave_plot(i + 1);
+ close_mod_options();
+ }
+#endif
+ break;
+ case "warp_selector":
+ if (get_current_chapter() != 0)
+ {
+ switch (i)
+ {
+ case 0: // battle room
+ warp_to_battleroom();
+ close_mod_options();
+ break;
+ case 1: // search room
+ get_room_warp_mod_options();
+ break;
+ }
+ }
+ break;
+ case "room_warp":
+ // first button is typing field
+ if (i != 0)
+ {
+ var room_id = asset_get_index(button_text[i]);
+ // shouldnt be possible to not have a proper room name
+ if (room_id > -1)
+ {
+ room_goto(room_id);
+ close_mod_options();
+ }
+ }
+ break;
+ case "uicolors":
current_ui_element = i
get_color_picker_options()
break
- case #OPTION_STATE.color_picker:
+ case "colorpicker":
switch (i)
{
- case #COLOR_PICKER_OPTION.rgb:
+ case 0: // rgb
red = get_integer("Enter red value (0 - 255)", "")
if (!validate_rgb_color(red))
{
@@ -354,7 +738,7 @@ for (var i = 0; i < button_amount; i++)
}
set_ui_color(current_ui_element, make_colour_rgb(red, green, blue))
break
- case #COLOR_PICKER_OPTION.hex:
+ case 1: // hex
hex = get_string("Enter hex value (000000 - FFFFFF)", "")
if (validate_hex_color(hex))
{
@@ -365,66 +749,93 @@ for (var i = 0; i < button_amount; i++)
}
break
- case #OPTION_STATE.saves:
- var clicked_value = button_text[i]
- var folder_pos = string_pos("[FOLDER]", clicked_value)
- if (folder_pos > 0)
- {
- load_save_buttons(get_save_dir(true) + string_copy(clicked_value, 1, folder_pos - 2))
- }
- var file_pos = string_pos("[FILE]", clicked_value)
- if (file_pos > 0)
+ case "savebrowse":
+ // first button only shows current folder
+ if (i != 0)
{
- var file_to_load = get_save_dir(true) + string_copy(clicked_value, 1, file_pos - 2);
-#if SURVEY_PROGRAM
- scr_load(file_to_load);
-#else
- if (!instance_exists(obj_time) && !instance_exists(obj_time_ch1))
+ var clicked_value = button_text[i]
+ var cur_dir = button_text[0];
+ var folder_pos = string_pos("[FOLDER]", clicked_value)
+ if (folder_pos > 0)
{
- show_message("Pick a chapter first!")
+ load_save_buttons(cur_dir + string_copy(clicked_value, 1, folder_pos - 2) + "/")
}
- else
+ var file_pos = string_pos("[FILE]", clicked_value)
+ if (file_pos > 0)
{
- if (global.chapter == 1)
+ // index 0 contains the folder
+ var file_to_load = get_save_dir(true) + cur_dir + "/" + string_copy(clicked_value, 1, file_pos - 2);
+ close_mod_options();
+#if SURVEY_PROGRAM
+ scr_load(file_to_load);
+#else
+ if (!instance_exists(obj_time) && !instance_exists(obj_time_ch1))
{
- scr_load_ch1(file_to_load);
+ show_message("Pick a chapter first!")
}
else
{
- scr_load(file_to_load);
+ if (global.chapter == 1)
+ {
+ scr_load_ch1(file_to_load);
+ }
+ else
+ {
+ scr_load(file_to_load);
+ }
}
- }
#endif
+ }
}
break
+ case "miscoptions":
+ var options = get_options();
+ var name = options[i];
+ var state = read_option_value(name);
+ if (state == "debug")
+ {
+ state = true;
+ }
+ else if (state == true)
+ {
+ state = false;
+ }
+ else
+ {
+ state = "debug";
+ }
+ set_option_value(name, state);
+ get_misc_options_mod_options();
+ break;
}
}
}
else
- button_state[i] = #BUTTON_STATE.hover
+ button_state[i] = "hover"
}
- else if (options_state == #OPTION_STATE.splits && i == obj_IGT.current_split)
+ else if (options_state == "pick_split_preset" && i == get_current_preset())
{
- button_state[i] = #BUTTON_STATE.highlight
+ button_state[i] = "highlight"
}
else
{
- button_state[i] = #BUTTON_STATE.none
+ button_state[i] = "none"
}
- if (button_state[i] == #BUTTON_STATE.hover)
+ if (button_state[i] == "hover")
{
draw_set_color(read_ui_color("button-hover"))
+ menu_hover_desc = hover_desc[i];
}
- else if (button_state[i] == #BUTTON_STATE.press)
+ else if (button_state[i] == "press")
{
draw_set_color(read_ui_color("button-press"))
}
- else if (button_state[i] == #BUTTON_STATE.none)
+ else if (button_state[i] == "none")
{
draw_set_color(read_ui_color("button"))
}
- else if (button_state[i] == #BUTTON_STATE.highlight)
+ else if (button_state[i] == "highlight")
{
draw_set_color(read_ui_color("button-highlight"))
}
@@ -432,8 +843,19 @@ for (var i = 0; i < button_amount; i++)
draw_set_color(read_ui_color("button-press"))
draw_rectangle(button_start_x, button_start_y, button_end_x, button_end_y, true)
draw_set_color(read_ui_color("text"))
- draw_text(button_start_x + 5, button_start_y + 5, button_text[i])
+ var enumeration_text = use_enumeration ? string(i + 1) + " - " : "";
+ draw_text(button_start_x + 5, button_start_y + 5, enumeration_text + button_text[i])
}
+
+// menu description rendering
+draw_set_color(read_ui_color("background"));
+draw_rectangle(0, 0, view_width, menu_desc_height, false);
+draw_rectangle(0, hover_desc_start_y, view_width, view_height, false);
+menu_desc_padding = 5;
+draw_set_color(read_ui_color("text"));
+draw_text(menu_desc_padding, menu_desc_padding, menu_desc);
+draw_text(menu_desc_padding, menu_desc_padding + hover_desc_start_y, menu_hover_desc);
+
draw_sprite(
#if DEMO
spr_maus_cursor
diff --git a/src/mod/all_chapters/option_menu/obj_options_watcher_Create_0.gml b/src/mod/all_chapters/option_menu/obj_options_watcher_Create_0.gml
deleted file mode 100644
index 0b99f51..0000000
--- a/src/mod/all_chapters/option_menu/obj_options_watcher_Create_0.gml
+++ /dev/null
@@ -1,3 +0,0 @@
-/// IMPORT
-
-options_exists = false
\ No newline at end of file
diff --git a/src/mod/all_chapters/option_menu/obj_options_watcher_Step_0.gml b/src/mod/all_chapters/option_menu/obj_options_watcher_Step_0.gml
index 82a09d9..adf9e15 100644
--- a/src/mod/all_chapters/option_menu/obj_options_watcher_Step_0.gml
+++ b/src/mod/all_chapters/option_menu/obj_options_watcher_Step_0.gml
@@ -9,17 +9,13 @@ if
#endif
)
{
- if (options_exists)
+ if (instance_exists(obj_mod_options))
{
- // edge case covering: keybinds are turned off when picking a new key, but if we are closing the menu without setting anything it just wont give the keybinds back, so this is just in case
- global.are_keybinds_on = true
-
- options_exists = false
- instance_destroy(obj_mod_options)
+ close_mod_options();
}
else
{
- options_exists = true
+ global.debug_keybinds_on = false;
instance_create_depth(0, 0, -100000, obj_mod_options)
}
}
\ No newline at end of file
diff --git a/src/mod/all_chapters/option_menu/option_menu.gml b/src/mod/all_chapters/option_menu/option_menu.gml
index da4f8e3..52a7152 100644
--- a/src/mod/all_chapters/option_menu/option_menu.gml
+++ b/src/mod/all_chapters/option_menu/option_menu.gml
@@ -80,36 +80,25 @@ function get_key_name(argument0)
}
}
-/*
-Get general player options
-*/
-function get_player_options()
-{
- get_buttons_from_pair_array
- (
- #GENERAL_OPTION.ui_colors, "UI Colors"
- )
-
- options_state = #OPTION_STATE.general_options
-}
-
/*
Get options for which UI element to set the color
*/
function get_ui_colors_options()
{
- get_buttons_from_pair_array
- (
- #UI_ELEMENT.background, "Background Color",
- #UI_ELEMENT.text, "Text Color",
- #UI_ELEMENT.button, "Button Color",
- #UI_ELEMENT.border, "Border Color",
- #UI_ELEMENT.button_hover, "Button Hover Color",
- #UI_ELEMENT.button_press, "Button Press Color",
- #UI_ELEMENT.button_highlight, "Button Highlight Color"
- )
-
- options_state = #OPTION_STATE.ui_colors
+ get_buttons_from_array(
+ "Background Color",
+ "Text Color",
+ "Button Color",
+ "Border Color",
+ "Button Hover Color",
+ "Button Press Color",
+ "Button Highlight Color",
+ "Scrollbar"
+ );
+
+ menu_desc = "Choose the interface element you would like to change the color of";
+ use_enumeration = true;
+ options_state = "uicolors"
}
/*
@@ -117,13 +106,14 @@ Get options for picking a color
*/
function get_color_picker_options()
{
- get_buttons_from_pair_array
- (
- #COLOR_PICKER_OPTION.rgb, "Get color from RGB",
- #COLOR_PICKER_OPTION.hex, "Get color from HEX value"
- )
-
- options_state = #OPTION_STATE.color_picker
+ get_buttons_from_array(
+ "Get color from RGB",
+ "Get color from HEX value"
+ );
+
+ menu_desc = "Pick the method for selecting the color"
+ use_enumeration = false;
+ options_state = "colorpicker";
}
/*
@@ -173,213 +163,626 @@ function validate_hex_color(color)
return true
}
-function get_split_assign_options(argument0)
-{
- var split_id = argument0
- selected_split = split_id
-
- start_room = 0
- split_count = 0
- // switch (split_id)
- // {
- // // case global.SPLIT_chapter_one:
- // // start_room = PLACE_CONTACT_ch1
- // // split_count = 7
- // // break
- // // case global.SPLIT_castle_town:
- // // start_room = PLACE_CONTACT_ch1
- // // split_count = 3
- // // break
- // case global.SPLIT_field_hopes_dreams:
- // start_room = room_field_start_ch1
- // split_count = 3
- // break
- // case global.SPLIT_checkerboard:
- // start_room = room_field_checkers4_ch1
- // split_count = 1
- // break
- // case global.SPLIT_forest:
- // start_room = room_forest_savepoint1_ch1
- // split_count = 3
- // break
- // case global.SPLIT_escape_castle:
- // start_room = room_forest_afterthrash2_ch1
- // split_count = 1
- // break
- // case global.SPLIT_castle_and_king:
- // start_room = room_cc_prisonlancer_ch1
- // split_count = 4
- // break
- // case global.SPLIT_chapter_two:
- // start_room = -1
- // split_count = 9
- // break
- // case global.SPLIT_cyber_field:
- // start_room = -1
- // split_count = 5
- // break
- // case global.SPLIT_city_one:
- // start_room = room_dw_city_intro
- // split_count = 4
- // break
- // case global.SPLIT_city_heights:
- // start_room = room_dw_city_traffic_4
- // split_count = 3
- // break
- // case global.SPLIT_mansion:
- // start_room = room_dw_mansion_krisroom
- // split_count = 4
- // break
- // case global.SPLIT_acid_lake:
- // start_room = room_dw_mansion_acid_tunnel
- // split_count = 2
- // break
- // case global.SPLIT_queen_and_giga:
- // start_room = room_dw_mansion_acid_tunnel_exit
- // split_count = 3
- // break
- // }
-
- var instructions = read_json_value(global.splits_json, split_id, "instructions")
- var start_instruction = read_json_value(instructions, 0)
- split_count = ds_map_size(instructions) - 1
- button_amount = 3
- button_text[0] = "Timer will start" + get_name_from_instruction(start_instruction)
- button_text[1] = "Warp"
- button_text[2] = selected_split == obj_IGT.current_split ? "Split Selected" : "Set current split"
-
- options_state = #OPTION_STATE.split_assign
-}
-
-function get_split_mod_options()
-{
- button_amount = ds_map_size(global.splits_json)
+function get_default_mod_options()
+{
+ var debug_state = global.debug ? "ON" : "OFF";
+
+ get_buttons_from_pair_array(
+ "Debug Mode [" + debug_state + "]", "Debug mode will enable some helpful features and the keybinds assigned to debug mode\nClick to turn on/off",
+ "Timer", "The in-game timer is a helpful tool to automatically time how fast you go\nClick to configure it",
+ "Practice Modes", "Click to check and activate various practice modes",
+ "RNG Settings", "RNG stands for Random Number Generator, the speedrunner's jargon for luck\nHere you can force certain RNG elements to be always the same",
+ "Debug Keybinds", "Various keybinds which will perform useful things for practice\nClick to see/change them",
+ "Other Keybinds", "Miscellaneous keybinds or shortcuts\nClick to see/change them",
+ "Misc Options", "Mod options you can toggle that don't fit anywhere else in this menu",
+ "Game Data", "Item giver, plot warper, party selector",
+ "Room Warps", "Allows teleporting to rooms",
+ "Saves", "Allows quickly loading savefiles that you have saved\nRequires some external setup (Click to learn)",
+ "UI Colors", "Change the color of the UI (User Interface) elements of this menu"
+ );
+
+ menu_desc = "Welcome to the Keucher Mod OPTIONS\nClick on buttons to explore or change settings\nHover over the buttons to get a summary of what they do"
+ use_enumeration = true;
+ options_state = "default";
+}
+
+function get_buttons_from_array()
+{
+ button_amount = argument_count
+ for (var i = 0; i < argument_count; i++)
+ {
+ button_text[i] = argument[i]
+ hover_desc[i] = "";
+ }
+}
+
+/* Create N buttons with a 2 * N element array where even indexes are the button text and odd indexes are the button desc */
+function get_buttons_from_pair_array()
+{
+ if (argument_count % 2 == 1)
+ {
+ show_message("Supplied ODD number of elements in pair array");
+ e += "crash";
+ }
+ button_amount = int64(argument_count / 2);
for (var i = 0; i < button_amount; i++)
{
- button_text[i] = read_json_value(global.splits_json, i, "name")
+ button_text[i] = argument[i * 2];
+ hover_desc[i] = argument[i * 2 + 1];
}
+}
- options_state = #OPTION_STATE.splits
+function get_timer_mod_options()
+{
+ var timer = read_config_value("timer_on") ? "ON" : "OFF";
+ var mode = get_timer_mode();
+ if (mode == "battle")
+ {
+ mode = "BATTLE";
+ }
+ else if (mode == "segment")
+ {
+ mode = "SEGMENT-BY-SEGMENT";
+ }
+ else if (mode == "splits")
+ {
+ mode = "SPLITS";
+ }
+
+ get_buttons_from_pair_array(
+ "Timer [" + timer + "]", "Click to turn the timer on/off",
+ "Timer Mode [" + mode + "]", "The current timer mode\nClick to change it",
+ "Segment-by-segment Options", "Click to configure how the segment-by-segment timer works",
+ "Split Preset Options", "Click to open the split presets menu",
+ "Timer Precision", "Click to change the number of decimal places the timer displays"
+ );
+
+ menu_desc = "Here, you can customize how the timer works"
+ use_enumeration = false;
+ options_state = "timer";
+}
+
+function get_timer_mode_mod_options()
+{
+ get_buttons_from_pair_array(
+ "Segment-by-Segment", "In this mode, the timer only displays a singular time, which updates in segments\nYou can configure when exactly the timer updates in the previous menu",
+ "Battle", "In this mode, the timer will show detailed information while in battles, including TP information",
+ "Splits", "In this mode, the timer load the split preset you have configured, which will split at each segment\nIt will make the timer behave more like \"Livesplit\""
+ );
+
+ menu_desc = "Choose the way in which the timer operates";
+ use_enumeration = false;
+ options_state = "timer_mode";
}
-/* Get an array that lists all the keybinds assigned to a specific key code */
-function get_keybinds_assigned(key)
+function get_timer_segment_mod_options()
{
- var keybinds_using;
- var keybinds = get_keybinds();
- var len = array_length_1d(keybinds);
- var found_conflict = false;
- var j = 0;
- for(var i = 0; i < len; i++)
+ var room_by_room = get_segment_room_status() ? "ON" : "OFF";
+ var battle = get_segment_battle_status() ? "ON" : "OFF";
+
+ var special_instructions = get_all_special_instructions();
+
+ button_amount = array_length(special_instructions) + 2;
+ button_text[0] = "Room-by-Room [" + room_by_room + "]";
+ hover_desc[0] = "";
+ button_text[1] = "Start and end of battles [" + battle + "]";
+ hover_desc[1] = "";
+
+ for (var i = 2; i < button_amount; i++)
{
- var keybind = keybinds[i];
- var value = read_json_value(global.mod_keybinds, real(keybind));
- if (value == key)
- {
- found_conflict = true;
- keybinds_using[j] = keybind;
- j++;
- }
+ var instruction = special_instructions[i - 2];
+ var state = get_segment_special_status(instruction) ? "ON" : "OFF";
+ button_text[i] = get_special_instruction_name(instruction) + " [" + state + "]";
+ hover_desc[i] = "";
}
- if (found_conflict)
+ menu_desc = "Here you can choose what will update the segment-by-segment timer";
+ use_enumeration = false;
+ options_state = "timer_segment";
+}
+
+function get_split_preset_mod_options()
+{
+ var cur_preset = get_current_preset();
+ var name;
+ if (cur_preset == -1)
{
- return keybinds_using;
+ name = "None Selected";
}
else
{
- return create_array();
+ name = read_json_value(global.presets, cur_preset, "name");
}
+
+ get_buttons_from_pair_array(
+ "Current Preset [" + name + "]", "The currently selected preset",
+ "Pick Preset", "Click to pick what preset to use\nMust create presets first",
+ "Create Preset", "Click to create a new split preset"
+ );
+
+ menu_desc = "Here you can configure split presets, which are what splits will be used while in the splits timer\nmode";
+ use_enumeration = false;
+ options_state = "timer_preset_options";
}
-/* Get an array with all the keybind indexes */
-function get_keybinds()
+function get_pick_preset_mod_options()
{
-#if SURVEY_PROGRAM
- // SP doesn't have `ds_map_keys_to_array`
- var keybinds;
- var key = ds_map_find_first(global.keybinding_info)
- for (var i = 0; key != undefined; i++)
+ button_amount = ds_map_size(global.presets);
+ for (var i = 0; i < button_amount; i++)
{
- keybinds[i] = key
- key = ds_map_find_next(global.keybinding_info, key)
+ button_text[i] = read_json_value(global.presets, i, "name");
+ hover_desc[i] = "";
}
-#else
- var keybinds = ds_map_keys_to_array(global.keybinding_info)
-#endif
- return keybinds
+
+ menu_desc = "Click to select a new split preset";
+ use_enumeration = false;
+ options_state = "pick_split_preset";
}
-/*
-This initialies the values of the keybinds, and sets them to their default values if they don't exist.
-*/
-function init_keybinds()
+function get_create_preset_mod_options()
{
- // this variable keeps track of whether or not keybinds are turned on. it is useful to turn them off in some special occasions
- global.are_keybinds_on = true
-
- // setting up keybinds
- global.mod_keybinds = scr_84_load_map_json("keucher_mod/keybinds.json")
- // definitions for the default are found in keybinding_info
+ var name = undefined
+ var splits = undefined
+ var name_text = "Pick a name for this preset"
- var keybinds = get_keybinds()
- var keybind_count = array_length_1d(keybinds)
- if (ds_map_empty(global.mod_keybinds))
+ if (!is_undefined(global.current_created_preset))
{
- for (var i = 0; i < keybind_count; i++)
+ var name = read_json_value(global.current_created_preset, "name")
+ var instructions = read_json_value(global.current_created_preset, "instructions")
+ if (!is_undefined(name))
{
- var keybind_index = keybinds[i]
- var keybind_info = read_json_value(global.keybinding_info, keybind_index)
- var default_value = read_json_value(keybind_info, "default")
- ds_map_add(global.mod_keybinds, keybind_index, default_value)
+ name_text = "Preset Name: [" + name + "]"
+ }
+ if (!is_undefined(instructions))
+ {
+ splits = instructions
}
}
else
{
- // check if any new keybinds are added
- for (var i = 0; i < keybind_count; i++)
+ global.current_created_preset = ds_map_create()
+ ds_map_add_map(global.current_created_preset, "instructions", ds_map_create())
+ }
+
+ obj_mod_options.button_text[0] = "Reset Preset"
+ hover_desc[0] = "Click to undo everything and go back to scratch";
+ obj_mod_options.button_text[1] = "Create This Preset";
+ hover_desc[1] = "Click to finish creating this preset with the settings picked!\nTo create, you must have at least two split points (start, and end)";
+ obj_mod_options.button_text[2] = name_text
+ hover_desc[2] = "Choose what this split preset should be named";
+ obj_mod_options.button_text[3] = "Add a new split to the preset";
+ hover_desc[3] = "Click to choose a new split point for this preset";
+ obj_mod_options.button_amount = 4
+ if (!is_undefined(splits))
+ {
+ var split_count = ds_map_size(splits)
+ obj_mod_options.button_amount += split_count
+ for (var i = 0; i < split_count; i ++)
{
- var keybind_index = keybinds[i]
- var keybind_info = read_json_value(global.mod_keybinds, keybind_index)
- if (keybind_info == undefined)
- {
- var default_value = read_json_value(global.keybinding_info, keybind_index, "default")
- ds_map_add(global.mod_keybinds, keybind_index, default_value)
- }
+ var instruction = read_json_value(splits, i)
+ var split_text = ""
+ if (i == 0) split_text = "Start: "
+ else if (i == split_count - 1) split_text = "End: "
+ else split_text = "Split " + string(i) + ": "
+ obj_mod_options.button_text[i + 4] = split_text + get_instruction_name(instruction)
}
}
- save_keybinds()
+ menu_desc = "In this menu you may create a new split preset";
+ use_enumeration = false;
+ obj_mod_options.options_state = "create_split_preset";
+}
- // save keybinds will make all arguments string, which is what we want, so load them again instead of converting them before
- global.mod_keybinds = scr_84_load_map_json("keucher_mod/keybinds.json")
+function get_split_pick_mod_options()
+{
+ get_buttons_from_pair_array(
+ "Rooms", "Choose a room to split",
+ "Events", "Choose from the list of special events to split"
+ );
+
+ menu_desc = "Choose the category you would like to pick the split point from";
+ use_enumeration = false;
+ options_state = "pick_split_1";
}
-function save_keybinds()
+function get_room_splits_mod_options()
{
- save_json("keucher_mod/keybinds.json", global.mod_keybinds)
+ get_buttons_from_array(
+ "Chapter 1",
+ "Chapter 2"
+ );
+
+ menu_desc = "Choose which chapter the room is from\nRooms in both Chapters (like Kris' room) must be picked from a specific chapter";
+ use_enumeration = false;
+ options_state = "pick_room_chapter";
}
-function get_default_mod_options()
+function get_rooms_in_chapter_mod_options(chapter)
+{
+ global.picking_room_from_chapter = chapter;
+ var rooms = get_chapter_rooms(chapter);
+ button_amount = array_length(rooms);
+ for (var i = 0; i < button_amount; i++)
+ {
+ button_text[i] = get_descriptive_room_name(chapter, rooms[i]);
+ hover_desc[i] = "";
+ }
+ menu_desc = "Choose which of these rooms will be in the preset next";
+ use_enumeration = true;
+ options_state = "pick_split_room";
+}
+
+function get_event_splits_mod_options()
+{
+ var events = get_all_special_instructions();
+ button_amount = array_length(events);
+ for (var i = 0; i < button_amount; i++)
+ {
+ button_text[i] = get_special_instruction_name(events[i]);
+ hover_desc[i] = "";
+ }
+
+ menu_desc = "Choose which of these events will be in the preset next";
+ use_enumeration = true;
+ options_state = "pick_split_event";
+}
+
+function get_practice_mode_mod_options()
+{
+ var boss_state = global.bossPractice ? "ON" : "OFF";
+ var crit_state = global.ambyu_practice ? "ON" : "OFF";
+ var rouxls_state = global.rurus_random ? "OFF" : "ON";
+ var ch1_mash_state = global.mash_practice_mode ? "ON" : "OFF";
+ var tady_state = global.tadytext_mode ? "ON" : "OFF";
+
+ get_buttons_from_pair_array(
+ "Boss Practice [" + boss_state + "]", "In this mode, you can practice each attack from the following bosses: King, Jevil, Queen, Spamton NEO\nCheck \"Other Keybinds\" for the keybinds",
+ "Crit Practice [" + crit_state + "]", "When fighting the first monster in the battle room, you can practice crits\nCheck \"Other Keybinds\" for the keybinds and \"Room Warps\" for battle room",
+ "Rouxls Practice [" + rouxls_state + "]", "Chooses the Rouxls house pattern\nCheck \"Other Keybinds\" for the keybinds",
+ "TadyText Practice [" + tady_state + "]", "Displays information for TadyText\nPlease check the README for information on this mode as it is complex",
+ "Chapter 1 Mashing Stats [" + ch1_mash_state + "]", "Displays your mashing stats in Chapter 1"
+ );
+
+ menu_desc = "Turn on/off various practice modes here\nHover for specific info on each mode";
+ use_enumeration = true;
+ options_state = "practice_modes";
+}
+
+function get_rng_settings_mod_options()
+{
+ var susie_state = read_rng_value("susie_death") ? "ON" : "OFF";
+ var spelling_state = read_rng_value("spelling_bee") ? "ON" : "OFF";
+
+ get_buttons_from_array(
+ "Susie always targeted in K. Round [" + susie_state + "]",
+ "Always optimal spelling bee word (language sensitive) [" + spelling_state +"]"
+ );
+
+ menu_desc = "Click each button to turn on/off a RNG setting"
+ use_enumeration = true;
+ options_state = "rng_settings";
+}
+
+function get_descriptive_debug_keybind_key(name)
+{
+ return get_key_name(get_debug_keybind_key(name));
+}
+
+function get_descriptive_debug_keybind_state(name)
{
- get_buttons_from_pair_array
- (
- #DEFAULT_OPTION.feature, "Configure features",
- #DEFAULT_OPTION.current_split, "Set current split",
- #DEFAULT_OPTION.create_split, "Create a new split",
- #DEFAULT_OPTION.timer_precision, "Set timer precision",
- #DEFAULT_OPTION.options, "General Options",
- #DEFAULT_OPTION.saves, "Saves"
- )
+ var state = get_debug_keybind_state(name);
+ if (state == "debug")
+ {
+ return "DEBUG";
+ }
- options_state = #OPTION_STATE.default_state
+ return state ? "ON" : "OFF";
}
-function get_buttons_from_pair_array()
+function get_debug_keybinds_mod_options()
+{
+ var keybinds = get_debug_keybinds();
+ button_amount = array_length(keybinds) + 1;
+
+ button_text[0] = "Reset Default Keybinds";
+ hover_desc[0] = "Click to reset all keybinds to default";
+
+ for (var i = 1; i < button_amount; i++)
+ {
+ var name = keybinds[i - 1];
+ var key = get_descriptive_debug_keybind_key(name);
+ var state = get_descriptive_debug_keybind_state(name);
+ button_text[i] = get_debug_keybind_descriptive_name(name) + " [State: " + state + "] [Key: " + key + "]";
+ hover_desc[i] = get_debug_keybind_description(name);
+ }
+
+ menu_desc = "Hover on buttons for info on each keybind\nClick on them to configure when the keybinds should work";
+ use_enumeration = true;
+ options_state = "debug_keybinds";
+}
+
+function get_single_debug_keybind_mod_options(key_index)
{
- button_amount = argument_count / 2
- for (var i = 0; i < argument_count; i+= 2)
+ var keybinds = get_debug_keybinds();
+ var name = keybinds[key_index];
+ var key = get_descriptive_debug_keybind_key(name);
+ var state = get_descriptive_debug_keybind_state(name);
+
+ var key_text = setting_keybind ? "Listening for input..." : "Key: [" + key + "]";
+
+ get_buttons_from_pair_array(
+ "\"" + get_debug_keybind_descriptive_name(name) + "\"", "",
+ "State: [" + state + "]", "Change when the key is available. If ON, it is always available, OFF is always unavailable\nDEBUG is only if Debug Mode is on",
+ key_text, "Click to update the value of this keybind"
+ );
+
+ menu_desc = "Here you can change this keybind and change when it is enabled";
+ current_keybind_index = key_index;
+ use_enumeration = true;
+ options_state = "debug_keybind";
+}
+
+// this listening index is not in the keybind array, but of the button
+function get_misc_keybinds_mod_options(listening_index)
+{
+ var keybinds = get_other_keybinds();
+ button_amount = array_length(keybinds) + 1;
+
+ button_text[0] = "Reset Default Keybinds";
+ hover_desc[0] = "Click to reset all keybinds to default";
+
+ for (var i = 1; i < button_amount; i++)
+ {
+ var name = keybinds[i - 1];
+ var desc = get_other_keybind_descriptive_name(name);
+ var key = get_key_name(read_config_value("other_keybind_" + name));
+ if (listening_index == i)
+ {
+ button_text[i] = desc + ": Listening for input...";
+ current_keybind_index = listening_index - 1;
+ setting_keybind = true;
+ setting_debug = false;
+ }
+ else
+ {
+ button_text[i] = desc + " [" + key + "]";
+ }
+ hover_desc[i] = "";
+ }
+
+ menu_desc = "Here you can see all the miscellaneous keybinds\nClick on them to change their value";
+ use_enumeration = true;
+ options_state = "other_keybinds";
+}
+
+function get_game_flags_mod_optins()
+{
+ if (loaded_savefile())
+ {
+ get_buttons_from_array(
+ "Item Selector",
+ "Party Selector",
+ "Plot Warp",
+ "Snowgrave Plot Setter"
+ );
+ menu_desc = "Click on the specific data manipulator";
+ }
+ else
{
- button_text[argument[i]] = argument[i + 1]
+ get_buttons_from_array();
+ menu_desc = "You must load a savefile to edit game data!";
}
+
+ use_enumeration = false;
+ options_state = "game_flags";
+}
+
+function get_item_selector()
+{
+ get_buttons_from_array(
+ "Weapons",
+ "Armor",
+ "Consumable"
+ );
+
+ menu_desc = "Pick the category of item to select";
+ use_enumeration = false;
+ options_state = "item_selector_intro";
+}
+
+function get_weapons_selector_mod_options()
+{
+ var weapons = get_weapon_ids();
+ var size = array_length(weapons);
+
+ button_amount = size;
+
+ for (var i = 0; i < size; i++)
+ {
+ button_text[i] = get_weapon_name(weapons[i]);
+ hover_desc[i] = "";
+ }
+
+ menu_desc = "Click the weapon to get it";
+ use_enumeration = false;
+ options_state = "weapon_selector";
+}
+
+function get_armors_selector_mod_options()
+{
+ var armors = get_armor_ids();
+ var size = array_length(armors);
+
+ button_amount = size;
+
+ for (var i = 0; i < size; i++)
+ {
+ button_text[i] = get_armor_name(armors[i]);
+ hover_desc[i] = "";
+ }
+
+ menu_desc = "Click the armor to get it";
+ use_enumeration = false;
+ options_state = "armor_selector";
+}
+
+function get_consumables_selector_mod_options()
+{
+ var consumables = get_consumable_ids();
+ var size = array_length(consumables);
+
+ button_amount = size;
+
+ for (var i = 0; i < size; i++)
+ {
+ button_text[i] = get_consumable_name(consumables[i]);
+ hover_desc[i] = "";
+ }
+
+ menu_desc = "Click the consumable to get it";
+ use_enumeration = false;
+ options_state = "consumable_selector";
+}
+
+function get_party_selector_mod_options()
+{
+ get_buttons_from_array(
+ "Kris",
+ "Kris + Susie",
+ "Kris + Ralsei",
+ "Kris + Susie + Ralsei",
+ "Kris + Noelle",
+ "Custom"
+ );
+
+ menu_desc = "Click what party you would like to have";
+ use_enumeration = false;
+ options_state = "party_selector";
+}
+
+function get_plot_warp_mod_options()
+{
+ var ch = get_current_chapter();
+ if (ch == 1)
+ {
+ get_buttons_from_pair_array(
+ "Chapter 1 Wake Up", "At the start of the Dark World",
+ "Field Start", "At the start of Field",
+ "Checkerboard Start", "At the start of Checkerboard",
+ "Forest Start", "At the start of Forest",
+ "Post Vs Lancer", "At the end of Forest",
+ "Post Escape", "After Susie rejoins party in Castle",
+ "King", "Before King fight"
+ );
+ }
+ else if (ch == 2)
+ {
+ get_buttons_from_pair_array(
+ "Post Arcade", "After the Punchout Arcade",
+ "City Start", "At the trash dump",
+ "City DJ Save", "In the bagel shop in city",
+ "City Post Berdly", "After Berdly 2 fight",
+ "Mansion Start", "After escaping Kris' room in mansion",
+ "Acid Lake Start", "Before acid tunnel",
+ "Acid Lake Exit", "After acid tunnel"
+ );
+ }
+
+ menu_desc = "Click in one of these options to warp to a certain moment in the game";
+ use_enumeration = true;
+ options_state = "plot_warp";
+}
+
+function get_snowgrave_plot_mod_options()
+{
+ if (!instance_exists(obj_mainchara) || global.chapter != 2)
+ {
+ get_buttons_from_array();
+ menu_desc = "You must be in Chapter 2 to set Snowgrave flags";
+ }
+ else
+ {
+ get_buttons_from_array(
+ "Default state (Before city)",
+ "Ready for Freeze Ring",
+ "After Forcefield",
+ "Berdly Frozen",
+ "After Rouxls Statue Scene",
+ "Before NEO"
+ );
+ menu_desc = "Click in one of these options to advance the Snowgrave progress";
+ }
+
+ use_enumeration = true;
+ options_state = "snowgrave_plot";
+}
+
+function get_warps_mod_options()
+{
+ if (get_current_chapter() == 0)
+ {
+ get_buttons_from_array();
+ menu_desc = "No room warping available in Chapter Select";
+ }
+ else
+ {
+ get_buttons_from_pair_array(
+ "Battle Test Warp", "Warps to the battle room\nIn the room you can choose what battle to confront",
+ "Room Search", "Search a room to warp to"
+ );
+ menu_desc = "Choose an option to warp to a room";
+ }
+
+ use_enumeration = false;
+ options_state = "warp_selector";
+}
+
+function get_room_warp_mod_options()
+{
+ room_results = search_room_by_substring(room_query);
+
+ button_amount = array_length(room_results) + 1;
+ button_text[0] = "[SEARCH ROOM]: " + room_query
+ hover_desc[0] = "";
+ for (var i = 0; i < button_amount - 1; i++)
+ {
+ button_text[i + 1] = room_results[i];
+ hover_desc[i] = "";
+ }
+
+ typing_room = true;
+ menu_desc = "Type to search for a room by its name";
+ use_enumeration = false;
+ options_state = "room_warp";
+}
+
+/* Proper way to close the mod options */
+function close_mod_options()
+{
+ if instance_exists(obj_mod_options)
+ {
+ instance_destroy(obj_mod_options);
+ global.debug_keybinds_on = true;
+ }
+}
+
+function get_misc_options_mod_options()
+{
+ var misc_options = get_options();
+ var size = array_length(misc_options);
+ button_amount = size;
+ for (var i = 0; i < size; i++)
+ {
+ var name = misc_options[i];
+ var state = read_option_value(name);
+ var state_text = state == "debug" ? "DEBUG" : (
+ state ? "ON" : "OFF"
+ );
+ button_text[i] = get_option_button_text(name) + " [" + state_text + "]";
+ hover_desc[i] = get_option_button_desc(name);
+ }
+
+ menu_desc = "Click on each option to change their availability from ON (always), OFF (never)\nDEBUG (if using debug mode)";
+ use_enumeration = true;
+ options_state = "miscoptions";
}
\ No newline at end of file
diff --git a/src/mod/all_chapters/party_selector/obj_darkcontroller_Create_0.gml b/src/mod/all_chapters/party_selector/obj_darkcontroller_Create_0.gml
index 9fbc600..db53811 100644
--- a/src/mod/all_chapters/party_selector/obj_darkcontroller_Create_0.gml
+++ b/src/mod/all_chapters/party_selector/obj_darkcontroller_Create_0.gml
@@ -1,9 +1,6 @@
/// PATCH .ignore ifndef DEMO
/// PREPEND
-// keeps track of the party members, using an arbitrary party ID system (check the switch statement)
-partystate = -1
-
// keeps track of how many times the party members have been changed
presscount = 0
diff --git a/src/mod/all_chapters/party_selector/obj_darkcontroller_SP_Create_0.gml b/src/mod/all_chapters/party_selector/obj_darkcontroller_SP_Create_0.gml
deleted file mode 100644
index c18bb18..0000000
--- a/src/mod/all_chapters/party_selector/obj_darkcontroller_SP_Create_0.gml
+++ /dev/null
@@ -1,7 +0,0 @@
-/// PATCH
-/// AFTER
-cur_jewel = 0
-/// CODE
-// id of the party member setting to be used
-partystate = -1
-/// END
\ No newline at end of file
diff --git a/src/mod/all_chapters/party_selector/obj_darkcontroller_SP_Step_0.gml b/src/mod/all_chapters/party_selector/obj_darkcontroller_SP_Step_0.gml
deleted file mode 100644
index d0c4e48..0000000
--- a/src/mod/all_chapters/party_selector/obj_darkcontroller_SP_Step_0.gml
+++ /dev/null
@@ -1,58 +0,0 @@
-/// PATCH
-// changing party in Ch1
-/// APPEND
-if pressed_active_feature_key(#KEYBINDING.change_party, "change-party")
-{
- var party_options = create_array
- (
- create_array("party: kris + susie + ralsei", 2, 3),
- create_array("party: kris + ralsei + susie", 3, 2),
- create_array("party: kris only"),
- create_array("party: kris + ralsei", 3),
- create_array("party: kris + susie", 2)
- )
-
- partystate = wrap_around(partystate + 1, 0, array_length(party_options) - 1)
-
- //destryoing previous party
-#if DEMO
- scr_losechar_ch1()
- if instance_exists(obj_caterpillarchara_ch1)
- {
- instance_destroy(obj_caterpillarchara_ch1)
- }
-#endif
-#if SURVEY_PROGRAM
- scr_losechar()
- if instance_exists(obj_caterpillarchara)
- {
- instance_destroy(obj_caterpillarchara)
- }
-#endif
-
- var party = party_options[partystate]
- var party_size = array_length(party)
- for (var i = 1; i < party_size; i++)
- {
- var party_member = party[i]
-#if DEMO
- scr_getchar_ch1(party_member)
-#endif
-#if SURVEY_PROGRAM
- scr_getchar(party_member)
-#endif
- }
- for (var i = 1; i < party_size; i++)
- {
- var party_member = party[i]
- var height = party_member == 2 ? 16 : 12
-#if DEMO
- scr_makecaterpillar_ch1(obj_mainchara_ch1.x, obj_mainchara_ch1.y - height, party_member, i - 1)
-#endif
-#if SURVEY_PROGRAM
- scr_makecaterpillar(obj_mainchara.x, obj_mainchara.y - height, party_member, i - 1)
-#endif
- }
- show_temp_message(party[0])
-}
-/// END
\ No newline at end of file
diff --git a/src/mod/all_chapters/party_selector/obj_darkcontroller_Step_0.gml b/src/mod/all_chapters/party_selector/obj_darkcontroller_Step_0.gml
deleted file mode 100644
index 579da81..0000000
--- a/src/mod/all_chapters/party_selector/obj_darkcontroller_Step_0.gml
+++ /dev/null
@@ -1,92 +0,0 @@
-/// PATCH .ignore ifndef DEMO
-
-/// APPEND
-// change party
-if pressed_active_feature_key(#KEYBINDING.change_party, "change-party")
-{
- var standard_parties = create_array
- (
- create_array("party: kris + susie + ralsei", 2, 3),
- create_array("party: kris only"),
- create_array("party: kris + ralsei", 3),
- create_array("party: kris + susie", 2),
- create_array("party: kris + noelle", 4),
- create_array("party: krerdly canon", 5)
- )
- partystate++
- presscount++
- if (presscount < 30)
- {
- global.krerdlyMode = 0
- partystate = wrap_around(partystate, 0, array_length(standard_parties) - 1)
- build_party_from_options(standard_parties[partystate])
- }
- // just to have a 10 press period with krerdly mode
- else if (presscount >= 30 && presscount < 40)
- {
- build_party_from_options(standard_parties[5])
- global.krerdlyMode = 1
- }
- // TO-DO: refactor this character switch
- else if (presscount >= 40)
- {
- var custom_party
- custom_party[0] = "kris"
-
- first_member = get_user_input_character(2)
-
- // 1 -> empty string, leave kris alone if no input
- if (first_member > 1)
- {
- custom_party[1] = first_member
- second_member = get_user_input_character(3)
- if (second_member > 1)
- {
- custom_party[2] = second_member
- }
- }
-
- var custom_names
- // setting berdly and starwalker vars
- var party_length = array_length(custom_party)
- for (var i = 1; i < party_length; i++)
- {
- var name = ""
- switch (custom_party[i])
- {
- case 2:
- {
- name = "susie"
- break
- }
- case 3:
- {
- name = "ralsei"
- break
- }
- case 4:
- {
- name = "noelle"
- break
- }
- case 5:
- {
- global.krerdlyMode = i
- name = "berdly"
- }
- case 6:
- {
- global.theOriginal = i
- name = "starwalker"
- }
- }
- if (name != "")
- {
- custom_party[0] += " + " + name
- }
- }
-
- build_party_from_options(custom_party)
- }
-}
-/// END
\ No newline at end of file
diff --git a/src/mod/all_chapters/party_selector/party_selector.gml b/src/mod/all_chapters/party_selector/party_selector.gml
index efd23b1..87e2458 100644
--- a/src/mod/all_chapters/party_selector/party_selector.gml
+++ b/src/mod/all_chapters/party_selector/party_selector.gml
@@ -1,5 +1,20 @@
/// FUNCTIONS
+/* Gets the character caterpillar ID based on its name */
+function get_character_code(char)
+{
+ switch (char)
+ {
+ case "susie": return 2;
+ case "ralsei": return 3;
+ case "noelle": return 4;
+ case "berdly": return 5;
+ case "starwalker": return 6;
+ default: return undefined;
+ }
+}
+
+/* Party is an array of strings containing the character names: "susie", "ralsei", "noelle", "berdly", "starwalker" */
function build_party_from_options(party)
{
//destryoing previous party
@@ -19,9 +34,13 @@ function build_party_from_options(party)
}
var party_size = array_length(party)
- for (var i = 1; i < party_size; i++)
+ for (var i = 0; i < party_size; i++)
{
- var party_member = party[i]
+ var party_member = get_character_code(party[i])
+ if (is_undefined(party_member))
+ {
+ continue;
+ }
#if DEMO
if (global.chapter == 1)
{
@@ -31,29 +50,33 @@ function build_party_from_options(party)
#endif
scr_getchar(party_member);
}
- for (var i = 1; i < party_size; i++)
+ for (var i = 0; i < party_size; i++)
{
- var party_member = party[i]
+ var party_member = get_character_code(party[i])
+ if (is_undefined(party_member))
+ {
+ continue;
+ }
var height = undefined
- switch party_member
+ switch (party[i])
{
- case 2:
+ case "susie":
{
height = 16
}
- case 3:
+ case "ralsei":
{
height = 12
}
- case 4:
+ case "noelle":
{
height = 18
}
- case 5:
+ case "berdly":
{
height = 6
}
- case 6:
+ case "starwalker":
{
height = 0
}
@@ -63,32 +86,42 @@ function build_party_from_options(party)
#if DEMO
if (global.chapter == 1)
{
- scr_makecaterpillar_ch1(obj_mainchara_ch1.x, obj_mainchara_ch1.y - height, party_member, i - 1)
+ scr_makecaterpillar_ch1(obj_mainchara_ch1.x, obj_mainchara_ch1.y - height, party_member, i)
}
else
#endif
- scr_makecaterpillar(obj_mainchara.x, obj_mainchara.y - height, party_member, i - 1);
+ scr_makecaterpillar(obj_mainchara.x, obj_mainchara.y - height, party_member, i);
}
-
}
- show_temp_message(party[0])
}
function get_user_input_character(number)
{
- var input = string_lower(get_string("Who's party member #" + string(number) + "? (susie, ralsei, noelle, berdly, starwalker, or leave blank)", ""))
- switch input
+ var character_options = "susie, ralsei";
+
+#if DEMO
+ if (global.chapter == 2)
{
- case "susie": return 2;
- case "ralsei": return 3;
- case "noelle": return 4;
- case "berdly": return 5;
- case "starwalker": return 6;
- case "": return 1;
- default:
- {
- show_message("Invalid party member.")
- return get_user_input_character(number)
- }
+ character_options += ", noelle, berdly, starwalker";
}
-}
\ No newline at end of file
+#endif
+
+ var input = string_lower(get_string("Who's party member #" + string(number) + "? (" + character_options + ", or leave blank)", ""));
+#if DEMO
+ if (input == "susie" || input == "ralsei" || (global.chapter == 2 && (input == "noelle" || input == "berdly" || input == "starwalker")))
+#elsif SURVEY_PROGRAM
+ if (input == "susie" || input == "ralseiu")
+#endif
+ {
+ return input;
+ }
+ else if (input == "")
+ {
+ return undefined;
+ }
+ else
+ {
+ show_message("Invalid party member.")
+ return get_user_input_character(number)
+ }
+}
diff --git a/src/mod/all_chapters/player_options/player_options.gml b/src/mod/all_chapters/player_options/player_options.gml
index 503b675..38c97a6 100644
--- a/src/mod/all_chapters/player_options/player_options.gml
+++ b/src/mod/all_chapters/player_options/player_options.gml
@@ -1,73 +1,5 @@
/// FUNCTIONS
-function init_player_options()
-{
- global.player_options = scr_84_load_map_json("keucher_mod/player_options.json")
- var feature_length = array_length(global.feature_info)
- if (ds_map_empty(global.player_options))
- {
- var feature_json = ""
- for (var i = 0; i < feature_length; i += global.feature_info_group_length)
- {
- var feature_name = global.feature_info[i]
- var value = global.feature_info[i + global.feature_info_state_index]
- feature_json += "\"" + feature_name + "\": " + string(value)
- if (i < feature_length - global.feature_info_group_length)
- {
- feature_json += ", "
- }
- }
-
- global.player_options = json_decode
- ("
- {
- \"timer-precision\": 2,
- \"feature-options\":
- {
- " + feature_json + "
- },
- \"debug\": true,
- \"ui-colors\":
- {
- \"background\": 12632256,
- \"text\": 16777215,
- \"border\": 16777215,
- \"button\": 0,
- \"button-hover\": 12632256,
- \"button-press\": 8421504,
- \"button-highlight\": 16711680
- }
- }
- ")
- }
- else
- {
- // adding new features if they don't exist yet
- var feature_options = read_json_value(global.player_options, "feature-options")
- for (var i = 0; i < feature_length; i += global.feature_info_group_length)
- {
- var feature_name = global.feature_info[i]
- var value = read_json_value(feature_options, feature_name)
- if (value == undefined)
- {
- ds_map_add(feature_options, feature_name, global.feature_info[i + global.feature_info_state_index])
- }
- }
- }
- save_player_options()
-
-}
-
-function read_player_option(key)
-{
- return read_json_value(global.player_options, argument0)
-}
-
-function save_player_options()
-{
- save_json("keucher_mod/player_options.json", global.player_options)
-}
-
/*
Updates the value of an UI element to a new color
@@ -80,30 +12,31 @@ function set_ui_color(element, color)
var ui_name = ""
switch (element)
{
- case #UI_ELEMENT.background:
+ case 0:
ui_name = "background"
break
- case #UI_ELEMENT.text:
+ case 1:
ui_name = "text"
break
- case #UI_ELEMENT.border:
+ case 2:
ui_name = "border"
break
- case #UI_ELEMENT.button:
+ case 3:
ui_name = "button"
break
- case #UI_ELEMENT.button_hover:
+ case 4:
ui_name = "button-hover"
break
- case #UI_ELEMENT.button_press:
+ case 5:
ui_name = "button-press"
break
- case #UI_ELEMENT.button_highlight:
+ case 6:
ui_name = "button-highlight"
break
+ case 7:
+ ui_name = "scrollbar"
}
- var ui_colors = read_json_value(global.player_options, "ui-colors")
- ds_map_set(ui_colors, ui_name, color)
+ update_config_value(color, ui_name + "color");
}
/*
@@ -114,5 +47,17 @@ Arguments:
*/
function read_ui_color(element)
{
- return read_json_value(global.player_options, "ui-colors", element)
-}
\ No newline at end of file
+ return read_config_value(element + "color");
+}
+
+function init_ui_colors()
+{
+ read_config_with_default("0", "backgroundcolor");
+ read_config_with_default("16777215", "textcolor");
+ read_config_with_default("16777215", "bordercolor");
+ read_config_with_default("0", "buttoncolor");
+ read_config_with_default("12632256", "button-hovercolor");
+ read_config_with_default("8421504", "button-presscolor");
+ read_config_with_default("16711680", "button-highlightcolor");
+ read_config_with_default("16777215", "scrollbarcolor");
+}
diff --git a/src/mod/all_chapters/plotwarp/plotwarp.gml b/src/mod/all_chapters/plotwarp/plotwarp.gml
index 776a95b..587c3dd 100644
--- a/src/mod/all_chapters/plotwarp/plotwarp.gml
+++ b/src/mod/all_chapters/plotwarp/plotwarp.gml
@@ -1,31 +1,5 @@
/// FUNCTIONS
-function warp_to_battleroom()
-{
- if (keyboard_check(ord("2")) && detected_active_feature_key(#KEYBINDING.plot_warp, "plotwarp"))
- {
- // free movement and set darkworld
- // TO-DO: I've seen this sort of pattern before. Group in function?
- global.darkzone = true
- global.interact = 0
-#if DEMO
- if (global.chapter == 1)
- {
- // TO-DO: group room_goto and snd_free_all in function
- snd_free_all_ch1()
- room_goto(room_battletest_ch1)
- }
- else if (global.chapter == 2)
- {
-#endif
- snd_free_all()
- room_goto(room_battletest)
-#if DEMO
- }
-#endif
- }
-}
-
function plotwarp(__warp)
{
// give player movement
diff --git a/src/mod/all_chapters/position_cache/position_cache.gml b/src/mod/all_chapters/position_cache/position_cache.gml
index 19e2b38..557403d 100644
--- a/src/mod/all_chapters/position_cache/position_cache.gml
+++ b/src/mod/all_chapters/position_cache/position_cache.gml
@@ -33,7 +33,7 @@ If position caching is activated, sets the flag that we are trying to load a fil
*/
function set_cache_loading()
{
- if is_feature_active("position-cache")
+ if is_option_active("position_save_caching")
{
global.is_cache_loading = true
}
diff --git a/src/mod/all_chapters/rng_rigging/spelling_bee/obj_ch2_scene19c_spelling_bee_Step_0.gml b/src/mod/all_chapters/rng_rigging/spelling_bee/obj_ch2_scene19c_spelling_bee_Step_0.gml
index b7428f8..6838581 100644
--- a/src/mod/all_chapters/rng_rigging/spelling_bee/obj_ch2_scene19c_spelling_bee_Step_0.gml
+++ b/src/mod/all_chapters/rng_rigging/spelling_bee/obj_ch2_scene19c_spelling_bee_Step_0.gml
@@ -4,7 +4,7 @@
sb_word_current = sb_word[random_range(0, 5)]
/// CODE
{
- if (first_word == 0 && is_feature_active("spelling-bee"))
+ if (first_word == 0 && read_rng_value("spelling_bee"))
{
// use words with the same number of characters
// as the optimal ones in each language
diff --git a/src/mod/all_chapters/rng_rigging/susie_death/obj_checkers_enemy_SP_Step_0.gml b/src/mod/all_chapters/rng_rigging/susie_death/obj_checkers_enemy_SP_Step_0.gml
index 531e1ca..ed11020 100644
--- a/src/mod/all_chapters/rng_rigging/susie_death/obj_checkers_enemy_SP_Step_0.gml
+++ b/src/mod/all_chapters/rng_rigging/susie_death/obj_checkers_enemy_SP_Step_0.gml
@@ -8,7 +8,7 @@ scr_randomtarget()
#endif
/// CODE
// target SUSIE
-if (first_turn == 0 && is_feature_active("susie-death"))
+if (first_turn == 0 && read_rng_value("susie_death"))
{
mytarget = 2
global.targeted[2] = true
diff --git a/src/mod/all_chapters/room_warp/room_warp.gml b/src/mod/all_chapters/room_warp/room_warp.gml
new file mode 100644
index 0000000..36e48b1
--- /dev/null
+++ b/src/mod/all_chapters/room_warp/room_warp.gml
@@ -0,0 +1,54 @@
+/// FUNCTIONS
+
+/* Creates global variable to store all room names for searching */
+function init_room_names()
+{
+ var room_names
+ var cur_room = 0
+ // for some reason, room_last is 0 at the start, so we can't use it
+ // THIS NEEDS TO BE UPDATED IF MORE ROOMS ARE ADDED
+ for (var i = 0; i < 427; i++)
+ {
+ var name = room_get_name(i)
+ // reached the limit of index, exit loop
+ if (name == "")
+ {
+ break;
+ }
+ room_names[cur_room] = name
+ cur_room += 1
+ }
+ global.room_names = room_names
+}
+
+/* Search across room names by a substring */
+function search_room_by_substring(substring)
+{
+ if (substring == "")
+ {
+ return global.room_names;
+ }
+
+ var results
+ var size = array_length(global.room_names)
+ found = 0
+ for (var i = 0; i < size; i++)
+ {
+ var current_room = global.room_names[i]
+ pos = string_pos(substring, current_room)
+ if (pos > 0)
+ {
+ results[found] = current_room
+ found++
+ }
+ }
+
+ if (found == 0)
+ {
+ return create_array()
+ }
+ else
+ {
+ return results
+ }
+}
\ No newline at end of file
diff --git a/src/mod/all_chapters/saves/saves.gml b/src/mod/all_chapters/saves/saves.gml
index 20b083b..ae4a732 100644
--- a/src/mod/all_chapters/saves/saves.gml
+++ b/src/mod/all_chapters/saves/saves.gml
@@ -4,28 +4,33 @@
function get_save_dir(include_slash)
{
var last_char = include_slash ? "/" : ""
- return "keucher_mod/saves" + last_char
+ return global.mod_dir + "/saves" + last_char
}
/* Loads the menu buttons that displays the files and folders for the given directory (for savefiles) */
function load_save_buttons(dir)
{
- var subfiles = get_all_subfiles(dir);
+ var relative_dir = get_save_dir(false) + dir;
+ var subfiles = get_all_subfiles(relative_dir);
var size = array_length_1d(subfiles);
- button_amount = size;
+ button_amount = size + 1;
+ button_text[0] = dir;
+ hover_desc[0] = "The current directory we are in";
for (var i = 0; i < size; i++)
{
var subfile = subfiles[i];
- var full_path = dir + "/" + subfile;
- var short_path = string_copy(full_path, string_length(get_save_dir(true)) + 1, string_length(full_path))
+ var full_path = relative_dir + subfile;
+ hover_desc[i + 1] = "";
if directory_exists(full_path)
{
- button_text[i] = short_path + " [FOLDER]";
+ button_text[i + 1] = subfile + " [FOLDER]";
}
else
{
- button_text[i] = short_path + " [FILE]";
+ button_text[i + 1] = subfile + " [FILE]";
}
}
- options_state = #OPTION_STATE.saves
+ menu_desc = "Browse your saves here!\nClick on a FOLDER to check inside it\nClick on a FILE to load it";
+ use_enumeration = false;
+ options_state = "savebrowse"
}
\ No newline at end of file
diff --git a/src/mod/all_chapters/time_manip/time_manip.gml b/src/mod/all_chapters/time_manip/time_manip.gml
index 58fcdd7..9b58d2f 100644
--- a/src/mod/all_chapters/time_manip/time_manip.gml
+++ b/src/mod/all_chapters/time_manip/time_manip.gml
@@ -12,7 +12,7 @@ Takes a value in microseconds and returns a string with the time
*/
function to_readable_time(original_time)
{
- var precision = read_json_value(global.player_options, "timer-precision")
+ var precision = read_config_value("timer_precision")
if (precision > 6)
{
precision = 6
diff --git a/src/mod/all_chapters/tp_toggle/obj_battlecontroller_DUPE_Step_0.gml b/src/mod/all_chapters/tp_toggle/obj_battlecontroller_DUPE_Step_0.gml
index 2f11f82..c6365d4 100644
--- a/src/mod/all_chapters/tp_toggle/obj_battlecontroller_DUPE_Step_0.gml
+++ b/src/mod/all_chapters/tp_toggle/obj_battlecontroller_DUPE_Step_0.gml
@@ -1,7 +1,7 @@
/// PATCH
// adding toggle in battles
/// APPEND
-if pressed_active_feature_key(#KEYBINDING.toggle_tp, "tp-toggle")
+if pressed_active_debug_keybind("tp_toggle")
{
global.tension = global.tension != 0 ? 0 : 250
}
diff --git a/src/mod/all_chapters/user_segments/user_segments.gml b/src/mod/all_chapters/user_segments/user_segments.gml
deleted file mode 100644
index 57def3a..0000000
--- a/src/mod/all_chapters/user_segments/user_segments.gml
+++ /dev/null
@@ -1,161 +0,0 @@
-/// FUNCTIONS
-
-function get_mod_room_name(room_id)
-{
-#if DEMO
- var suffix = "_ch1"
-#endif
-#if SURVEY_PROGRAM
- var suffix = ""
-#endif
-
- var ch1_room_descs = create_array
- (
- "PLACE_CONTACT", "Start Chapter 1",
- "room_krisroom", "Chapter 1 - Kris' Room",
- "room_dark1", "Chapter 1 Dark World - First Room",
- "room_dark1a", "Chapter 1 Dark World - First Savepoint",
- "room_castle_outskirts", "Chapter 1 - Get up after cliff",
- "room_field_start", "Field - Great Door",
- "room_field_puzzle1", "Field - First Puzzle",
- "room_field_shop1", "Field - Outside Shop",
- "room_field_checkers4", "Checkerboard - First Room",
- "room_forest_savepoint1", "Forest - Entrance",
- "room_forest_afterthrash2", "Forest - After Susie/Lancer",
- "room_cc_prisonlancer", "Castle - Cell Hallway",
- "room_krishallway", "Chapter 1 - Kris' Hallway"
- )
- var ch1_room_descs_size = array_length(ch1_room_descs)
- for (var i = 0; i < ch1_room_descs_size; i += 2)
- {
- if (asset_get_index(ch1_room_descs[i] + suffix) == room_id)
- {
- return ch1_room_descs[i + 1]
- }
- }
-
-#if DEMO
- switch (room_id)
- {
- case room_dw_cyber_intro_1:
- return "Cyber Field - First Room";
- case room_dw_city_intro:
- return "Cyber City - Garbage Dump";
- case room_dw_city_traffic_4:
- return "Cyber City - Traffic After Berdly";
- case room_dw_mansion_krisroom:
- return "Queen's Mansion - Kris's Room";
- case room_dw_mansion_fire_paintings:
- return "Queen's Mansion - Fire Paintings Room";
- case room_dw_mansion_acid_tunnel:
- return "Queen's Mansion - Acid Tunnel Entrance";
- case room_dw_mansion_acid_tunnel_exit:
- return "Queen's Mansion - Acid Tunnel Exit";
- case room_dw_mansion_top:
- return "Queen's Mansion - Giga Queen Room (before fight)";
- case room_dw_mansion_top_post:
- return "Queen's Mansion - Giga Queen Room (after fight)";
- case room_torhouse:
- return "Chapter 2 - Kris' House - Kitchen";
- }
-#endif
-}
-
-function get_name_from_instruction(instruction)
-{
- var room_index = asset_get_index(instruction)
- if (room_get_name(room_index) == "")
- {
- switch (instruction)
- {
- case "ch1introend": return "At the end of the VESSEL CREATION";
- case "doorslam": return "When the Castle Down door is closed";
- case "captured": return "Getting captured in Chapter 1";
- case "escaped": return "Escape prison in Chapter 1";
- case "kingdefeat": return "Finish King fight";
- case "ch1sleep": return "Sleeping in Chapter 1 (TIME END)";
- case "ch2start": return "Press YES in Chapter 2 naming";
- case "djsend": return "End DJs fight";
- case "cyberend": return "White fadeout in Cyber Field end";
- case "city2end": return "Black screen in City end";
- case "gigaend": return "End Giga Queen";
- case "ch2sleep": return "Sleeping in Chapter 2 (TIME END)";
- default: return "Error";
- }
- }
- else
- {
- return "Reaching the room \"" + get_mod_room_name(room_index) + "\"";
- }
-}
-
-function get_split_create_options()
-{
- var name = undefined
- var splits = undefined
- var name_text = "Pick a name"
-
- if (!is_undefined(global.current_created_preset))
- {
- var name = read_json_value(global.current_created_preset, "name")
- var instructions = read_json_value(global.current_created_preset, "instructions")
- if (!is_undefined(name))
- {
- name_text = "Splits Name: [" + name + "]"
- }
- if (!is_undefined(instructions))
- {
- splits = instructions
- }
- }
- else
- {
- global.current_created_preset = ds_map_create()
- ds_map_add_map(global.current_created_preset, "instructions", ds_map_create())
- }
-
- obj_mod_options.button_text[0] = "Reset"
- obj_mod_options.button_text[1] = "Create splits preset"
- obj_mod_options.button_text[2] = name_text
- obj_mod_options.button_text[3] = "Add a new split"
- obj_mod_options.button_amount = 4
- if (!is_undefined(splits))
- {
- var split_count = ds_map_size(splits)
- obj_mod_options.button_amount += split_count
- for (var i = 0; i < split_count; i ++)
- {
- var instruction = read_json_value(splits, i)
- var split_text = ""
- if (i == 0) split_text = "Start: "
- else if (i == split_count - 1) split_text = "End: "
- else split_text = "Split " + string(i) + ": "
- obj_mod_options.button_text[i + 4] = split_text + get_name_from_instruction(instruction)
- }
- }
-
- obj_mod_options.options_state = #OPTION_STATE.split_creator
-
-
-}
-
-function get_split_pick_options()
-{
- button_amount = array_length(global.ALL_INSTRUCTIONS)
- for (var i = 0; i < button_amount; i++)
- {
- button_text[i] = get_name_from_instruction(global.ALL_INSTRUCTIONS[i])
- }
- options_state = #OPTION_STATE.split_pick
-}
-
-function init_user_ils()
-{
- global.splits_json = scr_84_load_map_json("keucher_mod/userils.json")
- if (ds_map_empty(global.splits_json))
- {
- var file = file_text_open_write("keucher_mod/userils.json")
- file_text_write_string(file, "{}")
- file_text_close(file)
- }
-}
\ No newline at end of file
diff --git a/src/mod/all_chapters/utils/utils.gml b/src/mod/all_chapters/utils/utils.gml
index 22a9bf2..cfc03f2 100644
--- a/src/mod/all_chapters/utils/utils.gml
+++ b/src/mod/all_chapters/utils/utils.gml
@@ -131,4 +131,46 @@ function get_all_subfiles(dir)
{
return files;
}
+}
+
+/* Generates an array like [start, start + 1, ..., end_number] */
+function get_range_array(start_number, end_number)
+{
+ var range_array;
+
+ size = end_number - start_number + 1;
+ for (var i = 0; i < size; i++)
+ {
+ range_array[i] = start_number + i;
+ }
+
+ return range_array;
+}
+
+/* Returns 0 if chapter select */
+function get_current_chapter()
+{
+#if DEMO
+ if (instance_exists(obj_time_ch1))
+ {
+ return 1;
+ }
+ if (instance_exists(obj_time))
+ {
+ return 2;
+ }
+
+ return 0;
+#elsif SURVEY_PROGRAM
+ return 1;
+#endif
+}
+
+function loaded_savefile()
+{
+#if DEMO
+ return instance_exists(obj_mainchara) || instance_exists(obj_mainchara_ch1);
+#elsif SURVEY_PROGRAM
+ return instance_exists(obj_mainchara);
+#endif
}
\ No newline at end of file
diff --git a/src/mod/ch1/ch1_mashing/ch1_mashing.gml b/src/mod/ch1/ch1_mashing/ch1_mashing.gml
new file mode 100644
index 0000000..fbbda3e
--- /dev/null
+++ b/src/mod/ch1/ch1_mashing/ch1_mashing.gml
@@ -0,0 +1,8 @@
+/// FUNCTIONS
+
+function reset_mashing_stats()
+{
+ global.wrist_protector_auto_mashed = 0;
+ global.wrist_protector_manual_mashed = 0;
+ global.wrist_protector_manual_missed = 0;
+}
\ No newline at end of file
diff --git a/src/mod/ch1/ch1_mashing/obj_time_SP_Create_0.gml b/src/mod/ch1/ch1_mashing/obj_time_SP_Create_0.gml
index 05861e8..dbdd2a6 100644
--- a/src/mod/ch1/ch1_mashing/obj_time_SP_Create_0.gml
+++ b/src/mod/ch1/ch1_mashing/obj_time_SP_Create_0.gml
@@ -1,6 +1,8 @@
/// PATCH
/// APPEND
-global.wrist_protector_auto_mashed = 0
-global.wrist_protector_manual_mashed = 0
-global.wrist_protector_manual_missed = 0
+// track whether it is on or not
+global.mash_practice_mode = false;
+
+// used as initializer
+reset_mashing_stats();
/// END
\ No newline at end of file
diff --git a/src/mod/ch1/ch1_mashing/obj_time_SP_Draw_64.gml b/src/mod/ch1/ch1_mashing/obj_time_SP_Draw_64.gml
index 246e69f..6c84946 100644
--- a/src/mod/ch1/ch1_mashing/obj_time_SP_Draw_64.gml
+++ b/src/mod/ch1/ch1_mashing/obj_time_SP_Draw_64.gml
@@ -1,6 +1,12 @@
/// PATCH
/// APPEND
-if (is_feature_active("show-wp-mash"))
+
+if (pressed_other_keybind("reset_mash_stat"))
+{
+ reset_mashing_stats();
+}
+
+if (global.mash_practice_mode)
{
var total = global.wrist_protector_auto_mashed + global.wrist_protector_manual_mashed
// time in seconds: frames spent mashing / fps = s
diff --git a/src/mod/ch1/ch1_wakeup_mash/obj_time_SP_Draw_64.gml b/src/mod/ch1/ch1_wakeup_mash/obj_time_SP_Draw_64.gml
index 84822d2..da71d0e 100644
--- a/src/mod/ch1/ch1_wakeup_mash/obj_time_SP_Draw_64.gml
+++ b/src/mod/ch1/ch1_wakeup_mash/obj_time_SP_Draw_64.gml
@@ -1,6 +1,6 @@
/// PATCH
/// APPEND
-if (is_feature_active("show-wake-mash") && room ==
+if (is_option_active("wakeup_mash_display") && room ==
#if DEMO
room_dark1_ch1
#elsif SURVEY_PROGRAM
diff --git a/src/mod/ch1/ch2_debug_functions/obj_battlecontroller_SP_Step_0.gml b/src/mod/ch1/ch2_debug_functions/obj_battlecontroller_SP_Step_0.gml
index 6eb005a..c648159 100644
--- a/src/mod/ch1/ch2_debug_functions/obj_battlecontroller_SP_Step_0.gml
+++ b/src/mod/ch1/ch2_debug_functions/obj_battlecontroller_SP_Step_0.gml
@@ -1,7 +1,7 @@
/// PATCH
// adding ch1 battle debug keys
/// APPEND
-if pressed_active_feature_key(#KEYBINDING.heal, "party-heal")
+if pressed_active_debug_keybind("heal_party")
{
#if DEMO
scr_healallitemspell_ch1(999)
@@ -10,7 +10,7 @@ if pressed_active_feature_key(#KEYBINDING.heal, "party-heal")
scr_healallitemspell(999)
#endif
}
-if pressed_active_feature_key(#KEYBINDING.instant_win, "win-battle")
+if pressed_active_debug_keybind("instant_win")
{
#if DEMO
scr_wincombat_ch1()
diff --git a/src/mod/ch1/ch2_debug_functions/obj_darkcontroller_SP_Step_0.gml b/src/mod/ch1/ch2_debug_functions/obj_darkcontroller_SP_Step_0.gml
index fa0c00f..0509ce0 100644
--- a/src/mod/ch1/ch2_debug_functions/obj_darkcontroller_SP_Step_0.gml
+++ b/src/mod/ch1/ch2_debug_functions/obj_darkcontroller_SP_Step_0.gml
@@ -12,13 +12,13 @@ if scr_debug_ch1()
game_restart_true_ch1()
}
/// CODE
-if pressed_active_feature_key(#KEYBINDING.save, "save-file")
+if pressed_active_debug_keybind("save_menu")
instance_create_ch1(0, 0, obj_savemenu_ch1)
-if pressed_active_feature_key(#KEYBINDING.load, "save-load")
+if pressed_active_debug_keybind("load_file")
scr_load_ch1()
-if (pressed_active_feature_key(#KEYBINDING.reload, "restart") && keyboard_check(vk_backspace))
+if (pressed_active_debug_keybind("restart_room") && keyboard_check(vk_backspace))
game_restart_true()
-if (pressed_active_feature_key(#KEYBINDING.reload, "restart") && !keyboard_check(vk_backspace))
+if (pressed_active_debug_keybind("restart_room") && !keyboard_check(vk_backspace))
{
snd_free_all_ch1()
room_restart()
@@ -28,11 +28,11 @@ if (pressed_active_feature_key(#KEYBINDING.reload, "restart") && !keyboard_check
// adding INS and DEl warps in Ch1
/// APPEND
-if pressed_active_feature_key(#KEYBINDING.next_room, "room-warp")
+if pressed_active_debug_keybind("next_room")
{
room_goto_next()
}
-if pressed_active_feature_key(#KEYBINDING.previous_room, "room-warp")
+if pressed_active_debug_keybind("previous_room")
{
room_goto_previous()
}
@@ -51,19 +51,19 @@ if scr_debug()
game_restart_true()
}
/// CODE
-if pressed_active_feature_key(#KEYBINDING.save, "save-file")
+if pressed_active_debug_keybind("save_menu")
{
instance_create(0, 0, obj_savemenu)
}
-if pressed_active_feature_key(#KEYBINDING.load, "save-load")
+if pressed_active_debug_keybind("load_file")
{
scr_load()
}
-if (pressed_active_feature_key(#KEYBINDING.reload, "restart") && keyboard_check(vk_backspace))
+if (pressed_active_debug_keybind("restart_room") && keyboard_check(vk_backspace))
{
game_restart_true()
}
-if (pressed_active_feature_key(#KEYBINDING.reload, "restart") && !keyboard_check(vk_backspace))
+if (pressed_active_debug_keybind("restart_room") && !keyboard_check(vk_backspace))
{
snd_free_all()
room_restart()
diff --git a/src/mod/ch1/ch2_debug_functions/obj_mainchara_SP_Step_0.gml b/src/mod/ch1/ch2_debug_functions/obj_mainchara_SP_Step_0.gml
index ce5be0d..7357589 100644
--- a/src/mod/ch1/ch2_debug_functions/obj_mainchara_SP_Step_0.gml
+++ b/src/mod/ch1/ch2_debug_functions/obj_mainchara_SP_Step_0.gml
@@ -4,11 +4,11 @@
// adding INS and DEL keybinds
// TO-DO: I believe this is already in another file. double check why and if this is necessary
/// APPEND
-if pressed_active_feature_key(#KEYBINDING.next_room, "room-warp")
+if pressed_active_debug_keybind("next_room")
{
room_goto_next()
}
-if pressed_active_feature_key(#KEYBINDING.previous_room, "room-warp")
+if pressed_active_debug_keybind("previous_room")
{
room_goto_previous()
}
diff --git a/src/mod/ch1/debug/gml_GlobalScript_scr_debug_ch1.gml b/src/mod/ch1/debug/gml_GlobalScript_scr_debug_ch1.gml
new file mode 100644
index 0000000..420d86f
--- /dev/null
+++ b/src/mod/ch1/debug/gml_GlobalScript_scr_debug_ch1.gml
@@ -0,0 +1,10 @@
+/// PATCH .ignore ifndef DEMO
+
+// vanilla uses this debugcontroller which is useless
+
+/// REPLACE
+ if instance_exists(obj_debugcontroller_ch1)
+ return obj_debugcontroller_ch1.debug;
+/// CODE
+ return global.debug;
+/// END
\ No newline at end of file
diff --git a/src/mod/ch1/mercymeter/obj_battlecontroller_SP_Draw_0.gml b/src/mod/ch1/mercymeter/obj_battlecontroller_SP_Draw_0.gml
index 071a393..563b538 100644
--- a/src/mod/ch1/mercymeter/obj_battlecontroller_SP_Draw_0.gml
+++ b/src/mod/ch1/mercymeter/obj_battlecontroller_SP_Draw_0.gml
@@ -2,7 +2,7 @@
/// AFTER
mercyamt = 100
/// CODE
-if (is_feature_active("ch1-mercy-percentage"))
+if (is_option_active("mercy_percentage_ch1"))
{
#if DEMO
var joker = obj_joker_ch1
diff --git a/src/mod/ch1/misc/screenshot/obj_time_SP_Step_1.gml b/src/mod/ch1/misc/screenshot/obj_time_SP_Step_1.gml
index f00f2ec..8116365 100644
--- a/src/mod/ch1/misc/screenshot/obj_time_SP_Step_1.gml
+++ b/src/mod/ch1/misc/screenshot/obj_time_SP_Step_1.gml
@@ -1,7 +1,33 @@
/// PATCH
/// REPLACE
-if keyboard_check_pressed(vk_f10)
+#if DEMO
+if scr_debug_ch1()
+#elsif SURVEY_PROGRAM
+if scr_debug()
+#endif
+{
+#if DEMO
+ if scr_84_debug_ch1(true)
+#elsif SURVEY_PROGRAM
+ if scr_84_debug(true)
+#endif
+ return;
+ if keyboard_check_pressed(vk_f10)
+ {
+ screen_name = string(screenshot_number) + "_shot.png"
+ screen_save(screen_name)
+ screenshot_number += 1
+ }
+}
/// CODE
-if pressed_active_feature_key(#KEYBINDING.screenshot, "screenshot")
+/// END
+
+/// APPEND
+if pressed_active_debug_keybind("screenshot")
+{
+ screen_name = string(screenshot_number) + "_shot.png"
+ screen_save(screen_name)
+ screenshot_number += 1
+}
/// END
\ No newline at end of file
diff --git a/src/mod/ch1/tadytext/obj_time_SP_Create_0.gml b/src/mod/ch1/tadytext/obj_time_SP_Create_0.gml
index ebaafeb..4468934 100644
--- a/src/mod/ch1/tadytext/obj_time_SP_Create_0.gml
+++ b/src/mod/ch1/tadytext/obj_time_SP_Create_0.gml
@@ -1,6 +1,9 @@
/// PATCH
/// APPEND
+// whther or not tadytext practice is on
+global.tadytext_mode = false;
+
// tracks the number of the current textbox in tadytext
global.tady_text_num = 0
// tracks the current frame of the current textbox in tadytext
diff --git a/src/mod/ch1/tadytext/obj_time_SP_Draw_64.gml b/src/mod/ch1/tadytext/obj_time_SP_Draw_64.gml
index 7d1bf3b..fea3d30 100644
--- a/src/mod/ch1/tadytext/obj_time_SP_Draw_64.gml
+++ b/src/mod/ch1/tadytext/obj_time_SP_Draw_64.gml
@@ -1,7 +1,7 @@
/// PATCH
/// APPEND
-if is_feature_active("tadytext")
+if global.tadytext_mode
{
draw_set_color(c_black)
draw_set_alpha(0.5)
diff --git a/src/mod/ch2/door_overflow/obj_npc_musical_door_Draw_64.gml b/src/mod/ch2/door_overflow/obj_npc_musical_door_Draw_64.gml
index 8c4d455..34b6fa8 100644
--- a/src/mod/ch2/door_overflow/obj_npc_musical_door_Draw_64.gml
+++ b/src/mod/ch2/door_overflow/obj_npc_musical_door_Draw_64.gml
@@ -1,6 +1,6 @@
/// IMPORT .ignore ifndef DEMO
-if (is_feature_active("doorwarp-square"))
+if (is_option_active("doorwarp_indicator"))
{
// this is when door overflow is ready to be done
if (con == 7)
diff --git a/src/mod/ch2/rouxls_practice/obj_rouxls_simtown_Draw_0.gml b/src/mod/ch2/rouxls_practice/obj_rouxls_simtown_Draw_0.gml
index 3887376..b5ebba9 100644
--- a/src/mod/ch2/rouxls_practice/obj_rouxls_simtown_Draw_0.gml
+++ b/src/mod/ch2/rouxls_practice/obj_rouxls_simtown_Draw_0.gml
@@ -1,21 +1,14 @@
/// PATCH .ignore ifndef DEMO
/// APPEND
-// toggle practice
-if pressed_active_feature_key(#KEYBINDING.toggle_rouxls, "rouxls-practice")
-{
- if (global.rurus_random == 0)
- global.rurus_random = 1
- else
- global.rurus_random = 0
-}
+
// change pattern
-if keyboard_check_pressed(get_bound_key(#KEYBINDING.previous_house_pattern))
+if pressed_other_keybind("previous_house_pattern")
{
if (global.rurus_pattern > 0)
global.rurus_pattern -= 1
}
-else if keyboard_check_pressed(keyboard_check_pressed(get_bound_key(#KEYBINDING.next_house_pattern)))
+else if pressed_other_keybind("next_house_pattern")
{
if (global.rurus_pattern < 6)
global.rurus_pattern += 1
@@ -24,8 +17,7 @@ if (global.rurus_random == 0)
{
draw_set_font(fnt_main)
draw_set_color(c_yellow)
- draw_text
- (
+ draw_text(
__view_get(0 << 0, 0) + 5, __view_get(1 << 0, 0) + 5,
// fix 0 indexing
"Current Rouxls Pattern: " + string(global.rurus_pattern + 1)
diff --git a/src/mod/ch2/rouxls_practice/obj_time_Create_0.gml b/src/mod/ch2/rouxls_practice/obj_time_Create_0.gml
index 7818a4c..b2f94bf 100644
--- a/src/mod/ch2/rouxls_practice/obj_time_Create_0.gml
+++ b/src/mod/ch2/rouxls_practice/obj_time_Create_0.gml
@@ -2,5 +2,5 @@
/// APPEND
global.rurus_pattern = 0
-global.rurus_random = 1
+
/// END
\ No newline at end of file
diff --git a/src/mod/ch2/rouxls_practice/rouxls_practice.gml b/src/mod/ch2/rouxls_practice/rouxls_practice.gml
new file mode 100644
index 0000000..62167d0
--- /dev/null
+++ b/src/mod/ch2/rouxls_practice/rouxls_practice.gml
@@ -0,0 +1,6 @@
+/// FUNCTIONS
+
+function toggle_rouxls_practice(on)
+{
+ global.rurus_random = on;
+}
\ No newline at end of file
diff --git a/src/mod/ch2/side_action/obj_darkcontroller_Step_0.gml b/src/mod/ch2/side_action/obj_darkcontroller_Step_0.gml
deleted file mode 100644
index 92db1ef..0000000
--- a/src/mod/ch2/side_action/obj_darkcontroller_Step_0.gml
+++ /dev/null
@@ -1,18 +0,0 @@
-/// PATCH .ignore ifndef DEMO
-
-// disabling the S/R/N-Action
-/// APPEND
-if pressed_active_feature_key(#KEYBINDING.side_action, "side-action")
-{
- if (global.flag[34] == 0)
- {
- global.flag[34] = 1
- show_temp_message("S/R/N-Action disabled")
- }
- else if (global.flag[34] == 1)
- {
- global.flag[34] = 0
- show_temp_message("S/R/N-Action enabled")
- }
-}
-/// END
\ No newline at end of file
diff --git a/src/mod/ch2/snowgrave_plot/obj_darkcontroller_Step_0.gml b/src/mod/ch2/snowgrave_plot/obj_darkcontroller_Step_0.gml
deleted file mode 100644
index 562ab10..0000000
--- a/src/mod/ch2/snowgrave_plot/obj_darkcontroller_Step_0.gml
+++ /dev/null
@@ -1,43 +0,0 @@
-/// PATCH .ignore ifndef DEMO
-
-/// APPEND
-if detected_active_feature_key(#KEYBINDING.snowgrave_plot, "snowgrave-plot")
-{
- if (keyboard_check_pressed(ord("1")))
- {
- global.flag[915] = 0
- global.flag[916] = 0
- scr_debug_print("snowgrave plot = default state (before city)")
- }
- if (keyboard_check_pressed(ord("2")))
- {
- global.flag[915] = 2
- global.flag[916] = 0
- scr_debug_print("snowgrave plot = ready for freeze ring")
- }
- if (keyboard_check_pressed(ord("3")))
- {
- global.flag[915] = 4
- global.flag[916] = 0
- scr_debug_print("snowgrave plot = after forcefield")
- }
- if (keyboard_check_pressed(ord("4")))
- {
- global.flag[915] = 6
- global.flag[916] = 0
- scr_debug_print("snowgrave plot = berdly frozen")
- }
- if (keyboard_check_pressed(ord("5")))
- {
- global.flag[915] = 8
- global.flag[916] = 0
- scr_debug_print("snowgrave plot = after rouxls statue scene")
- }
- if (keyboard_check_pressed(ord("6")))
- {
- global.flag[915] = 9
- global.flag[916] = 0
- scr_debug_print("snowgrave plot = before NEO")
- }
-}
-/// END
\ No newline at end of file
diff --git a/src/mod/ch2/snowgrave_plot/snowgrave_plot.gml b/src/mod/ch2/snowgrave_plot/snowgrave_plot.gml
new file mode 100644
index 0000000..ccb6893
--- /dev/null
+++ b/src/mod/ch2/snowgrave_plot/snowgrave_plot.gml
@@ -0,0 +1,32 @@
+/// FUNCTIONS .ignore ifndef DEMO
+
+function set_snowgrave_plot(plot)
+{
+ switch (plot)
+ {
+ case 1:
+ //snowgrave plot = default state (before city)
+ global.flag[915] = 0
+ global.flag[916] = 0
+ case 2:
+ // snowgrave plot = ready for freeze ring
+ global.flag[915] = 2
+ global.flag[916] = 0
+ case 3:
+ // snowgrave plot = after forcefield
+ global.flag[915] = 4
+ global.flag[916] = 0
+ case 4:
+ // snowgrave plot = berdly frozen
+ global.flag[915] = 6
+ global.flag[916] = 0
+ case 5:
+ // snowgrave plot = after rouxls statue scene
+ global.flag[915] = 8
+ global.flag[916] = 0
+ case 6:
+ // snowgrave plot = before NEO
+ global.flag[915] = 9
+ global.flag[916] = 0
+ }
+}
\ No newline at end of file