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

View File

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

View File

@ -276,7 +276,7 @@ const char *options[MAXOPTIONS] =
};
int
max_skill(faction * f, skill_t sk)
max_skill(const faction * f, skill_t sk)
{
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_UNNAMED (1<<26) /* Partei/Einheit/Gebäude/Schiff ist unbenannt */
#define FFL_RESTART (1<<2)
#define FFL_OVERRIDE (1<<27) /* Override-Passwort wurde benutzt */
/* 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);
/* 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_all_money(const struct region * r);