Skip to content

Commit

Permalink
Merge branch 'Citadel-Station-13:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeramsay007 authored Aug 19, 2024
2 parents edd59bd + b0b4668 commit 70954c2
Show file tree
Hide file tree
Showing 42 changed files with 497 additions and 272 deletions.
9 changes: 8 additions & 1 deletion citadel.dme
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
#include "code\__DEFINES\dcs\flags.dm"
#include "code\__DEFINES\dcs\helpers.dm"
#include "code\__DEFINES\dcs\components\riding.dm"
#include "code\__DEFINES\dcs\components\slippery.dm"
#include "code\__DEFINES\dcs\signals\global_signals.dm"
#include "code\__DEFINES\dcs\signals\signals_area.dm"
#include "code\__DEFINES\dcs\signals\signals_datum.dm"
Expand Down Expand Up @@ -329,6 +330,7 @@
#include "code\__DEFINES\traits\atoms.dm"
#include "code\__DEFINES\traits\items.dm"
#include "code\__DEFINES\traits\mob.dm"
#include "code\__DEFINES\traits\movables.dm"
#include "code\__DEFINES\traits\sources.dm"
#include "code\__DEFINES\traits\unsorted.dm"
#include "code\__DEFINES\turfs\change_turf.dm"
Expand Down Expand Up @@ -765,6 +767,7 @@
#include "code\datums\components\items\wielding.dm"
#include "code\datums\components\movable\aquarium.dm"
#include "code\datums\components\movable\spatial_grid.dm"
#include "code\datums\components\objects\slippery.dm"
#include "code\datums\components\riding\riding_filter.dm"
#include "code\datums\components\riding\riding_handler.dm"
#include "code\datums\components\riding\mob\_mob.dm"
Expand Down Expand Up @@ -1634,6 +1637,7 @@
#include "code\game\objects\items\id_cards\sprite_stacks_cit.dm"
#include "code\game\objects\items\id_cards\station_ids.dm"
#include "code\game\objects\items\id_cards\syndicate_ids.dm"
#include "code\game\objects\items\janitorial\soap.dm"
#include "code\game\objects\items\robot\gripper.dm"
#include "code\game\objects\items\robot\robot_items.dm"
#include "code\game\objects\items\robot\robot_parts.dm"
Expand Down Expand Up @@ -1691,6 +1695,7 @@
#include "code\game\objects\items\storage\single_use\mre.dm"
#include "code\game\objects\items\stream_projector\medichine.dm"
#include "code\game\objects\items\stream_projector\stream_projector.dm"
#include "code\game\objects\items\theatrical\bike_horn.dm"
#include "code\game\objects\items\tools\_tool.dm"
#include "code\game\objects\items\tools\crowbar.dm"
#include "code\game\objects\items\tools\screwdriver.dm"
Expand All @@ -1704,7 +1709,6 @@
#include "code\game\objects\items\weapons\bones.dm"
#include "code\game\objects\items\weapons\candle.dm"
#include "code\game\objects\items\weapons\cigs_lighters.dm"
#include "code\game\objects\items\weapons\clown_items.dm"
#include "code\game\objects\items\weapons\cosmetics.dm"
#include "code\game\objects\items\weapons\dna_injector.dm"
#include "code\game\objects\items\weapons\duct_tape.dm"
Expand Down Expand Up @@ -3494,6 +3498,7 @@
#include "code\modules\mob\living\health.dm"
#include "code\modules\mob\living\inventory.dm"
#include "code\modules\mob\living\life.dm"
#include "code\modules\mob\living\living-defense.dm"
#include "code\modules\mob\living\living.dm"
#include "code\modules\mob\living\living_defines.dm"
#include "code\modules\mob\living\living_powers.dm"
Expand Down Expand Up @@ -3523,6 +3528,7 @@
#include "code\modules\mob\living\bot\secbot.dm"
#include "code\modules\mob\living\bot\SLed209bot.dm"
#include "code\modules\mob\living\carbon\breathe.dm"
#include "code\modules\mob\living\carbon\carbon-defense.dm"
#include "code\modules\mob\living\carbon\carbon.dm"
#include "code\modules\mob\living\carbon\carbon_defense.dm"
#include "code\modules\mob\living\carbon\carbon_defines.dm"
Expand Down Expand Up @@ -3577,6 +3583,7 @@
#include "code\modules\mob\living\carbon\human\emote.dm"
#include "code\modules\mob\living\carbon\human\examine.dm"
#include "code\modules\mob\living\carbon\human\health.dm"
#include "code\modules\mob\living\carbon\human\human-defense.dm"
#include "code\modules\mob\living\carbon\human\human.dm"
#include "code\modules\mob\living\carbon\human\human_attackhand.dm"
#include "code\modules\mob\living\carbon\human\human_damage.dm"
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/_flags/atom_flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ DEFINE_BITFIELD(pass_flags_self, list(
BITFIELD(ATOM_PASS_BUCKLED),
))

//? /atom/movable movement_type - only one should be on the atom at a time, but these are flags for quick checks.
//? /atom/movable movement_type - only one primary type should be on the atom at a time, but these are flags for quick checks.
/// Can not be stopped from moving from Cross(), CanPass(), or Uncross() failing. Still bumps everything it passes through, though.
#define MOVEMENT_UNSTOPPABLE (1<<0)
/// Ground movement.
Expand Down
29 changes: 29 additions & 0 deletions code/__DEFINES/dcs/components/slippery.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//* This file is explicitly licensed under the MIT license. *//
//* Copyright (c) 2024 Citadel Station developers. *//

/**
* Slip classes
*
* Despite being defined in the component file, this may be used basically everywhere.
*/

/// water slip
#define SLIP_CLASS_WATER (1<<0)
/// lube slip
#define SLIP_CLASS_LUBRICANT (1<<1)
/// oil slip
///
/// * sensically this is just weaker [SLIP_CLASS_LUBRICANT]
#define SLIP_CLASS_OIL (1<<2)
/// no-grav / no-friction slips
///
/// * used for very futuristic slips
#define SLIP_CLASS_KINESIS (1<<3)
/// ice-like surfaces
#define SLIP_CLASS_ICE (1<<4)
/// foam surfaces
///
/// * not necessarily as bad as [SLIP_CLASS_OIL] but also specialized
#define SLIP_CLASS_FOAM (1<<5)

// todo: DEFINE_BITFIELD_NEW
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
* * All signals send the source datum of the signal as the first argument
*/

/// From base of atom/Entered(): (atom/movable/arrived, atom/old_loc, list/atom/old_locs)
/// From base of atom/Entered(): (atom/movable/arrived, atom/old_loc)
/// If you hook this and need to intercept movement, always check if the atom is still in us. If something else is intercepting movement, bad things will happen as the component signal will not stop propagating.
// todo: this does not support multi-tile objects well
#define COMSIG_ATOM_ENTERED "atom_entered"
/// From base of atom/Exited(): (atom/movable/gone, atom/new_loc)
/// If you hook this and need to intercept movement, always check if the atom is still in us. If something else is intercepting movement, bad things will happen as the component signal will not stop propagating.
// todo: this does not support multi-tile objects well
#define COMSIG_ATOM_EXITED "atom_exited"
/// From base of atom/Bumped(): (/atom/movable)
#define COMSIG_ATOM_BUMPED "atom_bumped"
Expand Down
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.3"
#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
14 changes: 0 additions & 14 deletions code/__DEFINES/traits/atoms.dm
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
//? movement
/// flying
/// use add/remove_atom_flying() to modify
#define TRAIT_ATOM_FLYING "atom_flying"
DATUM_TRAIT(/atom, TRAIT_ATOM_FLYING)
/// phsaing
/// use add/remove_atom_phasing() to modify
#define TRAIT_ATOM_PHASING "atom_phasing"
DATUM_TRAIT(/atom, TRAIT_ATOM_PHASING)
/// floating
/// use add/remove_atom_floating() to modify
#define TRAIT_ATOM_FLOATING "atom_floating"
DATUM_TRAIT(/atom, TRAIT_ATOM_FLOATING)

//? radiation

/// block contents radiation
Expand Down
Loading

0 comments on commit 70954c2

Please sign in to comment.