mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-15 20:22:07 +00:00
## About The Pull Request This PR addresses an issue where netpod healing effects persisted under certain conditions (Issue #80715). Specifically, when a netpod is destroyed with a player inside, the embryonic stasis effect improperly continued. This adds another cases where the user is teleported out by other means (not currently a known issue). ## Why It's Good For The Game Fixes an in game exploit / bug Fixes #80715 ## Changelog 🆑 fix: Having a netpod destroyed will no longer grant you permanent healing. /🆑
70 lines
1.9 KiB
Plaintext
70 lines
1.9 KiB
Plaintext
#define BASE_HEAL 4
|
|
|
|
/datum/component/netpod_healing
|
|
|
|
/datum/component/netpod_healing/Initialize(obj/machinery/netpod/pod)
|
|
if (!iscarbon(parent))
|
|
return COMPONENT_INCOMPATIBLE
|
|
|
|
RegisterSignals(
|
|
pod,
|
|
list(COMSIG_MACHINERY_BROKEN, COMSIG_QDELETING, COMSIG_BITRUNNER_NETPOD_OPENED),
|
|
PROC_REF(on_remove),
|
|
)
|
|
|
|
RegisterSignal(parent, COMSIG_MOVABLE_MOVED, PROC_REF(on_remove))
|
|
|
|
var/mob/living/carbon/player = parent
|
|
player.apply_status_effect(/datum/status_effect/embryonic, STASIS_NETPOD_EFFECT)
|
|
|
|
START_PROCESSING(SSmachines, src)
|
|
|
|
/datum/component/netpod_healing/Destroy(force)
|
|
STOP_PROCESSING(SSmachines, src)
|
|
|
|
var/mob/living/carbon/player = parent
|
|
player.remove_status_effect(/datum/status_effect/embryonic)
|
|
|
|
return ..()
|
|
|
|
/datum/component/netpod_healing/process(seconds_per_tick)
|
|
var/mob/living/carbon/owner = parent
|
|
if(isnull(owner))
|
|
qdel(src)
|
|
return
|
|
|
|
var/need_mob_update = FALSE
|
|
need_mob_update += owner.adjustBruteLoss(-BASE_HEAL * seconds_per_tick, updating_health = FALSE)
|
|
need_mob_update += owner.adjustFireLoss(-BASE_HEAL * seconds_per_tick, updating_health = FALSE)
|
|
need_mob_update += owner.adjustToxLoss(-BASE_HEAL * seconds_per_tick, updating_health = FALSE, forced = TRUE)
|
|
|
|
if(owner.blood_volume < BLOOD_VOLUME_NORMAL)
|
|
owner.blood_volume += BASE_HEAL * seconds_per_tick
|
|
|
|
if(need_mob_update)
|
|
owner.updatehealth()
|
|
|
|
/// Deletes itself when the machine was opened
|
|
/datum/component/netpod_healing/proc/on_remove()
|
|
SIGNAL_HANDLER
|
|
|
|
qdel(src)
|
|
|
|
/datum/status_effect/embryonic
|
|
id = "embryonic"
|
|
alert_type = /atom/movable/screen/alert/status_effect/embryonic
|
|
|
|
/datum/status_effect/embryonic/on_apply()
|
|
ADD_TRAIT(owner, TRAIT_STASIS, TRAIT_STATUS_EFFECT(id))
|
|
return TRUE
|
|
|
|
/datum/status_effect/embryonic/on_remove()
|
|
REMOVE_TRAIT(owner, TRAIT_STASIS, TRAIT_STATUS_EFFECT(id))
|
|
|
|
/atom/movable/screen/alert/status_effect/embryonic
|
|
name = "Embryonic Stasis"
|
|
icon_state = "netpod_stasis"
|
|
desc = "You feel like you're in a dream."
|
|
|
|
#undef BASE_HEAL
|