mirror of
https://github.com/DrBeef/JKXR.git
synced 2024-11-22 04:01:33 +00:00
Make NPCs fire at different locations on the player
50% - Chest 30% - Legs 20% - Head
This commit is contained in:
parent
c46603adf3
commit
b9b10a9876
1 changed files with 10 additions and 1 deletions
|
@ -2033,7 +2033,16 @@ int NPC_ShotEntity( gentity_t *ent, vec3_t impactPos )
|
|||
{
|
||||
CalcEntitySpot( NPC, SPOT_WEAPON, muzzle );
|
||||
}
|
||||
CalcEntitySpot( ent, SPOT_CHEST, targ );
|
||||
|
||||
int location = Q_irand(0, 9);
|
||||
if (location <= 4 || cg.renderingThirdPerson ||
|
||||
ent->client->ps.clientNum != 0) { //50% chance (unless ent is not the player, then always go for chest, which is original behaviour)
|
||||
CalcEntitySpot(ent, SPOT_CHEST, targ);
|
||||
} else if (location <= 7) { //30% chance
|
||||
CalcEntitySpot(ent, SPOT_LEGS, targ);
|
||||
} else { // 20% chance
|
||||
CalcEntitySpot(ent, SPOT_HEAD, targ);
|
||||
}
|
||||
|
||||
// add aim error
|
||||
// use weapon instead of specific npc types, although you could add certain npc classes if you wanted
|
||||
|
|
Loading…
Reference in a new issue