Skip to content

Commit

Permalink
Merge branch 'master' into facehugger-funny
Browse files Browse the repository at this point in the history
  • Loading branch information
xDanilcusx committed Feb 16, 2024
2 parents d76f7d8 + f9d6d50 commit dd35014
Show file tree
Hide file tree
Showing 102 changed files with 1,270 additions and 828 deletions.
29 changes: 21 additions & 8 deletions 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 "6.7.0"
#define TGS_DMAPI_VERSION "7.0.2"

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

Expand Down Expand Up @@ -73,12 +73,12 @@
#define TGS_EVENT_REPO_MERGE_PULL_REQUEST 3
/// Before the repository makes a sychronize operation. Parameters: Absolute repostiory path.
#define TGS_EVENT_REPO_PRE_SYNCHRONIZE 4
/// Before a BYOND install operation begins. Parameters: [/datum/tgs_version] of the installing BYOND.
#define TGS_EVENT_BYOND_INSTALL_START 5
/// When a BYOND install operation fails. Parameters: Error message
#define TGS_EVENT_BYOND_INSTALL_FAIL 6
/// When the active BYOND version changes. Parameters: (Nullable) [/datum/tgs_version] of the current BYOND, [/datum/tgs_version] of the new BYOND.
#define TGS_EVENT_BYOND_ACTIVE_VERSION_CHANGE 7
/// Before a engine install operation begins. Parameters: Version string of the installing engine.
#define TGS_EVENT_ENGINE_INSTALL_START 5
/// When a engine install operation fails. Parameters: Error message
#define TGS_EVENT_ENGINE_INSTALL_FAIL 6
/// When the active engine version changes. Parameters: (Nullable) Version string of the current engine, version string of the new engine.
#define TGS_EVENT_ENGINE_ACTIVE_VERSION_CHANGE 7
/// When the compiler starts running. Parameters: Game directory path, origin commit SHA.
#define TGS_EVENT_COMPILE_START 8
/// When a compile is cancelled. No parameters.
Expand Down Expand Up @@ -108,7 +108,7 @@
// #define TGS_EVENT_DREAM_DAEMON_LAUNCH 22
/// After a single submodule update is performed. Parameters: Updated submodule name.
#define TGS_EVENT_REPO_SUBMODULE_UPDATE 23
/// After CodeModifications are applied, before DreamMaker is run. Parameters: Game directory path, origin commit sha, byond version.
/// After CodeModifications are applied, before DreamMaker is run. Parameters: Game directory path, origin commit sha, version string of the used engine.
#define TGS_EVENT_PRE_DREAM_MAKER 24
/// Whenever a deployment folder is deleted from disk. Parameters: Game directory path.
#define TGS_EVENT_DEPLOYMENT_CLEANUP 25
Expand All @@ -122,6 +122,7 @@
/// The watchdog will restart on reboot.
#define TGS_REBOOT_MODE_RESTART 2

// Note that security levels are currently meaningless in OpenDream
/// DreamDaemon Trusted security level.
#define TGS_SECURITY_TRUSTED 0
/// DreamDaemon Safe security level.
Expand All @@ -136,6 +137,11 @@
/// DreamDaemon invisible visibility level.
#define TGS_VISIBILITY_INVISIBLE 2

/// The Build Your Own Net Dream engine.
#define TGS_ENGINE_TYPE_BYOND 0
/// The OpenDream engine.
#define TGS_ENGINE_TYPE_OPENDREAM 1

//REQUIRED HOOKS

/**
Expand Down Expand Up @@ -420,6 +426,7 @@

/**
* Send a message to connected chats. This function may sleep!
* If TGS is offline when called, the message may be placed in a queue to be sent and this function will return immediately. Your message will be sent when TGS reconnects to the game.
*
* message - The [/datum/tgs_message_content] to send.
* admin_only: If [TRUE], message will be sent to admin connected chats. Vice-versa applies.
Expand All @@ -429,6 +436,7 @@

/**
* Send a private message to a specific user. This function may sleep!
* If TGS is offline when called, the message may be placed in a queue to be sent and this function will return immediately. Your message will be sent when TGS reconnects to the game.
*
* message - The [/datum/tgs_message_content] to send.
* user: The [/datum/tgs_chat_user] to PM.
Expand All @@ -438,6 +446,7 @@

/**
* Send a message to connected chats that are flagged as game-related in TGS. This function may sleep!
* If TGS is offline when called, the message may be placed in a queue to be sent and this function will return immediately. Your message will be sent when TGS reconnects to the game.
*
* message - The [/datum/tgs_message_content] to send.
* channels - Optional list of [/datum/tgs_chat_channel]s to restrict the message to.
Expand All @@ -449,6 +458,10 @@
/world/proc/TgsVersion()
return

/// Returns the running engine type
/world/proc/TgsEngine()
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()
return
Expand Down
5 changes: 4 additions & 1 deletion code/__DEFINES/xeno_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ PROBABILITY CALCULATIONS ARE HERE

#define XENO_SLASH 80

#define XENO_DOOR_BUILDING_CHANCE 25
#define XENO_DOOR_BUILDING_CHANCE 40

#define PLASMA_RETREAT_PERCENTAGE 10
#define HEALTH_RETREAT_PERCENTAGE 20
Expand Down Expand Up @@ -91,3 +91,6 @@ PROBABILITY CALCULATIONS ARE HERE

/// Special blockers for pathfinding or obstacle handling
#define XENO_AI_SPECIAL_BLOCKERS list(/obj/flamer_fire, /obj/vehicle/multitile, /turf/open/space)

// Friend-or-foe universal check
#define IS_SAME_HIVENUMBER(A,B) (A.hivenumber == B.hivenumber)
5 changes: 2 additions & 3 deletions code/datums/ammo/bullet/rifle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@
name = "depleted uranium bullet"

damage = 60
penetration = ARMOR_PENETRATION_TIER_10
var/acid_per_hit = 15 //woe, toxin upon ye
penetration = ARMOR_PENETRATION_TIER_5

/datum/ammo/bullet/rifle/m4ra/du/set_bullet_traits()
. = ..()
Expand All @@ -201,7 +200,7 @@
))

/datum/ammo/bullet/rifle/m4ra/du/on_hit_mob(mob/target, obj/projectile/fired_proj)
target.AddComponent(/datum/component/toxic_buildup, acid_per_hit)
target.AddComponent(/datum/component/toxic_buildup)
knockback(target, fired_proj, max_range = 2)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
return FALSE

processing_xeno.current_target = parent
processing_xeno.resting = FALSE
processing_xeno.set_resting(FALSE, FALSE, TRUE)
if(prob(5))
processing_xeno.emote("hiss")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,21 @@ GLOBAL_LIST_EMPTY(all_ai_behavior_overrides)
game_master.images -= behavior_image

QDEL_NULL(behavior_image)

for(var/assigned_xeno in currently_assigned)
UnregisterSignal(assigned_xeno, COMSIG_PARENT_QDELETING)
currently_assigned = null

. = ..()

/// Override this to check if we want our behavior to be valid for the checked_xeno, passes the common factor of "distance" which is the distance between the checked_xeno and src parent
/datum/component/ai_behavior_override/proc/check_behavior_validity(mob/living/carbon/xenomorph/checked_xeno, distance)
if(length(currently_assigned) >= max_assigned && !(checked_xeno in currently_assigned))
remove_from_queue(checked_xeno)
return FALSE

if(checked_xeno.stat != CONSCIOUS)
remove_from_queue(checked_xeno)
return FALSE

return TRUE
Expand All @@ -51,6 +59,14 @@ GLOBAL_LIST_EMPTY(all_ai_behavior_overrides)
/datum/component/ai_behavior_override/proc/process_override_behavior(mob/living/carbon/xenomorph/processing_xeno, delta_time)
SHOULD_NOT_SLEEP(TRUE)

RegisterSignal(processing_xeno, COMSIG_PARENT_QDELETING, PROC_REF(remove_from_queue), TRUE)
currently_assigned |= processing_xeno

return TRUE

/datum/component/ai_behavior_override/proc/remove_from_queue(mob/removed_xeno)
SIGNAL_HANDLER
if(currently_assigned)
currently_assigned -= removed_xeno

UnregisterSignal(removed_xeno, COMSIG_PARENT_QDELETING)
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@
qdel(src)
return FALSE

var/area/current_area = get_area(location)
if(!current_area.is_resin_allowed)
for(var/client/game_master in GLOB.game_masters)
to_chat(game_master, SPAN_XENOBOLDNOTICE("This area doesn't allow xenos to build here"))

qdel(src)
return FALSE

if(distance > 10)
return FALSE

Expand All @@ -46,9 +54,8 @@

if(checked_xeno.get_plasma_percentage() < PLASMA_RETREAT_PERCENTAGE)
var/turf/xeno_loc = get_turf(checked_xeno)
if(xeno_loc.weeds && !checked_xeno.resting)
currently_assigned -= checked_xeno
checked_xeno.lay_down()
if(xeno_loc.weeds)
checked_xeno.set_resting(TRUE, FALSE, TRUE)

return FALSE

Expand All @@ -59,16 +66,21 @@
if(!.)
return

processing_xeno.resting = FALSE
processing_xeno.set_resting(FALSE, FALSE, TRUE)

var/turf/xeno_loc = get_turf(processing_xeno)
if(xeno_loc.density)
return FALSE // We shouldn't stand in a wall, let's act default

var/turf/parent_turf = get_turf(parent)
var/distance = get_dist(processing_xeno, parent)

var/list/turfs_around = xeno_loc.AdjacentTurfs()
if(turfs_around && distance < 1) // We are gonna be stuck after building at our loc, let's step away
return processing_xeno.move_to_next_turf(pick(turfs_around))

var/is_diagonal = (get_dir(processing_xeno, parent_turf) in diagonals)
if(is_diagonal || get_dist(processing_xeno, parent) > 1)
if(is_diagonal || distance > 1)
return processing_xeno.move_to_next_turf(parent_turf)

for(var/obj/structure/blocker in parent_turf.contents)
Expand All @@ -84,19 +96,23 @@
var/list/resin_types = processing_xeno.resin_build_order
processing_xeno.selected_resin = locate(/datum/resin_construction/resin_turf/wall) in resin_types

var/wall_nearby
var/wall_nearby = FALSE
var/blocked_turfs = 0
for(var/turf/blocked_turf in orange(1, parent_turf) - parent_turf.AdjacentTurfs())
blocked_turfs++

if(get_dir(blocked_turf, parent_turf) in diagonals)
continue

if(blocked_turf.density)
wall_nearby = TRUE

blocked_turfs++
var/obj/effect/alien/weeds/turf_weeds = blocked_turf.weeds
if(turf_weeds && turf_weeds.secreting)
wall_nearby = TRUE // Something is being constructed nearby, let's bet this is a new resin wall

if(blocked_turfs)
if(prob(XENO_DOOR_BUILDING_CHANCE) || (wall_nearby && blocked_turfs == 2))
if(wall_nearby)
if(prob(XENO_DOOR_BUILDING_CHANCE) || (wall_nearby && blocked_turfs > 1))
processing_xeno.selected_resin = locate(/datum/resin_construction/resin_obj/door) in resin_types

var/datum/action/xeno_action/activable/secrete_resin/build_action = locate() in processing_xeno.actions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
/datum/component/ai_behavior_override/capture/Initialize(...)
. = ..()

if(!istype(parent, /mob))
return COMPONENT_INCOMPATIBLE
if(!ishuman(parent))
var/mob/living/carbon/human/new_parent = locate() in get_turf(parent)
if(new_parent)
new_parent.AddComponent(/datum/component/ai_behavior_override/capture)

if(isxeno(parent))
return COMPONENT_INCOMPATIBLE

/datum/component/ai_behavior_override/capture/check_behavior_validity(mob/living/carbon/xenomorph/checked_xeno, distance)
Expand All @@ -23,10 +24,10 @@

var/mob/parent_mob = parent

var/stat = parent_mob.stat
var/captee_stat = parent_mob.stat
var/mob/pulledby = parent_mob.pulledby

if(stat == DEAD)
if(captee_stat == DEAD)
qdel(src)
return FALSE

Expand All @@ -44,7 +45,7 @@
if(distance > 10)
return FALSE

if(stat == CONSCIOUS)
if(captee_stat == CONSCIOUS)
return FALSE

if(isxeno(pulledby) && pulledby != checked_xeno)
Expand All @@ -58,7 +59,7 @@
return

processing_xeno.current_target = parent
processing_xeno.resting = FALSE
processing_xeno.set_resting(FALSE, FALSE, TRUE)

if(processing_xeno.get_active_hand())
processing_xeno.swap_hand()
Expand Down
6 changes: 1 addition & 5 deletions code/datums/pain/_pain.dm
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,7 @@
activate_severe()

if(new_level < PAIN_LEVEL_SEVERE)
UnregisterSignal(source_mob, list(
COMSIG_MOB_DRAGGED,
COMSIG_MOB_DEVOURED,
COMSIG_MOVABLE_PRE_THROW
))
UnregisterSignal(source_mob, COMSIG_MOB_DEVOURED)

last_level = new_level
addtimer(CALLBACK(src, PROC_REF(before_update)), PAIN_UPDATE_FREQUENCY)
Expand Down
4 changes: 4 additions & 0 deletions code/game/gamemodes/colonialmarines/ai/colonialmarines_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@

. = ..()

/datum/game_mode/colonialmarines/ai/post_setup()
set_lz_resin_allowed(TRUE)
return ..()

/datum/game_mode/colonialmarines/ai/announce_bioscans()
return

Expand Down
4 changes: 3 additions & 1 deletion code/game/machinery/vending/vendor_types/crew/medical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ GLOBAL_LIST_INIT(cm_vending_clothing_doctor, list(
list("UNIFORM (CHOOSE 1)", 0, null, null, null),
list("Green Scrubs", 0, /obj/item/clothing/under/rank/medical/green, MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_RECOMMENDED),
list("Blue Scrubs", 0, /obj/item/clothing/under/rank/medical/blue, MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_REGULAR),
list("Light Blue Scrubs", 0, /obj/item/clothing/under/rank/medical/lightblue, MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_REGULAR),
list("Purple Scrubs", 0, /obj/item/clothing/under/rank/medical/purple, MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_REGULAR),

list("ARMOR (CHOOSE 1)", 0, null, null, null),
Expand Down Expand Up @@ -96,7 +97,7 @@ GLOBAL_LIST_INIT(cm_vending_clothing_nurse, list(
list("Green Scrubs", 0, /obj/item/clothing/under/rank/medical/green, MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_RECOMMENDED),
list("Blue Scrubs", 0, /obj/item/clothing/under/rank/medical/blue, MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_REGULAR),
list("Purple Scrubs", 0, /obj/item/clothing/under/rank/medical/purple, MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_REGULAR),
list("Medical Nurse Scrubs", 0, /obj/item/clothing/under/rank/medical/nurse, MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_MANDATORY),
list("Light Blue Scrubs", 0, /obj/item/clothing/under/rank/medical/lightblue, MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_MANDATORY),

list("ARMOR (CHOOSE 1)", 0, null, null, null),
list("Labcoat", 0, /obj/item/clothing/suit/storage/labcoat, MARINE_CAN_BUY_ARMOR, VENDOR_ITEM_REGULAR),
Expand Down Expand Up @@ -152,6 +153,7 @@ GLOBAL_LIST_INIT(cm_vending_clothing_researcher, list(
list("UNIFORM (CHOOSE 1)", 0, null, null, null),
list("Green Scrubs", 0, /obj/item/clothing/under/rank/medical/green, MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_RECOMMENDED),
list("Blue Scrubs", 0, /obj/item/clothing/under/rank/medical/blue, MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_REGULAR),
list("Light Blue Scrubs", 0, /obj/item/clothing/under/rank/medical/lightblue, MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_REGULAR),
list("Purple Scrubs", 0, /obj/item/clothing/under/rank/medical/purple, MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_REGULAR),
list("Researcher Uniform", 0, /obj/item/clothing/under/marine/officer/researcher, MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_MANDATORY),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ GLOBAL_LIST_INIT(cm_vending_clothing_cmo, list(
list("UNIFORM (CHOOSE 1)", 0, null, null, null),
list("Green Scrubs", 0, /obj/item/clothing/under/rank/medical/green, MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_RECOMMENDED),
list("Blue Scrubs", 0, /obj/item/clothing/under/rank/medical/blue, MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_REGULAR),
list("Light Blue Scrubs", 0, /obj/item/clothing/under/rank/medical/lightblue, MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_REGULAR),
list("Purple Scrubs", 0, /obj/item/clothing/under/rank/medical/purple, MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_REGULAR),
list("Doctor Uniform", 0, /obj/item/clothing/under/rank/medical, MARINE_CAN_BUY_UNIFORM, VENDOR_ITEM_REGULAR),

Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/vending/vendor_types/crew/synthetic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ GLOBAL_LIST_INIT(cm_vending_clothing_synth, list(
GLOBAL_LIST_INIT(cm_vending_clothing_synth_snowflake, list(
list("USCM UNIFORMS", 0, null, null, null),
list("Medical Scrubs, Blue", 12, /obj/item/clothing/under/rank/medical/blue, null, VENDOR_ITEM_REGULAR),
list("Medical Scrubs, Light Blue", 0, /obj/item/clothing/under/rank/medical/lightblue, null, VENDOR_ITEM_REGULAR),
list("Medical Scrubs, Green", 12, /obj/item/clothing/under/rank/medical/green, null, VENDOR_ITEM_REGULAR),
list("Medical Scrubs, Purple", 12, /obj/item/clothing/under/rank/medical/purple, null, VENDOR_ITEM_REGULAR),
list("Medical Scrubs, White", 12, /obj/item/clothing/under/rank/medical, null, VENDOR_ITEM_REGULAR),
Expand Down
12 changes: 0 additions & 12 deletions code/game/objects/items/devices/helmet_visors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,6 @@
name = "advanced medical optic"
helmet_overlay = "med_sight_left"

/obj/item/device/helmet_visor/medical/advanced/activate_visor(obj/item/clothing/head/helmet/marine/attached_helmet, mob/living/carbon/human/user)
. = ..()

var/datum/action/item_action/view_publications/helmet_visor/publication_action = new(attached_helmet)
publication_action.give_to(user)

/obj/item/device/helmet_visor/medical/advanced/deactivate_visor(obj/item/clothing/head/helmet/marine/attached_helmet, mob/living/carbon/human/user)
. = ..()

var/datum/action/item_action/view_publications/helmet_visor/publication_action = locate() in attached_helmet.actions
qdel(publication_action)

/obj/item/device/helmet_visor/medical/advanced/can_toggle(mob/living/carbon/human/user)
. = ..()
if(!.)
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/storage/belt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1526,8 +1526,8 @@
/obj/item/storage/belt/gun/flaregun
name = "\improper M276 pattern M82F flare gun holster rig"
desc = "The M276 is the standard load-bearing equipment of the USCM. It consists of a modular belt with various clips. This version is for the M82F flare gun."
storage_slots = 17
max_storage_space = 20
storage_slots = 28
max_storage_space = 31
icon_state = "m82f_holster"
item_state = "s_marinebelt"
can_hold = list(
Expand Down
Loading

0 comments on commit dd35014

Please sign in to comment.