rgss_db 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +5 -0
- data/COPYING.md +674 -0
- data/README.md +347 -0
- data/bin/rgss-db +4 -0
- data/bin/rgssdb +4 -0
- data/lib/rgss_db/app.rb +928 -0
- data/lib/rgss_db/controller/data_manager.rb +557 -0
- data/lib/rgss_db/model/data_file.rb +516 -0
- data/lib/rgss_db/model/data_file_factory.rb +94 -0
- data/lib/rgss_db/model/debug.rb +199 -0
- data/lib/rgss_db/model/errors.rb +17 -0
- data/lib/rgss_db/model/mixins/jsonable.rb +35 -0
- data/lib/rgss_db/model/mixins/jsonable_constructor.rb +40 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rgss/color.rb +72 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rgss/rect.rb +70 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rgss/table.rb +99 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rgss/tone.rb +72 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rgss.rb +11 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/actor.rb +44 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/animation.rb +31 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/animation_frame.rb +20 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/animation_timing.rb +23 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/area.rb +26 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/armor.rb +31 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/audio_file.rb +23 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/base_item.rb +25 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/bgm.rb +36 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/bgs.rb +36 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/class.rb +31 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/class_learning.rb +20 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/common_event.rb +25 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/enemy.rb +44 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/enemy_action.rb +29 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/enemy_drop_item.rb +23 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/event.rb +36 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/event_command.rb +19 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/event_page.rb +32 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/event_page_condition.rb +34 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/event_page_graphic.rb +25 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/item.rb +27 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/map.rb +47 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/map_info.rb +26 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/me.rb +27 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/move_command.rb +18 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/move_route.rb +20 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/se.rb +21 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/skill.rb +22 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/state.rb +47 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/system.rb +43 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/system_terms.rb +53 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/system_test_battler.rb +25 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/system_vehicle.rb +24 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/troop.rb +24 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/troop_member.rb +23 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/troop_page.rb +21 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/troop_page_condition.rb +33 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/usable_item.rb +87 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg/weapon.rb +31 -0
- data/lib/rgss_db/model/rpg_maker_data/vx/rpg.rb +59 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rgss/color.rb +72 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rgss/rect.rb +70 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rgss/table.rb +99 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rgss/tone.rb +72 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rgss.rb +11 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/actor.rb +27 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/animation.rb +31 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/animation_frame.rb +23 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/animation_timing.rb +26 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/armor.rb +20 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/audio_file.rb +23 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/base_item.rb +31 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/base_item_feature.rb +29 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/bgm.rb +43 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/bgs.rb +43 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/class.rb +37 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/class_learning.rb +24 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/common_event.rb +33 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/enemy.rb +27 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/enemy_action.rb +26 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/enemy_drop_item.rb +24 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/equip_item.rb +19 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/event.rb +36 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/event_command.rb +19 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/event_page.rb +35 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/event_page_condition.rb +40 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/event_page_graphic.rb +31 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/item.rb +25 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/map.rb +58 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/map_encounter.rb +23 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/map_info.rb +26 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/me.rb +27 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/move_command.rb +17 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/move_route.rb +19 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/se.rb +21 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/skill.rb +25 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/state.rb +34 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/system.rb +62 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/system_terms.rb +25 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/system_test_battler.rb +24 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/system_vehicle.rb +27 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/tileset.rb +26 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/troop.rb +24 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/troop_member.rb +25 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/troop_page.rb +24 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/troop_page_condition.rb +39 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/usable_item.rb +84 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/usable_item_damage.rb +56 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/usable_item_effect.rb +25 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg/weapon.rb +25 -0
- data/lib/rgss_db/model/rpg_maker_data/vx_ace/rpg.rb +66 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rgss/color.rb +72 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rgss/rect.rb +70 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rgss/table.rb +99 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rgss/tone.rb +72 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rgss.rb +11 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/actor.rb +44 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/animation.rb +28 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/animation_frame.rb +20 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/animation_timing.rb +24 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/armor.rb +37 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/audio_file.rb +23 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/class.rb +28 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/class_learning.rb +20 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/common_event.rb +25 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/enemy.rb +47 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/enemy_action.rb +28 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/event.rb +36 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/event_command.rb +19 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/event_page.rb +32 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/event_page_condition.rb +30 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/event_page_graphic.rb +27 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/item.rb +48 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/map.rb +39 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/map_info.rb +26 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/move_command.rb +18 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/move_route.rb +19 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/skill.rb +47 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/state.rb +51 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/system.rb +56 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/system_test_battler.rb +25 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/system_words.rb +39 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/tileset.rb +39 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/troop.rb +24 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/troop_member.rb +23 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/troop_page.rb +21 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/troop_page_condition.rb +32 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg/weapon.rb +38 -0
- data/lib/rgss_db/model/rpg_maker_data/xp/rpg.rb +52 -0
- data/lib/rgss_db/model/strings.rb +607 -0
- data/lib/rgss_db/model/utilities.rb +90 -0
- data/lib/rgss_db/version.rb +7 -0
- data/lib/rgss_db/view/app_cli.rb +449 -0
- data/lib/rgss_db.rb +41 -0
- data/sig/rgss_db.rbs +5221 -0
- metadata +496 -0
@@ -0,0 +1,99 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# The multidimensional array class.
|
5
|
+
#
|
6
|
+
# Each element is an integer of 2 signed bytes ranging from -32,768 to 32,767.
|
7
|
+
#
|
8
|
+
class Table
|
9
|
+
include RgssDb::Jsonable
|
10
|
+
extend RgssDb::JsonableConstructor
|
11
|
+
|
12
|
+
#
|
13
|
+
# Creates a Table object.
|
14
|
+
#
|
15
|
+
# Specifies the size of each dimension in the multidimensional array. 1-, 2-, and 3-dimensional arrays are possible.
|
16
|
+
#
|
17
|
+
# Arrays with no parameters are also permitted.
|
18
|
+
#
|
19
|
+
# @param xsize [Integer]
|
20
|
+
# @param ysize [Integer]
|
21
|
+
# @param zsize [Integer]
|
22
|
+
#
|
23
|
+
def initialize(xsize, ysize = 0, zsize = 0)
|
24
|
+
# RMXP needs dimensions
|
25
|
+
@dim = 1
|
26
|
+
@dim = 2 if ysize.positive?
|
27
|
+
@dim = 3 if zsize.positive?
|
28
|
+
@x = xsize
|
29
|
+
@y = ysize
|
30
|
+
@z = zsize
|
31
|
+
@data = []
|
32
|
+
end
|
33
|
+
|
34
|
+
#
|
35
|
+
# Dumps this instance into a binary string
|
36
|
+
#
|
37
|
+
# Note: needed for Marshal module support
|
38
|
+
#
|
39
|
+
# @return [String]
|
40
|
+
#
|
41
|
+
def _dump(*)
|
42
|
+
# int32_t, int32_t, int32_t, int32_t, int32_t, int16_t *
|
43
|
+
[@dim, @x, @y, @z, @x * @y * @z, *@data].pack("llllls*")
|
44
|
+
end
|
45
|
+
|
46
|
+
#
|
47
|
+
# Creates a new instance using the given binary data
|
48
|
+
#
|
49
|
+
# Note: needed for Marshal module support
|
50
|
+
#
|
51
|
+
# @param serialized_string [String]
|
52
|
+
#
|
53
|
+
# @return [Table]
|
54
|
+
#
|
55
|
+
def self._load(serialized_string)
|
56
|
+
Table.new_serialized(serialized_string)
|
57
|
+
end
|
58
|
+
|
59
|
+
#
|
60
|
+
# Creates a new instance from a serialized string
|
61
|
+
#
|
62
|
+
# Note: needed for Marshal module support
|
63
|
+
#
|
64
|
+
# @param serialized_string [String]
|
65
|
+
#
|
66
|
+
# @return [Table]
|
67
|
+
#
|
68
|
+
def self.new_serialized(serialized_string)
|
69
|
+
# int32_t, int32_t, int32_t, int32_t, int32_t, int16_t *
|
70
|
+
dim, x, y, z, size, *data = serialized_string.unpack("llllls*")
|
71
|
+
|
72
|
+
# Checks if written size value matches the actual size of the table
|
73
|
+
raise "Table: bad file format (size mismatch)" unless size == (x * y * z)
|
74
|
+
# Double check no data was lost
|
75
|
+
raise "Table: bad file format (data length mismatch)" unless size == data.length
|
76
|
+
|
77
|
+
# Creates the instance
|
78
|
+
table = Table.new(0, 0, 0)
|
79
|
+
table.dim = dim
|
80
|
+
table.x = x
|
81
|
+
table.y = y
|
82
|
+
table.z = z
|
83
|
+
table.data = data
|
84
|
+
table
|
85
|
+
end
|
86
|
+
|
87
|
+
#
|
88
|
+
# Returns a table instance for JSON deserialization
|
89
|
+
#
|
90
|
+
# @param args [Array]
|
91
|
+
#
|
92
|
+
# @return [Table]
|
93
|
+
#
|
94
|
+
def self.json_new(*args)
|
95
|
+
Table.new(0, 0, 0)
|
96
|
+
end
|
97
|
+
|
98
|
+
attr_accessor :dim, :x, :y, :z, :data
|
99
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# The color tone class.
|
5
|
+
#
|
6
|
+
# Each component is handled with a floating-point value (Float).
|
7
|
+
#
|
8
|
+
class Tone
|
9
|
+
include RgssDb::Jsonable
|
10
|
+
extend RgssDb::JsonableConstructor
|
11
|
+
|
12
|
+
#
|
13
|
+
# Creates a Tone object. If gray is omitted, it is assumed to be 0.
|
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 gray [Integer]
|
21
|
+
#
|
22
|
+
def initialize(red = 0, green = 0, blue = 0, gray = 0)
|
23
|
+
@red = red
|
24
|
+
@green = green
|
25
|
+
@blue = blue
|
26
|
+
@gray = gray
|
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, @gray].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 [Tone]
|
49
|
+
#
|
50
|
+
def self._load(serialized_string)
|
51
|
+
Tone.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 [Tone]
|
62
|
+
#
|
63
|
+
def self.new_serialized(serialized_string)
|
64
|
+
# double, double, double, double (double-precision)
|
65
|
+
red, green, blue, gray = serialized_string.unpack("dddd")
|
66
|
+
|
67
|
+
# Creates the instance
|
68
|
+
Tone.new(red, green, blue, gray)
|
69
|
+
end
|
70
|
+
|
71
|
+
attr_accessor :red, :green, :blue, :gray
|
72
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Application mixins
|
4
|
+
require_relative "../../mixins/jsonable"
|
5
|
+
require_relative "../../mixins/jsonable_constructor"
|
6
|
+
|
7
|
+
# RGSS Impl.
|
8
|
+
require_relative "./rgss/color"
|
9
|
+
require_relative "./rgss/rect"
|
10
|
+
require_relative "./rgss/table"
|
11
|
+
require_relative "./rgss/tone"
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RPG
|
4
|
+
#
|
5
|
+
# The data class for actors.
|
6
|
+
#
|
7
|
+
class Actor < BaseItem
|
8
|
+
include RgssDb::Jsonable
|
9
|
+
extend RgssDb::JsonableConstructor
|
10
|
+
|
11
|
+
def initialize
|
12
|
+
super
|
13
|
+
@nickname = ""
|
14
|
+
@class_id = 1
|
15
|
+
@initial_level = 1
|
16
|
+
@max_level = 99
|
17
|
+
@character_name = ""
|
18
|
+
@character_index = 0
|
19
|
+
@face_name = ""
|
20
|
+
@face_index = 0
|
21
|
+
@equips = [0, 0, 0, 0, 0]
|
22
|
+
end
|
23
|
+
|
24
|
+
attr_accessor :nickname, :class_id, :initial_level, :max_level, :character_name, :character_index, :face_name,
|
25
|
+
:face_index, :equips
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RPG
|
4
|
+
#
|
5
|
+
# The data class for animation.
|
6
|
+
#
|
7
|
+
class Animation
|
8
|
+
include RgssDb::Jsonable
|
9
|
+
extend RgssDb::JsonableConstructor
|
10
|
+
|
11
|
+
def initialize
|
12
|
+
@id = 0
|
13
|
+
@name = ""
|
14
|
+
@animation1_name = ""
|
15
|
+
@animation1_hue = 0
|
16
|
+
@animation2_name = ""
|
17
|
+
@animation2_hue = 0
|
18
|
+
@position = 1
|
19
|
+
@frame_max = 1
|
20
|
+
@frames = [RPG::Animation::Frame.new]
|
21
|
+
@timings = []
|
22
|
+
end
|
23
|
+
|
24
|
+
def to_s
|
25
|
+
@name.to_s
|
26
|
+
end
|
27
|
+
|
28
|
+
attr_accessor :id, :name, :animation1_name, :animation1_hue, :animation2_name,
|
29
|
+
:animation2_hue, :position, :frame_max, :frames, :timings
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RPG
|
4
|
+
#
|
5
|
+
# The data class for animation.
|
6
|
+
#
|
7
|
+
class Animation
|
8
|
+
#
|
9
|
+
# The data class for animation frames.
|
10
|
+
#
|
11
|
+
class Frame
|
12
|
+
include RgssDb::Jsonable
|
13
|
+
extend RgssDb::JsonableConstructor
|
14
|
+
|
15
|
+
def initialize
|
16
|
+
@cell_max = 0
|
17
|
+
@cell_data = Table.new(0, 0)
|
18
|
+
end
|
19
|
+
|
20
|
+
attr_accessor :cell_max, :cell_data
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RPG
|
4
|
+
#
|
5
|
+
# The data class for animation.
|
6
|
+
#
|
7
|
+
class Animation
|
8
|
+
#
|
9
|
+
# The data class for the timing of an animation's SE and flash effects.
|
10
|
+
#
|
11
|
+
class Timing
|
12
|
+
include RgssDb::Jsonable
|
13
|
+
extend RgssDb::JsonableConstructor
|
14
|
+
|
15
|
+
def initialize
|
16
|
+
@frame = 0
|
17
|
+
@se = RPG::SE.new("", 80)
|
18
|
+
@flash_scope = 0
|
19
|
+
@flash_color = Color.new(255, 255, 255, 255)
|
20
|
+
@flash_duration = 5
|
21
|
+
end
|
22
|
+
|
23
|
+
attr_accessor :frame, :se, :flash_scope, :flash_color, :flash_duration
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RPG
|
4
|
+
#
|
5
|
+
# The data class for armor.
|
6
|
+
#
|
7
|
+
class Armor < EquipItem
|
8
|
+
include RgssDb::Jsonable
|
9
|
+
extend RgssDb::JsonableConstructor
|
10
|
+
|
11
|
+
def initialize
|
12
|
+
super
|
13
|
+
@atype_id = 0
|
14
|
+
@etype_id = 1
|
15
|
+
@features.push(RPG::BaseItem::Feature.new(22, 1, 0))
|
16
|
+
end
|
17
|
+
|
18
|
+
attr_accessor :atype_id
|
19
|
+
end
|
20
|
+
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,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# RPG classes module
|
5
|
+
#
|
6
|
+
module RPG
|
7
|
+
#
|
8
|
+
# A superclass of actor, class, skill, item, weapon, armor, enemy, and state.
|
9
|
+
#
|
10
|
+
# Some items are unnecessary depending on the type of data, but they are included for convenience sake.
|
11
|
+
#
|
12
|
+
class BaseItem
|
13
|
+
include RgssDb::Jsonable
|
14
|
+
extend RgssDb::JsonableConstructor
|
15
|
+
|
16
|
+
def initialize
|
17
|
+
@id = 0
|
18
|
+
@name = ""
|
19
|
+
@icon_index = 0
|
20
|
+
@description = ""
|
21
|
+
@features = []
|
22
|
+
@note = ""
|
23
|
+
end
|
24
|
+
|
25
|
+
def to_s
|
26
|
+
@name.to_s
|
27
|
+
end
|
28
|
+
|
29
|
+
attr_accessor :id, :name, :icon_index, :description, :features, :note
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
#
|
4
|
+
# RPG classes module
|
5
|
+
#
|
6
|
+
module RPG
|
7
|
+
#
|
8
|
+
# A superclass of actor, class, skill, item, weapon, armor, enemy, and state.
|
9
|
+
#
|
10
|
+
# Some items are unnecessary depending on the type of data, but they are included for convenience sake.
|
11
|
+
#
|
12
|
+
class BaseItem
|
13
|
+
#
|
14
|
+
# The data inner class for features.
|
15
|
+
#
|
16
|
+
class Feature
|
17
|
+
include RgssDb::Jsonable
|
18
|
+
extend RgssDb::JsonableConstructor
|
19
|
+
|
20
|
+
def initialize(code = 0, data_id = 0, value = 0)
|
21
|
+
@code = code
|
22
|
+
@data_id = data_id
|
23
|
+
@value = value
|
24
|
+
end
|
25
|
+
|
26
|
+
attr_accessor :code, :data_id, :value
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RPG
|
4
|
+
#
|
5
|
+
# The data class for BGM. This class has functionality for playing itself using an Audio module.
|
6
|
+
#
|
7
|
+
class BGM < AudioFile
|
8
|
+
include RgssDb::Jsonable
|
9
|
+
extend RgssDb::JsonableConstructor
|
10
|
+
|
11
|
+
@@last = RPG::BGM.new
|
12
|
+
def play(pos = 0)
|
13
|
+
if @name.empty?
|
14
|
+
Audio.bgm_stop
|
15
|
+
@@last = RPG::BGM.new
|
16
|
+
else
|
17
|
+
Audio.bgm_play("Audio/BGM/" + @name, @volume, @pitch, pos)
|
18
|
+
@@last = clone
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def replay
|
23
|
+
play(@pos)
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.stop
|
27
|
+
Audio.bgm_stop
|
28
|
+
@@last = RPG::BGM.new
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.fade(time)
|
32
|
+
Audio.bgm_fade(time)
|
33
|
+
@@last = RPG::BGM.new
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.last
|
37
|
+
@@last.pos = Audio.bgm_pos
|
38
|
+
@@last
|
39
|
+
end
|
40
|
+
|
41
|
+
attr_accessor :pos
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RPG
|
4
|
+
#
|
5
|
+
# The data class for BGS. This class has functionality for playing itself using an Audio module.
|
6
|
+
#
|
7
|
+
class BGS < AudioFile
|
8
|
+
include RgssDb::Jsonable
|
9
|
+
extend RgssDb::JsonableConstructor
|
10
|
+
|
11
|
+
@@last = RPG::BGS.new
|
12
|
+
def play(pos = 0)
|
13
|
+
if @name.empty?
|
14
|
+
Audio.bgs_stop
|
15
|
+
@@last = RPG::BGS.new
|
16
|
+
else
|
17
|
+
Audio.bgs_play("Audio/BGS/" + @name, @volume, @pitch, pos)
|
18
|
+
@@last = clone
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def replay
|
23
|
+
play(@pos)
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.stop
|
27
|
+
Audio.bgs_stop
|
28
|
+
@@last = RPG::BGS.new
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.fade(time)
|
32
|
+
Audio.bgs_fade(time)
|
33
|
+
@@last = RPG::BGS.new
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.last
|
37
|
+
@@last.pos = Audio.bgs_pos
|
38
|
+
@@last
|
39
|
+
end
|
40
|
+
|
41
|
+
attr_accessor :pos
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RPG
|
4
|
+
#
|
5
|
+
# The data class for class.
|
6
|
+
#
|
7
|
+
class Class < BaseItem
|
8
|
+
include RgssDb::Jsonable
|
9
|
+
extend RgssDb::JsonableConstructor
|
10
|
+
|
11
|
+
def initialize
|
12
|
+
super
|
13
|
+
@exp_params = [30, 20, 30, 30]
|
14
|
+
@params = Table.new(8, 100)
|
15
|
+
@learnings = []
|
16
|
+
@features.push(RPG::BaseItem::Feature.new(23, 0, 1))
|
17
|
+
@features.push(RPG::BaseItem::Feature.new(22, 0, 0.95))
|
18
|
+
@features.push(RPG::BaseItem::Feature.new(22, 1, 0.05))
|
19
|
+
@features.push(RPG::BaseItem::Feature.new(22, 2, 0.04))
|
20
|
+
@features.push(RPG::BaseItem::Feature.new(41, 1))
|
21
|
+
@features.push(RPG::BaseItem::Feature.new(51, 1))
|
22
|
+
@features.push(RPG::BaseItem::Feature.new(52, 1))
|
23
|
+
end
|
24
|
+
|
25
|
+
def exp_for_level(level)
|
26
|
+
lv = level.to_f
|
27
|
+
basis = @exp_params[0].to_f
|
28
|
+
extra = @exp_params[1].to_f
|
29
|
+
acc_a = @exp_params[2].to_f
|
30
|
+
acc_b = @exp_params[3].to_f
|
31
|
+
(basis * ((lv - 1)**(0.9 + acc_a / 250)) * lv * (lv + 1) / (6 + lv**2 / 50 / acc_b) + (lv - 1) * extra)
|
32
|
+
.round.to_i
|
33
|
+
end
|
34
|
+
|
35
|
+
attr_accessor :exp_params, :params, :learnings
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RPG
|
4
|
+
#
|
5
|
+
# The data class for class.
|
6
|
+
#
|
7
|
+
class Class < BaseItem
|
8
|
+
#
|
9
|
+
# The data class for a class's [Skills to Learn].
|
10
|
+
#
|
11
|
+
class Learning
|
12
|
+
include RgssDb::Jsonable
|
13
|
+
extend RgssDb::JsonableConstructor
|
14
|
+
|
15
|
+
def initialize
|
16
|
+
@level = 1
|
17
|
+
@skill_id = 1
|
18
|
+
@note = ""
|
19
|
+
end
|
20
|
+
|
21
|
+
attr_accessor :level, :skill_id, :note
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RPG
|
4
|
+
#
|
5
|
+
# The 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 autorun?
|
20
|
+
@trigger == 1
|
21
|
+
end
|
22
|
+
|
23
|
+
def parallel?
|
24
|
+
@trigger == 2
|
25
|
+
end
|
26
|
+
|
27
|
+
def to_s
|
28
|
+
@name.to_s
|
29
|
+
end
|
30
|
+
|
31
|
+
attr_accessor :id, :name, :trigger, :switch_id, :list
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RPG
|
4
|
+
#
|
5
|
+
# The data class for enemies.
|
6
|
+
#
|
7
|
+
class Enemy < BaseItem
|
8
|
+
include RgssDb::Jsonable
|
9
|
+
extend RgssDb::JsonableConstructor
|
10
|
+
|
11
|
+
def initialize
|
12
|
+
super
|
13
|
+
@battler_name = ""
|
14
|
+
@battler_hue = 0
|
15
|
+
@params = [100, 0, 10, 10, 10, 10, 10, 10]
|
16
|
+
@exp = 0
|
17
|
+
@gold = 0
|
18
|
+
@drop_items = Array.new(3) { RPG::Enemy::DropItem.new }
|
19
|
+
@actions = [RPG::Enemy::Action.new]
|
20
|
+
@features.push(RPG::BaseItem::Feature.new(22, 0, 0.95))
|
21
|
+
@features.push(RPG::BaseItem::Feature.new(22, 1, 0.05))
|
22
|
+
@features.push(RPG::BaseItem::Feature.new(31, 1, 0))
|
23
|
+
end
|
24
|
+
|
25
|
+
attr_accessor :battler_name, :battler_hue, :params, :exp, :gold, :drop_items, :actions
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RPG
|
4
|
+
#
|
5
|
+
# The data class for enemies.
|
6
|
+
#
|
7
|
+
class Enemy < BaseItem
|
8
|
+
#
|
9
|
+
# The data class for enemy [Actions].
|
10
|
+
#
|
11
|
+
class Action
|
12
|
+
include RgssDb::Jsonable
|
13
|
+
extend RgssDb::JsonableConstructor
|
14
|
+
|
15
|
+
def initialize
|
16
|
+
@skill_id = 1
|
17
|
+
@condition_type = 0
|
18
|
+
@condition_param1 = 0
|
19
|
+
@condition_param2 = 0
|
20
|
+
@rating = 5
|
21
|
+
end
|
22
|
+
|
23
|
+
attr_accessor :skill_id, :condition_type, :condition_param1, :condition_param2, :rating
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RPG
|
4
|
+
#
|
5
|
+
# The data class for enemies.
|
6
|
+
#
|
7
|
+
class Enemy < BaseItem
|
8
|
+
#
|
9
|
+
# The data class for enemy [Drop Items].
|
10
|
+
#
|
11
|
+
class DropItem
|
12
|
+
include RgssDb::Jsonable
|
13
|
+
extend RgssDb::JsonableConstructor
|
14
|
+
|
15
|
+
def initialize
|
16
|
+
@kind = 0
|
17
|
+
@data_id = 1
|
18
|
+
@denominator = 1
|
19
|
+
end
|
20
|
+
|
21
|
+
attr_accessor :kind, :data_id, :denominator
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RPG
|
4
|
+
#
|
5
|
+
# A superclass of weapons and armor.
|
6
|
+
#
|
7
|
+
class EquipItem < BaseItem
|
8
|
+
include RgssDb::Jsonable
|
9
|
+
extend RgssDb::JsonableConstructor
|
10
|
+
|
11
|
+
def initialize
|
12
|
+
super
|
13
|
+
@price = 0
|
14
|
+
@etype_id = 0
|
15
|
+
@params = [0] * 8
|
16
|
+
end
|
17
|
+
attr_accessor :price, :etype_id, :params
|
18
|
+
end
|
19
|
+
end
|