From cd42700a2f6aafbc253288d516a08590804efb2d Mon Sep 17 00:00:00 2001 From: texan-down-under <73374039+etherware-novice@users.noreply.github.com> Date: Mon, 21 Nov 2022 01:05:39 -0600 Subject: [PATCH] Kickflip action for skateboards (#70613) ## About The Pull Request port of https://github.com/BeeStation/BeeStation-Hornet/pull/7507 New hud icon for skateboard while mounted, letting you "kickflip" to put the skateboard in your hand instantly. ## Why It's Good For The Game Its really hard to pick up your skateboard, which goes against the "fast but dangerous" concept of using the skateboard and just slowing the game down as you try to target the thin sprite. This gives you an option to quickly get off, while still keeping the difficulty if you get unmounted. :cl: add: kickflip skateboard /:cl: Co-authored-by: etherware-novice Co-authored-by: tralezab <40974010+tralezab@users.noreply.github.com> Co-authored-by: Candycaneannihalator Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com> --- code/modules/vehicles/scooter.dm | 1 + code/modules/vehicles/vehicle_actions.dm | 44 +++++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/code/modules/vehicles/scooter.dm b/code/modules/vehicles/scooter.dm index ccc99160214..760420a6c1f 100644 --- a/code/modules/vehicles/scooter.dm +++ b/code/modules/vehicles/scooter.dm @@ -72,6 +72,7 @@ /obj/vehicle/ridden/scooter/skateboard/generate_actions() . = ..() initialize_controller_action_type(/datum/action/vehicle/ridden/scooter/skateboard/ollie, VEHICLE_CONTROL_DRIVE) + initialize_controller_action_type(/datum/action/vehicle/ridden/scooter/skateboard/kickflip, VEHICLE_CONTROL_DRIVE) /obj/vehicle/ridden/scooter/skateboard/post_buckle_mob(mob/living/M)//allows skateboards to be non-dense but still allows 2 skateboarders to collide with each other set_density(TRUE) diff --git a/code/modules/vehicles/vehicle_actions.dm b/code/modules/vehicles/vehicle_actions.dm index e5ae645b686..08be04ff8a5 100644 --- a/code/modules/vehicles/vehicle_actions.dm +++ b/code/modules/vehicles/vehicle_actions.dm @@ -354,7 +354,7 @@ addtimer(CALLBACK(vehicle, TYPE_PROC_REF(/obj/vehicle/ridden/scooter/skateboard/, grind)), 2) else vehicle.obj_flags &= ~BLOCK_Z_OUT_DOWN - rider.spin(4, 1) + rider.spin(spintime = 4, speed = 1) animate(rider, pixel_y = -6, time = 4) animate(vehicle, pixel_y = -6, time = 3) playsound(vehicle, 'sound/vehicles/skateboard_ollie.ogg', 50, TRUE) @@ -364,6 +364,48 @@ passtable_off(rider, VEHICLE_TRAIT) vehicle.pass_flags &= ~PASSTABLE +/datum/action/vehicle/ridden/scooter/skateboard/kickflip + name = "Kickflip" + desc = "Kick your board up and catch it." + button_icon_state = "skateboard_ollie" + check_flags = AB_CHECK_CONSCIOUS + +/datum/action/vehicle/ridden/scooter/skateboard/kickflip/Trigger(trigger_flags) + var/obj/vehicle/ridden/scooter/skateboard/board = vehicle_target + var/mob/living/rider = owner + + rider.adjustStaminaLoss(board.instability) + if (rider.getStaminaLoss() >= 100) + playsound(src, 'sound/effects/bang.ogg', 20, vary = TRUE) + board.unbuckle_mob(rider) + rider.Paralyze(50) + if(prob(15)) + rider.visible_message( + span_userdanger("You smack against the board, hard."), + span_danger("[rider] misses the landing and falls on [rider.p_their()] face!)"), + ) + rider.emote("scream") + rider.adjustBruteLoss(10) // thats gonna leave a mark + return + rider.visible_message( + span_userdanger("You fall flat onto the board!"), + span_danger("[rider] misses the landing and falls on [rider.p_their()] face!"), + ) + return + + rider.visible_message( + span_notice("[rider] does a sick kickflip and catches [rider.p_their()] board in midair."), + span_notice("You do a sick kickflip, catching the board in midair! Stylish."), + ) + playsound(board, 'sound/vehicles/skateboard_ollie.ogg', 50, vary = TRUE) + rider.spin(spintime = 4, speed = 1) + animate(rider, pixel_y = -6, time = 0.4 SECONDS) + animate(board, pixel_y = -6, time = 0.3 SECONDS) + board.unbuckle_mob(rider) + addtimer(CALLBACK(board, /obj/vehicle/ridden/scooter/skateboard/proc/pick_up_board, rider), 1 SECONDS) // so the board can still handle "picking it up" + + + //VIM ACTION DATUMS /datum/action/vehicle/sealed/climb_out/vim