Files
Aurora.3/code/game/objects/structures/tank_dispenser.dm
Alberyk 76b743a986 Adds the Aut'akh unathi (#5919)
* Base work for the unathi robot subspecies.

* Adds metabolism species, kidney vars, and the robot unathi organs.

* Moves some action buttons to organs, pretty much a bay port right now. Todo: the unathi and alien stuff should also go here.

* First autakh implant power.

* Fixes the organs action button this time.

* Finishes more implants, and interactions with flashs and vaurca.

* Prepare for great changes.

* Drops the real bomb, boss.

* He who fights with monsters.

* Far more work into augments and limb removing powers.

* Limb verbs should be good now.

* A LOT of work into the assited organ, allowing it to bleed and etc, as well adding a new chem that will stop bleeding in their case.

* Probably the last work on implants.

* Some extra touches.

* Some tweaks to the species.

* More fixes and adds kyre's sprites.

* More runtime fixes.

* Fixes the species name too.

* Fixes travis.

* Updates this file too to work with the new tools procs.

* Adds changelog

* Fixed changelog.

* Unathi hair and lore description.

* Some tweaks to this too.

* Locks away them for now, they will be released after we got all the events and etc done.

* Changes this chemical.

* Fixes an airlock runtime.

* Adds the non scan flag to the autakh, mostly due to some bizzare interactions with changelings and cloning.

* Organs removal changes; can't take out the organ if it is too damage.

* Restricts them back again.

* Robotic organs now have the proper icons and names.

* Adds sprites for their organs and some extra tweaks.

* Fixes this missing icon.

* emp should also now hurt assited organs.

* Tweaks more organ related things.

* Fixes the head not being properly set as well.

* Fixes their flags.

* fixes the flag for real this time.

* Poze's review.

* Changes the au'takh organ buttons to don't be animated.

* Helps with adminbus or something.

* Fowl's requested changes.

* Fixes a typo.

* Robotic limb's brute and burn mods are now controlled by the limb model.

* Fowl's changes once more.

* Stops some spam.

* More grammar.

* No eal.

* Skull's review.
2019-01-23 19:27:44 +01:00

121 lines
3.4 KiB
Plaintext

/obj/structure/dispenser
name = "tank storage unit"
desc = "A simple yet bulky storage device for gas tanks. Has room for up to ten oxygen tanks, and ten phoron tanks."
icon = 'icons/obj/objects.dmi'
icon_state = "dispenser"
density = 1
anchored = 1.0
w_class = 5
var/oxygentanks = 10
var/phorontanks = 10
var/list/oxytanks = list() //sorry for the similar var names
var/list/platanks = list()
/obj/structure/dispenser/oxygen
phorontanks = 0
/obj/structure/dispenser/phoron
oxygentanks = 0
/obj/structure/dispenser/Initialize()
. = ..()
update_icon()
/obj/structure/dispenser/update_icon()
cut_overlays()
switch(oxygentanks)
if(1 to 3)
add_overlay("oxygen-[oxygentanks]")
if(4 to INFINITY)
add_overlay("oxygen-4")
switch(phorontanks)
if(1 to 4)
add_overlay("phoron-[phorontanks]")
if(5 to INFINITY)
add_overlay("phoron-5")
/obj/structure/dispenser/attack_ai(mob/user as mob)
if(user.Adjacent(src))
return attack_hand(user)
..()
/obj/structure/dispenser/attack_hand(mob/user as mob)
user.set_machine(src)
var/dat = "[src]<br><br>"
dat += "Oxygen tanks: [oxygentanks] - [oxygentanks ? "<A href='?src=\ref[src];oxygen=1'>Dispense</A>" : "empty"]<br>"
dat += "Phoron tanks: [phorontanks] - [phorontanks ? "<A href='?src=\ref[src];phoron=1'>Dispense</A>" : "empty"]"
user << browse(dat, "window=dispenser")
onclose(user, "dispenser")
return
/obj/structure/dispenser/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, /obj/item/weapon/tank/oxygen) || istype(I, /obj/item/weapon/tank/air) || istype(I, /obj/item/weapon/tank/anesthetic))
if(oxygentanks < 10)
user.drop_from_inventory(I,src)
oxytanks.Add(I)
oxygentanks++
user << "<span class='notice'>You put [I] in [src].</span>"
if(oxygentanks < 5)
update_icon()
else
user << "<span class='notice'>[src] is full.</span>"
updateUsrDialog()
return
if(istype(I, /obj/item/weapon/tank/phoron))
if(phorontanks < 10)
user.drop_from_inventory(I,src)
platanks.Add(I)
phorontanks++
user << "<span class='notice'>You put [I] in [src].</span>"
if(oxygentanks < 6)
update_icon()
else
user << "<span class='notice'>[src] is full.</span>"
updateUsrDialog()
return
if(I.iswrench())
if(anchored)
user << "<span class='notice'>You lean down and unwrench [src].</span>"
anchored = 0
else
user << "<span class='notice'>You wrench [src] into place.</span>"
anchored = 1
return
/obj/structure/dispenser/Topic(href, href_list)
if(usr.stat || usr.restrained())
return
if(Adjacent(usr))
usr.set_machine(src)
if(href_list["oxygen"])
if(oxygentanks > 0)
var/obj/item/weapon/tank/oxygen/O
if(oxytanks.len == oxygentanks)
O = oxytanks[1]
oxytanks.Remove(O)
else
O = new /obj/item/weapon/tank/oxygen(loc)
O.forceMove(loc)
usr << "<span class='notice'>You take [O] out of [src].</span>"
oxygentanks--
update_icon()
if(href_list["phoron"])
if(phorontanks > 0)
var/obj/item/weapon/tank/phoron/P
if(platanks.len == phorontanks)
P = platanks[1]
platanks.Remove(P)
else
P = new /obj/item/weapon/tank/phoron(loc)
P.forceMove(loc)
usr << "<span class='notice'>You take [P] out of [src].</span>"
phorontanks--
update_icon()
add_fingerprint(usr)
updateUsrDialog()
else
usr << browse(null, "window=dispenser")
return
return