mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
cl Qustinnus / Floyd / Ethereal sprites by Space, is that it? / Alerts and food sprites by MrDroppodBringer
add: Adds Ethereal; a race which lives off of electricity and shines bright. If they are healthy they shine a bright green light, and the more damaged they are, the less they shine and the greyer they become. Their punches do burn damage and they are weak to blunt attacks!
They dont need to eat normal food and dont have nutrition, Instead they gain charge by going into borg rechargers, eating ethereal food or doign specific interactions.
refactor: all nutrition changes now go through a proc so we can override behavior
/cl
Adds Ethereal. A race which is essentialy inspired by Zoltan but then with different mechanics to make it fit with SS13 more. I'm trying to stay away from making them actually provide power but the change from nutrition to electricity seemed kind of fun.
They have the following specifications:
They are walking lights; and shine bright and green if healthy, and get greyer and darker the more damaged they are. When dead they are just a grey unlit corpse.
They do burn punch damage instead of blunt.
They are weaker to blunt; especially when low on charge
They have charge instead of nutrition. Charge is gained by some interactions or by going into a borg charger. or eating new ethereal food.
They are slightly stronger to shock damage, and gain charge from it a bit; however, it is still deadly to them and thus they aren't free insulated gloves.
128 lines
3.6 KiB
Plaintext
128 lines
3.6 KiB
Plaintext
/obj/machinery/recharge_station
|
|
name = "cyborg recharging station"
|
|
desc = "This device recharges cyborgs and resupplies them with materials."
|
|
icon = 'icons/obj/objects.dmi'
|
|
icon_state = "borgcharger0"
|
|
density = FALSE
|
|
use_power = IDLE_POWER_USE
|
|
idle_power_usage = 5
|
|
active_power_usage = 1000
|
|
req_access = list(ACCESS_ROBOTICS)
|
|
state_open = TRUE
|
|
circuit = /obj/item/circuitboard/machine/cyborgrecharger
|
|
occupant_typecache = list(/mob/living/silicon/robot, /mob/living/carbon/human)
|
|
var/recharge_speed
|
|
var/repairs
|
|
|
|
/obj/machinery/recharge_station/Initialize()
|
|
. = ..()
|
|
update_icon()
|
|
|
|
/obj/machinery/recharge_station/RefreshParts()
|
|
recharge_speed = 0
|
|
repairs = 0
|
|
for(var/obj/item/stock_parts/capacitor/C in component_parts)
|
|
recharge_speed += C.rating * 100
|
|
for(var/obj/item/stock_parts/manipulator/M in component_parts)
|
|
repairs += M.rating - 1
|
|
for(var/obj/item/stock_parts/cell/C in component_parts)
|
|
recharge_speed *= C.maxcharge / 10000
|
|
|
|
/obj/machinery/recharge_station/examine(mob/user)
|
|
..()
|
|
if(in_range(user, src) || isobserver(user))
|
|
to_chat(user, "<span class='notice'>The status display reads: Recharging <b>[recharge_speed]J</b> per cycle.<span>")
|
|
if(repairs)
|
|
to_chat(user, "<span class='notice'>[src] has been upgraded to support automatic repairs.<span>")
|
|
|
|
/obj/machinery/recharge_station/process()
|
|
if(!is_operational())
|
|
return
|
|
|
|
if(occupant)
|
|
process_occupant()
|
|
return 1
|
|
|
|
/obj/machinery/recharge_station/relaymove(mob/user)
|
|
if(user.stat)
|
|
return
|
|
open_machine()
|
|
|
|
/obj/machinery/recharge_station/emp_act(severity)
|
|
. = ..()
|
|
if(!(stat & (BROKEN|NOPOWER)))
|
|
if(occupant && !(. & EMP_PROTECT_CONTENTS))
|
|
occupant.emp_act(severity)
|
|
if (!(. & EMP_PROTECT_SELF))
|
|
open_machine()
|
|
|
|
/obj/machinery/recharge_station/attackby(obj/item/P, mob/user, params)
|
|
if(state_open)
|
|
if(default_deconstruction_screwdriver(user, "borgdecon2", "borgcharger0", P))
|
|
return
|
|
|
|
if(default_pry_open(P))
|
|
return
|
|
|
|
if(default_deconstruction_crowbar(P))
|
|
return
|
|
return ..()
|
|
|
|
/obj/machinery/recharge_station/interact(mob/user)
|
|
toggle_open()
|
|
return TRUE
|
|
|
|
/obj/machinery/recharge_station/proc/toggle_open()
|
|
if(state_open)
|
|
close_machine()
|
|
else
|
|
open_machine()
|
|
|
|
/obj/machinery/recharge_station/open_machine()
|
|
. = ..()
|
|
if(iscyborg(occupant) || isethereal(occupant))
|
|
use_power = IDLE_POWER_USE
|
|
|
|
/obj/machinery/recharge_station/close_machine()
|
|
. = ..()
|
|
if(occupant)
|
|
if(iscyborg(occupant) || isethereal(occupant))
|
|
use_power = ACTIVE_POWER_USE
|
|
add_fingerprint(occupant)
|
|
|
|
/obj/machinery/recharge_station/update_icon()
|
|
if(is_operational())
|
|
if(state_open)
|
|
icon_state = "borgcharger0"
|
|
else
|
|
icon_state = (occupant ? "borgcharger1" : "borgcharger2")
|
|
else
|
|
icon_state = (state_open ? "borgcharger-u0" : "borgcharger-u1")
|
|
|
|
/obj/machinery/recharge_station/power_change()
|
|
..()
|
|
update_icon()
|
|
|
|
/obj/machinery/recharge_station/proc/process_occupant()
|
|
if(!occupant)
|
|
return
|
|
if(iscyborg(occupant))
|
|
var/mob/living/silicon/robot/R = occupant
|
|
restock_modules()
|
|
if(repairs)
|
|
R.heal_bodypart_damage(repairs, repairs - 1)
|
|
if(R.cell)
|
|
R.cell.charge = min(R.cell.charge + recharge_speed, R.cell.maxcharge)
|
|
if(isethereal(occupant))
|
|
var/mob/living/carbon/human/H = occupant
|
|
var/datum/species/ethereal/E = H.dna?.species
|
|
if(E)
|
|
E.adjust_charge(recharge_speed / 70) //Around 3 per process if unupgraded
|
|
|
|
/obj/machinery/recharge_station/proc/restock_modules()
|
|
if(occupant)
|
|
var/mob/living/silicon/robot/R = occupant
|
|
if(R && R.module)
|
|
var/coeff = recharge_speed * 0.005
|
|
R.module.respawn_consumable(R, coeff)
|