server/src/common/spells/buildingcurse.c

80 lines
1.7 KiB
C
Raw Normal View History

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 */
#include "message.h"
#include "nrmessage.h"
#include "objtypes.h"
#include "curse.h"
/* util includes */
2002-05-09 14:31:42 +02:00
#include <kernel/message.h>
#include <util/message.h>
2002-05-09 12:42:41 +02:00
/* libc includes */
#include <string.h>
#include <stdlib.h>
#include <assert.h>
static int
cinfo_building(const locale * lang, void * obj, typ_t typ, curse *c, int self)
{
message * msg;
unused(typ);
assert(typ == TYP_BUILDING);
2002-05-09 14:36:43 +02:00
if (self == 1){ /* 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;
if (self){
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;
if (self){
sprintf(buf, "Auf den Planken von %s erkennt man seltsame Runen. (%s)",
sh->name, curseid(c));
return 1;
}
}
return 0;
}