mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
Fix sharpness-related issues (#44830)
Turned off energy weapons can no longer cut down trees, destroy wooden walls, harvest lavaland plants and make planks.
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
if(I.force >= max || I.throwforce >= max)//no esword sharpening
|
||||
to_chat(user, "<span class='warning'>[I] is much too powerful to sharpen further!</span>")
|
||||
return
|
||||
if(requires_sharpness && !I.sharpness)
|
||||
if(requires_sharpness && !I.is_sharp())
|
||||
to_chat(user, "<span class='warning'>You can only sharpen items that are already sharp, such as knives!</span>")
|
||||
return
|
||||
if(istype(I, /obj/item/melee/transforming/energy))
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
/obj/structure/flora/tree/attackby(obj/item/W, mob/user, params)
|
||||
if(log_amount && (!(flags_1 & NODECONSTRUCT_1)))
|
||||
if(W.sharpness && W.force > 0)
|
||||
if(W.is_sharp() && W.force > 0)
|
||||
if(W.hitsound)
|
||||
playsound(get_turf(src), W.hitsound, 100, 0, 0)
|
||||
user.visible_message("<span class='notice'>[user] begins to cut down [src] with [W].</span>","<span class='notice'>You begin to cut down [src] with [W].</span>", "You hear the sound of sawing.")
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
canSmoothWith = list(/turf/closed/wall/mineral/wood, /obj/structure/falsewall/wood, /turf/closed/wall/mineral/wood/nonmetal)
|
||||
|
||||
/turf/closed/wall/mineral/wood/attackby(obj/item/W, mob/user)
|
||||
if(W.sharpness && W.force)
|
||||
if(W.is_sharp() && W.force)
|
||||
var/duration = (48/W.force) * 2 //In seconds, for now.
|
||||
if(istype(W, /obj/item/hatchet) || istype(W, /obj/item/twohanded/fireaxe))
|
||||
duration /= 4 //Much better with hatchets and axes.
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
/obj/item/reagent_containers/food/snacks/grown/wheat))
|
||||
|
||||
/obj/item/grown/log/attackby(obj/item/W, mob/user, params)
|
||||
if(W.sharpness)
|
||||
if(W.is_sharp())
|
||||
user.show_message("<span class='notice'>You make [plank_name] out of \the [src]!</span>", 1)
|
||||
var/seed_modifier = 0
|
||||
if(seed)
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
harvested = FALSE
|
||||
|
||||
/obj/structure/flora/ash/attackby(obj/item/W, mob/user, params)
|
||||
if(!harvested && needs_sharp_harvest && W.sharpness)
|
||||
if(!harvested && needs_sharp_harvest && W.is_sharp())
|
||||
user.visible_message("<span class='notice'>[user] starts to harvest from [src] with [W].</span>","<span class='notice'>You begin to harvest from [src] with [W].</span>")
|
||||
if(do_after(user, harvest_time, target = src))
|
||||
harvest(user)
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
..()
|
||||
|
||||
/obj/item/bodypart/attackby(obj/item/W, mob/user, params)
|
||||
if(W.sharpness)
|
||||
if(W.is_sharp())
|
||||
add_fingerprint(user)
|
||||
if(!contents.len)
|
||||
to_chat(user, "<span class='warning'>There is nothing left inside [src]!</span>")
|
||||
|
||||
Reference in New Issue
Block a user