UFO: Alien Invasion
e_event_doendround.cpp
Go to the documentation of this file.
1 
5 /*
6 Copyright (C) 2002-2022 UFO: Alien Invasion.
7 
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12 
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 
17 See the GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 
23 */
24 
25 #include "../../../../client.h"
26 #include "../../../../ui/ui_main.h"
27 #include "../../../cl_localentity.h"
28 #include "../../../cl_actor.h"
29 #include "../../../cl_particle.h"
30 #include "../../../cl_hud.h"
31 #include "e_event_doendround.h"
32 
39 void CL_DoEndRound (const eventRegister_t* self, dbuffer* msg)
40 {
41  /* hud changes */
42  if (cls.isOurRound())
43  UI_ExecuteConfunc("endround");
44 
46 
47  /* change active player */
48  Com_Printf("Team %i ended round\n", cl.actTeam);
49  cl.actTeam = NET_ReadByte(msg);
50  Com_Printf("Team %i's round started!\n", cl.actTeam);
51 
52  /* hud changes */
53  if (cls.isOurRound()) {
54  /* check whether a particle has to go */
56  UI_ExecuteConfunc("startround");
57  HUD_DisplayMessage(_("Your round started!"));
58  S_StartLocalSample("misc/roundstart", SND_VOLUME_DEFAULT);
60  }
61 }
#define _(String)
Definition: cl_shared.h:44
void Com_Printf(const char *const fmt,...)
Definition: common.cpp:386
Struct that defines one particular event with all its callbacks and data.
Definition: e_main.h:42
bool isOurRound() const
Definition: client.h:106
client_static_t cls
Definition: cl_main.cpp:83
void CL_ActorConditionalMoveCalc(le_t *le)
Recalculate forbidden list, available moves and actor's move length for the current selected actor...
Definition: cl_actor.cpp:682
rendererData_t refdef
Definition: r_main.cpp:45
void CL_ParticleCheckRounds(void)
checks whether a particle is still active in the current round
clientBattleScape_t cl
#define RDF_IRGOGGLES
Definition: cl_renderer.h:35
void S_StartLocalSample(const char *s, float volume)
Plays a sample without spatialization.
Definition: s_mix.cpp:184
le_t * selActor
Definition: cl_actor.cpp:49
void CL_DoEndRound(const eventRegister_t *self, dbuffer *msg)
Performs end-of-turn processing.
int NET_ReadByte(dbuffer *buf)
Reads a byte from the netchannel.
Definition: netpack.cpp:234
void HUD_DisplayMessage(const char *text)
Displays a message on the hud.
Definition: cl_hud.cpp:138
#define SND_VOLUME_DEFAULT
Definition: s_main.h:42
void UI_ExecuteConfunc(const char *fmt,...)
Executes confunc - just to identify those confuncs in the code - in this frame.
Definition: ui_main.cpp:110