Day.png);">
Apprendre


Vous êtes
nouveau sur
Oniromancie?

Visite guidée
du site


Découvrir
RPG Maker

RM 95
RM 2000/2003
RM XP
RM VX/VX Ace
RM MV/MZ

Apprendre
RPG Maker

Tutoriels
Guides
Making-of

Dans le
Forum

Section Entraide

Tutos: Checklist de la composition (...) / Sorties: Dread Mac Farlane - episode 8 / Sorties: Dread Mac Farlane - episode 7 / Jeux: Ce qui vit Dessous / News: Quoi de neuf sur Oniromancie (...) / Chat

Bienvenue
visiteur !




publicité RPG Maker!

Statistiques

Liste des
membres


Contact

Mentions légales

428 connectés actuellement

29386349 visiteurs
depuis l'ouverture

5 visiteurs
aujourd'hui



Barre de séparation

Partenaires

Indiexpo

Akademiya RPG Maker

Blog Alioune Fall

Fairy Tail Constellations

RPG Maker - La Communauté

Leo-Games

ConsoleFun

RPG Maker VX

Tous nos partenaires

Devenir
partenaire



Messages postés par Nérylis
Nombre de messages référencés sur Oniromancie (non supprimés): 145

Aller à la page: 1 2 3 4

Posté dans Forum - [RPG Maker VX Ace] Pourcentages de résistances aux éléments

Nérylis - posté le 14/05/2016 à 10:12:29. (149 messages postés)

J'ai déjà testé en mettant le bout de script au-dessus des autres mais le problème est toujours là.

Posté dans Forum - [RPG Maker VX Ace] Pourcentages de résistances aux éléments

Nérylis - posté le 12/05/2016 à 18:58:23. (149 messages postés)

Ah effectivement, je n'avais pas bien saisi comment cela marchait. Du coup, maintenant, ça semble plus logique car le joueur a l'impression que chaque équipement a une valeur fixe d'augmentation ou de réduction de la résistance aux éléments.

Par contre, quand je configure un équipement de la sorte : ResFeu 20% ou ResFeu 10%, j'obtiens respectivement 81% et 91% au lieu de 80% et 90%. Il y a un petit souci quelque part, non ?

Je dois avoir aussi un problème avec le script qui gère les sets d'équipement. Si le bonus de set est une valeur qui s'ajoute à une résistance élémentale, si la valeur finale dépasse 100, je passe en Absorption (je récupère des points de vie). Alors qu'on devrait être en Insensible.

Je laisse ma démo de menu : http://www.mediafire.com/download/suw7ouj8ew4qw7s/Ace+menu+update.exe

Est-ce que tu peux y jeter un oeil stp ? Il faut inclure le bout de script au-dessus du script de set d'équipement d'Emerald, configurer des équipements pour observer l'addition des valeurs avec une résistance élémentale. Pour tester les sets, le premier personnage peut s'en équiper (prendre des équipements du set Eléments). Si vous avez des questions, demandez-moi par mp car c'est assez corsé comme démo.

Edit :

En prenant un exemple, quand le bonus de set (+25% de Res Feu par exemple) s'ajoute et que le résultat dépasse 100, au lieu d'être Insensible, je suis en Absorption. C'est configuré tel quel dans ma démo pour le port de deux équipements du set Eléments. Je pense que le problème est lié au script d'Emerald (ligne 1039), ou peut-être le script de BlackMorning - Ace Status menu (ligne 885). Il doit y avoir un ajustement à faire mais je ne maîtrise pas suffisamment pour trouver ce qu'il faut modifier.

Et j'ai testé en mettant 0 à la ligne 179 du script de BlackMorning mais je passe quand même en Absorption.

Posté dans Forum - [RPG Maker VX Ace] Pourcentages de résistances aux éléments

Nérylis - posté le 11/05/2016 à 20:12:41. (149 messages postés)

Domaine concerné: Script
Logiciel utilisé: RPG Maker VX Ace
Coucou,

J'ai fait des recherches pour modifier la façon de calculer les résistances aux éléments. La méthode de base ne me plaît pas, le % s'applique sur la valeur actuelle du personnage. Si par exemple, je mets un équipement avec 10% de résistance au feu et un autre équipement avec 20%, je n'obtiens pas 30%. Or c'est ce que j'aimerais.

J'ai trouvé un topic sur un forum qui donne peut-être la solution :

Citation:


This should do what you need.

class Game_BattlerBase
def element_rate(element_id)
er = features_with_id(FEATURE_ELEMENT_RATE, element_id).inject(1.0) do |r, ft|
   r += (ft.value - 1.0)
end
[er, 0].max
end
end

It simply adjusts the way element rates are calculated - you will still use the feature to give rates. The way it calculates will be

100 + (v - 100)

where 'v' is the number you enter into the feature. So if I wanted to add 25% fire resistance, I would have 75 as the value. Additionally, please note that you can already give states element resistance, as it is a feature. There is no need for an addon to achieve that.



J'ai essayé ce bout de script mais je n'ai pas constaté de changement au niveau du cumul des résistances.

Quelqu'un saurait m'en dire plus ?

Posté dans Forum - [RPG Maker VX Ace] Boucle musique avec intro

Nérylis - posté le 01/05/2016 à 19:00:21. (149 messages postés)

Bon finalement, il s'avère que j'avais zappé la partie Loopstart et Looplength du tuto et effectivement avec ça, la boucle se fait bien à partir du point désiré. Et visiblement, c'est le seul moyen de boucler une musique ailleurs qu'au point de départ. Merci pour votre aide. J'ai pas pu essayer ta technique arttroy vu que j'ai supprimé les fichiers intermédiaires.

Posté dans Forum - [RPG Maker VX Ace] Boucle musique avec intro

Nérylis - posté le 01/05/2016 à 15:55:51. (149 messages postés)

Même en évênement commun en Processus Parallèle, on est bloqué dans l'évênement et les commandes de combat n'apparaissent pas.

J'ai déjà essayé la méthode du Battle Start mais c'est pareil, l'évênement en combat bloquera le début du combat et les commandes n'apparaîtront pas.

Posté dans Forum - [RPG Maker VX Ace] Boucle musique avec intro

Nérylis - posté le 01/05/2016 à 13:02:35. (149 messages postés)

Je ne comprends pas ta technique arttroy. Une fois le combat commencé, je ne peux agir que dans la partie Evênement combat, et donc pas en Processus parallèle. Si je mets un Wait pour ensuite passer au Battle theme, ça bloque les commandes.

Posté dans Forum - [RPG Maker VX Ace] Boucle musique avec intro

Nérylis - posté le 01/05/2016 à 12:09:07. (149 messages postés)

Plutôt pas mal, je viens de tester sur la map et ça marche bien. Par contre, je rencontre des soucis pour l'intégrer en combat. En voulant le mettre dans la fenêtre des évênements en combat, les commandes n'apparaissent puisque c'est pas joué en Processus Parallèle. Et en mettant l'évênement sur la map en Processus Parallèle, je dois changer la BGM de combat mais seul le début de l'évênement est joué. Car lorsque le combat démarre, la suite de l'évênement n'est pas joué et du coup, mon intro, elle boucle.^^

Posté dans Forum - [RPG Maker VX Ace] Boucle musique avec intro

Nérylis - posté le 01/05/2016 à 10:37:11. (149 messages postés)

Merci pour le lien du tuto mais je pratique déjà cette méthode. Malheureusement, cela ne résout pas mon problème. Un Wait ne serait pas non plus efficace puisque ça créerait une interruption dans la musique.

Ce que je cherche, c'est boucler la musique à partir d'un certain point et non pas depuis le début. J'ai pensé à intégrer l'intro dans la config de RPG Maker en Battle Start et mettre la partie bouclée dans Battle Music mais ça ne marche pas, les deux thèmes sont joués en même temps.^^

Pour vous donner un exemple qui se pratique dans certains RPGs, voici une petite vidéo : http://www.youtube.com/watch?v=TLB6jG31KXM

Allez à 17min00, vous verrez le combat commencer. Durant les 15 premières secondes du combat, on entend l'intro de la musique qui est jouée. Les 3 minutes suivantes constituent l'OST du battle theme qui est bouclé mais l'intro n'est plus jouée. C'est ça que j'aimerais reconstituer sur RPG Maker.

Posté dans Forum - [RPG Maker VX Ace] Boucle musique avec intro

Nérylis - posté le 30/04/2016 à 18:15:45. (149 messages postés)

Domaine concerné: Commande
Logiciel utilisé: RPG Maker VX Ace
Coucou,

J'ai remarqué que dans certains RPG, on pouvait entendre des musiques qui se répètent en boucle mais qui disposent d'une intro qui elle ne se répète pas. J'ai déjà vu ça pour certains combats, la musique commence en intro, puis on arrive à un passage qui est bouclé. Est-ce qu'on peut faire ça avec RPG Maker ?

Posté dans Forum - [RPG Maker VX Ace] Mémorisation curseur personnages

Nérylis - posté le 26/03/2016 à 18:30:38. (149 messages postés)

Je ne connais pas du tout la syntaxe à utiliser dans ce genre de code.

Posté dans Forum - [RPG Maker VX Ace] Mémorisation curseur personnages

Nérylis - posté le 26/03/2016 à 16:49:59. (149 messages postés)

Impeccable, c'est exactement ça. Merci bien. :)

Posté dans Forum - [RPG Maker VX Ace] Mémorisation curseur personnages

Nérylis - posté le 26/03/2016 à 07:54:11. (149 messages postés)

Domaine concerné: Script
Logiciel utilisé: RPG Maker VX Ace
Coucou,

Par défaut dans RPG maker, le dernier personnage sélectionné en sortant du menu est mémorisé. Si bien que lorsqu'on revient dans le menu, le curseur se place automatiquement sur le personnage dernièrement sélectionné. Je voulais savoir comment faire pour que cette mémorisation ne soit pas effectuée et que le curseur se place sur le premier personnage lorsqu'on sélectionne une option dans le menu.

Un exemple :

Je modifie l'équipement du personnage 3. Une fois cela fait, je sors du menu. Admettons que je décide d'aller dans le menu Compétences, le curseur va directement se placer sur le personnage 3. Or, je souhaiterais que par défaut, le curseur se réinitialise sur le premier personnage.

Posté dans Forum - [RPG Maker VX Ace] Souci avec un wallpaper

Nérylis - posté le 10/03/2016 à 15:47:01. (149 messages postés)

Non, j'ai regardé dans la démo où je n'ai conservé que les scripts de Yanfly - Shop et Mog - Wallpaper et ça le fait toujours cette alternance d'opacité entre les deux parties. C'est donc propre au script de Yanfly. Je vous mets le script si vous souhaitez regarder :

Portion de code : Tout sélectionner

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
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
#==============================================================================
# 
# ▼ Yanfly Engine Ace - Ace Shop Options v1.01
# -- Last Updated: 2012.01.05
# -- Level: Normal, Hard
# -- Requires: n/a
# 
#==============================================================================
 
$imported = {} if $imported.nil?
$imported["YEA-ShopOptions"] = true
 
#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.01.05 - Compatibility Update: Equip Dynamic Stats
# 2012.01.03 - Started Script and Finished.
# 
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# The RPG Maker VX Ace shop scene is relatively basic. It provides adequate
# information, but not really enough to let the player know what they're
# actually buying or even selling. This script enables shops to show more than
# just the basic information displayed in RPG Maker VX Ace and even allow for
# custom commands to be inserted.
# 
#==============================================================================
# ▼ 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.
# -----------------------------------------------------------------------------
# <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 Shop Options.
# 
# -----------------------------------------------------------------------------
# Weapon Notetags - These notetags go in the weapon notebox in the database.
# -----------------------------------------------------------------------------
# <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 Shop Options.
# 
# -----------------------------------------------------------------------------
# Armour Notetags - These notetags go in the armour notebox in the database.
# -----------------------------------------------------------------------------
# <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 Shop Options.
# 
#==============================================================================
# ▼ 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 SHOP
    
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Shop Command Window Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # Here, you can adjust the order at which the commands appear (or even
    # remove commands as you see fit). Here's a list of which does what:
    # 
    # -------------------------------------------------------------------------
    # :command         Description
    # -------------------------------------------------------------------------
    # :buy             Buys items from the shop. Default.
    # :sell            Sells items top the shop. Default.
    # :cancel          Leaves the shop. Default.
    # 
    # :equip           Allows the player to change equipment inside the shop.
    # 
    # :totorishop      Requires Kread-EX's Synthesis Shop.
    # 
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    COMMANDS =[
      :buy,          # Buys items from the shop. Default.
      :sell,         # Sells items top the shop. Default.
      :equip,        # Allows the player to change equipment inside the shop.
    # :totorishop,   # Requires Kread-EX's Synthesis Shop.
      :cancel,       # Leaves the shop. Default.
    # :custom1,      # Custom Command 1.
    # :custom2,      # Custom Command 2.
    ] # Do not remove this.
    
    #--------------------------------------------------------------------------
    # - Shop Custom Commands -
    # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    # For those who use scripts to that may produce unique effects for their
    # shops, use this hash to manage the custom commands for the Shop 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_SHOP_COMMANDS ={
    # :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method],
      :equip   => [     "Equiper",            0,          0, :command_equip],
    # :totorishop => [ "Synthesis",           0,      0, :command_synthshop],
    # :custom1 => [ "Custom Name",            0,          0, :command_name1],
    # :custom2 => [ "Custom Text",           13,          0, :command_name2],
    } # Do not remove this.
    
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Shop Data Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # The shop data window displays information about the item in detail.
    # Adjust the settings below to change the way the data window appears.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    STATUS_FONT_SIZE = 20       # Font size used for data window.
    MAX_ICONS_DRAWN  = 10       # Maximum number of icons drawn for states.
    
    # The following adjusts the vocabulary used for the data window. Each
    # of the vocabulary settings are self explanatory.
    VOCAB_STATUS ={
      :empty      => "---",          # Text used when nothing is shown.
      :hp_recover => "Gain HP",      # Text used for HP Recovery.
      :mp_recover => "Gain MP",      # Text used for MP Recovery.
      :tp_recover => "Gain TP",      # Text used for TP Recovery.
    # :tp_gain    => "Ajout TP",     # Text used for TP Gain.
      :applies    => "Effets",       # Text used for applied states and buffs.
      :removes    => "Soigne",       # Text used for removed states and buffs.
    } # Do not remove this.
    
  end # SHOP
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
    
    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::SHOP::VOCAB_STATUS[type]
  end
  
end # Vocab
 
#==============================================================================
# ■ DataManager
#==============================================================================
 
module DataManager
  
  #--------------------------------------------------------------------------
  # alias method: load_database
  #--------------------------------------------------------------------------
  class <<self; alias load_database_aso load_database; end
  def self.load_database
    load_database_aso
    load_notetags_aso
  end
  
  #--------------------------------------------------------------------------
  # new method: load_notetags_aso
  #--------------------------------------------------------------------------
  def self.load_notetags_aso
    groups = [$data_items, $data_weapons, $data_armors]
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_notetags_aso
      end
    end
  end
  
end # DataManager
 
#==============================================================================
# ■ RPG::BaseItem
#==============================================================================
 
class RPG::BaseItem
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :image
  
  #--------------------------------------------------------------------------
  # common cache: load_notetags_aso
  #--------------------------------------------------------------------------
  def load_notetags_aso
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      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_shop_index
  attr_accessor :scene_shop_oy
  
end # Game_Temp
 
#==============================================================================
# ■ Window_ShopCommand
#==============================================================================
 
class Window_ShopCommand < Window_HorzCommand
  
  #--------------------------------------------------------------------------
  # alias method: make_command_list
  #--------------------------------------------------------------------------
  alias window_shopcommand_make_command_list_aso make_command_list
  def make_command_list
    unless SceneManager.scene_is?(Scene_Shop)
      window_shopcommand_make_command_list_aso
      return
    end
    for command in YEA::SHOP::COMMANDS
      case command
      #--- Default Commands ---
      when :buy
        add_command(Vocab::ShopBuy, :buy)
      when :sell
        add_command(Vocab::ShopSell, :sell, !@purchase_only)
      when :cancel
        add_command(Vocab::ShopCancel, :cancel)
      #--- Imported Commands ---
      when :totorishop
        next unless $imported["KRX-SynthesisShop"]
        process_custom_command(command)
      #--- Custom Commands ---
      else
        process_custom_command(command)
      end
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: process_custom_command
  #--------------------------------------------------------------------------
  def process_custom_command(command)
    return unless YEA::SHOP::CUSTOM_SHOP_COMMANDS.include?(command)
    show = YEA::SHOP::CUSTOM_SHOP_COMMANDS[command][2]
    continue = show <= 0 ? true : $game_switches[show]
    return unless continue
    text = YEA::SHOP::CUSTOM_SHOP_COMMANDS[command][0]
    switch = YEA::SHOP::CUSTOM_SHOP_COMMANDS[command][1]
    enabled = switch <= 0 ? true : $game_switches[switch]
    add_command(text, command, enabled)
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: process_ok
  #--------------------------------------------------------------------------
  def process_ok
    $game_temp.scene_shop_index = index
    $game_temp.scene_shop_oy = self.oy
    super
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: window_width
  #--------------------------------------------------------------------------
  def window_width; return 160; end
  
  #--------------------------------------------------------------------------
  # overwrite method: contents_width
  #--------------------------------------------------------------------------
  def contents_width; return width - standard_padding * 2; end
  
  #--------------------------------------------------------------------------
  # overwrite method: contents_height
  #--------------------------------------------------------------------------
  def contents_height
    ch = height - standard_padding * 2
    return [ch - ch % item_height, row_max * item_height].max
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: visible_line_number
  #--------------------------------------------------------------------------
  def visible_line_number; return 4; end
  
  #--------------------------------------------------------------------------
  # overwrite method: col_max
  #--------------------------------------------------------------------------
  def col_max; return 1; end
    
  #--------------------------------------------------------------------------
  # overwrite method: item_rect
  #--------------------------------------------------------------------------
  def item_rect(index)
    rect = Rect.new
    rect.width = item_width
    rect.height = item_height
    rect.x = index % col_max * (item_width + spacing)
    rect.y = index / col_max * item_height
    rect
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: ensure_cursor_visible
  #--------------------------------------------------------------------------
  def ensure_cursor_visible
    self.top_row = row if row < top_row
    self.bottom_row = row if row > bottom_row
  end
    
  #--------------------------------------------------------------------------
  # overwrite method: cursor_down
  #--------------------------------------------------------------------------
  def cursor_down(wrap = false)
    if index < item_max - col_max || (wrap && col_max == 1)
      select((index + col_max) % item_max)
    end
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: cursor_up
  #--------------------------------------------------------------------------
  def cursor_up(wrap = false)
    if index >= col_max || (wrap && col_max == 1)
      select((index - col_max + item_max) % item_max)
    end
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: process_pageup
  #--------------------------------------------------------------------------
  def process_pageup
    Sound.play_cursor
    Input.update
    deactivate
    call_handler(:pageup)
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: process_pagedown
  #--------------------------------------------------------------------------
  def process_pagedown
    Sound.play_cursor
    Input.update
    deactivate
    call_handler(:pagedown)
  end
  
end # Window_ShopCommand
#==============================================================================
# ■ Window_ShopCategory
#==============================================================================
class Window_ShopCategory < Window_Command
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_reader   :item_window
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0)
  end
  
  #--------------------------------------------------------------------------
  # window_width
  #--------------------------------------------------------------------------
  def window_width; return 160; end
  
  #--------------------------------------------------------------------------
  # visible_line_number
  #--------------------------------------------------------------------------
  def visible_line_number; return 4; end
  
  #--------------------------------------------------------------------------
  # update
  #--------------------------------------------------------------------------
  def update
    super
    @item_window.category = current_symbol if @item_window
  end
  
  #--------------------------------------------------------------------------
  # make_command_list
  #--------------------------------------------------------------------------
  def make_command_list
    add_command(Vocab::item,     :item)
    add_command(Vocab::weapon,   :weapon)
    add_command(Vocab::armor,    :armor)
    add_command(Vocab::key_item, :key_item)
  end
  
  #--------------------------------------------------------------------------
  # item_window=
  #--------------------------------------------------------------------------
  def item_window=(item_window)
    @item_window = item_window
    update
  end
  
end# Window_ShopCategory
#==============================================================================
# ■ Window_ShopBuy
#==============================================================================
class Window_ShopBuy < Window_Selectable
  
  #--------------------------------------------------------------------------
  # overwrite method: item
  #--------------------------------------------------------------------------
  def item
    return index < 0 ? nil : @data[index]
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: window_width
  #--------------------------------------------------------------------------
  def window_width
    return Graphics.width - (Graphics.width * 2 / 5)
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    return if item.nil?
    rect = item_rect(index)
    draw_item_name(item, rect.x, rect.y, enable?(item), rect.width-24)
    rect.width -= 4
    contents.font.size = YEA::LIMIT::SHOP_FONT if $imported["YEA-AdjustLimits"]
    draw_text(rect, price(item).group, 2)
    reset_font_settings
  end
  
end # Window_ShopBuy
#==============================================================================
# ■ Window_ShopSell
#==============================================================================
class Window_ShopSell < Window_ItemList
  
  #--------------------------------------------------------------------------
  # overwrite method: initialize
  #--------------------------------------------------------------------------
  def initialize(dx, dy, dw, dh)
    dw = Graphics.width - (Graphics.width * 2 / 5)
    super(dx, dy, dw, dh)
    self.back_opacity = 0 #Ligne ajoutée si Wallpaper personnalisé
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: col_max
  #--------------------------------------------------------------------------
  def col_max; return 1; end
  
  #--------------------------------------------------------------------------
  # new method: status_window=
  #--------------------------------------------------------------------------
  def status_window= (window)
    @status_window = window
    call_update_help
  end
  
  #--------------------------------------------------------------------------
  # new method: update_help
  #--------------------------------------------------------------------------
  def update_help
    super
    @status_window.item = item if @status_window
  end
  
end # Window_ShopSell
#==============================================================================
# ■ Window_ShopStatus
#==============================================================================
class Window_ShopStatus < Window_Base
  
  #--------------------------------------------------------------------------
  # alias method: initialize
  #--------------------------------------------------------------------------
  alias window_shopstatus_initialize_aso initialize
  def initialize(dx, dy, dw, dh)
    dh = Graphics.height - SceneManager.scene.command_window.y
    dh -= SceneManager.scene.command_window.height + fitting_height(1)
    dy += fitting_height(1)
    window_shopstatus_initialize_aso(dx, dy, dw, dh)
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: page_size
  #--------------------------------------------------------------------------
  def page_size
    n = contents.height - line_height
    n /= line_height
    return n
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: update_page
  #--------------------------------------------------------------------------
  def update_page
    return unless visible
    return if @item.nil?
    return if @item.is_a?(RPG::Item)
    return unless Input.trigger?(:A)
    return unless page_max > 1
    Sound.play_cursor
    @page_index = (@page_index + 1) % page_max
    refresh
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: draw_equip_info
  #--------------------------------------------------------------------------
  def draw_equip_info(dx, dy)
    dy -= line_height
    status_members.each_with_index do |actor, i|
      draw_actor_equip_info(dx, dy + line_height * i, actor)
    end
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: draw_actor_equip_info
  #--------------------------------------------------------------------------
  def draw_actor_equip_info(dx, dy, actor)
    enabled = actor.equippable?(@item)
    change_color(normal_color, enabled)
    draw_text(dx, dy, contents.width, line_height, actor.name)
    item1 = current_equipped_item(actor, @item.etype_id)
    draw_actor_param_change(dx, dy, actor, item1) if enabled
  end
  
end # Window_ShopStatus
 
#==============================================================================
# ■ Window_ShopNumber
#==============================================================================
 
class Window_ShopNumber < Window_Selectable
  
  #--------------------------------------------------------------------------
  # alias method: initialize
  #--------------------------------------------------------------------------
  alias window_shopnumber_initialize_aso initialize
  def initialize(dx, dy, dh)
    dh = Graphics.height - SceneManager.scene.command_window.y
    dh -= SceneManager.scene.command_window.height
    window_shopnumber_initialize_aso(dx, dy, dh)
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: window_width
  #--------------------------------------------------------------------------
  def window_width
    return Graphics.width - (Graphics.width * 2 / 5)
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: figures
  #--------------------------------------------------------------------------
  def figures
    maximum = @max.nil? ? 2 : @max.group.size
    return maximum
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    reset_font_settings
    draw_item_name(@item, 0, item_y, true, contents.width - 24)
    draw_number
    draw_total_price
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: item_y
  #--------------------------------------------------------------------------
  def item_y
    return contents_height / 2 - line_height * 5 / 2
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: price_y
  #--------------------------------------------------------------------------
  def price_y
    return item_y + line_height * 2
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: draw_total_price
  #--------------------------------------------------------------------------
  def draw_total_price
    dw = contents_width - 8
    dy = price_y
    draw_currency_value($game_party.gold, @currency_unit, 4, dy, dw)
    dy += line_height
    draw_horz_line(dy)
    value = @price * @number
    value *= -1 if buy?
    draw_currency_value(value, @currency_unit, 4, dy, dw)
    dy += line_height
    value = $game_party.gold + value
    value = [[value, 0].max, $game_party.max_gold].min
    draw_currency_value(value, @currency_unit, 4, dy, dw)
  end
  
  #--------------------------------------------------------------------------
  # new method: buy?
  #--------------------------------------------------------------------------
  def buy?
    return SceneManager.scene.command_window.current_symbol == :buy
  end
  
  #--------------------------------------------------------------------------
  # new method: sell?
  #--------------------------------------------------------------------------
  def sell?
    return SceneManager.scene.command_window.current_symbol == :sell
  end
  
  #--------------------------------------------------------------------------
  # new method: draw_horz_line
  #--------------------------------------------------------------------------
  def draw_horz_line(dy)
    line_y = dy + line_height - 4
    contents.fill_rect(4, line_y, contents_width-8, 3, Font.default_out_color)
    contents.fill_rect(5, line_y+1, contents_width-10, 1, normal_color)
  end
  
  #--------------------------------------------------------------------------
  # alias method: update_number
  #--------------------------------------------------------------------------
  alias window_shopnumber_update_number_aso update_number
  def update_number
    window_shopnumber_update_number_aso
    change_number(-@max) if Input.repeat?(:L)
    change_number(@max)  if Input.repeat?(:R)
  end
  
end # Window_ShopNumber
 
#==============================================================================
# ■ Window_ShopData
#==============================================================================
 
class Window_ShopData < 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
  
  #--------------------------------------------------------------------------
  # item_window=
  #--------------------------------------------------------------------------
  def item_window= (window)
    @item_window = window
    update_item(@item_window.item)
  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::SHOP::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::SHOP::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::SHOP::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_ShopData
 
#==============================================================================
# ■ Scene_Shop
#==============================================================================
 
class Scene_Shop < Scene_MenuBase
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :command_window
  
  #--------------------------------------------------------------------------
  # alias method: start
  #--------------------------------------------------------------------------
  alias scene_shop_start_aso start
  def start
    scene_shop_start_aso
    create_actor_window
    create_data_window
    clean_up_settings
    relocate_windows
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: return_scene
  #--------------------------------------------------------------------------
  def return_scene
    $game_temp.scene_shop_index = nil
    $game_temp.scene_shop_oy = nil
    super
  end
  
  #--------------------------------------------------------------------------
  # alias method: create_gold_window
  #--------------------------------------------------------------------------
  alias scene_shop_create_gold_window_aso create_gold_window
  def create_gold_window
    scene_shop_create_gold_window_aso
    @gold_window.width = Graphics.width * 2 / 5
    @gold_window.create_contents
    @gold_window.refresh
    @gold_window.x = Graphics.width - @gold_window.width
  end
  
  #--------------------------------------------------------------------------
  # alias method: create_command_window
  #--------------------------------------------------------------------------
  alias scene_shop_create_command_window_aso create_command_window
  def create_command_window
    scene_shop_create_command_window_aso
    return unless SceneManager.scene_is?(Scene_Shop)
    if !$game_temp.scene_shop_index.nil?
      @command_window.select($game_temp.scene_shop_index)
      @command_window.oy = $game_temp.scene_shop_oy
    end
    $game_temp.scene_shop_index = nil
    $game_temp.scene_shop_oy = nil
    @command_window.set_handler(:equip, method(:command_equip))
    process_custom_shop_commands
  end
  
  #--------------------------------------------------------------------------
  # new method: process_custom_shop_commands
  #--------------------------------------------------------------------------
  def process_custom_shop_commands
    for command in YEA::SHOP::COMMANDS
      next unless YEA::SHOP::CUSTOM_SHOP_COMMANDS.include?(command)
      called_method = YEA::SHOP::CUSTOM_SHOP_COMMANDS[command][3]
      @command_window.set_handler(command, method(called_method))
    end
  end
  
  #--------------------------------------------------------------------------
  # alias method: create_dummy_window
  #--------------------------------------------------------------------------
  alias scene_shop_create_dummy_window_aso create_dummy_window
  def create_dummy_window
    scene_shop_create_dummy_window_aso
    @gold_window.y = @dummy_window.y
    @dummy_window.opacity = 0
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: create_category_window
  #--------------------------------------------------------------------------
  def create_category_window
    @category_window = Window_ShopCategory.new
    @category_window.viewport = @viewport
    @category_window.help_window = @help_window
    @category_window.y = @command_window.y
    @category_window.deactivate
    @category_window.x = Graphics.width
    @category_window.set_handler(:ok,     method(:on_category_ok))
    @category_window.set_handler(:cancel, method(:on_category_cancel))
  end
  
  #--------------------------------------------------------------------------
  # new method: create_actor_window
  #--------------------------------------------------------------------------
  def create_actor_window
    @actor_window = Window_MenuActor.new
    @actor_window.set_handler(:ok,     method(:on_actor_ok))
    @actor_window.set_handler(:cancel, method(:on_actor_cancel))
  end
  
  #--------------------------------------------------------------------------
  # new method: create_data_window
  #--------------------------------------------------------------------------
  def create_data_window
    wx = @command_window.width
    wy = @command_window.y
    @data_window = Window_ShopData.new(wx, wy, @buy_window)
    @data_window.viewport = @viewport
  end
  
  #--------------------------------------------------------------------------
  # new method: clean_up_settings
  #--------------------------------------------------------------------------
  def clean_up_settings
    @dummy_window.create_contents
    @buy_window.show
    @buy_window.unselect
    @buy_window.money = money
    @last_buy_index = 0
    @status_window.show
    @sell_window.show
    @sell_window.x = Graphics.width
    @sell_window.status_window = @status_window
  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
      @command_window.y = @help_window.height
      @buy_window.y = @command_window.y + @command_window.height
    when 1 # Middle
      @command_window.y = 0
      @help_window.y = @command_window.height
      @buy_window.y = @help_window.y + @help_window.height
    else # Bottom
      @command_window.y = 0
      @buy_window.y = @command_window.height
      @help_window.y = @buy_window.y + @buy_window.height
    end
    @category_window.y = @command_window.y
    @data_window.y = @command_window.y
    @gold_window.y = @buy_window.y
    @sell_window.y = @buy_window.y
    @number_window.y = @buy_window.y
    @status_window.y = @gold_window.y + @gold_window.height
  end
  
  #--------------------------------------------------------------------------
  # new method: show_sub_window
  #--------------------------------------------------------------------------
  def show_sub_window(window)
    width_remain = Graphics.width - window.width
    window.x = width_remain
    @viewport.rect.x = @viewport.ox = 0
    @viewport.rect.width = width_remain
    window.show.activate
  end
  
  #--------------------------------------------------------------------------
  # new method: hide_sub_window
  #--------------------------------------------------------------------------
  def hide_sub_window(window)
    @viewport.rect.x = @viewport.ox = 0
    @viewport.rect.width = Graphics.width
    window.hide.deactivate
    @command_window.activate
  end
  
  #--------------------------------------------------------------------------
  # new method: on_actor_ok
  #--------------------------------------------------------------------------
  def on_actor_ok
    case @command_window.current_symbol
    when :equip
      Sound.play_ok
      $game_party.menu_actor = $game_party.members[@actor_window.index]
      SceneManager.call(Scene_Equip)
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: on_actor_cancel
  #--------------------------------------------------------------------------
  def on_actor_cancel
    hide_sub_window(@actor_window)
  end
  
  #--------------------------------------------------------------------------
  # alias method: activate_sell_window
  #--------------------------------------------------------------------------
  alias scene_shop_activate_sell_window_aso activate_sell_window
  def activate_sell_window
    scene_shop_activate_sell_window_aso
    @status_window.show
  end
  
  #--------------------------------------------------------------------------
  # alias method: command_buy
  #--------------------------------------------------------------------------
  alias scene_shop_command_buy_aso command_buy
  def command_buy
    scene_shop_command_buy_aso
    @buy_window.select(@last_buy_index)
    @data_window.item_window = @buy_window
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: command_sell
  #--------------------------------------------------------------------------
  def command_sell
    @dummy_window.hide
    @category_window.activate
    @category_window.x = 0
    @command_window.x = Graphics.width
    @sell_window.x = 0
    @buy_window.x = Graphics.width
    @sell_window.unselect
    @sell_window.refresh
    @data_window.item_window = @sell_window
  end
  
  #--------------------------------------------------------------------------
  # alias method: on_buy_cancel
  #--------------------------------------------------------------------------
  alias scene_shop_on_buy_cancel_aso on_buy_cancel
  def on_buy_cancel
    @last_buy_index = @buy_window.index
    @buy_window.unselect
    scene_shop_on_buy_cancel_aso
    @buy_window.show
    @status_window.show
  end
  
  #--------------------------------------------------------------------------
  # alias method: on_sell_ok
  #--------------------------------------------------------------------------
  alias scene_shop_on_sell_ok_aso on_sell_ok
  def on_sell_ok
    scene_shop_on_sell_ok_aso
    @category_window.show
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: on_category_cancel
  #--------------------------------------------------------------------------
  def on_category_cancel
    @command_window.activate
    @dummy_window.show
    @category_window.x = Graphics.width
    @command_window.x = 0
    @sell_window.x = Graphics.width
    @buy_window.money = money
    @buy_window.x = 0
  end
  
  #--------------------------------------------------------------------------
  # new method: current_command_window_symbol
  #--------------------------------------------------------------------------
  def current_command_window_symbol
    return @command_window.current_symbol
  end
  
  #--------------------------------------------------------------------------
  # new method: current_command_window_y
  #--------------------------------------------------------------------------
  def current_command_window
    return @command_window
  end
  
  #--------------------------------------------------------------------------
  # new method: command_equip
  #--------------------------------------------------------------------------
  def command_equip
    show_sub_window(@actor_window)
    @actor_window.select_last
  end
  
  #--------------------------------------------------------------------------
  # new method: command_synthshop
  #--------------------------------------------------------------------------
  def command_synthshop
    SceneManager.call(Scene_SynthesisShop)
  end
  
  #--------------------------------------------------------------------------
  # new method: command_name1
  #--------------------------------------------------------------------------
  def command_name1
    # Do nothing.
  end
  
  #--------------------------------------------------------------------------
  # new method: command_name2
  #--------------------------------------------------------------------------
  def command_name2
    # Do nothing.
  end
  
end # Scene_Shop
 
#==============================================================================
# 
# ▼ End of File
# 
#==============================================================================



Posté dans Forum - [RPG Maker VX Ace] Souci avec un wallpaper

Nérylis - posté le 10/03/2016 à 10:21:44. (149 messages postés)

Il n'y a que la ligne que j'ai ajoutée. Le back_opacity n'apparaît pas autre part dans le script de Yanfly.

Posté dans Forum - [RPG Maker VX Ace] Souci avec un wallpaper

Nérylis - posté le 09/03/2016 à 22:55:30. (149 messages postés)

Bien vu, ça marche mieux. Merci.

Et pour l'histoire de l'opacité qui est alternée entre les écrans supérieurs et inférieurs quand on navigue entre le menu de gauche et celui du bas, on ne peut rien faire pour éviter de voir cette différence ? Je demande ça par curiosité.

Posté dans Forum - [RPG Maker VX Ace] Souci avec un wallpaper

Nérylis - posté le 09/03/2016 à 19:45:45. (149 messages postés)

J'ai bien essayé mais ça me met un message d'erreur. Il change quelque chose dans le def initialize du Shop_Sell.

A la base, dans RPG Maker, on a ça :

def initialize(x, y, width, height)
super(x, y, width, height)
end

Et lui, il met ça :

def initialize(dx, dy, dw, dh)
dw = Graphics.width - (Graphics.width * 2 / 5)
super(dx, dy, dw, dh)
end

Quand je rajoute la ligne self.back_opacity = 0, j'ai un message d'erreur.

Posté dans Forum - [RPG Maker VX Ace] Bug condition

Nérylis - posté le 09/03/2016 à 18:04:23. (149 messages postés)

Omg le piège. Effectivement, l'id de la première monnaie est 0. Merci du coup de main. :)

Posté dans Forum - [RPG Maker VX Ace] Souci avec un wallpaper

Nérylis - posté le 09/03/2016 à 17:58:47. (149 messages postés)

J'ai essayé en mettant un wallpaper tout noir pour mieux y voir. J'ai ajouté la ligne self.back_opacity = 0 dans les 4 Windows que tu m'as dit, avant le refresh de la def initialize. Il y a un problème au niveau du Shop_Sell et ça doit être lié au script de Yanfly (à partir de la ligne 490, il réécrit le def initalize). Voilà ce que j'obtiens :

image

Sinon, j'ai toujours 2 couleurs (opacités ?) différentes entre la partie supérieure et la partie inférieure de l'écran (voir screens ci-dessous). C'est possible de n'avoir qu'un seul ton pour les deux ?

image

image

Posté dans Forum - [RPG Maker VX Ace] Bug condition

Nérylis - posté le 09/03/2016 à 15:35:57. (149 messages postés)

Par exemple, si le joueur possède tant de pièces d'or, alors la condition est vraie. Sinon, elle est fausse. En admettant que l'or soit la première monnaie configurée dans le script (ce qui est le cas), j'étais parti là-dessus : $game_party.gold2[1], 1 étant l'id de la première monnaie. Donc $game_party.gold2[1] < 1000 dans la condition. Mais ça ne marche pas.

Posté dans Forum - [RPG Maker VX Ace] Souci avec un wallpaper

Nérylis - posté le 09/03/2016 à 15:15:21. (149 messages postés)

Domaine concerné: Script
Logiciel utilisé: RPG Maker VX Ace
Coucou,

Je rencontre un petit souci avec un script de Mog Hunter pour ajouter un wallpaper dans les menus. Dans son script, il suffit de configurer le nom des Scenes dans lesquelles le wallpaper doit être appliqué. J'ai réussi à le mettre partout où je voulais mais il y a un endroit où c'est mal appliqué. C'est lorsque j'ouvre le menu de magasin (à noter que j'utilise le script de Yanfly - Shop), on peut constater l'écran inférieur qui est bleuté lorsque je navigue dans le menu de gauche (voir capture ci-dessous).

image

J'ai eu beau regarder si une Scene ne m'avait pas échappé, le problème persiste et je n'arrive pas à le résoudre. Pouvez-vous m'aider s'il vous plaît ?

Je vous mets une démo avec juste les deux scripts : http://www.mediafire.com/download/14b6hm60y1rh7jk/Bug+Wallpaper.exe

Posté dans Forum - [RPG Maker VX Ace] Bug condition

Nérylis - posté le 06/03/2016 à 20:59:42. (149 messages postés)

Domaine concerné: Script
Logiciel utilisé: RPG Maker VX Ace
Bonjour,

Je rencontre un souci dans la formulation d'une condition. J'utilise un script pour avoir plusieurs monnaies dans le jeu. L'auteur, qui n'est malheureusement pas disponible depuis plusieurs mois, m'avait informé qu'on pouvait faire des conditions en utilisant $game_party.gold2[id]. A une époque, il me semble que cela marchait bien mais peut-être en mettant à jour son script, cela a modifié le fonctionnement car maintenant, ça ne marche plus et je ne trouve pas la solution. Pouvez-vous m'aider svp ? Je pourrais certes stocker la valeur actuelle de la monnaie dans une variable et faire la condition par rapport à cette variable mais j'aimerais retrouver la fonctionnalité d'origine de préférence.

Une démo pour que vous puissiez tester : http://www.mediafire.com/download/3cgp2ngp3pnollc/Bug+Condition.exe

Le script est dans la démo.

Posté dans Forum - [RPG Maker VX Ace] Problème gain de bonus

Nérylis - posté le 03/03/2016 à 21:54:25. (149 messages postés)

Regarde les autres types de bonus, notamment le 1 avec les pourcentages. Tu devrais constater une anomalie.

Posté dans Forum - [RPG Maker VX Ace] Problème gain de bonus

Nérylis - posté le 03/03/2016 à 19:05:29. (149 messages postés)

Cela dit, je viens de voir que sa dernière connection au forum remontait à mi-septembre. Peu d'espoir donc. As-tu regardé de ton côté si tu arrivais à faire marcher les bonus de type 1 ? Je pense qu'il doit y avoir une erreur dans le script lors de l'ajout du bonus qui est répétée à chaque fois.

Posté dans Forum - [RPG Maker VX Ace] Problème gain de bonus

Nérylis - posté le 03/03/2016 à 10:12:39. (149 messages postés)

J'ai essayé avec le script d'origine. Même constat : les bonus de type 0 fonctionnent mais pas ceux de type 1 avec les pourcentages. Quant aux autres, je n'ai pas pu vérifier puisqu'il n'y a aucune interface permettant de voir des stats comme la précision ou la résistance aux éléments. Tu arrives à faire fonctionner les pourcentages (les bonus de type 1) ? J'ai configuré comme tel :

Set_Bonuses =
{
1 => {
1 => [[1, 0, 10]],
2 => [[1, 0, 10]]
},
}

Normalement, je dois avoir 10% de HP en plus quand je m'équipe du premier équipement, et encore 10% quand je m'équipe du second.

Pour la modification faite par vincent26, il avait ajouté une interface permettant de visualiser les sets d'équipement, avec du texte permettant d'avoir des caractères spéciaux. Il avait fait en sorte aussi que la équipements des sets soient définis avec des notetags puisque j'utilise des Instance Items.

Posté dans Forum - [RPG Maker VX Ace] Problème gain de bonus

Nérylis - posté le 01/03/2016 à 09:50:24. (149 messages postés)

Je viens de tester en gardant juste le script de set et j'ai configuré de manière à ce que deux pièces du même équipement donnent un bonus de type 1, à savoir 10% de HP en plus. Je ne constate aucun bonus, donc ce n'est pas un conflit avec un autre script, le problème vient du script en lui-même.

Je vous ai fait une démo simplifiée en supprimant la majorité des autres scripts : http://www.mediafire.com/download/31pqu188umohz18/Bug+Sets+Bonus.exe

Posté dans Forum - [RPG Maker VX Ace] Ajustement fenêtre

Nérylis - posté le 29/02/2016 à 21:56:33. (149 messages postés)

Je viens de tester, je n'ai pas vu de changement. Pour la transition, pas de soucis. Mais pas de défilement.

Tu peux configurer un équipement en ajoutant 4-5 conditions en notetag comme par exemple :
<mhpreq 50>
<mmpreq 50>
<atkreq 10>
<defreq 10>
<matreq 10>
<mdfreq 10>
<agireq 10>
<lukreq 10>

Dans le script qui sert d'exemple, il y a un def recreate_contents à la ligne 79 avec le self.oy, ça a sans doute un rapport, non ?

Edit : Voici la solution.^^

Portion de code : Tout sélectionner

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
=begin
Equipment Requirements
by Fomar0153
modified by Zouzaka
Version 1.3
----------------------
Notes
----------------------
Adds a level requirement to equipment.
----------------------
Instructions
----------------------
Notetag the weapons/armors like so:
<levelreq x>
<mhpreq x>
<mmpreq x>
<atkreq x>
<defreq x>
<matreq x>
<mdfreq x>
<agireq x>
<lukreq x>
<switchreq x>
<variablereq x,y>
<wepreq x>
<armreq x>
----------------------
Change Log
----------------------
1.0 -> 1.1 Added stat requirements
          Changed script name from Equipment Level Requirements
          to just Equipment Requirements
1.1 -> 1.2 Added switch and other equipment requirements
1.2 -> 1.3 Ajout D'une Window qui affiche les Conditions requises
          Réduit le script de base de plus de 50 lignes
1.3 -> 1.4 Optimisation et resolution de bug
----------------------
Known bugs
----------------------
None
=end
  #--------------------------------------------------------------------------
  # ● If set to true then it compares the requirement with the actor's base 
  #  stat rather than their current.
  #--------------------------------------------------------------------------
EQUIPREQ_USE_BASE_STAT = true
  #--------------------------------------------------------------------------
  # ● Vocab for switch's 
  #  every switch_id in a different line
  #--------------------------------------------------------------------------
 
Switch_Vocab = {
# Switch_ID => "Vocab",
#2 => "Visiter la Campagne",
}
  #--------------------------------------------------------------------------
  # ● Vocab for variables 
  #  every variable_id in a different line
  #--------------------------------------------------------------------------
 
Variable_Vocab = {
# Variable_ID => "Vocab",
#2 => "Nombre de pierres à casser",
}
 
 
class Game_Actor
  def optimize_equipments
    clear_equipments
    equip_slots.size.times do |i|
      next if !equip_change_ok?(i)
      items = $game_party.equip_items.select do |item|
        item.etype_id == equip_slots[i] &&
        equippable?(item) && item.performance >= 0 && reqstate?(item)
      end
      change_equip(i, items.max_by {|item| item.performance })
    end
  end
  def reqstate?(item)
    unless item == nil
      return false if level < item.levelreq
      return false if reqstat(0) < item.mhpreq
      return false if reqstat(1) < item.mmpreq
      return false if reqstat(2) < item.atkreq
      return false if reqstat(3) < item.defreq
      return false if reqstat(4) < item.matreq
      return false if reqstat(5) < item.mdfreq
      return false if reqstat(6) < item.agireq
      return false if reqstat(7) < item.lukreq
      if item.switchreq > 0
        return false unless $game_switches[item.switchreq]
      end
      if item.variablereq != 0
        return false unless $game_variables[item.variablereq[0]] < item.variablereq[1]
      end
      if item.wepreq > 0
        e = []
        for equip in equips
          e.push(equip.id) if equip.class == RPG::Weapon
        end
        return false unless e.include?(item.wepreq)
      end
      if item.armreq > 0
        e = []
        for equip in equips
          e.push(equip.id) if equip.class == RPG::Armor
        end
        return false unless e.include?(item.armreq)
      end
    end
    return true
  end
  #--------------------------------------------------------------------------
  # ● New Method
  #--------------------------------------------------------------------------
  def reqstat(id)
    EQUIPREQ_USE_BASE_STAT ? param_base(id) : param(id)
  end
end
class Window_EquipItem
  #--------------------------------------------------------------------------
  # ● Check the requirements
  #--------------------------------------------------------------------------
  def enable?(item)
    return @actor.reqstate?(item)
  end
end
module RPG
  #--------------------------------------------------------------------------
  # ● Equip Item is inherited by both Weapon and Armor
  #--------------------------------------------------------------------------
  class EquipItem
    def variablereq
      self.note =~ /<variablereq (.*),(.*)>/i ? [$1.to_i,$2.to_i] : 0
    end
    def levelreq
      self.note =~ /<levelreq (.*)>/i ? $1.to_i : 0
    end
    def mhpreq
      self.note =~ /<mhpreq (.*)>/i ? $1.to_i : 0
    end
    def mmpreq
      self.note =~ /<mmpreq (.*)>/i ? $1.to_i : 0
    end
    def atkreq
      self.note =~ /<atkreq (.*)>/i ? $1.to_i : 0
    end
    def defreq
      self.note =~ /<defreq (.*)>/i ? $1.to_i : 0
    end
    def matreq
      self.note =~ /<matreq (.*)>/i ? $1.to_i : 0
    end
    def mdfreq
      self.note =~ /<mdfreq (.*)>/i ? $1.to_i : 0
    end
    def agireq
      self.note =~ /<agireq (.*)>/i ? $1.to_i : 0
    end
    def lukreq
      self.note =~ /<lukreq (.*)>/i ? $1.to_i : 0
    end
    def switchreq
      self.note =~ /<switchreq (.*)>/i ? $1.to_i : 0
    end
    def wepreq
      self.note =~ /<wepreq (.*)>/i ? $1.to_i : 0
    end
    def armreq
      self.note =~ /<armreq (.*)>/i ? $1.to_i : 0
    end
  end
end
class Window_Requirement < Window_Base
  def initialize(x, y)
    super(x, y, window_width, window_height)#(x, y, Graphics.width/2, Graphics.height)
    #self.openness = 0
    self.visible = false
    self.z = 250
    @item = nil
    @actor = nil
    self.padding = 16
    refresh
  end
  def window_width
    return 326
  end
  def window_height
    return 224
  end
  def reqstat(id)
    EQUIPREQ_USE_BASE_STAT ? @actor.param_base(id) : @actor.param(id)
  end
  def item ; return @item ; end
  def item=(item)
    @item = item
    refresh
  end
  def actor ; return @actor ; end
  def actor=(actor)
    @actor = actor
    refresh
  end
  def update
    super
    #refresh
  end
  def refresh
    self.oy = 0
    @req = ["item.levelreq","item.mhpreq","item.mmpreq","item.atkreq","item.defreq","item.matreq","item.mdfreq","item.agireq","item.lukreq"]#,"item.wepreq","item.armreq"]
    @vocab_req = [Vocab.level,Vocab.param(0),Vocab.param(1),Vocab.param(2),Vocab.param(3),Vocab.param(4),Vocab.param(5),Vocab.param(6),Vocab.param(7)]#,Vocab.weapon,Vocab.armor]
    @req_condition = ["@actor.level","reqstat(0)","reqstat(1)","reqstat(2)","reqstat(3)","reqstat(4)","reqstat(5)","reqstat(6)","reqstat(7)"]
    
    
    # Calculer la taille du contenu
    @t = 2
    @req.each do |req|
      if item != nil && eval(req) != 0 && actor != nil
        @t += 1
      end
    end
    if item != nil && item.wepreq != 0 && actor != nil
      @t += 1
    end
    if item != nil && item.armreq != 0 && actor != nil
      @t += 1
    end
    if item && item.switchreq != 0
      @t += 1
    end
    if item && item.variablereq != 0
      @t += 1
    end
    
    self.contents = Bitmap.new(width - self.padding * 2, @t * line_height)
    
    change_color(system_color)
    draw_text(contents.width/6, 0, contents.width, line_height, "Conditions requises")
    @t = 2
    @req.each do |req|
      if item != nil && eval(req) != 0 && actor != nil
        eval(@req_condition[@req.index(req)]) < eval(req) ? change_color(text_color(2)) : change_color(normal_color)
        draw_text(0, line_height*@t, contents.width, line_height, @vocab_req[@req.index(req)]+" requis : "+eval(req).to_s)
        @t += 1
      end
    end
    change_color(normal_color)
    if item != nil && item.wepreq != 0 && actor != nil
      e = []
      for equip in @actor.equips 
        if equip.class == RPG::Weapon
          e.push(equip.id)
        end
      end
      change_color(text_color(2)) unless e.include?(item.wepreq)
      draw_text(0, line_height*@t, contents.width, line_height, "Arme requise : "+$data_weapons[item.wepreq].name)
      @t += 1
    end
    change_color(normal_color)
    if item != nil && item.armreq != 0 && actor != nil
      e = []
      for equip in @actor.equips
        e.push(equip.id) if equip.class == RPG::Armor
      end
      change_color(text_color(2)) unless e.include?(item.armreq)
      draw_text(0, line_height*(@t), contents.width, line_height, "Armure requise : "+$data_armors[item.armreq].name)
      @t += 1
    end
    if item && item.switchreq != 0
      $game_switches[item.switchreq] ? change_color(normal_color) : change_color(text_color(2))
      draw_text(0, line_height*(@t), contents.width, line_height, Switch_Vocab[item.switchreq])
      @t += 1
    end
    if item && item.variablereq != 0
      $game_variables[item.variablereq[0]] >= item.variablereq[1] ? change_color(normal_color) : change_color(text_color(2))
      draw_text(0, line_height*(@t), contents.width, line_height, Variable_Vocab[item.variablereq[0]]+" "+$game_variables[item.variablereq[0]].to_s+"/"+item.variablereq[1].to_s)
    end
  end
  
  def downStat
    dif = (@t * line_height) - (height - self.padding * 2)
    save_oy = self.oy
    if self.oy + line_height > dif
      self.oy = [dif,0].max
    else
      self.oy += line_height
    end
    if save_oy != self.oy
      Sound.play_cursor
    end
  end
  
  def upStat
    save_oy = self.oy
    if self.oy - line_height < 0
      self.oy = 0
    else
      self.oy -= line_height
    end
    if save_oy != self.oy
      Sound.play_cursor
    end
  end
  
end
 
#~ #==============================================================================
#~ # ** Scene_Equip
#~ #------------------------------------------------------------------------------
#~ #  This class performs the equipment screen processing.
#~ #==============================================================================
 
class Scene_Equip
  alias :old_start :start
  def start
    old_start
    @window_req = Window_Requirement.new(0,192)#(Graphics.width/4,0)
  end
  alias :old_update :update
  def update
    old_update
    if Input.trigger?(:CTRL)
      #if @window_req.openness == 0 && @item_window.active && @item_window.item != nil
      if !@window_req.visible && @item_window.active && @item_window.item != nil
        Sound.play_cursor
        @window_req.item=@item_window.item
        @window_req.actor= @actor
        #@background = Sprite.new
        #@background.z = 200
        #@background.bitmap = Bitmap.new(Graphics.width, Graphics.height)
      # @background.bitmap.fill_rect(0,0,Graphics.width,Graphics.height,Color.new(0, 0, 0,128))
        #@window_req.open
        @window_req.visible = true
        @item_window.deactivate
        @item_window.visible = false
      #elsif @window_req.openness == 255
      elsif @window_req.visible
        Sound.play_cancel
        #@background.dispose if @background
        #@window_req.close
        @item_window.activate
        @item_window.visible = true
        @window_req.visible = false
      end
    elsif Input.trigger?(:B)
      #if @window_req.openness == 255
      if @window_req.visible
        Sound.play_cancel
        #@background.dispose if @background
        #@window_req.close
        @item_window.activate
        @item_window.visible = true
        @window_req.visible = false
      end
    elsif Input.trigger?(:UP) && @window_req.visible
      @window_req.upStat
      #@status_window.refresh(@status_window.item_actuel)
    elsif Input.trigger?(:DOWN) && @window_req.visible
      @window_req.downStat
    end
  end
end



Du coup, ça marche. Merci pour l'aide apportée. Il ne me reste plus qu'un problème sur l'autre topic à solutionner pour ma démo.

Posté dans Forum - [RPG Maker VX Ace] Ajustement fenêtre

Nérylis - posté le 29/02/2016 à 20:06:06. (149 messages postés)

Non, il a juste modifié le script que j'ai mis plus haut. Il me semble que c'est le "DownStat" et le "UpStat" qui gèrent le défilement, non ? On les retrouve lignes 27 et 30, et aussi à la fin.

Posté dans Forum - [RPG Maker VX Ace] Problème gain de bonus

Nérylis - posté le 29/02/2016 à 15:08:19. (149 messages postés)

Au niveau des bonus de type 0 (stats générales) et de type 5 (résistances aux éléments), ça fonctionne. Il doit donc y avoir une erreur pour les autres types 1, 2, 3, 7 et 8 sur l'ajout du bonus.

Posté dans Forum - [RPG Maker VX Ace] Problème gain de bonus

Nérylis - posté le 29/02/2016 à 09:40:38. (149 messages postés)

Up

Posté dans Forum - [RPG Maker VX Ace] Ajustement fenêtre

Nérylis - posté le 26/02/2016 à 16:22:24. (149 messages postés)

D'ac. J'ai voulu refaire comme pour l'autre interface mais je n'arrive même pas à enlever cette transition.

Posté dans Forum - [RPG Maker VX Ace] Problème gain de bonus

Nérylis - posté le 25/02/2016 à 20:17:20. (149 messages postés)

Cela est valable en tout temps, à partir du moment que les personnages sont équipés de plusieurs pièces d'équipement (c'est au nombre de pièces, donc cela fait beaucoup de possibilités par set d'équipement).

Posté dans Forum - [RPG Maker VX Ace] Problème gain de bonus

Nérylis - posté le 25/02/2016 à 20:06:46. (149 messages postés)

Domaine concerné: Script
Logiciel utilisé: RPG Maker VX Ace
Coucou,

Je rencontre un ultime problème sur ma démo de menu. J'utilise un système de sets d'équipements qui consiste à faire gagner des bonus supplémentaires aux personnages possédant plusieurs pièces d'un même ensemble d'équipements. Le souci que je rencontre, c'est que la plupart de ces bonus ne s'appliquent pas et je ne sais pas comment modifier le script pour régler ce problème.

Je vous mets une démo : http://www.mediafire.com/download/yxoti79mf54ceu8/Ace+menu6.exe
Quand vous prenez le contrôle du personnage, marchez sur l'hexagramme situé juste en-dessous pour pouvoir vous équiper avec le premier personnage des deux stuffs de couleur orange. Une fois équipé, appuyez sur la touche D sur l'écran de l'équipement pour accéder à l'interface et visualiser le bonus activé. Puis allez dans le menu Statut pour vérifier que les statistiques ont été modifiées.
Le bonus se configure à la ligne 422 du script Equipment Sets d'Emerald ci-dessous. J'ai pu remarquer que les bonus de type 1 (Standard Parameters Percentage), de type 2 (Extra parameters), de type 3 (Special parameters), de type 7 (State Rate) et de type 8 (State Resist) ne fonctionnaient pas. Je n'ai pas testé les autres (peut-être y a-t-il une même erreur à chaque fois) mais les bonus de type 0 et de type 5 fonctionnent.

Le script impacté ci-dessous :

Portion de code : Tout sélectionner

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
#============================================================================
# Equipment Sets v2.1e
# By Emerald
#----------------------------------------------------------------------------
# You're free to use the script for any game, as long as you give credits
#----------------------------------------------------------------------------
# Version History
# 1.0 -> Script fully ready for public use. Addes sets, unlimited set items,
#        set bonuses for the 8 basic stats, set bonuses requirement (how many
#        items of the set is the actor wearing?)
# 1.1 -> a. changed the set bonuses work. Instead of [parameter, bonus] you now
#        use [sort, parameter, bonus]. Also added sorts 0 and 2. Check SPECIAL
#        VALUES for their corresponding parameters.
#        b. Added sort 1: Standard Parameters (Percentage). The corresponding
#        parameters are the same as for sort 0. See SPECIAL VALUES for extra
#        notes.
# 1.2 -> Added Sort 3: Special Parameters. The values for the parameters can be
#        found in SPECIAL VALUES, just as usual. Addes Sort 4: Skills!! These
#        use a different syntax than the other bonuses, so be sure to check
#        SPECIAL VALUES if you are unfamiliar with them.
# 1.3 -> a. rewritten most of the code to remove so major bugs. Also cleaned
#        code (about 140 lines less this time, WITH 4 added Sorts). Added
#        Module Emerald (EME). Sets and Set_Bonuses move to Module EME. Added
#        MAX_ELEMENTS to Module EME. Added Sort 5 (Elemental Efficiency), Sort
#        6 (Debuff Rate), Sort 7 (State Rate), Sort 8 (State Resist) and Sort 9
#        (Attack Elements). See SPECIAL VALUES for instructions.
#        WARNING these are still in Beta Stage, so report all bugs found.  
#        b. removed many, MANY major bugs! Removed a bug where unequipping
#        resulted in an undefined array, removed some typos, fixed the bonuses
#        for almost EVERY Sort, removed some more typos, shortened code a little
#        bit, removed some more minor bugs regarding change_equip.
# 1.4 -> More bug fixes. Also added Sort 10 (Attack States), Sort 11 (Equipment
#        Types) and Sort 12 (Attack Specials). Refer to SPECIAL VALUES for
#        all needed information.
# 1.5 -> Bug fix to discard_equip(...). Added the foruth value of Sort 11
#        (Dual Wielding), added Sort 13, Sort 14, Sort 15, Sort 16 and Sort 17
#        which are Additional Skill Types, Sealed Skill Types, Sealed Skills,
#        Fixed Equip Types and Sealed Equip Types respectively. As usual, go to
#        SPECIAL VALUES for the needed instructions.
# 1.6 -> Added a compatibility patch for Fomar's Dual Wield -> Free Hands script.
# 1.7 -> Added Sorts 18 (special flags), 19 (party abilities) and 20 (other
#        traits). See SPECIAL VALUES for the instructions.
# 1.8a-> Added sounds to be played when a certain amount of set pieces has been
#        equipped. Also removed a bug regarding skipping amounts of pieces.
# 1.8b-> Small bugfix regarding set sounds.
# 1.8c-> Small bugfix regarding attack states.
#
# 2.0 -> MAJOR REWRITE. Aliased a few more methods than before, to further
#        increases compatability. Added a method which initializes sets which
#        are worn by actors at the start of the game. Halved the code used to
#        determine if items belong to sets. Scraped a few uneccessairy methods.
#        Practically removed 2/3 of my version of release_unequipable_equips,
#        and made the EES + Fomar123's Dual Wield -> Free Hands script patch
#        1 line instead of 10. Almost entirely changed the way Set Skills and
#        Set Equipment Options work. Also fixed a few bugs in the progress
#        (for example additions of variable 2 which I accidentally left in the
#        script.)
# 2.1a-> Start of the debugging patch. Added a function to remove bonuses when
#        unequipping stuff, like usual. Forgot to re-add in 2.0 >.<
# 2.1b-> Fixed a small typo.
# 2.1c-> Fixed initalizition of set equips.
# 2.1d-> Fixed a bug regarding bonuses not being applied upon optimizing equips
#        and a bug regarding the removing of bonuses when unequipping stuff.
# 2.1e-> Removed something which I should have added (regarding the BaseItem
#        class) in release_unequippable_items. This also fixed the compatibility
#        issues with Tsukihime's Effect Manager.
#----------------------------------------------------------------------------
# Started with a Iron Sword? Pretty good. Found a Gold Sword? Awesome! Found
# the complete Bronze Set? Bad stuff...
# Unless, they give you bonuses! In other words, this script allows you to create
# bonuses for wearing multiple items of a set... Just wanted to make it sound
# more fun...
#
# Instructions:
#
# Just as always, put this script between Бе Materials and Бе Main. Put this script
# below any script which rewrites change_equip and above any script which aliases
# 'param' in Game_Actor (usually in Game_BattlerBase, but it only matters if it
# is rewritten/aliased in Game_Actor).
#
# Set MAX_ELEMENTS below module EME and above Sets to the maximum number of
# elements in the database. Else, the script won't recognize any above the value.
#
#
# SETS
#
# To create sets (sorry, no names yet) go to Sets in the configuration part.
# Add the set id, followed by an array containing arrays. The latter arrays
# must be at least two elements long, one for the type of equipment, one for the
# id.
# Examples:
#
# 1 => [[0, 1], [1, 2]], <- The []'s define an array. The arrays like the [0,1]
# and [1, 2] should be at least two elements long (each element is separated by
# a comma.
#
# 2 => [[0, 5], [0, 6], [1, 5], [1,7]], <- If the array is not the last in the
# list, add a comma or you'll get an error. This goes for every array.
#
# set id => [[equipment type, equipment id], [equipment type, equipment id]]
#
# NOTE:
# The set id MUST be 0 or higher. The variable in which the sets are stored (which
# is called a hash) usually begins with 1 =>, so that's why that's also in the
# standard config.
# The Equipment Types are 0 (weapons) and 1 (armors.)
# DO NOT COPY the ID of items in the database. If you put all the useless 0's
# in front of the real ID, you'll get an error/the script won't work.
# Furthermore, you can have an infinite amount of equipment belonging (is that a
# word?) to a set, so don't worry about compatibility issues with Extra Equipment
# Slots scripts. Unless they rewrite change_equip, than there's a slight chance
# on problems. This can be fixed, however, by putting this script below any
# script which rewrites change_equip.
# Also, you can have multiple weapons in array and the same equipment in different
# sets.
#
#
# SET BONUSES
#
# For set bonuses, go to Set_Bonuses. Use the follwing syntax to add bonuses:
#
# set id => {
#    amount of pieces required => [[sort, parameter, bonus]]
#          },
#
# Specifications:
# set id = the same set id as in Sets.
#
# amount of pieces required = the amount of pieces the player must be wearing in
# order to receive the bonuses. If you want to skip one, just skip it. Like:
# 1 => blablabla
# 3 => blablabla
#
# sort = type of bonus. For all sorts, see SPECIAL VALUES.
#
# parameter = the parameter which receives the bonus. For all parameters, see
# SPECIAL VALUES.
#
# bonus = the bonus to be added to parameter. Note that this is a direct bonus,
# not a percentage. If the vale is negative, the bonus will become negative. If
# the value is 0, there will be no bonus to that stat.
#
#
# SPECIAL VALUES
# Sets
# ----
# Equipment types: 0 and 1. 0 is the Weapons tab in the database, 1 is the
# Armors tab in the database.
#
# Set_Bonuses
# ---
# Sorts:
# 0  - Standard Parameter
# 1  - Standard Parameter (Percentage)
# 2  - Extra Parameter
# 3  - Special Paramater
# 4  - Skills (WARNING, DIFFERENT SYNTAX!! See Skills on how to use them)
# 5  - Elemental Efficiency
# 6  - Debuff Rate
# 7  - State Rate
# 8  - State Resistance (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
# 9  - Attack Elements (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
# 10 - Attack States
# 11 - Equipment Types (WARNING, DIFFERENT SYNTAX!! See Equipment Types on how
#                      to use them)
# 12 - Attack Specials
# 13 - Additional Skill Types (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
# 14 - Sealed Skill Types (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
# 15 - Sealed Skills (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
# 16 - Fixed Equip Types (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
# 17 - Sealed Equip Types (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
# 18 - Special Flags (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
# 19 - Party Abilities (WARNING, VALUE HAS A DIFFERENT FUNCTION!!)
# 20 - Other Traits
#
# Standard Parameters: (Sort 0)
# 0 - MaxHp
# 1 - MaxMp
# 2 - Attack
# 3 - Defense
# 4 - Magic Attack (Spirit)
# 5 - Magic Defence (Resistance)
# 6 - Agility
# 7 - Luck
#
# Standard Parameters (Percentage): (Sort 1)
# 0 - MaxHp
# 1 - MaxMp
# 2 - Attack
# 3 - Defense
# 4 - Magic Attack (Spirit)
# 5 - Magic Defence (Resistance)
# 6 - Agility
# 7 - Luck
# Note that stats are calculated this way:
# Basic + Equipment Bonuses + Set Bonuses (normal) + Set Bonuses (percentages,
# equal to bonus% (in [1, parameter, bonus]) * basic + equipment bonuses)
#
# Extra Parameters: (Sort 2)
# 0 - Hit Rate
# 1 - Evasion
# 2 - Critical Rate
# 3 - Critical Evasion
# 4 - Magical Evasion
# 5 - Magical Reflection
# 6 - Counter Rate
# 7 - HP Regen
# 8 - MP Regen
# 9 - TP Regen
#
# Special Parameters: (Sort 3)
# 0 - Target Rate/ Accuracy Rate(in Eng Translation Patch)/ Aggro Rate
# 1 - Guard Effect Rate
# 2 - Recovery Effect Rate
# 3 - Pharmacology/ Knowledge in Medicine(in Eng Translation Patch)
# 4 - MP Cost Rate
# 5 - TP Charge Rate
# 6 - Physical Damage Rate
# 7 - Magical Damage Rate
# 8 - Floor Damage Rate
# 9 - Experience Rate
#
# Skills: (Sort 4)
# These skills don't have parameter values. Instead, the last two elements in
# their array have a different effect than usual:
# [sort (4), -----, skill_id]
# Sort = still the same and of course 4
# ----- = before this was Active, but that is no longer required. In order to
# by-pass the need to change this to skill_id (for people who had this script
# before v2.0), this variable has become unused instead of deleted all-together.
# You can put anything you want here, it doesn't even have to be an integer.
# Skill_Id = the id of the skill which the actor learns.
#
# Elemental Efficiency: (Sort 5)
# Values are the same as Element IDs in the database. (SO NO 0!!)
# If the bonus is negative, the actor becomes more resistant to the element.
# If the bonus is positive, the actor becomes weaker to the element.
#
# Debuff Rate: (Sort 6)
# 0 - MaxHp
# 1 - MaxMp
# 2 - Attack
# 3 - Defense
# 4 - Magic Attack (Spirit)
# 5 - Magic Defence (Resistance)
# 6 - Agility
# 7 - Luck
# If the bonus is negative, the actor becomes more resistant to debuffs regarding
# the set parameter.
# If the bonus is positive, the actor becomes weaker to debuffs regarding the set
# parameter.
#
# State Rate: (Sort 7)
# Values are the same as the State IDs in the database (SO NO 0!!)
# If the bonus is negative, the actor becomes more resistant to the state.
# If the bonus is positive, the actor becomes weaker to the state.
#
# State Resist: (Sort 8)
# Values are the same as the State IDs in the database (SO NO 0!!)
# If the bonus is positive, the actor becomes fully resistant to the set state.
# However, if the bonus is negative, the actor LOSES full resistance to the set
# state!
#
# Attack Elements: (Sort 9)
# Values are the same as the Element IDs in the database (SO NO 0!!)
# If the bonus is positive, the element is added to the attack elements.
# However, if the bonus is negative, the element is REMOVED from the attack
# elements!
#
# Attack States: (Sort 10)
# Values are the same as the State IDs in the database (SO NO 0!!)
# Bonus is the chance of the state to occur.
#
# Equipment Types: (Sort 11)
# 0 as parameter means that the bonus type is a Weapon Type.
# 1 as parameter means that the bonus type is a Weapon Type, but instead it will
# be REMOVED from the list of weapon types.
# 2 as parameter means that the bonus type is an Armor Type.
# 3 as parameter means that the bonus type is an Armor Type, but instead it will
# be REMOVED from the list of armor types.
# 4 as parameter allows Dual Wielding.
# Bonus is the same as the ID of the Equipment Types in the database.
# Note that removed types override added types. So you can first remove an
# equip type and afterwards add it, but you can first add it and then remove it.
#
# Attack Specials: (Sort 12)
# 0 - Attack Speed
# 1 - Additional Attacks
# Both in percentages. So for additional attacks, not 1 but 100.
#
# Additional Skill Types: (Sort 13)
# Values are the same as the Skill Types IDs in the database (SO NO 0!!)
# If the bonus is positive, the skill types is added.
# However, if the bonus is negative, the skill type is REMOVED!
#
# Sealed Skill Types: (Sort 14)
# Exact the same as above, only if the bonus is positive the type gets sealed,
# if the bonus is negative the type gets removed from the sealed types.
#
# Sealed Skills: (Sort 15)
# Again, exact the same as above. Only this time, replace the skill type id by
# the skill id.
#
# Fixed Equip Types: (Sort 16)
# Exact the same as Sealed Skill Types, only the equip types get fixed. Of course,
# replace skill type id by equip type id.
#
# Sealed Equip Types: (Sort 17)
# And yet again, exact the same only the equip types get sealed. Of course,
# replace skill type id by equip type id.
#
# Special Flags: (Sort 18)
# 0 - Auto Combat
# 1 - Guard
# 2 - Substitute/Cover
# 3 - Same TP in next battle
# For bonus, put a positive number (or 0) for added trait, and negative number
# for removed trait.
#
# Party Abilities: (Sort 19)
# 0 - Encounter cut down by half
# 1 - No encounters
# 2 - No suprise attacks
# 3 - Preemptive strike rate up
# 4 - Double currency from battles
# 5 - Double items from battles
# For bonus, put a positive number (or 0) for added trait, and negative number
# for removed trait.
#
# Others Traits: (Sort 20)
# 0 - Max TP up by bonus
# 1 - Atk Skill becomes bonus (skill ID) / So, if you have [20, 1, 10] the actor's
# attack skill becomes 10.
# 2 - Guard Skill becomes bonus (skill ID) / So, if you have [20, 2, 10] the
# actor's guard skill becomes 10,
#----------------------------------------------------------------------------
# Credits to:
# Lettuce, if it wasn't for his RMVX Item Sets script, I would not have learned
# how Arrays and Hashes work.
# Many members at www.rpgmakervxace.net for pointing out various bugs and whatnot.
# You for reading through the wall of text ^^ (at least... I hope you did that..)
#----------------------------------------------------------------------------
# If you have any issues with this script, contact me at
# http://www.rpgmakervxace.net/index.php?/topic/1092-ees-emeralds-equipment-sets/
#============================================================================
#
# CONFIGURATION
#
#============================================================================
# Ajout vincent 26
module Math
  #Détection de caractères dans un texte
  def self.get_charact(st,en,txt)
    return false unless txt
    id = txt.index(st)
    return false unless id
    id += st.length
    res = ""
    for i in id...txt.length
      break if txt[i...i+en.length] == en
      res += txt[i]
    end
    return res
  end
 
end
module EME
 
  MAX_ELEMENTS = 10
 
#----------------------------------------------------------------------------
# Sets syntax
#----------------------------------------------------------------------------
# Sets = {
#          set_id => "Name"
#        }
#
# In BDD add <Set_Equip = Name> to armor or weapon to configure them
#----------------------------------------------------------------------------
 
Sets = {
        1 => "Set du Guerrier légendaire",
        2 => "Set de la Lame éclair",
        3 => "Set du Loup blanc",
        4 => "Set Elémentaliste",
        5 => "Set du Mage suprême",
        6 => "Set Archange",
        7 => "Set Démon"
      }
 
#----------------------------------------------------------------------------
# Sets syntax
#----------------------------------------------------------------------------
# Set_Bonuses = {
#      set id => {
#        amount of pieces required => [[sort, parameter, bonus]], [sort, random parameter, 0]]
#                }
#                }
#
# set_id must correspond to set_id of Sets
# amount of pieces required indicates how many pieces of the set the actor must
# be wearing before receiving the bonus. If you want to skip one, make the only
# element in it's array [0, 0, 0].
# sort indicates which kind of parameters the bonuses change. See SPECIAL VALUES
# for all sorts.
# parameter can be a value depending on sort. See SPECIAL VALUES in the
# instructions for their corresponding stats.
# Bonus is a direct value added to 'parameter'. If 0, no bonus is added. If
# negative, bonus becomes negative.
# Random paramter is just a random parameter to prevent the last bonus from
# being doubled. Always make the bonus of this element 0.
#
# Add a comma after a ']' or '}' if it's not the last element in the array/hash.
#
# Don't forget to add a bonus of [0, 0, 0] at the end! Or else, the last bonus
# will be doubled!
#----------------------------------------------------------------------------
Set_Bonuses =
{
  1 => {
    1 => [[0, 0, 0]],
    2 => [[0, 3, 10]],
    3 => [[0, 5, 10]],
    4 => [[0, 2, 20]],
    5 => [[0, 3, 20]],
    6 => [[0, 1, 50]],
    7 => [[0, 2, 50]],
    8 => [[0, 0, 3000]]
      },
      
  2 => {
    1 => [[0, 0, 0]],
    2 => [[0, 6, 10]],
    3 => [[0, 2, 15]],
    4 => [[0, 6, 20]],
    5 => [[0, 6, 30]],
      },    
 
  3 => {
    1 => [[0, 0, 0]],
    2 => [[0, 2, 10]],
    3 => [[0, 6, 15]],
    4 => [[0, 2, 20]],
    5 => [[0, 2, 30]],
      },    
   
  4 => {
    1 => [[0, 0, 0]],
    2 => [[5, 3, -10]],
    3 => [[5, 4, -10]],
    4 => [[5, 5, -10]],
    5 => [[5, 6, -10]],
    6 => [[5, 7, -10]],
    7 => [[5, 8, -10]],
      },    
    
  5 => {
    1 => [[0, 0, 0]],
    2 => [[0, 4, 10]],
    3 => [[0, 5, 15]],
    4 => [[0, 7, 20]],
    5 => [[0, 4, 20]],
    6 => [[0, 5, 30]],
    7 => [[0, 7, 50]],
    8 => [[0, 1, 300]]
      },
 
  6 => {
    1 => [[0, 0, 0]],
    2 => [[0, 3, 10]],
    3 => [[0, 2, 10]],
    4 => [[0, 5, 10]],
    5 => [[0, 6, 10]],
    6 => [[0, 3, 30]],
    7 => [[0, 2, 30]],
    8 => [[0, 0, 1000]]
      },
   
  7 => {
    1 => [[0, 0, 0]],
    2 => [[0, 2, 10]],
    3 => [[0, 3, 10]],
    4 => [[0, 4, 10]],
    5 => [[0, 6, 10]],
    6 => [[0, 2, 30]],
    7 => [[0, 1, 150]],
    8 => [[0, 0, 1500]]
      },
}
 
#-----------------------------------------------------------------------------
# Sets syntax
#-----------------------------------------------------------------------------
# Set_Sounds = {
#  set_id => {
#    amount_of_pieces_required => [file_name, volume, pitch]
#  }
# }
#
# Resembles the other two parts so I think not much of an explanation is needed.
# When the required amount of pieces has been equipped, the sound sound will be
# played. Doesn't apply for unequipping. Again, watch the comma's!!
#----------------------------------------------------------------------------
Set_Sounds =
{
#  1 => {
#    1 => ["Slash4", 100, 100], # <- comma here since it isn't the last one!
#    2 => ["Slash4", 100, 100]  # <- no comma here since it IS the last one!
#      }
}
 
end
 
# Only edit things past here if you know what you're doing
 
$imported = {} if $imported.nil?
$imported["Emerald's Equipment Sets"] = true
 
#============================================================================
#
# Game_Actor
# Handles everything for this script.
#============================================================================
class Game_Actor < Game_Battler
 
  attr_reader :active_sets
  attr_reader :item_sets
 
  alias eme_ees_setup setup
  def setup(actor_id)
    @non_set_skills = []
    @skill_from_sets = false
    reset_bonuses
    @active_sets = []
    @item_sets = [0] * (EME::Sets.size + 1)
    eme_ees_setup(actor_id)
  end
 
  alias eme_init_equips init_equips
  def init_equips(equips)
    eme_init_equips(equips)
    equips.each_with_index{|item_id, i|
      etype_id = index_to_etype_id(i)
      slot_id = empty_slot(etype_id)
      EME::Sets.each do |key,value|
        if item_id != nil and slot_id != nil and ees_is_the_set_item?(etype_id == 0 ? $data_weapons[item_id] : $data_armors[item_id], value)
          @item_sets[key] += 1
          @active_sets.push(key) unless @active_sets.include?(key)
        end
      end
    }
    refresh
  end
 
  def ees_is_the_set_item?(item, ees_set_equip)
    return unless item
    if Math.get_charact("<Set_Equip = ",">",item.note)
      name = Math.get_charact("<Set_Equip = ",">",item.note)
      return ees_set_equip == name
    else
      return false
    end
  end
 
  alias eme_ees_learn_skill learn_skill
  def learn_skill(skill_id)
    eme_ees_learn_skill(skill_id)
    @non_set_skills.push(skill_id) unless @skill_from_sets
    @skill_from_sets = false
  end
 
  alias eme_ebs_change_equip change_equip
  def change_equip(slot_id, item)
    EME::Sets.each do |set_id,ees_set_equip|
      if slot_id != nil and @equips[slot_id] != nil and @equips[slot_id].object != nil
        if ees_is_the_set_item?(@equips[slot_id].object, ees_set_equip)
          @item_sets[set_id] -= 1
          @active_sets.delete(set_id) if @item_sets[set_id] == 0
        end
      end
      if item != nil and ees_is_the_set_item?(item, ees_set_equip)
        @item_sets[set_id] += 1
        @active_sets.push(set_id) unless @active_sets.include?(set_id)
        if EME::Set_Sounds.has_key?(set_id) and EME::Set_Sounds[set_id].has_key?(set_amount_wearing(set_id))
          sound = EME::Set_Sounds[set_id][set_amount_wearing(set_id)]
          Audio.se_play("Audio/SE/" + sound[0], sound[1], sound[2])
        end
      end
    end
    set_check
    eme_ebs_change_equip(slot_id, item)
  end
 
  def unlearn_set_skills(set_id)
    EME::Set_Bonuses[set_id].each_value{|bonus_array|
      bonus_array.each{|bonus|
        if bonus[0] == 4
          forget_skill(bonus[2]) unless @non_set_skills.include?(bonus[2])
          @ees_skills.delete(bonus[2])
        end
      }
    }
  end
 
  def item_set_reset_all
    @active_sets.each{|set_id| item_set_reset(set_id)}
  end
 
  def item_set_reset(set_id)
    return unless set_id > 0 and @item_sets[set_id] > 0
    unlearn_set_skills(set_id)
  end
 
  def release_unequippable_items(item_gain = true)
    @equips.each_with_index do |item, i|
      if !equippable?(item.object) || item.object.etype_id != equip_slots[i]
        trade_item_with_party(nil, item.object) if item_gain
        item.object = nil
      end
    end
  end
 
  def release_unequippable_items(item_gain = true)
    loop do
      change_equips = 0
      @equips.each_with_index do |item, i|
        if !equippable?(item.object) or item.object.etype_id != equip_slots[i]
          next if (RPG::Weapon.method_defined?(:two_handed?) and dual_wield? and (equip_slots[i] == 1 and item.object.etype_id == 0))
          trade_item_with_party(nil, item.object) if item_gain
          change_equips += 1 unless item.object.nil?
          unless item.object.nil?
          EME::Sets.each do |set_id,ees_set_equip|
            if ees_is_the_set_item?(item.object, ees_set_equip)
              @item_sets[set_id] -= 1
              @active_sets.delete(set_id) if @item_sets[set_id] == 0
            end
          end
          end
          item.object = nil
        end
      end
      set_check
      break if change_equips == 0
    end
  end
 
  alias eme_ebs_discard_equip discard_equip
  def discard_equip(item)
    slot_id = equips.index(item)
    if slot_id != nil
      EME::Sets.each do |set_id,ees_set_equip|
        if ees_is_the_set_item?(item, ees_set_equip)
          @item_sets[set_id] -= 1
          @active_sets.delete(set_id) if @item_sets[set_id] == 0
        end
      end
    end
    eme_ebs_discard_equip(item)
    refresh
  end
 
  def set_amount_wearing(set_id)
    return @item_sets[set_id]
  end
 
  def set_check
    item_set_reset_all
    reset_bonuses
    @active_sets.each{|set| change_bonuses(set) unless set == nil}
  end
 
  def change_bonuses(set_id)
    return if set_id == 0 or set_amount_wearing(set_id) == 0
    EME::Set_Bonuses[set_id].each_key{|key|
      if set_amount_wearing(set_id) >= key
        for g in 0...EME::Set_Bonuses[set_id][key].size
          sort = EME::Set_Bonuses[set_id][key][g][0]
          stat = EME::Set_Bonuses[set_id][key][g][1]
          stat_bonus = EME::Set_Bonuses[set_id][key][g][2]
          case EME::Set_Bonuses[set_id][key][g][0]
          when 0
            sets_param_change(stat, stat_bonus)
          when 1
            sets_per_param_change(stat, stat_bonus)
          when 2
            sets_xparam_change(stat, stat_bonus)
          when 3
            sets_sparam_change(stat, stat_bonus)
          when 4
            next if skill_learn?(stat_bonus)
            @skill_from_sets = true
            learn_skill(stat_bonus)
            @ees_skills.push(stat_bonus)
          when 5
            stat -= 1
            sets_element_rate_change(stat, stat_bonus)
          when 6
            stat -= 1
            sets_debuff_rate_change(stat, stat_bonus)
          when 7
            stat -= 1
            sets_state_rate_change(stat, stat_bonus)
          when 8
            sets_state_resist_change(stat, stat_bonus)
          when 9
            sets_atk_elements_change(stat, stat_bonus)
          when 10
            sets_atk_states_change(stat) if stat_bonus > 0
            sets_atk_states_rate_change(stat, stat_bonus)
          when 11
            if stat < 2
              change_sets_additional_wtypes(stat_bonus, (stat == 0 ? true : false))
            elsif stat < 4
              change_sets_additional_atypes(stat_bonus, (stat == 2))
            elsif stat == 4
              @eme_ebs_two_swords_style = true
            end
          when 12
            sets_atk_specials_change(stat, stat_bonus)
          when 13
            add_sets_skill_types(stat, stat_bonus)
          when 14
            add_sets_sealed_skill_types(stat, stat_bonus)
          when 15
            add_sets_sealed_skills(stat, stat_bonus)
          when 16
            add_sets_fixed_equip_types(stat, stat_bonus)
          when 17
            add_sets_sealed_equip_types(stat, stat_bonus)
          when 18
            stat_bonus < 0 ? change_special_flags(stat, true) : change_special_flags(stat)
          when 19
            stat_bonus < 0 ? change_party_abilities(stat, true) : change_party_abilities(stat)
          when 20
            case stat
            when 0
              set_bonus_max_tp(stat_bonus)
            when 1
              set_atk_skill(stat_bonus)
            when 2
              set_grd_skill(stat_bonus)
            end
          end
        end
      end
    }
  end
 
#-------------------------------------------#
# LABEL FOR AUTHOR                          #
# Don't mind this ;)                        #
#-------------------------------------------#
 
  def reset_bonuses
    @sets_param_plus = [0] * 8
    @sets_per_param_plus = [0] * 8
    @sets_xparam_plus = [0] * 10
    @sets_sparam_plus = [0] * 10
    @sets_element_rate = [0] * (EME::MAX_ELEMENTS)
    @sets_debuff_rate = [0] * 8
    @sets_state_rate = [0] * ($data_states.size + 1)
    @sets_state_resist = []
    @sets_state_resist_remove = []
    @sets_atk_elements = []
    @sets_atk_elements_remove = []
    @sets_atk_states = []
    @sets_atk_states_rate = [0] * $data_states.size
    @sets_atk_speed_plus = 0
    @sets_atk_times_plus = 0
    @sets_skill_types = []
    @sets_skill_types_remove = []
    @sets_sealed_skill_types = []
    @sets_sealed_skill_types_remove = []
    @sets_sealed_skills = []
    @sets_sealed_skills_remove = []
    @sets_fixed_equip_types = []
    @sets_fixed_equip_types_remove = []
    @sets_sealed_equip_types = []
    @sets_sealed_equip_types_remove = []
   
    @ees_added_special_flags = []
    @ees_removed_special_flags = []
    @ees_added_party_abilities = []
    @ees_removed_party_abilities = []
    @ees_bonus_max_tp = 0
    @new_atk_skill = nil
    @new_grd_skill = nil
   
    @ees_skills = []
    @sets_wtypes = []
    @sets_atypes = []
    @sets_removed_wtypes = []
    @sets_removed_atypes = []
    @eme_ebs_two_swords_style = false
  end
 
  def sets_param_plus(param_id)
    @sets_param_plus[param_id]
  end
 
  def sets_param_change(param_id, value)
    @sets_param_plus[param_id] += value
  end
 
  def sets_per_param_plus(param_id)
    value = param_base(param_id) + param_plus(param_id)
    value *= @sets_per_param_plus[param_id] / 100
    return value
  end
 
  def sets_per_param_change(param_id, value)
    @sets_per_param_plus[param_id] += value
  end
 
  def sets_xparam_plus(param_id)
    @sets_xparam_plus[param_id]
  end
 
  def sets_xparam_change(param_id, value)
    @sets_xparam_plus[param_id] += value
  end
 
  def sets_sparam_plus(param_id)
    @sets_sparam_plus[param_id]
  end
 
  def sets_sparam_change(param_id, value)
    @sets_sparam_plus[param_id] += value
  end
 
  def sets_element_rate(element_id)
    @sets_element_rate[element_id-1]
  end
 
  def sets_element_rate_change(element_id, value)
    @sets_element_rate[element_id] += value
  end
 
  def sets_debuff_rate(param_id)
    @sets_debuff_rate[param_id]
  end
 
  def sets_debuff_rate_change(param_id, value)
    @sets_debuff_rate[param_id] += value
  end
 
  def sets_state_rate(state_id)
    @sets_state_rate[state_id]
  end
 
  def sets_state_rate_change(state_id, value)
    @sets_state_rate[state_id] += value
  end
 
  def sets_state_resist(state_id)
    @sets_state_resist[state_id]
  end
 
  def sets_state_resist_remove(state_id)
    @sets_state_resist_remove[state_id]
  end
 
  def sets_state_resist_change(state_id, value)
    value >= 0 ? (@sets_state_resist.push(state_id) unless @sets_state_resist.include?(state_id)) : (@sets_state_resist_remove.delete(state_id) unless @sets_state_resist_remove.include?(state_id))
  end
 
  def sets_atk_elements(element_id)
    @sets_atk_elements[element_id]
  end
 
  def sets_atk_elements_remove(element_id)
    @sets_atk_elements_remove[element_id]
  end
 
  def sets_atk_elements_change(element_id, value)
    value >= 0 ? (@sets_atk_elements.push(element_id) unless @sets_atk_elements.include?(element_id)) : (@sets_attack_elements_remove.delete(element_id) unless @sets_atk_elements_remove.include?(element_id))
  end
 
  def sets_atk_states(state_id)
    @sets_atk_states[state_id]
  end
 
  def sets_atk_states_change(state_id)
    @sets_atk_states.push(state_id) unless @sets_atk_states.include?(state_id)
  end
 
  def sets_atk_states_rate(state_id)
    @sets_atk_states_rate[state_id]
  end
 
  def sets_atk_states_rate_change(state_id, value)
    @sets_atk_states_rate[state_id] += value
  end
 
  def sets_atk_speed_plus
    @sets_atk_speed_plus
  end
 
  def sets_atk_times_plus
    @sets_atk_times_plus
  end
 
  def sets_atk_specials_change(parameter, value)
    parameter == 0 ? @sets_atk_speed_plus += value : @sets_atk_times_plus += value
  end
   
  def sets_skill_types(skill_type_id)
    @sets_skill_types[skill_type_id]
  end
 
  def sets_skill_types_remove(skill_type_id)
    @sets_skill_types_remove[skill_type_id]
  end
 
  def add_sets_skill_types(skill_type_id, value)
    value >= 0 ? (@sets_skill_types.push(skill_type_id) unless @sets_skill_types.include?(skill_type_id)) : (@sets_skill_types_remove.delete(skill_type_id) unless @sets_skill_types_remove.include?(skill_type_id))
  end
 
  def sets_sealed_skill_types(skill_type_id)
    @sets_sealed_skill_types[skill_type_id]
  end
 
  def sets_sealed_skill_types_remove(skill_type_id)
    @sets_sealed_skill_types_remove[skill_type_id]
  end
 
  def add_sealed_skill_types(skill_type_id, value)
    value >= 0 ? (@sets_sealed_skill_types.push(skill_type_id) unless @sets_sealed_skill_types.include?(skill_type_id)) : (@sets_sealed_skill_types_remove.delete(skill_type_id) unless @sets_sealed_skill_types_remove.include?(skill_type_id))
  end
 
  def sets_sealed_skills(skill_id)
    @sets_sealed_skills[skill_id]
  end
 
  def sets_sealed_skills_remove(skill_id)
    @sets_sealed_skills_remove[skill_id]
  end
 
  def add_sets_sealed_skills(skill_id, value)
    value > 0 ? (@sets_sealed_skills.push(skill_id) unless @sets_sealed_skills.include?(skill_id)) : (@sets_attack_elements_remove.delete(skill_id) unless @sets_sealed_skills_remove.include?(skill_id))
  end
 
  def sets_additional_wtypes
    @sets_wtypes
  end
 
  def sets_additional_atypes
    @sets_atypes
  end
 
  def sets_removed_wtypes
    @sets_removed_wtypes
  end
 
  def sets_removed_atypes
    @sets_removed_atypes
  end
 
  def change_sets_additional_wtypes(wtype_id, positive_change = true)
    positive_change ? @sets_wtypes.push(wtype_id) : @sets_removed_wtypes.push(wtype_id)
  end
 
  def change_sets_additional_atypes(atype_id, positive_change = true)
    positive_change ? @sets_atypes.push(atype_id) : @sets_removed_atypes.push(atype_id)
  end
 
  def sets_fixed_equip_types(equip_type_id)
    @sets_fixed_equip_types[equip_type_id]
  end
 
  def sets_fixed_equip_types_remove(equip_type_id)
    @sets_fixed_equip_types_remove[equip_type_id]
  end
 
  def add_fixed_equip_types(equip_type_id, value)
    value >= 0 ? @sets_fixed_equip_types.push(equip_type_id) : @sets_fixed_equip_types_remove.delete(sequip_type_id)
  end
 
  def sets_sealed_equip_types(equip_type_id)
    @sets_sealed_equip_types[equip_type_id]
  end
 
  def sets_sealed_equip_types_remove(equip_type_id)
    @sets_sealed_equip_types_remove[equip_type_id]
  end
 
  def add_sealed_equip_types(equip_type_id, value)
    value > 0 ? (@sets_sealed_equip_types.push(equip_type_id) unless @sets_sealed_equip_types.include?(equip_type_id)) : (@sets_sealed_equip_types_remove.delete(equip_type_id) unless @sets_sealed_equip_types_remove.include?(equip_type_id))
  end
 
  def change_special_flags(flag_id, negative = false)
    !negative ? @ees_added_special_flags.push(flag_id) : @ees_removed_special_flags.push(flag_id)
  end
 
  def change_party_abilities(ability_id, negative = false)
    !negative ? @ees_added_party_abilities.push(ability_id) : @ees_removed_party_abilities.push(ability_id)
  end
 
  def set_bonus_max_tp(value)
    @ees_bonus_max_tp += value
  end
 
  def set_atk_skill(skill_id)
    @new_atk_skill = skill_id
  end
 
  def set_grd_skill(skill_id)
    @new_grd_skill = skill_id
  end
 
#-------------------------------------------#
# 'NOTHER LABEL FOR AUTHOR                  #
# Don't mind this ;)                        #
#-------------------------------------------#
 
  def param(param_id)
    value = param_base(param_id) + param_plus(param_id) + sets_param_plus(param_id) #+ [sets_per_param_plus(param_id), 0].max
    value *= param_rate(param_id) * param_buff_rate(param_id)
    [[value, param_max(param_id)].min, param_min(param_id)].max.to_i
  end
 
  alias eme_ebs_xparam xparam
  def xparam(xparam_id)
    value = eme_ebs_xparam(xparam_id) + sets_xparam_plus(xparam_id) / 100
    return value
  end
 
  alias eme_ebs_sparam sparam
  def sparam(sparam_id)
    value = eme_ebs_sparam(sparam_id) + sets_sparam_plus(sparam_id) / 100
    return value
  end
 
  alias eme_ebs_element_rate element_rate
  def element_rate(element_id)
    value = eme_ebs_element_rate(element_id) + sets_element_rate(element_id) / 100.0
    return value
  end
 
  alias eme_ebs_debuff_rate debuff_rate
  def debuff_rate(param_id)
    value = eme_ebs_debuff_rate(param_id) + sets_debuff_rate(param_id) / 100
    return value
  end
 
  alias eme_ebs_state_rate state_rate
  def state_rate(state_id)
    value = eme_ebs_state_rate(state_id) + sets_state_rate(state_id) / 100
    return value
  end
 
  alias eme_ebs_state_resist_set state_resist_set
  def state_resist_set
    value = eme_ebs_state_resist_set
    @sets_state_resist.each{|state| value.push(state) unless value.include?(element)}
    @sets_state_resist_remove.each{|state| value.delete(state)}
    return value
  end
 
  alias eme_ebs_atk_elements atk_elements
  def atk_elements
    value = eme_ebs_atk_elements
    @sets_atk_elements.each{|element| value.push(element) unless value.include?(element)}
    @sets_atk_elements_remove.each{|element| value.delete(element)}
    return value
  end
 
  alias eme_ebs_atk_states atk_states
  def atk_states
    value = eme_ebs_atk_states
    @sets_atk_states.each{|state| value.push(@sets_atk_states[i]) }
    return value
  end
 
  alias eme_ebs_atk_states_rate atk_states_rate
  def atk_states_rate(state_id)
    value = eme_ebs_atk_states_rate(state_id) + sets_atk_states_rate(state_id) / 100
    return value
  end
 
  alias eme_ebs_atk_speed atk_speed
  def atk_speed
    value = eme_ebs_atk_speed + sets_atk_speed_plus / 100
    return value
  end
 
  alias eme_ebs_atk_times atk_times_add
  def atk_times_add
    value = [eme_ebs_atk_times + sets_atk_times_plus / 100, 0].max
    return value
  end
 
  alias eme_ebs_dual_wield? dual_wield?
  def dual_wield?
    return true if @eme_ebs_two_swords_style
    eme_ebs_dual_wield?
  end
 
  alias eme_ebs_added_skill_types added_skill_types
  def added_skill_types
    value = eme_ebs_added_skill_types
    @sets_skill_types.each{|sk_type| value.push(sk_type)}
    @sets_skill_types_remove.each{|sk_type| value.delete(sk_type)}
    return value
  end
 
  def skill_type_sealed?(stype_id)
    value = features_set(FEATURE_STYPE_SEAL)
    @sets_sealed_skill_types.each{|sk_type| value.push(sk_type)}
    @sets_sealed_skill_types_remove.each{|sk_type| value.delete(sk_type)}
    return true if value.include?(stype_id)
  end
 
  def skill_sealed?(skill_id)
    value = features_set(FEATURE_SKILL_SEAL)
    @sets_sealed_skills.each{|skill| value.push(skill)}
    @sets_sealed_skills_remove.each{|skill| value.delete(skill)}
    return true if value.include?(skill_id)
  end
 
  def equip_wtype_ok?(wtype_id)
    value = features_set(FEATURE_EQUIP_WTYPE)
    @sets_wtypes.each{|w_type| value.push(w_type)}
    @sets_removed_wtypes.each{|w_type| value.delete(w_type)}
    return true if value.include?(wtype_id)
  end
 
  def equip_atype_ok?(atype_id)
    value = features_set(FEATURE_EQUIP_ATYPE)
    @sets_atypes.each{|a_type| value.push(a_type)}
    @sets_removed_atypes.each{|a_type| value.delete(a_type)}
    return true if value.include?(atype_id)
  end
 
  def equip_type_fixed?(etype_id)
    value = features_set(FEATURE_EQUIP_FIX)
    @sets_fixed_equip_types.each{|e_type| value.push(e_type)}
    @sets_fixed_equip_types_remove.each{|e_type| value.delete(e_type)}
    return true if value.include?(etype_id)
  end
 
  def equip_type_sealed?(etype_id)
    value = features_set(FEATURE_EQUIP_SEAL)
    @sets_sealed_equip_types.each{|e_type| value.push(e_type)}
    @sets_sealed_equip_types_remove.each{|e_type| value.delete(e_type)}
    return true if value.include?(etype_id)
  end
 
  alias eme_ees_special_flag special_flag
  def special_flag(flag_id)
    return false if @ees_removed_special_flags.include?(flag_id)
    return @ees_added_special_flags.include?(flag_id) ? true : eme_ees_special_flag(flag_id)
  end
 
  alias eme_ees_party_ability party_ability
  def party_ability(ability_id)
    return false if @ees_removed_party_abilities.include?(ability_id)
    return @ees_added_party_abilities.include?(ability_id) ? true : eme_ees_party_ability(ability_id)
  end
 
  alias eme_ees_max_tp max_tp
  def max_tp
    return eme_ees_max_tp + @ees_bonus_max_tp
  end
 
  alias eme_ees_attack_skill attack_skill_id
  def attack_skill_id
    return @new_atk_skill unless @new_atk_skill == nil
    return eme_ees_attack_skill
  end
 
  alias eme_ees_guard_skill guard_skill_id
  def guard_skill_id
    return @new_grd_skill unless @new_grd_skill == nil
    return eme_ees_guard_skill
  end
 
end



Posté dans Forum - [RPG Maker VX Ace] Ajustement fenêtre

Nérylis - posté le 25/02/2016 à 18:03:37. (149 messages postés)

La personne en question ne m'a pas fait la modification pour le script du topic. Je veux bien, si tu as du temps, que tu essaies de la faire. En même temps, ça te permettra de voir si tu arrives à reprendre l'idée pour créer l'interface de façon propre.

Sur le script que je te remets ci-dessous, j'ai retiré la partie qui permettait de visualiser l'interface depuis le menu Objets pour les raisons évoquées précédemment. Donc, du coup, il n'y a que à partir du menu Equipement qu'on a accès à cette interface lorsqu'on change d'équipement en appuyant sur la touche Ctrl. Les points à corriger :
- Création du menu déroulant lorsque la liste des pré-requis est longue au point de sortir de la fenêtre.
- Enlever la transition dûe au self.openness pour avoir quelque chose d'instantané.

Portion de code : Tout sélectionner

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
=begin
Equipment Requirements
by Fomar0153
modified by Zouzaka
Version 1.3
----------------------
Notes
----------------------
Adds a level requirement to equipment.
----------------------
Instructions
----------------------
Notetag the weapons/armors like so:
<levelreq x>
<mhpreq x>
<mmpreq x>
<atkreq x>
<defreq x>
<matreq x>
<mdfreq x>
<agireq x>
<lukreq x>
<switchreq x>
<variablereq x,y>
<wepreq x>
<armreq x>
----------------------
Change Log
----------------------
1.0 -> 1.1 Added stat requirements
          Changed script name from Equipment Level Requirements
          to just Equipment Requirements
1.1 -> 1.2 Added switch and other equipment requirements
1.2 -> 1.3 Ajout D'une Window qui affiche les Conditions requises
          Réduit le script de base de plus de 50 lignes
1.3 -> 1.4 Optimisation et resolution de bug
----------------------
Known bugs
----------------------
None
=end
  #--------------------------------------------------------------------------
  # ● If set to true then it compares the requirement with the actor's base 
  #  stat rather than their current.
  #--------------------------------------------------------------------------
EQUIPREQ_USE_BASE_STAT = true
  #--------------------------------------------------------------------------
  # ● Vocab for switch's 
  #  every switch_id in a different line
  #--------------------------------------------------------------------------
 
Switch_Vocab = {
# Switch_ID => "Vocab",
#2 => "Visiter la Campagne",
}
  #--------------------------------------------------------------------------
  # ● Vocab for variables 
  #  every variable_id in a different line
  #--------------------------------------------------------------------------
 
Variable_Vocab = {
# Variable_ID => "Vocab",
#2 => "Nombre de pierres à casser",
}
 
 
class Game_Actor
  def optimize_equipments
    clear_equipments
    equip_slots.size.times do |i|
      next if !equip_change_ok?(i)
      items = $game_party.equip_items.select do |item|
        item.etype_id == equip_slots[i] &&
        equippable?(item) && item.performance >= 0 && reqstate?(item)
      end
      change_equip(i, items.max_by {|item| item.performance })
    end
  end
  def reqstate?(item)
    unless item == nil
      return false if level < item.levelreq
      return false if reqstat(0) < item.mhpreq
      return false if reqstat(1) < item.mmpreq
      return false if reqstat(2) < item.atkreq
      return false if reqstat(3) < item.defreq
      return false if reqstat(4) < item.matreq
      return false if reqstat(5) < item.mdfreq
      return false if reqstat(6) < item.agireq
      return false if reqstat(7) < item.lukreq
      if item.switchreq > 0
        return false unless $game_switches[item.switchreq]
      end
      if item.variablereq != 0
        return false unless $game_variables[item.variablereq[0]] < item.variablereq[1]
      end
      if item.wepreq > 0
        e = []
        for equip in equips
          e.push(equip.id) if equip.class == RPG::Weapon
        end
        return false unless e.include?(item.wepreq)
      end
      if item.armreq > 0
        e = []
        for equip in equips
          e.push(equip.id) if equip.class == RPG::Armor
        end
        return false unless e.include?(item.armreq)
      end
    end
    return true
  end
  #--------------------------------------------------------------------------
  # ● New Method
  #--------------------------------------------------------------------------
  def reqstat(id)
    EQUIPREQ_USE_BASE_STAT ? param_base(id) : param(id)
  end
end
class Window_EquipItem
  #--------------------------------------------------------------------------
  # ● Check the requirements
  #--------------------------------------------------------------------------
  def enable?(item)
    return @actor.reqstate?(item)
  end
end
module RPG
  #--------------------------------------------------------------------------
  # ● Equip Item is inherited by both Weapon and Armor
  #--------------------------------------------------------------------------
  class EquipItem
    def variablereq
      self.note =~ /<variablereq (.*),(.*)>/i ? [$1.to_i,$2.to_i] : 0
    end
    def levelreq
      self.note =~ /<levelreq (.*)>/i ? $1.to_i : 0
    end
    def mhpreq
      self.note =~ /<mhpreq (.*)>/i ? $1.to_i : 0
    end
    def mmpreq
      self.note =~ /<mmpreq (.*)>/i ? $1.to_i : 0
    end
    def atkreq
      self.note =~ /<atkreq (.*)>/i ? $1.to_i : 0
    end
    def defreq
      self.note =~ /<defreq (.*)>/i ? $1.to_i : 0
    end
    def matreq
      self.note =~ /<matreq (.*)>/i ? $1.to_i : 0
    end
    def mdfreq
      self.note =~ /<mdfreq (.*)>/i ? $1.to_i : 0
    end
    def agireq
      self.note =~ /<agireq (.*)>/i ? $1.to_i : 0
    end
    def lukreq
      self.note =~ /<lukreq (.*)>/i ? $1.to_i : 0
    end
    def switchreq
      self.note =~ /<switchreq (.*)>/i ? $1.to_i : 0
    end
    def wepreq
      self.note =~ /<wepreq (.*)>/i ? $1.to_i : 0
    end
    def armreq
      self.note =~ /<armreq (.*)>/i ? $1.to_i : 0
    end
  end
end
class Window_Requirement < Window_Base
  def initialize(x, y)
    super(x, y, window_width, window_height)#(x, y, Graphics.width/2, Graphics.height)
    self.openness = 0
    self.z = 250
    @item = nil
    @actor = nil
    refresh
  end
  def window_width
    return 326
  end
  def window_height
    return 224
  end
  def reqstat(id)
    EQUIPREQ_USE_BASE_STAT ? @actor.param_base(id) : @actor.param(id)
  end
  def item ; return @item ; end
  def item=(item)
    @item = item
    refresh
  end
  def actor ; return @actor ; end
  def actor=(actor)
    @actor = actor
    refresh
  end
  def update
    super
      refresh
  end
  def refresh
    contents.clear
    @req = ["item.levelreq","item.mhpreq","item.mmpreq","item.atkreq","item.defreq","item.matreq","item.mdfreq","item.agireq","item.lukreq"]#,"item.wepreq","item.armreq"]
    @vocab_req = [Vocab.level,Vocab.param(0),Vocab.param(1),Vocab.param(2),Vocab.param(3),Vocab.param(4),Vocab.param(5),Vocab.param(6),Vocab.param(7)]#,Vocab.weapon,Vocab.armor]
    @req_condition = ["@actor.level","reqstat(0)","reqstat(1)","reqstat(2)","reqstat(3)","reqstat(4)","reqstat(5)","reqstat(6)","reqstat(7)"]
    @t = 2
    change_color(normal_color)
    draw_text(contents.width/6, 0, contents.width, line_height, "Conditions requises")
    @req.each do |req|
      if item != nil && eval(req) != 0 && actor != nil
        eval(@req_condition[@req.index(req)]) < eval(req) ? change_color(text_color(2)) : change_color(normal_color)
        draw_text(0, line_height*@t, contents.width, line_height, @vocab_req[@req.index(req)]+" requis : "+eval(req).to_s)
        @t += 1
      end
    end
    change_color(normal_color)
    if item != nil && item.wepreq != 0 && actor != nil
      e = []
      for equip in @actor.equips 
        if equip.class == RPG::Weapon
          e.push(equip.id)
        end
      end
      change_color(text_color(2)) unless e.include?(item.wepreq)
      draw_text(0, line_height*@t, contents.width, line_height, "Arme requise : "+$data_weapons[item.wepreq].name)
      @t += 1
    end
    change_color(normal_color)
    if item != nil && item.armreq != 0 && actor != nil
      e = []
      for equip in @actor.equips
        e.push(equip.id) if equip.class == RPG::Armor
      end
      change_color(text_color(2)) unless e.include?(item.armreq)
      draw_text(0, line_height*(@t), contents.width, line_height, "Armure requise : "+$data_armors[item.armreq].name)
      @t += 1
    end
    if item && item.switchreq != 0
      $game_switches[item.switchreq] ? change_color(normal_color) : change_color(text_color(2))
      draw_text(0, line_height*(@t), contents.width, line_height, Switch_Vocab[item.switchreq])
      @t += 1
    end
    if item && item.variablereq != 0
      $game_variables[item.variablereq[0]] >= item.variablereq[1] ? change_color(normal_color) : change_color(text_color(2))
      draw_text(0, line_height*(@t), contents.width, line_height, Variable_Vocab[item.variablereq[0]]+" "+$game_variables[item.variablereq[0]].to_s+"/"+item.variablereq[1].to_s)
    end
  end
end
 
#~ #==============================================================================
#~ # ** Scene_Equip
#~ #------------------------------------------------------------------------------
#~ #  This class performs the equipment screen processing.
#~ #==============================================================================
 
class Scene_Equip
  alias :old_start :start
  def start
    old_start
    @window_req = Window_Requirement.new(0,192)#(Graphics.width/4,0)
  end
  alias :old_update :update
  def update
    old_update
    if Input.trigger?(:CTRL)
      if @window_req.openness == 0 && @item_window.active && @item_window.item != nil
        Sound.play_cursor
        @window_req.item=@item_window.item
        @window_req.actor= @actor
        @background = Sprite.new
        @background.z = 200
        @background.bitmap = Bitmap.new(Graphics.width, Graphics.height)
       # @background.bitmap.fill_rect(0,0,Graphics.width,Graphics.height,Color.new(0, 0, 0,128))
        @window_req.open
        @item_window.deactivate
        @item_window.visible = false
      elsif @window_req.openness == 255
        Sound.play_cancel
        @background.dispose if @background
        @window_req.close
        @item_window.activate
        @item_window.visible = true
      end
    elsif Input.trigger?(:B)
      if @window_req.openness == 255
        Sound.play_cancel
        @background.dispose if @background
        @window_req.close
        @item_window.activate
        @item_window.visible = true
      end
    end
  end
end



Posté dans Forum - [RPG Maker VX Ace] Ajustement fenêtre

Nérylis - posté le 24/02/2016 à 18:06:04. (149 messages postés)

Je te mets le script concerné ci-dessous. Si tu veux essayer le même principe pour voir si tu arrives à un résultat similaire sur le script de ce topic, tu peux mais la personne doit me faire la modif aujourd'hui.

Portion de code : Tout sélectionner

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
#Modif class Scene_Equip
class Scene_Equip < Scene_MenuBase
  
  #Modification de l'update
  alias update_interface update
  def update
    update_interface
    if Input.trigger?(:SHIFT)
      return if !@item_window.active && !@slot_window.active && @status_window.menu == 0
      if @item_window.item != nil && !@slot_window.active && @item_window.visible
        if @status_window.menu == 0
          Sound.play_cursor
        else
          Sound.play_cancel
        end
        switch_info
      end
      if @slot_window.visible && @slot_window.item != nil
        if @status_window.menu == 0
          Sound.play_cursor
        else
          Sound.play_cancel
        end
        switch_info
      end
    elsif Input.trigger?(:UP) && @status_window.menu == 1
      @status_window.upStat
      #@status_window.refresh(@status_window.item_actuel)
    elsif Input.trigger?(:DOWN) && @status_window.menu == 1
      @status_window.downStat
      #@status_window.refresh(@status_window.item_actuel)
    elsif Input.trigger?(:B) && @status_window.menu == 1
      Sound.play_cancel
      switch_info
    end
  end
  
  #Switch vers le menu info
  def switch_info
    if @status_window.menu == 1
      @status_window.menu = 0
      @status_window.ligne_actuel = 0
      @item_window.activate if @item_window.visible
      @slot_window.activate if @slot_window.visible
      item = nil
    else
      @status_window.menu = 1
      if @item_window.visible
        @item_window.deactivate
        item = @item_window.item
      elsif @slot_window.visible
        @slot_window.deactivate
        item = @actor.equips[@slot_window.index]
      end
    end
    @status_window.recreate_contents(item)
  end
  
end
#Modif Window_EquipStatus
class Window_EquipStatus < Window_Base
  
  attr_accessor :menu #Ajout de la variable menu
  attr_reader :ligne_actuel #Ajout de la variable ligne actuel
  
  #Modification Initialisation
  alias initialize_interface initialize
  def initialize(*args)
    @menu = 0
    @ligne_actuel = 0
    initialize_interface(*args)
  end
  
  #Modification de la ligne actuel
  def ligne_actuel=(value)
    @ligne_actuel = [0,[value,@max_ligne-8].min].max
  end
  
  def recreate_contents(item)
    self.oy = 0
    if @menu == 0
      self.padding = 12
      create_contents
    else
      self.padding = 16
    end
    refresh(item)
  end
  
  #Modifiication du refresh
  alias refresh_interface refresh
  def refresh(item = nil)
    if @menu == 0
      refresh_interface
    else
      draw_interface(item)
    end
  end
  
  #Récuperation de l'item_actuel
  def item_actuel
    return @item
  end
  
  #Creation de la fenetre d'info
  def draw_interface(item)
    if item == nil
      create_contents
      draw_text_ex(0, 0, "")
      @max_ligne = 0
      @item = nil
    else
      # compter le nombre de ligne afin de créer le contennts de bonne taille
      @max_ligne = 6
      for i in 0..7
        if item.instance_mult_lvl_bonus(i) != 1 || item.instance_static_lvl_bonus(i) != 0
          @max_ligne += 2
        end
      end
      
      self.contents = Bitmap.new(width - self.padding * 2, @max_ligne * 24)
      
      @item = item
#~      draw_icon(item.icon_index , 0, -@ligne_actuel*24)
#~      contents.font.color = item.rarity_colour
#~      contents.draw_text(24, -88-@ligne_actuel*24, contents.width, contents.height, item.name)
 
      contents.font.color = system_color
      contents.draw_text(0, 0, contents.width, 24, "Niveau :")
      contents.font.color = normal_color
      if item.level != item.max_level
        contents.draw_text(0, 24, contents.width, 24, item.level.to_s + " / " + item.max_level.to_s)
      else
        contents.draw_text(0, 24, contents.width, 24, "-- Max --")
      end
      contents.font.color = system_color
      contents.draw_text(0, 48, contents.width, 24, "Expérience :")
      contents.font.color = normal_color
      if item.level != item.max_level
        contents.draw_text(0, 72, contents.width, 24, item.exp.to_s)
        contents.font.color = normal_color
        contents.draw_text(0, 96, contents.width, 24, item.exp_to_level.to_s)
      else
        contents.draw_text(0, 72, contents.width, 24, "-- Max --")
      end
      contents.font.color = system_color
      contents.draw_text(0, 120, contents.width, 24, "Prochains bonus :")
 
      j = 0
      for i in 0..7
        if item.instance_mult_lvl_bonus(i) != 1 || item.instance_static_lvl_bonus(i) != 0
          next_value = item.params[i]*item.instance_mult_lvl_bonus(i)+item.instance_static_lvl_bonus(i)
          contents.font.color = normal_color
          if item.level != item.max_level
            contents.draw_text(0 , 144 + (48 * j), contents.width, 24, Vocab.param(i))
            contents.font.color = normal_color
            contents.draw_text(0 , 168 + (48 * j), contents.width, 24, item.params[i].to_s+" passe à "+next_value.floor.to_s)
            j += 1
          end
        end
      end
    end
  end
  
  def downStat
    dif = (@max_ligne * 24) - (height - self.padding * 2)
    save_oy = self.oy
    if self.oy + 24 > dif
      self.oy = [dif,0].max
    else
      self.oy += 24
    end
    if save_oy != self.oy
      Sound.play_cursor
    end
  end
  
  def upStat
    save_oy = self.oy
    if self.oy - 24 < 0
      self.oy = 0
    else
      self.oy -= 24
    end
    if save_oy != self.oy
      Sound.play_cursor
    end
  end
  
end



Posté dans Forum - [RPG Maker VX Ace] Ajustement fenêtre

Nérylis - posté le 21/02/2016 à 13:39:19. (149 messages postés)

Ok, ça marche. Merci bien. :)

Edit : Ne t'embête pas, il va y avoir un problème de taille d'interface depuis le menu Objets. Donc, je ne vais pas intégrer cette possibilité.
Pour le menu défilant et l'histoire de la transition, je vais demander à une personne qui a réussi à satisfaire ma demande sur l'autre topic.

Merci en tout cas pour ton aide.

Posté dans Forum - [RPG Maker VX Ace] Ajustement fenêtre

Nérylis - posté le 20/02/2016 à 14:11:35. (149 messages postés)

Oui, merci pour ton aide (j'ai l'habitude de le dire à la fin quand tout est ok mais ne t'en fais pas, je n'oublie jamais de remercier ceux et celles qui m'aident).^^

C'est bon pour le son du curseur.

Un truc auquel je n'avais pas fais attention, c'est normal s'il y a un effet de transition quand j'ouvre et ferme l'interface ? Ça ne le fait pas sur les autres interfaces.

Pour les couleurs, j'avais bien repéré le text_color(2). Le souci, c'est qu'il y a deux cas à différencier. Le premier, c'est quand on va dans le menu Equiper où là on doit bien voir les conditions requises atteintes en blanc et les non atteintes en rouge. Le second, c'est quand on va dans le menu Objets où là on doit voir toutes les conditions en blanc car ce menu n'est pas rattaché à un personnage particulier. or là actuellement, la partie du script qui gère les couleurs est commun aux deux cas. Il faudrait séparer mais je ne sais pas comment faire.

Posté dans Forum - [RPG Maker VX Ace] Ajustement fenêtre

Nérylis - posté le 19/02/2016 à 15:50:44. (149 messages postés)

Je viens de tester, c'est beaucoup mieux qu'avant. J'ai quelques remarques :

- Est-ce qu'il serait possible d'avoir le son du curseur lorsqu'on appuie sur la touche pour accéder et quitter cette interface ?
- Est-ce qu'il y a une méthode pour centrer "Conditions requises" qui apparait en haut de l'interface ?
- Je ne sais pas si ça te bloque aussi dans ce cas mais lorsqu'on met un certain nombre de conditions, ça sort de la fenêtre. Il faudrait faire un menu déroulant avec les fameuses petites flèches, dans le cas où on a beaucoup de conditions.

Par rapport au fait de pouvoir accéder à cette interface depuis le menu Objets :
- Est-ce qu'il serait possible que la couleur d'écriture soit normale (blanche) pour toutes les conditions ? Parce que dans le menu Objets, on ne fait pas référence à un personnage particulier, donc on ne peut pas dire si les conditions sont vérifiées ou non par rapport à un personnage. C'est plutôt à titre d'information, il faudrait donc une couleur d'écriture normale dans ce cas-là. L'interface des sets d'équipement marche comme ça.

Posté dans Forum - [RPG Maker VX Ace] Ajustement fenêtre

Nérylis - posté le 18/02/2016 à 19:58:16. (149 messages postés)

Oki ça marche.

Posté dans Forum - [RPG Maker VX Ace] Ajustement fenêtre

Nérylis - posté le 17/02/2016 à 22:54:30. (149 messages postés)

Domaine concerné: Script
Logiciel utilisé: RPG Maker VX Ace
Coucou,

J'ai un petit problème d'interface sur ma démo. Il s'agit de l'interface qui permet de lire les pré-requis nécessaires au port des équipements. Il s'agit du script de Fomar intitulé Equipment Requirements présent dans ma démo que voici : http://www.mediafire.com/download/j0952abf5gaibtb/Ace+menu3.exe

Principe : quand on va dans le menu Equipement avec un personnage, lorsqu'on sélectionne les équipements disponibles, si on appuie sur la touche Ctrl, on accède à une interface sur laquelle on peut voir les conditions pour porter l'équipement en question (ça peut être un niveau minimum par exemple).

Voici ce que j'aimerais changer :

- Est-ce qu'il serait possible que le cadre de l'interface actuelle (encadré en bleu sur ma capture ci-dessous) se retrouve centrée en bas à gauche (suivant le cadre jaune) ?
- Est-ce qu'il serait possible que lorsqu'on switch sur cette interface, il n'y ait pas de transparence avec les autres fenêtres et qu'on puisse conserver le background de la même façon que pour l'interface des sets ?
- Est-ce qu'il serait possible, quand on est sur cette interface, de pouvoir revenir en arrière avec la touche dédiée (ici Ctrl) mais aussi avec la touche Annuler, de la même façon que pour l'interface des sets ?

Capture :

http://www.servimg.com/view/11188066/114

L'interface des sets que je cite comme référence est celle que l'on peut accéder en sélectionnant les équipements orange dans ma démo et en appuyant sur la touche D.

Voilà, si vous avez des questions, n'hésitez pas à me demander.

Posté dans Forum - [RPG Maker VX Ace] Petite modification de script

Nérylis - posté le 14/02/2016 à 15:45:40. (149 messages postés)

Arf. Dans ce cas, si quelqu'un a la solution, ça serait intéressant.

Edit : Problème réglé via un autre forum. Merci pour ton aide arttroy.

Aller à la page: 1 2 3 4

Haut de page

Merci de ne pas reproduire le contenu de ce site sans autorisation.
Contacter l'équipe - Mentions légales

Plan du site

Communauté: Accueil | Forum | Chat | Commentaires | News | Flash-news | Screen de la semaine | Sorties | Tests | Gaming-Live | Interviews | Galerie | OST | Blogs | Recherche
Apprendre: Visite guidée | RPG Maker 95 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker MV | Tutoriels | Guides | Making-of
Télécharger: Programmes | Scripts/Plugins | Ressources graphiques / sonores | Packs de ressources | Midis | Eléments séparés | Sprites
Jeux: Au hasard | Notre sélection | Sélection des membres | Tous les jeux | Jeux complets | Le cimetière | RPG Maker 95 | RPG Maker 2000 | RPG Maker 2003 | RPG Maker XP | RPG Maker VX | RPG Maker VX Ace | RPG Maker MV | Autres | Proposer
Ressources RPG Maker 2000/2003: Chipsets | Charsets | Panoramas | Backdrops | Facesets | Battle anims | Battle charsets | Monstres | Systems | Templates
Ressources RPG Maker XP: Tilesets | Autotiles | Characters | Battlers | Window skins | Icônes | Transitions | Fogs | Templates
Ressources RPG Maker VX: Tilesets | Charsets | Facesets | Systèmes
Ressources RPG Maker MV: Tilesets | Characters | Faces | Systèmes | Title | Battlebacks | Animations | SV/Ennemis
Archives: Palmarès | L'Annuaire | Livre d'or | Le Wiki | Divers