mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Converts most istype(thing,tool) procs into an appropriate thing.is_tool() format
This commit is contained in:
@@ -1054,18 +1054,26 @@ proc/get_mob_with_client_list()
|
||||
//Quick type checks for some tools
|
||||
var/global/list/common_tools = list(
|
||||
/obj/item/stack/cable_coil,
|
||||
/obj/item/weapon/wrench,
|
||||
/obj/item/weapon/tool/wrench,
|
||||
/obj/item/weapon/weldingtool,
|
||||
/obj/item/weapon/screwdriver,
|
||||
/obj/item/weapon/wirecutters,
|
||||
/obj/item/weapon/tool/screwdriver,
|
||||
/obj/item/weapon/tool/wirecutters,
|
||||
/obj/item/device/multitool,
|
||||
/obj/item/weapon/crowbar)
|
||||
/obj/item/weapon/tool/crowbar)
|
||||
|
||||
/proc/istool(O)
|
||||
if(O && is_type_in_list(O, common_tools))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
/proc/is_wire_tool(obj/item/I)
|
||||
if(I.is_multitool() || I.is_wirecutter())
|
||||
return TRUE
|
||||
if(istype(I, /obj/item/device/assembly/signaler))
|
||||
return TRUE
|
||||
return
|
||||
/*
|
||||
/proc/iswrench(O)
|
||||
if(istype(O, /obj/item/weapon/wrench))
|
||||
return 1
|
||||
@@ -1082,12 +1090,12 @@ var/global/list/common_tools = list(
|
||||
return 0
|
||||
|
||||
/proc/iswirecutter(O)
|
||||
if(istype(O, /obj/item/weapon/wirecutters))
|
||||
if(istype(O, /obj/item/weapon/tool/wirecutters))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/isscrewdriver(O)
|
||||
if(istype(O, /obj/item/weapon/screwdriver))
|
||||
if(istype(O, /obj/item/weapon/tool/screwdriver))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
@@ -1097,7 +1105,7 @@ var/global/list/common_tools = list(
|
||||
return 0
|
||||
|
||||
/proc/iscrowbar(O)
|
||||
if(istype(O, /obj/item/weapon/crowbar))
|
||||
if(istype(O, /obj/item/weapon/tool/crowbar))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
@@ -1105,16 +1113,7 @@ var/global/list/common_tools = list(
|
||||
if(istype(O, /obj/item/stack/cable_coil))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/is_wire_tool(obj/item/I)
|
||||
if(istype(I, /obj/item/device/multitool))
|
||||
return TRUE
|
||||
if(istype(I, /obj/item/weapon/wirecutters))
|
||||
return TRUE
|
||||
if(istype(I, /obj/item/device/assembly/signaler))
|
||||
return TRUE
|
||||
return
|
||||
|
||||
*/
|
||||
proc/is_hot(obj/item/W as obj)
|
||||
switch(W.type)
|
||||
if(/obj/item/weapon/weldingtool)
|
||||
@@ -1149,24 +1148,31 @@ proc/is_hot(obj/item/W as obj)
|
||||
|
||||
//Whether or not the given item counts as sharp in terms of dealing damage
|
||||
/proc/is_sharp(obj/O as obj)
|
||||
if (!O) return 0
|
||||
if (O.sharp) return 1
|
||||
if (O.edge) return 1
|
||||
return 0
|
||||
if(!O)
|
||||
return FALSE
|
||||
if(O.sharp)
|
||||
return TRUE
|
||||
if(O.edge)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
//Whether or not the given item counts as cutting with an edge in terms of removing limbs
|
||||
/proc/has_edge(obj/O as obj)
|
||||
if (!O) return 0
|
||||
if (O.edge) return 1
|
||||
return 0
|
||||
if(!O)
|
||||
return FALSE
|
||||
if(O.edge)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
//Returns 1 if the given item is capable of popping things like balloons, inflatable barriers, or cutting police tape.
|
||||
/proc/can_puncture(obj/item/W as obj) // For the record, WHAT THE HELL IS THIS METHOD OF DOING IT?
|
||||
if(!W) return 0
|
||||
if(W.sharp) return 1
|
||||
if(!W)
|
||||
return FALSE
|
||||
if(W.sharp)
|
||||
return TRUE
|
||||
return ( \
|
||||
W.sharp || \
|
||||
istype(W, /obj/item/weapon/screwdriver) || \
|
||||
W.is_screwdriver() || \
|
||||
istype(W, /obj/item/weapon/pen) || \
|
||||
istype(W, /obj/item/weapon/weldingtool) || \
|
||||
istype(W, /obj/item/weapon/flame/lighter/zippo) || \
|
||||
@@ -1462,12 +1468,3 @@ var/mob/dview/dview_mob = new
|
||||
return "Northwest"
|
||||
if(337.5)
|
||||
return "North-Northwest"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user