Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ctf_client.hpp
Go to the documentation of this file.
1 #pragma once
2 #include "inexor/client/gamemode/gamemode_client.hpp" // for clientmode
3 #include "inexor/gamemode/ctf_common.hpp" // for flag (ptr only)
4 #include "inexor/network/legacy/buffer_types.hpp" // for ucharbuf, pack...
5 #include "inexor/shared/cube_vector.hpp" // for vector
6 #include "inexor/shared/geom.hpp" // for vec
7 
8 namespace ai {
9 struct aistate;
10 struct interest;
11 } // namespace ai
12 struct fpsent;
13 
14 namespace game {
15 
17 {
18  bool addflag(int i, const vec &o, int team, int vistime = -1000);
19 
20  void ownflag(int i, fpsent *owner, int owntime);
21 
22  void returnflag(int i, int vistime = -1000);
23 
24  void preload() override;
25 
26  void drawblip(fpsent *d, float x, float y, float s, const vec &pos, bool flagblip);
27 
28  void drawblip(fpsent *d, float x, float y, float s, int i, bool flagblip);
29 
30  int clipconsole(int w, int h) override
31  {
32  return (h*(1 + 1 + 10))/(4*10);
33  }
34 
35  void drawhud(fpsent *d, int w, int h) override;
36 
37  void removeplayer(fpsent *d) override;
38 
39  vec interpflagpos(flag &f, float &angle);
40 
41  vec interpflagpos(flag &f) { float angle; return interpflagpos(f, angle); }
42 
43  void rendergame() override;
44 
45  void setup() override;
46 
47  void senditems(packetbuf &p) override;
48 
49  void parseflags(ucharbuf &p, bool commit);
50 
51  void trydropflag();
52 
53  const char *teamcolorflag(flag &f);
54 
55  void dropflag(int i, const vec &o, float yaw, int droptime);
56 
57  void dropflag(fpsent *d, int i, int version, const vec &droploc);
58 
59  void flagexplosion(int i, int team, const vec &loc);
60 
61  void flageffect(int i, int team, const vec &from, const vec &to);
62 
63  void returnflag(fpsent *d, int i, int version);
64 
65  void spawnflag(flag &f);
66 
67  void resetflag(int i, int version, int spawnindex, int team, int score);
68 
69  void scoreflag(fpsent *d, int relay, int relayversion, int goal, int goalversion, int goalspawn, int team, int score, int dflags, int time);
70 
71  void takeflag(fpsent *d, int i, int version);
72 
73  void invisflag(int i, int invis);
74 
75  void checkitems(fpsent *d) override;
76 
77  void respawned(fpsent *d) override;
78 
79  int respawnwait(fpsent *d) override;
80 
81  bool pickholdspawn(fpsent *d);
82 
83  void pickspawn(fpsent *d) override;
84 
85  bool aihomerun(fpsent *d, ai::aistate &b);
86 
87  bool aicheck(fpsent *d, ai::aistate &b) override;
88 
89  void aifind(fpsent *d, ai::aistate &b, vector<ai::interest> &interests) override;
90 
91  bool aidefend(fpsent *d, ai::aistate &b) override;
92 
93  bool aipursue(fpsent *d, ai::aistate &b) override;
94 
95  bool parse_network_message(int type, ucharbuf &p) override;
96 };
97 
98 extern ctfclientmode ctfmode;
99 
100 
101 } // ns game
Vector template.
Definition: cube_vector.hpp:22
void aifind(fpsent *d, ai::aistate &b, vector< ai::interest > &interests) override
Definition: ctf_client.cpp:636
Definition: gamemode_client.hpp:25
void drawhud(fpsent *d, int w, int h) override
Definition: ctf_client.cpp:102
void trydropflag()
Definition: ctf_client.cpp:341
void ownflag(int i, fpsent *owner, int owntime)
Definition: ctf_client.cpp:50
template implementation of buffers (networking e.g.).
Definition: buffer_types.hpp:14
void removeplayer(fpsent *d) override
Definition: ctf_client.cpp:165
bool aicheck(fpsent *d, ai::aistate &b) override
Definition: ctf_client.cpp:617
void checkitems(fpsent *d) override
Definition: ctf_client.cpp:498
Definition: ai.hpp:174
void flagexplosion(int i, int team, const vec &loc)
Definition: ctf_client.cpp:382
void respawned(fpsent *d) override
Definition: ctf_client.cpp:516
vec interpflagpos(flag &f)
Definition: ctf_client.hpp:41
ICOMMAND * f(float *a, float *b), floatret(*a **b)
Definition: ctf_common.hpp:17
void invisflag(int i, int invis)
Definition: ctf_client.cpp:491
void spawnflag(flag &f)
Definition: ctf_client.cpp:420
void takeflag(fpsent *d, int i, int version)
Definition: ctf_client.cpp:478
int respawnwait(fpsent *d) override
Definition: ctf_client.cpp:527
const char * teamcolorflag(flag &f)
Definition: ctf_client.cpp:350
Definition: ctf_client.hpp:16
Definition: ctf_common.hpp:69
vector with 3 floats and some useful methods.
Definition: geom.hpp:110
void flageffect(int i, int team, const vec &from, const vec &to)
Definition: ctf_client.cpp:391
void senditems(packetbuf &p) override
Definition: ctf_client.cpp:265
void parseflags(ucharbuf &p, bool commit)
Definition: ctf_client.cpp:288
int clipconsole(int w, int h) override
Definition: ctf_client.hpp:30
bool pickholdspawn(fpsent *d)
Definition: ctf_client.cpp:531
void scoreflag(fpsent *d, int relay, int relayversion, int goal, int goalversion, int goalspawn, int team, int score, int dflags, int time)
Definition: ctf_client.cpp:446
int d
Definition: octaedit.cpp:1749
bool aipursue(fpsent *d, ai::aistate &b) override
Definition: ctf_client.cpp:757
bool aihomerun(fpsent *d, ai::aistate &b)
Definition: ctf_client.cpp:576
network packet buffer
Definition: buffer_types.hpp:132
void pickspawn(fpsent *d) override
Definition: ctf_client.cpp:571
bool parse_network_message(int type, ucharbuf &p) override
Parse game mode specific network messages.
Definition: ctf_client.cpp:780
Definition: fpsent.hpp:12
vec interpflagpos(flag &f, float &angle)
Definition: ctf_client.cpp:175
ctfclientmode ctfmode
Definition: client.cpp:207
bool aidefend(fpsent *d, ai::aistate &b) override
Definition: ctf_client.cpp:707
void resetflag(int i, int version, int spawnindex, int team, int score)
Definition: ctf_client.cpp:427
void dropflag(int i, const vec &o, float yaw, int droptime)
Definition: ctf_client.cpp:354
void drawblip(fpsent *d, float x, float y, float s, const vec &pos, bool flagblip)
Definition: ctf_client.cpp:89
mathmatics for vectors, matrices, quaterions and more
void returnflag(int i, int vistime=-1000)
Definition: ctf_client.cpp:70
void preload() override
Definition: ctf_client.cpp:59
void setup() override
Definition: ctf_client.cpp:194
void rendergame() override
Definition: ctf_client.cpp:221
bool addflag(int i, const vec &o, int team, int vistime=-1000)
Definition: ctf_client.cpp:42