Skip to content

Commit

Permalink
Merge branch 'master' into translate
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jun 18, 2024
2 parents 234a05f + 25a4656 commit bac08f9
Show file tree
Hide file tree
Showing 32 changed files with 266 additions and 63 deletions.
4 changes: 4 additions & 0 deletions code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,10 @@
#define COMPONENT_BLOCK_DEFIB (1<<0)
/// If returned, don't even show the "failed" message, defer to the signal handler to do that.
#define COMPONENT_DEFIB_OVERRIDE (1<<1)
/// If returned, allow to revive through false death.
#define COMPONENT_DEFIB_FAKEDEATH_ACCEPTED (1<<2)
/// If returned, make the fake death look like a unresponsive ghost.
#define COMPONENT_DEFIB_FAKEDEATH_DENIED (1<<3)
///send from defibs on ressurection: (defibber, defib_item, ghost)
#define COMSIG_LIVING_DEFIBBED "living_defibbed"
///from base of mob/living/revive() (full_heal, admin_revive)
Expand Down
5 changes: 4 additions & 1 deletion code/__HELPERS/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@
var/datum/gear/G = geartype

var/use_category = initial(G.sort_category)

// SS220 EDIT - START
if(G.removed_from_loadout)
continue
// SS220 EDIT - END
if(G == initial(G.main_typepath))
continue

Expand Down
55 changes: 55 additions & 0 deletions code/_onclick/hud/alert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -870,3 +870,58 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
if(!istype(usr))
return
living_owner.do_succumb(TRUE)

/atom/movable/screen/alert/changeling_defib_revive
name = "Your heart is being defibrillated."
desc = "Click this status to be revived from fake death."
icon_state = "template"
timeout = 10 SECONDS
var/do_we_revive = FALSE
var/image/toggle_overlay

/atom/movable/screen/alert/changeling_defib_revive/Initialize(mapload, parent_unit)
. = ..()
var/image/defib_appearance = image(parent_unit)
defib_appearance.layer = FLOAT_LAYER
defib_appearance.plane = FLOAT_PLANE
overlays += defib_appearance

/atom/movable/screen/alert/changeling_defib_revive/attach_owner(mob/new_owner)
. = ..()
RegisterSignal(owner, COMSIG_LIVING_DEFIBBED, PROC_REF(on_defib_revive))

/atom/movable/screen/alert/changeling_defib_revive/Destroy()
if(owner)
UnregisterSignal(owner, COMSIG_LIVING_DEFIBBED)
if(toggle_overlay)
overlays -= toggle_overlay
qdel(toggle_overlay)
return ..()

/atom/movable/screen/alert/changeling_defib_revive/Click()
if(!..())
return
do_we_revive = !do_we_revive
if(!toggle_overlay)
toggle_overlay = image('icons/mob/screen_gen.dmi', icon_state = "selector")
toggle_overlay.layer = FLOAT_LAYER
toggle_overlay.plane = FLOAT_PLANE + 2
if(do_we_revive)
overlays |= toggle_overlay
else
overlays -= toggle_overlay

/atom/movable/screen/alert/changeling_defib_revive/proc/on_defib_revive()
. = COMPONENT_DEFIB_FAKEDEATH_DENIED
if(do_we_revive)
var/datum/antagonist/changeling/cling = owner.mind.has_antag_datum(/datum/antagonist/changeling)
cling.remove_specific_power(/datum/action/changeling/revive)
cling.regenerating = FALSE
var/heart_name = "heart"
if(iscarbon(owner))
var/mob/living/carbon/C = owner
var/datum/organ/heart/heart = C.get_int_organ_datum(ORGAN_DATUM_HEART)
heart_name = heart.linked_organ.name
to_chat(owner, "<span class='danger'>Electricity flows through our [heart_name]! We have been brought back to life and have stopped our regeneration.</span>")
. = COMPONENT_DEFIB_FAKEDEATH_ACCEPTED
owner.clear_alert("cling_defib")
47 changes: 27 additions & 20 deletions code/datums/components/defibrillator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@
to_chat(ghost, "<span class='ghostalert'>Your heart is being defibrillated. Return to your body if you want to be revived!</span> (Verbs -> Ghost -> Re-enter corpse)")
window_flash(ghost.client)
SEND_SOUND(ghost, sound('sound/effects/genetics.ogg'))
else if(HAS_TRAIT_FROM(target, TRAIT_FAKEDEATH, CHANGELING_TRAIT))
to_chat(target, "<span class='ghostalert'>Your heart is being defibrillated. Click the defibrillator status to be revived!</span>")
window_flash(target.client)
SEND_SOUND(target, sound('sound/effects/genetics.ogg'))
target.throw_alert("cling_defib", /atom/movable/screen/alert/changeling_defib_revive, alert_args = list(parent, target))

if(!do_after(user, 3 SECONDS * speed_multiplier, target = target)) // Beginning to place the paddles on patient's chest to allow some time for people to move away to stop the process
busy = FALSE
Expand Down Expand Up @@ -238,37 +243,39 @@
playsound(get_turf(defib_ref), 'sound/machines/defib_zap.ogg', 50, 1, -1)
ghost = target.get_ghost(TRUE) // We have to double check whether the dead guy has entered their body during the above

var/defib_success = TRUE

// Run through some quick failure states after shocking.
var/time_dead = world.time - target.timeofdeath

var/failure_message
if(!target.is_revivable())
user.visible_message("<span class='boldnotice'>[defib_ref] buzzes: Resuscitation failed - Heart tissue damage beyond point of no return for defibrillation.</span>")
defib_success = FALSE
failure_message = "<span class='boldnotice'>[defib_ref] buzzes: Resuscitation failed - Heart tissue damage beyond point of no return for defibrillation.</span>"
else if(target.getBruteLoss() >= 180 || target.getFireLoss() >= 180)
user.visible_message("<span class='boldnotice'>[defib_ref] buzzes: Resuscitation failed - Severe tissue damage detected.</span>")
defib_success = FALSE
failure_message = "<span class='boldnotice'>[defib_ref] buzzes: Resuscitation failed - Severe tissue damage detected.</span>"
else if(HAS_TRAIT(target, TRAIT_HUSK))
user.visible_message("<span class='boldnotice'>[defib_ref] buzzes: Resuscitation failed - Subject is husked.</span>")
defib_success = FALSE
failure_message = "<span class='boldnotice'>[defib_ref] buzzes: Resuscitation failed - Subject is husked.</span>"
else if(target.blood_volume < BLOOD_VOLUME_SURVIVE)
user.visible_message("<span class='boldnotice'>[defib_ref] buzzes: Resuscitation failed - Patient blood volume critically low.</span>")
defib_success = FALSE
failure_message = "<span class='boldnotice'>[defib_ref] buzzes: Resuscitation failed - Patient blood volume critically low.</span>"
else if(!target.get_organ_slot("brain")) // So things like headless clings don't get outed
user.visible_message("<span class='boldnotice'>[defib_ref] buzzes: Resuscitation failed - No brain detected within patient.</span>")
defib_success = FALSE
failure_message = "<span class='boldnotice'>[defib_ref] buzzes: Resuscitation failed - No brain detected within patient.</span>"
else if(ghost)
if(!ghost.can_reenter_corpse || target.suiciding) // DNR or AntagHUD
user.visible_message("<span class='boldnotice'>[defib_ref] buzzes: Resuscitation failed - No electrical brain activity detected.</span>")
failure_message = "<span class='boldnotice'>[defib_ref] buzzes: Resuscitation failed - No electrical brain activity detected.</span>"
else
failure_message = "<span class='boldnotice'>[defib_ref] buzzes: Resuscitation failed - Patient's brain is unresponsive. Further attempts may succeed.</span>"
else if(HAS_TRAIT(target, TRAIT_FAKEDEATH))
if(signal_result & COMPONENT_DEFIB_FAKEDEATH_DENIED)
failure_message = "<span class='boldnotice'>[defib_ref] buzzes: Resuscitation failed - Patient's brain is unresponsive. Further attempts may succeed.</span>"
else if(signal_result & COMPONENT_DEFIB_FAKEDEATH_ACCEPTED)
// as much as I hate that this is here, it has to come after the `Patient is not in a valid state. Operation aborted.` check.
REMOVE_TRAIT(target, TRAIT_FAKEDEATH, CHANGELING_TRAIT)
else
user.visible_message("<span class='boldnotice'>[defib_ref] buzzes: Resuscitation failed - Patient's brain is unresponsive. Further attempts may succeed.</span>")
defib_success = FALSE
else if((signal_result & COMPONENT_BLOCK_DEFIB) || HAS_TRAIT(target, TRAIT_FAKEDEATH) || HAS_TRAIT(target, TRAIT_BADDNA) || target.suiciding) // these are a bit more arbitrary
user.visible_message("<span class='boldnotice'>[defib_ref] buzzes: Resuscitation failed.</span>")
defib_success = FALSE
failure_message = "<span class='boldnotice'>[defib_ref] buzzes: Resuscitation failed.</span>" // has a fakedeath like capulettium

else if((signal_result & COMPONENT_BLOCK_DEFIB) || HAS_TRAIT(target, TRAIT_BADDNA) || target.suiciding) // these are a bit more arbitrary
failure_message = "<span class='boldnotice'>[defib_ref] buzzes: Resuscitation failed.</span>"

if(!defib_success)
if(failure_message)
user.visible_message(failure_message)
playsound(get_turf(defib_ref), 'sound/machines/defib_failed.ogg', 50, 0)
else
// Heal each basic damage type by as much as we're under -100 health
Expand Down Expand Up @@ -313,7 +320,7 @@
target.med_hud_set_status()
add_attack_logs(user, target, "Revived with [defib_ref]")
SSblackbox.record_feedback("tally", "players_revived", 1, "defibrillator")
SEND_SIGNAL(parent, COMSIG_DEFIB_SHOCK_APPLIED, user, target, should_cause_harm, defib_success)
SEND_SIGNAL(parent, COMSIG_DEFIB_SHOCK_APPLIED, user, target, should_cause_harm, isnull(failure_message))
set_cooldown(cooldown)
busy = FALSE

Expand Down
2 changes: 2 additions & 0 deletions code/game/machinery/computer/ai_core.dm
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@
SSticker.mode.remove_revolutionary(brain.brainmob.mind, 1)

var/mob/living/silicon/ai/A = new /mob/living/silicon/ai(loc, laws, brain)
// Stop holding onto the laws so we don't qdel them and make the AI randomly lose its laws when GC gives up and hard deletes them.
laws = null
if(A) //if there's no brain, the mob is deleted and a structure/AIcore is created
A.rename_self("ИИ", 1)
SSblackbox.record_feedback("amount", "ais_created", 1)
Expand Down
1 change: 0 additions & 1 deletion code/game/objects/effects/effect_system/effects_sparks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

/obj/effect/particle_effect/sparks/New()
..()
flick("sparks", src) // replay the animation
playsound(src, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
var/turf/T = loc
if(isturf(T))
Expand Down
51 changes: 21 additions & 30 deletions code/game/objects/items/weapons/manuals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -501,23 +501,16 @@
<b>Anti-Plague Sequence Beta</b>
<ul>
<li>1 unit of blood containing zombie plague cured by Anti-Plague Sequence Alpha</li>
<li>2 random chemicals from the list below, 1 unit of each (Unknown Random Recipe)
<li>3 random chemicals from the list below, 1 unit of each (Unknown Random Recipe)
<ul>
<li>Yellow Vomit</li>
<li>Jenkem</li>
<li>Charcoal</li>
<li>Egg</li>
<li>Saline-Glucose Solution</li>
<li>Toxin</li>
<li>Atropine</li>
<li>Lye</li>
<li>Sulphuric acid</li>
<li>Fluorosulfuric Acid</li>
<li>Soda Water</li>
<li>Surge</li>
<li>Ultra-Lube</li>
<li>Happiness</li>
<li>Morphine</li>
<li>Teporone</li>
</ul>
</li>
</ul>
Expand All @@ -527,17 +520,33 @@
<li>1 unit of blood containing zombie plague cured by Anti-Plague Sequence Beta</li>
<li>1 unit of blood containing an advanced virus with the <b>"Necrotizing Fasciitis"</b> symptom</li>
<li>3 random chemicals from the list below, 1 unit of each (Unknown Random Recipe)
<ul>
<li>Yellow Vomit</li>
<li>Jenkem</li>
<li>Charcoal</li>
<li>Egg</li>
<li>Sulphuric acid</li>
<li>Fluorosulfuric Acid</li>
<li>Surge</li>
<li>Ultra-Lube</li>
<li>Mitocholide</li>
</ul>
</li>
</ul>

<b>Anti-Plague Sequence Omega</b>
<ul>
<li>1 unit of blood containing zombie plague cured by Anti-Plague Sequence Gamma</li>
<li>1 unit of blood containing an advanced virus with the <b>"Anti-Bodies Metabolism"</b> symptom</li>
<li>2 of the chemicals from the list below, 1 unit of each (Unknown Random Recipe)
<ul>
<li>Colorful Reagent</li>
<li>Bacchus' Blessing</li>
<li>Pentetic Acid</li>
<li>Teporone</li>
<li>Glyphosate</li>
<li>Lazarus Reagent</li>
<li>Omnizine</li>
<li>Sarin</li>
<li>Mitocholide</li>
<li>Fliptonium</li>
<li>Ants</li>
<li>Chlorine Trifluoride</li>
<li>Sorium</li>
Expand All @@ -547,24 +556,6 @@
</li>
</ul>

<b>Anti-Plague Sequence Omega</b>
<ul>
<li>1 unit of blood containing zombie plague cured by Anti-Plague Sequence Gamma</li>
<li>1 unit of blood containing an advanced virus with the <b>"Anti-Bodies Metabolism"</b> symptom</li>
<li>2 of the chemicals from the list below, 1 unit of each (Unknown Random Recipe)
<ul>
<li>Entropic Polypnium</li>
<li>Tinea Luxor</li>
<li>earthsblood</li>
<li>Bath Salts</li>
<li>Rezadone</li>
<li>Rotatium</li>
<li>Krokodil</li>
<li>Fliptonium</li>
</ul>
</li>
</ul>

<b>Anti-Plague Sequence Duplication</b>
<ul>
<li>1 unit of any Anti-Plague Sequence</li>
Expand Down
1 change: 0 additions & 1 deletion code/game/turfs/simulated/floor/misc_floor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@
icon = 'icons/turf/floors/catwalk_floor.dmi'
icon_state = "catwalk"
base_icon_state = "catwalk"
baseturf = /turf/simulated/floor/plating
floor_tile = /obj/item/stack/tile/catwalk
smoothing_flags = SMOOTH_BITMASK
smoothing_groups = list(SMOOTH_GROUP_CATWALK, SMOOTH_GROUP_SIMULATED_TURFS)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/antagonists/changeling/changeling_power.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
var/req_stat = CONSCIOUS
/// If this power is active or not. Used for toggleable abilities.
var/active = FALSE
/// If this power can be used while the changeling has the `TRAIT_FAKE_DEATH` trait.
/// If this power can be used while the changeling has the `TRAIT_FAKEDEATH` trait.
var/bypass_fake_death = FALSE

/*
Expand Down
16 changes: 16 additions & 0 deletions code/modules/antagonists/changeling/datum_changeling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,22 @@ RESTRICT_TYPE(/datum/antagonist/changeling)
acquired_powers += power
power.on_purchase(changeling || owner.current, src)

/**
* Removes all `power_type` abilities that the changeling has. Refunds the cost of the power from our genetic points.
*
* Arugments:
* * datum/action/changeling/power - the typepath power to remove from the changeling.
* * refund_cost - if we should refund genetic points when giving the power
*/
/datum/antagonist/changeling/proc/remove_specific_power(datum/action/changeling/power_type, refund_cost = TRUE)
for(var/datum/action/changeling/power in acquired_powers)
if(!istype(power, power_type))
continue
if(refund_cost)
genetic_points -= power.dna_cost
acquired_powers -= power
qdel(power)

/**
* Store the languages from the `new_languages` list into the `absorbed_languages` list. Teaches the changeling the new languages.
*
Expand Down
3 changes: 3 additions & 0 deletions code/modules/antagonists/changeling/powers/fakedeath.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
user.updatehealth("fakedeath sting")
cling.regenerating = TRUE

cling.remove_specific_power(/datum/action/changeling/revive)
addtimer(CALLBACK(src, PROC_REF(ready_to_regenerate), user), CHANGELING_FAKEDEATH_TIME)
SSblackbox.record_feedback("nested tally", "changeling_powers", 1, list("[name]"))
return TRUE

/datum/action/changeling/fakedeath/proc/ready_to_regenerate(mob/user)
if(!HAS_TRAIT_FROM(user, TRAIT_FAKEDEATH, CHANGELING_TRAIT))
return
if(!QDELETED(user) && user.mind && cling?.acquired_powers)
to_chat(user, "<span class='notice'>We are ready to regenerate.</span>")
cling.give_power(new /datum/action/changeling/revive)
Expand Down
4 changes: 4 additions & 0 deletions code/modules/antagonists/changeling/powers/revive.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
if(HAS_TRAIT(user, TRAIT_UNREVIVABLE))
to_chat(user, "<span class='notice'>Something is preventing us from regenerating, we will need to revive at another point.</span>")
return FALSE
if(!HAS_TRAIT_FROM(user, TRAIT_FAKEDEATH, CHANGELING_TRAIT))
cling.acquired_powers -= src
Remove(user)
return
REMOVE_TRAIT(user, TRAIT_FAKEDEATH, CHANGELING_TRAIT)
for(var/obj/item/grab/G in user.grabbed_by)
var/mob/living/carbon/M = G.assailant
Expand Down
8 changes: 8 additions & 0 deletions code/modules/client/preference/loadout/loadout_accessories.dm
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@
display_name = "Corset, blue"
path = /obj/item/clothing/accessory/corset/blue

/datum/gear/accessory/nt_pin
display_name = "Nanotrasen pin"
path = /obj/item/clothing/accessory/pin

/datum/gear/accessory/pride_pin
display_name = "Pride pin"
path = /obj/item/clothing/accessory/pin/pride

/datum/gear/accessory/armband_red
display_name = "Armband"
path = /obj/item/clothing/accessory/armband
Expand Down
Loading

0 comments on commit bac08f9

Please sign in to comment.