diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm b/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm index c1b1ee5f8902..8ed6b27aa2f8 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/general_abilities.dm @@ -423,7 +423,7 @@ action_type = XENO_ACTION_CLICK ability_primacy = XENO_PRIMARY_ACTION_5 -/datum/action/xeno_action/activable/place_construction/queen_macro //so it doesn't screw other macros up +/datum/action/xeno_action/activable/place_construction/not_primary //so it doesn't screw other macros up ability_primacy = XENO_NOT_PRIMARY_ACTION /datum/action/xeno_action/activable/xeno_spit diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm index 53e30d374b2c..8dd23513ac61 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm @@ -288,7 +288,7 @@ /datum/action/xeno_action/onclick/regurgitate, /datum/action/xeno_action/watch_xeno, /datum/action/xeno_action/activable/tail_stab, - /datum/action/xeno_action/activable/place_construction/queen_macro, //normally fifth macro but not as important for queen + /datum/action/xeno_action/activable/place_construction/not_primary, //normally fifth macro but not as important for queen /datum/action/xeno_action/activable/corrosive_acid, /datum/action/xeno_action/onclick/emit_pheromones, /datum/action/xeno_action/onclick/queen_word, @@ -321,7 +321,7 @@ /datum/action/xeno_action/onclick/regurgitate, /datum/action/xeno_action/watch_xeno, /datum/action/xeno_action/activable/tail_stab, - /datum/action/xeno_action/activable/place_construction/queen_macro, //normally fifth macro but not as important for queen + /datum/action/xeno_action/activable/place_construction/not_primary, //normally fifth macro but not as important for queen /datum/action/xeno_action/activable/corrosive_acid, /datum/action/xeno_action/onclick/emit_pheromones, /datum/action/xeno_action/onclick/queen_word, @@ -797,7 +797,7 @@ // These already have their placement locked in: /datum/action/xeno_action/onclick/regurgitate, /datum/action/xeno_action/watch_xeno, - /datum/action/xeno_action/activable/place_construction/queen_macro, + /datum/action/xeno_action/activable/place_construction/not_primary, /datum/action/xeno_action/onclick/emit_pheromones, /datum/action/xeno_action/onclick/queen_word, /datum/action/xeno_action/onclick/psychic_whisper, diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/healer.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/healer.dm index 5caab38529e6..fe08e1e0801e 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/healer.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/drone/healer.dm @@ -9,11 +9,16 @@ /datum/action/xeno_action/activable/secrete_resin, /datum/action/xeno_action/onclick/choose_resin, /datum/action/xeno_action/activable/transfer_plasma, + /datum/action/xeno_action/activable/place_construction, // so it doesn't use fifth macro + /datum/action/xeno_action/onclick/plant_weeds, // so it doesn't break order ) mutator_actions_to_add = list( + /datum/action/xeno_action/activable/place_construction/not_primary, // so it doesn't use fifth macro + /datum/action/xeno_action/onclick/plant_weeds, // so it doesn't break order /datum/action/xeno_action/onclick/plant_resin_fruit, // Second macro. Resin fruits belong to Gardener, but Healer has a minor variant. /datum/action/xeno_action/activable/apply_salve, //Third macro, heal over time ability. /datum/action/xeno_action/activable/transfer_plasma/healer, //Fourth macro, an improved plasma transfer. + /datum/action/xeno_action/activable/healer_sacrifice, //Fifth macro, the ultimate ability to sacrifice yourself ) keystone = TRUE behavior_delegate_type = /datum/behavior_delegate/drone_healer @@ -137,8 +142,10 @@ to_chat(target_xeno, SPAN_XENOWARNING("[src] covers your wounds with a regenerative resin salve. You feel reinvigorated!")) to_chat(src, SPAN_XENOWARNING("You regurgitate your vital fluids and some plasma to create a regenerative resin salve and apply it to [target_xeno]'s wounds. You feel weakened...")) playsound(src, "alien_drool", 25) - var/datum/behavior_delegate/drone_healer/healer_delegate = src.behavior_delegate + var/datum/behavior_delegate/drone_healer/healer_delegate = behavior_delegate healer_delegate.salve_applied_recently = TRUE + if(target_xeno.mutation_type != DRONE_HEALER && !isfacehugger(target_xeno)) // no cheap grinding + healer_delegate.modify_transferred(amount * damage_taken_mod) update_icons() addtimer(CALLBACK(healer_delegate, /datum/behavior_delegate/drone_healer/proc/un_salve), 10 SECONDS, TIMER_OVERRIDE|TIMER_UNIQUE) @@ -148,6 +155,9 @@ var/salve_applied_recently = FALSE var/mutable_appearance/salve_applied_icon + var/transferred_amount = 0 + var/required_transferred_amount = 10000 + /datum/behavior_delegate/drone_healer/on_update_icons() if(!salve_applied_icon) salve_applied_icon = mutable_appearance('icons/mob/xenos/drone_strain_overlays.dmi',"Healer Drone Walking") @@ -173,3 +183,125 @@ /datum/behavior_delegate/drone_healer/proc/un_salve() salve_applied_recently = FALSE bound_xeno.update_icons() + +/* + SACRIFICE +*/ + +/datum/behavior_delegate/drone_healer/proc/modify_transferred(amount) + transferred_amount += amount + +/datum/behavior_delegate/drone_healer/append_to_stat() + . = list() + . += "Transferred health amount: [transferred_amount]" + if(transferred_amount >= required_transferred_amount) + . += "Sacrifice will grant you new life." + +/datum/behavior_delegate/drone_healer/on_life() + if(!bound_xeno) + return + if(bound_xeno.stat == DEAD) + return + var/image/holder = bound_xeno.hud_list[PLASMA_HUD] + holder.overlays.Cut() + var/percentage_transferred = min(round((transferred_amount / required_transferred_amount) * 100, 10), 100) + if(percentage_transferred) + holder.overlays += image('icons/mob/hud/hud.dmi', "xenoenergy[percentage_transferred]") + +/datum/behavior_delegate/drone_healer/handle_death(mob/M) + var/image/holder = bound_xeno.hud_list[PLASMA_HUD] + holder.overlays.Cut() + +/datum/action/xeno_action/activable/healer_sacrifice + name = "Sacrifice" + action_icon_state = "screech" + ability_name = "sacrifice" + var/max_range = 1 + var/transfer_mod = 0.75 // only transfers 75% of current healer's health + macro_path = /datum/action/xeno_action/verb/verb_healer_sacrifice + action_type = XENO_ACTION_CLICK + ability_primacy = XENO_PRIMARY_ACTION_5 + +/datum/action/xeno_action/verb/verb_healer_sacrifice() + set category = "Alien" + set name = "Sacrifice" + set hidden = TRUE + var/action_name = "Sacrifice" + handle_xeno_macro(src, action_name) + +/datum/action/xeno_action/activable/healer_sacrifice/use_ability(atom/atom) + var/mob/living/carbon/xenomorph/xeno = owner + var/mob/living/carbon/xenomorph/target = atom + + if(!istype(target)) + return + + if(target == xeno) + to_chat(xeno, "You can't heal yourself!") + return + + if(isfacehugger(target) || islesserdrone(target)) + to_chat(xeno, "It would be a waste...") + return + + if(!xeno.check_state()) + return + + if(target.stat == DEAD) + to_chat(xeno, SPAN_WARNING("[target] is already dead!")) + return + + if(target.health >= target.maxHealth) + to_chat(xeno, SPAN_WARNING("[target] is already at max health!")) + return + + if(!isturf(xeno.loc)) + to_chat(xeno, SPAN_WARNING("You cannot transfer health from here!")) + return + + if(get_dist(xeno, target) > max_range) + to_chat(xeno, SPAN_WARNING("You need to be closer to [target].")) + return + + xeno.say(";MY LIFE FOR THE QUEEN!!!") + + target.gain_health(xeno.health * transfer_mod) + target.updatehealth() + + target.xeno_jitter(1 SECONDS) + target.flick_heal_overlay(3 SECONDS, "#44253d") + + target.SetKnockDown(0) + target.SetStun(0) + target.SetKnockOut(0) + target.SetDaze(0) + target.SetSlow(0) + target.SetSuperslow(0) + + target.visible_message(SPAN_XENONOTICE("[xeno] explodes in a deluge of regenerative resin salve, covering [target] in it!")) + xeno_message(SPAN_XENOANNOUNCE("[xeno] sacrifices itself to heal [target]!"), 2, target.hive.hivenumber) + + var/datum/behavior_delegate/drone_healer/behavior_delegate = xeno.behavior_delegate + if(istype(behavior_delegate) && behavior_delegate.transferred_amount >= behavior_delegate.required_transferred_amount && xeno.client && xeno.hive) + var/datum/hive_status/hive_status = xeno.hive + var/turf/spawning_turf = get_turf(xeno) + if(!hive_status.hive_location) + addtimer(CALLBACK(xeno.hive, TYPE_PROC_REF(/datum/hive_status, respawn_on_turf), xeno.client, spawning_turf), 0.5 SECONDS) + else + addtimer(CALLBACK(xeno.hive, TYPE_PROC_REF(/datum/hive_status, free_respawn), xeno.client), 5 SECONDS) + + xeno.gib("sacrificing itself") + +/datum/action/xeno_action/activable/healer_sacrifice/action_activate() + ..() + var/mob/living/carbon/xenomorph/xeno = owner + if(xeno.selected_ability != src) + return + var/datum/behavior_delegate/drone_healer/behavior_delegate = xeno.behavior_delegate + if(!istype(behavior_delegate)) + return + if (behavior_delegate.transferred_amount < behavior_delegate.required_transferred_amount) + to_chat(xeno, SPAN_HIGHDANGER("Warning: [name] is a last measure skill. Using it will kill you.")) + else + to_chat(xeno, SPAN_HIGHDANGER("Warning: [name] is a last measure skill. Using it will kill you, but new life will be granted for your hard work for the hive.")) +