NewbieImmunity über config-datei kontrolliert.

This commit is contained in:
Enno Rehling 2005-01-07 23:19:10 +00:00
parent 032466e908
commit 0a5c8c0293
6 changed files with 19 additions and 7 deletions

View File

@ -2580,10 +2580,10 @@ steal_cmd(unit * u, struct order * ord, request ** stealorders)
return;
}
if (u2->faction->age < IMMUN_GEGEN_ANGRIFF) {
if (u2->faction->age < NewbieImmunity()) {
add_message(&u->faction->msgs,
msg_feedback(u, ord, "newbie_immunity_error",
"turns", IMMUN_GEGEN_ANGRIFF));
"turns", NewbieImmunity()));
return;
}

View File

@ -2711,7 +2711,7 @@ remove_unequipped_guarded(void)
for (r = regions; r; r = r->next)
for (u = r->units; u; u = u->next) {
if (getguard(u) && (!armedmen(u) || u->faction->age < IMMUN_GEGEN_ANGRIFF))
if (getguard(u) && (!armedmen(u) || u->faction->age < NewbieImmunity()))
setguard(u, GUARD_NONE);
}
}
@ -3609,9 +3609,9 @@ age_factions(void)
for (f = factions; f; f = f->next) {
++f->age;
if (f->age < IMMUN_GEGEN_ANGRIFF) {
if (f->age < NewbieImmunity()) {
add_message(&f->msgs, new_message(f,
"newbieimmunity%i:turns", IMMUN_GEGEN_ANGRIFF - f->age));
"newbieimmunity%i:turns", NewbieImmunity() - f->age));
}
}
}

View File

@ -3577,9 +3577,9 @@ init_battle(region * r, battle **bp)
sprintf(buf, "%s ist böse gewesen...", unitname(u));
mistake(u, ord, buf, MSG_BATTLE);
continue;
} if (u2->faction->age < IMMUN_GEGEN_ANGRIFF) {
} if (u2->faction->age < NewbieImmunity()) {
add_message(&u->faction->msgs,
msg_feedback(u, u->thisorder, "newbie_immunity_error", "turns", IMMUN_GEGEN_ANGRIFF));
msg_feedback(u, u->thisorder, "newbie_immunity_error", "turns", NewbieImmunity()));
continue;
}
/* Fehler: "Die Einheit ist mit uns alliert" */

View File

@ -107,6 +107,16 @@ static attrib_type at_creator = {
/* Rest ist NULL; temporäres, nicht alterndes Attribut */
};
static int
NewbieImmunity(void) {
static int value = -1;
if (value<0) {
const char * str = get_param(global.parameters, "NewbieImmunity");
value = str?atoi(str):IMMUN_GEGEN_ANGRIFF;
}
return value;
}
static int
MaxAge(void) {
static int value = -1;

View File

@ -1181,6 +1181,7 @@ extern int NMRTimeout(void);
extern int LongHunger(const struct unit * u);
extern boolean TradeDisabled(void);
extern int SkillCap(skill_t sk);
extern int NewbieImmunity();
extern int AllianceAuto(void); /* flags that allied factions get automatically */
extern int AllianceRestricted(void); /* flags restricted to allied factions */
extern struct order * default_order(const struct locale * lang);

View File

@ -30,6 +30,7 @@
<param name="nmr.timeout" value="9999"/>
<param name="nmr.removenewbie" value="0"/>
<param name="GiveRestriction" value="3"/>
<param name="NewbieImmunity" value="4"/>
<param name="hunger.long" value="1"/>
<param name="database.gameid" value="3"/>
<param name="globalreport" value="world"/>