Class: Game_System

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

Overview

** Game_System


This class handles system data. It saves the disable state of saving and

menus. Instances of this class are referenced by $game_system.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Game_System) initialize


  • Object Initialization




22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'Game_System.rb', line 22

def initialize
  @save_disabled = false
  @menu_disabled = false
  @encounter_disabled = false
  @formation_disabled = false
  @battle_count = 0
  @save_count = 0
  @version_id = 0
  @window_tone = nil
  @battle_bgm = nil
  @battle_end_me = nil
  @saved_bgm = nil
end

Instance Attribute Details

- (Object) battle_count

battle count



16
17
18
# File 'Game_System.rb', line 16

def battle_count
  @battle_count
end

- (Object) encounter_disabled

encounter forbidden



14
15
16
# File 'Game_System.rb', line 14

def encounter_disabled
  @encounter_disabled
end

- (Object) formation_disabled

formation change forbidden



15
16
17
# File 'Game_System.rb', line 15

def formation_disabled
  @formation_disabled
end

menu forbidden



13
14
15
# File 'Game_System.rb', line 13

def menu_disabled
  @menu_disabled
end

- (Object) save_count (readonly)

save count



17
18
19
# File 'Game_System.rb', line 17

def save_count
  @save_count
end

- (Object) save_disabled


  • Public Instance Variables




12
13
14
# File 'Game_System.rb', line 12

def save_disabled
  @save_disabled
end

- (Object) version_id (readonly)

game version ID



18
19
20
# File 'Game_System.rb', line 18

def version_id
  @version_id
end

Instance Method Details

- (Object) battle_bgm


  • Get Battle BGM




56
57
58
# File 'Game_System.rb', line 56

def battle_bgm
  @battle_bgm || $data_system.battle_bgm
end

- (Object) battle_bgm=(battle_bgm)


  • Set Battle BGM




62
63
64
# File 'Game_System.rb', line 62

def battle_bgm=(battle_bgm)
  @battle_bgm = battle_bgm
end

- (Object) battle_end_me


  • Get Battle End ME




68
69
70
# File 'Game_System.rb', line 68

def battle_end_me
  @battle_end_me || $data_system.battle_end_me
end

- (Object) battle_end_me=(battle_end_me)


  • Set Battle End ME




74
75
76
# File 'Game_System.rb', line 74

def battle_end_me=(battle_end_me)
  @battle_end_me = battle_end_me
end

- (Boolean) japanese?


  • Determine if Japanese Mode


Returns:

  • (Boolean)


38
39
40
# File 'Game_System.rb', line 38

def japanese?
  $data_system.japanese
end

- (Object) on_after_load


  • Post-Load Processing




90
91
92
93
94
# File 'Game_System.rb', line 90

def on_after_load
  Graphics.frame_count = @frames_on_save
  @bgm_on_save.play
  @bgs_on_save.play
end

- (Object) on_before_save


  • Pre-Save Processing




80
81
82
83
84
85
86
# File 'Game_System.rb', line 80

def on_before_save
  @save_count += 1
  @version_id = $data_system.version_id
  @frames_on_save = Graphics.frame_count
  @bgm_on_save = RPG::BGM.last
  @bgs_on_save = RPG::BGS.last
end

- (Object) playtime


  • Get Play Time in Seconds




98
99
100
# File 'Game_System.rb', line 98

def playtime
  Graphics.frame_count / Graphics.frame_rate
end

- (Object) playtime_s


  • Get Play Time in Character String




104
105
106
107
108
109
# File 'Game_System.rb', line 104

def playtime_s
  hour = playtime / 60 / 60
  min = playtime / 60 % 60
  sec = playtime % 60
  sprintf("%02d:%02d:%02d", hour, min, sec)
end

- (Object) replay_bgm


  • Resume BGM




119
120
121
# File 'Game_System.rb', line 119

def replay_bgm
  @saved_bgm.replay if @saved_bgm
end

- (Object) save_bgm


  • Save BGM




113
114
115
# File 'Game_System.rb', line 113

def save_bgm
  @saved_bgm = RPG::BGM.last
end

- (Object) window_tone


  • Get Window Color




44
45
46
# File 'Game_System.rb', line 44

def window_tone
  @window_tone || $data_system.window_tone
end

- (Object) window_tone=(window_tone)


  • Set Window Color




50
51
52
# File 'Game_System.rb', line 50

def window_tone=(window_tone)
  @window_tone = window_tone
end