Skip to content

Commit

Permalink
compile fixes, knockdown now immobilizess, as CM Dev intended
Browse files Browse the repository at this point in the history
  • Loading branch information
fira committed Nov 20, 2023
1 parent 7525607 commit 465f7c3
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 37 deletions.
6 changes: 3 additions & 3 deletions code/datums/ammo/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

if(!isxeno(M))
if(insta_neuro)
if(M.GetKnockDownValueNotADurationDoNotUse() < 3) // If they have less than somewhere random between 4 and 6 seconds KD left and assuming it doesnt get refreshed itnernally
if(M.GetKnockDownDuration() < 3) // Why are you not using KnockDown(3) ? Do you even know 3 is SIX seconds ? So many questions left unanswered.
M.adjust_effect(1 * power, WEAKEN)
return

Expand All @@ -65,7 +65,7 @@
no_clothes_neuro = TRUE

if(no_clothes_neuro)
if(M.GetKnockDownValueNotADurationDoNotUse() < 5) // If they have less than somewhere random between 8 and 10 seconds KD left and assuming it doesnt get refreshed itnernally
if(M.GetKnockDownDuration() < 5) // Nobody actually knows what this means. Supposedly it means less than 10 seconds. Frankly if you get locked into 10s of knockdown to begin with there are bigger issues.
M.adjust_effect(1 * power, WEAKEN) // KD them a bit more
M.visible_message(SPAN_DANGER("[M] falls prone."))

Expand All @@ -79,7 +79,7 @@
H.visible_message(SPAN_DANGER("[M] shrugs off the neurotoxin!"))
return

if(M.GetKnockDownValueNotADurationDoNotUse() < 0.7) // basically (knocked_down && prob(90))
if(M.GetKnockDownDuration() < 0.7) // Worth noting that the value has 0.25~0.5 resolution so this is completely stupid. Stop microdosing balance and get real
M.apply_effect(0.7, WEAKEN)
M.visible_message(SPAN_DANGER("[M] falls prone."))

Expand Down
4 changes: 2 additions & 2 deletions code/datums/status_effects/debuffs/debuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
. = ..()
if(!.)
return
ADD_TRAIT(owner, TRAIT_FLOORED, TRAIT_STATUS_EFFECT(id))
owner.add_traits(list(TRAIT_FLOORED, TRAIT_IMMOBILIZED), TRAIT_STATUS_EFFECT(id))

/datum/status_effect/incapacitating/knockdown/on_remove()
REMOVE_TRAIT(owner, TRAIT_FLOORED, TRAIT_STATUS_EFFECT(id))
owner.remove_traits(list(TRAIT_FLOORED, TRAIT_IMMOBILIZED), TRAIT_STATUS_EFFECT(id))
return ..()

/atom/movable/screen/alert/status_effect/knockdown
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/medical_pod/bodyscanner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
"toxloss" = H.getToxLoss(),
"cloneloss" = H.getCloneLoss(),
"brainloss" = H.getBrainLoss(),
"knocked_out" = H.GetKnockOutValueNotADurationDoNotUse(),
"knocked_out" = H.GetKnockOutDuration(),
"bodytemp" = H.bodytemperature,
"inaprovaline_amount" = H.reagents.get_reagent_amount("inaprovaline"),
"dexalin_amount" = H.reagents.get_reagent_amount("dexalin"),
Expand Down Expand Up @@ -263,7 +263,7 @@
s_class = occ["brainloss"] < 1 ? INTERFACE_GOOD : INTERFACE_BAD
dat += "[SET_CLASS("&nbsp&nbspApprox. Brain Damage:", INTERFACE_PINK)] [SET_CLASS("[occ["brainloss"]]%", s_class)]<br><br>"

dat += "[SET_CLASS("Knocked Out Summary:", "#40628a")] [occ["knocked_out"]]% (approximately [round(occ["knocked_out"] / 5)] seconds left!)<br>"
dat += "[SET_CLASS("Knocked Out Summary:", "#40628a")] [occ["knocked_out"]]% (approximately [round(occ["knocked_out"] * GLOBAL_STATUS_MULTIPLIER / (1 SECONDS))] seconds left!)<br>"
dat += "[SET_CLASS("Body Temperature:", "#40628a")] [occ["bodytemp"]-T0C]&deg;C ([occ["bodytemp"]*1.8-459.67]&deg;F)<br><HR>"

s_class = occ["blood_amount"] > 448 ? INTERFACE_OKAY : INTERFACE_BAD
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/medical_pod/sleeper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@
to_chat(user, "[]\t -Toxin Content %: []", (occupant.getToxLoss() < 60 ? SPAN_NOTICE("") : SPAN_DANGER("")), occupant.getToxLoss())
to_chat(user, "[]\t -Burn Severity %: []", (occupant.getFireLoss() < 60 ? SPAN_NOTICE("") : SPAN_DANGER("")), occupant.getFireLoss())
to_chat(user, SPAN_NOTICE(" Expected time till occupant can safely awake: (note: These times are always inaccurate)"))
to_chat(user, SPAN_NOTICE(" \t [occupant.GetKnockOutValueNotADurationDoNotUse() / 5] second\s (if around 1 or 2 the sleeper is keeping them asleep.)"))
to_chat(user, SPAN_NOTICE(" \t [occupant.GetKnockOutDuration() * GLOBAL_STATUS_MULTIPLIER / (1 SECONDS)] second\s (if around 1 or 2 the sleeper is keeping them asleep.)"))
else
to_chat(user, SPAN_NOTICE(" There is no one inside!"))
return
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1098,9 +1098,9 @@
for(var/datum/effects/bleeding/internal/internal_bleed in effects_list)
msg += "They have bloating and discoloration on their [internal_bleed.limb.display_name]\n"

if(knocked_out && stat != DEAD)
if(stat == UNCONSCIOUS)
msg += "They seem to be unconscious\n"
if(stat == DEAD)
else if(stat == DEAD)
if(src.check_tod() && is_revivable())
msg += "They're not breathing"
else
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/human_attackhand.dm
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,14 @@
w_uniform.add_fingerprint(M)


if(body_position == LYING_DOWN || sleeping)
if(HAS_TRAIT(src, TRAIT_FLOORED) || HAS_TRAIT(src, TRAIT_KNOCKEDOUT) || body_position == LYING_DOWN || sleeping)
if(client)
sleeping = max(0,src.sleeping-5)
if(!sleeping)
set_resting(FALSE)
M.visible_message(SPAN_NOTICE("[M] shakes [src] trying to wake [t_him] up!"), \
SPAN_NOTICE("You shake [src] trying to wake [t_him] up!"), null, 4)
else if(stunned)
else if(HAS_TRAIT(src, TRAIT_INCAPACITATED))
M.visible_message(SPAN_NOTICE("[M] shakes [src], trying to shake [t_him] out of his stupor!"), \
SPAN_NOTICE("You shake [src], trying to shake [t_him] out of his stupor!"), null, 4)
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
//Handle side effects from stasis
switch(in_stasis)
if(STASIS_IN_BAG)
// I hate whoever wrote this and statuses with a passion
knocked_down = knocked_down? --knocked_down : knocked_down + 10 //knocked_down set.
if(knocked_down <= 0)
knocked_down_callback()
// At least 6 seconds, but reduce by 2s every time - IN ADDITION to normal recovery
// Don't ask me why and feel free to change it
KnockDown(3)
AdjustKnockDown(-1)
if(STASIS_IN_CRYO_CELL)
if(sleeping < 10) sleeping += 10 //Puts the mob to sleep indefinitely.
5 changes: 1 addition & 4 deletions code/modules/mob/living/living_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
var/brainloss = 0 //'Retardation' damage caused by someone hitting you in the head with a bible or being infected with brainrot.
var/halloss = 0 //Hallucination damage. 'Fake' damage obtained through hallucinating or the holodeck. Sleeping should cause it to wear off.

// please don't use these
VAR_PROTECTED/knocked_out = 0
VAR_PROTECTED/knocked_down = 0
VAR_PROTECTED/stunned = 0
// please don't use these directly, use the procs
var/dazed = 0
var/slowed = 0 // X_SLOW_AMOUNT
var/superslowed = 0 // X_SUPERSLOW_AMOUNT
Expand Down
8 changes: 0 additions & 8 deletions code/modules/mob/living/living_health_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -493,11 +493,3 @@
return
face_dir(direction)
return ..()

// Transition handlers. do NOT use this. I mean seriously don't. It's broken. Players love their broken behaviors.
/mob/living/proc/GetStunValueNotADurationDoNotUse()
return stunned
/mob/living/proc/GetKnockDownValueNotADurationDoNotUse()
return knocked_down
/mob/living/proc/GetKnockOutValueNotADurationDoNotUse()
return knocked_out
3 changes: 0 additions & 3 deletions code/modules/mob/living/silicon/ai/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
// Gain Power
apply_damage(-1, OXY)

// Handle EMP-stun
handle_stunned()

//stage = 1
//if (isRemoteControlling(src)) // Are we not sure what we are?
var/blind = 0
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/silicon/robot/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/mob/living/silicon/robot/proc/clamp_values()

// set_effect(min(stunned, 30), STUN)
set_effect(min(knocked_out, 30), PARALYZE)
// set_effect(min(knocked_out, 30), PARALYZE)
// set_effect(min(knocked_down, 20), WEAKEN)
sleeping = 0
apply_damage(0, BRUTE)
Expand Down
5 changes: 0 additions & 5 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -853,11 +853,6 @@ note dizziness decrements automatically in the mob's Life() proc.
handle_slowed()
handle_superslowed()

/mob/living/proc/handle_stunned()
if(stunned)
adjust_effect(-1, STUN)
return stunned

/mob/living/proc/handle_dazed()
if(dazed)
adjust_effect(-1, DAZE)
Expand Down

0 comments on commit 465f7c3

Please sign in to comment.