Skip to content

Commit

Permalink
Merge pull request tgstation#15745 from KazeEspada/TreeCutting
Browse files Browse the repository at this point in the history
Tree cutting
  • Loading branch information
Cheridan committed Feb 26, 2016
2 parents 2d96194 + 8aeb267 commit d80756c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
26 changes: 24 additions & 2 deletions code/game/objects/structures/flora.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,29 @@
density = 1
pixel_x = -16
layer = 9
var/cut = FALSE
var/log_amount = 10

/obj/structure/flora/tree/attackby(obj/item/weapon/W, mob/user, params)
if(!cut && log_amount)
if(W.sharpness && 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 cutting a tree.")
if(do_after(user, 1000/W.force, target = user)) //5 seconds with 20 force, 8 seconds with a hatchet, 20 seconds with a shard.
user.visible_message("<span class='notice'>[user] falls [src] with the [W].</span>","<span class='notice'>You fall [src] with the [W].</span>", "You hear the sound of a tree falling.")
playsound(get_turf(src), 'sound/effects/meteorimpact.ogg', 100 , 0, 0)
icon_state = "tree_stump"
name = "stump"
cut = TRUE
for(var/i=1 to log_amount)
new /obj/item/weapon/grown/log/tree(get_turf(src))

else
..()




/obj/structure/flora/tree/pine
name = "pine tree"
Expand All @@ -21,7 +44,6 @@

/obj/structure/flora/tree/pine/xmas
name = "xmas tree"
icon = 'icons/obj/flora/pinetrees.dmi'
icon_state = "pine_c"

/obj/structure/flora/tree/pine/xmas/New()
Expand All @@ -32,7 +54,7 @@
icon = 'icons/obj/flora/deadtrees.dmi'
icon_state = "tree_1"

/obj/structure/flora/tree/festivus
/obj/structure/festivus
name = "festivus pole"
icon = 'icons/obj/flora/pinetrees.dmi'
icon_state = "festivus_pole"
Expand Down
7 changes: 6 additions & 1 deletion code/modules/hydroponics/growninedible.dm
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

/obj/item/weapon/grown/log/attackby(obj/item/weapon/W, mob/user, params)
..()
if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || (istype(W, /obj/item/weapon/twohanded/fireaxe) && W:wielded) || istype(W, /obj/item/weapon/melee/energy) || istype(W, /obj/item/weapon/twohanded/required/chainsaw))
if(W.sharpness)
user.show_message("<span class='notice'>You make [plank_name] out of \the [src]!</span>", 1)
var/obj/item/stack/plank = new plank_type(user.loc, 1 + round(potency / 25))
var/old_plank_amount = plank.amount
Expand All @@ -92,6 +92,11 @@
else
usr << "<span class ='warning'>You must dry this first!</span>"

/obj/item/weapon/grown/log/tree
seed = null
name = "wood log"
desc = "TIMMMMM-BERRRRRRRRRRR!"

/obj/item/weapon/grown/log/steel
seed = /obj/item/seeds/steelmycelium
name = "steel-cap log"
Expand Down
Binary file modified icons/obj/flora/deadtrees.dmi
Binary file not shown.
Binary file modified icons/obj/flora/pinetrees.dmi
Binary file not shown.

0 comments on commit d80756c

Please sign in to comment.