mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-20 12:29:23 +01:00
Greimorian Egg Cluster Implantation Refactor (#21554)
Fixes https://github.com/Aurorastation/Aurora.3/issues/21509 **Summary:** Cleans up a lot of old Greimorian egg implantation code- rewrote the actual worker injection behavior to use the organ/internal/parasite code we have, instead of creating effects with their loc set to the organ itself. This largely means that not only is Greimorian implantation able to be treated pharmaceutically (as you'd expect, with them being parasitic and medicine including antiparasitics), but it also means that 'greimorian eggs' also get the same treatment as nerve flukes, etc. That is to say, antags can now purchase Greimorian Clade Kits from the uplink and inject people or monkeys with them to cause Unhappy Tidings. This code is also fairly easy to modify, if one wanted to create more implantable parasites that burst out of people, unrelated to Greimorians. **Changes:** - refactor: "Refactors the egg injection of Greimorian Workers to use parasite code; it can now be treated with anti-parasitic medicines in addition to amputation of the affected limb. Works on all playable species, and monkeys." - rscadd: "New reagent 'Greimorian Eggs' creates an egg cluster parasite in a random organ when metabolized in the bloodstream. It also has very mild soporific effects." - balance: "Greimorian Workers and playable Greimorian Servants/Queen now inject Greimorian Eggs instead of Soporific." - rscadd: "Greimorian Clade Kit now available in Uplink under Bioweapons section (Greimorians now able to be introduced to ship by egg cluster or injectable reagent)." - balance: "All parasite kit bioweapons have had their vial reagent count increased from 2 -> 5." - balance: "Helmizole no longer treats K'ois Mycosis, Black K'ois Mycosis, Zombification, or Tumors (Benign or Malignant)." - code_imp: "Updates a lot of code documentation to dmdocs."
This commit is contained in:
@@ -2,23 +2,29 @@
|
||||
INTERNAL ORGANS DEFINES
|
||||
****************************************************/
|
||||
/obj/item/organ/internal
|
||||
var/dead_icon // Icon to use when the organ has died.
|
||||
var/damage_reduction = 0.5 //modifier for internal organ injury
|
||||
var/unknown_pain_location = TRUE // if TRUE, pain messages will point to the parent organ, otherwise it will print the organ name
|
||||
/// Icon to use when the organ has died.
|
||||
var/dead_icon
|
||||
/// Modifier for internal organ injury.
|
||||
var/damage_reduction = 0.5
|
||||
/// If TRUE, pain messages will point to the parent organ, otherwise it will print the organ name.
|
||||
var/unknown_pain_location = TRUE
|
||||
var/toxin_type = "undefined"
|
||||
var/relative_size = 25 //Used for size calcs
|
||||
/// The icon state to overlay on the mob
|
||||
/// Used for size calcs.
|
||||
var/relative_size = 25
|
||||
/// The icon state to overlay on the mob.
|
||||
var/on_mob_icon
|
||||
/// If the icon state has an active overlay
|
||||
/// If the icon state has an active overlay.
|
||||
var/active_overlay = FALSE
|
||||
/// If the icon state has an active emissive overlay
|
||||
/// If the icon state has an active emissive overlay.
|
||||
var/active_emissive = FALSE
|
||||
var/list/possible_modifications = list("Normal","Assisted","Mechanical") //this is used in the character setup
|
||||
/// Used in character setup.
|
||||
var/list/possible_modifications = list("Normal","Assisted","Mechanical")
|
||||
|
||||
/// The amount all organs heal themselves by per second when not being affected by chems.
|
||||
var/organ_self_heal_per_second = 0.2
|
||||
|
||||
min_broken_damage = 10 //Internal organs are frail, man.
|
||||
/// Internal organs are frail, man.
|
||||
min_broken_damage = 10
|
||||
|
||||
/obj/item/organ/internal/Destroy()
|
||||
if(owner)
|
||||
@@ -31,6 +37,7 @@
|
||||
if(istype(E)) E.internal_organs -= src
|
||||
return ..()
|
||||
|
||||
/// Sets the internal organ as belonging to the targeted external organ, and matches the target's species/robotness. Also updates all organ lists belonging to the owner.
|
||||
/obj/item/organ/internal/replaced(var/mob/living/carbon/human/target, var/obj/item/organ/external/affected)
|
||||
if(!istype(target))
|
||||
return 0
|
||||
|
||||
@@ -459,6 +459,7 @@ INITIALIZE_IMMEDIATE(/obj/item/organ)
|
||||
owner.update_action_buttons()
|
||||
owner = null
|
||||
|
||||
/// Sets the organ's owner to the proc's target, and ensures its forceMoved into that target.
|
||||
/obj/item/organ/proc/replaced(var/mob/living/carbon/human/target, var/obj/item/organ/external/affected)
|
||||
owner = target
|
||||
action_button_name = initial(action_button_name)
|
||||
|
||||
@@ -1135,10 +1135,15 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
if(victim.get_blood_color())
|
||||
gore.basecolor = victim.get_blood_color()
|
||||
gore.update_icon()
|
||||
// Tiny amount of blood and not impacted by anything like coagulants, etc- we just want it for effect.
|
||||
victim.blood_squirt(2, loc, rand(2,5))
|
||||
add_blood(victim)
|
||||
|
||||
INVOKE_ASYNC(gore, TYPE_PROC_REF(/atom/movable, throw_at), get_edge_target_turf(src, pick(GLOB.alldirs)), rand(1,3), 4)
|
||||
|
||||
for(var/obj/item/organ/I in internal_organs)
|
||||
I.removed()
|
||||
victim.blood_squirt(2, loc, rand(2,5))
|
||||
if(istype(loc,/turf))
|
||||
INVOKE_ASYNC(I, TYPE_PROC_REF(/atom/movable, throw_at), get_edge_target_turf(src, pick(GLOB.alldirs)), rand(1,3), 4)
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
/obj/item/organ/internal/parasite/process()
|
||||
..()
|
||||
if(!owner)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
if(owner.chem_effects[CE_ANTIPARASITE] && !drug_resistance)
|
||||
@@ -74,6 +75,13 @@
|
||||
/obj/item/organ/internal/parasite/proc/stage_effect()
|
||||
return
|
||||
|
||||
/// Removes the parasite on next process().
|
||||
/obj/item/organ/internal/parasite/proc/remove_parasite()
|
||||
recession = 1000
|
||||
stage = 1
|
||||
stage_ticker = 0
|
||||
drug_resistance = FALSE
|
||||
|
||||
/mob/living/carbon/human/proc/infest_with_parasite(var/mob/living/carbon/victim, var/parasite_type, var/obj/item/organ/external/organ_to_infest, var/chance_to_infest = 100, var/parasite_limit = 3)
|
||||
if(ishuman(victim))
|
||||
var/mob/living/carbon/human/H = victim
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
/obj/item/organ/internal/parasite/greimorian_eggcluster
|
||||
name = "cluster of greimorian eggs"
|
||||
icon = 'icons/effects/effects.dmi'
|
||||
icon_state = "eggs"
|
||||
dead_icon = "eggs"
|
||||
|
||||
organ_tag = BP_GREIMORIAN_EGGCLUSTER
|
||||
parent_organ = BP_CHEST
|
||||
subtle = 1
|
||||
|
||||
/// ~2 minutes/stage (at two seconds/tick)
|
||||
stage_interval = 60
|
||||
|
||||
max_stage = 5
|
||||
|
||||
origin_tech = list(TECH_BIO = 4)
|
||||
|
||||
egg = /singleton/reagent/toxin/greimorian_eggs
|
||||
|
||||
/// Everyone's favorite-named variable
|
||||
var/gestating_spiderlings = 0
|
||||
|
||||
var/last_crawling_msg = 0
|
||||
|
||||
/// True when it has ruptured; end additional behavior.
|
||||
var/ruptured = FALSE
|
||||
|
||||
/obj/item/organ/internal/parasite/greimorian_eggcluster/process()
|
||||
..()
|
||||
|
||||
if(!owner && gestating_spiderlings)
|
||||
return
|
||||
|
||||
if(ruptured)
|
||||
return
|
||||
|
||||
var/obj/item/organ/external/affecting_organ = owner.organs_by_name[parent_organ]
|
||||
|
||||
if(prob(8))
|
||||
gestating_spiderlings += 1
|
||||
|
||||
if(prob(5))
|
||||
to_chat(affecting_organ.owner, SPAN_NOTICE("Your [affecting_organ.name] itches."))
|
||||
|
||||
if(prob(33))
|
||||
owner.adjustNutritionLoss(3)
|
||||
|
||||
if(stage >= 2) //after ~2.5 minutes
|
||||
if(prob(8))
|
||||
gestating_spiderlings += rand(1,2)
|
||||
|
||||
if(prob(33))
|
||||
owner.adjustNutritionLoss(4)
|
||||
if(prob(5))
|
||||
owner.emote("whimper")
|
||||
if(prob(3))
|
||||
to_chat(owner, SPAN_WARNING(pick("You feel nauseous and hungry at the same time.", "You feel a burning pain in your [parent_organ].", "Your sense of balance seems broken.")))
|
||||
|
||||
if(stage >= 3) //after ~5 minutes
|
||||
if(prob(8))
|
||||
gestating_spiderlings += rand(1,3)
|
||||
|
||||
if(prob(33))
|
||||
owner.adjustNutritionLoss(5)
|
||||
if(prob(10))
|
||||
affecting_organ.take_damage(rand(1,3))
|
||||
owner.adjustHalLoss(8)
|
||||
if(world.time > last_crawling_msg + 15 SECONDS)
|
||||
last_crawling_msg = world.time
|
||||
owner.visible_message(
|
||||
SPAN_WARNING("You think you see something moving around in \the [owner.name]'s [affecting_organ.name]."),
|
||||
SPAN_WARNING("You [prob(25) ? "see" : "feel"] something large move around in your [affecting_organ.name]!"))
|
||||
if(prob(1))
|
||||
owner.seizure(0.4)
|
||||
|
||||
if(stage >= 4) //after ~7.5 minutes
|
||||
if(prob(8))
|
||||
gestating_spiderlings += rand(1,4)
|
||||
|
||||
if(prob(5))
|
||||
owner.reagents.add_reagent(/singleton/reagent/toxin/greimorian_eggs, (gestating_spiderlings / 3))
|
||||
owner.adjustHalLoss(12)
|
||||
to_chat(owner, SPAN_WARNING(pick("A sharp, caustic pain boils out from your [affecting_organ.name]!", "You can feel the flesh of your [affecting_organ.name] beginning to bulge!", "It's going to burst! Your [affecting_organ.name] is going to burst!")))
|
||||
if(prob(5))
|
||||
owner.seizure(0.5)
|
||||
|
||||
if(stage >= 5) //after ~9 minutes
|
||||
if(prob(8))
|
||||
gestating_spiderlings += rand(1,5)
|
||||
|
||||
if(prob(10))
|
||||
owner.seizure(0.6)
|
||||
if(prob(5))
|
||||
ruptured = TRUE
|
||||
owner.adjustHalLoss(75)
|
||||
owner.seizure()
|
||||
src.owner.emote("scream")
|
||||
owner.visible_message(
|
||||
SPAN_DANGER("You can see the flesh of [owner.name]'s [affecting_organ.name] begin rippling violently!"),
|
||||
SPAN_DANGER("An <b>extreme</b>, nauseating pain erupts from your [affecting_organ.name]; you feel something burst inside it. The flesh begins to ripple violently!"))
|
||||
addtimer(CALLBACK(src, PROC_REF(rupture)), rand(30, 50))
|
||||
|
||||
/obj/item/organ/internal/parasite/greimorian_eggcluster/Destroy()
|
||||
var/obj/item/organ/external/affecting_organ = owner.organs_by_name[parent_organ]
|
||||
to_chat(src.owner, SPAN_WARNING("Mercifully, you feel something finally dissolve in your [affecting_organ.name]..."))
|
||||
..()
|
||||
|
||||
/**
|
||||
* Makes the victim spew out all of the spiderlings it has. It's triggered at the point
|
||||
* of the parasite hitting stage 5 of its growth.
|
||||
*
|
||||
* The proc also drops the limb if it's on a human, or gibs it if it's on the floor. For
|
||||
* maximum drama, of course!
|
||||
*/
|
||||
/obj/item/organ/internal/parasite/greimorian_eggcluster/proc/rupture()
|
||||
var/obj/item/organ/external/victim_external_organ = owner.organs_by_name[parent_organ]
|
||||
if(src.owner)
|
||||
src.owner.visible_message(
|
||||
SPAN_DANGER("A group of [src] burst out of [owner]'s [victim_external_organ.name]!"),
|
||||
SPAN_DANGER("A group of [src] burst out of your [victim_external_organ.name]!"))
|
||||
src.owner.emote("scream")
|
||||
|
||||
var/target_loc = src.owner ? src.owner.loc : src.loc
|
||||
for(var/i = 0 to gestating_spiderlings)
|
||||
// For details on the spiderlings, check out 'code\game\objects\effects\spiders.dm'
|
||||
new /obj/effect/spider/spiderling(target_loc, src, 3)
|
||||
|
||||
if(victim_external_organ.owner)
|
||||
victim_external_organ.droplimb(0, DROPLIMB_BLUNT)
|
||||
|
||||
remove_parasite()
|
||||
Reference in New Issue
Block a user