Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
capture_client.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <algorithm> // for max
3 
4 #include "inexor/client/gamemode/gamemode_client.hpp" // for clientmode
5 #include "inexor/fpsgame/ai.hpp" // for ::AI_S_DEFEND
6 #include "inexor/fpsgame/fpsent.hpp" // for fpsent
7 #include "inexor/gamemode/capture_common.hpp" // for capturemode_co...
8 #include "inexor/gamemode/gamemode.hpp" // for m_regencapture
9 #include "inexor/network/legacy/buffer_types.hpp" // for packetbuf (ptr...
10 #include "inexor/physics/physics.hpp" // for findplayerspawn
11 #include "inexor/shared/cube_vector.hpp" // for vector
12 #include "inexor/shared/tools.hpp" // for max
13 #include "inexor/util/legacy_time.hpp" // for lastmillis
14 
15 namespace game {
16 
18 {
19  static const int AMMOHEIGHT = 5;
20 
21  void respawned(fpsent *d) override
22  {
23  }
24 
25  void replenishammo();
26 
27  void receiveammo(fpsent *d, int type);
28 
29  void checkitems(fpsent *d) override;
30 
31  void rendertether(fpsent *d);
32 
33  void preload() override;
34 
35  void rendergame() override;
36 
37  void drawblips(fpsent *d, float blipsize, int fw, int fh, int type, bool skipenemy = false);
38 
39  int respawnwait(fpsent *d) override
40  {
42  }
43 
44  int clipconsole(int w, int h) override
45  {
46  return (h*(1 + 1 + 10))/(4*10);
47  }
48 
49  void drawhud(fpsent *d, int w, int h) override;
50 
51  void setup() override;
52 
53  void senditems(packetbuf &p) override;
54 
55  void updatebase(int i, const char *owner, const char *enemy, int converted, int ammo);
56 
57  void setscore(int base, const char *team, int total);
58 
59  int closesttoenemy(const char *team, bool noattacked = false, bool farthest = false);
60 
61  int pickteamspawn(const char *team);
62 
63  void pickspawn(fpsent *d) override
64  {
66  }
67 
68  bool aicheck(fpsent *d, ai::aistate &b) override
69  {
70  return false;
71  }
72 
73  void aifind(fpsent *d, ai::aistate &b, vector<ai::interest> &interests) override;
74 
75  bool aidefend(fpsent *d, ai::aistate &b) override;
76 
77  bool aipursue(fpsent *d, ai::aistate &b) override
78  {
80  return aidefend(d, b);
81  }
82 
83  bool parse_network_message(int type, ucharbuf &p) override;
84 };
85 
86 extern captureclientmode capturemode;
87 
88 } // ns game
int respawnwait(fpsent *d) override
Definition: capture_client.hpp:39
void senditems(packetbuf &p) override
Definition: capture_client.cpp:361
Vector template.
Definition: cube_vector.hpp:22
Definition: gamemode_client.hpp:25
Definition: capture_client.hpp:17
const T & max(const inexor::rpc::SharedVar< T > &a, const T &b)
Definition: SharedVar.hpp:224
template implementation of buffers (networking e.g.).
Definition: buffer_types.hpp:14
void rendertether(fpsent *d)
Definition: capture_client.cpp:308
void setscore(int base, const char *team, int total)
Definition: capture_client.cpp:374
void updatebase(int i, const char *owner, const char *enemy, int converted, int ammo)
Definition: capture_client.cpp:160
void respawned(fpsent *d) override
Definition: capture_client.hpp:21
#define m_regencapture
Definition: gamemode.hpp:98
bool aipursue(fpsent *d, ai::aistate &b) override
Definition: capture_client.hpp:77
void rendergame() override
Definition: capture_client.cpp:215
void receiveammo(fpsent *d, int type)
Definition: capture_client.cpp:300
Definition: ai.hpp:174
static const int AMMOHEIGHT
Definition: capture_client.hpp:19
int clipconsole(int w, int h) override
Definition: capture_client.hpp:44
bool aicheck(fpsent *d, ai::aistate &b) override
Definition: capture_client.hpp:68
Definition: ai.hpp:151
void preload() override
Definition: capture_client.cpp:335
bool enemy(fpsent *d, aistate &b, const vec &pos, float guard=SIGHTMIN, int pursue=0)
Definition: ai.cpp:312
int lastmillis
Definition: legacy_time.cpp:14
int pickteamspawn(const char *team)
Definition: capture_client.cpp:414
void setup() override
Definition: capture_client.cpp:342
captureclientmode capturemode
Definition: client.cpp:206
Definition: capture_common.hpp:12
void pickspawn(fpsent *d) override
Definition: capture_client.hpp:63
void checkitems(fpsent *d) override
Definition: capture_client.cpp:195
void aifind(fpsent *d, ai::aistate &b, vector< ai::interest > &interests) override
Definition: capture_client.cpp:442
void findplayerspawn(dynent *d, int forceent, int tag)
Definition: world.cpp:1234
int lastpain
Definition: fpsent.hpp:18
int d
Definition: octaedit.cpp:1749
static const int REGENRESPAWNSECS
Definition: capture_common.hpp:29
string team
Definition: fpsent.hpp:30
network packet buffer
Definition: buffer_types.hpp:132
Definition: fpsent.hpp:12
void drawhud(fpsent *d, int w, int h) override
Definition: capture_client.cpp:103
int type
Definition: ai.hpp:176
bool aidefend(fpsent *d, ai::aistate &b) override
Definition: capture_client.cpp:477
bool parse_network_message(int type, ucharbuf &p) override
Parse game mode specific network messages.
Definition: capture_client.cpp:514
void drawblips(fpsent *d, float blipsize, int fw, int fh, int type, bool skipenemy=false)
Definition: capture_client.cpp:60
void replenishammo()
Definition: capture_client.cpp:290
int closesttoenemy(const char *team, bool noattacked=false, bool farthest=false)
Definition: capture_client.cpp:390
static const int RESPAWNSECS
Definition: capture_common.hpp:28