From e3bbcb0f7f124eb46f1a70d030cc4c2aff8656ac Mon Sep 17 00:00:00 2001 From: phil235 Date: Sun, 14 Feb 2016 15:26:46 +0100 Subject: [PATCH] Fixes revive() not properly removing the blind overlay. (fixes staff of healing) Fixes revive() working on brainless carbons, making them die right away. It now only heals the body but doesn't actually make the mob alive again. Fixes dead mob put into closet and then revived not seeing the closet vision overlay. Fixes brain mob's emp_damage never decreasing when stat == DEAD. Fixes posibrain's brainmob starting dead. Fixes ai fixing not clearing the blind overlay properly. Fireball projectile no longer explodes on the firer when there's a body on their tile. The fireball's range() code now only checks the two tiles on its front left and front right for mobs to hit. Remove some update_vision_overlays() (now unused) that I forgot to remove. Using a staff oh healing on a corpse with a damaged brain organ will revive the mob and heal the brain organ. --- code/game/machinery/computer/aifixer.dm | 11 +++++----- .../structures/crates_lockers/closets.dm | 2 +- code/game/objects/structures/morgue.dm | 2 +- code/modules/mob/living/carbon/brain/life.dm | 21 +++++++++++++++++-- .../mob/living/carbon/brain/posibrain.dm | 8 +++---- code/modules/mob/living/carbon/carbon.dm | 11 ++++++---- code/modules/mob/living/living.dm | 12 ++++------- code/modules/mob/living/silicon/ai/ai.dm | 14 ------------- .../modules/mob/living/silicon/robot/robot.dm | 19 ----------------- code/modules/projectiles/projectile/magic.dm | 8 ++++++- code/modules/recycling/disposal-unit.dm | 2 +- 11 files changed, 50 insertions(+), 60 deletions(-) diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm index 607f4ea040d..e05c4b5fe5a 100644 --- a/code/game/machinery/computer/aifixer.dm +++ b/code/game/machinery/computer/aifixer.dm @@ -85,13 +85,14 @@ if (href_list["fix"]) src.active = 1 while (src.occupier.health < 100) - src.occupier.adjustOxyLoss(-1) - src.occupier.adjustFireLoss(-1) - src.occupier.adjustToxLoss(-1) - src.occupier.adjustBruteLoss(-1) + src.occupier.adjustOxyLoss(-1, 0) + src.occupier.adjustFireLoss(-1, 0) + src.occupier.adjustToxLoss(-1, 0) + src.occupier.adjustBruteLoss(-1, 0) src.occupier.updatehealth() if (src.occupier.health >= 0 && src.occupier.stat == 2) - src.occupier.stat = 0 + src.occupier.stat = CONSCIOUS + src.occupier.adjust_blindness(-1) src.occupier.lying = 0 dead_mob_list -= src.occupier living_mob_list += src.occupier diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index f0e8a69813f..ed7c1c99d0d 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -367,7 +367,7 @@ update_icon() /obj/structure/closet/get_remote_view_fullscreens(mob/user) - if(!(user.sight & (SEEOBJS|SEEMOBS))) + if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS))) user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 1) /obj/structure/closet/emp_act(severity) diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 45c311f7098..48a2b4be107 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -93,7 +93,7 @@ update_icon() /obj/structure/bodycontainer/get_remote_view_fullscreens(mob/user) - if(!(user.sight & (SEEOBJS|SEEMOBS))) + if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS))) user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 2) /* * Morgue diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index fea3ed691e1..f07c18fa13b 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -1,4 +1,15 @@ +/mob/living/carbon/brain/Life() + set invisibility = 0 + set background = BACKGROUND_ENABLED + + if (notransform) + return + if(!loc) + return + . = ..() + handle_emp_damage() + /mob/living/carbon/brain/handle_breathing() return @@ -30,9 +41,15 @@ death() */ -/mob/living/carbon/brain/handle_status_effects() +/mob/living/carbon/brain/proc/handle_emp_damage() if(emp_damage) - emp_damage = max(emp_damage-1, 0) + if(stat == DEAD) + emp_damage = 0 + else + emp_damage = max(emp_damage-1, 0) + +/mob/living/carbon/brain/handle_status_effects() + return /mob/living/carbon/brain/handle_disabilities() return diff --git a/code/modules/mob/living/carbon/brain/posibrain.dm b/code/modules/mob/living/carbon/brain/posibrain.dm index 73b041187be..3dbb25fd26f 100644 --- a/code/modules/mob/living/carbon/brain/posibrain.dm +++ b/code/modules/mob/living/carbon/brain/posibrain.dm @@ -39,7 +39,7 @@ var/global/posibrain_notif_cooldown = 0 spawn(askDelay) //Seperate from the global cooldown. notified = 0 update_icon() - if(brainmob.stat == CONSCIOUS && brainmob.client) + if(brainmob.client) visible_message("The positronic brain pings, and its lights start flashing. Success!") else visible_message("The positronic brain buzzes quietly, and the golden lights fade away. Perhaps you could try again?") @@ -99,6 +99,9 @@ var/global/posibrain_notif_cooldown = 0 brainmob << "As a synthetic intelligence, you answer to all crewmembers, as well as the AI." brainmob << "Remember, the purpose of your existence is to serve the crew and the station. Above all else, do no harm." brainmob.mind.assigned_role = "Positronic Brain" + brainmob.stat = CONSCIOUS + dead_mob_list -= brainmob + living_mob_list += brainmob visible_message("The positronic brain chimes quietly.") update_icon() @@ -123,8 +126,6 @@ var/global/posibrain_notif_cooldown = 0 if(CONSCIOUS) if(!src.brainmob.client) msg += "It appears to be in stand-by mode.\n" //afk - if(UNCONSCIOUS) - msg += "It doesn't seem to be responsive.\n" if(DEAD) msg += "It appears to be completely inactive.\n" else @@ -139,7 +140,6 @@ var/global/posibrain_notif_cooldown = 0 brainmob.real_name = brainmob.name brainmob.loc = src brainmob.container = src - dead_mob_list -= brainmob ping_ghosts("created") ..() diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index f4a47adc483..1e6601d4c85 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -690,10 +690,7 @@ var/const/GALOSHES_DONT_HELP = 4 radiation = 0 nutrition = NUTRITION_LEVEL_FED + 50 bodytemperature = 310 - eye_damage = 0 disabilities = 0 - eye_blind = 0 - eye_blurry = 0 ear_deaf = 0 ear_damage = 0 hallucination = 0 @@ -714,7 +711,13 @@ var/const/GALOSHES_DONT_HELP = 4 if(stat == DEAD) dead_mob_list -= src living_mob_list += src - stat = CONSCIOUS + var/obj/item/organ/internal/brain/BR = getorgan(/obj/item/organ/internal/brain) + if(BR) //can't revive if the mob has no brain + stat = CONSCIOUS + BR.damaged_brain = 0 //if the brain itself is damaged we heal it + set_blindness(0) + set_blurriness(0) + set_eye_damage(0) if(ishuman(src)) var/mob/living/carbon/human/human_mob = src human_mob.restore_blood() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 8235f9b02a7..f06d5f7fe8c 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -469,10 +469,7 @@ Sorry Giacom. Please don't be mad :( radiation = 0 nutrition = NUTRITION_LEVEL_FED + 50 bodytemperature = 310 - eye_damage = 0 disabilities = 0 - eye_blind = 0 - eye_blurry = 0 ear_deaf = 0 ear_damage = 0 hallucination = 0 @@ -484,6 +481,9 @@ Sorry Giacom. Please don't be mad :( dead_mob_list -= src living_mob_list += src stat = CONSCIOUS + set_blindness(0) + set_blurriness(0) + set_eye_damage(0) updatehealth() update_fire() regenerate_icons() @@ -962,7 +962,7 @@ Sorry Giacom. Please don't be mad :( src << "You're too exhausted to keep going..." Weaken(5) setStaminaLoss(health - 2) - update_health_hud() + update_health_hud() /mob/proc/update_sight() return @@ -1102,10 +1102,6 @@ Sorry Giacom. Please don't be mad :( clear_fullscreen("high") clear_alert("high") - -/mob/proc/update_vision_overlays() - return - /mob/proc/cure_blind() //when we want to cure the BLIND disability only. return diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 7674171a8ae..fe19ba24ed9 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -890,17 +890,3 @@ var/list/ai_list = list() AT.get_remote_view_fullscreens(src) else clear_fullscreen("remote_view", 0) - - -/mob/living/silicon/ai/update_vision_overlays() - if(!client) - return - - if(stat == DEAD) //if dead we just remove all vision impairments - clear_fullscreens() - return - - if(eye_blind) - overlay_fullscreen("blind", /obj/screen/fullscreen/blind) - else - clear_fullscreen("blind") \ No newline at end of file diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index a81da477f77..e8047312618 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -1248,25 +1248,6 @@ update_canmove() update_headlamp() -/mob/living/silicon/robot/update_vision_overlays() - if(!client) - return - - if(stat == DEAD) //if dead we just remove all vision impairments - clear_fullscreens() - return - - if(eye_blind) - overlay_fullscreen("blind", /obj/screen/fullscreen/blind) - else - clear_fullscreen("blind") - - if(client.eye != src) - var/atom/A = client.eye - A.get_remote_view_fullscreens(src) - else - clear_fullscreen("remote_view", 0) - /mob/living/silicon/robot/fully_replace_character_name(oldname, newname) ..() if(oldname != real_name) diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm index 03859abea55..875cb94586d 100644 --- a/code/modules/projectiles/projectile/magic.dm +++ b/code/modules/projectiles/projectile/magic.dm @@ -25,10 +25,16 @@ nodamage = 0 /obj/item/projectile/magic/fireball/Range() - var/mob/living/L = locate(/mob/living) in (range(src, 1) - firer) + var/turf/T1 = get_step(src,turn(dir, -45)) + var/turf/T2 = get_step(src,turn(dir, 45)) + var/mob/living/L = locate(/mob/living) in T1 //if there's a mob alive in our front right diagonal, we hit it. if(L && L.stat != DEAD) Bump(L) //Magic Bullet #teachthecontroversy return + L = locate(/mob/living) in T2 + if(L && L.stat != DEAD) + Bump(L) + return ..() /obj/item/projectile/magic/fireball/on_hit(target) diff --git a/code/modules/recycling/disposal-unit.dm b/code/modules/recycling/disposal-unit.dm index a57c0dd2167..ff9539c7e94 100644 --- a/code/modules/recycling/disposal-unit.dm +++ b/code/modules/recycling/disposal-unit.dm @@ -476,7 +476,7 @@ return /obj/machinery/disposal/bin/get_remote_view_fullscreens(mob/user) - if(!(user.sight & (SEEOBJS|SEEMOBS))) + if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS))) user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 2)