"road anstatt straße im cr"
This commit is contained in:
Enno Rehling 2007-12-18 19:58:17 +00:00
parent ef77f0ad2b
commit e780097a3b
6 changed files with 489 additions and 418 deletions

View File

@ -1116,9 +1116,9 @@ cr_borders(seen_region ** seen, const region * r, const faction * f, int seemode
} }
} }
if (cs) { if (cs) {
const char * bname = b->type->__name; /* bug 1326 - I hate this */ const char * bname = b->type->name(b, r, f, 0); /* bug 1326 - I hate this */
fprintf(F, "GRENZE %d\n", ++g); fprintf(F, "GRENZE %d\n", ++g);
fprintf(F, "\"%s\";typ\n", LOC(default_locale, bname)); fprintf(F, "\"%s\";typ\n", LOC(default_locale, mkname("border", bname)));
fprintf(F, "%d;richtung\n", d); fprintf(F, "%d;richtung\n", d);
if (!b->type->transparent(b, f)) fputs("1;opaque\n", F); if (!b->type->transparent(b, f)) fputs("1;opaque\n", F);
/* hack: */ /* hack: */

View File

@ -840,7 +840,7 @@ describe(FILE * F, const region * r, int partial, faction * f)
const char *tname; const char *tname;
struct edge { struct edge {
struct edge * next; struct edge * next;
char * name; const char * name;
boolean transparent; boolean transparent;
boolean block; boolean block;
boolean exist[MAXDIRECTIONS]; boolean exist[MAXDIRECTIONS];
@ -868,10 +868,10 @@ describe(FILE * F, const region * r, int partial, faction * f)
b = b->next; b = b->next;
continue; continue;
} }
while (e && (e->transparent != transparent || strcmp(name,e->name))) e = e->next; while (e && (e->transparent != transparent || strcmp(name, e->name))) e = e->next;
if (!e) { if (!e) {
e = calloc(sizeof(struct edge), 1); e = calloc(sizeof(struct edge), 1);
e->name = strdup(name); e->name = name;
e->transparent = transparent; e->transparent = transparent;
e->next = edges; e->next = edges;
edges = e; edges = e;
@ -989,7 +989,7 @@ describe(FILE * F, const region * r, int partial, faction * f)
bytes = (int)strlcpy(bufp, LOC(f->locale, resourcename(oldresourcetype[R_SILVER], rmoney(r)!=1)), size); bytes = (int)strlcpy(bufp, LOC(f->locale, resourcename(oldresourcetype[R_SILVER], rmoney(r)!=1)), size);
if (wrptr(&bufp, &size, bytes)!=0) WARN_STATIC_BUFFER(); if (wrptr(&bufp, &size, bytes)!=0) WARN_STATIC_BUFFER();
} }
/* Pferde */ /* horses */
if (rhorses(r)) { if (rhorses(r)) {
bytes = snprintf(bufp, size, ", %d ", rhorses(r)); bytes = snprintf(bufp, size, ", %d ", rhorses(r));
@ -1152,7 +1152,7 @@ describe(FILE * F, const region * r, int partial, faction * f)
if (!e->transparent) bytes = (int)strlcpy(bufp, " versperrt ", size); if (!e->transparent) bytes = (int)strlcpy(bufp, " versperrt ", size);
else bytes = (int)strlcpy(bufp, " befindet sich ", size); else bytes = (int)strlcpy(bufp, " befindet sich ", size);
if (wrptr(&bufp, &size, bytes)!=0) WARN_STATIC_BUFFER(); if (wrptr(&bufp, &size, bytes)!=0) WARN_STATIC_BUFFER();
bytes = (int)strlcpy(bufp, e->name, size); bytes = (int)strlcpy(bufp, LOC(f->locale, mkname("border", e->name)), size);
if (wrptr(&bufp, &size, bytes)!=0) WARN_STATIC_BUFFER(); if (wrptr(&bufp, &size, bytes)!=0) WARN_STATIC_BUFFER();
if (!e->transparent) bytes = (int)strlcpy(bufp, " die Sicht.", size); if (!e->transparent) bytes = (int)strlcpy(bufp, " die Sicht.", size);
else bytes = (int)strlcpy(bufp, ".", size); else bytes = (int)strlcpy(bufp, ".", size);
@ -1163,7 +1163,6 @@ describe(FILE * F, const region * r, int partial, faction * f)
if (edges) { if (edges) {
while (edges) { while (edges) {
e = edges->next; e = edges->next;
free(edges->name);
free(edges); free(edges);
edges = e; edges = e;
} }

View File

@ -1,7 +1,7 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* *
* Eressea PB(E)M host Copyright (C) 1998-2003 * Eressea PB(E)M host Copyright (C) 1998-2003
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
* Henning Peters (faroul@beyond.kn-bremen.de) * Henning Peters (faroul@beyond.kn-bremen.de)
@ -41,10 +41,10 @@ border_type * bordertypes;
void void
free_borders(void) free_borders(void)
{ {
int i; int i;
for (i=0;i!=BMAXHASH;++i) { for (i=0;i!=BMAXHASH;++i) {
borders[i] = NULL; borders[i] = NULL;
} }
} }
border * border *
@ -144,11 +144,11 @@ erase_border(border * b)
void void
register_bordertype(border_type * type) register_bordertype(border_type * type)
{ {
border_type ** btp = &bordertypes; border_type ** btp = &bordertypes;
while (*btp && *btp!=type) btp = &(*btp)->next; while (*btp && *btp!=type) btp = &(*btp)->next;
if (*btp) return; if (*btp) return;
*btp = type; *btp = type;
} }
@ -217,17 +217,17 @@ boolean b_uinvisible(const border * b, const unit * u) { unused(u); unused(b); r
static int static int
a_agecountdown(attrib * a) a_agecountdown(attrib * a)
{ {
a->data.i = max(a->data.i-1, 0); a->data.i = max(a->data.i-1, 0);
return a->data.i; return a->data.i;
} }
attrib_type at_countdown = { attrib_type at_countdown = {
"countdown", "countdown",
DEFAULT_INIT, DEFAULT_INIT,
DEFAULT_FINALIZE, DEFAULT_FINALIZE,
a_agecountdown, a_agecountdown,
a_writeint, a_writeint,
a_readint a_readint
}; };
void void
@ -278,97 +278,96 @@ age_borders(void)
static const char * static const char *
b_namewall(const border * b, const region * r, const struct faction * f, int gflags) b_namewall(const border * b, const region * r, const struct faction * f, int gflags)
{ {
unused(f); unused(f);
unused(r); unused(r);
unused(b); unused(b);
if (gflags & GF_ARTICLE) return "eine Wand"; if (gflags & GF_ARTICLE) return "a_wall";
return "Wand"; return "wall";
} }
border_type bt_wall = { border_type bt_wall = {
"wall", VAR_INT, "wall", VAR_INT,
b_opaque, b_opaque,
NULL, /* init */ NULL, /* init */
NULL, /* destroy */ NULL, /* destroy */
b_read, /* read */ b_read, /* read */
b_write, /* write */ b_write, /* write */
b_blockall, /* block */ b_blockall, /* block */
b_namewall, /* name */ b_namewall, /* name */
b_rvisible, /* rvisible */ b_rvisible, /* rvisible */
b_fvisible, /* fvisible */ b_fvisible, /* fvisible */
b_uvisible, /* uvisible */ b_uvisible, /* uvisible */
}; };
border_type bt_noway = { border_type bt_noway = {
"noway", VAR_INT, "noway", VAR_INT,
b_transparent, b_transparent,
NULL, /* init */ NULL, /* init */
NULL, /* destroy */ NULL, /* destroy */
b_read, /* read */ b_read, /* read */
b_write, /* write */ b_write, /* write */
b_blockall, /* block */ b_blockall, /* block */
NULL, /* name */ NULL, /* name */
b_rinvisible, /* rvisible */ b_rinvisible, /* rvisible */
b_finvisible, /* fvisible */ b_finvisible, /* fvisible */
b_uinvisible, /* uvisible */ b_uinvisible, /* uvisible */
}; };
static const char * static const char *
b_namefogwall(const border * b, const region * r, const struct faction * f, int gflags) b_namefogwall(const border * b, const region * r, const struct faction * f, int gflags)
{ {
unused(f); unused(f);
unused(b); unused(b);
unused(r); unused(r);
if (gflags & GF_ARTICLE) return "eine Nebelwand"; if (gflags & GF_ARTICLE) return "a_fogwall";
return "Nebelwand"; return "fogwall";
} }
static boolean static boolean
b_blockfogwall(const border * b, const unit * u, const region * r) b_blockfogwall(const border * b, const unit * u, const region * r)
{ {
unused(b); unused(b);
unused(r); unused(r);
if (!u) return true; if (!u) return true;
return (boolean)(effskill(u, SK_OBSERVATION) > 4); /* Das ist die alte Nebelwand */ return (boolean)(effskill(u, SK_OBSERVATION) > 4); /* Das ist die alte Nebelwand */
} }
border_type bt_fogwall = { border_type bt_fogwall = {
"fogwall", VAR_INT, "fogwall", VAR_INT,
b_transparent, /* transparent */ b_transparent, /* transparent */
NULL, /* init */ NULL, /* init */
NULL, /* destroy */ NULL, /* destroy */
b_read, /* read */ b_read, /* read */
b_write, /* write */ b_write, /* write */
b_blockfogwall, /* block */ b_blockfogwall, /* block */
b_namefogwall, /* name */ b_namefogwall, /* name */
b_rvisible, /* rvisible */ b_rvisible, /* rvisible */
b_fvisible, /* fvisible */ b_fvisible, /* fvisible */
b_uvisible, /* uvisible */ b_uvisible, /* uvisible */
}; };
static const char * static const char *
b_nameillusionwall(const border * b, const region * r, const struct faction * f, int gflags) b_nameillusionwall(const border * b, const region * r, const struct faction * f, int gflags)
{ {
/* TODO: UNICODE: f->locale bestimmt die Sprache */ int fno = b->data.i;
int fno = b->data.i; unused(b);
unused(b); unused(r);
unused(r); if (gflags & GF_ARTICLE) return (f && fno==f->subscription)?"an_illusionwall":"a_wall";
if (gflags & GF_ARTICLE) return (f && fno==f->subscription)?"eine Illusionswand":"eine Wand"; return (f && fno==f->no)?"illusionwall":"wall";
return (f && fno==f->no)?"Illusionswand":"Wand";
} }
border_type bt_illusionwall = { border_type bt_illusionwall = {
"illusionwall", VAR_INT, "illusionwall", VAR_INT,
b_opaque, b_opaque,
NULL, /* init */ NULL, /* init */
NULL, /* destroy */ NULL, /* destroy */
b_read, /* read */ b_read, /* read */
b_write, /* write */ b_write, /* write */
b_blocknone, /* block */ b_blocknone, /* block */
b_nameillusionwall, /* name */ b_nameillusionwall, /* name */
b_rvisible, /* rvisible */ b_rvisible, /* rvisible */
b_fvisible, /* fvisible */ b_fvisible, /* fvisible */
b_uvisible, /* uvisible */ b_uvisible, /* uvisible */
}; };
/*** /***
@ -376,45 +375,44 @@ border_type bt_illusionwall = {
***/ ***/
boolean b_blockquestportal(const border * b, const unit * u, const region * r) { boolean b_blockquestportal(const border * b, const unit * u, const region * r) {
if(b->data.i > 0) return true; if(b->data.i > 0) return true;
return false; return false;
} }
static const char * static const char *
b_namequestportal(const border * b, const region * r, const struct faction * f, int gflags) b_namequestportal(const border * b, const region * r, const struct faction * f, int gflags)
{ {
/* TODO: UNICODE: f->locale bestimmt die Sprache */ int lock = b->data.i;
int lock = b->data.i; unused(b);
unused(b); unused(r);
unused(r);
if (gflags & GF_ARTICLE) { if (gflags & GF_ARTICLE) {
if(lock > 0) { if(lock > 0) {
return "ein gewaltiges verschlossenes Tor"; return "a_gate_locked";
} else { } else {
return "ein gewaltiges offenes Tor"; return "a_gate_open";
} }
} else { } else {
if(lock > 0) { if(lock > 0) {
return "gewaltiges verschlossenes Tor"; return "gate_locked";
} else { } else {
return "gewaltiges offenes Tor"; return "gate_open";
} }
} }
} }
border_type bt_questportal = { border_type bt_questportal = {
"questportal", VAR_INT, "questportal", VAR_INT,
b_opaque, b_opaque,
NULL, /* init */ NULL, /* init */
NULL, /* destroy */ NULL, /* destroy */
b_read, /* read */ b_read, /* read */
b_write, /* write */ b_write, /* write */
b_blockquestportal, /* block */ b_blockquestportal, /* block */
b_namequestportal, /* name */ b_namequestportal, /* name */
b_rvisible, /* rvisible */ b_rvisible, /* rvisible */
b_fvisible, /* fvisible */ b_fvisible, /* fvisible */
b_uvisible, /* uvisible */ b_uvisible, /* uvisible */
}; };
/*** /***
@ -430,32 +428,32 @@ b_nameroad(const border * b, const region * r, const struct faction * f, int gfl
unused(f); unused(f);
if (gflags & GF_ARTICLE) { if (gflags & GF_ARTICLE) {
if (!(gflags & GF_DETAILED)) return LOC(f->locale, "nr_a_road"); if (!(gflags & GF_DETAILED)) return "a_road";
else if (r->terrain->max_road<=local) { else if (r->terrain->max_road<=local) {
int remote = (r2==b->from)?b->data.sa[0]:b->data.sa[1]; int remote = (r2==b->from)?b->data.sa[0]:b->data.sa[1];
if (r2->terrain->max_road<=remote) { if (r2->terrain->max_road<=remote) {
return LOC(f->locale, "nr_a_road"); return "a_road";
} else { } else {
return LOC(f->locale, "nr_an_incomplete_road"); return "an_incomplete_road";
} }
} else { } else {
int percent = max(1, 100*local/r->terrain->max_road); int percent = max(1, 100*local/r->terrain->max_road);
if (local) { if (local) {
snprintf(buffer, sizeof(buffer), LOC(f->locale, "nr_road_percent"), percent); snprintf(buffer, sizeof(buffer), "a_road_percent", percent);
} else { } else {
return LOC(f->locale, "nr_a_road_connection"); return "a_road_connection";
} }
} }
} }
else if (gflags & GF_PLURAL) return LOC(f->locale, "nr_roads"); else if (gflags & GF_PLURAL) return "roads";
else return LOC(f->locale, "nr_road"); else return "road";
return buffer; return buffer;
} }
static void static void
b_readroad(border * b, FILE *f) b_readroad(border * b, FILE *f)
{ {
fscanf(f, "%hd %hd ", &b->data.sa[0], &b->data.sa[1]); fscanf(f, "%hd %hd ", &b->data.sa[0], &b->data.sa[1]);
} }
static void static void
@ -467,8 +465,8 @@ b_writeroad(const border * b, FILE *f)
static boolean static boolean
b_validroad(const border * b) b_validroad(const border * b)
{ {
if (b->data.sa[0]==SHRT_MAX) return false; if (b->data.sa[0]==SHRT_MAX) return false;
return true; return true;
} }
static boolean static boolean
@ -486,18 +484,18 @@ b_rvisibleroad(const border * b, const region * r)
} }
border_type bt_road = { border_type bt_road = {
"road", VAR_INT, "road", VAR_INT,
b_transparent, b_transparent,
NULL, /* init */ NULL, /* init */
NULL, /* destroy */ NULL, /* destroy */
b_readroad, /* read */ b_readroad, /* read */
b_writeroad, /* write */ b_writeroad, /* write */
b_blocknone, /* block */ b_blocknone, /* block */
b_nameroad, /* name */ b_nameroad, /* name */
b_rvisibleroad, /* rvisible */ b_rvisibleroad, /* rvisible */
b_finvisible, /* fvisible */ b_finvisible, /* fvisible */
b_uinvisible, /* uvisible */ b_uinvisible, /* uvisible */
b_validroad /* valid */ b_validroad /* valid */
}; };
void void

View File

@ -1,7 +1,7 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* *
* Eressea PB(E)M host Copyright (C) 1998-2003 * Eressea PB(E)M host Copyright (C) 1998-2003
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
* Henning Peters (faroul@beyond.kn-bremen.de) * Henning Peters (faroul@beyond.kn-bremen.de)
@ -80,39 +80,39 @@ static region * start_region[6];
static region * static region *
arena_region(int magic) arena_region(int magic)
{ {
return tower_region[magic]; return tower_region[magic];
} }
static building * static building *
arena_tower(int magic) arena_tower(int magic)
{ {
return arena_region(magic)->buildings; return arena_region(magic)->buildings;
} }
static int static int
leave_fail(unit * u) leave_fail(unit * u)
{ {
ADDMSG(&u->faction->msgs, msg_message("arena_leave_fail", "unit", u)); ADDMSG(&u->faction->msgs, msg_message("arena_leave_fail", "unit", u));
return 1; return 1;
} }
static int static int
leave_arena(struct unit * u, const struct item_type * itype, int amount, order * ord) leave_arena(struct unit * u, const struct item_type * itype, int amount, order * ord)
{ {
if (!u->building && leave_fail(u)) return -1; if (!u->building && leave_fail(u)) return -1;
if (u->building!=arena_tower(u->faction->magiegebiet) && leave_fail(u)) return -1; if (u->building!=arena_tower(u->faction->magiegebiet) && leave_fail(u)) return -1;
unused(amount); unused(amount);
unused(ord); unused(ord);
unused(itype); unused(itype);
assert(!"not implemented"); assert(!"not implemented");
return 0; return 0;
} }
static int static int
enter_fail(unit * u) enter_fail(unit * u)
{ {
ADDMSG(&u->faction->msgs, msg_message("arena_enter_fail", "region unit", u->region, u)); ADDMSG(&u->faction->msgs, msg_message("arena_enter_fail", "region unit", u->region, u));
return 1; return 1;
} }
static int static int
@ -136,16 +136,16 @@ enter_arena(unit * u, const item_type * itype, int amount, order * ord)
assert(!"not implemented"); assert(!"not implemented");
/* /*
for (res=0;res!=MAXRESOURCES;++res) if (res!=R_SILVER && res!=R_ARENA_GATE && (is_item(res) || is_herb(res) || is_potion(res))) { for (res=0;res!=MAXRESOURCES;++res) if (res!=R_SILVER && res!=R_ARENA_GATE && (is_item(res) || is_herb(res) || is_potion(res))) {
int x = get_resource(u, res); int x = get_resource(u, res);
if (x) { if (x) {
if (u2) { if (u2) {
change_resource(u2, res, x); change_resource(u2, res, x);
change_resource(u, res, -x); change_resource(u, res, -x);
} }
else if (enter_fail(u)) return -1; else if (enter_fail(u)) return -1;
} }
} }
*/ */
if (get_money(u) > fee) { if (get_money(u) > fee) {
if (u2) change_money(u2, get_money(u) - fee); if (u2) change_money(u2, get_money(u) - fee);
@ -167,25 +167,25 @@ enter_arena(unit * u, const item_type * itype, int amount, order * ord)
static int static int
use_wand_of_tears(unit * user, const struct item_type * itype, int amount, order * ord) use_wand_of_tears(unit * user, const struct item_type * itype, int amount, order * ord)
{ {
int i; int i;
unused(ord); unused(ord);
for (i=0;i!=amount;++i) { for (i=0;i!=amount;++i) {
unit * u; unit * u;
for (u=user->region->units;u;u=u->next) { for (u=user->region->units;u;u=u->next) {
if (u->faction != user->faction) { if (u->faction != user->faction) {
int i; int i;
for (i=0;i!=u->skill_size;++i) { for (i=0;i!=u->skill_size;++i) {
if (rng_int()%3) reduce_skill(u, u->skills+i, 1); if (rng_int()%3) reduce_skill(u, u->skills+i, 1);
} }
ADDMSG(&u->faction->msgs, msg_message("wand_of_tears_effect", ADDMSG(&u->faction->msgs, msg_message("wand_of_tears_effect",
"unit", u)); "unit", u));
} }
} }
} }
ADDMSG(&user->region->msgs, msg_message("wand_of_tears_usage", ADDMSG(&user->region->msgs, msg_message("wand_of_tears_usage",
"unit", user)); "unit", user));
return 0; return 0;
} }
/** /**
@ -193,70 +193,70 @@ use_wand_of_tears(unit * user, const struct item_type * itype, int amount, order
static int static int
age_hurting(attrib * a) { age_hurting(attrib * a) {
building * b = (building *)a->data.v; building * b = (building *)a->data.v;
unit * u; unit * u;
int active = 0; int active = 0;
if (b==NULL) return 0; if (b==NULL) return 0;
for (u=b->region->units;u;u=u->next) { for (u=b->region->units;u;u=u->next) {
if (u->building==b) { if (u->building==b) {
if (u->faction->magiegebiet==M_CHAOS) { if (u->faction->magiegebiet==M_CHAOS) {
active ++; active ++;
ADDMSG(&b->region->msgs, msg_message("praytoigjarjuk", "unit", u)); ADDMSG(&b->region->msgs, msg_message("praytoigjarjuk", "unit", u));
} }
} }
} }
if (active) for (u=b->region->units;u;u=u->next) if (playerrace(u->faction->race)) { if (active) for (u=b->region->units;u;u=u->next) if (playerrace(u->faction->race)) {
int i; int i;
if (u->faction->magiegebiet!=M_CHAOS) { if (u->faction->magiegebiet!=M_CHAOS) {
for (i=0;i!=active;++i) u->hp = (u->hp+1) / 2; /* make them suffer, but not die */ for (i=0;i!=active;++i) u->hp = (u->hp+1) / 2; /* make them suffer, but not die */
ADDMSG(&b->region->msgs, msg_message("cryinpain", "unit", u)); ADDMSG(&b->region->msgs, msg_message("cryinpain", "unit", u));
} }
} }
return 1; return 1;
} }
static void static void
write_hurting(const attrib * a, FILE * F) { write_hurting(const attrib * a, FILE * F) {
building * b = a->data.v; building * b = a->data.v;
fprintf(F, "%d ", b->no); fprintf(F, "%d ", b->no);
} }
static int static int
read_hurting(attrib * a, FILE * F) { read_hurting(attrib * a, FILE * F) {
int i; int i;
fscanf(F, "%d", &i); fscanf(F, "%d", &i);
a->data.v = (void*)findbuilding(i); a->data.v = (void*)findbuilding(i);
if (a->data.v==NULL) { if (a->data.v==NULL) {
log_error(("temple of pain is broken\n")); log_error(("temple of pain is broken\n"));
return AT_READ_FAIL; return AT_READ_FAIL;
} }
return AT_READ_OK; return AT_READ_OK;
} }
static attrib_type at_hurting = { static attrib_type at_hurting = {
"hurting", NULL, NULL, age_hurting, write_hurting, read_hurting "hurting", NULL, NULL, age_hurting, write_hurting, read_hurting
}; };
#ifdef ARENA_CREATION #ifdef ARENA_CREATION
static void static void
make_temple(region * r) make_temple(region * r)
{ {
const building_type * btype = bt_find("temple"); const building_type * btype = bt_find("temple");
building * b; building * b;
if (btype==NULL) { if (btype==NULL) {
log_error(("could not find buildingtype 'temple'\n")); log_error(("could not find buildingtype 'temple'\n"));
return; return;
} }
b = r->buildings; b = r->buildings;
while (b!=NULL && b->type!=btype) b = b->next; while (b!=NULL && b->type!=btype) b = b->next;
if (b!=NULL) return; /* gibt schon einen */ if (b!=NULL) return; /* gibt schon einen */
b = new_building(btype, r, NULL); b = new_building(btype, r, NULL);
b->size = btype->maxsize; b->size = btype->maxsize;
b->name = strdup("Igjarjuk's Tempel der Schreie"); b->name = strdup("Igjarjuk's Tempel der Schreie");
b->display = strdup("Ein Schrein aus spitzen Knochen und lodernden Flammen, gewidmet dem Wyrm der Wyrme"); b->display = strdup("Ein Schrein aus spitzen Knochen und lodernden Flammen, gewidmet dem Wyrm der Wyrme");
a_add(&b->attribs, a_new(&at_hurting))->data.v=b; a_add(&b->attribs, a_new(&at_hurting))->data.v=b;
} }
#endif #endif
@ -267,39 +267,39 @@ make_temple(region * r)
static void static void
tower_init(void) tower_init(void)
{ {
int i, first = newarena; int i, first = newarena;
item_type * it_demonseye = it_find("demonseye"); item_type * it_demonseye = it_find("demonseye");
item_type * it_griphonwing = it_find("griphonwing"); item_type * it_griphonwing = it_find("griphonwing");
assert(it_griphonwing && it_demonseye); assert(it_griphonwing && it_demonseye);
for (i=0;i!=6;++i) { for (i=0;i!=6;++i) {
region * r = tower_region[i] = findregion(arena_center->x+delta_x[i]*3, arena_center->y+delta_y[i]*3); region * r = tower_region[i] = findregion(arena_center->x+delta_x[i]*3, arena_center->y+delta_y[i]*3);
if (r) { if (r) {
start_region[i] = findregion(arena_center->x+delta_x[i]*2, arena_center->y+delta_y[i]*2); start_region[i] = findregion(arena_center->x+delta_x[i]*2, arena_center->y+delta_y[i]*2);
if (rterrain(r)!=T_DESERT) terraform(r, T_DESERT); if (rterrain(r)!=T_DESERT) terraform(r, T_DESERT);
if (!r->buildings) { if (!r->buildings) {
building * b = new_building(bt_find("castle"), r, NULL); building * b = new_building(bt_find("castle"), r, NULL);
b->size = 10; b->size = 10;
if (i!=0) { if (i!=0) {
sprintf(buf, "Turm des %s", sprintf(buf, "Turm des %s",
LOC(default_locale, mkname("school", magietypen[i]))); LOC(default_locale, mkname("school", magietypen[i])));
} }
else sprintf(buf, "Turm der Ahnungslosen"); else sprintf(buf, "Turm der Ahnungslosen");
set_string(&b->name, buf); set_string(&b->name, buf);
} }
} }
} }
if (first && !arena_center->buildings) { if (first && !arena_center->buildings) {
building * b = new_building(bt_find("castle"), arena_center, NULL); building * b = new_building(bt_find("castle"), arena_center, NULL);
attrib * a; attrib * a;
item * items; item * items;
i_add(&items, i_new(it_griphonwing, 1)); i_add(&items, i_new(it_griphonwing, 1));
i_add(&items, i_new(it_demonseye, 1)); i_add(&items, i_new(it_demonseye, 1));
a = a_add(&b->attribs, make_giveitem(b, items)); a = a_add(&b->attribs, make_giveitem(b, items));
b->size = 10; b->size = 10;
set_string(&b->name, "Höhle des Greifen"); set_string(&b->name, "Höhle des Greifen");
} }
} }
#endif #endif
@ -307,49 +307,49 @@ tower_init(void)
static void static void
guardian_faction(plane * pl, int id) guardian_faction(plane * pl, int id)
{ {
region * r; region * r;
faction * f = findfaction(id); faction * f = findfaction(id);
if (!f) { if (!f) {
f = calloc(1, sizeof(faction)); f = calloc(1, sizeof(faction));
f->banner = strdup("Sie dienen dem großen Wyrm"); f->banner = strdup("Sie dienen dem grossen Wyrm");
f->passw = strdup(itoa36(rng_int())); f->passw = strdup(itoa36(rng_int()));
f->override = strdup(itoa36(rng_int())); f->override = strdup(itoa36(rng_int()));
set_email(&f->email, "igjarjuk@eressea.de"); set_email(&f->email, "igjarjuk@eressea.de");
f->name = strdup("Igjarjuks Kundschafter"); f->name = strdup("Igjarjuks Kundschafter");
f->race = new_race[RC_ILLUSION]; f->race = new_race[RC_ILLUSION];
f->age = turn; f->age = turn;
f->locale = find_locale("de"); f->locale = find_locale("de");
f->options = want(O_COMPRESS) | want(O_REPORT) | want(O_COMPUTER) | want(O_ADRESSEN) | want(O_DEBUG); f->options = want(O_COMPRESS) | want(O_REPORT) | want(O_COMPUTER) | want(O_ADRESSEN) | want(O_DEBUG);
f->no = id; f->no = id;
addlist(&factions, f); addlist(&factions, f);
fhash(f); fhash(f);
} }
if (f->race != new_race[RC_ILLUSION]) { if (f->race != new_race[RC_ILLUSION]) {
assert(!"guardian id vergeben"); assert(!"guardian id vergeben");
exit(0); exit(0);
} }
f->lastorders = turn; f->lastorders = turn;
f->alive = true; f->alive = true;
for (r=regions;r;r=r->next) if (getplane(r)==pl && rterrain(r)!=T_FIREWALL) for (r=regions;r;r=r->next) if (getplane(r)==pl && rterrain(r)!=T_FIREWALL)
{ {
unit * u; unit * u;
freset(r, RF_ENCOUNTER); freset(r, RF_ENCOUNTER);
for (u=r->units;u;u=u->next) { for (u=r->units;u;u=u->next) {
if (u->faction==f) break; if (u->faction==f) break;
} }
if (u) continue; if (u) continue;
u = createunit(r, f, 1, new_race[RC_GOBLIN]); u = createunit(r, f, 1, new_race[RC_GOBLIN]);
set_string(&u->name, "Igjarjuks Auge"); set_string(&u->name, "Igjarjuks Auge");
set_item(u, I_RING_OF_INVISIBILITY, 1); set_item(u, I_RING_OF_INVISIBILITY, 1);
set_order(&u->thisorder, NULL); set_order(&u->thisorder, NULL);
#ifdef LASTORDER #ifdef LASTORDER
set_order(&u->lastorder, NULL); set_order(&u->lastorder, NULL);
#endif #endif
fset(u, UFL_PARTEITARNUNG); fset(u, UFL_PARTEITARNUNG);
set_money(u, 1000); set_money(u, 1000);
} }
} }
#endif #endif
@ -359,13 +359,13 @@ guardian_faction(plane * pl, int id)
static void static void
block_create(short x1, short y1, char terrain) block_create(short x1, short y1, char terrain)
{ {
short x, y; short x, y;
for (x=0;x!=BLOCKSIZE;++x) { for (x=0;x!=BLOCKSIZE;++x) {
for (y=0;y!=BLOCKSIZE;++y) { for (y=0;y!=BLOCKSIZE;++y) {
region * r = new_region(x1 + x, y1 + y); region * r = new_region(x1 + x, y1 + y);
terraform(r, terrain); terraform(r, terrain);
} }
} }
} }
#endif #endif
@ -374,76 +374,76 @@ block_create(short x1, short y1, char terrain)
static int static int
caldera_handle(trigger * t, void * data) caldera_handle(trigger * t, void * data)
{ {
/* call an event handler on caldera. /* call an event handler on caldera.
* data.v -> ( variant event, int timer ) * data.v -> ( variant event, int timer )
*/ */
building *b = (building *)t->data.v; building *b = (building *)t->data.v;
if (b!=NULL) { if (b!=NULL) {
unit ** up = &b->region->units; unit ** up = &b->region->units;
while (*up) { while (*up) {
unit * u = *up; unit * u = *up;
if (u->building==b) { if (u->building==b) {
message * msg; message * msg;
if (u->items) { if (u->items) {
item ** ip = &u->items; item ** ip = &u->items;
msg = msg_message("caldera_handle_1", "unit items", u, u->items); msg = msg_message("caldera_handle_1", "unit items", u, u->items);
while (*ip) { while (*ip) {
item * i = *ip; item * i = *ip;
i_remove(ip, i); i_remove(ip, i);
if (*ip==i) ip=&i->next; if (*ip==i) ip=&i->next;
} }
} else { } else {
msg = msg_message("caldera_handle_0", "unit", u); msg = msg_message("caldera_handle_0", "unit", u);
} }
add_message(&u->region->msgs, msg); add_message(&u->region->msgs, msg);
set_number(u, 0); set_number(u, 0);
} }
if (*up==u) up = &u->next; if (*up==u) up = &u->next;
} }
} else { } else {
log_error(("could not perform caldera::handle()\n")); log_error(("could not perform caldera::handle()\n"));
} }
unused(data); unused(data);
return 0; return 0;
} }
static void static void
caldera_write(const trigger * t, FILE * F) caldera_write(const trigger * t, FILE * F)
{ {
building *b = (building *)t->data.v; building *b = (building *)t->data.v;
fprintf(F, "%s ", itoa36(b->no)); fprintf(F, "%s ", itoa36(b->no));
} }
static int static int
caldera_read(trigger * t, FILE * F) caldera_read(trigger * t, FILE * F)
{ {
char zText[128]; char zText[128];
variant var; variant var;
fscanf(F, "%s", zText); fscanf(F, "%s", zText);
var.i = atoi36(zText); var.i = atoi36(zText);
t->data.v = findbuilding(var.i); t->data.v = findbuilding(var.i);
if (t->data.v==NULL) ur_add(var, &t->data.v, resolve_building); if (t->data.v==NULL) ur_add(var, &t->data.v, resolve_building);
return AT_READ_OK; return AT_READ_OK;
} }
struct trigger_type tt_caldera = { struct trigger_type tt_caldera = {
"caldera", "caldera",
NULL, NULL,
NULL, NULL,
caldera_handle, caldera_handle,
caldera_write, caldera_write,
caldera_read caldera_read
}; };
#ifdef ARENA_CREATION #ifdef ARENA_CREATION
static trigger * static trigger *
trigger_caldera(building * b) trigger_caldera(building * b)
{ {
trigger * t = t_new(&tt_caldera); trigger * t = t_new(&tt_caldera);
t->data.v = b; t->data.v = b;
return t; return t;
} }
#endif #endif
@ -451,17 +451,17 @@ trigger_caldera(building * b)
static void static void
init_volcano(void) init_volcano(void)
{ {
building * b; building * b;
region * r = arena_center; region * r = arena_center;
assert(arena_center); assert(arena_center);
if (rterrain(r)!=T_DESERT) return; /* been done before */ if (rterrain(r)!=T_DESERT) return; /* been done before */
terraform(arena_center, T_VOLCANO_SMOKING); terraform(arena_center, T_VOLCANO_SMOKING);
b = new_building(bt_find("caldera"), r, NULL); b = new_building(bt_find("caldera"), r, NULL);
b->size = 1; b->size = 1;
b->name = strdup("Igjarjuk's Schlund"); b->name = strdup("Igjarjuk's Schlund");
b->display = strdup("Feurige Lava fließt aus dem Krater des großen Vulkans. Alles wird von ihr verschlungen."); b->display = strdup("Feurige Lava fließt aus dem Krater des großen Vulkans. Alles wird von ihr verschlungen.");
add_trigger(&b->attribs, "timer", trigger_caldera(b)); add_trigger(&b->attribs, "timer", trigger_caldera(b));
tt_register(&tt_caldera); tt_register(&tt_caldera);
} }
#endif #endif
#endif #endif
@ -470,50 +470,50 @@ init_volcano(void)
void void
create_arena(void) create_arena(void)
{ {
short x; short x;
arena_id = hashstring("arena"); arena_id = hashstring("arena");
arena = getplanebyid(arena_id); arena = getplanebyid(arena_id);
if (arena!=NULL) return; if (arena!=NULL) return;
score(); /* ist wichtig, damit alle Parteien einen score haben, wenn sie durchs Tor wollen. */ score(); /* ist wichtig, damit alle Parteien einen score haben, wenn sie durchs Tor wollen. */
guardian_faction(arena, 999); guardian_faction(arena, 999);
if (arena) arena_center = findregion(plane_center_x(arena), plane_center_y(arena)); if (arena) arena_center = findregion(plane_center_x(arena), plane_center_y(arena));
if (!arena_center) { if (!arena_center) {
newarena = 1; newarena = 1;
arena = create_new_plane(arena_id, "Arena", -10000, -10000, 0, BLOCKSIZE-1, PFL_LOWSTEALING | PFL_NORECRUITS | PFL_NOALLIANCES); arena = create_new_plane(arena_id, "Arena", -10000, -10000, 0, BLOCKSIZE-1, PFL_LOWSTEALING | PFL_NORECRUITS | PFL_NOALLIANCES);
block_create(arena->minx, arena->miny, T_OCEAN); block_create(arena->minx, arena->miny, T_OCEAN);
arena_center = findregion(plane_center_x(arena), plane_center_y(arena)); arena_center = findregion(plane_center_x(arena), plane_center_y(arena));
for (x=0;x!=BLOCKSIZE;++x) { for (x=0;x!=BLOCKSIZE;++x) {
short y; short y;
for (y=0;y!=BLOCKSIZE;++y) { for (y=0;y!=BLOCKSIZE;++y) {
region * r = findregion(arena->minx+x, arena->miny+y); region * r = findregion(arena->minx+x, arena->miny+y);
freset(r, RF_ENCOUNTER); freset(r, RF_ENCOUNTER);
r->planep = arena; r->planep = arena;
switch (distance(r, arena_center)) { switch (distance(r, arena_center)) {
case 4: case 4:
terraform(r, T_FIREWALL); terraform(r, T_FIREWALL);
break; break;
case 0: case 0:
terraform(r, T_GLACIER); terraform(r, T_GLACIER);
break; break;
case 1: case 1:
terraform(r, T_SWAMP); terraform(r, T_SWAMP);
break; break;
case 2: case 2:
terraform(r, T_MOUNTAIN); terraform(r, T_MOUNTAIN);
break; break;
} }
} }
} }
} }
make_temple(arena_center); make_temple(arena_center);
#ifdef CENTRAL_VOLCANO #ifdef CENTRAL_VOLCANO
init_volcano(); init_volcano();
#else #else
if (arena_center->terrain!=T_DESERT) terraform(arena_center, T_DESERT); if (arena_center->terrain!=T_DESERT) terraform(arena_center, T_DESERT);
#endif #endif
rsetmoney(arena_center, 0); rsetmoney(arena_center, 0);
rsetpeasants(arena_center, 0); rsetpeasants(arena_center, 0);
tower_init(); tower_init();
} }
#endif #endif
void void

View File

@ -545,7 +545,7 @@ sp_summon_familiar(castorder *co)
int dh, dh1, bytes; int dh, dh1, bytes;
direction_t d; direction_t d;
message * msg; message * msg;
char zText[NAMESIZE], * bufp = zText; char zText[1024], * bufp = zText;
size_t size = sizeof(zText) - 1; size_t size = sizeof(zText) - 1;
if (get_familiar(mage) != NULL ) { if (get_familiar(mage) != NULL ) {
@ -2808,15 +2808,15 @@ resolve_buddy(variant data)
static const char * static const char *
fire_name(const border * b, const region * r, const faction * f, int gflags) b_namefirewall(const border * b, const region * r, const faction * f, int gflags)
{ {
unused(f); unused(f);
unused(r); unused(r);
unused(b); unused(b);
if (gflags & GF_ARTICLE) if (gflags & GF_ARTICLE)
return "eine Feuerwand"; return "a_firewall";
else else
return "Feuerwand"; return "firewall";
} }
static void static void
@ -2881,7 +2881,7 @@ border_type bt_firewall = {
wall_read, /* read */ wall_read, /* read */
wall_write, /* write */ wall_write, /* write */
b_blocknone, /* block */ b_blocknone, /* block */
fire_name, /* name */ b_namefirewall, /* name */
b_rvisible, /* rvisible */ b_rvisible, /* rvisible */
b_finvisible, /* fvisible */ b_finvisible, /* fvisible */
b_uinvisible, /* uvisible */ b_uinvisible, /* uvisible */
@ -2955,15 +2955,15 @@ sp_firewall(castorder *co)
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
static const char * static const char *
wisps_name(const border * b, const region * r, const faction * f, int gflags) b_namewisps(const border * b, const region * r, const faction * f, int gflags)
{ {
unused(f); unused(f);
unused(r); unused(r);
unused(b); unused(b);
if (gflags & GF_ARTICLE) if (gflags & GF_ARTICLE)
return "eine Gruppe von Irrlichtern"; return "a_wisps";
else else
return "Irrlichter"; return "wisps";
} }
typedef struct wisps_data { typedef struct wisps_data {
@ -3009,7 +3009,7 @@ border_type bt_wisps = {
wall_read, /* read */ wall_read, /* read */
wall_write, /* write */ wall_write, /* write */
b_blocknone, /* block */ b_blocknone, /* block */
wisps_name, /* name */ b_namewisps, /* name */
b_rvisible, /* rvisible */ b_rvisible, /* rvisible */
b_fvisible, /* fvisible */ b_fvisible, /* fvisible */
b_uvisible, /* uvisible */ b_uvisible, /* uvisible */

View File

@ -19,6 +19,7 @@
<text locale="de">Wabernde grüne Schwaden treiben durch den Nebel und <text locale="de">Wabernde grüne Schwaden treiben durch den Nebel und
verdichten sich zu einer unheimlichen Kreatur, die nur aus einem langen verdichten sich zu einer unheimlichen Kreatur, die nur aus einem langen
Ruderschwanz und einem riesigen runden Maul zu bestehen scheint.</text> Ruderschwanz und einem riesigen runden Maul zu bestehen scheint.</text>
<text locale="en">Wobbling green vapours drift through the mists to form an eldritch creature that seems to be entirely made up of huge jaws and a long tail.</text>
</string> </string>
<namespace name="raceinfo"> <namespace name="raceinfo">
<string name="no_info"> <string name="no_info">
@ -7442,41 +7443,114 @@
<text locale="en">Owner</text> <text locale="en">Owner</text>
</string> </string>
<string name="nr_a_road"> <namespace name="border">
<text locale="de">eine Straße</text> <string name="a_road">
<text locale="en">a road</text> <text locale="de">eine Straße</text>
</string> <text locale="en">a road</text>
</string>
<string name="nr_roads"> <string name="roads">
<text locale="de">Straßen</text> <text locale="de">Straßen</text>
<text locale="en">roads</text> <text locale="en">roads</text>
</string> </string>
<string name="nr_road"> <string name="road">
<text locale="de">Straße</text> <text locale="de">Straße</text>
<text locale="en">road</text> <text locale="en">road</text>
</string> </string>
<string name="nr_road_percent"> <string name="a_road_percent">
<text locale="de">eine zu %d%% vollendete Straße</text> <text locale="de">eine zu %d%% vollendete Straße</text>
<text locale="en">a road that is %d%% complete</text> <text locale="en">a road that is %d%% complete</text>
</string> </string>
<string name="nr_a_road_connection"> <string name="a_road_connection">
<text locale="de">ein Straßenanschluß</text> <text locale="de">ein Straßenanschluß</text>
<text locale="en">a connection to another road</text> <text locale="en">a connection to another road</text>
</string> </string>
<string name="an_incomplete_road">
<text locale="de">eine unvollständige Straße</text>
<text locale="en">an incomplete road</text>
</string>
<string name="wall">
<text locale="de">Wand</text>
<text locale="en">wall</text>
</string>
<string name="a_wall">
<text locale="de">eine Wand</text>
<text locale="en">a wall</text>
</string>
<string name="firewall">
<text locale="de">Feuerwand</text>
<text locale="en">firewall</text>
</string>
<string name="a_firewall">
<text locale="de">eine Feuerwand</text>
<text locale="en">a firewall</text>
</string>
<string name="fogwall">
<text locale="de">Nebelwand</text>
<text locale="en">wall of fog</text>
</string>
<string name="a_fogwall">
<text locale="de">eine Nebelwand</text>
<text locale="en">a wall of fog</text>
</string>
<string name="wisps">
<text locale="de">Irrlichter</text>
<text locale="en">wisps</text>
</string>
<string name="a_wisps">
<text locale="de">eine Gruppe von Irrlichtern</text>
<text locale="en">a cloud of wisps</text>
</string>
<string name="gate_open">
<text locale="de">gewaltiges offenes Tor</text>
<text locale="en">massive open door</text>
</string>
<string name="a_gate_open">
<text locale="de">ein gewaltiges offenes Tor</text>
<text locale="en">a massive open door</text>
</string>
<string name="gate_closed">
<text locale="de">gewaltiges geschlossenes Tor</text>
<text locale="en">massive locked door</text>
</string>
<string name="a_gate_closed">
<text locale="de">ein gewaltiges geschlossenes Tor</text>
<text locale="en">a massive locked door</text>
</string>
<string name="illusionwall">
<text locale="de">Illusionswand</text>
<text locale="en">illusionary wall</text>
</string>
<string name="an_illusionwall">
<text locale="de">eine Illusionswand</text>
<text locale="en">an illusionary wall</text>
</string>
</namespace>
<string name="nr_reduced_production"> <string name="nr_reduced_production">
<text locale="de">Die Region ist verwüstet, der Boden karg.</text> <text locale="de">Die Region ist verwüstet, der Boden karg.</text>
<text locale="en">The region is ravaged, the ground infertile.</text> <text locale="en">The region is ravaged, the ground infertile.</text>
</string> </string>
<string name="nr_an_incomplete_road">
<text locale="de">eine unvollständige Straße</text>
<text locale="en">an incomplete road</text>
</string>
<string name="par_unit"> <string name="par_unit">
<text locale="de">Einheit-Nr</text> <text locale="de">Einheit-Nr</text>
<text locale="en">unitid</text> <text locale="en">unitid</text>