[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

View File

@@ -829,21 +829,19 @@
if(!myseed && !weedlevel)
to_chat(user, "<span class='warning'>[src] doesn't have any plants or weeds!</span>")
return
user.visible_message("<span class='notice'>[user] starts digging out [src]'s plants...</span>", "<span class='notice'>You start digging out [src]'s plants...</span>")
O.play_tool_sound(src)
if(!do_after(user, 50, target = src) || (!myseed && !weedlevel))
return
user.visible_message("<span class='notice'>[user] digs out the plants in [src]!</span>", "<span class='notice'>You dig out all of [src]'s plants!</span>")
O.play_tool_sound(src)
if(myseed) //Could be that they're just using it as a de-weeder
age = 0
plant_health = 0
if(harvest)
harvest = FALSE //To make sure they can't just put in another seed and insta-harvest it
qdel(myseed)
myseed = null
weedlevel = 0 //Has a side effect of cleaning up those nasty weeds
update_icon()
user.visible_message("<span class='notice'>[user] starts digging out [src]'s plants...</span>",
"<span class='notice'>You start digging out [src]'s plants...</span>")
if(O.use_tool(src, user, 50, volume=50) || (!myseed && !weedlevel))
user.visible_message("<span class='notice'>[user] digs out the plants in [src]!</span>", "<span class='notice'>You dig out all of [src]'s plants!</span>")
if(myseed) //Could be that they're just using it as a de-weeder
age = 0
plant_health = 0
if(harvest)
harvest = FALSE //To make sure they can't just put in another seed and insta-harvest it
qdel(myseed)
myseed = null
weedlevel = 0 //Has a side effect of cleaning up those nasty weeds
update_icon()
else
return ..()

View File

@@ -12,16 +12,16 @@
righthand_file = 'icons/mob/inhands/equipment/mining_righthand.dmi'
w_class = WEIGHT_CLASS_BULKY
materials = list(MAT_METAL=2000) //one sheet, but where can you make them?
var/digspeed = 40
tool_behaviour = TOOL_MINING
toolspeed = 1
usesound = list('sound/effects/picaxe1.ogg', 'sound/effects/picaxe2.ogg', 'sound/effects/picaxe3.ogg')
attack_verb = list("hit", "pierced", "sliced", "attacked")
/obj/item/pickaxe/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] begins digging into their chest! It looks like [user.p_theyre()] trying to commit suicide!</span>")
if(do_after(user,30, target = user))
play_tool_sound(user)
if(use_tool(user, user, 30, volume=50))
return BRUTELOSS
user.visible_message("<span class='suicide'>[user] couldn't do it!</span>")
user.visible_message("<span class='suicide'>[user] couldn't do it!</span>")
return SHAME
/obj/item/pickaxe/mini
@@ -38,7 +38,7 @@
name = "silver-plated pickaxe"
icon_state = "spickaxe"
item_state = "spickaxe"
digspeed = 20 //mines faster than a normal pickaxe, bought from mining vendor
toolspeed = 0.5 //mines faster than a normal pickaxe, bought from mining vendor
desc = "A silver-plated pickaxe that mines slightly faster than standard-issue."
force = 17
@@ -46,7 +46,7 @@
name = "diamond-tipped pickaxe"
icon_state = "dpickaxe"
item_state = "dpickaxe"
digspeed = 14
toolspeed = 0.3
desc = "A pickaxe with a diamond pick head. Extremely robust at cracking rock walls and digging up dirt."
force = 19
@@ -55,7 +55,7 @@
icon_state = "handdrill"
item_state = "jackhammer"
slot_flags = SLOT_BELT
digspeed = 25 //available from roundstart, faster than a pickaxe.
toolspeed = 0.6 //available from roundstart, faster than a pickaxe.
usesound = 'sound/weapons/drill.ogg'
hitsound = 'sound/weapons/drill.ogg'
desc = "An electric mining drill for the especially scrawny."
@@ -68,19 +68,19 @@
/obj/item/pickaxe/drill/diamonddrill
name = "diamond-tipped mining drill"
icon_state = "diamonddrill"
digspeed = 7
toolspeed = 0.2
desc = "Yours is the drill that will pierce the heavens!"
/obj/item/pickaxe/drill/cyborg/diamond //This is the BORG version!
name = "diamond-tipped cyborg mining drill" //To inherit the NODROP_1 flag, and easier to change borg specific drill mechanics.
icon_state = "diamonddrill"
digspeed = 7
toolspeed = 0.2
/obj/item/pickaxe/drill/jackhammer
name = "sonic jackhammer"
icon_state = "jackhammer"
item_state = "jackhammer"
digspeed = 5 //the epitome of powertools. extremely fast mining, laughs at puny walls
toolspeed = 0.1 //the epitome of powertools. extremely fast mining, laughs at puny walls
usesound = 'sound/weapons/sonic_jackhammer.ogg'
hitsound = 'sound/weapons/sonic_jackhammer.ogg'
desc = "Cracks rocks with sonic blasts, and doubles as a demolition power tool for smashing walls."
@@ -95,7 +95,8 @@
flags_1 = CONDUCT_1
slot_flags = SLOT_BELT
force = 8
var/digspeed = 20
tool_behaviour = TOOL_SHOVEL
toolspeed = 1
usesound = 'sound/effects/shovel_dig.ogg'
throwforce = 4
item_state = "shovel"
@@ -103,13 +104,12 @@
materials = list(MAT_METAL=50)
attack_verb = list("bashed", "bludgeoned", "thrashed", "whacked")
sharpness = IS_SHARP
/obj/item/shovel/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] begins digging their own grave! It looks like [user.p_theyre()] trying to commit suicide!</span>")
if(do_after(user,30, target = user))
play_tool_sound(user)
if(use_tool(user, user, 30, volume=50))
return BRUTELOSS
user.visible_message("<span class='suicide'>[user] couldn't do it!</span>")
user.visible_message("<span class='suicide'>[user] couldn't do it!</span>")
return SHAME
/obj/item/shovel/spade
@@ -121,4 +121,4 @@
righthand_file = 'icons/mob/inhands/equipment/hydroponics_righthand.dmi'
force = 5
throwforce = 7
w_class = WEIGHT_CLASS_SMALL
w_class = WEIGHT_CLASS_SMALL

View File

@@ -198,7 +198,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
wires.interact(user)
return
if(istype(I, /obj/item/pickaxe) || istype(I, /obj/item/resonator) || I.force >= 10)
if(I.tool_behaviour == TOOL_MINING || istype(I, /obj/item/resonator) || I.force >= 10)
GibtoniteReaction(user)
return
if(primed)