Merge branch 'master' into hook-kill-v10-final-ultimate-final

This commit is contained in:
AffectedArc07
2020-06-26 12:30:43 +01:00
committed by GitHub
617 changed files with 7362 additions and 10731 deletions
+5
View File
@@ -14,3 +14,8 @@
/mob/camera/experience_pressure_difference()
return
/mob/camera/forceMove(atom/destination)
var/oldloc = loc
loc = destination
Moved(oldloc, NONE)
+1 -1
View File
@@ -15,7 +15,7 @@
onTransitZ(old_turf?.z, new_turf?.z)
var/oldloc = loc
loc = destination
Moved(oldloc, NONE, TRUE)
Moved(oldloc, NONE)
/mob/dead/onTransitZ(old_z,new_z)
..()
+2 -42
View File
@@ -23,7 +23,6 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
//If you died in the game and are a ghsot - this will remain as null.
//Note that this is not a reliable way to determine if admins started as observers, since they change mobs a lot.
universal_speak = TRUE
var/atom/movable/following = null
var/image/ghostimage = null //this mobs ghost image, for deleting and stuff
var/ghostvision = TRUE //is the ghost able to see things humans can't?
var/seedarkness = TRUE
@@ -91,10 +90,6 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
..()
/mob/dead/observer/Destroy()
if(ismob(following))
var/mob/M = following
M.following_mobs -= src
following = null
if(ghostimage)
GLOB.ghost_images -= ghostimage
QDEL_NULL(ghostimage)
@@ -142,13 +137,6 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
Transfer_mind is there to check if mob is being deleted/not going to have a body.
Works together with spawning an observer, noted above.
*/
/mob/dead/observer/Life(seconds, times_fired)
..()
if(!loc) return
if(!client) return 0
/mob/dead/proc/assess_targets(list/target_list, mob/dead/observer/U)
var/client/C = U.client
for(var/mob/living/carbon/human/target in target_list)
@@ -241,7 +229,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob/dead/observer/Move(NewLoc, direct)
update_parallax_contents()
following = null
setDir(direct)
ghostimage.setDir(dir)
@@ -423,7 +410,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
forceMove(pick(L))
update_parallax_contents()
following = null
/mob/dead/observer/verb/follow()
set category = "Ghost"
@@ -435,7 +421,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
A.on_close(CALLBACK(src, .proc/ManualFollow))
// This is the ghost's follow verb with an argument
/mob/dead/observer/proc/ManualFollow(var/atom/movable/target)
/mob/dead/observer/proc/ManualFollow(atom/movable/target)
if(!target || !isobserver(usr))
return
@@ -443,7 +429,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
return
if(target != src)
if(following && following == target)
if(orbiting && orbiting == target)
return
var/icon/I = icon(target.icon,target.icon_state,target.dir)
@@ -469,7 +455,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
else //Circular
rot_seg = 36 //360/10 bby, smooth enough aproximation of a circle
following = target
to_chat(src, "<span class='notice'>Now following [target]</span>")
orbit(target,orbitsize, FALSE, 20, rot_seg)
@@ -477,28 +462,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
setDir(2)//reset dir so the right directional sprites show up
return ..()
/mob/proc/update_following()
. = get_turf(src)
for(var/mob/dead/observer/M in following_mobs)
if(M.following != src)
following_mobs -= M
else
if(M.loc != .)
M.forceMove(.)
/mob
var/list/following_mobs = list()
/mob/Move()
. = ..()
if(.)
update_following()
/mob/Life(seconds, times_fired)
// to catch teleports etc which directly set loc
update_following()
return ..()
/mob/dead/observer/verb/jumptomob() //Moves the ghost instead of just changing the ghosts's eye -Nodrak
set category = "Ghost"
set name = "Jump to Mob"
@@ -518,7 +481,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(T && isturf(T)) //Make sure the turf exists, then move the source to that destination.
A.forceMove(T)
M.update_parallax_contents()
following = null
return
to_chat(A, "This mob is not located in the game world.")
@@ -649,7 +611,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob/dead/observer/Topic(href, href_list)
if(usr != src)
return
..()
if(href_list["track"])
var/atom/target = locate(href_list["track"])
@@ -676,7 +637,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(!client)
return
forceMove(T)
following = null
if(href_list["reenter"])
reenter_corpse()
-1
View File
@@ -22,7 +22,6 @@
var/atom/movable/mob_container
mob_container = M
mob_container.forceMove(get_turf(src))
M.reset_perspective()
qdel(src)
+2 -2
View File
@@ -214,9 +214,9 @@
if(M.equip_to_appropriate_slot(src))
if(M.hand)
M.update_inv_l_hand(0)
M.update_inv_l_hand()
else
M.update_inv_r_hand(0)
M.update_inv_r_hand()
return 1
if(M.s_active && M.s_active.can_be_inserted(src, 1)) //if storage active insert there
+2 -2
View File
@@ -33,7 +33,7 @@
for(var/i = 0;i<name_count;i++)
new_name = ""
for(var/x = rand(Floor(syllable_count/2),syllable_count);x>0;x--)
for(var/x = rand(FLOOR(syllable_count/2, 1),syllable_count);x>0;x--)
new_name += pick(syllables)
full_name += " [capitalize(lowertext(new_name))]"
@@ -619,7 +619,7 @@
var/message_start_dead = "<i><span class='game say'>[name], <span class='name'>[speaker.name] ([ghost_follow_link(speaker, ghost=M)])</span>"
M.show_message("[message_start_dead] [message_body]", 2)
for(var/mob/living/S in GLOB.living_mob_list)
for(var/mob/living/S in GLOB.alive_mob_list)
if(drone_only && !istype(S,/mob/living/silicon/robot/drone))
continue
else if(isAI(S))
+3 -20
View File
@@ -26,6 +26,8 @@
var/death_sound = 'sound/voice/hiss6.ogg'
/mob/living/carbon/alien/New()
..()
create_reagents(1000)
verbs += /mob/living/verb/mob_sleep
verbs += /mob/living/verb/lay_down
alien_organs += new /obj/item/organ/internal/brain/xeno
@@ -33,7 +35,6 @@
alien_organs += new /obj/item/organ/internal/ears
for(var/obj/item/organ/internal/I in alien_organs)
I.insert(src)
..()
/mob/living/carbon/alien/get_default_language()
if(default_language)
@@ -67,18 +68,6 @@
/mob/living/carbon/alien/check_eye_prot()
return 2
/mob/living/carbon/alien/updatehealth(reason = "none given")
if(status_flags & GODMODE)
health = maxHealth
stat = CONSCIOUS
return
health = maxHealth - getOxyLoss() - getFireLoss() - getBruteLoss() - getCloneLoss()
update_stat("updatehealth([reason])")
med_hud_set_health()
med_hud_set_status()
handle_hud_icons_health()
/mob/living/carbon/alien/handle_environment(var/datum/gas_mixture/environment)
if(!environment)
@@ -118,12 +107,6 @@
else
clear_alert("alien_fire")
/mob/living/carbon/alien/handle_fire()//Aliens on fire code
if(..())
return
bodytemperature += BODYTEMP_HEATING_MAX //If you're on fire, you heat up!
return
/mob/living/carbon/alien/IsAdvancedToolUser()
return has_fine_manipulation
@@ -243,7 +226,7 @@ Des: Removes all infected images from the alien.
/mob/living/carbon/alien/handle_footstep(turf/T)
if(..())
if(T.footstep_sounds["xeno"])
if(T.footstep_sounds && T.footstep_sounds["xeno"])
var/S = pick(T.footstep_sounds["xeno"])
if(S)
if(m_intent == MOVE_INTENT_RUN)
@@ -167,4 +167,4 @@ Doesn't work on other aliens/AI.*/
adjustPlasma(-amount)
return 1
return 0
return 0
@@ -6,7 +6,6 @@
icon_state = "aliend_s"
/mob/living/carbon/alien/humanoid/drone/New()
create_reagents(100)
if(src.name == "alien drone")
src.name = text("alien drone ([rand(1, 1000)])")
src.real_name = src.name
@@ -26,7 +25,7 @@
if(powerc(500))
// Queen check
var/no_queen = 1
for(var/mob/living/carbon/alien/humanoid/queen/Q in GLOB.living_mob_list)
for(var/mob/living/carbon/alien/humanoid/queen/Q in GLOB.alive_mob_list)
if(!Q.key && Q.get_int_organ(/obj/item/organ/internal/brain/))
continue
no_queen = 0
@@ -6,7 +6,6 @@
icon_state = "alienh_s"
/mob/living/carbon/alien/humanoid/hunter/New()
create_reagents(100)
if(name == "alien hunter")
name = text("alien hunter ([rand(1, 1000)])")
real_name = name
@@ -17,28 +16,6 @@
. = -1 //hunters are sanic
. += ..() //but they still need to slow down on stun
/mob/living/carbon/alien/humanoid/hunter/handle_hud_icons_health()
..() //-Yvarov
if(healths)
if(stat != 2)
switch(health)
if(125 to INFINITY)
healths.icon_state = "health0"
if(100 to 125)
healths.icon_state = "health1"
if(50 to 100)
healths.icon_state = "health2"
if(25 to 50)
healths.icon_state = "health3"
if(0 to 25)
healths.icon_state = "health4"
else
healths.icon_state = "health5"
else
healths.icon_state = "health6"
/mob/living/carbon/alien/humanoid/hunter/handle_environment()
if(m_intent == MOVE_INTENT_RUN || resting)
..()
@@ -33,7 +33,6 @@
overlays += I
/mob/living/carbon/alien/humanoid/sentinel/New()
create_reagents(100)
if(name == "alien sentinel")
name = text("alien sentinel ([rand(1, 1000)])")
real_name = name
@@ -42,27 +41,6 @@
alien_organs += new /obj/item/organ/internal/xenos/neurotoxin
..()
/mob/living/carbon/alien/humanoid/sentinel/handle_hud_icons_health()
..() //-Yvarov
if(healths)
if(stat != 2)
switch(health)
if(150 to INFINITY)
healths.icon_state = "health0"
if(100 to 150)
healths.icon_state = "health1"
if(75 to 100)
healths.icon_state = "health2"
if(25 to 75)
healths.icon_state = "health3"
if(0 to 25)
healths.icon_state = "health4"
else
healths.icon_state = "health5"
else
healths.icon_state = "health6"
/*
/mob/living/carbon/alien/humanoid/sentinel/verb/evolve() // -- TLE
set name = "Evolve (250)"
@@ -30,17 +30,17 @@
overlays += I
/mob/living/carbon/alien/humanoid/empress/New()
create_reagents(100)
//there should only be one queen
for(var/mob/living/carbon/alien/humanoid/empress/E in GLOB.living_mob_list)
if(E == src) continue
if(E.stat == DEAD) continue
for(var/mob/living/carbon/alien/humanoid/empress/E in GLOB.alive_mob_list)
if(E == src)
continue
if(E.stat == DEAD)
continue
if(E.client)
name = "alien grand princess ([rand(1, 999)])" //if this is too cutesy feel free to change it/remove it.
break
real_name = src.name
real_name = name
alien_organs += new /obj/item/organ/internal/xenos/plasmavessel/queen
alien_organs += new /obj/item/organ/internal/xenos/acidgland
alien_organs += new /obj/item/organ/internal/xenos/eggsac
@@ -48,27 +48,6 @@
alien_organs += new /obj/item/organ/internal/xenos/neurotoxin
..()
/mob/living/carbon/alien/humanoid/empress/handle_hud_icons_health()
..() //-Yvarov
if(healths)
if(stat != 2)
switch(health)
if(250 to INFINITY)
healths.icon_state = "health0"
if(175 to 250)
healths.icon_state = "health1"
if(100 to 175)
healths.icon_state = "health2"
if(50 to 100)
healths.icon_state = "health3"
if(0 to 50)
healths.icon_state = "health4"
else
healths.icon_state = "health5"
else
healths.icon_state = "health6"
/mob/living/carbon/alien/humanoid/empress/verb/lay_egg()
set name = "Lay Egg (250)"
set desc = "Lay an egg to produce huggers to impregnate prey with."
@@ -17,7 +17,6 @@
//This is fine right now, if we're adding organ specific damage this needs to be updated
/mob/living/carbon/alien/humanoid/New()
create_reagents(1000)
if(name == "alien")
name = text("alien ([rand(1, 1000)])")
real_name = name
@@ -55,7 +55,7 @@
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
visible_message("<span class='danger'>[M] has attempted to disarm [src]!</span>")
/mob/living/carbon/alien/humanoid/do_attack_animation(atom/A, visual_effect_icon, obj/item/used_item, no_effect, end_pixel_y)
/mob/living/carbon/alien/humanoid/do_attack_animation(atom/A, visual_effect_icon, obj/item/used_item, no_effect)
if(!no_effect && !visual_effect_icon)
visual_effect_icon = ATTACK_EFFECT_CLAW
..()
@@ -2,27 +2,6 @@
. = ..()
update_icons()
/mob/living/carbon/alien/humanoid/handle_disabilities()
if(disabilities & EPILEPSY)
if((prob(1) && paralysis < 10))
to_chat(src, "<span class='danger'>You have a seizure!</span>")
Paralyse(10)
if(disabilities & COUGHING)
if((prob(5) && paralysis <= 1))
drop_item()
emote("cough")
return
if(disabilities & TOURETTES)
if((prob(10) && paralysis <= 1))
Stun(10)
emote("twitch")
return
if(disabilities & NERVOUS)
if(prob(10))
stuttering = max(10, stuttering)
/mob/living/carbon/alien/humanoid/proc/adjust_body_temperature(current, loc_temp, boost)
var/temperature = current
var/difference = abs(current-loc_temp) //get difference
@@ -39,51 +18,3 @@
temperature = max(loc_temp, temperature-change)
temp_change = (temperature - current)
return temp_change
/mob/living/carbon/alien/humanoid/handle_regular_status_updates()
updatehealth()
if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP
SetSilence(0)
else //ALIVE. LIGHTS ARE ON
if(health < HEALTH_THRESHOLD_DEAD && check_death_method() || !get_int_organ(/obj/item/organ/internal/brain))
death()
SetSilence(0)
return 1
//UNCONSCIOUS. NO-ONE IS HOME
if((getOxyLoss() > 50) || (HEALTH_THRESHOLD_CRIT >= health && check_death_method()))
if(health <= 20 && prob(1))
emote("gasp")
if(!reagents.has_reagent("epinephrine"))
adjustOxyLoss(1)
Paralyse(3)
if(paralysis)
stat = UNCONSCIOUS
else if(sleeping)
stat = UNCONSCIOUS
if(prob(10) && health)
emote("hiss")
//CONSCIOUS
else
stat = CONSCIOUS
/* What in the living hell is this?*/
if(move_delay_add > 0)
move_delay_add = max(0, move_delay_add - rand(1, 2))
if(eye_blind) //blindness, heals slowly over time
AdjustEyeBlind(-1)
else if(eye_blurry) //blurry eyes heal slowly
AdjustEyeBlurry(-1)
if(stuttering)
AdjustStuttering(-1)
if(silent)
AdjustSilence(-1)
if(druggy)
AdjustDruggy(-1)
return 1
@@ -11,12 +11,12 @@
pressure_resistance = 200 //Because big, stompy xenos should not be blown around like paper.
/mob/living/carbon/alien/humanoid/queen/New()
create_reagents(100)
//there should only be one queen
for(var/mob/living/carbon/alien/humanoid/queen/Q in GLOB.living_mob_list)
if(Q == src) continue
if(Q.stat == DEAD) continue
for(var/mob/living/carbon/alien/humanoid/queen/Q in GLOB.alive_mob_list)
if(Q == src)
continue
if(Q.stat == DEAD)
continue
if(Q.client)
name = "alien princess ([rand(1, 999)])" //if this is too cutesy feel free to change it/remove it.
break
@@ -33,27 +33,6 @@
. = ..()
. += 3
/mob/living/carbon/alien/humanoid/queen/handle_hud_icons_health()
..() //-Yvarov
if(healths)
if(stat != DEAD)
switch(health)
if(250 to INFINITY)
healths.icon_state = "health0"
if(175 to 250)
healths.icon_state = "health1"
if(100 to 175)
healths.icon_state = "health2"
if(50 to 100)
healths.icon_state = "health3"
if(0 to 50)
healths.icon_state = "health4"
else
healths.icon_state = "health5"
else
healths.icon_state = "health6"
/mob/living/carbon/alien/humanoid/queen/can_inject(mob/user, error_msg, target_zone, penetrate_thick)
return FALSE
@@ -56,13 +56,14 @@
/mob/living/carbon/alien/humanoid/regenerate_icons()
..()
if(notransform) return
if(notransform)
return
update_inv_head(0,0)
update_inv_wear_suit(0,0)
update_inv_r_hand(0)
update_inv_l_hand(0)
update_inv_pockets(0)
update_inv_head()
update_inv_wear_suit()
update_inv_r_hand()
update_inv_l_hand()
update_inv_pockets()
update_icons()
update_fire()
update_transform()
@@ -82,7 +83,7 @@
else
overlays_standing[X_FIRE_LAYER] = null
/mob/living/carbon/alien/humanoid/update_inv_wear_suit(var/update_icons=1)
/mob/living/carbon/alien/humanoid/update_inv_wear_suit()
if(client && hud_used)
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_wear_suit]
inv.update_icon()
@@ -110,10 +111,10 @@
overlays_standing[X_SUIT_LAYER] = standing
else
overlays_standing[X_SUIT_LAYER] = null
if(update_icons) update_icons()
update_icons()
/mob/living/carbon/alien/humanoid/update_inv_head(var/update_icons=1)
/mob/living/carbon/alien/humanoid/update_inv_head()
if(head)
var/t_state = head.item_state
if(!t_state) t_state = head.icon_state
@@ -124,17 +125,19 @@
overlays_standing[X_HEAD_LAYER] = standing
else
overlays_standing[X_HEAD_LAYER] = null
if(update_icons) update_icons()
update_icons()
/mob/living/carbon/alien/humanoid/update_inv_pockets(var/update_icons=1)
if(l_store) l_store.screen_loc = ui_storage1
if(r_store) r_store.screen_loc = ui_storage2
if(update_icons) update_icons()
/mob/living/carbon/alien/humanoid/update_inv_pockets()
if(l_store)
l_store.screen_loc = ui_storage1
if(r_store)
r_store.screen_loc = ui_storage2
update_icons()
/mob/living/carbon/alien/humanoid/update_inv_r_hand(var/update_icons=1)
..(1)
/mob/living/carbon/alien/humanoid/update_inv_r_hand()
..()
if(r_hand)
var/t_state = r_hand.item_state
if(!t_state) t_state = r_hand.icon_state
@@ -142,10 +145,10 @@
overlays_standing[X_R_HAND_LAYER] = image("icon" = r_hand.righthand_file, "icon_state" = t_state)
else
overlays_standing[X_R_HAND_LAYER] = null
if(update_icons) update_icons()
update_icons()
/mob/living/carbon/alien/humanoid/update_inv_l_hand(var/update_icons=1)
..(1)
/mob/living/carbon/alien/humanoid/update_inv_l_hand()
..()
if(l_hand)
var/t_state = l_hand.item_state
if(!t_state) t_state = l_hand.icon_state
@@ -153,7 +156,7 @@
overlays_standing[X_L_HAND_LAYER] = image("icon" = l_hand.lefthand_file, "icon_state" = t_state)
else
overlays_standing[X_L_HAND_LAYER] = null
if(update_icons) update_icons()
update_icons()
//Xeno Overlays Indexes//////////
@@ -5,8 +5,8 @@
pass_flags = PASSTABLE | PASSMOB
mob_size = MOB_SIZE_SMALL
maxHealth = 30
health = 30
maxHealth = 25
health = 25
density = 0
var/amount_grown = 0
@@ -17,7 +17,6 @@
//This is fine right now, if we're adding organ specific damage this needs to be updated
/mob/living/carbon/alien/larva/New()
create_reagents(100)
if(name == "alien larva")
name = "alien larva ([rand(1, 1000)])"
real_name = name
@@ -25,7 +24,6 @@
add_language("Xenomorph")
add_language("Hivemind")
alien_organs += new /obj/item/organ/internal/xenos/plasmavessel/larva
..()
//This needs to be fixed
@@ -31,7 +31,7 @@
step_away(src, user, 15)
return TRUE
/mob/living/carbon/alien/larva/do_attack_animation(atom/A, visual_effect_icon, obj/item/used_item, no_effect, end_pixel_y)
/mob/living/carbon/alien/larva/do_attack_animation(atom/A, visual_effect_icon, obj/item/used_item, no_effect)
if(!no_effect && !visual_effect_icon)
visual_effect_icon = ATTACK_EFFECT_BITE
..()
@@ -1,57 +1,28 @@
/mob/living/carbon/alien/larva/Life(seconds, times_fired)
if(..()) //still breathing
set invisibility = 0
if(notransform)
return
if(..()) //not dead and not in stasis
// GROW!
if(amount_grown < max_grown)
amount_grown++
update_icons()
//some kind of bug in canmove() isn't properly calling update_icons, so this is here as a placeholder
update_icons()
/mob/living/carbon/alien/larva/handle_regular_status_updates()
updatehealth()
if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP
SetSilence(0)
else //ALIVE. LIGHTS ARE ON
if(health < -25 || !get_int_organ(/obj/item/organ/internal/brain))
/mob/living/carbon/alien/larva/update_stat(reason = "None given")
if(status_flags & GODMODE)
return
if(stat != DEAD)
if(health <= -maxHealth || !get_int_organ(/obj/item/organ/internal/brain))
death()
SetSilence(0)
return 1
return
//UNCONSCIOUS. NO-ONE IS HOME
if((getOxyLoss() > 25) || (HEALTH_THRESHOLD_CRIT >= health && check_death_method()))
//if( health <= 20 && prob(1) )
// spawn(0)
// emote("gasp")
if(!reagents.has_reagent("epinephrine"))
adjustOxyLoss(1)
Paralyse(3)
if(paralysis)
stat = UNCONSCIOUS
else if(sleeping)
stat = UNCONSCIOUS
if(prob(10) && health)
emote("hiss_")
//CONSCIOUS
if(paralysis || sleeping || getOxyLoss() > 50 || (HEALTH_THRESHOLD_CRIT <= health && check_death_method()))
if(stat == CONSCIOUS)
KnockOut()
create_debug_log("fell unconscious, trigger reason: [reason]")
else
stat = CONSCIOUS
/* What in the living hell is this?*/
if(move_delay_add > 0)
move_delay_add = max(0, move_delay_add - rand(1, 2))
if(eye_blind) //blindness, heals slowly over time
AdjustEyeBlind(-1)
else if(eye_blurry) //blurry eyes heal slowly
AdjustEyeBlurry(-1)
if(stuttering)
AdjustStuttering(-1)
if(silent)
AdjustSilence(-1)
if(druggy)
AdjustDruggy(-1)
return 1
if(stat == UNCONSCIOUS)
WakeUp()
create_debug_log("woke up, trigger reason: [reason]")
update_damage_hud()
update_health_hud()
@@ -28,3 +28,15 @@
//BREATH TEMPERATURE
handle_breath_temperature(breath)
/mob/living/carbon/alien/handle_status_effects()
..()
//natural reduction of movement delay due to stun.
if(move_delay_add > 0)
move_delay_add = max(0, move_delay_add - rand(1, 2))
/mob/living/carbon/alien/handle_fire()//Aliens on fire code
. = ..()
if(.) //if the mob isn't on fire anymore
return
adjust_bodytemperature(BODYTEMP_HEATING_MAX) //If you're on fire, you heat up!
@@ -146,7 +146,7 @@
"<span class='userdanger'>[src] tears [W] off of [target]'s face!</span>")
src.loc = target
target.equip_to_slot(src, slot_wear_mask,,0)
target.equip_to_slot_if_possible(src, slot_wear_mask, FALSE, TRUE)
if(!sterile)
M.Paralyse(MAX_IMPREGNATION_TIME/6) //something like 25 ticks = 20 seconds with the default settings
+2 -2
View File
@@ -49,7 +49,7 @@
brainmob.stat = CONSCIOUS
GLOB.respawnable_list -= brainmob
GLOB.dead_mob_list -= brainmob//Update dem lists
GLOB.living_mob_list += brainmob
GLOB.alive_mob_list += brainmob
held_brain = B
if(istype(O,/obj/item/organ/internal/brain/xeno)) // kept the type check, as it still does other weird stuff
@@ -157,7 +157,7 @@
brainmob.container = null//Reset brainmob mmi var.
brainmob.forceMove(held_brain) //Throw mob into brain.
GLOB.respawnable_list += brainmob
GLOB.living_mob_list -= brainmob//Get outta here
GLOB.alive_mob_list -= brainmob//Get outta here
held_brain.brainmob = brainmob//Set the brain to use the brainmob
held_brain.brainmob.cancel_camera()
brainmob = null//Set mmi brainmob var to null
@@ -7,9 +7,8 @@
icon_state = "brain1"
/mob/living/carbon/brain/New()
create_reagents(330)
add_language("Galactic Common")
..()
add_language("Galactic Common")
/mob/living/carbon/brain/Destroy()
if(key) //If there is a mob connected to this thing. Have to check key twice to avoid false death reporting.
@@ -26,11 +26,9 @@
mmi_icon = 'icons/mob/alien.dmi'
mmi_icon_state = "AlienMMI"
/obj/item/organ/internal/brain/New()
..()
spawn(5)
if(brainmob && brainmob.client)
brainmob.client.screen.len = null //clear the hud
/obj/item/organ/internal/brain/Destroy()
QDEL_NULL(brainmob)
return ..()
/obj/item/organ/internal/brain/proc/transfer_identity(var/mob/living/carbon/H)
brainmob = new(src)
@@ -72,7 +70,7 @@
if(istype(owner,/mob/living/carbon/human))
var/mob/living/carbon/human/H = owner
H.update_hair(1)
H.update_hair()
. = ..()
/obj/item/organ/internal/brain/insert(var/mob/living/target,special = 0)
@@ -84,7 +82,7 @@
brain_already_exists = 1
var/mob/living/carbon/human/H = target
H.update_hair(1)
H.update_hair()
if(!brain_already_exists)
if(brainmob)
+2 -4
View File
@@ -28,13 +28,11 @@
var/discomfort = min( abs(exposed_temperature - bodytemperature)*(exposed_intensity)/2000000, 1.0)
adjustFireLoss(5.0*discomfort)
/mob/living/carbon/brain/handle_regular_status_updates()
/mob/living/carbon/brain/Life()
. = ..()
if(.)
if(!container && (health < HEALTH_THRESHOLD_DEAD && check_death_method() || ((world.time - timeofhostdeath) > config.revival_brain_life)))
if(!container && (world.time - timeofhostdeath) > config.revival_brain_life)
death()
return 0
/mob/living/carbon/brain/breathe()
return
+18 -9
View File
@@ -2,6 +2,10 @@
var/canEnterVentWith = "/obj/item/implant=0&/obj/item/clothing/mask/facehugger=0&/obj/item/radio/borg=0&/obj/machinery/camera=0"
var/datum/middleClickOverride/middleClickOverride = null
/mob/living/carbon/Initialize(mapload)
. = ..()
GLOB.carbon_list += src
/mob/living/carbon/Destroy()
// This clause is here due to items falling off from limb deletion
for(var/obj/item in get_all_slots())
@@ -14,6 +18,7 @@
if(B)
B.leave_host()
qdel(B)
GLOB.carbon_list -= src
return ..()
/mob/living/carbon/handle_atom_del(atom/A)
@@ -486,7 +491,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
/mob/living/proc/add_ventcrawl(obj/machinery/atmospherics/starting_machine)
if(!istype(starting_machine) || !starting_machine.returnPipenet())
if(!istype(starting_machine) || !starting_machine.returnPipenet() || !starting_machine.can_see_pipes())
return
var/datum/pipeline/pipeline = starting_machine.returnPipenet()
var/list/totalMembers = list()
@@ -870,7 +875,6 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
unEquip(I)
I.dropped()
return
return 1
else
to_chat(src, "<span class='warning'>You fail to remove [I]!</span>")
@@ -977,25 +981,30 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
/mob/living/carbon/proc/slip(description, stun, weaken, tilesSlipped, walkSafely, slipAny, slipVerb = "slip")
if(flying || buckled || (walkSafely && m_intent == MOVE_INTENT_WALK))
return 0
return FALSE
if((lying) && (!(tilesSlipped)))
return 0
return FALSE
if(!(slipAny))
if(istype(src, /mob/living/carbon/human))
var/mob/living/carbon/human/H = src
if(isobj(H.shoes) && H.shoes.flags & NOSLIP)
return 0
return FALSE
if(tilesSlipped)
for(var/t = 0, t<=tilesSlipped, t++)
spawn (t) step(src, src.dir)
for(var/i in 1 to tilesSlipped)
spawn(i)
step(src, dir)
stop_pulling()
to_chat(src, "<span class='notice'>You [slipVerb]ped on [description]!</span>")
playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
playsound(loc, 'sound/misc/slip.ogg', 50, 1, -3)
// Something something don't run with scissors
moving_diagonally = 0 //If this was part of diagonal move slipping will stop it.
Stun(stun)
Weaken(weaken)
return 1
return TRUE
/mob/living/carbon/proc/can_eat(flags = 255)
return 1
@@ -12,7 +12,7 @@
visible_message("<span class='warning'>[src] catches [AM]!</span>")
throw_mode_off()
return TRUE
..()
return ..()
/mob/living/carbon/water_act(volume, temperature, source, method = REAGENT_TOUCH)
. = ..()
@@ -131,7 +131,7 @@
m_styles["head"] = "None"
update_markings()
update_body(1, 1) //Update the body and force limb icon regeneration to update the head with the new icon.
update_body(TRUE) //Update the body and force limb icon regeneration to update the head with the new icon.
if(wear_mask)
update_inv_wear_mask()
return 1
@@ -469,7 +469,7 @@
scramble(1, src, 100)
real_name = random_name(gender, dna.species.name) //Give them a name that makes sense for their species.
sync_organ_dna(assimilate = 1)
update_body(0)
update_body()
reset_hair() //No more winding up with hairstyles you're not supposed to have, and blowing your cover.
reset_markings() //...Or markings.
dna.ResetUIFrom(src)
@@ -65,15 +65,6 @@ GLOBAL_LIST_INIT(body_accessory_by_species, list("None" = null))
/datum/body_accessory/body
blend_mode = ICON_MULTIPLY
/datum/body_accessory/body/snake
name = "Snake"
icon = 'icons/mob/body_accessory_64.dmi'
icon_state = "snake"
pixel_x_offset = -16
//Tails
/datum/body_accessory/tail
icon = 'icons/mob/body_accessory.dmi'
+11 -12
View File
@@ -103,7 +103,6 @@
set_heartattack(FALSE)
SSmobs.cubemonkeys -= src
if(dna.species)
dna.species.handle_hud_icons(src)
//Handle species-specific deaths.
dna.species.handle_death(gibbed, src)
@@ -124,10 +123,10 @@
if(. && healthdoll)
// We're alive again, so re-build the entire healthdoll
healthdoll.cached_healthdoll_overlays.Cut()
update_health_hud()
// Update healthdoll
if(dna.species)
dna.species.update_sight(src)
dna.species.handle_hud_icons(src)
/mob/living/carbon/human/proc/makeSkeleton()
var/obj/item/organ/external/head/H = get_organ("head")
@@ -146,14 +145,14 @@
H.alt_head = initial(H.alt_head)
H.handle_alt_icon()
m_styles = DEFAULT_MARKING_STYLES
update_fhair(0)
update_hair(0)
update_head_accessory(0)
update_markings(0)
update_fhair()
update_hair()
update_head_accessory()
update_markings()
mutations.Add(SKELETON)
mutations.Add(NOCLONE)
update_body(0)
update_body()
update_mutantrace()
return
@@ -172,11 +171,11 @@
H.f_style = "Shaved" //we only change the icon_state of the hair datum, so it doesn't mess up their UI/UE
if(H.h_style)
H.h_style = "Bald"
update_fhair(0)
update_hair(0)
update_fhair()
update_hair()
mutations.Add(HUSK)
update_body(0)
update_body()
update_mutantrace()
return
@@ -190,6 +189,6 @@
var/obj/item/organ/external/head/H = bodyparts_by_name["head"]
if(istype(H))
H.disfigured = FALSE
update_body(0)
update_mutantrace(0)
update_body()
update_mutantrace()
UpdateAppearance() // reset hair from DNA
+15 -7
View File
@@ -139,10 +139,18 @@
//WHO THE FUCK THOUGHT THAT WAS A GOOD FUCKING IDEA!?!?
if("howl", "howls")
var/M = handle_emote_param(param) //Check to see if the param is valid (mob with the param name is in view).
message = "<B>[src]</B> howls[M ? " at [M]" : ""]!"
playsound(loc, 'sound/goonstation/voice/howl.ogg', 100, 1, 10, frequency = get_age_pitch())
m_type = 2
var/M = handle_emote_param(param)
if(miming)
message = "<B>[src]</B> acts out a howl[M ? " at [M]" : ""]!"
m_type = 1
else
if(!muzzled)
message = "<B>[src]</B> howls[M ? " at [M]" : ""]!"
playsound(loc, 'sound/goonstation/voice/howl.ogg', 100, 1, 10, frequency = get_age_pitch())
m_type = 2
else
message = "<B>[src]</B> makes a very loud noise[M ? " at [M]" : ""]."
m_type = 2
if("growl", "growls")
var/M = handle_emote_param(param)
@@ -256,12 +264,12 @@
if(body_accessory)
if(body_accessory.try_restrictions(src))
message = "<B>[src]</B> starts wagging [p_their()] tail."
start_tail_wagging(1)
start_tail_wagging()
else if(dna.species.bodyflags & TAIL_WAGGING)
if(!wear_suit || !(wear_suit.flags_inv & HIDETAIL))
message = "<B>[src]</B> starts wagging [p_their()] tail."
start_tail_wagging(1)
start_tail_wagging()
else
return
else
@@ -271,7 +279,7 @@
if("swag", "swags")
if(dna.species.bodyflags & TAIL_WAGGING || body_accessory)
message = "<B>[src]</B> stops wagging [p_their()] tail."
stop_tail_wagging(1)
stop_tail_wagging()
else
return
m_type = 1
+11 -6
View File
@@ -18,10 +18,10 @@
dna = new /datum/dna(null)
// Species name is handled by set_species()
set_species(new_species, 1, delay_icon_update = 1, skip_same_check = TRUE)
..()
set_species(new_species, 1, delay_icon_update = 1, skip_same_check = TRUE)
if(dna.species)
real_name = dna.species.get_random_name(gender)
name = real_name
@@ -41,6 +41,7 @@
sync_organ_dna(1)
UpdateAppearance()
GLOB.human_list += src
/mob/living/carbon/human/OpenCraftingMenu()
handcrafting.ui_interact(src)
@@ -60,6 +61,7 @@
SSmobs.cubemonkeys -= src
QDEL_LIST(bodyparts)
splinted_limbs.Cut()
GLOB.human_list -= src
/mob/living/carbon/human/dummy
real_name = "Test Dummy"
@@ -658,7 +660,7 @@
else
if(place_item)
usr.unEquip(place_item)
equip_to_slot_if_possible(place_item, pocket_id, 0, 1)
equip_to_slot_if_possible(place_item, pocket_id, FALSE, TRUE)
add_attack_logs(usr, src, "Equipped with [place_item]", isLivingSSD(src) ? null : ATKLOG_ALL)
// Update strip window
@@ -1169,7 +1171,7 @@
qdel(feet_blood_DNA)
bloody_feet = list(BLOOD_STATE_HUMAN = 0, BLOOD_STATE_XENO = 0, BLOOD_STATE_NOT_BLOODY = 0)
blood_state = BLOOD_STATE_NOT_BLOODY
update_inv_shoes(1)
update_inv_shoes()
return 1
/mob/living/carbon/human/cuff_resist(obj/item/I)
@@ -1349,7 +1351,7 @@
dna.species.create_organs(src)
for(var/obj/item/thing in kept_items)
equip_to_slot_if_possible(thing, kept_items[thing], redraw_mob = 0)
equip_to_slot_if_possible(thing, kept_items[thing])
thing.flags = item_flags[thing] // Reset the flags to the origional ones
//Handle default hair/head accessories for created mobs.
@@ -1399,7 +1401,7 @@
UpdateAppearance()
overlays.Cut()
update_mutantrace(1)
update_mutantrace()
regenerate_icons()
if(dna.species)
@@ -1962,3 +1964,6 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
if(O && O.glowing)
O.toggle_biolum(TRUE)
visible_message("<span class='danger'>[src] is engulfed in shadows and fades into the darkness.</span>", "<span class='danger'>A sense of dread washes over you as you suddenly dim dark.</span>")
/mob/living/carbon/human/proc/get_perceived_trauma()
return min(health, maxHealth - getStaminaLoss())
@@ -19,8 +19,6 @@
ChangeToHusk()
update_stat("updatehealth([reason])")
med_hud_set_health()
med_hud_set_status()
handle_hud_icons_health()
/mob/living/carbon/human/adjustBrainLoss(amount, updating = TRUE, use_brain_mod = TRUE)
if(status_flags & GODMODE)
@@ -32,7 +30,7 @@
if(dna.species && amount > 0)
if(use_brain_mod)
amount = amount * dna.species.brain_mod
sponge.damage = Clamp(sponge.damage + amount, 0, 120)
sponge.damage = clamp(sponge.damage + amount, 0, 120)
if(sponge.damage >= 120)
visible_message("<span class='alert'><B>[src]</B> goes limp, [p_their()] facial expression utterly blank.</span>")
death()
@@ -50,7 +48,7 @@
if(dna.species && amount > 0)
if(use_brain_mod)
amount = amount * dna.species.brain_mod
sponge.damage = Clamp(amount, 0, 120)
sponge.damage = clamp(amount, 0, 120)
if(sponge.damage >= 120)
visible_message("<span class='alert'><B>[src]</B> goes limp, [p_their()] facial expression utterly blank.</span>")
death()
@@ -134,7 +134,7 @@ emp_act
if(bp && istype(bp ,/obj/item/clothing))
var/obj/item/clothing/C = bp
if(C.body_parts_covered & def_zone.body_part)
protection += C.armor[type]
protection += C.armor.getRating(type)
return protection
@@ -185,19 +185,19 @@ emp_act
var/block_chance_modifier = round(damage / -3)
if(l_hand && !istype(l_hand, /obj/item/clothing))
var/final_block_chance = l_hand.block_chance - (Clamp((armour_penetration-l_hand.armour_penetration)/2,0,100)) + block_chance_modifier //So armour piercing blades can still be parried by other blades, for example
var/final_block_chance = l_hand.block_chance - (clamp((armour_penetration-l_hand.armour_penetration)/2,0,100)) + block_chance_modifier //So armour piercing blades can still be parried by other blades, for example
if(l_hand.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type))
return 1
if(r_hand && !istype(r_hand, /obj/item/clothing))
var/final_block_chance = r_hand.block_chance - (Clamp((armour_penetration-r_hand.armour_penetration)/2,0,100)) + block_chance_modifier //Need to reset the var so it doesn't carry over modifications between attempts
var/final_block_chance = r_hand.block_chance - (clamp((armour_penetration-r_hand.armour_penetration)/2,0,100)) + block_chance_modifier //Need to reset the var so it doesn't carry over modifications between attempts
if(r_hand.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type))
return 1
if(wear_suit)
var/final_block_chance = wear_suit.block_chance - (Clamp((armour_penetration-wear_suit.armour_penetration)/2,0,100)) + block_chance_modifier
var/final_block_chance = wear_suit.block_chance - (clamp((armour_penetration-wear_suit.armour_penetration)/2,0,100)) + block_chance_modifier
if(wear_suit.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type))
return 1
if(w_uniform)
var/final_block_chance = w_uniform.block_chance - (Clamp((armour_penetration-w_uniform.armour_penetration)/2,0,100)) + block_chance_modifier
var/final_block_chance = w_uniform.block_chance - (clamp((armour_penetration-w_uniform.armour_penetration)/2,0,100)) + block_chance_modifier
if(w_uniform.hit_reaction(src, AM, attack_text, final_block_chance, damage, attack_type))
return 1
return 0
@@ -457,13 +457,13 @@ emp_act
if(bloody)//Apply blood
if(wear_mask)
wear_mask.add_mob_blood(src)
update_inv_wear_mask(0)
update_inv_wear_mask()
if(head)
head.add_mob_blood(src)
update_inv_head(0,0)
update_inv_head()
if(glasses && prob(33))
glasses.add_mob_blood(src)
update_inv_glasses(0)
update_inv_glasses()
if("chest")//Easier to score a stun but lasts less time
@@ -475,10 +475,10 @@ emp_act
if(bloody)
if(wear_suit)
wear_suit.add_mob_blood(src)
update_inv_wear_suit(1)
update_inv_wear_suit()
if(w_uniform)
w_uniform.add_mob_blood(src)
update_inv_w_uniform(1)
update_inv_w_uniform()
@@ -525,16 +525,16 @@ emp_act
else
add_mob_blood(source)
bloody_hands = amount
update_inv_gloves(1) //updates on-mob overlays for bloody hands and/or bloody gloves
update_inv_gloves() //updates on-mob overlays for bloody hands and/or bloody gloves
/mob/living/carbon/human/proc/bloody_body(var/mob/living/source)
if(wear_suit)
wear_suit.add_mob_blood(source)
update_inv_wear_suit(0)
update_inv_wear_suit()
return
if(w_uniform)
w_uniform.add_mob_blood(source)
update_inv_w_uniform(1)
update_inv_w_uniform()
/mob/living/carbon/human/proc/handle_suit_punctures(var/damtype, var/damage)
@@ -81,7 +81,7 @@
/mob/living/carbon/human/handle_footstep(turf/T)
if(..())
if(T.footstep_sounds["human"])
if(T.footstep_sounds && T.footstep_sounds["human"])
var/S = pick(T.footstep_sounds["human"])
if(S)
if(m_intent == MOVE_INTENT_RUN)
@@ -8,12 +8,15 @@
/mob/living/carbon/human/var/list/bodyparts_by_name = list() // map organ names to organs
// Takes care of organ related updates, such as broken and missing limbs
/mob/living/carbon/human/proc/handle_organs()
/mob/living/carbon/human/handle_organs()
..()
//processing internal organs is pretty cheap, do that first.
for(var/obj/item/organ/internal/I in internal_organs)
for(var/X in internal_organs)
var/obj/item/organ/internal/I = X
I.process()
for(var/obj/item/organ/external/E in bodyparts)
for(var/Y in bodyparts)
var/obj/item/organ/external/E = Y
E.process()
if(!lying && world.time - l_move_time < 15)
@@ -109,6 +112,11 @@
do_sparks(5, 0, src)
/mob/living/carbon/human/handle_germs()
..()
if(gloves && germ_level > gloves.germ_level && prob(10))
gloves.germ_level += 1
/mob/living/carbon/human/proc/becomeSlim()
to_chat(src, "<span class='notice'>You feel fit again!</span>")
mutations.Remove(FAT)
@@ -178,8 +178,7 @@
//This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible()
//set redraw_mob to 0 if you don't wish the hud to be updated - if you're doing it manually in your own proc.
/mob/living/carbon/human/equip_to_slot(obj/item/I, slot, redraw_mob = 1)
/mob/living/carbon/human/equip_to_slot(obj/item/I, slot)
if(!slot)
return
if(!istype(I))
@@ -203,40 +202,40 @@
switch(slot)
if(slot_back)
back = I
update_inv_back(redraw_mob)
update_inv_back()
if(slot_wear_mask)
wear_mask = I
if((wear_mask.flags & BLOCKHAIR) || (wear_mask.flags & BLOCKHEADHAIR))
update_hair(redraw_mob) //rebuild hair
update_fhair(redraw_mob)
update_head_accessory(redraw_mob)
update_hair() //rebuild hair
update_fhair()
update_head_accessory()
if(hud_list.len)
sec_hud_set_ID()
wear_mask_update(I, toggle_off = TRUE)
update_inv_wear_mask(redraw_mob)
update_inv_wear_mask()
if(slot_handcuffed)
handcuffed = I
update_inv_handcuffed(redraw_mob)
update_inv_handcuffed()
if(slot_legcuffed)
legcuffed = I
update_inv_legcuffed(redraw_mob)
update_inv_legcuffed()
if(slot_l_hand)
l_hand = I
update_inv_l_hand(redraw_mob)
update_inv_l_hand()
if(slot_r_hand)
r_hand = I
update_inv_r_hand(redraw_mob)
update_inv_r_hand()
if(slot_belt)
belt = I
update_inv_belt(redraw_mob)
update_inv_belt()
if(slot_wear_id)
wear_id = I
if(hud_list.len)
sec_hud_set_ID()
update_inv_wear_id(redraw_mob)
update_inv_wear_id()
if(slot_wear_pda)
wear_pda = I
update_inv_wear_pda(redraw_mob)
update_inv_wear_pda()
if(slot_l_ear)
l_ear = I
if(l_ear.slot_flags & SLOT_TWOEARS)
@@ -245,7 +244,7 @@
r_ear = O
O.layer = ABOVE_HUD_LAYER
O.plane = ABOVE_HUD_PLANE
update_inv_ears(redraw_mob)
update_inv_ears()
if(slot_r_ear)
r_ear = I
if(r_ear.slot_flags & SLOT_TWOEARS)
@@ -254,7 +253,7 @@
l_ear = O
O.layer = ABOVE_HUD_LAYER
O.plane = ABOVE_HUD_PLANE
update_inv_ears(redraw_mob)
update_inv_ears()
if(slot_glasses)
glasses = I
var/obj/item/clothing/glasses/G = I
@@ -264,42 +263,42 @@
update_nearsighted_effects()
if(G.vision_flags || G.see_in_dark || G.invis_override || G.invis_view || !isnull(G.lighting_alpha))
update_sight()
update_inv_glasses(redraw_mob)
update_inv_glasses()
update_client_colour()
if(slot_gloves)
gloves = I
update_inv_gloves(redraw_mob)
update_inv_gloves()
if(slot_head)
head = I
if((head.flags & BLOCKHAIR) || (head.flags & BLOCKHEADHAIR))
update_hair(redraw_mob) //rebuild hair
update_fhair(redraw_mob)
update_head_accessory(redraw_mob)
update_hair() //rebuild hair
update_fhair()
update_head_accessory()
// paper + bandanas
if(istype(I, /obj/item/clothing/head))
var/obj/item/clothing/head/hat = I
if(hat.vision_flags || hat.see_in_dark || !isnull(hat.lighting_alpha))
update_sight()
head_update(I)
update_inv_head(redraw_mob)
update_inv_head()
if(slot_shoes)
shoes = I
update_inv_shoes(redraw_mob)
update_inv_shoes()
if(slot_wear_suit)
wear_suit = I
update_inv_wear_suit(redraw_mob)
update_inv_wear_suit()
if(slot_w_uniform)
w_uniform = I
update_inv_w_uniform(redraw_mob)
update_inv_w_uniform()
if(slot_l_store)
l_store = I
update_inv_pockets(redraw_mob)
update_inv_pockets()
if(slot_r_store)
r_store = I
update_inv_pockets(redraw_mob)
update_inv_pockets()
if(slot_s_store)
s_store = I
update_inv_s_store(redraw_mob)
update_inv_s_store()
if(slot_in_backpack)
if(get_active_hand() == I)
unEquip(I)
+261 -280
View File
@@ -1,18 +1,26 @@
/mob/living/carbon/human/Life(seconds, times_fired)
set invisibility = 0
if(notransform)
return
. = ..()
if(QDELETED(src))
return FALSE
life_tick++
voice = GetVoice()
if(..())
if(.) //not dead
if(check_mutations)
domutcheck(src,null)
update_mutations()
check_mutations=0
check_mutations = FALSE
handle_pain()
handle_heartbeat()
handle_drunk()
dna.species.handle_life(src)
if(!client)
dna.species.handle_npc(src)
@@ -24,45 +32,45 @@
if(stat == DEAD)
handle_decay()
if(life_tick > 5 && timeofdeath && (timeofdeath < 5 || world.time - timeofdeath > 6000)) //We are long dead, or we're junk mobs spawned like the clowns on the clown shuttle
return //We go ahead and process them 5 times for HUD images and other stuff though.
//Update our name based on whether our face is obscured/disfigured
name = get_visible_name()
pulse = handle_pulse(times_fired)
if(mind && mind.vampire)
if(mind?.vampire)
mind.vampire.handle_vampire()
if(life_tick == 1)
regenerate_icons() // Make sure the inventory updates
handle_ghosted()
handle_ssd()
if(player_ghosted > 0 && stat == CONSCIOUS && job && !restrained())
handle_ghosted()
if(player_logged > 0 && stat != DEAD && job)
handle_ssd()
if(stat != DEAD)
return TRUE
/mob/living/carbon/human/proc/handle_ghosted()
if(player_ghosted > 0 && stat == CONSCIOUS && job && !restrained())
if(key)
player_ghosted = 0
else
player_ghosted++
if(player_ghosted % 150 == 0)
force_cryo_human(src)
if(key)
player_ghosted = 0
else
player_ghosted++
if(player_ghosted % 150 == 0)
force_cryo_human(src)
/mob/living/carbon/human/proc/handle_ssd()
if(player_logged > 0 && stat != DEAD && job)
player_logged++
if(istype(loc, /obj/machinery/cryopod))
player_logged++
if(istype(loc, /obj/machinery/cryopod))
return
if(config.auto_cryo_ssd_mins && (player_logged >= (config.auto_cryo_ssd_mins * 30)) && player_logged % 30 == 0)
var/turf/T = get_turf(src)
if(!is_station_level(T.z))
return
if(config.auto_cryo_ssd_mins && (player_logged >= (config.auto_cryo_ssd_mins * 30)) && player_logged % 30 == 0)
var/turf/T = get_turf(src)
if(!is_station_level(T.z))
return
var/area/A = get_area(src)
if(cryo_ssd(src))
var/obj/effect/portal/P = new /obj/effect/portal(T, null, null, 40)
P.name = "NT SSD Teleportation Portal"
if(A.fast_despawn)
force_cryo_human(src)
var/area/A = get_area(src)
if(cryo_ssd(src))
var/obj/effect/portal/P = new /obj/effect/portal(T, null, null, 40)
P.name = "NT SSD Teleportation Portal"
if(A.fast_despawn)
force_cryo_human(src)
/mob/living/carbon/human/calculate_affecting_pressure(var/pressure)
..()
@@ -80,38 +88,35 @@
/mob/living/carbon/human/handle_disabilities()
if(disabilities & EPILEPSY)
if((prob(1) && paralysis < 1))
visible_message("<span class='danger'>[src] starts having a seizure!</span>","<span class='alert'>You have a seizure!</span>")
Paralyse(10)
Jitter(1000)
//Vision //god knows why this is here
var/obj/item/organ/vision
if(dna.species.vision_organ)
vision = get_int_organ(dna.species.vision_organ)
// If we have the gene for being crazy, have random events.
if(dna.GetSEState(GLOB.hallucinationblock))
if(prob(1))
Hallucinate(20)
if(!dna.species.vision_organ) // Presumably if a species has no vision organs, they see via some other means.
SetEyeBlind(0)
SetEyeBlurry(0)
if(disabilities & COUGHING)
if((prob(5) && paralysis <= 1))
drop_item()
emote("cough")
if(disabilities & TOURETTES)
if((prob(10) && paralysis <= 1))
Stun(10)
switch(rand(1, 3))
if(1)
emote("twitch")
if(2 to 3)
var/tourettes = pick("SHIT", "PISS", "FUCK", "CUNT", "COCKSUCKER", "MOTHERFUCKER", "TITS")
say("[prob(50) ? ";" : ""][tourettes]")
var/x_offset = pixel_x + rand(-2,2) //Should probably be moved into the twitch emote at some point.
var/y_offset = pixel_y + rand(-1,1)
animate(src, pixel_x = pixel_x + x_offset, pixel_y = pixel_y + y_offset, time = 1)
animate(pixel_x = initial(pixel_x) , pixel_y = initial(pixel_y), time = 1)
else if(!vision || vision.is_broken()) // Vision organs cut out or broken? Permablind.
EyeBlind(2)
EyeBlurry(2)
if(disabilities & NERVOUS)
if(prob(10))
Stuttering(10)
else
//blindness
if(BLINDNESS in mutations) // Disabled-blind, doesn't get better on its own
else if(eye_blind) // Blindness, heals slowly over time
AdjustEyeBlind(-1)
else if(istype(glasses, /obj/item/clothing/glasses/sunglasses/blindfold) && eye_blurry) //resting your eyes with a blindfold heals blurry eyes faster
AdjustEyeBlurry(-3)
//blurry sight
if(vision.is_bruised()) // Vision organs impaired? Permablurry.
EyeBlurry(2)
if(eye_blurry) // Blurry eyes heal slowly
AdjustEyeBlurry(-1)
if(getBrainLoss() >= 60 && stat != DEAD)
if(prob(3))
@@ -192,7 +197,7 @@
if(!(RADIMMUNE in dna.species.species_traits))
if(radiation)
radiation = Clamp(radiation, 0, 200)
radiation = clamp(radiation, 0, 200)
var/autopsy_damage = 0
switch(radiation)
@@ -607,6 +612,7 @@
// nutrition decrease
if(nutrition > 0 && stat != DEAD)
handle_nutrition_alerts()
// THEY HUNGER
var/hunger_rate = hunger_drain
if(satiety > 0)
@@ -656,22 +662,25 @@
AdjustSleeping(1)
Paralyse(5)
AdjustConfused(-1)
if(confused)
AdjustConfused(-1)
// decrement dizziness counter, clamped to 0
if(resting)
AdjustDizzy(-15)
AdjustJitter(-15)
if(dizziness)
AdjustDizzy(-15)
if(jitteriness)
AdjustJitter(-15)
else
AdjustDizzy(-3)
AdjustJitter(-3)
if(dizziness)
AdjustDizzy(-3)
if(jitteriness)
AdjustJitter(-3)
if(NO_INTORGANS in dna.species.species_traits)
return
handle_trace_chems()
return //TODO: DEFERRED
/mob/living/carbon/human/handle_drunk()
var/slur_start = 30 //12u ethanol, 30u whiskey FOR HUMANS
var/confused_start = 40
@@ -683,55 +692,54 @@
var/collapse_start = 75
var/braindamage_start = 120
var/alcohol_strength = drunk
var/sober_str=!(SOBER in mutations)?1:2
var/sober_str =! (SOBER in mutations) ? 1 : 2
if(drunk)
alcohol_strength/=sober_str
alcohol_strength /= sober_str
var/obj/item/organ/internal/liver/L
if(!isSynthetic())
L = get_int_organ(/obj/item/organ/internal/liver)
var/obj/item/organ/internal/liver/L
if(!isSynthetic())
L = get_int_organ(/obj/item/organ/internal/liver)
if(L)
alcohol_strength *= L.alcohol_intensity
else
alcohol_strength *= 5
if(alcohol_strength >= slur_start) //slurring
Slur(drunk)
if(alcohol_strength >= brawl_start) //the drunken martial art
if(!istype(martial_art, /datum/martial_art/drunk_brawling))
var/datum/martial_art/drunk_brawling/F = new
F.teach(src, 1)
if(alcohol_strength < brawl_start) //removing the art
if(istype(martial_art, /datum/martial_art/drunk_brawling))
martial_art.remove(src)
if(alcohol_strength >= confused_start && prob(33)) //confused walking
if(!confused)
Confused(1)
AdjustConfused(3 / sober_str)
if(alcohol_strength >= blur_start) //blurry eyes
EyeBlurry(10 / sober_str)
if(!isSynthetic()) //stuff only for non-synthetics
if(alcohol_strength >= vomit_start) //vomiting
if(prob(8))
fakevomit()
if(alcohol_strength >= pass_out)
Paralyse(5 / sober_str)
Drowsy(30 / sober_str)
if(L)
alcohol_strength *= L.alcohol_intensity
else
alcohol_strength *= 5
if(alcohol_strength >= slur_start) //slurring
Slur(drunk)
if(alcohol_strength >= brawl_start) //the drunken martial art
if(!istype(martial_art, /datum/martial_art/drunk_brawling))
var/datum/martial_art/drunk_brawling/F = new
F.teach(src,1)
if(alcohol_strength < brawl_start) //removing the art
if(istype(martial_art, /datum/martial_art/drunk_brawling))
martial_art.remove(src)
if(alcohol_strength >= confused_start && prob(33)) //confused walking
if(!confused) Confused(1)
AdjustConfused(3/sober_str)
if(alcohol_strength >= blur_start) //blurry eyes
EyeBlurry(10/sober_str)
if(!isSynthetic()) //stuff only for non-synthetics
if(alcohol_strength >= vomit_start) //vomiting
if(prob(8))
fakevomit()
if(alcohol_strength >= pass_out)
Paralyse(5/sober_str)
Drowsy(30/sober_str)
if(L)
L.receive_damage(0.1, 1)
adjustToxLoss(0.1)
else //stuff only for synthetics
if(alcohol_strength >= spark_start && prob(25))
do_sparks(3, 1, src)
if(alcohol_strength >= collapse_start && prob(10))
emote("collapse")
do_sparks(3, 1, src)
if(alcohol_strength >= braindamage_start && prob(10))
adjustBrainLoss(1)
L.receive_damage(0.1, 1)
adjustToxLoss(0.1)
else //stuff only for synthetics
if(alcohol_strength >= spark_start && prob(25))
do_sparks(3, 1, src)
if(alcohol_strength >= collapse_start && prob(10))
emote("collapse")
do_sparks(3, 1, src)
if(alcohol_strength >= braindamage_start && prob(10))
adjustBrainLoss(1)
if(!has_booze())
AdjustDrunk(-0.5)
return
/mob/living/carbon/human/proc/has_booze() //checks if the human has ethanol or its subtypes inside
for(var/A in reagents.reagent_list)
@@ -740,180 +748,154 @@
return 1
return 0
/mob/living/carbon/human/handle_regular_status_updates()
/mob/living/carbon/human/handle_critical_condition()
if(status_flags & GODMODE)
return 0
. = ..()
var/guaranteed_death_threshold = health + (getOxyLoss() * 0.5) - (getFireLoss() * 0.67) - (getBruteLoss() * 0.67)
if(.) //alive
if(REGEN in mutations)
heal_overall_damage(0.1, 0.1)
if(getBrainLoss() >= 120 || (guaranteed_death_threshold) <= -500)
death()
return
if(paralysis)
stat = UNCONSCIOUS
if(getBrainLoss() >= 100) // braindeath
AdjustLoseBreath(10, bound_lower = 0, bound_upper = 25)
Weaken(30)
else if(sleeping)
if(!check_death_method())
if(health <= HEALTH_THRESHOLD_DEAD)
var/deathchance = min(99, ((getBrainLoss() * -5) + (health + (getOxyLoss() / 2))) * -0.01)
if(prob(deathchance))
death()
return
stat = UNCONSCIOUS
if(health <= HEALTH_THRESHOLD_CRIT)
if(prob(5))
emote(pick("faint", "collapse", "cry", "moan", "gasp", "shudder", "shiver"))
AdjustStuttering(5, bound_lower = 0, bound_upper = 5)
EyeBlurry(5)
if(prob(7))
AdjustConfused(2)
if(prob(5))
Paralyse(2)
switch(health)
if(-INFINITY to -100)
adjustOxyLoss(1)
if(prob(health * -0.1))
if(ishuman(src))
var/mob/living/carbon/human/H = src
H.set_heartattack(TRUE)
if(prob(health * -0.2))
var/datum/disease/D = new /datum/disease/critical/heart_failure
ForceContractDisease(D)
Paralyse(5)
if(-99 to -80)
adjustOxyLoss(1)
if(prob(4))
to_chat(src, "<span class='userdanger'>Your chest hurts...</span>")
Paralyse(2)
var/datum/disease/D = new /datum/disease/critical/heart_failure
ForceContractDisease(D)
if(-79 to -50)
adjustOxyLoss(1)
if(prob(10))
var/datum/disease/D = new /datum/disease/critical/shock
ForceContractDisease(D)
if(prob(health * -0.08))
var/datum/disease/D = new /datum/disease/critical/heart_failure
ForceContractDisease(D)
if(prob(6))
to_chat(src, "<span class='userdanger'>You feel [pick("horrible pain", "awful", "like shit", "absolutely awful", "like death", "like you are dying", "nothing", "warm", "sweaty", "tingly", "really, really bad", "horrible")]!</span>")
Weaken(3)
if(prob(3))
Paralyse(2)
if(-49 to 0)
adjustOxyLoss(1)
if(prob(3))
var/datum/disease/D = new /datum/disease/critical/shock
ForceContractDisease(D)
if(prob(5))
to_chat(src, "<span class='userdanger'>You feel [pick("terrible", "awful", "like shit", "sick", "numb", "cold", "sweaty", "tingly", "horrible")]!</span>")
Weaken(3)
if(mind)
if(mind.vampire)
if(istype(loc, /obj/structure/closet/coffin))
adjustBruteLoss(-1)
adjustFireLoss(-1)
adjustToxLoss(-1)
else if(status_flags & FAKEDEATH)
stat = UNCONSCIOUS
//Vision //god knows why this is here
var/obj/item/organ/vision
if(dna.species.vision_organ)
vision = get_int_organ(dna.species.vision_organ)
if(!dna.species.vision_organ) // Presumably if a species has no vision organs, they see via some other means.
SetEyeBlind(0)
SetEyeBlurry(0)
else if(!vision || vision.is_broken()) // Vision organs cut out or broken? Permablind.
EyeBlind(2)
EyeBlurry(2)
else
//blindness
if(disabilities & BLIND) // Disabled-blind, doesn't get better on its own
else if(eye_blind) // Blindness, heals slowly over time
AdjustEyeBlind(-1)
else if(istype(glasses, /obj/item/clothing/glasses/sunglasses/blindfold)) //resting your eyes with a blindfold heals blurry eyes faster
AdjustEyeBlurry(-3)
//blurry sight
if(vision.is_bruised()) // Vision organs impaired? Permablurry.
EyeBlurry(2)
if(eye_blurry) // Blurry eyes heal slowly
AdjustEyeBlurry(-1)
if(flying)
animate(src, pixel_y = pixel_y + 5 , time = 10, loop = 1, easing = SINE_EASING)
animate(pixel_y = pixel_y - 5, time = 10, loop = 1, easing = SINE_EASING)
// If you're dirty, your gloves will become dirty, too.
if(gloves && germ_level > gloves.germ_level && prob(10))
gloves.germ_level += 1
handle_organs()
var/guaranteed_death_threshold = health + (getOxyLoss() * 0.5) - (getFireLoss() * 0.67) - (getBruteLoss() * 0.67)
if(getBrainLoss() >= 120 || (guaranteed_death_threshold) <= -500)
death()
return
if(getBrainLoss() >= 100) // braindeath
AdjustLoseBreath(10, bound_lower = 0, bound_upper = 25)
Weaken(30)
if(!check_death_method())
if(health <= HEALTH_THRESHOLD_DEAD)
var/deathchance = min(99, ((getBrainLoss() * -5) + (health + (getOxyLoss() / 2))) * -0.01)
if(prob(deathchance))
death()
return
if(health <= HEALTH_THRESHOLD_CRIT)
if(prob(5))
emote(pick("faint", "collapse", "cry", "moan", "gasp", "shudder", "shiver"))
AdjustStuttering(5, bound_lower = 0, bound_upper = 5)
EyeBlurry(5)
if(prob(7))
AdjustConfused(2)
if(prob(5))
Paralyse(2)
switch(health)
if(-INFINITY to -100)
adjustOxyLoss(1)
if(prob(health * -0.1))
if(ishuman(src))
var/mob/living/carbon/human/H = src
H.set_heartattack(TRUE)
if(prob(health * -0.2))
var/datum/disease/D = new /datum/disease/critical/heart_failure
ForceContractDisease(D)
Paralyse(5)
if(-99 to -80)
adjustOxyLoss(1)
if(prob(4))
to_chat(src, "<span class='userdanger'>Your chest hurts...</span>")
Paralyse(2)
var/datum/disease/D = new /datum/disease/critical/heart_failure
ForceContractDisease(D)
if(-79 to -50)
adjustOxyLoss(1)
if(prob(10))
var/datum/disease/D = new /datum/disease/critical/shock
ForceContractDisease(D)
if(prob(health * -0.08))
var/datum/disease/D = new /datum/disease/critical/heart_failure
ForceContractDisease(D)
if(prob(6))
to_chat(src, "<span class='userdanger'>You feel [pick("horrible pain", "awful", "like shit", "absolutely awful", "like death", "like you are dying", "nothing", "warm", "sweaty", "tingly", "really, really bad", "horrible")]!</span>")
Weaken(3)
if(prob(3))
Paralyse(2)
if(-49 to 0)
adjustOxyLoss(1)
if(prob(3))
var/datum/disease/D = new /datum/disease/critical/shock
ForceContractDisease(D)
if(prob(5))
to_chat(src, "<span class='userdanger'>You feel [pick("terrible", "awful", "like shit", "sick", "numb", "cold", "sweaty", "tingly", "horrible")]!</span>")
Weaken(3)
else //dead
SetSilence(0)
/mob/living/carbon/human/handle_vision()
if(machine)
if(!machine.check_eye(src))
reset_perspective(null)
/mob/living/carbon/human/update_health_hud()
if(!client)
return
if(dna.species.update_health_hud())
return
else
var/isRemoteObserve = 0
if((REMOTE_VIEW in mutations) && remoteview_target)
isRemoteObserve = 1
if(healths)
var/health_amount = get_perceived_trauma()
if(..(health_amount)) //not dead
switch(hal_screwyhud)
if(SCREWYHUD_CRIT)
healths.icon_state = "health6"
if(SCREWYHUD_DEAD)
healths.icon_state = "health7"
if(SCREWYHUD_HEALTHY)
healths.icon_state = "health0"
if(remoteview_target.stat != CONSCIOUS)
to_chat(src, "<span class='alert'>Your psy-connection grows too faint to maintain!</span>")
isRemoteObserve = 0
if(healthdoll)
if(stat == DEAD)
healthdoll.icon_state = "healthdoll_DEAD"
if(healthdoll.overlays.len)
healthdoll.overlays.Cut()
else
var/list/new_overlays = list()
var/list/cached_overlays = healthdoll.cached_healthdoll_overlays
// Use the dead health doll as the base, since we have proper "healthy" overlays now
healthdoll.icon_state = "healthdoll_DEAD"
for(var/obj/item/organ/external/O in bodyparts)
var/damage = O.burn_dam + O.brute_dam
var/comparison = (O.max_damage/5)
var/icon_num = 0
if(damage)
icon_num = 1
if(damage > (comparison))
icon_num = 2
if(damage > (comparison*2))
icon_num = 3
if(damage > (comparison*3))
icon_num = 4
if(damage > (comparison*4))
icon_num = 5
new_overlays += "[O.limb_name][icon_num]"
healthdoll.overlays += (new_overlays - cached_overlays)
healthdoll.overlays -= (cached_overlays - new_overlays)
healthdoll.cached_healthdoll_overlays = new_overlays
if(PSY_RESIST in remoteview_target.mutations)
to_chat(src, "<span class='alert'>Your mind is shut out!</span>")
isRemoteObserve = 0
/mob/living/carbon/human/proc/handle_nutrition_alerts() //This is a terrible abuse of the alert system; something like this should be a HUD element
if(NO_HUNGER in dna.species.species_traits)
return
if(mind?.vampire && (mind in SSticker.mode.vampires)) //Vampires
switch(nutrition)
if(NUTRITION_LEVEL_FULL to INFINITY)
throw_alert("nutrition", /obj/screen/alert/fat/vampire)
if(NUTRITION_LEVEL_WELL_FED to NUTRITION_LEVEL_FULL)
throw_alert("nutrition", /obj/screen/alert/full/vampire)
if(NUTRITION_LEVEL_FED to NUTRITION_LEVEL_WELL_FED)
throw_alert("nutrition", /obj/screen/alert/well_fed/vampire)
if(NUTRITION_LEVEL_HUNGRY to NUTRITION_LEVEL_FED)
throw_alert("nutrition", /obj/screen/alert/fed/vampire)
if(NUTRITION_LEVEL_STARVING to NUTRITION_LEVEL_HUNGRY)
throw_alert("nutrition", /obj/screen/alert/hungry/vampire)
else
throw_alert("nutrition", /obj/screen/alert/starving/vampire)
// Not on the station or mining?
var/turf/temp_turf = get_turf(remoteview_target)
if(!(temp_turf in config.contact_levels))
to_chat(src, "<span class='alert'>Your psy-connection grows too faint to maintain!</span>")
isRemoteObserve = 0
if(remote_view)
isRemoteObserve = 1
if(!isRemoteObserve && client && !client.adminobs)
remoteview_target = null
reset_perspective(null)
/mob/living/carbon/human/handle_hud_icons()
dna.species.handle_hud_icons(src)
/mob/living/carbon/human/handle_hud_icons_health()
dna.species.handle_hud_icons_health(src)
handle_hud_icons_health_overlay()
else //Any other non-vampires
switch(nutrition)
if(NUTRITION_LEVEL_FULL to INFINITY)
throw_alert("nutrition", /obj/screen/alert/fat)
if(NUTRITION_LEVEL_WELL_FED to NUTRITION_LEVEL_FULL)
throw_alert("nutrition", /obj/screen/alert/full)
if(NUTRITION_LEVEL_FED to NUTRITION_LEVEL_WELL_FED)
throw_alert("nutrition", /obj/screen/alert/well_fed)
if(NUTRITION_LEVEL_HUNGRY to NUTRITION_LEVEL_FED)
throw_alert("nutrition", /obj/screen/alert/fed)
if(NUTRITION_LEVEL_STARVING to NUTRITION_LEVEL_HUNGRY)
throw_alert("nutrition", /obj/screen/alert/hungry)
else
throw_alert("nutrition", /obj/screen/alert/starving)
/mob/living/carbon/human/handle_random_events()
// Puke if toxloss is too high
@@ -942,15 +924,14 @@
clear_alert("embeddedobject")
/mob/living/carbon/human/handle_changeling()
if(mind)
if(mind.changeling)
mind.changeling.regenerate(src)
if(hud_used)
hud_used.lingchemdisplay.invisibility = 0
hud_used.lingchemdisplay.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='#dd66dd'>[round(mind.changeling.chem_charges)]</font></div>"
else
if(hud_used)
hud_used.lingchemdisplay.invisibility = 101
if(mind.changeling)
mind.changeling.regenerate(src)
if(hud_used)
hud_used.lingchemdisplay.invisibility = 0
hud_used.lingchemdisplay.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='#dd66dd'>[round(mind.changeling.chem_charges)]</font></div>"
else
if(hud_used)
hud_used.lingchemdisplay.invisibility = 101
/mob/living/carbon/human/proc/handle_pulse(times_fired)
+2 -2
View File
@@ -138,7 +138,7 @@
span = mind.speech_span
if((COMIC in mutations) \
|| (locate(/obj/item/organ/internal/cyberimp/brain/clown_voice) in internal_organs) \
|| GetComponent(/datum/component/jestosterone))
|| HAS_TRAIT(src, TRAIT_JESTER))
span = "sans"
if(WINGDINGS in mutations)
@@ -151,7 +151,7 @@
if(S.speaking && S.speaking.flags & NO_STUTTER)
continue
if(silent || (disabilities & MUTE))
if(silent || (MUTE in mutations))
S.message = ""
if(istype(wear_mask, /obj/item/clothing/mask/horsehead))
@@ -754,105 +754,8 @@
return FALSE //Unsupported slot
/datum/species/proc/get_perceived_trauma(mob/living/carbon/human/H)
return min(H.health, H.maxHealth - H.getStaminaLoss())
/datum/species/proc/handle_hud_icons(mob/living/carbon/human/H)
if(!H.client)
return
handle_hud_icons_health(H)
H.handle_hud_icons_health_overlay()
handle_hud_icons_nutrition(H)
/datum/species/proc/handle_hud_icons_health(mob/living/carbon/H)
if(!H.client)
return
handle_hud_icons_health_side(H)
handle_hud_icons_health_doll(H)
/datum/species/proc/handle_hud_icons_health_side(mob/living/carbon/human/H)
if(H.healths)
if(H.stat == DEAD || (H.status_flags & FAKEDEATH))
H.healths.icon_state = "health7"
else
switch(H.hal_screwyhud)
if(SCREWYHUD_CRIT) H.healths.icon_state = "health6"
if(SCREWYHUD_DEAD) H.healths.icon_state = "health7"
if(SCREWYHUD_HEALTHY) H.healths.icon_state = "health0"
else
switch(get_perceived_trauma(H))
if(100 to INFINITY) H.healths.icon_state = "health0"
if(80 to 100) H.healths.icon_state = "health1"
if(60 to 80) H.healths.icon_state = "health2"
if(40 to 60) H.healths.icon_state = "health3"
if(20 to 40) H.healths.icon_state = "health4"
if(0 to 20) H.healths.icon_state = "health5"
else H.healths.icon_state = "health6"
/datum/species/proc/handle_hud_icons_health_doll(mob/living/carbon/human/H)
if(H.healthdoll)
if(H.stat == DEAD || (H.status_flags & FAKEDEATH))
H.healthdoll.icon_state = "healthdoll_DEAD"
if(H.healthdoll.overlays.len)
H.healthdoll.overlays.Cut()
else
var/list/new_overlays = list()
var/list/cached_overlays = H.healthdoll.cached_healthdoll_overlays
// Use the dead health doll as the base, since we have proper "healthy" overlays now
H.healthdoll.icon_state = "healthdoll_DEAD"
for(var/obj/item/organ/external/O in H.bodyparts)
var/damage = O.burn_dam + O.brute_dam
var/comparison = (O.max_damage/5)
var/icon_num = 0
if(damage)
icon_num = 1
if(damage > (comparison))
icon_num = 2
if(damage > (comparison*2))
icon_num = 3
if(damage > (comparison*3))
icon_num = 4
if(damage > (comparison*4))
icon_num = 5
new_overlays += "[O.limb_name][icon_num]"
H.healthdoll.overlays += (new_overlays - cached_overlays)
H.healthdoll.overlays -= (cached_overlays - new_overlays)
H.healthdoll.cached_healthdoll_overlays = new_overlays
/datum/species/proc/handle_hud_icons_nutrition(mob/living/carbon/human/H)
if(NO_HUNGER in species_traits)
return FALSE
if(H.mind && H.mind.vampire && (H.mind in SSticker.mode.vampires)) //Vampires
switch(H.nutrition)
if(NUTRITION_LEVEL_FULL to INFINITY)
H.throw_alert("nutrition", /obj/screen/alert/fat/vampire)
if(NUTRITION_LEVEL_WELL_FED to NUTRITION_LEVEL_FULL)
H.throw_alert("nutrition", /obj/screen/alert/full/vampire)
if(NUTRITION_LEVEL_FED to NUTRITION_LEVEL_WELL_FED)
H.throw_alert("nutrition", /obj/screen/alert/well_fed/vampire)
if(NUTRITION_LEVEL_HUNGRY to NUTRITION_LEVEL_FED)
H.throw_alert("nutrition", /obj/screen/alert/fed/vampire)
if(NUTRITION_LEVEL_STARVING to NUTRITION_LEVEL_HUNGRY)
H.throw_alert("nutrition", /obj/screen/alert/hungry/vampire)
else
H.throw_alert("nutrition", /obj/screen/alert/starving/vampire)
return 1
else ///Any other non-vampires
switch(H.nutrition)
if(NUTRITION_LEVEL_FULL to INFINITY)
H.throw_alert("nutrition", /obj/screen/alert/fat)
if(NUTRITION_LEVEL_WELL_FED to NUTRITION_LEVEL_FULL)
H.throw_alert("nutrition", /obj/screen/alert/full)
if(NUTRITION_LEVEL_FED to NUTRITION_LEVEL_WELL_FED)
H.throw_alert("nutrition", /obj/screen/alert/well_fed)
if(NUTRITION_LEVEL_HUNGRY to NUTRITION_LEVEL_FED)
H.throw_alert("nutrition", /obj/screen/alert/fed)
if(NUTRITION_LEVEL_STARVING to NUTRITION_LEVEL_HUNGRY)
H.throw_alert("nutrition", /obj/screen/alert/hungry)
else
H.throw_alert("nutrition", /obj/screen/alert/starving)
return 1
/datum/species/proc/update_health_hud(mob/living/carbon/human/H)
return FALSE
/*
Returns the path corresponding to the corresponding organ
@@ -636,12 +636,11 @@
H.mutations.Add(COMIC)
H.equip_to_slot_or_del(new /obj/item/reagent_containers/food/drinks/bottle/bottleofbanana(H), slot_r_store)
H.equip_to_slot_or_del(new /obj/item/bikehorn(H), slot_l_store)
H.AddComponent(/datum/component/waddling)
H.AddElement(/datum/element/waddling)
/datum/species/golem/bananium/on_species_loss(mob/living/carbon/C)
. = ..()
GET_COMPONENT_FROM(waddling, /datum/component/waddling, C)
waddling.Destroy()
C.RemoveElement(/datum/element/waddling)
/datum/species/golem/bananium/get_random_name()
var/clown_name = pick(GLOB.clown_names)
@@ -39,10 +39,10 @@
/datum/action/innate/shadow/darkvision/Activate()
var/mob/living/carbon/human/H = owner
if(!H.vision_type)
H.vision_type = new /datum/vision_override/nightvision
H.set_sight(/datum/vision_override/nightvision)
to_chat(H, "<span class='notice'>You adjust your vision to pierce the darkness.</span>")
else
H.vision_type = null
H.set_sight(null)
to_chat(H, "<span class='notice'>You adjust your vision to recognize the shadows.</span>")
/datum/species/shadow/on_species_gain(mob/living/carbon/human/H)
@@ -95,7 +95,7 @@
var/obj/item/organ/external/E = H.bodyparts_by_name[organname]
if(istype(E) && E.dna && istype(E.dna.species, /datum/species/slime))
E.sync_colour_to_human(H)
H.update_hair(0)
H.update_hair()
H.update_body()
..()
@@ -56,4 +56,4 @@
"is holding their breath!")
/datum/species/tajaran/handle_death(gibbed, mob/living/carbon/human/H)
H.stop_tail_wagging(1)
H.stop_tail_wagging()
@@ -104,7 +104,7 @@
return
/datum/species/unathi/handle_death(gibbed, mob/living/carbon/human/H)
H.stop_tail_wagging(1)
H.stop_tail_wagging()
/datum/species/unathi/ashwalker
name = "Ash Walker"
@@ -76,7 +76,7 @@
speciesbox = /obj/item/storage/box/survival_vox
/datum/species/vox/handle_death(gibbed, mob/living/carbon/human/H)
H.stop_tail_wagging(1)
H.stop_tail_wagging()
/datum/species/vox/after_equip_job(datum/job/J, mob/living/carbon/human/H)
if(!H.mind || !H.mind.assigned_role || H.mind.assigned_role != "Clown" && H.mind.assigned_role != "Mime")
@@ -50,4 +50,4 @@
"is holding their breath!")
/datum/species/vulpkanin/handle_death(gibbed, mob/living/carbon/human/H)
H.stop_tail_wagging(1)
H.stop_tail_wagging()
@@ -50,7 +50,7 @@
/datum/species/wryn/handle_death(gibbed, mob/living/carbon/human/H)
for(var/mob/living/carbon/C in GLOB.living_mob_list)
for(var/mob/living/carbon/C in GLOB.alive_mob_list)
if(C.get_int_organ(/obj/item/organ/internal/wryn/hivenode))
to_chat(C, "<span class='danger'><B>Your antennae tingle as you are overcome with pain...</B></span>")
to_chat(C, "<span class='danger'>It feels like part of you has died.</span>") // This is bullshit
@@ -77,14 +77,14 @@ There are several things that need to be remembered:
If you wish to update several overlays at once, you can set the argument to 0 to disable the update and call
it manually:
e.g.
update_inv_head(0)
update_inv_l_hand(0)
update_inv_head()
update_inv_l_hand()
update_inv_r_hand() //<---calls update_icons()
or equivillantly:
update_inv_head(0)
update_inv_l_hand(0)
update_inv_r_hand(0)
update_inv_head()
update_inv_l_hand()
update_inv_r_hand()
update_icons()
> If you need to update all overlays you can use regenerate_icons(). it works exactly like update_clothing used to.
@@ -124,7 +124,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
//DAMAGE OVERLAYS
//constructs damage icon for each organ from mask * damage field and saves it in our overlays_ lists
/mob/living/carbon/human/UpdateDamageIcon(var/update_icons=1)
/mob/living/carbon/human/UpdateDamageIcon()
// first check whether something actually changed about damage appearance
var/damage_appearance = ""
@@ -164,7 +164,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
//BASE MOB SPRITE
/mob/living/carbon/human/proc/update_body(var/update_icons=1, var/rebuild_base=0)
/mob/living/carbon/human/proc/update_body(rebuild_base = FALSE)
remove_overlay(BODY_LAYER)
remove_overlay(LIMBS_LAYER) // So we don't get the old species' sprite splatted on top of the new one's
remove_overlay(UNDERWEAR_LAYER)
@@ -281,19 +281,19 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
overlays_standing[BODY_LAYER] = standing
apply_overlay(BODY_LAYER)
//tail
update_tail_layer(0)
update_tail_layer()
update_int_organs()
//head accessory
update_head_accessory(0)
update_head_accessory()
//markings
update_markings(0)
update_markings()
//hair
update_hair(0)
update_fhair(0)
update_hair()
update_fhair()
//MARKINGS OVERLAY
/mob/living/carbon/human/proc/update_markings(var/update_icons=1)
/mob/living/carbon/human/proc/update_markings()
//Reset our markings.
remove_overlay(MARKINGS_LAYER)
@@ -325,7 +325,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
apply_overlay(MARKINGS_LAYER)
//HEAD ACCESSORY OVERLAY
/mob/living/carbon/human/proc/update_head_accessory(var/update_icons=1)
/mob/living/carbon/human/proc/update_head_accessory()
//Reset our head accessory
remove_overlay(HEAD_ACCESSORY_LAYER)
remove_overlay(HEAD_ACC_OVER_LAYER)
@@ -362,7 +362,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
//HAIR OVERLAY
/mob/living/carbon/human/proc/update_hair(var/update_icons=1)
/mob/living/carbon/human/proc/update_hair()
//Reset our hair
remove_overlay(HAIR_LAYER)
@@ -403,7 +403,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
//FACIAL HAIR OVERLAY
/mob/living/carbon/human/proc/update_fhair(var/update_icons=1)
/mob/living/carbon/human/proc/update_fhair()
//Reset our facial hair
remove_overlay(FHAIR_LAYER)
remove_overlay(FHAIR_OVER_LAYER)
@@ -447,7 +447,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
/mob/living/carbon/human/update_mutations(var/update_icons=1)
/mob/living/carbon/human/update_mutations()
remove_overlay(MUTATIONS_LAYER)
var/mutable_appearance/standing = mutable_appearance('icons/effects/genetics.dmi', layer = -MUTATIONS_LAYER)
var/add_image = 0
@@ -478,7 +478,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
apply_overlay(MUTATIONS_LAYER)
/mob/living/carbon/human/proc/update_mutantrace(var/update_icons=1)
/mob/living/carbon/human/proc/update_mutantrace()
//BS12 EDIT
var/skel = (SKELETON in mutations)
if(skel)
@@ -486,8 +486,8 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
else
skeleton = null
update_hair(0)
update_fhair(0)
update_hair()
update_fhair()
/mob/living/carbon/human/update_fire()
@@ -501,41 +501,42 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
//For legacy support.
/mob/living/carbon/human/regenerate_icons()
..()
if(notransform) return
update_mutations(0)
update_body(0, 1) //Update the body and force limb icon regeneration.
update_hair(0)
update_head_accessory(0)
update_fhair(0)
update_mutantrace(0)
update_inv_w_uniform(0,0)
update_inv_wear_id(0)
update_inv_gloves(0,0)
update_inv_glasses(0)
update_inv_ears(0)
update_inv_shoes(0,0)
update_inv_s_store(0)
update_inv_wear_mask(0)
update_inv_head(0,0)
update_inv_belt(0)
update_inv_back(0)
update_inv_wear_suit(0)
update_inv_r_hand(0)
update_inv_l_hand(0)
update_inv_handcuffed(0)
update_inv_legcuffed(0)
update_inv_pockets(0)
update_inv_wear_pda(0)
UpdateDamageIcon(0)
if(notransform)
return
update_mutations()
update_body(TRUE) //Update the body and force limb icon regeneration.
update_hair()
update_head_accessory()
update_fhair()
update_mutantrace()
update_inv_w_uniform()
update_inv_wear_id()
update_inv_gloves()
update_inv_glasses()
update_inv_ears()
update_inv_shoes()
update_inv_s_store()
update_inv_wear_mask()
update_inv_head()
update_inv_belt()
update_inv_back()
update_inv_wear_suit()
update_inv_r_hand()
update_inv_l_hand()
update_inv_handcuffed()
update_inv_legcuffed()
update_inv_pockets()
update_inv_wear_pda()
UpdateDamageIcon()
force_update_limbs()
update_tail_layer(0)
update_tail_layer()
overlays.Cut() // Force all overlays to regenerate
update_fire()
update_icons()
/* --------------------------------------- */
//vvvvvv UPDATE_INV PROCS vvvvvv
/mob/living/carbon/human/update_inv_w_uniform(var/update_icons=1)
/mob/living/carbon/human/update_inv_w_uniform()
remove_overlay(UNIFORM_LAYER)
if(client && hud_used)
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_w_uniform]
@@ -593,7 +594,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
thing.plane = initial(thing.plane)
apply_overlay(UNIFORM_LAYER)
/mob/living/carbon/human/update_inv_wear_id(var/update_icons=1)
/mob/living/carbon/human/update_inv_wear_id()
remove_overlay(ID_LAYER)
if(client && hud_used)
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_wear_id]
@@ -609,7 +610,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
overlays_standing[ID_LAYER] = mutable_appearance('icons/mob/mob.dmi', "id", layer = -ID_LAYER)
apply_overlay(ID_LAYER)
/mob/living/carbon/human/update_inv_gloves(var/update_icons=1)
/mob/living/carbon/human/update_inv_gloves()
remove_overlay(GLOVES_LAYER)
if(client && hud_used)
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_gloves]
@@ -646,7 +647,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
apply_overlay(GLOVES_LAYER)
/mob/living/carbon/human/update_inv_glasses(var/update_icons=1)
/mob/living/carbon/human/update_inv_glasses()
remove_overlay(GLASSES_LAYER)
remove_overlay(GLASSES_OVER_LAYER)
remove_overlay(OVER_MASK_LAYER)
@@ -687,7 +688,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
update_misc_effects()
/mob/living/carbon/human/update_inv_ears(var/update_icons=1)
/mob/living/carbon/human/update_inv_ears()
remove_overlay(EARS_LAYER)
if(client && hud_used)
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_l_ear]
@@ -735,7 +736,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
overlays_standing[EARS_LAYER] = mutable_appearance('icons/mob/ears.dmi', "[t_type]", layer = -EARS_LAYER)
apply_overlay(EARS_LAYER)
/mob/living/carbon/human/update_inv_shoes(var/update_icons=1)
/mob/living/carbon/human/update_inv_shoes()
remove_overlay(SHOES_LAYER)
if(client && hud_used)
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_shoes]
@@ -771,7 +772,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
overlays_standing[SHOES_LAYER] = bloodsies
apply_overlay(SHOES_LAYER)
/mob/living/carbon/human/update_inv_s_store(var/update_icons=1)
/mob/living/carbon/human/update_inv_s_store()
remove_overlay(SUIT_STORE_LAYER)
if(client && hud_used)
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_s_store]
@@ -792,7 +793,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
apply_overlay(SUIT_STORE_LAYER)
/mob/living/carbon/human/update_inv_head(var/update_icons=1)
/mob/living/carbon/human/update_inv_head()
..()
remove_overlay(HEAD_LAYER)
if(client && hud_used)
@@ -818,7 +819,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
overlays_standing[HEAD_LAYER] = standing
apply_overlay(HEAD_LAYER)
/mob/living/carbon/human/update_inv_belt(var/update_icons=1)
/mob/living/carbon/human/update_inv_belt()
remove_overlay(BELT_LAYER)
if(client && hud_used)
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_belt]
@@ -844,7 +845,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
apply_overlay(BELT_LAYER)
/mob/living/carbon/human/update_inv_wear_suit(var/update_icons=1)
/mob/living/carbon/human/update_inv_wear_suit()
remove_overlay(SUIT_LAYER)
if(client && hud_used)
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_wear_suit]
@@ -885,8 +886,8 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
overlays_standing[SUIT_LAYER] = standing
apply_overlay(SUIT_LAYER)
update_tail_layer(0)
update_collar(0)
update_tail_layer()
update_collar()
/mob/living/carbon/human/update_inv_pockets()
if(client && hud_used)
@@ -919,7 +920,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
client.screen += wear_pda
wear_pda.screen_loc = ui_pda
/mob/living/carbon/human/update_inv_wear_mask(var/update_icons = 1)
/mob/living/carbon/human/update_inv_wear_mask()
..()
remove_overlay(FACEMASK_LAYER)
if(client && hud_used)
@@ -955,7 +956,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
apply_overlay(FACEMASK_LAYER)
/mob/living/carbon/human/update_inv_back(var/update_icons=1)
/mob/living/carbon/human/update_inv_back()
..()
remove_overlay(BACK_LAYER)
if(back)
@@ -978,7 +979,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
overlays_standing[BACK_LAYER] = standing
apply_overlay(BACK_LAYER)
/mob/living/carbon/human/update_inv_handcuffed(var/update_icons=1)
/mob/living/carbon/human/update_inv_handcuffed()
remove_overlay(HANDCUFF_LAYER)
if(handcuffed)
if(istype(handcuffed, /obj/item/restraints/handcuffs/pinkcuffs))
@@ -987,7 +988,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
overlays_standing[HANDCUFF_LAYER] = mutable_appearance('icons/mob/mob.dmi', "handcuff1", layer = -HANDCUFF_LAYER)
apply_overlay(HANDCUFF_LAYER)
/mob/living/carbon/human/update_inv_legcuffed(var/update_icons=1)
/mob/living/carbon/human/update_inv_legcuffed()
remove_overlay(LEGCUFF_LAYER)
clear_alert("legcuffed")
if(legcuffed)
@@ -1000,7 +1001,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
apply_overlay(LEGCUFF_LAYER)
/mob/living/carbon/human/update_inv_r_hand(var/update_icons=1)
/mob/living/carbon/human/update_inv_r_hand()
..()
remove_overlay(R_HAND_LAYER)
if(r_hand)
@@ -1019,7 +1020,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
apply_overlay(R_HAND_LAYER)
/mob/living/carbon/human/update_inv_l_hand(var/update_icons=1)
/mob/living/carbon/human/update_inv_l_hand()
..()
remove_overlay(L_HAND_LAYER)
if(l_hand)
@@ -1060,7 +1061,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
client.screen += I
/mob/living/carbon/human/proc/update_tail_layer(var/update_icons=1)
/mob/living/carbon/human/proc/update_tail_layer()
remove_overlay(TAIL_UNDERLIMBS_LAYER) // SEW direction icons, overlayed by LIMBS_LAYER.
remove_overlay(TAIL_LAYER) /* This will be one of two things:
If the species' tail is overlapped by limbs, this will be only the N direction icon so tails
@@ -1135,7 +1136,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
apply_overlay(TAIL_LAYER)
apply_overlay(TAIL_UNDERLIMBS_LAYER)
/mob/living/carbon/human/proc/start_tail_wagging(var/update_icons=1)
/mob/living/carbon/human/proc/start_tail_wagging()
remove_overlay(TAIL_UNDERLIMBS_LAYER) // SEW direction icons, overlayed by LIMBS_LAYER.
remove_overlay(TAIL_LAYER) /* This will be one of two things:
If the species' tail is overlapped by limbs, this will be only the N direction icon so tails
@@ -1211,10 +1212,10 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
apply_overlay(TAIL_LAYER)
apply_overlay(TAIL_UNDERLIMBS_LAYER)
/mob/living/carbon/human/proc/stop_tail_wagging(var/update_icons=1)
/mob/living/carbon/human/proc/stop_tail_wagging()
remove_overlay(TAIL_UNDERLIMBS_LAYER)
remove_overlay(TAIL_LAYER)
update_tail_layer(update_icons) //just trigger a full update for normal stationary sprites
update_tail_layer() //just trigger a full update for normal stationary sprites
/mob/living/carbon/human/proc/update_int_organs()
remove_overlay(INTORGAN_LAYER)
@@ -1236,7 +1237,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
//Adds a collar overlay above the helmet layer if the suit has one
// Suit needs an identically named sprite in icons/mob/collar.dmi
// For suits with sprite_sheets, an identically named sprite needs to exist in a file like this icons/mob/species/[species_name_here]/collar.dmi.
/mob/living/carbon/human/proc/update_collar(var/update_icons=1)
/mob/living/carbon/human/proc/update_collar()
remove_overlay(COLLAR_LAYER)
var/icon/C = new('icons/mob/collar.dmi')
var/mutable_appearance/standing = null
@@ -1282,7 +1283,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
/mob/living/carbon/human/proc/force_update_limbs()
for(var/obj/item/organ/external/O in bodyparts)
O.sync_colour_to_human(src)
update_body(0)
update_body()
/mob/living/carbon/human/proc/get_overlays_copy(list/unwantedLayers)
var/list/out = new
@@ -12,7 +12,7 @@
/mob/living/carbon/human/update_nearsighted_effects()
var/obj/item/clothing/glasses/G = glasses
if((disabilities & NEARSIGHTED) && (!istype(G) || !G.prescription))
if((NEARSIGHTED in mutations) && (!istype(G) || !G.prescription))
overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1)
else
clear_fullscreen("nearsighted")
+91 -67
View File
@@ -1,25 +1,35 @@
/mob/living/carbon/Life(seconds, times_fired)
set invisibility = 0
set background = BACKGROUND_ENABLED
if(notransform)
return
if(!loc)
if(damageoverlaytemp)
damageoverlaytemp = 0
update_damage_hud()
if(stat != DEAD)
handle_organs()
. = ..()
if(QDELETED(src))
return
if(..())
. = 1
if(.) //not dead
handle_blood()
for(var/obj/item/organ/internal/O in internal_organs)
O.on_life()
handle_patches()
handle_changeling()
if(LAZYLEN(processing_patches))
handle_patches()
if(mind)
handle_changeling()
handle_wetness(times_fired)
// Increase germ_level regularly
if(germ_level < GERM_LEVEL_AMBIENT && prob(30)) //if you're just standing there, you shouldn't get more germs beyond an ambient level
germ_level++
handle_germs()
if(stat != DEAD)
return TRUE
///////////////
@@ -112,7 +122,7 @@
var/O2_partialpressure = (breath.oxygen/breath.total_moles())*breath_pressure
var/Toxins_partialpressure = (breath.toxins/breath.total_moles())*breath_pressure
var/CO2_partialpressure = (breath.carbon_dioxide/breath.total_moles())*breath_pressure
var/SA_partialpressure = (breath.sleeping_agent/breath.total_moles())*breath_pressure
//OXYGEN
if(O2_partialpressure < safe_oxy_min) //Not enough oxygen
@@ -152,22 +162,20 @@
//TOXINS/PLASMA
if(Toxins_partialpressure > safe_tox_max)
var/ratio = (breath.toxins/safe_tox_max) * 10
adjustToxLoss(Clamp(ratio, MIN_TOXIC_GAS_DAMAGE, MAX_TOXIC_GAS_DAMAGE))
adjustToxLoss(clamp(ratio, MIN_TOXIC_GAS_DAMAGE, MAX_TOXIC_GAS_DAMAGE))
throw_alert("too_much_tox", /obj/screen/alert/too_much_tox)
else
clear_alert("too_much_tox")
//TRACE GASES
if(breath.trace_gases.len)
for(var/datum/gas/sleeping_agent/SA in breath.trace_gases)
var/SA_partialpressure = (SA.moles/breath.total_moles())*breath_pressure
if(SA_partialpressure > SA_para_min)
Paralyse(3)
if(SA_partialpressure > SA_sleep_min)
AdjustSleeping(2, bound_lower = 0, bound_upper = 10)
else if(SA_partialpressure > 0.01)
if(prob(20))
emote(pick("giggle","laugh"))
if(breath.sleeping_agent)
if(SA_partialpressure > SA_para_min)
Paralyse(3)
if(SA_partialpressure > SA_sleep_min)
AdjustSleeping(2, bound_lower = 0, bound_upper = 10)
else if(SA_partialpressure > 0.01)
if(prob(20))
emote(pick("giggle","laugh"))
//BREATH TEMPERATURE
handle_breath_temperature(breath)
@@ -192,6 +200,11 @@
else
update_action_buttons_icon()
/mob/living/carbon/proc/handle_organs()
for(var/thing in internal_organs)
var/obj/item/organ/internal/O = thing
O.on_life()
/mob/living/carbon/handle_diseases()
for(var/thing in viruses)
var/datum/disease/D = thing
@@ -230,12 +243,11 @@
adjustToxLoss(3)
updatehealth("handle mutations and radiation(75-100)")
radiation = Clamp(radiation, 0, 100)
radiation = clamp(radiation, 0, 100)
/mob/living/carbon/handle_chemicals_in_body()
if(reagents)
reagents.metabolize(src)
reagents.metabolize(src)
/mob/living/carbon/proc/handle_wetness(times_fired)
@@ -262,7 +274,9 @@
if(stam_regen_start_time <= world.time)
if(stam_paralyzed)
update_stamina()
setStaminaLoss(0, FALSE)
if(staminaloss)
setStaminaLoss(0, FALSE)
update_health_hud()
var/restingpwr = 1 + 4 * resting
@@ -320,8 +334,17 @@
AdjustHallucinate(-2)
// Keep SSD people asleep
if(player_logged)
Sleeping(2)
/mob/living/carbon/handle_sleeping()
if(..())
if(mind?.vampire)
if(istype(loc, /obj/structure/closet/coffin))
adjustBruteLoss(-1, FALSE)
adjustFireLoss(-1, FALSE)
adjustToxLoss(-1)
handle_dreams()
adjustStaminaLoss(-10)
var/comfort = 1
@@ -337,44 +360,42 @@
comfort += 1 //Aren't naps SO much better when drunk?
AdjustDrunk(-0.2*comfort) //reduce drunkenness while sleeping.
if(comfort > 1 && prob(3))//You don't heal if you're just sleeping on the floor without a blanket.
adjustBruteLoss(-1*comfort)
adjustFireLoss(-1*comfort)
adjustBruteLoss(-1 * comfort, FALSE)
adjustFireLoss(-1 * comfort)
if(prob(10) && health && hal_screwyhud != SCREWYHUD_CRIT)
emote("snore")
// Keep SSD people asleep
if(player_logged)
Sleeping(2)
return sleeping
/mob/living/carbon/handle_hud_icons()
return
/mob/living/carbon/handle_hud_icons_health()
/mob/living/carbon/update_health_hud(shown_health_amount)
if(!client)
return
if(healths)
if(stat != DEAD)
switch(health)
if(100 to INFINITY)
healths.icon_state = "health0"
if(80 to 100)
healths.icon_state = "health1"
if(60 to 80)
healths.icon_state = "health2"
if(40 to 60)
healths.icon_state = "health3"
if(20 to 40)
healths.icon_state = "health4"
if(0 to 20)
healths.icon_state = "health5"
else
healths.icon_state = "health6"
. = TRUE
if(shown_health_amount == null)
shown_health_amount = health
if(shown_health_amount >= maxHealth)
healths.icon_state = "health0"
else if(shown_health_amount > maxHealth * 0.8)
healths.icon_state = "health1"
else if(shown_health_amount > maxHealth * 0.6)
healths.icon_state = "health2"
else if(shown_health_amount > maxHealth * 0.4)
healths.icon_state = "health3"
else if(shown_health_amount > maxHealth * 0.2)
healths.icon_state = "health4"
else if(shown_health_amount > 0)
healths.icon_state = "health5"
else
healths.icon_state = "health6"
else
healths.icon_state = "health7"
handle_hud_icons_health_overlay()
/mob/living/carbon/proc/handle_hud_icons_health_overlay()
/mob/living/carbon/update_damage_hud()
if(!client)
return
if(stat == UNCONSCIOUS && health <= HEALTH_THRESHOLD_CRIT)
if(check_death_method())
var/severity = 0
@@ -441,20 +462,23 @@
clear_fullscreen("brute")
/mob/living/carbon/proc/handle_patches()
if(LAZYLEN(processing_patches))
var/multiple_patch_multiplier = processing_patches.len > 1 ? (processing_patches.len * 1.5) : 1
var/applied_amount = 0.35 * multiple_patch_multiplier
var/multiple_patch_multiplier = processing_patches.len > 1 ? (processing_patches.len * 1.5) : 1
var/applied_amount = 0.35 * multiple_patch_multiplier
for(var/patch in processing_patches)
var/obj/item/reagent_containers/food/pill/patch/P = patch
for(var/patch in processing_patches)
var/obj/item/reagent_containers/food/pill/patch/P = patch
if(P.reagents && P.reagents.total_volume)
var/fractional_applied_amount = applied_amount / P.reagents.total_volume
P.reagents.reaction(src, REAGENT_TOUCH, fractional_applied_amount, P.needs_to_apply_reagents)
P.needs_to_apply_reagents = FALSE
P.reagents.trans_to(src, applied_amount * 0.5)
P.reagents.remove_any(applied_amount * 0.5)
else
if(!P.reagents || P.reagents.total_volume <= 0)
processing_patches -= P
qdel(P)
if(P.reagents && P.reagents.total_volume)
var/fractional_applied_amount = applied_amount / P.reagents.total_volume
P.reagents.reaction(src, REAGENT_TOUCH, fractional_applied_amount, P.needs_to_apply_reagents)
P.needs_to_apply_reagents = FALSE
P.reagents.trans_to(src, applied_amount * 0.5)
P.reagents.remove_any(applied_amount * 0.5)
else
if(!P.reagents || P.reagents.total_volume <= 0)
processing_patches -= P
qdel(P)
/mob/living/carbon/proc/handle_germs()
if(germ_level < GERM_LEVEL_AMBIENT && prob(30)) //if you're just standing there, you shouldn't get more germs beyond an ambient level
germ_level++
@@ -2,12 +2,10 @@
if(status_flags & GODMODE)
return
if(stat != DEAD)
// if(health <= min_health)
if(health <= HEALTH_THRESHOLD_DEAD && check_death_method())
death()
create_debug_log("died of damage, trigger reason: [reason]")
return
// if(paralysis || sleeping || getOxyLoss() > low_oxy_ko || (status_flags & FAKEDEATH) || health <= crit_health)
if(paralysis || sleeping || (check_death_method() && getOxyLoss() > 50) || (status_flags & FAKEDEATH) || health <= HEALTH_THRESHOLD_CRIT && check_death_method())
if(stat == CONSCIOUS)
KnockOut()
@@ -16,6 +14,9 @@
if(stat == UNCONSCIOUS)
WakeUp()
create_debug_log("woke up, trigger reason: [reason]")
update_damage_hud()
update_health_hud()
med_hud_set_status()
/mob/living/carbon/update_stamina()
var/stam = getStaminaLoss()
@@ -24,7 +25,6 @@
else if(stam_paralyzed)
stam_paralyzed = FALSE
update_canmove()
handle_hud_icons_health()
/mob/living/carbon/can_hear()
. = FALSE
+2
View File
@@ -269,6 +269,7 @@
if(amount > 0)
stam_regen_start_time = world.time + STAMINA_REGEN_BLOCK_TIME
if(updating)
update_health_hud()
update_stamina()
/mob/living/proc/setStaminaLoss(amount, updating = TRUE)
@@ -284,6 +285,7 @@
if(amount > 0)
stam_regen_start_time = world.time + STAMINA_REGEN_BLOCK_TIME
if(updating)
update_health_hud()
update_stamina()
/mob/living/proc/getMaxHealth()
+4 -1
View File
@@ -61,10 +61,13 @@
if(mind && suiciding)
mind.suicided = TRUE
reset_perspective(null)
clear_fullscreens()
update_sight()
update_action_buttons_icon()
update_damage_hud()
update_health_hud()
med_hud_set_health()
med_hud_set_status()
if(!gibbed && !QDELETED(src))
@@ -83,7 +86,7 @@
timeofdeath = world.time
create_log(ATTACK_LOG, "died[gibbed ? " (Gibbed)": ""]")
GLOB.living_mob_list -= src
GLOB.alive_mob_list -= src
GLOB.dead_mob_list += src
if(mind)
mind.store_memory("Time of death: [station_time_timestamp("hh:mm:ss", timeofdeath)]", 0)
+98 -106
View File
@@ -1,12 +1,10 @@
/mob/living/Life(seconds, times_fired)
/mob/living/proc/Life(seconds, times_fired)
set waitfor = FALSE
set invisibility = 0
set background = BACKGROUND_ENABLED
if(notransform)
return FALSE
if(!loc)
return FALSE
var/datum/gas_mixture/environment = loc.return_air()
if(flying) //TODO: Better floating
animate(src, pixel_y = pixel_y + 5 , time = 10, loop = 1, easing = SINE_EASING)
animate(pixel_y = pixel_y - 5, time = 10, loop = 1, easing = SINE_EASING)
if(client || registered_z) // This is a temporary error tracker to make sure we've caught everything
var/turf/T = get_turf(src)
@@ -17,28 +15,44 @@
else if (!client && registered_z)
log_game("Z-TRACKING: [src] of type [src.type] has a Z-registration despite not having a client.")
update_z(null)
if(notransform)
return FALSE
if(!loc)
return FALSE
if(stat != DEAD)
//Chemicals in the body
handle_chemicals_in_body()
if(reagents)
handle_chemicals_in_body()
if(QDELETED(src)) // some chems can gib mobs
return
if(stat != DEAD)
//Mutations and radiation
handle_mutations_and_radiation()
if(stat != DEAD)
//Breathing, if applicable
handle_breathing(times_fired)
if(stat != DEAD)
//Random events (vomiting etc)
handle_random_events()
. = 1
if(LAZYLEN(viruses))
handle_diseases()
handle_diseases()
if(QDELETED(src)) // diseases can qdel the mob via transformations
return
//Heart Attack, if applicable
if(stat != DEAD)
handle_heartattack()
//Handle temperature/pressure differences between body and environment
var/datum/gas_mixture/environment = loc.return_air()
if(environment)
handle_environment(environment)
@@ -49,19 +63,38 @@
update_gravity(mob_has_gravity())
update_pulling()
if(pulling)
update_pulling()
for(var/obj/item/grab/G in src)
G.process()
if(handle_regular_status_updates()) // Status & health update, are we dead or alive etc.
if(stat != DEAD)
handle_critical_condition()
if(stat != DEAD) // Status & health update, are we dead or alive etc.
handle_disabilities() // eye, ear, brain damages
if(stat != DEAD)
handle_status_effects() //all special effects, stunned, weakened, jitteryness, hallucination, sleeping, etc
if(client)
handle_regular_hud_updates()
if(stat != DEAD)
if(forced_look)
if(!isnum(forced_look))
var/atom/A = locateUID(forced_look)
if(istype(A))
var/view = client ? client.view : world.view
if(get_dist(src, A) > view || !(src in viewers(view, A)))
forced_look = null
to_chat(src, "<span class='notice'>Your direction target has left your view, you are no longer facing anything.</span>")
return
setDir()
..()
if(machine)
machine.check_eye(src)
if(stat != DEAD)
return TRUE
/mob/living/proc/handle_breathing(times_fired)
return
@@ -71,7 +104,6 @@
/mob/living/proc/handle_mutations_and_radiation()
radiation = 0 //so radiation don't accumulate in simple animals
return
/mob/living/proc/handle_chemicals_in_body()
return
@@ -89,122 +121,54 @@
return
/mob/living/proc/update_pulling()
if(pulling)
if(incapacitated())
stop_pulling()
//This updates the health and status of the mob (conscious, unconscious, dead)
/mob/living/proc/handle_regular_status_updates()
return stat != DEAD
if(incapacitated())
stop_pulling()
//this updates all special effects: stunned, sleeping, weakened, druggy, stuttering, etc..
/mob/living/proc/handle_status_effects()
handle_stunned()
handle_weakened()
handle_stuttering()
handle_silent()
handle_drugged()
handle_slurring()
handle_paralysed()
handle_sleeping()
handle_slowed()
handle_drunk()
handle_cultslurring()
/mob/living/proc/handle_stunned()
/mob/living/proc/handle_status_effects() // We check for the status effect in this proc as opposed to the procs below to avoid excessive proc call overhead
if(stunned)
AdjustStunned(-1, updating = 1, force = 1)
if(!stunned)
update_icons()
return stunned
/mob/living/proc/handle_weakened()
if(weakened)
AdjustWeakened(-1, updating = 1, force = 1)
if(!weakened)
update_icons()
return weakened
/mob/living/proc/handle_stuttering()
if(stuttering)
stuttering = max(stuttering-1, 0)
return stuttering
/mob/living/proc/handle_silent()
stuttering = max(stuttering - 1, 0)
if(silent)
AdjustSilence(-1)
return silent
/mob/living/proc/handle_drugged()
if(druggy)
AdjustDruggy(-1)
return druggy
/mob/living/proc/handle_slurring()
if(slurring)
AdjustSlur(-1)
return slurring
/mob/living/proc/handle_cultslurring()
if(cultslurring)
AdjustCultSlur(-1)
return cultslurring
/mob/living/proc/handle_paralysed()
if(paralysis)
AdjustParalysis(-1, updating = 1, force = 1)
return paralysis
/mob/living/proc/handle_sleeping()
if(sleeping)
AdjustSleeping(-1)
throw_alert("asleep", /obj/screen/alert/asleep)
else
clear_alert("asleep")
return sleeping
/mob/living/proc/handle_slowed()
handle_sleeping()
if(slowed)
AdjustSlowed(-1)
return slowed
if(drunk)
handle_drunk()
if(cultslurring)
AdjustCultSlur(-1)
/mob/living/proc/update_damage_hud()
return
/mob/living/proc/handle_sleeping()
AdjustSleeping(-1)
return sleeping
/mob/living/proc/handle_drunk()
if(drunk)
AdjustDrunk(-1)
AdjustDrunk(-1)
return drunk
/mob/living/proc/handle_disabilities()
//Eyes
if(disabilities & BLIND || stat) //blindness from disability or unconsciousness doesn't get better on its own
if((BLINDNESS in mutations) || stat) //blindness from disability or unconsciousness doesn't get better on its own
EyeBlind(1)
else if(eye_blind) //blindness, heals slowly over time
AdjustEyeBlind(-1)
else if(eye_blurry) //blurry eyes heal slowly
AdjustEyeBlurry(-1)
//this handles hud updates. Calls update_vision() and handle_hud_icons()
/mob/living/proc/handle_regular_hud_updates()
if(!client) return 0
handle_vision()
handle_hud_icons()
return 1
/mob/living/proc/handle_vision()
update_sight()
if(stat == DEAD)
return
if(machine)
if(!machine.check_eye(src))
reset_perspective(null)
else
if(!remote_view && !client.adminobs)
reset_perspective(null)
// Gives a mob the vision of being dead
/mob/living/proc/grant_death_vision()
sight |= SEE_TURFS
@@ -215,9 +179,37 @@
see_invisible = SEE_INVISIBLE_OBSERVER
sync_lighting_plane_alpha()
/mob/living/proc/handle_hud_icons()
handle_hud_icons_health()
/mob/living/proc/handle_critical_condition()
return
/mob/living/proc/handle_hud_icons_health()
return
/mob/living/update_health_hud()
if(!client)
return
if(healths)
var/severity = 0
var/healthpercent = (health / maxHealth) * 100
switch(healthpercent)
if(100 to INFINITY)
healths.icon_state = "health0"
if(80 to 100)
healths.icon_state = "health1"
severity = 1
if(60 to 80)
healths.icon_state = "health2"
severity = 2
if(40 to 60)
healths.icon_state = "health3"
severity = 3
if(20 to 40)
healths.icon_state = "health4"
severity = 4
if(1 to 20)
healths.icon_state = "health5"
severity = 5
else
healths.icon_state = "health7"
severity = 6
if(severity > 0)
overlay_fullscreen("brute", /obj/screen/fullscreen/brute, severity)
else
clear_fullscreen("brute")
+11 -9
View File
@@ -3,6 +3,7 @@
var/datum/atom_hud/data/human/medical/advanced/medhud = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
medhud.add_to_hud(src)
faction += "\ref[src]"
GLOB.mob_living_list += src
/mob/living/prepare_huds()
..()
@@ -17,7 +18,7 @@
if(ranged_ability)
ranged_ability.remove_ranged_ability(src)
remove_from_all_data_huds()
GLOB.mob_living_list -= src
if(LAZYLEN(status_effects))
for(var/s in status_effects)
var/datum/status_effect/S = s
@@ -285,8 +286,9 @@
health = maxHealth - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() - getCloneLoss()
update_stat("updatehealth([reason])")
handle_hud_icons_health()
med_hud_set_health()
med_hud_set_status()
update_health_hud()
//This proc is used for mobs which are affected by pressure to calculate the amount of pressure that actually
@@ -738,7 +740,8 @@
clear_alert("weightless")
else
throw_alert("weightless", /obj/screen/alert/weightless)
float(!has_gravity)
if(!flying)
float(!has_gravity)
/mob/living/proc/float(on)
if(throwing)
@@ -759,7 +762,7 @@
//called when the mob receives a bright flash
/mob/living/proc/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash)
if(check_eye_prot() < intensity && (override_blindness_check || !(disabilities & BLIND)))
if(check_eye_prot() < intensity && (override_blindness_check || !(BLINDNESS in mutations)))
overlay_fullscreen("flash", type)
addtimer(CALLBACK(src, .proc/clear_fullscreen, "flash", 25), 25)
return 1
@@ -802,7 +805,7 @@
if(do_mob(src, who, what.put_on_delay))
if(what && Adjacent(who) && !(what.flags & NODROP))
unEquip(what)
who.equip_to_slot_if_possible(what, where, 0, 1)
who.equip_to_slot_if_possible(what, where, FALSE, TRUE)
add_attack_logs(src, who, "Equipped [what]")
/mob/living/singularity_act()
@@ -823,8 +826,7 @@
spawn_dust()
gib()
/mob/living/do_attack_animation(atom/A, visual_effect_icon, obj/item/used_item, no_effect, end_pixel_y)
end_pixel_y = get_standard_pixel_y_offset(lying)
/mob/living/do_attack_animation(atom/A, visual_effect_icon, obj/item/used_item, no_effect)
if(!used_item)
used_item = get_active_hand()
..()
@@ -1025,9 +1027,9 @@
if("stat")
if((stat == DEAD) && (var_value < DEAD))//Bringing the dead back to life
GLOB.dead_mob_list -= src
GLOB.living_mob_list += src
GLOB.alive_mob_list += src
if((stat < DEAD) && (var_value == DEAD))//Kill he
GLOB.living_mob_list -= src
GLOB.alive_mob_list -= src
GLOB.dead_mob_list += src
. = ..()
switch(var_name)
+3 -3
View File
@@ -79,9 +79,9 @@
/obj/item/proc/get_volume_by_throwforce_and_or_w_class()
if(throwforce && w_class)
return Clamp((throwforce + w_class) * 5, 30, 100)// Add the item's throwforce to its weight class and multiply by 5, then clamp the value between 30 and 100
return clamp((throwforce + w_class) * 5, 30, 100)// Add the item's throwforce to its weight class and multiply by 5, then clamp the value between 30 and 100
else if(w_class)
return Clamp(w_class * 8, 20, 100) // Multiply the item's weight class by 8, then clamp the value between 20 and 100
return clamp(w_class * 8, 20, 100) // Multiply the item's weight class by 8, then clamp the value between 20 and 100
else
return 0
@@ -175,7 +175,7 @@
return
/mob/living/proc/adjust_fire_stacks(add_fire_stacks) //Adjusting the amount of fire_stacks we have on person
fire_stacks = Clamp(fire_stacks + add_fire_stacks, -20, 20)
fire_stacks = clamp(fire_stacks + add_fire_stacks, -20, 20)
if(on_fire && fire_stacks <= 0)
ExtinguishMob()
+5 -4
View File
@@ -172,6 +172,9 @@ proc/get_radio_key_from_channel(var/channel)
var/list/hsp = handle_speech_problems(message_pieces, verb)
verb = hsp["verb"]
// Do this so it gets logged for all types of communication
var/log_message = "[message_mode ? "([message_mode])" : ""] '[message]'"
create_log(SAY_LOG, log_message)
var/list/used_radios = list()
if(handle_message_mode(message_mode, message_pieces, verb, used_radios))
@@ -179,9 +182,7 @@ proc/get_radio_key_from_channel(var/channel)
// Log of what we've said, plain message, no spans or junk
// handle_message_mode should have logged this already if it handled it
var/log_message = "[message_mode ? "([message_mode])" : ""] '[message]'"
say_log += log_message
create_log(SAY_LOG, log_message) // TODO after #13047: Include the channel
log_say(log_message, src)
var/list/handle_v = handle_speech_sound()
@@ -335,7 +336,8 @@ proc/get_radio_key_from_channel(var/channel)
var/datum/multilingual_say_piece/S = message_pieces // Yay BYOND's hilarious typecasting
S.speaking.broadcast(src, S.message)
return 1
// Log it here since it skips the default way say handles it
create_log(SAY_LOG, "(whisper) '[message]'")
whisper_say(message_pieces)
// for weird circumstances where you're inside an atom that is also you, like pai's
@@ -364,7 +366,6 @@ proc/get_radio_key_from_channel(var/channel)
say_log += "whisper: [message]"
log_whisper(message, src)
create_log(SAY_LOG, "WHISPER: [message]")
var/message_range = 1
var/eavesdropping_range = 2
var/watching_range = 5
+1 -1
View File
@@ -34,7 +34,7 @@
spawn(10)
explosion(src.loc, 3, 6, 12, 15)
for(var/obj/machinery/ai_status_display/O in world) //change status
for(var/obj/machinery/ai_status_display/O in GLOB.machines) //change status
O.mode = 2
if(istype(loc, /obj/item/aicard))
@@ -67,9 +67,6 @@
// The actual updating. It gathers the visible turfs from cameras and puts them into the appropiate lists.
/datum/camerachunk/proc/update()
set background = BACKGROUND_ENABLED
var/list/newVisibleTurfs = list()
for(var/camera in cameras)
+2 -2
View File
@@ -37,7 +37,8 @@
else
adjustOxyLoss(-1)
handle_stunned()
if(stunned)
AdjustStunned(-1, updating = 1, force = 1)
var/area/my_area = get_area(src)
@@ -140,7 +141,6 @@
else
health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()
update_stat("updatehealth([reason])")
diag_hud_set_status()
diag_hud_set_health()
+1 -1
View File
@@ -1,6 +1,6 @@
/mob/living/silicon/ai/Logout()
..()
for(var/obj/machinery/ai_status_display/O in world) //change status
for(var/obj/machinery/ai_status_display/O in GLOB.machines) //change status
O.mode = 0
src.view_core()
return
@@ -9,7 +9,7 @@
else if(stat == UNCONSCIOUS)
WakeUp()
create_debug_log("woke up, trigger reason: [reason]")
//diag_hud_set_status()
diag_hud_set_status()
/mob/living/silicon/ai/has_vision(information_only = FALSE)
return ..() && !lacks_power()
@@ -4,7 +4,7 @@
if(!.)
return FALSE
icon_state = "ai-crash"
for(var/obj/machinery/ai_status_display/O in world) //change status
for(var/obj/machinery/ai_status_display/O in GLOB.machines) //change status
if(atoms_share_level(O, src))
O.mode = 2
gib()
+12 -16
View File
@@ -1,22 +1,18 @@
/mob/living/silicon/pai/Life(seconds, times_fired)
. = ..()
if(.)
//if(secHUD == 1)
// process_sec_hud(src, 1)
////if(medHUD == 1)
// process_med_hud(src, 1)
if(silence_time)
if(world.timeofday >= silence_time)
silence_time = null
to_chat(src, "<font color=green>Communication circuit reinitialized. Speech and messaging functionality restored.</font>")
if(QDELETED(src) || stat == DEAD)
return
if(silence_time)
if(world.timeofday >= silence_time)
silence_time = null
to_chat(src, "<font color=green>Communication circuit reinitialized. Speech and messaging functionality restored.</font>")
if(cable)
if(get_dist(src, cable) > 1)
var/turf/T = get_turf_or_move(loc)
for(var/mob/M in viewers(T))
M.show_message("<span class='warning'>The data cable rapidly retracts back into its spool.</span>", 3, "<span class='warning'>You hear a click and the sound of wire spooling rapidly.</span>", 2)
qdel(src.cable)
cable = null
if(cable)
if(get_dist(src, cable) > 1)
var/turf/T = get_turf_or_move(loc)
for(var/mob/M in viewers(T))
M.show_message("<span class='warning'>The data cable rapidly retracts back into its spool.</span>", 3, "<span class='warning'>You hear a click and the sound of wire spooling rapidly.</span>", 2)
QDEL_NULL(cable)
/mob/living/silicon/pai/updatehealth(reason = "none given")
if(status_flags & GODMODE)
@@ -18,7 +18,7 @@
flick("gibbed-r", animation)
robogibs(loc)
GLOB.living_mob_list -= src
GLOB.alive_mob_list -= src
GLOB.dead_mob_list -= src
QDEL_IN(animation, 15)
QDEL_IN(src, 15)
@@ -18,6 +18,8 @@
magpulse = 1
mob_size = MOB_SIZE_SMALL
modules_break = FALSE
// We need to keep track of a few module items so we don't need to do list operations
// every time we need them. These get set in New() after the module is chosen.
var/obj/item/stack/sheet/metal/cyborg/stack_metal = null
@@ -142,7 +144,7 @@
user.visible_message("<span class='warning'>\the [user] swipes [user.p_their()] ID card through [src], attempting to reboot it.</span>", "<span class='warning'>You swipe your ID card through [src], attempting to reboot it.</span>")
last_reboot = world.time / 10
var/drones = 0
for(var/mob/living/silicon/robot/drone/D in world)
for(var/mob/living/silicon/robot/drone/D in GLOB.silicon_mob_list)
if(D.key && D.client)
drones++
if(drones < config.max_maint_drones)
@@ -34,7 +34,7 @@
var/dat
dat += "<B>Maintenance Units</B><BR>"
for(var/mob/living/silicon/robot/drone/D in world)
for(var/mob/living/silicon/robot/drone/D in GLOB.silicon_mob_list)
dat += "<BR>[D.real_name] ([D.stat == 2 ? "<font color='red'>INACTIVE" : "<font color='green'>ACTIVE"]</FONT>)"
dat += "<font dize = 9><BR>Cell charge: [D.cell.charge]/[D.cell.maxcharge]."
dat += "<BR>Currently located in: [get_area(D)]."
@@ -74,7 +74,7 @@
else if(href_list["ping"])
to_chat(usr, "<span class='notice'>You issue a maintenance request for all active drones, highlighting [drone_call_area].</span>")
for(var/mob/living/silicon/robot/drone/D in world)
for(var/mob/living/silicon/robot/drone/D in GLOB.silicon_mob_list)
if(D.client && D.stat == 0)
to_chat(D, "-- Maintenance drone presence requested in: [drone_call_area].")
@@ -52,7 +52,7 @@
/obj/machinery/drone_fabricator/proc/count_drones()
var/drones = 0
for(var/mob/living/silicon/robot/drone/D in world)
for(var/mob/living/silicon/robot/drone/D in GLOB.silicon_mob_list)
if(D.key && D.client)
drones++
return drones
@@ -142,7 +142,7 @@
if(alert("Are you sure you want to respawn as a drone?", "Are you sure?", "Yes", "No") != "Yes")
return
for(var/obj/machinery/drone_fabricator/DF in world)
for(var/obj/machinery/drone_fabricator/DF in GLOB.machines)
if(DF.stat & NOPOWER || !DF.produce_drones)
continue
@@ -4,7 +4,7 @@
/mob/living/silicon/robot/drone/update_stat(reason = "none given")
if(status_flags & GODMODE)
return
if(health <= -35 && stat != DEAD)
if(health <= -maxHealth && stat != DEAD)
gib()
create_debug_log("died of damage, trigger reason: [reason]")
return
@@ -78,6 +78,7 @@
set_actions(O)
else
to_chat(src, "You need to disable a module first!")
check_module_damage(FALSE)
update_icons()
/mob/living/silicon/robot/proc/set_actions(obj/item/I)
+22 -57
View File
@@ -1,23 +1,20 @@
/mob/living/silicon/robot/Life(seconds, times_fired)
set invisibility = 0
set background = BACKGROUND_ENABLED
if(src.notransform)
if(notransform)
return
//Status updates, death etc.
clamp_values()
. = ..()
if(..())
handle_equipment()
// if Alive
if(.)
handle_robot_hud_updates()
handle_robot_cell()
process_locks()
update_items()
process_queued_alarms()
/mob/living/silicon/robot/proc/clamp_values()
SetStunned(min(stunned, 30))
SetParalysis(min(paralysis, 30))
SetWeakened(min(weakened, 20))
SetSleeping(0)
/mob/living/silicon/robot/proc/handle_robot_cell()
if(stat != DEAD)
@@ -39,7 +36,7 @@
if(is_component_functioning("power cell") && cell.charge)
if(cell.charge <= 100)
uneq_all()
var/amt = Clamp((lamp_intensity - 2) * 2,1,cell.charge) //Always try to use at least one charge per tick, but allow it to completely drain the cell.
var/amt = clamp((lamp_intensity - 2) * 2,1,cell.charge) //Always try to use at least one charge per tick, but allow it to completely drain the cell.
cell.use(amt) //Usage table: 1/tick if off/lowest setting, 4 = 4/tick, 6 = 8/tick, 8 = 12/tick, 10 = 16/tick
else
uneq_all()
@@ -47,36 +44,13 @@
update_headlamp()
diag_hud_set_borgcell()
/mob/living/silicon/robot/handle_regular_status_updates()
. = ..()
/mob/living/silicon/robot/proc/handle_equipment()
if(camera && !scrambledcodes)
if(stat == DEAD || wires.IsCameraCut())
camera.status = 0
else
camera.status = 1
if(sleeping)
AdjustSleeping(-1)
if(.) //alive
if(!istype(src, /mob/living/silicon/robot/drone))
if(health < 50) //Gradual break down of modules as more damage is sustained
if(uneq_module(module_state_3))
to_chat(src, "<span class='warning'>SYSTEM ERROR: Module 3 OFFLINE.</span>")
if(health < 0)
if(uneq_module(module_state_2))
to_chat(src, "<span class='warning'>SYSTEM ERROR: Module 2 OFFLINE.</span>")
if(health < -50)
if(uneq_module(module_state_1))
to_chat(src, "<span class='warning'>CRITICAL ERROR: All modules OFFLINE.</span>")
diag_hud_set_health()
diag_hud_set_status()
//update the state of modules and components here
if(stat != CONSCIOUS)
uneq_all()
@@ -86,18 +60,21 @@
else
radio.on = 1
return 1
/mob/living/silicon/robot/handle_hud_icons()
update_items()
update_cell()
/mob/living/silicon/robot/proc/SetEmagged(new_state)
emagged = new_state
update_icons()
if(emagged)
throw_alert("hacked", /obj/screen/alert/hacked)
else
clear_alert("hacked")
..()
/mob/living/silicon/robot/handle_hud_icons_health()
/mob/living/silicon/robot/proc/handle_robot_hud_updates()
if(!client)
return
update_cell_hud_icon()
/mob/living/silicon/robot/update_health_hud()
if(healths)
if(stat != DEAD)
if(health >= maxHealth)
@@ -115,19 +92,7 @@
else
healths.icon_state = "health7"
switch(bodytemperature) //310.055 optimal body temp
if(335 to INFINITY)
throw_alert("temp", /obj/screen/alert/hot/robot, 2)
if(320 to 335)
throw_alert("temp", /obj/screen/alert/hot/robot, 1)
if(300 to 320)
clear_alert("temp")
if(260 to 300)
throw_alert("temp", /obj/screen/alert/cold/robot, 1)
else
throw_alert("temp", /obj/screen/alert/cold/robot, 2)
/mob/living/silicon/robot/proc/update_cell()
/mob/living/silicon/robot/proc/update_cell_hud_icon()
if(cell)
var/cellcharge = cell.charge/cell.maxcharge
switch(cellcharge)
@@ -146,7 +111,7 @@
/mob/living/silicon/robot/proc/update_items()
/mob/living/silicon/robot/proc/update_items() // What in the Sam hell is this?
if(client)
for(var/obj/I in get_all_slots())
client.screen |= I
+29 -5
View File
@@ -87,6 +87,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
var/braintype = "Cyborg"
var/base_icon = ""
var/crisis = 0
var/modules_break = TRUE
var/lamp_max = 10 //Maximum brightness of a borg lamp. Set as a var for easy adjusting.
var/lamp_intensity = 0 //Luminosity of the headlamp. 0 is off. Higher settings than the minimum require power.
@@ -840,7 +841,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
return
else
sleep(6)
emagged = 1
SetEmagged(TRUE)
SetLockdown(1) //Borgs were getting into trouble because they would attack the emagger before the new laws were shown
if(src.hud_used)
src.hud_used.update_robot_modules_display() //Shows/hides the emag item if the inventory screen is already open.
@@ -1157,16 +1158,16 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
if(cleaned_human.lying)
if(cleaned_human.head)
cleaned_human.head.clean_blood()
cleaned_human.update_inv_head(0,0)
cleaned_human.update_inv_head()
if(cleaned_human.wear_suit)
cleaned_human.wear_suit.clean_blood()
cleaned_human.update_inv_wear_suit(0,0)
cleaned_human.update_inv_wear_suit()
else if(cleaned_human.w_uniform)
cleaned_human.w_uniform.clean_blood()
cleaned_human.update_inv_w_uniform(0,0)
cleaned_human.update_inv_w_uniform()
if(cleaned_human.shoes)
cleaned_human.shoes.clean_blood()
cleaned_human.update_inv_shoes(0,0)
cleaned_human.update_inv_shoes()
cleaned_human.clean_blood()
to_chat(cleaned_human, "<span class='danger'>[src] cleans your face!</span>")
if(floor_only)
@@ -1481,3 +1482,26 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
else
uneq_active() // else unequip the module and put it back into the robot's inventory.
return
/mob/living/silicon/robot/proc/check_module_damage(makes_sound = TRUE)
if(modules_break)
if(health < 50) //Gradual break down of modules as more damage is sustained
if(uneq_module(module_state_3))
if(makes_sound)
audible_message("<span class='warning'>[src] sounds an alarm! \"SYSTEM ERROR: Module 3 OFFLINE.\"</span>")
playsound(loc, 'sound/machines/warning-buzzer.ogg', 50, TRUE)
to_chat(src, "<span class='userdanger'>SYSTEM ERROR: Module 3 OFFLINE.</span>")
if(health < 0)
if(uneq_module(module_state_2))
if(makes_sound)
audible_message("<span class='warning'>[src] sounds an alarm! \"SYSTEM ERROR: Module 2 OFFLINE.\"</span>")
playsound(loc, 'sound/machines/warning-buzzer.ogg', 60, TRUE)
to_chat(src, "<span class='userdanger'>SYSTEM ERROR: Module 2 OFFLINE.</span>")
if(health < -50)
if(uneq_module(module_state_1))
if(makes_sound)
audible_message("<span class='warning'>[src] sounds an alarm! \"CRITICAL ERROR: All modules OFFLINE.\"</span>")
playsound(loc, 'sound/machines/warning-buzzer.ogg', 75, TRUE)
to_chat(src, "<span class='userdanger'>CRITICAL ERROR: All modules OFFLINE.</span>")
@@ -1,12 +1,6 @@
/mob/living/silicon/robot/updatehealth(reason = "none given")
if(status_flags & GODMODE)
health = maxHealth
stat = CONSCIOUS
return
health = maxHealth - (getOxyLoss() + getFireLoss() + getBruteLoss())
update_stat("updatehealth([reason])")
handle_hud_icons_health()
diag_hud_set_health()
..(reason)
check_module_damage()
/mob/living/silicon/robot/getBruteLoss(repairable_only = FALSE)
var/amount = 0
@@ -72,7 +66,7 @@
/mob/living/silicon/robot/heal_organ_damage(brute, burn, updating_health = TRUE)
var/list/datum/robot_component/parts = get_damaged_components(brute, burn)
if(!LAZYLEN(parts))
if(!LAZYLEN(parts))
return
var/datum/robot_component/picked = pick(parts)
picked.heal_damage(brute, burn, updating_health)
@@ -17,10 +17,12 @@
if(!is_component_functioning("actuator") || !is_component_functioning("power cell") || paralysis || sleeping || resting || stunned || IsWeakened() || getOxyLoss() > maxHealth * 0.5)
if(stat == CONSCIOUS)
KnockOut()
update_headlamp()
create_debug_log("fell unconscious, trigger reason: [reason]")
else
if(stat == UNCONSCIOUS)
WakeUp()
update_headlamp()
create_debug_log("woke up, trigger reason: [reason]")
else
if(health > 0)
@@ -31,9 +33,10 @@
ghost << sound('sound/effects/genetics.ogg')
create_attack_log("revived, trigger reason: [reason]")
create_log(MISC_LOG, "revived, trigger reason: [reason]")
// diag_hud_set_status()
// diag_hud_set_health()
// update_health_hud()
diag_hud_set_status()
diag_hud_set_health()
update_health_hud()
/mob/living/silicon/robot/SetStunned(amount, updating = 1, force = 0) //if you REALLY need to set stun to a set amount without the whole "can't go below current stunned"
. = STATUS_UPDATE_CANMOVE
@@ -118,7 +118,7 @@
/mob/living/simple_animal/blob_act(obj/structure/blob/B)
adjustBruteLoss(20)
/mob/living/simple_animal/do_attack_animation(atom/A, visual_effect_icon, used_item, no_effect, end_pixel_y)
/mob/living/simple_animal/do_attack_animation(atom/A, visual_effect_icon, used_item, no_effect)
if(!no_effect && !visual_effect_icon && melee_damage_upper)
if(melee_damage_upper < 10)
visual_effect_icon = ATTACK_EFFECT_PUNCH
@@ -1031,20 +1031,6 @@ Pass a positive integer as an argument to override a bot's default speed.
Radio.talk_into(src, message, message_mode, verb, speaking)
used_radios += Radio
/mob/living/simple_animal/bot/handle_hud_icons_health()
..()
switch(bodytemperature) //310.055 optimal body temp
if(335 to INFINITY)
throw_alert("temp", /obj/screen/alert/hot/robot, 2)
if(320 to 335)
throw_alert("temp", /obj/screen/alert/hot/robot, 1)
if(300 to 320)
clear_alert("temp")
if(260 to 300)
throw_alert("temp", /obj/screen/alert/cold/robot, 1)
else
throw_alert("temp", /obj/screen/alert/cold/robot, 2)
/mob/living/simple_animal/bot/is_mechanical()
return 1
@@ -391,8 +391,6 @@
passenger = M
load = M
can_buckle = FALSE
// Not sure why this is done
reset_perspective(src)
return TRUE
return FALSE
@@ -417,9 +415,6 @@
overlays.Cut()
if(ismob(load))
var/mob/M = load
M.reset_perspective(null)
unbuckle_all_mobs()
if(load)
@@ -446,9 +441,6 @@
AM.layer = initial(AM.layer)
AM.pixel_y = initial(AM.pixel_y)
AM.plane = initial(AM.plane)
if(ismob(AM))
var/mob/M = AM
M.reset_perspective(null)
/mob/living/simple_animal/bot/mulebot/call_bot()
..()
@@ -333,73 +333,116 @@
///ui stuff
/mob/living/simple_animal/hostile/construct/armoured/handle_hud_icons_health()
..()
/mob/living/simple_animal/hostile/construct/armoured/update_health_hud()
if(!client)
return
if(healths)
switch(health)
if(250 to INFINITY) healths.icon_state = "juggernaut_health0"
if(208 to 249) healths.icon_state = "juggernaut_health1"
if(167 to 207) healths.icon_state = "juggernaut_health2"
if(125 to 166) healths.icon_state = "juggernaut_health3"
if(84 to 124) healths.icon_state = "juggernaut_health4"
if(42 to 83) healths.icon_state = "juggernaut_health5"
if(1 to 41) healths.icon_state = "juggernaut_health6"
else healths.icon_state = "juggernaut_health7"
if(250 to INFINITY)
healths.icon_state = "juggernaut_health0"
if(208 to 249)
healths.icon_state = "juggernaut_health1"
if(167 to 207)
healths.icon_state = "juggernaut_health2"
if(125 to 166)
healths.icon_state = "juggernaut_health3"
if(84 to 124)
healths.icon_state = "juggernaut_health4"
if(42 to 83)
healths.icon_state = "juggernaut_health5"
if(1 to 41)
healths.icon_state = "juggernaut_health6"
else
healths.icon_state = "juggernaut_health7"
/mob/living/simple_animal/hostile/construct/behemoth/handle_hud_icons_health()
..()
/mob/living/simple_animal/hostile/construct/behemoth/update_health_hud()
if(!client)
return
if(healths)
switch(health)
if(750 to INFINITY) healths.icon_state = "juggernaut_health0"
if(625 to 749) healths.icon_state = "juggernaut_health1"
if(500 to 624) healths.icon_state = "juggernaut_health2"
if(375 to 499) healths.icon_state = "juggernaut_health3"
if(250 to 374) healths.icon_state = "juggernaut_health4"
if(125 to 249) healths.icon_state = "juggernaut_health5"
if(1 to 124) healths.icon_state = "juggernaut_health6"
else healths.icon_state = "juggernaut_health7"
if(750 to INFINITY)
healths.icon_state = "juggernaut_health0"
if(625 to 749)
healths.icon_state = "juggernaut_health1"
if(500 to 624)
healths.icon_state = "juggernaut_health2"
if(375 to 499)
healths.icon_state = "juggernaut_health3"
if(250 to 374)
healths.icon_state = "juggernaut_health4"
if(125 to 249)
healths.icon_state = "juggernaut_health5"
if(1 to 124)
healths.icon_state = "juggernaut_health6"
else
healths.icon_state = "juggernaut_health7"
/mob/living/simple_animal/hostile/construct/builder/handle_hud_icons_health()
..()
/mob/living/simple_animal/hostile/construct/builder/update_health_hud()
if(!client)
return
if(healths)
switch(health)
if(50 to INFINITY) healths.icon_state = "artificer_health0"
if(42 to 49) healths.icon_state = "artificer_health1"
if(34 to 41) healths.icon_state = "artificer_health2"
if(26 to 33) healths.icon_state = "artificer_health3"
if(18 to 25) healths.icon_state = "artificer_health4"
if(10 to 17) healths.icon_state = "artificer_health5"
if(1 to 9) healths.icon_state = "artificer_health6"
else healths.icon_state = "artificer_health7"
if(50 to INFINITY)
healths.icon_state = "artificer_health0"
if(42 to 49)
healths.icon_state = "artificer_health1"
if(34 to 41)
healths.icon_state = "artificer_health2"
if(26 to 33)
healths.icon_state = "artificer_health3"
if(18 to 25)
healths.icon_state = "artificer_health4"
if(10 to 17)
healths.icon_state = "artificer_health5"
if(1 to 9)
healths.icon_state = "artificer_health6"
else
healths.icon_state = "artificer_health7"
/mob/living/simple_animal/hostile/construct/wraith/handle_hud_icons_health()
..()
/mob/living/simple_animal/hostile/construct/wraith/update_health_hud()
if(!client)
return
if(healths)
switch(health)
if(75 to INFINITY) healths.icon_state = "wraith_health0"
if(62 to 74) healths.icon_state = "wraith_health1"
if(50 to 61) healths.icon_state = "wraith_health2"
if(37 to 49) healths.icon_state = "wraith_health3"
if(25 to 36) healths.icon_state = "wraith_health4"
if(12 to 24) healths.icon_state = "wraith_health5"
if(1 to 11) healths.icon_state = "wraith_health6"
else healths.icon_state = "wraith_health7"
if(75 to INFINITY)
healths.icon_state = "wraith_health0"
if(62 to 74)
healths.icon_state = "wraith_health1"
if(50 to 61)
healths.icon_state = "wraith_health2"
if(37 to 49)
healths.icon_state = "wraith_health3"
if(25 to 36)
healths.icon_state = "wraith_health4"
if(12 to 24)
healths.icon_state = "wraith_health5"
if(1 to 11)
healths.icon_state = "wraith_health6"
else
healths.icon_state = "wraith_health7"
/mob/living/simple_animal/hostile/construct/harvester/handle_hud_icons_health()
..()
/mob/living/simple_animal/hostile/construct/harvester/update_health_hud()
if(!client)
return
if(healths)
switch(health)
if(150 to INFINITY) healths.icon_state = "harvester_health0"
if(125 to 149) healths.icon_state = "harvester_health1"
if(100 to 124) healths.icon_state = "harvester_health2"
if(75 to 99) healths.icon_state = "harvester_health3"
if(50 to 74) healths.icon_state = "harvester_health4"
if(25 to 49) healths.icon_state = "harvester_health5"
if(1 to 24) healths.icon_state = "harvester_health6"
else healths.icon_state = "harvester_health7"
if(150 to INFINITY)
healths.icon_state = "harvester_health0"
if(125 to 149)
healths.icon_state = "harvester_health1"
if(100 to 124)
healths.icon_state = "harvester_health2"
if(75 to 99)
healths.icon_state = "harvester_health3"
if(50 to 74)
healths.icon_state = "harvester_health4"
if(25 to 49)
healths.icon_state = "harvester_health5"
if(1 to 24)
healths.icon_state = "harvester_health6"
else
healths.icon_state = "harvester_health7"
@@ -3,7 +3,7 @@
if(status_flags & GODMODE)
return FALSE
var/oldbruteloss = bruteloss
bruteloss = Clamp(bruteloss + amount, 0, maxHealth)
bruteloss = clamp(bruteloss + amount, 0, maxHealth)
if(oldbruteloss == bruteloss)
updating_health = FALSE
. = STATUS_UPDATE_NONE
@@ -153,16 +153,16 @@
if(def_zone)
if(def_zone == "head")
if(inventory_head)
armorval = inventory_head.armor[type]
armorval = inventory_head.armor.getRating(type)
else
if(inventory_back)
armorval = inventory_back.armor[type]
armorval = inventory_back.armor.getRating(type)
return armorval
else
if(inventory_head)
armorval += inventory_head.armor[type]
armorval += inventory_head.armor.getRating(type)
if(inventory_back)
armorval += inventory_back.armor[type]
armorval += inventory_back.armor.getRating(type)
return armorval * 0.5
/mob/living/simple_animal/pet/dog/corgi/attackby(obj/item/O, mob/user, params)
@@ -18,7 +18,7 @@
/mob/living/simple_animal/pet/penguin/Initialize(mapload)
. = ..()
AddComponent(/datum/component/waddling)
AddElement(/datum/element/waddling)
/mob/living/simple_animal/pet/penguin/emperor
name = "Emperor penguin"
@@ -123,8 +123,6 @@
if(health >= maxHealth)
to_chat(user, "<span class='warning'>[src] does not need repairing!</span>")
return
to_chat(user, "<span class='warning'>Unable to repair with the maintenance panel closed!</span>")
return
. = TRUE
if(!I.use_tool(src, user, volume = I.tool_volume))
return
@@ -153,7 +153,7 @@
icon_dead = "maid_dead"
/mob/living/simple_animal/hostile/alien/maid/AttackingTarget()
if(ismovableatom(target))
if(ismovable(target))
if(istype(target, /obj/effect/decal/cleanable))
visible_message("<span class='notice'>\The [src] cleans up \the [target].</span>")
qdel(target)
@@ -60,6 +60,7 @@
/mob/living/simple_animal/hostile/poison/bees/New()
..()
generate_bee_visuals()
AddComponent(/datum/component/swarming)
/mob/living/simple_animal/hostile/poison/bees/Destroy()
beegent = null
@@ -62,8 +62,8 @@
is_zombie = TRUE
if(H.wear_suit)
var/obj/item/clothing/suit/armor/A = H.wear_suit
if(A.armor && A.armor["melee"])
maxHealth += A.armor["melee"] //That zombie's got armor, I want armor!
if(A.armor && A.armor.getRating("melee"))
maxHealth += A.armor.getRating("melee") //That zombie's got armor, I want armor!
maxHealth += 200
health = maxHealth
name = "zombie"
@@ -79,7 +79,7 @@ Difficulty: Hard
/mob/living/simple_animal/hostile/megafauna/bubblegum/Initialize(mapload)
. = ..()
if(true_spawn)
for(var/mob/living/simple_animal/hostile/megafauna/bubblegum/B in GLOB.living_mob_list)
for(var/mob/living/simple_animal/hostile/megafauna/bubblegum/B in GLOB.alive_mob_list)
if(B != src)
qdel(src) //There can be only one
return
@@ -116,8 +116,8 @@ Difficulty: Hard
if(charging)
return
anger_modifier = Clamp(((maxHealth - health)/60),0,20)
enrage_time = initial(enrage_time) * Clamp(anger_modifier / 20, 0.5, 1)
anger_modifier = clamp(((maxHealth - health)/60),0,20)
enrage_time = initial(enrage_time) * clamp(anger_modifier / 20, 0.5, 1)
ranged_cooldown = world.time + 50
if(client)
@@ -83,7 +83,7 @@ Difficulty: Very Hard
chosen_attack_num = 4
/mob/living/simple_animal/hostile/megafauna/colossus/OpenFire()
anger_modifier = Clamp(((maxHealth - health)/50),0,20)
anger_modifier = clamp(((maxHealth - health)/50),0,20)
ranged_cooldown = world.time + 120
if(client)
@@ -103,7 +103,7 @@ Difficulty: Medium
if(swooping)
return
anger_modifier = Clamp(((maxHealth - health)/50),0,20)
anger_modifier = clamp(((maxHealth - health)/50),0,20)
ranged_cooldown = world.time + ranged_cooldown_time
if(client)
@@ -254,7 +254,7 @@ Difficulty: Medium
/mob/living/simple_animal/hostile/megafauna/dragon/proc/line_target(var/offset, var/range, var/atom/at = target)
if(!at)
return
var/angle = Atan2(at.x - src.x, at.y - src.y) + offset
var/angle = ATAN2(at.x - src.x, at.y - src.y) + offset
var/turf/T = get_turf(src)
for(var/i in 1 to range)
var/turf/check = locate(src.x + cos(angle) * i, src.y + sin(angle) * i, src.z)
@@ -344,10 +344,10 @@ Difficulty: Medium
//ensure swoop direction continuity.
if(negative)
if(IsInRange(x, initial_x + 1, initial_x + DRAKE_SWOOP_DIRECTION_CHANGE_RANGE))
if(ISINRANGE(x, initial_x + 1, initial_x + DRAKE_SWOOP_DIRECTION_CHANGE_RANGE))
negative = FALSE
else
if(IsInRange(x, initial_x - DRAKE_SWOOP_DIRECTION_CHANGE_RANGE, initial_x - 1))
if(ISINRANGE(x, initial_x - DRAKE_SWOOP_DIRECTION_CHANGE_RANGE, initial_x - 1))
negative = TRUE
new /obj/effect/temp_visual/dragon_flight/end(loc, negative)
new /obj/effect/temp_visual/dragon_swoop(loc)
@@ -452,6 +452,7 @@ Difficulty: Hard
else
burst_range = 3
INVOKE_ASYNC(src, .proc/burst, get_turf(src), 0.25) //melee attacks on living mobs cause it to release a fast burst if on cooldown
OpenFire()
else
devour(L)
else
@@ -481,7 +482,7 @@ Difficulty: Hard
/mob/living/simple_animal/hostile/megafauna/hierophant/proc/calculate_rage() //how angry we are overall
did_reset = FALSE //oh hey we're doing SOMETHING, clearly we might need to heal if we recall
anger_modifier = Clamp(((maxHealth - health) / 42),0,50)
anger_modifier = clamp(((maxHealth - health) / 42),0,50)
burst_range = initial(burst_range) + round(anger_modifier * 0.08)
beam_range = initial(beam_range) + round(anger_modifier * 0.12)
@@ -43,7 +43,6 @@
. = ..()
if(internal_type && true_spawn)
internal = new internal_type(src)
apply_status_effect(STATUS_EFFECT_CRUSHERDAMAGETRACKING)
for(var/action_type in attack_action_types)
var/datum/action/innate/megafauna_attack/attack_action = new action_type()
attack_action.Grant(src)
@@ -90,6 +90,7 @@
/mob/living/simple_animal/hostile/asteroid/hivelordbrood/Initialize(mapload)
. = ..()
addtimer(CALLBACK(src, .proc/death), 100)
AddComponent(/datum/component/swarming)
/mob/living/simple_animal/hostile/asteroid/hivelordbrood/blood
@@ -23,10 +23,6 @@
var/icon_aggro = null
var/crusher_drop_mod = 25
/mob/living/simple_animal/hostile/asteroid/Initialize(mapload)
. = ..()
apply_status_effect(STATUS_EFFECT_CRUSHERDAMAGETRACKING)
/mob/living/simple_animal/hostile/asteroid/Aggro()
..()
if(vision_range != aggro_vision_range)
@@ -335,7 +335,7 @@
//Jiggle the whole worm forwards towards the next segment
/mob/living/simple_animal/hostile/spaceWorm/do_attack_animation(atom/A, visual_effect_icon, used_item, no_effect, end_pixel_y)
/mob/living/simple_animal/hostile/spaceWorm/do_attack_animation(atom/A, visual_effect_icon, used_item, no_effect)
..()
if(previousWorm)
previousWorm.do_attack_animation(src)
@@ -180,7 +180,7 @@
range = 10
/obj/effect/proc_holder/spell/aoe_turf/blindness/cast(list/targets, mob/user = usr)
for(var/mob/living/L in GLOB.living_mob_list)
for(var/mob/living/L in GLOB.alive_mob_list)
if(L == user)
continue
var/turf/T = get_turf(L.loc)
@@ -281,7 +281,7 @@
/mob/living/simple_animal/hostile/syndicate/melee/autogib/depot/armory/LateInitialize()
if(istype(depotarea))
var/list/key_candidates = list()
for(var/mob/living/simple_animal/hostile/syndicate/melee/autogib/depot/officer/O in GLOB.living_mob_list)
for(var/mob/living/simple_animal/hostile/syndicate/melee/autogib/depot/officer/O in GLOB.alive_mob_list)
key_candidates += O
if(key_candidates.len)
var/mob/living/simple_animal/hostile/syndicate/melee/autogib/depot/officer/O = pick(key_candidates)
@@ -349,7 +349,8 @@
icon = 'icons/mob/critter.dmi'
icon_state = "viscerator_attack"
icon_living = "viscerator_attack"
pass_flags = PASSTABLE
pass_flags = PASSTABLE | PASSMOB
a_intent = INTENT_HARM
health = 15
maxHealth = 15
obj_damage = 0
@@ -365,3 +366,7 @@
gold_core_spawnable = HOSTILE_SPAWN
del_on_death = 1
deathmessage = "is smashed into pieces!"
/mob/living/simple_animal/hostile/viscerator/Initialize(mapload)
. = ..()
AddComponent(/datum/component/swarming)
@@ -38,9 +38,12 @@
evolvequeen_action.Grant(src)
/mob/living/simple_animal/hostile/poison/terror_spider/princess/proc/evolve_to_queen()
var/mob/living/simple_animal/hostile/poison/terror_spider/queen/Q = new /mob/living/simple_animal/hostile/poison/terror_spider/queen(loc)
var/mob/living/simple_animal/hostile/poison/terror_spider/queen/Q = new(loc)
if(mind)
mind.transfer_to(Q)
// Calling `transfer_to()` removes our new body (the Queen's) ability to see the med hud, so we have to re-add the queen here.
var/datum/atom_hud/U = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
U.add_hud_to(Q)
qdel(src)
/mob/living/simple_animal/hostile/poison/terror_spider/princess/DoWrap()
@@ -168,7 +168,7 @@
neststep = 4
else
spider_lastspawn = world.time
var/spiders_left_to_spawn = Clamp( (spider_max_per_nest - CountSpiders()), 1, 10)
var/spiders_left_to_spawn = clamp( (spider_max_per_nest - CountSpiders()), 1, 10)
DoLayTerrorEggs(pick(spider_types_standard), spiders_left_to_spawn)
if(4)
// Nest should be full. Otherwise, start replenishing nest (stage 5).
@@ -27,7 +27,7 @@
. += "<span class='warning'>[src] appears to be having trouble staying afloat!</span>"
/mob/living/simple_animal/possessed_object/do_attack_animation(atom/A, visual_effect_icon, used_item, no_effect, end_pixel_y)
/mob/living/simple_animal/possessed_object/do_attack_animation(atom/A, visual_effect_icon, used_item, no_effect)
..()
animate_ghostly_presence(src, -1, 20, 1) // Restart the floating animation after the attack animation, as it will be cancelled.

Some files were not shown because too many files have changed in this diff Show More