Skip to content

Commit

Permalink
Brainmed patch 3.14159 (#889)
Browse files Browse the repository at this point in the history
* pain redux

* pain spike reduced by painkillers

* slowdown stuffs

* FUCK

* oops

* rename multiplicative slowdown fuck you

* grammar

* experimental pain changes

* experimental pain shit i apparently for got to commit

* blood refactor

* tweak epinephrine

* brainmed 3

* macros

* whoops

* fix germs

* shock changes

* fix emote stuffs

* huh?
  • Loading branch information
Kapu1178 authored Mar 22, 2024
1 parent 36169eb commit a447482
Show file tree
Hide file tree
Showing 85 changed files with 522 additions and 361 deletions.
3 changes: 3 additions & 0 deletions code/__DEFINES/combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ GLOBAL_LIST_INIT(shove_disarming_types, typecacheof(list(
#define BODY_ZONE_PRECISE_L_FOOT "l_foot"
#define BODY_ZONE_PRECISE_R_FOOT "r_foot"

/// The max damage capacity of the average human. Used for balance purposes.
#define CARBON_BODYPART_HEALTH_SUM (/obj/item/bodypart/head::max_damage + /obj/item/bodypart/chest::max_damage + /obj/item/bodypart/leg::max_damage + /obj/item/bodypart/arm::max_damage)

//We will round to this value in damage calculations.
#define DAMAGE_PRECISION 0.1

Expand Down
7 changes: 6 additions & 1 deletion code/__DEFINES/logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#define LOG_VICTIM (1 << 20)
#define LOG_RADIO_EMOTE (1 << 21)
#define LOG_MECHCOMP (1 <<22)
#define LOG_HEALTH (1<< 23)

//Individual logging panel pages
#define INDIVIDUAL_ATTACK_LOG (LOG_ATTACK | LOG_VICTIM)
Expand All @@ -48,7 +49,11 @@
#define INDIVIDUAL_COMMS_LOG (LOG_PDA | LOG_CHAT | LOG_COMMENT | LOG_TELECOMMS)
#define INDIVIDUAL_OOC_LOG (LOG_OOC | LOG_ADMIN)
#define INDIVIDUAL_OWNERSHIP_LOG (LOG_OWNERSHIP)
#define INDIVIDUAL_SHOW_ALL_LOG (LOG_ATTACK | LOG_SAY | LOG_WHISPER | LOG_EMOTE | LOG_RADIO_EMOTE | LOG_DSAY | LOG_PDA | LOG_CHAT | LOG_COMMENT | LOG_TELECOMMS | LOG_OOC | LOG_ADMIN | LOG_OWNERSHIP | LOG_GAME | LOG_ADMIN_PRIVATE | LOG_ASAY | LOG_MECHA | LOG_VIRUS | LOG_CLONING | LOG_SHUTTLE | LOG_ECON | LOG_VICTIM)
#define INDIVIDUAL_HEALTH_LOG (LOG_HEALTH)
#define INDIVIDUAL_SHOW_ALL_LOG (ALL)

#define LOGSRC_CKEY "Ckey"
#define LOGSRC_MOB "Mob"


#define log_health(mob, message) mob?.log_message(message, LOG_HEALTH, COLOR_GREEN, FALSE)
6 changes: 4 additions & 2 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
#define MOVE_INTENT_SPRINT "sprint"

//Blood levels
#define BLOOD_VOLUME_MAX_LETHAL 2150
#define BLOOD_VOLUME_ABSOLUTE_MAX 2150
#define BLOOD_VOLUME_MAX_LETHAL BLOOD_VOLUME_ABSOLUTE_MAX
#define BLOOD_VOLUME_EXCESS 2100
#define BLOOD_VOLUME_MAXIMUM 2000
#define BLOOD_VOLUME_SLIME_SPLIT 1120
Expand Down Expand Up @@ -512,7 +513,8 @@

// /obj/item/bodypart on_mob_life() retval flag
#define BODYPART_LIFE_UPDATE_HEALTH (1<<0)
#define BODYPART_LIFE_UPDATE_DAMAGE_OVERLAYS (1<<1)
#define BODYPART_LIFE_UPDATE_HEALTH_HUD (1<<1)
#define BODYPART_LIFE_UPDATE_DAMAGE_OVERLAYS (1<<2)

#define MAX_REVIVE_FIRE_DAMAGE 180
#define MAX_REVIVE_BRUTE_DAMAGE 180
Expand Down
23 changes: 20 additions & 3 deletions code/__DEFINES/pain.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,23 @@
#define SHOCK_TIER_6 120
#define SHOCK_TIER_7 150

#define PAIN_AMT_LOW 10
#define PAIN_AMT_MEDIUM 40
#define PAIN_AMT_AGONIZING 70
/// The amount of shock required for someone to be elligible for shock-induced fibrillation
#define SHOCK_AMT_FOR_FIBRILLATION 120

/// The amount of pain where the mob is rendered unconscious
#define PAIN_AMT_PASSOUT (200)

/// The amount of pain where movement slowdown beings
#define PAIN_AMT_BEGIN_SLOWDOWN (PAIN_AMT_PASSOUT * 0.075)
#define PAIN_MAX_SLOWDOWN 5

#define PAIN_AMT_LOW (PAIN_AMT_PASSOUT * 0.05)
#define PAIN_AMT_MEDIUM (PAIN_AMT_PASSOUT * 0.35)
#define PAIN_AMT_AGONIZING (PAIN_AMT_PASSOUT * 0.85)

/// max_damage * this value is the amount of pain constantly applied when the limb bone is broken
#define BROKEN_BONE_PAIN_FACTOR 0.1
/// max_damage * this value is the amount of pain constantly applied when the limb is dislocated
#define DISLOCATED_LIMB_PAIN_FACTOR 0.05
/// The amount of pain applied immediately when a bone breaks
#define BONE_BREAK_APPLICATION_PAIN 60
2 changes: 1 addition & 1 deletion code/__DEFINES/wounds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#define WOUND_DETERMINATION_BLEED_MOD 0.85

/// How often can we annoy the player about their bleeding? This duration is extended if it's not serious bleeding
#define BLEEDING_MESSAGE_BASE_CD 10 SECONDS
#define BLEEDING_MESSAGE_BASE_CD (10 SECONDS)

///The percentage of damage at which a bodypart can start to be dismembered.
#define LIMB_DISMEMBERMENT_PERCENT 0.9
Expand Down
26 changes: 26 additions & 0 deletions code/__HELPERS/pronouns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
/datum/proc/p_do(temp_gender)
. = "does"

/datum/proc/p_dont(temp_gender)
. = "doesnt"

/datum/proc/p_theyve(capitalized, temp_gender)
. = p_they(capitalized, temp_gender) + "'" + copytext_char(p_have(temp_gender), 3)

Expand Down Expand Up @@ -136,6 +139,14 @@
if(temp_gender == PLURAL || temp_gender == NEUTER)
. = "do"

/client/p_dont(temp_gender)
if(!temp_gender)
temp_gender = gender

. = "doesn't"
if(temp_gender == PLURAL || temp_gender == NEUTER)
. = "don't"

/client/p_s(temp_gender)
if(!temp_gender)
temp_gender = gender
Expand Down Expand Up @@ -233,6 +244,14 @@
if(temp_gender == PLURAL)
. = "do"

/mob/p_dont(temp_gender)
if(!temp_gender)
temp_gender = gender

. = "doesn't"
if(temp_gender == PLURAL || temp_gender == NEUTER)
. = "don't"

/mob/p_s(temp_gender)
if(!temp_gender)
temp_gender = gender
Expand Down Expand Up @@ -302,6 +321,13 @@
temp_gender = PLURAL
return ..()

/mob/living/carbon/human/p_dont(temp_gender)
var/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((obscured & ITEM_SLOT_ICLOTHING) && skipface)
temp_gender = PLURAL
return ..()

/mob/living/carbon/human/p_s(temp_gender)
var/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
Expand Down
2 changes: 1 addition & 1 deletion code/datums/ai/basic_mobs/base_basic_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@

/datum/ai_controller/basic_controller/proc/update_speed(mob/living/basic/basic_mob)
SIGNAL_HANDLER
movement_delay = basic_mob.cached_multiplicative_slowdown
movement_delay = basic_mob.movement_delay
2 changes: 1 addition & 1 deletion code/datums/ai/dog/dog_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/datum/ai_controller/dog/process(delta_time)
if(ismob(pawn))
var/mob/living/living_pawn = pawn
movement_delay = living_pawn.cached_multiplicative_slowdown
movement_delay = living_pawn.movement_delay
return ..()

/datum/ai_controller/dog/TryPossessPawn(atom/new_pawn)
Expand Down
4 changes: 2 additions & 2 deletions code/datums/ai/monkey/monkey_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ have ways of interacting with a specific mob and control it.
RegisterSignal(new_pawn, COMSIG_CARBON_CUFF_ATTEMPTED, PROC_REF(on_attempt_cuff))
RegisterSignal(new_pawn, COMSIG_MOB_MOVESPEED_UPDATED, PROC_REF(update_movespeed))

movement_delay = living_pawn.cached_multiplicative_slowdown
movement_delay = living_pawn.movement_delay
return ..() //Run parent at end

/datum/ai_controller/monkey/UnpossessPawn(destroy)
Expand Down Expand Up @@ -215,7 +215,7 @@ have ways of interacting with a specific mob and control it.

/datum/ai_controller/monkey/proc/update_movespeed(mob/living/pawn)
SIGNAL_HANDLER
movement_delay = pawn.cached_multiplicative_slowdown
movement_delay = pawn.movement_delay

/datum/ai_controller/monkey/proc/target_del(target)
SIGNAL_HANDLER
Expand Down
2 changes: 1 addition & 1 deletion code/datums/ai/oldhostile/hostile_tameable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/datum/ai_controller/hostile_friend/process(delta_time)
if(isliving(pawn))
var/mob/living/living_pawn = pawn
movement_delay = living_pawn.cached_multiplicative_slowdown
movement_delay = living_pawn.movement_delay
return ..()

/datum/ai_controller/hostile_friend/TryPossessPawn(atom/new_pawn)
Expand Down
5 changes: 3 additions & 2 deletions code/datums/brain_damage/severe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,9 @@
if(high_stress)
if(prob(15) && ishuman(owner))
var/mob/living/carbon/human/H = owner
H.set_heartattack(TRUE)
to_chat(H, span_userdanger("You feel a stabbing pain in your heart!"))
if(H.set_heartattack(TRUE))
log_health(H, "Heart stopped due to monophobia quirk.")
to_chat(H, span_userdanger("You feel a stabbing pain in your heart!"))
else
to_chat(owner, span_userdanger("You feel your heart lurching in your chest..."))
owner.adjustOxyLoss(8)
Expand Down
7 changes: 4 additions & 3 deletions code/datums/emotes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,15 @@

log_message(text, LOG_EMOTE)

var/ghost_text = "<b>[src]</b> [text]"
var/ghost_text = "<span class='emote'>[src]</span> [text]"

var/origin_turf = get_turf(src)
if(client)
for(var/mob/ghost as anything in GLOB.dead_mob_list)
for(var/mob/ghost as anything in GLOB.dead_mob_list - viewers(origin_turf))
if(!ghost.client || isnewplayer(ghost))
continue
if(ghost.client.prefs.chat_toggles & CHAT_GHOSTSIGHT && !(ghost in viewers(origin_turf, null)))

if(ghost.client.prefs.chat_toggles & CHAT_GHOSTSIGHT)
ghost.show_message("[FOLLOW_LINK(ghost, src)] [ghost_text]")

visible_message(text, visible_message_flags = EMOTE_MESSAGE)
2 changes: 1 addition & 1 deletion code/datums/status_effects/buffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@
owner.remove_movespeed_modifier(/datum/movespeed_modifier/status_speed_boost, update = TRUE)

/datum/movespeed_modifier/status_speed_boost
multiplicative_slowdown = -1
slowdown = -1

///this buff provides a max health buff and a heal.
/datum/status_effect/limited_buff/health_buff
Expand Down
2 changes: 1 addition & 1 deletion code/datums/status_effects/debuffs/debuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@
owner.remove_movespeed_modifier(/datum/movespeed_modifier/freezing_blast, update = TRUE)

/datum/movespeed_modifier/freezing_blast
multiplicative_slowdown = 1
slowdown = 1

/datum/status_effect/discoordinated
id = "discoordinated"
Expand Down
4 changes: 2 additions & 2 deletions code/datums/status_effects/wound_effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,12 @@
if(speed_right == 1)
C.remove_actionspeed_modifier(/datum/actionspeed_modifier/broken_arm)
else
C.add_or_update_variable_actionspeed_modifier(/datum/actionspeed_modifier/broken_arm, multiplicative_slowdown = speed_right)
C.add_or_update_variable_actionspeed_modifier(/datum/actionspeed_modifier/broken_arm, slowdown = speed_right)
else if(hand == BODY_ZONE_L_ARM)
if(speed_left == 1)
C.remove_actionspeed_modifier(/datum/actionspeed_modifier/broken_arm)
else
C.add_or_update_variable_actionspeed_modifier(/datum/actionspeed_modifier/broken_arm, multiplicative_slowdown = speed_left)
C.add_or_update_variable_actionspeed_modifier(/datum/actionspeed_modifier/broken_arm, slowdown = speed_left)

/datum/status_effect/arm_slowdown/proc/on_hand_swap()
SIGNAL_HANDLER
Expand Down
2 changes: 1 addition & 1 deletion code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@

//They are moving! Wouldn't it be cool if we calculated their momentum and added it to the throw?
if (thrower && thrower.last_move && thrower.client && thrower.client.move_delay >= world.time + world.tick_lag*2)
var/user_momentum = thrower.cached_multiplicative_slowdown
var/user_momentum = thrower.movement_delay
if (!user_momentum) //no movement_delay, this means they move once per byond tick, lets calculate from that instead.
user_momentum = world.tick_lag

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/pipe/construction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ Buildable meters
if(prob(20))
C.spew_organ()
sleep(5)
C.blood_volume = 0
C.setBloodVolume(0)
return(OXYLOSS|BRUTELOSS)

/obj/item/pipe/examine(mob/user)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/buckling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
buckled_mob.set_buckled(null)
buckled_mob.set_anchored(initial(buckled_mob.anchored))
buckled_mob.clear_alert(ALERT_BUCKLED)
buckled_mob.set_glide_size(DELAY_TO_GLIDE_SIZE(buckled_mob.total_multiplicative_slowdown()))
buckled_mob.set_glide_size(DELAY_TO_GLIDE_SIZE(buckled_mob.total_slowdown()))
buckled_mobs -= buckled_mob

if(anchored)
Expand Down
6 changes: 5 additions & 1 deletion code/game/objects/items/defib.dm
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@
H.emote("scream")
shock_pulling(45, H)
if(H.set_heartattack(TRUE))
log_health(H, "Heart stopped due to offensive defibrillator use.")
if(!H.stat)
H.visible_message(span_warning("[H] thrashes wildly, clutching at [H.p_their()] chest!"),
span_userdanger("You feel a horrible agony in your chest!"))
Expand Down Expand Up @@ -619,7 +620,10 @@
return

user.audible_message(span_notice("[req_defib ? "[defib]" : "[src]"] pings: Resuscitation successful."))
H.resuscitate()

if(H.resuscitate())
log_health(H, "Resuscitated due to defibrillator shock.")

H.AdjustSleeping(-60 SECONDS) //WAKEY WAKEY YOUR HEART IS SHOCKY

/obj/item/shockpaddles/cyborg
Expand Down
8 changes: 7 additions & 1 deletion code/game/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,13 @@ GLOBAL_LIST_INIT(freqtospan, list(
var/alt_name = speaker.get_alt_name()

//Basic span
var/wrapper_span = "<span class='[radio_freq ? get_radio_span(radio_freq) : "game say"]'>"
var/wrapper_span = "<span class = 'game say'>"
if(radio_freq)
wrapper_span = "<span class = '[get_radio_span(radio_freq)]'>"

else if(message_mods[MODE_CUSTOM_SAY_ERASE_INPUT])
wrapper_span = "<span class = 'emote'>"

//Radio freq/name display
var/freqpart = radio_freq ? "\[[get_radio_name(radio_freq)]\] " : ""
//Speaker name
Expand Down
14 changes: 7 additions & 7 deletions code/modules/actionspeed/_actionspeed_modifier.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ can next move
var/flags = NONE

/// Multiplicative slowdown
var/multiplicative_slowdown = 0
var/slowdown = 0

/// Other modification datums this conflicts with.
var/conflicts_with
Expand Down Expand Up @@ -99,7 +99,7 @@ GLOBAL_LIST_EMPTY(actionspeed_modification_cache)
4. If any of the rest of the args are not null (see: multiplicative slowdown), modify the datum
5. Update if necessary
*/
/mob/proc/add_or_update_variable_actionspeed_modifier(datum/actionspeed_modifier/type_id_datum, update = TRUE, multiplicative_slowdown)
/mob/proc/add_or_update_variable_actionspeed_modifier(datum/actionspeed_modifier/type_id_datum, update = TRUE, slowdown)
var/modified = FALSE
var/inject = FALSE
var/datum/actionspeed_modifier/final
Expand All @@ -122,8 +122,8 @@ GLOBAL_LIST_EMPTY(actionspeed_modification_cache)
if(!LAZYACCESS(actionspeed_modification, final.id))
inject = TRUE
modified = TRUE
if(!isnull(multiplicative_slowdown))
final.multiplicative_slowdown = multiplicative_slowdown
if(!isnull(slowdown))
final.slowdown = slowdown
modified = TRUE
if(inject)
add_actionspeed_modifier(final, FALSE)
Expand All @@ -149,7 +149,7 @@ GLOBAL_LIST_EMPTY(actionspeed_modification_cache)
for(var/key in get_actionspeed_modifiers())
var/datum/actionspeed_modifier/M = actionspeed_modification[key]
var/conflict = M.conflicts_with
var/amt = M.multiplicative_slowdown
var/amt = M.slowdown
if(conflict)
// Conflicting modifiers prioritize the larger slowdown or the larger speedup
// We purposefuly don't handle mixing speedups and slowdowns on the same id
Expand All @@ -162,7 +162,7 @@ GLOBAL_LIST_EMPTY(actionspeed_modification_cache)

///Adds a default action speed
/mob/proc/initialize_actionspeed()
add_or_update_variable_actionspeed_modifier(/datum/actionspeed_modifier/base, multiplicative_slowdown = 1)
add_or_update_variable_actionspeed_modifier(/datum/actionspeed_modifier/base, slowdown = 1)

/// Get the action speed modifiers list of the mob
/mob/proc/get_actionspeed_modifiers()
Expand All @@ -172,4 +172,4 @@ GLOBAL_LIST_EMPTY(actionspeed_modification_cache)

/// Checks if a action speed modifier is valid and not missing any data
/proc/actionspeed_data_null_check(datum/actionspeed_modifier/M) //Determines if a data list is not meaningful and should be discarded.
. = !(M.multiplicative_slowdown)
. = !(M.slowdown)
2 changes: 1 addition & 1 deletion code/modules/actionspeed/modifiers/addiction.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/datum/actionspeed_modifier/stimulants
multiplicative_slowdown = 0.25
slowdown = 0.25
id = ACTIONSPEED_ID_STIMULANTS
8 changes: 4 additions & 4 deletions code/modules/actionspeed/modifiers/status_effects.dm
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/datum/actionspeed_modifier/timecookie
multiplicative_slowdown = -0.05
slowdown = -0.05

/datum/actionspeed_modifier/broken_arm
variable = TRUE

/datum/actionspeed_modifier/nooartrium
multiplicative_slowdown = 0.5
slowdown = 0.5

/datum/actionspeed_modifier/power_chord
multiplicative_slowdown = -0.15
slowdown = -0.15

/datum/actionspeed_modifier/status_effect/hazard_area
multiplicative_slowdown = 4
slowdown = 4
2 changes: 2 additions & 0 deletions code/modules/admin/verbs/individual_logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
dat += " | "
dat += individual_logging_panel_link(M, INDIVIDUAL_OOC_LOG, LOGSRC_MOB, "OOC Log", source, ntype)
dat += " | "
dat += individual_logging_panel_link(M, INDIVIDUAL_HEALTH_LOG, LOGSRC_MOB, "Health Log", source, ntype)
dat += " | "
dat += individual_logging_panel_link(M, INDIVIDUAL_SHOW_ALL_LOG, LOGSRC_MOB, "Show All", source, ntype)
dat += "</center>"

Expand Down
Loading

0 comments on commit a447482

Please sign in to comment.