From 9caf53b45a6702be6c0f292d7dba9db3effd290b Mon Sep 17 00:00:00 2001 From: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> Date: Sun, 15 Sep 2024 22:49:43 -0400 Subject: [PATCH] Hoverboards will now get cursed if used during megafauna (#26695) * Hoverboards will now get cursed if used during megafauna * fix pixel offset * Update code/modules/vehicle/tg_vehicles/scooter.dm Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> Signed-off-by: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> * Update megafauna.dm * Apply suggestions from code review Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> Signed-off-by: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> * TIMER DEFINES * Update code/modules/vehicle/tg_vehicles/scooter.dm Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> Signed-off-by: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> --------- Signed-off-by: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> --- .../hostile/megafauna/megafauna.dm | 17 ++++++++++ code/modules/vehicle/tg_vehicles/scooter.dm | 32 +++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm index bd6e91932d0..18739b9e6ea 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm @@ -52,9 +52,11 @@ for(var/action_type in attack_action_types) var/datum/action/innate/megafauna_attack/attack_action = new action_type() attack_action.Grant(src) + RegisterSignal(src, COMSIG_HOSTILE_FOUND_TARGET, PROC_REF(hoverboard_deactivation)) /mob/living/simple_animal/hostile/megafauna/Destroy() QDEL_NULL(internal_gps) + UnregisterSignal(src, COMSIG_HOSTILE_FOUND_TARGET) return ..() /mob/living/simple_animal/hostile/megafauna/Moved() @@ -158,6 +160,21 @@ C.density = FALSE //I hate it. addtimer(VARSET_CALLBACK(C, density, TRUE), 2 SECONDS) // Needed to make them path. I hate it. +/mob/living/simple_animal/hostile/megafauna/proc/hoverboard_deactivation(source, target) + SIGNAL_HANDLER // COMSIG_HOSTILE_FOUND_TARGET + if(!isliving(target)) + return + var/mob/living/L = target + if(!L.buckled) + return + if(!istype(L.buckled, /obj/tgvehicle/scooter/skateboard/hoverboard)) + return + var/obj/tgvehicle/scooter/skateboard/hoverboard/cursed_board = L.buckled + // Not a visible message, as walls or such may be in the way + to_chat(L, "You hear a loud roar in the distance, and the lights on [cursed_board] begin to spark dangerously, as the board rumbles heavily!") + playsound(get_turf(src), 'sound/effects/tendril_destroyed.ogg', 200, FALSE, 50, TRUE, TRUE) + cursed_board.necropolis_curse() + /datum/action/innate/megafauna_attack name = "Megafauna Attack" button_overlay_icon = 'icons/mob/actions/actions_animal.dmi' diff --git a/code/modules/vehicle/tg_vehicles/scooter.dm b/code/modules/vehicle/tg_vehicles/scooter.dm index ada9127fb35..5b9d490601a 100644 --- a/code/modules/vehicle/tg_vehicles/scooter.dm +++ b/code/modules/vehicle/tg_vehicles/scooter.dm @@ -33,6 +33,11 @@ buckled_mob.pixel_y = 5 else buckled_mob.pixel_y = -4 + if(istype(get_turf(src), /turf/simulated/floor/plating/asteroid)) //Rocks are bad for wheels mkay? + if(!HAS_TRAIT(src, TRAIT_NO_BREAK_GLASS_TABLES)) + buckled_mob.adjustStaminaLoss(2) + if(prob(7)) //Not to much spam. + to_chat(buckled_mob, "The rocky terrain you are riding on is tiring you out!") /obj/tgvehicle/scooter/skateboard name = "skateboard" @@ -51,6 +56,8 @@ var/instability = 10 ///If true, riding the skateboard with walk intent on will prevent crashing. var/can_slow_down = TRUE + ///Is this board cursed, preventing the cheeser from picking it up right away and using it again. Can not get on it while cursed either. + var/cursed = FALSE /obj/tgvehicle/scooter/skateboard/Initialize(mapload) . = ..() @@ -191,6 +198,9 @@ /obj/tgvehicle/scooter/skateboard/proc/pick_up_board(mob/living/carbon/skater) if(skater.incapacitated() || !Adjacent(skater)) return + if(cursed) + to_chat(skater, "Some magic burns your hands whenever you go to pick [src] up!") + return if(has_buckled_mobs()) to_chat(skater, "You can't lift this up when somebody's on it.") return @@ -214,6 +224,7 @@ instability = 3 icon_state = "hoverboard_red" resistance_flags = LAVA_PROOF | FIRE_PROOF + var/mutable_appearance/curse_overlay /obj/tgvehicle/scooter/skateboard/hoverboard/Initialize(mapload) . = ..() @@ -222,6 +233,27 @@ /obj/tgvehicle/scooter/skateboard/hoverboard/make_ridable() AddElement(/datum/element/ridable, /datum/component/riding/vehicle/scooter/skateboard/hover) +/obj/tgvehicle/scooter/skateboard/hoverboard/proc/necropolis_curse() + cursed = TRUE + can_buckle = FALSE + addtimer(CALLBACK(src, PROC_REF(remove_rider)), 5 SECONDS, TIMER_UNIQUE|TIMER_STOPPABLE|TIMER_DELETE_ME) + curse_overlay = mutable_appearance('icons/effects/cult_effects.dmi', "cult-mark", ABOVE_MOB_LAYER) + curse_overlay.pixel_y = -10 + + add_overlay(curse_overlay) + +/obj/tgvehicle/scooter/skateboard/hoverboard/proc/remove_rider() + visible_message("The boosters on [src] burn out as the magic extinguishes it!") + if(has_buckled_mobs()) + var/mob/living/carbon/skaterboy = buckled_mobs[1] + unbuckle_mob(skaterboy) + addtimer(CALLBACK(src, PROC_REF(clear_curse)), 30 SECONDS,TIMER_UNIQUE|TIMER_STOPPABLE|TIMER_DELETE_ME) + +/obj/tgvehicle/scooter/skateboard/hoverboard/proc/clear_curse() + can_buckle = TRUE + cursed = FALSE + cut_overlay(curse_overlay) + /obj/tgvehicle/scooter/skateboard/hoverboard/admin name = "\improper Board Of Directors" desc = "The engineering complexity of a spaceship concentrated inside of a board. Just as expensive, too."