Class: Battle

HungryGames~ Battle


new Battle(message, attacker, victim)

Create a single battle.
Parameters:
Name Type Description
message string The message of this battle event.
attacker number The damage done to the attacker.
victim number The damage done to the victim.
Source:

Extends

Members


<private, static, readonly> _fistBoth

The file path to read attacking both directions image.
Source:

<private, static, readonly> _fistLeft

The file path to read attacking left image.
Source:

<private, static, readonly> _fistRight

The file path to read attacking right image.
Source:

attacker :Object

Information about attacker.
Type:
  • Object
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:

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:

victim :Object

Information about victim.
Type:
  • Object
Source:

Methods


<static> finalize(affectedUsers, numVictim, numAttacker, mention, game, battles)

Make an event that contains a battle between players before the main event message.
Parameters:
Name Type Description
affectedUsers Array.<HungryGames~Player> All of the players involved in the event.
numVictim number The number of victims in this event.
numAttacker number The number of attackers in this event.
mention boolean Should every player be mentioned when their name comes up?
game HungryGames~GuildGame The GuildGame this battle is for. This is for settings checking and fetching non-affected users.
battles Array.<HungryGames~Battle> Array of all possible battle events to choose from.
Source:
Returns:
The event that was created.
Type
HungryGames~NormalEvent

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