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

More Xeno Alliances Tweaks #4053

Merged
merged 3 commits into from
Aug 12, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/xenomorph/XenoProcs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
if(SSticker.mode && SSticker.mode.xenomorphs.len) //Send to only xenos in our gamemode list. This is faster than scanning all mobs
for(var/datum/mind/L in SSticker.mode.xenomorphs)
var/mob/living/carbon/M = L.current
if(M && istype(M) && !M.stat && M.client && (!hivenumber || M.ally_of_hivenumber(hivenumber))) //Only living and connected xenos
if(M && istype(M) && !M.stat && M.client && (!hivenumber || M.hivenumber == hivenumber)) //Only living and connected xenos
to_chat(M, SPAN_XENODANGER("<span class=\"[fontsize_style]\"> [message]</span>"))

//Sends a maptext alert to our currently selected squad. Does not make sound.
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/carbon/xenomorph/death.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
if(!QDELETED(Q) && Q != src && Q.hivenumber == hivenumber)
hive.set_living_xeno_queen(Q)
break
hive.on_queen_death()
hive.handle_xeno_leader_pheromones()
if(SSticker.mode)
INVOKE_ASYNC(SSticker.mode, TYPE_PROC_REF(/datum/game_mode, check_queen_status), hivenumber)
Expand Down
3 changes: 1 addition & 2 deletions code/modules/mob/living/carbon/xenomorph/hive_faction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,5 @@ GLOBAL_LIST_INIT(hive_alliable_factions, generate_alliable_factions())
return

var/should_ally = text2num(params["should_ally"])
assoc_hive.allies[params["target_faction"]] = should_ally
assoc_hive.on_stance_change(params["target_faction"])
assoc_hive.change_stance(params["target_faction"], should_ally)
. = TRUE
40 changes: 31 additions & 9 deletions code/modules/mob/living/carbon/xenomorph/xeno_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1352,13 +1352,32 @@
/datum/hive_status/corrupted/renegade/faction_is_ally(faction, ignore_queen_check = TRUE)
return ..()

/datum/hive_status/proc/on_stance_change(faction)
if(!living_xeno_queen)
/datum/hive_status/proc/on_queen_death() //break alliances on queen's death
if(allow_no_queen_actions || living_xeno_queen)
return
if(allies[faction])
xeno_message(SPAN_XENOANNOUNCE("Your Queen set up an alliance with [faction]!"), 3, hivenumber)
else
xeno_message(SPAN_XENOANNOUNCE("Your Queen broke the alliance with [faction]!"), 3, hivenumber)
var/broken_alliances = FALSE
for(var/faction in allies)
if(!allies[faction])
continue
change_stance(faction, FALSE)
broken_alliances = TRUE


if(broken_alliances)
xeno_message(SPAN_XENOANNOUNCE("With the death of the Queen all alliances has been broken."), 3, hivenumber)
ihatethisengine marked this conversation as resolved.
Show resolved Hide resolved

/datum/hive_status/proc/change_stance(faction, should_ally)
if(faction == name)
return
if(allies[faction] == should_ally)
return
allies[faction] = should_ally

if(living_xeno_queen)
if(allies[faction])
xeno_message(SPAN_XENOANNOUNCE("Your Queen set up an alliance with [faction]!"), 3, hivenumber)
else
xeno_message(SPAN_XENOANNOUNCE("Your 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 All @@ -1367,12 +1386,15 @@
if(!target_hive.living_xeno_queen && !target_hive.allow_no_queen_actions)
return
if(allies[faction])
xeno_message(SPAN_XENOANNOUNCE("You sense that [name] Queen set up an alliance with us!"), 3, target_hive.hivenumber)
xeno_message(SPAN_XENOANNOUNCE("You sense that [name] [living_xeno_queen ? "Queen " : ""]set up an alliance with us!"), 3, target_hive.hivenumber)
return

xeno_message(SPAN_XENOANNOUNCE("You sense that [name] Queen broke the alliance with us!"), 3, target_hive.hivenumber)
xeno_message(SPAN_XENOANNOUNCE("You sense that [name] [living_xeno_queen ? "Queen " : ""]broke the alliance with us!"), 3, target_hive.hivenumber)
if(target_hive.allies[name]) //autobreak alliance on betrayal
target_hive.change_stance(name, FALSE)


/datum/hive_status/corrupted/on_stance_change(faction)
/datum/hive_status/corrupted/change_stance(faction, should_ally)
. = ..()
if(allies[faction])
return
Expand Down
Loading