Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/sfall-team/sfall into bet…
Browse files Browse the repository at this point in the history
…ter-docs
  • Loading branch information
burner1024 committed Oct 7, 2023
2 parents 5bf72d4 + daf9e57 commit f14b1a9
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 10 deletions.
3 changes: 2 additions & 1 deletion artifacts/ddraw.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
;sfall configuration settings
;v4.4
;v4.4.0.2

[Main]
;Set to 1 to enable the built-in High Resolution Patch mode that is similar to the hi-res patch by Mash
Expand Down Expand Up @@ -402,6 +402,7 @@ SaveInCombatFix=1
;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 corresponds to 's' and 15 to 't'
;This option is always enabled in 4.4.0.2/3.8.40.2 or later. The information is left for reference only
AdditionalWeaponAnims=1

;Uncomment these lines to modify the default modifiers for aimed shots at specific bodyparts
Expand Down
Binary file modified artifacts/mods/gl_partycontrol.int
Binary file not shown.
15 changes: 13 additions & 2 deletions artifacts/mods/gl_partycontrol.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
NOTE: this script requires compiler from sfall modderspack with -s option
(short circuit evaluation)

version 1.3
version 1.4

*/

Expand Down Expand Up @@ -44,8 +44,12 @@ variable
dudeLightInt, dudeLightDist;


// returns non-zero for a controlled NPC
procedure AllowControl(variable pid) begin
return ((pidList == 0 or scan_array(pidList, pid bwand 0xFFFFFF) != -1) and (party_member_obj(pid)));
if (pidList) then begin
return scan_array(pidList, pid bwand 0xFFFFFF) != -1;
end
return party_member_obj(pid);
end

procedure SetLight(variable critter, variable lInt, variable lDist) begin
Expand Down Expand Up @@ -99,6 +103,10 @@ procedure CombatTurn_Handler begin
level := has_trait(TRAIT_PERK, real_dude_obj, perkID);
if (level) then critter_add_trait(critter, TRAIT_PERK, perkID, level);
end
// special handling if dude has Jinxed trait/perk
if (has_trait(TRAIT_TRAIT, real_dude_obj, TRAIT_jinxed) or has_trait(TRAIT_PERK, real_dude_obj, PERK_jinxed_perk)) then begin
critter_add_trait(critter, TRAIT_PERK, PERK_jinxed_perk, 1);
end
intface_redraw;

obj_set_light_level(critter, 100, 4);
Expand Down Expand Up @@ -138,6 +146,8 @@ procedure CombatTurn_Handler begin
level := has_trait(TRAIT_PERK, real_dude_obj, perkID);
if (level) then critter_rm_trait(critter, TRAIT_PERK, perkID, level);
end
// special handling for Jinxed
critter_rm_trait(critter, TRAIT_PERK, PERK_jinxed_perk, -1);
end

if (status < 0) then begin
Expand All @@ -152,6 +162,7 @@ procedure GameModeChange_Handler begin
inControl := false;
npcControl := 0;
move_to(dude_obj, dude_tile, dude_elevation);
DEBUGMSG("Move to dude after NPC control.")
end
end

Expand Down
2 changes: 1 addition & 1 deletion artifacts/scripting/hooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@
-1 - combat ends abruptly (by script or by pressing Enter during PC turn)
-2 - combat ends normally (hook always runs at the end of combat)
Critter arg1 - critter doing the turn
bool arg2 - 1 at the start/end of the player's turn after loading a game saved in combat mode, 0 otherwise
int arg2 - 1 at the start/end of the player's turn after loading a game saved in combat mode, 0 otherwise
int ret0 - pass 1 at the start of turn to skip the turn, pass -1 at the end of turn to force end of combat
```
Expand Down
2 changes: 1 addition & 1 deletion artifacts/scripting/hookscripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ int arg0 - event type:
-1 - combat ends abruptly (by script or by pressing Enter during PC turn)
-2 - combat ends normally (hook always runs at the end of combat)
Critter arg1 - critter doing the turn
bool arg2 - 1 at the start/end of the player's turn after loading a game saved in combat mode, 0 otherwise
int arg2 - 1 at the start/end of the player's turn after loading a game saved in combat mode, 0 otherwise
int ret0 - pass 1 at the start of turn to skip the turn, pass -1 at the end of turn to force end of combat
```
Expand Down
Binary file modified artifacts/sfall.dat
Binary file not shown.
Binary file modified artifacts/sfall_ru.dat
Binary file not shown.
Binary file modified artifacts/sfall_zh.dat
Binary file not shown.
2 changes: 1 addition & 1 deletion sfall/InputFuncs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ DWORD __stdcall KeyDown(DWORD key) {
if ((key & 0x80000000) > 0) { // special flag to check by VK code directly
return GetAsyncKeyState(key & 0xFFFF) & 0x8000;
}
key = key & 0xFFFF;
key &= 0xFFFF;
// combined use of DINPUT states + confirmation from GetAsyncKeyState()
if (key < MAX_KEYS) {
if (keysDown[key]) { // confirm pressed state
Expand Down
4 changes: 2 additions & 2 deletions sfall/Modules/MiscPatches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,14 +477,14 @@ static void __declspec(naked) text_object_create_hack() {
}

static void AdditionalWeaponAnimsPatch() {
if (IniReader::GetConfigInt("Misc", "AdditionalWeaponAnims", 0)) {
//if (IniReader::GetConfigInt("Misc", "AdditionalWeaponAnims", 1)) {
dlogr("Applying additional weapon animations patch.", DL_INIT);
SafeWrite8(0x419320, 18); // art_get_code_
HookCalls(WeaponAnimHook, {
0x451648, 0x451671, // gsnd_build_character_sfx_name_
0x4194CC // art_get_name_
});
}
//}
}

static void SkilldexImagesPatch() {
Expand Down
4 changes: 2 additions & 2 deletions sfall/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
#define VERSION_MAJOR 4
#define VERSION_MINOR 4
#define VERSION_BUILD 0
#define VERSION_REV 1
#define VERSION_REV 2

#define VERSION_STRING "4.4.0.1"
#define VERSION_STRING "4.4.0.2"

0 comments on commit f14b1a9

Please sign in to comment.