From 9e22d7be4e6784541030ebb41e013bfbcaf5a90c Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Wed, 16 Dec 2015 19:57:52 -0600 Subject: [PATCH] Shielded hardsuits --- code/datums/uplink_item.dm | 9 +- code/modules/clothing/spacesuits/hardsuit.dm | 136 +++++++++++++++++++ 2 files changed, 144 insertions(+), 1 deletion(-) diff --git a/code/datums/uplink_item.dm b/code/datums/uplink_item.dm index 6c9902c8530..5c1fbd0faff 100644 --- a/code/datums/uplink_item.dm +++ b/code/datums/uplink_item.dm @@ -611,7 +611,7 @@ var/list/uplink_items = list() cost = 8 excludefrom = list(/datum/game_mode/gang) -/datum/uplink_item/device_tools/hardsuit +/datum/uplink_item/device_tools/elite_hardsuit name = "Elite Syndicate Hardsuit" desc = "The elite Syndicate hardsuit is worn by only the best nuclear agents. Features much better armoring and complete fireproofing, as well as a built in jetpack. \ When the built in helmet is deployed your identity will be protected, even in death, as the suit cannot be removed by outside forces. Toggling the suit into combat mode \ @@ -621,6 +621,13 @@ var/list/uplink_items = list() cost = 8 gamemodes = list(/datum/game_mode/nuclear) +/datum/uplink_item/dangerous/shielded_hardsuit + name = "Shielded Hardsuit" + desc = "An advanced hardsuit with built in energy shielding. The shields will rapidly recharge when not under fire." + item = /obj/item/clothing/suit/space/hardsuit/shielded/syndi + cost = 30 + gamemodes = list(/datum/game_mode/nuclear) + /datum/uplink_item/device_tools/thermal name = "Thermal Imaging Glasses" desc = "These goggles can be turned to resemble common eyewears throughout the station. \ diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index 2546097d3cb..9d19d0bb4c8 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -428,3 +428,139 @@ desc = "A special bulky suit that protects against hazardous, low pressure environments. Has an additional layer of armor." armor = list(melee = 45, bullet = 25, laser = 30, energy = 10, bomb = 25, bio = 100, rad = 50) helmettype = /obj/item/clothing/head/helmet/space/hardsuit/security/hos + + + +/////////////SHIELDED////////////////////////////////// + +/obj/item/clothing/suit/space/hardsuit/shielded + name = "shielded hardsuit" + desc = "A hardsuit with built in energy shielding. Will rapidly recharge when not under fire." + icon_state = "hardsuit-hos" + helmettype = /obj/item/clothing/head/helmet/space/hardsuit/security/hos + allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank/internals, /obj/item/weapon/gun,/obj/item/weapon/reagent_containers/spray/pepper,/obj/item/ammo_box,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/restraints/handcuffs) + armor = list(melee = 30, bullet = 15, laser = 30, energy = 10, bomb = 10, bio = 100, rad = 50) + var/current_charges = 3 + var/max_charges = 3 //How many charges total the shielding has + var/recharge_delay = 200 //How long after we've been shot before we can start recharging. 20 seconds here + var/recharge_cooldown = 0 //Time since we've last been shot + var/recharge_rate = 1 //How quickly the shield recharges once it starts charging + var/shield_state = "shield-old" + var/shield_on = "shield-old" + +/obj/item/clothing/suit/space/hardsuit/shielded/hit_reaction(mob/living/carbon/human/owner, attack_text) + if(current_charges > 0) + var/datum/effect_system/spark_spread/s = new + s.set_up(2, 1, src) + s.start() + owner.visible_message("The [attack_text] sparks harmlessly off [owner]'s shields!") + current_charges-- + recharge_cooldown = world.time + recharge_delay + if(current_charges <= 0) + owner.visible_message("[owner]'s shield overloads!") + shield_state = "broken" + owner.update_inv_wear_suit() + SSobj.processing |= src + return 1 + return 0 + + +/obj/item/clothing/suit/space/hardsuit/shielded/Destroy() + SSobj.processing.Remove(src) + return ..() + +/obj/item/clothing/suit/space/hardsuit/shielded/process() + if(world.time > recharge_cooldown && current_charges < max_charges) + current_charges = Clamp((current_charges + recharge_rate), 0, max_charges) + playsound(loc, 'sound/magic/Charge.ogg', 50, 1) + if(current_charges == max_charges) + playsound(loc, 'sound/machines/ding.ogg', 50, 1) + SSobj.processing.Remove(src) + shield_state = "[shield_on]" + if(istype(loc, /mob/living/carbon/human)) + var/mob/living/carbon/human/C = loc + C.update_inv_wear_suit() + + + +/obj/item/clothing/suit/space/hardsuit/shielded/worn_overlays(isinhands) + . = list() + if(!isinhands) + . += image(icon = 'icons/effects/effects.dmi', icon_state = "[shield_state]") + + +///////////////Capture the Flag//////////////////// + +/obj/item/clothing/suit/space/hardsuit/shielded/ctf + name = "white shielded hardsuit" + desc = "Standard issue hardsuit for playing capture the flag." + icon_state = "ert_medical" + item_state = "ert_medical" + item_color = "ert_medical" + flags = STOPSPRESSUREDMAGE | THICKMATERIAL | NODROP //Dont want people changing into the other teams gear + helmettype = /obj/item/clothing/head/helmet/space/hardsuit/shielded/ctf + armor = list(melee = 0, bullet = 30, laser = 30, energy = 30, bomb = 50, bio = 100, rad = 100) + slowdown = 0 + +/obj/item/clothing/suit/space/hardsuit/shielded/ctf/red + name = "red shielded hardsuit" + icon_state = "ert_security" + item_state = "ert_security" + item_color = "ert_security" + helmettype = /obj/item/clothing/head/helmet/space/hardsuit/shielded/ctf/red + +/obj/item/clothing/suit/space/hardsuit/shielded/ctf/blue + name = "blue shielded hardsuit" + desc = "Standard issue hardsuit for playing capture the flag." + icon_state = "ert_command" + item_state = "ert_command" + helmettype = /obj/item/clothing/head/helmet/space/hardsuit/shielded/ctf/blue + + + +/obj/item/clothing/head/helmet/space/hardsuit/shielded/ctf + name = "shielded hardsuit helmet" + desc = "Standard issue hardsuit helmet for playing capture the flag." + icon_state = "hardsuit0-ert_medical" + item_state = "hardsuit0-ert_medical" + item_color = "ert_medical" + armor = list(melee = 0, bullet = 30, laser = 30, energy = 30, bomb = 50, bio = 100, rad = 100) + + +/obj/item/clothing/head/helmet/space/hardsuit/shielded/ctf/red + icon_state = "hardsuit0-ert_security" + item_state = "hardsuit0-ert_security" + item_color = "ert_security" + +/obj/item/clothing/head/helmet/space/hardsuit/shielded/ctf/blue + name = "shielded hardsuit helmet" + desc = "Standard issue hardsuit helmet for playing capture the flag." + icon_state = "hardsuit0-ert_commander" + item_state = "hardsuit0-ert_commander" + item_color = "ert_commander" + + + + + +//////Syndicate Version + +/obj/item/clothing/suit/space/hardsuit/shielded/syndi + name = "blood-red hardsuit" + desc = "An advanced hardsuit with built in energy shielding." + icon_state = "hardsuit1-syndi" + item_state = "syndie_hardsuit" + item_color = "syndi" + armor = list(melee = 40, bullet = 50, laser = 30, energy = 15, bomb = 35, bio = 100, rad = 50) + allowed = list(/obj/item/weapon/gun,/obj/item/ammo_box,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/melee/energy/sword/saber,/obj/item/weapon/restraints/handcuffs,/obj/item/weapon/tank/internals) + helmettype = /obj/item/clothing/head/helmet/space/hardsuit/shielded/syndi + slowdown = 0 + + +/obj/item/clothing/head/helmet/space/hardsuit/shielded/syndi + name = "blood-red hardsuit helmet" + desc = "An advanced hardsuit helmet with built in energy shielding." + icon_state = "hardsuit1-syndi" + item_state = "syndie_helm" + item_color = "syndi" + armor = list(melee = 40, bullet = 50, laser = 30, energy = 15, bomb = 35, bio = 100, rad = 50) \ No newline at end of file