Expanded the functionality of Fallout1Behavior

* change the world map music and the credits music to match FO1 files.

Increased the maximum value of the combat speed slider.
Some minor code edits.
This commit is contained in:
NovaRain
2023-04-30 09:21:53 +08:00
parent a0cf633899
commit 41a1fead58
6 changed files with 17 additions and 3 deletions
+1
View File
@@ -232,6 +232,7 @@ DebugEditorKey=0
;- disables playing the final movie/credits after the endgame slideshow
;- disables halving the weight for power armor items
;- endgame_movie script function plays movie 10 or 11 based on the player's gender before the credits
;- changes the world map music to '03wrldmp.acm' and the credits music to 'maybe.acm'
Fallout1Behavior=0
;Time limit in years. Must be between -3 and 13
+2 -1
View File
@@ -98,12 +98,13 @@ WRAP_WATCOM_FUNC1(const char*, findCurrentProc, fo::Program*, program) // Return
WRAP_WATCOM_FUNC1(long, folder_print_line, const char*, text)
WRAP_WATCOM_FUNC1(long, FMtext_width, const char*, text)
WRAP_WATCOM_FUNC1(long, game_get_global_var, long, globalVar)
WRAP_WATCOM_FUNC1(void, gdialogDisplayMsg, const char*, message)
WRAP_WATCOM_FUNC0(long, get_input)
// Searches for message ID in given message file and places result in result argument
WRAP_WATCOM_FUNC3(const char*, getmsg, const fo::MessageList*, fileAddr, fo::MessageNode*, result, long, messageId)
WRAP_WATCOM_FUNC1(void, gdialogDisplayMsg, const char*, message)
WRAP_WATCOM_FUNC1(void, gmouse_3d_set_mode, long, mode)
WRAP_WATCOM_FUNC1(long, gmouse_set_cursor, long, picNum)
WRAP_WATCOM_FUNC0(void, grid_toggle)
WRAP_WATCOM_FUNC1(long, gsound_background_volume_get_set, long, setVolume)
WRAP_WATCOM_FUNC1(void, gsound_play_sfx_file, const char*, name) // Plays SFX sound with given name
WRAP_WATCOM_FUNC1(fo::Window*, GNW_find, long, winRef)
+1 -1
View File
@@ -547,7 +547,7 @@ void DebugEditor::KeyPressedHook(DWORD scanCode, bool pressed) {
}
if (mapGridToggleKey && scanCode == mapGridToggleKey && pressed && IsGameLoaded()) {
__asm call fo::funcoffs::grid_toggle_;
fo::func::grid_toggle();
fo::func::tile_refresh_display();
}
}
+10
View File
@@ -773,6 +773,8 @@ static void F1EngineBehaviorPatch() {
BlockCall(0x4A4343); // disable playing the final movie/credits after the endgame slideshow
SafeWrite8(0x477C71, CodeType::JumpShort); // disable halving the weight for power armor items
HookCall(0x43F872, endgame_movie_hook); // play movie 10 or 11 based on the player's gender before the credits
SafeWrite32(0x4C2361, (DWORD)&"03wrldmp"); // change the world map music to 03wrldmp.acm
SafeWriteStr(0x501A40, "maybe"); // change the credits music to maybe.acm
}
}
@@ -1057,6 +1059,14 @@ void MiscPatches::init() {
HookCall(0x48A954, obj_move_to_tile_hook_redraw);
HookCall(0x483726, map_check_state_hook_redraw);
// Increase the maximum value of the combat speed slider from 50 to 100
const DWORD combatSpeedMaxAddr[] = {
0x492120, 0x49212A, // UpdateThing_
0x493787, 0x493790 // RestoreSettings_
};
SafeWriteBatch<BYTE>(100, combatSpeedMaxAddr);
SafeWrite8(0x519B82, 0x59); // 100.0
// Corrects the height of the black background for death screen subtitles
if (!hrpIsEnabled) SafeWrite32(0x48134D, 38 - (640 * 3)); // main_death_scene_ (shift y-offset 2px up, w/o HRP)
if (!hrpIsEnabled || hrpVersionValid) SafeWrite8(0x481345, 4); // main_death_scene_
+1 -1
View File
@@ -481,7 +481,7 @@ static void __declspec(naked) quest_init_hook() {
}
}
void QuestListPatch() {
static void QuestListPatch() {
MakeCall(0x4974E4, StartPipboy_hack);
MakeCall(0x497173, pipboy_hack_action, 1);
@@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <intrin.h>
#include "..\..\main.h"
#include "..\..\FalloutEngine\Fallout2.h"