mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Converts most istype(thing,tool) procs into an appropriate thing.is_tool() format
This commit is contained in:
@@ -89,15 +89,15 @@
|
||||
if(health < maxhealth)
|
||||
switch(health / maxhealth)
|
||||
if(0.0 to 0.5)
|
||||
user << "<span class='warning'>It looks severely damaged!</span>"
|
||||
to_chat(user, "<span class='warning'>It looks severely damaged!</span>")
|
||||
if(0.25 to 0.5)
|
||||
user << "<span class='warning'>It looks damaged!</span>"
|
||||
to_chat(user, "<span class='warning'>It looks damaged!</span>")
|
||||
if(0.5 to 1.0)
|
||||
user << "<span class='notice'>It has a few scrapes and dents.</span>"
|
||||
to_chat(user, "<span class='notice'>It has a few scrapes and dents.</span>")
|
||||
|
||||
/obj/structure/table/attackby(obj/item/weapon/W, mob/user)
|
||||
|
||||
if(reinforced && istype(W, /obj/item/weapon/screwdriver))
|
||||
if(reinforced && W.is_screwdriver())
|
||||
remove_reinforced(W, user)
|
||||
if(!reinforced)
|
||||
update_desc()
|
||||
@@ -105,7 +105,7 @@
|
||||
update_material()
|
||||
return 1
|
||||
|
||||
if(carpeted && istype(W, /obj/item/weapon/crowbar))
|
||||
if(carpeted && W.is_crowbar())
|
||||
user.visible_message("<span class='notice'>\The [user] removes the carpet from \the [src].</span>",
|
||||
"<span class='notice'>You remove the carpet from \the [src].</span>")
|
||||
new /obj/item/stack/tile/carpet(loc)
|
||||
@@ -122,9 +122,9 @@
|
||||
update_icon()
|
||||
return 1
|
||||
else
|
||||
user << "<span class='warning'>You don't have enough carpet!</span>"
|
||||
to_chat(user, "<span class='warning'>You don't have enough carpet!</span>")
|
||||
|
||||
if(!reinforced && !carpeted && material && istype(W, /obj/item/weapon/wrench))
|
||||
if(!reinforced && !carpeted && material && W.is_wrench())
|
||||
remove_material(W, user)
|
||||
if(!material)
|
||||
update_connections(1)
|
||||
@@ -135,14 +135,14 @@
|
||||
update_material()
|
||||
return 1
|
||||
|
||||
if(!carpeted && !reinforced && !material && istype(W, /obj/item/weapon/wrench))
|
||||
if(!carpeted && !reinforced && !material && W.is_wrench())
|
||||
dismantle(W, user)
|
||||
return 1
|
||||
|
||||
if(health < maxhealth && istype(W, /obj/item/weapon/weldingtool))
|
||||
if(health < maxhealth && W.is_welder())
|
||||
var/obj/item/weapon/weldingtool/F = W
|
||||
if(F.welding)
|
||||
user << "<span class='notice'>You begin reparing damage to \the [src].</span>"
|
||||
to_chat(user, "<span class='notice'>You begin reparing damage to \the [src].</span>")
|
||||
playsound(src, F.usesound, 50, 1)
|
||||
if(!do_after(user, 20 * F.toolspeed) || !F.remove_fuel(1, user))
|
||||
return
|
||||
@@ -197,19 +197,19 @@
|
||||
|
||||
/obj/structure/table/proc/reinforce_table(obj/item/stack/material/S, mob/user)
|
||||
if(reinforced)
|
||||
user << "<span class='warning'>\The [src] is already reinforced!</span>"
|
||||
to_chat(user, "<span class='warning'>\The [src] is already reinforced!</span>")
|
||||
return
|
||||
|
||||
if(!can_reinforce)
|
||||
user << "<span class='warning'>\The [src] cannot be reinforced!</span>"
|
||||
to_chat(user, "<span class='warning'>\The [src] cannot be reinforced!</span>")
|
||||
return
|
||||
|
||||
if(!material)
|
||||
user << "<span class='warning'>Plate \the [src] before reinforcing it!</span>"
|
||||
to_chat(user, "<span class='warning'>Plate \the [src] before reinforcing it!</span>")
|
||||
return
|
||||
|
||||
if(flipped)
|
||||
user << "<span class='warning'>Put \the [src] back in place before reinforcing it!</span>"
|
||||
to_chat(user, "<span class='warning'>Put \the [src] back in place before reinforcing it!</span>")
|
||||
return
|
||||
|
||||
reinforced = common_material_add(S, user, "reinforc")
|
||||
@@ -234,12 +234,12 @@
|
||||
/obj/structure/table/proc/common_material_add(obj/item/stack/material/S, mob/user, verb) // Verb is actually verb without 'e' or 'ing', which is added. Works for 'plate'/'plating' and 'reinforce'/'reinforcing'.
|
||||
var/material/M = S.get_material()
|
||||
if(!istype(M))
|
||||
user << "<span class='warning'>You cannot [verb]e \the [src] with \the [S].</span>"
|
||||
to_chat(user, "<span class='warning'>You cannot [verb]e \the [src] with \the [S].</span>")
|
||||
return null
|
||||
|
||||
if(manipulating) return M
|
||||
manipulating = 1
|
||||
user << "<span class='notice'>You begin [verb]ing \the [src] with [M.display_name].</span>"
|
||||
to_chat(user, "<span class='notice'>You begin [verb]ing \the [src] with [M.display_name].</span>")
|
||||
if(!do_after(user, 20) || !S.use(1))
|
||||
manipulating = 0
|
||||
return null
|
||||
@@ -250,7 +250,7 @@
|
||||
// Returns the material to set the table to.
|
||||
/obj/structure/table/proc/common_material_remove(mob/user, material/M, delay, what, type_holding, sound)
|
||||
if(!M.stack_type)
|
||||
user << "<span class='warning'>You are unable to remove the [what] from this [src]!</span>"
|
||||
to_chat(user, "<span class='warning'>You are unable to remove the [what] from this [src]!</span>")
|
||||
return M
|
||||
|
||||
if(manipulating) return M
|
||||
@@ -268,13 +268,13 @@
|
||||
manipulating = 0
|
||||
return null
|
||||
|
||||
/obj/structure/table/proc/remove_reinforced(obj/item/weapon/screwdriver/S, mob/user)
|
||||
/obj/structure/table/proc/remove_reinforced(obj/item/weapon/S, mob/user)
|
||||
reinforced = common_material_remove(user, reinforced, 40 * S.toolspeed, "reinforcements", "screws", S.usesound)
|
||||
|
||||
/obj/structure/table/proc/remove_material(obj/item/weapon/wrench/W, mob/user)
|
||||
/obj/structure/table/proc/remove_material(obj/item/weapon/W, mob/user)
|
||||
material = common_material_remove(user, material, 20 * W.toolspeed, "plating", "bolts", W.usesound)
|
||||
|
||||
/obj/structure/table/proc/dismantle(obj/item/weapon/wrench/W, mob/user)
|
||||
/obj/structure/table/proc/dismantle(obj/item/W, mob/user)
|
||||
if(manipulating) return
|
||||
manipulating = 1
|
||||
user.visible_message("<span class='notice'>\The [user] begins dismantling \the [src].</span>",
|
||||
@@ -459,7 +459,8 @@
|
||||
*/
|
||||
|
||||
/proc/dirs_to_corner_states(list/dirs)
|
||||
if(!istype(dirs)) return
|
||||
if(!istype(dirs))
|
||||
return
|
||||
|
||||
var/list/ret = list(NORTHWEST, SOUTHEAST, NORTHEAST, SOUTHWEST)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user