Nuclide
Software Development Kit for id Technology (BETA)
MapDelegate.h
1/*
2 * Copyright (c) 2016-2020 Marco Cawthorne <marco@icculus.org>
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
14 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
56{
57public:
58 void ncMapDelegate(void);
59
60 virtual void Input(entity, string, string);
61
63 virtual void Precache(void);
64
65 /* logic */
67 virtual void FrameStart(void);
68
69 /* client */
71 virtual void PlayerConnect(ncPlayer);
73 virtual void PlayerDisconnect(ncPlayer);
75 virtual void PlayerSpawn(ncPlayer);
77 virtual void PlayerDeath(ncPlayer, ncEntity, ncEntity, string);
79 virtual void PlayerPain(ncPlayer, ncActor, ncDict);
81 virtual void NPCDeath(ncActor, ncEntity, ncEntity);
82
83 nonvirtual void LinkProgs(void);
84 nonvirtual ncMapDelegate ActiveInstance(void);
85};
86
87/* our currently running mode */
88ncMapDelegate g_grMap;
89var float g_mapCProgs;
90
91#define MAPLINK(x, y, z) x.y = externvalue(g_mapCProgs, z); if (!x.y) { x.y = ncMapDelegate::y; }
92
93void MapC_Init(void);
This entity class represents an object with choreographed/free-form movement.
Definition: Actor.h:93
This class is responsible for handling groups of key/value pairs.
Definition: Dict.h:42
ncEntity is the lowest of the user-accessible entity class.
Definition: Entity.h:75
This class is responsible for handling core entity functionality.
Definition: IO.h:78
This class delegates active MapC logic.
Definition: MapDelegate.h:56
virtual void NPCDeath(ncActor, ncEntity, ncEntity)
Overridable:: Called when an NPC gets killed.
Definition: MapDelegate.qc:49
virtual void PlayerDeath(ncPlayer, ncEntity, ncEntity, string)
Overridable: Called when a ncPlayer dies in the game.
Definition: MapDelegate.qc:54
nonvirtual void LinkProgs(void)
Definition: MapDelegate.qc:76
virtual void PlayerPain(ncPlayer, ncActor, ncDict)
Overridable: Called when a ncPlayer feels pain.
Definition: MapDelegate.qc:59
void ncMapDelegate(void)
Definition: MapDelegate.qc:18
virtual void PlayerDisconnect(ncPlayer)
Overridable: Called when a ncPlayer leaves the server.
Definition: MapDelegate.qc:44
virtual void PlayerConnect(ncPlayer)
Overridable: Called when a ncPlayer joins the server.
Definition: MapDelegate.qc:39
virtual void Input(entity, string, string)
Called when we are being prompted by another object/function with an input message.
Definition: MapDelegate.qc:23
virtual void FrameStart(void)
Overridable: Called every server frame.
Definition: MapDelegate.qc:33
virtual void Precache(void)
Overridable: Called from initents().
Definition: MapDelegate.qc:28
virtual void PlayerSpawn(ncPlayer)
Overridable: Called when a ncPlayer spawns, called sometime after joining.
Definition: MapDelegate.qc:64
nonvirtual ncMapDelegate ActiveInstance(void)
Definition: MapDelegate.qc:70
This entity class represents every player client.
Definition: Player.h:142