From 403616c4d7d35e69ee7b9be6822c61f7a7c23edd Mon Sep 17 00:00:00 2001 From: Miepee Date: Fri, 17 May 2024 12:59:21 +0200 Subject: [PATCH] Fix some weird cases with IBJ --- YAMS-LIB/Program.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/YAMS-LIB/Program.cs b/YAMS-LIB/Program.cs index 20cea2e..25d912d 100644 --- a/YAMS-LIB/Program.cs +++ b/YAMS-LIB/Program.cs @@ -1436,17 +1436,24 @@ public static void Main(string am2rPath, string outputAm2rPath, string jsonPath) // Add IBJ as item - TODO: set this to 0 when we have sprites!!! characterVarsCode.PrependGMLInCode("global.hasIBJ = 1;"); - gmData.Code.ByName("gml_Script_characterCreateEvent").AppendGMLInCode("IBJ_MIDAIR_MAX = 3; IBJLaidInAir = IBJ_MIDAIR_MAX;"); + gmData.Code.ByName("gml_Script_characterCreateEvent").AppendGMLInCode("IBJ_MIDAIR_MAX = 5; IBJLaidInAir = IBJ_MIDAIR_MAX; IBJ_MAX_BOMB_SEPERATE_TIMER = 4; IBJBombSeperateTimer = -1;"); + gmData.Code.ByName("gml_Object_oCharacter_Step_0").AppendGMLInCode("if (IBJBombSeperateTimer >= 0) IBJBombSeperateTimer-- if (!platformCharacterIs(IN_AIR)) IBJLaidInAir = IBJ_MIDAIR_MAX;"); gmData.Code.ByName("gml_Object_oCharacter_Collision_435").ReplaceGMLInCode("if (isCollisionTop(6) == 0)", """ if (!global.hasIBJ) { if (state == AIRBALL) - IBJLaidInAir-- + { + if (IBJBombSeperateTimer < 0) + IBJLaidInAir--; + } else - IBJLaidInAir = IBJ_MIDAIR_MAX + { + IBJLaidInAir = IBJ_MIDAIR_MAX; + } if (IBJLaidInAir <= 0) - exit + exit; + IBJBombSeperateTimer = IBJ_MAX_BOMB_SEPERATE_TIMER; } if (isCollisionTop(6) == 0) """);