-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIRROR] Cybernetic brains for androids [MDB IGNORE] (#660)
* Cybernetic brains for androids (#79421) --------- Co-authored-by: SkyratBot <[email protected]> Co-authored-by: GPeckman <[email protected]>
- Loading branch information
1 parent
c9a9a13
commit 8d28706
Showing
5 changed files
with
102 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/obj/item/organ/internal/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 | ||
failing_desc = "seems to be broken, and will not work without repairs." | ||
|
||
/obj/item/organ/internal/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.") | ||
|
||
/obj/item/organ/internal/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 | ||
|
||
/obj/item/organ/internal/brain/cybernetic/emp_act(severity) | ||
. = ..() | ||
if(. & EMP_PROTECT_SELF) | ||
return | ||
switch(severity) // Hard cap on brain damage from EMP | ||
if (EMP_HEAVY) | ||
apply_organ_damage(20, BRAIN_DAMAGE_SEVERE) | ||
if (EMP_LIGHT) | ||
apply_organ_damage(10, BRAIN_DAMAGE_MILD) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters