R3EXS 1.0.5 → 1.1.1

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.
@@ -1,17 +1,36 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'RGSS3'
4
-
5
3
  module R3EXS
6
4
 
7
5
  # 基础物品类
8
6
  class BaseItem
9
7
 
8
+ # 在原始数组中的索引
9
+ #
10
+ # @return [Integer]
11
+ attr_reader :index
12
+
13
+ # 物品名称
14
+ #
15
+ # @return [String]
16
+ attr_accessor :name
17
+
18
+ # 物品描述
19
+ #
20
+ # @return [String]
21
+ attr_accessor :description
22
+
23
+ # 物品注释
24
+ #
25
+ # @return [String]
26
+ attr_accessor :note
27
+
10
28
  # 用 RPG::BaseItem 初始化
11
29
  #
12
30
  # @param baseitem [RPG::BaseItem] 待处理的 RPG::BaseItem 对象
13
31
  # @param index [Integer] 在原始数组中的索引
14
32
  # @param with_note [Boolean] 是否处理 note 字段
33
+ #
15
34
  # @return [R3EXS::BaseItem]
16
35
  def initialize(baseitem, index, with_note)
17
36
  @index = index
@@ -24,6 +43,7 @@ module R3EXS
24
43
  # 注入到 RPG::BaseItem 对象
25
44
  #
26
45
  # @param baseitem [RPG::BaseItem] 待注入的 RPG::BaseItem 对象
46
+ #
27
47
  # @return [void]
28
48
  def inject_to(baseitem)
29
49
  baseitem.name = @name
@@ -45,6 +65,7 @@ module R3EXS
45
65
  # 将所有的字符串替换为指定的字符串
46
66
  #
47
67
  # @param hash [Hash<String, String>] 字符串翻译表
68
+ #
48
69
  # @return [void]
49
70
  def in_strings(hash)
50
71
  @name = hash[@name] || @name
@@ -58,36 +79,22 @@ module R3EXS
58
79
  def empty?
59
80
  @name.to_s.empty? && @description.to_s.empty? && @note.to_s.empty?
60
81
  end
61
-
62
- # 在原始数组中的索引
63
- #
64
- # @return [Integer]
65
- attr_reader :index
66
-
67
- # 物品名称
68
- #
69
- # @return [String]
70
- attr_accessor :name
71
-
72
- # 物品描述
73
- #
74
- # @return [String]
75
- attr_accessor :description
76
-
77
- # 物品注释
78
- #
79
- # @return [String]
80
- attr_accessor :note
81
82
  end
82
83
 
83
84
  # 角色类
84
85
  class Actor < BaseItem
85
86
 
87
+ # 昵称
88
+ #
89
+ # @return [String]
90
+ attr_accessor :nickname
91
+
86
92
  # 用 RPG::Actor 初始化
87
93
  #
88
94
  # @param actor [RPG::Actor] 待处理的 RPG::Actor 对象
89
95
  # @param index [Integer] 在原始数组中的索引
90
96
  # @param with_note [Boolean] 是否处理 note 字段
97
+ #
91
98
  # @return [R3EXS::Actor]
92
99
  def initialize(actor, index, with_note)
93
100
  super(actor, index, with_note)
@@ -97,6 +104,7 @@ module R3EXS
97
104
  # 注入到 RPG::Actor 对象
98
105
  #
99
106
  # @param actor [RPG::Actor] 待注入的 RPG::Actor 对象
107
+ #
100
108
  # @return [void]
101
109
  def inject_to(actor)
102
110
  super(actor)
@@ -112,9 +120,20 @@ module R3EXS
112
120
  strings
113
121
  end
114
122
 
123
+ # 提取术语表
124
+ #
125
+ # @return [Array<GlossaryItem>]
126
+ def ex_glossary
127
+ glossary = []
128
+ glossary << GlossaryItem.new(@name, '角色名称')
129
+ glossary << GlossaryItem.new(@nickname, '角色昵称')
130
+ glossary
131
+ end
132
+
115
133
  # 将所有的字符串替换为指定的字符串
116
134
  #
117
135
  # @param hash [Hash<String, String>] 字符串翻译表
136
+ #
118
137
  # @return [void]
119
138
  def in_strings(hash)
120
139
  super(hash)
@@ -127,20 +146,26 @@ module R3EXS
127
146
  def empty?
128
147
  super && @nickname.to_s.empty?
129
148
  end
130
-
131
- # 昵称
132
- #
133
- # @return [String]
134
- attr_accessor :nickname
135
149
  end
136
150
 
137
151
  # 动画类
138
152
  class Animation
139
153
 
154
+ # 在原始数组中的索引
155
+ #
156
+ # @return [Integer]
157
+ attr_reader :index
158
+
159
+ # 动画名称
160
+ #
161
+ # @return [String]
162
+ attr_accessor :name
163
+
140
164
  # 用 RPG::Animation 初始化
141
165
  #
142
166
  # @param animation [RPG::Animation] 待处理的 RPG::Animation 对象
143
167
  # @param index [Integer] 在原始数组中的索引
168
+ #
144
169
  # @return [R3EXS::Animation]
145
170
  def initialize(animation, index, _unused = nil)
146
171
  @index = index
@@ -150,6 +175,7 @@ module R3EXS
150
175
  # 注入到 RPG::Animation 对象
151
176
  #
152
177
  # @param animation [RPG::Animation] 待注入的 RPG::Animation 对象
178
+ #
153
179
  # @return [void]
154
180
  def inject_to(animation)
155
181
  animation.name = @name
@@ -165,6 +191,7 @@ module R3EXS
165
191
  # 将所有的字符串替换为指定的字符串
166
192
  #
167
193
  # @param hash [Hash<String, String>] 字符串翻译表
194
+ #
168
195
  # @return [void]
169
196
  def in_strings(hash)
170
197
  @name = hash[@name] || @name
@@ -176,16 +203,6 @@ module R3EXS
176
203
  def empty?
177
204
  @name.to_s.empty?
178
205
  end
179
-
180
- # 在原始数组中的索引
181
- #
182
- # @return [Integer]
183
- attr_reader :index
184
-
185
- # 动画名称
186
- #
187
- # @return [String]
188
- attr_accessor :name
189
206
  end
190
207
 
191
208
  # 可装备物品类
@@ -196,6 +213,7 @@ module R3EXS
196
213
  # @param equipitem [RPG::EquipItem] 待处理的 RPG::EquipItem 对象
197
214
  # @param index [Integer] 在原始数组中的索引
198
215
  # @param with_note [Boolean] 是否处理 note 字段
216
+ #
199
217
  # @return [R3EXS::EquipItem]
200
218
  def initialize(equipitem, index, with_note)
201
219
  super(equipitem, index, with_note)
@@ -204,6 +222,7 @@ module R3EXS
204
222
  # 注入到 RPG::EquipItem 对象
205
223
  #
206
224
  # @param equipitem [RPG::EquipItem] 待注入的 RPG::EquipItem 对象
225
+ #
207
226
  # @return [void]
208
227
  def inject_to(equipitem)
209
228
  super
@@ -219,6 +238,7 @@ module R3EXS
219
238
  # 将所有的字符串替换为指定的字符串
220
239
  #
221
240
  # @param hash [Hash<String, String>] 字符串翻译表
241
+ #
222
242
  # @return [void]
223
243
  def in_strings(hash)
224
244
  super(hash)
@@ -230,7 +250,6 @@ module R3EXS
230
250
  def empty?
231
251
  super
232
252
  end
233
-
234
253
  end
235
254
 
236
255
  # 护甲类
@@ -241,6 +260,7 @@ module R3EXS
241
260
  # @param armor [RPG::Armor] 待处理的 RPG::Armor 对象
242
261
  # @param index [Integer] 在原始数组中的索引
243
262
  # @param with_note [Boolean] 是否处理 note 字段
263
+ #
244
264
  # @return [R3EXS::Armor]
245
265
  def initialize(armor, index, with_note)
246
266
  super(armor, index, with_note)
@@ -249,6 +269,7 @@ module R3EXS
249
269
  # 注入到 RPG::Armor 对象
250
270
  #
251
271
  # @param armor [RPG::Armor] 待注入的 RPG::Armor 对象
272
+ #
252
273
  # @return [void]
253
274
  def inject_to(armor)
254
275
  super
@@ -261,9 +282,19 @@ module R3EXS
261
282
  super
262
283
  end
263
284
 
285
+ # 提取术语表
286
+ #
287
+ # @return [Array<GlossaryItem>]
288
+ def ex_glossary
289
+ glossary = []
290
+ glossary << GlossaryItem.new(@name, '护甲名称')
291
+ glossary
292
+ end
293
+
264
294
  # 将所有的字符串替换为指定的字符串
265
295
  #
266
296
  # @param hash [Hash<String, String>] 字符串翻译表
297
+ #
267
298
  # @return [void]
268
299
  def in_strings(hash)
269
300
  super(hash)
@@ -275,19 +306,34 @@ module R3EXS
275
306
  def empty?
276
307
  super
277
308
  end
278
-
279
309
  end
280
310
 
281
311
  # 职业类
282
312
  class Class < BaseItem
283
313
 
314
+ # 职业的学习技能列表
315
+ #
316
+ # @return [Array<R3EXS::Class::Learning>]
317
+ attr_accessor :learnings
318
+
284
319
  # 学习技能类
285
320
  class Learning
286
321
 
322
+ # 在原始数组中的索引
323
+ #
324
+ # @return [Integer]
325
+ attr_reader :index
326
+
327
+ # 学习技能注释
328
+ #
329
+ # @return [String]
330
+ attr_accessor :note
331
+
287
332
  # 用 RPG::Class::Learning 初始化
288
333
  #
289
334
  # @param learning [RPG::Class::Learning] 待处理的 RPG::Class::Learning 对象
290
335
  # @param index [Integer] 在原始数组中的索引
336
+ #
291
337
  # @return [R3EXS::Class::Learning]
292
338
  def initialize(learning, index)
293
339
  @index = index
@@ -297,6 +343,7 @@ module R3EXS
297
343
  # 注入到 RPG::Class::Learning 对象
298
344
  #
299
345
  # @param learning [RPG::Class::Learning] 待注入的 RPG::Class::Learning 对象
346
+ #
300
347
  # @return [void]
301
348
  def inject_to(learning)
302
349
  learning.note = @note
@@ -312,6 +359,7 @@ module R3EXS
312
359
  # 将所有的字符串替换为指定的字符串
313
360
  #
314
361
  # @param hash [Hash<String, String>] 字符串翻译表
362
+ #
315
363
  # @return [void]
316
364
  def in_strings(hash)
317
365
  @note = hash[@note] || @note
@@ -323,16 +371,6 @@ module R3EXS
323
371
  def empty?
324
372
  @note.to_s.empty?
325
373
  end
326
-
327
- # 在原始数组中的索引
328
- #
329
- # @return [Integer]
330
- attr_reader :index
331
-
332
- # 学习技能注释
333
- #
334
- # @return [String]
335
- attr_accessor :note
336
374
  end
337
375
 
338
376
  # 用 RPG::Class 初始化
@@ -340,6 +378,7 @@ module R3EXS
340
378
  # @param klass [RPG::Class] 待处理的 RPG::Class 对象
341
379
  # @param index [Integer] 在原始数组中的索引
342
380
  # @param with_note [Boolean] 是否处理 note 字段
381
+ #
343
382
  # @return [R3EXS::Class]
344
383
  def initialize(klass, index, with_note)
345
384
  super(klass, index, with_note)
@@ -356,6 +395,7 @@ module R3EXS
356
395
  # 注入到 RPG::Class 对象
357
396
  #
358
397
  # @param klass [RPG::Class] 待注入的 RPG::Class 对象
398
+ #
359
399
  # @return [void]
360
400
  def inject_to(klass)
361
401
  super(klass)
@@ -379,9 +419,19 @@ module R3EXS
379
419
  strings
380
420
  end
381
421
 
422
+ # 提取术语表
423
+ #
424
+ # @return [Array<GlossaryItem>]
425
+ def ex_glossary
426
+ glossary = []
427
+ glossary << GlossaryItem.new(@name, '职业名称')
428
+ glossary
429
+ end
430
+
382
431
  # 将所有的字符串替换为指定的字符串
383
432
  #
384
433
  # @param hash [Hash<String, String>] 字符串翻译表
434
+ #
385
435
  # @return [void]
386
436
  def in_strings(hash)
387
437
  super(hash)
@@ -398,17 +448,36 @@ module R3EXS
398
448
  def empty?
399
449
  super && @learnings.to_a.empty?
400
450
  end
401
-
402
- attr_accessor :learnings
403
451
  end
404
452
 
405
453
  # 移动指令类
406
454
  class MoveCommand
407
455
 
456
+ # 在原始数组中的索引
457
+ #
458
+ # @return [Integer]
459
+ attr_accessor :index
460
+
461
+ # 移动指令代码
462
+ #
463
+ # @return [Integer]
464
+ attr_accessor :code
465
+
466
+ # 移动指令用途
467
+ #
468
+ # @return [String]
469
+ attr_accessor :usage
470
+
471
+ # 移动指令参数
472
+ #
473
+ # @return [String]
474
+ attr_accessor :parameter
475
+
408
476
  # 用 RPG::MoveCommand 初始化
409
477
  #
410
478
  # @param movecommand [RPG::MoveCommand] 待处理的 RPG::MoveCommand 对象
411
479
  # @param index [Integer] 在原始数组中的索引
480
+ #
412
481
  # @return [R3EXS::MoveCommand]
413
482
  def initialize(movecommand, index)
414
483
  if movecommand.code == 45
@@ -424,6 +493,7 @@ module R3EXS
424
493
  # 注入到 RPG::MoveCommand 对象
425
494
  #
426
495
  # @param movecommand [RPG::MoveCommand] 待注入的 RPG::MoveCommand 对象
496
+ #
427
497
  # @return [void]
428
498
  def inject_to(movecommand)
429
499
  movecommand.parameters[0] = @parameter
@@ -439,6 +509,7 @@ module R3EXS
439
509
  # 将所有的字符串替换为指定的字符串
440
510
  #
441
511
  # @param hash [Hash<String, String>] 字符串翻译表
512
+ #
442
513
  # @return [void]
443
514
  def in_strings(hash)
444
515
  @parameter = hash[@parameter] || @parameter
@@ -450,34 +521,20 @@ module R3EXS
450
521
  def empty?
451
522
  @index == -1
452
523
  end
453
-
454
- # 在原始数组中的索引
455
- #
456
- # @return [Integer]
457
- attr_accessor :index
458
-
459
- # 移动指令代码
460
- #
461
- # @return [Integer]
462
- attr_accessor :code
463
-
464
- # 移动指令用途
465
- #
466
- # @return [String]
467
- attr_accessor :usage
468
-
469
- # 移动指令参数
470
- #
471
- # @return [String]
472
- attr_accessor :parameter
473
524
  end
474
525
 
475
526
  # 移动路线类
476
527
  class MoveRoute
477
528
 
529
+ # 移动指令列表
530
+ #
531
+ # @return [Array<R3EXS::MoveCommand>]
532
+ attr_accessor :list
533
+
478
534
  # 用 RPG::MoveRoute 初始化
479
535
  #
480
536
  # @param moveroute [RPG::MoveRoute] 待处理的 RPG::MoveRoute 对象
537
+ #
481
538
  # @return [R3EXS::MoveRoute]
482
539
  def initialize(moveroute)
483
540
  @list = []
@@ -491,6 +548,7 @@ module R3EXS
491
548
  # 注入到 RPG::MoveRoute 对象
492
549
  #
493
550
  # @param moveroute [RPG::MoveRoute] 待注入的 RPG::MoveRoute 对象
551
+ #
494
552
  # @return [void]
495
553
  def inject_to(moveroute)
496
554
  @list.each do |movecommand|
@@ -512,6 +570,7 @@ module R3EXS
512
570
  # 将所有的字符串替换为指定的字符串
513
571
  #
514
572
  # @param hash [Hash<String, String>] 字符串翻译表
573
+ #
515
574
  # @return [void]
516
575
  def in_strings(hash)
517
576
  @list.each do |movecommand|
@@ -525,20 +584,39 @@ module R3EXS
525
584
  def empty?
526
585
  @list.empty?
527
586
  end
528
-
529
- # 移动指令列表
530
- #
531
- # @return [Array<R3EXS::MoveCommand>]
532
- attr_accessor :list
533
587
  end
534
588
 
535
589
  # 事件指令类
536
590
  class EventCommand
537
591
 
592
+ # 在原始数组中的索引
593
+ #
594
+ # @return [Integer]
595
+ attr_accessor :index
596
+
597
+ # 事件指令代码
598
+ #
599
+ # @return [Integer]
600
+ attr_accessor :code
601
+
602
+ # 事件指令用途
603
+ #
604
+ # @return [String]
605
+ attr_accessor :usage
606
+
607
+ # 事件指令参数
608
+ #
609
+ # @note 当 '@code' 为 102 时, parameter 是一个字符串数组
610
+ #
611
+ # @return [String] if @code != 102
612
+ # @return [Array<String>] if @code == 102
613
+ attr_accessor :parameter
614
+
538
615
  # 用 RPG::EventCommand 初始化
539
616
  #
540
617
  # @param eventcommand [RPG::EventCommand] 待处理的 RPG::EventCommand 对象
541
618
  # @param index [Integer] 在原始数组中的索引
619
+ #
542
620
  # @return [R3EXS::EventCommand]
543
621
  def initialize(eventcommand, index)
544
622
  case eventcommand.code
@@ -583,13 +661,14 @@ module R3EXS
583
661
  @index = -1
584
662
  end
585
663
  when 205 # SetMoveRoute
586
- @index = index
587
- @code = 205
588
- @usage = Utils::EVENT_COMMANDS[205]
589
664
  moveroute_r3exs = R3EXS::MoveRoute.new(eventcommand.parameters[1])
590
- @parameter = moveroute_r3exs.list unless moveroute_r3exs.empty?
591
- if @parameter.nil?
592
- @index = -1 # 如果没有可提取的 MoveCommand ,就将索引设为-1,empty? 将据此判断是否为空
665
+ if moveroute_r3exs.empty?
666
+ @index = -1 # 如果 MoveRoute 里面没有可提取的 MoveCommand ,就将索引设为-1,empty? 将据此判断是否为空
667
+ else
668
+ @index = index
669
+ @code = 205
670
+ @usage = Utils::EVENT_COMMANDS[205]
671
+ @parameter = moveroute_r3exs
593
672
  end
594
673
  when 320 # ChangeActorName
595
674
  @index = index
@@ -627,13 +706,14 @@ module R3EXS
627
706
  @usage = Utils::EVENT_COMMANDS[408]
628
707
  @parameter = eventcommand.parameters[0]
629
708
  when 505 # MoveRoute
630
- if eventcommand.parameters[0].code == 45
709
+ movecommand_r3exs = R3EXS::MoveCommand.new(eventcommand.parameters[0], 0)
710
+ if movecommand_r3exs.empty?
711
+ @index = -1
712
+ else
631
713
  @index = index
632
714
  @code = 505
633
715
  @usage = Utils::EVENT_COMMANDS[505]
634
- @parameter = eventcommand.parameters[0].parameters[0]
635
- else
636
- @index = -1
716
+ @parameter = movecommand_r3exs
637
717
  end
638
718
  when 655 # ScriptMore
639
719
  @index = index
@@ -648,6 +728,7 @@ module R3EXS
648
728
  # 注入到 RPG::EventCommand 对象
649
729
  #
650
730
  # @param eventcommand [RPG::EventCommand] 待注入的 RPG::EventCommand 对象
731
+ #
651
732
  # @return [void]
652
733
  def inject_to(eventcommand)
653
734
  case eventcommand.code
@@ -684,7 +765,7 @@ module R3EXS
684
765
  when 408 # CommentMore
685
766
  eventcommand.parameters[0] = @parameter
686
767
  when 505 # MoveRoute
687
- eventcommand.parameters[0].parameters[0] = @parameter
768
+ @parameter.inject_to(eventcommand.parameters[0])
688
769
  when 655 # ScriptMore
689
770
  eventcommand.parameters[0] = @parameter
690
771
  else
@@ -703,6 +784,8 @@ module R3EXS
703
784
  [@parameter]
704
785
  when 205
705
786
  @parameter.ex_strings
787
+ when 505
788
+ @parameter.ex_strings
706
789
  else
707
790
  puts "Unknown code: #{@code}"
708
791
  []
@@ -712,6 +795,7 @@ module R3EXS
712
795
  # 将所有的字符串替换为指定的字符串
713
796
  #
714
797
  # @param hash [Hash<String, String>] 字符串翻译表
798
+ #
715
799
  # @return [void]
716
800
  def in_strings(hash)
717
801
  case @code
@@ -721,6 +805,8 @@ module R3EXS
721
805
  @parameter = hash[@parameter] || @parameter
722
806
  when 205
723
807
  @parameter.in_strings(hash)
808
+ when 505
809
+ @parameter.in_strings(hash)
724
810
  else
725
811
  puts "Unknown code: #{@code}"
726
812
  end
@@ -732,37 +818,31 @@ module R3EXS
732
818
  def empty?
733
819
  @index == -1
734
820
  end
821
+ end
822
+
823
+ # 公共事件类
824
+ class CommonEvent
735
825
 
736
826
  # 在原始数组中的索引
737
827
  #
738
828
  # @return [Integer]
739
829
  attr_accessor :index
740
830
 
741
- # 事件指令代码
742
- #
743
- # @return [Integer]
744
- attr_accessor :code
745
-
746
- # 事件指令用途
831
+ # 公共事件名称
747
832
  #
748
833
  # @return [String]
749
- attr_accessor :usage
834
+ attr_accessor :name
750
835
 
751
- # 事件指令参数
836
+ # 事件指令列表
752
837
  #
753
- # @note 当 '@code' 为 102 时, parameter 是一个字符串数组
754
- # @return [String] if @code != 102
755
- # @return [Array<String>] if @code == 102
756
- attr_accessor :parameter
757
- end
758
-
759
- # 公共事件类
760
- class CommonEvent
838
+ # @return [Array<R3EXS::EventCommand>]
839
+ attr_accessor :list
761
840
 
762
841
  # 用 RPG::CommonEvent 初始化
763
842
  #
764
843
  # @param commonevent [RPG::CommonEvent] 待处理的 RPG::CommonEvent 对象
765
844
  # @param index [Integer] 在原始数组中的索引
845
+ #
766
846
  # @return [R3EXS::CommonEvent]
767
847
  def initialize(commonevent, index, _unused = nil)
768
848
  @index = index
@@ -776,7 +856,9 @@ module R3EXS
776
856
  end
777
857
 
778
858
  # 注入到 RPG::CommonEvent 对象
859
+ #
779
860
  # @param commonevent [RPG::CommonEvent] 待注入的 RPG::CommonEvent 对象
861
+ #
780
862
  # @return [void]
781
863
  def inject_to(commonevent)
782
864
  commonevent.name = @name
@@ -799,6 +881,7 @@ module R3EXS
799
881
  # 将所有的字符串替换为指定的字符串
800
882
  #
801
883
  # @param hash [Hash<String, String>] 字符串翻译表
884
+ #
802
885
  # @return [void]
803
886
  def in_strings(hash)
804
887
  @name = hash[@name] || @name
@@ -813,31 +896,17 @@ module R3EXS
813
896
  def empty?
814
897
  @name.to_s.empty? && @list.empty?
815
898
  end
899
+ end
816
900
 
817
- # 在原始数组中的索引
818
- #
819
- # @return [Integer]
820
- attr_accessor :index
901
+ # 敌人类
902
+ class Enemy < BaseItem
821
903
 
822
- # 公共事件名称
823
- #
824
- # @return [String]
825
- attr_accessor :name
826
-
827
- # 事件指令列表
828
- #
829
- # @return [Array<R3EXS::EventCommand>]
830
- attr_accessor :list
831
- end
832
-
833
- # 敌人类
834
- class Enemy < BaseItem
835
-
836
- # 用 RPG::Enemy 初始化
904
+ # 用 RPG::Enemy 初始化
837
905
  #
838
906
  # @param enemy [RPG::Enemy] 待处理的 RPG::Enemy 对象
839
907
  # @param index [Integer] 在原始数组中的索引
840
908
  # @param with_note [Boolean] 是否处理 note 字段
909
+ #
841
910
  # @return [R3EXS::Enemy]
842
911
  def initialize(enemy, index, with_note)
843
912
  super(enemy, index, with_note)
@@ -847,6 +916,7 @@ module R3EXS
847
916
  # 注入到 RPG::Enemy 对象
848
917
  #
849
918
  # @param enemy [RPG::Enemy] 待注入的 RPG::Enemy 对象
919
+ #
850
920
  # @return [void]
851
921
  def inject_to(enemy)
852
922
  super
@@ -859,9 +929,19 @@ module R3EXS
859
929
  super
860
930
  end
861
931
 
932
+ # 提取术语表
933
+ #
934
+ # @return [Array<GlossaryItem>]
935
+ def ex_glossary
936
+ glossary = []
937
+ glossary << GlossaryItem.new(@name, '敌人名称')
938
+ glossary
939
+ end
940
+
862
941
  # 将所有的字符串替换为指定的字符串
863
942
  #
864
943
  # @param hash [Hash<String, String>] 字符串翻译表
944
+ #
865
945
  # @return [void]
866
946
  def in_strings(hash)
867
947
  super(hash)
@@ -873,7 +953,6 @@ module R3EXS
873
953
  def empty?
874
954
  super
875
955
  end
876
-
877
956
  end
878
957
 
879
958
  # 可使用物品类
@@ -884,6 +963,7 @@ module R3EXS
884
963
  # @param usableitem [RPG::UsableItem] 待处理的 RPG::UsableItem 对象
885
964
  # @param index [Integer] 在原始数组中的索引
886
965
  # @param with_note [Boolean] 是否处理 note 字段
966
+ #
887
967
  # @return [R3EXS::UsableItem]
888
968
  def initialize(usableitem, index, with_note)
889
969
  super(usableitem, index, with_note)
@@ -892,6 +972,7 @@ module R3EXS
892
972
  # 注入到 RPG::UsableItem 对象
893
973
  #
894
974
  # @param usableitem [RPG::UsableItem] 待注入的 RPG::UsableItem 对象
975
+ #
895
976
  # @return [void]
896
977
  def inject_to(usableitem)
897
978
  super
@@ -907,6 +988,7 @@ module R3EXS
907
988
  # 将所有的字符串替换为指定的字符串
908
989
  #
909
990
  # @param hash [Hash<String, String>] 字符串翻译表
991
+ #
910
992
  # @return [void]
911
993
  def in_strings(hash)
912
994
  super(hash)
@@ -928,13 +1010,16 @@ module R3EXS
928
1010
  # @param item [RPG::Item] 待处理的 RPG::Item 对象
929
1011
  # @param index [Integer] 在原始数组中的索引
930
1012
  # @param with_note [Boolean] 是否处理 note 字段
1013
+ #
931
1014
  # @return [R3EXS::Item]
932
1015
  def initialize(item, index, with_note)
933
1016
  super(item, index, with_note)
934
1017
  end
935
1018
 
936
1019
  # 注入到 RPG::Item 对象
1020
+ #
937
1021
  # @param item [RPG::Item] 待注入的 RPG::Item 对象
1022
+ #
938
1023
  # @return [void]
939
1024
  def inject_to(item)
940
1025
  super
@@ -947,9 +1032,19 @@ module R3EXS
947
1032
  super
948
1033
  end
949
1034
 
1035
+ # 提取术语表
1036
+ #
1037
+ # @return [Array<GlossaryItem>]
1038
+ def ex_glossary
1039
+ glossary = []
1040
+ glossary << GlossaryItem.new(@name, '物品名称')
1041
+ glossary
1042
+ end
1043
+
950
1044
  # 将所有的字符串替换为指定的字符串
951
1045
  #
952
1046
  # @param hash [Hash<String, String>] 字符串翻译表
1047
+ #
953
1048
  # @return [void]
954
1049
  def in_strings(hash)
955
1050
  super(hash)
@@ -966,13 +1061,39 @@ module R3EXS
966
1061
  # 事件类
967
1062
  class Event
968
1063
 
1064
+ # 在原始哈希表中的键
1065
+ #
1066
+ # @return [Integer]
1067
+ attr_accessor :index
1068
+
1069
+ # 事件名称
1070
+ #
1071
+ # @return [String]
1072
+ attr_accessor :name
1073
+
1074
+ # 事件页列表
1075
+ #
1076
+ # @return [Array<R3EXS::Event::Page>]
1077
+ attr_accessor :pages
1078
+
969
1079
  # 事件页类
970
1080
  class Page
971
1081
 
1082
+ # 在原始数组中的索引
1083
+ #
1084
+ # @return [Integer]
1085
+ attr_accessor :index
1086
+
1087
+ # 事件指令列表
1088
+ #
1089
+ # @return [Array<R3EXS::EventCommand>]
1090
+ attr_accessor :list
1091
+
972
1092
  # 用 RPG::Event::Page 初始化
973
1093
  #
974
1094
  # @param page [RPG::Event::Page] 待处理的 RPG::Event::Page 对象
975
1095
  # @param index [Integer] 在原始数组中的索引
1096
+ #
976
1097
  # @return [R3EXS::Event::Page]
977
1098
  def initialize(page, index)
978
1099
  @index = index
@@ -987,6 +1108,7 @@ module R3EXS
987
1108
  # 注入到 RPG::Event::Page 对象
988
1109
  #
989
1110
  # @param page [RPG::Event::Page] 待注入的 RPG::Event::Page 对象
1111
+ #
990
1112
  # @return [void]
991
1113
  def inject_to(page)
992
1114
  @list.each do |eventcommand|
@@ -1008,6 +1130,7 @@ module R3EXS
1008
1130
  # 将所有的字符串替换为指定的字符串
1009
1131
  #
1010
1132
  # @param hash [Hash<String, String>] 字符串翻译表
1133
+ #
1011
1134
  # @return [void]
1012
1135
  def in_strings(hash)
1013
1136
  @list.each do |eventcommand|
@@ -1021,22 +1144,13 @@ module R3EXS
1021
1144
  def empty?
1022
1145
  @list.empty?
1023
1146
  end
1024
-
1025
- # 在原始数组中的索引
1026
- #
1027
- # @return [Integer]
1028
- attr_accessor :index
1029
-
1030
- # 事件指令列表
1031
- #
1032
- # @return [Array<R3EXS::EventCommand>]
1033
- attr_accessor :list
1034
1147
  end
1035
1148
 
1036
1149
  # 用 RPG::Event 初始化
1037
1150
  #
1038
1151
  # @param event [RPG::Event] 待处理的 RPG::Event 对象
1039
1152
  # @param index [Integer] 在原始哈希表中的键
1153
+ #
1040
1154
  # @return [R3EXS::Event]
1041
1155
  def initialize(event, index)
1042
1156
  @index = index
@@ -1052,6 +1166,7 @@ module R3EXS
1052
1166
  # 注入到 RPG::Event 对象
1053
1167
  #
1054
1168
  # @param event [RPG::Event] 待注入的 RPG::Event 对象
1169
+ #
1055
1170
  # @return [void]
1056
1171
  def inject_to(event)
1057
1172
  event.name = @name
@@ -1074,6 +1189,7 @@ module R3EXS
1074
1189
  # 将所有的字符串替换为指定的字符串
1075
1190
  #
1076
1191
  # @param hash [Hash<String, String>] 字符串翻译表
1192
+ #
1077
1193
  # @return [void]
1078
1194
  def in_strings(hash)
1079
1195
  @name = hash[@name] || @name
@@ -1088,29 +1204,31 @@ module R3EXS
1088
1204
  def empty?
1089
1205
  @name.to_s.empty? && @pages.empty?
1090
1206
  end
1207
+ end
1091
1208
 
1092
- # 在原始哈希表中的键
1093
- #
1094
- # @return [Integer]
1095
- attr_accessor :index
1209
+ # 地图类
1210
+ class Map
1096
1211
 
1097
- # 事件名称
1212
+ # 地图显示名称
1098
1213
  #
1099
1214
  # @return [String]
1100
- attr_accessor :name
1215
+ attr_accessor :display_name
1101
1216
 
1102
- # 事件页列表
1217
+ # 地图注释
1103
1218
  #
1104
- # @return [Array<R3EXS::Event::Page>]
1105
- attr_accessor :pages
1106
- end
1219
+ # @return [String]
1220
+ attr_accessor :note
1107
1221
 
1108
- # 地图类
1109
- class Map
1222
+ # 事件列表
1223
+ #
1224
+ # @return [Array<R3EXS::Event>]
1225
+ attr_accessor :events
1110
1226
 
1111
1227
  # 用 RPG::Map 初始化
1228
+ #
1112
1229
  # @param map [RPG::Map] 待处理的 RPG::Map 对象
1113
1230
  # @param with_note [Boolean] 是否处理 note 字段
1231
+ #
1114
1232
  # @return [R3EXS::Map]
1115
1233
  def initialize(map, with_note)
1116
1234
  @display_name = map.display_name
@@ -1127,6 +1245,7 @@ module R3EXS
1127
1245
  # 注入到 RPG::Map 对象
1128
1246
  #
1129
1247
  # @param map [RPG::Map] 待注入的 RPG::Map 对象
1248
+ #
1130
1249
  # @return [void]
1131
1250
  def inject_to(map)
1132
1251
  map.display_name = @display_name
@@ -1149,9 +1268,19 @@ module R3EXS
1149
1268
  strings
1150
1269
  end
1151
1270
 
1271
+ # 提取术语表
1272
+ #
1273
+ # @return [Array<GlossaryItem>]
1274
+ def ex_glossary
1275
+ glossary = []
1276
+ glossary << GlossaryItem.new(@display_name, '地图名称')
1277
+ glossary
1278
+ end
1279
+
1152
1280
  # 将所有的字符串替换为指定的字符串
1153
1281
  #
1154
1282
  # @param hash [Hash<String, String>] 字符串翻译表
1283
+ #
1155
1284
  # @return [void]
1156
1285
  def in_strings(hash)
1157
1286
  @display_name = hash[@display_name] || @display_name
@@ -1160,29 +1289,26 @@ module R3EXS
1160
1289
  event.in_strings(hash)
1161
1290
  end
1162
1291
  end
1292
+ end
1163
1293
 
1164
- # 地图显示名称
1165
- #
1166
- # @return [String]
1167
- attr_accessor :display_name
1294
+ # 地图信息类
1295
+ class MapInfo
1168
1296
 
1169
- # 地图注释
1297
+ # 在原始哈希表中的键
1170
1298
  #
1171
- # @return [String]
1172
- attr_accessor :note
1299
+ # @return [Integer]
1300
+ attr_accessor :index
1173
1301
 
1174
- # 事件列表
1302
+ # 地图内部名称
1175
1303
  #
1176
- # @return [Array<R3EXS::Event>]
1177
- attr_accessor :events
1178
- end
1179
-
1180
- # 地图信息类
1181
- class MapInfo
1304
+ # @return [String]
1305
+ attr_accessor :name
1182
1306
 
1183
1307
  # 用 RPG::MapInfo 初始化
1308
+ #
1184
1309
  # @param mapinfo [RPG::MapInfo] 待处理的 RPG::MapInfo 对象
1185
1310
  # @param index [Integer] 在原始哈希表中的键
1311
+ #
1186
1312
  # @return [R3EXS::MapInfo]
1187
1313
  def initialize(mapinfo, index, _unused = nil)
1188
1314
  @index = index
@@ -1192,6 +1318,7 @@ module R3EXS
1192
1318
  # 注入到 RPG::MapInfo 对象
1193
1319
  #
1194
1320
  # @param mapinfo [RPG::MapInfo] 待注入的 RPG::MapInfo 对象
1321
+ #
1195
1322
  # @return [void]
1196
1323
  def inject_to(mapinfo)
1197
1324
  mapinfo.name = @name
@@ -1204,32 +1331,44 @@ module R3EXS
1204
1331
  [@name]
1205
1332
  end
1206
1333
 
1334
+ # 提取术语表
1335
+ #
1336
+ # @return [Array<GlossaryItem>]
1337
+ def ex_glossary
1338
+ glossary = []
1339
+ glossary << GlossaryItem.new(@name, '地图名称')
1340
+ glossary
1341
+ end
1342
+
1207
1343
  # 将所有的字符串替换为指定的字符串
1208
1344
  #
1209
1345
  # @param hash [Hash<String, String>] 字符串翻译表
1346
+ #
1210
1347
  # @return [void]
1211
1348
  def in_strings(hash)
1212
1349
  @name = hash[@name] || @name
1213
1350
  end
1351
+ end
1214
1352
 
1215
- # 在原始哈希表中的键
1216
- #
1217
- # @return [Integer]
1218
- attr_accessor :index
1353
+ # 技能类
1354
+ class Skill < UsableItem
1219
1355
 
1220
- # 地图内部名称
1356
+ # 技能使用时的消息
1221
1357
  #
1222
1358
  # @return [String]
1223
- attr_accessor :name
1224
- end
1359
+ attr_accessor :message1
1225
1360
 
1226
- # 技能类
1227
- class Skill < UsableItem
1361
+ # 技能使用时的消息
1362
+ #
1363
+ # @return [String]
1364
+ attr_accessor :message2
1228
1365
 
1229
1366
  # 用 RPG::Skill 初始化
1367
+ #
1230
1368
  # @param skill [RPG::Skill] 待处理的 RPG::Skill 对象
1231
1369
  # @param index [Integer] 在原始数组中的索引
1232
1370
  # @param with_note [Boolean] 是否处理 note 字段
1371
+ #
1233
1372
  # @return [R3EXS::Skill]
1234
1373
  def initialize(skill, index, with_note)
1235
1374
  super(skill, index, with_note)
@@ -1240,6 +1379,7 @@ module R3EXS
1240
1379
  # 注入到 RPG::Skill 对象
1241
1380
  #
1242
1381
  # @param skill [RPG::Skill] 待注入的 RPG::Skill 对象
1382
+ #
1243
1383
  # @return [void]
1244
1384
  def inject_to(skill)
1245
1385
  super
@@ -1257,9 +1397,19 @@ module R3EXS
1257
1397
  strings
1258
1398
  end
1259
1399
 
1400
+ # 提取术语表
1401
+ #
1402
+ # @return [Array<GlossaryItem>]
1403
+ def ex_glossary
1404
+ glossary = []
1405
+ glossary << GlossaryItem.new(@name, '技能名称')
1406
+ glossary
1407
+ end
1408
+
1260
1409
  # 将所有的字符串替换为指定的字符串
1261
1410
  #
1262
1411
  # @param hash [Hash<String, String>] 字符串翻译表
1412
+ #
1263
1413
  # @return [void]
1264
1414
  def in_strings(hash)
1265
1415
  super(hash)
@@ -1273,26 +1423,37 @@ module R3EXS
1273
1423
  def empty?
1274
1424
  super && @message1.to_s.empty? && @message2.to_s.empty?
1275
1425
  end
1426
+ end
1276
1427
 
1277
- # 技能使用时的消息
1428
+ # 状态类
1429
+ class State < BaseItem
1430
+
1431
+ # 状态应用队员时的消息
1278
1432
  #
1279
1433
  # @return [String]
1280
1434
  attr_accessor :message1
1281
1435
 
1282
- # 技能使用时的消息
1436
+ # 状态应用敌人时的消息
1283
1437
  #
1284
1438
  # @return [String]
1285
1439
  attr_accessor :message2
1286
- end
1287
1440
 
1288
- # 状态类
1289
- class State < BaseItem
1441
+ # 状态保持时的消息
1442
+ #
1443
+ # @return [String]
1444
+ attr_accessor :message3
1445
+
1446
+ # 状态解除时的消息
1447
+ #
1448
+ # @return [String]
1449
+ attr_accessor :message4
1290
1450
 
1291
1451
  # 用 RPG::State 初始化
1292
1452
  #
1293
1453
  # @param state [RPG::State] 待处理的 RPG::State 对象
1294
1454
  # @param index [Integer] 在原始数组中的索引
1295
1455
  # @param with_note [Boolean] 是否处理 note 字段
1456
+ #
1296
1457
  # @return [R3EXS::State]
1297
1458
  def initialize(state, index, with_note)
1298
1459
  super(state, index, with_note)
@@ -1306,6 +1467,7 @@ module R3EXS
1306
1467
  # 注入到 RPG::State 对象
1307
1468
  #
1308
1469
  # @param state [RPG::State] 待注入的 RPG::State 对象
1470
+ #
1309
1471
  # @return [void]
1310
1472
  def inject_to(state)
1311
1473
  super
@@ -1327,9 +1489,19 @@ module R3EXS
1327
1489
  strings
1328
1490
  end
1329
1491
 
1492
+ # 提取术语表
1493
+ #
1494
+ # @return [Array<GlossaryItem>]
1495
+ def ex_glossary
1496
+ glossary = []
1497
+ glossary << GlossaryItem.new(@name, '状态名称')
1498
+ glossary
1499
+ end
1500
+
1330
1501
  # 将所有的字符串替换为指定的字符串
1331
1502
  #
1332
1503
  # @param hash [Hash<String, String>] 字符串翻译表
1504
+ #
1333
1505
  # @return [void]
1334
1506
  def in_strings(hash)
1335
1507
  super(hash)
@@ -1345,37 +1517,83 @@ module R3EXS
1345
1517
  def empty?
1346
1518
  super && @message1.to_s.empty? && @message2.to_s.empty? && @message3.to_s.empty? && @message4.to_s.empty?
1347
1519
  end
1520
+ end
1348
1521
 
1349
- # 状态应用队员时的消息
1522
+ # 系统类
1523
+ class System
1524
+
1525
+ # 游戏标题
1350
1526
  #
1351
1527
  # @return [String]
1352
- attr_accessor :message1
1528
+ attr_accessor :game_title
1353
1529
 
1354
- # 状态应用敌人时的消息
1530
+ # 货币单位
1355
1531
  #
1356
1532
  # @return [String]
1357
- attr_accessor :message2
1533
+ attr_accessor :currency_unit
1358
1534
 
1359
- # 状态保持时的消息
1535
+ # 属性名称
1360
1536
  #
1361
- # @return [String]
1362
- attr_accessor :message3
1537
+ # @return [Array<String>]
1538
+ attr_accessor :elements
1363
1539
 
1364
- # 状态解除时的消息
1540
+ # 技能类型名称
1365
1541
  #
1366
- # @return [String]
1367
- attr_accessor :message4
1368
- end
1542
+ # @return [Array<String>]
1543
+ attr_accessor :skill_types
1369
1544
 
1370
- # 系统类
1371
- class System
1545
+ # 武器类型名称
1546
+ #
1547
+ # @return [Array<String>]
1548
+ attr_accessor :weapon_types
1549
+
1550
+ # 防具类型名称
1551
+ #
1552
+ # @return [Array<String>]
1553
+ attr_accessor :armor_types
1554
+
1555
+ # 开关名称
1556
+ #
1557
+ # @return [Array<String>]
1558
+ attr_accessor :switches
1559
+
1560
+ # 变量名称
1561
+ #
1562
+ # @return [Array<String>]
1563
+ attr_accessor :variables
1564
+
1565
+ # 系统术语
1566
+ #
1567
+ # @return [R3EXS::System::Terms]
1568
+ attr_accessor :terms
1372
1569
 
1373
1570
  # 术语类
1374
1571
  class Terms
1375
1572
 
1573
+ # 基本术语
1574
+ #
1575
+ # @return [Array<String>]
1576
+ attr_accessor :basic
1577
+
1578
+ # 属性名称
1579
+ #
1580
+ # @return [Array<String>]
1581
+ attr_accessor :params
1582
+
1583
+ # 装备类型名称
1584
+ #
1585
+ # @return [Array<String>]
1586
+ attr_accessor :etypes
1587
+
1588
+ # 命令名称
1589
+ #
1590
+ # @return [Array<String>]
1591
+ attr_accessor :commands
1592
+
1376
1593
  # 用 RPG::System::Terms 初始化
1377
1594
  #
1378
1595
  # @param terms [RPG::System::Terms] 待处理的 RPG::System::Terms 对象
1596
+ #
1379
1597
  # @return [R3EXS::System::Terms]
1380
1598
  def initialize(terms)
1381
1599
  @basic = terms.basic
@@ -1387,6 +1605,7 @@ module R3EXS
1387
1605
  # 注入到 RPG::System::Terms 对象
1388
1606
  #
1389
1607
  # @param terms [RPG::System::Terms] 待注入的 RPG::System::Terms 对象
1608
+ #
1390
1609
  # @return [void]
1391
1610
  def inject_to(terms)
1392
1611
  terms.basic = @basic
@@ -1407,9 +1626,30 @@ module R3EXS
1407
1626
  strings
1408
1627
  end
1409
1628
 
1629
+ # 提取术语表
1630
+ #
1631
+ # @return [Array<GlossaryItem>]
1632
+ def ex_glossary
1633
+ glossary = []
1634
+ @basic.each do |string|
1635
+ glossary << GlossaryItem.new(string, '基本术语')
1636
+ end
1637
+ @params.each do |string|
1638
+ glossary << GlossaryItem.new(string, '计量单位名称')
1639
+ end
1640
+ @etypes.each do |string|
1641
+ glossary << GlossaryItem.new(string, '装备类型名称')
1642
+ end
1643
+ @commands.each do |string|
1644
+ glossary << GlossaryItem.new(string, '指令名称')
1645
+ end
1646
+ glossary
1647
+ end
1648
+
1410
1649
  # 将所有的字符串替换为指定的字符串
1411
1650
  #
1412
1651
  # @param hash [Hash<String, String>] 字符串翻译表
1652
+ #
1413
1653
  # @return [void]
1414
1654
  def in_strings(hash)
1415
1655
  @basic.map! { |string| hash[string] || string }
@@ -1417,31 +1657,12 @@ module R3EXS
1417
1657
  @etypes.map! { |string| hash[string] || string }
1418
1658
  @commands.map! { |string| hash[string] || string }
1419
1659
  end
1420
-
1421
- # 基本术语
1422
- #
1423
- # @return [Array<String>]
1424
- attr_accessor :basic
1425
-
1426
- # 属性名称
1427
- #
1428
- # @return [Array<String>]
1429
- attr_accessor :params
1430
-
1431
- # 装备类型名称
1432
- #
1433
- # @return [Array<String>]
1434
- attr_accessor :etypes
1435
-
1436
- # 命令名称
1437
- #
1438
- # @return [Array<String>]
1439
- attr_accessor :commands
1440
1660
  end
1441
1661
 
1442
1662
  # 用 RPG::System 初始化
1443
1663
  #
1444
1664
  # @param system [RPG::System] 待处理的 RPG::System 对象
1665
+ #
1445
1666
  # @return [R3EXS::System]
1446
1667
  def initialize(system, _unused = nil)
1447
1668
  @game_title = system.game_title
@@ -1458,6 +1679,7 @@ module R3EXS
1458
1679
  # 注入到 RPG::System 对象
1459
1680
  #
1460
1681
  # @param system [RPG::System] 待注入的 RPG::System 对象
1682
+ #
1461
1683
  # @return [void]
1462
1684
  def inject_to(system)
1463
1685
  system.game_title = @game_title
@@ -1488,9 +1710,32 @@ module R3EXS
1488
1710
  strings
1489
1711
  end
1490
1712
 
1713
+ # 提取术语表
1714
+ #
1715
+ # @return [Array<GlossaryItem>]
1716
+ def ex_glossary
1717
+ glossary = []
1718
+ glossary << GlossaryItem.new(@game_title, '游戏标题')
1719
+ glossary << GlossaryItem.new(@currency_unit, '货币单位')
1720
+ @elements.each do |element|
1721
+ glossary << GlossaryItem.new(element, '属性名称')
1722
+ end
1723
+ @skill_types.each do |skill_type|
1724
+ glossary << GlossaryItem.new(skill_type, '技能类型名称')
1725
+ end
1726
+ @weapon_types.each do |weapon_type|
1727
+ glossary << GlossaryItem.new(weapon_type, '武器类型名称')
1728
+ end
1729
+ @armor_types.each do |armor_type|
1730
+ glossary << GlossaryItem.new(armor_type, '防具类型名称')
1731
+ end
1732
+ glossary.concat(@terms.ex_glossary)
1733
+ end
1734
+
1491
1735
  # 将所有的字符串替换为指定的字符串
1492
1736
  #
1493
1737
  # @param hash [Hash<String, String>] 字符串翻译表
1738
+ #
1494
1739
  # @return [void]
1495
1740
  def in_strings(hash)
1496
1741
  @game_title = hash[@game_title] || @game_title
@@ -1503,61 +1748,32 @@ module R3EXS
1503
1748
  @variables.map! { |string| hash[string] || string }
1504
1749
  @terms.in_strings(hash)
1505
1750
  end
1751
+ end
1506
1752
 
1507
- # 游戏标题
1508
- #
1509
- # @return [String]
1510
- attr_accessor :game_title
1511
-
1512
- # 货币单位
1513
- #
1514
- # @return [String]
1515
- attr_accessor :currency_unit
1516
-
1517
- # 属性名称
1518
- #
1519
- # @return [Array<String>]
1520
- attr_accessor :elements
1521
-
1522
- # 技能类型名称
1523
- #
1524
- # @return [Array<String>]
1525
- attr_accessor :skill_types
1526
-
1527
- # 武器类型名称
1528
- #
1529
- # @return [Array<String>]
1530
- attr_accessor :weapon_types
1531
-
1532
- # 防具类型名称
1533
- #
1534
- # @return [Array<String>]
1535
- attr_accessor :armor_types
1753
+ # 图块类
1754
+ class Tileset
1536
1755
 
1537
- # 开关名称
1756
+ # 在原始数组中的索引
1538
1757
  #
1539
- # @return [Array<String>]
1540
- attr_accessor :switches
1758
+ # @return [Integer]
1759
+ attr_accessor :index
1541
1760
 
1542
- # 变量名称
1761
+ # 图块名称
1543
1762
  #
1544
- # @return [Array<String>]
1545
- attr_accessor :variables
1763
+ # @return [String]
1764
+ attr_accessor :name
1546
1765
 
1547
- # 系统术语
1766
+ # 图块注释
1548
1767
  #
1549
- # @return [R3EXS::System::Terms]
1550
- attr_accessor :terms
1551
- end
1552
-
1553
- # 图块类
1554
- class Tileset
1768
+ # @return [String]
1769
+ attr_accessor :note
1555
1770
 
1556
1771
  # 用 RPG::Tileset 初始化
1557
1772
  #
1558
1773
  # @param tileset [RPG::Tileset] 待处理的 RPG::Tileset 对象
1559
1774
  # @param index [Integer] 在原始数组中的索引
1560
1775
  # @param with_note [Boolean] 是否处理 note 字段
1776
+ #
1561
1777
  # @return [R3EXS::Tileset]
1562
1778
  def initialize(tileset, index, with_note)
1563
1779
  @index = index
@@ -1569,6 +1785,7 @@ module R3EXS
1569
1785
  # 注入到 RPG::Tileset 对象
1570
1786
  #
1571
1787
  # @param tileset [RPG::Tileset] 待注入的 RPG::Tileset 对象
1788
+ #
1572
1789
  # @return [void]
1573
1790
  def inject_to(tileset)
1574
1791
  tileset.name = @name
@@ -1588,6 +1805,7 @@ module R3EXS
1588
1805
  # 将所有的字符串替换为指定的字符串
1589
1806
  #
1590
1807
  # @param hash [Hash<String, String>] 字符串翻译表
1808
+ #
1591
1809
  # @return [void]
1592
1810
  def in_strings(hash)
1593
1811
  @name = hash[@name] || @name
@@ -1600,33 +1818,44 @@ module R3EXS
1600
1818
  def empty?
1601
1819
  @name.to_s.empty? && @note.to_s.empty?
1602
1820
  end
1821
+ end
1822
+
1823
+ # 敌群类
1824
+ class Troop
1603
1825
 
1604
1826
  # 在原始数组中的索引
1605
1827
  #
1606
1828
  # @return [Integer]
1607
1829
  attr_accessor :index
1608
1830
 
1609
- # 图块名称
1831
+ # 敌群名称
1610
1832
  #
1611
1833
  # @return [String]
1612
1834
  attr_accessor :name
1613
1835
 
1614
- # 图块注释
1836
+ # 敌群页列表
1615
1837
  #
1616
- # @return [String]
1617
- attr_accessor :note
1618
- end
1619
-
1620
- # 敌群类
1621
- class Troop
1838
+ # @return [Array<R3EXS::Troop::Page>]
1839
+ attr_accessor :pages
1622
1840
 
1623
1841
  # 敌群页类
1624
1842
  class Page
1625
1843
 
1844
+ # 在原始数组中的索引
1845
+ #
1846
+ # @return [Integer]
1847
+ attr_accessor :index
1848
+
1849
+ # 事件指令列表
1850
+ #
1851
+ # @return [Array<R3EXS::EventCommand>]
1852
+ attr_accessor :list
1853
+
1626
1854
  # 用 RPG::Troop::Page 初始化
1627
1855
  #
1628
1856
  # @param page [RPG::Troop::Page] 待处理的 RPG::Troop::Page 对象
1629
1857
  # @param index [Integer] 在原始数组中的索引
1858
+ #
1630
1859
  # @return [R3EXS::Troop::Page]
1631
1860
  def initialize(page, index)
1632
1861
  @index = index
@@ -1641,6 +1870,7 @@ module R3EXS
1641
1870
  # 注入到 RPG::Troop::Page 对象
1642
1871
  #
1643
1872
  # @param page [RPG::Troop::Page] 待注入的 RPG::Troop::Page 对象
1873
+ #
1644
1874
  # @return [void]
1645
1875
  def inject_to(page)
1646
1876
  @list.each do |eventcommand|
@@ -1662,6 +1892,7 @@ module R3EXS
1662
1892
  # 将所有的字符串替换为指定的字符串
1663
1893
  #
1664
1894
  # @param hash [Hash<String, String>] 字符串翻译表
1895
+ #
1665
1896
  # @return [void]
1666
1897
  def in_strings(hash)
1667
1898
  @list.each do |eventcommand|
@@ -1675,21 +1906,13 @@ module R3EXS
1675
1906
  def empty?
1676
1907
  @list.empty?
1677
1908
  end
1678
-
1679
- # 在原始数组中的索引
1680
- #
1681
- # @return [Integer]
1682
- attr_accessor :index
1683
-
1684
- # 事件指令列表
1685
- #
1686
- # @return [Array<R3EXS::EventCommand>]
1687
- attr_accessor :list
1688
1909
  end
1689
1910
 
1690
1911
  # 用 RPG::Troop 初始化
1912
+ #
1691
1913
  # @param troop [RPG::Troop] 待处理的 RPG::Troop 对象
1692
1914
  # @param index [Integer] 在原始数组中的索引
1915
+ #
1693
1916
  # @return [R3EXS::Troop]
1694
1917
  def initialize(troop, index, _unused = nil)
1695
1918
  @index = index
@@ -1705,6 +1928,7 @@ module R3EXS
1705
1928
  # 注入到 RPG::Troop 对象
1706
1929
  #
1707
1930
  # @param troop [RPG::Troop] 待注入的 RPG::Troop 对象
1931
+ #
1708
1932
  # @return [void]
1709
1933
  def inject_to(troop)
1710
1934
  troop.name = @name
@@ -1727,6 +1951,7 @@ module R3EXS
1727
1951
  # 将所有的字符串替换为指定的字符串
1728
1952
  #
1729
1953
  # @param hash [Hash<String, String>] 字符串翻译表
1954
+ #
1730
1955
  # @return [void]
1731
1956
  def in_strings(hash)
1732
1957
  @name = hash[@name] || @name
@@ -1741,30 +1966,17 @@ module R3EXS
1741
1966
  def empty?
1742
1967
  @name.to_s.empty? && @pages.empty?
1743
1968
  end
1744
-
1745
- # 在原始数组中的索引
1746
- #
1747
- # @return [Integer]
1748
- attr_accessor :index
1749
-
1750
- # 敌群名称
1751
- #
1752
- # @return [String]
1753
- attr_accessor :name
1754
-
1755
- # 敌群页列表
1756
- #
1757
- # @return [Array<R3EXS::Troop::Page>]
1758
- attr_accessor :pages
1759
1969
  end
1760
1970
 
1761
1971
  # 武器类
1762
1972
  class Weapon < EquipItem
1763
1973
 
1764
1974
  # 用 RPG::Weapon 初始化
1975
+ #
1765
1976
  # @param weapon [RPG::Weapon] 待处理的 RPG::Weapon 对象
1766
1977
  # @param index [Integer] 在原始数组中的索引
1767
1978
  # @param with_note [Boolean] 是否处理 note 字段
1979
+ #
1768
1980
  # @return [R3EXS::Weapon]
1769
1981
  def initialize(weapon, index, with_note)
1770
1982
  super(weapon, index, with_note)
@@ -1773,6 +1985,7 @@ module R3EXS
1773
1985
  # 注入到 RPG::Weapon 对象
1774
1986
  #
1775
1987
  # @param weapon [RPG::Weapon] 待注入的 RPG::Weapon 对象
1988
+ #
1776
1989
  # @return [void]
1777
1990
  def inject_to(weapon)
1778
1991
  super
@@ -1785,9 +1998,19 @@ module R3EXS
1785
1998
  super
1786
1999
  end
1787
2000
 
2001
+ # 提取术语表
2002
+ #
2003
+ # @return [Array<GlossaryItem>]
2004
+ def ex_glossary
2005
+ glossary = []
2006
+ glossary << GlossaryItem.new(@name, '武器名称')
2007
+ glossary
2008
+ end
2009
+
1788
2010
  # 将所有的字符串替换为指定的字符串
1789
2011
  #
1790
2012
  # @param hash [Hash<String, String>] 字符串翻译表
2013
+ #
1791
2014
  # @return [void]
1792
2015
  def in_strings(hash)
1793
2016
  super(hash)