mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 13:38:41 +01:00
## About The Pull Request That part wasn't finished. It won't! The other change just makes it so non-vox aug brains can die from emps. ## Proof Of Testing it didn't work then, it's gone now ## Changelog 🆑 balance: vox get to keep their min brain health threshold from emps, removed it from roundstart aug brains. del: surplus cybernetic brain is gone again /🆑
137 lines
7.5 KiB
Plaintext
137 lines
7.5 KiB
Plaintext
/obj/item/organ/brain/cybernetic
|
|
name = "cybernetic brain"
|
|
desc = "A mechanical brain found inside of androids. Not to be confused with a positronic brain."
|
|
icon_state = "brain-c"
|
|
organ_flags = ORGAN_ROBOTIC | ORGAN_VITAL | ORGAN_PROMINENT //BUBBER EDIT - Added ORGAN_PROMINENT
|
|
failing_desc = "seems to be broken, and will not work without repairs."
|
|
shade_color = null
|
|
var/emp_dmg_mult = 1 //BUBBER EDIT - Variable multiplier for damage from EMPs. Note the base damage is 20/10.
|
|
var/emp_dmg_max = 999 ///BUBBER EDIT - Threshold before the organ simply stops taking damage from EMPs. Defaults to kill
|
|
|
|
/* BUBBER EDIT - Reformatted this to change text based on flags
|
|
/obj/item/organ/brain/cybernetic/brain_damage_examine()
|
|
if(suicided)
|
|
return span_info("Its circuitry is smoking slightly. They must not have been able to handle the stress of it all.")
|
|
if(brainmob && (decoy_override || brainmob.client || brainmob.get_ghost()))
|
|
if(organ_flags & ORGAN_FAILING)
|
|
return span_info("It seems to still have a bit of energy within it, but it's rather damaged... You may be able to repair it with a <b>multitool</b>.")
|
|
else if(damage >= BRAIN_DAMAGE_DEATH*0.5)
|
|
return span_info("You can feel the small spark of life still left in this one, but it's got some dents. You may be able to restore it with a <b>multitool</b>.")
|
|
else
|
|
return span_info("You can feel the small spark of life still left in this one.")
|
|
else
|
|
return span_info("This one is completely devoid of life.")
|
|
*/
|
|
//BUBBER EDIT - See above
|
|
/obj/item/organ/brain/cybernetic/brain_damage_examine()
|
|
|
|
var/is_organic = (organ_flags & ORGAN_ORGANIC) //this determines if it'll print the organic or cybernetic texts
|
|
|
|
if(suicided)
|
|
return span_info("Its circuitry is smoking slightly. They must not have been able to handle the stress of it all.")
|
|
if(brainmob && (decoy_override || brainmob.client || brainmob.get_ghost()))
|
|
if(organ_flags & ORGAN_FAILING)
|
|
return span_info("It seems to still have a bit of energy within it, but it's rather damaged... You may be able to repair it with [is_organic ? "some <b>mannitol</b> or " : ""]a <b>multitool</b>.")
|
|
else if(damage >= BRAIN_DAMAGE_DEATH*0.5)
|
|
return span_info("You can feel the small spark of life still left in this one, but it's got some dents. You may be able to restore it with [is_organic ? "some <b>mannitol</b> or " : ""]a <b>multitool</b>.")
|
|
else
|
|
return span_info("You can feel the small spark of life still left in this one.")
|
|
else
|
|
return span_info("This one is completely devoid of life.")
|
|
// EDIT END
|
|
|
|
/* BUBBER EDIT - Expands this proc for hybrid brain_size.
|
|
ORIGINAL:
|
|
/obj/item/organ/brain/cybernetic/check_for_repair(obj/item/item, mob/user)
|
|
|
|
if (item.tool_behaviour == TOOL_MULTITOOL) //attempt to repair the brain
|
|
if (brainmob?.health <= HEALTH_THRESHOLD_DEAD) //if the brain is fucked anyway, do nothing
|
|
to_chat(user, span_warning("[src] is far too damaged, there's nothing else we can do for it!"))
|
|
return TRUE
|
|
if (DOING_INTERACTION(user, src))
|
|
to_chat(user, span_warning("you're already repairing [src]!"))
|
|
return TRUE
|
|
user.visible_message(span_notice("[user] slowly starts to repair [src] with [item]."), span_notice("You slowly start to repair [src] with [item]."))
|
|
var/did_repair = FALSE
|
|
while(damage > 0)
|
|
if(item.use_tool(src, user, 3 SECONDS, volume = 50))
|
|
did_repair = TRUE
|
|
set_organ_damage(max(0, damage - 20))
|
|
else
|
|
break
|
|
if (did_repair)
|
|
if (damage > 0)
|
|
user.visible_message(span_notice("[user] partially repairs [src] with [item]."), span_notice("You partially repair [src] with [item]."))
|
|
else
|
|
user.visible_message(span_notice("[user] fully repairs [src] with [item], causing its warning light to stop flashing."), span_notice("You fully repair [src] with [item], causing its warning light to stop flashing."))
|
|
else
|
|
to_chat(user, span_warning("You failed to repair [src] with [item]!"))
|
|
return TRUE
|
|
return FALSE
|
|
EDIT END */
|
|
|
|
// EDITED:
|
|
/obj/item/organ/brain/cybernetic/check_for_repair(obj/item/item, mob/user)
|
|
if (item.tool_behaviour == TOOL_MULTITOOL && (organ_flags & ORGAN_ROBOTIC)) //robotic repair option
|
|
if (brainmob?.health <= HEALTH_THRESHOLD_DEAD) //if the brain is fucked anyway, do nothing
|
|
to_chat(user, span_warning("[src] is far too damaged, there's nothing else we can do for it!"))
|
|
return TRUE
|
|
|
|
if (DOING_INTERACTION(user, src))
|
|
to_chat(user, span_warning("you're already repairing [src]!"))
|
|
return TRUE
|
|
|
|
user.visible_message(span_notice("[user] slowly starts to repair [src] with [item]."), span_notice("You slowly start to repair [src] with [item]."))
|
|
var/did_repair = FALSE
|
|
while(damage > 0)
|
|
if(item.use_tool(src, user, 3 SECONDS, volume = 50))
|
|
did_repair = TRUE
|
|
set_organ_damage(max(0, damage - 20))
|
|
else
|
|
break
|
|
|
|
if (did_repair)
|
|
if (damage > 0)
|
|
user.visible_message(span_notice("[user] partially repairs [src] with [item]."), span_notice("You partially repair [src] with [item]."))
|
|
else
|
|
user.visible_message(span_notice("[user] fully repairs [src] with [item], causing its warning light to stop flashing."), span_notice("You fully repair [src] with [item], causing its warning light to stop flashing."))
|
|
else
|
|
to_chat(user, span_warning("You failed to repair [src] with [item]!"))
|
|
|
|
return TRUE
|
|
else if(damage && item.is_drainable() && item.reagents.has_reagent(/datum/reagent/medicine/mannitol) && (organ_flags & ORGAN_ORGANIC)) //ganic repair option (this is for the cortical children)
|
|
if(brainmob?.health <= HEALTH_THRESHOLD_DEAD) //if the brain is fucked anyway, do nothing
|
|
to_chat(user, span_warning("[src] is far too damaged, there's nothing else we can do for it!"))
|
|
return TRUE
|
|
|
|
user.visible_message(span_notice("[user] starts to slowly pour the contents of [item] onto [src]."), span_notice("You start to slowly pour the contents of [item] onto [src]."))
|
|
if(!do_after(user, 3 SECONDS, src))
|
|
to_chat(user, span_warning("You failed to pour the contents of [item] onto [src]!"))
|
|
return TRUE
|
|
var/and_bright_shade = !shade_color ? "" : " and turn a slightly brighter shade of [shade_color]"
|
|
user.visible_message(span_notice("[user] pours the contents of [item] onto [src], causing it to reform its original shape[and_bright_shade]."), span_notice("You pour the contents of [item] onto [src], causing it to reform its original shape[and_bright_shade]."))
|
|
var/amount = item.reagents.get_reagent_amount(/datum/reagent/medicine/mannitol)
|
|
var/healto = max(0, damage - amount * 2)
|
|
item.reagents.remove_all(ROUND_UP(item.reagents.total_volume / amount * (damage - healto) * 0.5)) //only removes however much solution is needed while also taking into account how much of the solution is mannitol
|
|
set_organ_damage(healto) //heals 2 damage per unit of mannitol, and by using "set_organ_damage", we clear the failing variable if that was up
|
|
return TRUE
|
|
|
|
return FALSE
|
|
|
|
/obj/item/organ/brain/cybernetic/emp_act(severity)
|
|
. = ..()
|
|
if(. & EMP_PROTECT_SELF)
|
|
return
|
|
//BUBBER EDIT BEGIN - can't be emp'd if dead
|
|
if(owner.stat == DEAD)
|
|
return
|
|
//BUBBER EDIT END
|
|
switch(severity)
|
|
if (EMP_HEAVY)
|
|
to_chat(owner, span_boldwarning("You feel [pick("like your brain is being fried", "a sharp pain in your head")]!")) //BUBBER EDIT - added alert text for getting EMP'd.
|
|
owner.adjust_organ_loss(ORGAN_SLOT_BRAIN, (20*emp_dmg_mult), emp_dmg_max) //BUBBER EDIT - cap implemented
|
|
if (EMP_LIGHT)
|
|
to_chat(owner, span_warning("You feel [pick("disoriented", "confused", "dizzy")].")) //BUBBER EDIT - added alert text for getting EMP'd.
|
|
owner.adjust_organ_loss(ORGAN_SLOT_BRAIN, (10*emp_dmg_mult), emp_dmg_max) //BUBBER EDIT - cap implemented
|
|
|