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>
This commit is contained in:
Qwertytoforty
2024-09-15 22:49:43 -04:00
committed by GitHub
parent 9e56381ab8
commit 9caf53b45a
2 changed files with 49 additions and 0 deletions
@@ -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, "<span class='userdanger'><b>You hear a loud roar in the distance, and the lights on [cursed_board] begin to spark dangerously, as the board rumbles heavily!</b></span>")
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'
@@ -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, "<span class='warning'>The rocky terrain you are riding on is tiring you out!</span>")
/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, "<span class='danger'>Some magic burns your hands whenever you go to pick [src] up!</span>")
return
if(has_buckled_mobs())
to_chat(skater, "<span class='warning'>You can't lift this up when somebody's on it.</span>")
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("<span class='warning'>The boosters on [src] burn out as the magic extinguishes it!</span>")
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."