mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 15:08:02 +01:00
IT COMPILES
This commit is contained in:
@@ -32,6 +32,7 @@ var/list/organ_cache = list()
|
||||
/obj/item/organ/Destroy()
|
||||
if(!owner)
|
||||
return ..()
|
||||
/*
|
||||
|
||||
if(istype(owner, /mob/living/carbon))
|
||||
if((owner.internal_organs) && (src in owner.internal_organs))
|
||||
@@ -43,17 +44,13 @@ var/list/organ_cache = list()
|
||||
owner.organs -= src
|
||||
if((owner.organs_by_name) && (src in owner.organs_by_name))
|
||||
owner.organs_by_name -= src
|
||||
*/
|
||||
if(src in owner.contents)
|
||||
owner.contents -= src
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/item/organ/attack_self(mob/user as mob)
|
||||
|
||||
// Convert it to an edible form, yum yum.
|
||||
if(!robotic && user.a_intent == I_HARM)
|
||||
bitten(user)
|
||||
return
|
||||
|
||||
/obj/item/organ/proc/update_health()
|
||||
return
|
||||
@@ -331,34 +328,6 @@ var/list/organ_cache = list()
|
||||
if(robotic)
|
||||
status |= ORGAN_ROBOT
|
||||
|
||||
/obj/item/organ/eyes/replaced(var/mob/living/carbon/human/target)
|
||||
|
||||
// Apply our eye colour to the target.
|
||||
if(istype(target) && eye_colour)
|
||||
target.r_eyes = eye_colour[1]
|
||||
target.g_eyes = eye_colour[2]
|
||||
target.b_eyes = eye_colour[3]
|
||||
target.update_eyes()
|
||||
..()
|
||||
|
||||
/obj/item/organ/proc/bitten(mob/user)
|
||||
|
||||
if(robotic)
|
||||
return
|
||||
|
||||
user << "\blue You take a bite out of \the [src]."
|
||||
|
||||
user.unEquip(src)
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/organ/O = new(get_turf(src))
|
||||
O.name = name
|
||||
O.icon_state = dead_icon ? dead_icon : icon_state
|
||||
|
||||
if(fingerprints) O.fingerprints = fingerprints.Copy()
|
||||
if(fingerprintshidden) O.fingerprintshidden = fingerprintshidden.Copy()
|
||||
if(fingerprintslast) O.fingerprintslast = fingerprintslast
|
||||
|
||||
user.put_in_active_hand(O)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/organ/proc/surgeryize()
|
||||
return
|
||||
|
||||
@@ -1,27 +1,136 @@
|
||||
#define PROCESS_ACCURACY 10
|
||||
|
||||
/obj/item/organ/internal
|
||||
origin_tech = "biotech=2"
|
||||
force = 1
|
||||
w_class = 2
|
||||
throwforce = 0
|
||||
var/zone = "chest"
|
||||
var/slot
|
||||
vital = 0
|
||||
var/organ_action_name = null
|
||||
|
||||
/obj/item/organ/internal/proc/Insert(mob/living/carbon/M, special = 0)
|
||||
if(!iscarbon(M) || owner == M)
|
||||
return
|
||||
|
||||
var/obj/item/organ/internal/replaced = M.get_organ_slot(slot)
|
||||
if(replaced)
|
||||
replaced.Remove(M, special = 1)
|
||||
|
||||
owner = M
|
||||
M.internal_organs |= src
|
||||
loc = null
|
||||
if(organ_action_name)
|
||||
action_button_name = organ_action_name
|
||||
|
||||
|
||||
/obj/item/organ/internal/proc/Remove(mob/living/carbon/M, special = 0)
|
||||
owner = null
|
||||
if(M)
|
||||
M.internal_organs -= src
|
||||
if(vital && !special)
|
||||
M.death()
|
||||
|
||||
if(organ_action_name)
|
||||
action_button_name = null
|
||||
|
||||
/obj/item/organ/internal/proc/on_find(mob/living/finder)
|
||||
return
|
||||
|
||||
/obj/item/organ/internal/proc/on_life()
|
||||
return
|
||||
|
||||
/obj/item/organ/internal/proc/prepare_eat()
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/organ/S = new
|
||||
S.name = name
|
||||
S.desc = desc
|
||||
S.icon = icon
|
||||
S.icon_state = icon_state
|
||||
S.origin_tech = origin_tech
|
||||
S.w_class = w_class
|
||||
|
||||
return S
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/organ
|
||||
name = "appendix"
|
||||
icon_state = "appendix"
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
|
||||
/obj/item/weapon/reagent_containers/food/snacks/organ/New()
|
||||
..()
|
||||
|
||||
reagents.add_reagent("nutriment" = 5)
|
||||
|
||||
|
||||
/obj/item/organ/internal/Destroy()
|
||||
if(owner)
|
||||
Remove(owner, 1)
|
||||
return ..()
|
||||
|
||||
/obj/item/organ/internal/attack(mob/living/carbon/M, mob/user)
|
||||
if(M == user && ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/S = prepare_eat()
|
||||
if(S)
|
||||
H.drop_item()
|
||||
H.put_in_active_hand(S)
|
||||
S.attack(H, H)
|
||||
qdel(src)
|
||||
else
|
||||
..()
|
||||
|
||||
/****************************************************
|
||||
INTERNAL ORGANS DEFINES
|
||||
****************************************************/
|
||||
|
||||
|
||||
// Brain is defined in brain_item.dm.
|
||||
/obj/item/organ/heart
|
||||
/obj/item/organ/internal/heart
|
||||
name = "heart"
|
||||
icon_state = "heart-on"
|
||||
organ_tag = "heart"
|
||||
parent_organ = "chest"
|
||||
dead_icon = "heart-off"
|
||||
vital = 1
|
||||
var/beating = 0
|
||||
|
||||
/obj/item/organ/lungs
|
||||
/obj/item/organ/internal/heart/update_icon()
|
||||
if(beating)
|
||||
icon_state = "heart-on"
|
||||
else
|
||||
icon_state = "heart-off"
|
||||
|
||||
/obj/item/organ/internal/heart/Insert(mob/living/carbon/M, special = 0)
|
||||
..()
|
||||
beating = 1
|
||||
update_icon()
|
||||
|
||||
/obj/item/organ/internal/heart/Remove(mob/living/carbon/M, special = 0)
|
||||
..()
|
||||
spawn(120)
|
||||
beating = 0
|
||||
update_icon()
|
||||
|
||||
/obj/item/organ/internal/heart/prepare_eat()
|
||||
var/obj/S = ..()
|
||||
S.icon_state = "heart-off"
|
||||
return S
|
||||
|
||||
/obj/item/organ/internal/lungs
|
||||
name = "lungs"
|
||||
icon_state = "lungs"
|
||||
gender = PLURAL
|
||||
organ_tag = "lungs"
|
||||
parent_organ = "chest"
|
||||
slot = "lungs"
|
||||
|
||||
/obj/item/organ/lungs/process()
|
||||
//Insert something neat here.
|
||||
///obj/item/organ/internal/heart/Remove(mob/living/carbon/M, special = 0)
|
||||
// ..()
|
||||
|
||||
|
||||
/obj/item/organ/internal/lungs/process()
|
||||
..()
|
||||
|
||||
if(!owner)
|
||||
@@ -39,14 +148,15 @@
|
||||
spawn owner.custom_emote(1, "gasps for air!")
|
||||
owner.losebreath += 5
|
||||
|
||||
/obj/item/organ/kidneys
|
||||
/obj/item/organ/internal/kidneys
|
||||
name = "kidneys"
|
||||
icon_state = "kidneys"
|
||||
gender = PLURAL
|
||||
organ_tag = "kidneys"
|
||||
parent_organ = "groin"
|
||||
slot = "kidneys"
|
||||
|
||||
/obj/item/organ/kidneys/process()
|
||||
/obj/item/organ/internal/kidneys/process()
|
||||
|
||||
..()
|
||||
|
||||
@@ -64,15 +174,16 @@
|
||||
owner.adjustToxLoss(0.3 * PROCESS_ACCURACY)
|
||||
|
||||
|
||||
/obj/item/organ/eyes
|
||||
/obj/item/organ/internal/eyes
|
||||
name = "eyeballs"
|
||||
icon_state = "eyes"
|
||||
gender = PLURAL
|
||||
organ_tag = "eyes"
|
||||
parent_organ = "head"
|
||||
slot = "eyes"
|
||||
var/list/eye_colour = list(0,0,0)
|
||||
|
||||
/obj/item/organ/eyes/proc/update_colour()
|
||||
/obj/item/organ/internal/eyes/proc/update_colour()
|
||||
if(!owner)
|
||||
return
|
||||
eye_colour = list(
|
||||
@@ -81,7 +192,7 @@
|
||||
owner.b_eyes ? owner.b_eyes : 0
|
||||
)
|
||||
|
||||
/obj/item/organ/eyes/surgeryize()
|
||||
/obj/item/organ/internal/eyes/surgeryize()
|
||||
if(!owner)
|
||||
return
|
||||
owner.disabilities &= ~NEARSIGHTED
|
||||
@@ -89,13 +200,14 @@
|
||||
owner.eye_blurry = 0
|
||||
owner.eye_blind = 0
|
||||
|
||||
/obj/item/organ/liver
|
||||
/obj/item/organ/internal/liver
|
||||
name = "liver"
|
||||
icon_state = "liver"
|
||||
organ_tag = "liver"
|
||||
parent_organ = "groin"
|
||||
slot = "liver"
|
||||
|
||||
/obj/item/organ/liver/process()
|
||||
/obj/item/organ/internal/liver/process()
|
||||
|
||||
..()
|
||||
|
||||
@@ -118,7 +230,7 @@
|
||||
src.damage += 0.2 * PROCESS_ACCURACY
|
||||
//Damaged one shares the fun
|
||||
else
|
||||
var/obj/item/organ/O = pick(owner.internal_organs)
|
||||
var/obj/item/organ/internal/O = pick(owner.internal_organs)
|
||||
if(O)
|
||||
O.damage += 0.2 * PROCESS_ACCURACY
|
||||
|
||||
@@ -148,15 +260,16 @@
|
||||
if(owner.reagents.has_reagent(toxin))
|
||||
owner.adjustToxLoss(0.3 * PROCESS_ACCURACY)
|
||||
|
||||
/obj/item/organ/appendix
|
||||
/obj/item/organ/internal/appendix
|
||||
name = "appendix"
|
||||
icon_state = "appendix"
|
||||
organ_tag = "appendix"
|
||||
parent_organ = "groin"
|
||||
slot = "appendix"
|
||||
|
||||
|
||||
/*
|
||||
/obj/item/organ/appendix/removed()
|
||||
/obj/item/organ/internal/appendix/removed()
|
||||
|
||||
if(owner)
|
||||
var/inflamed = 0
|
||||
@@ -168,4 +281,34 @@
|
||||
icon_state = "appendixinflamed"
|
||||
name = "inflamed appendix"
|
||||
..()
|
||||
*/
|
||||
*/
|
||||
|
||||
/obj/item/organ/internal/shadowtumor
|
||||
name = "black tumor"
|
||||
desc = "A tiny black mass with red tendrils trailing from it. It seems to shrivel in the light."
|
||||
icon_state = "blacktumor"
|
||||
origin_tech = "biotech=4"
|
||||
w_class = 1
|
||||
parent_organ = "head"
|
||||
slot = "brain_tumor"
|
||||
health = 3
|
||||
|
||||
/obj/item/organ/internal/shadowtumor/New()
|
||||
..()
|
||||
processing_objects.Add(src)
|
||||
|
||||
/obj/item/organ/internal/shadowtumor/Destroy()
|
||||
processing_objects.Remove(src)
|
||||
..()
|
||||
|
||||
/obj/item/organ/internal/shadowtumor/process()
|
||||
if(isturf(loc))
|
||||
var/turf/T = loc
|
||||
var/light_count = T.get_lumcount()
|
||||
if(light_count > 4 && health > 0) //Die in the light
|
||||
health--
|
||||
else if(light_count < 2 && health < 3) //Heal in the dark
|
||||
health++
|
||||
if(health <= 0)
|
||||
visible_message("<span class='warning'>[src] collapses in on itself!</span>")
|
||||
qdel(src)
|
||||
Reference in New Issue
Block a user