altEngine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
commando.h
Go to the documentation of this file.
1 #include "include.h"
2 
3 #ifndef COMMANDO_H
4 #define COMMANDO_H
5 
6 /*
7 Remember Commandos: Behind Enemy Lines?
8  Think that game in 3d using wolfenstein maps from rtcw and enemy territory
9 
10 enemy:
11  halt: ALTO.WAV
12  stab: CUCHI.WAV
13  find dead body: MUERTO.WAV
14  whose there: QUIENVA.WAV
15  distract: SOLDAT.WAV
16  alarm: VOZALARM.WAV
17 
18 
19 GB cant move:
20  ESA/GBIM01.WAV
21  ESA/GBIM02.WAV
22  ESA/GBIM03.WAV
23 
24 GB can move:
25  ESA/GBMV01.WAV - move 1
26  ESA/GBMV02.WAV - move 2
27  ESA/GBMV03.WAV - move 3
28  ESA/GBMV04.WAV - move 4
29 
30 GB okay:
31  GBNM01.WAV - okay1
32  GBNM02.WAV - okay1
33  GBNM03.WAV - okay1
34 
35 GB damage:
36  GBSD01.WAV - damage1
37  GBSD02.WAV - damage1
38  GBSD03.WAV - damage1
39 
40 
41 Spy:
42  SPN
43 Driver:
44  DR
45 Sapper?
46  MA
47 Sniper:
48  SN
49 
50 Green Beret:
51  pistol
52  knife
53  climb
54  decoy
55  carry barrel
56  carry body
57  shovel
58  noise maker: SEGNUELO.WAV
59 
60 
61 Sniper:
62  pistol
63  rifle scope (low ammo)
64  first aid kit
65 
66 Marine:
67  pistol
68  knife
69  boat
70  diving gear
71  harpoon (close range instant kill)
72 Sapper:
73  pistol
74  bear trap
75  time bomb
76  remote detonate bomb
77  grenade
78  pliers
79 Driver:
80  Pistol
81  submachine gun
82  first aid kit
83  driving (duh)
84  enemy fixed gun control
85 Spy:
86  Pistol
87  lethal injection
88  get enemy uniform (not from bodies)
89  disguise
90  distract
91  first aid kit
92  move bodies
93 */
94 
95 class Commando : public BaseGame
96 {
97 public:
98  Commando();
99 
100  void init(Engine *engine);
101  void step(int frame_step);
102  void destroy();
103 
104  void render_hud(double last_frametime);
105  void draw_name(Entity *entity, Menu &menu, matrix4 &real_projection);
106  void draw_line(Entity *a, Entity *b, Menu &menu, vec3 &color);
107  void transform_3d_2d(vec3 &position, vec3 &pos2d, matrix4 &projection);
108 
109  void handle_weapons(Player &player, input_t &input, int self);
110 
111  void handle_plasma(Player &player, int self);
112  void handle_rocketlauncher(Player &player, int self);
113  void handle_grenade(Player &player, int self);
114  void handle_knife(Player &player, int self);
115  void handle_rifle(Player &player, int self);
116  void handle_machinegun(Player &player, int self);
117  void handle_pistol(Player &player, int self);
118  void handle_gibs(Player &player);
119  void create_crosshair();
120  void draw_crosshair();
121  void draw_flash(Player &player);
122 
123 
124  void create_icon();
125  void draw_icon(float scale, int index, float x = 0.0f, float y = 0.0f, float z = 0.0f);
126  void load_icon();
127 
128 
129  void handle_player(int index);
130  void player_died(int index);
131  void drop_weapon(int index);
132  void drop_quaddamage(vec3 &position);
133  void add_bot(int &index);
134  void load_model(Entity &ent);
135 
136  int bot_get_path(int item, int self, int *nav_array, path_t &path);
137  int bot_follow(path_t &path, int *nav_array, Entity *entity, float speed_scale);
138 
139  void load(gametype_t gametype);
140  void setup_func(vector<Entity *> &entity_list, Bsp &q3map);
141  void unload();
142  void init_camera(vector<Entity *> &entity_list);
143  void console(int self, char *cmd, Menu &menu, vector<Entity *> &entity_list);
144  void endgame(char *winner);
145 
150  unsigned int chat_timer;
151  unsigned int notif_timer;
152  unsigned int weapon_switch_timer;
153 
154 private:
155 
157  bool blink;
160 
161  int crosshair_tex[10];
165 
167  unsigned int icon_vbo;
168  bool spectator;
169 
170  unsigned int spectator_timer;
171 };
172 
173 #endif
174