From dc867c6bf0efa89849552e07865ffebfdc90cb7c Mon Sep 17 00:00:00 2001 From: DodoBirb Date: Sat, 23 Apr 2022 09:54:07 +1000 Subject: [PATCH] Added Turbo --- Export_Code/gml_Script_characterStepEvent.gml | 90 +++++++++++-------- Export_Code/gml_Script_start_new_game.gml | 2 + 2 files changed, 57 insertions(+), 35 deletions(-) diff --git a/Export_Code/gml_Script_characterStepEvent.gml b/Export_Code/gml_Script_characterStepEvent.gml index 24cc327..b71ad6e 100644 --- a/Export_Code/gml_Script_characterStepEvent.gml +++ b/Export_Code/gml_Script_characterStepEvent.gml @@ -445,44 +445,34 @@ if platformCharacterIs(IN_AIR) } if ((isCollisionBottom(1) || isCollisionPlatformBottom(1)) && platformCharacterIs(IN_AIR) && yVel >= 0) { - if (state == AIRBALL && ballfall >= 32) + yVel = 0 + yAcc = 0 + landing = 1 + turning = 0 + vjump = 1 + canturn = 1 + walljumping = 0 + if (state != AIRBALL && speedboost == 0) { - yVel = -1.7 - dash = 0 - sfx_play(sndBallBounce) - ballbounce = 8 + image_index = 0 + state = STANDING + idle = 0 + statetime = 0 + xVel = 0 + xAcc = 0 + PlayLandingSound(get_floor_material()) } - else + if (state == AIRBALL && sball == 0 && (!moverobj)) { - yVel = 0 - yAcc = 0 - landing = 1 - turning = 0 - vjump = 1 - canturn = 1 - walljumping = 0 - if (state != AIRBALL) - { - image_index = 0 - state = STANDING - idle = 0 - statetime = 0 - xVel = 0 - xAcc = 0 - PlayLandingSound(get_floor_material()) - } - if (state == AIRBALL && sball == 0 && (!moverobj)) - { - state = BALL - statetime = 0 - if (mockball == 0) - { - xVel = 0 - xAcc = 0 - dash = 0 - } - sfx_play(sndCrouch) - } + state = BALL + statetime = 0 + sfx_play(sndCrouch) + } + if (speedboost == 1 && state != BALL) + { + state = RUNNING + statetime = 100 + dash = 30 } if (sball == 0) { @@ -556,6 +546,12 @@ if ((isCollisionLeft(1) && xVel < 0) || (isCollisionRight(1) && xVel > 0)) if platformCharacterIs(IN_AIR) xAcc = 0 jumpfwd = 0 + if (speedboost == 1 && vjump == 0 && platformCharacterIs(IN_AIR)) + { + charge = 120 + sfx_stop(sndSBChargeLoop) + sfx_loop(sndSBChargeLoop) + } } if ((state == STANDING || state == DUCKING || state == RUNNING) && charge > 0 && ((inwater == 0 && waterfall == 0) || global.currentsuit == 2) && kJump && kJumpPushedSteps == 0 && kLeft == 0 && kRight == 0) { @@ -878,6 +874,30 @@ if (state == SUPERJUMP) yVel = -3.5 facing = LEFT } + if (kWalk > 0) + { + if (sjball == 0) + state = RUNNING + else + state = BALL + speedboost = 1 + dash = 30 + statetime = 100 + sfx_stop(sndSJLoop) + if (sjdir == 0) + { + if (kLeft > 0) + { + xVel = -7.4 + facing = LEFT + } + if (kRight > 0) + { + xVel = 7.4 + facing = RIGHT + } + } + } if ((sjdir != 0 && facing == RIGHT && isCollisionRightSlope(0)) || (facing == LEFT && isCollisionLeftSlope(0))) { yVel = 0 diff --git a/Export_Code/gml_Script_start_new_game.gml b/Export_Code/gml_Script_start_new_game.gml index aac5459..215242a 100644 --- a/Export_Code/gml_Script_start_new_game.gml +++ b/Export_Code/gml_Script_start_new_game.gml @@ -9,5 +9,7 @@ load_character_vars() file_delete((((working_directory + "/TheHorde/random") + string((global.saveslot + 1))) + ".ini")) file_delete((((working_directory + "/TheHorde/save") + string((global.saveslot + 1))) + ".dat")) scr_newgame() +global.item[7] = 1 +global.speedbooster = 1 save_game(((working_directory + "/TheHorde/save") + string((global.saveslot + 1)))) room_change(global.start_room, 0)