- Bei der Berechnung des Talentunterschieds für Lerne/Lehre werden

item_modifications nicht mehr berücksichtigt.
This commit is contained in:
Christian Schlittchen 2002-11-27 19:53:04 +00:00
parent 6458ff490d
commit 5de27cf583
4 changed files with 25 additions and 10 deletions

View File

@ -291,7 +291,7 @@ teach(region * r, unit * u)
for (i=0;teachskill[i]!=NOSKILL;++i) if (sk==teachskill[i]) break;
sk = teachskill[i];
}
if (sk != NOSKILL && eff_skill(u, sk, r) > eff_skill(student, sk, r)) {
if (sk != NOSKILL && eff_skill_study(u, sk, r)-TEACHDIFFERENCE > eff_skill_study(student, sk, r)) {
teaching -= teach_unit(u, student, teaching, sk, true, &academy);
}
}
@ -304,7 +304,7 @@ teach(region * r, unit * u)
if (igetkeyword(student->thisorder, student->faction->locale) == K_STUDY) {
/* Input ist nun von student->thisorder !! */
sk = getskill(student->faction->locale);
if (sk != NOSKILL && eff_skill(u, sk, r)-TEACHDIFFERENCE >= eff_skill(student, sk, r)) {
if (sk != NOSKILL && eff_skill_study(u, sk, r)-TEACHDIFFERENCE >= eff_skill(student, sk, r)) {
teaching -= teach_unit(u, student, teaching, sk, true, &academy);
}
}
@ -407,7 +407,7 @@ teach(region * r, unit * u)
continue;
}
/* u is teacher, u2 is student */
if (eff_skill(u2, sk, r) > eff_skill(u, sk, r)-TEACHDIFFERENCE) {
if (eff_skill_study(u2, sk, r) > eff_skill_study(u, sk, r)-TEACHDIFFERENCE) {
add_message(&u->faction->msgs,
msg_error(u, u->thisorder, "teach_asgood", "student", u2));
continue;

View File

@ -633,7 +633,7 @@ spskill(const struct locale * lang, const struct unit * u, skill_t sk, int *dh,
int diff;
if(skill->old > 0) {
oldeff = skill->old + get_modifier(u, sk, skill->old, u->region);
oldeff = skill->old + get_modifier(u, sk, skill->old, u->region, false);
}
oldeff = max(0, oldeff);

View File

@ -963,8 +963,7 @@ item_modification(const unit *u, skill_t sk, int val)
/* Presseausweis: *2 Spionage, 0 Tarnung */
if(sk == SK_SPY && get_item(u, I_PRESSCARD) >= u->number) {
val = val * 2;
}
if(sk == SK_STEALTH) {
} else if(sk == SK_STEALTH) {
#if NEWATSROI == 1
if(get_item(u, I_RING_OF_INVISIBILITY)
+ 100 * get_item(u, I_SPHERE_OF_INVISIBILITY) >= u->number) {
@ -1031,7 +1030,7 @@ att_modification(const unit *u, skill_t sk)
}
int
get_modifier(const unit * u, skill_t sk, int level, const region * r)
get_modifier(const unit *u, skill_t sk, int level, const region *r, boolean noitem)
{
int bskill = level;
int skill = bskill;
@ -1042,7 +1041,9 @@ get_modifier(const unit * u, skill_t sk, int level, const region * r)
skill += rc_skillmod(u->race, r, sk);
skill += att_modification(u, sk);
skill = item_modification(u, sk, skill);
if(noitem == false) {
skill = item_modification(u, sk, skill);
}
skill = skillmod(u->attribs, u, r, sk, skill, SMF_ALWAYS);
if (fspecial(u->faction, FS_TELEPATHY)) {
@ -1072,7 +1073,19 @@ eff_skill(const unit * u, skill_t sk, const region * r)
{
int level = get_level(u, sk);
if (level>0) {
int mlevel = level + get_modifier(u, sk, level, r);
int mlevel = level + get_modifier(u, sk, level, r, false);
if (mlevel>0) return mlevel;
}
return 0;
}
int
eff_skill_study(const unit * u, skill_t sk, const region * r)
{
int level = get_level(u, sk);
if (level>0) {
int mlevel = level + get_modifier(u, sk, level, r, true);
if (mlevel>0) return mlevel;
}

View File

@ -120,7 +120,9 @@ extern int get_level(const struct unit * u, skill_t id);
extern void transfermen(struct unit * u, struct unit * u2, int n);
extern int eff_skill(const struct unit * u, skill_t sk, const struct region * r);
extern int get_modifier(const struct unit * u, skill_t sk, int lvl, const struct region * r);
extern int eff_skill_study(const struct unit * u, skill_t sk, const struct region * r);
extern int get_modifier(const struct unit * u, skill_t sk, int lvl, const struct region * r, boolean noitem);
#undef DESTROY