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