Runtime hunting: Thrown batons (#16518)

* Runtime hunting: Thrown batons

* macros and stuff
This commit is contained in:
DamianX
2017-11-10 22:11:44 +01:00
committed by Pieter-Jan Briers
parent a262ce1463
commit ac89c6110c

View File

@@ -15,7 +15,6 @@
var/status = 0
var/obj/item/weapon/cell/bcell = null
var/hitcost = 100 // 10 hits on crap cell
var/mob/foundmob = "" //Used in throwing proc.
/obj/item/weapon/melee/baton/suicide_act(mob/user)
to_chat(viewers(user), "<span class='danger'>[user] is putting the live [src.name] in \his mouth! It looks like \he's trying to commit suicide.</span>")
@@ -209,12 +208,14 @@
M.LAssailant = user
/obj/item/weapon/melee/baton/throw_impact(atom/hit_atom)
foundmob = directory[ckey(fingerprintslast)]
if(prob(50))
if(istype(hit_atom, /mob/living))
return ..()
if(!isliving(hit_atom) || !status)
return
var/client/foundclient = directory[ckey(fingerprintslast)]
var/mob/foundmob = foundclient.mob
var/mob/living/L = hit_atom
if(status)
if(foundmob)
if(foundmob && ismob(foundmob))
foundmob.lastattacked = L
L.lastattacker = foundmob
@@ -239,9 +240,6 @@
else
L.LAssailant = foundmob
return
return ..()
/obj/item/weapon/melee/baton/emp_act(severity)
if(bcell)
deductcharge(1000 / severity)