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

Corrupted Queen can set up personal alliances with humans #6155

Merged
merged 10 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions code/datums/mob_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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."))
fira marked this conversation as resolved.
Show resolved Hide resolved
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()
Expand Down
51 changes: 45 additions & 6 deletions code/modules/mob/living/carbon/xenomorph/hive_status.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
. = ..()
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down
Binary file modified icons/mob/hud/hud.dmi
Binary file not shown.
Loading