Minor edits to code and documents

Commented out unused combat related functions.
This commit is contained in:
NovaRain
2023-06-09 11:20:47 +08:00
parent 1c34f85789
commit ab0c373a9b
12 changed files with 45 additions and 37 deletions
+3 -3
View File
@@ -20,7 +20,7 @@ CheckLOS=0
; 16 - bright yellow
; 32 - dark yellow
; 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
; Motion Scanner mode:
@@ -31,11 +31,11 @@ MotionScanner=0
[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 1 to control all critters in combat (allowed only in sfall debugging mode)
;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
;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
+2 -3
View File
@@ -150,7 +150,7 @@ OverrideMusicDir=1
;This will slightly increase the startup time of the game on older computers
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)
;MainMenuMusic=07desert
;WorldMapMusic=23world
@@ -296,8 +296,7 @@ DataLoadOrderPatch=1
;Set to 2 to also load subtitle files from text\<language>\cuts_female\ for female PC
FemaleDialogMsgs=0
;Set to 1 to allow using the special '^' character in dialog msg files to specify the alternative text
;that will be displayed in the dialogue based on the player's gender
;Set to 1 to allow using the caret character '^' in dialog msg files to specify the alternative text based on the player's gender
;The text must be enclosed in angle brackets (example: <MaleText^FemaleText>)
DialogGenderWords=0
+1 -1
View File
@@ -1568,7 +1568,7 @@
- name:
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
- name: set_combat_free_move
+3 -3
View File
@@ -168,7 +168,7 @@ end
* Useful in cunjunction with is_in_array()
*/
procedure string_split_ints(variable str, variable split) begin
variable n;
variable n := 0;
variable list, result, val;
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);
result := temp_array_list(0);
foreach (val in list) begin
if val != "" then begin
if (val != "") then begin
resize_array(result, n + 1);
result[n] := atoi(val);
n += 1;
n++;
end
end
return result;
+1 -1
View File
@@ -1081,7 +1081,7 @@ sfall_funcX metarule functions
##### 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
+2 -2
View File
@@ -19,13 +19,13 @@ namespace game
namespace sf = sfall;
static const long aiUseItemAPCost = 2;
/*
// 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 result = fo::func::ai_can_use_weapon(source, weapon, hitMode);
return sf::CanUseWeaponHook_Invoke(result, source, weapon, hitMode);
}
*/
static long drugUsePerfFixMode;
void __stdcall CombatAI::ai_check_drugs(fo::GameObject* source) {
+1 -1
View File
@@ -15,7 +15,7 @@ class CombatAI {
public:
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);
};
+3 -3
View File
@@ -670,13 +670,13 @@ static void __declspec(naked) CanUseWeaponHook() {
retn;
}
}
/*
bool CanUseWeaponHook_Invoke(bool result, fo::GameObject* source, fo::GameObject* weapon, long hitMode) {
return (HookScripts::HookHasScript(HOOK_CANUSEWEAPON))
? CanUseWeaponHook_Script(result, source, weapon, hitMode)
: result;
}
*/
////////////////////////////////////////////////////////////////////////////////
void Inject_ToHitHook() {
@@ -721,7 +721,7 @@ void Inject_CombatDamageHook() {
// 0x423DE7, // compute_explosion_on_extras()
0x423E69, // compute_explosion_on_extras()
0x424220, // attack_crit_failure()
0x4242FB, // attack_crit_failure()
0x4242FB // attack_crit_failure()
});
MakeCall(0x423DEB, ComputeDamageHook); // compute_explosion_on_extras() - fix for the attacker
}
+1 -1
View File
@@ -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);
//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);
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);
}
+23 -14
View File
@@ -634,21 +634,30 @@ cancelEnc:
static long __stdcall RollCheckHook_Script(long roll, long chance, long bonus, long randomChance, long calledFrom) {
long hookType;
switch (calledFrom - 5) {
case 0x42388E: // compute_attack_
// compute_spray_
case 0x4234D1: hookType = 1; break; // single and burst attack hit event
// compute_spray_
case 0x42356C: hookType = 2; break; // burst attack bullet hit event
// skill_result_
case 0x4AAB29: hookType = 3; break; // common skill check event
// skill_use_
case 0x4AB3B6: hookType = 4; break; // SKILL_REPAIR
case 0x4AB8B5: hookType = 5; break; // SKILL_DOCTOR
// skill_check_stealing_ // SKILL_STEAL
case 0x4ABC9F: hookType = 6; break; // source stealing check event
case 0x4ABCE6: hookType = 7; break; // target stealing check event (fail for success stealing)
case 0x42388E: // compute_attack_
case 0x4234D1: // compute_spray_
hookType = 1; // single and burst attack hit event
break;
case 0x42356C: // compute_spray_
hookType = 2; // burst attack bullet hit event
break;
case 0x4AAB29: // skill_result_
hookType = 3; // common skill check event
break;
case 0x4AB3B6: // skill_use_
hookType = 4; // SKILL_REPAIR
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:
return roll; // unsupported hook
return roll; // unsupported hook
}
BeginHook();
+2 -2
View File
@@ -375,14 +375,14 @@ void __declspec(naked) critter_adjust_rads_hack() {
using namespace Fields;
__asm {
cmp dword ptr [eax + protoId], PID_Player; // critter.pid
jne isNotDude;
jne notDude;
push ecx;
call AdjustRads_Script; // ecx - critter, edx - amount
pop ecx;
mov ebx, eax; // old/new amount
mov edx, ds:[FO_VAR_obj_dude];
xor eax, eax; // for continue func
isNotDude:
notDude:
retn;
}
}
+3 -3
View File
@@ -77,8 +77,8 @@ static struct DudeState {
struct PartySneakWorking {
fo::GameObject* object;
unsigned long sneak_queue_time;
long sneak_working;
DWORD sneak_queue_time;
DWORD sneak_working;
};
static std::vector<PartySneakWorking> partySneakWorking;
@@ -867,7 +867,7 @@ void PartyControl::init() {
// Display party member's current level & AC & addict flag
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);
Translate::Get("sfall", "PartyLvlMsg", "Lvl:", levelMsg, 12);
Translate::Get("sfall", "PartyACMsg", "AC:", armorClassMsg, 12);