Files
Paradise/code/modules/surgery/organs/brain.dm
BiancaWilkson 036b8e0182 Mindflayers v0.9, Playable Edition! (#26596)
* adds antaghud icon

* TGUI bundle build dont push changes i didnt stage challenge 2025 (IMPOSSIBLE)

* Adds organ repair passive

* Description fix

* Runs prettier

* Fixes desc 2

* Fix revert

* Remove vamp text

* Fix some CI + Partial refactor

* Fixes CI

* Fixes gamemodes I messed with

* Moves these procs over

* Description fix again

* Add back limit requiring drainees to have ckeys

* Adds terminator icon

* Update code/datums/status_effects/buffs.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Update code/modules/surgery/organs/augments_internal.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/modules/antagonists/mind_flayer/powers/flayer_stealth_powers.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* More lewv review

* Clamps the EMP severity

* Fixes "surveilance" typos

* The TODO is gone and can't hurt me anymore

* Update code/modules/antagonists/mind_flayer/flayer_datum.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/game/objects/items/weapons/pneumaticCannon.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/game/objects/items/weapons/stunbaton.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* More lewc reviews

* Update code/modules/antagonists/_common/antag_datum.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/modules/antagonists/_common/antag_datum.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/modules/antagonists/mind_flayer/flayer_datum.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/modules/antagonists/mind_flayer/flayer_datum.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/modules/antagonists/mind_flayer/flayer_datum.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/modules/antagonists/mind_flayer/flayer_datum.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/modules/antagonists/mind_flayer/flayer_power.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Fixes some camera bug issues + lewc reviews

* Update code/modules/antagonists/mind_flayer/powers/flayer_passives.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Update code/modules/antagonists/mind_flayer/flayer_power.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Updates a comment and fixes whitespace

* Autodocs flayerprod

* Update code/modules/antagonists/mind_flayer/powers/flayer_mobility_powers.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* qdel things we dont need anymore + typing an argument of add_abillity

* Remove debug log

* Update code/modules/antagonists/mind_flayer/flayer_power.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* Slightly buffs, and fixes GC issues of tether

* I no longer feel i am a mindflayer

* Fixes formatting of greeting

* Better greeting

* Worlds shittiest sprite

* Don't need this TODO anymore

* Fixes double description

* Changes the wording on the borg laws

* and bundle too

* The cannon uses shrapnel now

* Initial style changes

* Ratios for brain damage

* Adds a chemical to test for flayerism

* Fixes the brain damage ratios

* Abilities are purchasable again

* Updates TGUI properly

* im sorry linter

* Steam smoke

* Hi bundle

* Re-abstracts this proc post syndi orgs

* Fixes gamemode logic post cling round removal

* I WONT FORGET IT THIS TIME

* Fix name of steam ability

* I'm a fool

* Fixes processed passives + removes debug message

* Fixes updating abilities inside UI

* Better description for quicksilver form

* First part lewc review

* Remove debug thingy

* Apply suggestions from code review

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Fixes defines + GCs weapon spells

* We don't need this

* Eyes GC properly

* Update code/modules/antagonists/mind_flayer/powers/flayer_mobility_powers.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* adds better logging to the assimilate

* Adds parenthesis

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>

* TGUI Bundle Rebuild

* Fixes and Reworks TGUI

* Cleaner JS and Fixes

* adds anti-snitching clause to borg laws

* changes the span for the borg messages

* No holoparasites

* Puts baton silence in line with glare

* Fixes total_swarms_gathered

* Nuke old trait

* Gun no longer not stuck

* Rejuv clears delayed knockdown

* Some weapon ability fixes

* Makes radio enable timers not counterintuitive

* Fixes beepsky runtimes

* Makes naming more consistent

* Adds one-click-antag

* Adds the mind flayer toggle (doesn't technically work)

* Adds flayers to check_antagonist

* Gives IDs to the status effects

* Also this one

* Makes retracting work again if it's in your offhand

* Fixes pacification tech levels

* Grapple is a weapon ability now, nullifcation retracts implants

* Fixed descriptions

* Adds some pizzaz to torque enhancer

* This actually needs to be like this

* Moves a helper proc over to a helper proc file

* Extra admin visibility

* Nukes the wacky flayer mob

* Makes silicon administrative access more sane

* Terminator form better description

* Makes rejuv set stamina to 0

* Various price increases

* AAAAAAAAAAAAA

* Better feedback + logging on cyborg subversion

* Swarm purchase display (temp fix)

* Makes mindflayer sounds more silent

* UI improvements

* Various mindflayer fixes

* Typo

* More fixes

* Fixes innates from being stupid

* Forgot to add this check earlier

* Oh this is how you add things to the protolathe

* Changes some description and upgrade messages

* Allows you to drain people beyond your limit

* Fixes some weapon upgrade issues

* Fix CI

* Fixes some draining issues

* More UI Tweaks and QoL

* Fixes most of the issues

* text

* Fixes

* Adds a radio jamming option to intruder

* Gives obfusciation to jammer ability

* Small passive cleanup

* Fixes Search and Adds Ability Stages to UI

* Adds freebie abilities

* Restructuring chain and adding blackbox

* Tgui polish

* Small fix for traceroute

* Fixes one click antag

* Increases EMP resistance cost

* Changes the pneumatic cannon into a shotgun

* Slightly lower static

* Fixed innate building rendering in upgrades

* Fixes icon and description

* Consistency

* Punctuation fix.

* Quick reboot + terminator form synergy

* Adds safety deleting

* Fix level for torque

* Fixes a bad bug

* Update code/game/gamemodes/objective.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Aaaaaaaaaaa

* Makes torque a martial art and some martial arts safeties

* Replaces vortex arm with barrier

* Fix paths

* Adds torque knockdown

* Part 1 lewc review

* HIIIII SQUIDWARD I'M IN YOUR BRANCH NOW

* Removes flak cannon

* Flayer respects mindshielding now on vamp+cling

* Fixes EMP resist

* More fixes

* DGL review

* Contra review

* Clean up weapon powers

* Various tweaks

* Borg hand slight improvements

* Parent call needs to be after this

* Fixes stuff

* Adds a new proc that is called when a spell is purchased

* NEW SPRITES WOOOO

* Traceroute update

* Slightly lower traceroute cost

* Formatting

* Oops

* Wow this could've been bad

* Overclock small buff

* Reduces cost of 1st level EMP immunity

* Lewc review

* TGUI Bundle Rebuild

* Fix barricades

* Lewc review

* Okay FINE qwerty I'll change this

* Traceroute thingy

* I am an idiot

* First part

* Lewc review

* Forgor  this one

* Last bits

* Update code/game/objects/items/control_wand.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Update code/modules/antagonists/mind_flayer/powers/flayer_mobility_powers.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Null

* Static-ness

* Update code/game/gamemodes/changeling/traitor_chan.dm

Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Update code/__DEFINES/mindflayer_defines.dm

Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>

* Last bits

---------

Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: BiancaWilkson <42818125+BiancaWilkson@users.noreply.github.com>
Co-authored-by: DGamerL <daan.lyklema@gmail.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com>
2024-10-30 18:35:29 +00:00

221 lines
7.6 KiB
Plaintext

/obj/item/organ/internal/brain
name = "brain"
max_damage = 120
icon_state = "brain2"
force = 1.0
w_class = WEIGHT_CLASS_SMALL
throwforce = 1.0
throw_speed = 3
throw_range = 5
origin_tech = "biotech=5"
attack_verb = list("attacked", "slapped", "whacked")
var/mob/living/brain/brainmob = null
organ_tag = "brain"
parent_organ = "head"
slot = "brain"
vital = TRUE
hidden_pain = TRUE //the brain has no pain receptors, and brain damage is meant to be a stealthy damage type.
var/mmi_icon = 'icons/obj/assemblies.dmi'
var/mmi_icon_state = "mmi_full"
/// If it's a fake brain without a mob assigned that should still be treated like a real brain.
var/decoy_brain = FALSE
/// Do we have temporary brain max hp reduction?
var/temporary_damage = 0
/obj/item/organ/internal/brain/xeno
name = "xenomorph brain"
desc = "We barely understand the brains of terrestial animals. Who knows what we may find in the brain of such an advanced species?"
icon_state = "brain-x"
origin_tech = "biotech=6"
mmi_icon = 'icons/mob/alien.dmi'
mmi_icon_state = "AlienMMI"
/obj/item/organ/internal/brain/Destroy()
QDEL_NULL(brainmob)
return ..()
/obj/item/organ/internal/brain/proc/transfer_identity(mob/living/carbon/H)
brainmob = new(src)
if(isnull(dna)) // someone didn't set this right...
stack_trace("[src] at [loc] did not contain a dna datum at time of removal.")
dna = H.dna.Clone()
if(dna.real_name)
name = "\the [dna.real_name]'s [initial(name)]"
brainmob.name = dna.real_name
brainmob.real_name = dna.real_name
else
name = "\the [H.real_name]'s [initial(name)]"
brainmob.name = H.real_name
brainmob.real_name = H.real_name
brainmob.dna = dna.Clone() // Silly baycode, what you do
brainmob.timeofhostdeath = H.timeofdeath
if(H.mind)
H.mind.transfer_to(brainmob)
to_chat(brainmob, "<span class='notice'>You feel slightly disoriented. That's normal when you're just a [initial(name)].</span>")
/obj/item/organ/internal/brain/examine(mob/user) // -- TLE
. = ..()
if(brainmob && brainmob.client)//if thar be a brain inside... the brain.
. += "You can feel a bright spark of life in this one!"
return
if(brainmob?.mind)
if(brainmob.get_ghost())
. += "You can feel the small spark of life still left in this one."
return
. += "This one seems particularly lifeless. Perhaps it will regain some of its luster later.."
/obj/item/organ/internal/brain/remove(mob/living/user, special = 0)
if(dna)
name = "[dna.real_name]'s [initial(name)]"
if(!owner) return ..() // Probably a redundant removal; just bail
var/obj/item/organ/internal/brain/B = src
if(!special)
if(owner.mind && !non_primary && !decoy_brain)//don't transfer if the owner does not have a mind.
B.transfer_identity(user)
if(ishuman(owner))
var/mob/living/carbon/human/H = owner
H.update_hair()
owner.thought_bubble_image = initial(owner.thought_bubble_image)
. = ..()
/obj/item/organ/internal/brain/insert(mob/living/target, special = 0)
name = "[initial(name)]"
var/brain_already_exists = FALSE
if(ishuman(target)) // No more IPC multibrain shenanigans
if(target.get_int_organ(/obj/item/organ/internal/brain))
brain_already_exists = TRUE
var/mob/living/carbon/human/H = target
H.update_hair()
if(IS_CHANGELING(target))
decoy_brain = TRUE
if(!brain_already_exists)
if(brainmob)
if(target.key)
target.ghostize()
if(brainmob.mind)
brainmob.mind.transfer_to(target)
else
target.key = brainmob.key
else
log_debug("Multibrain shenanigans at ([target.x],[target.y],[target.z]), mob '[target]'")
..(target, special = special)
/obj/item/organ/internal/brain/receive_damage(amount, silent = 0) //brains are special; if they receive damage by other means, we really just want the damage to be passed ot the owner and back onto the brain.
if(owner)
owner.adjustBrainLoss(amount)
/obj/item/organ/internal/brain/necrotize(update_sprite = TRUE, ignore_vital_death = FALSE) //Brain also has special handling for when it necrotizes
damage = max_damage
status |= ORGAN_DEAD
STOP_PROCESSING(SSobj, src)
if(dead_icon && !is_robotic())
icon_state = dead_icon
if(owner && vital)
owner.setBrainLoss(120)
/obj/item/organ/internal/brain/on_life()
if(decoy_brain)
return
var/ratio = damage / max_damage // Get our damage as a percentage of max HP
if(ratio < BRAIN_DAMAGE_RATIO_LIGHT)
return
switch(ratio)
if(BRAIN_DAMAGE_RATIO_LIGHT to BRAIN_DAMAGE_RATIO_MINOR)
handle_minor_brain_damage()
if(BRAIN_DAMAGE_RATIO_MINOR to BRAIN_DAMAGE_RATIO_MODERATE)
handle_moderate_brain_damage()
if(BRAIN_DAMAGE_RATIO_MODERATE to BRAIN_DAMAGE_RATIO_SEVERE)
handle_severe_brain_damage()
if(BRAIN_DAMAGE_RATIO_SEVERE to BRAIN_DAMAGE_RATIO_CRITICAL)
handle_critical_brain_damage()
if(temporary_damage) // Heal our max hp limit by one per cycle
// We use `clamp()` here because `temporary_damage` can have decimals
temporary_damage = clamp(temporary_damage - 0.25, 0, 120)
max_damage = clamp(max_damage + 0.25, 0, 120)
/obj/item/organ/internal/brain/proc/handle_minor_brain_damage()
if(prob(5))
owner.Dizzy(5 SECONDS)
to_chat(owner, "<span class='warning'>Your head feels foggy.</span>")
else if(prob(4))
owner.vomit()
to_chat(owner, "<span class='warning'>You feel nauseous.</span>")
/obj/item/organ/internal/brain/proc/handle_moderate_brain_damage()
if(prob(4))
owner.Confused(20 SECONDS)
to_chat(owner, "<span class='warning'>It's suddenly difficult to walk straight.</span>")
else if(prob(5))
owner.EyeBlurry(15 SECONDS)
to_chat(owner, "<span class='warning'>Your vision unfocuses.</span>")
else if(prob(3))
owner.Slur(60 SECONDS)
owner.Stuttering(60 SECONDS)
to_chat(owner, "<span class='warning'>You can't form your words properly.</span>")
/obj/item/organ/internal/brain/proc/handle_severe_brain_damage()
if(prob(5))
owner.Hallucinate(60 SECONDS)
to_chat(owner, "<span class='warning'>You start losing your grip on reality.</span>")
else if(prob(3))
owner.Drowsy(20 SECONDS)
to_chat(owner, "<span class='warning'>You're getting tired.</span>")
else if(prob(2))
owner.Stun(5 SECONDS)
to_chat(owner, "<span class='warning'>You stare forward in a stupor.</span>")
else if(prob(5))
owner.KnockDown(1 SECONDS)
to_chat(owner, "<span class='warning'>You lose your footing, and stumble.</span>")
/obj/item/organ/internal/brain/proc/handle_critical_brain_damage()
if(prob(4))
owner.Silence(45 SECONDS)
to_chat(owner, "<span class='warning'>You open your mouth to speak, but no sound comes out.</span>")
else if(prob(5))
owner.EyeBlind(30 SECONDS)
to_chat(owner, "<span class='warning'>Your vision gives out.</span>")
else if(prob(5))
owner.Weaken(10 SECONDS)
owner.Jitter(150 SECONDS)
to_chat(owner, "<span class='warning'>You start to have a seizure.</span>")
/obj/item/organ/internal/brain/prepare_eat()
return // Too important to eat.
// Hello I am from the ministry of rubber forehead aliens how are you
/obj/item/organ/internal/brain/slime
name = "slime core"
desc = "A complex, organic knot of jelly and crystalline particles."
icon = 'icons/mob/slimes.dmi'
icon_state = "green slime extract"
mmi_icon_state = "slime_mmi"
organ_datums = list(/datum/organ/heart, /datum/organ/lungs/slime)
/obj/item/organ/internal/brain/golem
name = "Runic mind"
desc = "A tightly furled roll of paper, covered with indecipherable runes."
icon = 'icons/obj/wizard.dmi'
icon_state = "scroll"
/obj/item/organ/internal/brain/cluwne
/obj/item/organ/internal/brain/cluwne/insert(mob/living/target, special = 0, make_cluwne = 1)
..(target, special = special)
if(ishuman(target) && make_cluwne)
var/mob/living/carbon/human/H = target
H.makeCluwne() //No matter where you go, no matter what you do, you cannot escape