diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-07-21 04:10:52 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-07-21 04:10:52 +0000 |
commit | a17368df4fcbdf37e3452c6bc4935ba4372aabd8 (patch) | |
tree | 05c1e1c8d83dfb48b191543e158c03e79d270729 /crawl-ref/source/artefact.h | |
parent | c2aad9d53735d0ac859227b27cd44733a28b31cf (diff) | |
download | crawl-ref-a17368df4fcbdf37e3452c6bc4935ba4372aabd8.tar.gz crawl-ref-a17368df4fcbdf37e3452c6bc4935ba4372aabd8.zip |
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
Diffstat (limited to 'crawl-ref/source/artefact.h')
-rw-r--r-- | crawl-ref/source/artefact.h | 20 |
1 files changed, 18 insertions, 2 deletions
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); }; |