* RESTART nur noch einmal im Leben der Partei

* Limitierte Talente nicht mit Flinkfingerring benutzbar
This commit is contained in:
Enno Rehling 2002-03-24 11:24:57 +00:00
parent f5c440328a
commit 3b0030bc61
4 changed files with 21 additions and 20 deletions

View File

@ -240,6 +240,7 @@ restart(unit *u, const race * rc)
unit * nu = f->units; unit * nu = f->units;
strlist ** o=&u->orders; strlist ** o=&u->orders;
fset(f, FFL_RESTART);
fprintf(sqlstream, "UPDATE subscriptions set faction='%s' where faction" fprintf(sqlstream, "UPDATE subscriptions set faction='%s' where faction"
"='%s' and game=%d;", itoa36(u->faction->no), itoa36(f->no), GAME_ID); "='%s' and game=%d;", itoa36(u->faction->no), itoa36(f->no), GAME_ID);
f->magiegebiet = u->faction->magiegebiet; f->magiegebiet = u->faction->magiegebiet;
@ -1154,17 +1155,14 @@ quit(void)
s_pass = getstrtoken(); s_pass = getstrtoken();
} }
if(frace != u->faction->race) { if (frace != u->faction->race && u->faction->age < 81) {
if(u->faction->age < 81) {
cmistake(u, S->s, 241, MSG_EVENT); cmistake(u, S->s, 241, MSG_EVENT);
continue; continue;
} }
} else { if (u->faction->age > 3 || fval(u->faction, FFL_RESTART)) {
if(u->faction->age < 9) {
cmistake(u, S->s, 305, MSG_EVENT); cmistake(u, S->s, 305, MSG_EVENT);
continue; continue;
} }
}
if (!playerrace(frace)) { if (!playerrace(frace)) {
cmistake(u, S->s, 243, MSG_EVENT); cmistake(u, S->s, 243, MSG_EVENT);

View File

@ -587,8 +587,7 @@ build(unit * u, const construction * ctype, int completed, int want)
skills += dm * effsk; skills += dm * effsk;
} }
for (;want>0 && skills>0;) { for (;want>0 && skills>0;) {
int c, n, i = 0; int c, n;
item * itm;
/* skip over everything that's already been done: /* skip over everything that's already been done:
* type->improvement==NULL means no more improvements, but no size limits * type->improvement==NULL means no more improvements, but no size limits
@ -631,12 +630,15 @@ build(unit * u, const construction * ctype, int completed, int want)
} else { } else {
n = skills; n = skills;
} }
itm = *i_find(&u->items, olditemtype[I_RING_OF_NIMBLEFINGER]); if (max_skill(u->faction, type->skill)==INT_MAX) {
int i = 0;
item * itm = *i_find(&u->items, olditemtype[I_RING_OF_NIMBLEFINGER]);
if (itm!=NULL) i = itm->number; if (itm!=NULL) i = itm->number;
if (i>0) { if (i>0) {
int rings = min(u->number, i); int rings = min(u->number, i);
n = n * (9*rings+u->number) / u->number; n = n * (9*rings+u->number) / u->number;
} }
}
if (want>0) if (want>0)
n = min(want, n); n = min(want, n);

View File

@ -276,7 +276,7 @@ const char *options[MAXOPTIONS] =
}; };
int int
max_skill(faction * f, skill_t sk) max_skill(const faction * f, skill_t sk)
{ {
int m = INT_MAX; int m = INT_MAX;

View File

@ -884,6 +884,7 @@ extern int max_unique_id;
#define FL_TAKEALL (1<<25) /* Einheit nimmt alle Gegenstände an */ #define FL_TAKEALL (1<<25) /* Einheit nimmt alle Gegenstände an */
#define FL_UNNAMED (1<<26) /* Partei/Einheit/Gebäude/Schiff ist unbenannt */ #define FL_UNNAMED (1<<26) /* Partei/Einheit/Gebäude/Schiff ist unbenannt */
#define FFL_RESTART (1<<2)
#define FFL_OVERRIDE (1<<27) /* Override-Passwort wurde benutzt */ #define FFL_OVERRIDE (1<<27) /* Override-Passwort wurde benutzt */
/* Flags, die gespeichert werden sollen: */ /* Flags, die gespeichert werden sollen: */
@ -918,7 +919,7 @@ extern boolean check_leuchtturm(struct region * r, struct faction * f);
extern void update_lighthouse(struct building * lh); extern void update_lighthouse(struct building * lh);
/* skills */ /* skills */
extern int max_skill(struct faction * f, skill_t sk); extern int max_skill(const struct faction * f, skill_t sk);
extern int count_skill(struct faction * f, skill_t sk); extern int count_skill(struct faction * f, skill_t sk);
extern int count_all_money(const struct region * r); extern int count_all_money(const struct region * r);