-
Notifications
You must be signed in to change notification settings - Fork 0
/
event_printer.rb
2065 lines (2028 loc) · 102 KB
/
event_printer.rb
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
#==============================================================================
# Event Printer - RPG Maker VXace
#------------------------------------------------------------------------------
# Version 1.3.1 - 06/05/2015
# - Add class 'event_code' to HTML and BBcode outputs
# Version 1.3 - 04/11/2013
# - Bugfix on conditions variable - variable. Second variable wasn't the good one
# Version 1.2 - 18/05/2013
# - Changes to BBcode/HTML (for BilouCorp)
# Version 1.1 - 25/04/2013
# - Bugfix
# - BBcode is now 100% BBcode (Thanks to Joke - Biloucorp)
# Version 1.0 - 23/04/2013
# - Original Release VXace
#------------------------------------------------------------------------------
# Special thanks to Nuki, Grim (and the other members of Funkywork)
#------------------------------------------------------------------------------
# This system is designed to transform en event from RPG maker to a textual representation
# Two type of output are usable. You can chose to print it in a file or you can put this into your clipboard
# Three output format are available : raw (only text), BBcode and HTML.
#
# You can change colors into the Theme module
# Only accessible in test mode.
#------------------------------------------------------------------------------
# - How to use depending your level :
# - Newbie Just launch SceneManager.call(EventPrinter::Scene) or press F5 on title screen
#
# - Programmer You can build event with the build method EventPrinter::Event / CommonEvent / BattleEvent
# Example : EventPrinter::CommonEvent.build(id_event, id_map)
# (you always need a map id (reference to event names)
# Then you can use print_raw, print_bbcode, print_html, copy_raw, copy_bbcode, copy_html
#
# - Nuki No. Don't use this Nuki
#==============================================================================
if $TEST
module EventPrinter
#==============================================================================
# ** Theme module
#==============================================================================
module Theme
#--------------------------------------------------------------------------
# ** Get a certain color
#--------------------------------------------------------------------------
def self.get_color(color)
self.const_get(color.to_s.capitalize.intern)
end
#---------------------------------------------------------------------------------------------
# * Color constants
#---------------------------------------------------------------------------------------------
Nothing = "#FFFFFF"
Standard = "#000000"
Function = "#0000FF"
Events = "#800000"
Comments = "#00A000"
Musics = "#008080"
Battle = "#9000D0"
Game = "#2090FF"
Parameters = "#A0A0A0"
Text = "#000080"
Variables = "#FF0000"
Pictures = "#800080"
Manage = "#DC6E00"
System = "#FF00FF"
Script = "#808080"
Graphics = "#FF00A0"
Wait = "#C03000"
end
# End of Theme ------------------------------------------------------------------------------------------------
#==============================================================================
# ** Vocab module
#==============================================================================
module Vocab
#--------------------------------------------------------------------------
# Commands Vocab
#--------------------------------------------------------------------------
# Misc
Name = "[%s]"
Group = "%04d..%04d"
VariableName = "%04d:%s"
MoreOrLess = ["ou plus", "ou moins"]
Command = "| >"
Vehicle = ["Radeau", "Bateau", "Vaisseau"]
Operators = ["=", "+=", "-=", "*=", "/=", "%="]
Wait = "Attendre : %d Frames"
SwitchOnOff = ["Désactiver", "Activer"]
WaitEnd = ", Attendre"
# Battlers
Attributes = ["Niveau", "Expérience", "PV", "PM", "PV Maximum", "PM Maximum",
"Attaque", "Défense", "Magie", "Déf. Magique", "Agilité", "Chance"]
# Evenements
HeroEvent = "Héros"
ThisEvent = "Cet événement"
# Dialogues
Message = "Message :"
MessageParams = "%s, %s, %s, %s"
MessagePosition = ["Bas", "Milleu", "Haut"]
MessageDisplay = ["Normal", "Transparent", "Sombre"]
Void = "Ø"
Choices = "Afficher Choix :"
Choice = "Si %s - Faire"
CancelChoice = "Annulation"
EndChoice = "Fin - Choix"
GetVar = "Entrer un Nombre - Stocker dans la variable %s, %d Chiffre(s)"
SelectItem = "Sélection d'un objet : %s"
DisplayScrollingText = "Afficher un texte défilant :"
ScrollSpeed = "Vitesse %d"
DisableFastForward = ", Désactiver l'avance rapide"
# Operations on variables
Operation = "Opération :"
Switch = "Interrupteur"
LocalSwitch = "Interrupteur local"
OnOff = ["Activé", "Désactivé"]
Variable = "Variable"
ValueOfVariable = "(la valeur de la variable %s)"
RandomValue = "(valeur aléatoire entre %d et %d)"
NumberOf = "%s possédés"
EventParam = ["Coordonée X", "Coordonée Y", "Direction", "Coordonée X à l'écran", "Coordonée Y à l'écran"]
OtherVariable = ["ID de la carte", "Nombre de personnage dans l'équipe", "Argent possédé",
"Nombre total de pas", "Temps de jeu", "Chronomètre", "Nombre de sauvegardes", "Nombre de combats"]
IdOfAMember = "ID du %s membre"
OrdinalNumber = ["1er", "2ème", "3ème", "4ème", "5ème", "6ème", "7ème", "8ème"]
Chronometer = "Gestion du Chronomètre :"
LeChronometer = "le Chronomètre est"
Time = "à %d Minutes et %d Secondes"
Start = "Démarrer (" + Time + ")"
Stop = "Arrêter"
# Conditions
Condition = "Condition :"
ComparationOperator = ["==", ">=", "<=", ">", "<", "!="]
HeroConditions = ["est dans l'équipe", "a pour nom '%s'", "a comme classe %s", "a la compétence %s",
"est équipé avec l'arme %s", "est équipé avec l'armure %s", "est sous l'effet de statut %s"]
MoneyCondition = "l'argent possédé est de %d %s"
ItemCondition = "l'objet %s est possédé"
WeaponCondition = "l'arme %s est possédée%s"
ArmorCondition = "l'armure %s est possédée%s"
OrEquipped = ", ou équipée"
KeyCondition = "la touche %s est pressée"
VehicleCondition = "le véhicule [%s] est utilisé"
Present = "est présent"
ScriptCondition = "Script : %s"
Else = "Sinon"
EndCondition = "Fin - Condition"
# Functions
CommonEventCall = "Appeler Événement Commun :"
Loop = "Boucle"
EndLoop = "Fin - Boucle"
ExitLoop = "Sortir de la Boucle"
Goto = "Étiquette :"
GotoCall = "Aller à l'Étiquette :"
StopEvents = "Arrêter les évènements"
Comment = "Commentaire :"
# Music / Video
Music = "'%s', Volume : %d, Tempo : %d"
BGM = "Jouer BGM :"
MemorizeBGM = "Mémoriser la musique (BGM)"
RestartBGM = "Reprendre la musique (BGM)"
BGS = "Jouer BGS :"
ME = "Jouer ME :"
SE = "Jouer SE :"
StopBGM = "Arrêter en fondu de la BGM : %s Secondes"
StopBGS = "Arrêter en fondu du BGS : %s Secondes"
StopSE = "Arrêter SE"
PlayVideo = "Jouer une vidéo : '%s'"
# Battle
Battle = "Démarrer un combat : %s"
BattleIndexed = "(Indexé par [%04d])"
IfVictory = "Si Victoire - Faire"
IfFlee = "Si Fuite - Faire"
IfLoss = "Si Défaite - Faire"
EndBattle = "Fin - Combat"
AllEnemies = "Tous les ennemis"
Enemy = "[%d. %s]"
# Game
Shop = "Appeler magasin :"
EnterName = "Enter le nom d'un personnage : %s, %d Lettres"
OpenMenu = "Ouvrir le menu principal"
OpenSave = "Ouvrir le menu de sauvegarde"
GameOver = "Game Over"
ToTitle = "Retourner à l'écran titre"
# System
ModifyBGM = "Modifier BGM de combat :"
ModifyME = "Modifier ME de victoire :"
ModifiySave = "Modifier l'accès aux sauvegardes :"
ModifiyMenu = "Modifier l'accès au menu :"
ModifiyEncounter = "Modifier les rencontres :"
ModifiyFormation = "Formation de l'équipe :"
WindowColor = "Affichage du nom de la carte : %s"
ModifyHeroAppearance = "Modifier Apparence Personnage : %s, Charset:'%s', 0, Faceset:'%s', 0"
ModifyVehicleAppearance = "Modifier Apparence Véhicule : [%s], '%s', 0"
# Script
ScriptCall = "Appeler Script :"
# Manage
WholeTeam = "Équipe Entière"
ModifyMoney = "Modifier Argent :"
ModifyItem = "Modifier Objet :"
ModifyWeapon = "Modifier Armes :"
ModifyArmor = "Modifier Armures :"
ModifyParty = "Modifier l'équipe :"
ModifyTextWithIncluded = "%s, Inclure l'équipement"
ModifyPartyTextWithReset = "%s, Démarre au niveau initial"
ModifyHP = "Modifier PV :"
ModifyMP = "Modifier PM :"
ModifyStatus = "Modifier Status : %s,"
Recover = "Récupération complète :"
ModifyExperience = "Modifier Expérience : %s,"
ModifyLevel = "Modifier Niveau : %s,"
ModifyParameters = "Modifier Caractéristique : %s,"
ModifySkill = "Modifier Compétence : %s,"
ModifyEquipement = "Modifier Équipement : %s,"
ModifyHeroName = "Modifier Nom Personnnage : %s,"
ModifyHeroAlias = "Modifier Surnom Personnnage : %s,"
ModifyHeroClass = "Modifier Classe Personnage : %s,"
RestoreEnemy = "Récupération Complète - "
PlusOrMinus = ["+", "-"]
AddOrRemove = ["Ajouter", "Retirer"]
Equipement = ["Armes", "Bouclier", "Casque", "Armure", "Accessoire"]
# Battle
ModifyHPEnemy = "Modifier PV - Ennemi : %s,"
ModifyMPEnemy = "Modifier PM - Ennemi : %s,"
ModifyStatusEnemy = "Modifier Status - Ennemi : %s,"
RecoverEnemy = "Récupération Complète - Ennemi : %s"
RevealEnemy = "Apparition ennemi caché : %s"
MorphEnemy = "Transformer l'ennemi : %s en %s"
DisplayBattleAnimation = "Afficher animation de combat : %s,"
Battler = "Personnage n°%d"
LastTarget = "Dernière Cible"
RandomTarget = "Cible Aléatoire"
Target = "Cible n°%d"
ForceAction = "Forcer action : %s, %s, %s"
EndTheBattle = "Terminer le combat"
# Warp
Warp = "Téléporter l'équipe :"
PlaceVehicle = "Placer véhicule :"
PlaceEvent = "Placer événement : %s, %s"
SwapPositions = "échanger la position avec [%s]"
Position = ["(X: %03d, Y: %03d)", "X: [%04d], Y: [%04d]", "échanger la position avec %s"]
# Deplacement
IsLooking = "Regarde vers"
Direction = {0 => "", 2 => ", le Bas", 4 => ", la Gauche", 6 => ", la Droite", 8 => ", le Haut"}
# Input
Inputs = { 2 =>"Bas", 4 => "Gauche", 6 => "Droite", 8 => "Haut", 11 => "A", 12 => "B", 13 => "C", 14 => "X",
15 => "Y", 16 => "Z", 17 => "L", 18 => "R" }
# Move route
MoveEvent = "Déplacer évènement :"
MoveRouteParams = ["Répéter", "Ignorer action impossible", "Attendre la fin"]
MoveRouteCommands = ["", "Un pas vers le Bas", "Un pas vers la Gauche", "Un pas vers la Droite",
"Un pas vers le Haut", "Un pas vers Bas-Gauche", "Un pas vers Bas-Droite", "Un pas vers Haut-Gauche",
"Un pas vers Haut-Droite", "Un pas au Hasard", "Un pas vers le Héros", "Fuis le héros d'un pas",
"Un pas en Avant", "Un pas en Arrière", "Saut : %s en X, %s en Y", "Attendre : %d Frames",
"Regarde vers le Bas", "Regarde vers la Gauche", "Regarde vers la Droite", "Regarde vers le Haut",
"Quart de tour à Droite", "Quart de tour à Gauche", "Demi tour", "Quart de tour au Hasard",
"Regarde Direction Aléat.", "Regarde vers le héros", "Se détourne du héros", "Active Inter. : %04d",
"Désactive Inter. : %04d", "Modifier Vitesse. : %d", "Modifier Fréquence : %d", "Marche animée ON",
"Marche animée OFF", "Animé à l'arrêt ON", "Animé à l'arrêt OFF", "Direction fixe ON", "Direction fixe OFF",
"Passe-muraille ON", "Passe-muraille OFF", "Transparent ON", "Transparent OFF", "Modifier charset : %s",
"Modifier opacité : %d", "Modifier transp. : %s", "Jouer un SE : %s",
"Appeller Script : %s"]
# Visual
Caterpillar = "Chenille :"
RegroupCaterpillar = "Regrouper la chenille"
Transparency = ["Normale", "Éclaircie", "Obscurcie"]
ScrollMap = "Faire défiler la carte vers"
ScrollMapParams = "de %d carreaux, vitesse %d"
EnterExitVehicle = "Entrer/Sortir du véhicule"
Opacity = ["Transparent", "Opaque"]
SetOpacity = "Transparence du héros :"
DisplayAnimation = "Afficher une animation : Cible - %s,"
DisplayEmote = "Afficher une émoticône : Cible - %s,"
DeleteEvent = "Effacer cet événement"
Emotes = ["Exclamation", "Interrogation", "Note de Musique", "Coeur", "Colère",
"Goute", "Toile", "Silence", "Ampoule", "Zzz"]
# Appearance
None = "(aucun)"
# Visual Effects
Color = ["(R:%d,V:%d,B:%d,I:%d)", "(R:%d,V:%d,B:%d)"]
Tone = "(R:%d,V:%d,B:%d,G:%d)"
FadeIn = "Effacer l'écran en fondu"
FadeOut = "Afficher l'écran en fondu"
ScreenTone = "Ton de l'écran : %s, %d Frames%s"
FlashScreen = "Flasher l'écran : %s, %d Frames%s"
ShakeScreen = "Secouer l'écran : Force %d, Vitesse %d, %d Frames%s"
# Pictures
DisplayPicture = "Afficher une image : %d, '%s', %s %s, (%d%%,%d%%), %d, %s"
MovePicture = "Afficher une image : %d, '%s', %s %s, (%d%%,%d%%), %d, %s, %d Frames%s"
PositionPicture = [["H.G.", "Ctre"], ["(%d,%d)", "(X:[%04d], Y:[%04d])"]]
RotatePicture = "Rotation Image : %d, Vitesse %s%d"
TonePicture = "Ton Image : %d, %s, %d Frames%s"
DeletePicture = "Effacer Image : %d"
WeatherEffect = "Effet Météorologique : %s, %d Frames%s"
Weather = {none: "Aucun", rain: "Pluie, %d", storm: "Orage, %d", snow: "Neige, %d"}
# Graphics
DisplayMapName = "Affichage du nom de la carte :"
ChangeTileset = "Changer de tileset :"
ChangeBattleBack = ["Changer le fond de combat : %s", "Changer le fond de combat : %s & %s"]
ChangePanorama = "Changer de panorama : '%s'"
GetInformation = "Récupérer des informations : [%04d], %s,"
GetInformationCoord = ["(%03d,%03d)", "Variable [%04d][%04d]"]
#--------------------------------------------------------------------------
# Window Vocab
#--------------------------------------------------------------------------
module Windows
# Helper text for scene
Helper = ["Choisissez la map", "Choisissez le type", "Choisissez l'évènement", "Choisissez la page",
"Choisissez l'action à effectuer"]
# WindowType content
Types = {map: "Events", common: "Events commun", battle: "Events de combat"}
# WindowMode content
Modes = {print_raw: "En brut - Dans un fichier", copy_raw: "En brut - Dans le presse-papier",
print_bbcode: "En BBcode - Dans un fichier", copy_bbcode: "En BBcode - Dans le presse-papier",
print_html: "En HTML - Dans un fichier", copy_html: "En HTML - Dans le presse-papier"}
# Page Name for WindowPage
PageName = "Page n°%03d"
# Event Name for WindowEvent
EventName = "[%03d]%s"
end
end
# End of Vocab ------------------------------------------------------------------------------------------------
module Utilities
extend self
#--------------------------------------------------------------------------
# * Get switch name
#--------------------------------------------------------------------------
def switch_name(id)
return name(sprintf("%04d", id)) if $data_system.switches[id] == ""
name(sprintf(Vocab::VariableName, id, $data_system.switches[id]))
end
#--------------------------------------------------------------------------
# * Get variable name
#--------------------------------------------------------------------------
def variable_name(id)
return name(sprintf("%04d", id)) if $data_system.variables[id] == ""
name(sprintf(Vocab::VariableName, id, $data_system.variables[id]))
end
#--------------------------------------------------------------------------
# * Get the variable name
#--------------------------------------------------------------------------
def la_variable(id)
Vocab::Variable + " " + variable_name(id)
end
#--------------------------------------------------------------------------
# * Get group name
def group_name(id1, id2)
name(sprintf(Vocab::Group, id1, id2))
end
#--------------------------------------------------------------------------
# * Get group or uniq variable
#--------------------------------------------------------------------------
def group_or_uniq(id1, id2, switch = true)
if id1 == id2
switch ? switch_name(id1) : variable_name(id1)
else
group_name(id1, id2)
end
end
#--------------------------------------------------------------------------
# * Get Event Name
#--------------------------------------------------------------------------
def event_name(id, map)
case id
when -1; Vocab::HeroEvent
when 0; Vocab::ThisEvent
else; sprintf(Vocab::Name, map.events[id].name)
end
end
#--------------------------------------------------------------------------
# * Get the map name
#--------------------------------------------------------------------------
def map_name(id)
(load_data("Data/MapInfos.rvdata2").find { |map| map[1].parent_id = id })[1].name
end
#--------------------------------------------------------------------------
# * Get hero name
#--------------------------------------------------------------------------
def tileset_name(id)
$data_tilesets[id].name
end
#--------------------------------------------------------------------------
# * Get hero name
#--------------------------------------------------------------------------
def hero_name(id)
id == 0 ? Vocab::WholeTeam : name($data_actors[id].name)
end
#--------------------------------------------------------------------------
# * Get class name
#--------------------------------------------------------------------------
def class_name(id)
name($data_classes[id].name)
end
#--------------------------------------------------------------------------
# * Get a foe name (in battle)
def foe_name(id, event)
return Vocab::AllEnemies if id == -1
sprintf(Vocab::Enemy, id + 1, event.troop.empty? ? "" : enemy_name(event.troop[id].enemy_id, false))
end
#--------------------------------------------------------------------------
# * Get a certain type of item name
# **(type : 0 => Item, 1 => Weapon, 2 => Armor)
#--------------------------------------------------------------------------
def base_item_name(type, id)
type == 0 ? item_name(id) : equipement_name(type-1, id)
end
#--------------------------------------------------------------------------
# * Get item name
#--------------------------------------------------------------------------
def item_name(id)
name($data_items[id].name)
end
#--------------------------------------------------------------------------
# * Get skill name
#--------------------------------------------------------------------------
def skill_name(id)
name($data_skills[id].name)
end
#--------------------------------------------------------------------------
# * Get an certain type of equipement name
#--------------------------------------------------------------------------
def equipement_name(type, id)
return Vocab::None if id == 0
type == 0 ? weapon_name(id) : armor_name(id)
end
#--------------------------------------------------------------------------
# * Get weapon name
#--------------------------------------------------------------------------
def weapon_name(id)
name($data_weapons[id].name)
end
#--------------------------------------------------------------------------
# * Get armor name
#--------------------------------------------------------------------------
def armor_name(id)
name($data_armors[id].name)
end
#--------------------------------------------------------------------------
# * Get state name
#--------------------------------------------------------------------------
def state_name(id)
name($data_states[id].name)
end
#--------------------------------------------------------------------------
# * Get common event name
#--------------------------------------------------------------------------
def common_event_name(id)
name($data_common_events[id].name)
end
#--------------------------------------------------------------------------
# * Get animation name
#--------------------------------------------------------------------------
def animation_name(id)
name($data_animations[id].name)
end
#--------------------------------------------------------------------------
# * Get enemy name
#--------------------------------------------------------------------------
def enemy_name(id, with_brackets = true)
with_brackets ? name($data_enemies[id].name) : $data_enemies[id].name
end
#--------------------------------------------------------------------------
# * Put the string between [ and ]
#--------------------------------------------------------------------------
def name(string)
sprintf(Vocab::Name, string)
end
#--------------------------------------------------------------------------
# * Get a target's name
#--------------------------------------------------------------------------
def target_name(id)
case id
when -2; Vocab::LastTarget
when -1; Vocab::RandomTarget;
else; sprintf(Vocab::Target, id+1); end
end
end
# End of Utilitities ------------------------------------------------------------------------------------------------
#==============================================================================
# ** EventCommand
#------------------------------------------------------------------------------
# Handle the conversion form code, indent and parameters to a representation
#==============================================================================
class EventCommand
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :event
#--------------------------------------------------------------------------
# * Hash which convert event command to a array representation
# ** Lambdas => should return a array like :
# [ true|false (Put the > or not)
# {color: :some_color_symbol, text: "Some text" }
# {color: :some_other_color_symbol, text: "Some other text" } ]
#--------------------------------------------------------------------------
CommandHash = {
0 => ->(params, event){ [true] },
101 => ->(params, event){ [true,
{color: :standard, text: EventPrinter::Vocab::Message},
{color: :parameters, text: sprintf(EventPrinter::Vocab::MessageParams,
params[0].empty? ? EventPrinter::Vocab::Void : "'#{params[0]}'", params[0].empty? ?
EventPrinter::Vocab::Void : params[1].to_s, EventPrinter::Vocab::MessageDisplay[params[2]],
EventPrinter::Vocab::MessagePosition[params[3]])}
]},
102 => ->(params, event){ [true,
{color: :standard, text: EventPrinter::Vocab::Choices},
{color: :text, text: params[0].join(", ")}] },
103 => ->(params, event){ [true,
{color: :standard, text: sprintf(EventPrinter::Vocab::GetVar,
EventPrinter::Utilities::variable_name(params[0]), params[1])}] },
104 => ->(params, event){ [true,
{color: :standard, text: sprintf(EventPrinter::Vocab::SelectItem,
EventPrinter::Utilities::variable_name(params[0]))}] },
105 => ->(params, event){ [true,
{color: :standard, text: EventPrinter::Vocab::DisplayScrollingText},
{color: :parameters, text: sprintf(EventPrinter::Vocab::ScrollSpeed, params[0])},
{color: :parameters, text: (params[1] ? EventPrinter::Vocab::DisableFastForward : "")}] },
108 => ->(params, event){ [true,
{color: :comments, text: EventPrinter::Vocab::Comment},
{color: :comments, text: params[0]}] },
111 => ->(params, event){ [true,
{color: :function, text: EventPrinter::Vocab::Condition},
{color: :function, text: ConditionArray[params[0]].call(params[1..-1], event) }]},
112 => ->(params, event){ [true,
{color: :function, text: EventPrinter::Vocab::Loop}]},
113 => ->(params, event){ [true,
{color: :function, text: EventPrinter::Vocab::ExitLoop}]},
115 => lambda { |params, event| [true,
{:color => :function, :text => EventPrinter::Vocab::StopEvents}]},
117 => ->(params, event){ [true,
{color: :function, text: EventPrinter::Vocab::CommonEventCall},
{color: :function, text: EventPrinter::Utilities::common_event_name(params[0])}
]},
118 => ->(params, event){ [true,
{color: :function, text: EventPrinter::Vocab::Goto},
{color: :function, text: params[0]}
]},
119 => ->(params, event){ [true,
{color: :function, text: EventPrinter::Vocab::GotoCall},
{color: :function, text: params[0]}
]},
121 => ->(params, event){ [true,
{color: :variables, text: EventPrinter::Vocab::Operation},
{color: :variables, text: EventPrinter::Vocab::Switch},
{color: :variables, text: EventPrinter::Utilities::group_or_uniq(params[0], params[1], true)},
{color: :variables, text: EventPrinter::Vocab::OnOff[params[2]]}] },
122 => ->(params, event){ [true,
{color: :variables, text: EventPrinter::Vocab::Operation},
{color: :variables, text: EventPrinter::Vocab::Variable},
{color: :variables, text: EventPrinter::Utilities::group_or_uniq(params[0], params[1], false)},
{color: :variables, text: EventPrinter::Vocab::Operators[params[2]]},
{color: :variables, text: OperandArray[params[3]].call(params[4..-1], event)} ]},
123 => ->(params, event){ [true,
{color: :variables, text: EventPrinter::Vocab::Operation},
{color: :variables, text: EventPrinter::Vocab::LocalSwitch},
{color: :variables, text: params[0]},
{color: :variables, text: EventPrinter::Vocab::Operators[0]},
{color: :variables, text: EventPrinter::Vocab::OnOff[params[1]]}]},
124 => ->(params, event){ [true,
{color: :variables, text: EventPrinter::Vocab::Chronometer},
{color: :variables, text: params[0] == 0 ? sprintf(EventPrinter::Vocab::Start,
params[1] / 60, params[1] % 60) : EventPrinter::Vocab::Stop
}] },
125 => ->(params, event){ [true,
{color: :manage, text: EventPrinter::Vocab::ModifyMoney},
{color: :manage, text: EventPrinter::Vocab::PlusOrMinus[params[0]]},
{color: :manage, text: params[1] == 0 ? params[2].to_s : EventPrinter::Utilities::la_variable(params[2])}
] },
126 => ->(params, event){ [true,
{color: :manage, text: EventPrinter::Vocab::ModifyItem},
{color: :manage, text: EventPrinter::Utilities::item_name(params[0])},
{color: :manage, text: EventPrinter::Vocab::PlusOrMinus[params[1]]},
{color: :manage, text: params[2] == 0 ? params[3].to_s : EventPrinter::Utilities::la_variable(params[3])}
] },
127 => ->(params, event){ [true,
{color: :manage, text: EventPrinter::Vocab::ModifyWeapon},
{color: :manage, text: EventPrinter::Utilities::weapon_name(params[0])},
{color: :manage, text: EventPrinter::Vocab::PlusOrMinus[params[1]]},
{color: :manage, text: sprintf(
params[1] == 1 && params[4] ? EventPrinter::Vocab::ModifyTextWithIncluded : "%s",
params[2] == 0 ? params[3].to_s : EventPrinter::Utilities::la_variable(params[3]))}
] },
128 => ->(params, event){ [true,
{color: :manage, text: EventPrinter::Vocab::ModifyArmor},
{color: :manage, text: EventPrinter::Utilities::armor_name(params[0])},
{color: :manage, text: EventPrinter::Vocab::PlusOrMinus[params[1]]},
{color: :manage, text: sprintf(
params[1] == 1 && params[4] ? EventPrinter::Vocab::ModifyTextWithIncluded : "%s",
params[2] == 0 ? params[3].to_s : EventPrinter::Utilities::la_variable(params[3]))}
] },
129 => ->(params, event){ [true,
{color: :manage, text: EventPrinter::Vocab::ModifyParty},
{color: :manage, text: EventPrinter::Vocab::AddOrRemove[params[1]]},
{color: :manage, text: sprintf(
params[1] == 0 && params[2] == 1 ? EventPrinter::Vocab::ModifyPartyTextWithReset : "%s",
EventPrinter::Utilities::hero_name(params[0]))}
] },
132 => ->(params, event){ [true,
{color: :system, text: EventPrinter::Vocab::ModifyBGM},
{color: :system, text: params[0].to_string_params}
] },
133 => ->(params, event){ [true,
{color: :system, text: EventPrinter::Vocab::ModifyME},
{color: :system, text: params[0].to_string_params}
] },
134 => ->(params, event){ [true,
{color: :system, text: EventPrinter::Vocab::ModifiySave},
{color: :system, text: EventPrinter::Vocab::SwitchOnOff[params[0]]}
] },
135 => ->(params, event){ [true,
{color: :system, text: EventPrinter::Vocab::ModifiyMenu},
{color: :system, text: EventPrinter::Vocab::SwitchOnOff[params[0]]}
] },
136 => ->(params, event){ [true,
{color: :system, text: EventPrinter::Vocab::ModifiyEncounter},
{color: :system, text: EventPrinter::Vocab::SwitchOnOff[params[0]]}
] },
137 => ->(params, event){ [true,
{color: :system, text: EventPrinter::Vocab::ModifiyFormation},
{color: :system, text: EventPrinter::Vocab::SwitchOnOff[params[0]]}
] },
138 => ->(params, event){ [true,
{color: :system, text: sprintf(EventPrinter::Vocab::WindowColor, params[0].to_string_params)}
] },
201 => ->(params, event){ [true,
{color: :events, text: EventPrinter::Vocab::Warp},
{color: :events, text: WarpText[params[0]].call(params[1..-1]) +
EventPrinter::Vocab::Direction[params[4]] }
] },
202 => ->(params, event){ [true,
{color: :events, text: EventPrinter::Vocab::PlaceVehicle},
{color: :events, text: EventPrinter::Vocab::Vehicle[params[0]]},
{color: :events, text: WarpText[params[1]].call(params[2..-1])}
] },
203 => ->(params, event){ [true,
{color: :events, text: (sprintf(EventPrinter::Vocab::PlaceEvent,
EventPrinter::Utilities::event_name(params[0], event.map), PositionArray[params[1]].call(params[2..-1], event)
) + EventPrinter::Vocab::Direction[params[4]])}
]},
204 => ->(params, event){ [true,
{color: :events, text: EventPrinter::Vocab::ScrollMap},
{color: :events, text: EventPrinter::Vocab::Direction[params[0]]},
{color: :events, text: sprintf(EventPrinter::Vocab::ScrollMapParams, *params[1..-1])} ]},
205 => ->(params, event){ [true,
{color: :events, text: EventPrinter::Vocab::MoveEvent},
{color: :events, text: EventPrinter::Utilities::event_name(params[0], event.map)},
{color: :events, text: params[1].to_string_params } ]},
206 => ->(params, event){ [true,
{color: :events, text: EventPrinter::Vocab::EnterExitVehicle}
]},
211 => ->(params, event){ [true,
{color: :events, text: EventPrinter::Vocab::SetOpacity},
{color: :events, text: EventPrinter::Vocab::Opacity[params[0]]}
]},
212 => ->(params, event){ [true,
{color: :events, text: sprintf(EventPrinter::Vocab::DisplayAnimation,
EventPrinter::Utilities::event_name(params[0], event.map))},
{color: :events, text: EventPrinter::Utilities::animation_name(params[1])}
]},
213 => ->(params, event){ [true,
{color: :events, text: sprintf(EventPrinter::Vocab::DisplayEmote,
EventPrinter::Utilities::event_name(params[0], event.map))},
{color: :events, text: EventPrinter::Vocab::Emotes[params[1]-1]}
]},
214 => ->(params, event){ [true,
{color: :events, text: EventPrinter::Vocab::DeleteEvent}
]},
216 => ->(params, event){ [true,
{color: :events, text: EventPrinter::Vocab::Caterpillar},
{color: :events, text: EventPrinter::Vocab::OnOff[params[0]]}
]},
217 => ->(params, event){ [true,
{color: :events, text: EventPrinter::Vocab::RegroupCaterpillar}
]},
221 => ->(params, event){ [true,
{color: :events, text: EventPrinter::Vocab::FadeIn}
]},
222 => ->(params, event){ [true,
{color: :events, text: EventPrinter::Vocab::FadeOut}
]},
223 => ->(params, event){ [true,
{color: :events, text: sprintf(EventPrinter::Vocab::ScreenTone, params[0].to_string_params, params[1],
params[2] ? EventPrinter::Vocab::WaitEnd : "")}
]},
224 => ->(params, event){ [true,
{color: :events, text: sprintf(EventPrinter::Vocab::FlashScreen, params[0].to_string_params, params[1],
params[2] ? EventPrinter::Vocab::WaitEnd : "")}
]},
225 => ->(params, event){ [true,
{color: :events, text: sprintf(EventPrinter::Vocab::ShakeScreen, params[0], params[1],
params[2], params[3] ? EventPrinter::Vocab::WaitEnd : "")}
]},
230 => ->(params, event){ [true,
{color: :wait, text: sprintf(EventPrinter::Vocab::Wait, params[0])}
]},
231 => ->(params, event){ [true,
{color: :pictures, text: sprintf(EventPrinter::Vocab::DisplayPicture, params[0], params[1],
EventPrinter::Vocab::PositionPicture[0][params[2]], sprintf(EventPrinter::Vocab::PositionPicture[1][params[3]],
params[4], params[5]), params[6], params[7], params[8], EventPrinter::Vocab::Transparency[params[9]])}
]},
232 => ->(params, event){ [true,
{color: :pictures, text: sprintf(EventPrinter::Vocab::MovePicture, params[0], params[1],
EventPrinter::Vocab::PositionPicture[0][params[2]], sprintf(EventPrinter::Vocab::PositionPicture[1][params[3]],
params[4], params[5]), params[6], params[7], params[8], EventPrinter::Vocab::Transparency[params[9]],
params[10], params[11] ? EventPrinter::Vocab::WaitEnd : "")}
]},
233 => ->(params, event){ [true,
{color: :pictures, text: sprintf(EventPrinter::Vocab::RotatePicture, params[0], params[1] > 0 ? "+" : "",
params[1])}
]},
234 => ->(params, event){ [true,
{color: :pictures, text: sprintf(EventPrinter::Vocab::TonePicture, params[0], params[1].to_string_params,
params[2], params[3] ? EventPrinter::Vocab::WaitEnd : "")}
]},
235 => ->(params, event){ [true,
{color: :pictures, text: sprintf(EventPrinter::Vocab::DeletePicture, params[0])}
]},
236 => ->(params, event){ [true,
{color: :pictures, text: sprintf(EventPrinter::Vocab::WeatherEffect,
sprintf(EventPrinter::Vocab::Weather[params[0]], params[1]), params[2],
params[3] ? EventPrinter::Vocab::WaitEnd : "")}
]},
241 => ->(params, event){ [true,
{color: :musics, text: EventPrinter::Vocab::BGM },
{color: :musics, text: params[0].to_string_params },
]},
242 => ->(params, event){ [true,
{color: :musics, text: sprintf(EventPrinter::Vocab::StopBGM, params[0]) }
]},
243 => ->(params, event){ [true,
{color: :musics, text: EventPrinter::Vocab::MemorizeBGM }
]},
244 => ->(params, event){ [true,
{color: :musics, text: EventPrinter::Vocab::RestartBGM }
]},
245 => ->(params, event){ [true,
{color: :musics, text: EventPrinter::Vocab::BGS },
{color: :musics, text: params[0].to_string_params },
]},
246 => ->(params, event){ [true,
{color: :musics, text: sprintf(EventPrinter::Vocab::StopBGS, params[0]) }
]},
249 => ->(params, event){ [true,
{color: :musics, text: EventPrinter::Vocab::ME },
{color: :musics, text: params[0].to_string_params },
]},
250 => ->(params, event){ [true,
{color: :musics, text: EventPrinter::Vocab::SE },
{color: :musics, text: params[0].to_string_params },
]},
251 => ->(params, event){ [true,
{color: :musics, text: EventPrinter::Vocab::StopSE }
]},
261 => ->(params, event){ [true,
{color: :musics, text: sprintf(EventPrinter::Vocab::PlayVideo, params[0]) }
]},
281 => ->(params, event){ [true,
{color: :graphics, text: EventPrinter::Vocab::DisplayMapName },
{color: :graphics, text: EventPrinter::Vocab::OnOff[params[0]]}
]},
282 => ->(params, event){ [true,
{color: :graphics, text: EventPrinter::Vocab::ChangeTileset },
{color: :graphics, text: EventPrinter::Utilities::tileset_name(params[0]) }
]},
283 => ->(params, event){ [true,
{color: :graphics, text: sprintf(EventPrinter::Vocab::ChangeBattleBack[params[1].empty? ? 0 : 1], *params)}
]},
284 => ->(params, event){ [true,
{color: :graphics, text: sprintf(EventPrinter::Vocab::ChangePanorama, *params)}
]},
285 => ->(params, event){ [true,
{color: :graphics, text: sprintf(EventPrinter::Vocab::GetInformation, *params)},
{color: :graphics, text: sprintf(EventPrinter::Vocab::GetInformationCoord[params[2]], *params[3..4])}
]},
301 => ->(params, event){ [true,
{color: :game, text: sprintf(EventPrinter::Vocab::Battle, params[0] == 0 ?
EventPrinter::Utilities::enemy_name(params[1]) : sprintf(EventPrinter::Vocab::BattleIndexed, params[1]))}
] },
302 => ->(params, event){ [true,
{color: :game, text: EventPrinter::Vocab::Shop},
{color: :game, text: EventPrinter::Utilities::base_item_name(*params[0..1])}
] },
303 => ->(params, event){ [true,
{color: :game, text: sprintf(EventPrinter::Vocab::EnterName,
EventPrinter::Utilities::hero_name(params[0])[1...-1], params[1])}
] },
311 => ->(params, event){ [true,
{color: :manage, text: EventPrinter::Vocab::ModifyHP},
{color: :manage, text: params[0] == 0 ? EventPrinter::Utilities::hero_name(params[1]) :
[EventPrinter::Vocab::Variable, EventPrinter::Utilities::variable_name(params[1])].join(" ")},
{color: :manage, text: EventPrinter::Vocab::PlusOrMinus[params[2]]},
{color: :manage, text: params[3] == 0 ? params[4].to_s : EventPrinter::Utilities::la_variable(params[4])}
] },
312 => ->(params, event){ [true,
{color: :manage, text: EventPrinter::Vocab::ModifyMP},
{color: :manage, text: params[0] == 0 ? EventPrinter::Utilities::hero_name(params[1]) :
[EventPrinter::Vocab::Variable, EventPrinter::Utilities::variable_name(params[1])].join(" ")},
{color: :manage, text: EventPrinter::Vocab::PlusOrMinus[params[2]]},
{color: :manage, text: params[3] == 0 ? params[4].to_s : EventPrinter::Utilities::la_variable(params[4])}
] },
313 => ->(params, event){ [true,
{color: :manage, text: sprintf(EventPrinter::Vocab::ModifyStatus,
EventPrinter::Utilities::hero_name(params[0]))},
{color: :manage, text: EventPrinter::Vocab::PlusOrMinus[params[1]]},
{color: :manage, text: sprintf(EventPrinter::Vocab::Name, EventPrinter::Utilities::state_name(params[2]))}
] },
314 => ->(params, event){ [true,
{color: :manage, text: EventPrinter::Vocab::Recover},
{color: :manage, text: params[0] == 0 ? EventPrinter::Utilities::hero_name(params[1]) :
[EventPrinter::Vocab::Variable, EventPrinter::Utilities::variable_name(params[1])].join(" ")}
] },
315 => ->(params, event){ [true,
{color: :manage, text: sprintf(EventPrinter::Vocab::ModifyExperience,
params[0] == 0 ? EventPrinter::Utilities::hero_name(params[1]) :
[EventPrinter::Vocab::Variable, EventPrinter::Utilities::variable_name(params[1])].join(" "))},
{color: :manage, text: EventPrinter::Vocab::PlusOrMinus[params[2]]},
{color: :manage, text: params[3] == 0 ? params[4].to_s : EventPrinter::Utilities::la_variable(params[4])}
] },
316 => ->(params, event){ [true,
{color: :manage, text: sprintf(EventPrinter::Vocab::ModifyLevel,
params[0] == 0 ? EventPrinter::Utilities::hero_name(params[1]) :
[EventPrinter::Vocab::Variable, EventPrinter::Utilities::variable_name(params[1])].join(" "))},
{color: :manage, text: EventPrinter::Vocab::PlusOrMinus[params[2]]},
{color: :manage, text: params[3] == 0 ? params[4].to_s : EventPrinter::Utilities::la_variable(params[4])}
] },
317 => ->(params, event){ [true,
{color: :manage, text: sprintf(EventPrinter::Vocab::ModifyParameters,
params[0] == 0 ? EventPrinter::Utilities::hero_name(params[1]) :
[EventPrinter::Vocab::Variable, EventPrinter::Utilities::variable_name(params[1])].join(" "))},
{color: :manage, text: EventPrinter::Vocab::Attributes[params[2] - 5]},
{color: :manage, text: EventPrinter::Vocab::PlusOrMinus[params[3]]},
{color: :manage, text: params[4] == 0 ? params[5].to_s : EventPrinter::Utilities::la_variable(params[5])}
] },
318 => ->(params, event){ [true,
{color: :manage, text: sprintf(EventPrinter::Vocab::ModifySkill,
params[0] == 0 ? EventPrinter::Utilities::hero_name(params[1]) :
[EventPrinter::Vocab::Variable, EventPrinter::Utilities::variable_name(params[1])].join(" "))},
{color: :manage, text: EventPrinter::Vocab::PlusOrMinus[params[2]]},
{color: :manage, text: EventPrinter::Utilities::skill_name(params[3])}
] },
319 => ->(params, event){ [true,
{color: :manage, text: sprintf(EventPrinter::Vocab::ModifyEquipement,
EventPrinter::Utilities::hero_name(params[0]))},
{color: :manage, text: EventPrinter::Vocab::Equipement[params[1]]},
{color: :manage, text: EventPrinter::Vocab::Operators[0]},
{color: :manage, text: EventPrinter::Utilities::equipement_name(params[1], params[2])}
] },
320 => ->(params, event){ [true,
{color: :manage, text: sprintf(EventPrinter::Vocab::ModifyHeroName,
EventPrinter::Utilities::hero_name(params[0]))},
{color: :manage, text: "'#{params[1]}'"}
] },
321 => ->(params, event){ [true,
{color: :manage, text: sprintf(EventPrinter::Vocab::ModifyHeroClass,
EventPrinter::Utilities::hero_name(params[0]))},
{color: :manage, text: EventPrinter::Utilities::class_name(params[1])}
] },
322 => ->(params, event){ [true,
{color: :system, text: sprintf(EventPrinter::Vocab::ModifyHeroAppearance,
EventPrinter::Utilities::hero_name(params[0]), *params[1..-1])}
] },
323 => ->(params, event){ [true,
{color: :system, text: sprintf(EventPrinter::Vocab::ModifyVehicleAppearance,
EventPrinter::Vocab::Vehicle[params[0]], *params[1..-1])},
] },
324 => ->(params, event){ [true,
{color: :manage, text: sprintf(EventPrinter::Vocab::ModifyHeroAlias,
EventPrinter::Utilities::hero_name(params[0]))},
{color: :manage, text: "'#{params[1]}'"}
] },
331 => ->(params, event){ [true,
{color: :battle, text: sprintf(EventPrinter::Vocab::ModifyHPEnemy,
EventPrinter::Utilities::foe_name(params[0], event))},
{color: :battle, text: EventPrinter::Vocab::PlusOrMinus[params[1]]},
{color: :battle, text: params[2] == 0 ? params[3].to_s : EventPrinter::Utilities::la_variable(params[3])}
] },
332 => ->(params, event){ [true,
{color: :battle, text: sprintf(EventPrinter::Vocab::ModifyMPEnemy,
EventPrinter::Utilities::foe_name(params[0], event))},
{color: :battle, text: EventPrinter::Vocab::PlusOrMinus[params[1]]},
{color: :battle, text: params[2] == 0 ? params[3].to_s : EventPrinter::Utilities::la_variable(params[3])}
] },
333 => ->(params, event){ [true,
{color: :battle, text: sprintf(EventPrinter::Vocab::ModifyStatusEnemy,
EventPrinter::Utilities::foe_name(params[0], event))},
{color: :battle, text: EventPrinter::Vocab::PlusOrMinus[params[1]]},
{color: :battle, text: EventPrinter::Utilities::state_name(params[2])}
] },
334 => ->(params, event){ [true,
{color: :battle, text: sprintf(EventPrinter::Vocab::RecoverEnemy,
EventPrinter::Utilities::foe_name(params[0], event))}
] },
335 => ->(params, event){ [true,
{color: :battle, text: sprintf(EventPrinter::Vocab::RevealEnemy,
EventPrinter::Utilities::foe_name(params[0], event))}
] },
336 => ->(params, event){ [true,
{color: :battle, text: sprintf(EventPrinter::Vocab::MorphEnemy,
EventPrinter::Utilities::foe_name(params[0], event), EventPrinter::Utilities::enemy_name(params[1]))}
] },
337 => ->(params, event){ [true,
{color: :battle, text: sprintf(EventPrinter::Vocab::DisplayBattleAnimation,
EventPrinter::Utilities::foe_name(params[0], event))},
{color: :battle, text: EventPrinter::Utilities::animation_name(params[1])}
] },
339 => ->(params, event){ [true,
{color: :battle, text: sprintf(EventPrinter::Vocab::ForceAction, params[0] == 0 ?
EventPrinter::Utilities::foe_name(params[1], event) : sprintf(EventPrinter::Vocab::Battler, params[1] + 1),
EventPrinter::Utilities::skill_name(params[2]), EventPrinter::Utilities::target_name(params[3]))}
]},
340 => ->(params, event){ [true,
{color: :battle, text: EventPrinter::Vocab::EndTheBattle}]},
351 => ->(params, event){ [true,
{color: :system, text: EventPrinter::Vocab::OpenMenu}]},
352 => ->(params, event){ [true,
{color: :system, text: EventPrinter::Vocab::OpenSave}]},
353 => ->(params, event){ [true,
{color: :system, text: EventPrinter::Vocab::GameOver}]},
354 => ->(params, event){ [true,
{color: :system, text: EventPrinter::Vocab::ToTitle}]},
355 => ->(params, event){ [true,
{color: :script, text: EventPrinter::Vocab::ScriptCall},
{color: :script, text: params[0]}
] },
401 => ->(params, event){ [false,
{color: :nothing, text: EventPrinter::Vocab::Message[0...-2]}, # Without the ":" and space
{color: :standard, text: ":"},
{color: :text, text: params[0]}] },
402 => ->(params, event){ [false,
{color: :standard, text: sprintf(EventPrinter::Vocab::Choice, "[#{params[1]}]")}] },
403 => ->(params, event){ [false,
{color: :standard, text: sprintf(EventPrinter::Vocab::Choice, EventPrinter::Vocab::CancelChoice)}] },
404 => ->(params, event){ [false,
{color: :standard, text: EventPrinter::Vocab::EndChoice}] },
405 => ->(params, event){ [false,
{color: :nothing, text: EventPrinter::Vocab::DisplayScrollingText[0...-2]},
{color: :standard, text: ":"},
{color: :text, text: params[0]}] },
408 => ->(params, event){ [false,
{color: :nothing, text: EventPrinter::Vocab::Comment[0...-2]},
{color: :events, text: ":"},
{color: :comments, text: params[0]}] },
411 => ->(params, event){ [false,
{color: :function, text: EventPrinter::Vocab::Else}] },
412 => ->(params, event){ [false,
{color: :function, text: EventPrinter::Vocab::EndCondition}] },
413 => ->(params, event){ [false,
{color: :function, text: EventPrinter::Vocab::EndLoop}] },
505 => ->(params, event){ [false,
{color: :nothing, text: EventPrinter::Vocab::MoveEvent[0...-2]},
{color: :events, text: ":"},
{color: :events, text: EventPrinter::Vocab::Command[2]},
{color: :events, text: sprintf(EventPrinter::Vocab::MoveRouteCommands[params[0].code],
*params[0].to_params)}
]},
601 => ->(params, event){ [false,
{color: :function, text: EventPrinter::Vocab::IfVictory}] },
602 => ->(params, event){ [false,
{color: :function, text: EventPrinter::Vocab::IfFlee}] },
603 => ->(params, event){ [false,
{color: :function, text: EventPrinter::Vocab::IfLoss}] },
604 => ->(params, event){ [false,
{color: :function, text: EventPrinter::Vocab::EndBattle}] },
605 => ->(params, event){ [false,
{color: :nothing, text: EventPrinter::Vocab::Shop[0...-2]},
{color: :game, text: ":"},
{color: :game, text: EventPrinter::Utilities::base_item_name(*params[0..1])}
] },