UFO: Alien Invasion
e_event_doendround.cpp
Go to the documentation of this file.
1
5/*
6Copyright (C) 2002-2022 UFO: Alien Invasion.
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; either version 2
11of the License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, 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
39void CL_DoEndRound (const eventRegister_t* self, dbuffer* msg)
40{
41 /* hud changes */
42 if (cls.isOurRound())
43 UI_ExecuteConfunc("endround");
44
45 refdef.rendererFlags &= ~RDF_IRGOGGLES;
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}
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
le_t * selActor
Definition: cl_actor.cpp:49
clientBattleScape_t cl
void HUD_DisplayMessage(const char *text)
Displays a message on the hud.
Definition: cl_hud.cpp:138
client_static_t cls
Definition: cl_main.cpp:83
void CL_ParticleCheckRounds(void)
checks whether a particle is still active in the current round
rendererData_t refdef
Definition: r_main.cpp:45
#define _(String)
Definition: cl_shared.h:44
void Com_Printf(const char *const fmt,...)
Definition: common.cpp:386
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 S_StartLocalSample(const char *s, float volume)
Plays a sample without spatialization.
Definition: s_mix.cpp:184
#define SND_VOLUME_DEFAULT
Definition: s_main.h:42
bool isOurRound() const
Definition: client.h:106
Struct that defines one particular event with all its callbacks and data.
Definition: e_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