forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stun.dm
56 lines (46 loc) · 2.13 KB
/
stun.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/obj/item/weapon/gun/energy/taser
name = "taser gun"
desc = "A low-capacity, energy-based stun gun used by security teams to subdue targets at range."
icon_state = "taser"
item_state = null //so the human update icon uses the icon_state instead.
ammo_type = list(/obj/item/ammo_casing/energy/electrode)
/obj/item/weapon/gun/energy/stunrevolver
name = "stun revolver"
desc = "A high-tech revolver that fires internal, reusable stun cartidges in a revolving cylinder. Holds twice as many electrodes as a standard taser."
icon_state = "stunrevolver"
origin_tech = "combat=3;materials=3;powerstorage=2"
ammo_type = list(/obj/item/ammo_casing/energy/electrode/gun)
can_flashlight = 0
pin = null
/obj/item/weapon/gun/energy/gun/advtaser
name = "hybrid taser"
desc = "A dual-mode taser designed to fire both short-range high-power electrodes and long-range disabler beams."
icon_state = "advtaser"
ammo_type = list(/obj/item/ammo_casing/energy/electrode, /obj/item/ammo_casing/energy/disabler)
cell_type = "/obj/item/weapon/stock_parts/cell/crap"
origin_tech = null
/obj/item/weapon/gun/energy/gun/advtaser/cyborg
name = "cyborg taser"
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
can_flashlight = 0
/obj/item/weapon/gun/energy/gun/advtaser/cyborg/New()
..()
SSobj.processing.Add(src)
/obj/item/weapon/gun/energy/gun/advtaser/cyborg/Destroy()
SSobj.processing.Remove(src)
..()
/obj/item/weapon/gun/energy/gun/advtaser/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