Class: Event

HungryGames~ Event

Event that can happen in a game.

new Event(message)

HungryGames Event base.
Parameters:
Name Type Description
message string The message to show.
Source:

Members


creator :string

The id of the user that created this event. If not defined, then something is broken. Default global events use SpikeyRobot's ID.
Type:
  • string
Source:

custom :boolean

If the event is created by the user.
Type:
  • boolean
Default Value:
  • true
Source:

<constant> id :string

The full unique ID of this event. If not specified, this generates just the 32 bit short hash.
Type:
  • string
Source:

message :string

The message to show.
Type:
  • string
Source:

subMessage :string

Additional message text to send.
Type:
  • string
Source:

type :string

The type of event this is ('normal', 'arena', 'weapon', or 'battle').
Type:
  • string
Default Value:
  • normal
Source:

Methods


<static> createIDHash()

Generate the trailing hash portion of Event IDs.
Source:
Returns:
Generated hash.
Type
string

<static> finalizeSimple(message [, game])

Make an event that doesn't affect any players and is just a plain message.
Parameters:
Name Type Argument Description
message string The message to show.
game HungryGames~GuildGame <optional>
The GuildGame to make this event for. This is to check options and fetch players that may be necessary.
Source:
Returns:
The event that was created.
Type
HungryGames~FinalEvent

<static> validate(evt)

Validate that the given data is properly typed and structured to be converted to an Event. Also coerces values to correct types if possible.
Parameters:
Name Type Description
evt HungryGames~Event The event data to verify.
Source:
Returns:
Error string, or null if no error.
Type
string

fill(obj)

Fill this instance with data from Event-like object.
Parameters:
Name Type Description
obj object Event-like object to copy.
Source:
Returns:
Current instance with copied values.
Type
HungryGames~Event