2020-04-13 18:12:09 -07:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
|
|
|
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* init */
|
|
|
|
void
|
2020-04-14 07:19:25 -07:00
|
|
|
CGameRules::InitPostEnts(void)
|
2020-04-13 18:12:09 -07:00
|
|
|
{
|
|
|
|
//print("Init!\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* logic */
|
|
|
|
void
|
|
|
|
CGameRules::FrameStart(void)
|
|
|
|
{
|
|
|
|
//print("StartFrame!\n");
|
|
|
|
}
|
|
|
|
float
|
2020-05-02 20:26:06 -07:00
|
|
|
CGameRules::ConsoleCommand(base_player pl, string cmd)
|
2020-04-13 18:12:09 -07:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* client */
|
|
|
|
void
|
|
|
|
CGameRules::PlayerConnect(entity pl)
|
|
|
|
{
|
|
|
|
//print("ClientConnect!\n");
|
|
|
|
}
|
|
|
|
void
|
|
|
|
CGameRules::PlayerDisconnect(entity pl)
|
|
|
|
{
|
|
|
|
//print("ClientDisconnect!\n");
|
|
|
|
}
|
|
|
|
void
|
2020-05-02 20:26:06 -07:00
|
|
|
CGameRules::PlayerKill(base_player pl)
|
2020-04-20 10:25:15 -07:00
|
|
|
{
|
|
|
|
//print("PlayerKill!\n");
|
|
|
|
}
|
|
|
|
void
|
2020-05-02 20:26:06 -07:00
|
|
|
CGameRules::PlayerDeath(base_player pl)
|
2020-04-20 10:25:15 -07:00
|
|
|
{
|
|
|
|
//print("PlayerDeath!\n");
|
|
|
|
}
|
|
|
|
void
|
2020-05-02 20:26:06 -07:00
|
|
|
CGameRules::PlayerPain(base_player pl)
|
2020-04-13 18:12:09 -07:00
|
|
|
{
|
|
|
|
//print("ClientKill!\n");
|
|
|
|
}
|
|
|
|
void
|
2020-05-02 20:26:06 -07:00
|
|
|
CGameRules::PlayerSpawn(base_player pl)
|
2020-04-13 18:12:09 -07:00
|
|
|
{
|
|
|
|
//print("PutClientInServer!\n");
|
|
|
|
}
|
|
|
|
void
|
2020-05-02 20:26:06 -07:00
|
|
|
CGameRules::PlayerPreFrame(base_player pl)
|
2020-04-13 18:12:09 -07:00
|
|
|
{
|
|
|
|
//print("PlayerPreThink!\n");
|
|
|
|
}
|
|
|
|
void
|
2020-05-02 20:26:06 -07:00
|
|
|
CGameRules::PlayerPostFrame(base_player pl)
|
2020-04-13 18:12:09 -07:00
|
|
|
{
|
|
|
|
//print("PlayerPostThink!\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* level transitions */
|
|
|
|
void
|
|
|
|
CGameRules::LevelNewParms(void)
|
|
|
|
{
|
|
|
|
//print("LevelNewParms!\n");
|
|
|
|
}
|
|
|
|
void
|
2020-05-02 20:26:06 -07:00
|
|
|
CGameRules::LevelChangeParms(base_player pl)
|
2020-04-13 18:12:09 -07:00
|
|
|
{
|
|
|
|
//print("LevelChangeParms!\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* spectator */
|
|
|
|
/*void
|
|
|
|
CGameRules::SpectatorConnect(player pl)
|
|
|
|
{
|
|
|
|
//print("SpectatorConnect!\n");
|
|
|
|
}
|
|
|
|
void
|
|
|
|
CGameRules::SpectatorDisconnect(player pl)
|
|
|
|
{
|
|
|
|
//print("SpectatorDisconnect!\n");
|
|
|
|
}
|
|
|
|
void
|
|
|
|
CGameRules::SpectatorThink(player pl)
|
|
|
|
{
|
|
|
|
//print("SpectatorThink!\n");
|
|
|
|
}*/
|
|
|
|
|
2020-04-23 12:02:38 -07:00
|
|
|
int
|
2020-04-23 20:37:54 -07:00
|
|
|
CGameRules::MaxItemPerSlot(int slot)
|
2020-04-23 12:02:38 -07:00
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2020-04-26 04:17:19 -07:00
|
|
|
void
|
|
|
|
CGameRules::IntermissionStart(void)
|
|
|
|
{
|
|
|
|
if (m_iIntermission)
|
|
|
|
return;
|
|
|
|
|
|
|
|
m_iIntermission = TRUE;
|
|
|
|
m_flIntermissionTime = time + 5.0f;
|
|
|
|
|
|
|
|
/* make the clients aware */
|
|
|
|
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
|
|
|
WriteByte(MSG_MULTICAST, EV_INTERMISSION);
|
|
|
|
msg_entity = world;
|
|
|
|
multicast([0,0,0], MULTICAST_ALL);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
CGameRules::IntermissionEnd(void)
|
|
|
|
{
|
|
|
|
if (!m_iIntermission)
|
|
|
|
return;
|
|
|
|
if (time < m_flIntermissionTime)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!(input_buttons & INPUT_BUTTON0) && !(input_buttons & INPUT_BUTTON2))
|
|
|
|
return;
|
|
|
|
|
|
|
|
localcmd("restart\n");
|
|
|
|
}
|
|
|
|
|
2020-04-13 18:12:09 -07:00
|
|
|
void
|
|
|
|
CGameRules::CGameRules(void)
|
|
|
|
{
|
2020-04-23 20:37:54 -07:00
|
|
|
forceinfokey(world, "teamplay", "0");
|
2020-04-13 18:12:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* our currently running mode */
|
|
|
|
CGameRules g_grMode;
|