Class: ActionStore

HungryGames~ ActionStore


new ActionStore()

Manages game action firing and listeners.
Source:

Members


dayEnd :Array.<HungryGames~Action>

Fired after a day has ended. Does not fire if game has ended.
Type:
Default Value:
  • ["","",""]
Source:

dayPlayerAlive :Array.<HungryGames~MemberAction>

Fired for all players who end day alive.
Type:
Default Value:
  • []
Source:

dayPlayerDead :Array.<HungryGames~MemberAction>

Fired for all players who end day dead.
Type:
Default Value:
  • []
Source:

dayPlayerWounded :Array.<HungryGames~MemberAction>

Fired for all players who end day wounded.
Type:
Default Value:
  • []
Source:

dayStart :Array.<HungryGames~Action>

Fired prior to the day starting.
Type:
Default Value:
  • [""]
Source:

eventInstant :Array.<HungryGames~Action>

Fired as the event message being sent.
Type:
Default Value:
  • [""]
Source:

eventPlayerAffected :Array.<HungryGames~MemberAction>

Fired during the event for all players.
Type:
Default Value:
  • []
Source:

eventPlayerDeath :Array.<HungryGames~MemberAction>

Fired during the event if players get killed.
Type:
Default Value:
  • []
Source:

eventPlayerGainWeapon :Array.<HungryGames~MemberAction>

Fired during the event if players gain weapons.
Type:
Default Value:
  • []
Source:

eventPlayerHealed :Array.<HungryGames~MemberAction>

Fired during the event if players get healed.
Type:
Default Value:
  • []
Source:

eventPlayerKilled :Array.<HungryGames~MemberAction>

Fired during the event if players kill another player.
Type:
Default Value:
  • []
Source:

eventPlayerLoseWeapon :Array.<HungryGames~MemberAction>

Fired during the event if players lose weapons.
Type:
Default Value:
  • []
Source:

eventPlayerRevive :Array.<HungryGames~MemberAction>

Fired during the event if players get revived.
Type:
Default Value:
  • []
Source:

eventPlayerUnAffected :Array.<HungryGames~MemberAction>

Fired during the event if player state is not changed for a player.
Type:
Default Value:
  • []
Source:

eventPlayerUseWeapon :Array.<HungryGames~MemberAction>

Fired during the event if players use their weapon.
Type:
Default Value:
  • []
Source:

eventPlayerWound :Array.<HungryGames~MemberAction>

Fired during the event if players get wounded.
Type:
Default Value:
  • []
Source:

gameAbort :Array.<HungryGames~Action>

Fired after the game has aborted.
Type:
Default Value:
  • []
Source:

gameEnd :Array.<HungryGames~Action>

Fired after the game has ended.
Type:
Default Value:
  • ["","",""]
Source:

gamePlayerAlive :Array.<HungryGames~MemberAction>

Fired for all player who end the game alive.
Type:
Default Value:
  • []
Source:

gamePlayerDead :Array.<HungryGames~MemberAction>

Fired for all player who end the game dead.
Type:
Default Value:
  • []
Source:

gamePlayerLose :Array.<HungryGames~MemberAction>

Fired for all player who lost the game.
Type:
Default Value:
  • []
Source:

gamePlayerWin :Array.<HungryGames~MemberAction>

Fired for all player who won the game.
Type:
Default Value:
  • []
Source:

gamePlayerWounded :Array.<HungryGames~MemberAction>

Fired for all player who end the game wounded.
Type:
Default Value:
  • []
Source:

gameStart :Array.<HungryGames~Action>

Fired prior to the game starting.
Type:
Default Value:
  • []
Source:

serializable

Get a serializable version of this class instance. Strips all private variables, and all functions. Assumes all public variables are serializable if they aren't a function.
Source:

Methods


<static> from(client, id, obj)

Convert a serialized action store back into the object.
Parameters:
Name Type Description
client Discord~Client Client reference for obtaining discord object references.
id string The Guild ID this action store is for.
obj object Parsed data from save file.
Source:
Returns:
Parsed object data.
Type
HungryGames~ActionStore

insert(name, action)

Insert an action for a trigger.
Parameters:
Name Type Description
name string The name of the trigger to insert the action.
action HungryGames~Action The action to insert.
Source:
Returns:
True if success, false if unable to find trigger by given name.
Type
boolean

remove(name, id)

Remove an action from a trigger.
Parameters:
Name Type Description
name string The name of the trigger to remove from.
id string The id of the action to remove.
Source:
Returns:
The removed action, or null if unable to find action.
Type
Action