source: golgotha/src/golg/objs/cobra_tank.cc

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: 1.3 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#include "object_definer.hh"
10#include "lisp/li_class.hh"
11#include "objs/model_draw.hh"
12
13class g1_cobra_tank_class : public g1_object_class
14{
15public:
16  virtual i4_float occupancy_radius() const { return draw_params.extent(); }
17 
18  g1_cobra_tank_class(g1_object_type id, g1_loader_class *fp)
19    : g1_object_class(id,fp)
20  {
21    radar_type=G1_RADAR_VEHICLE;
22    flags=SHADOWED |
23      SELECTABLE |
24      TARGETABLE |
25      GROUND |
26      HIT_GROUND |
27      BLOCKING |
28      DANGEROUS;
29   
30    draw_params.setup("cobra");
31  }
32 
33
34  void think()
35  {
36    grab_old();
37   
38    unoccupy_location();
39
40    x += 0.01;
41   
42    if (occupy_location())
43      request_think();
44  }
45};
46
47static g1_object_definer<g1_cobra_tank_class>
48damager_type("cobra_tank", g1_object_definition_class::EDITOR_SELECTABLE |
49   g1_object_definition_class::MOVABLE);
50
Note: See TracBrowser for help on using the repository browser.