source: golgotha/src/golg/objs/rocket.hh

Last change on this file was 80, checked in by Sam Hocevar, 12 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 2.5 KB
Line 
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
16class g1_solid_class;
17class g1_map_piece_class;
18class g1_smoke_trail_class;
19
20#define G1_ROCKET_DATA_VERSION 1
21
22class g1_rocket_class : public g1_object_class
23{
24protected: 
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
35public:
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
Note: See TracBrowser for help on using the repository browser.