Skip to content

Commit

Permalink
TGS Test Merge (#8281)
Browse files Browse the repository at this point in the history
  • Loading branch information
cm13-github committed Jan 30, 2025
2 parents 02bcf2d + 6185873 commit c825b4b
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 26 deletions.
18 changes: 18 additions & 0 deletions code/__DEFINES/gamemode.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#define QUEEN_DEATH_COUNTDOWN 10 MINUTES

#define MODE_INFESTATION_X_MAJOR "Xenomorph Major Victory"
#define MODE_INFESTATION_M_MAJOR "Marine Major Victory"
#define MODE_INFESTATION_X_MINOR "Xenomorph Minor Victory"
#define MODE_INFESTATION_M_MINOR "Marine Minor Victory"
#define MODE_INFESTATION_DRAW_DEATH "DRAW: Mutual Annihilation"

#define MODE_INFECTION_ZOMBIE_WIN "Major Zombie Victory"

#define MODE_BATTLEFIELD_W_MAJOR "Wey-Yu PMC Major Success"
#define MODE_BATTLEFIELD_M_MAJOR "Marine Major Success"
#define MODE_BATTLEFIELD_W_MINOR "Wey-Yu PMC Minor Success"
#define MODE_BATTLEFIELD_M_MINOR "Marine Minor Success"
#define MODE_BATTLEFIELD_DRAW_STALEMATE "DRAW: Stalemate"
#define MODE_BATTLEFIELD_DRAW_DEATH "DRAW: My Friends Are Dead"

#define MODE_GENERIC_DRAW_NUKE "DRAW: Nuclear Explosion"
14 changes: 9 additions & 5 deletions code/datums/statistics/entities/round_caste_picks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@
var/round_id
/// Dict of "castename" : amount picked
var/list/castes_picked
/// If xenos won (major or minor)
var/xenos_won = FALSE

/datum/entity/round_caste_picks/New()
. = ..()
round_id = GLOB.round_id || -1
if(SSticker.mode.round_finished == MODE_INFESTATION_X_MAJOR || SSticker.mode.round_finished == MODE_INFESTATION_X_MINOR)
xenos_won = TRUE

/datum/entity/round_caste_picks/assign_values(list/values, list/ignore = list())
for(var/field in metadata.field_types)
if(ignore.Find(field))
continue
if(field == "round_id")
if((field == "round_id") || (field == "xenos_won"))
vars[field] = values[field]
else
castes_picked[field] = values[field]
Expand All @@ -22,6 +26,7 @@
table_name = "round_caste_picks"
field_types = list(
"round_id" = DB_FIELDTYPE_INT,
"xenos_won" = DB_FIELDTYPE_INT,
)

/datum/entity_meta/round_caste_picks/New()
Expand All @@ -30,10 +35,9 @@
field_types[lowertext(replacetext(caste_name, " ", "_"))] = DB_FIELDTYPE_INT

/datum/entity_meta/round_caste_picks/map(datum/entity/round_caste_picks/entity, list/values)
var/strid = "[values[DB_DEFAULT_ID_FIELD]]"
entity.id = strid
entity.id = "[values[DB_DEFAULT_ID_FIELD]]"
for(var/field in field_types)
if(field == "round_id")
if((field == "round_id") || (field == "xenos_won"))
entity.vars[field] = values[field]
else
entity.castes_picked[field] = values[field]
Expand All @@ -43,7 +47,7 @@
if(include_id)
values[DB_DEFAULT_ID_FIELD] = entity.id
for(var/field in field_types)
if(field == "round_id")
if((field == "round_id") || (field == "xenos_won"))
values[field] = entity.vars[field]
else
values[field] = entity.castes_picked[field]
Expand Down
18 changes: 0 additions & 18 deletions code/game/gamemodes/cm_process.dm
Original file line number Diff line number Diff line change
@@ -1,22 +1,4 @@

#define QUEEN_DEATH_COUNTDOWN 10 MINUTES //10 minutes. Can be changed into a variable if it needs to be manipulated later.

#define MODE_INFESTATION_X_MAJOR "Xenomorph Major Victory"
#define MODE_INFESTATION_M_MAJOR "Marine Major Victory"
#define MODE_INFESTATION_X_MINOR "Xenomorph Minor Victory"
#define MODE_INFESTATION_M_MINOR "Marine Minor Victory"
#define MODE_INFESTATION_DRAW_DEATH "DRAW: Mutual Annihilation"

#define MODE_INFECTION_ZOMBIE_WIN "Major Zombie Victory"

#define MODE_BATTLEFIELD_W_MAJOR "Wey-Yu PMC Major Success"
#define MODE_BATTLEFIELD_M_MAJOR "Marine Major Success"
#define MODE_BATTLEFIELD_W_MINOR "Wey-Yu PMC Minor Success"
#define MODE_BATTLEFIELD_M_MINOR "Marine Minor Success"
#define MODE_BATTLEFIELD_DRAW_STALEMATE "DRAW: Stalemate"
#define MODE_BATTLEFIELD_DRAW_DEATH "DRAW: My Friends Are Dead"

#define MODE_GENERIC_DRAW_NUKE "DRAW: Nuclear Explosion"

/*
Like with cm_initialize.dm, these procs exist to quickly populate classic CM game modes.
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/xenomorph/Evolution.dm
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ GLOBAL_LIST_EMPTY(deevolved_ckeys)
// We prevent de-evolved people from being tracked for the rest of the round relating to T1s in order to prevent people
// Intentionally de/re-evolving to mess with the stats gathered. We don't track t2/3 because it's a legit strategy to open
// With a t1 into drone before de-evoing later to go t1 into another caste once survs are dead/capped
if(new_xeno.ckey && !((new_xeno.caste.caste_type in XENO_T1_CASTES) && (new_xeno.ckey in GLOB.deevolved_ckeys)))
if(new_xeno.ckey && !((new_xeno.caste.caste_type in XENO_T1_CASTES) && (new_xeno.ckey in GLOB.deevolved_ckeys) && !(new_xeno.datum_flags & DF_VAR_EDITED)))
var/caste_cleaned_key = lowertext(replacetext(castepick, " ", "_"))
if(!SSticker.mode?.round_stats.castes_evolved[caste_cleaned_key])
SSticker.mode?.round_stats.castes_evolved[caste_cleaned_key] = 1
Expand Down
5 changes: 3 additions & 2 deletions code/modules/mob/living/carbon/xenomorph/death.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
update_icons()

if(!should_block_game_interaction(src)) //so xeno players don't get death messages from admin tests
var/datum/entity/xeno_death/death_log = SSentity_manager.tables[/datum/entity/xeno_death].make_new()
death_log.load_data(src, cause)
if(!(datum_flags & DF_VAR_EDITED))
var/datum/entity/xeno_death/death_log = SSentity_manager.tables[/datum/entity/xeno_death].make_new()
death_log.load_data(src, cause)

if(isqueen(src))
var/mob/living/carbon/xenomorph/queen/XQ = src
Expand Down
1 change: 1 addition & 0 deletions colonialmarines.dme
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
#include "code\__DEFINES\fire.dm"
#include "code\__DEFINES\flags.dm"
#include "code\__DEFINES\fonts.dm"
#include "code\__DEFINES\gamemode.dm"
#include "code\__DEFINES\generators.dm"
#include "code\__DEFINES\guns.dm"
#include "code\__DEFINES\hijack.dm"
Expand Down

0 comments on commit c825b4b

Please sign in to comment.