summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.h
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-01 12:29:07 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-01 12:29:07 +0000
commitf5e97453a4ac3af452849dd8b3b429ecc8c7389d (patch)
treeae4ebfa3f583fde4b04738b120e0575f65b45353 /crawl-ref/source/beam.h
parent04f5058cac8e12d3b85834bda4589239932f371a (diff)
downloadcrawl-ref-f5e97453a4ac3af452849dd8b3b429ecc8c7389d.tar.gz
crawl-ref-f5e97453a4ac3af452849dd8b3b429ecc8c7389d.zip
Added shields of reflection, though they're not randomly generated and have no
valuation is shopping.cc. It currently only reflects missiles that are blocked with the shield. They could also reflect the brand effects of blocked melee weapons, but I'm not sure if that's a good idea. drop_item and the item to be dropped have been moved from fire_beam()'s parameters into the bolt structure, along with the beam's remaining range. Seems to work fine, but it might still lead to some buggyness. The game now distinguishes between killing yourself by hitting yourself with a beam bounced off a wall versus other forms of self targeting. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7705 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/beam.h')
-rw-r--r--crawl-ref/source/beam.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/crawl-ref/source/beam.h b/crawl-ref/source/beam.h
index ab74ec8ce2..69d12c6051 100644
--- a/crawl-ref/source/beam.h
+++ b/crawl-ref/source/beam.h
@@ -40,6 +40,8 @@ struct bolt
unsigned type; // missile gfx
int colour;
beam_type flavour;
+ bool drop_item; // should drop an item when done
+ item_def* item; // item to drop
coord_def source; // beam origin
coord_def target; // intended target
coord_def pos; // actual position
@@ -57,15 +59,22 @@ struct bolt
bool affects_nothing; // should not hit monsters or features
+ bool effect_known; // did we _know_ this would happen?
+
// 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
int fr_hurt, foe_hurt; // # of friends/foes actually hurt
int fr_helped, foe_helped; // # of friends/foes actually helped
+ bool dropped_item; // item has been dropped
+ coord_def item_pos; // position item was dropped at
+ int item_index; // mitm[index] of item
+
// INTERNAL use - should not usually be set outside of beam.cc
+ int range_used;
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
@@ -81,6 +90,13 @@ struct bolt
// friend
bool dont_stop_player; // player answered self target prompt with 'y'
+ int bounces; // # times beam bounced off walls
+ coord_def bounce_pos; // position of latest wall bounce,
+ // reset if a reflection happens
+
+ int reflections; // # times beam reflected off shields
+ int reflector; // latest thing to reflect beam
+
ray_def ray; // shoot on this specific ray
@@ -104,7 +120,7 @@ dice_def calc_dice( int num_dice, int max_damage );
// Test if the to-hit (attack) beats evasion (defence).
bool test_beam_hit(int attack, int defence);
-void fire_beam(bolt &pbolt, item_def *item = NULL, bool drop_item = false);
+void fire_beam(bolt &pbolt);
int explosion( bolt &pbolt, bool hole_in_the_middle = false,
bool explode_in_wall = false,
@@ -139,8 +155,9 @@ bool zapping( zap_type ztype, int power, struct bolt &pbolt,
bool needs_tracer = false, std::string msg = "" );
bool player_tracer( zap_type ztype, int power, struct bolt &pbolt,
int range = 0 );
-int affect(bolt &beam, const coord_def& p, item_def *item = NULL,
- bool affect_items = true);
-void beam_drop_object( bolt &beam, item_def *item, const coord_def& where );
+int affect(bolt &beam, const coord_def& p = coord_def(),
+ item_def *item = NULL, bool affect_items = true);
+void beam_drop_object( bolt &beam, item_def *item = NULL,
+ const coord_def& where = coord_def() );
#endif