forked from github/server
calculating score based on unmodified skill-level (faster, more accurate).
This commit is contained in:
parent
873404d8f4
commit
12906232f1
|
@ -107,9 +107,10 @@ score(void)
|
|||
}
|
||||
}
|
||||
for (u = r->units; u; u = u->next) {
|
||||
char index;
|
||||
item * itm;
|
||||
int itemscore = 0;
|
||||
int i;
|
||||
|
||||
if (u->race == new_race[RC_SPELL] || u->race == new_race[RC_BIRTHDAYDRAGON])
|
||||
continue;
|
||||
|
||||
|
@ -124,25 +125,22 @@ score(void)
|
|||
}
|
||||
f->score += itemscore / 10;
|
||||
|
||||
for (index = 0; index != MAXSKILLS; index++) {
|
||||
switch (index) {
|
||||
for (i=0;i!=u->skill_size;++i) {
|
||||
skill * sv = u->skills+i;
|
||||
switch (sv->id) {
|
||||
case SK_MAGIC:
|
||||
f->score += u->number * ((int) pow((double) eff_skill(u, index, r),
|
||||
(double) 4));
|
||||
f->score += (int)(u->number * pow(sv->level, 4));
|
||||
break;
|
||||
case SK_TACTICS:
|
||||
f->score += u->number * ((int) pow((double) eff_skill(u, index, r),
|
||||
(double) 3));
|
||||
f->score += (int)(u->number * pow(sv->level, 3));
|
||||
break;
|
||||
case SK_SPY:
|
||||
case SK_ALCHEMY:
|
||||
case SK_HERBALISM:
|
||||
f->score += u->number * ((int) pow((double) eff_skill(u, index, r),
|
||||
(double) 2.5));
|
||||
f->score += (int)(u->number * pow(sv->level, 2.5));
|
||||
break;
|
||||
default:
|
||||
f->score += u->number * ((int) pow((double) eff_skill(u, index, r),
|
||||
(double) 2.5)) / 10;
|
||||
f->score += (int)(u->number * pow(sv->level, 2.5) / 10);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue