- regionid() und die ersetzung von \\r entfernt.

- Neue Funktion für Steinkreise
- Bugfix alta Steinkreisfunktion
- Geschwindigkeit findfaction
- Geschwindigkeit it_find
- Einige Messages internationalisiert
- Bugfix Startholz
This commit is contained in:
Enno Rehling 2005-01-19 20:33:13 +00:00
parent 0bd27124b2
commit 13172a28af
41 changed files with 316 additions and 324 deletions

View File

@ -1,5 +1,5 @@
C++ = g++ ; C++ = g++ ;
CC = tcc ; CC = gcc ;
if ! $(HAVE_LUA) { if ! $(HAVE_LUA) {
HAVE_LUA = 1 ; HAVE_LUA = 1 ;

View File

@ -71,6 +71,7 @@ createmonsters(void)
f->alive = 1; f->alive = 1;
f->options = (char) pow(2, O_REPORT); f->options = (char) pow(2, O_REPORT);
addlist(&factions, f); addlist(&factions, f);
fhash(f);
} }
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */

View File

@ -161,14 +161,11 @@ reset_translations(void)
static void static void
cr_output_str_list(FILE * F, const char *title, const strlist * S, const faction * f) cr_output_str_list(FILE * F, const char *title, const strlist * S, const faction * f)
{ {
char *s;
if (!S) return; if (!S) return;
fprintf(F, "%s\n", title); fprintf(F, "%s\n", title);
while (S) { while (S) {
s = replace_global_coords(S->s, f); fprintf(F, "\"%s\"\n", S->s);
fprintf(F, "\"%s\"\n", s);
S = S->next; S = S->next;
} }
} }

View File

@ -743,9 +743,7 @@ maintain(building * b, boolean first)
region * r = b->region; region * r = b->region;
boolean paid = true, work = first; boolean paid = true, work = first;
unit * u; unit * u;
if (fval(b, BLD_MAINTAINED)) return true; if (fval(b, BLD_MAINTAINED) || b->type==NULL || b->type->maintenance==NULL || is_cursed(b->attribs, C_NOCOST, 0)) {
if (b->type==NULL || b->type->maintenance==NULL) return true;
if (is_cursed(b->attribs, C_NOCOST, 0)) {
fset(b, BLD_MAINTAINED); fset(b, BLD_MAINTAINED);
fset(b, BLD_WORKING); fset(b, BLD_WORKING);
return true; return true;
@ -1962,8 +1960,9 @@ expandselling(region * r, request * sellorders, int limit)
if (taxcollected > 0) { if (taxcollected > 0) {
change_money(maxowner, (int) taxcollected); change_money(maxowner, (int) taxcollected);
add_income(maxowner, IC_TRADETAX, taxcollected, taxcollected); add_income(maxowner, IC_TRADETAX, taxcollected, taxcollected);
/* sprintf(buf, "%s verdient %d Silber durch den Handel in %s.", /* TODO: Meldung
unitname(maxowner), (int) taxcollected, regionid(r)); */ * sprintf(buf, "%s verdient %d Silber durch den Handel in %s.",
* unitname(maxowner), (int) taxcollected, regionname(r)); */
} }
} }
if (hafenowner) { if (hafenowner) {

View File

@ -58,6 +58,7 @@
#include <kernel/ship.h> #include <kernel/ship.h>
#include <kernel/skill.h> #include <kernel/skill.h>
#include <kernel/spy.h> #include <kernel/spy.h>
#include <kernel/teleport.h>
#include <kernel/unit.h> #include <kernel/unit.h>
#ifdef USE_UGROUPS #ifdef USE_UGROUPS
# include <kernel/ugroup.h> # include <kernel/ugroup.h>
@ -2840,7 +2841,9 @@ renumber_factions(void)
sql_print(("UPDATE subscriptions set faction='%s' where id=%u;\n", sql_print(("UPDATE subscriptions set faction='%s' where id=%u;\n",
itoa36(rp->want), f->subscription)); itoa36(rp->want), f->subscription));
} }
funhash(f);
f->no = rp->want; f->no = rp->want;
fhash(f);
register_faction_id(rp->want); register_faction_id(rp->want);
fset(f, FF_NEWID); fset(f, FF_NEWID);
} }
@ -3161,6 +3164,79 @@ renumber(void)
renumber_factions(); renumber_factions();
} }
static building *
age_building(building * b)
{
static const building_type * bt_blessed = (const building_type*)0xdeadbeef;
static const curse_type * ct_astralblock = NULL;
if (bt_blessed==(const building_type*)0xdeadbeef) {
bt_blessed = bt_find("blessedstonecircle");
ct_astralblock = ct_find("astralblock");
}
/* blesses stone circles create an astral protection in the astral region
* above the shield, which prevents chaos suction and other spells.
* The shield is created when a magician enters the blessed stone circle,
* and lasts for as long as his skill level / 2 is, at no mana cost.
*
* TODO: this would be nicer in a btype->age function, but we don't have it.
*/
if (ct_astralblock && bt_blessed && b->type==bt_blessed) {
region * r = b->region;
region * rt = r_standard_to_astral(r);
unit * u, * mage = NULL;
/* step 1: give unicorns to people in the building,
* find out if there's a magician in there. */
for (u=r->units;u;u=u->next) {
if (b==u->building && inside_building(u)) {
if (!(u->race->ec_flags & NOGIVE)) {
int n, unicorns = 0;
for (n=0; n!=u->number; ++n) {
if (chance(0.02)) {
change_item(u, I_UNICORN, 1);
++unicorns;
}
if (unicorns) {
ADDMSG(&u->faction->msgs, msg_message("scunicorn",
"unit amount type", u, unicorns,
olditemtype[I_UNICORN]->rtype));
}
}
}
if (mage==NULL && is_mage(u)) {
mage = u;
}
}
}
/* if there's a magician, and a connection to astral space, create the
* curse. */
if (rt!=NULL && mage!=NULL) {
curse * c = get_curse(rt->attribs, ct_astralblock);
if (c==NULL) {
if (mage!=NULL) {
int sk = effskill(mage, SK_MAGIC);
/* the mage reactivates the circle */
c = create_curse(mage, &rt->attribs, ct_astralblock,
sk, sk/2, 100, 0);
ADDMSG(&r->msgs, msg_message("astralshield_activate",
"region unit", r, mage));
}
} else if (mage!=NULL) {
int sk = effskill(mage, SK_MAGIC);
c->duration = max(c->duration, sk/2);
c->vigour = max(c->vigour, sk);
}
}
}
a_age(&b->attribs);
handle_event(&b->attribs, "timer", b);
return b;
}
static void static void
ageing(void) ageing(void)
{ {
@ -3209,6 +3285,7 @@ ageing(void)
a_age(&r->attribs); a_age(&r->attribs);
handle_event(&r->attribs, "timer", r); handle_event(&r->attribs, "timer", r);
/* Einheiten */ /* Einheiten */
for (up=&r->units;*up;) { for (up=&r->units;*up;) {
unit * u = *up; unit * u = *up;
@ -3216,6 +3293,7 @@ ageing(void)
if (u==*up) handle_event(&u->attribs, "timer", u); if (u==*up) handle_event(&u->attribs, "timer", u);
if (u==*up) up = &(*up)->next; if (u==*up) up = &(*up)->next;
} }
/* Schiffe */ /* Schiffe */
for (sp=&r->ships;*sp;) { for (sp=&r->ships;*sp;) {
ship * s = *sp; ship * s = *sp;
@ -3223,11 +3301,12 @@ ageing(void)
if (s==*sp) handle_event(&s->attribs, "timer", s); if (s==*sp) handle_event(&s->attribs, "timer", s);
if (s==*sp) sp = &(*sp)->next; if (s==*sp) sp = &(*sp)->next;
} }
/* Gebäude */ /* Gebäude */
for (bp=&r->buildings;*bp;) { for (bp=&r->buildings;*bp;) {
building * b = *bp; building * b = *bp;
a_age(&b->attribs); b = age_building(b);
if (b==*bp) handle_event(&b->attribs, "timer", b);
if (b==*bp) bp = &(*bp)->next; if (b==*bp) bp = &(*bp)->next;
} }
} }

View File

@ -404,7 +404,8 @@ set_new_dragon_target(unit * u, region * r, int range)
} else { } else {
a->data.v = max_region; a->data.v = max_region;
} }
sprintf(buf, "Kommt aus: %s, Will nach: %s", regionid(r), regionid(max_region)); sprintf(buf, "Kommt aus: %s, Will nach: %s",
regionname(r, u->faction), regionname(max_region, u->faction));
usetprivate(u, buf); usetprivate(u, buf);
return a; return a;
} }

View File

@ -95,6 +95,7 @@ dissolve_units(void)
for (u=r->units;u;u=u->next) { for (u=r->units;u;u=u->next) {
attrib * a = a_find(u->attribs, &at_unitdissolve); attrib * a = a_find(u->attribs, &at_unitdissolve);
if (a) { if (a) {
const char * str = NULL;
if (u->age == 0 && a->data.ca[1] < 100) continue; if (u->age == 0 && a->data.ca[1] < 100) continue;
/* TODO: Durch einzelne Berechnung ersetzen */ /* TODO: Durch einzelne Berechnung ersetzen */
@ -112,56 +113,55 @@ dissolve_units(void)
continue; continue;
} }
scale_number(u,u->number - n); scale_number(u, u->number - n);
sprintf(buf, "%s in %s: %d %s ", unitname(u), regionid(r),
n, LOC(default_locale, rc_name(u->race, n!=1)));
switch(a->data.ca[0]) { switch(a->data.ca[0]) {
case 1: case 1:
rsetpeasants(r, rpeasants(r) + n); rsetpeasants(r, rpeasants(r) + n);
if (n == 1) { if (n == 1) {
scat("kehrte auf sein Feld zurück."); str = "kehrte auf sein Feld zurück.";
}else{ } else {
scat("kehrten auf ihre Felder zurück."); str = "kehrten auf ihre Felder zurück.";
} }
break; break;
case 2: case 2:
if(r->land) { if (r->land) {
#if GROWING_TREES #if GROWING_TREES
rsettrees(r, 2, rtrees(r,2) + n); rsettrees(r, 2, rtrees(r,2) + n);
#else #else
rsettrees(r, rtrees(r) + n); rsettrees(r, rtrees(r) + n);
#endif #endif
if (n == 1) { if (n == 1) {
scat("wurde zum Baum."); str = "wurde zum Baum.";
}else{ } else {
scat("wurden zu Bäumen."); str = "wurden zu Bäumen.";
} }
} else { } else {
if(n == 1) { if(n == 1) {
scat("verfaulte in der feuchten Seeluft."); str = "verfaulte in der feuchten Seeluft.";
} else { } else {
scat("verfaulten in der feuchten Seeluft."); str = "verfaulten in der feuchten Seeluft.";
} }
} }
break; break;
default: default:
if (u->race == new_race[RC_STONEGOLEM] || u->race == new_race[RC_IRONGOLEM]) { if (u->race == new_race[RC_STONEGOLEM] || u->race == new_race[RC_IRONGOLEM]) {
if (n == 1) { if (n == 1) {
scat("zerfiel zu Staub."); str = "zerfiel zu Staub.";
}else{ } else {
scat("zerfielen zu Staub."); str = "zerfielen zu Staub.";
} }
}else{ }else{
if (n == 1) { if (n == 1) {
scat("verschwand über Nacht."); str = "verschwand über Nacht.";
}else{ }else{
scat("verschwanden über Nacht."); str = "verschwanden über Nacht.";
} }
} }
break; break;
} }
addmessage(r, u->faction, buf, MSG_EVENT, ML_INFO); ADDMSG(&u->faction->msgs, msg_message("dissolve_units",
"unit region number race action", u, r, n, u->race, str));
} }
} }
} }
@ -606,9 +606,7 @@ chaos(region * r)
} }
u = u2; u = u2;
} }
sprintf(buf, "Ein gewaltige Flutwelle verschlingt %s und " ADDMSG(&r->msgs, msg_message("tidalwave", "region", r));
"alle Bewohner.", regionid(r));
addmessage(r, 0, buf, MSG_EVENT, ML_IMPORTANT);
for (b = rbuildings(r); b;) { for (b = rbuildings(r); b;) {
b2 = b->next; b2 = b->next;
@ -1312,24 +1310,6 @@ randomevents(void)
} /* !RACE_ADJUSTMENTS */ } /* !RACE_ADJUSTMENTS */
#endif #endif
for (u=r->units; u; u=u->next) {
if (!(u->race->ec_flags & NOGIVE)) {
struct building * b = inside_building(u);
const struct building_type * btype = b?b->type:NULL;
if (btype == bt_find("blessedstonecircle")) {
int n, c = 0;
for (n=0; n<u->number; n++) if (rand()%100 < 2) {
change_item(u, I_UNICORN, 1);
c++;
}
if (c) {
ADDMSG(&u->faction->msgs, new_message(u->faction,
"scunicorn%u:unit%i:amount%X:type",u,c,
olditemtype[I_UNICORN]->rtype));
}
}
}
}
} }
/* Orkifizierte Regionen mutieren und mutieren zurück */ /* Orkifizierte Regionen mutieren und mutieren zurück */

View File

@ -290,10 +290,6 @@ rpsnr(FILE * F, const char * s, int offset)
char ui=0; char ui=0;
size_t indent = 0, len; size_t indent = 0, len;
/* Geht nicht: Privatbeschreibungen der Monster enthalten
* \\r-Koordinaten ! */
/* assert(!strstr(s, "\\r(") || !"error: regionid not translated"); */
len = strlen(s); len = strlen(s);
while (*x++ == ' '); while (*x++ == ' ');
indent = x - s - 1; indent = x - s - 1;
@ -396,16 +392,7 @@ rnl(FILE * F)
static void static void
rps(FILE * F, const char * src) rps(FILE * F, const char * src)
{ {
char * s; rpsnr(F, src, 0);
if (strstr(src, "\\r(")) {
s = replace_global_coords(src, current_faction);
} else if(src != buf) {
s = strcpy(buf, src);
} else {
s = (char *)src;
}
rpsnr(F, s, 0);
} }
static void static void
@ -762,20 +749,12 @@ print_curses(FILE *F, const faction *viewer, const void * obj, typ_t typ, int in
} }
} }
char *
replace_global_coords(const char *s, const faction * f)
{
return translate_regions(s, f);
}
static void static void
rps_nowrap(FILE * F, const char *s) rps_nowrap(FILE * F, const char *s)
{ {
const char *x = s; const char *x = s;
int indent = 0; int indent = 0;
x = s = replace_global_coords(s, current_faction);
while (*x++ == ' '); while (*x++ == ' ');
indent = x - s - 1; indent = x - s - 1;
if (*(x - 1) && indent && *x == ' ') if (*(x - 1) && indent && *x == ' ')

View File

@ -440,11 +440,11 @@ sink_ship(region * r, ship * sh, const char *name, char spy, unit * saboteur)
{ {
vset_add(&survivors, u); vset_add(&survivors, u);
if (dead > 0) { if (dead > 0) {
strcat(strcpy(buffer, unit_lives_msg), regionid(safety)); strcat(strcpy(buffer, unit_lives_msg), regionname(safety, u->faction));
sprintf(buf, (dead == 1) ? person_lost_msg : persons_lost_msg, sprintf(buf, (dead == 1) ? person_lost_msg : persons_lost_msg,
dead, unitname(u), buffer); dead, unitname(u), buffer);
} else } else
sprintf(buf, unit_intact_msg, unitname(u), regionid(safety)); sprintf(buf, unit_intact_msg, unitname(u), regionname(safety, u->faction));
addmessage(0, u->faction, buf, MSG_EVENT, ML_WARN); addmessage(0, u->faction, buf, MSG_EVENT, ML_WARN);
set_leftship(u, u->ship); set_leftship(u, u->ship);
u->ship = 0; u->ship = 0;

View File

@ -35,13 +35,12 @@
static int static int
use_speedsail(struct unit * u, const struct item_type * itype, int amount, struct order * ord) use_speedsail(struct unit * u, const struct item_type * itype, int amount, struct order * ord)
{ {
struct plane * p = rplane(u->region); struct plane * p = rplane(u->region);
unused(amount); unused(amount);
unused(itype); unused(itype);
if (p!=NULL) { if (p!=NULL) {
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "use_realworld_only", "")); ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "use_realworld_only", ""));
return EUNUSABLE; } else {
} else {
if (u->ship) { if (u->ship) {
attrib * a = a_find(u->ship->attribs, &at_speedup); attrib * a = a_find(u->ship->attribs, &at_speedup);
if (a==NULL) { if (a==NULL) {
@ -49,6 +48,8 @@ use_speedsail(struct unit * u, const struct item_type * itype, int amount, struc
a->data.sa[0] = 50; /* speed */ a->data.sa[0] = 50; /* speed */
a->data.sa[1] = 50; /* decay */ a->data.sa[1] = 50; /* decay */
ADDMSG(&u->faction->msgs, msg_message("use_speedsail", "unit", u)); ADDMSG(&u->faction->msgs, msg_message("use_speedsail", "unit", u));
/* Ticket abziehen */
i_change(&u->items, itype, -1);
return 0; return 0;
} else { } else {
cmistake(u, ord, 211, MSG_EVENT); cmistake(u, ord, 211, MSG_EVENT);
@ -56,8 +57,8 @@ use_speedsail(struct unit * u, const struct item_type * itype, int amount, struc
} else { } else {
cmistake(u, ord, 144, MSG_EVENT); cmistake(u, ord, 144, MSG_EVENT);
} }
return EUNUSABLE; }
} return EUNUSABLE;
} }
static resource_type rt_speedsail = { static resource_type rt_speedsail = {

View File

@ -261,10 +261,11 @@ static void
battledebug(const char *s) battledebug(const char *s)
{ {
#if SHOW_DEBUG #if SHOW_DEBUG
printf("%s\n", translate_regions(s, NULL)); puts(s);
putc('\n');
#endif #endif
if (bdebug) { if (bdebug) {
dbgprintf((bdebug, "%s\n", translate_regions(s, NULL))); dbgprintf((bdebug, "%s\n", s));
} }
} }

View File

@ -529,7 +529,7 @@ build_road(region * r, unit * u, int size, direction_t d)
if (n <= 0) { if (n <= 0) {
sprintf(buf, "In %s gibt es keine Brücken und Straßen " sprintf(buf, "In %s gibt es keine Brücken und Straßen "
"mehr zu bauen", regionid(r)); "mehr zu bauen", regionname(r, u->faction));
mistake(u, u->thisorder, buf, MSG_PRODUCE); mistake(u, u->thisorder, buf, MSG_PRODUCE);
return; return;
} }

View File

@ -151,11 +151,16 @@ int
buildingcapacity(const building * b) buildingcapacity(const building * b)
{ {
if (b->type->capacity>=0) { if (b->type->capacity>=0) {
if (b->type->maxcapacity>=0) if (b->type->maxcapacity>=0) {
return min(b->type->maxcapacity, b->size * b->type->capacity); return min(b->type->maxcapacity, b->size * b->type->capacity);
}
return b->size * b->type->capacity; return b->size * b->type->capacity;
} }
if (b->size>=b->type->maxsize) return b->type->maxcapacity; if (b->size>=b->type->maxsize) {
if (b->type->maxcapacity>=0) {
return b->type->maxcapacity;
}
}
return 0; return 0;
} }

View File

@ -1500,15 +1500,8 @@ boolean enable_fuzzy = false;
faction * faction *
findfaction (int n) findfaction (int n)
{ {
faction * f; faction * f = ffindhash(n);
return f;
f = ffindhash(n);
if (f) return f;
for (f = factions; f; f = f->next)
if (f->no == n) {
fhash(f);
return f;
}
#ifdef FUZZY_BASE36 #ifdef FUZZY_BASE36
if(enable_fuzzy) { if(enable_fuzzy) {
n = atoi(itoa36(n)); n = atoi(itoa36(n));
@ -1523,10 +1516,8 @@ findfaction (int n)
} }
} }
} }
return NULL;
#endif /* FUZZY_BASE36 */ #endif /* FUZZY_BASE36 */
/* Gibt komische Seiteneffekte hier! */
/* if (n==MONSTER_FACTION) return makemonsters(); */
return NULL;
} }
faction * faction *
@ -1718,20 +1709,6 @@ cstring(const char *s)
return r; return r;
} }
const char *
regionid(const region * r)
{
char *buf = idbuf[(++nextbuf) % 8];
if (!r) {
strcpy(buf, "(Chaos)");
} else {
sprintf(buf, "\\r(%d,%d)", r->x, r->y);
}
return buf;
}
const char * const char *
buildingname (const building * b) buildingname (const building * b)
{ {
@ -1772,14 +1749,6 @@ unitname(const unit * u)
return ubuf; return ubuf;
} }
char *
xunitid(const unit *u)
{
char *buf = idbuf[(++nextbuf) % 8];
sprintf(buf, "%s in %s", unitname(u), regionid(u->region));
return buf;
}
/* -- Erschaffung neuer Einheiten ------------------------------ */ /* -- Erschaffung neuer Einheiten ------------------------------ */
extern faction * dfindhash(int i); extern faction * dfindhash(int i);

View File

@ -351,7 +351,7 @@ extern void plagues(struct region * r, boolean ismagic);
#define IDSIZE 15 /* max. Länge einer no (als String), ohne trailing 0 */ #define IDSIZE 15 /* max. Länge einer no (als String), ohne trailing 0 */
#define KEYWORDSIZE 15 /* max. Länge eines Keyword, ohne trailing 0 */ #define KEYWORDSIZE 15 /* max. Länge eines Keyword, ohne trailing 0 */
#define OBJECTIDSIZE (NAMESIZE+5+IDSIZE) /* max. Länge der Strings, die #define OBJECTIDSIZE (NAMESIZE+5+IDSIZE) /* max. Länge der Strings, die
* von struct unitname, regionid, etc. zurückgegeben werden. ohne die 0 */ * von struct unitname, etc. zurückgegeben werden. ohne die 0 */
#define CMDSIZE (DISPLAYSIZE*2+1) #define CMDSIZE (DISPLAYSIZE*2+1)
#define STARTMONEY 5000 #define STARTMONEY 5000
@ -1007,9 +1007,7 @@ struct region *findunitregion(const struct unit * su);
char *estring(const char *s); char *estring(const char *s);
char *cstring(const char *s); char *cstring(const char *s);
const char *regionid(const struct region * r);
const char *unitname(const struct unit * u); const char *unitname(const struct unit * u);
char *xunitid(const struct unit * u);
struct building *largestbuilding(const struct region * r, boolean img); struct building *largestbuilding(const struct region * r, boolean img);

View File

@ -123,12 +123,12 @@ addfaction(const char *email, const char * password,
f->no = unused_faction_id(); f->no = unused_faction_id();
register_faction_id(f->no); register_faction_id(f->no);
addlist(&factions, f);
fhash(f);
sprintf(buf, "%s %s", LOC(loc, "factiondefault"), factionid(f)); sprintf(buf, "%s %s", LOC(loc, "factiondefault"), factionid(f));
set_string(&f->name, buf); set_string(&f->name, buf);
addlist(&factions, f);
return f; return f;
} }

View File

@ -52,9 +52,11 @@ resource_type * resourcetypes;
weapon_type * weapontypes; weapon_type * weapontypes;
luxury_type * luxurytypes; luxury_type * luxurytypes;
potion_type * potiontypes; potion_type * potiontypes;
item_type * itemtypes;
herb_type * herbtypes; herb_type * herbtypes;
#define IMAXHASH 127
static item_type * itemtypes[IMAXHASH];
#ifdef AT_PTYPE #ifdef AT_PTYPE
static attrib_type at_ptype = { "potion_type" }; static attrib_type at_ptype = { "potion_type" };
#endif #endif
@ -178,7 +180,9 @@ new_resourcetype(const char ** names, const char ** appearances, int flags)
void void
it_register(item_type * itype) it_register(item_type * itype)
{ {
item_type ** p_itype = &itemtypes; int hash = hashstring(itype->rtype->_name[0]);
int key = hash % IMAXHASH;
item_type ** p_itype = &itemtypes[key];
while (*p_itype && *p_itype != itype) p_itype = &(*p_itype)->next; while (*p_itype && *p_itype != itype) p_itype = &(*p_itype)->next;
if (*p_itype==NULL) { if (*p_itype==NULL) {
#ifdef AT_ITYPE #ifdef AT_ITYPE
@ -452,12 +456,18 @@ it_find(const char * zname)
const char * name = it_alias(zname); const char * name = it_alias(zname);
unsigned int hash = hashstring(name); unsigned int hash = hashstring(name);
item_type * itype; item_type * itype;
unsigned int key = hash % IMAXHASH;
for (itype=itemtypes; itype; itype=itype->next) for (itype=itemtypes[key]; itype; itype=itype->next) {
if (itype->rtype->hashkey==hash && strcmp(itype->rtype->_name[0], name) == 0) break; if (itype->rtype->hashkey==hash && strcmp(itype->rtype->_name[0], name) == 0) {
if (!itype) for (itype=itemtypes; itype; itype=itype->next) break;
if (strcmp(itype->rtype->_name[1], name) == 0) break; }
}
if (itype==NULL) {
for (itype=itemtypes[key]; itype; itype=itype->next) {
if (strcmp(itype->rtype->_name[1], name) == 0) break;
}
}
return itype; return itype;
} }
@ -2285,7 +2295,6 @@ init_itemnames(void)
int i; int i;
for (i=0;localenames[i];++i) { for (i=0;localenames[i];++i) {
const struct locale * lang = find_locale(localenames[i]); const struct locale * lang = find_locale(localenames[i]);
const item_type * itl = itemtypes;
boolean exist = false; boolean exist = false;
local_names * in = inames; local_names * in = inames;
@ -2299,14 +2308,20 @@ init_itemnames(void)
if (in==NULL) in = calloc(sizeof(local_names), 1); if (in==NULL) in = calloc(sizeof(local_names), 1);
in->next = inames; in->next = inames;
in->lang = lang; in->lang = lang;
while (itl) {
void * result = NULL; if (!exist) {
const char * iname = locale_string(lang, itl->rtype->_name[0]); int key;
if (!exist || findtoken(&in->names, iname, &result)==E_TOK_NOMATCH || result!=itl) { for (key=0;key!=IMAXHASH;++key) {
addtoken(&in->names, iname, (void*)itl); const item_type * itl;
addtoken(&in->names, locale_string(lang, itl->rtype->_name[1]), (void*)itl); for (itl=itemtypes[key];itl;itl=itl->next) {
void * result = NULL;
const char * iname = locale_string(lang, itl->rtype->_name[0]);
if (findtoken(&in->names, iname, &result)==E_TOK_NOMATCH || result!=itl) {
addtoken(&in->names, iname, (void*)itl);
addtoken(&in->names, locale_string(lang, itl->rtype->_name[1]), (void*)itl);
}
}
} }
itl=itl->next;
} }
inames = in; inames = in;
} }

View File

@ -135,7 +135,6 @@ typedef struct item_type {
struct item_type * next; struct item_type * next;
} item_type; } item_type;
extern item_type * itemtypes;
extern const item_type * finditemtype(const char * name, const struct locale * lang); extern const item_type * finditemtype(const char * name, const struct locale * lang);
extern void init_itemnames(void); extern void init_itemnames(void);

View File

@ -572,7 +572,7 @@ jihad_attacks(void)
if(doit == false) continue; if(doit == false) continue;
printf("\tPogrom durch %s in %s\n", factionid(f), regionid(r)); log_printf("-->> Pogrom durch %s in %s\n", factionid(f), regionname(r, NULL));
for(u2 = r->units; u; u=u->next) if(u2->faction == f) { for(u2 = r->units; u; u=u->next) if(u2->faction == f) {
for(u=r->units; u; u=u->next) if(jihad(f, u->race)) { for(u=r->units; u; u=u->next) if(jihad(f, u->race)) {

View File

@ -952,7 +952,7 @@ cancast(unit * u, spell * sp, int level, int range, struct order * ord)
/* Noch fehlte keine Komponente, wir generieren den Anfang der /* Noch fehlte keine Komponente, wir generieren den Anfang der
* Fehlermeldung */ * Fehlermeldung */
sprintf(buf, "%s in %s: 'ZAUBER %s' Für diesen Zauber fehlen " sprintf(buf, "%s in %s: 'ZAUBER %s' Für diesen Zauber fehlen "
"noch %d ", unitname(u), regionid(u->region), "noch %d ", unitname(u), regionname(u->region, u->faction),
spell_name(sp, u->faction->locale), spell_name(sp, u->faction->locale),
itemanz); itemanz);
scat(locale_string(u->faction->locale, scat(locale_string(u->faction->locale,
@ -2559,7 +2559,7 @@ magic(void)
if (range > 1024) { /* (2^10) weiter als 10 Regionen entfernt */ if (range > 1024) { /* (2^10) weiter als 10 Regionen entfernt */
ADDMSG(&u->faction->msgs, msg_message("spellfail::nocontact", ADDMSG(&u->faction->msgs, msg_message("spellfail::nocontact",
"mage region command target", u, u->region, ord, "mage region command target", u, u->region, ord,
gc_add(strdup(regionid(target_r))))); gc_add(strdup(regionname(target_r, u->faction)))));
continue; continue;
} }
} }

View File

@ -57,65 +57,6 @@ typedef struct msg_setting {
#define MAXSTRLEN (4*DISPLAYSIZE+3) #define MAXSTRLEN (4*DISPLAYSIZE+3)
#include "region.h" #include "region.h"
#include "eressea.h" #include "eressea.h"
const char *
translate_regions(const char *st, const faction * f)
{
static char temp[MAXSTRLEN + 1];
char *s, *t = temp;
const char *p = st;
char *c = strstr(p, "\\r(");
if (!c) return strcpy(temp, st);
temp[0] = 0;
do {
static region *r;
static int cache_x = -999999, cache_y = -999999;
int koor_x, koor_y;
int x = MAXSTRLEN - (t - temp);
plane *cache_pl = NULL;
if (c - p < x)
x = c - p;
s = temp;
strnzcpy(t, p, x);
t += (c - p);
p = c + 3;
koor_x = atoi(p);
p = strchr(p, ',') + 1;
koor_y = atoi(p);
if (koor_x != cache_x || koor_y != cache_y) {
r = findregion(koor_x, koor_y);
cache_x = koor_x;
cache_y = koor_y;
cache_pl = getplane(r);
}
if (r!=NULL) {
const char *rn;
if (f!=NULL) {
rn = rname(r, f->locale);
} else {
rn = rname(r, default_locale);
}
if(rn && *rn) {
sprintf(t, "%s (%d,%d)", rn, region_x(r, f), region_y(r, f));
} else {
sprintf(t, "(%d,%d)", region_x(r, f), region_y(r, f));
}
} else strcpy(t, "(Chaos)");
t += strlen(t);
p = strchr(p, ')') + 1;
c = strstr(p, "\\r(");
} while (c!= NULL);
if (s == temp)
strcat(t, p);
return s;
}
messageclass * msgclasses; messageclass * msgclasses;
@ -382,14 +323,14 @@ caddmessage(region * r, faction * f, const char *s, msg_t mtype, int level)
void void
addmessage(region * r, faction * f, const char *s, msg_t mtype, int level) addmessage(region * r, faction * f, const char *s, msg_t mtype, int level)
{ {
caddmessage(r, f, gc_add(strdup(translate_regions(s, f))), mtype, level); caddmessage(r, f, gc_add(strdup(s)), mtype, level);
} }
void void
mistake(const unit * u, struct order * ord, const char *comment, int mtype) mistake(const unit * u, struct order * ord, const char *comment, int mtype)
{ {
if (u->faction->no != MONSTER_FACTION) { if (u->faction->no != MONSTER_FACTION) {
char * cmt = strdup(translate_regions(comment, u->faction)); char * cmt = strdup(comment);
ADDMSG(&u->faction->msgs, msg_message("mistake", ADDMSG(&u->faction->msgs, msg_message("mistake",
"command error unit region", copy_order(ord), cmt, u, u->region)); "command error unit region", copy_order(ord), cmt, u, u->region));
} }

View File

@ -1655,9 +1655,9 @@ sail(unit * u, order * ord, boolean move_on_land, region_list **routep)
else else
scat("segelt"); scat("segelt");
scat(" von "); scat(" von ");
scat(regionid(starting_point)); scat(regionname(starting_point, u->faction));
scat(" nach "); scat(" nach ");
scat(regionid(current_point)); scat(regionname(current_point, u->faction));
scat("."); scat(".");
addmessage(0, u->faction, buf, MSG_MOVE, ML_INFO); addmessage(0, u->faction, buf, MSG_MOVE, ML_INFO);

View File

@ -138,35 +138,30 @@ typdata_t typdata[] = {
/* TYP_UNIT */ { /* TYP_UNIT */ {
(ID_fun)unit_ID, (ID_fun)unit_ID,
(find_fun)unit_find, (find_fun)unit_find,
(desc_fun)unitname,
(attrib_fun)unit_attribs, (attrib_fun)unit_attribs,
(set_fun)unit_set, (set_fun)unit_set,
}, },
/* TYP_REGION */ { /* TYP_REGION */ {
(ID_fun)region_ID, (ID_fun)region_ID,
(find_fun)region_find, (find_fun)region_find,
(desc_fun)regionid,
(attrib_fun)region_attribs, (attrib_fun)region_attribs,
(set_fun)region_set, (set_fun)region_set,
}, },
/* TYP_BUILDING */ { /* TYP_BUILDING */ {
(ID_fun)building_ID, (ID_fun)building_ID,
(find_fun)building_find, (find_fun)building_find,
(desc_fun)buildingname,
(attrib_fun)building_attribs, (attrib_fun)building_attribs,
(set_fun)building_set, (set_fun)building_set,
}, },
/* TYP_SHIP */ { /* TYP_SHIP */ {
(ID_fun)ship_ID, (ID_fun)ship_ID,
(find_fun)ship_find, (find_fun)ship_find,
(desc_fun)shipname,
(attrib_fun)ship_attribs, (attrib_fun)ship_attribs,
(set_fun)ship_set, (set_fun)ship_set,
}, },
/* TYP_FACTION */ { /* TYP_FACTION */ {
(ID_fun)faction_ID, (ID_fun)faction_ID,
(find_fun)faction_find, (find_fun)faction_find,
(desc_fun)notimplemented_desc,
(attrib_fun)faction_attribs, (attrib_fun)faction_attribs,
(set_fun)faction_set, (set_fun)faction_set,
}, },

View File

@ -44,7 +44,6 @@ extern void resolve_IDs(void);
typedef obj_ID (*ID_fun)(void *obj); typedef obj_ID (*ID_fun)(void *obj);
typedef void *(*find_fun)(obj_ID id); typedef void *(*find_fun)(obj_ID id);
typedef char *(*desc_fun)(void *obj);
typedef attrib **(*attrib_fun)(void *obj); typedef attrib **(*attrib_fun)(void *obj);
typedef void (*set_fun)(void *ptrptr, void *obj); /* *ptrptr = obj */ typedef void (*set_fun)(void *ptrptr, void *obj); /* *ptrptr = obj */
@ -52,7 +51,6 @@ typedef void (*set_fun)(void *ptrptr, void *obj); /* *ptrptr = obj */
typedef struct { typedef struct {
ID_fun getID; /* liefert obj_ID zu struct unit* */ ID_fun getID; /* liefert obj_ID zu struct unit* */
find_fun find; /* liefert struct unit* zu obj_ID */ find_fun find; /* liefert struct unit* zu obj_ID */
desc_fun getname; /* unitname() */
attrib_fun getattribs; /* liefert &u->attribs */ attrib_fun getattribs; /* liefert &u->attribs */
set_fun ppset; /* setzt *(struct unit **) zu struct unit* */ set_fun ppset; /* setzt *(struct unit **) zu struct unit* */
} typdata_t; } typdata_t;

View File

@ -870,12 +870,14 @@ get_addresses(faction * f)
region *r, *last = f->last?f->last:lastregion(f); region *r, *last = f->last?f->last:lastregion(f);
const faction * lastf = NULL; const faction * lastf = NULL;
faction_list * flist = calloc(1, sizeof(faction_list)); faction_list * flist = calloc(1, sizeof(faction_list));
flist->data = findfaction(f->no); flist->data = f;
for (r=f->first?f->first:firstregion(f);r!=last;r=r->next) { for (r=f->first?f->first:firstregion(f);r!=last;r=r->next) {
const unit * u = r->units; const unit * u = r->units;
const seen_region * sr = find_seen(r); const seen_region * sr = find_seen(r);
if (sr==NULL) continue; if (sr==NULL) continue;
while (u!=NULL) { while (u!=NULL) {
faction * sf = visible_faction(f, u); faction * sf = visible_faction(f, u);
boolean ballied = sf && sf!=f && sf!=lastf boolean ballied = sf && sf!=f && sf!=lastf
&& !fval(u, UFL_PARTEITARNUNG) && cansee(f, r, u, 0); && !fval(u, UFL_PARTEITARNUNG) && cansee(f, r, u, 0);

View File

@ -56,9 +56,6 @@ extern struct summary * make_summary(boolean count_new);
int hat_in_region(item_t itm, struct region * r, struct faction * f); int hat_in_region(item_t itm, struct region * r, struct faction * f);
char *translate_regions(const char *st, const struct faction * f);
char *replace_global_coords(const char *s, const struct faction * f);
char *f_regionid(const struct region *r, const struct faction *f); char *f_regionid(const struct region *r, const struct faction *f);

View File

@ -1029,9 +1029,8 @@ readunit(FILE * F)
u_setfaction(u, NULL); u_setfaction(u, NULL);
} }
{ {
faction * f; int n = rid(F);
int n = rid(F); faction * f = findfaction(n);
f = findfaction(n);
if (f!=u->faction) u_setfaction(u, f); if (f!=u->faction) u_setfaction(u, f);
} }
rds(F, &u->name); rds(F, &u->name);
@ -1812,6 +1811,7 @@ readgame(const char * filename, int backup)
while (--n >= 0) { while (--n >= 0) {
faction * f = readfaction(F); faction * f = readfaction(F);
addlist2(fp, f); addlist2(fp, f);
fhash(f);
} }
*fp = 0; *fp = 0;

View File

@ -38,7 +38,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
/* Umlaute hier drin, weil die in den Report kommen */
static const char *skillnames[MAXSKILLS] = static const char *skillnames[MAXSKILLS] =
{ {
"sk_alchemy", "sk_alchemy",

View File

@ -472,7 +472,7 @@ report_effect(region * r, unit * mage, message * seen, message * unseen)
* Zauberwirkungen) * Zauberwirkungen)
sprintf(buf, "%s in %s: 'ZAUBER %s': [hier die Fehlermeldung].", sprintf(buf, "%s in %s: 'ZAUBER %s': [hier die Fehlermeldung].",
unitname(mage), regionid(mage->region), sa->strings[0]); unitname(mage), regionname(mage->region, mage->faction), sa->strings[0]);
add_message(0, mage->faction, buf, MSG_MAGIC, ML_MISTAKE); add_message(0, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
* Allgemein sichtbare Auswirkungen in der Region sollten als * Allgemein sichtbare Auswirkungen in der Region sollten als
@ -706,7 +706,7 @@ sp_destroy_magic(castorder *co)
{ {
region *tr = pa->param[0]->data.r; region *tr = pa->param[0]->data.r;
ap = &tr->attribs; ap = &tr->attribs;
strcpy(ts, regionid(tr)); strcpy(ts, regionname(tr, mage->faction));
break; break;
} }
case SPP_TEMP: case SPP_TEMP:
@ -1027,7 +1027,7 @@ sp_blessstonecircle(castorder *co)
} }
if(b->size < b->type->maxsize) { if(b->size < b->type->maxsize) {
sprintf(buf, "%s muss vor der Weihe fertiggestellt sein.", buildingname(b)); sprintf(buf, "%s muss vor der Weihe fertiggestellt sein.", buildingname(b));
mistake(mage, co->order, buf, MSG_MAGIC); mistake(mage, co->order, buf, MSG_MAGIC);
return 0; return 0;
} }
@ -1746,7 +1746,7 @@ sp_great_drought(castorder *co)
fset(u->faction, FL_DH); fset(u->faction, FL_DH);
sprintf(buf, "%s ruft das Feuer der Sonne auf %s hinab.", sprintf(buf, "%s ruft das Feuer der Sonne auf %s hinab.",
cansee(u->faction, r, mage, 0)? unitname(mage) : "Jemand", cansee(u->faction, r, mage, 0)? unitname(mage) : "Jemand",
regionid(r)); regionname(r, u->faction));
if (rterrain(r) != T_OCEAN){ if (rterrain(r) != T_OCEAN){
if(rterrain(r) == T_SWAMP && terraform){ if(rterrain(r) == T_SWAMP && terraform){
scat(" Eis schmilzt und verwandelt sich in Morast. Reißende " scat(" Eis schmilzt und verwandelt sich in Morast. Reißende "
@ -2444,7 +2444,7 @@ sp_earthquake(castorder *co)
fset(u->faction, FL_DH); fset(u->faction, FL_DH);
sprintf(buf, "%s läßt die Erde in %s erzittern.", sprintf(buf, "%s läßt die Erde in %s erzittern.",
cansee(u->faction, r, mage, 0) ? unitname(mage) : "Jemand", cansee(u->faction, r, mage, 0) ? unitname(mage) : "Jemand",
regionid(r)); regionname(r, u->faction));
addmessage(r, u->faction, buf, MSG_EVENT, ML_INFO); addmessage(r, u->faction, buf, MSG_EVENT, ML_INFO);
} }
@ -2603,23 +2603,16 @@ sp_forest_fire(castorder *co)
} }
if (destroyed > 0 || vernichtet_schoesslinge > 0) { if (destroyed > 0 || vernichtet_schoesslinge > 0) {
rsettrees(nr, 2, rtrees(nr,2) - destroyed); message * m = msg_message("forestfire_spread", "region next trees",
rsettrees(nr, 1, rtrees(nr,1) - vernichtet_schoesslinge); r, nr, destroyed+vernichtet_schoesslinge);
sprintf(buf, "Der Waldbrand in %s griff auch auf %s "
"über und %d %s.", add_message(&r->msgs, m);
regionid(r), regionid(nr), destroyed+vernichtet_schoesslinge, add_message(&mage->faction->msgs, m);
destroyed+vernichtet_schoesslinge == 1 ? "Baum verbrannte" : "Bäume verbrannten"); msg_release(m);
for (u = nr->units; u; u = u->next) freset(u->faction, FL_DH);
for(u = nr->units; u; u = u->next ) { rsettrees(nr, 2, rtrees(nr,2) - destroyed);
if(!fval(u->faction, FL_DH) ) { rsettrees(nr, 1, rtrees(nr,1) - vernichtet_schoesslinge);
fset(u->faction, FL_DH); }
addmessage(r, u->faction, buf, MSG_EVENT, ML_INFO);
}
}
if(!fval(mage->faction, FL_DH)){
addmessage(0, mage->faction, buf, MSG_MAGIC, ML_INFO);
}
}
#else #else
if (rtrees(nr) >= 800) { if (rtrees(nr) >= 800) {
if (chance(probability)) destroyed = (int)(rtrees(nr) * percentage/2); if (chance(probability)) destroyed = (int)(rtrees(nr) * percentage/2);
@ -2628,21 +2621,12 @@ sp_forest_fire(castorder *co)
} }
if (destroyed > 0 ) { if (destroyed > 0 ) {
message * m = msg_message("forestfire_spread", "region next trees",
r, nr, destroyed);
add_message(&r->msgs, m);
add_message(&mage->faction->msgs, m);
msg_release(m);
rsettrees(nr, rtrees(nr) - destroyed); rsettrees(nr, rtrees(nr) - destroyed);
sprintf(buf, "Der Waldbrand in %s griff auch auf %s "
"über und %d %s.",
regionid(r), regionid(nr), destroyed,
destroyed == 1 ? "Baum verbrannte" : "Bäume verbrannten");
for (u = nr->units; u; u = u->next) freset(u->faction, FL_DH);
for(u = nr->units; u; u = u->next ) {
if(!fval(u->faction, FL_DH) ) {
fset(u->faction, FL_DH);
addmessage(r, u->faction, buf, MSG_EVENT, ML_INFO);
}
}
if(!fval(mage->faction, FL_DH)){
addmessage(0, mage->faction, buf, MSG_MAGIC, ML_INFO);
}
} }
#endif #endif
} }
@ -2801,7 +2785,7 @@ sp_summondragon(castorder *co)
} else { } else {
a->data.v = co->rt; a->data.v = co->rt;
} }
sprintf(buf, "Kommt aus: %s, Will nach: %s", regionid(rl2->data), regionid(co->rt)); sprintf(buf, "Kommt aus: %s, Will nach: %s", regionname(rl2->data, u->faction), regionname(co->rt, u->faction));
usetprivate(u, buf); usetprivate(u, buf);
} }
} }
@ -3487,9 +3471,8 @@ sp_plague(castorder *co)
plagues(r, true); plagues(r, true);
sprintf(buf, "%s ruft eine Pest in %s hervor.", unitname(mage), ADDMSG(&mage->faction->msgs, msg_message("plague_spell",
regionid(r)); "region mage", r, mage));
addmessage(0, mage->faction, buf, MSG_MAGIC, ML_INFO);
return cast_level; return cast_level;
} }
@ -3788,7 +3771,7 @@ sp_summonundead(castorder *co)
if (!r->land || deathcount(r) == 0) { if (!r->land || deathcount(r) == 0) {
sprintf(buf, "%s in %s: In %s sind keine Gräber.", unitname(mage), sprintf(buf, "%s in %s: In %s sind keine Gräber.", unitname(mage),
regionid(mage->region), regionid(r)); regionname(mage->region, mage->faction), regionname(r, mage->faction));
addmessage(0, mage->faction, buf, MSG_MAGIC, ML_MISTAKE); addmessage(0, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
return 0; return 0;
} }
@ -3872,11 +3855,11 @@ sp_auraleak(castorder *co)
if (cansee(u->faction, r, mage, 0)) { if (cansee(u->faction, r, mage, 0)) {
sprintf(buf, "%s rief in %s einen Riss in dem Gefüge der Magie " sprintf(buf, "%s rief in %s einen Riss in dem Gefüge der Magie "
"hervor, der alle magische Kraft aus der Region riss.", "hervor, der alle magische Kraft aus der Region riss.",
unitname(mage), regionid(r)); unitname(mage), regionname(r, u->faction));
} else { } else {
sprintf(buf, "In %s entstand ein Riss in dem Gefüge der Magie, " sprintf(buf, "In %s entstand ein Riss in dem Gefüge der Magie, "
"der alle magische Kraft aus der Region riss.", "der alle magische Kraft aus der Region riss.",
regionid(r)); regionname(r, u->faction));
} }
addmessage(r, u->faction, buf, MSG_EVENT, ML_WARN); addmessage(r, u->faction, buf, MSG_EVENT, ML_WARN);
} }
@ -4235,18 +4218,18 @@ sp_rallypeasantmob(castorder *co)
fset(u->faction, FL_DH); fset(u->faction, FL_DH);
sprintf(buf, "%s besänftigt den Bauernaufstand in %s.", sprintf(buf, "%s besänftigt den Bauernaufstand in %s.",
cansee(u->faction, r, mage, 0) ? unitname(mage) : "Jemand", cansee(u->faction, r, mage, 0) ? unitname(mage) : "Jemand",
regionid(r)); regionname(r, u->faction));
addmessage(r, u->faction, buf, MSG_MAGIC, ML_INFO); addmessage(r, u->faction, buf, MSG_MAGIC, ML_INFO);
} }
} }
if (!fval(mage->faction, FL_DH)){ if (!fval(mage->faction, FL_DH)){
sprintf(buf, "%s besänftigt den Bauernaufstand in %s.", sprintf(buf, "%s besänftigt den Bauernaufstand in %s.",
unitname(mage), regionid(r)); unitname(mage), regionname(r, u->faction));
addmessage(r, u->faction, buf, MSG_MAGIC, ML_INFO); addmessage(r, u->faction, buf, MSG_MAGIC, ML_INFO);
} }
} else { } else {
sprintf(buf, "Der Bauernaufstand in %s hatte sich bereits verlaufen.", sprintf(buf, "Der Bauernaufstand in %s hatte sich bereits verlaufen.",
regionid(r)); regionname(r, u->faction));
addmessage(r, u->faction, buf, MSG_MAGIC, ML_INFO); addmessage(r, u->faction, buf, MSG_MAGIC, ML_INFO);
} }
return erfolg; return erfolg;
@ -4383,7 +4366,7 @@ sp_migranten(castorder *co)
|| target->number > max_spellpoints(r, mage)) || target->number > max_spellpoints(r, mage))
{ {
sprintf(buf, "%s in %s: 'ZAUBER %s': So viele Personen übersteigen " sprintf(buf, "%s in %s: 'ZAUBER %s': So viele Personen übersteigen "
"meine Kräfte.", unitname(mage), regionid(mage->region), "meine Kräfte.", unitname(mage), regionname(mage->region, mage->faction),
spell_name(sp, mage->faction->locale)); spell_name(sp, mage->faction->locale));
addmessage(0, mage->faction, buf, MSG_MAGIC, ML_WARN); addmessage(0, mage->faction, buf, MSG_MAGIC, ML_WARN);
} }
@ -4501,7 +4484,7 @@ sp_generous(castorder *co)
if(is_cursed(r->attribs, C_DEPRESSION, 0)){ if(is_cursed(r->attribs, C_DEPRESSION, 0)){
sprintf(buf, "%s in %s: Die Stimmung in %s ist so schlecht, das " sprintf(buf, "%s in %s: Die Stimmung in %s ist so schlecht, das "
"niemand auf den Zauber reagiert.", unitname(mage), "niemand auf den Zauber reagiert.", unitname(mage),
regionid(mage->region), regionid(r)); regionname(mage->region, mage->faction), regionname(r, mage->faction));
addmessage(0, mage->faction, buf, MSG_MAGIC, ML_MISTAKE); addmessage(0, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
return 0; return 0;
} }
@ -4677,13 +4660,13 @@ sp_pump(castorder *co)
if (see == false){ if (see == false){
sprintf(buf, "%s horcht %s über %s aus, aber %s wusste nichts zu " sprintf(buf, "%s horcht %s über %s aus, aber %s wusste nichts zu "
"berichten.", unitname(mage), unitname(target), regionid(rt), "berichten.", unitname(mage), unitname(target), regionname(rt, mage->faction),
unitname(target)); unitname(target));
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_INFO); addmessage(r, mage->faction, buf, MSG_MAGIC, ML_INFO);
return cast_level/2; return cast_level/2;
} else { } else {
sprintf(buf, "%s horcht %s über %s aus.", unitname(mage), sprintf(buf, "%s horcht %s über %s aus.", unitname(mage),
unitname(target), regionid(rt)); unitname(target), regionname(rt, mage->faction));
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_INFO); addmessage(r, mage->faction, buf, MSG_MAGIC, ML_INFO);
} }
@ -5045,7 +5028,7 @@ sp_dragonsong(castorder *co)
} else { } else {
a->data.v = r; a->data.v = r;
} }
sprintf(buf, "Kommt aus: %s, Will nach: %s", regionid(rl2->data), regionid(r)); sprintf(buf, "Kommt aus: %s, Will nach: %s", regionname(rl2->data, u->faction), regionname(r, u->faction));
usetprivate(u, buf); usetprivate(u, buf);
} }
} }
@ -5509,7 +5492,7 @@ sp_dreamreading(castorder *co)
set_level(u2, SK_OBSERVATION, eff_skill(u, SK_OBSERVATION, u2->region)); set_level(u2, SK_OBSERVATION, eff_skill(u, SK_OBSERVATION, u2->region));
sprintf(buf, "%s verliert sich in die Träume von %s und erhält einen " sprintf(buf, "%s verliert sich in die Träume von %s und erhält einen "
"Eindruck von %s.", unitname(mage), unitname(u), regionid(u->region)); "Eindruck von %s.", unitname(mage), unitname(u), regionname(u->region, mage->faction));
addmessage(r, mage->faction, buf, MSG_EVENT, ML_INFO); addmessage(r, mage->faction, buf, MSG_EVENT, ML_INFO);
return cast_level; return cast_level;
} }
@ -5582,7 +5565,7 @@ sp_disturbingdreams(castorder *co)
curse_setflag(c, CURSE_ISNEW); curse_setflag(c, CURSE_ISNEW);
sprintf(buf, "%s sorgt für schlechten Schlaf in %s.", sprintf(buf, "%s sorgt für schlechten Schlaf in %s.",
unitname(mage), regionid(r)); unitname(mage), regionname(r, mage->faction));
addmessage(0, mage->faction, buf, MSG_EVENT, ML_INFO); addmessage(0, mage->faction, buf, MSG_EVENT, ML_INFO);
return cast_level; return cast_level;
} }
@ -5825,7 +5808,7 @@ sp_enterastral(castorder *co)
default: default:
sprintf(buf, "%s in %s: 'ZAUBER %s': Dieser Zauber funktioniert " sprintf(buf, "%s in %s: 'ZAUBER %s': Dieser Zauber funktioniert "
"nur in der materiellen Welt.", unitname(mage), "nur in der materiellen Welt.", unitname(mage),
regionid(mage->region), spell_name(sp, mage->faction->locale)); regionname(mage->region, mage->faction), spell_name(sp, mage->faction->locale));
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE); addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
return 0; return 0;
} }
@ -5833,7 +5816,7 @@ sp_enterastral(castorder *co)
if(!rt) { if(!rt) {
sprintf(buf, "%s in %s: 'ZAUBER %s': Es kann hier kein Kontakt zur " sprintf(buf, "%s in %s: 'ZAUBER %s': Es kann hier kein Kontakt zur "
"Astralwelt hergestellt werden.", unitname(mage), "Astralwelt hergestellt werden.", unitname(mage),
regionid(mage->region), spell_name(sp, mage->faction->locale)); regionname(mage->region, mage->faction), spell_name(sp, mage->faction->locale));
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE); addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
return 0; return 0;
} }
@ -5842,7 +5825,7 @@ sp_enterastral(castorder *co)
is_cursed(ro->attribs, C_ASTRALBLOCK, 0)) { is_cursed(ro->attribs, C_ASTRALBLOCK, 0)) {
sprintf(buf, "%s in %s: 'ZAUBER %s': Es kann kein Kontakt zu " sprintf(buf, "%s in %s: 'ZAUBER %s': Es kann kein Kontakt zu "
"dieser astralen Region hergestellt werden.", unitname(mage), "dieser astralen Region hergestellt werden.", unitname(mage),
regionid(mage->region), spell_name(sp, mage->faction->locale)); regionname(mage->region, mage->faction), spell_name(sp, mage->faction->locale));
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE); addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
return 0; return 0;
} }
@ -5949,7 +5932,7 @@ sp_pullastral(castorder *co)
if(!rl2) { if(!rl2) {
sprintf(buf, "%s in %s: 'ZAUBER %s': Es kann kein Kontakt zu " sprintf(buf, "%s in %s: 'ZAUBER %s': Es kann kein Kontakt zu "
"dieser Region hergestellt werden.", unitname(mage), "dieser Region hergestellt werden.", unitname(mage),
regionid(mage->region), spell_name(sp, mage->faction->locale)); regionname(mage->region, mage->faction), spell_name(sp, mage->faction->locale));
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE); addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
free_regionlist(rl); free_regionlist(rl);
return 0; return 0;
@ -5959,7 +5942,7 @@ sp_pullastral(castorder *co)
default: default:
sprintf(buf, "%s in %s: 'ZAUBER %s': Dieser Zauber funktioniert " sprintf(buf, "%s in %s: 'ZAUBER %s': Dieser Zauber funktioniert "
"nur in der astralen Welt.", unitname(mage), "nur in der astralen Welt.", unitname(mage),
regionid(mage->region), spell_name(sp, mage->faction->locale)); regionname(mage->region, mage->faction), spell_name(sp, mage->faction->locale));
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE); addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
return 0; return 0;
} }
@ -5968,7 +5951,7 @@ sp_pullastral(castorder *co)
is_cursed(ro->attribs, C_ASTRALBLOCK, 0)) { is_cursed(ro->attribs, C_ASTRALBLOCK, 0)) {
sprintf(buf, "%s in %s: 'ZAUBER %s': Es kann kein Kontakt zu " sprintf(buf, "%s in %s: 'ZAUBER %s': Es kann kein Kontakt zu "
"dieser Region hergestellt werden.", unitname(mage), "dieser Region hergestellt werden.", unitname(mage),
regionid(mage->region), spell_name(sp, mage->faction->locale)); regionname(mage->region, mage->faction), spell_name(sp, mage->faction->locale));
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE); addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
return 0; return 0;
} }
@ -6475,7 +6458,7 @@ sp_disruptastral(castorder *co)
if(!is_magic_resistant(mage, u, 0) && can_survive(u, tr)) { if(!is_magic_resistant(mage, u, 0) && can_survive(u, tr)) {
move_unit(u, tr, NULL); move_unit(u, tr, NULL);
sprintf(buf, "%s wird aus der astralen Ebene nach %s geschleudert.", sprintf(buf, "%s wird aus der astralen Ebene nach %s geschleudert.",
unitname(u), regionid(tr)); unitname(u), regionname(tr, u->faction));
addmessage(0, u->faction, buf, MSG_MAGIC, ML_INFO); addmessage(0, u->faction, buf, MSG_MAGIC, ML_INFO);
} }
} }
@ -6610,7 +6593,7 @@ sp_permtransfer(castorder *co)
if(!is_mage(tu)) { if(!is_mage(tu)) {
/* sprintf(buf, "%s in %s: 'ZAUBER %s': Einheit ist kein Magier." /* sprintf(buf, "%s in %s: 'ZAUBER %s': Einheit ist kein Magier."
, unitname(mage), regionid(mage->region),sa->strings[0]); */ , unitname(mage), regionname(mage->region, mage->faction),sa->strings[0]); */
cmistake(mage, co->order, 214, MSG_MAGIC); cmistake(mage, co->order, 214, MSG_MAGIC);
return 0; return 0;
} }
@ -6656,7 +6639,7 @@ sp_movecastle(castorder *co)
if(dir == NODIRECTION) { if(dir == NODIRECTION) {
sprintf(buf, "%s in %s: 'ZAUBER %s': Ungültige Richtung %s.", sprintf(buf, "%s in %s: 'ZAUBER %s': Ungültige Richtung %s.",
unitname(mage), regionid(mage->region), unitname(mage), regionname(mage->region, mage->faction),
spell_name(sp, mage->faction->locale), spell_name(sp, mage->faction->locale),
pa->param[1]->data.s); pa->param[1]->data.s);
addmessage(0, mage->faction, buf, MSG_MAGIC, ML_MISTAKE); addmessage(0, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
@ -6666,7 +6649,7 @@ sp_movecastle(castorder *co)
if(b->size > (cast_level-12) * 250) { if(b->size > (cast_level-12) * 250) {
sprintf(buf, "%s in %s: 'ZAUBER %s': Der Elementar ist " sprintf(buf, "%s in %s: 'ZAUBER %s': Der Elementar ist "
"zu klein, um das Gebäude zu tragen.", unitname(mage), "zu klein, um das Gebäude zu tragen.", unitname(mage),
regionid(mage->region), spell_name(sp, mage->faction->locale)); regionname(mage->region, mage->faction), spell_name(sp, mage->faction->locale));
addmessage(0, mage->faction, buf, MSG_MAGIC, ML_MISTAKE); addmessage(0, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
return cast_level; return cast_level;
} }
@ -6676,7 +6659,7 @@ sp_movecastle(castorder *co)
if(!(terrain[target_region->terrain].flags & LAND_REGION)) { if(!(terrain[target_region->terrain].flags & LAND_REGION)) {
sprintf(buf, "%s in %s: 'ZAUBER %s': Der Erdelementar " sprintf(buf, "%s in %s: 'ZAUBER %s': Der Erdelementar "
"weigert sich, nach %s zu gehen.", "weigert sich, nach %s zu gehen.",
unitname(mage), regionid(mage->region), unitname(mage), regionname(mage->region, mage->faction),
spell_name(sp, mage->faction->locale), spell_name(sp, mage->faction->locale),
locale_string(mage->faction->locale, directions[dir])); locale_string(mage->faction->locale, directions[dir]));
addmessage(0, mage->faction, buf, MSG_MAGIC, ML_MISTAKE); addmessage(0, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
@ -7079,7 +7062,7 @@ sp_q_antimagie(castorder *co)
switch(obj){ switch(obj){
case SPP_REGION: case SPP_REGION:
ap = &r->attribs; ap = &r->attribs;
set_string(&ts, regionid(r)); set_string(&ts, regionname(r, mage->faction));
break; break;
case SPP_TEMP: case SPP_TEMP:
@ -7112,7 +7095,7 @@ sp_q_antimagie(castorder *co)
succ = destroy_curse(ap, cast_level, force, c); succ = destroy_curse(ap, cast_level, force, c);
if(succ) { if (succ) {
ADDMSG(&mage->faction->msgs, msg_message( ADDMSG(&mage->faction->msgs, msg_message(
"destroy_magic_effect", "unit region command succ target", "destroy_magic_effect", "unit region command succ target",
mage, mage->region, co->order, succ, strdup(ts))); mage, mage->region, co->order, succ, strdup(ts)));

View File

@ -116,7 +116,7 @@ static item_type it_gryphonwing = {
static int static int
enter_fail(unit * u) { enter_fail(unit * u) {
sprintf(buf, "In %s erklingt die Stimme des Torwächters: 'Nur wer ohne materielle Güter und noch lernbegierig ist, der darf die Ebene der Herausforderung betreten. Und vergiß nicht mein Trinkgeld.'. %s erhielt keinen Einlaß.", regionid(u->region), unitname(u)); sprintf(buf, "In %s erklingt die Stimme des Torwächters: 'Nur wer ohne materielle Güter und noch lernbegierig ist, der darf die Ebene der Herausforderung betreten. Und vergiß nicht mein Trinkgeld.'. %s erhielt keinen Einlaß.", regionname(u->region, u->faction), unitname(u));
addmessage(NULL, u->faction, buf, MSG_MESSAGE, ML_IMPORTANT); addmessage(NULL, u->faction, buf, MSG_MESSAGE, ML_IMPORTANT);
return 1; return 1;
} }
@ -157,7 +157,7 @@ enter_arena(unit * u, const item_type * itype, int amount, order * ord)
if (u2) change_money(u2, get_money(u) - fee); if (u2) change_money(u2, get_money(u) - fee);
else if (enter_fail(u)) return -1; else if (enter_fail(u)) return -1;
} }
sprintf(buf, "In %s öffnet sich ein Portal. Eine Stimme ertönt, und spricht: 'Willkommen in der Ebene der Herausforderung'. %s durchschreitet das Tor zu einer anderen Welt.", regionid(u->region), unitname(u)); sprintf(buf, "In %s öffnet sich ein Portal. Eine Stimme ertönt, und spricht: 'Willkommen in der Ebene der Herausforderung'. %s durchschreitet das Tor zu einer anderen Welt.", regionname(u->region, u->faction), unitname(u));
addmessage(NULL, u->faction, buf, MSG_MESSAGE, ML_IMPORTANT); addmessage(NULL, u->faction, buf, MSG_MESSAGE, ML_IMPORTANT);
new_use_pooled(u, &rt_gryphonwing, GET_SLACK|GET_RESERVE, 1); new_use_pooled(u, &rt_gryphonwing, GET_SLACK|GET_RESERVE, 1);
use_pooled(u, r, R_SILVER, fee); use_pooled(u, r, R_SILVER, fee);
@ -357,6 +357,7 @@ guardian_faction(plane * pl, int id)
f->no = id; f->no = id;
addlist(&factions, f); addlist(&factions, 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");

View File

@ -648,6 +648,7 @@ gm_addquest(const char * email, const char * name, int radius, unsigned int flag
f->no = i; f->no = i;
addlist(&factions, f); addlist(&factions, f);
fhash(f);
} }
/* GM playfield */ /* GM playfield */
@ -751,6 +752,7 @@ gm_addfaction(const char * email, plane * p, region * r)
f->no = i; f->no = i;
addlist(&factions, f); addlist(&factions, f);
fhash(f);
} }
/* generic permissions */ /* generic permissions */
a = a_add(&f->attribs, a_new(&at_permissions)); a = a_add(&f->attribs, a_new(&at_permissions));

View File

@ -324,7 +324,7 @@ use_museumexitticket(unit *u, const struct item_type *itype, int amount, order *
/* Exitticket abziehen */ /* Exitticket abziehen */
i_change(&u->items, itype, -1); i_change(&u->items, itype, -1);
return 1; return 0;
} }
resource_type rt_museumexitticket = { resource_type rt_museumexitticket = {
@ -379,7 +379,7 @@ use_museumticket(unit *u, const struct item_type *itype, int amount, order * ord
/* Benutzer ein Exitticket geben */ /* Benutzer ein Exitticket geben */
i_change(&u->items, &it_museumexitticket, 1); i_change(&u->items, &it_museumexitticket, 1);
return 1; return 0;
} }
resource_type rt_museumticket = { resource_type rt_museumticket = {

View File

@ -161,13 +161,13 @@ attrib_type at_eventhandler = {
}; };
struct trigger ** struct trigger **
get_triggers(struct attrib * ap, const char * event) get_triggers(struct attrib * ap, const char * eventname)
{ {
handler_info * td = NULL; handler_info * td = NULL;
attrib * a = a_find(ap, &at_eventhandler); attrib * a = a_find(ap, &at_eventhandler);
while (a!=NULL) { while (a!=NULL) {
td = (handler_info *)a->data.v; td = (handler_info *)a->data.v;
if (!strcmp(td->event, event)) { if (!strcmp(td->event, eventname)) {
break; break;
} }
a = a->nexttype; a = a->nexttype;
@ -177,7 +177,7 @@ get_triggers(struct attrib * ap, const char * event)
} }
void void
add_trigger(struct attrib ** ap, const char * event, struct trigger * t) add_trigger(struct attrib ** ap, const char * eventname, struct trigger * t)
{ {
trigger ** tp; trigger ** tp;
handler_info * td = NULL; handler_info * td = NULL;
@ -185,7 +185,7 @@ add_trigger(struct attrib ** ap, const char * event, struct trigger * t)
assert(t->next==NULL); assert(t->next==NULL);
while (a!=NULL) { while (a!=NULL) {
td = (handler_info *)a->data.v; td = (handler_info *)a->data.v;
if (!strcmp(td->event, event)) { if (!strcmp(td->event, eventname)) {
break; break;
} }
a = a->nexttype; a = a->nexttype;
@ -193,7 +193,7 @@ add_trigger(struct attrib ** ap, const char * event, struct trigger * t)
if (!a) { if (!a) {
a = a_add(ap, a_new(&at_eventhandler)); a = a_add(ap, a_new(&at_eventhandler));
td = (handler_info *)a->data.v; td = (handler_info *)a->data.v;
td->event = strdup(event); td->event = strdup(eventname);
} }
tp = &td->triggers; tp = &td->triggers;
while (*tp) tp=&(*tp)->next; while (*tp) tp=&(*tp)->next;
@ -201,7 +201,7 @@ add_trigger(struct attrib ** ap, const char * event, struct trigger * t)
} }
void void
handle_event_va(attrib ** attribs, const char * event, const char * format, ...) handle_event_va(attrib ** attribs, const char * eventname, const char * format, ...)
{ {
event_arg args[9]; event_arg args[9];
int argc = 0; int argc = 0;
@ -218,12 +218,12 @@ handle_event_va(attrib ** attribs, const char * event, const char * format, ...)
} }
args[argc].type=NULL; args[argc].type=NULL;
va_end(marker); va_end(marker);
handle_event(attribs, event, args); handle_event(attribs, eventname, args);
free (toks); free (toks);
} }
void void
handle_event(attrib ** attribs, const char * event, void * data) handle_event(attrib ** attribs, const char * eventname, void * data)
{ {
while (*attribs) { while (*attribs) {
if ((*attribs)->type==&at_eventhandler) break; if ((*attribs)->type==&at_eventhandler) break;
@ -231,7 +231,7 @@ handle_event(attrib ** attribs, const char * event, void * data)
} }
while (*attribs) { while (*attribs) {
handler_info * tl = (handler_info*)(*attribs)->data.v; handler_info * tl = (handler_info*)(*attribs)->data.v;
if (!strcmp(tl->event, event)) break; if (!strcmp(tl->event, eventname)) break;
attribs = &(*attribs)->nexttype; attribs = &(*attribs)->nexttype;
} }
if (*attribs) { if (*attribs) {
@ -265,9 +265,9 @@ tt_find(const char * name)
} }
void void
remove_triggers(struct attrib ** ap, const char * event, const trigger_type * tt) remove_triggers(struct attrib ** ap, const char * eventname, const trigger_type * tt)
{ {
trigger ** tp = get_triggers(*ap, event); trigger ** tp = get_triggers(*ap, eventname);
if(tp == NULL) return; if(tp == NULL) return;
while (*tp) { while (*tp) {
/* first, remove all gate-triggers */ /* first, remove all gate-triggers */

View File

@ -55,12 +55,12 @@ extern void t_add(trigger ** tlist, trigger * t);
/** add and handle triggers **/ /** add and handle triggers **/
/* add a trigger to a list of attributes */ /* add a trigger to a list of attributes */
extern void add_trigger(struct attrib ** ap, const char * event, struct trigger * t); extern void add_trigger(struct attrib ** ap, const char * eventname, struct trigger * t);
extern void remove_triggers(struct attrib ** ap, const char * event, const trigger_type * tt); extern void remove_triggers(struct attrib ** ap, const char * eventname, const trigger_type * tt);
extern struct trigger ** get_triggers(struct attrib * ap, const char * event); extern struct trigger ** get_triggers(struct attrib * ap, const char * eventname);
/* calls handle() for each of these. e.g. used in timeout */ /* calls handle() for each of these. e.g. used in timeout */
extern void handle_event(struct attrib ** attribs, const char * event, void * data); extern void handle_event(struct attrib ** attribs, const char * eventname, void * data);
extern void handle_event_va(struct attrib ** attribs, const char * event, const char * format, ...); extern void handle_event_va(struct attrib ** attribs, const char * eventname, const char * format, ...);
/* functions for making complex triggers: */ /* functions for making complex triggers: */
extern void free_triggers(trigger * triggers); /* release all these triggers */ extern void free_triggers(trigger * triggers); /* release all these triggers */

View File

@ -42,7 +42,7 @@
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386" AdditionalOptions="/MACHINE:I386 /FIXED:NO"
AdditionalDependencies="luabind.lib lua50.lib lualib50.lib libxml2.lib iconv.lib" AdditionalDependencies="luabind.lib lua50.lib lualib50.lib libxml2.lib iconv.lib"
OutputFile=".\Release/eressea-lua.exe" OutputFile=".\Release/eressea-lua.exe"
LinkIncremental="1" LinkIncremental="1"
@ -76,8 +76,8 @@
</Configuration> </Configuration>
<Configuration <Configuration
Name="Profile|Win32" Name="Profile|Win32"
OutputDirectory=".\Profile" OutputDirectory=".\Profile-lua"
IntermediateDirectory=".\Profile" IntermediateDirectory=".\Profile-lua"
ConfigurationType="1" ConfigurationType="1"
UseOfMFC="0" UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE" ATLMinimizesCRunTimeLibraryUsage="FALSE"

View File

@ -469,7 +469,7 @@ fix_firewalls(void)
if (a==NULL || a->data.i <= 0) { if (a==NULL || a->data.i <= 0) {
erase_border(b); erase_border(b);
log_warning(("firewall between regions %s and %s was bugged. removed.\n", log_warning(("firewall between regions %s and %s was bugged. removed.\n",
regionid(r), regionid(r2))); regionname(r, NULL), regionname(r2, NULL)));
b = get_borders(r, r2); b = get_borders(r, r2);
} else { } else {
b = b->next; b = b->next;

View File

@ -206,7 +206,9 @@ chg_item(selection * s, void * data) {
boolean boolean
modify_items(unit * u) modify_items(unit * u)
{ {
selection *ilist = NULL, **ilast = &ilist; selection *ilist = NULL;
#if 0
selection **ilast = &ilist;
const item_type * itype = itemtypes; const item_type * itype = itemtypes;
while (itype!=NULL) { while (itype!=NULL) {
@ -222,7 +224,8 @@ modify_items(unit * u)
itype=itype->next; itype=itype->next;
while (ilist->prev!=NULL) ilist=ilist->prev; while (ilist->prev!=NULL) ilist=ilist->prev;
} }
i_modif = false; #endif
i_modif = false;
do_selection(ilist, "Gegenstände", chg_item, (void*)u); do_selection(ilist, "Gegenstände", chg_item, (void*)u);
while (ilist) { while (ilist) {
selection * s = ilist; selection * s = ilist;

View File

@ -1544,7 +1544,6 @@ makemonsters(void)
f->name=strdup("Monster"); f->name=strdup("Monster");
f->passw=strdup("abc123"); f->passw=strdup("abc123");
f->override = strdup(itoa36(rand())); f->override = strdup(itoa36(rand()));
fhash(f);
return f; return f;
} }

View File

@ -6,7 +6,7 @@
<building name="genericbuilding" maxsize="1" nobuild="yes" auraregen="1.00"/> <building name="genericbuilding" maxsize="1" nobuild="yes" auraregen="1.00"/>
<building name="artacademy" maxsize="100" nobuild="yes" nodestroy="yes" unique="yes" auraregen="1.00"/> <building name="artacademy" maxsize="100" nobuild="yes" nodestroy="yes" unique="yes" auraregen="1.00"/>
<building name="artsculpture" maxsize="100" nobuild="yes" nodestroy="yes" unique="yes" auraregen="1.00"/> <building name="artsculpture" maxsize="100" nobuild="yes" nodestroy="yes" unique="yes" auraregen="1.00"/>
<building name="blessedstonecircle" maxsize="100" nobuild="yes" magic="yes" magres="60" magresbonus="30" auraregen="1.50"> <building name="blessedstonecircle" maxcapacity="3" maxsize="100" nobuild="yes" magic="yes" magres="60" magresbonus="30" auraregen="1.50">
<construction skill="sk_building" minskill="2" reqsize="100" maxsize="100"> <construction skill="sk_building" minskill="2" reqsize="100" maxsize="100">
<requirement type="log" recycle="0.5" quantity="500"/> <requirement type="log" recycle="0.5" quantity="500"/>
<requirement type="stone" recycle="0.5" quantity="500"/> <requirement type="stone" recycle="0.5" quantity="500"/>

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<equipment> <equipment>
<item name="conquesttoken" amount="1"/> <item name="conquesttoken" amount="1"/>
<item name="wood" amount="30"/> <item name="log" amount="30"/>
<item name="stone" amount="30"/> <item name="stone" amount="30"/>
<item name="money" amount="2000"/> <item name="money" amount="2000"/>
</equipment> </equipment>

View File

@ -6069,5 +6069,53 @@
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - The unit has $int($have) of $int($cost) silver required."</text> <text locale="en">"$unit($unit) in $region($region): '$order($command)' - The unit has $int($have) of $int($cost) silver required."</text>
</message> </message>
<message name="tidalwave" section="events">
<type>
<arg name="region" type="region"/>
</type>
<text locale="de">"Eine gewaltige Flutwelle verschlingt $region($region) und alle Bewohner."</text>
<text locale="en">"A tidal wave wipes out $region($region) and all who lived there."</text>
</message>
<message name="astralshield_activate" section="events">
<type>
<arg name="region" type="region"/>
<arg name="unit" type="unit"/>
</type>
<text locale="de">"$unit($unit) reaktiviert den astralen Schutzschild in $region($region)."</text>
<text locale="en">"$unit($unit) reactivates the astral protection shield in $region($region)."</text>
</message>
<message name="dissolve_units" section="events">
<type>
<arg name="region" type="region"/>
<arg name="unit" type="unit"/>
<arg name="number" type="int"/>
<arg name="race" type="race"/>
<arg name="action" type="string"/>
</type>
<text locale="de">"$unit($unit) in $region($region): $int($number) $race($race,$number) $action"</text>
<text locale="en">"$unit($unit) in $region($region): $int($number) $race($race,$number) $action"</text>
</message>
<message name="forestfire_spread" section="events">
<type>
<arg name="region" type="region"/>
<arg name="next" type="region"/>
<arg name="trees" type="int"/>
</type>
<text locale="de">"Der Waldbrand in $region($region) griff auch auf $region($next) über, und $int($trees) verbrannten."</text>
<text locale="en">"The fire in $region($region) spread to $region($next) and $int($trees) were burnt."</text>
</message>
<message name="plague_spell" section="events">
<type>
<arg name="region" type="region"/>
<arg name="mage" type="unit"/>
</type>
<text locale="de">"$unit($unit) ruft in $region($region) eine Pest hervor."</text>
<text locale="en">"$unit($unit) sends the plague on $region($region)."</text>
</message>
</messages> </messages>