diff options
Diffstat (limited to 'crawl-ref/source/beam.h')
-rw-r--r-- | crawl-ref/source/beam.h | 163 |
1 files changed, 163 insertions, 0 deletions
diff --git a/crawl-ref/source/beam.h b/crawl-ref/source/beam.h index e9ac9efa84..11cd0c5f6e 100644 --- a/crawl-ref/source/beam.h +++ b/crawl-ref/source/beam.h @@ -16,6 +16,169 @@ #include "externs.h" +#include "ray.h" + +enum demon_beam_type +{ + DMNBM_HELLFIRE, // 0 + DMNBM_SMITING, + DMNBM_BRAIN_FEED, + DMNBM_MUTATION +}; + +// beam[].type - note that this (and its variants) also accepts values +// from other enums - confusing {dlb} +enum zap_symbol_type +{ + SYM_SPACE = ' ', // 32 + SYM_FLASK = '!', // 33 + SYM_BOLT = '#', // 35 + SYM_CHUNK = '%', // 37 + SYM_OBJECT = '(', // 40 - actually used for books, but... {dlb} + SYM_WEAPON = ')', // 41 + SYM_ZAP = '*', // 42 + SYM_BURST = '+', // 43 + SYM_STICK = '/', // 47 + SYM_TRINKET = '=', // 61 + SYM_SCROLL = '?', // 63 + SYM_DEBUG = 'X', // 88 + SYM_ARMOUR = '[', // 91 + SYM_MISSILE = '`', // 96 + SYM_EXPLOSION = '#' +}; + +enum zap_type +{ + ZAP_FLAME, // 0 + ZAP_FROST, + ZAP_SLOWING, + ZAP_HASTING, + ZAP_MAGIC_DARTS, + ZAP_HEALING, // 5 + ZAP_PARALYSIS, + ZAP_FIRE, + ZAP_COLD, + ZAP_CONFUSION, + ZAP_INVISIBILITY, // 10 + ZAP_DIGGING, + ZAP_FIREBALL, + ZAP_TELEPORTATION, + ZAP_LIGHTNING, + ZAP_POLYMORPH_OTHER, // 15 + ZAP_VENOM_BOLT, + ZAP_NEGATIVE_ENERGY, + ZAP_CRYSTAL_SPEAR, + ZAP_BEAM_OF_ENERGY, + ZAP_MYSTIC_BLAST, // 20 + ZAP_ENSLAVEMENT, + ZAP_PAIN, + ZAP_STICKY_FLAME, + ZAP_DISPEL_UNDEAD, + ZAP_CLEANSING_FLAME, // 25 + ZAP_BONE_SHARDS, + ZAP_BANISHMENT, + ZAP_DEGENERATION, + ZAP_STING, + ZAP_HELLFIRE, // 30 + ZAP_IRON_BOLT, + ZAP_STRIKING, + ZAP_STONE_ARROW, + ZAP_ELECTRICITY, + ZAP_ORB_OF_ELECTRICITY, // 35 + ZAP_SPIT_POISON, + ZAP_DEBUGGING_RAY, + ZAP_BREATHE_FIRE, + ZAP_BREATHE_FROST, + ZAP_BREATHE_ACID, // 40 + ZAP_BREATHE_POISON, + ZAP_BREATHE_POWER, + ZAP_ENSLAVE_UNDEAD, + ZAP_AGONY, + ZAP_DISRUPTION, // 45 + ZAP_DISINTEGRATION, // 46 + // ZAP_ISKS_CROSS, // 47: Isk's Cross -- commented out, deprecated {dlb} + ZAP_BREATHE_STEAM = 48, // 48 + ZAP_CONTROL_DEMON, + ZAP_ORB_OF_FRAGMENTATION, // 50 + ZAP_ICE_BOLT, + ZAP_ICE_STORM, + ZAP_BACKLIGHT, //jmf: added next bunch 19mar2000 + ZAP_SLEEP, + ZAP_FLAME_TONGUE, + ZAP_SANDBLAST, + ZAP_SMALL_SANDBLAST, + ZAP_MAGMA, + ZAP_POISON_ARROW, + ZAP_BREATHE_STICKY_FLAME, + ZAP_BREATHE_LIGHTNING, + ZAP_PETRIFY, + ZAP_HELLFROST, + NUM_ZAPS // must remain last member {dlb} +}; + +struct dist; + +struct bolt +{ + // INPUT parameters set by caller + int range; // minimum range + int rangeMax; // maximum range + int type; // missile gfx + int colour; + int flavour; + int source_x, source_y; // beam origin + dice_def damage; + int ench_power, hit; + int target_x, target_y; // intended target + char thrower; // what kind of thing threw this? + char ex_size; // explosion radius (0==none) + int beam_source; // NON_MONSTER or monster index # + std::string name; + bool is_beam; // beams? (can hits multiple targets?) + bool is_explosion; + bool is_big_cloud; // expands into big_cloud at endpoint + bool is_enchant; // no block/dodge, but mag resist + bool is_energy; // mostly energy/non-physical attack + bool is_launched; // was fired from launcher? + bool is_thrown; // was thrown from hand? + bool target_first; // targeting by direction + bool aimed_at_spot; // aimed at (x,y), should not cross + std::string aux_source; // source of KILL_MISC beams + + // OUTPUT parameters (tracing, ID) + bool obvious_effect; // did an 'obvious' effect happen? + bool effect_known; // did we _know_ this would happen? + int fr_count, foe_count; // # of times a friend/foe is "hit" + int fr_power, foe_power; // total levels/hit dice affected + + // INTERNAL use - should not usually be set outside of beam.cc + bool is_tracer; // is this a tracer? + bool aimed_at_feet; // this was aimed at self! + bool msg_generated; // an appropriate msg was already mpr'd + bool in_explosion_phase; // explosion phase (as opposed to beam phase) + bool smart_monster; // tracer firer can guess at other mons. resists? + bool can_see_invis; // tracer firer can see invisible? + mon_attitude_type attitude; // attitude of whoever fired tracer + int foe_ratio; // 100* foe ratio (see mons_should_fire()) + bool chose_ray; // do we want a specific ray? + ray_def ray; // shoot on this specific ray + +public: + // A constructor to try and fix some of the bugs that occur because + // this struct never seems to be properly initialized. Definition + // is over in beam.cc. + bolt(); + + void set_target(const dist &); + + // Returns YOU_KILL or MON_KILL, depending on the source of the beam. + killer_type killer() const; + + coord_def target() const + { + return (coord_def(target_x, target_y)); + } +}; dice_def calc_dice( int num_dice, int max_damage ); |