- Stirb-Ergänzung um Übergabe

This commit is contained in:
Christian Schlittchen 2003-04-24 20:54:14 +00:00
parent 034c0073cc
commit 1974fe5baa
4 changed files with 70 additions and 3 deletions

View File

@ -1025,6 +1025,24 @@ inactivefaction(faction * f)
fclose(inactiveFILE);
}
#ifdef ENHANCED_QUIT
static void
transfer_faction(faction *f, faction *f2)
{
unit *u, *un;
for (u = f->units; u;) {
un = u->next;
if(!unit_has_cursed_item(u)
&& !has_skill(u, SK_MAGIC)
&& !has_skill(u, SK_ALCHEMY)) {
u_setfaction(u, f2);
}
u = un;
}
}
#endif
void
quit(void)
{
@ -1043,7 +1061,36 @@ quit(void)
for (S = u->orders; S; S = S->next) {
if (igetkeyword(S->s, u->faction->locale) == K_QUIT) {
if (checkpasswd(u->faction, getstrtoken())) {
#ifdef ENHANCED_QUIT
int f2_id = getid();
if(f2_id > 0) {
faction *f2 = findfaction(f2_id);
f = u->faction;
if(f2 == NULL) {
cmistake(u, S->s, 66, MSG_EVENT);
} else if(f == f2) {
cmistake(u, S->s, 8, MSG_EVENT);
#ifdef ALLIANCES
} else if(u->faction->alliance != f2->alliance) {
cmistake(u, S->s, 315, MSG_EVENT);
#else
#warning ENHANCED_QUIT defined without ALLIANCES
#endif
} else if(alliedfaction(NULL, f, f2, HELP_MONEY)) {
cmistake(u, S->s, 316, MSG_EVENT);
} else {
transfer_faction(f,f2);
destroyfaction(f);
}
} else {
destroyfaction(u->faction);
}
#else
destroyfaction(u->faction);
#endif
break;
} else {
cmistake(u, S->s, 86, MSG_EVENT);

View File

@ -906,7 +906,7 @@ sp_chaosrow(fighter * fi, int level, int force, spell * sp)
if (df->unit->race->battle_flags & BF_NOBLOCK) {
df->side->nonblockers[row] -= df->alive;
}
row = FIRST_ROW + (rand()%(NUMROWS-1));
row = FIRST_ROW + (rand()%(LAST_ROW-FIRST_ROW));
switch (row) {
case FIGHT_ROW:
df->status = ST_FIGHT;

View File

@ -29,7 +29,7 @@
#define LARGE_CASTLES 1
#define NEW_MIGRATION 1
#define NEW_RESOURCEGROWTH 1
#define NMRTIMEOUT 5
#define NMRTIMEOUT 99
#define PEASANTS_DO_NOT_STARVE 0
#define PEASANT_ADJUSTMENT 1
#define RACE_ADJUSTMENTS 1
@ -46,6 +46,7 @@
#define ROIBONUS 4
#endif
#define ENHANCED_QUIT
#define ALLIANCES
#undef ALLIANCEJOIN
#define AUTOALLIANCE (HELP_FIGHT)

View File

@ -4483,7 +4483,26 @@
<text locale="de">"$unit($unit) in $region($region): '$command' - Eine Partei kann nur einmal neu starten."</text>
<text locale="en">"$unit($unit) in $region($region): '$command' - Restart can only be used once."</text>
</message>
<message name="error315">
<type>
<arg name="unit" type="unit"></arg>
<arg name="region" type="region"></arg>
<arg name="command" type="string"></arg>
</type>
<text locale="de">"$unit($unit) in $region($region): '$command' - Die Partei kann nur an eine Partei in derselben Allianz übergeben werden."</text>
<text locale="en">"$unit($unit) in $region($region): '$command' - The faction can only be given to a faction in the same alliance."</text>
</message>
<message name="error316">
<type>
<arg name="unit" type="unit"></arg>
<arg name="region" type="region"></arg>
<arg name="command" type="string"></arg>
</type>
<text locale="de">"$unit($unit) in $region($region): '$command' - Die Partei möchte unsere Personen nicht aufnehmen."</text>
<text locale="en">"$unit($unit) in $region($region): '$command' - The faction does not want to take out people."</text>
</message>
<message name="drown_on_ship">
<type>