Skip to content

Commit

Permalink
Merge branch 'cmss13-devs:master' into USASF_Air
Browse files Browse the repository at this point in the history
  • Loading branch information
IroquoisLou authored Dec 24, 2024
2 parents 3e81249 + f6f3747 commit f01c0c0
Show file tree
Hide file tree
Showing 125 changed files with 814 additions and 429 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ sound/music/walkman/*/*.ogg
sound/music/walkman/*.txt
icons/custom/*
maps/**/backup
maps/templates.dm
*.before
__pycache__
test_environment.txt
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
#define AREA_UNWEEDABLE (1<<4)
/// Flags the area as having purpose by the Yautja, and exempt from gear tracking.
#define AREA_YAUTJA_GROUNDS (1<<5)
/// Flags the area as a hunting grounds for the Yautja, sometimes blocking game interaction.
#define AREA_YAUTJA_HUNTING_GROUNDS (1<<6)

/// Default number of ticks for do_after
#define DA_DEFAULT_NUM_TICKS 5

Expand Down
29 changes: 28 additions & 1 deletion code/__DEFINES/tgs.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 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.3.0"
#define TGS_DMAPI_VERSION "7.3.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 @@ -58,6 +58,11 @@
#define TGS_FILE2TEXT_NATIVE file2text
#endif

// SpacemanDMM compatibility
#ifndef CAN_BE_REDEFINED
#define CAN_BE_REDEFINED(X)
#endif

// EVENT CODES

/// Before a reboot mode change, extras parameters are the current and new reboot mode enums.
Expand Down Expand Up @@ -160,6 +165,7 @@
* * 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, datum/tgs_http_handler/http_handler)
CAN_BE_REDEFINED(TRUE)
return

/**
Expand All @@ -170,13 +176,15 @@
* This function should not be called before ..() in [/world/proc/New].
*/
/world/proc/TgsInitializationComplete()
CAN_BE_REDEFINED(TRUE)
return

/// 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

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

// DATUM DEFINITIONS
Expand Down Expand Up @@ -214,6 +222,7 @@
* Returns [TRUE]/[FALSE] based on if the [/datum/tgs_version] contains wildcards.
*/
/datum/tgs_version/proc/Wildcard()
CAN_BE_REDEFINED(TRUE)
return

/**
Expand All @@ -222,6 +231,7 @@
* other_version - The [/datum/tgs_version] to compare against.
*/
/datum/tgs_version/proc/Equals(datum/tgs_version/other_version)
CAN_BE_REDEFINED(TRUE)
return

/// Represents a merge of a GitHub pull request.
Expand Down Expand Up @@ -459,16 +469,19 @@

/// Returns the maximum supported [/datum/tgs_version] of the DMAPI.
/world/proc/TgsMaximumApiVersion()
CAN_BE_REDEFINED(TRUE)
return

/// Returns the minimum supported [/datum/tgs_version] of the DMAPI.
/world/proc/TgsMinimumApiVersion()
CAN_BE_REDEFINED(TRUE)
return

/**
* Returns [TRUE] if DreamDaemon was launched under TGS, the API matches, and was properly initialized. [FALSE] will be returned otherwise.
*/
/world/proc/TgsAvailable()
CAN_BE_REDEFINED(TRUE)
return

// No function below this succeeds if it TgsAvailable() returns FALSE or if TgsNew() has yet to be called.
Expand All @@ -480,6 +493,7 @@
* If TGS has not requested a [TGS_REBOOT_MODE_SHUTDOWN] DreamDaemon will be launched again.
*/
/world/proc/TgsEndProcess()
CAN_BE_REDEFINED(TRUE)
return

/**
Expand All @@ -490,6 +504,7 @@
* admin_only: If [TRUE], message will be sent to admin connected chats. Vice-versa applies.
*/
/world/proc/TgsTargetedChatBroadcast(datum/tgs_message_content/message, admin_only = FALSE)
CAN_BE_REDEFINED(TRUE)
return

/**
Expand All @@ -500,6 +515,7 @@
* user: The [/datum/tgs_chat_user] to PM.
*/
/world/proc/TgsChatPrivateMessage(datum/tgs_message_content/message, datum/tgs_chat_user/user)
CAN_BE_REDEFINED(TRUE)
return

/**
Expand All @@ -510,42 +526,52 @@
* channels - Optional list of [/datum/tgs_chat_channel]s to restrict the message to.
*/
/world/proc/TgsChatBroadcast(datum/tgs_message_content/message, list/channels = null)
CAN_BE_REDEFINED(TRUE)
return

/// Returns the current [/datum/tgs_version] of TGS if it is running the server, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsVersion()
CAN_BE_REDEFINED(TRUE)
return

/// Returns the running engine type
/world/proc/TgsEngine()
CAN_BE_REDEFINED(TRUE)
return

/// Returns the current [/datum/tgs_version] of the DMAPI being used if it was activated, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsApiVersion()
CAN_BE_REDEFINED(TRUE)
return

/// Returns the name of the TGS instance running the game if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsInstanceName()
CAN_BE_REDEFINED(TRUE)
return

/// Return the current [/datum/tgs_revision_information] of the running server if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsRevision()
CAN_BE_REDEFINED(TRUE)
return

/// Returns the current BYOND security level as a TGS_SECURITY_ define if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsSecurityLevel()
CAN_BE_REDEFINED(TRUE)
return

/// Returns the current BYOND visibility level as a TGS_VISIBILITY_ define if TGS is present, null otherwise. Requires TGS to be using interop API version 5 or higher otherwise the string "___unimplemented" wil be returned. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsVisibility()
CAN_BE_REDEFINED(TRUE)
return

/// Returns a list of active [/datum/tgs_revision_information/test_merge]s if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsTestMerges()
CAN_BE_REDEFINED(TRUE)
return

/// Returns a list of connected [/datum/tgs_chat_channel]s if TGS is present, null otherwise. This function may sleep if the call to [/world/proc/TgsNew] is sleeping!
/world/proc/TgsChatChannelInfo()
CAN_BE_REDEFINED(TRUE)
return

/**
Expand All @@ -556,6 +582,7 @@
* 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)
CAN_BE_REDEFINED(TRUE)
return

/*
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ world
A.overlays.Remove(src)

/mob/proc/flick_heal_overlay(time, color = "#00FF00") //used for warden and queen healing
var/image/I = image('icons/mob/mob.dmi', src, "heal_overlay")
var/image/I = image('icons/mob/do_afters.dmi', src, "heal_overlay")
switch(icon_size)
if(48)
I.pixel_x = 8
Expand Down
5 changes: 4 additions & 1 deletion code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1694,12 +1694,15 @@ GLOBAL_LIST_INIT(duplicate_forbidden_vars,list(

/// Returns TRUE if the target is somewhere that the game should not interact with if possible
/// In this case, admin Zs and tutorial areas
/proc/should_block_game_interaction(atom/target)
/proc/should_block_game_interaction(atom/target, include_hunting_grounds = FALSE)
if(is_admin_level(target.z))
return TRUE

var/area/target_area = get_area(target)
if(target_area?.block_game_interaction)
return TRUE

if(include_hunting_grounds && target_area?.flags_area & AREA_YAUTJA_HUNTING_GROUNDS)
return TRUE

return FALSE
2 changes: 1 addition & 1 deletion code/game/area/hunting_preserve.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
icon_state = "green"
ambience_exterior = AMBIENCE_JUNGLE
weather_enabled = FALSE
flags_area = AREA_NOTUNNEL|AREA_AVOID_BIOSCAN|AREA_YAUTJA_GROUNDS
flags_area = AREA_NOTUNNEL|AREA_AVOID_BIOSCAN|AREA_YAUTJA_GROUNDS|AREA_YAUTJA_HUNTING_GROUNDS
resin_construction_allowed = FALSE
can_build_special = FALSE
is_resin_allowed = TRUE
Expand Down
2 changes: 0 additions & 2 deletions code/game/jobs/job/marine/squads.dm
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//This datum keeps track of individual squads. New squads can be added without any problem but to give them
//access you must add them individually to access.dm with the other squads. Just look for "access_alpha" and add the new one

//Note: some important procs are held by the job controller, in job_controller.dm.
//In particular, get_lowest_squad() and randomize_squad()
/datum/squad_type //Majority of this is for a follow-on PR to fully flesh the system out and add more bits for other factions.
var/name = "Squad Type"
var/lead_name
Expand Down
7 changes: 2 additions & 5 deletions code/game/jobs/role_authority.dm
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou
for(var/datum/squad/squad in squads)
if(squad.roundstart && squad.usable && squad.faction == human.faction && squad.name != "Root")
mixed_squads += squad
mixed_squads = shuffle(mixed_squads)

var/preferred_squad
if(human?.client?.prefs?.preferred_squad)
Expand All @@ -556,11 +557,7 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou
if(squad.roles_in[slot_check] >= squad.roles_cap[slot_check])
continue

if(preferred_squad == "None")
if(squad.put_marine_in_squad(human))
return

else if(squad.name == preferred_squad || squad.equivalent_name == preferred_squad) //fav squad or faction equivalent has a spot for us, no more searching needed.
if(squad.name == preferred_squad || squad.equivalent_name == preferred_squad) //fav squad or faction equivalent has a spot for us, no more searching needed.
if(squad.put_marine_in_squad(human))
return

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/camera_console.dm
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
if(inoperable())
return
if(show_message_above_tv)
langchat_speech(emote, get_mobs_in_view(7, src), null, null, TRUE, LANGCHAT_FAST_POP, list("emote"))
langchat_speech(emote, get_mobs_in_view(7, src), skip_language_check = TRUE, animation_style = LANGCHAT_FAST_POP, additional_styles = list("emote"))
for(var/datum/weakref/user_ref in concurrent_users)
var/mob/user = user_ref.resolve()
if(user?.client?.prefs && (user.client.prefs.toggles_langchat & LANGCHAT_SEE_EMOTES) && (!audible || !user.ear_deaf))
Expand Down
Loading

0 comments on commit f01c0c0

Please sign in to comment.