Nuclide
Software Development Kit for id Technology
NSGameRules Class Reference

About this class

This class represents active gamerules.

Inheritance diagram for NSGameRules:
NSIO

Public Member Functions

void NSGameRules (void)
 
virtual void Save (float)
 Handles saving a copy of this entity to a given filehandle. More...
 
virtual void Restore (string, string)
 Similar to NSIO::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 (NSClientPlayer, string)
 Overridable: Called when a client issues a console command. More...
 
virtual bool ClientCommand (NSClient, string)
 Overridable: Called when a client issues a client command. More...
 
virtual bool ImpulseCommand (NSClient, float)
 Overridable: Called when a client issues an impulse command. More...
 
virtual void PlayerConnect (NSClientPlayer)
 Overridable: Called when a NSClientPlayer joins the server. More...
 
virtual void PlayerDisconnect (NSClientPlayer)
 Overridable: Called when a NSClientPlayer leaves the server. More...
 
virtual void PlayerKill (NSClientPlayer)
 Overridable: Called when a NSClientPlayer issues the kill console command. More...
 
virtual void PlayerSpawn (NSClientPlayer)
 Overridable: Called when a NSClientPlayer spawns, called sometime after joining. More...
 
virtual void PlayerPreFrame (NSClientPlayer)
 Overridable: Called before running physics on the NSClientPlayer in question. More...
 
virtual void PlayerPostFrame (NSClientPlayer)
 Overridable: Called after running physics on the NSClientPlayer in question. More...
 
virtual void PlayerDeath (NSClientPlayer, NSEntity, NSEntity, string)
 Overridable: Called when a NSClientPlayer dies in the game. More...
 
virtual void PlayerPain (NSClientPlayer, NSActor, NSDict)
 Overridable: Called when a NSClientPlayer feels pain. More...
 
virtual bool PlayerCanAttack (NSClientPlayer)
 Overridable: Called to check if a NSClientPlayer can attack. More...
 
virtual void NPCDeath (NSActor, NSEntity, NSEntity)
 Overridable:: Called when an NPC gets killed. More...
 
virtual bool PlayerRequestRespawn (NSClientPlayer)
 Overridable: called when a NSClientPlayer requests a respawn. More...
 
virtual bool PlayerRequestTeam (NSClientPlayer, int team)
 Overridable: called when a NSClientPlayer requests joining a specific team. More...
 
virtual void LevelNewParms (void)
 Overridable: Called to set up new level parms for any NSClientPlayer. More...
 
virtual void LevelChangeParms (NSClientPlayer)
 Overridable: Called to store parms for a specific NSClientPlayer. 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 NSMonster or NSTalkMonster 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 (NSClientPlayer)
 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 (NSClient, 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 (NSClient, 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 NSGameRules InitFromProgs (string pathToProgs)
 

Constructor & Destructor Documentation

◆ NSGameRules()

void NSGameRules::NSGameRules ( void  )

Member Function Documentation

◆ ChatMessageAll()

void NSGameRules::ChatMessageAll ( NSClient  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 NSGameRules::ChatMessageTeam ( NSClient  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 NSGameRules::ClientCommand ( NSClient  pl,
string  cmd 
)
virtual

Overridable: Called when a client issues a client command.

◆ ConsoleCommand()

bool NSGameRules::ConsoleCommand ( NSClientPlayer  pl,
string  cmd 
)
virtual

Overridable: Called when a client issues a console command.

◆ FrameStart()

void NSGameRules::FrameStart ( void  )
virtual

Overridable: Called every server frame.

◆ ImpulseCommand()

bool NSGameRules::ImpulseCommand ( NSClient  pl,
float  num 
)
virtual

Overridable: Called when a client issues an impulse command.

◆ InIntermission()

bool NSGameRules::InIntermission ( void  )
virtual

Returns if the gamerules find themselves in an intermission.

◆ InitFromProgs()

NSGameRules NSGameRules::InitFromProgs ( string  pathToProgs)

◆ InitPostEnts()

void NSGameRules::InitPostEnts ( void  )
virtual

Overridable: Called when all map entities have initialized.

◆ Input()

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

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

Reimplemented from NSIO.

◆ IntermissionCycle()

void NSGameRules::IntermissionCycle ( void  )
virtual

Called when the intermission system calls a new map.

◆ IntermissionEnd()

void NSGameRules::IntermissionEnd ( void  )
virtual

Called when intermission ends.

◆ IntermissionStart()

void NSGameRules::IntermissionStart ( void  )
virtual

Called when intermission starts.

Will send all current players to the intermission screen.

◆ IntermissionToPlayer()

void NSGameRules::IntermissionToPlayer ( NSClientPlayer  targetPlayer)
virtual

Run to send a specific player to an intermission.

Like when joining late.

◆ IsMultiplayer()

bool NSGameRules::IsMultiplayer ( void  )
virtual

Returns if the gamerule is a multiplayer game.

◆ IsTeamplay()

bool NSGameRules::IsTeamplay ( void  )
virtual

Returns if this gamerule considers itself teamplay oriented.

◆ LevelChangeParms()

void NSGameRules::LevelChangeParms ( NSClientPlayer  pl)
virtual

Overridable: Called to store parms for a specific NSClientPlayer.

◆ LevelNewParms()

void NSGameRules::LevelNewParms ( void  )
virtual

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

◆ MaxItemPerSlot()

int NSGameRules::MaxItemPerSlot ( int  slot)
virtual

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

◆ MonstersSpawn()

bool NSGameRules::MonstersSpawn ( void  )
virtual

Overridable: Returns if NSMonster or NSTalkMonster entities can spawn.

◆ NPCDeath()

void NSGameRules::NPCDeath ( NSActor  npc,
NSEntity  attacker,
NSEntity  inflictor 
)
virtual

Overridable:: Called when an NPC gets killed.

◆ PlayerCanAttack()

bool NSGameRules::PlayerCanAttack ( NSClientPlayer  bp)
virtual

Overridable: Called to check if a NSClientPlayer can attack.

◆ PlayerConnect()

void NSGameRules::PlayerConnect ( NSClientPlayer  pl)
virtual

Overridable: Called when a NSClientPlayer joins the server.

◆ PlayerDeath()

void NSGameRules::PlayerDeath ( NSClientPlayer  deadPlayer,
NSEntity  inflictor,
NSEntity  attacker,
string  weaponDef 
)
virtual

Overridable: Called when a NSClientPlayer dies in the game.

◆ PlayerDisconnect()

void NSGameRules::PlayerDisconnect ( NSClientPlayer  pl)
virtual

Overridable: Called when a NSClientPlayer leaves the server.

◆ PlayerKill()

void NSGameRules::PlayerKill ( NSClientPlayer  pl)
virtual

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

◆ PlayerPain()

void NSGameRules::PlayerPain ( NSClientPlayer  pl,
NSActor  attacker,
NSDict  damageDecl 
)
virtual

Overridable: Called when a NSClientPlayer feels pain.

◆ PlayerPostFrame()

void NSGameRules::PlayerPostFrame ( NSClientPlayer  pl)
virtual

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

◆ PlayerPreFrame()

void NSGameRules::PlayerPreFrame ( NSClientPlayer  pl)
virtual

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

◆ PlayerRequestRespawn()

bool NSGameRules::PlayerRequestRespawn ( NSClientPlayer  pl)
virtual

Overridable: called when a NSClientPlayer 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 NSGameRules::PlayerRequestTeam ( NSClientPlayer  pl,
int  team 
)
virtual

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

Returns
True/false depending on the team change success.

◆ PlayerSpawn()

void NSGameRules::PlayerSpawn ( NSClientPlayer  pl)
virtual

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

◆ Restore()

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

Similar to NSIO::SpawnKey but for save-game fields.

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

Reimplemented from NSIO.

◆ RestoreComplete()

void NSGameRules::RestoreComplete ( void  )
virtual

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

Reimplemented from NSIO.

◆ Save()

void NSGameRules::Save ( float  handle)
virtual

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

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

Reimplemented from NSIO.

◆ Title()

string NSGameRules::Title ( void  )
virtual

Returns the title of the gamemode running.


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