"road anstatt straße im cr"
fixed again, differently
This commit is contained in:
Enno Rehling 2007-12-18 22:58:58 +00:00
parent e780097a3b
commit 09683fd891
7 changed files with 305 additions and 283 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(b, r, f, 0); /* bug 1326 - I hate this */ const char * bname = b->type->name(b, r, f, GF_PURE);
fprintf(F, "GRENZE %d\n", ++g); fprintf(F, "GRENZE %d\n", ++g);
fprintf(F, "\"%s\";typ\n", LOC(default_locale, mkname("border", bname))); fprintf(F, "\"%s\";typ\n", LOC(default_locale, 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;
const char * name; 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 = name; e->name = strdup(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();
} }
/* horses */ /* Pferde */
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, LOC(f->locale, mkname("border", e->name)), size); bytes = (int)strlcpy(bufp, 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,6 +1163,7 @@ 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

@ -278,11 +278,14 @@ 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)
{ {
const char * bname = "wall";
unused(f); unused(f);
unused(r); unused(r);
unused(b); unused(b);
if (gflags & GF_ARTICLE) return "a_wall"; if (gflags & GF_ARTICLE) bname = "a_wall";
return "wall"; if (gflags & GF_PURE) return bname;
return LOC(f->locale, mkname("border", bname));
} }
border_type bt_wall = { border_type bt_wall = {
@ -319,8 +322,9 @@ b_namefogwall(const border * b, const region * r, const struct faction * f, int
unused(f); unused(f);
unused(b); unused(b);
unused(r); unused(r);
if (gflags & GF_ARTICLE) return "a_fogwall"; if (gflags & GF_PURE) return "fogwall";
return "fogwall"; if (gflags & GF_ARTICLE) return LOC(f->locale, mkname("border", "a_fogwall"));
return LOC(f->locale, mkname("border", "fogwall"));
} }
static boolean static boolean
@ -349,11 +353,15 @@ border_type bt_fogwall = {
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_PURE) return (f && fno==f->no)?"illusionwall":"wall";
return (f && fno==f->no)?"illusionwall":"wall"; if (gflags & GF_ARTICLE) {
return LOC(f->locale, mkname("border", (f && fno==f->subscription)?"an_illusionwall":"a_wall"));
}
return LOC(f->locale, mkname("border", (f && fno==f->no)?"illusionwall":"wall"));
} }
border_type bt_illusionwall = { border_type bt_illusionwall = {
@ -382,23 +390,27 @@ boolean b_blockquestportal(const border * b, const unit * u, const region * r) {
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 */
const char * bname;
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 "a_gate_locked"; bname = "a_gate_locked";
} else { } else {
return "a_gate_open"; bname = "a_gate_open";
} }
} else { } else {
if(lock > 0) { if (lock > 0) {
return "gate_locked"; bname = "gate_locked";
} else { } else {
return "gate_open"; bname = "gate_open";
} }
} }
if (gflags & GF_PURE) return bname;
return LOC(f->locale, mkname("border", bname));
} }
border_type bt_questportal = { border_type bt_questportal = {
@ -427,26 +439,27 @@ b_nameroad(const border * b, const region * r, const struct faction * f, int gfl
static char buffer[64]; static char buffer[64];
unused(f); unused(f);
if (gflags & GF_PURE) return "road";
if (gflags & GF_ARTICLE) { if (gflags & GF_ARTICLE) {
if (!(gflags & GF_DETAILED)) return "a_road"; if (!(gflags & GF_DETAILED)) return LOC(f->locale, mkname("border", "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 "a_road"; return LOC(f->locale, mkname("border", "a_road"));
} else { } else {
return "an_incomplete_road"; return LOC(f->locale, mkname("border", "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), "a_road_percent", percent); snprintf(buffer, sizeof(buffer), LOC(f->locale, mkname("border", "road_percent")), percent);
} else { } else {
return "a_road_connection"; return LOC(f->locale, mkname("border", "a_road_connection"));
} }
} }
} }
else if (gflags & GF_PLURAL) return "roads"; else if (gflags & GF_PLURAL) return LOC(f->locale, mkname("border", "roads"));
else return "road"; else return LOC(f->locale, mkname("border", "road"));
return buffer; return buffer;
} }

View file

@ -303,6 +303,8 @@ void addmessage(struct region * r, struct faction * f, const char *s, msg_t mtyp
/* der, die, das vs. ein, eine */ /* der, die, das vs. ein, eine */
#define GF_DETAILED 32 #define GF_DETAILED 32
/* mehr Informationen. z.b. straße zu 50% */ /* mehr Informationen. z.b. straße zu 50% */
#define GF_PURE 64
/* untranslated */
#define GUARD_NONE 0 #define GUARD_NONE 0
#define GUARD_TAX 1 #define GUARD_TAX 1

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 grossen Wyrm"); f->banner = strdup("Sie dienen dem großen 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[1024], * bufp = zText; char zText[NAMESIZE], * bufp = zText;
size_t size = sizeof(zText) - 1; size_t size = sizeof(zText) - 1;
if (get_familiar(mage) != NULL ) { if (get_familiar(mage) != NULL ) {
@ -2810,13 +2810,15 @@ resolve_buddy(variant data)
static const char * static const char *
b_namefirewall(const border * b, const region * r, const faction * f, int gflags) b_namefirewall(const border * b, const region * r, const faction * f, int gflags)
{ {
const char * bname;
unused(f); unused(f);
unused(r); unused(r);
unused(b); unused(b);
if (gflags & GF_ARTICLE) if (gflags & GF_ARTICLE) bname = "a_firewall";
return "a_firewall"; else bname = "firewall";
else
return "firewall"; if (gflags & GF_PURE) return bname;
return LOC(f->locale, mkname("border", bname));
} }
static void static void
@ -2955,15 +2957,19 @@ sp_firewall(castorder *co)
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
static const char * static const char *
b_namewisps(const border * b, const region * r, const faction * f, int gflags) wisps_name(const border * b, const region * r, const faction * f, int gflags)
{ {
const char * bname;
unused(f); unused(f);
unused(r); unused(r);
unused(b); unused(b);
if (gflags & GF_ARTICLE) if (gflags & GF_ARTICLE) {
return "a_wisps"; bname = "a_wisps";
else } else {
return "wisps"; bname = "wisps";
}
if (gflags & GF_PURE) return bname;
return LOC(f->locale, mkname("border", bname));
} }
typedef struct wisps_data { typedef struct wisps_data {
@ -3009,7 +3015,7 @@ border_type bt_wisps = {
wall_read, /* read */ wall_read, /* read */
wall_write, /* write */ wall_write, /* write */
b_blocknone, /* block */ b_blocknone, /* block */
b_namewisps, /* name */ wisps_name, /* name */
b_rvisible, /* rvisible */ b_rvisible, /* rvisible */
b_fvisible, /* fvisible */ b_fvisible, /* fvisible */
b_uvisible, /* uvisible */ b_uvisible, /* uvisible */

View file

@ -7524,13 +7524,13 @@
<text locale="en">a massive open door</text> <text locale="en">a massive open door</text>
</string> </string>
<string name="gate_closed"> <string name="gate_locked">
<text locale="de">gewaltiges geschlossenes Tor</text> <text locale="de">gewaltiges verschlossenes Tor</text>
<text locale="en">massive locked door</text> <text locale="en">massive locked door</text>
</string> </string>
<string name="a_gate_closed"> <string name="a_gate_locked">
<text locale="de">ein gewaltiges geschlossenes Tor</text> <text locale="de">ein gewaltiges verschlossenes Tor</text>
<text locale="en">a massive locked door</text> <text locale="en">a massive locked door</text>
</string> </string>