mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
SecBorgDisabler
This commit is contained in:
@@ -158,11 +158,41 @@
|
||||
|
||||
/obj/item/weapon/gun/energy/disabler
|
||||
name = "disabler"
|
||||
desc = "An integrated hybrid taser that draws directly from a cyborg's power cell. The weapon contains a limiter to prevent the cyborg's power cell from overheating."
|
||||
var/charge_tick = 0
|
||||
var/recharge_time = 10
|
||||
|
||||
/obj/item/weapon/gun/energy/disabler/cyborg
|
||||
name = "cyborg disabler"
|
||||
desc = "A self-defense weapon that exhausts organic targets, weakening them until they collapse."
|
||||
icon_state = "disabler"
|
||||
item_state = null
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/disabler)
|
||||
|
||||
/obj/item/weapon/gun/energy/disabler/cyborg/New()
|
||||
..()
|
||||
SSobj.processing.Add(src)
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/disabler/cyborg/Destroy()
|
||||
SSobj.processing.Remove(src)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/gun/energy/disabler/cyborg/process() //Every [recharge_time] ticks, recharge a shot for the cyborg
|
||||
charge_tick++
|
||||
if(charge_tick < recharge_time) return 0
|
||||
charge_tick = 0
|
||||
|
||||
if(!power_supply) return 0 //sanity
|
||||
if(isrobot(src.loc))
|
||||
var/mob/living/silicon/robot/R = src.loc
|
||||
if(R && R.cell)
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select] //Necessary to find cost of shot
|
||||
if(R.cell.use(shot.e_cost)) //Take power from the borg...
|
||||
power_supply.give(shot.e_cost) //... to recharge the shot
|
||||
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/gun/energy/wormhole_projector
|
||||
name = "bluespace wormhole projector"
|
||||
|
||||
Reference in New Issue
Block a user