Skip to content

Commit

Permalink
Merge branch 'master' into corpse
Browse files Browse the repository at this point in the history
  • Loading branch information
BOBAMAx committed Nov 1, 2024
2 parents be38163 + 539a7b1 commit 4573580
Show file tree
Hide file tree
Showing 52 changed files with 4,868 additions and 3,610 deletions.
7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
/tools/docker/ @Fira
/Dockerfile @Fira

# Forest2001

/code/game/machinery/ARES @realforest2001
/tgui/packages/tgui/interfaces/AresAdmin.jsx @realforest2001
/tgui/packages/tgui/interfaces/AresInterface.jsx @realforest2001
/tgui/packages/tgui/interfaces/WorkingJoe.jsx @realforest2001

# Nanu

/maps @Nanu308
Expand Down
6 changes: 6 additions & 0 deletions code/controllers/configuration/entries/general.dm
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,12 @@ The default value assumes youtube-dl is in your system PATH
/datum/config_entry/string/invoke_youtubedl
protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN

/datum/config_entry/string/cobalt_base_api
protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN


/datum/config_entry/string/cobalt_api_key
protection = CONFIG_ENTRY_LOCKED | CONFIG_ENTRY_HIDDEN

/datum/config_entry/number/error_cooldown // The "cooldown" time for each occurrence of a unique error
config_entry_value = 600
Expand Down
5 changes: 3 additions & 2 deletions code/datums/ammo/rocket.dm
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,9 @@

/datum/ammo/rocket/custom
name = "custom rocket"
accurate_range = 8
max_range = 8
accuracy = HIT_ACCURACY_TIER_5
accurate_range = 7
max_range = 7

/datum/ammo/rocket/custom/proc/prime(atom/atom, obj/projectile/projectile)
var/obj/item/weapon/gun/launcher/rocket/launcher = projectile.shot_from
Expand Down
112 changes: 112 additions & 0 deletions code/datums/internet_media.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/**
* Generic implementation to get a URL that can be sent to
* clients to play audio via [/datum/tgui_panel/proc/play_music], from a provided URL
*/
/datum/internet_media
/**
* If we have encountered an error while attempting to retrieve the URL
*/
var/error

/**
* Handles a request for an audio file, from a provided media URL
* Must return a [/datum/media_response], which must have at least the [/datum/media_response/var/url] filled out
*
* If we are not returning a media_response, set the [/datum/internet_media/var/error] to be an error
*/
/datum/internet_media/proc/get_media(url)
RETURN_TYPE(/datum/media_response)

CRASH("[type] does not override [nameof(__PROC__)].")

/datum/internet_media/yt_dlp

/datum/internet_media/yt_dlp/get_media(url)
var/ytdl = CONFIG_GET(string/invoke_youtubedl)
if(!ytdl)
error = "Youtube-dl FAILED: Not configured"
return

if(findtext(url, ":") && !findtext(url, GLOB.is_http_protocol))
error = "Youtube-dl FAILED: Non-http(s) URIs are not allowed. For youtube-dl shortcuts like ytsearch: please use the appropriate full url from the website."
return

var/list/output = world.shelleo("[ytdl] --geo-bypass --format \"bestaudio\[ext=mp3]/best\[ext=mp4]\[height<=360]/bestaudio\[ext=m4a]/bestaudio\[ext=aac]\" --dump-single-json --no-playlist -- \"[shell_url_scrub(url)]\"")
var/errorlevel = output[SHELLEO_ERRORLEVEL]
var/stdout = output[SHELLEO_STDOUT]
var/stderr = output[SHELLEO_STDERR]

if(errorlevel)
error = "Youtube-dl URL retrieval FAILED: [stderr]"
return

var/data

try
data = json_decode(stdout)
catch(var/exception/decode_error)
error = "Youtube-dl JSON parsing FAILED: [decode_error]: [stdout]"
return

return new /datum/media_response(data["url"], data["title"], data["start_time"], data["end_time"])

/datum/internet_media/cobalt

/datum/internet_media/cobalt/get_media(url)
var/cobalt = CONFIG_GET(string/cobalt_base_api)
if(!cobalt)
error = "cobalt.tools FAILED: Not configured"
return

var/list/headers = list()
headers["Accept"] = "application/json"
headers["Content-Type"] = "application/json"

var/auth_key = CONFIG_GET(string/cobalt_api_key)
if(auth_key)
headers["Authorization"] = "Api-Key [auth_key]"

var/datum/http_request/request = new
request.prepare(RUSTG_HTTP_METHOD_POST, cobalt, json_encode(list(
"url" = url,
"downloadMode" = "audio"
)), headers)

request.execute_blocking()

var/datum/http_response/response_raw = request.into_response()

if(response_raw.errored)
error = "cobalt.tools web request FAILED: [response_raw.error]"
return

var/list/response
try
response = json_decode(response_raw.body)
catch(var/exception/decode_error)
error = "cobalt.tools JSON parsing FAILED: [decode_error]: [response_raw.body]"
return

if(!(response["status"] in list("redirect", "tunnel")))
error = "cobalt.tools request FAILED - invalid response: [response_raw.body]"
return

return new /datum/media_response(response["url"])

/datum/media_response
var/url
var/title
var/start_time
var/end_time

/datum/media_response/New(url, title, start_time, end_time)
if(isnull(url))
CRASH("/datum/media_response created without a URL field.")

src.url = url
src.title = title
src.start_time = start_time
src.end_time = end_time

/datum/media_response/proc/get_list()
return list("url" = url, "title" = title, "start_time" = start_time, "end_time" = end_time)
1 change: 1 addition & 0 deletions code/datums/mob_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list(
holder2.icon_state = "huddeaddefib"
holder3.icon_state = "huddead"
holder2_set = 1
update_minimap_icon()
else
if(is_heart_broken()) // broken heart icon
holder.icon_state = "huddeadheart"
Expand Down
5 changes: 4 additions & 1 deletion code/game/machinery/cryopod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ GLOBAL_LIST_INIT(frozen_items, list(SQUAD_MARINE_1 = list(), SQUAD_MARINE_2 = li

item_loop:
for(var/obj/item/W in items)
if(((W.flags_inventory & CANTSTRIP) || (W.flags_item & NODROP) || (W.flags_item & NO_CRYO_STORE)) && !gearless_role(occupant)) //We don't keep donor items, undroppable/unremovable items, and specifically filtered items
if((W.flags_inventory & CANTSTRIP) || (W.flags_item & NODROP) || (W.flags_item & NO_CRYO_STORE) || gearless_role(occupant)) //We don't keep donor items, undroppable/unremovable items, and specifically filtered items
if(istype(W, /obj/item/clothing/suit/storage))
var/obj/item/clothing/suit/storage/SS = W
for(var/obj/item/I in SS.pockets) //But we keep stuff inside them
Expand Down Expand Up @@ -321,6 +321,9 @@ GLOBAL_LIST_INIT(frozen_items, list(SQUAD_MARINE_1 = list(), SQUAD_MARINE_2 = li

stripped_items:
for(var/obj/item/A in strippeditems)
if(gearless_role(occupant))
qdel(A)
continue stripped_items
for(var/DAA in deleteall)
if(istype(A, DAA))
qdel(A)
Expand Down
16 changes: 15 additions & 1 deletion code/game/objects/items/devices/radio/headset.dm
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@
to_chat(user, SPAN_NOTICE("This headset doesn't have any encryption keys! How useless..."))

if(istype(W, /obj/item/device/encryptionkey/))
for (var/obj/item/device/encryptionkey/key as anything in keys)
if (istype(key, W.type))
to_chat(user, SPAN_NOTICE("A [W.name] is already installed on this device!"))
return

var/keycount = 0
for (var/obj/item/device/encryptionkey/key in keys)
if(!key.abstract)
Expand Down Expand Up @@ -362,7 +367,16 @@

///Change the minimap icon to a dead icon
/obj/item/device/radio/headset/proc/set_dead_on_minimap(z_level, marker_flags)
SSminimaps.add_marker(wearer, z_level, marker_flags, given_image = wearer.assigned_equipment_preset.get_minimap_icon(wearer), overlay_iconstates = list("defibbable"))
var/icon_to_use
if(world.time > wearer.timeofdeath + wearer.revive_grace_period - 1 MINUTES)
icon_to_use = "defibbable4"
else if(world.time > wearer.timeofdeath + wearer.revive_grace_period - 2 MINUTES)
icon_to_use = "defibbable3"
else if(world.time > wearer.timeofdeath + wearer.revive_grace_period - 3 MINUTES)
icon_to_use = "defibbable2"
else
icon_to_use = "defibbable"
SSminimaps.add_marker(wearer, z_level, marker_flags, given_image = wearer.assigned_equipment_preset.get_minimap_icon(wearer), overlay_iconstates = list(icon_to_use))

///Change the minimap icon to a undefibbable icon
/obj/item/device/radio/headset/proc/set_undefibbable_on_minimap(z_level, marker_flags)
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/explosives/explosive.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
var/max_container_volume = 120
var/current_container_volume = 0
var/assembly_stage = ASSEMBLY_EMPTY //The assembly_stage of the assembly
var/list/reaction_limits = list("max_ex_power" = 175, "base_ex_falloff" = 75, "max_ex_shards" = 32,
"max_fire_rad" = 5, "max_fire_int" = 20, "max_fire_dur" = 24,
var/list/reaction_limits = list("max_ex_power" = 180, "base_ex_falloff" = 80, "max_ex_shards" = 40,
"max_fire_rad" = 5, "max_fire_int" = 25, "max_fire_dur" = 24,
"min_fire_rad" = 1, "min_fire_int" = 3, "min_fire_dur" = 3
)
var/falloff_mode = EXPLOSION_FALLOFF_SHAPE_LINEAR
Expand Down
8 changes: 4 additions & 4 deletions code/game/objects/items/explosives/grenades/chem_grenade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
customizable = TRUE
underslug_launchable = TRUE
allowed_sensors = list(/obj/item/device/assembly/timer)
max_container_volume = 90
matter = list("metal" = 3750)
max_container_volume = 120
matter = list("metal" = 4250)
has_blast_wave_dampener = TRUE

/obj/item/explosive/grenade/custom/prime()
Expand All @@ -22,8 +22,8 @@
icon_state = "large_grenade_custom"
allowed_containers = list(/obj/item/reagent_container/glass)
max_container_volume = 180
reaction_limits = list( "max_ex_power" = 215, "base_ex_falloff" = 90, "max_ex_shards" = 32,
"max_fire_rad" = 5, "max_fire_int" = 20, "max_fire_dur" = 24,
reaction_limits = list( "max_ex_power" = 220, "base_ex_falloff" = 120, "max_ex_shards" = 80,
"max_fire_rad" = 6, "max_fire_int" = 30, "max_fire_dur" = 32,
"min_fire_rad" = 1, "min_fire_int" = 3, "min_fire_dur" = 3
)
underslug_launchable = FALSE
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/explosives/mine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
antigrief_protection = TRUE
allowed_sensors = list(/obj/item/device/assembly/prox_sensor)
max_container_volume = 120
reaction_limits = list( "max_ex_power" = 105, "base_ex_falloff" = 60, "max_ex_shards" = 32,
"max_fire_rad" = 5, "max_fire_int" = 12, "max_fire_dur" = 18,
reaction_limits = list( "max_ex_power" = 100, "base_ex_falloff" = 80, "max_ex_shards" = 40,
"max_fire_rad" = 4, "max_fire_int" = 20, "max_fire_dur" = 18,
"min_fire_rad" = 2, "min_fire_int" = 3, "min_fire_dur" = 3
)
angle = 60
Expand Down
6 changes: 3 additions & 3 deletions code/game/objects/items/explosives/plastic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
w_class = SIZE_SMALL
allowed_sensors = list(/obj/item/device/assembly/prox_sensor, /obj/item/device/assembly/signaller, /obj/item/device/assembly/timer)
max_container_volume = 180
reaction_limits = list( "max_ex_power" = 260, "base_ex_falloff" = 90, "max_ex_shards" = 64,
"max_fire_rad" = 6, "max_fire_int" = 26, "max_fire_dur" = 30,
reaction_limits = list( "max_ex_power" = 280, "base_ex_falloff" = 120, "max_ex_shards" = 100,
"max_fire_rad" = 4, "max_fire_int" = 50, "max_fire_dur" = 20,
"min_fire_rad" = 2, "min_fire_int" = 4, "min_fire_dur" = 5
)

var/deploying_time = 50
var/penetration = 1.5 // How much damage adjacent walls receive
var/penetration = 2 // How much damage adjacent walls receive
var/timer = 10 // detonation time
var/min_timer = 10
var/atom/plant_target = null //which atom the plstique explosive is planted on
Expand Down
8 changes: 4 additions & 4 deletions code/game/objects/items/explosives/warhead.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
max_container_volume = 210
allow_star_shape = FALSE
matter = list("metal" = 11250) //3 sheets
reaction_limits = list( "max_ex_power" = 240, "base_ex_falloff" = 90,"max_ex_shards" = 64,
"max_fire_rad" = 6, "max_fire_int" = 40, "max_fire_dur" = 48,
reaction_limits = list( "max_ex_power" = 220, "base_ex_falloff" = 160,"max_ex_shards" = 80,
"max_fire_rad" = 4, "max_fire_int" = 45, "max_fire_dur" = 48,
"min_fire_rad" = 2, "min_fire_int" = 4, "min_fire_dur" = 5
)
has_blast_wave_dampener = TRUE
Expand All @@ -24,8 +24,8 @@
icon_state = "warhead_mortar"
max_container_volume = 240
matter = list("metal" = 11250) //3 sheets
reaction_limits = list( "max_ex_power" = 360, "base_ex_falloff" = 90, "max_ex_shards" = 128,
"max_fire_rad" = 8, "max_fire_int" = 40, "max_fire_dur" = 48,
reaction_limits = list( "max_ex_power" = 360, "base_ex_falloff" = 130, "max_ex_shards" = 200,
"max_fire_rad" = 8, "max_fire_int" = 45, "max_fire_dur" = 48,
"min_fire_rad" = 3, "min_fire_int" = 5, "min_fire_dur" = 5
)
has_blast_wave_dampener = TRUE
Expand Down
35 changes: 19 additions & 16 deletions code/game/objects/items/storage/firstaid.dm
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,23 @@
maptext_x = 18
maptext_y = 3

var/base_icon = "pill_canister"
var/static/list/possible_colors = list(
"Orange" = "",
"Blue" = "1",
"Yellow" = "2",
"Light Purple" = "3",
"Light Grey" = "4",
"White" = "5",
"Light Green" = "6",
"Cyan" = "7",
"Bordeaux" = "8",
"Aquamarine" = "9",
"Grey" = "10",
"Red" = "11",
"Black" = "12",
)

/obj/item/storage/pill_bottle/Initialize()
. = ..()
if(display_maptext == FALSE)
Expand Down Expand Up @@ -518,28 +535,14 @@
/obj/item/storage/pill_bottle/proc/choose_color(mob/user)
if(!user)
user = usr
var/static/list/possible_colors = list(
"Orange" = "",
"Blue" = "1",
"Yellow" = "2",
"Light Purple" = "3",
"Light Grey" = "4",
"White" = "5",
"Light Green" = "6",
"Cyan" = "7",
"Bordeaux" = "8",
"Aquamarine" = "9",
"Grey" = "10",
"Red" = "11",
"Black" = "12",
)

var/selected_color = tgui_input_list(user, "Select a color.", "Color choice", possible_colors)
if(!selected_color)
return

selected_color = possible_colors[selected_color]

icon_state = "pill_canister" + selected_color
icon_state = base_icon + selected_color
to_chat(user, SPAN_NOTICE("You color [src]."))
update_icon()

Expand Down
Loading

0 comments on commit 4573580

Please sign in to comment.