11---- -------------------------------
22-- xi.effect.OVERDRIVE
3+ -- https://wiki.ffo.jp/html/954.html
4+ -- TODO: More testing on "significant resistance to status ailments" for now, gives Rank 11 resistance to status ailments during effect.
35---- -------------------------------
46--- @type TEffect
57local effectObject = {}
68
9+ local jobPointBonuses =
10+ {
11+ [1 ] = xi .mod .STR ,
12+ [2 ] = xi .mod .DEX ,
13+ [3 ] = xi .mod .VIT ,
14+ [4 ] = xi .mod .AGI ,
15+ [5 ] = xi .mod .INT ,
16+ [6 ] = xi .mod .MND ,
17+ [7 ] = xi .mod .CHR ,
18+ }
19+
20+ local statusAilmentResRanks =
21+ {
22+ xi .mod .PARALYZE_RES_RANK ,
23+ xi .mod .BIND_RES_RANK ,
24+ xi .mod .SILENCE_RES_RANK ,
25+ xi .mod .SLOW_RES_RANK ,
26+ xi .mod .POISON_RES_RANK ,
27+ xi .mod .LIGHT_SLEEP_RES_RANK ,
28+ xi .mod .DARK_SLEEP_RES_RANK ,
29+ xi .mod .BLIND_RES_RANK ,
30+ -- xi.mod.GRAVITY_RES_RANK,
31+ }
32+
33+ local overdriveDefenseDivisors =
34+ {
35+ [xi .automaton .frame .VALOREDGE ] = 24 ,
36+ [xi .automaton .frame .STORMWAKER ] = 16 ,
37+ [xi .automaton .frame .SHARPSHOT ] = 18 ,
38+ [xi .automaton .frame .HARLEQUIN ] = 20 ,
39+ }
40+
741effectObject .onEffectGain = function (target , effect )
8- target :addMod (xi .mod .OVERLOAD_THRESH , 5000 )
9- local pet = target :getPet ()
10- local jpBonus = target :getJobPointLevel (xi .jp .OVERDRIVE_EFFECT ) * 5
42+ if target :getObjType () == xi .objType .PC then
43+ effect :addMod (xi .mod .OVERLOAD_THRESH , 5000 )
44+ target :updateAttachments ()
45+ end
46+
47+ if target :getObjType () == xi .objType .PET then
48+ effect :addMod (xi .mod .HASTE_MAGIC , 2500 )
49+ effect :addMod (xi .mod .ATTP , 25 )
50+ effect :addMod (xi .mod .RATTP , 25 )
51+ effect :addMod (xi .mod .ACC , 25 )
52+ effect :addMod (xi .mod .RACC , 25 )
53+ effect :addMod (xi .mod .EVA , 25 )
54+
55+ local master = target :getMaster ()
56+
57+ if not master then
58+ return
59+ end
1160
12- if pet then
13- pet :setLocalVar (' overdrive' , 1 )
14- pet :addMod (xi .mod .HASTE_MAGIC , 2500 )
15- pet :addMod (xi .mod .MAIN_DMG_RATING , 30 )
16- pet :addMod (xi .mod .RANGED_DMG_RATING , 30 )
17- pet :addMod (xi .mod .ATTP , 50 )
18- pet :addMod (xi .mod .RATTP , 50 )
19- pet :addMod (xi .mod .ACC , 100 )
20- pet :addMod (xi .mod .RACC , 100 )
21- pet :addMod (xi .mod .EVA , 50 )
22- pet :addMod (xi .mod .MEVA , 50 )
23- pet :addMod (xi .mod .REVA , 50 )
24- pet :addMod (xi .mod .DMG , - 5000 )
25- if jpBonus > 0 then
26- pet :addMod (xi .mod .STR , jpBonus )
27- pet :addMod (xi .mod .DEX , jpBonus )
28- pet :addMod (xi .mod .VIT , jpBonus )
29- pet :addMod (xi .mod .AGI , jpBonus )
30- pet :addMod (xi .mod .INT , jpBonus )
31- pet :addMod (xi .mod .MND , jpBonus )
32- pet :addMod (xi .mod .CHR , jpBonus )
61+ local frameEquipped = target :getAutomatonFrame ()
62+ local frameDivisor = overdriveDefenseDivisors [frameEquipped ] or 24
63+
64+ if frameDivisor then
65+ effect :addMod (xi .mod .DEFP , math.floor (400 / frameDivisor ))
66+ end
67+
68+ for _ , mod in pairs (statusAilmentResRanks ) do
69+ effect :addMod (mod , 11 )
70+ end
71+
72+ local jobPointBonus = master :getJobPointLevel (xi .jp .OVERDRIVE_EFFECT ) * 5
73+
74+ if jobPointBonus > 0 then
75+ for _ , mod in pairs (jobPointBonuses ) do
76+ effect :addMod (mod , jobPointBonus )
77+ end
3378 end
3479 end
3580end
@@ -38,32 +83,8 @@ effectObject.onEffectTick = function(target, effect)
3883end
3984
4085effectObject .onEffectLose = function (target , effect )
41- target :delMod (xi .mod .OVERLOAD_THRESH , 5000 )
42- local pet = target :getPet ()
43- local jpBonus = target :getJobPointLevel (xi .jp .OVERDRIVE_EFFECT ) * 5
44-
45- if pet and pet :getLocalVar (' overdrive' ) ~= 0 then
46- pet :setLocalVar (' overdrive' , 0 )
47- pet :delMod (xi .mod .HASTE_MAGIC , 2500 )
48- pet :delMod (xi .mod .MAIN_DMG_RATING , 30 )
49- pet :delMod (xi .mod .RANGED_DMG_RATING , 30 )
50- pet :delMod (xi .mod .ATTP , 50 )
51- pet :delMod (xi .mod .RATTP , 50 )
52- pet :delMod (xi .mod .ACC , 100 )
53- pet :delMod (xi .mod .RACC , 100 )
54- pet :delMod (xi .mod .EVA , 50 )
55- pet :delMod (xi .mod .MEVA , 50 )
56- pet :delMod (xi .mod .REVA , 50 )
57- pet :delMod (xi .mod .DMG , - 5000 )
58- if jpBonus > 0 then
59- pet :delMod (xi .mod .STR , jpBonus )
60- pet :delMod (xi .mod .DEX , jpBonus )
61- pet :delMod (xi .mod .VIT , jpBonus )
62- pet :delMod (xi .mod .AGI , jpBonus )
63- pet :delMod (xi .mod .INT , jpBonus )
64- pet :delMod (xi .mod .MND , jpBonus )
65- pet :delMod (xi .mod .CHR , jpBonus )
66- end
86+ if target :getObjType () == xi .objType .PC then
87+ target :updateAttachments ()
6788 end
6889end
6990
0 commit comments