Skip to content

Commit

Permalink
Standardize xeno wait times into defines
Browse files Browse the repository at this point in the history
  • Loading branch information
Drulikar committed Jun 22, 2023
1 parent 20e4005 commit e4b0861
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 17 deletions.
2 changes: 0 additions & 2 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
#define OVEREAT_TIME 200

//=================================================
#define ALIEN_SELECT_AFK_BUFFER 1 // How many minutes that a person can be AFK before not being allowed to be an alien.

#define HEAT_DAMAGE_LEVEL_1 2 //Amount of damage applied when your body temperature just passes the 360.15k safety point
#define HEAT_DAMAGE_LEVEL_2 4 //Amount of damage applied when your body temperature passes the 400K point
#define HEAT_DAMAGE_LEVEL_3 8 //Amount of damage applied when your body temperature passes the 1000K point
Expand Down
16 changes: 16 additions & 0 deletions code/__DEFINES/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,22 @@
#define WEED_BASE_GROW_SPEED (5 SECONDS)
#define WEED_BASE_DECAY_SPEED (10 SECONDS)

/// The time you must be dead to join as a xeno larva
#define XENO_JOIN_DEAD_LARVA_TIME (2.5 MINUTES)
/// The time you must be dead to join as xeno (not larva)
#define XENO_JOIN_DEAD_TIME (5 MINUTES)
/// The time of inactivity you cannot exceed to join as a xeno
#define XENO_JOIN_AFK_TIME_LIMIT (5 MINUTES)
/// The amount of time after round start before buried larva spawns are disallowed
#define XENO_BURIED_LARVA_TIME_LIMIT (30 MINUTES)

/// The time against away_timer when an AFK xeno larva can be replaced
#define XENO_LEAVE_TIMER_LARVA 80 //80 seconds
/// The time against away_timer when an AFK xeno (not larva) can be replaced
#define XENO_LEAVE_TIMER 300 //300 seconds
/// The time against away_timer when an AFK xeno gets listed in the available list so ghosts can get ready
#define XENO_AVAILABLE_TIMER 60 //60 seconds

/// Between 2% to 10% of explosion severity
#define WEED_EXPLOSION_DAMAGEMULT rand(2, 10)*0.01

Expand Down
4 changes: 0 additions & 4 deletions code/__HELPERS/_time.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@

#define DECISECONDS_TO_HOURS /36000

#define XENO_LEAVE_TIMER_LARVA 80 //80 seconds
#define XENO_LEAVE_TIMER 300 //300 seconds
#define XENO_AVAILABLE_TIMER 60 //60 seconds, when to add a xeno to the avaliable list so ghosts can get ready

var/midnight_rollovers = 0
var/rollovercheck_last_timeofday = 0

Expand Down
4 changes: 2 additions & 2 deletions code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,11 @@

// copied from join as xeno
var/deathtime = world.time - cur_obs.timeofdeath
if(deathtime < (5 MINUTES) && ( !cur_obs.client.admin_holder || !(cur_obs.client.admin_holder.rights & R_ADMIN)) )
if(deathtime < XENO_JOIN_DEAD_TIME && ( !cur_obs.client.admin_holder || !(cur_obs.client.admin_holder.rights & R_ADMIN)) )
continue

// AFK players cannot be drafted
if(cur_obs.client.inactivity / (1 MINUTES) > ALIEN_SELECT_AFK_BUFFER + 5)
if(cur_obs.client.inactivity > XENO_JOIN_AFK_TIME_LIMIT)
continue

// Mods with larva protection cannot be drafted
Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/observer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
return FALSE

var/deathtime = world.time - timeofdeath
if(deathtime < 2.5 MINUTES)
if(deathtime < XENO_JOIN_DEAD_LARVA_TIME)
var/message = "You have been dead for [DisplayTimeText(deathtime)]."
message = SPAN_WARNING("[message]")
to_chat(src, message)
to_chat(src, SPAN_WARNING("You must wait 2.5 minutes before rejoining the game!"))
to_chat(src, SPAN_WARNING("You must wait atleast 2.5 minutes before rejoining the game!"))
ManualFollow(target)
return FALSE

Expand Down
14 changes: 7 additions & 7 deletions code/game/gamemodes/cm_initialize.dm
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ Additional game mode variables.
var/datum/hive_status/hive
for(var/hivenumber in GLOB.hive_datum)
hive = GLOB.hive_datum[hivenumber]
if(!hive.hardcore && hive.stored_larva && (hive.hive_location || (world.time < 30 MINUTES + SSticker.round_start_time)))
if(!hive.hardcore && hive.stored_larva && (hive.hive_location || (world.time < XENO_BURIED_LARVA_TIME_LIMIT + SSticker.round_start_time)))
if(SSticker.mode && (SSticker.mode.flags_round_type & MODE_RANDOM_HIVE))
available_xenos |= "any buried larva"
LAZYADD(available_xenos["any buried larva"], hive)
Expand Down Expand Up @@ -397,11 +397,11 @@ Additional game mode variables.
if(!xeno_bypass_timer)
var/deathtime = world.time - xeno_candidate.timeofdeath
if(isnewplayer(xeno_candidate))
deathtime = 2.5 MINUTES //so new players don't have to wait to latejoin as xeno in the round's first 5 mins.
if(deathtime < 2.5 MINUTES && !check_client_rights(xeno_candidate.client, R_ADMIN, FALSE))
deathtime = XENO_JOIN_DEAD_LARVA_TIME //so new players don't have to wait to latejoin as xeno in the round's first 5 mins.
if(deathtime < XENO_JOIN_DEAD_LARVA_TIME && !check_client_rights(xeno_candidate.client, R_ADMIN, FALSE))
var/message = SPAN_WARNING("You have been dead for [DisplayTimeText(deathtime)].")
to_chat(xeno_candidate, message)
to_chat(xeno_candidate, SPAN_WARNING("You must wait 2.5 minutes before rejoining the game as a buried larva!"))
to_chat(xeno_candidate, SPAN_WARNING("You must wait 2 minutes and 30 seconds before rejoining the game as a buried larva!"))
return FALSE

for(var/mob_name in picked_hive.banished_ckeys)
Expand All @@ -413,7 +413,7 @@ Additional game mode variables.
noob.close_spawn_windows()
if(picked_hive.hive_location)
picked_hive.hive_location.spawn_burrowed_larva(xeno_candidate)
else if((world.time < 30 MINUTES + SSticker.round_start_time))
else if((world.time < XENO_BURIED_LARVA_TIME_LIMIT + SSticker.round_start_time))
picked_hive.do_buried_larva_spawn(xeno_candidate)
else
to_chat(xeno_candidate, SPAN_WARNING("Seems like something went wrong. Try again?"))
Expand All @@ -437,8 +437,8 @@ Additional game mode variables.
if(!xeno_bypass_timer)
var/deathtime = world.time - xeno_candidate.timeofdeath
if(istype(xeno_candidate, /mob/new_player))
deathtime = 5 MINUTES //so new players don't have to wait to latejoin as xeno in the round's first 5 mins.
if(deathtime < 5 MINUTES && !check_client_rights(xeno_candidate.client, R_ADMIN, FALSE))
deathtime = XENO_JOIN_DEAD_TIME //so new players don't have to wait to latejoin as xeno in the round's first 5 mins.
if(deathtime < XENO_JOIN_DEAD_TIME && !check_client_rights(xeno_candidate.client, R_ADMIN, FALSE))
var/message = "You have been dead for [DisplayTimeText(deathtime)]."
message = SPAN_WARNING("[message]")
to_chat(xeno_candidate, message)
Expand Down

0 comments on commit e4b0861

Please sign in to comment.