Skip to content

Commit

Permalink
Merge pull request NebulaSS13#4111 from MistakeNot4892/fix/holders
Browse files Browse the repository at this point in the history
More Shaded Hills-related dev fixes.
  • Loading branch information
out-of-phaze authored Jun 18, 2024
2 parents c48e5da + f4f8c21 commit 0d077a7
Show file tree
Hide file tree
Showing 28 changed files with 92 additions and 50 deletions.
4 changes: 2 additions & 2 deletions code/game/machinery/jukebox.dm
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@
qdel(src)

/obj/machinery/media/jukebox/attackby(obj/item/W, mob/user)
if(IS_WRENCH(W) && !panel_open)
if((IS_WRENCH(W) || IS_HAMMER(W)) && !panel_open)
add_fingerprint(user)
wrench_floor_bolts(user, 0)
wrench_floor_bolts(user, 0, W)
power_change()
return
return ..()
Expand Down
6 changes: 3 additions & 3 deletions code/game/machinery/vending/_vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@

build_inventory(populate_parts)
return INITIALIZE_HINT_LATELOAD

/obj/machinery/vending/LateInitialize()
..()
update_icon()
Expand Down Expand Up @@ -181,8 +181,8 @@
return TRUE
if((. = component_attackby(W, user)))
return
if((obj_flags & OBJ_FLAG_ANCHORABLE) && IS_WRENCH(W))
wrench_floor_bolts(user)
if((obj_flags & OBJ_FLAG_ANCHORABLE) && (IS_WRENCH(W) || IS_HAMMER(W)))
wrench_floor_bolts(user, null, W)
power_change()
return

Expand Down
12 changes: 8 additions & 4 deletions code/game/objects/objs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,18 @@
. |= DAM_LASER

/obj/attackby(obj/item/O, mob/user)
if((obj_flags & OBJ_FLAG_ANCHORABLE) && IS_WRENCH(O))
wrench_floor_bolts(user)
if((obj_flags & OBJ_FLAG_ANCHORABLE) && (IS_WRENCH(O) || IS_HAMMER(O)))
wrench_floor_bolts(user, null, O)
update_icon()
return TRUE
return ..()

/obj/proc/wrench_floor_bolts(mob/user, delay=20)
playsound(loc, 'sound/items/Ratchet.ogg', 100, 1)
/obj/proc/wrench_floor_bolts(mob/user, delay = 2 SECONDS, obj/item/tool)
if(!istype(tool) || IS_WRENCH(tool))
playsound(loc, 'sound/items/Ratchet.ogg', 100, 1)
else if(IS_HAMMER(tool))
playsound(loc, 'sound/weapons/Genhit.ogg', 100, 1)

if(anchored)
user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
else
Expand Down
16 changes: 10 additions & 6 deletions code/game/objects/structures/compost.dm
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
/// The number of worms influences the rate at which contents are decomposed into compost.
var/global/const/COMPOST_WORM_EAT_AMOUNT = 50
var/global/const/COMPOST_MAX_WORMS = 10
var/global/const/COMPOST_WORM_EAT_AMOUNT = 50
var/global/const/COMPOST_MAX_WORMS = 10
var/global/const/COMPOST_WORM_HUNGER_FACTOR = MINIMUM_CHEMICAL_VOLUME

/obj/structure/reagent_dispensers/compost_bin
name = "compost bin"
desc = "A squat bin for decomposing organic material."
icon = 'icons/obj/structures/compost.dmi'
icon_state = ICON_STATE_WORLD
anchored = TRUE
atom_flags = ATOM_FLAG_CLIMBABLE | ATOM_FLAG_OPEN_CONTAINER
material = /decl/material/solid/organic/wood
density = TRUE
atom_flags = ATOM_FLAG_CLIMBABLE
matter = null
material = /decl/material/solid/organic/wood
material_alteration = MAT_FLAG_ALTERATION_COLOR | MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_DESC
wrenchable = FALSE
possible_transfer_amounts = @"[10,25,50,100]"
volume = 2000
can_toggle_open = FALSE
storage = /datum/storage/hopper/industrial/compost

/obj/structure/reagent_dispensers/compost_bin/Initialize()
Expand All @@ -28,7 +33,6 @@ var/global/const/COMPOST_MAX_WORMS = 10
qdel(worm)
break
. = ..()
atom_flags |= ATOM_FLAG_OPEN_CONTAINER // something seems to be unsetting this :(

/obj/structure/reagent_dispensers/compost_bin/Destroy()
if(is_processing)
Expand Down Expand Up @@ -186,7 +190,7 @@ var/global/const/COMPOST_MAX_WORMS = 10
if(compost_amount > 0)
// Worms gotta eat...
if(worms_are_hungry)
reagents.remove_reagent(/decl/material/liquid/fertilizer/compost, worm_drink_amount * 0.025)
reagents.remove_reagent(/decl/material/liquid/fertilizer/compost, worm_drink_amount * COMPOST_WORM_HUNGER_FACTOR)
if(prob(1) && worms < COMPOST_MAX_WORMS)
var/obj/item/chems/food/worm/worm = new(src)
if(!storage.handle_item_insertion(null, worm))
Expand Down
9 changes: 9 additions & 0 deletions code/game/objects/structures/drying_rack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@
/obj/structure/drying_rack/Process()
if(!drying)
return

if(isturf(loc))
var/turf/my_turf = loc
var/decl/state/weather/weather_state = my_turf.weather?.weather_system?.current_state
if(istype(weather_state) && weather_state.is_liquid)
return // can't dry in the rain
if(loc?.is_flooded(TRUE))
return // can't dry in the wet

var/dry_product = drying?.dry_out(src)
if(dry_product)
if(drying != dry_product)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/flora/plant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
var/fail_chance = user ? user.skill_fail_chance(SKILL_BOTANY, 30, SKILL_ADEPT) : 30
if(!prob(fail_chance))
for(var/i = 1 to rand(1,3))
new /obj/item/seeds(loc, null, plant)
new /obj/item/seeds/extracted(loc, null, plant)
return ..()

/obj/structure/flora/plant/Initialize(ml, _mat, _reinf_mat, datum/seed/_plant)
Expand Down
15 changes: 8 additions & 7 deletions code/game/objects/structures/well.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,27 @@
icon_state = ICON_STATE_WORLD
anchored = TRUE
density = TRUE
atom_flags = ATOM_FLAG_CLIMBABLE | ATOM_FLAG_OPEN_CONTAINER
atom_flags = ATOM_FLAG_CLIMBABLE
matter = null
material = /decl/material/solid/stone/granite
material_alteration = MAT_FLAG_ALTERATION_COLOR | MAT_FLAG_ALTERATION_DESC
wrenchable = FALSE
amount_dispensed = 10
possible_transfer_amounts = @"[10,25,50,100]"
volume = 10000
can_toggle_open = FALSE

/obj/structure/reagent_dispensers/well/on_update_icon()
. = ..()
if(reagents?.total_volume)
add_overlay(overlay_image(icon, "[icon_state]-fluid", reagents.get_color(), (RESET_COLOR | RESET_ALPHA)))

/obj/structure/reagent_dispensers/well/on_reagent_change()
. = ..()
update_icon()
if(!is_processing)
START_PROCESSING(SSobj, src)

/obj/structure/reagent_dispensers/well/mapped/populate_reagents()
. = ..()
add_to_reagents(/decl/material/liquid/water, reagents.maximum_volume)
Expand All @@ -34,9 +41,3 @@
if(is_processing)
STOP_PROCESSING(SSobj, src)
return ..()

/obj/structure/reagent_dispensers/well/mapped/on_reagent_change()
. = ..()
update_icon()
if(!is_processing)
START_PROCESSING(SSobj, src)
2 changes: 2 additions & 0 deletions code/game/turfs/floors/natural/_natural.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
base_icon_state = "0"
base_color = null

can_engrave = FALSE

var/dirt_color = "#7c5e42"
var/possible_states = 0
var/icon_edge_layer = -1
Expand Down
2 changes: 1 addition & 1 deletion code/game/turfs/floors/natural/natural_dirt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
return 1

/turf/floor/natural/dirt/fluid_act(var/datum/reagents/fluids)
if(fluids?.total_volume < FLUID_SHALLOW)
if(fluids?.total_volume < FLUID_PUDDLE)
return ..()
var/turf/new_turf = ChangeTurf(/turf/floor/natural/mud, keep_air = TRUE, keep_height = TRUE)
return new_turf.fluid_act(fluids)
Expand Down
2 changes: 1 addition & 1 deletion code/game/turfs/floors/natural/natural_mud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
return 0.0

/turf/floor/natural/dry/fluid_act(datum/reagents/fluids)
if(fluids?.total_volume < FLUID_SHALLOW)
if(fluids?.total_volume < FLUID_PUDDLE)
return ..()
var/turf/new_turf = ChangeTurf(/turf/floor/natural/mud, keep_air = TRUE, keep_height = TRUE)
return new_turf.fluid_act(fluids)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
return TRUE

// Will only be used if you set the anchorable obj flag.
/obj/machinery/atmospherics/binary/wrench_floor_bolts(user)
/obj/machinery/atmospherics/binary/wrench_floor_bolts(mob/user, delay = 2 SECONDS, obj/item/tool)
. = ..()
if(anchored)
set_dir(dir) // making sure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
if (turbine.stat & (BROKEN) || !turbine.anchored || turn(turbine.dir,180) != dir)
turbine = null

/obj/machinery/turbinemotor/wrench_floor_bolts(user)
/obj/machinery/turbinemotor/wrench_floor_bolts(mob/user, delay = 2 SECONDS, obj/item/tool)
. = ..()
updateConnection()

Expand Down
5 changes: 5 additions & 0 deletions code/modules/crafting/stack_recipes/recipes_planks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,8 @@
/decl/stack_recipe/planks/furniture/barrel
result_type = /obj/structure/reagent_dispensers/barrel
difficulty = MAT_VALUE_HARD_DIY

/decl/stack_recipe/planks/furniture/table_frame
result_type = /obj/structure/table/frame
category = "furniture"
difficulty = MAT_VALUE_HARD_DIY
15 changes: 8 additions & 7 deletions code/modules/crafting/textiles/_textiles.dm
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/obj/structure/textiles

abstract_type = /obj/structure/textiles
icon_state = ICON_STATE_WORLD
anchored = TRUE
density = TRUE
material = /decl/material/solid/organic/wood
abstract_type = /obj/structure/textiles
icon_state = ICON_STATE_WORLD
anchored = TRUE
density = TRUE
material = /decl/material/solid/organic/wood
material_alteration = MAT_FLAG_ALTERATION_COLOR | MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_DESC
obj_flags = OBJ_FLAG_ANCHORABLE

var/tmp/working = FALSE
var/work_skill = SKILL_CONSTRUCTION
var/tmp/working = FALSE
var/work_skill = SKILL_CONSTRUCTION
var/product_type
var/datum/composite_sound/work_sound

Expand Down
2 changes: 1 addition & 1 deletion code/modules/fabrication/fabricator_intake.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
if(panel_open && (IS_MULTITOOL(O) || IS_WIRECUTTER(O)))
attack_hand_with_interaction_checks(user)
return TRUE
if((obj_flags & OBJ_FLAG_ANCHORABLE) && IS_WRENCH(O))
if((obj_flags & OBJ_FLAG_ANCHORABLE) && (IS_WRENCH(O) || IS_HAMMER(O)))
return ..()
if(stat & (NOPOWER | BROKEN))
return
Expand Down
2 changes: 1 addition & 1 deletion code/modules/fabrication/fabricator_pipe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
return STATUS_CLOSE
return ..()

/obj/machinery/fabricator/pipe/wrench_floor_bolts()
/obj/machinery/fabricator/pipe/wrench_floor_bolts(mob/user, delay = 2 SECONDS, obj/item/tool)
..()
update_use_power(anchored ? POWER_USE_IDLE : POWER_USE_OFF)

Expand Down
2 changes: 1 addition & 1 deletion code/modules/hydroponics/seed.dm
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@
update_growth_stages()

//Place the plant products at the feet of the user.
/datum/seed/proc/harvest(var/mob/user,var/yield_mod,var/harvest_sample,var/force_amount)
/datum/seed/proc/harvest(var/mob/user, var/yield_mod, var/harvest_sample, var/force_amount)

if(!user)
return FALSE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/hydroponics/trays/tray.dm
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
check_plant_health()

//Harvests the product of a plant.
/obj/machinery/portable_atmospherics/hydroponics/proc/harvest(var/mob/user)
/obj/machinery/portable_atmospherics/hydroponics/proc/harvest(mob/user)

//Harvest the product of the plant,
if(!seed || !harvest)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/hydroponics/trays/tray_soil.dm
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
..()
qdel(src)

/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/harvest()
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/harvest(mob/user)
..()
if(!seed) // Repeat harvests are a thing.
qdel(src)
Expand Down
8 changes: 6 additions & 2 deletions code/modules/mob_holder/holder_mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
to_chat(initiator, "<span class='notice'>You scoop up \the [src]!</span>")
to_chat(src, "<span class='notice'>\The [initiator] scoops you up!</span>")

src.forceMove(H)
forceMove(H)
reset_offsets(0)

target.status_flags |= PASSEMOTES
H.sync(src)
Expand All @@ -46,6 +47,9 @@
return FALSE
if(QDELETED(scooper) || QDELETED(src))
return FALSE
if(!CanPhysicallyInteract(scooper))
if(istype(loc, /obj/item/holder))
if(loc.CanUseTopicPhysical(scooper) != STATUS_INTERACTIVE)
return FALSE
else if(!CanPhysicallyInteract(scooper))
return FALSE
return !!holder_type && scooper.mob_size > src.mob_size
16 changes: 14 additions & 2 deletions code/modules/reagents/reagent_dispenser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
var/unwrenched = FALSE
var/tmp/volume = 1000
var/amount_dispensed = 10
var/can_toggle_open = TRUE
var/tmp/possible_transfer_amounts = @"[10,25,50,100,500]"

/obj/structure/reagent_dispensers/Initialize(ml, _mat, _reinf_mat)
Expand All @@ -22,6 +23,16 @@
if (!possible_transfer_amounts)
verbs -= /obj/structure/reagent_dispensers/verb/set_amount_dispensed

/obj/structure/reagent_dispensers/receive_mouse_drop(atom/dropping, mob/user, params)
if(!(. = ..()) && user?.get_active_held_item() == dropping && isitem(dropping))
// Awful. Sorry.
var/obj/item/item = dropping
var/old_atom_flags = atom_flags
atom_flags |= ATOM_FLAG_OPEN_CONTAINER
if(item.standard_pour_into(user, src))
. = TRUE
atom_flags = old_atom_flags

/obj/structure/reagent_dispensers/on_reagent_change()
..()
if(reagents?.total_volume > 0)
Expand Down Expand Up @@ -311,7 +322,8 @@
/obj/structure/reagent_dispensers/get_alt_interactions(var/mob/user)
. = ..()
LAZYADD(., /decl/interaction_handler/set_transfer/reagent_dispenser)
LAZYADD(., /decl/interaction_handler/toggle_open/reagent_dispenser)
if(can_toggle_open)
LAZYADD(., /decl/interaction_handler/toggle_open/reagent_dispenser)

//Set amount dispensed
/decl/interaction_handler/set_transfer/reagent_dispenser
Expand All @@ -337,4 +349,4 @@
target.atom_flags &= ~ATOM_FLAG_OPEN_CONTAINER
else
target.atom_flags |= ATOM_FLAG_OPEN_CONTAINER
return TRUE
return TRUE
Binary file modified icons/mob/simple_animal/fish_salmon.dmi
Binary file not shown.
4 changes: 2 additions & 2 deletions maps/shaded_hills/shaded_hills-grassland.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"kr" = (
/obj/structure/closet/crate/chest,
/obj/item/tool/pickaxe/iron,
/obj/item/tool/axe/hatchet,
/obj/item/tool/axe,
/obj/abstract/exterior_marker/inside,
/turf/floor/woven,
/area/shaded_hills/outside)
Expand All @@ -96,7 +96,7 @@
/area/shaded_hills/caves)
"mG" = (
/obj/structure/bed/chair/bench/ebony,
/obj/item/knife/utility,
/obj/item/bladed/folding,
/obj/abstract/landmark/start/shaded_hills/miner,
/turf/floor/natural/barren,
/area/shaded_hills/outside)
Expand Down
2 changes: 1 addition & 1 deletion maps/shaded_hills/shaded_hills-woods.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/area/shaded_hills/outside/woods)
"cN" = (
/obj/structure/table/woodentable/ebony,
/obj/item/knife/kitchen,
/obj/item/bladed/knife,
/turf/floor/wood/ebony,
/area/shaded_hills/forester_hut)
"dp" = (
Expand Down
2 changes: 1 addition & 1 deletion maps/shaded_hills/submaps/woods/bear_den/bear_den.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/turf/floor/natural/dirt,
/area/shaded_hills/outside/point_of_interest/bear_den)
"w" = (
/obj/item/knife,
/obj/item/bladed/knife,
/obj/item/cash/imperial/crown,
/obj/item/cash/imperial/crown,
/obj/item/cash/imperial/quin,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
/turf/floor/natural/barren,
/area/shaded_hills/outside/point_of_interest/hunter_camp)
"Z" = (
/obj/item/knife,
/obj/item/bladed/knife,
/turf/floor/natural/barren,
/area/shaded_hills/outside/point_of_interest/hunter_camp)

Expand Down
Loading

0 comments on commit 0d077a7

Please sign in to comment.