Files
CHOMPStation2/code/modules/organs/internal/brain.dm
Neerti ea6128f986 Adds Modifier System, Changes Some Ling Stuff
Adds a fairly simple system that allows adjusting various numbers like max health, incoming damage, outgoing melee damage, etc.  The nice part is that changing certain variables this way (like max health) is a lot safer than manually setting the max health var directly.
Changes a lot of short lines of code to point towards a variable's getter or setter helper instead of reading the var directly so the modifiers can work.
Endoarmor, delayed toxin sting, Enfeebling sting, and recursive adrenaline overdose now use the modifier system.
Enfeebling sting now only lasts two minutes, from five minutes, however it now also reduces the victim's melee damage by 25%/50%, and increases the damage they suffer by 10%/35%, for normal and recursive respectively.
Delayed Toxin Sting's effects are now felt all at once instead of over the course of a few minutes.
2017-04-18 21:23:59 -04:00

136 lines
3.9 KiB
Plaintext

/obj/item/organ/internal/brain
name = "brain"
health = 400 //They need to live awhile longer than other organs. Is this even used by organ code anymore?
desc = "A piece of juicy meat found in a person's head."
organ_tag = "brain"
parent_organ = BP_HEAD
vital = 1
icon_state = "brain2"
force = 1.0
w_class = ITEMSIZE_SMALL
throwforce = 1.0
throw_speed = 3
throw_range = 5
origin_tech = list(TECH_BIO = 3)
attack_verb = list("attacked", "slapped", "whacked")
var/mob/living/carbon/brain/brainmob = null
/obj/item/organ/internal/brain/robotize()
replace_self_with(/obj/item/organ/internal/mmi_holder/posibrain)
/obj/item/organ/internal/brain/mechassist()
replace_self_with(/obj/item/organ/internal/mmi_holder)
/obj/item/organ/internal/brain/digitize()
replace_self_with(/obj/item/organ/internal/mmi_holder/robot)
/obj/item/organ/internal/brain/handle_germ_effects()
. = ..() //Up should return an infection level as an integer
if(!.) return
//Bacterial meningitis (more of a spine thing but 'brain infection' isn't a common thing)
if (. >= 1)
if(prob(1))
owner.custom_pain("Your neck aches, and feels very stiff!",0)
if (. >= 2)
if(prob(1))
owner.custom_pain("Your feel very dizzy for a moment!",0)
owner.Confuse(2)
/obj/item/organ/internal/brain/proc/replace_self_with(replace_path)
var/mob/living/carbon/human/tmp_owner = owner
qdel(src)
if(tmp_owner)
tmp_owner.internal_organs_by_name[organ_tag] = new replace_path(tmp_owner, 1)
tmp_owner = null
/obj/item/organ/internal/pariah_brain
name = "brain remnants"
desc = "Did someone tread on this? It looks useless for cloning or cyborgification."
organ_tag = "brain"
parent_organ = BP_HEAD
icon = 'icons/mob/alien.dmi'
icon_state = "chitin"
vital = 1
/obj/item/organ/internal/brain/xeno
name = "thinkpan"
desc = "It looks kind of like an enormous wad of purple bubblegum."
icon = 'icons/mob/alien.dmi'
icon_state = "chitin"
/obj/item/organ/internal/brain/New()
..()
health = config.default_brain_health
spawn(5)
if(brainmob && brainmob.client)
brainmob.client.screen.len = null //clear the hud
/obj/item/organ/internal/brain/Destroy()
if(brainmob)
qdel(brainmob)
brainmob = null
..()
/obj/item/organ/internal/brain/proc/transfer_identity(var/mob/living/carbon/H)
if(!brainmob)
brainmob = new(src)
brainmob.name = H.real_name
brainmob.real_name = H.real_name
brainmob.dna = H.dna.Clone()
brainmob.timeofhostdeath = H.timeofdeath
if(H.mind)
H.mind.transfer_to(brainmob)
brainmob << "<span class='notice'>You feel slightly disoriented. That's normal when you're just \a [initial(src.name)].</span>"
callHook("debrain", list(brainmob))
/obj/item/organ/internal/brain/examine(mob/user) // -- TLE
..(user)
if(brainmob && brainmob.client)//if thar be a brain inside... the brain.
user << "You can feel the small spark of life still left in this one."
else
user << "This one seems particularly lifeless. Perhaps it will regain some of its luster later.."
/obj/item/organ/internal/brain/removed(var/mob/living/user)
if(name == initial(name))
name = "\the [owner.real_name]'s [initial(name)]"
var/mob/living/simple_animal/borer/borer = owner.has_brain_worms()
if(borer)
borer.detatch() //Should remove borer if the brain is removed - RR
var/obj/item/organ/internal/brain/B = src
if(istype(B) && istype(owner))
B.transfer_identity(owner)
..()
/obj/item/organ/internal/brain/replaced(var/mob/living/target)
if(target.key)
target.ghostize()
if(brainmob)
if(brainmob.mind)
brainmob.mind.transfer_to(target)
else
target.key = brainmob.key
..()
/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"
/obj/item/organ/internal/brain/golem
name = "chem"
desc = "A tightly furled roll of paper, covered with indecipherable runes."
icon = 'icons/obj/wizard.dmi'
icon_state = "scroll"