Class: Game_CommonEvent

Inherits:
Object
  • Object
show all
Defined in:
Game_CommonEvent.rb

Overview

** Game_CommonEvent


This class handles common events. It includes functionality for execution of

parallel process events. It's used within the Game_Map class ($game_map).

Instance Method Summary (collapse)

Constructor Details

- (Game_CommonEvent) initialize(common_event_id)


  • Object Initialization




12
13
14
15
# File 'Game_CommonEvent.rb', line 12

def initialize(common_event_id)
  @event = $data_common_events[common_event_id]
  refresh
end

Instance Method Details

- (Boolean) active?


  • Determine if Active State


Returns:

  • (Boolean)


29
30
31
# File 'Game_CommonEvent.rb', line 29

def active?
  @event.parallel? && $game_switches[@event.switch_id]
end

- (Object) refresh


  • Refresh




19
20
21
22
23
24
25
# File 'Game_CommonEvent.rb', line 19

def refresh
  if active?
    @interpreter ||= Game_Interpreter.new
  else
    @interpreter = nil
  end
end

- (Object) update


  • Frame Update




35
36
37
38
39
40
# File 'Game_CommonEvent.rb', line 35

def update
  if @interpreter
    @interpreter.setup(@event.list) unless @interpreter.running?
    @interpreter.update
  end
end