A 1.41 beta is
up. (Along with sslc
here.) Three new features this time.
Critical tables
Can be overridden either by script using the new set/get/reset_critical_table functions, and/or by supplying a CriticalOverrides.ini file. In either case OverrideCriticalTable in ddraw.ini needs to be set to 1. (Off by default because it noticeably lengthens loading times.)
If you're using an ini to override, the syntax is to have one section for each critter/bodypart/critical level block, in the format [c_<critter id>_<bodypart>_<critical level>] (e.g. [c_00_0_0] for the lowest level of critical on a male targeted at the head.) That section can contain any of 'DamageMultiplier', 'EffectFlags', 'StatCheck', 'StatMod', 'FailureEffect', 'Message' or 'FailMessage' keys. Any not present just use the default values.
e.g. a file containing
Code:
[c_01_0_0]
DamageMultiplier=100
[c_01_0_1]
DamageMultiplier=100
[c_01_0_2]
DamageMultiplier=100
[c_01_0_3]
DamageMultiplier=100
[c_01_0_4]
DamageMultiplier=100
[c_01_0_5]
DamageMultiplier=100
Would cause all critical hits to the head of a female to do silly amounts of damage.
ac bonus from unspent ap
The bonuses are controlled by script, and the bonuses can be set for regular ap and h2h evade separately, in fractions of 1/4. In addition, the h2h evade hardcoded effect is modified to support multiple levels. (The perk itself still limits you to 1 level, but if a mod changes that then it'll now work, rather than extra levels above 1 having no effect.)
e.g. if you used 'set_unspent_ap_bonus(6); set_unspent_ap_perk_bonus(2);', and the player ended the turn with 2 ap left, they would get 3 extra ac without any levels of h2h evade, 4 with 1 level and 5 with 2.
The default values are 4 for both, i.e. 1 point of ac for each spare point of ap, doubled if you have h2h evade.
hook scripts
This is the reason it's beta; there's a lot of potential for me to have broken something here. I'll quote the readme to save typing it out again:
hookscripts.txt said:
Hook scripts are specially named scripts that are run by sfall at specific points to allow mods to override normally hardcoded behaviour in a more flexible way than sfall's normal ini configuration.
In addition to the bit of code it overrides, the script will be run once when first loaded and again at each player reload to allow for setup. Hook scripts have access to a set of arguments supplied to sfall, but aren't required to use them all. They also return one or more values, but again they're optional, and you only need to return a value if you want to override the default.
There are three script functions specific to hook scripts:
int init_hook()
The hook script equivilent of game_loaded; it returns 2 when the script is first loaded, 1 when the player reloads and 0 otherwise.
mixed get_sfall_arg()
Gets the next argument from sfall. Each time it's called it returns the next argument, or otherwise it returns 0 if there are no more arguments left.
void set_sfall_return(int value)
Used to return the new values from the script. Each time it's called it sets the next value, or if you've already set all return values it does nothing.
The only one in there atm is for the hit chance, which would enable you to write a script that did something like scaling how the hit chance drops with distance so that eye's get harder to hit faster than the torso, or something similar.
As a quick example script, compiling this and saving it as hs_tohit.int will simply increase the chances of everything hitting anything by 20%
Code:
procedure start;
procedure start begin
if(init_hook) then begin
end else begin
set_sfall_return(get_sfall_arg + 20);
end
end
Not actually a very good script, because it can result in chances over 100; the script is run after the normal hit chance is capped at 95.
I'll get some extras in for 1.41 proper, if anyone has any suggestions for hardcoded sfall effects they'd like to be able to script.