new WeaponEvent(outcomes [, consumable] [, name])
A game weapon storing possible HungryGames~NormalEvents.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
outcomes |
Array.<HungryGames~NormalEvent> | All possible events in this weapon event. | |
consumable |
string |
<optional> |
The formattable string for what to call this weapons consumable items. |
name |
string |
<optional> |
The formattable name for this weapon. |
- Source:
Extends
Members
-
<static, constant> action :string
-
Default action template.
Type:
- string
- Source:
-
<nullable> consumable :string
-
The formattable string for what to call this weapon's consumable items.
Type:
- string
- Source:
-
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
- Inherited From:
- Overrides:
- Source:
-
custom :boolean
-
If the event is created by the user.
Type:
- boolean
- Inherited From:
- Overrides:
- 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
- Inherited From:
- Overrides:
- Source:
-
message :string
-
The message to show.
Type:
- string
- Inherited From:
- Overrides:
- Source:
-
name :string
-
The formattable string for what to call this weapon.
Type:
- string
- Source:
-
outcomes :Array.<HungryGames~Event>
-
All possible events for this weapon event.
Type:
- Array.<HungryGames~Event>
- Source:
-
subMessage :string
-
Additional message text to send.
Type:
- string
- Inherited From:
- Overrides:
- Source:
-
type :string
-
The type of event this is ('normal', 'arena', 'weapon', or 'battle').
Type:
- string
- Inherited From:
- Overrides:
- Default Value:
-
- normal
- Source:
Methods
-
<static> from(obj)
-
Create a new WeaponEvent object from a WeaponEvent-like object. Similar to copy-constructor.
Parameters:
Name Type Description obj
object Event-like object to copy. - Source:
Returns:
Copy of event. -
<static> validate(evt)
-
Validate that the given data is properly typed and structured to be converted to a WeaponEvent. Also coerces values to correct types if possible.
Parameters:
Name Type Description evt
HungryGames~WeaponEvent 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. - Inherited From:
- Overrides:
- Source:
Returns:
Current instance with copied values.- Type
- HungryGames~Event