Skip to content

Commit 7a498a3

Browse files
authored
Hydroponics change and general QOL (#998)
* hydroponics change * tgstation/tgstation#84006 * gdi
1 parent 7a345a3 commit 7a498a3

File tree

3 files changed

+40
-20
lines changed

3 files changed

+40
-20
lines changed

code/__HELPERS/game.dm

+21-8
Original file line numberDiff line numberDiff line change
@@ -316,16 +316,29 @@
316316

317317
///Recursively checks if an item is inside a given type, even through layers of storage. Returns the atom if it finds it.
318318
/proc/recursive_loc_check(atom/movable/target, type)
319-
var/atom/atom_to_find = target
320-
if(istype(atom_to_find, type))
321-
return atom_to_find
319+
var/atom/atom_to_find = null
322320

323-
while(!istype(atom_to_find.loc, type))
324-
if(!atom_to_find.loc)
325-
return
326-
atom_to_find = atom_to_find.loc
321+
if(ispath(type))
322+
atom_to_find = target
323+
if(istype(atom_to_find, type))
324+
return atom_to_find
327325

328-
return atom_to_find.loc
326+
while(!istype(atom_to_find.loc, type))
327+
if(!atom_to_find.loc)
328+
return
329+
atom_to_find = atom_to_find.loc
330+
331+
else if(isatom(type))
332+
atom_to_find = target
333+
if(atom_to_find.loc == type)
334+
return atom_to_find
335+
336+
while(atom_to_find.loc != type)
337+
if(!atom_to_find.loc)
338+
return
339+
atom_to_find = atom_to_find.loc
340+
341+
return atom_to_find
329342

330343
///Send a message in common radio when a player arrives
331344
/proc/announce_arrival(mob/living/carbon/human/character, rank)

code/modules/hydroponics/hydroponics.dm

+5-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@
295295

296296
//Water//////////////////////////////////////////////////////////////////
297297
// Drink random amount of water
298-
adjust_waterlevel(-rand(1,6) / rating)
298+
adjust_waterlevel(-0.4 / rating)
299299

300300
// If the plant is dry, it loses health pretty fast, unless mushroom
301301
if(waterlevel <= 10 && !myseed.get_gene(/datum/plant_gene/trait/plant_type/fungal_metabolism))
@@ -815,13 +815,17 @@
815815
var/water_amt = reagent_source.reagents.get_reagent_amount(/datum/reagent/water) * split / reagent_source.reagents.total_volume
816816
H.adjust_waterlevel(round(water_amt))
817817
reagent_source.reagents.remove_reagent(/datum/reagent/water, water_amt)
818+
818819
reagent_source.reagents.trans_to(H.reagents, split, transfered_by = user)
819820
lastuser = WEAKREF(user)
821+
820822
if(IS_EDIBLE(reagent_source) || istype(reagent_source, /obj/item/reagent_containers/pill))
821823
qdel(reagent_source)
822824
H.update_appearance()
823825
return 1
826+
824827
H.update_appearance()
828+
825829
if(reagent_source) // If the source wasn't composted and destroyed
826830
reagent_source.update_appearance()
827831
return 1

code/modules/mob/living/living.dm

+14-11
Original file line numberDiff line numberDiff line change
@@ -1034,51 +1034,54 @@
10341034
/mob/living/can_hold_items(obj/item/I)
10351035
return usable_hands && ..()
10361036

1037-
/mob/living/canUseTopic(atom/movable/target, flags)
1037+
/mob/living/canUseTopic(atom/target, flags)
1038+
if(stat != CONSCIOUS)
1039+
to_chat(src, span_warning("You cannot do that while unconscious."))
1040+
return FALSE
10381041

10391042
// If the MOBILITY_UI bitflag is not set it indicates the mob's hands are cutoff, blocked, or handcuffed
10401043
// Note - AI's and borgs have the MOBILITY_UI bitflag set even though they don't have hands
10411044
// Also if it is not set, the mob could be incapcitated, knocked out, unconscious, asleep, EMP'd, etc.
10421045
if(!(mobility_flags & MOBILITY_UI) && !(flags & USE_RESTING))
1043-
to_chat(src, span_warning("You can't do that right now!"))
1046+
to_chat(src, span_warning("You cannot do that right now."))
10441047
return FALSE
10451048

10461049
// NEED_HANDS is already checked by MOBILITY_UI for humans so this is for silicons
10471050
if((flags & USE_NEED_HANDS) && !can_hold_items(isitem(target) ? target : null)) //almost redundant if it weren't for mobs,
1048-
to_chat(src, span_warning("You don't have the physical ability to do this!"))
1051+
to_chat(src, span_warning("You are not physically capable of doing that."))
10491052
return FALSE
10501053

1051-
if((flags & USE_CLOSE) && !Adjacent(target) && (target.loc != src))
1054+
if((flags & USE_CLOSE) && !CanReach(target) && (recursive_loc_check(src, target)))
10521055
if(issilicon(src) && !ispAI(src))
10531056
if(!(flags & USE_SILICON_REACH)) // silicons can ignore range checks (except pAIs)
1054-
to_chat(src, span_warning("You are too far away!"))
1057+
to_chat(src, span_warning("You are too far away."))
10551058
return FALSE
10561059

10571060
else if(flags & USE_IGNORE_TK)
1058-
to_chat(src, span_warning("You are too far away!"))
1061+
to_chat(src, span_warning("You are too far away."))
10591062
return FALSE
10601063

10611064
else
10621065
var/datum/dna/D = has_dna()
10631066
if(!D || !D.check_mutation(/datum/mutation/human/telekinesis) || !tkMaxRangeCheck(src, target))
1064-
to_chat(src, span_warning("You are too far away!"))
1067+
to_chat(src, span_warning("You are too far away."))
10651068
return FALSE
10661069

10671070
if((flags & USE_DEXTERITY) && !ISADVANCEDTOOLUSER(src))
1068-
to_chat(src, span_warning("You don't have the dexterity to do this!"))
1071+
to_chat(src, span_warning("You do not have the dexterity required to do that."))
10691072
return FALSE
10701073

10711074
if((flags & USE_LITERACY) && !is_literate())
1072-
to_chat(src, span_warning("You can't comprehend any of this!"))
1075+
to_chat(src, span_warning("You cannot comprehend this."))
10731076
return FALSE
10741077
return TRUE
10751078

10761079
/mob/living/proc/can_use_guns(obj/item/G)//actually used for more than guns!
10771080
if(G.trigger_guard == TRIGGER_GUARD_NONE)
1078-
to_chat(src, span_warning("You are unable to fire this!"))
1081+
to_chat(src, span_warning("You are unable to fire that."))
10791082
return FALSE
10801083
if(G.trigger_guard != TRIGGER_GUARD_ALLOW_ALL && (!ISADVANCEDTOOLUSER(src) && !HAS_TRAIT(src, TRAIT_GUN_NATURAL)))
1081-
to_chat(src, span_warning("You try to fire [G], but can't use the trigger!"))
1084+
to_chat(src, span_warning("You attempt to fire [G], but cannot pull the trigger."))
10821085
return FALSE
10831086
return TRUE
10841087

0 commit comments

Comments
 (0)