Skip to content

Commit

Permalink
[WORK IN PROGRESS] Adds in a framework for hardsuits to become power …
Browse files Browse the repository at this point in the history
…cell eating power armor (#221)

* Basic power armor

* Adds the rest of the power armor

* kewl updates

* Update hardsuit.dm
  • Loading branch information
ma44 authored and AndrewL97 committed Nov 29, 2018
1 parent 67bcaf0 commit 2fb6ec5
Showing 1 changed file with 251 additions and 0 deletions.
251 changes: 251 additions & 0 deletions code/modules/clothing/spacesuits/hardsuit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
item_color = "engineering" //Determines used sprites: hardsuit[on]-[color] and hardsuit[on]-[color]2 (lying down sprite)
actions_types = list(/datum/action/item_action/toggle_helmet_light)

var/offlinetint //For powerarmor

var/rad_count = 0
var/rad_record = 0
var/grace_count = 0
Expand Down Expand Up @@ -814,3 +816,252 @@
strip_delay = 130
max_heat_protection_temperature = FIRE_IMMUNITY_HELM_MAX_TEMP_PROTECT
actions_types = list()


///////////////////////
//////POWER ARMOR//////
///////////////////////
//Power armor is a type of armor that takes power cells while possibly also allowing cool things like night vision
//Meant for fallout and to be more immersive as well as a replacement for mecha suits

//THE HELMET SHOULD NOT EXIST AS A STANDALONE ITEM
//IT'S MEANT TO BE ACTIVATED AND APPEAR VIA THE BASE SUIT

/obj/item/clothing/head/helmet/space/hardsuit/powerarmor
name = "default power armor helmet"
desc = "Default power armor helmet, this should DEFINITELY not exist at all sadly."
clothing_flags = THICKMATERIAL //It better stop syringes
cold_protection = HEAD
min_cold_protection_temperature = SPACE_HELM_MIN_TEMP_PROTECT
heat_protection = HEAD
max_heat_protection_temperature = SPACE_HELM_MAX_TEMP_PROTECT
strip_delay = 200
flags_inv = HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDEFACIALHAIR|HIDEMASK|HIDEJUMPSUIT
flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH
resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF
flash_protect = 3
tint = 0
dynamic_hair_suffix = ""
dynamic_fhair_suffix = ""
ispowerarmor = 1
offlinetint = 2 //Rip your eyes
var/offline = 0 //If it's offline
//actions_types = list(/datum/action/item_action/toggle_helmet_light)
actions_types = list()

/obj/item/clothing/suit/space/hardsuit/powerarmor
name = "default power armor suit"
desc = "Default power armor suit, this shouldn't really exist at all sadly. Altclick this to get the power cell out."
slowdown = 1
ispowerarmor = 1
body_parts_covered = CHEST|GROIN|LEGS|FEET|ARMS
cold_protection = CHEST|GROIN|LEGS|FEET|ARMS|HANDS
heat_protection = CHEST|GROIN|LEGS|FEET|ARMS
flags_inv = HIDEJUMPSUIT
strip_delay = 200
resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF
clothing_flags = THICKMATERIAL //It better stop syringes
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 0, "acid" = 0)
obj/item/clothing/head/helmet/spacec/hardsuit/powerarmor/helmettype = /obj/item/clothing/head/helmet/space/hardsuit/powerarmor //Recast bois
obj/item/clothing/head/helmet/spacec/hardsuit/powerarmor/helmet
var/offlineslowdown = 4 //How slow you go when its powered off
var/obj/item/stock_parts/cell/cell = new/obj/item/stock_parts/cell/upgraded/plus //Power source used to power said armor, 5000 charge default
var/putondelay = 120 //To prevent lugging this armor and putting it on instantly when combat happens; gotta have it on you
var/energydrain = 25 //default drain of energy per 2 seconds
var/offline = 0 //If it's offline

/obj/item/clothing/suit/space/hardsuit/powerarmor/Initialize()
..()
START_PROCESSING(SSobj, src)

/obj/item/clothing/suit/space/hardsuit/powerarmor/Destroy()
STOP_PROCESSING(SSobj, src)
..()

/obj/item/clothing/head/helmet/space/hardsuit/powerarmor/Initialize()
..()
START_PROCESSING(SSobj, src)

/obj/item/clothing/head/helmet/space/hardsuit/powerarmor/Destroy()
STOP_PROCESSING(SSobj, src)
..()

/obj/item/clothing/head/helmet/space/hardsuit/powerarmor/process()
if(suit)
var/obj/item/clothing/suit/space/hardsuit/powerarmor/armor = suit
if(armor.cell.charge == 0)
if(!offline)
offline = TRUE
tint = offlinetint
else
return
else
if(offline)
tint = initial(tint)
offline = FALSE

/obj/item/clothing/suit/space/hardsuit/powerarmor/process()
if(cell)
if(!(cell.use(energydrain)))
if(!offline)
offline = TRUE
slowdown = offlineslowdown
playsound(src, 'sound/weapons/saberoff.ogg', 35, 1)
visible_message("The [src.name] suddenly runs out of power!", "The hardsuit runs out of power, that can't be good.")
else
if(offline) //Used power but it's offline; turn it on
offline = FALSE
slowdown = initial(slowdown)
playsound(src, 'sound/weapons/saberoff.ogg', 35, 1)
visible_message("The [name] suddenly powers back up!", "The hardsuit gets back up and running, that's pretty good.")
if(offline) //TODO; ASK FOR SPRITES THAT LIGHT UP WHEN POWERED
return
else
slowdown = initial(slowdown)

/obj/item/clothing/suit/space/hardsuit/powerarmor/item_action_slot_check(slot)
if(cell.charge == 0) //Power is ded; no use
return FALSE
else
return TRUE //Thing is powered; give the cool stuff

/obj/item/clothing/head/helmet/space/hardsuit/powerarmor/item_action_slot_check(slot)
if(offline)
return FALSE
else
return TRUE


/obj/item/clothing/suit/space/hardsuit/powerarmor/AltClick(mob/user)
if(cell && user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
if(!(user.put_in_hands(cell)))
to_chat(user, "Your hands are currently occupied and you can't take out the powercell!")
return
else
to_chat(user,"You take the powercell out of the power armor, turning off the powerarmor.")
cell = null //Power cell no longer in the dang armor
return

/obj/item/clothing/suit/space/hardsuit/powerarmor/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/stock_parts/cell))
var/obj/item/stock_parts/cell/cell2 = I
if(cell) //Swap
cell2.forceMove(src)
user.put_in_hands(cell)
cell = cell2
to_chat(user, "You swap out the cells in the [name].")
else //Put in if there's no cell
cell2.forceMove(src)
cell = cell2
to_chat(user, "You insert a cell into the [name].")

/obj/item/clothing/suit/space/hardsuit/powerarmor/mob_can_equip(mob/living/carbon/human/user, slot)
if(src == user.wear_suit) //Suit is already equipped; stops message spam
return FALSE //Do it quietly
if (ishuman(user))
var/mob/living/carbon/human/H = user
if ((!H.mind.martial_art && H.mind.martial_art.name != "Power Armor Training") && ispowerarmor)
to_chat(H, "<span class='warning'>You don't have the proper training to operate the power armor!</span>")
return FALSE
else
to_chat(H, "<span class='notice'>You start to put on the [src.name]...</span>")
if(do_after(user, putondelay, target = src))
user.equip_to_slot(src, SLOT_WEAR_SUIT) //say it with me; hardcored slots
to_chat(H, "<span class='notice'>You put on the [src.name]! Ready to rock and roll.</span>")
return FALSE //Already equipped the armor; don't want the armor being equipped to another slot
else
to_chat(H, "<span class='warning'>You somehow failed to put on the [src.name].</span>")
return FALSE
return FALSE

/obj/item/clothing/head/helmet/space/hardsuit/powerarmor/t45b
name = "Salvaged T-45b helmet"
desc = "It's a pre-War power armor helmet, recovered and maintained by NCR engineers."
icon_state = "t45bhelmet"
item_state = "t45bhelmet"
armor = list("melee" = 50, "bullet" = 48, "laser" = 25, "energy" = 25, "bomb" = 48, "bio" = 100, "rad" = 50, "fire" = 50, "acid" = 0)

/obj/item/clothing/suit/space/hardsuit/powerarmor/t45b
ispowerarmor = 0
name = "Salvaged T-45b power armor"
desc = "It's a set of T-45b power armor recovered by the NCR during the NCR-Brotherhood War.<br>NCR technicians have restored it to working order by replacing the back-mounted cylinders with a custom air conditioning module and stripping out the joint servomotors."
icon_state = "t45bpowerarmor"
item_state = "t45bpowerarmor"
armor = list("melee" = 50, "bullet" = 48, "laser" = 25, "energy" = 25, "bomb" = 48, "bio" = 0, "rad" = 0, "fire" = 0, "acid" = 0)
helmettype = /obj/item/clothing/head/helmet/space/hardsuit/powerarmor/t45b

/obj/item/clothing/head/helmet/space/hardsuit/powerarmor/t45d
name = "T-45d power helmet"
desc = "It's an old pre-War power armor helmet. It's pretty hot inside of it."
icon_state = "t45dhelmet"
item_state = "t45dhelmet"
armor = list("melee" = 68, "bullet" = 62, "laser" = 39, "energy" = 39, "bomb" = 62, "bio" = 100, "rad" = 60, "fire" = 50, "acid" = 0)

/obj/item/clothing/suit/space/hardsuit/powerarmor/t45d
name = "T-45d power armor"
desc = "Originally developed and manufactured for the United States Army by American defense contractor West Tek, the T-45d power armor was the first version of power armor to be successfully deployed in battle."
icon_state = "t45dpowerarmor"
item_state = "t45dpowerarmor"
armor = list("melee" = 68, "bullet" = 62, "laser" = 39, "energy" = 39, "bomb" = 62, "bio" = 100, "rad" = 60, "fire" = 0, "acid" = 0)
helmettype = /obj/item/clothing/head/helmet/space/hardsuit/powerarmor/t45d

/obj/item/clothing/head/helmet/space/hardsuit/powerarmor/advanced
name = "Advanced power helmet"
desc = "It's an advanced power armor Mk I helmet, typically used by the Enclave. It looks somewhat threatening."
icon_state = "advhelmet1"
item_state = "advhelmet1"
armor = list("melee" = 72, "bullet" = 72, "laser" = 48,"energy" = 48, "bomb" = 72, "bio" = 100,"rad" = 100, "fire" = 50, "acid" = 0)

/obj/item/clothing/suit/space/hardsuit/powerarmor/advanced
name = "Advanced power armor"
desc = "An advanced suit of armor typically used by the Enclave.<br>It is composed of lightweight metal alloys, reinforced with ceramic castings at key stress points.<br>Additionally, like the T-51b power armor, it includes a recycling system that can convert human waste into drinkable water, and an air conditioning system for it's user's comfort."
icon_state = "advpowerarmor1"
item_state = "advpowerarmor1"
armor = list("melee" = 72, "bullet" = 72, "laser" = 48, "energy" = 48, "bomb" = 72, "bio" = 100, "rad" = 100, "fire" = 0, "acid" = 0)
helmettype = /obj/item/clothing/head/helmet/space/hardsuit/powerarmor/advanced

/obj/item/clothing/head/helmet/space/hardsuit/powerarmor/mk2
name = "Advanced power helmet MKII"
desc = "It's an improved model of advanced power armor used exclusively by the Enclave military forces, developed after the Great War.<br>Like its older brother, the standard advanced power armor, it's matte black with a menacing appearance, but with a few significant differences - it appears to be composed entirely of lightweight ceramic composites rather than the usual combination of metal and ceramic plates.<br>Additionally, like the T-51b power armor, it includes a recycling system that can convert human waste into drinkable water, and an air conditioning system for it's user's comfort."
icon_state = "advhelmet2"
item_state = "advhelmet2"
armor = list("melee" = 72, "bullet" = 72, "laser" = 48, "energy" = 48, "bomb" = 72, "bio" = 100, "rad" = 100, "fire" = 50, "acid" = 0)

/obj/item/clothing/suit/space/hardsuit/powerarmor/advanced/mk2
name = "Advanced power armor MKII"
desc = "It's an improved model of advanced power armor used exclusively by the Enclave military forces, developed after the Great War.<br>Like its older brother, the standard advanced power armor, it's matte black with a menacing appearance, but with a few significant differences - it appears to be composed entirely of lightweight ceramic composites rather than the usual combination of metal and ceramic plates.<br>Additionally, like the T-51b power armor, it includes a recycling system that can convert human waste into drinkable water, and an air conditioning system for it's user's comfort."
icon_state = "advpowerarmor2"
item_state = "advpowerarmor2"
body_parts_covered = CHEST|GROIN|LEGS|FEET|ARMS
armor = list("melee" = 72, "bullet" = 72, "laser" = 48, "energy" = 48, "bomb" = 72, "bio" = 100, "rad" = 100, "fire" = 0, "acid" = 0)
helmettype = /obj/item/clothing/head/helmet/space/hardsuit/powerarmor/mk2

/obj/item/clothing/head/helmet/space/hardsuit/powerarmor/tesla
name = "tesla power helmet"
desc = "A helmet typically used by Enclave special forces.<br>There are three orange energy capacitors on the side."
icon_state = "tesla"
item_state = "tesla"
armor = list("melee" = 68, "bullet" = 62, "laser" = 80, "energy" = 80, "bomb" = 62, "bio" = 100, "rad" = 100, "fire" = 50, "acid" = 0)

/obj/item/clothing/suit/space/hardsuit/powerarmor/tesla
name = "tesla power armor"
desc = "A variant of the Enclave's advanced power armor Mk I, jury-rigged with a Tesla device that is capable of dispersing a large percentage of the damage done by directed-energy attacks.<br>As it's made of complex composite materials designed to block most of energy damage - it's notably weaker against kinetic impacts."
icon_state = "tesla"
item_state = "tesla"
armor = list("melee" = 68, "bullet" = 62, "laser" = 80, "energy" = 80, "bomb" = 62, "bio" = 100, "rad" = 100, "fire" = 0, "acid" = 0)
helmettype = /obj/item/clothing/head/helmet/space/hardsuit/powerarmor/tesla

/obj/item/clothing/head/helmet/space/hardsuit/powerarmor/t51b
name = "T-51b power helmet"
desc = "It's a t51b power helmet, typically used by the Brotherhood. It looks somewhat charming."
icon_state = "t51bhelmet"
item_state = "t51bhelmet"
armor = list("melee" = 68, "bullet" = 62, "laser" = 39, "energy" = 39, "bomb" = 62, "bio" = 100, "rad" = 100, "fire" = 50, "acid" = 0)

/obj/item/clothing/suit/space/hardsuit/powerarmor/t51b
name = "T-51b power armor"
desc = "The pinnacle of pre-war technology. This suit of power armor provides substantial protection to the wearer."
icon_state = "t51bpowerarmor"
item_state = "t51bpowerarmor"
armor = list("melee" = 68, "bullet" = 62, "laser" = 39, "energy" = 39, "bomb" = 62, "bio" = 100, "rad" = 100, "fire" = 0, "acid" = 0)
helmettype = /obj/item/clothing/head/helmet/space/hardsuit/powerarmor/t51b

0 comments on commit 2fb6ec5

Please sign in to comment.