Skip to content

Commit

Permalink
Merge branch 'cmss13-devs:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
blackdragonTOW committed Jun 24, 2023
2 parents 3575d87 + 807387b commit 2e5d557
Show file tree
Hide file tree
Showing 39 changed files with 491 additions and 145 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
9 changes: 9 additions & 0 deletions code/__HELPERS/cmp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,12 @@ var/atom/cmp_dist_origin=null

/proc/cmp_typepaths_asc(A, B)
return sorttext("[B]","[A]")

/// Compares mobs based on their timeofdeath value in ascending order
/proc/cmp_mob_deathtime_asc(mob/A, mob/B)
return A.timeofdeath - B.timeofdeath

/// Compares observers based on their larva_queue_time value in ascending order
/// Assumes the client on the observer is not null
/proc/cmp_obs_larvaqueuetime_asc(mob/dead/observer/A, mob/dead/observer/B)
return A.client.larva_queue_time - B.client.larva_queue_time
5 changes: 0 additions & 5 deletions code/__HELPERS/files.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@

return text

//Sends resource files to client cache
/client/proc/getFiles()
for(var/file in args)
src << browse_rsc(file)

/client/proc/browse_files(root="data/logs/", max_iterations=10, list/valid_extensions=list(".txt",".log",".htm"))
var/path = root

Expand Down
61 changes: 48 additions & 13 deletions code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -241,35 +241,70 @@
else
return get_step(start, EAST)

// Same as above but for alien candidates.
/proc/get_alien_candidates()
/// Get a list of observers that can be alien candidates, optionally sorted by larva_queue_time
/proc/get_alien_candidates(sorted = TRUE)
var/list/candidates = list()

for(var/i in GLOB.observer_list)
var/mob/dead/observer/O = i
for(var/mob/dead/observer/cur_obs as anything in GLOB.observer_list)
// Preference check
if(!cur_obs.client || !cur_obs.client.prefs || !(cur_obs.client.prefs.be_special & BE_ALIEN_AFTER_DEATH))
continue

// Jobban check
if(!O.client || !O.client.prefs || !(O.client.prefs.be_special & BE_ALIEN_AFTER_DEATH) || jobban_isbanned(O, JOB_XENOMORPH))
if(jobban_isbanned(cur_obs, JOB_XENOMORPH))
continue

//players that can still be revived are skipped
if(O.mind && O.mind.original && ishuman(O.mind.original))
var/mob/living/carbon/human/H = O.mind.original
if (H.check_tod() && H.is_revivable())
if(cur_obs.mind && cur_obs.mind.original && ishuman(cur_obs.mind.original))
var/mob/living/carbon/human/cur_human = cur_obs.mind.original
if(cur_human.check_tod() && cur_human.is_revivable())
continue

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

// Admins and AFK players cannot be drafted
if(O.client.inactivity / 600 > ALIEN_SELECT_AFK_BUFFER + 5 || (O.client.admin_holder && (O.client.admin_holder.rights & R_MOD)) && O.adminlarva == 0)
// AFK players cannot be drafted
if(cur_obs.client.inactivity > XENO_JOIN_AFK_TIME_LIMIT)
continue

candidates += O
// Mods with larva protection cannot be drafted
if((cur_obs.client.admin_holder && (cur_obs.client.admin_holder.rights & R_MOD)) && !cur_obs.adminlarva)
continue

candidates += cur_obs

// Optionally sort by larva_queue_time
if(sorted && length(candidates))
candidates = sort_list(candidates, GLOBAL_PROC_REF(cmp_obs_larvaqueuetime_asc))

return candidates

/**
* Messages observers that are currently candidates an update on the queue.
*
* Arguments:
* * candidates - The list of observers from get_alien_candidates()
* * dequeued - How many candidates to skip messaging because they were dequeued
* * cache_only - Whether to not actually send a to_chat message and instead only update larva_queue_cached_message
*/
/proc/message_alien_candidates(list/candidates, dequeued, cache_only = FALSE)
var/new_players = 0
for(var/i in (1 + dequeued) to candidates.len)
var/mob/dead/observer/cur_obs = candidates[i]

// Generate the messages
var/cached_message = SPAN_XENONOTICE("You are currently [i-dequeued]\th in the larva queue. There are [new_players] ahead of you that have yet to play this round.")
cur_obs.larva_queue_cached_message = cached_message
if(!cache_only)
var/chat_message = dequeued ? replacetext(cached_message, "currently", "now") : cached_message
to_chat(candidates[i], chat_message)

// Count how many are prioritized
if(cur_obs.client.larva_queue_time < 2) // 0 and 1 because facehuggers/t-domers are slightly deprioritized
new_players++

/proc/convert_k2c(temp)
return ((temp - T0C))

Expand Down
4 changes: 3 additions & 1 deletion code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@
return

// Click handled elsewhere. (These clicks are not affected by the next_move cooldown)
if (click(A, mods) || A.clicked(src, mods, location, params))
if(click(A, mods))
return
if(A.clicked(src, mods, location, params))
return

// Default click functions from here on.
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
2 changes: 1 addition & 1 deletion code/_onclick/other_mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
Have no reason to click on anything at all.
*/
/mob/new_player/click()
return 1
return
14 changes: 14 additions & 0 deletions code/controllers/subsystem/assets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ SUBSYSTEM_DEF(assets)
var/list/preload = list()
var/datum/asset_transport/transport = new()

/datum/controller/subsystem/assets/OnConfigLoad()
var/newtransporttype = /datum/asset_transport
switch (CONFIG_GET(string/asset_transport))
if ("webroot")
newtransporttype = /datum/asset_transport/webroot

if (newtransporttype == transport.type)
return

var/datum/asset_transport/newtransport = new newtransporttype ()
if (newtransport.validate_config())
transport = newtransport
transport.Load()

/datum/controller/subsystem/assets/Initialize()
for(var/type in typesof(/datum/asset))
var/datum/asset/A = type
Expand Down
Loading

0 comments on commit 2e5d557

Please sign in to comment.