mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 05:30:05 +01:00
Merge pull request #7479 from paprka/batonshit
Makes batons slowly lose charge when left on
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
var/status = 0
|
||||
var/obj/item/weapon/stock_parts/cell/high/bcell = null
|
||||
var/hitcost = 1000
|
||||
var/losspertick = 5
|
||||
|
||||
/obj/item/weapon/melee/baton/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is putting the live [name] in \his mouth! It looks like \he's trying to commit suicide.</span>")
|
||||
@@ -44,6 +45,25 @@
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/item/weapon/melee/baton/proc/update_process()
|
||||
if(status)
|
||||
SSobj.processing |= src
|
||||
else
|
||||
SSobj.processing.Remove(src)
|
||||
|
||||
/obj/item/weapon/melee/baton/process()
|
||||
if(bcell)
|
||||
if(bcell.charge < hitcost)
|
||||
status = 0
|
||||
update_icon()
|
||||
if(status)
|
||||
if(isrobot(loc))
|
||||
var/mob/living/silicon/robot/R = loc
|
||||
if(R && R.cell)
|
||||
R.cell.use(losspertick)
|
||||
else
|
||||
bcell.use(losspertick)
|
||||
|
||||
/obj/item/weapon/melee/baton/update_icon()
|
||||
if(status)
|
||||
icon_state = "[initial(name)]_active"
|
||||
@@ -51,6 +71,7 @@
|
||||
icon_state = "[initial(name)]_nocell"
|
||||
else
|
||||
icon_state = "[initial(name)]"
|
||||
update_process()
|
||||
|
||||
/obj/item/weapon/melee/baton/examine(mob/user)
|
||||
..()
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
author: Paprka
|
||||
|
||||
delete-after: True
|
||||
|
||||
changes:
|
||||
- tweak: "Batons now slowly lose power when left on."
|
||||
Reference in New Issue
Block a user