Skip to content

Commit

Permalink
Module: Cleanup 2 (#2)
Browse files Browse the repository at this point in the history
* auto_cell.dm; explosion.dm; vomitwave.dm

* attachment_handler.dm; overlay_lighting.dm

* shrapnel_removal.dm; yautja_tracked_item.dm

* necoarc.dm

* _game_mode.dm

* crash.dm

* distress.dm; nuclear_war.dm

* All greyscale files + json

* clown.dm; job_exp.dm

* job.dm; marines.dm; militarypolice.dm; necoarc.dm; pred.dm

* squads.dm; shipside.dm; sons_of_mars_shipside.dm; xenomorph.dm

* keybindings

* loadout

* looping_sounds

* status_effects

* datums
  • Loading branch information
fe-ed authored Jul 10, 2024
1 parent 9db80cc commit 54347bc
Show file tree
Hide file tree
Showing 69 changed files with 730 additions and 1,716 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
27 changes: 21 additions & 6 deletions code/datums/components/overlay_lighting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
///For light sources that can be turned on and off.
var/overlay_lighting_flags = NONE

/* RUTGMC DELETION START

///Cache of the possible light overlays, according to size.
var/static/list/light_overlays = list(
"32" = 'icons/effects/light_overlays/light_32.dmi',
Expand All @@ -43,8 +43,25 @@
"288" = 'icons/effects/light_overlays/light_288.dmi',
"320" = 'icons/effects/light_overlays/light_320.dmi',
"352" = 'icons/effects/light_overlays/light_352.dmi',
"384" = 'icons/effects/light_overlays/light_384.dmi',
"416" = 'icons/effects/light_overlays/light_416.dmi',
"448" = 'icons/effects/light_overlays/light_448.dmi',
"480" = 'icons/effects/light_overlays/light_480.dmi',
"512" = 'icons/effects/light_overlays/light_512.dmi',
"544" = 'icons/effects/light_overlays/light_544.dmi',
"576" = 'icons/effects/light_overlays/light_576.dmi',
"608" = 'icons/effects/light_overlays/light_608.dmi',
"640" = 'icons/effects/light_overlays/light_640.dmi',
"672" = 'icons/effects/light_overlays/light_672.dmi',
"704" = 'icons/effects/light_overlays/light_704.dmi',
"736" = 'icons/effects/light_overlays/light_736.dmi',
"768" = 'icons/effects/light_overlays/light_768.dmi',
"800" = 'icons/effects/light_overlays/light_800.dmi',
"832" = 'icons/effects/light_overlays/light_832.dmi',
"864" = 'icons/effects/light_overlays/light_864.dmi',
"896" = 'icons/effects/light_overlays/light_896.dmi',
"928" = 'icons/effects/light_overlays/light_928.dmi',
)
RUTGMC DELETION END */

///Overlay effect to cut into the darkness and provide light.
var/image/visible_mask
Expand Down Expand Up @@ -218,15 +235,13 @@
make_luminosity_update()


/* RUTGMC DELETION START
///Changes the range which the light reaches. 0 means no light, 6 is the maximum value.
/datum/component/overlay_lighting/proc/set_range(atom/source, new_range)
SIGNAL_HANDLER
if(range == new_range)
return
if(range == 0)
turn_off()
range = clamp(CEILING(new_range, 0.5), 1, 6)
range = clamp(CEILING(new_range, 0.5), 1, 15)
var/pixel_bounds = ((range - 1) * 64) + 32
lumcount_range = CEILING(range, 1)
if(current_holder && overlay_lighting_flags & LIGHTING_ON)
Expand All @@ -243,7 +258,7 @@
current_holder.underlays += visible_mask
if(overlay_lighting_flags & LIGHTING_ON)
make_luminosity_update()
RUTGMC DELETION END */


///Changes the intensity/brightness of the light by altering the visual object's alpha.
/datum/component/overlay_lighting/proc/set_power(atom/source, new_power)
Expand Down
13 changes: 8 additions & 5 deletions code/datums/elements/shrapnel_removal.dm
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
/* RUTGMC DELETION, SHRAPNEL REMOVAL FOR KNIVES
/datum/element/shrapnel_removal
element_flags = ELEMENT_BESPOKE
argument_hash_start_idx = 2
///Channel time per shrap removal
var/do_after_time
///Fumble time for unskilled users
var/fumble_duration
///Additional damage for removing something with improvised tools
var/additional_damage

/datum/element/shrapnel_removal/Attach(datum/target, duration, fumble_time)
/datum/element/shrapnel_removal/Attach(datum/target, duration, fumble_time, damage)
. = ..()
if(!isitem(target) || (duration < 1))
return ELEMENT_INCOMPATIBLE
do_after_time = duration
fumble_duration = fumble_time ? fumble_time : do_after_time
additional_damage = damage ? damage : 5
RegisterSignal(target, COMSIG_ITEM_ATTACK, PROC_REF(on_attack))

/datum/element/shrapnel_removal/Detach(datum/source, force)
Expand All @@ -21,6 +23,8 @@

/datum/element/shrapnel_removal/proc/on_attack(datum/source, mob/living/M, mob/living/user)
SIGNAL_HANDLER
if(user.a_intent != INTENT_HELP)
return
INVOKE_ASYNC(src, PROC_REF(attempt_remove), source, M, user)
return COMPONENT_ITEM_NO_ATTACK

Expand Down Expand Up @@ -69,9 +73,8 @@
I.unembed_ourself(FALSE)
if(skill < SKILL_MEDICAL_PRACTICED)
user.visible_message(span_notice("[user] violently rips out [I] from [target]!"), span_notice("You violently rip out [I] from [target]!"))
targetlimb.take_damage_limb(30 * (SKILL_MEDICAL_PRACTICED - skill), 0, FALSE, FALSE)
targetlimb.take_damage_limb(5 + additional_damage * (SKILL_MEDICAL_PRACTICED - skill), 0, FALSE, FALSE)
else
user.visible_message(span_notice("[user] pulls out [I] from [target]!"), span_notice("You pull out [I] from [target]!"))
targetlimb.take_damage_limb(15, 0, FALSE, FALSE)
targetlimb.take_damage_limb(rand(3, 7), 0, FALSE, FALSE)
break
*/
File renamed without changes.
File renamed without changes.
File renamed without changes.
137 changes: 136 additions & 1 deletion code/datums/gamemodes/_game_mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ GLOBAL_VAR(common_report) //Contains common part of roundend report
///What factions are used in this gamemode, typically TGMC and xenos
var/list/factions = list(FACTION_TERRAGOV, FACTION_ALIEN)

var/list/predators = list()

var/pred_current_num = 0 //How many are there now?
var/pred_per_players = 20 //Preds per player
var/pred_start_count = 0 //The initial count of predators

var/pred_additional_max = 0
var/pred_leader_count = 0 //How many Leader preds are active
var/pred_leader_max = 1 //How many Leader preds are permitted. Currently fixed to 1. May add admin verb to adjust this later.
var/quickbuild_points_flags = NONE

//Distress call variables.
var/list/datum/emergency_call/all_calls = list() //initialized at round start and stores the datums.
var/datum/emergency_call/picked_call = null //Which distress call is currently active
Expand All @@ -61,7 +72,7 @@ GLOBAL_VAR(common_report) //Contains common part of roundend report
///If the gamemode has a whitelist of valid ground maps. Whitelist overrides the blacklist
var/list/whitelist_ground_maps
///If the gamemode has a blacklist of disallowed ground maps
var/list/blacklist_ground_maps = list(MAP_DELTA_STATION, MAP_PRISON_STATION, MAP_LV_624, MAP_WHISKEY_OUTPOST, MAP_OSCAR_OUTPOST, MAP_FORT_PHOBOS)
var/list/blacklist_ground_maps = list(MAP_DELTA_STATION, MAP_WHISKEY_OUTPOST, MAP_OSCAR_OUTPOST, MAP_FORT_PHOBOS)
///if fun tads are enabled by default
var/enable_fun_tads = FALSE

Expand Down Expand Up @@ -135,6 +146,9 @@ GLOBAL_VAR(common_report) //Contains common part of roundend report
var/datum/db_query/query_round_game_mode = SSdbcore.NewQuery("UPDATE [format_table_name("round")] SET [sql] WHERE id = :roundid", list("roundid" = GLOB.round_id))
query_round_game_mode.Execute()
qdel(query_round_game_mode)
if(flags_round_type & MODE_SILO_RESPAWN)
var/datum/hive_status/normal/HN = GLOB.hive_datums[XENO_HIVE_NORMAL]
HN.RegisterSignals(SSdcs, list(COMSIG_GLOB_OPEN_TIMED_SHUTTERS_LATE, COMSIG_GLOB_OPEN_SHUTTERS_EARLY), TYPE_PROC_REF(/datum/hive_status/normal, set_siloless_collapse_timer))

/datum/game_mode/proc/new_player_topic(mob/new_player/NP, href, list/href_list)
return FALSE
Expand Down Expand Up @@ -945,6 +959,17 @@ GLOBAL_LIST_INIT(bioscan_locations, list(
handle_larva_timer(dcs, source, items)
handle_xeno_respawn_timer(dcs, source, items)

if(isobserver(source))
var/siloless_countdown = SSticker.mode.get_siloless_collapse_countdown()
if(siloless_countdown)
items +="Silo less hive collapse timer: [siloless_countdown]"
else if(isxeno(source))
var/mob/living/carbon/xenomorph/xeno_source = source
if(xeno_source.hivenumber == XENO_HIVE_NORMAL)
var/siloless_countdown = SSticker.mode.get_siloless_collapse_countdown()
if(siloless_countdown)
items +="Silo less hive collapse timer: [siloless_countdown]"

/// Displays the orphan hivemind collapse timer, if applicable
/datum/game_mode/proc/handle_collapse_timer(datum/dcs, mob/source, list/items)
if (isxeno(source))
Expand Down Expand Up @@ -976,3 +1001,113 @@ GLOBAL_LIST_INIT(bioscan_locations, list(
items += "Xeno respawn timer: READY"
else
items += "Xeno respawn timer: [(status_value / 60) % 60]:[add_leading(num2text(status_value % 60), 2, "0")]"

/// called to check for updates that might require starting/stopping the siloless collapse timer
/datum/game_mode/proc/update_silo_death_timer(datum/hive_status/silo_owner)
return

///starts the timer to end the round when no silo is left
/datum/game_mode/proc/get_siloless_collapse_countdown()
return

/datum/game_mode/proc/predator_round()
switch(CONFIG_GET(number/pred_round))
if(0)
return
if(1)
if(!prob(CONFIG_GET(number/pred_round_chance)))
return

var/datum/job/PJ = SSjob.GetJobType(/datum/job/predator)
var/new_pred_max = min(max(round(length(GLOB.clients) * PREDATOR_TO_TOTAL_SPAWN_RATIO), 1), 4)
PJ.total_positions = new_pred_max
PJ.max_positions = new_pred_max
flags_round_type |= MODE_PREDATOR

/datum/game_mode/proc/initialize_predator(mob/living/carbon/human/new_predator, client/player, ignore_pred_num = FALSE)
predators[lowertext(player.ckey)] = list("Name" = new_predator.real_name, "Status" = "Alive")
if(!ignore_pred_num)
pred_current_num++

/datum/game_mode/proc/get_whitelisted_predators(readied = 1)
// Assemble a list of active players who are whitelisted.
var/players[] = new

var/mob/new_player/new_pred
for(var/mob/player in GLOB.player_list)
if(!player.client) continue //No client. DCed.
if(isyautja(player)) continue //Already a predator. Might be dead, who knows.
if(readied) //Ready check for new players.
new_pred = player
if(!istype(new_pred)) continue //Have to be a new player here.
if(!new_pred.ready) continue //Have to be ready.
else
if(!istype(player,/mob/dead)) continue //Otherwise we just want to grab the ghosts.

if(GLOB.roles_whitelist[player.ckey] & WHITELIST_PREDATOR) //Are they whitelisted?
if(!player.client.prefs)
player.client.prefs = new /datum/preferences(player.client) //Somehow they don't have one.

if(player.client.prefs.job_preferences[JOB_PREDATOR] > 0) //Are their prefs turned on?
if(!player.mind) //They have to have a key if they have a client.
player.mind_initialize() //Will work on ghosts too, but won't add them to active minds.
players += player.mind
return players

#define calculate_pred_max (length(GLOB.player_list) / pred_per_players + pred_additional_max + pred_start_count)

/datum/game_mode/proc/check_predator_late_join(mob/pred_candidate, show_warning = TRUE)
if(!pred_candidate?.client) // Nigga, how?!
return

var/datum/job/job = SSjob.GetJobType(/datum/job/predator)

if(!job)
if(show_warning)
to_chat(pred_candidate, span_warning("Something went wrong!"))
return

if(show_warning && alert(pred_candidate, "Confirm joining the hunt. You will join as \a [lowertext(job.get_whitelist_status(GLOB.roles_whitelist, pred_candidate.client))] predator", "Confirm", "Yes", "No") != "Yes")
return

if(!(GLOB.roles_whitelist[pred_candidate.ckey] & WHITELIST_PREDATOR))
if(show_warning)
to_chat(pred_candidate, span_warning("You are not whitelisted! You may apply on the forums to be whitelisted as a predator."))
return

if(is_banned_from(ckey(pred_candidate.key), JOB_PREDATOR))
if(show_warning)
to_chat(pred_candidate, span_warning("You are banned."))
return

if(!(flags_round_type & MODE_PREDATOR))
if(show_warning)
to_chat(pred_candidate, span_warning("There is no Hunt this round! Maybe the next one."))
return

if(pred_candidate.ckey in predators)
if(show_warning)
to_chat(pred_candidate, span_warning("You already were a Yautja! Give someone else a chance."))
return

if(get_desired_status(pred_candidate.client.prefs.yautja_status, WHITELIST_COUNCIL) == WHITELIST_NORMAL)
var/pred_max = calculate_pred_max
if(pred_current_num >= pred_max)
if(show_warning)
to_chat(pred_candidate, span_warning("Only [pred_max] predators may spawn this round, but Councillors and Ancients do not count."))
return

return TRUE

#undef calculate_pred_max

/datum/game_mode/proc/join_predator(mob/pred_candidate)
var/datum/job/job = SSjob.GetJobType(/datum/job/predator)
var/datum/preferences/prefs = pred_candidate.client.prefs
var/spawn_type = job.return_spawn_type(prefs)
var/mob/living/carbon/human/new_predator = new spawn_type()
new_predator.forceMove(job.return_spawn_turf(pred_candidate, pred_candidate.client))
new_predator.ckey = pred_candidate.ckey
new_predator.apply_assigned_role_to_spawn(job)
job.after_spawn(new_predator)
qdel(pred_candidate)
3 changes: 3 additions & 0 deletions code/datums/gamemodes/crash.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/datum/job/terragov/squad/smartgunner = 1,
/datum/job/terragov/squad/leader = 1,
/datum/job/terragov/medical/professor = 1,
/datum/job/terragov/medical/medicalofficer = 1,
/datum/job/terragov/silicon/synthetic = 1,
/datum/job/terragov/command/fieldcommander = 1,
/datum/job/xenomorph = FREE_XENO_AT_START
Expand Down Expand Up @@ -74,6 +75,8 @@
SSshuttle.moveShuttleToDock(shuttle.id, actual_crash_site, TRUE) // FALSE = instant arrival
addtimer(CALLBACK(src, PROC_REF(crash_shuttle), actual_crash_site), 10 MINUTES)

GLOB.start_squad_landmarks_list = null


/datum/game_mode/infestation/crash/post_setup()
. = ..()
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions code/datums/gamemodes/nuclear_war.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
silo_scaling = 1.5
flags_round_type = MODE_INFESTATION|MODE_LATE_OPENING_SHUTTER_TIMER|MODE_XENO_RULER|MODE_PSY_POINTS|MODE_PSY_POINTS_ADVANCED|MODE_DEAD_GRAB_FORBIDDEN|MODE_HIJACK_POSSIBLE|MODE_SILO_RESPAWN|MODE_SILOS_SPAWN_MINIONS|MODE_ALLOW_XENO_QUICKBUILD
flags_xeno_abilities = ABILITY_NUCLEARWAR
quickbuild_points_flags = MODE_GENERAL_QUICKBUILD_POINTS
valid_job_types = list(
/datum/job/terragov/command/captain = 1,
/datum/job/terragov/command/fieldcommander = 1,
Expand Down
30 changes: 30 additions & 0 deletions code/datums/greyscale/greyscale_configs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -659,3 +659,33 @@
/datum/greyscale_config/broken_man
icon_file = 'icons/mob/human_face.dmi'
json_config = 'code/datums/greyscale/json_configs/broken_man.json'

//Capes
/datum/greyscale_config/cape
icon_file = 'icons/mob/modular/capes_saro.dmi'
json_config = 'code/datums/greyscale/json_configs/cape.json'


//Cape highlights
/datum/greyscale_config/cape_highlight
icon_file = 'icons/mob/modular/capes_highlight_saro.dmi'
json_config = 'code/datums/greyscale/json_configs/cape_highlight.json'


//Xenonauten MK1
/datum/greyscale_config/xenonaut/mk1
icon_file = 'icons/mob/modular/xenonauten_mk1.dmi'
json_config = 'code/datums/greyscale/json_configs/xenonaut_mk1.json'
prefix = "med_"

/datum/greyscale_config/xenonaut/mk1/light
prefix = "light_"

/datum/greyscale_config/xenonaut/mk1/medium
prefix = "med_"

/datum/greyscale_config/xenonaut/mk1/heavy
prefix = "heavy_"

/datum/greyscale_config/xenonaut/helm/mk1
icon_file = 'icons/mob/modular/xenonauten_mk1.dmi'
Loading

0 comments on commit 54347bc

Please sign in to comment.