rvpacker-txt 1.11.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0be6dfc912a9d15dd4be7c37ecee0c316d650ca10f89eb99af19d5baf38addf2
4
- data.tar.gz: a0ed09eac3d11c36db6d9014e4c0bc6ffa2408ac8c4a78f55fdfbb08285b759a
3
+ metadata.gz: 306650077c0c96134cd8f4f1d76c3c5fc7d7b3e7745ad1ddd4a998d75b2635fe
4
+ data.tar.gz: f1ca20dfdcfd2392887d670aa6d9627dbdef790c33e914885e1e408f13c13204
5
5
  SHA512:
6
- metadata.gz: bfc00222eff1dc676c73e62bc9048a89a4ea01fdce63eda1e7373a8d4f5a4d9975418111844704127cae24f2d01848d8486ba544f8f2de409346801f9563325c
7
- data.tar.gz: 473d0707b8359f54dd49ed665addf7cbfedf4a80ccadfaf6f7d997db9e4f691ae05a4882187a5dad3c8a6dc37231c11efb6e997a573bd89a70bc3f366f6e8695
6
+ metadata.gz: e7c3d64504ea05478e5dbe30c6658a1c9ce7bfb6534769c4030cc2397b1288985bccb60fd88f3f8e22775d5e7abe9f8c9f749f8e256c563fab5d25d6ec99d79c
7
+ data.tar.gz: 101c1fd97bcd7e9e91c86e0ac7bf5746e0dc53450eebc5d518542b26a9133c8f53f7e849892a64afc32ad48a3241212bd77efc10ead33d835c52269aadf38087
data/Gemfile CHANGED
@@ -4,3 +4,4 @@ source 'https://rubygems.org'
4
4
 
5
5
  gemspec
6
6
  gem 'rubocop', group: 'development', require: false
7
+ gem 'syntax_tree', group: 'development', require: false
data/README.md CHANGED
@@ -1,25 +1,25 @@
1
1
  # rvpacker-txt
2
2
 
3
+ **This project won't longer be maintained. Consider looking into my other projects: [Rust implementation of Marshal](https://github.com/savannstm/marshal-rs) and [TypeScript implementation of Marshal](https://github.com/savannstm/marshal)**
4
+
3
5
  A tool to read RPG Maker data files to .txt files and write them back to the initial form. It's a port of Darkness9724's
4
6
  port of Ruby 1.9.x's rvpacker to Ruby 3.x to use .txt files instead of YAML, and overall improve the code quality.
5
7
 
6
- rvpacker consists of 3 parts:
8
+ rvpacker-txt consists of 3 parts:
7
9
 
8
- * classes.rb library - all necessary classes to properly load and dump RPG Maker files
9
- * read.rb library - all necessary functions for reading and parsing RPG Maker files to text
10
- * write.rb library - all necessary functions for writing parsed RPG Maker files back to their initial form.
10
+ - classes.rb library - all necessary classes to properly load and dump RPG Maker files.
11
+ - read.rb library - all necessary functions for reading and parsing RPG Maker files to text.
12
+ - write.rb library - all necessary functions for writing parsed RPG Maker files back to their initial form.
11
13
 
12
- # Installation
14
+ ## Installation
13
15
 
14
- ```
15
- $ gem install rvpacker-txt
16
- ```
16
+ `gem install rvpacker-txt`
17
17
 
18
- # Usage
18
+ ## Usage
19
19
 
20
20
  You can get a help message on usage using `rvpacker-txt -h`.
21
21
 
22
- ```
22
+ ```text
23
23
  $ rvpacker-txt -h
24
24
  This tool allows to parse RPG Maker games to .txt files and write them back to their initial form.
25
25
 
@@ -47,44 +47,40 @@ OPTIONS:
47
47
 
48
48
  For example, to read a RPG Maker VX Ace project in E:/Documents/RPGMakerGame to .txt files:
49
49
 
50
- ```
51
- $ rvpacker-txt read --input-dir E:/Documents/RPGMakerGame
52
- ```
50
+ `$ rvpacker-txt read --input-dir E:/Documents/RPGMakerGame`
53
51
 
54
52
  Program determines game engine automatically.
55
53
 
56
- This will parse all text from Data/* files into translation/maps and translation/other directories as files without
57
- _trans postfix that contain original text and files with _trans postfix that contain empty lines for translation.
54
+ This will parse all text from Data/\* files into translation/maps and translation/other directories as files without
55
+ \_trans postfix that contain original text and files with \_trans postfix that contain empty lines for translation.
58
56
  Lines from Scripts file will be parsed into translation/other/scripts.txt file as plain text, and
59
57
  also into a scripts_plain.txt file that contains scripts contents as a whole - that's just for convenience.
60
58
 
61
59
  To write previously parsed project back to its initial form:
62
60
 
63
- ```
64
- $ rvpacker-txt write --input-dir E:/Documents/RPGMakerGame
65
- ```
61
+ `$ rvpacker-txt write --input-dir E:/Documents/RPGMakerGame`
66
62
 
67
- This will take all of translation lines from _trans files from the translation subdirectories and repack all of them
63
+ This will take all of translation lines from \_trans files from the translation subdirectories and repack all of them
68
64
  to their initial form in output directory.
69
65
 
70
- ## General
66
+ ### General
71
67
 
72
68
  This is great for collaborating on translations and have clean version control.
73
69
  You can easily push .txt files and easily merge them.
74
70
 
75
71
  Now your translation can be forked/merged in an extremely easy way.
76
72
 
77
- ## Credit to previous authors
73
+ ### Credit to previous authors
78
74
 
79
75
  The RPG and RGSS libraries were originally taken from SiCrane's YAML importer/exporter on the gamedev forums.
80
76
 
81
- http://www.gamedev.net/topic/646333-rpg-maker-vx-ace-data-conversion-utility/
77
+ <http://www.gamedev.net/topic/646333-rpg-maker-vx-ace-data-conversion-utility/>
82
78
 
83
79
  akesterson, ymaxkrapzv and BigBlueHat created an original rvpacker repository with the initial frontend for SiCrane's
84
80
  YAML importer/exporter.
85
81
 
86
- https://github.com/ymaxkrapzv/rvpacker
82
+ <https://github.com/ymaxkrapzv/rvpacker>
87
83
 
88
84
  Darkness9724 forked rvpacker to rvpacker-ng, ported it to Ruby 3.x and updated dependencies.
89
85
 
90
- https://gitlab.com/Darkness9724/rvpacker-ng
86
+ <https://gitlab.com/Darkness9724/rvpacker-ng>
data/bin/rvpacker-txt CHANGED
@@ -7,25 +7,27 @@ require 'fileutils'
7
7
  require 'classes'
8
8
 
9
9
  def self.parse_options
10
- options = { action: nil,
11
- input_path: './',
12
- output_path: './',
13
- disable_processing: {
14
- maps: false,
15
- other: false,
16
- system: false,
17
- scripts: false
18
- },
19
- disable_custom_processing: false,
20
- romanize: false,
21
- logging: false,
22
- force: false,
23
- append: false,
24
- shuffle_level: 0,
25
- silent: false }
10
+ options = {
11
+ action: nil,
12
+ input_path: './',
13
+ output_path: './',
14
+ disable_processing: {
15
+ maps: false,
16
+ other: false,
17
+ system: false,
18
+ scripts: false,
19
+ },
20
+ disable_custom_processing: false,
21
+ romanize: false,
22
+ logging: false,
23
+ force: false,
24
+ append: false,
25
+ shuffle_level: 0,
26
+ silent: false,
27
+ }
26
28
 
27
29
  options[:action] = ARGV[0]
28
- options[:silent] = true unless ARGV.delete('--silent').nil?
30
+ options[:silent] = true if ARGV.delete('--silent')
29
31
 
30
32
  unless %w[read write].include?(options[:action])
31
33
  if %w[-h --help].include?(options[:action])
@@ -37,102 +39,136 @@ def self.parse_options
37
39
  end
38
40
  end
39
41
 
40
- read_command_description = 'Parses files from "original" or "data" folders of input directory to "translation" folder of output directory.'
41
- write_command_description = 'Writes translated files using original files from "original" or "data" folder of input directory and writes results to "output" folder of output directory.'
42
- banner_text = "This tool allows to parse RPG Maker games to .txt files and write them back to their initial form.\n\nUsage: rvpacker-txt COMMAND [OPTIONS]\n\nCOMMANDS:\n read - #{read_command_description}\n write - #{write_command_description}\nOPTIONS:"
43
-
44
- banner,
45
- input_dir_description,
46
- output_dir_description, =
42
+ read_command_description =
43
+ 'Parses files from "original" or "data" folders of input directory to "translation" folder of output directory.'
44
+ write_command_description =
45
+ 'Writes translated files using original files from "original" or "data" folder of input directory and writes ' \
46
+ 'results to "output" folder of output directory.'
47
+ banner_text =
48
+ "This tool allows to parse RPG Maker games to .txt files and write them back to their initial form.\n\nUsage:" \
49
+ " rvpacker-txt COMMAND [OPTIONS]\n\nCOMMANDS:\n read - #{read_command_description}\n write - " \
50
+ "#{write_command_description}\nOPTIONS:"
51
+
52
+ banner, input_dir_description, output_dir_description, =
47
53
  case options[:action]
48
- when 'read'
49
- ["#{read_command_description}\n\nOPTIONS:\n",
50
- ['Input directory, containing folders "original" or "data" with original game files.'],
51
- ['Output directory, where a "translation" folder will be created, containing parsed .txt files with the text from the game.']]
52
- when 'write'
53
- ["#{write_command_description}\n\nOPTIONS:\n",
54
- ['Input directory, containing folders "original" or "data" and "translation" with original game files and .txt files with translation respectively.'],
55
- ['Output directory, where an "output" folder will be created, containing compiled RPG Maker files with your translation.']]
56
- else
57
- [banner_text,
58
- ['When reading: Input directory, containing folders "original" or "data" with original game files.',
59
- 'When writing: Input directory, containing folders "original" or "data" and "translation" with original game files and .txt files with translation respectively.'],
60
- ['When reading: Output directory, where a "translation" folder will be created, containing parsed .txt files with the text from the game.',
61
- 'When writing: Output directory, where an "output" folder will be created, containing compiled RPG Maker files with your translation.']]
62
- end
63
-
64
- OptionParser.new(banner) do |cmd|
65
- cmd.on('-i', '--input-dir PATH', String,
66
- *input_dir_description) do |dir|
67
- options[:input_path] = File.exist?(dir) ? File.realpath(dir) : (raise "#{dir} not found")
68
- options[:output_path] = options[:input_path]
69
- end
70
-
71
- cmd.on('-o', '--output-dir PATH', String,
72
- *output_dir_description) do |dir|
73
- options[:output_path] = File.exist?(dir) ? File.realpath(dir) : (raise "#{dir} not found")
54
+ when 'read'
55
+ [
56
+ "#{read_command_description}\n\nOPTIONS:\n",
57
+ ['Input directory, containing folders "original" or "data" with original game files.'],
58
+ [
59
+ 'Output directory, where a "translation" folder will be created, containing parsed .txt files ' \
60
+ 'with the text from the game.',
61
+ ],
62
+ ]
63
+ when 'write'
64
+ [
65
+ "#{write_command_description}\n\nOPTIONS:\n",
66
+ [
67
+ 'Input directory, containing folders "original" or "data" and "translation" with original game ' \
68
+ 'files and .txt files with translation respectively.',
69
+ ],
70
+ [
71
+ 'Output directory, where an "output" folder will be created, containing compiled RPG Maker files ' \
72
+ 'with your translation.',
73
+ ],
74
+ ]
75
+ else
76
+ [
77
+ banner_text,
78
+ [
79
+ 'When reading: Input directory, containing folders "original" or "data" with original game files.',
80
+ 'When writing: Input directory, containing folders "original" or "data" and "translation" with ' \
81
+ 'original game files and .txt files with translation respectively.',
82
+ ],
83
+ [
84
+ 'When reading: Output directory, where a "translation" folder will be created, containing parsed ' \
85
+ '.txt files with the text from the game.',
86
+ 'When writing: Output directory, where an "output" folder will be created, containing compiled ' \
87
+ 'RPG Maker files with your translation.',
88
+ ],
89
+ ]
74
90
  end
75
91
 
76
- cmd.on('--disable-processing FILES', Array,
77
- 'Skips processing specified files.',
78
- 'Example: --disable-processing=maps,other,system.',
79
- '[Allowed values: maps, other, system, scripts]') do |files|
80
- files.each do |file|
81
- files = %w[maps other system scripts]
82
- index = files.find_index(file)
83
- options[:disable_processing][files[index]] = true if index
92
+ OptionParser
93
+ .new(banner) do |cmd|
94
+ cmd.on('-i', '--input-dir PATH', String, *input_dir_description) do |dir|
95
+ options[:input_path] = File.exist?(dir) ? File.realpath(dir) : (raise "#{dir} not found")
96
+ options[:output_path] = options[:input_path]
84
97
  end
85
- end
86
98
 
87
- cmd.on('--disable-custom-processing',
88
- 'Disables built-in custom text processing for some games.',
89
- 'This flag will automatically be used when writing if you parsed game text with it.') do
90
- options[:disable_custom_processing] = true
91
- end
92
-
93
- cmd.on('-r', '--romanize',
94
- 'If you parsing text from a Japanese game, that contains symbols like 「」, which are just the Japanese quotation marks,',
95
- 'it automatically replaces these symbols by their roman equivalents (in this case, "").',
96
- 'This flag will automatically be used when writing if you parsed game text with it.') do
97
- options[:romanize] = true
98
- end
99
-
100
- if options[:action] == 'read'
101
- cmd.on('-f', '--force',
102
- 'Force rewrite all files. Cannot be used with --append.',
103
- 'USE WITH CAUTION!') do
104
- options[:force] = true
99
+ cmd.on('-o', '--output-dir PATH', String, *output_dir_description) do |dir|
100
+ options[:output_path] = File.exist?(dir) ? File.realpath(dir) : (raise "#{dir} not found")
105
101
  end
106
102
 
107
- cmd.on('-a', '--append',
108
- "When the rvpacker-txt or the game which files you've parsed receives an update, you probably should re-read game files with --append,",
109
- 'which will append any new text to your files without overwriting the progress.',
110
- 'Cannot be used with --force.') do
111
- raise '--append cannot be used with --force.' if options[:force]
112
- options[:append] = true
103
+ cmd.on(
104
+ '--disable-processing FILES',
105
+ Array,
106
+ 'Skips processing specified files.',
107
+ 'Example: --disable-processing=maps,other,system.',
108
+ '[Allowed values: maps, other, system, scripts]',
109
+ ) do |files|
110
+ files.each do |file|
111
+ files = %w[maps other system scripts]
112
+ index = files.find_index(file)
113
+ options[:disable_processing][files[index]] = true if index
114
+ end
113
115
  end
114
- elsif options[:action] == 'write'
115
- cmd.on('-s', '--shuffle-level NUMBER', Integer,
116
- 'With value 1, shuffles all translation lines. With value 2, shuffles all words and lines in translation text.',
117
- 'Example: --shuffle-level 1.',
118
- '[Allowed values: 0, 1, 2]',
119
- '[Default value: 0]') do |num|
120
- raise 'Allowed values: 0, 1, 2.' if num > 2
121
- options[:shuffle_level] = num
116
+
117
+ cmd.on(
118
+ '--disable-custom-processing',
119
+ 'Disables built-in custom text processing for some games.',
120
+ 'This flag will automatically be used when writing if you parsed game text with it.',
121
+ ) { options[:disable_custom_processing] = true }
122
+
123
+ cmd.on(
124
+ '-r',
125
+ '--romanize',
126
+ 'If you parsing text from a Japanese game, that contains symbols like 「」, which are just the ' \
127
+ 'Japanese quotation marks,',
128
+ 'it automatically replaces these symbols by their roman equivalents (in this case, "").',
129
+ 'This flag will automatically be used when writing if you parsed game text with it.',
130
+ ) { options[:romanize] = true }
131
+
132
+ if options[:action] == 'read'
133
+ cmd.on('-f', '--force', 'Force rewrite all files. Cannot be used with --append.', 'USE WITH CAUTION!') do
134
+ options[:force] = true
135
+ end
136
+
137
+ cmd.on(
138
+ '-a',
139
+ '--append',
140
+ "When the rvpacker-txt or the game which files you've parsed receives an update, you probably " \
141
+ 'should re-read game files with --append,',
142
+ 'which will append any new text to your files without overwriting the progress.',
143
+ 'Cannot be used with --force.',
144
+ ) do
145
+ raise '--append cannot be used with --force.' if options[:force]
146
+ options[:append] = true
147
+ end
148
+ elsif options[:action] == 'write'
149
+ cmd.on(
150
+ '-s',
151
+ '--shuffle-level NUMBER',
152
+ Integer,
153
+ 'With value 1, shuffles all translation lines. With value 2, shuffles all words and lines in ' \
154
+ 'translation text.',
155
+ 'Example: --shuffle-level 1.',
156
+ '[Allowed values: 0, 1, 2]',
157
+ '[Default value: 0]',
158
+ ) do |num|
159
+ raise 'Allowed values: 0, 1, 2.' if num > 2
160
+ options[:shuffle_level] = num
161
+ end
122
162
  end
123
- end
124
163
 
125
- cmd.on('-l', '--log',
126
- 'Enables logging.') do
127
- options[:logging] = true
128
- end
164
+ cmd.on('-l', '--log', 'Enables logging.') { options[:logging] = true }
129
165
 
130
- cmd.on('-h', '--help',
131
- "Prints the program's help message or for the entered subcommand.") do
132
- puts cmd
133
- exit
166
+ cmd.on('-h', '--help', "Prints the program's help message or for the entered subcommand.") do
167
+ puts cmd
168
+ exit
169
+ end
134
170
  end
135
- end.parse!
171
+ .parse!
136
172
 
137
173
  options
138
174
  end
@@ -181,8 +217,9 @@ metadata_file_path = File.join(input_path, 'translation', '.rvpacker-txt-metadat
181
217
  FileUtils.mkdir_p(maps_path)
182
218
  FileUtils.mkdir_p(other_path)
183
219
 
184
- engine = extensions.each_pair { |sym, ext| break sym if File.exist?(File.join(original_directory, "System.#{ext}")) } ||
185
- (raise "Couldn't determine project engine.")
220
+ engine =
221
+ extensions.each_pair { |sym, ext| break sym if File.exist?(File.join(original_directory, "System.#{ext}")) } ||
222
+ (raise "Couldn't determine project engine.")
186
223
 
187
224
  files = Dir.glob("#{original_directory}/*#{extensions[engine]}")
188
225
 
@@ -195,9 +232,9 @@ files.each do |file|
195
232
  basename = File.basename(file)
196
233
  next unless basename.end_with?(extensions[engine])
197
234
 
198
- if basename.start_with?(/Map[0-9]/)
235
+ if basename.match?(/^Map[0-9]/)
199
236
  maps_files_paths.push(file)
200
- elsif !basename.start_with?(/Map|Tilesets|Animations|System|Scripts|Areas/)
237
+ elsif !basename.match?(/^(Map|Tilesets|Animations|System|Scripts|Areas)/)
201
238
  other_files_paths.push(file)
202
239
  elsif basename.start_with?('System')
203
240
  system_file_path = file
@@ -217,29 +254,41 @@ $wait_time = 0
217
254
  if options[:action] == 'read'
218
255
  require 'read'
219
256
 
220
- processing_mode = if force
221
- unless silent
222
- wait_time_start = Time.now
257
+ processing_mode =
258
+ if force
259
+ unless silent
260
+ wait_time_start = Time.now
223
261
 
224
- puts "WARNING! You're about to forcefully rewrite all your translation files, including _trans files.",
225
- "If you really want to do it, make sure you've made a backup of your _trans files, if you made some changes in them already.",
226
- "Input 'Y' to continue."
227
- exit unless $stdin.gets.chomp == 'Y'
262
+ puts "WARNING! You're about to forcefully rewrite all your translation files, including _trans files.",
263
+ "If you really want to do it, make sure you've made a backup of your _trans files, if you '\
264
+ 'made some changes in them already.",
265
+ "Input 'Y' to continue."
266
+ exit unless $stdin.gets.chomp == 'Y'
228
267
 
229
- $wait_time += Time.now - wait_time_start
230
- end
231
- :force
232
- elsif append
233
- :append
234
- else
235
- :default
236
- end
268
+ $wait_time += Time.now - wait_time_start
269
+ end
270
+ :force
271
+ elsif append
272
+ :append
273
+ else
274
+ :default
275
+ end
237
276
 
238
- File.binwrite(metadata_file_path, Marshal.dump({ romanize: romanize, disable_custom_processing: disable_custom_processing }))
277
+ File.binwrite(
278
+ metadata_file_path,
279
+ Marshal.dump({ romanize: romanize, disable_custom_processing: disable_custom_processing }),
280
+ )
239
281
 
240
282
  read_map(maps_files_paths, maps_path, romanize, logging, game_type, processing_mode) unless disable_processing[:maps]
241
- read_other(other_files_paths, other_path, romanize, logging, game_type, processing_mode) unless disable_processing[:other]
242
- read_system(system_file_path, ini_file_path, other_path, romanize, logging, processing_mode) unless disable_processing[:system]
283
+
284
+ unless disable_processing[:other]
285
+ read_other(other_files_paths, other_path, romanize, logging, game_type, processing_mode)
286
+ end
287
+
288
+ unless disable_processing[:system]
289
+ read_system(system_file_path, ini_file_path, other_path, romanize, logging, processing_mode)
290
+ end
291
+
243
292
  read_scripts(scripts_file_path, other_path, romanize, logging, processing_mode) unless disable_processing[:scripts]
244
293
  else
245
294
  require 'write'
@@ -261,9 +310,18 @@ else
261
310
  end
262
311
  end
263
312
 
264
- write_map(maps_files_paths, maps_path, output_path, shuffle_level, romanize, logging, game_type) unless disable_processing[:maps]
265
- write_other(other_files_paths, other_path, output_path, shuffle_level, romanize, logging, game_type) unless disable_processing[:other]
266
- write_system(system_file_path, ini_file_path, other_path, output_path, shuffle_level, romanize, logging) unless disable_processing[:system]
313
+ unless disable_processing[:maps]
314
+ write_map(maps_files_paths, maps_path, output_path, shuffle_level, romanize, logging, game_type)
315
+ end
316
+
317
+ unless disable_processing[:other]
318
+ write_other(other_files_paths, other_path, output_path, shuffle_level, romanize, logging, game_type)
319
+ end
320
+
321
+ unless disable_processing[:system]
322
+ write_system(system_file_path, ini_file_path, other_path, output_path, shuffle_level, romanize, logging)
323
+ end
324
+
267
325
  write_scripts(scripts_file_path, other_path, output_path, romanize, logging) unless disable_processing[:scripts]
268
326
  end
269
327
 
data/lib/classes.rb CHANGED
@@ -1,22 +1,22 @@
1
- =begin
2
- Copyright (c) 2013 Howard Jeng
3
-
4
- Permission is hereby granted, free of charge, to any person obtaining a copy of this
5
- software and associated documentation files (the "Software"), to deal in the Software
6
- without restriction, including without limitation the rights to use, copy, modify, merge,
7
- publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
8
- to whom the Software is furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in all copies or
11
- substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
14
- INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
15
- PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
16
- FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
17
- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18
- DEALINGS IN THE SOFTWARE.
19
- =end
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2013 Howard Jeng
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy of this
6
+ # software and associated documentation files (the "Software"), to deal in the Software
7
+ # without restriction, including without limitation the rights to use, copy, modify, merge,
8
+ # publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
9
+ # to whom the Software is furnished to do so, subject to the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be included in all copies or
12
+ # substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15
+ # INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16
+ # PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17
+ # FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
18
+ # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19
+ # DEALINGS IN THE SOFTWARE.
20
20
 
21
21
  class Table
22
22
  def initialize(bytes)
@@ -75,43 +75,6 @@ class Rect
75
75
  end
76
76
  end
77
77
 
78
- # Fuck using an array with set, that's just straight dumb and not efficient
79
- class IndexSet
80
- def initialize
81
- @hash = Hash.new
82
- end
83
-
84
- def add(item)
85
- return if @hash.include?(item)
86
- @hash[item] = @hash.size
87
- @hash
88
- end
89
-
90
- def include?(item)
91
- @hash.include?(item)
92
- end
93
-
94
- def each(&block)
95
- @hash.each_key(&block)
96
- end
97
-
98
- def to_a
99
- @hash.dup
100
- end
101
-
102
- def join(delimiter = '')
103
- @hash.keys.join(delimiter)
104
- end
105
-
106
- def length
107
- @hash.size
108
- end
109
-
110
- def empty?
111
- @hash.empty?
112
- end
113
- end
114
-
115
78
  class Hash
116
79
  def insert_at_index(index, key, value)
117
80
  return self[key] = value if index >= size
@@ -160,11 +123,11 @@ module RPG
160
123
  end
161
124
 
162
125
  class Skill
163
- attr_accessor :name, :description, :note
126
+ attr_accessor :name, :description, :note, :message1, :message2
164
127
  end
165
128
 
166
129
  class State
167
- attr_accessor :name, :description, :note
130
+ attr_accessor :name, :description, :note, :message1, :message2, :message3, :message4
168
131
  end
169
132
 
170
133
  class Weapon
@@ -248,10 +211,8 @@ module RGSS
248
211
  %i[RPG UsableItem],
249
212
  %i[RPG UsableItem Damage],
250
213
  %i[RPG UsableItem Effect],
251
- %i[RPG Weapon]
214
+ %i[RPG Weapon],
252
215
  ].freeze
253
216
 
254
- CLASSES_NESTED_ARRAY.each do |symbol_array|
255
- process(Object, *symbol_array)
256
- end
217
+ CLASSES_NESTED_ARRAY.each { |symbol_array| process(Object, *symbol_array) }
257
218
  end