Files
+37 21b4095dfd [MDB IGNORE] [IDB IGNORE] Upstream Sync - 04/17/2026 (#5453)
Upstream 04/17/2026

fixes https://github.com/Bubberstation/Bubberstation/issues/5549

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: tgstation-ci[bot] <179393467+tgstation-ci[bot]@users.noreply.github.com>
Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Rhials <28870487+Rhials@users.noreply.github.com>
Co-authored-by: rageguy505 <54517726+rageguy505@users.noreply.github.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: Aliceee2ch <160794176+Aliceee2ch@users.noreply.github.com>
Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com>
Co-authored-by: Tsar-Salat <62388554+Tsar-Salat@users.noreply.github.com>
Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com>
Co-authored-by: Maxipat <108554989+Maxipat112@users.noreply.github.com>
Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com>
Co-authored-by: SimplyLogan <47579821+loganuk@users.noreply.github.com>
Co-authored-by: loganuk <fakeemail123@aol.com>
Co-authored-by: Leland Kemble <70413276+lelandkemble@users.noreply.github.com>
Co-authored-by: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com>
Co-authored-by: Roxy <75404941+TealSeer@users.noreply.github.com>
Co-authored-by: Lucy <lucy@absolucy.moe>
Co-authored-by: siliconOpossum <138069572+siliconOpossum@users.noreply.github.com>
Co-authored-by: Isratosh <Isratosh@hotmail.com>
Co-authored-by: TheRyeGuyWhoWillNowDie <70169560+TheRyeGuyWhoWillNowDie@users.noreply.github.com>
Co-authored-by: Neocloudy <88008002+Neocloudy@users.noreply.github.com>
Co-authored-by: Alexander V. <volas@ya.ru>
Co-authored-by: ElGitificador <168473461+ElGitificador@users.noreply.github.com>
Co-authored-by: Twaticus <46540570+Twaticus@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
Co-authored-by: Tim <timothymtorres@gmail.com>
Co-authored-by: Iamgoofball <iamgoofball@gmail.com>
Co-authored-by: Layzu666 <121319428+Layzu666@users.noreply.github.com>
Co-authored-by: Arturlang <24881678+Arturlang@users.noreply.github.com>
Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com>
Co-authored-by: mrmanlikesbt <99309552+mrmanlikesbt@users.noreply.github.com>
Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
Co-authored-by: John F. Kennedy <54908920+MacaroniCritter@users.noreply.github.com>
Co-authored-by: Cursor <102828457+theselfish@users.noreply.github.com>
Co-authored-by: Josh <josh.adam.powell@gmail.com>
Co-authored-by: Josh Powell <josh.powell@softwire.com>
Co-authored-by: Yobrocharlie <Charliemiller5617@gmail.com>
Co-authored-by: Hardly3D <66234359+Hardly3D@users.noreply.github.com>
Co-authored-by: shayoki <96078776+shayoki@users.noreply.github.com>
Co-authored-by: LT3 <83487515+lessthnthree@users.noreply.github.com>
2026-05-16 00:56:00 +02:00

71 lines
2.6 KiB
Plaintext

/// Causes a fake "zap" to the hallucinator.
/datum/hallucination/shock
random_hallucination_weight = 1 // really low weight, as it also has a snowflake check to trigger when bumping airlocks
hallucination_tier = HALLUCINATION_TIER_COMMON
var/electrocution_icon = 'icons/mob/human/human.dmi'
var/electrocution_icon_state = "electrocuted_base"
var/image/shock_image
var/image/electrocution_skeleton_anim
/datum/hallucination/shock/New(mob/living/hallucinator)
electrocution_icon_state = ishuman(hallucinator) ? "electrocuted_base" : "electrocuted_generic"
return ..()
/datum/hallucination/shock/Destroy()
if(shock_image)
hallucinator.client?.images -= shock_image
shock_image = null
if(electrocution_skeleton_anim)
hallucinator.client?.images -= electrocution_skeleton_anim
electrocution_skeleton_anim = null
return ..()
/datum/hallucination/shock/start()
shock_image = image(hallucinator, hallucinator, dir = hallucinator.dir)
shock_image.appearance_flags |= KEEP_APART
shock_image.color = rgb(0, 0, 0)
shock_image.override = TRUE
electrocution_skeleton_anim = image(electrocution_icon, hallucinator, icon_state = electrocution_icon_state, layer = ABOVE_MOB_LAYER)
electrocution_skeleton_anim.appearance_flags |= RESET_COLOR|KEEP_APART
if(ishuman(hallucinator))
var/mob/living/carbon/human/human_hallucinator = hallucinator
human_hallucinator.apply_height_filters(electrocution_skeleton_anim)
SET_PLANE_EXPLICIT(shock_image, ABOVE_GAME_PLANE, hallucinator)
SET_PLANE_EXPLICIT(electrocution_skeleton_anim, ABOVE_GAME_PLANE, hallucinator)
to_chat(hallucinator, span_userdanger("You feel a powerful shock course through your body!"))
hallucinator.visible_message(span_warning("[hallucinator] falls to the ground, shaking!"), ignored_mobs = hallucinator)
hallucinator.client?.images |= shock_image
hallucinator.client?.images |= electrocution_skeleton_anim
hallucinator.playsound_local(get_turf(src), SFX_SPARKS, 100, TRUE)
hallucinator.adjust_stamina_loss(50)
hallucinator.Stun(4 SECONDS)
hallucinator.do_jitter_animation(300) // Maximum jitter
hallucinator.adjust_jitter(20 SECONDS)
addtimer(CALLBACK(src, PROC_REF(reset_shock_animation)), 4 SECONDS)
addtimer(CALLBACK(src, PROC_REF(shock_drop)), 2 SECONDS)
QDEL_IN(src, 4 SECONDS)
return TRUE
/datum/hallucination/shock/proc/reset_shock_animation()
if(QDELETED(hallucinator))
return
hallucinator.client?.images -= shock_image
shock_image = null
hallucinator.client?.images -= electrocution_skeleton_anim
electrocution_skeleton_anim = null
/datum/hallucination/shock/proc/shock_drop()
if(QDELETED(hallucinator))
return
hallucinator.Paralyze(6 SECONDS)