Slight tweak to NPC Combat

This commit is contained in:
Simon 2023-03-28 13:51:49 +01:00
parent 20de6ec478
commit f452b9cf06
2 changed files with 16 additions and 10 deletions

View file

@ -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);
}

View file

@ -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);
}