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 ROCKET_HH
|
---|
10 | #define ROCKET_HH
|
---|
11 |
|
---|
12 | #include "g1_object.hh"
|
---|
13 | #include "player_type.hh"
|
---|
14 | #include "path.hh"
|
---|
15 |
|
---|
16 | class g1_solid_class;
|
---|
17 | class g1_map_piece_class;
|
---|
18 | class g1_smoke_trail_class;
|
---|
19 |
|
---|
20 | #define G1_ROCKET_DATA_VERSION 1
|
---|
21 |
|
---|
22 | class g1_rocket_class : public g1_object_class
|
---|
23 | {
|
---|
24 | protected:
|
---|
25 | g1_typed_reference_class<g1_map_piece_class> who_fired_me, track_object;
|
---|
26 | g1_typed_reference_class<g1_smoke_trail_class> smoke_trail;
|
---|
27 |
|
---|
28 | i4_float zv, // z velocity
|
---|
29 | speed; // velocity in the x-y plane (uses theta for direction)
|
---|
30 |
|
---|
31 |
|
---|
32 | i4_float g() { return 0.05; }
|
---|
33 | i4_float vo() { return 0.4; }
|
---|
34 |
|
---|
35 | public:
|
---|
36 |
|
---|
37 | w32 damage;
|
---|
38 |
|
---|
39 | // fire_at setups all the rocket variables so it will hit a specific object fired
|
---|
40 | // from sx,sy,sz if the object is too far away the rocket will land in front of the object
|
---|
41 | // if owner is not 0, then owner will be notified when the rocket hits or misses
|
---|
42 | // this function will also add the rocket to the map and do a request_think()
|
---|
43 | virtual void fire_at(i4_float sx, i4_float sy, i4_float sz,
|
---|
44 | i4_float angle,
|
---|
45 | g1_map_piece_class *kill_target,
|
---|
46 | g1_map_piece_class *owner,
|
---|
47 | w32 damage);
|
---|
48 |
|
---|
49 | // fire is called to setup the rocket if the rocket is not being fired at anything in
|
---|
50 | // particular. In this case it will travel it's maximum range at the specified angle
|
---|
51 | // if owner is not 0, then owner will be notified when the rocket hits or misses
|
---|
52 | // this function will also add the rocket to the map and do a request_think()
|
---|
53 | virtual void fire(i4_float sx, i4_float sy, i4_float sz, i4_angle angle,
|
---|
54 | g1_map_piece_class *owner,
|
---|
55 | w32 damage);
|
---|
56 |
|
---|
57 | g1_rocket_class(g1_object_type id, g1_loader_class *fp);
|
---|
58 | virtual void save(g1_saver_class *fp);
|
---|
59 | virtual void think();
|
---|
60 | virtual void draw(g1_draw_context_class *context);
|
---|
61 |
|
---|
62 | virtual i4_bool move(i4_float x_amount,
|
---|
63 | i4_float y_amount,
|
---|
64 | i4_float z_amount);
|
---|
65 |
|
---|
66 | };
|
---|
67 |
|
---|
68 | #endif
|
---|