1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
| =begin
#===============================================================================
Disgaea - Skill level System
#===============================================================================
#Ligne 384 pour l'opacité de cette putain de fenêtre
By GB Production
http://gbproduction.wordpress.com/
I'm french, sorry for my bad english !
Version 1.1
Last date updated : 10/11/2010
This script reproduce the skill level system you can find in Disgaea.
FEATURES :
- Skills now have their own exp list
- Script has a module who separate each skills of the same name
- A lot of possibilities for the skills notetag regarding skill level up
Please report bugs, ask me if you have any suggestions to improve this script.
Credit:
GB Production
Thanks :
Yanfly for code snippet (Windows skill datas)
#===============================================================================
Version history
#===============================================================================
10/11/2010 - v1.1
Minor bug fix
03/11/2010 - Begin and finish v1.0
#===============================================================================
Dev's Blog
#===============================================================================
#===============================================================================
INSTRUCTIONS
#===============================================================================
- Place this script under materials
- Compatibility with YEM Skill Overhaul and YEM battle melody
#==============================================================================
# Tag for SKILL notetag
<no_level>
Means that this skill doesn't have level.
<max_level: x>
Use this tag to set the max level of the skill. In the module configuration, you can choose a default value.
<base_exp: x>
Use this tag to calculate the base exp of the skill.
Ex: <base_exp: 5> You need 5exp for second level and the value increase each level...
<skill_color: x>
If you want, you can choose a different color to display the skill. x is the number of the color on
your window skin.
<cost_change: +x> or <cost_change: -x> or <cost_change: +x%> or <cost_change: -x%>
Use this tag if you want the skill cost to change when level up.
Ex: <cost_change: +5> At lvl2, skill cost +5 At lvl3, skill cost +10...
<change_base_damage: +x> or <change_base_damage: -x>
<change_base_damage: +x%> or <change_base_damage: -x%>
Use this tag to increase/decrease the base damage of the skill at each level up.
<change_stat_f: +x> or <change_stat_f: -x> or <change_stat_f: +x%> or <change_stat_f: -x%>
stat can be atk, spi and def, agi, res, dex if you use YEM battle engine melody
Use this tag to increase/decrease the factor power of the skill at each level up.
<unlock_skillX: Y>
Use this tag allow the skill to unlock the skill X at it level Y.
Ex: <unlock_skill34: 10> The skill unlock the skill ID 34 when it reaches lvl 10.
<add_state+X: Y> <add_state-X: Y>
Use this tag to add a new state X when the skill reaches the level Y.
if +X you add an inflicted state but if -X it's a curative state.
<add_elementX: Y>
Use this tag to add the element X when the skill reaches the level Y.
=end
$imported = {} if $imported == nil
$imported["DisgaeaSkill"] = true
module GBP
module DISGAEA_SKILL
USE_BG_IMAGE = true
BG_FILE_NAME = "Background"
# This hash contains all of the information and data regarding the learn
# data window. Adjust it accordingly.
LEARN_DATA ={
:fontsize => 50,
:skill_cost => "Coût",
:mana_cost_icon => 431, #only need if you don't use YEM battle engine
:dmg_icon => 458,
:heal_icon => 459,
:base_dmg => "Domage de base",
:base_heal => "Soin de base",
:multiplier => "%s +",
:element => "Élément",
:add_state => "Applique",
:rem_state => "Annule",
:stat_rate => "%s Réussite",
:stat_set => "%s Changement",
} # Do not remove this.
#Icon of elements
ELEMENT_ICON = {
# ID => Icon
1 => 344, # feu element.
2 => 345, # glace element.
3 => 346, # Foudre element.
4 => 348, # terre element.
5 => 349, # vent element.
6 => 347, # eau element.
7 => 351, # tenebres element.
8 => 350, # lumiere element.
9 => 410, # neutre element.
11 => 414, # attaque physique element.
} # Do not remove this.
#Witch element do you want to shown ?
SHOWN_ELEMENTS = [3, 4, 5, 6..10]
#The default color for skill color
DEFAULT_SKILL_COLOR = 0
#The default maxlevel for skills
DEFAULT_SKILL_MAXLEVEL = 99
# The default base exp for skills
DEFAULT_SKILL_BASEEXP = 6
#When a skill reaches the max level, their is 3 ways of display the level of the skill :
#Method 1: Normal display, nothing change.
#Method 2: You can display a icon of your choice instead of the level
#Method 3: Use a text of your choice instead of the level
MASTERSKILL_DISPLAY_METHOD = 3
#ID of the icon to display if a skill has reach it max level. Only need to edit if you use the method 2
MASTERSKILL_ICON = 29
#Text to display if a skill has reach it max level. Only need to edit if you use the method 3
MASTERSKILL_TEXT = "Max"
#Here you can try to edit the exp formula at your own risk
def self.skill_exp_formula(base_exp, level)
return base_exp + (level - 1) * base_exp / 2 #edit this line only
end
end #module
end #module
#########################################################################################
#########################################################################################
#########################################################################################
#==============================================================================
# ** RPG::BaseItem
#==============================================================================
module RPG
class Skill < RPG::UsableItem
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :no_level
attr_accessor :max_level
attr_accessor :exp
attr_accessor :total_exp
attr_accessor :level
attr_accessor :cost_change
attr_accessor :cost_change_per
attr_accessor :skill_color
attr_accessor :skill_to_unlock
attr_accessor :custom_data
#--------------------------------------------------------------------------
# * scan
#--------------------------------------------------------------------------
def scan
@custom_data = []
enable_custom_data = false
@bonus_table = []
@exp = 0
@total_exp = 0
@level = 1
@exp_list = []
@state_to_add = {}
@element_to_add = {}
@skill_to_unlock = {}
no_level = /<(?:no_level)>/i
max_level = /<max_level:\s*(\d+)>/i
base_exp = /<base_exp:\s*(\d+)>/i
change_base_damage = /<change_base_damage:[ ]*([\+\-]\d+)>/i
change_base_damage_per = /<change_base_damage:[ ]*([\+\-]\d+)%>/i
change_stat_factor = /<change_(.*)_f:[ ]*([\+\-]\d+)>/i
change_stat_factor_per = /<change_(.*)_f:[ ]*([\+\-]\d+)%>/i
cost_change = /<cost_change:[ ]*([\+\-]\d+)>/i
cost_change_per = /<cost_change:[ ]*([\+\-]\d+)%>/i
add_state = /<add_state([\+\-]\d+):\s*(\d+)>/i
add_element = /<add_element(\d+):\s*(\d+)>/i
skill_color = /<skill_color:\s*(\d+)>/i
unlock_skill = /<unlock_skill(\d+):\s*(\d+)>/i
customdata1 = /<(?:CUSTOM_DATA|custom data)>/i
customdata2 = /<\/(?:CUSTOM_DATA|custom data)>/i
@note.each_line { |line|
case line
when no_level
@no_level = true
when max_level
@max_level = $1.to_i
when skill_color
@skill_color = $1.to_i
when cost_change
@cost_change = $1.to_i
when cost_change_per
@cost_change_per = $1.to_i
when base_exp
@base_exp = $1.to_i
when change_base_damage
@change_base_damage = $1.to_i
when change_base_damage_per
@change_base_damage_per = $1.to_i
when change_stat_factor
case $1.upcase
when "ATK"; @atk_f_change = $2.to_i
when "DEF"; @def_f_change = $2.to_i
when "SPI"; @spi_f_change = $2.to_i
when "DEX"; @dex_f_change = $2.to_i
when "RES"; @res_f_change = $2.to_i
when "AGI"; @agi_f_change = $2.to_i
end #case
when change_stat_factor_per
case $1.upcase
when "ATK"; @atk_f_change_per = $2.to_i
when "DEF"; @def_f_change_per = $2.to_i
when "SPI"; @spi_f_change_per = $2.to_i
when "DEX"; @dex_f_change_per = $2.to_i
when "RES"; @res_f_change_per = $2.to_i
when "AGI"; @agi_f_change_per = $2.to_i
end #case
when add_state
@state_to_add[$2.to_i] = $1.to_i
when add_element
@element_to_add[$2.to_i] = $1.to_i
when unlock_skill
@skill_to_unlock[$2.to_i] = $1.to_i
when customdata1
enable_custom_data = true
when customdata2
enable_custom_data = false
when /(\d+),[ ](.*),[ ](.*)/i
next unless enable_custom_data
array = [$1.to_i, $2.to_s, $3.to_s]
@custom_data.push(array)
end #case
} #each_line
@no_level = false if @no_level.nil?
@max_level = GBP::DISGAEA_SKILL::DEFAULT_SKILL_MAXLEVEL if @max_level.nil?
@base_exp = GBP::DISGAEA_SKILL::DEFAULT_SKILL_BASEEXP if @base_exp.nil?
@skill_color = GBP::DISGAEA_SKILL::DEFAULT_SKILL_COLOR if @skill_color.nil?
@cost_change = 0 if @cost_change.nil?
@cost_change_per = 0 if @cost_change_per.nil?
@change_base_damage = 0 if @change_base_damage.nil?
@change_base_damage_per = 0 if @change_base_damage_per.nil?
@atk_f_change = 0 if @atk_f_change.nil?
@def_f_change = 0 if @def_f_change.nil?
@spi_f_change = 0 if @spi_f_change.nil?
@agi_f_change = 0 if @agi_f_change.nil?
@res_f_change = 0 if @res_f_change.nil?
@dex_f_change = 0 if @dex_f_change.nil?
@atk_f_change_per = 0 if @atk_f_change_per.nil?
@def_f_change_per = 0 if @def_f_change_per.nil?
@spi_f_change_per = 0 if @spi_f_change_per.nil?
@res_f_change_per = 0 if @res_f_change_per.nil?
@dex_f_change_per = 0 if @dex_f_change_per.nil?
@agi_f_change_per = 0 if @agi_f_change_per.nil?
@exp_list[0] = @exp_list[@max_level] = 0
for i in 1..@max_level
@exp_list[i - 1] = GBP::DISGAEA_SKILL.skill_exp_formula(@base_exp, i)
end
end #scan
def plus_state_set
@plus_state_set = @plus_state_set.dup
return @plus_state_set
end
def minus_state_set
@minus_state_set = @minus_state_set.dup
return @minus_state_set
end
def element_set
@element_set = @element_set.dup
return @element_set
end
def gain_exp(amount)
@total_exp += amount
@exp += amount
while @exp >= @exp_list[@level] and @exp_list[@level] > 0
level_up
end
end #def
def level_up
@level = [@level + 1, @max_level].min
unless @state_to_add[@level].nil?
if @state_to_add[@level] > 0
@plus_state_set.push(@state_to_add[@level].abs) unless @plus_state_set.include?(@state_to_add[@level].abs)
else
@minus_state_set.push(@state_to_add[@level].abs) unless @minus_state_set.include?(@state_to_add[@level].abs)
end
end
unless @element_to_add[@level].nil?
@element_set.push(@element_to_add[@level]) unless @element_set.include?(@element_to_add[@level])
end
@base_damage += @change_base_damage
@base_damage += (@base_damage*@change_base_damage_per)/100
@atk_f += @atk_f_change
@spi_f += @spi_f_change
@atk_f += (@atk_f *@atk_f_change_per)/100
@spi_f += (@spi_f *@spi_f_change_per)/100
if $imported["BattleEngineMelody"]
@agi_f += @agi_f_change
@res_f += @res_f_change
@dex_f += @dex_f_change
@def_f += @def_f_change
@def_f += (@def_f *@def_f_change_per)/100
@agi_f += (@agi_f *@agi_f_change_per)/100
@res_f += (@res_f *@res_f_change_per)/100
@dex_f += (@dex_f *@dex_f_change_per)/100
end
@exp -= @exp_list[@level - 1]
end
def exp_needed
return @level == @max_level ? "-------" : @exp_list[@level]
end
def exp_to_next
return @exp_list[@level] - @exp
end
end #class
end #module
#==============================================================================
# ** Window_Base
#==============================================================================
class Window_Base < Window
def draw_skill(skill, x, y, enabled = true)
if skill != nil
unless skill.no_level
if enabled; c1 = text_color(2); c2 = text_color(18); else; c1 = text_color(7); c2 = text_color(8); end
current = skill.exp
max = skill.exp_needed
draw_gauge(current, max, x+2, y-7, 202, c1, c2)
end
draw_icon(skill.icon_index, x+3, y, enabled)
self.contents.font.color = normal_color
self.contents.font.size = 15
self.contents.font.color = text_color(6)
self.contents.font.color.alpha = enabled ? 255 : 128
# self.opacity = 255
if skill.no_level
self.contents.draw_text(x + 82, y+2, 110, WLH, "---", 2)
else
self.contents.draw_text(x + 82, y+2, 120, WLH, Vocab.level_a+skill.level.to_s, 2) unless skill.level == skill.max_level
end
if skill.level == skill.max_level
case GBP::DISGAEA_SKILL::MASTERSKILL_DISPLAY_METHOD
when 1 #normal
self.contents.draw_text(x + 82, y+2, 40, WLH, Vocab.level_a+skill.level.to_s, 2)
when 2 #icon display
draw_icon(GBP::DISGAEA_SKILL::MASTERSKILL_ICON, x+102, y-1, enabled)
when 3 #special text
self.contents.draw_text(x + 82, y+2, 120, WLH, GBP::DISGAEA_SKILL::MASTERSKILL_TEXT, 2)
end #case
end
self.contents.font.color = text_color(skill.skill_color)
self.contents.font.color.alpha = enabled ? 255 : 128
self.contents.draw_text(x + 27, y+2, 230, WLH, skill.name) # self.contents.draw_text(x + 27, y+2, 70, WLH, skill.name)
self.contents.font.size = Font.default_size
self.contents.font.color = normal_color
self.contents.font.color.alpha = 255
end
end
#--------------------------------------------------------------------------
# * Draw gauge
#--------------------------------------------------------------------------
def draw_gauge(current, max, x, y, width, color1, color2)
gw = max.is_a?(String) ? width : width * current / max unless max == 0
gc1 = color1
gc2 = color2
self.contents.fill_rect(x, y + WLH - 2, width, 6, gauge_back_color)
self.contents.gradient_fill_rect(x, y + WLH - 2, gw, 6, gc1, gc2)
end #def
end #class
#==============================================================================
# ** Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# resident_half_mp_cost YEM
#--------------------------------------------------------------------------
def apply_skill_cost_changes(skill, cost, type = "MP")
if $imported["ItemWorld"]
unless half_mp_cost_bonus == 0
cost = [cost - half_mp_cost_bonus, 0].max if GB_Prod::RESIDENT_LIST[:half_mp_cost_resident][6] == "integer"
cost /= half_mp_cost_bonus if GB_Prod::RESIDENT_LIST[:half_mp_cost_resident][6] == "percent"
end
end
cost = apply_skill_cost_state_per(skill, cost, type)
cost = apply_skill_cost_state_set(skill, cost, type)
cost += skill.cost_change*(skill.level-1)
cost += (cost*(skill.cost_change_per*(skill.level-1)))/100
return cost
end
end
#==============================================================================
# ** Window_Skill
#==============================================================================
class Window_Skill < Window_Selectable
def initialize(x, y, width, height, actor)
if $scene.is_a?(Scene_Battle)
super(x, y, width, height)
@column_max = 2
self.opacity = 0
else
super(x, y, width/2, height)
@column_max = 1
self.opacity = 0
end
@actor = actor
self.index = 0
self.opacity = 0
refresh
end
#--------------------------------------------------------------------------
# * Draw Item
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
skill = @data[index]
if skill != nil
rect.width -= 4
enabled = @actor.skill_can_use?(skill)
draw_skill(skill, rect.x, rect.y, enabled)
if $imported["BattleEngineMelody"]
draw_obj_cost(skill, rect.clone, enabled)
else
self.contents.draw_text(rect.clone, @actor.calc_mp_cost(skill), 2)
end
end
end
end #class
#===============================================================================
# ** Window_SkillData
#===============================================================================
class Window_SkillData < Window_Base
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize(actor, main_window)
@actor = actor
@class_id = @actor.class_id
@main_window = main_window
super(@main_window.width, @main_window.y, 240, @main_window.height)
self.width = 272
self.opacity = 0
create_contents
refresh
end
#--------------------------------------------------------------------------
# actor=
#--------------------------------------------------------------------------
def actor=(new_actor)
@actor = new_actor
@class_id = @actor.class_id
refresh
end
#--------------------------------------------------------------------------
# class_id=
#--------------------------------------------------------------------------
def class_id=(new_class)
@class_id = new_class
refresh
end
#--------------------------------------------------------------------------
# update
#--------------------------------------------------------------------------
def update
super
refresh if @skill != @main_window.skill and !@anti_update
end
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@skill = @main_window.skill
return if @skill == nil
draw_obj_name
dy = 72
dy = draw_properties(dy)
end
#--------------------------------------------------------------------------
# draw_properties
#--------------------------------------------------------------------------
def draw_properties(dy)
self.contents.font.size = 20
draw_exp_info
self.contents.font.size = 15
dy = draw_skill_cost(dy)
dy = draw_base_damage(dy)
dy = draw_multipliers(dy)
dy = draw_elements(dy)
dy = draw_plus_states(dy)
dy = draw_minus_states(dy)
dy = draw_custom_data(dy)
self.contents.font.size = Font.default_size
return dy
end
#--------------------------------------------------------------------------
# draw_exp_info
#--------------------------------------------------------------------------
def draw_exp_info
self.contents.font.color = system_color
self.contents.draw_text(0, 24, self.contents.width, WLH, Vocab::ExpTotal+":")
self.contents.draw_text(0, 48, self.contents.width, WLH, sprintf(Vocab::ExpNext, Vocab::level)+":")
self.contents.font.color = normal_color
self.contents.draw_text(0, 24, self.contents.width, WLH, @skill.total_exp, 2)
self.contents.draw_text(0, 48, self.contents.width, WLH, @skill.exp_to_next, 2)
end
#--------------------------------------------------------------------------
# new method: draw_obj_name
#--------------------------------------------------------------------------
def draw_obj_name
draw_icon(@skill.icon_index, 0, 0)
self.contents.font.size = Font.default_size
self.contents.font.color = normal_color
self.contents.font.color = text_color(@skill.skill_color)
self.contents.draw_text(24, 0, contents.width-28, WLH, @skill.name)
self.contents.font.color = text_color(6)
if @skill.no_level
self.contents.draw_text(0, 0, self.contents.width, WLH, "---", 2)
end
if @skill.level == @skill.max_level
case GBP::DISGAEA_SKILL::MASTERSKILL_DISPLAY_METHOD
when 1 #normal
self.contents.draw_text(0, 0, self.contents.width, WLH, Vocab.level_a+@skill.level.to_s, 2)
when 2 #icon display
draw_icon(GBP::DISGAEA_SKILL::MASTERSKILL_ICON, self.contents.width-24, 0)
when 3 #special text
self.contents.draw_text(0, 0, self.contents.width, WLH, GBP::DISGAEA_SKILL::MASTERSKILL_TEXT, 2)
end #case
end
self.contents.font.size = Font.default_size
self.contents.font.color = normal_color
self.contents.font.color.alpha = 255
end
#--------------------------------------------------------------------------
# draw_properties_title
#--------------------------------------------------------------------------
def draw_properties_title(dy)
return dy if dy + WLH > contents.height
self.contents.font.size = GBP::DISGAEA_SKILL::LEARN_DATA[:fontsize]
self.contents.font.color = system_color
text = GBP::DISGAEA_SKILL::LEARN_DATA[:properties]
self.contents.draw_text(4, dy, contents.width-8, WLH, text, 1); dy += WLH
return dy
end
#--------------------------------------------------------------------------
# draw_skill_cost
#--------------------------------------------------------------------------
def draw_skill_cost(dy)
return dy if dy + WLH > contents.height
if $imported["BattleEngineMelody"]
return dy if @actor.custom_skill_costs(@skill, :calc_cost) <= 0
icon = @actor.custom_skill_costs(@skill, :use_icon)
draw_icon(icon, 0, dy)
text = GBP::DISGAEA_SKILL::LEARN_DATA[:skill_cost]
self.contents.font.color = system_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 0)
self.contents.font.color = normal_color
text = @actor.custom_skill_costs(@skill, :text_cost)
text = sprintf(@actor.custom_skill_costs(@skill, :suffix), text)
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 2)
else
return dy if @skill.mp_cost <= 0
icon = GBP::DISGAEA_SKILL::LEARN_DATA[:mana_cost_icon]
draw_icon(icon, 0, dy)
text = GBP::DISGAEA_SKILL::LEARN_DATA[:skill_cost]
self.contents.font.color = system_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 0)
self.contents.font.color = normal_color
text = sprintf("%d%s", @skill.mp_cost, Vocab.mp)
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 2)
end
dy += WLH
return dy
end
#--------------------------------------------------------------------------
# draw_base_damage
#--------------------------------------------------------------------------
def draw_base_damage(dy)
return dy if dy + WLH > contents.height
return dy if (-5..5) === @skill.base_damage
if @skill.base_damage > 0
draw_icon(GBP::DISGAEA_SKILL::LEARN_DATA[:dmg_icon], 0, dy)
text = GBP::DISGAEA_SKILL::LEARN_DATA[:base_dmg]
else
draw_icon(GBP::DISGAEA_SKILL::LEARN_DATA[:heal_icon], 0, dy)
text = GBP::DISGAEA_SKILL::LEARN_DATA[:base_heal]
end
self.contents.font.color = system_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 0)
self.contents.font.color = normal_color
text = (@skill.base_damage).abs
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 2); dy += WLH
return dy
end
#--------------------------------------------------------------------------
# draw_multipliers
#--------------------------------------------------------------------------
def draw_multipliers(dy)
return dy if dy + WLH > contents.height
return dy if @skill.base_damage == 0
icon = @skill.base_damage > 0 ? GBP::DISGAEA_SKILL::LEARN_DATA[:dmg_icon] : GBP::DISGAEA_SKILL::LEARN_DATA[:heal_icon]
#---
if @skill.atk_f > 0
draw_icon(icon, 0, dy)
text = sprintf(GBP::DISGAEA_SKILL::LEARN_DATA[:multiplier], Vocab.atk)
self.contents.font.color = system_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 0)
text = sprintf("%s%%", @skill.atk_f)
self.contents.font.color = normal_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 2)
dy += WLH
end
#---
return dy if dy + WLH > contents.height
#---
if $imported["BattleEngineMelody"] and @skill.def_f > 0
draw_icon(icon, 0, dy)
text = sprintf(GBP::DISGAEA_SKILL::LEARN_DATA[:multiplier], Vocab.def)
self.contents.font.color = system_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 0)
text = sprintf("%s%%", @skill.def_f)
self.contents.font.color = normal_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 2)
dy += WLH
end
#---
return dy if dy + WLH > contents.height
#---
if @skill.spi_f > 0
draw_icon(icon, 0, dy)
text = sprintf(GBP::DISGAEA_SKILL::LEARN_DATA[:multiplier], Vocab.spi)
self.contents.font.color = system_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 0)
text = sprintf("%s%%", @skill.spi_f)
self.contents.font.color = normal_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 2)
dy += WLH
end
#---
return dy if dy + WLH > contents.height
#---
if $imported["BattleEngineMelody"] and $imported["RES Stat"] and
@skill.res_f > 0
draw_icon(icon, 0, dy)
text = sprintf(GBP::DISGAEA_SKILL::LEARN_DATA[:multiplier], Vocab.res)
self.contents.font.color = system_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 0)
text = sprintf("%s%%", @skill.res_f)
self.contents.font.color = normal_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 2)
dy += WLH
end
#---
return dy if dy + WLH > contents.height
#---
if $imported["BattleEngineMelody"] and $imported["DEX Stat"] and
@skill.dex_f > 0
draw_icon(icon, 0, dy)
text = sprintf(GBP::DISGAEA_SKILL::LEARN_DATA[:multiplier], Vocab.dex)
self.contents.font.color = system_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 0)
text = sprintf("%s%%", @skill.dex_f)
self.contents.font.color = normal_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 2)
dy += WLH
end
#---
return dy if dy + WLH > contents.height
#---
if $imported["BattleEngineMelody"] and @skill.agi_f > 0
draw_icon(icon, 0, dy)
text = sprintf(GBP::DISGAEA_SKILL::LEARN_DATA[:multiplier], Vocab.agi)
self.contents.font.color = system_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 0)
text = sprintf("%s%%", @skill.agi_f)
self.contents.font.color = normal_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 2)
dy += WLH
end
#---
return dy
end
#--------------------------------------------------------------------------
# draw_elements
#--------------------------------------------------------------------------
def draw_elements(dy)
return dy if @skill.element_set == []
for element_id in GBP::DISGAEA_SKILL::SHOWN_ELEMENTS
break if dy + WLH > contents.height
next unless @skill.element_set.include?(element_id)
draw_icon(GBP::DISGAEA_SKILL::ELEMENT_ICON[element_id], 0, dy)
text = GBP::DISGAEA_SKILL::LEARN_DATA[:element]
self.contents.font.color = system_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 0)
text = $data_system.elements[element_id]
self.contents.font.color = normal_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 2)
dy += WLH
end
return dy
end
#--------------------------------------------------------------------------
# total_drawn_states
#--------------------------------------------------------------------------
def total_drawn_states(array)
result = 0
for state_id in array
next if $data_states[state_id] == nil
next if $data_states[state_id].icon_index == 0
result += 1
end
return [result, 8].min
end
#--------------------------------------------------------------------------
# draw_plus_states
#--------------------------------------------------------------------------
def draw_plus_states(dy)
return dy if @skill.plus_state_set == []
total = total_drawn_states(@skill.plus_state_set)
if total == 1
return dy if dy + WLH > contents.height
state = $data_states[@skill.plus_state_set[0]]
draw_icon(state.icon_index, 0, dy)
text = GBP::DISGAEA_SKILL::LEARN_DATA[:add_state]
self.contents.font.color = system_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 0)
text = state.name
self.contents.font.color = normal_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 2)
else
return dy if dy + WLH*2 > contents.height
text = GBP::DISGAEA_SKILL::LEARN_DATA[:add_state]
self.contents.font.color = system_color
self.contents.draw_text(4, dy, contents.width-8, WLH, text, 1)
dy += WLH
dx = (contents.width - total*24)/2
for state_id in @skill.plus_state_set
break if dx + 24 > contents.width
state = $data_states[state_id]
next if state.icon_index == 0
draw_icon(state.icon_index, dx, dy)
dx += 24
end
end
dy += WLH
return dy
end
#--------------------------------------------------------------------------
# draw_minus_states
#--------------------------------------------------------------------------
def draw_minus_states(dy)
return dy if @skill.minus_state_set == []
total = total_drawn_states(@skill.minus_state_set)
if total == 1
return dy if dy + WLH > contents.height
state = $data_states[@skill.minus_state_set[0]]
draw_icon(state.icon_index, 0, dy)
text = GBP::DISGAEA_SKILL::LEARN_DATA[:rem_state]
self.contents.font.color = system_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 0)
text = state.name
self.contents.font.color = normal_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 2)
else
return dy if dy + WLH*2 > contents.height
text = GBP::DISGAEA_SKILL::LEARN_DATA[:rem_state]
self.contents.font.color = system_color
self.contents.draw_text(4, dy, contents.width-8, WLH, text, 1)
dy += WLH
dx = (contents.width - total*24)/2
for state_id in @skill.minus_state_set
break if dx + 24 > contents.width
state = $data_states[state_id]
next if state.icon_index == 0
draw_icon(state.icon_index, dx, dy)
dx += 24
end
end
dy += WLH
return dy
end
#--------------------------------------------------------------------------
# draw_custom_data
#--------------------------------------------------------------------------
def draw_custom_data(dy)
return dy if @skill.custom_data == []
for array in @skill.custom_data
break if dy + WLH > contents.height
draw_icon(array[0], 0, dy)
text = array[1]
self.contents.font.color = system_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 0)
text = array[2]
self.contents.font.color = normal_color
self.contents.draw_text(24, dy, contents.width-28, WLH, text, 2)
dy += WLH
end
return dy
end
end # Window_LearnData
#==============================================================================
# ** Scene_Skill
#==============================================================================
class Scene_Skill < Scene_Base
#--------------------------------------------------------------------------
# overwrite method: create_menu_background
#--------------------------------------------------------------------------
def create_menu_background
if YEZ::STATUS::USE_BG_IMAGE
@menuback_sprite = Sprite.new
@menuback_sprite.bitmap = Cache.system(YEZ::STATUS::BG_FILE_NAME)
update_menu_background
else
super
end
end
#--------------------------------------------------------------------------
# alias method: return_scene
#--------------------------------------------------------------------------
alias return_scene_status_scm return_scene unless $@
def return_scene
$game_temp.status_oy = nil
$game_temp.status_index = nil
$game_temp.status_calc_width = nil
return_scene_status_scm
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
alias gbp_dsls_ss_s start
def start
gbp_dsls_ss_s
@skillData_window = Window_SkillData.new(@actor, @skill_window)
@skillData_window.z = 1
@skillData_window.visible = true
end
alias gbp_dsls_ss_t terminate
def terminate
gbp_dsls_ss_t
@skillData_window.dispose
end
if $imported["SkillOverhaul"]
#--------------------------------------------------------------------------
# new method: update_windows
#--------------------------------------------------------------------------
alias qsdcqs update_windows
def update_windows
qsdcqs
if @command_window.index == 0
@skillData_window.visible = true unless @skillData_window.nil?
else
@skillData_window.visible = false unless @skillData_window.nil?
end
end #def
end #imported
unless $imported["SkillOverhaul"]
#--------------------------------------------------------------------------
# overwrite method: next_actor
#--------------------------------------------------------------------------
def next_actor
@actor_index += 1
@actor_index %= $game_party.members.size
set_new_actor
end
#--------------------------------------------------------------------------
# overwrite method: prev_actor
#--------------------------------------------------------------------------
def prev_actor
@actor_index += $game_party.members.size - 1
@actor_index %= $game_party.members.size
set_new_actor
end
#--------------------------------------------------------------------------
# new method: set_new_actor
#--------------------------------------------------------------------------
def set_new_actor
$game_party.last_actor_index = @actor_index
@actor = $game_party.members[@actor_index]
@class_id = @actor.class_id
if $imported["SkillOverhaul"]
@status_window.actor = @actor
for window in @windows; window.actor = @actor; end
update_windows
else
$scene = Scene_Skill.new(@actor_index)
end
end
end #imported
#--------------------------------------------------------------------------
# * Update Skill Selection
#--------------------------------------------------------------------------
def update_skill_selection
update_menu_background
@skill_window.update if $imported["SkillOverhaul"]
if Input.trigger?(Input::B)
if $imported["SkillOverhaul"]
Sound.play_cancel
@command_window.active = true
@skill_window.active = false
else
Sound.play_cancel
return_scene
end
elsif Input.trigger?(Input::RIGHT)
Sound.play_cursor
next_actor
elsif Input.trigger?(Input::LEFT)
Sound.play_cursor
prev_actor
elsif Input.trigger?(Input::DOWN) | Input.repeat?(Input::DOWN) | Input.trigger?(Input::UP) | Input.repeat?(Input::UP) | Input.trigger?(Input::L) | Input.repeat?(Input::L) | Input.trigger?(Input::R) | Input.repeat?(Input::R)
@skillData_window.refresh
elsif Input.trigger?(Input::C)
@skill = @skill_window.skill
if @skill != nil
@actor.last_skill_id = @skill.id
end
if @actor.skill_can_use?(@skill)
Sound.play_decision
determine_skill
else
Sound.play_buzzer
end
end
end #def
end #class
#==============================================================================
# ** Scene_Title
#==============================================================================
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
alias gbp_dsls_title_start start
def start
gbp_dsls_title_start
for i in 0...$data_skills.size
next if $data_skills[i].nil?
$data_skills[i].scan
end
end #def
end #class
#==============================================================================
# ** Separation
#==============================================================================
module Skill_Separation
#--------------------------------------------------------------------------
# * The Main Creation of Equipment
#--------------------------------------------------------------------------
def self.create(skill)
temp_skill = skill.dup
temp_skill.scan
temp_skill.id = $data_skills.size
index = $data_skills.size
$data_skills.push(temp_skill)
return temp_skill.id
end #def
#--------------------------------------------------------------------------
# * Item Version of the above
#--------------------------------------------------------------------------
def self.skill_create(skill)
temp_skill = skill.dup
temp_skill.id = $data_skills.size
$data_skills.push(temp_skill)
return temp_skill.id
end
end #class
#==============================================================================
# ** Scene_File
#==============================================================================
class Scene_File
#--------------------------------------------------------------------------
# * Alias List
#--------------------------------------------------------------------------
alias gbp_dsls_sf_wsd write_save_data
alias gbp_dsls_sf_rsd read_save_data
#--------------------------------------------------------------------------
# * Write Save Data
# file : write file object (opened)
#--------------------------------------------------------------------------
def write_save_data(file)
gbp_dsls_sf_wsd(file)
Marshal.dump($data_skills, file)
end
#--------------------------------------------------------------------------
# * Read Save Data
# file : file object for reading (opened)
#--------------------------------------------------------------------------
def read_save_data(file)
gbp_dsls_sf_rsd(file)
$data_skills = Marshal.load(file)
end
end #class
#==============================================================================
# ** Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# alias: execute_action_skill
#--------------------------------------------------------------------------
alias gbp_dsls_sbeas execute_action_skill
def execute_action_skill
gbp_dsls_sbeas
return unless @active_battler.actor?
skill = @active_battler.action.skill
memo_skill_level = skill.level
skill.gain_exp(1) unless skill.no_level
if skill.level != memo_skill_level
unless skill.skill_to_unlock[skill.level].nil?
@active_battler.learn_skill(skill.skill_to_unlock[skill.level])
end
end
end #def
end #class
#==============================================================================
# ** Scene_Skill
#==============================================================================
class Scene_Skill < Scene_Base
#--------------------------------------------------------------------------
# * Use Skill (apply effects to non-ally targets)
#--------------------------------------------------------------------------
alias gbp_dsls_ss_usn use_skill_nontarget
def use_skill_nontarget
gbp_dsls_ss_usn
memo_skill_level = @skill.level
@skill.gain_exp(1) unless @skill.no_level
if @skill.level != memo_skill_level
unless @skill.skill_to_unlock[@skill.level].nil?
@actor.learn_skill(@skill.skill_to_unlock[@skill.level])
end
end
@skill_window.refresh
@skillData_window.refresh
end #def
end #class |