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,23 @@
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
+ end
19
+
20
+ attr_accessor :frame, :se, :flash_scope, :flash_color, :flash_duration
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for areas.
6
+ #
7
+ class Area
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize
12
+ @id = 0
13
+ @name = ""
14
+ @map_id = 0
15
+ @rect = Rect.new(0, 0, 0, 0)
16
+ @encounter_list = []
17
+ @order = 0
18
+ end
19
+
20
+ def to_s
21
+ @name.to_s
22
+ end
23
+
24
+ attr_accessor :id, :name, :map_id, :rect, :encounter_list, :order
25
+ end
26
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for armor.
6
+ #
7
+ class Armor < BaseItem
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize
12
+ super
13
+ @kind = 0
14
+ @price = 0
15
+ @eva = 0
16
+ @atk = 0
17
+ @def = 0
18
+ @spi = 0
19
+ @agi = 0
20
+ @prevent_critical = false
21
+ @half_mp_cost = false
22
+ @double_exp_gain = false
23
+ @auto_hp_recover = false
24
+ @element_set = []
25
+ @state_set = []
26
+ end
27
+
28
+ attr_accessor :kind, :price, :eva, :atk, :def, :spi, :agi, :prevent_critical, :half_mp_cost, :double_exp_gain,
29
+ :auto_hp_recover, :element_set, :state_set
30
+ end
31
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # A superclass of BGM, BGS, ME, and 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,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Superclass of Skill, Item, Weapon, and Armor.
6
+ #
7
+ class BaseItem
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize
12
+ @id = 0
13
+ @name = ""
14
+ @icon_index = 0
15
+ @description = ""
16
+ @note = ""
17
+ end
18
+
19
+ def to_s
20
+ @name.to_s
21
+ end
22
+
23
+ attr_accessor :id, :name, :icon_index, :description, :note
24
+ end
25
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for BGM. This class has a method to play oneself with Audio module.
6
+ #
7
+ class BGM < AudioFile
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ @@last = BGM.new
12
+ def play
13
+ if @name.empty?
14
+ Audio.bgm_stop
15
+ @@last = BGM.new
16
+ else
17
+ Audio.bgm_play("Audio/BGM/" + @name, @volume, @pitch)
18
+ @@last = self
19
+ end
20
+ end
21
+
22
+ def self.stop
23
+ Audio.bgm_stop
24
+ @@last = BGM.new
25
+ end
26
+
27
+ def self.fade(time)
28
+ Audio.bgm_fade(time)
29
+ @@last = BGM.new
30
+ end
31
+
32
+ def self.last
33
+ @@last
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for BGS. This class has a method to play oneself with Audio module.
6
+ #
7
+ class BGS < AudioFile
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ @@last = BGS.new
12
+ def play
13
+ if @name.empty?
14
+ Audio.bgs_stop
15
+ @@last = BGS.new
16
+ else
17
+ Audio.bgs_play("Audio/BGS/" + @name, @volume, @pitch)
18
+ @@last = self
19
+ end
20
+ end
21
+
22
+ def self.stop
23
+ Audio.bgs_stop
24
+ @@last = BGS.new
25
+ end
26
+
27
+ def self.fade(time)
28
+ Audio.bgs_fade(time)
29
+ @@last = BGS.new
30
+ end
31
+
32
+ def self.last
33
+ @@last
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,31 @@
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
+ @skill_name_valid = false
21
+ @skill_name = ""
22
+ end
23
+
24
+ def to_s
25
+ @name.to_s
26
+ end
27
+
28
+ attr_accessor :id, :name, :position, :weapon_set, :armor_set, :element_ranks, :state_ranks, :learnings,
29
+ :skill_name_valid, :skill_name
30
+ end
31
+ 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,44 @@
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 = 10
17
+ @maxmp = 10
18
+ @atk = 10
19
+ @def = 10
20
+ @spi = 10
21
+ @agi = 10
22
+ @hit = 95
23
+ @eva = 5
24
+ @exp = 0
25
+ @gold = 0
26
+ @drop_item1 = RPG::Enemy::DropItem.new
27
+ @drop_item2 = RPG::Enemy::DropItem.new
28
+ @levitate = false
29
+ @has_critical = false
30
+ @element_ranks = Table.new(1)
31
+ @state_ranks = Table.new(1)
32
+ @actions = [RPG::Enemy::Action.new]
33
+ @note = ""
34
+ end
35
+
36
+ def to_s
37
+ @name.to_s
38
+ end
39
+
40
+ attr_accessor :id, :name, :battler_name, :battler_hue, :maxhp, :maxmp, :atk, :def, :spi, :agi, :hit, :eva, :exp,
41
+ :gold, :drop_item1, :drop_item2, :levitate, :has_critical, :element_ranks, :state_ranks,
42
+ :actions, :note
43
+ end
44
+ end
@@ -0,0 +1,29 @@
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_type = 0
17
+ @condition_param1 = 0
18
+ @condition_param2 = 0
19
+ @rating = 5
20
+ end
21
+
22
+ def skill?
23
+ @kind == 1
24
+ end
25
+
26
+ attr_accessor :kind, :basic, :skill_id, :condition_type, :condition_param1, :condition_param2, :rating
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ class Enemy
5
+ #
6
+ # Data class for enemy [Drop Item].
7
+ #
8
+ class DropItem
9
+ include RgssDb::Jsonable
10
+ extend RgssDb::JsonableConstructor
11
+
12
+ def initialize
13
+ @kind = 0
14
+ @item_id = 1
15
+ @weapon_id = 1
16
+ @armor_id = 1
17
+ @denominator = 1
18
+ end
19
+
20
+ attr_accessor :kind, :item_id, :weapon_id, :armor_id, :denominator
21
+ end
22
+ end
23
+ 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
+ @priority_type = 0
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, :priority_type, :trigger, :list
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ class Event
5
+ class Page
6
+ #
7
+ # Data class for the 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
+ @item_valid = false
19
+ @actor_valid = false
20
+ @switch1_id = 1
21
+ @switch2_id = 1
22
+ @variable_id = 1
23
+ @variable_value = 0
24
+ @self_switch_ch = "A"
25
+ @item_id = 1
26
+ @actor_id = 1
27
+ end
28
+
29
+ attr_accessor :switch1_valid, :switch2_valid, :variable_valid, :self_switch_valid, :item_valid, :actor_valid,
30
+ :switch1_id, :switch2_id, :variable_id, :variable_value, :self_switch_ch, :item_id, :actor_id
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,25 @@
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_index = 0
17
+ @direction = 2
18
+ @pattern = 0
19
+ end
20
+
21
+ attr_accessor :tile_id, :character_name, :character_index, :direction, :pattern
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for items.
6
+ #
7
+ class Item < UsableItem
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def initialize
12
+ super
13
+ @scope = 7
14
+ @price = 0
15
+ @consumable = true
16
+ @hp_recovery_rate = 0
17
+ @hp_recovery = 0
18
+ @mp_recovery_rate = 0
19
+ @mp_recovery = 0
20
+ @parameter_type = 0
21
+ @parameter_points = 0
22
+ end
23
+
24
+ attr_accessor :price, :consumable, :hp_recovery_rate, :hp_recovery, :mp_recovery_rate, :mp_recovery,
25
+ :parameter_type, :parameter_points
26
+ end
27
+ end
@@ -0,0 +1,47 @@
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
+ @width = width
13
+ @height = height
14
+ @scroll_type = 0
15
+ @autoplay_bgm = false
16
+ @bgm = RPG::AudioFile.new
17
+ @autoplay_bgs = false
18
+ @bgs = RPG::AudioFile.new("", 80)
19
+ @disable_dashing = false
20
+ @encounter_list = []
21
+ @encounter_step = 30
22
+ @parallax_name = ""
23
+ @parallax_loop_x = false
24
+ @parallax_loop_y = false
25
+ @parallax_sx = 0
26
+ @parallax_sy = 0
27
+ @parallax_show = false
28
+ @data = Table.new(width, height, 3)
29
+ @events = {}
30
+ end
31
+
32
+ #
33
+ # JSON constructor
34
+ #
35
+ # @param args [Array]
36
+ #
37
+ # @return Class instance
38
+ #
39
+ def self.json_new(*args)
40
+ new(-1, -1)
41
+ end
42
+
43
+ attr_accessor :width, :height, :scroll_type, :autoplay_bgm, :bgm, :autoplay_bgs, :bgs, :disable_dashing,
44
+ :encounter_list, :encounter_step, :parallax_name, :parallax_loop_x, :parallax_loop_y, :parallax_sx,
45
+ :parallax_sy, :parallax_show, :data, :events
46
+ end
47
+ 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,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RPG
4
+ #
5
+ # Data class for ME. This class has a method to play oneself with Audio module.
6
+ #
7
+ class ME < AudioFile
8
+ include RgssDb::Jsonable
9
+ extend RgssDb::JsonableConstructor
10
+
11
+ def play
12
+ if @name.empty?
13
+ Audio.me_stop
14
+ else
15
+ Audio.me_play("Audio/ME/" + @name, @volume, @pitch)
16
+ end
17
+ end
18
+
19
+ def self.stop
20
+ Audio.me_stop
21
+ end
22
+
23
+ def self.fade(time)
24
+ Audio.me_fade(time)
25
+ end
26
+ end
27
+ 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