mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 18:44:48 +01:00
Adds 3 ipc only implants. (#22798)
* FUCK fix drugs first * done just wait for prs to be merged (sorry s34n) * removes uneeded chest implant redifine, repair implant * Apply suggestions from code review Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> * !human, fluid * guard variable lisst * oops * Apply suggestions from code review Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> * Update code/modules/surgery/organs/organ_external.dm Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> * Update code/game/objects/items/stacks/nanopaste.dm Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> * lewcs good to them? * Apply suggestions from code review Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> * not needed --------- Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
This commit is contained in:
@@ -317,7 +317,6 @@
|
||||
/obj/item/organ/internal/cyberimp/chest/nutriment
|
||||
name = "Nutriment pump implant"
|
||||
desc = "This implant will synthesize a small amount of nutriment and pumps it directly into your bloodstream when you are starving."
|
||||
icon_state = "chest_implant"
|
||||
implant_color = "#00AA00"
|
||||
var/hunger_threshold = NUTRITION_LEVEL_STARVING
|
||||
var/synthesizing = 0
|
||||
@@ -367,7 +366,6 @@
|
||||
/obj/item/organ/internal/cyberimp/chest/nutriment/plus
|
||||
name = "Nutriment pump implant PLUS"
|
||||
desc = "This implant will synthesize a small amount of nutriment and pumps it directly into your bloodstream when you are hungry."
|
||||
icon_state = "chest_implant"
|
||||
implant_color = "#006607"
|
||||
hunger_threshold = NUTRITION_LEVEL_HUNGRY
|
||||
poison_amount = 10
|
||||
@@ -384,7 +382,6 @@
|
||||
/obj/item/organ/internal/cyberimp/chest/reviver
|
||||
name = "Reviver implant"
|
||||
desc = "This implant will attempt to heal you out of critical condition. For the faint of heart!"
|
||||
icon_state = "chest_implant"
|
||||
implant_color = "#AD0000"
|
||||
origin_tech = "materials=5;programming=4;biotech=4"
|
||||
slot = "heartdrive"
|
||||
@@ -457,6 +454,87 @@
|
||||
if(H.stat == CONSCIOUS)
|
||||
to_chat(H, "<span class='notice'>You feel your heart beating again!</span>")
|
||||
|
||||
/obj/item/organ/internal/cyberimp/chest/ipc_repair
|
||||
name = "Reactive Repair Implant"
|
||||
desc = "This implant reworks the IPC frame, in order to incorporate materials that return to their original shape after being damaged. Requires power to function."
|
||||
implant_color = "#0ac0d8"
|
||||
origin_tech = "materials=4;programming=4;biotech=4;magnets=4;engineering=4"
|
||||
slot = "stomach" //Can't have a nutriment pump with it.
|
||||
requires_machine_person = TRUE
|
||||
|
||||
/obj/item/organ/internal/cyberimp/chest/ipc_repair/on_life()
|
||||
if(crit_fail)
|
||||
return
|
||||
if(owner.maxHealth == owner.health)
|
||||
owner.adjust_nutrition(-0.5)
|
||||
return //Passive damage scanning
|
||||
|
||||
owner.adjustBruteLoss(-0.5, robotic = TRUE)
|
||||
owner.adjustFireLoss(-0.5, robotic = TRUE)
|
||||
owner.adjust_nutrition(-4) //Very power inefficent. Hope you got an APC nearby.
|
||||
|
||||
/obj/item/organ/internal/cyberimp/chest/ipc_repair/emp_act(severity)
|
||||
if(!owner || emp_proof || crit_fail)
|
||||
return
|
||||
crit_fail = TRUE
|
||||
addtimer(VARSET_CALLBACK(src, crit_fail, FALSE), 30 SECONDS / severity)
|
||||
|
||||
/obj/item/organ/internal/cyberimp/chest/ipc_joints
|
||||
name = "IPC ER-OR Joint Implant"
|
||||
desc = "This is a basetype. Notify a coder!"
|
||||
implant_color = "#eeff00"
|
||||
origin_tech = "materials=5;programming=4;biotech=4"
|
||||
slot = "joints"
|
||||
requires_machine_person = TRUE
|
||||
|
||||
/obj/item/organ/internal/cyberimp/chest/ipc_joints/magnetic_joints
|
||||
name = "Magnetic Joints Implant"
|
||||
desc = "This implant modifies IPC joints to use magnets, allowing easy re-attachment and fluid movement."
|
||||
implant_color = "#670db1"
|
||||
origin_tech = "materials=4;programming=4;biotech=4;magnets=4;engineering=4"
|
||||
|
||||
/obj/item/organ/internal/cyberimp/chest/ipc_joints/magnetic_joints/emp_act(severity)
|
||||
if(!owner || emp_proof)
|
||||
return
|
||||
if(ishuman(owner))
|
||||
var/mob/living/carbon/human/H = owner
|
||||
to_chat(H, "<span class='userdanger'>Your magnetic joints lose power!</span>")
|
||||
for(var/obj/item/organ/external/E in H.bodyparts)
|
||||
if(E.body_part != UPPER_TORSO && E.body_part != LOWER_TORSO)
|
||||
E.droplimb(TRUE) //lego disasemble sound
|
||||
|
||||
/obj/item/organ/internal/cyberimp/chest/ipc_joints/magnetic_joints/insert(mob/living/carbon/M, special = FALSE)
|
||||
ADD_TRAIT(M, TRAIT_IPC_JOINTS_MAG, "ipc_joint[UID()]")
|
||||
return ..()
|
||||
|
||||
/obj/item/organ/internal/cyberimp/chest/ipc_joints/magnetic_joints/remove(mob/living/carbon/M, special = FALSE)
|
||||
REMOVE_TRAIT(M, TRAIT_IPC_JOINTS_MAG, "ipc_joint[UID()]")
|
||||
return ..()
|
||||
|
||||
/obj/item/organ/internal/cyberimp/chest/ipc_joints/sealed
|
||||
name = "Sealed Joints Implant"
|
||||
desc = "This implant seals and reinforces IPC joints, securing the limbs better for industrial work, though prone to locking up."
|
||||
implant_color = "#b10d0d"
|
||||
origin_tech = "materials=4;programming=4;biotech=4;engineering=4;combat=4;"
|
||||
|
||||
/obj/item/organ/internal/cyberimp/chest/ipc_joints/sealed/emp_act(severity)
|
||||
if(!owner || emp_proof)
|
||||
return
|
||||
var/weaken_time = (10 + (severity - 1 ? 0 : 10)) SECONDS
|
||||
owner.Weaken(weaken_time) //Pop it and lock it
|
||||
to_chat(owner, "<span class='warning'>Your body seizes up!</span>")
|
||||
return weaken_time
|
||||
|
||||
/obj/item/organ/internal/cyberimp/chest/ipc_joints/sealed/insert(mob/living/carbon/M, special = FALSE)
|
||||
ADD_TRAIT(M, TRAIT_IPC_JOINTS_SEALED, "ipc_joint[UID()]")
|
||||
owner.physiology.stamina_mod *= 1.15 //15% more stamina damage, representing extra friction in limbs. I guess.
|
||||
return ..()
|
||||
|
||||
/obj/item/organ/internal/cyberimp/chest/ipc_joints/sealed/remove(mob/living/carbon/M, special = FALSE)
|
||||
REMOVE_TRAIT(M, TRAIT_IPC_JOINTS_SEALED, "ipc_joint[UID()]")
|
||||
owner.physiology.stamina_mod /= 1.15
|
||||
return ..()
|
||||
|
||||
//BOX O' IMPLANTS
|
||||
|
||||
/obj/item/storage/box/cyber_implants
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
var/emp_proof = FALSE //is the organ immune to EMPs?
|
||||
var/hidden_pain = FALSE //will it skip pain messages?
|
||||
var/requires_robotic_bodypart = FALSE
|
||||
/// When this variable is true, it can only be installed on the machine person species.
|
||||
var/requires_machine_person = FALSE
|
||||
|
||||
///Should this organ be destroyed on removal?
|
||||
var/destroy_on_removal = FALSE
|
||||
|
||||
@@ -164,6 +164,27 @@
|
||||
if(!HAS_TRAIT(owner, TRAIT_IB_IMMUNE))
|
||||
limb_flags &= ~CANNOT_INT_BLEED
|
||||
|
||||
/obj/item/organ/external/attack(mob/M, mob/living/user)
|
||||
if(!ishuman(M))
|
||||
return ..()
|
||||
var/mob/living/carbon/human/C = M
|
||||
if(is_robotic() && HAS_TRAIT(C, TRAIT_IPC_JOINTS_MAG) && isnull(C.bodyparts_by_name[limb_name]))
|
||||
user.unEquip(src)
|
||||
replaced(C)
|
||||
C.update_body()
|
||||
C.updatehealth()
|
||||
C.UpdateDamageIcon()
|
||||
if(limb_name == BODY_ZONE_HEAD)
|
||||
var/obj/item/organ/external/head/H = C.get_organ(BODY_ZONE_HEAD)
|
||||
var/datum/robolimb/robohead = GLOB.all_robolimbs[H.model]
|
||||
if(robohead.is_monitor) //Ensures that if an IPC gets a head that's got a human hair wig attached to their body, the hair won't wipe.
|
||||
H.h_style = "Bald"
|
||||
H.f_style = "Shaved"
|
||||
C.m_styles["head"] = "None"
|
||||
user.visible_message(
|
||||
"<span class='notice'>[user] has attached [C]'s [src] to the [amputation_point].</span>",
|
||||
"<span class='notice'>You have attached [C]'s [src] to the [amputation_point].</span>")
|
||||
return TRUE
|
||||
/obj/item/organ/external/replaced(mob/living/carbon/human/target)
|
||||
owner = target
|
||||
loc = null
|
||||
@@ -198,6 +219,7 @@
|
||||
****************************************************/
|
||||
|
||||
/obj/item/organ/external/receive_damage(brute, burn, sharp, used_weapon = null, list/forbidden_limbs = list(), ignore_resists = FALSE, updating_health = TRUE)
|
||||
var/max_limb_damage = max_damage - (HAS_TRAIT(owner, TRAIT_IPC_JOINTS_MAG) ? max_damage * 0.25 : 0)
|
||||
if(tough && !ignore_resists)
|
||||
brute = max(0, brute - 5)
|
||||
burn = max(0, burn - 4)
|
||||
@@ -226,7 +248,7 @@
|
||||
// Probability of taking internal damage from sufficient force, while otherwise healthy
|
||||
#define LIMB_DMG_PROB 5
|
||||
// High brute damage or sharp objects may damage internal organs
|
||||
if(internal_organs && (brute_dam >= max_damage || (((sharp && brute >= LIMB_SHARP_THRESH_INT_DMG) || brute >= LIMB_THRESH_INT_DMG) && prob(LIMB_DMG_PROB))))
|
||||
if(internal_organs && (brute_dam >= max_limb_damage || (((sharp && brute >= LIMB_SHARP_THRESH_INT_DMG) || brute >= LIMB_THRESH_INT_DMG) && prob(LIMB_DMG_PROB))))
|
||||
// Damage an internal organ
|
||||
if(internal_organs && internal_organs.len)
|
||||
var/obj/item/organ/internal/I = pick(internal_organs)
|
||||
@@ -244,14 +266,14 @@
|
||||
add_autopsy_data(null, brute + burn)
|
||||
|
||||
// Make sure we don't exceed the maximum damage a limb can take before dismembering
|
||||
if((brute_dam + burn_dam + brute + burn) < max_damage)
|
||||
if((brute_dam + burn_dam + brute + burn) < max_limb_damage)
|
||||
brute_dam += brute
|
||||
burn_dam += burn
|
||||
check_for_internal_bleeding(brute)
|
||||
else
|
||||
//If we can't inflict the full amount of damage, spread the damage in other ways
|
||||
//How much damage can we actually cause?
|
||||
var/can_inflict = max_damage - (brute_dam + burn_dam)
|
||||
var/can_inflict = max_limb_damage - (brute_dam + burn_dam)
|
||||
if(can_inflict)
|
||||
if(brute > 0)
|
||||
//Inflict all burte damage we can
|
||||
@@ -285,7 +307,7 @@
|
||||
var/obj/item/organ/external/target = pick(possible_points)
|
||||
target.receive_damage(brute, burn, sharp, used_weapon, forbidden_limbs + src, ignore_resists = TRUE) //If the damage was reduced before, don't reduce it again
|
||||
|
||||
if(dismember_at_max_damage && body_part != UPPER_TORSO && body_part != LOWER_TORSO) // We've ensured all damage to the mob is retained, now let's drop it, if necessary.
|
||||
if(dismember_at_max_damage && body_part != UPPER_TORSO && body_part != LOWER_TORSO && !HAS_TRAIT(owner, TRAIT_IPC_JOINTS_SEALED)) // We've ensured all damage to the mob is retained, now let's drop it, if necessary.
|
||||
droplimb(1) //Clean loss, just drop the limb and be done
|
||||
|
||||
var/mob/living/carbon/owner_old = owner //Need to update health, but need a reference in case the below check cuts off a limb.
|
||||
|
||||
@@ -396,6 +396,10 @@
|
||||
to_chat(user, "<span class='warning'>[I] is an organ that requires a robotic interface! [target]'s [parse_zone(target_zone)] does not have one.</span>")
|
||||
return SURGERY_BEGINSTEP_SKIP
|
||||
|
||||
if(I.requires_machine_person && !ismachineperson(target))
|
||||
to_chat(user, "<span class='warning'>[I] is an organ that requires an IPC interface! [target]'s [parse_zone(target_zone)] does not have one.</span>")
|
||||
return SURGERY_BEGINSTEP_SKIP
|
||||
|
||||
if(target_zone != I.parent_organ || target.get_organ_slot(I.slot))
|
||||
to_chat(user, "<span class='notice'>There is no room for [I] in [target]'s [parse_zone(target_zone)]!</span>")
|
||||
return SURGERY_BEGINSTEP_SKIP
|
||||
@@ -427,7 +431,10 @@
|
||||
if(!istype(tool))
|
||||
return SURGERY_STEP_INCOMPLETE
|
||||
if(I.requires_robotic_bodypart)
|
||||
to_chat(user, "<span class='warning'>[I] is an organ that requires a robotic interface[target].</span>")
|
||||
to_chat(user, "<span class='warning'>[I] requires a robotic interface.</span>")
|
||||
return SURGERY_STEP_INCOMPLETE
|
||||
if(I.requires_machine_person && !ismachineperson(target))
|
||||
to_chat(user, "<span class='warning'>[I] requires an IPC interface!</span>")
|
||||
return SURGERY_STEP_INCOMPLETE
|
||||
if(!user.drop_item())
|
||||
to_chat(user, "<span class='warning'>[I] is stuck to your hand, you can't put it in [target]!</span>")
|
||||
|
||||
Reference in New Issue
Block a user