mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 11:43:31 +00:00
@@ -47,6 +47,7 @@
|
||||
// Damage above this value must be repaired with surgery.
|
||||
#define ROBOLIMB_REPAIR_CAP 30
|
||||
|
||||
#define ORGAN_FLESH 0 // Normal organic organs.
|
||||
#define ORGAN_ASSISTED 1 // Like pacemakers, not robotic
|
||||
#define ORGAN_ROBOT 2 // Fully robotic, no organic parts
|
||||
#define ORGAN_LIFELIKE 3 // Robotic, made to appear organic
|
||||
|
||||
@@ -196,6 +196,9 @@
|
||||
#define O_VOICE "voicebox"
|
||||
#define O_STANDARD list(O_EYES, O_HEART, O_LUNGS, O_BRAIN, O_LIVER, O_KIDNEYS, O_APPENDIX, O_VOICE)
|
||||
|
||||
// Augments
|
||||
#define O_AUG_TSHADE "integrated thermolensing implant"
|
||||
|
||||
// Non-Standard organs
|
||||
#define O_MOUTH "mouth"
|
||||
#define O_CELL "cell"
|
||||
|
||||
92
code/modules/organs/internal/bioaugment.dm
Normal file
92
code/modules/organs/internal/bioaugment.dm
Normal file
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* Augments. This file contains the base, and organic-targeting augments.
|
||||
*/
|
||||
|
||||
/obj/item/organ/internal/augment
|
||||
name = "augment"
|
||||
|
||||
icon_state = "cell_bay"
|
||||
|
||||
parent_organ = BP_TORSO
|
||||
|
||||
organ_verbs = list() // Verbs added by the organ when present in the body.
|
||||
target_parent_classes = list() // Is the parent supposed to be organic, robotic, assisted?
|
||||
forgiving_class = FALSE // Will the organ give its verbs when it isn't a perfect match? I.E., assisted in organic, synthetic in organic.
|
||||
|
||||
var/obj/item/integrated_object // Objects held by the organ, used for deployable things.
|
||||
var/integrated_object_type // Object type the organ will spawn.
|
||||
|
||||
/obj/item/organ/internal/augment/Initialize()
|
||||
..()
|
||||
if(integrated_object_type)
|
||||
integrated_object = new integrated_object_type(src)
|
||||
integrated_object.canremove = FALSE
|
||||
|
||||
/obj/item/organ/internal/augment/handle_organ_mod_special(var/removed = FALSE)
|
||||
if(removed && integrated_object && integrated_object.loc != src)
|
||||
if(isliving(integrated_object.loc))
|
||||
var/mob/living/L = integrated_object.loc
|
||||
L.drop_from_inventory(integrated_object)
|
||||
integrated_object.forceMove(src)
|
||||
..(removed)
|
||||
|
||||
// The base organic-targeting augment.
|
||||
|
||||
/obj/item/organ/internal/augment/bioaugment
|
||||
name = "bioaugmenting implant"
|
||||
|
||||
robotic = ORGAN_ROBOT
|
||||
target_parent_classes = list(ORGAN_FLESH)
|
||||
|
||||
// Jensen Shades. Your vision can be augmented.
|
||||
|
||||
/obj/item/organ/internal/augment/bioaugment/thermalshades
|
||||
name = "integrated thermolensing implant"
|
||||
desc = "A miniscule implant that houses a pair of thermolensed sunglasses. Don't ask how they deploy, you don't want to know."
|
||||
icon_state = "augment_shades"
|
||||
dead_icon = "augment_shades_dead"
|
||||
|
||||
w_class = ITEMSIZE_TINY
|
||||
|
||||
organ_tag = O_AUG_TSHADE
|
||||
|
||||
parent_organ = BP_HEAD
|
||||
|
||||
organ_verbs = list(/mob/living/carbon/human/proc/toggle_shades)
|
||||
|
||||
integrated_object_type = /obj/item/clothing/glasses/hud/security/jensenshades
|
||||
|
||||
/mob/living/carbon/human/proc/toggle_shades()
|
||||
set name = "Toggle Integrated Thermoshades"
|
||||
set desc = "Toggle your flash-proof, thermal-integrated sunglasses."
|
||||
set category = "Augments"
|
||||
|
||||
var/obj/item/organ/internal/augment/aug = internal_organs_by_name[O_AUG_TSHADE]
|
||||
|
||||
if(glasses)
|
||||
if(aug && aug.integrated_object == glasses)
|
||||
drop_from_inventory(glasses)
|
||||
aug.integrated_object.forceMove(aug)
|
||||
if(!glasses)
|
||||
to_chat(src, "<span class='alien'>Your [aug.integrated_object] retract into your skull.</span>")
|
||||
else if(!istype(glasses, /obj/item/clothing/glasses/hud/security/jensenshades))
|
||||
to_chat(src, "<span class='notice'>\The [glasses] block your shades from deploying.</span>")
|
||||
else if(istype(glasses, /obj/item/clothing/glasses/hud/security/jensenshades))
|
||||
var/obj/item/G = glasses
|
||||
if(G.canremove)
|
||||
to_chat(src, "<span class='notice'>\The [G] are not your integrated shades.</span>")
|
||||
else
|
||||
drop_from_inventory(G)
|
||||
to_chat(src, "<span class='notice'>\The [G] retract into your skull.</span>")
|
||||
qdel(G)
|
||||
|
||||
else
|
||||
if(aug && aug.integrated_object)
|
||||
to_chat(src, "<span class='alien'>Your [aug.integrated_object] deploy.</span>")
|
||||
equip_to_slot(aug.integrated_object, slot_glasses, 0, 1)
|
||||
if(!glasses || glasses != aug.integrated_object)
|
||||
aug.integrated_object.forceMove(aug)
|
||||
else
|
||||
var/obj/item/clothing/glasses/hud/security/jensenshades/J = new(get_turf(src))
|
||||
equip_to_slot(J, slot_glasses, 1, 1)
|
||||
to_chat(src, "<span class='notice'>Your [aug.integrated_object] deploy.</span>")
|
||||
@@ -36,7 +36,10 @@ var/list/organ_cache = list()
|
||||
var/list/will_assist_languages = list()
|
||||
var/list/datum/language/assists_languages = list()
|
||||
|
||||
// Organ verb vars.
|
||||
var/list/organ_verbs // Verbs added by the organ when present in the body.
|
||||
var/list/target_parent_classes = list() // Is the parent supposed to be organic, robotic, assisted?
|
||||
var/forgiving_class = TRUE // Will the organ give its verbs when it isn't a perfect match? I.E., assisted in organic, synthetic in organic.
|
||||
|
||||
/obj/item/organ/Destroy()
|
||||
|
||||
@@ -441,12 +444,12 @@ var/list/organ_cache = list()
|
||||
all_organs |= owner.internal_organs
|
||||
|
||||
for(var/obj/item/organ/O in all_organs)
|
||||
if(!(O.status & ORGAN_DEAD) && O.organ_verbs)
|
||||
if(!(O.status & ORGAN_DEAD) && O.organ_verbs && O.check_verb_compatability())
|
||||
for(var/verb_type in O.organ_verbs)
|
||||
if(verb_type in organ_verbs)
|
||||
save_verbs |= verb_type
|
||||
|
||||
if(!removed && organ_verbs)
|
||||
if(!removed && organ_verbs && check_verb_compatability())
|
||||
for(var/verb_path in organ_verbs)
|
||||
owner.verbs |= verb_path
|
||||
else if(organ_verbs)
|
||||
@@ -457,3 +460,32 @@ var/list/organ_cache = list()
|
||||
|
||||
/obj/item/organ/proc/handle_organ_proc_special() // Called when processed.
|
||||
return
|
||||
|
||||
/obj/item/organ/proc/check_verb_compatability() // Used for determining if an organ should give or remove its verbs. I.E., FBP part in a human, no verbs. If true, keep or add.
|
||||
if(owner)
|
||||
if(ishuman(owner))
|
||||
var/mob/living/carbon/human/H = owner
|
||||
var/obj/item/organ/O = H.get_organ(parent_organ)
|
||||
if(forgiving_class)
|
||||
if(O.robotic <= ORGAN_ASSISTED && robotic <= ORGAN_LIFELIKE) // Parent is organic or assisted, we are at most synthetic.
|
||||
return TRUE
|
||||
|
||||
if(O.robotic >= ORGAN_ROBOT && robotic >= ORGAN_ASSISTED) // Parent is synthetic, and we are biosynthetic at least.
|
||||
return TRUE
|
||||
|
||||
if(!target_parent_classes || !target_parent_classes.len) // Default checks, if we're not looking for a Specific type.
|
||||
|
||||
if(O.robotic == robotic) // Same thing, we're fine.
|
||||
return TRUE
|
||||
|
||||
if(O.robotic < ORGAN_ROBOT && robotic < ORGAN_ROBOT)
|
||||
return TRUE
|
||||
|
||||
if(O.robotic > ORGAN_ASSISTED && robotic > ORGAN_ASSISTED)
|
||||
return TRUE
|
||||
|
||||
else
|
||||
if(O.robotic in target_parent_classes)
|
||||
return TRUE
|
||||
|
||||
return FALSE
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 33 KiB |
@@ -2591,6 +2591,7 @@
|
||||
#include "code\modules\organs\robolimbs_vr.dm"
|
||||
#include "code\modules\organs\wound.dm"
|
||||
#include "code\modules\organs\internal\appendix.dm"
|
||||
#include "code\modules\organs\internal\bioaugment.dm"
|
||||
#include "code\modules\organs\internal\brain.dm"
|
||||
#include "code\modules\organs\internal\eyes.dm"
|
||||
#include "code\modules\organs\internal\heart.dm"
|
||||
|
||||
Reference in New Issue
Block a user