273 lines
7.6 KiB
Plaintext
273 lines
7.6 KiB
Plaintext
#define STUN_SET_AMOUNT 2
|
|
|
|
/obj/item/organ/internal/cyberimp
|
|
name = "cybernetic implant"
|
|
desc = "a state-of-the-art implant that improves a baseline's functionality"
|
|
status = ORGAN_ROBOTIC
|
|
var/implant_color = "#FFFFFF"
|
|
var/implant_overlay
|
|
|
|
/obj/item/organ/internal/cyberimp/New(var/mob/M = null)
|
|
if(iscarbon(M))
|
|
src.Insert(M)
|
|
if(implant_overlay)
|
|
var/image/overlay = new /image(icon, implant_overlay)
|
|
overlay.color = implant_color
|
|
overlays |= overlay
|
|
return ..()
|
|
|
|
|
|
|
|
//[[[[BRAIN]]]]
|
|
|
|
/obj/item/organ/internal/cyberimp/brain
|
|
name = "cybernetic brain implant"
|
|
desc = "injectors of extra sub-routines for the brain"
|
|
icon_state = "brain_implant"
|
|
implant_overlay = "brain_implant_overlay"
|
|
zone = "head"
|
|
|
|
/obj/item/organ/internal/cyberimp/brain/emp_act(severity)
|
|
if(!owner)
|
|
return
|
|
var/stun_amount = 5 + (severity-1 ? 0 : 5)
|
|
owner.Stun(stun_amount)
|
|
owner << "<span class='warning'>Your body seizes up!</span>"
|
|
return stun_amount
|
|
|
|
|
|
/obj/item/organ/internal/cyberimp/brain/anti_drop
|
|
name = "Anti-drop implant"
|
|
desc = "This cybernetic brain implant will allow you to force your hand muscles to contract, preventing item dropping. Twitch ear to toggle."
|
|
var/active = 0
|
|
var/l_hand_ignore = 0
|
|
var/r_hand_ignore = 0
|
|
var/obj/item/l_hand_obj = null
|
|
var/obj/item/r_hand_obj = null
|
|
implant_color = "#DE7E00"
|
|
slot = "brain_antidrop"
|
|
origin_tech = "materials=5;programming=4;biotech=4"
|
|
organ_action_name = "Toggle Anti-Drop"
|
|
|
|
/obj/item/organ/internal/cyberimp/brain/anti_drop/ui_action_click()
|
|
active = !active
|
|
if(active)
|
|
l_hand_obj = owner.l_hand
|
|
r_hand_obj = owner.r_hand
|
|
if(l_hand_obj)
|
|
if(owner.l_hand.flags & NODROP)
|
|
l_hand_ignore = 1
|
|
else
|
|
owner.l_hand.flags |= NODROP
|
|
l_hand_ignore = 0
|
|
|
|
if(r_hand_obj)
|
|
if(owner.r_hand.flags & NODROP)
|
|
r_hand_ignore = 1
|
|
else
|
|
owner.r_hand.flags |= NODROP
|
|
r_hand_ignore = 0
|
|
|
|
if(!l_hand_obj && !r_hand_obj)
|
|
owner << "<span class='notice'>You are not holding any items, your hands relax...</span>"
|
|
active = 0
|
|
else
|
|
var/msg = 0
|
|
msg += !l_hand_ignore && l_hand_obj ? 1 : 0
|
|
msg += !r_hand_ignore && r_hand_obj ? 2 : 0
|
|
switch(msg)
|
|
if(1)
|
|
owner << "<span class='notice'>Your left hand's grip tightens.</span>"
|
|
if(2)
|
|
owner << "<span class='notice'>Your right hand's grip tightens.</span>"
|
|
if(3)
|
|
owner << "<span class='notice'>Both of your hand's grips tighten.</span>"
|
|
else
|
|
release_items()
|
|
owner << "<span class='notice'>Your hands relax...</span>"
|
|
l_hand_obj = null
|
|
r_hand_obj = null
|
|
|
|
/obj/item/organ/internal/cyberimp/brain/anti_drop/emp_act(severity)
|
|
if(!owner)
|
|
return
|
|
var/range = severity ? 10 : 5
|
|
var/atom/A
|
|
var/obj/item/L_item = owner.l_hand
|
|
var/obj/item/R_item = owner.r_hand
|
|
|
|
release_items()
|
|
..()
|
|
if(L_item)
|
|
A = pick(oview(range))
|
|
L_item.throw_at(A, range, 2)
|
|
owner << "<span class='notice'>Your left arm spasms and throws the [L_item.name]!</span>"
|
|
if(R_item)
|
|
A = pick(oview(range))
|
|
R_item.throw_at(A, range, 2)
|
|
owner << "<span class='notice'>Your right arm spasms and throws the [R_item.name]!</span>"
|
|
|
|
/obj/item/organ/internal/cyberimp/brain/anti_drop/proc/release_items()
|
|
if(!l_hand_ignore && l_hand_obj in owner.contents)
|
|
l_hand_obj.flags ^= NODROP
|
|
if(!r_hand_ignore && r_hand_obj in owner.contents)
|
|
r_hand_obj.flags ^= NODROP
|
|
|
|
/obj/item/organ/internal/cyberimp/brain/anti_drop/Remove(var/mob/living/carbon/M, special = 0)
|
|
if(active)
|
|
ui_action_click()
|
|
..()
|
|
|
|
|
|
/obj/item/organ/internal/cyberimp/brain/anti_stun
|
|
name = "CNS Rebooter implant"
|
|
desc = "This implant will automatically give you back control over your central nervous system, reducing downtime when stunned."
|
|
implant_color = "#FFFF00"
|
|
slot = "brain_antistun"
|
|
origin_tech = "materials=6;programming=4;biotech=5"
|
|
|
|
/obj/item/organ/internal/cyberimp/brain/anti_stun/on_life()
|
|
..()
|
|
if(crit_fail)
|
|
return
|
|
|
|
if(owner.stunned > STUN_SET_AMOUNT)
|
|
owner.stunned = STUN_SET_AMOUNT
|
|
if(owner.weakened > STUN_SET_AMOUNT)
|
|
owner.weakened = STUN_SET_AMOUNT
|
|
|
|
/obj/item/organ/internal/cyberimp/brain/anti_stun/emp_act(severity)
|
|
if(crit_fail)
|
|
return
|
|
crit_fail = 1
|
|
spawn(90 / severity)
|
|
crit_fail = 0
|
|
|
|
|
|
//[[[[CHEST]]]]
|
|
|
|
/obj/item/organ/internal/cyberimp/chest
|
|
name = "cybernetic torso implant"
|
|
desc = "implants for the organs in your torso"
|
|
icon_state = "chest_implant"
|
|
implant_overlay = "chest_implant_overlay"
|
|
zone = "chest"
|
|
|
|
/obj/item/organ/internal/cyberimp/chest/nutriment
|
|
name = "Nutriment pump implant"
|
|
desc = "This implant with synthesize and pump into your bloodstream a small amount of nutriment when you are starving."
|
|
icon_state = "chest_implant"
|
|
implant_color = "#00AA00"
|
|
var/hunger_threshold = NUTRITION_LEVEL_STARVING
|
|
var/synthesizing = 0
|
|
var/poison_amount = 5
|
|
slot = "stomach"
|
|
origin_tech = "materials=5;programming=3;biotech=4"
|
|
|
|
/obj/item/organ/internal/cyberimp/chest/nutriment/on_life()
|
|
if(synthesizing)
|
|
return
|
|
|
|
if(owner.nutrition <= hunger_threshold)
|
|
synthesizing = 1
|
|
owner << "<span class='notice'>You feel less hungry...</span>"
|
|
owner.nutrition += 50
|
|
spawn(50)
|
|
synthesizing = 0
|
|
|
|
/obj/item/organ/internal/cyberimp/chest/nutriment/emp_act(severity)
|
|
if(!owner)
|
|
return
|
|
owner.reagents.add_reagent("????",poison_amount / severity) //food poisoning
|
|
owner << "<span class='warning'>You feel like your insides are burning.</span>"
|
|
|
|
|
|
/obj/item/organ/internal/cyberimp/chest/nutriment/plus
|
|
name = "Nutriment pump implant PLUS"
|
|
desc = "This implant will synthesize and pump into your bloodstream a small amount of nutriment when you are hungry."
|
|
icon_state = "chest_implant"
|
|
implant_color = "#006607"
|
|
hunger_threshold = NUTRITION_LEVEL_HUNGRY
|
|
poison_amount = 10
|
|
origin_tech = "materials=5;programming=3;biotech=5"
|
|
|
|
|
|
|
|
/obj/item/organ/internal/cyberimp/chest/reviver
|
|
name = "Reviver implant"
|
|
desc = "This implant will attempt to revive you if you lose consciousness. For the faint of heart!"
|
|
icon_state = "chest_implant"
|
|
implant_color = "#AD0000"
|
|
origin_tech = "materials=6;programming=3;biotech=6;syndicate=4"
|
|
slot = "heartdrive"
|
|
var/revive_cost = 0
|
|
var/reviving = 0
|
|
var/cooldown = 0
|
|
|
|
/obj/item/organ/internal/cyberimp/chest/reviver/on_life()
|
|
if(reviving)
|
|
if(owner.stat == UNCONSCIOUS)
|
|
spawn(30)
|
|
if(prob(90) && owner.getOxyLoss())
|
|
owner.adjustOxyLoss(-3)
|
|
revive_cost += 5
|
|
if(prob(75) && owner.getBruteLoss())
|
|
owner.adjustBruteLoss(-1)
|
|
revive_cost += 20
|
|
if(prob(75) && owner.getFireLoss())
|
|
owner.adjustFireLoss(-1)
|
|
revive_cost += 20
|
|
if(prob(40) && owner.getToxLoss())
|
|
owner.adjustToxLoss(-1)
|
|
revive_cost += 50
|
|
else
|
|
cooldown = revive_cost + world.time
|
|
reviving = 0
|
|
return
|
|
|
|
if(cooldown > world.time)
|
|
return
|
|
if(owner.stat != UNCONSCIOUS)
|
|
return
|
|
if(owner.suiciding)
|
|
return
|
|
|
|
revive_cost = 0
|
|
reviving = 1
|
|
|
|
/obj/item/organ/internal/cyberimp/chest/reviver/emp_act(severity)
|
|
if(!owner)
|
|
return
|
|
|
|
if(reviving)
|
|
revive_cost += 200
|
|
else
|
|
cooldown += 200
|
|
|
|
if(istype(owner, /mob/living/carbon/human))
|
|
var/mob/living/carbon/human/H = owner
|
|
if(H.stat != DEAD && prob(50 / severity))
|
|
H.heart_attack = 1
|
|
spawn(600 / severity)
|
|
H.heart_attack = 0
|
|
if(H.stat == CONSCIOUS)
|
|
H << "<span class='notice'>You feel your heart beating again!</span>"
|
|
|
|
|
|
//BOX O' IMPLANTS
|
|
|
|
/obj/item/weapon/storage/box/cyber_implants
|
|
name = "boxed cybernetic implants"
|
|
desc = "A sleek, sturdy box."
|
|
icon_state = "cyber_implants"
|
|
var/list/boxed = list(/obj/item/organ/internal/cyberimp/eyes/xray,/obj/item/organ/internal/cyberimp/eyes/thermals,
|
|
/obj/item/organ/internal/cyberimp/brain/anti_stun, /obj/item/organ/internal/cyberimp/chest/reviver)
|
|
var/amount = 5
|
|
|
|
/obj/item/weapon/storage/box/cyber_implants/New()
|
|
..()
|
|
var/i
|
|
var/implant
|
|
for(i = 0, i < amount, i++)
|
|
implant = pick(boxed)
|
|
new implant(src) |