Skip to content

Commit

Permalink
3rd Party Victory Music (WY, UPP, CLF, USCM) (#3861)
Browse files Browse the repository at this point in the history
# About the pull request

This adds a "Last Man Standing" condition, where in the event of a Xeno
Minor where all Xenos are dead but humans are still in control of the
ship, we figure out which faction controls the Almayer and play thematic
music for that faction. Currently whichever faction has more than 50% of
the Last Troops Standing, is considered the "winner". Additionally the
Colonial Marines theme song is now officially the USCM hijack comeback
song.

Melancholy1 is the fallback in the case that there is no determined
majority.

This adds:
- Weyland-Yutani
- UPP
- CLF
- USCM (technically)

Note: This only alters what music plays during a Xeno Minor. The round
outcome still counts as a Xeno win both mechanically and statistically.

# Explain why it's good for the game

In the rare event of a botched xeno hijack, it'd be cool to do something
special if a 3rd party manages to secure a USCM Warship.


# Testing Photographs and Procedure
The headcount proc was tested against ERT members making sure that
faction count was accurate.
The music selector was tested by forcing round_status to Xeno_Minor and
verifying that we toggle between whomever is the majority.
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl:
add: Added unique, faction dependent music to Round End in the event
that Xenos lose post hijack.
/:cl:

---------

Co-authored-by: Ben <[email protected]>
Co-authored-by: harryob <[email protected]>
  • Loading branch information
3 people committed Jul 24, 2023
1 parent 19c9f82 commit 0e93e1d
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 1 deletion.
28 changes: 28 additions & 0 deletions code/game/gamemodes/cm_process.dm
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,34 @@ GLOBAL_VAR_INIT(next_admin_bioscan, 30 MINUTES)

return num_marines

/datum/game_mode/proc/count_per_faction(list/z_levels = SSmapping.levels_by_any_trait(list(ZTRAIT_GROUND, ZTRAIT_RESERVED, ZTRAIT_MARINE_MAIN_SHIP)))
var/num_marines = 0
var/num_WY = 0
var/num_UPP = 0
var/num_CLF = 0
var/num_headcount = 0

for(var/mob/living/carbon/human/current_human as anything in GLOB.alive_human_list)
if(!(current_human.z && (current_human.z in z_levels) && !istype(current_human.loc, /turf/open/space)))
continue
if(current_human.faction in FACTION_LIST_WY || current_human.job == "Corporate Liaison") //The CL is assigned the USCM faction for gameplay purposes
num_WY++
num_headcount++
continue
if(current_human.faction == FACTION_UPP)
num_UPP++
num_headcount++
continue
if(current_human.faction == FACTION_CLF)
num_CLF++
num_headcount++
continue
if(current_human.faction == FACTION_MARINE)
num_marines++
num_headcount++
continue
num_headcount++
return list("marine_headcount" = num_marines,"WY_headcount" = num_WY,"UPP_headcount" = num_UPP,"CLF_headcount" = num_CLF,"total_headcount" = num_headcount)

/*
#undef QUEEN_DEATH_COUNTDOWN
Expand Down
18 changes: 17 additions & 1 deletion code/game/gamemodes/colonialmarines/colonialmarines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@
//////////////////////////////////////////////////////////////////////
//Announces the end of the game with all relevant information stated//
//////////////////////////////////////////////////////////////////////
#define MAJORITY 0.5 // What percent do we consider a 'majority?'

/datum/game_mode/colonialmarines/declare_completion()
announce_ending()
var/musical_track
Expand All @@ -372,7 +374,20 @@
round_statistics.current_map.total_marine_victories++
round_statistics.current_map.total_marine_majors++
if(MODE_INFESTATION_X_MINOR)
musical_track = pick('sound/theme/neutral_melancholy1.ogg','sound/theme/neutral_melancholy2.ogg')
var/list/living_player_list = count_humans_and_xenos(EvacuationAuthority.get_affected_zlevels())
if(living_player_list[1] && !living_player_list[2]) // If Xeno Minor but Xenos are dead and Humans are alive, see which faction is the last standing
var/headcount = count_per_faction()
var/living = headcount["total_headcount"]
if ((headcount["WY_headcount"] / living) > MAJORITY)
musical_track = pick('sound/theme/LastManStanding_WY.ogg')
else if ((headcount["UPP_headcount"] / living) > MAJORITY)
musical_track = pick('sound/theme/LastManStanding_UPP.ogg')
else if ((headcount["CLF_headcount"] / living) > MAJORITY)
musical_track = pick('sound/theme/LastManStanding_CLF.ogg')
else if ((headcount["marine_headcount"] / living) > MAJORITY)
musical_track = pick('sound/theme/neutral_melancholy2.ogg') //This is the theme song for Colonial Marines the game, fitting
else
musical_track = pick('sound/theme/neutral_melancholy1.ogg')
end_icon = "xeno_minor"
if(round_statistics && round_statistics.current_map)
round_statistics.current_map.total_xeno_victories++
Expand Down Expand Up @@ -581,3 +596,4 @@

#undef HIJACK_EXPLOSION_COUNT
#undef MARINE_MAJOR_ROUND_END_DELAY
#undef MAJORITY
Binary file added sound/theme/lastmanstanding_clf.ogg
Binary file not shown.
Binary file added sound/theme/lastmanstanding_upp.ogg
Binary file not shown.
Binary file added sound/theme/lastmanstanding_wy.ogg
Binary file not shown.

0 comments on commit 0e93e1d

Please sign in to comment.