mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29da6d7071 | ||
|
|
ec4a58e19e | ||
|
|
b023999c5e | ||
|
|
ee711d8f81 | ||
|
|
d26a06872a | ||
|
|
c4f8912490 | ||
|
|
d9a440f667 | ||
|
|
49bc2d3241 | ||
|
|
d07603f1b0 | ||
|
|
76346c24b3 | ||
|
|
dee3e2f596 | ||
|
|
648eb9b2f1 | ||
|
|
fcbf4d3972 | ||
|
|
3ef6056a77 | ||
|
|
ac10bce231 | ||
|
|
6780a21b07 | ||
|
|
25fabde434 | ||
|
|
da7cd2a060 | ||
|
|
8924257aee | ||
|
|
90ef9e273d | ||
|
|
b447e8e9b8 | ||
|
|
3744c0b165 | ||
|
|
c98af496b3 | ||
|
|
c7eaff7ff5 | ||
|
|
37acec7115 | ||
|
|
f6ec543f40 | ||
|
|
5cfd5f99e3 | ||
|
|
dafee58c77 | ||
|
|
4cf0c6688f | ||
|
|
27ec2d24fe | ||
|
|
e3a3ff2540 | ||
|
|
e6a51f965f | ||
|
|
552a2a185e | ||
|
|
04d47d10ad | ||
|
|
749e248c8b | ||
|
|
52290b09d2 | ||
|
|
a6a8e2e42f | ||
|
|
9693c0d439 | ||
|
|
aa22575ec9 | ||
|
|
8f4fd1dec8 | ||
|
|
d26097e9ae | ||
|
|
4bb9828f3e | ||
|
|
2d2f539826 | ||
|
|
97bd2cee18 | ||
|
|
62f890d287 | ||
|
|
4b28829983 | ||
|
|
cbb739bd7c | ||
|
|
e00d02f1f0 | ||
|
|
c9e0feeb32 | ||
|
|
272e58d873 | ||
|
|
20cb24b385 | ||
|
|
071581effc | ||
|
|
155c14f4e7 | ||
|
|
c6d612f4a7 | ||
|
|
61aa1104a1 | ||
|
|
2bd8a6223d | ||
|
|
99bc47e3f8 | ||
|
|
07ff16af75 | ||
|
|
a7ea2a9a81 | ||
|
|
2bbb020a80 | ||
|
|
81ba15d451 | ||
|
|
36523d89e5 | ||
|
|
53bb9ea5c7 | ||
|
|
c0f9f142c4 | ||
|
|
8b9ffd08a8 | ||
|
|
b26208141f | ||
|
|
147382de25 | ||
|
|
9529208c7c | ||
|
|
fc3b7180af | ||
|
|
f53aa16923 |
@@ -7,6 +7,30 @@
|
||||
; have an additional NoHardcode option in this file which can
|
||||
; be used to remove their hardcoded effects, and add new stat/skill effects
|
||||
|
||||
[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
|
||||
@@ -35,6 +59,7 @@
|
||||
|
||||
;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
|
||||
@@ -57,6 +82,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
|
||||
|
||||
+45
-30
@@ -1,5 +1,5 @@
|
||||
;sfall configuration settings
|
||||
;v3.8.19
|
||||
;v3.8.21
|
||||
|
||||
[Main]
|
||||
;Change to 1 if you want to use command line args to tell sfall to use another ini file.
|
||||
@@ -15,7 +15,7 @@ UseCommandLine=0
|
||||
NumSoundBuffers=0
|
||||
|
||||
;Set to 1 to allow attaching sound files to combat float messages
|
||||
AllowSoundForFloats=1
|
||||
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
|
||||
@@ -78,7 +78,7 @@ GPUBlt=0
|
||||
Use32BitHeadGraphics=0
|
||||
|
||||
;Set to 1 to automatically search for alternative avi video files when Fallout tries to play the game movies
|
||||
;Requires graphics mode 4 or 5
|
||||
;Requires DX9 graphics mode 4 or 5
|
||||
AllowDShowMovies=0
|
||||
|
||||
;Fade effect time percentage modifier
|
||||
@@ -178,6 +178,11 @@ DebugEditorKey=0
|
||||
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
[Misc]
|
||||
;Changes some of Fallout 2 engine functions to Fallout 1 behavior:
|
||||
;- disables playing the final movie/credits after the endgame slideshow
|
||||
;- disables halving the weight for power armor items
|
||||
Fallout1Behavior=0
|
||||
|
||||
;Time limit in years. Must be between -3 and 13
|
||||
;Set to 0 if you want to die the instant you leave arroyo
|
||||
;Set to -1 to remove the time limit, and automatically reset the date back to 2241 each time you would have reached it
|
||||
@@ -255,7 +260,7 @@ Movie16=artimer4.mve
|
||||
Movie17=credits.mve
|
||||
|
||||
;To change the starting year, month or day, uncomment the next 3 lines
|
||||
;Both StartMonth and StartDay are 0-indexed
|
||||
;Both StartMonth and StartDay are 0-indexed (i.e. 0 is January or the first day of a month)
|
||||
;StartYear=-1
|
||||
;StartMonth=-1
|
||||
;StartDay=-1
|
||||
@@ -319,7 +324,7 @@ OverrideArtCacheSize=0
|
||||
;Set to 2 to block all saving in combat
|
||||
SaveInCombatFix=1
|
||||
|
||||
;Point at an ini file containing elevator data
|
||||
;Point to an ini file containing elevator data
|
||||
;ElevatorsFile=Elevators.ini
|
||||
|
||||
;Uncomment and set a comma delimited list of numbers to use a custom xp table.
|
||||
@@ -332,14 +337,17 @@ SaveInCombatFix=1
|
||||
AdditionalWeaponAnims=1
|
||||
|
||||
;Uncomment these lines to modify the default modifiers for aimed shots at specific bodyparts
|
||||
;Modifiers affect both NPCs and the player
|
||||
;BodyHit_Head=-40
|
||||
;BodyHit_Left_Arm=-30
|
||||
;BodyHit_Right_Arm=-30
|
||||
;BodyHit_Torso_Uncalled=0
|
||||
;BodyHit_Torso=0
|
||||
;BodyHit_Right_Leg=-20
|
||||
;BodyHit_Left_Leg=-20
|
||||
;BodyHit_Eyes=-60
|
||||
;BodyHit_Groin=-30
|
||||
;The modifier for unaimed shots
|
||||
;BodyHit_Torso_Uncalled=0
|
||||
|
||||
;Set to 1 to use a CriticalOverrides.ini file to override the default critical table
|
||||
;Set to 2 to use the default critical with bug fixes (doesn't require an ini)
|
||||
@@ -347,6 +355,8 @@ AdditionalWeaponAnims=1
|
||||
;If the ExtraKillTypes option is enabled, this should be set to 3, with containing entries for any new types
|
||||
;Must be non-zero to use the edit/get/reset_critical script functions
|
||||
OverrideCriticalTable=2
|
||||
;To change the path and filename of the critical table file, uncomment the next line
|
||||
;OverrideCriticalFile=CriticalOverrides.ini
|
||||
|
||||
;Set to 1 to get notification of karma changes in the notification window
|
||||
DisplayKarmaChanges=0
|
||||
@@ -357,9 +367,6 @@ AlwaysReloadMsgs=0
|
||||
;Set to 1 to force the player to play the idle animation when reloading their weapon
|
||||
PlayIdleAnimOnReload=0
|
||||
|
||||
;Set to 1 to prevent corpses from blocking line of fire
|
||||
CorpseLineOfFireFix=0
|
||||
|
||||
;Changes the timer (in days) for deleting corpses on a map after you leave (valid range: 0..13)
|
||||
;The corpses of critters with 'Ages' flag or on maps with 'dead_bodies_age=No' set in maps.txt will not disappear
|
||||
;Default is 6. Set to 0 for a 12-hour timer
|
||||
@@ -372,6 +379,7 @@ CorpseDeleteTime=6
|
||||
ProcessorIdle=-1
|
||||
|
||||
;Set to 1 if using the hero appearance mod
|
||||
;Set to 2 for backward compatibility with scripts that manually fix obj_art_fid/art_change_fid_num script functions for dude_obj
|
||||
;You can add AppChCrt.frm and AppChEdt.frm files to art\intrface\ to set a custom background for the character screen
|
||||
EnableHeroAppearanceMod=0
|
||||
|
||||
@@ -384,8 +392,9 @@ SkipOpeningMovies=0
|
||||
;Set to 0 to disable
|
||||
NPCsTryToSpendExtraAP=0
|
||||
|
||||
;Set to 1 to fix NPCs not checking weapon perks properly when searching for the best weapon
|
||||
;Note that enabling this option can significantly affect the weapon choice of some NPCs in combat
|
||||
;Set to 1 to fix NPCs not checking weapon perks properly when choosing the best weapon in combat
|
||||
;Set to 2 to change the priority multiplier for having weapon perk to 3x (the original is 5x)
|
||||
;Note that enabling this option can significantly affect the weapon of choice for some NPCs
|
||||
AIBestWeaponFix=0
|
||||
|
||||
;Set to 1 to fix NPCs not taking chem_primary_desire in AI.txt as drug use preference when using drugs in their inventory
|
||||
@@ -420,12 +429,12 @@ UseScrollingQuestsList=1
|
||||
|
||||
;Uncomment these lines to control the premade characters offered when starting a new game
|
||||
;Multiple options should be separated by commas, and there must be the same number of entries in both lines
|
||||
;Each name in PremadePaths is limited to 11 characters
|
||||
;PremadePaths=combat,diplomat,stealth
|
||||
;PremadeFIDs=201,203,202
|
||||
|
||||
;Use this line to modify the list of cities and their associated global variables used for city reputations
|
||||
;Syntax is 'city id:global id', with each city/global pair separated by a comma.
|
||||
;CityRepsCount=19
|
||||
;CityRepsList=0:47,2:48,1:49,4:50,5:51,3:52,8:53,6:54,7:55,13:56,10:57,11:59,14:61,17:63,19:64,18:65,25:66,9:294,20:308
|
||||
|
||||
;Set this to a valid path to save a copy of the console contents
|
||||
@@ -441,7 +450,6 @@ SpeedInterfaceCounterAnims=0
|
||||
|
||||
;These lines allow you to control the karma FRMs displayed on the character screen
|
||||
;Number of KarmaPoints should be 1 less than number of KarmaFRMs
|
||||
;KarmaFRMsCount=3
|
||||
;KarmaFRMs=47,48,49
|
||||
;KarmaPoints=-100,100
|
||||
|
||||
@@ -452,8 +460,11 @@ ScienceOnCritters=0
|
||||
;Default is 166
|
||||
SpeedInventoryPCRotation=166
|
||||
|
||||
;Uncomment to set the text colour of the extra 5 interface boxes
|
||||
;The line must contain 5 digits, each either a 0 for green or 1 for red
|
||||
;Modify the number of the extra interface boxes available to modders. (Default is 5, and the maximum is 95)
|
||||
BoxBarCount=5
|
||||
|
||||
;Uncomment to set the text colour of the extra interface boxes
|
||||
;The line must contain the same number of digits as the value of BoxBarCount, each either a 0 for green or 1 for red
|
||||
;BoxBarColours=00000
|
||||
|
||||
;Set to 1 to fix the bug that caused bonus HtH damage to not be applied correctly.
|
||||
@@ -471,12 +482,11 @@ AnimationsAtOnceLimit=120
|
||||
;Set to 1 to remove the limits that stop the player rolling critical successes/misses in the first few days of game time
|
||||
RemoveCriticalTimelimits=0
|
||||
|
||||
;Set to 1 to enable party members with level 6 protos to reach level 6
|
||||
NPCStage6Fix=0
|
||||
|
||||
;Change the colour of the font used on the main menu for the Fallout/sfall version number
|
||||
;It's the last byte ('3c' by default) that picks the colour used. The first byte supplies additional flags
|
||||
;MainMenuFontColour=0x0600003c
|
||||
;Change the colour of the font used on the main menu for the Fallout/sfall version number and copyright text
|
||||
;It's the last byte ('3C' by default) that picks the colour used. The first byte supplies additional flags for this option
|
||||
;MainMenuFontColour=0x00003C
|
||||
;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
|
||||
@@ -488,7 +498,7 @@ FastShotFix=1
|
||||
BoostScriptDialogLimit=0
|
||||
|
||||
;Allows you to edit the skill tables
|
||||
;Point the next line at an ini file containing the replacement skill data
|
||||
;Point the next line to an ini file containing the replacement skill data
|
||||
;SkillsFile=Skills.ini
|
||||
|
||||
;To change the relationship between SPECIAL stats and derived stats, uncomment the next line
|
||||
@@ -612,7 +622,7 @@ StackEmptyWeapons=0
|
||||
;If the amount of ammo boxes in the inventory is less than or equal to the reserve, only one box will be used
|
||||
ReloadReserve=-1
|
||||
|
||||
;Set to 1 to change the counter in the 'Move Items' window to start with maximum number except in the barter screen
|
||||
;Set to 1 to change the counter in the 'Move Items' window to start with maximum number, except in the barter screen
|
||||
ItemCounterDefaultMax=0
|
||||
|
||||
;Set to 1 to leave the music playing in dialogue with talking heads
|
||||
@@ -628,10 +638,14 @@ UseWalkDistance=3
|
||||
;Set to 1 to fix the bug of being unable to sell used geiger counters or stealth boys
|
||||
CanSellUsedGeiger=1
|
||||
|
||||
;Set to 1 to fix the issue with being able to charge the car by using cells on other scenary/critters
|
||||
;Set to 1 to fix the issue with being able to charge the car by using cells on other scenery/critters
|
||||
;Set to 0 if another mod you're using has custom vehicles
|
||||
CarChargingFix=1
|
||||
|
||||
;Set to 1 to prevent the car from being lost when entering a location via the Town/World button and then leaving on foot
|
||||
;Note that the global variable 633 (GVAR_CAR_PLACED_TILE) will be set to -1 when the player leaves a location
|
||||
CarPlacedTileFix=1
|
||||
|
||||
;Set to 1 to skip weapon equip/unequip animations when performing various actions
|
||||
InstantWeaponEquip=0
|
||||
|
||||
@@ -665,7 +679,7 @@ SpecialDeathGVAR=491
|
||||
;Note that enabling this option can break the map changes in Modoc and Vault 15
|
||||
DisableSpecialMapIDs=0
|
||||
|
||||
;Changes the base value of the duration of the knockout effect (valid range: 35..100)
|
||||
;Changes the base value of the duration of the knockout effect (valid range: 35..100; default is 35)
|
||||
;The formula for the duration in ticks is: 10 * (value - 3 * EN)
|
||||
KnockoutTime=35
|
||||
|
||||
@@ -681,7 +695,8 @@ CreditsAtBottom=0
|
||||
Enable=0
|
||||
|
||||
;Fallout 2 Debug Patch
|
||||
;Set to 1 to send debug output to the screen, 2 to a debug.log file, or 3 to both the screen and a debug.log file
|
||||
;Set to 1 to send debug output to the screen, 2 to a debug.log file, or 3 to both the screen and debug.log
|
||||
;Does not require sfall debugging mode
|
||||
;While you don't need to create an environment variable, you do still need to set the appropriate lines in fallout2.cfg:
|
||||
;-------
|
||||
;[debug]
|
||||
@@ -696,6 +711,9 @@ Enable=0
|
||||
;-------
|
||||
DebugMode=0
|
||||
|
||||
;Set to 1 to hide error messages in debug output when a null value is passed to the function as an object
|
||||
HideObjIsNullMsg=0
|
||||
|
||||
;Change to 1 to skip the compatibility mode check
|
||||
SkipCompatModeCheck=0
|
||||
|
||||
@@ -713,17 +731,14 @@ SkipSizeCheck=0
|
||||
DontDeleteProtos=0
|
||||
|
||||
;Set to 1 to give scripts direct access to Fallout's address space, and to make arbitrary calls into Fallout's code
|
||||
;Does not require sfall debugging mode
|
||||
AllowUnsafeScripting=0
|
||||
|
||||
;Set to 1 to hide error messages in debug output when a null value is passed to the function as an object
|
||||
HideObjIsNullMsg=0
|
||||
|
||||
;Set to 1 to force critters to display combat float messages
|
||||
;Requires AllowSoundForFloats to be enabled
|
||||
Test_ForceFloats=0
|
||||
|
||||
;These options control what output is saved in the debug log (sfall-log.txt)
|
||||
|
||||
;Prints messages duing sfall initialization
|
||||
Init=0
|
||||
;Prints messages relating to hook scripts
|
||||
|
||||
@@ -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
|
||||
Binary file not shown.
@@ -2,29 +2,45 @@
|
||||
#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 +48,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 +69,5 @@ 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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Binary file not shown.
@@ -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.
|
||||
Binary file not shown.
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
|
||||
UI Hotkeys mod for Fallout 2 by NovaRain
|
||||
----------------------------------------
|
||||
|
||||
- closes some game interfaces by pressing their hotkeys again:
|
||||
* 'I' key for Inventory
|
||||
* 'S' key for Skilldex
|
||||
* 'Z' key for Pip-Boy
|
||||
|
||||
- extends the functionality of the 'Space' key (Caps Lock must be off):
|
||||
* takes all items in the loot screen
|
||||
* makes the offer in the barter screen
|
||||
|
||||
Requires sfall 3.5 or higher
|
||||
|
||||
*/
|
||||
|
||||
#include "..\headers\sfall\sfall.h"
|
||||
#include "..\headers\sfall\dik.h"
|
||||
|
||||
procedure start;
|
||||
|
||||
procedure start begin
|
||||
if game_loaded then begin
|
||||
register_hook(HOOK_KEYPRESS);
|
||||
end else begin
|
||||
variable
|
||||
event := get_sfall_arg,
|
||||
keyDX := get_sfall_arg,
|
||||
mode;
|
||||
|
||||
if (event) then begin
|
||||
mode := get_game_mode;
|
||||
if (mode bwand COUNTERWIN) then return; // new mode from sfall 4.2/3.8.20
|
||||
if (keyDX == DIK_I and (mode bwand INVENTORY)) then begin
|
||||
tap_key(DIK_ESCAPE);
|
||||
end else if (keyDX == DIK_S and (mode bwand SKILLDEX)) then begin
|
||||
tap_key(DIK_ESCAPE);
|
||||
end else if (keyDX == DIK_Z and (mode bwand PIPBOY)) then begin
|
||||
tap_key(DIK_ESCAPE);
|
||||
end else if (keyDX == DIK_SPACE) then begin
|
||||
if (mode bwand INTFACELOOT) then begin
|
||||
tap_key(DIK_CAPITAL);
|
||||
tap_key(DIK_A);
|
||||
tap_key(DIK_CAPITAL);
|
||||
end else if (mode bwand BARTER) then begin
|
||||
play_sfx("IB2P1XX1");
|
||||
tap_key(DIK_M);
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,22 @@
|
||||
UI Hotkeys mod for Fallout 2 by NovaRain
|
||||
----------------------------------------
|
||||
|
||||
- closes some game interfaces by pressing their hotkeys again:
|
||||
* 'I' key for Inventory
|
||||
* 'S' key for Skilldex
|
||||
* 'Z' key for Pip-Boy
|
||||
|
||||
- extends the functionality of the 'Space' key (Caps Lock must be off):
|
||||
* takes all items in the loot screen
|
||||
* makes the offer in the barter screen
|
||||
|
||||
- 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
|
||||
* the lowercase 'm' is the built-in hotkey for the OFFER button on the barter screen
|
||||
|
||||
|
||||
Requires sfall 3.5 or higher
|
||||
|
||||
To use, copy gl_uihotkeys.int to your scripts folder.
|
||||
|
||||
This mod is a simple example of how you can use HOOK_KEYPRESS hooks.
|
||||
@@ -212,9 +212,11 @@ use macros sort_array, sort_array_reverse, reverse_array, shuffle_array from sfa
|
||||
- always returns 0
|
||||
|
||||
> void save_array(mixed key, int arrayID):
|
||||
- makes the array saveable; it will be saved in sfallgv.sav file when saving the game
|
||||
- arrayID is associated with given "key"
|
||||
- array becomes permanent (if it was temporary) and "saved"
|
||||
- key can be of any type (int, float or string)
|
||||
- if you specify 0 as the key for the array ID, it will make the array "unsaved"
|
||||
|
||||
> int load_array(mixed key):
|
||||
- load array from savegame data by the same key provided in "save_array"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,16 @@
|
||||
#ifndef DEFINE_EXTRA_H
|
||||
#define DEFINE_EXTRA_H
|
||||
|
||||
#define BODY_HIT_HEAD (0)
|
||||
#define BODY_HIT_LEFT_ARM (1)
|
||||
#define BODY_HIT_RIGHT_ARM (2)
|
||||
#define BODY_HIT_TORSO (3)
|
||||
#define BODY_HIT_RIGHT_LEG (4)
|
||||
#define BODY_HIT_LEFT_LEG (5)
|
||||
#define BODY_HIT_EYES (6)
|
||||
#define BODY_HIT_GROIN (7)
|
||||
#define BODY_UNCALLED (8)
|
||||
|
||||
#define OBJ_TYPE_ITEM (0)
|
||||
#define OBJ_TYPE_CRITTER (1)
|
||||
#define OBJ_TYPE_SCENERY (2)
|
||||
@@ -31,6 +41,7 @@
|
||||
|
||||
#define WEAPON_BIGGUN 256 // 0x00000100 - Big Gun
|
||||
#define WEAPON_2HAND 512 // 0x00000200 - 2Hnd (weapon is two-handed)
|
||||
#define WEAPON_ENERGY 1024 // 0x00000400 - Energy Weapon (forces weapon to use Energy Weapons skill)
|
||||
|
||||
#define ATKMODE_PRI_NONE 0
|
||||
#define ATKMODE_PRI_PUNCH 1 // 0001
|
||||
@@ -109,7 +120,7 @@
|
||||
#define RMOBJ_RM_MULT_OBJS 4563866
|
||||
#define RMOBJ_REPLACE_WEAPON 4658526
|
||||
#define RMOBJ_THROW 4266040
|
||||
#define RMOBJ_SUB_CONTAINER 4683191 // search and remove the item from a container inside of an inventory
|
||||
#define RMOBJ_SUB_CONTAINER 4683191 // search and remove the item from nested containers in the inventory
|
||||
|
||||
// common prototype offsets for get/set_proto_data
|
||||
#define PROTO_PID (1)
|
||||
@@ -300,10 +311,11 @@
|
||||
#define OBJ_DATA_FID (0x20)
|
||||
#define OBJ_DATA_ELEVATION (0x28)
|
||||
#define OBJ_DATA_PID (0x64)
|
||||
#define OBJ_DATA_CID (0x68) // combat id, used for savegame
|
||||
#define OBJ_DATA_SID (0x78)
|
||||
#define OBJ_DATA_CID (0x68) // combat ID, used for savegame
|
||||
#define OBJ_DATA_SID (0x78) // script ID
|
||||
#define OBJ_DATA_SCRIPT_INDEX (0x80) // script index number in scripts.lst
|
||||
// items
|
||||
#define OBJ_DATA_CUR_CHARGES (0x3C)
|
||||
#define OBJ_DATA_CUR_CHARGES (0x3C) // for key items it's the key code
|
||||
// critters
|
||||
#define OBJ_DATA_COMBAT_STATE (0x3C) // flags: 1 - combat, 2 - target is out of range, 4 - flee
|
||||
#define OBJ_DATA_CUR_ACTION_POINT (0x40)
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
#define INTFACEUSE (0x8000)
|
||||
#define INTFACELOOT (0x10000)
|
||||
#define BARTER (0x20000)
|
||||
#define HEROWIN (0x40000)
|
||||
#define DIALOGVIEW (0x80000)
|
||||
#define COUNTERWIN (0x100000) // counter window for moving multiple items or setting a timer
|
||||
|
||||
//Valid arguments to register_hook
|
||||
#define HOOK_TOHIT (0)
|
||||
@@ -57,7 +60,8 @@
|
||||
#define LIST_ALL (9)
|
||||
|
||||
//Valid flags for force_encounter_with_flags
|
||||
#define ENCOUNTER_FLAG_NO_CAR (1)
|
||||
#define ENCOUNTER_FLAG_NO_CAR (1)
|
||||
#define ENCOUNTER_FLAG_LOCK (2) // block new forced encounter by the next function call until the current specified encounter occurs
|
||||
|
||||
//The attack types returned by get_attack_type
|
||||
#define ATKTYPE_LWEP1 (0)
|
||||
@@ -126,12 +130,13 @@
|
||||
#define reverse_array(array) resize_array(array, -4)
|
||||
// randomly shuffle elements in list/map
|
||||
#define shuffle_array(array) resize_array(array, -5)
|
||||
// sort map in ascending order by value
|
||||
// sort map in ascending order by key value
|
||||
#define sort_map_value(array) resize_array(array, -6)
|
||||
// sort map in descending order by value
|
||||
#define sort_map_value_desc(array) resize_array(array, -7)
|
||||
// sort map in descending order by key value
|
||||
#define sort_map_reverse(array) resize_array(array, -7)
|
||||
// remove element from map or just replace value with 0 for list
|
||||
#define unset_array(array, item) set_array(array, item, 0)
|
||||
|
||||
// same as "key_pressed" but checks VK codes instead of DX codes
|
||||
#define key_pressed_vk(key) (key_pressed(key bwor 0x80000000))
|
||||
|
||||
@@ -219,6 +224,8 @@
|
||||
#define ADD_PERK_MODE_REMOVE (4) // remove from the list of selectable perks
|
||||
|
||||
// sfall_funcX macros
|
||||
#define add_iface_tag sfall_func0("add_iface_tag")
|
||||
#define add_trait(traitId) sfall_func1("add_trait", traitId)
|
||||
#define art_cache_clear sfall_func0("art_cache_clear")
|
||||
#define attack_is_aimed sfall_func0("attack_is_aimed")
|
||||
#define create_win(winName, x, y, w, h) sfall_func5("create_win", winName, x, y, w, h)
|
||||
@@ -231,6 +238,7 @@
|
||||
#define get_current_inven_size(obj) sfall_func1("get_current_inven_size", obj)
|
||||
#define get_cursor_mode sfall_func0("get_cursor_mode")
|
||||
#define get_flags(obj) sfall_func1("get_flags", obj)
|
||||
#define get_inven_ap_cost sfall_func0("get_inven_ap_cost")
|
||||
#define get_map_enter_position sfall_func0("get_map_enter_position")
|
||||
#define get_metarule_table sfall_func0("get_metarule_table")
|
||||
#define get_object_data(obj, offset) sfall_func2("get_object_data", obj, offset)
|
||||
@@ -250,12 +258,15 @@
|
||||
#define real_dude_obj sfall_func0("real_dude_obj")
|
||||
#define set_cursor_mode(mode) sfall_func1("set_cursor_mode", mode)
|
||||
#define set_flags(obj, flags) sfall_func2("set_flags", obj, flags)
|
||||
#define set_iface_tag_text(tag, text, color) sfall_func3("set_iface_tag_text", tag, text, color)
|
||||
#define set_ini_setting(setting, value) sfall_func2("set_ini_setting", setting, value)
|
||||
#define set_map_enter_position(tile, elev, rot) sfall_func3("set_map_enter_position", tile, elev, rot)
|
||||
#define set_object_data(obj, offset, value) sfall_func3("set_object_data", obj, offset, value)
|
||||
#define set_outline(obj, color) sfall_func2("set_outline", obj, color)
|
||||
#define set_unique_id(obj) sfall_func1("set_unique_id", obj)
|
||||
#define unset_unique_id(obj) sfall_func2("set_unique_id", obj, -1)
|
||||
#define set_unjam_locks_time(time) sfall_func1("set_unjam_locks_time", time)
|
||||
#define spatial_radius(obj) sfall_func1("spatial_radius", obj)
|
||||
#define tile_refresh_display sfall_func0("tile_refresh_display")
|
||||
#define unjam_lock(obj) sfall_func1("unjam_lock", obj)
|
||||
#define unwield_slot(critter, slot) sfall_func2("unwield_slot", critter, slot)
|
||||
|
||||
@@ -10,8 +10,6 @@ To aid in mods compatibility, avoid using hs_xxx .int scripts. Instead it is rec
|
||||
|
||||
Example setup for a hook-script based mod:
|
||||
|
||||
|
||||
|
||||
procedure tohit_hook_handler begin
|
||||
display_msg("Modifying hit_hook " + get_sfall_arg);
|
||||
set_hit_chance_max(100);
|
||||
@@ -25,8 +23,6 @@ procedure start begin
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
There are script functions available, specific to hook scripts:
|
||||
|
||||
> int init_hook()
|
||||
@@ -47,8 +43,11 @@ Changes argument value. The argument number (argnum) is 0-indexed. This is usefu
|
||||
> void register_hook(int hooktype)
|
||||
Used from a normal global script if you want to run it at the same point a full hook script would normally run. In case of this function, "start" proc will be executed in a current global script. You can use all above functions like normal.
|
||||
|
||||
> void register_hook_proc(int hooktype, proc procedure)
|
||||
The same as register_hook, except that you specifically define which procedure in the current script should be called as a hook (instead of "start"). Pass procedure the same as how you use dialog option functions. This IS the recommended way to use hook scripts, as it gives both modularity (each mod logic in a separate global script, no conflicts if you don't use "hs_*.int" scripts) and flexibility (you can place all related hook scripts for specific mod in a single script!).
|
||||
> void register_hook_proc(int hook, procedure proc)
|
||||
The same as register_hook, except that you specifically define which procedure in the current script should be called as a hook (instead of "start" by default). Pass procedure the same as how you use dialog option functions. This IS the recommended way to use hook scripts, as it gives both modularity (each mod logic in a separate global script, no conflicts if you don't use "hs_*.int" scripts) and flexibility (you can place all related hook scripts for specific mod in a single script!).
|
||||
|
||||
> void register_hook_proc_spec(int hook, procedure proc)
|
||||
Works very similar to register_hook_proc, except that it registers the current script at the end of the hook script execution chain (i.e. the script will be executed after all previously registered scripts for the same hook, including the hs_*.int script). All scripts hooked to a single hook point with this function are executed in exact order of how they were registered, as opposed to the description below, which refers to using register_hook/register_hook_proc functions.
|
||||
|
||||
NOTE: you can hook several scripts to a single hook point, for example if it's different mods from different authors or just some different aspects of one larger mod. In this case scripts are executed in reverse order of how they were registered. When one of the scripts in a chain returns value with "set_sfall_return", the next script may override this value if calls "set_sfall_return" again. Sometimes you need to multiply certain value in a chain of hook scripts.
|
||||
Example: let's say we have a Mod A which reduces all "to hit" chances by 50%. The code might look like this:
|
||||
@@ -248,13 +247,14 @@ Obj arg1 - the owner that the object is being removed from
|
||||
item arg2 - the item that is being removed
|
||||
int arg3 - the number of items to remove
|
||||
int arg4 - The reason the object is being removed (see RMOBJ_* constants)
|
||||
Obj arg5 - The destination object when the item is moved to another object, otherwise 0
|
||||
Obj arg5 - The destination object when the item is moved to another object, 0 otherwise
|
||||
|
||||
-------------------------------------------
|
||||
|
||||
HOOK_BARTERPRICE (hs_barterprice.int)
|
||||
|
||||
Runs whenever the value of goods being purchased is calculated
|
||||
NOTE: the hook is executed twice when entering the barter screen or after transaction: the first time is for the player and the second time is for NPC
|
||||
|
||||
critter arg1 - the critter doing the bartering (either dude_obj or inven_dude)
|
||||
critter arg2 - the critter being bartered with
|
||||
@@ -264,7 +264,8 @@ int arg5 - the amount of actual caps in the barter stack (as opposed to good
|
||||
int arg6 - the value of all goods being traded before skill modifications
|
||||
critter arg7 - table of offered goods (being sold to NPC)
|
||||
int arg8 - the total cost of the goods offered by the player
|
||||
int arg9 - set 1 if the "offers" button was pressed (not for a party member), otherwise 0
|
||||
int arg9 - 1 if the "offers" button was pressed (not for a party member), 0 otherwise
|
||||
int arg10 - 1 if trading with a party member, 0 otherwise
|
||||
|
||||
int ret1 - the modified value of all of the goods (pass -1 if you just want to modify offered goods)
|
||||
int ret2 - the modified value of all offered goods
|
||||
@@ -334,7 +335,6 @@ int arg4 - Type of hook (0 - when subtracting ammo after single shot attack,
|
||||
|
||||
int ret1 - new ammo cost value (set to 0 for unlimited ammo)
|
||||
|
||||
|
||||
-------------------------------------------
|
||||
|
||||
HOOK_KEYPRESS (hs_keypress.int)
|
||||
@@ -431,7 +431,7 @@ int ret1 - Override setting (-1 - use engine handler, any other value - prev
|
||||
|
||||
HOOK_INVENWIELD (hs_invenwield.int)
|
||||
|
||||
Runs before wielding or unwielding an armor or a weapon by a critter (except when using inventory by PC).
|
||||
Runs before causing a critter or the player to wield/unwield an armor or a weapon (except when using the inventory by PC).
|
||||
An example usage would be to change critter art depending on armor being used or to dynamically customize weapon animations.
|
||||
NOTE: when replacing a previously wielded armor or weapon, the unwielding hook will not be executed.
|
||||
If you need to rely on this, try checking if armor/weapon is already equipped when wielding hook is executed.
|
||||
@@ -440,5 +440,6 @@ Critter arg1 - critter
|
||||
Obj arg2 - item being wielded or unwielded (weapon/armor)
|
||||
int arg3 - slot (INVEN_TYPE_*)
|
||||
int arg4 - 1 when wielding, 0 when unwielding
|
||||
int arg5 - 1 when removing an equipped item from inventory, 0 otherwise
|
||||
|
||||
int ret1 - overrides hard-coded handler (-1 - use engine handler, any other value - override) - NOT RECOMMENDED
|
||||
|
||||
@@ -50,7 +50,7 @@ has_fake_trait and has_fake_perk return the number of levels the player has of t
|
||||
|
||||
perk_add_mode, set_selectable_perk, set_perkbox_title, hide_real_perks, show_real_perks and clear_selectable_perks control the behaviour of the select a perk box. set_selectable_perk can be used to add additional items by setting the 'active' parameter to 1, and to remove them again by setting it to 0. set_perkbox_title can be used to change the title of the box, or by using "" it will be set back to the default. hide and show_real_perks can be used to prevent the dialog from displaying any of the original 119 perks. perk_add_mode modifies what happens when a fake perk is selected from the perks dialog. It is treated as a set of flags - if bit 1 is set then it is added to the player's traits, if bit 2 is set it is added to the player's perks, and if bit 3 is set it is removed from the list of selectable perks. The default is 0x2. clear_selectable_perks restores the dialog to its default state.
|
||||
|
||||
show_iface_tag, hide_iface_tag and is_iface_tag_active relate to the boxes that appear above the interface such as SNEAK and LEVEL. You can use 3 for LEVEL and 4 for ADDICT, or the range from 5 to 9 for custom boxes. Remember to add your messages to intrface.msg and set up the font colours in ddraw.ini if you're going to use custom boxes. Starting from sfall 3.8.12, is_iface_tag_active can also be used to check 0 for SNEAK, 1 for POISONED, and 2 for RADIATED.
|
||||
show_iface_tag, hide_iface_tag and is_iface_tag_active relate to the boxes that appear above the interface such as SNEAK and LEVEL. You can use 3 for LEVEL and 4 for ADDICT, or the range from 5 to (4 + the value of BoxBarCount in ddraw.ini) for custom boxes. Remember to add your messages to intrface.msg and set up the font colours in ddraw.ini if you're going to use custom boxes. Starting from sfall 3.8.12, is_iface_tag_active can also be used to check 0 for SNEAK, 1 for POISONED, and 2 for RADIATED.
|
||||
|
||||
get/set_bodypart_hit_modifier alter the hit percentage modifiers for aiming at specific bodyparts. Valid bodypart id's are from 0 to 8. Changes are not saved, and will reset to the defaults (or to the values specified in ddraw.ini if they exist) at each reload.
|
||||
|
||||
@@ -302,6 +302,10 @@ Some utility/math functions are available:
|
||||
- second argument should be passed just like you pass procedures to functions like gsay_option, giq_option, etc (name without quotes)
|
||||
- see "hookscripts.txt" for more details
|
||||
|
||||
> void register_hook_proc_spec(int hook, procedure proc)
|
||||
- works just like "register_hook_proc", but allows to register a script at the end of the hook script execution chain (i.e. the script will be executed after all previously registered scripts for the same hook, including the hs_*.int script)
|
||||
- to unregister hook script from current global script, use the register_hook_proc function
|
||||
|
||||
> string message_str_game(int fileId, int messageId)
|
||||
- works exactly the same as message_str, except you get messages from files in "text\<language>\game\" directory
|
||||
- use GAME_MSG_* defines or mstr_* macros from sfall.h to use specific msg file
|
||||
@@ -439,6 +443,12 @@ Some utility/math functions are available:
|
||||
- unjams a lock immediately without having to wait until the next day, or leave the map and then return after 24 hours
|
||||
- does not work in use_skill_on_p_proc procedure
|
||||
|
||||
> void sfall_func1("set_unjam_locks_time", int time)
|
||||
- sets after how many hours (up to 127 hours) jammed locks will be unjammed if the player leaves the map
|
||||
- also disables the auto unjam that occurs at midnight when the player is on the map
|
||||
- passing 0 will disable the auto unjam mechanism completely
|
||||
- The auto unjam mechanism will be reset each time the player reloads the game
|
||||
|
||||
> array sfall_func0("get_map_enter_position")
|
||||
- returns an array of the player's position data (index 0 - tile, 1 - elevation, 2 - rotation) when entering the map through exit grids
|
||||
- if entering from the world map, the tile value will be -1
|
||||
@@ -452,6 +462,16 @@ Some utility/math functions are available:
|
||||
> int sfall_func0("attack_is_aimed")
|
||||
- returns 1 if the aimed attack mode is selected, 0 otherwise
|
||||
|
||||
> void sfall_func3("set_iface_tag_text", int tag, string text, int color)
|
||||
- sets the text messages and colors for custom notification boxes to the interface without the need to add messages to intrface.msg and set up the font colors in ddraw.ini
|
||||
- tag value is the same as used in show_iface_tag, hide_iface_tag, and is_iface_tag_active. The valid range is from 5 to (4 + the value of BoxBarCount in ddraw.ini) or the number of the last custom box added using the add_ifaca_tag function
|
||||
- The text is limited to 19 characters
|
||||
- available colors: 0 - green, 1 - red, 2 - white, 3 - yellow, 4 - dark yellow, 5 - blue, 6 - purple, 7 - dull pink
|
||||
|
||||
> int sfall_func0("add_iface_tag")
|
||||
- adds one custom box to the current boxes, and returns the number of the added tag (-1 if the tags limit is exceeded)
|
||||
- The maximum number of boxes is limited to 126 tags
|
||||
|
||||
> void sfall_func1("inventory_redraw", int invSide)
|
||||
- redraws inventory list in the inventory/use inventory item on/loot/barter screens
|
||||
- invSide specifies which side needs to be redrawn: 0 - the player, 1 - target (container/NPC in loot/barter screens)
|
||||
@@ -497,6 +517,17 @@ Some utility/math functions are available:
|
||||
- there is also a unique ID number range for the player and party members from 18000 to 83535
|
||||
- to assign a new ID number generated by the engine to the object (i.e. unassign a unique ID), call the function with two arguments and pass -1 for the flag argument
|
||||
|
||||
> void sfall_func2("unwield_slot", object critter, int slot)
|
||||
- unequips an item from the specified slot for a critter or the player
|
||||
- can take off player's equipped item when the inventory is opened, or the player is in the barter screen
|
||||
- slot: 0 - armor slot, 1 - right slot, 2 - left slot (see INVEN_TYPE_* in define.h)
|
||||
|
||||
> void sfall_func1("add_trait", int traitId)
|
||||
- adds the specified trait to the player
|
||||
|
||||
> int sfall_func0("get_inven_ap_cost")
|
||||
- returns the current AP cost to access the inventory in combat
|
||||
|
||||
------------------------
|
||||
------ MORE INFO -------
|
||||
------------------------
|
||||
|
||||
@@ -357,6 +357,8 @@
|
||||
0x827b - any sfall_func5(string funcName, arg1, arg2, arg3, arg4, arg5)
|
||||
0x827c - any sfall_func6(string funcName, arg1, arg2, arg3, arg4, arg5, arg6)
|
||||
|
||||
0x827d - void register_hook_proc_spec(int hook, procedure proc)
|
||||
|
||||
|
||||
* These functions require AllowUnsafeScripting to be enabled in ddraw.ini
|
||||
|
||||
|
||||
+2
-2
@@ -186,9 +186,9 @@ void AIInit() {
|
||||
|
||||
MakeJump(0x45F6AF, BlockCombatHook1); // intface_use_item_
|
||||
HookCall(0x4432A6, BlockCombatHook2); // game_handle_input_
|
||||
GetPrivateProfileString("sfall", "BlockedCombat", "You cannot enter combat at this time.", combatBlockedMessage, 128, translationIni);
|
||||
Translate("sfall", "BlockedCombat", "You cannot enter combat at this time.", combatBlockedMessage);
|
||||
|
||||
RetryCombatMinAP = GetPrivateProfileIntA("Misc", "NPCsTryToSpendExtraAP", 0, ini);
|
||||
RetryCombatMinAP = GetConfigInt("Misc", "NPCsTryToSpendExtraAP", 0);
|
||||
if (RetryCombatMinAP > 0) {
|
||||
dlog("Applying retry combat patch.", DL_INIT);
|
||||
HookCall(0x422B94, RetryCombatHook); // combat_turn_
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user