From 81ce777ec26eaa42a4b6aa101124bf4658f256ed Mon Sep 17 00:00:00 2001 From: phil235 Date: Thu, 4 Feb 2016 00:33:16 +0100 Subject: [PATCH] - you now only see turfs when inside gas pipes. - I renamed some vars of datum/hud to be more selfexplanatory - Moved all datum/hud mob code into the hud folder. - fixed alien's zone selection button not using the correct sprites. - I removed the update_hud() proc (that needed to be removed). - Fixed a typo in /mob/living/carbon/ContractDisease , using "internals" instead of "internal" (very different things) - Fixed doTeleport() calling Entered() twice on the destination area. - To reference a mob's selected zone, you now use a direct mob var ("H.zone_selected" instead of "H.zone_sel.selecting") - mobs lose certain screen objects var ("healths", "zone_sel", "internals", etc) which are now vars of the mob's datum/hud instead. - the Blind spell is now done via the blind mutation instead of the blind disabilities. - Give to mobs a version of forceMove(), so the mob is always properly unbuckled, his pull stopped, his vision updated, etc. - The "user" var of mob/camera/aiEye/remote is renamed to "eye_user" to avoid confusion. - reset_view() is replaced by reset_perspective(). Now all changes to client.eye and client.perspective are done with this proc. - I reworked /obj/machinery/computer/security code, changing camera is instantaneous now, as well as cancelling. - I reworked /obj/machinery/computer/camera_advanced code as well. - I changed /obj/item/mecha_parts/mecha_equipment/mining_scanner's meson view to be constant instead of by intermittent. - Fixes not being able to use /obj/item/device/camera_bug while buckled. - removed admin_forcemove() proc, admin force moving now uses forceMove() simply. - Removed the client var "adminobs" - Added var/vision_correction to glasses. - Added a thermal_overload() proc for glasses, to remove copypasta in emp_act code. - Remove the hal_crit mob var - We no longer delete the mob's hud everytime he logs in. - Added a stat == dead check in mob's metabolize() so we immediately stop metabolizing if one of the chem kills the mob. - Being inside disposal bin lowers your vision, like wearing a welding helmet. - removed the remote_view mob var. - I changed advanced camera EYE, some fixes, removed unnecessary code when the eye moves, now the mob client eye properly follows the camera mob. - fixes mob var "machine" not being nullified on logout. - larva/death() was calling two "living_mob_list -= src" - I made the Blind screen objects into a global_hud instead of giving one to each mob (like damage overlay). - I untied tint and eye_blind, TINT_BLIND doesn't give you eye_blind=1. - gave a visual overlay when inside locker (vimpaired) - when inside disposal/gas pipes you get sight |= (BLIND|SEE_TURFS) - glasses toggling updates (atmos meson toggle): DONE - The new adjust procs serve to properly change eye_blind etc and call vision update procs when needed. - I added an on_unset_machine() proc to handle perspective reset for camera consoles. - I moved consequences of eye_check fail inside eye_check() procs themselves. - I fixed vision updates being fucked by forceMove, especially pipe vision. - I decided that damage overlay not appearing when dead. - mob's hud_used is no longer deleted on each login() - I refactored mob huds a bit, creating subtypes for each mob (/datum/hud/human) - f12's hud toggling is now available to all mobs - gave borgs a low_power_mode var so unpowered borg do not use stat= UNCONSCIOUS (which made things weird since you were unconscious but not blind) - Fixed double Area entering when forced teleporting. - I fixed larva pulling not being broken when cuffing them, and larva not seeing handcuff alert (and they can resist by clicking it) - I removed pull updates from life() since it onyl checked for puller's incapacitation. - I renamed camera/deactivate() to toggle_cam() to be more accurate. - I fixed mmi brain being immortal (by removing the brain and putting it back) - I simplified mmi brain emp damage. --- code/ATMOSPHERICS/atmospherics.dm | 31 +- .../components/unary_devices/cryo.dm | 5 +- code/__DEFINES/clothing.dm | 5 +- code/__DEFINES/sight.dm | 10 +- code/_onclick/hud/ai.dm | 42 +-- code/_onclick/hud/alert.dm | 14 +- code/_onclick/hud/alien.dm | 116 +++--- code/_onclick/hud/alien_larva.dm | 58 +-- code/_onclick/hud/blob_overmind.dm | 151 ++++++++ code/_onclick/hud/drones.dm | 73 ++-- code/_onclick/hud/ghost.dm | 28 +- code/_onclick/hud/guardian.dm | 85 +++++ code/_onclick/hud/hud.dm | 235 +++++------- code/_onclick/hud/human.dm | 233 +++++++----- code/_onclick/hud/monkey.dm | 142 ++++---- code/_onclick/hud/other_mobs.dm | 63 ++-- code/_onclick/hud/robot.dm | 182 +++++----- code/_onclick/hud/screen_objects.dm | 70 +++- code/_onclick/hud/swarmer.dm | 97 +++++ code/controllers/subsystem/jobs.dm | 2 - code/datums/diseases/_MobProcs.dm | 2 +- .../diseases/advance/symptoms/vision.dm | 20 +- .../diseases/advance/symptoms/weakness.dm | 2 +- code/datums/diseases/tuberculosis.dm | 2 +- code/datums/helper_datums/teleport.dm | 11 - code/datums/martial.dm | 8 +- code/datums/mutations.dm | 22 +- code/datums/spells/inflict_handler.dm | 4 +- code/datums/spells/wizard.dm | 2 +- code/datums/wires/robot.dm | 7 +- code/game/atoms.dm | 11 +- code/game/atoms_movable.dm | 35 +- code/game/data_huds.dm | 7 +- code/game/gamemodes/blob/blobs/core.dm | 4 +- code/game/gamemodes/blob/overmind.dm | 161 +-------- .../gamemodes/changeling/powers/adrenaline.dm | 4 +- .../changeling/powers/augmented_eyesight.dm | 5 +- .../gamemodes/changeling/powers/fakedeath.dm | 1 + .../gamemodes/changeling/powers/headcrab.dm | 4 +- .../changeling/powers/horror_form.dm | 28 ++ .../gamemodes/changeling/powers/revive.dm | 24 +- .../gamemodes/changeling/powers/swap_forms.dm | 53 +++ .../changeling/powers/synaptic_enhancement.dm | 20 + .../gamemodes/changeling/powers/tiny_prick.dm | 8 +- code/game/gamemodes/cult/runes.dm | 9 +- code/game/gamemodes/handofgod/god.dm | 10 +- .../gamemodes/malfunction/Malf_Modules.dm | 2 +- .../miniantags/abduction/abduction_gear.dm | 10 +- .../miniantags/abduction/machinery/camera.dm | 6 +- .../gamemodes/miniantags/bot_swarm/swarmer.dm | 101 +----- code/game/gamemodes/sandbox/h_sandbox.dm | 3 +- .../shadowling/shadowling_abilities.dm | 5 +- code/game/gamemodes/wizard/artefact.dm | 16 +- code/game/gamemodes/wizard/raginmages.dm | 8 +- code/game/gamemodes/wizard/spellbook.dm | 2 +- code/game/machinery/Sleeper.dm | 4 +- code/game/machinery/alarm.dm | 6 - code/game/machinery/camera/camera.dm | 33 +- code/game/machinery/cloning.dm | 4 +- code/game/machinery/computer/camera.dm | 195 ++++++---- .../machinery/computer/camera_advanced.dm | 106 +++--- code/game/machinery/computer/computer.dm | 5 - code/game/machinery/doors/airlock.dm | 2 +- code/game/machinery/machinery.dm | 15 +- code/game/machinery/portable_turret.dm | 6 +- code/game/machinery/rechargestation.dm | 6 +- code/game/machinery/suit_storage_unit.dm | 36 +- code/game/machinery/transformer.dm | 1 - .../mecha/equipment/tools/medical_tools.dm | 2 - .../mecha/equipment/tools/mining_tools.dm | 21 +- code/game/mecha/equipment/weapons/weapons.dm | 2 +- code/game/mecha/mecha.dm | 14 +- .../effects/effect_system/effects_smoke.dm | 2 +- code/game/objects/items.dm | 36 +- code/game/objects/items/crayons.dm | 4 +- code/game/objects/items/devices/camera_bug.dm | 21 +- .../objects/items/devices/chameleonproj.dm | 2 +- code/game/objects/items/devices/flashlight.dm | 6 +- .../objects/items/devices/laserpointer.dm | 2 +- .../objects/items/robot/robot_upgrades.dm | 7 +- code/game/objects/items/stacks/medical.dm | 2 +- .../game/objects/items/weapons/clown_items.dm | 2 +- code/game/objects/items/weapons/cosmetics.dm | 4 +- code/game/objects/items/weapons/defib.dm | 15 +- .../items/weapons/grenades/flashbang.dm | 2 +- code/game/objects/items/weapons/handcuffs.dm | 4 +- .../items/weapons/implants/implantchair.dm | 14 +- code/game/objects/items/weapons/kitchen.dm | 2 +- .../game/objects/items/weapons/tanks/tanks.dm | 7 +- code/game/objects/items/weapons/tools.dm | 6 +- code/game/objects/objs.dm | 8 +- .../structures/crates_lockers/closets.dm | 14 +- .../crates_lockers/closets/statue.dm | 8 +- code/game/objects/structures/morgue.dm | 4 +- code/game/objects/structures/tables_racks.dm | 1 + .../transit_tubes/transit_tube_pod.dm | 4 +- code/game/objects/structures/watercloset.dm | 5 +- code/modules/admin/verbs/adminjump.dm | 25 +- code/modules/admin/verbs/randomverbs.dm | 7 +- .../awaymissions/mission_code/wildwest.dm | 4 +- code/modules/client/client defines.dm | 2 +- code/modules/client/preferences_toggles.dm | 4 +- code/modules/clothing/clothing.dm | 7 +- .../clothing/glasses/engine_goggles.dm | 4 + code/modules/clothing/glasses/glasses.dm | 29 +- code/modules/clothing/glasses/hud.dm | 10 +- .../modules/clothing/spacesuits/chronosuit.dm | 12 +- code/modules/clothing/suits/armor.dm | 2 - code/modules/clothing/under/ties.dm | 2 +- code/modules/events/camerafailure.dm | 2 +- code/modules/flufftext/Hallucination.dm | 15 +- code/modules/food&drinks/drinks/drinks.dm | 2 +- .../food&drinks/drinks/drinks/bottle.dm | 2 +- .../food&drinks/kitchen machinery/gibber.dm | 4 +- code/modules/hydroponics/growninedible.dm | 2 +- code/modules/mob/camera/camera.dm | 2 +- code/modules/mob/dead/observer/observer.dm | 11 +- code/modules/mob/interactive.dm | 5 +- code/modules/mob/inventory.dm | 9 +- code/modules/mob/living/carbon/alien/alien.dm | 38 ++ .../mob/living/carbon/alien/alien_defense.dm | 2 +- .../carbon/alien/humanoid/caste/hunter.dm | 21 -- .../carbon/alien/humanoid/caste/praetorian.dm | 22 -- .../carbon/alien/humanoid/caste/sentinel.dm | 21 -- .../mob/living/carbon/alien/humanoid/death.dm | 9 +- .../mob/living/carbon/alien/humanoid/login.dm | 7 - .../mob/living/carbon/alien/humanoid/queen.dm | 21 -- .../carbon/alien/humanoid/update_icons.dm | 5 +- .../mob/living/carbon/alien/larva/death.dm | 10 +- .../mob/living/carbon/alien/larva/life.dm | 51 +-- .../living/carbon/alien/larva/update_icons.dm | 4 +- code/modules/mob/living/carbon/alien/life.dm | 30 -- .../modules/mob/living/carbon/alien/screen.dm | 3 - code/modules/mob/living/carbon/brain/MMI.dm | 29 +- code/modules/mob/living/carbon/brain/brain.dm | 15 +- .../mob/living/carbon/brain/brain_item.dm | 24 +- code/modules/mob/living/carbon/brain/death.dm | 20 +- code/modules/mob/living/carbon/brain/life.dm | 118 ++---- code/modules/mob/living/carbon/brain/login.dm | 2 - .../mob/living/carbon/brain/posibrain.dm | 4 +- code/modules/mob/living/carbon/carbon.dm | 329 +++++++++++++++-- .../mob/living/carbon/carbon_defines.dm | 2 + code/modules/mob/living/carbon/death.dm | 2 +- code/modules/mob/living/carbon/human/blood.dm | 2 +- code/modules/mob/living/carbon/human/death.dm | 11 +- code/modules/mob/living/carbon/human/human.dm | 110 +++++- .../living/carbon/human/human_attackalien.dm | 2 +- .../mob/living/carbon/human/human_damage.dm | 22 +- .../mob/living/carbon/human/human_defense.dm | 6 +- .../mob/living/carbon/human/human_defines.dm | 4 +- .../mob/living/carbon/human/human_helpers.dm | 16 - .../mob/living/carbon/human/inventory.dm | 21 +- code/modules/mob/living/carbon/human/life.dm | 41 +-- code/modules/mob/living/carbon/human/login.dm | 4 - .../mob/living/carbon/human/species.dm | 174 +++------ .../mob/living/carbon/human/species_types.dm | 2 - .../mob/living/carbon/human/update_icons.dm | 85 ++--- code/modules/mob/living/carbon/inventory.dm | 12 +- code/modules/mob/living/carbon/life.dm | 230 ++---------- .../modules/mob/living/carbon/monkey/death.dm | 8 +- code/modules/mob/living/carbon/monkey/life.dm | 7 - .../modules/mob/living/carbon/monkey/login.dm | 4 - .../mob/living/carbon/monkey/update_icons.dm | 53 ++- .../modules/mob/living/carbon/update_icons.dm | 79 ++-- code/modules/mob/living/damage_procs.dm | 2 +- code/modules/mob/living/death.dm | 21 +- code/modules/mob/living/emote.dm | 6 +- code/modules/mob/living/life.dm | 121 ++----- code/modules/mob/living/living.dm | 342 ++++++++++++++---- code/modules/mob/living/living_defines.dm | 2 + code/modules/mob/living/login.dm | 5 + code/modules/mob/living/silicon/ai/ai.dm | 74 ++-- code/modules/mob/living/silicon/ai/death.dm | 11 +- code/modules/mob/living/silicon/ai/examine.dm | 3 - code/modules/mob/living/silicon/ai/life.dm | 263 ++++++-------- code/modules/mob/living/silicon/ai/login.dm | 17 +- code/modules/mob/living/silicon/ai/logout.dm | 7 +- code/modules/mob/living/silicon/pai/death.dm | 13 +- code/modules/mob/living/silicon/pai/life.dm | 3 +- code/modules/mob/living/silicon/pai/pai.dm | 65 ---- .../modules/mob/living/silicon/robot/death.dm | 13 +- .../mob/living/silicon/robot/inventory.dm | 2 +- code/modules/mob/living/silicon/robot/life.dm | 145 ++------ .../modules/mob/living/silicon/robot/robot.dm | 102 +++++- code/modules/mob/living/silicon/silicon.dm | 5 +- .../mob/living/simple_animal/bot/ed209bot.dm | 2 +- .../mob/living/simple_animal/bot/secbot.dm | 2 +- .../mob/living/simple_animal/corpse.dm | 2 +- .../simple_animal/friendly/drone/_drone.dm | 19 +- .../friendly/drone/drones_as_items.dm | 2 +- .../friendly/drone/interaction.dm | 6 +- .../friendly/drone/visuals_icons.dm | 8 +- .../living/simple_animal/guardian/guardian.dm | 92 +---- .../living/simple_animal/hostile/statue.dm | 8 +- .../simple_animal/hostile/true_changeling.dm | 190 ++++++++++ .../mob/living/simple_animal/simple_animal.dm | 67 ++-- .../mob/living/simple_animal/slime/death.dm | 2 - .../mob/living/simple_animal/slime/life.dm | 8 +- code/modules/mob/living/ventcrawling.dm | 9 +- code/modules/mob/login.dm | 19 +- code/modules/mob/logout.dm | 1 + code/modules/mob/mob.dm | 98 +++-- code/modules/mob/mob_defines.dm | 16 +- code/modules/mob/mob_helpers.dm | 7 +- code/modules/mob/new_player/new_player.dm | 2 +- code/modules/mob/update_icons.dm | 3 - code/modules/ninja/ninja_event.dm | 3 +- .../suit/n_suit_verbs/ninja_adrenaline.dm | 1 - code/modules/paperwork/paper.dm | 1 + code/modules/power/cable.dm | 2 +- code/modules/projectiles/firing.dm | 2 +- code/modules/projectiles/gun.dm | 4 +- .../projectiles/guns/projectile/revolver.dm | 2 +- .../projectiles/guns/projectile/sniper.dm | 2 +- code/modules/reagents/chemistry/holder.dm | 37 +- .../chemistry/reagents/alcohol_reagents.dm | 9 +- .../chemistry/reagents/blob_reagents.dm | 2 +- .../chemistry/reagents/drink_reagents.dm | 68 ++-- .../chemistry/reagents/drug_reagents.dm | 4 +- .../chemistry/reagents/food_reagents.dm | 33 +- .../chemistry/reagents/medicine_reagents.dm | 43 ++- .../chemistry/reagents/toxin_reagents.dm | 24 +- code/modules/recycling/disposal-structures.dm | 35 +- code/modules/recycling/disposal-unit.dm | 14 +- .../research/xenobiology/xenobio_camera.dm | 6 +- code/modules/surgery/dethralling.dm | 2 +- code/modules/surgery/eye_surgery.dm | 9 +- code/modules/surgery/helpers.dm | 2 +- code/modules/surgery/limb augmentation.dm | 6 +- code/modules/surgery/organs/augments_eyes.dm | 21 +- code/modules/surgery/organs/organ_external.dm | 4 + .../modules/surgery/remove_embedded_object.dm | 6 +- code/modules/surgery/surgery.dm | 2 +- tgstation.dme | 11 +- 234 files changed, 3641 insertions(+), 3242 deletions(-) create mode 100644 code/_onclick/hud/blob_overmind.dm create mode 100644 code/_onclick/hud/guardian.dm create mode 100644 code/_onclick/hud/swarmer.dm create mode 100644 code/game/gamemodes/changeling/powers/horror_form.dm create mode 100644 code/game/gamemodes/changeling/powers/swap_forms.dm create mode 100644 code/game/gamemodes/changeling/powers/synaptic_enhancement.dm delete mode 100644 code/modules/mob/living/carbon/alien/humanoid/login.dm delete mode 100644 code/modules/mob/living/carbon/brain/login.dm delete mode 100644 code/modules/mob/living/carbon/human/login.dm delete mode 100644 code/modules/mob/living/carbon/monkey/login.dm create mode 100644 code/modules/mob/living/simple_animal/hostile/true_changeling.dm diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index f19d8df4217..8a4f8c19f7c 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -45,7 +45,6 @@ Pipelines + Other Objects -> Pipe network stored = null for(var/mob/living/L in src) - L.remove_ventcrawl() L.forceMove(get_turf(src)) if(pipe_vision_img) qdel(pipe_vision_img) @@ -243,22 +242,21 @@ Pipelines + Other Objects -> Pipe network var/obj/machinery/atmospherics/target_move = findConnecting(direction) if(target_move) - if(is_type_in_list(target_move, ventcrawl_machinery) && target_move.can_crawl_through()) - user.remove_ventcrawl() - user.forceMove(target_move.loc) //handle entering and so on. - user.visible_message("You hear something squeezing through the ducts...","You climb out the ventilation system.") - else if(target_move.can_crawl_through()) - var/list/pipenetdiff = returnPipenets() ^ target_move.returnPipenets() - if(pipenetdiff.len) - user.update_pipe_vision(target_move) - user.loc = target_move - user.client.eye = target_move //Byond only updates the eye every tick, This smooths out the movement - if(world.time - user.last_played_vent > VENT_SOUND_DELAY) - user.last_played_vent = world.time - playsound(src, 'sound/machines/ventcrawl.ogg', 50, 1, -3) + if(target_move.can_crawl_through()) + if(is_type_in_list(target_move, ventcrawl_machinery)) + user.forceMove(target_move.loc) //handle entering and so on. + user.visible_message("You hear something squeezing through the ducts...","You climb out the ventilation system.") + else + var/list/pipenetdiff = returnPipenets() ^ target_move.returnPipenets() + if(pipenetdiff.len) + user.update_pipe_vision(target_move) + user.loc = target_move + user.client.eye = target_move //Byond only updates the eye every tick, This smooths out the movement + if(world.time - user.last_played_vent > VENT_SOUND_DELAY) + user.last_played_vent = world.time + playsound(src, 'sound/machines/ventcrawl.ogg', 50, 1, -3) else if((direction & initialize_directions) || is_type_in_list(src, ventcrawl_machinery) && can_crawl_through()) //if we move in a way the pipe can connect, but doesn't - or we're in a vent - user.remove_ventcrawl() user.forceMove(src.loc) user.visible_message("You hear something squeezing through the ducts...","You climb out the ventilation system.") user.canmove = 0 @@ -279,3 +277,6 @@ Pipelines + Other Objects -> Pipe network /obj/machinery/atmospherics/proc/returnPipenets() return list() +/obj/machinery/atmospherics/update_remote_sight(mob/user) + user.sight |= (SEE_TURFS|BLIND) + user.update_pipe_vision(src) \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/unary_devices/cryo.dm b/code/ATMOSPHERICS/components/unary_devices/cryo.dm index 0e116e25725..a0295829ec8 100644 --- a/code/ATMOSPHERICS/components/unary_devices/cryo.dm +++ b/code/ATMOSPHERICS/components/unary_devices/cryo.dm @@ -264,10 +264,11 @@ occupant.bodytemperature += 2*(air_contents.temperature - occupant.bodytemperature) * current_heat_capacity / (current_heat_capacity + air_contents.heat_capacity()) occupant.bodytemperature = max(occupant.bodytemperature, air_contents.temperature) // this is so ugly i'm sorry for doing it i'll fix it later i promise //TODO: fix someone else's broken promise - duncathan if(occupant.bodytemperature < T0C) - occupant.sleeping = max(5 / efficiency, (1 / occupant.bodytemperature) * 2000 / efficiency) + occupant.Sleeping(max(5 / efficiency, (1 / occupant.bodytemperature) * 2000 / efficiency)) occupant.Paralyse(max(5 / efficiency, (1 / occupant.bodytemperature) * 3000 / efficiency)) if(air_contents.oxygen > 2) - if(occupant.getOxyLoss()) occupant.adjustOxyLoss(-1) + if(occupant.getOxyLoss()) + occupant.adjustOxyLoss(-1) else occupant.adjustOxyLoss(-1) // Severe damage should heal waaay slower without proper chemicals... diff --git a/code/__DEFINES/clothing.dm b/code/__DEFINES/clothing.dm index 8f6e457c2c5..2c695fbd327 100644 --- a/code/__DEFINES/clothing.dm +++ b/code/__DEFINES/clothing.dm @@ -94,4 +94,7 @@ #define MASKCOVERSEYES 2 // get rid of some of the other retardation in these flags #define HEADCOVERSEYES 4 // feel free to realloc these numbers for other purposes #define MASKCOVERSMOUTH 8 // on other items, these are just for mask/head -#define HEADCOVERSMOUTH 16 \ No newline at end of file +#define HEADCOVERSMOUTH 16 + +#define TINT_DARKENED 2 //Threshold of tint level to apply weld mask overlay +#define TINT_BLIND 3 //Threshold of tint level to obscure vision fully diff --git a/code/__DEFINES/sight.dm b/code/__DEFINES/sight.dm index 40c56793bac..1bbb24cf4cf 100644 --- a/code/__DEFINES/sight.dm +++ b/code/__DEFINES/sight.dm @@ -1,17 +1,17 @@ #define SEE_INVISIBLE_MINIMUM 5 -#define SEE_INVISIBLE_OBSERVER_NOLIGHTING 15 +#define SEE_INVISIBLE_NOLIGHTING 15 //to not see the lighting objects. Used for nightvision and observer with darkness toggled. #define INVISIBILITY_LIGHTING 20 #define SEE_INVISIBLE_LIVING 25 -#define SEE_INVISIBLE_LEVEL_ONE 35 //Used by some stuff in code. It's really poorly organized. -#define INVISIBILITY_LEVEL_ONE 35 //Used by some stuff in code. It's really poorly organized. +#define SEE_INVISIBLE_LEVEL_ONE 35 //currently unused +#define INVISIBILITY_LEVEL_ONE 35 //currently unused -#define SEE_INVISIBLE_LEVEL_TWO 45 //Used by some other stuff in code. It's really poorly organized. -#define INVISIBILITY_LEVEL_TWO 45 //Used by some other stuff in code. It's really poorly organized. +#define SEE_INVISIBLE_LEVEL_TWO 45 //currently unused +#define INVISIBILITY_LEVEL_TWO 45 //currently unused #define INVISIBILITY_OBSERVER 60 #define SEE_INVISIBLE_OBSERVER 60 diff --git a/code/_onclick/hud/ai.dm b/code/_onclick/hud/ai.dm index 16f91ef2ab3..350b813e56b 100644 --- a/code/_onclick/hud/ai.dm +++ b/code/_onclick/hud/ai.dm @@ -132,87 +132,87 @@ S.sensor_mode() -/datum/hud/proc/ai_hud() - adding = list() - other = list() - +/datum/hud/ai/New(mob/owner) + ..() var/obj/screen/using //AI core using = new /obj/screen/ai/aicore() using.screen_loc = ui_ai_core - adding += using + static_inventory += using //Camera list using = new /obj/screen/ai/camera_list() using.screen_loc = ui_ai_camera_list - adding += using + static_inventory += using //Track using = new /obj/screen/ai/camera_track() using.screen_loc = ui_ai_track_with_camera - adding += using + static_inventory += using //Camera light using = new /obj/screen/ai/camera_light() using.screen_loc = ui_ai_camera_light - adding += using + static_inventory += using //Crew Monitoring using = new /obj/screen/ai/crew_monitor() using.screen_loc = ui_ai_crew_monitor - adding += using + static_inventory += using //Crew Manifest using = new /obj/screen/ai/crew_manifest() using.screen_loc = ui_ai_crew_manifest - adding += using + static_inventory += using //Alerts using = new /obj/screen/ai/alerts() using.screen_loc = ui_ai_alerts - adding += using + static_inventory += using //Announcement using = new /obj/screen/ai/announcement() using.screen_loc = ui_ai_announcement - adding += using + static_inventory += using //Shuttle using = new /obj/screen/ai/call_shuttle() using.screen_loc = ui_ai_shuttle - adding += using + static_inventory += using //Laws using = new /obj/screen/ai/state_laws() using.screen_loc = ui_ai_state_laws - adding += using + static_inventory += using //PDA message using = new /obj/screen/ai/pda_msg_send() using.screen_loc = ui_ai_pda_send - adding += using + static_inventory += using //PDA log using = new /obj/screen/ai/pda_msg_show() using.screen_loc = ui_ai_pda_log - adding += using + static_inventory += using //Take image using = new /obj/screen/ai/image_take() using.screen_loc = ui_ai_take_picture - adding += using + static_inventory += using //View images using = new /obj/screen/ai/image_view() using.screen_loc = ui_ai_view_images - adding += using + static_inventory += using //Medical/Security sensors using = new /obj/screen/ai/sensors() using.screen_loc = ui_ai_sensor - adding += using + static_inventory += using - mymob.client.screen += adding + other - return \ No newline at end of file + +/mob/living/silicon/ai/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/ai(src) \ No newline at end of file diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index c6ea726b85d..f8d1951ee63 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -6,14 +6,10 @@ /mob/proc/throw_alert(category, type, severity, obj/new_master) /* Proc to create or update an alert. Returns the alert if the alert is new or updated, 0 if it was thrown already - category is a text string. Each mob may only have one alert per category; the previous one will be replaced - path is a type path of the actual alert type to throw - severity is an optional number that will be placed at the end of the icon_state for this alert For example, high pressure's icon_state is "highpressure" and can be serverity 1 or 2 to get "highpressure1" or "highpressure2" - new_master is optional and sets the alert's icon state to "template" in the ui_style icons with the master as an overlay. Clicks are forwarded to master */ @@ -27,17 +23,17 @@ WARNING("[src] threw alert [category] with new_master [new_master] while already having that alert with master [alert.master]") clear_alert(category) return .() - else if(alert.type == type && (!severity || severity == alert.severity)) + else if(alert.type != type) + clear_alert(category) + return .() + else if(!severity || severity == alert.severity) if(alert.timeout) clear_alert(category) return .() - else -// src << "threw alert not in need of update [category] [type] [severity]" + else //no need to update return 0 -// src << "updating alert [category] [type] [severity]" else alert = PoolOrNew(type) -// src << "throwing new alert [category] [type] [severity]" if(new_master) var/old_layer = new_master.layer diff --git a/code/_onclick/hud/alien.dm b/code/_onclick/hud/alien.dm index 94b3efb66c5..676b4b8bfae 100644 --- a/code/_onclick/hud/alien.dm +++ b/code/_onclick/hud/alien.dm @@ -6,13 +6,14 @@ icon_state = "leap_off" /obj/screen/alien/leap/Click() - if(istype(usr, /mob/living/carbon/alien/humanoid)) + if(istype(usr, /mob/living/carbon/alien/humanoid/hunter)) var/mob/living/carbon/alien/humanoid/hunter/AH = usr AH.toggle_leap() /obj/screen/alien/nightvision name = "toggle night-vision" icon_state = "nightvision1" + screen_loc = ui_alien_nightvision /obj/screen/alien/nightvision/Click() var/mob/living/carbon/alien/A = usr @@ -21,9 +22,14 @@ T.fire(A) -/datum/hud/proc/alien_hud() - adding = list() - other = list() +/obj/screen/alien/plasma_display + icon = 'icons/mob/screen_gen.dmi' + icon_state = "power_display2" + name = "plasma stored" + screen_loc = ui_alienplasmadisplay + +/datum/hud/alien/New(mob/living/carbon/alien/humanoid/owner) + ..() var/obj/screen/using var/obj/screen/inventory/inv_box @@ -39,9 +45,11 @@ inv_box.icon_state = "hand_r_active" inv_box.screen_loc = ui_rhand inv_box.layer = 19 - r_hand_hud_object = inv_box inv_box.slot_id = slot_r_hand - adding += inv_box + r_hand_hud_object = inv_box + if(owner.handcuffed) + inv_box.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="markus") + static_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "l_hand" @@ -53,7 +61,9 @@ inv_box.layer = 19 inv_box.slot_id = slot_l_hand l_hand_hud_object = inv_box - adding += inv_box + if(owner.handcuffed) + inv_box.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="gabrielle") + static_inventory += inv_box //begin buttons @@ -63,7 +73,7 @@ using.icon_state = "swap_1" using.screen_loc = ui_swaphand1 using.layer = 19 - adding += using + static_inventory += using using = new /obj/screen/inventory() using.name = "hand" @@ -71,78 +81,76 @@ using.icon_state = "swap_2" using.screen_loc = ui_swaphand2 using.layer = 19 - adding += using + static_inventory += using - using = new /obj/screen/act_intent() - using.icon = 'icons/mob/screen_alien.dmi' + using = new /obj/screen/act_intent/alien() using.icon_state = mymob.a_intent - using.screen_loc = ui_movi - adding += using + static_inventory += using action_intent = using if(istype(mymob, /mob/living/carbon/alien/humanoid/hunter)) var/mob/living/carbon/alien/humanoid/hunter/H = mymob H.leap_icon = new /obj/screen/alien/leap() H.leap_icon.screen_loc = ui_alien_storage_r - adding += H.leap_icon + static_inventory += H.leap_icon using = new /obj/screen/drop() using.icon = 'icons/mob/screen_alien.dmi' using.screen_loc = ui_drop_throw - adding += using + static_inventory += using using = new /obj/screen/resist() using.icon = 'icons/mob/screen_alien.dmi' using.screen_loc = ui_pull_resist - adding += using + hotkeybuttons += using - mymob.throw_icon = new /obj/screen/throw_catch() - mymob.throw_icon.icon = 'icons/mob/screen_alien.dmi' - mymob.throw_icon.screen_loc = ui_drop_throw + throw_icon = new /obj/screen/throw_catch() + throw_icon.icon = 'icons/mob/screen_alien.dmi' + throw_icon.screen_loc = ui_drop_throw + hotkeybuttons += throw_icon - mymob.pullin = new /obj/screen/pull() - mymob.pullin.icon = 'icons/mob/screen_alien.dmi' - mymob.pullin.update_icon(mymob) - mymob.pullin.screen_loc = ui_pull_resist + pull_icon = new /obj/screen/pull() + pull_icon.icon = 'icons/mob/screen_alien.dmi' + pull_icon.update_icon(mymob) + pull_icon.screen_loc = ui_pull_resist + static_inventory += pull_icon //begin indicators - mymob.healths = new /obj/screen() - mymob.healths.icon = 'icons/mob/screen_alien.dmi' - mymob.healths.icon_state = "health0" - mymob.healths.name = "health" - mymob.healths.screen_loc = ui_alien_health + healths = new /obj/screen/healths/alien() + infodisplay += healths nightvisionicon = new /obj/screen/alien/nightvision() - nightvisionicon.screen_loc = ui_alien_nightvision + infodisplay += nightvisionicon - alien_plasma_display = new /obj/screen() - alien_plasma_display.icon = 'icons/mob/screen_gen.dmi' - alien_plasma_display.icon_state = "power_display2" - alien_plasma_display.name = "plasma stored" - alien_plasma_display.screen_loc = ui_alienplasmadisplay + alien_plasma_display = new /obj/screen/alien/plasma_display() + infodisplay += alien_plasma_display - mymob.blind = new /obj/screen() - mymob.blind.icon = 'icons/mob/screen_full.dmi' - mymob.blind.icon_state = "blackimageoverlay" - mymob.blind.name = " " - mymob.blind.screen_loc = "CENTER-7,CENTER-7" - mymob.blind.layer = 0 - mymob.blind.mouse_opacity = 0 + mymob.flash = new /obj/screen/flash() + screenoverlays += mymob.flash - mymob.flash = new /obj/screen() - mymob.flash.icon = 'icons/mob/screen_gen.dmi' - mymob.flash.icon_state = "blank" - mymob.flash.name = "flash" - mymob.flash.screen_loc = "WEST,SOUTH to EAST,NORTH" - mymob.flash.layer = 17 + zone_select = new /obj/screen/zone_sel/alien() + zone_select.update_icon(mymob) + static_inventory += zone_select - mymob.zone_sel = new /obj/screen/zone_sel/alien() - mymob.zone_sel.icon = 'icons/mob/screen_alien.dmi' - mymob.zone_sel.update_icon() - mymob.client.screen = list() +/datum/hud/alien/persistant_inventory_update() + if(!mymob) + return + var/mob/living/carbon/alien/humanoid/H = mymob + if(hud_version != HUD_STYLE_NOHUD) + if(H.r_hand) + H.r_hand.screen_loc = ui_rhand + H.client.screen += H.r_hand + if(H.l_hand) + H.l_hand.screen_loc = ui_lhand + H.client.screen += H.l_hand + else + if(H.r_hand) + H.r_hand.screen_loc = null + if(H.l_hand) + H.l_hand.screen_loc = null - mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.healths, nightvisionicon, alien_plasma_display, mymob.pullin, mymob.blind, mymob.flash) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach ) - mymob.client.screen += adding + other - mymob.client.screen += mymob.client.void \ No newline at end of file +/mob/living/carbon/alien/humanoid/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/alien(src) diff --git a/code/_onclick/hud/alien_larva.dm b/code/_onclick/hud/alien_larva.dm index cc7b962e066..77bcbb3b67b 100644 --- a/code/_onclick/hud/alien_larva.dm +++ b/code/_onclick/hud/alien_larva.dm @@ -1,51 +1,33 @@ -/datum/hud/proc/larva_hud() - adding = list() - other = list() - +/datum/hud/larva/New(mob/owner) + ..() var/obj/screen/using - using = new /obj/screen/act_intent() - using.icon = 'icons/mob/screen_alien.dmi' + using = new /obj/screen/act_intent/alien() using.icon_state = mymob.a_intent - using.screen_loc = ui_movi - adding += using + static_inventory += using action_intent = using - mymob.healths = new /obj/screen() - mymob.healths.icon = 'icons/mob/screen_alien.dmi' - mymob.healths.icon_state = "health0" - mymob.healths.name = "health" - mymob.healths.screen_loc = ui_alien_health + healths = new /obj/screen/healths/alien() + infodisplay += healths nightvisionicon = new /obj/screen/alien/nightvision() nightvisionicon.screen_loc = ui_alien_nightvision + infodisplay += nightvisionicon - mymob.pullin = new /obj/screen/pull() - mymob.pullin.icon = 'icons/mob/screen_alien.dmi' - mymob.pullin.update_icon(mymob) - mymob.pullin.screen_loc = ui_pull_resist + pull_icon = new /obj/screen/pull() + pull_icon.icon = 'icons/mob/screen_alien.dmi' + pull_icon.update_icon(mymob) + pull_icon.screen_loc = ui_pull_resist + hotkeybuttons += pull_icon - mymob.blind = new /obj/screen() - mymob.blind.icon = 'icons/mob/screen_full.dmi' - mymob.blind.icon_state = "blackimageoverlay" - mymob.blind.name = " " - mymob.blind.screen_loc = "CENTER-7,CENTER-7" - mymob.blind.layer = 0 - mymob.blind.mouse_opacity = 0 + mymob.flash = new /obj/screen/flash() + screenoverlays += mymob.flash - mymob.flash = new /obj/screen() - mymob.flash.icon = 'icons/mob/screen_gen.dmi' - mymob.flash.icon_state = "blank" - mymob.flash.name = "flash" - mymob.flash.screen_loc = "WEST,SOUTH to EAST,NORTH" - mymob.flash.layer = 17 + zone_select = new /obj/screen/zone_sel/alien() + zone_select.update_icon(mymob) + static_inventory += zone_select - mymob.zone_sel = new /obj/screen/zone_sel/alien() - mymob.zone_sel.icon = 'icons/mob/screen_alien.dmi' - mymob.zone_sel.update_icon() - mymob.client.screen = list() - - mymob.client.screen += list( mymob.zone_sel, mymob.healths, nightvisionicon, mymob.pullin, mymob.blind, mymob.flash) //, mymob.rest, mymob.sleep, mymob.mach ) - mymob.client.screen += adding + other - mymob.client.screen += mymob.client.void \ No newline at end of file +/mob/living/carbon/alien/larva/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/larva(src) diff --git a/code/_onclick/hud/blob_overmind.dm b/code/_onclick/hud/blob_overmind.dm new file mode 100644 index 00000000000..0b9ca79290b --- /dev/null +++ b/code/_onclick/hud/blob_overmind.dm @@ -0,0 +1,151 @@ + +/obj/screen/blob + icon = 'icons/mob/blob.dmi' + +/obj/screen/blob/BlobHelp + icon_state = "ui_help" + name = "Blob Help" + desc = "Help on playing blob!" + +/obj/screen/blob/BlobHelp/Click() + if(isovermind(usr)) + var/mob/camera/blob/B = usr + B.blob_help() + +/obj/screen/blob/JumpToNode + icon_state = "ui_tonode" + name = "Jump to Node" + desc = "Moves your camera to a selected blob node." + +/obj/screen/blob/JumpToNode/Click() + if(isovermind(usr)) + var/mob/camera/blob/B = usr + B.jump_to_node() + +/obj/screen/blob/JumpToCore + icon_state = "ui_tocore" + name = "Jump to Core" + desc = "Moves your camera to your blob core." + +/obj/screen/blob/JumpToCore/Click() + if(isovermind(usr)) + var/mob/camera/blob/B = usr + B.transport_core() + +/obj/screen/blob/Blobbernaut + icon_state = "ui_blobbernaut" + name = "Produce Blobbernaut (20)" + desc = "Produces a blobbernaut for 20 points." + +/obj/screen/blob/Blobbernaut/Click() + if(isovermind(usr)) + var/mob/camera/blob/B = usr + B.create_blobbernaut() + +/obj/screen/blob/ResourceBlob + icon_state = "ui_resource" + name = "Produce Resource Blob (40)" + desc = "Produces a resource blob for 40 points." + +/obj/screen/blob/ResourceBlob/Click() + if(isovermind(usr)) + var/mob/camera/blob/B = usr + B.create_resource() + +/obj/screen/blob/NodeBlob + icon_state = "ui_node" + name = "Produce Node Blob (60)" + desc = "Produces a node blob for 60 points." + +/obj/screen/blob/NodeBlob/Click() + if(isovermind(usr)) + var/mob/camera/blob/B = usr + B.create_node() + +/obj/screen/blob/FactoryBlob + icon_state = "ui_factory" + name = "Produce Factory Blob (60)" + desc = "Produces a resource blob for 60 points." + +/obj/screen/blob/FactoryBlob/Click() + if(isovermind(usr)) + var/mob/camera/blob/B = usr + B.create_factory() + +/obj/screen/blob/ReadaptChemical + icon_state = "ui_chemswap" + name = "Readapt Chemical (40)" + desc = "Randomly rerolls your chemical for 40 points." + +/obj/screen/blob/ReadaptChemical/Click() + if(isovermind(usr)) + var/mob/camera/blob/B = usr + B.chemical_reroll() + +/obj/screen/blob/RelocateCore + icon_state = "ui_swap" + name = "Relocate Core (80)" + desc = "Swaps a node and your core for 80 points." + +/obj/screen/blob/RelocateCore/Click() + if(isovermind(usr)) + var/mob/camera/blob/B = usr + B.relocate_core() + +/datum/hud/blob_overmind/New(mob/owner) + ..() + var/obj/screen/using + + blobpwrdisplay = new /obj/screen() + blobpwrdisplay.name = "blob power" + blobpwrdisplay.icon_state = "block" + blobpwrdisplay.screen_loc = ui_health + blobpwrdisplay.mouse_opacity = 0 + blobpwrdisplay.layer = 20 + static_inventory += blobpwrdisplay + + healths = new /obj/screen/healths/blob() + static_inventory += healths + + using = new /obj/screen/blob/BlobHelp() + using.screen_loc = "NORTH:-6,WEST:6" + static_inventory += using + + using = new /obj/screen/blob/JumpToNode() + using.screen_loc = ui_inventory + static_inventory += using + + using = new /obj/screen/blob/JumpToCore() + using.screen_loc = ui_zonesel + static_inventory += using + + using = new /obj/screen/blob/Blobbernaut() + using.screen_loc = ui_belt + static_inventory += using + + using = new /obj/screen/blob/ResourceBlob() + using.screen_loc = ui_back + static_inventory += using + + using = new /obj/screen/blob/NodeBlob() + using.screen_loc = ui_lhand + static_inventory += using + + using = new /obj/screen/blob/FactoryBlob() + using.screen_loc = ui_rhand + static_inventory += using + + using = new /obj/screen/blob/ReadaptChemical() + using.screen_loc = ui_storage1 + static_inventory += using + + using = new /obj/screen/blob/RelocateCore() + using.screen_loc = ui_storage2 + static_inventory += using + + +/mob/camera/blob/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/blob_overmind(src) + + diff --git a/code/_onclick/hud/drones.dm b/code/_onclick/hud/drones.dm index a07958db7aa..7e2d478c2ab 100644 --- a/code/_onclick/hud/drones.dm +++ b/code/_onclick/hud/drones.dm @@ -1,19 +1,18 @@ -/datum/hud/proc/drone_hud(ui_style = 'icons/mob/screen_midnight.dmi') - adding = list() - +/datum/hud/drone/New(mob/owner, ui_style = 'icons/mob/screen_midnight.dmi') + ..() var/obj/screen/using var/obj/screen/inventory/inv_box using = new /obj/screen/drop() using.icon = ui_style using.screen_loc = ui_drone_drop - adding += using + static_inventory += using - mymob.pullin = new /obj/screen/pull() - mymob.pullin.icon = ui_style - mymob.pullin.update_icon(mymob) - mymob.pullin.screen_loc = ui_drone_pull - adding += mymob.pullin + pull_icon = new /obj/screen/pull() + pull_icon.icon = ui_style + pull_icon.update_icon(mymob) + pull_icon.screen_loc = ui_drone_pull + static_inventory += pull_icon inv_box = new /obj/screen/inventory() inv_box.name = "r_hand" @@ -25,7 +24,7 @@ inv_box.slot_id = slot_r_hand inv_box.layer = 19 r_hand_hud_object = inv_box - adding += inv_box + static_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "l_hand" @@ -37,7 +36,7 @@ inv_box.slot_id = slot_l_hand inv_box.layer = 19 l_hand_hud_object = inv_box - adding += inv_box + static_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "internal storage" @@ -46,7 +45,7 @@ inv_box.screen_loc = ui_drone_storage inv_box.slot_id = slot_drone_storage inv_box.layer = 19 - adding += inv_box + static_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "head/mask" @@ -55,7 +54,7 @@ inv_box.screen_loc = ui_drone_head inv_box.slot_id = slot_head inv_box.layer = 19 - adding += inv_box + static_inventory += inv_box using = new /obj/screen/inventory() using.name = "hand" @@ -63,7 +62,7 @@ using.icon_state = "swap_1_m" using.screen_loc = ui_swaphand1 using.layer = 19 - adding += using + static_inventory += using using = new /obj/screen/inventory() using.name = "hand" @@ -71,12 +70,44 @@ using.icon_state = "swap_2" using.screen_loc = ui_swaphand2 using.layer = 19 - adding += using + static_inventory += using - mymob.zone_sel = new /obj/screen/zone_sel() - mymob.zone_sel.icon = ui_style - mymob.zone_sel.update_icon() + zone_select = new /obj/screen/zone_sel() + zone_select.icon = ui_style + zone_select.update_icon(mymob) - mymob.client.screen = list() - mymob.client.screen += mymob.client.void - mymob.client.screen += adding + +/datum/hud/drone/persistant_inventory_update() + if(!mymob) + return + var/mob/living/simple_animal/drone/D = mymob + + if(hud_shown) + if(D.internal_storage) + D.internal_storage.screen_loc = ui_drone_storage + D.client.screen += D.internal_storage + if(D.head) + D.head.screen_loc = ui_drone_head + D.client.screen += D.head + else + if(D.internal_storage) + D.internal_storage.screen_loc = null + if(D.head) + D.head.screen_loc = null + + if(hud_version != HUD_STYLE_NOHUD) + if(D.r_hand) + D.r_hand.screen_loc = ui_rhand + D.client.screen += D.r_hand + if(D.l_hand) + D.l_hand.screen_loc = ui_lhand + D.client.screen += D.l_hand + else + if(D.r_hand) + D.r_hand.screen_loc = null + if(D.l_hand) + D.l_hand.screen_loc = null + +/mob/living/simple_animal/drone/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/drone(src, ui_style2icon(client.prefs.UI_style)) diff --git a/code/_onclick/hud/ghost.dm b/code/_onclick/hud/ghost.dm index c12d842f86a..ca7886e29d9 100644 --- a/code/_onclick/hud/ghost.dm +++ b/code/_onclick/hud/ghost.dm @@ -36,31 +36,39 @@ var/mob/dead/observer/G = usr G.dead_tele() -/datum/hud/proc/ghost_hud() +/datum/hud/ghost/New(mob/owner) + ..() var/mob/dead/observer/G = mymob if(!G.client.prefs.ghost_hud) - mymob.client.screen -= adding + mymob.client.screen = null return - adding = list() - var/obj/screen/using using = new /obj/screen/ghost/jumptomob() using.screen_loc = ui_ghost_jumptomob - adding += using + static_inventory += using using = new /obj/screen/ghost/orbit() using.screen_loc = ui_ghost_orbit - adding += using + static_inventory += using using = new /obj/screen/ghost/reenter_corpse() using.screen_loc = ui_ghost_reenter_corpse - adding += using + static_inventory += using using = new /obj/screen/ghost/teleport() using.screen_loc = ui_ghost_teleport - adding += using + static_inventory += using - mymob.client.screen += adding - return + +/datum/hud/ghost/show_hud() + var/mob/dead/observer/G = mymob + mymob.client.screen = list() + if(!G.client.prefs.ghost_hud) + return + mymob.client.screen += static_inventory + +/mob/dead/observer/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/ghost(src) diff --git a/code/_onclick/hud/guardian.dm b/code/_onclick/hud/guardian.dm new file mode 100644 index 00000000000..8473ad3ca87 --- /dev/null +++ b/code/_onclick/hud/guardian.dm @@ -0,0 +1,85 @@ + +/datum/hud/guardian/New(mob/owner) + ..() + var/obj/screen/using + + using = new /obj/screen/guardian/Manifest() + using.screen_loc = ui_rhand + static_inventory += using + + using = new /obj/screen/guardian/Recall() + using.screen_loc = ui_lhand + static_inventory += using + + using = new /obj/screen/guardian/ToggleMode() + using.screen_loc = ui_storage1 + static_inventory += using + + using = new /obj/screen/guardian/ToggleLight() + using.screen_loc = ui_inventory + static_inventory += using + + using = new /obj/screen/guardian/Communicate() + using.screen_loc = ui_back + static_inventory += using + + +/mob/living/simple_animal/hostile/guardian/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/guardian(src) + + +/obj/screen/guardian + icon = 'icons/mob/guardian.dmi' + +/obj/screen/guardian/Manifest + icon_state = "manifest" + name = "Manifest" + desc = "Spring forth into battle!" + +/obj/screen/guardian/Manifest/Click() + if(isguardian(usr)) + var/mob/living/simple_animal/hostile/guardian/G = usr + G.Manifest() + + +/obj/screen/guardian/Recall + icon_state = "recall" + name = "Recall" + desc = "Return to your user." + +/obj/screen/guardian/Recall/Click() + if(isguardian(usr)) + var/mob/living/simple_animal/hostile/guardian/G = usr + G.Recall() + +/obj/screen/guardian/ToggleMode + icon_state = "toggle" + name = "Toggle Mode" + desc = "Switch between ability modes." + +/obj/screen/guardian/ToggleMode/Click() + if(isguardian(usr)) + var/mob/living/simple_animal/hostile/guardian/G = usr + G.ToggleMode() + +/obj/screen/guardian/Communicate + icon_state = "communicate" + name = "Communicate" + desc = "Communicate telepathically with your user." + +/obj/screen/guardian/Communicate/Click() + if(isguardian(usr)) + var/mob/living/simple_animal/hostile/guardian/G = usr + G.Communicate() + + +/obj/screen/guardian/ToggleLight + icon_state = "light" + name = "Toggle Light" + desc = "Glow like star dust." + +/obj/screen/guardian/ToggleLight/Click() + if(isguardian(usr)) + var/mob/living/simple_animal/hostile/guardian/G = usr + G.ToggleLight() diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 8c81a622508..f065922cfab 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -8,6 +8,7 @@ var/datum/global_hud/global_hud = new() /datum/global_hud var/obj/screen/druggy var/obj/screen/blurry + var/obj/screen/blind var/list/vimpaired var/list/darkMask @@ -27,6 +28,13 @@ var/datum/global_hud/global_hud = new() blurry.layer = 17 blurry.mouse_opacity = 0 + blind = new /obj/screen() + blind.icon = 'icons/mob/screen_full.dmi' + blind.icon_state = "blackimageoverlay" + blind.screen_loc = "CENTER-7,CENTER-7" + blind.mouse_opacity = 0 + blind.layer = 18 + var/obj/screen/O var/i //that nasty looking dither you get when you're short-sighted @@ -95,15 +103,13 @@ var/datum/global_hud/global_hud = new() var/show_intent_icons = 0 var/hotkey_ui_hidden = 0 //This is to hide the buttons that can be used via hotkeys. (hotkeybuttons list of buttons) - var/obj/screen/lingchemdisplay - var/obj/screen/lingstingdisplay + var/obj/screen/ling/chems/lingchemdisplay + var/obj/screen/ling/sting/lingstingdisplay var/obj/screen/blobpwrdisplay - var/obj/screen/blobhealthdisplay var/obj/screen/alien_plasma_display - var/obj/screen/deity_health_display var/obj/screen/deity_power_display var/obj/screen/deity_follower_display @@ -111,107 +117,30 @@ var/datum/global_hud/global_hud = new() var/obj/screen/r_hand_hud_object var/obj/screen/l_hand_hud_object var/obj/screen/action_intent - var/obj/screen/move_intent + var/obj/screen/zone_select + var/obj/screen/pull_icon + var/obj/screen/throw_icon + var/obj/screen/module_store_icon - var/list/adding - var/list/other - var/list/obj/screen/hotkeybuttons + var/list/static_inventory = list() //the screen objects which are static + var/list/toggleable_inventory = list() //the screen objects which can be hidden + var/list/obj/screen/hotkeybuttons = list() //the buttons that can be used via hotkeys + var/list/infodisplay = list() //the screen objects that display mob info (health, alien plasma, etc...) + var/list/screenoverlays = list() //the screen objects used as whole screen overlays (flash, damageoverlay, etc...) var/obj/screen/movable/action_button/hide_toggle/hide_actions_toggle var/action_buttons_hidden = 0 + var/obj/screen/healths + var/obj/screen/healthdoll + var/obj/screen/internals + /datum/hud/New(mob/owner) mymob = owner - instantiate() - ..() +/mob/proc/create_mob_hud() + return -/datum/hud/proc/hidden_inventory_update() - if(!mymob) - return - - if(ishuman(mymob)) - var/mob/living/carbon/human/H = mymob - if(H.handcuffed) - H.handcuffed.screen_loc = null //no handcuffs in my UI! - if(inventory_shown && hud_shown) - if(H.shoes) H.shoes.screen_loc = ui_shoes - if(H.gloves) H.gloves.screen_loc = ui_gloves - if(H.ears) H.ears.screen_loc = ui_ears - if(H.glasses) H.glasses.screen_loc = ui_glasses - if(H.w_uniform) H.w_uniform.screen_loc = ui_iclothing - if(H.wear_suit) H.wear_suit.screen_loc = ui_oclothing - if(H.wear_mask) H.wear_mask.screen_loc = ui_mask - if(H.head) H.head.screen_loc = ui_head - else - if(H.shoes) H.shoes.screen_loc = null - if(H.gloves) H.gloves.screen_loc = null - if(H.ears) H.ears.screen_loc = null - if(H.glasses) H.glasses.screen_loc = null - if(H.w_uniform) H.w_uniform.screen_loc = null - if(H.wear_suit) H.wear_suit.screen_loc = null - if(H.wear_mask) H.wear_mask.screen_loc = null - if(H.head) H.head.screen_loc = null - - -/datum/hud/proc/persistant_inventory_update() - if(!mymob) - return - - if(ishuman(mymob)) - var/mob/living/carbon/human/H = mymob - if(hud_shown) - if(H.s_store) H.s_store.screen_loc = ui_sstore1 - if(H.wear_id) H.wear_id.screen_loc = ui_id - if(H.belt) H.belt.screen_loc = ui_belt - if(H.back) H.back.screen_loc = ui_back - if(H.l_store) H.l_store.screen_loc = ui_storage1 - if(H.r_store) H.r_store.screen_loc = ui_storage2 - else - if(H.s_store) H.s_store.screen_loc = null - if(H.wear_id) H.wear_id.screen_loc = null - if(H.belt) H.belt.screen_loc = null - if(H.back) H.back.screen_loc = null - if(H.l_store) H.l_store.screen_loc = null - if(H.r_store) H.r_store.screen_loc = null - - -/datum/hud/proc/instantiate() - if(!ismob(mymob)) - return 0 - if(!mymob.client) - return 0 - - var/ui_style = ui_style2icon(mymob.client.prefs.UI_style) - - if(ishuman(mymob)) - human_hud(ui_style) // Pass the player the UI style chosen in preferences - else if(ismonkey(mymob)) - monkey_hud(ui_style) - else if(isbrain(mymob)) - brain_hud(ui_style) - else if(islarva(mymob)) - larva_hud() - else if(isalien(mymob)) - alien_hud() - else if(isAI(mymob)) - ai_hud() - else if(isrobot(mymob)) - robot_hud() - else if(isobserver(mymob)) - ghost_hud() - else if(isovermind(mymob)) - blob_hud() - else if(isdrone(mymob)) - drone_hud(ui_style) - else if(isswarmer(mymob)) - swarmer_hud() - else if(is_handofgod_god(mymob)) - hoggod_hud() - else if(isguardian(mymob)) - guardian_hud() - else if(isovermind(mymob)) - blob_hud() //Version denotes which style should be displayed. blank or 0 means "next version" /datum/hud/proc/show_hud(version = 0) @@ -219,6 +148,9 @@ var/datum/global_hud/global_hud = new() return 0 if(!mymob.client) return 0 + + mymob.client.screen = list() + var/display_hud_version = version if(!display_hud_version) //If 0 or blank, display the next hud version display_hud_version = hud_version + 1 @@ -228,71 +160,70 @@ var/datum/global_hud/global_hud = new() switch(display_hud_version) if(HUD_STYLE_STANDARD) //Default HUD hud_shown = 1 //Governs behavior of other procs - if(adding) - mymob.client.screen += adding - if(other && inventory_shown) - mymob.client.screen += other - if(hotkeybuttons && !hotkey_ui_hidden) + if(static_inventory.len) + mymob.client.screen += static_inventory + if(toggleable_inventory.len && inventory_shown) + mymob.client.screen += toggleable_inventory + if(hotkeybuttons.len && !hotkey_ui_hidden) mymob.client.screen += hotkeybuttons + if(infodisplay.len) + mymob.client.screen += infodisplay - action_intent.screen_loc = ui_acti //Restore intent selection to the original position - mymob.client.screen += mymob.zone_sel //This one is a special snowflake - mymob.client.screen += mymob.healths //As are the rest of these. - mymob.client.screen += mymob.healthdoll - mymob.client.screen += mymob.internals - mymob.client.screen += lingstingdisplay - mymob.client.screen += lingchemdisplay + if(action_intent) + action_intent.screen_loc = initial(action_intent.screen_loc) //Restore intent selection to the original position - hidden_inventory_update() - persistant_inventory_update() - mymob.update_action_buttons() - reorganize_alerts() if(HUD_STYLE_REDUCED) //Reduced HUD hud_shown = 0 //Governs behavior of other procs - if(adding) - mymob.client.screen -= adding - if(other) - mymob.client.screen -= other - if(hotkeybuttons) + if(static_inventory.len) + mymob.client.screen -= static_inventory + if(toggleable_inventory.len) + mymob.client.screen -= toggleable_inventory + if(hotkeybuttons.len) mymob.client.screen -= hotkeybuttons + if(infodisplay.len) + mymob.client.screen += infodisplay - //These ones are not a part of 'adding', 'other' or 'hotkeybuttons' but we want them gone. - mymob.client.screen -= mymob.zone_sel //zone_sel is a mob variable for some reason. - mymob.client.screen -= lingstingdisplay - mymob.client.screen -= lingchemdisplay + //These ones are a part of 'static_inventory', 'toggleable_inventory' or 'hotkeybuttons' but we want them to stay + if(l_hand_hud_object) + mymob.client.screen += l_hand_hud_object //we want the hands to be visible + if(r_hand_hud_object) + mymob.client.screen += r_hand_hud_object //we want the hands to be visible + if(action_intent) + mymob.client.screen += action_intent //we want the intent switcher visible + action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is. - //These ones are a part of 'adding', 'other' or 'hotkeybuttons' but we want them to stay - mymob.client.screen += l_hand_hud_object //we want the hands to be visible - mymob.client.screen += r_hand_hud_object //we want the hands to be visible - mymob.client.screen += action_intent //we want the intent swticher visible - action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is. - - hidden_inventory_update() - persistant_inventory_update() - mymob.update_action_buttons() - reorganize_alerts() if(HUD_STYLE_NOHUD) //No HUD hud_shown = 0 //Governs behavior of other procs - if(adding) - mymob.client.screen -= adding - if(other) - mymob.client.screen -= other - if(hotkeybuttons) + if(static_inventory.len) + mymob.client.screen -= static_inventory + if(toggleable_inventory.len) + mymob.client.screen -= toggleable_inventory + if(hotkeybuttons.len) mymob.client.screen -= hotkeybuttons + if(infodisplay.len) + mymob.client.screen -= infodisplay - //These ones are not a part of 'adding', 'other' or 'hotkeybuttons' but we want them gone. - mymob.client.screen -= mymob.zone_sel //zone_sel is a mob variable for some reason. - mymob.client.screen -= mymob.healths - mymob.client.screen -= mymob.healthdoll - mymob.client.screen -= mymob.internals - mymob.client.screen -= lingstingdisplay - mymob.client.screen -= lingchemdisplay - - hidden_inventory_update() - persistant_inventory_update() - mymob.update_action_buttons() - reorganize_alerts() + if(screenoverlays.len) + mymob.client.screen += screenoverlays + mymob.client.screen += mymob.client.void hud_version = display_hud_version + persistant_inventory_update() + mymob.update_action_buttons() + reorganize_alerts() + +/datum/hud/human/show_hud(version = 0) + ..() + hidden_inventory_update() + +/datum/hud/robot/show_hud(version = 0) + ..() + update_robot_modules_display() + +/datum/hud/proc/hidden_inventory_update() + return + +/datum/hud/proc/persistant_inventory_update() + return //Triggered when F12 is pressed (Unless someone changed something in the DMF) /mob/verb/button_pressed_F12() @@ -300,10 +231,8 @@ var/datum/global_hud/global_hud = new() set hidden = 1 if(hud_used && client) - if(ishuman(src)) - hud_used.show_hud() //Shows the next hud preset - usr << "Switched HUD mode. Press F12 to toggle." - else - usr << "Inventory hiding is currently only supported for human mobs, sorry." + hud_used.show_hud() //Shows the next hud preset + usr << "Switched HUD mode. Press F12 to toggle." else usr << "This mob type does not use a HUD." + diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index d9a9ba93dec..22359ff69b7 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -8,10 +8,10 @@ /obj/screen/human/toggle/Click() if(usr.hud_used.inventory_shown) usr.hud_used.inventory_shown = 0 - usr.client.screen -= usr.hud_used.other + usr.client.screen -= usr.hud_used.toggleable_inventory else usr.hud_used.inventory_shown = 1 - usr.client.screen += usr.hud_used.other + usr.client.screen += usr.hud_used.toggleable_inventory usr.hud_used.hidden_inventory_update() @@ -30,6 +30,7 @@ /obj/screen/ling/sting name = "current sting" + screen_loc = ui_lingstingdisplay /obj/screen/ling/sting/Click() var/mob/living/carbon/U = usr @@ -38,33 +39,37 @@ /obj/screen/ling/chems name = "chemical storage" icon_state = "power_display" + screen_loc = ui_lingchemdisplay -/datum/hud/proc/human_hud(ui_style = 'icons/mob/screen_midnight.dmi') - adding = list() - other = list() - hotkeybuttons = list() //These can be disabled for hotkey users + + +/mob/living/carbon/human/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/human(src, ui_style2icon(client.prefs.UI_style)) + + +/datum/hud/human/New(mob/living/carbon/human/owner, ui_style = 'icons/mob/screen_midnight.dmi') + ..() var/obj/screen/using var/obj/screen/inventory/inv_box using = new /obj/screen/act_intent() using.icon_state = mymob.a_intent - using.screen_loc = ui_acti - adding += using + static_inventory += using action_intent = using using = new /obj/screen/mov_intent() using.icon = ui_style using.icon_state = (mymob.m_intent == "run" ? "running" : "walking") using.screen_loc = ui_movi - adding += using - move_intent = using + static_inventory += using using = new /obj/screen/drop() using.icon = ui_style using.screen_loc = ui_drop_throw - hotkeybuttons += using + static_inventory += using inv_box = new /obj/screen/inventory() inv_box.name = "i_clothing" @@ -73,7 +78,7 @@ inv_box.icon_state = "uniform" inv_box.screen_loc = ui_iclothing inv_box.layer = 19 - other += inv_box + toggleable_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "o_clothing" @@ -82,7 +87,7 @@ inv_box.icon_state = "suit" inv_box.screen_loc = ui_oclothing inv_box.layer = 19 - other += inv_box + toggleable_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "r_hand" @@ -94,7 +99,9 @@ inv_box.slot_id = slot_r_hand inv_box.layer = 19 r_hand_hud_object = inv_box - adding += inv_box + if(owner.handcuffed) + inv_box.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="markus") + static_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "l_hand" @@ -106,7 +113,9 @@ inv_box.slot_id = slot_l_hand inv_box.layer = 19 l_hand_hud_object = inv_box - adding += inv_box + if(owner.handcuffed) + inv_box.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="gabrielle") + static_inventory += inv_box using = new /obj/screen/inventory() using.name = "hand" @@ -114,7 +123,7 @@ using.icon_state = "swap_1" using.screen_loc = ui_swaphand1 using.layer = 19 - adding += using + static_inventory += using using = new /obj/screen/inventory() using.name = "hand" @@ -122,7 +131,7 @@ using.icon_state = "swap_2" using.screen_loc = ui_swaphand2 using.layer = 19 - adding += using + static_inventory += using inv_box = new /obj/screen/inventory() inv_box.name = "id" @@ -131,7 +140,7 @@ inv_box.screen_loc = ui_id inv_box.slot_id = slot_wear_id inv_box.layer = 19 - adding += inv_box + static_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "mask" @@ -140,7 +149,7 @@ inv_box.screen_loc = ui_mask inv_box.slot_id = slot_wear_mask inv_box.layer = 19 - other += inv_box + toggleable_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "back" @@ -149,7 +158,7 @@ inv_box.screen_loc = ui_back inv_box.slot_id = slot_back inv_box.layer = 19 - adding += inv_box + static_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "storage1" @@ -158,7 +167,7 @@ inv_box.screen_loc = ui_storage1 inv_box.slot_id = slot_l_store inv_box.layer = 19 - adding += inv_box + static_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "storage2" @@ -167,7 +176,7 @@ inv_box.screen_loc = ui_storage2 inv_box.slot_id = slot_r_store inv_box.layer = 19 - adding += inv_box + static_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "suit storage" @@ -176,7 +185,7 @@ inv_box.screen_loc = ui_sstore1 inv_box.slot_id = slot_s_store inv_box.layer = 19 - adding += inv_box + static_inventory += inv_box using = new /obj/screen/resist() using.icon = ui_style @@ -186,12 +195,12 @@ using = new /obj/screen/human/toggle() using.icon = ui_style using.screen_loc = ui_inventory - adding += using + static_inventory += using using = new /obj/screen/human/equip() using.icon = ui_style using.screen_loc = ui_equip - adding += using + static_inventory += using inv_box = new /obj/screen/inventory() inv_box.name = "gloves" @@ -200,7 +209,7 @@ inv_box.screen_loc = ui_gloves inv_box.slot_id = slot_gloves inv_box.layer = 19 - other += inv_box + toggleable_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "eyes" @@ -209,7 +218,7 @@ inv_box.screen_loc = ui_glasses inv_box.slot_id = slot_glasses inv_box.layer = 19 - other += inv_box + toggleable_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "ears" @@ -218,7 +227,7 @@ inv_box.screen_loc = ui_ears inv_box.slot_id = slot_ears inv_box.layer = 19 - other += inv_box + toggleable_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "head" @@ -227,7 +236,7 @@ inv_box.screen_loc = ui_head inv_box.slot_id = slot_head inv_box.layer = 19 - other += inv_box + toggleable_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "shoes" @@ -236,7 +245,7 @@ inv_box.screen_loc = ui_shoes inv_box.slot_id = slot_shoes inv_box.layer = 19 - other += inv_box + toggleable_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "belt" @@ -245,73 +254,135 @@ inv_box.screen_loc = ui_belt inv_box.slot_id = slot_belt inv_box.layer = 19 - adding += inv_box + static_inventory += inv_box - mymob.throw_icon = new /obj/screen/throw_catch() - mymob.throw_icon.icon = ui_style - mymob.throw_icon.screen_loc = ui_drop_throw - hotkeybuttons += mymob.throw_icon + throw_icon = new /obj/screen/throw_catch() + throw_icon.icon = ui_style + throw_icon.screen_loc = ui_drop_throw + hotkeybuttons += throw_icon + internals = new /obj/screen/internals() + infodisplay += internals - mymob.internals = new /obj/screen/internals() - mymob.internals.screen_loc = ui_internal + healths = new /obj/screen/healths() + infodisplay += healths - mymob.healths = new /obj/screen() - mymob.healths.icon_state = "health0" - mymob.healths.name = "health" - mymob.healths.screen_loc = ui_health + healthdoll = new /obj/screen/healthdoll() + infodisplay += healthdoll - mymob.healthdoll = new /obj/screen() - mymob.healthdoll.name = "health doll" - mymob.healthdoll.screen_loc = ui_healthdoll - - mymob.pullin = new /obj/screen/pull() - mymob.pullin.icon = ui_style - mymob.pullin.update_icon(mymob) - mymob.pullin.screen_loc = ui_pull_resist - hotkeybuttons += mymob.pullin + pull_icon = new /obj/screen/pull() + pull_icon.icon = ui_style + pull_icon.update_icon(mymob) + pull_icon.screen_loc = ui_pull_resist + static_inventory += pull_icon lingchemdisplay = new /obj/screen/ling/chems() - lingchemdisplay.screen_loc = ui_lingchemdisplay + infodisplay += lingchemdisplay lingstingdisplay = new /obj/screen/ling/sting() - lingstingdisplay.screen_loc = ui_lingstingdisplay + infodisplay += lingstingdisplay - mymob.blind = new /obj/screen() - mymob.blind.icon = 'icons/mob/screen_full.dmi' - mymob.blind.icon_state = "blackimageoverlay" - mymob.blind.name = " " - mymob.blind.screen_loc = "CENTER-7,CENTER-7" - mymob.blind.mouse_opacity = 0 - mymob.blind.layer = 0 + mymob.damageoverlay = new /obj/screen/damageoverlay() + screenoverlays += mymob.damageoverlay - mymob.damageoverlay = new /obj/screen() - mymob.damageoverlay.icon = 'icons/mob/screen_full.dmi' - mymob.damageoverlay.icon_state = "oxydamageoverlay0" - mymob.damageoverlay.name = "dmg" - mymob.damageoverlay.blend_mode = BLEND_MULTIPLY - mymob.damageoverlay.screen_loc = "CENTER-7,CENTER-7" - mymob.damageoverlay.mouse_opacity = 0 - mymob.damageoverlay.layer = 18.1 //The black screen overlay sets layer to 18 to display it, this one has to be just on top. + mymob.flash = new /obj/screen/flash() + screenoverlays += mymob.flash - mymob.flash = new /obj/screen() - mymob.flash.icon_state = "blank" - mymob.flash.name = "flash" - mymob.flash.blend_mode = BLEND_ADD - mymob.flash.screen_loc = "WEST,SOUTH to EAST,NORTH" - mymob.flash.layer = 17 + zone_select = new /obj/screen/zone_sel() + zone_select.icon = ui_style + zone_select.update_icon(mymob) + static_inventory += zone_select - mymob.zone_sel = new /obj/screen/zone_sel() - mymob.zone_sel.icon = ui_style - mymob.zone_sel.update_icon() + inventory_shown = 0 - mymob.client.screen = list() +/datum/hud/human/hidden_inventory_update() + if(!mymob) + return + var/mob/living/carbon/human/H = mymob + if(inventory_shown && hud_shown) + if(H.shoes) + H.shoes.screen_loc = ui_shoes + H.client.screen += H.shoes + if(H.gloves) + H.gloves.screen_loc = ui_gloves + H.client.screen += H.gloves + if(H.ears) + H.ears.screen_loc = ui_ears + H.client.screen += H.ears + if(H.glasses) + H.glasses.screen_loc = ui_glasses + H.client.screen += H.glasses + if(H.w_uniform) + H.w_uniform.screen_loc = ui_iclothing + H.client.screen += H.w_uniform + if(H.wear_suit) + H.wear_suit.screen_loc = ui_oclothing + H.client.screen += H.wear_suit + if(H.wear_mask) + H.wear_mask.screen_loc = ui_mask + H.client.screen += H.wear_mask + if(H.head) + H.head.screen_loc = ui_head + H.client.screen += H.head + else + if(H.shoes) H.shoes.screen_loc = null + if(H.gloves) H.gloves.screen_loc = null + if(H.ears) H.ears.screen_loc = null + if(H.glasses) H.glasses.screen_loc = null + if(H.w_uniform) H.w_uniform.screen_loc = null + if(H.wear_suit) H.wear_suit.screen_loc = null + if(H.wear_mask) H.wear_mask.screen_loc = null + if(H.head) H.head.screen_loc = null - mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.internals, mymob.healths, mymob.healthdoll, mymob.pullin, mymob.blind, mymob.flash, mymob.damageoverlay, lingchemdisplay, lingstingdisplay) //, mymob.hands, mymob.rest, mymob.sleep) //, mymob.mach ) - mymob.client.screen += adding + hotkeybuttons - mymob.client.screen += mymob.client.void - inventory_shown = 0; +/datum/hud/human/persistant_inventory_update() + if(!mymob) + return + var/mob/living/carbon/human/H = mymob + if(hud_shown) + if(H.s_store) + H.s_store.screen_loc = ui_sstore1 + H.client.screen += H.s_store + if(H.wear_id) + H.wear_id.screen_loc = ui_id + H.client.screen += H.wear_id + if(H.belt) + H.belt.screen_loc = ui_belt + H.client.screen += H.belt + if(H.back) + H.back.screen_loc = ui_back + H.client.screen += H.back + if(H.l_store) + H.l_store.screen_loc = ui_storage1 + H.client.screen += H.l_store + if(H.r_store) + H.r_store.screen_loc = ui_storage2 + H.client.screen += H.r_store + else + if(H.s_store) + H.s_store.screen_loc = null + if(H.wear_id) + H.wear_id.screen_loc = null + if(H.belt) + H.belt.screen_loc = null + if(H.back) + H.back.screen_loc = null + if(H.l_store) + H.l_store.screen_loc = null + if(H.r_store) + H.r_store.screen_loc = null + if(hud_version != HUD_STYLE_NOHUD) + if(H.r_hand) + H.r_hand.screen_loc = ui_rhand + H.client.screen += H.r_hand + if(H.l_hand) + H.l_hand.screen_loc = ui_lhand + H.client.screen += H.l_hand + else + if(H.r_hand) + H.r_hand.screen_loc = null + if(H.l_hand) + H.l_hand.screen_loc = null /mob/living/carbon/human/verb/toggle_hotkey_verbs() set category = "OOC" diff --git a/code/_onclick/hud/monkey.dm b/code/_onclick/hud/monkey.dm index 32b4e98832e..bc67e0b6a29 100644 --- a/code/_onclick/hud/monkey.dm +++ b/code/_onclick/hud/monkey.dm @@ -1,7 +1,5 @@ -/datum/hud/proc/monkey_hud(ui_style = 'icons/mob/screen_midnight.dmi') - adding = list() - other = list() - +/datum/hud/monkey/New(mob/living/carbon/monkey/owner, ui_style = 'icons/mob/screen_midnight.dmi') + ..() var/obj/screen/using var/obj/screen/inventory/inv_box @@ -9,20 +7,19 @@ using.icon = ui_style using.icon_state = mymob.a_intent using.screen_loc = ui_acti - adding += using + static_inventory += using action_intent = using using = new /obj/screen/mov_intent() using.icon = ui_style using.icon_state = (mymob.m_intent == "run" ? "running" : "walking") using.screen_loc = ui_movi - adding += using - move_intent = using + static_inventory += using using = new /obj/screen/drop() using.icon = ui_style using.screen_loc = ui_drop_throw - adding += using + static_inventory += using inv_box = new /obj/screen/inventory() inv_box.name = "r_hand" @@ -34,7 +31,9 @@ inv_box.slot_id = slot_r_hand inv_box.layer = 19 r_hand_hud_object = inv_box - adding += inv_box + if(owner.handcuffed) + inv_box.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="markus") + static_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "l_hand" @@ -46,23 +45,25 @@ inv_box.slot_id = slot_l_hand inv_box.layer = 19 l_hand_hud_object = inv_box - adding += inv_box + if(owner.handcuffed) + inv_box.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="gabrielle") + static_inventory += inv_box - using = new /obj/screen() + using = new /obj/screen/inventory() using.name = "hand" using.icon = ui_style using.icon_state = "swap_1_m" //extra wide! using.screen_loc = ui_swaphand1 using.layer = 19 - adding += using + static_inventory += using - using = new /obj/screen() + using = new /obj/screen/inventory() using.name = "hand" using.icon = ui_style using.icon_state = "swap_2" using.screen_loc = ui_swaphand2 using.layer = 19 - adding += using + static_inventory += using inv_box = new /obj/screen/inventory() inv_box.name = "mask" @@ -71,7 +72,7 @@ inv_box.screen_loc = ui_monkey_mask inv_box.slot_id = slot_wear_mask inv_box.layer = 19 - adding += inv_box + static_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "head" @@ -80,7 +81,7 @@ inv_box.screen_loc = ui_monkey_head inv_box.slot_id = slot_head inv_box.layer = 19 - adding += inv_box + static_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "back" @@ -89,66 +90,85 @@ inv_box.screen_loc = ui_back inv_box.slot_id = slot_back inv_box.layer = 19 - adding += inv_box + static_inventory += inv_box - mymob.throw_icon = new /obj/screen/throw_catch() - mymob.throw_icon.icon = ui_style - mymob.throw_icon.screen_loc = ui_drop_throw + throw_icon = new /obj/screen/throw_catch() + throw_icon.icon = ui_style + throw_icon.screen_loc = ui_drop_throw + hotkeybuttons += throw_icon - mymob.internals = new /obj/screen/internals() - mymob.internals.screen_loc = ui_internal + internals = new /obj/screen/internals() + infodisplay += internals - mymob.healths = new /obj/screen() - mymob.healths.icon_state = "health0" - mymob.healths.name = "health" - mymob.healths.screen_loc = ui_health + healths = new /obj/screen/healths() + infodisplay += healths - mymob.pullin = new /obj/screen/pull() - mymob.pullin.icon = ui_style - mymob.pullin.update_icon(mymob) - mymob.pullin.screen_loc = ui_pull_resist + pull_icon = new /obj/screen/pull() + pull_icon.icon = ui_style + pull_icon.update_icon(mymob) + pull_icon.screen_loc = ui_pull_resist + static_inventory += pull_icon lingchemdisplay = new /obj/screen/ling/chems() - lingchemdisplay.screen_loc = ui_lingchemdisplay + infodisplay += lingchemdisplay lingstingdisplay = new /obj/screen/ling/sting() - lingstingdisplay.screen_loc = ui_lingstingdisplay + infodisplay += lingstingdisplay - mymob.blind = new /obj/screen() - mymob.blind.icon = 'icons/mob/screen_full.dmi' - mymob.blind.icon_state = "blackimageoverlay" - mymob.blind.name = " " - mymob.blind.screen_loc = "CENTER-7,CENTER-7" - mymob.blind.layer = 0 - mymob.blind.mouse_opacity = 0 + mymob.damageoverlay = new /obj/screen/damageoverlay() + screenoverlays += mymob.damageoverlay - mymob.damageoverlay = new /obj/screen() - mymob.damageoverlay.icon = 'icons/mob/screen_full.dmi' - mymob.damageoverlay.icon_state = "oxydamageoverlay0" - mymob.damageoverlay.name = "dmg" - mymob.damageoverlay.blend_mode = BLEND_MULTIPLY - mymob.damageoverlay.screen_loc = "CENTER-7,CENTER-7" - mymob.damageoverlay.mouse_opacity = 0 - mymob.damageoverlay.layer = 18.1 //The black screen overlay sets layer to 18 to display it, this one has to be just on top. + mymob.flash = new /obj/screen/flash() + screenoverlays += mymob.flash - mymob.flash = new /obj/screen() - mymob.flash.icon = 'icons/mob/screen_gen.dmi' - mymob.flash.icon_state = "blank" - mymob.flash.name = "flash" - mymob.flash.screen_loc = "WEST,SOUTH to EAST,NORTH" - mymob.flash.layer = 17 - - mymob.zone_sel = new /obj/screen/zone_sel() - mymob.zone_sel.icon = ui_style - mymob.zone_sel.update_icon() + zone_select = new /obj/screen/zone_sel() + zone_select.icon = ui_style + zone_select.update_icon(mymob) + static_inventory += zone_select mymob.client.screen = list() using = new /obj/screen/resist() using.icon = ui_style using.screen_loc = ui_pull_resist - adding += using + hotkeybuttons += using - mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.internals, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, lingchemdisplay, lingstingdisplay) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach ) - mymob.client.screen += adding + other - mymob.client.screen += mymob.client.void \ No newline at end of file +/datum/hud/monkey/persistant_inventory_update() + if(!mymob) + return + var/mob/living/carbon/monkey/M = mymob + + if(hud_shown) + if(M.back) + M.back.screen_loc = ui_back + M.client.screen += M.back + if(M.wear_mask) + M.wear_mask.screen_loc = ui_monkey_mask + M.client.screen += M.wear_mask + if(M.head) + M.head.screen_loc = ui_monkey_head + M.client.screen += M.head + else + if(M.back) + M.back.screen_loc = null + if(M.wear_mask) + M.wear_mask.screen_loc = null + if(M.head) + M.head.screen_loc = null + + if(hud_version != HUD_STYLE_NOHUD) + if(M.r_hand) + M.r_hand.screen_loc = ui_rhand + M.client.screen += M.r_hand + if(M.l_hand) + M.l_hand.screen_loc = ui_lhand + M.client.screen += M.l_hand + else + if(M.r_hand) + M.r_hand.screen_loc = null + if(M.l_hand) + M.l_hand.screen_loc = null + +/mob/living/carbon/monkey/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/monkey(src, ui_style2icon(client.prefs.UI_style)) diff --git a/code/_onclick/hud/other_mobs.dm b/code/_onclick/hud/other_mobs.dm index cfcfd7566fe..e1bacf6922d 100644 --- a/code/_onclick/hud/other_mobs.dm +++ b/code/_onclick/hud/other_mobs.dm @@ -1,38 +1,41 @@ -/datum/hud/proc/unplayer_hud() - return - -/datum/hud/proc/brain_hud(ui_style = 'icons/mob/screen_midnight.dmi') - mymob.blind = new /obj/screen() - mymob.blind.icon = 'icons/mob/screen_full.dmi' - mymob.blind.icon_state = "blackimageoverlay" - mymob.blind.name = " " - mymob.blind.screen_loc = "CENTER-7,CENTER-7" - mymob.blind.layer = 0 - mymob.blind.mouse_opacity = 0 +/datum/hud/brain/show_hud(version = 0) + if(!ismob(mymob)) + return 0 + if(!mymob.client) + return 0 mymob.client.screen = list() - mymob.client.screen += list(mymob.blind) mymob.client.screen += mymob.client.void -/datum/hud/proc/hoggod_hud(ui_style = 'icons/mob/screen_midnight.dmi') - deity_health_display = new /obj/screen() - deity_health_display.name = "Nexus Health" - deity_health_display.icon_state = "deity_nexus" - deity_health_display.screen_loc = ui_deityhealth - deity_health_display.layer = 20 +/mob/living/carbon/brain/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/brain(src) - deity_power_display = new /obj/screen() - deity_power_display.name = "Faith" - deity_power_display.icon_state = "deity_power" - deity_power_display.screen_loc = ui_deitypower - deity_power_display.layer = 20 +/datum/hud/hog_god/New(mob/owner) + ..() + healths = new /obj/screen/healths/deity() + infodisplay += healths - deity_follower_display = new /obj/screen() - deity_follower_display.name = "Followers" - deity_follower_display.icon_state = "deity_followers" - deity_follower_display.screen_loc = ui_deityfollowers - deity_follower_display.layer = 20 + deity_power_display = new /obj/screen/deity_power_display() + infodisplay += deity_power_display - mymob.client.screen = null + deity_follower_display = new /obj/screen/deity_follower_display() + infodisplay += deity_follower_display + + +/mob/camera/god/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/hog_god(src) + +/obj/screen/deity_power_display + name = "Faith" + icon_state = "deity_power" + screen_loc = ui_deitypower + layer = 20 + +/obj/screen/deity_follower_display + name = "Followers" + icon_state = "deity_followers" + screen_loc = ui_deityfollowers + layer = 20 - mymob.client.screen += list(deity_health_display, deity_power_display, deity_follower_display) diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index 51dc22df59e..d39ca085410 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -62,17 +62,14 @@ R.control_headlamp() -/datum/hud/proc/robot_hud() - adding = list() - other = list() - +/datum/hud/robot/New(mob/owner) + ..() var/obj/screen/using - //Radio using = new /obj/screen/robot/radio() using.screen_loc = ui_borg_radio - adding += using + static_inventory += using //Module select @@ -80,17 +77,17 @@ using = new /obj/screen/robot/module1() using.screen_loc = ui_inv1 - adding += using + static_inventory += using mymobR.inv1 = using using = new /obj/screen/robot/module2() using.screen_loc = ui_inv2 - adding += using + static_inventory += using mymobR.inv2 = using using = new /obj/screen/robot/module3() using.screen_loc = ui_inv3 - adding += using + static_inventory += using mymobR.inv3 = using //End of module select @@ -99,77 +96,54 @@ using = new /obj/screen/ai/image_take() using.screen_loc = ui_borg_camera - adding += using + static_inventory += using using = new /obj/screen/ai/image_view() using.screen_loc = ui_borg_album - adding += using + static_inventory += using //Sec/Med HUDs using = new /obj/screen/ai/sensors() using.screen_loc = ui_borg_sensor - adding += using + static_inventory += using //Headlamp control using = new /obj/screen/robot/lamp() using.screen_loc = ui_borg_lamp - adding += using + static_inventory += using mymobR.lamp_button = using //Intent - using = new /obj/screen/act_intent() - using.icon = 'icons/mob/screen_cyborg.dmi' + using = new /obj/screen/act_intent/robot() using.icon_state = mymob.a_intent - using.screen_loc = ui_borg_intents - adding += using + static_inventory += using action_intent = using //Health - mymob.healths = new /obj/screen() - mymob.healths.icon = 'icons/mob/screen_cyborg.dmi' - mymob.healths.icon_state = "health0" - mymob.healths.name = "health" - mymob.healths.screen_loc = ui_borg_health + healths = new /obj/screen/healths/robot() + infodisplay += healths //Installed Module mymob.hands = new /obj/screen/robot/module() mymob.hands.screen_loc = ui_borg_module + static_inventory += mymob.hands //Store - mymob.throw_icon = new /obj/screen/robot/store() - mymob.throw_icon.screen_loc = ui_borg_store + module_store_icon = new /obj/screen/robot/store() + module_store_icon.screen_loc = ui_borg_store - mymob.pullin = new /obj/screen/pull() - mymob.pullin.icon = 'icons/mob/screen_cyborg.dmi' - mymob.pullin.update_icon(mymob) - mymob.pullin.screen_loc = ui_borg_pull + pull_icon = new /obj/screen/pull() + pull_icon.icon = 'icons/mob/screen_cyborg.dmi' + pull_icon.update_icon(mymob) + pull_icon.screen_loc = ui_borg_pull + hotkeybuttons += pull_icon - mymob.blind = new /obj/screen() - mymob.blind.icon = 'icons/mob/screen_full.dmi' - mymob.blind.icon_state = "blackimageoverlay" - mymob.blind.name = " " - mymob.blind.screen_loc = "CENTER-7,CENTER-7" - mymob.blind.layer = 0 - mymob.blind.mouse_opacity = 0 + mymob.flash = new /obj/screen/flash() + screenoverlays += mymob.flash - mymob.flash = new /obj/screen() - mymob.flash.icon = 'icons/mob/screen_gen.dmi' - mymob.flash.icon_state = "blank" - mymob.flash.name = "flash" - mymob.flash.screen_loc = "WEST,SOUTH to EAST,NORTH" - mymob.flash.layer = 17 - - mymob.zone_sel = new /obj/screen/zone_sel() - mymob.zone_sel.icon = 'icons/mob/screen_cyborg.dmi' - mymob.zone_sel.update_icon() - - mymob.client.screen = list() - - mymob.client.screen += list(mymob.zone_sel, mymob.hands, mymob.healths, mymob.pullin, mymob.blind, mymob.flash) //, mymob.rest, mymob.sleep, mymob.mach ) - mymob.client.screen += adding + other - mymob.client.screen += mymob.client.void - - return + zone_select = new /obj/screen/zone_sel/robot() + zone_select.update_icon(mymob) + static_inventory += zone_select /datum/hud/proc/toggle_show_robot_modules() @@ -185,49 +159,77 @@ var/mob/living/silicon/robot/r = mymob - if(r.client) - if(r.shown_robot_modules) - //Modules display is shown - r.client.screen += r.throw_icon //"store" icon + if(!r.client) + return - if(!r.module) - usr << "No module selected" - return + if(!r.module) + return - if(!r.module.modules) - usr << "Selected module has no modules to select" - return + if(r.shown_robot_modules && hud_shown) + //Modules display is shown + r.client.screen += module_store_icon //"store" icon - if(!r.robot_modules_background) - return + if(!r.module.modules) + usr << "Selected module has no modules to select" + return - var/display_rows = Ceiling(length(r.module.get_inactive_modules()) / 8) - r.robot_modules_background.screen_loc = "CENTER-4:16,SOUTH+1:7 to CENTER+3:16,SOUTH+[display_rows]:7" - r.client.screen += r.robot_modules_background + if(!r.robot_modules_background) + return - var/x = -4 //Start at CENTER-4,SOUTH+1 - var/y = 1 + var/display_rows = Ceiling(length(r.module.get_inactive_modules()) / 8) + r.robot_modules_background.screen_loc = "CENTER-4:16,SOUTH+1:7 to CENTER+3:16,SOUTH+[display_rows]:7" + r.client.screen += r.robot_modules_background - for(var/atom/movable/A in r.module.get_inactive_modules()) - //Module is not currently active - r.client.screen += A - if(x < 0) - A.screen_loc = "CENTER[x]:16,SOUTH+[y]:7" - else - A.screen_loc = "CENTER+[x]:16,SOUTH+[y]:7" - A.layer = 20 + var/x = -4 //Start at CENTER-4,SOUTH+1 + var/y = 1 - x++ - if(x == 4) - x = -4 - y++ + for(var/atom/movable/A in r.module.get_inactive_modules()) + //Module is not currently active + r.client.screen += A + if(x < 0) + A.screen_loc = "CENTER[x]:16,SOUTH+[y]:7" + else + A.screen_loc = "CENTER+[x]:16,SOUTH+[y]:7" + A.layer = 20 - else - //Modules display is hidden - r.client.screen -= r.throw_icon //"store" icon + x++ + if(x == 4) + x = -4 + y++ - for(var/atom/A in r.module.get_inactive_modules()) - //Module is not currently active - r.client.screen -= A - r.shown_robot_modules = 0 - r.client.screen -= r.robot_modules_background \ No newline at end of file + else + //Modules display is hidden + r.client.screen -= module_store_icon //"store" icon + + for(var/atom/A in r.module.get_inactive_modules()) + //Module is not currently active + r.client.screen -= A + r.shown_robot_modules = 0 + r.client.screen -= r.robot_modules_background + +/mob/living/silicon/robot/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/robot(src) + + +/datum/hud/robot/persistant_inventory_update() + if(!mymob) + return + var/mob/living/silicon/robot/R = mymob + if(hud_shown) + if(R.module_state_1) + R.module_state_1.screen_loc = ui_inv1 + R.client.screen += R.module_state_1 + if(R.module_state_2) + R.module_state_2.screen_loc = ui_inv2 + R.client.screen += R.module_state_2 + if(R.module_state_3) + R.module_state_3.screen_loc = ui_inv3 + R.client.screen += R.module_state_3 + else + if(R.module_state_1) + R.module_state_1.screen_loc = null + if(R.module_state_2) + R.module_state_2.screen_loc = null + if(R.module_state_3) + R.module_state_3.screen_loc = null \ No newline at end of file diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 9681dd9b556..4b8130533d8 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -68,6 +68,7 @@ /obj/screen/act_intent name = "intent" icon_state = "help" + screen_loc = ui_acti /obj/screen/act_intent/Click(location, control, params) if(ishuman(usr) && (usr.client.prefs.toggles & INTENT_STYLE)) @@ -90,9 +91,18 @@ else usr.a_intent_change("right") +/obj/screen/act_intent/alien + icon = 'icons/mob/screen_alien.dmi' + screen_loc = ui_movi + +/obj/screen/act_intent/robot + icon = 'icons/mob/screen_cyborg.dmi' + screen_loc = ui_borg_intents + /obj/screen/internals name = "toggle internals" icon_state = "internal0" + screen_loc = ui_internal /obj/screen/internals/Click() if(iscarbon(usr)) @@ -267,12 +277,24 @@ selecting = "eyes" if(old_selecting != selecting) - update_icon() + update_icon(usr) return 1 -/obj/screen/zone_sel/update_icon() +/obj/screen/zone_sel/update_icon(mob/user) overlays.Cut() overlays += image('icons/mob/screen_gen.dmi', "[selecting]") + user.zone_selected = selecting + +/obj/screen/zone_sel/alien + icon = 'icons/mob/screen_alien.dmi' + +/obj/screen/zone_sel/alien/update_icon(mob/user) + overlays.Cut() + overlays += image('icons/mob/screen_alien.dmi', "[selecting]") + user.zone_selected = selecting + +/obj/screen/zone_sel/robot + icon = 'icons/mob/screen_cyborg.dmi' /obj/screen/inventory/Click() // At this point in client Click() code we have passed the 1/10 sec check and little else @@ -306,3 +328,47 @@ usr.update_inv_l_hand(0) usr.update_inv_r_hand(0) return 1 + +/obj/screen/flash + name = "flash" + icon_state = "blank" + blend_mode = BLEND_ADD + screen_loc = "WEST,SOUTH to EAST,NORTH" + layer = 17 + +/obj/screen/damageoverlay + icon = 'icons/mob/screen_full.dmi' + icon_state = "oxydamageoverlay0" + name = "dmg" + blend_mode = BLEND_MULTIPLY + screen_loc = "CENTER-7,CENTER-7" + mouse_opacity = 0 + layer = 18.1 //The black screen overlay sets layer to 18 to display it, this one has to be just on top. + +/obj/screen/healths + name = "health" + icon_state = "health0" + screen_loc = ui_health + +/obj/screen/healths/alien + icon = 'icons/mob/screen_alien.dmi' + screen_loc = ui_alien_health + +/obj/screen/healths/robot + icon = 'icons/mob/screen_cyborg.dmi' + screen_loc = ui_borg_health + +/obj/screen/healths/deity + name = "Nexus Health" + icon_state = "deity_nexus" + screen_loc = ui_deityhealth + +/obj/screen/healths/blob + name = "blob health" + icon_state = "block" + screen_loc = ui_internal + mouse_opacity = 0 + +/obj/screen/healthdoll + name = "health doll" + screen_loc = ui_healthdoll \ No newline at end of file diff --git a/code/_onclick/hud/swarmer.dm b/code/_onclick/hud/swarmer.dm new file mode 100644 index 00000000000..85ee9c4977f --- /dev/null +++ b/code/_onclick/hud/swarmer.dm @@ -0,0 +1,97 @@ + + +/obj/screen/swarmer + icon = 'icons/mob/swarmer.dmi' + +/obj/screen/swarmer/FabricateTrap + icon_state = "ui_trap" + name = "Create trap (Costs 5 Resources)" + desc = "Creates a trap that will nonlethally shock any non-swarmer that attempts to cross it. (Costs 5 resources)" + +/obj/screen/swarmer/FabricateTrap/Click() + if(isswarmer(usr)) + var/mob/living/simple_animal/hostile/swarmer/S = usr + S.CreateTrap() + +/obj/screen/swarmer/Barricade + icon_state = "ui_barricade" + name = "Create barricade (Costs 5 Resources)" + desc = "Creates a destructible barricade that will stop any non swarmer from passing it. Also allows disabler beams to pass through. (Costs 5 resources)" + +/obj/screen/swarmer/Barricade/Click() + if(isswarmer(usr)) + var/mob/living/simple_animal/hostile/swarmer/S = usr + S.CreateBarricade() + +/obj/screen/swarmer/Replicate + icon_state = "ui_replicate" + name = "Replicate (Costs 50 Resources)" + desc = "Creates a another of our kind." + +/obj/screen/swarmer/Replicate/Click() + if(isswarmer(usr)) + var/mob/living/simple_animal/hostile/swarmer/S = usr + S.CreateSwarmer() + +/obj/screen/swarmer/RepairSelf + icon_state = "ui_self_repair" + name = "Repair self" + desc = "Repairs damage to our body." + +/obj/screen/swarmer/RepairSelf/Click() + if(isswarmer(usr)) + var/mob/living/simple_animal/hostile/swarmer/S = usr + S.RepairSelf() + +/obj/screen/swarmer/ToggleLight + icon_state = "ui_light" + name = "Toggle light" + desc = "Toggles our inbuilt light on or off." + +/obj/screen/swarmer/ToggleLight/Click() + if(isswarmer(usr)) + var/mob/living/simple_animal/hostile/swarmer/S = usr + S.ToggleLight() + +/obj/screen/swarmer/ContactSwarmers + icon_state = "ui_contact_swarmers" + name = "Contact swarmers" + desc = "Sends a message to all other swarmers, should they exist." + +/obj/screen/swarmer/ContactSwarmers/Click() + if(isswarmer(usr)) + var/mob/living/simple_animal/hostile/swarmer/S = usr + S.ContactSwarmers() + +/datum/hud/swarmer/New(mob/owner) + ..() + var/obj/screen/using + + using = new /obj/screen/swarmer/FabricateTrap() + using.screen_loc = ui_rhand + static_inventory += using + + using = new /obj/screen/swarmer/Barricade() + using.screen_loc = ui_lhand + static_inventory += using + + using = new /obj/screen/swarmer/Replicate() + using.screen_loc = ui_zonesel + static_inventory += using + + using = new /obj/screen/swarmer/RepairSelf() + using.screen_loc = ui_storage1 + static_inventory += using + + using = new /obj/screen/swarmer/ToggleLight() + using.screen_loc = ui_back + static_inventory += using + + using = new /obj/screen/swarmer/ContactSwarmers() + using.screen_loc = ui_inventory + static_inventory += using + + +/mob/living/simple_animal/hostile/swarmer/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/swarmer(src) \ No newline at end of file diff --git a/code/controllers/subsystem/jobs.dm b/code/controllers/subsystem/jobs.dm index 456ae87304d..5964ff944fd 100644 --- a/code/controllers/subsystem/jobs.dm +++ b/code/controllers/subsystem/jobs.dm @@ -378,8 +378,6 @@ var/datum/subsystem/job/SSjob H << "You are playing a job that is important for Game Progression. If you have to disconnect, please notify the admins via adminhelp." if(config.minimal_access_threshold) H << "As this station was initially staffed with a [config.jobs_have_minimal_access ? "full crew, only your job's necessities" : "skeleton crew, additional access may"] have been added to your ID card." - - H.update_hud() // Tmp fix for Github issue 1006. TODO: make all procs in update_icons.dm do client.screen |= equipment no matter what. return 1 diff --git a/code/datums/diseases/_MobProcs.dm b/code/datums/diseases/_MobProcs.dm index 042e8ab3529..f5fcf511f2f 100644 --- a/code/datums/diseases/_MobProcs.dm +++ b/code/datums/diseases/_MobProcs.dm @@ -125,7 +125,7 @@ Cl = M.wear_mask passed = prob((Cl.permeability_coefficient*100) - 1) - if(!passed && (D.spread_flags & AIRBORNE) && !internals) + if(!passed && (D.spread_flags & AIRBORNE) && !internal) passed = (prob((50*D.permeability_mod) - 1)) if(passed) diff --git a/code/datums/diseases/advance/symptoms/vision.dm b/code/datums/diseases/advance/symptoms/vision.dm index 40932a88764..927ca426c3e 100644 --- a/code/datums/diseases/advance/symptoms/vision.dm +++ b/code/datums/diseases/advance/symptoms/vision.dm @@ -34,19 +34,17 @@ Bonus M << "Your eyes itch." if(3, 4) M << "Your eyes burn!" - M.eye_blurry = 10 - M.eye_stat += 1 + M.set_blurriness(max(M.eye_blurry,10)) + M.adjust_eye_stat(1) else M << "Your eyes burn horrificly!" - M.eye_blurry = 20 - M.eye_stat += 5 - if (M.eye_stat >= 10) - M.disabilities |= NEARSIGHT - if (prob(M.eye_stat - 10 + 1) && !(M.eye_blind)) - M << "You go blind!" - M.disabilities |= BLIND - M.eye_blind = 1 - return + M.set_blurriness(max(M.eye_blurry,20)) + M.adjust_eye_stat(5) + if(M.eye_stat >= 10) + M.become_nearsighted() + if(prob(M.eye_stat - 10 + 1)) + if(M.become_blind()) + M << "You go blind!" /* diff --git a/code/datums/diseases/advance/symptoms/weakness.dm b/code/datums/diseases/advance/symptoms/weakness.dm index f75f51e47b5..b0769680dc9 100644 --- a/code/datums/diseases/advance/symptoms/weakness.dm +++ b/code/datums/diseases/advance/symptoms/weakness.dm @@ -40,5 +40,5 @@ Bonus M.adjustStaminaLoss(30) if(M.getStaminaLoss() > 60 && !M.stat) M.visible_message("[M] faints!", "You swoon and faint...") - M.sleeping += 5 + M.AdjustSleeping(5) return diff --git a/code/datums/diseases/tuberculosis.dm b/code/datums/diseases/tuberculosis.dm index 19fed9d99db..2dc4403bb31 100644 --- a/code/datums/diseases/tuberculosis.dm +++ b/code/datums/diseases/tuberculosis.dm @@ -45,7 +45,7 @@ if(prob(10)) affected_mob.adjustStaminaLoss(100) affected_mob.visible_message("[affected_mob] faints!", "You surrender yourself and feel at peace...") - affected_mob.sleeping += 5 + affected_mob.AdjustSleeping(5) if(prob(2)) affected_mob << "You feel your mind relax and your thoughts drift!" affected_mob.confused = min(100, affected_mob.confused + 8) diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm index 6c22a9c08db..9ac03f96485 100644 --- a/code/datums/helper_datums/teleport.dm +++ b/code/datums/helper_datums/teleport.dm @@ -97,7 +97,6 @@ var/turf/destturf var/turf/curturf = get_turf(teleatom) - var/area/destarea = get_area(destination) if(precision) var/list/posturfs = list() var/center = get_turf(destination) @@ -120,16 +119,6 @@ else if(teleatom.Move(destturf)) playSpecials(destturf,effectout,soundout) - - if(isliving(teleatom)) - var/mob/living/L = teleatom - if(L.buckled) - L.buckled.unbuckle_mob() - if(L.buckled_mob) - L.unbuckle_mob(force=1) - - destarea.Entered(teleatom) - return 1 /datum/teleport/proc/teleport() diff --git a/code/datums/martial.dm b/code/datums/martial.dm index 64ffea2115c..38f7d23b054 100644 --- a/code/datums/martial.dm +++ b/code/datums/martial.dm @@ -41,7 +41,7 @@ add_logs(A, D, "attempted to [atk_verb]") return 0 - var/obj/item/organ/limb/affecting = D.get_organ(ran_zone(A.zone_sel.selecting)) + var/obj/item/organ/limb/affecting = D.get_organ(ran_zone(A.zone_selected)) var/armor_block = D.run_armor_check(affecting, "melee") playsound(D.loc, A.dna.species.attack_sound, 25, 1, -1) @@ -106,7 +106,7 @@ return 0 - var/obj/item/organ/limb/affecting = D.get_organ(ran_zone(A.zone_sel.selecting)) + var/obj/item/organ/limb/affecting = D.get_organ(ran_zone(A.zone_selected)) var/armor_block = D.run_armor_check(affecting, "melee") playsound(D.loc, A.dna.species.attack_sound, 25, 1, -1) @@ -181,7 +181,7 @@ D.grabbedby(A,1) D.visible_message("[A] holds [D] down!", \ "[A] holds [D] down!") - var/obj/item/organ/limb/affecting = D.get_organ(ran_zone(A.zone_sel.selecting)) + var/obj/item/organ/limb/affecting = D.get_organ(ran_zone(A.zone_selected)) var/armor_block = D.run_armor_check(affecting, "melee") D.apply_damage(10, STAMINA, affecting, armor_block) return 1 @@ -568,7 +568,7 @@ if(total_health <= config.health_threshold_crit && !H.stat) H.visible_message("[user] delivers a heavy hit to [H]'s head, knocking them out cold!", \ "[user] knocks you unconscious!") - H.sleeping += 30 + H.SetSleeping(30) H.adjustBrainLoss(25) return else diff --git a/code/datums/mutations.dm b/code/datums/mutations.dm index fe0df5ec3a3..6e01d874cea 100644 --- a/code/datums/mutations.dm +++ b/code/datums/mutations.dm @@ -202,19 +202,13 @@ /datum/mutation/human/x_ray/on_acquiring(mob/living/carbon/human/owner) if(..()) return - on_life(owner) -/datum/mutation/human/x_ray/on_life(mob/living/carbon/human/owner) - owner.sight |= SEE_MOBS|SEE_OBJS|SEE_TURFS - owner.see_in_dark = 8 + owner.update_sight() /datum/mutation/human/x_ray/on_losing(mob/living/carbon/human/owner) if(..()) return - if((SEE_MOBS & owner.permanent_sight_flags) && (SEE_OBJS & owner.permanent_sight_flags) && (SEE_TURFS & owner.permanent_sight_flags)) //Xray flag combo - return - owner.see_in_dark = initial(owner.see_in_dark) - owner.sight = initial(owner.sight) + owner.update_sight() /datum/mutation/human/nearsight @@ -225,12 +219,12 @@ /datum/mutation/human/nearsight/on_acquiring(mob/living/carbon/human/owner) if(..()) return - owner.disabilities |= NEARSIGHT + owner.become_nearsighted() /datum/mutation/human/nearsight/on_losing(mob/living/carbon/human/owner) if(..()) return - owner.disabilities &= ~NEARSIGHT + owner.cure_nearsighted() /datum/mutation/human/epilepsy @@ -239,7 +233,7 @@ text_gain_indication = "You get a headache." /datum/mutation/human/epilepsy/on_life(mob/living/carbon/human/owner) - if((prob(1) && owner.paralysis < 1)) + if(prob(1) && !owner.paralysis) owner.visible_message("[owner] starts having a seizure!", "You have a seizure!") owner.Paralyse(10) owner.Jitter(1000) @@ -368,15 +362,15 @@ /datum/mutation/human/blind/on_acquiring(mob/living/carbon/human/owner) if(..()) return - owner.disabilities |= BLIND + owner.become_blind() /datum/mutation/human/blind/on_losing(mob/living/carbon/human/owner) if(..()) return - owner.disabilities &= ~BLIND + owner.cure_blind() + /datum/mutation/human/race - name = "Monkified" quality = NEGATIVE time_coeff = 2 diff --git a/code/datums/spells/inflict_handler.dm b/code/datums/spells/inflict_handler.dm index 0f7230ef277..480ad8b2c97 100644 --- a/code/datums/spells/inflict_handler.dm +++ b/code/datums/spells/inflict_handler.dm @@ -50,8 +50,8 @@ target.Paralyse(amt_paralysis) target.Stun(amt_stunned) - target.eye_blind += amt_eye_blind - target.eye_blurry += amt_eye_blurry + target.set_blindness(max(target.eye_blind,amt_eye_blind)) + target.set_blurriness(max(target.eye_blurry,amt_eye_blurry)) //summoning if(summon_type) new summon_type(target.loc, target) \ No newline at end of file diff --git a/code/datums/spells/wizard.dm b/code/datums/spells/wizard.dm index 49e5d968f96..4976b6a4718 100644 --- a/code/datums/spells/wizard.dm +++ b/code/datums/spells/wizard.dm @@ -246,7 +246,7 @@ sound="sound/magic/Blind.ogg" /obj/effect/proc_holder/spell/targeted/genetic/blind - disabilities = BLIND + mutations = list(BLINDMUT) duration = 300 sound="sound/magic/Blind.ogg" diff --git a/code/datums/wires/robot.dm b/code/datums/wires/robot.dm index a01efe58d21..7bbe76b8fe9 100644 --- a/code/datums/wires/robot.dm +++ b/code/datums/wires/robot.dm @@ -39,7 +39,7 @@ var/const/BORG_WIRE_CAMERA = 16 if (BORG_WIRE_CAMERA) if(!isnull(R.camera) && !R.scrambledcodes) R.camera.status = mended - R.camera.deactivate(usr, 0) // Will kick anyone who is watching the Cyborg's camera. + R.camera.toggle_cam(usr, 0) // Will kick anyone who is watching the Cyborg's camera. if(BORG_WIRE_LAWCHECK) //Forces a law update if the borg is set to receive them. Since an update would happen when the borg checks its laws anyway, not much use, but eh if (R.lawupdate) @@ -82,9 +82,8 @@ var/const/BORG_WIRE_CAMERA = 16 if (BORG_WIRE_CAMERA) if(!isnull(R.camera) && R.camera.can_use() && !R.scrambledcodes) - R.camera.deactivate(usr, 0) // Kick anyone watching the Cyborg's camera, doesn't display you disconnecting the camera. - R.visible_message("[R]'s camera lense focuses loudly.") - R << "Your camera lense focuses loudly." + R.camera.toggle_cam(usr, 0) // Kick anyone watching the Cyborg's camera, doesn't display you disconnecting the camera. + R.visible_message("[R]'s camera lense focuses loudly.","Your camera lense focuses loudly.") if(BORG_WIRE_LOCKED_DOWN) R.SetLockdown(!R.lockcharge) // Toggle diff --git a/code/game/atoms.dm b/code/game/atoms.dm index efe8e4883fd..9bb3ceaca33 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -72,8 +72,6 @@ return null /atom/proc/check_eye(mob/user) - if (istype(user, /mob/living/silicon/ai)) // WHYYYY - return 1 return /atom/proc/on_reagent_change() @@ -369,3 +367,12 @@ var/list/blood_splatter_icons = list() /atom/Stat() . = ..() sleep(1) + + +//the vision impairment to give to the mob whose perspective is set to that atom (e.g. an unfocused camera giving you an impaired vision when looking through it) +/atom/proc/get_vision_impairments(mob/user) + return + +//the sight changes to give to the mob whose perspective is set to that atom (e.g. A mob with nightvision loses its nightvision while looking through a normal camera) +/atom/proc/update_remote_sight(mob/living/user) + return diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index a3c326abfa1..77e0de49f71 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -116,13 +116,46 @@ oldloc.Exited(src, destination) loc = destination destination.Entered(src, oldloc) + var/area/old_area = get_area(oldloc) + var/area/destarea = get_area(destination) + if(old_area != destarea) + destarea.Entered(src) for(var/atom/movable/AM in destination) - if(AM == src) continue + if(AM == src) + continue AM.Crossed(src) Moved(oldloc, 0) return 1 return 0 +/mob/living/forceMove(atom/destination) + stop_pulling() + if(pulledby) + pulledby.stop_pulling() + if(buckled) + buckled.unbuckle_mob() + if(buckled_mob) + unbuckle_mob(force=1) + . = ..() + if(client) + reset_perspective(destination) + if(pipes_shown.len && !istype(loc, /obj/machinery/atmospherics)) + remove_ventcrawl() + +/mob/living/carbon/brain/forceMove(atom/destination) + if(container) + container.forceMove(destination) + else //something went very wrong. + CRASH("Brainmob without container.") + + +/mob/living/silicon/pai/forceMove(atom/destination) + if(card) + card.forceMove(destination) + else //something went very wrong. + CRASH("pAI without card") + + //Called whenever an object moves and by mobs when they attempt to move themselves through space //And when an object or action applies a force on src, see newtonian_move() below //Return 0 to have src start/keep drifting in a no-grav area and 1 to stop/not start drifting diff --git a/code/game/data_huds.dm b/code/game/data_huds.dm index 3ae2e05f76d..14a79e8a9ae 100644 --- a/code/game/data_huds.dm +++ b/code/game/data_huds.dm @@ -102,18 +102,19 @@ //called when a carbon changes health /mob/living/carbon/proc/med_hud_set_health() var/image/holder = hud_list[HEALTH_HUD] - if(stat == 2) + if(stat == DEAD) holder.icon_state = "hudhealth-100" else holder.icon_state = "hud[RoundHealth(health)]" var/turf/T = get_turf(src) - if (T) crewmonitor.queueUpdate(T.z) + if (T) + crewmonitor.queueUpdate(T.z) //called when a carbon changes stat, virus or XENO_HOST /mob/living/carbon/proc/med_hud_set_status() var/image/holder = hud_list[STATUS_HUD] - if(stat == 2) + if(stat == DEAD) holder.icon_state = "huddead" else if(status_flags & XENO_HOST) holder.icon_state = "hudxeno" diff --git a/code/game/gamemodes/blob/blobs/core.dm b/code/game/gamemodes/blob/blobs/core.dm index 7771469a545..033ab808217 100644 --- a/code/game/gamemodes/blob/blobs/core.dm +++ b/code/game/gamemodes/blob/blobs/core.dm @@ -54,7 +54,7 @@ /obj/effect/blob/core/check_health() ..() if(overmind) //we should have an overmind, but... - overmind.update_health() + overmind.update_health_hud() /obj/effect/blob/core/RegenHealth() return // Don't regen, we handle it in Life() @@ -68,7 +68,7 @@ overmind.add_points(point_rate) health = min(maxhealth, health+health_regen) if(overmind) - overmind.update_health() + overmind.update_health_hud() Pulse_Area(overmind, 12, 4, 3) for(var/b_dir in alldirs) if(!prob(5)) diff --git a/code/game/gamemodes/blob/overmind.dm b/code/game/gamemodes/blob/overmind.dm index 439b1b01366..7c6eb820441 100644 --- a/code/game/gamemodes/blob/overmind.dm +++ b/code/game/gamemodes/blob/overmind.dm @@ -54,11 +54,11 @@ sync_mind() src << "You are the overmind!" blob_help() - update_health() + update_health_hud() -/mob/camera/blob/proc/update_health() +/mob/camera/blob/update_health_hud() if(blob_core) - hud_used.blobhealthdisplay.maptext = "
[round(blob_core.health)]
" + hud_used.healths.maptext = "
[round(blob_core.health)]
" /mob/camera/blob/proc/add_points(points) if(points != 0) @@ -120,158 +120,3 @@ /mob/camera/blob/proc/can_attack() return (world.time > (last_attack + CLICK_CD_RANGE)) - - -/obj/screen/blob - icon = 'icons/mob/blob.dmi' - -/obj/screen/blob/BlobHelp - icon_state = "ui_help" - name = "Blob Help" - desc = "Help on playing blob!" - -/obj/screen/blob/BlobHelp/Click() - if(isovermind(usr)) - var/mob/camera/blob/B = usr - B.blob_help() - -/obj/screen/blob/JumpToNode - icon_state = "ui_tonode" - name = "Jump to Node" - desc = "Moves your camera to a selected blob node." - -/obj/screen/blob/JumpToNode/Click() - if(isovermind(usr)) - var/mob/camera/blob/B = usr - B.jump_to_node() - -/obj/screen/blob/JumpToCore - icon_state = "ui_tocore" - name = "Jump to Core" - desc = "Moves your camera to your blob core." - -/obj/screen/blob/JumpToCore/Click() - if(isovermind(usr)) - var/mob/camera/blob/B = usr - B.transport_core() - -/obj/screen/blob/Blobbernaut - icon_state = "ui_blobbernaut" - name = "Produce Blobbernaut (20)" - desc = "Produces a blobbernaut for 20 points." - -/obj/screen/blob/Blobbernaut/Click() - if(isovermind(usr)) - var/mob/camera/blob/B = usr - B.create_blobbernaut() - -/obj/screen/blob/ResourceBlob - icon_state = "ui_resource" - name = "Produce Resource Blob (40)" - desc = "Produces a resource blob for 40 points." - -/obj/screen/blob/ResourceBlob/Click() - if(isovermind(usr)) - var/mob/camera/blob/B = usr - B.create_resource() - -/obj/screen/blob/NodeBlob - icon_state = "ui_node" - name = "Produce Node Blob (60)" - desc = "Produces a node blob for 60 points." - -/obj/screen/blob/NodeBlob/Click() - if(isovermind(usr)) - var/mob/camera/blob/B = usr - B.create_node() - -/obj/screen/blob/FactoryBlob - icon_state = "ui_factory" - name = "Produce Factory Blob (60)" - desc = "Produces a resource blob for 60 points." - -/obj/screen/blob/FactoryBlob/Click() - if(isovermind(usr)) - var/mob/camera/blob/B = usr - B.create_factory() - -/obj/screen/blob/ReadaptChemical - icon_state = "ui_chemswap" - name = "Readapt Chemical (40)" - desc = "Randomly rerolls your chemical for 40 points." - -/obj/screen/blob/ReadaptChemical/Click() - if(isovermind(usr)) - var/mob/camera/blob/B = usr - B.chemical_reroll() - -/obj/screen/blob/RelocateCore - icon_state = "ui_swap" - name = "Relocate Core (80)" - desc = "Swaps a node and your core for 80 points." - -/obj/screen/blob/RelocateCore/Click() - if(isovermind(usr)) - var/mob/camera/blob/B = usr - B.relocate_core() - -/datum/hud/proc/blob_hud(ui_style = 'icons/mob/screen_midnight.dmi') - adding = list() - - var/obj/screen/using - - blobpwrdisplay = new /obj/screen() - blobpwrdisplay.name = "blob power" - blobpwrdisplay.icon_state = "block" - blobpwrdisplay.screen_loc = ui_health - blobpwrdisplay.mouse_opacity = 0 - blobpwrdisplay.layer = 20 - adding += blobpwrdisplay - - blobhealthdisplay = new /obj/screen() - blobhealthdisplay.name = "blob health" - blobhealthdisplay.icon_state = "block" - blobhealthdisplay.screen_loc = ui_internal - blobhealthdisplay.mouse_opacity = 0 - blobhealthdisplay.layer = 20 - adding += blobhealthdisplay - - using = new /obj/screen/blob/BlobHelp() - using.screen_loc = "NORTH:-6,WEST:6" - adding += using - - using = new /obj/screen/blob/JumpToNode() - using.screen_loc = ui_inventory - adding += using - - using = new /obj/screen/blob/JumpToCore() - using.screen_loc = ui_zonesel - adding += using - - using = new /obj/screen/blob/Blobbernaut() - using.screen_loc = ui_belt - adding += using - - using = new /obj/screen/blob/ResourceBlob() - using.screen_loc = ui_back - adding += using - - using = new /obj/screen/blob/NodeBlob() - using.screen_loc = ui_lhand - adding += using - - using = new /obj/screen/blob/FactoryBlob() - using.screen_loc = ui_rhand - adding += using - - using = new /obj/screen/blob/ReadaptChemical() - using.screen_loc = ui_storage1 - adding += using - - using = new /obj/screen/blob/RelocateCore() - using.screen_loc = ui_storage2 - adding += using - - mymob.client.screen = list() - mymob.client.screen += mymob.client.void - mymob.client.screen += adding diff --git a/code/game/gamemodes/changeling/powers/adrenaline.dm b/code/game/gamemodes/changeling/powers/adrenaline.dm index 1d4a2d35084..4ebfbe1540d 100644 --- a/code/game/gamemodes/changeling/powers/adrenaline.dm +++ b/code/game/gamemodes/changeling/powers/adrenaline.dm @@ -10,12 +10,10 @@ //Recover from stuns. /obj/effect/proc_holder/changeling/adrenaline/sting_action(mob/living/user) user << "Energy rushes through us.[user.lying ? " We arise." : ""]" - user.stat = 0 + user.SetSleeping(0) user.SetParalysis(0) user.SetStunned(0) user.SetWeakened(0) - user.lying = 0 - user.update_canmove() user.reagents.add_reagent("changelingAdrenaline", 10) user.reagents.add_reagent("changelingAdrenaline2", 2) //For a really quick burst of speed user.adjustStaminaLoss(-75) diff --git a/code/game/gamemodes/changeling/powers/augmented_eyesight.dm b/code/game/gamemodes/changeling/powers/augmented_eyesight.dm index c929eda6b68..71f22c791b2 100644 --- a/code/game/gamemodes/changeling/powers/augmented_eyesight.dm +++ b/code/game/gamemodes/changeling/powers/augmented_eyesight.dm @@ -31,9 +31,6 @@ qdel(O) - - - /obj/item/organ/internal/cyberimp/eyes/shield/ling name = "protective membranes" desc = "These variable transparency organic membranes will protect you from welders and flashes and heal your eye damage." @@ -46,7 +43,7 @@ /obj/item/organ/internal/cyberimp/eyes/shield/ling/on_life() ..() - if(owner.eye_blind || owner.eye_stat || owner.eye_blurry || (owner.disabilities & BLIND) || (owner.disabilities & NEARSIGHT)) + if(owner.eye_blind>1 || (owner.eye_blind && owner.stat !=UNCONSCIOUS) || owner.eye_stat || owner.eye_blurry || (owner.disabilities & NEARSIGHT)) owner.reagents.add_reagent("oculine", 1) /obj/item/organ/internal/cyberimp/eyes/shield/ling/prepare_eat() diff --git a/code/game/gamemodes/changeling/powers/fakedeath.dm b/code/game/gamemodes/changeling/powers/fakedeath.dm index 9b6fd852606..05da0cb464a 100644 --- a/code/game/gamemodes/changeling/powers/fakedeath.dm +++ b/code/game/gamemodes/changeling/powers/fakedeath.dm @@ -12,6 +12,7 @@ /obj/effect/proc_holder/changeling/fakedeath/sting_action(mob/living/user) user << "We begin our stasis, preparing energy to arise once more." user.status_flags |= FAKEDEATH //play dead + user.update_stat() user.update_canmove() if(user.stat != DEAD) user.emote("deathgasp") diff --git a/code/game/gamemodes/changeling/powers/headcrab.dm b/code/game/gamemodes/changeling/powers/headcrab.dm index 71ffc3480ba..1ff2740a6c0 100644 --- a/code/game/gamemodes/changeling/powers/headcrab.dm +++ b/code/game/gamemodes/changeling/powers/headcrab.dm @@ -17,8 +17,8 @@ for(var/mob/living/carbon/human/H in range(2,user)) H << "You are blinded by a shower of blood!" H.Stun(1) - H.eye_blurry = 20 - H.eye_stat += 5 + H.set_blurriness(max(H.eye_blurry,20)) + H.adjust_eye_stat(5) H.confused += 3 for(var/mob/living/silicon/S in range(2,user)) S << "Your sensors are disabled by a shower of blood!" diff --git a/code/game/gamemodes/changeling/powers/horror_form.dm b/code/game/gamemodes/changeling/powers/horror_form.dm new file mode 100644 index 00000000000..f1dab9fe804 --- /dev/null +++ b/code/game/gamemodes/changeling/powers/horror_form.dm @@ -0,0 +1,28 @@ +/obj/effect/proc_holder/changeling/horror_form //Horror Form: turns the changeling into a terrifying abomination + name = "Horror Form" + desc = "We tear apart our human disguise, revealing our true form." + helptext = "We will become an unstoppable force of destruction. We will be able to turn back into a human after some time." + chemical_cost = 75 + dna_cost = 20 //Requires a massive amount of absorptions + req_human = 1 + +/obj/effect/proc_holder/changeling/horror_form/sting_action(mob/living/carbon/human/user) + if(!user || user.notransform) + return 0 + user.visible_message("[user] writhes and contorts, their body expanding to inhuman proportions!", \ + "We begin our transformation to our true form!") + if(!do_after(user, 30, target = user)) + user.visible_message("[user]'s transformation abruptly reverts itself!", \ + "Our transformation has been interrupted!") + return 0 + user.visible_message("[user] grows into an abomination and lets out an awful scream!", \ + "We cast off our petty shell and enter our true form!") + var/mob/living/simple_animal/hostile/true_changeling/new_mob = new(get_turf(user)) + new_mob.real_name = user.mind.changeling.changelingID + new_mob.name = new_mob.real_name + new_mob.stored_changeling = user + user.loc = new_mob + user.status_flags |= GODMODE + user.mind.transfer_to(new_mob) + feedback_add_details("changeling_powers","HF") + return 1 diff --git a/code/game/gamemodes/changeling/powers/revive.dm b/code/game/gamemodes/changeling/powers/revive.dm index 613f8bcf1b7..36e171ec8be 100644 --- a/code/game/gamemodes/changeling/powers/revive.dm +++ b/code/game/gamemodes/changeling/powers/revive.dm @@ -8,28 +8,28 @@ if(user.stat == DEAD) dead_mob_list -= user living_mob_list += user + user.status_flags &= ~(FAKEDEATH) + user.stat = UNCONSCIOUS user.tod = null - user.setToxLoss(0) - user.setOxyLoss(0) - user.setCloneLoss(0) - user.SetParalysis(0) - user.SetStunned(0) - user.SetWeakened(0) + user.toxloss = 0 + user.oxyloss = 0 + user.cloneloss = 0 + user.paralysis = 0 + user.stunned = 0 + user.weakened = 0 user.radiation = 0 - user.heal_overall_damage(user.getBruteLoss(), user.getFireLoss()) + user.sleeping = 0 + user.clear_alert("asleep") + user.heal_overall_damage(user.getBruteLoss(), user.getFireLoss(), 0) //not updating health & stat user.reagents.clear_reagents() if(ishuman(user)) var/mob/living/carbon/human/H = user H.restore_blood() H.remove_all_embedded_objects() user << "We have regenerated." - user.status_flags &= ~(FAKEDEATH) - user.update_canmove() user.mind.changeling.purchasedpowers -= src - user.med_hud_set_status() - user.med_hud_set_health() feedback_add_details("changeling_powers","CR") - user.stat = CONSCIOUS + user.updatehealth() return 1 /obj/effect/proc_holder/changeling/revive/can_be_used_by(mob/user) diff --git a/code/game/gamemodes/changeling/powers/swap_forms.dm b/code/game/gamemodes/changeling/powers/swap_forms.dm new file mode 100644 index 00000000000..a2b1fc62c24 --- /dev/null +++ b/code/game/gamemodes/changeling/powers/swap_forms.dm @@ -0,0 +1,53 @@ +/obj/effect/proc_holder/changeling/swap_form //Swap Forms: Allows the changeling to swap minds with another human + name = "Swap Forms" + desc = "We force ourselves into the body of another form, pushing their consciousness into the form we left behind." + helptext = "We will bring all our abilities with us, but we will lose our old form DNA in exchange for the new one. The process will seem suspicious to any observers." + chemical_cost = 40 + dna_cost = 1 + req_human = 1 //Monkeys can't grab + +/obj/effect/proc_holder/changeling/swap_form/can_sting(mob/living/carbon/user) + if(!..()) + return + var/obj/item/weapon/grab/G = user.get_active_hand() + if(!istype(G) || (G.state < GRAB_AGGRESSIVE)) + user << "We must have an aggressive grab on creature in our active hand to do this!" + return + var/mob/living/carbon/target = G.affecting + if((target.disabilities & NOCLONE) || (target.disabilities & HUSK)) + user << "DNA of [target] is ruined beyond usability!" + return + if(!ishuman(target)) + user << "[target] is not compatible with this ability." + return + return 1 + + +/obj/effect/proc_holder/changeling/swap_form/sting_action(mob/living/carbon/user) + var/obj/item/weapon/grab/G = user.get_active_hand() + var/mob/living/carbon/target = G.affecting + var/datum/changeling/changeling = user.mind.changeling + + user << "We tighen our grip. We must hold still...." + target.do_jitter_animation(500) + user.do_jitter_animation(500) + + if(!do_mob(user,target,20)) + user << "The body swap has been interrupted!" + return + + target << "[user] tightens their grip as a painful sensation invades your body." + + if(!changeling.has_dna(target.dna)) + changeling.add_profile(target, user) + changeling.remove_profile(user) + + var/mob/dead/observer/ghost = target.ghostize(0) + user.mind.transfer_to(target) + if(ghost && ghost.mind) + ghost.mind.transfer_to(user) + else + user.key = ghost.key + + user.Paralyse(2) + target << "Our genes cry out as we swap our [user] form for [target]." diff --git a/code/game/gamemodes/changeling/powers/synaptic_enhancement.dm b/code/game/gamemodes/changeling/powers/synaptic_enhancement.dm new file mode 100644 index 00000000000..7bace751249 --- /dev/null +++ b/code/game/gamemodes/changeling/powers/synaptic_enhancement.dm @@ -0,0 +1,20 @@ +/obj/effect/proc_holder/changeling/synaptic_enhancement //Synaptic Enhancement; allows changelings to attack faster + name = "Synaptic Enhancement" + desc = "We redirect mental pathways to devote more energy to muscle movement." + helptext = "The delay between attacks and actions will be halved." + dna_cost = 5 + chemical_cost = 25 + var/active = FALSE + +/obj/effect/proc_holder/changeling/synaptic_enhancement/sting_action(mob/user) + active = !active + user << "We [active ? "quicken our mind" : "return to normal"]." + if(active) + user.next_move_modifier = 0.5 + else + user.next_move_modifier = initial(user.next_move_modifier) + feedback_add_details("changeling_powers","SE") + return 1 + +/obj/effect/proc_holder/changeling/synaptic_enhancement/on_refund(mob/user) + user.next_move_modifier = initial(user.next_move_modifier) diff --git a/code/game/gamemodes/changeling/powers/tiny_prick.dm b/code/game/gamemodes/changeling/powers/tiny_prick.dm index d5e3c54277c..bd8b4a4b2b7 100644 --- a/code/game/gamemodes/changeling/powers/tiny_prick.dm +++ b/code/game/gamemodes/changeling/powers/tiny_prick.dm @@ -201,12 +201,12 @@ chemical_cost = 25 dna_cost = 1 -/obj/effect/proc_holder/changeling/sting/blind/sting_action(mob/user, mob/target) +/obj/effect/proc_holder/changeling/sting/blind/sting_action(mob/user, mob/living/carbon/target) add_logs(user, target, "stung", "blind sting") target << "Your eyes burn horrifically!" - target.disabilities |= NEARSIGHT - target.eye_blind = 20 - target.eye_blurry = 40 + target.become_nearsighted() + target.set_blindness(20) + target.set_blurriness(40) feedback_add_details("changeling_powers","BS") return 1 diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index bdec6fc038c..0424bbc4443 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -192,8 +192,6 @@ var/list/teleport_runes = list() return var/obj/effect/rune/selected_rune = pick(potential_runes) - if(user.buckled) - user.buckled.unbuckle_mob() user.visible_message("[user] vanishes in a flash of red light!", \ "Your vision blurs, and you suddenly appear somewhere else.") user.forceMove(get_turf(selected_rune)) @@ -256,8 +254,7 @@ var/list/teleport_other_runes = list() return else target = targets[targets.len] - if(target.buckled) - target.buckled.unbuckle_mob() + target.visible_message("[target] vanishes in a flash of red light!", \ "Your vision blurs, and you suddenly appear somewhere else.") target.forceMove(get_turf(selected_rune)) @@ -580,8 +577,8 @@ var/list/teleport_other_runes = list() C << "You feel oily shadows cover your senses." C.adjustEarDamage(0,50) C.flash_eyes(1, 1) - C.eye_blurry += 50 - C.eye_blind += 20 + C.adjust_blurriness(50) + C.adjust_blindness(20) C.silent += 10 qdel(src) diff --git a/code/game/gamemodes/handofgod/god.dm b/code/game/gamemodes/handofgod/god.dm index 3c445a09756..771141213f4 100644 --- a/code/game/gamemodes/handofgod/god.dm +++ b/code/game/gamemodes/handofgod/god.dm @@ -73,10 +73,10 @@ /mob/camera/god/update_icons() icon_state = "[initial(icon_state)]-[side]" - + if(ghostimage) ghost_darkness_images -= ghostimage - + ghostimage = image(src.icon,src,src.icon_state) ghost_darkness_images |= ghostimage updateallghostimages() @@ -104,9 +104,9 @@ update_health_hud() -/mob/camera/god/proc/update_health_hud() - if(god_nexus && hud_used && hud_used.deity_health_display) - hud_used.deity_health_display.maptext = "
[god_nexus.health]
" +/mob/camera/god/update_health_hud() + if(god_nexus && hud_used && hud_used.healths) + hud_used.healths.maptext = "
[god_nexus.health]
" /mob/camera/god/proc/add_faith(faith_amt) diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm index 6b1041d2d2e..f2b5a818219 100644 --- a/code/game/gamemodes/malfunction/Malf_Modules.dm +++ b/code/game/gamemodes/malfunction/Malf_Modules.dm @@ -471,7 +471,7 @@ var/initial_range = initial(C.view_range) //To prevent calling the proc twice if(camera.uses > 0) if(!C.status) - C.deactivate(src, 0) //Reactivates the camera based on status. Badly named proc. + C.toggle_cam(src, 0) //Reactivates the camera based on status. Badly named proc. fixedcams++ camera.uses-- if(C.view_range != initial_range) diff --git a/code/game/gamemodes/miniantags/abduction/abduction_gear.dm b/code/game/gamemodes/miniantags/abduction/abduction_gear.dm index a14280395e6..5e929b98c82 100644 --- a/code/game/gamemodes/miniantags/abduction/abduction_gear.dm +++ b/code/game/gamemodes/miniantags/abduction/abduction_gear.dm @@ -100,13 +100,10 @@ if(combat_cooldown != initial(combat_cooldown)) src.loc << "Combat injection is still recharging." var/mob/living/carbon/human/M = src.loc - M.stat = 0 + M.adjustStaminaLoss(-75) M.SetParalysis(0) M.SetStunned(0) M.SetWeakened(0) - M.lying = 0 - M.update_canmove() - M.adjustStaminaLoss(-75) combat_cooldown = 0 SSobj.processing |= src @@ -458,11 +455,10 @@ Congratulations! You are now trained for xenobiology research!"} /obj/item/weapon/abductor_baton/proc/SleepAttack(mob/living/L,mob/living/user) if(L.stunned) - L.SetSleeping(60) L.visible_message("[user] has induced sleep in [L] with [src]!", \ "You suddenly feel very drowsy!") playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1) - + L.Sleeping(60) add_logs(user, L, "put to sleep") else L.drowsyness += 1 @@ -482,7 +478,7 @@ Congratulations! You are now trained for xenobiology research!"} if(do_mob(user, C, 30)) if(!C.handcuffed) C.handcuffed = new /obj/item/weapon/restraints/handcuffs/energy/used(C) - C.update_inv_handcuffed(0) + C.update_handcuffed() user << "You handcuff [C]." add_logs(user, C, "handcuffed") else diff --git a/code/game/gamemodes/miniantags/abduction/machinery/camera.dm b/code/game/gamemodes/miniantags/abduction/machinery/camera.dm index 75f58e9cd4b..0806aad2787 100644 --- a/code/game/gamemodes/miniantags/abduction/machinery/camera.dm +++ b/code/game/gamemodes/miniantags/abduction/machinery/camera.dm @@ -59,7 +59,6 @@ var/mob/living/carbon/C = target var/mob/camera/aiEye/remote/remote_eye = C.remote_control var/obj/machinery/computer/camera_advanced/abductor/origin = remote_eye.origin - C.remote_view = 0 origin.current_user = null origin.jump_action.Remove(C) origin.tele_in_action.Remove(C) @@ -67,10 +66,9 @@ origin.tele_self_action.Remove(C) origin.vest_mode_action.Remove(C) origin.vest_disguise_action.Remove(C) - remote_eye.user = null + remote_eye.eye_user = null + C.reset_perspective(null) if(C.client) - C.client.perspective = MOB_PERSPECTIVE - C.client.eye = src C.client.images -= remote_eye.user_image for(var/datum/camerachunk/chunk in remote_eye.visibleCameraChunks) C.client.images -= chunk.obscured diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm index da0a9add2ce..c5fd31ba656 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm @@ -148,7 +148,7 @@ /obj/machinery/camera/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) S.DisIntegrate(src) - deactivate(S, 0) + toggle_cam(S, 0) /obj/machinery/particle_accelerator/control_box/swarmer_act(mob/living/simple_animal/hostile/swarmer/S) S.DisIntegrate(src) @@ -502,102 +502,3 @@ if(isswarmer(M) || (M in dead_mob_list)) M << "Swarm communication - [src] states: [message]" - - -////HUD NONSENSE//// -/obj/screen/swarmer - icon = 'icons/mob/swarmer.dmi' - -/obj/screen/swarmer/FabricateTrap - icon_state = "ui_trap" - name = "Create trap (Costs 5 Resources)" - desc = "Creates a trap that will nonlethally shock any non-swarmer that attempts to cross it. (Costs 5 resources)" - -/obj/screen/swarmer/FabricateTrap/Click() - if(isswarmer(usr)) - var/mob/living/simple_animal/hostile/swarmer/S = usr - S.CreateTrap() - -/obj/screen/swarmer/Barricade - icon_state = "ui_barricade" - name = "Create barricade (Costs 5 Resources)" - desc = "Creates a destructible barricade that will stop any non swarmer from passing it. Also allows disabler beams to pass through. (Costs 5 resources)" - -/obj/screen/swarmer/Barricade/Click() - if(isswarmer(usr)) - var/mob/living/simple_animal/hostile/swarmer/S = usr - S.CreateBarricade() - -/obj/screen/swarmer/Replicate - icon_state = "ui_replicate" - name = "Replicate (Costs 50 Resources)" - desc = "Creates a another of our kind." - -/obj/screen/swarmer/Replicate/Click() - if(isswarmer(usr)) - var/mob/living/simple_animal/hostile/swarmer/S = usr - S.CreateSwarmer() - -/obj/screen/swarmer/RepairSelf - icon_state = "ui_self_repair" - name = "Repair self" - desc = "Repairs damage to our body." - -/obj/screen/swarmer/RepairSelf/Click() - if(isswarmer(usr)) - var/mob/living/simple_animal/hostile/swarmer/S = usr - S.RepairSelf() - -/obj/screen/swarmer/ToggleLight - icon_state = "ui_light" - name = "Toggle light" - desc = "Toggles our inbuilt light on or off." - -/obj/screen/swarmer/ToggleLight/Click() - if(isswarmer(usr)) - var/mob/living/simple_animal/hostile/swarmer/S = usr - S.ToggleLight() - -/obj/screen/swarmer/ContactSwarmers - icon_state = "ui_contact_swarmers" - name = "Contact swarmers" - desc = "Sends a message to all other swarmers, should they exist." - -/obj/screen/swarmer/ContactSwarmers/Click() - if(isswarmer(usr)) - var/mob/living/simple_animal/hostile/swarmer/S = usr - S.ContactSwarmers() - -/datum/hud/proc/swarmer_hud(ui_style = 'icons/mob/screen_midnight.dmi') - adding = list() - - var/obj/screen/using - - using = new /obj/screen/swarmer/FabricateTrap() - using.screen_loc = ui_rhand - adding += using - - using = new /obj/screen/swarmer/Barricade() - using.screen_loc = ui_lhand - adding += using - - using = new /obj/screen/swarmer/Replicate() - using.screen_loc = ui_zonesel - adding += using - - using = new /obj/screen/swarmer/RepairSelf() - using.screen_loc = ui_storage1 - adding += using - - using = new /obj/screen/swarmer/ToggleLight() - using.screen_loc = ui_back - adding += using - - using = new /obj/screen/swarmer/ContactSwarmers() - using.screen_loc = ui_inventory - adding += using - - mymob.client.screen = list() - mymob.client.screen += mymob.client.void - mymob.client.screen += adding - diff --git a/code/game/gamemodes/sandbox/h_sandbox.dm b/code/game/gamemodes/sandbox/h_sandbox.dm index 73ab2b3423c..96271d1795a 100644 --- a/code/game/gamemodes/sandbox/h_sandbox.dm +++ b/code/game/gamemodes/sandbox/h_sandbox.dm @@ -169,8 +169,7 @@ var/hsboxspawn = 1 P.back.layer = 20 P.update_inv_back() P.internal = P.back - if(P.internals) - P.internals.icon_state = "internal1" + P.update_internals_hud_icon(1) if("hsbscrubber") // This is beyond its normal capability but this is sandbox and you spawned one, I assume you need it var/obj/hsb = new/obj/machinery/portable_atmospherics/scrubber{volume_rate=50*ONE_ATMOSPHERE;on=1}(usr.loc) diff --git a/code/game/gamemodes/shadowling/shadowling_abilities.dm b/code/game/gamemodes/shadowling/shadowling_abilities.dm index 151b8b6a160..810210993fd 100644 --- a/code/game/gamemodes/shadowling/shadowling_abilities.dm +++ b/code/game/gamemodes/shadowling/shadowling_abilities.dm @@ -416,10 +416,11 @@ datum/reagent/shadowling_blindness_smoke //Reagent used for above spell metabolization_rate = 100 //lel /datum/reagent/shadowling_blindness_smoke/on_mob_life(mob/living/M) - if(!M) M = holder.my_atom + if(!M) + M = holder.my_atom if(!is_shadow_or_thrall(M)) M << "You breathe in the black smoke, and your eyes burn horribly!" - M.eye_blind = 5 + M.set_blindness(5) if(prob(25)) M.visible_message("[M] claws at their eyes!") M.Stun(3) diff --git a/code/game/gamemodes/wizard/artefact.dm b/code/game/gamemodes/wizard/artefact.dm index 9ba6d74ce4a..15208b23356 100644 --- a/code/game/gamemodes/wizard/artefact.dm +++ b/code/game/gamemodes/wizard/artefact.dm @@ -504,7 +504,7 @@ var/global/list/multiverse = list() target.bodytemperature += 50 GiveHint(target) else if(is_pointed(I)) - target << "You feel a stabbing pain in [parse_zone(user.zone_sel.selecting)]!" + target << "You feel a stabbing pain in [parse_zone(user.zone_selected)]!" target.Weaken(2) GiveHint(target) else if(istype(I,/obj/item/weapon/bikehorn)) @@ -525,14 +525,16 @@ var/global/list/multiverse = list() ..() /obj/item/voodoo/check_eye(mob/user) - return src.loc == user + if(loc != user) + user.reset_perspective(null) + user.unset_machine() /obj/item/voodoo/attack_self(mob/user) if(!target && possible.len) target = input(user, "Select your victim!", "Voodoo") as null|anything in possible return - if(user.zone_sel.selecting == "chest") + if(user.zone_selected == "chest") if(link) target = null link.loc = get_turf(src) @@ -542,18 +544,16 @@ var/global/list/multiverse = list() return if(target && cooldown < world.time) - switch(user.zone_sel.selecting) + switch(user.zone_selected) if("mouth") var/wgw = sanitize(input(user, "What would you like the victim to say", "Voodoo", null) as text) target.say(wgw) log_game("[user][user.key] made [target][target.key] say [wgw] with a voodoo doll.") if("eyes") user.set_machine(src) - if(user.client) - user.client.eye = target - user.client.perspective = EYE_PERSPECTIVE + user.reset_perspective(target) spawn(100) - user.reset_view() + user.reset_perspective(null) user.unset_machine() if("r_leg","l_leg") user << "You move the doll's legs around." diff --git a/code/game/gamemodes/wizard/raginmages.dm b/code/game/gamemodes/wizard/raginmages.dm index 46addfb7f6d..03f6db9d07e 100644 --- a/code/game/gamemodes/wizard/raginmages.dm +++ b/code/game/gamemodes/wizard/raginmages.dm @@ -54,22 +54,22 @@ if(wizard.current.stat==UNCONSCIOUS) if(wizard.current.health < 0) wizard.current << "The Space Wizard Federation is upset with your performance and have terminated your employment." - wizard.current.stat = 2 + wizard.current.death() continue wizards_alive++ - if(!time_checked) + if(!time_checked) time_checked = world.time if(bullshit_mode) if(world.time > time_checked + time_check) max_mages = INFINITY time_checked = world.time - make_more_mages() + make_more_mages() return ..() if (wizards_alive) if(world.time > time_checked + time_check && (mages_made < max_mages)) time_checked = world.time make_more_mages() - + else if(mages_made >= max_mages) finished = 1 diff --git a/code/game/gamemodes/wizard/spellbook.dm b/code/game/gamemodes/wizard/spellbook.dm index 9d09dbdd948..581cb9585b5 100644 --- a/code/game/gamemodes/wizard/spellbook.dm +++ b/code/game/gamemodes/wizard/spellbook.dm @@ -744,7 +744,7 @@ /obj/item/weapon/spellbook/oneuse/blind/recoil(mob/user) ..() user <<"You go blind!" - user.eye_blind = 10 + user.set_blindness(10) /obj/item/weapon/spellbook/oneuse/mindswap spell = /obj/effect/proc_holder/spell/targeted/mind_transfer diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 922c0a71cd5..aa31b2a6c94 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -100,9 +100,7 @@ return for(var/atom/movable/O in src) O.loc = loc - if(occupant.client) - occupant.client.eye = occupant.client.mob - occupant.client.perspective = MOB_PERSPECTIVE + occupant.reset_perspective(null) occupant = null icon_state = "sleeper-open" diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 723f6b7a10b..49905c54ab3 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -879,15 +879,9 @@ FIRE ALARM src.alarm() // added check of detector status here return -/obj/machinery/firealarm/attack_ai(mob/user as mob) - return src.attack_hand(user) - /obj/machinery/firealarm/bullet_act(BLAH) return src.alarm() -/obj/machinery/firealarm/attack_paw(mob/user) - return src.attack_hand(user) - /obj/machinery/firealarm/emp_act(severity) if(prob(50/severity)) alarm() ..() diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 58fa41b44d9..7b89d807e5c 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -51,10 +51,10 @@ /obj/machinery/camera/initialize() if(z == 1 && prob(3) && !start_active) - deactivate() + toggle_cam() /obj/machinery/camera/Destroy() - deactivate(null, 0) //kick anyone viewing out + toggle_cam(null, 0) //kick anyone viewing out if(assembly) qdel(assembly) assembly = null @@ -97,7 +97,7 @@ for(var/mob/O in mob_list) if (O.client && O.client.eye == src) O.unset_machine() - O.reset_view(null) + O.reset_perspective(null) O << "The screen bursts into static." ..() @@ -127,7 +127,7 @@ playsound(src.loc, 'sound/weapons/slash.ogg', 100, 1) health = max(0, health - 30) if(!health && status) - deactivate(user, 0) + toggle_cam(user, 0) /obj/machinery/camera/attackby(obj/W, mob/living/user, params) var/msg = "You attach [W] into the assembly's inner circuits." @@ -142,7 +142,7 @@ if(panel_open) if(istype(W, /obj/item/weapon/wirecutters)) //enable/disable the camera - deactivate(user, 1) + toggle_cam(user, 1) health = initial(health) //this is a pretty simplistic way to heal the camera, but there's no reason for this to be complex. else if(istype(W, /obj/item/device/multitool)) //change focus @@ -241,10 +241,10 @@ user.do_attack_animation(src) if(!health && status) triggerCameraAlarm() - deactivate(user, 1) + toggle_cam(user, 1) return -/obj/machinery/camera/proc/deactivate(mob/user, displaymessage = 1) //this should be called toggle() but doing a find and replace for this would be ass +/obj/machinery/camera/proc/toggle_cam(mob/user, displaymessage = 1) status = !status if(can_use()) cameranet.addCamera(src) @@ -277,7 +277,7 @@ for(var/mob/O in player_list) if (O.client && O.client.eye == src) O.unset_machine() - O.reset_view(null) + O.reset_perspective(null) O << "The screen bursts into static." /obj/machinery/camera/proc/triggerCameraAlarm() @@ -363,7 +363,7 @@ health = max(0, health - proj.damage) if(!health && status) triggerCameraAlarm() - deactivate(null, 1) + toggle_cam(null, 1) /obj/machinery/camera/portable //Cameras which are placed inside of things, such as helmets. var/turf/prev_turf @@ -378,3 +378,18 @@ if(cameranet && get_turf(src) != prev_turf) cameranet.updatePortableCamera(src) prev_turf = get_turf(src) + +/obj/machinery/camera/get_vision_impairments(mob/user) + . = list() + if(view_range == short_range) //unfocused + . += global_hud.darkMask + +/obj/machinery/camera/update_remote_sight(mob/living/user) + user.see_invisible = SEE_INVISIBLE_LIVING //can't see ghosts through cameras + if(isXRay()) + user.sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS) + user.see_in_dark = max(user.see_in_dark, 8) + else + user.sight = 0 + user.see_in_dark = 2 + return 1 \ No newline at end of file diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 627f5727480..6c1b7ab09b8 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -322,11 +322,9 @@ O.loc = src.loc */ - if (occupant.client) - occupant.client.eye = occupant.client.mob - occupant.client.perspective = MOB_PERSPECTIVE if(occupant.loc == src) occupant.loc = loc + occupant.reset_perspective(null) icon_state = "pod_0" eject_wait = 0 //If it's still set somehow. occupant.domutcheck() //Waiting until they're out before possible monkeyizing. diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index cae5d5e445d..0bdb44931a3 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -4,89 +4,140 @@ icon_screen = "cameras" icon_keyboard = "security_key" circuit = /obj/item/weapon/circuitboard/security - var/obj/machinery/camera/current = null var/last_pic = 1 var/list/network = list("SS13") var/mapping = 0//For the overview file, interesting bit of code. + var/list/watchers = list() //who's using the console, associated with the camera they're on. /obj/machinery/computer/security/check_eye(mob/user) - if ((get_dist(user, src) > 1 || user.eye_blind || !( current ) || !( current.status )) && (!istype(user, /mob/living/silicon))) - return null - var/list/viewing = viewers(src) - if((istype(user,/mob/living/silicon/robot)) && (!(viewing.Find(user)))) - return null - user.reset_view(current) - return 1 + if( (stat & (NOPOWER|BROKEN)) || user.incapacitated() || user.eye_blind ) + user.unset_machine() + return + if(!(user in watchers)) + user.unset_machine() + return + if(!watchers[user]) + user.unset_machine() + return + var/obj/machinery/camera/C = watchers[user] + if(!C.can_use()) + user.unset_machine() + return + if(!issilicon(user)) + if(!Adjacent(user)) + user.unset_machine() + return + else if(isrobot(user)) + var/list/viewing = viewers(src) + if(!viewing.Find(user)) + user.unset_machine() +/obj/machinery/computer/security/on_unset_machine(mob/user) + watchers.Remove(user) + user.reset_perspective(null) + +/obj/machinery/computer/security/Destroy() + if(watchers.len) + for(var/mob/M in watchers) + M.unset_machine() //to properly reset the view of the users if the console is deleted. + return ..() /obj/machinery/computer/security/attack_hand(mob/user) - if(!stat) - - if (!network) - throw EXCEPTION("No camera network") - return - if (!(istype(network,/list))) - throw EXCEPTION("Camera network is not a list") - return - - if(..()) - return - - var/list/L = list() - for (var/obj/machinery/camera/C in cameranet.cameras) - if((z > ZLEVEL_SPACEMAX || C.z > ZLEVEL_SPACEMAX) && (C.z != z))//if on away mission, can only recieve feed from same z_level cameras - continue - L.Add(C) - - camera_sort(L) - - var/list/D = list() - D["Cancel"] = "Cancel" - for(var/obj/machinery/camera/C in L) - if(!C.network) - spawn(0) - throw EXCEPTION("Camera in a cameranet has no camera network") - continue - if(!(istype(C.network,/list))) - spawn(0) - throw EXCEPTION("Camera in a cameranet has a non-list camera network") - continue - var/list/tempnetwork = C.network&network - if(tempnetwork.len) - D[text("[][]", C.c_tag, (C.status ? null : " (Deactivated)"))] = C - - var/t = input(user, "Which camera should you change to?") as null|anything in D - if(!t) - user.unset_machine() - return 0 - - var/obj/machinery/camera/C = D[t] - - if(t == "Cancel") - user.unset_machine() - return 0 - - if(C) - if ((get_dist(user, src) > 1 || user.machine != src || user.eye_blind || !( C.can_use() )) && (!istype(user, /mob/living/silicon/ai))) - user.unset_machine() - if(!C.can_use() && !isAI(user)) - src.current = null - - return 0 - else - if(isAI(user)) - var/mob/living/silicon/ai/A = user - A.eyeobj.setLoc(get_turf(C)) - A.client.eye = A.eyeobj - else - src.current = C - use_power(50) - - spawn(5) - attack_hand(user) + if(stat) + return + if (!network) + throw EXCEPTION("No camera network") + user.unset_machine() + return + if (!(istype(network,/list))) + throw EXCEPTION("Camera network is not a list") + user.unset_machine() + return + if(..()) + user.unset_machine() return + var/list/camera_list = get_available_cameras() + if(!(user in watchers)) + for(var/Num in camera_list) + var/obj/machinery/camera/CAM = camera_list[Num] + if(istype(CAM)) + if(CAM.can_use()) + watchers[user] = CAM //let's give the user the first usable camera, and then let him change to the camera he wants. + break + if(!(user in watchers)) + user.unset_machine() // no usable camera on the network, we disconnect the user from the computer. + return + use_camera_console(user) +/obj/machinery/computer/security/proc/use_camera_console(mob/user) + var/list/camera_list = get_available_cameras() + var/t = input(user, "Which camera should you change to?") as null|anything in camera_list + if(user.machine != src) //while we were choosing we got disconnected from our computer or are using another machine. + return + if(!t) + user.unset_machine() + return + + var/obj/machinery/camera/C = camera_list[t] + + if(t == "Cancel") + user.unset_machine() + return + if(C) + var/camera_fail = 0 + if(!C.can_use() || user.machine != src || user.eye_blind || user.incapacitated()) + camera_fail = 1 + else if(isrobot(user)) + var/list/viewing = viewers(src) + if(!viewing.Find(user)) + camera_fail = 1 + else if(!issilicon(user)) + if(!Adjacent(user)) + camera_fail = 1 + + if(camera_fail) + user.unset_machine() + return 0 + + if(isAI(user)) + var/mob/living/silicon/ai/A = user + A.eyeobj.setLoc(get_turf(C)) + A.client.eye = A.eyeobj + else + user.reset_perspective(C) + watchers[user] = C + use_power(50) + spawn(5) + use_camera_console(user) + else + user.unset_machine() + +//returns the list of cameras accessible from this computer +/obj/machinery/computer/security/proc/get_available_cameras() + var/list/L = list() + for (var/obj/machinery/camera/C in cameranet.cameras) + if((z > ZLEVEL_SPACEMAX || C.z > ZLEVEL_SPACEMAX) && (C.z != z))//if on away mission, can only recieve feed from same z_level cameras + continue + L.Add(C) + + camera_sort(L) + + var/list/D = list() + D["Cancel"] = "Cancel" + for(var/obj/machinery/camera/C in L) + if(!C.network) + spawn(0) + throw EXCEPTION("Camera in a cameranet has no camera network") + continue + if(!(istype(C.network,/list))) + spawn(0) + throw EXCEPTION("Camera in a cameranet has a non-list camera network") + continue + var/list/tempnetwork = C.network&network + if(tempnetwork.len) + D["[C.c_tag][(C.status ? null : " (Deactivated)")]"] = C + return D /obj/machinery/computer/security/telescreen name = "\improper Telescreen" diff --git a/code/game/machinery/computer/camera_advanced.dm b/code/game/machinery/computer/camera_advanced.dm index 996b181c534..1e6e563a1fa 100644 --- a/code/game/machinery/computer/camera_advanced.dm +++ b/code/game/machinery/computer/camera_advanced.dm @@ -20,71 +20,94 @@ jump_action.Grant(user) /obj/machinery/computer/camera_advanced/check_eye(mob/user) - if (get_dist(user, src) > 1 || user.eye_blind) - if(user == current_user) - off_action.Activate() - return 0 - return 1 + if( (stat & (NOPOWER|BROKEN)) || !Adjacent(user) || user.eye_blind || user.incapacitated() ) + user.unset_machine() + +/obj/machinery/computer/camera_advanced/Destroy() + if(current_user) + current_user.unset_machine() + if(eyeobj) + qdel(eyeobj) + return ..() + +/obj/machinery/computer/camera_advanced/on_unset_machine(mob/M) + if(M == current_user) + off_action.Activate() /obj/machinery/computer/camera_advanced/attack_hand(mob/user) - if(..()) + if(current_user) + user << "The console is already in use!" return if(!iscarbon(user)) return + if(..()) + return var/mob/living/carbon/L = user - if(!current_user) - if(!eyeobj) - CreateEye() - GrantActions(user) - current_user = user - eyeobj.user = user - eyeobj.name = "Camera Eye ([user.name])" - L.remote_view = 1 - L.remote_control = eyeobj - L.client.perspective = EYE_PERSPECTIVE - if(!eyeobj.initialized) - for(var/obj/machinery/camera/C in cameranet.cameras) - if(!C.can_use()) - continue - if(C.network&networks) - eyeobj.setLoc(get_turf(C)) - break + if(!eyeobj) + CreateEye() + + if(!eyeobj.initialized) + var/camera_location + for(var/obj/machinery/camera/C in cameranet.cameras) + if(!C.can_use()) + continue + if(C.network&networks) + camera_location = get_turf(C) + break + if(camera_location) eyeobj.initialized = 1 + give_eye_control(L) + eyeobj.setLoc(camera_location) else - eyeobj.setLoc(eyeobj.loc) + user.unset_machine() else - user << "The console is already in use!" + give_eye_control(L) + eyeobj.setLoc(eyeobj.loc) + + + +/obj/machinery/computer/camera_advanced/proc/give_eye_control(mob/user) + GrantActions(user) + current_user = user + eyeobj.eye_user = user + eyeobj.name = "Camera Eye ([user.name])" + user.remote_control = eyeobj + user.reset_perspective(eyeobj) /mob/camera/aiEye/remote name = "Inactive Camera Eye" var/sprint = 10 var/cooldown = 0 var/acceleration = 1 - var/mob/living/carbon/human/user = null + var/mob/living/carbon/human/eye_user = null var/obj/machinery/computer/camera_advanced/origin var/initialized = 0 var/visible_icon = 0 var/image/user_image = null +/mob/camera/aiEye/remote/Destroy() + eye_user = null + origin = null + return ..() + /mob/camera/aiEye/remote/GetViewerClient() - if(user) - return user.client + if(eye_user) + return eye_user.client return null /mob/camera/aiEye/remote/setLoc(T) - if(user) - if(!isturf(user.loc)) + if(eye_user) + if(!isturf(eye_user.loc)) return T = get_turf(T) loc = T cameranet.visibility(src) - if(user.client) - if(visible_icon) - user.client.images -= user_image + if(visible_icon) + if(eye_user.client) + eye_user.client.images -= user_image user_image = image(icon,loc,icon_state,FLY_LAYER) - user.client.images += user_image - user.client.eye = src + eye_user.client.images += user_image /mob/camera/aiEye/remote/relaymove(mob/user,direct) var/initial = initial(sprint) @@ -113,16 +136,15 @@ return var/mob/living/carbon/C = target var/mob/camera/aiEye/remote/remote_eye = C.remote_control - C.remote_view = 0 remote_eye.origin.current_user = null remote_eye.origin.jump_action.Remove(C) - remote_eye.user = null + remote_eye.eye_user = null if(C.client) - C.client.perspective = MOB_PERSPECTIVE - C.client.eye = src - C.client.images -= remote_eye.user_image - for(var/datum/camerachunk/chunk in remote_eye.visibleCameraChunks) - C.client.images -= chunk.obscured + C.reset_perspective(null) + if(remote_eye.visible_icon) + C.client.images -= remote_eye.user_image +// for(var/datum/camerachunk/chunk in remote_eye.visibleCameraChunks) +// C.client.images -= chunk.obscured C.remote_control = null C.unset_machine() src.Remove(C) diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index b90cd0d3cdf..eb0ada26249 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -35,7 +35,6 @@ if(prob(20/severity)) set_broken() ..() - /obj/machinery/computer/ex_act(severity, target) if(target == src) qdel(src) @@ -113,10 +112,6 @@ qdel(src) return -/obj/machinery/computer/attack_hand(user) - . = ..() - return - /obj/machinery/computer/attack_paw(mob/living/user) user.do_attack_animation(src) if(circuit) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 74869fafb76..8c018a27c67 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -581,7 +581,7 @@ About the new airlock wires panel: // Otherwise it will runtime with this kind of error: null.Topic() if(!nowindow) ..() - if((usr.stat || usr.restrained()) && !IsAdminGhost(usr)) + if(usr.incapacitated() && !IsAdminGhost(usr)) return add_fingerprint(usr) if(href_list["close"]) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 7d79c1fe7be..134f33ad080 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -161,9 +161,7 @@ Class Procs: var/turf/T = get_turf(src) T.contents += contents if(occupant) - if(occupant.client) - occupant.client.eye = occupant - occupant.client.perspective = MOB_PERSPECTIVE + occupant.reset_perspective(null) occupant = null /obj/machinery/proc/close_machine(mob/living/target = null) @@ -176,9 +174,7 @@ Class Procs: else target = C if(target && !target.buckled && !target.buckled_mob) - if(target.client) - target.client.perspective = EYE_PERSPECTIVE - target.client.eye = src + target.reset_perspective(src) occupant = target target.loc = src target.stop_pulling() @@ -231,10 +227,9 @@ Class Procs: /obj/machinery/attack_ai(mob/user) - if(isrobot(user)) - // For some reason attack_robot doesn't work - // This is to stop robots from using cameras to remotely control machines. - if(user.client && user.client.eye == user) + if(isrobot(user))// For some reason attack_robot doesn't work + var/mob/living/silicon/robot/R = user + if(R.client && R.client.eye == R && !R.low_power_mode)// This is to stop robots from using cameras to remotely control machines; and from using machines when the borg has no power. return src.attack_hand(user) else return src.attack_hand(user) diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index d2cdf0153f1..f5a20bdc6b8 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -9,7 +9,7 @@ icon_state = "grey_target_prism" anchored = 1 layer = 3 - invisibility = INVISIBILITY_LEVEL_TWO //the turret is invisible if it's inside its cover + invisibility = INVISIBILITY_OBSERVER //the turret is invisible if it's inside its cover density = 1 use_power = 1 //this turret uses and requires power idle_power_usage = 50 //when inactive, this turret takes up constant 50 Equipment power @@ -292,7 +292,7 @@ //This code handles moving the turret around. After all, it's a portable turret! if(!anchored && !isinspace()) anchored = 1 - invisibility = INVISIBILITY_LEVEL_TWO + invisibility = INVISIBILITY_OBSERVER icon_state = "[base_icon_state][off_state]" user << "You secure the exterior bolts on the turret." if(has_cover) @@ -912,7 +912,7 @@ if(!Parent_Turret.anchored) Parent_Turret.anchored = 1 - Parent_Turret.invisibility = INVISIBILITY_LEVEL_TWO + Parent_Turret.invisibility = INVISIBILITY_OBSERVER Parent_Turret.icon_state = "grey_target_prism" user << "You secure the exterior bolts on the turret." else diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index 8803110b477..f1d43782606 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -101,11 +101,7 @@ /obj/machinery/recharge_station/close_machine() if(!panel_open) for(var/mob/living/silicon/robot/R in loc) - R.stop_pulling() - if(R.client) - R.client.eye = src - R.client.perspective = EYE_PERSPECTIVE - R.loc = src + R.forceMove(src) occupant = R use_power = 2 add_fingerprint(R) diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index 179eff07051..25a8aeaa4d3 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -414,26 +414,25 @@ /obj/machinery/suit_storage_unit/proc/eject_occupant(mob/user) - if (src.islocked) + if (islocked) return - if (!src.OCCUPANT) + if (!OCCUPANT) return - if (src.OCCUPANT.client) + if (OCCUPANT.client) if(user != OCCUPANT) OCCUPANT << "The machine kicks you out!" - if(user.loc != src.loc) + if(user.loc != loc) OCCUPANT << "You leave the not-so-cozy confines of [src]." - src.OCCUPANT.client.eye = src.OCCUPANT.client.mob - src.OCCUPANT.client.perspective = MOB_PERSPECTIVE - if(src.OCCUPANT.loc == src) - src.OCCUPANT.loc = src.loc - src.OCCUPANT = null + if(OCCUPANT.loc == src) + OCCUPANT.loc = loc + OCCUPANT.reset_perspective(null) + OCCUPANT = null if(!src.isopen) src.isopen = 1 - src.update_icon() + update_icon() return @@ -491,18 +490,15 @@ M.visible_message("[user] starts putting [M] into [src]!", "[user] starts shoving you into [src]!") if(do_mob(user, M, 10)) user.stop_pulling() - if(M.client) - M.client.perspective = EYE_PERSPECTIVE - M.client.eye = src M.loc = src - src.OCCUPANT = M - src.isopen = 0 - src.update_icon() + M.reset_perspective(src) + OCCUPANT = M + isopen = 0 + update_icon() + + add_fingerprint(user) + updateUsrDialog() - src.add_fingerprint(user) - src.updateUsrDialog() - return - return /obj/machinery/suit_storage_unit/proc/fix() audible_message("[src] beeps and comes back online!") diff --git a/code/game/machinery/transformer.dm b/code/game/machinery/transformer.dm index df341d96204..9fcf68832ae 100644 --- a/code/game/machinery/transformer.dm +++ b/code/game/machinery/transformer.dm @@ -69,7 +69,6 @@ playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) H.emote("scream") // It is painful H.adjustBruteLoss(max(0, 80 - H.getBruteLoss())) // Hurt the human, don't try to kill them though. - H.handle_regular_hud_updates() // Make sure they see the pain. // Sleep for a couple of ticks to allow the human to see the pain sleep(5) diff --git a/code/game/mecha/equipment/tools/medical_tools.dm b/code/game/mecha/equipment/tools/medical_tools.dm index 827a258508e..d025a43ed9b 100644 --- a/code/game/mecha/equipment/tools/medical_tools.dm +++ b/code/game/mecha/equipment/tools/medical_tools.dm @@ -51,7 +51,6 @@ return target.forceMove(src) patient = target - target.reset_view(src) SSobj.processing |= src update_equip_info() occupant_message("[target] successfully loaded into [src]. Life support functions engaged.") @@ -76,7 +75,6 @@ patient.forceMove(get_turf(src)) occupant_message("[patient] ejected. Life support functions disabled.") log_message("[patient] ejected. Life support functions disabled.") - patient.reset_view() SSobj.processing.Remove(src) patient = null update_equip_info() diff --git a/code/game/mecha/equipment/tools/mining_tools.dm b/code/game/mecha/equipment/tools/mining_tools.dm index 07231ed8854..8d485dcf240 100644 --- a/code/game/mecha/equipment/tools/mining_tools.dm +++ b/code/game/mecha/equipment/tools/mining_tools.dm @@ -108,6 +108,18 @@ /obj/item/mecha_parts/mecha_equipment/mining_scanner/New() SSobj.processing |= src +/obj/item/mecha_parts/mecha_equipment/mining_scanner/attach(obj/mecha/M) + ..() + M.occupant_sight_flags |= SEE_TURFS + if(M.occupant) + M.occupant.update_sight() + +/obj/item/mecha_parts/mecha_equipment/mining_scanner/detach() + chassis.occupant_sight_flags &= ~SEE_TURFS + if(chassis.occupant) + chassis.occupant.update_sight() + return ..() + /obj/item/mecha_parts/mecha_equipment/mining_scanner/process() if(!loc) SSobj.processing.Remove(src) @@ -118,13 +130,10 @@ var/obj/mecha/working/mecha = loc if(!mecha.occupant) return - var/mob/pilot = mecha.occupant - var/list/occupant = list() - occupant |= pilot - pilot.sight |= SEE_TURFS + var/list/L = list(mecha.occupant) scanning = 1 - mineral_scan_pulse(occupant,get_turf(loc)) + mineral_scan_pulse(L,get_turf(loc)) spawn(equip_cooldown) scanning = 0 - pilot.sight -= SEE_TURFS + diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm index 855408d7461..e1690b9b64d 100644 --- a/code/game/mecha/equipment/weapons/weapons.dm +++ b/code/game/mecha/equipment/weapons/weapons.dm @@ -170,7 +170,7 @@ if(istype(H.ears, /obj/item/clothing/ears/earmuffs)) continue M << "HONK" - M.sleeping = 0 + M.SetSleeping(0) M.stuttering += 20 M.adjustEarDamage(0, 30) M.Weaken(3) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 2c892b128a9..eb561ef12c7 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -77,6 +77,8 @@ var/datum/action/innate/mecha/mech_toggle_lights/lights_action = new var/datum/action/innate/mecha/mech_view_stats/stats_action = new + var/occupant_sight_flags = 0 //sight flags to give to the occupant (e.g. mech mining scanner gives meson-like vision) + hud_possible = list (DIAG_STAT_HUD, DIAG_BATT_HUD, DIAG_MECH_HUD) /obj/mecha/New() @@ -108,7 +110,7 @@ if(isAI(M)) M.gib() //AIs are loaded into the mech computer itself. When the mech dies, so does the AI. Forever. else - M.Move(loc) + M.forceMove(loc) if(prob(30)) explosion(get_turf(loc), 0, 0, 1, 3) @@ -714,8 +716,6 @@ /obj/mecha/proc/moved_inside(mob/living/carbon/human/H) if(H && H.client && H in range(1)) - H.reset_view(src) - H.stop_pulling() H.forceMove(src) occupant = H add_fingerprint(H) @@ -768,7 +768,7 @@ user << "\the [mmi_as_oc] is stuck to your hand, you cannot put it in \the [src]!" return var/mob/brainmob = mmi_as_oc.brainmob - brainmob.reset_view(src) + brainmob.reset_perspective(src) occupant = brainmob brainmob.loc = src //should allow relaymove brainmob.canmove = 1 @@ -816,14 +816,13 @@ occupant = null //we need it null when forceMove calls Exited(). if(mob_container.forceMove(newloc))//ejecting mob container log_message("[mob_container] moved out.") - L.reset_view() L << browse(null, "window=exosuit") - if(istype(mob_container, /obj/item/device/mmi)) var/obj/item/device/mmi/mmi = mob_container if(mmi.brainmob) L.loc = mmi + L.reset_perspective() mmi.mecha = null mmi.update_icon() L.canmove = 0 @@ -900,6 +899,9 @@ var/year_integer = text2num(year) // = 2013??? /obj/mecha/allow_drop() return 0 +/obj/mecha/update_remote_sight(mob/living/user) + if(occupant_sight_flags) + user.sight |= occupant_sight_flags //////////////////////////////////////// Action Buttons /////////////////////////////////////////////// diff --git a/code/game/objects/effects/effect_system/effects_smoke.dm b/code/game/objects/effects/effect_system/effects_smoke.dm index cb5f4de5cdd..1f20199e235 100644 --- a/code/game/objects/effects/effect_system/effects_smoke.dm +++ b/code/game/objects/effects/effect_system/effects_smoke.dm @@ -200,7 +200,7 @@ /obj/effect/particle_effect/smoke/sleeping/smoke_mob(mob/living/carbon/M) if(..()) M.drop_item() - M.sleeping = max(M.sleeping,10) + M.Sleeping(max(M.sleeping,10)) M.emote("cough") return 1 diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 58138a2999d..17f14ec5054 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -292,10 +292,12 @@ var/global/image/fire_overlay = image("icon" = 'icons/effects/fire.dmi', "icon_s /obj/item/attack_ai(mob/user) if (istype(src.loc, /obj/item/weapon/robot_module)) //If the item is part of a cyborg module, equip it - if(!isrobot(user)) return + if(!isrobot(user)) + return var/mob/living/silicon/robot/R = user - R.activate_module(src) - R.hud_used.update_robot_modules_display() + if(!R.low_power_mode) //can't equip modules with an empty cell. + R.activate_module(src) + R.hud_used.update_robot_modules_display() // Due to storage type consolidation this should get used more now. // I have cleaned it up a little, but it could probably use more. -Sayu @@ -346,7 +348,7 @@ var/global/image/fire_overlay = image("icon" = 'icons/effects/fire.dmi', "icon_s return /obj/item/proc/dropped(mob/user) - ..() + return // called just as an item is picked up (loc is not yet changed) /obj/item/proc/pickup(mob/user) @@ -454,27 +456,25 @@ var/global/image/fire_overlay = image("icon" = 'icons/effects/fire.dmi', "icon_s add_logs(user, M, "attacked", "[src.name]", "(INTENT: [uppertext(user.a_intent)])") - M.eye_blurry += rand(3,4) - M.eye_stat += rand(2,4) - if (M.eye_stat >= 10) - M.eye_blurry += 15+(0.1*M.eye_blurry) - if(M.stat != 2) + M.adjust_blurriness(3) + M.adjust_eye_stat(rand(2,4)) + if(M.eye_stat >= 10) + M.adjust_blurriness(15) + if(M.stat != DEAD) M << "Your eyes start to bleed profusely!" - if (!(M.disabilities & (NEARSIGHT | BLIND))) - M.disabilities |= NEARSIGHT - M << "You become nearsighted!" + if(!(M.disabilities & (NEARSIGHT | BLIND))) + if(M.become_nearsighted()) + M << "You become nearsighted!" if(prob(50)) - if(M.stat != 2) + if(M.stat != DEAD) if(M.drop_item()) M << "You drop what you're holding and clutch at your eyes!" - M.eye_blurry += 10 + M.adjust_blurriness(10) M.Paralyse(1) M.Weaken(2) - if (prob(M.eye_stat - 10 + 1) && !(M.disabilities & BLIND)) - if(M.stat != 2) + if (prob(M.eye_stat - 10 + 1)) + if(M.become_blind()) M << "You go blind!" - M.disabilities |= BLIND - return /obj/item/clean_blood() . = ..() diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index 907697bac1e..e4443b842db 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -192,8 +192,8 @@ user.visible_message("[user] sprays [src] into the face of [target]!") target << "[user] sprays [src] into your face!" if(C.client) - C.eye_blurry = max(C.eye_blurry, 3) - C.eye_blind = max(C.eye_blind, 1) + C.set_blurriness(3) + C.set_blindness(1) if(C.check_eye_prot() <= 0) // no eye protection? ARGH IT BURNS. C.confused = max(C.confused, 3) C.Weaken(3) diff --git a/code/game/objects/items/devices/camera_bug.dm b/code/game/objects/items/devices/camera_bug.dm index 7d283c67787..24c0776d2b1 100644 --- a/code/game/objects/items/devices/camera_bug.dm +++ b/code/game/objects/items/devices/camera_bug.dm @@ -57,20 +57,17 @@ interact(user) /obj/item/device/camera_bug/check_eye(mob/user) - if (user.stat || loc != user || !user.canmove || user.eye_blind || !current) - user.reset_view(null) + if ( loc != user || user.incapacitated() || user.eye_blind || !current ) user.unset_machine() - return null - + return var/turf/T = get_turf(user.loc) if(T.z != current.z || !current.can_use()) user << "[src] has lost the signal." current = null - user.reset_view(null) user.unset_machine() - return null - return 1 +/obj/item/device/camera_bug/on_unset_machine(mob/user) + user.reset_perspective(null) /obj/item/device/camera_bug/proc/get_cameras() if( world.time > (last_net_update + 100)) @@ -185,7 +182,6 @@ /obj/item/device/camera_bug/Topic(href,list/href_list) if(usr != loc) usr.unset_machine() - usr.reset_view(null) usr << browse(null, "window=camerabug") return usr.set_machine(src) @@ -196,7 +192,7 @@ if(C) track_mode = BUGMODE_MONITOR current = C - usr.reset_view(null) + usr.reset_perspective(null) interact() if("track" in href_list) var/atom/A = locate(href_list["track"]) @@ -215,10 +211,9 @@ interact() return if("close" in href_list) - usr.reset_view(null) usr.unset_machine() current = null - return // I do not <- I do not remember what I was going to write in this comment -Sayu, sometime later + return if("view" in href_list) var/obj/machinery/camera/C = locate(href_list["view"]) if(istype(C)) @@ -232,16 +227,14 @@ current = C spawn(6) if(src.check_eye(usr)) - usr.reset_view(C) + usr.reset_perspective(C) interact() else usr.unset_machine() - usr.reset_view(null) usr << browse(null, "window=camerabug") return else usr.unset_machine() - usr.reset_view(null) interact() diff --git a/code/game/objects/items/devices/chameleonproj.dm b/code/game/objects/items/devices/chameleonproj.dm index a7b4d29e2e1..8526353c4a4 100644 --- a/code/game/objects/items/devices/chameleonproj.dm +++ b/code/game/objects/items/devices/chameleonproj.dm @@ -80,7 +80,7 @@ A.loc = active_dummy.loc if(ismob(A)) var/mob/M = A - M.reset_view(null) + M.reset_perspective(null) /obj/effect/dummy/chameleon name = "" diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 5e56436efc7..4dbf44c4ea5 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -46,7 +46,7 @@ /obj/item/device/flashlight/attack(mob/living/carbon/human/M, mob/living/carbon/human/user) add_fingerprint(user) - if(on && user.zone_sel.selecting == "eyes") + if(on && user.zone_selected == "eyes") if((user.disabilities & CLUMSY || user.getBrainLoss() >= 60) && prob(50)) //too dumb to use flashlight properly return ..() //just hit them in the head @@ -307,13 +307,13 @@ obj/item/device/flashlight/lamp/bananalamp return 1 /obj/item/device/flashlight/emp/attack(mob/living/M, mob/living/user) - if(on && user.zone_sel.selecting == "eyes") // call original attack proc only if aiming at the eyes + if(on && user.zone_selected == "eyes") // call original attack proc only if aiming at the eyes ..() return /obj/item/device/flashlight/emp/afterattack(atom/A as mob|obj, mob/user, proximity) if(!proximity) return - if(istype(A, /obj/item/weapon/storage/) && A.loc == user) + if(istype(A, /obj/item/weapon/storage/) && A.loc == user) return if (emp_cur_charges > 0) emp_cur_charges -= 1 diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm index c410938f186..12107b3cdfc 100644 --- a/code/game/objects/items/devices/laserpointer.dm +++ b/code/game/objects/items/devices/laserpointer.dm @@ -97,7 +97,7 @@ //human/alien mobs if(iscarbon(target)) var/mob/living/carbon/C = target - if(user.zone_sel.selecting == "eyes") + if(user.zone_selected == "eyes") add_logs(user, C, "shone in the eyes", src) var/severity = 1 diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm index dd4c801e324..2022d5a3364 100644 --- a/code/game/objects/items/robot/robot_upgrades.dm +++ b/code/game/objects/items/robot/robot_upgrades.dm @@ -82,7 +82,10 @@ if(ghost.mind && ghost.mind.current == R) R.key = ghost.key - R.stat = CONSCIOUS + R.stat = UNCONSCIOUS + R.update_stat() + if(R.camera && !R.wires.IsCameraCut()) + R.camera.toggle_cam(R,0) dead_mob_list -= R //please never forget this ever kthx living_mob_list += R R.notify_ai(1) @@ -151,7 +154,7 @@ R.module.modules += new/obj/item/weapon/tank/jetpack/carbondioxide(R.module) for(var/obj/item/weapon/tank/jetpack/carbondioxide in R.module.modules) - R.internals = src + R.internal = src R.jetpackoverlay = 1 R.module.rebuild() return 1 diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index 8f3d63b0e57..2d27c02485a 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -70,7 +70,7 @@ if(ishuman(M)) var/mob/living/carbon/human/H = M - var/obj/item/organ/limb/affecting = H.get_organ(check_zone(user.zone_sel.selecting)) + var/obj/item/organ/limb/affecting = H.get_organ(check_zone(user.zone_selected)) if(stop_bleeding) if(!H.bleedsuppress) //so you can't stack bleed suppression H.suppress_bloodloss(stop_bleeding) diff --git a/code/game/objects/items/weapons/clown_items.dm b/code/game/objects/items/weapons/clown_items.dm index a1692841bd8..6b1e73c8c7c 100644 --- a/code/game/objects/items/weapons/clown_items.dm +++ b/code/game/objects/items/weapons/clown_items.dm @@ -63,7 +63,7 @@ if(do_after(user, src.cleanspeed, target = target)) user << "You scrub \the [target.name] out." qdel(target) - else if(ishuman(target) && user.zone_sel && user.zone_sel.selecting == "mouth") + else if(ishuman(target) && user.zone_selected == "mouth") user.visible_message("\the [user] washes \the [target]'s mouth out with [src.name]!", "You wash \the [target]'s mouth out with [src.name]!") //washes mouth out with soap sounds better than 'the soap' here return else if(istype(target, /obj/structure/window)) diff --git a/code/game/objects/items/weapons/cosmetics.dm b/code/game/objects/items/weapons/cosmetics.dm index 2fe704d5760..5a65a2c5951 100644 --- a/code/game/objects/items/weapons/cosmetics.dm +++ b/code/game/objects/items/weapons/cosmetics.dm @@ -76,7 +76,7 @@ //you can wipe off lipstick with paper! /obj/item/weapon/paper/attack(mob/M, mob/user) - if(user.zone_sel.selecting == "mouth") + if(user.zone_selected == "mouth") if(!ismob(M)) return @@ -120,7 +120,7 @@ /obj/item/weapon/razor/attack(mob/M, mob/user) if(ishuman(M)) var/mob/living/carbon/human/H = M - var/location = user.zone_sel.selecting + var/location = user.zone_selected if(location == "mouth") if(!(H.dna.species.specflags & FACEHAIR)) user << "There is no facial hair to shave!" diff --git a/code/game/objects/items/weapons/defib.dm b/code/game/objects/items/weapons/defib.dm index f81fc5dd559..5dfda9c80a2 100644 --- a/code/game/objects/items/weapons/defib.dm +++ b/code/game/objects/items/weapons/defib.dm @@ -394,7 +394,7 @@ else recharge(60) return - if(user.zone_sel && user.zone_sel.selecting == "chest") + if(user.zone_selected == "chest") if(user.a_intent == "harm") if(req_defib && defib.safety) return @@ -497,17 +497,20 @@ else //If the body has been fixed so that they would not be in crit when defibbed, give them oxyloss to put them back into crit if (H.health > halfwaycritdeath) - H.adjustOxyLoss(H.health - halfwaycritdeath) + H.adjustOxyLoss(H.health - halfwaycritdeath, 0) else var/overall_damage = total_brute + total_burn + H.getToxLoss() + H.getOxyLoss() var/mobhealth = H.health - H.adjustOxyLoss((mobhealth - halfwaycritdeath) * (H.getOxyLoss() / overall_damage)) - H.adjustToxLoss((mobhealth - halfwaycritdeath) * (H.getToxLoss() / overall_damage)) - H.adjustFireLoss((mobhealth - halfwaycritdeath) * (total_burn / overall_damage)) - H.adjustBruteLoss((mobhealth - halfwaycritdeath) * (total_brute / overall_damage)) + H.adjustOxyLoss((mobhealth - halfwaycritdeath) * (H.getOxyLoss() / overall_damage), 0) + H.adjustToxLoss((mobhealth - halfwaycritdeath) * (H.getToxLoss() / overall_damage), 0) + H.adjustFireLoss((mobhealth - halfwaycritdeath) * (total_burn / overall_damage), 0) + H.adjustBruteLoss((mobhealth - halfwaycritdeath) * (total_brute / overall_damage), 0) user.visible_message("[req_defib ? "[defib]" : "[src]"] pings: Resuscitation successful.") playsound(get_turf(src), 'sound/machines/defib_success.ogg', 50, 0) H.stat = UNCONSCIOUS + H.updatehealth() + H.update_sight() + H.update_vision_overlays() dead_mob_list -= H living_mob_list |= list(H) H.emote("gasp") diff --git a/code/game/objects/items/weapons/grenades/flashbang.dm b/code/game/objects/items/weapons/grenades/flashbang.dm index 79f635fb818..360aa621405 100644 --- a/code/game/objects/items/weapons/grenades/flashbang.dm +++ b/code/game/objects/items/weapons/grenades/flashbang.dm @@ -31,7 +31,7 @@ M << "AAAAGH!" M.Weaken(15) //hella stunned M.Stun(15) - M.eye_stat += 8 + M.adjust_eye_stat(8) if(M.flash_eyes(affect_silicon = 1)) M.Stun(max(10/distance, 3)) diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index c6047b5c6af..65eab91de20 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -63,7 +63,7 @@ cuffs.loc = target target.handcuffed = cuffs - target.update_inv_handcuffed(0) + target.update_handcuffed() if(trashtype && !dispense) qdel(src) return @@ -146,7 +146,7 @@ if(do_mob(user, C, 30)) if(!C.handcuffed) C.handcuffed = new /obj/item/weapon/restraints/handcuffs/cable/zipties/used(C) - C.update_inv_handcuffed(0) + C.update_handcuffed() user << "You handcuff [C]." add_logs(user, C, "handcuffed") else diff --git a/code/game/objects/items/weapons/implants/implantchair.dm b/code/game/objects/items/weapons/implants/implantchair.dm index 891ab95aa35..a8fa6ef2ffe 100644 --- a/code/game/objects/items/weapons/implants/implantchair.dm +++ b/code/game/objects/items/weapons/implants/implantchair.dm @@ -89,18 +89,16 @@ /obj/machinery/implantchair/go_out(mob/M) - if(!( src.occupant )) + if(!occupant) return if(M == occupant) // so that the guy inside can't eject himself -Agouri return - if (src.occupant.client) - src.occupant.client.eye = src.occupant.client.mob - src.occupant.client.perspective = MOB_PERSPECTIVE - src.occupant.loc = src.loc + occupant.loc = loc + occupant.reset_perspective(null) if(injecting) implant(src.occupant) injecting = 0 - src.occupant = null + occupant = null icon_state = "implantchair" return @@ -112,11 +110,9 @@ if(src.occupant) usr << "The [src.name] is already occupied!" return - if(M.client) - M.client.perspective = EYE_PERSPECTIVE - M.client.eye = src M.stop_pulling() M.loc = src + M.reset_perspective(src) src.occupant = M src.add_fingerprint(usr) icon_state = "implantchair_on" diff --git a/code/game/objects/items/weapons/kitchen.dm b/code/game/objects/items/weapons/kitchen.dm index e5b7b2df05f..bcb311cd9c8 100644 --- a/code/game/objects/items/weapons/kitchen.dm +++ b/code/game/objects/items/weapons/kitchen.dm @@ -41,7 +41,7 @@ forkload = null return - else if(user.zone_sel.selecting == "eyes") + else if(user.zone_selected == "eyes") if(user.disabilities & CLUMSY && prob(50)) M = user return eyestab(M,user) diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 57054c54afa..740eb15247f 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -175,16 +175,13 @@ var/mob/living/carbon/location = loc if(location.internal == src) location.internal = null - location.internals.icon_state = "internal0" usr << "You close the tank release valve." - if (location.internals) - location.internals.icon_state = "internal0" + location.update_internals_hud_icon(0) else if(location.wear_mask && (location.wear_mask.flags & MASKINTERNALS)) location.internal = src usr << "You open \the [src] valve." - if (location.internals) - location.internals.icon_state = "internal1" + location.update_internals_hud_icon(1) else usr << "You need something to connect to \the [src]!" return 1 diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index f878422481f..59d32b254ed 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -92,7 +92,7 @@ /obj/item/weapon/screwdriver/attack(mob/living/carbon/M, mob/living/carbon/user) if(!istype(M)) return ..() - if(user.zone_sel.selecting != "eyes" && user.zone_sel.selecting != "head") + if(user.zone_selected != "eyes" && user.zone_selected != "head") return ..() if(user.disabilities & CLUMSY && prob(50)) M = user @@ -131,7 +131,7 @@ C.handcuffed = null if(C.buckled && C.buckled.buckle_requires_restraints) C.buckled.unbuckle_mob() - C.update_inv_handcuffed(0) + C.update_handcuffed() return else ..() @@ -217,7 +217,7 @@ if(!istype(H)) return ..() - var/obj/item/organ/limb/affecting = H.get_organ(check_zone(user.zone_sel.selecting)) + var/obj/item/organ/limb/affecting = H.get_organ(check_zone(user.zone_selected)) if(affecting.status == ORGAN_ROBOTIC && user.a_intent != "harm") if(src.remove_fuel(1)) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 961b9f8ee28..2a036a5404d 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -108,7 +108,13 @@ return /mob/proc/unset_machine() - src.machine = null + if(machine) + machine.on_unset_machine(src) + machine = null + +//called when the user unsets the machine. +/atom/movable/proc/on_unset_machine(mob/user) + return /mob/proc/set_machine(obj/O) if(src.machine) diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 38a348bbfcb..b9f290d9a83 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -91,9 +91,7 @@ for(var/mob/M in src) M.loc = loc - if(M.client) - M.client.eye = M.client.mob - M.client.perspective = MOB_PERSPECTIVE + M.reset_perspective(null) if(throwing) step(M, dir) if(throwing) @@ -130,9 +128,7 @@ mobs_stored++ if(mobs_stored >= mob_storage_capacity) return 0 - if(L.client) - L.client.perspective = EYE_PERSPECTIVE - L.client.eye = src + L.reset_perspective(src) L.stop_pulling() else if(!istype(AM, /obj/item) && !istype(AM, /obj/effect/dummy/chameleon)) return 0 @@ -389,8 +385,7 @@ locked = !locked add_fingerprint(user) for(var/mob/O in viewers(user, 3)) - if((O.client && !( O.eye_blind ))) - O << "[user] has [locked ? null : "un"]locked the locker." + O.show_message("[user] has [locked ? null : "un"]locked the locker.", 1) update_icon() else user << "Access Denied" @@ -408,3 +403,6 @@ overlays += "sparking" spawn(4) //overlays don't support flick so we have to cheat update_icon() + +/obj/structure/closet/get_vision_impairments(mob/user) + return global_hud.vimpaired diff --git a/code/game/objects/structures/crates_lockers/closets/statue.dm b/code/game/objects/structures/crates_lockers/closets/statue.dm index 4022c003311..45fb2a474a5 100644 --- a/code/game/objects/structures/crates_lockers/closets/statue.dm +++ b/code/game/objects/structures/crates_lockers/closets/statue.dm @@ -17,9 +17,7 @@ if(ishuman(L) || ismonkey(L) || iscorgi(L)) if(L.buckled) L.buckled.unbuckle_mob() - if(L.client) - L.client.perspective = EYE_PERSPECTIVE - L.client.eye = src + L.reset_perspective(src) L.loc = src L.disabilities += MUTE L.faction += "mimic" //Stops mimics from instaqdeling people in statues @@ -83,9 +81,7 @@ M.disabilities -= MUTE M.take_overall_damage((M.health - health - 100),0) //any new damage the statue incurred is transfered to the mob M.faction -= "mimic" - if(M.client) - M.client.eye = M.client.mob - M.client.perspective = MOB_PERSPECTIVE + M.reset_perspective(null) /obj/structure/closet/statue/take_contents() return diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index cd8c190569e..92d511b3317 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -90,9 +90,11 @@ playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) for(var/atom/movable/A in connected.loc) if(!A.anchored || A == connected) - A.loc = src + A.forceMove(loc) update_icon() +/obj/structure/bodycontainer/get_vision_impairments(mob/user) + return global_hud.darkMask /* * Morgue */ diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 1bff662f0a3..5836f596fe3 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -130,6 +130,7 @@ if(istype(src, /obj/structure/table/optable)) var/obj/structure/table/optable/OT = src G.affecting.resting = 1 + G.affecting.update_canmove() visible_message("[G.assailant] has laid [G.affecting] on [src].") OT.patient = G.affecting OT.check_patient() diff --git a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm index 0370ec49f9d..d85de6dce75 100644 --- a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm +++ b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm @@ -181,7 +181,7 @@ if(!(locate(/obj/structure/transit_tube) in loc)) mob.loc = loc mob.client.Move(get_step(loc, direction), direction) - mob.reset_view(null) + mob.reset_perspective(null) //if(moving && istype(loc, /turf/space)) // Todo: If you get out of a moving pod in space, you should move as well. @@ -195,7 +195,7 @@ if(station.icon_state == "open") mob.loc = loc mob.client.Move(get_step(loc, direction), direction) - mob.reset_view(null) + mob.reset_perspective(null) else station.open_animation() diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 431057335d7..03103ecf1bb 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -381,7 +381,7 @@ if(busy) user << "Someone's already washing here." return - var/selected_area = parse_zone(user.zone_sel.selecting) + var/selected_area = parse_zone(user.zone_selected) var/washing_face = 0 if(selected_area in list("head", "mouth", "eyes")) washing_face = 1 @@ -403,8 +403,7 @@ H.lip_style = null //Washes off lipstick H.lip_color = initial(H.lip_color) H.regenerate_icons() - user.drowsyness -= rand(2,3) //Washing your face wakes you up if you're falling asleep - user.drowsyness = Clamp(user.drowsyness, 0, INFINITY) + user.drowsyness = max(user.drowsyness - rand(2,3), 0) //Washing your face wakes you up if you're falling asleep else user.clean_blood() diff --git a/code/modules/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm index 44a59ede8c3..b9557c5161b 100644 --- a/code/modules/admin/verbs/adminjump.dm +++ b/code/modules/admin/verbs/adminjump.dm @@ -20,7 +20,7 @@ if(!T) src << "Nowhere to jump to!" return - admin_forcemove(usr, T) + usr.forceMove(T) log_admin("[key_name(usr)] jumped to [A]") message_admins("[key_name_admin(usr)] jumped to [A]") feedback_add_details("admin_verb","JA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -53,7 +53,7 @@ var/turf/T = get_turf(M) if(T && isturf(T)) feedback_add_details("admin_verb","JM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - admin_forcemove(A, M.loc) + A.forceMove(M.loc) else A << "This mob is not located in the game world." @@ -92,7 +92,7 @@ log_admin("[key_name(usr)] jumped to [key_name(M)]") message_admins("[key_name_admin(usr)] jumped to [key_name_admin(M)]") - admin_forcemove(usr, M.loc) + usr.forceMove(M.loc) feedback_add_details("admin_verb","JK") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -106,7 +106,7 @@ log_admin("[key_name(usr)] teleported [key_name(M)]") message_admins("[key_name_admin(usr)] teleported [key_name_admin(M)]") - admin_forcemove(M, get_turf(usr)) + M.forceMove(get_turf(usr)) feedback_add_details("admin_verb","GM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/Getkey() @@ -131,7 +131,7 @@ log_admin("[key_name(usr)] teleported [key_name(M)]") message_admins("[key_name_admin(usr)] teleported [key_name(M)]") if(M) - admin_forcemove(M, get_turf(usr)) + M.forceMove(get_turf(usr)) usr.loc = M.loc feedback_add_details("admin_verb","GK") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -143,20 +143,7 @@ return var/area/A = input(usr, "Pick an area.", "Pick an area") in sortedAreas|null if(A && istype(A)) - admin_forcemove(M, pick(get_area_turfs(A))) + M.forceMove(pick(get_area_turfs(A))) feedback_add_details("admin_verb","SMOB") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! log_admin("[key_name(usr)] teleported [key_name(M)] to [A]") message_admins("[key_name_admin(usr)] teleported [key_name_admin(M)] to [A]") - -/proc/admin_forcemove(mob/mover, atom/newloc) - if(mover.buckled) - mover.buckled.unbuckle_mob() - if(mover.buckled_mob) - mover.unbuckle_mob(force=1) - mover.loc = newloc - mover.on_forcemove(newloc) - -/mob/proc/on_forcemove(atom/newloc) - return - - diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 93bf512311a..d1d6899ce63 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -354,15 +354,10 @@ Traitors and the like can also be revived with the previous role mostly intact. ninja_spawn += L new_character.equip_space_ninja() new_character.internal = new_character.s_store - new_character.internals.icon_state = "internal1" + new_character.update_internals_hud_icon(1) if(ninja_spawn.len) var/obj/effect/landmark/ninja_spawn_here = pick(ninja_spawn) new_character.loc = ninja_spawn_here.loc -/* DEATH SQUADS - if("Death Commando")//Leaves them at late-join spawn. - new_character.equip_death_commando() - new_character.internal = new_character.s_store - new_character.internals.icon_state = "internal1"*/ else//They may also be a cyborg or AI. switch(new_character.mind.assigned_role) diff --git a/code/modules/awaymissions/mission_code/wildwest.dm b/code/modules/awaymissions/mission_code/wildwest.dm index 7a4bcc86671..b789a257b2d 100644 --- a/code/modules/awaymissions/mission_code/wildwest.dm +++ b/code/modules/awaymissions/mission_code/wildwest.dm @@ -103,9 +103,7 @@ user << "Whatever alien sentience that the Wish Granter possesses is satisfied with your wish. There is a distant wailing as the last of the Faithless begin to die, then silence." user << "You feel as if you just narrowly avoided a terrible fate..." for(var/mob/living/simple_animal/hostile/faithless/F in mob_list) - F.health = -10 - F.stat = 2 - F.icon_state = "faithless_dead" + F.death() ///////////////Meatgrinder////////////// diff --git a/code/modules/client/client defines.dm b/code/modules/client/client defines.dm index ad9ea063694..72679562098 100644 --- a/code/modules/client/client defines.dm +++ b/code/modules/client/client defines.dm @@ -17,7 +17,7 @@ var/datum/preferences/prefs = null var/move_delay = 1 var/moving = null - var/adminobs = null + var/area = null /////////////// diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm index 4ac9a20fe8c..181aee82b98 100644 --- a/code/modules/client/preferences_toggles.dm +++ b/code/modules/client/preferences_toggles.dm @@ -258,12 +258,12 @@ var/global/list/ghost_orbits = list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS set name = "Toggle Ghost HUD" set category = "Preferences" set desc = "Hide/Show Ghost HUD" - + prefs.ghost_hud = !prefs.ghost_hud src << "Ghost HUD will now be [prefs.ghost_hud ? "visible" : "hidden"]." prefs.save_preferences() if(istype(mob,/mob/dead/observer)) - mob.hud_used.ghost_hud() + mob.hud_used.show_hud() /client/verb/toggle_inquisition() // warning: unexpected inquisition set name = "Toggle Inquisitiveness" diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 165bac65cbc..b315d2fd9b9 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -50,6 +50,7 @@ var/invis_override = 0 //Override to allow glasses to set higher than normal see_invis var/emagged = 0 var/list/icon/current = list() //the current hud icons + var/vision_correction = 0 //does wearing these glasses correct some of our vision defects? strip_delay = 20 put_on_delay = 25 burn_state = FIRE_PROOF @@ -483,12 +484,6 @@ BLIND // can't see anything flash_protect ^= initial(flash_protect) tint ^= initial(tint) - if(istype(src, /obj/item/clothing/head)) //makes the mob-overlays update //this is awful - usr.update_inv_head() - if(istype(src, /obj/item/clothing/glasses)) - usr.update_inv_glasses() - if(istype(src, /obj/item/clothing/mask)) - usr.update_inv_wear_mask() if(istype(usr, /mob/living/carbon)) var/mob/living/carbon/C = usr C.head_update(src, forced = 1) diff --git a/code/modules/clothing/glasses/engine_goggles.dm b/code/modules/clothing/glasses/engine_goggles.dm index 81415a37e1c..ec8c5750012 100644 --- a/code/modules/clothing/glasses/engine_goggles.dm +++ b/code/modules/clothing/glasses/engine_goggles.dm @@ -30,6 +30,10 @@ loc << "You toggle the goggles' scanning mode to \[Meson]." invis_update() + if(istype(loc,/mob/living/carbon)) + var/mob/living/carbon/C = loc + C.update_sight() + update_icon() /obj/item/clothing/glasses/meson/engine/process() diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index 5869330431e..6273ed9461a 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -2,6 +2,18 @@ name = "glasses" materials = list(MAT_GLASS = 250) +//called when thermal glasses are emped. +/obj/item/clothing/glasses/proc/thermal_overload() + if(ishuman(src.loc)) + var/mob/living/carbon/human/H = src.loc + if(!(H.disabilities & BLIND)) + if(H.glasses == src) + H << "The [src] overloads and blinds you!" + flick("e_flash", H.flash) + H.set_blindness(3) + H.set_blurriness(5) + H.adjust_eye_stat(5) + /obj/item/clothing/glasses/meson name = "Optical Meson Scanner" desc = "Used by engineering and mining staff to see basic structural and terrain layouts through walls, regardless of lighting condition." @@ -84,6 +96,7 @@ desc = "Made by Nerd. Co." icon_state = "glasses" item_state = "glasses" + vision_correction = 1 //corrects nearsightedness /obj/item/clothing/glasses/regular/hipster name = "Prescription Glasses" @@ -182,7 +195,7 @@ desc = "Covers the eyes, preventing sight." icon_state = "blindfold" item_state = "blindfold" -// vision_flags = BLIND //handled in life.dm/handle_regular_hud_updates() +// vision_flags = BLIND flash_protect = 2 tint = 3 // to make them blind @@ -201,17 +214,9 @@ invis_view = 2 flash_protect = 0 - emp_act(severity) - if(istype(src.loc, /mob/living/carbon/human)) - var/mob/living/carbon/human/M = src.loc - if(M.glasses == src) - M << "The Optical Thermal Scanner overloads and blinds you!" - M.eye_blind = 3 - M.eye_blurry = 5 - M.disabilities |= NEARSIGHT - spawn(100) - M.disabilities &= ~NEARSIGHT - ..() +/obj/item/clothing/glasses/thermal/emp_act(severity) + thermal_overload() + ..() /obj/item/clothing/glasses/thermal/syndi //These are now a traitor item, concealed as mesons. -Pete name = "Chameleon Thermals" diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm index 5105fd84850..133e55cc1f0 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -157,13 +157,5 @@ user.update_inv_glasses() /obj/item/clothing/glasses/hud/toggle/thermal/emp_act(severity) - if(istype(src.loc, /mob/living/carbon/human)) - var/mob/living/carbon/human/M = src.loc - if(M.glasses == src) - M << "The [src] overloads and blinds you!" - M.eye_blind = 3 - M.eye_blurry = 5 - M.disabilities |= NEARSIGHT - spawn(100) - M.disabilities &= ~NEARSIGHT + thermal_overload() ..() \ No newline at end of file diff --git a/code/modules/clothing/spacesuits/chronosuit.dm b/code/modules/clothing/spacesuits/chronosuit.dm index be2da2b3b62..2e95c4c9f0a 100644 --- a/code/modules/clothing/spacesuits/chronosuit.dm +++ b/code/modules/clothing/spacesuits/chronosuit.dm @@ -281,7 +281,7 @@ loc = get_turf(user) if(user.client && user.client.eye != src) src.loc = get_turf(user) - user.reset_view(src) + user.reset_perspective(src) user.set_machine(src) var/atom/step = get_step(src, direction) if(step) @@ -300,10 +300,11 @@ qdel(src) /obj/effect/chronos_cam/check_eye(mob/user) - if(user == holder) - return 1 - user.unset_machine() - user.reset_view(null) + if(user != holder) + user.unset_machine() + +/obj/effect/chronos_cam/on_unset_machine(mob/user) + user.reset_perspective(null) /obj/effect/chronos_cam/Destroy() if(holder) @@ -311,7 +312,6 @@ holder.remote_control = null if(holder.client && (holder.client.eye == src)) holder.unset_machine() - holder.reset_view(null) return ..() /obj/screen/chronos_target diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index 89c27f94d13..92f57d39faa 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -176,8 +176,6 @@ var/turf/picked = pick(turfs) if(!isturf(picked)) return - if(H.buckled) - H.buckled.unbuckle_mob() H.forceMove(picked) return 1 return 0 diff --git a/code/modules/clothing/under/ties.dm b/code/modules/clothing/under/ties.dm index 90c3ca06834..908cd97e991 100644 --- a/code/modules/clothing/under/ties.dm +++ b/code/modules/clothing/under/ties.dm @@ -45,7 +45,7 @@ /obj/item/clothing/tie/stethoscope/attack(mob/living/carbon/human/M, mob/living/user) if(ishuman(M) && isliving(user)) if(user.a_intent == "help") - var/body_part = parse_zone(user.zone_sel.selecting) + var/body_part = parse_zone(user.zone_selected) if(body_part) var/their = "their" switch(M.gender) diff --git a/code/modules/events/camerafailure.dm b/code/modules/events/camerafailure.dm index 8804b233688..695b82a1926 100644 --- a/code/modules/events/camerafailure.dm +++ b/code/modules/events/camerafailure.dm @@ -17,5 +17,5 @@ while(!("SS13" in C.network)) C = pick(cameranet.cameras) if(C.status) - C.deactivate(null, 0) + C.toggle_cam(null, 0) iterations *= 2.5 diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 1c3365cd59a..1a6ed0de679 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -17,7 +17,6 @@ Gunshots/explosions/opening doors/less rare audio (done) var/obj/halitem var/hal_screwyhud = 0 //1 - critical, 2 - dead, 3 - oxygen indicator, 4 - toxin indicator, 5 - perfect health var/handling_hal = 0 - var/hal_crit = 0 /mob/living/carbon/proc/handle_hallucinations() if(handling_hal) @@ -235,13 +234,11 @@ Gunshots/explosions/opening doors/less rare audio (done) /obj/effect/hallucination/simple/singularity/proc/Eat(atom/OldLoc, Dir) var/target_dist = get_dist(src,target) if(target_dist<=3) //"Eaten" - target.sleeping = 20 - target.hal_crit = 1 target.hal_screwyhud = 1 + target.SetSleeping(20) spawn(rand(50,100)) - target.sleeping = 0 - target.hal_crit = 0 target.hal_screwyhud = 0 + target.SetSleeping(0) /obj/effect/hallucination/battle @@ -434,7 +431,7 @@ Gunshots/explosions/opening doors/less rare audio (done) my_target.show_message("[src.name] has attacked [my_target] with [weapon_name]!", 1) my_target.staminaloss += 30 if(prob(20)) - my_target.eye_blurry += 3 + my_target.set_blurriness(max(my_target.eye_blurry,3)) if(prob(33)) if(!locate(/obj/effect/overlay) in my_target.loc) fake_blood(my_target) @@ -695,13 +692,11 @@ var/list/non_fakeattack_weapons = list(/obj/item/weapon/gun/projectile, /obj/ite halimage = null if("death") //Fake death - src.sleeping = 20 - hal_crit = 1 hal_screwyhud = 1 + SetSleeping(20) spawn(rand(50,100)) - src.sleeping = 0 - hal_crit = 0 hal_screwyhud = 0 + SetSleeping(0) if("husks") if(!halbody) var/list/possible_points = list() diff --git a/code/modules/food&drinks/drinks/drinks.dm b/code/modules/food&drinks/drinks/drinks.dm index b9f6cc3fbd3..c1b01d296a2 100644 --- a/code/modules/food&drinks/drinks/drinks.dm +++ b/code/modules/food&drinks/drinks/drinks.dm @@ -230,7 +230,7 @@ name = "soda can" /obj/item/weapon/reagent_containers/food/drinks/soda_cans/attack(mob/M, mob/user) - if(M == user && !src.reagents.total_volume && user.a_intent == "harm" && user.zone_sel.selecting == "head") + if(M == user && !src.reagents.total_volume && user.a_intent == "harm" && user.zone_selected == "head") user.visible_message("[user] crushes the can of [src] on \his forehead!", "You crush the can of [src] on your forehead.") playsound(user.loc,'sound/weapons/pierce.ogg', rand(10,50), 1) var/obj/item/trash/can/crushed_can = new /obj/item/trash/can(user.loc) diff --git a/code/modules/food&drinks/drinks/drinks/bottle.dm b/code/modules/food&drinks/drinks/drinks/bottle.dm index 9b9bccc986e..0e5647e265d 100644 --- a/code/modules/food&drinks/drinks/drinks/bottle.dm +++ b/code/modules/food&drinks/drinks/drinks/bottle.dm @@ -59,7 +59,7 @@ force = 15 //Smashing bottles over someoen's head hurts. - var/obj/item/organ/limb/affecting = user.zone_sel.selecting //Find what the player is aiming at + var/obj/item/organ/limb/affecting = user.zone_selected //Find what the player is aiming at var/armor_block = 0 //Get the target's armor values for normal attack damage. var/armor_duration = 0 //The more force the bottle has, the longer the duration. diff --git a/code/modules/food&drinks/kitchen machinery/gibber.dm b/code/modules/food&drinks/kitchen machinery/gibber.dm index 79f11788a74..ce1f11696fc 100644 --- a/code/modules/food&drinks/kitchen machinery/gibber.dm +++ b/code/modules/food&drinks/kitchen machinery/gibber.dm @@ -112,9 +112,7 @@ src.add_fingerprint(user) if(do_after(user, gibtime, target = src) && G && G.affecting && G.affecting == C && !C.buckled && !C.buckled_mob && !occupant) user.visible_message("[user] stuffs [G.affecting] into the gibber!") - if(C.client) - C.client.perspective = EYE_PERSPECTIVE - C.client.eye = src + C.reset_perspective(src) C.loc = src occupant = C qdel(G) diff --git a/code/modules/hydroponics/growninedible.dm b/code/modules/hydroponics/growninedible.dm index eed08060cfc..68d83fbb249 100644 --- a/code/modules/hydroponics/growninedible.dm +++ b/code/modules/hydroponics/growninedible.dm @@ -245,7 +245,7 @@ M << "You are stunned by the powerful acid of the Deathnettle!" add_logs(user, M, "attacked", src) - M.eye_blurry += force/7 + M.adjust_blurriness(force/7) if(prob(20)) M.Paralyse(force / 6) M.Weaken(force / 15) diff --git a/code/modules/mob/camera/camera.dm b/code/modules/mob/camera/camera.dm index eb3f4a6c8d0..637779e94ec 100644 --- a/code/modules/mob/camera/camera.dm +++ b/code/modules/mob/camera/camera.dm @@ -8,7 +8,7 @@ mouse_opacity = 0 see_in_dark = 7 invisibility = 101 // No one can see us - + sight = SEE_SELF move_on_shuttle = 0 /mob/camera/experience_pressure_difference() diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 65643040b5c..df98d87281a 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -9,6 +9,9 @@ var/list/image/ghost_darkness_images = list() //this is a list of images for thi density = 0 canmove = 0 anchored = 1 // don't get pushed around + sight = SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF + see_invisible = SEE_INVISIBLE_OBSERVER + see_in_dark = 100 invisibility = INVISIBILITY_OBSERVER languages = ALL var/can_reenter_corpse @@ -27,11 +30,7 @@ var/list/image/ghost_darkness_images = list() //this is a list of images for thi var/ghost_orbit = GHOST_ORBIT_CIRCLE /mob/dead/observer/New(mob/body) - sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF - see_invisible = SEE_INVISIBLE_OBSERVER - see_in_dark = 100 verbs += /mob/dead/observer/proc/dead_tele - stat = DEAD ghostimage = image(src.icon,src,src.icon_state) ghost_darkness_images |= ghostimage @@ -308,11 +307,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp /mob/dead/observer/proc/updateghostsight() if (!seedarkness) - see_invisible = SEE_INVISIBLE_OBSERVER_NOLIGHTING + see_invisible = SEE_INVISIBLE_NOLIGHTING else see_invisible = SEE_INVISIBLE_OBSERVER if (!ghostvision) - see_invisible = SEE_INVISIBLE_LIVING; + see_invisible = SEE_INVISIBLE_LIVING updateghostimages() /proc/updateallghostimages() diff --git a/code/modules/mob/interactive.dm b/code/modules/mob/interactive.dm index 44ecafca878..73bdac2eaa9 100644 --- a/code/modules/mob/interactive.dm +++ b/code/modules/mob/interactive.dm @@ -124,8 +124,7 @@ MYPDA.ownjob = "Crew" MYPDA.name = "PDA-[real_name] ([myjob.title])" equip_to_slot_or_del(MYPDA, slot_belt) - zone_sel = new /obj/screen/zone_sel() - zone_sel.selecting = "chest" + zone_selected = "chest" if(prob(10)) //my x is augmented //arms if(prob((FUZZY_CHANCE_LOW+FUZZY_CHANCE_HIGH)/2)) @@ -554,7 +553,7 @@ if(canmove) if(prob(attitude) && (graytide || (TRAITS & TRAIT_MEAN)) || retal) a_intent = "harm" - zone_sel.selecting = pick("chest","r_leg","l_leg","r_arm","l_arm","head") + zone_selected = pick("chest","r_leg","l_leg","r_arm","l_arm","head") doing |= FIGHTING if(retal) TARGET = retal_target diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 753b66235b6..f8b3f82fcd3 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -26,10 +26,9 @@ W.loc = src //TODO: move to equipped? l_hand = W W.layer = 20 //TODO: move to equipped? -// l_hand.screen_loc = ui_lhand W.equipped(src,slot_l_hand) - if(client) client.screen |= W - if(pulling == W) stop_pulling() + if(pulling == W) + stop_pulling() update_inv_l_hand() W.pixel_x = initial(W.pixel_x) W.pixel_y = initial(W.pixel_y) @@ -46,8 +45,8 @@ r_hand = W W.layer = 20 W.equipped(src,slot_r_hand) - if(client) client.screen |= W - if(pulling == W) stop_pulling() + if(pulling == W) + stop_pulling() update_inv_r_hand() W.pixel_x = initial(W.pixel_x) W.pixel_y = initial(W.pixel_y) diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 4e444378c6f..4a1aa571b53 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -11,6 +11,8 @@ faction = list("alien") ventcrawler = 2 languages = ALIEN + sight = SEE_MOBS + see_in_dark = 4 verb_say = "hisses" type_of_meat = /obj/item/weapon/reagent_containers/food/snacks/meat/slab/xeno var/nightvision = 1 @@ -187,3 +189,39 @@ Des: Removes all infected images from the alien. #undef HEAT_DAMAGE_LEVEL_1 #undef HEAT_DAMAGE_LEVEL_2 #undef HEAT_DAMAGE_LEVEL_3 + + +/mob/living/carbon/alien/update_sight() + if(!client) + return + if(stat == DEAD) + sight |= SEE_TURFS + sight |= SEE_MOBS + sight |= SEE_OBJS + see_in_dark = 8 + see_invisible = SEE_INVISIBLE_OBSERVER + return + + sight = SEE_MOBS + if(nightvision) + see_in_dark = 8 + see_invisible = SEE_INVISIBLE_MINIMUM + else + see_in_dark = 4 + see_invisible = SEE_INVISIBLE_LIVING + + if(client.eye != src) + var/atom/A = client.eye + if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates. + return + + for(var/obj/item/organ/internal/cyberimp/eyes/E in internal_organs) + sight |= E.sight_flags + if(E.dark_view) + see_in_dark = max(see_in_dark, E.dark_view) + if(E.see_invisible) + see_invisible = min(see_invisible, E.see_invisible) + + if(see_override) + see_invisible = see_override + diff --git a/code/modules/mob/living/carbon/alien/alien_defense.dm b/code/modules/mob/living/carbon/alien/alien_defense.dm index e236d53f5e3..d9f5ef6fa98 100644 --- a/code/modules/mob/living/carbon/alien/alien_defense.dm +++ b/code/modules/mob/living/carbon/alien/alien_defense.dm @@ -18,7 +18,7 @@ In all, this is a lot like the monkey code. /N switch(M.a_intent) if ("help") - sleeping = max(0,sleeping-5) + AdjustSleeping(-5) resting = 0 AdjustParalysis(-3) AdjustStunned(-3) diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm index b99f7eb5e88..707fb458493 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm @@ -10,27 +10,6 @@ internal_organs += new /obj/item/organ/internal/alien/plasmavessel/small ..() -/mob/living/carbon/alien/humanoid/hunter/handle_hud_icons_health() - if (healths) - if (stat != 2) - switch(health) - if(150 to INFINITY) - healths.icon_state = "health0" - if(120 to 150) - healths.icon_state = "health1" - if(90 to 120) - healths.icon_state = "health2" - if(60 to 90) - healths.icon_state = "health3" - if(30 to 60) - healths.icon_state = "health4" - if(0 to 30) - healths.icon_state = "health5" - else - healths.icon_state = "health6" - else - healths.icon_state = "health7" - /mob/living/carbon/alien/humanoid/hunter/movement_delay() . = -1 //hunters are sanic . += ..() //but they still need to slow down on stun diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/praetorian.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/praetorian.dm index c7ce06b06b6..9f420dda655 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/praetorian.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/praetorian.dm @@ -19,28 +19,6 @@ AddAbility(new /obj/effect/proc_holder/alien/royal/praetorian/evolve()) ..() -/mob/living/carbon/alien/humanoid/royal/praetorian/handle_hud_icons_health() - if (healths) - if(stat != DEAD) - switch(health) - if(250 to INFINITY) - healths.icon_state = "health0" - if(200 to 250) - healths.icon_state = "health1" - if(150 to 200) - healths.icon_state = "health2" - if(100 to 150) - healths.icon_state = "health3" - if(50 to 100) - healths.icon_state = "health4" - if(0 to 50) - healths.icon_state = "health5" - else - healths.icon_state = "health6" - else - healths.icon_state = "health7" - - /mob/living/carbon/alien/humanoid/royal/praetorian/movement_delay() . = ..() . += 1 diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm index 8e5b88cf393..eb53eb5c1b5 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm @@ -13,26 +13,5 @@ AddAbility(new /obj/effect/proc_holder/alien/sneak) ..() -/mob/living/carbon/alien/humanoid/sentinel/handle_hud_icons_health() - if (healths) - if (stat != 2) - switch(health) - if(125 to INFINITY) - healths.icon_state = "health0" - if(100 to 125) - healths.icon_state = "health1" - if(75 to 100) - healths.icon_state = "health2" - if(50 to 75) - healths.icon_state = "health3" - if(25 to 50) - healths.icon_state = "health4" - if(0 to 25) - healths.icon_state = "health5" - else - healths.icon_state = "health6" - else - healths.icon_state = "health7" - /mob/living/carbon/alien/humanoid/sentinel/movement_delay() . = ..() diff --git a/code/modules/mob/living/carbon/alien/humanoid/death.dm b/code/modules/mob/living/carbon/alien/humanoid/death.dm index 9e2d3706d6c..67d9304cec5 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/death.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/death.dm @@ -1,17 +1,14 @@ /mob/living/carbon/alien/humanoid/death(gibbed) - if(stat == DEAD) return - if(healths) healths.icon_state = "health6" + if(stat == DEAD) + return + stat = DEAD if(!gibbed) playsound(loc, 'sound/voice/hiss6.ogg', 80, 1, 1) visible_message("[src] lets out a waning guttural screech, green blood bubbling from its maw...") update_canmove() - if(client) blind.layer = 0 update_icons() status_flags |=CANPUSH - tod = worldtime2text() //weasellos time of death patch - if(mind) mind.store_memory("Time of death: [tod]", 0) - return ..(gibbed) diff --git a/code/modules/mob/living/carbon/alien/humanoid/login.dm b/code/modules/mob/living/carbon/alien/humanoid/login.dm deleted file mode 100644 index 607a03fef0f..00000000000 --- a/code/modules/mob/living/carbon/alien/humanoid/login.dm +++ /dev/null @@ -1,7 +0,0 @@ -/mob/living/carbon/alien/humanoid/Login() - ..() - update_hud() - if(!isturf(loc)) - client.eye = loc - client.perspective = EYE_PERSPECTIVE - return diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm index 25f8bf1f9bd..34b64d21bd9 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm @@ -43,27 +43,6 @@ AddAbility(new/obj/effect/proc_holder/alien/royal/queen/promote()) ..() -/mob/living/carbon/alien/humanoid/royal/queen/handle_hud_icons_health() - if (src.healths) - if (src.stat != 2) - switch(health) - if(400 to INFINITY) - src.healths.icon_state = "health0" - if(320 to 400) - src.healths.icon_state = "health1" - if(240 to 320) - src.healths.icon_state = "health2" - if(160 to 240) - src.healths.icon_state = "health3" - if(80 to 160) - src.healths.icon_state = "health4" - if(0 to 80) - src.healths.icon_state = "health5" - else - src.healths.icon_state = "health6" - else - src.healths.icon_state = "health7" - /mob/living/carbon/alien/humanoid/royal/queen/movement_delay() . = ..() . += 5 diff --git a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm index 9d8853c6c0d..5812dd9eac1 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm @@ -1,6 +1,5 @@ /mob/living/carbon/alien/humanoid/update_icons() - update_hud() //TODO: remove the need for this to be here overlays.Cut() for(var/image/I in overlays_standing) overlays += I @@ -42,7 +41,6 @@ /mob/living/carbon/alien/humanoid/regenerate_icons() if(!..()) - update_hud() // update_icons() //Handled in update_transform(), leaving this here as a reminder update_transform() @@ -76,5 +74,4 @@ var/image/I = image("icon" = alt_inhands_file , "icon_state"="[itm_state][caste]_l", "layer"=-L_HAND_LAYER) overlays_standing[L_HAND_LAYER] = I - - apply_overlay(L_HAND_LAYER) \ No newline at end of file + apply_overlay(L_HAND_LAYER) diff --git a/code/modules/mob/living/carbon/alien/larva/death.dm b/code/modules/mob/living/carbon/alien/larva/death.dm index 67edcfd04ca..136572fb5c5 100644 --- a/code/modules/mob/living/carbon/alien/larva/death.dm +++ b/code/modules/mob/living/carbon/alien/larva/death.dm @@ -1,16 +1,10 @@ /mob/living/carbon/alien/larva/death(gibbed) - if(stat == DEAD) return - if(healths) healths.icon_state = "health6" + if(stat == DEAD) + return stat = DEAD icon_state = "larva_dead" if(!gibbed) visible_message("[src] lets out a waning high-pitched cry.") - update_canmove() - if(client) blind.layer = 0 - - tod = worldtime2text() //weasellos time of death patch - if(mind) mind.store_memory("Time of death: [tod]", 0) - living_mob_list -= src return ..(gibbed) diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index cfbef54967e..f6a48f29d41 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -10,39 +10,26 @@ // GROW! if(amount_grown < max_grown) amount_grown++ - - //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_hud_icons_health() - - if (healths) - if (stat != 2) - switch(health) - if(25 to INFINITY) - healths.icon_state = "health0" - if(20 to 25) - healths.icon_state = "health1" - if(15 to 20) - healths.icon_state = "health2" - if(10 to 15) - healths.icon_state = "health3" - if(5 to 10) - healths.icon_state = "health4" - if(0 to 5) - healths.icon_state = "health5" - else - healths.icon_state = "health6" - else - healths.icon_state = "health7" + update_icons() -/mob/living/carbon/alien/larva/handle_regular_status_updates() - - if(..()) //alive - - if(health <= -maxHealth) +/mob/living/carbon/alien/larva/update_stat() + if(status_flags & GODMODE) + return + if(stat != DEAD) + if(health<= -maxHealth || !getorgan(/obj/item/organ/internal/brain)) death() return - - return 1 \ No newline at end of file + if(paralysis || sleeping || getOxyLoss() > 50 || (status_flags & FAKEDEATH) || health <= config.health_threshold_crit) + if(stat == CONSCIOUS) + stat = UNCONSCIOUS + set_blindness(1) + update_canmove() + else + if(stat == UNCONSCIOUS) + stat = CONSCIOUS + resting = 0 + adjust_blindness(-1) + update_canmove() + update_damage_hud() + update_health_hud() \ No newline at end of file diff --git a/code/modules/mob/living/carbon/alien/larva/update_icons.dm b/code/modules/mob/living/carbon/alien/larva/update_icons.dm index 5f355eff7c7..6e4c9f8a931 100644 --- a/code/modules/mob/living/carbon/alien/larva/update_icons.dm +++ b/code/modules/mob/living/carbon/alien/larva/update_icons.dm @@ -26,4 +26,6 @@ return update_icons() /mob/living/carbon/alien/larva/update_inv_handcuffed() - return \ No newline at end of file + update_icons() //larva icon_state changes if cuffed/uncuffed. + + diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index 4162a583675..7e2af0ebb2f 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -35,35 +35,5 @@ if(move_delay_add > 0) move_delay_add = max(0, move_delay_add - rand(1, 2)) -/mob/living/carbon/alien/update_sight() - if(stat == DEAD) - sight |= SEE_TURFS - sight |= SEE_MOBS - sight |= SEE_OBJS - see_in_dark = 8 - see_invisible = SEE_INVISIBLE_LEVEL_TWO - else - sight |= SEE_MOBS - sight &= ~SEE_TURFS - sight &= ~SEE_OBJS - if(nightvision) - see_in_dark = 8 - see_invisible = SEE_INVISIBLE_MINIMUM - else if(!nightvision) - see_in_dark = 4 - see_invisible = 45 - if(see_override) - see_invisible = see_override - -/mob/living/carbon/alien/handle_hud_icons() - - handle_hud_icons_health() - - return 1 - -/mob/living/carbon/alien/CheckStamina() - setStaminaLoss(max((staminaloss - 2), 0)) - return - /mob/living/carbon/alien/handle_changeling() return \ No newline at end of file diff --git a/code/modules/mob/living/carbon/alien/screen.dm b/code/modules/mob/living/carbon/alien/screen.dm index 616f681538a..bcc24157cd4 100644 --- a/code/modules/mob/living/carbon/alien/screen.dm +++ b/code/modules/mob/living/carbon/alien/screen.dm @@ -1,6 +1,3 @@ -/obj/screen/zone_sel/alien/update_icon() - overlays.Cut() - overlays += selecting /mob/living/carbon/alien/proc/updatePlasmaDisplay() if(hud_used) //clientless aliens diff --git a/code/modules/mob/living/carbon/brain/MMI.dm b/code/modules/mob/living/carbon/brain/MMI.dm index 227b4ea3b43..65a472c8178 100644 --- a/code/modules/mob/living/carbon/brain/MMI.dm +++ b/code/modules/mob/living/carbon/brain/MMI.dm @@ -18,14 +18,21 @@ /obj/item/device/mmi/update_icon() if(brain) if(istype(brain,/obj/item/organ/internal/brain/alien)) - icon_state = "mmi_alien" + if(brain.brainmob && brain.brainmob.stat == DEAD) + icon_state = "mmi_alien_dead" + else + icon_state = "mmi_alien" braintype = "Xenoborg" //HISS....Beep. else - icon_state = "mmi_full" + if(brain.brainmob && brain.brainmob.stat == DEAD) + icon_state = "mmi_dead" + else + icon_state = "mmi_full" braintype = "Cyborg" else icon_state = "mmi_empty" + /obj/item/device/mmi/attackby(obj/item/O, mob/user, params) user.changeNext_move(CLICK_CD_MELEE) if(istype(O,/obj/item/organ/internal/brain)) //Time to stick a brain in it --NEO @@ -48,9 +55,11 @@ newbrain.brainmob = null brainmob.loc = src brainmob.container = src - brainmob.stat = 0 - dead_mob_list -= brainmob //Update dem lists - living_mob_list += brainmob + if(brainmob.health > config.health_threshold_dead) + brainmob.stat = CONSCIOUS + brainmob.reset_perspective() + dead_mob_list -= brainmob //Update dem lists + living_mob_list += brainmob newbrain.loc = src //P-put your brain in it brain = newbrain @@ -75,6 +84,9 @@ brainmob.container = null //Reset brainmob mmi var. brainmob.loc = brain //Throw mob into brain. + brainmob.stat = DEAD + brainmob.emp_damage = 0 + brainmob.reset_perspective() //so the brainmob follows the brain organ instead of the mmi. And to update our vision living_mob_list -= brainmob //Get outta here brain.brainmob = brainmob //Set the brain to use the brainmob brainmob = null //Set mmi brainmob var to null @@ -137,11 +149,12 @@ else switch(severity) if(1) - brainmob.emp_damage += rand(20,30) + brainmob.emp_damage = min(brainmob.emp_damage + rand(20,30), 30) if(2) - brainmob.emp_damage += rand(10,20) + brainmob.emp_damage = min(brainmob.emp_damage + rand(10,20), 30) if(3) - brainmob.emp_damage += rand(0,10) + brainmob.emp_damage = min(brainmob.emp_damage + rand(0,10), 30) + brainmob.emote("alarm") ..() /obj/item/device/mmi/Destroy() diff --git a/code/modules/mob/living/carbon/brain/brain.dm b/code/modules/mob/living/carbon/brain/brain.dm index fbaa5e16486..d3babc45894 100644 --- a/code/modules/mob/living/carbon/brain/brain.dm +++ b/code/modules/mob/living/carbon/brain/brain.dm @@ -5,7 +5,7 @@ var/obj/item/container = null var/timeofhostdeath = 0 var/emp_damage = 0//Handles a type of MMI damage - var/alert = null + var/revivable = 1 // has_limbs = 0 /mob/living/carbon/brain/Destroy() @@ -16,8 +16,10 @@ return ..() /mob/living/carbon/brain/update_canmove() - if(in_contents_of(/obj/mecha)) canmove = 1 - else canmove = 0 + if(in_contents_of(/obj/mecha)) + canmove = 1 + else + canmove = 0 return canmove /mob/living/carbon/brain/toggle_throw_mode() @@ -29,13 +31,6 @@ /mob/living/carbon/brain/blob_act() return -/mob/living/carbon/brain/on_forcemove(atom/newloc) - if(container) - container.loc = newloc - else //something went very wrong. - CRASH("Brainmob without container.") - loc = container - /mob/living/carbon/brain/UnarmedAttack(atom/A)//Stops runtimes due to attack_animal being the default return diff --git a/code/modules/mob/living/carbon/brain/brain_item.dm b/code/modules/mob/living/carbon/brain/brain_item.dm index fb42992cd01..64d3666e260 100644 --- a/code/modules/mob/living/carbon/brain/brain_item.dm +++ b/code/modules/mob/living/carbon/brain/brain_item.dm @@ -42,14 +42,6 @@ /obj/item/organ/internal/brain/prepare_eat() return // Too important to eat. -/obj/item/organ/internal/brain/New() - ..() - //Shifting the brain "mob" over to the brain object so it's easier to keep track of. --NEO - spawn(5) - if(brainmob && brainmob.client) - brainmob.client.screen.len = null //clear the hud - - /obj/item/organ/internal/brain/proc/transfer_identity(mob/living/L) name = "[L.name]'s brain" brainmob = new(src) @@ -68,11 +60,17 @@ /obj/item/organ/internal/brain/examine(mob/user) ..() - if(brainmob && brainmob.client) - user << "You can feel the small spark of life still left in this one." - else - user << "This one seems particularly lifeless. Perhaps it will regain some of its luster later." + if(brainmob) + if(brainmob.client) + if(brainmob.health <= config.health_threshold_dead) + user << "It's lifeless and severely damaged." + else + user << "You can feel the small spark of life still left in this one." + else + user << "This one seems particularly lifeless. Perhaps it will regain some of its luster later." + else + user << "This one is completely devoid of life." /obj/item/organ/internal/brain/attack(mob/living/carbon/M, mob/user) if(!istype(M)) @@ -80,7 +78,7 @@ add_fingerprint(user) - if(user.zone_sel.selecting != "head") + if(user.zone_selected != "head") return ..() var/mob/living/carbon/human/H = M diff --git a/code/modules/mob/living/carbon/brain/death.dm b/code/modules/mob/living/carbon/brain/death.dm index 889c0826459..5931a033626 100644 --- a/code/modules/mob/living/carbon/brain/death.dm +++ b/code/modules/mob/living/carbon/brain/death.dm @@ -1,22 +1,14 @@ /mob/living/carbon/brain/death(gibbed) - if(stat == DEAD) return + if(stat == DEAD) + return if(!gibbed && container && istype(container, /obj/item/device/mmi))//If not gibbed but in a container. - container.visible_message("[src]'s MMI flatlines!", \ + var/obj/item/device/mmi = container + mmi.visible_message("[src]'s MMI flatlines!", \ "You hear something flatline.") - if(istype(src,/obj/item/organ/internal/brain/alien)) - container.icon_state = "mmi_alien_dead" - else - container.icon_state = "mmi_dead" + mmi.update_icon() + stat = DEAD - if(blind) blind.layer = 0 - sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS - see_in_dark = 8 - see_invisible = SEE_INVISIBLE_LEVEL_TWO - - tod = worldtime2text() //weasellos time of death patch - if(mind) mind.store_memory("Time of death: [tod]", 0) //mind. ? - return ..(gibbed) /mob/living/carbon/brain/gib(animation = 0) diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index 752219b0815..a74c233761c 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -52,104 +52,46 @@ var/discomfort = min( abs(exposed_temperature - bodytemperature)*(exposed_intensity)/2000000, 1) adjustFireLoss(5*discomfort) - -/mob/living/carbon/brain/handle_regular_status_updates() //TODO: comment out the unused bits >_> - - if(stat == DEAD) - eye_blind = max(eye_blind, 1) - silent = 0 - else - updatehealth() - if( !container && (health < config.health_threshold_dead || ((world.time - timeofhostdeath) > config.revival_brain_life)) ) +/mob/living/carbon/brain/update_stat() + if(status_flags & GODMODE) + return + if(stat != DEAD) + if(health <= config.health_threshold_dead || !container) death() - eye_blind = max(eye_blind, 1) - silent = 0 return + if(emp_damage>15) + if(stat == CONSCIOUS) + stat = UNCONSCIOUS + set_blindness(1) else - stat = CONSCIOUS + if(stat == UNCONSCIOUS) + stat = CONSCIOUS + set_blindness(0) - //Handling EMP effect in the Life(), it's made VERY simply, and has some additional effects handled elsewhere - if(emp_damage) //This is pretty much a damage type only used by MMIs, dished out by the emp_act - if(!(container && istype(container, /obj/item/device/mmi))) - emp_damage = 0 - else - emp_damage = round(emp_damage,1)//Let's have some nice numbers to work with - switch(emp_damage) - if(31 to INFINITY) - emp_damage = 30//Let's not overdo it - if(21 to 30)//High level of EMP damage, unable to see, hear, or speak - eye_blind = max(eye_blind, 1) - setEarDamage(-1,1) - silent = 1 - if(!alert)//Sounds an alarm, but only once per 'level' - emote("alarm") - src << "Major electrical distruption detected: System rebooting." - alert = 1 - if(prob(75)) - emp_damage -= 1 - if(20) - alert = 0 - eye_blind = 0 - setEarDamage(-1,0) - silent = 0 - emp_damage -= 1 - if(11 to 19)//Moderate level of EMP damage, resulting in nearsightedness and ear damage - eye_blurry = 1 - setEarDamage(1,-1) - if(!alert) - emote("alert") - src << "Primary systems are now online." - alert = 1 - if(prob(50)) - emp_damage -= 1 - if(10) - alert = 0 - eye_blurry = 0 - setEarDamage(0,-1) - emp_damage -= 1 - if(2 to 9)//Low level of EMP damage, has few effects(handled elsewhere) - if(!alert) - emote("notice") - src << "System reboot nearly complete." - alert = 1 - if(prob(25)) - emp_damage -= 1 - if(1) - alert = 0 - src << "All systems restored." - emp_damage -= 1 - else - eye_blind = 0 - return 1 - -/mob/living/carbon/brain/handle_disabilities() - //Eyes - if(disabilities & BLIND || stat) - eye_blind = max(eye_blind, 1) - else - if(eye_blind) - eye_blind = 0 - if(eye_blurry) - eye_blurry = 0 - if(eye_stat) - eye_stat = 0 - - //Ears - if(disabilities & DEAF) - setEarDamage(-1, max(ear_deaf, 1)) - else if(ear_damage < 100) - setEarDamage(0, 0) +/* //currently unused feature, since brain outside a mmi is always dead. +/mob/living/carbon/brain/proc/handle_brain_revival_life() + if(stat != DEAD) + if(config.revival_brain_life != -1) + if( !container && (world.time - timeofhostdeath) > config.revival_brain_life) + death() +*/ /mob/living/carbon/brain/handle_status_effects() + if(!container) + emp_damage = 0 + return + if(emp_damage) + update_stat() + emp_damage = max(emp_damage-1, 0) + +/mob/living/carbon/brain/handle_disabilities() + return + +/mob/living/carbon/brain/setEarDamage() return /mob/living/carbon/brain/handle_changeling() return -/mob/living/carbon/brain/handle_regular_hud_updates() - handle_vision() - handle_hud_icons_health() - update_action_buttons() - return 1 diff --git a/code/modules/mob/living/carbon/brain/login.dm b/code/modules/mob/living/carbon/brain/login.dm deleted file mode 100644 index 84bccdfe964..00000000000 --- a/code/modules/mob/living/carbon/brain/login.dm +++ /dev/null @@ -1,2 +0,0 @@ -/mob/living/carbon/brain/Login() - return ..() \ No newline at end of file diff --git a/code/modules/mob/living/carbon/brain/posibrain.dm b/code/modules/mob/living/carbon/brain/posibrain.dm index 40727647cd7..9c018695bcb 100644 --- a/code/modules/mob/living/carbon/brain/posibrain.dm +++ b/code/modules/mob/living/carbon/brain/posibrain.dm @@ -70,7 +70,7 @@ var/global/posibrain_notif_cooldown = 0 brainmob.dna = new /datum/dna(brainmob) C.dna.copy_dna(brainmob.dna) brainmob.timeofhostdeath = C.timeofdeath - brainmob.stat = 0 + brainmob.stat = CONSCIOUS if(brainmob.mind) brainmob.mind.assigned_role = "Positronic Brain" if(C.mind) @@ -135,8 +135,6 @@ var/global/posibrain_notif_cooldown = 0 brainmob.real_name = brainmob.name brainmob.loc = src brainmob.container = src - brainmob.stat = 0 - brainmob.silent = 0 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 c7d8d287697..12b27da18a6 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -154,9 +154,7 @@ if(health >= 0) if(lying) - sleeping = max(0, sleeping - 5) - if(sleeping == 0) - resting = 0 + AdjustSleeping(-5) M.visible_message("[M] shakes [src] trying to get \him up!", \ "You shake [src] trying to get \him up!") else @@ -178,27 +176,27 @@ if(1) src << "Your eyes sting a little." if(prob(40)) - eye_stat += 1 + adjust_eye_stat(1) if(2) src << "Your eyes burn." - eye_stat += rand(2, 4) + adjust_eye_stat(rand(2, 4)) else src << "Your eyes itch and burn severely!" - eye_stat += rand(12, 16) + adjust_eye_stat(rand(12, 16)) if(eye_stat > 10) - eye_blind += damage - eye_blurry += damage * rand(3, 6) + set_blindness(damage) + set_blurriness(damage * rand(3, 6)) if(eye_stat > 20) - if (prob(eye_stat - 20)) - src << "Your eyes start to burn badly!" - disabilities |= NEARSIGHT + if(prob(eye_stat - 20)) + if(become_nearsighted()) + src << "Your eyes start to burn badly!" else if(prob(eye_stat - 25)) - src << "You can't see anything!" - disabilities |= BLIND + if(become_blind()) + src << "You can't see anything!" else src << "Your eyes are really starting to hurt. This can't be good for you!" return 1 @@ -207,9 +205,6 @@ if(prob(20)) src << "Something bright flashes in the corner of your vision!" -/mob/living/carbon/proc/tintcheck() - return 0 - //Throwing stuff /mob/living/carbon/proc/toggle_throw_mode() if(stat) @@ -222,12 +217,14 @@ /mob/living/carbon/proc/throw_mode_off() in_throw_mode = 0 - throw_icon.icon_state = "act_throw_off" + if(client && hud_used) + hud_used.throw_icon.icon_state = "act_throw_off" /mob/living/carbon/proc/throw_mode_on() in_throw_mode = 1 - throw_icon.icon_state = "act_throw_on" + if(client && hud_used) + hud_used.throw_icon.icon_state = "act_throw_on" /mob/proc/throw_item(atom/target) return @@ -322,12 +319,10 @@ if(do_mob(usr, src, POCKET_STRIP_DELAY)) if(internal) internal = null - if(internals) - internals.icon_state = "internal0" + update_internals_hud_icon(0) else if(ITEM && istype(ITEM, /obj/item/weapon/tank) && wear_mask && (wear_mask.flags & MASKINTERNALS)) internal = ITEM - if(internals) - internals.icon_state = "internal1" + update_internals_hud_icon(1) visible_message("[usr] [internal ? "opens" : "closes"] the valve on [src]'s [ITEM].", \ "[usr] [internal ? "opens" : "closes"] the valve on [src]'s [ITEM].") @@ -441,7 +436,7 @@ var/const/GALOSHES_DONT_HELP = 4 handcuffed = null if(buckled && buckled.buckle_requires_restraints) buckled.unbuckle_mob() - update_inv_handcuffed() + update_handcuffed() return if(legcuffed) legcuffed.loc = loc @@ -464,7 +459,7 @@ var/const/GALOSHES_DONT_HELP = 4 if(handcuffed) handcuffed = null - update_inv_handcuffed() + update_handcuffed() return else legcuffed = null @@ -478,7 +473,7 @@ var/const/GALOSHES_DONT_HELP = 4 handcuffed = null if (buckled && buckled.buckle_requires_restraints) buckled.unbuckle_mob() - update_inv_handcuffed() + update_handcuffed() if (client) client.screen -= W if (W) @@ -610,3 +605,287 @@ var/const/GALOSHES_DONT_HELP = 4 nutrition -= lost_nutrition adjustToxLoss(-3) return 1 + +/mob/living/carbon/update_sight() + if(!client) + return + if(stat == DEAD) + sight = (SEE_TURFS|SEE_MOBS|SEE_OBJS) + see_in_dark = 8 + see_invisible = SEE_INVISIBLE_OBSERVER + return + + see_invisible = initial(see_invisible) + see_in_dark = initial(see_in_dark) + sight = initial(sight) + + if(client.eye != src) + var/atom/A = client.eye + if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates. + return + + for(var/obj/item/organ/internal/cyberimp/eyes/E in internal_organs) + sight |= E.sight_flags + if(E.dark_view) + see_in_dark = max(see_in_dark,E.dark_view) + if(E.see_invisible) + see_invisible = min(see_invisible, E.see_invisible) + + if(see_override) + see_invisible = see_override + + +//to recalculate the mob's total tint from tinted equipment it's wearing. +/mob/living/carbon/proc/update_tinttotal() + if(!tinted_weldhelh) + return + tinttotal = 0 + if(istype(head, /obj/item/clothing/head)) + var/obj/item/clothing/head/HT = head + tinttotal += HT.tint + if(wear_mask) + tinttotal += wear_mask.tint + update_vision_overlays() + +/mob/living/carbon/update_vision_overlays() + if(!client) + return + client.screen.Remove(global_hud.blind, global_hud.darkMask, global_hud.blurry, global_hud.druggy, global_hud.vimpaired) + + if(stat == DEAD) //if dead we just remove all vision impairments + return + + var/list/impairments = list() + + if(tinted_weldhelh) + if(tinttotal >= TINT_BLIND) + impairments |= global_hud.blind + else if(tinttotal >= TINT_DARKENED) + impairments |= global_hud.darkMask + + if(eye_blind) + impairments |= global_hud.blind + + if(eye_blurry) + impairments |= global_hud.blurry + + if(druggy) + impairments |= global_hud.druggy + + if(eye_stat > 20) + if(eye_stat > 30) + impairments |= global_hud.darkMask + else + impairments |= global_hud.vimpaired + + if(client.eye != src) + var/atom/A = client.eye + var/new_impairments = A.get_vision_impairments(src) + if(new_impairments) + impairments |= new_impairments + + for(var/A in impairments) + client.screen += A + + +/mob/living/carbon/revive() + setToxLoss(0) + setOxyLoss(0) + setCloneLoss(0) + setBrainLoss(0) + setStaminaLoss(0) + SetParalysis(0) + SetStunned(0) + SetWeakened(0) + SetSleeping(0) + radiation = 0 + nutrition = NUTRITION_LEVEL_FED + 50 + bodytemperature = 310 + if(client) + if(eye_blind) + client.screen.Remove(global_hud.blind) + clear_alert("blind") + if(eye_blurry) + client.screen.Remove(global_hud.blurry) + client.screen.Remove(global_hud.darkMask) + client.screen.Remove(global_hud.vimpaired) + eye_stat = 0 + disabilities = 0 + eye_blind = 0 + eye_blurry = 0 + ear_deaf = 0 + ear_damage = 0 + heal_overall_damage(1000, 1000) + ExtinguishMob() + fire_stacks = 0 + suiciding = 0 + handcuffed = initial(handcuffed) + for(var/obj/item/weapon/restraints/R in contents) //actually remove cuffs from inventory + qdel(R) + update_handcuffed() + if(reagents) + for(var/datum/reagent/R in reagents.reagent_list) + reagents.clear_reagents() + reagents.addiction_list = list() + for(var/datum/disease/D in viruses) + D.cure(0) + if(stat == DEAD) + dead_mob_list -= src + living_mob_list += src + stat = CONSCIOUS + if(ishuman(src)) + var/mob/living/carbon/human/human_mob = src + human_mob.restore_blood() + human_mob.remove_all_embedded_objects() + updatehealth() + update_fire() + if(dna) + for(var/datum/mutation/human/HM in dna.mutations) + if(HM.quality != POSITIVE) + dna.remove_mutation(HM.name) + update_sight() + update_vision_overlays() + update_canmove() + + +//this handles hud updates +/mob/living/carbon/update_damage_hud() + + if(!client) + return + + if(damageoverlay) + damageoverlay.overlays.Cut() + switch(stat) + if(UNCONSCIOUS) + //Critical damage passage overlay + if(health <= config.health_threshold_crit) + var/image/I = image("icon" = 'icons/mob/screen_full.dmi', "icon_state" = "passage0") + I.blend_mode = BLEND_OVERLAY //damageoverlay is BLEND_MULTIPLY + switch(health) + if(-20 to -10) + I.icon_state = "passage1" + if(-30 to -20) + I.icon_state = "passage2" + if(-40 to -30) + I.icon_state = "passage3" + if(-50 to -40) + I.icon_state = "passage4" + if(-60 to -50) + I.icon_state = "passage5" + if(-70 to -60) + I.icon_state = "passage6" + if(-80 to -70) + I.icon_state = "passage7" + if(-90 to -80) + I.icon_state = "passage8" + if(-95 to -90) + I.icon_state = "passage9" + if(-INFINITY to -95) + I.icon_state = "passage10" + damageoverlay.overlays += I + if(CONSCIOUS) + //Oxygen damage overlay + if(oxyloss) + var/image/I = image("icon" = 'icons/mob/screen_full.dmi', "icon_state" = "oxydamageoverlay0") + switch(oxyloss) + if(10 to 20) + I.icon_state = "oxydamageoverlay1" + if(20 to 25) + I.icon_state = "oxydamageoverlay2" + if(25 to 30) + I.icon_state = "oxydamageoverlay3" + if(30 to 35) + I.icon_state = "oxydamageoverlay4" + if(35 to 40) + I.icon_state = "oxydamageoverlay5" + if(40 to 45) + I.icon_state = "oxydamageoverlay6" + if(45 to INFINITY) + I.icon_state = "oxydamageoverlay7" + damageoverlay.overlays += I + + //Fire and Brute damage overlay (BSSR) + var/hurtdamage = getBruteLoss() + getFireLoss() + damageoverlaytemp + if(hurtdamage) + var/image/I = image("icon" = 'icons/mob/screen_full.dmi', "icon_state" = "brutedamageoverlay0") + I.blend_mode = BLEND_ADD + switch(hurtdamage) + if(5 to 15) + I.icon_state = "brutedamageoverlay1" + if(15 to 30) + I.icon_state = "brutedamageoverlay2" + if(30 to 45) + I.icon_state = "brutedamageoverlay3" + if(45 to 70) + I.icon_state = "brutedamageoverlay4" + if(70 to 85) + I.icon_state = "brutedamageoverlay5" + if(85 to INFINITY) + I.icon_state = "brutedamageoverlay6" + var/image/black = image(I.icon, I.icon_state) //BLEND_ADD doesn't let us darken, so this is just to blacken the edge of the screen + black.color = "#170000" + damageoverlay.overlays += I + damageoverlay.overlays += black + +/mob/living/carbon/update_health_hud(shown_health_amount) + if(!client || !hud_used) + return + if(hud_used.healths) + if(stat != DEAD) + . = 1 + if(!shown_health_amount) + shown_health_amount = health + if(shown_health_amount >= maxHealth) + hud_used.healths.icon_state = "health0" + else if(shown_health_amount > maxHealth*0.8) + hud_used.healths.icon_state = "health1" + else if(shown_health_amount > maxHealth*0.6) + hud_used.healths.icon_state = "health2" + else if(shown_health_amount > maxHealth*0.4) + hud_used.healths.icon_state = "health3" + else if(shown_health_amount > maxHealth*0.2) + hud_used.healths.icon_state = "health4" + else if(shown_health_amount > 0) + hud_used.healths.icon_state = "health5" + else + hud_used.healths.icon_state = "health6" + else + hud_used.healths.icon_state = "health7" + +/mob/living/carbon/proc/update_internals_hud_icon(internal_state = 0) + if(hud_used && hud_used.internals) + hud_used.internals = "internal[internal_state]" + +/mob/living/carbon/update_stat() + if(status_flags & GODMODE) + return + if(stat != DEAD) + if(health<= config.health_threshold_dead || !getorgan(/obj/item/organ/internal/brain)) + death() + return + if(paralysis || sleeping || getOxyLoss() > 50 || (status_flags & FAKEDEATH) || health <= config.health_threshold_crit) + if(stat == CONSCIOUS) + stat = UNCONSCIOUS + set_blindness(1) + update_canmove() + else + if(stat == UNCONSCIOUS) + stat = CONSCIOUS + resting = 0 + adjust_blindness(-1) + update_canmove() + update_damage_hud() + update_health_hud() + +//called when we get cuffed/uncuffed +/mob/living/carbon/proc/update_handcuffed() + if(handcuffed) + drop_r_hand() + drop_l_hand() + stop_pulling() + throw_alert("handcuffed", /obj/screen/alert/restrained/handcuffed, new_master = src.handcuffed) + else + clear_alert("handcuffed") + update_inv_handcuffed() + update_hud_handcuffed() \ No newline at end of file diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index f31fd834c05..665ca0422be 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -28,3 +28,5 @@ var/gib_type = /obj/effect/decal/cleanable/blood/gibs var/rotate_on_lying = 1 + + var/tinttotal = 0 // Total level of visualy impairing items diff --git a/code/modules/mob/living/carbon/death.dm b/code/modules/mob/living/carbon/death.dm index 056dfbc5ec9..127aafc8f77 100644 --- a/code/modules/mob/living/carbon/death.dm +++ b/code/modules/mob/living/carbon/death.dm @@ -3,4 +3,4 @@ losebreath = 0 med_hud_set_health() med_hud_set_status() - ..(gibbed) + ..() diff --git a/code/modules/mob/living/carbon/human/blood.dm b/code/modules/mob/living/carbon/human/blood.dm index ae8d90f7985..15ceb38545e 100644 --- a/code/modules/mob/living/carbon/human/blood.dm +++ b/code/modules/mob/living/carbon/human/blood.dm @@ -92,7 +92,7 @@ var/const/BLOOD_VOLUME_SURVIVE = 122 oxyloss += 10 oxyloss += 1 if(prob(5)) - eye_blurry += 6 + set_blurriness(max(eye_blurry,6)) var/word = pick("dizzy","woozy","faint") src << "You feel very [word]." if(BLOOD_VOLUME_SURVIVE to BLOOD_VOLUME_BAD) diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 365c881dac9..4810de6cf47 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -16,8 +16,6 @@ /mob/living/carbon/human/death(gibbed) if(stat == DEAD) return - if(healths) - healths.icon_state = "health5" stat = DEAD dizziness = 0 jitteriness = 0 @@ -31,15 +29,9 @@ if(!gibbed) emote("deathgasp") //let the world KNOW WE ARE DEAD - update_canmove() - if(client) blind.layer = 0 - dna.species.spec_death(gibbed,src) - tod = worldtime2text() //weasellos time of death patch - if(mind) mind.store_memory("Time of death: [tod]", 0) if(ticker && ticker.mode) -// world.log << "k" sql_report_death(src) ticker.mode.check_win() //Calls the rounds wincheck, mainly for wizard, malf, and changeling now return ..(gibbed) @@ -50,7 +42,8 @@ return 1 /mob/living/carbon/proc/ChangeToHusk() - if(disabilities & HUSK) return + if(disabilities & HUSK) + return disabilities |= HUSK status_flags |= DISFIGURED //makes them unknown without fucking up other stuff like admintools return 1 diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index d578bb03c28..3e7cc505ffe 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -563,7 +563,7 @@ /mob/living/carbon/human/can_inject(mob/user, error_msg, target_zone, var/penetrate_thick = 0) . = 1 // Default to returning true. if(user && !target_zone) - target_zone = user.zone_sel.selecting + target_zone = user.zone_selected if(dna && PIERCEIMMUNE in dna.species.specflags) . = 0 // If targeting the head, see if the head item is thin enough. @@ -863,3 +863,111 @@ return 1 return return 1 + +/mob/living/carbon/human/update_sight() + if(!client) + return + if(stat == DEAD) + sight = (SEE_TURFS|SEE_MOBS|SEE_OBJS) + see_in_dark = 8 + see_invisible = SEE_INVISIBLE_OBSERVER + return + + dna.species.update_sight(src) + +/mob/living/carbon/human/update_tinttotal() + if(!tinted_weldhelh) + return + tinttotal = 0 + if(istype(head, /obj/item/clothing/head)) + var/obj/item/clothing/head/HT = head + tinttotal += HT.tint + if(wear_mask) + tinttotal += wear_mask.tint + if(glasses) + tinttotal += glasses.tint + update_vision_overlays() + +/mob/living/carbon/human/update_vision_overlays() + if(!client) + return + client.screen.Remove(global_hud.blind, global_hud.darkMask, global_hud.blurry, global_hud.druggy, global_hud.vimpaired) + + if(stat == DEAD) //if dead we remove all vision impairments + return + + var/list/impairments = list() + + if(tinted_weldhelh) + if(tinttotal >= TINT_BLIND) + impairments |= global_hud.blind + else if(tinttotal >= TINT_DARKENED) + impairments |= global_hud.darkMask + + if(eye_blind) + impairments |= global_hud.blind + + if(disabilities & NEARSIGHT && !(glasses && glasses.vision_correction)) + impairments |= global_hud.vimpaired + + if(eye_blurry) + impairments |= global_hud.blurry + + if(druggy) + impairments |= global_hud.druggy + + if(eye_stat > 20) + if(eye_stat > 30) + impairments |= global_hud.darkMask + else + impairments |= global_hud.vimpaired + + if(client.eye != src) + var/atom/A = client.eye + var/new_impairments = A.get_vision_impairments(src) + if(new_impairments) + impairments |= new_impairments + + for(var/X in impairments) + client.screen += X + +/mob/living/carbon/human/update_health_hud() + if(!client || !hud_used) + return + if(dna.species.update_health_hud()) + return + else + if(hud_used.healths) + var/health_amount = health - staminaloss + if(..(health_amount)) //not dead + switch(hal_screwyhud) + if(1) + hud_used.healths.icon_state = "health6" + if(2) + hud_used.healths.icon_state = "health7" + if(5) + hud_used.healths.icon_state = "health0" + if(hud_used.healthdoll) + hud_used.healthdoll.overlays.Cut() + if(stat != DEAD) + hud_used.healthdoll.icon_state = "healthdoll_OVERLAY" + for(var/obj/item/organ/limb/L in organs) + var/damage = L.burn_dam + L.brute_dam + var/comparison = (L.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 + if(hal_screwyhud == 5) + icon_num = 0 + if(icon_num) + hud_used.healthdoll.overlays += image('icons/mob/screen_gen.dmi',"[L.name][icon_num]") + else + hud_used.healthdoll.icon_state = "healthdoll_DEAD" diff --git a/code/modules/mob/living/carbon/human/human_attackalien.dm b/code/modules/mob/living/carbon/human/human_attackalien.dm index 50616ff5af8..10e19dfd198 100644 --- a/code/modules/mob/living/carbon/human/human_attackalien.dm +++ b/code/modules/mob/living/carbon/human/human_attackalien.dm @@ -13,7 +13,7 @@ visible_message("[M] has lunged at [src]!", \ "[M] has lunged at [src]!") return 0 - var/obj/item/organ/limb/affecting = get_organ(ran_zone(M.zone_sel.selecting)) + var/obj/item/organ/limb/affecting = get_organ(ran_zone(M.zone_selected)) var/armor_block = run_armor_check(affecting, "melee","","",10) playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1) diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 37f501760a5..4f2d4242a40 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -1,8 +1,6 @@ //Updates the mob's health from organs and mob damage variables /mob/living/carbon/human/updatehealth() if(status_flags & GODMODE) - health = maxHealth - stat = CONSCIOUS return var/total_burn = 0 var/total_brute = 0 @@ -10,13 +8,13 @@ total_brute += O.brute_dam total_burn += O.burn_dam health = maxHealth - getOxyLoss() - getToxLoss() - getCloneLoss() - total_burn - total_brute + update_stat() if( ((maxHealth - total_burn) < config.health_threshold_dead) && stat == DEAD ) ChangeToHusk() if(on_fire) shred_clothing() med_hud_set_health() med_hud_set_status() - return //These procs fetch a cumulative total damage from all organs @@ -34,12 +32,16 @@ /mob/living/carbon/human/adjustBruteLoss(amount) + if(status_flags & GODMODE) + return 0 if(amount > 0) take_overall_damage(amount, 0) else heal_overall_damage(-amount, 0) /mob/living/carbon/human/adjustFireLoss(amount) + if(status_flags & GODMODE) + return 0 if(amount > 0) take_overall_damage(0, amount) else @@ -93,12 +95,11 @@ var/obj/item/organ/limb/picked = pick(parts) if(picked.take_damage(brute,burn)) update_damage_overlays(0) - updatehealth() //Heal MANY external organs, in random order -/mob/living/carbon/human/heal_overall_damage(brute, burn) +/mob/living/carbon/human/heal_overall_damage(brute, burn, updating_health=1) var/list/obj/item/organ/limb/parts = get_damaged_organs(brute,burn) var/update = 0 @@ -114,8 +115,10 @@ burn -= (burn_was-picked.burn_dam) parts -= picked - updatehealth() - if(update) update_damage_overlays(0) + if(updating_health) + updatehealth() + if(update) + update_damage_overlays(0) // damage MANY external organs, in random order /mob/living/carbon/human/take_overall_damage(brute, burn) @@ -138,10 +141,9 @@ burn -= (picked.burn_dam - burn_was) parts -= picked - updatehealth() - - if(update) update_damage_overlays(0) + if(update) + update_damage_overlays(0) /mob/living/carbon/human/proc/restore_blood() if(!(NOBLOOD in dna.species.specflags)) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 7c0df56c7b8..d3e8a3733a3 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -95,8 +95,8 @@ /mob/living/carbon/human/attacked_by(obj/item/I, mob/living/user, def_zone) if(!I || !user) return 0 - var/obj/item/organ/limb/target_limb = get_organ(check_zone(user.zone_sel.selecting)) - var/obj/item/organ/limb/affecting = get_organ(ran_zone(user.zone_sel.selecting)) + var/obj/item/organ/limb/target_limb = get_organ(check_zone(user.zone_selected)) + var/obj/item/organ/limb/affecting = get_organ(ran_zone(user.zone_selected)) var/hit_area = parse_zone(affecting.name) var/target_area = parse_zone(target_limb.name) feedback_add_details("item_used_for_combat","[I.type]|[I.force]") @@ -288,7 +288,7 @@ return 0 if(stat != DEAD) L.amount_grown = min(L.amount_grown + damage, L.max_grown) - var/obj/item/organ/limb/affecting = get_organ(ran_zone(L.zone_sel.selecting)) + var/obj/item/organ/limb/affecting = get_organ(ran_zone(L.zone_selected)) var/armor_block = run_armor_check(affecting, "melee") apply_damage(damage, BRUTE, affecting, armor_block) updatehealth() diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 5f64d3bcea6..e3a142f0e8c 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -30,7 +30,7 @@ var/obj/item/shoes = null var/obj/item/belt = null var/obj/item/gloves = null - var/obj/item/glasses = null + var/obj/item/clothing/glasses/glasses = null var/obj/item/ears = null var/obj/item/wear_id = null var/obj/item/r_store = null @@ -52,4 +52,4 @@ var/name_override //For temporary visible name changes - var/heart_attack = 0 \ No newline at end of file + var/heart_attack = 0 diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index ed0add4de62..0424ecedcad 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -96,22 +96,6 @@ if((ears && (ears.flags & EARBANGPROTECT)) || (head && (head.flags & HEADBANGPROTECT))) return 1 -///tintcheck() -///Checks eye covering items for visually impairing tinting, such as welding masks -///Checked in life.dm. 0 & 1 = no impairment, 2 = welding mask overlay, 3 = You can see jack, but you can't see shit. -/mob/living/carbon/human/tintcheck() - var/tinted = 0 - if(istype(src.head, /obj/item/clothing/head)) - var/obj/item/clothing/head/HT = src.head - tinted += HT.tint - if(istype(src.glasses, /obj/item/clothing/glasses)) - var/obj/item/clothing/glasses/GT = src.glasses - tinted += GT.tint - if(istype(src.wear_mask, /obj/item/clothing/mask)) - var/obj/item/clothing/mask/MT = src.wear_mask - tinted += MT.tint - return tinted - /mob/living/carbon/human/abiotic(full_body = 0) if(full_body && ((src.l_hand && !( src.l_hand.flags&ABSTRACT )) || (src.r_hand && !( src.r_hand.flags&ABSTRACT )) || (src.back || src.wear_mask || src.head || src.shoes || src.w_uniform || src.wear_suit || src.glasses || src.ears || src.gloves))) return 1 diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 36978456f8a..03343367442 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -70,6 +70,13 @@ update_inv_ears() if(slot_glasses) glasses = I + var/obj/item/clothing/glasses/G = I + if(G.tint) + update_tinttotal() + if(G.vision_correction) + update_vision_overlays() + if(G.vision_flags || G.darkness_view || G.invis_override || G.invis_view) + update_sight() update_inv_glasses() if(slot_gloves) gloves = I @@ -127,6 +134,13 @@ update_inv_gloves() else if(I == glasses) glasses = null + var/obj/item/clothing/glasses/G = I + if(G.tint) + update_tinttotal() + if(G.vision_correction) + update_vision_overlays() + if(G.vision_flags || G.darkness_view || G.invis_override || G.invis_view) + update_sight() update_inv_glasses() else if(I == ears) ears = null @@ -151,12 +165,11 @@ s_store = null update_inv_s_store() -/mob/living/carbon/human/wear_mask_update(obj/item/I, unequip = 1) - if(I.flags & BLOCKHAIR) +/mob/living/carbon/human/wear_mask_update(obj/item/clothing/C, unequip = 1) + if(C.flags & BLOCKHAIR) update_hair() if(unequip && internal) - if(internals) - internals.icon_state = "internal0" + update_internals_hud_icon(0) internal = null sec_hud_set_security_status() ..() diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 27a76f7eec2..faf39511b2b 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -3,9 +3,6 @@ //NOTE: Breathing happens once per FOUR TICKS, unless the last breath fails. In which case it happens once per ONE TICK! So oxyloss healing is done once per 4 ticks while oxyloss damage is applied once per tick! -#define TINT_IMPAIR 2 //Threshold of tint level to apply weld mask overlay -#define TINT_BLIND 3 //Threshold of tint level to obscure vision fully - #define HEAT_DAMAGE_LEVEL_1 2 //Amount of damage applied when your body temperature just passes the 360.15k safety point #define HEAT_DAMAGE_LEVEL_2 3 //Amount of damage applied when your body temperature passes the 400K point #define HEAT_DAMAGE_LEVEL_3 10 //Amount of damage applied when your body temperature passes the 460K point and you are on fire @@ -23,10 +20,6 @@ #define COLD_GAS_DAMAGE_LEVEL_2 1.5 //Amount of damage applied when the current breath's temperature passes the 200K point #define COLD_GAS_DAMAGE_LEVEL_3 3 //Amount of damage applied when the current breath's temperature passes the 120K point -/mob/living/carbon/human - var/tinttotal = 0 // Total level of visualy impairing items - - /mob/living/carbon/human/Life() set invisibility = 0 @@ -35,8 +28,6 @@ if (notransform) return - tinttotal = tintcheck() //here as both hud updates and status updates call it - if(..()) for(var/datum/mutation/human/HM in dna.mutations) HM.on_life(src) @@ -60,17 +51,23 @@ /mob/living/carbon/human/handle_disabilities() - ..() - //Eyes - if(!(disabilities & BLIND)) - if(tinttotal >= TINT_BLIND) //covering your eyes heals blurry eyes faster - eye_blurry = max(eye_blurry-2, 0) + if(eye_blind) //blindness, heals slowly over time + if(tinttotal >= TINT_BLIND) //covering your eyes heals blurry eyes faster + adjust_blindness(-3) + else + adjust_blindness(-1) + else if(eye_blurry) //blurry eyes heal slowly + adjust_blurriness(-1) //Ears - if(!(disabilities & DEAF)) + if(disabilities & DEAF) //disabled-deaf, doesn't get better on its own + setEarDamage(-1, max(ear_deaf, 1)) + else if(istype(ears, /obj/item/clothing/ears/earmuffs)) // earmuffs rest your ears, healing ear_deaf faster and ear_damage, but keeping you deaf. setEarDamage(max(ear_damage-0.10, 0), max(ear_deaf - 1, 1)) - + // deafness heals slowly over time, unless ear_damage is over 100 + if(ear_damage < 100) + adjustEarDamage(-0.05,-1) if (getBrainLoss() >= 60 && stat != DEAD) if (prob(3)) @@ -262,18 +259,6 @@ reagents.metabolize(src, can_overdose=1) dna.species.handle_chemicals_in_body(src) -/mob/living/carbon/human/handle_vision() - client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask) - if(machine) - if(!machine.check_eye(src)) reset_view(null) - else - if(!remote_view && !client.adminobs) reset_view(null) - - dna.species.handle_vision(src) - -/mob/living/carbon/human/handle_hud_icons() - dna.species.handle_hud_icons(src) - /mob/living/carbon/human/handle_random_events() // Puke if toxloss is too high if(!stat) diff --git a/code/modules/mob/living/carbon/human/login.dm b/code/modules/mob/living/carbon/human/login.dm deleted file mode 100644 index 7877b6f6072..00000000000 --- a/code/modules/mob/living/carbon/human/login.dm +++ /dev/null @@ -1,4 +0,0 @@ -/mob/living/carbon/human/Login() - ..() - update_hud() - return diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 6d5491b5eb3..f4b5c60161a 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1,8 +1,5 @@ // This code handles different species in the game. -#define TINT_IMPAIR 2 -#define TINT_BLIND 3 - #define HUMAN_MAX_OXYLOSS 3 #define HUMAN_CRIT_MAX_OXYLOSS (SSmob.wait/30) @@ -633,7 +630,7 @@ if(prob(round(-H.satiety/40))) H.Jitter(5) hunger_rate = 3 * HUNGER_FACTOR - H.nutrition = max (0, H.nutrition - hunger_rate) + H.nutrition = max(0, H.nutrition - hunger_rate) if (H.nutrition > NUTRITION_LEVEL_FULL) @@ -659,126 +656,6 @@ H << "You no longer feel vigorous." H.metabolism_efficiency = 1 - H.updatehealth() - - return - -/datum/species/proc/handle_vision(mob/living/carbon/human/H) - if( H.stat == DEAD ) - H.sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS) - H.see_in_dark = 8 - if(!H.druggy) H.see_invisible = SEE_INVISIBLE_LEVEL_TWO - else - if(!(SEE_TURFS & H.permanent_sight_flags)) - H.sight &= ~SEE_TURFS - if(!(SEE_MOBS & H.permanent_sight_flags)) - H.sight &= ~SEE_MOBS - if(!(SEE_OBJS & H.permanent_sight_flags)) - H.sight &= ~SEE_OBJS - - if(H.remote_view) - H.sight |= SEE_TURFS - H.sight |= SEE_MOBS - H.sight |= SEE_OBJS - - H.see_in_dark = (H.sight == SEE_TURFS|SEE_MOBS|SEE_OBJS) ? 8 : darksight - var/see_temp = H.see_invisible - H.see_invisible = invis_sight - - if(H.glasses) - if(istype(H.glasses, /obj/item/clothing/glasses)) - var/obj/item/clothing/glasses/G = H.glasses - H.sight |= G.vision_flags - H.see_in_dark = G.darkness_view - if(G.invis_override) - H.see_invisible = G.invis_override - else - H.see_invisible = min(G.invis_view, H.see_invisible) - if(H.druggy) //Override for druggy - H.see_invisible = see_temp - - if(H.see_override) //Override all - H.see_invisible = H.see_override - - // This checks how much the mob's eyewear impairs their vision - if(H.tinttotal >= TINT_IMPAIR) - if(tinted_weldhelh) - if(H.tinttotal >= TINT_BLIND) - H.eye_blind = max(H.eye_blind, 1) - if(H.client) - H.client.screen += global_hud.darkMask - - if(H.blind) - if(H.eye_blind) - H.throw_alert("blind", /obj/screen/alert/blind) - H.blind.layer = 18 - else - H.clear_alert("blind") - H.blind.layer = 0 - - if(!H.client)//no client, no screen to update - return 1 - - if( H.disabilities & NEARSIGHT && !istype(H.glasses, /obj/item/clothing/glasses/regular) ) - H.client.screen += global_hud.vimpaired - if(H.eye_blurry) H.client.screen += global_hud.blurry - if(H.druggy) - H.client.screen += global_hud.druggy - H.throw_alert("high", /obj/screen/alert/high) - else - H.clear_alert("high") - - - if(H.eye_stat > 20) - if(H.eye_stat > 30) H.client.screen += global_hud.darkMask - else H.client.screen += global_hud.vimpaired - - return 1 - -/datum/species/proc/handle_hud_icons(mob/living/carbon/human/H) - if(H.healths) - if(H.stat == DEAD) - H.healths.icon_state = "health7" - else - switch(H.hal_screwyhud) - if(1) H.healths.icon_state = "health6" - if(2) H.healths.icon_state = "health7" - if(5) H.healths.icon_state = "health0" - else - switch(H.health - H.staminaloss) - 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" - - if(H.healthdoll) - H.healthdoll.overlays.Cut() - if(H.stat == DEAD) - H.healthdoll.icon_state = "healthdoll_DEAD" - else - H.healthdoll.icon_state = "healthdoll_OVERLAY" - for(var/obj/item/organ/limb/L in H.organs) - var/damage = L.burn_dam + L.brute_dam - var/comparison = (L.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 - if(H.hal_screwyhud == 5) - icon_num = 0 - if(icon_num) - H.healthdoll.overlays += image('icons/mob/screen_gen.dmi',"[L.name][icon_num]") - switch(H.nutrition) if(NUTRITION_LEVEL_FULL to INFINITY) H.throw_alert("nutrition", /obj/screen/alert/fat) @@ -789,7 +666,43 @@ else H.throw_alert("nutrition", /obj/screen/alert/starving) - return 1 + +/datum/species/proc/update_sight(mob/living/carbon/human/H) + H.sight = initial(H.sight) + H.see_in_dark = darksight + H.see_invisible = invis_sight + + if(H.client.eye != H) + var/atom/A = H.client.eye + if(A.update_remote_sight(H)) //returns 1 if we override all other sight updates. + return + + for(var/obj/item/organ/internal/cyberimp/eyes/E in H.internal_organs) + H.sight |= E.sight_flags + if(E.dark_view) + H.see_in_dark = E.dark_view + if(E.see_invisible) + H.see_invisible = min(H.see_invisible, E.see_invisible) + + if(H.glasses) + var/obj/item/clothing/glasses/G = H.glasses + H.sight |= G.vision_flags + H.see_in_dark = max(G.darkness_view, H.see_in_dark) + if(G.invis_override) + H.see_invisible = G.invis_override + else + H.see_invisible = min(G.invis_view, H.see_invisible) + + for(var/datum/mutation/M in H.dna.mutations) + if(M.name == XRAY) + H.sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS) + H.see_in_dark = max(H.see_in_dark, 8) + + if(H.see_override) //Override all + H.see_invisible = H.see_override + +/datum/species/proc/update_health_hud(mob/living/carbon/human/H) + return 0 /datum/species/proc/handle_mutations_and_radiation(mob/living/carbon/human/H) @@ -936,7 +849,7 @@ return 0 - var/obj/item/organ/limb/affecting = H.get_organ(ran_zone(M.zone_sel.selecting)) + var/obj/item/organ/limb/affecting = H.get_organ(ran_zone(M.zone_selected)) var/armor_block = H.run_armor_check(affecting, "melee") playsound(H.loc, M.dna.species.attack_sound, 25, 1, -1) @@ -962,7 +875,7 @@ if(H.w_uniform) H.w_uniform.add_fingerprint(M) - var/obj/item/organ/limb/affecting = H.get_organ(ran_zone(M.zone_sel.selecting)) + var/obj/item/organ/limb/affecting = H.get_organ(ran_zone(M.zone_selected)) var/randn = rand(1, 100) if(randn <= 25) playsound(H, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) @@ -1192,7 +1105,8 @@ H.throw_alert("oxy", /obj/screen/alert/oxy) else H.failed_last_breath = 0 - H.adjustOxyLoss(-5) + if(H.getOxyLoss()) + H.adjustOxyLoss(-5) gas_breathed = breath.oxygen/6 H.clear_alert("oxy") @@ -1277,7 +1191,7 @@ if(SA_pp > SA_para_min) // Enough to make us paralysed for a bit H.Paralyse(3) // 3 gives them one second to wake up and run away a bit! if(SA_pp > SA_sleep_min) // Enough to make us sleep as well - H.sleeping = max(H.sleeping+2, 10) + H.Sleeping(max(H.sleeping+2, 10)) else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning if(prob(20)) H.emote(pick("giggle", "laugh")) @@ -1444,5 +1358,3 @@ #undef COLD_GAS_DAMAGE_LEVEL_2 #undef COLD_GAS_DAMAGE_LEVEL_3 -#undef TINT_IMPAIR -#undef TINT_BLIND diff --git a/code/modules/mob/living/carbon/human/species_types.dm b/code/modules/mob/living/carbon/human/species_types.dm index 177a21f0589..7dd2f1b6b1d 100644 --- a/code/modules/mob/living/carbon/human/species_types.dm +++ b/code/modules/mob/living/carbon/human/species_types.dm @@ -238,7 +238,6 @@ datum/species/human/spec_death(gibbed, mob/living/carbon/human/H) id = "slime" default_color = "00FFFF" darksight = 3 - invis_sight = SEE_INVISIBLE_LEVEL_ONE specflags = list(MUTCOLORS,EYECOLOR,HAIR,FACEHAIR,NOBLOOD) say_mod = "says" eyes = "eyes" @@ -448,7 +447,6 @@ datum/species/human/spec_death(gibbed, mob/living/carbon/human/H) darksight = 3 say_mod = "gibbers" sexes = 0 - invis_sight = SEE_INVISIBLE_LEVEL_ONE specflags = list(NOBLOOD,NOBREATH,VIRUSIMMUNE) var/scientist = 0 // vars to not pollute spieces list with castes var/agent = 0 diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index f5b8eb3a86a..c7434866afa 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -153,8 +153,6 @@ Please contact me on #coderbus IRC. ~Carnie x update_inv_wear_suit() update_inv_pockets() update_transform() - //Hud Stuff - update_hud() // Mutantrace colors update_mutcolor() //mutations @@ -203,8 +201,8 @@ Please contact me on #coderbus IRC. ~Carnie x /mob/living/carbon/human/update_inv_wear_id() remove_overlay(ID_LAYER) if(wear_id) - wear_id.screen_loc = ui_id //TODO - if(client && hud_used) + if(client && hud_used && hud_used.hud_shown) + wear_id.screen_loc = ui_id client.screen += wear_id //TODO: add an icon file for ID slot stuff, so it's less snowflakey @@ -288,8 +286,8 @@ Please contact me on #coderbus IRC. ~Carnie x remove_overlay(SUIT_STORE_LAYER) if(s_store) - s_store.screen_loc = ui_sstore1 //TODO - if(client && hud_used) + if(client && hud_used && hud_used.hud_shown) + s_store.screen_loc = ui_sstore1 client.screen += s_store var/t_state = s_store.item_state @@ -301,25 +299,17 @@ Please contact me on #coderbus IRC. ~Carnie x /mob/living/carbon/human/update_inv_head() - var/obj/item/H = ..() - if(H) - if(client && hud_used && hud_used.hud_shown) - if(hud_used.inventory_shown) //if the inventory is open ... - H.screen_loc = ui_head //TODO //...draw the item in the inventory screen - client.screen += H //Either way, add the item to the HUD - + ..() update_mutant_bodyparts() - apply_overlay(HEAD_LAYER) /mob/living/carbon/human/update_inv_belt() remove_overlay(BELT_LAYER) if(belt) - belt.screen_loc = ui_belt - if(client && hud_used) + if(client && hud_used && hud_used.hud_shown) client.screen += belt - + belt.screen_loc = ui_belt var/t_state = belt.item_state if(!t_state) t_state = belt.icon_state @@ -349,44 +339,31 @@ Please contact me on #coderbus IRC. ~Carnie x drop_l_hand() drop_r_hand() - src.update_hair() - src.update_mutant_bodyparts() + update_hair() + update_mutant_bodyparts() apply_overlay(SUIT_LAYER) /mob/living/carbon/human/update_inv_pockets() if(l_store) - l_store.screen_loc = ui_storage1 //TODO - if(client && hud_used) + if(client && hud_used && hud_used.hud_shown) client.screen += l_store + l_store.screen_loc = ui_storage1 if(r_store) - r_store.screen_loc = ui_storage2 //TODO - if(client && hud_used) + if(client && hud_used && hud_used.hud_shown) client.screen += r_store + r_store.screen_loc = ui_storage2 + /mob/living/carbon/human/update_inv_wear_mask() - var/obj/item/clothing/mask/M = ..() - if(M) - if(client && hud_used && hud_used.hud_shown) - if(hud_used.inventory_shown) //if the inventory is open ... - M.screen_loc = ui_mask //TODO //...draw the item in the inventory screen - client.screen += M //Either way, add the item to the HUD + ..() update_mutant_bodyparts() - apply_overlay(FACEMASK_LAYER) - - -/mob/living/carbon/human/update_inv_back() - var/obj/item/B = ..() - if(B) - B.screen_loc = ui_back - if(client && hud_used && hud_used.hud_shown) - client.screen += B - apply_overlay(BACK_LAYER) /mob/living/carbon/human/update_inv_handcuffed() - if(..()) + remove_overlay(HANDCUFF_LAYER) + if(handcuffed) overlays_standing[HANDCUFF_LAYER] = image("icon"='icons/mob/mob.dmi', "icon_state"="handcuff1", "layer"=-HANDCUFF_LAYER) apply_overlay(HANDCUFF_LAYER) @@ -398,13 +375,6 @@ Please contact me on #coderbus IRC. ~Carnie x apply_overlay(LEGCUFF_LAYER) throw_alert("legcuffed", /obj/screen/alert/restrained/legcuffed, new_master = src.legcuffed) - -/mob/living/carbon/human/update_hud() //TODO: do away with this if possible - if(..()) - if(hud_used) - hud_used.hidden_inventory_update() //Updates the screenloc of the items on the 'other' inventory bar - - /proc/wear_female_version(t_color, icon, layer, type) var/index = t_color var/icon/female_clothing_icon = female_clothing_icons[index] @@ -423,6 +393,27 @@ Please contact me on #coderbus IRC. ~Carnie x return out +//human HUD updates for items in our inventory + +//update whether our head item appears on our hud. +/mob/living/carbon/human/update_hud_head(obj/item/I) + if(client && hud_used && hud_used.hud_shown) + if(hud_used.inventory_shown) + I.screen_loc = ui_head + client.screen += I + +//update whether our mask item appears on our hud. +/mob/living/carbon/human/update_hud_wear_mask(obj/item/I) + if(client && hud_used && hud_used.hud_shown) + if(hud_used.inventory_shown) + I.screen_loc = ui_mask + client.screen += I + +//update whether our back item appears on our hud. +/mob/living/carbon/human/update_hud_back(obj/item/I) + if(client && hud_used && hud_used.hud_shown) + I.screen_loc = ui_back + client.screen += I /* diff --git a/code/modules/mob/living/carbon/inventory.dm b/code/modules/mob/living/carbon/inventory.dm index d8294eaa567..e39f6daa0bb 100644 --- a/code/modules/mob/living/carbon/inventory.dm +++ b/code/modules/mob/living/carbon/inventory.dm @@ -46,7 +46,7 @@ head_update(I) if(slot_handcuffed) handcuffed = I - update_inv_handcuffed() + update_handcuffed() if(slot_legcuffed) legcuffed = I update_inv_legcuffed() @@ -82,17 +82,23 @@ handcuffed = null if(buckled && buckled.buckle_requires_restraints) buckled.unbuckle_mob() - update_inv_handcuffed() + update_handcuffed() else if(I == legcuffed) legcuffed = null update_inv_legcuffed() //handle stuff to update when a mob equips/unequips a mask. -/mob/living/carbon/proc/wear_mask_update(obj/item/I, unequip = 1) +/mob/living/carbon/proc/wear_mask_update(obj/item/clothing/C, unequip = 1) + if(C.tint) + update_tinttotal() update_inv_wear_mask() //handle stuff to update when a mob equips/unequips a headgear. /mob/living/carbon/proc/head_update(obj/item/I, forced) + if(istype(I, /obj/item/clothing)) + var/obj/item/clothing/C = I + if(C.tint || initial(C.tint)) + update_tinttotal() if(I.flags_inv & HIDEMASK || forced) update_inv_wear_mask() update_inv_head() diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index b1797c1a63d..b769c332e75 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -7,11 +7,24 @@ if(!loc) return + if(damageoverlaytemp) + damageoverlaytemp = 0 + update_damage_hud() + if(..()) . = 1 + for(var/obj/item/organ/internal/O in internal_organs) O.on_life() + //grab processing + if(istype(l_hand, /obj/item/weapon/grab)) + var/obj/item/weapon/grab/G = l_hand + G.process() + if(istype(r_hand, /obj/item/weapon/grab)) + var/obj/item/weapon/grab/G = r_hand + G.process() + //Updates the number of stored chemicals for powers handle_changeling() @@ -94,7 +107,6 @@ adjustOxyLoss(1) failed_last_breath = 1 throw_alert("oxy", /obj/screen/alert/oxy) - return 0 var/safe_oxy_min = 16 @@ -126,7 +138,8 @@ else //Enough oxygen failed_last_breath = 0 - adjustOxyLoss(-5) + if(getOxyLoss()) + adjustOxyLoss(-5) oxygen_used = breath.oxygen/6 clear_alert("oxy") @@ -164,7 +177,7 @@ if(SA_partialpressure > SA_para_min) Paralyse(3) if(SA_partialpressure > SA_sleep_min) - sleeping = max(sleeping+2, 10) + Sleeping(max(sleeping+2, 10)) else if(SA_partialpressure > 0.01) if(prob(20)) emote(pick("giggle","laugh")) @@ -185,12 +198,10 @@ if (!wear_mask || !(wear_mask.flags & MASKINTERNALS) ) internal = null if(internal) - if (internals) - internals.icon_state = "internal1" + update_internals_hud_icon(1) return internal.remove_air_volume(volume_needed) else - if (internals) - internals.icon_state = "internal0" + update_internals_hud_icon(0) return @@ -237,24 +248,19 @@ switch(radiation) if(0 to 50) - radiation-- + radiation = max(radiation-1,0) if(prob(25)) adjustToxLoss(1) - updatehealth() if(50 to 75) - radiation -= 2 + radiation = max(radiation-2,0) adjustToxLoss(1) if(prob(5)) - radiation -= 5 - updatehealth() + radiation = max(radiation-5,0) if(75 to 100) - radiation -= 3 + radiation = max(radiation-3,0) adjustToxLoss(3) - updatehealth() - - radiation = Clamp(radiation, 0, 100) /mob/living/carbon/handle_chemicals_in_body() @@ -268,8 +274,8 @@ if(M.loc != src) stomach_contents.Remove(M) continue - if(istype(M, /mob/living/carbon) && stat != 2) - if(M.stat == 2) + if(istype(M, /mob/living/carbon) && stat != DEAD) + if(M.stat == DEAD) M.death(1) stomach_contents.Remove(M) qdel(M) @@ -279,50 +285,21 @@ M.adjustBruteLoss(5) nutrition += 10 -//This updates the health and status of the mob (conscious, unconscious, dead) -/mob/living/carbon/handle_regular_status_updates() - - if(..()) //alive - - if(health <= config.health_threshold_dead || !getorgan(/obj/item/organ/internal/brain)) - death() - return - - if(getOxyLoss() > 50 || health <= config.health_threshold_crit) - Paralyse(3) - stat = UNCONSCIOUS - - if(sleeping) - stat = UNCONSCIOUS - - return 1 - -/mob/living/carbon/proc/CheckStamina() - if(staminaloss) - var/total_health = (health - staminaloss) - if(total_health <= config.health_threshold_crit && !stat) - src << "You're too exhausted to keep going..." - Weaken(5) - setStaminaLoss(health - 2) - return - setStaminaLoss(max((staminaloss - 2), 0)) - //this updates all special effects: stunned, sleeping, weakened, druggy, stuttering, etc.. /mob/living/carbon/handle_status_effects() ..() - CheckStamina() + if(staminaloss) + if(sleeping) + adjustStaminaLoss(-10) + else + adjustStaminaLoss(-2) if(sleeping) - throw_alert("asleep", /obj/screen/alert/asleep) handle_dreams() - adjustStaminaLoss(-10) - sleeping = max(sleeping-1, 0) - if( prob(10) && health && !hal_crit ) + AdjustSleeping(-1) + if(prob(10) && health>config.health_threshold_crit) emote("snore") - else - clear_alert("asleep") - var/restingpwr = 1 + 4 * resting @@ -362,9 +339,9 @@ if(drowsyness) drowsyness = max(drowsyness - restingpwr, 0) - eye_blurry = max(2, eye_blurry) + set_blurriness(max(2, eye_blurry)) if(prob(5)) - sleeping += 1 + AdjustSleeping(1) Paralyse(5) if(confused) @@ -385,148 +362,11 @@ silent = max(silent-1, 0) if(druggy) - druggy = max(druggy-1, 0) + adjust_drugginess(-1) if(hallucination) spawn handle_hallucinations() - - if(hallucination<=2) - hallucination = 0 - else - hallucination -= 2 - -//this handles hud updates. Calls update_vision() and handle_hud_icons() -/mob/living/carbon/handle_regular_hud_updates() - if(!client) return 0 - - if(damageoverlay) - if(damageoverlay.overlays) - damageoverlay.overlays = list() - - if(stat == UNCONSCIOUS) - //Critical damage passage overlay - if(health <= config.health_threshold_crit) - var/image/I = image("icon" = 'icons/mob/screen_full.dmi', "icon_state" = "passage0") - I.blend_mode = BLEND_OVERLAY //damageoverlay is BLEND_MULTIPLY - switch(health) - if(-20 to -10) - I.icon_state = "passage1" - if(-30 to -20) - I.icon_state = "passage2" - if(-40 to -30) - I.icon_state = "passage3" - if(-50 to -40) - I.icon_state = "passage4" - if(-60 to -50) - I.icon_state = "passage5" - if(-70 to -60) - I.icon_state = "passage6" - if(-80 to -70) - I.icon_state = "passage7" - if(-90 to -80) - I.icon_state = "passage8" - if(-95 to -90) - I.icon_state = "passage9" - if(-INFINITY to -95) - I.icon_state = "passage10" - damageoverlay.overlays += I - else - //Oxygen damage overlay - if(oxyloss) - var/image/I = image("icon" = 'icons/mob/screen_full.dmi', "icon_state" = "oxydamageoverlay0") - switch(oxyloss) - if(10 to 20) - I.icon_state = "oxydamageoverlay1" - if(20 to 25) - I.icon_state = "oxydamageoverlay2" - if(25 to 30) - I.icon_state = "oxydamageoverlay3" - if(30 to 35) - I.icon_state = "oxydamageoverlay4" - if(35 to 40) - I.icon_state = "oxydamageoverlay5" - if(40 to 45) - I.icon_state = "oxydamageoverlay6" - if(45 to INFINITY) - I.icon_state = "oxydamageoverlay7" - damageoverlay.overlays += I - - //Fire and Brute damage overlay (BSSR) - var/hurtdamage = src.getBruteLoss() + src.getFireLoss() + damageoverlaytemp - damageoverlaytemp = 0 // We do this so we can detect if someone hits us or not. - if(hurtdamage) - var/image/I = image("icon" = 'icons/mob/screen_full.dmi', "icon_state" = "brutedamageoverlay0") - I.blend_mode = BLEND_ADD - switch(hurtdamage) - if(5 to 15) - I.icon_state = "brutedamageoverlay1" - if(15 to 30) - I.icon_state = "brutedamageoverlay2" - if(30 to 45) - I.icon_state = "brutedamageoverlay3" - if(45 to 70) - I.icon_state = "brutedamageoverlay4" - if(70 to 85) - I.icon_state = "brutedamageoverlay5" - if(85 to INFINITY) - I.icon_state = "brutedamageoverlay6" - var/image/black = image(I.icon, I.icon_state) //BLEND_ADD doesn't let us darken, so this is just to blacken the edge of the screen - black.color = "#170000" - damageoverlay.overlays += I - damageoverlay.overlays += black - - ..() - - return 1 - -/mob/living/carbon/update_sight() - if(stat == DEAD) - sight |= SEE_TURFS - sight |= SEE_MOBS - sight |= SEE_OBJS - see_in_dark = 8 - see_invisible = SEE_INVISIBLE_LEVEL_TWO - else - if(!(SEE_TURFS & permanent_sight_flags)) - sight &= ~SEE_TURFS - if(!(SEE_MOBS & permanent_sight_flags)) - sight &= ~SEE_MOBS - if(!(SEE_OBJS & permanent_sight_flags)) - sight &= ~SEE_OBJS - if(remote_view) - sight |= SEE_TURFS - sight |= SEE_MOBS - sight |= SEE_OBJS - see_in_dark = (sight == SEE_TURFS|SEE_MOBS|SEE_OBJS) ? 8 : 2 //Xray flag combo - see_invisible = SEE_INVISIBLE_LIVING - if(see_override) - see_invisible = see_override - - -/mob/living/carbon/handle_hud_icons() - return - -/mob/living/carbon/handle_hud_icons_health() - 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" - else - healths.icon_state = "health7" - + hallucination = max(hallucination-2,0) //used in human and monkey handle_environment() /mob/living/carbon/proc/natural_bodytemperature_stabilization() diff --git a/code/modules/mob/living/carbon/monkey/death.dm b/code/modules/mob/living/carbon/monkey/death.dm index 7e90fb4d386..7884e7064b5 100644 --- a/code/modules/mob/living/carbon/monkey/death.dm +++ b/code/modules/mob/living/carbon/monkey/death.dm @@ -8,16 +8,14 @@ ..() /mob/living/carbon/monkey/death(gibbed) - if(stat == DEAD) return - if(healths) healths.icon_state = "health5" + if(stat == DEAD) + return + stat = DEAD if(!gibbed) visible_message("[src] lets out a faint chimper as it collapses and stops moving...") //ded -- Urist - update_canmove() - if(blind) blind.layer = 0 - if(ticker && ticker.mode) ticker.mode.check_win() diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index 43ab7159124..cdc9b8350c5 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -130,13 +130,6 @@ return - -/mob/living/carbon/monkey/handle_hud_icons() - - handle_hud_icons_health() - - return 1 - /mob/living/carbon/monkey/handle_random_events() if (prob(1) && prob(2)) emote("scratch") diff --git a/code/modules/mob/living/carbon/monkey/login.dm b/code/modules/mob/living/carbon/monkey/login.dm deleted file mode 100644 index 3b7e5dcb971..00000000000 --- a/code/modules/mob/living/carbon/monkey/login.dm +++ /dev/null @@ -1,4 +0,0 @@ -/mob/living/carbon/monkey/Login() - ..() - update_hud() - return diff --git a/code/modules/mob/living/carbon/monkey/update_icons.dm b/code/modules/mob/living/carbon/monkey/update_icons.dm index 03e2f721a9c..a018f4f2f81 100644 --- a/code/modules/mob/living/carbon/monkey/update_icons.dm +++ b/code/modules/mob/living/carbon/monkey/update_icons.dm @@ -6,47 +6,21 @@ update_inv_back() update_icons() update_transform() - //Hud Stuff - update_hud() /mob/living/carbon/monkey/update_icons() - update_hud() overlays.Cut() icon_state = "monkey1" for(var/image/I in overlays_standing) overlays += I //////// -/mob/living/carbon/monkey/update_inv_wear_mask() - var/obj/item/clothing/mask/M = ..() - if(M) - M.screen_loc = ui_monkey_mask - if(client && hud_used) - client.screen += M - apply_overlay(FACEMASK_LAYER) - - -/mob/living/carbon/monkey/update_inv_head() - var/obj/item/H = ..() - if(H) - H.screen_loc = ui_monkey_head - if(client && hud_used) - client.screen += H - apply_overlay(HEAD_LAYER) - -/mob/living/carbon/monkey/update_inv_back() - var/obj/item/B = ..() - if(B) - B.screen_loc = ui_monkey_back - if(client && hud_used) - client.screen += B - apply_overlay(BACK_LAYER) /mob/living/carbon/monkey/update_fire() ..("Monkey_burning") /mob/living/carbon/monkey/update_inv_handcuffed() - if(..()) + remove_overlay(HANDCUFF_LAYER) + if(handcuffed) overlays_standing[HANDCUFF_LAYER] = image("icon"='icons/mob/mob.dmi', "icon_state"="handcuff1", "layer"=-HANDCUFF_LAYER) apply_overlay(HANDCUFF_LAYER) @@ -56,4 +30,25 @@ var/image/standing = image("icon"='icons/mob/mob.dmi', "icon_state"="legcuff1", "layer"=-LEGCUFF_LAYER) standing.pixel_y = 8 overlays_standing[LEGCUFF_LAYER] = standing - apply_overlay(LEGCUFF_LAYER) \ No newline at end of file + apply_overlay(LEGCUFF_LAYER) + + +//monkey HUD updates for items in our inventory + +//update whether our head item appears on our hud. +/mob/living/carbon/monkey/update_hud_head(obj/item/I) + if(client && hud_used && hud_used.hud_shown) + I.screen_loc = ui_monkey_head + client.screen += I + +//update whether our mask item appears on our hud. +/mob/living/carbon/monkey/update_hud_wear_mask(obj/item/I) + if(client && hud_used && hud_used.hud_shown) + I.screen_loc = ui_monkey_mask + client.screen += I + +//update whether our back item appears on our hud. +/mob/living/carbon/monkey/update_hud_back(obj/item/I) + if(client && hud_used && hud_used.hud_shown) + I.screen_loc = ui_monkey_back + client.screen += I \ No newline at end of file diff --git a/code/modules/mob/living/carbon/update_icons.dm b/code/modules/mob/living/carbon/update_icons.dm index 595609f1ccb..a684a9ee7c1 100644 --- a/code/modules/mob/living/carbon/update_icons.dm +++ b/code/modules/mob/living/carbon/update_icons.dm @@ -46,8 +46,8 @@ drop_r_hand() return if(r_hand) - r_hand.screen_loc = ui_rhand - if(client && hud_used) + if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD) + r_hand.screen_loc = ui_rhand client.screen += r_hand var/t_state = r_hand.item_state @@ -61,12 +61,12 @@ /mob/living/carbon/update_inv_l_hand() remove_overlay(L_HAND_LAYER) - if (handcuffed) + if(handcuffed) drop_l_hand() return if(l_hand) - l_hand.screen_loc = ui_lhand - if(client && hud_used) + if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD) + l_hand.screen_loc = ui_lhand client.screen += l_hand var/t_state = l_hand.item_state @@ -85,11 +85,6 @@ apply_overlay(FIRE_LAYER) -/mob/living/carbon/update_hud() - if(client) - client.screen |= contents - return 1 - /mob/living/carbon/regenerate_icons() if(notransform) return 1 @@ -101,54 +96,60 @@ /mob/living/carbon/update_inv_wear_mask() remove_overlay(FACEMASK_LAYER) - if(istype(wear_mask, /obj/item/clothing/mask)) - if(!(head && (head.flags_inv & HIDEMASK))) - var/image/standing = wear_mask.build_worn_icon(state = wear_mask.icon_state, default_layer = FACEMASK_LAYER, default_icon_file = 'icons/mob/mask.dmi') - overlays_standing[FACEMASK_LAYER] = standing - return wear_mask + overlays_standing[FACEMASK_LAYER] = standing + update_hud_wear_mask(wear_mask) + apply_overlay(FACEMASK_LAYER) /mob/living/carbon/update_inv_back() remove_overlay(BACK_LAYER) if(back) - var/image/standing = back.build_worn_icon(state = back.icon_state, default_layer = BACK_LAYER, default_icon_file = 'icons/mob/back.dmi') overlays_standing[BACK_LAYER] = standing - return back - + update_hud_back(back) + apply_overlay(BACK_LAYER) /mob/living/carbon/update_inv_head() remove_overlay(HEAD_LAYER) if(head) - var/image/standing = head.build_worn_icon(state = head.icon_state, default_layer = HEAD_LAYER, default_icon_file = 'icons/mob/head.dmi') overlays_standing[HEAD_LAYER] = standing - return head + update_hud_head(head) + apply_overlay(HEAD_LAYER) /mob/living/carbon/update_inv_handcuffed() - remove_overlay(HANDCUFF_LAYER) - clear_alert("handcuffed") - if(handcuffed) - drop_r_hand() - drop_l_hand() - stop_pulling() //TODO: should be handled elsewhere - throw_alert("handcuffed", /obj/screen/alert/restrained/handcuffed, new_master = src.handcuffed) - if(hud_used) //hud handcuff icons - var/obj/screen/inventory/R = hud_used.r_hand_hud_object - var/obj/screen/inventory/L = hud_used.l_hand_hud_object - R.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="markus") - L.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="gabrielle") - return 1 - else - if(hud_used) - var/obj/screen/inventory/R = hud_used.r_hand_hud_object - var/obj/screen/inventory/L = hud_used.l_hand_hud_object - R.overlays = null - L.overlays = null + return +//mob HUD updates for items in our inventory + +//update whether handcuffs appears on our hud. +/mob/living/carbon/proc/update_hud_handcuffed() + if(hud_used) + var/obj/screen/inventory/R = hud_used.r_hand_hud_object + var/obj/screen/inventory/L = hud_used.l_hand_hud_object + if(R && L) + if(handcuffed) //hud handcuff icons + R.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="markus") + L.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="gabrielle") + else + R.overlays = null + L.overlays = null + +//update whether our head item appears on our hud. +/mob/living/carbon/proc/update_hud_head(obj/item/I) + return + +//update whether our mask item appears on our hud. +/mob/living/carbon/proc/update_hud_wear_mask(obj/item/I) + return + +//update whether our back item appears on our hud. +/mob/living/carbon/proc/update_hud_back(obj/item/I) + return + //Overlays for the worn overlay so you can overlay while you overlay //eg: ammo counters, primed grenade flashing, etc. diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index 2afbf5c033b..0d47a59c86f 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -58,7 +58,7 @@ if(status_flags & CANSTUN) // stun is usually associated with stutter stuttering = max(stuttering,(effect * blocked)) if(EYE_BLUR) - eye_blurry = max(eye_blurry,(effect * blocked)) + set_blurriness(max(eye_blurry,(effect * blocked))) if(DROWSY) drowsyness = max(drowsyness,(effect * blocked)) if(JITTER) diff --git a/code/modules/mob/living/death.dm b/code/modules/mob/living/death.dm index 3d34f72f240..c90df5cf2f3 100644 --- a/code/modules/mob/living/death.dm +++ b/code/modules/mob/living/death.dm @@ -35,15 +35,32 @@ flick(flick_name, animate) /mob/living/death(gibbed) - eye_blind = max(eye_blind, 1) + unset_machine() + reset_perspective(null) + if(client) + if(damageoverlay) + damageoverlay.overlays.Cut() timeofdeath = world.time - + tod = worldtime2text() + if(mind) + mind.store_memory("Time of death: [tod]", 0) living_mob_list -= src if(!gibbed) dead_mob_list += src else if(buckled) buckled.unbuckle_mob() + paralysis = 0 + stunned = 0 + weakened = 0 + sleeping = 0 + update_sight() + update_vision_overlays() + update_damage_hud() + update_health_hud() + + update_canmove() + /mob/living/proc/setup_animation(animation, prev_lying) var/atom/movable/overlay/animate = null diff --git a/code/modules/mob/living/emote.dm b/code/modules/mob/living/emote.dm index 094ed866db3..70fdee24d9c 100644 --- a/code/modules/mob/living/emote.dm +++ b/code/modules/mob/living/emote.dm @@ -75,9 +75,9 @@ if ("faint","faints") message = "[src] faints." - if(src.sleeping) + if(sleeping) return //Can't faint while asleep - src.sleeping += 10 //Short-short nap + SetSleeping(10) //Short-short nap m_type = 1 if ("flap","flaps") @@ -86,7 +86,7 @@ m_type = 2 if ("flip","flips") - if (!src.restrained() || !src.resting || !src.sleeping) + if (!restrained() || !resting || !sleeping) src.SpinAnimation(7,1) m_type = 2 diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index af5c3b5e4bb..016e0658951 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -41,21 +41,17 @@ update_gravity(mob_has_gravity()) - update_pulling() + if(machine) + machine.check_eye(src) - for(var/obj/item/weapon/grab/G in src) - G.process() - if(handle_regular_status_updates()) // Status & health update, are we dead or alive etc. + if(stat != DEAD) handle_disabilities() // eye, ear, brain damages handle_status_effects() //all special effects, stunned, weakened, jitteryness, hallucination, sleeping, etc handle_actions() - update_canmove() - - if(client) - handle_regular_hud_updates() + handle_regular_hud_updates() @@ -89,51 +85,29 @@ /mob/living/proc/handle_stomach() 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() - - updatehealth() - - if(stat != DEAD) - - if(paralysis) - stat = UNCONSCIOUS - - else if (status_flags & FAKEDEATH) - stat = UNCONSCIOUS - - else - stat = CONSCIOUS - - return 1 - //this updates all special effects: stunned, sleeping, weakened, druggy, stuttering, etc.. /mob/living/proc/handle_status_effects() if(paralysis) - paralysis = max(paralysis-1,0) + AdjustParalysis(-1) if(stunned) - stunned = max(stunned-1,0) - if(!stunned) - update_icons() - + AdjustStunned(-1) if(weakened) - weakened = max(weakened-1,0) - if(!weakened) - update_icons() + AdjustWeakened(-1) /mob/living/proc/handle_disabilities() //Eyes - if(disabilities & BLIND || stat) //blindness from disability or unconsciousness doesn't get better on its own - eye_blind = max(eye_blind, 1) - else if(eye_blind) //blindness, heals slowly over time - eye_blind = max(eye_blind-1,0) + if(eye_blind) //blindness, heals slowly over time + if(!stat && !(disabilities & BLIND)) + eye_blind = max(eye_blind-1,0) + if(client && !eye_blind) + clear_alert("blind") + update_vision_overlays() + else + eye_blind = max(eye_blind-1,1) else if(eye_blurry) //blurry eyes heal slowly eye_blurry = max(eye_blurry-1, 0) + if(client && !eye_blurry) + update_vision_overlays() //Ears if(disabilities & DEAF) //disabled-deaf, doesn't get better on its own @@ -167,69 +141,18 @@ if(recursive) for(var/obj/item/T in I) - give_action_button(I, recursive - 1) + give_action_button(T, recursive - 1) -//this handles hud updates. Calls update_vision() and handle_hud_icons() +/mob/living/proc/update_damage_hud() + return + +//this handles hud updates. /mob/living/proc/handle_regular_hud_updates() if(!client) return 0 - - handle_vision() - handle_hud_icons() update_action_buttons() - return 1 -/mob/living/proc/handle_vision() - - client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask) - - update_sight() - - if(stat != DEAD) - if(blind) - if(eye_blind) - blind.layer = 18 - throw_alert("blind", /obj/screen/alert/blind) - else - blind.layer = 0 - clear_alert("blind") - - if (disabilities & NEARSIGHT) - client.screen += global_hud.vimpaired - - if (eye_blurry) - client.screen += global_hud.blurry - - if (druggy) - client.screen += global_hud.druggy - throw_alert("high", /obj/screen/alert/high) - else - clear_alert("high") - - if(eye_stat > 20) - if(eye_stat > 30) - client.screen += global_hud.darkMask - else - client.screen += global_hud.vimpaired - - if(machine) - if (!( machine.check_eye(src) )) - reset_view(null) - else - if(!remote_view && !client.adminobs) - reset_view(null) - -/mob/living/proc/update_sight() - return - -/mob/living/proc/handle_hud_icons() - handle_hud_icons_health() - return - -/mob/living/proc/handle_hud_icons_health() - return - /mob/living/update_action_buttons() if(!hud_used) return if(!client) return diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index c46d0f1cfde..761040e9cdf 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -196,10 +196,9 @@ Sorry Giacom. Please don't be mad :( /mob/living/proc/updatehealth() if(status_flags & GODMODE) - health = maxHealth - stat = CONSCIOUS return health = maxHealth - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() - getCloneLoss() + update_stat() //This proc is used for mobs which are affected by pressure to calculate the amount of pressure that actually @@ -233,81 +232,113 @@ Sorry Giacom. Please don't be mad :( /mob/living/proc/getBruteLoss() return bruteloss -/mob/living/proc/adjustBruteLoss(amount) - if(status_flags & GODMODE) return 0 +/mob/living/proc/adjustBruteLoss(amount, updating_health=1) + if(status_flags & GODMODE) + return 0 bruteloss = min(max(bruteloss + amount, 0),(maxHealth*2)) - handle_regular_status_updates() //we update our health right away. + if(updating_health) + updatehealth() /mob/living/proc/getOxyLoss() return oxyloss -/mob/living/proc/adjustOxyLoss(amount) - if(status_flags & GODMODE) return 0 +/mob/living/proc/adjustOxyLoss(amount, updating_health=1) + if(status_flags & GODMODE) + return 0 oxyloss = min(max(oxyloss + amount, 0),(maxHealth*2)) - handle_regular_status_updates() + if(updating_health) + updatehealth() -/mob/living/proc/setOxyLoss(amount) - if(status_flags & GODMODE) return 0 +/mob/living/proc/setOxyLoss(amount, updating_health=1) + if(status_flags & GODMODE) + return 0 oxyloss = amount - handle_regular_status_updates() + if(updating_health) + updatehealth() /mob/living/proc/getToxLoss() return toxloss -/mob/living/proc/adjustToxLoss(amount) - if(status_flags & GODMODE) return 0 +/mob/living/proc/adjustToxLoss(amount, updating_health=1) + if(status_flags & GODMODE) + return 0 toxloss = min(max(toxloss + amount, 0),(maxHealth*2)) - handle_regular_status_updates() + if(updating_health) + updatehealth() -/mob/living/proc/setToxLoss(amount) - if(status_flags & GODMODE) return 0 +/mob/living/proc/setToxLoss(amount, updating_health=1) + if(status_flags & GODMODE) + return 0 toxloss = amount - handle_regular_status_updates() + if(updating_health) + updatehealth() /mob/living/proc/getFireLoss() return fireloss -/mob/living/proc/adjustFireLoss(amount) - if(status_flags & GODMODE) return 0 +/mob/living/proc/adjustFireLoss(amount, updating_health=1) + if(status_flags & GODMODE) + return 0 fireloss = min(max(fireloss + amount, 0),(maxHealth*2)) - handle_regular_status_updates() //we update our health right away. + if(updating_health) + updatehealth() /mob/living/proc/getCloneLoss() return cloneloss -/mob/living/proc/adjustCloneLoss(amount) - if(status_flags & GODMODE) return 0 +/mob/living/proc/adjustCloneLoss(amount, updating_health=1) + if(status_flags & GODMODE) + return 0 cloneloss = min(max(cloneloss + amount, 0),(maxHealth*2)) - handle_regular_status_updates() + if(updating_health) + updatehealth() -/mob/living/proc/setCloneLoss(amount) - if(status_flags & GODMODE) return 0 +/mob/living/proc/setCloneLoss(amount, updating_health=1) + if(status_flags & GODMODE) + return 0 cloneloss = amount - handle_regular_status_updates() + if(updating_health) + updatehealth() /mob/living/proc/getBrainLoss() return brainloss /mob/living/proc/adjustBrainLoss(amount) - if(status_flags & GODMODE) return 0 + if(status_flags & GODMODE) + return 0 brainloss = min(max(brainloss + amount, 0),(maxHealth*2)) - handle_regular_status_updates() /mob/living/proc/setBrainLoss(amount) - if(status_flags & GODMODE) return 0 + if(status_flags & GODMODE) + return 0 brainloss = amount - handle_regular_status_updates() //we update our health right away. /mob/living/proc/getStaminaLoss() return staminaloss /mob/living/proc/adjustStaminaLoss(amount) - if(status_flags & GODMODE) return 0 + return + +/mob/living/carbon/adjustStaminaLoss(amount) + if(status_flags & GODMODE) + return 0 staminaloss = min(max(staminaloss + amount, 0),(maxHealth*2)) + update_stamina() + +/mob/living/carbon/alien/adjustStaminaLoss(amount) + return /mob/living/proc/setStaminaLoss(amount) - if(status_flags & GODMODE) return 0 + return + +/mob/living/carbon/setStaminaLoss(amount) + if(status_flags & GODMODE) + return 0 staminaloss = amount + update_stamina() + +/mob/living/carbon/alien/setStaminaLoss(amount) + return /mob/living/proc/getMaxHealth() return maxHealth @@ -326,7 +357,7 @@ Sorry Giacom. Please don't be mad :( return else if(alert(src, "You sure you want to sleep for a while?", "Sleep", "Yes", "No") == "Yes") - sleeping = 20 //Short nap + SetSleeping(20) //Short nap update_canmove() /mob/proc/get_contents() @@ -379,7 +410,7 @@ Sorry Giacom. Please don't be mad :( /mob/living/proc/get_organ_target() var/mob/shooter = src - var/t = shooter:zone_sel.selecting + var/t = shooter.zone_selected if ((t in list( "eyes", "mouth" ))) t = "head" var/obj/item/organ/limb/def_zone = ran_zone(t) @@ -398,28 +429,32 @@ Sorry Giacom. Please don't be mad :( ear_deaf = deaf // heal ONE external organ, organ gets randomly selected from damaged ones. -/mob/living/proc/heal_organ_damage(brute, burn) - adjustBruteLoss(-brute) - adjustFireLoss(-burn) - src.updatehealth() +/mob/living/proc/heal_organ_damage(brute, burn, updating_health=1) + adjustBruteLoss(-brute, updating_health) + adjustFireLoss(-burn, updating_health) + if(updating_health) + updatehealth() // damage ONE external organ, organ gets randomly selected from damaged ones. -/mob/living/proc/take_organ_damage(brute, burn) +/mob/living/proc/take_organ_damage(brute, burn, updating_health=1) adjustBruteLoss(brute) adjustFireLoss(burn) - src.updatehealth() + if(updating_health) + updatehealth() // heal MANY external organs, in random order -/mob/living/proc/heal_overall_damage(brute, burn) - adjustBruteLoss(-brute) - adjustFireLoss(-burn) - src.updatehealth() +/mob/living/proc/heal_overall_damage(brute, burn, updating_health=1) + adjustBruteLoss(-brute, updating_health) + adjustFireLoss(-burn, updating_health) + if(updating_health) + updatehealth() // damage MANY external organs, in random order -/mob/living/proc/take_overall_damage(brute, burn) - adjustBruteLoss(brute) - adjustFireLoss(burn) - src.updatehealth() +/mob/living/proc/take_overall_damage(brute, burn, updating_health=1) + adjustBruteLoss(brute, updating_health) + adjustFireLoss(burn, updating_health) + if(updating_health) + updatehealth() /mob/living/proc/revive() setToxLoss(0) @@ -430,9 +465,19 @@ Sorry Giacom. Please don't be mad :( SetParalysis(0) SetStunned(0) SetWeakened(0) + SetSleeping(0) radiation = 0 nutrition = NUTRITION_LEVEL_FED + 50 bodytemperature = 310 + if(client) + if(eye_blind) + client.screen.Remove(global_hud.blind) + clear_alert("blind") + if(eye_blurry) + client.screen.Remove(global_hud.blurry) + client.screen.Remove(global_hud.darkMask) + client.screen.Remove(global_hud.vimpaired) + eye_stat = 0 disabilities = 0 eye_blind = 0 eye_blurry = 0 @@ -442,33 +487,17 @@ Sorry Giacom. Please don't be mad :( ExtinguishMob() fire_stacks = 0 suiciding = 0 - if(iscarbon(src)) - var/mob/living/carbon/C = src - C.handcuffed = initial(C.handcuffed) - for(var/obj/item/weapon/restraints/R in C.contents) //actually remove cuffs from inventory - qdel(R) - if(C.reagents) - for(var/datum/reagent/R in C.reagents.reagent_list) - C.reagents.clear_reagents() - C.reagents.addiction_list = list() - for(var/datum/disease/D in viruses) - D.cure(0) if(stat == DEAD) dead_mob_list -= src living_mob_list += src stat = CONSCIOUS - if(ishuman(src)) - var/mob/living/carbon/human/human_mob = src - human_mob.restore_blood() - human_mob.remove_all_embedded_objects() - + updatehealth() update_fire() regenerate_icons() /mob/living/proc/update_damage_overlays() return - /mob/living/proc/Examine_OOC() set name = "Examine Meta-Info (OOC)" set category = "OOC" @@ -917,3 +946,186 @@ Sorry Giacom. Please don't be mad :( else src << "You don't have the dexterity to do this!" return + +/mob/living/carbon/proc/update_stamina() + return + +/mob/living/carbon/human/update_stamina() + if(staminaloss) + var/total_health = (health - staminaloss) + if(total_health <= config.health_threshold_crit && !stat) + src << "You're too exhausted to keep going..." + Weaken(5) + update_health_hud() + +/mob/proc/update_sight() + return + +/mob/proc/adjust_blindness() + return + +/mob/living/adjust_blindness(amount) + if(amount>0) + var/old_eye_blind = eye_blind + eye_blind += amount + if(!old_eye_blind) + throw_alert("blind", /obj/screen/alert/blind) + update_vision_overlays()//if we were not blind before, we update our vision overlays. + return + if(eye_blind) + var/blind_minimum = 0 + if(stat == UNCONSCIOUS || (disabilities & BLIND)) + blind_minimum = 1 + if(client) + if(client.eye != src) + var/atom/A = client.eye + if(global_hud.blind in A.get_vision_impairments(src)) + blind_minimum = 1 + eye_blind = max(eye_blind+amount, blind_minimum) + if(!eye_blind) + clear_alert("blind") + update_vision_overlays()//if we're no longer blind, we update our vision overlays. + + +/mob/proc/set_blindness(amount) + return + +/mob/living/set_blindness(amount) + if(amount>0) + if(eye_blind >= amount) + return + var/old_eye_blind = eye_blind + eye_blind = amount + if(client && !old_eye_blind) + update_vision_overlays() + throw_alert("blind", /obj/screen/alert/blind) + else if(eye_blind) + var/blind_minimum = 0 + if(stat == UNCONSCIOUS || (disabilities & BLIND)) + blind_minimum = 1 + if(client) + if(client.eye != src) + var/atom/A = client.eye + if(global_hud.blind in A.get_vision_impairments(src)) + blind_minimum = 1 + eye_blind = blind_minimum + if(!eye_blind) + clear_alert("blind") + update_vision_overlays() + +/mob/proc/adjust_blurriness(amount) + if(amount>0) + var/old_eye_blurry = eye_blurry + eye_blurry += amount + if(!old_eye_blurry) + update_vision_overlays() + else if(eye_blurry) + eye_blurry = max(eye_blurry+amount, 0) + if(!eye_blurry) + update_vision_overlays() + +/mob/proc/set_blurriness(amount) + var/old_eye_blurry = eye_blurry + eye_blurry = amount + if(amount>0) + if(!old_eye_blurry) + update_vision_overlays() + else if(old_eye_blurry) + update_vision_overlays() + + +/mob/proc/set_eye_stat(amount) + return + +/mob/living/carbon/set_eye_stat(amount) + var/old_eye_stat = eye_stat + if(amount>0) + eye_stat = amount + update_vision_overlays() + else if(old_eye_stat) + eye_stat = 0 + update_vision_overlays() + +/mob/proc/adjust_eye_stat(amount) + return + +/mob/living/carbon/human/adjust_eye_stat(amount) + var/old_eye_stat = eye_stat + if(amount>0) + eye_stat += amount + if(!old_eye_stat) + update_vision_overlays() + else if(old_eye_stat) + eye_stat = max(eye_stat+amount, 0) + if(old_eye_stat && !eye_stat) + update_vision_overlays() + +/mob/proc/adjust_drugginess(amount) + return + +/mob/living/carbon/adjust_drugginess(amount) + var/old_druggy = druggy + if(amount>0) + druggy += amount + if(!old_druggy) + update_vision_overlays() + throw_alert("high", /obj/screen/alert/high) + else if(old_druggy) + druggy = max(eye_blurry+amount, 0) + if(!druggy) + update_vision_overlays() + clear_alert("high") + +/mob/proc/set_drugginess(amount) + return + +/mob/living/carbon/set_drugginess(amount) + var/old_druggy = druggy + druggy = amount + if(amount>0) + if(!old_druggy) + update_vision_overlays() + throw_alert("high", /obj/screen/alert/high) + else if(old_druggy) + update_vision_overlays() + clear_alert("high") + + +/mob/proc/update_vision_overlays() + return + +/mob/proc/cure_blind() //when we want to cure the BLIND disability only. + return + +/mob/living/carbon/cure_blind() + if(disabilities & BLIND) + disabilities &= ~BLIND + adjust_blindness(-1) + return 1 + +/mob/proc/cure_nearsighted() + return + +/mob/living/carbon/cure_nearsighted() + if(disabilities & NEARSIGHT) + disabilities &= ~NEARSIGHT + update_vision_overlays() + return 1 + +/mob/proc/become_nearsighted() + return + +/mob/living/carbon/become_nearsighted() + if(!(disabilities & NEARSIGHT)) + disabilities |= NEARSIGHT + update_vision_overlays() + return 1 + +/mob/proc/become_blind() + return + +/mob/living/carbon/become_blind() + if(!(disabilities & BLIND)) + disabilities |= BLIND + set_blindness(max(eye_blind, 1)) + return 1 diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 27bd2ccb751..e6abd447498 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -1,6 +1,8 @@ /mob/living see_invisible = SEE_INVISIBLE_LIVING languages = HUMAN + sight = 0 + see_in_dark = 2 //Health and life related vars var/maxHealth = 100 //Maximum health that should be possible. diff --git a/code/modules/mob/living/login.dm b/code/modules/mob/living/login.dm index 7d99cd5fce8..c2d67d405d6 100644 --- a/code/modules/mob/living/login.dm +++ b/code/modules/mob/living/login.dm @@ -10,6 +10,11 @@ if("sandbox") CanBuild() + update_sight() + update_vision_overlays() + update_damage_hud() + update_health_hud() + //Vents if(ventcrawler) src << "You can ventcrawl! Use alt+click on vents to quickly travel about the station." diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 9a4875bfe9a..f1a2c173d60 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -20,6 +20,8 @@ var/list/ai_list = list() density = 1 status_flags = CANSTUN|CANPARALYSE|CANPUSH force_compose = 1 //This ensures that the AI always composes it's own hear message. Needed for hrefs and job display. + sight = SEE_TURFS | SEE_MOBS | SEE_OBJS + see_in_dark = 8 med_hud = DATA_HUD_MEDICAL_BASIC sec_hud = DATA_HUD_SECURITY_BASIC var/list/network = list("SS13") @@ -295,7 +297,7 @@ var/list/ai_list = list() onclose(src, "airoster") /mob/living/silicon/ai/proc/ai_call_shuttle() - if(stat == 2) + if(stat == DEAD) return //won't work if dead if(istype(usr,/mob/living/silicon/ai)) var/mob/living/silicon/ai/AI = src @@ -324,7 +326,7 @@ var/list/ai_list = list() set name = "Toggle Floor Bolts" if(!isturf(loc)) // if their location isn't a turf return // stop - if(stat == 2) + if(stat == DEAD) return //won't work if dead anchored = !anchored // Toggles the anchor @@ -336,7 +338,7 @@ var/list/ai_list = list() /mob/living/silicon/ai/proc/ai_cancel_call() set category = "Malfunction" - if(stat == 2) + if(stat == DEAD) return //won't work if dead if(istype(usr,/mob/living/silicon/ai)) var/mob/living/silicon/ai/AI = src @@ -346,14 +348,8 @@ var/list/ai_list = list() SSshuttle.cancelEvac(src) return -/mob/living/silicon/ai/check_eye(mob/user) - if (!current) - return null - user.reset_view(current) - return 1 - /mob/living/silicon/ai/blob_act() - if (stat != 2) + if (stat != DEAD) adjustBruteLoss(60) updatehealth() return 1 @@ -378,11 +374,11 @@ var/list/ai_list = list() if(1) gib() if(2) - if (stat != 2) + if (stat != DEAD) adjustBruteLoss(60) adjustFireLoss(60) if(3) - if (stat != 2) + if (stat != DEAD) adjustBruteLoss(30) return @@ -472,20 +468,12 @@ var/list/ai_list = list() ..() return -/mob/living/silicon/ai/reset_view(atom/A) - if (camera_light_on) - light_cameras() - if(istype(A,/obj/machinery/camera)) - current = A - ..() - - /mob/living/silicon/ai/proc/switchCamera(obj/machinery/camera/C) if(!tracking) cameraFollow = null - if (!C || stat == 2) //C.can_use()) + if (!C || stat == DEAD) //C.can_use()) return 0 if(!src.eyeobj) @@ -848,4 +836,46 @@ var/list/ai_list = list() raw_message = lang_treat(speaker, message_langs, raw_message, spans) var/name_used = speaker.GetVoice() var/rendered = "Relayed Speech: [name_used] [raw_message]" - show_message(rendered, 2) \ No newline at end of file + show_message(rendered, 2) + + +/mob/living/silicon/ai/reset_perspective(atom/A) + if(camera_light_on) + light_cameras() + if(istype(A,/obj/machinery/camera)) + current = A + if(client) + if(istype(A, /atom/movable)) + client.perspective = EYE_PERSPECTIVE + client.eye = A + else + if(isturf(loc)) + if(eyeobj) + client.eye = eyeobj + client.perspective = MOB_PERSPECTIVE + else + client.eye = client.mob + client.perspective = MOB_PERSPECTIVE + else + client.perspective = EYE_PERSPECTIVE + client.eye = loc + update_sight() + update_vision_overlays() + + +/mob/living/silicon/ai/adjust_blurriness() + return + +/mob/living/silicon/ai/set_blindness() + return + +/mob/living/silicon/ai/update_vision_overlays() + if(!client) + return + client.screen.Remove(global_hud.blind) + + if(stat == DEAD) //if dead we just remove all vision impairments + return + + if(eye_blind) + client.screen += global_hud.blind diff --git a/code/modules/mob/living/silicon/ai/death.dm b/code/modules/mob/living/silicon/ai/death.dm index 9268598c985..966ecc79505 100644 --- a/code/modules/mob/living/silicon/ai/death.dm +++ b/code/modules/mob/living/silicon/ai/death.dm @@ -11,14 +11,12 @@ else icon_state = "ai_dead" + cameraFollow = null + anchored = 0 //unbolt floorbolts update_canmove() if(src.eyeobj) src.eyeobj.setLoc(get_turf(src)) - if(blind) blind.layer = 0 - sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS - see_in_dark = 8 - see_invisible = SEE_INVISIBLE_LEVEL_TWO shuttle_caller_list -= src SSshuttle.autoEvac() @@ -45,7 +43,4 @@ if (istype(loc, /obj/item/device/aicard)) loc.icon_state = "aicard-404" - tod = worldtime2text() //weasellos time of death patch - if(mind) mind.store_memory("Time of death: [tod]", 0) - - return ..(gibbed) + return ..() diff --git a/code/modules/mob/living/silicon/ai/examine.dm b/code/modules/mob/living/silicon/ai/examine.dm index 0c8d26f8960..a47c0e8293c 100644 --- a/code/modules/mob/living/silicon/ai/examine.dm +++ b/code/modules/mob/living/silicon/ai/examine.dm @@ -14,9 +14,6 @@ msg += "It looks slightly charred.\n" else msg += "Its casing is melted and heat-warped!\n" - - if (src.stat == UNCONSCIOUS) - msg += "It is non-responsive and displaying the text: \"RUNTIME: Sensory Overload, stack 26/3\".\n" msg += "
" if (shunted == 0 && !src.client) msg += "[src]Core.exe has stopped responding! NTOS is searching for a solution to the problem...\n" diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index baeed877e6f..d4e074d8af6 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -3,184 +3,153 @@ return else //I'm not removing that shitton of tabs, unneeded as they are. -- Urist //Being dead doesn't mean your temperature never changes - var/turf/T = get_turf(src) - - if (src.stat!= CONSCIOUS) - src.cameraFollow = null - src.reset_view(null) - src.unset_machine() - - updatehealth() update_gravity(mob_has_gravity()) update_action_buttons() - if (src.malfhack) - if (src.malfhack.aidisabled) + if(malfhack) + if(malfhack.aidisabled) src << "ERROR: APC access disabled, hack attempt canceled." - src.malfhacking = 0 - src.malfhack = null - - - if (src.health <= config.health_threshold_dead) - death() - return - - if (src.machine) - if (!( src.machine.check_eye(src) )) - src.reset_view(null) + malfhacking = 0 + malfhack = null // Handle power damage (oxy) - if(src.aiRestorePowerRoutine != 0) + if(aiRestorePowerRoutine) // Lost power adjustOxyLoss(1) else // Gain Power - adjustOxyLoss(-1) - - //stage = 1 - //if (istype(src, /mob/living/silicon/ai)) // Are we not sure what we are? - var/blindness = 0 - //stage = 2 - var/area/loc = null - if (istype(T, /turf)) - //stage = 3 - loc = T.loc - if (istype(loc, /area)) - //stage = 4 - if (lacks_power()) - //stage = 5 - blindness = 1 - - if (!blindness) - //stage = 4.5 - if (src.blind.layer != 0) - src.blind.layer = 0 - src.sight |= SEE_TURFS - src.sight |= SEE_MOBS - src.sight |= SEE_OBJS - src.see_in_dark = 8 - src.see_invisible = SEE_INVISIBLE_LEVEL_TWO - if(see_override) - see_invisible = see_override + if(getOxyLoss()) + adjustOxyLoss(-1) + if(!lacks_power()) var/area/home = get_area(src) - if(!home) return//something to do with malf fucking things up I guess. <-- aisat is gone. is this still necessary? ~Carn if(home.powered(EQUIP)) home.use_power(1000, EQUIP) - if (src:aiRestorePowerRoutine==2) + if(aiRestorePowerRoutine==2) src << "Alert cancelled. Power has been restored without our assistance." - src:aiRestorePowerRoutine = 0 - src.blind.layer = 0 + aiRestorePowerRoutine = 0 + set_blindness(0) + update_sight() return - else if (src:aiRestorePowerRoutine==3) + else if (aiRestorePowerRoutine==3) src << "Alert cancelled. Power has been restored." - src:aiRestorePowerRoutine = 0 - src.blind.layer = 0 + aiRestorePowerRoutine = 0 + set_blindness(0) + update_sight() return - else - //stage = 6 - src.blind.screen_loc = "1,1 to 15,15" - if (src.blind.layer!=18) - src.blind.layer = 18 - src.sight = src.sight&~SEE_TURFS - src.sight = src.sight&~SEE_MOBS - src.sight = src.sight&~SEE_OBJS - src.see_in_dark = 0 - src.see_invisible = SEE_INVISIBLE_LIVING - - if (lacks_power()) - if (src:aiRestorePowerRoutine==0) - src:aiRestorePowerRoutine = 1 - - src << "You've lost power!" -// world << "DEBUG CODE TIME! [loc] is the area the AI is sucking power from" - //if (!is_special_character(src)) - //src.set_zeroth_law("") - //src.clear_supplied_laws() // Don't reset our laws. - //var/time = time2text(world.realtime,"hh:mm:ss") - //lawchanges.Add("[time] : [src.name]'s noncore laws have been reset due to power failure") - spawn(20) - src << "Backup battery online. Scanners, camera, and radio interface offline. Beginning fault-detection." - sleep(50) - if (loc.master.power_equip) - if (!istype(T, /turf/space)) - src << "Alert cancelled. Power has been restored without our assistance." - src.aiRestorePowerRoutine = 0 - src.blind.layer = 0 - return - src << "Fault confirmed: missing external power. Shutting down main control system to save power." - sleep(20) - src << "Emergency control system online. Verifying connection to power network." - sleep(50) - if (istype(T, /turf/space)) - src << "Unable to verify! No power connection detected!" - src:aiRestorePowerRoutine = 2 - return - src << "Connection verified. Searching for APC in power network." - sleep(50) - var/obj/machinery/power/apc/theAPC = null -/* - for (var/something in loc) - if (istype(something, /obj/machinery/power/apc)) - if (!(something:stat & BROKEN)) - theAPC = something - break -*/ - var/PRP //like ERP with the code, at least this stuff is no more 4x sametext - for (PRP=1, PRP<=4, PRP++) - var/area/AIarea = get_area(src) - for(var/area/A in AIarea.master.related) - for (var/obj/machinery/power/apc/APC in A) - if (!(APC.stat & BROKEN)) - theAPC = APC - break - if (!theAPC) - switch(PRP) - if (1) src << "Unable to locate APC!" - else src << "Lost connection with the APC!" - src:aiRestorePowerRoutine = 2 - return - if (loc.master.power_equip) - if (!istype(T, /turf/space)) - src << "Alert cancelled. Power has been restored without our assistance." - src:aiRestorePowerRoutine = 0 - src.blind.layer = 0 //This, too, is a fix to issue 603 - return - switch(PRP) - if (1) src << "APC located. Optimizing route to APC to avoid needless power waste." - if (2) src << "Best route identified. Hacking offline APC power port." - if (3) src << "Power port upload access confirmed. Loading control program into APC power port software." - if (4) - src << "Transfer complete. Forcing APC to execute program." - sleep(50) - src << "Receiving control information from APC." - sleep(2) - //bring up APC dialog - apc_override = 1 - theAPC.ui_interact(src, state = conscious_state) - apc_override = 0 - src:aiRestorePowerRoutine = 3 - src << "Here are your current laws:" - src.show_laws() - sleep(50) - theAPC = null + else if(!aiRestorePowerRoutine) + aiRestorePowerRoutine = 1 + set_blindness(1) + update_sight() + src << "You've lost power!" + spawn(20) + start_RestorePowerRoutine() /mob/living/silicon/ai/proc/lacks_power() var/turf/T = get_turf(src) var/area/A = get_area(src) - return ((!A.power_equip) || istype(T, /turf/space)) && !is_type_in_list(src.loc, list(/obj/item, /obj/mecha)) + return !T || !A || ((!A.master.power_equip || istype(T, /turf/space)) && !is_type_in_list(src.loc, list(/obj/item, /obj/mecha))) /mob/living/silicon/ai/updatehealth() if(status_flags & GODMODE) - health = maxHealth - stat = CONSCIOUS return health = maxHealth - getOxyLoss() - getToxLoss() - getBruteLoss() if(!fire_res_on_core) health -= getFireLoss() + update_stat() diag_hud_set_status() - diag_hud_set_health() \ No newline at end of file + diag_hud_set_health() + +/mob/living/silicon/ai/update_stat() + if(status_flags & GODMODE) + return + if(stat != DEAD) + if(health <= config.health_threshold_dead) + death() + return + +/mob/living/silicon/ai/update_sight() + see_invisible = initial(see_invisible) + see_in_dark = initial(see_in_dark) + sight = initial(sight) + if(aiRestorePowerRoutine) + sight = sight&~SEE_TURFS + sight = sight&~SEE_MOBS + sight = sight&~SEE_OBJS + see_in_dark = 0 + + if(see_override) + see_invisible = see_override + + +/mob/living/silicon/ai/proc/start_RestorePowerRoutine() + src << "Backup battery online. Scanners, camera, and radio interface offline. Beginning fault-detection." + sleep(50) + var/turf/T = get_turf(src) + var/area/AIarea = get_area(src) + if(AIarea && AIarea.master.power_equip) + if(!istype(T, /turf/space)) + src << "Alert cancelled. Power has been restored without our assistance." + aiRestorePowerRoutine = 0 + set_blindness(0) + update_sight() + return + src << "Fault confirmed: missing external power. Shutting down main control system to save power." + sleep(20) + src << "Emergency control system online. Verifying connection to power network." + sleep(50) + T = get_turf(src) + if (istype(T, /turf/space)) + src << "Unable to verify! No power connection detected!" + aiRestorePowerRoutine = 2 + return + src << "Connection verified. Searching for APC in power network." + sleep(50) + var/obj/machinery/power/apc/theAPC = null + + var/PRP //like ERP with the code, at least this stuff is no more 4x sametext + for (PRP=1, PRP<=4, PRP++) + T = get_turf(src) + AIarea = get_area(src) + if(AIarea) + for(var/area/A in AIarea.master.related) + for (var/obj/machinery/power/apc/APC in A) + if (!(APC.stat & BROKEN)) + theAPC = APC + break + if (!theAPC) + switch(PRP) + if(1) + src << "Unable to locate APC!" + else + src << "Lost connection with the APC!" + aiRestorePowerRoutine = 2 + return + if(AIarea.master.power_equip) + if (!istype(T, /turf/space)) + src << "Alert cancelled. Power has been restored without our assistance." + aiRestorePowerRoutine = 0 + set_blindness(0) + update_sight() + return + switch(PRP) + if (1) src << "APC located. Optimizing route to APC to avoid needless power waste." + if (2) src << "Best route identified. Hacking offline APC power port." + if (3) src << "Power port upload access confirmed. Loading control program into APC power port software." + if (4) + src << "Transfer complete. Forcing APC to execute program." + sleep(50) + src << "Receiving control information from APC." + sleep(2) + apc_override = 1 + theAPC.ui_interact(src, state = conscious_state) + apc_override = 0 + aiRestorePowerRoutine = 3 + src << "Here are your current laws:" + show_laws() + sleep(50) + theAPC = null \ No newline at end of file diff --git a/code/modules/mob/living/silicon/ai/login.dm b/code/modules/mob/living/silicon/ai/login.dm index b5b6808bac9..21f12ab915d 100644 --- a/code/modules/mob/living/silicon/ai/login.dm +++ b/code/modules/mob/living/silicon/ai/login.dm @@ -1,25 +1,12 @@ -/mob/living/silicon/ai/Login() //ThisIsDumb(TM) TODO: tidy this up ¬_¬ ~Carn +/mob/living/silicon/ai/Login() ..() for(var/obj/effect/rune/rune in world) var/image/blood = image(loc = rune) blood.override = 1 client.images += blood - regenerate_icons() - flash = new /obj/screen() - flash.icon_state = "blank" - flash.name = "flash" - flash.screen_loc = "1,1 to 15,15" - flash.layer = 17 - blind = new /obj/screen() - blind.icon_state = "black" - blind.name = " " - blind.screen_loc = "1,1 to 15,15" - blind.layer = 0 - client.screen.Add( blind, flash ) if(stat != DEAD) for(var/obj/machinery/ai_status_display/O in machines) //change status O.mode = 1 O.emotion = "Neutral" - src.view_core() - return \ No newline at end of file + view_core() diff --git a/code/modules/mob/living/silicon/ai/logout.dm b/code/modules/mob/living/silicon/ai/logout.dm index 09bc93bf349..7a7670cfcb4 100644 --- a/code/modules/mob/living/silicon/ai/logout.dm +++ b/code/modules/mob/living/silicon/ai/logout.dm @@ -2,9 +2,4 @@ ..() for(var/obj/machinery/ai_status_display/O in world) //change status O.mode = 0 - if(!isturf(loc)) - if (client) - client.eye = loc - client.perspective = EYE_PERSPECTIVE - src.view_core() - return \ No newline at end of file + view_core() diff --git a/code/modules/mob/living/silicon/pai/death.dm b/code/modules/mob/living/silicon/pai/death.dm index 75e30dda3f9..a1e3b67fea4 100644 --- a/code/modules/mob/living/silicon/pai/death.dm +++ b/code/modules/mob/living/silicon/pai/death.dm @@ -2,17 +2,12 @@ if(stat == DEAD) return stat = DEAD canmove = 0 - if(blind) blind.layer = 0 - sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS - see_in_dark = 8 - see_invisible = SEE_INVISIBLE_LEVEL_TWO - - //var/tod = time2text(world.realtime,"hh:mm:ss") //weasellos time of death patch - //mind.store_memory("Time of death: [tod]", 0) + update_sight() + update_vision_overlays() //New pAI's get a brand new mind to prevent meta stuff from their previous life. This new mind causes problems down the line if it's not deleted here. - //Read as: I have no idea what I'm doing but asking for help got me nowhere so this is what you get. - Nodrak - if(mind) del(mind) + if(mind) + del(mind) living_mob_list -= src ghostize() qdel(src) \ No newline at end of file diff --git a/code/modules/mob/living/silicon/pai/life.dm b/code/modules/mob/living/silicon/pai/life.dm index bc665bd4ec5..191f28d7c37 100644 --- a/code/modules/mob/living/silicon/pai/life.dm +++ b/code/modules/mob/living/silicon/pai/life.dm @@ -14,7 +14,6 @@ /mob/living/silicon/pai/updatehealth() if(status_flags & GODMODE) - health = maxHealth - stat = CONSCIOUS return health = maxHealth - getBruteLoss() - getFireLoss() + update_stat() diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index c1ea89972d6..06e2d4731c0 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -92,12 +92,6 @@ else stat(null, text("Systems nonfunctional")) -/mob/living/silicon/pai/check_eye(mob/user) - if (!src.current) - return null - user.reset_view(src.current) - return 1 - /mob/living/silicon/pai/blob_act() return 0 @@ -155,68 +149,9 @@ // See software.dm for Topic() -///mob/living/silicon/pai/attack_hand(mob/living/carbon/M as mob) - -/mob/living/silicon/pai/proc/switchCamera(obj/machinery/camera/C) - usr:cameraFollow = null - if (!C) - src.unset_machine() - src.reset_view(null) - return 0 - if (stat == 2 || !C.status || !(src.network in C.network)) return 0 - - // ok, we're alive, camera is good and in our network... - - set_machine(src) - current = C - reset_view(C) - return 1 - - -/mob/living/silicon/pai/cancel_camera() - set category = "pAI Commands" - set name = "Cancel Camera View" - src.reset_view(null) - src.unset_machine() - src:cameraFollow = null - /mob/living/silicon/pai/UnarmedAttack(atom/A)//Stops runtimes due to attack_animal being the default return -/mob/living/silicon/pai/on_forcemove(atom/newloc) - if(card) - card.loc = newloc - else //something went very wrong. - CRASH("pAI without card") - loc = card - -//Addition by Mord_Sith to define AI's network change ability -/* -/mob/living/silicon/pai/proc/pai_network_change() - set category = "pAI Commands" - set name = "Change Camera Network" - src.reset_view(null) - src.unset_machine() - src:cameraFollow = null - var/cameralist[0] - - if(usr.stat == 2) - usr << "You can't change your camera network because you are dead!" - return - - for (var/obj/machinery/camera/C in Cameras) - if(!C.status) - continue - else - if(C.network != "CREED" && C.network != "thunder" && C.network != "RD" && C.network != "toxins" && C.network != "Prison") COMPILE ERROR! This will have to be updated as camera.network is no longer a string, but a list instead - cameralist[C.network] = C.network - - src.network = input(usr, "Which network would you like to view?") as null|anything in cameralist - src << "\blue Switched to [src.network] camera network." -//End of code by Mord_Sith -*/ - - /* // Debug command - Maybe should be added to admin verbs later /mob/verb/makePAI(var/turf/t in view()) diff --git a/code/modules/mob/living/silicon/robot/death.dm b/code/modules/mob/living/silicon/robot/death.dm index 96439b2d1a5..b8848a47565 100644 --- a/code/modules/mob/living/silicon/robot/death.dm +++ b/code/modules/mob/living/silicon/robot/death.dm @@ -26,21 +26,14 @@ locked = 0 //unlock cover stat = DEAD update_canmove() - if(camera) - camera.status = 0 + if(camera && camera.status) + camera.toggle_cam(src,0) update_headlamp(1) //So borg lights are disabled when killed. uneq_all() // particularly to ensure sight modes are cleared - if(blind) - blind.layer = 0 - sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS - see_in_dark = 8 - see_invisible = SEE_INVISIBLE_LEVEL_TWO update_icons() - tod = worldtime2text() //weasellos time of death patch - if(mind) mind.store_memory("Time of death: [tod]", 0) sql_report_cyborg_death(src) - return ..(gibbed) \ No newline at end of file + return ..() \ No newline at end of file diff --git a/code/modules/mob/living/silicon/robot/inventory.dm b/code/modules/mob/living/silicon/robot/inventory.dm index a646d4e159d..f5b710af9e7 100644 --- a/code/modules/mob/living/silicon/robot/inventory.dm +++ b/code/modules/mob/living/silicon/robot/inventory.dm @@ -1,4 +1,4 @@ -//These procs handle putting s tuff in your hand. It's probably best to use these rather than setting stuff manually +//These procs handle putting stuff in your hand. It's probably best to use these rather than setting stuff manually //as they handle all relevant stuff like adding it to the player's screen and such //Returns the thing in our active hand (whatever is in our active module-slot, in this case) diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index b5dcbc62dbb..67c36e0cc5e 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -5,21 +5,18 @@ if (src.notransform) return - clamp_values() ..() - if(!stat) - use_power() + handle_robot_cell() -/mob/living/silicon/robot/proc/clamp_values() - SetStunned(min(stunned, 30)) - SetParalysis(min(paralysis, 30)) - SetWeakened(min(weakened, 20)) - sleeping = 0 - adjustBruteLoss(0) - adjustToxLoss(0) - adjustOxyLoss(0) - adjustFireLoss(0) +/mob/living/silicon/robot/proc/handle_robot_cell() + if(stat != DEAD) + if(low_power_mode) + if(cell && cell.charge) + low_power_mode = 0 + update_headlamp() + else if(stat == CONSCIOUS) + use_power() /mob/living/silicon/robot/proc/use_power() if(cell && cell.charge) @@ -29,49 +26,17 @@ 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() - stat = UNCONSCIOUS - update_headlamp(1) + low_power_mode = 1 + update_headlamp() diag_hud_set_borgcell() - -/mob/living/silicon/robot/handle_regular_status_updates() - if(camera && !scrambledcodes) - if(stat == DEAD || wires.IsCameraCut()) - camera.status = 0 - else - camera.status = 1 - - if (..()) //Alive. - - if(health <= -maxHealth) //die only once - death() - diag_hud_set_status() - return - - if(getOxyLoss() > maxHealth*0.5) - Paralyse(3) - - if (paralysis || stunned || weakened) //Stunned etc. - stat = UNCONSCIOUS - update_headlamp() - diag_hud_set_health() - diag_hud_set_status() - - return 1 - -/mob/living/silicon/robot/handle_status_effects() - ..() - if (stuttering) - stuttering = max(0, stuttering - 1) - - if (druggy) - druggy = max(0, druggy - 1) - /mob/living/silicon/robot/handle_regular_hud_updates() if(!client) return + update_cell_hud_icon() + if (syndicate) if(ticker.mode.name == "traitor") for(var/datum/mind/tra in ticker.mode.traitors) @@ -88,60 +53,28 @@ ..() return 1 -/mob/living/silicon/robot/update_sight() - - if (stat == DEAD || src.sight_mode & BORGXRAY) - src.sight |= SEE_TURFS - src.sight |= SEE_MOBS - src.sight |= SEE_OBJS - src.see_in_dark = 8 - src.see_invisible = SEE_INVISIBLE_LEVEL_TWO - else - src.see_in_dark = 8 - if (src.sight_mode & BORGMESON && src.sight_mode & BORGTHERM) - src.sight |= SEE_TURFS - src.sight |= SEE_MOBS - src.see_invisible = SEE_INVISIBLE_MINIMUM - else if (src.sight_mode & BORGMESON) - src.sight |= SEE_TURFS - src.see_invisible = SEE_INVISIBLE_MINIMUM - src.see_in_dark = 1 - else if (src.sight_mode & BORGTHERM) - src.sight |= SEE_MOBS - src.see_invisible = SEE_INVISIBLE_LEVEL_TWO - else if (src.stat != DEAD) - src.sight &= ~SEE_MOBS - src.sight &= ~SEE_TURFS - src.sight &= ~SEE_OBJS - src.see_invisible = SEE_INVISIBLE_LEVEL_TWO - if(see_override) - see_invisible = see_override - -/mob/living/silicon/robot/handle_hud_icons() - update_items() - update_cell() - ..() - -/mob/living/silicon/robot/handle_hud_icons_health() - if (healths) - if (stat != DEAD) +/mob/living/silicon/robot/update_health_hud() + if(!client || !hud_used) + return + if(hud_used.healths) + if(stat != DEAD) if(health >= maxHealth) - healths.icon_state = "health0" - else if(health > maxHealth*0.5) - healths.icon_state = "health2" - else if(health > 0) - healths.icon_state = "health3" - else if(health > -maxHealth*0.5) - healths.icon_state = "health4" - else if(health > -maxHealth) - healths.icon_state = "health5" + hud_used.healths.icon_state = "health0" + else if(health > maxHealth*0.6) + hud_used.healths.icon_state = "health2" + else if(health > maxHealth*0.2) + hud_used.healths.icon_state = "health3" + else if(health > -maxHealth*0.2) + hud_used.healths.icon_state = "health4" + else if(health > -maxHealth*0.6) + hud_used.healths.icon_state = "health5" else - healths.icon_state = "health6" + hud_used.healths.icon_state = "health6" else - healths.icon_state = "health7" + hud_used.healths.icon_state = "health7" -/mob/living/silicon/robot/proc/update_cell() - if (cell) +/mob/living/silicon/robot/proc/update_cell_hud_icon() + if(cell) var/cellcharge = cell.charge/cell.maxcharge switch(cellcharge) if(0.75 to INFINITY) @@ -157,20 +90,6 @@ else throw_alert("charge", /obj/screen/alert/nocell) -/mob/living/silicon/robot/proc/update_items() - if (client) - client.screen -= contents - for(var/obj/I in contents) - if(I && !(istype(I,/obj/item/weapon/stock_parts/cell) || istype(I,/obj/item/device/radio) || istype(I,/obj/machinery/camera) || istype(I,/obj/item/device/mmi))) - client.screen += I - if(module_state_1) - module_state_1:screen_loc = ui_inv1 - if(module_state_2) - module_state_2:screen_loc = ui_inv2 - if(module_state_3) - module_state_3:screen_loc = ui_inv3 - - //Robots on fire /mob/living/silicon/robot/handle_fire() if(..()) @@ -194,7 +113,7 @@ IgniteMob() /mob/living/silicon/robot/update_canmove() - if(paralysis || stunned || weakened || buckled || lockcharge) + if(stat || buckled || lockcharge) canmove = 0 else canmove = 1 diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 51ffa99333c..fa890cdfa57 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -23,10 +23,10 @@ //3 Modules can be activated at any one time. var/obj/item/weapon/robot_module/module = null - var/module_active = null - var/module_state_1 = null - var/module_state_2 = null - var/module_state_3 = null + var/obj/item/module_active = null + var/obj/item/module_state_1 = null + var/obj/item/module_state_2 = null + var/obj/item/module_state_3 = null var/mob/living/silicon/ai/connected_ai = null var/obj/item/weapon/stock_parts/cell/cell = null @@ -46,11 +46,11 @@ var/alarms = list("Motion"=list(), "Fire"=list(), "Atmosphere"=list(), "Power"=list(), "Camera"=list(), "Burglar"=list()) var/viewalerts = 0 var/modtype = "robot" - var/lower_mod = 0 var/jetpack = 0 var/datum/effect_system/trail_follow/ion/ion_trail = null var/datum/effect_system/spark_spread/spark_system//So they can initialize sparks whenever/N var/jeton = 0 + var/low_power_mode = 0 //whether the robot has no charge left. var/lawupdate = 1 //Cyborgs will sync their laws with their AI by default var/lockcharge //Boolean of whether the borg is locked down or not @@ -755,7 +755,7 @@ /mob/living/silicon/robot/update_icons() overlays.Cut() - if(stat != DEAD && !(paralysis || stunned || weakened)) //Not dead, not stunned. + if(stat != DEAD && !(paralysis || stunned || weakened || low_power_mode)) //Not dead, not stunned. var/state_name = icon_state //For easy conversion and/or different names switch(icon_state) if("robot") @@ -1032,7 +1032,7 @@ set_autosay() /mob/living/silicon/robot/proc/control_headlamp() - if(stat || lamp_recharging) + if(stat || lamp_recharging || low_power_mode) src << "This function is currently offline." return @@ -1044,7 +1044,7 @@ /mob/living/silicon/robot/proc/update_headlamp(var/turn_off = 0, var/cooldown = 100) SetLuminosity(0) - if(lamp_intensity && (turn_off || stat)) + if(lamp_intensity && (turn_off || stat || low_power_mode)) src << "Your headlamp has been deactivated." lamp_intensity = 0 lamp_recharging = 1 @@ -1153,7 +1153,7 @@ connected_ai << "

NOTICE - Cyborg reclassification detected: [oldname] is now designated as [newname].
" /mob/living/silicon/robot/canUseTopic(atom/movable/M, be_close = 0) - if(stat || lockcharge || stunned || weakened) + if(stat || lockcharge || low_power_mode) return if(be_close && !in_range(M, src)) return @@ -1169,4 +1169,86 @@ src << "SYSTEM ERROR: Module 2 OFFLINE." if(health < -maxHealth*0.5) if(uneq_module(module_state_1)) - src << "CRITICAL ERROR: All modules OFFLINE." \ No newline at end of file + src << "CRITICAL ERROR: All modules OFFLINE." + diag_hud_set_health() + diag_hud_set_status() + update_health_hud() + + +/mob/living/silicon/robot/update_sight() + if(!client) + return + if(stat == DEAD) + sight = (SEE_TURFS|SEE_MOBS|SEE_OBJS) + see_in_dark = 8 + see_invisible = SEE_INVISIBLE_OBSERVER + return + + see_invisible = initial(see_invisible) + see_in_dark = initial(see_in_dark) + sight = initial(sight) + + if(client.eye != src) + var/atom/A = client.eye + if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates. + return + + if(sight_mode & BORGMESON) + sight |= SEE_TURFS + see_invisible = min(see_invisible, SEE_INVISIBLE_MINIMUM) + see_in_dark = 1 + + if(sight_mode & BORGXRAY) + sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS) + see_invisible = SEE_INVISIBLE_LIVING + see_in_dark = 8 + + if(sight_mode & BORGTHERM) + sight |= SEE_MOBS + see_invisible = min(see_invisible, SEE_INVISIBLE_LIVING) + see_in_dark = 8 + + if(see_override) + see_invisible = see_override + +/mob/living/silicon/robot/update_stat() + if(status_flags & GODMODE) + return + if(stat != DEAD) + if(health <= -maxHealth) //die only once + death() + return + if(paralysis || stunned || weakened || getOxyLoss() > maxHealth*0.5) + if(stat == CONSCIOUS) + stat = UNCONSCIOUS + set_blindness(1) + update_canmove() + update_headlamp() + else + if(stat == UNCONSCIOUS) + stat = CONSCIOUS + adjust_blindness(-1) + update_canmove() + update_headlamp() + +/mob/living/silicon/robot/update_vision_overlays() + if(!client) + return + client.screen.Remove(global_hud.blind) + + if(stat == DEAD) //if dead we just remove all vision impairments + return + + var/list/impairments = list() + + if(eye_blind) + impairments |= global_hud.blind + + if(client.eye != src) + var/atom/A = client.eye + var/new_impairments = A.get_vision_impairments(src) + if(new_impairments) + impairments |= new_impairments + + for(var/A in impairments) + client.screen += A \ No newline at end of file diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index b4604dbc0b9..9aa3756673c 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -7,6 +7,7 @@ verb_ask = "queries" verb_exclaim = "declares" verb_yell = "alarms" + see_in_dark = 8 var/syndicate = 0 var/datum/ai_laws/laws = null//Now... THEY ALL CAN ALL HAVE LAWS var/list/alarms_to_show = list() @@ -187,7 +188,7 @@ if(STUTTER) stuttering = max(stuttering,(effect/(blocked+1))) if(EYE_BLUR) - eye_blurry = max(eye_blurry,(effect/(blocked+1))) + set_blurriness(max(eye_blurry,(effect/(blocked+1)))) if(DROWSY) drowsyness = max(drowsyness,(effect/(blocked+1))) updatehealth() @@ -482,4 +483,4 @@ if(changed) animate(src, transform = ntransform, time = 2,easing = EASE_IN|EASE_OUT) - return ..() \ No newline at end of file + return ..() diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm index f8a304ad3e3..802e5619cc2 100644 --- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm +++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm @@ -563,5 +563,5 @@ Auto Patrol[]"}, return if(!C.handcuffed) C.handcuffed = new /obj/item/weapon/restraints/handcuffs/cable/zipties/used(C) - C.update_inv_handcuffed(0) //update the handcuffs overlay + C.update_handcuffed() back_to_idle() diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm index a0d0ef6b331..b974c0c7a74 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -194,7 +194,7 @@ Auto Patrol: []"}, return if(!C.handcuffed) C.handcuffed = new /obj/item/weapon/restraints/handcuffs/cable/zipties/used(C) - C.update_inv_handcuffed(0) //update the handcuffs overlay + C.update_handcuffed() playsound(loc, pick('sound/voice/bgod.ogg', 'sound/voice/biamthelaw.ogg', 'sound/voice/bsecureday.ogg', 'sound/voice/bradio.ogg', 'sound/voice/binsult.ogg', 'sound/voice/bcreep.ogg'), 50, 0) back_to_idle() diff --git a/code/modules/mob/living/simple_animal/corpse.dm b/code/modules/mob/living/simple_animal/corpse.dm index fa0f4d29a38..541284cf2f6 100644 --- a/code/modules/mob/living/simple_animal/corpse.dm +++ b/code/modules/mob/living/simple_animal/corpse.dm @@ -33,7 +33,7 @@ /obj/effect/landmark/mobcorpse/proc/createCorpse() //Creates a mob and checks for gear in each slot before attempting to equip it. var/mob/living/carbon/human/M = new /mob/living/carbon/human (src.loc) M.real_name = src.name - M.stat = 2 //Kills the new mob + M.death() //Kills the new mob if(src.corpseuniform) M.equip_to_slot_or_del(new src.corpseuniform(M), slot_w_uniform) if(src.corpsesuit) diff --git a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm index 54a6b86c314..79738cadbf9 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm @@ -88,9 +88,6 @@ /mob/living/simple_animal/drone/Login() ..() - update_inv_hands() - update_inv_head() - update_inv_internal_storage() check_laws() updateSeeStaticMobs() @@ -238,4 +235,18 @@ return ..() || mob_negates_gravity() /mob/living/simple_animal/drone/experience_pressure_difference(pressure_difference, direction) - return \ No newline at end of file + return + +/mob/living/simple_animal/drone/revive() + adjustBruteLoss(-getBruteLoss()) //Heal all brute damage + stat = CONSCIOUS + updatehealth() + icon_state = icon_living + if(stat == DEAD) + dead_mob_list -= src + living_mob_list += src + update_sight() + update_vision_overlays() + update_canmove() + + diff --git a/code/modules/mob/living/simple_animal/friendly/drone/drones_as_items.dm b/code/modules/mob/living/simple_animal/friendly/drone/drones_as_items.dm index 378fcf6be69..1b611d1da57 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/drones_as_items.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/drones_as_items.dm @@ -56,7 +56,7 @@ contents -= drone drone.loc = get_turf(src) - drone.reset_view() + drone.reset_perspective() drone.dir = SOUTH //Looks better drone.visible_message("[drone] uncurls!") drone = null diff --git a/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm b/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm index f863d12faa1..a8dbdc217f3 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm @@ -34,11 +34,7 @@ return D.visible_message("[D] begins to reactivate [src].", "You begin to reactivate [src]...") if(do_after(user,30, 1, target = src)) - adjustBruteLoss(-getBruteLoss()) //Heal all brute damage - stat = CONSCIOUS - icon_state = icon_living - dead_mob_list -= src - living_mob_list += src + revive() D.visible_message("[D] reactivates [src]!", "You reactivate [src].") alert_drones(DRONE_NET_CONNECT) if(G) diff --git a/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm b/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm index 5bbd09bd9a4..2f62aabea0c 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm @@ -36,7 +36,7 @@ hands_overlays += r_hand_image - if(client && hud_used) + if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD) r_hand.layer = 20 r_hand.screen_loc = ui_rhand client.screen |= r_hand @@ -53,7 +53,7 @@ hands_overlays += l_hand_image - if(client && hud_used) + if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD) l_hand.layer = 20 l_hand.screen_loc = ui_lhand client.screen |= l_hand @@ -65,7 +65,7 @@ /mob/living/simple_animal/drone/proc/update_inv_internal_storage() - if(internal_storage && client && hud_used) + if(internal_storage && client && hud_used && hud_used.hud_shown) internal_storage.screen_loc = ui_drone_storage client.screen += internal_storage @@ -74,7 +74,7 @@ remove_overlay(DRONE_HEAD_LAYER) if(head) - if(client && hud_used) + if(client && hud_used && hud_used.hud_shown) head.screen_loc = ui_drone_head client.screen += head diff --git a/code/modules/mob/living/simple_animal/guardian/guardian.dm b/code/modules/mob/living/simple_animal/guardian/guardian.dm index afced5e62b3..5a751db01f0 100644 --- a/code/modules/mob/living/simple_animal/guardian/guardian.dm +++ b/code/modules/mob/living/simple_animal/guardian/guardian.dm @@ -70,7 +70,7 @@ visible_message("The [src] jumps back to its user.") loc = get_turf(summoner) -/mob/living/mob/living/simple_animal/hostile/guardian/canSuicide() +/mob/living/simple_animal/hostile/guardian/canSuicide() return 0 /mob/living/simple_animal/hostile/guardian/death() @@ -692,93 +692,3 @@ new /obj/item/weapon/guardiancreator/tech/choose(src) new /obj/item/weapon/paper/guardian(src) return - - -///HUD - -/datum/hud/proc/guardian_hud(ui_style = 'icons/mob/screen_midnight.dmi') - adding = list() - - var/obj/screen/using - - using = new /obj/screen/guardian/Manifest() - using.screen_loc = ui_rhand - adding += using - - using = new /obj/screen/guardian/Recall() - using.screen_loc = ui_lhand - adding += using - - using = new /obj/screen/guardian/ToggleMode() - using.screen_loc = ui_storage1 - adding += using - - using = new /obj/screen/guardian/ToggleLight() - using.screen_loc = ui_inventory - adding += using - - using = new /obj/screen/guardian/Communicate() - using.screen_loc = ui_back - adding += using - - mymob.client.screen = list() - mymob.client.screen += mymob.client.void - mymob.client.screen += adding - - -//HUD BUTTONS - -/obj/screen/guardian - icon = 'icons/mob/guardian.dmi' - -/obj/screen/guardian/Manifest - icon_state = "manifest" - name = "Manifest" - desc = "Spring forth into battle!" - -/obj/screen/guardian/Manifest/Click() - if(isguardian(usr)) - var/mob/living/simple_animal/hostile/guardian/G = usr - G.Manifest() - - -/obj/screen/guardian/Recall - icon_state = "recall" - name = "Recall" - desc = "Return to your user." - -/obj/screen/guardian/Recall/Click() - if(isguardian(usr)) - var/mob/living/simple_animal/hostile/guardian/G = usr - G.Recall() - -/obj/screen/guardian/ToggleMode - icon_state = "toggle" - name = "Toggle Mode" - desc = "Switch between ability modes." - -/obj/screen/guardian/ToggleMode/Click() - if(isguardian(usr)) - var/mob/living/simple_animal/hostile/guardian/G = usr - G.ToggleMode() - -/obj/screen/guardian/Communicate - icon_state = "communicate" - name = "Communicate" - desc = "Communicate telepathically with your user." - -/obj/screen/guardian/Communicate/Click() - if(isguardian(usr)) - var/mob/living/simple_animal/hostile/guardian/G = usr - G.Communicate() - - -/obj/screen/guardian/ToggleLight - icon_state = "light" - name = "Toggle Light" - desc = "Glow like star dust." - -/obj/screen/guardian/ToggleLight/Click() - if(isguardian(usr)) - var/mob/living/simple_animal/hostile/guardian/G = usr - G.ToggleLight() diff --git a/code/modules/mob/living/simple_animal/hostile/statue.dm b/code/modules/mob/living/simple_animal/hostile/statue.dm index 8b07a7caa40..1bf39d6b478 100644 --- a/code/modules/mob/living/simple_animal/hostile/statue.dm +++ b/code/modules/mob/living/simple_animal/hostile/statue.dm @@ -58,7 +58,7 @@ mob_spell_list += new /obj/effect/proc_holder/spell/targeted/night_vision(src) // Give nightvision - see_invisible = SEE_INVISIBLE_OBSERVER_NOLIGHTING + see_invisible = SEE_INVISIBLE_NOLIGHTING // Set creator if(creator) @@ -183,7 +183,7 @@ for(var/mob/living/L in living_mob_list) var/turf/T = get_turf(L.loc) if(T && T in targets) - L.eye_blind = max(L.eye_blind, 4) + L.set_blindness(4) return //Toggle Night Vision @@ -203,7 +203,7 @@ if(istype(target, /mob/living/carbon/human)) var/mob/living/carbon/human/H = target if(H.dna.species.invis_sight == SEE_INVISIBLE_LIVING) - H.dna.species.invis_sight = SEE_INVISIBLE_OBSERVER_NOLIGHTING + H.dna.species.invis_sight = SEE_INVISIBLE_NOLIGHTING name = "Toggle Nightvision \[ON]" else H.dna.species.invis_sight = SEE_INVISIBLE_LIVING @@ -211,7 +211,7 @@ else if(target.see_invisible == SEE_INVISIBLE_LIVING) - target.see_invisible = SEE_INVISIBLE_OBSERVER_NOLIGHTING + target.see_invisible = SEE_INVISIBLE_NOLIGHTING name = "Toggle Nightvision \[ON]" else target.see_invisible = SEE_INVISIBLE_LIVING diff --git a/code/modules/mob/living/simple_animal/hostile/true_changeling.dm b/code/modules/mob/living/simple_animal/hostile/true_changeling.dm new file mode 100644 index 00000000000..ea7ce44039f --- /dev/null +++ b/code/modules/mob/living/simple_animal/hostile/true_changeling.dm @@ -0,0 +1,190 @@ +#define TRUE_CHANGELING_REFORM_THRESHOLD 0 //Can turn back at will, by default +#define TRUE_CHANGELING_PASSIVE_HEAL 3 //Amount of brute damage restored per tick +#define TRUE_CHANGELING_FORCED_REFORM 300 //5 minutes + +//Changelings in their true form. +//Massive health and damage, but move slowly. + +/mob/living/simple_animal/hostile/true_changeling + name = "true changeling" + real_name = "true changeling" + desc = "Holy shit, what the fuck is that thing?!" + speak_emote = list("says with one of its faces") + emote_hear = list("says with one of its faces") + icon = 'icons/mob/animal.dmi' + icon_state = "horror" + icon_living = "horror" + icon_dead = "horror_dead" + speed = 2 + gender = NEUTER + a_intent = "harm" + stop_automated_movement = 1 + status_flags = CANPUSH + atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) + minbodytemp = 0 + health = 500 + maxHealth = 500 //Very durable + force_threshold = 10 + healable = 0 + environment_smash = 1 //Tables, closets, etc. + melee_damage_lower = 30 + melee_damage_upper = 30 + see_in_dark = 8 + see_invisible = SEE_INVISIBLE_MINIMUM + wander = 0 + attacktext = "tears into" + attack_sound = 'sound/effects/blobattack.ogg' + next_move_modifier = 0.5 //Faster attacks + butcher_results = list(/obj/item/weapon/reagent_containers/food/snacks/meat/slab/human = 15) //It's a pretty big dude. Actually killing one is a feat. + gold_core_spawnable = 1 //To be fair, they won't be able to become changelings, like headslugs can + var/time_spent_as_true = 0 + var/playstyle_string = "We have entered our true form! We are unbelievably powerful, and regenerate life at a steady rate. However, most of \ + our abilities are useless in this form, and we must utilise the abilities that we have gained as a result of our transformation. Taking too much damage will also turn us back into a \ + human in addition to knocking us out for a long time. Finally, we will uncontrollably revert into a human after some time due to our inability to maintain this form." + var/mob/living/carbon/human/stored_changeling = null //The changeling that transformed + var/devouring = FALSE //If the true changeling is currently devouring a human + var/wallcrawl = FALSE //If the true changeling is crawling around the place, allowing it to counteract gravity loss + +/mob/living/simple_animal/hostile/true_changeling/New() + ..() + spawn(0) + src << playstyle_string + +/mob/living/simple_animal/hostile/true_changeling/Life() + ..() + adjustBruteLoss(-TRUE_CHANGELING_PASSIVE_HEAL) //True changelings slowly regenerate + time_spent_as_true++ //Used for re-forming + if(stored_changeling && time_spent_as_true >= TRUE_CHANGELING_FORCED_REFORM) + death() //After a while, the ling'll revert back without being able to control it + +/mob/living/simple_animal/hostile/true_changeling/Stat() + ..() + if(statpanel("Status")) + if(stored_changeling) + var/time_left = TRUE_CHANGELING_FORCED_REFORM - time_spent_as_true + time_left = Clamp(time_left, 0, INFINITY) + stat(null, "Time Remaining: [time_left]") + stat(null, "Ignoring Gravity: [wallcrawl ? "YES" : "NO"]") + +/mob/living/simple_animal/hostile/true_changeling/death() + ..(1) + if(stored_changeling && mind) + visible_message("[src] lets out a furious scream as it shrinks into its human form.", \ + "We lack the power to maintain this form! We helplessly turn back into a human...") + stored_changeling.loc = get_turf(src) + mind.transfer_to(stored_changeling) + stored_changeling.Paralyse(30) //Make them helpless for 30 seconds + stored_changeling.status_flags &= ~GODMODE + qdel(src) + else + visible_message("[src] lets out a waning scream as it falls, twitching, to the floor.", \ + "We have fallen! We begin the revival process... (this will take around 45 seconds.)") + spawn(450) + if(src) + visible_message("[src] suddenly rises from the dead!") + revive() //Changelings can self-revive, and true changelings are no exception + +/mob/living/simple_animal/hostile/true_changeling/mob_negates_gravity() + return wallcrawl + +/mob/living/simple_animal/hostile/true_changeling/adjustFireLoss(amount) + amount *= 2 //True changelings take 2 times the burn damage! + ..() + +/mob/living/simple_animal/hostile/true_changeling/verb/reform() + set name = "Re-Form Human Shell" + set desc = "We turn back into a human. This takes considerable effort and will stun us for some time afterwards." + set category = "True Changeling" + + if(stat) + src << "We must be conscious to debase ourselves!" + return 0 + if(!stored_changeling) + src << "We do not have a form other than this!" + return 0 + if(stored_changeling.stat == DEAD) + src << "Our human form is dead!" + return 0 + if(time_spent_as_true < TRUE_CHANGELING_REFORM_THRESHOLD) + src << "We are still unable to change back at will!" + return 0 + visible_message("[src] suddenly crunches and twists into a smaller form!", \ + "We return to our lesser form.") + stored_changeling.loc = get_turf(src) + mind.transfer_to(stored_changeling) + stored_changeling.Weaken(10) + stored_changeling.status_flags &= ~GODMODE + qdel(usr) + return 1 + +/mob/living/simple_animal/hostile/true_changeling/verb/devour() + set name = "Devour" + set desc = "We tear into the innards of a human. After some time, they will be significantly damaged and our health partially restored." + set category = "True Changeling" + + if(stat) + src << "We must be conscious to feast!" + return 0 + if(devouring) + src << "We are already feasting on a human!" + return 0 + var/list/potential_targets = list() + for(var/mob/living/carbon/human/H in range(1, src)) + if(H == stored_changeling || (H.mind && H.mind.changeling)) //You can't eat changelings in human form + continue + potential_targets.Add(H) + if(!potential_targets.len) + src << "There are no humans nearby!" + return 0 + var/mob/living/carbon/human/lunch + if(potential_targets.len == 1) + lunch = potential_targets[1] + else + lunch = input(src, "Choose a human to devour.", "Lunch") as null|anything in potential_targets + if(!lunch) + return 0 + if(lunch.getBruteLoss() >= 200) + src << "This human's flesh is too mangled to devour!" + return 0 + devouring = TRUE + visible_message("[src] begins ripping apart and feasting on [lunch]!", \ + "We begin to feast upon [lunch]...") + if(!do_mob(src, 50, target = lunch)) + devouring = FALSE + return 0 + devouring = FALSE + visible_message("[src] tears a chunk from [lunch]'s flesh!", \ + "We tear a chunk of flesh from [lunch] and devour it!") + lunch.adjustBruteLoss(60) + lunch << "[src] tears into you!" + var/obj/effect/decal/cleanable/blood/gibs/G = new(get_turf(lunch)) + step(G, pick(alldirs)) //Make some gibs spray out for dramatic effect + playsound(lunch, 'sound/effects/splat.ogg', 50, 1) + if(!lunch.stat) + lunch.emote("scream") + if(lunch.disabilities & FAT) + adjustBruteLoss(-100) //Tasty leetle peegy + else + adjustBruteLoss(-50) + +/mob/living/simple_animal/hostile/true_changeling/verb/crawl() + set name = "Spine Crawl" + set desc = "We use our spines to gouge into terrain and crawl along it, negating gravity loss. This makes us very slow." + set category = "True Changeling" + + if(stat) + src << "We must be conscious to switch our method of movement!" + return 0 + wallcrawl = !wallcrawl + if(wallcrawl) + visible_message("[src] begins gouging its spines into the terrain!", \ + "We begin using our spines for movement.") + speed = 3 //Veeery slow + else + visible_message("[src] begins moving normally!", \ + "We return moving normally.") + speed = initial(speed) + +#undef TRUE_CHANGELING_REFORM_THRESHOLD +#undef TRUE_CHANGELING_PASSIVE_HEAL +#undef TRUE_CHANGELING_FORCED_REFORM diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index f0c670e6d9a..39c608a9caa 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -97,39 +97,39 @@ handle_automated_speech() return 1 -/mob/living/simple_animal/handle_regular_status_updates() - if(..()) //alive +/mob/living/simple_animal/update_stat() + if(status_flags & GODMODE) + return + if(stat != DEAD) if(health < 1) death() - return 0 - return 1 -/mob/living/simple_animal/handle_disabilities() - //Eyes - if(disabilities & BLIND || stat) - eye_blind = max(eye_blind, 1) - else - if(eye_blind) - eye_blind = 0 - if(eye_blurry) - eye_blurry = 0 - if(eye_stat) - eye_stat = 0 +/mob/living/simple_animal/adjust_blindness() + return - //Ears - if(disabilities & DEAF) - setEarDamage(-1, max(ear_deaf, 1)) - else if(ear_damage < 100) - setEarDamage(0, 0) +/mob/living/simple_animal/adjust_blurriness() + return + +/mob/living/simple_animal/set_blindness() + return + +/mob/living/simple_animal/set_blurriness() + return + +/mob/living/simple_animal/become_blind() + return + +/mob/living/simple_animal/setEarDamage() + return + +/mob/living/simple_animal/adjustEarDamage() + return /mob/living/simple_animal/handle_status_effects() ..() if(stuttering) stuttering = 0 - if(druggy) - druggy = 0 - /mob/living/simple_animal/proc/handle_automated_action() return @@ -388,7 +388,6 @@ /mob/living/simple_animal/Stat() ..() - if(statpanel("Status")) stat(null, "Health: [round((health / maxHealth) * 100)]%") return 1 @@ -532,4 +531,22 @@ /mob/living/simple_animal/proc/sentience_act() //Called when a simple animal gains sentience via gold slime potion - return \ No newline at end of file + return + +/mob/living/simple_animal/update_sight() + if(!client) + return + if(stat == DEAD) + sight = (SEE_TURFS|SEE_MOBS|SEE_OBJS) + see_in_dark = 8 + see_invisible = SEE_INVISIBLE_OBSERVER + return + + see_invisible = initial(see_invisible) + see_in_dark = initial(see_in_dark) + sight = initial(sight) + + if(client.eye != src) + var/atom/A = client.eye + if(A.update_remote_sight(src)) //returns 1 if we override all other sight updates. + return \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/slime/death.dm b/code/modules/mob/living/simple_animal/slime/death.dm index 31542c8051c..2f28d8b1359 100644 --- a/code/modules/mob/living/simple_animal/slime/death.dm +++ b/code/modules/mob/living/simple_animal/slime/death.dm @@ -24,8 +24,6 @@ overlays.len = 0 update_canmove() - if(blind) - blind.layer = 0 if(ticker && ticker.mode) ticker.mode.check_win() diff --git a/code/modules/mob/living/simple_animal/slime/life.dm b/code/modules/mob/living/simple_animal/slime/life.dm index 1774f2e592d..34ffe87fab6 100644 --- a/code/modules/mob/living/simple_animal/slime/life.dm +++ b/code/modules/mob/living/simple_animal/slime/life.dm @@ -148,10 +148,10 @@ temp_change = (temperature - current) return temp_change -/mob/living/simple_animal/slime/handle_regular_status_updates() - if(..()) - if(prob(30)) - adjustBruteLoss(-1) +/mob/living/simple_animal/slime/handle_status_effects() + ..() + if(prob(30)) + adjustBruteLoss(-1) /mob/living/simple_animal/slime/proc/handle_feeding() if(!ismob(buckled)) diff --git a/code/modules/mob/living/ventcrawling.dm b/code/modules/mob/living/ventcrawling.dm index 0cc06ce18ec..3178e8fb130 100644 --- a/code/modules/mob/living/ventcrawling.dm +++ b/code/modules/mob/living/ventcrawling.dm @@ -66,8 +66,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/components/unary return visible_message("[src] scrambles into the ventilation ducts!","You climb into the ventilation ducts.") - loc = vent_found - add_ventcrawl(vent_found) + forceMove(vent_found) else src << "This ventilation duct is not connected to anything!" @@ -86,11 +85,12 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/components/unary for(var/datum/pipeline/P in starting_machine.returnPipenets()) totalMembers += P.members totalMembers += P.other_atmosmch - + if(!totalMembers.len) return - for(var/obj/machinery/atmospherics/A in totalMembers) + for(var/X in totalMembers) + var/obj/machinery/atmospherics/A = X //all elements in totalMembers are necessarily of this type. if(!A.pipe_vision_img) A.pipe_vision_img = image(A, A.loc, layer = 20, dir = A.dir) //20 for being above darkness @@ -103,7 +103,6 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/components/unary if(client) for(var/image/current_image in pipes_shown) client.images -= current_image - client.eye = src pipes_shown.len = 0 diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index ed176d9aa3c..1a8abccc90c 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -27,24 +27,21 @@ player_list |= src update_Login_details() world.update_status() - - client.images = null //remove the images such as AIs being unable to see runes + + client.images = list() //remove the images such as AIs being unable to see runes client.screen = list() //remove hud items just in case - if(hud_used) qdel(hud_used) //remove the hud objects - hud_used = new /datum/hud(src) + + if(!hud_used) + create_mob_hud() + if(hud_used) + hud_used.show_hud(hud_used.hud_version) next_move = 1 - sight |= SEE_SELF ..() if (key != client.key) key = client.key - if(loc && !isturf(loc)) - client.eye = loc - client.perspective = EYE_PERSPECTIVE - else - client.eye = src - client.perspective = MOB_PERSPECTIVE + reset_perspective(loc) if(isobj(loc)) var/obj/Loc=loc diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm index 968b4f0c16c..77d6ca571ea 100644 --- a/code/modules/mob/logout.dm +++ b/code/modules/mob/logout.dm @@ -1,5 +1,6 @@ /mob/Logout() SStgui.on_logout(src) + unset_machine() player_list -= src log_access("Logout: [key_name(src)]") if(admin_datums[src.ckey]) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 3ece8a53fa3..f39dbc0c382 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -289,19 +289,24 @@ var/next_mob_id = 0 return 0 -/mob/proc/reset_view(atom/A) - if (client) - if (istype(A, /atom/movable)) +/mob/proc/reset_perspective(atom/A) + if(client) + if(istype(A, /atom/movable)) client.perspective = EYE_PERSPECTIVE client.eye = A else - if (isturf(loc)) + if(isturf(loc)) client.eye = client.mob client.perspective = MOB_PERSPECTIVE else client.perspective = EYE_PERSPECTIVE client.eye = loc - return + return 1 + +/mob/living/reset_perspective(atom/A) + if(..()) + update_sight() + update_vision_overlays() /mob/proc/show_inv(mob/user) @@ -360,8 +365,7 @@ var/next_mob_id = 0 src.pulling = AM AM.pulledby = src - if(pullin) - pullin.update_icon(src) + update_pull_hud_icon() if(ismob(AM)) var/mob/M = AM if(!iscarbon(src)) @@ -377,8 +381,12 @@ var/next_mob_id = 0 if(pulling) pulling.pulledby = null pulling = null - if(pullin) - pullin.update_icon(src) + update_pull_hud_icon() + +/mob/proc/update_pull_hud_icon() + if(client && hud_used) + if(hud_used.pull_icon) + hud_used.pull_icon.update_icon(src) /mob/verb/mode() set name = "Activate Held Object" @@ -535,15 +543,11 @@ var/next_mob_id = 0 if(client && mob_eye) client.eye = mob_eye - if (is_admin) - client.adminobs = 1 - if(mob_eye == client.mob || client.eye == client.mob) - client.adminobs = 0 /mob/verb/cancel_camera() set name = "Cancel Camera View" set category = "OOC" - reset_view(null) + reset_perspective(null) unset_machine() /mob/Topic(href, href_list) @@ -714,6 +718,9 @@ var/next_mob_id = 0 if(ko || resting || stunned) drop_r_hand() drop_l_hand() + unset_machine() + if(pulling) + stop_pulling() else lying = 0 canmove = 1 @@ -790,85 +797,96 @@ var/next_mob_id = 0 if(status_flags & CANSTUN) stunned = max(max(stunned,amount),0) //can't go below 0, getting a low amount of stun doesn't lower your current stun update_canmove() - return /mob/proc/SetStunned(amount) //if you REALLY need to set stun to a set amount without the whole "can't go below current stunned" if(status_flags & CANSTUN) stunned = max(amount,0) update_canmove() - return /mob/proc/AdjustStunned(amount) if(status_flags & CANSTUN) stunned = max(stunned + amount,0) update_canmove() - return /mob/proc/Weaken(amount, ignore_canweaken = 0) if(status_flags & CANWEAKEN || ignore_canweaken) weakened = max(max(weakened,amount),0) update_canmove() //updates lying, canmove and icons - return /mob/proc/SetWeakened(amount) if(status_flags & CANWEAKEN) weakened = max(amount,0) update_canmove() //updates lying, canmove and icons - return /mob/proc/AdjustWeakened(amount) if(status_flags & CANWEAKEN) weakened = max(weakened + amount,0) update_canmove() //updates lying, canmove and icons - return /mob/proc/Paralyse(amount) if(status_flags & CANPARALYSE) + var/old_paralysis = paralysis paralysis = max(max(paralysis,amount),0) - update_canmove() - return + if((!old_paralysis && paralysis) || (old_paralysis && !paralysis)) + update_stat() /mob/proc/SetParalysis(amount) if(status_flags & CANPARALYSE) + var/old_paralysis = paralysis paralysis = max(amount,0) - update_canmove() - return + if((!old_paralysis && paralysis) || (old_paralysis && !paralysis)) + update_stat() /mob/proc/AdjustParalysis(amount) if(status_flags & CANPARALYSE) + var/old_paralysis = paralysis paralysis = max(paralysis + amount,0) - update_canmove() - return + if((!old_paralysis && paralysis) || (old_paralysis && !paralysis)) + update_stat() -/mob/proc/Sleeping(amount) +/mob/proc/Sleeping(amount, updating_stat = 1) + var/old_sleeping = sleeping sleeping = max(max(sleeping,amount),0) - update_canmove() - return + if(!old_sleeping && sleeping) + throw_alert("asleep", /obj/screen/alert/asleep) + if(updating_stat) + update_stat() + else if(old_sleeping && !sleeping) + clear_alert("asleep") + if(updating_stat) + update_stat() /mob/proc/SetSleeping(amount) + var/old_sleeping = sleeping sleeping = max(amount,0) - update_canmove() - return + if(!old_sleeping && sleeping) + throw_alert("asleep", /obj/screen/alert/asleep) + update_stat() + else if(old_sleeping && !sleeping) + clear_alert("asleep") + update_stat() /mob/proc/AdjustSleeping(amount) + var/old_sleeping = sleeping sleeping = max(sleeping + amount,0) - update_canmove() - return + if(!old_sleeping && sleeping) + throw_alert("asleep", /obj/screen/alert/asleep) + update_stat() + else if(old_sleeping && !sleeping) + clear_alert("asleep") + update_stat() /mob/proc/Resting(amount) resting = max(max(resting,amount),0) update_canmove() - return /mob/proc/SetResting(amount) resting = max(amount,0) update_canmove() - return /mob/proc/AdjustResting(amount) resting = max(resting + amount,0) update_canmove() - return /mob/proc/assess_threat() //For sec bot threat assessment return @@ -981,4 +999,10 @@ var/next_mob_id = 0 for(var/F in faction) if(F in target.faction) return 1 - return 0 \ No newline at end of file + return 0 + +/mob/proc/update_stat() + return + +/mob/proc/update_health_hud() + return \ No newline at end of file diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 158183b0e46..99a5e26cb68 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -11,14 +11,7 @@ var/stat = 0 //Whether a mob is alive or dead. TODO: Move this to living - Nodrak var/obj/screen/flash = null - var/obj/screen/blind = null var/obj/screen/hands = null - var/obj/screen/pullin = null - var/obj/screen/internals = null - var/obj/screen/i_select = null - var/obj/screen/m_select = null - var/obj/screen/healths = null - var/obj/screen/throw_icon = null var/obj/screen/damageoverlay = null /*A bunch of this stuff really needs to go under their own defines instead of being globally attached to mob. A variable should only be globally attached to turfs/objects/whatever, when it is in fact needed as such. @@ -26,8 +19,7 @@ I'll make some notes on where certain variable defines should probably go. Changing this around would probably require a good look-over the pre-existing code. */ - var/obj/screen/zone_sel/zone_sel = null - var/obj/screen/healthdoll = null + var/zone_selected = null var/damageoverlaytemp = 0 var/computer_id = null @@ -46,7 +38,7 @@ var/eye_blurry = 0 //Carbon var/ear_deaf = 0 //Carbon var/ear_damage = 0 //Carbon - var/stuttering = null //Carbon + var/stuttering = 0 //Carbon var/slurring = 0 //Carbon var/real_name = null var/druggy = 0 //Carbon @@ -56,7 +48,7 @@ var/lying = 0 var/lying_prev = 0 var/canmove = 1 - var/eye_stat = null//Living, potentially Carbon + var/eye_stat = 0//Living, potentially Carbon var/lastpuke = 0 var/name_archive //For admin things like possession @@ -142,11 +134,9 @@ var/obj/control_object //Used by admins to possess objects. All mobs should have this var var/atom/movable/remote_control //Calls relaymove() to whatever it is - var/remote_view = 0 // Set to 1 to prevent view resets on Life var/turf/listed_turf = null //the current turf being examined in the stat panel var/list/permanent_huds = list() - var/permanent_sight_flags = 0 var/resize = 1 //Badminnery resize \ No newline at end of file diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 0b51dc021d1..4854fab14de 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -260,10 +260,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp a_intent = intent_numeric(intent_numeric(a_intent) - 3) if(hud_used && hud_used.action_intent) - if(a_intent == "harm") - hud_used.action_intent.icon_state = "harm" - else - hud_used.action_intent.icon_state = "help" + hud_used.action_intent.icon_state = "[a_intent]" /proc/is_blind(A) if(ismob(A)) @@ -350,7 +347,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp A.overlays += alert_overlay /proc/item_heal_robotic(mob/living/carbon/human/H, mob/user, brute, burn) - var/obj/item/organ/limb/affecting = H.get_organ(check_zone(user.zone_sel.selecting)) + var/obj/item/organ/limb/affecting = H.get_organ(check_zone(user.zone_selected)) var/dam //changes repair text based on how much brute/burn was supplied diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 82f40f51a3a..75a2dcd34d8 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -9,7 +9,7 @@ invisibility = 101 density = 0 - stat = 2 + stat = DEAD canmove = 0 anchored = 1 // don't get pushed around diff --git a/code/modules/mob/update_icons.dm b/code/modules/mob/update_icons.dm index 13ec3f05463..b14056f4186 100644 --- a/code/modules/mob/update_icons.dm +++ b/code/modules/mob/update_icons.dm @@ -7,9 +7,6 @@ /mob/proc/update_icons() return -/mob/proc/update_hud() - return - /mob/proc/update_transform() return diff --git a/code/modules/ninja/ninja_event.dm b/code/modules/ninja/ninja_event.dm index e4b60e7d420..e4ee6ed3275 100644 --- a/code/modules/ninja/ninja_event.dm +++ b/code/modules/ninja/ninja_event.dm @@ -124,8 +124,7 @@ Contents: N.randomize_param() Ninja.internal = Ninja.s_store - if(Ninja.internals) - Ninja.internals.icon_state = "internal1" + Ninja.update_internals_hud_icon(1) if(Ninja.mind != Mind) //something has gone wrong! throw EXCEPTION("Ninja created with incorrect mind") diff --git a/code/modules/ninja/suit/n_suit_verbs/ninja_adrenaline.dm b/code/modules/ninja/suit/n_suit_verbs/ninja_adrenaline.dm index 8487a3c2d47..b77c67970e8 100644 --- a/code/modules/ninja/suit/n_suit_verbs/ninja_adrenaline.dm +++ b/code/modules/ninja/suit/n_suit_verbs/ninja_adrenaline.dm @@ -14,7 +14,6 @@ H.SetStunned(0) H.SetWeakened(0) - H.stat = 0//At least now you should be able to teleport away or shoot ninja stars. spawn(30)//Slight delay so the enemy does not immedietly know the ability was used. Due to lag, this often came before waking up. H.say(pick("A CORNERED FOX IS MORE DANGEROUS THAN A JACKAL!","HURT ME MOOORRREEE!","IMPRESSIVE!")) spawn(70) diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 4accdee71a2..32a1777ede3 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -79,6 +79,7 @@ if(H.disabilities & CLUMSY && prob(25)) H << "You cut yourself on the paper! Ahhhh! Ahhhhh!" H.damageoverlaytemp = 9001 + H.update_damage_hud() return var/n_name = stripped_input(usr, "What would you like to label the paper?", "Paper Labelling", null, MAX_NAME_LEN) if((loc == usr && usr.stat == 0)) diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 9a021cd1b4e..30cf438ba8e 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -517,7 +517,7 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list ( \ if(!istype(H)) return ..() - var/obj/item/organ/limb/affecting = H.get_organ(check_zone(user.zone_sel.selecting)) + var/obj/item/organ/limb/affecting = H.get_organ(check_zone(user.zone_selected)) if(affecting.status == ORGAN_ROBOTIC) user.visible_message("[user] starts to fix some of the wires in [H]'s [affecting.getDisplayName()].", "You start fixing some of the wires in [H]'s [affecting.getDisplayName()].") if(!do_mob(user, H, 50)) return diff --git a/code/modules/projectiles/firing.dm b/code/modules/projectiles/firing.dm index 507a224cc35..713a67c367b 100644 --- a/code/modules/projectiles/firing.dm +++ b/code/modules/projectiles/firing.dm @@ -23,7 +23,7 @@ if (zone_override) BB.def_zone = zone_override else - BB.def_zone = user.zone_sel.selecting + BB.def_zone = user.zone_selected BB.suppressed = quiet if(reagents && BB.reagents) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 6d6a36df584..0e0a0a7f95f 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -135,7 +135,7 @@ return if(!ismob(target) || user.a_intent == "harm") //melee attack return - if(user.zone_sel.selecting == "mouth") + if(user.zone_selected == "mouth") handle_suicide(user, target, params) return if(target == user) //so we can't shoot ourselves (unless mouth selected) @@ -406,7 +406,7 @@ obj/item/weapon/gun/proc/newshot() semicd = 1 - if(!do_mob(user, target, 120) || user.zone_sel.selecting != "mouth") + if(!do_mob(user, target, 120) || user.zone_selected != "mouth") if(user) if(user == target) user.visible_message("[user] decided life was worth living.") diff --git a/code/modules/projectiles/guns/projectile/revolver.dm b/code/modules/projectiles/guns/projectile/revolver.dm index e14e31baeef..585f488cde9 100644 --- a/code/modules/projectiles/guns/projectile/revolver.dm +++ b/code/modules/projectiles/guns/projectile/revolver.dm @@ -236,7 +236,7 @@ var/obj/item/ammo_casing/AC = chambered if(AC.fire(user, user)) playsound(user, fire_sound, 50, 1) - var/obj/item/organ/limb/affecting = H.get_organ(check_zone(user.zone_sel.selecting)) + var/obj/item/organ/limb/affecting = H.get_organ(check_zone(user.zone_selected)) var/limb_name = affecting.getDisplayName() if(affecting.name == "head" || affecting.name == "eyes" || affecting.name == "mouth") user.apply_damage(300, BRUTE, affecting) diff --git a/code/modules/projectiles/guns/projectile/sniper.dm b/code/modules/projectiles/guns/projectile/sniper.dm index f1690cbbfc0..d131da991ca 100644 --- a/code/modules/projectiles/guns/projectile/sniper.dm +++ b/code/modules/projectiles/guns/projectile/sniper.dm @@ -97,7 +97,7 @@ /obj/item/projectile/bullet/sniper/soporific/on_hit(atom/target, blocked = 0, hit_zone) if((blocked != 100) && istype(target, /mob/living)) var/mob/living/L = target - L.SetSleeping(20) + L.Sleeping(20) return ..() diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index e26987c1e31..cf8f44beede 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -235,24 +235,25 @@ var/const/INJECT = 5 //injection continue if(!M) M = R.holder.my_atom - if(M && R) - if(M.reagent_check(R) != 1) - if(can_overdose) - if(R.overdose_threshold) - if(R.volume >= R.overdose_threshold && !R.overdosed) - R.overdosed = 1 - R.overdose_start(M) - if(R.addiction_threshold) - if(R.volume >= R.addiction_threshold && !is_type_in_list(R, addiction_list)) - var/datum/reagent/new_reagent = new R.type() - addiction_list.Add(new_reagent) - if(R.overdosed) - R.overdose_process(M) - if(is_type_in_list(R,addiction_list)) - for(var/datum/reagent/addicted_reagent in addiction_list) - if(istype(R, addicted_reagent)) - addicted_reagent.addiction_stage = -15 // you're satisfied for a good while. - R.on_mob_life(M) + if(!M || M == DEAD || !R) + break + if(M.reagent_check(R) != 1) + if(can_overdose) + if(R.overdose_threshold) + if(R.volume >= R.overdose_threshold && !R.overdosed) + R.overdosed = 1 + R.overdose_start(M) + if(R.addiction_threshold) + if(R.volume >= R.addiction_threshold && !is_type_in_list(R, addiction_list)) + var/datum/reagent/new_reagent = new R.type() + addiction_list.Add(new_reagent) + if(R.overdosed) + R.overdose_process(M) + if(is_type_in_list(R,addiction_list)) + for(var/datum/reagent/addicted_reagent in addiction_list) + if(istype(R, addicted_reagent)) + addicted_reagent.addiction_stage = -15 // you're satisfied for a good while. + R.on_mob_life(M) if(can_overdose) if(addiction_tick == 6) diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm index f3383ccf9f1..b87b51929c7 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm @@ -81,7 +81,7 @@ /datum/reagent/consumable/ethanol/kahlua/on_mob_life(mob/living/M) M.dizziness = max(0,M.dizziness-5) M.drowsyness = max(0,M.drowsyness-3) - M.sleeping = max(0,M.sleeping-2) + M.AdjustSleeping(-2) M.Jitter(5) ..() return @@ -103,7 +103,7 @@ /datum/reagent/consumable/ethanol/thirteenloko/on_mob_life(mob/living/M) M.drowsyness = max(0,M.drowsyness-7) - M.sleeping = max(0,M.sleeping-2) + M.AdjustSleeping(-2) if (M.bodytemperature > 310) M.bodytemperature = max(310, M.bodytemperature - (5 * TEMPERATURE_DAMAGE_COEFFICIENT)) M.Jitter(5) @@ -144,9 +144,8 @@ boozepwr = 15 /datum/reagent/consumable/ethanol/threemileisland/on_mob_life(mob/living/M) - M.druggy = max(M.druggy, 50) + M.set_drugginess(50) ..() - return /datum/reagent/consumable/ethanol/gin name = "Gin" @@ -399,7 +398,7 @@ boozepwr = 15 /datum/reagent/consumable/ethanol/manhattan_proj/on_mob_life(mob/living/M) - M.druggy = max(M.druggy, 30) + M.set_drugginess(30) ..() return diff --git a/code/modules/reagents/chemistry/reagents/blob_reagents.dm b/code/modules/reagents/chemistry/reagents/blob_reagents.dm index ebb389a9482..c8dffb05732 100644 --- a/code/modules/reagents/chemistry/reagents/blob_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/blob_reagents.dm @@ -147,7 +147,7 @@ /datum/reagent/blob/hallucinogenic_nectar/reaction_mob(mob/living/M, method=TOUCH, reac_volume) reac_volume = ..() M.hallucination += 0.6*reac_volume - M.druggy += 0.6*reac_volume + M.adjust_drugginess(0.6*reac_volume) if(M.reagents) M.reagents.add_reagent("spore", 0.2*reac_volume) if(M) diff --git a/code/modules/reagents/chemistry/reagents/drink_reagents.dm b/code/modules/reagents/chemistry/reagents/drink_reagents.dm index ae26a8a1802..d99f783f316 100644 --- a/code/modules/reagents/chemistry/reagents/drink_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drink_reagents.dm @@ -47,14 +47,14 @@ color = "#973800" // rgb: 151, 56, 0 /datum/reagent/consumable/carrotjuice/on_mob_life(mob/living/M) - M.eye_blurry = max(M.eye_blurry-1 , 0) - M.eye_blind = max(M.eye_blind-1 , 0) + M.adjust_blurriness(-1) + M.adjust_blindness(-1) switch(current_cycle) if(1 to 20) //nothing if(21 to INFINITY) - if (prob(current_cycle-10)) - M.disabilities &= ~NEARSIGHT + if(prob(current_cycle-10)) + M.cure_nearsighted() ..() return @@ -174,7 +174,7 @@ /datum/reagent/consumable/coffee/on_mob_life(mob/living/M) M.dizziness = max(0,M.dizziness-5) M.drowsyness = max(0,M.drowsyness-3) - M.sleeping = max(0,M.sleeping - 2) + M.AdjustSleeping(-2) if (M.bodytemperature < 310)//310 is the normal bodytemp. 310.055 M.bodytemperature = min(310, M.bodytemperature + (25 * TEMPERATURE_DAMAGE_COEFFICIENT)) if(holder.has_reagent("frostoil")) @@ -192,7 +192,7 @@ M.dizziness = max(0,M.dizziness-2) M.drowsyness = max(0,M.drowsyness-1) M.jitteriness = max(0,M.jitteriness-3) - M.sleeping = max(0,M.sleeping-1) + M.AdjustSleeping(-1) if(M.getToxLoss() && prob(20)) M.adjustToxLoss(-1) if (M.bodytemperature < 310) //310 is the normal bodytemp. 310.055 @@ -210,7 +210,7 @@ /datum/reagent/consumable/icecoffee/on_mob_life(mob/living/M) M.dizziness = max(0,M.dizziness-5) M.drowsyness = max(0,M.drowsyness-3) - M.sleeping = max(0,M.sleeping-2) + M.AdjustSleeping(-2) if (M.bodytemperature > 310)//310 is the normal bodytemp. 310.055 M.bodytemperature = max(310, M.bodytemperature - (5 * TEMPERATURE_DAMAGE_COEFFICIENT)) M.Jitter(5) @@ -227,7 +227,7 @@ /datum/reagent/consumable/icetea/on_mob_life(mob/living/M) M.dizziness = max(0,M.dizziness-2) M.drowsyness = max(0,M.drowsyness-1) - M.sleeping = max(0,M.sleeping-2) + M.AdjustSleeping(-2) if(M.getToxLoss() && prob(20)) M.adjustToxLoss(-1) if (M.bodytemperature > 310)//310 is the normal bodytemp. 310.055 @@ -256,10 +256,10 @@ /datum/reagent/consumable/nuka_cola/on_mob_life(mob/living/M) M.Jitter(20) - M.druggy = max(M.druggy, 30) + M.set_drugginess(30) M.dizziness +=5 M.drowsyness = 0 - M.sleeping = max(0,M.sleeping-2) + M.AdjustSleeping(-2) M.status_flags |= GOTTAGOFAST if (M.bodytemperature > 310)//310 is the normal bodytemp. 310.055 M.bodytemperature = max(310, M.bodytemperature - (5 * TEMPERATURE_DAMAGE_COEFFICIENT)) @@ -274,12 +274,11 @@ /datum/reagent/consumable/spacemountainwind/on_mob_life(mob/living/M) M.drowsyness = max(0,M.drowsyness-7) - M.sleeping = max(0,M.sleeping-1) + M.AdjustSleeping(-1) if (M.bodytemperature > 310) M.bodytemperature = max(310, M.bodytemperature - (5 * TEMPERATURE_DAMAGE_COEFFICIENT)) M.Jitter(5) ..() - return /datum/reagent/consumable/dr_gibb name = "Dr. Gibb" @@ -341,7 +340,7 @@ /datum/reagent/consumable/tonic/on_mob_life(mob/living/M) M.dizziness = max(0,M.dizziness-5) M.drowsyness = max(0,M.drowsyness-3) - M.sleeping = max(0,M.sleeping-2) + M.AdjustSleeping(-2) if (M.bodytemperature > 310) M.bodytemperature = max(310, M.bodytemperature - (5 * TEMPERATURE_DAMAGE_COEFFICIENT)) ..() @@ -368,7 +367,7 @@ /datum/reagent/consumable/soy_latte/on_mob_life(mob/living/M) M.dizziness = max(0,M.dizziness-5) M.drowsyness = max(0,M.drowsyness-3) - M.sleeping = 0 + M.SetSleeping(0) if (M.bodytemperature < 310)//310 is the normal bodytemp. 310.055 M.bodytemperature = min(310, M.bodytemperature + (5 * TEMPERATURE_DAMAGE_COEFFICIENT)) M.Jitter(5) @@ -386,7 +385,7 @@ /datum/reagent/consumable/cafe_latte/on_mob_life(mob/living/M) M.dizziness = max(0,M.dizziness-5) M.drowsyness = max(0,M.drowsyness-3) - M.sleeping = 0 + M.SetSleeping(0) if (M.bodytemperature < 310)//310 is the normal bodytemp. 310.055 M.bodytemperature = min(310, M.bodytemperature + (5 * TEMPERATURE_DAMAGE_COEFFICIENT)) M.Jitter(5) @@ -486,7 +485,7 @@ color = "#666300" // rgb: 102, 99, 0 /datum/reagent/consumable/atomicbomb/on_mob_life(mob/living/M) - M.druggy = max(M.druggy, 50) + M.set_drugginess(50) M.confused = max(M.confused+2,0) M.Dizzy(10) if (!M.slurring) @@ -494,9 +493,9 @@ M.slurring += 3 switch(current_cycle) if(51 to 200) - M.sleeping += 1 + M.AdjustSleeping(1) if(201 to INFINITY) - M.sleeping += 1 + M.AdjustSleeping(1) M.adjustToxLoss(2) ..() return @@ -518,7 +517,7 @@ if(prob(50)) M.confused = max(M.confused+3,0) if(55 to 200) - M.druggy = max(M.druggy, 55) + M.set_drugginess(55) if(200 to INFINITY) M.adjustToxLoss(2) ..() @@ -542,7 +541,7 @@ if(prob(50)) M.confused = max(M.confused+3,0) if(55 to 200) - M.druggy = max(M.druggy, 55) + M.set_drugginess(55) if(200 to INFINITY) M.adjustToxLoss(2) ..() @@ -557,30 +556,33 @@ metabolization_rate = 0.2 * REAGENTS_METABOLISM /datum/reagent/consumable/hippies_delight/on_mob_life(mob/living/M) - M.druggy = max(M.druggy, 50) + if (!M.slurring) + M.slurring = 1 switch(current_cycle) if(1 to 5) - if (!M.slurring) M.slurring = 1 M.Dizzy(10) - if(prob(10)) M.emote(pick("twitch","giggle")) + M.set_drugginess(30) + if(prob(10)) + M.emote(pick("twitch","giggle")) if(5 to 10) - if (!M.slurring) M.slurring = 1 M.Jitter(20) M.Dizzy(20) - M.druggy = max(M.druggy, 45) - if(prob(20)) M.emote(pick("twitch","giggle")) + M.set_drugginess(45) + if(prob(20)) + M.emote(pick("twitch","giggle")) if (10 to 200) - if (!M.slurring) M.slurring = 1 M.Jitter(40) M.Dizzy(40) - M.druggy = max(M.druggy, 60) - if(prob(30)) M.emote(pick("twitch","giggle")) + M.set_drugginess(60) + if(prob(30)) + M.emote(pick("twitch","giggle")) if(200 to INFINITY) - if (!M.slurring) M.slurring = 1 M.Jitter(60) M.Dizzy(60) - M.druggy = max(M.druggy, 75) - if(prob(40)) M.emote(pick("twitch","giggle")) - if(prob(30)) M.adjustToxLoss(2) + M.set_drugginess(75) + if(prob(40)) + M.emote(pick("twitch","giggle")) + if(prob(30)) + M.adjustToxLoss(2) ..() return diff --git a/code/modules/reagents/chemistry/reagents/drug_reagents.dm b/code/modules/reagents/chemistry/reagents/drug_reagents.dm index df33fc5c594..a19a67aaf36 100644 --- a/code/modules/reagents/chemistry/reagents/drug_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drug_reagents.dm @@ -13,14 +13,13 @@ overdose_threshold = 30 /datum/reagent/drug/space_drugs/on_mob_life(mob/living/M) - M.druggy = max(M.druggy, 15) + M.set_drugginess(15) if(isturf(M.loc) && !istype(M.loc, /turf/space)) if(M.canmove) if(prob(10)) step(M, pick(cardinal)) if(prob(7)) M.emote(pick("twitch","drool","moan","giggle")) ..() - return /datum/reagent/drug/space_drugs/overdose_start(mob/living/M) M << "You start tripping hard!" @@ -30,7 +29,6 @@ if(M.hallucination < volume && prob(20)) M.hallucination += 5 ..() - return /datum/reagent/drug/nicotine name = "Nicotine" diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm index 9f73634deea..f14bf7e2de7 100644 --- a/code/modules/reagents/chemistry/reagents/food_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm @@ -58,13 +58,11 @@ /datum/reagent/consumable/sugar/overdose_start(mob/living/M) M << "You go into hyperglycaemic shock! Lay off the twinkies!" - M.sleeping += 30 - return + M.AdjustSleeping(30) /datum/reagent/consumable/sugar/overdose_process(mob/living/M) - M.sleeping += 3 + M.AdjustSleeping(3) ..() - return /datum/reagent/consumable/virus_food name = "Virus Food" @@ -204,26 +202,27 @@ else if ( mouth_covered ) // Reduced effects if partially protected if(prob(5)) victim.emote("scream") - victim.eye_blurry = max(M.eye_blurry, 3) - victim.eye_blind = max(M.eye_blind, 1) + victim.adjust_blurriness(3) + victim.adjust_blindness(1) victim.confused = max(M.confused, 3) victim.damageoverlaytemp = 60 victim.Weaken(3) victim.drop_item() return else if ( eyes_covered ) // Eye cover is better than mouth cover - victim.eye_blurry = max(M.eye_blurry, 3) + victim.adjust_blurriness(3) victim.damageoverlaytemp = 30 return else // Oh dear :D if(prob(5)) victim.emote("scream") - victim.eye_blurry = max(M.eye_blurry, 5) - victim.eye_blind = max(M.eye_blind, 2) + victim.adjust_blurriness(5) + victim.adjust_blindness(2) victim.confused = max(M.confused, 6) victim.damageoverlaytemp = 75 victim.Weaken(5) victim.drop_item() + victim.update_damage_hud() /datum/reagent/consumable/condensedcapsaicin/on_mob_life(mob/living/M) if(prob(5)) @@ -264,7 +263,6 @@ if (M.bodytemperature < 310)//310 is the normal bodytemp. 310.055 M.bodytemperature = min(310, M.bodytemperature + (5 * TEMPERATURE_DAMAGE_COEFFICIENT)) ..() - return /datum/reagent/mushroomhallucinogen name = "Mushroom Hallucinogen" @@ -274,32 +272,27 @@ metabolization_rate = 0.2 * REAGENTS_METABOLISM /datum/reagent/mushroomhallucinogen/on_mob_life(mob/living/M) - M.druggy = max(M.druggy, 30) + if(!M.slurring) + M.slurring = 1 switch(current_cycle) if(1 to 5) - if (!M.slurring) - M.slurring = 1 M.Dizzy(5) + M.set_drugginess(30) if(prob(10)) M.emote(pick("twitch","giggle")) if(5 to 10) - if (!M.slurring) - M.slurring = 1 M.Jitter(10) M.Dizzy(10) - M.druggy = max(M.druggy, 35) + M.set_drugginess(35) if(prob(20)) M.emote(pick("twitch","giggle")) if (10 to INFINITY) - if (!M.slurring) - M.slurring = 1 M.Jitter(20) M.Dizzy(20) - M.druggy = max(M.druggy, 40) + M.set_drugginess(40) if(prob(30)) M.emote(pick("twitch","giggle")) ..() - return /datum/reagent/consumable/sprinkles name = "Sprinkles" diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 5b0c8459bbc..bc3925b9522 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -42,8 +42,8 @@ M.hallucination = 0 M.setBrainLoss(0) M.disabilities = 0 - M.eye_blurry = 0 - M.eye_blind = 0 + M.set_blurriness(0) + M.set_blindness(0) M.SetWeakened(0) M.SetStunned(0) M.SetParalysis(0) @@ -53,7 +53,7 @@ M.stuttering = 0 M.slurring = 0 M.confused = 0 - M.sleeping = 0 + M.SetSleeping(0) M.jitteriness = 0 for(var/datum/disease/D in M.viruses) if(D.severity == NONTHREAT) @@ -527,9 +527,8 @@ if(current_cycle >= 12 && current_cycle < 24) M.drowsyness += 1 else if(current_cycle >= 24) - M.sleeping += 1 + M.AdjustSleeping(1) ..() - return /datum/reagent/medicine/morphine/overdose_process(mob/living/M) if(prob(33)) @@ -539,7 +538,6 @@ M.Dizzy(2) M.Jitter(2) ..() - return /datum/reagent/medicine/morphine/addiction_act_stage1(mob/living/M) if(prob(33)) @@ -549,7 +547,7 @@ M.Dizzy(2) M.Jitter(2) ..() - return + /datum/reagent/medicine/morphine/addiction_act_stage2(mob/living/M) if(prob(33)) var/obj/item/I = M.get_active_hand() @@ -593,21 +591,20 @@ if(M.disabilities & BLIND) if(prob(20)) M << "Your vision slowly returns..." - M.disabilities &= ~BLIND - M.disabilities &= NEARSIGHT - M.eye_blurry = 35 + M.cure_blind() + M.cure_nearsighted() + M.set_blurriness(35) else if(M.disabilities & NEARSIGHT) M << "The blackness in your peripheral vision fades." - M.disabilities &= ~NEARSIGHT - M.eye_blurry = 10 + M.cure_nearsighted() + M.set_blurriness(10) else if(M.eye_blind || M.eye_blurry) - M.eye_blind = 0 - M.eye_blurry = 0 + M.set_blindness(0) + M.set_blurriness(0) else if(M.eye_stat > 0) - M.eye_stat -= 1 - M.eye_stat = Clamp(M.eye_stat, 0, INFINITY) + M.adjust_eye_stat(-1) ..() return @@ -698,13 +695,15 @@ spawn (100) //so the ghost has time to re-enter return else - M.stat = 1 M.adjustOxyLoss(-20) M.adjustToxLoss(-20) - dead_mob_list -= M - living_mob_list |= list(M) - M.emote("gasp") - add_logs(M, M, "revived", src) + if(M.health > config.health_threshold_dead && M.getorgan(/obj/item/organ/internal/brain)) + M.stat = UNCONSCIOUS + M.set_blindness(1) + dead_mob_list -= M + living_mob_list |= list(M) + M.emote("gasp") + add_logs(M, M, "revived", src) ..() return @@ -827,7 +826,7 @@ /datum/reagent/medicine/insulin/on_mob_life(mob/living/M) if(M.sleeping) - M.sleeping-- + M.AdjustSleeping(-1) M.reagents.remove_reagent("sugar", 3) ..() return diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm index b002165be98..be59ae5410c 100644 --- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm @@ -225,10 +225,9 @@ /datum/reagent/toxin/spore/on_mob_life(mob/living/M) M.damageoverlaytemp = 60 - M.eye_blurry = max(M.eye_blurry, 3) + M.update_damage_hud() + M.set_blurriness(max(M.eye_blurry, 3)) ..() - return - /datum/reagent/toxin/spore_burning name = "Burning Spore Toxin" @@ -257,9 +256,9 @@ M.confused += 2 M.drowsyness += 2 if(10 to 50) - M.sleeping += 1 + M.AdjustSleeping(1) if(51 to INFINITY) - M.sleeping += 1 + M.AdjustSleeping(1) M.adjustToxLoss((current_cycle - 50)*REM) ..() return @@ -274,12 +273,11 @@ /datum/reagent/toxin/beer2/on_mob_life(mob/living/M) switch(current_cycle) if(1 to 50) - M.sleeping += 1 + M.AdjustSleeping(1) if(51 to INFINITY) - M.sleeping += 1 + M.AdjustSleeping(1) M.adjustToxLoss((current_cycle - 50)*REM) ..() - return /datum/reagent/toxin/coffeepowder name = "Coffee Grounds" @@ -349,7 +347,7 @@ switch(pick(1, 2, 3, 4)) if(1) M << "You can barely see!" - M.eye_blurry = 3 + M.set_blurriness(max(M.eye_blurry, 3)) if(2) M.emote("cough") if(3) @@ -414,7 +412,7 @@ M.adjustBrainLoss(1*REM) M.adjustToxLoss(1*REM) if(current_cycle >= 18) - M.sleeping += 1 + M.AdjustSleeping(1) ..() /datum/reagent/toxin/cyanide @@ -515,7 +513,7 @@ /datum/reagent/toxin/pancuronium/on_mob_life(mob/living/M) if(current_cycle >= 10) - M.SetParalysis(1) + M.Paralyse(1) if(prob(20)) M.losebreath += 4 ..() @@ -531,7 +529,7 @@ /datum/reagent/toxin/sodium_thiopental/on_mob_life(mob/living/M) if(current_cycle >= 10) - M.sleeping += 1 + M.AdjustSleeping(1) M.adjustStaminaLoss(10*REM) ..() @@ -546,7 +544,7 @@ /datum/reagent/toxin/sulfonal/on_mob_life(mob/living/M) if(current_cycle >= 22) - M.sleeping += 1 + M.AdjustSleeping(1) ..() /datum/reagent/toxin/amanitin diff --git a/code/modules/recycling/disposal-structures.dm b/code/modules/recycling/disposal-structures.dm index d818c88567c..96a6760e2e5 100644 --- a/code/modules/recycling/disposal-structures.dm +++ b/code/modules/recycling/disposal-structures.dm @@ -26,20 +26,16 @@ //Check for any living mobs trigger hasmob. //hasmob effects whether the package goes to cargo or its tagged destination. for(var/mob/living/M in D) - if(M && M.stat != DEAD) - if(M.client) - M.client.eye = src - hasmob = 1 + if(M.client) + M.reset_perspective(src) + hasmob = 1 //Checks 1 contents level deep. This means that players can be sent through disposals... //...but it should require a second person to open the package. (i.e. person inside a wrapped locker) for(var/obj/O in D) if(O.contents) for(var/mob/living/M in O.contents) - if(M && M.stat != DEAD) - if(M.client) - M.client.eye = src - hasmob = 1 + hasmob = 1 // now everything inside the disposal gets put into the holder // note AM since can contain mobs or objs @@ -106,8 +102,7 @@ AM.loc = src // move everything in other holder to this one if(ismob(AM)) var/mob/M = AM - if(M.client) // if a client mob, update eye to follow this holder - M.client.eye = src + M.reset_perspective(src) // if a client mob, update eye to follow this holder qdel(other) @@ -191,7 +186,7 @@ // this is unlikely, but just dump out everything into the turf in case for(var/atom/movable/AM in H) - AM.loc = T + AM.forceMove(src.loc) AM.pipe_eject(0) qdel(H) return ..() @@ -276,7 +271,7 @@ playsound(src, 'sound/machines/hiss.ogg', 50, 0, 0) if(H) for(var/atom/movable/AM in H) - AM.loc = T + AM.forceMove(src.loc) AM.pipe_eject(direction) AM.throw_at_fast(target, 10, 1) @@ -286,8 +281,7 @@ if(H) for(var/atom/movable/AM in H) target = get_offset_target_turf(T, rand(5)-rand(5), rand(5)-rand(5)) - - AM.loc = T + AM.forceMove(src.loc) AM.pipe_eject(0) AM.throw_at_fast(target, 5, 1) H.vent_gas(T) @@ -316,7 +310,7 @@ // this is unlikely, but just dump out everything into the turf in case for(var/atom/movable/AM in H) - AM.loc = T + AM.forceMove(src.loc) AM.pipe_eject(0) qdel(H) return @@ -794,9 +788,10 @@ sleep(20) if(H) for(var/atom/movable/AM in H) - AM.loc = src.loc + AM.forceMove(src.loc) AM.pipe_eject(dir) AM.throw_at_fast(target, eject_range, 1) + H.vent_gas(src.loc) qdel(H) return @@ -842,14 +837,6 @@ /atom/movable/proc/pipe_eject(direction) return -// check if mob has client, if so restore client view on eject -/mob/pipe_eject(var/direction) - if (src.client) - src.client.perspective = MOB_PERSPECTIVE - src.client.eye = src - - return - /obj/effect/decal/cleanable/blood/gibs/pipe_eject(direction) var/list/dirs if(direction) diff --git a/code/modules/recycling/disposal-unit.dm b/code/modules/recycling/disposal-unit.dm index ed95abc4232..f8b0c5b9aa4 100644 --- a/code/modules/recycling/disposal-unit.dm +++ b/code/modules/recycling/disposal-unit.dm @@ -123,10 +123,7 @@ if(do_mob(user, target, 20)) if (!loc) return - if (target.client) - target.client.perspective = EYE_PERSPECTIVE - target.client.eye = src - target.loc = src + target.forceMove(src) if(user == target) user.visible_message("[user] climbs into [src].", \ "You climb into [src].") @@ -157,10 +154,8 @@ // leave the disposal /obj/machinery/disposal/proc/go_out(mob/user) - if (user.client) - user.client.eye = user.client.mob - user.client.perspective = MOB_PERSPECTIVE user.loc = src.loc + user.reset_perspective(null) update() return @@ -485,6 +480,9 @@ update() return +/obj/machinery/disposal/bin/get_vision_impairments(mob/user) + return global_hud.darkMask + //Delivery Chute @@ -524,7 +522,7 @@ if(prob(2)) // to prevent mobs being stuck in infinite loops M << "You hit the edge of the chute." return - M.loc = src + M.forceMove(src) flush() /atom/movable/proc/disposalEnterTry() diff --git a/code/modules/research/xenobiology/xenobio_camera.dm b/code/modules/research/xenobiology/xenobio_camera.dm index 8345a4f9dd5..dbc201fab83 100644 --- a/code/modules/research/xenobiology/xenobio_camera.dm +++ b/code/modules/research/xenobiology/xenobio_camera.dm @@ -68,7 +68,6 @@ var/mob/living/carbon/C = target var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control var/obj/machinery/computer/camera_advanced/xenobio/origin = remote_eye.origin - C.remote_view = 0 origin.current_user = null origin.jump_action.Remove(C) origin.slime_place_action.Remove(C) @@ -76,10 +75,9 @@ origin.feed_slime_action.Remove(C) origin.monkey_recycle_action.Remove(C) //All of this stuff below could probably be a proc for all advanced cameras, only the action removal needs to be camera specific - remote_eye.user = null + remote_eye.eye_user = null + C.reset_perspective(null) if(C.client) - C.client.perspective = MOB_PERSPECTIVE - C.client.eye = src C.client.images -= remote_eye.user_image for(var/datum/camerachunk/chunk in remote_eye.visibleCameraChunks) C.client.images -= chunk.obscured diff --git a/code/modules/surgery/dethralling.dm b/code/modules/surgery/dethralling.dm index 3eb2729f450..8cf27e999c8 100644 --- a/code/modules/surgery/dethralling.dm +++ b/code/modules/surgery/dethralling.dm @@ -20,7 +20,7 @@ user.visible_message("[target] suddenly slams upward and knocks down [user]!", \ "[target] suddenly bolts up and slams you with tremendous force!") user.resting = 0 //Remove all stuns - user.sleeping = 0 + user.SetSleeping(0) user.SetStunned(0) user.SetWeakened(0) user.SetParalysis(0) diff --git a/code/modules/surgery/eye_surgery.dm b/code/modules/surgery/eye_surgery.dm index 83821b42e1d..93310e3b4d5 100644 --- a/code/modules/surgery/eye_surgery.dm +++ b/code/modules/surgery/eye_surgery.dm @@ -16,10 +16,11 @@ /datum/surgery_step/fix_eyes/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) user.visible_message("[user] successfully fixes [target]'s eyes!", "You succeed in fixing [target]'s eyes.") - target.disabilities &= ~BLIND - target.disabilities &= ~NEARSIGHT - target.eye_blurry = 35 //this will fix itself slowly. - target.eye_stat = 0 + target.cure_blind() + target.set_blindness(0) + target.cure_nearsighted() + target.set_blurriness(max(target.eye_blurry,35)) //this will fix itself slowly. + target.set_eye_stat(0) return 1 /datum/surgery_step/fix_eyes/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) diff --git a/code/modules/surgery/helpers.dm b/code/modules/surgery/helpers.dm index d7af75c311a..ca64b7b099c 100644 --- a/code/modules/surgery/helpers.dm +++ b/code/modules/surgery/helpers.dm @@ -2,7 +2,7 @@ if(istype(M)) var/mob/living/carbon/human/H var/obj/item/organ/limb/affecting - var/selected_zone = user.zone_sel.selecting + var/selected_zone = user.zone_selected if(istype(M, /mob/living/carbon/human)) H = M diff --git a/code/modules/surgery/limb augmentation.dm b/code/modules/surgery/limb augmentation.dm index f84e595c635..a7b9f3c2088 100644 --- a/code/modules/surgery/limb augmentation.dm +++ b/code/modules/surgery/limb augmentation.dm @@ -11,7 +11,7 @@ /datum/surgery_step/replace/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - user.visible_message("[user] begins to sever the muscles on [target]'s [parse_zone(user.zone_sel.selecting)].", "You begin to sever the muscles on [target]'s [parse_zone(user.zone_sel.selecting)]...") + user.visible_message("[user] begins to sever the muscles on [target]'s [parse_zone(user.zone_selected)].", "You begin to sever the muscles on [target]'s [parse_zone(user.zone_selected)]...") /datum/surgery_step/add_limb @@ -25,9 +25,9 @@ /datum/surgery_step/add_limb/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) L = surgery.organ if(L) - user.visible_message("[user] begins to augment [target]'s [parse_zone(user.zone_sel.selecting)].", "You begin to augment [target]'s [parse_zone(user.zone_sel.selecting)]...") + user.visible_message("[user] begins to augment [target]'s [parse_zone(user.zone_selected)].", "You begin to augment [target]'s [parse_zone(user.zone_selected)]...") else - user.visible_message("[user] looks for [target]'s [parse_zone(user.zone_sel.selecting)].", "You look for [target]'s [parse_zone(user.zone_sel.selecting)]...") + user.visible_message("[user] looks for [target]'s [parse_zone(user.zone_selected)].", "You look for [target]'s [parse_zone(user.zone_selected)]...") diff --git a/code/modules/surgery/organs/augments_eyes.dm b/code/modules/surgery/organs/augments_eyes.dm index f92dffc912a..a571e57875a 100644 --- a/code/modules/surgery/organs/augments_eyes.dm +++ b/code/modules/surgery/organs/augments_eyes.dm @@ -25,7 +25,8 @@ HMN.regenerate_icons() if(aug_message && !special) owner << "[aug_message]" - M.sight |= sight_flags + + owner.update_sight() /obj/item/organ/internal/cyberimp/eyes/Remove(var/mob/living/carbon/M, var/special = 0) M.sight ^= sight_flags @@ -35,30 +36,14 @@ HMN.regenerate_icons() ..() -/obj/item/organ/internal/cyberimp/eyes/on_life() - ..() - owner.sight |= sight_flags - if(dark_view) - owner.see_in_dark = dark_view - if(see_invisible) - owner.see_invisible = see_invisible - /obj/item/organ/internal/cyberimp/eyes/emp_act(severity) if(!owner) return if(severity > 1) if(prob(10 * severity)) return - var/save_sight = owner.sight - owner.sight &= 0 - owner.disabilities |= BLIND owner << "Static obfuscates your vision!" - spawn(60 / severity) - if(owner) - owner.sight |= save_sight - owner.disabilities ^= BLIND - - + flick("e_flash", owner.flash) /obj/item/organ/internal/cyberimp/eyes/xray name = "X-ray implant" diff --git a/code/modules/surgery/organs/organ_external.dm b/code/modules/surgery/organs/organ_external.dm index 2e931859bd2..656ef7f2278 100644 --- a/code/modules/surgery/organs/organ_external.dm +++ b/code/modules/surgery/organs/organ_external.dm @@ -108,6 +108,8 @@ burn_dam += can_inflict else return 0 + if(owner) + owner.updatehealth() return update_organ_icon() @@ -126,6 +128,8 @@ brute_dam = max(brute_dam - brute, 0) burn_dam = max(burn_dam - burn, 0) + if(owner) + owner.updatehealth() return update_organ_icon() diff --git a/code/modules/surgery/remove_embedded_object.dm b/code/modules/surgery/remove_embedded_object.dm index 5ca4083ab6c..1573d010508 100644 --- a/code/modules/surgery/remove_embedded_object.dm +++ b/code/modules/surgery/remove_embedded_object.dm @@ -14,9 +14,9 @@ /datum/surgery_step/remove_object/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) L = surgery.organ if(L) - user.visible_message("[user] looks for objects embedded in [target]'s [parse_zone(user.zone_sel.selecting)].", "You look for objects embedded in [target]'s [parse_zone(user.zone_sel.selecting)]...") + user.visible_message("[user] looks for objects embedded in [target]'s [parse_zone(user.zone_selected)].", "You look for objects embedded in [target]'s [parse_zone(user.zone_selected)]...") else - user.visible_message("[user] looks for [target]'s [parse_zone(user.zone_sel.selecting)].", "You look for [target]'s [parse_zone(user.zone_sel.selecting)]...") + user.visible_message("[user] looks for [target]'s [parse_zone(user.zone_selected)].", "You look for [target]'s [parse_zone(user.zone_selected)]...") /datum/surgery_step/remove_object/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) @@ -35,6 +35,6 @@ user << "You find no objects embedded in [H]'s [L.getDisplayName()]!" else - user << "You can't find [target]'s [parse_zone(user.zone_sel.selecting)], let alone any objects embedded in it!" + user << "You can't find [target]'s [parse_zone(user.zone_selected)], let alone any objects embedded in it!" return 1 \ No newline at end of file diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index ecee25e7b13..c8b1e43081c 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -23,7 +23,7 @@ var/datum/surgery_step/S = get_surgery_step() if(S) - if(S.try_op(user, target, user.zone_sel.selecting, user.get_active_hand(), src)) + if(S.try_op(user, target, user.zone_selected, user.get_active_hand(), src)) return 1 return 0 diff --git a/tgstation.dme b/tgstation.dme index b9045a531c1..b1a49ae4d45 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -97,8 +97,10 @@ #include "code\_onclick\hud\alert.dm" #include "code\_onclick\hud\alien.dm" #include "code\_onclick\hud\alien_larva.dm" +#include "code\_onclick\hud\blob_overmind.dm" #include "code\_onclick\hud\drones.dm" #include "code\_onclick\hud\ghost.dm" +#include "code\_onclick\hud\guardian.dm" #include "code\_onclick\hud\hud.dm" #include "code\_onclick\hud\human.dm" #include "code\_onclick\hud\monkey.dm" @@ -106,6 +108,7 @@ #include "code\_onclick\hud\other_mobs.dm" #include "code\_onclick\hud\robot.dm" #include "code\_onclick\hud\screen_objects.dm" +#include "code\_onclick\hud\swarmer.dm" #include "code\ATMOSPHERICS\atmospherics.dm" #include "code\ATMOSPHERICS\datum_pipeline.dm" #include "code\ATMOSPHERICS\components\components_base.dm" @@ -334,6 +337,7 @@ #include "code\game\gamemodes\changeling\powers\glands.dm" #include "code\game\gamemodes\changeling\powers\headcrab.dm" #include "code\game\gamemodes\changeling\powers\hivemind.dm" +#include "code\game\gamemodes\changeling\powers\horror_form.dm" #include "code\game\gamemodes\changeling\powers\humanform.dm" #include "code\game\gamemodes\changeling\powers\lesserform.dm" #include "code\game\gamemodes\changeling\powers\mimic_voice.dm" @@ -343,6 +347,8 @@ #include "code\game\gamemodes\changeling\powers\shriek.dm" #include "code\game\gamemodes\changeling\powers\spiders.dm" #include "code\game\gamemodes\changeling\powers\strained_muscles.dm" +#include "code\game\gamemodes\changeling\powers\swap_forms.dm" +#include "code\game\gamemodes\changeling\powers\synaptic_enhancement.dm" #include "code\game\gamemodes\changeling\powers\tiny_prick.dm" #include "code\game\gamemodes\changeling\powers\transform.dm" #include "code\game\gamemodes\cult\cult.dm" @@ -1202,7 +1208,6 @@ #include "code\modules\mob\living\carbon\alien\humanoid\humanoid.dm" #include "code\modules\mob\living\carbon\alien\humanoid\inventory.dm" #include "code\modules\mob\living\carbon\alien\humanoid\life.dm" -#include "code\modules\mob\living\carbon\alien\humanoid\login.dm" #include "code\modules\mob\living\carbon\alien\humanoid\queen.dm" #include "code\modules\mob\living\carbon\alien\humanoid\update_icons.dm" #include "code\modules\mob\living\carbon\alien\humanoid\caste\drone.dm" @@ -1223,7 +1228,6 @@ #include "code\modules\mob\living\carbon\brain\death.dm" #include "code\modules\mob\living\carbon\brain\emote.dm" #include "code\modules\mob\living\carbon\brain\life.dm" -#include "code\modules\mob\living\carbon\brain\login.dm" #include "code\modules\mob\living\carbon\brain\MMI.dm" #include "code\modules\mob\living\carbon\brain\posibrain.dm" #include "code\modules\mob\living\carbon\brain\say.dm" @@ -1242,7 +1246,6 @@ #include "code\modules\mob\living\carbon\human\human_movement.dm" #include "code\modules\mob\living\carbon\human\inventory.dm" #include "code\modules\mob\living\carbon\human\life.dm" -#include "code\modules\mob\living\carbon\human\login.dm" #include "code\modules\mob\living\carbon\human\say.dm" #include "code\modules\mob\living\carbon\human\species.dm" #include "code\modules\mob\living\carbon\human\species_types.dm" @@ -1252,7 +1255,6 @@ #include "code\modules\mob\living\carbon\monkey\emote.dm" #include "code\modules\mob\living\carbon\monkey\inventory.dm" #include "code\modules\mob\living\carbon\monkey\life.dm" -#include "code\modules\mob\living\carbon\monkey\login.dm" #include "code\modules\mob\living\carbon\monkey\monkey.dm" #include "code\modules\mob\living\carbon\monkey\update_icons.dm" #include "code\modules\mob\living\silicon\death.dm" @@ -1347,6 +1349,7 @@ #include "code\modules\mob\living\simple_animal\hostile\statue.dm" #include "code\modules\mob\living\simple_animal\hostile\syndicate.dm" #include "code\modules\mob\living\simple_animal\hostile\tree.dm" +#include "code\modules\mob\living\simple_animal\hostile\true_changeling.dm" #include "code\modules\mob\living\simple_animal\hostile\venus_human_trap.dm" #include "code\modules\mob\living\simple_animal\hostile\wizard.dm" #include "code\modules\mob\living\simple_animal\hostile\zombie.dm"