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

Sorties: "Dread Mac Farlane", (...) / Tutos: Checklist de la composition (...) / Sorties: Dread Mac Farlane - episode 8 / Sorties: Dread Mac Farlane - episode 7 / Jeux: Ce qui vit Dessous / Chat

Bienvenue
visiteur !




publicité RPG Maker!

Statistiques

Liste des
membres


Contact

Mentions légales

464 connectés actuellement

29431343 visiteurs
depuis l'ouverture

5719 visiteurs
aujourd'hui



Barre de séparation

Partenaires

Indiexpo

Akademiya RPG Maker

Blog Alioune Fall

Fairy Tail Constellations

Tashiroworld

New RPG Maker

Le Temple de Valor

Zarok

RPG Fusion

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 - [VX Ace] Graphics.frame_count

Nérylis - posté le 05/04/2021 à 19:13:05. (149 messages postés)

Je crois que j'ai enfin saisi comment ça marche.

Comme tu l'as dit mamie, graphics.frame_count joue un peu le même role que les données comme le temps de jeu, le nombre de pas effectués, le nombre de combats... les stats de la partie en gros. Donc en effet, il ne faut pas chercher à remettre ces données à 0.

Après, il y a 2 moyens de calculer le moment où le point de récolte sera de nouveau disponible. Je peux stocker dans une variable la donnée qui m'intéresse au moment de la récolte et lui ajouter l'équivalent du temps de repop, pour ensuite comparer avec la donnée qui tourne en permanence. Ou bien je garde en mémoire la valeur d'origine et je fais une soustraction avec la donnée en temps réel pour déduire si le temps de repop a été écoulé ou pas.

Mais il n'est pas évident le graphics.frame_count car il n'apparaît pas dans les options Autre proposées lorsqu'on veut modifier une variable. À la limite, je pourrais utiliser la donnée Temps de jeu qui est en secondes. Mais je pense que je vais même faire ça avec le nombre de pas effectués (ça évitera que les petits malins laissent le jeu tourner en attendant le repop). Du coup, ça ne change pas trop la façon de fonctionner de l'event.

P.S : ce n'est pas moi qui ai créé le reste de l'event avec les appels de script.^^

Posté dans Forum - [VX Ace] Graphics.frame_count

Nérylis - posté le 05/04/2021 à 16:02:22. (149 messages postés)

Il y a 2 onglets parce que l'apparence du point de récolte change en fonction de la disponibilité des matériaux.

J'ai fait des captures d'écran, ça sera mieux pour comprendre.

image

image

Posté dans Forum - [VX Ace] Graphics.frame_count

Nérylis - posté le 05/04/2021 à 15:25:47. (149 messages postés)

Domaine concerné: Event
Logiciel utilisé: VX Ace
Bonjour,

Je me questionne sur le fonctionnement (et éventuellement une amélioration) d'un système pour changer l'état d'un event en fonction du temps de jeu écoulé.

Dans mon jeu, il y a des points de récolte. On peut récupérer des matériaux. Seulement après, il faut patienter un certain moment avant de pouvoir recommencer.

On m'avait proposé, il y a longtemps, d'utiliser le graphics.frame_count.

Voici à quoi ressemble mon event, en 2 onglets. Ici, j'ai choisi un temps de repop d'une heure qui correspond à 216000 frames.

Onglet 1 : (déclenchement : touche action)

Variable A = graphics.frame_count
Variable A = +216000
Interrupteur local A activé

Onglet 2 : (condition : si Interrupteur local A est activé ; déclenchement : processus parallèle)

Si Variable A est inférieure ou égale à graphics.frame_count
Alors Interrupteur local A est désactivé


Si je comprends bien, ce graphics.frame_count est une variable qui compte quand on lui demande et qui ne revient jamais à 0. N'y a-t-il pas la possibilité de mettre cette variable à 0 ? J'aurais bien imaginé mettre cette variable à 0, commencer le comptage et une fois arrivé à 216000, lui dire stop et désactivé l'interrupteur local. Est-ce qu'il y a un moyen d'améliorer ce système ?

Posté dans Forum - [VX Ace] Vidéo en fullscreen

Nérylis - posté le 27/03/2021 à 22:45:24. (149 messages postés)

Avec cette version plus récente, comment on fait pour passer en grand écran ? C'était F5 et F6 avant.

Posté dans Forum - [VX Ace] Vidéo en fullscreen

Nérylis - posté le 27/03/2021 à 18:50:57. (149 messages postés)

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

J'ai voulu utiliser le script de Zeus81 pour mettre le jeu en fullscreen. Ça marche, il n'y a aucun souci. Par contre, j'utilise parfois des vidéos dont le format est le natif de RPG Maker VX Ace, soit 640x480. Et quand en plein jeu je déclenche une de ses vidéos, alors que je suis en fullscreen, elle apparaît dans son format habituel en haut à gauche de l'écran, donc tout petit. Est-ce qu'il y a la possibilité d'arranger ça ?

Le script de Zeus81 est ici : https://pastebin.com/raw/kc1hzBek

Le script qui gère les vidéos avait été modifié, donc je vous le mets en code 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
#--------------------------------------------------
# Ce Script est la fusion de 2 scripts,
# "Play Movie before skill" et "MhAD bugfix".
# De plus, ce script permet de séparer les
# animations quand un Battler attaque
# à multiple reprise une même cible.
#
# Pour être compatible avec LNX11,
# ce script doit être AVANT LNX11.
#
# Par Azuma-01
#
#------------------------------------
# Script 1
#  Name : Play Movie before skill
#  Scripter : efeberk
#  Date : 29.07.2013 07:28
#  Version : RPG Maker VX Ace(RGSS3)
#  Modified by Trihan on 08/05/2015
#
#  How to:
#    Just add a little text to skill notetag
#    movie: name
#------------------------------------
# Script 2
#  Nom : MhAD bugfix
#  Par : Azuma-01
#  Date : 30/03/2016
#  Version : 2.0.5
#------------------------------------------------
# Par conséquent, cette fusion doit être placer
# APRÈS LNX11 et les 2 deux autres script ne sont
# pas nécéssaire!
 
#
module Play_Movie_Before_Skill
  DURATION = 3 # x is used to control how long the cast message will last
end
 
class RPG::Skill < RPG::UsableItem
  def movie
    if @note =~ /^movie:\s*(.+?)$/i
      return $1.to_s
    end
  end
end
 
class RPG::Item < RPG::UsableItem
  def movie
    if @note =~ /^movie:\s*(.+?)$/i
      return $1.to_s
    end
  end
end
    
class Scene_Battle
  #--------------------------------------------------------------------------
  # * When a target counter, chance to cancel the subject action
  #  note: if set to 1, always cancel the subject action ; 0, never
  #--------------------------------------------------------------------------
  def counter_break_rate(target)
    # always break
    return 1
    # target critical rate * 10
    #return target.cri * 10
    # (target critical rate - subject critical rate) * 10
    #return (target.cri - @subject.cri) *10
  end
  #--------------------------------------------------------------------------
  # * [Overwrite] Use Skill/Item
  #--------------------------------------------------------------------------
  def use_item
    item = @subject.current_action.item
    alive_scope = !item.for_dead_friend?
    @log_window.display_use_item(@subject, item)
    @subject.use_item(item)
    refresh_status
    #--------------------------------------------
    #Intégration Play_Movie_Before_Skill
    if item.is_a?(RPG::Skill) && item.movie
      Play_Movie_Before_Skill::DURATION.times { @log_window.wait }
      Graphics.play_movie('Movies/' + item.movie)
    end
    if item.is_a?(RPG::Item) && item.movie
      Play_Movie_Before_Skill::DURATION.times { @log_window.wait }
      Graphics.play_movie('Movies/' + item.movie)
    end
    #--------------------------------------------
    targets = @subject.current_action.make_targets.compact
    anim_screen = (id=item.animation_id) > 0 ?
      $data_animations[id].to_screen? : false
    # play animation once if to_screen?
    show_animation(targets, id) if anim_screen
    targets.each {|target|
      next if target.hp <= 0 && alive_scope #ignore target if target is dead
      # play animation if !to_screen?
      show_animation([target], id) unless anim_screen
      item.repeats.times {
        return if invoke_item(target, item)
        break if target.hp <= 0 && alive_scope #stop atk if target died on privious hit
      }
    }
    wait_for_effect
  end
  #--------------------------------------------------------------------------
  # Overwrite * Invoke Skill/Item
  #--------------------------------------------------------------------------
  def invoke_item(target, item)
    # if target do a counter, calc chance to break the subject action
    break_cycle = rand < counter_break_rate(target)
    if rand < target.item_cnt(@subject, item)
      invoke_counter_attack(target, item)
    elsif rand < target.item_mrf(@subject, item)
      invoke_magic_reflection(target, item)
    else
      apply_item_effects(apply_substitute(target, item), item)
      break_cycle = false # no counter, target cant break action
    end
    @subject.last_target_index = target.index
    return break_cycle
  end
  
end



Posté dans Forum - [VX Ace] Petite modification magasin

Nérylis - posté le 20/01/2021 à 08:49:23. (149 messages postés)

J'ai obtenu la solution à mes 2 demandes sur un autre forum.
Topic à fermer.

Posté dans Forum - [VX Ace] Petite modification magasin

Nérylis - posté le 07/01/2021 à 17:20:12. (149 messages postés)

Oui Gari, je dirais même ligne 41, il faudrait changer $game_party.item_number(@item) par l'équivalent qui prendrait en compte également les armes/armures équipées.

Posté dans Forum - [VX Ace] Petite modification magasin

Nérylis - posté le 03/01/2021 à 12:08:14. (149 messages postés)

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

J'aurais besoin d'une petite modification sur l'écran de magasin. Actuellement, le nombre d'équipements en possession prend en compte uniquement les équipements dans l'inventaire, pas ceux dont les personnages sont équipés. J'aimerais que ces derniers soient comptabilisés et que le nom des personnages les portant apparaissent avec une couleur différente.

Exemples en images :

Sur le premier screen, la Griffe de fer est dans l'inventaire, ça me met 1 en possession.

image

Sur le second screen, la Griffe d'acier est portée par Érios, mais ça me met 0 en possession.

image

Pour la modification à effectuer, je ne sais pas si ça se fait dans les scripts de base ou dans celui de Yanfly que j'utilise. Donc, je vous mets celui-ci si besoin :

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
1376
1377
1378
1379
1380
1381
1382
1383
1384
#==============================================================================
# 
# ▼ 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  = 8        # 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)
    if item.is_a?(RPG::Item)
      if $game_party.item_number(item) == 0
        if @item_window.index != 0
          @item_window.select(@item_window.index - 1)
        end
      end
    else
      @item_window.select_last
    end       
  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
# 
#==============================================================================



Bon courage et merci d'avance.

Posté dans Forum - [VX Ace] Avatar sélectionné automatiquement dans les dialogues

Nérylis - posté le 29/11/2020 à 15:39:55. (149 messages postés)

Bonjour,

Je me permets de rebondir sur ce sujet. Je me suis aperçu que les codes de mise en forme de texte du script de Modern Algebra ne s'appliquaient pas dans les appels de script. Est-ce que c'est possible de remédier à ça ?

Voici le script en question :

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
#==============================================================================
#    ATS: Special Message Codes [VXA]
#    Version: 1.0.6
#    Author: modern algebra (rmrk.net)
#    Date: 18 October 2012
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#
#    This script allows you to use a number of additional special codes in the
#   message system, which will function similar to the default codes like
#   \v[n], \c[n], etc. Please see the list of special message codes starting at
#   line 54 for a full idea of what is added. Basically, it gives you greater
#   control over the delivery of a message, allows you to make use of font
#   effects like bolding and italicizing, and allows you to retrieve and
#   display useful data like the names of weapons and armors.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  ATS Series:
#
#    This script is part of the Advanced Text System series of scripts. These
#   scripts are based off the Advanced Text System for RMVX, but since RMVX Ace
#   has a much more sensibly designed message system, it is no longer necessary
#   that it be one large script. For that reason, and responding to feedback on
#   the ATS, I have split the ATS into multiple different scripts so that you
#   only need to pick up the components for the features that you want. It is
#   therefore easier to customize and configure.
#
#    To find more scripts in the ATS Series, please visit:
#      http://rmrk.net/index.php/topic,44525.0.html
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    This script is not difficult to use or configure. There are only ten
#   configuration options for this script. These are:
#
#      :message_speed               :font_italic
#      :show_fast_speed             :font_outline
#      :font_name                   :font_shadow
#      :font_size                   :font_underline
#      :font_bold                   :font_highlight
#
#   :message_speed allows you to set the default number of frames to wait
#   between drawing each letter in the message window. :show_fast_speed allows
#   you to control the amount it speeds up when the player presses enter. You
#   can gain instructions on setting the default value for both at line 180.
#
#   All of the :font_ settings simply let you set the initial values for the
#   font when used.
#
#    As with other ATS scripts, you can change the value of these options in
#   game with the following codes in a script call:
#
#      ats_next(:message_option, x)
#      ats_all(:message_option, x)
#
#   Where :message_option is the symbol you want (:message_speed or
#   :show_fast_speed) and x is the value you want to change it to. ats_next
#   will only change it for the very next message, while ats_all will change it
#   for every message to follow.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  List of Special Message Codes:
#
#    The default message codes are retained, and this script adds a number of
#   other desirable features. The following is a complete list of the message
#   codes at your disposal. Simply insert them into a Display Message command,
#   Choice Branches, or any other message related system.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Font Effects:
#
# \fn[fontname] - Change the font to fontname. If you put multiple fontnames
#     separated by commas, then it will take the first one the user has installed
# \fs[n] - Change the font size to n.
# \{ - Increase the font size by 8.
# \} - Decrease the font size by 8.
# \c[n] - Set the colour of the text being drawn to the nth colour of the
#     Windowskin palette. 0 is the normal color and 16 is the system color.
# \hc[RRGGBB] or \c[#RRGGBB] - Set the colour of the text being drawn to any
#     colour, using hexadecimal values. You can set each colour (red, green,
#     blue) to anything from 0-255 (00-FF). You must use hexadecimal values. If
#     so desired, you can add an additional hex value from 00-FF to change the
#     alpha.
# \b     - Turn bold on. Text drawn after this code will be bolded.
# /b     - Turn bold off.
# \i     - Turn italic on. Text drawn after this code will be italicized.
# /i     - Turn italic off.
# \o     - Turn outline on.
# /o     - Turn outline off.
# \s     - Turn shadow on. Text drawn after this code will have a shadow.
# /s     - Turn shadow off.
# \u     - Turn underline on. Text drawn after this code will be underlined.
# /u     - Turn underline off.
# \hl[n] - Turn highlight on. Text drawn after this code will be highlighted
#     with colour n + 1 from the windowskin palette
# /hl OR \hl[0] - Turn highlight off.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Message Control:
#
# \s[n] - Sets the message speed to wait n frames between drawing every letter.
#     0 is instant.
# \s[+n] - Sets the message speed to wait an additional n frames between drawing
#     every letter.
# \s[-n] - Sets the message speed to wait n less frames between drawing every
#     letter.
# \. - Wait 15 frames before drawing the next character
# \| - Wait 60 frames before drawing the next character
# \w[n] - Wait n frames before drawing the next character
# \! - Pause text and wait for player to press Enter
# \^ - Skip Pause; allows you to close a message window without requiring player
#     input.
# \> - Show line fast.
# \< - Stop showing line fast.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Replacement Codes:
#
# \p[n] - Draw the name of the actor in the xth position in the party. 1 is
#     the party leader, 2 is the second member, etc.
# \n[n] - Draw the name of the actor with ID n
# \nn[n] - Draw the nickname of the actor with ID n.
# \pid[n] - Draw the ID of the actor in the nth position in the party.
# \ac[n] - Draw the class name of the actor with ID n.
# \al[n] - Draw the level of the actor with ID n.
# \ni[n] - Draw the name of the item with ID n.
# \nw[n] - Draw the name of the weapon with ID n.
# \na[n] - Draw the name of the armor with ID n.
# \ns[n] - Draw the name of the skill with ID n.
# \nt[n] - Draw the name of the state with ID n.
# \nc[n] - Draw the name of the class with ID n.
# \ne[n] - Draw the name of the event with ID n on the current map.
# \nm[n] - Draw the name of the enemy with ID n.
# \nv[n] - Draw the name of the variable with ID n.
# \nsw[n] - Draw the name of the switch with ID n.
# \nl[n] - Draw the name of the element with ID n.
# \nwt[n] - Draw the name of the weapon type with ID n.
# \nat[n] - Draw the name of the armor type with ID n.
# \nst[n] - Draw the name of the skill type with ID n.
# \np[n] - Draw the name of the actor in the nth position in the party.
# \map   - Draw the name of the map the player is currently on.
# \map[n] - Draw the name of the map with ID n.
# \pg - Draws the amount of money the party has.
# \g - Draws the unit of currency.
# \vocab[method] - Will draw whatever Vocab.method returns, if it is a valid
#     method call. Suitable values for method are: level, level_a, hp, hp_a,
#     mp, mp_a, tp, tp_a, fight, escape, attack, guard, item, skill, equip,
#     status, formation, save, game_end, weapon, armor, key_item, equip2,
#     optimize, clear, new_game, continue, shutdown, to_title, cancel,
#     currency_unit
# \vocab[param, n] - Will draw the label for parameter with ID n. 0 => Max HP;
#     1 => Max MP; 2 => Attack; 3 => Defence; 4 => Magic; 5 => Magic Defence;
#     6 => Agility; 7 => Luck
# \vocab[etype, n] - Will draw the label for equipment type with ID n.
#     0 => Weapon; 1 => Shield; 2 => Head; 3 => Body; 4 => Accessory
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Other Effects:
#
# \$ - Opens a window which shows the party's gold.
# \n - line break
# \i[n] - Draw icon with index n.
# \ii[n] - Draw icon of the item with ID n.
# \iw[n] - Draw icon of the weapon with ID n.
# \ia[n] - Draw icon of the armor with ID n.
# \is[n] - Draw icon of the skill with ID n.
# \it[n] - Draw icon of the state with ID n.
# \x[n] - Draw next character at pixel n of the window contents.
# \s{n,text} - Will only draw text if the switch with ID n is ON.
# \s!{n,text} - Will only draw text if the switch with ID n is OFF.
# \#{code} - This will evaluate code. So, if you know scipting, you can place
#     any code there and it will draw whatever is returned by it. For instance:
#     \#{$game_system.save_count} would draw the number of times the player has
#     saved the current game.
#==============================================================================
 
$imported = {} unless $imported
$imported[:ATS_SpecialMessageCodes] = true
 
#==============================================================================
# ** Game_ATS
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    new public instance variables - message_speed; special_message_codes
#==============================================================================
 
class Game_ATS
  CONFIG = {} unless $imported[:AdvancedTextSystem]
  CONFIG[:special_message_codes] = {
    special_message_codes: true,
    #\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
    #  EDITABLE REGION
    #||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
    #   :message_speed => x,
    #      Changing the value of x determines the default number of frames to
    #     wait between drawing letters in a message window. 0 is instant.
    :message_speed =>   1,
    #   :show_fast_speed => x
    #      Changing the value of x determines the number of frames to wait
    #     between drawing letters when the player is holding enter. 0 is
    #     instant
      :show_fast_speed => 0,
    # Font Settings - Set the default settings for the font you are using here.
    :font_name => Font.default_name,       # String or Array of Strings
    :font_size => Font.default_size,       # Integer
    :font_bold => Font.default_bold,       # true or false
    :font_italic => Font.default_italic,   # true or false
    :font_outline => Font.default_outline, # true or false
    :font_shadow => Font.default_shadow,   # true or false
    :font_underline => false,              # true or false
    :font_highlight => -1,                 # Integer for colour of highlight
    #||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
    #  END EDITABLE REGION
    #////////////////////////////////////////////////////////////////////////
  }
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CONFIG[:special_message_codes].keys.each { |key| attr_accessor key }
end
 
#==============================================================================
#  Initialize Common ATS Data if no other ATS script interpreted first
#==============================================================================
 
if !$imported[:AdvancedTextSystem]
  #============================================================================
  # *** DataManager
  #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  #  Summary of Changes:
  #    aliased method - create_game_objects; make_save_contents;
  #      extract_save_contents
  #============================================================================
  module DataManager
    class << self
      #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      # * Create Game Objects
      #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      alias modb_ats_crtgmobj_6yh7 create_game_objects
      def create_game_objects(*args, &block)
        modb_ats_crtgmobj_6yh7(*args, &block)
        $game_ats = Game_ATS.new
        $game_ats.init_new_installs
      end
      #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      # * Make Save Contents
      #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      alias mlba_ats_mksave_5tg9 make_save_contents
      def make_save_contents(*args, &block)
        contents = mlba_ats_mksave_5tg9(*args, &block)
        contents[:ats] = $game_ats
        contents
      end
      #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      # * Extract Save Contents
      #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      alias ma_ats_extrcsvcon_8uj2 extract_save_contents
      def extract_save_contents(contents, *args, &block)
        ma_ats_extrcsvcon_8uj2(contents, *args, &block)
        $game_ats = contents[:ats] ? contents[:ats] : Game_ATS.new
        $game_ats.init_new_installs
      end
    end
  end
 
  #============================================================================
  # ** Game_ATS
  #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  #  This class holds the default data for all scripts in the ATS series
  #============================================================================
 
  class Game_ATS
    def initialize; reset; end
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Reset any or all installed ATS scripts
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def reset(script_name = nil)
      if script_name.is_a? (Symbol) # If script to reset specified
        CONFIG[script_name].each_pair { |key, value|
          self.send("#{key}=".to_sym, value)
          $game_message.send("#{key}=".to_sym, value)
        }
      else                          # Reset all ATS scripts
        CONFIG.keys.each { |script| reset(script) }
      end
    end
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Initialize any newly installed ATS scripts
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def init_new_installs
      CONFIG.keys.each { |script| reset(script) unless self.send(script) }
    end
  end
 
  #============================================================================
  # ** Game_Message
  #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  #  Summary of Changes:
  #    aliased method - clear
  #============================================================================
 
  class Game_Message
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Clear
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    alias mlb_ats_clrats_5tv1 clear
    def clear(*args, &block)
      mlb_ats_clrats_5tv1(*args, &block) # Run Original Method
      return if !$game_ats
      Game_ATS::CONFIG.values.each { |installed|
        installed.keys.each { |key| self.send("#{key}=".to_sym, $game_ats.send(key)) }
      }
    end
  end
 
  #============================================================================
  # ** Game_Interpreter
  #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  #  Summary of Changes:
  #    new methods - ats_all; ats_next
  #============================================================================
 
  class Game_Interpreter
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * ATS All
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def ats_all(sym, *args, &block)
      $game_ats.send("#{sym}=".to_sym, *args, &block)
      ats_next(sym, *args, &block)
    end
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * ATS Next
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def ats_next(sym, *args, &block)
      $game_message.send("#{sym}=".to_sym, *args, &block)
    end
  end
end
 
$imported[:AdvancedTextSystem] = true
 
class Game_Message
  Game_ATS::CONFIG[:special_message_codes].keys.each { |key| attr_accessor key }
end
 
#==============================================================================
# ** Game_Event
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    new method - name
#==============================================================================
 
class Game_Event
  def name
    return @event ? @event.name : ""
  end
end
 
#==============================================================================
# ** Window_Base
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased methods - initialize; convert_escape_characters; calc_line_height;
#      process_escape_character; process_normal_character
#==============================================================================
 
class Window_Base
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mlgb_atssmc_init_3do9 initialize
  def initialize(*args, &block)
    mlgb_atssmc_init_3do9(*args, &block) # Run Original Method
    @underline = false
    @highlight = -1
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Convert Escape Characters
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_atssmc_convesc_4rc1 convert_escape_characters
  def convert_escape_characters(text, *args, &block)
    result = ma_atssmc_convesc_4rc1(text, *args, &block) # Run Original Method
    # Party
    result.gsub!(/\ePID\[(\d+)\]/i) { $1.to_i >= 1 ? $game_party.members[$1.to_i - 1].id.to_s : "1" }
    result.gsub!(/\ePG/i) { $game_party.gold }
    # Message Speed
    result.gsub!(/\eS\[([\+-]?\d+)\]/i) { "\eMS\[#{$1}\]" }
    result.gsub!(/\e%/)             { "\eDS%"}
    # Hex Colour
    result.gsub!(/\eC\[#/i)         { "\eHC[" }
    # Icons
    result.gsub!(/\eII\[(\d+)\]/i)  { "\eI\[#{$data_items[$1.to_i].icon_index}\]" rescue "" }
    result.gsub!(/\eIW\[(\d+)\]/i)  { "\eI\[#{$data_weapons[$1.to_i].icon_index}\]" rescue "" }
    result.gsub!(/\eIA\[(\d+)\]/i)  { "\eI\[#{$data_armors[$1.to_i].icon_index}\]" rescue "" }
    result.gsub!(/\eIS\[(\d+)\]/i)  { "\eI\[#{$data_skills[$1.to_i].icon_index}\]" rescue "" }
    result.gsub!(/\eIT\[(\d+)\]/i)  { "\eI\[#{$data_states[$1.to_i].icon_index}\]" rescue "" }
    # Actor Stats
    result.gsub!(/\eAC\[(\d+)\]/i)  { $data_classes[$game_actors[$1.to_i].class_id].name }
    result.gsub!(/\eAL\[(\d+)\]/i)  { $game_actors[$1.to_i].level.to_s }
    # Names
    result.gsub!(/\eMAP\[(\d+)\]/i) { load_data(sprintf("Data/Map%03d.rvdata2", $1.to_i)).display_name rescue "" }
    result.gsub!(/\eMAP/i)          { $game_map.display_name rescue "" }
    result.gsub!(/\eNP\[(\d+)\]/i)  { $game_party.members[$1.to_i].name rescue "" }
    result.gsub!(/\eNE\[(\d+)\]/i)  { $game_map.events[$1.to_i].name rescue "" }
    result.gsub!(/\eNN\[(\d+)\]/i)  { $game_actors[$1.to_i].nickname rescue "" }
    result.gsub!(/\eNI\[(\d+)\]/i)  { $data_items[$1.to_i].name rescue "" }
    result.gsub!(/\eNW\[(\d+)\]/i)  { $data_weapons[$1.to_i].name rescue "" }
    result.gsub!(/\eNA\[(\d+)\]/i)  { $data_armors[$1.to_i].name rescue "" }
    result.gsub!(/\eNS\[(\d+)\]/i)  { $data_skills[$1.to_i].name rescue "" }
    result.gsub!(/\eNT\[(\d+)\]/i)  { $data_states[$1.to_i].name rescue "" }
    result.gsub!(/\eNM\[(\d+)\]/i)  { $data_enemies[$1.to_i].name rescue "" }
    result.gsub!(/\eNC\[(\d+)\]/i)  { $data_classes[$1.to_i].name rescue "" }
    result.gsub!(/\eNV\[(\d+)\]/i)  { $data_system.variables[$1.to_i] }
    result.gsub!(/\eNSW\[(\d+)\]/i) { $data_system.switches[$1.to_i] }
    result.gsub!(/\eNWT\[(\d+)\]/i) { $data_system.weapon_types[$1.to_i] }
    result.gsub!(/\eNAT\[(\d+)\]/i) { $data_system.armor_types[$1.to_i] }
    result.gsub!(/\eNST\[(\d+)\]/i) { $data_system.skill_types[$1.to_i] }
    result.gsub!(/\eNL\[(\d+)\]/i)  { $data_system.elements[$1.to_i] }
    # Vocab
    result.gsub!(/\eVOCAB\[(\w+),\s*(\d+)\s*\]/i) { Vocab.send($1.downcase, $2.to_i) rescue "" }
    result.gsub!(/\eVOCAB\[(\w+)\]/i) { Vocab.send($1.downcase) rescue "" }
    # Font Settings
    result.gsub!(/\eB/i)            { "\eFE[0]" } # Bold On
    result.gsub!(/\/B/i)            { "\eFE[1]" } # Bold Off
    result.gsub!(/\eI([^\[])/i)     { "\eFE[2]#{$1}" } # Italics On
    result.gsub!(/\/I/i)            { "\eFE[3]" } # Italics Off
    result.gsub!(/\eO/i)            { "\eFE[4]" } # Outline On
    result.gsub!(/\/O/i)            { "\eFE[5]" } # Outline Off
    result.gsub!(/\eS([^\[!])/i)    { "\eFE[6]#{$1}" } # Shadow On
    result.gsub!(/\/S/i)            { "\eFE[7]" } # Shadow Off
    result.gsub!(/\eU/i)            { "\eFE[8]" } # Underline On
    result.gsub!(/\/U/i)            { "\e\FE[9]" } # Underline Off
    result.gsub!(/\eHL\[(\d+)\]/i)  { "\eHL[#{$1.to_i}]" } # Highlight On: custom colour
    result.gsub!(/\eHL([^\[])/i)    { "\eHL[17]#{$1}" }# Highlight On: system colour
    result.gsub!(/\/HL/i)           { "\eHL[0]" } # Hightlight Off
    result.gsub!(/\/FN/i)           { "\eFN[]" }  # Default Font
    result.gsub!(/\/FS/i)           { "\eFS[#{Font.default_size}]" } # Default Font
    # Conditional Text
    result.gsub!(/\eS\[(\d+)[,;:](.+?)\]/mi) { $game_switches[$1.to_i] ? $2 : "" }
    result.gsub!(/\eS!\[(\d+)[,;:](.+?)\]/mi) { $game_switches[$1.to_i] ? "" : $2 }
    result.gsub!(/\eS\{(\d+)[,;:](.+?)\}/mi) { $game_switches[$1.to_i] ? $2 : "" }
    result.gsub!(/\eS!\{(\d+)[,;:](.+?)\}/mi) { $game_switches[$1.to_i] ? "" : $2 }
    # Evaluation
    result.gsub!(/\e#\{(.+?)\}/im)  { (eval($1)).to_s rescue "" }
    # Do resubstitutions if requested
    if result.sub!(/\eRESUB/i, "") != nil
      result = convert_escape_characters(result, *args, &block)
    end
    result.gsub!(/\e(N|LB)/i, "\n") # Line Break
    result # Return result
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Calculate Line Height
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_atssmc_clclnhght_3ek9 calc_line_height
  def calc_line_height(text, *args, &block)
    res = ma_atssmc_clclnhght_3ek9(text, *args, &block) # Run Original Method
    text.slice(/^.*$/).scan(/\eFS\[(\d+)\]/i) { |num| res = [res, num[0].to_i].max }
    res
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Process Normal Character
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mlra_atssmc_procnorm_5fg2 process_normal_character
  def process_normal_character(c, pos, *args, &block)
    draw_highlight_underline(c, pos) if @underline || @highlight
    mlra_atssmc_procnorm_5fg2(c, pos, *args, &block) # Run Original Method
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Process Escape Character
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_atssmc_procesc_7gv1 process_escape_character
  def process_escape_character(code, text, pos, *args, &block)
    case code.upcase
    when 'X' then pos[:x] = obtain_escape_param(text)
    when 'HC' # Hex Colour
      hex = text.slice!(/^\[([ABCDEF\d]+)\]/i)
      rgb = $1.scan(/../).map { |hex| hex.to_i(16) }
      change_color(Color.new(*rgb)) if rgb.size.between?(3,4)
    when 'FE' # Font Settings
      param = obtain_escape_param(text)
      case param / 2
      when 0 then contents.font.bold = ((param % 2) == 0)     # Bold
      when 1 then contents.font.italic = ((param % 2) == 0)   # Italic
      when 2 then contents.font.outline = ((param % 2) == 0)  # Outline
      when 3 then contents.font.shadow = ((param % 2) == 0)   # Shadow
      when 4 then @underline = ((param % 2) == 0)             # Underline
      end
    when 'HL' then @highlight = obtain_escape_param(text) - 1 # Highlight
    when 'FN' # Font Name
      text.slice!(/^\[(.*?\])/)
      param = $1
      if param.nil? || param == ']'
        contents.font.name = Font.default_name
      else
        ary = []
        while param.slice!(/\s*(.+?)\s*[,;:\]]/) != nil do ary.push($1) end
        contents.font.name = ary
      end
    when 'FS' # Font Size
      text.slice!(/^\[(\d+)\]/)
      contents.font.size = [[$1.to_i, 16].max, 64].min
    else
      ma_atssmc_procesc_7gv1(code, text, pos, *args, &block) # Run Original Method
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Highlighting and Underlining
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def draw_highlight_underline(c, pos)
    text_width = text_size(c).width
    y_space = (pos[:height] - contents.font.size) / 2
    if @underline      # Underlining
      y = pos[:y] + pos[:height]
      y -= [2, y_space].max
      contents.fill_rect(pos[:x], y, text_width, 2, contents.font.color)
    end
    if @highlight >= 0 # Highlighting
      y = pos[:y]
      y += y_space - 1 if y_space > 0
      text_height = [contents.font.size + 2, pos[:height]].min
      colour = text_color(@highlight)
      colour.alpha = 128 if colour.alpha > 128
      contents.fill_rect(pos[:x], y, text_width, text_height, colour)
    end
  end
end
 
#===============================================================================
# ** Window_Message
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - clear_instance_variables; process_escape_character;
#      update_show_fast; wait_for_one_character
#    overwritten super method - reset_font_settings
#===============================================================================
 
class Window_Message
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Clear Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_atssmc_clrinsvar_3dq9 clear_instance_variables
  def clear_instance_variables(*args, &block)
    ma_atssmc_clrinsvar_3dq9(*args, &block) # Run Original Method
    @skip_disabled = false
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Reset Font Settings
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def reset_font_settings(*args, &block)
    change_color(normal_color)
    contents.font.name = $game_message.font_name
    contents.font.size = $game_message.font_size
    contents.font.bold = $game_message.font_bold
    contents.font.italic = $game_message.font_italic
    contents.font.outline = $game_message.font_outline
    contents.font.shadow = $game_message.font_shadow
    @underline = $game_message.font_underline
    @highlight = $game_message.font_highlight
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Process Escape Character
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mnaa_atssmc_escchar_3dr9 process_escape_character
  def process_escape_character(code, text, pos, *args, &block)
    case code.upcase
    when 'MS' # Set Message Speed
      if !text[/^\[([+-])/].nil?
        text.sub!(/^\[([\+-])/, '[' )
        sign = $1
      else
        sign = ""
      end
      param = obtain_escape_param(text)
      sign.empty? ? $game_message.message_speed = param : $game_message.message_speed += "#{sign}#{param}".to_i
      when 'DS'
        text.slice!(/^%/) # Delete buffer to ensure code isn't overextended
        @skip_disabled = !@skip_disabled
      when 'W' then wait(obtain_escape_param(text))
    else
      mnaa_atssmc_escchar_3dr9(code, text, pos, *args, &block) # Run Original Method
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Update Show Fast
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mlg_atssmc_updshwfast_7yb1 update_show_fast
  def update_show_fast(*args, &block)
    mlg_atssmc_updshwfast_7yb1(*args, &block)
    if $game_message.message_speed < 1
      @show_fast = true
    elsif @skip_disabled
      @show_fast = false
    elsif $game_message.show_fast_speed > 0
      @show_fast = Input.press?(:C)
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Wait for One Character
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mdrnl_smcats_waitonechar_5rf1 wait_for_one_character
  def wait_for_one_character(*args, &block)
    mdrnl_smcats_waitonechar_5rf1(*args, &block) # Run Original Method
    if (@show_fast || @line_show_fast) && $game_message.show_fast_speed > 0
      wait($game_message.show_fast_speed)
    elsif $game_message.message_speed > 1
      wait($game_message.message_speed - 1)
    end
  end
end



Posté dans Forum - [VX ACE] Évènement en airship

Nérylis - posté le 15/11/2020 à 09:49:55. (149 messages postés)

En effet, je trouve mon bonheur avec un évènement en processus parallèle qui calcule les coordonnées X et Y du personnage. Merci pour ta réponse.

Posté dans Forum - [VX ACE] Évènement en airship

Nérylis - posté le 14/11/2020 à 18:24:27. (149 messages postés)

Domaine concerné: Évènement
Logiciel utilisé: VX ACE
Bonjour,

J'ai une question concernant le déclenchement des évènements lorsqu'on utilise l'airship. Habituellement, lorsque le héros se déplace à pied ou en bateau, on peut placer des évènements qui se déclenchent lors du passage sur la case ou quand la touche Action est pressée. Seulement, ça ne fonctionne pas en airship. Est-ce que vous savez comment enclencher un évènement lorsqu'on passe sur une case en airship ?

Posté dans Forum - [VX Ace] Avatar sélectionné automatiquement dans les dialogues

Nérylis - posté le 18/10/2020 à 10:08:41. (149 messages postés)

J'avais pensé aussi à faire des conditions, mais j'ai 9 personnages à la fin dans l'équipe, cela aurait été très fastidieux. Je n'utilise pas les expressions faciales, juste un avatar unique par personnage.

Je viens de tester rapidement ton script, ça a l'air de marcher. Je n'avais pas compris au départ, mais en gros, j'écris le dialogue dans l'appel de script. Et les sauts de ligne marchent aussi, donc ça c'est bien.

Je vais regarder ce soir plus en profondeur si je vois des problèmes. Sinon, je passerai le topic en résolu. Merci pour ton aide. :sourire3

Edit : Ok pour moi, tout fonctionne à merveille. Problème résolu. :)

Posté dans Forum - [VX Ace] Avatar sélectionné automatiquement dans les dialogues

Nérylis - posté le 17/10/2020 à 17:41:09. (149 messages postés)

Domaine concerné: Messages
Logiciel utilisé: VX Ace
Bonjour,

J'utilise la fonction \P[1] dans les dialogues afin de faire parler le personnage chef de groupe (je fais ça pour les dialogues optionnels qui peuvent se faire à n'importe quel moment du jeu et qui doit donc prendre en compte les personnages présents à l'instant t, raison pour laquelle je ne peux pas mettre un personnage fixe). Ça marche bien pour ce qui est d'afficher le nom du leader, mais comment je peux faire pour afficher le bon avatar correspondant ?

Posté dans Forum - [VX Ace] Désactivation d'un script sur une map

Nérylis - posté le 17/03/2019 à 23:35:34. (149 messages postés)

Domaine concerné: Script
Logiciel utilisé: VX Ace
Bonsoir,

J'utilise le script de Yanfly - Move Restrict Region dans mon projet sur certaines cartes où j'ai de l'Overlay. Toutefois, je suis embêté sur ma WorldMap où j'utilise l'ensemble des régions numérotées et où bien sûr il n'y a pas d'Overlay. J'aurais voulu savoir s'il était possible de désactiver ce script lorsque j'entre sur la WorldMap. S'il existe une commande ou un notetag...
Dans la mesure du possible, je souhaiterais éviter de casser ce que j'ai mis en place.

Merci d'avance

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
#==============================================================================
#
# ▼ Yanfly Engine Ace - Move Restrict Region v1.03
# -- Last Updated: 2012.01.03
# -- Level: Normal
# -- Requires: n/a
#
#==============================================================================
 
$imported = {} if $imported.nil?
$imported["YEA-MoveRestrictRegion"] = true
 
#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.23.08 - Added Feature: <all restrict: x>
# 2012.01.03 - Added Feature: <all restrict: x>
# 2011.12.26 - Bug Fixed: Player Restricted Regions.
# 2011.12.15 - Started Script and Finished.
#
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Not everybody wants NPC's to travel all over the place. With this script, you
# can set NPC's to be unable to move pass tiles marked by a specified Region.
# Simply draw out the area you want to enclose NPC's in on and they'll be
# unable to move past it unless they have Through on. Likewise, there are
# regions that you can prevent the player from moving onto, too!
#
#==============================================================================
# ▼ 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.
#
# -----------------------------------------------------------------------------
# Map Notetags - These notetags go in the map notebox in a map's properties.
# -----------------------------------------------------------------------------
# <all restrict: x>
# <all restrict: x, x>
# Players and NPC's on the map will be unable to move past region x even if
# they have the "through" flag set. The only thing that can go past is if the
# player is using the debug through flag. Draw out the area you want to close
# the player and NPC's in with the regions and both will be unable to move onto
# any of those tiles marked by region x. If you want to have more regions
# restrict NPC's, insert multiples of this tag.
#
# <npc restrict: x>
# <npc restrict: x, x>
# NPC's on that map will be unable to move past regions x unless they have a
# "Through" flag on. Draw out the area you want to close NPC's in with the
# regions and the NPC's will be unable to move onto any of those tiles marked
# by region x. If you want to have more regions restrict NPC's, insert
# multiples of this tag.
#
# <player restrict: x>
# <player restrict: x, x>
# Players will not be able to move on tiles marked by region x unless the
# player has a "Through" flag on. Draw out the area you want to close the
# player in with the regions and the player will be unable to move past any of
# those tiles marked by region x. If you want to have more regions restrict the
# player, insert multiples of this tag.
#
#==============================================================================
# ▼ 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 MOVE_RESTRICT
   
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Default Completely Restricted Regions -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # If you want there to always be a region ID that will forbid both the
    # player and NPC's from passing through, insert that region ID into the
    # array below. This effect will completely block out both players and NPC's
    # even if they have the "through" flag. However, it does not block the
    # debug_through flag for players.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    DEFAULT_ALL = [61]
   
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Default Player Restricted Regions -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # If you want there to always be a region ID that will forbid the player
    # from passing through, insert that region ID into the array below.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    DEFAULT_PLAYER = [62]
   
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Default NPC Restricted Regions -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # If you want there to always be a region ID that will forbid NPC's from
    # passing through, insert that region ID into the array below.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    DEFAULT_NPC = [63]
   
  end # MOVE_RESTRICT
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 MAP
   
    ALL_RESTRICT =
      /<(?:ALL_RESTRICT|all restrict):[ ]*(\d+(?:\s*,\s*\d+)*)>/i
    NPC_RESTRICT =
      /<(?:NPC_RESTRICT|npc restrict):[ ]*(\d+(?:\s*,\s*\d+)*)>/i
    PLAYER_RESTRICT =
      /<(?:PLAYER_RESTRICT|player restrict):[ ]*(\d+(?:\s*,\s*\d+)*)>/i
   
  end # MAP
  end # REGEXP
end # YEA
 
#==============================================================================
# ■ RPG::Map
#==============================================================================
 
class RPG::Map
 
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :all_restrict_regions
  attr_accessor :npc_restrict_regions
  attr_accessor :player_restrict_regions
 
  #--------------------------------------------------------------------------
  # common cache: load_notetags_mrr
  #--------------------------------------------------------------------------
  def load_notetags_mrr
    @all_restrict_regions = YEA::MOVE_RESTRICT::DEFAULT_ALL.clone
    @npc_restrict_regions = YEA::MOVE_RESTRICT::DEFAULT_NPC.clone
    @player_restrict_regions = YEA::MOVE_RESTRICT::DEFAULT_PLAYER.clone
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when YEA::REGEXP::MAP::ALL_RESTRICT
        $1.scan(/\d+/).each { |num|
        @all_restrict_regions.push(num.to_i) if num.to_i > 0 }
      when YEA::REGEXP::MAP::NPC_RESTRICT
        $1.scan(/\d+/).each { |num|
        @npc_restrict_regions.push(num.to_i) if num.to_i > 0 }
      when YEA::REGEXP::MAP::PLAYER_RESTRICT
        $1.scan(/\d+/).each { |num|
        @player_restrict_regions.push(num.to_i) if num.to_i > 0 }
      #---
      end
    } # self.note.split
    #---
  end
 
end # RPG::Map
 
#==============================================================================
# ■ Game_Map
#==============================================================================
 
class Game_Map
 
  #--------------------------------------------------------------------------
  # alias method: setup
  #--------------------------------------------------------------------------
  alias game_map_setup_mrr setup
  def setup(map_id)
    game_map_setup_mrr(map_id)
    @map.load_notetags_mrr
  end
 
  #--------------------------------------------------------------------------
  # new method: all_restrict_regions
  #--------------------------------------------------------------------------
  def all_restrict_regions
    return @map.all_restrict_regions
  end
 
  #--------------------------------------------------------------------------
  # new method: npc_restrict_regions
  #--------------------------------------------------------------------------
  def npc_restrict_regions
    return @map.npc_restrict_regions
  end
 
  #--------------------------------------------------------------------------
  # new method: player_restrict_regions
  #--------------------------------------------------------------------------
  def player_restrict_regions
    return @map.player_restrict_regions
  end
 
end # Game_Map
 
#==============================================================================
# ■ Game_CharacterBase
#==============================================================================
 
class Game_CharacterBase
 
  #--------------------------------------------------------------------------
  # alias method: passable?
  #--------------------------------------------------------------------------
  alias game_characterbase_passable_mrr passable?
  def passable?(x, y, d)
    return false if npc_region_forbid?(x, y, d)
    return false if player_region_forbid?(x, y, d)
    return game_characterbase_passable_mrr(x, y, d)
  end
 
  #--------------------------------------------------------------------------
  # new method: npc_forbid?
  #--------------------------------------------------------------------------
  def npc_region_forbid?(x, y, d)
    return false unless self.is_a?(Game_Event)
    region = 0
    case d
    when 1; region = $game_map.region_id(x-1, y+1)
    when 2; region = $game_map.region_id(x+0, y+1)
    when 3; region = $game_map.region_id(x+1, y+1)
    when 4; region = $game_map.region_id(x-1, y+0)
    when 5; region = $game_map.region_id(x+0, y+0)
    when 6; region = $game_map.region_id(x+1, y+0)
    when 7; region = $game_map.region_id(x-1, y-1)
    when 8; region = $game_map.region_id(x+0, y-1)
    when 9; region = $game_map.region_id(x+1, y-1)
    end
    return true if $game_map.all_restrict_regions.include?(region)
    return false if @through
    return $game_map.npc_restrict_regions.include?(region)
  end
 
  #--------------------------------------------------------------------------
  # new method: player_region_forbid?
  #--------------------------------------------------------------------------
  def player_region_forbid?(x, y, d)
    return false unless self.is_a?(Game_Player)
    return false if debug_through?
    region = 0
    case d
    when 1; region = $game_map.region_id(x-1, y+1)
    when 2; region = $game_map.region_id(x+0, y+1)
    when 3; region = $game_map.region_id(x+1, y+1)
    when 4; region = $game_map.region_id(x-1, y+0)
    when 5; region = $game_map.region_id(x+0, y+0)
    when 6; region = $game_map.region_id(x+1, y+0)
    when 7; region = $game_map.region_id(x-1, y-1)
    when 8; region = $game_map.region_id(x+0, y-1)
    when 9; region = $game_map.region_id(x+1, y-1)
    end
    return true if $game_map.all_restrict_regions.include?(region)
    return false if @through
    return $game_map.player_restrict_regions.include?(region)
  end
 
end # Game_CharacterBase
 
#==============================================================================
#
# ▼ End of File
#
#==============================================================================



Posté dans Forum - [Résolu] Entrer un nombre - Mémorisation du choix

Nérylis - posté le 22/12/2018 à 19:34:05. (149 messages postés)

Bien vu. En mettant la variable à 0 avant de lancer la commande Entrer un nombre, la valeur se met à 0 par défaut, ce qui fait plus propre.

Merci du coup de pouce. :sourire2

Posté dans Forum - [Résolu] Entrer un nombre - Mémorisation du choix

Nérylis - posté le 22/12/2018 à 17:29:53. (149 messages postés)

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

J'utilise dans un évènement la commande Entrer un nombre, pour choisir le nombre d'heures pour se reposer. Mais j'ai remarqué que lorsque je fais cet évènement plusieurs fois de suite, le jeu garde en mémoire la valeur que j'ai entrée précédemment. Est-ce qu'il est possible de désactiver cette mémorisation de valeur ?

Posté dans Forum - [VX ACE] Immobilier le héros

Nérylis - posté le 06/07/2018 à 19:25:09. (149 messages postés)

Contractuellement parlant, je pense pouvoir te répondre par un non négatif.

Posté dans Forum - [VX ACE] Immobilier le héros

Nérylis - posté le 06/07/2018 à 15:27:34. (149 messages postés)

Pas mal l'astuce. Merci pour le tuyau. :)

Posté dans Forum - [VX ACE] Immobilier le héros

Nérylis - posté le 06/07/2018 à 14:01:49. (149 messages postés)

Domaine concerné: Event
Logiciel utilisé: VX ACE
Bonjour,

Je suis en train de créer des passages scénarisés avec des dialogues entre plusieurs personnages. Mon but est d'avoir la caméra fixe à un point défini afin qu'on puisse voir les personnages bouger et se déplacer pour donner un peu de vie à la scène. Pour cela, je place le héros en invisible sur ce point stratégique. Le problème que je rencontre, c'est que si j'appuie sur les touches directionnelles entre les fenêtres de dialogue, le héros invisible se déplace et donc bouge la caméra. Est-ce que vous avez une astuce pour éviter ce problème ?

Posté dans Forum - [VX ACE] Carreaux obsurcissants

Nérylis - posté le 16/06/2018 à 23:26:03. (149 messages postés)

Coucou,

J'ai testé aussi de mon côté durant plusieurs heures. J'ai résolu le problème en agrandissant de plusieurs pixels la taille des blocs d'herbe, puis en recoupant ce qui dépassait. A la base, j'avais récupéré les ressources MV sur un seul et même site, puis tout redimensionné suivant les standards VX Ace. Du coup, c'est bizarre parce que c'est comme si les blocs d'herbe n'étaient pas assez gros et que c'est pour ça que ça a causé ce souci ? Niveau transparence, j'ai rien touché, j'ai juste changé la taille des fichiers et conservé le PNG.

Posté dans Forum - [VX ACE] Carreaux obsurcissants

Nérylis - posté le 16/06/2018 à 13:22:38. (149 messages postés)

Aucun script, et oui, le tileset est paramétré sur Carreaux obscurcissants.

Edit : Voici une démo, ça sera certainement plus parlant : http://www.mediafire.com/file/zo8soaqdba8ha58/Test.exe/file

Marcher dans l'herbe pour s'apercevoir du problème sur les bords inférieurs gauche et droit.

J'ai remarqué que j'ai le problème pour les trois premiers types d'herbe. Par contre, pour le quatrième type avec la neige, le souci ne se produit pas. Il faudrait chercher du côté de l'image Outside_A2 mais je ne vois pas comment identifier le problème pour le résoudre.

Posté dans Forum - [VX ACE] Carreaux obsurcissants

Nérylis - posté le 16/06/2018 à 12:35:39. (149 messages postés)

Domaine concerné: Tileset
Logiciel utilisé: VX ACE
Bonjour,

J'ai un petit problème. Lorsque je marche sur des tilesets obscurcissants comme les herbes, le personnage apparaît entièrement dans les coins d'herbe inférieurs. Comprenez que si je fais un carré d'herbe de 3x3 cases, les jambes du personnage disparaissent bien sur la première et la deuxième rangée. Par contre, sur la troisième rangée en bas, ça marche au centre, mais pas à droite ni à gauche. Quelqu'un a une idée du problème ?

Posté dans Forum - [VX ACE] Nouveau skill appris (Son SE)

Nérylis - posté le 30/04/2018 à 18:06:41. (149 messages postés)

Merci bien.

Posté dans Forum - [VX ACE] Nouveau skill appris (Son SE)

Nérylis - posté le 29/04/2018 à 19:46:09. (149 messages postés)

Domaine concerné: Script
Logiciel utilisé: VX ACE
Bonjour,

Question simple : comment on fait pour ajouter un son SE quand, en fin de combat, un personnage a appris un nouveau skill suite à son level-up ?

Posté dans Forum - [VX Ace] Espacement entre icône et nom

Nérylis - posté le 25/03/2018 à 15:20:40. (149 messages postés)

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

J'aimerais savoir dans quelle partie des scripts on peut changer l'espacement entre les icônes d'objets/armes/armures et le nom associé dans les menus.

Merci d'avance.

Posté dans Forum - [VX ACE] Limiter l'atterrissage d'un véhicule

Nérylis - posté le 13/03/2018 à 06:45:33. (149 messages postés)

Oui, les carreaux obscurcissants provoquent l'effet des forêts et après avoir testé, c'est ce paramétrage qui empêche le vaisseau de se poser. Donc, ce n'est pas possible de mettre cette option sur des collines. Du coup, je n'ai pas d'autre choix que de réutiliser le script de Galv en jouant sur les régions, et pas sur les numéros de tag terrain.

Merci pour ton aide.

Posté dans Forum - [VX ACE] Limiter l'atterrissage d'un véhicule

Nérylis - posté le 12/03/2018 à 23:11:48. (149 messages postés)

Sauf qu'après, je pourrais poser l'aéronef sur les forêts.

Ce que tu dis sur les positions, c'est forcément paramétré quelque part. Ça ne se fait pas tout seul sur les positions 5 et 7.

Posté dans Forum - [VX ACE] Limiter l'atterrissage d'un véhicule

Nérylis - posté le 12/03/2018 à 22:42:57. (149 messages postés)

Merci pour les explication, mais j'utilise déjà les numéros de terrain pour un event général dans mon projet. Là, on en revient à utiliser le script indiqué plus haut que j'utilisais à une époque et que je ne souhaite plus avoir.

Ce que je ne comprends pas, c'est qu'il doit bien y avoir quelque chose qui définit que les forêts empêchent l'atterrissage de l'aéronef. Je pense que le mieux serait de saisir comment c'est défini et l'étendre aux collines (certainement un paramètre à modifier quelque part, mais lequel ?).

Posté dans Forum - [VX ACE] Limiter l'atterrissage d'un véhicule

Nérylis - posté le 12/03/2018 à 20:21:38. (149 messages postés)

Je suis censé faire quoi avec ces lignes de script ? Je ne comprends pas ce que je dois faire.

Posté dans Forum - [VX ACE] Limiter l'atterrissage d'un véhicule

Nérylis - posté le 12/03/2018 à 06:29:23. (149 messages postés)

Pourtant, ça doit être configuré quelque part dans les scripts de base qu'on ne peut pas se poser sur les forêts. En théorie, il suffirait de rajouter les tiles des collines. Reste à savoir où est-ce que ça se trouve dans les scripts.

Posté dans Forum - [VX ACE] Limiter l'atterrissage d'un véhicule

Nérylis - posté le 11/03/2018 à 22:32:36. (149 messages postés)

Domaine concerné: Event
Logiciel utilisé: VX ACE
Bonsoir,

J'ai une question de débutant.^^
Comment faire pour que l'aéronef ne puisse pas se poser sur les collines ?
J'aimerais en gros que les collines soient comme les forêts (que le personnage puisse marcher dessus mais qu'on ne puisse pas s'y poser en aéronef).

Posté dans Forum - Dragon's Power - Trailer

Nérylis - posté le 04/05/2017 à 19:06:06. (149 messages postés)

Oui, merci le mirudien. Tu as parfaitement compris l'objectif du projet.
Je compte me servir de cette base technique pour me lancer dans un vrai jeu soigné.

Posté dans Forum - Dragon's Power - Trailer

Nérylis - posté le 03/05/2017 à 22:45:02. (149 messages postés)

Oups, en effet. Ça devrait être mieux maintenant.

Posté dans Forum - Dragon's Power - Trailer

Nérylis - posté le 03/05/2017 à 18:07:55. (149 messages postés)

Coucou tout le monde,

Après 2 ans et demi de manipulations et de tests sur RPG Maker, j'ai enfin pu réaliser et finir mon jeu test.

A l'origine, il s'agissait de faire un test grandeur nature pour apprendre à me servir du logiciel et de ses multiples fonctions. Je voulais créer mon propre système avec des menus spécifiques, diverses méthodes pour améliorer ses personnages... Bref, je voulais me faire une démo complète avec un temps de jeu réaliste pour comprendre comment gérer les heures de partie.

Et aujourd'hui, c'est fait. J'ai terminé mon test, procédé aux derniers réglages et j'en ai profité pour créer un trailer dans lequel on voit un peu la tête du jeu et ses possibilités.

Le lien est ici : http://www.youtube.com/watch?v=6oAQc6uiZoE

J'aimerais connaître votre avis, vos ressentis sur cet aperçu.

A la base, je n'ai pas prévu de le proposer en test. Comme il s'agit d'un test fonctionnel, la partie scénaristique n'est pas développée. En gros, c'est du pex à 90-95% du temps, donc pas forcément intéressant. Cela dit, si plusieurs d'entre vous insistent pour essayer le jeu, je peux le proposer avec une véritable présentation.

Voilà. :)
A+

Posté dans Forum - [RPG Maker VX Ace] Jauge ATB pour LNX Battle

Nérylis - posté le 17/01/2017 à 20:05:08. (149 messages postés)

Mes astuces et mes remerciements sont réservés à ceux qui m'aident. Je regarde un peu les projets des autres mais c'est souvent loin de ce que j'aime.
Un financement ? Sur un forum d'entraide ouvert à tous ? Je ne suis pas un pigeon.

Edit : Je voulais présenter un projet, mais je me suis réservé à un test strictement fermé parmi des gens rigoureux, qui savent tester un jeu dans tous les recoins. La communauté de RPG Maker ne rime pas avec rigueur malheureusement.

Posté dans Forum - [RPG Maker VX Ace] Jauge ATB pour LNX Battle

Nérylis - posté le 17/01/2017 à 19:06:18. (149 messages postés)

Merci.
Vous pouvez clore le topic, si la communauté principale FR n'a pas les compétences pour traiter cette demande. Dommage qu'un si bon outil comme RPG Maker ne soit pas mieux exploité par sa communauté. La vision qu'en ont les gens serait tout autre.

Posté dans Forum - [RPG Maker VX Ace] Jauge ATB pour LNX Battle

Nérylis - posté le 17/01/2017 à 17:41:29. (149 messages postés)

Vous servez à rien alors.

Posté dans Forum - [RPG Maker VX Ace] Jauge ATB pour LNX Battle

Nérylis - posté le 17/01/2017 à 06:29:18. (149 messages postés)

J'attends toujours une réponse et une solution.

Posté dans Forum - [RPG Maker VX Ace] Maîtrise des types d'armes

Nérylis - posté le 04/08/2016 à 14:17:17. (149 messages postés)

Solution donnée en externe. La voici pour info :

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
=begin
##############################################################
Weapon_Upgrade
####
Vincent26
####
Description:
Ce script permet de monter en level pour l'utilisation de catégorie d'armes.
Le principe est que chaque coup donné avec un type d'armes particulier augmente
son expérience. Une fois un niveau passé, le personnage reçoit une amélioration
définitive d'une de ses caractéristiques.
Un menu secondaire est ajouté au menu status à l'appui de la touche Shift.
Le niveau de compétence pour une arme du héros est associé à un nom descriptif.
####
Utilisation :
Configurer le module suivant pour mettre en place ce script.
=end
module Weapon_Upgrade
 
  #Ne pas modifier
  CARACTERISTIQUE = {:max_hp => 0,:max_mp => 1,:force => 2,:defense => 3,
                    :magic_atk => 4,:magic_def => 5,:agilité => 6,:chance => 7}
 
  #LISTE DES TYPES D'ARMES DANS LE LEXIQUE DE LA BDD
  #
  #
  # Liste des upgrades des types d'armes :
  # TYPE => [[NBR_COUP,VALEUR,CARACTERISTIQUE,[ID_PERSONNAGE]],...]
  #
  # TYPE est le type d'arme (l'id associé dans la BDD)
  # VALEUR est la valeur à ajouter à la caractéristique du perso
  # CARACTERISTIQUE est la caractéristique à modifier
  # ID_PERSONNAGE est la liste des personnages à qui peut s'appliquer cet upgrade
  UPGRADE_LIST = {
    1 => [[75,2,:force,[1,2,3,4,5,6,7,8,9,10]],                  #Hache
        [350,3,:force,[1,2,3,4,5,6,7,8,9,10]],
        [1000,5,:force,[1,2,3,4,5,6,7,8,9,10]],
        [1800,10,:force,[1,2,3,4,5,6,7,8,9,10]],
        [3000,15,:force,[1,2,3,4,5,6,7,8,9,10]],
        [4500,20,:force,[1,2,3,4,5,6,7,8,9,10]],
        [9999,50,:force,[1,2,3,4,5,6,7,8,9,10]]],
    2 => [[150,1,:agilité,[1,2,3,4,5,6,7,8,9,10]],               #Griffes
        [800,2,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [2100,3,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [3400,5,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [5100,8,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [7500,10,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [9999,20,:force,[1,2,3,4,5,6,7,8,9,10]]],
    3 => [[110,2,:agilité,[1,2,3,4,5,6,7,8,9,10]],               #Lance
        [525,3,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [1300,5,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [2200,10,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [3300,15,:agilité,[1,2,3,4,5,6,7,8,9,10]],        
        [5250,20,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [9999,50,:agilité,[1,2,3,4,5,6,7,8,9,10]]],
    4 => [[115,2,:force,[1,2,3,4,5,6,7,8,9,10]],                 #Epée
        [550,3,:force,[1,2,3,4,5,6,7,8,9,10]],
        [1325,5,:force,[1,2,3,4,5,6,7,8,9,10]],
        [2300,10,:force,[1,2,3,4,5,6,7,8,9,10]],
        [3500,15,:force,[1,2,3,4,5,6,7,8,9,10]],        
        [5350,20,:force,[1,2,3,4,5,6,7,8,9,10]],
        [9999,50,:force,[1,2,3,4,5,6,7,8,9,10]]],
    5 => [[100,2,:force,[1,2,3,4,5,6,7,8,9,10]],                 #Katana
        [500,3,:force,[1,2,3,4,5,6,7,8,9,10]],
        [1200,5,:force,[1,2,3,4,5,6,7,8,9,10]],
        [2000,10,:force,[1,2,3,4,5,6,7,8,9,10]],
        [3250,15,:force,[1,2,3,4,5,6,7,8,9,10]],
        [5000,20,:force,[1,2,3,4,5,6,7,8,9,10]],
        [9999,50,:force,[1,2,3,4,5,6,7,8,9,10]]],
    6 => [[120,2,:agilité,[1,2,3,4,5,6,7,8,9,10]],               #Arc
        [600,3,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [1400,5,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [2400,10,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [3800,15,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [5500,20,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [9999,50,:agilité,[1,2,3,4,5,6,7,8,9,10]]],
    7 => [[135,2,:agilité,[1,2,3,4,5,6,7,8,9,10]],               #Dague
        [750,3,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [1600,5,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [2800,10,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [4400,15,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [6500,20,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [9999,50,:agilité,[1,2,3,4,5,6,7,8,9,10]]],
    8 => [[65,2,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],              #Massue
        [300,3,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],
        [900,5,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],
        [1650,10,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],
        [2450,15,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],        
        [3750,20,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],
        [9999,50,:magic_atk,[1,2,3,4,5,6,7,8,9,10]]],
    9 => [[50,2,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],              #Bâton
        [250,3,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],
        [850,5,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],
        [1500,10,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],
        [2350,15,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],        
        [3450,20,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],
        [9999,50,:magic_atk,[1,2,3,4,5,6,7,8,9,10]]],
  10 => [[125,1,:agilité,[1,2,3,4,5,6,7,8,9,10]],                #Arme à feu
        [650,2,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [1450,3,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [2500,5,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [4000,8,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [6000,10,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [9999,20,:force,[1,2,3,4,5,6,7,8,9,10]]],
    }
 
  #Nombre de types d'armes
  NBR_TYPE_ARME = 10
 
  #Liste des types d'armes
  LIST_TYPE_ARME = ["Hache","Griffes","Lance","Epée","Katana","Arc","Dague",
                    "Massue","Bâton","Arme à feu"]
 
  #Description des levels de maitrîse
  LVL_DESCRIPTION = { 1 => {0=>"Néophyte",                       #Hache 
                            75=>"Initié",                
                            350=>"Apprenti",
                            1000=>"Confirmé",            
                            1800=>"Expert",
                            3000=>"Prodige",
                            4500=>"Maître",
                            9999=>"Légende"},
 
                      2 => {0=>"Néophyte",                       #Griffes 
                            150=>"Initié",                  
                            800=>"Apprenti",                                       
                            2100=>"Confirmé",                                                   
                            3400=>"Expert",              
                            5100=>"Prodige",             
                            7500=>"Maître",                                                    
                            9999=>"Légende"},           
 
                      3 => {0=>"Néophyte",                       #Lance
                            110=>"Initié",                
                            525=>"Apprenti",
                            1300=>"Confirmé",            
                            2200=>"Expert",
                            3300=>"Prodige",
                            5250=>"Maître",
                            9999=>"Légende"},
      
                      4 => {0=>"Néophyte",                       #Epée
                            115=>"Initié",                
                            550=>"Apprenti",
                            1325=>"Confirmé",            
                            2300=>"Expert",
                            3500=>"Prodige",
                            5350=>"Maître",
                            9999=>"Légende"},
       
                      5 => {0=>"Néophyte",                       #Katana
                            100=>"Initié",                
                            500=>"Apprenti",
                            1200=>"Confirmé",            
                            2000=>"Expert",
                            3250=>"Prodige",
                            5000=>"Maître",
                            9999=>"Légende"},
                      
                      6 => {0=>"Néophyte",                       #Arc
                            120=>"Initié",                
                            600=>"Apprenti",
                            1400=>"Confirmé",            
                            2400=>"Expert",
                            3800=>"Prodige",
                            5500=>"Maître",
                            9999=>"Légende"},
      
                      7 => {0=>"Néophyte",                       #Dague
                            135=>"Initié",                
                            750=>"Apprenti",
                            1600=>"Confirmé",            
                            2800=>"Expert",
                            4400=>"Prodige",
                            6500=>"Maître",
                            9999=>"Légende"},
      
                      8 => {0=>"Néophyte",                       #Massue
                            65=>"Initié",                
                            300=>"Apprenti",
                            900=>"Confirmé",            
                            1650=>"Expert",
                            2450=>"Prodige",
                            3750=>"Maître",
                            9999=>"Légende"},
      
                      9 => {0=>"Néophyte",                       #Bâton
                            50=>"Initié",                
                            250=>"Apprenti",
                            850=>"Confirmé",            
                            1500=>"Expert",
                            2350=>"Prodige",
                            3450=>"Maître",
                            9999=>"Légende"},
                      
                     10 => {0=>"Néophyte",                       #Arme à feu
                            125=>"Initié",                
                            650=>"Apprenti",
                            1450=>"Confirmé",            
                            2500=>"Expert",
                            4000=>"Prodige",
                            6000=>"Maître",
                            9999=>"Légende"}}
                                           
  #Pour définir une autre attaque que celle de base pour le décompte des points,
  #ajouter cela dans la note d'un personnage :
  #<Basic_Skill = ID>
  #ID est l'id de la compétence prise pour base
 
end
class Scene_Battle
 
  alias start_weapon_upgrade start
  def start
    @attaque_standard = false
    start_weapon_upgrade
  end
 
  alias use_item_weapon_upgrade use_item
  def use_item
    @attaque_standard = false
    item = @subject.current_action.item
    if @subject.actor?
      if @subject.actor.note =~ /<Basic_Skill = (\d+)>/
        skill_id = $1.to_i
        @attaque_standard = true if item.id == skill_id
      else
        @attaque_standard = true if item.animation_id < 0
      end
    end
    use_item_weapon_upgrade
  end
 
  alias apply_item_effects_weapon_uprade apply_item_effects
  def apply_item_effects(target, item)
    apply_item_effects_weapon_uprade(target, item)
    if target.result.hit? && target.result.success && @attaque_standard
      if @subject.actor?
        @subject.upgrade_weapon_skill
      end
    end
  end
 
end
module BattleManager
 
  class << self
  
    alias gain_exp_weapon_update gain_exp
    alias process_abort_weapon_update process_abort
  
    def gain_exp
      gain_exp_weapon_update
      new = false
      for i in $game_party.members
        for j in i.texte_fin_combat
          $game_message.new_page if new = false
          new = true
          $game_message.add(j)
          $game_message.set_options_on_last_add(:sound=> RPG::SE.new("Wind10"), :wait=>60, :input=>true)
        end
        i.texte_fin_combat = []
      end
    end
  
    def process_abort
      new = false
      for i in $game_party.members
        for j in i.texte_fin_combat
          $game_message.new_page if new = false
          new = true
          $game_message.add(j)
          $game_message.set_options_on_last_add(:sound=> RPG::SE.new("Wind10"), :wait=>60, :input=>true)
        end
        i.texte_fin_combat = []
      end
      process_abort_weapon_update
    end
  end
end
class Game_Actor
 
  attr_reader :upgrade_list
  attr_accessor :texte_fin_combat
 
  alias initialize_weapon_upgrade initialize
  def initialize(actor_id)
    initialize_weapon_upgrade(actor_id)
    @weapon_upgrade = {}
    @texte_fin_combat = []
    @upgrade_list = {}
    Weapon_Upgrade::UPGRADE_LIST.each do |key,value|
      li = []
      for list in value
        if list[3].include?(actor_id)
          li.push([list[0],list[1],list[2],true])
        end
      end
      @upgrade_list[key] = li if li != []
    end
  end
 
  def upgrade_weapon_skill
    for i in 1..Weapon_Upgrade::NBR_TYPE_ARME
      if wtype_equipped?(i)
        @weapon_upgrade[i.to_s] = 0 if !@weapon_upgrade.include?(i.to_s)
        @weapon_upgrade[i.to_s] += 1
        test_upgrade_weapon(i)
      end
    end
  end
 
  def level_up_weapon(name,lvl)
    id = (Weapon_Upgrade::LIST_TYPE_ARME.index(name)+1).to_s
    @weapon_upgrade[id] = 0 if !@weapon_upgrade.include?(id)
    @weapon_upgrade[id] += lvl
    @upgrade_list.each do |key,lis|
    next if key.to_s != id
      for j in 0..lis.length-1
      liste = lis[j]
        if liste[3]
          if @weapon_upgrade[id.to_s] >= liste[0]
          param = Weapon_Upgrade::CARACTERISTIQUE[liste[2]]
          add_param(param, liste[1])
          @upgrade_list[key][j][3] = false
          end
        end
      end
    end
  end
 
  def weapon_upgrade
    return @weapon_upgrade
  end
 
  def test_upgrade_weapon(id)
    @upgrade_list.each do |key,lis|
      next if key != id
      for j in 0..lis.length-1
        liste = lis[j]
        if liste[3]
          if @weapon_upgrade[id.to_s] >= liste[0]
            param = Weapon_Upgrade::CARACTERISTIQUE[liste[2]]
            add_param(param, liste[1])
                    #NOMPERSO          |              NOUVEAU RANG                  |        |        NOM ARME              |                      | NOM DU PARAMETRE|    | VALEUR AUG |
            @texte_fin_combat.push(@name +" devient "+Weapon_Upgrade::LVL_DESCRIPTION[id][liste[0]].to_s+" en "+Weapon_Upgrade::LIST_TYPE_ARME[id-1]+ ", "+Vocab.param(param)+" +"+liste[1].to_s+".")
            @upgrade_list[key][j][3] = false
          end
        end
      end
    end
  end
end
class Scene_Status
 
 
  alias update_weapon_upgrade update
  def update
    if Input.trigger?(:UP) && @item_window.menu == 1
      Sound.play_cursor
      @item_window.ligne_actuel -= 1
      @item_window.refresh
    elsif Input.trigger?(:DOWN) && @item_window.menu == 1
      Sound.play_cursor
      @item_window.ligne_actuel += 1
      @item_window.refresh
    end
    if Input.trigger?(:B) && @item_window.menu == 1
      Sound.play_cancel
      @item_window.menu = 0
      @command_window.activate
    else
      update_weapon_upgrade
    end
  end
 
  alias terminate_vincent26_weapon_type terminate
  def terminate
    terminate_vincent26_weapon_type
    $game_temp.scene_status_index = nil
  end
 
  def maitrise_commande
    if @item_window.line_nbr_max == 0
      @item_window.menu = 0
      @command_window.activate
    else
      @item_window.menu = 1
    end
  end
 
end
class Window_StatusItem < Window_Base
 
  attr_accessor :menu
  attr_reader :ligne_actuel
 
  NRB_LINE = 7
 
 
  alias initialize_weapon_upgrade initialize
  def initialize(*args)
    @ligne_actuel = 0
    @table_upgrade = []
    @menu = 0
    initialize_weapon_upgrade(*args)
  end
 
  def ligne_actuel=(value)
    table = []
    for feat in @actor.class.features
      if feat.code == 51
        table.push(feat.data_id)
      end
    end
    table.uniq!
    @ligne_actuel = [[value,table.length-NRB_LINE].min,0].max
  end
 
  def line_nbr_max
    table = []
    for feat in @actor.class.features
      if feat.code == 51
        table.push(feat.data_id)
      end
    end
    table.uniq!
    [table.length-NRB_LINE,0].max
  end
 
  alias contents_height_weapon_upgrade contents_height
  def contents_height
    if @upgrade_weapon_contents
      @table_upgrade.length*24+24
    else
      contents_height_weapon_upgrade
    end
  end
 
  alias refresh_weapon_upgrade refresh
  def refresh
    @upgrade_weapon_contents = false
    create_contents
    refresh_weapon_upgrade
  end
 
  def maitrise_enable
    actif = self.line_nbr_max() != 0
    return actif
  end
  
  def draw_maitrise_block
    if @actor_save != @actor
      @ligne_actuel = 0
      @actor_save = @actor
    end
    
    table = []
    for feat in @actor.class.features
      if feat.code == 51
        table.push(feat.data_id)
      end
    end
    table.uniq!
    @table_upgrade = table
    @upgrade_weapon_contents = true
    create_contents
    y = @ligne_actuel*24
    self.oy = y
    draw_arme_usable(32,y,table)
    draw_arme_lvl(270,y,table)
    draw_arme_param(380,y,table)
    draw_arme_rang(150,y,table)
  end
 
 
  def draw_arme_rang(x,y,table)
    for i in 0..table.length
      next if i > NRB_LINE
      if i != 0
        nbr = @actor.weapon_upgrade[table[i-1+@ligne_actuel].to_s] || 0
        rang = Weapon_Upgrade::LVL_DESCRIPTION[table[i-1+@ligne_actuel]][0]
        Weapon_Upgrade::LVL_DESCRIPTION[table[i-1+@ligne_actuel]].each do |key , value|
          break if nbr < key
          rang = value
        end
        rang = "" if !Weapon_Upgrade::UPGRADE_LIST.has_key?(table[i-1+@ligne_actuel])
      else
        rang = "Rang"
      end
      if rang == "Rang"
        change_color(system_color)
        draw_text(126, y+i*line_height, 140, line_height, rang, 1)
      else
        if rang == "Légende"
          change_color(text_color(17))
          draw_text(126, y+i*line_height, 140, line_height, rang, 1)
        else
          change_color(normal_color)
          draw_text(126, y+i*line_height, 140, line_height, rang, 1)
        end
      end
    end
  end
 
  def draw_arme_param(x,y,table)
    for i in 0..table.length
      next if i > NRB_LINE
      if i != 0
        if @actor.upgrade_list.has_key?(table[i-1+@ligne_actuel])
          for j in @actor.upgrade_list[table[i-1+@ligne_actuel]]
            if j[3] == true
              value = j[1]
              param = Weapon_Upgrade::CARACTERISTIQUE[j[2]]
              texte = Vocab::param(param)+" +"+value.to_s
              break
            end
            texte = "-"
          end
        else
          texte = "-"
        end
      else
        texte = "Obtention"
      end
      if texte == "Obtention"
        change_color(system_color)
        draw_text(378, y+i*line_height, 140, line_height, texte, 1)
      else
        if texte == "-"
          change_color(text_color(17))
          draw_text(378, y+i*line_height, 140, line_height, texte, 1)
        else
          change_color(normal_color)
          draw_text(378, y+i*line_height, 140, line_height, texte, 1)          
        end
      end
    end
  end
 
  def draw_arme_usable(x,y,table)
    for i in 0..table.length
      if i != 0
        next if i > NRB_LINE
        texte = Weapon_Upgrade::LIST_TYPE_ARME[table[i-1+@ligne_actuel]-1]
        nbr = @actor.weapon_upgrade[table[i-1+@ligne_actuel].to_s] || 0
        rang = Weapon_Upgrade::LVL_DESCRIPTION[table[i-1+@ligne_actuel]][0]
        Weapon_Upgrade::LVL_DESCRIPTION[table[i-1+@ligne_actuel]].each do |key , value|
          break if nbr < key
          rang = value
        end
      else
        texte = "Type arme"
      end
      if texte == "Type arme"
        change_color(system_color)
        draw_text(0, y+i*line_height, 140, line_height, texte, 1)
      else
        if rang == "Légende"
          change_color(text_color(17))
          draw_text(0, y+i*line_height, 140, line_height, texte, 1)
        else
          change_color(normal_color)
          draw_text(0, y+i*line_height, 140, line_height, texte, 1)          
        end
      end
    end
  end
 
  def draw_arme_lvl(x,y,table)
    for i in 0..table.length
      if i != 0
        next if i > NRB_LINE
        nbr = @actor.weapon_upgrade[table[i-1+@ligne_actuel].to_s] || 0
        if @actor.upgrade_list.has_key?(table[i-1+@ligne_actuel])
          for j in @actor.upgrade_list[table[i-1+@ligne_actuel]]
            if j[3] == true
              lvl = j[0]
              texte = nbr.to_s+"/"+lvl.to_s
              break
            end
            texte = "Max"
          end
        else
          texte = "Max"
        end
      else
        texte = "Points"
      end
      if texte == "Points"
        change_color(system_color)
        draw_text(252, y+i*line_height, 140, line_height , texte, 1)
      else
        if texte == "Max"
          change_color(text_color(17))
          draw_text(252, y+i*line_height, 140, line_height, texte, 1)
        else
          change_color(normal_color)
          draw_text(252, y+i*line_height, 140, line_height, texte, 1)
        end
      end
    end
  end
  
end
 
class Game_Interpreter
 
  def get_rang_lvl_actor(id, weapon_id)
    nbr = $game_actors[id].weapon_upgrade[weapon_id.to_s] || 0
    rang = Weapon_Upgrade::LVL_DESCRIPTION[weapon_id][0]
    Weapon_Upgrade::LVL_DESCRIPTION[weapon_id].each do |key , value|
      break if nbr < key
      rang = value
    end
    rang = "" if !Weapon_Upgrade::UPGRADE_LIST.has_key?(weapon_id)
    return rang
  end
 
  def get_rang_lvl_member(id, weapon_id)
    nbr = $game_party.members[id].weapon_upgrade[weapon_id.to_s] || 0
    rang = Weapon_Upgrade::LVL_DESCRIPTION[weapon_id][0]
    Weapon_Upgrade::LVL_DESCRIPTION[weapon_id].each do |key , value|
      break if nbr < key
      rang = value
    end
    rang = "" if !Weapon_Upgrade::UPGRADE_LIST.has_key?(weapon_id)
    return rang
  end
 
end



Posté dans Forum - [RPG Maker VX Ace] Maîtrise des types d'armes

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

Effectivement, on peut essayer.

Donc voilà ce que arttroy avait commencé. Si quelqu'un sait comment finaliser.

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
=begin
##############################################################
Weapon_Upgrade
####
Vincent26
####
Description:
Ce script permet de monter en level pour l'utilisation de catégorie d'armes.
Le principe est que chaque coup donné avec un type d'armes particulier augmente
son expérience. Une fois un niveau passé, le personnage reçoit une amélioration
définitive d'une de ses caractéristiques.
Un menu secondaire est ajouté au menu status à l'appui de la touche Shift.
Le niveau de compétence pour une arme du héros est associé à un nom descriptif.
####
Utilisation :
Configurer le module suivant pour mettre en place ce script.
=end
module Weapon_Upgrade
 
  #Ne pas modifier
  CARACTERISTIQUE = {:max_hp => 0,:max_mp => 1,:force => 2,:defense => 3,
                    :magic_atk => 4,:magic_def => 5,:agilité => 6,:chance => 7}
 
  #LISTE DES TYPES D'ARMES DANS LE LEXIQUE DE LA BDD
  #
  #
  # Liste des upgrades des types d'armes :
  # TYPE => [[NBR_COUP,VALEUR,CARACTERISTIQUE,[ID_PERSONNAGE]],...]
  #
  # TYPE est le type d'arme (l'id associé dans la BDD)
  # VALEUR est la valeur à ajouter à la caractéristique du perso
  # CARACTERISTIQUE est la caractéristique à modifier
  # ID_PERSONNAGE est la liste des personnages à qui peut s'appliquer cet upgrade
  UPGRADE_LIST = {
    1 => [[75,2,:force,[1,2,3,4,5,6,7,8,9,10]],                  #Hache
        [350,3,:force,[1,2,3,4,5,6,7,8,9,10]],
        [1000,5,:force,[1,2,3,4,5,6,7,8,9,10]],
        [1800,10,:force,[1,2,3,4,5,6,7,8,9,10]],
        [3000,15,:force,[1,2,3,4,5,6,7,8,9,10]],
        [4500,20,:force,[1,2,3,4,5,6,7,8,9,10]],
        [9999,50,:force,[1,2,3,4,5,6,7,8,9,10]]],
    2 => [[150,1,:agilité,[1,2,3,4,5,6,7,8,9,10]],               #Griffes
        [800,2,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [2100,3,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [3400,5,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [5100,8,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [7500,10,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [9999,20,:force,[1,2,3,4,5,6,7,8,9,10]]],
    3 => [[110,2,:agilité,[1,2,3,4,5,6,7,8,9,10]],               #Lance
        [525,3,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [1300,5,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [2200,10,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [3300,15,:agilité,[1,2,3,4,5,6,7,8,9,10]],        
        [5250,20,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [9999,50,:agilité,[1,2,3,4,5,6,7,8,9,10]]],
    4 => [[115,2,:force,[1,2,3,4,5,6,7,8,9,10]],                 #Epée
        [550,3,:force,[1,2,3,4,5,6,7,8,9,10]],
        [1325,5,:force,[1,2,3,4,5,6,7,8,9,10]],
        [2300,10,:force,[1,2,3,4,5,6,7,8,9,10]],
        [3500,15,:force,[1,2,3,4,5,6,7,8,9,10]],        
        [5350,20,:force,[1,2,3,4,5,6,7,8,9,10]],
        [9999,50,:force,[1,2,3,4,5,6,7,8,9,10]]],
    5 => [[100,2,:force,[1,2,3,4,5,6,7,8,9,10]],                 #Katana
        [500,3,:force,[1,2,3,4,5,6,7,8,9,10]],
        [1200,5,:force,[1,2,3,4,5,6,7,8,9,10]],
        [2000,10,:force,[1,2,3,4,5,6,7,8,9,10]],
        [3250,15,:force,[1,2,3,4,5,6,7,8,9,10]],
        [5000,20,:force,[1,2,3,4,5,6,7,8,9,10]],
        [9999,50,:force,[1,2,3,4,5,6,7,8,9,10]]],
    6 => [[120,2,:agilité,[1,2,3,4,5,6,7,8,9,10]],               #Arc
        [600,3,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [1400,5,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [2400,10,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [3800,15,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [5500,20,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [9999,50,:agilité,[1,2,3,4,5,6,7,8,9,10]]],
    7 => [[135,2,:agilité,[1,2,3,4,5,6,7,8,9,10]],               #Dague
        [750,3,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [1600,5,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [2800,10,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [4400,15,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [6500,20,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [9999,50,:agilité,[1,2,3,4,5,6,7,8,9,10]]],
    8 => [[65,2,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],              #Massue
        [300,3,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],
        [900,5,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],
        [1650,10,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],
        [2450,15,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],        
        [3750,20,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],
        [9999,50,:magic_atk,[1,2,3,4,5,6,7,8,9,10]]],
    9 => [[50,2,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],              #Bâton
        [250,3,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],
        [850,5,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],
        [1500,10,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],
        [2350,15,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],        
        [3450,20,:magic_atk,[1,2,3,4,5,6,7,8,9,10]],
        [9999,50,:magic_atk,[1,2,3,4,5,6,7,8,9,10]]],
  10 => [[125,1,:agilité,[1,2,3,4,5,6,7,8,9,10]],                #Arme à feu
        [650,2,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [1450,3,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [2500,5,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [4000,8,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [6000,10,:agilité,[1,2,3,4,5,6,7,8,9,10]],
        [9999,20,:force,[1,2,3,4,5,6,7,8,9,10]]],
    }
 
  #Nombre de type d'arme
  NBR_TYPE_ARME = 10
 
  #Liste des types d'armes
  LIST_TYPE_ARME = ["Hache","Griffes","Lance","Epée","Katana","Arc","Dague",
                    "Massue","Bâton","Arme à feu"]
 
  #Description des levels de maitrisse
  LVL_DESCRIPTION = {1 => {0=>"Néophyte",            
                      75=>"Initié",                
                      350=>"Apprenti",
                      1000=>"Confirmé",            #Hache
                      1800=>"Expert",
                      3000=>"Prodige",
                      4500=>"Maître",
                      9999=>"Légende"},
                      
                      2 => {0=>"Néophyte", 
                      150=>"Initié",                  
                      800=>"Apprenti",                                       
                      2100=>"Confirmé",            #Griffes                                        
                      3400=>"Expert",              
                      5100=>"Prodige",             
                      7500=>"Maître",                                                    
                      9999=>"Légende"},
                      
                      3 => {0=>"Néophyte",            
                      110=>"Initié",                
                      525=>"Apprenti",
                      1300=>"Confirmé",            #Lance
                      2200=>"Expert",
                      3300=>"Prodige",
                      5250=>"Maître",
                      9999=>"Légende"},
                      
                      4 => {0=>"Néophyte",            
                      115=>"Initié",                
                      550=>"Apprenti",
                      1325=>"Confirmé",            #Epée
                      2300=>"Expert",
                      3500=>"Prodige",
                      5350=>"Maître",
                      9999=>"Légende"},
                      
                      5 => {0=>"Néophyte",            
                      100=>"Initié",                
                      500=>"Apprenti",
                      1200=>"Confirmé",            #Katana
                      2000=>"Expert",
                      3250=>"Prodige",
                      5000=>"Maître",
                      9999=>"Légende"},
                                            
                      6 => {0=>"Néophyte",            
                      120=>"Initié",                
                      600=>"Apprenti",
                      1400=>"Confirmé",            #Arc
                      2400=>"Expert",
                      3800=>"Prodige",
                      5500=>"Maître",
                      9999=>"Légende"},
                      
                      7 => {0=>"Néophyte",            
                      135=>"Initié",                
                      750=>"Apprenti",
                      1600=>"Confirmé",            #Dague
                      2800=>"Expert",
                      4400=>"Prodige",
                      6500=>"Maître",
                      9999=>"Légende"},
 
                      8 => {0=>"Néophyte",            
                      65=>"Initié",                
                      300=>"Apprenti",
                      900=>"Confirmé",            #Massue
                      1650=>"Expert",
                      2450=>"Prodige",
                      3750=>"Maître",
                      9999=>"Légende"},
                      
                      9 => {0=>"Néophyte",            
                      50=>"Initié",                
                      250=>"Apprenti",
                      850=>"Confirmé",            #Bâton
                      1500=>"Expert",
                      2350=>"Prodige",
                      3450=>"Maître",
                      9999=>"Légende"},
                      
                      10 => {0=>"Néophyte",            
                      125=>"Initié",                
                      650=>"Apprenti",
                      1450=>"Confirmé",            #Arme à feu
                      2500=>"Expert",
                      4000=>"Prodige",
                      6000=>"Maître",
                      9999=>"Légende"}}           
                     
  #Pour définir une autre attaque que celle de base pour le décompte des point
  #ajouter cela dans la note d'un personnage :
  #<Basic_Skill = ID>
  #ID est l'id de la compétence prise pour base
 
end
class Scene_Battle
 
  alias start_weapon_upgrade start
  def start
    @attaque_standard = false
    start_weapon_upgrade
  end
 
  alias use_item_weapon_upgrade use_item
  def use_item
    @attaque_standard = false
    item = @subject.current_action.item
    if @subject.actor?
      if @subject.actor.note =~ /<Basic_Skill = (\d+)>/
        skill_id = $1.to_i
        @attaque_standard = true if item.id == skill_id
      else
        @attaque_standard = true if item.animation_id < 0
      end
    end
    use_item_weapon_upgrade
  end
 
  alias apply_item_effects_weapon_uprade apply_item_effects
  def apply_item_effects(target, item)
    apply_item_effects_weapon_uprade(target, item)
    if target.result.hit? && target.result.success && @attaque_standard
      if @subject.actor?
        @subject.upgrade_weapon_skill
      end
    end
  end
 
end
module BattleManager
 
  class << self
  
    alias gain_exp_weapon_update gain_exp
    alias process_abort_weapon_update process_abort
  
    def gain_exp
      new = false
      for i in $game_party.members
        for j in i.texte_fin_combat
          $game_message.new_page if new = false
          new = true
          $game_message.add(j)
       #   $game_message.set_options_on_last_add(:sound=> RPG::SE.new("Wind10"), :wait=>60, :input=>true)
        end
        i.texte_fin_combat = []
      end
      gain_exp_weapon_update
    end
  
    def process_abort
      new = false
      for i in $game_party.members
        for j in i.texte_fin_combat
          $game_message.new_page if new = false
          new = true
          $game_message.add(j)
        #  $game_message.set_options_on_last_add(:sound=> RPG::SE.new("Wind10"), :wait=>60, :input=>true)
        end
        i.texte_fin_combat = []
      end
      process_abort_weapon_update
    end
  end
end
class Game_Actor
 
  attr_reader :upgrade_list
  attr_accessor :texte_fin_combat
 
  alias initialize_weapon_upgrade initialize
  def initialize(actor_id)
    initialize_weapon_upgrade(actor_id)
    @weapon_upgrade = {}
    @texte_fin_combat = []
    @upgrade_list = {}
    Weapon_Upgrade::UPGRADE_LIST.each do |key,value|
      li = []
      for list in value
        if list[3].include?(actor_id)
          li.push([list[0],list[1],list[2],true])
        end
      end
      @upgrade_list[key] = li if li != []
    end
  end
 
  def upgrade_weapon_skill
    for i in 1..Weapon_Upgrade::NBR_TYPE_ARME
      if wtype_equipped?(i)
        @weapon_upgrade[i.to_s] = 0 if !@weapon_upgrade.include?(i.to_s)
        @weapon_upgrade[i.to_s] += 1
        test_upgrade_weapon(i)
      end
    end
  end
 
  def level_up_weapon(name,lvl)
    id = (Weapon_Upgrade::LIST_TYPE_ARME.index(name)+1).to_s
    @weapon_upgrade[id] = 0 if !@weapon_upgrade.include?(id)
    @weapon_upgrade[id] += lvl
    @upgrade_list.each do |key,lis|
    next if key.to_s != id
      for j in 0..lis.length-1
      liste = lis[j]
        if liste[3]
          if @weapon_upgrade[id.to_s] >= liste[0]
          param = Weapon_Upgrade::CARACTERISTIQUE[liste[2]]
          add_param(param, liste[1])
          @upgrade_list[key][j][3] = false
          end
        end
      end
    end
  end
 
  def weapon_upgrade
    return @weapon_upgrade
  end
 
  def test_upgrade_weapon(id)
    @upgrade_list.each do |key,lis|
      next if key != id
      for j in 0..lis.length-1
        liste = lis[j]
        if liste[3]
          if @weapon_upgrade[id.to_s] >= liste[0]
            param = Weapon_Upgrade::CARACTERISTIQUE[liste[2]]
            add_param(param, liste[1])
                    #NOMPERSO          |              NOUVEAU RANG                  |        |        NOM ARME              |                      | NOM DU PARAMETRE|    | VALEUR AUG |
            @texte_fin_combat.push(@name +" devient "+Weapon_Upgrade::LVL_DESCRIPTION[id][0].to_s+" en "+Weapon_Upgrade::LIST_TYPE_ARME[id-1]+ ", "+Vocab.param(param)+" +"+liste[1].to_s+".")
            @upgrade_list[key][j][3] = false
          end
        end
      end
    end
  end
end
class Scene_Status
 
 
  alias update_weapon_upgrade update
  def update
    if Input.trigger?(:UP) && @item_window.menu == 1
      Sound.play_cursor
      @item_window.ligne_actuel -= 1
      @item_window.refresh
    elsif Input.trigger?(:DOWN) && @item_window.menu == 1
      Sound.play_cursor
      @item_window.ligne_actuel += 1
      @item_window.refresh
    end
    if Input.trigger?(:B) && @item_window.menu == 1
      Sound.play_cancel
      @item_window.menu = 0
      @command_window.activate
    else
      update_weapon_upgrade
    end
  end
 
  alias terminate_vincent26_weapon_type terminate
  def terminate
    terminate_vincent26_weapon_type
    $game_temp.scene_status_index = nil
  end
 
  def maitrise_commande
    if @item_window.line_nbr_max == 0
      @item_window.menu = 0
      @command_window.activate
    else
      @item_window.menu = 1
    end
  end
 
end
class Window_StatusItem < Window_Base
 
  attr_accessor :menu
  attr_reader :ligne_actuel
 
  NRB_LINE = 7
 
 
  alias initialize_weapon_upgrade initialize
  def initialize(*args)
    @ligne_actuel = 0
    @table_upgrade = []
    @menu = 0
    initialize_weapon_upgrade(*args)
  end
 
  def ligne_actuel=(value)
    table = []
    for feat in @actor.class.features
      if feat.code == 51
        table.push(feat.data_id)
      end
    end
    table.uniq!
    @ligne_actuel = [[value,table.length-NRB_LINE].min,0].max
  end
 
  def line_nbr_max
    table = []
    for feat in @actor.class.features
      if feat.code == 51
        table.push(feat.data_id)
      end
    end
    table.uniq!
    [table.length-NRB_LINE,0].max
  end
 
  alias contents_height_weapon_upgrade contents_height
  def contents_height
    if @upgrade_weapon_contents
      @table_upgrade.length*24+24
    else
      contents_height_weapon_upgrade
    end
  end
 
  alias refresh_weapon_upgrade refresh
  def refresh
    @upgrade_weapon_contents = false
    create_contents
    refresh_weapon_upgrade
  end
 
  def maitrise_enable
    actif = self.line_nbr_max() != 0
    return actif
  end
  
  def draw_maitrise_block
    if @actor_save != @actor
      @ligne_actuel = 0
      @actor_save = @actor
    end
    
    table = []
    for feat in @actor.class.features
      if feat.code == 51
        table.push(feat.data_id)
      end
    end
    table.uniq!
    @table_upgrade = table
    @upgrade_weapon_contents = true
    create_contents
    y = @ligne_actuel*24
    self.oy = y
    draw_arme_usable(32,y,table)
    draw_arme_lvl(270,y,table)
    draw_arme_param(380,y,table)
    draw_arme_rang(150,y,table)
  end
 
 
  def draw_arme_rang(x,y,table)
    for i in 0..table.length
      next if i > NRB_LINE
      if i != 0
        nbr = @actor.weapon_upgrade[table[i-1+@ligne_actuel].to_s] || 0
        rang = Weapon_Upgrade::LVL_DESCRIPTION[i][0]
        Weapon_Upgrade::LVL_DESCRIPTION[i].each do |key , value|
          break if nbr < key
          rang = value
        end
        rang = "" if !Weapon_Upgrade::UPGRADE_LIST.has_key?(table[i-1+@ligne_actuel])
      else
        rang = "Rang"
      end
      if rang == "Rang"
        change_color(system_color)
        draw_text(126, y+i*line_height, 140, line_height, rang, 1)
      else
        if rang == "Légende"
          change_color(text_color(17))
          draw_text(126, y+i*line_height, 140, line_height, rang, 1)
        else
          change_color(normal_color)
          draw_text(126, y+i*line_height, 140, line_height, rang, 1)
        end
      end
    end
  end
 
  def draw_arme_param(x,y,table)
    for i in 0..table.length
      next if i > NRB_LINE
      if i != 0
        if @actor.upgrade_list.has_key?(table[i-1+@ligne_actuel])
          for j in @actor.upgrade_list[table[i-1+@ligne_actuel]]
            if j[3] == true
              value = j[1]
              param = Weapon_Upgrade::CARACTERISTIQUE[j[2]]
              texte = Vocab::param(param)+" +"+value.to_s
              break
            end
            texte = "-"
          end
        else
          texte = "-"
        end
      else
        texte = "Obtention"
      end
      if texte == "Obtention"
        change_color(system_color)
        draw_text(378, y+i*line_height, 140, line_height, texte, 1)
      else
        if texte == "-"
          change_color(text_color(17))
          draw_text(378, y+i*line_height, 140, line_height, texte, 1)
        else
          change_color(normal_color)
          draw_text(378, y+i*line_height, 140, line_height, texte, 1)          
        end
      end
    end
  end
 
  def draw_arme_usable(x,y,table)
    for i in 0..table.length
      if i != 0
        next if i > NRB_LINE
        texte = Weapon_Upgrade::LIST_TYPE_ARME[table[i-1+@ligne_actuel]-1]
        nbr = @actor.weapon_upgrade[table[i-1+@ligne_actuel].to_s] || 0
        rang = Weapon_Upgrade::LVL_DESCRIPTION[i][0]
        Weapon_Upgrade::LVL_DESCRIPTION[i].each do |key , value|
          break if nbr < key
          rang = value
        end
      else
        texte = "Type arme"
      end
      if texte == "Type arme"
        change_color(system_color)
        draw_text(0, y+i*line_height, 140, line_height, texte, 1)
      else
        if rang == "Légende"
          change_color(text_color(17))
          draw_text(0, y+i*line_height, 140, line_height, texte, 1)
        else
          change_color(normal_color)
          draw_text(0, y+i*line_height, 140, line_height, texte, 1)          
        end
      end
    end
  end
 
  def draw_arme_lvl(x,y,table)
    for i in 0..table.length
      if i != 0
        next if i > NRB_LINE
        nbr = @actor.weapon_upgrade[table[i-1+@ligne_actuel].to_s] || 0
        if @actor.upgrade_list.has_key?(table[i-1+@ligne_actuel])
          for j in @actor.upgrade_list[table[i-1+@ligne_actuel]]
            if j[3] == true
              lvl = j[0]
              texte = nbr.to_s+"/"+lvl.to_s
              break
            end
            texte = "Max"
          end
        else
          texte = "Max"
        end
      else
        texte = "Points"
      end
      if texte == "Points"
        change_color(system_color)
        draw_text(252, y+i*line_height, 140, line_height , texte, 1)
      else
        if texte == "Max"
          change_color(text_color(17))
          draw_text(252, y+i*line_height, 140, line_height, texte, 1)
        else
          change_color(normal_color)
          draw_text(252, y+i*line_height, 140, line_height, texte, 1)
        end
      end
    end
  end
   
end
 
class Game_Interpreter
 
  def get_rang_lvl_actor(id, weapon_id)
    nbr = $game_actors[id].weapon_upgrade[weapon_id.to_s] || 0
    rang = Weapon_Upgrade::LVL_DESCRIPTION[weapon_id][0]
    Weapon_Upgrade::LVL_DESCRIPTION[weapon_id].each do |key , value|
      break if nbr < key
      rang = value
    end
    rang = "" if !Weapon_Upgrade::UPGRADE_LIST.has_key?(weapon_id)
    return rang
  end
 
  def get_rang_lvl_member(id, weapon_id)
    nbr = $game_party.members[id].weapon_upgrade[weapon_id.to_s] || 0
    rang = Weapon_Upgrade::LVL_DESCRIPTION[weapon_id][0]
    Weapon_Upgrade::LVL_DESCRIPTION[weapon_id].each do |key , value|
      break if nbr < key
      rang = value
    end
    rang = "" if !Weapon_Upgrade::UPGRADE_LIST.has_key?(weapon_id)
    return rang
  end
 
end



Edit : Notez que vous pouvez utiliser un event comme les hexagrammes blancs en haut à droite sur ma démo pour monter manuellement les points de maîtrise sans avoir besoin de combattre. Ainsi, vous pouvez vérifier que le grade et le bonus sont corrects via le menu Statut - Maîtrise.

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