diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index e2bd868f9a80..dbd8dbe7ce41 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -120,6 +120,7 @@ #define CANDAZE (1<<18) #define CANSLOW (1<<19) #define NO_PERMANENT_DAMAGE (1<<20) +#define CORRUPTED_ALLY (1<<21) // ============================= // hive types diff --git a/code/datums/mob_hud.dm b/code/datums/mob_hud.dm index 5e57b8f5616c..88785474bc23 100644 --- a/code/datums/mob_hud.dm +++ b/code/datums/mob_hud.dm @@ -422,6 +422,10 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list( if(hive && hive.color) holder3.color = hive.color + if(status_flags & CORRUPTED_ALLY) + holder4.color = "#80ff80" + holder4.icon_state = "hudalien_ally" + if(stat == DEAD || status_flags & FAKEDEATH) if(revive_enabled) if(!client) diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm index 1f37651b2c8e..38e643e0d25c 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm @@ -371,10 +371,17 @@ xeno.use_plasma(plasma_cost_jelly) return /datum/action/xeno_action/onclick/manage_hive/use_ability(atom/Atom) - var/mob/living/carbon/xenomorph/queen/queenbanish = owner + var/mob/living/carbon/xenomorph/queen/queen_manager = owner plasma_cost = 0 - - var/choice = tgui_input_list(queenbanish, "Manage The Hive", "Hive Management", list("Banish (500)", "Re-Admit (100)", "De-evolve (500)", "Reward Jelly (500)", "Exchange larva for evolution (100)",), theme="hive_status") + var/list/options = list("Banish (500)", "Re-Admit (100)", "De-evolve (500)", "Reward Jelly (500)", "Exchange larva for evolution (100)",) + if(queen_manager.hive.hivenumber == XENO_HIVE_CORRUPTED) + var/datum/hive_status/corrupted/hive = queen_manager.hive + options += "Add Personal Ally" + if(length(hive.personal_allies)) + options += "Remove Personal Ally" + options += "Clear Personal Allies" + + var/choice = tgui_input_list(queen_manager, "Manage The Hive", "Hive Management", options, theme="hive_status") switch(choice) if("Banish (500)") banish() @@ -383,9 +390,118 @@ if("De-evolve (500)") de_evolve_other() if("Reward Jelly (500)") - give_jelly_reward(queenbanish.hive) + give_jelly_reward(queen_manager.hive) if("Exchange larva for evolution (100)") give_evo_points() + if("Add Personal Ally") + add_personal_ally() + if("Remove Personal Ally") + remove_personal_ally() + if("Clear Personal Allies") + clear_personal_allies() + +/datum/action/xeno_action/onclick/manage_hive/proc/add_personal_ally() + var/mob/living/carbon/xenomorph/queen/user_xeno = owner + if(user_xeno.hive.hivenumber != XENO_HIVE_CORRUPTED) + return + + if(!user_xeno.check_state()) + return + + var/datum/hive_status/corrupted/hive = user_xeno.hive + var/list/target_list = list() + if(!user_xeno.client) + return + for(var/mob/living/carbon/human/possible_target in range(7, user_xeno.client.eye)) + if(possible_target.stat == DEAD) + continue + if(possible_target.status_flags & CORRUPTED_ALLY) + continue + if(possible_target.hivenumber) + continue + target_list += possible_target + + if(!length(target_list)) + to_chat(user_xeno, SPAN_WARNING("No talls in view.")) + return + var/mob/living/target_mob = tgui_input_list(usr, "Target", "Set Up a Personal Alliance With...", target_list, theme="hive_status") + + if(!user_xeno.check_state(TRUE)) + return + + if(!target_mob) + return + + if(target_mob.hivenumber) + to_chat(user_xeno, SPAN_WARNING("We cannot set up a personal alliance with a hive cultist.")) + return + + hive.add_personal_ally(target_mob) + +/datum/action/xeno_action/onclick/manage_hive/proc/remove_personal_ally() + var/mob/living/carbon/xenomorph/queen/user_xeno = owner + if(user_xeno.hive.hivenumber != XENO_HIVE_CORRUPTED) + return + + if(!user_xeno.check_state()) + return + + var/datum/hive_status/corrupted/hive = user_xeno.hive + + if(!length(hive.personal_allies)) + to_chat(user_xeno, SPAN_WARNING("We don't have personal allies.")) + return + + var/list/mob/living/allies = list() + var/list/datum/weakref/dead_refs = list() + for(var/datum/weakref/ally_ref as anything in hive.personal_allies) + var/mob/living/ally = ally_ref.resolve() + if(ally) + allies += ally + continue + dead_refs += ally_ref + + hive.personal_allies -= dead_refs + + if(!length(allies)) + to_chat(user_xeno, SPAN_WARNING("We don't have personal allies.")) + return + + var/mob/living/target_mob = tgui_input_list(usr, "Target", "Break the Personal Alliance With...", allies, theme="hive_status") + + if(!target_mob) + return + + var/target_mob_ref = WEAKREF(target_mob) + + if(!(target_mob_ref in hive.personal_allies)) + return + + if(!user_xeno.check_state(TRUE)) + return + + hive.remove_personal_ally(target_mob_ref) + +/datum/action/xeno_action/onclick/manage_hive/proc/clear_personal_allies() + var/mob/living/carbon/xenomorph/queen/user_xeno = owner + if(user_xeno.hive.hivenumber != XENO_HIVE_CORRUPTED) + return + + if(!user_xeno.check_state()) + return + + var/datum/hive_status/corrupted/hive = user_xeno.hive + if(!length(hive.personal_allies)) + to_chat(user_xeno, SPAN_WARNING("We don't have personal allies.")) + return + + if(tgui_alert(user_xeno, "Are you sure you want to clear personal allies?", "Clear Personal Allies", list("No", "Yes"), 10 SECONDS) != "Yes") + return + + if(!length(hive.personal_allies)) + return + + hive.clear_personal_allies() /datum/action/xeno_action/onclick/manage_hive/proc/banish() diff --git a/code/modules/mob/living/carbon/xenomorph/hive_status.dm b/code/modules/mob/living/carbon/xenomorph/hive_status.dm index 22b061715892..baa736382733 100644 --- a/code/modules/mob/living/carbon/xenomorph/hive_status.dm +++ b/code/modules/mob/living/carbon/xenomorph/hive_status.dm @@ -979,6 +979,7 @@ need_round_end_check = TRUE var/list/defectors = list() + var/list/datum/weakref/personal_allies = list() /datum/hive_status/corrupted/add_xeno(mob/living/carbon/xenomorph/xeno) . = ..() @@ -1253,9 +1254,9 @@ if(living_xeno_queen) if(allies[faction]) - xeno_message(SPAN_XENOANNOUNCE("Your Queen set up an alliance with [faction]!"), 3, hivenumber) + xeno_message(SPAN_XENOANNOUNCE("Our Queen set up an alliance with [faction]!"), 3, hivenumber) else - xeno_message(SPAN_XENOANNOUNCE("Your Queen broke the alliance with [faction]!"), 3, hivenumber) + xeno_message(SPAN_XENOANNOUNCE("Our Queen broke the alliance with [faction]!"), 3, hivenumber) for(var/number in GLOB.hive_datum) var/datum/hive_status/target_hive = GLOB.hive_datum[number] @@ -1291,14 +1292,14 @@ addtimer(CALLBACK(src, PROC_REF(handle_defectors), faction), 11 SECONDS) /datum/hive_status/corrupted/proc/give_defection_choice(mob/living/carbon/xenomorph/xeno, faction) - if(tgui_alert(xeno, "Your Queen has broken the alliance with the [faction]. The device inside your carapace begins to suppress your connection with the Hive. Do you remove it and stay loyal to her?", "Alliance broken!", list("Stay loyal", "Obey the talls"), 10 SECONDS) == "Obey the talls") + if(tgui_alert(xeno, "Our Queen has broken the alliance with the [faction]. The device inside our carapace begins to suppress our connection with the Hive. Do we remove it and stay loyal to her?", "Alliance broken!", list("Stay loyal", "Obey the talls"), 10 SECONDS) == "Obey the talls") if(!xeno.iff_tag) to_chat(xeno, SPAN_XENOWARNING("It's too late now. The device is gone and our service to the Queen continues.")) return defectors += xeno xeno.set_hive_and_update(XENO_HIVE_RENEGADE) to_chat(xeno, SPAN_XENOANNOUNCE("You lost the connection with your Hive. Now you have no Queen, only your masters.")) - to_chat(xeno, SPAN_NOTICE("Our instincts have changed, we seem compelled to protect [english_list(xeno.iff_tag.faction_groups, "no one")].")) + to_chat(xeno, SPAN_NOTICE("Your instincts have changed, you seem compelled to protect [english_list(xeno.iff_tag.faction_groups, "no one")].")) return xeno.visible_message(SPAN_XENOWARNING("[xeno] rips out [xeno.iff_tag]!"), SPAN_XENOWARNING("We rip out [xeno.iff_tag]! For the Hive!")) xeno.adjustBruteLoss(50) @@ -1313,20 +1314,58 @@ continue if(!(faction in xeno.iff_tag.faction_groups)) continue - xeno.visible_message(SPAN_XENOWARNING("[xeno] rips out [xeno.iff_tag]!"), SPAN_XENOWARNING("You rip out [xeno.iff_tag]! For the hive!")) + xeno.visible_message(SPAN_XENOWARNING("[xeno] rips out [xeno.iff_tag]!"), SPAN_XENOWARNING("We rip out [xeno.iff_tag]! For the hive!")) xeno.adjustBruteLoss(50) xeno.iff_tag.forceMove(get_turf(xeno)) xeno.iff_tag = null if(!length(defectors)) return - xeno_message(SPAN_XENOANNOUNCE("You sense that [english_list(defectors)] turned their backs against their sisters and the Queen in favor of their slavemasters!"), 3, hivenumber) + xeno_message(SPAN_XENOANNOUNCE("We sense that [english_list(defectors)] turned their backs against their sisters and the Queen in favor of their slavemasters!"), 3, hivenumber) defectors.Cut() +/datum/hive_status/corrupted/proc/add_personal_ally(mob/living/ally) + personal_allies += WEAKREF(ally) + ally.status_flags |= CORRUPTED_ALLY + ally.med_hud_set_status() + xeno_message(SPAN_XENOANNOUNCE("Our Queen proclaimed [ally] our ally! We must not harm them."), 3, hivenumber) + +/datum/hive_status/corrupted/proc/remove_personal_ally(datum/weakref/ally_ref) + personal_allies -= ally_ref + var/mob/living/ally = ally_ref.resolve() + if(ally) + ally.status_flags &= ~CORRUPTED_ALLY + ally.med_hud_set_status() + xeno_message(SPAN_XENOANNOUNCE("Our Queen has declared that [ally] is no longer our ally!"), 3, hivenumber) + +/datum/hive_status/corrupted/proc/clear_personal_allies(death = FALSE) + for(var/datum/weakref/ally_ref in personal_allies) + var/mob/living/ally = ally_ref.resolve() + if(!ally) + continue + ally.status_flags &= ~CORRUPTED_ALLY + ally.med_hud_set_status() + personal_allies.Cut() + if(!death) + xeno_message(SPAN_XENOANNOUNCE("Our Queen has broken all personal alliances with the talls! Favoritism is no more."), 3, hivenumber) + return + xeno_message(SPAN_XENOWARNING("With the death of the Queen, her friends no longer matter to us."), 3, hivenumber) + +/datum/hive_status/corrupted/is_ally(mob/living/living_mob) + if(living_mob.status_flags & CORRUPTED_ALLY) + return TRUE + return ..() + /datum/hive_status/proc/override_evilution(evil, override) if(SSxevolution) SSxevolution.override_power(hivenumber, evil, override) +/datum/hive_status/corrupted/on_queen_death() + ..() + if(!length(personal_allies)) + return + clear_personal_allies(TRUE) + //Xeno Resin Mark Shit, the very best place for it too :0) //Defines at the bottom of this list here will show up at the top in the mark menu /datum/xeno_mark_define diff --git a/icons/mob/hud/hud.dmi b/icons/mob/hud/hud.dmi index 507ec0dd485b..8d89fb781264 100644 Binary files a/icons/mob/hud/hud.dmi and b/icons/mob/hud/hud.dmi differ