Skip to content

Commit

Permalink
Merge branch 'master' into burgers
Browse files Browse the repository at this point in the history
  • Loading branch information
Meatstuff882 committed Aug 19, 2024
2 parents 2f93757 + 3b631ae commit 67fdb88
Show file tree
Hide file tree
Showing 161 changed files with 646 additions and 537 deletions.
100 changes: 73 additions & 27 deletions code/__DEFINES/tgs.dm
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
// tgstation-server DMAPI
// The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in IETF RFC 2119.

#define TGS_DMAPI_VERSION "7.1.2"
#define TGS_DMAPI_VERSION "7.2.1"

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

// CONFIGURATION

/// Create this define if you want to do TGS configuration outside of this file.
/// Consumers SHOULD create this define if you want to do TGS configuration outside of this file.
#ifndef TGS_EXTERNAL_CONFIGURATION

// Comment this out once you've filled in the below.
// Consumers MUST comment this out once you've filled in the below and are not using [TGS_EXTERNAL_CONFIGURATION].
#error TGS API unconfigured

// Uncomment this if you wish to allow the game to interact with TGS 3..
// Consumers MUST uncomment this if you wish to allow the game to interact with TGS version 3.
// This will raise the minimum required security level of your game to TGS_SECURITY_TRUSTED due to it utilizing call()().
//#define TGS_V3_API

Expand Down Expand Up @@ -52,7 +53,7 @@

#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
#error Your codebase is re-defining the BYOND proc file2text. The DMAPI requires the native version to read the result of world.Export(). You SHOULD 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
Expand Down Expand Up @@ -152,16 +153,17 @@
//REQUIRED HOOKS

/**
* Call this somewhere in [/world/proc/New] that is always run. This function may sleep!
* Consumers MUST call this somewhere in [/world/proc/New] that is always run. This function may sleep!
*
* * event_handler - Optional user defined [/datum/tgs_event_handler].
* * minimum_required_security_level: The minimum required security level to run the game in which the DMAPI is integrated. Can be one of [TGS_SECURITY_ULTRASAFE], [TGS_SECURITY_SAFE], or [TGS_SECURITY_TRUSTED].
* * http_handler - Optional user defined [/datum/tgs_http_handler].
*/
/world/proc/TgsNew(datum/tgs_event_handler/event_handler, minimum_required_security_level = TGS_SECURITY_ULTRASAFE)
/world/proc/TgsNew(datum/tgs_event_handler/event_handler, minimum_required_security_level = TGS_SECURITY_ULTRASAFE, datum/tgs_http_handler/http_handler)
return

/**
* Call this when your initializations are complete and your game is ready to play before any player interactions happen.
* Consumers MUST call this when world initializations are complete and the game is ready to play before any player interactions happen.
*
* This may use [/world/var/sleep_offline] to make this happen so ensure no changes are made to it while this call is running.
* Afterwards, consider explicitly setting it to what you want to avoid this BYOND bug: http://www.byond.com/forum/post/2575184
Expand All @@ -170,12 +172,10 @@
/world/proc/TgsInitializationComplete()
return

/// Put this at the start of [/world/proc/Topic].
/// Consumers MUST run this macro at the start of [/world/proc/Topic].
#define TGS_TOPIC var/tgs_topic_return = TgsTopic(args[1]); if(tgs_topic_return) return tgs_topic_return

/**
* Call this as late as possible in [world/proc/Reboot] (BEFORE ..()).
*/
/// Consumers MUST call this as late as possible in [world/proc/Reboot] (BEFORE ..()).
/world/proc/TgsReboot()
return

Expand Down Expand Up @@ -269,7 +269,7 @@
/// The [/datum/tgs_chat_channel] the user was from.
var/datum/tgs_chat_channel/channel

/// User definable handler for TGS events.
/// User definable handler for TGS events This abstract version SHOULD be overridden to be used.
/datum/tgs_event_handler
/// If the handler receieves [TGS_EVENT_HEALTH_CHECK] events.
var/receive_health_checks = FALSE
Expand All @@ -283,7 +283,41 @@
set waitfor = FALSE
return

/// User definable chat command.
/// User definable handler for HTTP calls. This abstract version MUST be overridden to be used.
/datum/tgs_http_handler

/**
* User definable callback for executing HTTP GET requests.
* MUST perform BYOND sleeps while the request is in flight.
* MUST return a [/datum/tgs_http_result].
* SHOULD log its own errors
*
* url - The full URL to execute the GET request for including query parameters.
*/
/datum/tgs_http_handler/proc/PerformGet(url)
CRASH("[type]/PerformGet not implemented!")

/// Result of a [/datum/tgs_http_handler] call. MUST NOT be overridden.
/datum/tgs_http_result
/// HTTP response as text
var/response_text
/// Boolean request success flag. Set for any 2XX response code.
var/success

/**
* Create a [/datum/tgs_http_result].
*
* * response_text - HTTP response as text. Must be provided in New().
* * success - Boolean request success flag. Set for any 2XX response code. Must be provided in New().
*/
/datum/tgs_http_result/New(response_text, success)
if(response_text && !istext(response_text))
CRASH("response_text was not text!")

src.response_text = response_text
src.success = success

/// User definable chat command. This abstract version MUST be overridden to be used.
/datum/tgs_chat_command
/// The string to trigger this command on a chat bot. e.g `@bot name ...` or `!tgs name ...`.
var/name = ""
Expand All @@ -296,21 +330,27 @@

/**
* Process command activation. Should return a [/datum/tgs_message_content] to respond to the issuer with.
* MUST be implemented
*
* sender - The [/datum/tgs_chat_user] who issued the command.
* params - The trimmed string following the command `/datum/tgs_chat_command/var/name].
* * sender - The [/datum/tgs_chat_user] who issued the command.
* * params - The trimmed string following the command `/datum/tgs_chat_command/var/name].
*/
/datum/tgs_chat_command/proc/Run(datum/tgs_chat_user/sender, params)
CRASH("[type] has no implementation for Run()")

/// User definable chat message.
/// User definable chat message. MUST NOT be overridden.
/datum/tgs_message_content
/// The tring content of the message. Must be provided in New().
/// The string content of the message. Must be provided in New().
var/text

/// The [/datum/tgs_chat_embed] to embed in the message. Not supported on all chat providers.
var/datum/tgs_chat_embed/structure/embed

/**
* Create a [/datum/tgs_message_content].
*
* * text - The string content of the message.
*/
/datum/tgs_message_content/New(text)
..()
if(!istext(text))
Expand All @@ -319,7 +359,7 @@

src.text = text

/// User definable chat embed. Currently mirrors Discord chat embeds. See https://discord.com/developers/docs/resources/channel#embed-object-embed-structure for details.
/// User definable chat embed. Currently mirrors Discord chat embeds. See https://discord.com/developers/docs/resources/message#embed-object for details.
/datum/tgs_chat_embed/structure
var/title
var/description
Expand All @@ -331,13 +371,13 @@
/// Colour must be #AARRGGBB or #RRGGBB hex string.
var/colour

/// See https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure for details.
/// See https://discord.com/developers/docs/resources/message#embed-object-embed-image-structure for details.
var/datum/tgs_chat_embed/media/image

/// See https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure for details.
/// See https://discord.com/developers/docs/resources/message#embed-object-embed-thumbnail-structure for details.
var/datum/tgs_chat_embed/media/thumbnail

/// See https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure for details.
/// See https://discord.com/developers/docs/resources/message#embed-object-embed-video-structure for details.
var/datum/tgs_chat_embed/media/video

var/datum/tgs_chat_embed/footer/footer
Expand All @@ -346,58 +386,64 @@

var/list/datum/tgs_chat_embed/field/fields

/// Common datum for similar discord embed medias.
/// Common datum for similar Discord embed medias.
/datum/tgs_chat_embed/media
/// Must be set in New().
var/url
var/width
var/height
var/proxy_url

/// Create a [/datum/tgs_chat_embed].
/datum/tgs_chat_embed/media/New(url)
..()
if(!istext(url))
CRASH("[/datum/tgs_chat_embed/media] created with no url!")

src.url = url

/// See https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure for details.
/// See https://discord.com/developers/docs/resources/message#embed-object-embed-footer-structure for details.
/datum/tgs_chat_embed/footer
/// Must be set in New().
var/text
var/icon_url
var/proxy_icon_url

/// Create a [/datum/tgs_chat_embed/footer].
/datum/tgs_chat_embed/footer/New(text)
..()
if(!istext(text))
CRASH("[/datum/tgs_chat_embed/footer] created with no text!")

src.text = text

/// See https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure for details.
/// See https://discord.com/developers/docs/resources/message#embed-object-embed-provider-structure for details.
/datum/tgs_chat_embed/provider
var/name
var/url

/// See https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure for details. Must have name set in New().
/// See https://discord.com/developers/docs/resources/message#embed-object-embed-author-structure for details. Must have name set in New().
/datum/tgs_chat_embed/provider/author
var/icon_url
var/proxy_icon_url

/// Create a [/datum/tgs_chat_embed/footer].
/datum/tgs_chat_embed/provider/author/New(name)
..()
if(!istext(name))
CRASH("[/datum/tgs_chat_embed/provider/author] created with no name!")

src.name = name

/// See https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure for details. Must have name and value set in New().
/// See https://discord.com/developers/docs/resources/message#embed-object-embed-field-structure for details.
/datum/tgs_chat_embed/field
/// Must be set in New().
var/name
/// Must be set in New().
var/value
var/is_inline

/// Create a [/datum/tgs_chat_embed/field].
/datum/tgs_chat_embed/field/New(name, value)
..()
if(!istext(name))
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/xeno_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#define FIRE_PENALTY 25
#define SENTRY_PENALTY 25
#define VEHICLE_PENALTY 25
#define LOCKED_DOOR_PENALTY 25
#define WINDOW_FRAME_PENALTY 25
#define BARRICADE_PENALTY 50
#define WALL_PENALTY 100
Expand Down
1 change: 1 addition & 0 deletions code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ SUBSYSTEM_DEF(ticker)
/datum/controller/subsystem/ticker/proc/request_start()
if(current_state == GAME_STATE_PREGAME)
time_left = 0
delay_start = FALSE

// Killswitch if hanging or interrupted
if(SSnightmare.stat != NIGHTMARE_STATUS_DONE)
Expand Down
4 changes: 2 additions & 2 deletions code/datums/ammo/bullet/special_ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@
icon_state = "bullet" // Keeping it bog standard with the turret but allows it to be changed

accurate_range = 12
damage = 35
damage = 40
penetration= ARMOR_PENETRATION_TIER_10 //Bumped the penetration to serve a different role from sentries, MGs are a bit more offensive
accuracy = HIT_ACCURACY_TIER_3
accuracy = HIT_ACCURACY_TIER_5

/datum/ammo/bullet/machinegun/set_bullet_traits()
. = ..()
Expand Down
6 changes: 0 additions & 6 deletions code/game/jobs/job/antag/xeno/queen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,3 @@
to_chat(new_queen, "<B>Your job is to spread the hive.</B>")
to_chat(new_queen, "<B>You should start by building a hive core.</B>")
to_chat(new_queen, "Talk in Hivemind using <strong>;</strong> (e.g. ';Hello my children!')")

AddTimelock(/datum/job/antag/xenos/queen, list(
JOB_XENO_ROLES = 10 HOURS,
JOB_DRONE_ROLES = 5 HOURS,
JOB_T3_ROLES = 3 HOURS,
))
4 changes: 0 additions & 4 deletions code/game/jobs/job/civilians/other/liaison.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,3 @@
name = JOB_CORPORATE_LIAISON
icon_state = "cl_spawn"
job = /datum/job/civilian/liaison

AddTimelock(/datum/job/civilian/liaison, list(
JOB_HUMAN_ROLES = 10 HOURS,
))
4 changes: 0 additions & 4 deletions code/game/jobs/job/civilians/other/reporter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,3 @@ This could be the story of the sector! 'Brave Marines responding to dangerous di
/obj/effect/landmark/start/reporter
name = JOB_COMBAT_REPORTER
job = /datum/job/civilian/reporter

AddTimelock(/datum/job/civilian/reporter, list(
JOB_HUMAN_ROLES = 10 HOURS,
))
6 changes: 0 additions & 6 deletions code/game/jobs/job/civilians/other/survivors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,6 @@

SSticker.mode.survivors_by_type_amounts[preferred_variant] += 1

AddTimelock(/datum/job/civilian/survivor, list(
JOB_SQUAD_ROLES = 5 HOURS,
JOB_ENGINEER_ROLES = 5 HOURS,
JOB_MEDIC_ROLES = 5 HOURS
))

/datum/job/civilian/survivor/synth
title = JOB_SYNTH_SURVIVOR
selection_class = "job_synth"
Expand Down
4 changes: 0 additions & 4 deletions code/game/jobs/job/civilians/support/cmo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
gear_preset = /datum/equipment_preset/uscm_ship/uscm_medical/cmo
entry_message_body = "You're a commissioned officer of the USCM. <a href='"+WIKI_PLACEHOLDER+"'>You have authority over everything related to Medbay and Research</a>, only able to be overriden by the XO and CO. You are in charge of medical staff, surgery, chemistry, stimulants and keeping the marines healthy overall."

AddTimelock(/datum/job/civilian/professor, list(
JOB_MEDIC_ROLES = 10 HOURS
))

/obj/effect/landmark/start/professor
name = JOB_CMO
icon_state = "cmo_spawn"
Expand Down
4 changes: 0 additions & 4 deletions code/game/jobs/job/civilians/support/doctor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@
total_positions_so_far = positions
return positions

AddTimelock(/datum/job/civilian/doctor, list(
JOB_MEDIC_ROLES = 1 HOURS
))

/obj/effect/landmark/start/doctor
name = JOB_DOCTOR
icon_state = "doc_spawn"
Expand Down
4 changes: 0 additions & 4 deletions code/game/jobs/job/civilians/support/nurse.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,3 @@
name = JOB_NURSE
icon_state = "nur_spawn"
job = /datum/job/civilian/nurse

AddTimelock(/datum/job/civilian/nurse, list(
JOB_HUMAN_ROLES = 1 HOURS
))
4 changes: 0 additions & 4 deletions code/game/jobs/job/civilians/support/researcher.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
total_positions_so_far = positions
return positions

AddTimelock(/datum/job/civilian/researcher, list(
JOB_MEDIC_ROLES = 5 HOURS
))

/obj/effect/landmark/start/researcher
name = JOB_RESEARCHER
icon_state = "res_spawn"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@
gear_preset = /datum/equipment_preset/uscm_ship/auxiliary_officer
entry_message_body = "<a href='"+WIKI_PLACEHOLDER+"'>Your job is to oversee</a> the hangar crew, the intel officers, the engineering department, and requisition department. You have many responsibilities and a few plates to keep spinning but your subordinates are mostly self-reliant. Assist where you can and make sure command personnel are confident the auxiliary departments are operating at peak efficiency."

AddTimelock(/datum/job/command/auxiliary_officer, list(
JOB_SQUAD_ROLES = 5 HOURS,
JOB_REQUISITION_ROLES = 5 HOURS,
JOB_ENGINEER_ROLES = 5 HOURS,
JOB_AUXILIARY_ROLES = 5 HOURS,
))

/obj/effect/landmark/start/auxiliary_officer
name = JOB_AUXILIARY_OFFICER
job = /datum/job/command/auxiliary_officer
Expand Down
4 changes: 0 additions & 4 deletions code/game/jobs/job/command/auxiliary/crew_chief.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
gear_preset = /datum/equipment_preset/uscm_ship/dcc
entry_message_body = "<a href='"+WIKI_PLACEHOLDER+"'>Your job is to assist</a> the pilot officer maintain the ship's dropship. You have authority only on the dropship, but you are expected to maintain order, as not to disrupt the pilot."

AddTimelock(/datum/job/command/crew_chief, list(
JOB_SQUAD_ROLES = 5 HOURS
))

/obj/effect/landmark/start/crew_chief
name = JOB_DROPSHIP_CREW_CHIEF
icon_state = "dcc_spawn"
Expand Down
4 changes: 0 additions & 4 deletions code/game/jobs/job/command/auxiliary/intel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
total_positions_so_far = positions
return positions

AddTimelock(/datum/job/command/intel, list(
JOB_SQUAD_ROLES = 5 HOURS
))

/obj/effect/landmark/start/intel
name = JOB_INTEL
icon_state = "io_spawn"
Expand Down
Loading

0 comments on commit 67fdb88

Please sign in to comment.