Skip to content

Commit

Permalink
Merge branch 'tg-effects-prelude-living' into tg-effects-1123
Browse files Browse the repository at this point in the history
  • Loading branch information
fira committed Nov 9, 2023
2 parents f26d91b + 65be7a2 commit b0a9fe8
Show file tree
Hide file tree
Showing 13 changed files with 109 additions and 34 deletions.
2 changes: 1 addition & 1 deletion code/_onclick/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
if(xeno.stat != DEAD) // If the Xeno is alive, fight back
var/mob/living/carbon/carbon_user = user
if(!carbon_user || !carbon_user.ally_of_hivenumber(xeno.hivenumber))
user.KnockDown(rand(xeno.caste.tacklestrength_min, xeno.caste.tacklestrength_max))
carbon_user.KnockDown(rand(xeno.caste.tacklestrength_min, xeno.caste.tacklestrength_max))
playsound(user.loc, 'sound/weapons/pierce.ogg', 25, TRUE)
user.visible_message(SPAN_WARNING("\The [user] tried to unstrap \the [back_item] from [xeno] but instead gets a tail swipe to the head!"))
return
Expand Down
8 changes: 4 additions & 4 deletions code/datums/ammo/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

neuro_callback = CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(apply_neuro))

/proc/apply_neuro(mob/M, power, insta_neuro)
/proc/apply_neuro(mob/living/M, power, insta_neuro)
if(skillcheck(M, SKILL_ENDURANCE, SKILL_ENDURANCE_MAX) && !insta_neuro)
M.visible_message(SPAN_DANGER("[M] withstands the neurotoxin!"))
return //endurance 5 makes you immune to weak neurotoxin
Expand Down Expand Up @@ -67,7 +67,7 @@
M.adjust_effect(1 * power, WEAKEN) // KD them a bit more
M.visible_message(SPAN_DANGER("[M] falls prone."))

/proc/apply_scatter_neuro(mob/M)
/proc/apply_scatter_neuro(mob/living/M)
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(skillcheck(M, SKILL_ENDURANCE, SKILL_ENDURANCE_MAX))
Expand Down Expand Up @@ -314,7 +314,7 @@
shrapnel_type = /obj/item/shard/shrapnel/bone_chips
shrapnel_chance = 60

/datum/ammo/xeno/bone_chips/on_hit_mob(mob/M, obj/projectile/P)
/datum/ammo/xeno/bone_chips/on_hit_mob(mob/living/M, obj/projectile/P)
if(iscarbon(M))
var/mob/living/carbon/C = M
if((HAS_FLAG(C.status_flags, XENO_HOST) && HAS_TRAIT(C, TRAIT_NESTED)) || C.stat == DEAD)
Expand Down Expand Up @@ -344,7 +344,7 @@
damage = 10
shrapnel_chance = 0

/datum/ammo/xeno/bone_chips/spread/runner/on_hit_mob(mob/M, obj/projectile/P)
/datum/ammo/xeno/bone_chips/spread/runner/on_hit_mob(mob/living/M, obj/projectile/P)
if(iscarbon(M))
var/mob/living/carbon/C = M
if((HAS_FLAG(C.status_flags, XENO_HOST) && HAS_TRAIT(C, TRAIT_NESTED)) || C.stat == DEAD)
Expand Down
12 changes: 8 additions & 4 deletions code/modules/admin/player_panel/actions/general.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,16 @@
name = "Toggle Sleeping"

/datum/player_action/mob_sleep/act(client/user, mob/target, list/params)
if(!istype(target, /mob/living))
return TRUE
var/mob/living/living = target

if (!params["sleep"]) //if they're already slept, set their sleep to zero and remove the icon
target.sleeping = 0
target.RemoveSleepingIcon()
living.sleeping = 0
living.RemoveSleepingIcon()
else
target.sleeping = 9999999 //if they're not, sleep them and add the sleep icon, so other marines nearby know not to mess with them.
target.AddSleepingIcon()
living.sleeping = 9999999 //if they're not, sleep them and add the sleep icon, so other marines nearby know not to mess with them.
living.AddSleepingIcon()

message_admins("[key_name_admin(user)] toggled sleep on [key_name_admin(target)].")

Expand Down
7 changes: 6 additions & 1 deletion code/modules/admin/player_panel/player_panel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,12 @@
. = list()
.["mob_name"] = targetMob.name

.["mob_sleeping"] = targetMob.sleeping
if(istype(targetMob, /mob/living))
var/mob/living/livingTarget = targetMob
.["mob_sleeping"] = livingTarget.sleeping
else
.["mob_sleeping"] = 0

.["mob_frozen"] = HAS_TRAIT_FROM(targetMob, TRAIT_IMMOBILIZED, TRAIT_SOURCE_ADMIN)

.["mob_speed"] = targetMob.speed
Expand Down
21 changes: 13 additions & 8 deletions code/modules/mob/hear_say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
if(!client && !(mind && mind.current != src))
return

if(stat == UNCONSCIOUS)
hear_sleep(src, message, src == speaker, Adjacent(speaker))
return

var/style = "body"
var/comm_paygrade = ""

Expand Down Expand Up @@ -67,9 +63,6 @@
if(!client && !(mind && mind.current != src))
return

if(stat == UNCONSCIOUS)
hear_sleep(src, message, FALSE, FALSE)
return
var/comm_paygrade = ""

var/track = null
Expand Down Expand Up @@ -207,7 +200,19 @@
M.show_message(message)
src.show_message(message)

/mob/proc/hear_sleep(mob/speaker = null, message, hearing_self = FALSE, proximity_flag = FALSE)
/mob/living/hear_say(message, verb, datum/language/language, alt_name, italics, mob/speaker, sound/speech_sound, sound_vol)
if(client && mind && stat == UNCONSCIOUS)
hear_sleep(src, message, src == speaker, Adjacent(speaker))
return
return ..()

/mob/living/hear_radio(message, verb, datum/language/language, part_a, part_b, mob/speaker, hard_to_hear, vname, command, no_paygrade)
if(client && mind && stat == UNCONSCIOUS)
hear_sleep(src, message, FALSE, FALSE)
return
return ..()

/mob/living/proc/hear_sleep(mob/speaker = null, message, hearing_self = FALSE, proximity_flag = FALSE)
var/heard = ""

if(sdisabilities & DISABILITY_DEAF || ear_deaf)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -446,11 +446,11 @@
set name = "Sleep"
set category = "IC"

if(usr.sleeping)
if(sleeping)
to_chat(usr, SPAN_DANGER("You are already sleeping"))
return
if(alert(src,"You sure you want to sleep for a while?","Sleep","Yes","No") == "Yes")
usr.sleeping = 20 //Short nap
sleeping = 20 //Short nap


/mob/living/carbon/Collide(atom/movable/AM)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/emote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
key_third_person = "faints"
message = "faints!"

/datum/emote/living/carbon/human/faint/run_emote(mob/user, params, type_override, intentional)
/datum/emote/living/carbon/human/faint/run_emote(mob/living/carbon/human/user, params, type_override, intentional)
. = ..()
user.sleeping += 10

Expand Down
8 changes: 8 additions & 0 deletions code/modules/mob/living/living_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@

var/current_weather_effect_type

var/dazed = 0
var/knocked_out = 0
var/stunned = 0
var/knocked_down = 0
var/slowed = 0 // X_SLOW_AMOUNT
var/superslowed = 0 // X_SUPERSLOW_AMOUNT
var/sleeping = 0

var/slash_verb = "attack"
var/slashes_verb = "attacks"
Expand All @@ -127,3 +134,4 @@

/// Flags that determine the potential of a mob to perform certain actions. Do not change this directly.
var/mobility_flags = MOBILITY_FLAGS_DEFAULT

57 changes: 57 additions & 0 deletions code/modules/mob/living/living_health_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,63 @@
game_plane_master_controller.add_filter("eye_blur", 1, gauss_blur_filter(clamp(eye_blurry * 0.1, 0.6, 3)))


/mob/living/proc/TalkStutter(amount)
stuttering = max(max(stuttering, amount), 0)
return


/mob/living/proc/SetTalkStutter(amount)
stuttering = max(amount, 0)
return

/mob/living/proc/AdjustTalkStutter(amount)
stuttering = max(stuttering + amount,0)
return


/mob/living/proc/SetEyeBlind(amount)
eye_blind = max(amount, 0)
return


/mob/living/proc/AdjustEyeBlind(amount)
eye_blind = max(eye_blind + amount, 0)
return

/mob/living/proc/ReduceEyeBlind(amount)
eye_blind = max(eye_blind - amount, 0)
return

/mob/living/proc/AdjustEarDeafness(amount)
var/prev_deaf = ear_deaf
ear_deaf = max(ear_deaf + amount, 0)
if(prev_deaf)
if(ear_deaf == 0)
on_deafness_loss()
else if(ear_deaf)
on_deafness_gain()


/mob/living/proc/SetEarDeafness(amount)
var/prev_deaf = ear_deaf
ear_deaf = max(amount, 0)
if(prev_deaf)
if(ear_deaf == 0)
on_deafness_loss()
else if(ear_deaf)
on_deafness_gain()

/mob/living/proc/on_deafness_gain()
to_chat(src, SPAN_WARNING("You notice you can't hear anything... you're deaf!"))
SEND_SIGNAL(src, COMSIG_MOB_DEAFENED)

/mob/living/proc/on_deafness_loss()
to_chat(src, SPAN_WARNING("You start hearing things again!"))
SEND_SIGNAL(src, COMSIG_MOB_REGAINED_HEARING)




/mob/living/proc/TalkStutter(amount)
stuttering = max(max(stuttering, amount), 0)
return
Expand Down
6 changes: 1 addition & 5 deletions code/modules/mob/mob_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,13 @@
var/jitteriness = 0//Carbon
var/floatiness = 0
var/losebreath = 0.0//Carbon
var/dazed = 0
var/slowed = 0 // X_SLOW_AMOUNT
var/superslowed = 0 // X_SUPERSLOW_AMOUNT
var/shakecamera = 0

// bool status effects \\
/// bool that tracks if blind
var/blinded = FALSE
var/sleeping = 0 //Carbon
var/resting = 0 //Carbon
var/resting = 0
var/is_floating = 0
var/is_dizzy = 0
var/is_jittery = 0
Expand Down
3 changes: 1 addition & 2 deletions code/modules/mob/mob_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@
if(length(mind.memory) < 4000)
mind.store_memory(msg)
else
src.sleeping = 9999999
message_admins("[key_name(usr)] auto-slept for attempting to exceed mob memory limit. [ADMIN_JMP(src.loc)]")
message_admins("[key_name(usr)] auto-slept for attempting to exceed mob memory limit.]", loc.x, loc.y, loc.z)
else
to_chat(src, "The game appears to have misplaced your mind datum, so we can't show you your notes.")

Expand Down
4 changes: 2 additions & 2 deletions code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@
Note: pickup and dropped on weapons must have both the ..() to update zoom AND twohanded,
As sniper rifles have both and weapon mods can change them as well. ..() deals with zoom only.
*/
/obj/item/weapon/gun/equipped(mob/user, slot)
/obj/item/weapon/gun/equipped(mob/living/user, slot)
if(flags_item & NODROP) return

unwield(user)
Expand Down Expand Up @@ -731,7 +731,7 @@ As sniper rifles have both and weapon mods can change them as well. ..() deals w

// END TGUI \\
/obj/item/weapon/gun/wield(mob/user)
/obj/item/weapon/gun/wield(mob/living/user)

if(!(flags_item & TWOHANDED) || flags_item & WIELDED)
return
Expand Down
9 changes: 5 additions & 4 deletions code/modules/recycling/disposal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,11 @@
AM.forceMove(loc)
AM.pipe_eject(0)
if(isliving(AM))
var/mob/living/M = AM
M.apply_effect(2, STUN)
M.visible_message(SPAN_WARNING("[M] is suddenly pushed out of [src]!"),
SPAN_WARNING("You get pushed out of [src] and get your bearings!"))
var/mob/living/living = AM
living.Stun(2)
if(!living.lying)
living.visible_message(SPAN_WARNING("[living] is suddenly pushed out of [src]!"),
SPAN_WARNING("You get pushed out of [src] and get your bearings!"))
update()

///Pipe affected by explosion
Expand Down

0 comments on commit b0a9fe8

Please sign in to comment.