/* * The implementation of the Crown of Yendor. * * This file knows there is always exactly one crown. This simplifies * monster flag setting in moved_crown(), which would otherwise have * to consider the possibility that there is another crown in the from * inventory. */ #include "obj.h" #include "util.h" #include "vars.h" #include "format.h" #include "structs.h" static void moved_crown(INVOBJ *io __attribute__((__unused__)), INVENT *from, INVENT *to) { if (from && (from->type == IT_MON)) from->u.m->baseflags &= ~MBF_CROWN; if (to && (to->type == IT_MON)) to->u.m->baseflags |= MBF_CROWN; } #define new_crown noop_new #define old_crown noop_old #define format_crown std_format #define fmt_cond_crown panic_fmt_cond #define fmt_spec_crown panic_fmt_spec #define collapsible_crown never_collapsible #define identical_crown never_identical #define identified_crown always_identified #define identify_crown already_identify #define split_crown std_split #define cursable_crown 0 #define setcursed_crown setcursed_uncursable #define inuse_crown inuse_never OBJOPS objops_crown = OBJOPS_INIT(crown);