Enabled AI to use unarmed attack when switching weapons

Added build folders to gitignore.
This commit is contained in:
NovaRain
2021-05-08 23:16:14 +08:00
parent 2d2c13b35e
commit 45a268ee77
3 changed files with 20 additions and 0 deletions
+2
View File
@@ -53,8 +53,10 @@ nb-configuration.xml
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Dd]evXP/
[Rr]elease/
[Rr]eleases/
[Ww]in2K/
x64/
x86/
build/
+9
View File
@@ -276,7 +276,14 @@ static long __fastcall ai_try_attack_switch_fix(TGameObj* target, long &hitMode,
}
return 1; // all good, execute vanilla behavior of ai_switch_weapons_ function
}
// no other weapon in inventory
if (weapon) {
if (fo_item_w_range(source, ATKTYPE_PUNCH) >= fo_obj_dist(source, target)) {
hitMode = ATKTYPE_PUNCH;
return 0; // change hit mode, continue attack cycle
}
}
return (weapon) ? -1 // exit, NPC has a weapon in hand slot, so we don't look for another weapon on the map
: 1; // no weapon in inventory or hand slot, continue to search weapons on the map (call ai_switch_weapons_)
}
@@ -544,6 +551,8 @@ static void __declspec(naked) ai_try_attack_hack_check_safe_weapon() {
}
}
////////////////////////////////////////////////////////////////////////////////
static void __fastcall CombatAttackHook(TGameObj* source, TGameObj* target) {
sources[target] = source; // who attacked the 'target' from the last time
targets[source] = target; // who was attacked by the 'source' from the last time
+9
View File
@@ -278,15 +278,24 @@ enum ArtType : char
// Some FO2 PIDs possibly used by engine
enum ProtoID : unsigned long
{
PID_POWERED_ARMOR = 3,
PID_STIMPAK = 40,
PID_BOTTLE_CAPS = 41,
PID_DYNAMITE = 51,
PID_GEIGER_COUNTER = 52,
PID_STEALTH_BOY = 54,
PID_MOTION_SENSOR = 59,
PID_PLASTIC_EXPLOSIVES = 85,
PID_SUPER_STIMPAK = 144,
PID_ACTIVE_DYNAMITE = 206,
PID_ACTIVE_GEIGER_COUNTER = 207,
PID_ACTIVE_PLASTIC_EXPLOSIVE = 209,
PID_ACTIVE_STEALTH_BOY = 210,
PID_HARDENED_POWER_ARMOR = 232,
PID_JET = 259,
PID_HEALING_POWDER = 273,
PID_ADVANCED_POWER_ARMOR = 348,
PID_ADVANCED_POWER_ARMOR_MK2 = 349,
PID_SOLAR_SCORCHER = 390,
PID_CAR_TRUNK = 455,
PID_JESSE_CONTAINER = 467,