1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
| #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ Ÿ—a‚©‚è Š | KGC_Depository Ÿ
#_/----------------------------------------------------------------------------
#_/ ƒAƒCƒeƒ€‚â ŠŽ ‹à‚ð—a‚¯‚邱‚Æ‚ª‚Å‚«‚é“X‚ð ì ¬‚µ‚Ü‚· B
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#====================================================================
# š ƒJƒXƒ^ƒ}ƒCƒY €–Ú š
#====================================================================
module KGC
$game_special_elements = {}
$imported = {}
$data_states = load_data("Data/States.rxdata")
$data_system = load_data("Data/System.rxdata")
# Ÿ‘€ ìƒEƒBƒ“ƒhƒE‚̃Rƒ}ƒ“ƒh–¼
DEPOSITORY_COMMAND = [
"Deposer Or.", # ‚¨‹à‚ð—a‚¯‚é
"Reprendre Or.", # ‚¨‹à‚ðˆø‚« o‚·
"Deposer Obj.", # ƒAƒCƒeƒ€‚ð—a‚¯‚é
"Reprendre Obj." # ƒAƒCƒeƒ€‚ðˆø‚« o‚·
]
# Ÿ‘€ ìƒEƒBƒ“ƒhƒE‚̃wƒ‹ƒv
DEPOSITORY_HELP = [
"Permet de deposer de l'or dans la banque.", # ‚¨‹à‚ð—a‚¯‚é
"Permet de reprendre l'or laissé à la banque.", # ‚¨‹à‚ðˆø‚« o‚·
"Permet de deposer des Objets dans la banque.", # ƒAƒCƒeƒ€‚ð—a‚¯‚é
"Permet de reprendre les Objets laissés à la banque." # ƒAƒCƒeƒ€‚ðˆø‚« o‚·
]
# Ÿ‹àŠzŽw’è‚ÌŒ… ”
DEPOSITORY_GOLD_DIGITS = 7
# ŸƒS [ƒ‹ƒh‚ð—a‚¯‚é ۂ̃ ƒbƒZ [ƒW(ƒwƒ‹ƒvƒEƒBƒ“ƒhƒE)
DEPOSIT_GOLD = "Choisissez la quantité d'or à deposer."
# ŸƒS [ƒ‹ƒh‚ðˆø‚« o‚· ۂ̃ ƒbƒZ [ƒW(ƒwƒ‹ƒvƒEƒBƒ“ƒhƒE)
WDEPOSIT_GOLD = "Choisissez la quantité d'or à reprendre"
# ŸƒAƒCƒeƒ€‚ð—a‚¯‚é ۂ̃ ƒbƒZ [ƒW(ŒÂ ”ƒEƒBƒ“ƒhƒE)
DEPOSIT_ITEM = "Choisissez le nombre de cet Objet à deposer"
# ŸƒAƒCƒeƒ€‚ðˆø‚« o‚· ۂ̃ ƒbƒZ [ƒW(ŒÂ ”ƒEƒBƒ“ƒhƒE)
WDEPOSIT_ITEM = "Choisissez le nombre de cet Objet à reprendre"
end
# š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š
$imported = {} if $imported == nil
$imported["Depository"] = true
#--------------------------------------------------------------------------
# œ —a‚©‚è ŠŒÄ‚Ñ o‚µ
# type : 0..‹à/ƒAƒCƒeƒ€ 1..‹à 2..ƒAƒCƒeƒ€
#--------------------------------------------------------------------------
def call_depository(type = 0)
# ƒvƒŒƒCƒ„ [‚ÌŽp ¨‚ð‹¸ ³
$game_player.straighten
# —a‚©‚è Š‰æ–Ê‚É Ø‚è‘Ö‚¦
$scene = Scene_Depository.new(type)
end
# š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š
#==========================================================
# ¡ Game_Party
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg ‰Šú‰»
#--------------------------------------------------------------------------
alias initialize_KGC_Depository initialize
def initialize
# Œ³‚Ì ˆ— ‚ðŽÀ s
initialize_KGC_Depository
@deposit_gold = 0
@deposit_item, @deposit_weapon, @deposit_armor = [], [], []
end
#--------------------------------------------------------------------------
# œ —a‚¯‚½‹àŽæ“¾
#--------------------------------------------------------------------------
def deposit_gold
@deposit_gold = 0 if @deposit_gold == nil
return @deposit_gold
end
#--------------------------------------------------------------------------
# œ —a‚¯‚½‹à‘ ‰Á
# number : ‘ ‰Á—Ê
#--------------------------------------------------------------------------
def gain_deposit_gold(number)
@deposit_gold = 0 if @deposit_gold == nil
@deposit_gold += number
end
#--------------------------------------------------------------------------
# œ —a‚¯‚½‹àŒ¸
# number : Œ¸ —Ê
#--------------------------------------------------------------------------
def lose_deposit_gold(number)
self.gain_deposit_gold(-number)
end
#--------------------------------------------------------------------------
# œ —a‚¯‚½ƒAƒCƒeƒ€Žæ“¾
# id : ID
#--------------------------------------------------------------------------
def deposit_item_number(id)
@deposit_item = [] if @deposit_item == nil
return @deposit_item[id] != nil ? @deposit_item[id] : 0
end
#--------------------------------------------------------------------------
# œ —a‚¯‚½ƒAƒCƒeƒ€‘ ‰Á
# id : ID
# number : ŒÂ ”
#--------------------------------------------------------------------------
def gain_deposit_item(id, number)
@deposit_item = [] if @deposit_item == nil
@deposit_item[id] = 0 if @deposit_item[id] == nil
@deposit_item[id] += number
end
#--------------------------------------------------------------------------
# œ —a‚¯‚½ƒAƒCƒeƒ€Œ¸
# id : ID
# number : ŒÂ ”
#--------------------------------------------------------------------------
def lose_deposit_item(id, number)
self.gain_deposit_item(id, -number)
end
#--------------------------------------------------------------------------
# œ —a‚¯‚½• ŠíŽæ“¾
# id : ID
#--------------------------------------------------------------------------
def deposit_weapon_number(id)
@deposit_weapon = [] if @deposit_weapon == nil
return @deposit_weapon[id] != nil ? @deposit_weapon[id] : 0
end
#--------------------------------------------------------------------------
# œ —a‚¯‚½• Ší‘ ‰Á
# id : ID
# number : ŒÂ ”
#--------------------------------------------------------------------------
def gain_deposit_weapon(id, number)
@deposit_weapon = [] if @deposit_weapon == nil
@deposit_weapon[id] = 0 if @deposit_weapon[id] == nil
@deposit_weapon[id] += number
end
#--------------------------------------------------------------------------
# œ —a‚¯‚½• ŠíŒ¸
# id : ID
# number : ŒÂ ”
#--------------------------------------------------------------------------
def lose_deposit_weapon(id, number)
self.gain_deposit_weapon(id, -number)
end
#--------------------------------------------------------------------------
# œ —a‚¯‚½–h‹ïŽæ“¾
# id : ID
#--------------------------------------------------------------------------
def deposit_armor_number(id)
@deposit_armor = [] if @deposit_armor == nil
return @deposit_armor[id] != nil ? @deposit_armor[id] : 0
end
#--------------------------------------------------------------------------
# œ —a‚¯‚½–h‹ï‘ ‰Á
# id : ID
# number : ŒÂ ”
#--------------------------------------------------------------------------
def gain_deposit_armor(id, number)
@deposit_armor = [] if @deposit_armor == nil
@deposit_armor[id] = 0 if @deposit_armor[id] == nil
@deposit_armor[id] += number
end
#--------------------------------------------------------------------------
# œ —a‚¯‚½–h‹ïŒ¸
# id : ID
# number : ŒÂ ”
#--------------------------------------------------------------------------
def lose_deposit_armor(id, number)
self.gain_deposit_armor(id, -number)
end
end
# š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š
#===============================================================
# ¡ Window_DepositoryCommand
#------------------------------------------------------------------------------
# @—a‚©‚è Š‰æ–Ê‚Å A‘€ ì‚ð‘I‘ð‚·‚éƒEƒBƒ“ƒhƒE‚Å‚· B
#===============================================================
class Window_DepositoryCommand < Window_Selectable
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg ‰Šú‰»
#--------------------------------------------------------------------------
def initialize(type)
super(0, 64, 640, 64)
self.y = 128 if $imported["HelpExtension"]
self.contents = Bitmap.new(width - 32, height - 32)
# ƒRƒ}ƒ“ƒhˆê——‚ð ì ¬
case type
when 1 # ‹à
@commands = KGC::DEPOSITORY_COMMAND[0, 2]
@help_text = KGC::DEPOSITORY_HELP[0, 2]
when 2 # ƒAƒCƒeƒ€
@commands = KGC::DEPOSITORY_COMMAND[2, 2]
@help_text = KGC::DEPOSITORY_HELP[2, 2]
else # ‹à/ƒAƒCƒeƒ€
@commands = KGC::DEPOSITORY_COMMAND
@help_text = KGC::DEPOSITORY_HELP
end
@item_max = @commands.size
@column_max = @commands.size
@item_width = (width - 32) / @commands.size
self.back_opacity = 160
self.index = 0
refresh
end
#--------------------------------------------------------------------------
# œ ƒŠƒtƒŒƒbƒVƒ…
#--------------------------------------------------------------------------
def refresh
for i in 0...@commands.size
rect = Rect.new(@item_width * i, 0, @item_width, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.font.color = system_color
self.contents.draw_text(rect, @commands[i], 1)
end
end
#--------------------------------------------------------------------------
# œ ƒJ [ƒ\ƒ‹‚Ì‹éŒ` X V
#--------------------------------------------------------------------------
def update_cursor_rect
if index != -1
self.cursor_rect.set(@item_width * index, 0, @item_width, 32)
end
end
#--------------------------------------------------------------------------
# œ ƒwƒ‹ƒvƒeƒLƒXƒg X V
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(@help_text[self.index])
end
end
# š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š
#==============================================================================
# ¡ Window_DepositoryGold
#------------------------------------------------------------------------------
# @—a‚©‚è Š‰æ–Ê‚Å A‹àŠz‚ð“ü—Í‚·‚éƒEƒBƒ“ƒhƒE‚Å‚· B
#==============================================================================
class Window_DepositoryGold = 2
$game_system.se_play($data_system.cursor_se)
@index = (@index + 1) % @digits_max
end
end
# ƒJ [ƒ\ƒ‹ ¶
if Input.repeat?(Input::LEFT)
if @digits_max >= 2
$game_system.se_play($data_system.cursor_se)
@index = (@index + @digits_max - 1) % @digits_max
end
end
update_cursor_rect
end
end
# š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š
#==============================================================================
# ¡ Window_DepositoryItem
#------------------------------------------------------------------------------
# @—a‚©‚è Š‰æ–Ê‚Å A—a‚¯‚½ƒAƒCƒeƒ€‚̈ꗗ‚ð•\Ž¦‚·‚éƒEƒBƒ“ƒhƒE‚Å‚· B
#==============================================================================
class Window_DepositoryItem 0
@data.push($data_items[i])
end
end
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0
@data.push($data_weapons[i])
end
end
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0
@data.push($data_armors[i])
end
end
when 1
for i in 1...$data_items.size
if $game_party.deposit_item_number(i) > 0
@data.push($data_items[i])
end
end
for i in 1...$data_weapons.size
if $game_party.deposit_weapon_number(i) > 0
@data.push($data_weapons[i])
end
end
for i in 1...$data_armors.size
if $game_party.deposit_armor_number(i) > 0
@data.push($data_armors[i])
end
end
end
if reset
self.index = 0
else
self.index = @data[last_index] != nil ? last_index :
[last_index - 1, 0].max
end
# €–Ú ”‚ª 0 ‚Å‚È‚¯‚ê‚΃rƒbƒgƒ}ƒbƒv‚ð ì ¬‚µ A‘S €–Ú‚ð•`‰æ
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i, type)
end
end
end
#--------------------------------------------------------------------------
# œ €–Ú‚Ì•`‰æ
# index : €–Ú”Ô †
# type : Œ`Ž®
#--------------------------------------------------------------------------
def draw_item(index, type)
item = @data[index]
case item
when RPG::Item
number = type == 0 ? $game_party.item_number(item.id) :
$game_party.deposit_item_number(item.id)
when RPG::Weapon
number = type == 0 ? $game_party.weapon_number(item.id) :
$game_party.deposit_weapon_number(item.id)
when RPG::Armor
number = type == 0 ? $game_party.armor_number(item.id) :
$game_party.deposit_armor_number(item.id)
end
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end
#--------------------------------------------------------------------------
# œ ƒwƒ‹ƒvƒeƒLƒXƒg X V
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
# š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š
#==============================================================================
# ¡ Window_DepositoryNumber
#------------------------------------------------------------------------------
# @—a‚©‚è Š‚ÅŽg—p‚·‚é A ”’l“ü—Í—p‚̃EƒBƒ“ƒhƒE‚Å‚· B
#==============================================================================
class Window_DepositoryNumber = 2
$game_system.se_play($data_system.cursor_se)
@index = (@index + 1) % @digits_max
end
end
# ƒJ [ƒ\ƒ‹ ¶
if Input.repeat?(Input::LEFT)
if @digits_max >= 2
$game_system.se_play($data_system.cursor_se)
@index = (@index + @digits_max - 1) % @digits_max
end
end
update_cursor_rect
end
end
# š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š ™ š
#==============================================================================
# ¡ Scene_Depository
#------------------------------------------------------------------------------
# @—a‚©‚è Š‰æ–Ê‚Ì ˆ— ‚ð s‚¤ƒNƒ‰ƒX‚Å‚· B
#==============================================================================
class Scene_Depository
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg ‰Šú‰»
#--------------------------------------------------------------------------
def initialize(type)
@type = type
case type
when 1 # ‹à
@command_money = 0
@command_item = 100
when 2 # ƒAƒCƒeƒ€
@command_money = 100
@command_item = 0
else # ‹à/ƒAƒCƒeƒ€
@command_money = 0
@command_item = 2
end
end
#--------------------------------------------------------------------------
# œ ƒ ƒCƒ“ ˆ—
#--------------------------------------------------------------------------
def main
# ƒXƒvƒ‰ƒCƒgƒZƒbƒg ì ¬
@spriteset = Spriteset_Map.new
# ŠeŽíƒEƒBƒ“ƒhƒE‚ð ì ¬
if $imported["HelpExtension"]
@dummy_window = Window_Base.new(0, 192, 640, 288)
@help_window = Window_HelpExtension.new
else
@dummy_window = Window_Base.new(0, 128, 640, 352)
@help_window = Window_Help.new
end
@dummy_window.back_opacity = 160
@help_window.back_opacity = 160
@command_window = Window_DepositoryCommand.new(@type)
@gold_window = Window_DepositoryGold.new
@item_window = Window_DepositoryItem.new
@number_window = Window_DepositoryNumber.new
# ƒwƒ‹ƒvƒEƒBƒ“ƒhƒE‚ðŠÖ˜A•t‚¯
@command_window.help_window = @help_window
@item_window.help_window = @help_window
# ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“ŽÀ s
Graphics.transition
# ƒ ƒCƒ“ƒ‹ [ƒv
loop {
Graphics.update
Input.update
update
break if $scene != self
}
# ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“ €”õ
Graphics.freeze
# ‰ð•ú
@spriteset.dispose
@dummy_window.dispose
@help_window.dispose
@command_window.dispose
@gold_window.dispose
@item_window.dispose
@number_window.dispose
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ [ƒ€ X V
#--------------------------------------------------------------------------
def update
# ƒEƒBƒ“ƒhƒE‚ð X V
@dummy_window.update
@help_window.update
@command_window.update
@gold_window.update
@item_window.update
@number_window.update
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ì ê ‡: update_command ‚ðŒÄ‚Ô
if @command_window.active
update_command
return
end
# ƒS [ƒ‹ƒhƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ì ê ‡: update_gold ‚ðŒÄ‚Ô
if @gold_window.active
update_gold
return
end
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ì ê ‡: update_item ‚ðŒÄ‚Ô
if @item_window.active
update_item
return
end
# ŒÂ ”ƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ì ê ‡: update_number ‚ðŒÄ‚Ô
if @number_window.active
update_number
return
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ [ƒ€ X V (ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ì ê ‡)
#--------------------------------------------------------------------------
def update_command
# B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽ ê ‡
if Input.trigger?(Input::B)
# ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cancel_se)
# ƒ}ƒbƒv‰æ–Ê‚É Ø‚è‘Ö‚¦
$scene = Scene_Map.new
return
end
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽ ê ‡
if Input.trigger?(Input::C)
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒJ [ƒ\ƒ‹ˆÊ’u‚Å•ªŠò
case @command_window.index
when @command_money
# ƒS [ƒ‹ƒhƒEƒBƒ“ƒhƒE‚É Ø‚è‘Ö‚¦
@gold_window.active = true
@gold_window.visible = true
@gold_window.reset(0)
@help_window.set_text(KGC::DEPOSIT_GOLD)
when @command_money + 1
# ƒS [ƒ‹ƒhƒEƒBƒ“ƒhƒE‚É Ø‚è‘Ö‚¦
@gold_window.active = true
@gold_window.visible = true
@gold_window.reset(1)
@help_window.set_text(KGC::WDEPOSIT_GOLD)
when @command_item
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚É Ø‚è‘Ö‚¦
@item_window.refresh(0, true)
@item_window.active = true
@item_window.visible = true
when @command_item + 1
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚É Ø‚è‘Ö‚¦
@item_window.refresh(1, true)
@item_window.active = true
@item_window.visible = true
end
@command_window.active = false
# ƒ_ƒ~ [ƒEƒBƒ“ƒhƒE Á‹Ž
@dummy_window.visible = false
return
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ [ƒ€ X V (ƒS [ƒ‹ƒhƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ì ê ‡)
#--------------------------------------------------------------------------
def update_gold
# B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽ ê ‡
if Input.trigger?(Input::B)
# ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cancel_se)
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚É Ø‚è‘Ö‚¦
@command_window.active = true
@gold_window.active = false
@gold_window.visible = false
@dummy_window.visible = true
return
end
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽ ê ‡
if Input.trigger?(Input::C)
# “ü—Í‚µ‚½‹àŠz‚ðŽæ“¾
price = @gold_window.price
# ‹àŠz‚ª 0 ‚Ì ê ‡
if price == 0
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚É Ø‚è‘Ö‚¦
@command_window.active = true
@gold_window.active = false
@gold_window.visible = false
@dummy_window.visible = true
return
end
# ƒVƒ‡ƒbƒv SE ‚ð‰‰‘t
$game_system.se_play($data_system.shop_se)
# ƒJ [ƒ\ƒ‹ˆÊ’u‚Å•ªŠò
case @command_window.index
when 0 # —a‚¯‚é
$game_party.lose_gold(price)
$game_party.gain_deposit_gold(price)
when 1 # ˆø‚« o‚·
$game_party.gain_gold(price)
$game_party.lose_deposit_gold(price)
end
# ƒS [ƒ‹ƒhƒEƒBƒ“ƒhƒE‚ðƒŠƒZƒbƒg
@gold_window.reset(@command_window.index)
return
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ [ƒ€ X V (ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ì ê ‡)
#--------------------------------------------------------------------------
def update_item
# B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽ ê ‡
if Input.trigger?(Input::B)
# ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cancel_se)
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚É Ø‚è‘Ö‚¦
@command_window.active = true
@item_window.active = false
@item_window.visible = false
@dummy_window.visible = true
return
end
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽ ê ‡
if Input.trigger?(Input::C)
# ‘I‘ðƒAƒCƒeƒ€‚ðŽæ“¾
@item = @item_window.item
# ‹ó—“‚Ì ê ‡
if @item == nil
# ƒuƒU [ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
# ŒÂ ”ƒEƒBƒ“ƒhƒE‚̃AƒCƒeƒ€‚ð Ý’è
@number_window.item = @item
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒJ [ƒ\ƒ‹ˆÊ’u‚Å•ªŠò
case @command_window.index
when 2 # —a‚¯‚é
@number_window.set_text(KGC::DEPOSIT_ITEM)
when 3 # ˆø‚« o‚·
@number_window.set_text(KGC::WDEPOSIT_ITEM)
end
# ŒÂ ”ƒEƒBƒ“ƒhƒE‚ðƒŠƒZƒbƒg
@number_window.reset(@command_window.index - 2)
# ŒÂ ”ƒEƒBƒ“ƒhƒE‚É Ø‚è‘Ö‚¦
@item_window.active = false
@number_window.active = true
@number_window.visible = true
return
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ [ƒ€ X V (ŒÂ ”ƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ì ê ‡)
#--------------------------------------------------------------------------
def update_number
# B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽ ê ‡
if Input.trigger?(Input::B)
# ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cancel_se)
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚É Ø‚è‘Ö‚¦
@item_window.active = true
@number_window.active = false
@number_window.visible = false
return
end
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽ ê ‡
if Input.trigger?(Input::C)
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
number = @number_window.number
# ƒJ [ƒ\ƒ‹ˆÊ’u‚Å•ªŠò
case @command_window.index
when 2 # —a‚¯‚é
case @item
when RPG::Item
$game_party.lose_item(@item.id, number)
$game_party.gain_deposit_item(@item.id, number)
when RPG::Weapon
$game_party.lose_weapon(@item.id, number)
$game_party.gain_deposit_weapon(@item.id, number)
when RPG::Armor
$game_party.lose_armor(@item.id, number)
$game_party.gain_deposit_armor(@item.id, number)
end
when 3 # ˆø‚« o‚·
case @item
when RPG::Item
$game_party.gain_item(@item.id, number)
$game_party.lose_deposit_item(@item.id, number)
when RPG::Weapon
$game_party.gain_weapon(@item.id, number)
$game_party.lose_deposit_weapon(@item.id, number)
when RPG::Armor
$game_party.gain_armor(@item.id, number)
$game_party.lose_deposit_armor(@item.id, number)
end
end
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚ðƒŠƒtƒŒƒbƒVƒ…
@item_window.refresh(@command_window.index - 2)
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚É Ø‚è‘Ö‚¦
@item_window.active = true
@number_window.active = false
@number_window.visible = false
return
end
end
end |