Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changes recovery node from giving heals to emiting phero #5518

Closed
wants to merge 4 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 16 additions & 19 deletions code/modules/cm_aliens/structures/special/recovery_node.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,26 @@
desc = "A warm, soothing light source that pulsates with a faint hum."
icon_state = "recovery"
health = 400
var/heal_amount = 10
var/heal_cooldown = 5 SECONDS
var/last_healed
var/recovery_pheromone_range = 2
var/warding_pheromone_range = 8
var/recovery_strenght = 2.5
var/warding_strenght = 1


/obj/effect/alien/resin/special/recovery/get_examine_text(mob/user)
. = ..()
if((isxeno(user) || isobserver(user)) && linked_hive)
. += "Recovers the health of adjacent Xenomorphs."
. += "Emits pheromons to nerby xenomorphs"
cuberound marked this conversation as resolved.
Show resolved Hide resolved

/obj/effect/alien/resin/special/recovery/process()
if(last_healed && world.time < last_healed + heal_cooldown)
return
var/list/heal_candidates = list()
for(var/mob/living/carbon/xenomorph/X in orange(src, 1))
if(X.health >= X.maxHealth || !X.resting || X.hivenumber != linked_hive.hivenumber)
for(var/mob/living/carbon/xenomorph/xenomorph in range(recovery_pheromone_range, loc))
if(xenomorph.ignores_pheromones)
continue
if(recovery_strenght > xenomorph.recovery_new && linked_hive == xenomorph.hivenumber)
xenomorph.recovery_new = recovery_strenght

for(var/mob/living/carbon/xenomorph/xenomorph in range(warding_pheromone_range, loc))
if(xenomorph.ignores_pheromones)
continue
heal_candidates += X
last_healed = world.time
if(!heal_candidates.len)
return
var/mob/living/carbon/xenomorph/picked_candidate = pick(heal_candidates)
picked_candidate.visible_message(SPAN_HELPFUL("\The [picked_candidate] glows as a warm aura envelops them."), \
SPAN_HELPFUL("You feel a warm aura envelop you."))
if(!do_after(picked_candidate, heal_cooldown, INTERRUPT_MOVED, BUSY_ICON_MEDICAL))
return
picked_candidate.gain_health(heal_amount)
if(warding_strenght > xenomorph.warding_new && linked_hive == xenomorph.hivenumber)
xenomorph.recovery_new = warding_strenght