Skip to content

Commit

Permalink
Finally got around to working on that power armor overhaul I'd told m…
Browse files Browse the repository at this point in the history
…yself I was gonna do.

tl;dr is that instead of being a single object, power armor now has component objects, which determine how good it is at things. They are still a work in progress, lacking a way to actually construct them and such. That said, there are adminspawnable sets. One is more or less what the old power armor was, sans a runtime error that was causing it to be immune to everything, the other is an adminbus set that is genuinely immune to everything.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2023 316c924e-a436-60f5-8080-3fe189b3f50e
  • Loading branch information
n3ophyt3 committed Aug 19, 2011
1 parent 66b3a71 commit d867f56
Show file tree
Hide file tree
Showing 4 changed files with 541 additions and 178 deletions.
178 changes: 0 additions & 178 deletions code/game/objects/items/clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -371,182 +371,4 @@ THERMAL GLASSES
M.disabilities &= ~1
..()

/obj/item/clothing/suit/armor/powered
name = "Powered armor"
desc = "Not for rookies."
icon_state = "swat"
item_state = "swat"
w_class = 4//bulky item
gas_transfer_coefficient = 0.01
permeability_coefficient = 0.02
heat_transfer_coefficient = 0.02
radiation_protection = 0.25
protective_temperature = 1000
flags = FPRINT | TABLEPASS
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS
armor = list(melee = 40, bullet = 30, laser = 20, taser = 15, bomb = 25, bio = 10, rad = 10)
allowed = list(/obj/item/device/flashlight,/obj/item/weapon/gun,/obj/item/weapon/melee/baton,/obj/item/weapon/handcuffs,/obj/item/weapon/tank/emergency_oxygen)
slowdown = 9
var/fuel = 0
var/list/togglearmor = list(melee = 90, bullet = 70, laser = 60, taser = 40, bomb = 75, bio = 75, rad = 75)
var/active = 0
var/obj/item/clothing/head/helmet/powered/helm = null

New()
verbs += /obj/item/clothing/suit/armor/powered/proc/poweron

proc/poweron()
set category = "Object"
set name = "Activate armor systems"

var/mob/living/carbon/human/user = usr

if(user.stat)
return //if you're unconscious or dead, no dicking with your armor. --NEO

if(!istype(user))
user << "\red This suit was engineered for human use only."
return

if(user.wear_suit!=src)
user << "\red The suit functions best if you are inside of it."
return

if(!istype(user.head, /obj/item/clothing/head/helmet/powered))
user << "\red Helmet missing, unable to initiate power-on procedure."
return

if(active)
user << "\red The suit is already on, you can't turn it on twice."
return

if(fuel < 1)
user << "\red Insufficient fuel."
return

verbs -= /obj/item/clothing/suit/armor/powered/proc/poweron

user << "\blue Suit interlocks engaged."
helm = user.head
helm.canremove = 0
canremove = 0
sleep(20)

user << "\blue Atmospheric seals engaged."
flags |= SUITSPACE
helm.flags |= HEADSPACE
sleep(20)

user << "\blue Reactive armor systems engaged."
var/list/switchover = list()
for (var/armorvar in togglearmor)
switchover[armorvar] = "[togglearmor[armorvar]]"
togglearmor[armorvar] = "[armor[armorvar]]"
armor[armorvar] = "[switchover[armorvar]]"
helm.armor[armorvar] = armor[armorvar]
sleep(20)

user << "\blue Movement assist servos engaged."
slowdown = 2.5
sleep(20)

user << "\blue All systems online."
active = 1
powered()
verbs += /obj/item/clothing/suit/armor/powered/proc/poweroff


proc/poweroff()
set category = "Object"
set name = "Deactivate armor systems"
powerdown() //BYOND doesn't seem to like it if you try using a proc with vars in it as a verb, hence this. --NEO

proc/powerdown(sudden = 0)

var/delay = sudden?0:20

var/mob/living/carbon/human/user = usr

if(user.stat && !sudden)
return //if you're unconscious or dead, no dicking with your armor. --NEO

if(!active)
return

verbs -= /obj/item/clothing/suit/armor/powered/proc/poweroff

if(sudden)
user << "\red Your armor loses power!"

if(!sudden)
user << "\blue Movement assist servos disengaged."
slowdown = 9
sleep(delay)


if(!sudden)
user << "\blue Reactive armor systems disengaged."
var/list/switchover = list()
for (var/armorvar in armor)
switchover[armorvar] = "[togglearmor[armorvar]]"
togglearmor[armorvar] = "[armor[armorvar]]"
armor[armorvar] = "[switchover[armorvar]]"
helm.armor[armorvar] = armor[armorvar]
sleep(delay)

if(!sudden)
user << "\blue Atmospheric seals disengaged."
flags &= ~SUITSPACE
helm.flags &= ~HEADSPACE
sleep(delay)

if(!sudden)
user << "\blue Suit interlocks disengaged."
helm.canremove = 1
canremove = 1
helm = null
//Not a tabbing error, the thing only unlocks if you intentionally power-down the armor. --NEO
sleep(20)

if(!sudden)
user << "\blue All systems disengaged."
active = 0


verbs += /obj/item/clothing/suit/armor/powered/proc/poweron

proc/powered()
if (fuel > 0 && active)
fuel--
spawn(50)
powered()
return
else if (active)
powerdown(1)
return

attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/stack/sheet/plasma))
if(fuel < 50)
user << "\blue You feed some plasma into the armor's generator."
fuel += 25
W:amount--
if (W:amount <= 0)
del(W)
return
else
user << "\red The generator already has plenty of plasma."
return
else
..()


/obj/item/clothing/head/helmet/powered
name = "Powered armor helmet"
icon_state = "swat"
desc = "Not for rookies."
flags = FPRINT | TABLEPASS | HEADCOVERSEYES | HEADCOVERSMOUTH
see_face = 0.0
item_state = "swat"
permeability_coefficient = 0.01
armor = list(melee = 40, bullet = 30, laser = 20, taser = 15, bomb = 25, bio = 10, rad = 10)
Loading

0 comments on commit d867f56

Please sign in to comment.