mirror of
https://github.com/DrBeef/JKXR.git
synced 2024-11-24 21:11:03 +00:00
Slight tweak to NPC Combat
This commit is contained in:
parent
20de6ec478
commit
f452b9cf06
2 changed files with 16 additions and 10 deletions
|
@ -2256,13 +2256,16 @@ int NPC_ShotEntity( gentity_t *ent, vec3_t impactPos )
|
|||
CalcEntitySpot( NPC, SPOT_WEAPON, muzzle );
|
||||
}
|
||||
|
||||
int location = Q_irand(0, 9);
|
||||
if (location <= 4 || cg.renderingThirdPerson ||
|
||||
ent->client == NULL || ent->client->ps.clientNum != 0) { //50% chance (unless ent is not the player, then always go for chest, which is original behaviour)
|
||||
int location = Q_irand(0, 99);
|
||||
if (location < 65 || cg.renderingThirdPerson ||
|
||||
ent->client == NULL || ent->client->ps.clientNum != 0) {
|
||||
// 65% 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
|
||||
} else if (location < 85) {
|
||||
// 20% chance
|
||||
CalcEntitySpot(ent, SPOT_LEGS, targ);
|
||||
} else { // 20% chance
|
||||
} else {
|
||||
// 15% chance
|
||||
CalcEntitySpot(ent, SPOT_HEAD, targ);
|
||||
}
|
||||
|
||||
|
|
|
@ -2034,13 +2034,16 @@ int NPC_ShotEntity( gentity_t *ent, vec3_t impactPos )
|
|||
CalcEntitySpot( NPC, SPOT_WEAPON, muzzle );
|
||||
}
|
||||
|
||||
int location = Q_irand(0, 9);
|
||||
if (location <= 4 || cg.renderingThirdPerson ||
|
||||
ent->client == NULL || ent->client->ps.clientNum != 0) { //50% chance (unless ent is not the player, then always go for chest, which is original behaviour)
|
||||
int location = Q_irand(0, 99);
|
||||
if (location < 65 || cg.renderingThirdPerson ||
|
||||
ent->client == NULL || ent->client->ps.clientNum != 0) {
|
||||
// 65% 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
|
||||
} else if (location < 85) {
|
||||
// 20% chance
|
||||
CalcEntitySpot(ent, SPOT_LEGS, targ);
|
||||
} else { // 20% chance
|
||||
} else {
|
||||
// 15% chance
|
||||
CalcEntitySpot(ent, SPOT_HEAD, targ);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue