forked from Archeia/YEARepo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ace_Battle_Engine124backup.rb
3200 lines (2856 loc) · 123 KB
/
Ace_Battle_Engine124backup.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
#==============================================================================
#
# ¥ Yanfly Engine Ace - Ace Battle Engine v1.24
# -- Last Updated: 2012.08.21
# -- Level: Normal, Hard
# -- Requires: n/a
#
#==============================================================================
$imported = {} if $imported.nil?
$imported["YEA-BattleEngine"] = true
#==============================================================================
# ¥ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.08.06 - Bug fixed: Repeating sound effect when using a revive spell/item.
#
# 2012.08.06 - Bug fixed: Screen effect for Slip Damage.
# - Bug fixed: Performing Collapse for Slip Damage.
# - Bug fixed: Divided by Zero when Troop has no member.
# 2012.03.04 - Bug fixed: Input crash bug.
# 2012.02.13 - Bug fixed: Odd Victory game crash fixed.
# 2012.02.12 - Bug fixed: Displayed damage in combat log is correct now.
# 2012.01.29 - Visual Changes: Buff stacks now show one popup upon one skill.
# 2012.01.24 - Compatibility Update: Enemy Levels
# 2012.01.18 - Bug Fixed: Help Window clears text upon selecting nil items.
# 2012.01.11 - Added <one animation> tag for multi-hit skills to play an
# animation only once.
# - Reduced lag from battle system constantly recreating bitmaps.
# 2012.01.10 - Compatibility Update: Battle System FTB
# 2012.01.09 - Anticrash methods implemented.
# - Damage Popups are now separate for damage formulas and recovery.
# 2012.01.05 - Bug fixed: Game no longer crashes with escape skills/items.
# 2012.01.02 - Compatibility Update: Target Manager
# - Added Option: AUTO_FAST
# - Random hits now show animations individually.
# 2011.12.30 - Compatibility Update: Enemy Levels
# - Added Option to center the actors in the HUD.
# 2011.12.27 - Bug fixed: TP Damage skills and items no longer crash game.
# - Default battle system bug fixes are now included from YEA's Ace
# Core Engine.
# - Groundwork is also made to support future battle system types.
# - Multi-hit actions no longer linger when a target dies during the
# middle of one of the hits.
# - Compatibility Update: Lunatic Objects v1.02
# 2011.12.26 - Bug fixed: Multi-hit popups occured even after an enemy's dead.
# 2011.12.22 - Bug fixed: Elemental Resistance popup didn't show.
# 2011.12.20 - Bug fixed: Death state popups against immortal states.
# - Bug fixed: During State popup fix.
# - Added HIDE_POPUP_SWITCH.
# 2011.12.17 - Compatibiilty Update: Cast Animations
# 2011.12.15 - Compatibility Update: Battle Command List
# 2011.12.14 - Compatibility Update: Lunatic Objects
# 2011.12.13 - Compatibility Update: Command Party
# 2011.12.12 - Bug fixed: Turn stalling if no inputable members.
# 2011.12.10 - Compatibility update for Automatic Party HUD.
# - Popup graphical bug fixed.
# - Bug fixed: Didn't wait for boss dead animations.
# - Bug fixed: Surprise attacks that froze the game.
# - Bug fixed: Popups didn't show for straight recovery effects.
# 2011.12.08 - Finished Script.
# 2011.12.04 - Started Script.
#
#==============================================================================
# ¥ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Ace Battle Engine works as a foundation for future battle engine add-ons. It
# allows for easier management of the battle engine without adding too many
# features, allowing users to customize what they want as they see fit. While
# the Ace Battle Engine isn't an entirely new engine, it gives users control
# that RPG Maker VX Ace didn't originally give them.
#
# Furthermore, this script provides some new features. They are as follows:
#
# -----------------------------------------------------------------------------
# Animation Fixes
# -----------------------------------------------------------------------------
# Though the Yanfly Engine Ace - Ace Core Engine script contains these fixes,
# these fixes are included in this script as well to ensure it's working for
# the battle script in the event someone chooses not to work with the Ace Core
# Engine script. The animation fixes prevent excessive animation overlaying
# (and making the screen look really ugly) and prevents animation clashing
# between two dual wielding normal attack animations.
#
# -----------------------------------------------------------------------------
# Enemy Animations
# -----------------------------------------------------------------------------
# Enemies now show battle animations when they deliver attacks and skills
# against the player's party. Before in RPG Maker VX Ace, it was nothing more
# than just sound effects and the screen shaking. Now, animations play where
# the status window is and relative to the position of each party member.
#
# -----------------------------------------------------------------------------
# Left/Right Command Selection
# -----------------------------------------------------------------------------
# While choosing actions, the player can press Left or Right to move freely
# between (alive) actors to change their skills. Players no longer have to
# cancel all the way back to change one person's skill and reselect everything.
# On that note, there is now the option that when a battle starts or at the
# end of a turn, players will start immediately at command selection rather
# than needing to select "Fight" in the Party Command Window.
#
# -----------------------------------------------------------------------------
# Popups
# -----------------------------------------------------------------------------
# Dealing damage, inflicting states, adding buffs, landing critical hits,
# striking weaknesses, missing attacks, you name it, there's probably a popup
# for it. Popups deliver information to the player in a quick or orderly
# fashion without requiring the player to read lines of text.
#
# -----------------------------------------------------------------------------
# Targeting Window
# -----------------------------------------------------------------------------
# When targeting enemies, the window is no longer displayed. Instead, the
# targeted enemies are highlighted and their names are shown at the top of the
# screen in a help window. Another thing that's changed is when skills that
# target multiple targets are selected, there is a confirmation step that the
# player must take before continuing. In this confirmation step, all of the
# multiple targets are selected and in the help window would display the scope
# of the skill (such as "All Foes" or "Random Foes"). RPG Maker VX Ace skipped
# this step by default.
#
# -----------------------------------------------------------------------------
# Toggling On and Off Special Effects and Text
# -----------------------------------------------------------------------------
# Not everybody likes having the screen shake or the enemies blink when they
# take damage. These effects can now be toggled on and off. Certain text can
# also be toggled on and off from appearing. A lot of the displayed text has
# been rendered redundant through the use of popups.
#
# -----------------------------------------------------------------------------
# Visual Battle Status Window
# -----------------------------------------------------------------------------
# Rather than just having rows of names with HP and MP bars next to them, the
# Battle Status Window now displays actors' faces and their gauges aligned at
# the bottom. More status effects can be shown in addition to showing more
# members on screen at once. The Battle Status Window is also optimized to
# refresh less (thus, removing potential lag from the system).
#
# -----------------------------------------------------------------------------
# Window Position Changes
# -----------------------------------------------------------------------------
# Windows such as the Skill Window and Item Window have been rearranged to
# always provide the player a clear view of the battlefield rather than opening
# up and covering everything. As such, the window positions are placed at the
# bottom of the screen and are repositioned.
#
#==============================================================================
# ¥ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ¥ Materials/ef?T but above ¥ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# Skill Notetags - These notetags go in the skills notebox in the database.
# -----------------------------------------------------------------------------
# <one animation>
# Causes the action to display the action animation only once, even if it's a
# multi-hit action. This is used primarily for non-all scope targeting.
#
# -----------------------------------------------------------------------------
# Item Notetags - These notetags go in the items notebox in the database.
# -----------------------------------------------------------------------------
# <one animation>
# Causes the action to display the action animation only once, even if it's a
# multi-hit action. This is used primarily for non-all scope targeting.
#
# -----------------------------------------------------------------------------
# Enemy Notetags - These notetags go in the enemy notebox in the database.
# -----------------------------------------------------------------------------
# <atk ani 1: x>
# <atk ani 2: x>
# Changes the normal attack animation of the particular enemy to animation x.
# Attack animation 1 is the first one that plays. If there's a second animation
# then the second one will play after in mirrored form.
#
# -----------------------------------------------------------------------------
# State Notetags - These notetags go in the state notebox in the database.
# -----------------------------------------------------------------------------
# <popup add: string>
# <popup rem: string>
# <popup dur: string>
# Status effects now create popups whenever they're inflicted. However, if you
# don't like that a certain status effect uses a particular colour setting,
# change "string" to one of the rulesets below to cause that popup to use a
# different ruleset.
#
# <popup hide add>
# <popup hide rem>
# <popup hide dur>
# Not everybody wants status effects to show popups when inflicted. When this
# is the case, insert the respective tag to hide popups from appearing when the
# state is added, removed, or during the stand-by phases.
#
# -----------------------------------------------------------------------------
# Debug Tools - These tools only work during Test Play.
# -----------------------------------------------------------------------------
# - F5 Key -
# Recovers all actors. Restores their HP and MP to max. Does not affect TP.
# All states and buffs are removed whether they are positive or negative.
#
# - F6 Key -
# Sets all actors to have 1 HP, 0 MP, and 0 TP. States are unaffected.
#
# - F7 Key -
# Sets all actors to have max TP. Everything else is unaffected.
#
# - F8 Key -
# Kills all enemies in battle. Ends the battle quickly.
#
#==============================================================================
# ¥ 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 BATTLE
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - General Battle Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# These settings are adjusted for the overall battle system. These are
# various miscellaneous options to adjust. Each of the settings below will
# explain what they do. Change default enemy battle animations here, too.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
BLINK_EFFECTS = false # Blink sprite when damaged?
FLASH_WHITE_EFFECT = true # Flash enemy white when it starts an attack.
SCREEN_SHAKE = false # Shake screen in battle?
SKIP_PARTY_COMMAND = true # Skips the Fight/Escape menu.
AUTO_FAST = true # Causes message windows to not wait.
ENEMY_ATK_ANI = 36 # Sets default attack animation for enemies.
# If this switch is ON, popups will be hidden. If OFF, the popups will be
# shown. If you do not wish to use this switch, set it to 0.
HIDE_POPUP_SWITCH = 0
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Battle Status Window -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# This sets the default battle system your game will use. If your game
# doesn't have any other battle systems installed, it will use :dtb.
#
# Battle System Requirement
# :dtb - Default Turn Battle. Default system.
# :ftb - YEA Battle System Add-On: Free Turn Battle
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
DEFAULT_BATTLE_SYSTEM = :dtb # Default battle system set.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Battle Status Window -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Here, you can adjust the settings for the battle status window. The
# battle status window, by default, will show the actor's face, HP, MP, TP
# (if viable), and any inflicted status effects.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
BATTLESTATUS_NAME_FONT_SIZE = 20 # Font size used for name.
BATTLESTATUS_TEXT_FONT_SIZE = 16 # Font size used for HP, MP, TP.
BATTLESTATUS_NO_ACTION_ICON = 185 # No action icon.
BATTLESTATUS_HPGAUGE_Y_PLUS = 11 # Y Location buffer used for HP gauge.
BATTLESTATUS_CENTER_FACES = false # Center faces for the Battle Status.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Help Window Text -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# When selecting a target to attack, this is the text that will be shown
# in place of a target's name for special cases. These special cases are
# for selections that were originally non-targetable battle scopes.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
HELP_TEXT_ALL_FOES = "All Foes"
HELP_TEXT_ONE_RANDOM_FOE = "One Random Foe"
HELP_TEXT_MANY_RANDOM_FOE = "%d Random Foes"
HELP_TEXT_ALL_ALLIES = "All Allies"
HELP_TEXT_ALL_DEAD_ALLIES = "All Dead Allies"
HELP_TEXT_ONE_RANDOM_ALLY = "One Random Ally"
HELP_TEXT_RANDOM_ALLIES = "%d Random Allies"
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Popup Settings -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# These settings will adjust the popups that appear in battle. Popups
# deliver information to your player as battlers deal damage, inflict
# status effects, and more.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
ENABLE_POPUPS = true # Set this to false if you wish to disable them.
FLASH_CRITICAL = true # Sets critical hits to flash.
# This hash adjusts the popup settings that will govern how popups appear.
# Adjust them accordingly.
POPUP_SETTINGS ={
:offset => -24, # Height offset of a popup.
:fade => 12, # Fade rate for each popup.
:full => 60, # Frames before a popup fades.
:hp_dmg => "-%s ", # SprintF for HP damage.
:hp_heal => "+%s ", # SprintF for HP healing.
:mp_dmg => "-%s MP", # SprintF for MP damage.
:mp_heal => "+%s MP", # SprintF for MP healing.
:tp_dmg => "-%s TP", # SprintF for MP damage.
:tp_heal => "+%s TP", # SprintF for MP healing.
:drained => "DRAIN", # Text display for draining HP/MP.
:critical => "CRITICAL!", # Text display for critical hit.
:missed => "MISS", # Text display for missed attack.
:evaded => "EVADE!", # Text display for evaded attack.
:nulled => "NULL", # Text display for nulled attack.
:failed => "FAILED", # Text display for a failed attack.
:add_state => "+%s", # SprintF for added states.
:rem_state => "-%s", # SprintF for removed states.
:dur_state => "%s", # SprintF for during states.
:ele_rates => true, # This will display elemental affinities.
:ele_wait => 20, # This is how many frames will wait.
:weakpoint => "WEAKPOINT", # Appears if foe is weak to element.
:resistant => "RESIST", # Appears if foe is resistant to element.
:immune => "IMMUNE", # Appears if foe is immune to element.
:absorbed => "ABSORB", # Appears if foe can absorb the element.
:add_buff => "%s?{", # Appears when a positive buff is applied.
:add_debuff => "%s?|", # Appears when a negative buff is applied.
} # Do not remove this.
# This is the default font used for the popups. Adjust them accordingly
# or even add new ones.
DEFAULT = ["VL Gothic", "Verdana", "Arial", "Courier"]
# The following are the various rules that govern the individual popup
# types that will appear. Adjust them accordingly. Here is a list of what
# each category does.
# Zoom1 The zoom the popup starts at. Values over 2.0 may cause lag.
# Zoom2 The zoom the popup goes to. Values over 2.0 may cause lag.
# Sz The font size used for the popup text.
# Bold Applying bold for the popup text.
# Italic Applying italic for the popup text.
# Red The red value of the popup text.
# Grn The green value of the popup text.
# Blu The blue value of the popup text.
# Font The font used for the popup text.
POPUP_RULES ={
# Type => [ Zoom1, Zoom2, Sz, Bold, Italic, Red, Grn, Blu, Font]
"DEFAULT" => [ 2.0, 1.0, 24, true, false, 255, 255, 255, DEFAULT],
"CRITICAL" => [ 2.0, 1.0, 24, true, false, 255, 80, 80, DEFAULT],
"HP_DMG" => [ 2.0, 1.0, 36, true, false, 255, 255, 255, DEFAULT],
"HP_HEAL" => [ 2.0, 1.0, 36, true, false, 130, 250, 130, DEFAULT],
"MP_DMG" => [ 2.0, 1.0, 36, true, false, 220, 180, 255, DEFAULT],
"MP_HEAL" => [ 2.0, 1.0, 36, true, false, 160, 230, 255, DEFAULT],
"TP_DMG" => [ 2.0, 1.0, 36, true, false, 242, 108, 78, DEFAULT],
"TP_HEAL" => [ 2.0, 1.0, 36, true, false, 251, 175, 92, DEFAULT],
"ADDSTATE" => [ 2.0, 1.0, 24, true, false, 240, 100, 100, DEFAULT],
"REMSTATE" => [ 2.0, 1.0, 24, true, false, 125, 170, 225, DEFAULT],
"DURSTATE" => [ 2.0, 1.0, 24, true, false, 255, 240, 150, DEFAULT],
"DRAIN" => [ 2.0, 1.0, 36, true, false, 250, 190, 255, DEFAULT],
"POSITIVE" => [ 2.0, 1.0, 24, true, false, 110, 210, 245, DEFAULT],
"NEGATIVE" => [ 2.0, 1.0, 24, true, false, 245, 155, 195, DEFAULT],
"WEAK_ELE" => [ 0.5, 1.0, 24, true, false, 240, 110, 80, DEFAULT],
"IMMU_ELE" => [ 0.5, 1.0, 24, true, false, 185, 235, 255, DEFAULT],
"REST_ELE" => [ 0.5, 1.0, 24, true, false, 145, 230, 180, DEFAULT],
"ABSB_ELE" => [ 0.5, 1.0, 24, true, false, 250, 190, 255, DEFAULT],
"BUFF" => [ 2.0, 1.0, 24, true, false, 255, 240, 100, DEFAULT],
"DEBUFF" => [ 2.0, 1.0, 24, true, false, 160, 130, 200, DEFAULT],
} # Do not remove this.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# - Streamlined Messages -
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# Want to remove some of those annoying messages that appear all the time?
# Now you can! Select which messages you want to enable or disable. Some of
# these messages will be rendered useless due to popups.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
MSG_ENEMY_APPEARS = false # Message when enemy appears start of battle.
MSG_CURRENT_STATE = false # Show which states has affected battler.
MSG_CURRENT_ACTION = true # Show the current action of the battler.
MSG_COUNTERATTACK = true # Show the message for a counterattack.
MSG_REFLECT_MAGIC = true # Show message for reflecting magic attacks.
MSG_SUBSTITUTE_HIT = true # Show message for ally taking another's hit.
MSG_FAILURE_HIT = false # Show effect failed against target.
MSG_CRITICAL_HIT = false # Show attack was a critical hit.
MSG_HIT_MISSED = false # Show attack missed the target.
MSG_EVASION = false # Show attack was evaded by the target.
MSG_HP_DAMAGE = false # Show HP damage to target.
MSG_MP_DAMAGE = false # Show MP damage to target.
MSG_TP_DAMAGE = false # Show TP damage to target.
MSG_ADDED_STATES = false # Show target's added states.
MSG_REMOVED_STATES = false # Show target's removed states.
MSG_CHANGED_BUFFS = false # Show target's changed buffs.
end # BATTLE
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 ENEMY
ATK_ANI1 = /<(?:ATK_ANI_1|atk ani 1):[ ]*(\d+)>/i
ATK_ANI2 = /<(?:ATK_ANI_2|atk ani 2):[ ]*(\d+)>/i
end # ENEMY
module USABLEITEM
ONE_ANIMATION = /<(?:ONE_ANIMATION|one animation)>/i
end # USABLEITEM
module STATE
POPUP_ADD = /<(?:POPUP_ADD_RULE|popup add rule|popup add):[ ](.*)>/i
POPUP_REM = /<(?:POPUP_REM_RULE|popup rem rule|popup rem):[ ](.*)>/i
POPUP_DUR = /<(?:POPUP_DUR_RULE|popup dur rule|popup dur):[ ](.*)>/i
HIDE_ADD = /<(?:POPUP_HIDE_ADD|popup hide add|hide add)>/i
HIDE_REM = /<(?:POPUP_HIDE_REM|popup hide rem|hide rem)>/i
HIDE_DUR = /<(?:POPUP_HIDE_DUR|popup hide dur|hide dur)>/i
end # STATE
end # REGEXP
end # YEA
#==============================================================================
# ?! Switch
#==============================================================================
module Switch
#--------------------------------------------------------------------------
# self.hide_popups
#--------------------------------------------------------------------------
def self.hide_popups
return false if YEA::BATTLE::HIDE_POPUP_SWITCH <= 0
return $game_switches[YEA::BATTLE::HIDE_POPUP_SWITCH]
end
end # Switch
#==============================================================================
# ?! Colour
#==============================================================================
module Colour
#--------------------------------------------------------------------------
# self.text_colour
#--------------------------------------------------------------------------
def self.text_colour(index)
windowskin = Cache.system("Window")
x = 64 + (index % 8) * 8
y = 96 + (index / 8) * 8
return windowskin.get_pixel(x, y)
end
end # Colour
#==============================================================================
# ?! Icon
#==============================================================================
module Icon
#--------------------------------------------------------------------------
# self.no_action
#--------------------------------------------------------------------------
def self.no_action; return YEA::BATTLE::BATTLESTATUS_NO_ACTION_ICON; end
end # Icon
#==============================================================================
# ?! Numeric
#==============================================================================
class Numeric
#--------------------------------------------------------------------------
# new method: group_digits
#--------------------------------------------------------------------------
unless $imported["YEA-CoreEngine"]
def group; return self.to_s; end
end # $imported["YEA-CoreEngine"]
end # Numeric
#==============================================================================
# ?! DataManager
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# alias method: load_database
#--------------------------------------------------------------------------
class <<self; alias load_database_abe load_database; end
def self.load_database
load_database_abe
load_notetags_abe
end
#--------------------------------------------------------------------------
# new method: load_notetags_abe
#--------------------------------------------------------------------------
def self.load_notetags_abe
groups = [$data_enemies, $data_states, $data_skills, $data_items]
for group in groups
for obj in group
next if obj.nil?
obj.load_notetags_abe
end
end
end
end # DataManager
#==============================================================================
# ?! RPG::UsableItem
#==============================================================================
class RPG::UsableItem < RPG::BaseItem
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :one_animation
#--------------------------------------------------------------------------
# common cache: load_notetags_abe
#--------------------------------------------------------------------------
def load_notetags_abe
@one_animation = false
#---
self.note.split(/[\r\n]+/).each { |line|
case line
#---
when YEA::REGEXP::USABLEITEM::ONE_ANIMATION
@one_animation = true
end
} # self.note.split
#---
end
end # RPG::UsableItem
#==============================================================================
# ?! RPG::Enemy
#==============================================================================
class RPG::Enemy < RPG::BaseItem
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :atk_animation_id1
attr_accessor :atk_animation_id2
#--------------------------------------------------------------------------
# common cache: load_notetags_abe
#--------------------------------------------------------------------------
def load_notetags_abe
@atk_animation_id1 = YEA::BATTLE::ENEMY_ATK_ANI
@atk_animation_id2 = 0
#---
self.note.split(/[\r\n]+/).each { |line|
case line
#---
when YEA::REGEXP::ENEMY::ATK_ANI1
@atk_animation_id1 = $1.to_i
when YEA::REGEXP::ENEMY::ATK_ANI2
@atk_animation_id2 = $1.to_i
end
} # self.note.split
#---
end
end # RPG::Enemy
#==============================================================================
# ?! RPG::Enemy
#==============================================================================
class RPG::State < RPG::BaseItem
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :popup_rules
#--------------------------------------------------------------------------
# common cache: load_notetags_abe
#--------------------------------------------------------------------------
def load_notetags_abe
@popup_rules = {
:add_state => "ADDSTATE",
:rem_state => "REMSTATE",
:dur_state => nil
} # Do not remove this.
#---
self.note.split(/[\r\n]+/).each { |line|
case line
#---
when YEA::REGEXP::STATE::POPUP_ADD
@popup_rules[:add_state] = $1.upcase.to_s
when YEA::REGEXP::STATE::POPUP_REM
@popup_rules[:rem_state] = $1.upcase.to_s
when YEA::REGEXP::STATE::POPUP_DUR
@popup_rules[:dur_state] = $1.upcase.to_s
when YEA::REGEXP::STATE::HIDE_ADD
@popup_rules[:add_state] = nil
when YEA::REGEXP::STATE::HIDE_REM
@popup_rules[:rem_state] = nil
when YEA::REGEXP::STATE::HIDE_DUR
@popup_rules[:dur_state] = nil
end
} # self.note.split
#---
end
end # RPG::State
#==============================================================================
# ?! BattleManager
#==============================================================================
module BattleManager
#--------------------------------------------------------------------------
# overwrite method: self.battle_start
#--------------------------------------------------------------------------
def self.battle_start
$game_system.battle_count += 1
$game_party.on_battle_start
$game_troop.on_battle_start
return unless YEA::BATTLE::MSG_ENEMY_APPEARS
$game_troop.enemy_names.each do |name|
$game_message.add(sprintf(Vocab::Emerge, name))
end
if @preemptive
$game_message.add(sprintf(Vocab::Preemptive, $game_party.name))
elsif @surprise
$game_message.add(sprintf(Vocab::Surprise, $game_party.name))
end
wait_for_message
end
#--------------------------------------------------------------------------
# overwrite method: make_action_orders
#--------------------------------------------------------------------------
def self.make_action_orders
make_dtb_action_orders if btype?(:dtb)
end
#--------------------------------------------------------------------------
# new method: make_dtb_action_orders
#--------------------------------------------------------------------------
def self.make_dtb_action_orders
@action_battlers = []
@action_battlers += $game_party.members unless @surprise
@action_battlers += $game_troop.members unless @preemptive
@action_battlers.each {|battler| battler.make_speed }
@action_battlers.sort! {|a,b| b.speed - a.speed }
end
#--------------------------------------------------------------------------
# overwrite method: turn_start
#--------------------------------------------------------------------------
def self.turn_start
@phase = :turn
clear_actor
$game_troop.increase_turn
@performed_battlers = []
make_action_orders
end
#--------------------------------------------------------------------------
# overwrite method: next_subject
#--------------------------------------------------------------------------
def self.next_subject
@performed_battlers = [] if @performed_battlers.nil?
loop do
@action_battlers -= @performed_battlers
battler = @action_battlers.shift
return nil unless battler
next unless battler.index && battler.alive?
@performed_battlers.push(battler)
return battler
end
end
#--------------------------------------------------------------------------
# overwrite method: force_action
#--------------------------------------------------------------------------
def self.force_action(battler)
@action_forced = [] if @action_forced == nil
@action_forced.push(battler)
return unless Switch.forced_action_remove
@action_battlers.delete(battler)
end
#--------------------------------------------------------------------------
# overwrite method: action_forced?
#--------------------------------------------------------------------------
def self.action_forced?
@action_forced != nil
end
#--------------------------------------------------------------------------
# overwrite method: action_forced_battler
#--------------------------------------------------------------------------
def self.action_forced_battler
@action_forced.shift
end
#--------------------------------------------------------------------------
# overwrite method: clear_action_force
#--------------------------------------------------------------------------
def self.clear_action_force
return if @action_forced.nil?
@action_forced = nil if @action_forced.empty?
end
#--------------------------------------------------------------------------
# new method: self.init_battle_type
#--------------------------------------------------------------------------
def self.init_battle_type
set_btype($game_system.battle_system)
end
#--------------------------------------------------------------------------
# new method: self.set_btype
#--------------------------------------------------------------------------
def self.set_btype(btype = :dtb)
@battle_type = btype
end
#--------------------------------------------------------------------------
# new method: self.btype?
#--------------------------------------------------------------------------
def self.btype?(btype)
return @battle_type == btype
end
end # BattleManager
#==============================================================================
# ?! Game_System
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# new method: battle_system
#--------------------------------------------------------------------------
def battle_system
if @battle_system.nil?
return battle_system_corrected(YEA::BATTLE::DEFAULT_BATTLE_SYSTEM)
else
return battle_system_corrected(@battle_system)
end
end
#--------------------------------------------------------------------------
# new method: set_battle_system
#--------------------------------------------------------------------------
def set_battle_system(type)
case type
when :dtb; @battle_system = :dtb
when :ftb; @battle_system = $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
else; @battle_system = :dtb
end
end
#--------------------------------------------------------------------------
# new method: battle_system_corrected
#--------------------------------------------------------------------------
def battle_system_corrected(type)
case type
when :dtb; return :dtb
when :ftb; return $imported["YEA-BattleSystem-FTB"] ? :ftb : :dtb
else; return :dtb
end
end
end # Game_System
#==============================================================================
# ?! Sprite_Base
#==============================================================================
class Sprite_Base < Sprite
#--------------------------------------------------------------------------
# new method: start_pseudo_animation
#--------------------------------------------------------------------------
unless $imported["YEA-CoreEngine"]
def start_pseudo_animation(animation, mirror = false)
dispose_animation
@animation = animation
return if @animation.nil?
@ani_mirror = mirror
set_animation_rate
@ani_duration = @animation.frame_max * @ani_rate + 1
@ani_sprites = []
end
end # $imported["YEA-CoreEngine"]
end # Sprite_Base
#==============================================================================
# ?! Sprite_Battler
#==============================================================================
class Sprite_Battler < Sprite_Base
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :effect_type
attr_accessor :battler_visible
attr_accessor :popups
#--------------------------------------------------------------------------
# alias method: initialize
#--------------------------------------------------------------------------
alias sprite_battler_initialize_abe initialize
def initialize(viewport, battler = nil)
sprite_battler_initialize_abe(viewport, battler)
@popups = []
@popup_flags = []
end
#--------------------------------------------------------------------------
# alias method: update_bitmap
#--------------------------------------------------------------------------
alias sprite_battler_update_bitmap_abe update_bitmap
def update_bitmap
return if @battler.actor? && @battler.battler_name == ""
sprite_battler_update_bitmap_abe
end
#--------------------------------------------------------------------------
# alias method: setup_new_animation
#--------------------------------------------------------------------------
unless $imported["YEA-CoreEngine"]
alias sprite_battler_setup_new_animation_abe setup_new_animation
def setup_new_animation
sprite_battler_setup_new_animation_abe
return if @battler.pseudo_ani_id <= 0
animation = $data_animations[@battler.pseudo_ani_id]
mirror = @battler.animation_mirror
start_pseudo_animation(animation, mirror)
@battler.pseudo_ani_id = 0
end
end # $imported["YEA-CoreEngine"]
#--------------------------------------------------------------------------
# alias method: setup_new_effect
#--------------------------------------------------------------------------
alias sprite_battler_setup_new_effect_abe setup_new_effect
def setup_new_effect
sprite_battler_setup_new_effect_abe
setup_popups
end
#--------------------------------------------------------------------------
# new method: setup_popups
#--------------------------------------------------------------------------
def setup_popups
return unless @battler.use_sprite?
@battler.popups = [] if @battler.popups.nil?
return if @battler.popups == []
array = @battler.popups.shift
create_new_popup(array[0], array[1], array[2])
end
#--------------------------------------------------------------------------
# new method: create_new_popup
#--------------------------------------------------------------------------
def create_new_popup(value, rules, flags)
return if @battler == nil
return if flags & @popup_flags != []
array = YEA::BATTLE::POPUP_RULES[rules]
for popup in @popups
popup.y -= 24
end
return unless SceneManager.scene.is_a?(Scene_Battle)
return if SceneManager.scene.spriteset.nil?
view = SceneManager.scene.spriteset.viewportPopups
new_popup = Sprite_Popup.new(view, @battler, value, rules, flags)
@popups.push(new_popup)
@popup_flags.push("weakness") if flags.include?("weakness")
@popup_flags.push("resistant") if flags.include?("resistant")
@popup_flags.push("immune") if flags.include?("immune")
@popup_flags.push("absorbed") if flags.include?("absorbed")
end
#--------------------------------------------------------------------------
# alias method: update_effect
#--------------------------------------------------------------------------
alias sprite_battler_update_effect_abe update_effect
def update_effect
sprite_battler_update_effect_abe
update_popups
end
#--------------------------------------------------------------------------
# new method: update_popups
#--------------------------------------------------------------------------
def update_popups
for popup in @popups
popup.update
next unless popup.opacity <= 0
popup.bitmap.dispose
popup.dispose
@popups.delete(popup)
popup = nil
end
@popup_flags = [] if @popups == [] && @popup_flags != []
return unless SceneManager.scene_is?(Scene_Battle)
if @current_active_battler != SceneManager.scene.subject
@current_active_battler = SceneManager.scene.subject
@popup_flags = []
end
end
end # Sprite_Battler
#==============================================================================
# ?! Sprite_Popup
#==============================================================================
class Sprite_Popup < Sprite_Base
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :flags
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize(viewport, battler, value, rules, flags)
super(viewport)
@value = value
@rules = rules
@rules = "DEFAULT" unless YEA::BATTLE::POPUP_RULES.include?(@rules)
@fade = YEA::BATTLE::POPUP_SETTINGS[:fade]
@full = YEA::BATTLE::POPUP_SETTINGS[:full]
@flags = flags
@battler = battler
create_popup_bitmap
end
#--------------------------------------------------------------------------
# create_popup_bitmap
#--------------------------------------------------------------------------
def create_popup_bitmap
rules_array = YEA::BATTLE::POPUP_RULES[@rules]
bw = Graphics.width
bw += 48 if @flags.include?("state")
bh = Font.default_size * 3
bitmap = Bitmap.new(bw, bh)
bitmap.font.name = rules_array[8]
size = @flags.include?("critical") ? rules_array[2] * 1.2 : rules_array[2]
bitmap.font.size = size
bitmap.font.bold = rules_array[3]
bitmap.font.italic = rules_array[4]
if flags.include?("critical")
crit = YEA::BATTLE::POPUP_RULES["CRITICAL"]
bitmap.font.out_color.set(crit[5], crit[6], crit[7], 255)
else
bitmap.font.out_color.set(0, 0, 0, 255)
end
dx = 0; dy = 0; dw = 0
dx += 24 if @flags.include?("state")
dw += 24 if @flags.include?("state")
if @flags.include?("state") || @flags.include?("buff")
c_width = bitmap.text_size(@value).width
icon_bitmap = $game_temp.iconset
icon_index = flag_state_icon
rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
bitmap.blt(dx+(bw-c_width)/2-36, (bh - 24)/2, icon_bitmap, rect, 255)
end
bitmap.font.color.set(rules_array[5], rules_array[6], rules_array[7])
bitmap.draw_text(dx, dy, bw-dw, bh, @value, 1)
self.bitmap = bitmap
self.x = @battler.screen_x
self.x += rand(4) - rand(4) if @battler.sprite.popups.size >= 1
self.x -= SceneManager.scene.spriteset.viewport1.ox
self.y = @battler.screen_y - @battler.sprite.oy/2
self.y -= @battler.sprite.oy/2 if @battler.actor?
self.y -= SceneManager.scene.spriteset.viewport1.oy
self.ox = bw/2; self.oy = bh/2
self.zoom_x = self.zoom_y = rules_array[0]
if @flags.include?("no zoom")
self.zoom_x = self.zoom_y = rules_array[1]
end
@target_zoom = rules_array[1]
@zoom_direction = (self.zoom_x > @target_zoom) ? "down" : "up"
self.z = 500
end
#--------------------------------------------------------------------------