From a17368df4fcbdf37e3452c6bc4935ba4372aabd8 Mon Sep 17 00:00:00 2001 From: zelgadis Date: Tue, 21 Jul 2009 04:10:52 +0000 Subject: Allow unrandart launchers to modify the beam of the missile they fire. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10363 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/artefact.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/artefact.h') diff --git a/crawl-ref/source/artefact.h b/crawl-ref/source/artefact.h index 19f403d14e..2b240ef69a 100644 --- a/crawl-ref/source/artefact.h +++ b/crawl-ref/source/artefact.h @@ -12,6 +12,8 @@ #include "externs.h" +class bolt; + // NOTE: NO_UNRANDARTS is automatically set by util/art-data.pl #define NO_UNRANDARTS 76 @@ -120,6 +122,13 @@ enum unrand_flag_type UNRAND_FLAG_CHAOTIC = 0x08 }; +enum setup_missile_type +{ + SM_CONTINUE, + SM_FINISHED, + SM_CANCEL +}; + // The following unrandart bits were taken from $pellbinder's mon-util // code (see mon-util.h & mon-util.cc) and modified (LRH). struct unrandart_entry @@ -148,8 +157,15 @@ struct unrandart_entry void (*equip_func)(item_def* item, bool* show_msgs, bool unmeld); void (*unequip_func)(const item_def* item, bool* show_msgs); void (*world_reacts_func)(item_def* item); - void (*melee_effects_func)(item_def* item, actor* attacker, - actor* defender, bool mondied); + // An item can't be a melee weapon and launcher at the same time, so have + // the functions relevant to those item types share a union. + union + { + void (*melee_effects)(item_def* item, actor* attacker, + actor* defender, bool mondied); + setup_missile_type (*launch)(item_def* item, bolt* beam, + std::string* ammo_name, bool* returning); + } fight_func; bool (*evoke_func)(item_def *item, int* pract, bool* did_work, bool* unevokable); }; -- cgit v1.2.3-54-g00ecf