Skip to content

Commit

Permalink
Merge branch 'master' into scrapaudit
Browse files Browse the repository at this point in the history
  • Loading branch information
firebudgy authored Jan 17, 2025
2 parents e5666a4 + 19366fc commit 275b075
Show file tree
Hide file tree
Showing 26 changed files with 122 additions and 104 deletions.
12 changes: 6 additions & 6 deletions code/__DEFINES/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@
/// The natural temperature for a body
#define HUMAN_BODYTEMP_NORMAL 310.15
/// This is the divisor which handles how much of the temperature difference between the current body temperature and 310.15K (optimal temperature) humans auto-regenerate each tick. The higher the number, the slower the recovery. This is applied each tick, so long as the mob is alive.
#define HUMAN_BODYTEMP_AUTORECOVERY_DIVISOR 22
#define HUMAN_BODYTEMP_AUTORECOVERY_DIVISOR 11
/// Minimum amount of kelvin moved toward 310K per tick. So long as abs(310.15 - bodytemp) is more than 50.
#define HUMAN_BODYTEMP_AUTORECOVERY_MINIMUM 12
///Similar to the HUMAN_BODYTEMP_AUTORECOVERY_DIVISOR, but this is the divisor which is applied at the stage that follows autorecovery. This is the divisor which comes into play when the human's loc temperature is lower than their body temperature. Make it lower to lose bodytemp faster.
#define HUMAN_BODYTEMP_COLD_DIVISOR 20
#define HUMAN_BODYTEMP_COLD_DIVISOR 10
/// Similar to the HUMAN_BODYTEMP_AUTORECOVERY_DIVISOR, but this is the divisor which is applied at the stage that follows autorecovery. This is the divisor which comes into play when the human's loc temperature is higher than their body temperature. Make it lower to gain bodytemp faster.
#define HUMAN_BODYTEMP_HEAT_DIVISOR 10
/// The maximum number of degrees that your body can cool in 1 tick, due to the environment, when in a cold area.
#define HUMAN_BODYTEMP_COOLING_MAX -100
#define HUMAN_BODYTEMP_COOLING_MAX -20
/// The maximum number of degrees that your body can heat up in 1 tick, due to the environment, when in a hot area.
#define HUMAN_BODYTEMP_HEATING_MAX 30
#define HUMAN_BODYTEMP_HEATING_MAX 10
/// The body temperature limit the human body can take before it starts taking damage from heat.
/// This also affects how fast the body normalises it's temperature when hot.
/// 340k is about 66c, and rather high for a human.
#define HUMAN_BODYTEMP_HEAT_DAMAGE_LIMIT (HUMAN_BODYTEMP_NORMAL + 3)
#define HUMAN_BODYTEMP_HEAT_DAMAGE_LIMIT (HUMAN_BODYTEMP_NORMAL + 30)
/// The body temperature limit the human body can take before it starts taking damage from cold.
/// This also affects how fast the body normalises it's temperature when cold.
/// 270k is about -3c, that is below freezing and would hurt over time.
#define HUMAN_BODYTEMP_COLD_DAMAGE_LIMIT (HUMAN_BODYTEMP_NORMAL - 8)
#define HUMAN_BODYTEMP_COLD_DAMAGE_LIMIT (HUMAN_BODYTEMP_NORMAL - 40)


//VOX DEFINES
Expand Down
29 changes: 28 additions & 1 deletion code/__DEFINES/tgs.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// tgstation-server DMAPI
// The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in IETF RFC 2119.

#define TGS_DMAPI_VERSION "7.3.0"
#define TGS_DMAPI_VERSION "7.3.1"

// All functions and datums outside this document are subject to change with any version and should not be relied on.

Expand Down Expand Up @@ -58,6 +58,11 @@
#define TGS_FILE2TEXT_NATIVE file2text
#endif

// SpacemanDMM compatibility
#ifndef CAN_BE_REDEFINED
#define CAN_BE_REDEFINED(X)
#endif

// EVENT CODES

/// Before a reboot mode change, extras parameters are the current and new reboot mode enums.
Expand Down Expand Up @@ -160,6 +165,7 @@
* * http_handler - Optional user defined [/datum/tgs_http_handler].
*/
/world/proc/TgsNew(datum/tgs_event_handler/event_handler, minimum_required_security_level = TGS_SECURITY_ULTRASAFE, datum/tgs_http_handler/http_handler)
CAN_BE_REDEFINED(TRUE)
return

/**
Expand All @@ -170,13 +176,15 @@
* This function should not be called before ..() in [/world/proc/New].
*/
/world/proc/TgsInitializationComplete()
CAN_BE_REDEFINED(TRUE)
return

/// Consumers MUST run this macro at the start of [/world/proc/Topic].
#define TGS_TOPIC var/tgs_topic_return = TgsTopic(args[1]); if(tgs_topic_return) return tgs_topic_return

/// Consumers MUST call this as late as possible in [world/proc/Reboot] (BEFORE ..()).
/world/proc/TgsReboot()
CAN_BE_REDEFINED(TRUE)
return

// DATUM DEFINITIONS
Expand Down Expand Up @@ -214,6 +222,7 @@
* Returns [TRUE]/[FALSE] based on if the [/datum/tgs_version] contains wildcards.
*/
/datum/tgs_version/proc/Wildcard()
CAN_BE_REDEFINED(TRUE)
return

/**
Expand All @@ -222,6 +231,7 @@
* other_version - The [/datum/tgs_version] to compare against.
*/
/datum/tgs_version/proc/Equals(datum/tgs_version/other_version)
CAN_BE_REDEFINED(TRUE)
return

/// Represents a merge of a GitHub pull request.
Expand Down Expand Up @@ -459,16 +469,19 @@

/// Returns the maximum supported [/datum/tgs_version] of the DMAPI.
/world/proc/TgsMaximumApiVersion()
CAN_BE_REDEFINED(TRUE)
return

/// Returns the minimum supported [/datum/tgs_version] of the DMAPI.
/world/proc/TgsMinimumApiVersion()
CAN_BE_REDEFINED(TRUE)
return

/**
* Returns [TRUE] if DreamDaemon was launched under TGS, the API matches, and was properly initialized. [FALSE] will be returned otherwise.
*/
/world/proc/TgsAvailable()
CAN_BE_REDEFINED(TRUE)
return

// No function below this succeeds if it TgsAvailable() returns FALSE or if TgsNew() has yet to be called.
Expand All @@ -480,6 +493,7 @@
* If TGS has not requested a [TGS_REBOOT_MODE_SHUTDOWN] DreamDaemon will be launched again.
*/
/world/proc/TgsEndProcess()
CAN_BE_REDEFINED(TRUE)
return

/**
Expand All @@ -490,6 +504,7 @@
* admin_only: If [TRUE], message will be sent to admin connected chats. Vice-versa applies.
*/
/world/proc/TgsTargetedChatBroadcast(datum/tgs_message_content/message, admin_only = FALSE)
CAN_BE_REDEFINED(TRUE)
return

/**
Expand All @@ -500,6 +515,7 @@
* user: The [/datum/tgs_chat_user] to PM.
*/
/world/proc/TgsChatPrivateMessage(datum/tgs_message_content/message, datum/tgs_chat_user/user)
CAN_BE_REDEFINED(TRUE)
return

/**
Expand All @@ -510,42 +526,52 @@
* channels - Optional list of [/datum/tgs_chat_channel]s to restrict the message to.
*/
/world/proc/TgsChatBroadcast(datum/tgs_message_content/message, list/channels = null)
CAN_BE_REDEFINED(TRUE)
return

/// Returns the current [/datum/tgs_version] of TGS if it is running the server, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsVersion()
CAN_BE_REDEFINED(TRUE)
return

/// Returns the running engine type
/world/proc/TgsEngine()
CAN_BE_REDEFINED(TRUE)
return

/// Returns the current [/datum/tgs_version] of the DMAPI being used if it was activated, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsApiVersion()
CAN_BE_REDEFINED(TRUE)
return

/// Returns the name of the TGS instance running the game if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsInstanceName()
CAN_BE_REDEFINED(TRUE)
return

/// Return the current [/datum/tgs_revision_information] of the running server if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsRevision()
CAN_BE_REDEFINED(TRUE)
return

/// Returns the current BYOND security level as a TGS_SECURITY_ define if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsSecurityLevel()
CAN_BE_REDEFINED(TRUE)
return

/// Returns the current BYOND visibility level as a TGS_VISIBILITY_ define if TGS is present, null otherwise. Requires TGS to be using interop API version 5 or higher otherwise the string "___unimplemented" wil be returned. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsVisibility()
CAN_BE_REDEFINED(TRUE)
return

/// Returns a list of active [/datum/tgs_revision_information/test_merge]s if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsTestMerges()
CAN_BE_REDEFINED(TRUE)
return

/// Returns a list of connected [/datum/tgs_chat_channel]s if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsChatChannelInfo()
CAN_BE_REDEFINED(TRUE)
return

/**
Expand All @@ -556,6 +582,7 @@
* wait_for_completion - If set, this function will not return until the event has run to completion.
*/
/world/proc/TgsTriggerEvent(event_name, list/parameters, wait_for_completion = FALSE)
CAN_BE_REDEFINED(TRUE)
return

/*
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/hud/alert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ Override makes it so the alert is not replaced until cleared by a clear_alert wi

/atom/movable/screen/alert/sweat
name = "Sweating"
desc = "You're sweating and the heat is starting to hurt. Stay hydrated, get somewhere cooler, and take off any insulating clothing like a fire suit."
desc = "You're sweating and the heat is starting to hurt. Get somewhere cooler, and take off any insulating clothing like a fire suit."
icon_state = "sweat"

/atom/movable/screen/alert/shiver
Expand Down
5 changes: 1 addition & 4 deletions code/datums/mood_events/generic_negative_events.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,7 @@

/datum/mood_event/brain_damage
mood_change = -3

/datum/mood_event/brain_damage/add_effects()
var/damage_message = pick_list_replacements(BRAIN_DAMAGE_FILE, "brain_damage")
description = span_warning("Hurr durr... [damage_message]")
description = span_warning("It's so... Hard to think...")

/datum/mood_event/hulk //Entire duration of having the hulk mutation
description = span_warning("HULK SMASH!")
Expand Down
2 changes: 1 addition & 1 deletion code/datums/weather/weather_types/hailstorm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
/// Think of some good solution of how weather should affect monsters and how they should be resistant to things like this
if(isanimal(living_mob))
return
living_mob.adjust_bodytemperature(-rand(1,2))
living_mob.adjust_bodytemperature(-rand(3,6), 243)
living_mob.adjustBruteLoss(rand(2,4))
2 changes: 1 addition & 1 deletion code/datums/weather/weather_types/snowfall.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
thunder_chance = 2

/datum/weather/snowfall/heavy/weather_act(mob/living/living_mob)
living_mob.adjust_bodytemperature(-rand(1,2))
living_mob.adjust_bodytemperature(-rand(2,4), 243)
27 changes: 15 additions & 12 deletions code/game/objects/structures/shower.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
if(isliving(A))
check_heat(A)

if(iscarbon(A)) //WS edit - moth dust from hugging
if(iscarbon(A))
var/mob/living/carbon/C = A
C.mothdust -= 10;

Expand All @@ -130,18 +130,21 @@
qdel(src)

/obj/machinery/shower/proc/check_heat(mob/living/L)
var/mob/living/carbon/C = L

if(current_temperature == SHOWER_FREEZING)
if(iscarbon(L))
C.adjust_bodytemperature(-5, 280)
to_chat(L, "<span class='warning'>[src] is freezing!</span>")
else if(current_temperature == SHOWER_BOILING)
if(iscarbon(L))
C.adjust_bodytemperature(5, 0, 350)
L.adjustFireLoss(5)
to_chat(L, "<span class='danger'>[src] is searing!</span>")
if(iscarbon(L))
var/mob/living/carbon/C = L

switch(current_temperature)
if(SHOWER_FREEZING)
C.adjust_bodytemperature(-3, 280)
to_chat(L, "<span class='warning'>[src] is cold!</span>")
if(SHOWER_BOILING)
C.adjust_bodytemperature(3, 0, 330)
to_chat(L, "<span class='danger'>[src] is hot!</span>")
if(SHOWER_NORMAL)
if(C.bodytemperature >= HUMAN_BODYTEMP_NORMAL)
C.adjust_bodytemperature(-2, HUMAN_BODYTEMP_NORMAL)
else
C.adjust_bodytemperature(2, HUMAN_BODYTEMP_NORMAL)

/obj/effect/mist
name = "mist"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/food_and_drinks/food/snacks/meat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
desc = "A synthetic slab of meat."
icon_state = "meat_old"
cooked_type = /obj/item/reagent_containers/food/snacks/meat/steak/synth
foodtype = RAW | MEAT //hurr durr chemicals we're harmed in the production of this meat thus its non-vegan.
foodtype = RAW | MEAT

/obj/item/reagent_containers/food/snacks/meat/slab/meatproduct
name = "meat product"
Expand Down
20 changes: 3 additions & 17 deletions code/modules/mob/living/carbon/human/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ GLOBAL_LIST_EMPTY(roundstart_races)
/// Minimum amount of kelvin moved toward normal body temperature per tick.
var/bodytemp_autorecovery_min = HUMAN_BODYTEMP_AUTORECOVERY_MINIMUM
/// The maximum temperature the species is comfortable at. Going above this does not apply any effects, but warns players that the temperture is hot
var/max_temp_comfortable = (HUMAN_BODYTEMP_NORMAL) //20 c will always be below human bodytemp, this just makes it so when it can sustain that its higher
var/max_temp_comfortable = (HUMAN_BODYTEMP_NORMAL + 7) //20 c will always be below human bodytemp, this just makes it so when it can sustain that its higher
/// The minimum temperature the species is comfortable at. Going below this does not apply any effects, but warns players that the temperture is chilly
var/min_temp_comfortable = (HUMAN_BODYTEMP_NORMAL - 1)
var/min_temp_comfortable = (HUMAN_BODYTEMP_NORMAL - 5)
/// This is the divisor which handles how much of the temperature difference between the current body temperature and 310.15K (optimal temperature) humans auto-regenerate each tick. The higher the number, the slower the recovery.
var/bodytemp_autorecovery_divisor = HUMAN_BODYTEMP_AUTORECOVERY_DIVISOR
///Similar to the autorecovery_divsor, but this is the divisor which is applied at the stage that follows autorecovery. This is the divisor which comes into play when the human's loc temperature is higher than their body temperature. Make it lower to lose bodytemp faster.
Expand Down Expand Up @@ -1431,13 +1431,6 @@ GLOBAL_LIST_EMPTY(roundstart_races)
if(radiation > RAD_MOB_VOMIT && prob(RAD_MOB_VOMIT_PROB))
H.vomit(10, TRUE)

if(radiation > RAD_MOB_MUTATE)
if(prob(1))
to_chat(H, "<span class='danger'>You mutate!</span>")
H.easy_randmut(NEGATIVE+MINOR_NEGATIVE)
H.emote("gasp")
H.domutcheck()

if(radiation > RAD_MOB_HAIRLOSS)
if(prob(15) && !(H.hairstyle == "Bald") && (HAIR in species_traits))
to_chat(H, "<span class='danger'>Your hair starts to fall out in clumps...</span>")
Expand Down Expand Up @@ -1955,13 +1948,6 @@ GLOBAL_LIST_EMPTY(roundstart_races)
else
H.throw_alert("temp", /atom/movable/screen/alert/sweat, 3)

//Stay hydrated.
if(!(H.mob_biotypes & MOB_ROBOTIC) && H.reagents.has_reagent(/datum/reagent/water) && H.stat != DEAD)
burn_damage -= clamp(H.reagents.get_reagent_amount(/datum/reagent/water) /10, 0, 2)
// if youre dead, no need to sweat?
if(H.stat != DEAD)
burn_damage -= (max(burn_damage - 2.5, 0))

// Apply species and physiology modifiers to heat damage
burn_damage = burn_damage * heatmod * H.physiology.heat_mod

Expand Down Expand Up @@ -2016,7 +2002,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
firemodifier = min(firemodifier, 0)

// this can go below 5 at log 2.5
burn_damage = max(log(2 - firemodifier, (current_human.bodytemperature - current_human.get_body_temp_normal(apply_change=FALSE))) - 2,0)
burn_damage = max(log(2 - firemodifier, (current_human.bodytemperature - current_human.get_body_temp_normal(apply_change=FALSE))) - 5,0)
return burn_damage

/// Handle the air pressure of the environment
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/species_types/kepori.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
bodytemp_heat_damage_limit = HUMAN_BODYTEMP_HEAT_DAMAGE_LIMIT + 35
bodytemp_cold_damage_limit = HUMAN_BODYTEMP_COLD_DAMAGE_LIMIT + 3

max_temp_comfortable = HUMAN_BODYTEMP_NORMAL + 15
min_temp_comfortable = HUMAN_BODYTEMP_NORMAL - 1
max_temp_comfortable = HUMAN_BODYTEMP_NORMAL + 40
min_temp_comfortable = HUMAN_BODYTEMP_NORMAL - 3

bodytemp_autorecovery_divisor = HUMAN_BODYTEMP_AUTORECOVERY_DIVISOR - 4

Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/species_types/mothmen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
species_l_leg = /obj/item/bodypart/leg/left/moth
species_r_leg = /obj/item/bodypart/leg/right/moth

min_temp_comfortable = HUMAN_BODYTEMP_NORMAL - 2
bodytemp_cold_damage_limit = HUMAN_BODYTEMP_COLD_DAMAGE_LIMIT - 2
min_temp_comfortable = HUMAN_BODYTEMP_NORMAL - 5
bodytemp_cold_damage_limit = HUMAN_BODYTEMP_COLD_DAMAGE_LIMIT - 5

/datum/species/moth/regenerate_organs(mob/living/carbon/C, datum/species/old_species,replace_current=TRUE, list/excluded_zones, robotic = FALSE)
. = ..()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/species_types/vox.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
bodytemp_cold_divisor = VOX_BODYTEMP_COLD_DIVISOR
bodytemp_autorecovery_min = VOX_BODYTEMP_AUTORECOVERY_MIN

max_temp_comfortable = HUMAN_BODYTEMP_NORMAL + 1
max_temp_comfortable = HUMAN_BODYTEMP_NORMAL + 10
min_temp_comfortable = HUMAN_BODYTEMP_NORMAL - 20

bodytemp_heat_damage_limit = HUMAN_BODYTEMP_HEAT_DAMAGE_LIMIT + 10
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
natural_change = (1 / (thermal_protection + 1)) * natural_change

// Apply the natural stabilization changes
adjust_bodytemperature(natural_change)
adjust_bodytemperature(natural_change, use_insulation=FALSE)

/**
* Get the insulation that is appropriate to the temperature you're being exposed to.
Expand Down Expand Up @@ -635,7 +635,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
* * use_steps (optional) Use the body temp divisors and max change rates
* * hardsuit_fix (optional) num HUMAN_BODYTEMP_NORMAL - H.bodytemperature Use hardsuit override until hardsuits fix is done...
*/
/mob/living/carbon/adjust_bodytemperature(amount, min_temp=0, max_temp=INFINITY, use_insulation=FALSE, use_steps=FALSE, \
/mob/living/carbon/adjust_bodytemperature(amount, min_temp=0, max_temp=INFINITY, use_insulation=TRUE, use_steps=FALSE, \
hardsuit_fix=FALSE)
// apply insulation to the amount of change
if(use_insulation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
damage_type = BURN
nodamage = TRUE
flag = "energy"
temperature = -5 // Cools you down! per hit!
temperature = -25 // Cools you down! per hit!

/obj/projectile/temp/basilisk/super
temperature = -20
temperature = -50
damage = 5
nodamage = FALSE

Expand Down
Loading

0 comments on commit 275b075

Please sign in to comment.