├── sfall ├── stdafx.cpp ├── resource.h ├── version.h ├── Game │ ├── stats.cpp │ ├── README.md │ ├── template.h │ ├── GUI │ │ ├── Text.h │ │ └── render.h │ ├── template.cpp │ ├── skills.h │ ├── stats.h │ ├── combatAI.h │ ├── ImprovedAI │ │ ├── AI.SearchTarget.h │ │ ├── AI.Combat.h │ │ └── AI.Behavior.h │ ├── tilemap.h │ ├── objects.h │ ├── AI │ │ └── AIHelpers.h │ ├── objects.cpp │ ├── inventory.h │ ├── skills.cpp │ └── items.h ├── Modules │ ├── Unarmed.cpp │ ├── BugFixes.cpp │ ├── Scripting │ │ ├── Handlers │ │ │ ├── Utils.cpp │ │ │ ├── Inventory.h │ │ │ ├── Combat.h │ │ │ ├── Memory.h │ │ │ ├── Metarule.h │ │ │ ├── Math.h │ │ │ ├── Utils.h │ │ │ ├── Graphics.h │ │ │ ├── Anims.h │ │ │ ├── FileSystem.h │ │ │ ├── Arrays.h │ │ │ └── Worldmap.h │ │ └── Opcodes.h │ ├── SubModules │ │ ├── EnginePerks.h │ │ ├── CombatExt.h │ │ ├── CombatBlock.h │ │ ├── ObjectName.h │ │ ├── DirectDraw.h │ │ └── WindowRender.h │ ├── DebugEditor.h │ ├── Reputations.h │ ├── TalkingHeads.h │ ├── Input.h │ ├── HookScripts │ │ ├── DeathHs.h │ │ ├── HexBlockingHs.h │ │ ├── ObjectHs.h │ │ ├── InventoryHs.h │ │ ├── MiscHs.h │ │ ├── CombatHs.h │ │ └── Common.h │ ├── Interface.h │ ├── BugFixes.h │ ├── CritterPoison.h │ ├── BarBoxes.h │ ├── Sound.h │ ├── MainLoopHook.h │ ├── Objects.h │ ├── EngineTweaks.cpp │ ├── Premade.h │ ├── Credits.h │ ├── BurstMods.h │ ├── Elevators.h │ ├── Tiles.h │ ├── Books.h │ ├── EngineTweaks.h │ ├── KillCounter.h │ ├── MetaruleExtender.h │ ├── Karma.h │ ├── MainMenu.h │ ├── MiscPatches.h │ ├── QuestList.h │ ├── Animations.h │ ├── Console.h │ ├── PlayerModel.h │ ├── LoadOrder.h │ ├── Movies.h │ ├── Module.h │ ├── ScriptShaders.h │ ├── SpeedPatch.h │ ├── Explosions.h │ ├── Skills.h │ ├── AI.h │ ├── Unarmed.h │ ├── Inventory.h │ ├── Criticals.h │ ├── ExtraSaveSlots.h │ ├── HeroAppearance.h │ ├── DamageMod.h │ ├── Stats.h │ ├── CritterStats.h │ ├── PartyControl.h │ ├── Drugs.h │ ├── Combat.h │ ├── Worldmap.h │ ├── FileSystem.h │ └── MainLoopHook.cpp ├── ddraw_CheckAddr.ini ├── FalloutEngine │ ├── Structs.h │ ├── VariableOffsets_HRP.h │ ├── FunctionOffsets.cpp │ ├── Fallout2.h │ ├── FunctionOffsets.h │ └── AsmMacros.h ├── CheckAddress.h ├── HRP │ ├── LoadSave.h │ ├── Worldmap.h │ ├── Character.h │ ├── Inventory.h │ ├── CreditsScreen.h │ ├── MiscInterface.h │ ├── HelpScreen.h │ ├── DeathScreen.h │ ├── SlidesScreen.h │ ├── SplashScreen.h │ ├── viewmap │ │ ├── EdgeClipping.h │ │ ├── ViewMap.h │ │ └── EdgeBorder.h │ ├── Dialog.h │ ├── MoviesScreen.h │ ├── MainMenu.h │ ├── Init.h │ ├── InterfaceBar.h │ ├── Image.h │ └── MiscInterface.cpp ├── .editorconfig ├── postbuild_debug.cmd ├── postbuild.cmd.template ├── stdafx.h ├── ReplacementFuncs.h ├── ModuleManager.cpp ├── ModuleManager.h ├── WinProc.h ├── CRC.h ├── resource.rc ├── Utils.h ├── SimplePatch.h ├── HLSL │ ├── L8PixelShader.hlsl │ └── A8PixelShader.hlsl ├── Logging.h ├── exports.def ├── Translate.h └── Delegate.h ├── artifacts ├── sfall.dat ├── sfall_ru.dat ├── mods │ ├── gl_ammoMod.int │ ├── gl_npcarmor.int │ ├── gl_autodoors.int │ ├── gl_sfall-mods.int │ ├── gl_auto_closebox.int │ ├── gl_highlighting.int │ ├── gl_partycontrol.int │ ├── readme.txt │ └── gl_auto_closebox.ssl ├── translations │ ├── chs.ini │ ├── cht.ini │ ├── french.ini │ ├── german.ini │ ├── polish.ini │ ├── russian.ini │ ├── russian_oem.ini │ └── brazilian_portuguese.ini ├── config_files │ ├── sfall-mods_ru.ini │ ├── Tweaks.ini │ ├── CriticalOverrides - old.ini │ ├── books.ini │ ├── readme.txt │ ├── Skills.ini │ ├── Stats.ini │ ├── elevators.ini │ ├── Unarmed.ini │ ├── Translations.ini │ ├── CriticalOverrides.ini │ ├── Drugs.ini │ ├── NpcArmorRP.ini │ └── npcarmor.ini ├── example_mods │ ├── APcosts │ │ ├── gl_itemapcost.int │ │ └── readme.txt │ ├── AutoDoors │ │ ├── gl_autodoors.int │ │ └── readme.txt │ ├── StealCheat │ │ ├── gl_stealcheat.int │ │ ├── readme.txt │ │ └── gl_stealcheat.ssl │ ├── TakeAllHotkey │ │ ├── gl_takeallkey.int │ │ ├── readme.txt │ │ └── gl_takeallkey.ssl │ ├── rain │ │ ├── data │ │ │ ├── scripts │ │ │ │ ├── gltsrain.int │ │ │ │ └── shader_test │ │ │ │ │ └── gltsrain.int │ │ │ ├── art │ │ │ │ └── stex │ │ │ │ │ └── weather │ │ │ │ │ ├── rain.png │ │ │ │ │ ├── sand.png │ │ │ │ │ ├── snow.png │ │ │ │ │ ├── mask-def.png │ │ │ │ │ ├── mask-esc.png │ │ │ │ │ ├── mask-inv.png │ │ │ │ │ ├── mask-map.png │ │ │ │ │ └── mask-skd.png │ │ │ └── shaders │ │ │ │ └── weather │ │ │ │ ├── snow-esc.fx │ │ │ │ ├── snow-inv.fx │ │ │ │ ├── snow-map.fx │ │ │ │ ├── snow-skd.fx │ │ │ │ ├── sand-esc.fx │ │ │ │ ├── sand-inv.fx │ │ │ │ ├── sand-map.fx │ │ │ │ ├── sand-skd.fx │ │ │ │ ├── rain-esc.fx │ │ │ │ ├── rain-inv.fx │ │ │ │ ├── rain-map.fx │ │ │ │ ├── rain-skd.fx │ │ │ │ ├── snow-def.fx │ │ │ │ ├── rain-def.fx │ │ │ │ └── sand-def.fx │ │ └── readme.txt │ ├── GetDrunk │ │ ├── Data │ │ │ ├── scripts │ │ │ │ └── glbooze.int │ │ │ └── shaders │ │ │ │ ├── Booze1.fx │ │ │ │ ├── Booze2.fx │ │ │ │ ├── Booze3.fx │ │ │ │ └── Booze4.fx │ │ └── readme.txt │ ├── ComputeDamage │ │ └── gl_compute_damage.ssl │ ├── Traits │ │ ├── Data │ │ │ └── scripts │ │ │ │ ├── gltschardev.int │ │ │ │ └── gltschardev2.int │ │ └── readme.txt │ ├── readme.txt │ ├── ExplosiveTimer │ │ └── hs_explosivetimer.ssl │ └── Sneak │ │ └── hs_sneak.ssl └── scripting │ ├── headers │ └── lib.math.h │ └── README.md ├── DebugEditor ├── FalloutDebug.exe ├── README.md ├── SfallDebugEditor.sln ├── Program.cs └── Properties │ └── AssemblyInfo.cs ├── DevUtils ├── AddrHackScanner.exe └── AddrHackScanner │ ├── AddrHackScanner │ ├── Properties │ │ ├── Settings.settings │ │ ├── Settings.Designer.cs │ │ └── AssemblyInfo.cs │ └── Program.cs │ └── AddrHackScanner.sln ├── ThirdPartyTools └── SND2ACM_FIX │ ├── SND2ACM_FIX.exe │ ├── SND2ACM_FIX │ └── Properties │ │ ├── Settings.settings │ │ ├── Settings.Designer.cs │ │ └── AssemblyInfo.cs │ └── SND2ACM_FIX.sln └── .github └── workflows └── build.yml /sfall/stdafx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /sfall/resource.h: -------------------------------------------------------------------------------- 1 | #define IDR_RCDATA1 101 2 | -------------------------------------------------------------------------------- /sfall/version.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/sfall/version.h -------------------------------------------------------------------------------- /artifacts/sfall.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/sfall.dat -------------------------------------------------------------------------------- /sfall/Game/stats.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/sfall/Game/stats.cpp -------------------------------------------------------------------------------- /artifacts/sfall_ru.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/sfall_ru.dat -------------------------------------------------------------------------------- /sfall/Modules/Unarmed.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/sfall/Modules/Unarmed.cpp -------------------------------------------------------------------------------- /sfall/ddraw_CheckAddr.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/sfall/ddraw_CheckAddr.ini -------------------------------------------------------------------------------- /sfall/Modules/BugFixes.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/sfall/Modules/BugFixes.cpp -------------------------------------------------------------------------------- /DebugEditor/FalloutDebug.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/DebugEditor/FalloutDebug.exe -------------------------------------------------------------------------------- /DevUtils/AddrHackScanner.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/DevUtils/AddrHackScanner.exe -------------------------------------------------------------------------------- /artifacts/mods/gl_ammoMod.int: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/mods/gl_ammoMod.int -------------------------------------------------------------------------------- /artifacts/mods/gl_npcarmor.int: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/mods/gl_npcarmor.int -------------------------------------------------------------------------------- /artifacts/translations/chs.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/translations/chs.ini -------------------------------------------------------------------------------- /artifacts/translations/cht.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/translations/cht.ini -------------------------------------------------------------------------------- /sfall/FalloutEngine/Structs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/sfall/FalloutEngine/Structs.h -------------------------------------------------------------------------------- /artifacts/mods/gl_autodoors.int: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/mods/gl_autodoors.int -------------------------------------------------------------------------------- /artifacts/mods/gl_sfall-mods.int: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/mods/gl_sfall-mods.int -------------------------------------------------------------------------------- /artifacts/mods/gl_auto_closebox.int: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/mods/gl_auto_closebox.int -------------------------------------------------------------------------------- /artifacts/mods/gl_highlighting.int: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/mods/gl_highlighting.int -------------------------------------------------------------------------------- /artifacts/mods/gl_partycontrol.int: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/mods/gl_partycontrol.int -------------------------------------------------------------------------------- /artifacts/translations/french.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/translations/french.ini -------------------------------------------------------------------------------- /artifacts/translations/german.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/translations/german.ini -------------------------------------------------------------------------------- /artifacts/translations/polish.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/translations/polish.ini -------------------------------------------------------------------------------- /artifacts/translations/russian.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/translations/russian.ini -------------------------------------------------------------------------------- /artifacts/config_files/sfall-mods_ru.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/config_files/sfall-mods_ru.ini -------------------------------------------------------------------------------- /artifacts/translations/russian_oem.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/translations/russian_oem.ini -------------------------------------------------------------------------------- /sfall/Modules/Scripting/Handlers/Utils.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/sfall/Modules/Scripting/Handlers/Utils.cpp -------------------------------------------------------------------------------- /ThirdPartyTools/SND2ACM_FIX/SND2ACM_FIX.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/ThirdPartyTools/SND2ACM_FIX/SND2ACM_FIX.exe -------------------------------------------------------------------------------- /sfall/Game/README.md: -------------------------------------------------------------------------------- 1 | ## Game Folder 2 | This directory contains the code of the functions of the original Fallout 2 game engine with sfall fixes included. -------------------------------------------------------------------------------- /artifacts/translations/brazilian_portuguese.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/translations/brazilian_portuguese.ini -------------------------------------------------------------------------------- /artifacts/example_mods/APcosts/gl_itemapcost.int: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/example_mods/APcosts/gl_itemapcost.int -------------------------------------------------------------------------------- /artifacts/example_mods/AutoDoors/gl_autodoors.int: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/example_mods/AutoDoors/gl_autodoors.int -------------------------------------------------------------------------------- /artifacts/example_mods/StealCheat/gl_stealcheat.int: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/example_mods/StealCheat/gl_stealcheat.int -------------------------------------------------------------------------------- /artifacts/example_mods/TakeAllHotkey/gl_takeallkey.int: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/example_mods/TakeAllHotkey/gl_takeallkey.int -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/scripts/gltsrain.int: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/example_mods/rain/data/scripts/gltsrain.int -------------------------------------------------------------------------------- /artifacts/example_mods/GetDrunk/Data/scripts/glbooze.int: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/example_mods/GetDrunk/Data/scripts/glbooze.int -------------------------------------------------------------------------------- /artifacts/example_mods/ComputeDamage/gl_compute_damage.ssl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/example_mods/ComputeDamage/gl_compute_damage.ssl -------------------------------------------------------------------------------- /artifacts/example_mods/Traits/Data/scripts/gltschardev.int: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/example_mods/Traits/Data/scripts/gltschardev.int -------------------------------------------------------------------------------- /artifacts/example_mods/Traits/Data/scripts/gltschardev2.int: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/example_mods/Traits/Data/scripts/gltschardev2.int -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/art/stex/weather/rain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/example_mods/rain/data/art/stex/weather/rain.png -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/art/stex/weather/sand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/example_mods/rain/data/art/stex/weather/sand.png -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/art/stex/weather/snow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/example_mods/rain/data/art/stex/weather/snow.png -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/art/stex/weather/mask-def.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/example_mods/rain/data/art/stex/weather/mask-def.png -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/art/stex/weather/mask-esc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/example_mods/rain/data/art/stex/weather/mask-esc.png -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/art/stex/weather/mask-inv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/example_mods/rain/data/art/stex/weather/mask-inv.png -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/art/stex/weather/mask-map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/example_mods/rain/data/art/stex/weather/mask-map.png -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/art/stex/weather/mask-skd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/example_mods/rain/data/art/stex/weather/mask-skd.png -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/scripts/shader_test/gltsrain.int: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FalloutTeamX/sfall-Extended/HEAD/artifacts/example_mods/rain/data/scripts/shader_test/gltsrain.int -------------------------------------------------------------------------------- /artifacts/mods/readme.txt: -------------------------------------------------------------------------------- 1 | To install each mod, copy *.int file into your \data\scripts\ folder. 2 | For gl_npcarmor.int, you also need to copy npcarmor.ini to your Fallout directory. 3 | -------------------------------------------------------------------------------- /sfall/CheckAddress.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace sfall 4 | { 5 | 6 | void PrintAddrList(); 7 | void CheckConflict(DWORD addr, long len); 8 | void AddrAddToList(DWORD addr, long len); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /sfall/Modules/SubModules/EnginePerks.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace sfall 4 | { 5 | namespace perk 6 | { 7 | 8 | void EnginePerkBonusInit(); 9 | void ReadPerksBonuses(const char* perksFile); 10 | 11 | } 12 | } -------------------------------------------------------------------------------- /sfall/Modules/DebugEditor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace sfall 4 | { 5 | 6 | class DebugEditor : public Module { 7 | public: 8 | const char* name() { return "Debug Editor"; } 9 | void init(); 10 | }; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /sfall/Game/template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace game 10 | { 11 | 12 | class x { 13 | public: 14 | static void init(); 15 | 16 | }; 17 | 18 | } -------------------------------------------------------------------------------- /sfall/HRP/LoadSave.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace HRP 10 | { 11 | 12 | class LoadSave { 13 | public: 14 | static void init(); 15 | 16 | }; 17 | 18 | } -------------------------------------------------------------------------------- /sfall/HRP/Worldmap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace HRP 10 | { 11 | 12 | class Worldmap { 13 | public: 14 | static void init(); 15 | 16 | }; 17 | 18 | } -------------------------------------------------------------------------------- /sfall/HRP/Character.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace HRP 10 | { 11 | 12 | class Character { 13 | public: 14 | static void init(); 15 | 16 | }; 17 | 18 | } -------------------------------------------------------------------------------- /sfall/HRP/Inventory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace HRP 10 | { 11 | 12 | class Inventory { 13 | public: 14 | static void init(); 15 | 16 | }; 17 | 18 | } -------------------------------------------------------------------------------- /sfall/Modules/Reputations.h: -------------------------------------------------------------------------------- 1 | 2 | #include "Module.h" 3 | 4 | namespace sfall 5 | { 6 | 7 | class Reputations : public Module { 8 | public: 9 | const char* name() { return "Reputations"; } 10 | void init(); 11 | void exit() override; 12 | }; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /sfall/Modules/TalkingHeads.h: -------------------------------------------------------------------------------- 1 | #include "Module.h" 2 | 3 | namespace sfall 4 | { 5 | 6 | class TalkingHeads : public Module { 7 | public: 8 | const char* name() { return "TalkingHeads"; } 9 | void init(); 10 | void exit() override; 11 | }; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /sfall/HRP/CreditsScreen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace HRP 10 | { 11 | 12 | class CreditsScreen { 13 | public: 14 | static void init(); 15 | 16 | }; 17 | 18 | } -------------------------------------------------------------------------------- /sfall/HRP/MiscInterface.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace HRP 10 | { 11 | 12 | class MiscInterface { 13 | public: 14 | static void init(); 15 | 16 | }; 17 | 18 | } -------------------------------------------------------------------------------- /sfall/Modules/Input.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Module.h" 4 | 5 | namespace sfall 6 | { 7 | 8 | class Input : public Module { 9 | public: 10 | const char* name() { return "InputPatch"; } 11 | void init(); 12 | void exit() override; 13 | }; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /artifacts/example_mods/rain/readme.txt: -------------------------------------------------------------------------------- 1 | example rain mod. Extract to the fallout folder, (i.e. weather.ini needs to end up in the same location as fallout2.exe) and make sure sfall is set to use graphics mode 4 or 5. 2 | 3 | Thanks to Josan12 for weather settings, textures and ideas. -------------------------------------------------------------------------------- /sfall/.editorconfig: -------------------------------------------------------------------------------- 1 | ; Top-most EditorConfig file 2 | root = true 3 | 4 | ; 4-column tab indentation 5 | [*.cpp] 6 | indent_style = tab 7 | indent_size = 4 8 | 9 | [*.h] 10 | indent_style = tab 11 | indent_size = 4 12 | 13 | [*.hpp] 14 | indent_style = tab 15 | indent_size = 4 -------------------------------------------------------------------------------- /sfall/Modules/SubModules/CombatExt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 The sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace sfall 10 | { 11 | 12 | class CombatExt { 13 | public: 14 | static void init(); 15 | 16 | }; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /sfall/postbuild_debug.cmd: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | rem debug, release, etc. 4 | SET type=%1 5 | rem full path to the compiled DLL 6 | SET target=%2 7 | 8 | SET destination="F:\Fallout2\ddraw.dll" 9 | 10 | echo Copying %target% to %destination% ... 11 | copy %target% %destination% -------------------------------------------------------------------------------- /sfall/Game/GUI/Text.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace game 10 | { 11 | namespace gui 12 | { 13 | 14 | class Text { 15 | public: 16 | static void init(); 17 | }; 18 | 19 | } 20 | } -------------------------------------------------------------------------------- /sfall/postbuild.cmd.template: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | rem debug, release, etc. 4 | SET type=%1 5 | rem full path to the compiled DLL 6 | SET target=%2 7 | 8 | SET destination=d:\GAMES\Fallout2\@RP\ddraw.dll 9 | 10 | echo Copying %target% to %destination% ... 11 | copy %target% %destination% -------------------------------------------------------------------------------- /sfall/Modules/HookScripts/DeathHs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Hook scripts related to critter Death 4 | 5 | namespace sfall 6 | { 7 | 8 | void InitDeathHookScripts(); 9 | 10 | void Inject_DeathAnim1Hook(); 11 | void Inject_DeathAnim2Hook(); 12 | void Inject_OnDeathHook(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /sfall/HRP/HelpScreen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace HRP 10 | { 11 | 12 | class HelpScreen { 13 | public: 14 | static void init(); 15 | 16 | static long HELP_SCRN_SIZE; 17 | }; 18 | 19 | } -------------------------------------------------------------------------------- /sfall/HRP/DeathScreen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace HRP 10 | { 11 | 12 | class DeathScreen { 13 | public: 14 | static void init(); 15 | 16 | static long DEATH_SCRN_SIZE; 17 | }; 18 | 19 | } -------------------------------------------------------------------------------- /sfall/HRP/SlidesScreen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace HRP 10 | { 11 | 12 | class SlidesScreen { 13 | public: 14 | static void init(); 15 | 16 | static long END_SLIDE_SIZE; 17 | }; 18 | 19 | } -------------------------------------------------------------------------------- /sfall/Game/template.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #include "..\FalloutEngine\Fallout2.h" 8 | 9 | #include "x.h" 10 | 11 | namespace game 12 | { 13 | 14 | namespace sf = sfall; 15 | 16 | void x::init() { 17 | 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /artifacts/example_mods/readme.txt: -------------------------------------------------------------------------------- 1 | These are some example mods I've put together. Each uses sfall features in a simple way, generally involving a single global script. The uncompiled versions of each script is included. 2 | 3 | Further good examples of sfall scripts are available from Nirran's site: http://www.nirran.com/ -------------------------------------------------------------------------------- /DebugEditor/README.md: -------------------------------------------------------------------------------- 1 | Apparently this project was intended as some kind of Multiplayer module for Fallout 2. 2 | 3 | Now it only works as a supplement for sfall debugging mode. It shows a lists of: game objects, sfall globals, arrays, etc (in a separate window). Primarily focused on debugging sfall-enabled scripts. 4 | -------------------------------------------------------------------------------- /sfall/HRP/SplashScreen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace HRP 10 | { 11 | 12 | class SplashScreen { 13 | public: 14 | static void init(); 15 | 16 | static long SPLASH_SCRN_SIZE; 17 | 18 | 19 | }; 20 | 21 | } -------------------------------------------------------------------------------- /sfall/HRP/viewmap/EdgeClipping.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace HRP 10 | { 11 | 12 | class EdgeClipping { 13 | 14 | public: 15 | static void init(); 16 | 17 | static long CheckMapClipping(); 18 | }; 19 | 20 | } -------------------------------------------------------------------------------- /artifacts/example_mods/StealCheat/readme.txt: -------------------------------------------------------------------------------- 1 | Master Theif cheat for fallout 2 by phobos2077 2 | ---------------------------------------- 3 | 4 | - forces all steal attempts to succeed 5 | 6 | 7 | To use, copy *.int file to your scripts folder. 8 | 9 | This mod is an example of how you can use HOOK_STEAL hooks. 10 | -------------------------------------------------------------------------------- /DevUtils/AddrHackScanner/AddrHackScanner/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ThirdPartyTools/SND2ACM_FIX/SND2ACM_FIX/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /sfall/Game/skills.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace game 10 | { 11 | 12 | class Skills 13 | { 14 | public: 15 | static void init(); 16 | 17 | static int __stdcall trait_adjust_skill(DWORD skillID); 18 | 19 | }; 20 | 21 | } -------------------------------------------------------------------------------- /sfall/HRP/Dialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace HRP 10 | { 11 | 12 | class Dialog { 13 | public: 14 | static void init(); 15 | 16 | static bool DIALOG_SCRN_ART_FIX; 17 | static bool DIALOG_SCRN_BACKGROUND; 18 | }; 19 | 20 | } -------------------------------------------------------------------------------- /artifacts/example_mods/AutoDoors/readme.txt: -------------------------------------------------------------------------------- 1 | Auto Doors mod for Fallout 2 by Mr.Stalin 2 | ----------------------------------------- 3 | 4 | - allows the player to automatically open/walk through unlocked doors when not in combat 5 | 6 | 7 | Requires sfall 3.7b or higher. 8 | 9 | To use, copy gl_autodoors.int to your scripts folder. 10 | -------------------------------------------------------------------------------- /sfall/Modules/SubModules/CombatBlock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2020 The sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace sfall 10 | { 11 | 12 | class CombatBlock { 13 | public: 14 | static void init(); 15 | 16 | static void __stdcall SetBlockCombat(long toggle); 17 | 18 | }; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /sfall/HRP/MoviesScreen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace HRP 10 | { 11 | 12 | class MoviesScreen { 13 | public: 14 | static void init(); 15 | 16 | static long MOVIE_SIZE; 17 | 18 | static void SetDrawMode(bool mode); 19 | }; 20 | 21 | } -------------------------------------------------------------------------------- /sfall/Modules/HookScripts/HexBlockingHs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Hook scripts related to hex blocking checks (during pathfinding, etc.) 4 | 5 | namespace sfall 6 | { 7 | 8 | void InitHexBlockingHookScripts(); 9 | 10 | void Inject_HexSightBlockHook(); 11 | void Inject_HexShootBlockHook(); 12 | void Inject_HexIABlockHook(); 13 | void Inject_HexMoveBlockHook(); 14 | 15 | } -------------------------------------------------------------------------------- /sfall/Modules/Interface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Module.h" 4 | 5 | namespace sfall 6 | { 7 | 8 | class Interface : public Module { 9 | public: 10 | const char* name() { return "Interface"; } 11 | void init(); 12 | void exit() override; 13 | 14 | static long ActiveInterfaceWID(); 15 | static fo::Window* GetWindow(long winType); 16 | 17 | }; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /sfall/Modules/SubModules/ObjectName.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 The sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace sfall 10 | { 11 | 12 | class ObjectName 13 | { 14 | public: 15 | static void init(); 16 | 17 | static const char* __stdcall GetName(fo::GameObject* object); 18 | static void SetName(long sid, const char* name); 19 | }; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /sfall/Modules/BugFixes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Module.h" 4 | 5 | namespace sfall 6 | { 7 | 8 | class BugFixes : public Module { 9 | public: 10 | const char* name() { return "BugFixes"; } 11 | void init(); 12 | 13 | static void DrugsSaveFix(HANDLE file); 14 | static bool DrugsLoadFix(HANDLE file); 15 | }; 16 | 17 | extern int tagSkill4LevelBase; 18 | 19 | extern void ResetBodyState(); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /sfall/Game/stats.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace game 10 | { 11 | 12 | class Stats 13 | { 14 | public: 15 | static void init(); 16 | 17 | static int trait_level(DWORD statID); 18 | static int perk_level(fo::GameObject* source, DWORD perkID); 19 | 20 | static int __stdcall trait_adjust_stat(DWORD statID); 21 | }; 22 | 23 | } -------------------------------------------------------------------------------- /sfall/Game/GUI/render.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | #include "..\..\FalloutEngine\Fallout2.h" 10 | 11 | namespace game 12 | { 13 | namespace gui 14 | { 15 | 16 | class Render 17 | { 18 | public: 19 | static void init(); 20 | 21 | static void __fastcall GNW_win_refresh(fo::Window* win, RECT* updateRect, BYTE* toBuffer); 22 | }; 23 | 24 | } 25 | } -------------------------------------------------------------------------------- /sfall/HRP/MainMenu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace HRP 10 | { 11 | 12 | class MainMenuScreen { 13 | public: 14 | static void init(); 15 | 16 | static long MAIN_MENU_SIZE; 17 | static bool USE_HIRES_IMAGES; 18 | static bool SCALE_BUTTONS_AND_TEXT_MENU; 19 | static long MENU_BG_OFFSET_X; 20 | static long MENU_BG_OFFSET_Y; 21 | }; 22 | 23 | } -------------------------------------------------------------------------------- /sfall/FalloutEngine/VariableOffsets_HRP.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define HRP_VAR_disp_width 0x1006EB70 4 | #define HRP_VAR_display_string_buf 0x10068708 5 | 6 | #define HRP_VAR_FOG_OF_WAR 0x100683D4 7 | #define HRP_VAR_MOVIE_SIZE 0x1006EC10 8 | #define HRP_VAR_IFACE_BAR_MODE 0x1006EB0C 9 | #define HRP_VAR_HR_IFACE_FRM_STR 0x10039358 10 | #define HRP_VAR_VERSION_STR 0x10039940 11 | -------------------------------------------------------------------------------- /artifacts/example_mods/APcosts/readme.txt: -------------------------------------------------------------------------------- 1 | AP costs mod for fallout 2 by phobos2077 2 | ---------------------------------------- 3 | 4 | - increases AP cost of using all misc items to 4 5 | - AP are reduced even when using items (eg. stimpaks) from the inventory 6 | 7 | 8 | To use, copy gl_itemapcost.int to your scripts folder. 9 | 10 | This mod is a simple example of a global script, so I've also included an uncompiled copy in the scripts folder. 11 | 12 | -------------------------------------------------------------------------------- /artifacts/example_mods/TakeAllHotkey/readme.txt: -------------------------------------------------------------------------------- 1 | "Take All" Hotkey mod for Fallout 2 by NovaRain 2 | ---------------------------------------- 3 | 4 | - makes pressing the semicolon key send an uppercase A after a semicolon. 5 | - Note: the uppercase A (shift + A if Caps Lock is off) is the built-in hotkey for the TAKE ALL button on the loot screen. 6 | 7 | To use, copy *.int file to your scripts folder. 8 | 9 | This mod is a simple example of how you can use HOOK_KEYPRESS hooks. 10 | -------------------------------------------------------------------------------- /sfall/Modules/CritterPoison.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Module.h" 4 | 5 | namespace sfall 6 | { 7 | 8 | class CritterPoison : public Module { 9 | public: 10 | const char* name() { return "CritterPoison"; } 11 | void init(); 12 | 13 | static long adjustPoisonHP_Default; 14 | static long adjustPoisonHP; // temp value from HOOK_ADJUSTPOISON 15 | 16 | static void SetDefaultAdjustPoisonHP(long value); 17 | }; 18 | 19 | extern void critter_adjust_poison_hack_fix(); 20 | 21 | } -------------------------------------------------------------------------------- /artifacts/config_files/Tweaks.ini: -------------------------------------------------------------------------------- 1 | ; Game engine tweaks 2 | 3 | [Main] 4 | 5 | 6 | [Items] 7 | ;Override the PIDs of the standard healing drugs that AI will use in combat 8 | ;Set to -1 if you don't want AI to identify this item as a healing drug 9 | ;Note: Starting from sfall 4.3.1/3.8.31, you can set a new flag (FlagsExt: 0x04000000) 10 | ;in the prototype for other items, so AI will use them for healing in combat as well 11 | ;STIMPAK=40 12 | ;SUPER_STIMPAK=144 13 | ;HEALING_POWDER=237 14 | -------------------------------------------------------------------------------- /sfall/Game/combatAI.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace game 10 | { 11 | 12 | #include "..\FalloutEngine\Fallout2.h" 13 | 14 | class CombatAI { 15 | public: 16 | static void init(); 17 | 18 | static bool CombatAI::ai_can_use_weapon(fo::GameObject* source, fo::GameObject* weapon, long hitMode); 19 | 20 | static void __stdcall CombatAI::ai_check_drugs(fo::GameObject* source); 21 | }; 22 | 23 | } -------------------------------------------------------------------------------- /sfall/stdafx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #pragma message("Compiling precompiled headers.\n") 3 | 4 | #define WINVER _WIN32_WINNT_WINXP 5 | #define _WIN32_WINNT _WIN32_WINNT_WINXP 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | //#define WIN32_LEAN_AND_MEAN 17 | #define NOCRYPT 18 | #define NOSERVICE 19 | #define NOMCX 20 | #define NOIME 21 | #include 22 | -------------------------------------------------------------------------------- /sfall/Modules/HookScripts/ObjectHs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace sfall 4 | { 5 | void InitObjectHookScripts(); 6 | 7 | void Inject_UseObjOnHook(); 8 | void Inject_UseObjHook(); 9 | void Inject_UseAnimateObjHook(); 10 | void Inject_DescriptionObjHook(); 11 | void Inject_SetLightingHook(); 12 | void Inject_ScriptProcedureHook(); 13 | void Inject_ScriptProcedureHook2(); 14 | void Inject_AdjustPoisonHook(); 15 | void Inject_AdjustPadsHook(); 16 | 17 | long UseObjOnHook_Invoke(fo::GameObject* source, fo::GameObject* item, fo::GameObject* target); 18 | } 19 | -------------------------------------------------------------------------------- /sfall/Modules/SubModules/DirectDraw.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace sfall 10 | { 11 | 12 | class DirectDraw { 13 | public: 14 | static void init(); 15 | static void exit(); 16 | 17 | static void Clear(long indxColor); 18 | 19 | #pragma pack(push, 1) 20 | struct PALCOLOR { 21 | union { 22 | DWORD xRGB; 23 | struct { 24 | BYTE R; 25 | BYTE G; 26 | BYTE B; 27 | BYTE x; 28 | }; 29 | }; 30 | }; 31 | #pragma pack(pop) 32 | }; 33 | 34 | } -------------------------------------------------------------------------------- /sfall/Modules/BarBoxes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Module.h" 4 | 5 | namespace sfall 6 | { 7 | 8 | class BarBoxes : public Module { 9 | private: 10 | static int boxCount; 11 | 12 | public: 13 | const char* name() { return "BarBoxes"; } 14 | void init(); 15 | void exit() override; 16 | 17 | static int MaxBox() { return boxCount - 1; } 18 | static void SetText(int box, const char* text, DWORD color); 19 | 20 | static bool GetBox(int); 21 | static void AddBox(int); 22 | static void RemoveBox(int); 23 | static long AddExtraBox(); 24 | }; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /sfall/Modules/HookScripts/InventoryHs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Inventory-Related hook scripts 4 | 5 | namespace sfall 6 | { 7 | 8 | void InitInventoryHookScripts(); 9 | 10 | void Inject_RemoveInvenObjHook(); 11 | void Inject_MoveCostHook(); 12 | void Inject_SwitchHandHook(); 13 | void Inject_InventoryMoveHook(); 14 | void Inject_InvenWieldHook(); 15 | 16 | long InvenWieldHook_Invoke(fo::GameObject* critter, fo::GameObject* item, long flags); 17 | 18 | void InvenUnwield_HookDrop(); 19 | void InvenUnwield_HookMove(); 20 | 21 | void SetRemoveObjectType(long rmType); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /sfall/Game/ImprovedAI/AI.SearchTarget.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2021 The sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace game 10 | { 11 | namespace imp_ai 12 | { 13 | 14 | class AISearchTarget { 15 | public: 16 | static void init(bool); 17 | 18 | static fo::GameObject* __fastcall AIDangerSource_Extended(fo::GameObject* source, long type); 19 | static fo::GameObject* AIDangerSource(fo::GameObject* source, long type); 20 | 21 | static fo::GameObject* __fastcall RevertTarget(fo::GameObject* source, fo::GameObject* target); 22 | }; 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /DevUtils/AddrHackScanner/AddrHackScanner/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | 6 | namespace AddrHackScanner 7 | { 8 | static class Program 9 | { 10 | /// 11 | /// Главная точка входа для приложения. 12 | /// 13 | [STAThread] 14 | static void Main() 15 | { 16 | Application.EnableVisualStyles(); 17 | Application.SetCompatibleTextRenderingDefault(false); 18 | Application.Run(new Form1()); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /sfall/Modules/Sound.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2020 The sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | #include "Module.h" 10 | 11 | namespace sfall 12 | { 13 | 14 | class Sound : public Module { 15 | public: 16 | const char* name() { return "Sounds"; } 17 | void init(); 18 | void exit() override; 19 | 20 | static long PlaySfallSound(const char* path, long mode); 21 | static void __stdcall StopSfallSound(uint32_t id); 22 | 23 | static long CalculateVolumeDB(long masterVolume, long passVolume); 24 | 25 | static void SoundLostFocus(long isActive); 26 | }; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /sfall/Modules/SubModules/WindowRender.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2020 The sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace sfall 10 | { 11 | 12 | class WindowRender { 13 | public: 14 | static void init(); 15 | 16 | static void CreateOverlaySurface(fo::Window* win, long winType); 17 | static void DestroyOverlaySurface(fo::Window* win); 18 | static void ClearOverlay(fo::Window* win); 19 | static void ClearOverlay(fo::Window* win, Rectangle &rect); 20 | static BYTE* GetOverlaySurface(fo::Window* win); 21 | 22 | static void EnableRecalculateFadeSteps(); 23 | }; 24 | 25 | } -------------------------------------------------------------------------------- /artifacts/example_mods/TakeAllHotkey/gl_takeallkey.ssl: -------------------------------------------------------------------------------- 1 | procedure start; 2 | // adjust include paths if needed 3 | #include "..\..\scripting_docs\headers\sfall.h" 4 | #include "..\..\scripting_docs\headers\dik.h" 5 | 6 | procedure start begin 7 | if game_loaded then begin 8 | register_hook(HOOK_KEYPRESS); 9 | end else begin 10 | variable 11 | event := get_sfall_arg, 12 | keyDX := get_sfall_arg; 13 | 14 | if (event == 1) and (keyDX == DIK_SEMICOLON) then begin 15 | tap_key(DIK_CAPITAL); 16 | tap_key(DIK_A); 17 | tap_key(DIK_CAPITAL); 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /sfall/Game/tilemap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace game 10 | { 11 | 12 | class Tilemap { 13 | public: 14 | static void init(); 15 | 16 | static void obj_path_blocking_at_(); 17 | 18 | static long __fastcall tile_num_beyond(long sourceTile, long targetTile, long maxRange); 19 | 20 | static long __fastcall make_path_func(fo::GameObject* srcObject, long sourceTile, long targetTile, long type, long maxNodes, void* arrayRef, long checkTargetTile, void* blockFunc); 21 | 22 | static void SetPathMaxNodes(long maxNodes); 23 | }; 24 | 25 | } -------------------------------------------------------------------------------- /sfall/Modules/MainLoopHook.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "..\Delegate.h" 4 | #include "Module.h" 5 | 6 | namespace sfall 7 | { 8 | 9 | class MainLoopHook : public Module { 10 | public: 11 | const char* name() { return "MainLoopHook"; } 12 | 13 | void init(); 14 | 15 | // Main game loop (real-time action) 16 | static Delegate<>& OnMainLoop(); 17 | 18 | // Turn-based combat loop 19 | static Delegate<>& OnCombatLoop(); 20 | 21 | // Called after each attack action in combat (at the end of combat_attack() function) 22 | static Delegate<>& OnAfterCombatAttack(); 23 | 24 | static bool displayWinUpdateState; 25 | }; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /artifacts/config_files/CriticalOverrides - old.ini: -------------------------------------------------------------------------------- 1 | ;This is the old critical override format. 2 | ;I advise against using it, due to the effects on loading times 3 | 4 | ;Enable overriding the critical hit tables 5 | ;For details on the tables and their values, see: 6 | ; http://falloutmods.wikia.com/wiki/Critical_hit_tables 7 | ;In the section names, the first two digits are the critter type 8 | ; the third digit is the body part, (0-8) and the forth is the 9 | ; level of critical hit (0-5) 10 | 11 | [c_01_0_0] 12 | DamageMultiplier=100 13 | EffectFlags=0 14 | StatCheck=0 15 | StatMod=0 16 | FailureEffect=0 17 | Message=0 18 | FailMessage=0 19 | -------------------------------------------------------------------------------- /sfall/Game/objects.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace game 10 | { 11 | 12 | class Objects { 13 | public: 14 | static void init(); 15 | 16 | // Implementation of is_within_perception_ engine function with the HOOK_WITHINPERCEPTION hook 17 | static long is_within_perception(fo::GameObject* watcher, fo::GameObject* target, long hookType); 18 | 19 | // Alternative implementation of the objFindObjPtrFromID_ engine function with the type of object to find 20 | static fo::GameObject* __fastcall FindObjectFromID(long id, long type); 21 | 22 | }; 23 | 24 | } -------------------------------------------------------------------------------- /sfall/HRP/Init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace HRP 10 | { 11 | 12 | class Setting { 13 | public: 14 | static void init(const char*, std::string&, DWORD); 15 | 16 | static DWORD GetAddress(DWORD addr); 17 | static bool VersionIsValid; // HRP 4.1.8 version validation 18 | static bool CheckExternalPatch(); 19 | static bool ExternalEnabled(); 20 | 21 | // Built-in High Resolution Patch 22 | static bool IsEnabled(); 23 | 24 | static long ScreenWidth(); 25 | static long ScreenHeight(); 26 | static long ColorBits(); 27 | static char ScaleX2(); 28 | }; 29 | 30 | } -------------------------------------------------------------------------------- /sfall/ReplacementFuncs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | #include "Game\GUI\render.h" 10 | #include "Game\GUI\Text.h" 11 | 12 | #include "Game\combatAI.h" 13 | #include "Game\inventory.h" 14 | #include "Game\skills.h" 15 | #include "Game\stats.h" 16 | #include "Game\items.h" 17 | #include "Game\tilemap.h" 18 | 19 | __inline void InitReplacementHack() { 20 | game::gui::Render::init(); 21 | game::gui::Text::init(); 22 | 23 | game::CombatAI::init(); 24 | game::Inventory::init(); 25 | game::Skills::init(); 26 | game::Stats::init(); 27 | game::Items::init(); 28 | game::Tilemap::init(); 29 | } -------------------------------------------------------------------------------- /artifacts/example_mods/GetDrunk/Data/shaders/Booze1.fx: -------------------------------------------------------------------------------- 1 | sampler s0; 2 | 3 | static const float2 rcpres = 4 | { 5 | 0.0015625, 6 | 0.0020833333333333333333333333333333 7 | }; 8 | 9 | float4 Blur( float2 Tex : TEXCOORD0 ) : COLOR0 10 | { 11 | float4 Color = 0; 12 | 13 | Color += tex2D( s0, float2(Tex.x, Tex.y)); 14 | Color += tex2D( s0, float2(Tex.x + rcpres.x, Tex.y)); 15 | Color += tex2D( s0, float2(Tex.x - rcpres.x, Tex.y)); 16 | Color += tex2D( s0, float2(Tex.x, Tex.y + rcpres.y)); 17 | Color += tex2D( s0, float2(Tex.x, Tex.y - rcpres.y)); 18 | 19 | return Color * 0.2; 20 | } 21 | 22 | Technique blur 23 | { 24 | Pass P0 { PixelShader = compile ps_2_0 Blur(); } 25 | } -------------------------------------------------------------------------------- /sfall/ModuleManager.cpp: -------------------------------------------------------------------------------- 1 | #include "Logging.h" 2 | 3 | #include "ModuleManager.h" 4 | 5 | namespace sfall 6 | { 7 | 8 | ModuleManager ModuleManager::_instance; 9 | 10 | ModuleManager::ModuleManager() { 11 | } 12 | 13 | ModuleManager::~ModuleManager() { 14 | for (auto it = _modules.cbegin(); it != _modules.cend(); ++it) { 15 | (*it)->exit(); 16 | } 17 | } 18 | 19 | void ModuleManager::initAll() { 20 | for (auto it = _modules.cbegin(); it != _modules.cend(); ++it) { 21 | dlog_f("Initializing module %s...\n", DL_INIT, (*it)->name()); 22 | (*it)->init(); 23 | } 24 | } 25 | 26 | ModuleManager& ModuleManager::getInstance() { 27 | return _instance; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /artifacts/config_files/books.ini: -------------------------------------------------------------------------------- 1 | ; Allows to reassign books to different object PIDs, text messages, and skill. 2 | ; Maximum 50 books are allowed 3 | 4 | [main] 5 | ; total number of books in this file 6 | count=1 7 | 8 | ; set to 1 to override all vanilla books, so you will have to define ALL the necessary books in this file 9 | ; otherwise only new books are defined here, to just override the skill/text of a vanilla book 10 | ; specify its pid number in the new book and set parameters 11 | overrideVanilla=0 12 | 13 | ; count starts from 1 14 | [1] 15 | ; book item PID 16 | PID=626 17 | ; textID from proto.msg which displayed when reading book 18 | TextID=802 19 | ; corresponding skill 20 | Skill=15 -------------------------------------------------------------------------------- /sfall/HRP/InterfaceBar.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace HRP 10 | { 11 | 12 | class IFaceBar { 13 | public: 14 | static void init(); 15 | 16 | static long IFACE_BAR_MODE; 17 | static long IFACE_BAR_SIDE_ART; 18 | static long IFACE_BAR_WIDTH; 19 | static bool IFACE_BAR_SIDES_ORI; 20 | 21 | static long ALTERNATE_AMMO_METRE; 22 | static BYTE ALTERNATE_AMMO_LIGHT; 23 | static BYTE ALTERNATE_AMMO_DARK; 24 | 25 | static long display_width; 26 | static char* display_string_buf; 27 | 28 | static void SetExpandAPBar(); 29 | 30 | static void Hide(); 31 | static void Show(); 32 | }; 33 | 34 | } -------------------------------------------------------------------------------- /sfall/Modules/HookScripts/MiscHs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace sfall 4 | { 5 | void InitMiscHookScripts(); 6 | void SourceUseSkillOnInit(); 7 | 8 | void Inject_BarterPriceHook(); 9 | void Inject_UseSkillOnHook(); 10 | void Inject_UseSkillHook(); 11 | void Inject_StealCheckHook(); 12 | void Inject_SneakCheckHook(); 13 | void Inject_WithinPerceptionHook(); 14 | void Inject_CarTravelHook(); 15 | void Inject_SetGlobalVarHook(); 16 | void Inject_RestTimerHook(); 17 | void Inject_ExplosiveTimerHook(); 18 | void Inject_EncounterHook(); 19 | void Inject_RollCheckHook(); 20 | 21 | long PerceptionRangeHook_Invoke(fo::GameObject* watcher, fo::GameObject* target, long type, long result); 22 | } 23 | -------------------------------------------------------------------------------- /sfall/HRP/Image.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace HRP 10 | { 11 | 12 | class Image { 13 | public: 14 | static long GetDarkColor(fo::PALETTE* palette); 15 | 16 | static long GetAspectSize(long sW, long sH, long* x, long* y, long &dW, long &dH); 17 | 18 | static void Scale(BYTE* src, long sWight, long sHeight, BYTE* dst, long dWight, long dHeight, long dPitch = 0, long sPitch = 0); 19 | static void ScaleText(BYTE* dst, const char* text, long txtWidth, long dstWidth, long colorFlags, float scaleFactor); 20 | 21 | static bool MakeBMP(const char* file, BYTE* dataRGB32, long width, long height, long pitch); 22 | }; 23 | 24 | } -------------------------------------------------------------------------------- /artifacts/example_mods/GetDrunk/Data/shaders/Booze2.fx: -------------------------------------------------------------------------------- 1 | sampler s0; 2 | 3 | static const float2 rcpres = 4 | { 5 | 0.0015625, 6 | 0.0020833333333333333333333333333333 7 | }; 8 | 9 | float4 Blur( float2 Tex : TEXCOORD0 ) : COLOR0 10 | { 11 | float4 Color = 0; 12 | 13 | Color += tex2D( s0, float2(Tex.x, Tex.y)); 14 | Color += tex2D( s0, float2(Tex.x + rcpres.x, Tex.y)); 15 | Color += tex2D( s0, float2(Tex.x - rcpres.x, Tex.y)); 16 | Color += tex2D( s0, float2(Tex.x, Tex.y + rcpres.y)); 17 | Color += tex2D( s0, float2(Tex.x, Tex.y - rcpres.y)); 18 | 19 | return Color * 0.2; 20 | } 21 | 22 | Technique blur 23 | { 24 | Pass P0 { PixelShader = compile ps_2_0 Blur(); } 25 | Pass P1 { PixelShader = compile ps_2_0 Blur(); } 26 | } -------------------------------------------------------------------------------- /sfall/Modules/Scripting/Handlers/Inventory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 The sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | #include "..\OpcodeContext.h" 10 | 11 | namespace sfall 12 | { 13 | namespace script 14 | { 15 | 16 | void __declspec() op_active_hand(); 17 | 18 | void __declspec() op_toggle_active_hand(); 19 | 20 | void __declspec() op_set_inven_ap_cost(); 21 | 22 | void mf_get_inven_ap_cost(OpcodeContext&); 23 | 24 | void op_obj_is_carrying_obj(OpcodeContext&); 25 | 26 | void mf_critter_inven_obj2(OpcodeContext&); 27 | 28 | void mf_item_weight(OpcodeContext&); 29 | 30 | void mf_get_current_inven_size(OpcodeContext&); 31 | 32 | void mf_unwield_slot(OpcodeContext&); 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /artifacts/example_mods/GetDrunk/readme.txt: -------------------------------------------------------------------------------- 1 | Get drunk mod for fallout 2 by Timeslip 2 | ---------------------------------------- 3 | 4 | To use, extract the contents of this archive to your fallout 2 directory, and then go and drink some booze. You will suffer varying levels of blurred vision which cap out after drinking 10 bottles. It takes one minute for the effects of each bottle to wear off. Only booze is affected; other alcoholic drinks aren't changed. 5 | 6 | This mod is a simple example of a global script, so I've also included an uncompiled copy in the scripts folder. 7 | 8 | Obviously you need to be using sfall with the script extender turned on in order to use this mod. You also need to set the graphics mode to 4 or 5 in order for the shaders to work. -------------------------------------------------------------------------------- /artifacts/config_files/readme.txt: -------------------------------------------------------------------------------- 1 | sfall's main configuration options appear in ddraw.ini, but there are several other configuration files that it can read in for modding purposes. 2 | 3 | Books.ini: Lets you override/add books to the game (associated object PIDs, skills and text messages) 4 | Perks.ini: Lets you override the name/description/frm image/other stats of perks and traits 5 | Elevators.ini: Lets you override which elevators lead where 6 | CriticalOverrides.ini: Lets you make modifications to the critical hit tables 7 | Translations.ini: Contains some text strings which sfall displays, to allow their translation 8 | Skills.ini: Lets you change the formula used for calculating skills 9 | Stats.ini: Lets you change the formula used to calculate the derived stats 10 | -------------------------------------------------------------------------------- /artifacts/example_mods/StealCheat/gl_stealcheat.ssl: -------------------------------------------------------------------------------- 1 | procedure start; 2 | // adjust include paths if needed 3 | #include "..\..\scripting_docs\headers\sfall.h" 4 | 5 | #define RESULT_SUCCESS (1) 6 | #define RESULT_FAIL (0) 7 | 8 | procedure start begin 9 | if game_loaded then begin 10 | register_hook(HOOK_STEAL); 11 | end else begin 12 | variable 13 | thief := get_sfall_arg, 14 | target := get_sfall_arg, 15 | item := get_sfall_arg, 16 | action := get_sfall_arg, 17 | result := RESULT_SUCCESS; 18 | 19 | if (thief == dude_obj) then begin 20 | display_msg(sprintf(mstr_skill(570 + result + action*2), obj_name(item))); 21 | set_sfall_return(result); 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /sfall/ModuleManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "Modules\Module.h" 7 | 8 | namespace sfall 9 | { 10 | 11 | // Singleton for managing all of Sfall modules. 12 | class ModuleManager { 13 | public: 14 | ModuleManager(); 15 | 16 | ~ModuleManager(); 17 | 18 | void initAll(); 19 | 20 | template 21 | void add() 22 | { 23 | _modules.emplace_back(new T()); 24 | } 25 | 26 | static ModuleManager& getInstance(); 27 | 28 | private: 29 | // disallow copy constructor and copy assignment because we're dealing with unique_ptr's here 30 | ModuleManager(const ModuleManager&); 31 | void operator = (const ModuleManager&) {} 32 | 33 | std::vector> _modules; 34 | 35 | static ModuleManager _instance; 36 | }; 37 | 38 | } 39 | -------------------------------------------------------------------------------- /sfall/Modules/Objects.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Module.h" 4 | 5 | namespace sfall 6 | { 7 | 8 | enum UniqueID : long { 9 | Start = 0x0FFFFFFF, // start at 0x10000000 10 | End = 0x7FFFFFFF 11 | }; 12 | 13 | class Objects : public Module { 14 | public: 15 | const char* name() { return "Objects"; } 16 | void init(); 17 | 18 | static long uniqueID; 19 | static char sfallProcessSeenState; 20 | 21 | static void __fastcall sf_obj_process_seen(long tileIndex); 22 | 23 | static bool IsUniqueID(long id); 24 | 25 | static long __fastcall SetObjectUniqueID(fo::GameObject* obj); 26 | static long __fastcall SetSpecialID(fo::GameObject* obj); 27 | static void SetNewEngineID(fo::GameObject* obj); 28 | 29 | static void SetAutoUnjamLockTime(DWORD time); 30 | static void LoadProtoAutoMaxLimit(); 31 | }; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/shaders/weather/snow-esc.fx: -------------------------------------------------------------------------------- 1 | texture tex1; 2 | texture tex2; 3 | 4 | static const float tscale=3; 5 | int tickcount; 6 | float multi; 7 | float speed; 8 | 9 | sampler s0; 10 | sampler s1 = sampler_state { 11 | texture = ; 12 | }; 13 | sampler s2 = sampler_state { 14 | texture = ; 15 | addressu=wrap; 16 | addressv=wrap; 17 | }; 18 | 19 | float4 ps_p0(float2 tex : TEXCOORD0) : COLOR0 20 | { 21 | float3 r1=tex2D(s0, tex); 22 | float offset=(float)tickcount/speed; 23 | float2 y={-0.174, 0.985}; 24 | y*=offset; 25 | float3 r2=saturate(tex2D(s1, tex)*tex2D(s2, tex*tscale-y)-(1.0-multi)); 26 | float alpha=r2.g; 27 | r1=r1*(1-alpha) + r2*alpha; 28 | return float4(saturate(r1), 1); 29 | } 30 | 31 | 32 | technique T0 33 | { 34 | pass P0 { PixelShader = compile ps_2_0 ps_p0(); } 35 | } -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/shaders/weather/snow-inv.fx: -------------------------------------------------------------------------------- 1 | texture tex1; 2 | texture tex2; 3 | 4 | static const float tscale=3; 5 | int tickcount; 6 | float multi; 7 | float speed; 8 | 9 | sampler s0; 10 | sampler s1 = sampler_state { 11 | texture = ; 12 | }; 13 | sampler s2 = sampler_state { 14 | texture = ; 15 | addressu=wrap; 16 | addressv=wrap; 17 | }; 18 | 19 | float4 ps_p0(float2 tex : TEXCOORD0) : COLOR0 20 | { 21 | float3 r1=tex2D(s0, tex); 22 | float offset=(float)tickcount/speed; 23 | float2 y={-0.174, 0.985}; 24 | y*=offset; 25 | float3 r2=saturate(tex2D(s1, tex)*tex2D(s2, tex*tscale-y)-(1.0-multi)); 26 | float alpha=r2.g; 27 | r1=r1*(1-alpha) + r2*alpha; 28 | return float4(saturate(r1), 1); 29 | } 30 | 31 | 32 | technique T0 33 | { 34 | pass P0 { PixelShader = compile ps_2_0 ps_p0(); } 35 | } -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/shaders/weather/snow-map.fx: -------------------------------------------------------------------------------- 1 | texture tex1; 2 | texture tex2; 3 | 4 | static const float tscale=3; 5 | int tickcount; 6 | float multi; 7 | float speed; 8 | 9 | sampler s0; 10 | sampler s1 = sampler_state { 11 | texture = ; 12 | }; 13 | sampler s2 = sampler_state { 14 | texture = ; 15 | addressu=wrap; 16 | addressv=wrap; 17 | }; 18 | 19 | float4 ps_p0(float2 tex : TEXCOORD0) : COLOR0 20 | { 21 | float3 r1=tex2D(s0, tex); 22 | float offset=(float)tickcount/speed; 23 | float2 y={-0.174, 0.985}; 24 | y*=offset; 25 | float3 r2=saturate(tex2D(s1, tex)*tex2D(s2, tex*tscale-y)-(1.0-multi)); 26 | float alpha=r2.g; 27 | r1=r1*(1-alpha) + r2*alpha; 28 | return float4(saturate(r1), 1); 29 | } 30 | 31 | 32 | technique T0 33 | { 34 | pass P0 { PixelShader = compile ps_2_0 ps_p0(); } 35 | } -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/shaders/weather/snow-skd.fx: -------------------------------------------------------------------------------- 1 | texture tex1; 2 | texture tex2; 3 | 4 | static const float tscale=3; 5 | int tickcount; 6 | float multi; 7 | float speed; 8 | 9 | sampler s0; 10 | sampler s1 = sampler_state { 11 | texture = ; 12 | }; 13 | sampler s2 = sampler_state { 14 | texture = ; 15 | addressu=wrap; 16 | addressv=wrap; 17 | }; 18 | 19 | float4 ps_p0(float2 tex : TEXCOORD0) : COLOR0 20 | { 21 | float3 r1=tex2D(s0, tex); 22 | float offset=(float)tickcount/speed; 23 | float2 y={-0.174, 0.985}; 24 | y*=offset; 25 | float3 r2=saturate(tex2D(s1, tex)*tex2D(s2, tex*tscale-y)-(1.0-multi)); 26 | float alpha=r2.g; 27 | r1=r1*(1-alpha) + r2*alpha; 28 | return float4(saturate(r1), 1); 29 | } 30 | 31 | 32 | technique T0 33 | { 34 | pass P0 { PixelShader = compile ps_2_0 ps_p0(); } 35 | } -------------------------------------------------------------------------------- /sfall/HRP/viewmap/ViewMap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace HRP 10 | { 11 | 12 | class ViewMap { 13 | public: 14 | static void init(); 15 | static void RedrawFix(); 16 | 17 | static long SCROLL_DIST_X; 18 | static long SCROLL_DIST_Y; 19 | static bool IGNORE_PLAYER_SCROLL_LIMITS; 20 | static bool IGNORE_MAP_EDGES; 21 | static bool EDGE_CLIPPING_ON; 22 | 23 | static long mapWidthModSize; 24 | static long mapHeightModSize; 25 | static long mapModWidth; 26 | static long mapModHeight; 27 | 28 | static void GetCoordFromOffset(long &inOutX, long &inOutY); 29 | static void GetTileCoord(long tile, long &outX, long &outY); 30 | static void GetTileCoordOffset(long tile, long &outX, long &outY); 31 | static void GetWinMapHalfSize(long &outW, long &outH); 32 | }; 33 | 34 | } -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/shaders/weather/sand-esc.fx: -------------------------------------------------------------------------------- 1 | texture tex1; 2 | texture tex2; 3 | 4 | static const float tscale=3; 5 | int tickcount; 6 | float multi; 7 | float speed; 8 | 9 | sampler s0; 10 | sampler s1 = sampler_state { 11 | texture = ; 12 | }; 13 | sampler s2 = sampler_state { 14 | texture = ; 15 | addressu=wrap; 16 | addressv=wrap; 17 | }; 18 | 19 | float4 ps_p0(float2 tex : TEXCOORD0) : COLOR0 20 | { 21 | float3 r1=tex2D(s0, tex); 22 | //if(tex.y>0.8) return float4(r1, 1); 23 | 24 | float offset=(float)tickcount/speed; 25 | float2 y={0.940, 0.342}; 26 | y*=offset; 27 | float3 r2=tex2D(s1, tex)*tex2D(s2, tex*tscale-y)-(1.0-multi); 28 | if(r2.r>0) { 29 | return float4(0.5,0.5,0,1); 30 | } else { 31 | return float4(r1, 1); 32 | } 33 | } 34 | 35 | 36 | technique T0 37 | { 38 | pass P0 { PixelShader = compile ps_2_0 ps_p0(); } 39 | } -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/shaders/weather/sand-inv.fx: -------------------------------------------------------------------------------- 1 | texture tex1; 2 | texture tex2; 3 | 4 | static const float tscale=3; 5 | int tickcount; 6 | float multi; 7 | float speed; 8 | 9 | sampler s0; 10 | sampler s1 = sampler_state { 11 | texture = ; 12 | }; 13 | sampler s2 = sampler_state { 14 | texture = ; 15 | addressu=wrap; 16 | addressv=wrap; 17 | }; 18 | 19 | float4 ps_p0(float2 tex : TEXCOORD0) : COLOR0 20 | { 21 | float3 r1=tex2D(s0, tex); 22 | //if(tex.y>0.8) return float4(r1, 1); 23 | 24 | float offset=(float)tickcount/speed; 25 | float2 y={0.940, 0.342}; 26 | y*=offset; 27 | float3 r2=tex2D(s1, tex)*tex2D(s2, tex*tscale-y)-(1.0-multi); 28 | if(r2.r>0) { 29 | return float4(0.5,0.5,0,1); 30 | } else { 31 | return float4(r1, 1); 32 | } 33 | } 34 | 35 | 36 | technique T0 37 | { 38 | pass P0 { PixelShader = compile ps_2_0 ps_p0(); } 39 | } -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/shaders/weather/sand-map.fx: -------------------------------------------------------------------------------- 1 | texture tex1; 2 | texture tex2; 3 | 4 | static const float tscale=3; 5 | int tickcount; 6 | float multi; 7 | float speed; 8 | 9 | sampler s0; 10 | sampler s1 = sampler_state { 11 | texture = ; 12 | }; 13 | sampler s2 = sampler_state { 14 | texture = ; 15 | addressu=wrap; 16 | addressv=wrap; 17 | }; 18 | 19 | float4 ps_p0(float2 tex : TEXCOORD0) : COLOR0 20 | { 21 | float3 r1=tex2D(s0, tex); 22 | //if(tex.y>0.8) return float4(r1, 1); 23 | 24 | float offset=(float)tickcount/speed; 25 | float2 y={0.940, 0.342}; 26 | y*=offset; 27 | float3 r2=tex2D(s1, tex)*tex2D(s2, tex*tscale-y)-(1.0-multi); 28 | if(r2.r>0) { 29 | return float4(0.5,0.5,0,1); 30 | } else { 31 | return float4(r1, 1); 32 | } 33 | } 34 | 35 | 36 | technique T0 37 | { 38 | pass P0 { PixelShader = compile ps_2_0 ps_p0(); } 39 | } -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/shaders/weather/sand-skd.fx: -------------------------------------------------------------------------------- 1 | texture tex1; 2 | texture tex2; 3 | 4 | static const float tscale=3; 5 | int tickcount; 6 | float multi; 7 | float speed; 8 | 9 | sampler s0; 10 | sampler s1 = sampler_state { 11 | texture = ; 12 | }; 13 | sampler s2 = sampler_state { 14 | texture = ; 15 | addressu=wrap; 16 | addressv=wrap; 17 | }; 18 | 19 | float4 ps_p0(float2 tex : TEXCOORD0) : COLOR0 20 | { 21 | float3 r1=tex2D(s0, tex); 22 | //if(tex.y>0.8) return float4(r1, 1); 23 | 24 | float offset=(float)tickcount/speed; 25 | float2 y={0.940, 0.342}; 26 | y*=offset; 27 | float3 r2=tex2D(s1, tex)*tex2D(s2, tex*tscale-y)-(1.0-multi); 28 | if(r2.r>0) { 29 | return float4(0.5,0.5,0,1); 30 | } else { 31 | return float4(r1, 1); 32 | } 33 | } 34 | 35 | 36 | technique T0 37 | { 38 | pass P0 { PixelShader = compile ps_2_0 ps_p0(); } 39 | } -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/shaders/weather/rain-esc.fx: -------------------------------------------------------------------------------- 1 | string texname1 = "weather\\mask-esc.png"; 2 | texture tex1; 3 | string texname2 = ""; 4 | texture tex2; 5 | 6 | static const float tscale=3; 7 | int tickcount; 8 | float multi; 9 | float speed; 10 | 11 | sampler s0; 12 | sampler s1 = sampler_state { 13 | texture = ; 14 | }; 15 | sampler s2 = sampler_state { 16 | texture = ; 17 | addressu=wrap; 18 | addressv=wrap; 19 | }; 20 | 21 | float4 ps_p0(float2 tex : TEXCOORD0) : COLOR0 22 | { 23 | float3 r1=tex2D(s0, tex); 24 | 25 | float offset=(float)tickcount/speed; 26 | float2 y={0.342, 0.940}; 27 | y*=offset; 28 | float3 r2=tex2D(s2, tex*tscale-y)*tex2D(s1, tex)*multi; 29 | float alpha=r2.g; 30 | r1=r1*(1-alpha) + r2*alpha; 31 | return float4(saturate(r1), 1); 32 | } 33 | 34 | 35 | technique T0 36 | { 37 | pass P0 { PixelShader = compile ps_2_0 ps_p0(); } 38 | } -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/shaders/weather/rain-inv.fx: -------------------------------------------------------------------------------- 1 | string texname1 = "weather\\mask-inv.png"; 2 | texture tex1; 3 | string texname2 = ""; 4 | texture tex2; 5 | 6 | static const float tscale=3; 7 | int tickcount; 8 | float multi; 9 | float speed; 10 | 11 | sampler s0; 12 | sampler s1 = sampler_state { 13 | texture = ; 14 | }; 15 | sampler s2 = sampler_state { 16 | texture = ; 17 | addressu=wrap; 18 | addressv=wrap; 19 | }; 20 | 21 | float4 ps_p0(float2 tex : TEXCOORD0) : COLOR0 22 | { 23 | float3 r1=tex2D(s0, tex); 24 | 25 | float offset=(float)tickcount/speed; 26 | float2 y={0.342, 0.940}; 27 | y*=offset; 28 | float3 r2=tex2D(s2, tex*tscale-y)*tex2D(s1, tex)*multi; 29 | float alpha=r2.g; 30 | r1=r1*(1-alpha) + r2*alpha; 31 | return float4(saturate(r1), 1); 32 | } 33 | 34 | 35 | technique T0 36 | { 37 | pass P0 { PixelShader = compile ps_2_0 ps_p0(); } 38 | } -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/shaders/weather/rain-map.fx: -------------------------------------------------------------------------------- 1 | string texname1 = "weather\\mask-map.png"; 2 | texture tex1; 3 | string texname2 = ""; 4 | texture tex2; 5 | 6 | static const float tscale=3; 7 | int tickcount; 8 | float multi; 9 | float speed; 10 | 11 | sampler s0; 12 | sampler s1 = sampler_state { 13 | texture = ; 14 | }; 15 | sampler s2 = sampler_state { 16 | texture = ; 17 | addressu=wrap; 18 | addressv=wrap; 19 | }; 20 | 21 | float4 ps_p0(float2 tex : TEXCOORD0) : COLOR0 22 | { 23 | float3 r1=tex2D(s0, tex); 24 | 25 | float offset=(float)tickcount/speed; 26 | float2 y={0.342, 0.940}; 27 | y*=offset; 28 | float3 r2=tex2D(s2, tex*tscale-y)*tex2D(s1, tex)*multi; 29 | float alpha=r2.g; 30 | r1=r1*(1-alpha) + r2*alpha; 31 | return float4(saturate(r1), 1); 32 | } 33 | 34 | 35 | technique T0 36 | { 37 | pass P0 { PixelShader = compile ps_2_0 ps_p0(); } 38 | } -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/shaders/weather/rain-skd.fx: -------------------------------------------------------------------------------- 1 | string texname1 = "weather\\mask-skd.png"; 2 | texture tex1; 3 | string texname2 = ""; 4 | texture tex2; 5 | 6 | static const float tscale=3; 7 | int tickcount; 8 | float multi; 9 | float speed; 10 | 11 | sampler s0; 12 | sampler s1 = sampler_state { 13 | texture = ; 14 | }; 15 | sampler s2 = sampler_state { 16 | texture = ; 17 | addressu=wrap; 18 | addressv=wrap; 19 | }; 20 | 21 | float4 ps_p0(float2 tex : TEXCOORD0) : COLOR0 22 | { 23 | float3 r1=tex2D(s0, tex); 24 | 25 | float offset=(float)tickcount/speed; 26 | float2 y={0.342, 0.940}; 27 | y*=offset; 28 | float3 r2=tex2D(s2, tex*tscale-y)*tex2D(s1, tex)*multi; 29 | float alpha=r2.g; 30 | r1=r1*(1-alpha) + r2*alpha; 31 | return float4(saturate(r1), 1); 32 | } 33 | 34 | 35 | technique T0 36 | { 37 | pass P0 { PixelShader = compile ps_2_0 ps_p0(); } 38 | } -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/shaders/weather/snow-def.fx: -------------------------------------------------------------------------------- 1 | string texname1 = ""; 2 | texture tex1; 3 | string texname2 = "weather\\snow.png"; 4 | texture tex2; 5 | 6 | static const float tscale=3; 7 | int tickcount; 8 | float multi; 9 | float speed; 10 | 11 | sampler s0; 12 | sampler s1 = sampler_state { 13 | texture = ; 14 | }; 15 | sampler s2 = sampler_state { 16 | texture = ; 17 | addressu=wrap; 18 | addressv=wrap; 19 | }; 20 | 21 | float4 ps_p0(float2 tex : TEXCOORD0) : COLOR0 22 | { 23 | float3 r1=tex2D(s0, tex); 24 | float offset=(float)tickcount/speed; 25 | float2 y={-0.174, 0.985}; 26 | y*=offset; 27 | float3 r2=saturate(tex2D(s1, tex)*tex2D(s2, tex*tscale-y)-(1.0-multi)); 28 | float alpha=r2.g; 29 | r1=r1*(1-alpha) + r2*alpha; 30 | return float4(saturate(r1), 1); 31 | } 32 | 33 | 34 | technique T0 35 | { 36 | pass P0 { PixelShader = compile ps_2_0 ps_p0(); } 37 | } -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/shaders/weather/rain-def.fx: -------------------------------------------------------------------------------- 1 | string texname1 = "weather\\mask-def.png"; 2 | texture tex1; 3 | string texname2 = "weather\\rain.png"; 4 | texture tex2; 5 | 6 | static const float tscale=3; 7 | int tickcount; 8 | float multi; 9 | float speed; 10 | 11 | sampler s0; 12 | sampler s1 = sampler_state { 13 | texture = ; 14 | }; 15 | sampler s2 = sampler_state { 16 | texture = ; 17 | addressu=wrap; 18 | addressv=wrap; 19 | }; 20 | 21 | float4 ps_p0(float2 tex : TEXCOORD0) : COLOR0 22 | { 23 | float3 r1=tex2D(s0, tex); 24 | 25 | float offset=(float)tickcount/speed; 26 | float2 y={0.342, 0.940}; 27 | y*=offset; 28 | float3 r2=tex2D(s2, tex*tscale-y)*tex2D(s1, tex)*multi; 29 | float alpha=r2.g; 30 | r1=r1*(1-alpha) + r2*alpha; 31 | return float4(saturate(r1), 1); 32 | } 33 | 34 | 35 | technique T0 36 | { 37 | pass P0 { PixelShader = compile ps_2_0 ps_p0(); } 38 | } -------------------------------------------------------------------------------- /artifacts/config_files/Skills.ini: -------------------------------------------------------------------------------- 1 | ;This file lets you set the formula for calculating skills 2 | 3 | [skills] 4 | ;Changes the initial bonus to skill level for tagged skills 5 | ;valid range 0..100, 20 - default bonus 6 | TagSkillBonus=20 7 | 8 | ;Changes the behavior for tagged skills 9 | ;Set to 1 to give initial skill bonus for "Tag" perk 10 | ;Set to 2 to disable the double bonus of skill points for tagged skills 11 | ;Set to 3 to use both modes 12 | TagSkillMode=0 13 | 14 | ;Set to 1 to base skill costs on the number of additional points in a skill instead of the current level 15 | BasedOnPoints=0 16 | 17 | ;Examples 18 | ;Skill0=s1|i2|l1.5 ;Skill 0 (small guns) is str*1 + int*2 + luck*1.5 19 | ;SkillBase1=50 ;Big guns has a base of 50 20 | ;SkillImage1=72 21 | ;SkillMulti2=10 ;Each point spent in energy weapons increases it by 10 22 | ;SkillCost0=0|0|0|0|0|300 ;Each level of small guns costs 6 skill points -------------------------------------------------------------------------------- /sfall/Modules/EngineTweaks.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2021 The sfall team 4 | * 5 | */ 6 | 7 | #include "..\FalloutEngine\Fallout2.h" 8 | #include "..\main.h" 9 | 10 | #include "..\Game\items.h" 11 | 12 | #include "EngineTweaks.h" 13 | 14 | namespace sfall 15 | { 16 | 17 | void EngineTweaks::init() { 18 | auto tweakFile = IniReader::GetConfigString("Misc", "TweakFile", "", MAX_PATH); 19 | if (!tweakFile.empty()) { 20 | const char* cTweakFile = tweakFile.insert(0, ".\\").c_str(); 21 | 22 | game::Items::SetHealingPID(0, IniReader::GetInt("Items", "STIMPAK", fo::PID_STIMPAK, cTweakFile)); 23 | game::Items::SetHealingPID(1, IniReader::GetInt("Items", "SUPER_STIMPAK", fo::PID_SUPER_STIMPAK, cTweakFile)); 24 | game::Items::SetHealingPID(2, IniReader::GetInt("Items", "HEALING_POWDER", fo::PID_HEALING_POWDER, cTweakFile)); 25 | } 26 | } 27 | 28 | void EngineTweaks::exit() {} 29 | 30 | } 31 | -------------------------------------------------------------------------------- /sfall/WinProc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace sfall 10 | { 11 | 12 | class WinProc { 13 | public: 14 | static void init(); 15 | 16 | static void __stdcall MessageWindow(); 17 | static void __stdcall WaitMessageWindow(); 18 | 19 | static void SetWindowProc(); 20 | 21 | static void SetHWND(HWND _window); 22 | static void SetTitle(long wWidth, long wHeight, long gMode); 23 | static void SetSize(long w, long h, char scaleX2); 24 | 25 | // Sets the window style and its position 26 | static void SetStyle(long windowStyle); 27 | 28 | static void SetMoveKeys(); 29 | static void Moving(); 30 | 31 | static void SetToCenter(long wWidth, long wHeight, long* outX, long* outY); 32 | static void LoadPosition(); 33 | static void SavePosition(long mode); 34 | 35 | static const POINT* GetClientPos(); 36 | }; 37 | 38 | } -------------------------------------------------------------------------------- /sfall/CRC.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2009 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | namespace sfall 20 | { 21 | 22 | DWORD CRC(const char* filepath); 23 | DWORD GetCRC(FILE* fl); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /artifacts/example_mods/rain/data/shaders/weather/sand-def.fx: -------------------------------------------------------------------------------- 1 | string texname1 = ""; 2 | texture tex1; 3 | string texname2 = "weather\\sand.png"; 4 | texture tex2; 5 | 6 | static const float tscale=3; 7 | int tickcount; 8 | float multi; 9 | float speed; 10 | 11 | sampler s0; 12 | sampler s1 = sampler_state { 13 | texture = ; 14 | }; 15 | sampler s2 = sampler_state { 16 | texture = ; 17 | addressu=wrap; 18 | addressv=wrap; 19 | }; 20 | 21 | float4 ps_p0(float2 tex : TEXCOORD0) : COLOR0 22 | { 23 | float3 r1=tex2D(s0, tex); 24 | //if(tex.y>0.8) return float4(r1, 1); 25 | 26 | float offset=(float)tickcount/speed; 27 | float2 y={0.940, 0.342}; 28 | y*=offset; 29 | float3 r2=tex2D(s1, tex)*tex2D(s2, tex*tscale-y)-(1.0-multi); 30 | if(r2.r>0) { 31 | return float4(0.5,0.5,0,1); 32 | } else { 33 | return float4(r1, 1); 34 | } 35 | } 36 | 37 | 38 | technique T0 39 | { 40 | pass P0 { PixelShader = compile ps_2_0 ps_p0(); } 41 | } -------------------------------------------------------------------------------- /sfall/resource.rc: -------------------------------------------------------------------------------- 1 | #include "version.h" 2 | #include "resource.h" 3 | 4 | 1 VERSIONINFO 5 | FILEVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_BUILD,VERSION_REV 6 | PRODUCTVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_BUILD,VERSION_REV 7 | FILEFLAGSMASK 0x0L 8 | FILEFLAGS 0x0L 9 | FILEOS 0x0L 10 | FILETYPE 0x2L 11 | FILESUBTYPE 0x0L 12 | BEGIN 13 | BLOCK "StringFileInfo" 14 | BEGIN 15 | BLOCK "04090000" 16 | BEGIN 17 | VALUE "FileDescription", "sFall extended version by Mr.Stalin, for " TARGETVERSION 18 | VALUE "FileVersion", VERSION_STRING 19 | VALUE "InternalName", "sfall" 20 | VALUE "LegalCopyright", LEGAL_COPYRIGHT 21 | VALUE "ProductName", "sFall Extended" 22 | VALUE "ProductVersion", VERSION_STRING 23 | END 24 | END 25 | BLOCK "VarFileInfo" 26 | BEGIN 27 | VALUE "Translation", 0x0409, 0x0000 28 | END 29 | END 30 | 31 | // 32 | // RCDATA 33 | // 34 | IDR_RCDATA1 RCDATA "..\\DebugEditor\\FalloutDebug.exe" -------------------------------------------------------------------------------- /DebugEditor/SfallDebugEditor.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 11.00 2 | # Visual Studio 2010 3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SfallDebugEditor", "SfallDebugEditor.csproj", "{80ED0DCE-100E-4EC9-A79D-2FBFA4CAD1E3}" 4 | EndProject 5 | Global 6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 7 | Debug|Any CPU = Debug|Any CPU 8 | Release|Any CPU = Release|Any CPU 9 | EndGlobalSection 10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 11 | {80ED0DCE-100E-4EC9-A79D-2FBFA4CAD1E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 12 | {80ED0DCE-100E-4EC9-A79D-2FBFA4CAD1E3}.Debug|Any CPU.Build.0 = Debug|Any CPU 13 | {80ED0DCE-100E-4EC9-A79D-2FBFA4CAD1E3}.Release|Any CPU.ActiveCfg = Release|Any CPU 14 | {80ED0DCE-100E-4EC9-A79D-2FBFA4CAD1E3}.Release|Any CPU.Build.0 = Release|Any CPU 15 | EndGlobalSection 16 | GlobalSection(SolutionProperties) = preSolution 17 | HideSolutionNode = FALSE 18 | EndGlobalSection 19 | EndGlobal 20 | -------------------------------------------------------------------------------- /artifacts/example_mods/GetDrunk/Data/shaders/Booze3.fx: -------------------------------------------------------------------------------- 1 | sampler s0; 2 | 3 | static const float2 rcpres = 4 | { 5 | 0.0015625, 6 | 0.0020833333333333333333333333333333 7 | }; 8 | 9 | float4 Blur(float2 Tex : TEXCOORD0) : COLOR0 10 | { 11 | float4 Color = 0; 12 | 13 | Color += tex2D( s0, float2(Tex.x, Tex.y)); 14 | Color += tex2D(s0, float2(Tex.x + rcpres.x, Tex.y)); 15 | Color += tex2D(s0, float2(Tex.x - rcpres.x, Tex.y)); 16 | Color += tex2D(s0, float2(Tex.x, Tex.y + rcpres.y)); 17 | Color += tex2D(s0, float2(Tex.x, Tex.y - rcpres.y)); 18 | 19 | return Color * 0.2; 20 | } 21 | 22 | float4 Blind(float2 Tex : TEXCOORD0) : COLOR0 23 | { 24 | float4 Color = tex2D(s0, Tex); 25 | return Color * saturate(1.8 - (length(Tex - 0.5)*2)); 26 | } 27 | 28 | Technique blur 29 | { 30 | Pass P0 { PixelShader = compile ps_2_0 Blur(); } 31 | Pass P1 { PixelShader = compile ps_2_0 Blur(); } 32 | Pass P2 { PixelShader = compile ps_2_0 Blur(); } 33 | Pass P3 { PixelShader = compile ps_2_0 Blind(); } 34 | } -------------------------------------------------------------------------------- /ThirdPartyTools/SND2ACM_FIX/SND2ACM_FIX.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SND2ACM_FIX", "SND2ACM_FIX\SND2ACM_FIX.csproj", "{1D0A07AE-EDB4-43F3-BA7B-837CEE60CCDB}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {1D0A07AE-EDB4-43F3-BA7B-837CEE60CCDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {1D0A07AE-EDB4-43F3-BA7B-837CEE60CCDB}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {1D0A07AE-EDB4-43F3-BA7B-837CEE60CCDB}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {1D0A07AE-EDB4-43F3-BA7B-837CEE60CCDB}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /DevUtils/AddrHackScanner/AddrHackScanner.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddrHackScanner", "AddrHackScanner\AddrHackScanner.csproj", "{1B8E0D7F-664E-40DA-801B-7BB780347407}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {1B8E0D7F-664E-40DA-801B-7BB780347407}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {1B8E0D7F-664E-40DA-801B-7BB780347407}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {1B8E0D7F-664E-40DA-801B-7BB780347407}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {1B8E0D7F-664E-40DA-801B-7BB780347407}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /sfall/Modules/Premade.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2009 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "Module.h" 20 | 21 | namespace sfall 22 | { 23 | 24 | class Premade : public Module { 25 | public: 26 | const char* name() { return "Premade"; } 27 | void init(); 28 | }; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /sfall/FalloutEngine/FunctionOffsets.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2017 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "FunctionOffsets.h" 20 | 21 | namespace fo 22 | { 23 | namespace funcoffs 24 | { 25 | 26 | #define FUNC(name, addr) const unsigned long name = addr; 27 | 28 | #include "FunctionOffsets_def.h" 29 | 30 | #undef FUNC 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /sfall/Modules/Credits.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008, 2009 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class Credits : public Module { 27 | public: 28 | const char* name() { return "Credits"; } 29 | void init(); 30 | }; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /sfall/Modules/BurstMods.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2014 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class BurstMods : public Module { 27 | public: 28 | const char* name() { return "BurstMods"; } 29 | void init(); 30 | }; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /sfall/Modules/Elevators.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008, 2009 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class Elevators : public Module { 27 | public: 28 | const char* name() { return "Elevators"; } 29 | void init(); 30 | }; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /sfall/Modules/Scripting/Opcodes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2016 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | // 20 | // Everything related to new sfall opcodes. 21 | // 22 | 23 | namespace sfall 24 | { 25 | namespace script 26 | { 27 | 28 | class Opcodes { 29 | public: 30 | static void InitNew(); 31 | 32 | }; 33 | 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /sfall/Modules/Tiles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008, 2009 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class Tiles : public Module { 27 | public: 28 | const char* name() { return "Tiles"; } 29 | void init(); 30 | void exit() override; 31 | }; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /sfall/Modules/Books.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008, 2009 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class Books : public Module { 27 | public: 28 | const char* name() { return "Books"; } 29 | void init(); 30 | void exit() override; 31 | }; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /sfall/Modules/Scripting/Handlers/Combat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 The sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | #include "..\OpcodeContext.h" 10 | 11 | namespace sfall 12 | { 13 | namespace script 14 | { 15 | 16 | // Kill counters 17 | void SetExtraKillCounter(bool value); 18 | 19 | void __declspec() op_get_kill_counter(); 20 | 21 | void __declspec() op_mod_kill_counter(); 22 | 23 | void op_set_object_knockback(OpcodeContext&); 24 | 25 | void op_remove_object_knockback(OpcodeContext&); 26 | 27 | void __declspec() op_get_bodypart_hit_modifier(); 28 | 29 | void __declspec() op_set_bodypart_hit_modifier(); 30 | 31 | void op_get_attack_type(OpcodeContext&); 32 | 33 | void __declspec() op_force_aimed_shots(); 34 | 35 | void __declspec() op_disable_aimed_shots(); 36 | 37 | void __declspec() op_get_last_attacker(); 38 | 39 | void __declspec() op_get_last_target(); 40 | 41 | void __declspec() op_block_combat(); 42 | 43 | void mf_attack_is_aimed(OpcodeContext&); 44 | 45 | void mf_combat_data(OpcodeContext&); 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /sfall/Utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace sfall 8 | { 9 | 10 | // splits a string by given delimiter 11 | // taken from: http://stackoverflow.com/a/236803/4331475 12 | template 13 | void split(const std::string &s, char delim, T result, size_t limit = -1) { 14 | std::stringstream ss; 15 | ss.str(s); 16 | std::string item; 17 | size_t i = 0; 18 | while (std::getline(ss, item, delim) && (limit == -1 || i < limit)) { 19 | *(result++) = item; 20 | i++; 21 | } 22 | } 23 | 24 | WORD ByteSwapW(WORD w); 25 | DWORD ByteSwapD(DWORD dw); 26 | 27 | // Splits a string by given delimiter 28 | std::vector split(const std::string &s, char delim); 29 | 30 | std::string trim(const std::string& str); 31 | 32 | void trim(char* str); 33 | 34 | void ToLowerCase(std::string& line); 35 | 36 | bool isSpace(char c); 37 | 38 | const char* strfind(const char* source, const char* word); 39 | 40 | void StrNormalizePath(char* path); 41 | 42 | long GetRandom(long min, long max); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /sfall/SimplePatch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace sfall 4 | { 5 | 6 | template 7 | T SimplePatch(unsigned long addr, const char* iniSection, const char* iniKey, T defaultValue, T minValue = 0, T maxValue = INT_MAX) 8 | { 9 | return SimplePatch(&addr, 1, iniSection, iniKey, defaultValue, minValue, maxValue); 10 | } 11 | 12 | template 13 | T SimplePatch(unsigned long *addrs, int numAddrs, const char* iniSection, const char* iniKey, T defaultValue, T minValue = 0, T maxValue = INT_MAX) 14 | { 15 | T value; 16 | char msg[255]; 17 | value = (T)GetConfigInt(iniSection, iniKey, defaultValue); 18 | if (value != defaultValue) { 19 | if (value < minValue) { 20 | value = minValue; 21 | } else if (value > maxValue) { 22 | value = maxValue; 23 | } 24 | _snprintf_s(msg, sizeof(msg), _TRUNCATE, "Applying patch: %s = %d.", iniKey, value); 25 | dlog((const char*)msg, DL_INIT); 26 | for (int i = 0; i < numAddrs; i++) { 27 | SafeWrite(addrs[i], (T)value); 28 | } 29 | dlogr(" Done", DL_INIT); 30 | } 31 | return value; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /sfall/Modules/EngineTweaks.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2021 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class EngineTweaks : public Module { 27 | public: 28 | const char* name() { return "EngineTweaks"; } 29 | void init(); 30 | void exit() override; 31 | }; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /artifacts/example_mods/GetDrunk/Data/shaders/Booze4.fx: -------------------------------------------------------------------------------- 1 | sampler s0; 2 | 3 | static const float2 rcpres = 4 | { 5 | 0.0015625, 6 | 0.0020833333333333333333333333333333 7 | }; 8 | 9 | float4 Blur(float2 Tex : TEXCOORD0) : COLOR0 10 | { 11 | float4 Color = 0; 12 | 13 | Color += tex2D( s0, float2(Tex.x, Tex.y)); 14 | Color += tex2D(s0, float2(Tex.x + rcpres.x, Tex.y)); 15 | Color += tex2D(s0, float2(Tex.x - rcpres.x, Tex.y)); 16 | Color += tex2D(s0, float2(Tex.x, Tex.y + rcpres.y)); 17 | Color += tex2D(s0, float2(Tex.x, Tex.y - rcpres.y)); 18 | 19 | return Color * 0.2; 20 | } 21 | 22 | float4 Blind(float2 Tex : TEXCOORD0) : COLOR0 23 | { 24 | float4 Color = tex2D(s0, Tex); 25 | return Color * saturate(1.5 - (length(Tex - 0.5)*2)); 26 | } 27 | 28 | Technique blur 29 | { 30 | Pass P0 { PixelShader = compile ps_2_0 Blur(); } 31 | Pass P1 { PixelShader = compile ps_2_0 Blur(); } 32 | Pass P2 { PixelShader = compile ps_2_0 Blur(); } 33 | Pass P3 { PixelShader = compile ps_2_0 Blur(); } 34 | Pass P4 { PixelShader = compile ps_2_0 Blur(); } 35 | Pass P5 { PixelShader = compile ps_2_0 Blind(); } 36 | } -------------------------------------------------------------------------------- /sfall/Game/AI/AIHelpers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace game 10 | { 11 | namespace ai 12 | { 13 | 14 | class AIHelpers { 15 | public: 16 | 17 | // Returns the friendly critter or any blocking object in the line of fire 18 | static fo::GameObject* CheckShootAndTeamCritterOnLineOfFire(fo::GameObject* object, long targetTile, long team); 19 | 20 | // Returns the friendly critter in the line of fire 21 | static fo::GameObject* CheckFriendlyFire(fo::GameObject* target, fo::GameObject* attacker); 22 | 23 | // Return of the friendly critter that are located on the line of fire or any other non-shooting object 24 | // destTile - the tile from which the line will be checked 25 | static fo::GameObject* CheckFriendlyFire(fo::GameObject* target, fo::GameObject* attacker, long destTile); 26 | 27 | static bool AttackInRange(fo::GameObject* source, fo::GameObject* weapon, long distance); 28 | static bool AttackInRange(fo::GameObject* source, fo::GameObject* weapon, fo::GameObject* target); 29 | }; 30 | 31 | } 32 | } -------------------------------------------------------------------------------- /sfall/Modules/KillCounter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008, 2009 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class KillCounter : public Module { 27 | public: 28 | const char* name() { return "KillCounter"; } 29 | void init(); 30 | 31 | static bool UsingExtraKillTypes(); 32 | }; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /sfall/Modules/MetaruleExtender.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2020 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class MetaruleExtender : public Module { 27 | public: 28 | const char* name() { return "MetaruleExtender"; } 29 | void init(); 30 | //void exit() override; 31 | 32 | }; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /sfall/FalloutEngine/Fallout2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2017 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | /* 22 | * FALLOUT2.EXE structs, function offsets and wrappers are included from here. 23 | */ 24 | 25 | #include "Enums.h" 26 | #include "FunctionOffsets.h" 27 | #include "Structs.h" 28 | #include "EngineUtils.h" 29 | #include "Variables.h" 30 | #include "Functions.h" 31 | 32 | #include "VariableOffsets_HRP.h" -------------------------------------------------------------------------------- /sfall/Game/objects.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #include "..\FalloutEngine\Fallout2.h" 8 | #include "..\main.h" 9 | 10 | #include "..\Modules\HookScripts\MiscHs.h" 11 | 12 | #include "objects.h" 13 | 14 | namespace game 15 | { 16 | 17 | namespace sf = sfall; 18 | 19 | // Implementation of is_within_perception_ engine function with the HOOK_WITHINPERCEPTION hook 20 | long Objects::is_within_perception(fo::GameObject* watcher, fo::GameObject* target, long hookType) { 21 | return sf::PerceptionRangeHook_Invoke(watcher, target, hookType, fo::func::is_within_perception(watcher, target)); 22 | } 23 | 24 | // Alternative implementation of the objFindObjPtrFromID_ engine function with the type of object to find 25 | fo::GameObject* __fastcall Objects::FindObjectFromID(long id, long type) { 26 | fo::GameObject* obj = fo::func::obj_find_first(); 27 | while (obj) { 28 | if (obj->id == id && obj->Type() == type) return obj; 29 | obj = fo::func::obj_find_next(); 30 | } 31 | return nullptr; 32 | } 33 | 34 | void Objects::init() { 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /sfall/Modules/Karma.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2017 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class Karma : public Module { 27 | public: 28 | const char* name() { return "Karma"; } 29 | static void DisplayKarma(int value); 30 | void init(); 31 | }; 32 | 33 | extern bool displayKarmaChanges; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /sfall/Modules/MainMenu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2012 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "Module.h" 20 | 21 | namespace sfall 22 | { 23 | 24 | class MainMenu : public Module { 25 | public: 26 | const char* name() { return "MainMenu"; } 27 | void init(); 28 | 29 | static long mXOffset; 30 | static long mYOffset; 31 | static long mTextOffset; 32 | }; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /sfall/Modules/MiscPatches.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2016 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | #pragma once 19 | 20 | #include "Module.h" 21 | 22 | namespace sfall 23 | { 24 | 25 | class MiscPatches : public Module { 26 | public: 27 | const char* name() { return "MiscPatches"; } 28 | void init(); 29 | void exit() override; 30 | 31 | static void SetIdle(int value); 32 | }; 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /sfall/Modules/QuestList.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2009 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "Module.h" 20 | 21 | namespace sfall 22 | { 23 | 24 | class QuestList : public Module { 25 | public: 26 | const char* name() { return "QuestList"; } 27 | void init(); 28 | 29 | static void AddQuestFailureValue(long globalVarNum, long failureThreshold); 30 | }; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /sfall/Modules/Animations.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2009 Mash (Matt Wells, mashw at bigpond dot net dot au) 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class Animations : public Module { 27 | public: 28 | const char* name() { return "Animations"; } 29 | void init(); 30 | void exit() override; 31 | }; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /sfall/Modules/Console.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008, 2009 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class Console : public Module { 27 | public: 28 | const char* name() { return "Console"; } 29 | void init(); 30 | void exit() override; 31 | 32 | static void PrintFile(const char* msg); 33 | }; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /sfall/Modules/PlayerModel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2017 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | #pragma once 19 | 20 | #include "Module.h" 21 | 22 | namespace sfall 23 | { 24 | 25 | class PlayerModel : public Module { 26 | public: 27 | const char* name() { return "PlayerModel"; } 28 | void init(); 29 | }; 30 | 31 | extern char defaultMaleModelName[65]; 32 | extern char defaultFemaleModelName[65]; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /sfall/HRP/viewmap/EdgeBorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace HRP 10 | { 11 | 12 | class EdgeBorder { 13 | public: 14 | class Edge { 15 | public: 16 | POINT center; // x/y center of current map screen? 17 | RECT borderRect; // right is less than left 18 | RECT rect_2; // 19 | RECT tileRect; 20 | RECT squareRect; // angel clipping 21 | long clipData; // angel clip type 22 | Edge* prevEdgeData = nullptr; // unused (use in 3.06) 23 | Edge* nextEdgeData = nullptr; 24 | 25 | void Release() { 26 | Edge* edge = this->nextEdgeData; 27 | while (edge) { 28 | Edge* edgeNext = edge->nextEdgeData; 29 | delete edge; 30 | edge = edgeNext; 31 | }; 32 | this->nextEdgeData = nullptr; 33 | } 34 | 35 | ~Edge() { 36 | if (nextEdgeData) delete nextEdgeData; 37 | } 38 | }; 39 | 40 | static void init(); 41 | 42 | static Edge* CurrentMapEdge(); 43 | static long EdgeBorder::EdgeVersion(); 44 | 45 | static long GetCenterTile(long tile, long mapLevel); 46 | static long CheckBorder(long tile); 47 | }; 48 | 49 | } -------------------------------------------------------------------------------- /sfall/Modules/LoadOrder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2017 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class LoadOrder : public Module { 27 | public: 28 | const char* name() { return "LoadOrder"; } 29 | void init(); 30 | 31 | static void art_get_name_hack(); 32 | 33 | static void AddResourcePatches(std::string &dat, std::string &patches); 34 | }; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /sfall/Game/inventory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | #include "..\FalloutEngine\Fallout2.h" 10 | 11 | namespace game 12 | { 13 | 14 | class Inventory 15 | { 16 | public: 17 | static void init(); 18 | 19 | // Custom implementation engine function correctFidForRemovedItem_ with the HOOK_INVENWIELD hook 20 | static long correctFidForRemovedItem(fo::GameObject* critter, fo::GameObject* item, long flags); 21 | 22 | //static DWORD __fastcall item_weight(fo::GameObject* item); 23 | 24 | // The function returns the size of the occupied space for the object or critter 25 | // - difference from the item_c_curr_size_ function returns the size of equipped items for the critter 26 | // - does not return the size of nested items 27 | static DWORD __stdcall item_total_size(fo::GameObject* critter); 28 | 29 | // Reimplementation of adjust_fid engine function 30 | // Differences from vanilla: 31 | // - doesn't use art_vault_guy_num as default art, uses current critter FID instead 32 | // - invokes onAdjustFid delegate that allows to hook into FID calculation 33 | static DWORD __stdcall adjust_fid(); 34 | }; 35 | 36 | } -------------------------------------------------------------------------------- /sfall/Modules/HookScripts/CombatHs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Combat-related hook scripts 4 | 5 | namespace sfall 6 | { 7 | 8 | void InitCombatHookScripts(); 9 | 10 | void Inject_ToHitHook(); 11 | void Inject_AfterHitRollHook(); 12 | void Inject_CalcApCostHook(); 13 | void Inject_CombatDamageHook(); 14 | void Inject_FindTargetHook(); 15 | void Inject_ItemDamageHook(); 16 | void Inject_AmmoCostHook(); 17 | void Inject_CombatTurnHook(); 18 | void Inject_OnExplosionHook(); 19 | void Inject_SubCombatDamageHook(); 20 | void Inject_TargetObjectHook(); 21 | void Inject_BestWeaponHook(); 22 | void Inject_CanUseWeaponHook(); 23 | 24 | int __fastcall AmmoCostHook_Script(DWORD hookType, fo::GameObject* weapon, DWORD &rounds); 25 | 26 | long CalcAPCostHook_Invoke(fo::GameObject* source, long hitMode, long isCalled, long cost, fo::GameObject* weapon); 27 | void FindTargetHook_Invoke(fo::GameObject* targets[], fo::GameObject* attacker); 28 | fo::GameObject* BestWeaponHook_Invoke(fo::GameObject* bestWeapon, fo::GameObject* source, fo::GameObject* weapon1, fo::GameObject* weapon2, fo::GameObject* target); 29 | bool CanUseWeaponHook_Invoke(bool result, fo::GameObject* source, fo::GameObject* weapon, long hitMode); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /sfall/Modules/Movies.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008, 2009 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class Movies : public Module { 27 | public: 28 | const char* name() { return "Movies"; } 29 | void init(); 30 | void exit() override; 31 | 32 | static bool DirectShowMovies(); 33 | }; 34 | 35 | static constexpr int MaxMovies = 32; 36 | extern char MoviePaths[MaxMovies * 65]; 37 | 38 | } 39 | -------------------------------------------------------------------------------- /sfall/Modules/Module.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2017 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace sfall 22 | { 23 | 24 | class Module { 25 | public: 26 | 27 | Module() { 28 | } 29 | 30 | // the module name for logging 31 | virtual const char* name() = 0; 32 | 33 | // Called on starting the game 34 | virtual void init() = 0; 35 | 36 | // Called on exit 37 | virtual void exit() {} 38 | 39 | ~Module() { 40 | } 41 | }; 42 | 43 | } 44 | 45 | -------------------------------------------------------------------------------- /sfall/Modules/ScriptShaders.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Module.h" 4 | #include "Graphics.h" 5 | 6 | namespace sfall 7 | { 8 | 9 | class ScriptShaders : public Module { 10 | public: 11 | const char* name() { return "ScriptShaders"; } 12 | void init(); 13 | //void exit() override; 14 | 15 | static size_t Count(); 16 | 17 | static void Refresh(IDirect3DSurface9* sSurf1, IDirect3DSurface9* sSurf2, IDirect3DTexture9* sTex2); 18 | static void OnResetDevice(); 19 | static void OnLostDevice(); 20 | static void Release(); 21 | 22 | static void LoadGlobalShader(); 23 | }; 24 | 25 | int __stdcall LoadShader(const char*); 26 | void __stdcall ActivateShader(DWORD); 27 | void __stdcall DeactivateShader(DWORD); 28 | void __stdcall FreeShader(DWORD); 29 | void __stdcall SetShaderMode(DWORD d, DWORD mode); 30 | 31 | void __stdcall SetShaderInt(DWORD d, const char* param, int value); 32 | void __stdcall SetShaderFloat(DWORD d, const char* param, float value); 33 | void __stdcall SetShaderVector(DWORD d, const char* param, float f1, float f2, float f3, float f4); 34 | 35 | int __stdcall GetShaderTexture(DWORD d, DWORD id); 36 | void __stdcall SetShaderTexture(DWORD d, const char* param, DWORD value); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /sfall/Modules/SpeedPatch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2017 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class SpeedPatch : public Module { 27 | public: 28 | const char* name() { return "SpeedPatch"; } 29 | void init(); 30 | void exit() override; 31 | 32 | static DWORD getTickCountOffs; 33 | 34 | // sfall implementation of the GetTickCount() function 35 | static DWORD getTickCount(); 36 | }; 37 | 38 | } 39 | -------------------------------------------------------------------------------- /sfall/Modules/Explosions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2014 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class Explosions : public Module { 27 | public: 28 | const char* name() { return "Explosions"; } 29 | void init(); 30 | 31 | static void AddToExplosives(DWORD pid, DWORD activePid, DWORD minDmg, DWORD maxDmg); 32 | }; 33 | 34 | int __stdcall ExplosionsMetaruleFunc(int mode, int arg1, int arg2); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /sfall/Modules/Skills.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2011 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class Skills : public Module { 27 | public: 28 | const char* name() { return "Skills"; } 29 | void init(); 30 | void exit() override; 31 | }; 32 | 33 | void __stdcall SetSkillMax(fo::GameObject* critter, int maximum); 34 | void __stdcall SetPickpocketMax(fo::GameObject* critter, DWORD maximum, DWORD mod); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /sfall/Modules/AI.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2012 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "..\FalloutEngine\Fallout2.h" 22 | 23 | #include "Module.h" 24 | 25 | namespace sfall 26 | { 27 | 28 | class AI : public Module { 29 | public: 30 | const char* name() { return "AI"; } 31 | void init(); 32 | 33 | static fo::GameObject* __stdcall AIGetLastAttacker(fo::GameObject* target); 34 | static fo::GameObject* __stdcall AIGetLastTarget(fo::GameObject* source); 35 | }; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /ThirdPartyTools/SND2ACM_FIX/SND2ACM_FIX/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SND2ACM_FIX.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /sfall/Game/ImprovedAI/AI.Combat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2021 The sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace game 10 | { 11 | namespace imp_ai 12 | { 13 | 14 | enum CombatShootResult : long { 15 | Ok = 0, 16 | NoAmmo = 1, 17 | OutOfRange = 2, 18 | NotEnoughAPs = 3, 19 | TargetDead = 4, 20 | ShootBlock = 5, 21 | CrippledHand = 6, 22 | CrippledHands = 7, 23 | CantUseWeapon = 7, 24 | NoActionPoint = 8, // add ext 25 | }; 26 | 27 | enum class CombatDifficulty : long 28 | { 29 | Easy = 0, 30 | Normal = 1, 31 | Hard = 2 32 | }; 33 | 34 | class AICombat { 35 | public: 36 | static void init(bool); 37 | 38 | static bool AICombat::npcPercentMinHP; 39 | static CombatDifficulty AICombat::combatDifficulty; 40 | 41 | static CombatShootResult combat_check_bad_shot(fo::GameObject* source, fo::GameObject* target, fo::AttackType hitMode, long isCalled); 42 | 43 | static void AttackerSetHitMode(fo::AttackType mode); 44 | static fo::AttackType AttackerHitMode(); 45 | static long AttackerBonusAP(); 46 | static long AttackerBodyType(); 47 | static bool AttackerIsHumanoid(); 48 | static bool AttackerInParty(); 49 | static fo::AIcap* AttackerAI(); 50 | }; 51 | 52 | } 53 | } -------------------------------------------------------------------------------- /DevUtils/AddrHackScanner/AddrHackScanner/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace AddrHackScanner.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /DebugEditor/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using System.IO; 4 | 5 | namespace FalloutClient { 6 | static class Program { 7 | /// 8 | /// The main entry point for the application. 9 | /// 10 | [STAThread] 11 | static void Main(string[] args) { 12 | Application.EnableVisualStyles(); 13 | Application.SetCompatibleTextRenderingDefault(false); 14 | 15 | if (args.Length == 1 && args[0] == "-debugedit") { 16 | Application.Run(new DebugEditor(new EditorConnection())); 17 | } else { 18 | MessageBox.Show("The debug editor can only be run from the game.\n" + 19 | "Use the key assigned to the DebugEditorKey option in ddraw.ini to run the debugger.", 20 | "sfall debug editor", MessageBoxButtons.OK, MessageBoxIcon.Stop); 21 | } 22 | } 23 | } 24 | 25 | enum DataTypeSend { 26 | SetGlobal = 0, 27 | SetMapVar = 1, 28 | RetrieveCritter = 2, 29 | SetCritter = 3, 30 | SetSGlobal = 4, 31 | GetArray = 9, 32 | SetArray = 10, 33 | GetLocal = 11, 34 | SetLocal = 12, 35 | Exit = 254, 36 | RedrawGame = 255 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /artifacts/config_files/Stats.ini: -------------------------------------------------------------------------------- 1 | ;This file can be used to set the relationship between derived stats and base stats 2 | ;Put the stat id in brackets, then use the following keys 3 | ;base - the initial value of the stat 4 | ;min - the lower limit of the stat after applying the base stats, 5 | ; but before adding any extra/perk/trait bonuses 6 | ;multi[x] - where x is from 0 to 6, the multiplier of st/pe/en/etc. 7 | ;shift[x] - shifts the base stat before the multiplication 8 | 9 | [Main] 10 | ;Set to 1 to take the bonus values of SPECIAL stats into account when calculating maximum health points 11 | ;Set to 0 for the fallout(original) behavior (bonus stats do not affect derived maximum health points) 12 | HPDependOnBonusStats=0 13 | 14 | ;max hp 15 | [7] 16 | base=15 ; base of 15 17 | multi0=1 ; +1*st 18 | multi2=2 ; +2*en 19 | 20 | ;max ap 21 | [8] 22 | base=5 ; base of 5 23 | multi5=0.5 ; +0.5*ag 24 | 25 | ;ac 26 | [9] 27 | multi5=1 28 | 29 | ;melee damage 30 | [11] 31 | min=1 32 | shift0=-5 33 | multi0=1 34 | 35 | ;carry weight 36 | [12] 37 | base=25 38 | multi0=25 39 | 40 | ;sequence 41 | [13] 42 | multi1=2 43 | 44 | ;heal rate 45 | [14] 46 | min=1 47 | multi2=0.3333333333 48 | 49 | ;critical chance 50 | [15] 51 | multi6=1 52 | 53 | ;rad resist 54 | [31] 55 | multi2=2 56 | 57 | ;poison resist 58 | [32] 59 | multi2=5 -------------------------------------------------------------------------------- /artifacts/config_files/elevators.ini: -------------------------------------------------------------------------------- 1 | ;Controls the elevators 2 | ;Image must match up with the image of an existing elevator (can be overrided in sfall 4.1.4 or newer) 3 | ;Make sure you specify the correct number of exit targets 4 | ;The maximum number of elevators is currently capped at 50 5 | ;Use the line number (0-indexed) of the corresponding FRM in intrface.lst to set the appearance of the elevator 6 | 7 | ;Override elevator 0 8 | [0] 9 | ;This elevator will uses the settings of the original forth elevator 10 | Image=4 11 | 12 | ;Set up the first exit point 13 | ID1=49 14 | Elevation1=0 15 | Tile1=14920 16 | 17 | ;Second exit point 18 | ID2=49 19 | Elevation2=1 20 | Tile2=15120 21 | 22 | ;Third exit point 23 | ID3=50 24 | Elevation3=0 25 | Tile3=12944 26 | 27 | ;No forth exit point 28 | 29 | ;Override FRM images of elevator 0. Set ButtonsFrm to -1 to use default buttons from MainFrm 30 | MainFrm=143 31 | ButtonsFrm=-1 32 | 33 | 34 | ;An example of a new elevator 35 | [24] 36 | ;Set Image to 24 to create a new elevator type (0-23 are the original elevator types) 37 | Image=24 38 | 39 | ;Set the number of buttons 40 | ButtonCount=3 41 | 42 | ;Set the appearance of the elevator 43 | MainFrm=148 ; EL_VAULT.FRM 44 | ButtonsFrm=151 ; EL_MIL3.FRM 45 | 46 | ;Set up the exit points for all three buttons (see examples above) 47 | -------------------------------------------------------------------------------- /sfall/Modules/Unarmed.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2021 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class Unarmed : public Module { 27 | public: 28 | const char* name() { return "Unarmed"; } 29 | void init(); 30 | //void exit() override; 31 | 32 | static long GetHitCostAP(fo::AttackType hit); 33 | static long GetDamage(fo::AttackType hit, long &minOut, long &maxOut); 34 | static const char* GetName(fo::AttackType hit); 35 | 36 | static fo::AttackType GetStoredHitMode(fo::HandSlot slot); 37 | }; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /artifacts/example_mods/ExplosiveTimer/hs_explosivetimer.ssl: -------------------------------------------------------------------------------- 1 | /* 2 | Example implementation of the algorithm of how the game engine sets the explosive timer. 3 | */ 4 | 5 | #include "..\..\scripting_docs\headers\sfall.h" 6 | #include "..\..\scripting_docs\headers\define_lite.h" 7 | 8 | // from CONDTION.H 9 | #define ROLL_CRITICAL_FAILURE (0) 10 | #define ROLL_FAILURE (1) 11 | #define ROLL_SUCCESS (2) 12 | #define ROLL_CRITICAL_SUCCESS (3) 13 | 14 | procedure start; 15 | 16 | procedure start begin 17 | if (init_hook == 0) then begin 18 | variable 19 | time := get_sfall_arg, 20 | result := ROLL_CRITICAL_FAILURE; 21 | 22 | if has_trait(TRAIT_PERK, dude_obj, PERK_demolition_expert_perk) then 23 | result := ROLL_SUCCESS; 24 | else begin 25 | result := roll_vs_skill(dude_obj, SKILL_TRAPS, 0); 26 | end 27 | 28 | if (result) then begin 29 | if (result == ROLL_FAILURE) then 30 | time /= 2; 31 | else begin // success or critical success 32 | result := ROLL_SUCCESS; 33 | end 34 | end else begin // critical failure 35 | time := 0; 36 | result := ROLL_FAILURE; 37 | end 38 | 39 | set_sfall_return(time); 40 | set_sfall_return(result); // failure/success 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /sfall/Modules/Inventory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2011 Timeslip 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "..\Delegate.h" 22 | #include "Module.h" 23 | 24 | namespace sfall 25 | { 26 | 27 | class Inventory : public Module { 28 | public: 29 | const char* name() { return "Inventory"; } 30 | void init(); 31 | 32 | // Called after game calculated dude FID for displaying on inventory screen 33 | static Delegate& OnAdjustFid(); 34 | static void InvokeAdjustFid(long fid); 35 | 36 | static long GetInvenApCost(); 37 | static void __fastcall SetInvenApCost(int cost); 38 | }; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /sfall/Game/ImprovedAI/AI.Behavior.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2020 The sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace game 10 | { 11 | namespace imp_ai 12 | { 13 | 14 | #ifndef NDEBUG 15 | #define DEV_PRINTF(info) fo::func::debug_printf(info) 16 | #define DEV_PRINTF1(info, a) fo::func::debug_printf(info, a) 17 | #define DEV_PRINTF2(info, a, b) fo::func::debug_printf(info, a, b) 18 | #define DEV_PRINTF3(info, a, b, c) fo::func::debug_printf(info, a, b, c) 19 | #else 20 | #define DEV_PRINTF(info) 21 | #define DEV_PRINTF1(info, a) 22 | #define DEV_PRINTF2(info, a, b) 23 | #define DEV_PRINTF3(info, a, b, c) 24 | #endif 25 | 26 | class AIBehavior { 27 | public: 28 | static void init(bool); 29 | 30 | enum class AttackResult : long 31 | { 32 | Default = -1, 33 | TargetDead = 4, // цель была убита 34 | NoMovePoints = 8, // нет очков для передвижения 35 | LostWeapon = 9, // оружие упало 36 | ReTryAttack = 10, 37 | BadToHit = 11, 38 | MoveAway 39 | }; 40 | 41 | static long __fastcall AICheckBeforeWeaponSwitch(fo::GameObject* target, long &hitMode, fo::GameObject* source, fo::GameObject* weapon); 42 | static long __fastcall AIMoveStepsCloser(long flags, fo::GameObject* target, fo::GameObject* source, long distance); 43 | }; 44 | 45 | constexpr int pickupCostAP = 3; // engine default cost 46 | 47 | } 48 | } -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | branches: 6 | - 'devUnofficial' 7 | - 'github-action' 8 | paths: 9 | - '.github/workflows/build.yml' 10 | - 'action.yml' 11 | - 'sfall/**' 12 | 13 | jobs: 14 | Build: 15 | name: sfall 16 | runs-on: windows-latest 17 | steps: 18 | 19 | - name: Clone sfall 20 | uses: actions/checkout@v2 21 | 22 | # Action is used twice for self-testing only 23 | 24 | - name: ReleaseXP build 25 | id: build 26 | uses: ./ 27 | with: 28 | release-xp: false 29 | 30 | - name: DevXP build 31 | id: build2 32 | uses: ./ 33 | with: 34 | dev-xp: true 35 | 36 | - name: Prepare artifact 37 | run: | 38 | : 39 | mkdir -p ddraw/DevXP 40 | if [[ "${{ steps.build2.outputs.dev-xp }}" != "" ]]; then 41 | cp "${{ steps.build2.outputs.dev-xp }}" ddraw/DevXP 42 | cp "${{ steps.build2.outputs.dev-xp-pdb }}" ddraw/DevXP 43 | fi 44 | 45 | if [[ "${{ steps.build.outputs.release-xp }}" != "" ]]; then 46 | cp "${{ steps.build.outputs.release-xp }}" ddraw 47 | fi 48 | shell: bash 49 | 50 | - name: Upload artifacts 51 | uses: actions/upload-artifact@v2 52 | with: 53 | name: sfall-ext 54 | path: ddraw 55 | retention-days: 7 56 | -------------------------------------------------------------------------------- /artifacts/mods/gl_auto_closebox.ssl: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Auto-Close Containers Mod 4 | ---------------------------------------------------- 5 | - automatically closes the container after looting 6 | 7 | Requires sfall 4.2.2/3.8.29 or higher 8 | 9 | */ 10 | 11 | #define SFALL_SC_EVALUATION (true) // Automatic script compilation with -s option 12 | 13 | #include "main.h" 14 | 15 | procedure start; 16 | procedure close; 17 | 18 | variable lootObject; 19 | variable closeObject; 20 | 21 | procedure start begin 22 | if (game_loaded) then begin 23 | if (GetConfig("Inventory", "AutoCloseContainers", 0)) then begin 24 | register_hook_proc_spec(HOOK_GAMEMODECHANGE, start); 25 | end 26 | end 27 | else begin 28 | variable mode = get_game_mode; 29 | if (mode andAlso mode != INTFACELOOT) then return; 30 | if (mode == INTFACELOOT) then begin 31 | lootObject = loot_obj; 32 | if (obj_type(lootObject) != OBJ_TYPE_ITEM) then lootObject = 0; 33 | end 34 | else if (lootObject andAlso get_sfall_arg_at(1) == INTFACELOOT) then begin 35 | if (get_object_data(lootObject, OBJ_DATA_CUR_FRM) > 1) then begin 36 | closeObject = lootObject; 37 | call close in 0; 38 | end 39 | lootObject = 0; 40 | end 41 | end 42 | end 43 | 44 | procedure close begin 45 | obj_close(closeObject); 46 | end -------------------------------------------------------------------------------- /DebugEditor/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Fallout Sfall Debug Editor")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Sfall")] 13 | [assembly: AssemblyCopyright("Copyright © 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("6b3c8cd6-54f0-4f35-a87e-50f760ad36fd")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | [assembly: AssemblyVersion("4.1.9.0")] 33 | [assembly: AssemblyFileVersion("4.1.9.0")] 34 | -------------------------------------------------------------------------------- /artifacts/config_files/Unarmed.ini: -------------------------------------------------------------------------------- 1 | ; This file lets you configure the requirements and effects of unarmed attacks 2 | 3 | ;*** Example for Strong Punch hit *** 4 | [8] ; STRONG_PUNCH 5 | ReqLevel=1 ; required player level 6 | SkillLevel=55 ; required Unarmed skill level 7 | 8 | ; Required stats 9 | Stat0=0 ; ST 10 | Stat1=0 ; PE 11 | Stat2=0 ; EN 12 | Stat3=0 ; CH 13 | Stat4=0 ; IQ 14 | Stat5=6 ; AG 15 | Stat6=0 ; LU 16 | 17 | MinDamage=1 18 | MaxDamage=2 19 | BonusDamage=3 ; bonus damage added to the minimum and maximum damage 20 | BonusCrit=0 ; value to the chance of critical success 21 | 22 | ; The number of action points spent on a hit 23 | ; you can leave the value empty or omit the parameter to use the engine default value 24 | CostAP= 25 | Penetrate=0 ; set to 1 to make the attack reduce target's armor DT (the formula is determined by the engine or a custom script) 26 | Secondary=0 ; set to 1 to assign the attack to the secondary mode (be careful when setting this parameter) 27 | 28 | 29 | [9] ; JAB 30 | 31 | [10] ; HAMMER_PUNCH 32 | 33 | [11] ; PALM_STRIKE 34 | 35 | [12] ; HAYMAKER 36 | 37 | [13] ; PIERCING_STRIKE 38 | 39 | [14] ; STRONG_KICK 40 | 41 | [15] ; HIP_KICK 42 | 43 | [16] ; SNAP_KICK 44 | 45 | [17] ; HOOK_KICK 46 | 47 | [18] ; POWER_KICK 48 | 49 | [19] ; PIERCING_KICK 50 | 51 | ; Default attacks (any requirements are ignored) 52 | [4] ; PUNCH 53 | 54 | [5] ; KICK 55 | -------------------------------------------------------------------------------- /artifacts/config_files/Translations.ini: -------------------------------------------------------------------------------- 1 | [sfall] 2 | SaveInCombat=Cannot save at this time. 3 | KarmaGain=You gained %d karma. 4 | KarmaLoss=You lost %d karma. 5 | HighlightFail1=You aren't carrying a motion sensor. 6 | HighlightFail2=Your motion sensor is out of charge. 7 | SuperStimExploitMsg=You cannot use this item on someone who is not injured! 8 | BlockedCombat=You cannot enter combat at this time. 9 | SaveSfallDataFail=ERROR saving extended savegame information! Check if other programs interfere with savegame files/folders and try again. 10 | PartyLvlMsg=Level: 11 | PartyACMsg=AC: 12 | PartyAddictMsg=Addict 13 | DisplayStatEL=" Electr." 14 | DisplayStatHP=HP: 15 | NPCPickupFail=%s cannot pick up the item. 16 | 17 | PartyOrderAttackHuman=I'll take care of it.|Okay, I got it.|Sounds like a plan. 18 | ;PartyOrderAttackCreature=::Growl:: 19 | ;PartyOrderAttackRobot=::Beep:: 20 | 21 | [AppearanceMod] 22 | RaceText=Race 23 | StyleText=Style 24 | ;DoneBtn=Done 25 | 26 | ;Custom names for player's unarmed attacks (max 16 characters) 27 | [Hits] 28 | ;Punch=Punch: 29 | ;Kick=Kick: 30 | ;StrongPunch=Strong punch: 31 | ;HammerPunch=Hammer punch: 32 | ;Haymaker=Haymaker: 33 | ;Jab=Jab: 34 | ;PalmStrike=Palm strike: 35 | ;PiercingStrike=Piercing strike: 36 | ;StrongKick=Strong kick: 37 | ;SnapKick=Snap kick: 38 | ;PowerKick=Power kick: 39 | ;HipKick=Hip kick: 40 | ;HookKick=Hook kick: 41 | ;PiercingKick=Piercing kick: 42 | -------------------------------------------------------------------------------- /sfall/Modules/Criticals.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008, 2009 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class Criticals : public Module { 27 | public: 28 | const char* name() { return "Criticals"; } 29 | void init(); 30 | 31 | static const DWORD critTableCount; 32 | 33 | static void SetCriticalTable(DWORD critter, DWORD bodypart, DWORD slot, DWORD element, DWORD value); 34 | static DWORD GetCriticalTable(DWORD critter, DWORD bodypart, DWORD slot, DWORD element); 35 | static void ResetCriticalTable(DWORD critter, DWORD bodypart, DWORD slot, DWORD element); 36 | 37 | }; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /sfall/Modules/Scripting/Handlers/Memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2016 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace sfall 22 | { 23 | namespace script 24 | { 25 | 26 | extern bool checkValidMemAddr; 27 | 28 | // memory_reading_funcs 29 | 30 | void __declspec() op_read_byte(); 31 | 32 | void __declspec() op_read_short(); 33 | 34 | void __declspec() op_read_int(); 35 | 36 | void __declspec() op_read_string(); 37 | 38 | void __declspec() op_write_byte(); 39 | 40 | void __declspec() op_write_short(); 41 | 42 | void __declspec() op_write_int(); 43 | 44 | void __declspec() op_write_string(); 45 | 46 | void __declspec() op_call_offset(); 47 | 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /sfall/Modules/ExtraSaveSlots.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2009 Mash (Matt Wells, mashw at bigpond dot net dot au) 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class ExtraSaveSlots : public Module { 27 | public: 28 | const char* name() { return "SuperSave"; } 29 | void init(); 30 | void exit() override; 31 | 32 | static long ExtraSaveSlots::GetSaveSlot(); 33 | static void ExtraSaveSlots::SetSaveSlot(long page, long slot); 34 | 35 | static long ExtraSaveSlots::GetQuickSavePage(); 36 | static long ExtraSaveSlots::GetQuickSaveSlot(); 37 | static void ExtraSaveSlots::SetQuickSaveSlot(long page, long slot, long check); 38 | }; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /sfall/Modules/HeroAppearance.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2009 Mash (Matt Wells, mashw at bigpond dot net dot au) 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class HeroAppearance : public Module { 27 | public: 28 | const char* name() { return "HeroAppearance"; } 29 | 30 | void init(); 31 | void exit() override; 32 | 33 | static bool appModEnabled; 34 | }; 35 | 36 | void __stdcall HeroSelectWindow(int raceStyleFlag); 37 | void __stdcall SetHeroStyle(int newStyleVal); 38 | void __stdcall SetHeroRace(int newRaceVal); 39 | void __stdcall LoadHeroAppearance(void); 40 | void __stdcall SetNewCharAppearanceGlobals(void); 41 | 42 | void __stdcall RefreshPCArt(); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /sfall/Modules/Scripting/Handlers/Metarule.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2016 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #include "..\..\..\main.h" 26 | #include "..\..\ScriptExtender.h" 27 | 28 | namespace sfall 29 | { 30 | namespace script 31 | { 32 | 33 | // Example handler. Feel free to add handlers in other files. 34 | #ifndef NDEBUG 35 | void mf_test(OpcodeContext&); 36 | #endif 37 | 38 | // returns current contents of metarule table 39 | void mf_get_metarule_table(OpcodeContext&); 40 | 41 | void mf_metarule_exist(OpcodeContext&); 42 | 43 | void InitMetaruleTable(); 44 | 45 | void HandleMetarule(OpcodeContext& ctx); 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /sfall/Modules/Scripting/Handlers/Math.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2020 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace sfall 22 | { 23 | namespace script 24 | { 25 | 26 | class OpcodeContext; 27 | 28 | void op_div(OpcodeContext&); 29 | 30 | void op_sqrt(OpcodeContext&); 31 | 32 | void op_abs(OpcodeContext&); 33 | 34 | void op_sin(OpcodeContext&); 35 | 36 | void op_cos(OpcodeContext&); 37 | 38 | void op_tan(OpcodeContext&); 39 | 40 | void op_arctan(OpcodeContext&); 41 | 42 | void op_power(OpcodeContext&); 43 | 44 | void op_log(OpcodeContext&); 45 | 46 | void op_exponent(OpcodeContext&); 47 | 48 | void op_ceil(OpcodeContext&); 49 | 50 | void op_round(OpcodeContext&); 51 | 52 | void mf_floor2(OpcodeContext&); 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /sfall/HLSL/L8PixelShader.hlsl: -------------------------------------------------------------------------------- 1 | 2 | texture image; 3 | texture palette; 4 | texture head; 5 | texture highlight; 6 | sampler s0 = sampler_state { texture=; }; 7 | sampler s1 = sampler_state { texture=; minFilter=none; magFilter=none; addressU=clamp; addressV=clamp; }; 8 | sampler s2 = sampler_state { texture=; minFilter=linear; magFilter=linear; addressU=clamp; addressV=clamp; }; 9 | sampler s3 = sampler_state { texture=; minFilter=linear; magFilter=linear; addressU=clamp; addressV=clamp; }; 10 | float2 size; 11 | float2 corner; 12 | float2 sizehl; 13 | float2 cornerhl; 14 | int showhl; 15 | 16 | // shader for displaying head textures 17 | float4 P1( in float2 Tex : TEXCOORD0 ) : COLOR0 18 | { 19 | float backdrop = tex2D(s0, Tex).r; 20 | float3 result; 21 | 22 | if (abs(backdrop - 1.0) < 0.001) { 23 | result = tex2D(s2, saturate((Tex - corner) / size)); 24 | } else { 25 | result = tex1D(s1, backdrop).bgr * 4; 26 | } 27 | // blend highlights 28 | if (showhl) { 29 | float4 h = tex2D(s3, saturate((Tex - cornerhl) / sizehl)); 30 | result = saturate(result + h); 31 | } 32 | return float4(result, 1); 33 | } 34 | 35 | technique T1 36 | { 37 | pass p1 { PixelShader = compile ps_2_0 P1(); } 38 | } 39 | 40 | // main shader 41 | float4 P0( in float2 Tex : TEXCOORD0 ) : COLOR0 42 | { 43 | float3 result = tex1D(s1, tex2D(s0, Tex).r); 44 | return float4(result.bgr * 4, 1); 45 | } 46 | 47 | technique T0 48 | { 49 | pass p0 { PixelShader = compile ps_2_0 P0(); } 50 | } 51 | -------------------------------------------------------------------------------- /sfall/Modules/DamageMod.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008, 2009 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class DamageMod : public Module { 27 | public: 28 | const char* name() { return "DamageMod"; } 29 | void init(); 30 | 31 | static int formula; 32 | 33 | static void DamageYAAM(fo::ComputeAttackResult &ctd, DWORD &accumulatedDamage, int rounds, int armorDT, int armorDR, int bonusRangedDamage,int multiplyDamage, int difficulty); 34 | static void DamageGlovz(fo::ComputeAttackResult &ctd, DWORD &accumulatedDamage, int rounds, int armorDT, int armorDR, int bonusRangedDamage, int multiplyDamage, int difficulty); 35 | 36 | static long GetHtHMinDamageBonus(fo::GameObject* source); 37 | }; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /sfall/Game/skills.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #include "..\FalloutEngine\Fallout2.h" 8 | 9 | #include "..\main.h" 10 | #include "..\Modules\Perks.h" 11 | 12 | #include "skills.h" 13 | 14 | namespace game 15 | { 16 | 17 | namespace sf = sfall; 18 | 19 | // TODO: skill_level_, perk_adjust_skill_ 20 | 21 | int __stdcall Skills::trait_adjust_skill(DWORD skillID) { 22 | int result = 0; 23 | 24 | if (sf::Perks::TraitsModEnable()) { 25 | if (fo::var::pc_trait[0] != -1) result += sf::Perks::GetTraitSkillBonus(skillID, 0); 26 | if (fo::var::pc_trait[1] != -1) result += sf::Perks::GetTraitSkillBonus(skillID, 1); 27 | } 28 | 29 | if (sf::Perks::DudeHasTrait(fo::TRAIT_gifted)) result -= 10; 30 | 31 | if (sf::Perks::DudeHasTrait(fo::TRAIT_good_natured)) { 32 | if (skillID <= fo::SKILL_THROWING) { 33 | result -= 10; 34 | } else if (skillID == fo::SKILL_FIRST_AID || skillID == fo::SKILL_DOCTOR || skillID == fo::SKILL_CONVERSANT || skillID == fo::SKILL_BARTER) { 35 | result += 15; 36 | } 37 | } 38 | return result; 39 | } 40 | 41 | static void __declspec(naked) trait_adjust_skill_replacement() { 42 | __asm { 43 | push edx; 44 | push ecx; 45 | push eax; // skillID 46 | call Skills::trait_adjust_skill; 47 | pop ecx; 48 | pop edx; 49 | retn; 50 | } 51 | } 52 | 53 | void Skills::init() { 54 | // Replace functions 55 | sf::MakeJump(fo::funcoffs::trait_adjust_skill_, trait_adjust_skill_replacement); // 0x4B40FC 56 | } 57 | 58 | } -------------------------------------------------------------------------------- /sfall/Modules/Stats.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008, 2009 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class Stats : public Module { 27 | public: 28 | const char* name() { return "Stats"; } 29 | void init(); 30 | 31 | static float experienceMod; 32 | static DWORD standardApAcBonus; 33 | static DWORD extraApAcBonus; 34 | 35 | static long GetStatMax(int stat, int isNPC); 36 | static long GetStatMin(int stat, int isNPC); 37 | 38 | static void UpdateHPStat(fo::GameObject* critter); 39 | }; 40 | 41 | void __stdcall SetPCStatMax(int stat, int value); 42 | void __stdcall SetPCStatMin(int stat, int value); 43 | void __stdcall SetNPCStatMax(int stat, int value); 44 | void __stdcall SetNPCStatMin(int stat, int value); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /sfall/FalloutEngine/FunctionOffsets.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2017 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | /* 22 | * HOW TO USE ENGINE FUNCTIONS: 23 | * 24 | * in ASM code, call offsets directly, don't call wrappers as they might not be _stdcall 25 | * in C++ code, use wrappers (add new ones if the don't exist yet, see Wrappers_def.h) 26 | * 27 | * Note: USE C++! 28 | * 1) Place thin __declspec(naked) hooks, only use minimum ASM to pass values to/from C++ 29 | * 2) Call _stdcall functions from (1), write those entirely in C++ (with little ASM blocks only to call engine functions, when you are too lazy to add wrapper) 30 | */ 31 | 32 | namespace fo 33 | { 34 | 35 | namespace funcoffs 36 | { 37 | 38 | #define FUNC(name, addr) extern const unsigned long name; 39 | 40 | #include "FunctionOffsets_def.h" 41 | 42 | #undef FUNC 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /artifacts/scripting/headers/lib.math.h: -------------------------------------------------------------------------------- 1 | #ifndef LIB_MATH_H 2 | #define LIB_MATH_H 3 | 4 | /** 5 | Numbers... 6 | */ 7 | 8 | #define above(a, b) (unsigned_comp(a, b) > 0) 9 | #define above_equal(a, b) (unsigned_comp(a, b) >= 0) 10 | #define below(a, b) (unsigned_comp(a, b) < 0) 11 | #define below_equal(a, b) (unsigned_comp(a, b) <= 0) 12 | 13 | // for sfall 4.2.3/3.8.23 14 | pure procedure unsigned_comp(variable a, variable b) begin 15 | if ((a bwxor b) == 0) then return 0; // a == b 16 | return 1 if ((b == 0) orElse a div b) else -1; 17 | end 18 | 19 | #define MAX(x, y) ((x > y) * x + (x <= y) * y) 20 | #define MIN(x, y) ((x < y) * x + (x >= y) * y) 21 | #define in_range(x, from, to) (x >= from and x <= to) 22 | 23 | procedure max(variable x, variable y) begin 24 | if (x > y) then return x; 25 | return y; 26 | end 27 | 28 | procedure min(variable x, variable y) begin 29 | if (x < y) then return x; 30 | return y; 31 | end 32 | 33 | /*procedure round(variable val) begin 34 | variable intp; 35 | intp := floor(val); 36 | if ((val-intp) >= 0.5) then intp++; 37 | return intp; 38 | end*/ 39 | 40 | /*procedure ceil(variable val) begin 41 | variable intp; 42 | intp := floor(val); 43 | if (abs(val-intp) > 0.0) then begin 44 | intp++; 45 | end 46 | return intp; 47 | end*/ 48 | 49 | procedure cap_number(variable num, variable min, variable max) begin 50 | if (num > max) then 51 | num := max; 52 | else if (num < min) then 53 | num := min; 54 | 55 | return num; 56 | end 57 | 58 | 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /sfall/Modules/Scripting/Handlers/Utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2016 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace sfall 22 | { 23 | namespace script 24 | { 25 | 26 | class OpcodeContext; 27 | 28 | void op_string_split(OpcodeContext&); 29 | 30 | void op_atoi(OpcodeContext&); 31 | 32 | void op_atof(OpcodeContext&); 33 | 34 | void op_substr(OpcodeContext&); 35 | 36 | void op_strlen(OpcodeContext&); 37 | 38 | void mf_string_compare(OpcodeContext&); 39 | 40 | void op_sprintf(OpcodeContext&); 41 | 42 | void mf_string_format(OpcodeContext&); 43 | 44 | void op_ord(OpcodeContext&); 45 | 46 | void op_message_str_game(OpcodeContext&); 47 | 48 | void mf_add_extra_msg_file(OpcodeContext&); 49 | 50 | void mf_get_string_pointer(OpcodeContext&); 51 | 52 | void mf_get_text_width(OpcodeContext&); 53 | 54 | void mf_string_to_case(OpcodeContext&); 55 | 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /DevUtils/AddrHackScanner/AddrHackScanner/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Управление общими сведениями о сборке осуществляется с помощью 6 | // набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения, 7 | // связанные со сборкой. 8 | [assembly: AssemblyTitle("AddrHackScanner")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("AddrHackScanner")] 13 | [assembly: AssemblyCopyright("Copyright © 2021")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Параметр ComVisible со значением FALSE делает типы в сборке невидимыми 18 | // для COM-компонентов. Если требуется обратиться к типу в этой сборке через 19 | // COM, задайте атрибуту ComVisible значение TRUE для этого типа. 20 | [assembly: ComVisible(false)] 21 | 22 | // Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM 23 | [assembly: Guid("4516c2dc-8262-4622-86f1-29f29f9a2fe2")] 24 | 25 | // Сведения о версии сборки состоят из следующих четырех значений: 26 | // 27 | // Основной номер версии 28 | // Дополнительный номер версии 29 | // Номер построения 30 | // Редакция 31 | // 32 | // Можно задать все значения или принять номер построения и номер редакции по умолчанию, 33 | // используя "*", как показано ниже: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /artifacts/config_files/CriticalOverrides.ini: -------------------------------------------------------------------------------- 1 | ;This is the new critical hit table override format 2 | ;It's faster loading than the old one, and is compatible with the extra kill types option 3 | ;Note that the player's critter number is now 38 rather than 19 4 | 5 | ;Enable overriding the critical hit tables 6 | ;For details on the tables and their values, see: 7 | ; http://falloutmods.wikia.com/wiki/Critical_hit_tables 8 | 9 | [c_00] ; The entries for the 'men' critter type 10 | Enabled=1 ; Tell sfall that we want to modify this table. If we had set 'Enabled=2' then sfall will assume you want to modify all parts, and will not check the Part_X entries 11 | Part_0=1 ; Tell sfall that we want to modify the head entries 12 | 13 | [c_00_0] ; The entries for the head table of the men critter type. 14 | e0_DamageMultiplier=100 ;First level critical 15 | e0_EffectFlags=0 ; The values of the flags (see DAM_* in Define.h), are allowed to use hexadecimal values, as well several values of flags separated by commas (i.e. 2, 4, 0x40) 16 | e0_StatCheck=0 17 | e0_StatMod=0 18 | e0_FailureEffect=0 19 | e0_Message=0 ; This is an index into the msg file, not a string 20 | e0_FailMessage=0 21 | ;e1_... ; Second level critical 22 | ;... ; And so on up to the hardest hitting level 5 critical 23 | ;e5_... 24 | 25 | ;You can skip any entries from this section to leave them at their defaults 26 | ;Any missing entries for critters 19-37 will be replaced by a 0, since they have no default 27 | ;Note that the UOP fixes are included in the defaults, and do not need to be 28 | ; added manually when using this override format, as opposed to the old one -------------------------------------------------------------------------------- /sfall/Modules/CritterStats.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2019 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | enum OffsetStat : long { 27 | base = 9, // offset from base_stat_srength 28 | bonus = 44 // offset from bonus_stat_srength 29 | }; 30 | 31 | class CritterStats : public Module { 32 | public: 33 | const char* name() { return "CritterStats"; } 34 | void init(); 35 | 36 | static long* __fastcall GetProto(fo::GameObject* critter); 37 | static void RecalcDerivedHook(); 38 | 39 | static long GetStat(fo::GameObject* critter, long stat, long offset); 40 | static void SetStat(fo::GameObject* critter, long stat, long amount, long offset); 41 | static long SetProtoData(long pid, long offset, long amount); 42 | 43 | static void SaveStatData(HANDLE file); 44 | static bool LoadStatData(HANDLE file); 45 | }; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /sfall/Modules/Scripting/Handlers/Graphics.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2016 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace sfall 22 | { 23 | namespace script 24 | { 25 | 26 | // graphics_functions 27 | void __declspec() op_graphics_funcs_available(); 28 | 29 | void __declspec() op_load_shader(); 30 | 31 | void __declspec() op_free_shader(); 32 | 33 | void __declspec() op_activate_shader(); 34 | 35 | void __declspec() op_deactivate_shader(); 36 | 37 | void __declspec() op_get_shader_texture(); 38 | 39 | void __declspec() op_set_shader_int(); 40 | 41 | void __declspec() op_set_shader_texture(); 42 | 43 | void __declspec() op_set_shader_float(); 44 | 45 | void __declspec() op_set_shader_vector(); 46 | 47 | void __declspec() op_get_shader_version(); 48 | 49 | void __declspec() op_set_shader_mode(); 50 | 51 | void __declspec() op_force_graphics_refresh(); 52 | 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /sfall/HLSL/A8PixelShader.hlsl: -------------------------------------------------------------------------------- 1 | 2 | texture image; 3 | texture palette; 4 | texture head; 5 | texture highlight; 6 | sampler s0 = sampler_state { texture=; }; 7 | sampler s1 = sampler_state { texture=; minFilter=none; magFilter=none; addressU=clamp; addressV=clamp; }; 8 | sampler s2 = sampler_state { texture=; minFilter=linear; magFilter=linear; addressU=clamp; addressV=clamp; }; 9 | sampler s3 = sampler_state { texture=; minFilter=linear; magFilter=linear; addressU=clamp; addressV=clamp; }; 10 | float2 size; 11 | float2 corner; 12 | float2 sizehl; 13 | float2 cornerhl; 14 | int showhl; 15 | 16 | // shader for displaying head textures 17 | float4 P1( in float2 Tex : TEXCOORD0 ) : COLOR0 18 | { 19 | float backdrop = tex2D(s0, Tex).a; 20 | float3 result; 21 | 22 | if (abs(backdrop - 1.0) < 0.001) { // (48.0 / 255.0) // 48 - key index color 23 | result = tex2D(s2, saturate((Tex - corner) / size)); 24 | } else { 25 | result = tex1D(s1, backdrop).bgr * 4; // get color in palette 26 | } 27 | // blend highlights 28 | if (showhl) { 29 | float4 h = tex2D(s3, saturate((Tex - cornerhl) / sizehl)); 30 | result = saturate(result + h); // saturate(result * (1 - h.a) * h.rgb * h.a) 31 | } 32 | return float4(result, 1); 33 | } 34 | 35 | technique T1 36 | { 37 | pass p1 { PixelShader = compile ps_2_0 P1(); } 38 | } 39 | 40 | // main shader 41 | float4 P0( in float2 Tex : TEXCOORD0 ) : COLOR0 42 | { 43 | float3 result = tex1D(s1, tex2D(s0, Tex).a); // get color in palette 44 | return float4(result.bgr * 4, 1); 45 | } 46 | 47 | technique T0 48 | { 49 | pass p0 { PixelShader = compile ps_2_0 P0(); } 50 | } 51 | -------------------------------------------------------------------------------- /sfall/Game/items.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | namespace game 10 | { 11 | 12 | class Items 13 | { 14 | public: 15 | static void init(); 16 | 17 | static long GetHealingPID(long index); 18 | static void SetHealingPID(long index, long pid); 19 | 20 | static bool __fastcall IsHealingItem(fo::GameObject* item); 21 | 22 | // True - use failed 23 | static bool UseDrugItemFunc(fo::GameObject* source, fo::GameObject* item); 24 | 25 | // Implementation of item_d_take_ engine function with the HOOK_USEOBJON hook 26 | static long item_d_take_drug(fo::GameObject* source, fo::GameObject* item); 27 | 28 | static long item_remove_mult(fo::GameObject* source, fo::GameObject* item, long count, long rmType); 29 | 30 | static long item_count(fo::GameObject* who, fo::GameObject* item); 31 | 32 | //static long item_weapon_range(fo::GameObject* source, long hitMode); 33 | 34 | static long item_weapon_range(fo::GameObject* source, fo::GameObject* weapon, long hitMode); 35 | 36 | // Implementing the item_w_primary_mp_cost and item_w_secondary_mp_cost engine functions in single function with the HOOK_CALCAPCOST hook 37 | // Note: Use only for weapons 38 | static long __fastcall item_weapon_mp_cost(fo::GameObject* source, fo::GameObject* weapon, long hitMode, long isCalled); 39 | 40 | // Implementation of item_w_mp_cost_ engine function with the HOOK_CALCAPCOST hook 41 | // Note: Can use the generic item_mp_cost_ function which has a hook call 42 | static long __fastcall item_w_mp_cost(fo::GameObject* source, fo::AttackType hitMode, long isCalled); 43 | 44 | }; 45 | 46 | } -------------------------------------------------------------------------------- /artifacts/config_files/Drugs.ini: -------------------------------------------------------------------------------- 1 | ; Allows you to configure advanced settings for drugs. 2 | ; Maximum 50 drugs are allowed 3 | ; Note: for vanilla drugs, you can only override the values of NumEffect and AddictTime parameters 4 | 5 | [main] 6 | ; set to 1 to change Jet addiction to be removed after the time expires 7 | JetWithdrawal=0 8 | 9 | ; total number of drugs in this file 10 | Count=0 11 | 12 | ; count starts from 1 13 | [1] 14 | ; drug item PID 15 | PID=0 16 | 17 | ; set a limit on the count of first and second delayed effects when using the drug, i.e. if the queue has delayed effects from the drug, 18 | ; and their count is greater or equal to NumEffects, it is not possible to obtain new effects from using the drug 19 | ; e.g. this count is 4 for Buffout/Mentats/Psycho/Jet 20 | ; set -1 to leave this parameter unchanged 21 | NumEffects=-1 22 | 23 | ; the duration of the addiction effect in game minutes (i.e. 1440 = 24 game hours) 24 | ; set to 0 to use the default time 7 days (as all drugs, except Jet) 25 | AddictTime=0 26 | 27 | ; the number of the global variable from vault13.gam responsible for displaying addiction in the character screen 28 | ; if you set engine global variables with numbers: 21-26, 295, 296, or variable numbers that have already been declared in other above sections, 29 | ; the TextID and FrmID options this section will be ignored 30 | ; set to 0 if the addiction is not required 31 | GvarID=0 32 | 33 | ; the index number from editor.msg to display the title of the addiction (the description uses the index number of TextID + 100) 34 | TextID=-1 35 | 36 | ; the line number (0-indexed) of the corresponding FRM in skilldex.lst 37 | FrmID=-1 38 | -------------------------------------------------------------------------------- /artifacts/example_mods/Traits/readme.txt: -------------------------------------------------------------------------------- 1 | Improved character development mod for fallout 2 by Timeslip 2 | v1.4 3 | ---------------------------------------- 4 | 5 | To use, simply extract the contents of this archive to your fallout 2 directory. If you are using a version of this mod from before 1.3, or have not used this mod before, you will need to start a new game. If you are already using 1.3 or newer, updating will not effect you save games. 6 | 7 | There are currently a total of 6 traits and 5 perks available. You can only pick one extra trait per character, which must be chosen from the character screen at any time before advancing to level 2. Perks will become available at specific levels just like the normal ones. 8 | 9 | This mod should be compatible with any other mods, as long as they don't use conflicting sfall functions. 10 | 11 | ---------------------------------------- 12 | 13 | v1.4 (1/9/08) 14 | Pyromaniac now increases fire damage by 10 15 | Heave ho will now increase thrown weapon range beyond their usual maximums 16 | Swift learner xp bonus increased to 20% 17 | Snake eater and rad resist perks changed to give +40% resistance each. 18 | New perk: Teacher 19 | Added stat requirements for the new perks 20 | 21 | v1.3 (30/8/08) 22 | Converted to use the new functions in 1.33, resulting in a few fixed bugs and less script hackery. 23 | Removed some of the more pointless traits. Readded a couple as perks, and added a couple of completely new perks. 24 | 25 | v1.2 (30/6/08) 26 | Fixes and balance tweaks 27 | 28 | v1.1 (17/5/08) 29 | Added new traits rapid learner and diligent learner 30 | 31 | v1.0 (09/02/08) 32 | First release. Included 8 additional traits. -------------------------------------------------------------------------------- /artifacts/scripting/README.md: -------------------------------------------------------------------------------- 1 | This folder contains documentation about sfall scripting extensions. 2 | 3 | headers\ - folder contains sfall headers that you should #include in your scripts 4 | sfall.h - main sfall header, always include it 5 | define_extra.h - some additional preprocessor constants for vanilla engine stuff (proto offsets, etc.) 6 | define_lite.h - a lite version of official define.h 7 | command_lite.h - a lite version of official command.h 8 | dik.h - DX scancodes constants for use with key_pressed function and HOOK_KEYPRESS 9 | lib.arrays.h - procedures that will help you use arrays in their full: 10 | - use them as stacks, sets 11 | - easily compare, copy, slice, cut, add arrays 12 | - display array contents (for debugging) 13 | - save/load two-dimensional arrays to savegame in one command (e.g. arrays of objects) 14 | lib.inven.h - fallout items manipulation functions 15 | lib.math.h - a few simple functions for calculations 16 | lib.strings.h - search in strings, join, repeat, etc. 17 | lib.misc.h - misc stuff 18 | 19 | sfall function notes.md - incomplete reference for new opcodes 20 | sfall opcode list.md - list of all sfall opcodes (w/o descriptions) 21 | HookScripts.md - detailed manual for using hook scripts to modify engine behavior 22 | Arrays.md - manual for sfall arrays 23 | 24 | If you are/will be using sfall Script Editor, don't forget to check out new compiler documentation in **.\compiler\sslc_readme.txt**, 25 | there are numerious new syntax features and extensions to SSL (Star-Trek Scripting language). 26 | 27 | -------------------------------------------------------------------------------- /sfall/Modules/PartyControl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2016 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | #pragma once 19 | 20 | #include "Module.h" 21 | 22 | namespace sfall 23 | { 24 | 25 | class PartyControl : public Module { 26 | public: 27 | const char* name() { return "PartyControl"; } 28 | void init(); 29 | void exit() override; 30 | 31 | static int __fastcall SwitchHandHook(fo::GameObject* item); 32 | 33 | static bool IsNpcControlled(); 34 | 35 | // Take control of given NPC or switch back to "Real" dude if nullptr is passed 36 | static void SwitchToCritter(fo::GameObject* critter); 37 | 38 | // Returns pointer to "real" dude, which is different from "dude_obj" when controlling another critter 39 | static fo::GameObject* RealDudeObject(); 40 | 41 | static void OrderAttackPatch(); 42 | static void __fastcall SetOrderTarget(fo::GameObject* attacker); 43 | }; 44 | 45 | extern bool npcAutoLevelEnabled; 46 | extern bool npcEngineLevelUp; 47 | 48 | } 49 | -------------------------------------------------------------------------------- /sfall/Modules/Scripting/Handlers/Anims.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2016 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "..\OpcodeContext.h" 22 | 23 | namespace sfall 24 | { 25 | namespace script 26 | { 27 | 28 | // new reg_anim functions (all using existing engine code) 29 | 30 | void RegAnimCombatCheck(DWORD newValue); 31 | 32 | class OpcodeContext; 33 | 34 | void op_reg_anim_combat_check(OpcodeContext&); 35 | void op_reg_anim_destroy(OpcodeContext&); 36 | void op_reg_anim_animate_and_hide(OpcodeContext&); 37 | void op_reg_anim_light(OpcodeContext&); 38 | void op_reg_anim_change_fid(OpcodeContext&); 39 | void op_reg_anim_take_out(OpcodeContext&); 40 | void op_reg_anim_turn_towards(OpcodeContext&); 41 | void op_reg_anim_callback(OpcodeContext&); 42 | 43 | void op_explosions_metarule(OpcodeContext&); 44 | 45 | void op_art_exists(OpcodeContext&); 46 | 47 | void mf_art_cache_flush(OpcodeContext&); 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /ThirdPartyTools/SND2ACM_FIX/SND2ACM_FIX/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // Управление общими сведениями о сборке осуществляется с помощью 6 | // набора атрибутов. Измените значения этих атрибутов, чтобы изменить сведения, 7 | // связанные со сборкой. 8 | [assembly: AssemblyTitle("Wrapper for fixes the sampling rate and channels of the ACM file after converting.")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Wrapper SND2ACM.EXE")] 13 | [assembly: AssemblyCopyright("Copyright © 2021")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Параметр ComVisible со значением FALSE делает типы в сборке невидимыми 18 | // для COM-компонентов. Если требуется обратиться к типу в этой сборке через 19 | // COM, задайте атрибуту ComVisible значение TRUE для этого типа. 20 | [assembly: ComVisible(false)] 21 | 22 | // Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM 23 | [assembly: Guid("e9920350-3cf6-4a83-8116-4765f2972277")] 24 | 25 | // Сведения о версии сборки состоят из следующих четырех значений: 26 | // 27 | // Основной номер версии 28 | // Дополнительный номер версии 29 | // Номер построения 30 | // Редакция 31 | // 32 | // Можно задать все значения или принять номер построения и номер редакции по умолчанию, 33 | // используя "*", как показано ниже: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /sfall/Modules/HookScripts/Common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "..\HookScripts.h" 4 | #include "..\ScriptExtender.h" 5 | 6 | // Common variables and functions for hook script implementations 7 | 8 | namespace sfall 9 | { 10 | 11 | class HookCommon { 12 | public: 13 | static DWORD GetHSArgCount(); 14 | static DWORD GetHSArg(); 15 | static DWORD GetHSArgAt(long id); 16 | static DWORD* GetHSArgs(); 17 | static void SetHSArg(DWORD id, DWORD value); 18 | static void __stdcall SetHSReturn(DWORD d); 19 | 20 | static void GameModeChangeHook(DWORD exit); 21 | static void KeyPressHook(DWORD* dxKey, bool pressed, DWORD vKey); 22 | static void __stdcall MouseClickHook(DWORD button, bool pressed); 23 | 24 | static void Reset(); 25 | }; 26 | 27 | // Struct for registered hook script 28 | struct HookScript { 29 | ScriptProgram prog; 30 | int callback; // procedure position in script's proc table 31 | char isGlobalScript; // 0 for hs_* scripts, 1/2 type for gl* scripts 32 | }; 33 | 34 | // All currently registered hook scripts 35 | extern std::vector hooks[]; 36 | 37 | extern DWORD args[]; // current hook arguments 38 | extern DWORD rets[]; // current hook return values 39 | 40 | extern DWORD argCount; 41 | extern DWORD cArg; // how many arguments were taken by current hook script 42 | extern DWORD cRet; // how many return values were set by current hook script 43 | extern DWORD cRetTmp; // how many return values were set by specific hook script (when using register_hook) 44 | 45 | void __stdcall BeginHook(); 46 | void __stdcall RunHookScript(DWORD hook); 47 | void __stdcall EndHook(); 48 | 49 | #define HookBegin pushadc __asm call BeginHook popadc 50 | #define HookEnd pushadc __asm call EndHook popadc 51 | 52 | } 53 | -------------------------------------------------------------------------------- /sfall/Logging.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008, 2009, 2010 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #define DL_MAIN (0) 20 | #define DL_INIT (0x1) 21 | #define DL_HOOK (0x2) 22 | #define DL_SCRIPT (0x4) 23 | #define DL_CRITICALS (0x8) 24 | #define DL_FIX (0x10) 25 | 26 | #ifndef NO_SFALL_DEBUG 27 | #include 28 | #include 29 | 30 | namespace sfall 31 | { 32 | 33 | void dlog(const char*, int type); 34 | void dlog(const std::string&, int type); 35 | void dlogr(const char*, int type); 36 | void dlogr(const std::string&, int type); 37 | void dlog_f(const char* fmt, int type, ...); 38 | void dlogh(const char* fmt, long, long, long); 39 | 40 | #ifndef NDEBUG 41 | // Prints debug message to sfall log file for develop build 42 | void devlog_f(const char* fmt, int type, ...); 43 | #else 44 | void devlog_f(...); 45 | #endif 46 | 47 | void LoggingInit(); 48 | 49 | } 50 | #else 51 | #define dlog(a,b) 52 | #define dlogr(a,b) 53 | #define dlog_f(a, b, ...) 54 | #define dlogh(a, b, c, d) 55 | #endif 56 | -------------------------------------------------------------------------------- /artifacts/example_mods/Sneak/hs_sneak.ssl: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | Name: hs_sneak 3 | Description: Example engine working sneak algorithm. 4 | 5 | *******************************************************************************/ 6 | 7 | /* Include Files */ 8 | #include "define.h" 9 | #include "command.h" 10 | 11 | /* Defines */ 12 | 13 | /* Script Procedures */ 14 | procedure start; 15 | 16 | procedure start begin 17 | variable sneakIsSuccess, time, level; 18 | 19 | if not(init_hook) then begin 20 | level := critter_skill_level(dude_obj, SKILL_SNEAK); 21 | if (roll_vs_skill(dude_obj, SKILL_SNEAK, 0) < ROLL_SUCCESS) then begin 22 | sneakIsSuccess := false; 23 | time := ONE_GAME_MINUTE; 24 | if (level <= 250) then 25 | if (level <= 200) then 26 | if (level <= 170) then 27 | if (level <= 135) then 28 | if (level <= 100) then 29 | if (level > 80) then 30 | time := 400; // 40 sec 31 | else 32 | time := 300; // 30 sec 33 | else 34 | time := 200; // 20 sec 35 | else 36 | time := 150; // 15 sec 37 | else 38 | time := 120; // 12 sec 39 | else 40 | time := 100; // 10 sec for skill level > 250 41 | end 42 | else begin 43 | sneakIsSuccess := true; 44 | time := ONE_GAME_MINUTE; 45 | end 46 | set_sfall_return(sneakIsSuccess); 47 | set_sfall_return(time); 48 | end 49 | end 50 | -------------------------------------------------------------------------------- /sfall/Modules/Drugs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2019 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class Drugs : public Module { 27 | public: 28 | const char* name() { return "Drugs"; } 29 | void init(); 30 | void exit() override; 31 | 32 | static long addictionGvarCount; 33 | static bool JetWithdrawal; 34 | 35 | static long GetDrugCount(); 36 | static long GetDrugPid(long n); 37 | static long GetDrugGvar(long n); 38 | 39 | static long SetDrugNumEffect(long pid, long effect); 40 | static long SetDrugAddictTimeOff(long pid, long time); 41 | }; 42 | 43 | #define SIZE_S_DRUGS (32 + 1) 44 | 45 | #pragma pack(push, 1) 46 | struct sDrugs { 47 | DWORD drugPid; // don't move 48 | long gvarID; // don't move 49 | long numEffects; // don't move 50 | long addictTimeOff; 51 | long msgID; 52 | long frmID; 53 | long iniNumEffects; 54 | long iniAddictTimeOff; 55 | 56 | char skip; 57 | }; 58 | #pragma pack(pop) 59 | 60 | extern sDrugs *drugs; 61 | 62 | } 63 | -------------------------------------------------------------------------------- /sfall/Modules/Scripting/Handlers/FileSystem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2016 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | //file system functions 22 | 23 | namespace sfall 24 | { 25 | namespace script 26 | { 27 | 28 | class OpcodeContext; 29 | 30 | void op_fs_create(OpcodeContext&); 31 | 32 | void op_fs_copy(OpcodeContext&); 33 | 34 | void op_fs_find(OpcodeContext&); 35 | 36 | void op_fs_write_byte(OpcodeContext&); 37 | 38 | void op_fs_write_short(OpcodeContext&); 39 | 40 | void op_fs_write_int(OpcodeContext&); 41 | 42 | void op_fs_write_string(OpcodeContext&); 43 | 44 | void op_fs_write_bstring(OpcodeContext&); 45 | 46 | void op_fs_read_byte(OpcodeContext&); 47 | 48 | void op_fs_read_short(OpcodeContext&); 49 | 50 | void op_fs_read_int(OpcodeContext&); 51 | 52 | void op_fs_read_float(OpcodeContext&); 53 | 54 | void op_fs_delete(OpcodeContext&); 55 | 56 | void op_fs_size(OpcodeContext&); 57 | 58 | void op_fs_pos(OpcodeContext&); 59 | 60 | void op_fs_seek(OpcodeContext&); 61 | 62 | void op_fs_resize(OpcodeContext&); 63 | 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /artifacts/config_files/NpcArmorRP.ini: -------------------------------------------------------------------------------- 1 | ;WeaponAnims codes 2 | ; 1 - Knife (D) 3 | ; 2 - Club (E) 4 | ; 3 - Sledgehammer (F) 5 | ; 4 - Spear (G) 6 | ; 5 - Pistol (H) 7 | ; 6 - SMG (I) 8 | ; 7 - Rifle (J) 9 | ; 8 - Big Gun (K) 10 | ; 9 - Minigun (L) 11 | ; 10- Rocket Launcher (M) 12 | ; 11-15 - sfall additional weapon animation codes 13 | 14 | ; This section maps 7 armor types to corresponding armor item PIDs 15 | [ArmorTypes] 16 | Jacket = 74,265 17 | Leather = 1,379 18 | Metal = 2,240,380 19 | Power = 3,232 20 | AdvPower = 348,349 21 | Combat = 17,239,381 22 | Robe = 113,524 23 | 24 | ; Default armor FIDs (the same for all NPCs) 25 | [Default] 26 | Power=16777217 27 | AdvPower=16777287 28 | Robe=16777218 29 | 30 | 31 | ; Sulik 32 | [1] 33 | PID=16777313 34 | WeaponAnims=1,3,4,6,14 35 | Default=16777280 36 | Leather=16777325 37 | Power=16777324 38 | Metal=16777323 39 | Jacket=16777321 40 | Combat=16777322 41 | 42 | ; Vic 43 | [2] 44 | PID=16777278 45 | WeaponAnims=1,5,7,13,14 46 | Default=16777307 47 | Jacket=16777329 48 | Combat=16777330 49 | Metal=16777331 50 | Power=16777332 51 | Leather=16777333 52 | 53 | ; Cassidy 54 | [3] 55 | PID=16777305 56 | WeaponAnims=4,5,7,13 57 | Default=16777354 58 | Leather=16777260 59 | Power=16777328 60 | Metal=16777327 61 | Jacket=16777351 62 | Combat=16777326 63 | 64 | ; Myron 65 | [4] 66 | PID=16777376 67 | WeaponAnims=1,5,14 68 | Default=16777304 69 | Power=16777349 70 | Combat=16777350 71 | 72 | ; Cat Jules (RP) 73 | [5] 74 | PID=16777720 75 | WeaponAnims=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 76 | Default=16777353 77 | Leather=16777347 78 | Metal=16777348 79 | Jacket=16777346 80 | Combat=16777226 81 | 82 | ; Kitsune (RP) 83 | [6] 84 | PID=16777718 85 | WeaponAnims=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 86 | Default=16777222 87 | Leather=16777221 88 | Metal=16777223 89 | Jacket=16777222 90 | Combat=16777219 91 | -------------------------------------------------------------------------------- /artifacts/config_files/npcarmor.ini: -------------------------------------------------------------------------------- 1 | ;Configuration NPC armor appearance for classic version of Fallout 2 2 | 3 | ;WeaponAnims codes 4 | ; 1 - Knife (D) 5 | ; 2 - Club (E) 6 | ; 3 - Sledgehammer (F) 7 | ; 4 - Spear (G) 8 | ; 5 - Pistol (H) 9 | ; 6 - SMG (I) 10 | ; 7 - Rifle (J) 11 | ; 8 - Big Gun (K) 12 | ; 9 - Minigun (L) 13 | ; 10- Rocket Launcher (M) 14 | ; 11-15 - sfall additional weapon animation codes 15 | 16 | [Options] 17 | ;Set to 1, to ignore FID settings armor appearance parameters and use the values determined by the armor item 18 | ;In this mode, you can still use the option WeaponAnims of the party members to allow them to use certain weapons 19 | SimpleMode=0 20 | 21 | ; This section maps 7 armor types to corresponding armor item PIDs 22 | [ArmorTypes] 23 | Jacket = 74,265 24 | Leather = 1,379 25 | Metal = 2,240,380 26 | Power = 3,232 27 | AdvPower = 348,349 28 | Combat = 17,239,381 29 | Robe = 113,524 30 | 31 | ; Default armor FIDs (the same for all NPCs) 32 | [Default] 33 | Jacket = 16777229 34 | Leather = 16777228 35 | Metal = 16777230 36 | Combat = 16777226 37 | Power = 16777217 38 | AdvPower = 16777287 39 | Robe = 16777218 40 | 41 | ; Sulik 42 | [1] 43 | PID=16777313 44 | WeaponAnims=1,3,4,6 45 | Default=16777280 46 | 47 | ; Vic 48 | [2] 49 | PID=16777278 50 | WeaponAnims=1,5,7 51 | Default=16777307 52 | 53 | ; Cassidy 54 | [3] 55 | PID=16777305 56 | WeaponAnims=4,5,7 57 | Default=16777260 58 | Leather=16777260 59 | 60 | ; Myron 61 | [4] 62 | PID=16777376 63 | WeaponAnims=1,5 64 | Default=16777304 65 | 66 | ; Lenny 67 | [5] 68 | PID=16777323 69 | WeaponAnims=1,5 70 | Default=16777295 71 | 72 | ; Davin 73 | [6] 74 | PID=16777379 75 | WeaponAnims=1,2,5 76 | Default=16777264 77 | 78 | ; Miria 79 | [7] 80 | PID=16777380 81 | WeaponAnims=1,6 82 | Default=16777252 83 | Jacket=16777222 84 | Leather=16777221 85 | Metal=16777223 86 | Combat=16777219 -------------------------------------------------------------------------------- /sfall/FalloutEngine/AsmMacros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2020 The sfall team 4 | * 5 | */ 6 | 7 | #pragma once 8 | 9 | /* 10 | MACROS for operators assembly code 11 | 12 | Notes: 13 | - DO NOT add any comments within macros 14 | - every macro should contain __asm {} block 15 | - every assembly line should start with __asm and should NOT have semicolon in the end! 16 | - use this macros outside of other __asm {} blocks (obviously) 17 | */ 18 | 19 | /* 20 | Gets argument from stack to eax and puts its type to edx register 21 | eax register must contain the script_ptr 22 | jlabel - name of the jump label in case the value type is not INT 23 | return: eax - arg value 24 | */ 25 | #define _GET_ARG_INT(jlabel) __asm { \ 26 | __asm mov edx, eax \ 27 | __asm call fo::funcoffs::interpretPopShort_ \ 28 | __asm xchg eax, edx \ 29 | __asm call fo::funcoffs::interpretPopLong_ \ 30 | __asm cmp dx, VAR_TYPE_INT \ 31 | __asm jnz jlabel \ 32 | } 33 | 34 | #define _GET_ARG(outVal, outType) __asm { \ 35 | __asm call fo::funcoffs::interpretPopShort_ \ 36 | __asm mov outType, eax \ 37 | __asm mov eax, ebx \ 38 | __asm call fo::funcoffs::interpretPopLong_ \ 39 | __asm mov outVal, eax \ 40 | } 41 | 42 | /* 43 | Returns the value to the script 44 | eax and ebx register must contain the script_ptr 45 | edx register must contain the returned value 46 | */ 47 | #define _RET_VAL_INT __asm { \ 48 | __asm call fo::funcoffs::interpretPushLong_ \ 49 | __asm mov edx, VAR_TYPE_INT \ 50 | __asm mov eax, ebx \ 51 | __asm call fo::funcoffs::interpretPushShort_ \ 52 | } 53 | 54 | #define _J_RET_VAL_TYPE(type) __asm { \ 55 | __asm call fo::funcoffs::interpretPushLong_ \ 56 | __asm mov edx, type \ 57 | __asm mov eax, ebx \ 58 | __asm jmp fo::funcoffs::interpretPushShort_ \ 59 | } 60 | -------------------------------------------------------------------------------- /sfall/Modules/Scripting/Handlers/Arrays.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2016 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace sfall 22 | { 23 | namespace script 24 | { 25 | 26 | void op_create_array(OpcodeContext&); 27 | 28 | void op_set_array(OpcodeContext&); 29 | 30 | /* 31 | used in place of [] operator when compiling in sslc 32 | so it works as get_array if first argument is int and as substr(x, y, 1) if first argument is string 33 | */ 34 | void op_get_array(OpcodeContext&); 35 | 36 | void op_free_array(OpcodeContext&); 37 | 38 | void op_len_array(OpcodeContext&); 39 | 40 | void op_resize_array(OpcodeContext&); 41 | 42 | void op_temp_array(OpcodeContext&); 43 | 44 | void op_fix_array(OpcodeContext&); 45 | 46 | void op_scan_array(OpcodeContext&); 47 | 48 | void op_save_array(OpcodeContext&); 49 | 50 | void op_load_array(OpcodeContext&); 51 | 52 | void op_get_array_key(OpcodeContext&); 53 | 54 | void op_stack_array(OpcodeContext&); 55 | 56 | void op_list_begin(OpcodeContext&); 57 | 58 | void op_list_as_array(OpcodeContext&); 59 | 60 | void op_list_next(OpcodeContext&); 61 | 62 | void op_list_end(OpcodeContext&); 63 | 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /sfall/Modules/Scripting/Handlers/Worldmap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2016 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace sfall 22 | { 23 | namespace script 24 | { 25 | 26 | class OpcodeContext; 27 | 28 | void op_force_encounter(OpcodeContext&); 29 | 30 | DWORD ForceEncounterRestore(); 31 | 32 | // world_map_functions 33 | void __declspec() op_in_world_map(); 34 | 35 | void __declspec() op_get_game_mode(); 36 | 37 | void __declspec() op_get_world_map_x_pos(); 38 | 39 | void __declspec() op_get_world_map_y_pos(); 40 | 41 | void __declspec() op_set_world_map_pos(); 42 | 43 | void op_set_map_time_multi(OpcodeContext&); 44 | 45 | void mf_set_car_intface_art(OpcodeContext&); 46 | 47 | void mf_set_map_enter_position(OpcodeContext&); 48 | 49 | void mf_get_map_enter_position(OpcodeContext&); 50 | 51 | void mf_set_rest_heal_time(OpcodeContext&); 52 | 53 | void mf_set_rest_mode(OpcodeContext&); 54 | 55 | void mf_set_rest_on_map(OpcodeContext&); 56 | 57 | void mf_get_rest_on_map(OpcodeContext&); 58 | 59 | void mf_tile_by_position(OpcodeContext&); 60 | 61 | void mf_set_terrain_name(OpcodeContext&); 62 | 63 | void mf_set_town_title(OpcodeContext&); 64 | 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /sfall/exports.def: -------------------------------------------------------------------------------- 1 | LIBRARY ddraw 2 | EXPORTS 3 | 4 | AcquireDDThreadLock = FakeAcquireDDThreadLock @1 5 | CheckFullscreen = FakeCheckFullscreen @2 6 | CompleteCreateSysmemSurface = FakeCompleteCreateSysmemSurface @3 7 | D3DParseUnknownCommand = FakeD3DParseUnknownCommand @4 8 | DDGetAttachedSurfaceLcl = FakeDDGetAttachedSurfaceLcl @5 9 | DDInternalLock = FakeDDInternalLock @6 10 | DDInternalUnlock = FakeDDInternalUnlock @7 11 | DSoundHelp = FakeDSoundHelp @8 12 | DirectDrawCreate = FakeDirectDrawCreate @9 13 | DirectDrawCreateClipper = FakeDirectDrawCreateClipper @10 14 | DirectDrawCreateEx = FakeDirectDrawCreateEx @11 15 | DirectDrawEnumerateA = FakeDirectDrawEnumerateA @12 16 | DirectDrawEnumerateExA = FakeDirectDrawEnumerateExA @13 17 | DirectDrawEnumerateExW = FakeDirectDrawEnumerateExW @14 18 | DirectDrawEnumerateW = FakeDirectDrawEnumerateW @15 19 | DllCanUnloadNow = FakeDllCanUnloadNow PRIVATE 20 | DllGetClassObject = FakeDllGetClassObject PRIVATE 21 | GetDDSurfaceLocal = FakeGetDDSurfaceLocal @18 22 | GetOLEThunkData = FakeGetOLEThunkData @19 23 | GetSurfaceFromDC = FakeGetSurfaceFromDC @20 24 | RegisterSpecialCase = FakeRegisterSpecialCase @21 25 | ReleaseDDThreadLock = FakeReleaseDDThreadLock @22 26 | SetAppCompatData = FakeSetAppCompatData @23 27 | 28 | ; sfall override 29 | DirectDrawCreat2 = FakeDirectDrawCreate2 @24 30 | DirectInputCreateA = FakeDirectInputCreate @25 31 | 32 | ; for crash monitor 33 | SaveScreenA @30 34 | -------------------------------------------------------------------------------- /sfall/HRP/MiscInterface.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008 - 2021 Timeslip and sfall team 4 | * 5 | */ 6 | 7 | #include "..\FalloutEngine\Fallout2.h" 8 | #include "..\main.h" 9 | #include "..\Modules\LoadGameHook.h" 10 | 11 | #include "MiscInterface.h" 12 | 13 | namespace HRP 14 | { 15 | 16 | static long xPosition; 17 | static long yPosition; 18 | 19 | static long __fastcall CommonWinAdd(long height, long width, long color, long flags) { 20 | xPosition = (Setting::ScreenWidth() - width) / 2; 21 | yPosition = (Setting::ScreenHeight() - height) / 2; 22 | 23 | if (sfall::IsGameLoaded()) { 24 | yPosition -= 50; 25 | if (yPosition < 0) yPosition = 0; 26 | } 27 | return fo::func::win_add(xPosition, yPosition, width, height, color, flags); 28 | } 29 | 30 | static void __declspec(naked) CommonWinAddHook() { 31 | __asm { 32 | mov edx, ebx; // width 33 | jmp CommonWinAdd; 34 | } 35 | } 36 | 37 | static void __declspec(naked) MouseGetPositionHook() { 38 | __asm { 39 | push eax; // outX ref 40 | push edx; // outY ref 41 | call fo::funcoffs::mouse_get_position_; 42 | pop edx; 43 | mov eax, yPosition; 44 | sub [edx], eax; 45 | pop edx; 46 | mov eax, xPosition; 47 | sub [edx], eax; 48 | retn; 49 | } 50 | } 51 | 52 | void MiscInterface::init() { 53 | sfall::HookCalls(CommonWinAddHook, { 54 | 0x497405, // StartPipboy_ 55 | 0x41B979, // automap_ 56 | 0x42626B, // get_called_shot_location_ 57 | 0x43F560, // elevator_start_ 58 | 0x490005, // OptnStart_ 59 | 0x490961, // PrefStart_ 60 | }); 61 | 62 | sfall::HookCalls(MouseGetPositionHook, { 63 | 0x490EAC, 0x491546, // DoThing_ 64 | 0x497092, // pipboy_ 65 | 0x49A1B6, // ScreenSaver_ 66 | }); 67 | sfall::BlockCall(0x49A0FB); // ScreenSaver_ 68 | 69 | // PauseWindow_ 70 | sfall::SafeWrite32(0x49042A, Setting::ScreenHeight()); 71 | sfall::SafeWrite32(0x490436, Setting::ScreenWidth()); 72 | // ShadeScreen_ 73 | sfall::SafeWrite32(0x49075F, Setting::ScreenWidth()); 74 | } 75 | 76 | } -------------------------------------------------------------------------------- /sfall/Translate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2021 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace sfall 22 | { 23 | 24 | class Translate { 25 | public: 26 | static void init(const char*); 27 | 28 | // Translates given string using sfall translation INI file and puts the result into given buffer. 29 | static size_t Get(const char* section, const char* setting, const char* defaultValue, char* buffer, size_t bufSize = 128); 30 | 31 | // Translates given string using Sfall translation INI file. 32 | static std::string Get(const char* section, const char* setting, const char* defaultValue, size_t bufSize = 128); 33 | 34 | // Translates given strings list using Sfall translation INI file. 35 | static std::vector GetList(const char* section, const char* setting, const char* defaultValue, char delimiter, size_t bufSize = 256); 36 | 37 | /* Messages */ 38 | 39 | // SaveSfallDataFail: "ERROR saving extended savegame information!" 40 | static std::string& Translate::SfallSaveDataFailure(); 41 | 42 | // SaveInCombat: "Cannot save at this time." 43 | static std::string& Translate::CombatSaveBlockMessage(); 44 | 45 | // BlockedCombat: "You cannot enter combat at this time." 46 | static std::string& Translate::CombatBlockMessage(); 47 | }; 48 | 49 | } 50 | -------------------------------------------------------------------------------- /sfall/Modules/Combat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008, 2009, 2011 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | struct ChanceModifier { 27 | long id; 28 | int maximum; 29 | int mod; 30 | 31 | ChanceModifier() : id(0), maximum(95), mod(0) {} 32 | 33 | ChanceModifier(long _id, int max, int _mod) { 34 | id = _id; 35 | maximum = max; 36 | mod = _mod; 37 | } 38 | 39 | void SetDefault() { 40 | maximum = 95; 41 | mod = 0; 42 | } 43 | }; 44 | 45 | class Combat : public Module { 46 | public: 47 | const char* name() { return "Combat"; } 48 | void init(); 49 | 50 | static long determineHitChance; 51 | 52 | static long __fastcall check_item_ammo_cost(fo::GameObject* weapon, fo::AttackType hitMode); 53 | 54 | static bool IsBurstDisabled(fo::GameObject* critter); 55 | }; 56 | 57 | void __stdcall SetHitChanceMax(fo::GameObject* critter, DWORD maximum, DWORD mod); 58 | void __stdcall KnockbackSetMod(fo::GameObject* object, DWORD type, float val, DWORD mode); 59 | void __stdcall KnockbackRemoveMod(fo::GameObject* object, DWORD mode); 60 | 61 | void __stdcall SetNoBurstMode(fo::GameObject* critter, bool on); 62 | void __stdcall DisableAimedShots(DWORD pid); 63 | void __stdcall ForceAimedShots(DWORD pid); 64 | 65 | } 66 | -------------------------------------------------------------------------------- /sfall/Modules/Worldmap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008-2017 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "..\Delegate.h" 22 | #include "Module.h" 23 | 24 | namespace sfall 25 | { 26 | 27 | class Worldmap : public Module { 28 | public: 29 | const char* name() { return "Worldmap"; } 30 | void init(); 31 | 32 | static Delegate<>& OnWorldmapLoop(); 33 | 34 | static void Worldmap::SaveData(HANDLE); 35 | static bool Worldmap::LoadData(HANDLE); 36 | 37 | static void SetCarInterfaceArt(DWORD artIndex); 38 | static void SetRestHealTime(DWORD minutes); 39 | static void SetRestMode(DWORD mode); 40 | static void SetRestMapLevel(int mapId, long elev, bool canRest); 41 | static long __fastcall GetRestMapLevel(long elev, int mapId); 42 | 43 | static DWORD GetAddedYears(bool isCheck = true); 44 | static void SetAddedYears(DWORD years); 45 | 46 | static void SetTerrainTypeName(long x, long y, const char* name); 47 | //static const char* GetTerrainTypeName(long x, long y); 48 | static const char* GetCurrentTerrainName(); 49 | 50 | static bool AreaTitlesIsEmpty(); 51 | static const char* GetCustomAreaTitle(long areaID); 52 | static void SetCustomAreaTitle(long areaID, const char* msg); 53 | 54 | static long AreaMarkStateIsNoRadius(); 55 | static void SetMapMulti(float value); 56 | }; 57 | 58 | } 59 | -------------------------------------------------------------------------------- /sfall/Modules/FileSystem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sfall 3 | * Copyright (C) 2008, 2009 The sfall team 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Module.h" 22 | 23 | namespace sfall 24 | { 25 | 26 | class FileSystem : public Module { 27 | public: 28 | const char* name() { return "FileSystem"; } 29 | void init(); 30 | 31 | static bool UsingFileSystem; 32 | 33 | // save FileSystem data to a save game file 34 | static void Save(HANDLE h); 35 | static bool IsEmpty(); 36 | }; 37 | 38 | DWORD __stdcall FScreate(const char* path, int size); 39 | DWORD __stdcall FScreateFromData(const char* path, void* data, int size); 40 | DWORD __stdcall FScopy(const char* path, const char* source); 41 | DWORD __stdcall FSfind(const char* path); 42 | void __stdcall FSwrite_byte(DWORD id, int data); 43 | void __stdcall FSwrite_short(DWORD id, int data); 44 | void __stdcall FSwrite_int(DWORD id, int data); 45 | void __stdcall FSwrite_string(DWORD id, const char* data); 46 | void __stdcall FSwrite_bstring(DWORD id, const char* data); 47 | int __stdcall FSread_byte(DWORD id); 48 | int __stdcall FSread_short(DWORD id); 49 | int __stdcall FSread_int(DWORD id); 50 | void __stdcall FSdelete(DWORD id); 51 | DWORD __stdcall FSsize(DWORD id); 52 | DWORD __stdcall FSpos(DWORD id); 53 | void __stdcall FSseek(DWORD id, DWORD pos); 54 | void __stdcall FSresize(DWORD id, DWORD size); 55 | 56 | } 57 | -------------------------------------------------------------------------------- /sfall/Modules/MainLoopHook.cpp: -------------------------------------------------------------------------------- 1 | #include "..\FalloutEngine\Fallout2.h" 2 | #include "..\SafeWrite.h" 3 | 4 | #include "MainLoopHook.h" 5 | 6 | namespace sfall 7 | { 8 | 9 | static Delegate<> onMainLoop; 10 | static Delegate<> onCombatLoop; 11 | static Delegate<> onAfterCombatAttack; 12 | 13 | bool MainLoopHook::displayWinUpdateState = false; 14 | 15 | static void MainGameLoopResetStates() { 16 | MainLoopHook::displayWinUpdateState = false; 17 | } 18 | 19 | static void __stdcall MainGameLoop() { 20 | onMainLoop.invoke(); 21 | MainGameLoopResetStates(); 22 | } 23 | 24 | static void __stdcall CombatLoop() { 25 | onCombatLoop.invoke(); 26 | } 27 | 28 | static void __stdcall AfterCombatAttack() { 29 | onAfterCombatAttack.invoke(); 30 | } 31 | 32 | static void __declspec(naked) MainGameLoopHook() { 33 | __asm { 34 | push ecx; 35 | call fo::funcoffs::get_input_; 36 | push edx; 37 | push eax; 38 | call MainGameLoop; 39 | pop eax; 40 | pop edx; 41 | pop ecx; 42 | retn; 43 | } 44 | } 45 | 46 | static void __declspec(naked) CombatLoopHook() { 47 | __asm { 48 | push ecx; 49 | push edx; 50 | //push eax; 51 | call CombatLoop; 52 | //pop eax; 53 | pop edx; 54 | call fo::funcoffs::get_input_; 55 | pop ecx; // fix to prevent the combat turn from being skipped after using Alt+Tab keys 56 | retn; 57 | } 58 | } 59 | 60 | static void __declspec(naked) AfterCombatAttackHook() { 61 | __asm { 62 | push ecx; 63 | push edx; 64 | call AfterCombatAttack; 65 | pop edx; 66 | pop ecx; 67 | mov eax, 1; 68 | retn; 69 | } 70 | } 71 | 72 | void MainLoopHook::init() { 73 | HookCall(0x480E7B, MainGameLoopHook); // hook the main game loop 74 | HookCall(0x422845, CombatLoopHook); // hook the combat loop 75 | MakeCall(0x4230D5, AfterCombatAttackHook); 76 | } 77 | 78 | Delegate<>& MainLoopHook::OnMainLoop() { 79 | return onMainLoop; 80 | } 81 | 82 | Delegate<>& MainLoopHook::OnCombatLoop() { 83 | return onCombatLoop; 84 | } 85 | 86 | Delegate<>& MainLoopHook::OnAfterCombatAttack() { 87 | return onAfterCombatAttack; 88 | } 89 | 90 | } 91 | -------------------------------------------------------------------------------- /sfall/Delegate.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace sfall 7 | { 8 | 9 | // Simple multi-cast Delegate implementation. 10 | // Removing specific functions after they were added is not supported yet. 11 | template 12 | class Delegate { 13 | public: 14 | // The type of functions that can be stored in this delegate. 15 | using Functor = std::function; 16 | // Function collection type. 17 | using FunctorCollection = std::vector; 18 | 19 | // Creates an empty delegate. 20 | Delegate() {} 21 | 22 | // Add a function to the delegate 23 | void add(Functor func) { 24 | _functors.emplace_back(std::move(func)); 25 | } 26 | 27 | // Add all functions from another delegate of the same type. 28 | void add(const Delegate& other) 29 | { 30 | for (auto& func : other.functors()) 31 | { 32 | add(func); 33 | } 34 | } 35 | 36 | // Remove all functions from this delegate. 37 | void clear() { 38 | _functors.clear(); 39 | } 40 | 41 | // Invoke all functions in the delegate, passing the arguments provided (if any). 42 | void invoke(ArgT... args) { 43 | for (auto& func : _functors) { 44 | func(args...); 45 | } 46 | } 47 | 48 | // The list of currently registered delegates. 49 | const FunctorCollection& functors() const { 50 | return _functors; 51 | } 52 | 53 | // Replaces the current list of functions with single function provided. 54 | //Delegate operator =(Functor func) { 55 | // clear(); 56 | // add(std::move(func)); 57 | // return *this; 58 | //} 59 | 60 | // Removes all functions. 61 | Delegate operator=(std::nullptr_t) { 62 | clear(); 63 | return *this; 64 | } 65 | 66 | // Adds a single function to the list. 67 | Delegate operator +=(Functor func) { 68 | add(std::move(func)); 69 | return *this; 70 | } 71 | 72 | // Adds all functions from another delegate. 73 | Delegate operator +=(const Delegate other) { 74 | add(other); 75 | return *this; 76 | } 77 | 78 | private: 79 | // The list of functions 80 | FunctorCollection _functors; 81 | 82 | }; 83 | 84 | } 85 | --------------------------------------------------------------------------------