forked from github/server
commit
78b9149636
10 changed files with 165 additions and 138 deletions
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<!-- begin main races -->
|
<!-- begin main races -->
|
||||||
|
|
||||||
<race name="template" maintenance="0" magres="100" maxaura="0" regaura="0" weight="0" capacity="1000" speed="10.000000" hp="10" damage="1d4" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" fly="yes" swim="yes" walk="yes" shapeshift="yes" shapeshiftany="yes" giveperson="yes" giveunit="yes" getitem="yes" recruitethereal="yes" recruitunlimited="yes" equipment="yes">
|
<race name="template" maintenance="0" magres="100" maxaura="0" regaura="0" weight="0" capacity="1000" speed="10.0" hp="10" damage="1d4" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" fly="yes" swim="yes" walk="yes" shapeshift="yes" giveperson="yes" giveunit="yes" getitem="yes" recruitethereal="yes" recruitunlimited="yes" equipment="yes">
|
||||||
<ai splitsize="10000" moverandom="yes" learn="yes"/>
|
<ai splitsize="10000" moverandom="yes" learn="yes"/>
|
||||||
<attack type="1" damage="1d4"/>
|
<attack type="1" damage="1d4"/>
|
||||||
</race>
|
</race>
|
||||||
|
@ -101,7 +101,7 @@
|
||||||
|
|
||||||
<!-- begin secondary races -->
|
<!-- begin secondary races -->
|
||||||
|
|
||||||
<race name="demon" magres="15" maxaura="1" regaura="1.1" recruitcost="360" maintenance="10" weight="1000" capacity="540" speed="1.0" hp="30" ac="2" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" shapeshift="yes" giveperson="yes" giveunit="yes" getitem="yes" recruitethereal="yes" equipment="yes">
|
<race name="demon" magres="15" maxaura="1" regaura="1.1" recruitcost="360" maintenance="10" weight="1000" capacity="540" speed="1.0" hp="30" ac="2" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" recruitethereal="yes" equipment="yes">
|
||||||
<ai splitsize="10000" moverandom="yes" learn="yes"/>
|
<ai splitsize="10000" moverandom="yes" learn="yes"/>
|
||||||
<skill name="cartmaking" modifier="-2"/>
|
<skill name="cartmaking" modifier="-2"/>
|
||||||
<skill name="forestry" modifier="1"/>
|
<skill name="forestry" modifier="1"/>
|
||||||
|
|
|
@ -689,7 +689,7 @@
|
||||||
<attack type="4" damage="1d6"/>
|
<attack type="4" damage="1d6"/>
|
||||||
<attack type="1" damage="1d5"/>
|
<attack type="1" damage="1d5"/>
|
||||||
</race>
|
</race>
|
||||||
<race name="catdragon" magres="90" maxaura="1.000000" regaura="1.000000" weight="20000" capacity="10000" speed="1.000000" hp="20" damage="2d40" unarmedattack="0" unarmeddefense="0" defensemodifier="50" fly="yes" walk="yes" teach="no" shapeshift="yes" giveperson="yes" getitem="yes" dragon="yes">
|
<race name="catdragon" magres="90" maxaura="1.000000" regaura="1.000000" weight="20000" capacity="10000" speed="1.000000" hp="20" damage="2d40" unarmedattack="0" unarmeddefense="0" defensemodifier="50" fly="yes" walk="yes" teach="no" giveperson="yes" getitem="yes" dragon="yes">
|
||||||
<ai splitsize="1"/>
|
<ai splitsize="1"/>
|
||||||
<attack type="4" damage="2d40"/>
|
<attack type="4" damage="2d40"/>
|
||||||
<attack type="4" damage="2d40"/>
|
<attack type="4" damage="2d40"/>
|
||||||
|
@ -840,7 +840,10 @@
|
||||||
<familiar race="tunnelworm"/>
|
<familiar race="tunnelworm"/>
|
||||||
<familiar race="imp"/>
|
<familiar race="imp"/>
|
||||||
</race>
|
</race>
|
||||||
<race name="demon" magres="15" maxaura="1" regaura="1.25" recruitcost="150" maintenance="10" weight="1000" capacity="540" speed="1" hp="50" ac="2" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" shapeshift="yes" giveperson="yes" giveunit="yes" getitem="yes" recruitethereal="yes" equipment="yes">
|
<race name="demon" magres="15" maxaura="1" regaura="1.25" recruitcost="150"
|
||||||
|
maintenance="10" weight="1000" capacity="540" speed="1" hp="50" ac="2" damage="1d5"
|
||||||
|
unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" giveperson="yes"
|
||||||
|
giveunit="yes" getitem="yes" recruitethereal="yes" equipment="yes">
|
||||||
<ai splitsize="10000" moverandom="yes" learn="yes"/>
|
<ai splitsize="10000" moverandom="yes" learn="yes"/>
|
||||||
<skill name="alchemy" modifier="2"/>
|
<skill name="alchemy" modifier="2"/>
|
||||||
<skill name="trade" modifier="-3"/>
|
<skill name="trade" modifier="-3"/>
|
||||||
|
|
|
@ -24,17 +24,20 @@ const char *get_racename(attrib * alist)
|
||||||
void set_racename(attrib ** palist, const char *name)
|
void set_racename(attrib ** palist, const char *name)
|
||||||
{
|
{
|
||||||
attrib *a = a_find(*palist, &at_racename);
|
attrib *a = a_find(*palist, &at_racename);
|
||||||
if (!a && name) {
|
|
||||||
|
if (a) {
|
||||||
|
if (name) {
|
||||||
|
if (strcmp(a->data.v, name) != 0) {
|
||||||
|
free(a->data.v);
|
||||||
|
a->data.v = str_strdup(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
a_remove(palist, a);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (name) {
|
||||||
a = a_add(palist, a_new(&at_racename));
|
a = a_add(palist, a_new(&at_racename));
|
||||||
a->data.v = str_strdup(name);
|
a->data.v = str_strdup(name);
|
||||||
}
|
}
|
||||||
else if (a && !name) {
|
|
||||||
a_remove(palist, a);
|
|
||||||
}
|
|
||||||
else if (a) {
|
|
||||||
if (strcmp(a->data.v, name) != 0) {
|
|
||||||
free(a->data.v);
|
|
||||||
a->data.v = str_strdup(name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,24 +117,26 @@ static translation *junkyard;
|
||||||
|
|
||||||
static const char *translate(const char *key, const char *value)
|
static const char *translate(const char *key, const char *value)
|
||||||
{
|
{
|
||||||
int kk = ((key[0] << 5) + key[0]) % TRANSMAXHASH;
|
if (value) {
|
||||||
translation *t = translation_table[kk];
|
int kk = ((key[0] << 5) + key[0]) % TRANSMAXHASH;
|
||||||
while (t && strcmp(t->key, key) != 0)
|
translation *t = translation_table[kk];
|
||||||
t = t->next;
|
while (t && strcmp(t->key, key) != 0)
|
||||||
if (!t) {
|
t = t->next;
|
||||||
if (junkyard) {
|
if (!t) {
|
||||||
t = junkyard;
|
if (junkyard) {
|
||||||
junkyard = junkyard->next;
|
t = junkyard;
|
||||||
|
junkyard = junkyard->next;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
t = malloc(sizeof(translation));
|
||||||
|
if (!t) abort();
|
||||||
|
}
|
||||||
|
t->key = str_strdup(key);
|
||||||
|
if (!t->key) abort();
|
||||||
|
t->value = value;
|
||||||
|
t->next = translation_table[kk];
|
||||||
|
translation_table[kk] = t;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
t = malloc(sizeof(translation));
|
|
||||||
if (!t) abort();
|
|
||||||
}
|
|
||||||
t->key = str_strdup(key);
|
|
||||||
if (!t->key) abort();
|
|
||||||
t->value = value;
|
|
||||||
t->next = translation_table[kk];
|
|
||||||
translation_table[kk] = t;
|
|
||||||
}
|
}
|
||||||
return crtag(key);
|
return crtag(key);
|
||||||
}
|
}
|
||||||
|
@ -796,18 +798,14 @@ void cr_output_unit(stream *out, const faction * f,
|
||||||
|
|
||||||
pzTmp = get_racename(u->attribs);
|
pzTmp = get_racename(u->attribs);
|
||||||
if (pzTmp) {
|
if (pzTmp) {
|
||||||
const char *pzRace = locale_string(lang, mkname("race", pzTmp), false);
|
const race *irace = rc_find(pzTmp);
|
||||||
if (pzRace) {
|
if (irace) {
|
||||||
pzTmp = pzRace;
|
const char *pzRace = rc_name_s(irace, NAME_PLURAL);
|
||||||
|
stream_printf(out, "\"%s\";Typ\n",
|
||||||
|
translate(pzRace, LOC(lang, pzRace)));
|
||||||
}
|
}
|
||||||
pzRace = translate(pzTmp, locale_string(lang, pzTmp, false));
|
else {
|
||||||
if (!pzRace) {
|
stream_printf(out, "\"%s\";Typ\n", pzTmp);
|
||||||
pzRace = pzTmp;
|
|
||||||
}
|
|
||||||
stream_printf(out, "\"%s\";Typ\n", pzRace);
|
|
||||||
if (u->faction == f && fval(u_race(u), RCF_SHAPESHIFTANY)) {
|
|
||||||
pzRace = rc_name_s(u_race(u), NAME_PLURAL);
|
|
||||||
stream_printf(out, "\"%s\";wahrerTyp\n", pzRace);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -299,15 +299,27 @@ static void test_cr_hiderace(CuTest *tc) {
|
||||||
|
|
||||||
/* when we use racename, nobody can tell it's not the real deal */
|
/* when we use racename, nobody can tell it's not the real deal */
|
||||||
u->irace = NULL;
|
u->irace = NULL;
|
||||||
set_racename(&u->attribs, "Zwerge");
|
set_racename(&u->attribs, "human");
|
||||||
mstream_init(&strm);
|
mstream_init(&strm);
|
||||||
cr_output_unit(&strm, f1, u, seen_unit);
|
cr_output_unit(&strm, f1, u, seen_unit);
|
||||||
CuAssertTrue(tc, cr_find_string(&strm, ";Typ", "Zwerge"));
|
CuAssertTrue(tc, cr_find_string(&strm, ";Typ", "Menschen"));
|
||||||
CuAssertTrue(tc, cr_find_string(&strm, ";wahrerTyp", NULL));
|
CuAssertTrue(tc, cr_find_string(&strm, ";wahrerTyp", NULL));
|
||||||
mstream_done(&strm);
|
mstream_done(&strm);
|
||||||
mstream_init(&strm);
|
mstream_init(&strm);
|
||||||
cr_output_unit(&strm, f2, u, seen_unit);
|
cr_output_unit(&strm, f2, u, seen_unit);
|
||||||
CuAssertTrue(tc, cr_find_string(&strm, ";Typ", "Zwerge"));
|
CuAssertTrue(tc, cr_find_string(&strm, ";Typ", "Menschen"));
|
||||||
|
CuAssertTrue(tc, cr_find_string(&strm, ";wahrerTyp", NULL));
|
||||||
|
mstream_done(&strm);
|
||||||
|
|
||||||
|
set_racename(&u->attribs, "Ritter von Go");
|
||||||
|
mstream_init(&strm);
|
||||||
|
cr_output_unit(&strm, f1, u, seen_unit);
|
||||||
|
CuAssertTrue(tc, cr_find_string(&strm, ";Typ", "Ritter von Go"));
|
||||||
|
CuAssertTrue(tc, cr_find_string(&strm, ";wahrerTyp", NULL));
|
||||||
|
mstream_done(&strm);
|
||||||
|
mstream_init(&strm);
|
||||||
|
cr_output_unit(&strm, f2, u, seen_unit);
|
||||||
|
CuAssertTrue(tc, cr_find_string(&strm, ";Typ", "Ritter von Go"));
|
||||||
CuAssertTrue(tc, cr_find_string(&strm, ";wahrerTyp", NULL));
|
CuAssertTrue(tc, cr_find_string(&strm, ";wahrerTyp", NULL));
|
||||||
mstream_done(&strm);
|
mstream_done(&strm);
|
||||||
|
|
||||||
|
|
|
@ -45,9 +45,10 @@
|
||||||
#define FIX_RES_BASE_VERSION 367 /* fixing resource base */
|
#define FIX_RES_BASE_VERSION 367 /* fixing resource base */
|
||||||
#define FIX_CLONES_VERSION 368 /* dissolve clones */
|
#define FIX_CLONES_VERSION 368 /* dissolve clones */
|
||||||
#define FIX_MIGRANT_AURA_VERSION 369 /* bug 2585, migrants with aura */
|
#define FIX_MIGRANT_AURA_VERSION 369 /* bug 2585, migrants with aura */
|
||||||
#define SHIP_NUMBER_VERISON 370 /* ships have a number */
|
#define SHIP_NUMBER_VERSION 370 /* ships have a number */
|
||||||
|
#define FIX_SHAPESHIFT_VERSION 371 /* ships have a number */
|
||||||
|
|
||||||
#define RELEASE_VERSION SHIP_NUMBER_VERISON /* current datafile */
|
#define RELEASE_VERSION FIX_SHAPESHIFT_VERSION /* current datafile */
|
||||||
#define MIN_VERSION UIDHASH_VERSION /* minimal datafile we support */
|
#define MIN_VERSION UIDHASH_VERSION /* minimal datafile we support */
|
||||||
#define MAX_VERSION RELEASE_VERSION /* change this if we can need to read the future datafile, and we can do so */
|
#define MAX_VERSION RELEASE_VERSION /* change this if we can need to read the future datafile, and we can do so */
|
||||||
|
|
||||||
|
|
|
@ -207,7 +207,6 @@ extern "C" {
|
||||||
#define RCF_NOHEAL (1<<16) /* Einheit kann nicht geheilt werden */
|
#define RCF_NOHEAL (1<<16) /* Einheit kann nicht geheilt werden */
|
||||||
#define RCF_NOWEAPONS (1<<17) /* Einheit kann keine Waffen benutzen */
|
#define RCF_NOWEAPONS (1<<17) /* Einheit kann keine Waffen benutzen */
|
||||||
#define RCF_SHAPESHIFT (1<<18) /* Kann TARNE RASSE benutzen. */
|
#define RCF_SHAPESHIFT (1<<18) /* Kann TARNE RASSE benutzen. */
|
||||||
#define RCF_SHAPESHIFTANY (1<<19) /* Kann TARNE RASSE "string" benutzen. */
|
|
||||||
#define RCF_UNDEAD (1<<20) /* Undead. */
|
#define RCF_UNDEAD (1<<20) /* Undead. */
|
||||||
#define RCF_DRAGON (1<<21) /* Drachenart (fuer Zauber) */
|
#define RCF_DRAGON (1<<21) /* Drachenart (fuer Zauber) */
|
||||||
#define RCF_COASTAL (1<<22) /* kann in Landregionen an der Kueste sein */
|
#define RCF_COASTAL (1<<22) /* kann in Landregionen an der Kueste sein */
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
/* attributes includes */
|
/* attributes includes */
|
||||||
#include <attributes/attributes.h>
|
#include <attributes/attributes.h>
|
||||||
#include <attributes/key.h>
|
#include <attributes/key.h>
|
||||||
|
#include <attributes/racename.h>
|
||||||
#include <triggers/timeout.h>
|
#include <triggers/timeout.h>
|
||||||
#include <triggers/shock.h>
|
#include <triggers/shock.h>
|
||||||
|
|
||||||
|
@ -381,6 +382,12 @@ unit *read_unit(gamedata *data)
|
||||||
char obuf[DISPLAYSIZE];
|
char obuf[DISPLAYSIZE];
|
||||||
faction *f;
|
faction *f;
|
||||||
char rname[32];
|
char rname[32];
|
||||||
|
static const struct race * rc_demon;
|
||||||
|
static int config;
|
||||||
|
|
||||||
|
if (rc_changed(&config)) {
|
||||||
|
rc_demon = get_race(RC_DAEMON);
|
||||||
|
}
|
||||||
|
|
||||||
READ_INT(data->store, &n);
|
READ_INT(data->store, &n);
|
||||||
if (n <= 0) {
|
if (n <= 0) {
|
||||||
|
@ -518,6 +525,18 @@ unit *read_unit(gamedata *data)
|
||||||
u->hp = u->number;
|
u->hp = u->number;
|
||||||
}
|
}
|
||||||
read_attribs(data, &u->attribs, u);
|
read_attribs(data, &u->attribs, u);
|
||||||
|
if (rc_demon && data->version < FIX_SHAPESHIFT_VERSION) {
|
||||||
|
if (u_race(u) == rc_demon) {
|
||||||
|
const char *zRace = get_racename(u->attribs);
|
||||||
|
if (zRace) {
|
||||||
|
const struct race *rc = rc_find(zRace);
|
||||||
|
if (rc) {
|
||||||
|
set_racename(&u->attribs, NULL);
|
||||||
|
u->irace = rc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
resolve_unit(u);
|
resolve_unit(u);
|
||||||
return u;
|
return u;
|
||||||
}
|
}
|
||||||
|
@ -1322,7 +1341,7 @@ ship *read_ship(gamedata *data)
|
||||||
}
|
}
|
||||||
assert(sh->type || !"ship_type not registered!");
|
assert(sh->type || !"ship_type not registered!");
|
||||||
|
|
||||||
if (data->version < SHIP_NUMBER_VERISON) {
|
if (data->version < SHIP_NUMBER_VERSION) {
|
||||||
sh->number = 1;
|
sh->number = 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -698,7 +698,7 @@ void bufunit(const faction * f, const unit * u, const faction *fv,
|
||||||
if (pzTmp) {
|
if (pzTmp) {
|
||||||
const char *name = locale_string(lang, mkname("race", pzTmp), false);
|
const char *name = locale_string(lang, mkname("race", pzTmp), false);
|
||||||
sbs_strcat(sbp, name ? name : pzTmp);
|
sbs_strcat(sbp, name ? name : pzTmp);
|
||||||
if (u->faction == f && fval(u_race(u), RCF_SHAPESHIFTANY)) {
|
if (u->faction == f) {
|
||||||
sbs_strcat(sbp, " (");
|
sbs_strcat(sbp, " (");
|
||||||
sbs_strcat(sbp, racename(lang, u, u_race(u)));
|
sbs_strcat(sbp, racename(lang, u, u_race(u)));
|
||||||
sbs_strcat(sbp, ")");
|
sbs_strcat(sbp, ")");
|
||||||
|
|
168
src/spy.c
168
src/spy.c
|
@ -195,6 +195,39 @@ void set_factionstealth(unit *u, faction *f) {
|
||||||
a->data.v = f;
|
a->data.v = f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void stealth_race(unit *u, const char *s) {
|
||||||
|
const race *trace;
|
||||||
|
|
||||||
|
trace = findrace(s, u->faction->locale);
|
||||||
|
if (trace) {
|
||||||
|
/* demons can cloak as other player-races */
|
||||||
|
if (u_race(u) == get_race(RC_DAEMON)) {
|
||||||
|
if (playerrace(trace)) {
|
||||||
|
u->irace = trace;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* Singdrachen können sich nur als Drachen tarnen */
|
||||||
|
else if (u_race(u) == get_race(RC_SONGDRAGON)
|
||||||
|
|| u_race(u) == get_race(RC_BIRTHDAYDRAGON)) {
|
||||||
|
if (trace == get_race(RC_SONGDRAGON) || trace == get_race(RC_FIREDRAGON)
|
||||||
|
|| trace == get_race(RC_DRAGON) || trace == get_race(RC_WYRM)) {
|
||||||
|
u->irace = trace;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Schablonen können sich als alles mögliche tarnen */
|
||||||
|
if (u_race(u)->flags & RCF_SHAPESHIFT) {
|
||||||
|
u->irace = trace;
|
||||||
|
set_racename(&u->attribs, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (u_race(u)->flags & RCF_SHAPESHIFT) {
|
||||||
|
set_racename(&u->attribs, s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int setstealth_cmd(unit * u, struct order *ord)
|
int setstealth_cmd(unit * u, struct order *ord)
|
||||||
{
|
{
|
||||||
char token[64];
|
char token[64];
|
||||||
|
@ -207,111 +240,70 @@ int setstealth_cmd(unit * u, struct order *ord)
|
||||||
|
|
||||||
if (s == NULL || *s == 0) {
|
if (s == NULL || *s == 0) {
|
||||||
u_seteffstealth(u, -1);
|
u_seteffstealth(u, -1);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
else if (isdigit(*(const unsigned char *)s)) {
|
||||||
if (isdigit(*(const unsigned char *)s)) {
|
|
||||||
/* Tarnungslevel setzen */
|
/* Tarnungslevel setzen */
|
||||||
int level = atoi((const char *)s);
|
int level = atoi((const char *)s);
|
||||||
if (level > effskill(u, SK_STEALTH, NULL)) {
|
if (level > effskill(u, SK_STEALTH, NULL)) {
|
||||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "error_lowstealth", ""));
|
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "error_lowstealth", ""));
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
u_seteffstealth(u, level);
|
else {
|
||||||
return 0;
|
u_seteffstealth(u, level);
|
||||||
}
|
|
||||||
|
|
||||||
if (skill_enabled(SK_STEALTH)) { /* hack! E3 erlaubt keine Tarnung */
|
|
||||||
const race *trace;
|
|
||||||
|
|
||||||
trace = findrace(s, u->faction->locale);
|
|
||||||
if (trace) {
|
|
||||||
/* demons can cloak as other player-races */
|
|
||||||
if (u_race(u) == get_race(RC_DAEMON)) {
|
|
||||||
if (playerrace(trace)) {
|
|
||||||
u->irace = trace;
|
|
||||||
if (u_race(u)->flags & RCF_SHAPESHIFTANY && get_racename(u->attribs)) {
|
|
||||||
set_racename(&u->attribs, NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
/* Singdrachen koennen sich nur als Drachen tarnen */
|
|
||||||
else if (u_race(u) == get_race(RC_SONGDRAGON)
|
|
||||||
|| u_race(u) == get_race(RC_BIRTHDAYDRAGON)) {
|
|
||||||
if (trace == get_race(RC_SONGDRAGON) || trace == get_race(RC_FIREDRAGON)
|
|
||||||
|| trace == get_race(RC_DRAGON) || trace == get_race(RC_WYRM)) {
|
|
||||||
u->irace = trace;
|
|
||||||
if (u_race(u)->flags & RCF_SHAPESHIFTANY && get_racename(u->attribs))
|
|
||||||
set_racename(&u->attribs, NULL);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Daemomen und Illusionsparteien koennen sich als andere race tarnen */
|
|
||||||
if (u_race(u)->flags & RCF_SHAPESHIFT) {
|
|
||||||
if (playerrace(trace)) {
|
|
||||||
u->irace = trace;
|
|
||||||
if ((u_race(u)->flags & RCF_SHAPESHIFTANY) && get_racename(u->attribs))
|
|
||||||
set_racename(&u->attribs, NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
switch (findparam(s, u->faction->locale)) {
|
switch (findparam(s, u->faction->locale)) {
|
||||||
case P_FACTION:
|
case P_FACTION:
|
||||||
/* TARNE PARTEI [NICHT|NUMMER abcd] */
|
/* TARNE PARTEI [NICHT|NUMMER abcd] */
|
||||||
s = gettoken(token, sizeof(token));
|
s = gettoken(token, sizeof(token));
|
||||||
if (rule_stealth_anon()) {
|
if (rule_stealth_anon()) {
|
||||||
if (!s || *s == 0) {
|
if (!s || *s == 0) {
|
||||||
u->flags |= UFL_ANON_FACTION;
|
u->flags |= UFL_ANON_FACTION;
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if (findparam(s, u->faction->locale) == P_NOT) {
|
|
||||||
u->flags &= ~UFL_ANON_FACTION;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (rule_stealth_other()) {
|
|
||||||
if (get_keyword(s, u->faction->locale) == K_NUMBER) {
|
|
||||||
int nr = -1;
|
|
||||||
|
|
||||||
s = gettoken(token, sizeof(token));
|
|
||||||
if (s) {
|
|
||||||
nr = atoi36(s);
|
|
||||||
}
|
|
||||||
if (!s || *s == 0 || nr == u->faction->no) {
|
|
||||||
a_removeall(&u->attribs, &at_otherfaction);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else {
|
else if (findparam(s, u->faction->locale) == P_NOT) {
|
||||||
struct faction *f = findfaction(nr);
|
u->flags &= ~UFL_ANON_FACTION;
|
||||||
if (f == NULL || !can_set_factionstealth(u, f)) {
|
break;
|
||||||
cmistake(u, ord, 66, MSG_EVENT);
|
}
|
||||||
|
}
|
||||||
|
if (rule_stealth_other()) {
|
||||||
|
if (get_keyword(s, u->faction->locale) == K_NUMBER) {
|
||||||
|
int nr = -1;
|
||||||
|
|
||||||
|
s = gettoken(token, sizeof(token));
|
||||||
|
if (s) {
|
||||||
|
nr = atoi36(s);
|
||||||
|
}
|
||||||
|
if (!s || *s == 0 || nr == u->faction->no) {
|
||||||
|
a_removeall(&u->attribs, &at_otherfaction);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
set_factionstealth(u, f);
|
struct faction *f = findfaction(nr);
|
||||||
break;
|
if (f == NULL || !can_set_factionstealth(u, f)) {
|
||||||
|
cmistake(u, ord, 66, MSG_EVENT);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
set_factionstealth(u, f);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
cmistake(u, ord, 289, MSG_EVENT);
|
|
||||||
break;
|
|
||||||
case P_ANY:
|
|
||||||
case P_NOT:
|
|
||||||
/* TARNE ALLES (was nicht so alles geht?) */
|
|
||||||
u_seteffstealth(u, -1);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (u_race(u)->flags & RCF_SHAPESHIFTANY) {
|
|
||||||
set_racename(&u->attribs, s);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
cmistake(u, ord, 289, MSG_EVENT);
|
cmistake(u, ord, 289, MSG_EVENT);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case P_ANY:
|
||||||
|
case P_NOT:
|
||||||
|
/* TARNE ALLES (was nicht so alles geht?) */
|
||||||
|
u_seteffstealth(u, -1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
if (skill_enabled(SK_STEALTH)) { /* hack! E3 erlaubt keine Tarnung */
|
||||||
|
stealth_race(u, s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue