Skip to content

Commit

Permalink
Fix some weird cases with IBJ
Browse files Browse the repository at this point in the history
  • Loading branch information
Miepee committed May 17, 2024
1 parent 99cac52 commit 403616c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions YAMS-LIB/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
""");
Expand Down

0 comments on commit 403616c

Please sign in to comment.