Files
Paradise/code/modules/surgery/organs/parasites.dm
T
kyunkyunkyunandGitHub b0463d3c83 Convert most spans to defines (#31080)
* spanish?

* aaaagain

* keep maptext

* Update robot_items.dm

* Update span_defines.dm

* compiles

* Update silicon_mob.dm

* compile
2025-12-13 23:55:48 +00:00

106 lines
3.3 KiB
Plaintext

// Traitor-only space spider eggs
/obj/item/organ/internal/body_egg/spider_eggs
name = "spider eggs"
icon = 'icons/effects/effects.dmi'
icon_state = "eggs"
destroy_on_removal = TRUE
var/stage = 1
/obj/item/organ/internal/body_egg/spider_eggs/on_life()
..()
if(stage < 5 && prob(3))
stage++
switch(stage)
if(2)
if(prob(3))
owner.reagents.add_reagent("histamine", 2)
if(3)
if(prob(5))
owner.reagents.add_reagent("histamine", 3)
if(4)
if(prob(12))
owner.reagents.add_reagent("histamine", 5)
if(5)
to_chat(owner, SPAN_DANGER("You feel like something is tearing its way out of your skin..."))
owner.reagents.add_reagent("histamine", 10)
if(prob(30))
owner.emote("scream")
var/spiders = rand(3,5)
for(var/i in 1 to spiders)
new/mob/living/basic/spiderling(get_turf(owner))
owner.visible_message(SPAN_DANGER("[owner] bursts open! Holy fuck!"))
owner.gib()
/obj/item/organ/internal/body_egg/spider_eggs/remove(mob/living/carbon/M, special = 0)
M.reagents.del_reagent("spidereggs") //purge all remaining spider eggs reagent if caught, in time.
return ..()
// Terror Spiders - white spider infection
/obj/item/organ/internal/body_egg/terror_eggs
name = "terror eggs"
icon = 'icons/effects/effects.dmi'
icon_state = "eggs"
destroy_on_removal = TRUE
var/cycle_num = 0 // # of on_life() cycles completed, never reset
var/egg_progress = 0 // # of on_life() cycles completed, unlike cycle_num this is reset on each hatch event
var/egg_progress_per_hatch = 90 // if egg_progress > this, chance to hatch and reset egg_progress
var/eggs_hatched = 0 // num of hatch events completed
/obj/item/organ/internal/body_egg/terror_eggs/on_life()
// Safety first.
if(!owner)
return
..()
// Parasite growth
cycle_num += 1
egg_progress += pick(0, 1, 2)
egg_progress += calc_variable_progress()
// Once at least one egg has hatched from you, you'll need help to reach medbay.
if(eggs_hatched >= 1)
owner.SetConfused(45)
if(egg_progress > egg_progress_per_hatch)
egg_progress -= egg_progress_per_hatch
hatch_egg()
/obj/item/organ/internal/body_egg/terror_eggs/proc/calc_variable_progress()
var/extra_progress = 0
if(owner.nutrition > NUTRITION_LEVEL_FULL)
extra_progress += 1
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
if(antibiotics > 50)
extra_progress -= 0.5
var/boosters = owner.reagents.get_reagent_amount("salglu_solution")
if(boosters > 1)
extra_progress += 1
return extra_progress
/obj/item/organ/internal/body_egg/terror_eggs/proc/hatch_egg()
var/infection_completed = FALSE
var/mob/living/basic/spiderling/terror_spiderling/S = new(get_turf(owner))
switch(eggs_hatched)
if(0) // 1st spiderling
S.grow_as = /mob/living/simple_animal/hostile/poison/terror_spider/gray
if(1) // 2nd
S.grow_as = /mob/living/simple_animal/hostile/poison/terror_spider/red
if(2) // 3rd
S.grow_as = /mob/living/simple_animal/hostile/poison/terror_spider/brown
if(3) // 4th
S.grow_as = /mob/living/simple_animal/hostile/poison/terror_spider/green
if(4) // 5th
S.grow_as = /mob/living/simple_animal/hostile/poison/terror_spider/green
infection_completed = TRUE
eggs_hatched++
to_chat(owner, SPAN_WARNING("A strange prickling sensation moves across your skin... then suddenly the whole world seems to spin around you!"))
owner.Paralyse(20 SECONDS)
if(infection_completed)
remove(owner)