Merge pull request #4866 from mwerezak/stunglove

Fixes #4850
This commit is contained in:
Mloc
2014-05-01 10:36:17 +01:00

View File

@@ -1,76 +1,82 @@
/obj/item/clothing/gloves/attackby(obj/item/weapon/W, mob/user)
if(istype(src, /obj/item/clothing/gloves/boxing)) //quick fix for stunglove overlay not working nicely with boxing gloves.
if(istype(src, /obj/item/clothing/gloves/boxing)) //quick fix for stunglove overlay not working nicely with boxing gloves.
user << "<span class='notice'>That won't work.</span>" //i'm not putting my lips on that!
..()
return
//add wires
if(istype(W, /obj/item/weapon/cable_coil))
if(!("stunglove" in species_restricted))
var/obj/item/weapon/cable_coil/C = W
if(!wired)
if(C.amount >= 2)
C.use(2)
wired = 1
siemens_coefficient = 3.0
user << "<span class='notice'>You wrap some wires around [src].</span>"
update_icon()
else
user << "<span class='notice'>There is not enough wire to cover [src].</span>"
else
user << "<span class='notice'>[src] are already wired.</span>"
else
user << "<span class='notice'[src] is not suitable for wiring.</span>"
var/obj/item/weapon/cable_coil/C = W
if (clipped)
user << "<span class='notice'>The [src] are too badly mangled for wiring.</span>"
return
if(wired)
user << "<span class='notice'>The [src] are already wired.</span>"
return
if(C.amount < 2)
user << "<span class='notice'>There is not enough wire to cover the [src].</span>"
return
C.use(2)
wired = 1
siemens_coefficient = 3.0
user << "<span class='notice'>You wrap some wires around the [src].</span>"
update_icon()
return
//add cell
else if(istype(W, /obj/item/weapon/cell))
if(!wired)
user << "<span class='notice'>[src] need to be wired first.</span>"
user << "<span class='notice'>The [src] need to be wired first.</span>"
else if(!cell)
user.drop_item()
W.loc = src
cell = W
user << "<span class='notice'>You attach a cell to [src].</span>"
user << "<span class='notice'>You attach the [cell] to the [src].</span>"
update_icon()
else
user << "<span class='notice'>[src] already have a cell.</span>"
user << "<span class='notice'>A [cell] is already attached to the [src].</span>"
return
else if(istype(W, /obj/item/weapon/wirecutters) || istype(W, /obj/item/weapon/scalpel))
wired = null
//stunglove stuff
if(cell)
cell.updateicon()
user << "<span class='notice'>You cut the [cell] away from the [src].</span>"
cell.loc = get_turf(src.loc)
cell = null
if(clipped == 0)
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
user.visible_message("\red [user] cut the fingertips off [src].","\red You cut the fingertips off [src].")
clipped = 1
if("exclude" in species_restricted)
name = "mangled [name]"
desc = "[desc] They have had the fingertips cut off of them."
species_restricted -= "Unathi"
species_restricted -= "Tajaran"
species_restricted += "stunglove"
else if(clipped == 1)
user << "<span class='notice'>[src] have already been clipped!</span>"
update_icon()
return
if(cell)
cell.updateicon()
cell.loc = get_turf(src.loc)
cell = null
user << "<span class='notice'>You cut the cell away from [src].</span>"
update_icon()
return
if(wired) //wires disappear into the void because fuck that shit
wired = 0
siemens_coefficient = initial(siemens_coefficient)
user << "<span class='notice'>You cut the wires away from [src].</span>"
user << "<span class='notice'>You cut the wires away from the [src].</span>"
update_icon()
..()
return
return
//clipping fingertips
if(!clipped)
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
user.visible_message("\red [user] cuts the fingertips off of the [src].","\red You cut the fingertips off of the [src].")
clipped = 1
name = "mangled [name]"
desc = "[desc]<br>They have had the fingertips cut off of them."
if("exclude" in species_restricted)
species_restricted -= "Unathi"
species_restricted -= "Tajaran"
return
else
user << "<span class='notice'>The [src] have already been clipped!</span>"
update_icon()
return
return
..()
/obj/item/clothing/gloves/update_icon()
..()