Class: Australium::Trigger

Inherits:
Event show all
Defined in:
lib/australium/events/trigger.rb

Overview

A Trigger Event is a very general Event. Triggers occur on point capture, round end, even damage and healing with plugins installed. Depending on the kind of trigger, it could involve one player, two players, or no players at all (in the case of 'World' triggering an event, such as a round end).

Constant Summary collapse

LOG_REGEX =
/: "?(?<initiator>.*(World|>))"? triggered "(?<action>[^"]+)"(?: against "(?<target>.+>)")?/

Constants inherited from Event

Event::PROPERTY_REGEX, Event::TIMESTAMP_FORMAT, Event::TIMESTAMP_REGEX

Instance Attribute Summary collapse

Attributes inherited from Event

#raw

Instance Method Summary collapse

Methods inherited from Event

inherited, #to_s

Methods inherited from OpenStruct

#initialize_clone

Constructor Details

#initialize(data) ⇒ Trigger


16
17
18
19
20
21
22
# File 'lib/australium/events/trigger.rb', line 16

def initialize(data)
  super(data)
  if initiator.is_a?(Player)
    initiator[:connected?, timestamp] = true
    initiator[:in_game?, timestamp] = true
  end
end

Instance Attribute Details

#actionString


16
17
18
19
20
21
22
# File 'lib/australium/events/trigger.rb', line 16

def initialize(data)
  super(data)
  if initiator.is_a?(Player)
    initiator[:connected?, timestamp] = true
    initiator[:in_game?, timestamp] = true
  end
end

#initiatorPlayer, String


16
17
18
19
20
21
22
# File 'lib/australium/events/trigger.rb', line 16

def initialize(data)
  super(data)
  if initiator.is_a?(Player)
    initiator[:connected?, timestamp] = true
    initiator[:in_game?, timestamp] = true
  end
end

#targetPlayer, NilClass


16
17
18
19
20
21
22
# File 'lib/australium/events/trigger.rb', line 16

def initialize(data)
  super(data)
  if initiator.is_a?(Player)
    initiator[:connected?, timestamp] = true
    initiator[:in_game?, timestamp] = true
  end
end