Skip to content

Commit

Permalink
fix merge accidents and two bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
fira committed Nov 9, 2023
1 parent ee19848 commit 2393c4d
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 81 deletions.
20 changes: 10 additions & 10 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,18 @@
#define ROUNDSTART_TRAIT "roundstart"

//-- mob traits --
/// Prevents voluntary movement.
#define TRAIT_IMMOBILIZED "immobilized"
/// Apply this to make a mob not dense, and remove it when you want it to no longer make them undense, other sorces of undesity will still apply. Always define a unique source when adding a new instance of this!
#define TRAIT_UNDENSE "undense"
/// Forces the user to stay unconscious.
#define TRAIT_KNOCKEDOUT "knockedout"
/// Prevents voluntary movement.
#define TRAIT_IMMOBILIZED "immobilized"
/// Prevents voluntary standing or staying up on its own.
#define TRAIT_FLOORED "floored"
/// Forces user to stay standing
#define TRAIT_FORCED_STANDING "forcedstanding"
/// Stuns preventing movement and using objects but without further impairement
#define TRAIT_INCAPACITATED "incapacitated"

// SPECIES TRAITS
/// Knowledge of Yautja technology
Expand All @@ -147,14 +155,6 @@
/// Makes it impossible to strip the inventory of this mob.
#define TRAIT_UNSTRIPPABLE "t_unstrippable"

/// Forces the user to stay unconscious.
#define TRAIT_KNOCKEDOUT "knockedout"
/// Prevents voluntary movement.
#define TRAIT_IMMOBILIZED "immobilized"
/// Prevents voluntary standing or staying up on its own.
#define TRAIT_FLOORED "floored"
#define TRAIT_INCAPACITATED "incapacitated"

// HIVE TRAITS
/// If the Hive is a Xenonid Hive
#define TRAIT_XENONID "t_xenonid"
Expand Down
6 changes: 3 additions & 3 deletions code/modules/mob/living/carbon/human/powers/human_powers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@
if(body_position == LYING_DOWN)
if(!silent)
to_chat(src, SPAN_NOTICE("You will now try to stay lying down on the floor."))
// else if(HAS_TRAIT(src, TRAIT_FORCED_STANDING) || (buckled && buckled.buckle_lying != NO_BUCKLE_LYING))
// if(!silent)
// to_chat(src, SPAN_NOTICE("You will now lay down as soon as you are able to."))
else if(HAS_TRAIT(src, TRAIT_FORCED_STANDING) || (buckled && buckled.buckle_lying != NO_BUCKLE_LYING))
if(!silent)
to_chat(src, SPAN_NOTICE("You will now lay down as soon as you are able to."))
else
if(!silent)
to_chat(src, SPAN_NOTICE("You lay down."))
Expand Down
24 changes: 22 additions & 2 deletions code/modules/mob/living/init_signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_FLOORED), PROC_REF(on_floored_trait_gain))
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_FLOORED), PROC_REF(on_floored_trait_loss))

RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_FORCED_STANDING), PROC_REF(on_forced_standing_trait_gain))
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_FORCED_STANDING), PROC_REF(on_forced_standing_trait_loss))

RegisterSignal(src, SIGNAL_ADDTRAIT(TRAIT_INCAPACITATED), PROC_REF(on_incapacitated_trait_gain))
RegisterSignal(src, SIGNAL_REMOVETRAIT(TRAIT_INCAPACITATED), PROC_REF(on_incapacitated_trait_loss))

Expand Down Expand Up @@ -41,8 +44,8 @@
SIGNAL_HANDLER
if(buckled && buckled.buckle_lying != NO_BUCKLE_LYING)
return // Handled by the buckle.
// if(HAS_TRAIT(src, TRAIT_FORCED_STANDING))
// return // Don't go horizontal if mob has forced standing trait.
if(HAS_TRAIT(src, TRAIT_FORCED_STANDING))
return // Don't go horizontal if mob has forced standing trait.
mobility_flags &= ~MOBILITY_STAND
on_floored_start()

Expand All @@ -53,6 +56,23 @@
mobility_flags |= MOBILITY_STAND
on_floored_end()

/// Called when [TRAIT_FORCED_STANDING] is added to the mob.
/mob/living/proc/on_forced_standing_trait_gain(datum/source)
SIGNAL_HANDLER

set_body_position(STANDING_UP)
set_lying_angle(0)

/// Called when [TRAIT_FORCED_STANDING] is removed from the mob.
/mob/living/proc/on_forced_standing_trait_loss(datum/source)
SIGNAL_HANDLER

if(HAS_TRAIT(src, TRAIT_FLOORED))
on_fall()

Check failure on line 71 in code/modules/mob/living/init_signals.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined proc: "on_fall" on /mob/living
set_lying_down()
else if(resting)
set_lying_down()

/// Called when [TRAIT_INCAPACITATED] is added to the mob.
/mob/living/proc/on_incapacitated_trait_gain(datum/source)
SIGNAL_HANDLER
Expand Down
5 changes: 2 additions & 3 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,9 @@
///Called by mob Move() when the lying_angle is different than zero, to better visually simulate crawling.
/mob/living/proc/lying_angle_on_movement(direct)
if(direct & EAST)
set_lying_angle(90)
set_lying_angle(90, on_movement = TRUE)
else if(direct & WEST)
set_lying_angle(270)
set_lying_angle(270, on_movement = TRUE)

///Reports the event of the change in value of the buckled variable.
/mob/living/proc/set_buckled(new_buckled)
Expand Down Expand Up @@ -549,7 +549,6 @@
var/obj/old_buckled = . // /tg/ code has buckling defined on /atom/movable - consider refactoring this sometime
if(old_buckled.buckle_lying == 0 && (resting || HAS_TRAIT(src, TRAIT_FLOORED))) // The buckle forced us to stay up (like a chair)
set_lying_down() // We want to rest or are otherwise floored, so let's drop on the ground.
set_lying_angle(pick(90, 270)) // As above. /tg/ doesnt have this line, but without we get issues in buckling-resting-unbuckling. How come?

/mob/living/proc/get_up(instant = FALSE) // arg ignored
// set waitfor = FALSE
Expand Down
12 changes: 4 additions & 8 deletions code/modules/mob/living/living_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
VAR_PROTECTED/knocked_out = 0
VAR_PROTECTED/knocked_down = 0
VAR_PROTECTED/stunned = 0
var/dazed = 0
var/slowed = 0 // X_SLOW_AMOUNT
var/superslowed = 0 // X_SUPERSLOW_AMOUNT
var/sleeping = 0

var/hallucination = 0 //Directly affects how long a mob will hallucinate for
var/list/atom/hallucinations = list() //A list of hallucinated people that try to attack the mob. See /obj/effect/fake_attacker in hallucinations.dm
Expand Down Expand Up @@ -104,14 +108,6 @@

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 Down
54 changes: 0 additions & 54 deletions code/modules/mob/living/living_health_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -371,60 +371,6 @@
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

/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)

// heal ONE limb, organ gets randomly selected from damaged ones.
/mob/living/proc/heal_limb_damage(brute, burn)
apply_damage(-brute, BRUTE)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/recycling/disposal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@
if(isliving(AM))
var/mob/living/living = AM
living.Stun(2)
if(!living.lying)
if(living.body_position == STANDING_UP)
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()
Expand Down

0 comments on commit 2393c4d

Please sign in to comment.