Skip to content

Commit

Permalink
Merge branch 'dev-sierra' into upstream-pr-34908
Browse files Browse the repository at this point in the history
  • Loading branch information
Lexanx authored Nov 26, 2024
2 parents 92468db + 486829a commit 711efdd
Show file tree
Hide file tree
Showing 101 changed files with 1,018 additions and 397 deletions.
6 changes: 5 additions & 1 deletion code/__defines/atmospherics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
#define PIPE_ROTATE_TWODIR 1 // Sanitizes cardinal directions to just two, leaves corner directions alone
#define PIPE_ROTATE_ONEDIR 2 // Only has one dir, south

#define PIPE_PLACEMENT_SIMPLE 1
#define PIPE_PLACEMENT_ORTHOGONAL 2
#define PIPE_PLACEMENT_DIAGONAL 3

//Connection Type Definitions
#define CONNECT_TYPE_REGULAR 1
#define CONNECT_TYPE_SUPPLY 2
Expand All @@ -23,4 +27,4 @@
#define PIPE_CLASS_QUATERNARY 4
#define PIPE_CLASS_OMNI 5

#define ADIABATIC_EXPONENT 0.667 //Actually adiabatic exponent - 1.
#define ADIABATIC_EXPONENT 0.667 //Actually adiabatic exponent - 1.
41 changes: 26 additions & 15 deletions code/datums/audio/_audio.dm
Original file line number Diff line number Diff line change
@@ -1,39 +1,50 @@
/singleton/audio
var/source //Path to file source
var/display //A display title we use in the game
var/volume //If present, a `normal` volume
var/title //The real title
/// Path to file source
var/source

/// The real (ie, artist's) audio title
var/title

/// The display title to use in game, if different
var/display

/// The normal volume to play the audio at, if set
var/volume

/// The artist's name
var/author

/// The collection (eg album) the audio belongs to
var/collection
var/singleton/license/license
var/url

/// The license under which the audio was made available
var/singleton/license/license

//Repository scopes
/singleton/audio/effect
/singleton/audio/track
/// A link to the audio's source, if available
var/url


/singleton/audio/New()
/singleton/audio/Initialize()
. = ..()
license = GET_SINGLETON(license)


/singleton/audio/VV_static()
return ..() + vars


/singleton/audio/proc/get_info(with_meta = TRUE)
. = SPAN_GOOD("[title][!author?"":" by [author]"][!collection?"":" ([collection])"]")
if (with_meta)
. = "[.][!url?"":"\[<a href='[url]'>link</a>\]"]\[<a href='[license.url]'>license</a>\]"


/singleton/audio/proc/get_sound(channel)
var/sound/S = sound(source, FALSE, FALSE, channel, volume || 100)
return S
var/sound/sound = sound(source, FALSE, FALSE, channel, volume || 100)
return sound


/singleton/audio/track/get_sound(channel = GLOB.lobby_sound_channel)
var/sound/S = ..()
S.repeat = TRUE
return S
var/sound/sound = ..()
sound.repeat = TRUE
return sound
62 changes: 34 additions & 28 deletions code/datums/audio/jukebox.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/jukebox //abstraction of music player behavior for jukeboxes, headphones, etc
/datum/jukebox
var/atom/owner
var/sound_id
var/datum/sound_token/token
Expand All @@ -17,7 +17,7 @@
var/playing


/jukebox/New(atom/_owner, _template, _ui_title, _ui_width, _ui_height)
/datum/jukebox/New(atom/_owner, _template, _ui_title, _ui_width, _ui_height)
. = ..()
if (QDELETED(_owner) || !isatom(_owner))
qdel(src)
Expand All @@ -27,46 +27,46 @@
for (var/path in GLOB.jukebox_tracks)
var/singleton/audio/track/track = GET_SINGLETON(path)
AddTrack(track.display || track.title, track.source)
sound_id = "[/jukebox]_[sequential_id(/jukebox)]"
sound_id = "[/datum/jukebox]_[sequential_id(/datum/jukebox)]"
template = _template
ui_title = _ui_title
ui_width = _ui_width
ui_height = _ui_height


/jukebox/Destroy()
/datum/jukebox/Destroy()
QDEL_NULL_LIST(tracks)
QDEL_NULL(token)
owner = null
. = ..()
return ..()


/jukebox/proc/AddTrack(title = "Track [length(tracks) + 1]", source)
tracks += new /jukebox_track (title, source)
/datum/jukebox/proc/AddTrack(title = "Track [length(tracks) + 1]", source)
tracks += new /datum/jukebox_track (title, source)


/jukebox/proc/ClearTracks()
/datum/jukebox/proc/ClearTracks()
QDEL_NULL_LIST(tracks)
tracks = list()


/jukebox/proc/Next()
/datum/jukebox/proc/Next()
if (++index > length(tracks))
index = 1
if (playing)
Stop()
Play()


/jukebox/proc/Last()
/datum/jukebox/proc/Last()
if (--index < 1)
index = length(tracks)
if (playing)
Stop()
Play()


/jukebox/proc/Track(_index)
/datum/jukebox/proc/Track(_index)
_index = text2num(_index)
if (!IsInteger(_index))
return
Expand All @@ -76,16 +76,16 @@
Play()


/jukebox/proc/Stop()
/datum/jukebox/proc/Stop()
playing = FALSE
QDEL_NULL(token)
owner.queue_icon_update()


/jukebox/proc/Play()
/datum/jukebox/proc/Play()
if (playing)
return
var/jukebox_track/track = tracks[index]
var/datum/jukebox_track/track = tracks[index]
if (!track.source)
return
playing = TRUE
Expand All @@ -94,7 +94,7 @@
owner.queue_icon_update()


/jukebox/proc/Volume(_volume)
/datum/jukebox/proc/Volume(_volume)
_volume = text2num(_volume)
if (!isfinite(_volume))
return
Expand All @@ -108,16 +108,16 @@
token.SetVolume(volume)


/jukebox/nano_host()
/datum/jukebox/nano_host()
return owner


/jukebox/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui, force_open = TRUE, datum/topic_state/state = GLOB.default_state)//, datum/topic_state/state = GLOB.jukebox_state)
/datum/jukebox/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui, force_open = TRUE, datum/topic_state/state = GLOB.default_state)
var/list/data_tracks = list()
for (var/i = 1 to length(tracks))
var/jukebox_track/track = tracks[i]
var/datum/jukebox_track/track = tracks[i]
data_tracks += list(list("track" = track.title, "index" = i))
var/jukebox_track/track = tracks[index]
var/datum/jukebox_track/track = tracks[index]
var/list/data = list(
"track" = track.title,
"playing" = playing,
Expand All @@ -131,24 +131,30 @@
ui.open()


/jukebox/Topic(href, href_list)
/datum/jukebox/Topic(href, href_list)
switch ("[href_list["act"]]")
if ("next") Next()
if ("last") Last()
if ("stop") Stop()
if ("play") Play()
if ("volume") Volume("[href_list["dat"]]")
if ("track") Track("[href_list["dat"]]")
if ("next")
Next()
if ("last")
Last()
if ("stop")
Stop()
if ("play")
Play()
if ("volume")
Volume("[href_list["dat"]]")
if ("track")
Track("[href_list["dat"]]")
return TOPIC_REFRESH



/jukebox_track
/datum/jukebox_track
var/title
var/source


/jukebox_track/New(_title, _source, _volume)
/datum/jukebox_track/New(_title, _source)
title = _title
source = _source

Expand Down
7 changes: 7 additions & 0 deletions code/datums/uplink/highly_visible_and_dangerous_weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,10 @@
item_cost = 12
path = /obj/item/gun/projectile/heavysniper/boltaction
antag_roles = list(MODE_REVOLUTIONARY)

/datum/uplink_item/item/visible_weapons/sniperlaser
name = "Marksman Energy Rifle"
desc = "An energy based long-range weapon. Not as powerful as a sniper rifle, but it can be recharged."
item_cost = 50
path = /obj/item/gun/energy/sniperrifle
antag_roles = list(MODE_MERCENARY)
2 changes: 1 addition & 1 deletion code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
* - `mover` - The atom that's attempting to move.
* - `target` - The detination turf `mover` is attempting to move to.
*
* Returns boolean. If `FALSE`, blocks movement and calls `mover.Bump(src)`.
* Returns boolean. If `FALSE`, blocks movement and calls `mover.Bump(src, TRUE)`.
*/
/atom/proc/CheckExit(atom/movable/mover, turf/target)
return TRUE
Expand Down
13 changes: 7 additions & 6 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,19 @@
particles = null
return ..()

/atom/movable/Bump(atom/A, yes)
if(!QDELETED(throwing))
throwing.hit_atom(A)

if(inertia_dir)
/// Called should be true when calling this in code.
/atom/movable/Bump(atom/A, called)
if (!QDELETED(throwing))
throwing.hit_atom(A)
if (inertia_dir)
inertia_dir = 0

if (A && yes)
if (A && called)
A.last_bumped = world.time
invoke_async(A, TYPE_PROC_REF(/atom, Bumped), src) // Avoids bad actors sleeping or unexpected side effects, as the legacy behavior was to spawn here
..()


/atom/movable/proc/forceMove(atom/destination)
if((gc_destroyed && gc_destroyed != GC_CURRENTLY_BEING_QDELETED) && !isnull(destination))
CRASH("Attempted to forceMove a QDELETED [src] out of nullspace!!!")
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/cult/narsie.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ var/global/list/narsie_list = list()
M.apply_effect(3, EFFECT_STUN)


/obj/singularity/narsie/large/Bump(atom/A)
/obj/singularity/narsie/large/Bump(atom/A, called)
if(!cause_hell) return
if(isturf(A))
narsiewall(A)
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/meteor/meteors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ var/global/list/meteors_cataclysm = list(\
if (!ismissile)
SpinAnimation()

/obj/meteor/Bump(atom/A)
/obj/meteor/Bump(atom/A, called)
..()
if(A && !QDELETED(src)) // Prevents explosions and other effects when we were deleted by whatever we Bumped() - currently used by shields.
ram_turf(get_turf(A))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,23 @@
machine.attack_hand(user)
return TRUE

/*
This returning FALSE means if component_attackby under use_tool called this it will also return FALSE; which means the use_tool call will proceed.
In that same vein, the attackby() children of this proc will also continue the rest of its code if this crashes; since this check is called at the beginning.
*/
/singleton/machine_construction/proc/attackby(obj/item/I, mob/user, obj/machinery/machine)
if(!validate_state(machine))

/**
* Handles tool usage on the parent machine. Has the same return rules as `/atom/proc/use_tool()`.
*
* **Parameters**:
* - `tool` - The item being used.
* - `user` - The mob performing the interaction.
* - `machine` - The parent machine being interacted with.
*
* Returns boolean. Indicates whether the interaction was handled or not. If `TRUE`, no other interactions will occur.
*/
/singleton/machine_construction/proc/use_tool(obj/item/tool, mob/user, obj/machinery/machine)
if (!validate_state(machine))
crash_with("Machine [log_info_line(machine)] violated the state assumptions of the construction state [type]!")
return FALSE


/singleton/machine_construction/proc/mechanics_info()

// Used to transfer state as needed post-construction.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
down_state = /singleton/machine_construction/default/panel_open/computer
needs_board = "computer"

/singleton/machine_construction/default/panel_closed/computer/no_deconstruct/attackby(obj/item/I, mob/user, obj/machinery/machine)
/singleton/machine_construction/default/panel_closed/computer/no_deconstruct/use_tool(obj/item/tool, mob/user, obj/machinery/machine)
return FALSE

/singleton/machine_construction/default/panel_open/computer
Expand Down
Loading

0 comments on commit 711efdd

Please sign in to comment.