From b7ab02b3b234c8389b95141803e90878ac4fca74 Mon Sep 17 00:00:00 2001 From: Doubleumc Date: Sun, 26 Nov 2023 14:26:55 -0500 Subject: [PATCH 01/23] CORSAT poddoor and LZ fixes (#5029) # About the pull request Fixes CORSAT's LZs so that they can be landed on using the modern shuttle system. Removed the icon from poddoors supposedly invisible `filler_object` so they will actually be invisible, as intended. There's a lot more to be said about wide poddoors using a completely separate system from wide airlocks but -- well, I don't want to. # Explain why it's good for the game A little less friction using an unmaintained map like CORSAT. # Testing Photographs and Procedure
Screenshots & Videos Before, LZs ![image](https://github.com/PvE-CMSS13/PvE-CMSS13/assets/14267245/6a92c821-2507-4bf4-8e69-d994dce16925) Before, closed poddoors ![image](https://github.com/PvE-CMSS13/PvE-CMSS13/assets/14267245/9cc0ff68-efef-4d05-a1ba-b3c7c8ae86df) Before, open poddoors ![image](https://github.com/PvE-CMSS13/PvE-CMSS13/assets/14267245/8b89866e-7b2d-499e-8b7c-858a8df2e3e3) After, LZs ![image](https://github.com/PvE-CMSS13/PvE-CMSS13/assets/14267245/20348a33-e36d-4588-a9d0-06fa8bf61ea6) After, closed poddoors ![image](https://github.com/PvE-CMSS13/PvE-CMSS13/assets/14267245/e63c0624-0e77-409c-af4a-c2290292517a) After, open poddoors ![image](https://github.com/PvE-CMSS13/PvE-CMSS13/assets/14267245/62aacf64-2e00-445d-bfd5-a414121e84aa)
# Changelog :cl: fix: CORSAT poddoors no longer have extra sprites overlaid on them maptweak: CORSAT LZs can be used by shuttles /:cl: --- code/game/machinery/doors/poddoor.dm | 1 + maps/map_files/CORSAT/Corsat.dmm | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/code/game/machinery/doors/poddoor.dm b/code/game/machinery/doors/poddoor.dm index b2d836ee476f..0a3b873ce385 100644 --- a/code/game/machinery/doors/poddoor.dm +++ b/code/game/machinery/doors/poddoor.dm @@ -240,6 +240,7 @@ /obj/structure/machinery/door/poddoor/filler_object name = "" + icon = null icon_state = "" unslashable = TRUE unacidable = TRUE diff --git a/maps/map_files/CORSAT/Corsat.dmm b/maps/map_files/CORSAT/Corsat.dmm index ab1e9cbaa2fd..b00a12dc86bd 100644 --- a/maps/map_files/CORSAT/Corsat.dmm +++ b/maps/map_files/CORSAT/Corsat.dmm @@ -37445,7 +37445,6 @@ /area/corsat/gamma/biodome/virology) "drp" = ( /obj/docking_port/stationary/marine_dropship/lz1{ - dwidth = 1; name = "Gamma Landing Zone" }, /turf/open/floor/plating, @@ -38223,7 +38222,6 @@ /area/corsat/omega/complex) "dUj" = ( /obj/docking_port/stationary/marine_dropship/lz2{ - dwidth = 1; name = "Sigma Landing Zone" }, /turf/open/floor/plating, From 28d3f59feb9f2025fc3817bb697baf3e2cb84279 Mon Sep 17 00:00:00 2001 From: cm13-github <128137806+cm13-github@users.noreply.github.com> Date: Sun, 26 Nov 2023 19:35:19 +0000 Subject: [PATCH 02/23] Automatic changelog for PR #5029 [ci skip] --- html/changelogs/AutoChangeLog-pr-5029.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-5029.yml diff --git a/html/changelogs/AutoChangeLog-pr-5029.yml b/html/changelogs/AutoChangeLog-pr-5029.yml new file mode 100644 index 000000000000..50be75c613d6 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-5029.yml @@ -0,0 +1,5 @@ +author: "Doubleumc" +delete-after: True +changes: + - bugfix: "CORSAT poddoors no longer have extra sprites overlaid on them" + - maptweak: "CORSAT LZs can be used by shuttles" \ No newline at end of file From 5e2819ebb3f34849c3184a34f19363ce14c02901 Mon Sep 17 00:00:00 2001 From: hislittlecuzingames <142365554+hislittlecuzingames@users.noreply.github.com> Date: Sun, 26 Nov 2023 14:27:12 -0500 Subject: [PATCH 03/23] Fixes Hijack Dropship launch announcement alarm not turning off - Bwoop is Kil (#5025) # About the pull request Turns the launch alarm off on dropships when the queen hijacks a ship. # Explain why it's good for the game Players found the alarm annoying when the ship was hijacked with the alarm sounding and they couldn't turn it off. # Testing Photographs and Procedure
Screenshots & Videos Put screenshots and videos here with an empty
Happens in the first few seconds so you don't have to listen to youtube and alarms and sensory overload https://github.com/cmss13-devs/cmss13/assets/142365554/12485a52-a887-4ce0-825d-bb0b33e7e98d
# Changelog :cl: fix: Disables launch announcment alarm if it's sounding when queen hijacks /:cl: --------- Co-authored-by: Drathek <76988376+Drulikar@users.noreply.github.com> --- code/modules/shuttle/computers/dropship_computer.dm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/modules/shuttle/computers/dropship_computer.dm b/code/modules/shuttle/computers/dropship_computer.dm index d11c39ec1734..6774d81e590d 100644 --- a/code/modules/shuttle/computers/dropship_computer.dm +++ b/code/modules/shuttle/computers/dropship_computer.dm @@ -270,6 +270,9 @@ hijack.fire() GLOB.alt_ctrl_disabled = TRUE + dropship.alarm_sound_loop.stop() + dropship.playing_launch_announcement_alarm = FALSE + marine_announcement("Unscheduled dropship departure detected from operational area. Hijack likely. Shutting down autopilot.", "Dropship Alert", 'sound/AI/hijack.ogg', logging = ARES_LOG_SECURITY) log_ares_flight("Unknown", "Unscheduled dropship departure detected from operational area. Hijack likely. Shutting down autopilot.") From 91b56c31ac6c48723663ef51fa9b44bab90c2794 Mon Sep 17 00:00:00 2001 From: cm13-github <128137806+cm13-github@users.noreply.github.com> Date: Sun, 26 Nov 2023 19:48:17 +0000 Subject: [PATCH 04/23] Automatic changelog for PR #5025 [ci skip] --- html/changelogs/AutoChangeLog-pr-5025.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-5025.yml diff --git a/html/changelogs/AutoChangeLog-pr-5025.yml b/html/changelogs/AutoChangeLog-pr-5025.yml new file mode 100644 index 000000000000..0144cc0b59fc --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-5025.yml @@ -0,0 +1,4 @@ +author: "hislittlecuzingames" +delete-after: True +changes: + - bugfix: "Disables launch announcment alarm if it's sounding when queen hijacks" \ No newline at end of file From 59b25e0d34f30aea752b6bc45415154adfa1fe35 Mon Sep 17 00:00:00 2001 From: Zonespace <41448081+Zonespace27@users.noreply.github.com> Date: Sun, 26 Nov 2023 11:27:22 -0800 Subject: [PATCH 05/23] Fix post-SD detonation timer (#5036) # About the pull request The timer would loop over to 1h after SD went off, this fixes that. # Explain why it's good for the game Bugs bad # Changelog :cl: fix: The Self Destruct timer in the status panel will now stop once SD has gone off. /:cl: --- code/controllers/subsystem/hijack.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/controllers/subsystem/hijack.dm b/code/controllers/subsystem/hijack.dm index 4031c98a40da..ee3e86e6095e 100644 --- a/code/controllers/subsystem/hijack.dm +++ b/code/controllers/subsystem/hijack.dm @@ -238,7 +238,7 @@ SUBSYSTEM_DEF(hijack) return "Complete" /datum/controller/subsystem/hijack/proc/get_sd_eta() - if(!sd_time_remaining) + if(sd_detonated) return "Complete" if(overloaded_generators <= 0) From c97529a4547a05f8324326c9a56d85a4844636e7 Mon Sep 17 00:00:00 2001 From: cm13-github <128137806+cm13-github@users.noreply.github.com> Date: Sun, 26 Nov 2023 20:01:28 +0000 Subject: [PATCH 06/23] Automatic changelog for PR #5036 [ci skip] --- html/changelogs/AutoChangeLog-pr-5036.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-5036.yml diff --git a/html/changelogs/AutoChangeLog-pr-5036.yml b/html/changelogs/AutoChangeLog-pr-5036.yml new file mode 100644 index 000000000000..668158a722a8 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-5036.yml @@ -0,0 +1,4 @@ +author: "Zonespace27" +delete-after: True +changes: + - bugfix: "The Self Destruct timer in the status panel will now stop once SD has gone off." \ No newline at end of file From 7ddb7e85f45b3ee9dbcec59e8508b62f121ccc27 Mon Sep 17 00:00:00 2001 From: Birdtalon Date: Sun, 26 Nov 2023 19:28:31 +0000 Subject: [PATCH 07/23] Fixes repaired vendor icons not updating (#5024) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # About the pull request Fixes #5016 # Explain why it's good for the game # Testing Photographs and Procedure
Screenshots & Videos Put screenshots and videos here with an empty line between the screenshots and the `
` tags.
# Changelog :cl: fix: Fixes vendor sprites not updating icon when fully repaired /🆑 --- code/game/machinery/vending/cm_vending.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/vending/cm_vending.dm b/code/game/machinery/vending/cm_vending.dm index 12231f30bc59..b1d5fc9bb706 100644 --- a/code/game/machinery/vending/cm_vending.dm +++ b/code/game/machinery/vending/cm_vending.dm @@ -84,7 +84,7 @@ IN_USE used for vending/denying if(stat & NOPOWER || stat & TIPPED_OVER) //tipping off without breaking uses "_off" sprite overlays += image(icon, "[icon_state]_off") if(stat & MAINT) //if we require maintenance, then it is completely "_broken" - icon_state = "[initial(icon_state)]_broken" + overlays += image(icon, "[initial(icon_state)]_broken") if(stat & IN_REPAIR) //if someone started repairs, they unscrewed "_panel" overlays += image(icon, "[icon_state]_panel") From 9692c431895ce8953a1fb1b43b1eb9a88a012bef Mon Sep 17 00:00:00 2001 From: cm13-github <128137806+cm13-github@users.noreply.github.com> Date: Sun, 26 Nov 2023 20:17:08 +0000 Subject: [PATCH 08/23] Automatic changelog for PR #5024 [ci skip] --- html/changelogs/AutoChangeLog-pr-5024.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-5024.yml diff --git a/html/changelogs/AutoChangeLog-pr-5024.yml b/html/changelogs/AutoChangeLog-pr-5024.yml new file mode 100644 index 000000000000..2598c60a3320 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-5024.yml @@ -0,0 +1,4 @@ +author: "Birdtalon" +delete-after: True +changes: + - bugfix: "Fixes vendor sprites not updating icon when fully repaired\n/🆑" \ No newline at end of file From 8112b599447f75375259b28ffac371bca18fc0b8 Mon Sep 17 00:00:00 2001 From: SabreML <57483089+SabreML@users.noreply.github.com> Date: Sun, 26 Nov 2023 20:05:46 +0000 Subject: [PATCH 09/23] Character creation 'Preferred Armor' preview (#5033) # About the pull request Makes the armour worn by the preview dummy in the character creation menu show the user's 'Preferred Armor' setting. Also fixes a bug I found where the 'Padded' armour type would have its sprite replaced with the user's preferred style when vended. This specifically affected the 'Padded' variant because that has the icon states of `L1`/`1`/`H1` for Light/Medium/Heavy, and `post_vendor_spawn_hook()` worked by replacing any `1`s in the `icon_state` with the user's preference. (`post_vendor_spawn_hook()` now checks if the armour has style variants before anything else.) # Explain why it's good for the game The 'Preferred Armor' setting can be a bit confusing if you don't actually know what each armour style looks like. (Which I personally didn't until making this PR.) # Testing Photographs and Procedure
Screenshots & Videos **Character creation preview:** https://github.com/cmss13-devs/cmss13/assets/57483089/e2ac29ea-c290-447f-b234-a3ca82397e23
**Padded armour bug before:** (Preferred Armor set to 'Skull') https://github.com/cmss13-devs/cmss13/assets/57483089/ba0bc7d0-2ea0-4d07-8185-3d8920790463 **Padded armour bug after:** (Preferred Armor set to 'Skull') https://github.com/cmss13-devs/cmss13/assets/57483089/397ad4b4-a7e5-4433-84b5-196ce5df7ded
# Changelog :cl: add: Made the character preview in the character creation menu show the 'Preferred Armor' setting. fix: Fixed 'Padded' armour being replaced by the user's armour style preference when vended. /:cl: --- code/modules/client/preferences.dm | 2 + code/modules/clothing/suits/marine_armor.dm | 40 ++++++++++++++----- .../mob/new_player/preferences_setup.dm | 10 +++++ 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 73493af538fa..6c52b497f9a3 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1620,6 +1620,8 @@ GLOBAL_LIST_INIT(bgstate_options, list( var/new_pref_armor = tgui_input_list(user, "Choose your character's default style of armor:", "Character Preferences", GLOB.armor_style_list) if(new_pref_armor) preferred_armor = new_pref_armor + // Update the dummy with the new armor style. + update_preview_icon() if("limbs") var/limb_name = tgui_input_list(user, "Which limb do you want to change?", list("Left Leg","Right Leg","Left Arm","Right Arm","Left Foot","Right Foot","Left Hand","Right Hand")) diff --git a/code/modules/clothing/suits/marine_armor.dm b/code/modules/clothing/suits/marine_armor.dm index ce4b771ebcab..d5dda73c061f 100644 --- a/code/modules/clothing/suits/marine_armor.dm +++ b/code/modules/clothing/suits/marine_armor.dm @@ -118,7 +118,7 @@ select_gamemode_skin(type) armor_overlays = list("lamp") //Just one for now, can add more later. if(armor_variation && mapload) - post_vendor_spawn_hook() + set_armor_style("Random") update_icon() pockets.max_w_class = SIZE_SMALL //Can contain small items AND rifle magazines. pockets.bypass_w_limit = list( @@ -149,18 +149,15 @@ /obj/item/clothing/suit/storage/marine/post_vendor_spawn_hook(mob/living/carbon/human/user) //used for randomizing/selecting a variant for armors. - var/new_look //used for the icon_state text replacement. - - if(!user?.client?.prefs) - new_look = rand(1,armor_variation) - - else if(user.client.prefs.preferred_armor == "Random") - new_look = rand(1,armor_variation) + if(!armor_variation) + return + if(user?.client?.prefs) + // Set the armor style to the user's preference. + set_armor_style(user.client.prefs.preferred_armor) else - new_look = GLOB.armor_style_list[user.client.prefs.preferred_armor] - - icon_state = replacetext(icon_state,"1","[new_look]") + // Or if that isn't possible, just pick a random one. + set_armor_style("Random") update_icon(user) /obj/item/clothing/suit/storage/marine/attack_self(mob/user) @@ -219,6 +216,27 @@ M.visible_message(SPAN_DANGER("Your programming prevents you from wearing this!")) return 0 +/** + * Updates the armor's `icon_state` to the style represented by `new_style`. + * + * Arguments: + * * new_style - The new armor style. May only be one of `GLOB.armor_style_list`'s keys, or `"Random"`. + */ +/obj/item/clothing/suit/storage/marine/proc/set_armor_style(new_style) + // Regex to match one or more digits. + var/static/regex/digits = new("\\d+") + // Integer for the new armor style's `icon_state`. + var/new_look + + if(new_style == "Random") + // The style icon states are all numbers between 1 and `armor_variation`, so this picks a random one. + new_look = rand(1, armor_variation) + else + new_look = GLOB.armor_style_list[new_style] + + // Replace the digits in the current icon state with `new_look`. (E.g. "L6" -> "L2") + icon_state = digits.Replace(icon_state, new_look) + /obj/item/clothing/suit/storage/marine/padded name = "M3 pattern padded marine armor" icon_state = "1" diff --git a/code/modules/mob/new_player/preferences_setup.dm b/code/modules/mob/new_player/preferences_setup.dm index 0f270a568304..a4525e16a6c6 100644 --- a/code/modules/mob/new_player/preferences_setup.dm +++ b/code/modules/mob/new_player/preferences_setup.dm @@ -198,6 +198,16 @@ arm_equipment(preview_dummy, J, FALSE, FALSE, owner, show_job_gear) + // If the dummy was equipped with marine armor. + var/jacket = preview_dummy.get_item_by_slot(WEAR_JACKET) + if(istype(jacket, /obj/item/clothing/suit/storage/marine)) + var/obj/item/clothing/suit/storage/marine/armor = jacket + // If the armor has different sprite variants. + if(armor.armor_variation) + // Set its `icon_state` to the style the player picked as their 'Preferred Armor'. + armor.set_armor_style(preferred_armor) + armor.update_icon(preview_dummy) + if(isnull(preview_front)) preview_front = new() owner.add_to_screen(preview_front) From b9685e47f7c66940168a74998f7989c61ed40f18 Mon Sep 17 00:00:00 2001 From: cm13-github <128137806+cm13-github@users.noreply.github.com> Date: Sun, 26 Nov 2023 20:33:05 +0000 Subject: [PATCH 10/23] Automatic changelog for PR #5033 [ci skip] --- html/changelogs/AutoChangeLog-pr-5033.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-5033.yml diff --git a/html/changelogs/AutoChangeLog-pr-5033.yml b/html/changelogs/AutoChangeLog-pr-5033.yml new file mode 100644 index 000000000000..6d3553d51576 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-5033.yml @@ -0,0 +1,5 @@ +author: "SabreML" +delete-after: True +changes: + - rscadd: "Made the character preview in the character creation menu show the 'Preferred Armor' setting." + - bugfix: "Fixed 'Padded' armour being replaced by the user's armour style preference when vended." \ No newline at end of file From daf2383b187a27129acc02f8fae4ca5a7d106de2 Mon Sep 17 00:00:00 2001 From: Birdtalon Date: Sun, 26 Nov 2023 20:13:44 +0000 Subject: [PATCH 11/23] Lesser drone CRASH hotfix (#5037) # About the pull request Fixes a `CRASH()` when the lesser drone gets gibbed... # Explain why it's good for the game # Testing Photographs and Procedure
Screenshots & Videos Put screenshots and videos here with an empty line between the screenshots and the `
` tags.
# Changelog :cl: fix: Fix lesser drone crash on getting gibbed. /:cl: --- code/modules/mob/living/carbon/xenomorph/castes/lesser_drone.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/lesser_drone.dm b/code/modules/mob/living/carbon/xenomorph/castes/lesser_drone.dm index 3eb11d155c74..9ca4cdc52474 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/lesser_drone.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/lesser_drone.dm @@ -98,7 +98,7 @@ /mob/living/carbon/xenomorph/lesser_drone/ghostize(can_reenter_corpse = FALSE, aghosted = FALSE) . = ..() - if(. && !aghosted) + if(. && !aghosted && !QDELETED(src)) gib() /mob/living/carbon/xenomorph/lesser_drone/handle_ghost_message() From 5822ea807c3503b4f4184a10cd08b474e8993940 Mon Sep 17 00:00:00 2001 From: cm13-github <128137806+cm13-github@users.noreply.github.com> Date: Sun, 26 Nov 2023 20:47:02 +0000 Subject: [PATCH 12/23] Automatic changelog for PR #5037 [ci skip] --- html/changelogs/AutoChangeLog-pr-5037.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-5037.yml diff --git a/html/changelogs/AutoChangeLog-pr-5037.yml b/html/changelogs/AutoChangeLog-pr-5037.yml new file mode 100644 index 000000000000..eb67c0c171cc --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-5037.yml @@ -0,0 +1,4 @@ +author: "Birdtalon" +delete-after: True +changes: + - bugfix: "Fix lesser drone crash on getting gibbed." \ No newline at end of file From 0271b9183b0b95a6979ecdd471d12aa0a78d9408 Mon Sep 17 00:00:00 2001 From: SabreML <57483089+SabreML@users.noreply.github.com> Date: Sun, 26 Nov 2023 20:16:34 +0000 Subject: [PATCH 13/23] Makes the squad attachments vendor vend to hand (#5021) # About the pull request Adds the `VEND_TO_HAND` flag to the squad attachments vendor so that vended items are put into the user's hand (if possible) rather than going directly onto the floor. Fixes #4875. # Explain why it's good for the game Good for QOL/consistency, since all the other vendors in squad prep already have this functionality. # Testing Photographs and Procedure
Videos
**Before:** https://github.com/cmss13-devs/cmss13/assets/57483089/301a15b1-ffe5-4af3-bed7-f6c567607a80 **After:** https://github.com/cmss13-devs/cmss13/assets/57483089/8dd0cf18-ce15-4517-989b-19d017612520
# Changelog :cl: qol: Made the squad prep attachments vendors vend items into the user's hands. /:cl: --- .../game/machinery/vending/vendor_types/squad_prep/squad_prep.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm b/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm index 94325b09e9eb..52418fb8940c 100644 --- a/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm +++ b/code/game/machinery/vending/vendor_types/squad_prep/squad_prep.dm @@ -307,6 +307,7 @@ req_access = list(ACCESS_MARINE_ALPHA) req_one_access = list(ACCESS_MARINE_LEADER, ACCESS_MARINE_SPECPREP, ACCESS_MARINE_RO) hackable = TRUE + vend_flags = VEND_CLUTTER_PROTECTION | VEND_LIMITED_INVENTORY | VEND_TO_HAND vend_y_offset = 1 From eceba174406abb39a0bb70b5ab693001887271cb Mon Sep 17 00:00:00 2001 From: cm13-github <128137806+cm13-github@users.noreply.github.com> Date: Sun, 26 Nov 2023 21:00:04 +0000 Subject: [PATCH 14/23] Automatic changelog for PR #5021 [ci skip] --- html/changelogs/AutoChangeLog-pr-5021.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-5021.yml diff --git a/html/changelogs/AutoChangeLog-pr-5021.yml b/html/changelogs/AutoChangeLog-pr-5021.yml new file mode 100644 index 000000000000..729b67fb29f1 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-5021.yml @@ -0,0 +1,4 @@ +author: "SabreML" +delete-after: True +changes: + - qol: "Made the squad prep attachments vendors vend items into the user's hands." \ No newline at end of file From a3e650eb12bc4a67638e6d49d80bb932f2e2fbeb Mon Sep 17 00:00:00 2001 From: Kozmos <31109792+HeresKozmos@users.noreply.github.com> Date: Sun, 26 Nov 2023 21:39:44 +0000 Subject: [PATCH 15/23] Sorokyne Tunnels Upgrade (#5020) # About the pull request This PR removes the five original tunnels on Sorokyne (shown below*) and replaces them with 8 new tunnels with better placement with a focus on the center and right side of the map. # Explain why it's good for the game I really like Sorokyne and I think it's a cool map, but whenever I play Xenomorph I just hate the base tunnels on the map; two of them are right next to comms arrays and get nuked nearly instantly, one is out in plain view in a very high-traffic area with no cover and the remaining two are in mediocre spots at best. The "useful" tunnels are well known by this point. Sorokyne's central map area (the outpost*) cannot have tunnels created anywhere inside of it by a Burrower unlike most other maps which allow at least some degree of indoor tunnel creation, blocking off a good chunk of the map from having any real, useful tunnels. I have added four maintenance hatch type tunnels to the Engineering, Aerodome, Administration and Personal Storage areas. Three of the remaining four have been distributed near the Research Station, east of Carp Lake and in the far south caves to better provide access to the cave areas. The eight and final tunnel is in the Cryo-Thermal Springs area between the LZs to give a movement option to the left side of the map while not being within eyesight range of the comms array areas to prevent Xenomorphs just tunneling straight to the array at 01:00 should it not be destroyed already. I believe the addition of these tunnels will help make movement around the map more dynamic for Xenomorphs and provide them better flanking and movement options while helping to remedy the lack of a Burrower on the map to create tunnels. # Testing Photographs and Procedure (The lines are just visual aids to make finding the tunnel spots easier, they are not indicative of other functions*) The old tunnels: ![Sorokyne Tunnel Map 1 1 V2](https://github.com/cmss13-devs/cmss13/assets/31109792/295f0857-37b8-474b-b019-75667c2def41) The new tunnels: ![Sorokyne Tunnel Map 1 2 V2](https://github.com/cmss13-devs/cmss13/assets/31109792/d4c9f99a-9990-4a15-bad9-99b107966189) # Changelog :cl: add: Added eight new tunnels to Sorokyne del: Removed the original five tunnels on Sorokyne /:cl: --- .../Sorokyne_Strata/Sorokyne_Strata.dmm | 85 ++++++++++--------- 1 file changed, 47 insertions(+), 38 deletions(-) diff --git a/maps/map_files/Sorokyne_Strata/Sorokyne_Strata.dmm b/maps/map_files/Sorokyne_Strata/Sorokyne_Strata.dmm index 19a7717a7e67..84355a59b16d 100644 --- a/maps/map_files/Sorokyne_Strata/Sorokyne_Strata.dmm +++ b/maps/map_files/Sorokyne_Strata/Sorokyne_Strata.dmm @@ -7794,7 +7794,9 @@ }, /area/strata/ag/interior/outpost/engi) "axf" = ( -/obj/structure/surface/table/reinforced/prison, +/obj/structure/tunnel/maint_tunnel{ + pixel_y = 16 + }, /turf/open/floor/strata, /area/strata/ag/interior/outpost/engi) "axg" = ( @@ -10464,11 +10466,13 @@ }, /area/strata/ag/interior/outpost/canteen) "aFC" = ( -/obj/structure/tunnel{ - id = "hole3" +/obj/structure/machinery/light/small, +/obj/structure/tunnel/maint_tunnel, +/turf/open/floor/strata{ + dir = 10; + icon_state = "multi_tiles" }, -/turf/open/auto_turf/snow/brown_base/layer0, -/area/strata/ag/exterior/paths/north_outpost) +/area/strata/ag/interior/outpost/engi/drome) "aFD" = ( /turf/closed/wall/strata_ice/jungle, /area/strata/ag/interior/outpost/maint/canteen_e_1) @@ -16510,11 +16514,9 @@ /turf/open/auto_turf/snow/brown_base/layer2, /area/strata/ag/interior/disposals) "bad" = ( -/obj/structure/tunnel{ - id = "hole4" - }, -/turf/open/auto_turf/snow/brown_base/layer2, -/area/strata/ag/exterior/north_lz_caves) +/obj/structure/tunnel, +/turf/open/auto_turf/strata_grass/layer1, +/area/strata/ug/interior/jungle/deep/tearlake) "bae" = ( /obj/structure/prop/almayer/computers/mapping_computer, /turf/open/floor/strata{ @@ -18476,12 +18478,9 @@ }, /area/strata/ug/interior/outpost/jung/dorms/admin4) "bgX" = ( -/obj/structure/flora/bush/ausbushes/grassybush, -/obj/structure/tunnel{ - id = "hole2" - }, -/turf/open/auto_turf/strata_grass/layer1, -/area/strata/ug/exterior/jungle/deep/carplake_center) +/obj/structure/tunnel, +/turf/open/auto_turf/ice/layer1, +/area/strata/ag/exterior/marsh/center) "bha" = ( /obj/structure/pipes/standard/simple/hidden/cyan, /turf/open/auto_turf/snow/brown_base/layer1, @@ -21979,11 +21978,9 @@ /turf/open/auto_turf/snow/brown_base/layer2, /area/strata/ag/exterior/marsh/center) "bui" = ( -/obj/structure/tunnel{ - id = "hole1" - }, -/turf/open/auto_turf/snow/brown_base/layer3, -/area/strata/ag/exterior/tcomms/tcomms_deck) +/obj/structure/tunnel, +/turf/open/auto_turf/strata_grass/layer1, +/area/strata/ug/interior/jungle/deep/minehead) "bul" = ( /obj/item/tool/shovel/snow, /turf/open/auto_turf/snow/brown_base/layer1, @@ -34633,6 +34630,12 @@ "lbh" = ( /turf/open/asphalt/cement, /area/strata/ag/exterior/tcomms/tcomms_deck) +"lbW" = ( +/obj/structure/tunnel/maint_tunnel, +/turf/open/floor/strata{ + icon_state = "floor3" + }, +/area/strata/ag/interior/outpost/admin) "lcq" = ( /obj/item/clothing/suit/storage/militia, /obj/item/clothing/suit/storage/snow_suit/doctor, @@ -36226,6 +36229,10 @@ }, /turf/open/auto_turf/strata_grass/layer1, /area/strata/ug/interior/jungle/deep/hotsprings) +"nPr" = ( +/obj/structure/tunnel, +/turf/open/auto_turf/strata_grass/layer1, +/area/strata/ug/interior/jungle/deep/east_carp) "nPJ" = ( /obj/structure/pipes/standard/manifold/hidden/cyan, /turf/open/floor/strata, @@ -37410,12 +37417,14 @@ }, /area/strata/ag/interior/tcomms) "pMU" = ( -/obj/structure/flora/bush/ausbushes/grassybush, -/obj/structure/tunnel{ - id = "hole1" +/obj/structure/tunnel/maint_tunnel{ + pixel_y = 16 }, -/turf/open/auto_turf/strata_grass/layer1, -/area/strata/ug/interior/jungle/platform/east/scrub) +/turf/open/floor/strata{ + dir = 10; + icon_state = "multi_tiles" + }, +/area/strata/ag/interior/outpost/canteen/personal_storage) "pNL" = ( /obj/structure/stairs/perspective{ color = "#6e6e6e"; @@ -49411,7 +49420,7 @@ aXP aYd aac aac -bad +aYd aYd aXP aXP @@ -49825,7 +49834,7 @@ aac aac rsm coC -coC +bgX coC wrw aac @@ -55882,7 +55891,7 @@ aac aac aac aac -bui +btX btq btq btv @@ -60485,7 +60494,7 @@ ayr ayr aCu aAb -aFC +ayw ayw aAR awJ @@ -64616,7 +64625,7 @@ biK blQ biH bsC -bll +lbW cik bCo bGO @@ -69514,7 +69523,7 @@ bvz gUj snV srk -pMU +wij wZZ htD wZZ @@ -69706,7 +69715,7 @@ bgO bht bzl cfg -ppA +aFC snV tnM srk @@ -73738,7 +73747,7 @@ awb agR agR aiM -bPZ +pMU bPZ bPZ bSv @@ -74254,7 +74263,7 @@ jLb jLb sKX jLb -jLb +bad aad aad aad @@ -78846,7 +78855,7 @@ cpg cpg cpg cpg -bgX +kvY piY piY cwD @@ -84455,7 +84464,7 @@ aad aad bHj bHj -vVK +bui bon bon bon @@ -86083,7 +86092,7 @@ sKg sKg sKg daq -daq +nPr daq daq sKg From 8ddfa927db57705f9049e0160065bdda21b9e720 Mon Sep 17 00:00:00 2001 From: cm13-github <128137806+cm13-github@users.noreply.github.com> Date: Sun, 26 Nov 2023 22:01:02 +0000 Subject: [PATCH 16/23] Automatic changelog for PR #5020 [ci skip] --- html/changelogs/AutoChangeLog-pr-5020.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-5020.yml diff --git a/html/changelogs/AutoChangeLog-pr-5020.yml b/html/changelogs/AutoChangeLog-pr-5020.yml new file mode 100644 index 000000000000..64ace43583a1 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-5020.yml @@ -0,0 +1,5 @@ +author: "HeresKozmos" +delete-after: True +changes: + - rscadd: "Added eight new tunnels to Sorokyne" + - rscdel: "Removed the original five tunnels on Sorokyne" \ No newline at end of file From 18ba27def4258f123da7f80870eb8dbdfd14554a Mon Sep 17 00:00:00 2001 From: Changelogs Date: Mon, 27 Nov 2023 01:11:46 +0000 Subject: [PATCH 17/23] Automatic changelog compile [ci skip] --- html/changelogs/AutoChangeLog-pr-5020.yml | 5 ----- html/changelogs/AutoChangeLog-pr-5021.yml | 4 ---- html/changelogs/AutoChangeLog-pr-5024.yml | 4 ---- html/changelogs/AutoChangeLog-pr-5025.yml | 4 ---- html/changelogs/AutoChangeLog-pr-5029.yml | 5 ----- html/changelogs/AutoChangeLog-pr-5033.yml | 5 ----- html/changelogs/AutoChangeLog-pr-5036.yml | 4 ---- html/changelogs/AutoChangeLog-pr-5037.yml | 4 ---- html/changelogs/archive/2023-11.yml | 21 +++++++++++++++++++++ 9 files changed, 21 insertions(+), 35 deletions(-) delete mode 100644 html/changelogs/AutoChangeLog-pr-5020.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-5021.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-5024.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-5025.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-5029.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-5033.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-5036.yml delete mode 100644 html/changelogs/AutoChangeLog-pr-5037.yml diff --git a/html/changelogs/AutoChangeLog-pr-5020.yml b/html/changelogs/AutoChangeLog-pr-5020.yml deleted file mode 100644 index 64ace43583a1..000000000000 --- a/html/changelogs/AutoChangeLog-pr-5020.yml +++ /dev/null @@ -1,5 +0,0 @@ -author: "HeresKozmos" -delete-after: True -changes: - - rscadd: "Added eight new tunnels to Sorokyne" - - rscdel: "Removed the original five tunnels on Sorokyne" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-5021.yml b/html/changelogs/AutoChangeLog-pr-5021.yml deleted file mode 100644 index 729b67fb29f1..000000000000 --- a/html/changelogs/AutoChangeLog-pr-5021.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "SabreML" -delete-after: True -changes: - - qol: "Made the squad prep attachments vendors vend items into the user's hands." \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-5024.yml b/html/changelogs/AutoChangeLog-pr-5024.yml deleted file mode 100644 index 2598c60a3320..000000000000 --- a/html/changelogs/AutoChangeLog-pr-5024.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Birdtalon" -delete-after: True -changes: - - bugfix: "Fixes vendor sprites not updating icon when fully repaired\n/🆑" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-5025.yml b/html/changelogs/AutoChangeLog-pr-5025.yml deleted file mode 100644 index 0144cc0b59fc..000000000000 --- a/html/changelogs/AutoChangeLog-pr-5025.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "hislittlecuzingames" -delete-after: True -changes: - - bugfix: "Disables launch announcment alarm if it's sounding when queen hijacks" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-5029.yml b/html/changelogs/AutoChangeLog-pr-5029.yml deleted file mode 100644 index 50be75c613d6..000000000000 --- a/html/changelogs/AutoChangeLog-pr-5029.yml +++ /dev/null @@ -1,5 +0,0 @@ -author: "Doubleumc" -delete-after: True -changes: - - bugfix: "CORSAT poddoors no longer have extra sprites overlaid on them" - - maptweak: "CORSAT LZs can be used by shuttles" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-5033.yml b/html/changelogs/AutoChangeLog-pr-5033.yml deleted file mode 100644 index 6d3553d51576..000000000000 --- a/html/changelogs/AutoChangeLog-pr-5033.yml +++ /dev/null @@ -1,5 +0,0 @@ -author: "SabreML" -delete-after: True -changes: - - rscadd: "Made the character preview in the character creation menu show the 'Preferred Armor' setting." - - bugfix: "Fixed 'Padded' armour being replaced by the user's armour style preference when vended." \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-5036.yml b/html/changelogs/AutoChangeLog-pr-5036.yml deleted file mode 100644 index 668158a722a8..000000000000 --- a/html/changelogs/AutoChangeLog-pr-5036.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Zonespace27" -delete-after: True -changes: - - bugfix: "The Self Destruct timer in the status panel will now stop once SD has gone off." \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-5037.yml b/html/changelogs/AutoChangeLog-pr-5037.yml deleted file mode 100644 index eb67c0c171cc..000000000000 --- a/html/changelogs/AutoChangeLog-pr-5037.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Birdtalon" -delete-after: True -changes: - - bugfix: "Fix lesser drone crash on getting gibbed." \ No newline at end of file diff --git a/html/changelogs/archive/2023-11.yml b/html/changelogs/archive/2023-11.yml index f07814a4a06c..8fc0ce518efb 100644 --- a/html/changelogs/archive/2023-11.yml +++ b/html/changelogs/archive/2023-11.yml @@ -367,3 +367,24 @@ for TL Nanu308: - rscdel: Removed the Pizza Cutter. +2023-11-27: + Birdtalon: + - bugfix: "Fixes vendor sprites not updating icon when fully repaired\n/\U0001F191" + - bugfix: Fix lesser drone crash on getting gibbed. + Doubleumc: + - bugfix: CORSAT poddoors no longer have extra sprites overlaid on them + - maptweak: CORSAT LZs can be used by shuttles + HeresKozmos: + - rscadd: Added eight new tunnels to Sorokyne + - rscdel: Removed the original five tunnels on Sorokyne + SabreML: + - rscadd: Made the character preview in the character creation menu show the 'Preferred + Armor' setting. + - bugfix: Fixed 'Padded' armour being replaced by the user's armour style preference + when vended. + - qol: Made the squad prep attachments vendors vend items into the user's hands. + Zonespace27: + - bugfix: The Self Destruct timer in the status panel will now stop once SD has + gone off. + hislittlecuzingames: + - bugfix: Disables launch announcment alarm if it's sounding when queen hijacks From 2011c229f9a37de8fa67a74d8e40974515724cde Mon Sep 17 00:00:00 2001 From: stalkerino <66872447+irakligabunia@users.noreply.github.com> Date: Mon, 27 Nov 2023 12:14:37 +0400 Subject: [PATCH 18/23] Readds skull facemask and facepaint (#5042) # About the pull request It readds two items that were removed in the past for no valid reason (in my opinion), since it was a targeted PR against a specific player I do not think it should've been removed. # Explain why it's good for the game It looks nice and fits the atmosphere, adding it will help players customize their characters without being too loud. The removal reason of "You'd get laughed at for wearing it IRL" is invalid, a lot of military and law enforcement people wear skull masks, punisher emblems and etcetra - this is especially evident in America (We're UA) https://discord.com/channels/150315577943130112/746325423289401395/1168350579307860078 https://discord.com/channels/150315577943130112/827156857566265375/1145494273568022588 https://files.catbox.moe/4o3ag1.png https://discord.com/channels/150315577943130112/604397850675380234/1094357565317586964 -- the person who made it admitting it was targeted. # Testing Photographs and Procedure I don't think it needs testing
# Changelog :cl: stalkerino add: readds skull facepaint and skull balaclava (blue and black) /:cl: --- code/modules/client/preferences_gear.dm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/code/modules/client/preferences_gear.dm b/code/modules/client/preferences_gear.dm index c976f9b5715e..8a46e60956db 100644 --- a/code/modules/client/preferences_gear.dm +++ b/code/modules/client/preferences_gear.dm @@ -161,6 +161,18 @@ GLOBAL_LIST_EMPTY(gear_datums_by_name) display_name = "USCM balaclava, tan" path = /obj/item/clothing/mask/rebreather/scarf/tan +/datum/gear/skull_balaclava_blue + display_name = "Blue Skull Balaclava" + path = /obj/item/clothing/mask/rebreather/skull + cost = 4 //same as skull facepaint + slot = WEAR_FACE + +/datum/gear/skull_balaclava_black + display_name = "Black Skull Balaclava" + path = /obj/item/clothing/mask/rebreather/skull/black + cost = 4 + slot = WEAR_FACE + /datum/gear/headwear category = "Headwear" cost = 3 @@ -876,6 +888,11 @@ GLOBAL_LIST_EMPTY(gear_datums_by_name) display_name = "Facepaint, black" path = /obj/item/facepaint/black +/datum/gear/skullfacepaint + display_name = "Skull Facepaint" + path = /obj/item/facepaint/skull + cost = 3 + /datum/gear/misc/facepaint_body display_name = "Fullbody paint" path = /obj/item/facepaint/sniper From 77a9f061a2a880c879b6cdd0cbbdd4c0a491fc43 Mon Sep 17 00:00:00 2001 From: cm13-github <128137806+cm13-github@users.noreply.github.com> Date: Mon, 27 Nov 2023 08:22:43 +0000 Subject: [PATCH 19/23] Automatic changelog for PR #5042 [ci skip] --- html/changelogs/AutoChangeLog-pr-5042.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-5042.yml diff --git a/html/changelogs/AutoChangeLog-pr-5042.yml b/html/changelogs/AutoChangeLog-pr-5042.yml new file mode 100644 index 000000000000..ff4fbf2ac464 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-5042.yml @@ -0,0 +1,4 @@ +author: "stalkerino" +delete-after: True +changes: + - rscadd: "readds skull facepaint and skull balaclava (blue and black)" \ No newline at end of file From a955791561d5aeab0ff0640923fe1192ad377830 Mon Sep 17 00:00:00 2001 From: fira Date: Mon, 27 Nov 2023 13:22:49 +0100 Subject: [PATCH 20/23] /tg/ Status effects part 1 - fluid status updates (#4828) ![image](https://github.com/cmss13-devs/cmss13/assets/604624/38cdd1a0-e13c-4d69-b893-49cea2a8113f) CM Dev figured it out 9 years ago and nobody listened and kept tacking illogical conditions # About the pull request Builds on previous "prelude" PRs in the following steps: * Ports /tg/ body_position and mobility_flags * Fixes some interaction requirements to use stun/mobility rather than lying/knocked_down * Ports /tg/ granular status updates, ie. status propagating through handlers and signals. This includes changes to resting, buckling, and lying down human transforms. * Wires our status effect system to it directly * Removes `update_canmove` from existence completely as not needed anymore Because step 1 and 2 require updating all the gameplay logic using them, this PR modifies a lot of files. Part 2 will move the actual status effects to /tg/ status_effects, resolving our timing problems. # Testing Photographs and Procedure
Testing Checklist! - [x] Basic Movement - [x] Admin Freeze Prevents Movement - [x] Resting, Getting Up - [x] Xenos change icon when resting - [x] Buckling, including bed rotation and propelled chairs - [x] Crawling Movement including sprite movement - [x] Aggressive, Choke Grabbing, and Fireman carry apply rotation - [x] Xeno Pounce and Abduct properly freeze both target and caster - [x] Double dropship seats density update - [x] Explosive knockout on Humans - [x] Xeno burrow density and movement interactions - [x] Xeno nest interactions, specifically confirm density changes work - [ ] Xeno nest bullet hits doublecheck with snowflake trait check - [x] Combat Xeno ~~knockouts~~ knockdown and sprite updates - [x] ~~Sleeping, Waking up, Usage of items while sleeping~~ - Can't really test this we have almost no sleep code - [x] Arbitrary buckling rotations - [x] Admin-set transforms work with buckling/lying - [ ] All the broken objects that will only be found out in Testmerge
# Changelog :cl: code: Ported basic /tg/ Status Backend. add: Human transform changes such as lying down, knock down, buckling, are now animated. fix: Some statuses will now take effect immediately instead of waiting for a life tick, notably Resting. balance: Many interaction requirements were changed to eg. fail upon stuns rather than if lying down. /:cl: --- .../signals/atom/mob/living/signals_living.dm | 5 + .../dcs/signals/atom/mob/signals_mob.dm | 6 - code/__DEFINES/mobs.dm | 28 +++ code/__DEFINES/traits.dm | 45 +++- code/__HELPERS/animations.dm | 2 + code/__HELPERS/status_effects.dm | 1 + code/__HELPERS/unsorted.dm | 16 +- code/_globalvars/bitfields.dm | 7 + code/_onclick/human.dm | 6 +- code/_onclick/ventcrawl.dm | 4 +- code/_onclick/xeno.dm | 4 +- code/datums/action.dm | 6 +- code/datums/agents/tools/chloroform.dm | 2 - code/datums/ammo/ammo.dm | 6 +- code/datums/ammo/bullet/shotgun.dm | 2 +- code/datums/ammo/xeno.dm | 8 +- code/datums/components/footstep.dm | 2 +- code/datums/diseases/cold.dm | 4 +- code/datums/diseases/flu.dm | 4 +- .../effects/xeno_strains/boiler_trap.dm | 14 +- code/datums/elements/mouth_drop_item.dm | 4 +- code/datums/mob_hud.dm | 4 +- code/game/atoms.dm | 2 +- .../colonialmarines/whiskey_outpost.dm | 4 +- .../gamemodes/colonialmarines/xenovsxeno.dm | 1 - code/game/jobs/job/antag/xeno/xenomorph.dm | 3 +- code/game/machinery/OpTable.dm | 2 +- code/game/machinery/bots/mulebot.dm | 1 - code/game/machinery/computer/aifixer.dm | 1 - code/game/machinery/computer/medical.dm | 2 +- code/game/machinery/computer/robot.dm | 21 +- code/game/machinery/doors/airlock.dm | 2 +- code/game/machinery/doors/firedoor.dm | 2 +- code/game/machinery/fax_machine.dm | 3 +- code/game/machinery/floodlight.dm | 4 +- code/game/machinery/iv_drip.dm | 4 +- code/game/machinery/machinery.dm | 10 +- .../game/machinery/medical_pod/bodyscanner.dm | 4 +- .../game/machinery/medical_pod/medical_pod.dm | 1 - code/game/machinery/medical_pod/sleeper.dm | 4 +- code/game/machinery/nuclearbomb.dm | 4 +- code/game/machinery/pipe/pipe_dispenser.dm | 6 +- code/game/machinery/vending/cm_vending.dm | 2 +- code/game/machinery/vending/vending.dm | 2 +- code/game/objects/effects/acid_hole.dm | 10 +- code/game/objects/effects/aliens.dm | 4 +- code/game/objects/effects/step_triggers.dm | 4 +- code/game/objects/items.dm | 9 +- .../objects/items/devices/autopsy_scanner.dm | 2 +- code/game/objects/items/devices/binoculars.dm | 2 +- .../objects/items/devices/radio/beacon.dm | 2 +- .../items/explosives/grenades/flashbang.dm | 7 +- code/game/objects/items/hoverpack.dm | 4 +- .../items/implants/implantneurostim.dm | 2 +- .../items/reagent_containers/blood_pack.dm | 2 +- code/game/objects/items/storage/backpack.dm | 2 +- code/game/objects/items/storage/internal.dm | 8 +- .../objects/items/storage/large_holster.dm | 2 +- code/game/objects/items/storage/smartpack.dm | 2 +- .../objects/items/tools/experimental_tools.dm | 2 +- code/game/objects/items/toys/toy_weapons.dm | 6 +- code/game/objects/objs.dm | 19 +- code/game/objects/structures.dm | 7 +- .../structures/barricade/deployable.dm | 2 +- code/game/objects/structures/bookcase.dm | 2 +- .../structures/crates_lockers/closets.dm | 11 +- .../crates_lockers/closets/secure/personal.dm | 2 +- .../closets/secure/secure_closets.dm | 2 +- .../crates_lockers/secure_crates.dm | 2 +- code/game/objects/structures/ladders.dm | 12 +- code/game/objects/structures/morgue.dm | 5 +- .../structures/stool_bed_chair_nest/bed.dm | 2 +- .../structures/stool_bed_chair_nest/chairs.dm | 2 +- .../stool_bed_chair_nest/wheelchair.dm | 2 +- .../stool_bed_chair_nest/xeno_nest.dm | 12 +- .../objects/structures/vulture_spotter.dm | 4 +- code/game/objects/structures/watercloset.dm | 1 + code/modules/admin/topic/topic.dm | 11 - code/modules/animations/animation_library.dm | 4 +- code/modules/assembly/infrared.dm | 2 +- code/modules/clothing/glasses/glasses.dm | 62 +++--- code/modules/clothing/glasses/hud.dm | 2 +- code/modules/clothing/gloves/miscellaneous.dm | 2 +- code/modules/clothing/head/misc_special.dm | 56 ++--- code/modules/clothing/masks/breath.dm | 2 +- code/modules/clothing/suits/jobs.dm | 2 +- code/modules/clothing/suits/labcoat.dm | 2 +- code/modules/clothing/suits/marine_armor.dm | 7 +- code/modules/clothing/suits/marine_coat.dm | 2 +- code/modules/clothing/suits/miscellaneous.dm | 2 +- code/modules/clothing/under/under.dm | 2 +- code/modules/cm_aliens/XenoStructures.dm | 5 +- code/modules/cm_aliens/structures/fruit.dm | 2 +- code/modules/cm_aliens/structures/trap.dm | 2 +- code/modules/cm_aliens/structures/tunnel.dm | 4 +- code/modules/cm_marines/Donator_Items.dm | 8 +- code/modules/cm_marines/m2c.dm | 17 +- code/modules/cm_marines/marines_consoles.dm | 4 +- code/modules/cm_marines/orbital_cannon.dm | 2 +- code/modules/cm_marines/smartgun_mount.dm | 10 +- code/modules/cm_preds/thrall_procs.dm | 2 +- code/modules/cm_preds/yaut_bracers.dm | 5 +- code/modules/cm_preds/yaut_procs.dm | 6 +- code/modules/cm_tech/hologram.dm | 1 - code/modules/defenses/defenses.dm | 4 +- .../desert_dam/filtration/filtration.dm | 2 +- .../desert_dam/motion_sensor/sensortower.dm | 2 +- code/modules/droppod/container_droppod.dm | 2 +- code/modules/economy/ATM.dm | 2 +- code/modules/flufftext/Dreaming.dm | 2 +- code/modules/flufftext/Hallucination.dm | 2 +- code/modules/gear_presets/corpses.dm | 1 - code/modules/hydroponics/vines.dm | 1 - code/modules/mob/dead/observer/observer.dm | 4 +- code/modules/mob/death.dm | 2 - code/modules/mob/inventory.dm | 4 - code/modules/mob/living/brain/brain.dm | 9 - code/modules/mob/living/brain/life.dm | 1 - code/modules/mob/living/carbon/carbon.dm | 49 +++-- .../mob/living/carbon/carbon_defines.dm | 1 + code/modules/mob/living/carbon/give.dm | 4 +- code/modules/mob/living/carbon/human/human.dm | 5 +- .../living/carbon/human/human_abilities.dm | 2 - .../living/carbon/human/human_attackhand.dm | 5 +- .../mob/living/carbon/human/human_defines.dm | 1 + .../mob/living/carbon/human/human_helpers.dm | 8 - .../mob/living/carbon/human/human_movement.dm | 9 +- code/modules/mob/living/carbon/human/life.dm | 2 - .../carbon/human/life/handle_disabilities.dm | 8 +- .../living/carbon/human/life/handle_organs.dm | 4 +- .../life/handle_regular_status_updates.dm | 5 +- .../carbon/human/life/handle_stasis_bag.dm | 3 + .../living/carbon/human/life/life_helpers.dm | 29 --- .../carbon/human/powers/human_powers.dm | 53 ++++- .../mob/living/carbon/human/species/monkey.dm | 2 +- .../living/carbon/human/species/species.dm | 17 +- .../mob/living/carbon/human/species/zombie.dm | 5 +- .../mob/living/carbon/human/update_icons.dm | 29 +-- .../modules/mob/living/carbon/update_icons.dm | 5 - .../mob/living/carbon/xenomorph/Embryo.dm | 8 +- .../living/carbon/xenomorph/Facehuggers.dm | 8 +- .../mob/living/carbon/xenomorph/XenoProcs.dm | 15 +- .../abilities/ability_helper_procs.dm | 1 - .../abilities/burrower/burrower_powers.dm | 12 +- .../abilities/crusher/crusher_abilities.dm | 6 +- .../abilities/crusher/crusher_powers.dm | 4 +- .../abilities/defender/defender_powers.dm | 2 - .../xenomorph/abilities/general_abilities.dm | 11 +- .../xenomorph/abilities/general_powers.dm | 3 - .../abilities/hivelord/hivelord_abilities.dm | 2 +- .../abilities/lurker/lurker_powers.dm | 2 +- .../abilities/praetorian/praetorian_powers.dm | 19 +- .../abilities/predalien/predalien_powers.dm | 6 - .../abilities/ravager/ravager_powers.dm | 2 - .../carbon/xenomorph/abilities/xeno_action.dm | 2 +- .../living/carbon/xenomorph/attack_alien.dm | 6 +- .../carbon/xenomorph/castes/Burrower.dm | 7 - .../living/carbon/xenomorph/castes/Carrier.dm | 8 +- .../carbon/xenomorph/castes/Facehugger.dm | 14 +- .../living/carbon/xenomorph/castes/Larva.dm | 6 +- .../living/carbon/xenomorph/castes/Lurker.dm | 2 +- .../living/carbon/xenomorph/castes/Queen.dm | 14 +- .../living/carbon/xenomorph/damage_procs.dm | 2 +- .../mob/living/carbon/xenomorph/life.dm | 17 +- .../mutators/strains/crusher/charger.dm | 2 +- .../mutators/strains/drone/gardener.dm | 4 +- .../mutators/strains/drone/healer.dm | 4 +- .../mutators/strains/praetorian/oppressor.dm | 12 +- .../xenomorph/mutators/strains/runner/acid.dm | 2 +- .../living/carbon/xenomorph/update_icons.dm | 36 +++- code/modules/mob/living/init_signals.dm | 78 ++++++- code/modules/mob/living/living.dm | 202 +++++++++++++++++- code/modules/mob/living/living_defines.dm | 32 ++- .../modules/mob/living/living_health_procs.dm | 41 ++-- code/modules/mob/living/living_verbs.dm | 4 +- code/modules/mob/living/silicon/ai/ai.dm | 4 +- .../modules/mob/living/silicon/decoy/decoy.dm | 2 +- code/modules/mob/living/silicon/robot/life.dm | 16 +- .../modules/mob/living/silicon/robot/robot.dm | 4 +- code/modules/mob/living/simple_animal/bat.dm | 1 - .../living/simple_animal/friendly/mouse.dm | 1 - .../mob/living/simple_animal/hostile/alien.dm | 14 +- .../living/simple_animal/hostile/hostile.dm | 2 +- .../mob/living/simple_animal/parrot.dm | 4 +- .../mob/living/simple_animal/simple_animal.dm | 20 +- code/modules/mob/living/simple_animal/slug.dm | 1 - code/modules/mob/mob.dm | 71 +----- code/modules/mob/mob_defines.dm | 3 - code/modules/mob/mob_grab.dm | 10 +- code/modules/mob/mob_helpers.dm | 13 +- code/modules/mob/mob_movement.dm | 25 ++- code/modules/mob/mob_verbs.dm | 5 +- code/modules/mob/new_player/new_player.dm | 2 +- code/modules/mob/transform_procs.dm | 34 +-- code/modules/nano/nanoui.dm | 6 +- code/modules/paperwork/photography.dm | 2 +- code/modules/power/apc.dm | 4 +- code/modules/projectiles/gun.dm | 6 +- code/modules/projectiles/gun_attachables.dm | 2 +- code/modules/projectiles/gun_helpers.dm | 2 +- .../specialist/launcher/rocket_launcher.dm | 4 +- .../projectiles/guns/specialist/sniper.dm | 4 +- code/modules/projectiles/projectile.dm | 8 +- .../chemistry_machinery/acid_harness.dm | 2 +- .../chemistry_properties/prop_neutral.dm | 2 +- .../chemistry_properties/prop_positive.dm | 2 +- .../reagents/chemistry_reagents/drink.dm | 3 +- .../reagents/chemistry_reagents/toxin.dm | 2 + code/modules/recycling/conveyor2.dm | 2 +- code/modules/recycling/disposal.dm | 10 +- code/modules/shuttles/shuttle_console.dm | 2 - code/modules/sorokyne/sorokyne_cold_water.dm | 6 +- code/modules/surgery/surgery_initiator.dm | 4 +- code/modules/surgery/surgery_procedure.dm | 2 +- code/modules/tgui/status_composers.dm | 11 - .../vehicles/interior/interactable/seats.dm | 11 - code/modules/vehicles/train.dm | 6 +- code/modules/vehicles/van/van.dm | 6 +- colonialmarines.dme | 2 + 219 files changed, 1052 insertions(+), 819 deletions(-) create mode 100644 code/__HELPERS/animations.dm create mode 100644 code/__HELPERS/status_effects.dm diff --git a/code/__DEFINES/dcs/signals/atom/mob/living/signals_living.dm b/code/__DEFINES/dcs/signals/atom/mob/living/signals_living.dm index 89a65dad230e..56cd4dd8cd8e 100644 --- a/code/__DEFINES/dcs/signals/atom/mob/living/signals_living.dm +++ b/code/__DEFINES/dcs/signals/atom/mob/living/signals_living.dm @@ -33,3 +33,8 @@ /// From /mob/living/Collide(): (atom/A) #define COMSIG_LIVING_PRE_COLLIDE "living_pre_collide" #define COMPONENT_LIVING_COLLIDE_HANDLED (1<<0) + +///from base of mob/living/set_buckled(): (new_buckled) +#define COMSIG_LIVING_SET_BUCKLED "living_set_buckled" +///from base of mob/living/set_body_position() +#define COMSIG_LIVING_SET_BODY_POSITION "living_set_body_position" diff --git a/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm b/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm index 32717a2115f2..f4beec321c9e 100644 --- a/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm +++ b/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm @@ -37,10 +37,6 @@ #define COMSIG_MOB_FIRED_GUN_ATTACHMENT "mob_fired_gun_attachment" /// From /mob/proc/death #define COMSIG_MOB_DEATH "mob_death" -/// From /mob/proc/update_canmove() -#define COMSIG_MOB_GETTING_UP "mob_getting_up" -/// From /mob/proc/update_canmove() -#define COMSIG_MOB_KNOCKED_DOWN "mob_knocked_down" /// For when a mob is dragged #define COMSIG_MOB_DRAGGED "mob_dragged" /// From /obj/item/proc/unequipped() @@ -86,8 +82,6 @@ //from /mob/proc/on_deafness_loss() #define COMSIG_MOB_REGAINED_HEARING "mob_regained_hearing" -#define COMSIG_MOB_POST_UPDATE_CANMOVE "mob_can_move" - #define COMSIG_ATTEMPT_MOB_PULL "attempt_mob_pull" #define COMPONENT_CANCEL_MOB_PULL (1<<0) diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index a8b986f8873e..0dcd26de3e3a 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -419,3 +419,31 @@ GLOBAL_LIST_INIT(default_xeno_onmob_icons, list( #define CORE_LIMBS list("chest","head","groin") #define SYMPTOM_ACTIVATION_PROB 3 + +// Body position defines. +/// Mob is standing up, usually associated with lying_angle value of 0. +#define STANDING_UP 0 +/// Mob is lying down, usually associated with lying_angle values of 90 or 270. +#define LYING_DOWN 1 + +/// Possible value of [/atom/movable/buckle_lying]. If set to a different (positive-or-zero) value than this, the buckling thing will force a lying angle on the buckled. +#define NO_BUCKLE_LYING -1 + +// ==================================== +// /mob/living /tg/ mobility_flags +// These represent in what capacity the mob is capable of moving +// Because porting this is underway, NOT ALL FLAGS ARE CURRENTLY IN. + +/// can move +#define MOBILITY_MOVE (1<<0) +/// can, and is, standing up +#define MOBILITY_STAND (1<<1) +/// can rest +#define MOBILITY_REST (1<<7) +/// can lie down +#define MOBILITY_LIEDOWN (1<<8) + +#define MOBILITY_FLAGS_DEFAULT (MOBILITY_MOVE | MOBILITY_STAND) +#define MOBILITY_FLAGS_CARBON_DEFAULT (MOBILITY_MOVE | MOBILITY_STAND | MOBILITY_REST | MOBILITY_LIEDOWN) +#define MOBILITY_FLAGS_REST_CAPABLE_DEFAULT (MOBILITY_MOVE | MOBILITY_STAND | MOBILITY_REST | MOBILITY_LIEDOWN) + diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 7f69a4acc4d6..8962230946c8 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -143,10 +143,18 @@ // #define TRAIT_X "t_x" //-- mob traits -- -/// Prevents voluntary movement. -#define TRAIT_IMMOBILIZED "immobilized" /// Apply this to make a mob not dense, and remove it when you want it to no longer make them undense, other sorces of undesity will still apply. Always define a unique source when adding a new instance of this! #define TRAIT_UNDENSE "undense" +/// Forces the user to stay unconscious. +#define TRAIT_KNOCKEDOUT "knockedout" +/// Prevents voluntary movement. +#define TRAIT_IMMOBILIZED "immobilized" +/// Prevents voluntary standing or staying up on its own. +#define TRAIT_FLOORED "floored" +/// Forces user to stay standing +#define TRAIT_FORCED_STANDING "forcedstanding" +/// Stuns preventing movement and using objects but without further impairement +#define TRAIT_INCAPACITATED "incapacitated" /// Apply this to identify a mob as merged with weeds #define TRAIT_MERGED_WITH_WEEDS "merged_with_weeds" @@ -298,7 +306,10 @@ GLOBAL_LIST_INIT(mob_traits, list( */ GLOBAL_LIST_INIT(traits_by_type, list( /mob = list( + "TRAIT_KNOCKEDOUT" = TRAIT_KNOCKEDOUT, "TRAIT_IMMOBILIZED" = TRAIT_IMMOBILIZED, + "TRAIT_INCAPACITATED" = TRAIT_INCAPACITATED, + "TRAIT_FLOORED" = TRAIT_FLOORED, "TRAIT_UNDENSE" = TRAIT_UNDENSE, "TRAIT_YAUTJA_TECH" = TRAIT_YAUTJA_TECH, "TRAIT_SUPER_STRONG" = TRAIT_SUPER_STRONG, @@ -416,13 +427,39 @@ GLOBAL_LIST(trait_name_map) //Status trait coming from clothing. #define TRAIT_SOURCE_CLOTHING "t_s_clothing" -/// traits associated with actively interacted machinery -#define INTERACTION_TRAIT "interaction" +/// trait associated to being buckled +#define BUCKLED_TRAIT "buckled" // Yes the name doesn't conform. /tg/ appears to have changed naming style inbetween +/// trait source when an effect is coming from a fakedeath effect (refactor this) +#define FAKEDEATH_TRAIT "fakedeath" +/// trait source where a condition comes from body state +#define BODY_TRAIT "body" +/// Trait associated to lying down (having a [lying_angle] of a different value than zero). +#define LYING_DOWN_TRAIT "lying-down" +/// trait associated to a stat value or range of +#define STAT_TRAIT "stat" +/// trait effect related to the queen ovipositor +#define OVIPOSITOR_TRAIT "ovipositor" +/// trait associated to being held in a chokehold +#define CHOKEHOLD_TRAIT "chokehold" /// trait effect related to active specialist gear #define SPECIALIST_GEAR_TRAIT "specialist_gear" /// traits associated with usage of snowflake dropship double seats #define DOUBLE_SEATS_TRAIT "double_seats" /// traits associated with xeno on-ground weeds #define XENO_WEED_TRAIT "xeno_weed" +/// traits associated with actively interacted machinery +#define INTERACTION_TRAIT "interaction" +/// traits bound by stunned status effects +#define STUNNED_TRAIT "stunned" +/// traits bound by knocked_down status effect +#define KNOCKEDDOWN_TRAIT "knockeddown" +/// traits bound by knocked_out status effect +#define KNOCKEDOUT_TRAIT "knockedout" +/// traits from being pounced +#define POUNCED_TRAIT "pounced" +/// traits from step_triggers on the map +#define STEP_TRIGGER_TRAIT "step_trigger" +/// traits from hacked machine interactions +#define HACKED_TRAIT "hacked" /// traits from chloroform usage #define CHLOROFORM_TRAIT "chloroform" diff --git a/code/__HELPERS/animations.dm b/code/__HELPERS/animations.dm new file mode 100644 index 000000000000..f85fb763a4a6 --- /dev/null +++ b/code/__HELPERS/animations.dm @@ -0,0 +1,2 @@ +/// The duration of the animate call in mob/living/update_transform +#define UPDATE_TRANSFORM_ANIMATION_TIME (0.2 SECONDS) diff --git a/code/__HELPERS/status_effects.dm b/code/__HELPERS/status_effects.dm new file mode 100644 index 000000000000..d06cb687f6a5 --- /dev/null +++ b/code/__HELPERS/status_effects.dm @@ -0,0 +1 @@ +#define TRAIT_STATUS_EFFECT(effect_id) "[effect_id]-trait" diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 4bfde929464c..a7af9d7f6324 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1089,7 +1089,7 @@ GLOBAL_DATUM(action_purple_power_up, /image) target_orig_turf = get_turf(target) var/obj/user_holding = busy_user.get_active_hand() var/obj/target_holding - var/cur_user_lying = busy_user.lying + var/cur_user_lying = busy_user.body_position var/cur_target_lying var/expected_total_time = delayfraction*numticks var/time_remaining = expected_total_time @@ -1097,7 +1097,7 @@ GLOBAL_DATUM(action_purple_power_up, /image) if(has_target && istype(T)) cur_target_zone_sel = T.zone_selected target_holding = T.get_active_hand() - cur_target_lying = T.lying + cur_target_lying = T.body_position . = TRUE for(var/i in 1 to numticks) @@ -1121,13 +1121,13 @@ GLOBAL_DATUM(action_purple_power_up, /image) ) . = FALSE break - if(user_flags & INTERRUPT_KNOCKED_DOWN && busy_user.knocked_down || \ - target_is_mob && (target_flags & INTERRUPT_KNOCKED_DOWN && T.knocked_down) + if(user_flags & INTERRUPT_KNOCKED_DOWN && HAS_TRAIT(busy_user, TRAIT_FLOORED) || \ + target_is_mob && (target_flags & INTERRUPT_KNOCKED_DOWN && HAS_TRAIT(T, TRAIT_FLOORED)) ) . = FALSE break - if(user_flags & INTERRUPT_STUNNED && busy_user.stunned || \ - target_is_mob && (target_flags & INTERRUPT_STUNNED && T.stunned) + if(user_flags & INTERRUPT_STUNNED && HAS_TRAIT(busy_user, TRAIT_INCAPACITATED)|| \ + target_is_mob && (target_flags & INTERRUPT_STUNNED && HAS_TRAIT(T, TRAIT_INCAPACITATED)) ) . = FALSE break @@ -1201,8 +1201,8 @@ GLOBAL_DATUM(action_purple_power_up, /image) ) . = FALSE break - if(user_flags & INTERRUPT_CHANGED_LYING && busy_user.lying != cur_user_lying || \ - target_is_mob && (target_flags & INTERRUPT_CHANGED_LYING && T.lying != cur_target_lying) + if(user_flags & INTERRUPT_CHANGED_LYING && busy_user.body_position != cur_user_lying || \ + target_is_mob && (target_flags & INTERRUPT_CHANGED_LYING && T.body_position != cur_target_lying) ) . = FALSE break diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index b85aa18fdb6b..541d1a05362d 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -369,6 +369,13 @@ DEFINE_BITFIELD(mob_flags, list( "NOBIOSCAN" = NOBIOSCAN, )) +DEFINE_BITFIELD(mobility_flags, list( + "MOVE" = MOBILITY_MOVE, + "STAND" = MOBILITY_STAND, + "REST" = MOBILITY_REST, + "LIEDOWN" = MOBILITY_LIEDOWN +)) + DEFINE_BITFIELD(flags, list( "NO_BLOOD" = NO_BLOOD, "NO_BREATHE" = NO_BREATHE, diff --git a/code/_onclick/human.dm b/code/_onclick/human.dm index 8f329656ef6c..b09c26ffb92f 100644 --- a/code/_onclick/human.dm +++ b/code/_onclick/human.dm @@ -64,7 +64,7 @@ /mob/living/carbon/human/UnarmedAttack(atom/A, proximity, click_parameters) - if(lying) //No attacks while laying down + if(body_position == LYING_DOWN) //No attacks while laying down return 0 var/obj/item/clothing/gloves/G = gloves // not typecast specifically enough in defines @@ -88,7 +88,7 @@ /atom/proc/attack_hand(mob/user) return -/mob/living/carbon/human/MouseDrop_T(atom/dropping, mob/user) +/mob/living/carbon/human/MouseDrop_T(atom/dropping, mob/living/user) if(user != src) return . = ..() @@ -153,6 +153,4 @@ target.Move(user.loc, get_dir(target.loc, user.loc)) target.update_transform(TRUE) - target.update_canmove() - diff --git a/code/_onclick/ventcrawl.dm b/code/_onclick/ventcrawl.dm index b079cffe2afe..51afbc139fdd 100644 --- a/code/_onclick/ventcrawl.dm +++ b/code/_onclick/ventcrawl.dm @@ -45,7 +45,7 @@ to_chat(src, SPAN_WARNING("You must be conscious to do this!")) return - if(lying) + if(is_mob_incapacitated()) to_chat(src, SPAN_WARNING("You can't vent crawl while you're stunned!")) return @@ -88,7 +88,7 @@ return updatehealth() - if(stat || stunned || dazed || knocked_down || lying || health < 0 || !client || !ventcrawl_carry()) + if(is_mob_incapacitated(src) || health < 0 || !client || !ventcrawl_carry()) vent_found.animate_ventcrawl_reset() return diff --git a/code/_onclick/xeno.dm b/code/_onclick/xeno.dm index adb637dfe8fa..abb76ded498b 100644 --- a/code/_onclick/xeno.dm +++ b/code/_onclick/xeno.dm @@ -3,7 +3,7 @@ */ /mob/living/carbon/xenomorph/UnarmedAttack(atom/target, proximity, click_parameters, tile_attack = FALSE, ignores_resin = FALSE) - if(lying || HAS_TRAIT(src, TRAIT_ABILITY_BURROWED)) //No attacks while laying down + if(body_position == LYING_DOWN || HAS_TRAIT(src, TRAIT_ABILITY_BURROWED)) //No attacks while laying down return FALSE var/mob/alt @@ -21,7 +21,7 @@ if (!L.is_xeno_grabbable() || L == src) //Xenos never attack themselves. continue - if (L.lying) + if (L.body_position == LYING_DOWN) alt = L continue target = L diff --git a/code/datums/action.dm b/code/datums/action.dm index 47b302e09aac..0510a43415a7 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -187,8 +187,10 @@ I.ui_action_click(owner, holder_item) /datum/action/item_action/can_use_action() - if(ishuman(owner) && !owner.is_mob_incapacitated() && !owner.lying) - return TRUE + if(ishuman(owner) && !owner.is_mob_incapacitated()) + var/mob/living/carbon/human/human = owner + if(human.body_position == STANDING_UP) + return TRUE /datum/action/item_action/update_button_icon() button.overlays.Cut() diff --git a/code/datums/agents/tools/chloroform.dm b/code/datums/agents/tools/chloroform.dm index c6e3320688eb..b1c666ac9ec8 100644 --- a/code/datums/agents/tools/chloroform.dm +++ b/code/datums/agents/tools/chloroform.dm @@ -50,7 +50,6 @@ ADD_TRAIT(M, TRAIT_IMMOBILIZED, CHLOROFORM_TRAIT) ADD_TRAIT(M, TRAIT_UNDENSE, CHLOROFORM_TRAIT) M.able_to_speak = FALSE - M.update_canmove() M.drop_inv_item_on_ground(M.wear_mask, force = TRUE) @@ -79,7 +78,6 @@ /obj/item/weapon/chloroform/proc/remove_stun(mob/living/M) animate(M, pixel_x = 0, pixel_y = 0, time = 0.2 SECONDS, easing = QUAD_EASING) M.anchored = FALSE - M.density = TRUE M.able_to_speak = TRUE M.layer = MOB_LAYER REMOVE_TRAIT(M, TRAIT_IMMOBILIZED, CHLOROFORM_TRAIT) diff --git a/code/datums/ammo/ammo.dm b/code/datums/ammo/ammo.dm index a858c6b1f5a7..9faaf299669d 100644 --- a/code/datums/ammo/ammo.dm +++ b/code/datums/ammo/ammo.dm @@ -138,7 +138,7 @@ /datum/ammo/proc/knockback(mob/living/living_mob, obj/projectile/fired_projectile, max_range = 2) if(!living_mob || living_mob == fired_projectile.firer) return - if(fired_projectile.distance_travelled > max_range || living_mob.lying) + if(fired_projectile.distance_travelled > max_range || living_mob.body_position == LYING_DOWN) return //Two tiles away or more, basically. if(living_mob.mob_size >= MOB_SIZE_BIG) @@ -180,8 +180,8 @@ else living_mob.apply_stamina_damage(fired_projectile.ammo.damage, fired_projectile.def_zone, ARMOR_BULLET) -/datum/ammo/proc/pushback(mob/target_mob, obj/projectile/fired_projectile, max_range = 2) - if(!target_mob || target_mob == fired_projectile.firer || fired_projectile.distance_travelled > max_range || target_mob.lying) +/datum/ammo/proc/pushback(mob/living/target_mob, obj/projectile/fired_projectile, max_range = 2) + if(!target_mob || target_mob == fired_projectile.firer || fired_projectile.distance_travelled > max_range || target_mob.body_position == LYING_DOWN) return if(target_mob.mob_size >= MOB_SIZE_BIG) diff --git a/code/datums/ammo/bullet/shotgun.dm b/code/datums/ammo/bullet/shotgun.dm index 4cedb8b3ee69..77e1e6401472 100644 --- a/code/datums/ammo/bullet/shotgun.dm +++ b/code/datums/ammo/bullet/shotgun.dm @@ -334,7 +334,7 @@ if(P.distance_travelled > 8) knockback(M, P, 12) - else if(!M || M == P.firer || M.lying) //These checks are included in knockback and would be redundant above. + else if(!M || M == P.firer || M.body_position == LYING_DOWN) //These checks are included in knockback and would be redundant above. return shake_camera(M, 3, 4) diff --git a/code/datums/ammo/xeno.dm b/code/datums/ammo/xeno.dm index 75c78298fe4f..9ecc9ebf9321 100644 --- a/code/datums/ammo/xeno.dm +++ b/code/datums/ammo/xeno.dm @@ -49,9 +49,9 @@ if(!isxeno(M)) if(insta_neuro) - if(M.knocked_down < 3) + if(M.GetKnockDownValueNotADurationDoNotUse() < 3) // If they have less than somewhere random between 4 and 6 seconds KD left and assuming it doesnt get refreshed itnernally M.adjust_effect(1 * power, WEAKEN) - return + return if(ishuman(M)) M.apply_effect(2.5, SUPERSLOW) @@ -65,7 +65,7 @@ no_clothes_neuro = TRUE if(no_clothes_neuro) - if(M.knocked_down < 5) + if(M.GetKnockDownValueNotADurationDoNotUse() < 5) // If they have less than somewhere random between 8 and 10 seconds KD left and assuming it doesnt get refreshed itnernally M.adjust_effect(1 * power, WEAKEN) // KD them a bit more M.visible_message(SPAN_DANGER("[M] falls prone.")) @@ -79,7 +79,7 @@ H.visible_message(SPAN_DANGER("[M] shrugs off the neurotoxin!")) return - if(M.knocked_down < 0.7) // apply knockdown only if current knockdown is less than 0.7 second + if(M.GetKnockDownValueNotADurationDoNotUse() < 0.7) // basically (knocked_down && prob(90)) M.apply_effect(0.7, WEAKEN) M.visible_message(SPAN_DANGER("[M] falls prone.")) diff --git a/code/datums/components/footstep.dm b/code/datums/components/footstep.dm index ef77aaf471dc..6eaaa6e76af5 100644 --- a/code/datums/components/footstep.dm +++ b/code/datums/components/footstep.dm @@ -47,7 +47,7 @@ if(!T) return var/mob/living/parent_mob = parent - if(parent_mob.lying && (isfile(drag_sounds) || istext(drag_sounds))) + if(parent_mob.body_position == LYING_DOWN && (isfile(drag_sounds) || istext(drag_sounds))) playsound(T, drag_sounds, volume, rand(20000, 25000), range, falloff = falloff) else if(isfile(footstep_sounds) || istext(footstep_sounds)) playsound(T, footstep_sounds, volume, rand(20000, 25000), range, falloff = falloff) diff --git a/code/datums/diseases/cold.dm b/code/datums/diseases/cold.dm index 46cd8952dda1..fd3fbc3a7d2d 100644 --- a/code/datums/diseases/cold.dm +++ b/code/datums/diseases/cold.dm @@ -20,7 +20,7 @@ cure() return */ - if(affected_mob.lying && prob(40)) //changed FROM prob(10) until sleeping is fixed + if(affected_mob.body_position == LYING_DOWN && prob(40)) //changed FROM prob(10) until sleeping is fixed to_chat(affected_mob, SPAN_NOTICE(" You feel better.")) cure() return @@ -43,7 +43,7 @@ cure() return */ - if(affected_mob.lying && prob(25)) //changed FROM prob(5) until sleeping is fixed + if(affected_mob.body_position == LYING_DOWN && prob(25)) //changed FROM prob(5) until sleeping is fixed to_chat(affected_mob, SPAN_NOTICE(" You feel better.")) cure() return diff --git a/code/datums/diseases/flu.dm b/code/datums/diseases/flu.dm index f2c029587616..fad0b15228b1 100644 --- a/code/datums/diseases/flu.dm +++ b/code/datums/diseases/flu.dm @@ -21,7 +21,7 @@ stage-- return */ - if(affected_mob.lying && prob(20)) //added until sleeping is fixed --Blaank + if(affected_mob.body_position == LYING_DOWN && prob(20)) //added until sleeping is fixed --Blaank to_chat(affected_mob, SPAN_NOTICE(" You feel better.")) stage-- return @@ -46,7 +46,7 @@ stage-- return */ - if(affected_mob.lying && prob(15)) //added until sleeping is fixed + if(affected_mob.body_position == LYING_DOWN && prob(15)) //added until sleeping is fixed to_chat(affected_mob, SPAN_NOTICE(" You feel better.")) stage-- return diff --git a/code/datums/effects/xeno_strains/boiler_trap.dm b/code/datums/effects/xeno_strains/boiler_trap.dm index 1833b9641a9a..199505379b27 100644 --- a/code/datums/effects/xeno_strains/boiler_trap.dm +++ b/code/datums/effects/xeno_strains/boiler_trap.dm @@ -5,16 +5,16 @@ duration = null flags = INF_DURATION -/datum/effects/boiler_trap/New(atom/A, mob/from, last_dmg_source, zone) +/datum/effects/boiler_trap/New(atom/A, mob/living/from, last_dmg_source, zone) . = ..() if(!QDELETED(src)) - var/mob/M = affected_atom - ADD_TRAIT(M, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name)) + var/mob/living/affected_living = affected_atom + ADD_TRAIT(affected_living, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name)) /datum/effects/boiler_trap/Destroy(force) if(ismob(affected_atom)) - var/mob/M = affected_atom - REMOVE_TRAIT(M, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name)) + var/mob/living/affected_living = affected_atom + REMOVE_TRAIT(affected_living, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name)) return ..() /datum/effects/boiler_trap/validate_atom(atom/A) @@ -26,6 +26,6 @@ /datum/effects/boiler_trap/process_mob() . = ..() if(!.) return FALSE - var/mob/M = affected_atom - ADD_TRAIT(M, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name)) + var/mob/living/affected_living = affected_atom + ADD_TRAIT(affected_living, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY(effect_name)) return TRUE diff --git a/code/datums/elements/mouth_drop_item.dm b/code/datums/elements/mouth_drop_item.dm index 42c61bd275cc..7a546c6b3933 100644 --- a/code/datums/elements/mouth_drop_item.dm +++ b/code/datums/elements/mouth_drop_item.dm @@ -19,9 +19,9 @@ SIGNAL_HANDLER if(slot == WEAR_FACE) - I.RegisterSignal(user, COMSIG_MOB_KNOCKED_DOWN, TYPE_PROC_REF(/obj/item, drop_to_floor)) + I.RegisterSignal(user, COMSIG_LIVING_SET_BODY_POSITION, TYPE_PROC_REF(/obj/item, drop_to_floor)) /datum/element/mouth_drop_item/proc/item_dropped(obj/item/I, mob/living/carbon/human/user) SIGNAL_HANDLER - I.UnregisterSignal(user, COMSIG_MOB_KNOCKED_DOWN) + I.UnregisterSignal(user, COMSIG_LIVING_SET_BODY_POSITION) diff --git a/code/datums/mob_hud.dm b/code/datums/mob_hud.dm index f3864476431b..e4ec3acc1410 100644 --- a/code/datums/mob_hud.dm +++ b/code/datums/mob_hud.dm @@ -803,8 +803,6 @@ GLOBAL_DATUM(hud_icon_hudfocus, /image) if (tag_found) tag_holder.overlays += image('icons/mob/hud/hud.dmi', src, "prae_tag") - // Hacky, but works. Currently effects are hard to make with precise timings - var/freeze_found = HAS_TRAIT(src, TRAIT_IMMOBILIZED) && !buckled && !lying - + var/freeze_found = HAS_TRAIT(src, TRAIT_IMMOBILIZED) && body_position == STANDING_UP && !buckled // Eligible targets are unable to move but can stand and aren't buckled (eg nested) - This is to convey that they are temporarily unable to move if (freeze_found) freeze_holder.overlays += image('icons/mob/hud/hud.dmi', src, "xeno_freeze") diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 17642836ba3f..5f36b3b8b390 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -166,7 +166,7 @@ directive is properly returned. if(!time) transform = complete return - animate(src, transform = complete, time = time, easing = easing) + animate(src, transform = complete, time = time, easing = easing, flags = ANIMATION_PARALLEL) /// Upates the base_transform which will be compounded with other transforms /atom/proc/update_base_transform(matrix/new_transform, time = 0) diff --git a/code/game/gamemodes/colonialmarines/whiskey_outpost.dm b/code/game/gamemodes/colonialmarines/whiskey_outpost.dm index 11e26e195c12..3bc56728a7b9 100644 --- a/code/game/gamemodes/colonialmarines/whiskey_outpost.dm +++ b/code/game/gamemodes/colonialmarines/whiskey_outpost.dm @@ -511,10 +511,10 @@ unacidable = TRUE var/working = 0 -/obj/structure/machinery/wo_recycler/attack_hand(mob/user) +/obj/structure/machinery/wo_recycler/attack_hand(mob/living/user) if(inoperable(MAINT)) return - if(user.lying || user.stat) + if(user.is_mob_incapacitated()) return if(ismaintdrone(usr) || \ istype(usr, /mob/living/carbon/xenomorph)) diff --git a/code/game/gamemodes/colonialmarines/xenovsxeno.dm b/code/game/gamemodes/colonialmarines/xenovsxeno.dm index 32afb2156925..a9ad48196257 100644 --- a/code/game/gamemodes/colonialmarines/xenovsxeno.dm +++ b/code/game/gamemodes/colonialmarines/xenovsxeno.dm @@ -141,7 +141,6 @@ original.statistic_exempt = TRUE original.buckled = start_nest original.setDir(start_nest.dir) - original.update_canmove() start_nest.buckled_mob = original start_nest.afterbuckle(original) diff --git a/code/game/jobs/job/antag/xeno/xenomorph.dm b/code/game/jobs/job/antag/xeno/xenomorph.dm index 53b06147e28c..78b6ab7e3ab2 100644 --- a/code/game/jobs/job/antag/xeno/xenomorph.dm +++ b/code/game/jobs/job/antag/xeno/xenomorph.dm @@ -88,9 +88,8 @@ break human_to_transform.statistic_exempt = TRUE - human_to_transform.buckled = start_nest + human_to_transform.set_buckled(start_nest) human_to_transform.setDir(start_nest.dir) - human_to_transform.update_canmove() start_nest.buckled_mob = human_to_transform start_nest.afterbuckle(human_to_transform) diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm index c9092a750f73..03c013703b07 100644 --- a/code/game/machinery/OpTable.dm +++ b/code/game/machinery/OpTable.dm @@ -19,7 +19,7 @@ active_power_usage = 5 var/strapped = 0 can_buckle = TRUE - buckle_lying = TRUE + buckle_lying = 90 var/buckling_y = -4 surgery_duration_multiplier = SURGERY_SURFACE_MULT_IDEAL //Ideal surface for surgery. var/patient_exam = 0 diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm index b91b865b96a9..08437d35a8e3 100644 --- a/code/game/machinery/bots/mulebot.dm +++ b/code/game/machinery/bots/mulebot.dm @@ -763,7 +763,6 @@ M.stop_pulling() M.apply_effect(8, STUN) M.apply_effect(5, WEAKEN) - M.lying = 1 ..() /obj/structure/machinery/bot/mulebot/alter_health() diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm index 67e4e8ed35ab..3a809620d7e6 100644 --- a/code/game/machinery/computer/aifixer.dm +++ b/code/game/machinery/computer/aifixer.dm @@ -68,7 +68,6 @@ src.occupant.updatehealth() if (src.occupant.health >= 0 && src.occupant.stat == DEAD) src.occupant.set_stat(CONSCIOUS) - src.occupant.lying = 0 GLOB.dead_mob_list -= src.occupant GLOB.alive_mob_list += src.occupant occupant.reload_fullscreens() diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index d28825939d86..20aa6925d0b4 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -24,7 +24,7 @@ set name = "Eject ID Card" set src in oview(1) - if(!usr || usr.stat || usr.lying) return + if(!usr || usr.is_mob_incapacitated()) return if(scan) to_chat(usr, "You remove \the [scan] from \the [src].") diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm index c5a13e2c3e74..19e3ac900af6 100644 --- a/code/game/machinery/computer/robot.dm +++ b/code/game/machinery/computer/robot.dm @@ -51,11 +51,11 @@ dat += "[R.name] |" if(R.stat) dat += " Not Responding |" - else if (!R.canmove) + else if (HAS_TRAIT_FROM(R, TRAIT_IMMOBILIZED, HACKED_TRAIT)) dat += " Locked Down |" else dat += " Operating Normally |" - if(R.canmove && R.cell) + if(R.cell) dat += " Battery Installed ([R.cell.charge]/[R.cell.maxcharge]) |" else dat += " No Cell Installed |" @@ -70,7 +70,8 @@ if (isRemoteControlling(user)) if((user.mind.original == user)) dat += "(Hack) " - dat += "([R.canmove ? "Lockdown" : "Release"]) " + var/canmove = HAS_TRAIT_FROM(src, TRAIT_IMMOBILIZED, HACKED_TRAIT) + dat += "([canmove ? "Lockdown" : "Release"]) " dat += "(Destroy)" dat += "
" dat += "(Return to Main Menu)
" @@ -161,20 +162,22 @@ else if (href_list["stopbot"]) if(src.allowed(usr)) var/mob/living/silicon/robot/R = locate(href_list["stopbot"]) + var/canmove = HAS_TRAIT_FROM(src, TRAIT_IMMOBILIZED, HACKED_TRAIT) if(R && istype(R)) // Extra sancheck because of input var references - var/choice = tgui_input_list(usr, "Are you certain you wish to [R.canmove ? "lock down" : "release"] [R.name]?", "Hack machine", list("Confirm", "Abort")) + var/choice = tgui_input_list(usr, "Are you certain you wish to [canmove ? "lock down" : "release"] [R.name]?", "Hack machine", list("Confirm", "Abort")) if(choice == "Confirm") if(R && istype(R)) - message_admins("[key_name_admin(usr)] [R.canmove ? "locked down" : "released"] [R.name]!") - log_game("[key_name(usr)] [R.canmove ? "locked down" : "released"] [R.name]!") - R.canmove = !R.canmove + message_admins("[key_name_admin(usr)] [canmove ? "locked down" : "released"] [R.name]!") + log_game("[key_name(usr)] [canmove ? "locked down" : "released"] [R.name]!") + if(canmove) + ADD_TRAIT(src, TRAIT_IMMOBILIZED, HACKED_TRAIT) + else + REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, HACKED_TRAIT) if (R.lockcharge) - // R.cell.charge = R.lockcharge R.lockcharge = !R.lockcharge to_chat(R, "Your lockdown has been lifted!") else R.lockcharge = !R.lockcharge - // R.cell.charge = 0 to_chat(R, "You have been locked down!") else diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 80306ab483b1..4e362ef12fac 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -91,7 +91,7 @@ GLOBAL_LIST_INIT(airlock_wire_descriptions, list( else if(user.hallucination > 50 && prob(10) && operating == 0) to_chat(user, SPAN_DANGER("You feel a powerful shock course through your body!")) user.halloss += 10 - user.stunned += 10 + user.apply_effect(10, STUN) return ..(user) diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index efb4a7d05c9d..cddd67c7e2b2 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -132,7 +132,7 @@ "Would you like to [density ? "open" : "close"] this [src.name]?[ alarmed && density ? "\nNote that by doing so, you acknowledge any damages from opening this\n[src.name] as being your own fault, and you will be held accountable under the law." : ""]",\ "\The [src]", list("Yes", "No")) != "Yes") return - if(user.is_mob_incapacitated() || (!user.canmove && !isRemoteControlling(user)) || (get_dist(src, user) > 1 && !isRemoteControlling(user))) + if(user.is_mob_incapacitated() || (get_dist(src, user) > 1 && !isRemoteControlling(user))) to_chat(user, "Sorry, you must remain able bodied and close to \the [src] in order to use it.") return if(density && (inoperable())) //can still close without power diff --git a/code/game/machinery/fax_machine.dm b/code/game/machinery/fax_machine.dm index db9a1dbbf76e..4a5c62b1f9a0 100644 --- a/code/game/machinery/fax_machine.dm +++ b/code/game/machinery/fax_machine.dm @@ -110,7 +110,8 @@ GLOBAL_LIST_EMPTY(alldepartments) set category = "Object" set name = "Eject ID Card" set src in view(1) - if(!usr || usr.stat || usr.lying) return + if(usr.is_mob_incapacitated()) + return if(ishuman(usr) && scan) to_chat(usr, "You remove \the [scan] from \the [src].") diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm index 516cdad380b1..580fea644eec 100644 --- a/code/game/machinery/floodlight.dm +++ b/code/game/machinery/floodlight.dm @@ -36,12 +36,12 @@ update_icon() -/obj/structure/machinery/floodlight/attack_hand(mob/user) +/obj/structure/machinery/floodlight/attack_hand(mob/living/user) if(!toggleable) to_chat(user, SPAN_NOTICE("[src] doesn't seem to have a switch to toggle the light.")) return - if(user.lying || user.stat) + if(user.is_mob_incapacitated()) return if(!is_valid_user(user)) diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index ef6c74a052cd..4b863bec043d 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -57,7 +57,7 @@ if(ishuman(usr)) var/mob/living/carbon/human/user = usr - if(user.stat || get_dist(user, src) > 1 || user.blinded || user.lying) + if(user.is_mob_incapacitated() || get_dist(user, src) > 1 || user.blinded) return if(!skillcheck(user, SKILL_SURGERY, SKILL_SURGERY_NOVICE)) @@ -179,7 +179,7 @@ if(!istype(usr, /mob/living)) return - if(usr.stat || usr.lying) + if(usr.stat || usr.is_mob_incapacitated()) return mode = !mode diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 93c7327c8045..c5eaa14e05b5 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -229,7 +229,11 @@ Class Procs: return TRUE if(inoperable()) return 1 - if(usr.is_mob_restrained() || usr.lying || usr.stat) + if(isliving(usr)) + var/mob/living/living = usr + if(living.body_position == LYING_DOWN) // legacy. if you too find it doesn't make sense, consider removing it + return TRUE + if(usr.is_mob_restrained()) return 1 if(!is_valid_user(usr)) to_chat(usr, SPAN_DANGER("You don't have the dexterity to do this!")) @@ -251,10 +255,10 @@ Class Procs: else return src.attack_hand(user) -/obj/structure/machinery/attack_hand(mob/user as mob) +/obj/structure/machinery/attack_hand(mob/living/user as mob) if(inoperable(MAINT)) return TRUE - if(user.lying || user.stat) + if(user.is_mob_incapacitated()) return TRUE if(!is_valid_user(user)) to_chat(usr, SPAN_DANGER("You don't have the dexterity to do this!")) diff --git a/code/game/machinery/medical_pod/bodyscanner.dm b/code/game/machinery/medical_pod/bodyscanner.dm index fdcd0ceb62e6..bbc3be7d5aae 100644 --- a/code/game/machinery/medical_pod/bodyscanner.dm +++ b/code/game/machinery/medical_pod/bodyscanner.dm @@ -204,7 +204,7 @@ "toxloss" = H.getToxLoss(), "cloneloss" = H.getCloneLoss(), "brainloss" = H.getBrainLoss(), - "knocked_out" = H.knocked_out, + "knocked_out" = H.GetKnockOutValueNotADurationDoNotUse(), "bodytemp" = H.bodytemperature, "inaprovaline_amount" = H.reagents.get_reagent_amount("inaprovaline"), "dexalin_amount" = H.reagents.get_reagent_amount("dexalin"), @@ -263,7 +263,7 @@ s_class = occ["brainloss"] < 1 ? INTERFACE_GOOD : INTERFACE_BAD dat += "[SET_CLASS("  Approx. Brain Damage:", INTERFACE_PINK)] [SET_CLASS("[occ["brainloss"]]%", s_class)]

" - dat += "[SET_CLASS("Knocked Out Summary:", "#40628a")] [occ["knocked_out"]]% ([round(occ["knocked_out"] / 4)] seconds left!)
" + dat += "[SET_CLASS("Knocked Out Summary:", "#40628a")] [occ["knocked_out"]]% (approximately [round(occ["knocked_out"] / 5)] seconds left!)
" dat += "[SET_CLASS("Body Temperature:", "#40628a")] [occ["bodytemp"]-T0C]°C ([occ["bodytemp"]*1.8-459.67]°F)

" s_class = occ["blood_amount"] > 448 ? INTERFACE_OKAY : INTERFACE_BAD diff --git a/code/game/machinery/medical_pod/medical_pod.dm b/code/game/machinery/medical_pod/medical_pod.dm index b284d71ad4a7..62c8eef1f72c 100644 --- a/code/game/machinery/medical_pod/medical_pod.dm +++ b/code/game/machinery/medical_pod/medical_pod.dm @@ -155,7 +155,6 @@ if(exit_stun) occupant.apply_effect(exit_stun, STUN) //Action delay when going out - occupant.update_canmove() //Force the delay to go in action immediately occupant.visible_message(SPAN_WARNING("[occupant] pops out of \the [src]!"), SPAN_WARNING("You get out of \the [src] and get your bearings!")) diff --git a/code/game/machinery/medical_pod/sleeper.dm b/code/game/machinery/medical_pod/sleeper.dm index afd7c43979f0..fe2b698caed0 100644 --- a/code/game/machinery/medical_pod/sleeper.dm +++ b/code/game/machinery/medical_pod/sleeper.dm @@ -390,8 +390,8 @@ to_chat(user, "[]\t -Respiratory Damage %: []", (occupant.getOxyLoss() < 60 ? SPAN_NOTICE("") : SPAN_DANGER("")), occupant.getOxyLoss()) to_chat(user, "[]\t -Toxin Content %: []", (occupant.getToxLoss() < 60 ? SPAN_NOTICE("") : SPAN_DANGER("")), occupant.getToxLoss()) to_chat(user, "[]\t -Burn Severity %: []", (occupant.getFireLoss() < 60 ? SPAN_NOTICE("") : SPAN_DANGER("")), occupant.getFireLoss()) - to_chat(user, SPAN_NOTICE(" Expected time till occupant can safely awake: (note: If health is below 20% these times are inaccurate)")) - to_chat(user, SPAN_NOTICE(" \t [occupant.knocked_out / 5] second\s (if around 1 or 2 the sleeper is keeping them asleep.)")) + to_chat(user, SPAN_NOTICE(" Expected time till occupant can safely awake: (note: These times are always inaccurate)")) + to_chat(user, SPAN_NOTICE(" \t [occupant.GetKnockOutValueNotADurationDoNotUse() / 5] second\s (if around 1 or 2 the sleeper is keeping them asleep.)")) else to_chat(user, SPAN_NOTICE(" There is no one inside!")) return diff --git a/code/game/machinery/nuclearbomb.dm b/code/game/machinery/nuclearbomb.dm index 306f9c8bbcbe..369953788ae1 100644 --- a/code/game/machinery/nuclearbomb.dm +++ b/code/game/machinery/nuclearbomb.dm @@ -98,7 +98,7 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) ..() /obj/structure/machinery/nuclearbomb/attack_hand(mob/user as mob) - if(user.is_mob_incapacitated() || !user.canmove || get_dist(src, user) > 1 || isRemoteControlling(user)) + if(user.is_mob_incapacitated() || get_dist(src, user) > 1 || isRemoteControlling(user)) return if(isyautja(user)) @@ -290,7 +290,7 @@ GLOBAL_VAR_INIT(bomb_set, FALSE) set name = "Make Deployable" set src in oview(1) - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || being_used || timing) + if(usr.is_mob_incapacitated() || being_used || timing) return if(!ishuman(usr)) diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm index fc8815b0511f..e007ada79a0e 100644 --- a/code/game/machinery/pipe/pipe_dispenser.dm +++ b/code/game/machinery/pipe/pipe_dispenser.dm @@ -75,7 +75,7 @@ /obj/structure/machinery/pipedispenser/Topic(href, href_list) if(..()) return - if(unwrenched || !usr.canmove || usr.stat || usr.is_mob_restrained() || !in_range(loc, usr)) + if(unwrenched || usr.is_mob_incapacitated() || !in_range(loc, usr)) close_browser(usr, "pipedispenser") return usr.set_interaction(src) @@ -150,7 +150,7 @@ Nah //Allow you to drag-drop disposal pipes into it /obj/structure/machinery/pipedispenser/disposal/MouseDrop_T(obj/structure/disposalconstruct/pipe as obj, mob/usr as mob) - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) return if (!istype(pipe) || get_dist(usr, src) > 1 || get_dist(src,pipe) > 1 ) @@ -192,7 +192,7 @@ Nah usr.set_interaction(src) src.add_fingerprint(usr) if(href_list["dmake"]) - if(unwrenched || !usr.canmove || usr.stat || usr.is_mob_restrained() || !in_range(loc, usr)) + if(unwrenched || usr.is_mob_incapacitated() || !in_range(loc, usr)) close_browser(usr, "pipedispenser") return if(!wait) diff --git a/code/game/machinery/vending/cm_vending.dm b/code/game/machinery/vending/cm_vending.dm index b1d5fc9bb706..6205f24c8e05 100644 --- a/code/game/machinery/vending/cm_vending.dm +++ b/code/game/machinery/vending/cm_vending.dm @@ -899,7 +899,7 @@ GLOBAL_LIST_EMPTY(vending_products) if(inoperable()) return - if(user.stat || user.is_mob_restrained() || user.lying) + if(user.stat || user.is_mob_restrained()) return if(get_dist(user, src) > 1 || get_dist(src, A) > 1) diff --git a/code/game/machinery/vending/vending.dm b/code/game/machinery/vending/vending.dm index da1673cad06f..b6c4da03640c 100644 --- a/code/game/machinery/vending/vending.dm +++ b/code/game/machinery/vending/vending.dm @@ -820,7 +820,7 @@ GLOBAL_LIST_EMPTY_TYPED(total_vending_machines, /obj/structure/machinery/vending if(inoperable()) return - if(user.stat || user.is_mob_restrained() || user.lying) + if(user.stat || user.is_mob_restrained()) return if(get_dist(user, src) > 1 || get_dist(src, A) > 1) diff --git a/code/game/objects/effects/acid_hole.dm b/code/game/objects/effects/acid_hole.dm index 415df0e7e5a7..a4db9ef5c0e0 100644 --- a/code/game/objects/effects/acid_hole.dm +++ b/code/game/objects/effects/acid_hole.dm @@ -50,18 +50,18 @@ return XENO_NO_DELAY_ACTION /obj/effect/acid_hole/proc/expand_hole(mob/living/carbon/xenomorph/user) - if(user.action_busy || user.lying) + if(user.action_busy || user.is_mob_incapacitated()) return playsound(src, "pry", 25, 1) xeno_attack_delay(user) - if(do_after(user, 60, INTERRUPT_ALL, BUSY_ICON_GENERIC) && !QDELETED(src) && holed_wall && !user.lying && istype(holed_wall)) + if(do_after(user, 60, INTERRUPT_ALL, BUSY_ICON_GENERIC) && !QDELETED(src) && holed_wall && istype(holed_wall)) holed_wall.take_damage(rand(2000,3500)) user.emote("roar") -/obj/effect/acid_hole/proc/use_wall_hole(mob/user) +/obj/effect/acid_hole/proc/use_wall_hole(mob/living/user) - if(user.mob_size >= MOB_SIZE_BIG || user.is_mob_incapacitated() || user.lying || user.buckled || user.anchored) + if(user.mob_size >= MOB_SIZE_BIG || user.is_mob_incapacitated() || user.buckled || user.anchored) return FALSE var/mob_dir = get_dir(user, src) @@ -95,7 +95,7 @@ to_chat(user, SPAN_NOTICE("You start crawling through the hole.")) if(do_after(user, 15, INTERRUPT_NO_NEEDHAND, BUSY_ICON_GENERIC)) - if(!user.is_mob_incapacitated() && !user.lying && !user.buckled) + if(!user.is_mob_incapacitated() && !user.buckled) if (T.density) return for(var/obj/O in T) diff --git a/code/game/objects/effects/aliens.dm b/code/game/objects/effects/aliens.dm index 867c6924b39d..0b44c0bb4443 100644 --- a/code/game/objects/effects/aliens.dm +++ b/code/game/objects/effects/aliens.dm @@ -160,7 +160,7 @@ //damages human that comes in contact /obj/effect/xenomorph/spray/proc/apply_spray(mob/living/carbon/H, should_stun = TRUE) - if(!H.lying) + if(H.body_position == STANDING_UP) to_chat(H, SPAN_DANGER("Your feet scald and burn! Argh!")) if(ishuman(H)) H.emote("pain") @@ -264,7 +264,7 @@ else PAS.increment_stack_count(2) - if(!H.lying) + if(H.body_position == STANDING_UP) to_chat(H, SPAN_DANGER("Your feet scald and burn! Argh!")) H.emote("pain") H.last_damage_data = cause_data diff --git a/code/game/objects/effects/step_triggers.dm b/code/game/objects/effects/step_triggers.dm index 2499810cbd3f..ab3c248c797f 100644 --- a/code/game/objects/effects/step_triggers.dm +++ b/code/game/objects/effects/step_triggers.dm @@ -50,7 +50,7 @@ if(ismob(AM)) var/mob/M = AM if(immobilize) - M.canmove = 0 + ADD_TRAIT(M, TRAIT_IMMOBILIZED, STEP_TRIGGER_TRAIT) affecting.Add(AM) while(AM && !stopthrow) @@ -87,7 +87,7 @@ if(ismob(AM)) var/mob/M = AM if(immobilize) - M.canmove = 1 + REMOVE_TRAIT(M, TRAIT_IMMOBILIZED, STEP_TRIGGER_TRAIT) /* Stops things thrown by a thrower, doesn't do anything */ diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index f27a35457a7c..11da4cce6d98 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -517,14 +517,14 @@ cases. Override_icon_state should be a list.*/ if(WEAR_L_HAND) if(human.l_hand) return FALSE - if(human.lying) + if(human.body_position == LYING_DOWN) to_chat(human, SPAN_WARNING("You can't equip that while lying down.")) return return TRUE if(WEAR_R_HAND) if(human.r_hand) return FALSE - if(human.lying) + if(human.body_position == LYING_DOWN) to_chat(human, SPAN_WARNING("You can't equip that while lying down.")) return return TRUE @@ -920,9 +920,10 @@ cases. Override_icon_state should be a list.*/ mob_state += GLOB.slot_to_contained_sprite_shorthand[slot] return mob_state -/obj/item/proc/drop_to_floor(mob/wearer) +/obj/item/proc/drop_to_floor(mob/wearer, body_position) SIGNAL_HANDLER - wearer.drop_inv_item_on_ground(src) + if(body_position == LYING_DOWN) + wearer.drop_inv_item_on_ground(src) // item animatzionen diff --git a/code/game/objects/items/devices/autopsy_scanner.dm b/code/game/objects/items/devices/autopsy_scanner.dm index 67d18924c02b..6703ead88147 100644 --- a/code/game/objects/items/devices/autopsy_scanner.dm +++ b/code/game/objects/items/devices/autopsy_scanner.dm @@ -174,7 +174,7 @@ M.update_inv_r_hand() /obj/item/device/autopsy_scanner/attack(mob/living/carbon/human/M as mob, mob/living/carbon/user as mob) - if(!istype(M) || !M.lying) + if(!istype(M) || !M.is_mob_incapacitated()) return var/table diff --git a/code/game/objects/items/devices/binoculars.dm b/code/game/objects/items/devices/binoculars.dm index f94d62c47de8..a9b7706bcfb7 100644 --- a/code/game/objects/items/devices/binoculars.dm +++ b/code/game/objects/items/devices/binoculars.dm @@ -422,7 +422,7 @@ if(!(GLOB.character_traits[/datum/character_trait/skills/spotter] in human.traits)) to_chat(human, SPAN_WARNING("You have no idea how to use this!")) return FALSE - if(istype(human) && !human.is_mob_incapacitated() && !human.lying && (holder_item == human.r_hand || holder_item || human.l_hand)) + if(istype(human) && !human.is_mob_incapacitated() && (holder_item == human.r_hand || holder_item || human.l_hand)) return TRUE /datum/action/item_action/specialist/spotter_target/proc/use_ability(atom/targeted_atom) diff --git a/code/game/objects/items/devices/radio/beacon.dm b/code/game/objects/items/devices/radio/beacon.dm index 0b8cbc303c06..bc97cf04fdfb 100644 --- a/code/game/objects/items/devices/radio/beacon.dm +++ b/code/game/objects/items/devices/radio/beacon.dm @@ -27,7 +27,7 @@ set category = "Object" set src in usr - if ((usr.canmove && !( usr.is_mob_restrained() ))) + if (usr.is_mob_incapacitated()) src.code = t if (!( src.code )) src.code = "beacon" diff --git a/code/game/objects/items/explosives/grenades/flashbang.dm b/code/game/objects/items/explosives/grenades/flashbang.dm index 365dfe26df89..50cb34668ae3 100644 --- a/code/game/objects/items/explosives/grenades/flashbang.dm +++ b/code/game/objects/items/explosives/grenades/flashbang.dm @@ -256,6 +256,7 @@ //decide how banged mob is var/bang_effect = 0 + var/lying = H.body_position == LYING_DOWN //flashbang effect depends on eye protection only, so we will process this case first //A bit dumb, but headsets don't have ear protection and even earmuffs are a fluff now @@ -264,7 +265,7 @@ if((get_dist(H, T) <= 1 || src.loc == H.loc || src.loc == H)) H.apply_damage(5, BRUTE) H.apply_damage(5, BURN) - if(H.lying) + if(lying) bang_effect = 1 else bang_effect = 2 @@ -277,13 +278,13 @@ H.apply_damage(5, BRUTE) H.apply_damage(5, BURN) - if(H.lying) + if(lying) bang_effect = 4 else bang_effect = 5 else if(get_dist(H, T) <= 5) - if(H.lying) + if(lying) bang_effect = 3 else bang_effect = 4 diff --git a/code/game/objects/items/hoverpack.dm b/code/game/objects/items/hoverpack.dm index c2bfacd3c3ad..027b9d77f581 100644 --- a/code/game/objects/items/hoverpack.dm +++ b/code/game/objects/items/hoverpack.dm @@ -184,7 +184,7 @@ warning.forceMove(path[max_distance]) /obj/item/hoverpack/proc/can_use_hoverpack(mob/living/carbon/human/user) - if(user.is_mob_incapacitated() || user.lying) + if(user.is_mob_incapacitated()) to_chat(user, SPAN_WARNING("You're a bit too incapacitated for that.")) return FALSE @@ -204,7 +204,7 @@ /datum/action/item_action/hover/can_use_action() var/mob/living/carbon/human/H = owner - if(!H.is_mob_incapacitated() && !H.lying && holder_item == H.back) + if(!H.is_mob_incapacitated() && holder_item == H.back) return TRUE /datum/action/item_action/hover/action_activate() diff --git a/code/game/objects/items/implants/implantneurostim.dm b/code/game/objects/items/implants/implantneurostim.dm index 544cf70147e2..21ee2542649b 100644 --- a/code/game/objects/items/implants/implantneurostim.dm +++ b/code/game/objects/items/implants/implantneurostim.dm @@ -63,7 +63,7 @@ var/mob_pain_msg = "Excruciating pain shoots through [part ? "your [part.display_name]" : "you"]!" M.visible_message(SPAN_DANGER("[M] convulses in pain!"), SPAN_DANGER(mob_pain_msg)) M.flash_eyes(1, TRUE) - M.stunned += 10 + M.apply_effect(10, STUN) M.apply_effect(10, WEAKEN) M.apply_damage(100, HALLOSS, part) M.apply_damage(5, BURN, part, 0, 0, src) diff --git a/code/game/objects/items/reagent_containers/blood_pack.dm b/code/game/objects/items/reagent_containers/blood_pack.dm index 0879dcffdc68..92c68e81c9d2 100644 --- a/code/game/objects/items/reagent_containers/blood_pack.dm +++ b/code/game/objects/items/reagent_containers/blood_pack.dm @@ -163,7 +163,7 @@ if(!istype(usr, /mob/living)) return - if(usr.stat || usr.lying) + if(usr.stat || usr.is_mob_incapacitated()) return mode = !mode diff --git a/code/game/objects/items/storage/backpack.dm b/code/game/objects/items/storage/backpack.dm index c8516dd59b2b..5b77b9149a53 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -842,7 +842,7 @@ GLOBAL_LIST_EMPTY_TYPED(radio_packs, /obj/item/storage/backpack/marine/satchel/r /datum/action/item_action/specialist/toggle_cloak/can_use_action() var/mob/living/carbon/human/H = owner - if(istype(H) && !H.is_mob_incapacitated() && !H.lying && holder_item == H.back) + if(istype(H) && !H.is_mob_incapacitated() && holder_item == H.back) return TRUE /datum/action/item_action/specialist/toggle_cloak/action_activate() diff --git a/code/game/objects/items/storage/internal.dm b/code/game/objects/items/storage/internal.dm index 68bdda8d7e7b..a491df12f086 100644 --- a/code/game/objects/items/storage/internal.dm +++ b/code/game/objects/items/storage/internal.dm @@ -25,10 +25,10 @@ //Items that use internal storage have the option of calling this to emulate default storage MouseDrop behaviour. //Returns 1 if the master item's parent's MouseDrop() should be called, 0 otherwise. It's strange, but no other way of //Doing it without the ability to call another proc's parent, really. -/obj/item/storage/internal/proc/handle_mousedrop(mob/user as mob, obj/over_object as obj) +/obj/item/storage/internal/proc/handle_mousedrop(mob/living/carbon/human/user, obj/over_object as obj) if(ishuman(user)) - if(user.lying) //Can't use your inventory when lying + if(user.body_position == LYING_DOWN) //Can't use your inventory when lying //what about stuns? don't argue return if(QDELETED(master_object)) @@ -84,8 +84,8 @@ //Items that use internal storage have the option of calling this to emulate default storage attack_hand behaviour. //Returns 1 if the master item's parent's attack_hand() should be called, 0 otherwise. //It's strange, but no other way of doing it without the ability to call another proc's parent, really. -/obj/item/storage/internal/proc/handle_attack_hand(mob/user as mob, mods) - if(user.lying) +/obj/item/storage/internal/proc/handle_attack_hand(mob/living/user as mob, mods) + if(user.body_position == LYING_DOWN) // what about stuns? huh? return FALSE if(ishuman(user)) diff --git a/code/game/objects/items/storage/large_holster.dm b/code/game/objects/items/storage/large_holster.dm index 27026165fc31..76f98c423974 100644 --- a/code/game/objects/items/storage/large_holster.dm +++ b/code/game/objects/items/storage/large_holster.dm @@ -367,7 +367,7 @@ /datum/action/item_action/specialist/toggle_fuel/can_use_action() var/mob/living/carbon/human/H = owner - if(istype(H) && !H.is_mob_incapacitated() && !H.lying && holder_item == H.back) + if(istype(H) && !H.is_mob_incapacitated() && H.body_position == STANDING_UP && holder_item == H.back) return TRUE /datum/action/item_action/specialist/toggle_fuel/action_activate() diff --git a/code/game/objects/items/storage/smartpack.dm b/code/game/objects/items/storage/smartpack.dm index 0b0fd05eac17..d012e773617b 100644 --- a/code/game/objects/items/storage/smartpack.dm +++ b/code/game/objects/items/storage/smartpack.dm @@ -223,7 +223,7 @@ user.remove_filter("synth_protective_form") -/obj/item/storage/backpack/marine/smartpack/proc/immobile_form(mob/user) +/obj/item/storage/backpack/marine/smartpack/proc/immobile_form(mob/living/user) if(activated_form) return diff --git a/code/game/objects/items/tools/experimental_tools.dm b/code/game/objects/items/tools/experimental_tools.dm index d27272881e1e..221aa279a53b 100644 --- a/code/game/objects/items/tools/experimental_tools.dm +++ b/code/game/objects/items/tools/experimental_tools.dm @@ -279,7 +279,7 @@ return if(ishuman(user)) - if(user.stat || user.blinded || user.lying) + if(user.stat || user.blinded || user.body_position == LYING_DOWN) return if(attaching) diff --git a/code/game/objects/items/toys/toy_weapons.dm b/code/game/objects/items/toys/toy_weapons.dm index ed66be43dbc7..ce32cfdb67a9 100644 --- a/code/game/objects/items/toys/toy_weapons.dm +++ b/code/game/objects/items/toys/toy_weapons.dm @@ -156,10 +156,10 @@ O.show_message(SPAN_DANGER("[user] realized they were out of ammo and starting scrounging for some!"), SHOW_MESSAGE_VISIBLE) -/obj/item/toy/crossbow/attack(mob/M as mob, mob/user as mob) +/obj/item/toy/crossbow/attack(mob/living/M as mob, mob/user as mob) src.add_fingerprint(user) - if (src.bullets > 0 && M.lying) + if (src.bullets > 0 && M.body_position == LYING_DOWN) for(var/mob/O in viewers(M, null)) if(O.client) @@ -169,7 +169,7 @@ playsound(user.loc, 'sound/items/syringeproj.ogg', 15, 1) new /obj/item/toy/crossbow_ammo(M.loc) src.bullets-- - else if (M.lying && src.bullets == 0) + else if (M.body_position == LYING_DOWN && src.bullets == 0) for(var/mob/O in viewers(M, null)) if (O.client) O.show_message(SPAN_DANGER("[user] casually lines up a shot with [M]'s head, pulls the trigger, then realizes they are out of ammo and drops to the floor in search of some!"), SHOW_MESSAGE_VISIBLE, SPAN_DANGER("You hear someone fall"), SHOW_MESSAGE_AUDIBLE) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index db90ea1728dd..9d730c71970b 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -14,7 +14,8 @@ /// If we have a user using us, this will be set on. We will check if the user has stopped using us, and thus stop updating and LAGGING EVERYTHING! var/in_use = FALSE var/mob/living/buckled_mob - var/buckle_lying = FALSE //Is the mob buckled in a lying position + /// Bed-like behaviour, forces mob.lying = buckle_lying if not set to [NO_BUCKLE_LYING]. + var/buckle_lying = NO_BUCKLE_LYING var/can_buckle = FALSE /**Applied to surgery times for mobs buckled prone to it or lying on the same tile, if the surgery cares about surface conditions. The lowest multiplier of objects on the tile is used.**/ @@ -224,7 +225,7 @@ else . = ..() /obj/proc/afterbuckle(mob/M as mob) // Called after somebody buckled / unbuckled - handle_rotation() + handle_rotation() // To be removed when we have full dir support in set_buckled SEND_SIGNAL(src, COSMIG_OBJ_AFTER_BUCKLE, buckled_mob) if(!buckled_mob) UnregisterSignal(M, COMSIG_PARENT_QDELETING) @@ -235,9 +236,8 @@ /obj/proc/unbuckle() SIGNAL_HANDLER if(buckled_mob && buckled_mob.buckled == src) - buckled_mob.buckled = null + buckled_mob.set_buckled(null) buckled_mob.anchored = initial(buckled_mob.anchored) - buckled_mob.update_canmove() var/M = buckled_mob REMOVE_TRAITS_IN(buckled_mob, TRAIT_SOURCE_BUCKLE) @@ -268,7 +268,7 @@ //trying to buckle a mob /obj/proc/buckle_mob(mob/M, mob/user) - if (!ismob(M) || (get_dist(src, user) > 1) || user.is_mob_restrained() || user.lying || user.stat || buckled_mob || M.buckled || !isturf(user.loc)) + if (!ismob(M) || (get_dist(src, user) > 1) || user.is_mob_restrained() || user.stat || buckled_mob || M.buckled || !isturf(user.loc)) return if (isxeno(user)) @@ -299,20 +299,15 @@ // the actual buckling proc // Yes I know this is not style but its unreadable otherwise -/obj/proc/do_buckle(mob/target, mob/user) +/obj/proc/do_buckle(mob/living/target, mob/user) send_buckling_message(target, user) if (src && src.loc) - target.buckled = src + target.set_buckled(src) target.forceMove(src.loc) target.setDir(dir) - target.update_canmove() src.buckled_mob = target src.add_fingerprint(user) afterbuckle(target) - if(buckle_lying) // Make sure buckling to beds/nests etc only turns, and doesn't give a random offset - var/matrix/new_matrix = matrix() - new_matrix.Turn(90) - target.apply_transform(new_matrix) return TRUE /obj/proc/send_buckling_message(mob/M, mob/user) diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index 9b0b8cf30aae..95998d5de79a 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -150,7 +150,8 @@ for(var/mob/living/M in get_turf(src)) - if(M.lying) return //No spamming this on people. + if(HAS_TRAIT(M, TRAIT_FLOORED)) + return //No spamming this on people. M.apply_effect(5, WEAKEN) to_chat(M, SPAN_WARNING("You topple as \the [src] moves under you!")) @@ -191,7 +192,7 @@ H.updatehealth() return -/obj/structure/proc/can_touch(mob/user) +/obj/structure/proc/can_touch(mob/living/user) if(!user) return 0 if(!Adjacent(user) || !isturf(user.loc)) @@ -199,7 +200,7 @@ if(user.is_mob_restrained() || user.buckled) to_chat(user, SPAN_NOTICE("You need your hands and legs free for this.")) return 0 - if(user.is_mob_incapacitated(TRUE) || user.lying) + if(user.is_mob_incapacitated(TRUE) || user.body_position == LYING_DOWN) return 0 if(isRemoteControlling(user)) to_chat(user, SPAN_NOTICE("You need hands for this.")) diff --git a/code/game/objects/structures/barricade/deployable.dm b/code/game/objects/structures/barricade/deployable.dm index 77aa6b7e6816..0d5275f98a3d 100644 --- a/code/game/objects/structures/barricade/deployable.dm +++ b/code/game/objects/structures/barricade/deployable.dm @@ -63,7 +63,7 @@ if(!ishuman(usr)) return - if(usr.lying) + if(usr.is_mob_incapacitated()) return if(over_object == usr && Adjacent(usr)) diff --git a/code/game/objects/structures/bookcase.dm b/code/game/objects/structures/bookcase.dm index becb0906e3c6..ce338de47b35 100644 --- a/code/game/objects/structures/bookcase.dm +++ b/code/game/objects/structures/bookcase.dm @@ -33,7 +33,7 @@ if(contents.len) var/obj/item/book/choice = input("Which book would you like to remove from the shelf?") as null|obj in contents if(choice) - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !in_range(loc, usr)) + if(usr.is_mob_incapacitated() || !in_range(loc, usr)) return if(ishuman(user)) if(!user.get_active_hand()) diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index a7394f3a7586..d6148b23b7f0 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -79,10 +79,11 @@ M.forceMove(loc) if(exit_stun) M.apply_effect(exit_stun, STUN) //Action delay when going out of a closet - M.update_canmove() //Force the delay to go in action immediately - if(!M.lying) - M.visible_message(SPAN_WARNING("[M] suddenly gets out of [src]!"), - SPAN_WARNING("You get out of [src] and get your bearings!")) + if(isliving(M)) + var/mob/living/living_M = M + if(living_M.mobility_flags & MOBILITY_MOVE) + M.visible_message(SPAN_WARNING("[M] suddenly gets out of [src]!"), + SPAN_WARNING("You get out of [src] and get your bearings!")) /obj/structure/closet/proc/open() if(opened) @@ -333,7 +334,7 @@ set category = "Object" set name = "Toggle Open" - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) return if(usr.loc == src) diff --git a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm index d6b4a35b04f7..3206da86b197 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm @@ -78,7 +78,7 @@ set src in oview(1) // One square distance set category = "Object" set name = "Reset Lock" - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain + if(usr.is_mob_incapacitated()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain return if(ishuman(usr)) src.add_fingerprint(usr) diff --git a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm index 331cb884bd59..ba974a8e722a 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm @@ -121,7 +121,7 @@ set category = "Object" set name = "Toggle Lock" - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain + if(usr.is_mob_incapacitated()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain return if(ishuman(usr)) diff --git a/code/game/objects/structures/crates_lockers/secure_crates.dm b/code/game/objects/structures/crates_lockers/secure_crates.dm index 28a77e0c81c0..6b025a57c78b 100644 --- a/code/game/objects/structures/crates_lockers/secure_crates.dm +++ b/code/game/objects/structures/crates_lockers/secure_crates.dm @@ -53,7 +53,7 @@ set category = "Object" set name = "Toggle Lock" - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain + if(usr.is_mob_incapacitated()) // Don't use it if you're not able to! Checks for stuns, ghost and restrain return if(ishuman(usr)) diff --git a/code/game/objects/structures/ladders.dm b/code/game/objects/structures/ladders.dm index f2e6b172ad88..da6d4f1a8254 100644 --- a/code/game/objects/structures/ladders.dm +++ b/code/game/objects/structures/ladders.dm @@ -67,8 +67,8 @@ else //wtf make your ladders properly assholes icon_state = "ladder00" -/obj/structure/ladder/attack_hand(mob/user) - if(user.stat || get_dist(user, src) > 1 || user.blinded || user.lying || user.buckled || user.anchored) return +/obj/structure/ladder/attack_hand(mob/living/user) + if(user.stat || get_dist(user, src) > 1 || user.blinded || user.body_position == LYING_DOWN || user.buckled || user.anchored) return if(busy) to_chat(user, SPAN_WARNING("Someone else is currently using [src].")) return @@ -94,7 +94,7 @@ SPAN_NOTICE("You start climbing [ladder_dir_name] [src].")) busy = TRUE if(do_after(user, 20, INTERRUPT_INCAPACITATED|INTERRUPT_OUT_OF_RANGE|INTERRUPT_RESIST, BUSY_ICON_GENERIC, src, INTERRUPT_NONE)) - if(!user.is_mob_incapacitated() && get_dist(user, src) <= 1 && !user.blinded && !user.lying && !user.buckled && !user.anchored) + if(!user.is_mob_incapacitated() && get_dist(user, src) <= 1 && !user.blinded && user.body_position != LYING_DOWN && !user.buckled && !user.anchored) visible_message(SPAN_NOTICE("[user] climbs [ladder_dir_name] [src].")) //Hack to give a visible message to the people here without duplicating user message user.visible_message(SPAN_NOTICE("[user] climbs [ladder_dir_name] [src]."), SPAN_NOTICE("You climb [ladder_dir_name] [src].")) @@ -103,9 +103,9 @@ busy = FALSE add_fingerprint(user) -/obj/structure/ladder/check_eye(mob/user) +/obj/structure/ladder/check_eye(mob/living/user) //Are we capable of looking? - if(user.is_mob_incapacitated() || get_dist(user, src) > 1 || user.blinded || user.lying || !user.client) + if(user.is_mob_incapacitated() || get_dist(user, src) > 1 || user.blinded || user.body_position == LYING_DOWN || !user.client) user.unset_interaction() //Are ladder cameras ok? @@ -140,7 +140,7 @@ //Peeking up/down /obj/structure/ladder/MouseDrop(over_object, src_location, over_location) if((over_object == usr && (in_range(src, usr)))) - if(islarva(usr) || isobserver(usr) || usr.is_mob_incapacitated() || usr.blinded || usr.lying) + if(islarva(usr) || isobserver(usr) || usr.is_mob_incapacitated() || usr.blinded) to_chat(usr, "You can't do that in your current state.") return if(is_watching) diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index b3fb2423008a..f1717f5bf0f5 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -117,9 +117,8 @@ if(user.is_mob_incapacitated()) return if(exit_stun) - user.stunned = max(user.stunned, exit_stun) //Action delay when going out of a closet (or morgue in this case) - user.update_canmove() //Force the delay to go in action immediately - if(!user.lying) + user.apply_effect(exit_stun, STUN) + if(user.mobility_flags & MOBILITY_MOVE) user.visible_message(SPAN_WARNING("[user] suddenly gets out of [src]!"), SPAN_WARNING("You get out of [src] and get your bearings!")) toggle_morgue(user) diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index fbf193a4abab..34b0fb01e9d6 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -13,7 +13,7 @@ icon_state = "bed" icon = 'icons/obj/objects.dmi' can_buckle = TRUE - buckle_lying = TRUE + buckle_lying = 90 throwpass = TRUE debris = list(/obj/item/stack/sheet/metal) var/buildstacktype = /obj/item/stack/sheet/metal diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm index 4186ae8608a9..e523906f4cfe 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -6,7 +6,7 @@ name = "chair" desc = "A rectangular metallic frame sitting on four legs with a back panel. Designed to fit the sitting position, more or less comfortably." icon_state = "chair" - buckle_lying = FALSE + buckle_lying = 0 var/propelled = FALSE //Check for fire-extinguisher-driven chairs var/can_rotate = TRUE var/picked_up_item = /obj/item/weapon/twohanded/folded_metal_chair diff --git a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm index 2b42e641f0cf..986ae99739aa 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm @@ -20,7 +20,7 @@ if(world.time <= l_move_time + move_delay) return // Redundant check? - if(user.is_mob_incapacitated() || user.lying) + if(user.is_mob_incapacitated()) return if(propelled) //can't manually move it mid-propelling. diff --git a/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm b/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm index 6375fcd13823..65bb2fd6a963 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/xeno_nest.dm @@ -10,7 +10,7 @@ health = 100 layer = ABOVE_MOB_LAYER plane = GAME_PLANE - buckle_lying = FALSE + buckle_lying = 0 var/on_fire = 0 var/resisting = 0 var/resisting_ready = 0 @@ -145,7 +145,7 @@ if(!(buckled_mob && buckled_mob.buckled == src && buckled_mob != user)) return - if(user.stat || user.lying || user.is_mob_restrained()) + if(user.body_position == LYING_DOWN || user.is_mob_incapacitated()) return if(isxeno(user)) @@ -167,7 +167,7 @@ if(H.stat != DEAD) if(alert(user, "[H] is still alive and kicking! Are you sure you want to remove them from the nest?", "Confirmation", "Yes", "No") != "Yes") return - if(!buckled_mob || !user.Adjacent(H) || user.stat || user.lying || user.is_mob_restrained()) + if(!buckled_mob || !user.Adjacent(H) || user.is_mob_incapacitated(FALSE)) return if(ishuman(user)) @@ -191,7 +191,7 @@ /obj/structure/bed/nest/buckle_mob(mob/mob, mob/user) . = FALSE - if(!isliving(mob) || islarva(user) || (get_dist(src, user) > 1) || user.is_mob_restrained() || user.stat || user.lying || mob.buckled || !iscarbon(user)) + if(!isliving(mob) || islarva(user) || (get_dist(src, user) > 1) || user.is_mob_incapacitated(FALSE)) return if(isxeno(mob)) @@ -220,7 +220,7 @@ var/mob/living/carbon/human/human = null if(ishuman(mob)) human = mob - if(!human.lying) //Don't ask me why is has to be + if(human.body_position != LYING_DOWN) //Don't ask me why is has to be to_chat(user, SPAN_WARNING("[mob] is resisting, ground them.")) return @@ -242,7 +242,7 @@ return if(human) //Improperly stunned Marines won't be nested - if(!human.lying) //Don't ask me why is has to be + if(human.body_position != LYING_DOWN) //Don't ask me why is has to be to_chat(user, SPAN_WARNING("[mob] is resisting, ground them.")) return diff --git a/code/game/objects/structures/vulture_spotter.dm b/code/game/objects/structures/vulture_spotter.dm index 682a13be98fc..d90a1ec1615a 100644 --- a/code/game/objects/structures/vulture_spotter.dm +++ b/code/game/objects/structures/vulture_spotter.dm @@ -78,7 +78,7 @@ try_scope(user) -/obj/structure/vulture_spotter_tripod/on_set_interaction(mob/user) +/obj/structure/vulture_spotter_tripod/on_set_interaction(mob/living/user) var/obj/item/attachable/vulture_scope/scope = get_vulture_scope() scope.spotter_spotting = TRUE to_chat(scope.scope_user, SPAN_NOTICE("You notice that [scope] drifts less.")) @@ -102,7 +102,7 @@ give_action(user, /datum/action/vulture_tripod_unscope, null, null, src) set_scope_loc(user, scope) -/obj/structure/vulture_spotter_tripod/on_unset_interaction(mob/user) +/obj/structure/vulture_spotter_tripod/on_unset_interaction(mob/living/user) user.status_flags &= ~IMMOBILE_ACTION user.visible_message(SPAN_NOTICE("[user] looks up from [src]."),SPAN_NOTICE("You look up from [src].")) REMOVE_TRAIT(user, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Vulture spotter")) diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index cccc1211bfb0..60c37fcdc607 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -8,6 +8,7 @@ density = FALSE anchored = TRUE can_buckle = TRUE + buckle_lying = 0 var/open = 0 //if the lid is up var/cistern = 0 //if the cistern bit is open var/w_items = 0 //the combined w_class of all the items in the cistern diff --git a/code/modules/admin/topic/topic.dm b/code/modules/admin/topic/topic.dm index 93cd66d586c4..a0e9e8b787aa 100644 --- a/code/modules/admin/topic/topic.dm +++ b/code/modules/admin/topic/topic.dm @@ -585,17 +585,6 @@ message_admins("[key_name_admin(usr)] attempting to monkeyize [key_name_admin(H)]") H.monkeyize() - else if(href_list["corgione"]) - if(!check_rights(R_SPAWN)) return - - var/mob/living/carbon/human/H = locate(href_list["corgione"]) - if(!istype(H)) - to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human") - return - - message_admins("[key_name_admin(usr)] attempting to corgize [key_name_admin(H)]") - H.corgize() - else if(href_list["forcespeech"]) if(!check_rights(R_ADMIN)) return diff --git a/code/modules/animations/animation_library.dm b/code/modules/animations/animation_library.dm index 2bbff8d4cfcd..d4fd8feeaf24 100644 --- a/code/modules/animations/animation_library.dm +++ b/code/modules/animations/animation_library.dm @@ -249,7 +249,7 @@ Can look good elsewhere as well.*/ var/pre_rappel_alpha = alpha alpha = 20 dir = WEST - canmove = FALSE + ADD_TRAIT(src, TRAIT_IMMOBILIZED, INTERACTION_TRAIT) var/matrix/initial_matrix = matrix() initial_matrix.Turn(45) apply_transform(initial_matrix) @@ -257,4 +257,4 @@ Can look good elsewhere as well.*/ var/matrix/reset_matrix = matrix() animate(src, 3, transform = reset_matrix, pixel_y = 0, alpha = pre_rappel_alpha, flags = ANIMATION_PARALLEL) sleep(3) - canmove = TRUE + REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, INTERACTION_TRAIT) diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm index 05ad7c5a87c7..929e2d6af7b2 100644 --- a/code/modules/assembly/infrared.dm +++ b/code/modules/assembly/infrared.dm @@ -137,7 +137,7 @@ /obj/item/device/assembly/infra/Topic(href, href_list) ..() - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !in_range(loc, usr)) + if(usr.is_mob_incapacitated() || !in_range(loc, usr)) close_browser(usr, "infra") return diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index 8bf58c680798..dae7f633f05d 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -507,38 +507,40 @@ set name = "Adjust welding goggles" set src in usr - if(usr.canmove && !usr.stat && !usr.is_mob_restrained()) - if(active) - active = 0 - vision_impair = vision_impair_off - flags_inventory &= ~COVEREYES - flags_inv_hide &= ~HIDEEYES - flags_armor_protection &= ~BODY_FLAG_EYES - update_icon() - eye_protection = EYE_PROTECTION_NONE - to_chat(usr, "You push [src] up out of your face.") - else - active = 1 - vision_impair = vision_impair_on - flags_inventory |= COVEREYES - flags_inv_hide |= HIDEEYES - flags_armor_protection |= BODY_FLAG_EYES - update_icon() - eye_protection = initial(eye_protection) - to_chat(usr, "You flip [src] down to protect your eyes.") - - - if(ishuman(loc)) - var/mob/living/carbon/human/H = loc - if(H.glasses == src) - H.update_tint() + if(usr.is_mob_incapacitated()) + return + + if(active) + active = 0 + vision_impair = vision_impair_off + flags_inventory &= ~COVEREYES + flags_inv_hide &= ~HIDEEYES + flags_armor_protection &= ~BODY_FLAG_EYES + update_icon() + eye_protection = EYE_PROTECTION_NONE + to_chat(usr, "You push [src] up out of your face.") + else + active = 1 + vision_impair = vision_impair_on + flags_inventory |= COVEREYES + flags_inv_hide |= HIDEEYES + flags_armor_protection |= BODY_FLAG_EYES + update_icon() + eye_protection = initial(eye_protection) + to_chat(usr, "You flip [src] down to protect your eyes.") + + + if(ishuman(loc)) + var/mob/living/carbon/human/H = loc + if(H.glasses == src) + H.update_tint() - update_clothing_icon() + update_clothing_icon() - for(var/X in actions) - var/datum/action/A = X - if(istype(A, /datum/action/item_action/toggle)) - A.update_button_icon() + for(var/X in actions) + var/datum/action/A = X + if(istype(A, /datum/action/item_action/toggle)) + A.update_button_icon() /obj/item/clothing/glasses/welding/superior name = "superior welding goggles" diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm index 9ddaed35826a..7406e6baa754 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -36,7 +36,7 @@ return /datum/action/item_action/view_publications/can_use_action() - if(owner && !owner.is_mob_incapacitated() && !owner.lying && owner.faction != FACTION_SURVIVOR) + if(owner && !owner.is_mob_incapacitated() && owner.faction != FACTION_SURVIVOR) return TRUE /datum/action/item_action/view_publications/action_activate() diff --git a/code/modules/clothing/gloves/miscellaneous.dm b/code/modules/clothing/gloves/miscellaneous.dm index e6c8391ac0a1..15a4cf742464 100644 --- a/code/modules/clothing/gloves/miscellaneous.dm +++ b/code/modules/clothing/gloves/miscellaneous.dm @@ -88,7 +88,7 @@ playsound(loc, knockout_sound, 50, FALSE) M.show_message(FONT_SIZE_LARGE(SPAN_WARNING("KNOCKOUT!")), SHOW_MESSAGE_VISIBLE) return 1 - if (L.lying == 1 || L.stat == UNCONSCIOUS)//Can't beat 'em while they're down. + if (L.body_position == LYING_DOWN || L.stat == UNCONSCIOUS)//Can't beat 'em while they're down. to_chat(M, SPAN_WARNING("You can't box with [A], they're already down!")) return 1 M.visible_message(SPAN_DANGER("[M] [boxing_verb] [A]!")) diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 102d8241754f..afc8e0a7cbba 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -45,33 +45,35 @@ set name = "Adjust welding mask" set src in usr - if(usr.canmove && !usr.stat && !usr.is_mob_restrained()) - if(up) - vision_impair = VISION_IMPAIR_MAX - flags_inventory |= COVEREYES|COVERMOUTH|BLOCKSHARPOBJ - flags_inv_hide |= HIDEEARS|HIDEEYES|HIDEFACE - icon_state = initial(icon_state) - eye_protection = initial(eye_protection) - to_chat(usr, "You flip the [src] down to protect your eyes.") - else - vision_impair = VISION_IMPAIR_NONE - flags_inventory &= ~(COVEREYES|COVERMOUTH|BLOCKSHARPOBJ) - flags_inv_hide &= ~(HIDEEARS|HIDEEYES|HIDEFACE) - icon_state = "[initial(icon_state)]up" - eye_protection = EYE_PROTECTION_NONE - to_chat(usr, "You push the [src] up out of your face.") - up = !up - - if(ishuman(loc)) - var/mob/living/carbon/human/H = loc - if(H.head == src) - H.update_tint() - - update_clothing_icon() //so our mob-overlays update - - for(var/X in actions) - var/datum/action/A = X - A.update_button_icon() + if(usr.is_mob_incapacitated()) + return + + if(up) + vision_impair = VISION_IMPAIR_MAX + flags_inventory |= COVEREYES|COVERMOUTH|BLOCKSHARPOBJ + flags_inv_hide |= HIDEEARS|HIDEEYES|HIDEFACE + icon_state = initial(icon_state) + eye_protection = initial(eye_protection) + to_chat(usr, "You flip the [src] down to protect your eyes.") + else + vision_impair = VISION_IMPAIR_NONE + flags_inventory &= ~(COVEREYES|COVERMOUTH|BLOCKSHARPOBJ) + flags_inv_hide &= ~(HIDEEARS|HIDEEYES|HIDEFACE) + icon_state = "[initial(icon_state)]up" + eye_protection = EYE_PROTECTION_NONE + to_chat(usr, "You push the [src] up out of your face.") + up = !up + + if(ishuman(loc)) + var/mob/living/carbon/human/H = loc + if(H.head == src) + H.update_tint() + + update_clothing_icon() //so our mob-overlays update + + for(var/X in actions) + var/datum/action/A = X + A.update_button_icon() /* * Cakehat diff --git a/code/modules/clothing/masks/breath.dm b/code/modules/clothing/masks/breath.dm index 76d61b4e3cc9..ffdda93f8a73 100644 --- a/code/modules/clothing/masks/breath.dm +++ b/code/modules/clothing/masks/breath.dm @@ -16,7 +16,7 @@ set name = "Adjust mask" set src in usr - if(usr.canmove && !usr.stat && !usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) if(!src.hanging) src.hanging = !src.hanging gas_transfer_coefficient = 1 //gas is now escaping to the turf and vice versa diff --git a/code/modules/clothing/suits/jobs.dm b/code/modules/clothing/suits/jobs.dm index a28a143f4ff0..5b97051852a6 100644 --- a/code/modules/clothing/suits/jobs.dm +++ b/code/modules/clothing/suits/jobs.dm @@ -385,7 +385,7 @@ set category = "Object" set src in usr - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) return 0 switch(icon_state) diff --git a/code/modules/clothing/suits/labcoat.dm b/code/modules/clothing/suits/labcoat.dm index 278ffb666bfd..1c2fb2a9f29d 100644 --- a/code/modules/clothing/suits/labcoat.dm +++ b/code/modules/clothing/suits/labcoat.dm @@ -52,7 +52,7 @@ set category = "Object" set src in usr - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) return 0 if(src.buttoned == TRUE) diff --git a/code/modules/clothing/suits/marine_armor.dm b/code/modules/clothing/suits/marine_armor.dm index d5dda73c061f..e505d458e496 100644 --- a/code/modules/clothing/suits/marine_armor.dm +++ b/code/modules/clothing/suits/marine_armor.dm @@ -644,7 +644,7 @@ set category = "Object" set src in usr - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) return 0 if(!injections) @@ -923,7 +923,6 @@ H.alpha = full_camo_alpha H.FF_hit_evade = 1000 ADD_TRAIT(H, TRAIT_UNDENSE, SPECIALIST_GEAR_TRAIT) - H.density = FALSE RegisterSignal(H, COMSIG_MOB_MOVE_OR_LOOK, PROC_REF(handle_mob_move_or_look)) @@ -948,7 +947,6 @@ COMSIG_MOB_FIRED_GUN, COMSIG_MOB_FIRED_GUN_ATTACHMENT, COMSIG_MOB_DEATH, - COMSIG_MOB_POST_UPDATE_CANMOVE, COMSIG_HUMAN_EXTINGUISH, COMSIG_MOB_MOVE_OR_LOOK )) @@ -957,7 +955,6 @@ animate(H, alpha = initial(H.alpha), flags = ANIMATION_END_NOW) H.FF_hit_evade = initial(H.FF_hit_evade) REMOVE_TRAIT(H, TRAIT_UNDENSE, SPECIALIST_GEAR_TRAIT) - H.update_canmove() var/datum/mob_hud/security/advanced/SA = GLOB.huds[MOB_HUD_SECURITY_ADVANCED] SA.add_to_hud(H) @@ -1002,7 +999,7 @@ /datum/action/item_action/specialist/prepare_position/can_use_action() var/mob/living/carbon/human/H = owner - if(istype(H) && !H.is_mob_incapacitated() && !H.lying && holder_item == H.wear_suit) + if(istype(H) && !H.is_mob_incapacitated() && H.body_position == STANDING_UP && holder_item == H.wear_suit) return TRUE /datum/action/item_action/specialist/prepare_position/action_activate() diff --git a/code/modules/clothing/suits/marine_coat.dm b/code/modules/clothing/suits/marine_coat.dm index 73d7e0981859..3aa43706c7d8 100644 --- a/code/modules/clothing/suits/marine_coat.dm +++ b/code/modules/clothing/suits/marine_coat.dm @@ -53,7 +53,7 @@ set category = "Object" set src in usr - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) return 0 if(src.buttoned == TRUE) diff --git a/code/modules/clothing/suits/miscellaneous.dm b/code/modules/clothing/suits/miscellaneous.dm index 2a3cff05ee1e..b5859bb6f2d4 100644 --- a/code/modules/clothing/suits/miscellaneous.dm +++ b/code/modules/clothing/suits/miscellaneous.dm @@ -332,7 +332,7 @@ set category = "Object" set src in usr - if(!usr.canmove || usr.stat || usr.is_mob_restrained()) + if(usr.is_mob_incapacitated()) return 0 if(src.icon_state == "suitjacket_blue_open") diff --git a/code/modules/clothing/under/under.dm b/code/modules/clothing/under/under.dm index a48111690271..ebfac5216330 100644 --- a/code/modules/clothing/under/under.dm +++ b/code/modules/clothing/under/under.dm @@ -106,7 +106,7 @@ if ((flags_item & NODROP) || loc != usr) return - if (!usr.is_mob_incapacitated() && !(usr.buckled && usr.lying)) + if (!usr.is_mob_incapacitated() && !(usr.buckled)) if(over_object) switch(over_object.name) if("r_hand") diff --git a/code/modules/cm_aliens/XenoStructures.dm b/code/modules/cm_aliens/XenoStructures.dm index 0802295110c4..340fabdf1973 100644 --- a/code/modules/cm_aliens/XenoStructures.dm +++ b/code/modules/cm_aliens/XenoStructures.dm @@ -160,7 +160,8 @@ /obj/effect/alien/resin/sticky/Crossed(atom/movable/AM) . = ..() var/mob/living/carbon/human/H = AM - if(istype(H) && !H.lying && !H.ally_of_hivenumber(hivenumber)) + // Wait doesn't this stack slows if you get dragged over it? What's going on here? + if(istype(H) && !H.ally_of_hivenumber(hivenumber)) H.next_move_slowdown = H.next_move_slowdown + slow_amt return . var/mob/living/carbon/xenomorph/X = AM @@ -565,7 +566,7 @@ return FALSE burning_friendly = TRUE - else if(current_mob.lying || current_mob.is_mob_incapacitated(TRUE)) + else if(current_mob.body_position == LYING_DOWN || current_mob.is_mob_incapacitated(TRUE)) return FALSE if(!burning_friendly && current_mob.health < 0) diff --git a/code/modules/cm_aliens/structures/fruit.dm b/code/modules/cm_aliens/structures/fruit.dm index 318bc6ba6cf2..09983c930031 100644 --- a/code/modules/cm_aliens/structures/fruit.dm +++ b/code/modules/cm_aliens/structures/fruit.dm @@ -442,7 +442,7 @@ /obj/effect/alien/resin/fruit/MouseDrop(atom/over_object) var/mob/living/carbon/xenomorph/X = over_object - if(!istype(X) || !Adjacent(X) || X != usr || X.is_mob_incapacitated() || X.lying) return ..() + if(!istype(X) || !Adjacent(X) || X != usr || X.is_mob_incapacitated() || X.body_position == LYING_DOWN) return ..() X.pickup_fruit(src) // Handles xenos picking up fruit diff --git a/code/modules/cm_aliens/structures/trap.dm b/code/modules/cm_aliens/structures/trap.dm index bc8eb7e6c7c0..d885e4d14a91 100644 --- a/code/modules/cm_aliens/structures/trap.dm +++ b/code/modules/cm_aliens/structures/trap.dm @@ -106,7 +106,7 @@ var/mob/living/carbon/human/H = AM if(issynth(H) || isyautja(H)) return - if(H.stat == DEAD || H.lying) + if(H.stat == DEAD || H.body_position == LYING_DOWN) return if(H.ally_of_hivenumber(hivenumber)) return diff --git a/code/modules/cm_aliens/structures/tunnel.dm b/code/modules/cm_aliens/structures/tunnel.dm index 6ac90338045d..8c467be695b4 100644 --- a/code/modules/cm_aliens/structures/tunnel.dm +++ b/code/modules/cm_aliens/structures/tunnel.dm @@ -127,7 +127,7 @@ /obj/structure/tunnel/proc/pick_tunnel(mob/living/carbon/xenomorph/X) . = FALSE //For peace of mind when it comes to dealing with unintended proc failures - if(!istype(X) || X.stat || X.lying || !isfriendly(X) || !hive) + if(!istype(X) || X.is_mob_incapacitated(TRUE) || !isfriendly(X) || !hive) return FALSE if(X in contents) var/list/tunnels = list() @@ -195,7 +195,7 @@ . = attack_alien(M) /obj/structure/tunnel/attack_alien(mob/living/carbon/xenomorph/M) - if(!istype(M) || M.stat || M.lying) + if(!istype(M) || M.is_mob_incapacitated(TRUE)) return XENO_NO_DELAY_ACTION if(!isfriendly(M)) diff --git a/code/modules/cm_marines/Donator_Items.dm b/code/modules/cm_marines/Donator_Items.dm index e8eb3f75ae60..6d2f46490d13 100644 --- a/code/modules/cm_marines/Donator_Items.dm +++ b/code/modules/cm_marines/Donator_Items.dm @@ -23,7 +23,7 @@ set src in usr if(!ishuman(usr)) return - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !usr.loc || !isturf(usr.loc)) + if(usr.is_mob_incapacitated() || !isturf(usr.loc)) to_chat(usr, SPAN_WARNING("Not right now!")) return @@ -35,7 +35,7 @@ set src in usr if(!ishuman(usr)) return - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !usr.loc || !isturf(usr.loc)) + if(usr.is_mob_incapacitated() || !isturf(usr.loc)) to_chat(usr, SPAN_WARNING("Not right now!")) return @@ -91,7 +91,7 @@ set src in usr if(!ishuman(usr)) return - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !usr.loc || !isturf(usr.loc)) + if(usr.is_mob_incapacitated() || !isturf(usr.loc)) to_chat(usr, SPAN_WARNING("Not right now!")) return @@ -103,7 +103,7 @@ set src in usr if(!ishuman(usr)) return - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !usr.loc || !isturf(usr.loc)) + if(usr.is_mob_incapacitated() || !isturf(usr.loc)) to_chat(usr, SPAN_WARNING("Not right now!")) return diff --git a/code/modules/cm_marines/m2c.dm b/code/modules/cm_marines/m2c.dm index 820e318b2777..f61c9ef89659 100644 --- a/code/modules/cm_marines/m2c.dm +++ b/code/modules/cm_marines/m2c.dm @@ -445,7 +445,7 @@ //ATTACK WITH BOTH HANDS COMBO -/obj/structure/machinery/m56d_hmg/auto/attack_hand(mob/user) +/obj/structure/machinery/m56d_hmg/auto/attack_hand(mob/living/user) ..() var/turf/user_turf = get_turf(user) @@ -515,16 +515,13 @@ ..() ADD_TRAIT(user, TRAIT_OVERRIDE_CLICKDRAG, TRAIT_SOURCE_WEAPON) RegisterSignal(user, COMSIG_MOVABLE_PRE_MOVE, PROC_REF(disable_interaction)) - RegisterSignal(user, COMSIG_MOB_POST_UPDATE_CANMOVE, PROC_REF(disable_canmove_interaction)) + RegisterSignal(user, COMSIG_LIVING_SET_BODY_POSITION, PROC_REF(body_position_changed)) // DISMOUNT THE MG /obj/structure/machinery/m56d_hmg/auto/on_unset_interaction(mob/user) REMOVE_TRAIT(user, TRAIT_OVERRIDE_CLICKDRAG, TRAIT_SOURCE_WEAPON) - UnregisterSignal(user, list( - COMSIG_MOVABLE_PRE_MOVE, - COMSIG_MOB_POST_UPDATE_CANMOVE - )) + UnregisterSignal(user, COMSIG_MOVABLE_PRE_MOVE) ..() // GET ANIMATED @@ -598,16 +595,16 @@ to_chat(user, SPAN_NOTICE("You rotate [src], using the tripod to support your pivoting movement.")) -/obj/structure/machinery/m56d_hmg/auto/proc/disable_interaction(mob/user, NewLoc, direction) +/obj/structure/machinery/m56d_hmg/auto/proc/disable_interaction(mob/living/user, NewLoc, direction) SIGNAL_HANDLER - if(user.lying || get_dist(user,src) > 0 || user.is_mob_incapacitated() || !user.client) + if(user.body_position != STANDING_UP || get_dist(user,src) > 0 || user.is_mob_incapacitated() || !user.client) user.unset_interaction() -/obj/structure/machinery/m56d_hmg/auto/proc/disable_canmove_interaction(mob/user, canmove, laid_down, lying) +/obj/structure/machinery/m56d_hmg/auto/proc/body_position_changed(mob/living/user, body_position, old_body_position) SIGNAL_HANDLER - if(laid_down) + if(body_position != STANDING_UP) user.unset_interaction() /obj/structure/machinery/m56d_hmg/auto/proc/handle_rotating_gun(mob/user) diff --git a/code/modules/cm_marines/marines_consoles.dm b/code/modules/cm_marines/marines_consoles.dm index d05233e57937..994e9f1ddcb2 100644 --- a/code/modules/cm_marines/marines_consoles.dm +++ b/code/modules/cm_marines/marines_consoles.dm @@ -432,7 +432,7 @@ set name = "Eject ID Card" set src in oview(1) - if(!usr || usr.stat || usr.lying) return + if(!usr || usr.is_mob_incapacitated()) return if(user_id_card) user_id_card.loc = get_turf(src) @@ -498,7 +498,7 @@ set name = "Eject ID Card" set src in view(1) - if(!usr || usr.stat || usr.lying) return + if(!usr || usr.is_mob_incapacitated()) return if(ishuman(usr) && ID_to_modify) to_chat(usr, "You remove \the [ID_to_modify] from \the [src].") diff --git a/code/modules/cm_marines/orbital_cannon.dm b/code/modules/cm_marines/orbital_cannon.dm index 612c43ae1dc9..c9ec4190ce90 100644 --- a/code/modules/cm_marines/orbital_cannon.dm +++ b/code/modules/cm_marines/orbital_cannon.dm @@ -446,7 +446,7 @@ GLOBAL_LIST_EMPTY(orbital_cannon_cancellation) shake_camera(user, 3, total_shake_factor, shake_frequency) user.KnockDown(rand(max_knockdown_time * distance_percent, (max_knockdown_time * distance_percent + 1))) - if(!user.knocked_down) + if(HAS_TRAIT(user, TRAIT_FLOORED)) continue to_chat(user, SPAN_WARNING("You are thrown off balance and fall to the ground!")) diff --git a/code/modules/cm_marines/smartgun_mount.dm b/code/modules/cm_marines/smartgun_mount.dm index dd9053810042..8b6dde5527e2 100644 --- a/code/modules/cm_marines/smartgun_mount.dm +++ b/code/modules/cm_marines/smartgun_mount.dm @@ -839,7 +839,7 @@ to_chat(usr, SPAN_NOTICE("You are too far from the handles to man [src]!")) /obj/structure/machinery/m56d_hmg/on_set_interaction(mob/user) - RegisterSignal(user, list(COMSIG_MOB_MG_EXIT, COMSIG_MOB_RESISTED, COMSIG_MOB_DEATH, COMSIG_MOB_KNOCKED_DOWN), PROC_REF(exit_interaction)) + RegisterSignal(user, list(COMSIG_MOB_MG_EXIT, COMSIG_MOB_RESISTED, COMSIG_MOB_DEATH, COMSIG_LIVING_SET_BODY_POSITION), PROC_REF(exit_interaction)) flags_atom |= RELAY_CLICK user.status_flags |= IMMOBILE_ACTION user.visible_message(SPAN_NOTICE("[user] mans \the [src]."),SPAN_NOTICE("You man \the [src], locked and loaded!")) @@ -854,7 +854,7 @@ update_pixels(user) operator = user -/obj/structure/machinery/m56d_hmg/on_unset_interaction(mob/user) +/obj/structure/machinery/m56d_hmg/on_unset_interaction(mob/living/user) flags_atom &= ~RELAY_CLICK SEND_SIGNAL(src, COMSIG_GUN_INTERRUPT_FIRE) user.status_flags &= ~IMMOBILE_ACTION @@ -875,7 +875,7 @@ COMSIG_MOB_MG_EXIT, COMSIG_MOB_RESISTED, COMSIG_MOB_DEATH, - COMSIG_MOB_KNOCKED_DOWN, + COMSIG_LIVING_SET_BODY_POSITION, )) @@ -915,8 +915,8 @@ user.client.pixel_y = 0 animate(user, pixel_x=user_old_x, pixel_y=user_old_y, 4, 1) -/obj/structure/machinery/m56d_hmg/check_eye(mob/user) - if(user.lying || get_dist(user,src) > 0 || user.is_mob_incapacitated() || !user.client) +/obj/structure/machinery/m56d_hmg/check_eye(mob/living/user) + if(user.body_position != STANDING_UP || get_dist(user,src) > 0 || user.is_mob_incapacitated() || !user.client) user.unset_interaction() /obj/structure/machinery/m56d_hmg/clicked(mob/user, list/mods) diff --git a/code/modules/cm_preds/thrall_procs.dm b/code/modules/cm_preds/thrall_procs.dm index 8ea0f2abb51a..a28f6eba2662 100644 --- a/code/modules/cm_preds/thrall_procs.dm +++ b/code/modules/cm_preds/thrall_procs.dm @@ -14,7 +14,7 @@ to_chat(wearer, SPAN_WARNING("You've already claimed your equipment.")) return - if(wearer.is_mob_incapacitated() || wearer.lying || wearer.buckled) + if(wearer.is_mob_incapacitated() || wearer.body_position == LYING_DOWN /* replace by mobility_flags */ || wearer.buckled) to_chat(wearer, SPAN_WARNING("You're not able to do that right now.")) return diff --git a/code/modules/cm_preds/yaut_bracers.dm b/code/modules/cm_preds/yaut_bracers.dm index d18ca4c153df..111a95d1089c 100644 --- a/code/modules/cm_preds/yaut_bracers.dm +++ b/code/modules/cm_preds/yaut_bracers.dm @@ -106,6 +106,7 @@ /// handles decloaking only on HUNTER gloves /obj/item/clothing/gloves/yautja/proc/decloak() + SIGNAL_HANDLER return /// Called to update the minimap icon of the predator @@ -408,7 +409,7 @@ . = wristblades_internal(usr, FALSE) /obj/item/clothing/gloves/yautja/hunter/proc/wristblades_internal(mob/living/carbon/human/caller, forced = FALSE) - if(!caller.loc || !caller.canmove || caller.stat || !ishuman(caller)) + if(!caller.loc || caller.is_mob_incapacitated() || !ishuman(caller)) return . = check_random_function(caller, forced) @@ -648,7 +649,7 @@ . = caster_internal(usr, FALSE) /obj/item/clothing/gloves/yautja/hunter/proc/caster_internal(mob/living/carbon/human/caller, forced = FALSE) - if(!caller.loc || !caller.canmove || caller.stat || !ishuman(caller)) + if(!caller.loc || caller.is_mob_incapacitated() || !ishuman(caller)) return . = check_random_function(caller, forced) diff --git a/code/modules/cm_preds/yaut_procs.dm b/code/modules/cm_preds/yaut_procs.dm index 32d532da72a0..728e548dfd2f 100644 --- a/code/modules/cm_preds/yaut_procs.dm +++ b/code/modules/cm_preds/yaut_procs.dm @@ -48,7 +48,7 @@ set name = "Butcher" set desc = "Butcher a corpse you're standing on for its tasty meats." - if(is_mob_incapacitated() || lying || buckled) + if(is_mob_incapacitated() || body_position != STANDING_UP || buckled) return var/list/choices = list() @@ -77,7 +77,7 @@ to_chat(src, SPAN_WARNING("This tiny worm is not even worth using your tools on.")) return - if(is_mob_incapacitated() || lying || buckled) + if(is_mob_incapacitated() || body_position != STANDING_UP || buckled) return if(issynth(T)) @@ -236,7 +236,7 @@ to_chat(src, SPAN_WARNING("You've already claimed your equipment.")) return - if(is_mob_incapacitated() || lying || buckled) + if(is_mob_incapacitated() || body_position != STANDING_UP || buckled) to_chat(src, SPAN_WARNING("You're not able to do that right now.")) return diff --git a/code/modules/cm_tech/hologram.dm b/code/modules/cm_tech/hologram.dm index 5c0e986f45b2..3509c0a73a7d 100644 --- a/code/modules/cm_tech/hologram.dm +++ b/code/modules/cm_tech/hologram.dm @@ -5,7 +5,6 @@ GLOBAL_LIST_EMPTY_TYPED(hologram_list, /mob/hologram) desc = "It seems to be a visual projection of someone" //jinkies! icon = 'icons/mob/mob.dmi' icon_state = "hologram" - canmove = TRUE blinded = FALSE invisibility = INVISIBILITY_OBSERVER diff --git a/code/modules/defenses/defenses.dm b/code/modules/defenses/defenses.dm index 099b41aee72b..633b51801e27 100644 --- a/code/modules/defenses/defenses.dm +++ b/code/modules/defenses/defenses.dm @@ -408,9 +408,9 @@ damaged_action(damage) if(stat == DEFENSE_DAMAGED) - density = FALSE + set_density(FALSE) else - density = initial(density) + set_density(initial(density)) update_icon() diff --git a/code/modules/desert_dam/filtration/filtration.dm b/code/modules/desert_dam/filtration/filtration.dm index 33c3e265e182..c289ae878bad 100644 --- a/code/modules/desert_dam/filtration/filtration.dm +++ b/code/modules/desert_dam/filtration/filtration.dm @@ -186,7 +186,7 @@ Each var depends on others M.apply_damage(0.5,BURN) else var/dam_amount = 3 - if(M.lying) + if(M.body_position == LYING_DOWN) M.apply_damage(dam_amount,BURN) M.apply_damage(dam_amount,BURN) M.apply_damage(dam_amount,BURN) diff --git a/code/modules/desert_dam/motion_sensor/sensortower.dm b/code/modules/desert_dam/motion_sensor/sensortower.dm index 6a718607aaf6..50aeede45f66 100644 --- a/code/modules/desert_dam/motion_sensor/sensortower.dm +++ b/code/modules/desert_dam/motion_sensor/sensortower.dm @@ -211,7 +211,7 @@ if(do_after(M, 40, INTERRUPT_ALL, BUSY_ICON_HOSTILE)) if(M.loc != cur_loc) return XENO_NO_DELAY_ACTION //Make sure we're still there - if(M.lying) + if(M.is_mob_incapacitated()) return XENO_NO_DELAY_ACTION if(buildstate == SENSORTOWER_BUILDSTATE_BLOWTORCH) return XENO_NO_DELAY_ACTION diff --git a/code/modules/droppod/container_droppod.dm b/code/modules/droppod/container_droppod.dm index 270f15011c5c..a9432933fa90 100644 --- a/code/modules/droppod/container_droppod.dm +++ b/code/modules/droppod/container_droppod.dm @@ -126,7 +126,7 @@ . = ..() if(loc) collect_objects(loc.contents) - density = TRUE + set_density(TRUE) /obj/structure/droppod/container/proc/collect_objects(list/L) for(var/atom/movable/A in L) diff --git a/code/modules/economy/ATM.dm b/code/modules/economy/ATM.dm index a1cbce7a40a6..1345164fcf34 100644 --- a/code/modules/economy/ATM.dm +++ b/code/modules/economy/ATM.dm @@ -465,7 +465,7 @@ log transactions set name = "Eject ID Card" set src in view(1) - if(!usr || usr.stat || usr.lying) return + if(!usr || usr.is_mob_incapacitated()) return if(ishuman(usr) && held_card) to_chat(usr, "You remove \the [held_card] from \the [src].") diff --git a/code/modules/flufftext/Dreaming.dm b/code/modules/flufftext/Dreaming.dm index 9503eee267e0..e62ad15a649e 100644 --- a/code/modules/flufftext/Dreaming.dm +++ b/code/modules/flufftext/Dreaming.dm @@ -21,7 +21,7 @@ for(var/i = rand(1,4),i > 0, i--) to_chat(src, SPAN_NOTICE("... [pick(POSSIBLE_DREAM_TOPICS)] ...")) sleep(rand(40,70)) - if(knocked_out <= 0) + if(!stat) dreaming = 0 return dreaming = 0 diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index ee3d749ec4fa..ceff47b5b63c 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -351,7 +351,7 @@ GLOBAL_LIST_INIT(non_fakeattack_weapons, list(/obj/item/device/aicard,\ var/clone_weapon = null for(var/mob/living/carbon/human/H in GLOB.alive_mob_list) - if(H.stat || H.lying) continue + if(H.stat) continue // possible_clones += H clone = H break //changed the code a bit. Less randomised, but less work to do. Should be ok, world.contents aren't stored in any particular order. diff --git a/code/modules/gear_presets/corpses.dm b/code/modules/gear_presets/corpses.dm index 70f4e2206002..de24f1f84ff3 100644 --- a/code/modules/gear_presets/corpses.dm +++ b/code/modules/gear_presets/corpses.dm @@ -39,7 +39,6 @@ if(nest) new_human.buckled = nest new_human.setDir(nest.dir) - new_human.update_canmove() nest.buckled_mob = new_human nest.afterbuckle(new_human) new_human.spawned_corpse = TRUE diff --git a/code/modules/hydroponics/vines.dm b/code/modules/hydroponics/vines.dm index 9268d3279539..bfca73e8d01b 100644 --- a/code/modules/hydroponics/vines.dm +++ b/code/modules/hydroponics/vines.dm @@ -124,7 +124,6 @@ if(V && (V.stat != DEAD) && (V.buckled != src)) // If mob exists and is not dead or captured. V.buckled = src V.forceMove(src.loc) - V.update_canmove() src.buckled_mob = V to_chat(V, SPAN_DANGER("The vines [pick("wind", "tangle", "tighten")] around you!")) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index cf3f9e8b4702..887313eb4db9 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -25,7 +25,6 @@ icon = 'icons/mob/mob.dmi' icon_state = "ghost" density = FALSE - canmove = TRUE blinded = FALSE anchored = TRUE // don't get pushed around invisibility = INVISIBILITY_OBSERVER @@ -80,6 +79,9 @@ GLOB.observer_list += src + // Ghosts don't move, they teleport via a special case in mob code + ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_INHERENT) + var/turf/spawn_turf if(ismob(body)) spawn_turf = get_turf(body) //Where is the body located? diff --git a/code/modules/mob/death.dm b/code/modules/mob/death.dm index 608458e2dd0d..8aea59b96a81 100644 --- a/code/modules/mob/death.dm +++ b/code/modules/mob/death.dm @@ -57,8 +57,6 @@ set_stat(DEAD) - update_canmove() - dizziness = 0 jitteriness = 0 diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 5ce40810e0b2..d71a908d627a 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -29,8 +29,6 @@ //Puts the item into your l_hand if possible and calls all necessary triggers/updates. returns 1 on success. /mob/proc/put_in_l_hand(obj/item/W) - if(lying) - return FALSE if(!istype(W)) return FALSE if(!l_hand) @@ -48,8 +46,6 @@ //Puts the item into your r_hand if possible and calls all necessary triggers/updates. returns 1 on success. /mob/proc/put_in_r_hand(obj/item/W) - if(lying) - return FALSE if(!istype(W)) return FALSE if(!r_hand) diff --git a/code/modules/mob/living/brain/brain.dm b/code/modules/mob/living/brain/brain.dm index ec55e6c51b59..b815fe4e3621 100644 --- a/code/modules/mob/living/brain/brain.dm +++ b/code/modules/mob/living/brain/brain.dm @@ -41,15 +41,6 @@ return 1 return ..() - -/mob/living/brain/update_canmove() - canmove = FALSE - return canmove - - - - - /mob/living/brain/update_sight() if (stat == DEAD) sight |= SEE_TURFS diff --git a/code/modules/mob/living/brain/life.dm b/code/modules/mob/living/brain/life.dm index 82cbb155b516..7f84b6466144 100644 --- a/code/modules/mob/living/brain/life.dm +++ b/code/modules/mob/living/brain/life.dm @@ -18,7 +18,6 @@ //Status updates, death etc. handle_regular_status_updates() - update_canmove() if(client) handle_regular_hud_updates() diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 0d33503bcef4..b63ce0174a22 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -74,7 +74,7 @@ /mob/living/carbon/ex_act(severity, direction, datum/cause_data/cause_data) - if(lying) + if(body_position == LYING_DOWN) severity *= EXPLOSION_PRONE_MULTIPLIER if(severity >= 30) @@ -260,19 +260,24 @@ /mob/living/carbon/proc/help_shake_act(mob/living/carbon/M) if(src == M) return - var/t_him = "it" - if(gender == MALE) - t_him = "him" - else if(gender == FEMALE) - t_him = "her" - if(lying || sleeping) + var/t_him = p_them() + + var/shake_action + if(stat == DEAD || HAS_TRAIT(src, TRAIT_INCAPACITATED) || sleeping) // incap implies also unconscious or knockedout + shake_action = "wake [t_him] up!" + else if(HAS_TRAIT(src, TRAIT_FLOORED)) + shake_action = "get [t_him] up!" + + if(shake_action) // We are incapacitated in some fashion if(client) sleeping = max(0,sleeping-5) - if(sleeping == 0) - resting = 0 - update_canmove() - M.visible_message(SPAN_NOTICE("[M] shakes [src] trying to wake [t_him] up!"), \ - SPAN_NOTICE("You shake [src] trying to wake [t_him] up!"), null, 4) + M.visible_message(SPAN_NOTICE("[M] shakes [src] trying to [shake_action]"), \ + SPAN_NOTICE("You shake [src] trying to [shake_action]"), null, 4) + + else if(body_position == LYING_DOWN) // We're just chilling on the ground, let us be + M.visible_message(SPAN_NOTICE("[M] stares and waves impatiently at [src] lying on the ground."), \ + SPAN_NOTICE("You stare and wave at [src] just lying on the ground."), null, 4) + else var/mob/living/carbon/human/H = M if(istype(H)) @@ -452,19 +457,19 @@ /mob/living/carbon/slip(slip_source_name, stun_level, weaken_level, run_only, override_noslip, slide_steps) set waitfor = 0 if(buckled) return FALSE //can't slip while buckled - if(lying) return FALSE //can't slip if already lying down. + if(body_position != STANDING_UP) return FALSE //can't slip if already lying down. stop_pulling() to_chat(src, SPAN_WARNING("You slipped on \the [slip_source_name? slip_source_name : "floor"]!")) playsound(src.loc, 'sound/misc/slip.ogg', 25, 1) apply_effect(stun_level, STUN) apply_effect(weaken_level, WEAKEN) . = TRUE - if(slide_steps && lying)//lying check to make sure we downed the mob + if(slide_steps && HAS_TRAIT(src, TRAIT_FLOORED))//lying check to make sure we downed the mob var/slide_dir = dir for(var/i=1, i<=slide_steps, i++) step(src, slide_dir) sleep(2) - if(!lying) + if(!HAS_TRAIT(src, TRAIT_FLOORED)) // just watch this break in the most horrible way possible break @@ -518,3 +523,17 @@ . += SPAN_GREEN("[src] was thralled by [src.hunter_data.thralled_set.real_name] for '[src.hunter_data.thralled_reason]'.") else if(src.hunter_data.gear) . += SPAN_RED("[src] was marked as carrying gear by [src.hunter_data.gear_set].") + + +/mob/living/carbon/on_lying_down(new_lying_angle) + . = ..() + if(!buckled || buckled.buckle_lying != 0) + lying_angle_on_lying_down(new_lying_angle) + + +/// Special carbon interaction on lying down, to transform its sprite by a rotation. +/mob/living/carbon/proc/lying_angle_on_lying_down(new_lying_angle) + if(!new_lying_angle) + set_lying_angle(pick(90, 270)) + else + set_lying_angle(new_lying_angle) diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index 5cac9db53cc6..6ff2a96b72f0 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -1,5 +1,6 @@ /mob/living/carbon gender = MALE + mobility_flags = MOBILITY_FLAGS_CARBON_DEFAULT var/list/stomach_contents = list() var/life_tick = 0 // The amount of life ticks that have processed on this mob. diff --git a/code/modules/mob/living/carbon/give.dm b/code/modules/mob/living/carbon/give.dm index c493559ff0d8..3f88d6beccb1 100644 --- a/code/modules/mob/living/carbon/give.dm +++ b/code/modules/mob/living/carbon/give.dm @@ -28,7 +28,7 @@ I = giver.r_hand if(!istype(I) || (I.flags_item & (DELONDROP|NODROP|ITEM_ABSTRACT))) return - if(lying) + if(body_position == LYING_DOWN) // replace by mobiilty_flags probably to_chat(giver, SPAN_WARNING("[src] can't hold that while lying down.")) return if(r_hand && l_hand) @@ -47,7 +47,7 @@ to_chat(giver, SPAN_WARNING("You need to keep the item in your active hand.")) to_chat(src, SPAN_WARNING("[giver] seem to have given up on giving [I] to you.")) return - if(lying) + if(body_position == LYING_DOWN) to_chat(src, SPAN_WARNING("You can't hold that while lying down.")) to_chat(giver, SPAN_WARNING("[src] can't hold that while lying down.")) return diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 38969c01488a..6170aec3031c 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -133,7 +133,7 @@ . += "Self Destruct Status: [SShijack.get_sd_eta()]" /mob/living/carbon/human/ex_act(severity, direction, datum/cause_data/cause_data) - if(lying) + if(body_position == LYING_DOWN) severity *= EXPLOSION_PRONE_MULTIPLIER @@ -172,6 +172,7 @@ var/obj/item/item1 = get_active_hand() var/obj/item/item2 = get_inactive_hand() apply_effect(round(knockdown_minus_armor), WEAKEN) + apply_effect(round(knockdown_minus_armor), STUN) // Remove this to let people crawl after an explosion. Funny but perhaps not desirable. var/knockout_value = damage * 0.1 var/knockout_minus_armor = min(knockout_value * bomb_armor_mult * 0.5, 0.5 SECONDS) // the KO time is halved from the knockdown timer. basically same stun time, you just spend less time KO'd. apply_effect(round(knockout_minus_armor), PARALYZE) @@ -1052,7 +1053,7 @@ /mob/living/carbon/human/proc/handle_embedded_objects() - if((stat == DEAD) || lying || buckled) // Shouldnt be needed, but better safe than sorry + if((stat == DEAD) || body_position || buckled) // Shouldnt be needed, but better safe than sorry return for(var/obj/item/W in embedded_items) diff --git a/code/modules/mob/living/carbon/human/human_abilities.dm b/code/modules/mob/living/carbon/human/human_abilities.dm index 37329c53b275..b5a401bc5649 100644 --- a/code/modules/mob/living/carbon/human/human_abilities.dm +++ b/code/modules/mob/living/carbon/human/human_abilities.dm @@ -455,9 +455,7 @@ CULT return to_chat(chosen, SPAN_HIGHDANGER("You feel a dangerous presence in the back of your head. You find yourself unable to move!")) - ADD_TRAIT(chosen, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Cultist Stun")) - chosen.update_canmove() chosen.update_xeno_hostile_hud() diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 805b3d7e1744..2bb113d67739 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -206,12 +206,11 @@ w_uniform.add_fingerprint(M) - if(lying || sleeping) + if(body_position == LYING_DOWN || sleeping) if(client) sleeping = max(0,src.sleeping-5) if(!sleeping) - resting = 0 - update_canmove() + set_resting(FALSE) M.visible_message(SPAN_NOTICE("[M] shakes [src] trying to wake [t_him] up!"), \ SPAN_NOTICE("You shake [src] trying to wake [t_him] up!"), null, 4) else if(stunned) diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 1dd7ff5fe124..dd25a13538af 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -1,5 +1,6 @@ /mob/living/carbon/human light_system = MOVABLE_LIGHT + rotate_on_lying = TRUE //Hair color and style var/r_hair = 0 var/g_hair = 0 diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index c4690c03068f..08ddd11da5b3 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -219,14 +219,6 @@ return 0 - -/mob/living/carbon/human/has_legs() - . = 0 - if(has_limb("r_foot") && has_limb("r_leg")) - .++ - if(has_limb("l_foot") && has_limb("l_leg")) - .++ - /mob/living/carbon/human/proc/disable_special_flags() status_flags |= CANPUSH anchored = FALSE diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 1a906dfa5c11..1803e289114e 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -108,7 +108,7 @@ //Do we have a working jetpack if(istype(back, /obj/item/tank/jetpack)) var/obj/item/tank/jetpack/J = back - if(((!check_drift) || (check_drift && J.stabilization_on)) && (!lying) && (J.allow_thrust(0.01, src))) + if(((!check_drift) || (check_drift && J.stabilization_on)) && (body_position == STANDING_UP) && (J.allow_thrust(0.01, src))) inertia_dir = 0 return 1 // if(!check_drift && J.allow_thrust(0.01, src)) @@ -140,3 +140,10 @@ prob_slip = round(prob_slip) return(prob_slip) + +/// Updates [TRAIT_FLOORED] based on whether the mob has appropriate limbs to stand or not +/mob/living/carbon/human/proc/update_leg_status() + if((has_limb("r_foot") && has_limb("r_leg")) || (has_limb("l_foot") && has_limb("l_leg"))) + REMOVE_TRAIT(src, TRAIT_FLOORED, BODY_TRAIT) + else + ADD_TRAIT(src, TRAIT_FLOORED, BODY_TRAIT) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index fded3d5e3f77..be1c7833c5c1 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -82,8 +82,6 @@ //Status updates, death etc. handle_regular_status_updates() //Optimized a bit - update_canmove() - handle_regular_hud_updates() pulse = handle_pulse() diff --git a/code/modules/mob/living/carbon/human/life/handle_disabilities.dm b/code/modules/mob/living/carbon/human/life/handle_disabilities.dm index 9ab234212108..77358ca45b89 100644 --- a/code/modules/mob/living/carbon/human/life/handle_disabilities.dm +++ b/code/modules/mob/living/carbon/human/life/handle_disabilities.dm @@ -3,7 +3,7 @@ /mob/living/carbon/human/proc/handle_disabilities() if(disabilities & EPILEPSY) - if((prob(1) && knocked_out < 1)) + if(prob(1) && !HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) visible_message(SPAN_DANGER("\The [src] starts having a seizure!"), \ SPAN_DANGER("You start having a seizure!"), null, 5) apply_effect(10, PARALYZE) @@ -11,14 +11,14 @@ return if(disabilities & COUGHING) - if((prob(5) && knocked_out <= 1)) + if(prob(5) && !HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) drop_held_item() INVOKE_ASYNC(src, PROC_REF(emote), "cough") return if(disabilities & TOURETTES) speech_problem_flag = TRUE - if((prob(10) && knocked_out <= 1)) + if((prob(10) && !HAS_TRAIT(src, TRAIT_KNOCKEDOUT))) apply_effect(10, STUN) spawn() switch(rand(1, 3)) @@ -56,6 +56,6 @@ to_chat(src, SPAN_DANGER("Your hand won't respond properly, you drop what you're holding.")) drop_held_item() if(10 to 12) - if(getBrainLoss() >= 50 && !lying) + if(getBrainLoss() >= 50 && body_position == STANDING_UP) to_chat(src, SPAN_DANGER("Your legs won't respond properly, you fall down.")) resting = 1 diff --git a/code/modules/mob/living/carbon/human/life/handle_organs.dm b/code/modules/mob/living/carbon/human/life/handle_organs.dm index 2c978f2295ed..706e8567a50c 100644 --- a/code/modules/mob/living/carbon/human/life/handle_organs.dm +++ b/code/modules/mob/living/carbon/human/life/handle_organs.dm @@ -16,7 +16,7 @@ else E.process() - if(!lying && world.time - l_move_time < 15) + if(body_position == STANDING_UP && world.time - l_move_time < 15) // Moving around with fractured ribs won't do you any good if(E.is_broken() && E.internal_organs && prob(15)) var/datum/internal_organ/I = pick(E.internal_organs) @@ -32,7 +32,7 @@ custom_pain("You feel broken bones cutting at you in your [E.display_name]!", 1) pain.apply_pain(damage * 1.5) - if(!lying && !buckled && prob(2)) + if(body_position == STANDING_UP && !buckled && prob(2)) var/left_leg_crippled = FALSE var/right_leg_crippled = FALSE diff --git a/code/modules/mob/living/carbon/human/life/handle_regular_status_updates.dm b/code/modules/mob/living/carbon/human/life/handle_regular_status_updates.dm index 5c951a8112bf..41554f056744 100644 --- a/code/modules/mob/living/carbon/human/life/handle_regular_status_updates.dm +++ b/code/modules/mob/living/carbon/human/life/handle_regular_status_updates.dm @@ -1,6 +1,6 @@ //Refer to life.dm for caller -/mob/living/carbon/human/handle_regular_status_updates(regular_update = TRUE) +/mob/living/carbon/human/handle_regular_status_updates(regular_update = TRUE) // you're next, evil proc --fira if(status_flags & GODMODE) return 0 @@ -53,9 +53,8 @@ if(!already_in_crit) new /datum/effects/crit/human(src) - if(knocked_out) + if(HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) blinded = TRUE - set_stat(UNCONSCIOUS) if(regular_update && halloss > 0) apply_damage(-3, HALLOSS) else if(sleeping) diff --git a/code/modules/mob/living/carbon/human/life/handle_stasis_bag.dm b/code/modules/mob/living/carbon/human/life/handle_stasis_bag.dm index 9d257da720b9..16d9955395b0 100644 --- a/code/modules/mob/living/carbon/human/life/handle_stasis_bag.dm +++ b/code/modules/mob/living/carbon/human/life/handle_stasis_bag.dm @@ -4,6 +4,9 @@ //Handle side effects from stasis switch(in_stasis) if(STASIS_IN_BAG) + // I hate whoever wrote this and statuses with a passion knocked_down = knocked_down? --knocked_down : knocked_down + 10 //knocked_down set. + if(knocked_down <= 0) + knocked_down_callback() if(STASIS_IN_CRYO_CELL) if(sleeping < 10) sleeping += 10 //Puts the mob to sleep indefinitely. diff --git a/code/modules/mob/living/carbon/human/life/life_helpers.dm b/code/modules/mob/living/carbon/human/life/life_helpers.dm index fedeaf9fd48c..25f020a9f8b6 100644 --- a/code/modules/mob/living/carbon/human/life/life_helpers.dm +++ b/code/modules/mob/living/carbon/human/life/life_helpers.dm @@ -25,33 +25,6 @@ pressure_adjustment_coefficient = min(1, max(pressure_adjustment_coefficient, 0)) //So it isn't less than 0 or larger than 1. return pressure_adjustment_coefficient -//Calculate how much of the enviroment pressure-difference affects the human. -/mob/living/carbon/human/calculate_affecting_pressure(pressure) - var/pressure_difference - - //First get the absolute pressure difference. - if(pressure < ONE_ATMOSPHERE) //We are in an underpressure. - pressure_difference = ONE_ATMOSPHERE - pressure - - else //We are in an overpressure or standard atmosphere. - pressure_difference = pressure - ONE_ATMOSPHERE - - if(pressure_difference < 5) //If the difference is small, don't bother calculating the fraction. - pressure_difference = 0 - - else - //Otherwise calculate how much of that absolute pressure difference affects us, can be 0 to 1 (equals 0% to 100%). - //This is our relative difference. - pressure_difference *= get_pressure_weakness() - - //The difference is always positive to avoid extra calculations. - //Apply the relative difference on a standard atmosphere to get the final result. - //The return value will be the adjusted_pressure of the human that is the basis of pressure warnings and damage. - if(pressure < ONE_ATMOSPHERE) - return ONE_ATMOSPHERE - pressure_difference - else - return ONE_ATMOSPHERE + pressure_difference - /mob/living/carbon/human/proc/stabilize_body_temperature() @@ -320,9 +293,7 @@ emote("gasp") regenerate_icons() reload_fullscreens() - update_canmove() flash_eyes() apply_effect(10, EYE_BLUR) apply_effect(10, PARALYZE) - update_canmove() updatehealth() //One more time, so it doesn't show the target as dead on HUDs diff --git a/code/modules/mob/living/carbon/human/powers/human_powers.dm b/code/modules/mob/living/carbon/human/powers/human_powers.dm index b31d7cbcce76..be7848b2a936 100644 --- a/code/modules/mob/living/carbon/human/powers/human_powers.dm +++ b/code/modules/mob/living/carbon/human/powers/human_powers.dm @@ -9,7 +9,7 @@ if(last_special > world.time) return - if(is_mob_incapacitated() || lying || buckled) + if(is_mob_incapacitated() || buckled) to_chat(src, "You cannot tackle someone in your current state.") return @@ -27,7 +27,7 @@ if(last_special > world.time) return - if(is_mob_incapacitated() || lying || buckled) + if(is_mob_incapacitated() || buckled) to_chat(src, "You cannot tackle in your current state.") return @@ -56,7 +56,7 @@ if(last_special > world.time) return - if(is_mob_incapacitated() || lying || buckled) + if(is_mob_incapacitated() || body_position != STANDING_UP || buckled) to_chat(src, "You cannot leap in your current state.") return @@ -74,7 +74,7 @@ if(last_special > world.time) return - if(is_mob_incapacitated() || lying || buckled) + if(is_mob_incapacitated() || body_position != STANDING_UP || buckled) to_chat(src, "You cannot leap in your current state.") return @@ -110,7 +110,7 @@ if(last_special > world.time) return - if(is_mob_incapacitated(TRUE) || lying) + if(is_mob_incapacitated() || body_position != STANDING_UP) to_chat(src, SPAN_DANGER("You cannot do that in your current state.")) return @@ -193,13 +193,46 @@ /mob/living/verb/lay_down() set name = "Rest" set category = "IC" + set_resting(!resting, FALSE, TRUE) - if(!resting) - apply_effect(1, WEAKEN) //so that the mob immediately falls over - - resting = !resting +///Proc to hook behavior to the change of value in the resting variable. +/mob/living/proc/set_resting(new_resting, silent = TRUE, instant = FALSE) + if(!(mobility_flags & MOBILITY_REST)) + return + if(new_resting == resting) + return + if(!COOLDOWN_FINISHED(src, rest_cooldown)) + to_chat(src, SPAN_WARNING("You can't 'rest' that fast. Take a breather!")) + return + COOLDOWN_START(src, rest_cooldown, 1 SECONDS) + + . = resting + resting = new_resting + if(new_resting) + if(body_position == LYING_DOWN) + if(!silent) + to_chat(src, SPAN_NOTICE("You will now try to stay lying down on the floor.")) + else if(HAS_TRAIT(src, TRAIT_FORCED_STANDING) || (buckled && buckled.buckle_lying != NO_BUCKLE_LYING)) + if(!silent) + to_chat(src, SPAN_NOTICE("You will now lay down as soon as you are able to.")) + else + if(!silent) + to_chat(src, SPAN_NOTICE("You lay down.")) + set_lying_down() + else + if(body_position == STANDING_UP) + if(!silent) + to_chat(src, SPAN_NOTICE("You will now try to remain standing up.")) + else if(HAS_TRAIT(src, TRAIT_FLOORED) || (buckled && buckled.buckle_lying != NO_BUCKLE_LYING)) + if(!silent) + to_chat(src, SPAN_NOTICE("You will now stand up as soon as you are able to.")) + else + if(!silent) + to_chat(src, SPAN_NOTICE("You stand up.")) + get_up(instant) - to_chat(src, SPAN_NOTICE("You are now [resting ? "resting." : "getting up."]")) +// SEND_SIGNAL(src, COMSIG_LIVING_RESTING, new_resting, silent, instant) +// update_resting() // HUD icons /mob/living/carbon/human/proc/toggle_inherent_nightvison() set category = "Synthetic" diff --git a/code/modules/mob/living/carbon/human/species/monkey.dm b/code/modules/mob/living/carbon/human/species/monkey.dm index f1ef5d40ec69..8e8d2443293d 100644 --- a/code/modules/mob/living/carbon/human/species/monkey.dm +++ b/code/modules/mob/living/carbon/human/species/monkey.dm @@ -46,7 +46,7 @@ /datum/species/monkey/handle_npc(mob/living/carbon/human/H) if(H.stat != CONSCIOUS) return - if(prob(33) && isturf(H.loc) && !H.pulledby && !H.lying && !H.is_mob_restrained()) //won't move if being pulled + if(prob(33) && isturf(H.loc) && !H.pulledby && (H.mobility_flags & MOBILITY_MOVE) && !H.is_mob_restrained()) //won't move if being pulled step(H, pick(GLOB.cardinals)) var/obj/held = H.get_active_hand() diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 52f0a54b7a4f..397a478a2779 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -166,6 +166,13 @@ for(var/datum/internal_organ/I in H.internal_organs) I.mechanize() + // We just deleted the legs so they fell down. + // Update again now that the legs are back so they can stand properly during rest of species code and before outside updates kick in. + // I hate this code. + H.update_leg_status() + // While we're deep in shitcode we also force instant transition so this nonsense isn't visually noticeable + H.update_transform(instant_update = TRUE) + /datum/species/proc/initialize_pain(mob/living/carbon/human/H) if(pain_type) QDEL_NULL(H.pain) @@ -179,12 +186,7 @@ /datum/species/proc/hug(mob/living/carbon/human/H, mob/living/carbon/target, target_zone = "chest") if(H.flags_emote) return - var/t_him = "them" - switch(target.gender) - if(MALE) - t_him = "him" - if(FEMALE) - t_him = "her" + var/t_him = target.p_them() if(target_zone == "head") attempt_rock_paper_scissors(H, target) @@ -195,6 +197,9 @@ else if(target_zone in list("l_hand", "r_hand")) attempt_fist_bump(H, target) return + else if(H.body_position == LYING_DOWN) // Keep other interactions above lying check for maximum awkwardness potential + H.visible_message(SPAN_NOTICE("[H] waves at [target] to make [t_him] feel better!"), \ + SPAN_NOTICE("You wave at [target] to make [t_him] feel better!"), null, 4) else if(target_zone == "groin") H.visible_message(SPAN_NOTICE("[H] hugs [target] to make [t_him] feel better!"), \ SPAN_NOTICE("You hug [target] to make [t_him] feel better!"), null, 4) diff --git a/code/modules/mob/living/carbon/human/species/zombie.dm b/code/modules/mob/living/carbon/human/species/zombie.dm index 251816c03468..76b1c3928659 100644 --- a/code/modules/mob/living/carbon/human/species/zombie.dm +++ b/code/modules/mob/living/carbon/human/species/zombie.dm @@ -53,9 +53,6 @@ if(zombie.glasses) zombie.drop_inv_item_on_ground(zombie.glasses, FALSE, TRUE) if(zombie.wear_mask) zombie.drop_inv_item_on_ground(zombie.wear_mask, FALSE, TRUE) - if(zombie.lying) - zombie.lying = FALSE - var/obj/item/weapon/zombie_claws/ZC = new(zombie) ZC.icon_state = "claw_r" zombie.equip_to_slot_or_del(ZC, WEAR_R_HAND, TRUE) @@ -116,7 +113,7 @@ /datum/species/zombie/proc/revive_from_death(mob/living/carbon/human/zombie) if(zombie && zombie.loc && zombie.stat == DEAD) zombie.revive(TRUE) - zombie.stunned = 4 + zombie.apply_effect(4, STUN) zombie.make_jittery(500) zombie.visible_message(SPAN_WARNING("[zombie] rises from the ground!")) diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 6aaf05ff9f12..c7427384f0a4 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -89,25 +89,6 @@ There are several things that need to be remembered: overlays -= I overlays_standing[cache_index] = null - -/mob/living/carbon/human/update_transform(force = FALSE) - if(lying == lying_prev && !force) - return - lying_prev = lying - var/matrix/new_matrix = matrix() - if(lying) - if(pulledby && pulledby.grab_level >= GRAB_CARRY) - new_matrix.Turn(90) - else - if(prob(50)) - new_matrix.Turn(90) - else - new_matrix.Turn(270) - new_matrix.Translate(rand(-10,10), rand(-10,10)) - apply_transform(new_matrix) - else - apply_transform(new_matrix) - /mob/living/carbon/human/UpdateDamageIcon() for(var/obj/limb/O in limbs) if(!(O.status & LIMB_DESTROYED)) @@ -131,6 +112,8 @@ There are several things that need to be remembered: //BASE MOB SPRITE /mob/living/carbon/human/proc/update_body() + update_leg_status() // Not icon ops, but placed here due to lack of a non-icons update_body + appearance_flags |= KEEP_TOGETHER // sanity update_damage_overlays() @@ -807,3 +790,11 @@ Applied by gun suicide and high impact bullet executions, removed by rejuvenate, /mob/living/carbon/human/on_immobilized_trait_loss(datum/source) . = ..() update_xeno_hostile_hud() + +/mob/living/carbon/human/on_floored_trait_gain(datum/source) + . = ..() + update_xeno_hostile_hud() + +/mob/living/carbon/human/on_floored_trait_loss(datum/source) + . = ..() + update_xeno_hostile_hud() diff --git a/code/modules/mob/living/carbon/update_icons.dm b/code/modules/mob/living/carbon/update_icons.dm index cc76999358a2..e08a71f81e12 100644 --- a/code/modules/mob/living/carbon/update_icons.dm +++ b/code/modules/mob/living/carbon/update_icons.dm @@ -4,8 +4,3 @@ /mob/living/carbon/proc/remove_overlay(cache_index) return - -/mob/living/carbon/update_transform() - if(lying != lying_prev ) - lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again - update_icons() diff --git a/code/modules/mob/living/carbon/xenomorph/Embryo.dm b/code/modules/mob/living/carbon/xenomorph/Embryo.dm index ee948b8ef1e0..0d522c142f36 100644 --- a/code/modules/mob/living/carbon/xenomorph/Embryo.dm +++ b/code/modules/mob/living/carbon/xenomorph/Embryo.dm @@ -102,7 +102,7 @@ switch(stage) if(2) if(prob(4)) - if(affected_mob.knocked_out < 1) + if(!HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) affected_mob.pain.apply_pain(PAIN_CHESTBURST_WEAK) affected_mob.visible_message(SPAN_DANGER("[affected_mob] starts shaking uncontrollably!"), \ SPAN_DANGER("You feel something moving inside you! You start shaking uncontrollably!")) @@ -123,7 +123,7 @@ else if(prob(2)) affected_mob.emote("[pick("sneeze", "cough")]") if(prob(5)) - if(affected_mob.knocked_out < 1) + if(!HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) affected_mob.pain.apply_pain(PAIN_CHESTBURST_WEAK) affected_mob.visible_message(SPAN_DANGER("\The [affected_mob] starts shaking uncontrollably!"), \ SPAN_DANGER("You feel something moving inside you! You start shaking uncontrollably!")) @@ -139,7 +139,7 @@ if(prob(50)) affected_mob.emote("scream") if(prob(6)) - if(affected_mob.knocked_out < 1) + if(!HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) affected_mob.pain.apply_pain(PAIN_CHESTBURST_WEAK) affected_mob.visible_message(SPAN_DANGER("[affected_mob] starts shaking uncontrollably!"), \ SPAN_DANGER("You feel something moving inside you! You start shaking uncontrollably!")) @@ -295,7 +295,7 @@ return victim.chestburst = TRUE to_chat(src, SPAN_DANGER("You start bursting out of [victim]'s chest!")) - if(victim.knocked_out < 1) + if(!HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) victim.apply_effect(20, DAZE) victim.visible_message(SPAN_DANGER("\The [victim] starts shaking uncontrollably!"), \ SPAN_DANGER("You feel something ripping up your insides!")) diff --git a/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm b/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm index 997d84465332..3ed4bf036e12 100644 --- a/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm +++ b/code/modules/mob/living/carbon/xenomorph/Facehuggers.dm @@ -116,8 +116,8 @@ attack_hand(user)//Not a carrier, or already full? Just pick it up. return XENO_NO_DELAY_ACTION -/obj/item/clothing/mask/facehugger/attack(mob/M, mob/user) - if(!can_hug(M, hivenumber) || !(M.is_mob_incapacitated() || M.lying || M.buckled && !isyautja(M))) +/obj/item/clothing/mask/facehugger/attack(mob/living/M, mob/user) + if(!can_hug(M, hivenumber) || !(M.is_mob_incapacitated() || M.body_position == LYING_DOWN || M.buckled && !isyautja(M))) to_chat(user, SPAN_WARNING("The facehugger refuses to attach.")) ..() return @@ -130,7 +130,7 @@ if(!do_after(user, 2 SECONDS, INTERRUPT_ALL, BUSY_ICON_HOSTILE, M, INTERRUPT_MOVED, BUSY_ICON_HOSTILE)) return - if(!can_hug(M, hivenumber) || !(M.is_mob_incapacitated() || M.lying || M.buckled)) + if(!can_hug(M, hivenumber) || !(M.is_mob_incapacitated() || M.body_position == LYING_DOWN || M.buckled)) return attach(M) @@ -525,7 +525,7 @@ var/catch_chance = 50 if(target.dir == GLOB.reverse_dir[hugger.dir]) catch_chance += 20 - if(target.lying) + if(target.body_position == LYING_DOWN) catch_chance -= 50 catch_chance -= ((target.maxHealth - target.health) / 3) if(target.get_active_hand()) diff --git a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm index 7b13e0010057..84eceb028349 100644 --- a/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm +++ b/code/modules/mob/living/carbon/xenomorph/XenoProcs.dm @@ -150,7 +150,7 @@ //A simple handler for checking your state. Used in pretty much all the procs. /mob/living/carbon/xenomorph/proc/check_state(permissive = FALSE) if(!permissive) - if(is_mob_incapacitated() || lying || buckled || evolving || !isturf(loc)) + if(is_mob_incapacitated() || body_position == LYING_DOWN || buckled || evolving || !isturf(loc)) to_chat(src, SPAN_WARNING("You cannot do this in your current state.")) return FALSE else if(caste_type != XENO_CASTE_QUEEN && observed_xeno) @@ -319,7 +319,6 @@ if (pounceAction.freeze_self) if(pounceAction.freeze_play_sound) playsound(loc, rand(0, 100) < 95 ? 'sound/voice/alien_pounce.ogg' : 'sound/voice/alien_pounce2.ogg', 25, 1) - canmove = FALSE ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Pounce")) pounceAction.freeze_timer_id = addtimer(CALLBACK(src, PROC_REF(unfreeze_pounce)), pounceAction.freeze_time, TIMER_STOPPABLE) pounceAction.additional_effects(M) @@ -556,7 +555,7 @@ if(!TC) TC = new(tackle_min + tackle_min_offset, tackle_max + tackle_max_offset, tackle_chance*tackle_mult) LAZYSET(tackle_counter, M, TC) - RegisterSignal(M, COMSIG_MOB_KNOCKED_DOWN, PROC_REF(tackle_handle_lying_changed)) + RegisterSignal(M, COMSIG_LIVING_SET_BODY_POSITION, PROC_REF(tackle_handle_lying_changed)) if (TC.tackle_reset_id) deltimer(TC.tackle_reset_id) @@ -568,8 +567,11 @@ else reset_tackle(M) -/mob/living/carbon/xenomorph/proc/tackle_handle_lying_changed(mob/M) +/mob/living/carbon/xenomorph/proc/tackle_handle_lying_changed(mob/living/M, body_position) SIGNAL_HANDLER + if(body_position != LYING_DOWN) + return + // Infected mobs do not have their tackle counter reset if // they get knocked down or get up from a knockdown if(M.status_flags & XENO_HOST) @@ -582,7 +584,7 @@ if (TC) qdel(TC) LAZYREMOVE(tackle_counter, M) - UnregisterSignal(M, COMSIG_MOB_KNOCKED_DOWN) + UnregisterSignal(M, COMSIG_LIVING_SET_BODY_POSITION) /mob/living/carbon/xenomorph/burn_skin(burn_amount) @@ -707,3 +709,6 @@ SSminimaps.remove_marker(src) add_minimap_marker() + +/mob/living/carbon/xenomorph/lying_angle_on_lying_down(new_lying_angle) + return // Do not rotate xenos around on the floor, their sprite is already top-down'ish diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm b/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm index 6f8ccd157481..35024d7304af 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm @@ -165,7 +165,6 @@ return REMOVE_TRAIT(H, TRAIT_IMMOBILIZED, trait_source) - H.update_canmove() if(ishuman(H)) var/mob/living/carbon/human/T = H diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm index 8b8e3f9c86a3..6a2071fafc3b 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/burrower/burrower_powers.dm @@ -37,18 +37,14 @@ to_chat(src, SPAN_XENOWARNING("You burrow yourself into the ground.")) invisibility = 101 anchored = TRUE - density = FALSE if(caste.fire_immunity == FIRE_IMMUNITY_NONE) RegisterSignal(src, COMSIG_LIVING_PREIGNITION, PROC_REF(fire_immune)) RegisterSignal(src, list( COMSIG_LIVING_FLAMER_CROSSED, COMSIG_LIVING_FLAMER_FLAMED, ), PROC_REF(flamer_crossed_immune)) - ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Burrow")) - ADD_TRAIT(src, TRAIT_ABILITY_BURROWED, TRAIT_SOURCE_ABILITY("Burrow")) - ADD_TRAIT(src, TRAIT_UNDENSE, TRAIT_SOURCE_ABILITY("Burrow")) + add_traits(list(TRAIT_ABILITY_BURROWED, TRAIT_UNDENSE, TRAIT_IMMOBILIZED), TRAIT_SOURCE_ABILITY("Burrow")) playsound(src.loc, 'sound/effects/burrowing_b.ogg', 25) - update_canmove() update_icons() addtimer(CALLBACK(src, PROC_REF(do_burrow_cooldown)), (caste ? caste.burrow_cooldown : 5 SECONDS)) burrow_timer = world.time + 90 // How long we can be burrowed @@ -74,19 +70,15 @@ COMSIG_LIVING_FLAMER_CROSSED, COMSIG_LIVING_FLAMER_FLAMED, )) - REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Burrow")) - REMOVE_TRAIT(src, TRAIT_ABILITY_BURROWED, TRAIT_SOURCE_ABILITY("Burrow")) - REMOVE_TRAIT(src, TRAIT_UNDENSE, TRAIT_SOURCE_ABILITY("Burrow")) + remove_traits(list(TRAIT_ABILITY_BURROWED, TRAIT_UNDENSE, TRAIT_IMMOBILIZED), TRAIT_SOURCE_ABILITY("Burrow")) invisibility = FALSE anchored = FALSE - density = TRUE playsound(loc, 'sound/effects/burrowoff.ogg', 25) for(var/mob/living/carbon/mob in loc) if(!can_not_harm(mob)) mob.apply_effect(2, WEAKEN) addtimer(CALLBACK(src, PROC_REF(do_burrow_cooldown)), (caste ? caste.burrow_cooldown : 5 SECONDS)) - update_canmove() update_icons() /mob/living/carbon/xenomorph/proc/do_burrow_cooldown() diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_abilities.dm b/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_abilities.dm index 6405428de7cb..63051a94efa9 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_abilities.dm @@ -120,6 +120,10 @@ var/momentum = 0 +/datum/action/xeno_action/onclick/charger_charge/proc/handle_position_change(mob/living/carbon/xenomorph/xeno, body_position) + SIGNAL_HANDLER + if(body_position == LYING_DOWN) + handle_movement(xeno) /datum/action/xeno_action/onclick/charger_charge/proc/handle_movement(mob/living/carbon/xenomorph/Xeno, atom/oldloc, dir, forced) SIGNAL_HANDLER @@ -178,7 +182,7 @@ playsound(Xeno, 'sound/effects/alien_footstep_charge1.ogg', 50) for(var/mob/living/carbon/human/Mob in Xeno.loc) - if(Mob.lying && Mob.stat != DEAD) + if(Mob.body_position == LYING_DOWN && Mob.stat != DEAD) Xeno.visible_message(SPAN_DANGER("[Xeno] runs [Mob] over!"), SPAN_DANGER("You run [Mob] over!") ) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_powers.dm index ce4a631e281f..34a9a4833fec 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/crusher/crusher_powers.dm @@ -252,7 +252,7 @@ to_chat(Xeno, SPAN_XENONOTICE("You will [will_charge] charge when moving.")) if(activated) RegisterSignal(Xeno, COMSIG_MOVABLE_MOVED, PROC_REF(handle_movement)) - RegisterSignal(Xeno, COMSIG_MOB_KNOCKED_DOWN, PROC_REF(handle_movement)) + RegisterSignal(Xeno, COMSIG_LIVING_SET_BODY_POSITION, PROC_REF(handle_position_change)) RegisterSignal(Xeno, COMSIG_ATOM_DIR_CHANGE, PROC_REF(handle_dir_change)) RegisterSignal(Xeno, COMSIG_XENO_RECALCULATE_SPEED, PROC_REF(update_speed)) RegisterSignal(Xeno, COMSIG_XENO_STOP_MOMENTUM, PROC_REF(stop_momentum)) @@ -264,7 +264,7 @@ stop_momentum() UnregisterSignal(Xeno, list( COMSIG_MOVABLE_MOVED, - COMSIG_MOB_KNOCKED_DOWN, + COMSIG_LIVING_SET_BODY_POSITION, COMSIG_ATOM_DIR_CHANGE, COMSIG_XENO_RECALCULATE_SPEED, COMSIG_MOVABLE_ENTERED_RIVER, diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/defender/defender_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/defender/defender_powers.dm index 249271c5f050..0709f2b17717 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/defender/defender_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/defender/defender_powers.dm @@ -220,7 +220,6 @@ ADD_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Fortify")) X.anchored = TRUE X.small_explosives_stun = FALSE - X.update_canmove() RegisterSignal(owner, COMSIG_XENO_PRE_CALCULATE_ARMOURED_DAMAGE_PROJECTILE, PROC_REF(check_directional_armor)) X.mob_size = MOB_SIZE_IMMOBILE //knockback immune X.mob_flags &= ~SQUEEZE_UNDER_VEHICLES @@ -242,7 +241,6 @@ UnregisterSignal(owner, COMSIG_XENO_PRE_CALCULATE_ARMOURED_DAMAGE_PROJECTILE) X.mob_size = MOB_SIZE_XENO //no longer knockback immune X.mob_flags |= SQUEEZE_UNDER_VEHICLES - X.update_canmove() X.update_icons() X.fortify = FALSE diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm b/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm index 5e3ab3b0afd9..00a7ceaba97e 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm @@ -252,7 +252,6 @@ return var/mob/living/carbon/xenomorph/X = owner REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Pounce")) - X.update_canmove() deltimer(freeze_timer_id) freeze_timer_id = TIMER_ID_NULL to_chat(X, SPAN_XENONOTICE("Slashing frenzies you! You feel free to move immediately!")) @@ -285,7 +284,7 @@ /datum/action/xeno_action/onclick/toggle_long_range/can_use_action() var/mob/living/carbon/xenomorph/xeno = owner - if(xeno && !xeno.is_mob_incapacitated() && !xeno.lying && !xeno.buckled) + if(xeno && !xeno.is_mob_incapacitated() && !xeno.buckled) return TRUE /datum/action/xeno_action/onclick/toggle_long_range/give_to(mob/living/living_mob) @@ -542,6 +541,14 @@ hide_from(owner) +/datum/action/xeno_action/onclick/tacmap/can_use_action() + if(!owner) + return FALSE + var/mob/living/carbon/xenomorph/xeno = owner + if(xeno.is_mob_incapacitated() || xeno.dazed) + return FALSE + return TRUE + /datum/action/xeno_action/onclick/tacmap/use_ability(atom/target) var/mob/living/carbon/xenomorph/xeno = owner xeno.xeno_tacmap() diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm index f362be4358e3..94c0110fc68f 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_powers.dm @@ -413,7 +413,6 @@ if (!windup_interruptable) ADD_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Pounce")) X.anchored = TRUE - X.update_canmove() pre_windup_effects() if (!do_after(X, windup_duration, INTERRUPT_NO_NEEDHAND, BUSY_ICON_HOSTILE)) @@ -421,14 +420,12 @@ if (!windup_interruptable) REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Pounce")) X.anchored = FALSE - X.update_canmove() post_windup_effects(interrupted = TRUE) return if (!windup_interruptable) REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Pounce")) X.anchored = FALSE - X.update_canmove() post_windup_effects() X.visible_message(SPAN_XENOWARNING("\The [X] [ability_name][findtext(ability_name, "e", -1) || findtext(ability_name, "p", -1) ? "s" : "es"] at [A]!"), SPAN_XENOWARNING("You [ability_name] at [A]!")) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/hivelord/hivelord_abilities.dm b/code/modules/mob/living/carbon/xenomorph/abilities/hivelord/hivelord_abilities.dm index 8c39228e3567..02e7fd814453 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/hivelord/hivelord_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/hivelord/hivelord_abilities.dm @@ -18,7 +18,7 @@ /datum/action/xeno_action/active_toggle/toggle_speed/can_use_action() var/mob/living/carbon/xenomorph/hivelord/xeno = owner - if(xeno && !xeno.is_mob_incapacitated() && !xeno.lying && !xeno.buckled) + if(xeno && !xeno.is_mob_incapacitated() && xeno.body_position == STANDING_UP && !xeno.buckled) // do we rly need standing up? return TRUE /datum/action/xeno_action/active_toggle/toggle_speed/give_to(mob/living/living_mob) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_powers.dm index 13734a5b9cf4..0c2b226cb268 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/lurker/lurker_powers.dm @@ -268,7 +268,7 @@ if(xeno.can_not_harm(target_carbon)) return - if(!(target_carbon.knocked_out || target_carbon.stat == UNCONSCIOUS)) //called knocked out because for some reason .stat seems to have a delay . + if(!(HAS_TRAIT(target_carbon, TRAIT_KNOCKEDOUT) || target_carbon.stat == UNCONSCIOUS)) //called knocked out because for some reason .stat seems to have a delay . to_chat(xeno, SPAN_XENOHIGHDANGER("You can only headbite an unconscious, adjacent target!")) return diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/praetorian/praetorian_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/praetorian/praetorian_powers.dm index 8fe8121a6d48..85a9ee8f054b 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/praetorian/praetorian_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/praetorian/praetorian_powers.dm @@ -174,9 +174,7 @@ var/root_duration = buffed ? root_duration_buffed : root_duration_unbuffed vanguard_user.visible_message(SPAN_XENODANGER("[vanguard_user] slams [target_atom] into the ground!"), SPAN_XENOHIGHDANGER("You slam [target_atom] into the ground!")) - ADD_TRAIT(target_carbon, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Cleave")) - target_carbon.update_canmove() if (ishuman(target_carbon)) var/mob/living/carbon/human/Hu = target_carbon @@ -293,7 +291,6 @@ var/throw_target_turf = get_step(xeno.loc, facing) ADD_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Abduct")) - xeno.update_canmove() if(!do_after(xeno, windup, INTERRUPT_NO_NEEDHAND, BUSY_ICON_HOSTILE, numticks = 1)) to_chat(xeno, SPAN_XENOWARNING("You relax your tail.")) apply_cooldown() @@ -303,7 +300,6 @@ qdel(xenotelegraph) REMOVE_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Abduct")) - xeno.update_canmove() return @@ -311,7 +307,6 @@ return REMOVE_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Abduct")) - xeno.update_canmove() playsound(get_turf(xeno), 'sound/effects/bang.ogg', 25, 0) xeno.visible_message(SPAN_XENODANGER("\The [xeno] suddenly uncoils its tail, firing it towards [atom]!"), SPAN_XENODANGER("You uncoil your tail, sending it out towards \the [atom]!")) @@ -339,13 +334,11 @@ new /datum/effects/xeno_slow(target, xeno, , ,25) target.apply_effect(1, SLOW) else if (LAZYLEN(targets) == 2) - ADD_TRAIT(target, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Abduct")) - target.update_canmove() if (ishuman(target)) - var/mob/living/carbon/human/human = target - human.update_xeno_hostile_hud() - addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(unroot_human), target), get_xeno_stun_duration(target, 25)) + var/mob/living/carbon/human/target_human = target + target_human.update_xeno_hostile_hud() + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(unroot_human), target, TRAIT_SOURCE_ABILITY("Abduct")), get_xeno_stun_duration(target, 25)) to_chat(target, SPAN_XENOHIGHDANGER("[xeno] has pinned you to the ground! You cannot move!")) target.set_effect(2, DAZE) @@ -409,10 +402,9 @@ oppressor_user.animation_attack_on(target_carbon) oppressor_user.flick_attack_overlay(target_carbon, "punch") - if (HAS_TRAIT(target_carbon, TRAIT_IMMOBILIZED) || target_carbon.slowed || target_carbon.knocked_down) + if (!(target_carbon.mobility_flags & MOBILITY_MOVE) || !(target_carbon.mobility_flags & MOBILITY_STAND) || target_carbon.slowed) target_carbon.apply_damage(get_xeno_damage_slash(target_carbon, damage), BRUTE, target_limb? target_limb.name : "chest") ADD_TRAIT(target_carbon, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Oppressor Punch")) - target_carbon.update_canmove() if (ishuman(target_carbon)) var/mob/living/carbon/human/Hu = target_carbon @@ -1013,7 +1005,6 @@ throw_target_turf = behind_turf ADD_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Praetorian Retrieve")) - X.update_canmove() if(windup) if(!do_after(X, windup, INTERRUPT_NO_NEEDHAND, BUSY_ICON_HOSTILE, numticks = 1)) to_chat(X, SPAN_XENOWARNING("You cancel your retrieve.")) @@ -1024,12 +1015,10 @@ qdel(XT) REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Praetorian Retrieve")) - X.update_canmove() return REMOVE_TRAIT(X, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Praetorian Retrieve")) - X.update_canmove() playsound(get_turf(X), 'sound/effects/bang.ogg', 25, 0) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm index a26cc922c528..3c475743c0bf 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/predalien/predalien_powers.dm @@ -79,7 +79,6 @@ for(var/mob/living/carbon/carbon in oview(round(behavior.kills * 0.5 + 2), xeno)) if(!xeno.can_not_harm(carbon) && carbon.stat != DEAD) ADD_TRAIT(carbon, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Smash")) - carbon.update_canmove() if (ishuman(carbon)) var/mob/living/carbon/human/human = carbon @@ -126,7 +125,6 @@ return ADD_TRAIT(carbon, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Devastate")) - carbon.update_canmove() if (ishuman(carbon)) var/mob/living/carbon/human/human = carbon @@ -136,7 +134,6 @@ ADD_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Devastate")) xeno.anchored = TRUE - xeno.update_canmove() if (do_after(xeno, activation_delay, INTERRUPT_ALL | BEHAVIOR_IMMOBILE, BUSY_ICON_HOSTILE)) xeno.visible_message(SPAN_XENOHIGHDANGER("[xeno] rips open the guts of [carbon]!"), SPAN_XENOHIGHDANGER("You rip open the guts of [carbon]!")) @@ -154,9 +151,6 @@ REMOVE_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Devastate")) xeno.anchored = FALSE unroot_human(carbon, TRAIT_SOURCE_ABILITY("Devastate")) - xeno.update_canmove() - - unroot_human(carbon) xeno.visible_message(SPAN_XENODANGER("[xeno] rapidly slices into [carbon]!")) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/ravager/ravager_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/ravager/ravager_powers.dm index 34e84866304b..22f119faf234 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/ravager/ravager_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/ravager/ravager_powers.dm @@ -388,7 +388,6 @@ ADD_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Eviscerate")) xeno.anchored = TRUE - xeno.update_canmove() if (do_after(xeno, (activation_delay - windup_reduction), INTERRUPT_ALL | BEHAVIOR_IMMOBILE, BUSY_ICON_HOSTILE)) xeno.emote("roar") @@ -433,7 +432,6 @@ REMOVE_TRAIT(xeno, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ABILITY("Eviscerate")) xeno.anchored = FALSE - xeno.update_canmove() return ..() diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/xeno_action.dm b/code/modules/mob/living/carbon/xenomorph/abilities/xeno_action.dm index e0d1db45c9a7..11b8f0db0075 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/xeno_action.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/xeno_action.dm @@ -71,7 +71,7 @@ if(!owner) return FALSE var/mob/living/carbon/xenomorph/X = owner - if(X && !X.is_mob_incapacitated() && !X.dazed && !X.lying && !X.buckled && X.plasma_stored >= plasma_cost) + if(X && !X.is_mob_incapacitated() && !X.dazed && X.body_position == STANDING_UP && !X.buckled && X.plasma_stored >= plasma_cost) return TRUE /datum/action/xeno_action/give_to(mob/living/L) diff --git a/code/modules/mob/living/carbon/xenomorph/attack_alien.dm b/code/modules/mob/living/carbon/xenomorph/attack_alien.dm index ba8099cea404..0ad84fc49e42 100644 --- a/code/modules/mob/living/carbon/xenomorph/attack_alien.dm +++ b/code/modules/mob/living/carbon/xenomorph/attack_alien.dm @@ -209,7 +209,7 @@ SPAN_DANGER("You tackle down [src]!"), null, 5, CHAT_TYPE_XENO_COMBAT) else playsound(loc, 'sound/weapons/alien_claw_swipe.ogg', 25, 1) - if (knocked_down) + if (HAS_TRAIT(src, TRAIT_FLOORED)) M.visible_message(SPAN_DANGER("[M] tries to tackle [src], but they are already down!"), \ SPAN_DANGER("You try to tackle [src], but they are already down!"), null, 5, CHAT_TYPE_XENO_COMBAT) else @@ -555,7 +555,7 @@ if(M.action_busy) return XENO_NO_DELAY_ACTION - if(M.lying) + if(M.is_mob_incapacitated() || M.body_position != STANDING_UP) return XENO_NO_DELAY_ACTION var/delay @@ -574,7 +574,7 @@ if(do_after(M, delay, INTERRUPT_ALL, BUSY_ICON_HOSTILE)) if(M.loc != cur_loc) return XENO_NO_DELAY_ACTION //Make sure we're still there - if(M.lying) + if(M.is_mob_incapacitated() || M.body_position != STANDING_UP) return XENO_NO_DELAY_ACTION if(locked) to_chat(M, SPAN_WARNING("[src] is bolted down tight.")) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm b/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm index e7118164cf07..ee882bc14fdf 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm @@ -84,13 +84,6 @@ . = ..() sight |= SEE_TURFS -/mob/living/carbon/xenomorph/burrower/update_canmove() - . = ..() - if(HAS_TRAIT(src, TRAIT_ABILITY_BURROWED)) - density = FALSE - canmove = FALSE - return canmove - /mob/living/carbon/xenomorph/burrower/ex_act(severity) if(HAS_TRAIT(src, TRAIT_ABILITY_BURROWED)) return diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm b/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm index c13555cba12c..07f161f4c6f7 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm @@ -117,8 +117,8 @@ for(var/i in hugger_image_index) if(stat == DEAD) hugger_overlays_icon.overlays += icon(icon, "clinger_[i] Knocked Down") - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) hugger_overlays_icon.overlays += icon(icon, "clinger_[i] Sleeping") else hugger_overlays_icon.overlays +=icon(icon, "clinger_[i] Knocked Down") @@ -162,8 +162,8 @@ i = 1 if(stat != DEAD) - if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) eggsac_overlays_icon.overlays += icon(icon, "eggsac_[i] Sleeping") else eggsac_overlays_icon.overlays +=icon(icon, "eggsac_[i] Knocked Down") diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm b/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm index c9ceaaa85cfb..3e01cc2af139 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm @@ -70,7 +70,7 @@ if(stat == DEAD) return ..() - if(!lying && !(mutation_type == FACEHUGGER_WATCHER) && !(locate(/obj/effect/alien/weeds) in get_turf(src))) + if(body_position == STANDING_UP && !(mutation_type == FACEHUGGER_WATCHER) && !(locate(/obj/effect/alien/weeds) in get_turf(src))) adjustBruteLoss(1) return ..() @@ -86,8 +86,8 @@ if(stat == DEAD) icon_state = "[mutation_type] [caste.caste_type] Dead" - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) icon_state = "[mutation_type] [caste.caste_type] Sleeping" else icon_state = "[mutation_type] [caste.caste_type] Knocked Down" @@ -110,8 +110,8 @@ if(!caste) return FALSE - if(lying) //No attacks while laying down - return FALSE + if(body_position == LYING_DOWN) //No attacks while laying down + return FALSE // Yoooo replace this by a mobility_flag for attacks or something if(istype(A, /obj/effect/alien/resin/special/eggmorph)) var/obj/effect/alien/resin/special/eggmorph/morpher = A @@ -130,7 +130,7 @@ if(ishuman(A)) var/mob/living/carbon/human/human = A - if(!human.lying) + if(human.body_position != LYING_DOWN) to_chat(src, SPAN_WARNING("You can't reach \the [human], they need to be lying down.")) return if(!can_hug(human, hivenumber)) @@ -139,7 +139,7 @@ visible_message(SPAN_WARNING("\The [src] starts climbing onto \the [human]'s face..."), SPAN_XENONOTICE("You start climbing onto \the [human]'s face...")) if(!do_after(src, FACEHUGGER_WINDUP_DURATION, INTERRUPT_ALL, BUSY_ICON_HOSTILE, human, INTERRUPT_MOVED, BUSY_ICON_HOSTILE)) return - if(!human.lying) + if(human.body_position != LYING_DOWN) to_chat(src, SPAN_WARNING("You can't reach \the [human], they need to be lying down.")) return if(!can_hug(human, hivenumber)) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm b/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm index 82d80752ec54..816e6020c30f 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Larva.dm @@ -130,8 +130,8 @@ else if(handcuffed || legcuffed) icon_state = "[state_override || state]Larva Cuff" - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) icon_state = "[state_override || state]Larva Sleeping" else icon_state = "[state_override || state]Larva Stunned" @@ -155,7 +155,7 @@ if(!caste) return FALSE - if(lying) //No attacks while laying down + if(body_position) //No attacks while laying down return FALSE A.attack_larva(src) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm index 1c7ba8503d4d..a34913b2ff5c 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm @@ -102,7 +102,7 @@ if (!isxeno_human(target_carbon)) return - if (target_carbon.knocked_down) + if (HAS_TRAIT(target_carbon, TRAIT_FLOORED)) new /datum/effects/xeno_slow(target_carbon, bound_xeno, null, null, get_xeno_stun_duration(target_carbon, slash_slow_duration)) return diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm index b83b33e2eee5..e6f4dfae8a44 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm @@ -791,6 +791,9 @@ if(ovipositor) return //sanity check ovipositor = TRUE + ADD_TRAIT(src, TRAIT_IMMOBILIZED, OVIPOSITOR_TRAIT) + set_body_position(STANDING_UP) + set_resting(FALSE) set_resin_build_order(GLOB.resin_build_order_ovipositor) // This needs to occur before we update the abilities so we can update the choose resin icon for(var/datum/action/xeno_action/action in actions) @@ -843,7 +846,6 @@ egg_planting_range = 3 anchored = TRUE resting = FALSE - update_canmove() update_icons() bubble_icon_x_offset = 32 bubble_icon_y_offset = 32 @@ -871,6 +873,7 @@ if(!ovipositor) return ovipositor = FALSE + REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, OVIPOSITOR_TRAIT) update_icons() bubble_icon_x_offset = initial(bubble_icon_x_offset) bubble_icon_y_offset = initial(bubble_icon_y_offset) @@ -899,7 +902,6 @@ ovi_ability.apply_cooldown() break anchored = FALSE - update_canmove() for(var/mob/living/carbon/xenomorph/L in hive.xeno_leader_list) L.handle_xeno_leader_pheromones() @@ -909,14 +911,6 @@ SEND_SIGNAL(src, COMSIG_QUEEN_DISMOUNT_OVIPOSITOR, instant_dismount) -/mob/living/carbon/xenomorph/queen/update_canmove() - . = ..() - if(ovipositor) - lying = FALSE - density = TRUE - canmove = FALSE - return canmove - /mob/living/carbon/xenomorph/queen/handle_special_state() if(ovipositor) return TRUE diff --git a/code/modules/mob/living/carbon/xenomorph/damage_procs.dm b/code/modules/mob/living/carbon/xenomorph/damage_procs.dm index 51ceee153368..b6ceb2043458 100644 --- a/code/modules/mob/living/carbon/xenomorph/damage_procs.dm +++ b/code/modules/mob/living/carbon/xenomorph/damage_procs.dm @@ -36,7 +36,7 @@ /mob/living/carbon/xenomorph/ex_act(severity, direction, datum/cause_data/cause_data, pierce=0) - if(lying) + if(body_position == LYING_DOWN) severity *= EXPLOSION_PRONE_MULTIPLIER if(severity >= 30) diff --git a/code/modules/mob/living/carbon/xenomorph/life.dm b/code/modules/mob/living/carbon/xenomorph/life.dm index 09a4f5014bc4..f794c051dbff 100644 --- a/code/modules/mob/living/carbon/xenomorph/life.dm +++ b/code/modules/mob/living/carbon/xenomorph/life.dm @@ -10,7 +10,8 @@ ..() - if(is_zoomed && (stat || lying)) + // replace this by signals or trait signals + if(is_zoomed && (stat || body_position == LYING_DOWN)) zoom_out() if(stat != DEAD) //Stop if dead. Performance boost @@ -23,7 +24,6 @@ handle_regular_status_updates() handle_stomach_contents() handle_overwatch() // For new Xeno hivewide overwatch - Fourk, 6/24/19 - update_canmove() update_icons() handle_luminosity() handle_blood() @@ -187,9 +187,8 @@ ear_damage = 0 SetEyeBlind(0) - if(knocked_out) //If they're down, make sure they are actually down. + if(HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) //If they're down, make sure they are actually down. blinded = TRUE - set_stat(UNCONSCIOUS) if(regular_update && halloss > 0) apply_damage(-3, HALLOSS) else if(sleeping) @@ -342,7 +341,7 @@ Make sure their actual health updates immediately.*/ if(recovery_aura) plasma_stored += round(plasma_gain * plasma_max / 100 * recovery_aura/4) //Divided by four because it gets massive fast. 1 is equivalent to weed regen! Only the strongest pheromones should bypass weeds if(health < maxHealth && !hardcore && is_hive_living(hive) && last_hit_time + caste.heal_delay_time <= world.time) - if(lying || resting) + if(body_position == LYING_DOWN || resting) if(health < 0) //Unconscious heal_wounds(caste.heal_knocked_out * regeneration_multiplier, recoveryActual) //Healing is much slower. Warding pheromones make up for the rest if you're curious else @@ -536,8 +535,6 @@ Make sure their actual health updates immediately.*/ if(layer != initial(layer)) //Unhide layer = initial(layer) recalculate_move_delay = TRUE - if(!lying) - update_canmove() /mob/living/carbon/xenomorph/proc/handle_luminosity() var/new_luminosity = 0 @@ -583,16 +580,14 @@ Make sure their actual health updates immediately.*/ return superslowed /mob/living/carbon/xenomorph/handle_knocked_down() - if(knocked_down) + if(HAS_TRAIT(src, TRAIT_FLOORED)) adjust_effect(life_knockdown_reduction, WEAKEN, EFFECT_FLAG_LIFE) knocked_down_callback_check() - return knocked_down /mob/living/carbon/xenomorph/handle_knocked_out() - if(knocked_out) + if(HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) adjust_effect(life_knockout_reduction, PARALYZE, EFFECT_FLAG_LIFE) knocked_out_callback_check() - return knocked_out //Returns TRUE if xeno is on weeds //Returns TRUE if xeno is off weeds AND doesn't need weeds for healing AND is not on Almayer UNLESS Queen is also on Almayer (aka - no solo Lurker Almayer hero) diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/strains/crusher/charger.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/crusher/charger.dm index b455cbf9e0a4..1fc746829acd 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/crusher/charger.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/crusher/charger.dm @@ -82,7 +82,7 @@ return /datum/behavior_delegate/crusher_charger/on_update_icons() - if(HAS_TRAIT(bound_xeno, TRAIT_CHARGING) && !bound_xeno.lying) + if(HAS_TRAIT(bound_xeno, TRAIT_CHARGING) && bound_xeno.body_position == STANDING_UP) bound_xeno.icon_state = "[bound_xeno.mutation_icon_state || bound_xeno.mutation_type] Crusher Charging" return TRUE diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/gardener.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/gardener.dm index 303e1c94692d..c11f0e11f399 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/gardener.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/gardener.dm @@ -379,8 +379,8 @@ if(bound_xeno.stat == DEAD) fruit_sac_overlay_icon.icon_state = "Gardener Drone Dead" - else if(bound_xeno.lying) - if((bound_xeno.resting || bound_xeno.sleeping) && (!bound_xeno.knocked_down && !bound_xeno.knocked_out && bound_xeno.health > 0)) + else if(bound_xeno.body_position == LYING_DOWN) + if(!HAS_TRAIT(bound_xeno, TRAIT_INCAPACITATED) && !HAS_TRAIT(bound_xeno, TRAIT_FLOORED)) fruit_sac_overlay_icon.icon_state = "Gardener Drone Sleeping" else fruit_sac_overlay_icon.icon_state = "Gardener Drone Knocked Down" diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/healer.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/healer.dm index 5caab38529e6..2e562ceac6a9 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/healer.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/healer.dm @@ -160,8 +160,8 @@ if(bound_xeno.stat == DEAD) salve_applied_icon.icon_state = "Healer Drone Dead" - else if(bound_xeno.lying) - if((bound_xeno.resting || bound_xeno.sleeping) && (!bound_xeno.knocked_down && !bound_xeno.knocked_out && bound_xeno.health > 0)) + else if(bound_xeno.body_position == LYING_DOWN) + if(!HAS_TRAIT(bound_xeno, TRAIT_INCAPACITATED) && !HAS_TRAIT(bound_xeno, TRAIT_FLOORED)) salve_applied_icon.icon_state = "Healer Drone Sleeping" else salve_applied_icon.icon_state = "Healer Drone Knocked Down" diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/strains/praetorian/oppressor.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/praetorian/oppressor.dm index ecb0e1eff51e..4beaedf8d6a8 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/praetorian/oppressor.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/praetorian/oppressor.dm @@ -52,14 +52,12 @@ var/tearing_damage = 15 /datum/behavior_delegate/oppressor_praetorian/melee_attack_additional_effects_target(mob/living/carbon/target_carbon) - if(target_carbon.stat == DEAD) return - if(!(target_carbon.knocked_down || HAS_TRAIT(target_carbon, TRAIT_IMMOBILIZED) || target_carbon.slowed)) - return + // impaired in some capacity + if(!(target_carbon.mobility_flags & MOBILITY_STAND) || !(target_carbon.mobility_flags & MOBILITY_MOVE) || target_carbon.slowed) + target_carbon.apply_armoured_damage(get_xeno_damage_slash(target_carbon, tearing_damage), ARMOR_MELEE, BRUTE, bound_xeno.zone_selected ? bound_xeno.zone_selected : "chest") + target_carbon.visible_message(SPAN_DANGER("[bound_xeno] tears into [target_carbon]!")) + playsound(bound_xeno, 'sound/weapons/alien_tail_attack.ogg', 25, TRUE) - target_carbon.apply_armoured_damage(get_xeno_damage_slash(target_carbon, tearing_damage), ARMOR_MELEE, BRUTE, bound_xeno.zone_selected ? bound_xeno.zone_selected : "chest") - target_carbon.visible_message(SPAN_DANGER("[bound_xeno] tears into [target_carbon]!")) - playsound(bound_xeno, 'sound/weapons/alien_tail_attack.ogg', 25, TRUE) - return diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/strains/runner/acid.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/runner/acid.dm index 630edf26d353..490e5ca36cba 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/runner/acid.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/runner/acid.dm @@ -87,7 +87,7 @@ if(embryo?.stage >= 4) //very late stage hugged in case the runner unnests them return - if(target_mob.lying) + if(target_mob.body_position == LYING_DOWN) modify_acid(acid_slash_regen_lying) return modify_acid(acid_slash_regen_standing) diff --git a/code/modules/mob/living/carbon/xenomorph/update_icons.dm b/code/modules/mob/living/carbon/xenomorph/update_icons.dm index 27e7ec3225ed..e576b23e2855 100644 --- a/code/modules/mob/living/carbon/xenomorph/update_icons.dm +++ b/code/modules/mob/living/carbon/xenomorph/update_icons.dm @@ -69,8 +69,8 @@ icon_state = "[mutation_caste_state] Dead" if(!(icon_state in icon_states(icon_xeno))) icon_state = "Normal [caste.caste_type] Dead" - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) icon_state = "[mutation_caste_state] Sleeping" if(!(icon_state in icon_states(icon_xeno))) icon_state = "Normal [caste.caste_type] Sleeping" @@ -93,6 +93,28 @@ update_inv_resource() update_icons() +/* CRUTCH ZONE - Update icons when relevant status happen - Ideally do this properly and for everything, then kill update_icons() someday */ +// set_body_position is needed on addition of floored start/stop because we can be switching between resting and knockeddown +/mob/living/carbon/xenomorph/set_body_position(new_value) + . = ..() + if(. != new_value) + update_icons() // Snowflake handler for xeno resting icons + +/mob/living/carbon/xenomorph/on_floored_start() + . = ..() + update_icons() +/mob/living/carbon/xenomorph/on_floored_end() + . = ..() + update_icons() +/mob/living/carbon/xenomorph/on_incapacitated_trait_gain() + . = ..() + update_icons() +/mob/living/carbon/xenomorph/on_incapacitated_trait_loss() + . = ..() + update_icons() + +/* ^^^^^^^^^^^^^^ End Icon updates */ + /mob/living/carbon/xenomorph/update_inv_pockets() var/datum/custom_hud/alien/ui_datum = GLOB.custom_huds_list[HUD_ALIEN] if(l_store) @@ -142,8 +164,8 @@ var/state_modifier = "" if(stat == DEAD) state_modifier = " Dead" - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) state_modifier = " Sleeping" else state_modifier = " Knocked Down" @@ -237,7 +259,7 @@ if(on_fire && fire_reagent) var/image/I if(mob_size >= MOB_SIZE_BIG) - if((!initial(pixel_y) || lying) && !resting && !sleeping) + if((!initial(pixel_y) || body_position != LYING_DOWN)) // what's that pixel_y doing here??? I = image("icon"='icons/mob/xenos/overlay_effects64x64.dmi', "icon_state"="alien_fire", "layer"=-X_FIRE_LAYER) else I = image("icon"='icons/mob/xenos/overlay_effects64x64.dmi', "icon_state"="alien_fire_lying", "layer"=-X_FIRE_LAYER) @@ -278,8 +300,8 @@ if(health > HEALTH_THRESHOLD_DEAD) if(health_threshold > 3) wound_icon_holder.icon_state = "none" - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) wound_icon_holder.icon_state = "[caste.caste_type]_rest_[health_threshold]" else wound_icon_holder.icon_state = "[caste.caste_type]_downed_[health_threshold]" diff --git a/code/modules/mob/living/init_signals.dm b/code/modules/mob/living/init_signals.dm index d7edd02893b3..696eaa3f0120 100644 --- a/code/modules/mob/living/init_signals.dm +++ b/code/modules/mob/living/init_signals.dm @@ -1,21 +1,91 @@ /// Called on [/mob/living/Initialize(mapload)], for the mob to register to relevant signals. /mob/living/proc/register_init_signals() + RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_KNOCKEDOUT), PROC_REF(on_knockedout_trait_gain)) + RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_KNOCKEDOUT), PROC_REF(on_knockedout_trait_loss)) RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_IMMOBILIZED), PROC_REF(on_immobilized_trait_gain)) RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_IMMOBILIZED), PROC_REF(on_immobilized_trait_loss)) + + RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_FLOORED), PROC_REF(on_floored_trait_gain)) + RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_FLOORED), PROC_REF(on_floored_trait_loss)) + + RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_FORCED_STANDING), PROC_REF(on_forced_standing_trait_gain)) + RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_FORCED_STANDING), PROC_REF(on_forced_standing_trait_loss)) + + RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_INCAPACITATED), PROC_REF(on_incapacitated_trait_gain)) + RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_INCAPACITATED), PROC_REF(on_incapacitated_trait_loss)) + RegisterSignal(src, list(SIGNAL_ADDTRAIT(TRAIT_UNDENSE), SIGNAL_REMOVETRAIT(TRAIT_UNDENSE)), PROC_REF(undense_changed)) +/// Called when [TRAIT_KNOCKEDOUT] is added to the mob. +/mob/living/proc/on_knockedout_trait_gain(datum/source) + SIGNAL_HANDLER + if(stat < UNCONSCIOUS) + set_stat(UNCONSCIOUS) + +/// Called when [TRAIT_KNOCKEDOUT] is removed from the mob. +/mob/living/proc/on_knockedout_trait_loss(datum/source) + SIGNAL_HANDLER + if(stat <= UNCONSCIOUS) + update_stat() + /// Called when [TRAIT_IMMOBILIZED] is added to the mob. /mob/living/proc/on_immobilized_trait_gain(datum/source) SIGNAL_HANDLER -// mobility_flags &= ~MOBILITY_MOVE - update_canmove() + mobility_flags &= ~MOBILITY_MOVE /// Called when [TRAIT_IMMOBILIZED] is removed from the mob. /mob/living/proc/on_immobilized_trait_loss(datum/source) SIGNAL_HANDLER -// mobility_flags |= MOBILITY_MOVE - update_canmove() + mobility_flags |= MOBILITY_MOVE + +/// Called when [TRAIT_FLOORED] is added to the mob. +/mob/living/proc/on_floored_trait_gain(datum/source) + SIGNAL_HANDLER + if(buckled && buckled.buckle_lying != NO_BUCKLE_LYING) + return // Handled by the buckle. + if(HAS_TRAIT(src, TRAIT_FORCED_STANDING)) + return // Don't go horizontal if mob has forced standing trait. + mobility_flags &= ~MOBILITY_STAND + on_floored_start() + + +/// Called when [TRAIT_FLOORED] is removed from the mob. +/mob/living/proc/on_floored_trait_loss(datum/source) + SIGNAL_HANDLER + mobility_flags |= MOBILITY_STAND + on_floored_end() + +/// Called when [TRAIT_FORCED_STANDING] is added to the mob. +/mob/living/proc/on_forced_standing_trait_gain(datum/source) + SIGNAL_HANDLER + + set_body_position(STANDING_UP) + set_lying_angle(0) + +/// Called when [TRAIT_FORCED_STANDING] is removed from the mob. +/mob/living/proc/on_forced_standing_trait_loss(datum/source) + SIGNAL_HANDLER + + if(HAS_TRAIT(src, TRAIT_FLOORED)) + on_fall() + set_lying_down() + else if(resting) + set_lying_down() + +/// Called when [TRAIT_INCAPACITATED] is added to the mob. +/mob/living/proc/on_incapacitated_trait_gain(datum/source) + SIGNAL_HANDLER + //add_traits(list(TRAIT_UI_BLOCKED, TRAIT_PULL_BLOCKED), TRAIT_INCAPACITATED) + //update_appearance() + return + +/// Called when [TRAIT_INCAPACITATED] is removed from the mob. +/mob/living/proc/on_incapacitated_trait_loss(datum/source) + SIGNAL_HANDLER + //remove_traits(list(TRAIT_UI_BLOCKED, TRAIT_PULL_BLOCKED), TRAIT_INCAPACITATED) + //update_appearance() + return /// Called when [TRAIT_UNDENSE] is gained or lost /mob/living/proc/undense_changed(datum/source) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 9f01b8037e0f..6205c4f919a4 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -34,11 +34,6 @@ QDEL_NULL(stamina) QDEL_NULL(hallucinations) -//This proc is used for mobs which are affected by pressure to calculate the amount of pressure that actually -//affects them once clothing is factored in. ~Errorage -/mob/living/proc/calculate_affecting_pressure(pressure) - return - /mob/living/proc/initialize_pain() pain = new /datum/pain(src) @@ -151,6 +146,8 @@ return /mob/living/Move(NewLoc, direct) + if(lying_angle != 0) + lying_angle_on_movement(direct) if (buckled && buckled.loc != NewLoc) //not updating position if (!buckled.anchored) return buckled.Move(NewLoc, direct) @@ -454,16 +451,170 @@ for(var/h in src.hud_possible) src.clone.hud_list[h].icon_state = src.hud_list[h].icon_state +// Note that this might CLASH with handle_regular_status_updates until it is ELIMINATED +// and everything is switched from updates to signaling - due to not accounting for all cases. +// If this proc causes issues you can probably disable it until then. +/mob/living/carbon/update_stat() + if(stat != DEAD) + if(health <= HEALTH_THRESHOLD_DEAD) + death() + return + else if(HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) + set_stat(UNCONSCIOUS) + else + set_stat(CONSCIOUS) + /mob/living/set_stat(new_stat) . = ..() if(isnull(.)) return - switch(.) + + switch(.) //Previous stat. + if(CONSCIOUS) + if(stat >= UNCONSCIOUS) + ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_KNOCKEDOUT) + add_traits(list(/*TRAIT_HANDS_BLOCKED, */ TRAIT_INCAPACITATED, TRAIT_FLOORED), STAT_TRAIT) + if(UNCONSCIOUS) + if(stat >= UNCONSCIOUS) + ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_KNOCKEDOUT) //adding trait sources should come before removing to avoid unnecessary updates if(DEAD) SEND_SIGNAL(src, COMSIG_MOB_STAT_SET_ALIVE) - switch(stat) +// remove_from_dead_mob_list() +// add_to_alive_mob_list() + + switch(stat) //Current stat. + if(CONSCIOUS) + if(. >= UNCONSCIOUS) + REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_KNOCKEDOUT) + remove_traits(list(/*TRAIT_HANDS_BLOCKED, */ TRAIT_INCAPACITATED, TRAIT_FLOORED, /*TRAIT_CRITICAL_CONDITION*/), STAT_TRAIT) + if(UNCONSCIOUS) + if(. >= UNCONSCIOUS) + REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_KNOCKEDOUT) if(DEAD) SEND_SIGNAL(src, COMSIG_MOB_STAT_SET_DEAD) +// REMOVE_TRAIT(src, TRAIT_CRITICAL_CONDITION, STAT_TRAIT) +// remove_from_alive_mob_list() +// add_to_dead_mob_list() + +/** + * Changes the inclination angle of a mob, used by humans and others to differentiate between standing up and prone positions. + * + * In BYOND-angles 0 is NORTH, 90 is EAST, 180 is SOUTH and 270 is WEST. + * This usually means that 0 is standing up, 90 and 270 are horizontal positions to right and left respectively, and 180 is upside-down. + * Mobs that do now follow these conventions due to unusual sprites should require a special handling or redefinition of this proc, due to the density and layer changes. + * The return of this proc is the previous value of the modified lying_angle if a change was successful (might include zero), or null if no change was made. + */ +/mob/living/proc/set_lying_angle(new_lying, on_movement = FALSE) + if(new_lying == lying_angle) + return + . = lying_angle + lying_angle = new_lying + if(lying_angle != lying_prev) + update_transform(instant_update = on_movement) // Don't use transition for eg. crawling movement, because we already have the movement glide + lying_prev = lying_angle + +///Called by mob Move() when the lying_angle is different than zero, to better visually simulate crawling. +/mob/living/proc/lying_angle_on_movement(direct) + if(direct & EAST) + set_lying_angle(90, on_movement = TRUE) + else if(direct & WEST) + set_lying_angle(270, on_movement = TRUE) + +///Reports the event of the change in value of the buckled variable. +/mob/living/proc/set_buckled(new_buckled) + if(new_buckled == buckled) + return + SEND_SIGNAL(src, COMSIG_LIVING_SET_BUCKLED, new_buckled) + . = buckled + buckled = new_buckled + if(buckled) +// if(!HAS_TRAIT(buckled, TRAIT_NO_IMMOBILIZE)) +// ADD_TRAIT(src, TRAIT_IMMOBILIZED, BUCKLED_TRAIT) + ADD_TRAIT(src, TRAIT_IMMOBILIZED, BUCKLED_TRAIT) + switch(buckled.buckle_lying) + if(NO_BUCKLE_LYING) // The buckle doesn't force a lying angle. + REMOVE_TRAIT(src, TRAIT_FLOORED, BUCKLED_TRAIT) + if(0) // Forcing to a standing position. + REMOVE_TRAIT(src, TRAIT_FLOORED, BUCKLED_TRAIT) + set_body_position(STANDING_UP) + set_lying_angle(0) + else // Forcing to a lying position. + ADD_TRAIT(src, TRAIT_FLOORED, BUCKLED_TRAIT) + set_body_position(LYING_DOWN) + set_lying_angle(buckled.buckle_lying) + else + remove_traits(list(TRAIT_IMMOBILIZED, TRAIT_FLOORED), BUCKLED_TRAIT) + if(.) // We unbuckled from something. + //var/atom/movable/old_buckled = . + var/obj/old_buckled = . // /tg/ code has buckling defined on /atom/movable - consider refactoring this sometime + if(old_buckled.buckle_lying == 0 && (resting || HAS_TRAIT(src, TRAIT_FLOORED))) // The buckle forced us to stay up (like a chair) + set_lying_down() // We want to rest or are otherwise floored, so let's drop on the ground. + +/mob/living/proc/get_up(instant = FALSE) // arg ignored +// set waitfor = FALSE +// if(!instant && !do_after(src, 1 SECONDS, src, timed_action_flags = (IGNORE_USER_LOC_CHANGE|IGNORE_TARGET_LOC_CHANGE|IGNORE_HELD_ITEM), extra_checks = CALLBACK(src, TYPE_PROC_REF(/mob/living, rest_checks_callback)), interaction_key = DOAFTER_SOURCE_GETTING_UP)) +// return + if(resting || body_position == STANDING_UP || HAS_TRAIT(src, TRAIT_FLOORED)) + return + set_body_position(STANDING_UP) + set_lying_angle(0) + +/// Change the [body_position] to [LYING_DOWN] and update associated behavior. +/mob/living/proc/set_lying_down(new_lying_angle) + set_body_position(LYING_DOWN) + +/// Proc to append behavior related to lying down. +/mob/living/proc/on_lying_down(new_lying_angle) +// if(layer == initial(layer)) //to avoid things like hiding larvas. +// layer = LYING_MOB_LAYER //so mob lying always appear behind standing mobs + add_traits(list(/*TRAIT_UI_BLOCKED, TRAIT_PULL_BLOCKED,*/ TRAIT_UNDENSE), LYING_DOWN_TRAIT) + if(HAS_TRAIT(src, TRAIT_FLOORED) && !(dir & (NORTH|SOUTH))) + setDir(pick(NORTH, SOUTH)) // We are and look helpless. +// if(rotate_on_lying) +// body_position_pixel_y_offset = PIXEL_Y_OFFSET_LYING + + // CM legacy canmove procs, replace this with signal procs probably + drop_l_hand() + drop_r_hand() + add_temp_pass_flags(PASS_MOB_THRU) + //so mob lying always appear behind standing mobs, but dead ones appear behind living ones + if(pulledby && pulledby.grab_level == GRAB_CARRY) + layer = ABOVE_MOB_LAYER + else if (stat == DEAD) + layer = LYING_DEAD_MOB_LAYER // Dead mobs should layer under living ones + else if(layer == initial(layer)) //to avoid things like hiding larvas. + layer = LYING_LIVING_MOB_LAYER + +/// Called when mob changes from a standing position into a prone while lacking the ability to stand up at the moment. +/mob/living/proc/on_fall() + return + +/// Changes the value of the [living/body_position] variable. Call this before set_lying_angle() +/mob/living/proc/set_body_position(new_value) + if(body_position == new_value) + return + if((new_value == LYING_DOWN) && !(mobility_flags & MOBILITY_LIEDOWN)) + return + . = body_position + body_position = new_value + SEND_SIGNAL(src, COMSIG_LIVING_SET_BODY_POSITION, new_value, .) + if(new_value == LYING_DOWN) // From standing to lying down. + on_lying_down() + else // From lying down to standing up. + on_standing_up() + +/// Proc to append behavior related to lying down. +/mob/living/proc/on_standing_up() + //if(layer == LYING_MOB_LAYER) + // layer = initial(layer) + remove_traits(list(/*TRAIT_UI_BLOCKED, TRAIT_PULL_BLOCKED,*/ TRAIT_UNDENSE), LYING_DOWN_TRAIT) + // Make sure it doesn't go out of the southern bounds of the tile when standing. + //body_position_pixel_y_offset = get_pixel_y_offset_standing(current_size) + // CM stuff below + remove_temp_pass_flags(PASS_MOB_THRU) + if(layer == LYING_DEAD_MOB_LAYER || layer == LYING_LIVING_MOB_LAYER) + layer = initial(layer) + /// Uses presence of [TRAIT_UNDENSE] to figure out what is the correct density state for the mob. Triggered by trait signal. /mob/living/proc/update_density() @@ -471,3 +622,40 @@ set_density(FALSE) else set_density(TRUE) + +/// Proc to append behavior to the condition of being floored. Called when the condition starts. +/mob/living/proc/on_floored_start() + if(body_position == STANDING_UP) //force them on the ground + set_body_position(LYING_DOWN) + set_lying_angle(pick(90, 270), on_movement = TRUE) +// on_fall() + + +/// Proc to append behavior to the condition of being floored. Called when the condition ends. +/mob/living/proc/on_floored_end() + if(!resting) + get_up() + + +/mob/living/update_transform(instant_update = FALSE) + var/visual_angle = lying_angle + if(!rotate_on_lying) + return + var/matrix/base = matrix() + if(pulledby && pulledby.grab_level >= GRAB_CARRY) + visual_angle = 90 // CM code - for fireman carry + if(instant_update) + apply_transform(base.Turn(visual_angle)) + else + apply_transform(base.Turn(visual_angle), UPDATE_TRANSFORM_ANIMATION_TIME) + + +// legacy procs +/mob/living/put_in_l_hand(obj/item/W) + if(body_position == LYING_DOWN) + return + return ..() +/mob/living/put_in_r_hand(obj/item/W) + if(body_position == LYING_DOWN) + return + return ..() diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 97d71fcb4e8e..ce4634a102fc 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -14,6 +14,18 @@ var/brainloss = 0 //'Retardation' damage caused by someone hitting you in the head with a bible or being infected with brainrot. var/halloss = 0 //Hallucination damage. 'Fake' damage obtained through hallucinating or the holodeck. Sleeping should cause it to wear off. + // please don't use these + VAR_PROTECTED/knocked_out = 0 + VAR_PROTECTED/knocked_down = 0 + VAR_PROTECTED/stunned = 0 + var/dazed = 0 + var/slowed = 0 // X_SLOW_AMOUNT + var/superslowed = 0 // X_SUPERSLOW_AMOUNT + var/sleeping = 0 + + /// Cooldown for manually toggling resting to avoid spamming + COOLDOWN_DECLARE(rest_cooldown) + var/hallucination = 0 //Directly affects how long a mob will hallucinate for var/list/atom/hallucinations = list() //A list of hallucinated people that try to attack the mob. See /obj/effect/fake_attacker in hallucinations.dm @@ -99,7 +111,6 @@ var/current_weather_effect_type - var/slash_verb = "attack" var/slashes_verb = "attacks" @@ -111,10 +122,15 @@ /// This is what the value is changed to when the mob dies. Actual BMV definition in atom/movable. var/dead_black_market_value = 0 - var/dazed = 0 - var/knocked_out = 0 - var/stunned = 0 - var/knocked_down = 0 - var/slowed = 0 // X_SLOW_AMOUNT - var/superslowed = 0 // X_SUPERSLOW_AMOUNT - var/sleeping = 0 + /// Variable to track the body position of a mob, regardgless of the actual angle of rotation (usually matching it, but not necessarily). + var/body_position = STANDING_UP + /// Number of degrees of rotation of a mob. 0 means no rotation, up-side facing NORTH. 90 means up-side rotated to face EAST, and so on. + VAR_PROTECTED/lying_angle = 0 + /// Value of lying lying_angle before last change. TODO: Remove the need for this. + var/lying_prev = 0 + /// Does the mob rotate when lying + var/rotate_on_lying = FALSE + + /// Flags that determine the potential of a mob to perform certain actions. Do not change this directly. + var/mobility_flags = MOBILITY_FLAGS_DEFAULT + diff --git a/code/modules/mob/living/living_health_procs.dm b/code/modules/mob/living/living_health_procs.dm index 3a96400ade6a..e4c9659db827 100644 --- a/code/modules/mob/living/living_health_procs.dm +++ b/code/modules/mob/living/living_health_procs.dm @@ -86,6 +86,7 @@ VAR_PROTECTED/stun_timer = TIMER_ID_NULL /mob/living/proc/stun_callback() + REMOVE_TRAIT(src, TRAIT_INCAPACITATED, STUNNED_TRAIT) stunned = 0 handle_regular_status_updates(FALSE) if(stun_timer != TIMER_ID_NULL) @@ -93,9 +94,14 @@ stun_timer = TIMER_ID_NULL /mob/living/proc/stun_callback_check() + if(stunned) + ADD_TRAIT(src, TRAIT_INCAPACITATED, STUNNED_TRAIT) if(stunned && stunned < recovery_constant) stun_timer = addtimer(CALLBACK(src, PROC_REF(stun_callback)), (stunned/recovery_constant) * 2 SECONDS, TIMER_OVERRIDE|TIMER_UNIQUE|TIMER_STOPPABLE) return + if(!stunned) // Force reset since the timer wasn't called + stun_callback() + return if(stun_timer != TIMER_ID_NULL) deltimer(stun_timer) @@ -172,15 +178,23 @@ VAR_PRIVATE/knocked_down_timer /mob/living/proc/knocked_down_callback() + remove_traits(list(TRAIT_FLOORED, TRAIT_INCAPACITATED), KNOCKEDDOWN_TRAIT) knocked_down = 0 handle_regular_status_updates(FALSE) knocked_down_timer = null /mob/living/proc/knocked_down_callback_check() + if(knocked_down) + add_traits(list(TRAIT_FLOORED, TRAIT_INCAPACITATED), KNOCKEDDOWN_TRAIT) + if(knocked_down && knocked_down < recovery_constant) knocked_down_timer = addtimer(CALLBACK(src, PROC_REF(knocked_down_callback)), (knocked_down/recovery_constant) * 2 SECONDS, TIMER_OVERRIDE|TIMER_UNIQUE|TIMER_STOPPABLE) // times whatever amount we have per tick return + if(!knocked_down) // Force reset since the timer wasn't called + knocked_down_callback() + return + if(knocked_down_timer) deltimer(knocked_down_timer) knocked_down_timer = null @@ -192,11 +206,14 @@ return /mob/living/proc/knocked_out_callback() + REMOVE_TRAIT(src, TRAIT_KNOCKEDOUT, KNOCKEDOUT_TRAIT) knocked_out = 0 handle_regular_status_updates(FALSE) knocked_out_timer = null /mob/living/proc/knocked_out_callback_check() + if(knocked_out) + ADD_TRAIT(src, TRAIT_KNOCKEDOUT, KNOCKEDOUT_TRAIT) if(knocked_out && knocked_out < recovery_constant) knocked_out_timer = addtimer(CALLBACK(src, PROC_REF(knocked_out_callback)), (knocked_out/recovery_constant) * 2 SECONDS, TIMER_OVERRIDE|TIMER_UNIQUE|TIMER_STOPPABLE) // times whatever amount we have per tick return @@ -219,7 +236,6 @@ knocked_down_callback_check() return - /mob/living/proc/SetKnockDown(amount) if(status_flags & CANKNOCKDOWN) knocked_down = max(amount,0) @@ -362,12 +378,6 @@ to_chat(src, SPAN_WARNING("You start hearing things again!")) SEND_SIGNAL(src, COMSIG_MOB_REGAINED_HEARING) - - - - - - // heal ONE limb, organ gets randomly selected from damaged ones. /mob/living/proc/heal_limb_damage(brute, burn) apply_damage(-brute, BRUTE) @@ -491,14 +501,13 @@ return if(stat >= UNCONSCIOUS) return + face_dir(direction) return ..() -/mob/living/is_laid_down() - if(knocked_down || knocked_out) - return TRUE - return ..() - -/mob/living/is_mob_incapacitated(ignore_restrained) - if(stunned || knocked_down || knocked_out) - return TRUE - return ..() +// Transition handlers. do NOT use this. I mean seriously don't. It's broken. Players love their broken behaviors. +/mob/living/proc/GetStunValueNotADurationDoNotUse() + return stunned +/mob/living/proc/GetKnockDownValueNotADurationDoNotUse() + return knocked_down +/mob/living/proc/GetKnockOutValueNotADurationDoNotUse() + return knocked_out diff --git a/code/modules/mob/living/living_verbs.dm b/code/modules/mob/living/living_verbs.dm index 77b996ff6bb0..45f5a25fce2c 100644 --- a/code/modules/mob/living/living_verbs.dm +++ b/code/modules/mob/living/living_verbs.dm @@ -163,7 +163,7 @@ return //breaking out of handcuffs & putting out fires - if(canmove && !knocked_down) + if(!is_mob_incapacitated(TRUE)) if(on_fire) resist_fire() @@ -179,7 +179,7 @@ if(!iscarbon(src)) return var/mob/living/carbon/C = src - if((C.handcuffed || C.legcuffed) && C.canmove && (C.last_special <= world.time)) + if((C.handcuffed || C.legcuffed) && (C.mobility_flags & MOBILITY_MOVE) && (C.last_special <= world.time)) resist_restraints() /mob/living/proc/resist_buckle() diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 0cd43361e22a..6782e3174579 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -101,8 +101,8 @@ GLOBAL_LIST_INIT(ai_verbs_default, list( // aiPDA = new/obj/item/device/pda/ai(src) SetName(pickedName) anchored = TRUE - canmove = 0 - density = TRUE + ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_INHERENT) + set_density(TRUE) forceMove(loc) holo_icon = getHologramIcon(icon('icons/mob/AI.dmi',"holo1")) diff --git a/code/modules/mob/living/silicon/decoy/decoy.dm b/code/modules/mob/living/silicon/decoy/decoy.dm index 5294631a70ec..bc7271554352 100644 --- a/code/modules/mob/living/silicon/decoy/decoy.dm +++ b/code/modules/mob/living/silicon/decoy/decoy.dm @@ -4,7 +4,6 @@ icon = 'icons/obj/structures/machinery/ai.dmi' icon_state = "hydra" anchored = TRUE - canmove = 0 density = TRUE //Do not want to see past it. bound_height = 64 //putting this in so we can't walk through our machine. bound_width = 96 @@ -23,6 +22,7 @@ ai_headset = new(src) GLOB.ai_mob_list += src real_name = MAIN_AI_SYSTEM + ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_INHERENT) /mob/living/silicon/decoy/ship_ai/Destroy() QDEL_NULL(ai_headset) diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index b0230bba5dba..b4a6e59e52e2 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -18,7 +18,6 @@ use_power() process_killswitch() process_locks() - update_canmove() /mob/living/silicon/robot/proc/clamp_values() @@ -79,14 +78,14 @@ death() if (stat != DEAD) //Alive. - if (knocked_out || stunned || knocked_down || !has_power) //Stunned etc. + if (HAS_TRAIT(src, TRAIT_KNOCKEDOUT) || HAS_TRAIT(src, TRAIT_INCAPACITATED) || !has_power) //Stunned etc. set_stat(UNCONSCIOUS) if(regular_update) - if (src.stunned > 0) + if (HAS_TRAIT(src, TRAIT_INCAPACITATED)) adjust_effect(-1, STUN) - if (src.knocked_down > 0) + if (HAS_TRAIT(src, TRAIT_FLOORED)) adjust_effect(-1, WEAKEN) - if (src.knocked_out > 0) + if (HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) adjust_effect(-1, PARALYZE) src.blinded = TRUE else @@ -113,8 +112,6 @@ src.ear_damage -= 0.05 src.ear_damage = max(src.ear_damage, 0) - src.density = !( src.lying ) - if ((src.sdisabilities & DISABILITY_BLIND)) src.blinded = TRUE if ((src.sdisabilities & DISABILITY_DEAF)) @@ -271,8 +268,3 @@ to_chat(src, SPAN_DANGER("Weapon Lock Timed Out!")) weapon_lock = 0 weaponlock_time = 120 - -/mob/living/silicon/robot/update_canmove() - if(knocked_out || stunned || knocked_down || buckled || lockcharge || !is_component_functioning("actuator")) canmove = 0 - else canmove = 1 - return canmove diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 7a3ed2868389..888b484fab06 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -840,7 +840,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list( cleaned_item.clean_blood() else if(istype(A, /mob/living/carbon/human)) var/mob/living/carbon/human/cleaned_human = A - if(cleaned_human.lying) + if(cleaned_human.body_position == LYING_DOWN) if(cleaned_human.head) cleaned_human.head.clean_blood() cleaned_human.update_inv_head(0) @@ -866,7 +866,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list( src.connected_ai = null lawupdate = 0 lockcharge = 0 - canmove = 1 + //canmove = 1 // Yes this will probably break something, whatevver it is scrambledcodes = 1 //Disconnect it's camera so it's not so easily tracked. if(src.camera) diff --git a/code/modules/mob/living/simple_animal/bat.dm b/code/modules/mob/living/simple_animal/bat.dm index a95d97be6e1a..eea7998bda67 100644 --- a/code/modules/mob/living/simple_animal/bat.dm +++ b/code/modules/mob/living/simple_animal/bat.dm @@ -27,4 +27,3 @@ set_stat(CONSCIOUS) icon_state = "bat" wander = 1 - canmove = 1 diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index fa93399683d8..11064634d498 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -46,7 +46,6 @@ set_stat(CONSCIOUS) icon_state = "mouse_[body_color]" wander = 1 - canmove = 1 else if(prob(5)) INVOKE_ASYNC(src, PROC_REF(emote), "snuffles") diff --git a/code/modules/mob/living/simple_animal/hostile/alien.dm b/code/modules/mob/living/simple_animal/hostile/alien.dm index 5e56b0204777..6e8d0b8a2867 100644 --- a/code/modules/mob/living/simple_animal/hostile/alien.dm +++ b/code/modules/mob/living/simple_animal/hostile/alien.dm @@ -63,19 +63,19 @@ icon_living = "Normal [caste_name] Running" icon_dead = "Normal [caste_name] Dead" -/mob/living/simple_animal/hostile/alien/update_transform() - if(lying != lying_prev) - lying_prev = lying +/mob/living/simple_animal/hostile/alien/update_transform(instant_update = FALSE) + // TODO: Move all this mess outside of update_transform if(stat == DEAD) icon_state = "Normal [caste_name] Dead" - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) icon_state = "Normal [caste_name] Sleeping" else icon_state = "Normal [caste_name] Knocked Down" else icon_state = "Normal [caste_name] Running" update_wounds() + return ..() /mob/living/simple_animal/hostile/alien/evaluate_target(mob/living/carbon/target) . = ..() @@ -114,8 +114,8 @@ if(health > HEALTH_THRESHOLD_DEAD) if(health_threshold > 3) wound_icon_holder.icon_state = "none" - else if(lying) - if((resting || sleeping) && (!knocked_down && !knocked_out && health > 0)) + else if(body_position == LYING_DOWN) + if(!HAS_TRAIT(src, TRAIT_INCAPACITATED) && !HAS_TRAIT(src, TRAIT_FLOORED)) wound_icon_holder.icon_state = "[caste_name]_rest_[health_threshold]" else wound_icon_holder.icon_state = "[caste_name]_downed_[health_threshold]" diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 9d0dfc869d8c..5a5791eb8311 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -125,7 +125,7 @@ if(client) return 0 - if(!stat && canmove) + if(!stat && mobility_flags & MOBILITY_MOVE) switch(stance) if(HOSTILE_STANCE_IDLE) target_mob = FindTarget() diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index a5109685e41b..d1b140305d60 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -127,7 +127,7 @@ /mob/living/simple_animal/parrot/Topic(href, href_list) //Can the usr physically do this? - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !in_range(loc, usr)) + if(usr.is_mob_incapacitated() || !in_range(loc, usr)) return //Is the usr's mob type able to do this? @@ -284,7 +284,7 @@ if(client || stat) return //Lets not force players or dead/incap parrots to move - if(!isturf(src.loc) || !canmove || buckled) + if(!isturf(src.loc) || !(mobility_flags & MOBILITY_MOVE) || buckled) return //If it can't move, dont let it move. (The buckled check probably isn't necessary thanks to canmove) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index e18d8e8f066f..3d3a4b491950 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -81,8 +81,8 @@ GLOB.dead_mob_list -= src GLOB.alive_mob_list += src set_stat(CONSCIOUS) - lying = 0 - density = TRUE +// lying = 0 +// density = TRUE reload_fullscreens() return 0 @@ -96,11 +96,10 @@ handle_stunned() handle_knocked_down(TRUE) handle_knocked_out(TRUE) - update_canmove() //Movement if(!client && !stop_automated_movement && wander && !anchored) - if(isturf(src.loc) && !resting && !buckled && canmove) //This is so it only moves if it's not inside a closet, gentics machine, etc. + if(isturf(src.loc) && !resting && !buckled && (mobility_flags & MOBILITY_MOVE)) //This is so it only moves if it's not inside a closet, gentics machine, etc. turns_since_move++ if(turns_since_move >= turns_per_move) if(!(stop_automated_movement_when_pulled && pulledby)) //Soma animals don't move when pulled @@ -361,10 +360,17 @@ ..(message, null, verb, nolog = !ckey) //if the animal has a ckey then it will log the message -/mob/living/simple_animal/update_canmove() +/mob/living/simple_animal/on_immobilized_trait_gain(datum/source) . = ..() - if(!canmove) - stop_moving() + stop_moving() + +/mob/living/simple_animal/on_knockedout_trait_gain(datum/source) + . = ..() + stop_moving() + +/mob/living/simple_animal/on_incapacitated_trait_gain(datum/source) + . = ..() + stop_moving() /mob/living/simple_animal/proc/stop_moving() walk_to(src, 0) // stops us dead in our tracks diff --git a/code/modules/mob/living/simple_animal/slug.dm b/code/modules/mob/living/simple_animal/slug.dm index e09d2c715e54..3f2ceb57b838 100644 --- a/code/modules/mob/living/simple_animal/slug.dm +++ b/code/modules/mob/living/simple_animal/slug.dm @@ -33,7 +33,6 @@ set_stat(CONSCIOUS) icon_state = "slug_movement" wander = 1 - canmove = 1 /mob/living/simple_animal/alien_slug/Initialize() . = ..() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 03fc6c24ca26..c256f05e74b4 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -454,7 +454,7 @@ if(!Adjacent(usr)) return if(!ishuman(M) && !ismonkey(M)) return if(!ishuman(src) && !ismonkey(src)) return - if(M.lying || M.is_mob_incapacitated()) + if(M.is_mob_incapacitated()) return if(M.pulling == src && (M.a_intent & INTENT_GRAB) && M.grab_level == GRAB_AGGRESSIVE) return @@ -693,71 +693,15 @@ note dizziness decrements automatically in the mob's Life() proc. // facing verbs /mob/proc/canface() - if(!canmove) return 0 if(client.moving) return 0 if(stat==2) return 0 if(anchored) return 0 if(monkeyizing) return 0 if(is_mob_restrained()) return 0 + if(HAS_TRAIT(src, TRAIT_INCAPACITATED)) // We allow rotation if simply floored + return FALSE return 1 -//Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it. -/mob/proc/update_canmove() - var/laid_down = is_laid_down() - - if(laid_down) - lying = TRUE - flags_atom &= ~DIRLOCK - else - lying = FALSE - if(buckled) - if(buckled.buckle_lying) - lying = TRUE - flags_atom &= ~DIRLOCK - else - lying = FALSE - - canmove = !HAS_TRAIT(src, TRAIT_IMMOBILIZED) - - if(isliving(src)) // Temporary I SWEAR. This whole proc is going down - var/mob/living/living = src - if(living.stunned) - canmove = FALSE - - if(!can_crawl && lying) - canmove = FALSE - - if(lying_prev != lying) - if(lying) - ADD_TRAIT(src, TRAIT_UNDENSE, LYING_TRAIT) - add_temp_pass_flags(PASS_MOB_THRU) - drop_l_hand() - drop_r_hand() - SEND_SIGNAL(src, COMSIG_MOB_KNOCKED_DOWN) - else - REMOVE_TRAIT(src, TRAIT_UNDENSE, LYING_TRAIT) - SEND_SIGNAL(src, COMSIG_MOB_GETTING_UP) - remove_temp_pass_flags(PASS_MOB_THRU) - update_transform() - - if(lying) - //so mob lying always appear behind standing mobs, but dead ones appear behind living ones - if(pulledby && pulledby.grab_level == GRAB_CARRY) - layer = ABOVE_MOB_LAYER - else if (stat == DEAD) - layer = LYING_DEAD_MOB_LAYER // Dead mobs should layer under living ones - else if(layer == initial(layer)) //to avoid things like hiding larvas. - layer = LYING_LIVING_MOB_LAYER - else if(layer == LYING_DEAD_MOB_LAYER || layer == LYING_LIVING_MOB_LAYER) - layer = initial(layer) - - SEND_SIGNAL(src, COMSIG_MOB_POST_UPDATE_CANMOVE, canmove, laid_down, lying) - - return canmove - -/mob/proc/is_laid_down() - return (stat || !has_legs() || resting || (status_flags & FAKEDEATH) || (pulledby && pulledby.grab_level >= GRAB_AGGRESSIVE)) - /mob/proc/face_dir(ndir, specific_dir) if(!canface()) return 0 if(dir != ndir) @@ -924,13 +868,13 @@ note dizziness decrements automatically in the mob's Life() proc. /mob/living/proc/handle_knocked_down(bypass_client_check = FALSE) if(knocked_down && (bypass_client_check || client)) - knocked_down = max(knocked_down-1,0) //before you get mad Rockdtben: I done this so update_canmove isn't called multiple times + knocked_down = max(knocked_down-1,0) knocked_down_callback_check() return knocked_down /mob/living/proc/handle_knocked_out(bypass_client_check = FALSE) if(knocked_out && (bypass_client_check || client)) - knocked_out = max(knocked_out-1,0) //before you get mad Rockdtben: I done this so update_canmove isn't called multiple times + knocked_out = max(knocked_out-1,0) knocked_out_callback_check() return knocked_out @@ -1123,6 +1067,9 @@ note dizziness decrements automatically in the mob's Life() proc. /mob/proc/set_stat(new_stat) if(new_stat == stat) return - . = stat //old stat + . = stat stat = new_stat SEND_SIGNAL(src, COMSIG_MOB_STATCHANGE, new_stat, .) + +/mob/proc/update_stat() + return diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index dc107e1bd190..f0e5bc48a855 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -87,9 +87,6 @@ var/exploit_record = "" var/gibbing = FALSE - var/lying = FALSE - var/lying_prev = 0 - var/canmove = 1 var/lastpuke = 0 unacidable = FALSE var/mob_size = MOB_SIZE_HUMAN diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index a234c5962f72..071728195e3f 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -83,21 +83,21 @@ if(GRAB_AGGRESSIVE) progress_aggressive(user, victim) -/obj/item/grab/proc/progress_passive(mob/living/carbon/human/user, mob/victim) + if(user.grab_level >= GRAB_AGGRESSIVE) + ADD_TRAIT(victim, TRAIT_FLOORED, CHOKEHOLD_TRAIT) + +/obj/item/grab/proc/progress_passive(mob/living/carbon/human/user, mob/living/victim) user.grab_level = GRAB_AGGRESSIVE playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 25, 1, 7) user.visible_message(SPAN_WARNING("[user] has grabbed [victim] aggressively!"), null, null, 5) - victim.update_canmove() -/obj/item/grab/proc/progress_aggressive(mob/living/carbon/human/user, mob/victim) +/obj/item/grab/proc/progress_aggressive(mob/living/carbon/human/user, mob/living/victim) user.grab_level = GRAB_CHOKE playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 25, 1, 7) user.visible_message(SPAN_WARNING("[user] holds [victim] by the neck and starts choking them!"), null, null, 5) victim.Move(user.loc, get_dir(victim.loc, user.loc)) victim.update_transform(TRUE) - victim.update_canmove() - /obj/item/grab/attack(mob/living/M, mob/living/user) if(M == grabbed_thing) attack_self(user) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 4529580859de..5d1baac3a534 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -311,14 +311,11 @@ GLOBAL_LIST_INIT(limb_types_by_name, list( /mob/proc/is_mob_restrained() return +/// Returns if the mob is incapacitated and unable to perform general actions /mob/proc/is_mob_incapacitated(ignore_restrained) - return (stat || (!ignore_restrained && is_mob_restrained()) || status_flags & FAKEDEATH) - - -//returns how many non-destroyed legs the mob has (currently only useful for humans) -/mob/proc/has_legs() - return 2 - + // note that stat includes knockout via unconscious + // TODO: re-re-re-figure out if we need TRAIT_FLOORED here or using TRAIT_INCAPACITATED only is acceptable deviance from legacy behavior + return (stat || (!ignore_restrained && is_mob_restrained()) || (status_flags & FAKEDEATH) || HAS_TRAIT(src, TRAIT_INCAPACITATED)) /mob/proc/get_eye_protection() return EYE_PROTECTION_NONE @@ -480,7 +477,7 @@ GLOBAL_LIST_INIT(limb_types_by_name, list( set name = "Pick Up" set category = "Object" - if(!canmove || stat || is_mob_restrained() || !Adjacent(pickupify)) + if(is_mob_incapacitated() || !Adjacent(pickupify)) return if(world.time <= next_move) diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 86ce622824db..65489944211a 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -95,7 +95,13 @@ mob.next_delay_update = world.time + mob.next_delay_delay /client/Move(n, direct) - if(world.time < next_movement || (mob.lying && mob.crawling)) + var/mob/living/living_mob + if(isliving(mob)) + living_mob = mob + + if(world.time < next_movement) + return + if(living_mob && living_mob.body_position == LYING_DOWN && mob.crawling) return next_move_dir_add = 0 @@ -134,7 +140,17 @@ if(!isliving(mob)) return mob.Move(n, direct) - if(!mob.canmove || mob.is_mob_incapacitated(TRUE) || (mob.lying && !mob.can_crawl)) + if(mob.is_mob_incapacitated(TRUE)) + return + + if(mob.buckled) + // Handle buckled relay before mobility because buckling inherently immobilizes + // This means you can (try to) move with a cargo tug or powerloader while immobilized, which i think makes sense + return mob.buckled.relaymove(mob, direct) + + if(!(living_mob.mobility_flags & MOBILITY_MOVE)) + return + if(living_mob.body_position == LYING_DOWN && !living_mob.can_crawl) return //Check if you are being grabbed and if so attemps to break it @@ -150,9 +166,6 @@ next_movement = world.time + MINIMAL_MOVEMENT_INTERVAL return - if(mob.buckled) - return mob.buckled.relaymove(mob, direct) - if(!mob.z)//Inside an object, tell it we moved var/atom/O = mob.loc if(!O) @@ -172,7 +185,7 @@ //We are now going to move moving = TRUE mob.move_intentionally = TRUE - if(mob.lying) + if(living_mob && living_mob.body_position == LYING_DOWN) //check for them not being a limbless blob (only humans have limbs) if(ishuman(mob)) var/mob/living/carbon/human/human = mob diff --git a/code/modules/mob/mob_verbs.dm b/code/modules/mob/mob_verbs.dm index b6b27bcf6605..a941dfc51090 100644 --- a/code/modules/mob/mob_verbs.dm +++ b/code/modules/mob/mob_verbs.dm @@ -98,7 +98,8 @@ if(length(mind.memory) < 4000) mind.store_memory(msg) else - message_admins("[key_name(usr)] auto-slept for attempting to exceed mob memory limit.]", loc.x, loc.y, loc.z) + message_admins("[key_name(usr)] warned for attempting to exceed mob memory limit.]", loc.x, loc.y, loc.z) + to_chat(src, "You have exceeded the maximum memory limit. Sorry!") else to_chat(src, "The game appears to have misplaced your mind datum, so we can't show you your notes.") @@ -221,6 +222,7 @@ set category = "IC" if(pulling) + REMOVE_TRAIT(pulling, TRAIT_FLOORED, CHOKEHOLD_TRAIT) var/mob/M = pulling pulling.pulledby = null pulling = null @@ -243,4 +245,3 @@ //so we must undo it here so the victim can move right away M.client.next_movement = world.time M.update_transform(TRUE) - M.update_canmove() diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 5938f7f51a2d..2034202144b2 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -6,7 +6,6 @@ invisibility = 101 density = FALSE - canmove = FALSE anchored = TRUE universal_speak = TRUE stat = DEAD @@ -15,6 +14,7 @@ . = ..() GLOB.new_player_list += src GLOB.dead_mob_list -= src + ADD_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_SOURCE_INHERENT) /mob/new_player/Destroy() if(ready) diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index aa292c39245b..6dda93e4d9c2 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -7,8 +7,8 @@ drop_inv_item_on_ground(W) regenerate_icons() monkeyizing = 1 - canmove = 0 - stunned = 1 + anchored = TRUE + ADD_TRAIT(src, TRAIT_INCAPACITATED, "Terminal Monkeyziation") icon = null invisibility = 101 for(var/t in limbs) @@ -68,7 +68,7 @@ for(var/obj/item/W in src) drop_inv_item_on_ground(W) monkeyizing = 1 - canmove = 0 + ADD_TRAIT(src, TRAIT_INCAPACITATED, "Terminal Monkeyziation") icon = null invisibility = 101 return ..() @@ -85,7 +85,7 @@ drop_inv_item_on_ground(W) regenerate_icons() monkeyizing = 1 - canmove = 0 + ADD_TRAIT(src, TRAIT_INCAPACITATED, "Terminal Monkeyziation") icon = null invisibility = 101 for(var/t in limbs) @@ -131,7 +131,7 @@ drop_inv_item_on_ground(W) regenerate_icons() monkeyizing = 1 - canmove = 0 + ADD_TRAIT(src, TRAIT_INCAPACITATED, "Terminal Monkeyziation") icon = null invisibility = 101 for(var/t in limbs) @@ -186,28 +186,6 @@ qdel(src) return -/mob/living/carbon/human/proc/corgize() - if (monkeyizing) - return - for(var/obj/item/W in src) - drop_inv_item_on_ground(W) - regenerate_icons() - monkeyizing = 1 - canmove = 0 - icon = null - invisibility = 101 - for(var/t in limbs) //this really should not be necessary - qdel(t) - - var/mob/living/simple_animal/corgi/new_corgi = new /mob/living/simple_animal/corgi (loc) - new_corgi.a_intent = INTENT_HARM - new_corgi.key = key - if(new_corgi.client) new_corgi.client.change_view(GLOB.world_view_size) - - to_chat(new_corgi, "You are now a Corgi. Yap Yap!") - qdel(src) - return - /mob/living/carbon/human/Animalize() var/list/mobtypes = typesof(/mob/living/simple_animal) @@ -224,7 +202,7 @@ regenerate_icons() monkeyizing = 1 - canmove = 0 + ADD_TRAIT(src, TRAIT_INCAPACITATED, "Terminal Monkeyziation") icon = null invisibility = 101 diff --git a/code/modules/nano/nanoui.dm b/code/modules/nano/nanoui.dm index 7d24db7d529f..46a30b313bb8 100644 --- a/code/modules/nano/nanoui.dm +++ b/code/modules/nano/nanoui.dm @@ -177,9 +177,13 @@ nanoui is used to open and update nano browser uis close() return + var/mob/living/living_user + if(isliving(user)) + living_user = user + if ((allowed_user_stat > -1) && (user.stat > allowed_user_stat)) set_status(STATUS_DISABLED, push_update) // no updates, completely disabled (red visibility) - else if (user.is_mob_restrained() || user.lying) + else if (user.is_mob_restrained() || (living_user && living_user.body_position == LYING_DOWN)) set_status(STATUS_UPDATE, push_update) // update only (orange visibility) else if (!(src_object in view(4, user))) // If the src object is not in visable, set status to 0 set_status(STATUS_DISABLED, push_update) // interactive (green visibility) diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index f5a680c5076a..cebb4ad613b0 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -213,7 +213,7 @@ // Check if we're looking at a mob that's lying down if(istype(cur_atom, /mob/living)) var/mob/living/cur_mob = cur_atom - if(!isxeno(cur_mob) && cur_mob.lying) //xenos don't use icon rotatin for lying. + if(!isxeno(cur_mob) && cur_mob.body_position == LYING_DOWN) //xenos don't use icon rotatin for lying. cur_icon.BecomeLying() // Calculate where we are relative to the center of the photo diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index df4e9badc598..dd0327e3821d 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1000,7 +1000,7 @@ GLOBAL_LIST_INIT(apc_wire_descriptions, list( SEND_SIGNAL(user, COMSIG_MOB_APC_POWER_PULSE, src) addtimer(VARSET_CALLBACK(src, shorted, FALSE), 2 MINUTES) -/obj/structure/machinery/power/apc/proc/can_use(mob/user as mob, loud = 0) //used by attack_hand() and Topic() +/obj/structure/machinery/power/apc/proc/can_use(mob/living/user as mob, loud = 0) //used by attack_hand() and Topic() if(user.client && user.client.remote_control) return TRUE @@ -1016,7 +1016,7 @@ GLOBAL_LIST_INIT(apc_wire_descriptions, list( if(user.is_mob_restrained()) to_chat(user, SPAN_WARNING("You must have free hands to use [src].")) return 0 - if(user.lying) + if(user.body_position == LYING_DOWN) to_chat(user, SPAN_WARNING("You can't reach [src]!")) return 0 autoflag = 5 diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 4767f443506b..8d7ab1532ade 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -1400,7 +1400,7 @@ and you're good to go. var/damage_buff = BASE_BULLET_DAMAGE_MULT //if target is lying or unconscious - add damage bonus - if(attacked_mob.lying == TRUE || attacked_mob.stat == UNCONSCIOUS) + if(!(attacked_mob.mobility_flags & MOBILITY_STAND) || attacked_mob.stat == UNCONSCIOUS) damage_buff += BULLET_DAMAGE_MULT_TIER_4 projectile_to_fire.damage *= damage_buff //Multiply the damage for point blank. if(bullets_fired == 1) //First shot gives the PB message. @@ -1424,7 +1424,7 @@ and you're good to go. projectile_to_fire.give_bullet_traits(BP) if(bullets_fired > 1) BP.original = attacked_mob //original == the original target of the projectile. If the target is downed and this isn't set, the projectile will try to fly over it. Of course, it isn't going anywhere, but it's the principle of the thing. Very embarrassing. - if(!BP.handle_mob(attacked_mob) && attacked_mob.lying) //This is the 'handle impact' proc for a flying projectile, including hit RNG, on_hit_mob and bullet_act. If it misses, it doesn't go anywhere. We'll pretend it slams into the ground or punches a hole in the ceiling, because trying to make it bypass the xeno or shoot from the tile beyond it is probably more spaghet than my life is worth. + if(!BP.handle_mob(attacked_mob) && attacked_mob.body_position == LYING_DOWN) //This is the 'handle impact' proc for a flying projectile, including hit RNG, on_hit_mob and bullet_act. If it misses, it doesn't go anywhere. We'll pretend it slams into the ground or punches a hole in the ceiling, because trying to make it bypass the xeno or shoot from the tile beyond it is probably more spaghet than my life is worth. if(BP.ammo.sound_bounce) playsound(attacked_mob.loc, BP.ammo.sound_bounce, 35, 1) attacked_mob.visible_message(SPAN_AVOIDHARM("[BP] slams into [get_turf(attacked_mob)]!"), //Managing to miss an immobile target flat on the ground deserves some recognition, don't you think? @@ -1437,7 +1437,7 @@ and you're good to go. if(bullets_fired > 1) projectile_to_fire.original = attacked_mob - if(!projectile_to_fire.handle_mob(attacked_mob) && attacked_mob.lying) + if(!projectile_to_fire.handle_mob(attacked_mob) && attacked_mob.body_position == LYING_DOWN) if(projectile_to_fire.ammo.sound_bounce) playsound(attacked_mob.loc, projectile_to_fire.ammo.sound_bounce, 35, 1) attacked_mob.visible_message(SPAN_AVOIDHARM("[projectile_to_fire] slams into [get_turf(attacked_mob)]!"), diff --git a/code/modules/projectiles/gun_attachables.dm b/code/modules/projectiles/gun_attachables.dm index c567f7d684a2..9f0ddd04fc11 100644 --- a/code/modules/projectiles/gun_attachables.dm +++ b/code/modules/projectiles/gun_attachables.dm @@ -2685,7 +2685,7 @@ Defined in conflicts.dm of the #defines folder. /obj/item/attachable/attached_gun/grenade/unique_action(mob/user) if(!ishuman(usr)) return - if(!user.canmove || user.stat || user.is_mob_restrained() || !user.loc || !isturf(usr.loc)) + if(user.is_mob_incapacitated() || !isturf(usr.loc)) to_chat(user, SPAN_WARNING("Not right now.")) return diff --git a/code/modules/projectiles/gun_helpers.dm b/code/modules/projectiles/gun_helpers.dm index ba5f8e491590..8e73124a8b92 100644 --- a/code/modules/projectiles/gun_helpers.dm +++ b/code/modules/projectiles/gun_helpers.dm @@ -462,7 +462,7 @@ DEFINES in setup.dm, referenced here. /obj/item/weapon/gun/proc/get_active_firearm(mob/user, restrictive = TRUE) if(!ishuman(usr)) return - if(!user.canmove || user.stat || user.is_mob_restrained() || !user.loc || !isturf(usr.loc)) + if(user.is_mob_incapacitated() || !isturf(usr.loc)) to_chat(user, SPAN_WARNING("Not right now.")) return diff --git a/code/modules/projectiles/guns/specialist/launcher/rocket_launcher.dm b/code/modules/projectiles/guns/specialist/launcher/rocket_launcher.dm index 6d998002134c..356d0e6c3b48 100644 --- a/code/modules/projectiles/guns/specialist/launcher/rocket_launcher.dm +++ b/code/modules/projectiles/guns/specialist/launcher/rocket_launcher.dm @@ -190,7 +190,7 @@ smoke.start() playsound(src, 'sound/weapons/gun_rocketlauncher.ogg', 100, TRUE, 10) for(var/mob/living/carbon/C in backblast_loc) - if(!C.lying && !HAS_TRAIT(C, TRAIT_EAR_PROTECTION)) //Have to be standing up to get the fun stuff + if(C.body_position == STANDING_UP && !HAS_TRAIT(C, TRAIT_EAR_PROTECTION)) //Have to be standing up to get the fun stuff C.apply_damage(15, BRUTE) //The shockwave hurts, quite a bit. It can knock unarmored targets unconscious in real life C.apply_effect(4, STUN) //For good measure C.apply_effect(6, STUTTER) @@ -362,7 +362,7 @@ smoke.start() playsound(src, 'sound/weapons/gun_rocketlauncher.ogg', 100, TRUE, 10) for(var/mob/living/carbon/C in backblast_loc) - if(!C.lying && !HAS_TRAIT(C, TRAIT_EAR_PROTECTION)) //Have to be standing up to get the fun stuff + if(C.body_position == STANDING_UP && !HAS_TRAIT(C, TRAIT_EAR_PROTECTION)) //Have to be standing up to get the fun stuff C.apply_damage(15, BRUTE) //The shockwave hurts, quite a bit. It can knock unarmored targets unconscious in real life C.apply_effect(4, STUN) //For good measure C.apply_effect(6, STUTTER) diff --git a/code/modules/projectiles/guns/specialist/sniper.dm b/code/modules/projectiles/guns/specialist/sniper.dm index 3fe2934259bf..0cd9d8dd16c8 100644 --- a/code/modules/projectiles/guns/specialist/sniper.dm +++ b/code/modules/projectiles/guns/specialist/sniper.dm @@ -75,7 +75,7 @@ /datum/action/item_action/specialist/aimed_shot/can_use_action() var/mob/living/carbon/human/H = owner - if(istype(H) && !H.is_mob_incapacitated() && !H.lying && (holder_item == H.r_hand || holder_item || H.l_hand)) + if(istype(H) && !H.is_mob_incapacitated() && (holder_item == H.r_hand || holder_item || H.l_hand)) return TRUE /datum/action/item_action/specialist/aimed_shot/proc/use_ability(atom/A) @@ -450,7 +450,7 @@ . = ..() if(.) var/mob/living/carbon/human/PMC_sniper = user - if(PMC_sniper.lying == 0 && !istype(PMC_sniper.wear_suit,/obj/item/clothing/suit/storage/marine/smartgunner/veteran/pmc) && !istype(PMC_sniper.wear_suit,/obj/item/clothing/suit/storage/marine/veteran)) + if(PMC_sniper.body_position == STANDING_UP && !istype(PMC_sniper.wear_suit,/obj/item/clothing/suit/storage/marine/smartgunner/veteran/pmc) && !istype(PMC_sniper.wear_suit,/obj/item/clothing/suit/storage/marine/veteran)) PMC_sniper.visible_message(SPAN_WARNING("[PMC_sniper] is blown backwards from the recoil of the [src.name]!"),SPAN_HIGHDANGER("You are knocked prone by the blowback!")) step(PMC_sniper,turn(PMC_sniper.dir,180)) PMC_sniper.apply_effect(5, WEAKEN) diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 37e398080227..7de8f12fc546 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -517,7 +517,7 @@ X.behavior_delegate.on_hitby_projectile(ammo) . = TRUE - else if(!L.lying) + else if(L.body_position != LYING_DOWN) animatation_displace_reset(L) if(ammo.sound_miss) playsound_client(L.client, ammo.sound_miss, get_turf(L), 75, TRUE) L.visible_message(SPAN_AVOIDHARM("[src] misses [L]!"), @@ -766,8 +766,8 @@ //mobs use get_projectile_hit_chance instead of get_projectile_hit_boolean /mob/living/proc/get_projectile_hit_chance(obj/projectile/P) - if(lying && src != P.original) - return FALSE + if((body_position == LYING_DOWN || HAS_TRAIT(src, TRAIT_NESTED)) && src != P.original) + return FALSE // Snowflake check for xeno nests, because we want bullets to fly through even though they're standing in it var/ammo_flags = P.ammo.flags_ammo_behavior | P.projectile_override_flags if(ammo_flags & AMMO_XENO) if((status_flags & XENO_HOST) && HAS_TRAIT(src, TRAIT_NESTED)) @@ -775,7 +775,7 @@ . = P.get_effective_accuracy() - if(lying && stat) + if(body_position == LYING_DOWN && stat) . += 15 //Bonus hit against unconscious people. if(isliving(P.firer)) diff --git a/code/modules/reagents/chemistry_machinery/acid_harness.dm b/code/modules/reagents/chemistry_machinery/acid_harness.dm index ae54474c3aed..52a1a5f13bd7 100644 --- a/code/modules/reagents/chemistry_machinery/acid_harness.dm +++ b/code/modules/reagents/chemistry_machinery/acid_harness.dm @@ -443,7 +443,7 @@ else if(inject_conditions & ACID_SCAN_CONDITION_DEFIB && vitals_scan < ACID_VITALS_DEAD && last_vitals_scan & ACID_SCAN_CONDITION_DEATH) condition_scan |= ACID_SCAN_CONDITION_DEFIB //If we were previously dead and are now alive, we assume we got defibbed - if(inject_conditions & ACID_SCAN_CONDITION_CONCUSSION && (user.knocked_down || user.knocked_out)) + if(inject_conditions & ACID_SCAN_CONDITION_CONCUSSION && (HAS_TRAIT(src, TRAIT_KNOCKEDOUT) || HAS_TRAIT(src, TRAIT_FLOORED))) condition_scan |= ACID_SCAN_CONDITION_CONCUSSION if(inject_conditions & ACID_SCAN_CONDITION_INTOXICATION && (user.dazed || user.slowed || user.confused || user.drowsyness || user.dizziness || user.druggy)) diff --git a/code/modules/reagents/chemistry_properties/prop_neutral.dm b/code/modules/reagents/chemistry_properties/prop_neutral.dm index a35fb5e554bf..3048b12ee296 100644 --- a/code/modules/reagents/chemistry_properties/prop_neutral.dm +++ b/code/modules/reagents/chemistry_properties/prop_neutral.dm @@ -199,7 +199,7 @@ M.druggy = min(M.druggy + 0.5 * potency * delta_time, potency * 10) /datum/chem_property/neutral/hallucinogenic/process_overdose(mob/living/M, potency = 1, delta_time) - if(isturf(M.loc) && !istype(M.loc, /turf/open/space) && M.canmove && !M.is_mob_restrained()) + if(isturf(M.loc) && !istype(M.loc, /turf/open/space) && (M.mobility_flags & MOBILITY_MOVE) && !M.is_mob_restrained()) step(M, pick(GLOB.cardinals)) M.hallucination += 10 M.make_jittery(5) diff --git a/code/modules/reagents/chemistry_properties/prop_positive.dm b/code/modules/reagents/chemistry_properties/prop_positive.dm index 971051e9bf88..8bf7eadc5d77 100644 --- a/code/modules/reagents/chemistry_properties/prop_positive.dm +++ b/code/modules/reagents/chemistry_properties/prop_positive.dm @@ -455,7 +455,7 @@ if(prob(10 * delta_time)) to_chat(M, SPAN_WARNING("You feel like you have the worst brain freeze ever!")) M.apply_effect(20, PARALYZE) - M.stunned = max(M.stunned,21) + M.apply_effect(20, STUN) /datum/chem_property/positive/neurocryogenic/process_overdose(mob/living/M, potency = 1, delta_time) M.bodytemperature = max(M.bodytemperature - 2.5 * potency * delta_time,0) diff --git a/code/modules/reagents/chemistry_reagents/drink.dm b/code/modules/reagents/chemistry_reagents/drink.dm index 3bd7336c32b6..66ce0844556b 100644 --- a/code/modules/reagents/chemistry_reagents/drink.dm +++ b/code/modules/reagents/chemistry_reagents/drink.dm @@ -555,7 +555,8 @@ /datum/reagent/neurotoxin/on_mob_life(mob/living/carbon/M) . = ..() if(!.) return - M.knocked_down = max(M.knocked_down, 3) + if(!HAS_TRAIT(src, TRAIT_FLOORED)) + M.apply_effect(5, WEAKEN) if(!data) data = 1 data++ M.dizziness +=6 diff --git a/code/modules/reagents/chemistry_reagents/toxin.dm b/code/modules/reagents/chemistry_reagents/toxin.dm index 6ffd14ea8ae3..d9be565a85b2 100644 --- a/code/modules/reagents/chemistry_reagents/toxin.dm +++ b/code/modules/reagents/chemistry_reagents/toxin.dm @@ -113,6 +113,7 @@ if(!. || deleted) return M.status_flags |= FAKEDEATH + ADD_TRAIT(M, TRAIT_IMMOBILIZED, FAKEDEATH_TRAIT) M.apply_damage(0.5*REM, OXY) M.apply_effect(2, WEAKEN) M.silent = max(M.silent, 10) @@ -125,6 +126,7 @@ var/mob/living/holder_mob = . holder_mob.status_flags &= ~FAKEDEATH + REMOVE_TRAIT(holder_mob, TRAIT_IMMOBILIZED, FAKEDEATH_TRAIT) /datum/reagent/toxin/mindbreaker name = "Mindbreaker Toxin" diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index b468116da5f2..4c60a9e345e0 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -112,7 +112,7 @@ // attack with hand, move pulled object onto conveyor /obj/structure/machinery/conveyor/attack_hand(mob/user as mob) - if ((!( user.canmove ) || user.is_mob_restrained() || !( user.pulling ))) + if (( user.is_mob_incapacitated() || !( user.pulling ))) return if (user.pulling.anchored) return diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 2ce4c992b80c..1522f0100c4e 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -222,7 +222,7 @@ ///Attempt to move while inside /obj/structure/machinery/disposal/relaymove(mob/living/user) - if(user.stat || user.stunned || user.knocked_down || flushing) + if(user.is_mob_incapacitated(TRUE) || flushing) return FALSE if(user.loc == src) go_out(user) @@ -234,9 +234,8 @@ user.client.eye = user.client.mob user.client.perspective = MOB_PERSPECTIVE user.forceMove(loc) - user.stunned = max(user.stunned, 2) //Action delay when going out of a bin - user.update_canmove() //Force the delay to go in action immediately - if(!user.lying) + user.apply_effect(2, STUN) + if(user.mobility_flags & MOBILITY_MOVE) user.visible_message(SPAN_WARNING("[user] suddenly climbs out of [src]!"), SPAN_WARNING("You climb out of [src] and get your bearings!")) update() @@ -305,8 +304,7 @@ if(isliving(AM)) var/mob/living/living = AM living.Stun(2) - living.update_canmove() //Force the delay to go in action immediately - if(!living.lying) + if(living.body_position == STANDING_UP) living.visible_message(SPAN_WARNING("[living] is suddenly pushed out of [src]!"), SPAN_WARNING("You get pushed out of [src] and get your bearings!")) update() diff --git a/code/modules/shuttles/shuttle_console.dm b/code/modules/shuttles/shuttle_console.dm index 816447658f13..96cc72970f3b 100644 --- a/code/modules/shuttles/shuttle_console.dm +++ b/code/modules/shuttles/shuttle_console.dm @@ -82,8 +82,6 @@ GLOBAL_LIST_EMPTY(shuttle_controls) user.visible_message(SPAN_NOTICE("[user] starts to type on the [src]."), SPAN_NOTICE("You try to take back the control over the shuttle. It will take around 3 minutes.")) if(do_after(user, 3 MINUTES, INTERRUPT_ALL, BUSY_ICON_FRIENDLY)) - if(user.lying) - return 0 shuttle.last_locked = world.time shuttle.queen_locked = 0 shuttle.last_door_override = world.time diff --git a/code/modules/sorokyne/sorokyne_cold_water.dm b/code/modules/sorokyne/sorokyne_cold_water.dm index adf7e3de6228..345014a1e460 100644 --- a/code/modules/sorokyne/sorokyne_cold_water.dm +++ b/code/modules/sorokyne/sorokyne_cold_water.dm @@ -48,13 +48,13 @@ var/dam_amount = COLD_WATER_DAMAGE if(issynth(M) || isyautja(M)) dam_amount -= 0.5 - if(M.lying) - M.apply_damage(5*dam_amount,BURN) - else + if(M.body_position == STANDING_UP) M.apply_damage(dam_amount,BURN,"l_leg") M.apply_damage(dam_amount,BURN,"l_foot") M.apply_damage(dam_amount,BURN,"r_leg") M.apply_damage(dam_amount,BURN,"r_foot") + else + M.apply_damage(5*dam_amount,BURN) if (ishuman(M)) if (M.bodytemperature > MINIMUM_TEMP) diff --git a/code/modules/surgery/surgery_initiator.dm b/code/modules/surgery/surgery_initiator.dm index 8b7506c9b7b8..706b28d0e94e 100644 --- a/code/modules/surgery/surgery_initiator.dm +++ b/code/modules/surgery/surgery_initiator.dm @@ -43,7 +43,7 @@ continue //Lying and self-surgery checks. - if(surgeryloop.lying_required && !target.lying) + if(surgeryloop.lying_required && target.body_position != LYING_DOWN) continue if(!surgeryloop.self_operable && target == user) continue @@ -134,7 +134,7 @@ [target_zone == "r_hand"||target_zone == "l_hand" ? "hand":"arm"] you're using!")) return TRUE - if(surgeryinstance.lying_required && !target.lying) + if(surgeryinstance.lying_required && target.body_position != LYING_DOWN) return TRUE if(surgery_limb) diff --git a/code/modules/surgery/surgery_procedure.dm b/code/modules/surgery/surgery_procedure.dm index 1e11516a8079..8620c557eb4b 100644 --- a/code/modules/surgery/surgery_procedure.dm +++ b/code/modules/surgery/surgery_procedure.dm @@ -90,7 +90,7 @@ to_chat(user, SPAN_WARNING("You can't operate on [target], \he is being carried by [target.pulledby]!")) return FALSE - if(lying_required && !target.lying) + if(lying_required && target.body_position != LYING_DOWN) to_chat(user, SPAN_WARNING("[user == target ? "You need" : "[target] needs"] to be lying down for this operation!")) return FALSE diff --git a/code/modules/tgui/status_composers.dm b/code/modules/tgui/status_composers.dm index 6d7b5897863e..ba1b29d8152e 100644 --- a/code/modules/tgui/status_composers.dm +++ b/code/modules/tgui/status_composers.dm @@ -56,17 +56,6 @@ /mob/living/silicon/proc/get_ui_access(atom/source) return UI_INTERACTIVE // Ubiquitous networking. Do not abuse. -/// Returns UI_INTERACTIVE if the user is conscious and lying down. -/// Returns UI_UPDATE otherwise. -/proc/ui_status_user_is_conscious_and_lying_down(mob/user) - if (!isliving(user)) - return UI_UPDATE - - var/mob/living/living_user = user - return (living_user.lying && living_user.stat == CONSCIOUS) \ - ? UI_INTERACTIVE \ - : UI_UPDATE - /// Return UI_INTERACTIVE if the user is strictly adjacent to the target atom, whether they can see it or not. /// Return UI_CLOSE otherwise. /proc/ui_status_user_strictly_adjacent(mob/user, atom/target) diff --git a/code/modules/vehicles/interior/interactable/seats.dm b/code/modules/vehicles/interior/interactable/seats.dm index 1e5df9fd1d81..ea961bc72593 100644 --- a/code/modules/vehicles/interior/interactable/seats.dm +++ b/code/modules/vehicles/interior/interactable/seats.dm @@ -388,17 +388,6 @@ handle_rotation() -/obj/structure/bed/chair/vehicle/unbuckle() - if(buckled_mob && buckled_mob.buckled == src) - buckled_mob.buckled = null - buckled_mob.anchored = initial(buckled_mob.anchored) - buckled_mob.update_canmove() - - var/M = buckled_mob - buckled_mob = null - - afterbuckle(M) - //attack handling /obj/structure/bed/chair/vehicle/attack_alien(mob/living/user) diff --git a/code/modules/vehicles/train.dm b/code/modules/vehicles/train.dm index 92358a1e0f27..cbad4535df72 100644 --- a/code/modules/vehicles/train.dm +++ b/code/modules/vehicles/train.dm @@ -54,8 +54,8 @@ //------------------------------------------- -/obj/vehicle/train/MouseDrop_T(atom/movable/C, mob/user as mob) - if(user.buckled || user.stat || user.is_mob_restrained() || !Adjacent(user) || !user.Adjacent(C) || !istype(C) || (user == C && !user.canmove)) +/obj/vehicle/train/MouseDrop_T(atom/movable/C, mob/living/user as mob) + if(user.buckled || user.stat || user.is_mob_restrained() || !Adjacent(user) || !user.Adjacent(C) || !istype(C) || (user == C && !(user.mobility_flags & MOBILITY_MOVE))) return if(istype(C,/obj/vehicle/train)) latch(C, user) @@ -71,7 +71,7 @@ if(!istype(usr, /mob/living/carbon/human)) return - if(!usr.canmove || usr.stat || usr.is_mob_restrained() || !Adjacent(usr)) + if(usr.is_mob_incapacitated() || !Adjacent(usr)) return unattach(usr) diff --git a/code/modules/vehicles/van/van.dm b/code/modules/vehicles/van/van.dm index fdb2f397bb2e..c4aa64360ec0 100644 --- a/code/modules/vehicles/van/van.dm +++ b/code/modules/vehicles/van/van.dm @@ -92,13 +92,13 @@ if(mover in mobs_under) //can't collide with the thing you're buckled to return NO_BLOCKED_MOVEMENT - if(ismob(mover)) - var/mob/M = mover + if(isliving(mover)) + var/mob/living/M = mover if(M.mob_flags & SQUEEZE_UNDER_VEHICLES) add_under_van(M) return NO_BLOCKED_MOVEMENT - if(M.lying) + if(M.body_position == LYING_DOWN) return NO_BLOCKED_MOVEMENT if(M.mob_size >= MOB_SIZE_IMMOBILE && next_push < world.time) diff --git a/colonialmarines.dme b/colonialmarines.dme index df6c6c1bccb6..d632d6bd4998 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -144,6 +144,7 @@ #include "code\__HELPERS\#maths.dm" #include "code\__HELPERS\_lists.dm" #include "code\__HELPERS\_time.dm" +#include "code\__HELPERS\animations.dm" #include "code\__HELPERS\chat.dm" #include "code\__HELPERS\cmp.dm" #include "code\__HELPERS\datums.dm" @@ -165,6 +166,7 @@ #include "code\__HELPERS\qdel.dm" #include "code\__HELPERS\sanitize_values.dm" #include "code\__HELPERS\shell.dm" +#include "code\__HELPERS\status_effects.dm" #include "code\__HELPERS\text.dm" #include "code\__HELPERS\traits.dm" #include "code\__HELPERS\type2type.dm" From 28891893f3a722a927a9b91615896ac0e808bf9c Mon Sep 17 00:00:00 2001 From: cm13-github <128137806+cm13-github@users.noreply.github.com> Date: Mon, 27 Nov 2023 12:33:39 +0000 Subject: [PATCH 21/23] Automatic changelog for PR #4828 [ci skip] --- html/changelogs/AutoChangeLog-pr-4828.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-4828.yml diff --git a/html/changelogs/AutoChangeLog-pr-4828.yml b/html/changelogs/AutoChangeLog-pr-4828.yml new file mode 100644 index 000000000000..133404e587a6 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-4828.yml @@ -0,0 +1,7 @@ +author: "fira" +delete-after: True +changes: + - code_imp: "Ported basic /tg/ Status Backend." + - rscadd: "Human transform changes such as lying down, knock down, buckling, are now animated." + - bugfix: "Some statuses will now take effect immediately instead of waiting for a life tick, notably Resting." + - balance: "Many interaction requirements were changed to eg. fail upon stuns rather than if lying down." \ No newline at end of file From f367771f5799b87257d92cb79db71bcd85b62f75 Mon Sep 17 00:00:00 2001 From: Birdtalon Date: Mon, 27 Nov 2023 18:42:21 +0000 Subject: [PATCH 22/23] Eggsac carrier revival (#4716) [Forum Thread](https://forum.cm-ss13.com/t/eggsac-carrier-revival/4711) # About the pull request The concept of this PR is to find a middle ground between the current eggsac carrier and the pre #4459 eggsac carrier. This PR will make the following changes. (From this point "normal weeds" can be substituted for "off hive weeds" Placing eggs on hive weeds is **unchanged**.) - Eggsac carrier can once again place eggs on normal weeds. - Eggsac carrier can only place 4 eggs at once on normal weeds. - If the Eggsac places more than 4 eggs on normal weeds, their oldest placed egg will die. No hugger release. - Eggs placed on normal weeds have a maximum lifetime of 5 MINUTES after which they will die. No hugger release. - Eggs placed on normal weeds have a 1 MINUTE life whilst the carrier is further than 14 tiles away from them. - If the carrier dies, all of their sustained eggs die. # Explain why it's good for the game Eggsac carrier at the moment is in a bit of a poor place and has gone from being very strong to quite poor. Considering the limitation of having to place only on hive weeds. The majority of feedback I read against eggsac carrier was with the quantity of eggs able to be placed, as well as the locations they can be placed in, all across the map and with impunity. This PR aims to address those concerns to make the eggsac both less infuriating to play against while still being satisfying to play as a frontline support or as a stealthy trapper. Eggs can no longer be placed all over the map because of the 4 egg limit off weeds, so the carrier has to think where they want to impact the map. The carrier also has to stay within a reasonable distance to where they are impacting with their eggs which localises their impact to their immediate play area. The carrier also has to be more reactive to current events as they cannot place an egg which then becomes useful 30 minutes later. Killing the carrier also has a small reward as in addition to removing a xeno from the game, the eggs they are sustaining are cleared. If a carrier is supporting the front and dies, the marines don't then have to clear X number of eggs AFTER the kill. # Testing Photographs and Procedure 1. Spawn as egg carrier. 2. Plant egg on normal weeds. 3. Move 15+ tiles away. 4. Wait 1 minute 5. OR Wait 5 minutes within 14 tiles. 6. Kill the carrier. The 5 minute lifetime of the eggs will also clear the eggs in the case that the carrier is admin deleted, or some other weird stuff happens which doesn't result in a death. This will also catch carriers de-evolving
Screenshots & Videos Put screenshots and videos here with an empty line between the screenshots and the `
` tags.
# Changelog :cl: add: Eggsac carrier can now place eggs on normal weeds to a maximum of 4 eggs. add: Eggsac carrier eggs on normal weeds have an expiry date. /:cl: --- code/modules/cm_aliens/structures/egg.dm | 60 +++++++++++++++++++ .../mob/living/carbon/xenomorph/egg_item.dm | 13 +++- .../mutators/strains/carrier/eggsac.dm | 55 ++++++++++++++++- 3 files changed, 124 insertions(+), 4 deletions(-) diff --git a/code/modules/cm_aliens/structures/egg.dm b/code/modules/cm_aliens/structures/egg.dm index c23f4f3e2b20..ce0be7c0c8a1 100644 --- a/code/modules/cm_aliens/structures/egg.dm +++ b/code/modules/cm_aliens/structures/egg.dm @@ -296,3 +296,63 @@ linked_egg.HasProximity(C) if(linked_eggmorph) linked_eggmorph.HasProximity(C) + +/* +SPECIAL EGG USED BY EGG CARRIER +*/ + +#define CARRIER_EGG_UNSUSTAINED_LIFE 1 MINUTES +#define CARRIER_EGG_MAXIMUM_LIFE 5 MINUTES + +/obj/effect/alien/egg/carrier_egg + name = "fragile egg" + desc = "It looks like a weird, fragile egg." + ///Owner of the fragile egg, must be a mob/living/carbon/xenomorph/carrier + var/mob/living/carbon/xenomorph/carrier/owner = null + ///Time that the carrier was last within refresh range of the egg (14 tiles) + var/last_refreshed = null + /// Timer holder for the maximum lifetime of the egg as defined CARRIER_EGG_MAXIMUM_LIFE + var/life_timer = null + +/obj/effect/alien/egg/carrier_egg/Initialize(mapload, hivenumber, planter = null) + . = ..() + last_refreshed = world.time + if(!planter) + //If we have no owner when created... this really shouldn't happen but start decaying the egg immediately. + start_unstoppable_decay() + else + //Die after maximum lifetime + life_timer = addtimer(CALLBACK(src, PROC_REF(start_unstoppable_decay)), CARRIER_EGG_MAXIMUM_LIFE, TIMER_STOPPABLE) + set_owner(planter) + +/obj/effect/alien/egg/carrier_egg/Destroy() + if(life_timer) + deltimer(life_timer) + //Remove reference to src in owner's behavior_delegate and set owner to null + if(owner) + var/mob/living/carbon/xenomorph/carrier/my_owner = owner + var/datum/behavior_delegate/carrier_eggsac/behavior = my_owner.behavior_delegate + behavior.eggs_sustained -= src + my_owner = null + return ..() + +/// Set the owner of the egg to the planter. +/obj/effect/alien/egg/carrier_egg/proc/set_owner(mob/living/carbon/xenomorph/carrier/planter) + var/datum/behavior_delegate/carrier_eggsac/my_delegate = planter.behavior_delegate + my_delegate.eggs_sustained += src + owner = planter + +///Check the last refreshed time and burst the egg if we're over the lifetime of the egg +/obj/effect/alien/egg/carrier_egg/proc/check_decay() + if(last_refreshed + CARRIER_EGG_UNSUSTAINED_LIFE < world.time) + start_unstoppable_decay() + +///Burst the egg without hugger release after a 10 second timer & remove the life timer. +/obj/effect/alien/egg/carrier_egg/proc/start_unstoppable_decay() + addtimer(CALLBACK(src, PROC_REF(Burst), TRUE), 10 SECONDS) + if(life_timer) + deltimer(life_timer) + +/obj/effect/alien/egg/carrier_egg/Burst(kill, instant_trigger, mob/living/carbon/xenomorph/X, is_hugger_player_controlled) + . = ..() + owner = null diff --git a/code/modules/mob/living/carbon/xenomorph/egg_item.dm b/code/modules/mob/living/carbon/xenomorph/egg_item.dm index 77c5548d9f9f..05d456d0025d 100644 --- a/code/modules/mob/living/carbon/xenomorph/egg_item.dm +++ b/code/modules/mob/living/carbon/xenomorph/egg_item.dm @@ -98,7 +98,7 @@ to_chat(user, SPAN_XENOWARNING("[src] must be planted on [lowertext(hive.prefix)]weeds.")) return - if(!hive_weeds) + if(!hive_weeds && user.mutation_type != CARRIER_EGGSAC) to_chat(user, SPAN_XENOWARNING("[src] can only be planted on [lowertext(hive.prefix)]hive weeds.")) return @@ -117,9 +117,16 @@ return for(var/obj/effect/alien/weeds/weed in T) - if(weed.weed_strength >= WEED_LEVEL_HIVE) + if(weed.weed_strength >= WEED_LEVEL_HIVE || user.mutation_type == CARRIER_EGGSAC) user.use_plasma(30) - var/obj/effect/alien/egg/newegg = new /obj/effect/alien/egg(T, hivenumber) + var/obj/effect/alien/egg/newegg + if(weed.weed_strength >= WEED_LEVEL_HIVE) + newegg = new /obj/effect/alien/egg(T, hivenumber) + else if(weed.weed_strength == WEED_LEVEL_STANDARD) + newegg = new /obj/effect/alien/egg/carrier_egg(T,hivenumber, user) + else + to_chat(user, SPAN_XENOWARNING("[src] can't be planted on these weeds.")) + return newegg.flags_embryo = flags_embryo diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/strains/carrier/eggsac.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/carrier/eggsac.dm index 524571fc0dfd..3d032da2fe36 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/carrier/eggsac.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/carrier/eggsac.dm @@ -1,6 +1,6 @@ /datum/xeno_mutator/eggsac name = "STRAIN: Carrier - Eggsac" - description = "In exchange for your ability to store huggers and place traps, you gain larger plasma stores, strong pheromones, and the ability to lay eggs by using your plasma stores. In addition, you can now carry twelve eggs at once and can place eggs one pace further than normal" + description = "In exchange for your ability to store huggers and place traps, you gain larger plasma stores, strong pheromones, and the ability to lay eggs by using your plasma stores. In addition, you can now carry twelve eggs at once and can place eggs one pace further than normal. \n\nYou can also place a small number of fragile eggs on normal weeds. These eggs have a lifetime of five minutes while you remain within 14 tiles. Or one minute if you leave this range." flavor_description = "An egg is always an adventure; the next one may be different." cost = MUTATOR_COST_EXPENSIVE individual_only = TRUE @@ -15,6 +15,7 @@ /datum/action/xeno_action/active_toggle/generate_egg, /datum/action/xeno_action/activable/retrieve_egg, // readding it so it gets at the end of the ability list ) + behavior_delegate_type = /datum/behavior_delegate/carrier_eggsac keystone = TRUE /datum/xeno_mutator/eggsac/apply_mutator(datum/mutator_set/individual_mutators/mutator_set) @@ -40,8 +41,57 @@ carrier.update_eggsac_overlays() carrier.eggs_max = 12 carrier.egg_planting_range = 2 + apply_behavior_holder(carrier) return TRUE +#define EGGSAC_OFF_WEED_EGGCAP 4 +#define EGGSAC_EGG_SUSTAIN_DISTANCE 14 + +/datum/behavior_delegate/carrier_eggsac + name = "Eggsac Carrier Behavior Delegate" + ///List of /obj/effect/alien/egg/carrier_egg sustained by the carrier on normal weeds + var/list/eggs_sustained = list() + ///Total number of eggs which can be sustained defined as EGGSAC_OFF_WEED_EGGCAP + var/egg_sustain_cap = EGGSAC_OFF_WEED_EGGCAP + ///Distance from the egg that the carrier can go before it stops sustaining it + var/sustain_distance = EGGSAC_EGG_SUSTAIN_DISTANCE + +/datum/behavior_delegate/carrier_eggsac/append_to_stat() + . = list() + . += "Eggs sustained: [length(eggs_sustained)] / [egg_sustain_cap]" + +/datum/behavior_delegate/carrier_eggsac/on_life() + if(length(eggs_sustained) > egg_sustain_cap) + var/obj/effect/alien/egg/carrier_egg/my_egg = eggs_sustained[1] + remove_egg_owner(my_egg) + my_egg.start_unstoppable_decay() + to_chat(bound_xeno, SPAN_XENOWARNING("You can only sustain [egg_sustain_cap] eggs off hive weeds! Your oldest placed egg is decaying rapidly.")) + + for(var/obj/effect/alien/egg/carrier_egg/my_egg as anything in eggs_sustained) + //Get the distance from us to our sustained egg + if(get_dist(bound_xeno, my_egg) <= sustain_distance) + my_egg.last_refreshed = world.time + else + my_egg.check_decay() + +///Remove owner of egg +/datum/behavior_delegate/carrier_eggsac/proc/remove_egg_owner(obj/effect/alien/egg/carrier_egg/egg) + if(!egg.owner || egg.owner != bound_xeno) + return + eggs_sustained -= egg + egg.owner = null + +/datum/behavior_delegate/carrier_eggsac/handle_death(mob/M) + for(var/obj/effect/alien/egg/carrier_egg/my_egg as anything in eggs_sustained) + remove_egg_owner(my_egg) + my_egg.start_unstoppable_decay() + +///Remove all references to src in eggs_sustained +/datum/behavior_delegate/carrier_eggsac/Destroy() + for(var/obj/effect/alien/egg/carrier_egg/my_egg as anything in eggs_sustained) + my_egg.owner = null + return ..() + /datum/action/xeno_action/active_toggle/generate_egg name = "Generate Eggs (50)" action_icon_state = "lay_egg" @@ -77,3 +127,6 @@ xeno.eggs_cur++ to_chat(xeno, SPAN_XENONOTICE("You generate a egg. Now sheltering: [xeno.eggs_cur] / [xeno.eggs_max].")) xeno.update_icons() + +#undef EGGSAC_OFF_WEED_EGGCAP +#undef EGGSAC_EGG_SUSTAIN_DISTANCE From 52d5b542ec44c9ef9bd45dd0178de50ac9cda2b7 Mon Sep 17 00:00:00 2001 From: cm13-github <128137806+cm13-github@users.noreply.github.com> Date: Mon, 27 Nov 2023 18:50:46 +0000 Subject: [PATCH 23/23] Automatic changelog for PR #4716 [ci skip] --- html/changelogs/AutoChangeLog-pr-4716.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-4716.yml diff --git a/html/changelogs/AutoChangeLog-pr-4716.yml b/html/changelogs/AutoChangeLog-pr-4716.yml new file mode 100644 index 000000000000..76dacd7a72ca --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-4716.yml @@ -0,0 +1,5 @@ +author: "Birdtalon" +delete-after: True +changes: + - rscadd: "Eggsac carrier can now place eggs on normal weeds to a maximum of 4 eggs." + - rscadd: "Eggsac carrier eggs on normal weeds have an expiry date." \ No newline at end of file