Skip to content

Commit

Permalink
Merge pull request #4783 from MistakeNot4892/devupdate
Browse files Browse the repository at this point in the history
Updating dev from staging.
  • Loading branch information
MistakeNot4892 authored Jan 21, 2025
2 parents 42ac5a3 + efec300 commit 81b3367
Show file tree
Hide file tree
Showing 34 changed files with 139 additions and 147 deletions.
3 changes: 2 additions & 1 deletion code/__defines/research.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
#define HOLLOW_OBJECT_MATTER_MULTIPLIER 0.05
#define BASE_OBJECT_MATTER_MULTPLIER 0.25

#define GENERIC_SMELTING_HEAT_POINT 1350 CELSIUS
#define LOW_SMELTING_HEAT_POINT 1150 CELSIUS // Reachable with coal in a kiln on the medieval maps.
#define GENERIC_SMELTING_HEAT_POINT 1350 CELSIUS // Reachable with coal and a bellows in a kiln on medieval maps.
#define HIGH_SMELTING_HEAT_POINT 4000 CELSIUS // must be at least 4074K (3800 C) to melt graphite

#define TECH_MATERIAL "materials"
Expand Down
3 changes: 3 additions & 0 deletions code/_onclick/hud/ai.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/mob/living/silicon/ai
hud_used = /datum/hud/ai

/datum/hud/ai
action_intent_type = null // no selector

/datum/hud/ai/FinalizeInstantiation()
var/list/ai_hud_data = decls_repository.get_decls_of_subtype(/decl/ai_hud)
for(var/elem_type in ai_hud_data)
Expand Down
2 changes: 0 additions & 2 deletions code/_onclick/hud/animal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@
move_intent = new(null, mymob, ui_style, ui_color, ui_alpha, UI_ICON_MOVEMENT)
move_intent.icon_state = mymob.move_intent.hud_icon_state
adding += move_intent
action_intent = new(null, mymob, ui_style, ui_color, ui_alpha)
adding += action_intent
..()
13 changes: 12 additions & 1 deletion code/_onclick/hud/hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@

var/list/hand_hud_objects
var/list/swaphand_hud_objects
var/obj/screen/intent/action_intent
var/obj/screen/movement/move_intent
var/obj/screen/stamina/stamina_bar

var/action_intent_type = /obj/screen/intent
var/obj/screen/intent/action_intent

var/list/adding = list()
var/list/other = list()
var/list/hud_elements = list()
Expand Down Expand Up @@ -118,9 +120,17 @@
return FALSE

/datum/hud/proc/FinalizeInstantiation()

SHOULD_CALL_PARENT(TRUE)

if(!action_intent && action_intent_type) // Everyone needs an intent selector.
action_intent = new action_intent_type(null, mymob)
adding |= action_intent
hud_elements |= action_intent

BuildInventoryUI()
BuildHandsUI()

if(mymob.client)
mymob.client.screen = list()
if(length(hand_hud_objects))
Expand All @@ -133,6 +143,7 @@
mymob.client.screen |= adding
if(length(hotkeybuttons))
mymob.client.screen |= hotkeybuttons

hide_inventory()

/datum/hud/proc/get_ui_style_data()
Expand Down
6 changes: 0 additions & 6 deletions code/_onclick/hud/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@
stamina_bar = new(null, mymob)
adding += stamina_bar

// Draw the attack intent dialogue.
if(hud_data.show_intent_selector)
action_intent = new(null, mymob)
src.adding += action_intent
hud_elements |= action_intent

if(hud_data.has_m_intent)
move_intent = new(null, mymob, ui_style, ui_color, ui_alpha, UI_ICON_MOVEMENT)
move_intent.icon_state = mymob.move_intent.hud_icon_state
Expand Down
5 changes: 0 additions & 5 deletions code/_onclick/hud/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ var/global/obj/screen/robot_inventory
R.ui_drop_grab = new(null, mymob)
adding += R.ui_drop_grab

//Intent
action_intent = new /obj/screen/intent/robot(null, mymob)
action_intent.icon_state = R.get_intent().icon_state

adding += action_intent
adding += new /obj/screen/robot_panel(null, mymob)
adding += new /obj/screen/robot_store(null, mymob)

Expand Down
2 changes: 0 additions & 2 deletions code/_onclick/hud/screen/screen_robot_intent.dm

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
PROCESSING_SUBSYSTEM_DEF(plants)
name = "Plants"
priority = SS_PRIORITY_PLANTS
runlevels = RUNLEVEL_GAME|RUNLEVEL_POSTGAME
flags = SS_BACKGROUND|SS_POST_FIRE_TIMING
init_order = SS_INIT_PLANTS
wait = 60
/datum/proc/process_plants()
SHOULD_NOT_SLEEP(TRUE)
return PROCESS_KILL

PROCESSING_SUBSYSTEM_DEF(plants)
name = "Plants"
priority = SS_PRIORITY_PLANTS
runlevels = RUNLEVEL_GAME|RUNLEVEL_POSTGAME
flags = SS_BACKGROUND|SS_POST_FIRE_TIMING
init_order = SS_INIT_PLANTS
wait = 1 MINUTE
process_proc = TYPE_PROC_REF(/datum, process_plants)
/// Stores generated fruit descs.
var/list/product_descs = list()
/// All seed data stored here.
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/effects/decals/posters/_poster.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
icon = 'icons/obj/items/posters.dmi'
icon_state = "poster0"
anchored = TRUE
directional_offset = @'{"NORTH":{"y":32}, "SOUTH":{"y":-32}, "WEST":{"x":32}, "EAST":{"x":-32}}'
directional_offset = @'{"NORTH":{"y":32}, "SOUTH":{"y":-32}, "EAST":{"x":32}, "WEST":{"x":-32}}'
material = /decl/material/solid/organic/paper
max_health = 10
max_health = 10
parts_type = /obj/item/poster
parts_amount = 1

Expand Down
8 changes: 8 additions & 0 deletions code/game/turfs/floors/subtypes/floor_misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@
/turf/floor/plating
_base_flooring = /decl/flooring/plating // Setting here so overrides on /turf/floor do not impact explicitly typed plating turfs.

// Dirt plating for Tradeship farms.
/turf/floor/plating/dirt
name = "dirt"
icon = 'icons/turf/flooring/dirt.dmi'
icon_state = "dirt"
color = "#41311b"
_flooring = /decl/flooring/dirt

/turf/floor/plating/broken
_floor_broken = TRUE

Expand Down
1 change: 1 addition & 0 deletions code/modules/augment/augment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "embedded augment"
desc = "An embedded augment."
icon = 'icons/obj/augment.dmi'
w_class = ITEM_SIZE_TINY // Need to be tiny to fit inside limbs.
//By default these fit on both flesh and robotic organs and are robotic
organ_properties = ORGAN_PROP_PROSTHETIC
default_action_type = /datum/action/item_action/organ/augment
Expand Down
9 changes: 1 addition & 8 deletions code/modules/clothing/spacesuits/rig/modules/utility.dm
Original file line number Diff line number Diff line change
Expand Up @@ -456,14 +456,7 @@
use_power_cost = 200
usable = 1
selectable = 0
device = /obj/item/paper_bin

/obj/item/rig_module/device/paperdispenser/engage(atom/target)
if(!..() || !device)
return FALSE
if(!target)
device.attack_hand_with_interaction_checks(holder.wearer)
return TRUE
device = /obj/item/form_printer

/obj/item/rig_module/device/pen
name = "mounted pen"
Expand Down
4 changes: 2 additions & 2 deletions code/modules/clothing/spacesuits/rig/rig.dm
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
wearer.visible_message(
SPAN_HARDSUIT("[wearer]'s suit emits a quiet hum as it begins to adjust its seals."),
SPAN_HARDSUIT("With a quiet hum, the suit begins running checks and adjusting components."))
if(seal_delay && !do_after(wearer,seal_delay, src))
if(seal_delay && !do_after(wearer, seal_delay, src))
if(wearer) to_chat(wearer, "<span class='warning'>You must remain still while the suit is adjusting the components.</span>")
failed_to_seal = 1

Expand Down Expand Up @@ -299,7 +299,7 @@
var/obj/item/compare_piece = piece_data[2]
var/msg_type = piece_data[3]

if(!piece)
if(!piece || !compare_piece)
continue

if(!istype(wearer) || !istype(piece) || !istype(compare_piece) || !msg_type)
Expand Down
7 changes: 3 additions & 4 deletions code/modules/hydroponics/seed.dm
Original file line number Diff line number Diff line change
Expand Up @@ -256,16 +256,15 @@

var/growth_rate = 1
var/turf/current_turf = isturf(holder) ? holder : get_turf(holder)
if(istype(holder) && !holder.mechanical && current_turf)
growth_rate = current_turf.get_plant_growth_rate()
if(istype(holder))
growth_rate = holder.get_growth_rate()

var/health_change = 0
// Handle gas consumption.
if(consume_gasses && consume_gasses.len)
var/missing_gas = 0
for(var/gas in consume_gasses)
if(environment && environment.gas && environment.gas[gas] && \
environment.gas[gas] >= consume_gasses[gas])
if(LAZYACCESS(environment?.gas, gas) >= consume_gasses[gas])
if(!check_only)
environment.adjust_gas(gas,-consume_gasses[gas],1)
else
Expand Down
6 changes: 0 additions & 6 deletions code/modules/hydroponics/trays/tray.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
// Mechanical concerns.
var/plant_health = 0 // Plant health.
var/lastproduce = 0 // Last time tray was harvested
var/lastcycle = 0 // Cycle timing/tracking var.
var/cycledelay = 150 // Delay per cycle.
var/closed_system // If set, the tray will attempt to take atmos from a pipe.
var/force_update // Set this to bypass the cycle time check.
var/obj/temp_chem_holder // Something to hold reagents during process_reagents()
Expand Down Expand Up @@ -328,7 +326,6 @@
return //Weed does not exist, someone fucked up.

age = 0
lastcycle = world.time
harvest = 0
weedlevel = 0
pestlevel = 0
Expand Down Expand Up @@ -397,7 +394,6 @@
set_seed(SSplants.seeds[newseed])
mutate(1)
plant_health = seed.get_trait(TRAIT_ENDURANCE) // re-run in case mutation changed our endurance
lastcycle = world.time

update_icon()
visible_message("<span class='danger'>The </span><span class='notice'>[previous_plant]</span><span class='danger'> has suddenly mutated into </span><span class='notice'>[seed.display_name]!</span>")
Expand Down Expand Up @@ -556,7 +552,6 @@
//Snowflakey, maybe move this to the seed datum
// re-running to adjust based on planting method
plant_health = (istype(S, /obj/item/seeds/extracted/cutting) ? round(seed.get_trait(TRAIT_ENDURANCE)/rand(2,5)) : seed.get_trait(TRAIT_ENDURANCE))
lastcycle = world.time

var/needed_skill = seed.mysterious ? SKILL_ADEPT : SKILL_BASIC
if(prob(user.skill_fail_chance(SKILL_BOTANY, 40, needed_skill)))
Expand Down Expand Up @@ -654,7 +649,6 @@
age = 1
// re-running to adjust for planting method
plant_health = (istype(S, /obj/item/seeds/extracted/cutting) ? round(seed.get_trait(TRAIT_ENDURANCE)/rand(2,5)) : seed.get_trait(TRAIT_ENDURANCE))
lastcycle = world.time
check_plant_health()
qdel(S)

Expand Down
56 changes: 24 additions & 32 deletions code/modules/hydroponics/trays/tray_process.dm
Original file line number Diff line number Diff line change
@@ -1,37 +1,29 @@
/obj/machinery/portable_atmospherics/hydroponics/Process()

var/growth_rate = 1
var/turf/T = get_turf(src)
if(istype(T))
if(!mechanical)
growth_rate = T.get_plant_growth_rate()

if(!closed_system)
var/space_left = reagents ? (reagents.maximum_volume - reagents.total_volume) : 0
if(space_left > 0 && reagents.total_volume < 10)
// Handle nearby smoke if any.
for(var/obj/effect/effect/smoke/chem/smoke in view(1, src))
if(smoke.reagents.total_volume)
smoke.reagents.trans_to_obj(src, 5, copy = 1)
// Handle environmental effects like weather and flooding.
if(T.reagents?.total_volume)
T.reagents.trans_to_obj(src, min(space_left, min(T.reagents.total_volume, rand(5,10))))
if(istype(T.weather?.weather_system?.current_state, /decl/state/weather/rain))
var/decl/state/weather/rain/rain = T.weather.weather_system.current_state
if(rain.is_liquid)
reagents.add_reagent(T.weather.water_material, min(space_left, rand(3,5)))
/obj/machinery/portable_atmospherics/hydroponics/proc/get_growth_rate()
return 1

/obj/machinery/portable_atmospherics/hydroponics/process_plants()

var/growth_rate = get_growth_rate()
var/turf/my_turf = get_turf(src)
if(istype(my_turf) && !closed_system)
var/space_left = reagents ? (reagents.maximum_volume - reagents.total_volume) : 0
if(space_left > 0 && reagents.total_volume < 10)
// Handle nearby smoke if any.
for(var/obj/effect/effect/smoke/chem/smoke in view(1, src))
if(smoke.reagents.total_volume)
smoke.reagents.trans_to_obj(src, 5, copy = 1)
// Handle environmental effects like weather and flooding.
if(my_turf.reagents?.total_volume)
my_turf.reagents.trans_to_obj(src, min(space_left, min(my_turf.reagents.total_volume, rand(5,10))))
if(istype(my_turf.weather?.weather_system?.current_state, /decl/state/weather/rain))
var/decl/state/weather/rain/rain = my_turf.weather.weather_system.current_state
if(rain.is_liquid)
reagents.add_reagent(my_turf.weather.water_material, min(space_left, rand(3,5)))

//Do this even if we're not ready for a plant cycle.
process_reagents()
var/needs_icon_update = 0

// Update values every cycle rather than every process() tick.
if(force_update)
force_update = 0
else if(world.time < (lastcycle + cycledelay))
return
lastcycle = world.time

// Mutation level drops each main tick.
mutation_level -= rand(2,4)

Expand Down Expand Up @@ -94,7 +86,7 @@
if(closed_system && (get_port() || holding))
environment = air_contents
// If atmos input is not there, grab from turf.
if(!environment && istype(T)) environment = T.return_air()
if(!environment && istype(my_turf)) environment = my_turf.return_air()
if(!environment) return

// Seed datum handles gasses, light and pressure.
Expand Down Expand Up @@ -148,9 +140,9 @@
if(!closed_system && \
seed.get_trait(TRAIT_SPREAD) == 2 && \
2 * age >= seed.get_trait(TRAIT_MATURATION) && \
!(locate(/obj/effect/vine) in T) && \
!(locate(/obj/effect/vine) in my_turf) && \
prob(2 * seed.get_trait(TRAIT_POTENCY)))
new /obj/effect/vine(T, seed)
new /obj/effect/vine(my_turf, seed)

if(prob(3)) // On each tick, there's a chance the pest population will increase
pestlevel += 0.1 * growth_rate
Expand Down
10 changes: 8 additions & 2 deletions code/modules/hydroponics/trays/tray_soil.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
LAZYREMOVE(., global._reagent_interactions)
LAZYADD(., /decl/interaction_handler/empty_into)

/obj/machinery/portable_atmospherics/hydroponics/soil/get_growth_rate()
var/turf/my_turf = get_turf(src)
return max(0, my_turf?.get_plant_growth_rate())

/obj/machinery/portable_atmospherics/hydroponics/soil/Initialize()

. = ..()
Expand Down Expand Up @@ -162,7 +166,6 @@
dead = 0
age = start_mature ? seed.get_trait(TRAIT_MATURATION) : 1
plant_health = seed.get_trait(TRAIT_ENDURANCE)
lastcycle = world.time
if(isnull(default_pixel_y))
default_pixel_y = rand(-12,12)
if(isnull(default_pixel_y))
Expand Down Expand Up @@ -199,4 +202,7 @@
for(var/obj/effect/vine/plant in get_turf(src))
if(plant.invisibility == INVISIBILITY_MAXIMUM)
plant.set_invisibility(initial(plant.invisibility))
. = ..()
. = ..()

/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/get_growth_rate()
return max(..(), 1)
2 changes: 1 addition & 1 deletion code/modules/materials/definitions/solids/_mat_solid.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
solution_name = "[name] solution"
if(!ore_compresses_to)
ore_compresses_to = type
. = ..()
. = ..()
Original file line number Diff line number Diff line change
Expand Up @@ -487,3 +487,4 @@
taste_mult = 0 //no taste
color = "#dcdcdc"
value = 0.5
melting_point = 3422 CELSIUS
Loading

0 comments on commit 81b3367

Please sign in to comment.