1 | /********************************************************************** <BR>
|
---|
2 | This file is part of Crack dot Com's free source code release of
|
---|
3 | Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
|
---|
4 | information about compiling & licensing issues visit this URL</a>
|
---|
5 | <PRE> If that doesn't help, contact Jonathan Clark at
|
---|
6 | golgotha_source@usa.net (Subject should have "GOLG" in it)
|
---|
7 | ***********************************************************************/
|
---|
8 |
|
---|
9 | #ifndef BULLET_HH
|
---|
10 | #define BULLET_HH
|
---|
11 |
|
---|
12 | #include "g1_object.hh"
|
---|
13 | #include "player_type.hh"
|
---|
14 | #include "path.hh"
|
---|
15 | #include "objs/model_draw.hh"
|
---|
16 |
|
---|
17 | class g1_solid_class;
|
---|
18 | class g1_map_piece_class;
|
---|
19 | class g1_light_object_class;
|
---|
20 | class g1_particle_emitter_class;
|
---|
21 |
|
---|
22 | class g1_bullet_class : public g1_object_class
|
---|
23 | {
|
---|
24 | enum { DATA_VERSION=7 };
|
---|
25 | protected:
|
---|
26 | void move_forward();
|
---|
27 | void done(i4_bool hit=i4_F,g1_object_class *hit_object=0);
|
---|
28 |
|
---|
29 | r1_texture_handle tex;
|
---|
30 | public:
|
---|
31 | g1_typed_reference_class<g1_object_class> who_fired_me;
|
---|
32 | g1_typed_reference_class<g1_light_object_class> light;
|
---|
33 | g1_typed_reference_class<g1_particle_emitter_class> particle_emitter;
|
---|
34 |
|
---|
35 | enum { IS_SPRITE=2,
|
---|
36 | CREATES_ACID=4,
|
---|
37 | CREATES_NAPALM=8,
|
---|
38 | MAKE_SMOKE=16,
|
---|
39 | SPINS=32
|
---|
40 | };
|
---|
41 |
|
---|
42 | i4_float range, // how much further we can travel
|
---|
43 | range_decrement; // hom much range to subtract each tick
|
---|
44 |
|
---|
45 | i4_3d_vector vel;
|
---|
46 |
|
---|
47 | virtual i4_float occupancy_radius() const { return 0.1; }
|
---|
48 |
|
---|
49 | virtual i4_bool move();
|
---|
50 |
|
---|
51 | g1_bullet_class(g1_object_type id, g1_loader_class *fp);
|
---|
52 |
|
---|
53 | virtual void save(g1_saver_class *fp);
|
---|
54 |
|
---|
55 |
|
---|
56 | w32 bullet_flags;
|
---|
57 |
|
---|
58 | virtual void setup(const i4_3d_vector &start_pos,
|
---|
59 | const i4_3d_vector &vel,
|
---|
60 | g1_object_class *this_guy_fired_me,
|
---|
61 | i4_float range,
|
---|
62 | w32 flags=0,
|
---|
63 | r1_texture_handle sprite_texture=0,
|
---|
64 | g1_light_object_class *light=0);
|
---|
65 |
|
---|
66 | virtual void draw(g1_draw_context_class *context);
|
---|
67 | virtual void think();
|
---|
68 | };
|
---|
69 |
|
---|
70 | #endif
|
---|