Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropship Airlocks #545

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
8aef645
init
Warfan1815 Sep 23, 2024
c97c66f
secondary
Warfan1815 Sep 26, 2024
e2b5bfc
3rd
Warfan1815 Sep 26, 2024
ff2358d
4th
Warfan1815 Sep 30, 2024
c8fa61a
5th
Warfan1815 Oct 1, 2024
d57ca38
6th
Warfan1815 Oct 2, 2024
9bd326e
7th
Warfan1815 Oct 6, 2024
f79563b
8th
Warfan1815 Oct 6, 2024
2663112
9th
Warfan1815 Oct 6, 2024
b6a424d
10th
Warfan1815 Oct 20, 2024
d931429
11th
Warfan1815 Nov 10, 2024
52f66f0
12th
Warfan1815 Nov 10, 2024
0eab090
13th_test_merge
Warfan1815 Nov 10, 2024
b318c48
merge conflict fix
Warfan1815 Nov 10, 2024
eb7a96b
Merge remote-tracking branch 'origin/master' into movielike_dropships
Warfan1815 Nov 10, 2024
53fab93
I hate you ScrapeAway
Warfan1815 Nov 10, 2024
68f527d
I hate you ScrapeAway 2: Vitriolic Boogaloo
Warfan1815 Nov 10, 2024
3f3ce8b
hopeful fix to hard del
Warfan1815 Nov 10, 2024
d52be3a
oops one more thing
Warfan1815 Nov 10, 2024
fa181b6
Additional features and fixes
Warfan1815 Nov 15, 2024
8e0c4dc
Hull tile-ification
Warfan1815 Nov 15, 2024
7564abd
sound and clamp fix
Warfan1815 Nov 15, 2024
bd7957d
shake
Warfan1815 Nov 15, 2024
67d4e38
Merge branch 'master' into movielike_dropships
Warfan1815 Nov 15, 2024
78378ec
further changes
Warfan1815 Nov 15, 2024
41b24f8
Merge remote-tracking branch 'origin/movielike_dropships' into moviel…
Warfan1815 Nov 15, 2024
63c72d8
sfx and mechanic tightening
Warfan1815 Nov 15, 2024
2d95b62
hatch_release_button_fix
Warfan1815 Nov 16, 2024
3b87214
buckle
Warfan1815 Nov 17, 2024
d8c65d1
further fixes
Warfan1815 Nov 18, 2024
607c9b2
overlay fix
Warfan1815 Nov 23, 2024
cc90f0c
Limb fracturing, visible message fix, turbulence occurrence fix, etc
Warfan1815 Dec 5, 2024
960be98
map update in preparation of garrow 3
Warfan1815 Jan 4, 2025
5a1cba0
Merge remote-tracking branch 'origin/master' into movielike_dropships
Warfan1815 Jan 4, 2025
de7689b
update to garrow 3 plus minor fixes
Warfan1815 Jan 4, 2025
6443bbd
various minor fixes
Warfan1815 Jan 4, 2025
2eff100
oops
Warfan1815 Jan 4, 2025
3c559b0
working larger airlocks
Warfan1815 Jan 5, 2025
b4c74ed
Merge branch 'master' into movielike_dropships
Warfan1815 Jan 5, 2025
9b3f6be
various back-end refactors
Warfan1815 Jan 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions code/__DEFINES/__game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@

/// how long in ticks we wait before assuming the docking controller is broken or blown up.
#define DOCK_ATTEMPT_TIMEOUT 20 SECONDS
#define DROPSHIP_WARMUP_TIME 10 SECONDS
#define DROPSHIP_WARMUP_TIME 15 SECONDS
#define DROPSHIP_DROP_MSG_DELAY 30 SECONDS
#define DROPSHIP_TRANSIT_DURATION 100 SECONDS
#define DROPSHIP_TRANSIT_DURATION 90 SECONDS
#define DROPSHIP_CORSAT_DURATION 30 SECONDS
#define ELEVATOR_TRANSIT_DURATION 5 SECONDS
#define TRANSIT_POD_TRANSIT_DURATION 30 SECONDS
Expand Down Expand Up @@ -230,6 +230,24 @@
#define ALARM_WARNING_DOWN (1<<4)
#define ALARM_LOCKDOWN (1<<5)

//Turbulence for dropships
#define DROPSHIP_TURBULENCE_FREEFALL_PERIOD 15 SECONDS // tied to the 'sound/effects/dropship_flight_start.ogg' sfx
#define DROPSHIP_TURBULENCE_START_PERIOD 10 SECONDS
#define DROPSHIP_TURBULENCE_PERIOD 5 SECONDS
#define DROPSHIP_TURBULENCE_THROWFORCE_MULTIPLIER 4
#define DROPSHIP_TURBULENCE_GRIPLOSS_PROBABILITY 25 // performed every move
#define DROPSHIP_TURBULENCE_PROBABILITY 50
#define DROPSHIP_TURBULENCE_BONEBREAK_PROBABILITY 10

//Dropship Airlocks
#define DROPSHIP_AIRLOCK_DECLAMP_PERIOD 3 SECONDS // tied to the 'sound/effects/dropship_flight_airlocked_start.ogg' sfx
#define DROPSHIP_AIRLOCK_HEIGHT_TRANSITION 9 SECONDS // tied to 'sound/machines/asrs_lowering.ogg' & 'sound/machines/asrs_raising.ogg' sfx
#define DROPSHIP_AIRLOCK_FLOODLIGHT_TRANSITION 1.5 SECONDS // quickly compounded by the amount of floodlights
#define DROPSHIP_AIRLOCK_TRANSITION_PERIOD 5 SECONDS // tied to ''sound/machines/centrifuge.ogg' & the animations of the dropship airlocks
#define DROPSHIP_AIRLOCK_FROM_DOCKPORT_TO_EFFECT x + -7, y + -12, z// for readability
#define DROPSHIP_AIRLOCK_FROM_DOCKPORT_TO_NE_BOUND x - -7, y - -12, z // for readability
#define DROPSHIP_AIRLOCK_BOUNDS locate(DROPSHIP_AIRLOCK_FROM_DOCKPORT_TO_EFFECT), locate(DROPSHIP_AIRLOCK_FROM_DOCKPORT_TO_NE_BOUND) // for readability

//=================================================
#define HOSTILE_STANCE_IDLE 1
#define HOSTILE_STANCE_ALERT 2
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/dropship_airlocks.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#define GOLDEN_ARROW_AIRLOCK_ONE "golden-arrow-airlock-one"
#define GOLDEN_ARROW_AIRLOCK_TWO "golden-arrow-airlock-two"
2 changes: 1 addition & 1 deletion code/__DEFINES/equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/// Used for armors or uniforms that don't have a snow/desert/etc icon state set via select_gamemode_skin (not all item types currently perform this test though).
#define NO_SNOW_TYPE (1<<11)

#define INVULNERABLE (1<<12)
#define INVULNERABLE (1<<12) // previously unfunctional, now has been co-opted to prevent things getting qdel'd by shuttle landing

/// syringes can inject or drain reagents in this even if it isn't an OPENCONTAINER
#define CAN_BE_SYRINGED (1<<13)
Expand Down
8 changes: 8 additions & 0 deletions code/__DEFINES/shuttles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@

#define GOLDEN_ARROW_LZ "golden arrow lz"

#define GENERIC_A_O "generic-airlock-outer"

#define GOLDEN_ARROW_A1_O "golden-arrow-airlock-1-outer"
#define GOLDEN_ARROW_A2_O "golden-arrow-airlock-2-outer"

#define GOLDEN_ARROW_A1_I "golden-arrow-airlock-1-inner"
#define GOLDEN_ARROW_A2_I "golden-arrow-airlock-2-inner"

#define DROPSHIP_FLYBY_ID "special_flight"
#define DROPSHIP_LZ1 "dropship-lz1"
#define DROPSHIP_LZ2 "dropship-lz2"
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/sounds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define ITEM_EQUIP_VOLUME 50

//Reserved channels
#define SOUND_CHANNEL_DROPSHIP 1014
#define SOUND_CHANNEL_TEST 1015
#define SOUND_CHANNEL_NOTIFY 1016
#define SOUND_CHANNEL_VOX 1017
Expand Down
42 changes: 27 additions & 15 deletions code/controllers/subsystem/fz_transitions.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
GLOBAL_LIST_EMPTY(projectors)
GLOBAL_LIST_EMPTY(clones)
GLOBAL_LIST_EMPTY(clones_t)

Expand All @@ -8,42 +7,55 @@ SUBSYSTEM_DEF(fz_transitions)
priority = SS_PRIORITY_FZ_TRANSITIONS
init_order = SS_INIT_FZ_TRANSITIONS
flags = SS_KEEP_TIMING
var/list/selective_update = null

/datum/controller/subsystem/fz_transitions/stat_entry(msg)
msg = "P:[length(GLOB.projectors)]|C:[length(GLOB.clones)]|T:[length(GLOB.clones_t)]"
return ..()

/datum/controller/subsystem/fz_transitions/Initialize()
for(var/obj/effect/projector/P in world)
GLOB.projectors.Add(P)
selective_update = list(null = 1)
return SS_INIT_SUCCESS

/datum/controller/subsystem/fz_transitions/fire(resumed = FALSE)
for(var/obj/effect/projector/P in GLOB.projectors)
for(var/obj/effect/projector/P as anything in GLOB.projectors)
if(!P || !P.loc)
GLOB.projectors -= P
continue
if(!P.loc.clone)
P.loc.create_clone(P.vector_x, P.vector_y, P.vector_z)

P.loc.create_clone(P)
if(P.loc.contents)
for(var/atom/movable/O in P.loc.contents)
if(!istype(O, /obj/effect/projector) && !istype(O, /mob/dead/observer) && !istype(O, /obj/structure/stairs) && !istype(O, /obj/structure/catwalk) && O.type != /atom/movable/clone)
if(!O.clone) //Create a clone if it's on a projector
O.create_clone_movable(P.vector_x, P.vector_y, P.vector_z)
else
for(var/atom/movable/O as anything in P.loc.contents)
if(!O.clone)
if(!(istype(O, /obj/effect/projector) || istype(O, /mob/dead/observer) || istype(O, /obj/structure/stairs) || istype(O, /obj/structure/catwalk) || O.type == /atom/movable/clone))
O.create_clone_movable(P)
else
if(!(istype(O, /obj/effect/projector) || istype(O, /mob/dead/observer) || istype(O, /obj/structure/stairs) || istype(O, /obj/structure/catwalk) || O.type == /atom/movable/clone))
O.clone.proj_x = P.vector_x //Make sure projection is correct
O.clone.proj_y = P.vector_y
O.clone.proj_z = P.vector_z


for(var/atom/movable/clone/C in GLOB.clones)
for(var/atom/movable/clone/C as anything in GLOB.clones)
if(C.mstr == null || !istype(C.mstr.loc, /turf))
C.mstr.destroy_clone() //Kill clone if master has been destroyed or picked up
else
if(C != C.mstr)
if(C != C.mstr && selective_update[C.proj.firing_id])
C.mstr.update_clone() //NOTE: Clone updates are also forced by player movement to reduce latency

for(var/atom/T in GLOB.clones_t)
for(var/atom/T as anything in GLOB.clones_t)
if(T.clone && T.icon_state) //Just keep the icon updated for explosions etc.
T.clone.icon_state = T.icon_state

/datum/controller/subsystem/fz_transitions/proc/toggle_selective_update(update, firing_id)
selective_update[firing_id] = update
if(update)
for(var/obj/effect/projector/P as anything in GLOB.deselected_projectors)
if(selective_update[P.firing_id])
GLOB.deselected_projectors -= P
GLOB.projectors += P
else
for(var/obj/effect/projector/P as anything in GLOB.projectors)
if(!selective_update[P.firing_id])
GLOB.projectors -= P
GLOB.deselected_projectors += P
fire()
7 changes: 6 additions & 1 deletion code/datums/soundOutput.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@
/datum/soundOutput/proc/update_ambience(area/target_area, ambience_override, force_update = FALSE)
var/status_flags = SOUND_STREAM
var/target_ambience = ambience_override
var/presumptive_sound_channel = SOUND_CHANNEL_AMBIENCE
var/should_wait = TRUE

if(!(owner.prefs.toggles_sound & SOUND_AMBIENCE))
if(!force_update)
Expand All @@ -79,10 +81,13 @@
return
if(!target_ambience)
target_ambience = target_area.get_sound_ambience(owner)

if(target_area)
soundscape_playlist = target_area.soundscape_playlist
if(istype(target_area, /area/shuttle))
presumptive_sound_channel = SOUND_CHANNEL_DROPSHIP

var/sound/S = sound(null,1,0,SOUND_CHANNEL_AMBIENCE)
var/sound/S = sound(null,1,should_wait,presumptive_sound_channel)

if(ambience == target_ambience)
if(!force_update)
Expand Down
3 changes: 2 additions & 1 deletion code/game/area/shuttles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
// Loading the same shuttle map at a different time will produce distinct area instances.
unique = FALSE

base_lighting_alpha = 255
area_has_base_lighting = FALSE
base_lighting_alpha = 0


///area/shuttle/Initialize()
Expand Down
37 changes: 31 additions & 6 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -416,16 +416,41 @@ Parameters are passed from New.
var/proj_x = 0
var/proj_y = 0
var/proj_z = 0
var/obj/effect/projector/proj = null

/atom/proc/create_clone(shift_x, shift_y, shift_z) //NOTE: Use only for turfs, otherwise use create_clone_movable
/atom/proc/create_clone(obj/effect/projector/P) //NOTE: Use only for turfs, otherwise use create_clone_movable
var/turf/T = null
T = locate(src.x + shift_x, src.y + shift_y, src.z + shift_z)
T = locate(src.x + P.vector_x, src.y + P.vector_y, src.z + P.vector_z)

T.appearance = src.appearance
T.setDir(src.dir)
if(P.modify_turf)
T.appearance = src.appearance
T.setDir(src.dir)

GLOB.clones_t.Add(src)
src.clone = T
if(P.mask_layer)
T.layer = ((P.mask_layer-0.5)+(src.layer/10))

GLOB.clones_t.Add(src)
src.clone = T
else
var/atom/movable/clone/facsimile_T = new /atom/movable/clone(T)

facsimile_T.appearance = src.appearance

// we don't want a projected lighting underlay (especially when this generates at roundstart) to duplicate over the real turf's lighting (not a very sound way of doing it, but the only one plausible it seems like.)
facsimile_T.underlays -= facsimile_T.underlays[1]
// spider webs and etcetra may be an issue
facsimile_T.overlays = list()

facsimile_T.setDir(src.dir)
if(P.mask_layer)
facsimile_T.layer = ((P.mask_layer-0.5)+(src.layer/10))
facsimile_T.plane = -7
facsimile_T.opacity = P.projected_opacity

GLOB.clones_t.Add(src)
src.clone = facsimile_T
facsimile_T.mstr = src
facsimile_T.proj = P

// EFFECTS
/atom/proc/extinguish_acid()
Expand Down
54 changes: 41 additions & 13 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@
var/proj_x = 0
var/proj_y = 0
var/proj_z = 0
var/proj_base_layer = null
var/proj_plane = -6
var/proj_mouse_opacity = 1
var/proj_opacity = 1
var/obj/effect/projector/proj = null
unacidable = TRUE

var/list/image/hud_list
Expand All @@ -269,49 +274,72 @@

/atom/movable/clone/bullet_act(obj/projectile/P)
return src.mstr.bullet_act(P)

/atom/movable/clone/onShuttleMove(turf/newT, turf/oldT, list/movement_force, move_dir, obj/docking_port/stationary/old_dock, obj/docking_port/mobile/moving_dock)
return TRUE
// at least for how we're using them for airlocks, we don't want clones moving

/atom/movable/clone/Destroy(force)
if(!force)
return QDEL_HINT_LETMELIVE
. = ..()
/////////////////////

/atom/movable/proc/create_clone_movable(shift_x, shift_y, shift_z)
/atom/movable/proc/create_clone_movable(obj/effect/projector/P)
var/atom/movable/clone/C = new /atom/movable/clone(src.loc)
C.density = FALSE
C.proj_x = shift_x
C.proj_y = shift_y
C.proj_z = shift_z
C.proj_x = P.vector_x
C.proj_y = P.vector_y
C.proj_z = P.vector_z
if(P.mask_layer)
C.proj_base_layer = P.mask_layer-0.5
C.proj_plane = P.movables_projection_plane
C.proj_mouse_opacity = P.projected_mouse_opacity
C.proj_opacity = P.projected_opacity

GLOB.clones.Add(C)
C.mstr = src //Link clone and master
C.proj = P
src.clone = C

/atom/movable/proc/update_clone()
/atom/movable/proc/update_clone(full_update = TRUE)
///---Var-Copy---////
clone.forceMove(locate(x + clone.proj_x, y + clone.proj_y, z + clone.proj_z))
//Translate clone position by projection factor
//This is done first to reduce movement latency

clone.anchored = anchored //Some of these may be suitable for Init
clone.appearance = appearance
clone.dir = dir
clone.flags_atom = flags_atom
clone.density = density
clone.layer = layer
clone.level = level
clone.name = name
clone.pixel_x = pixel_x
clone.pixel_y = pixel_y
clone.transform = transform
clone.invisibility = invisibility
////////////////////
clone.flags_atom = flags_atom
clone.layer = layer
clone.opacity = clone.proj_opacity
clone.plane = clone.proj_plane // necessary when placing movables (typically plane -6) under a turf (typically plane -7)
clone.density = density
clone.anchored = anchored
clone.name = name
clone.mouse_opacity = clone.proj_mouse_opacity

if(clone.proj_base_layer)
for(var/overlay in clone.overlays) // overlays cannot be reliably interacted with to apply layers
clone.overlays -= overlay
clone.layer = clone.proj_base_layer+(layer/10)

////////////////////
if(light) //Clone lighting
if(!clone.light)
clone.set_light(luminosity) //Create clone light
else
if(clone.light)
clone.set_light(0) //Kill clone light


/atom/movable/proc/destroy_clone()
GLOB.clones.Remove(src.clone)
qdel(src.clone)
qdel(src.clone, TRUE)
src.clone = null

/**
Expand Down
34 changes: 34 additions & 0 deletions code/game/machinery/door_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,37 @@
/obj/structure/machinery/door_control/cl/quarter/windows
name = "Quarter Windows Shutters"
id = "cl_quarter_windows"

/obj/structure/machinery/door_control/dropship_airlock
name = "maintenance hatch release"
var/linked_inner_dropship_airlock_id = "generic"
var/obj/docking_port/stationary/marine_dropship/airlock/inner/linked_inner = null

/obj/structure/machinery/door_control/dropship_airlock/Initialize(mapload, ...)
. = ..()
return INITIALIZE_HINT_LATELOAD

/obj/structure/machinery/door_control/dropship_airlock/LateInitialize()
. = ..()
for(var/obj/docking_port/stationary/marine_dropship/airlock/inner/inner_airlock in GLOB.dropship_airlock_docking_ports)
if(linked_inner_dropship_airlock_id == inner_airlock.dropship_airlock_id)
linked_inner = inner_airlock
linked_inner.door_controls += src

/obj/structure/machinery/door_control/dropship_airlock/Destroy()
if(linked_inner)
linked_inner.door_controls -= src
. = ..()

/obj/structure/machinery/door_control/dropship_airlock/use_button(mob/living/user, force)
if(linked_inner?.open_outer_airlock)
to_chat(user, SPAN_WARNING("Locked out while the outer airlock is open."))
flick(initial(icon_state) + "-denied",src)
return
. = ..()

/obj/structure/machinery/door_control/dropship_airlock/golden_arrow_one
linked_inner_dropship_airlock_id = GOLDEN_ARROW_AIRLOCK_ONE

/obj/structure/machinery/door_control/dropship_airlock/golden_arrow_two
linked_inner_dropship_airlock_id = GOLDEN_ARROW_AIRLOCK_TWO
Loading
Loading