diff --git a/YAMS-LIB/Program.cs b/YAMS-LIB/Program.cs index 56a2a14..a09265b 100644 --- a/YAMS-LIB/Program.cs +++ b/YAMS-LIB/Program.cs @@ -1622,7 +1622,28 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te } """); ReplaceGMLInCode(eTankCharacterEvent, "popup_text(get_text(\"Notifications\", \"EnergyTank\"))", ""); - + + // Add speedbooster reduction + PrependGMLInCode(characterVarsCode, "global.speedBoosterFramesReduction = 0;"); + ReplaceGMLInCode(gmData.Code.ByName("gml_Script_characterStepEvent"), "speedboost_steps > 75", "speedboost_steps >= 1 && speedboost_steps > (75 - global.speedBoosterFramesReduction)"); + ReplaceGMLInCode(gmData.Code.ByName("gml_Script_characterStepEvent"), "dash == 30", "dash >= 1 && dash >= (30 - (max(global.speedBoosterFramesReduction, 76)-76))"); + ReplaceGMLInCode(gmData.Code.ByName("gml_Script_characterStepEvent"), """ + speedboost = 1 + canturn = 0 + sjball = 0 + charge = 0 + sfx_play(sndSBStart) + alarm[2] = 30 + """, """ + dash = 30 + speedboost = 1 + canturn = 0 + sjball = 0 + charge = 0 + sfx_play(sndSBStart) + alarm[2] = 30 + """); + // Decouple Major items from item locations PrependGMLInCode(characterVarsCode, "global.dna = 0; global.hasBombs = 0; global.hasPowergrip = 0; global.hasSpiderball = 0; global.hasJumpball = 0; global.hasHijump = 0;" + "global.hasVaria = 0; global.hasSpacejump = 0; global.hasSpeedbooster = 0; global.hasScrewattack = 0; global.hasGravity = 0;" + @@ -1986,8 +2007,9 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te ds_list_add(list, global.gameHash) ds_list_add(list, global.dna) ds_list_add(list, global.startingSave) + ds_list_add(list, global.speedBoosterFramesReduction) comment = "gives me some leeway in case i need to add more" - repeat (15) + repeat (14) { ds_list_add(list, 0) i += 1 @@ -2038,6 +2060,7 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te global.gameHash = readline() global.dna = readline() global.startingSave = readline(); + global.speedBoosterFramesReduction = readline(); ds_list_clear(list) """); gmData.Code.Add(loadGlobalsCode); @@ -2213,6 +2236,9 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te case ItemEnum.Morphball: ReplaceGMLInCode(characterVarsCode, "global.hasMorph = 0", $"global.hasMorph = {quantity};"); break; + case ItemEnum.SpeedBoosterUpgrade: + ReplaceGMLInCode(characterVarsCode, "global.speedBoosterFramesReduction = 0", $"global.speedBoosterFramesReduction = {quantity}"); + break; case ItemEnum.Nothing: break; default: @@ -2549,6 +2575,7 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te ItemEnum.MissileDrop => $"event_inherited(); if (active) {{ global.missiles += {pickup.Quantity}; if (global.missiles > global.maxmissiles) global.missiles = global.maxmissiles }}", ItemEnum.SuperMissileDrop => $"event_inherited(); if (active) {{ global.smissiles += {pickup.Quantity}; if (global.smissiles > global.maxsmissiles) global.smissiles = global.maxsmissiles }}", ItemEnum.PBombDrop => $"event_inherited(); if (active) {{ global.pbombs += {pickup.Quantity}; if (global.pbombs > global.maxpbombs) global.pbombs = global.maxpbombs }}", + ItemEnum.SpeedBoosterUpgrade => $"event_inherited(); if (active) {{ global.speedBoosterFramesReduction += {pickup.Quantity}; }}", ItemEnum.Nothing => "event_inherited();", _ => throw new NotSupportedException("Unsupported item! " + pickup.ItemEffect) }; diff --git a/YAMS-LIB/SeedObject.cs b/YAMS-LIB/SeedObject.cs index faab571..9b4f83e 100644 --- a/YAMS-LIB/SeedObject.cs +++ b/YAMS-LIB/SeedObject.cs @@ -478,6 +478,8 @@ public enum ItemEnum SuperMissileDrop, [EnumMember(Value = "Power Bomb Drop")] PBombDrop, + [EnumMember(Value = "Speed Booster Upgrade")] + SpeedBoosterUpgrade, } public class PickupObject