Skip to content

Commit

Permalink
Merge pull request #28 from Paxilmaniac/plant
Browse files Browse the repository at this point in the history
far sight and floor mats
  • Loading branch information
Paxilmaniac authored Jul 16, 2024
2 parents 3c1499b + e53b4f2 commit 50a3960
Show file tree
Hide file tree
Showing 12 changed files with 145 additions and 3 deletions.
45 changes: 45 additions & 0 deletions code/modules/fantasystation_content/crafting/floors.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Base fantasystation organic floor types, like mats and whatnot, basetype is dried grass

/turf/open/floor/fantasy_organic
name = "grass floor mat"
desc = "A woven mat made of dried grass."
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
flags_1 = NONE
footstep = FOOTSTEP_GRASS
barefootstep = FOOTSTEP_GRASS
clawfootstep = FOOTSTEP_GRASS
heavyfootstep = FOOTSTEP_GENERIC_HEAVY
/// What we make when we're torn up
var/obj/torn_up_result = /obj/item/fantasy_cut_grass

/turf/open/floor/fantasy_organic/broken_states()
return

/turf/open/floor/fantasy_organic/crowbar_act(mob/living/user, obj/item/I)
return FALSE

/turf/open/floor/fantasy_organic/attackby(obj/item/object, mob/living/user, params)
if(!object.tool_behaviour == TOOL_KNIFE)
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."
icon = 'icons/obj/fantasystation_obj/floors/reedmat.dmi'
icon_state = "reedmat-0"
base_icon_state = "reedmat"
torn_up_result = /obj/item/fantasy_cut_cattail
2 changes: 0 additions & 2 deletions code/modules/fantasystation_content/crafting/walls.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
/turf/closed/wall/fantasystation/try_decon(obj/item/attacking_item, mob/user)
if(attacking_item.tool_behaviour != TOOL_AXE)
return FALSE
if(!attacking_item.tool_start_check(user, amount=round(slicing_duration / 50)))
return FALSE

to_chat(user, span_notice("You begin hacking through the logs..."))
if(attacking_item.use_tool(src, user, slicing_duration, volume=100))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/fantasystation_content/food/roots.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
)

/obj/item/food/fantasy_grown/hideroot/make_grillable()
AddComponent(/datum/component/grillable, /obj/item/food/fantasy_grown/hideroot, rand(90 SECONDS, 140 SECONDS), TRUE, TRUE)
AddComponent(/datum/component/grillable, /obj/item/food/fantasy_grown/hideroot/cooked, rand(90 SECONDS, 140 SECONDS), TRUE, TRUE)

/obj/item/food/fantasy_grown/hideroot/cooked
name = "cooked hideroot"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,27 @@
resistance_flags = FLAMMABLE
w_class = WEIGHT_CLASS_SMALL
campfire_fuel_value = 30 SECONDS
/// Type of turf we place when used on another open turf
var/turf/place_turf_type = /turf/open/floor/fantasy_organic

/obj/item/fantasy_cut_grass/examine(mob/user)
. = ..()
. += span_notice("Using this on <b>bare terrain</b> will make flooring.")
return .

/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))
return NONE
place_floor_mat(interacting_with, user)
return ITEM_INTERACT_SUCCESS

/// Places the floor mat tile on the given turf if the do_after passes
/obj/item/fantasy_cut_grass/proc/place_floor_mat(turf/mat_target, mob/living/user)
if(!do_after(user, 3 SECONDS, mat_target))
return
mat_target.place_on_top(place_turf_type, flags = CHANGETURF_INHERIT_AIR)

/// Cattails

Expand Down Expand Up @@ -123,6 +144,27 @@
icon_state = "cattails"
resistance_flags = FLAMMABLE
w_class = WEIGHT_CLASS_SMALL
/// Type of turf we place when used on another open turf
var/turf/place_turf_type = /turf/open/floor/fantasy_organic/reed

/obj/item/fantasy_cut_cattail/examine(mob/user)
. = ..()
. += span_notice("Using this on <b>bare terrain</b> will make flooring.")
return .

/obj/item/fantasy_cut_cattail/interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
if(!isturf(interacting_with))
return NONE
if(!ismiscturf(interacting_with))
return NONE
place_floor_mat(interacting_with, user)
return ITEM_INTERACT_SUCCESS

/// Places the floor mat tile on the given turf if the do_after passes
/obj/item/fantasy_cut_cattail/proc/place_floor_mat(turf/mat_target, mob/living/user)
if(!do_after(user, 3 SECONDS, mat_target))
return
mat_target.place_on_top(place_turf_type, flags = CHANGETURF_INHERIT_AIR)

/// Crafting recipes with river reeds

Expand Down
28 changes: 28 additions & 0 deletions code/modules/surgery/organs/internal/eyes/_eyes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
high_threshold_cleared = "<span class='info'>Your vision functions passably once more.</span>"
low_threshold_cleared = "<span class='info'>Your vision is cleared of any ailment.</span>"

actions_types = list(/datum/action/item_action/organ_action/toggle)
/// If we are zoomed with our scope component
var/zoomed = FALSE
/// What range power are we giving to the scope component?
var/range_power = 2

/// Sight flags this eye pair imparts on its user.
var/sight_flags = NONE
/// changes how the eyes overlay is applied, makes it apply over the lighting layer
Expand Down Expand Up @@ -52,6 +58,28 @@
/// Native FOV that will be applied if a config is enabled
var/native_fov = FOV_90_DEGREES

/obj/item/organ/internal/eyes/Initialize(mapload)
. = ..()
AddComponent(/datum/component/scope, range_modifier = range_power)

/obj/item/organ/internal/eyes/ui_action_click(mob/user, actiontype)
if(istype(actiontype, /datum/action/item_action/organ_action/toggle))
toggle_eye_zoom_active(user)

/// Toggles the scope vision thing for eyes
/obj/item/organ/internal/eyes/proc/toggle_eye_zoom_active(mob/user)
var/datum/component/scope/zoom = src.GetComponent(/datum/component/scope)
if (zoomed)
zoom.stop_zooming(user)
zoomed = FALSE
else
if (user.is_blind())
user.balloon_alert(user, "can't look ahead while blind!")
return

zoom.zoom(user)
zoomed = TRUE

/obj/item/organ/internal/eyes/Insert(mob/living/carbon/eye_recipient, special = FALSE, movement_flags = DELETE_IF_REPLACED)
// If we don't do this before everything else, heterochromia will be reset leading to eye_color_right no longer being accurate
if(ishuman(eye_recipient))
Expand Down
Binary file added icons/obj/fantasystation_obj/floors/grassmat.dmi
Binary file not shown.
Binary file added icons/obj/fantasystation_obj/floors/grassmat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions icons/obj/fantasystation_obj/floors/grassmat.png.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
output_name = "grassmat"
template = "bitmask/diagonal_32x32.toml"

[icon_size]
x = 32
y = 32

[output_icon_size]
x = 32
y = 32

[cut_pos]
x = 16
y = 16
Binary file added icons/obj/fantasystation_obj/floors/reedmat.dmi
Binary file not shown.
Binary file added icons/obj/fantasystation_obj/floors/reedmat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions icons/obj/fantasystation_obj/floors/reedmat.png.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
output_name = "reedmat"
template = "bitmask/diagonal_32x32.toml"

[icon_size]
x = 32
y = 32

[output_icon_size]
x = 32
y = 32

[cut_pos]
x = 16
y = 16
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -4118,6 +4118,7 @@
#include "code\modules\fantasystation_content\clothing\backpack.dm"
#include "code\modules\fantasystation_content\crafting\crafting_recipe_fantasy.dm"
#include "code\modules\fantasystation_content\crafting\fire.dm"
#include "code\modules\fantasystation_content\crafting\floors.dm"
#include "code\modules\fantasystation_content\crafting\palisade.dm"
#include "code\modules\fantasystation_content\crafting\rock_and_stone.dm"
#include "code\modules\fantasystation_content\crafting\sticks.dm"
Expand Down

0 comments on commit 50a3960

Please sign in to comment.