Files
Aurora.3/code/modules/power/pacman2.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

170 lines
4.9 KiB
Plaintext

//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:05
//PACMAN variant that can run on the small plasma tanks.
/obj/machinery/power/port_gen/pacman2
name = "Pacman II"
desc = "P.A.C.M.A.N. type II portable generator. Uses liquid phoron as a fuel source."
power_gen = 4500
var/obj/item/weapon/tank/phoron/P = null
var/board_path = "/obj/item/weapon/circuitboard/pacman2"
var/emagged = 0
var/heat = 0
/*
process()
if(P)
if(P.air_contents.phoron <= 0)
P.air_contents.phoron = 0
eject()
else
P.air_contents.phoron -= 0.001
return
*/
HasFuel()
if(P.air_contents.phoron >= 0.1)
return 1
return 0
UseFuel()
P.air_contents.phoron -= 0.01
return
setup_components()
. = list(
new /obj/item/weapon/stock_parts/matter_bin(src),
new /obj/item/weapon/stock_parts/micro_laser(src),
new /obj/item/stack/cable_coil(src),
new /obj/item/stack/cable_coil(src),
new /obj/item/weapon/stock_parts/capacitor(src),
new board_path(src)
)
RefreshParts()
var/temp_rating = 0
for(var/obj/item/weapon/stock_parts/SP in component_parts)
if(istype(SP, /obj/item/weapon/stock_parts/matter_bin))
//max_coins = SP.rating * SP.rating * 1000
else if(istype(SP, /obj/item/weapon/stock_parts/micro_laser) || istype(SP, /obj/item/weapon/stock_parts/capacitor))
temp_rating += SP.rating
power_gen = round(initial(power_gen) * (max(2, temp_rating) / 2))
examine(mob/user)
..(user)
user << "<span class='notice'>The generator has [P.air_contents.phoron] units of fuel left, producing [power_gen] per cycle.</span>"
handleInactive()
heat -= 2
if (heat < 0)
heat = 0
else
for(var/mob/M in viewers(1, src))
if (M.client && M.machine == src)
src.updateUsrDialog()
proc
overheat()
explosion(get_turf(src), 2, 5, 2, -1)
attackby(var/obj/item/O as obj, var/mob/user as mob)
if(istype(O, /obj/item/weapon/tank/phoron))
if(P)
user << "<span class='warning'>The generator already has a phoron tank loaded!</span>"
return
P = O
user.drop_from_inventory(O,src)
user << "<span class='notice'>You add the phoron tank to the generator.</span>"
else if(!active)
if(O.iswrench())
anchored = !anchored
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
if(anchored)
user << "<span class='notice'>You secure the generator to the floor.</span>"
else
user << "<span class='notice'>You unsecure the generator from the floor.</span>"
SSmachinery.powernet_update_queued = TRUE
else if(O.isscrewdriver())
open = !open
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
if(open)
user << "<span class='notice'>You open the access panel.</span>"
else
user << "<span class='notice'>You close the access panel.</span>"
else if(O.iscrowbar() && !open)
var/obj/machinery/constructable_frame/machine_frame/new_frame = new /obj/machinery/constructable_frame/machine_frame(src.loc)
for(var/obj/item/I in component_parts)
I.forceMove(src.loc)
new_frame.state = 2
new_frame.icon_state = "box_1"
qdel(src)
attack_hand(mob/user as mob)
..()
if (!anchored)
return
interact(user)
attack_ai(mob/user as mob)
interact(user)
attack_paw(mob/user as mob)
interact(user)
proc
interact(mob/user)
if (get_dist(src, user) > 1 )
if (!istype(user, /mob/living/silicon/ai))
user.machine = null
user << browse(null, "window=port_gen")
return
user.machine = src
var/dat = text("<b>[name]</b><br>")
if (active)
dat += text("Generator: <A href='?src=\ref[src];action=disable'>On</A><br>")
else
dat += text("Generator: <A href='?src=\ref[src];action=enable'>Off</A><br>")
if(P)
dat += text("Currently loaded phoron tank: [P.air_contents.phoron]<br>")
else
dat += text("No phoron tank currently loaded.<br>")
dat += text("Power output: <A href='?src=\ref[src];action=lower_power'>-</A> [power_gen * power_output] <A href='?src=\ref[src];action=higher_power'>+</A><br>")
dat += text("Heat: [heat]<br>")
dat += "<br><A href='?src=\ref[src];action=close'>Close</A>"
user << browse("[dat]", "window=port_gen")
Topic(href, href_list)
if(..())
return
src.add_fingerprint(usr)
if(href_list["action"])
if(href_list["action"] == "enable")
if(!active && HasFuel())
active = 1
icon_state = "portgen1"
src.updateUsrDialog()
if(href_list["action"] == "disable")
if (active)
active = 0
icon_state = "portgen0"
src.updateUsrDialog()
if(href_list["action"] == "lower_power")
if (power_output > 1)
power_output--
src.updateUsrDialog()
if (href_list["action"] == "higher_power")
if (power_output < 4 || emagged)
power_output++
src.updateUsrDialog()
if (href_list["action"] == "close")
usr << browse(null, "window=port_gen")
usr.machine = null
/obj/machinery/power/port_gen/pacman2/emag_act(var/remaining_uses, var/mob/user)
emagged = 1
emp_act(1)
return 1