2001-01-25 10:37:55 +01:00
|
|
|
|
/* vi: set ts=2:
|
|
|
|
|
*
|
2001-04-14 13:39:14 +02:00
|
|
|
|
*
|
2001-01-25 10:37:55 +01:00
|
|
|
|
* 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 "demonseye.h"
|
|
|
|
|
|
|
|
|
|
/* kernel includes */
|
2002-04-07 10:56:28 +02:00
|
|
|
|
#include <faction.h>
|
2001-01-25 10:37:55 +01:00
|
|
|
|
#include <item.h>
|
2002-04-07 10:56:28 +02:00
|
|
|
|
#include <message.h>
|
|
|
|
|
#include <plane.h>
|
|
|
|
|
#include <region.h>
|
|
|
|
|
#include <unit.h>
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
2001-12-10 01:13:39 +01:00
|
|
|
|
/* util includes */
|
|
|
|
|
#include <functions.h>
|
|
|
|
|
|
2001-01-25 10:37:55 +01:00
|
|
|
|
/* libc includes */
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
|
|
static int
|
2002-03-16 18:30:48 +01:00
|
|
|
|
summon_igjarjuk(struct unit * u, const struct item_type * itype, int amount, const char * cmd)
|
2001-01-25 10:37:55 +01:00
|
|
|
|
{
|
2002-04-07 10:56:28 +02:00
|
|
|
|
struct plane * p = rplane(u->region);
|
2002-03-16 18:30:48 +01:00
|
|
|
|
unused(amount);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
unused(itype);
|
2002-04-07 10:56:28 +02:00
|
|
|
|
if (p!=NULL) {
|
|
|
|
|
ADDMSG(&u->faction->msgs, msg_error(u, cmd, "use_realworld_only", ""));
|
|
|
|
|
return EUNUSABLE;
|
|
|
|
|
} else {
|
|
|
|
|
assert(!"not implemented");
|
|
|
|
|
return EUNUSABLE;
|
|
|
|
|
}
|
2001-01-25 10:37:55 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static resource_type rt_demonseye = {
|
2001-04-22 07:36:50 +02:00
|
|
|
|
{ "ao_daemon", "ao_daemon_p" },
|
|
|
|
|
{ "ao_daemon", "ao_daemon_p" },
|
2001-01-25 10:37:55 +01:00
|
|
|
|
RTF_ITEM,
|
|
|
|
|
&res_changeitem
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2001-12-10 01:13:39 +01:00
|
|
|
|
boolean
|
2001-01-25 10:37:55 +01:00
|
|
|
|
give_igjarjuk(const struct unit * src, const struct unit * d, const struct item_type * itype, int n, const char * cmd)
|
|
|
|
|
{
|
|
|
|
|
sprintf(buf, "Eine h<>here Macht hindert %s daran, das Objekt zu <20>bergeben. "
|
|
|
|
|
"'ES IST DEINS, MEIN KIND. DEINS GANZ ALLEIN'.", unitname(src));
|
|
|
|
|
mistake(src, cmd, buf, MSG_COMMERCE);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
item_type it_demonseye = {
|
|
|
|
|
&rt_demonseye, /* resourcetype */
|
|
|
|
|
ITF_NOTLOST|ITF_CURSED, 0, 0, /* flags, weight, capacity */
|
|
|
|
|
NULL, /* construction */
|
|
|
|
|
&summon_igjarjuk,
|
2002-03-16 18:30:48 +01:00
|
|
|
|
NULL,
|
2001-01-25 10:37:55 +01:00
|
|
|
|
&give_igjarjuk
|
|
|
|
|
};
|
2001-02-02 09:40:49 +01:00
|
|
|
|
|
|
|
|
|
void
|
2001-12-10 01:13:39 +01:00
|
|
|
|
register_demonseye(void)
|
2001-02-02 09:40:49 +01:00
|
|
|
|
{
|
|
|
|
|
it_register(&it_demonseye);
|
2001-12-10 01:13:39 +01:00
|
|
|
|
register_function((pf_generic)summon_igjarjuk, "useigjarjuk");
|
|
|
|
|
register_function((pf_generic)give_igjarjuk, "giveigjarjuk");
|
2001-02-02 09:40:49 +01:00
|
|
|
|
}
|