Compare commits

...
317 Commits
Author SHA1 Message Date
NovaRain 061a3925e6 Minor edits to Message.cpp/h 2020-10-27 00:54:29 +08:00
NovaRain c6fa6bac30 Cleaned up define_lite.h and command_lite.h
Improved/corrected the fix for function args in commit e59af7e8.
Minor code edits.
2020-10-26 11:25:31 +08:00
NovaRain 0988004245 Fixed the error handling in win_fill_color
Some code fixes.
2020-10-25 08:07:49 +08:00
NovaRain e59af7e88a Fixed function args not being reset properly
Removed redundant safeguard/manual arg init in various script functions.
2020-10-25 01:05:34 +08:00
NovaRain 7cf1b60b38 Backported the extended functionality of ExtraGameMsgFileList from 4.x 2020-10-24 21:23:04 +08:00
NovaRain a8919367ea Added "win_fill_color" script function 2020-10-24 13:54:43 +08:00
NovaRain 0a44f7118a Added support for drawing PCX images to draw_image, draw_image_scaled, and interface_art_draw
Fixed bug in TalkingHeads.cpp.
2020-10-24 00:55:40 +08:00
NovaRain cda56aca7d Fixed the macro guard in command_lite.h and added two macros 2020-10-21 22:36:59 +08:00
NovaRain 761124aaf4 Code edits to PartyControl.cpp 2020-10-18 07:15:57 +08:00
NovaRain 8e6a961fba Renamed elements in PerkInfo/TraitInfo structs
Implemented StatFormula struct from 4.x for Stats.cpp.
Implemented DudeState struct from 4.x for PartyControl.cpp.
2020-10-15 13:12:15 +08:00
NovaRain cca0fe0cb6 Fixed and improved the code in Graphics.cpp 2020-10-15 09:30:39 +08:00
NovaRain 180761c489 Added the ability to change the poison level for critters 2020-10-12 20:47:05 +08:00
NovaRain 540b68070b Corrected code in Arrays.cpp 2020-10-12 11:03:55 +08:00
NovaRain 466b79f5e8 Code optimization for array expression (from 4.x) 2020-10-11 10:55:58 +08:00
NovaRain b1f847afbc Code edits to Graphics.cpp according to 4.x changes
Minor edits to MetaruleExtender.cpp and notes.txt.
2020-10-11 01:09:31 +08:00
NovaRain 31fbddb612 Code correction in FalloutEngine.cpp
Updated global shader example files.
2020-10-09 08:57:46 +08:00
NovaRain 0c547da134 Backported "car_gas_amount" and "set_car_intface_art" functions from 4.0
Added prefixes to some functions (fake classes)
2020-10-08 22:14:32 +08:00
NovaRain cc5561d3d6 Updated example mod scripts 2020-10-08 15:34:41 +08:00
NovaRain 66ff811bcd Added "combat_data" script function
Added a new argument to HOOK_COMBATDAMAGE.
Removed the check for valid objects from get/set_object_data functions.
Some code fixes/edits.
2020-10-08 13:50:37 +08:00
NovaRain 27963fd064 Fixed broken Print() script function
Fixed the background image of the character portrait on inv/char screens.
Renamed "print_text" to "interface_print".
2020-10-06 11:48:31 +08:00
NovaRain dc88193ff6 Added "print_text" script function 2020-10-05 21:05:06 +08:00
NovaRain 2c36ad9a2a Removed InterfaceDontMoveOnTop from ddraw.ini (always enabled)
Added a fix to prevent toggling the cursor for a Transparent window.
2020-10-05 10:26:39 +08:00
NovaRain 9d34a4c70a Added support for transparent interface windows (#25) 2020-10-03 21:01:54 +08:00
NovaRain 548039d5bc Fixed FrmFile struct in the previous commit
Finished the code refactoring in InterfaceOps.hpp.
2020-09-29 09:04:27 +08:00
NovaRain 49c4bb2479 Some code refactoring
Added a value of 2 to TextureFilter option.
2020-09-28 12:07:12 +08:00
NovaRain 75b275159f Added "interface_art_draw" script function
Added an argument to "intface_redraw" function to redraw all interfaces.
2020-09-26 22:17:59 +08:00
NovaRain 52f42af913 Changed the behavior of saving/restoring hook arguments
(no need to specify the number of args when executing a nested hook)
Reverted the change of argCount in some hooks.
Disabled an obsolete fix for MultiHexPathingFix.
Simplified the code of draw_image/draw_image_scaled script functions.
2020-09-25 00:12:22 +08:00
NovaRain b195a8ab02 Moved all engine function defines to new FalloutFuncs_def.h
(similar to the way how 4.x handles engine functions)

Added the ability to get Automap window pointer.

Reorganized some code to prepare for later commits.
2020-09-24 15:22:32 +08:00
NovaRain 796e834a9d Some edits to the previous commit
Minor edits to some code.
2020-09-23 23:07:45 +08:00
NovaRain df4e847c59 Changed argCount to be set right after HookBegin in some hooks
* to avoid possible unexpected issues.
2020-09-23 15:33:42 +08:00
NovaRain 0a48ed3048 Added a new argument to HOOK_TOHIT (#339)
Added hook type 3 to HOOK_WITHINPERCEPTION (when AI selects a target)

Extended the upper limit of set_pickpocket_max and set_hit_chance_max
script functions to 999.

Added a fix for combat_is_shot_blocked_ not taking the flags of critters
in the line of fire into account.

Minor edits to ASM code of some hooks.
2020-09-22 22:16:57 +08:00
NovaRain 7414c8a361 Refactored ASM code of some hooks using 4.x as ref
Code edits to DisplayKarmaChanges.
Implemented the buf_to_buf_ replacement function from 4.x.
2020-09-21 21:22:21 +08:00
NovaRain 90a9ee5f15 Added loading multiple shader files for GlobalShaderFile option
Added a sharpen filter file as a global shader example.
Set TextureFilter to be enabled by default.
2020-09-21 13:03:05 +08:00
NovaRain 314100f231 Added TextureFilter option (restored from sfall 2.x) 2020-09-20 10:07:16 +08:00
NovaRain 9c92e2f487 Reorganized the function defines in FalloutEngine.cpp/h
* in the same way as 4.x's Functions_def.h.

Replaced some ASM blocks with function defines.
2020-09-19 21:34:14 +08:00
NovaRain 2d3a4d6c34 Corrected talking heads code of Use32BitHeadGraphics
Minor code correction.
2020-09-19 00:39:55 +08:00
NovaRain a936f35c80 Refactored code in Elevators.cpp to be like 4.x 2020-09-16 14:25:21 +08:00
NovaRain 3479bc6893 Backported KeepWeaponSelectMode from 4.x
Minor edits to code and documents.
2020-09-16 11:09:55 +08:00
NovaRain ff1aac40f5 Fixed temporary arrays being cleared when flushing the keyboard buffer (#337)
Added a message about failed initialization of the game and exit if an error occurs.
2020-09-15 11:34:26 +08:00
NovaRain 6142d95a60 Graphics: improved the performance of DX9 mode 2020-09-15 10:33:33 +08:00
NovaRain c4fc3d2c8b Graphics & Movies refactoring (WIP/unfinished) 2020-09-13 22:33:30 +08:00
NovaRain 40cca2452d Reverted part of changes in commit 0d5c88f
* InterpretGetValue could cause unexpected behavior in global scripts.
2020-09-13 18:37:55 +08:00
NovaRain 33a5c7428a Updated Ammo INI Loader example script mod
* now the INI will be read only once on script initialization, not
always being re-read on each map load.
2020-09-10 14:55:11 +08:00
NovaRain 55e935e18c Added the original Fallout 1 behavior to FastShotFix 2020-09-06 08:45:17 +08:00
NovaRain 398ad650b9 Added a fix to the weapon check in the Fast Shot trait
* changed range check to type+range check, the same fix is also applied
to FastShotTraitFix.

Added more info to the description of FastShotFix option.
2020-09-05 10:47:53 +08:00
NovaRain 9c7f34ffb2 Fixed typo in sfall.h (#334) 2020-09-03 21:06:01 +08:00
NovaRain 6a2a7ee82f Fixed EncounterTableSize option (#333)
* the encounter messages were still limited to 50 entries per table when
the value for encounters is set to greater than 50.

Fixed building the path to multihex objects.
2020-09-03 14:24:00 +08:00
NovaRain 849ae49bfb Tweaked the field of view check in ObjCanSeeObj_ShootThru_Fix
And fixed a bug when the target critter has the ShootTrhu flag set
(cannot be seen by the source)

Minor edits to some comments in previous commit.
2020-09-02 14:21:57 +08:00
NovaRain ed9c6c7508 Added support for ACM audio file playback to soundplay script function
(with volume control)

Added a volume control to reduce the volume for play_sfall_sound.
Added descriptions and constant defines to documents.
Some code optimization.
Updated version number.
2020-09-01 16:12:00 +08:00
NovaRain 57f4deb5cf Minor edits to Interface.cpp and ddraw.ini 2020-08-22 10:51:07 +08:00
NovaRain c6da5169b8 Minor edits to HookScripts.cpp based on 4.x changes 2020-08-21 12:57:03 +08:00
NovaRain 72f3abe3c9 Moved DeathScreenFontPatch code to Interface.cpp
Added a note about DeathScreenFontPatch in ddraw.ini.

Some code edits in BugFixes.cpp and DamageMod.cpp.
2020-08-21 12:42:46 +08:00
NovaRain 5d12d815dd Added DeathScreenFontPatch option
* use the normal font instead of bitmap font for death screen subtitles.

Attempted to fix the melee damage display for some extreme cases when
BonusHtHDamageFix=1 and DisplayBonusDamage=0.
2020-08-20 13:48:41 +08:00
NovaRain 502a5764a5 Updated global.fx and withinperception example script
Fixed some code.
2020-08-19 15:21:53 +08:00
NovaRain 13976a5278 Added a fix to limit the maximum distance for knockback animation
* 20 hexes at max. This does not affect the knockback value in
Combat Damage hook, only the animation part.

Backported AlwaysFindScripts option from 4.x for global scripts.
2020-08-18 13:45:49 +08:00
NovaRain a35487d0aa Added a fix to prevent the player from leaving the map during death anim
* when the death animation causes the player to cross an exit grid.

Fixed the height of the black background for the subtitles on death
screens when using the hi-res patch.

Added MakeJumps template to SafeWrite.h and devlog_f to Logging.cpp.

Minor code edits.
2020-08-17 15:11:16 +08:00
NovaRain f1102afbc3 Fixed the use of #pragma pack() directives for structures 2020-08-16 11:15:37 +08:00
NovaRain 4071a65f73 Replaced all 'DWORD' script pointers with the proper 'TProgram*'
Added more engine function wrappers.
2020-08-15 10:02:36 +08:00
NovaRain 8d813a952e Fixed and improved the behavior of nested timer events in global scripts
Added a fix to prevent the execution of critter_p_proc and game events
when playing movies.

Added a debug message about a corrupted proto file.

Some minor code/document edits.
2020-08-14 21:31:06 +08:00
NovaRain c1b7e729a8 Reorganized KeyPress hook & related code
* now it should work in exactly the same way as 4.x.

Improved the key press behavior for Debug Editor.
Implemented ScriptListInfoItem struct from 4.x.
2020-08-14 00:39:09 +08:00
NovaRain 12070f5e3d Fixed the playback of additional movies defined in the MovieXX options (#330)
Added the keyboard buffer cleanup function to metarule3.
2020-08-13 15:22:20 +08:00
NovaRain 63b2025468 Added the city name in the description of a save slot by default
Corrected some code.
2020-08-13 14:44:09 +08:00
NovaRain 44ad268aed Added a fix to remove floating text after moving to another elevation
* also update black edges of the map (HRP bug, #282)
2020-08-09 12:29:15 +08:00
NovaRain 2305128adc Changed the behavior of ObjCanSeeObj_ShootThru_Fix
* now the critter can only see through objects in front of it.
2020-08-08 11:52:17 +08:00
NovaRain 112c931ea3 Added a patch to allow setting custom colors for object outlines
Added a tweak to ObjCanSeeObj_ShootThru_Fix to allow critters to see
through other critters.

Fixed the internal variable for Horrigan encounter always being reset if
DisableHorrigan=0 (commit 74d3cb9)

Corrected some code.
2020-08-05 16:18:19 +08:00
NovaRain 8e3ae04aec Changed the behavior for replacing art aliases for critters
Added ANIM_charred_body/ANIM_charred_body_sf animations to art aliases
(#323)

Minor code edit to OverrideMusicDir (nop the rest to avoid leaving
garbage bytes)

Renamed some functions in Worldmap.cpp.
2020-08-03 14:41:43 +08:00
NovaRain 89ec203483 Corrected combat_attack_gcsd code in the previous commit
Added DAM_PRESERVE_FLAGS to attack_complex for keeping result flags.
Fixed OverrideMusicDir=2 not working.
2020-08-02 19:48:04 +08:00
NovaRain 21cbcb4a03 Rewrote several fixes for attack_complex in C++ and merged them
Added a default fix for attack_complex to untie target_results from
attacker_results.
2020-08-01 10:27:18 +08:00
NovaRain 76c9d63d3e Added more fixes for the arguments of attack_complex function:
* fixed result flags for the attacker and the target when calling
attack_complex function (#323)

* tweaked how attacker_results/target_results work when
AttackComplexFix is enabled.

Minor code edits.
2020-07-31 20:42:46 +08:00
NovaRain 962e7f0056 Added support for delayed speech playback to AllowDShowSound
(for synchronizing with subtitles when playing endgame slideshow)
2020-07-30 10:42:08 +08:00
NovaRain 950b9949c0 Added a new value 2 to AllowDShowMovies
* for forcing avi videos to fit the screen width.

Disabled warning C4995 (e.g. wcscpy in Movies.cpp)
Minor code edits to AI.cpp & Sound.cpp.
2020-07-29 14:20:04 +08:00
NovaRain 648bffedc6 Added volume control support for avi movies
Fixed implementation bugs when playing avi movies.
Added a couple of engine variable pointers.
2020-07-28 17:08:44 +08:00
NovaRain 058cc0bb96 Further implementation of speech playback for alternative sound files 2020-07-26 08:53:31 +08:00
NovaRain 9e79b01a27 Added a function extension for vanilla metarule3 function
Added SET_HORRIGAN_ENCOUNTER function to metarule3.
Updated German translation.
2020-07-24 21:29:54 +08:00
NovaRain 37e3ccb410 WIP: Fixed sfx/speech playback for alternative sound files 2020-07-22 12:27:18 +08:00
NovaRain 82db339ff9 Implemented CodeType enums in some SafeWrite8
Replaced some SafeWriteX with SafeWriteBatch.
Misc code edits to DebugEditor.cpp and ScriptExtender.cpp.
Minor edits to documents.
2020-07-21 12:42:46 +08:00
NovaRain 74d3cb9707 Removed some redundant code 2020-07-19 08:56:42 +08:00
NovaRain e0f0ee0f7d Fixed the default values for the MovieXX options
Added some comments to elevators.ini & other codes.
Rearranged the functions in NewGame2().
Updated FalloutEngine.h for previous commit.
Updated version number.
2020-07-18 22:28:22 +08:00
NovaRain 107335749f Implemented union in TGameObj struct (from 4.x)
Moved some code from HeroAppearance to other parts.
Some code edits.
2020-07-18 10:50:49 +08:00
NovaRain c66add00e7 Added more 4.x constants to Define.h
Renamed some members in structs according to 4.x namings.
2020-07-16 11:10:48 +08:00
NovaRain d4d8b3a06c Uploaded language translation files to repo
Updated German (#326) and Russian translations.
2020-07-08 09:54:08 +08:00
NovaRain fcd3bd05f0 Fixed NPC stuck in an animation loop in combat (#321)
* this happens when trying to move close to a multihex critter.
2020-07-01 09:49:37 +08:00
NovaRain ae6a6e80d3 Fixed ASM error in the previous commit 2020-06-30 15:49:53 +08:00
NovaRain c0557ddbc1 Fixed broken PlayIdleAnimOnReload option (#320)
(in commit aafc030)

Improved the fix for incorrect positioning after exiting small/medium
locations.
2020-06-30 12:31:49 +08:00
NovaRain 46dd02b566 Fixed the code for "display_stats" script function
Minor edit to Perks.cpp.
2020-06-29 23:03:41 +08:00
NovaRain 4c3f255915 Added a fix to prevent showing an empty perk selection window 2020-06-29 12:56:27 +08:00
NovaRain de01fdf065 Added "get_stat_max/min" script functions (#307)
Added updating player's stats on the char screen to "display_stats"
script function (#314)
2020-06-29 11:57:36 +08:00
NovaRain 1e6d2229dd Corrected the code for multihex retargeting tile
Small optimization to sfall function code.
2020-06-28 23:13:05 +08:00
NovaRain 317c4d4c05 Re-fix for the previous commit 2020-06-28 09:53:33 +08:00
NovaRain 31b244e5f3 Corrected the fix from the previous commit 2020-06-27 10:16:14 +08:00
NovaRain 066280a7ca Fixed the hang/freeze in combat (from commit b345140)
Added a fix for retargeting tile for multihex critters.
2020-06-27 09:48:20 +08:00
NovaRain 535595a997 Refactored some code in HeroAppearance.cpp 2020-06-14 10:41:57 +08:00
NovaRain 41b15b8838 Fixed bugs in the hero appearance mod:
* gender was not reset properly when creating a new character (#309)
* the player was missing some fire/electrical death animations (#310)
2020-06-14 09:29:53 +08:00
NovaRain 2cd79c1033 Moved static addresses into respective funcs in Stats.cpp 2020-06-13 00:26:31 +08:00
NovaRain cc9807344a Fixed Auto Doors example script mod
Cosmetic changes to the text descriptions in Perks.ini.
2020-06-13 00:20:48 +08:00
NovaRain 6c31cc43a0 Increased the max width of the player name on the char screen (#305)
Updated version number.
2020-06-04 06:40:57 +08:00
NovaRain b345140fba Some bug fixes regarding multihex critters in shoot blocking 2020-05-24 11:33:06 +08:00
NovaRain 3acf051b49 Renamed all metarule functions with mf_ prefix 2020-05-21 09:42:02 +08:00
NovaRain 0137504f3f Renamed all script opcode handlers with op_ prefix 2020-05-19 10:05:27 +08:00
NovaRain ebcd505561 Minor code fixes in AI.cpp:
* Fixed NPCs being unable to select a burst attack mode if the line of
fire was blocked.

* Changed the return point of combat_ai_hook_FleeFix to run
ai_check_drugs_ first.

Changed the debug message about missing art file for critters to be
displayed in game only when in sfall debugging mode.
2020-05-19 09:50:23 +08:00
NovaRain 24cb02b7d8 Fixed ai_move_away_ engine function
Some minor fixes.
2020-05-10 10:03:04 +08:00
NovaRain 48ce358451 Backported SkipLoadingGameSettings option from 4.x 2020-05-08 10:38:32 +08:00
NovaRain c293a826bc Cosmetic changes to the code:
Use double underscore for stdcall and "asm" keyword.
2020-05-07 12:30:22 +08:00
NovaRain 0da7c7b266 Minor code edits to Combat.cpp 2020-05-07 11:20:32 +08:00
NovaRain d74df7fc78 Added checking AP cost to ai_pick_hit_mode_ engine function 2020-05-07 09:49:57 +08:00
NovaRain df816bcd47 Added a tweak for finding new targets for PMs
* before they would "forget" their current target when trying to find
new ones (only 3), now the current target is included as one of
potential targets.

Tweaked the code of MultiHexPathingFix.
2020-05-05 12:15:30 +08:00
NovaRain 068988caad Added internal implementation of engine functions with hooks:
* item_w_mp_cost_ with CALCAPCOST
* is_within_perception_ with WITHINPERCEPTION
2020-05-01 10:29:27 +08:00
NovaRain 24c9499021 Added combat rating check to "Snipe" distance preference fix
Added a fix to reduce friendly fire in burst attacks.
Updated the info of TGameObj struct.
2020-05-01 08:01:24 +08:00
NovaRain 7f3de8d19a Minor code edits/fixes 2020-04-30 10:28:31 +08:00
NovaRain 87f7fe4a54 Moved code from main.cpp to new PlayerModel/MiscPatches.cpp 2020-04-28 12:43:54 +08:00
NovaRain 01ba18100e Added a fix for AI behavior for "Snipe" distance preference
Added a check for for the weapon range and the distance to the target
when AI is choosing weapon attack modes.
2020-04-28 10:58:24 +08:00
NovaRain 8b26573073 Changed the fix for AI target selection in commit f0f00a7
* NPCs will reload the weapon in the same turn (and attack if have
enough AP left) if weapon is empty while selecting targets.

Moved some leftover code in main.cpp to KillCounter.cpp & Elevators.cpp.

Misc code edits.
2020-04-27 14:32:39 +08:00
NovaRain 1839790dfb Fixed AllowDShowSound=2 not working
Limited NumSoundBuffers to the max of 32.
Fixed replacing Body_Torso with Body_Uncalled (from commit 62f890d)
Corrected the code in the previous commit.
2020-04-23 12:42:20 +08:00
NovaRain cb1d5d359f Added a tweak to the miss message in combat
* if the main target has Flat flag set, remove the message about hitting
another object.

Reorganized the code of misc patches in main.cpp.
2020-04-22 11:40:11 +08:00
NovaRain b781e117a2 Improved the fix for placing PID_CORPSE_BLOOD obj on the lower layer
(didn't work correctly after re-entering the map.)

Fixed CorpseDeleteTime not setting the timer correctly.
2020-04-21 10:55:56 +08:00
NovaRain a7d9716b68 Moved some engine structs to FalloutStructs.h
Some code edits regarding variable/struct types.
2020-04-20 12:06:13 +08:00
NovaRain cdd2bfe338 Reverted incorrect code change of SpeedPatch.cpp in previous commit.
Some code edits to Explosions.cpp and Perks.cpp.
2020-04-19 10:21:20 +08:00
NovaRain 7decec4a2c Added use_item_on_dude macro to sfall.h
Various code edits:
* Implemented more HookCalls/MakeCalls/SafeWriteBatch in code.
* Moved return/jump address consts into their respective functions.
2020-04-18 21:25:54 +08:00
NovaRain e3af4f5754 Fixed ReloadWeaponKey for using any non-weapon item (#84) 2020-04-18 11:25:46 +08:00
NovaRain 1b61bca702 Fixed "loot_obj" script function 2020-04-18 09:03:16 +08:00
NovaRain f0f00a77ea Fixed AI target selection for no ammo or target out of range cases 2020-04-18 09:01:29 +08:00
NovaRain 58d41487fd Re-fixed automatically ending combat
Updated version number.
2020-04-18 08:59:28 +08:00
NovaRain 73ccba22bf Implemented HookCalls/MakeCalls templates
* same as SafeWriteBatch, only accept address arrays due to no support
for list initialization in VS2010.
2020-04-11 08:19:32 +08:00
NovaRain 1f8b3636f3 Implemented SafeWriteBatch template from 4.x
* only the version that accepts address array due to no support
for list initialization in VS2020.
2020-04-08 10:42:59 +08:00
NovaRain b7e80d445e Fixed NPCs not fully reloading a weapon sometimes
* NPCs use only one box per reload. If the weapon has more ammo
capacity than a box of ammo (e.g. miniguns and BB gun), it'll take
several tries for them to fully reload it.
2020-04-05 08:25:00 +08:00
NovaRain e404684f58 Reverted the change for ResetState() in 993555
* reason: the skills didn't get initialized properly if loading a save
from the main menu before starting any game. And some inits in 3.8
also require running ResetState() before any game, so reverting is
probably the easiest solution before I break more stuff.

Backported some code setup from 4.x for Combat.cpp & Skills.cpp.
2020-04-04 18:06:04 +08:00
NovaRain 4c78ba595c Moved static addresses into respective funcs in BugFixes & main.cpp 2020-04-03 23:19:10 +08:00
NovaRain 1f1d6eb6f0 Some code correction in BugFixes
Minor edits to documents.
2020-04-03 12:33:48 +08:00
NovaRain 9935553bce Reduced unnecessary game reset execution 2020-04-02 23:20:04 +08:00
NovaRain cd4d3b5b2f Some code/document edits 2020-04-02 12:00:52 +08:00
NovaRain a61ff5b626 Edited the description of RadEffectsRemovalMsg option 2020-04-01 22:10:55 +08:00
NovaRain bc2e8e4362 Backported the code of DeathAnim1/2 hook from 4.x
Updated hookscripts.txt to reflect the change.
2020-04-01 10:57:54 +08:00
NovaRain 136404a723 Fixed loading savegame for "NPC turns into a container" bug fix
Added RadEffectsRemovalMsg option for radiation fixes.

Some code correction in Graphics.cpp.
2020-03-31 21:54:49 +08:00
NovaRain 1a17ac5ac8 Added ActiveGeigerMsgs option and radiation fixes
Changed "Radiated" to be highlighted in red color when the player is
under the influence of negative effects of radiation.

Some edits to macros in HookScripts.cpp.
2020-03-30 21:15:19 +08:00
NovaRain 07543dd29d Fixed a crash when using older versions of HRP
Fixed potential crash/bug when alt-tab out of game and get back.
Edited OnDeath hook to minimize its hook points to the engine (from 4.x)
Minor edits to ddraw.ini.
2020-03-26 14:13:22 +08:00
NovaRain 4243bead5d Attempted to fix the crash with sfall array and missing script (#281)
Replaced all pushad/popad in script opcodes with pushaop/popaop macros.
2020-03-25 20:22:54 +08:00
NovaRain f80e933889 Rewrote some script functions in PerksOps.hpp
* funcs: get_perk_available, set_perk_name/desc, set_selectable_perk,
set_fake_perk/trait.

Minor code refactoring in ObjectsOps.hpp.
2020-03-25 12:26:26 +08:00
NovaRain 7cbde234c6 Rewrote various script functions in _WRAP_OPCODE
* funcs: reg_anim_*, sqrt, sin, cos, tan, arctan, get/set_weapon_ammo_*,
list_*, strlen, atoi, atof, typeof, string_split.
2020-03-24 12:12:34 +08:00
NovaRain f6ae7c5f2c Fixed stuttering when playing avi movies
Fixed a crash when playing mve movies without the hi-res patch.

Minor edits to ddraw.ini and function notes.txt.
2020-03-24 10:55:28 +08:00
NovaRain 58060a8c5f Simplified the pushad/popad in _WRAP_OPCODE macro
Refactored ASM code of art_exists and sneak_success functions.
Rewrote set_critter_current_ap and set_sfall_arg with _WRAP_OPCODE.
2020-03-23 13:52:28 +08:00
NovaRain 22140e2a0c Added performance patches, some code moved to main.cpp
Minor edits to ddraw.ini.

Tweaked the names in AsmMacros.h.
2020-03-22 09:27:24 +08:00
NovaRain 1c6f8cc255 Refactored sfall_ver_* and charcode functions 2020-03-20 12:32:05 +08:00
NovaRain e479609581 Added a new "fullscreen windowed" DX9 mode
Added saving the position of the game window to ddraw.ini
2020-03-20 12:30:41 +08:00
NovaRain ab11c0422a Refactored ASM code of script opcode handlers
Included call_offset_xx functions for AllowUnsafeScripting=2
2020-03-19 12:57:19 +08:00
NovaRain 09752c98a4 Attempted to fix the crash in commit 0ba3b62
* the crash happens when the game loses focus.
2020-03-17 14:48:50 +08:00
NovaRain aab04764ae Added a new value to AllowUnsafeScripting
* for disabling the memory address check in write_xxx unsafe functions.
2020-03-17 13:39:05 +08:00
NovaRain 0ba3b62eff Improved and fixed the playback of alternative sound files
Added a new mode to play_sfall_sound script function.
2020-03-17 13:08:47 +08:00
NovaRain 0c0d1dd73e Fixed the return value of play_sfall_sound function
* before it returned a raw pointer instead of the ID number of the
played sound.
2020-03-12 11:58:48 +08:00
NovaRain 0fd45aa37a Moved allowDShowSound code from Movies.cpp to Sound.cpp 2020-03-12 10:06:56 +08:00
NovaRain 00a6e4f0f9 Fixed set_palette function broken in the previous commit 2020-03-10 10:07:59 +08:00
NovaRain 36ef55ddd0 Refactored ASM code of script handlers in MiscOps.hpp
Minor code edits.
2020-03-07 16:02:23 +08:00
NovaRain db2435416d Minor code edits 2020-02-29 18:59:44 +08:00
NovaRain 0120e46782 Added a new value to the 'mark_state' arg of mark_area_known function
* 3 - uncovers locations without highlighting their sub-tiles.
(Fallout 1 behavior)
2020-02-29 08:40:45 +08:00
NovaRain eddefd6bd5 Fixed Fill_W not uncovering all tiles to the left (#287) 2020-02-28 07:43:14 +08:00
NovaRain f9cbab3d55 Fixed a crash or animation glitch of the critter in combat (beta fix)
* when an explosion from explosives and the AI attack animation are
performed simultaneously.
2020-02-25 11:38:43 +08:00
NovaRain e3168946ba Minor code fix for Graphics.cpp
Added notes/correction to hookscripts.txt.
2020-02-22 15:50:06 +08:00
NovaRain 8bb660ff11 Fixed the player's money not being displayed after barter (#286)
Restored TownMapHotkeysFix option.

Updated version number.
2020-02-22 15:37:36 +08:00
NovaRain 8a7d9cbd78 Re-ordered the code in ScriptExtender.cpp
* for removing some unnecessary static func declarations at the top.

Moved Set/GetAppearanceGlobals() to HeroAppearance.cpp like 4.x.
2020-02-10 22:22:02 +08:00
NovaRain 008fdb12b7 Minor code improvement in Graphics.cpp 2020-02-09 09:29:43 +08:00
NovaRain 3609f2e309 Renamed dinput.cpp/input.h to InputFuncs.cpp/h 2020-02-08 11:59:00 +08:00
NovaRain 517c2e6825 Updated stdafx.h and other code/doc files 2020-02-08 08:48:02 +08:00
NovaRain 4bc687922a Reverted part of changes in the previous commit 2020-02-07 19:17:24 +08:00
NovaRain 5230ca9cbf Edited some wording in ddraw.ini and Define.h 2020-02-07 10:05:59 +08:00
NovaRain 5a5c65291d Fixed trying to loot corpses with the "NoSteal" flag (#280) 2020-02-06 10:52:19 +08:00
NovaRain e153819bcd Added the description for 'div' operator to notes.txt 2020-02-05 23:21:15 +08:00
NovaRain 8ab5b9b7e7 Replaced all MAXINT with INT_MAX in QuestList.cpp (#279)
Added WINVER and _WIN32_WINNT defines to stdafx.h.
2020-02-05 16:18:51 +08:00
NovaRain abe3b01213 Fixed playing game movies with width less than 640px in DX9 mode
Fixed palette updating.
2020-02-05 09:47:25 +08:00
NovaRain 15019ffe81 Some code edits to ExtraSaveSlots.cpp 2020-02-04 16:28:21 +08:00
NovaRain eacd1e5682 Moved engine function defines from HeroAppearance to FalloutEngine 2020-02-04 10:55:09 +08:00
NovaRain 84204d97d8 Simplified the code in HeroAppearance.cpp 2020-02-03 11:23:20 +08:00
NovaRain 3b85596ca1 Renamed all Op.hpp to Ops.hpp 2020-02-02 21:54:10 +08:00
NovaRain 21bf1056ac Added DivisionOperatorFix option for signed integer division (#278)
* it changes the behavior of vanilla division operator to use signed
integer division. Before it used signed division for floats but
unsigned for integers.

Added a new "div" operator for unsigned integer division.
Moved mathematical script functions from ScriptUtils.hpp to new MathOps.
Added include guard to sfall.h and main.h in modders pack.
2020-02-02 21:49:54 +08:00
NovaRain 1354467059 Fixed the barter button on the dialog window (from rotators repo)
* when first entering the dialog, it didn't animate on click.
2020-02-02 15:44:47 +08:00
NovaRain 8d720185a7 Reverted part of changes in previous commit 2020-02-02 13:50:01 +08:00
NovaRain 87864d9ef6 Fixed palette in DX9 mode 2020-02-01 14:08:46 +08:00
NovaRain 0d5c88fded Implemented the optimization for receiving/passing script args from 4.x
* combined related engine interpreter functions into a single function
for aligning the compiled ASM code better.

Minor edits to dinput.cpp.
2020-01-31 20:29:29 +08:00
NovaRain 555b3a9504 Fixed the timer event execution in global scripts 2020-01-31 01:41:25 +08:00
NovaRain f8cd74cc49 Minor changes to some other code and documents. 2020-01-31 01:23:32 +08:00
NovaRain 408661f42b Rewrote and rename "dialog_box" to "message_box"
Added support for '\n' control character to create_message_window.

Fix the playback of the speech sound file for the death screen.
2020-01-28 13:14:58 +08:00
NovaRain 893847cc6a Added "dialog_box" script function
Added a new attrType value to "get_window_attribute" function.

Tweaked the arg type check for "force_encounter_with_flags" function.
2020-01-27 20:52:01 +08:00
NovaRain 6b1fffded1 Fixed the timing of setting some game mode flags
* now WORLDMAP, PIPBOY, INVENTORY, INTFACEUSE, and INTFACELOOT are
toggled after creating/before deleting their corresponding interface
windows.

Fixed the array out of bounds bug in Skills.cpp.
2020-01-27 10:42:51 +08:00
NovaRain 3b2e23fda6 Backported FO1 worldmap features from 4.x
* WorldMapTravelMarkers, WorldMapTerrainInfo options.
* set_terrain_name, set_town_title script functions.
2020-01-26 09:26:41 +08:00
NovaRain c9b1a1b583 Edited FalloutEngine using 4.x's EngineUtils & Variables_def as ref 2020-01-25 18:01:55 +08:00
NovaRain d13cd9267d Reordered ResetState() sequence in LoadGameHook.cpp
* in the same order as 4.x modules.

Merged and renamed some "reset" functions.
2020-01-24 22:38:55 +08:00
NovaRain 5a638f48ff Added some engine variables to pointer defines.
Removed redundant PlayAcm() from HeroAppearance.cpp.
2020-01-24 10:03:39 +08:00
NovaRain df1d147a4f Removed TownMapHotkeysFix from ddraw.ini (always enabled)
Also move its code from Worldmap.cpp to BugFixes.cpp.
2020-01-23 23:34:21 +08:00
NovaRain e733954e65 Removed DisplaySecondWeaponRange from ddraw.ini (always enabled)
Minor edits to some code and documents.
2020-01-23 20:35:18 +08:00
NovaRain 36b3b6a2c7 Added "get_window_attribute" script function (#276) 2020-01-22 21:23:12 +08:00
NovaRain ceba5d1da2 Added a flashing icon to the Horrigan encounter
Minor edits to some code and documents.
2020-01-22 10:27:11 +08:00
NovaRain d6486008f4 Expanded the functionality of Fallout1Behavior
* calling endgame_movie now plays Movie11 or Movie12 depending on
the player's gender before the credits.

Added new flags to force_encounter_with_flags function.
2020-01-21 21:40:36 +08:00
NovaRain 9f140cf3ca Added a blinking icon to force_encounter/with_flags functions
* currently an icon is always shown for scripted force encounters.
2020-01-20 11:51:17 +08:00
NovaRain f2670deb6f Minor edits to Console.cpp and Logging.cpp
Added procedure and macros for unsigned integer comparison to lib.math.h.
2020-01-19 12:20:18 +08:00
NovaRain 6e6e01ea7f Simplified the code of string_to_case function
Minor edits to some code and documents.
2020-01-17 21:56:12 +08:00
NovaRain dccd735454 Improved the avi playback function 2020-01-17 21:48:54 +08:00
NovaRain 21004e3e63 Combined tolower/toupper in previous commit to "string_to_case" 2020-01-16 20:35:49 +08:00
NovaRain d12db2be28 Added "tolower", "toupper" script functions 2020-01-16 09:46:27 +08:00
NovaRain 3d335231a2 Replaced <hash_map><set> with <unordered_map><unordered_set> 2020-01-10 21:33:32 +08:00
NovaRain d4eb1ee539 Moved the Combat Block patch from AI.cpp to Combat.cpp
Removed palette animations enablement from Interface.cpp.
2020-01-10 11:12:34 +08:00
NovaRain 61c0964c98 Moved engine func defines from various files to FalloutEngine.cpp
(HeroAppearance.cpp, Message.cpp, Sound.cpp)
2020-01-09 22:36:58 +08:00
NovaRain 58532fd902 Fixed duplicate critters being added to the target list for AI
Edited hookscripts.txt to mention the fix.

Some code correction.
2020-01-09 11:41:50 +08:00
NovaRain aafc030f8e Code refactoring in main.cpp (from MiscPatches in 4.x)
Updated compiler document.
2020-01-08 16:59:07 +08:00
NovaRain c652982a06 Added sslc documents to repo 2020-01-06 14:14:22 +08:00
NovaRain 1e0b048e9e Re-fixed setting DIALOG game mode flag 2020-01-06 00:19:36 +08:00
NovaRain 28dc256f61 Fixed the timing of setting DIALOG game mode flag
Renamed win_* related functions in FalloutEngine.

Minor code edits to Inventory & Worldmap following develop branch.
2020-01-05 10:05:39 +08:00
NovaRain 18e1e06d28 Merged message struct defines in Inventory.cpp & Message.cpp
Changed GetMessageStr() and MsgSearch() to take proper MSGList struct.

Edited some code to reflect the changes above.
2020-01-04 01:21:48 +08:00
NovaRain 6871e6f673 Minor edits to Worldmap.cpp & Interface.cpp (from 4.x) 2020-01-02 00:43:13 +08:00
NovaRain 9ef670161d Reverted the change on x offset in previous commit 2019-12-29 08:42:08 +08:00
NovaRain c26cd45b5b Increased the width of the total weight display in the inventory
(moved from the CritterInvSizeLimitMode option)

Minor format edits to README.md.
2019-12-29 01:58:02 +08:00
NovaRain 0b5c61cb72 Backported AutoQuickSave and AutoQuickSavePage options from 4.x
Updated version number and year.
2019-12-28 09:27:45 +08:00
NovaRain 11261ca9be Merged db_* engine function defines in HeroAppearance and Tiles
Edited both source files according to new defines.
2019-12-28 09:14:12 +08:00
NovaRain 4d435ca143 Backported WRAP_WATCOM_CALL macros from 4.x for engine function defines 2019-12-28 09:03:27 +08:00
NovaRain 35d9b9439c Included Define.h in FalloutEngine.h
* it removes the need to include Define.h separately across the code.
(similar to Fallout2.h in 4.x code)

Added StrNormalizePath() to Utils.cpp.
2019-12-25 09:25:36 +08:00
NovaRain a1968f7f86 Minor edits to the built-in item highlighting function
Removed the redundant struct define in Tiles.cpp.

Added a comment to ScriptUtils.hpp.
2019-12-24 20:58:03 +08:00
NovaRain 85a5ee2a52 Some edits to hookscripts.txt & function notes.txt 2019-12-24 00:57:16 +08:00
NovaRain 310c392759 Added lootable corpses to the built-in item highlighting 2019-12-23 21:22:15 +08:00
NovaRain 3a24d0bdfd Replaced _stricmp in previous commit with strcmp.
Minor edits to Inventory.cpp.
2019-12-16 15:46:09 +08:00
NovaRain a9ad1a62eb Tweaked the path to load global shaders in the previous commit
* although 3.8 doesn't have the path issue as 4.x due to the lack of
loading custom .dat, it's better to unify the path in this case.

Refactored the code for DataLoadOrderPatch in the same way as 4.x.
2019-12-15 10:31:50 +08:00
NovaRain d73859fa5f Applied proper ptr_patches to some code 2019-12-14 11:41:43 +08:00
NovaRain 04043989c6 Restored loading global shaders at game start from pre-3.0
Added GlobalShaderFile option to ddraw.ini.
Added an example global shader file to modderspack.
Minor edits to HeroAppearance.cpp.
2019-12-14 11:05:12 +08:00
NovaRain 3b82232b46 Edited the description of the functions in the previous commit
Rewrote ASM code for tile_under_cursor script function.
2019-12-14 00:35:05 +08:00
NovaRain 5e704d206f Added "objects_in_radius" and "tile_by_position" script functions 2019-12-13 10:56:15 +08:00
NovaRain 5e65510797 Rewrote the code of some hook in 4.x style
* TOHIT, AFTERHITROLL, REMOVEINVENOBJ
2019-12-11 15:55:29 +08:00
NovaRain b4dac84ddd Rewrote some script functions in ObjectsOps in C++
* remove_script, set/get_script, set_critter_burst_disable.

Changed the return value of get_script to 0 for unscripted objects.
2019-12-09 11:07:40 +08:00
NovaRain cbc822c9e0 Minor edits to code 2019-12-07 09:56:43 +08:00
NovaRain 6cc68ed3de Re-fixed the previous commit
Replaced calling full substring with a simplified one for get_array.
2019-12-05 09:49:07 +08:00
NovaRain 6d4aea216b Fix for printing game messages to debug log 2019-12-04 13:07:04 +08:00
NovaRain 569790acb2 Code refactoring for ASM code in opcodes 2019-12-04 11:37:44 +08:00
NovaRain 7016690f99 Added "string_format" script function
Rewrote ASM code of opcode handlers in MemoryOp.hpp.
2019-12-03 10:52:56 +08:00
NovaRain eeb97a4299 Some code refactoring 2019-12-01 12:10:33 +08:00
NovaRain 66c237d297 Refactored the code for "substr" script function
* fixed the crashing bug and added a new behavior.

Changed the error message due to missing critter frame (again):
* replaced the interruption with printing the error message to in-game
message window.
2019-11-29 12:13:36 +08:00
NovaRain 3629c90fa9 Simplified _RET_VAL_INT2 in AsmMacros.h (from dev)
Changed related ASM code in various script functions.

Minor refactoring on some script functions.
2019-11-29 12:10:08 +08:00
NovaRain 1f99855500 Changed the error msg due to missing critter frame
* now the game only "crashes" when both Enable and DebugMode are
enabled in [Debugging] in ddraw.ini.
2019-11-28 14:43:00 +08:00
NovaRain cdf0bdf23e Refactored script function handlers
Changed error return values of list_begin/next to the same as dev.
2019-11-28 14:42:07 +08:00
NovaRain 2c67058016 Code refactoring for opcodes/metarules
* added proper arg validation for some opcodes using WRAP_OPCODE macro.
* changed return values of some opcodes/metarules to be the same as dev.
2019-11-28 10:24:40 +08:00
NovaRain 29f0affd72 Re-fixed commit e62b5c0 (correct variant) 2019-11-26 07:49:31 +08:00
NovaRain e01569637d Backported additional check in DialogHook from 4.x
Renamed inLoop/saveInCombatFix variables in LoadGameHook.cpp.
2019-11-25 09:58:12 +08:00
NovaRain 78f0ac473d Restored calling original engine functions from HRP hacks. 2019-11-25 07:29:29 +08:00
NovaRain bbe9a2d26d Added "get_text_width" and "string_compare" script functions
Rewrote set_dm/df_model, set_movie_path functions with WRAP_OPCODE.
2019-11-23 20:32:57 +08:00
NovaRain 7bcb76e70c Restored and fixed RemoveWindowRounding option
Reorganized ddraw.ini a bit.
2019-11-21 00:58:41 +08:00
NovaRain 3348d8b716 Backported "draw_image" and "draw_image_scaled" functions from 4.1 2019-11-19 20:51:22 +08:00
NovaRain 4767ad2753 Fixed a crash bug in CorpseLineOfFireFix (from commit d9a440f)
Minor edits to HookScripts/FalloutEngine.
2019-11-19 14:27:19 +08:00
NovaRain 04ebbaa182 Added three new script window functions:
"show_window", "hide_window", "set_window_flag"

Updated documents.
2019-11-17 08:40:18 +08:00
NovaRain 3c5dc6853a Added "get_sfall_arg_at" script function
Improved the functionality of "inventory_redraw" function.
2019-11-16 22:54:09 +08:00
NovaRain a70a776e46 Tweaked/fixed reg_anim_callback function 2019-11-15 10:01:39 +08:00
NovaRain 83c3d6b1a8 Added "reg_anim_callback" script function(opcode)
Updated documents.
2019-11-14 13:02:10 +08:00
NovaRain 6a566087ca Implemented executing timed_event_p_proc in sfall global scripts
Added "add_g_timer_event" and "remove_timer_event" script functions
for timed_event_p_proc in global scripts.

Fixed the check on the 'hidden' flag for previous commit.
2019-11-11 10:01:38 +08:00
NovaRain e62b5c03db Added a fix for scripted interface windows
* prevents player's movement when clicking on the window.

* the mouse cursor will not be toggled when the cursor hovers over
a hidden window.

Updated version number.
2019-11-10 18:24:43 +08:00
NovaRain 29da6d7071 Minor edits to FalloutStructs.h
Removed unnecessary AfterAttackCleanup on reset in LoadGameHook.cpp.
Fixed Debug build configuration in project file.
2019-11-05 09:27:41 +08:00
NovaRain ec4a58e19e Updated define_extra.h
Added define of OBJ_DATA_SCRIPT_INDEX to define_extra.h.
Moved Stats related reset code from ScriptExtender.cpp to Stats.cpp.
2019-11-04 21:28:06 +08:00
NovaRain b023999c5e Updated script mods. 2019-11-03 10:10:11 +08:00
NovaRain ee711d8f81 Added "get_inven_ap_cost" script function 2019-11-02 10:26:28 +08:00
NovaRain d26a06872a Backported the advanced BarBoxes features from 4.x:
* Added BoxBarCount option.
* Added "set_iface_tag_text" and "add_iface_tag" script functions.
* Now number of simultaneously displayed boxes depends on game res.
* Updated documents.
2019-11-01 21:14:03 +08:00
NovaRain c4f8912490 Added support for displaying item AP cost up to 19
* Requires an extended MVENUM.frm in the art\intrface\ directory to
display properly (will be included in modderspack).
2019-10-31 12:47:57 +08:00
NovaRain d9a440f667 Fixed PM's weapon being misplaced after level up
Moved some codes from Worldmap.cpp to new Interface.cpp (same as 4.x).

Moved some option codes from main.cpp to other modules.

Removed CorpseLineOfFireFix from ddraw.ini (always enabled).
2019-10-31 11:42:20 +08:00
NovaRain 49bc2d3241 Some code fixes/edits. 2019-10-29 10:45:46 +08:00
NovaRain d07603f1b0 Renamed AnimationsAtOnceLimit.cpp/h to Animations
Renamed SuperSave.cpp/h to ExtraSaveSlots (same as 4.x)
2019-10-28 09:51:20 +08:00
NovaRain 76346c24b3 Added a debug message about missing art file for critters 2019-10-25 10:24:40 +08:00
NovaRain dee3e2f596 Minor code edit to previous commit 2019-10-23 09:37:10 +08:00
NovaRain 648eb9b2f1 Engine now uses 'English' as the fallback language for all msg files 2019-10-22 15:56:04 +08:00
NovaRain fcbf4d3972 Cleanup in vcxproj file 2019-10-22 10:27:59 +08:00
NovaRain 3ef6056a77 Added "add_trait" script function
Replaced some C-style casting with pre-defined ptr_* variables.
2019-10-20 19:31:08 +08:00
NovaRain ac10bce231 Moved code from main.cpp to new LoadOrder/Karma.cpp
Slightly refactored list_* functions with 4.x codebase.

Changed the initialization order in main.cpp to 4.x's.
2019-10-18 11:15:10 +08:00
NovaRain 6780a21b07 Fixed amount argument for critter_add/rm_trait functions 2019-10-17 10:27:28 +08:00
NovaRain 25fabde434 Replaced GetPrivateProfileInt/String with wrapper functions
Fixed crash when a name in PremadePaths exceeds 11 characters.
2019-10-16 14:29:04 +08:00
NovaRain da7cd2a060 Implemented new ini reading funcs (part 2)
Refactored Premade.cpp, Reputations.cpp, KarmaFRMs in main.cpp, and
XPTable in Stats.cpp using 4.x implementation.
2019-10-15 21:57:49 +08:00
NovaRain 8924257aee Added a new flag to MainMenuFontColour option
* set bit 1 of the first byte to only change the color of version text
(old behavior)
2019-10-15 11:58:49 +08:00
NovaRain 90ef9e273d Implemented new ini reading funcs in various codes 2019-10-14 23:55:54 +08:00
NovaRain b447e8e9b8 Rewrote set_xp_mod function with WRAP_OPCODE.
Cleanup in ASM scripting handlers code.

Code edits to Perks.cpp and Stats.cpp.
2019-10-14 21:36:25 +08:00
NovaRain 3744c0b165 Added optional options to the perks ini file
* to toggle modification sections for perks and traits.

Backported ini reading functions from 4.x to main.cpp, and edited
related code in Perks.cpp (need to implement to other source later)

Added error/warning icons to message boxes.
2019-10-14 15:30:46 +08:00
NovaRain c98af496b3 Added command_lite.h header file to modderspack 2019-10-11 00:53:22 +08:00
NovaRain c7eaff7ff5 Fixed art_change_fid_num when the hero appearance mod is enabled
* before it set player's FID incorrectly if PC is in other appearance.

Prevented the player from equipping a weapon when player's current
appearance doesn't have the animation for it.

Fixed the player name while controlling other critters.

Edited texts for some error message boxes.
2019-10-10 12:00:30 +08:00
NovaRain 37acec7115 Added "unwield_slot" script function
Re-fixed obj_art_fid for player's FID (commit 36523d8)
2019-10-08 10:56:49 +08:00
NovaRain f6ec543f40 Fixed inven_unwield script function
* now it updates the interface slot for the player properly.

Fixed some code in PartyControl.cpp.
2019-10-07 13:34:35 +08:00
NovaRain 5cfd5f99e3 Moved object unique id code from ScriptExtender to new Objects.cpp/h
Backported set_unjam_locks_time function from 4.0.
2019-10-07 09:36:46 +08:00
NovaRain dafee58c77 Fixed arg1 of HOOK_INVENWIELD when calling move_obj_inven_to_obj
Moved get/set_proto_data functions from MiscOps.hpp to ObjectsOps.hpp.
2019-10-05 07:53:50 +08:00
NovaRain 4cf0c6688f Improved the implementation of HOOK_INVENWIELD
* it now runs for the player and NPCs when removing equipped items.
* added an additional argument.

Fixed drop_obj script function not removing the equipped armor properly
for the player and party members.
2019-10-04 22:04:05 +08:00
NovaRain 27ec2d24fe Fixed move_obj_inven_to_obj script function
* it didn't remove the equipped armor properly for the player and party
members, resulting in broken armor stats.

Added a check for valid objects to get/set_object_data functions.

Some code edits to HeroAppearance.cpp.
2019-09-30 07:51:43 +08:00
NovaRain e3a3ff2540 Improved file searching for hero appearance mod (#251)
* now it will search files in .dat files and folders simultaneously.

* files in folders have higher priority than .dat files.
2019-09-28 10:52:48 +08:00
NovaRain e6a51f965f Removed NPCStage6Fix from ddraw.ini (always enabled)
Moved the code of NPCStage6Fix to BugFixes.cpp.
(to its original relative location, right above MultiHexPathingFix)

Reorganized some code in BugFixes.cpp.

Tweaked the error printing for ResizeArray in Arrays.cpp.
2019-09-27 20:51:34 +08:00
NovaRain 552a2a185e Refactored code in Arrays.cpp and fixed save_array() script function. 2019-09-24 16:50:50 +08:00
NovaRain 04d47d10ad Some minor changes:
* Improved the display of the car fuel gauge on the world map interface.

* Expanded set_critter_stat function to allow changing STAT_unused and
STAT_dmg_* stats for the player, and STAT_unused for other critters.

* Changed AllowUnsafeScripting to not require sfall debugging mode.

* Changed NPCStage6Fix to be enabled by default.

* Added a new value to AIBestWeaponFix to change the priority multiplier
for having weapon perk to 3x.

Updated version number.
2019-09-24 16:01:39 +08:00
NovaRain 749e248c8b Changed CorpseLineOfFireFix to be enabled by default 2019-09-15 07:18:13 +08:00
NovaRain 52290b09d2 Removed duplicate code from intface_redraw_ engine function
Minor edits to code/documents.
2019-09-14 08:56:05 +08:00
NovaRain a6a8e2e42f Backported HEROWIN, DIALOGVIEW, COUNTERWIN game mode flags from 4.x
Updated UI hotkeys example mod.
2019-09-13 08:09:07 +08:00
NovaRain 9693c0d439 Added "register_hook_proc_spec" script function
Updated documents to address the new function.
2019-09-12 22:23:02 +08:00
NovaRain aa22575ec9 Backported optimization for global/hook scripts execution from 4.x 2019-09-11 13:18:20 +08:00
NovaRain 8f4fd1dec8 Fixed AllowLargeTiles option (broken in 3.8.18)
(due to commit f7fa62a)
2019-09-10 10:09:15 +08:00
NovaRain d26097e9ae Fixed some code in AnimationsAtOnceLimit.cpp
Renamed F1EngineBehavior option to Fallout1Behavior.
2019-09-10 06:53:48 +08:00
NovaRain 4bb9828f3e Added F1EngineBehavior option to change some of F2 engine funcs to F1
* disables playing the final movie/credits after the endgame slideshow.
* disables halving the weight for power armor items.

Moved FastShotFix and Ray's combat_p_proc fix from main.cpp to other
files.
2019-09-09 15:19:37 +08:00
NovaRain 2d2f539826 Added a call to load f2_res.dll library from sfall code
Fixed code that depends on HRP addresses in Tiles.cpp.
2019-09-08 10:46:53 +08:00
NovaRain 97bd2cee18 Changed CriticalOverrides.ini to be parsed only once at game start
* before the ini was always reparsed after each game load/reset. This
should improve the performance.
2019-09-07 21:24:19 +08:00
NovaRain 62f890d287 Removed the dependency of Body_Torso from Body_Uncalled hit modifier
Re-added BodyHit_Torso to ddraw.ini.
Reverted set_bodypart_hit_modifier function to pre-3.7.4 behavior.
2019-09-07 20:16:50 +08:00
NovaRain 4b28829983 Renamed Knockback.cpp/h to Combat.cpp/h and reorganized some code:
* Moved PickpocketMod to skills.cpp.
* Moved CheckWeaponAmmoCost to Combat.cpp.
2019-09-07 12:13:31 +08:00
NovaRain cbb739bd7c Added options for tweaking some engine perks to the perks ini file
Minor code edits to main.cpp and ObjectsOps.hpp.
2019-09-06 13:13:40 +08:00
NovaRain e00d02f1f0 Added a compute damage example script.
Updated compiled scripts due to main.h changes.
2019-09-01 11:38:34 +08:00
NovaRain c9e0feeb32 Increased the width of the car fuel gauge to 2px 2019-09-01 09:03:09 +08:00
NovaRain 272e58d873 Tweaked reordering the execution of functions before exiting the map
Added event clearing for active explosives before exiting the map.

Minor code edit to BARTERPRICE hook.
2019-08-31 20:01:51 +08:00
NovaRain 20cb24b385 Fixed some args in HOOK_BARTERPRICE hook when trading with PM
And added a new argument to indicate trading with a party member.

Refactored register_hook/register_hook_proc with _WRAP_OPCODE.
2019-08-27 22:31:10 +08:00
NovaRain 071581effc Replaced 'Take All' hotkey mod with UI hotkeys mod
Minor edits to code/documents.
2019-08-26 21:53:11 +08:00
NovaRain 155c14f4e7 Fixed player stuck at "climbing" frame after ladder climbing animation
Removed the previous fix about player's direction.

Minor code refactoring in AnimationsAtOnceLimit.cpp (from 4.x)
2019-08-25 10:25:30 +08:00
NovaRain c6d612f4a7 Added MainMenuBigFontColour option to change button text color
Changed the fix for player's direction after climbing ladder (61aa11)
2019-08-23 10:35:17 +08:00
NovaRain 61aa1104a1 Fixed player's position if entrance tile is blocked when entering a map
Fixed player's direction after leaving a map via ladder/stairs.

Fixed MainMenuFontColour not changing the font color for the copyright
text on the main menu (#261)

Code correction in main.cpp.
2019-08-22 13:32:18 +08:00
NovaRain 2bd8a6223d Added OverrideCriticalFile option for specifying alternative crit file
Added code for preparing clearing map_update_event in queue.

Fixed a crash bug in message_str_game function when passing a negative
fileId value.

Corrected/edited some code.
2019-08-20 16:47:37 +08:00
NovaRain 99bc47e3f8 Minor edits to Message.cpp and define_extra.h. 2019-08-17 20:56:48 +08:00
NovaRain 07ff16af75 Added an additional 'Energy Weapon' flag to ext flags in weapon protos
* it forces the weapon to use EW skill regardless of its damage type.

Placed an object with PID 0x5000004 (corpse blood) to the lower z-layer
of the tile.
2019-08-16 15:17:59 +08:00
NovaRain a7ea2a9a81 Set DAM_BACKWASH_ flag for attacker before calling combat damage (#246) 2019-08-14 14:36:35 +08:00
NovaRain 2bbb020a80 Fixed the lost car bug with using the Town/World button
(http://www.nma-fallout.com/threads/fallout-2-vehicle-bug.217993/)
2019-08-13 13:59:20 +08:00
NovaRain 81ba15d451 Rewrote the code of force_encounter functions
Added a new flag to force_encounter_with_flags.
2019-08-12 21:12:28 +08:00
NovaRain 36523d89e5 Fixed obj_art_fid for dude_obj when the hero appearance mod is enabled 2019-08-12 00:13:50 +08:00
NovaRain 53bb9ea5c7 Fixed create_message_window script function
* prevent it from creating multiple message windows.

Capped StartMonth/StartDay in case people didn't notice "0-indexed".
Minor fix for assigning an ID to objects when loading a map.
Small optimization for sfall gl/hs scripts.
2019-08-11 11:04:57 +08:00
NovaRain c0f9f142c4 Added a tweak for weapon perk modifier to AIBestWeaponFix
Minor edits to code/documents.
Updated version number.
2019-08-09 11:59:45 +08:00
NovaRain 8b9ffd08a8 Minor edits to ddraw.ini 2019-07-18 09:27:28 +08:00
NovaRain b26208141f Changed DebugMode to not require enabling sfall debugging mode
Changed version to 3.8.19.1 as maintenance release.
2019-07-17 10:10:28 +08:00
NovaRain 147382de25 Minor code edits to LoadGameHook, PartyControl, ScriptExtender.cpp 2019-07-16 13:01:44 +08:00
NovaRain 9529208c7c Fixed the error handling on loading sfallgv.sav
* to improve backward compatibility with older saved games.
2019-07-15 20:51:29 +08:00
NovaRain fc3b7180af Backported the code of COMBATDAMAGE hook from 4.x
Moved instadeath crit fix from COMBATDAMAGE hook to BugFixes.cpp.
Completed the compute_attack struct.
Updated version number.
2019-07-15 09:59:58 +08:00
NovaRain f53aa16923 Excluded Awareness from perks resetting in PartyControl.cpp 2019-07-14 10:46:56 +08:00
171 changed files with 24373 additions and 16049 deletions
+4 -4
View File
@@ -1,8 +1,8 @@
# sfall
A set of engine modifications for the classic game Fallout 2 in form of a DLL, which modifies executable in memory without changing anything in EXE file itself.
A set of engine modifications for the classic game Fallout 2 in form of a DLL, which modifies executable in memory without changing anything in EXE file itself.
Engine modifications include:
**Engine modifications include:**
- Better support for modern operating systems
- Externalizing many settings like starting map and game time, skills, perks, critical hit tables, books, etc.
- Bug fixes
@@ -10,7 +10,7 @@ Engine modifications include:
- Extended scripting capabilities for modders (many new opcodes to control sfall features as well as previously unavailable vanilla engine functions)
Original author: timeslip
Original author: timeslip
Original description: A set of engine modifications for the classic game Fallout 2 by Interplay. Includes fixes for bugs in the original engine, allows fallout to run correctly on modern operating systems, and adds additional features for modders.
Original description: A set of engine modifications for the classic game Fallout 2 by Interplay. Includes fixes for bugs in the original engine, allows fallout to run correctly on modern operating systems, and adds additional features for modders.
+55 -32
View File
@@ -1,44 +1,62 @@
;This file handles modifications to perks and traits
;When adding extra perks to a mod, it's advisable to use
; the fake perk scripting functions rather than make modifications
; in this file, as some perks have hardcoded effects which may
; catch you out
;Since traits need to be picked before any scripts run, they
; have an additional NoHardcode option in this file which can
;When adding extra perks to a mod, it's advisable to use the fake perk scripting functions rather than make modifications
; in this file, as some perks have hardcoded effects which may catch you out
;Since traits need to be picked before any scripts run, they have an additional NoHardcode option in this file which can
; be used to remove their hardcoded effects, and add new stat/skill effects
;Name=The name of the perk (max 63 characters)
;Desc=The description of the perk (max 255 characters)
;Image=The line number (0-indexed) of the corresponding FRM in skilldex.lst
;Ranks=The number of perk levels
;Level=The minimum required level
;Type=If 0, the perk checks only Skill1 for skill requirements; if 1, it checks
; Skill1 or Skill2; if 2, it checks both Skill1 and Skill2
;Stat=The modified stat or -1 if you don't want to change any stats
;StatMag=The increased/decreased value to the modified stat
;Skill1=The first skill (or -1 for none) to check, but if you set a specific bit
; (67108864 or 0x4000000), it checks GVAR. For example, if Skill1=67108864, then
; the perk will check GVAR_PLAYER_REPUTATION (67108864 + 0) on Skill1Mag value
;Skill1Mag=Positive value is used as the minimum requirements of the first
; skill/GVAR, and a negative value is interpreted as the maximum requirement.
; For example, with Skill1=0 and Skill1Mag=100, if player has small guns skill
; >= 100 and meets all other requirements, the perk will be available in the
; selection window; with Skill1=1 and Skill1Mag=-120, the perk will not be
; available if player has big guns skill >= 120
;Skill2=The second skill/GVAR (or -1 for none) to check
;Skill2Mag=Same as Skill1Mag, but for Skill2
;STR-LCK=Positive values are used as minimum requirements of SPECIAL stats, and
; negative values are interpreted as maximum requirements. For some special
; perks processed by the engine (e.g. PERK_armor_powered and PERK_armor_combat),
; the values are not used as requirements but to add to corresponding SPECIAL
; stats
[PerksTweak]
;Change the penalty distance and distance bonus for 'Weapon Scope Range' weapon perk
;0 - no penalty, 8 - default penalty
WeaponScopeRangePenalty=8
;2 - no bonus, 5 - default bonus
WeaponScopeRangeBonus=5
;Changes the distance bonus for 'Weapon Long Range' weapon perk
;2 - no bonus, 4 - default bonus
WeaponLongRangeBonus=4
;Changes the hit chance bonus for 'Weapon Accurate' weapon perk
;0 - no bonus, 200 - maximum bonus, 20 - default bonus
WeaponAccurateBonus=20
;Changes the strength bonus for 'Weapon Handling' perk
;0 - no bonus, 10 - maximum bonus, 3 - default bonus
WeaponHandlingBonus=3
;##############################################################################
[Perks]
;Set to 1 to enable the modifications for perks
Enable=0
;Name: The name of the perk (max 63 characters)
;Desc: The description of the perk (max 255 characters)
;Image: The line number (0-indexed) of the corresponding FRM in skilldex.lst
;Ranks: The number of perk levels
;Level: The minimum required level
;Type: If 0, the perk checks only Skill1 for skill requirements; if 1, it checks Skill1 or Skill2; if 2, it checks both Skill1 and Skill2
;Stat: The modified stat or -1 if you don't want to change any stats
;StatMag: The increased/decreased value to the modified stat
;Skill1/Skill2: The first/second skill (or -1 for none) to check, but if you set a specific bit 0x4000000 (67108864), it checks GVAR.
; For example, if Skill1=0x4000004, then the perk will check GVAR_BAD_MONSTER (0x4000000 + 4) on Skill1Mag value
;Skill1Mag/Skill2Mag: Positive value is used as the minimum requirements of the first/second skill/GVAR, and a negative value is interpreted as the maximum requirement.
; For example, with Skill1=0 and Skill1Mag=100, if player has small guns skill >= 100 and meets all other requirements, the perk will be available in the
; selection window; with Skill1=1 and Skill1Mag=-120, the perk will not be available if player has big guns skill >= 120
;STR-LCK: Positive values are used as minimum requirements of SPECIAL stats, and negative values are interpreted as maximum requirements.
; For some special perks processed by the engine (e.g. PERK_armor_powered and PERK_armor_combat), the values are not used as requirements
; but to add to corresponding SPECIAL stats
;If the value is set to -99999, the variable will be ignored (similar to comment out that line)
;##############################################################################
;This is a modification to perk 119
[119]
Name=Example
Desc=This is an example perk~Second line
Desc=This is an example perk description
Image=72
Ranks=1
Level=1
@@ -57,6 +75,11 @@ INT=0
AGL=0
LCK=0
;##############################################################################
[Traits]
;Set to 1 to enable the modifications for traits
Enable=0
;This is a modification to trait 0
[t0]
NoHardcode=0
+2 -2
View File
@@ -40,7 +40,7 @@ Image=24
ButtonCount=3
;Set the appearance of the elevator
MainFrm=148
ButtonsFrm=151
MainFrm=148 ; EL_VAULT.FRM
ButtonsFrm=151 ; EL_MIL3.FRM
;Set up the exit points for all three buttons (see examples above)
+210 -121
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.
+35 -29
View File
@@ -12,52 +12,58 @@ Requires sfall 3.5 or higher
*/
#include "..\headers\define_extra.h"
#include "..\headers\sfall\sfall.h"
#include "..\headers\sfall\define_extra.h"
procedure set_ammo_mod;
procedure start;
procedure map_enter_p_proc;
variable ammoIni;
variable ammoData;
variable enabled;
procedure set_ammo_mod begin
variable pid, dmg_mod, i := 1;
while (i > 0) do begin
pid := get_ini_setting(ammoIni + "|" + i + "|pid");
if (pid < 1) then break;
set_proto_data(pid, PROTO_AM_AC_MOD, get_ini_setting(ammoIni + "|" + i + "|ac_adjust"));
set_proto_data(pid, PROTO_AM_DR_MOD, get_ini_setting(ammoIni + "|" + i + "|dr_adjust"));
// dam_mult and dam_div must be positive integers
dmg_mod := get_ini_setting(ammoIni + "|" + i + "|dam_mult");
if (dmg_mod < 1) then dmg_mod := 1;
set_proto_data(pid, PROTO_AM_DMG_MULT, dmg_mod);
dmg_mod := get_ini_setting(ammoIni + "|" + i + "|dam_div");
if (dmg_mod < 1) then dmg_mod := 1;
set_proto_data(pid, PROTO_AM_DMG_DIV, dmg_mod);
i++;
end
//debug_msg("AmmoMod: " + ammoIni + " - set " + (i - 1) + " ammo protos.");
end
procedure start begin
variable i := 1, ammo, ammoPid, dmgMod;
if game_loaded then begin
ammoIni := get_ini_setting("ddraw.ini|Misc|DamageFormula");
if (ammoIni == 1 or ammoIni == 2) then
enabled := get_ini_setting("ddraw.ini|Misc|DamageFormula");
if (enabled == 1 or enabled == 2) then
ammoIni := "AmmoGlovz.ini";
else if (ammoIni == 5) then
else if (enabled == 5) then
ammoIni := "AmmoYAAM.ini";
else
ammoIni := "AmmoMod.ini";
enabled := get_ini_setting(ammoIni + "|1|pid");
if (enabled > 0) then call set_ammo_mod;
if (enabled <= 0) then return;
ammoData := create_array_map;
ammoPid := enabled; // pid from the first section
while (ammoPid > 0) do begin
ammo := create_array_map; // create permanent arrays
ammo.ac_adjust := get_ini_setting(ammoIni + "|" + i + "|ac_adjust");
ammo.dr_adjust := get_ini_setting(ammoIni + "|" + i + "|dr_adjust");
// dam_mult and dam_div must be positive integers
dmgMod := get_ini_setting(ammoIni + "|" + i + "|dam_mult");
ammo.dam_mult := dmgMod if (dmgMod > 0) else 1;
dmgMod := get_ini_setting(ammoIni + "|" + i + "|dam_div");
ammo.dam_div := dmgMod if (dmgMod > 0) else 1;
ammoData[ammoPid] := ammo;
i++;
ammoPid := get_ini_setting(ammoIni + "|" + i + "|pid");
end
call map_enter_p_proc;
debug_msg("Ammo INI Loader mod: " + ammoIni + " - set " + (i - 1) + " ammo protos.");
end
end
procedure map_enter_p_proc begin
if (enabled > 0) then call set_ammo_mod;
variable pid, values;
if (enabled > 0) then begin
foreach (pid: values in ammoData) begin
set_proto_data(pid, PROTO_AM_AC_MOD, values.ac_adjust);
set_proto_data(pid, PROTO_AM_DR_MOD, values.dr_adjust);
set_proto_data(pid, PROTO_AM_DMG_MULT, values.dam_mult);
set_proto_data(pid, PROTO_AM_DMG_DIV, values.dam_div);
end
end
end
Binary file not shown.
@@ -1,14 +1,13 @@
/*
Auto Doors mod v1.1 for Fallout 2 by Mr.Stalin
Auto Doors mod v1.2 for Fallout 2 by Mr.Stalin
----------------------------------------------
- allows the player to automatically open/walk through unlocked doors when not in combat
Requires sfall 3.7b or higher
NOTE: this script requires compiler from sfall modderspack with -s option
(short circuit evaluation)
NOTE: this script requires compiler from sfall modderspack with -s option (short circuit evaluation)
*/
@@ -30,8 +29,8 @@ procedure combatturn_handler;
#define PORTAL (0)
#define DOOR_FLAGS (0x24)
variable only_once := 0;
variable arrayPid;
variable onlyOnce := 0;
variable pidDoors;
procedure start begin
if game_loaded then begin
@@ -41,11 +40,11 @@ procedure start begin
set_global_script_repeat(40); // for sfall 3.x
call map_enter_p_proc;
end else begin
if (only_once == 1 and combat_is_initialized) then begin
only_once := 2;
if (onlyOnce == 1 and combat_is_initialized) then begin
onlyOnce := 2;
call set_door_flag(0); // reset flag when entering combat mode
end else if (only_once == 2 and not(combat_is_initialized)) then begin
only_once := 1;
end else if (onlyOnce == 2 and not(combat_is_initialized)) then begin
onlyOnce := 1;
if (sfall_ver_major >= 4) then set_global_script_repeat(0);
call set_door_flag(FLAG_WALKTHRU); // set flag after combat mode ends
end
@@ -53,34 +52,35 @@ procedure start begin
end
procedure map_enter_p_proc begin
if (arrayPid) then begin
// when changing maps, delete the current array to create a new one
free_array(arrayPid);
arrayPid := 0;
if (pidDoors) then begin
// when changing the map, delete the current array to create a new one
free_array(pidDoors);
pidDoors := 0;
end
only_once := 1;
onlyOnce := 1;
call set_door_flag(FLAG_WALKTHRU); // set flag when entering the map
end
procedure set_door_flag(variable state) begin
variable objectMap, obj, objPid, i;
if (arrayPid) then begin
if (pidDoors) then begin
call set_door_flag_array(state);
return;
end
objectMap := list_as_array(LIST_SCENERY);
arrayPid := create_array(0, 0);
pidDoors := create_array(0, 0);
foreach (obj in objectMap) begin
objPid := obj_pid(obj);
if (proto_data(objPid, sc_type) != PORTAL) or is_in_array(objPid, arrayPid) then
if (proto_data(objPid, sc_type) != PORTAL or get_proto_data(objPid, DOOR_FLAGS) or is_in_array(objPid, pidDoors)) then begin
continue; // next object
end
resize_array(arrayPid, i + 1);
arrayPid[i] := objPid;
resize_array(pidDoors, i + 1);
pidDoors[i] := objPid; // add pid to array
i++;
set_proto_data(objPid, DOOR_FLAGS, state);
end
@@ -88,14 +88,14 @@ end
procedure set_door_flag_array(variable state) begin
variable objPid;
foreach (objPid in arrayPid) begin
foreach (objPid in pidDoors) begin
set_proto_data(objPid, DOOR_FLAGS, state);
end
end
procedure combatturn_handler begin
if (only_once == 1) then begin
only_once := 2;
if (onlyOnce == 1) then begin
onlyOnce := 2;
call set_door_flag_array(0);
set_global_script_repeat(60);
end
@@ -0,0 +1,206 @@
/*
Example algorithm of how the game engine calculates combat damage
*/
#include "..\headers\define.h"
#include "..\headers\command.h"
#include "..\headers\sfall\sfall.h"
#include "..\headers\sfall\define_extra.h"
procedure start;
procedure compute_damage_F2;
procedure item_w_damage_hook;
procedure item_w_subtype(variable weapon, variable hit_mode);
procedure get_ammo_value(variable weapon, variable param);
variable item_w_damage;
procedure start begin
if game_loaded then begin
register_hook_proc(HOOK_COMBATDAMAGE, compute_damage_F2);
register_hook_proc(HOOK_ITEMDAMAGE, item_w_damage_hook);
end
end
procedure compute_damage_F2 begin
variable dmg_type, weapon_perk, dmg_thresh, dmg_resist, weapon_subtype, bonus_ranged, difficulty, i, dmg_mult, dmg_div, damage;
variable target, flags, knockback, amount;
variable
ctdTarget := get_sfall_arg,
ctdSource := get_sfall_arg,
amountTarget := get_sfall_arg,
amountSource := get_sfall_arg,
flagsTarget := get_sfall_arg,
flagsSource := get_sfall_arg,
weapon := get_sfall_arg,
bodypart := get_sfall_arg,
damageMultiplier := get_sfall_arg,
rounds := get_sfall_arg,
amountKnockback := get_sfall_arg,
hit_mode := get_sfall_arg;
if (flagsSource bwand DAM_HIT) then begin
target := ctdTarget;
flags := flagsTarget;
knockback := 1;
end else begin
target := ctdSource;
flags := flagsSource;
knockback := 0;
end
//amount := 0;
if target and (obj_type(target) == OBJ_TYPE_CRITTER) then begin
if weapon then begin
dmg_type := weapon_dmg_type(weapon);
weapon_perk := get_proto_data(obj_pid(weapon), PROTO_WP_PERK);
end else begin
dmg_type := DMG_normal_dam;
weapon_perk := -1;
end
dmg_thresh := get_critter_stat(target, STAT_dmg_thresh + dmg_type);
dmg_resist := get_critter_stat(target, STAT_dmg_resist + dmg_type);
if (flags bwand DAM_BYPASS) and (dmg_type != DMG_emp) then begin
dmg_thresh := dmg_thresh * 20 / 100;
dmg_resist := dmg_resist * 20 / 100;
end else begin
if (weapon_perk == PERK_weapon_penetrate)
or (hit_mode == ATKTYPE_PALMSTRIKE or hit_mode == ATKTYPE_PIERCINGSTRIKE
or hit_mode == ATKTYPE_HOOKKICK or hit_mode == ATKTYPE_PIERCINGKICK) then
dmg_thresh := dmg_thresh * 20 / 100;
if ctdSource == dude_obj and has_trait(TRAIT_TRAIT, ctdSource, TRAIT_finesse) then
dmg_resist += 30;
end
weapon_subtype := item_w_subtype(weapon, hit_mode); // item_w_subtype_
if (ctdSource != dude_obj) or (weapon_subtype != WEAPON_TYPE_GUNS) then
bonus_ranged := 0;
else
bonus_ranged := has_trait(TRAIT_PERK, ctdSource, PERK_bonus_ranged_damage) * 2;
difficulty := 100;
if (has_trait(TRAIT_OBJECT, ctdSource, OBJECT_TEAM_NUM) != has_trait(TRAIT_OBJECT, dude_obj, OBJECT_TEAM_NUM)) then begin
if (combat_difficulty == 0) then
difficulty := 75;
else if (combat_difficulty == 2) then
difficulty := 125;
end
// F2 default start
// Damage = (1 - (DR_armor + DR_ammo_adjust) * (((raw_damage * (dmg_mult * damageMultiplier)) / dmg_div) - dmg_thresh)
dmg_resist += get_ammo_value(weapon, PROTO_AM_DR_MOD); // item_w_dr_adjust_ (DR Adjust %)
if (dmg_resist < 100) then begin
if (dmg_resist < 0) then dmg_resist := 0;
dmg_mult := damageMultiplier * get_ammo_value(weapon, PROTO_AM_DMG_MULT); // item_w_dam_mult_ (Dmg mod A)
dmg_div := get_ammo_value(weapon, PROTO_AM_DMG_DIV); // item_w_dam_div_ (Dmg mod B)
for (i := 1; i <= rounds; i++) begin
damage := (item_w_damage + bonus_ranged) * dmg_mult; // item_w_damage_ (raw_damage)
if dmg_div then damage /= dmg_div;
damage := (((damage / 2) * difficulty) / 100) - dmg_thresh;
if (damage > 0) then begin
damage := damage - ((damage * dmg_resist) / 100); // reduce damage by the percentage of DR_armor + DR_Ammo
if (damage > 0) then amount += damage;
end
end
end
// F2 default end
if (ctdSource == dude_obj) then begin
if has_trait(TRAIT_PERK, ctdSource, PERK_living_anatomy_perk) and (critter_kill_type(ctdTarget) != KILL_TYPE_robot_kills)
and (critter_kill_type(ctdTarget) != KILL_TYPE_alien_kills) then
amount += 5;
if has_trait(TRAIT_PERK, ctdSource, PERK_pyromaniac_perk) and (dmg_type == DMG_fire) then
amount += 5;
end
if knockback and ((get_flags(target) bwand FLAG_MULTIHEX) == 0)
and (dmg_type == DMG_explosion or weapon == 0 or weapon_subtype == WEAPON_TYPE_MELEE)
and ((get_proto_data(obj_pid(target), PROTO_CR_FLAGS) bwand CFLG_NOKNOCKDOWN) == 0) then begin // critter_flag_check_
damage := 0;
if (target == dude_obj) and has_trait(TRAIT_PERK, target, PERK_stonewall_perk) then begin
damage := 1;
if (random(0, 100) < 50) then knockback := 0;
end
if knockback then begin
if (weapon_perk == PERK_weapon_knockback) then
amountKnockback := amount / 5;
else
amountKnockback := amount / 10;
if damage then amountKnockback /= 2;
end
end
end
if (flagsSource bwand DAM_HIT) then begin
display_msg("amountTarget = " + amountTarget+ ", amount = " + amount);
amountTarget := amount;
flagsTarget := flags;
end else begin
display_msg("amountSource = " + amountSource+ ", amount = " + amount);
amountSource := amount;
flagsSource := flags;
end
set_sfall_return(amountTarget);
set_sfall_return(amountSource);
set_sfall_return(flagsTarget);
set_sfall_return(flagsSource);
set_sfall_return(amountKnockback);
end
procedure item_w_damage_hook begin
variable
item_w_damage_min := get_sfall_arg,
item_w_damage_max := get_sfall_arg;
//weapon := get_sfall_arg,
//source := get_sfall_arg,
//hit_mode := get_sfall_arg,
//isMelee := get_sfall_arg;
item_w_damage := (item_w_damage_min + (item_w_damage_max - item_w_damage_min) / 2);
display_msg("item_w_damage_ = " + item_w_damage);
set_sfall_return(item_w_damage);
end
procedure item_w_subtype(variable weapon, variable hit_mode) begin
variable attack_mode, type := WEAPON_TYPE_UNARMED;
if weapon and (hit_mode <= ATKTYPE_RWEP2) then begin
attack_mode := (get_proto_data(obj_pid(weapon), PROTO_IT_FLAGS));
if (hit_mode == ATKTYPE_LWEP2) or (hit_mode == ATKTYPE_RWEP2) then
attack_mode := (attack_mode bwand 0xF0) / 16; // shift 4 bits to the right
else
attack_mode := (attack_mode bwand 0x0F);
if (attack_mode > ATKMODE_PRI_THROW) then
type := WEAPON_TYPE_GUNS;
else if (attack_mode == ATKMODE_PRI_THROW) then
type := WEAPON_TYPE_THROWN;
else if (attack_mode > ATKMODE_PRI_KICK) then
type := WEAPON_TYPE_MELEE;
end
return type;
end
procedure get_ammo_value(variable weapon, variable param) begin
variable pid := -1, value := 0; // default DR value
if weapon then begin
pid := get_weapon_ammo_pid(weapon);
if (pid > -1) then value := get_proto_data(pid, param);
end
if (pid == -1 and param != PROTO_AM_DR_MOD) then value := 1; // default value for Mult/Div
return value;
end
@@ -1,85 +1,104 @@
procedure start;
procedure GetBoozes;
procedure update_shader;
variable perception;
variable boozes;
variable shader1;
variable shader2;
variable shader3;
variable shader4;
variable drunk_level;
variable next_reduction;
variable begin
perception;
boozes;
shader1;
shader2;
shader3;
shader4;
drunk_level;
next_reduction;
booze_pids;
end
procedure start begin
variable new_pe;
variable new_booze;
variable drunk_count;
if (metarule(22,0)) then return;
variable new_pe, new_booze, drunk_count;
if (metarule(22, 0)) then return; //is_loading_game
if (game_loaded) then begin
if(not graphics_funcs_available) then begin
if (not graphics_funcs_available) then begin
display_msg("ERROR: You must set sfall to use graphics mode 4 or 5 to use this mod");
return;
end else begin
//new_pe:=create_object_sid(125, 0, 0, -1);
// pid list of the items for the mod to apply the effect
booze_pids := [/*124,*/ 125];
fix_array(booze_pids);
//new_pe := create_object_sid(125, 0, 0, -1);
//add_mult_objs_to_inven(dude_obj, new_pe, 10);
perception:=get_pc_extra_stat(1);
boozes:=obj_is_carrying_obj_pid(dude_obj, 125);
set_global_script_repeat(25);
set_global_script_repeat(-1);
shader1:=load_shader("booze1.fx");
shader2:=load_shader("booze2.fx");
shader3:=load_shader("booze3.fx");
shader4:=load_shader("booze4.fx");
drunk_level:=0;
next_reduction:=0;
perception := get_pc_extra_stat(1);
boozes := GetBoozes;
set_global_script_repeat(50);
set_global_script_type(1);
shader1 := load_shader("booze1.fx");
shader2 := load_shader("booze2.fx");
shader3 := load_shader("booze3.fx");
shader4 := load_shader("booze4.fx");
//display_msg("Init: " + perception + ", " + boozes);
end
end else begin
new_pe:=get_pc_extra_stat(1);
new_booze:=obj_is_carrying_obj_pid(dude_obj, 125);
if( (perception != new_pe) or (boozes != new_booze) ) then begin
new_pe := get_pc_extra_stat(1);
new_booze := GetBoozes;
if ((perception != new_pe) orElse (boozes != new_booze)) then begin
//display_msg("var change: " + perception + ", " + boozes + " -> " + new_pe + ", " + new_booze);
if ( (perception > new_pe) and (boozes > new_booze) ) then begin
if ( (perception - new_pe) < (boozes - new_booze) ) then begin
drunk_count:=perception - new_pe;
if ((perception > new_pe) andAlso (boozes > new_booze)) then begin
variable pe_diff := perception - new_pe;
variable booze_diff := boozes - new_booze;
if (pe_diff < booze_diff) then begin
drunk_count := pe_diff;
end else begin
drunk_count:=boozes - new_booze;
drunk_count := booze_diff;
end
drunk_level:=drunk_level + (drunk_count*10);
drunk_level += (drunk_count * 10);
//display_msg("Increasing booze count: " + drunk_level);
call update_shader;
next_reduction:=game_time + game_ticks(6);
next_reduction := game_time + game_ticks(6);
end
perception:=new_pe;
boozes:=new_booze;
perception := new_pe;
boozes := new_booze;
end
if( (next_reduction != 0 ) and (game_time >= next_reduction) ) then begin
drunk_level:=drunk_level - 1;
if(drunk_level == 0) then next_reduction:=0;
else next_reduction:=next_reduction + game_ticks(6);
if ((next_reduction != 0) andAlso (game_time >= next_reduction)) then begin
drunk_level -= 1;
if (drunk_level == 0) then
next_reduction := 0;
else
next_reduction += game_ticks(6);
call update_shader;
//display_msg("Decreasing booze count: " + drunk_level);
end
end
end
procedure GetBoozes begin
variable pid, count_booze := 0;
foreach (pid in booze_pids) begin
count_booze += obj_is_carrying_obj_pid(dude_obj, pid);
end
return count_booze;
end
procedure update_shader begin
if(drunk_level >= 100) then begin
if (drunk_level >= 100) then begin
deactivate_shader(shader1);
deactivate_shader(shader2);
deactivate_shader(shader3);
activate_shader(shader4);
end else if(drunk_level >= 50) then begin
end else if (drunk_level >= 50) then begin
deactivate_shader(shader1);
deactivate_shader(shader2);
activate_shader(shader3);
deactivate_shader(shader4);
end else if(drunk_level >= 25) then begin
end else if (drunk_level >= 25) then begin
deactivate_shader(shader1);
activate_shader(shader2);
deactivate_shader(shader3);
deactivate_shader(shader4);
end else if(drunk_level > 0) then begin
end else if (drunk_level > 0) then begin
activate_shader(shader1);
deactivate_shader(shader2);
deactivate_shader(shader3);
@@ -0,0 +1,128 @@
/*************************************************************
LumaSharpen version 1.5.0 for Reshade 3.x
by Christian Cann Schuldt Jensen ~ CeeJay.dk
It blurs the original pixel with the surrounding pixels and then subtracts this blur to sharpen the image.
It does this in luma to avoid color artifacts and allows limiting the maximum sharpning to avoid or lessen halo artifacts.
This is similar to using Unsharp Mask in Photoshop.
Adapted to sfall by Mr.Stalin
*************************************************************/
// Strength of the sharpening
// min 0.1, max 3.0
#define sharp_strength 0.75
// Limits maximum amount of sharpening a pixel receives. This helps avoid "haloing" artifacts which would otherwise occur when you raised the strength too much
// min 0.0, max 1.0, step 0.005
#define sharp_clamp 0.035
// Offset bias adjusts the radius of the sampling pattern. I designed the pattern for an offset bias of 1.0, but feel free to experiment
// min 0.0, max 6.0
#define offset_bias 1.0
//------------------------------------------------------//
// Developer settings //
//------------------------------------------------------//
#define CoefLuma float3(0.2126, 0.7152, 0.0722) // BT.709 & sRBG luma coefficient (Monitors and HD Television)
//#define CoefLuma float3(0.299, 0.587, 0.114) // BT.601 luma coefficient (SD Television)
//#define CoefLuma float3(1.0/3.0, 1.0/3.0, 1.0/3.0) // Equal weight coefficient
sampler s0;
float2 rcpres; // pixel size
float4 LumaSharpenPS(float4 color : COLOR0, float2 tex : TEXCOORD) : COLOR0
{
// Get the original pixel
float3 ori = tex2D(s0, tex).rgb; // ori = original pixel
// Combining the strength and luma multipliers
float3 sharp_strength_luma = (CoefLuma * sharp_strength); // I'll be combining even more multipliers with it later on
//------------------------------------------------------//
// Sampling patterns //
//------------------------------------------------------//
float3 blur_ori;
// [ NW, , NE ] Each texture lookup (except ori)
// [ ,ori, ] samples 4 pixels
// [ SW, , SE ]
// -- Pattern 2 -- A 9 tap gaussian using 4+1 texture fetches.
//
// -- Gaussian filter --
// [ .25, .50, .25] [ 1 , 2 , 1 ]
// [ .50, 1, .50] = [ 2 , 4 , 2 ]
// [ .25, .50, .25] [ 1 , 2 , 1 ]
blur_ori = tex2D(s0, tex + float2(rcpres.x, -rcpres.y) * 0.5 * offset_bias).rgb; // South East
blur_ori += tex2D(s0, tex - rcpres * 0.5 * offset_bias).rgb; // South West
blur_ori += tex2D(s0, tex + rcpres * 0.5 * offset_bias).rgb; // North East
blur_ori += tex2D(s0, tex - float2(rcpres.x, -rcpres.y) * 0.5 * offset_bias).rgb; // North West
blur_ori *= 0.25; // Divide by 4 the number of texture fetches
// -- Pattern 3 -- An experimental 17 tap gaussian using 4+1 texture fetches.
// Wider is less sensitive to noise but also to fine details.
// -- Gaussian filter --
// [ , 4 , 6 , , ]
// [ ,16 ,24 ,16 , 4 ]
// [ 6 ,24 , ,24 , 6 ]
// [ 4 ,16 ,24 ,16 , ]
// [ , , 6 , 4 , ]
//blur_ori = tex2D(s0, tex + rcpres * float2(0.4, -1.2) * offset_bias).rgb; // South South East
//blur_ori += tex2D(s0, tex - rcpres * float2(1.2, 0.4) * offset_bias).rgb; // West South West
//blur_ori += tex2D(s0, tex + rcpres * float2(1.2, 0.4) * offset_bias).rgb; // East North East
//blur_ori += tex2D(s0, tex - rcpres * float2(0.4, -1.2) * offset_bias).rgb; // North North West
//blur_ori *= 0.25; // Divide by the number of texture fetches
//sharp_strength_luma *= 0.51;
// -- Pattern 4 -- A 9 tap high pass (pyramid filter) using 4+1 texture fetches.
// Pyramid has a slightly more aggresive look
// -- Gaussian filter --
// [ .50, .50, .50] [ 1 , 1 , 1 ]
// [ .50, , .50] = [ 1 , , 1 ]
// [ .50, .50, .50] [ 1 , 1 , 1 ]
//blur_ori = tex2D(s0, tex + float2(0.5 * rcpres.x, -rcpres.y * offset_bias)).rgb; // South South East
//blur_ori += tex2D(s0, tex + float2(offset_bias * -rcpres.x, 0.5 * -rcpres.y)).rgb; // West South West
//blur_ori += tex2D(s0, tex + float2(offset_bias * rcpres.x, 0.5 * rcpres.y)).rgb; // East North East
//blur_ori += tex2D(s0, tex + float2(0.5 * -rcpres.x, rcpres.y * offset_bias)).rgb; // North North West
////blur_ori += (2 * ori); // Probably not needed. Only serves to lessen the effect.
//blur_ori /= 4.0; // Divide by the number of texture fetches
//sharp_strength_luma *= 0.666; // Adjust strength to aproximate the strength of pattern 2
//------------------------------------------------------//
// Sharpen //
//------------------------------------------------------//
// Calculate the sharpening --
float3 sharp = ori - blur_ori; // Subtracting the blurred image from the original image
// Adjust strength of the sharpening and clamp it
float4 sharp_strength_luma_clamp = float4(sharp_strength_luma * (0.5 / sharp_clamp), 0.5); // Roll part of the clamp into the dot
//sharp_luma = saturate((0.5 / sharp_clamp) * sharp_luma + 0.5); // scale up and clamp
float sharp_luma = saturate(dot(float4(sharp, 1.0), sharp_strength_luma_clamp)); // Calculate the luma, adjust the strength, scale up and clamp
sharp_luma = (sharp_clamp * 2.0) * sharp_luma - sharp_clamp; // scale down
// Combining the values to get the final sharpened pixel
float3 outputcolor = ori + sharp_luma; // Add the sharpening to the the original.
//------------------------------------------------------//
// Returning the output //
//------------------------------------------------------//
// Show sharpening pattern
// Visualize the strength of the sharpen\nThis is useful for seeing what areas the sharpning affects the most
//outputcolor = saturate(0.5 + (sharp_luma * 4.0)).rrr; //outputcolor = abs(sharp * 4.0);
return float4(saturate(outputcolor), 1);
}
technique LumaSharpen
{
pass P0 { PixelShader = compile ps_2_0 LumaSharpenPS(); }
}
@@ -0,0 +1,255 @@
///////////////////////////////////////////////////////////////////////////////
// Blur filter setting
//
// min: blurFalloff 8, sharpness 10/8
// mid: blurFalloff 6, sharpness 8
// max: blurFalloff 4, sharpness 6
///////////////////////////////////////////////////////////////////////////////
#define blurFalloff 4.0
#define sharpness 6.0
///////////////////////////////////////////////////////////////////////////////
// Sharpen filter setting
//
// min: Sharpen 0.5, EdgeSharpen 1.0
// mid: Sharpen 1.0, EdgeSharpen -0.25
// max: Sharpen 1.75, EdgeSharpen -0.5 (1.5, -0.25)
///////////////////////////////////////////////////////////////////////////////
#define Sharpen 0.5
#define EdgeSharpen 1.0
texture bloomMap;
sampler s0;
sampler BloomSampler : samplerstate
{
Texture = bloomMap;
MinFilter = Linear;
MagFilter = Linear;
AddressU = Clamp;
AddressV = Clamp;
};
// Variables that set the width and height of the current game resolution from sfall (only for global shaders)
int w;
int h;
// the pixel size is computed as: 1.0f / resolution
float2 rcpres;
// system ticks (received from sfall)
//int tickcount;
static const float2 wPass = float2(1, 0);
static const float2 hPass = float2(0, 1);
float Brightness(float3 color)
{
return 0.299 * color.r + 0.587 * color.g + 0.114 * color.b;
}
float3 BlurFunction(float2 uv, float brightness, inout float totalWeight)
{
float3 pointColor = (tex2Dlod(s0, float4(uv, 0, 0)).rgb);
float diff = abs(brightness - Brightness(pointColor));
float weight = exp2((-0.25 * blurFalloff) - (diff * sharpness));
totalWeight += weight;
return pointColor * weight;
}
float4 BlurDeltaPassPS(float2 uv : TEXCOORD0, uniform float2 delta) : COLOR0
{
float3 sumColor = (tex2D(s0, uv).rgb);
float brightness = Brightness(sumColor);
delta *= rcpres;
float totalWeight = 1;
float2 pointUV = uv + delta;
sumColor += BlurFunction(pointUV, brightness, totalWeight);
pointUV = uv - delta;
sumColor += BlurFunction(pointUV, brightness, totalWeight);
return float4((sumColor / totalWeight), 1);
}
static const float2 wDelta = float2(1, 0) * rcpres;
static const float2 hDelta = float2(0, 1) * rcpres;
float4 BlurPS(float4 color : COLOR0, float2 uv : TEXCOORD0) : COLOR0
{
float totalWeight = 1;
float3 sumColor = (tex2D(s0, uv).rgb);
float brightness = Brightness(sumColor);
float2 pointUV = uv + wDelta;
sumColor += BlurFunction(pointUV, brightness, totalWeight);
pointUV = uv - wDelta;
sumColor += BlurFunction(pointUV, brightness, totalWeight);
pointUV = uv + hDelta;
sumColor += BlurFunction(pointUV, brightness, totalWeight);
pointUV = uv - hDelta;
sumColor += BlurFunction(pointUV, brightness, totalWeight);
return float4((sumColor / totalWeight), 1);
}
///////////////////////////////////////////////////////////////////////////////
// Bloom effect setting
//
// min: BloomIntensity .8
// mid: BloomIntensity .85
// max: BloomIntensity .9
///////////////////////////////////////////////////////////////////////////////
#define BaseIntensity 1.2
#define BaseSaturation 1.0
#define BloomIntensity 0.8
#define BloomSaturation 0.35
#define BloomThreshold 0.35
#define BlurPower 0.002
// pseudo gauss blur
static const float2 offsets[12] = {
-0.326212, -0.405805,
-0.840144, -0.073580,
-0.695914, 0.457137,
-0.203345, 0.620716,
0.962340, -0.194983,
0.473434, -0.480026,
0.519456, 0.767022,
0.185461, -0.893124,
0.507431, 0.064425,
0.896420, 0.412458,
-0.321940, -0.932615,
-0.791559, -0.597705,
};
float4 AdjustSaturation(float4 color, float saturation)
{
float grey = dot(color, float3(0.3, 0.59, 0.11));
return lerp(grey, color, saturation);
}
float4 BloomPS(float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
float4 original = tex2D(s0, texCoord);
original = AdjustSaturation(original, BaseSaturation) * BaseIntensity;
float sum = (original.r + original.g + original.b) * 0.333;
if (sum >= 0.95) return original;
// bloom blur
float4 bloomBlur = tex2D(s0, texCoord);
for(int i = 0; i < 12; i++)
{
bloomBlur += tex2D(s0, texCoord + BlurPower * offsets[i]);
}
bloomBlur *= 0.085;
float intensity = BloomIntensity - lerp(0.0, 0.2, sum);
bloomBlur = AdjustSaturation(bloomBlur, BloomSaturation) * intensity;
bloomBlur = saturate((bloomBlur - BloomThreshold) / (1 - BloomThreshold));
return bloomBlur + original;
}
static const float CoefBlur = (Sharpen * 0.5);
static const float CoefOrig = (1 + CoefBlur);
// for the sharpen edge
#define SharpenEdge 0.4
static const float sharpenVal0 = (Sharpen * (1.5 + EdgeSharpen));
static const float sharpenVal1 = ((sharpenVal0 - 1) / 8.0);
// pixel "width"
static const float px = rcpres.x;
static const float py = rcpres.y;
// for the blur filter
#define mean 1.0
static const float dx = (mean * px);
static const float dy = (mean * py);
float4 SharpenComplexPS(float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
float4 c0 = tex2D(s0, texCoord); // get original pixel
// edge detection
// Get neighbor points
// [ c1, c2, c3 ]
// [ c4, c0, c5 ]
// [ c6, c7, c8 ]
float4 c1 = tex2D(s0, texCoord + float2(-px, -py));
float4 c2 = tex2D(s0, texCoord + float2( 0, -py));
float4 c3 = tex2D(s0, texCoord + float2( px, -py));
float4 c4 = tex2D(s0, texCoord + float2(-px, 0));
float4 c5 = tex2D(s0, texCoord + float2( px, 0));
float4 c6 = tex2D(s0, texCoord + float2(-px, py));
float4 c7 = tex2D(s0, texCoord + float2( 0, py));
float4 c8 = tex2D(s0, texCoord + float2( px, py));
// using Sobel filter
// horizontal gradient
// [ -1, 0, 1 ]
// [ -2, 0, 2 ]
// [ -1, 0, 1 ]
float delta1 = (c3 + 2 * c5 + c8) - (c1 + 2 * c4 + c6);
// vertical gradient
// [ -1, - 2, -1 ]
// [ 0, 0, 0 ]
// [ 1, 2, 1 ]
float4 c13 = c1 + c3;
float4 c68 = c6 + c8;
float delta2 = (c68 + 2 * c7) - (c13 + 2 * c2);
// computation
if (sqrt(mul(delta1, delta1) + mul(delta2, delta2)) > SharpenEdge) {
// if we have an edge, use sharpen
return c0 * sharpenVal0 - (c13 + c2 + c4 + c5 + c68 + c7) * sharpenVal1;
// Display edges in red...
//return float4( 1.0, 0.0, 0.0, 0.0 );
} else {
// else return corrected image
// compute blurred image (gaussian filter)
c1 = tex2D(s0, texCoord + float2(-dx, -dy));
c2 = tex2D(s0, texCoord + float2( 0, -dy));
c3 = tex2D(s0, texCoord + float2( dx, -dy));
c4 = tex2D(s0, texCoord + float2(-dx, 0));
c5 = tex2D(s0, texCoord + float2( dx, 0));
c6 = tex2D(s0, texCoord + float2(-dx, dy));
c7 = tex2D(s0, texCoord + float2( 0, dy));
c8 = tex2D(s0, texCoord + float2( dx, dy));
// gaussian filter
// [ 1, 2, 1 ]
// [ 2, 4, 2 ]
// [ 1, 2, 1 ]
// to normalize the values, we need to divide by the coeff sum
float4 flou = (c1 + c3 + c6 + c8 + 2 * (c2 + c4 + c5 + c7) + 4 * c0) * 0.0625; // 1 / (1+2+1+2+4+2+1+2+1) = 1 / 16 = 0.0625
// substract blurred image from original image
return (CoefOrig * c0 - CoefBlur * flou);
}
}
technique BlurBloom
{
//pass P0 { PixelShader = compile ps_3_0 BlurDeltaPassPS(wPass); }
//pass P1 { PixelShader = compile ps_3_0 BlurDeltaPassPS(hPass); }
pass P0 { PixelShader = compile ps_3_0 BlurPS(); }
pass P3 { PixelShader = compile ps_2_0 BloomPS(); }
pass P2 { PixelShader = compile ps_2_0 SharpenComplexPS(); }
}
@@ -0,0 +1,106 @@
// Shader from Media Player Classic - Home Cinema
// Adapted to sfall by Mr.Stalin
///////////////////////////////////////////////////////////////////////////////
// Sharpen filter setting
//
// min: Sharpen 0.5, EdgeSharpen 1.0
// mid: Sharpen 1.0, EdgeSharpen -0.25
// max: Sharpen 1.75, EdgeSharpen -0.5 (1.5, -0.25)
///////////////////////////////////////////////////////////////////////////////
#define Sharpen 0.5
#define EdgeSharpen 1.1
sampler s0;
// Variables that set the width and height of the current game resolution from sfall
float w;
float h;
float2 rcpres; // pixel size
static const float CoefBlur = (Sharpen * 0.5);
static const float CoefOrig = (1 + CoefBlur);
// for the sharpen edge
#define SharpenEdge 0.4
static const float sharpenVal0 = (Sharpen * (1.5 + EdgeSharpen));
static const float sharpenVal1 = ((sharpenVal0 - 1) / 8.0);
// pixel "width"
static const float px = rcpres.x;
static const float py = rcpres.y;
// for the blur filter
#define mean 1.0
static const float dx = (mean * px);
static const float dy = (mean * py);
float4 SharpenComplexPS(float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
float4 c0 = tex2D(s0, texCoord); // get original pixel
// edge detection
// Get neighbor points
// [ c1, c2, c3 ]
// [ c4, c0, c5 ]
// [ c6, c7, c8 ]
float4 c1 = tex2D(s0, texCoord + float2(-px, -py));
float4 c2 = tex2D(s0, texCoord + float2( 0, -py));
float4 c3 = tex2D(s0, texCoord + float2( px, -py));
float4 c4 = tex2D(s0, texCoord + float2(-px, 0));
float4 c5 = tex2D(s0, texCoord + float2( px, 0));
float4 c6 = tex2D(s0, texCoord + float2(-px, py));
float4 c7 = tex2D(s0, texCoord + float2( 0, py));
float4 c8 = tex2D(s0, texCoord + float2( px, py));
// using Sobel filter
// horizontal gradient
// [ -1, 0, 1 ]
// [ -2, 0, 2 ]
// [ -1, 0, 1 ]
float delta1 = (c3 + 2 * c5 + c8) - (c1 + 2 * c4 + c6);
// vertical gradient
// [ -1, - 2, -1 ]
// [ 0, 0, 0 ]
// [ 1, 2, 1 ]
float4 c13 = c1 + c3;
float4 c68 = c6 + c8;
float delta2 = (c68 + 2 * c7) - (c13 + 2 * c2);
// computation
if (sqrt(mul(delta1, delta1) + mul(delta2, delta2)) > SharpenEdge) {
// if we have an edge, use sharpen
return c0 * sharpenVal0 - (c13 + c2 + c4 + c5 + c68 + c7) * sharpenVal1;
// Display edges in red...
//return float4( 1.0, 0.0, 0.0, 0.0 );
} else {
// else return corrected image
// compute blurred image (gaussian filter)
c1 = tex2D(s0, texCoord + float2(-dx, -dy));
c2 = tex2D(s0, texCoord + float2( 0, -dy));
c3 = tex2D(s0, texCoord + float2( dx, -dy));
c4 = tex2D(s0, texCoord + float2(-dx, 0));
c5 = tex2D(s0, texCoord + float2( dx, 0));
c6 = tex2D(s0, texCoord + float2(-dx, dy));
c7 = tex2D(s0, texCoord + float2( 0, dy));
c8 = tex2D(s0, texCoord + float2( dx, dy));
// gaussian filter
// [ 1, 2, 1 ]
// [ 2, 4, 2 ]
// [ 1, 2, 1 ]
// to normalize the values, we need to divide by the coeff sum
float4 flou = (c1 + c3 + c6 + c8 + 2 * (c2 + c4 + c5 + c7) + 4 * c0) * 0.0625; // 1 / (1+2+1+2+4+2+1+2+1) = 1 / 16 = 0.0625
// substract blurred image from original image
return (CoefOrig * c0 - CoefBlur * flou);
}
}
technique SharpenT
{
pass P0 { PixelShader = compile ps_2_0 SharpenComplexPS(); }
}
@@ -1,30 +1,48 @@
#ifndef MAIN_H
#define MAIN_H
#include "..\scripting\headers\sfall.h"
#include "..\scripting\headers\define_lite.h"
#include "..\scripting\headers\define_extra.h"
#include "..\scripting\headers\dik.h"
/*
#include "..\scripting\headers\lib.arrays.h"
#include "..\scripting\headers\lib.strings.h"
// #include "..\scripting\headers\lib.inven.h"
#include "..\scripting\headers\lib.inven.h"
*/
variable ini := "sfall-mods.ini";
variable translationIni;
// Gets the integer value from ini
// Gets the integer value from the specified ini
procedure GetIniConfig(variable section, variable key, variable def, variable inifile) begin
variable val := get_ini_setting(inifile + "|" + section + "|" + key);
if val == -1 then val := def;
return val;
end
// Gets the string value from the specified ini
procedure GetIniConfigStr(variable section, variable key, variable def, variable inifile) begin
variable val := get_ini_string(inifile + "|" + section + "|" + key);
if val == -1 or val == "" then val := def;
return val;
end
// Gets the integer value from sfall-mods.ini
procedure GetConfig(variable section, variable key, variable def) begin
variable val := get_ini_setting(ini + "|" + section + "|" + key);
if val == -1 then val := def;
return val;
end
// Gets the string value from ini
// Gets the string value from sfall-mods.ini
procedure GetConfigStr(variable section, variable key, variable def) begin
variable val := get_ini_string(ini + "|" + section + "|" + key);
if val == -1 or val == "" then val := def;
return val;
end
// Gets the value from ini as a temp array of strings
// Gets the value from sfall-mods.ini as a temp array of strings
procedure GetConfigList(variable section, variable key) begin
variable val := get_ini_string(ini + "|" + section + "|" + key);
if val == -1 or val == "" then return [];
@@ -32,7 +50,7 @@ procedure GetConfigList(variable section, variable key) begin
return string_split(val, ",");
end
// Gets the value from ini as a temp array of ints
// Gets the value from sfall-mods.ini as a temp array of ints
procedure GetConfigListInt(variable section, variable key) begin
variable arr, i, item;
@@ -53,5 +71,7 @@ procedure Translate(variable id, variable def) begin
end
procedure InitConfigs begin
translationIni := GetConfigStr("Main", "TranslationsINI", "./Translations.ini");
translationIni := GetIniConfigStr("Main", "TranslationsINI", "Translations.ini", "ddraw.ini");
end
#endif
+2 -2
View File
@@ -1,5 +1,5 @@
Master Theif cheat for fallout 2 by phobos2077
----------------------------------------
Master Thief cheat for fallout 2 by phobos2077
----------------------------------------------
- forces all steal attempts to succeed
@@ -1,20 +0,0 @@
procedure start;
// adjust include paths if needed
#include "..\..\scripting_docs\headers\sfall.h"
#include "..\..\scripting_docs\headers\dik.h"
procedure start begin
if game_loaded then begin
register_hook(HOOK_KEYPRESS);
end else begin
variable
event := get_sfall_arg,
keyDX := get_sfall_arg;
if (event == 1) and (keyDX == DIK_SEMICOLON) then begin
tap_key(DIK_CAPITAL);
tap_key(DIK_A);
tap_key(DIK_CAPITAL);
end
end
end
@@ -1,9 +0,0 @@
"Take All" Hotkey mod for Fallout 2 by NovaRain
----------------------------------------
- makes pressing the semicolon key send an uppercase A after a semicolon.
- 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.
To use, copy *.int file to your scripts folder.
This mod is a simple example of how you can use HOOK_KEYPRESS hooks.

Some files were not shown because too many files have changed in this diff Show More