server/src/spells/magicresistance.c

32 lines
947 B
C
Raw Normal View History

2015-07-07 20:23:24 +02:00
#include <platform.h>
#include <kernel/config.h>
#include <kernel/curse.h>
#include <kernel/messages.h>
#include <util/language.h>
2015-07-07 20:23:24 +02:00
static struct message *cinfo_magicresistance(const void *obj, objtype_t typ, const struct curse * c, int self)
{
if (typ == TYP_UNIT) {
if (self != 0) {
const struct unit *u = (const struct unit *)obj;
return msg_message(mkname("curseinfo", "magicresistance_unit"), "unit id", u,
c->no);
}
return NULL;
2015-07-07 20:23:24 +02:00
}
if (typ == TYP_BUILDING) {
const struct building *b = (const struct building *)obj;
return msg_message(mkname("curseinfo", "magicresistance_building"), "id building", c->no, b);
2015-07-07 20:23:24 +02:00
}
return 0;
}
static struct curse_type ct_magicresistance = {
"magicresistance", CURSETYP_UNIT, CURSE_SPREADMODULO, M_MEN, cinfo_magicresistance
};
void register_magicresistance(void)
{
ct_register(&ct_magicresistance);
}