Skip to content

Commit

Permalink
impprove
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoonij authored Dec 23, 2024
1 parent 66734ee commit 9154581
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 18 deletions.
2 changes: 0 additions & 2 deletions code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -916,8 +916,6 @@
#define COMSIG_HUMAN_SPECIES_CHANGED "human_species_changed"
/// Source: /mob/living/carbon/human/handle_environment(datum/gas_mixture/environment)
#define COMSIG_HUMAN_EARLY_HANDLE_ENVIRONMENT "human_early_handle_environment"
/// Source: /mob/living/carbon/human/handle_environment(datum/gas_mixture/environment)
#define COMSIG_HUMAN_HANDLE_ENVIRONMENT "human_handle_environment"

///from /mob/living/carbon/human/proc/check_shields(): (atom/hit_by, damage, attack_text, attack_type, armour_penetration, damage_type)
#define COMSIG_HUMAN_CHECK_SHIELDS "human_check_shields"
Expand Down
4 changes: 2 additions & 2 deletions code/datums/status_effects/buffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@
return ..()

/datum/status_effect/drask_coma/on_apply()
to_chat(owner, span_notice("Your metabolical processes are stopped."))
to_chat(owner, span_notice("Ваш метаболизм полностью остановлен."))

cached_sleep_time = world.time
owner.AdjustSleeping(duration)
Expand All @@ -811,7 +811,7 @@
owner.adjust_bodytemperature(-temp_step)

/datum/status_effect/drask_coma/on_remove()
to_chat(owner, span_notice("You feel that your metabolism restored to normal state."))
to_chat(owner, span_notice("Вы чувствуете прилив сил и наконец просыпаетесь."))

var/elapsed_time = world.time - cached_sleep_time

Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/carbon/human/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@
//Body temperature is adjusted in two steps. Firstly your body tries to stabilize itself a bit.
if(stat != DEAD)
body_thermal_regulation(loc_temp)
SEND_SIGNAL(src, COMSIG_HUMAN_HANDLE_ENVIRONMENT, environment)

// After then, it reacts to the surrounding atmosphere based on your thermal protection
// If we are on fire, we do not heat up or cool down based on surrounding gases
Expand Down
29 changes: 19 additions & 10 deletions code/modules/mob/living/carbon/human/species/drask.dm
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
/datum/action/innate/drask/Grant(mob/user)
. = ..()

if(!. && !isliving(user))
if(!. || !isliving(user))
return FALSE

return .
Expand All @@ -165,26 +165,35 @@
var/mob/living/living = owner

if(!living.has_status_effect(STATUS_EFFECT_DRASK_COMA))
if(living.stat)
return
handle_activation(living)
return

if(!do_after(living, 5 SECONDS, living, ALL, cancel_on_max = TRUE, max_interact_count = 1))
return
handle_deactivation(living)

living.apply_status_effect(STATUS_EFFECT_DRASK_COMA)
COOLDOWN_START(src, wake_up_cooldown, 10 SECONDS)
/datum/action/innate/drask/coma/proc/handle_activation(mob/living/living)
if(living.stat)
return FALSE

return
if(!do_after(living, 5 SECONDS, living, ALL, cancel_on_max = TRUE, max_interact_count = 1))
return FALSE

living.apply_status_effect(STATUS_EFFECT_DRASK_COMA)
COOLDOWN_START(src, wake_up_cooldown, 10 SECONDS)

return TRUE

/datum/action/innate/drask/coma/proc/handle_deactivation(mob/living/living)
if(!COOLDOWN_FINISHED(src, wake_up_cooldown))
to_chat(living, span_warning("Вы не можете пробудиться сейчас."))
return
return FALSE

if(!do_after(living, 10 SECONDS, living, ALL, cancel_on_max = TRUE, max_interact_count = 1))
return
return FALSE

living.remove_status_effect(STATUS_EFFECT_DRASK_COMA)

return TRUE

/datum/species/drask/get_emote_pitch(mob/living/carbon/human/H, tolerance)
. = ..()
. += DRASK_PITCH_SHIFT
Expand Down
9 changes: 6 additions & 3 deletions code/modules/surgery/organs/lungs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -343,16 +343,19 @@
if(!.)
return FALSE

RegisterSignal(owner, COMSIG_HUMAN_HANDLE_ENVIRONMENT, PROC_REF(regulate_temperature))
RegisterSignal(owner, COMSIG_HUMAN_EARLY_HANDLE_ENVIRONMENT, PROC_REF(regulate_temperature))

/obj/item/organ/internal/lungs/drask/proc/regulate_temperature(datum/source, datum/gas_mixture/environment)
/obj/item/organ/internal/lungs/drask/proc/regulate_temperature(mob/living/source, datum/gas_mixture/environment)
SIGNAL_HANDLER

if(source.stat == DEAD)
return

if(owner.bodytemperature > cooling_start_temp && environment.temperature <= cooling_stop_temp)
owner.adjust_bodytemperature(-5)

/obj/item/organ/internal/lungs/drask/remove(mob/living/user, special = ORGAN_MANIPULATION_DEFAULT)
UnregisterSignal(owner, COMSIG_HUMAN_HANDLE_ENVIRONMENT)
UnregisterSignal(owner, COMSIG_HUMAN_EARLY_HANDLE_ENVIRONMENT)
return ..()

/obj/item/organ/internal/lungs/cybernetic
Expand Down

0 comments on commit 9154581

Please sign in to comment.