rgss_db 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +5 -0
  3. data/COPYING.md +674 -0
  4. data/README.md +347 -0
  5. data/bin/rgss-db +4 -0
  6. data/bin/rgssdb +4 -0
  7. data/lib/rgss_db/app.rb +928 -0
  8. data/lib/rgss_db/controller/data_manager.rb +557 -0
  9. data/lib/rgss_db/model/data_file.rb +516 -0
  10. data/lib/rgss_db/model/data_file_factory.rb +94 -0
  11. data/lib/rgss_db/model/debug.rb +199 -0
  12. data/lib/rgss_db/model/errors.rb +17 -0
  13. data/lib/rgss_db/model/mixins/jsonable.rb +35 -0
  14. data/lib/rgss_db/model/mixins/jsonable_constructor.rb +40 -0
  15. data/lib/rgss_db/model/rpg_maker_data/vx/rgss/color.rb +72 -0
  16. data/lib/rgss_db/model/rpg_maker_data/vx/rgss/rect.rb +70 -0
  17. data/lib/rgss_db/model/rpg_maker_data/vx/rgss/table.rb +99 -0
  18. data/lib/rgss_db/model/rpg_maker_data/vx/rgss/tone.rb +72 -0
  19. data/lib/rgss_db/model/rpg_maker_data/vx/rgss.rb +11 -0
  20. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/actor.rb +44 -0
  21. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/animation.rb +31 -0
  22. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/animation_frame.rb +20 -0
  23. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/animation_timing.rb +23 -0
  24. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/area.rb +26 -0
  25. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/armor.rb +31 -0
  26. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/audio_file.rb +23 -0
  27. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/base_item.rb +25 -0
  28. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/bgm.rb +36 -0
  29. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/bgs.rb +36 -0
  30. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/class.rb +31 -0
  31. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/class_learning.rb +20 -0
  32. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/common_event.rb +25 -0
  33. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/enemy.rb +44 -0
  34. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/enemy_action.rb +29 -0
  35. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/enemy_drop_item.rb +23 -0
  36. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/event.rb +36 -0
  37. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/event_command.rb +19 -0
  38. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/event_page.rb +32 -0
  39. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/event_page_condition.rb +34 -0
  40. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/event_page_graphic.rb +25 -0
  41. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/item.rb +27 -0
  42. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/map.rb +47 -0
  43. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/map_info.rb +26 -0
  44. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/me.rb +27 -0
  45. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/move_command.rb +18 -0
  46. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/move_route.rb +20 -0
  47. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/se.rb +21 -0
  48. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/skill.rb +22 -0
  49. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/state.rb +47 -0
  50. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/system.rb +43 -0
  51. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/system_terms.rb +53 -0
  52. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/system_test_battler.rb +25 -0
  53. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/system_vehicle.rb +24 -0
  54. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/troop.rb +24 -0
  55. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/troop_member.rb +23 -0
  56. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/troop_page.rb +21 -0
  57. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/troop_page_condition.rb +33 -0
  58. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb +87 -0
  59. data/lib/rgss_db/model/rpg_maker_data/vx/rpg/weapon.rb +31 -0
  60. data/lib/rgss_db/model/rpg_maker_data/vx/rpg.rb +59 -0
  61. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rgss/color.rb +72 -0
  62. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rgss/rect.rb +70 -0
  63. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rgss/table.rb +99 -0
  64. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rgss/tone.rb +72 -0
  65. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rgss.rb +11 -0
  66. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/actor.rb +27 -0
  67. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/animation.rb +31 -0
  68. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/animation_frame.rb +23 -0
  69. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/animation_timing.rb +26 -0
  70. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/armor.rb +20 -0
  71. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/audio_file.rb +23 -0
  72. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/base_item.rb +31 -0
  73. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/base_item_feature.rb +29 -0
  74. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/bgm.rb +43 -0
  75. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/bgs.rb +43 -0
  76. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/class.rb +37 -0
  77. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/class_learning.rb +24 -0
  78. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/common_event.rb +33 -0
  79. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/enemy.rb +27 -0
  80. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/enemy_action.rb +26 -0
  81. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/enemy_drop_item.rb +24 -0
  82. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/equip_item.rb +19 -0
  83. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/event.rb +36 -0
  84. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/event_command.rb +19 -0
  85. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/event_page.rb +35 -0
  86. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/event_page_condition.rb +40 -0
  87. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/event_page_graphic.rb +31 -0
  88. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/item.rb +25 -0
  89. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/map.rb +58 -0
  90. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/map_encounter.rb +23 -0
  91. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/map_info.rb +26 -0
  92. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/me.rb +27 -0
  93. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/move_command.rb +17 -0
  94. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/move_route.rb +19 -0
  95. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/se.rb +21 -0
  96. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/skill.rb +25 -0
  97. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/state.rb +34 -0
  98. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/system.rb +62 -0
  99. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/system_terms.rb +25 -0
  100. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/system_test_battler.rb +24 -0
  101. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/system_vehicle.rb +27 -0
  102. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/tileset.rb +26 -0
  103. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/troop.rb +24 -0
  104. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/troop_member.rb +25 -0
  105. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/troop_page.rb +24 -0
  106. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/troop_page_condition.rb +39 -0
  107. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/usable_item.rb +84 -0
  108. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/usable_item_damage.rb +56 -0
  109. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/usable_item_effect.rb +25 -0
  110. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/weapon.rb +25 -0
  111. data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg.rb +66 -0
  112. data/lib/rgss_db/model/rpg_maker_data/xp/rgss/color.rb +72 -0
  113. data/lib/rgss_db/model/rpg_maker_data/xp/rgss/rect.rb +70 -0
  114. data/lib/rgss_db/model/rpg_maker_data/xp/rgss/table.rb +99 -0
  115. data/lib/rgss_db/model/rpg_maker_data/xp/rgss/tone.rb +72 -0
  116. data/lib/rgss_db/model/rpg_maker_data/xp/rgss.rb +11 -0
  117. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/actor.rb +44 -0
  118. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/animation.rb +28 -0
  119. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/animation_frame.rb +20 -0
  120. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/animation_timing.rb +24 -0
  121. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/armor.rb +37 -0
  122. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/audio_file.rb +23 -0
  123. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/class.rb +28 -0
  124. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/class_learning.rb +20 -0
  125. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/common_event.rb +25 -0
  126. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/enemy.rb +47 -0
  127. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/enemy_action.rb +28 -0
  128. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/event.rb +36 -0
  129. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/event_command.rb +19 -0
  130. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/event_page.rb +32 -0
  131. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/event_page_condition.rb +30 -0
  132. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/event_page_graphic.rb +27 -0
  133. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb +48 -0
  134. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/map.rb +39 -0
  135. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/map_info.rb +26 -0
  136. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/move_command.rb +18 -0
  137. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/move_route.rb +19 -0
  138. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/skill.rb +47 -0
  139. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/state.rb +51 -0
  140. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/system.rb +56 -0
  141. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/system_test_battler.rb +25 -0
  142. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/system_words.rb +39 -0
  143. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/tileset.rb +39 -0
  144. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/troop.rb +24 -0
  145. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/troop_member.rb +23 -0
  146. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/troop_page.rb +21 -0
  147. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/troop_page_condition.rb +32 -0
  148. data/lib/rgss_db/model/rpg_maker_data/xp/rpg/weapon.rb +38 -0
  149. data/lib/rgss_db/model/rpg_maker_data/xp/rpg.rb +52 -0
  150. data/lib/rgss_db/model/strings.rb +607 -0
  151. data/lib/rgss_db/model/utilities.rb +90 -0
  152. data/lib/rgss_db/version.rb +7 -0
  153. data/lib/rgss_db/view/app_cli.rb +449 -0
  154. data/lib/rgss_db.rb +41 -0
  155. data/sig/rgss_db.rbs +5221 -0
  156. metadata +496 -0
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for the Move route.
6
+ #
7
+ class MoveRoute
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize
12
+ @repeat = true
13
+ @skippable = false
14
+ @wait = false
15
+ @list = [RPG::MoveCommand.new]
16
+ end
17
+
18
+ attr_accessor :repeat, :skippable, :wait, :list
19
+ end
20
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for SE. This class has a method to play oneself with Audio module.
6
+ #
7
+ class SE < AudioFile
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def play
12
+ return if @name.empty?
13
+
14
+ Audio.se_play("Audio/SE/" + @name, @volume, @pitch)
15
+ end
16
+
17
+ def self.stop
18
+ Audio.se_stop
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for skills.
6
+ #
7
+ class Skill < UsableItem
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize
12
+ super
13
+ @scope = 1
14
+ @mp_cost = 0
15
+ @hit = 100
16
+ @message1 = ""
17
+ @message2 = ""
18
+ end
19
+
20
+ attr_accessor :mp_cost, :hit, :message1, :message2
21
+ end
22
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for state.
6
+ #
7
+ class State
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize
12
+ @id = 0
13
+ @name = ""
14
+ @icon_index = 0
15
+ @restriction = 0
16
+ @priority = 5
17
+ @atk_rate = 100
18
+ @def_rate = 100
19
+ @spi_rate = 100
20
+ @agi_rate = 100
21
+ @nonresistance = false
22
+ @offset_by_opposite = false
23
+ @slip_damage = false
24
+ @reduce_hit_ratio = false
25
+ @battle_only = true
26
+ @release_by_damage = false
27
+ @hold_turn = 0
28
+ @auto_release_prob = 0
29
+ @message1 = ""
30
+ @message2 = ""
31
+ @message3 = ""
32
+ @message4 = ""
33
+ @element_set = []
34
+ @state_set = []
35
+ @note = ""
36
+ end
37
+
38
+ def to_s
39
+ @name.to_s
40
+ end
41
+
42
+ attr_accessor :id, :name, :icon_index, :restriction, :priority, :atk_rate, :def_rate, :spi_rate, :agi_rate,
43
+ :nonresistance, :offset_by_opposite, :slip_damage, :reduce_hit_ratio, :battle_only,
44
+ :release_by_damage, :hold_turn, :auto_release_prob, :message1, :message2,
45
+ :message3, :message4, :element_set, :state_set, :note
46
+ end
47
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for the system.
6
+ #
7
+ class System
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize
12
+ @game_title = ""
13
+ @version_id = 0
14
+ @party_members = [1]
15
+ @elements = [nil, ""]
16
+ @switches = [nil, ""]
17
+ @variables = [nil, ""]
18
+ @passages = Table.new(8192)
19
+ @boat = RPG::System::Vehicle.new
20
+ @ship = RPG::System::Vehicle.new
21
+ @airship = RPG::System::Vehicle.new
22
+ @title_bgm = RPG::BGM.new
23
+ @battle_bgm = RPG::BGM.new
24
+ @battle_end_me = RPG::ME.new
25
+ @gameover_me = RPG::ME.new
26
+ @sounds = []
27
+ 20.times { @sounds.push(RPG::AudioFile.new) }
28
+ @test_battlers = []
29
+ @test_troop_id = 1
30
+ @start_map_id = 1
31
+ @start_x = 0
32
+ @start_y = 0
33
+ @terms = RPG::System::Terms.new
34
+ @battler_name = ""
35
+ @battler_hue = 0
36
+ @edit_map_id = 1
37
+ end
38
+
39
+ attr_accessor :game_title, :version_id, :party_members, :elements, :switches, :variables, :passages, :boat, :ship,
40
+ :airship, :title_bgm, :battle_bgm, :battle_end_me, :gameover_me, :sounds, :test_battlers,
41
+ :test_troop_id, :start_map_id, :start_x, :start_y, :terms, :battler_name, :battler_hue, :edit_map_id
42
+ end
43
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ class System
5
+ #
6
+ # Data class for terminology.
7
+ #
8
+ class Terms
9
+ include RgssDb::Jsonable
10
+ extend RgssDb::JsonableConstructor
11
+
12
+ def initialize
13
+ @level = ""
14
+ @level_a = ""
15
+ @hp = ""
16
+ @hp_a = ""
17
+ @mp = ""
18
+ @mp_a = ""
19
+ @atk = ""
20
+ @def = ""
21
+ @spi = ""
22
+ @agi = ""
23
+ @weapon = ""
24
+ @armor1 = ""
25
+ @armor2 = ""
26
+ @armor3 = ""
27
+ @armor4 = ""
28
+ @weapon1 = ""
29
+ @weapon2 = ""
30
+ @attack = ""
31
+ @skill = ""
32
+ @guard = ""
33
+ @item = ""
34
+ @equip = ""
35
+ @status = ""
36
+ @save = ""
37
+ @game_end = ""
38
+ @fight = ""
39
+ @escape = ""
40
+ @new_game = ""
41
+ @continue = ""
42
+ @shutdown = ""
43
+ @to_title = ""
44
+ @cancel = ""
45
+ @gold = ""
46
+ end
47
+
48
+ attr_accessor :level, :level_a, :hp, :hp_a, :mp, :mp_a, :atk, :def, :spi, :agi, :weapon, :armor1, :armor2,
49
+ :armor3, :armor4, :weapon1, :weapon2, :attack, :skill, :guard, :item, :equip, :status,
50
+ :save, :game_end, :fight, :escape, :new_game, :continue, :shutdown, :to_title, :cancel, :gold
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ class System
5
+ #
6
+ # Data class for the battlers used in battle tests.
7
+ #
8
+ class TestBattler
9
+ include RgssDb::Jsonable
10
+ extend RgssDb::JsonableConstructor
11
+
12
+ def initialize
13
+ @actor_id = 1
14
+ @level = 1
15
+ @weapon_id = 0
16
+ @armor1_id = 0
17
+ @armor2_id = 0
18
+ @armor3_id = 0
19
+ @armor4_id = 0
20
+ end
21
+
22
+ attr_accessor :actor_id, :level, :weapon_id, :armor1_id, :armor2_id, :armor3_id, :armor4_id
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ class System
5
+ #
6
+ # Data class for vehicles.
7
+ #
8
+ class Vehicle
9
+ include RgssDb::Jsonable
10
+ extend RgssDb::JsonableConstructor
11
+
12
+ def initialize
13
+ @character_name = ""
14
+ @character_index = 0
15
+ @bgm = RPG::AudioFile.new
16
+ @start_map_id = 0
17
+ @start_x = 0
18
+ @start_y = 0
19
+ end
20
+
21
+ attr_accessor :character_name, :character_index, :bgm, :start_map_id, :start_x, :start_y
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for troops.
6
+ #
7
+ class Troop
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize
12
+ @id = 0
13
+ @name = ""
14
+ @members = []
15
+ @pages = [RPG::Troop::Page.new]
16
+ end
17
+
18
+ def to_s
19
+ @name.to_s
20
+ end
21
+
22
+ attr_accessor :id, :name, :members, :pages
23
+ end
24
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ class Troop
5
+ #
6
+ # Data class for troop members.
7
+ #
8
+ class Member
9
+ include RgssDb::Jsonable
10
+ extend RgssDb::JsonableConstructor
11
+
12
+ def initialize
13
+ @enemy_id = 1
14
+ @x = 0
15
+ @y = 0
16
+ @hidden = false
17
+ @immortal = false
18
+ end
19
+
20
+ attr_accessor :enemy_id, :x, :y, :hidden, :immortal
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ class Troop
5
+ #
6
+ # Data class for battle events (pages).
7
+ #
8
+ class Page
9
+ include RgssDb::Jsonable
10
+ extend RgssDb::JsonableConstructor
11
+
12
+ def initialize
13
+ @condition = RPG::Troop::Page::Condition.new
14
+ @span = 0
15
+ @list = [RPG::EventCommand.new]
16
+ end
17
+
18
+ attr_accessor :condition, :span, :list
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ class Troop
5
+ class Page
6
+ #
7
+ # A database of battle event [Conditions].
8
+ #
9
+ class Condition
10
+ include RgssDb::Jsonable
11
+ extend RgssDb::JsonableConstructor
12
+
13
+ def initialize
14
+ @turn_ending = false
15
+ @turn_valid = false
16
+ @enemy_valid = false
17
+ @actor_valid = false
18
+ @switch_valid = false
19
+ @turn_a = 0
20
+ @turn_b = 0
21
+ @enemy_index = 0
22
+ @enemy_hp = 50
23
+ @actor_id = 1
24
+ @actor_hp = 50
25
+ @switch_id = 1
26
+ end
27
+
28
+ attr_accessor :turn_ending, :turn_valid, :enemy_valid, :actor_valid, :switch_valid, :turn_a, :turn_b,
29
+ :enemy_index, :enemy_hp, :actor_id, :actor_hp, :switch_id
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,87 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Superclass of Skill and Item.
6
+ #
7
+ class UsableItem < BaseItem
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize
12
+ super
13
+ @scope = 0
14
+ @occasion = 0
15
+ @speed = 0
16
+ @animation_id = 0
17
+ @common_event_id = 0
18
+ @base_damage = 0
19
+ @variance = 20
20
+ @atk_f = 0
21
+ @spi_f = 0
22
+ @physical_attack = false
23
+ @damage_to_mp = false
24
+ @absorb_damage = false
25
+ @ignore_defense = false
26
+ @element_set = []
27
+ @plus_state_set = []
28
+ @minus_state_set = []
29
+ end
30
+
31
+ def for_opponent?
32
+ [1, 2, 3, 4, 5, 6].include?(@scope)
33
+ end
34
+
35
+ def for_friend?
36
+ [7, 8, 9, 10, 11].include?(@scope)
37
+ end
38
+
39
+ def for_dead_friend?
40
+ [9, 10].include?(@scope)
41
+ end
42
+
43
+ def for_user?
44
+ [11].include?(@scope)
45
+ end
46
+
47
+ def for_one?
48
+ [1, 3, 4, 7, 9, 11].include?(@scope)
49
+ end
50
+
51
+ def for_two?
52
+ [5].include?(@scope)
53
+ end
54
+
55
+ def for_three?
56
+ [6].include?(@scope)
57
+ end
58
+
59
+ def for_random?
60
+ [4, 5, 6].include?(@scope)
61
+ end
62
+
63
+ def for_all?
64
+ [2, 8, 10].include?(@scope)
65
+ end
66
+
67
+ def dual?
68
+ [3].include?(@scope)
69
+ end
70
+
71
+ def need_selection?
72
+ [1, 3, 7, 9].include?(@scope)
73
+ end
74
+
75
+ def battle_ok?
76
+ [0, 1].include?(@occasion)
77
+ end
78
+
79
+ def menu_ok?
80
+ [0, 2].include?(@occasion)
81
+ end
82
+
83
+ attr_accessor :scope, :occasion, :speed, :animation_id, :common_event_id, :base_damage, :variance, :atk_f, :spi_f,
84
+ :physical_attack, :damage_to_mp, :absorb_damage, :ignore_defense, :element_set, :plus_state_set,
85
+ :minus_state_set
86
+ end
87
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for weapons.
6
+ #
7
+ class Weapon < BaseItem
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize
12
+ super
13
+ @animation_id = 0
14
+ @price = 0
15
+ @hit = 95
16
+ @atk = 0
17
+ @def = 0
18
+ @spi = 0
19
+ @agi = 0
20
+ @two_handed = false
21
+ @fast_attack = false
22
+ @dual_attack = false
23
+ @critical_bonus = false
24
+ @element_set = []
25
+ @state_set = []
26
+ end
27
+
28
+ attr_accessor :animation_id, :price, :hit, :atk, :def, :spi, :agi, :two_handed, :fast_attack, :dual_attack,
29
+ :critical_bonus, :element_set, :state_set
30
+ end
31
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Application mixins
4
+ require_relative "../../mixins/jsonable"
5
+ require_relative "../../mixins/jsonable_constructor"
6
+
7
+ # RPGVX Data Structures (RPGVX.chm::/rgss/g_rpg_data.html)
8
+ require_relative "./rpg/map"
9
+ require_relative "./rpg/map_info"
10
+ require_relative "./rpg/area"
11
+
12
+ require_relative "./rpg/event"
13
+ require_relative "./rpg/event_page"
14
+ require_relative "./rpg/event_page_condition"
15
+ require_relative "./rpg/event_page_graphic"
16
+ require_relative "./rpg/event_command"
17
+
18
+ require_relative "./rpg/move_route"
19
+ require_relative "./rpg/move_command"
20
+
21
+ require_relative "./rpg/actor"
22
+
23
+ require_relative "./rpg/class"
24
+ require_relative "./rpg/class_learning"
25
+
26
+ require_relative "./rpg/base_item"
27
+ require_relative "./rpg/usable_item"
28
+ require_relative "./rpg/skill"
29
+ require_relative "./rpg/item"
30
+ require_relative "./rpg/weapon"
31
+ require_relative "./rpg/armor"
32
+
33
+ require_relative "./rpg/enemy"
34
+ require_relative "./rpg/enemy_drop_item"
35
+ require_relative "./rpg/enemy_action"
36
+
37
+ require_relative "./rpg/troop"
38
+ require_relative "./rpg/troop_member"
39
+ require_relative "./rpg/troop_page"
40
+ require_relative "./rpg/troop_page_condition"
41
+
42
+ require_relative "./rpg/state"
43
+
44
+ require_relative "./rpg/animation"
45
+ require_relative "./rpg/animation_frame"
46
+ require_relative "./rpg/animation_timing"
47
+
48
+ require_relative "./rpg/common_event"
49
+
50
+ require_relative "./rpg/system"
51
+ require_relative "./rpg/system_vehicle"
52
+ require_relative "./rpg/system_terms"
53
+ require_relative "./rpg/system_test_battler"
54
+
55
+ require_relative "./rpg/audio_file"
56
+ require_relative "./rpg/bgm"
57
+ require_relative "./rpg/bgs"
58
+ require_relative "./rpg/me"
59
+ require_relative "./rpg/se"
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+
3
+ #
4
+ # The RGBA color class.
5
+ #
6
+ # Each component is handled with a floating-point value (Float).
7
+ #
8
+ class Color
9
+ include RgssDb::Jsonable
10
+ extend RgssDb::JsonableConstructor
11
+
12
+ #
13
+ # Creates a Color object. If alpha is omitted, it is assumed to be 255.
14
+ #
15
+ # The default values when no arguments are specified are (0, 0, 0, 0).
16
+ #
17
+ # @param red [Integer]
18
+ # @param green [Integer]
19
+ # @param blue [Integer]
20
+ # @param alpha [Integer]
21
+ #
22
+ def initialize(red = 0, green = 0, blue = 0, alpha = 0)
23
+ @red = red
24
+ @green = green
25
+ @blue = blue
26
+ @alpha = [red, green, blue].sum.positive? && alpha.zero? ? 255 : alpha
27
+ end
28
+
29
+ #
30
+ # Dumps this instance into a binary string
31
+ #
32
+ # Note: needed for Marshal module support
33
+ #
34
+ # @return [String]
35
+ #
36
+ def _dump(*)
37
+ # double, double, double, double (double-precision)
38
+ [@red, @green, @blue, @alpha].pack("dddd")
39
+ end
40
+
41
+ #
42
+ # Creates a new instance using the given binary data
43
+ #
44
+ # Note: needed for Marshal module support
45
+ #
46
+ # @param serialized_string [String]
47
+ #
48
+ # @return [Color]
49
+ #
50
+ def self._load(serialized_string)
51
+ Color.new_serialized(serialized_string)
52
+ end
53
+
54
+ #
55
+ # Creates a new instance from a serialized string
56
+ #
57
+ # Note: needed for Marshal module support
58
+ #
59
+ # @param serialized_string [String]
60
+ #
61
+ # @return [Color]
62
+ #
63
+ def self.new_serialized(serialized_string)
64
+ # double, double, double, double (double-precision)
65
+ red, green, blue, alpha = serialized_string.unpack("dddd")
66
+
67
+ # Creates the instance
68
+ Color.new(red, green, blue, alpha)
69
+ end
70
+
71
+ attr_accessor :red, :green, :blue, :alpha
72
+ end
@@ -0,0 +1,70 @@
1
+ # frozen_string_literal: true
2
+
3
+ #
4
+ # The rectangle class.
5
+ #
6
+ class Rect
7
+ include RgssDb::Jsonable
8
+ extend RgssDb::JsonableConstructor
9
+
10
+ #
11
+ # Creates a new Rect object.
12
+ #
13
+ # The default values when no arguments are specified are (0, 0, 0, 0).
14
+ #
15
+ # @param x [Integer]
16
+ # @param y [Integer]
17
+ # @param width [Integer]
18
+ # @param height [Integer]
19
+ #
20
+ def initialize(x = 0, y = 0, width = 0, height = 0)
21
+ @x = x
22
+ @y = y
23
+ @width = width
24
+ @height = height
25
+ end
26
+
27
+ #
28
+ # Dumps this instance into a binary string
29
+ #
30
+ # Note: needed for Marshal module support
31
+ #
32
+ # @return [String]
33
+ #
34
+ def _dump(*)
35
+ # int32_t, int32_t, int32_t, int32_t
36
+ [@x, @y, @width, @height].pack("llll")
37
+ end
38
+
39
+ #
40
+ # Creates a new instance using the given binary data
41
+ #
42
+ # Note: needed for Marshal module support
43
+ #
44
+ # @param serialized_string [String]
45
+ #
46
+ # @return [Rect]
47
+ #
48
+ def self._load(serialized_string)
49
+ Rect.new_serialized(serialized_string)
50
+ end
51
+
52
+ #
53
+ # Creates a new instance from a serialized string
54
+ #
55
+ # Note: needed for Marshal module support
56
+ #
57
+ # @param serialized_string [String]
58
+ #
59
+ # @return [Rect]
60
+ #
61
+ def self.new_serialized(serialized_string)
62
+ # int32_t, int32_t, int32_t, int32_t
63
+ x, y, width, height = serialized_string.unpack("llll")
64
+
65
+ # Creates the instance
66
+ Rect.new(x, y, width, height)
67
+ end
68
+
69
+ attr_accessor :x, :y, :width, :height
70
+ end