Bienvenue visiteur !
|
Statistiques
Liste des membres
Contact
Mentions légales
714 connectés actuellement
29892291 visiteurs depuis l'ouverture
8635 visiteurs aujourd'hui
Partenaires
Tous nos partenaires
Devenir partenaire
|
Ryukko -
posté le 11/04/2013 à 23:26:30 (30 messages postés)
| | Domaine concerné: script
Logiciel utilisé: VX Ace
Salut, salut!
J'utilise le script Ace Item Engine de YANFLY que voici :
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
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
|
#==============================================================================
#
# ▼ Yanfly Engine Ace - Ace Item Menu v1.02
# -- Last Updated: 2012.01.05
# -- Level: Normal, Hard
# -- Requires: n/a
#
#==============================================================================
$imported = {} if $imported.nil?
$imported["YEA-ItemMenu"] = true
#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.01.05 - Compatibility Update with Equip Dynamic Stats.
# 2012.01.03 - Started Script and Finished.
# - Compatibility Update with Ace Menu Engine.
#
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# The Ace Item Menu offers more item categorization control and a better layout
# that simulatenously provides information regarding the items to the player,
# while keeping a good amount of the item list visible on screen at once. The
# script can also be customized to rearrange commands and categories.
#
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# Item Notetags - These notetags go in the item notebox in the database.
# -----------------------------------------------------------------------------
# <category: string>
# Places this object into the item category for "string". Whenever the selected
# category is highlighted in the Ace Item Menu command window, this object will
# be included and shown in the item window.
#
# <image: string>
# Uses a picture from Graphics\Pictures\ of your RPG Maker VX Ace Project's
# directory with the filename of "string" (without the extension) as the image
# picture shown in the Ace Item Menu.
#
# -----------------------------------------------------------------------------
# Weapon Notetags - These notetags go in the weapon notebox in the database.
# -----------------------------------------------------------------------------
# <category: string>
# Places this object into the item category for "string". Whenever the selected
# category is highlighted in the Ace Item Menu command window, this object will
# be included and shown in the item window.
#
# <image: string>
# Uses a picture from Graphics\Pictures\ of your RPG Maker VX Ace Project's
# directory with the filename of "string" (without the extension) as the image
# picture shown in the Ace Item Menu.
#
# -----------------------------------------------------------------------------
# Armour Notetags - These notetags go in the armour notebox in the database.
# -----------------------------------------------------------------------------
# <category: string>
# Places this object into the item category for "string". Whenever the selected
# category is highlighted in the Ace Item Menu command window, this object will
# be included and shown in the item window.
#
# <image: string>
# Uses a picture from Graphics\Pictures\ of your RPG Maker VX Ace Project's
# directory with the filename of "string" (without the extension) as the image
# picture shown in the Ace Item Menu.
#
#==============================================================================
# ▼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
#==============================================================================
module YEA
module ITEM
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Item Command Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# This array adjusts what options appear in the initial item command window
# before the items are split into separate categories. Add commands, remove
# commands, or rearrange them. Here's a list of which does what:
#
# -------------------------------------------------------------------------
# :command Description
# -------------------------------------------------------------------------
# :item Opens up the various item categories. Default.
# :weapon Opens up the various weapon categories. Default.
# :armor Opens up the various armour categories. Default.
# :key_item Shows a list of the various key items. Default.
#
# :gogototori Requires Kread-EX's Go Go Totori Synthesis.
#
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
COMMANDS =[
:item, # Opens up the various item categories. Default.
:weapon, # Opens up the various weapon categories. Default.
:armor, # Opens up the various armour categories. Default.
:key_item, # Shows a list of the various key items. Default.
:gogototori, # Requires Kread-EX's Go Go Totori Synthesis.
# :custom1, # Custom command 1.
# :custom2, # Custom command 2.
] # Do not remove this.
#--------------------------------------------------------------------------
# - Item Custom Commands -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# For those who use scripts to that may produce unique effects for the item
# scene, use this hash to manage the custom commands for the Item Command
# Window. You can disable certain commands or prevent them from appearing
# by using switches. If you don't wish to bind them to a switch, set the
# proper switch to 0 for it to have no impact.
#--------------------------------------------------------------------------
CUSTOM_ITEM_COMMANDS ={
# :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method],
:gogototori => ["Synthesis", 0, 0, :command_totori],
:custom1 => [ "Custom Name", 0, 0, :command_name1],
:custom2 => [ "Custom Text", 13, 0, :command_name2],
} # Do not remove this.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Item Type Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# These arrays adjusts and shows the various item types shown for Items,
# Weapons, and Armours. Note that when using :category symbols, the
# specific category shown will be equal to the text used for the Display
# and the included item must contain a category equal to the Display name.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# This array contains the order for the Item categories.
ITEM_TYPES =[
# [ :symbol, "Display"],
[ :field, "Field"], # Shows Menu-usable items.
[ :battle, "Battle"], # Shows Battle-usable items.
[:category, "Special"], # Categorized by <category: string>
[:category,"Ingredient"], # Categorized by <category: string>
[:key_item, "Key Item"], # Shows all key items.
[ :all, "All"], # Shows all usable items.
] # Do not remove this.
# This array contains the order for the Weapon categories.
WEAPON_TYPES =[
# [ :symbol, "Display"],
[ :types, "WPNTYPES"], # Lists all of the individual weapon types.
[:category, "Training"], # Categorized by <category: string>
[:category, "Legendary"], # Categorized by <category: string>
[ :all, "All"], # Shows all weapons.
] # Do not remove this.
# This array contains the order for the Armour categories.
ARMOUR_TYPES =[
# [ :symbol, "Display"],
[ :slots, "ARMSLOTS"], # Lists all of the individual armour slots.
[ :types, "ARMTYPES"], # Lists all of the individual armours types.
[:category, "Training"], # Categorized by <category: string>
[:category, "Legendary"], # Categorized by <category: string>
[ :all, "All"], # Shows all armours.
] # Do not remove this.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Item Status Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# The item status window displays information about the item in detail.
# Adjust the settings below to change the way the status window appears.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
STATUS_FONT_SIZE = 20 # Font size used for status window.
MAX_ICONS_DRAWN = 10 # Maximum number of icons drawn for states.
# The following adjusts the vocabulary used for the status window. Each
# of the vocabulary settings are self explanatory.
VOCAB_STATUS ={
:empty => "---", # Text used when nothing is shown.
:hp_recover => "HP Heal", # Text used for HP Recovery.
:mp_recover => "MP Heal", # Text used for MP Recovery.
:tp_recover => "TP Heal", # Text used for TP Recovery.
:tp_gain => "TP Gain", # Text used for TP Gain.
:applies => "Applies", # Text used for applied states and buffs.
:removes => "Removes", # Text used for removed states and buffs.
} # Do not remove this.
end # ITEM
end # YEA
#==============================================================================
# ▼ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================
module YEA
module REGEXP
module BASEITEM
CATEGORY = /<(?:CATEGORIES|category):[ ](.*)>/i
IMAGE = /<(?:IMAGE|image):[ ](.*)>/i
end # BASEITEM
end # REGEXP
end # YEA
#==============================================================================
# ■ Numeric
#==============================================================================
class Numeric
#--------------------------------------------------------------------------
# new method: group_digits
#--------------------------------------------------------------------------
unless $imported["YEA-CoreEngine"]
def group; return self.to_s; end
end # $imported["YEA-CoreEngine"]
end # Numeric
#==============================================================================
# ■ Vocab
#==============================================================================
module Vocab
#--------------------------------------------------------------------------
# new method: self.item_status
#--------------------------------------------------------------------------
def self.item_status(type)
return YEA::ITEM::VOCAB_STATUS[type]
end
end # Vocab
#==============================================================================
# ■ DataManager
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# alias method: load_database
#--------------------------------------------------------------------------
class <<self; alias load_database_aim load_database; end
def self.load_database
load_database_aim
load_notetags_aim
end
#--------------------------------------------------------------------------
# new method: load_notetags_aim
#--------------------------------------------------------------------------
def self.load_notetags_aim
groups = [$data_items, $data_weapons, $data_armors]
for group in groups
for obj in group
next if obj.nil?
obj.load_notetags_aim
end
end
end
end # DataManager
#==============================================================================
# ■ RPG::BaseItem
#==============================================================================
class RPG::BaseItem
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :category
attr_accessor :image
#--------------------------------------------------------------------------
# common cache: load_notetags_aim
#--------------------------------------------------------------------------
def load_notetags_aim
@category = []
#---
self.note.split(/[\r\n]+/).each { |line|
case line
#---
when YEA::REGEXP::BASEITEM::CATEGORY
@category.push($1.upcase.to_s)
when YEA::REGEXP::BASEITEM::IMAGE
@image = $1.to_s
end
} # self.note.split
#---
end
end # RPG::BaseItem
#==============================================================================
# ■ Game_Temp
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :scene_item_index
attr_accessor :scene_item_oy
end # Game_Temp
#==============================================================================
# ■ Window_ItemList
#==============================================================================
class Window_ItemList < Window_Selectable
#--------------------------------------------------------------------------
# overwrite method: draw_item
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
return if item.nil?
rect = item_rect(index)
rect.width -= 4
draw_item_name(item, rect.x, rect.y, enable?(item), rect.width - 24)
draw_item_number(rect, item)
end
end # Window_ItemList
#==============================================================================
# ■ Window_ItemCommand
#==============================================================================
class Window_ItemCommand < Window_Command
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_reader :item_window
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y)
end
#--------------------------------------------------------------------------
# window_width
#--------------------------------------------------------------------------
def window_width; return 160; end
#--------------------------------------------------------------------------
# visible_line_number
#--------------------------------------------------------------------------
def visible_line_number; return 4; end
#--------------------------------------------------------------------------
# process_ok
#--------------------------------------------------------------------------
def process_ok
$game_temp.scene_item_index = index
$game_temp.scene_item_oy = self.oy
super
end
#--------------------------------------------------------------------------
# make_command_list
#--------------------------------------------------------------------------
def make_command_list
for command in YEA::ITEM::COMMANDS
case command
#--- Default Commands ---
when :item
add_command(Vocab::item, :item)
when :weapon
add_command(Vocab::weapon, :weapon)
when :armor
add_command(Vocab::armor, :armor)
when :key_item
add_command(Vocab::key_item, :key_item)
#--- Imported ---
when :gogototori
next unless $imported["KRX-AlchemicSynthesis"]
process_custom_command(command)
#--- Custom Commands ---
else
process_custom_command(command)
end
end
end
#--------------------------------------------------------------------------
# process_custom_command
#--------------------------------------------------------------------------
def process_custom_command(command)
return unless YEA::ITEM::CUSTOM_ITEM_COMMANDS.include?(command)
show = YEA::ITEM::CUSTOM_ITEM_COMMANDS[command][2]
continue = show <= 0 ? true : $game_switches[show]
return unless continue
text = YEA::ITEM::CUSTOM_ITEM_COMMANDS[command][0]
switch = YEA::ITEM::CUSTOM_ITEM_COMMANDS[command][1]
enabled = switch <= 0 ? true : $game_switches[switch]
add_command(text, command, enabled)
end
#--------------------------------------------------------------------------
# update
#--------------------------------------------------------------------------
def update
super
return unless self.active
@item_window.category = current_symbol if @item_window
end
#--------------------------------------------------------------------------
# item_window=
#--------------------------------------------------------------------------
def item_window=(item_window)
@item_window = item_window
update
end
end # Window_ItemCommand
#==============================================================================
# ■ Window_ItemType
#==============================================================================
class Window_ItemType < Window_Command
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_reader :item_window
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y)
deactivate
@type = nil
end
#--------------------------------------------------------------------------
# window_width
#--------------------------------------------------------------------------
def window_width; return 160; end
#--------------------------------------------------------------------------
# visible_line_number
#--------------------------------------------------------------------------
def visible_line_number; return 4; end
#--------------------------------------------------------------------------
# reveal
#--------------------------------------------------------------------------
def reveal(type)
@type = type
refresh
activate
select(0)
end
#--------------------------------------------------------------------------
# make_command_list
#--------------------------------------------------------------------------
def make_command_list
return if @type.nil?
#---
case @type
when :item
commands = YEA::ITEM::ITEM_TYPES
when :weapon
commands = YEA::ITEM::WEAPON_TYPES
else
commands = YEA::ITEM::ARMOUR_TYPES
end
#---
for command in commands
case command[0]
#---
when :types
case @type
when :weapon
for i in 1...$data_system.weapon_types.size
name = $data_system.weapon_types[i]
add_command(name, :w_type, true, i)
end
else
for i in 1...$data_system.armor_types.size
name = $data_system.armor_types[i]
add_command(name, :a_type, true, i)
end
end
#---
when :slots
if $imported["YEA-AceEquipEngine"]
maximum = 1
for key in YEA::EQUIP::TYPES
maximum = [maximum, key[0]].max
end
else
maximum = 4
end
for i in 1..maximum
name = Vocab::etype(i)
add_command(name, :e_type, true, i) if name != ""
end
#---
else
add_command(command[1], command[0], true, @type)
end
end
end
#--------------------------------------------------------------------------
# update
#--------------------------------------------------------------------------
def update
super
return unless self.active
@item_window.category = current_symbol if @item_window
end
#--------------------------------------------------------------------------
# item_window=
#--------------------------------------------------------------------------
def item_window=(item_window)
@item_window = item_window
update
end
end # Window_ItemType
#==============================================================================
# ■ Window_ItemList
#==============================================================================
class Window_ItemList < Window_Selectable
#--------------------------------------------------------------------------
# alias method: initialize
#--------------------------------------------------------------------------
alias window_itemlist_initialize_aim initialize
def initialize(dx, dy, dw, dh)
window_itemlist_initialize_aim(dx, dy, dw, dh)
@ext = :none
@name = ""
end
#--------------------------------------------------------------------------
# alias method: category=
#--------------------------------------------------------------------------
alias window_itemlist_category_aim category=
def category=(category)
if @types_window.nil?
window_itemlist_category_aim(category)
else
return unless update_types?(category)
@category = category
if @types_window.active
@name = @types_window.current_data[:name]
@ext = @types_window.current_ext
end
refresh
self.oy = 0
end
end
#--------------------------------------------------------------------------
# new method: update_types?
#--------------------------------------------------------------------------
def update_types?(category)
return true if @category != category
return false unless @types_window.active
if category == :category
return @name != @types_window.current_data[:name]
end
return @ext != @types_window.current_ext
end
#--------------------------------------------------------------------------
# new method: types_window=
#--------------------------------------------------------------------------
def types_window=(window)
@types_window = window
end
#--------------------------------------------------------------------------
# alias method: include?
#--------------------------------------------------------------------------
alias window_itemlist_include_aim include?
def include?(item)
if @types_window.nil?
return window_itemlist_include_aim(item)
else
return ace_item_menu_include?(item)
end
end
#--------------------------------------------------------------------------
# new method: ace_item_menu_include?
#--------------------------------------------------------------------------
def ace_item_menu_include?(item)
case @category
#---
when :field
return false unless item.is_a?(RPG::Item)
return item.menu_ok?
when :battle
return false unless item.is_a?(RPG::Item)
return item.battle_ok?
#---
when :w_type
return false unless item.is_a?(RPG::Weapon)
return item.wtype_id == @types_window.current_ext
when :a_type
return false unless item.is_a?(RPG::Armor)
return item.atype_id == @types_window.current_ext
when :e_type
return false unless item.is_a?(RPG::Armor)
return item.etype_id == @types_window.current_ext
#---
when :all
case @types_window.current_ext
when :item
return item.is_a?(RPG::Item)
when :weapon
return item.is_a?(RPG::Weapon)
else
return item.is_a?(RPG::Armor)
end
#---
when :category
case @types_window.current_ext
when :item
return false unless item.is_a?(RPG::Item)
when :weapon
return false unless item.is_a?(RPG::Weapon)
else
return false unless item.is_a?(RPG::Armor)
end
return item.category.include?(@types_window.current_data[:name].upcase)
#---
else
return window_itemlist_include_aim(item)
end
end
end # Window_ItemList
#==============================================================================
# ■ Window_ItemStatus
#==============================================================================
class Window_ItemStatus < Window_Base
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize(dx, dy, item_window)
super(dx, dy, Graphics.width - dx, fitting_height(4))
@item_window = item_window
@item = nil
refresh
end
#--------------------------------------------------------------------------
# update
#--------------------------------------------------------------------------
def update
super
update_item(@item_window.item)
end
#--------------------------------------------------------------------------
# update_item
#--------------------------------------------------------------------------
def update_item(item)
return if @item == item
@item = item
refresh
end
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh
contents.clear
reset_font_settings
return draw_empty if @item.nil?
contents.font.size = YEA::ITEM::STATUS_FONT_SIZE
draw_item_image
draw_item_stats
draw_item_effects
end
#--------------------------------------------------------------------------
# draw_empty
#--------------------------------------------------------------------------
def draw_empty
colour = Color.new(0, 0, 0, translucent_alpha/2)
rect = Rect.new(1, 1, 94, 94)
contents.fill_rect(rect, colour)
dx = 96; dy = 0
dw = (contents.width - 96) / 2
for i in 0...8
draw_background_box(dx, dy, dw)
dx = dx >= 96 + dw ? 96 : 96 + dw
dy += line_height if dx == 96
end
end
#--------------------------------------------------------------------------
# draw_background_box
#--------------------------------------------------------------------------
def draw_background_box(dx, dy, dw)
colour = Color.new(0, 0, 0, translucent_alpha/2)
rect = Rect.new(dx+1, dy+1, dw-2, line_height-2)
contents.fill_rect(rect, colour)
end
#--------------------------------------------------------------------------
# draw_item_image
#--------------------------------------------------------------------------
def draw_item_image
colour = Color.new(0, 0, 0, translucent_alpha/2)
rect = Rect.new(1, 1, 94, 94)
contents.fill_rect(rect, colour)
if @item.image.nil?
icon_index = @item.icon_index
bitmap = Cache.system("Iconset")
rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
target = Rect.new(0, 0, 96, 96)
contents.stretch_blt(target, bitmap, rect)
else
bitmap = Cache.picture(@item.image)
contents.blt(0, 0, bitmap, bitmap.rect, 255)
end
end
#--------------------------------------------------------------------------
# draw_item_stats
#--------------------------------------------------------------------------
def draw_item_stats
return unless @item.is_a?(RPG::Weapon) || @item.is_a?(RPG::Armor)
dx = 96; dy = 0
dw = (contents.width - 96) / 2
for i in 0...8
draw_equip_param(i, dx, dy, dw)
dx = dx >= 96 + dw ? 96 : 96 + dw
dy += line_height if dx == 96
end
end
#--------------------------------------------------------------------------
# draw_equip_param
#--------------------------------------------------------------------------
def draw_equip_param(param_id, dx, dy, dw)
draw_background_box(dx, dy, dw)
change_color(system_color)
draw_text(dx+4, dy, dw-8, line_height, Vocab::param(param_id))
if $imported["YEA-EquipDynamicStats"]
draw_percentage_param(param_id, dx, dy, dw)
else
draw_set_param(param_id, dx, dy, dw)
end
end
#--------------------------------------------------------------------------
# draw_percentage_param
#--------------------------------------------------------------------------
def draw_percentage_param(param_id, dx, dy, dw)
if @item.per_params[param_id] != 0 && @item.params[param_id] != 0
text = draw_set_param(param_id, dx, dy, dw)
dw -= text_size(text).width
draw_percent_param(param_id, dx, dy, dw)
elsif @item.per_params[param_id] != 0 && @item.params[param_id] == 0
draw_percent_param(param_id, dx, dy, dw)
else
draw_set_param(param_id, dx, dy, dw)
end
end
#--------------------------------------------------------------------------
# draw_set_param
#--------------------------------------------------------------------------
def draw_set_param(param_id, dx, dy, dw)
value = @item.params[param_id]
if $imported["YEA-EquipDynamicStats"] && @item.var_params[param_id] > 0
value += $game_variables[@item.var_params[param_id]] rescue 0
end
change_color(param_change_color(value), value != 0)
text = value.group
text = "+" + text if value > 0
draw_text(dx+4, dy, dw-8, line_height, text, 2)
return text
end
#--------------------------------------------------------------------------
# draw_percent_param
#--------------------------------------------------------------------------
def draw_percent_param(param_id, dx, dy, dw)
value = @item.per_params[param_id]
change_color(param_change_color(value))
text = (@item.per_params[param_id] * 100).to_i.group + "%"
text = "+" + text if @item.per_params[param_id] > 0
draw_text(dx+4, dy, dw-8, line_height, text, 2)
return text
end
#--------------------------------------------------------------------------
# draw_item_effects
#--------------------------------------------------------------------------
def draw_item_effects
return unless @item.is_a?(RPG::Item)
dx = 96; dy = 0
dw = (contents.width - 96) / 2
draw_hp_recover(dx, dy + line_height * 0, dw)
draw_mp_recover(dx, dy + line_height * 1, dw)
draw_tp_recover(dx + dw, dy + line_height * 0, dw)
draw_tp_gain(dx + dw, dy + line_height * 1, dw)
dw = contents.width - 96
draw_applies(dx, dy + line_height * 2, dw)
draw_removes(dx, dy + line_height * 3, dw)
end
#--------------------------------------------------------------------------
# draw_hp_recover
#--------------------------------------------------------------------------
def draw_hp_recover(dx, dy, dw)
draw_background_box(dx, dy, dw)
change_color(system_color)
draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:hp_recover))
per = 0
set = 0
for effect in @item.effects
next unless effect.code == 11
per += (effect.value1 * 100).to_i
set += effect.value2.to_i
end
if per != 0 && set != 0
change_color(param_change_color(set))
text = set > 0 ? sprintf("+%s", set.group) : set.group
draw_text(dx+4, dy, dw-8, line_height, text, 2)
dw -= text_size(text).width
change_color(param_change_color(per))
text = per > 0 ? sprintf("+%s%%", per.group) : sprintf("%s%%", per.group)
draw_text(dx+4, dy, dw-8, line_height, text, 2)
return
elsif per != 0
change_color(param_change_color(per))
text = per > 0 ? sprintf("+%s%%", per.group) : sprintf("%s%%", per.group)
elsif set != 0
change_color(param_change_color(set))
text = set > 0 ? sprintf("+%s", set.group) : set.group
else
change_color(normal_color, false)
text = Vocab::item_status(:empty)
end
draw_text(dx+4, dy, dw-8, line_height, text, 2)
end
#--------------------------------------------------------------------------
# draw_mp_recover
#--------------------------------------------------------------------------
def draw_mp_recover(dx, dy, dw)
draw_background_box(dx, dy, dw)
change_color(system_color)
draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:mp_recover))
per = 0
set = 0
for effect in @item.effects
next unless effect.code == 12
per += (effect.value1 * 100).to_i
set += effect.value2.to_i
end
if per != 0 && set != 0
change_color(param_change_color(set))
text = set > 0 ? sprintf("+%s", set.group) : set.group
draw_text(dx+4, dy, dw-8, line_height, text, 2)
dw -= text_size(text).width
change_color(param_change_color(per))
text = per > 0 ? sprintf("+%s%%", per.group) : sprintf("%s%%", per.group)
draw_text(dx+4, dy, dw-8, line_height, text, 2)
return
elsif per != 0
change_color(param_change_color(per))
text = per > 0 ? sprintf("+%s%%", per.group) : sprintf("%s%%", per.group)
elsif set != 0
change_color(param_change_color(set))
text = set > 0 ? sprintf("+%s", set.group) : set.group
else
change_color(normal_color, false)
text = Vocab::item_status(:empty)
end
draw_text(dx+4, dy, dw-8, line_height, text, 2)
end
#--------------------------------------------------------------------------
# draw_tp_recover
#--------------------------------------------------------------------------
def draw_tp_recover(dx, dy, dw)
draw_background_box(dx, dy, dw)
change_color(system_color)
draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:tp_recover))
set = 0
for effect in @item.effects
next unless effect.code == 13
set += effect.value1.to_i
end
if set != 0
change_color(param_change_color(set))
text = set > 0 ? sprintf("+%s", set.group) : set.group
else
change_color(normal_color, false)
text = Vocab::item_status(:empty)
end
draw_text(dx+4, dy, dw-8, line_height, text, 2)
end
#--------------------------------------------------------------------------
# draw_tp_gain
#--------------------------------------------------------------------------
def draw_tp_gain(dx, dy, dw)
draw_background_box(dx, dy, dw)
change_color(system_color)
draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:tp_gain))
set = @item.tp_gain
if set != 0
change_color(param_change_color(set))
text = set > 0 ? sprintf("+%s", set.group) : set.group
else
change_color(normal_color, false)
text = Vocab::item_status(:empty)
end
draw_text(dx+4, dy, dw-8, line_height, text, 2)
end
#--------------------------------------------------------------------------
# draw_applies
#--------------------------------------------------------------------------
def draw_applies(dx, dy, dw)
draw_background_box(dx, dy, dw)
change_color(system_color)
draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:applies))
icons = []
for effect in @item.effects
case effect.code
when 21
next unless effect.value1 > 0
next if $data_states[effect.value1].nil?
icons.push($data_states[effect.data_id].icon_index)
when 31
icons.push($game_actors[1].buff_icon_index(1, effect.data_id))
when 32
icons.push($game_actors[1].buff_icon_index(-1, effect.data_id))
end
icons.delete(0)
break if icons.size >= YEA::ITEM::MAX_ICONS_DRAWN
end
draw_icons(dx, dy, dw, icons)
end
#--------------------------------------------------------------------------
# draw_removes
#--------------------------------------------------------------------------
def draw_removes(dx, dy, dw)
draw_background_box(dx, dy, dw)
change_color(system_color)
draw_text(dx+4, dy, dw-8, line_height, Vocab::item_status(:removes))
icons = []
for effect in @item.effects
case effect.code
when 22
next unless effect.value1 > 0
next if $data_states[effect.value1].nil?
icons.push($data_states[effect.data_id].icon_index)
when 33
icons.push($game_actors[1].buff_icon_index(1, effect.data_id))
when 34
icons.push($game_actors[1].buff_icon_index(-1, effect.data_id))
end
icons.delete(0)
break if icons.size >= YEA::ITEM::MAX_ICONS_DRAWN
end
draw_icons(dx, dy, dw, icons)
end
#--------------------------------------------------------------------------
# draw_icons
#--------------------------------------------------------------------------
def draw_icons(dx, dy, dw, icons)
dx += dw - 4
dx -= icons.size * 24
for icon_id in icons
draw_icon(icon_id, dx, dy)
dx += 24
end
if icons.size == 0
change_color(normal_color, false)
text = Vocab::item_status(:empty)
draw_text(4, dy, contents.width-8, line_height, text, 2)
end
end
end # Window_ItemStatus
#==============================================================================
# ■ Scene_Item
#==============================================================================
class Scene_Item < Scene_ItemBase
#--------------------------------------------------------------------------
# alias method: start
#--------------------------------------------------------------------------
alias scene_item_start_aim start
def start
scene_item_start_aim
create_types_window
create_status_window
relocate_windows
end
#--------------------------------------------------------------------------
# overwrite method: return_scene
#--------------------------------------------------------------------------
def return_scene
$game_temp.scene_item_index = nil
$game_temp.scene_item_oy = nil
super
end
#--------------------------------------------------------------------------
# overwrite method: create_category_window
#--------------------------------------------------------------------------
def create_category_window
wy = @help_window.height
@category_window = Window_ItemCommand.new(0, wy)
@category_window.viewport = @viewport
@category_window.help_window = @help_window
@category_window.y = @help_window.height
if !$game_temp.scene_item_index.nil?
@category_window.select($game_temp.scene_item_index)
@category_window.oy = $game_temp.scene_item_oy
end
$game_temp.scene_item_index = nil
$game_temp.scene_item_oy = nil
@category_window.set_handler(:ok, method(:on_category_ok))
@category_window.set_handler(:cancel, method(:return_scene))
@category_window.set_handler(:item, method(:open_types))
@category_window.set_handler(:weapon, method(:open_types))
@category_window.set_handler(:armor, method(:open_types))
process_custom_item_commands
end
#--------------------------------------------------------------------------
# new method: process_custom_item_commands
#--------------------------------------------------------------------------
def process_custom_item_commands
for command in YEA::ITEM::COMMANDS
next unless YEA::ITEM::CUSTOM_ITEM_COMMANDS.include?(command)
called_method = YEA::ITEM::CUSTOM_ITEM_COMMANDS[command][3]
@category_window.set_handler(command, method(called_method))
end
end
#--------------------------------------------------------------------------
# new method: create_types_window
#--------------------------------------------------------------------------
def create_types_window
wy = @category_window.y
@types_window = Window_ItemType.new(Graphics.width, wy)
@types_window.viewport = @viewport
@types_window.help_window = @help_window
@types_window.y = @help_window.height
@types_window.item_window = @item_window
@item_window.types_window = @types_window
@types_window.set_handler(:ok, method(:on_types_ok))
@types_window.set_handler(:cancel, method(:on_types_cancel))
end
#--------------------------------------------------------------------------
# new method: create_status_window
#--------------------------------------------------------------------------
def create_status_window
wx = @category_window.width
wy = @category_window.y
@status_window = Window_ItemStatus.new(wx, wy, @item_window)
@status_window.viewport = @viewport
end
#--------------------------------------------------------------------------
# new method: relocate_windows
#--------------------------------------------------------------------------
def relocate_windows
return unless $imported["YEA-AceMenuEngine"]
case Menu.help_window_location
when 0 # Top
@help_window.y = 0
@category_window.y = @help_window.height
@item_window.y = @category_window.y + @category_window.height
when 1 # Middle
@category_window.y = 0
@help_window.y = @category_window.height
@item_window.y = @help_window.y + @help_window.height
else # Bottom
@category_window.y = 0
@item_window.y = @category_window.height
@help_window.y = @item_window.y + @item_window.height
end
@types_window.y = @category_window.y
@status_window.y = @category_window.y
end
#--------------------------------------------------------------------------
# new method: open_categories
#--------------------------------------------------------------------------
def open_types
@category_window.x = Graphics.width
@types_window.x = 0
@types_window.reveal(@category_window.current_symbol)
end
#--------------------------------------------------------------------------
# new method: on_types_ok
#--------------------------------------------------------------------------
def on_types_ok
@item_window.activate
@item_window.select_last
end
#--------------------------------------------------------------------------
# new method: on_types_cancel
#--------------------------------------------------------------------------
def on_types_cancel
@category_window.x = 0
@category_window.activate
@types_window.unselect
@types_window.x = Graphics.width
end
#--------------------------------------------------------------------------
# alias method: on_item_cancel
#--------------------------------------------------------------------------
alias scene_item_on_item_cancel_aim on_item_cancel
def on_item_cancel
if @types_window.x <= 0
@item_window.unselect
@types_window.activate
else
scene_item_on_item_cancel_aim
end
end
#--------------------------------------------------------------------------
# new method: command_totori
#--------------------------------------------------------------------------
def command_totori
SceneManager.call(Scene_Alchemy)
end
#--------------------------------------------------------------------------
# new method: command_name1
#--------------------------------------------------------------------------
def command_name1
# Do nothing.
end
#--------------------------------------------------------------------------
# new method: command_name2
#--------------------------------------------------------------------------
def command_name2
# Do nothing.
end
end # Scene_Item
#==============================================================================
#
# ▼ End of File
#
#============================================================================== |
Mais voilà, je voulais ajouter à mon jeu un bestiaire, avec une commande d'ouverture depuis le menu objet.
J'ai opté pour le script de MOG que je post juste après (taille du post oblige )
La ligne 126 du script de yanfly permet a priori d'ajouter ce genre de commande :
1
| :custom1 => [ "Custom Name", 0, 0, :command_name1], |
J'ai essayer d'utiliser la commande manuelle :bestiary, method(:Monster_Book), mais ce n'est pas comme ceci qu'il faut procéder. Comment bien utiliser la compatibilité entre ce deux scripts?
Merci d'avance aux héros qui m'aideront
|
sorine -
posté le 11/04/2013 à 23:45:37 (18 messages postés)
| |
|
Ryukko -
posté le 11/04/2013 à 23:47:12 (30 messages postés)
| | Voici le script du bestiaire que j'ai choisi (MOG)
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
| #==============================================================================
# +++ MOG - MONSTER BOOK (v1.4) +++
#==============================================================================
# By Moghunter
# http://www.atelier-rgss.com/
#==============================================================================
# Sistema que permite verificar os parâmetros dos inimigos derrotados,
# o que inclui o battleback e a música de batalha.
#
#==============================================================================
# Para chamar o script use o comando abaixo.
#
# SceneManager.call(Monster_Book)
#
#==============================================================================
#==============================================================================
# ● Histórico (Version History)
#==============================================================================
# v 1.4 - Correção do Crash quando não há definição de música de batalha.
# v 1.3 - Correção do Crash aleatório.
# v 1.2 - Melhoria no sistema de dispose.
# v 1.1 - Correção na atualização do battleback em imagens repetidas.
# - Correção na execução da música quando o pitch ou volume é diferente.
# - Correção no espaço entre os números de parametros.
#==============================================================================
module MOG_MONSTER_BOOK
#Ocultar inimigos especificos da lista de inimigos.
HIDE_ENEMIES_ID = [9,10]
#Ativar a música de batalha.
PLAY_MUSIC = true
#Definição da palavra Completado.
COMPLETED_WORD = "Completed"
#Ativar o Monster Book no Menu.
MENU_COMMAND = true
#Nome do comando apresentado no menu.
MENU_COMMAND_NAME = "Bestiary"
end
#==============================================================================
# ■ Game_Temp
#==============================================================================
class Game_Temp
attr_accessor :bestiary_battleback1_name
attr_accessor :bestiary_battleback2_name
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
alias mog_bestiary_initialize initialize
def initialize
@bestiary_battleback1_name = ""
@bestiary_battleback1_name = ""
mog_bestiary_initialize
end
end
#==============================================================================
# ■ Game_System
#==============================================================================
class Game_System
attr_accessor :bestiary_defeated
attr_accessor :bestiary_battleback
attr_accessor :bestiary_music
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
alias mog_monster_book_initialize initialize
def initialize
@bestiary_defeated = []
@bestiary_battleback = []
@bestiary_music = []
mog_monster_book_initialize
end
end
#==============================================================================
# ■ Spriteset_Battle
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
alias mog_bestiary_initialize initialize
def initialize
mog_bestiary_initialize
$game_temp.bestiary_battleback1_name = battleback1_name
$game_temp.bestiary_battleback2_name = battleback2_name
end
end
#==============================================================================
# ■ Game_Enemy
#==============================================================================
class Game_Enemy < Game_Battler
attr_accessor :enemy_id
#--------------------------------------------------------------------------
# ● Die
#--------------------------------------------------------------------------
alias mog_monster_book_die die
def die
mog_monster_book_die
check_monster_book
end
#--------------------------------------------------------------------------
# ● Check Monster Book
#--------------------------------------------------------------------------
def check_monster_book
if $game_system.bestiary_defeated[@enemy_id] == nil
$game_system.bestiary_defeated[@enemy_id] = 0
$game_system.bestiary_battleback[@enemy_id] = [$game_temp.bestiary_battleback1_name,$game_temp.bestiary_battleback2_name]
$game_system.bestiary_music[@enemy_id] = $game_system.battle_bgm
end
$game_system.bestiary_defeated[@enemy_id] += 1
end
end
#==============================================================================
# ■ Window_Monster_Status
#==============================================================================
class Window_Monster_Status < Window_Selectable
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize(enemy)
super(0, 288, 544, 128)
self.opacity = 255
self.z = 300
refresh(enemy)
activate
end
#--------------------------------------------------------------------------
# ● Refresh
#--------------------------------------------------------------------------
def refresh(enemy)
self.contents.clear
if $game_system.bestiary_defeated[enemy.id] == nil
self.contents.draw_text(0,0 , 180, 24, "No Data",0)
else
change_color(system_color)
w_max = 50
ex = 16
self.contents.draw_text(0,0 , w_max, 24, Vocab::param(0),0)
self.contents.draw_text(0,24 * 1 , w_max, 24, Vocab::param(1),0)
self.contents.draw_text(0,24 * 2 , w_max, 24, Vocab::param(2),0)
self.contents.draw_text(0,24 * 3 , w_max, 24, Vocab::param(3),0)
self.contents.draw_text(128,24 * 0 , w_max, 24, Vocab::param(4),0)
self.contents.draw_text(128,24 * 1 , w_max, 24, Vocab::param(5),0)
self.contents.draw_text(128,24 * 2 , w_max, 24, Vocab::param(6),0)
self.contents.draw_text(128,24 * 3 , w_max, 24, Vocab::param(7),0)
self.contents.draw_text(256,24 * 0 , w_max, 24, "Exp",0)
self.contents.draw_text(384,24 * 0 , w_max, 24, Vocab::currency_unit,0)
self.contents.draw_text(256,24 * 1 , w_max, 24, "Treasure",0)
change_color(normal_color,true)
w_max2 = 64
#HP
self.contents.draw_text(32 + ex,0 , w_max2, 24, enemy.params[0],2)
#MP
self.contents.draw_text(32 + ex,24 * 1 , w_max2, 24, enemy.params[1],2)
#ATK
self.contents.draw_text(32 + ex,24 * 2 ,w_max2 , 24, enemy.params[2],2)
#Def
self.contents.draw_text(32 + ex,24 * 3 , w_max2, 24, enemy.params[3],2)
#Mag Power
self.contents.draw_text(160 + ex,24 * 0 , w_max2, 24, enemy.params[4],2)
#Mag Def
self.contents.draw_text(160 + ex,24 * 1 , w_max2, 24, enemy.params[5],2)
#Agility
self.contents.draw_text(160 + ex,24 * 2 , w_max2, 24, enemy.params[6],2)
#Luck
self.contents.draw_text(160 + ex,24 * 3 , w_max2, 24, enemy.params[7],2)
#EXP
self.contents.draw_text(280,24 * 0 , 96, 24, enemy.exp,2)
#Gold
self.contents.draw_text(400,24 * 0 , 96, 24, enemy.gold,2)
#Drop Items
tr = 0
for i in enemy.drop_items
next if i.kind == 0
tr += 1
tr_name = $data_items[i.data_id] if i.kind == 1
tr_name = $data_weapons[i.data_id] if i.kind == 2
tr_name = $data_armors [i.data_id] if i.kind == 3
draw_icon(tr_name.icon_index, 336, 24 * tr)
self.contents.draw_text(368,24 * tr , 160, 24, tr_name.name.to_s,0)
end
end
end
end
#==============================================================================
# ■ Window_Monster_List
#==============================================================================
class Window_Monster_List < Window_Selectable
#------------------------------------------------------------------------------
# ● Initialize
#------------------------------------------------------------------------------
def initialize(data)
super(312, 64, 232, 224)
self.opacity = 255
self.z = 301
@index = -1
@data = data
@item_max = @data.size
refresh(data)
select(0)
activate
end
#------------------------------------------------------------------------------
# ● Refresh
#------------------------------------------------------------------------------
def refresh(data)
self.contents.clear
if @item_max > 0
self.contents = Bitmap.new(width - 32, @item_max * 24)
for i in 0...@item_max
draw_item(i)
end
end
end
#------------------------------------------------------------------------------
# ● draw_item MAX
#------------------------------------------------------------------------------
def check_item_max
@data_max = 0
for i in $data_enemies
next if i == nil or MOG_MONSTER_BOOK::HIDE_ENEMIES_ID.include?(i.id)
@data_max += 1
end
end
#------------------------------------------------------------------------------
# ● draw_item
#------------------------------------------------------------------------------
def draw_item(index)
x = 0
y = index / col_max * 24
n_index = index + 1
if $game_system.bestiary_defeated[@data[index].id] == nil
monster_name = "No Data"
defeated = " ---- "
change_color(normal_color,false)
else
monster_name = @data[index].name
change_color(normal_color,true)
end
check_item_max
d = @data_max > 99 ? "%03d" : @data_max > 9 ? "%02d" : "%01d"
text = sprintf(d, n_index).to_s + " - "
self.contents.draw_text(x,y , 56, 24, text,0)
self.contents.draw_text(x + 56,y , 140, 24, monster_name,0)
end
#------------------------------------------------------------------------------
# ● Item Max
#------------------------------------------------------------------------------
def item_max
return @item_max == nil ? 0 : @item_max
end
end
#==============================================================================
# ■ Window_Monster_Comp
#==============================================================================
class Window_Monster_Comp < Window_Selectable
include MOG_MONSTER_BOOK
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize
super(312,0, 232, 64)
self.opacity = 255
self.z = 300
refresh
activate
end
#--------------------------------------------------------------------------
# ● Check Completition
#--------------------------------------------------------------------------
def check_completion
data_max = 0
for i in $data_enemies
next if i == nil or MOG_MONSTER_BOOK::HIDE_ENEMIES_ID.include?(i.id)
data_max += 1
end
comp = 0
for i in 0...$game_system.bestiary_defeated.size
comp += 1 if $game_system.bestiary_defeated[i] != nil
end
@completed = COMPLETED_WORD + " " + comp.to_s + "/" + data_max.to_s
end
#--------------------------------------------------------------------------
# ● Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
check_completion
self.contents.draw_text(0,0, 160, 24, @completed.to_s,0)
end
end
#==============================================================================
# ■ Monster_Book
#==============================================================================
class Monster_Book
#--------------------------------------------------------------------------
# ● Main
#--------------------------------------------------------------------------
def main
Graphics.transition
execute_loop
execute_dispose
end
#--------------------------------------------------------------------------
# ● Execute Loop
#--------------------------------------------------------------------------
def execute_loop
loop do
Graphics.update
Input.update
update
break if SceneManager.scene != self
end
end
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
def initialize
load_data
execute_dispose
create_window_guide
create_enemy_sprite
create_battleback
@music = [nil,nil,nil]
refresh_bgm
end
#------------------------------------------------------------------------------
# ● Initialize
#------------------------------------------------------------------------------
def load_data
BattleManager.save_bgm_and_bgs
@data = []
for i in $data_enemies
next if i == nil or MOG_MONSTER_BOOK::HIDE_ENEMIES_ID.include?(i.id)
@data.push(i)
end
end
#--------------------------------------------------------------------------
# ● Execute Dispose
#--------------------------------------------------------------------------
def execute_dispose
return if @windows_guide == nil
Graphics.freeze
@windows_guide.dispose
@windows_guide = nil
@windows_status.dispose
if @enemy_sprite.bitmap != nil
@enemy_sprite.bitmap.dispose
end
@enemy_sprite.dispose
dispose_battleback
@battleback1.dispose
@battleback2.dispose
@window_comp.dispose
BattleManager.replay_bgm_and_bgs
end
#--------------------------------------------------------------------------
# ● Dispose_battleback
#--------------------------------------------------------------------------
def dispose_battleback
if @battleback1.bitmap != nil
@battleback1.bitmap.dispose
@battleback1.bitmap = nil
end
if @battleback2.bitmap != nil
@battleback2.bitmap.dispose
@battleback2.bitmap = nil
end
end
#--------------------------------------------------------------------------
# ● Create Window Guide
#--------------------------------------------------------------------------
def create_window_guide
@windows_guide = Window_Monster_List.new(@data)
@enemy = @data[@windows_guide.index]
@windows_status = Window_Monster_Status.new(@enemy)
@window_comp = Window_Monster_Comp.new
@old_index = @windows_guide.index
@org_pos = [@windows_guide.x,@windows_guide.y]
@fade_time = 60
end
#--------------------------------------------------------------------------
# ● Create Enemy Sprite
#--------------------------------------------------------------------------
def create_enemy_sprite
@enemy_sprite = Sprite.new
@enemy_sprite.z = 100
@enemy_sprite_org = @enemy_sprite.x
refresh_enemy_sprite
end
#--------------------------------------------------------------------------
# ● Create_Battleback
#--------------------------------------------------------------------------
def create_battleback
@battleback1 = Sprite.new
@battleback1.z = 1
@battleback1.opacity = 0
@battleback2 = Sprite.new
@battleback2.z = 2
@battleback2.opacity = 0
@old_battleback = [nil,nil]
refresh_batteback
end
#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------
def update
@windows_guide.update
update_command
update_animation
refresh if @old_index != @windows_guide.index
end
#--------------------------------------------------------------------------
# ● Update Animation
#--------------------------------------------------------------------------
def update_animation
update_window_fade_animation
update_battleback_animation
update_enemy_sprite_animation
end
#--------------------------------------------------------------------------
# ● Update Enemy Sprite Animation
#--------------------------------------------------------------------------
def update_enemy_sprite_animation
@enemy_sprite.opacity += 15
if @enemy_sprite.x < @enemy_sprite_org
@enemy_sprite.x += 15
if @enemy_sprite.x >= @enemy_sprite_org
@enemy_sprite.x = @enemy_sprite_org
end
end
end
#--------------------------------------------------------------------------
# ● Update Window Fade Animation
#--------------------------------------------------------------------------
def update_window_fade_animation
if @windows_guide.visible
@windows_guide.opacity += 15
@windows_guide.contents_opacity += 15
if @windows_guide.y > @org_pos[1]
@windows_guide.y -= 25
if @windows_guide.y < @org_pos[1]
@windows_guide.y = @org_pos[1]
@windows_guide.opacity += 255
@windows_guide.contents_opacity = 255
end
end
else
@windows_guide.opacity -= 15
@windows_guide.contents_opacity -= 15
if @windows_guide.y < (@windows_guide.height + 416)
@windows_guide.y += 25
@windows_guide.y = (@windows_guide.height + 416) if @windows_guide.y > (@windows_guide.height + 416)
end
end
end
#--------------------------------------------------------------------------
# ● Update Battleback Animation
#--------------------------------------------------------------------------
def update_battleback_animation
if @old_battleback == nil
@battleback1.opacity -= 10
@battleback2.opacity -= 10
else
@battleback1.opacity += 10
@battleback2.opacity += 10
end
end
#--------------------------------------------------------------------------
# ● Update Command
#--------------------------------------------------------------------------
def update_command
if Input.trigger?(Input::B) or Input.press?(Input::B)
Sound.play_cancel
SceneManager.return
elsif Input.trigger?(Input::C)
Sound.play_ok
return
if @windows_guide.visible
@windows_guide.visible = false
else
@windows_guide.visible = true
end
end
end
#--------------------------------------------------------------------------
# ● Refresh Animation
#--------------------------------------------------------------------------
def refresh
@old_index = @windows_guide.index
@enemy = @data[@windows_guide.index]
@windows_status.refresh(@enemy)
refresh_bgm
refresh_enemy_sprite
refresh_batteback
end
#--------------------------------------------------------------------------
# ● Refresh Animation
#--------------------------------------------------------------------------
def refresh_enemy_sprite
if @enemy_sprite.bitmap != nil
@enemy_sprite.bitmap.dispose
@enemy_sprite.bitmap = nil
end
if $game_system.bestiary_defeated[@enemy.id] != nil
@enemy_sprite.bitmap = Cache.battler(@enemy.battler_name, @enemy.battler_hue)
@enemy_sprite_org = (312/ 2) - (@enemy_sprite.bitmap.width / 2)
@enemy_sprite.x = -@enemy_sprite.bitmap.width
@enemy_sprite.y = 272 - @enemy_sprite.bitmap.height
@enemy_sprite.opacity = 0
end
end
#--------------------------------------------------------------------------
# ● BGM Refresh
#--------------------------------------------------------------------------
def refresh_bgm
return unless MOG_MONSTER_BOOK::PLAY_MUSIC
if $game_system.bestiary_music[@enemy.id] != nil and
(@music[0] != $game_system.bestiary_music[@enemy.id].name or
@music[1] != $game_system.bestiary_music[@enemy.id].volume or
@music[2] != $game_system.bestiary_music[@enemy.id].pitch)
m = $game_system.bestiary_music[@enemy.id]
@music = [m.name, m.volume, m.pitch]
RPG::BGM.stop
Audio.bgm_play("Audio/BGM/" + m.name, m.volume, m.pitch) rescue nil
end
end
#--------------------------------------------------------------------------
# ● Refresh Battleback
#--------------------------------------------------------------------------
def refresh_batteback
if $game_system.bestiary_battleback[@enemy.id] != nil and
(@old_battleback[0] != $game_system.bestiary_battleback[@enemy.id][0] or
@old_battleback[1] != $game_system.bestiary_battleback[@enemy.id][1])
@old_battleback = [$game_system.bestiary_battleback[@enemy.id][0], $game_system.bestiary_battleback[@enemy.id][1]]
dispose_battleback
@battleback1.opacity = 0
@battleback2.opacity = 0
if $game_system.bestiary_battleback[@enemy.id][0] != nil
@battleback1.bitmap = Cache.battleback1($game_system.bestiary_battleback[@enemy.id][0])
else
@battleback1.bitmap = Cache.battleback1("")
end
if $game_system.bestiary_battleback[@enemy.id][1] != nil
@battleback2.bitmap = Cache.battleback2($game_system.bestiary_battleback[@enemy.id][1])
else
@battleback2.bitmap = Cache.battleback2("")
end
end
end
end
if MOG_MONSTER_BOOK::MENU_COMMAND
#==============================================================================
# ■ Window Menu Command
#==============================================================================
class Window_MenuCommand < Window_Command
#------------------------------------------------------------------------------
# ● Add Main Commands
#------------------------------------------------------------------------------
alias mog_bestiary_add_main_commands add_main_commands
def add_main_commands
mog_bestiary_add_main_commands
add_command(MOG_MONSTER_BOOK::MENU_COMMAND_NAME, :bestiary, main_commands_enabled)
end
end
#==============================================================================
# ■ Scene Menu
#==============================================================================
class Scene_Menu < Scene_MenuBase
#------------------------------------------------------------------------------
# ● Create Command Windows
#------------------------------------------------------------------------------
alias mog_bestiary_create_command_window create_command_window
def create_command_window
mog_bestiary_create_command_window
@command_window.set_handler(:bestiary, method(:Monster_Book))
end
#------------------------------------------------------------------------------
# ● Monster Book
#------------------------------------------------------------------------------
def Monster_Book
SceneManager.call(Monster_Book)
end
end
end
$mog_rgss3_monster_book = true |
(exactement sorine)
|
Estheone -
posté le 12/04/2013 à 00:56:04 (312 messages postés)
| | Enlève le # devant la commande custom1 :
1
2
3
4
5
6
7
8
9
| COMMANDS =[
:item, # Opens up the various item categories. Default.
:weapon, # Opens up the various weapon categories. Default.
:armor, # Opens up the various armour categories. Default.
:key_item, # Shows a list of the various key items. Default.
:gogototori, # Requires Kread-EX's Go Go Totori Synthesis.
:custom1, # Custom command 1.
# :custom2, # Custom command 2.
] # Do not remove this. |
Dans le tableau en-dessous tu peux choisir le nom qui va s'afficher (disons Bestiary) :
1
2
3
4
5
6
| CUSTOM_ITEM_COMMANDS ={
# :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method],
:gogototori => ["Synthesis", 0, 0, :command_totori],
:custom1 => [ "Bestiary", 0, 0, :command_name1],
:custom2 => [ "Custom Text", 13, 0, :command_name2],
} # Do not remove this. |
Et tu complètes la fonction command_name1 de Scene_Item :
1
2
3
| def command_name1
SceneManager.call(Monster_Book)
end |
Et évidemment tu règles MENU_COMMAND sur false dans le script du bestiaire pour ne pas qu'il soit accessible depuis le menu de base.
Tant que tu y es, ajoute un Input.update à la fin de la fonction execute_loop de la classe Monster_Book, sinon tu vas carrément sortir du menu objet en faisant annuler à partir du bestiaire.
|
Wandering Souls : Jeu complet / Topic sur Oniro |
Ryukko -
posté le 12/04/2013 à 09:49:34 (30 messages postés)
| | Salut!
Hyper rapide
Hyper précis
Hyper simpa
T'auras un hyper merci à la fin de mon jeu ^^ (dans une ou deux décennies)
| Index du forum > Entraide > [VX Ace] Compatibilité de script
|
|
|