diff --git a/code/game/objects/structures/false_walls.dm b/code/game/objects/structures/false_walls.dm index a1ff1406751..08123b5fec1 100644 --- a/code/game/objects/structures/false_walls.dm +++ b/code/game/objects/structures/false_walls.dm @@ -124,10 +124,9 @@ if(istype(W, /obj/item/weapon/pickaxe/drill/jackhammer)) var/obj/item/weapon/pickaxe/drill/jackhammer/D = W if(!D.bcell.use(300)) - user << "Your jackhammer doesn't have enough power to break through that wall." - D.update_charge() + user << "Your [D.name] doesn't have enough power to break through the [name]." return - D.update_charge() + D.update_icon() D.playDigSound() dismantle(user) diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index e674b20fad5..1b26e4e5410 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -45,9 +45,9 @@ else if(istype(W, /obj/item/weapon/pickaxe/drill/jackhammer)) var/obj/item/weapon/pickaxe/drill/jackhammer/D = W if(!D.bcell.use(D.drillcost)) - D.update_charge() + user << "Your [D.name] doesn't have enough power to break through the [name]." return - D.update_charge() + D.update_icon() user << "You smash through the girder!" new /obj/item/stack/sheet/metal(get_turf(src)) D.playDigSound() @@ -292,9 +292,8 @@ else if(istype(W, /obj/item/weapon/pickaxe/drill/jackhammer)) var/obj/item/weapon/pickaxe/drill/jackhammer/D = W if(!D.bcell.use(D.drillcost)) - D.update_charge() return - D.update_charge() + D.update_icon() user << "Your jackhammer smashes through the girder!" var/obj/effect/decal/remains/human/R = new (get_turf(src)) transfer_fingerprints_to(R) diff --git a/code/game/objects/structures/statues.dm b/code/game/objects/structures/statues.dm index 43a5a3d4639..888af8a09ac 100644 --- a/code/game/objects/structures/statues.dm +++ b/code/game/objects/structures/statues.dm @@ -57,9 +57,9 @@ else if(istype(W, /obj/item/weapon/pickaxe/drill/jackhammer)) var/obj/item/weapon/pickaxe/drill/jackhammer/D = W if(!D.bcell.use(D.drillcost)) - D.update_charge() + user << "Your [D.name] doesn't have enough power to break through the [name]." return - D.update_charge() + D.update_icon() if(!src.loc) return user.visible_message("[user] destroys the [name]!", \ diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index bb0b9d7b701..bd54b2067b9 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -215,16 +215,15 @@ if(istype(W, /obj/item/weapon/pickaxe/drill/jackhammer)) var/obj/item/weapon/pickaxe/drill/jackhammer/D = W if(!D.bcell.use(400)) - D.update_charge() - user << "Your jackhammer doesn't have enough power to break through that wall." + user << "Your [D.name] doesn't have enough power to break through the [name]." return - D.update_charge() + D.update_icon() if( !istype(src, /turf/simulated/wall) || !user || !W || !T ) return 1 if( user.loc == T && user.get_active_hand() == W ) D.playDigSound() dismantle_wall() - visible_message("[user] smashes through the wall with [W]!", "You hear the grinding of metal.") + visible_message("[user] smashes through the [name] with the [W.name]!", "You hear the grinding of metal.") return 1 else if( istype(W, /obj/item/weapon/melee/energy/blade) ) var/obj/item/weapon/melee/energy/blade/EB = W diff --git a/code/game/turfs/simulated/walls_reinforced.dm b/code/game/turfs/simulated/walls_reinforced.dm index aeb3c507dfa..c66d1061e50 100644 --- a/code/game/turfs/simulated/walls_reinforced.dm +++ b/code/game/turfs/simulated/walls_reinforced.dm @@ -34,20 +34,17 @@ return 1 else if(istype(W, /obj/item/weapon/pickaxe/drill/jackhammer)) var/obj/item/weapon/pickaxe/drill/jackhammer/D = W - if(!D.powered) + if(!D.bcell.use(800)) + user << "Your [D.name] doesn't have enough power to break through the [name]." return 1 - user << "You begin to smash though the reinforced wall." + user << "You begin to smash though the [name]." if(do_after(user, 50)) if( !istype(src, /turf/simulated/wall/r_wall) || !user || !W || !T ) return 1 if( user.loc == T && user.get_active_hand() == W ) - if(!D.bcell.use(800)) - user << "Your jackhammer doesn't have enough power to break through that wall." - D.update_charge() - return 1 - D.update_charge() + D.update_icon() D.playDigSound() - user << "Your jackhammer smashes though the last of the reinforced plating." + visible_message("[user] smashes through the [name] with the [D.name]!", "You hear the grinding of metal.") dismantle_wall() return 1 else if(istype(W, /obj/item/stack/sheet/metal) && d_state) diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm index 1d746d9068a..fffb61016e5 100644 --- a/code/modules/mining/mine_items.dm +++ b/code/modules/mining/mine_items.dm @@ -63,7 +63,6 @@ var/list/digsound = list('sound/effects/picaxe1.ogg','sound/effects/picaxe2.ogg','sound/effects/picaxe3.ogg') origin_tech = "materials=1;engineering=1" attack_verb = list("hit", "pierced", "sliced", "attacked") - var/powered = 1 //used to check for drill charge when mining /obj/item/weapon/pickaxe/proc/playDigSound() playsound(src, pick(digsound),50,1) @@ -87,21 +86,12 @@ desc = "An electric mining drill for the especially scrawny." var/drillcost = 125 //80 mineral walls by default var/obj/item/weapon/stock_parts/cell/high/bcell = null - powered = 0 /obj/item/weapon/pickaxe/drill/New() //this one starts with a cell pre-installed. ..() bcell = new(src) - update_charge() return -/obj/item/weapon/pickaxe/drill/proc/update_charge() - if(bcell && bcell.charge >= drillcost) - powered = 1 - else - powered = 0 - update_icon() - /obj/item/weapon/pickaxe/drill/update_icon() if(!bcell) icon_state = "[initial(icon_state)]-nocell" @@ -119,14 +109,14 @@ W.loc = src bcell = W user << "You install a cell in [src]." - update_charge() + update_icon() else if(istype(W, /obj/item/weapon/screwdriver)) if(bcell) bcell.updateicon() bcell.loc = get_turf(src.loc) bcell = null user << "You remove the cell from [src]." - update_charge() + update_icon() return ..() return diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index e7702171258..38afd36308c 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -392,39 +392,28 @@ if (!( istype(T, /turf) )) return - if(!P.powered) - return -/* - if (istype(W, /obj/item/weapon/pickaxe/radius)) - var/turf/T = user.loc - if (!( istype(T, /turf) )) - return -*/ -//Watch your tabbing, microwave. --NEO + if(istype(P, /obj/item/weapon/pickaxe/drill)) + var/obj/item/weapon/pickaxe/drill/D = P + if(isrobot(user)) + var/mob/living/silicon/robot/R = user + if(!R.cell.use(D.drillcost)) + R << "Your [D.name] doesn't have enough charge." + return + if(!D.bcell.use(D.drillcost)) + user << "Your [D.name] doesn't have enough charge." + return + if(last_act+P.digspeed > world.time)//prevents message spam return last_act = world.time user << "You start picking." - //playsound(user, 'sound/weapons/Genhit.ogg', 20, 1) P.playDigSound() if(do_after(user,P.digspeed)) - if(istype(P, /obj/item/weapon/pickaxe/drill)) - var/obj/item/weapon/pickaxe/drill/D = P - if(isrobot(user)) - var/mob/living/silicon/robot/R = user - if(R && R.cell) - if(!R.cell.use(D.drillcost)) - D.update_charge() - return - else - if(!D.bcell.use(D.drillcost)) - user << "Your drill ran out of power." - D.update_charge() - return - D.update_charge() - user << "You finish cutting into the rock." - gets_drilled(user) + if(istype(src, /turf/simulated/mineral)) //sanity check against turf being deleted during digspeed delay + user << "You finish cutting into the rock." + P.update_icon() + gets_drilled(user) else return attack_hand(user) return