Routine fuer "Teure Fremde" hat auch Untote korrigiert.

This commit is contained in:
Enno Rehling 2007-03-11 20:52:09 +00:00
parent 8b2897406c
commit e9feec08ba
5 changed files with 44 additions and 39 deletions

View File

@ -1153,9 +1153,10 @@ demon_skillchanges(void)
while (weeks--) learn_skill(u, sv->id, 1.0); while (weeks--) learn_skill(u, sv->id, 1.0);
} }
if (sv->old>sv->level) { if (sv->old>sv->level) {
if (!quiet) {
log_printf("%s dropped from %u to %u:%u in %s\n", log_printf("%s dropped from %u to %u:%u in %s\n",
unitname(u), sv->old, sv->level, unitname(u), sv->old, sv->level, sv->weeks, skillname(sv->id, NULL));
sv->weeks, skillname(sv->id, NULL)); }
} }
} }
++sv; ++sv;

View File

@ -82,8 +82,8 @@ is_migrant(unit *u)
{ {
if (u->race == u->faction->race) return false; if (u->race == u->faction->race) return false;
if (fval(u->race, RCF_UNDEAD|RCF_ILLUSIONARY)) return false;
if (is_familiar(u)) return false; if (is_familiar(u)) return false;
if (u->race == new_race[RC_TOAD]) return false; if (u->race == new_race[RC_TOAD]) return false;
return true; return true;

View File

@ -217,12 +217,18 @@ warn_items(void)
static boolean static boolean
kor_teure_talente(unit *u) kor_teure_talente(unit *u)
{ {
if(effskill(u, SK_TACTICS) >= 1 || const skill_t expskills[] = { SK_ALCHEMY, SK_HERBALISM, SK_MAGIC, SK_SPY, SK_TACTICS, NOSKILL };
effskill(u, SK_MAGIC) >= 1 || skill * sv = u->skills;
effskill(u, SK_ALCHEMY) >= 1 || for (;sv!=u->skills+u->skill_size;++sv) {
effskill(u, SK_HERBALISM) >= 1 || int l = 0, h = 4;
effskill(u, SK_SPY) >= 1) { skill_t sk = sv->id;
return true; assert(expskills[h]==NOSKILL);
while (l<h) {
int m = (l+h)/2;
if (sk==expskills[m]) return true;
else if (sk>expskills[m]) l=m+1;
else h=m;
}
} }
return false; return false;
} }
@ -231,22 +237,19 @@ static void
no_teurefremde(boolean convert) no_teurefremde(boolean convert)
{ {
const curse_type * slave_ct = ct_find("slavery"); const curse_type * slave_ct = ct_find("slavery");
region *r; faction * f;
for(r=regions;r;r=r->next) { for (f=factions;f;f=f->next) {
if (f->no != MONSTER_FACTION) {
unit *u; unit *u;
for (u=f->units;u;u=u->nextF) {
for(u=r->units;u;u=u->next) { if (is_migrant(u) && kor_teure_talente(u)) {
if (u->faction->no != MONSTER_FACTION && playerrace(u->faction->race)
&& is_migrant(u) && kor_teure_talente(u))
{
if (slave_ct && curse_active(get_curse(u->attribs, slave_ct))) if (slave_ct && curse_active(get_curse(u->attribs, slave_ct)))
continue; continue;
log_warning(("Teurer Migrant: %s, Partei %s\n", log_warning(("Teurer Migrant: %s, Partei %s\n", unitname(u), factionname(f)));
unitname(u), factionname(u->faction)));
if (convert) { if (convert) {
u->race = u->faction->race; u->race = f->race;
u->irace = u->faction->race; u->irace = f->race;
sprintf(buf, "Die Götter segnen %s mit der richtigen Rasse", sprintf(buf, "Die Götter segnen %s mit der richtigen Rasse",
unitname(u)); unitname(u));
addmessage(0, u->faction, buf, MSG_MESSAGE, ML_IMPORTANT); addmessage(0, u->faction, buf, MSG_MESSAGE, ML_IMPORTANT);
@ -255,6 +258,7 @@ no_teurefremde(boolean convert)
} }
} }
} }
}
extern plane * arena; extern plane * arena;