Skip to content

Commit

Permalink
Fix suit issues when collecting while item is inactive (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
Miepee authored Oct 27, 2023
1 parent a8494e9 commit 3d68b87
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions YAMS-LIB/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2561,7 +2561,6 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te
ItemEnum.Screwattack => "event_inherited(); if (active) { global.screwattack = 1; global.hasScrewattack = 1; } with (oCharacter) sfx_stop(spinjump_sound);",
ItemEnum.Varia => """
event_inherited()
global.hasVaria = 1;
global.SuitChange = !global.skipItemFanfare;
// If any Metroid exists, force suit cutscene to be off
if (!((instance_number(oMAlpha) <= 0) && (instance_number(oMGamma) <= 0) && (instance_number(oMZeta) <= 0) && (instance_number(oMOmega) <= 0)))
Expand All @@ -2575,6 +2574,7 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te
global.SuitChangeGravity = 0;
if (active)
{
global.hasVaria = 1;
with (oCharacter)
alarm[1] = 1;
}
Expand All @@ -2585,7 +2585,6 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te
ItemEnum.ProgressiveJump => "event_inherited(); if (active) { if (global.hasSpacejump) exit; else if (global.hasHijump) { global.spacejump = 1; global.hasSpacejump = 1; } else { global.hijump = 1; global.hasHijump = 1; } }",
ItemEnum.Gravity => """
event_inherited();
global.hasGravity = 1;
global.SuitChange = !global.skipItemFanfare;
// If any Metroid exists, force suit cutscene to be off
if (!((instance_number(oMAlpha) <= 0) && (instance_number(oMGamma) <= 0) && (instance_number(oMZeta) <= 0) && (instance_number(oMOmega) <= 0)))
Expand All @@ -2599,6 +2598,7 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te
global.SuitChangeGravity = 1;
if (active)
{
global.hasGravity = 1;
with (oCharacter)
alarm[4] = 1;
}
Expand All @@ -2615,19 +2615,19 @@ void RotateTextureAndSaveToTexturePage(int rotation, UndertaleTexturePageItem te
global.SuitChange = 0;
global.SuitChangeX = x;
global.SuitChangeY = y;
if (global.hasGravity) exit
else if (global.hasVaria)
{
global.hasGravity = 1;
global.SuitChangeGravity = 1;
}
else
{
global.hasVaria = 1;
global.SuitChangeGravity = 0;
}
if (active)
{
if (global.hasGravity) exit
else if (global.hasVaria)
{
global.hasGravity = 1;
global.SuitChangeGravity = 1;
}
else
{
global.hasVaria = 1;
global.SuitChangeGravity = 0;
}
with (oCharacter)
if (global.hasGravity)
alarm[4] = 1;
Expand Down

0 comments on commit 3d68b87

Please sign in to comment.