From 16a514a2a86a254b0721dac3c2edc9fbcb1a0e0b Mon Sep 17 00:00:00 2001 From: Eschess Date: Sat, 17 Nov 2018 23:17:56 +0100 Subject: [PATCH 1/7] adds ui button to toggle hardsuit helmet --- code/modules/clothing/spacesuits/hardsuit.dm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index dea27a5b946..747145532b5 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -69,6 +69,7 @@ armor = list(melee = 10, bullet = 5, laser = 10, energy = 5, bomb = 10, bio = 100, rad = 75) allowed = list(/obj/item/flashlight,/obj/item/tank,/obj/item/t_scanner, /obj/item/rcd) siemens_coefficient = 0 + actions_types = list(/datum/action/item_action/toggle_helmet) hide_tail_by_species = list("Vox" , "Vulpkanin" , "Unathi" , "Tajaran") species_restricted = list("exclude","Diona","Wryn") @@ -99,6 +100,7 @@ var/obj/item/clothing/shoes/magboots/boots = null // Deployable boots, if any. var/attached_helmet = 1 // Can't wear a helmet if one is deployable. var/obj/item/clothing/head/helmet/helmet = null // Deployable helmet, if any. + var/helmettype = /obj/item/clothing/head/helmet/space/hardsuit var/list/max_mounted_devices = 0 // Maximum devices. Easy. var/list/can_mount = null // Types of device that can be hardpoint mounted. @@ -156,6 +158,10 @@ H.unEquip(boots) boots.forceMove(src) +/obj/item/clothing/suit/space/hardsuit/ui_action_click() + ..() + toggle_helmet() + /obj/item/clothing/suit/space/hardsuit/verb/toggle_helmet() set name = "Toggle Helmet" set category = "Object" From 899ce0db8b6441bd5b03297456dafa1dedaddf57 Mon Sep 17 00:00:00 2001 From: Eschess Date: Sun, 18 Nov 2018 02:48:16 +0100 Subject: [PATCH 2/7] Update hardsuit.dm --- code/modules/clothing/spacesuits/hardsuit.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index 747145532b5..3adb967a53b 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -326,6 +326,7 @@ icon_state = "hardsuit[on]-[item_color]" /obj/item/clothing/head/helmet/space/hardsuit/syndi/attack_self(mob/user) + toggle_hardsuit_mode() on = !on if(on) to_chat(user, "You switch your helmet to travel mode. It will allow you to stand in zero pressure environments, at the cost of speed.") @@ -378,7 +379,7 @@ /obj/item/clothing/suit/space/hardsuit/syndi/update_icon() icon_state = "hardsuit[on]-[item_color]" -/obj/item/clothing/suit/space/hardsuit/syndi/attack_self(mob/user) +/obj/item/clothing/suit/space/hardsuit/syndi/proc/toggle_hardsuit_mode(mob/user) on = !on if(on) to_chat(user, "You switch your hardsuit to travel mode. It will allow you to stand in zero pressure environments, at the cost of speed.") From c306b94a3789b07f49788b646ae98fc04504257b Mon Sep 17 00:00:00 2001 From: Eschess Date: Mon, 19 Nov 2018 20:17:27 +0100 Subject: [PATCH 3/7] trying to fix the combat mode thingy WIP --- code/modules/clothing/spacesuits/hardsuit.dm | 75 +++++++++----------- 1 file changed, 35 insertions(+), 40 deletions(-) diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index 3adb967a53b..3aeaa6685f7 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -100,7 +100,6 @@ var/obj/item/clothing/shoes/magboots/boots = null // Deployable boots, if any. var/attached_helmet = 1 // Can't wear a helmet if one is deployable. var/obj/item/clothing/head/helmet/helmet = null // Deployable helmet, if any. - var/helmettype = /obj/item/clothing/head/helmet/space/hardsuit var/list/max_mounted_devices = 0 // Maximum devices. Easy. var/list/can_mount = null // Types of device that can be hardpoint mounted. @@ -118,16 +117,6 @@ if(H.wear_suit != src) return - if(attached_helmet && helmet) - if(H.head) - to_chat(M, "You are unable to deploy your suit's helmet as \the [H.head] is in the way.") - else - to_chat(M, "Your suit's helmet deploys with a hiss.") - //TODO: Species check, skull damage for forcing an unfitting helmet on? - helmet.forceMove(H) - H.equip_to_slot(helmet, slot_head) - helmet.flags |= NODROP - if(attached_boots && boots) if(H.shoes) to_chat(M, "You are unable to deploy your suit's magboots as \the [H.shoes] are in the way.") @@ -228,6 +217,7 @@ user.drop_item() W.loc = src src.helmet = W + return else if(istype(W,/obj/item/clothing/shoes/magboots) && can_modify(user)) @@ -318,6 +308,7 @@ item_color = "syndi" armor = list(melee = 40, bullet = 50, laser = 30, energy = 15, bomb = 35, bio = 100, rad = 50) on = 1 + var/obj/item/clothing/suit/space/hardsuit/syndi/linkedsuit = null actions_types = list(/datum/action/item_action/toggle_helmet_mode) flags = BLOCKHAIR | STOPSPRESSUREDMAGE | THICKMATERIAL visor_flags_inv = HIDEMASK|HIDEEYES|HIDEFACE|HIDETAIL @@ -325,8 +316,12 @@ /obj/item/clothing/head/helmet/space/hardsuit/syndi/update_icon() icon_state = "hardsuit[on]-[item_color]" +/obj/item/clothing/head/helmet/space/hardsuit/syndi/Initialize() + . = ..() + if(istype(loc, /obj/item/clothing/suit/space/hardsuit/syndi)) + linkedsuit = loc + /obj/item/clothing/head/helmet/space/hardsuit/syndi/attack_self(mob/user) - toggle_hardsuit_mode() on = !on if(on) to_chat(user, "You switch your helmet to travel mode. It will allow you to stand in zero pressure environments, at the cost of speed.") @@ -349,12 +344,39 @@ update_icon() playsound(src.loc, 'sound/mecha/mechmove03.ogg', 50, 1) + toggle_hardsuit_mode() user.update_inv_head() for(var/X in actions) var/datum/action/A = X A.UpdateButtonIcon() +/obj/item/clothing/head/helmet/space/hardsuit/syndi/proc/toggle_hardsuit_mode(mob/user) //Helmet Toggles Suit Mode + if(linkedsuit) + if(on) + linkedsuit.name = initial(linkedsuit.name) + linkedsuit.desc = initial(linkedsuit.desc) + linkedsuit.slowdown = 1 + linkedsuit.flags |= BLOCKHAIR | STOPSPRESSUREDMAGE | THICKMATERIAL | NODROP + linkedsuit.flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT|HIDETAIL + linkedsuit.cold_protection |= UPPER_TORSO | LOWER_TORSO | LEGS | FEET | ARMS | HANDS + else + linkedsuit.name += " (combat)" + linkedsuit.desc = linkedsuit.alt_desc + linkedsuit.slowdown = 0 + linkedsuit.flags &= ~BLOCKHAIR | STOPSPRESSUREDMAGE | THICKMATERIAL | NODROP + linkedsuit.cold_protection &= ~(UPPER_TORSO | LOWER_TORSO | LEGS | FEET | ARMS | HANDS) + linkedsuit.flags_inv &= ~(HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT|HIDETAIL) + + linkedsuit.icon_state = "hardsuit[on]-[item_color]" + linkedsuit.update_icon() + user.update_inv_wear_suit() + user.update_inv_w_uniform() + + for(var/X in actions) + var/datum/action/A = X + A.UpdateButtonIcon() + /obj/item/clothing/head/helmet/space/hardsuit/syndi/freedom name = "eagle helmet" desc = "An advanced, space-proof helmet. It appears to be modeled after an old-world eagle." @@ -367,6 +389,7 @@ /obj/item/clothing/suit/space/hardsuit/syndi name = "blood-red hardsuit" desc = "A dual-mode advanced hardsuit designed for work in special operations. It is in travel mode. Property of Gorlex Marauders." + alt_desc = "A dual-mode advanced hardsuit designed for work in special operations. It is in combat mode. Property of Gorlex Marauders." icon_state = "hardsuit1-syndi" item_state = "syndie_hardsuit" item_color = "syndi" @@ -379,34 +402,6 @@ /obj/item/clothing/suit/space/hardsuit/syndi/update_icon() icon_state = "hardsuit[on]-[item_color]" -/obj/item/clothing/suit/space/hardsuit/syndi/proc/toggle_hardsuit_mode(mob/user) - on = !on - if(on) - to_chat(user, "You switch your hardsuit to travel mode. It will allow you to stand in zero pressure environments, at the cost of speed.") - name = "blood-red hardsuit" - desc = "A dual-mode advanced hardsuit designed for work in special operations. It is in travel mode. Property of Gorlex Marauders." - slowdown = 1 - flags = STOPSPRESSUREDMAGE | THICKMATERIAL - flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT|HIDETAIL - cold_protection = UPPER_TORSO | LOWER_TORSO | LEGS | FEET | ARMS | HANDS - else - to_chat(user, "You switch your hardsuit to combat mode. You will take damage in zero pressure environments, but you are more suited for a fight.") - name = "blood-red hardsuit (combat)" - desc = "A dual-mode advanced hardsuit designed for work in special operations. It is in combat mode. Property of Gorlex Marauders." - slowdown = 0 - flags = THICKMATERIAL - flags_inv = null - cold_protection = null - - update_icon() - playsound(src.loc, 'sound/mecha/mechmove03.ogg', 50, 1) - user.update_inv_wear_suit() - user.update_inv_w_uniform() - - for(var/X in actions) - var/datum/action/A = X - A.UpdateButtonIcon() - //Elite Syndie suit /obj/item/clothing/head/helmet/space/hardsuit/syndi/elite name = "elite syndicate hardsuit helmet" From 5c57cf38b05ccfc0c7ff661c2b419fd540cd742b Mon Sep 17 00:00:00 2001 From: Eschess Date: Tue, 20 Nov 2018 01:36:43 +0100 Subject: [PATCH 4/7] adds proc, still WIP --- code/modules/clothing/spacesuits/hardsuit.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index 3aeaa6685f7..0282f2ef3bf 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -217,7 +217,7 @@ user.drop_item() W.loc = src src.helmet = W - + helmet.link_suit() return else if(istype(W,/obj/item/clothing/shoes/magboots) && can_modify(user)) @@ -316,9 +316,9 @@ /obj/item/clothing/head/helmet/space/hardsuit/syndi/update_icon() icon_state = "hardsuit[on]-[item_color]" -/obj/item/clothing/head/helmet/space/hardsuit/syndi/Initialize() - . = ..() - if(istype(loc, /obj/item/clothing/suit/space/hardsuit/syndi)) +/obj/item/clothing/head/helmet/space/hardsuit/syndi/proc/link_suit() + . = ..() + if(istype(loc,/obj/item/clothing/suit/space/hardsuit/syndi)) linkedsuit = loc /obj/item/clothing/head/helmet/space/hardsuit/syndi/attack_self(mob/user) From 1f614665f3a95e9f7c67fddbc2e51773af1ac22a Mon Sep 17 00:00:00 2001 From: Eschess Date: Tue, 20 Nov 2018 19:38:53 +0100 Subject: [PATCH 5/7] toggling combat mode via the helmet button actually works now --- code/modules/clothing/spacesuits/hardsuit.dm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index 0282f2ef3bf..069d081a554 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -217,7 +217,7 @@ user.drop_item() W.loc = src src.helmet = W - helmet.link_suit() + helmet:link_suit() return else if(istype(W,/obj/item/clothing/shoes/magboots) && can_modify(user)) @@ -344,7 +344,7 @@ update_icon() playsound(src.loc, 'sound/mecha/mechmove03.ogg', 50, 1) - toggle_hardsuit_mode() + toggle_hardsuit_mode(user) user.update_inv_head() for(var/X in actions) @@ -357,18 +357,17 @@ linkedsuit.name = initial(linkedsuit.name) linkedsuit.desc = initial(linkedsuit.desc) linkedsuit.slowdown = 1 - linkedsuit.flags |= BLOCKHAIR | STOPSPRESSUREDMAGE | THICKMATERIAL | NODROP + linkedsuit.flags |= BLOCKHAIR | STOPSPRESSUREDMAGE | THICKMATERIAL linkedsuit.flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT|HIDETAIL linkedsuit.cold_protection |= UPPER_TORSO | LOWER_TORSO | LEGS | FEET | ARMS | HANDS else linkedsuit.name += " (combat)" linkedsuit.desc = linkedsuit.alt_desc linkedsuit.slowdown = 0 - linkedsuit.flags &= ~BLOCKHAIR | STOPSPRESSUREDMAGE | THICKMATERIAL | NODROP + linkedsuit.flags = THICKMATERIAL linkedsuit.cold_protection &= ~(UPPER_TORSO | LOWER_TORSO | LEGS | FEET | ARMS | HANDS) linkedsuit.flags_inv &= ~(HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT|HIDETAIL) - linkedsuit.icon_state = "hardsuit[on]-[item_color]" linkedsuit.update_icon() user.update_inv_wear_suit() user.update_inv_w_uniform() From aba20b9b5871ee81a785f528975ab39e417e0ba5 Mon Sep 17 00:00:00 2001 From: Eschess Date: Tue, 20 Nov 2018 23:26:51 +0100 Subject: [PATCH 6/7] typecasts link_sui and readds helmet autodeploy --- code/modules/clothing/spacesuits/hardsuit.dm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index 069d081a554..99bdaca2ec7 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -117,6 +117,16 @@ if(H.wear_suit != src) return + if(attached_helmet && helmet) + if(H.head) + to_chat(M, "You are unable to deploy your suit's helmet as \the [H.head] is in the way.") + else + to_chat(M, "Your suit's helmet deploys with a hiss.") + //TODO: Species check, skull damage for forcing an unfitting helmet on? + helmet.forceMove(H) + H.equip_to_slot(helmet, slot_head) + helmet.flags |= NODROP + if(attached_boots && boots) if(H.shoes) to_chat(M, "You are unable to deploy your suit's magboots as \the [H.shoes] are in the way.") @@ -217,7 +227,10 @@ user.drop_item() W.loc = src src.helmet = W - helmet:link_suit() + var/obj/item/clothing/head/helmet/space/hardsuit/syndi/S = W + S.loc = src + helmet = S + S.link_suit() return else if(istype(W,/obj/item/clothing/shoes/magboots) && can_modify(user)) From 86c229b6e04bc8fd9336c3f2e909b1dccb26761e Mon Sep 17 00:00:00 2001 From: Eschess Date: Wed, 21 Nov 2018 16:29:10 +0100 Subject: [PATCH 7/7] changes loc for forcemove, also removes pointless blockhair flag --- code/modules/clothing/spacesuits/hardsuit.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index 99bdaca2ec7..a5e66af02ac 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -228,7 +228,7 @@ W.loc = src src.helmet = W var/obj/item/clothing/head/helmet/space/hardsuit/syndi/S = W - S.loc = src + S.forceMove(src) helmet = S S.link_suit() return @@ -370,7 +370,7 @@ linkedsuit.name = initial(linkedsuit.name) linkedsuit.desc = initial(linkedsuit.desc) linkedsuit.slowdown = 1 - linkedsuit.flags |= BLOCKHAIR | STOPSPRESSUREDMAGE | THICKMATERIAL + linkedsuit.flags |= STOPSPRESSUREDMAGE | THICKMATERIAL linkedsuit.flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT|HIDETAIL linkedsuit.cold_protection |= UPPER_TORSO | LOWER_TORSO | LEGS | FEET | ARMS | HANDS else