Nuclide
Software Development Kit for id Technology (BETA)
ncGameRules Class Reference

About this class

This class represents active gamerules.

Inheritance diagram for ncGameRules:
ncIO

Public Member Functions

void ncGameRules (void)
 
virtual void Save (float)
 Handles saving a copy of this entity to a given filehandle. More...
 
virtual void Restore (string, string)
 Similar to ncIO::SpawnKey() but for save-game fields. More...
 
virtual void RestoreComplete (void)
 Called when the entity has been successfully restored from a savegame file. More...
 
virtual void Input (entity, string, string)
 Called when we are being prompted by another object/function with an input message. More...
 
virtual void InitPostEnts (void)
 Overridable: Called when all map entities have initialized. More...
 
virtual void FrameStart (void)
 Overridable: Called every server frame. More...
 
virtual bool ConsoleCommand (ncPlayer, string)
 Overridable: Called when a client issues a console command. More...
 
virtual bool ClientCommand (ncClient, string)
 Overridable: Called when a client issues a client command. More...
 
virtual bool ImpulseCommand (ncClient, float)
 Overridable: Called when a client issues an impulse command. More...
 
virtual void PlayerConnect (ncPlayer)
 Overridable: Called when a ncPlayer joins the server. More...
 
virtual void PlayerDisconnect (ncPlayer)
 Overridable: Called when a ncPlayer leaves the server. More...
 
virtual void PlayerKill (ncPlayer)
 Overridable: Called when a ncPlayer issues the kill console command. More...
 
virtual void PlayerSpawn (ncPlayer)
 Overridable: Called when a ncPlayer spawns, called sometime after joining. More...
 
virtual void PlayerPreFrame (ncPlayer)
 Overridable: Called before running physics on the ncPlayer in question. More...
 
virtual void PlayerPostFrame (ncPlayer)
 Overridable: Called after running physics on the ncPlayer in question. More...
 
virtual void PlayerDeath (ncPlayer, ncEntity, ncEntity, string)
 Overridable: Called when a ncPlayer dies in the game. More...
 
virtual void PlayerPain (ncPlayer, ncActor, ncDict)
 Overridable: Called when a ncPlayer feels pain. More...
 
virtual bool PlayerCanAttack (ncPlayer)
 Overridable: Called to check if a ncPlayer can attack. More...
 
virtual void NPCDeath (ncActor, ncEntity, ncEntity)
 Overridable:: Called when an NPC gets killed. More...
 
virtual bool PlayerRequestRespawn (ncPlayer)
 Overridable: called when a ncPlayer requests a respawn. More...
 
virtual bool PlayerRequestTeam (ncPlayer, int team)
 Overridable: called when a ncPlayer requests joining a specific team. More...
 
virtual void LevelNewParms (void)
 Overridable: Called to set up new level parms for any ncPlayer. More...
 
virtual void LevelChangeParms (ncPlayer)
 Overridable: Called to store parms for a specific ncPlayer. More...
 
virtual int MaxItemPerSlot (int)
 Overridable: Returns how many items players can carry in a given slot. More...
 
virtual bool MonstersSpawn (void)
 Overridable: Returns if ncMonster or ncTalkMonster entities can spawn. More...
 
virtual void IntermissionStart (void)
 Called when intermission starts. More...
 
virtual void IntermissionCycle (void)
 Called when the intermission system calls a new map. More...
 
virtual void IntermissionEnd (void)
 Called when intermission ends. More...
 
virtual void IntermissionToPlayer (ncPlayer)
 Run to send a specific player to an intermission. More...
 
virtual bool InIntermission (void)
 Returns if the gamerules find themselves in an intermission. More...
 
virtual bool IsTeamplay (void)
 Returns if this gamerule considers itself teamplay oriented. More...
 
virtual bool IsMultiplayer (void)
 Returns if the gamerule is a multiplayer game. More...
 
virtual void ChatMessageAll (ncClient, string)
 Called by Nuclide when the server has received a chat message that is to be distributed amongst all clients, regardless of team. More...
 
virtual void ChatMessageTeam (ncClient, string)
 Called by Nuclide when the server has received a chat message that is to be distributed amongst all clients of the same team. More...
 
virtual string Title (void)
 Returns the title of the gamemode running. More...
 
nonvirtual ncGameRules CreateRules (void)
 

Constructor & Destructor Documentation

◆ ncGameRules()

void ncGameRules::ncGameRules ( void  )

Member Function Documentation

◆ ChatMessageAll()

void ncGameRules::ChatMessageAll ( ncClient  cl,
string  strMessage 
)
virtual

Called by Nuclide when the server has received a chat message that is to be distributed amongst all clients, regardless of team.

◆ ChatMessageTeam()

void ncGameRules::ChatMessageTeam ( ncClient  cl,
string  strMessage 
)
virtual

Called by Nuclide when the server has received a chat message that is to be distributed amongst all clients of the same team.

◆ ClientCommand()

bool ncGameRules::ClientCommand ( ncClient  pl,
string  cmd 
)
virtual

Overridable: Called when a client issues a client command.

◆ ConsoleCommand()

bool ncGameRules::ConsoleCommand ( ncPlayer  pl,
string  cmd 
)
virtual

Overridable: Called when a client issues a console command.

◆ CreateRules()

ncGameRules ncGameRules::CreateRules ( void  )

◆ FrameStart()

void ncGameRules::FrameStart ( void  )
virtual

Overridable: Called every server frame.

◆ ImpulseCommand()

bool ncGameRules::ImpulseCommand ( ncClient  pl,
float  num 
)
virtual

Overridable: Called when a client issues an impulse command.

◆ InIntermission()

bool ncGameRules::InIntermission ( void  )
virtual

Returns if the gamerules find themselves in an intermission.

◆ InitPostEnts()

void ncGameRules::InitPostEnts ( void  )
virtual

Overridable: Called when all map entities have initialized.

◆ Input()

void ncGameRules::Input ( entity  eAct,
string  strInput,
string  strData 
)
virtual

Called when we are being prompted by another object/function with an input message.

Reimplemented from ncIO.

◆ IntermissionCycle()

void ncGameRules::IntermissionCycle ( void  )
virtual

Called when the intermission system calls a new map.

◆ IntermissionEnd()

void ncGameRules::IntermissionEnd ( void  )
virtual

Called when intermission ends.

◆ IntermissionStart()

void ncGameRules::IntermissionStart ( void  )
virtual

Called when intermission starts.

Will send all current players to the intermission screen.

◆ IntermissionToPlayer()

void ncGameRules::IntermissionToPlayer ( ncPlayer  targetPlayer)
virtual

Run to send a specific player to an intermission.

Like when joining late.

◆ IsMultiplayer()

bool ncGameRules::IsMultiplayer ( void  )
virtual

Returns if the gamerule is a multiplayer game.

◆ IsTeamplay()

bool ncGameRules::IsTeamplay ( void  )
virtual

Returns if this gamerule considers itself teamplay oriented.

◆ LevelChangeParms()

void ncGameRules::LevelChangeParms ( ncPlayer  pl)
virtual

Overridable: Called to store parms for a specific ncPlayer.

◆ LevelNewParms()

void ncGameRules::LevelNewParms ( void  )
virtual

Overridable: Called to set up new level parms for any ncPlayer.

◆ MaxItemPerSlot()

int ncGameRules::MaxItemPerSlot ( int  slot)
virtual

Overridable: Returns how many items players can carry in a given slot.

◆ MonstersSpawn()

bool ncGameRules::MonstersSpawn ( void  )
virtual

Overridable: Returns if ncMonster or ncTalkMonster entities can spawn.

◆ NPCDeath()

void ncGameRules::NPCDeath ( ncActor  npc,
ncEntity  attacker,
ncEntity  inflictor 
)
virtual

Overridable:: Called when an NPC gets killed.

◆ PlayerCanAttack()

bool ncGameRules::PlayerCanAttack ( ncPlayer  bp)
virtual

Overridable: Called to check if a ncPlayer can attack.

◆ PlayerConnect()

void ncGameRules::PlayerConnect ( ncPlayer  pl)
virtual

Overridable: Called when a ncPlayer joins the server.

◆ PlayerDeath()

void ncGameRules::PlayerDeath ( ncPlayer  deadPlayer,
ncEntity  inflictor,
ncEntity  attacker,
string  weaponDef 
)
virtual

Overridable: Called when a ncPlayer dies in the game.

◆ PlayerDisconnect()

void ncGameRules::PlayerDisconnect ( ncPlayer  pl)
virtual

Overridable: Called when a ncPlayer leaves the server.

◆ PlayerKill()

void ncGameRules::PlayerKill ( ncPlayer  pl)
virtual

Overridable: Called when a ncPlayer issues the kill console command.

◆ PlayerPain()

void ncGameRules::PlayerPain ( ncPlayer  pl,
ncActor  attacker,
ncDict  damageDecl 
)
virtual

Overridable: Called when a ncPlayer feels pain.

◆ PlayerPostFrame()

void ncGameRules::PlayerPostFrame ( ncPlayer  pl)
virtual

Overridable: Called after running physics on the ncPlayer in question.

◆ PlayerPreFrame()

void ncGameRules::PlayerPreFrame ( ncPlayer  pl)
virtual

Overridable: Called before running physics on the ncPlayer in question.

◆ PlayerRequestRespawn()

bool ncGameRules::PlayerRequestRespawn ( ncPlayer  pl)
virtual

Overridable: called when a ncPlayer requests a respawn.

In a multiplayer game, it'll put you back into the game as a player. In a singleplayer game, it might load the most recent save.

Returns
True/false depending on the respawn succeeded.

◆ PlayerRequestTeam()

bool ncGameRules::PlayerRequestTeam ( ncPlayer  pl,
int  team 
)
virtual

Overridable: called when a ncPlayer requests joining a specific team.

Returns
True/false depending on the team change success.

◆ PlayerSpawn()

void ncGameRules::PlayerSpawn ( ncPlayer  pl)
virtual

Overridable: Called when a ncPlayer spawns, called sometime after joining.

◆ Restore()

void ncGameRules::Restore ( string  strKey,
string  strValue 
)
virtual

Similar to ncIO::SpawnKey() but for save-game fields.

Whatever you write into file handles within your ncIO::Save() method needs to be read back in here.

Reimplemented from ncIO.

◆ RestoreComplete()

void ncGameRules::RestoreComplete ( void  )
virtual

Called when the entity has been successfully restored from a savegame file.

Reimplemented from ncIO.

◆ Save()

void ncGameRules::Save ( float  handle)
virtual

Handles saving a copy of this entity to a given filehandle.

Within you want to use the ncIO::SaveFloat() etc. methods to write the internal member attributes to the specified file handle.

Reimplemented from ncIO.

◆ Title()

string ncGameRules::Title ( void  )
virtual

Returns the title of the gamemode running.


The documentation for this class was generated from the following files: