forked from github/server
- Spezialeigenschaft: Lykanthrop
This commit is contained in:
parent
278731ec04
commit
1309dba1ec
|
@ -583,6 +583,8 @@ givemen(int n, unit * u, unit * u2, const char * cmd)
|
|||
error = 73;
|
||||
} else if (u2 && (has_skill(u, SK_MAGIC) || has_skill(u2, SK_MAGIC))) {
|
||||
error = 158;
|
||||
} else if (fval(u, UFL_WERE) != fval(u2, UFL_WERE)) {
|
||||
error = 312;
|
||||
} else {
|
||||
if (n > u->number) n = u->number;
|
||||
if (n == 0) {
|
||||
|
@ -3002,6 +3004,11 @@ entertain(region * r, unit * u)
|
|||
int max_e;
|
||||
request *o;
|
||||
|
||||
if (fval(u, UFL_WERE)) {
|
||||
cmistake(u, findorder(u, u->thisorder), 58, MSG_INCOME);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!effskill(u, SK_ENTERTAINMENT)) {
|
||||
cmistake(u, findorder(u, u->thisorder), 58, MSG_INCOME);
|
||||
return;
|
||||
|
@ -3094,6 +3101,10 @@ work(region * r, unit * u)
|
|||
request *o;
|
||||
int w;
|
||||
|
||||
if(fval(u, UFL_WERE)) {
|
||||
cmistake(u, findorder(u, u->thisorder), 313, MSG_INCOME);
|
||||
return;
|
||||
}
|
||||
if (besieged(u)) {
|
||||
cmistake(u, findorder(u, u->thisorder), 60, MSG_INCOME);
|
||||
return;
|
||||
|
@ -3146,6 +3157,11 @@ tax(region * r, unit * u, request ** taxorders)
|
|||
cmistake(u, findorder(u, u->thisorder), 228, MSG_INCOME);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fval(u, UFL_WERE)) {
|
||||
cmistake(u, findorder(u, u->thisorder), 228, MSG_INCOME);
|
||||
return;
|
||||
}
|
||||
|
||||
if (besieged(u)) {
|
||||
cmistake(u, findorder(u, u->thisorder), 60, MSG_INCOME);
|
||||
|
|
|
@ -2405,6 +2405,10 @@ instant_orders(void)
|
|||
setstealth(u, S);
|
||||
break;
|
||||
|
||||
case K_WEREWOLF:
|
||||
setwere(u, S);
|
||||
break;
|
||||
|
||||
case K_STATUS:
|
||||
param = getstrtoken();
|
||||
switch (findparam(param, u->faction->locale)) {
|
||||
|
@ -3126,6 +3130,7 @@ setdefaults (void)
|
|||
case K_WORK:
|
||||
case K_DRIVE:
|
||||
case K_MOVE:
|
||||
case K_WEREWOLF:
|
||||
cmd = S->s;
|
||||
#if HUNGER_DISABLES_LONGORDERS
|
||||
if (fval(u, FL_HUNGER)) {
|
||||
|
@ -3161,6 +3166,7 @@ setdefaults (void)
|
|||
case K_MOVE:
|
||||
case K_BIETE:
|
||||
case K_ATTACK:
|
||||
case K_WEREWOLF:
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -1044,6 +1044,7 @@ godcurse(void)
|
|||
void
|
||||
randomevents(void)
|
||||
{
|
||||
faction *f;
|
||||
region *r;
|
||||
building *b, *b2;
|
||||
unit *u;
|
||||
|
@ -1471,6 +1472,19 @@ randomevents(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (f = factions; f; f=f->next) {
|
||||
int level = fspecial(f, FS_LYCANTROPE);
|
||||
if(level > 0) {
|
||||
for(u = f->units; u; u=u->nextF) {
|
||||
if(rand()%100 < 2*level) {
|
||||
ADDMSG(&u->faction->msgs, msg_message("becomewere",
|
||||
"unit region", u, u->region));
|
||||
fset(u, UFL_WERE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Frühling, die Bäume schlagen aus. */
|
||||
|
||||
|
|
|
@ -108,6 +108,45 @@ spy(region * r, unit * u)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
setwere(unit *u, strlist *S)
|
||||
{
|
||||
int level = fspecial(u->faction,FS_LYCANTROPE);
|
||||
char *s;
|
||||
|
||||
if(!level) {
|
||||
cmistake(u, S->s, 311, MSG_EVENT);
|
||||
return;
|
||||
}
|
||||
|
||||
s = getstrtoken();
|
||||
|
||||
if(s == NULL || *s == '\0') {
|
||||
if(fval(u, UFL_WERE)) {
|
||||
cmistake(u, S->s, 309, MSG_EVENT);
|
||||
} else if(rand()%100 < 35+(level-1)*20) { /* 35, 55, 75, 95% */
|
||||
fset(u, UFL_WERE);
|
||||
} else {
|
||||
cmistake(u, S->s, 311, MSG_EVENT);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if(findparam(s, u->faction->locale) == P_NOT) {
|
||||
if(fval(u, UFL_WERE)) {
|
||||
cmistake(u, S->s, 310, MSG_EVENT);
|
||||
} else if(rand()%100 < 90-level*20) { /* 70, 50, 30, 10% */
|
||||
freset(u, UFL_WERE);
|
||||
} else {
|
||||
cmistake(u, S->s, 311, MSG_EVENT);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
setstealth(unit * u, strlist * S)
|
||||
{
|
||||
|
@ -125,7 +164,6 @@ setstealth(unit * u, strlist * S)
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
trace = findrace(s, u->faction->locale);
|
||||
if (trace) {
|
||||
/* Dämonen können sich nur als andere Spielerrassen tarnen */
|
||||
|
|
|
@ -246,7 +246,7 @@ teach(region * r, unit * u)
|
|||
char *s;
|
||||
skill_t sk;
|
||||
|
||||
if ((u->race->flags & RCF_NOTEACH)) {
|
||||
if ((u->race->flags & RCF_NOTEACH) || fval(u, UFL_WERE)) {
|
||||
cmistake(u, u->thisorder, 274, MSG_EVENT);
|
||||
return;
|
||||
}
|
||||
|
@ -471,7 +471,7 @@ learn(void)
|
|||
cmistake(u, findorder(u, u->thisorder), 52, MSG_PRODUCE);
|
||||
continue;
|
||||
}
|
||||
if ((u->race->flags & RCF_NOLEARN)) {
|
||||
if ((u->race->flags & RCF_NOLEARN) || fval(u, UFL_WERE)) {
|
||||
sprintf(buf, "%s können nichts lernen", LOC(default_locale, rc_name(u->race, 1)));
|
||||
mistake(u, u->thisorder, buf, MSG_EVENT);
|
||||
continue;
|
||||
|
|
|
@ -773,9 +773,13 @@ select_armor(troop t)
|
|||
int geschuetzt = 0;
|
||||
|
||||
/* Drachen benutzen keine Rüstungen */
|
||||
|
||||
if (!(t.fighter->unit->race->battle_flags & BF_EQUIPMENT))
|
||||
return AR_NONE;
|
||||
|
||||
/* ... und Werwölfe auch nicht */
|
||||
if(fval(t.fighter->unit, UFL_WERE)) {
|
||||
return AR_NONE;
|
||||
}
|
||||
|
||||
do {
|
||||
if (armordata[a].shield == 0) {
|
||||
|
@ -1026,6 +1030,11 @@ terminate(troop dt, troop at, int type, const char *damage, boolean missile)
|
|||
ar += armordata[shield].prot;
|
||||
/* natürliche Rüstung */
|
||||
an = du->race->armor;
|
||||
if(fval(du, UFL_WERE)) {
|
||||
int level = fspecial(du->faction, FS_LYCANTROPE);
|
||||
an += level;
|
||||
da += level;
|
||||
}
|
||||
/* magische Rüstung durch Artefakte oder Sprüche */
|
||||
/* Momentan nur Trollgürtel */
|
||||
am = select_magicarmor(dt);
|
||||
|
@ -1583,6 +1592,11 @@ skilldiff(troop at, troop dt, int dist)
|
|||
skdiff += 5;
|
||||
}
|
||||
|
||||
/* Werwolf */
|
||||
if(fval(au, UFL_WERE)) {
|
||||
skdiff += fspecial(au->faction, FS_LYCANTROPE);
|
||||
}
|
||||
|
||||
if (old_race(au->race) == RC_GOBLIN &&
|
||||
af->side->size[SUM_ROW] >= df->side->size[SUM_ROW] * 10)
|
||||
skdiff += 1;
|
||||
|
@ -2862,12 +2876,12 @@ make_fighter(battle * b, unit * u, boolean attack)
|
|||
if (fig->horses) {
|
||||
if ((r->terrain != T_PLAIN && r->terrain != T_HIGHLAND
|
||||
&& r->terrain != T_DESERT) || r_isforest(r)
|
||||
|| eff_skill(u, SK_RIDING, r) < 2 || old_race(u->race) == RC_TROLL)
|
||||
|| eff_skill(u, SK_RIDING, r) < 2 || old_race(u->race) == RC_TROLL || fval(u, UFL_WERE))
|
||||
fig->horses = 0;
|
||||
}
|
||||
|
||||
if (fig->elvenhorses) {
|
||||
if (eff_skill(u, SK_RIDING, r) < 5 || old_race(u->race) == RC_TROLL)
|
||||
if (eff_skill(u, SK_RIDING, r) < 5 || old_race(u->race) == RC_TROLL || fval(u, UFL_WERE))
|
||||
fig->elvenhorses = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -231,9 +231,8 @@ const char *keywords[MAXKEYWORDS] =
|
|||
#endif
|
||||
"PRÄFIX",
|
||||
"SYNONYM",
|
||||
#if GROWING_TREES
|
||||
"PFLANZEN",
|
||||
#endif
|
||||
"WERWESEN"
|
||||
};
|
||||
|
||||
const char *report_options[MAX_MSG] =
|
||||
|
|
|
@ -438,6 +438,7 @@ enum {
|
|||
K_PREFIX,
|
||||
K_SYNONYM,
|
||||
K_PFLANZE,
|
||||
K_WEREWOLF,
|
||||
MAXKEYWORDS,
|
||||
NOKEYWORD = (keyword_t) - 1
|
||||
};
|
||||
|
@ -891,6 +892,8 @@ extern int max_unique_id;
|
|||
#define FFL_RESTART (1<<2)
|
||||
#define FFL_OVERRIDE (1<<27) /* Override-Passwort wurde benutzt */
|
||||
|
||||
#define UFL_WERE (1<<28)
|
||||
|
||||
/* Flags, die gespeichert werden sollen: */
|
||||
#define UFL_SAVEMASK (FL_NOAID | FL_OWNER | FL_PARTEITARNUNG | FL_LOCKED | FL_HUNGER | FL_NOIDLEOUT | FL_TAKEALL | FL_UNNAMED)
|
||||
|
||||
|
|
|
@ -274,20 +274,21 @@ struct fspecialdata fspecials[MAXFACTIONSPECIALS] = {
|
|||
"Auswirkungen.",
|
||||
100
|
||||
},
|
||||
/* TODO: Noch nicht implementiert */
|
||||
{
|
||||
"Lykanthrop",
|
||||
"Angehörige einer Partei mit dieser Eigenschaft sind Werwesen. Einheiten "
|
||||
"einer solchen Partei können sich mit Hilfe der Befehle 'WERWESEN' und "
|
||||
"einer solchen Partei können sich mit Hilfe der langen Befehle 'WERWESEN' und "
|
||||
"'WERWESEN NICHT' in eine andere Form verwandeln. Beide Befehle haben "
|
||||
"nur eine gewisse Erfolgswahrscheinlichkeit und funktionieren nicht immer. "
|
||||
"In Werform erhalten die Einheiten +2 auf Angriff und Schaden und "
|
||||
"eine natürliche Rüstung von 2. Sie können sich so schnell "
|
||||
"bewegen, als wäre sie beritten, benutzen aber keine Pferde im "
|
||||
"Kampf, und verwenden als Rüstungen nur Schilde. Sie sind "
|
||||
"eingeschränkt und können in Werform kein Geld verdienen "
|
||||
"und nicht Lernen oder Lehren.",
|
||||
1
|
||||
"nur eine gewisse Erfolgswahrscheinlichkeit und funktionieren nicht immer: "
|
||||
"Je höher die Stufe der Eigenschaft, desto größer die Wahrscheinlichkeit, "
|
||||
"dass die Verwandlung gelingt, und je geringer die Chance, sich "
|
||||
"zurückzuverwandeln. Zudem besteht eine zunehmende kleine Chance der "
|
||||
"spontanen Verwandlung. In Werform erhalten die Einheiten einen Bonus auf "
|
||||
"Angriff, Schaden und natürliche Rüstung in Höhe der Eigenschaft. Sie "
|
||||
"benutzen jedoch keine Pferde im Kampf, und verwenden als Rüstungen nur "
|
||||
"Schilde. Sie sind eingeschränkt und können in Werform kein Geld verdienen, "
|
||||
"nicht Zaubern und nicht Lernen oder Lehren.",
|
||||
4
|
||||
},
|
||||
/* TODO: Noch nicht implementiert */
|
||||
/* Einheitenlimit-Senkung sinnlos für alte Parteien. */
|
||||
|
@ -295,7 +296,9 @@ struct fspecialdata fspecials[MAXFACTIONSPECIALS] = {
|
|||
"Elite",
|
||||
"Für eine Partei mit dieser Eigenschaft verdoppeln sich alle Boni- und "
|
||||
"Mali ihrer Rasse. Ihre Unterhaltskosten erhöhen sich auf 12 Silber pro "
|
||||
"Runde, ihr Einheitenlimit reduziert sich auf 25%%.",
|
||||
"Runde, ihr Einheitenlimit reduziert sich auf 25%%. Diese Eigenschaft "
|
||||
"kann nicht erworben werden, wenn die Partei nach dem Erwerb zuviele "
|
||||
"Einheiten hätte.",
|
||||
1
|
||||
}
|
||||
};
|
||||
|
|
|
@ -36,7 +36,7 @@ typedef enum {
|
|||
FS_UNDEAD,
|
||||
FS_QUICK,
|
||||
FS_LUCKY,
|
||||
FS_LYCANTROP,
|
||||
FS_LYCANTROPE,
|
||||
FS_ELITE,
|
||||
MAXFACTIONSPECIALS
|
||||
} fspecial_t;
|
||||
|
|
|
@ -2888,6 +2888,10 @@ magic(void)
|
|||
!is_cursed(u->attribs, C_KAELTESCHUTZ,0))
|
||||
continue;
|
||||
|
||||
if(fval(u, UFL_WERE)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (attacked(u)) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ struct unit;
|
|||
struct region;
|
||||
struct strlist;
|
||||
|
||||
void setwere(struct unit * u, struct strlist * S);
|
||||
void setstealth(struct unit * u, struct strlist * S);
|
||||
void spy(struct region * r, struct unit * u);
|
||||
void sabotage(struct region * r, struct unit * u);
|
||||
|
|
|
@ -4340,6 +4340,96 @@
|
|||
</nr>
|
||||
</locale>
|
||||
</message>
|
||||
|
||||
<message name="error309">
|
||||
<type>
|
||||
<arg name="unit" type="unit"></arg>
|
||||
<arg name="region" type="region"></arg>
|
||||
<arg name="command" type="string"></arg>
|
||||
</type>
|
||||
<locale name="de">
|
||||
<nr section="errors">
|
||||
<text>"$unit($unit) in $region($region): '$command' - Diese Einheit ist schon ein Werwesen."</text>
|
||||
</nr>
|
||||
</locale>
|
||||
<locale name="en">
|
||||
<nr section="errors">
|
||||
<text>"$unit($unit) in $region($region): '$command' - This unit already assumed lycantropic form."</text>
|
||||
</nr>
|
||||
</locale>
|
||||
</message>
|
||||
|
||||
<message name="error310">
|
||||
<type>
|
||||
<arg name="unit" type="unit"></arg>
|
||||
<arg name="region" type="region"></arg>
|
||||
<arg name="command" type="string"></arg>
|
||||
</type>
|
||||
<locale name="de">
|
||||
<nr section="errors">
|
||||
<text>"$unit($unit) in $region($region): '$command' - Diese Einheit ist kein Werwesen."</text>
|
||||
</nr>
|
||||
</locale>
|
||||
<locale name="en">
|
||||
<nr section="errors">
|
||||
<text>"$unit($unit) in $region($region): '$command' - This unit is not in lycantropic form."</text>
|
||||
</nr>
|
||||
</locale>
|
||||
</message>
|
||||
|
||||
<message name="error311">
|
||||
<type>
|
||||
<arg name="unit" type="unit"></arg>
|
||||
<arg name="region" type="region"></arg>
|
||||
<arg name="command" type="string"></arg>
|
||||
</type>
|
||||
<locale name="de">
|
||||
<nr section="errors">
|
||||
<text>"$unit($unit) in $region($region): '$command' - Die Einheit kann sich nicht verwandeln."</text>
|
||||
</nr>
|
||||
</locale>
|
||||
<locale name="en">
|
||||
<nr section="errors">
|
||||
<text>"$unit($unit) in $region($region): '$command' - This unit can not change shape."</text>
|
||||
</nr>
|
||||
</locale>
|
||||
</message>
|
||||
|
||||
<message name="error312">
|
||||
<type>
|
||||
<arg name="unit" type="unit"></arg>
|
||||
<arg name="region" type="region"></arg>
|
||||
<arg name="command" type="string"></arg>
|
||||
</type>
|
||||
<locale name="de">
|
||||
<nr section="errors">
|
||||
<text>"$unit($unit) in $region($region): '$command' - Werwesen können nicht mit anderen Personen gemischt werden."</text>
|
||||
</nr>
|
||||
</locale>
|
||||
<locale name="en">
|
||||
<nr section="errors">
|
||||
<text>"$unit($unit) in $region($region): '$command' - Lycantropes may not be mixed with normal people."</text>
|
||||
</nr>
|
||||
</locale>
|
||||
</message>
|
||||
|
||||
<message name="error313">
|
||||
<type>
|
||||
<arg name="unit" type="unit"></arg>
|
||||
<arg name="region" type="region"></arg>
|
||||
<arg name="command" type="string"></arg>
|
||||
</type>
|
||||
<locale name="de">
|
||||
<nr section="errors">
|
||||
<text>"$unit($unit) in $region($region): '$command' - Werwesen können nicht arbeiten."</text>
|
||||
</nr>
|
||||
</locale>
|
||||
<locale name="en">
|
||||
<nr section="errors">
|
||||
<text>"$unit($unit) in $region($region): '$command' - Lycantropes don't work."</text>
|
||||
</nr>
|
||||
</locale>
|
||||
</message>
|
||||
|
||||
<message name="drown_on_ship">
|
||||
<type>
|
||||
|
@ -7366,5 +7456,15 @@
|
|||
<text locale="de">"SIEG! $if($eq($n,1), "Die Partei $winners hat", "Die Parteien $winners haben") die Siegbedingung für die erforderliche Zeit erfüllt. Das Spiel ist damit beendet."</text>
|
||||
<text locale="en">"VICTORY! $if($eq($n,1), "The faction $winners has", "The factions $winners have") fulfilled the victory condition for the necessary time. The game is over."</text>
|
||||
</message>
|
||||
|
||||
<message name="becomewere" section="events">
|
||||
<type>
|
||||
<arg name="unit" type="unit"></arg>
|
||||
<arg name="region" type="region"></arg>
|
||||
</type>
|
||||
<text locale="de">"$unit($unit) in $region($region) verwandelt sich in ein Werwesen."</text>
|
||||
<text locale="en">"$unit($unit) in $region($region) becomes a lycantrope."</text>
|
||||
</message>
|
||||
|
||||
|
||||
</messages>
|
||||
|
|
|
@ -1780,7 +1780,9 @@
|
|||
<string name="GM">
|
||||
<text locale="de">GM</text>
|
||||
</string>
|
||||
|
||||
<string name="WERWESEN">
|
||||
<text locale="de">WERWESEN</text>
|
||||
</string>
|
||||
|
||||
<string name="Adler">
|
||||
<text locale="de">Adler</text>
|
||||
|
|
|
@ -1593,6 +1593,9 @@
|
|||
<string name="ZÜCHTEN">
|
||||
<text locale="en">GROW</text>
|
||||
</string>
|
||||
<string name="WERWESEN">
|
||||
<text locale="en">LYCANTROPE</text>
|
||||
</string>
|
||||
|
||||
<string name="Adler">
|
||||
<text locale="en">eagle</text>
|
||||
|
|
Loading…
Reference in New Issue