Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
NovaRain committed Oct 17, 2020
2 parents 69ccc1c + 6d412e9 commit 914c653
Show file tree
Hide file tree
Showing 77 changed files with 3,043 additions and 1,735 deletions.
43 changes: 23 additions & 20 deletions artifacts/ddraw.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
;sfall configuration settings
;v4.2.7
;v4.2.8

[Main]
;Change to 1 if you want to use command line args to tell sfall to use another ini file.
Expand Down Expand Up @@ -44,7 +44,7 @@ SpeedMulti9=900
;The initial speed at game startup
SpeedMultiInitial=100

;Set to 1 to also affect the playback speed of mve video files without an audio track
;Set to 1 to also affect the playback speed of MVE video files without an audio track
AffectPlayback=0

;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Expand All @@ -69,8 +69,14 @@ WindowData=0

;Uncomment the option to use a hardware shader (requires DX9 graphics mode)
;The shader file <name>.fx must be placed in <GameRoot>\<master_patches>\shaders\ and must contain one technique with one or more passes
;You can specify multiple shader files, separated by commas
;GlobalShaderFile=global.fx

;Set to 1 to automatically enable linear texture filtering when the scale factor is not an integer
;Set to 2 to force-enable linear texture filtering
;This can be used in conjunction with the GlobalShaderFile option
TextureFilter=1

;Set to 1 to do the palette conversion on the GPU
;Set to 2 to do the palette conversion on the CPU
;Set to 0 to pick automatically
Expand All @@ -84,8 +90,8 @@ GPUBlt=0
;Requires DX9 graphics mode and v2.0 pixel shader support (see GPUBlt option)
Use32BitHeadGraphics=0

;Set to 1 to automatically search for alternative avi video files when Fallout tries to play the game movies
;Set to 2 to force avi videos to fit the screen width
;Set to 1 to automatically search for alternative AVI video files when Fallout tries to play the game movies
;Set to 2 to force AVI videos to fit the screen width
;Requires DX9 graphics mode
AllowDShowMovies=0

Expand Down Expand Up @@ -128,8 +134,8 @@ NumSoundBuffers=0
;Set to 1 to allow attaching sound files to combat float messages
AllowSoundForFloats=0

;Set to 1 to automatically search for alternative formats (mp3/wma/wav) when Fallout tries to play an acm
;Set to 2 to play alternative music files even if original acm files are not present in the music folder
;Set to 1 to automatically search for alternative formats (mp3/wma/wav) when Fallout tries to play an ACM
;Set to 2 to play alternative music files even if original ACM files are not present in the music folder
;This does not effect the play_sfall_sound and stop_sfall_sound script functions
AllowDShowSound=0

Expand Down Expand Up @@ -371,9 +377,9 @@ SaveInCombatFix=1
;Player's level is capped once the highest specified level is reached
;XPTable=50,100,200

;Set to 1 to enable additional weapon animation codes from o-t
;Set to 1 to enable additional weapon animation codes from o to t
;The 4 byte value at 0x39 of weapon protos may range from 0 to 15 rather than 0 to 10
;Since the letters 'n' and 'r' are in use for other animations, an animation code of 11 corrisponds to 's' and 15 to 't'
;Since the letters 'n' and 'r' are in use for other animations, an animation code of 11 corresponds to 's' and 15 to 't'
AdditionalWeaponAnims=1

;Uncomment these lines to modify the default modifiers for aimed shots at specific bodyparts
Expand Down Expand Up @@ -534,10 +540,11 @@ RemoveCriticalTimelimits=0
;Change the colour of the font used on the main menu for the button text
;MainMenuBigFontColour=0x3C

;Two alternate fixes to the interaction between HtH attacks and the fast shot trait
;0 - Fallout 2 original behaviour
;1 - Haenlomal's fix, called shots are enabled for HtH attacks
;2 - Restoring the -1 AP bonus for HtH attacks (i.e. Fallout 1 behaviour)
;Alternative behaviors to the Fast Shot trait
;0 - Fallout 2 original behavior: -1 AP cost for ranged weapons; aimed attacks are disabled
;1 - Haenlomal's fix: aimed attacks are enabled for melee/unarmed weapons and HtH attacks
;2 - Alternative behavior: apply -1 AP cost to melee/unarmed weapons and HtH attacks
;3 - Fallout 1 original behavior: -1 AP cost for all weapons; aimed attacks are disabled
FastShotFix=1

;Set to 1 to boost the maximum number of script names from 1450 to 10000
Expand All @@ -556,8 +563,10 @@ CritterInvSizeLimit=100
;2 - Motion sensor doesn't require charges
MotionScannerFlags=1

;Set to non-0 to adjust the maximum encounter table size
;Default is 40, and the maximum is 127
;Set a value greater than 40 to change the maximum encounter table size (enc_## in worldmap.txt)
;Default is 40, and the maximum is 100
;Note: Setting this greater than 50 requires renumbering all message lines for the encounter tables in worldmap.msg
;The messages for each table must be numbered from (3000 + table number * 100) to (3099 + table number * 100)
EncounterTableSize=0

;Set to 1 to disable the pipboy alarm button
Expand Down Expand Up @@ -701,9 +710,6 @@ WorldMapFontPatch=0
;Requires changing the color of subtitles in death.pal palette to white color (index 220) to display the text correctly
DeathScreenFontPatch=0

;Set to 1 to keep the selected attack mode when moving the weapon between active item slots
KeepWeaponSelectMode=1

;Set to 1 to display full item description for weapon/ammo in the barter screen
FullItemDescInBarter=0

Expand All @@ -724,9 +730,6 @@ PartyMemberSkillFix=0
;Set to 2 to also skip loading the game/combat difficulty settings
SkipLoadingGameSettings=0

;Set to 1 to prevent the inventory/loot/automap interfaces from being placed on top of other script-created windows
InterfaceDontMoveOnTop=0

;Overrides the global variable number used to show the special death message of the Modoc toilet explosion
;Set to -1 to disable the special death message when the global variable is set
SpecialDeathGVAR=491
Expand Down
Binary file modified artifacts/example_mods/AmmoMod/gl_ammomod.int
Binary file not shown.
64 changes: 35 additions & 29 deletions artifacts/example_mods/AmmoMod/gl_ammomod.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -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 modified artifacts/example_mods/GetDrunk/Data/scripts/glbooze.int
Binary file not shown.
105 changes: 62 additions & 43 deletions artifacts/example_mods/GetDrunk/Data/scripts/glbooze.ssl
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
Loading

0 comments on commit 914c653

Please sign in to comment.