[MIRROR] Mining tools now use tool system (#5462)

* Mining tools now use tool system

* Update hydroponics.dm
This commit is contained in:
CitadelStationBot
2018-02-14 05:36:15 -06:00
committed by Poojawa
parent 5d18ffef44
commit 9b4770f855
8 changed files with 56 additions and 63 deletions
+2 -2
View File
@@ -173,8 +173,8 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust)) //for space dust event
#undef METEOR_MEDAL
/obj/effect/meteor/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/pickaxe))
/obj/effect/meteor/attackby(obj/item/I, mob/user, params)
if(I.tool_behaviour == TOOL_MINING)
make_debris()
qdel(src)
else
@@ -124,11 +124,10 @@
else
icon_state = initial_state
/obj/structure/mineral_door/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/pickaxe))
var/obj/item/pickaxe/digTool = W
/obj/structure/mineral_door/attackby(obj/item/I, mob/user, params)
if(I.tool_behaviour == TOOL_MINING)
to_chat(user, "<span class='notice'>You start digging the [name]...</span>")
if(do_after(user,digTool.digspeed*(1+round(max_integrity*0.01)), target = src) && src)
if(I.use_tool(src, user, 40, volume=50))
to_chat(user, "<span class='notice'>You finish digging.</span>")
deconstruct(TRUE)
else if(user.a_intent != INTENT_HARM)
+10 -10
View File
@@ -46,26 +46,26 @@
return ..()
/turf/closed/mineral/attackby(obj/item/pickaxe/P, mob/user, params)
/turf/closed/mineral/attackby(obj/item/I, mob/user, params)
if (!user.IsAdvancedToolUser())
to_chat(usr, "<span class='warning'>You don't have the dexterity to do this!</span>")
return
if (istype(P, /obj/item/pickaxe))
if(I.tool_behaviour == TOOL_MINING)
var/turf/T = user.loc
if (!isturf(T))
return
if(last_act+P.digspeed > world.time)//prevents message spam
if(last_act + (40 * I.toolspeed) > world.time)//prevents message spam
return
last_act = world.time
to_chat(user, "<span class='notice'>You start picking...</span>")
if(do_after(user,P.digspeed, target = src))
if(I.use_tool(src, user, 40, volume=50))
if(ismineralturf(src))
to_chat(user, "<span class='notice'>You finish cutting into the rock.</span>")
gets_drilled(user)
SSblackbox.record_feedback("tally", "pick_used_mining", 1, P.type)
SSblackbox.record_feedback("tally", "pick_used_mining", 1, I.type)
else
return attack_hand(user)
@@ -90,7 +90,7 @@
/turf/closed/mineral/attack_alien(mob/living/carbon/alien/M)
to_chat(M, "<span class='notice'>You start digging into the rock...</span>")
playsound(src, 'sound/effects/break_stone.ogg', 50, 1)
if(do_after(M,40, target = src))
if(do_after(M, 40, target = src))
to_chat(M, "<span class='notice'>You tunnel into the rock.</span>")
gets_drilled(M)
@@ -98,14 +98,14 @@
..()
if(ishuman(AM))
var/mob/living/carbon/human/H = AM
var/obj/item/I = H.is_holding_item_of_type(/obj/item/pickaxe)
var/obj/item/I = H.is_holding_tool_quality(TOOL_MINING)
if(I)
attackby(I,H)
attackby(I, H)
return
else if(iscyborg(AM))
var/mob/living/silicon/robot/R = AM
if(istype(R.module_active, /obj/item/pickaxe))
attackby(R.module_active,R)
if(R.module_active && R.module_active.tool_behaviour == TOOL_MINING)
attackby(R.module_active, R)
return
else
return