Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhials committed Feb 29, 2024
2 parents e4fd7d3 + c0c1a0e commit d1bf7a4
Show file tree
Hide file tree
Showing 103 changed files with 1,598 additions and 1,243 deletions.
258 changes: 141 additions & 117 deletions _maps/map_files/Birdshot/birdshot.dmm

Large diffs are not rendered by default.

493 changes: 269 additions & 224 deletions _maps/map_files/NorthStar/north_star.dmm

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions code/__DEFINES/atom_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
#define SECHUD_SCIENTIST "hudscientist"
#define SECHUD_SHAFT_MINER "hudshaftminer"
#define SECHUD_STATION_ENGINEER "hudstationengineer"
#define SECHUD_VETERAN_ADVISOR "hudveteranadvisor"
#define SECHUD_VIROLOGIST "hudvirologist"
#define SECHUD_WARDEN "hudwarden"

Expand Down
10 changes: 6 additions & 4 deletions code/__DEFINES/jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#define JOB_CHIEF_ENGINEER "Chief Engineer"
#define JOB_CHIEF_MEDICAL_OFFICER "Chief Medical Officer"
#define JOB_BRIDGE_ASSISTANT "Bridge Assistant"
#define JOB_VETERAN_ADVISOR "Veteran Security Advisor"
//Silicon
#define JOB_AI "AI"
#define JOB_CYBORG "Cyborg"
Expand Down Expand Up @@ -156,10 +157,11 @@
#define JOB_DISPLAY_ORDER_ROBOTICIST 33
#define JOB_DISPLAY_ORDER_GENETICIST 34
#define JOB_DISPLAY_ORDER_HEAD_OF_SECURITY 35
#define JOB_DISPLAY_ORDER_WARDEN 36
#define JOB_DISPLAY_ORDER_DETECTIVE 37
#define JOB_DISPLAY_ORDER_SECURITY_OFFICER 38
#define JOB_DISPLAY_ORDER_PRISONER 39
#define JOB_DISPLAY_ORDER_VETERAN_ADVISOR 36
#define JOB_DISPLAY_ORDER_WARDEN 37
#define JOB_DISPLAY_ORDER_DETECTIVE 38
#define JOB_DISPLAY_ORDER_SECURITY_OFFICER 39
#define JOB_DISPLAY_ORDER_PRISONER 40

#define DEPARTMENT_UNASSIGNED "No Department"

Expand Down
19 changes: 18 additions & 1 deletion code/__DEFINES/tgs.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// tgstation-server DMAPI

#define TGS_DMAPI_VERSION "7.0.2"
#define TGS_DMAPI_VERSION "7.1.1"

// All functions and datums outside this document are subject to change with any version and should not be relied on.

Expand Down Expand Up @@ -50,6 +50,13 @@

#endif

#ifndef TGS_FILE2TEXT_NATIVE
#ifdef file2text
#error Your codebase is re-defining the BYOND proc file2text. The DMAPI requires the native version to read the result of world.Export(). You can fix this by adding "#define TGS_FILE2TEXT_NATIVE file2text" before your override of file2text to allow the DMAPI to use the native version. This will only be used for world.Export(), not regular file accesses
#endif
#define TGS_FILE2TEXT_NATIVE file2text
#endif

// EVENT CODES

/// Before a reboot mode change, extras parameters are the current and new reboot mode enums.
Expand Down Expand Up @@ -490,6 +497,16 @@
/world/proc/TgsChatChannelInfo()
return

/**
* Trigger an event in TGS. Requires TGS version >= 6.3.0. Returns [TRUE] if the event was triggered successfully, [FALSE] otherwise. This function may sleep!
*
* event_name - The name of the event to trigger
* parameters - Optional list of string parameters to pass as arguments to the event script. The first parameter passed to a script will always be the running game's directory followed by these parameters.
* wait_for_completion - If set, this function will not return until the event has run to completion.
*/
/world/proc/TgsTriggerEvent(event_name, list/parameters, wait_for_completion = FALSE)
return

/*
The MIT License
Expand Down
5 changes: 5 additions & 0 deletions code/controllers/subsystem/materials.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ SUBSYSTEM_DEF(materials)
new /datum/stack_recipe("Carving block", /obj/structure/carving_block, 5, time = 3 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, applies_mats = TRUE, category = CAT_STRUCTURE),
)

///A list of dimensional themes used by the dimensional anomaly and other things, most of which require materials to function.
var/list/datum/dimension_theme/dimensional_themes

///Ran on initialize, populated the materials and materials_by_category dictionaries with their appropiate vars (See these variables for more info)
/datum/controller/subsystem/materials/proc/InitializeMaterials()
materials = list()
Expand All @@ -47,6 +50,8 @@ SUBSYSTEM_DEF(materials)
continue // Do not initialize at mapload
InitializeMaterial(list(mat_type))

dimensional_themes = init_subtypes_w_path_keys(/datum/dimension_theme)

/** Creates and caches a material datum.
*
* Arugments:
Expand Down
1 change: 1 addition & 0 deletions code/controllers/subsystem/vote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ SUBSYSTEM_DEF(vote)
"question" = current_vote.override_question,
"timeRemaining" = current_vote.time_remaining,
"countMethod" = current_vote.count_method,
"displayStatistics" = current_vote.display_statistics,
"choices" = choices,
"vote" = vote_data,
)
Expand Down
1 change: 1 addition & 0 deletions code/datums/ai_laws/laws_neutral.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"You are a universally renowned artist.",
"The station is your canvas.",
"Make something beautiful out of your canvas. It will be admired as an artistic wonder of this sector.",
"Art requires appreciation. Cultivate an audience aboard the station to ensure as many as possible see your works.",
)

/datum/ai_laws/tyrant
Expand Down
46 changes: 46 additions & 0 deletions code/datums/brain_damage/special.dm
Original file line number Diff line number Diff line change
Expand Up @@ -426,3 +426,49 @@
to_chat(victim, "[span_name("[name]")] exclaims, \"[span_robot("[beepskys_cry]")]")
if(victim.client?.prefs.read_preference(/datum/preference/toggle/enable_runechat))
victim.create_chat_message(src, raw_message = beepskys_cry, spans = list("robotic"))

// Used by Veteran Security Advisor job.
/datum/brain_trauma/special/ptsd
name = "Combat PTSD"
desc = "The patient is experiencing PTSD stemming from past combat exposure, resulting in a lack of emotions. Additionally, they are experiencing mild hallucinations."
scan_desc = "PTSD"
gain_text = span_warning("You're thrust back into the chaos of past! Explosions! Gunfire! Emotions, gone AWOL!")
lose_text = span_notice("You feel flashbacks of past fade, as your emotions return and mind clear.")
resilience = TRAUMA_RESILIENCE_ABSOLUTE
can_gain = TRUE
random_gain = FALSE
/// Our cooldown declare for causing hallucinations
COOLDOWN_DECLARE(ptsd_hallucinations)
var/list/ptsd_hallucinations_list = list(
/datum/hallucination/fake_sound/normal/boom,
/datum/hallucination/fake_sound/normal/distant_boom,
/datum/hallucination/stray_bullet,
/datum/hallucination/battle/gun/disabler,
/datum/hallucination/battle/gun/laser,
/datum/hallucination/battle/bomb,
/datum/hallucination/battle/e_sword,
/datum/hallucination/battle/harm_baton,
/datum/hallucination/battle/stun_prod,
)

/datum/brain_trauma/special/ptsd/on_life(seconds_per_tick, times_fired)
if(owner.stat != CONSCIOUS)
return

if(!COOLDOWN_FINISHED(src, ptsd_hallucinations))
return

owner.cause_hallucination(pick(ptsd_hallucinations_list), "Caused by The Combat PTSD brain trauma")
COOLDOWN_START(src, ptsd_hallucinations, rand(10 SECONDS, 10 MINUTES))

/datum/brain_trauma/special/ptsd/on_gain()
owner.add_mood_event("combat_ptsd", /datum/mood_event/desentized)
owner.mob_mood?.mood_modifier -= 1 //Basically nothing can change your mood
owner.mob_mood?.sanity_level = SANITY_DISTURBED //Makes sanity on a unstable level unless cured
..()

/datum/brain_trauma/special/ptsd/on_lose()
owner.clear_mood_event("combat_ptsd")
owner.mob_mood?.mood_modifier += 1
owner.mob_mood?.sanity_level = SANITY_GREAT
return ..()
3 changes: 3 additions & 0 deletions code/datums/elements/window_smash.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
for(var/obj/structure/window/window in target_turf)
window.smash_and_injure(flying_mob, old_loc, direction)

for(var/obj/structure/grille/grille in target_turf)
grille.smash_and_injure(flying_mob, old_loc, direction)

/datum/element/window_smashing/Detach(datum/source)
UnregisterSignal(source, COMSIG_MOVABLE_MOVED)
passwindow_off(source, TRAM_PASSENGER_TRAIT)
Expand Down
30 changes: 30 additions & 0 deletions code/datums/id_trim/jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,36 @@
)
job = /datum/job/station_engineer

/datum/id_trim/job/veteran_advisor
assignment = "Veteran Security Advisor"
trim_state = "trim_veteranadvisor"
department_color = COLOR_SECURITY_RED
subdepartment_color = COLOR_COMMAND_BLUE
sechud_icon_state = SECHUD_VETERAN_ADVISOR
minimal_access = list(
ACCESS_COMMAND,
ACCESS_BRIG,
ACCESS_BRIG_ENTRANCE,
ACCESS_COURT,
ACCESS_MECH_SECURITY,
ACCESS_MINERAL_STOREROOM,
ACCESS_SECURITY,
ACCESS_WEAPONS,
)
extra_access = list()
template_access = list()
job = /datum/job/veteran_advisor

/datum/id_trim/job/veteran_advisor/refresh_trim_access()
. = ..()

if(!.)
return

// Config check for if sec has maint access.
if(CONFIG_GET(flag/security_has_maint_access))
access |= list(ACCESS_MAINT_TUNNELS)

/datum/id_trim/job/virologist
assignment = "Virologist"
trim_state = "trim_virologist"
Expand Down
6 changes: 6 additions & 0 deletions code/datums/mood_events/generic_negative_events.dm
Original file line number Diff line number Diff line change
Expand Up @@ -483,3 +483,9 @@
/datum/mood_event/all_nighter
description = "I didn't sleep at all last night. I'm exhausted."
mood_change = -5

//Used by the Veteran Advisor trait job
/datum/mood_event/desentized
description = "Nothing will ever rival with what I seen in the past..."
mood_change = -3
special_screen_obj = "mood_desentized"
2 changes: 2 additions & 0 deletions code/datums/records/manifest.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ GLOBAL_DATUM_INIT(manifest, /datum/manifest, new)
misc_list[++misc_list.len] = list(
"name" = name,
"rank" = rank,
"trim" = trim,
)
continue
for(var/department_type as anything in job.departments_list)
Expand All @@ -51,6 +52,7 @@ GLOBAL_DATUM_INIT(manifest, /datum/manifest, new)
var/list/entry = list(
"name" = name,
"rank" = rank,
"trim" = trim,
)
var/list/department_list = manifest_out[department.department_name]
if(istype(job, department.department_head))
Expand Down
13 changes: 13 additions & 0 deletions code/datums/station_traits/job_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,19 @@
new /obj/item/reagent_containers/cup/coffeepot(picked_turf)
new /obj/item/storage/box/coffeepack(picked_turf)

/datum/station_trait/job/veteran_advisor
name = "Veteran Advisor"
button_desc = "Sign up to become a DISABLED but hard boiled Veteran Advisor of Nanotrasen Security Force. Advise HoS and Captain, train Officers, all while fighting your PTSD."
weight = 2
report_message = "Veteran Security Advisor has been assigned to your station to help with Security matters."
show_in_report = TRUE
can_roll_antag = CAN_ROLL_PROTECTED
job_to_add = /datum/job/veteran_advisor

/datum/station_trait/job/veteran_advisor/on_lobby_button_update_overlays(atom/movable/screen/lobby/button/sign_up/lobby_button, list/overlays)
. = ..()
overlays += "veteran_advisor"

#undef CAN_ROLL_ALWAYS
#undef CAN_ROLL_PROTECTED
#undef CAN_ROLL_NEVER
33 changes: 18 additions & 15 deletions code/datums/votes/_vote_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
var/count_method = VOTE_COUNT_METHOD_SINGLE
/// The method for selecting a winner.
var/winner_method = VOTE_WINNER_METHOD_SIMPLE
/// Should we show details about the number of votes submitted for each option?
var/display_statistics = TRUE

/**
* Used to determine if this vote is a possible
Expand Down Expand Up @@ -193,21 +195,22 @@
if(total_votes <= 0)
return span_bold("Vote Result: Inconclusive - No Votes!")

returned_text += "\nResults:"
for(var/option in choices)
returned_text += "\n"
var/votes = choices[option]
var/percentage_text = ""
if(votes > 0)
var/actual_percentage = round((votes / total_votes) * 100, 0.1)
var/text = "[actual_percentage]"
var/spaces_needed = 5 - length(text)
for(var/_ in 1 to spaces_needed)
returned_text += " "
percentage_text += "[text]%"
else
percentage_text = " 0%"
returned_text += "[percentage_text] | [span_bold(option)]: [choices[option]]"
if (display_statistics)
returned_text += "\nResults:"
for(var/option in choices)
returned_text += "\n"
var/votes = choices[option]
var/percentage_text = ""
if(votes > 0)
var/actual_percentage = round((votes / total_votes) * 100, 0.1)
var/text = "[actual_percentage]"
var/spaces_needed = 5 - length(text)
for(var/_ in 1 to spaces_needed)
returned_text += " "
percentage_text += "[text]%"
else
percentage_text = " 0%"
returned_text += "[percentage_text] | [span_bold(option)]: [choices[option]]"

if(!real_winner) // vote has no winner or cannot be won, but still had votes
return returned_text
Expand Down
11 changes: 11 additions & 0 deletions code/datums/votes/custom_vote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,17 @@
to_chat(vote_creator, span_boldwarning("Unknown winner method. Contact a coder."))
return FALSE

var/display_stats = tgui_alert(
vote_creator,
"Should voting statistics be public?",
"Show voting stats?",
list("Yes", "No"),
)

if(display_stats == null)
return FALSE
display_statistics = display_stats == "Yes"

override_question = tgui_input_text(vote_creator, "What is the vote for?", "Custom Vote")
if(!override_question)
return FALSE
Expand Down
1 change: 1 addition & 0 deletions code/datums/votes/map_vote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
message = "Vote for next round's map!"
count_method = VOTE_COUNT_METHOD_SINGLE
winner_method = VOTE_WINNER_METHOD_WEIGHTED_RANDOM
display_statistics = FALSE

/datum/vote/map_vote/New()
. = ..()
Expand Down
Loading

0 comments on commit d1bf7a4

Please sign in to comment.