Update combFire weapon to use the new getDroidEffectiveLevel function.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3178 4a71c877-e1ca-e34f-864e-861f7616d084
master
Freddie Witherden 2007-12-26 14:25:32 +00:00
parent 624825854c
commit 27c3a29d73
1 changed files with 4 additions and 6 deletions

View File

@ -296,21 +296,19 @@ void combFire(WEAPON *psWeap, BASE_OBJECT *psAttacker, BASE_OBJECT *psTarget, in
// add the attacker's experience // add the attacker's experience
if (psAttacker->type == OBJ_DROID) if (psAttacker->type == OBJ_DROID)
{ {
SDWORD level = getDroidLevel((DROID *)psAttacker); SDWORD level = getDroidEffectiveLevel((DROID *) psAttacker);
SDWORD cmdLevel = cmdGetCommanderLevel((DROID *)psAttacker);
// increase total accuracy by EXP_ACCURACY_BONUS % for each experience level // increase total accuracy by EXP_ACCURACY_BONUS % for each experience level
resultHitChance += EXP_ACCURACY_BONUS * MAX(level, cmdLevel) * baseHitChance / 100; resultHitChance += EXP_ACCURACY_BONUS * level * baseHitChance / 100;
} }
// subtract the defender's experience // subtract the defender's experience
if (psTarget->type == OBJ_DROID) if (psTarget->type == OBJ_DROID)
{ {
SDWORD level = getDroidLevel((DROID *)psTarget); SDWORD level = getDroidEffectiveLevel((DROID *) psTarget);
SDWORD cmdLevel = cmdGetCommanderLevel((DROID *)psTarget);
// decrease weapon accuracy by EXP_ACCURACY_BONUS % for each experience level // decrease weapon accuracy by EXP_ACCURACY_BONUS % for each experience level
resultHitChance -= EXP_ACCURACY_BONUS * MAX(level, cmdLevel) * baseHitChance / 100; resultHitChance -= EXP_ACCURACY_BONUS * level * baseHitChance / 100;
} }