While adding in accuracy decrease due to head and arm injuries, I noticed in g_combat.c:G_ShootSingle:
/* Calculate spread multiplier to give worse precision when HPs are not at max */
injurymultiplier = GET_INJURY_MULT(ent->chr.score.skills[ABILITY_MIND], ent->HP, ent->chr.maxHP == 0 ? 100 : ent->chr.maxHP);
Com_DPrintf(DEBUG_GAME, "G_ShootSingle: injury spread multiplier = %5.3f (mind %d, HP %d, maxHP %d)\n", injurymultiplier,
ent->chr.score.skills[ABILITY_MIND], ent->HP, ent->chr.maxHP == 0 ? 100 : ent->chr.maxHP);
anyways, the code I'm adding to this function before this call is:
/* Get accuracy value for this attacker. */
acc = GET_ACC(ent->chr.score.skills[ABILITY_ACCURACY], fd->weaponSkill ? ent->chr.score.skills[fd->weaponSkill] : 0);
acc -= ((G_ActorAccuracyDecreaseByWounds(ent) / 100) * acc); <-- This line only.
/* Get 2 gaussian distributed random values */
gaussrand(&gauss1, &gauss2);
Let me know if I should do this a different way, for now injuries will be counted twice -- once due to arm and head injuries, and a second time via total hp missing.. Not sure if that's too much or not.
(Edit) This is appearing on page 12, so I'd like to mention I posted 2 other posts on page 11 today, be sure to check them out too since I doubt the board will show them...