Skip to content

Commit

Permalink
Merge pull request #29 from Paxilmaniac/plant
Browse files Browse the repository at this point in the history
fixes some stuff with the last pr
  • Loading branch information
Paxilmaniac authored Jul 16, 2024
2 parents 50a3960 + 2df6f9a commit 9ccde97
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
4 changes: 3 additions & 1 deletion code/__DEFINES/icon_smoothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,10 @@ DEFINE_BITFIELD(smoothing_junction, list(
#define SGROUP_FIRE_CLAY S_TURF(104)
#define SGROUP_FANTASY_GRASS S_TURF(105)

#define SGROUP_GRASS_MAT S_TURF(106)
#define SGROUP_REED_MAT S_TURF(107)

#define MAX_S_TURF 105 //Always match this value with the one above it.
#define MAX_S_TURF 107 //Always match this value with the one above it.

#define S_OBJ(num) ("-" + #num + ",")
/* /obj included */
Expand Down
23 changes: 13 additions & 10 deletions code/modules/fantasystation_content/crafting/floors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

/turf/open/floor/fantasy_organic
name = "grass floor mat"
desc = "A woven mat made of dried grass."
desc = "A woven mat made of dried grass. Can be cut apart with a knife."
icon = 'icons/obj/fantasystation_obj/floors/grassmat.dmi'
icon_state = "grassmat-0"
base_icon_state = "grassmat"
baseturfs = /turf/baseturf_bottom // These shouldnt be map placed ever but just in case
floor_tile = null
smoothing_flags = SMOOTH_BITMASK
smoothing_groups = SMOOTH_GROUP_TURF_OPEN
canSmoothWith = null
smoothing_groups = SMOOTH_GROUP_TURF_OPEN + SGROUP_GRASS_MAT
canSmoothWith = SGROUP_GRASS_MAT
flags_1 = NONE
footstep = FOOTSTEP_GRASS
barefootstep = FOOTSTEP_GRASS
Expand All @@ -26,20 +26,23 @@
return FALSE

/turf/open/floor/fantasy_organic/attackby(obj/item/object, mob/living/user, params)
if(!object.tool_behaviour == TOOL_KNIFE)
if(object.tool_behaviour == TOOL_KNIFE)
if(!do_after(user, 3 SECONDS, src))
return
playsound(src, 'sound/items/poster_ripped.ogg', 50, TRUE)
new torn_up_result(src)
src.ScrapeAway(flags = CHANGETURF_INHERIT_AIR)
else
return ..()
if(!do_after(user, 3 SECONDS, src))
return
playsound(src, 'sound/items/poster_ripped.ogg', 20, TRUE)
new torn_up_result(src)
src.ScrapeAway(flags = CHANGETURF_INHERIT_AIR)

// Reed mats

/turf/open/floor/fantasy_organic/reed
name = "reed floor mat"
desc = "A woven mat made of river reeds."
desc = "A woven mat made of river reeds. Can be cut apart with a knife."
icon = 'icons/obj/fantasystation_obj/floors/reedmat.dmi'
icon_state = "reedmat-0"
base_icon_state = "reedmat"
torn_up_result = /obj/item/fantasy_cut_cattail
smoothing_groups = SMOOTH_GROUP_TURF_OPEN + SGROUP_REED_MAT
canSmoothWith = SGROUP_REED_MAT
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
/obj/item/fantasy_cut_grass/interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
if(!isturf(interacting_with))
return NONE
if(!ismiscturf(interacting_with))
if(istype(interacting_with, /turf/open/floor))
return NONE
place_floor_mat(interacting_with, user)
return ITEM_INTERACT_SUCCESS
Expand All @@ -110,7 +110,10 @@
/obj/item/fantasy_cut_grass/proc/place_floor_mat(turf/mat_target, mob/living/user)
if(!do_after(user, 3 SECONDS, mat_target))
return
if(QDELETED(src))
return
mat_target.place_on_top(place_turf_type, flags = CHANGETURF_INHERIT_AIR)
qdel(src)

/// Cattails

Expand Down Expand Up @@ -164,7 +167,10 @@
/obj/item/fantasy_cut_cattail/proc/place_floor_mat(turf/mat_target, mob/living/user)
if(!do_after(user, 3 SECONDS, mat_target))
return
if(QDELETED(src))
return
mat_target.place_on_top(place_turf_type, flags = CHANGETURF_INHERIT_AIR)
qdel(src)

/// Crafting recipes with river reeds

Expand Down

0 comments on commit 9ccde97

Please sign in to comment.