From 3cf3840c53b9a6c6e2d41941c3a57c5aaaf83e48 Mon Sep 17 00:00:00 2001 From: skull132 Date: Fri, 25 Mar 2016 01:29:14 +0200 Subject: [PATCH] Fixes #207 Hardsuit items that would require actual space to be utilized, like weapons, can no longer be used inside mechs. May be modified later to include other conditions, such as being inside lockers or whatever. --- code/modules/clothing/spacesuits/rig/modules/computer.dm | 2 ++ code/modules/clothing/spacesuits/rig/modules/modules.dm | 5 +++++ code/modules/clothing/spacesuits/rig/modules/ninja.dm | 1 + code/modules/clothing/spacesuits/rig/modules/utility.dm | 4 +++- code/modules/clothing/spacesuits/rig/modules/vision.dm | 3 ++- 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/code/modules/clothing/spacesuits/rig/modules/computer.dm b/code/modules/clothing/spacesuits/rig/modules/computer.dm index 11d551ace00..d39113480c9 100644 --- a/code/modules/clothing/spacesuits/rig/modules/computer.dm +++ b/code/modules/clothing/spacesuits/rig/modules/computer.dm @@ -34,6 +34,7 @@ usable = 1 disruptive = 0 activates_on_touch = 1 + confined_use = 1 engage_string = "Eject AI" activate_string = "Enable Dataspike" @@ -324,6 +325,7 @@ icon_state = "ewar" toggleable = 1 usable = 0 + confined_use = 1 activate_string = "Enable Countermeasures" deactivate_string = "Disable Countermeasures" diff --git a/code/modules/clothing/spacesuits/rig/modules/modules.dm b/code/modules/clothing/spacesuits/rig/modules/modules.dm index c33064b41c9..e009bc00309 100644 --- a/code/modules/clothing/spacesuits/rig/modules/modules.dm +++ b/code/modules/clothing/spacesuits/rig/modules/modules.dm @@ -28,6 +28,7 @@ var/permanent // If set, the module can't be removed. var/disruptive = 1 // Can disrupt by other effects. var/activates_on_touch // If set, unarmed attacks will call engage() on the target. + var/confined_use = 0 // If set, can be used inside mechs and other vehicles. var/active // Basic module status var/disruptable // Will deactivate if some other powers are used. @@ -169,6 +170,10 @@ if(!holder.check_power_cost(usr, use_power_cost, 0, src, (istype(usr,/mob/living/silicon ? 1 : 0) ) ) ) return 0 + if(!confined_use && istype(usr.loc, /obj/mecha)) + usr << "You cannot use the suit in the confined space." + return 0 + next_use = world.time + module_cooldown return 1 diff --git a/code/modules/clothing/spacesuits/rig/modules/ninja.dm b/code/modules/clothing/spacesuits/rig/modules/ninja.dm index 96cf6a113a2..e6ff815b640 100644 --- a/code/modules/clothing/spacesuits/rig/modules/ninja.dm +++ b/code/modules/clothing/spacesuits/rig/modules/ninja.dm @@ -15,6 +15,7 @@ toggleable = 1 disruptable = 1 disruptive = 0 + confined_use = 1 use_power_cost = 50 active_power_cost = 10 diff --git a/code/modules/clothing/spacesuits/rig/modules/utility.dm b/code/modules/clothing/spacesuits/rig/modules/utility.dm index a1b772f539d..4249ccac1fd 100644 --- a/code/modules/clothing/spacesuits/rig/modules/utility.dm +++ b/code/modules/clothing/spacesuits/rig/modules/utility.dm @@ -123,6 +123,7 @@ selectable = 0 toggleable = 0 disruptive = 0 + confined_use = 1 engage_string = "Inject" @@ -268,6 +269,7 @@ selectable = 0 toggleable = 0 disruptive = 0 + confined_use = 1 engage_string = "Configure Synthesiser" @@ -379,4 +381,4 @@ jets.holder = null jets.ion_trail.set_up(jets) -/obj/item/rig_module/foam_sprayer \ No newline at end of file +/obj/item/rig_module/foam_sprayer diff --git a/code/modules/clothing/spacesuits/rig/modules/vision.dm b/code/modules/clothing/spacesuits/rig/modules/vision.dm index aa106eda02a..90bd8adbd7e 100644 --- a/code/modules/clothing/spacesuits/rig/modules/vision.dm +++ b/code/modules/clothing/spacesuits/rig/modules/vision.dm @@ -50,6 +50,7 @@ usable = 1 toggleable = 1 disruptive = 0 + confined_use = 1 engage_string = "Cycle Visor Mode" activate_string = "Enable Visor" @@ -188,4 +189,4 @@ if(!vision) vision = vision_datum processed_vision += vision_datum - vision_modes = processed_vision \ No newline at end of file + vision_modes = processed_vision