Fehlende "" um skill-namen

This commit is contained in:
Enno Rehling 2005-07-10 20:58:13 +00:00
parent e1dc630bcd
commit a96d3807a6
1 changed files with 70 additions and 64 deletions

View File

@ -80,16 +80,17 @@ is_waiting(const unit * u)
static order * static order *
monster_attack(unit * u, const unit * target) monster_attack(unit * u, const unit * target)
{ {
char zText[20]; char zText[20];
if (u->region!=target->region) return NULL; if (u->region!=target->region) return NULL;
if (u->faction==target->faction) return NULL; if (u->faction==target->faction) return NULL;
if (!cansee(u->faction, u->region, target, 0)) return NULL; if (!cansee(u->faction, u->region, target, 0)) return NULL;
if (is_waiting(u)) return NULL; if (is_waiting(u)) return NULL;
sprintf(zText, "%s %s", sprintf(zText, "%s %s",
locale_string(u->faction->locale, keywords[K_ATTACK]), unitid(target)); locale_string(u->faction->locale, keywords[K_ATTACK]),
return parse_order(zText, u->faction->locale); unitid(target));
return parse_order(zText, u->faction->locale);
} }
@ -324,7 +325,8 @@ monster_move(region * r, unit * u)
if (d == NODIRECTION) if (d == NODIRECTION)
return NULL; return NULL;
sprintf(buf, "%s %s", locale_string(u->faction->locale, keywords[K_MOVE]), locale_string(u->faction->locale, directions[d])); sprintf(buf, "%s %s", locale_string(u->faction->locale, keywords[K_MOVE]),
locale_string(u->faction->locale, directions[d]));
return parse_order(buf, u->faction->locale); return parse_order(buf, u->faction->locale);
} }
@ -453,35 +455,36 @@ monster_seeks_target(region *r, unit *u)
return NULL; /* this is a bug workaround! remove!! */ return NULL; /* this is a bug workaround! remove!! */
} }
if(r == target->region ) { /* Wir haben ihn! */ if(r == target->region ) { /* Wir haben ihn! */
if (u->race == new_race[RC_ALP]) { if (u->race == new_race[RC_ALP]) {
alp_findet_opfer(u, r); alp_findet_opfer(u, r);
} }
else { else {
assert(!"Seeker-Monster hat keine Aktion fuer Ziel"); assert(!"Seeker-Monster hat keine Aktion fuer Ziel");
} }
return NULL; return NULL;
} }
/* Simpler Ansatz: Nachbarregion mit gerinster Distanz suchen. /* Simpler Ansatz: Nachbarregion mit gerinster Distanz suchen.
* Sinnvoll momentan nur bei Monstern, die sich nicht um das * Sinnvoll momentan nur bei Monstern, die sich nicht um das
* Terrain kümmern. Nebelwände & Co machen derzeit auch nix... * Terrain kümmern. Nebelwände & Co machen derzeit auch nix...
*/ */
dist2 = distance(r, target->region); dist2 = distance(r, target->region);
d = NODIRECTION; d = NODIRECTION;
for( i = 0; i < MAXDIRECTIONS; i++ ) { for( i = 0; i < MAXDIRECTIONS; i++ ) {
nr = rconnect(r, i); nr = rconnect(r, i);
assert(nr); assert(nr);
dist = distance(nr, target->region); dist = distance(nr, target->region);
if( dist < dist2 ) { if( dist < dist2 ) {
dist2 = dist; dist2 = dist;
d = i; d = i;
} }
} }
assert(d != NODIRECTION ); assert(d != NODIRECTION );
sprintf(buf, "%s %s", locale_string(u->faction->locale, keywords[K_MOVE]), locale_string(u->faction->locale, directions[d])); sprintf(buf, "%s %s", locale_string(u->faction->locale, keywords[K_MOVE]),
return parse_order(buf, u->faction->locale); locale_string(u->faction->locale, directions[d]));
return parse_order(buf, u->faction->locale);
} }
unit * unit *
@ -677,32 +680,32 @@ extern attrib_type at_direction;
static order * static order *
monster_learn(unit *u) monster_learn(unit *u)
{ {
int c = 0; int c = 0;
int n; int n;
skill * sv; skill * sv;
const struct locale * lang = u->faction->locale; const struct locale * lang = u->faction->locale;
/* Monster lernt ein zufälliges Talent aus allen, in denen es schon /* Monster lernt ein zufälliges Talent aus allen, in denen es schon
* Lerntage hat. */ * Lerntage hat. */
for (sv = u->skills; sv != u->skills + u->skill_size; ++sv) { for (sv = u->skills; sv != u->skills + u->skill_size; ++sv) {
if (sv->level>0) ++c; if (sv->level>0) ++c;
} }
if(c == 0) return NULL; if(c == 0) return NULL;
n = rand()%c + 1; n = rand()%c + 1;
c = 0; c = 0;
for (sv = u->skills; sv != u->skills + u->skill_size; ++sv) { for (sv = u->skills; sv != u->skills + u->skill_size; ++sv) {
if (sv->level>0) { if (sv->level>0) {
if (++c == n) { if (++c == n) {
sprintf(buf, "%s %s", locale_string(lang, keywords[K_STUDY]), sprintf(buf, "%s \"%s\"", locale_string(lang, keywords[K_STUDY]),
skillname(sv->id, lang)); skillname(sv->id, lang));
return parse_order(buf, lang); return parse_order(buf, lang);
} }
} }
} }
return NULL; return NULL;
} }
@ -775,7 +778,8 @@ recruit_dracoids(unit * dragon, int size)
if (weapon->rtype->wtype->flags & WTF_MISSILE) un->status = ST_BEHIND; if (weapon->rtype->wtype->flags & WTF_MISSILE) un->status = ST_BEHIND;
else un->status = ST_FIGHT; else un->status = ST_FIGHT;
sprintf(buf, "%s \"%s\"", keywords[K_STUDY], skillname(weapon->rtype->wtype->skill, f->locale)); sprintf(buf, "%s \"%s\"", keywords[K_STUDY],
skillname(weapon->rtype->wtype->skill, f->locale));
new_order = parse_order(buf, default_locale); new_order = parse_order(buf, default_locale);
#ifdef LASTORDER #ifdef LASTORDER
set_order(&un->lastorder, new_order); set_order(&un->lastorder, new_order);
@ -870,7 +874,8 @@ plan_dragon(unit * u)
} }
} }
if (long_order==NULL) { if (long_order==NULL) {
sprintf(buf, "%s \"%s\"", keywords[K_STUDY], skillname(SK_OBSERVATION, u->faction->locale)); sprintf(buf, "%s \"%s\"", keywords[K_STUDY],
skillname(SK_OBSERVATION, u->faction->locale));
long_order = parse_order(buf, default_locale); long_order = parse_order(buf, default_locale);
} }
return long_order; return long_order;
@ -953,8 +958,9 @@ plan_monsters(void)
* zu bewachen: */ * zu bewachen: */
if (u->race->bonus[SK_WEAPONLESS] != -99) { if (u->race->bonus[SK_WEAPONLESS] != -99) {
if (eff_skill(u, SK_WEAPONLESS, u->region) < 1) { if (eff_skill(u, SK_WEAPONLESS, u->region) < 1) {
sprintf(buf, "%s %s", locale_string(f->locale, keywords[K_STUDY]), sprintf(buf, "%s \"%s\"",
skillname(SK_WEAPONLESS, f->locale)); locale_string(f->locale, keywords[K_STUDY]),
skillname(SK_WEAPONLESS, f->locale));
long_order = parse_order(buf, f->locale); long_order = parse_order(buf, f->locale);
} }
} }