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
+ class Animation
5
+ #
6
+ # Data class for animation frames.
7
+ #
8
+ class Frame
9
+ include RgssDb::Jsonable
10
+ extend RgssDb::JsonableConstructor
11
+
12
+ def initialize
13
+ @cell_max = 0
14
+ @cell_data = Table.new(0, 0)
15
+ end
16
+
17
+ attr_accessor :cell_max, :cell_data
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ class Animation
5
+ #
6
+ # Data class for the timing of an animation's SE and flash effects.
7
+ #
8
+ class Timing
9
+ include RgssDb::Jsonable
10
+ extend RgssDb::JsonableConstructor
11
+
12
+ def initialize
13
+ @frame = 0
14
+ @se = RPG::AudioFile.new("", 80)
15
+ @flash_scope = 0
16
+ @flash_color = Color.new(255, 255, 255, 255)
17
+ @flash_duration = 5
18
+ @condition = 0
19
+ end
20
+
21
+ attr_accessor :frame, :se, :flash_scope, :flash_color, :flash_duration, :condition
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for armor.
6
+ #
7
+ class Armor
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize
12
+ @id = 0
13
+ @name = ""
14
+ @icon_name = ""
15
+ @description = ""
16
+ @kind = 0
17
+ @auto_state_id = 0
18
+ @price = 0
19
+ @pdef = 0
20
+ @mdef = 0
21
+ @eva = 0
22
+ @str_plus = 0
23
+ @dex_plus = 0
24
+ @agi_plus = 0
25
+ @int_plus = 0
26
+ @guard_element_set = []
27
+ @guard_state_set = []
28
+ end
29
+
30
+ def to_s
31
+ @name.to_s
32
+ end
33
+
34
+ attr_accessor :id, :name, :icon_name, :description, :kind, :auto_state_id, :price, :pdef, :mdef, :eva, :str_plus,
35
+ :dex_plus, :agi_plus, :int_plus, :guard_element_set, :guard_state_set
36
+ end
37
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for audio files. Common to all formats (BGM, BGS, ME, SE).
6
+ #
7
+ class AudioFile
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize(name = "", volume = 100, pitch = 100)
12
+ @name = name
13
+ @volume = volume
14
+ @pitch = pitch
15
+ end
16
+
17
+ def to_s
18
+ @name.to_s
19
+ end
20
+
21
+ attr_accessor :name, :volume, :pitch
22
+ end
23
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for class.
6
+ #
7
+ class Class
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize
12
+ @id = 0
13
+ @name = ""
14
+ @position = 0
15
+ @weapon_set = []
16
+ @armor_set = []
17
+ @element_ranks = Table.new(1)
18
+ @state_ranks = Table.new(1)
19
+ @learnings = []
20
+ end
21
+
22
+ def to_s
23
+ @name.to_s
24
+ end
25
+
26
+ attr_accessor :id, :name, :position, :weapon_set, :armor_set, :element_ranks, :state_ranks, :learnings
27
+ end
28
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ class Class
5
+ #
6
+ # Data class for a [Class's Learned] skills.
7
+ #
8
+ class Learning
9
+ include RgssDb::Jsonable
10
+ extend RgssDb::JsonableConstructor
11
+
12
+ def initialize
13
+ @level = 1
14
+ @skill_id = 1
15
+ end
16
+
17
+ attr_accessor :level, :skill_id
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for common events.
6
+ #
7
+ class CommonEvent
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize
12
+ @id = 0
13
+ @name = ""
14
+ @trigger = 0
15
+ @switch_id = 1
16
+ @list = [RPG::EventCommand.new]
17
+ end
18
+
19
+ def to_s
20
+ @name.to_s
21
+ end
22
+
23
+ attr_accessor :id, :name, :trigger, :switch_id, :list
24
+ end
25
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for enemies.
6
+ #
7
+ class Enemy
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize
12
+ @id = 0
13
+ @name = ""
14
+ @battler_name = ""
15
+ @battler_hue = 0
16
+ @maxhp = 500
17
+ @maxsp = 500
18
+ @str = 50
19
+ @dex = 50
20
+ @agi = 50
21
+ @int = 50
22
+ @atk = 100
23
+ @pdef = 100
24
+ @mdef = 100
25
+ @eva = 0
26
+ @animation1_id = 0
27
+ @animation2_id = 0
28
+ @element_ranks = Table.new(1)
29
+ @state_ranks = Table.new(1)
30
+ @actions = [RPG::Enemy::Action.new]
31
+ @exp = 0
32
+ @gold = 0
33
+ @item_id = 0
34
+ @weapon_id = 0
35
+ @armor_id = 0
36
+ @treasure_prob = 100
37
+ end
38
+
39
+ def to_s
40
+ @name.to_s
41
+ end
42
+
43
+ attr_accessor :id, :name, :battler_name, :battler_hue, :maxhp, :maxsp, :str, :dex, :agi, :int, :atk, :pdef, :mdef,
44
+ :eva, :animation1_id, :animation2_id, :element_ranks, :state_ranks, :actions, :exp, :gold, :item_id,
45
+ :weapon_id, :armor_id, :treasure_prob
46
+ end
47
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ class Enemy
5
+ #
6
+ # Data class for enemy [Actions].
7
+ #
8
+ class Action
9
+ include RgssDb::Jsonable
10
+ extend RgssDb::JsonableConstructor
11
+
12
+ def initialize
13
+ @kind = 0
14
+ @basic = 0
15
+ @skill_id = 1
16
+ @condition_turn_a = 0
17
+ @condition_turn_b = 1
18
+ @condition_hp = 100
19
+ @condition_level = 1
20
+ @condition_switch_id = 0
21
+ @rating = 5
22
+ end
23
+
24
+ attr_accessor :kind, :basic, :skill_id, :condition_turn_a, :condition_turn_b, :condition_hp, :condition_level,
25
+ :condition_switch_id, :rating
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for map events.
6
+ #
7
+ class Event
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize(x, y)
12
+ @id = 0
13
+ @name = ""
14
+ @x = x
15
+ @y = y
16
+ @pages = [RPG::Event::Page.new]
17
+ end
18
+
19
+ def to_s
20
+ @name.to_s
21
+ end
22
+
23
+ #
24
+ # JSON constructor
25
+ #
26
+ # @param args [Array]
27
+ #
28
+ # @return Class instance
29
+ #
30
+ def self.json_new(*args)
31
+ new(-1, -1)
32
+ end
33
+
34
+ attr_accessor :id, :name, :x, :y, :pages
35
+ end
36
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for the Event command.
6
+ #
7
+ class EventCommand
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize(code = 0, indent = 0, parameters = [])
12
+ @code = code
13
+ @indent = indent
14
+ @parameters = parameters
15
+ end
16
+
17
+ attr_accessor :code, :indent, :parameters
18
+ end
19
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ class Event
5
+ #
6
+ # Data class for the event page.
7
+ #
8
+ class Page
9
+ include RgssDb::Jsonable
10
+ extend RgssDb::JsonableConstructor
11
+
12
+ def initialize
13
+ @condition = RPG::Event::Page::Condition.new
14
+ @graphic = RPG::Event::Page::Graphic.new
15
+ @move_type = 0
16
+ @move_speed = 3
17
+ @move_frequency = 3
18
+ @move_route = RPG::MoveRoute.new
19
+ @walk_anime = true
20
+ @step_anime = false
21
+ @direction_fix = false
22
+ @through = false
23
+ @always_on_top = false
24
+ @trigger = 0
25
+ @list = [RPG::EventCommand.new]
26
+ end
27
+
28
+ attr_accessor :condition, :graphic, :move_type, :move_speed, :move_frequency, :move_route, :walk_anime,
29
+ :step_anime, :direction_fix, :through, :always_on_top, :trigger, :list
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ class Event
5
+ class Page
6
+ #
7
+ # A database of event page conditions.
8
+ #
9
+ class Condition
10
+ include RgssDb::Jsonable
11
+ extend RgssDb::JsonableConstructor
12
+
13
+ def initialize
14
+ @switch1_valid = false
15
+ @switch2_valid = false
16
+ @variable_valid = false
17
+ @self_switch_valid = false
18
+ @switch1_id = 1
19
+ @switch2_id = 1
20
+ @variable_id = 1
21
+ @variable_value = 0
22
+ @self_switch_ch = "A"
23
+ end
24
+
25
+ attr_accessor :switch1_valid, :switch2_valid, :variable_valid, :self_switch_valid, :switch1_id, :switch2_id,
26
+ :variable_id, :variable_value, :self_switch_ch
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ class Event
5
+ class Page
6
+ #
7
+ # Data class for the Event page [Graphics].
8
+ #
9
+ class Graphic
10
+ include RgssDb::Jsonable
11
+ extend RgssDb::JsonableConstructor
12
+
13
+ def initialize
14
+ @tile_id = 0
15
+ @character_name = ""
16
+ @character_hue = 0
17
+ @direction = 2
18
+ @pattern = 0
19
+ @opacity = 255
20
+ @blend_type = 0
21
+ end
22
+
23
+ attr_accessor :tile_id, :character_name, :character_hue, :direction, :pattern, :opacity, :blend_type
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for items.
6
+ #
7
+ class Item
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize
12
+ @id = 0
13
+ @name = ""
14
+ @icon_name = ""
15
+ @description = ""
16
+ @scope = 0
17
+ @occasion = 0
18
+ @animation1_id = 0
19
+ @animation2_id = 0
20
+ @menu_se = RPG::AudioFile.new("", 80)
21
+ @common_event_id = 0
22
+ @price = 0
23
+ @consumable = true
24
+ @parameter_type = 0
25
+ @parameter_points = 0
26
+ @recover_hp_rate = 0
27
+ @recover_hp = 0
28
+ @recover_sp_rate = 0
29
+ @recover_sp = 0
30
+ @hit = 100
31
+ @pdef_f = 0
32
+ @mdef_f = 0
33
+ @variance = 0
34
+ @element_set = []
35
+ @plus_state_set = []
36
+ @minus_state_set = []
37
+ end
38
+
39
+ def to_s
40
+ @name.to_s
41
+ end
42
+
43
+ attr_accessor :id, :name, :icon_name, :description, :scope, :occasion, :animation1_id, :animation2_id, :menu_se,
44
+ :common_event_id, :price, :consumable, :parameter_type, :parameter_points, :recover_hp_rate,
45
+ :recover_hp, :recover_sp_rate, :recover_sp, :hit, :pdef_f, :mdef_f, :variance, :element_set,
46
+ :plus_state_set, :minus_state_set
47
+ end
48
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for maps.
6
+ #
7
+ class Map
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize(width, height)
12
+ @tileset_id = 1
13
+ @width = width
14
+ @height = height
15
+ @autoplay_bgm = false
16
+ @bgm = RPG::AudioFile.new
17
+ @autoplay_bgs = false
18
+ @bgs = RPG::AudioFile.new("", 80)
19
+ @encounter_list = []
20
+ @encounter_step = 30
21
+ @data = Table.new(width, height, 3)
22
+ @events = {}
23
+ end
24
+
25
+ #
26
+ # JSON constructor
27
+ #
28
+ # @param args [Array]
29
+ #
30
+ # @return Class instance
31
+ #
32
+ def self.json_new(*args)
33
+ new(-1, -1)
34
+ end
35
+
36
+ attr_accessor :tileset_id, :width, :height, :autoplay_bgm, :bgm, :autoplay_bgs, :bgs, :encounter_list,
37
+ :encounter_step, :data, :events
38
+ end
39
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for map information.
6
+ #
7
+ class MapInfo
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize
12
+ @name = ""
13
+ @parent_id = 0
14
+ @order = 0
15
+ @expanded = false
16
+ @scroll_x = 0
17
+ @scroll_y = 0
18
+ end
19
+
20
+ def to_s
21
+ @name.to_s
22
+ end
23
+
24
+ attr_accessor :name, :parent_id, :order, :expanded, :scroll_x, :scroll_y
25
+ end
26
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for the Move command.
6
+ #
7
+ class MoveCommand
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize(code = 0, parameters = [])
12
+ @code = code
13
+ @parameters = parameters
14
+ end
15
+
16
+ attr_accessor :code, :parameters
17
+ end
18
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for the move route (movement route).
6
+ #
7
+ class MoveRoute
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize
12
+ @repeat = true
13
+ @skippable = false
14
+ @list = [RPG::MoveCommand.new]
15
+ end
16
+
17
+ attr_accessor :repeat, :skippable, :list
18
+ end
19
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for skills.
6
+ #
7
+ class Skill
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize
12
+ @id = 0
13
+ @name = ""
14
+ @icon_name = ""
15
+ @description = ""
16
+ @scope = 0
17
+ @occasion = 1
18
+ @animation1_id = 0
19
+ @animation2_id = 0
20
+ @menu_se = RPG::AudioFile.new("", 80)
21
+ @common_event_id = 0
22
+ @sp_cost = 0
23
+ @power = 0
24
+ @atk_f = 0
25
+ @eva_f = 0
26
+ @str_f = 0
27
+ @dex_f = 0
28
+ @agi_f = 0
29
+ @int_f = 100
30
+ @hit = 100
31
+ @pdef_f = 0
32
+ @mdef_f = 100
33
+ @variance = 15
34
+ @element_set = []
35
+ @plus_state_set = []
36
+ @minus_state_set = []
37
+ end
38
+
39
+ def to_s
40
+ @name.to_s
41
+ end
42
+
43
+ attr_accessor :id, :name, :icon_name, :description, :scope, :occasion, :animation1_id, :animation2_id, :menu_se,
44
+ :common_event_id, :sp_cost, :power, :atk_f, :eva_f, :str_f, :dex_f, :agi_f, :int_f, :hit, :pdef_f,
45
+ :mdef_f, :variance, :element_set, :plus_state_set, :minus_state_set
46
+ end
47
+ end
@@ -0,0 +1,51 @@
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
+ @animation_id = 0
15
+ @restriction = 0
16
+ @nonresistance = false
17
+ @zero_hp = false
18
+ @cant_get_exp = false
19
+ @cant_evade = false
20
+ @slip_damage = false
21
+ @rating = 5
22
+ @hit_rate = 100
23
+ @maxhp_rate = 100
24
+ @maxsp_rate = 100
25
+ @str_rate = 100
26
+ @dex_rate = 100
27
+ @agi_rate = 100
28
+ @int_rate = 100
29
+ @atk_rate = 100
30
+ @pdef_rate = 100
31
+ @mdef_rate = 100
32
+ @eva = 0
33
+ @battle_only = true
34
+ @hold_turn = 0
35
+ @auto_release_prob = 0
36
+ @shock_release_prob = 0
37
+ @guard_element_set = []
38
+ @plus_state_set = []
39
+ @minus_state_set = []
40
+ end
41
+
42
+ def to_s
43
+ @name.to_s
44
+ end
45
+
46
+ attr_accessor :id, :name, :animation_id, :restriction, :nonresistance, :zero_hp, :cant_get_exp, :cant_evade,
47
+ :slip_damage, :rating, :hit_rate, :maxhp_rate, :maxsp_rate, :str_rate, :dex_rate, :agi_rate,
48
+ :int_rate, :atk_rate, :pdef_rate, :mdef_rate, :eva, :battle_only, :hold_turn, :auto_release_prob,
49
+ :shock_release_prob, :guard_element_set, :plus_state_set, :minus_state_set
50
+ end
51
+ end