2015-07-07 20:23:24 +02:00
|
|
|
#include <platform.h>
|
|
|
|
#include <kernel/config.h>
|
|
|
|
#include <kernel/curse.h>
|
2015-07-08 05:12:26 +02:00
|
|
|
#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) {
|
2015-07-08 05:12:26 +02:00
|
|
|
if (self != 0) {
|
|
|
|
const struct unit *u = (const struct unit *)obj;
|
|
|
|
return msg_message(mkname("curseinfo", c->type->cname), "unit id", u,
|
|
|
|
c->no);
|
|
|
|
}
|
|
|
|
return NULL;
|
2015-07-07 20:23:24 +02:00
|
|
|
}
|
|
|
|
if (typ == TYP_BUILDING) {
|
2015-07-08 05:12:26 +02:00
|
|
|
const struct building *b = (const struct building *)obj;
|
|
|
|
return msg_message(mkname("curseinfo", self ? "homestone" : "buildingunknown"), "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);
|
|
|
|
}
|