Updated toilets. You can now crowbar open the cistern and hide stuff in there.

Recoded stunbatons, and put them into their own stunbaton.dm. They should function more or less the same, there's a few differences.
Recoded rechargers, they function exactly the same, but should be a bit more responsive now.

Fixed issue 475.

Filing cabinets, photocopiers, and hydroponics trays are now unwrenchable (the latter by request of Cheridan. It may need balancing, or more steps to unanchor.)

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3749 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
petethegoat@gmail.com
2012-06-06 13:07:51 +00:00
parent 834fe68277
commit 717da7aafa
11 changed files with 234 additions and 203 deletions
@@ -0,0 +1,87 @@
/obj/item/weapon/melee/baton
name = "stun baton"
desc = "A stun baton for incapacitating people with."
icon_state = "stunbaton"
item_state = "baton"
flags = FPRINT | TABLEPASS
slot_flags = SLOT_BELT
force = 10
throwforce = 7
w_class = 3
var/charges = 10
var/status = 0
origin_tech = "combat=2"
/obj/item/weapon/melee/baton/update_icon()
if(status)
icon_state = "stunbaton_active"
else
icon_state = "stunbaton"
/obj/item/weapon/melee/baton/attack_self(mob/user as mob)
if(status && (CLUMSY in user.mutations) && prob(50))
user << "\red You grab the [src] on the wrong side."
user.Weaken(30)
charges--
if(charges < 1)
status = 0
update_icon()
return
if(charges > 0)
status = !status
user << "<span class='notice'>\The [src] is now [status ? "on" : "off"].</span>"
playsound(src.loc, "sparks", 75, 1, -1)
update_icon()
else
status = 0
user << "<span class='warning'>\The [src] is out of charge.</span>"
add_fingerprint(user)
/obj/item/weapon/melee/baton/attack(mob/M as mob, mob/user as mob)
if(status && (CLUMSY in user.mutations) && prob(50))
user << "<span class='danger'>You accidentally hit yourself with the [src]!</span>"
user.Weaken(30)
charges--
if(charges < 1)
status = 0
update_icon()
return
var/mob/living/carbon/human/H = M
if(isrobot(M))
..()
return
if(user.a_intent != "help")
if(!..()) return
H.apply_effect(5, WEAKEN, 0)
H.visible_message("<span class='danger'>[M] has been beaten with the [src] by [user]!</span>")
playsound(src.loc, "swing_hit", 50, 1, -1)
else if(!status)
H.visible_message("<span class='warning'>[M] has been prodded with the [src] by [user]. Luckily it was off.</span>")
return
if(status)
H.apply_effect(10, STUN, 0)
H.apply_effect(10, WEAKEN, 0)
H.apply_effect(10, STUTTER, 0)
user.lastattacked = M
H.lastattacker = user
charges--
H.visible_message("<span class='danger'>[M] has been stunned with the [src] by [user]!</span>")
playsound(src.loc, "sparks", 75, 1, -1)
if(charges < 1)
status = 0
update_icon()
add_fingerprint(user)
/obj/item/weapon/melee/baton/emp_act(severity)
switch(severity)
if(1)
charges = 0
if(2)
charges = max(0, charges - 5)
if(charges < 1)
status = 0
update_icon()
@@ -3,7 +3,7 @@ CONTAINS:
SWORD
BLADE
AXE
STUN BATON
CLASSIC BATON
ENERGY SHIELD (where else should i even put this)
*/
@@ -94,102 +94,6 @@ ENERGY SHIELD (where else should i even put this)
src.add_fingerprint(user)
return
// STUN BATON
/obj/item/weapon/melee/baton/update_icon()
if(src.status)
icon_state = "stunbaton_active"
else
icon_state = "stunbaton"
/obj/item/weapon/melee/baton/attack_self(mob/user as mob)
src.status = !( src.status )
if ((CLUMSY in user.mutations) && prob(50))
usr << "\red You grab the stunbaton on the wrong side."
usr.Paralyse(60)
return
if (src.status)
user << "\blue The baton is now on."
playsound(src.loc, "sparks", 75, 1, -1)
else
user << "\blue The baton is now off."
playsound(src.loc, "sparks", 75, 1, -1)
update_icon()
src.add_fingerprint(user)
return
/obj/item/weapon/melee/baton/attack(mob/M as mob, mob/user as mob)
if ((CLUMSY in usr.mutations) && prob(50))
usr << "\red You grab the stunbaton on the wrong side."
usr.Weaken(30)
return
src.add_fingerprint(user)
var/mob/living/carbon/human/H = M
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been attacked with [src.name] by [user.name] ([user.ckey]) (INTENT: [uppertext(user.a_intent)])</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to attack [M.name] ([M.ckey]) (INTENT: [uppertext(user.a_intent)])</font>")
log_attack("<font color='red'>[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>")
if(isrobot(M))
..()
return
if (status == 0 || (status == 1 && charges ==0))
if(user.a_intent == "hurt")
if(!..()) return
M.Weaken(5)
for(var/mob/O in viewers(M))
if (O.client) O.show_message("\red <B>[M] has been beaten with the stun baton by [user]!</B>", 1)
if(status == 1 && charges == 0)
user << "\red Not enough charge"
return
else
for(var/mob/O in viewers(M))
if (O.client) O.show_message("\red <B>[M] has been prodded with the stun baton by [user]! Luckily it was off.</B>", 1)
if(status == 1 && charges == 0)
user << "\red Not enough charge"
return
if((charges > 0 && status == 1) && (istype(H, /mob/living/carbon)))
flick("baton_active", src)
if (user.a_intent == "hurt")
if(!..()) return
playsound(src.loc, 'Genhit.ogg', 50, 1, -1)
if(isrobot(user))
var/mob/living/silicon/robot/R = user
R.cell.charge -= 20
else
charges--
if (M.stuttering < 1 && (!(HULK in M.mutations) && M.canstun) /*&& (!istype(H:wear_suit, /obj/item/clothing/suit/judgerobe))*/)
M.stuttering = 1
M.Stun(1)
M.Weaken(1)
else
playsound(src.loc, 'Egloves.ogg', 50, 1, -1)
if(isrobot(user))
var/mob/living/silicon/robot/R = user
R.cell.charge -= 20
else
charges--
if (M.stuttering < 10 && (!(HULK in M.mutations) && M.canstun) /*&& (!istype(H:wear_suit, /obj/item/clothing/suit/judgerobe))*/)
M.stuttering = 10
M.Stun(10)
M.Weaken(10)
user.lastattacked = M
M.lastattacker = user
for(var/mob/O in viewers(M))
if (O.client) O.show_message("\red <B>[M] has been stunned with the stun baton by [user]!</B>", 1, "\red You hear someone fall", 2)
/obj/item/weapon/melee/baton/emp_act(severity)
switch(severity)
if(1)
src.charges = 0
if(2)
charges -= 5
/obj/item/weapon/melee/classic_baton/attack(mob/M as mob, mob/living/user as mob)
if ((CLUMSY in user.mutations) && prob(50))
user << "\red You club yourself over the head."