mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Minor edits to code and documents
Commented out unused combat related functions.
This commit is contained in:
@@ -20,7 +20,7 @@ CheckLOS=0
|
|||||||
; 16 - bright yellow
|
; 16 - bright yellow
|
||||||
; 32 - dark yellow
|
; 32 - dark yellow
|
||||||
; 64 - purple
|
; 64 - purple
|
||||||
; You can set a custom color from the game palette by multiplying the color index value by 256 (available since sfall 4.2.7)
|
; You can set a custom color from the game palette by multiplying the color index value by 256 (in 4.2.7 or later)
|
||||||
OutlineColor=16
|
OutlineColor=16
|
||||||
|
|
||||||
; Motion Scanner mode:
|
; Motion Scanner mode:
|
||||||
@@ -31,11 +31,11 @@ MotionScanner=0
|
|||||||
|
|
||||||
|
|
||||||
[CombatControl]
|
[CombatControl]
|
||||||
;Allows you to directly control other critters in combat
|
;Allows you to control other critters directly in combat
|
||||||
;Set to 0 to disable
|
;Set to 0 to disable
|
||||||
;Set to 1 to control all critters in combat (allowed only in sfall debugging mode)
|
;Set to 1 to control all critters in combat (allowed only in sfall debugging mode)
|
||||||
;Set to 2 to control all party members
|
;Set to 2 to control all party members
|
||||||
;Set to 3 to let you order party members to attack specified targets after your first attack instead of controlling them directly
|
;Set to 3 to let you use the command cursor to specify targets for party members to attack in combat
|
||||||
Mode=0
|
Mode=0
|
||||||
;If you want to control only specific critters, uncomment the PIDList line and set a comma delimited list of PIDs
|
;If you want to control only specific critters, uncomment the PIDList line and set a comma delimited list of PIDs
|
||||||
;PIDList=62,89,97,107,160,161
|
;PIDList=62,89,97,107,160,161
|
||||||
|
|||||||
+2
-3
@@ -150,7 +150,7 @@ OverrideMusicDir=1
|
|||||||
;This will slightly increase the startup time of the game on older computers
|
;This will slightly increase the startup time of the game on older computers
|
||||||
AutoSearchSFX=1
|
AutoSearchSFX=1
|
||||||
|
|
||||||
;Uncomment these lines to override the names of sound files for game modes
|
;Uncomment these lines to override the names of sound files used by the engine
|
||||||
;Filenames are limited to 8 characters (without extension)
|
;Filenames are limited to 8 characters (without extension)
|
||||||
;MainMenuMusic=07desert
|
;MainMenuMusic=07desert
|
||||||
;WorldMapMusic=23world
|
;WorldMapMusic=23world
|
||||||
@@ -296,8 +296,7 @@ DataLoadOrderPatch=1
|
|||||||
;Set to 2 to also load subtitle files from text\<language>\cuts_female\ for female PC
|
;Set to 2 to also load subtitle files from text\<language>\cuts_female\ for female PC
|
||||||
FemaleDialogMsgs=0
|
FemaleDialogMsgs=0
|
||||||
|
|
||||||
;Set to 1 to allow using the special '^' character in dialog msg files to specify the alternative text
|
;Set to 1 to allow using the caret character '^' in dialog msg files to specify the alternative text based on the player's gender
|
||||||
;that will be displayed in the dialogue based on the player's gender
|
|
||||||
;The text must be enclosed in angle brackets (example: <MaleText^FemaleText>)
|
;The text must be enclosed in angle brackets (example: <MaleText^FemaleText>)
|
||||||
DialogGenderWords=0
|
DialogGenderWords=0
|
||||||
|
|
||||||
|
|||||||
@@ -1568,7 +1568,7 @@
|
|||||||
|
|
||||||
- name:
|
- name:
|
||||||
detail: int get_combat_free_move
|
detail: int get_combat_free_move
|
||||||
doc: Returns current "bonus move" points of a current critter's turn. For NPC's this is always 0, unless changed by set_combat_free_move.
|
doc: Returns available "bonus move" points of the current critter's turn. For NPCs, this is always 0 unless changed by `set_combat_free_move`
|
||||||
macro: sfall.h
|
macro: sfall.h
|
||||||
|
|
||||||
- name: set_combat_free_move
|
- name: set_combat_free_move
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ end
|
|||||||
* Useful in cunjunction with is_in_array()
|
* Useful in cunjunction with is_in_array()
|
||||||
*/
|
*/
|
||||||
procedure string_split_ints(variable str, variable split) begin
|
procedure string_split_ints(variable str, variable split) begin
|
||||||
variable n;
|
variable n := 0;
|
||||||
variable list, result, val;
|
variable list, result, val;
|
||||||
|
|
||||||
if (str == "" or typeof(str) != VALTYPE_STR) then
|
if (str == "" or typeof(str) != VALTYPE_STR) then
|
||||||
@@ -177,10 +177,10 @@ procedure string_split_ints(variable str, variable split) begin
|
|||||||
list := string_split(str, split);
|
list := string_split(str, split);
|
||||||
result := temp_array_list(0);
|
result := temp_array_list(0);
|
||||||
foreach (val in list) begin
|
foreach (val in list) begin
|
||||||
if val != "" then begin
|
if (val != "") then begin
|
||||||
resize_array(result, n + 1);
|
resize_array(result, n + 1);
|
||||||
result[n] := atoi(val);
|
result[n] := atoi(val);
|
||||||
n += 1;
|
n++;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -1081,7 +1081,7 @@ sfall_funcX metarule functions
|
|||||||
##### get_combat_free_move
|
##### get_combat_free_move
|
||||||
`int sfall_func0("get_combat_free_move")`
|
`int sfall_func0("get_combat_free_move")`
|
||||||
|
|
||||||
- Returns current "bonus move" points of a current critter's turn. For NPC's this is always 0, unless changed by set_combat_free_move.
|
- Returns available "bonus move" points of the current critter's turn. For NPCs, this is always 0 unless changed by `set_combat_free_move`.
|
||||||
|
|
||||||
----
|
----
|
||||||
##### set_combat_free_move
|
##### set_combat_free_move
|
||||||
|
|||||||
@@ -19,13 +19,13 @@ namespace game
|
|||||||
namespace sf = sfall;
|
namespace sf = sfall;
|
||||||
|
|
||||||
static const long aiUseItemAPCost = 2;
|
static const long aiUseItemAPCost = 2;
|
||||||
|
/*
|
||||||
// Implementation of ai_can_use_weapon_ engine function with the HOOK_CANUSEWEAPON hook
|
// Implementation of ai_can_use_weapon_ engine function with the HOOK_CANUSEWEAPON hook
|
||||||
bool CombatAI::ai_can_use_weapon(fo::GameObject* source, fo::GameObject* weapon, long hitMode) {
|
bool CombatAI::ai_can_use_weapon(fo::GameObject* source, fo::GameObject* weapon, long hitMode) {
|
||||||
bool result = fo::func::ai_can_use_weapon(source, weapon, hitMode);
|
bool result = fo::func::ai_can_use_weapon(source, weapon, hitMode);
|
||||||
return sf::CanUseWeaponHook_Invoke(result, source, weapon, hitMode);
|
return sf::CanUseWeaponHook_Invoke(result, source, weapon, hitMode);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
static long drugUsePerfFixMode;
|
static long drugUsePerfFixMode;
|
||||||
|
|
||||||
void __stdcall CombatAI::ai_check_drugs(fo::GameObject* source) {
|
void __stdcall CombatAI::ai_check_drugs(fo::GameObject* source) {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class CombatAI {
|
|||||||
public:
|
public:
|
||||||
static void init();
|
static void init();
|
||||||
|
|
||||||
static bool ai_can_use_weapon(fo::GameObject* source, fo::GameObject* weapon, long hitMode);
|
//static bool ai_can_use_weapon(fo::GameObject* source, fo::GameObject* weapon, long hitMode);
|
||||||
|
|
||||||
static void __stdcall ai_check_drugs(fo::GameObject* source);
|
static void __stdcall ai_check_drugs(fo::GameObject* source);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -670,13 +670,13 @@ static void __declspec(naked) CanUseWeaponHook() {
|
|||||||
retn;
|
retn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
bool CanUseWeaponHook_Invoke(bool result, fo::GameObject* source, fo::GameObject* weapon, long hitMode) {
|
bool CanUseWeaponHook_Invoke(bool result, fo::GameObject* source, fo::GameObject* weapon, long hitMode) {
|
||||||
return (HookScripts::HookHasScript(HOOK_CANUSEWEAPON))
|
return (HookScripts::HookHasScript(HOOK_CANUSEWEAPON))
|
||||||
? CanUseWeaponHook_Script(result, source, weapon, hitMode)
|
? CanUseWeaponHook_Script(result, source, weapon, hitMode)
|
||||||
: result;
|
: result;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void Inject_ToHitHook() {
|
void Inject_ToHitHook() {
|
||||||
@@ -721,7 +721,7 @@ void Inject_CombatDamageHook() {
|
|||||||
// 0x423DE7, // compute_explosion_on_extras()
|
// 0x423DE7, // compute_explosion_on_extras()
|
||||||
0x423E69, // compute_explosion_on_extras()
|
0x423E69, // compute_explosion_on_extras()
|
||||||
0x424220, // attack_crit_failure()
|
0x424220, // attack_crit_failure()
|
||||||
0x4242FB, // attack_crit_failure()
|
0x4242FB // attack_crit_failure()
|
||||||
});
|
});
|
||||||
MakeCall(0x423DEB, ComputeDamageHook); // compute_explosion_on_extras() - fix for the attacker
|
MakeCall(0x423DEB, ComputeDamageHook); // compute_explosion_on_extras() - fix for the attacker
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,6 @@ int __fastcall AmmoCostHook_Script(DWORD hookType, fo::GameObject* weapon, DWORD
|
|||||||
long CalcApCostHook_Invoke(fo::GameObject* source, long hitMode, long isCalled, long cost, fo::GameObject* weapon);
|
long CalcApCostHook_Invoke(fo::GameObject* source, long hitMode, long isCalled, long cost, fo::GameObject* weapon);
|
||||||
//void FindTargetHook_Invoke(fo::GameObject* targets[], fo::GameObject* attacker);
|
//void FindTargetHook_Invoke(fo::GameObject* targets[], fo::GameObject* attacker);
|
||||||
//fo::GameObject* BestWeaponHook_Invoke(fo::GameObject* bestWeapon, fo::GameObject* source, fo::GameObject* weapon1, fo::GameObject* weapon2, fo::GameObject* target);
|
//fo::GameObject* BestWeaponHook_Invoke(fo::GameObject* bestWeapon, fo::GameObject* source, fo::GameObject* weapon1, fo::GameObject* weapon2, fo::GameObject* target);
|
||||||
bool CanUseWeaponHook_Invoke(bool result, fo::GameObject* source, fo::GameObject* weapon, long hitMode);
|
//bool CanUseWeaponHook_Invoke(bool result, fo::GameObject* source, fo::GameObject* weapon, long hitMode);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -634,21 +634,30 @@ cancelEnc:
|
|||||||
static long __stdcall RollCheckHook_Script(long roll, long chance, long bonus, long randomChance, long calledFrom) {
|
static long __stdcall RollCheckHook_Script(long roll, long chance, long bonus, long randomChance, long calledFrom) {
|
||||||
long hookType;
|
long hookType;
|
||||||
switch (calledFrom - 5) {
|
switch (calledFrom - 5) {
|
||||||
case 0x42388E: // compute_attack_
|
case 0x42388E: // compute_attack_
|
||||||
// compute_spray_
|
case 0x4234D1: // compute_spray_
|
||||||
case 0x4234D1: hookType = 1; break; // single and burst attack hit event
|
hookType = 1; // single and burst attack hit event
|
||||||
// compute_spray_
|
break;
|
||||||
case 0x42356C: hookType = 2; break; // burst attack bullet hit event
|
case 0x42356C: // compute_spray_
|
||||||
// skill_result_
|
hookType = 2; // burst attack bullet hit event
|
||||||
case 0x4AAB29: hookType = 3; break; // common skill check event
|
break;
|
||||||
// skill_use_
|
case 0x4AAB29: // skill_result_
|
||||||
case 0x4AB3B6: hookType = 4; break; // SKILL_REPAIR
|
hookType = 3; // common skill check event
|
||||||
case 0x4AB8B5: hookType = 5; break; // SKILL_DOCTOR
|
break;
|
||||||
// skill_check_stealing_ // SKILL_STEAL
|
case 0x4AB3B6: // skill_use_
|
||||||
case 0x4ABC9F: hookType = 6; break; // source stealing check event
|
hookType = 4; // SKILL_REPAIR
|
||||||
case 0x4ABCE6: hookType = 7; break; // target stealing check event (fail for success stealing)
|
break;
|
||||||
|
case 0x4AB8B5: // skill_use_
|
||||||
|
hookType = 5; // SKILL_DOCTOR
|
||||||
|
break;
|
||||||
|
case 0x4ABC9F: // skill_check_stealing_
|
||||||
|
hookType = 6; // SKILL_STEAL - source stealing check event
|
||||||
|
break;
|
||||||
|
case 0x4ABCE6: // skill_check_stealing_
|
||||||
|
hookType = 7; // SKILL_STEAL - target stealing check event (fail for success stealing)
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return roll; // unsupported hook
|
return roll; // unsupported hook
|
||||||
}
|
}
|
||||||
|
|
||||||
BeginHook();
|
BeginHook();
|
||||||
|
|||||||
@@ -375,14 +375,14 @@ void __declspec(naked) critter_adjust_rads_hack() {
|
|||||||
using namespace Fields;
|
using namespace Fields;
|
||||||
__asm {
|
__asm {
|
||||||
cmp dword ptr [eax + protoId], PID_Player; // critter.pid
|
cmp dword ptr [eax + protoId], PID_Player; // critter.pid
|
||||||
jne isNotDude;
|
jne notDude;
|
||||||
push ecx;
|
push ecx;
|
||||||
call AdjustRads_Script; // ecx - critter, edx - amount
|
call AdjustRads_Script; // ecx - critter, edx - amount
|
||||||
pop ecx;
|
pop ecx;
|
||||||
mov ebx, eax; // old/new amount
|
mov ebx, eax; // old/new amount
|
||||||
mov edx, ds:[FO_VAR_obj_dude];
|
mov edx, ds:[FO_VAR_obj_dude];
|
||||||
xor eax, eax; // for continue func
|
xor eax, eax; // for continue func
|
||||||
isNotDude:
|
notDude:
|
||||||
retn;
|
retn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,8 +77,8 @@ static struct DudeState {
|
|||||||
|
|
||||||
struct PartySneakWorking {
|
struct PartySneakWorking {
|
||||||
fo::GameObject* object;
|
fo::GameObject* object;
|
||||||
unsigned long sneak_queue_time;
|
DWORD sneak_queue_time;
|
||||||
long sneak_working;
|
DWORD sneak_working;
|
||||||
};
|
};
|
||||||
static std::vector<PartySneakWorking> partySneakWorking;
|
static std::vector<PartySneakWorking> partySneakWorking;
|
||||||
|
|
||||||
@@ -867,7 +867,7 @@ void PartyControl::init() {
|
|||||||
|
|
||||||
// Display party member's current level & AC & addict flag
|
// Display party member's current level & AC & addict flag
|
||||||
if (IniReader::GetConfigInt("Misc", "PartyMemberExtraInfo", 0)) {
|
if (IniReader::GetConfigInt("Misc", "PartyMemberExtraInfo", 0)) {
|
||||||
dlogr("Applying display NPC extra info patch.", DL_INIT);
|
dlogr("Applying display extra info patch for party members.", DL_INIT);
|
||||||
HookCall(0x44926F, gdControlUpdateInfo_hook);
|
HookCall(0x44926F, gdControlUpdateInfo_hook);
|
||||||
Translate::Get("sfall", "PartyLvlMsg", "Lvl:", levelMsg, 12);
|
Translate::Get("sfall", "PartyLvlMsg", "Lvl:", levelMsg, 12);
|
||||||
Translate::Get("sfall", "PartyACMsg", "AC:", armorClassMsg, 12);
|
Translate::Get("sfall", "PartyACMsg", "AC:", armorClassMsg, 12);
|
||||||
|
|||||||
Reference in New Issue
Block a user