Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes supermatter charged singularity damage the eyes of viewers #171

Merged
merged 4 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions code/datums/components/vision_hurting.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/// A component that damages eyes that look at the owner
/datum/component/vision_hurting
var/damage_per_second
var/message

/datum/component/vision_hurting/Initialize(damage_per_second=1, message="Your eyes burn as you look at")
if(!isatom(parent))
return COMPONENT_INCOMPATIBLE

src.damage_per_second = damage_per_second
src.message = message

START_PROCESSING(SSdcs, src)

/datum/component/vision_hurting/process(seconds_per_tick)
for(var/mob/living/carbon/viewer in viewers(parent))
if(viewer.is_blind() || viewer.get_eye_protection() >= damage_per_second)
continue
var/obj/item/organ/internal/eyes/burning_orbs = locate() in viewer.organs
if(!burning_orbs)
continue
burning_orbs.apply_organ_damage(damage_per_second * seconds_per_tick)
if(SPT_PROB(50, seconds_per_tick))
to_chat(viewer, span_userdanger("[message] [parent]!"))
if(SPT_PROB(20, seconds_per_tick))
viewer.emote("scream")
5 changes: 5 additions & 0 deletions code/modules/power/singularity/singularity.dm
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@
new_consume_range = 5
dissipate = FALSE

if(temp_allowed_size == STAGE_SIX)
AddComponent(/datum/component/vision_hurting)
else
qdel(GetComponent(/datum/component/vision_hurting))

var/datum/component/singularity/resolved_singularity = singularity_component.resolve()
if (!isnull(resolved_singularity))
resolved_singularity.consume_range = new_consume_range
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
attack_verb_simple = "attack"

/mob/living/simple_animal/hostile/megafauna/hierophant/astrum/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit = FALSE)
. = ..()
if(. != BULLET_ACT_HIT)
return

Expand Down
5 changes: 4 additions & 1 deletion modular_skyrat/modules/cellguns/code/medigun_cells.dm
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@
name = "clotting agent shot"

/obj/projectile/energy/medical/utility/clotting/on_hit(mob/living/target, blocked = 0, pierce_hit)
. = ..()
if(!IsLivingHuman(target))
return FALSE

Expand All @@ -387,6 +388,7 @@
name = "temperature adjustment shot"

/obj/projectile/energy/medical/utility/temperature/on_hit(mob/living/target, blocked = 0, pierce_hit)
. = ..()
if(!IsLivingHuman(target))
return FALSE

Expand All @@ -409,6 +411,7 @@
name = "hardlight surgical gown field"

/obj/projectile/energy/medical/utility/gown/on_hit(mob/living/target, blocked = 0, pierce_hit)
. = ..()
if(!istype(target, /mob/living/carbon/human)) //Dead check isn't fully needed, since it'd be reasonable for this to work on corpses.
return

Expand Down Expand Up @@ -438,7 +441,7 @@
/obj/projectile/energy/medical/utility/salve/on_hit(mob/living/target, blocked = 0, pierce_hit)
if(!IsLivingHuman(target)) //No using this on the dead or synths.
return FALSE
. = ..()
return ..()

//Hardlight Rollerbed Medicell
/obj/item/ammo_casing/energy/medical/utility/bed
Expand Down
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,7 @@
#include "code\datums\components\uplink.dm"
#include "code\datums\components\usb_port.dm"
#include "code\datums\components\vacuum.dm"
#include "code\datums\components\vision_hurting.dm"
#include "code\datums\components\wall_mounted.dm"
#include "code\datums\components\wearertargeting.dm"
#include "code\datums\components\weatherannouncer.dm"
Expand Down
Loading