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

Adds special endings for the crew completing none, or some of the objectives. Syndicate victories are now player-obtainable #698

Merged
merged 1 commit into from
Aug 29, 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
8 changes: 5 additions & 3 deletions code/__defines/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
#define GAMEMODE_BREAK 6

#define WORLD_END_SHUTDOWN 0
#define WORLD_END_NANOTRASEN_VICTORY 1
#define WORLD_END_SYNDICATE_VICTORY 2
#define WORLD_END_SYNDICATE_VICTORY 1
#define WORLD_END_BORING_VICTORY 2
#define WORLD_END_MINOR_NANOTRASEN_VICTORY 3
#define WORLD_END_NANOTRASEN_VICTORY 4

#define FAILED "FAILED"
#define COMPLETED "COMPLETED"
#define ACTIVE "ACTIVE"
#define IMPOSSIBLE "IMPOSSIBLE"
#define IMPOSSIBLE "IMPOSSIBLE"
4 changes: 2 additions & 2 deletions code/_core/datum/gamemode/horde.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
if(can_continue())
SSvote.create_vote(/vote/continue_round)
else
world.end(WORLD_END_NANOTRASEN_VICTORY)
world.end()

/gamemode/horde/proc/create_horde_mob(var/desired_loc)
var/mob/living/L = pickweight(enemy_types_to_spawn)
Expand Down Expand Up @@ -386,4 +386,4 @@
continue
return N_start

return null
return null
4 changes: 2 additions & 2 deletions code/_core/datum/gamemode/mission.dm
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
status_display_text = "VOTE"
round_time_next = -1
if(allow_continue)
world.end(WORLD_END_NANOTRASEN_VICTORY)
world.end()
else
SSvote.create_vote(/vote/continue_round)

Expand All @@ -228,4 +228,4 @@
add_objective(objectives_left[1])
objectives_left.Cut(1,2)
else
stage = 5 //No objectives left!
stage = 5 //No objectives left!
4 changes: 2 additions & 2 deletions code/_core/datum/vote/continue.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
/vote/continue_round/on_result(var/winner,var/list/results)

if(winner == "No")
world.end(WORLD_END_NANOTRASEN_VICTORY)
world.end()
else
SSgamemode.active_gamemode.on_continue()

return TRUE
return TRUE
41 changes: 37 additions & 4 deletions code/_core/world/_world.dm
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ var/global/world_state = STATE_STARTING
P.to_chat(span("danger","Save error! Your character could not be saved!"))
CHECK_TICK_HARD

/world/proc/end(var/reason,var/shutdown=FALSE)
/world/proc/end(var/reason = FALSE, var/shutdown = FALSE)

if(world_state != STATE_RUNNING)
log_error("Can't end now!")
Expand All @@ -202,17 +202,50 @@ var/global/world_state = STATE_STARTING

world_state = STATE_ROUND_END

if(!reason)
var/gamemode/gamemode = SSgamemode.active_gamemode
var/completed_objectives = length(gamemode.crew_completed_objectives)
var/failed_objectives = length(gamemode.crew_failed_objectives)
var/total_objectives = length(gamemode.crew_active_objectives) + completed_objectives + failed_objectives

if((completed_objectives || failed_objectives) && total_objectives)
switch((completed_objectives - (failed_objectives * 0.4)) / total_objectives)
if(-INFINITY to 0)
reason = WORLD_END_SYNDICATE_VICTORY
if(0.01 to 0.99)
reason = WORLD_END_MINOR_NANOTRASEN_VICTORY
if(1 to INFINITY)
reason = WORLD_END_NANOTRASEN_VICTORY

else
reason = WORLD_END_BORING_VICTORY

switch(reason)
if(WORLD_END_SHUTDOWN)
nice_reason = "Adminbus."

if(WORLD_END_SYNDICATE_VICTORY)
nice_reason = "Syndicate Victory"
announce("Central Command Mission Update","Fission Mailed","Mission failed, we'll get them next time.")

if(WORLD_END_BORING_VICTORY)
nice_reason = "Neutral Victory"
announce("Central Command Mission Update","Mission... failure?","You completed no objectives, don't expect to get paid any extra for your \"work\".")

if(WORLD_END_MINOR_NANOTRASEN_VICTORY)
nice_reason = "Minor Nanotrasen Victory"
SSpayday.stored_payday += 2500
SSpayday.trigger_payday()
announce("Central Command Mission Update","Minor Mission Success","You completed some of the objectives without fucking up too hard, so here is a small bonus.")

if(WORLD_END_NANOTRASEN_VICTORY)
nice_reason = "Nanotrasen Victory"
SSpayday.stored_payday += 5000
SSpayday.trigger_payday()
announce("Central Command Mission Update","Mission Success","You completed all the objectives without fucking up too hard, so here is a bonus.")
if(WORLD_END_SYNDICATE_VICTORY)
nice_reason = "Syndicate Victory"
announce("Central Command Mission Update","Fission Mailed","Mission failed, we'll get them next time.")

else
nice_reason = reason

play_sound_global('sound/meme/apcdestroyed.ogg',SSliving.all_mobs_with_clients)

Expand Down
Loading