I was somewhat disappointed when I found that Magnitude was bugged/unfinished as it's one of my favorite moves for my Geodude. I found that it was only hitting for 2-3 damage and not reporting what magnitude the move was hitting for (Magnitude !).
Now I know barely anything about coding or programming so I was more like a laymen with a scalpel in my attempts to fix the move... but after several hours of trying different ideas I finally have it hitting for variable damage and reporting the magnitude of the hit (without crashing the game!). The first few uses are still not correct, but after the 3rd use it seems to be correct pretty much every time. I found that the line "SetAttackPreAttackDelegate" was not working so I added both functions into a single function.
Here's a copy of my fixed Magnitude file if anyone wants to test it out:
SetAttackBaseDamage(222,10)
SetAttackMaxPP(222,30)
SetAttackCategory(222,0)
SetAttackCategory(222,1)
SetAttackContestCategory(222,0)
SetAttackType(222,4)
SetAttackPriority(222,0)
SetAttackAccuracy(222,255)
SetAttackSpecialAttackDelegate(222, "ATTACKS_GROUND_MAGNITUDE_PRE_ATTACK")
function ATTACKS_GROUND_MAGNITUDE_PRE_ATTACK()
local chance = math.random(0,100)
if chance < 5 then
Attacks_SetBaseDamage(10)
Attacks_AddBattleStep("Message", "Magnitude 4!")
elseif chance >= 5 and chance < 15 then
Attacks_SetBaseDamage(30)
Attacks_AddBattleStep("Message", "Magnitude 5!")
elseif chance >= 15 and chance < 35 then
Attacks_SetBaseDamage(50)
Attacks_AddBattleStep("Message", "Magnitude 6!")
elseif chance >= 35 and chance < 65 then
Attacks_SetBaseDamage(70)
Attacks_AddBattleStep("Message", "Magnitude 7!")
elseif chance >= 65 and chance < 85 then
Attacks_SetBaseDamage(90)
Attacks_AddBattleStep("Message", "Magnitude 8!")
elseif chance >= 85 and chance < 95 then
Attacks_SetBaseDamage(110)
Attacks_AddBattleStep("Message", "Magnitude 9!")
else
Attacks_SetBaseDamage(150)
Attacks_AddBattleStep("Message", "Magnitude 10!")
end
end
P.S. Spaces aren't showing so make sure to indent the lines with 4 spaces before the local, if chance, elseif, and else lines (and the 1st end). 8 spaces after each "if chance" and "elseif" lines, and 12 spaces for every "Attacks_AddBattleStep" line.
Now I know barely anything about coding or programming so I was more like a laymen with a scalpel in my attempts to fix the move... but after several hours of trying different ideas I finally have it hitting for variable damage and reporting the magnitude of the hit (without crashing the game!). The first few uses are still not correct, but after the 3rd use it seems to be correct pretty much every time. I found that the line "SetAttackPreAttackDelegate" was not working so I added both functions into a single function.
Here's a copy of my fixed Magnitude file if anyone wants to test it out:
SetAttackBaseDamage(222,10)
SetAttackMaxPP(222,30)
SetAttackCategory(222,0)
SetAttackCategory(222,1)
SetAttackContestCategory(222,0)
SetAttackType(222,4)
SetAttackPriority(222,0)
SetAttackAccuracy(222,255)
SetAttackSpecialAttackDelegate(222, "ATTACKS_GROUND_MAGNITUDE_PRE_ATTACK")
function ATTACKS_GROUND_MAGNITUDE_PRE_ATTACK()
local chance = math.random(0,100)
if chance < 5 then
Attacks_SetBaseDamage(10)
Attacks_AddBattleStep("Message", "Magnitude 4!")
elseif chance >= 5 and chance < 15 then
Attacks_SetBaseDamage(30)
Attacks_AddBattleStep("Message", "Magnitude 5!")
elseif chance >= 15 and chance < 35 then
Attacks_SetBaseDamage(50)
Attacks_AddBattleStep("Message", "Magnitude 6!")
elseif chance >= 35 and chance < 65 then
Attacks_SetBaseDamage(70)
Attacks_AddBattleStep("Message", "Magnitude 7!")
elseif chance >= 65 and chance < 85 then
Attacks_SetBaseDamage(90)
Attacks_AddBattleStep("Message", "Magnitude 8!")
elseif chance >= 85 and chance < 95 then
Attacks_SetBaseDamage(110)
Attacks_AddBattleStep("Message", "Magnitude 9!")
else
Attacks_SetBaseDamage(150)
Attacks_AddBattleStep("Message", "Magnitude 10!")
end
end
P.S. Spaces aren't showing so make sure to indent the lines with 4 spaces before the local, if chance, elseif, and else lines (and the 1st end). 8 spaces after each "if chance" and "elseif" lines, and 12 spaces for every "Attacks_AddBattleStep" line.