From cb86993b342613503bdaa766b78d95240dd2c101 Mon Sep 17 00:00:00 2001 From: Mors Date: Thu, 3 Nov 2022 23:25:50 +0300 Subject: [PATCH] Green Demon mode tweaks and more --- DEV_CHANGELOG.md | 11 +++-- data/behavior_data.c | 17 +++++-- include/behavior_data.h | 3 +- launcher/categories.json | 70 +++++++++++++-------------- launcher/presets/Modern.ini | 4 +- launcher/presets/Recommended.ini | 2 +- launcher/presets/Vanilla.ini | 2 +- src/engine/level_script.c | 6 +-- src/game/area.c | 6 +-- src/game/behavior_actions.h | 3 +- src/game/behaviors/boo.inc.c | 4 +- src/game/behaviors/bowser.inc.c | 10 +++- src/game/behaviors/ddd_sub.inc.c | 4 +- src/game/behaviors/koopa.inc.c | 8 +-- src/game/behaviors/mushroom_1up.inc.c | 44 +++++++++++++++-- src/game/behaviors/snowman.inc.c | 4 +- src/game/interaction.c | 4 +- src/game/level_update.c | 2 +- src/game/mario_actions_cutscene.c | 6 +-- src/game/settings.c | 2 +- src/pc/configfile.c | 2 +- 21 files changed, 137 insertions(+), 77 deletions(-) diff --git a/DEV_CHANGELOG.md b/DEV_CHANGELOG.md index 9eebebe..5517a99 100644 --- a/DEV_CHANGELOG.md +++ b/DEV_CHANGELOG.md @@ -4,7 +4,6 @@ This is the changelog for the current development commit of the game. For the ch ### Additions: - Added the controller rumble feature from the Shindou version of the game. The strength of it can be adjusted from the "Input Mapping" page. -- Completely overhauled the camera options with brand new camera modes. - Added 11 new preset color palettes for Mario, and increased the customization settings for custom Mario colors. - Added a setting to disable the "M" logo on Mario's cap. - Added the "Save the Lives Count" setting, which allows you to save the number of lives you got to your save file. @@ -12,7 +11,10 @@ This is the changelog for the current development commit of the game. For the ch - Added the "Fix Exploits" setting, which fixes several exploits in the game like the bomb clip, hands-free holding, and the Backwards Long Jump. ### Changes: +- Completely overhauled the \"Stay in Course After Getting a Star\" setting. You no longer get kicked out of a level after defeating bosses or getting key stars. This should make the whole experience way more seamless. - Completely overhauled the custom camera mode. It should now feel much more natural to use and behave much closer to the cameras of more modern 3D platformers. +- Changed how controller button mapping works. This unfortunately makes button mapping way harder without the use of the launcher. +- Tweaked the difficulty of the "Constant Chase!" mode option for the Green Demon Mode and made it way more forgiving. For those who want an experience closer to how it was before, now there's an "Unfair Chase!!!" option as well. - Updated the codebase to include the latest commits to the sm64-port repository, and made countless technical changes and fixes in the process. This ideally shouldn't make any visible differences in gameplay. - Made Mario crouch faster with the \"Improved Controls\" setting enabled. - Made it easier to do long jumps with the \"Improved Controls\" setting. @@ -27,15 +29,18 @@ This is the changelog for the current development commit of the game. For the ch - Altered the default presets slightly. ### Fixes: -- Fixed a bug that would cause the level progression to break when "Tie Bowser's Sub to Missions" and "Stay in Course After Getting a Star" settings are both enabled. +- Fixed a bug that would cause the level progression to break when \"Tie Bowser's Sub to Missions\" and \"Stay in Course After Getting a Star\" settings are both enabled. - Fixed custom player colors affecting other objects in the game. - Made fixes mouse movement in the Mario's face screen. - Made Mario's face not get affected by the custom player colors. - Fixed some inconsistencies with some internal setting names, which would result in with unpredictable behavior. ### Launcher: +- Made various small improvements to the launcher. +- Completely overhauled the way controller button mapping works. Now you have to assign buttons to actions, not the other way around. This should make it much easier to remap non-standard controllers for the game. - Made the launcher load the recommended preset value when a setting is missing from the settings file. This should fix many issues caused by upgrading the game from older versions. - Fixed incorrect preset loading behavior and reverted it back to how it functioned prior to v2.1.0. - Made the launcher reload settings after closing the game. - Fixed the menu position incorrectly moving around when you minimize the launcher window while it's in fullscreen. -- Added all the new option types for the new settings fields. +- Fixed the launched game appearing behind the launcher window. +- Fixed many more minor bugs. \ No newline at end of file diff --git a/data/behavior_data.c b/data/behavior_data.c index 379fb2a..a179a75 100644 --- a/data/behavior_data.c +++ b/data/behavior_data.c @@ -4807,6 +4807,19 @@ const BehaviorScript bhvHidden1upInPole[] = { END_LOOP(), }; +const BehaviorScript bhvGreenDemon[] = { + BEGIN(OBJ_LIST_LEVEL), + OR_INT(oFlags, (OBJ_FLAG_COMPUTE_ANGLE_TO_MARIO | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)), + BILLBOARD(), + SET_HITBOX_WITH_OFFSET(/*Radius*/ 30, /*Height*/ 30, /*Downwards offset*/ 0), + SET_FLOAT(oGraphYOffset, 30), + CALL_NATIVE(bhv_1up_common_init), + BEGIN_LOOP(), + SET_INT(oIntangibleTimer, 0), + CALL_NATIVE(bhv_1up_green_demon_loop), + END_LOOP(), +}; + const BehaviorScript bhvHidden1upInPoleTrigger[] = { BEGIN(OBJ_LIST_LEVEL), OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE), @@ -6105,6 +6118,4 @@ const BehaviorScript bhvIntroScene[] = { BEGIN_LOOP(), CALL_NATIVE(bhv_intro_scene_loop), END_LOOP(), -}; - - +}; \ No newline at end of file diff --git a/include/behavior_data.h b/include/behavior_data.h index 66c410b..d2094e1 100644 --- a/include/behavior_data.h +++ b/include/behavior_data.h @@ -427,6 +427,7 @@ extern const BehaviorScript bhv1upJumpOnApproach[]; extern const BehaviorScript bhvHidden1up[]; extern const BehaviorScript bhvHidden1upTrigger[]; extern const BehaviorScript bhvHidden1upInPole[]; +extern const BehaviorScript bhvGreenDemon[]; extern const BehaviorScript bhvHidden1upInPoleTrigger[]; extern const BehaviorScript bhvHidden1upInPoleSpawner[]; extern const BehaviorScript bhvControllablePlatform[]; @@ -543,4 +544,4 @@ extern const BehaviorScript bhvEndBirds2[]; extern const BehaviorScript bhvIntroScene[]; extern const BehaviorScript bhvUnusedFakeStar[]; -#endif // BEHAVIOR_DATA_H +#endif // BEHAVIOR_DATA_H \ No newline at end of file diff --git a/launcher/categories.json b/launcher/categories.json index d06a18f..7f47108 100644 --- a/launcher/categories.json +++ b/launcher/categories.json @@ -2,7 +2,7 @@ "title": "DISPLAY", "items": [{ "internal_name": "fullscreen", - "description": "Makes the game run at fullscreen. Can be toggled in-game via the \"Alt + Enter\" key combo.", + "description": "Makes the game run in fullscreen. Can be toggled in-game via the \"Alt + Enter\" key combo.", "os": OS_ANY, "type": TYPE_BOOL, "enabled_by": -1, @@ -10,7 +10,7 @@ "name": "Fullscreen" }, { "internal_name": "default_monitor", - "description": "The monitor the game renders on in fullscreen.", + "description": "The monitor the game renders on in the fullscreen mode.", "os": OS_ANY, "type": TYPE_MONITOR, "enabled_by": -1, @@ -150,7 +150,7 @@ "name": "Frame Rate" }, { "internal_name": "draw_distance", - "description": "Allows you to increase or decrease the draw distance for certain objects. Disabling this setting forces the game to always render distant objects. Any changes to this setting may affect the gameplay slightly, and can lead to minor graphical issues.", + "description": "Allows you to change the draw distance for certain objects. Disabling this setting forces the game to always render distant objects. Changes to this setting may affect the gameplay and lead to minor graphical issues.", "os": OS_ANY, "type": TYPE_DRAW_DISTANCE, "enabled_by": -1, @@ -166,7 +166,7 @@ "name": "Level of Detail" }, { "internal_name": "texture_filtering", - "description": "Changes the way the textures are filtered. \"3 Point\" filtering is what's used in the original game, but it only works with the \"Direct3D 11\" backend.", + "description": "Changes the way the textures are filtered. \"3 Point\" filtering is what's used in the original game, but it only works with the \"Direct3D 11\" graphics backend.", "os": OS_ANY, "type": TYPE_TEXTURE_FILTERING, "enabled_by": -1, @@ -182,7 +182,7 @@ "name": "Noise Type" }, { "internal_name": "force_4by3", - "description": "Limits the game aspect ratio to be roughly the same as the original game on Nintendo 64, regardless of the resolution.", + "description": "Limits the game's aspect ratio to be roughly the same as the original game on Nintendo 64, regardless of the resolution.", "os": OS_ANY, "type": TYPE_BOOL, "enabled_by": -1, @@ -204,7 +204,7 @@ "name": "Improved Controls" }, { "internal_name": "improved_swimming", - "description": "Makes tweaks to the swimming controls specifically, also making them more precise.", + "description": "Makes minor tweaks to the swimming controls, also making them more precise.", "os": OS_ANY, "type": TYPE_BOOL, "enabled_by": -1, @@ -236,7 +236,7 @@ "name": "D-Pad Controls" }, { "internal_name": "full_air_control", - "description": "Gives you near full control over Mario's direction on air. This setting significantly alters the way the controls feel and is not recommended for the first-time players.", + "description": "Gives you near full control over Mario's direction in air. This setting significantly alters the way the controls feel and is not recommended for the first-time players.", "os": OS_ANY, "type": TYPE_BOOL, "enabled_by": -1, @@ -257,13 +257,13 @@ "disabled_by": -1, "name": "Apply Bug Fixes" }, { - "internal_name": "save_the_lives_count", + "internal_name": "save_lives_to_save_file", "description": "Saves amount of lives you have to the currently selected save file. In the original game the number of lives resets each time you load a save file.", "os": OS_ANY, "type": TYPE_BOOL, "enabled_by": -1, "disabled_by": -1, - "name": "Save the Lives Count" + "name": "Save Lives to Save File" }, { "internal_name": "make_items_respawn", "description": "Makes Koopa shells and blue coin switches respawn after use.", @@ -282,7 +282,7 @@ "name": "Remove Inconvenient Warps" }, { "internal_name": "improve_powerups", - "description": "Makes it so that underwater shells last longer, Metal Mario sinks faster, and Metal Mario's interactions with hazards become more consistent.", + "description": "Makes it so that underwater shells last longer and Metal Mario sinks faster, and Metal Mario's interactions become more consistent.", "os": OS_ANY, "type": TYPE_BOOL, "enabled_by": -1, @@ -290,7 +290,7 @@ "name": "Improve Powerups" }, { "internal_name": "improve_enemies", - "description": "Makes the behavior some of the enemies (specifically Boos, clams, and tiny Goombas) less annoying.", + "description": "Tweaks the behavior of some enemies, specifically Boos, Clams, and Tiny Goombas.", "os": OS_ANY, "type": TYPE_BOOL, "enabled_by": -1, @@ -322,7 +322,7 @@ "name": "Disable Fall Damage" }, { "internal_name": "allow_leaving_the_course_at_any_time", - "description": "Makes it so that you don't have to be standing still to leave the course from the pause menu.", + "description": "Makes it so that you don't have to be standing still to leave the course from the pause menu. Do not use this to cheat, that wouldn't be very nice!", "os": OS_ANY, "type": TYPE_BOOL, "enabled_by": -1, @@ -352,7 +352,7 @@ "title": "PROGRESSION", "items": [{ "internal_name": "tie_bowsers_sub_to_missions", - "description": "Forces Bowser's submarine to always appear in the first mission of Dire Dire Docks, and never in the later ones. Recommended if you have no idea what this setting is all about.", + "description": "Makes Bowser's submarine to always appear in the first mission of Dire Dire Docks, and never in the later ones. It's recommended to leave this enabled if you have no idea what any of this is about.", "os": OS_ANY, "type": TYPE_BOOL, "enabled_by": -1, @@ -360,7 +360,7 @@ "name": "Tie Bowser's Sub to Missions" }, { "internal_name": "always_stay_in_course", - "description": "Allows you to continue playing the game after a getting a Power Star, and makes gameplay changes to make it all work depending on the option. When not sure, either go with \"Nah\" or \"Smart\".", + "description": "Allows you to continue playing the game after a getting a Power Star, and makes gameplay changes to make it all work.", "os": OS_ANY, "type": TYPE_STAR_MESSAGE, "enabled_by": -1, @@ -376,7 +376,7 @@ "name": "Skip Mission Select" }, { "internal_name": "auto_switch_to_the_next_mission", - "description": "Makes completing a course automatically start the next available mission.", + "description": "Makes completing a mission automatically start the next available one.", "os": OS_ANY, "type": TYPE_BOOL, "enabled_by": -1, @@ -398,7 +398,7 @@ "title": "CAMERA", "items": [{ "internal_name": "default_camera_mode", - "description": "Changes the default camera mode.\n\nThe default mode from the original game is \"Lakitu Cam\".", + "description": "Changes the default camera mode.\nThe default mode from the original game is \"Lakitu Cam\".", "os": OS_ANY, "type": TYPE_CAMERA_MODE, "enabled_by": -1, @@ -406,7 +406,7 @@ "name": "Default Camera Mode" }, { "internal_name": "alternate_camera_mode", - "description": "Changes the alternate camera mode that you can switch to in-game.\n\nThe default mode from the original game is \"Mario Cam\".", + "description": "Changes the alternate camera mode that you can switch to in-game.\nThe default mode from the original game is \"Mario Cam\".", "os": OS_ANY, "type": TYPE_CAMERA_MODE, "enabled_by": -1, @@ -422,7 +422,7 @@ "name": "Horizontal Analog Camera" }, { "internal_name": "vertical_analog_camera", - "description": "Allows you to tilt the camera vertically using the right analog stick on the new camera modes.", + "description": "Allows you to tilt the camera vertically using the right analog stick in the \"Custom\" camera mode.", "os": OS_ANY, "type": TYPE_BOOL, "enabled_by": -1, @@ -454,7 +454,7 @@ "name": "Invert Vertical Camera Controls" }, { "internal_name": "analog_camera_speed", - "description": "Sets the movement speed of the analog camera.\n\nThe default value is 32.", + "description": "Sets the movement speed of the analog camera.\nThe default value is 32.", "os": OS_ANY, "type": TYPE_FLOAT, "enabled_by": -1, @@ -462,7 +462,7 @@ "name": "Analog Camera Speed" }, { "internal_name": "additional_camera_distance", - "description": "Pans the camera further away, regardless of the camera mode.\n\nThe default value is 0.", + "description": "Pans the camera further away, regardless of the camera mode.\nThe default value is 0.", "os": OS_ANY, "type": TYPE_FLOAT, "enabled_by": -1, @@ -470,7 +470,7 @@ "name": "Additional Camera Distance" }, { "internal_name": "additional_fov", - "description": "Adds additional field of view over the original.\n\nThe default value is 0.", + "description": "Adds additional field of view over the original.\nThe default value is 0.", "os": OS_ANY, "type": TYPE_FLOAT, "enabled_by": -1, @@ -562,7 +562,7 @@ "title": "MOUSE", "items": [{ "internal_name": "mouse_support", - "description": "Lets you navigate the menus and control the camera with your mouse. Controlling the camera only works when the \"Analog Camera\" settings are on, and works best with the \"Custom Camera\" settings.", + "description": "Allows you to navigate the menus and control the camera with your mouse. Only fully works when the \"Analog Camera\" settings are enabled, and works best with the \"Custom\" camera mode.", "os": OS_ANY, "type": TYPE_BOOL, "enabled_by": -1, @@ -570,7 +570,7 @@ "name": "Mouse Support" }, { "internal_name": "mouse_sensitivity", - "description": "Sets the mouse sensitivity when the \"Mouse Support\" setting is on.\n\nThe default value is 4.", + "description": "Sets the mouse sensitivity when the \"Mouse Support\" setting is on.\nThe default value is 4.", "os": OS_ANY, "type": TYPE_FLOAT, "enabled_by": 0, @@ -810,7 +810,7 @@ "title": "COLORS", "items": [{ "internal_name": "color_palette", - "description": "Lets you to use a predefined color palette.\nSetting this to anything other than \"Custom\" will override your custom color values the next time the game is launched.", + "description": "Allows you to use a predefined color palette.\nSetting this to anything other than \"Custom\" will override your custom color values the next time the game is launched.", "os": OS_ANY, "type": TYPE_PALETTE, "enabled_by": -1, @@ -1084,7 +1084,7 @@ "name": "Fullscreen Refresh Rate" }, { "internal_name": "custom_camera_distance", - "description": "Sets the default camera distance when using the \"Modern\" and \"Custom\" camera settings.\n\nThe default value is 100.", + "description": "Sets the default camera distance when using the \"Modern\" and \"Custom\" camera settings.\nThe default value is 100.", "os": OS_ANY, "type": TYPE_FLOAT, "enabled_by": -1, @@ -1092,7 +1092,7 @@ "name": "Custom Camera Distance" }, { "internal_name": "zoomed_out_custom_camera_distance", - "description": "Sets the zoomed out camera distance when using the \"Modern\" and \"Custom\" camera settings.\n\nThe default value is 180.", + "description": "Sets the zoomed out camera distance when using the \"Modern\" and \"Custom\" camera settings.\nThe default value is 180.", "os": OS_ANY, "type": TYPE_FLOAT, "enabled_by": -1, @@ -1216,7 +1216,7 @@ "title": "KEY MAPPING", "items": [{ "internal_name": "key_a", - "description": "The keyboard key assigned to the A button.\n\nThe value is a DirectInput scan code.", + "description": "The keyboard key assigned to the A button.\nThe value is a DirectInput scan code.", "os": OS_ANY, "type": TYPE_KEY, "enabled_by": -1, @@ -1224,7 +1224,7 @@ "name": "A (Jump)" }, { "internal_name": "key_b", - "description": "The keyboard key assigned to the B button.\n\nThe value is a DirectInput scan code.", + "description": "The keyboard key assigned to the B button.\nThe value is a DirectInput scan code.", "os": OS_ANY, "type": TYPE_KEY, "enabled_by": -1, @@ -1240,7 +1240,7 @@ "name": "Start (Pause)" }, { "internal_name": "key_l", - "description": "The keyboard key assigned to the L trigger.\n\nThe value is a DirectInput scan code.", + "description": "The keyboard key assigned to the L trigger.\nThe value is a DirectInput scan code.", "os": OS_ANY, "type": TYPE_KEY, "enabled_by": -1, @@ -1248,7 +1248,7 @@ "name": "L (Center Camera)" }, { "internal_name": "key_r", - "description": "The keyboard key assigned to the R trigger.\n\nThe value is a DirectInput scan code.", + "description": "The keyboard key assigned to the R trigger.\nThe value is a DirectInput scan code.", "os": OS_ANY, "type": TYPE_KEY, "enabled_by": -1, @@ -1256,7 +1256,7 @@ "name": "R (Change Camera)" }, { "internal_name": "key_z", - "description": "The keyboard key assigned to the Z trigger.\n\nThe value is a DirectInput scan code.", + "description": "The keyboard key assigned to the Z trigger.\nThe value is a DirectInput scan code.", "os": OS_ANY, "type": TYPE_KEY, "enabled_by": -1, @@ -1296,7 +1296,7 @@ "name": "C-Right (Rotate Right)" }, { "internal_name": "key_stickup", - "description": "The keyboard key assigned to the stick up action.\n\nThe value is a DirectInput scan code.", + "description": "The keyboard key assigned to the stick up action.\nThe value is a DirectInput scan code.", "os": OS_ANY, "type": TYPE_KEY, "enabled_by": -1, @@ -1304,7 +1304,7 @@ "name": "Stick Up" }, { "internal_name": "key_stickdown", - "description": "The keyboard key assigned to the stick down action.\n\nThe value is a DirectInput scan code.", + "description": "The keyboard key assigned to the stick down action.\nThe value is a DirectInput scan code.", "os": OS_ANY, "type": TYPE_KEY, "enabled_by": -1, @@ -1312,7 +1312,7 @@ "name": "Stick Down" }, { "internal_name": "key_stickleft", - "description": "The keyboard key assigned to the stick left action.\n\nThe value is a DirectInput scan code.", + "description": "The keyboard key assigned to the stick left action.\nThe value is a DirectInput scan code.", "os": OS_ANY, "type": TYPE_KEY, "enabled_by": -1, @@ -1320,7 +1320,7 @@ "name": "Stick Left" }, { "internal_name": "key_stickright", - "description": "The keyboard key assigned to the stick right action.\n\nThe value is a DirectInput scan code.", + "description": "The keyboard key assigned to the stick right action.\nThe value is a DirectInput scan code.", "os": OS_ANY, "type": TYPE_KEY, "enabled_by": -1, diff --git a/launcher/presets/Modern.ini b/launcher/presets/Modern.ini index bd27f3b..237bb8d 100644 --- a/launcher/presets/Modern.ini +++ b/launcher/presets/Modern.ini @@ -31,7 +31,7 @@ dpad_controls = "true" full_air_control = "false" [GAMEPLAY] apply_bug_fixes = "2" -save_the_lives_count = "true" +save_lives_to_save_file = "true" make_items_respawn = "true" remove_inconvenient_warps = "true" improve_powerups = "true" @@ -44,7 +44,7 @@ make_secrets_visible = "false" fix_exploits = "false" [PROGRESSION] tie_bowsers_sub_to_missions = "true" -always_stay_in_course = "3" +always_stay_in_course = "2" skip_mission_select = "true" auto_switch_to_the_next_mission = "true" skip_cutscenes = "false" diff --git a/launcher/presets/Recommended.ini b/launcher/presets/Recommended.ini index 3f57c5c..a049b5e 100644 --- a/launcher/presets/Recommended.ini +++ b/launcher/presets/Recommended.ini @@ -31,7 +31,7 @@ dpad_controls = "true" full_air_control = "false" [GAMEPLAY] apply_bug_fixes = "2" -save_the_lives_count = "true" +save_lives_to_save_file = "true" make_items_respawn = "true" remove_inconvenient_warps = "true" improve_powerups = "true" diff --git a/launcher/presets/Vanilla.ini b/launcher/presets/Vanilla.ini index faa0cdd..0d74410 100644 --- a/launcher/presets/Vanilla.ini +++ b/launcher/presets/Vanilla.ini @@ -31,7 +31,7 @@ dpad_controls = "false" full_air_control = "false" [GAMEPLAY] apply_bug_fixes = "0" -save_the_lives_count = "false" +save_lives_to_save_file = "false" make_items_respawn = "false" remove_inconvenient_warps = "false" improve_powerups = "false" diff --git a/src/engine/level_script.c b/src/engine/level_script.c index 4b5b946..c53f753 100644 --- a/src/engine/level_script.c +++ b/src/engine/level_script.c @@ -763,7 +763,7 @@ static void level_cmd_place_object(void) { gAreas[sCurrAreaIndex].objectSpawnInfos = spawnInfo; - if (configStayInCourse == 3) + if (configStayInCourse == 2) { remain_mod_objects(spawnInfo); } @@ -787,7 +787,7 @@ static void level_cmd_create_warp_node(void) { warpNode->next = gAreas[sCurrAreaIndex].warpNodes; gAreas[sCurrAreaIndex].warpNodes = warpNode; - if (configStayInCourse == 3) + if (configStayInCourse == 2) { remain_mod_warp_nodes(warpNode); } @@ -1147,4 +1147,4 @@ struct LevelCommand *level_script_execute(struct LevelCommand *cmd) { alloc_display_list(0); return sCurrentCmd; -} +} \ No newline at end of file diff --git a/src/game/area.c b/src/game/area.c index cc8c482..08c1e12 100644 --- a/src/game/area.c +++ b/src/game/area.c @@ -286,8 +286,8 @@ void load_mario_area(void) { spawn_objects_from_info(0, gMarioSpawnInfo); } - if (gGreenDemon > 1 && gCurrLevelNum != LEVEL_CASTLE && gCurrLevelNum != LEVEL_CASTLE_COURTYARD && gCurrLevelNum != LEVEL_CASTLE_GROUNDS) { - spawn_object(gMarioObject, MODEL_1UP, bhvHidden1upInPole); + if (gGreenDemon > 1 && gCurrLevelNum != LEVEL_CASTLE && gCurrLevelNum != LEVEL_CASTLE_COURTYARD && gCurrLevelNum != LEVEL_CASTLE_GROUNDS && gCurrLevelNum != LEVEL_BOWSER_1 && gCurrLevelNum != LEVEL_BOWSER_2 && gCurrLevelNum != LEVEL_BOWSER_3) { + spawn_object_relative(0, 0, 256, 0, gMarioObject, MODEL_1UP, bhvGreenDemon); } } @@ -453,4 +453,4 @@ void render_game(void) { D_8032CE74 = NULL; D_8032CE78 = NULL; -} +} \ No newline at end of file diff --git a/src/game/behavior_actions.h b/src/game/behavior_actions.h index 9793917..0b2376c 100644 --- a/src/game/behavior_actions.h +++ b/src/game/behavior_actions.h @@ -399,6 +399,7 @@ void bhv_1up_jump_on_approach_loop(void); void bhv_1up_hidden_loop(void); void bhv_1up_hidden_trigger_loop(void); void bhv_1up_hidden_in_pole_loop(void); +void bhv_1up_green_demon_loop(void); void bhv_1up_hidden_in_pole_trigger_loop(void); void bhv_1up_hidden_in_pole_spawner_loop(void); void bhv_controllable_platform_init(void); @@ -576,4 +577,4 @@ Gfx *geo_scale_bowser_key(s32 run, struct GraphNode *node, UNUSED f32 mtx[4][4]) extern struct WaterDropletParams gShallowWaterSplashDropletParams; extern struct WaterDropletParams gShallowWaterWaveDropletParams; -#endif // BEHAVIOR_ACTIONS_H +#endif // BEHAVIOR_ACTIONS_H \ No newline at end of file diff --git a/src/game/behaviors/boo.inc.c b/src/game/behaviors/boo.inc.c index f3a59c0..e10673d 100644 --- a/src/game/behaviors/boo.inc.c +++ b/src/game/behaviors/boo.inc.c @@ -193,7 +193,7 @@ static void boo_move_during_hit(s32 roll, f32 fVel) { s32 oscillationVel = o->oTimer * 0x800 + 0x800; o->oForwardVel = fVel; - o->oVelY = coss(oscillationVel); + o->oVelY = coss(oscillationVel) * (configBetterEnemies ? 0x200 : 1.0f); o->oMoveAngleYaw = o->oBooMoveYawDuringHit; if (roll != FALSE) { @@ -931,4 +931,4 @@ void bhv_boo_staircase(void) { break; } -} +} \ No newline at end of file diff --git a/src/game/behaviors/bowser.inc.c b/src/game/behaviors/bowser.inc.c index cbf0c73..9ff4cf9 100644 --- a/src/game/behaviors/bowser.inc.c +++ b/src/game/behaviors/bowser.inc.c @@ -1274,6 +1274,10 @@ s32 bowser_dead_default_stage_ending(void) { bowser_spawn_collectable(); set_mario_npc_dialog(MARIO_DIALOG_STOP); ret = TRUE; + + if (gGreenDemon > 1) { + spawn_object_relative(0, 0, 256, 0, gMarioObject, MODEL_1UP, bhvHidden1upInPole); + } } return ret; } @@ -1315,6 +1319,10 @@ s32 bowser_dead_final_stage_ending(void) { // And at last, hide him bowser_dead_hide(); ret = TRUE; + + if (gGreenDemon > 1) { + spawn_object_relative(0, 0, 256, 0, gMarioObject, MODEL_1UP, bhvGreenDemon); + } } return ret; } @@ -1916,4 +1924,4 @@ Gfx *geo_bits_bowser_coloring(s32 callContext, struct GraphNode *node, UNUSED s3 gSPEndDisplayList(gfx); } return gfxHead; -} +} \ No newline at end of file diff --git a/src/game/behaviors/ddd_sub.inc.c b/src/game/behaviors/ddd_sub.inc.c index d289136..6743cb9 100644 --- a/src/game/behaviors/ddd_sub.inc.c +++ b/src/game/behaviors/ddd_sub.inc.c @@ -1,7 +1,7 @@ // ddd_sub.c.inc void bhv_bowsers_sub_loop(void) { - if (configStayInCourse == 3) + if (configStayInCourse == 2) { if (!configBowsersSub && (save_file_get_flags() & (SAVE_FLAG_HAVE_KEY_2 | SAVE_FLAG_UNLOCKED_UPSTAIRS_DOOR))) { @@ -13,4 +13,4 @@ void bhv_bowsers_sub_loop(void) { if ((configBowsersSub && gCurrActNum >= 2) || (!configBowsersSub && (save_file_get_flags() & (SAVE_FLAG_HAVE_KEY_2 | SAVE_FLAG_UNLOCKED_UPSTAIRS_DOOR)))) obj_mark_for_deletion(o); -} +} \ No newline at end of file diff --git a/src/game/behaviors/koopa.inc.c b/src/game/behaviors/koopa.inc.c index 43678e4..568d8bd 100644 --- a/src/game/behaviors/koopa.inc.c +++ b/src/game/behaviors/koopa.inc.c @@ -522,7 +522,7 @@ static void koopa_the_quick_act_show_init_text(void) { s32 response = obj_update_race_proposition_dialog( sKoopaTheQuickProperties[o->oKoopaTheQuickRaceIndex].initText); - if ((configStayInCourse == 3) && (gCurrCourseNum == COURSE_BOB)) + if ((configStayInCourse == 2) && (gCurrCourseNum == COURSE_BOB)) { struct Object *checkForFlag = cur_obj_nearest_object_with_behavior(bhvKoopaRaceEndpoint); @@ -764,7 +764,7 @@ static void koopa_the_quick_act_after_race(void) { o->oTimer = 0; // Lost or cheated in Bob-Omb Race: - if ((configStayInCourse == 3) && (gCurrCourseNum == COURSE_BOB) && (o->parentObj->oKoopaRaceEndpointRaceStatus == 0)) + if ((configStayInCourse == 2) && (gCurrCourseNum == COURSE_BOB) && (o->parentObj->oKoopaRaceEndpointRaceStatus == 0)) { // JUMP o->oVelY = 140.0f; @@ -783,7 +783,7 @@ static void koopa_the_quick_act_after_race(void) { o->parentObj->oKoopaRaceEndpointRaceStatus = 0; } - if ((configStayInCourse == 3) && (gCurrCourseNum == COURSE_BOB) && (o->oPosY > 5500)) + if ((configStayInCourse == 2) && (gCurrCourseNum == COURSE_BOB) && (o->oPosY > 5500)) { spawn_object_abs_with_rot_degrees(o, 0, MODEL_KOOPA_WITH_SHELL, bhvKoopa, 0x01020000, -4004, 0, 5221, 0, 0, 0); o->parentObj->oKoopaRaceEndpointKoopaFinished = FALSE; @@ -887,4 +887,4 @@ void bhv_koopa_race_endpoint_update(void) { } } } -} +} \ No newline at end of file diff --git a/src/game/behaviors/mushroom_1up.inc.c b/src/game/behaviors/mushroom_1up.inc.c index 9d762b5..5932bae 100644 --- a/src/game/behaviors/mushroom_1up.inc.c +++ b/src/game/behaviors/mushroom_1up.inc.c @@ -57,7 +57,7 @@ void one_up_loop_in_air(void) { } } -void pole_1up_move_towards_mario(void) { +void pole_1up_move_towards_mario(s16 speed) { f32 sp34 = gMarioObject->header.gfx.pos[0] - o->oPosX; f32 sp30 = gMarioObject->header.gfx.pos[1] + 120.0f - o->oPosY; f32 sp2C = gMarioObject->header.gfx.pos[2] - o->oPosZ; @@ -65,8 +65,8 @@ void pole_1up_move_towards_mario(void) { obj_turn_toward_object(o, gMarioObject, 16, 0x1000); o->oMoveAnglePitch = approach_s16_symmetric(o->oMoveAnglePitch, sp2A, 0x1000); - o->oVelY = sins(o->oMoveAnglePitch) * 30.0f; - o->oForwardVel = coss(o->oMoveAnglePitch) * 30.0f; + o->oVelY = sins(o->oMoveAnglePitch) * speed; + o->oForwardVel = coss(o->oMoveAnglePitch) * speed; bhv_1up_interact(); } @@ -290,7 +290,7 @@ void bhv_1up_hidden_in_pole_loop(void) { break; case 1: - pole_1up_move_towards_mario(); + pole_1up_move_towards_mario(30.0f); sp26 = object_step(); break; @@ -310,6 +310,40 @@ void bhv_1up_hidden_in_pole_loop(void) { } } +void bhv_1up_green_demon_loop(void) { + UNUSED s16 sp26; + switch (o->oAction) { + case 0: + o->header.gfx.node.flags |= GRAPH_RENDER_INVISIBLE; + if (o->o1UpHiddenUnkF4 == o->oBehParams2ndByte) { + o->oVelY = 40.0f; + o->oAction = 3; + o->header.gfx.node.flags &= ~GRAPH_RENDER_INVISIBLE; + play_sound(SOUND_GENERAL2_1UP_APPEAR, gGlobalSoundSource); + } + break; + + case 1: + pole_1up_move_towards_mario((gGreenDemon > 2) ? 30.0f : 20.0f); + sp26 = object_step(); + break; + + case 3: + sp26 = object_step(); + if (o->oTimer >= 18) + spawn_object(o, MODEL_NONE, bhvSparkleSpawn); + + one_up_loop_in_air(); + + if (o->oTimer == ((gGreenDemon > 2) ? 105 : 90)) { + cur_obj_become_tangible(); + o->oAction = 1; + o->oForwardVel = 10.0f; + } + break; + } +} + void bhv_1up_hidden_in_pole_trigger_loop(void) { struct Object *sp1C; @@ -334,4 +368,4 @@ void bhv_1up_hidden_in_pole_spawner_loop(void) { o->activeFlags = ACTIVE_FLAG_DEACTIVATED; } -} +} \ No newline at end of file diff --git a/src/game/behaviors/snowman.inc.c b/src/game/behaviors/snowman.inc.c index 8fcf6f9..3b4407b 100644 --- a/src/game/behaviors/snowman.inc.c +++ b/src/game/behaviors/snowman.inc.c @@ -178,7 +178,7 @@ void bhv_snowmans_head_init(void) { o->oFriction = 0.999f; o->oBuoyancy = 2.0f; - if (configStayInCourse == 3) + if (configStayInCourse == 2) { return; } @@ -242,4 +242,4 @@ void bhv_snowmans_body_checkpoint_loop(void) { if (o->parentObj->activeFlags == ACTIVE_FLAG_DEACTIVATED) o->activeFlags = ACTIVE_FLAG_DEACTIVATED; -} +} \ No newline at end of file diff --git a/src/game/interaction.c b/src/game/interaction.c index 79b5915..5ffbf3b 100644 --- a/src/game/interaction.c +++ b/src/game/interaction.c @@ -952,7 +952,7 @@ u32 interact_star_or_key(struct MarioState *m, UNUSED u32 interactType, struct O update_mario_sound_and_camera(m); #endif - if (configStayInCourse == 3) + if (configStayInCourse == 2) { remain_mod_spawn_objects(o); } @@ -2041,4 +2041,4 @@ void mario_handle_special_floors(struct MarioState *m) { } } } -} +} \ No newline at end of file diff --git a/src/game/level_update.c b/src/game/level_update.c index a07d9ed..f897df8 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -595,7 +595,7 @@ void warp_area(void) { init_mario_after_warp(); - if (configStayInCourse == 3) + if (configStayInCourse == 2) { remain_mod_load_area(); } diff --git a/src/game/mario_actions_cutscene.c b/src/game/mario_actions_cutscene.c index a2ed53a..542658b 100644 --- a/src/game/mario_actions_cutscene.c +++ b/src/game/mario_actions_cutscene.c @@ -644,7 +644,7 @@ void general_star_dance_handler(struct MarioState *m, s32 isInWater) { m->actionState = 1; } // If it's automatic - else if (configStayInCourse == 2) { + else if (configStayInCourse == 3) { if ((gLastCompletedStarNum == 7) || (gCurrAreaIndex > 1 && (gCurrLevelNum == LEVEL_SSL || gCurrLevelNum == LEVEL_LLL || gCurrLevelNum == LEVEL_WDW))) { enable_time_stop(); @@ -657,7 +657,7 @@ void general_star_dance_handler(struct MarioState *m, s32 isInWater) { } } // If it's set to always - else if (configStayInCourse == 3) { + else if (configStayInCourse == 2) { save_file_do_save(gCurrSaveFileNum - 1); m->actionState = 2; } @@ -2872,4 +2872,4 @@ s32 mario_execute_cutscene_action(struct MarioState *m) { } return cancel; -} +} \ No newline at end of file diff --git a/src/game/settings.c b/src/game/settings.c index 4b2ed16..c06a7c1 100644 --- a/src/game/settings.c +++ b/src/game/settings.c @@ -323,7 +323,7 @@ unsigned int configKeyWalk = DIK_LSHIFT; s16 gCollectedStar = 0; s8 stay_in_level() { - if (configStayInCourse == 2 && ( + if (configStayInCourse == 3 && ( // If we have collected the first star in the first act in these levels, kick us out. (gCurrActNum == 1 && gCollectedStar == 0 && (gCurrLevelNum == LEVEL_BOB || gCurrLevelNum == LEVEL_WF || gCurrLevelNum == LEVEL_JRB || gCurrLevelNum == LEVEL_BBH || diff --git a/src/pc/configfile.c b/src/pc/configfile.c index 217e123..5efc2df 100644 --- a/src/pc/configfile.c +++ b/src/pc/configfile.c @@ -69,7 +69,7 @@ static const struct ConfigOption options[] = { { .name = "GAMEPLAY", .type = CONFIG_TYPE_SECTION }, { .name = "apply_bug_fixes", .type = CONFIG_TYPE_UINT, .uintValue = &configApplyBugFixes }, - { .name = "save_the_lives_count", .type = CONFIG_TYPE_BOOL, .boolValue = &configSaveLives }, + { .name = "save_lives_to_save_file", .type = CONFIG_TYPE_BOOL, .boolValue = &configSaveLives }, { .name = "make_items_respawn", .type = CONFIG_TYPE_BOOL, .boolValue = &configRespawnCertainItems }, { .name = "remove_inconvenient_warps", .type = CONFIG_TYPE_BOOL, .boolValue = &configRemoveAnnoyingWarps }, { .name = "improve_powerups", .type = CONFIG_TYPE_BOOL, .boolValue = &configBetterPowerups },