From 114fd83ea455f18b48fa9b810f1fdb84c6f25537 Mon Sep 17 00:00:00 2001 From: LMH Date: Sat, 15 Nov 2014 13:10:37 -1000 Subject: [PATCH] Bouncing on enemies and trampolines also gets a hight bonus from airflower --- src/object/player.cpp | 10 ++++++---- src/object/trampoline.cpp | 9 ++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/object/player.cpp b/src/object/player.cpp index c40a9ee6d..3af291c84 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -1511,10 +1511,12 @@ Player::get_velocity() void Player::bounce(BadGuy& ) { - if(controller->hold(Controller::JUMP)) - physic.set_velocity_y(-520); - else - physic.set_velocity_y(-300); + if(!(player_status->bonus == AIR_BONUS)) + physic.set_velocity_y(controller->hold(Controller::JUMP) ? -520 : -300); + else { + physic.set_velocity_y(controller->hold(Controller::JUMP) ? -580 : -340); + glide_time = player_status->max_air_time * GLIDE_TIME_PER_FLOWER; + } } //scripting Functions Below diff --git a/src/object/trampoline.cpp b/src/object/trampoline.cpp index b1c2fbc5a..b8d20ad5e 100644 --- a/src/object/trampoline.cpp +++ b/src/object/trampoline.cpp @@ -83,11 +83,10 @@ Trampoline::collision(GameObject& other, const CollisionHit& hit) float vy = player->get_physic().get_velocity_y(); //player is falling down on trampoline if(hit.top && vy >= 0) { - if(player->get_controller()->hold(Controller::JUMP)) { - vy = VY_MIN; - } else { - vy = VY_INITIAL; - } + if (!(player->get_status()->bonus == AIR_BONUS)) + vy = player->get_controller()->hold(Controller::JUMP) ? VY_MIN : VY_INITIAL; + else + vy = player->get_controller()->hold(Controller::JUMP) ? VY_MIN - 300 : VY_INITIAL - 40; player->get_physic().set_velocity_y(vy); SoundManager::current()->play(TRAMPOLINE_SOUND); sprite->set_action("swinging", 1); -- 2.11.0