Skip to content
This repository has been archived by the owner on Oct 15, 2023. It is now read-only.

SoftCrit Rework + Crawling #203

Merged
merged 8 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions code/_onclick/other_mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
Otherwise pretty standard.
*/
/mob/living/carbon/human/UnarmedAttack(atom/A, proximity)
if(lying && (!ishuman(A) || (ishuman(A) && !mind?.martial_art)))
to_chat(src, span_warning("Вы не можете взаимодействовать в лежачей позиции!"))
return FALSE
// Special glove functions:
// If the gloves do anything, have them return 1 to stop
// normal attack_hand() here.
Expand Down
9 changes: 6 additions & 3 deletions code/controllers/configuration.dm
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
//Unversal modifiers
var/run_speed = 0
var/walk_speed = 0
var/crawl_speed = 0

//Mob specific modifiers. NOTE: These will affect different mob types in different ways
var/human_delay = 0
Expand Down Expand Up @@ -320,7 +321,7 @@
var/modify_pull_push_speed = FALSE

var/pixel_shift = FALSE

var/ignore_obscured_mouth = FALSE

var/ai_heat = FALSE
Expand Down Expand Up @@ -912,13 +913,13 @@
if("override_map")
config.override_map = value


if("modify_pull_push_speed")
config.modify_pull_push_speed = TRUE

if("pixel_shift")
config.pixel_shift = TRUE

if("ignore_obscured_mouth")
config.ignore_obscured_mouth = TRUE

Expand Down Expand Up @@ -953,6 +954,8 @@
config.run_speed = value
if("walk_speed")
config.walk_speed = value
if("crawl_speed")
config.crawl_speed = value
if("human_delay")
config.human_delay = value
if("robot_delay")
Expand Down
20 changes: 13 additions & 7 deletions code/datums/components/footstep.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,9 @@
return

var/mob/living/LM = parent
if(!T.footstep || LM.lying || !LM.canmove || LM.resting || LM.buckled || LM.throwing || LM.flying || istype(LM.loc, /obj/machinery/atmospherics))
if(!T.footstep || !LM.canmove || LM.buckled || LM.throwing || LM.flying || istype(LM.loc, /obj/machinery/atmospherics))
return

if(ishuman(LM))
var/mob/living/carbon/human/H = LM
if(!H.get_organ(BODY_ZONE_L_LEG) && !H.get_organ(BODY_ZONE_R_LEG))
return
if(H.m_intent == MOVE_INTENT_WALK)
return// stealth
steps++

if(steps >= 6)
Expand All @@ -72,6 +66,18 @@

if(steps != 0 && !has_gravity(LM, T)) // don't need to step as often when you hop around
return

if(LM.lying)
playsound(T, 'sound/effects/footstep/crawl1.ogg', 15 * volume, falloff_distance = 1, vary = sound_vary)
return

if(ishuman(LM))
var/mob/living/carbon/human/H = LM
if(!H.get_organ(BODY_ZONE_L_LEG) && !H.get_organ(BODY_ZONE_R_LEG))
return
if(H.m_intent == MOVE_INTENT_WALK)
return// stealth

return T

/datum/component/footstep/proc/play_simplestep()
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/carbon/human/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,8 @@
return

if(health <= HEALTH_THRESHOLD_CRIT)
if(!lying)
update_canmove()
if(prob(5))
emote(pick("faint", "collapse", "cry", "moan", "gasp", "shudder", "shiver"))
AdjustStuttering(5, bound_lower = 0, bound_upper = 5)
Expand Down
5 changes: 4 additions & 1 deletion code/modules/mob/living/carbon/human/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@
return list("verb" = verb)

/mob/living/carbon/human/handle_message_mode(var/message_mode, list/message_pieces, var/verb, var/used_radios)
if(health <= HEALTH_THRESHOLD_CRIT)
whisper_say(message_pieces)
return TRUE
switch(message_mode)
if("intercom")
for(var/obj/item/radio/intercom/I in view(1, src))
Expand Down Expand Up @@ -250,7 +253,7 @@

if("whisper")
whisper_say(message_pieces)
return 1
return TRUE
else
if(message_mode)
if(isradio(l_ear))
Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/carbon/human/species/_species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
var/is_small
var/show_ssd = 1
var/forced_heartattack = FALSE //Some species have blood, but we still want them to have heart attacks
var/dies_at_threshold = FALSE // Do they die or get knocked out at specific thresholds, or do they go through complex crit?
var/can_revive_by_healing // Determines whether or not this species can be revived by simply healing them
var/has_gender = TRUE
var/blacklisted = FALSE
Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/carbon/human/species/abductor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@


species_traits = list(NO_BLOOD, NO_BREATHE, VIRUSIMMUNE, NOGUNS, NO_HUNGER, NO_EXAMINE)
dies_at_threshold = TRUE

taste_sensitivity = TASTE_SENSITIVITY_NO_TASTE

Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/carbon/human/species/golem.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
deform = 'icons/mob/human_races/r_golem.dmi'

species_traits = list(NO_BREATHE, NO_BLOOD, NO_PAIN, RADIMMUNE, NOGUNS, PIERCEIMMUNE)
dies_at_threshold = TRUE
speed_mod = 2
brute_mod = 0.45 //55% damage reduction
burn_mod = 0.45
Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/carbon/human/species/machine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

//Default styles for created mobs.
default_hair = "Blue IPC Screen"
dies_at_threshold = TRUE
can_revive_by_healing = 1
has_gender = FALSE
reagent_tag = PROCESS_SYN
Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/carbon/human/species/nucleation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
burn_mod = 4 // holy shite, poor guys wont survive half a second cooking smores
brute_mod = 2 // damn, double wham, double dam
species_traits = list(LIPS, IS_WHITELISTED, NO_BREATHE, NO_BLOOD, NO_PAIN, NO_SCAN, RADIMMUNE, VIRUSIMMUNE, NO_GERMS)
dies_at_threshold = TRUE

//Default styles for created mobs.
default_hair = "Nucleation Crystals"
Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/carbon/human/species/shadow.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
)

species_traits = list(NO_BREATHE, NO_BLOOD, RADIMMUNE, VIRUSIMMUNE)
dies_at_threshold = TRUE

reagent_tag = PROCESS_ORG
suicide_messages = list(
Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/carbon/human/species/skeleton.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
flesh_color = "#E6E6C6"

species_traits = list(NO_BREATHE, NO_BLOOD, RADIMMUNE, VIRUSIMMUNE, NO_HUNGER, PIERCEIMMUNE, NO_DNA, RUNIC_MIND)
dies_at_threshold = TRUE
skinned_type = /obj/item/stack/sheet/bone

taste_sensitivity = TASTE_SENSITIVITY_NO_TASTE //skeletons can't taste anything
Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/carbon/human/species/vox.dm
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@
species_traits = list(NO_SCAN, NO_GERMS, NO_DECAY, NO_BLOOD, NO_PAIN)
clothing_flags = 0 //IDK if you've ever seen underwear on an Armalis, but it ain't pretty.
bodyflags = HAS_TAIL
dies_at_threshold = TRUE

blood_color = "#2299FC"
flesh_color = "#808D11"
Expand Down
2 changes: 0 additions & 2 deletions code/modules/mob/living/carbon/human/species/wryn.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@
clothing_flags = HAS_UNDERWEAR | HAS_UNDERSHIRT | HAS_SOCKS
bodyflags = HAS_SKIN_COLOR

dies_at_threshold = TRUE

reagent_tag = PROCESS_ORG
base_color = "#704300"
flesh_color = "#704300"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/update_stat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
. = dna.species.can_hear(src)

/mob/living/carbon/human/check_death_method()
return dna.species.dies_at_threshold
return FALSE
2 changes: 2 additions & 0 deletions code/modules/mob/living/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@

if(stat != DEAD)
handle_critical_condition()
if(lying && !resting)
update_canmove()

if(stat != DEAD) // Status & health update, are we dead or alive etc.
handle_disabilities() // eye, ear, brain damages
Expand Down
10 changes: 8 additions & 2 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,12 @@

//Generic Bump(). Override MobBump() and ObjBump() instead of this.
/mob/living/Bump(atom/A, yes)
if(..()) //we are thrown onto something
if(throwing) //we are thrown onto something
..()
return
if(buckled || !yes || now_pushing)
if(buckled || !yes || now_pushing || lying)
return
..()
if(ismob(A))
if(MobBump(A))
return
Expand Down Expand Up @@ -1073,6 +1075,10 @@
. += 10
if(forced_look)
. += 3
if(lying)
. += config.crawl_speed
. += config.walk_speed
return
if(ignorewalk)
. += config.run_speed
else
Expand Down
5 changes: 4 additions & 1 deletion code/modules/mob/living/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,13 @@ GLOBAL_LIST_EMPTY(channel_to_radio_key)
return list("verb" = verb)

/mob/living/proc/handle_message_mode(message_mode, list/message_pieces, verb, used_radios)
if(health <= HEALTH_THRESHOLD_CRIT)
whisper_say(message_pieces)
return TRUE
switch(message_mode)
if("whisper") //all mobs can whisper by default
whisper_say(message_pieces)
return 1
return TRUE
return 0

/mob/living/proc/handle_speech_sound()
Expand Down
6 changes: 3 additions & 3 deletions code/modules/mob/living/update_status.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,18 @@
/mob/living/update_canmove(delay_action_updates = 0)
var/fall_over = !can_stand()
var/buckle_lying = !(buckled && !buckled.buckle_lying)
if(fall_over || resting || stunned)
if(fall_over || resting || stunned || health <= HEALTH_THRESHOLD_CRIT)
drop_r_hand()
drop_l_hand()
else
lying = 0
canmove = 1
if(buckled)
lying = 90 * buckle_lying
else if((fall_over || resting) && !lying)
else if((fall_over || resting || health <= HEALTH_THRESHOLD_CRIT) && !lying)
fall(fall_over)

canmove = !(fall_over || resting || stunned || IsFrozen() || buckled)
canmove = !(fall_over || stunned || IsFrozen() || buckled)
density = !lying
if(lying)
if(layer == initial(layer))
Expand Down
9 changes: 5 additions & 4 deletions code/modules/mob/mob_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -424,12 +424,13 @@ GLOBAL_LIST_INIT(intents, list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM
set category = "IC"

if(!resting)
client.move_delay = world.time + 20
to_chat(src, "<span class='notice'>Вы отдыхаете.</span>")
to_chat(src, span_notice("Вы отдыхаете."))
StartResting()
else if(resting)
to_chat(src, "<span class='notice'>Вы встаёте.</span>")
StopResting()
client.move_delay = world.time + 1 SECONDS
to_chat(src, span_notice("Вы встаёте."))
if(do_mob(src, src, 1 SECONDS, TRUE, TRUE))
StopResting()

/proc/get_multitool(mob/user as mob)
// Get tool
Expand Down
1 change: 1 addition & 0 deletions config/example/game_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ REVIVAL_BRAIN_LIFE -1
## These modify the run/walk speed of all mobs before the mob-specific modifiers are applied.
RUN_SPEED 1
WALK_SPEED 4
CRAWL_SPEED 4

## The variables below affect the movement of specific mob types.
HUMAN_DELAY 1.5
Expand Down
Loading