mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 12:41:09 +01:00
41 lines
1.3 KiB
Plaintext
41 lines
1.3 KiB
Plaintext
/datum/mutation/radioactive
|
|
name = "Radioactivity"
|
|
desc = "A volatile mutation that causes the host to sent out deadly beta radiation. This affects both the hosts and their surroundings."
|
|
quality = NEGATIVE
|
|
text_gain_indication = span_warning("You can feel it in your bones!")
|
|
instability = NEGATIVE_STABILITY_MAJOR
|
|
difficulty = 8
|
|
power_coeff = 1
|
|
mutation_icon_state = "radiation"
|
|
offset_location = ENTIRE_BODY
|
|
/// Weakref to our radiation emitter component
|
|
var/datum/weakref/radioactivity_source_ref
|
|
|
|
/datum/mutation/radioactive/on_acquiring(mob/living/carbon/human/acquirer)
|
|
. = ..()
|
|
if(!.)
|
|
return
|
|
var/datum/component/radioactive_emitter/radioactivity_source = make_radioactive(acquirer)
|
|
radioactivity_source_ref = WEAKREF(radioactivity_source)
|
|
|
|
/datum/mutation/radioactive/setup()
|
|
. = ..()
|
|
if(!QDELETED(owner))
|
|
make_radioactive(owner)
|
|
|
|
/**
|
|
* Makes the passed mob radioactive, or if they're already radioactive,
|
|
* update their radioactivity to the newly set values
|
|
*/
|
|
/datum/mutation/radioactive/proc/make_radioactive(mob/living/carbon/human/who)
|
|
return who.AddComponent(
|
|
/datum/component/radioactive_emitter, \
|
|
cooldown_time = 5 SECONDS, \
|
|
range = 1 * (GET_MUTATION_POWER(src) * 2), \
|
|
threshold = RAD_MEDIUM_INSULATION, \
|
|
)
|
|
|
|
/datum/mutation/radioactive/on_losing(mob/living/carbon/human/owner)
|
|
QDEL_NULL(radioactivity_source_ref)
|
|
return ..()
|