forked from MoogleX/MV_Plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMoogle_X_TraitsExtensionBundle.js
1689 lines (1516 loc) · 65.7 KB
/
Moogle_X_TraitsExtensionBundle.js
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
//=============================================================================
// Traits Extension Bundle by Moogle_X
// Moogle_X_TraitsExtensionBundle.js
// Created on: February 1st 2016
//=============================================================================
var Imported = Imported || {};
Imported.Moogle_X_TEB = true;
var Moogle_X = Moogle_X || {};
Moogle_X.TEB = Moogle_X.TEB || {};
//=============================================================================
/*:
* @plugindesc v1.02 Adds plenty of new traits to your game.
* @author Moogle_X
*
* @param Victory Cry Revival
* @desc Allows Victory Cry to revive dead actor? 1:Yes 0:No
* @default 1
*
* @param Catnip Damage
* @desc This is the damage value when Catnip trait is in effect.
* @default 9999
*
* @param Apply Catnip on Effects
* @desc Allows Catnip to modify skill/item's effects amount? 1:Yes 0:No
* @default 1
*
* @param Apply BER to Inactive
* @desc Apply Battle End Regeneration (BER) to inactive party members? 1:Yes 0:No
* @default 0
*
* @param Natural Cure List
* @desc This is the list of state id(s) that will be removed by Natural Cure. Example: 3 6 12
* @default 4 5 6 7 8 9 10
*
* @param Spellbound List
* @desc This is the list of state id(s) that will be affected by Spellbound. Example: 3 6 12
* @default 14 15 16
*
* @help
* ============================================================================
* Introduction
* ============================================================================
* This plugin adds plenty of new traits to your game.
* All of these new traits will be carried over with Passive Skills.
*
* ============================================================================
* 1. Victory Cry
* ============================================================================
* Notetag: <TEB Victory Cry>
* Usable on: Actors, Classes, Weapons, Armors, States.
* Description:
* Heal actor at full HP and MP at the end of battle. Turn on "Victory Cry
* Revival" parameter if you want this trait to affect dead actor.
*
* Source: Shin Megami Tensei series.
*
* ============================================================================
* 2. Catnip
* ============================================================================
* Notetag: <TEB Catnip>
* Usable on: Actors, Classes, Weapons, Armors, States, Enemies.
* Description:
* When in critical health (< 25% MaxHP), "damage value" (damage or healing)
* automatically becomes 9999. Value can be changed in "Catnip Damage" plugin
* parameter.
* Catnip trait also affects skill/item's effects, in particular:
* - Recover HP
* - Recover MP
* - Gain TP
* All of those effects' values will become 9999 as well when user is in
* critical health. If you want to disable Catnip value modification on above
* three effects, simply turn off "Apply Catnip on Effects" parameter in the
* plugin configurations.
*
* Source: Final Fantasy X-2.
*
* ============================================================================
* 3. Initial Battle State (IBS)
* ============================================================================
* Notetag: <TEB IBS: x> // Change x to state ID.
* Usable on: Actors, Classes, Weapons, Armors, States, Enemies.
* Description:
* On battle start, add state x to this battler. This trait is handy if want
* a battler start with certain (impermanent) state at the start of battle.
* Insert multiple copies of this notetag for multiple Initial Battle States.
*
* Source: Persona 4 (Auto-Tarukaja).
*
* ============================================================================
* 4. Initial Battle State - Party (IBSP)
* ============================================================================
* Notetag: <TEB IBSP: x> // Change x to state ID.
* Usable on: Actors, Classes, Weapons, Armors, States.
* Description:
* On battle start, add state x to all actors in active battle party. This
* trait is similar with IBS, except it applies to whole party. Also, you
* can't use it on Enemies. Insert multiple copies of this notetag for
* multiple Initial Battle States on party.
*
* Source: Persona 4 (Auto-Matarukaja).
*
* ============================================================================
* 5. Discount
* ============================================================================
* Notetag: <TEB Discount: x%>
* Usable on: Actors, Classes, Weapons, Armors, States.
* Description:
* Decrease the buying price of all items in the shop by x%.
* Shop will combine the total discount rate of all members in active battle
* party only. Discount rate from inactive party members will be excluded.
*
* If Potion has normal price of 200 and party has 25% total discount rate,
* the Potion will have the price reduced to 150.
*
* Multiple copies of this trait will be additive instead of multiplicative.
* There is a cap for maximum total discount rate. Total discount rate is
* capped at 100% (obviously).
*
* Source: Ragnarok Online (Merchant's Discount Skill).
*
* ============================================================================
* 6. Overcharge
* ============================================================================
* Notetag: <TEB Overcharge: x%>
* Usable on: Actors, Classes, Weapons, Armors, States.
* Description:
* Increase the selling price of all items in the shop by x%.
* Shop will combine the total overcharge rate of all members in active battle
* party only. Overcharge rate from inactive party members will be excluded.
*
* If Potion has standard selling price of 100 and party has 10% total
* overcharge rate, the Potion will have the selling price increased to 110.
*
* Multiple copies of this trait will be additive instead of multiplicative.
* There is no cap for maximum total overcharge rate. Please watch out for
* potential infinite money issue.
*
* Source: Ragnarok Online (Merchant's Overcharge Skill).
*
* ============================================================================
* 7. Static Regeneration (SR)
* ============================================================================
* Notetag: <TEB SR HP: x>
* <TEB SR HP: -x>
* <TEB SR MP: x>
* <TEB SR MP: -x>
*
* Usable on: Actors, Classes, Weapons, Armors, States, Enemies.
* Description:
* By default, you can only apply regeneration based on percentage value only
* like 10% of Max HP or Max MP. Now, you can apply static value regeneration
* like straight up +1245 HP or -15 MP regeneration.
*
* Multiple copies of these traits will be additive (obviously).
*
* ============================================================================
* 8. Battle End Regeneration (BER)
* ============================================================================
* Notetag: <TEB BER HP: x%> // Percentage HP increase.
* <TEB BER HP: -x%> // Percentage HP decrease.
* <TEB BER HP: x> // Static HP increase.
* <TEB BER HP: -x> // Static HP decrease.
* <TEB BER MP: x%> // Percentage MP increase.
* <TEB BER MP: -x%> // Percentage MP decrease.
* <TEB BER MP: x> // Static MP increase.
* <TEB BER MP: -x> // Static MP decrease.
* <TEB BER TP: x%> // Percentage TP increase.
* <TEB BER TP: -x%> // Percentage TP decrease.
* <TEB BER TP: x> // Static TP increase.
* <TEB BER TP: -x> // Static TP decrease.
*
* Usable on: Actors, Classes, Weapons, Armors, States.
* Description:
* Another set of regeneration traits that occur at the END OF BATTLE only.
* These regeneration will be applied to all actors in active battle party
* only if the battle resulted in victory. Escape and losing won't trigger
* any regeneration.
*
* By default, inactive party members do NOT receive any regeneration from
* these traits. If you want inactive party members to be affected by These
* traits, you must turn on the "Apply BER to Inactive" parameter in the
* plugin configurations.
*
* Dead actors will not receive any regeneration from these traits.
*
* ============================================================================
* 9. Piercing Magic
* ============================================================================
* Notetag: <TEB Piercing Magic>
* Usable on: Actors, Classes, Weapons, Armors, States, Enemies.
* Description:
* All actors and enemies with this trait will not trigger Magic Reflection
* when they use magical skills.
*
* Source: Final Fantasy series.
*
* ============================================================================
* 10. Ignore Counter
* ============================================================================
* Notetag: <TEB Ignore Counter>
* Usable on: Actors, Classes, Weapons, Armors, States, Enemies.
* Description:
* All actors and enemies with this trait will not trigger Counter Attack
* when they use physical skills.
*
* ============================================================================
* 11. Natural Cure
* ============================================================================
* Notetag: <TEB Natural Cure: x%>
* Usable on: Actors, Classes, Weapons, Armors, States, Enemies.
* Description:
* All actors and enemies with this trait will have x% chance to remove some
* predefined states at the end of each turn. You can decide which states
* to be removed by this trait in the "Natural Cure List" plugin parameter.
*
* Multiple copies of this trait will be additive instead of multiplicative.
*
* Source: Pokemon (Shed Skin ability).
*
* ============================================================================
* 12. Spellbound
* ============================================================================
* Notetag: <TEB Spellbound: x>
* Usable on: Actors, Classes, Weapons, Armors, States, Enemies.
* Description:
* All actors and enemies with this trait will get extra x turns duration
* for certain states. In other words, their states' duration will last longer
* than usual.
*
* You can decide which states to be affected by Spellbound trait in the
* "Spellbound List" parameter in the plugin configuration. Any states not
* listed in that parameter will not receive duration bonus.
*
* Multiple copies of this trait will be additive instead of multiplicative.
*
* Source: FFTA2 (Time Mage's Extend spell).
*
* ============================================================================
* 13. Static Parameter Bonus (SPB)
* ============================================================================
* Notetag: <TEB SPB MHP: x> // +x Max HP bonus.
* <TEB SPB MHP: -x> // -x Max HP bonus.
* <TEB SPB MMP: x> // +x Max MP bonus.
* <TEB SPB MMP: -x> // -x Max MP bonus.
* <TEB SPB ATK: x> // +x Attack bonus.
* <TEB SPB ATK: -x> // -x Attack bonus.
* <TEB SPB DEF: x> // +x Defense bonus.
* <TEB SPB DEF: -x> // -x Defense bonus.
* <TEB SPB MAT: x> // +x Magic Attack bonus.
* <TEB SPB MAT: -x> // -x Magic Attack bonus.
* <TEB SPB MDF: x> // +x Magic Defense bonus.
* <TEB SPB MDF: -x> // -x Magic Defense bonus.
* <TEB SPB AGI: x> // +x Agility bonus.
* <TEB SPB AGI: -x> // -x Agility bonus.
* <TEB SPB LUK: x> // +x Luck bonus.
* <TEB SPB LUK: -x> // -x Luck bonus.
*
* Usable on: Actors, Classes, Weapons, Armors, States, Enemies.
* Description:
* By default, you can only apply parameter bonus based on percentage value
* only like 120% Attack or 150% Magic. Now, you can apply static parameter
* bonus like +35 Max HP or -40 Agility.
*
* Multiple copies of these traits will be additive.
*
* ============================================================================
* 14. Full HP Bonus (FHB)
* ============================================================================
* Notetag: <TEB FHB ATK: x%> // x% Attack rate multiplier.
* <TEB FHB DEF: x%> // x% Defense rate multiplier.
* <TEB FHB MAT: x%> // x% Magic Attack rate multiplier.
* <TEB FHB MDF: x%> // x% Magic Defense rate multiplier.
* <TEB FHB AGI: x%> // x% Agility rate multiplier.
* <TEB FHB LUK: x%> // x% Luck rate multiplier.
*
* <TEB FHB ATK: x> // +x Attack bonus.
* <TEB FHB ATK: -x> // -x Attack bonus.
* <TEB FHB DEF: x> // +x Defense bonus.
* <TEB FHB DEF: -x> // -x Defense bonus.
* <TEB FHB MAT: x> // +x Magic Attack bonus.
* <TEB FHB MAT: -x> // -x Magic Attack bonus.
* <TEB FHB MDF: x> // +x Magic Defense bonus.
* <TEB FHB MDF: -x> // -x Magic Defense bonus.
* <TEB FHB AGI: x> // +x Agility bonus.
* <TEB FHB AGI: -x> // -x Agility bonus.
* <TEB FHB LUK: x> // +x Luck bonus.
* <TEB FHB LUK: -x> // -x Luck bonus.
*
* Usable on: Actors, Classes, Weapons, Armors, States, Enemies.
* Description:
* "Full HP Bonus" is special kind of trait that will activate whenever the
* user is at full HP. You can assign rate multiplier like 125% Attack or you
* can assign a static parameter bonus like +55 Agility.
*
* Any parameter changes made by this trait will disappear as soon the user
* no longer at full HP.
*
* Multiple copies of these traits will be additive (for static parameter
* bonus) and multiplicative (for rate multiplier).
*
* ============================================================================
* 15. Critical HP Bonus (CHB)
* ============================================================================
* Notetag: <TEB CHB ATK: x%> // x% Attack rate multiplier.
* <TEB CHB DEF: x%> // x% Defense rate multiplier.
* <TEB CHB MAT: x%> // x% Magic Attack rate multiplier.
* <TEB CHB MDF: x%> // x% Magic Defense rate multiplier.
* <TEB CHB AGI: x%> // x% Agility rate multiplier.
* <TEB CHB LUK: x%> // x% Luck rate multiplier.
*
* <TEB CHB ATK: x> // +x Attack bonus.
* <TEB CHB ATK: -x> // -x Attack bonus.
* <TEB CHB DEF: x> // +x Defense bonus.
* <TEB CHB DEF: -x> // -x Defense bonus.
* <TEB CHB MAT: x> // +x Magic Attack bonus.
* <TEB CHB MAT: -x> // -x Magic Attack bonus.
* <TEB CHB MDF: x> // +x Magic Defense bonus.
* <TEB CHB MDF: -x> // -x Magic Defense bonus.
* <TEB CHB AGI: x> // +x Agility bonus.
* <TEB CHB AGI: -x> // -x Agility bonus.
* <TEB CHB LUK: x> // +x Luck bonus.
* <TEB CHB LUK: -x> // -x Luck bonus.
*
* Usable on: Actors, Classes, Weapons, Armors, States, Enemies.
* Description:
* "Critical HP Bonus" is similar with "Full HP Bonus" trait. This trait will
* activate whenever the user is at critical HP (less than 25% HP). You can
* assign rate multiplier like 150% Attack or static parameter bonus like
* +125 Magic Attack.
*
* Any parameter changes made by this trait will disappear as soon the user
* no longer at critical HP.
*
* Multiple copies of these traits will be additive (for static parameter
* bonus) and multiplicative (for rate multiplier).
*
* ============================================================================
* 16. Mana Switch
* ============================================================================
* Notetag: <TEB Mana Switch>
*
* Usable on: Actors, Classes, Weapons, Armors, States, Enemies.
* Description:
* As long as the user possesses this trait, user's Max HP and Max MP
* parameters will be switched. If the battler didn't possess this trait
* previously, and then later on receive this trait by any means (from states,
* equipment, passive skill, etc) the battler CURRENT HP and MP value will be
* switched as well.
*
* ============================================================================
* 17. Power Swap
* ============================================================================
* Notetag: <TEB Power Swap>
*
* Usable on: Actors, Classes, Weapons, Armors, States, Enemies.
* Description:
* As long as the user possesses this trait, user's Attack parameter and Magic
* Attack parameter will be switched.
*
* ============================================================================
* 18. Guard Swap
* ============================================================================
* Notetag: <TEB Guard Swap>
*
* Usable on: Actors, Classes, Weapons, Armors, States, Enemies.
* Description:
* As long as the user possesses this trait, user's Defense parameter and
* Magic Defense parameter will be switched.
*
* Source: Pokemon (Wonder Room move).
*
* ============================================================================
* Notetags and Plugin Commands List
* ============================================================================
* Actors, Classes, Weapons, Armors, and States Notetag:
* <TEB Victory Cry>
* <TEB IBSP: x>
* <TEB Discount: x%>
* <TEB Overcharge: x%>
* <TEB BER HP: x%>
* <TEB BER HP: -x%>
* <TEB BER HP: x>
* <TEB BER HP: -x>
* <TEB BER MP: x%>
* <TEB BER MP: -x%>
* <TEB BER MP: x>
* <TEB BER MP: -x>
* <TEB BER TP: x%>
* <TEB BER TP: -x%>
* <TEB BER TP: x>
* <TEB BER TP: -x>
*
* Actors, Classes, Weapons, Armors, States, and Enemies Notetag:
* <TEB Catnip>
* <TEB IBS: x>
* <TEB SR HP: x>
* <TEB SR HP: -x>
* <TEB SR MP: x>
* <TEB SR MP: -x>
* <TEB Piercing Magic>
* <TEB Ignore Counter>
* <TEB Natural Cure: x%>
* <TEB Spellbound: x>
* <TEB Mana Switch>
* <TEB Power Swap>
* <TEB Guard Swap>
*
* <TEB SPB MHP: x>
* <TEB SPB MHP: -x>
* <TEB SPB MMP: x>
* <TEB SPB MMP: -x>
* <TEB SPB ATK: x>
* <TEB SPB ATK: -x>
* <TEB SPB DEF: x>
* <TEB SPB DEF: -x>
* <TEB SPB MAT: x>
* <TEB SPB MAT: -x>
* <TEB SPB MDF: x>
* <TEB SPB MDF: -x>
* <TEB SPB AGI: x>
* <TEB SPB AGI: -x>
* <TEB SPB LUK: x>
* <TEB SPB LUK: -x>
*
* <TEB FHB ATK: x%>
* <TEB FHB DEF: x%>
* <TEB FHB MAT: x%>
* <TEB FHB MDF: x%>
* <TEB FHB AGI: x%>
* <TEB FHB LUK: x%>
* <TEB FHB ATK: x>
* <TEB FHB ATK: -x>
* <TEB FHB DEF: x>
* <TEB FHB DEF: -x>
* <TEB FHB MAT: x>
* <TEB FHB MAT: -x>
* <TEB FHB MDF: x>
* <TEB FHB MDF: -x>
* <TEB FHB AGI: x>
* <TEB FHB AGI: -x>
* <TEB FHB LUK: x>
* <TEB FHB LUK: -x>
*
* <TEB CHB ATK: x%>
* <TEB CHB DEF: x%>
* <TEB CHB MAT: x%>
* <TEB CHB MDF: x%>
* <TEB CHB AGI: x%>
* <TEB CHB LUK: x%>
* <TEB CHB ATK: x>
* <TEB CHB ATK: -x>
* <TEB CHB DEF: x>
* <TEB CHB DEF: -x>
* <TEB CHB MAT: x>
* <TEB CHB MAT: -x>
* <TEB CHB MDF: x>
* <TEB CHB MDF: -x>
* <TEB CHB AGI: x>
* <TEB CHB AGI: -x>
* <TEB CHB LUK: x>
* <TEB CHB LUK: -x>
*
* ============================================================================
* Compatibility
* ============================================================================
* This plugin must be positioned BELOW any of these plugins:
*
* YEP_ShopMenuCore
* YEP_ElementReflect
*
* If you use any of the above plugins, please make sure to position Traits
* Extension Bundle plugin under those plugins.
*
* ============================================================================
* Terms of Use
* ============================================================================
* Free to use in both commercial and non-commercial project as long as credit
* is given.
*
* ============================================================================
* Change Log
* ============================================================================
* Version 1.02:
* - Added TP regen option for "Battle End Regeneration".
* - Added "Critical HP Bonus" trait.
* - Added "Mana Switch" trait.
* - Added "Power Swap" trait.
* - Added "Guard Swap" trait.
*
* Version 1.01:
* - Changed "Battle End Regeneration" condition to battle victory only.
* - Added "Static Parameter Bonus" trait.
* - Added "Full HP Bonus" trait.
*
* Version 1.0:
* - Completed plugin.
*
*/
//=============================================================================
(function() { // IIFE
//=============================================================================
// Parameter Variables
//=============================================================================
Moogle_X.TEB.parameters = PluginManager.parameters('Moogle_X_TraitsExtensionBundle');
Moogle_X.TEB.vCryRevive = Number(Moogle_X.TEB.parameters['Victory Cry Revival']) != 0;
Moogle_X.TEB.catnipDamage = Number(Moogle_X.TEB.parameters['Catnip Damage'] || 0);
Moogle_X.TEB.catnipEffect = Number(Moogle_X.TEB.parameters['Apply Catnip on Effects']) != 0;
Moogle_X.TEB.berInactive = Number(Moogle_X.TEB.parameters['Apply BER to Inactive']) != 0;
Moogle_X.TEB.ntrCureList = String(Moogle_X.TEB.parameters['Natural Cure List'] || 0);
Moogle_X.TEB.spellboundList = String(Moogle_X.TEB.parameters['Spellbound List'] || 0);
var ntrCureAilments = Moogle_X.TEB.ntrCureList.split(' ');
Moogle_X.TEB.ntrCureList = [];
for (var i = 0; i < ntrCureAilments.length; i++) {
Moogle_X.TEB.ntrCureList.push(Number(ntrCureAilments[i]));
}
var spellboundStates = Moogle_X.TEB.spellboundList.split(' ');
Moogle_X.TEB.spellboundList = [];
for (var i = 0; i < spellboundStates.length; i++) {
Moogle_X.TEB.spellboundList.push(Number(spellboundStates[i]));
}
//=============================================================================
// Constant Declaration
//=============================================================================
Game_BattlerBase.TRAIT_TEB_VICTORY_CRY = 127; // New trait code.
Game_BattlerBase.TRAIT_TEB_CATNIP = 128; // New trait code.
Game_BattlerBase.TRAIT_TEB_IBS = 129; // New trait code.
Game_BattlerBase.TRAIT_TEB_IBSP = 130; // New trait code.
Game_BattlerBase.TRAIT_TEB_DISCOUNT = 131; // New trait code.
Game_BattlerBase.TRAIT_TEB_OVERCHARGE = 132; // New trait code.
Game_BattlerBase.TRAIT_TEB_STATIC_HP_REGEN = 134; // New trait code.
Game_BattlerBase.TRAIT_TEB_STATIC_MP_REGEN = 135; // New trait code.
Game_BattlerBase.TRAIT_TEB_BER_HP_STATIC = 136; // New trait code.
Game_BattlerBase.TRAIT_TEB_BER_HP_PERCENTAGE = 137; // New trait code.
Game_BattlerBase.TRAIT_TEB_BER_MP_STATIC = 138; // New trait code.
Game_BattlerBase.TRAIT_TEB_BER_MP_PERCENTAGE = 139; // New trait code.
Game_BattlerBase.TRAIT_TEB_PIERCING_MAGIC = 140; // New trait code.
Game_BattlerBase.TRAIT_TEB_IGNORE_COUNTER = 141; // New trait code.
Game_BattlerBase.TRAIT_TEB_NATURAL_CURE = 142; // New trait code.
Game_BattlerBase.TRAIT_TEB_SPELLBOUND = 143; // New trait code.
Game_BattlerBase.TRAIT_TEB_STATIC_PARAMETER_BONUS = 144; // New trait code.
Game_BattlerBase.TRAIT_TEB_FHB_RATE = 145; // New trait code.
Game_BattlerBase.TRAIT_TEB_FHB_STATIC = 146; // New trait code.
Game_BattlerBase.TRAIT_TEB_BER_TP_STATIC = 147; // New trait code.
Game_BattlerBase.TRAIT_TEB_BER_TP_PERCENTAGE = 148; // New trait code.
Game_BattlerBase.TRAIT_TEB_CHB_RATE = 149; // New trait code.
Game_BattlerBase.TRAIT_TEB_CHB_STATIC = 150; // New trait code.
Game_BattlerBase.TRAIT_TEB_MANA_SWITCH = 151; // New trait code.
Game_BattlerBase.TRAIT_TEB_POWER_SWAP = 152; // New trait code.
Game_BattlerBase.TRAIT_TEB_GUARD_SWAP = 153; // New trait code.
//=============================================================================
// DataManager
//=============================================================================
Moogle_X.TEB.DatabaseLoaded = false;
Moogle_X.TEB.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
DataManager.isDatabaseLoaded = function() {
if (!Moogle_X.TEB.DataManager_isDatabaseLoaded.call(this)) return false;
if (!Moogle_X.TEB.DatabaseLoaded) {
DataManager.readNotetags_TEB1($dataActors);
DataManager.readNotetags_TEB1($dataClasses);
DataManager.readNotetags_TEB1($dataWeapons);
DataManager.readNotetags_TEB1($dataArmors);
DataManager.readNotetags_TEB1($dataStates);
DataManager.readNotetags_TEB2($dataActors);
DataManager.readNotetags_TEB2($dataClasses);
DataManager.readNotetags_TEB2($dataWeapons);
DataManager.readNotetags_TEB2($dataArmors);
DataManager.readNotetags_TEB2($dataStates);
DataManager.readNotetags_TEB2($dataEnemies);
Moogle_X.TEB.DatabaseLoaded = true;
}
return true;
};
DataManager.readNotetags_TEB1 = function(group) {
var note1 = /<(?:TEB VICTORY CRY)>/i;
var note2 = /<(?:TEB IBSP):[ ](\d+)>/i;
var note3 = /<(?:TEB DISCOUNT):[ ](\d+)\%>/i;
var note4 = /<(?:TEB OVERCHARGE):[ ](\d+)\%>/i;
var note5 = /<(?:TEB BER HP):[ ](.*)\%>/i;
var note6 = /<(?:TEB BER HP):[ ](.*)>/i;
var note7 = /<(?:TEB BER MP):[ ](.*)\%>/i;
var note8 = /<(?:TEB BER MP):[ ](.*)>/i;
var note9 = /<(?:TEB BER TP):[ ](.*)\%>/i;
var note10 = /<(?:TEB BER TP):[ ](.*)>/i;
for (var n = 1; n < group.length; n++) {
var obj = group[n];
var notedata = obj.note.split(/[\r\n]+/);
for (var i = 0; i < notedata.length; i++) {
var line = notedata[i];
// Victory Cry
if (line.match(note1)) {
var code = Game_BattlerBase.TRAIT_SPECIAL_FLAG;
var dataId = Game_BattlerBase.TRAIT_TEB_VICTORY_CRY;
var value = 0;
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Initial Battle State - Party
} else if (line.match(note2)) {
var code = Game_BattlerBase.TRAIT_TEB_IBSP;
var dataId = Number(RegExp.$1);
var value = 0;
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Discount
} else if (line.match(note3)) {
var code = Game_BattlerBase.TRAIT_TEB_DISCOUNT;
var dataId = 0;
var value = Number(RegExp.$1) / 100;
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Overcharge
} else if (line.match(note4)) {
var code = Game_BattlerBase.TRAIT_TEB_OVERCHARGE;
var dataId = 0;
var value = Number(RegExp.$1) / 100;
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Battle End Regeneration (HP Percentage)
} else if (line.match(note5)) {
var code = Game_BattlerBase.TRAIT_TEB_BER_HP_PERCENTAGE;
var dataId = 0;
var value = Number(RegExp.$1) / 100;
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Battle End Regeneration (HP Static)
} else if (line.match(note6)) {
var code = Game_BattlerBase.TRAIT_TEB_BER_HP_STATIC;
var dataId = 0;
var value = Number(RegExp.$1);
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Battle End Regeneration (MP Percentage)
} else if (line.match(note7)) {
var code = Game_BattlerBase.TRAIT_TEB_BER_MP_PERCENTAGE;
var dataId = 0;
var value = Number(RegExp.$1) / 100;
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Battle End Regeneration (MP Static)
} else if (line.match(note8)) {
var code = Game_BattlerBase.TRAIT_TEB_BER_MP_STATIC;
var dataId = 0;
var value = Number(RegExp.$1);
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Battle End Regeneration (TP Percentage)
} else if (line.match(note9)) {
var code = Game_BattlerBase.TRAIT_TEB_BER_TP_PERCENTAGE;
var dataId = 0;
var value = Number(RegExp.$1) / 100;
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Battle End Regeneration (TP Static)
} else if (line.match(note10)) {
var code = Game_BattlerBase.TRAIT_TEB_BER_TP_STATIC;
var dataId = 0;
var value = Number(RegExp.$1);
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
}
}
}
};
DataManager.readNotetags_TEB2 = function(group) {
var note1 = /<(?:TEB CATNIP)>/i;
var note2 = /<(?:TEB IBS):[ ](\d+)>/i;
var note3 = /<(?:TEB SR HP):[ ](.*)>/i;
var note4 = /<(?:TEB SR MP):[ ](.*)>/i;
var note5 = /<(?:TEB PIERCING MAGIC)>/i;
var note6 = /<(?:TEB IGNORE COUNTER)>/i;
var note7 = /<(?:TEB NATURAL CURE):[ ](\d+)\%>/i;
var note8 = /<(?:TEB SPELLBOUND):[ ](\d+)>/i;
var note9 = /<(?:TEB SPB MHP):[ ](.*)>/i;
var note10 = /<(?:TEB SPB MMP):[ ](.*)>/i;
var note11 = /<(?:TEB SPB ATK):[ ](.*)>/i;
var note12 = /<(?:TEB SPB DEF):[ ](.*)>/i;
var note13 = /<(?:TEB SPB MAT):[ ](.*)>/i;
var note14 = /<(?:TEB SPB MDF):[ ](.*)>/i;
var note15 = /<(?:TEB SPB AGI):[ ](.*)>/i;
var note16 = /<(?:TEB SPB LUK):[ ](.*)>/i;
var note17 = /<(?:TEB FHB ATK):[ ](\d+)\%>/i;
var note18 = /<(?:TEB FHB DEF):[ ](\d+)\%>/i;
var note19 = /<(?:TEB FHB MAT):[ ](\d+)\%>/i;
var note20 = /<(?:TEB FHB MDF):[ ](\d+)\%>/i;
var note21 = /<(?:TEB FHB AGI):[ ](\d+)\%>/i;
var note22 = /<(?:TEB FHB LUK):[ ](\d+)\%>/i;
var note23 = /<(?:TEB FHB ATK):[ ](.*)>/i;
var note24 = /<(?:TEB FHB DEF):[ ](.*)>/i;
var note25 = /<(?:TEB FHB MAT):[ ](.*)>/i;
var note26 = /<(?:TEB FHB MDF):[ ](.*)>/i;
var note27 = /<(?:TEB FHB AGI):[ ](.*)>/i;
var note28 = /<(?:TEB FHB LUK):[ ](.*)>/i;
var note29 = /<(?:TEB CHB ATK):[ ](\d+)\%>/i;
var note30 = /<(?:TEB CHB DEF):[ ](\d+)\%>/i;
var note31 = /<(?:TEB CHB MAT):[ ](\d+)\%>/i;
var note32 = /<(?:TEB CHB MDF):[ ](\d+)\%>/i;
var note33 = /<(?:TEB CHB AGI):[ ](\d+)\%>/i;
var note34 = /<(?:TEB CHB LUK):[ ](\d+)\%>/i;
var note35 = /<(?:TEB CHB ATK):[ ](.*)>/i;
var note36 = /<(?:TEB CHB DEF):[ ](.*)>/i;
var note37 = /<(?:TEB CHB MAT):[ ](.*)>/i;
var note38 = /<(?:TEB CHB MDF):[ ](.*)>/i;
var note39 = /<(?:TEB CHB AGI):[ ](.*)>/i;
var note40 = /<(?:TEB CHB LUK):[ ](.*)>/i;
var note41 = /<(?:TEB MANA SWITCH)>/i;
var note42 = /<(?:TEB POWER SWAP)>/i;
var note43 = /<(?:TEB GUARD SWAP)>/i;
for (var n = 1; n < group.length; n++) {
var obj = group[n];
var notedata = obj.note.split(/[\r\n]+/);
for (var i = 0; i < notedata.length; i++) {
var line = notedata[i];
// Catnip
if (line.match(note1)) {
var code = Game_BattlerBase.TRAIT_SPECIAL_FLAG;
var dataId = Game_BattlerBase.TRAIT_TEB_CATNIP;
var value = 0;
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Initial Battle State
} else if (line.match(note2)) {
var code = Game_BattlerBase.TRAIT_TEB_IBS;
var dataId = Number(RegExp.$1);
var value = 0;
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Static HP Regeneration
} else if (line.match(note3)) {
var code = Game_BattlerBase.TRAIT_TEB_STATIC_HP_REGEN;
var dataId = 0;
var value = Number(RegExp.$1);
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Static MP Regeneration
} else if (line.match(note4)) {
var code = Game_BattlerBase.TRAIT_TEB_STATIC_MP_REGEN;
var dataId = 0;
var value = Number(RegExp.$1);
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Piercing Magic
} else if (line.match(note5)) {
var code = Game_BattlerBase.TRAIT_SPECIAL_FLAG;
var dataId = Game_BattlerBase.TRAIT_TEB_PIERCING_MAGIC;
var value = 0;
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Ignore Counter
} else if (line.match(note6)) {
var code = Game_BattlerBase.TRAIT_SPECIAL_FLAG;
var dataId = Game_BattlerBase.TRAIT_TEB_IGNORE_COUNTER;
var value = 0;
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Natural Cure
} else if (line.match(note7)) {
var code = Game_BattlerBase.TRAIT_TEB_NATURAL_CURE;
var dataId = 0;
var value = Number(RegExp.$1) / 100;
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Spellbound
} else if (line.match(note8)) {
var code = Game_BattlerBase.TRAIT_TEB_SPELLBOUND;
var dataId = 0;
var value = Number(RegExp.$1);
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Static Max HP Bonus
} else if (line.match(note9)) {
var code = Game_BattlerBase.TRAIT_TEB_STATIC_PARAMETER_BONUS;
var dataId = 0;
var value = Number(RegExp.$1);
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Static Max MP Bonus
} else if (line.match(note10)) {
var code = Game_BattlerBase.TRAIT_TEB_STATIC_PARAMETER_BONUS;
var dataId = 1;
var value = Number(RegExp.$1);
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Static Attack Bonus
} else if (line.match(note11)) {
var code = Game_BattlerBase.TRAIT_TEB_STATIC_PARAMETER_BONUS;
var dataId = 2;
var value = Number(RegExp.$1);
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Static Defense Bonus
} else if (line.match(note12)) {
var code = Game_BattlerBase.TRAIT_TEB_STATIC_PARAMETER_BONUS;
var dataId = 3;
var value = Number(RegExp.$1);
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Static Magic Attack Bonus
} else if (line.match(note13)) {
var code = Game_BattlerBase.TRAIT_TEB_STATIC_PARAMETER_BONUS;
var dataId = 4;
var value = Number(RegExp.$1);
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Static Magic Defense Bonus
} else if (line.match(note14)) {
var code = Game_BattlerBase.TRAIT_TEB_STATIC_PARAMETER_BONUS;
var dataId = 5;
var value = Number(RegExp.$1);
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Static Agility Bonus
} else if (line.match(note15)) {
var code = Game_BattlerBase.TRAIT_TEB_STATIC_PARAMETER_BONUS;
var dataId = 6;
var value = Number(RegExp.$1);
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Static Luck Bonus
} else if (line.match(note16)) {
var code = Game_BattlerBase.TRAIT_TEB_STATIC_PARAMETER_BONUS;
var dataId = 7;
var value = Number(RegExp.$1);
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Full HP Bonus Rate (Attack)
} else if (line.match(note17)) {
var code = Game_BattlerBase.TRAIT_TEB_FHB_RATE;
var dataId = 2;
var value = Number(RegExp.$1) / 100;
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Full HP Bonus Rate (Defense)
} else if (line.match(note18)) {
var code = Game_BattlerBase.TRAIT_TEB_FHB_RATE;
var dataId = 3;
var value = Number(RegExp.$1) / 100;
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Full HP Bonus Rate (Magic Attack)
} else if (line.match(note19)) {
var code = Game_BattlerBase.TRAIT_TEB_FHB_RATE;
var dataId = 4;
var value = Number(RegExp.$1) / 100;
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Full HP Bonus Rate (Magic Defense)
} else if (line.match(note20)) {
var code = Game_BattlerBase.TRAIT_TEB_FHB_RATE;
var dataId = 5;
var value = Number(RegExp.$1) / 100;
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Full HP Bonus Rate (Agility)
} else if (line.match(note21)) {
var code = Game_BattlerBase.TRAIT_TEB_FHB_RATE;
var dataId = 6;
var value = Number(RegExp.$1) / 100;
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Full HP Bonus Rate (Luck)
} else if (line.match(note22)) {
var code = Game_BattlerBase.TRAIT_TEB_FHB_RATE;
var dataId = 7;
var value = Number(RegExp.$1) / 100;
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Full HP Bonus Static (Attack)
} else if (line.match(note23)) {
var code = Game_BattlerBase.TRAIT_TEB_FHB_STATIC;
var dataId = 2;
var value = Number(RegExp.$1);
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Full HP Bonus Static (Defense)
} else if (line.match(note24)) {
var code = Game_BattlerBase.TRAIT_TEB_FHB_STATIC;
var dataId = 3;
var value = Number(RegExp.$1);
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Full HP Bonus Static (Magic Attack)
} else if (line.match(note25)) {
var code = Game_BattlerBase.TRAIT_TEB_FHB_STATIC;
var dataId = 4;
var value = Number(RegExp.$1);
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Full HP Bonus Static (Magic Defense)
} else if (line.match(note26)) {
var code = Game_BattlerBase.TRAIT_TEB_FHB_STATIC;
var dataId = 5;
var value = Number(RegExp.$1);
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Full HP Bonus Static (Agility)
} else if (line.match(note27)) {
var code = Game_BattlerBase.TRAIT_TEB_FHB_STATIC;
var dataId = 6;
var value = Number(RegExp.$1);
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Full HP Bonus Static (Luck)
} else if (line.match(note28)) {
var code = Game_BattlerBase.TRAIT_TEB_FHB_STATIC;
var dataId = 7;
var value = Number(RegExp.$1);
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Critical HP Bonus Rate (Attack)
} else if (line.match(note29)) {
var code = Game_BattlerBase.TRAIT_TEB_CHB_RATE;
var dataId = 2;
var value = Number(RegExp.$1) / 100;
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Critical HP Bonus Rate (Defense)
} else if (line.match(note30)) {
var code = Game_BattlerBase.TRAIT_TEB_CHB_RATE;
var dataId = 3;
var value = Number(RegExp.$1) / 100;
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Critical HP Bonus Rate (Magic Attack)
} else if (line.match(note31)) {
var code = Game_BattlerBase.TRAIT_TEB_CHB_RATE;
var dataId = 4;
var value = Number(RegExp.$1) / 100;
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Critical HP Bonus Rate (Magic Defense)
} else if (line.match(note32)) {
var code = Game_BattlerBase.TRAIT_TEB_CHB_RATE;
var dataId = 5;
var value = Number(RegExp.$1) / 100;
var trait = [{"code":code,"dataId":dataId,"value":value}];
obj.traits = obj.traits.concat(trait);
// Critical HP Bonus Rate (Agility)
} else if (line.match(note33)) {