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

Last change on this file was 80, checked in by Sam Hocevar, 11 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.6 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 G1_OBJECT_DEFAULTS_HH
10#define G1_OBJECT_DEFAULTS_HH
11
12#include "arch.hh"
13#include "math/num_type.hh"
14#include "string/string.hh"
15class i4_image_class;
16class li_symbol;
17class g1_damage_map
18{
19public:
20  class entry
21  {
22  public:
23    li_symbol *key;
24    sw16 damage;
25  };
26  i4_array<entry> map;
27};
28
29struct g1_object_defaults_struct
30{
31  char object_name[20];
32
33  i4_float speed,
34    turn_speed,
35    accel;
36
37  w16 cost,
38    health,
39    fire_delay;
40
41  float detection_range;
42
43  li_symbol *fire_type;
44};
45
46
47// defines an ammo type the supertank can fire
48struct g1_stank_ammo_type_struct
49{
50  w16 max_amount;         // when refueling, this is the max we can get
51  w16 refuel_delay;       // ticks to refuel completely
52  w16 fire_delay;         // delay after each shot
53  li_symbol *weapon_type; // name of projectile fired (passed to g1_fire)
54 
55  i4_image_class *icon;       // used to draw the weapon on the status bar
56  i4_image_class *dark_icon;
57};
58
59
60// defines how much damage a weapon does to people and for how long
61class g1_damage_map_struct
62{
63public:
64  li_symbol *object_for;     // which object does this apply to?
65  int special_damage;        // radius of effect or ticks to apply damage
66  int default_damage;        // how much damage is done by default (if not in exxception list)
67  float speed;               // speed at which weapon travels
68  int t_maps;                // how many exceptions are in the array
69  float range;            // how far the shot can travel
70 
71  struct map
72  {
73    li_symbol *object_type;  // who this exception is for
74    int damage;             // how much damage to do to them
75  } *maps;
76
77  int get_damage_for(int object_type);
78  enum { HURT_SINGLE_GUY,
79         DO_AREA_OF_EFFECT } hurt_type;
80};
81
82
83g1_damage_map_struct *g1_find_damage_map(int object_type);
84 
85
86
87g1_stank_ammo_type_struct *g1_find_stank_ammo_type(li_symbol *sym);
88
89g1_object_defaults_struct *g1_get_object_defaults(const char *object_name,
90                                                  i4_bool barf_on_error=i4_T);
91void g1_unload_object_defaults();     // call at end of game to clean up memory
92
93#endif
94
95
Note: See TracBrowser for help on using the repository browser.