mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
Merge branch 'master' of https://github.com/tgstation/tgstation into upstream-2025-11-12
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
// Empath quirk component, it's a component because it can be applied in ways that don't give you the quirk. (For health analyzer purposes)
|
||||
|
||||
/datum/component/empathy
|
||||
|
||||
dupe_mode = COMPONENT_DUPE_SOURCES
|
||||
|
||||
// Whether or not we should get scared the next time we see an evil person.
|
||||
var/seen_it = FALSE
|
||||
|
||||
// What sort of information we can glean from examining someone
|
||||
var/visible_info = ALL
|
||||
|
||||
// Whether or not we can use empathy on ourselves
|
||||
var/self_empath = FALSE
|
||||
|
||||
// Whether or not empathy works on humans playing dead
|
||||
var/sense_dead = FALSE
|
||||
|
||||
// Whether or not we can tell if people whisper under their mask from far away (We can't hear what they said, we just know they said something)
|
||||
var/sense_whisper = TRUE
|
||||
|
||||
// Whether or not we can be smited by someoneone with the evil trait using the mending touch mutation
|
||||
var/smite_target = TRUE
|
||||
|
||||
/datum/component/empathy/Initialize(seen_it = FALSE, visible_info = ALL, self_empath = FALSE, sense_dead = FALSE, sense_whisper = TRUE, smite_target = TRUE)
|
||||
if (!isliving(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
|
||||
src.seen_it = seen_it
|
||||
src.visible_info = visible_info
|
||||
src.self_empath = self_empath
|
||||
src.sense_dead = sense_dead
|
||||
src.sense_whisper = sense_whisper
|
||||
src.smite_target = smite_target
|
||||
if(sense_whisper)
|
||||
ADD_TRAIT(parent, TRAIT_SEE_MASK_WHISPER, REF(src))
|
||||
|
||||
/datum/component/empathy/RegisterWithParent()
|
||||
RegisterSignal(parent, COMSIG_CARBON_MID_EXAMINE, PROC_REF(get_empath_info))
|
||||
RegisterSignal(parent, COMSIG_ON_LAY_ON_HANDS, PROC_REF(on_hands_laid))
|
||||
|
||||
/datum/component/empathy/proc/get_empath_info(datum/source, mob/living/target, list/examine_list)
|
||||
SIGNAL_HANDLER
|
||||
if(target.stat == DEAD)
|
||||
return
|
||||
if(HAS_TRAIT(target, TRAIT_FAKEDEATH))
|
||||
if(sense_dead)
|
||||
examine_list += "Something about this dead body doesn't look right..."
|
||||
else
|
||||
return
|
||||
var/mob/living/living_parent = parent
|
||||
if(target == living_parent && !self_empath)
|
||||
return
|
||||
var/t_They = target.p_They()
|
||||
var/t_their = target.p_their()
|
||||
var/t_Their = target.p_Their()
|
||||
var/t_are = target.p_are()
|
||||
if((visible_info & EMPATH_SEE_COMBAT) && target.combat_mode)
|
||||
examine_list += "[t_They] seem[p_s()] to be on guard."
|
||||
if((visible_info & EMPATH_SEE_OXY) && target.getOxyLoss() >= 10)
|
||||
examine_list += "[t_They] seem[p_s()] winded."
|
||||
if((visible_info & EMPATH_SEE_TOX) && target.getToxLoss() >= 10)
|
||||
examine_list += "[t_They] seem[p_s()] sickly."
|
||||
if((visible_info & EMPATH_SEE_SANITY) && target.mob_mood.sanity <= SANITY_DISTURBED)
|
||||
examine_list += "[t_They] seem[p_s()] distressed."
|
||||
if((visible_info & EMPATH_SEE_BLIND) && target.is_blind())
|
||||
examine_list += "[t_They] appear[p_s()] to be staring off into space."
|
||||
if((visible_info & EMPATH_SEE_DEAF) && HAS_TRAIT(target, TRAIT_DEAF))
|
||||
examine_list += "[t_They] appear[p_s()] to not be responding to noises."
|
||||
if((visible_info & EMPATH_SEE_HOT) && target.bodytemperature > target.get_body_temp_heat_damage_limit())
|
||||
examine_list += "[t_They] [t_are] flushed and wheezing."
|
||||
if((visible_info & EMPATH_SEE_COLD) && target.bodytemperature < target.get_body_temp_cold_damage_limit())
|
||||
examine_list += "[t_They] [t_are] shivering."
|
||||
if((visible_info & EMPATH_SEE_EVIL) && HAS_TRAIT(target, TRAIT_EVIL))
|
||||
examine_list += "[t_Their] eyes radiate with a unfeeling, cold detachment. There is nothing but darkness within [t_their] soul."
|
||||
if(living_parent.mind?.holy_role >= HOLY_ROLE_PRIEST)
|
||||
examine_list += span_warning("PERFECT FOR SMITING!!")
|
||||
else if(!seen_it)
|
||||
seen_it = TRUE
|
||||
living_parent.add_mood_event("encountered_evil", /datum/mood_event/encountered_evil)
|
||||
living_parent.set_jitter_if_lower(15 SECONDS)
|
||||
|
||||
/datum/component/empathy/proc/on_hands_laid(datum/source, mob/living/carbon/smiter)
|
||||
SIGNAL_HANDLER
|
||||
if(iscarbon(parent))
|
||||
var/mob/living/carbon/carbon_parent = parent
|
||||
if(carbon_parent.mob_biotypes & MOB_UNDEAD)
|
||||
return FALSE
|
||||
if(smite_target && HAS_TRAIT(smiter, TRAIT_EVIL))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/component/empathy/UnregisterFromParent()
|
||||
UnregisterSignal(parent, COMSIG_CARBON_MID_EXAMINE)
|
||||
|
||||
/datum/component/empathy/Destroy(force = FALSE)
|
||||
REMOVE_TRAIT(parent, TRAIT_SEE_MASK_WHISPER, REF(src))
|
||||
return ..()
|
||||
@@ -155,7 +155,7 @@
|
||||
LAZYADD(grilled_food.intrinsic_food_materials, original_food.intrinsic_food_materials)
|
||||
grilled_result.set_custom_materials(original_object.custom_materials)
|
||||
|
||||
if(IsEdible(grilled_result) && positive_result)
|
||||
if(IS_EDIBLE(grilled_result) && positive_result)
|
||||
BLACKBOX_LOG_FOOD_MADE(grilled_result.type)
|
||||
//make space and tranfer reagents if it has any, also let any bad result handle removing or converting the transferred reagents on its own terms
|
||||
if(grilled_result.reagents && original_object.reagents)
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
var/datum/track/new_track = new()
|
||||
new_track.song_path = file("[global.config.directory]/jukebox_music/sounds/[track_file]")
|
||||
var/list/track_data = splittext(track_file, "+")
|
||||
if(length(track_data) < 3)
|
||||
if(length(track_data) < 3 || !IS_SOUND_FILE(new_track.song_path))
|
||||
continue
|
||||
new_track.song_name = track_data[1]
|
||||
new_track.song_length = text2num(track_data[2])
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
do_update_cam()
|
||||
|
||||
/datum/component/simple_bodycam/proc/do_update_cam()
|
||||
GLOB.cameranet.updatePortableCamera(bodycam, camera_update_time)
|
||||
SScameras.update_portable_camera(bodycam, camera_update_time)
|
||||
|
||||
/datum/component/simple_bodycam/proc/rotate_cam(datum/source, old_dir, new_dir)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
@@ -54,28 +54,25 @@
|
||||
return ..()
|
||||
|
||||
/datum/component/wet_floor/proc/update_overlay()
|
||||
var/turf/parent_turf = parent
|
||||
if(!should_display_overlay)
|
||||
if(!current_overlay)
|
||||
return
|
||||
|
||||
var/turf/parent_turf = parent
|
||||
parent_turf.cut_overlay(current_overlay)
|
||||
current_overlay = null
|
||||
return
|
||||
|
||||
var/intended
|
||||
if(!isfloorturf(parent))
|
||||
intended = generic_turf_overlay
|
||||
else
|
||||
switch(highest_strength)
|
||||
if(TURF_WET_PERMAFROST)
|
||||
intended = permafrost_overlay
|
||||
if(TURF_WET_ICE)
|
||||
intended = ice_overlay
|
||||
else
|
||||
intended = water_overlay
|
||||
switch(highest_strength)
|
||||
if(TURF_WET_PERMAFROST)
|
||||
intended = permafrost_overlay
|
||||
if(TURF_WET_ICE)
|
||||
// Should really get someone to make a generic_ice_overlay.
|
||||
intended = parent_turf.tiled_turf ? ice_overlay : generic_turf_overlay
|
||||
else
|
||||
intended = parent_turf.tiled_turf ? water_overlay : generic_turf_overlay
|
||||
if(current_overlay != intended)
|
||||
var/turf/parent_turf = parent
|
||||
parent_turf.cut_overlay(current_overlay)
|
||||
parent_turf.add_overlay(intended)
|
||||
current_overlay = intended
|
||||
|
||||
Reference in New Issue
Block a user