2002-05-09 12:42:41 +02:00
|
|
|
|
/* vi: set ts=2:
|
|
|
|
|
*
|
|
|
|
|
* Eressea PB(E)M host Copyright (C) 1998-2000
|
|
|
|
|
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
|
|
|
|
* Katja Zedel (katze@felidae.kn-bremen.de)
|
|
|
|
|
* Henning Peters (faroul@beyond.kn-bremen.de)
|
|
|
|
|
* Enno Rehling (enno@eressea-pbem.de)
|
|
|
|
|
* Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de)
|
|
|
|
|
*
|
|
|
|
|
* This program may not be used, modified or distributed without
|
|
|
|
|
* prior permission by the authors of Eressea.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
#include "eressea.h"
|
|
|
|
|
#include "buildingcurse.h"
|
|
|
|
|
|
|
|
|
|
/* kernel includes */
|
2002-05-09 14:48:19 +02:00
|
|
|
|
#include <message.h>
|
|
|
|
|
#include <nrmessage.h>
|
|
|
|
|
#include <objtypes.h>
|
|
|
|
|
#include <building.h>
|
|
|
|
|
#include <ship.h>
|
|
|
|
|
#include <curse.h>
|
2002-05-09 12:42:41 +02:00
|
|
|
|
|
|
|
|
|
/* util includes */
|
2002-05-09 14:48:19 +02:00
|
|
|
|
#include <base36.h>
|
|
|
|
|
#include <functions.h>
|
2002-05-09 12:42:41 +02:00
|
|
|
|
|
|
|
|
|
/* libc includes */
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
|
|
|
2002-05-09 14:48:19 +02:00
|
|
|
|
int
|
2002-05-09 12:42:41 +02:00
|
|
|
|
cinfo_building(const locale * lang, void * obj, typ_t typ, curse *c, int self)
|
|
|
|
|
{
|
|
|
|
|
message * msg;
|
|
|
|
|
|
|
|
|
|
unused(typ);
|
|
|
|
|
assert(typ == TYP_BUILDING);
|
|
|
|
|
|
2002-05-10 18:09:07 +02:00
|
|
|
|
if (self != 0){ /* owner or inside */
|
2002-05-09 12:42:41 +02:00
|
|
|
|
msg = msg_message(mkname("curseinfo", c->type->cname), "id", c->no);
|
2002-05-09 14:36:43 +02:00
|
|
|
|
} else { /* outside */
|
2002-05-09 12:42:41 +02:00
|
|
|
|
msg = msg_message(mkname("curseinfo", "buildingunknown"), "id", c->no);
|
|
|
|
|
}
|
|
|
|
|
nr_render(msg, lang, buf, sizeof(buf), NULL);
|
|
|
|
|
msg_release(msg);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* CurseInfo mit Spezialabfragen */
|
|
|
|
|
|
2002-05-09 14:36:43 +02:00
|
|
|
|
/* C_MAGICSTONE*/
|
|
|
|
|
static int
|
|
|
|
|
cinfo_magicrunes(void * obj, typ_t typ, curse *c, int self)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
if (typ == TYP_BUILDING){
|
|
|
|
|
building * b;
|
|
|
|
|
b = (building*)obj;
|
2002-05-10 18:09:07 +02:00
|
|
|
|
if (self != 0){
|
2002-05-09 14:36:43 +02:00
|
|
|
|
sprintf(buf, "Auf den Mauern von %s erkennt man seltsame Runen. (%s)",
|
|
|
|
|
b->name, curseid(c));
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
} else if (typ == TYP_SHIP) {
|
|
|
|
|
ship *sh;
|
|
|
|
|
sh = (ship*)obj;
|
2002-05-10 18:09:07 +02:00
|
|
|
|
if (self != 0){
|
2002-05-09 14:36:43 +02:00
|
|
|
|
sprintf(buf, "Auf den Planken von %s erkennt man seltsame Runen. (%s)",
|
|
|
|
|
sh->name, curseid(c));
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2002-05-11 19:08:54 +02:00
|
|
|
|
static struct curse_type ct_magicrunes = { "magicrunes",
|
|
|
|
|
CURSETYP_NORM, 0, M_SUMEFFECT,
|
|
|
|
|
"Dieses Zauber verst<73>rkt die nat<61>rliche Widerstandskraft gegen eine "
|
|
|
|
|
"Verzauberung.",
|
|
|
|
|
cinfo_magicrunes
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static struct curse_type ct_magicwalls = { "magicwalls",
|
|
|
|
|
CURSETYP_NORM, 0, NO_MERGE,
|
|
|
|
|
"Die Macht dieses Zaubers ist fast greifbar und tief in die Mauern "
|
|
|
|
|
"gebunden. Starke elementarmagische Kr<4B>fte sind zu sp<73>ren. "
|
|
|
|
|
"Vieleicht wurde gar ein Erdelementar in diese Mauern gebannt. "
|
|
|
|
|
"Ausser ebenso starkter Antimagie wird nichts je diese Mauern "
|
|
|
|
|
"gef<EFBFBD>hrden k<>nnen.",
|
|
|
|
|
cinfo_building
|
|
|
|
|
};
|
|
|
|
|
static struct curse_type ct_strongwall = { "strongwall",
|
|
|
|
|
CURSETYP_NORM, 0, NO_MERGE,
|
|
|
|
|
"",
|
|
|
|
|
cinfo_building
|
|
|
|
|
};
|
|
|
|
|
static struct curse_type ct_nocostbuilding = { "nocostbuilding",
|
|
|
|
|
CURSETYP_NORM, 0, NO_MERGE,
|
|
|
|
|
"Die Macht dieses Zaubers ist fast greifbar und tief in die Mauern "
|
|
|
|
|
"gebunden. Unbeeindruck vom Zahn der Zeit wird dieses Geb<65>ude wohl "
|
|
|
|
|
"auf Ewig stehen.",
|
|
|
|
|
cinfo_building
|
|
|
|
|
};
|
2002-05-09 14:36:43 +02:00
|
|
|
|
|
2002-05-09 14:48:19 +02:00
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
register_buildingcurse(void)
|
|
|
|
|
{
|
|
|
|
|
register_function((pf_generic)cinfo_magicrunes, "curseinfo::magicrunes");
|
2002-05-11 19:08:54 +02:00
|
|
|
|
|
|
|
|
|
ct_register(&ct_magicwalls);
|
|
|
|
|
ct_register(&ct_strongwall);
|
|
|
|
|
ct_register(&ct_magicrunes);
|
|
|
|
|
ct_register(&ct_nocostbuilding);
|
2002-05-09 14:55:56 +02:00
|
|
|
|
}
|