mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 15:47:15 +01:00
Fix conflict
This commit is contained in:
@@ -395,7 +395,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
data_core.manifest_inject(new_character)
|
||||
|
||||
if(alert(new_character,"Would you like an active AI to announce this character?",,"No","Yes")=="Yes")
|
||||
call(/mob/new_player/proc/AnnounceArrival)(new_character, new_character.mind.assigned_role)
|
||||
AnnounceArrival(new_character, new_character.mind.assigned_role)
|
||||
|
||||
message_admins("<span class='adminnotice'>[admin] has respawned [player_key] as [new_character.real_name].</span>")
|
||||
|
||||
|
||||
@@ -14,10 +14,6 @@ var/global/dmm_suite/preloader/_preloader = new
|
||||
// /^[\s\n]+|[\s\n]+$/
|
||||
var/static/regex/trimRegex = new/regex("^\[\\s\n]+|\[\\s\n]+$", "g")
|
||||
var/static/list/modelCache = list()
|
||||
var/static/space // the world turf model key
|
||||
#ifdef TESTING
|
||||
var/static/num_skipped
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Construct the model map and control the loading process
|
||||
@@ -32,15 +28,7 @@ var/global/dmm_suite/preloader/_preloader = new
|
||||
/dmm_suite/load_map(dmm_file as file, x_offset as num, y_offset as num, z_offset as num, cropMap as num, measureOnly as num, no_changeturf as num)
|
||||
//How I wish for RAII
|
||||
Master.StartLoadingMap()
|
||||
space = null //different file, different keys
|
||||
#ifdef TESTING
|
||||
num_skipped = 0
|
||||
#endif
|
||||
. = load_map_impl(dmm_file, x_offset, y_offset, z_offset, cropMap, measureOnly, no_changeturf)
|
||||
#ifdef TESTING
|
||||
if(. && no_changeturf)
|
||||
testing("Skipped loading [num_skipped] basic turfs.")
|
||||
#endif
|
||||
Master.StopLoadingMap()
|
||||
|
||||
/dmm_suite/proc/load_map_impl(dmm_file, x_offset, y_offset, z_offset, cropMap, measureOnly, no_changeturf)
|
||||
@@ -93,7 +81,6 @@ var/global/dmm_suite/preloader/_preloader = new
|
||||
continue
|
||||
else
|
||||
world.maxz = zcrd //create a new z_level if needed
|
||||
var/basic_turfs = no_changeturf || zexpansion
|
||||
|
||||
bounds[MAP_MINX] = min(bounds[MAP_MINX], xcrdStart)
|
||||
bounds[MAP_MINZ] = min(bounds[MAP_MINZ], zcrd)
|
||||
@@ -139,14 +126,9 @@ var/global/dmm_suite/preloader/_preloader = new
|
||||
|
||||
if(xcrd >= 1)
|
||||
var/model_key = copytext(line, tpos, tpos + key_len)
|
||||
if(!basic_turfs || model_key != space)
|
||||
if(!grid_models[model_key])
|
||||
throw EXCEPTION("Undefined model key in DMM.")
|
||||
parse_grid(grid_models[model_key], model_key, xcrd, ycrd, zcrd, basic_turfs)
|
||||
#ifdef TESTING
|
||||
else
|
||||
++num_skipped
|
||||
#endif
|
||||
if(!grid_models[model_key])
|
||||
throw EXCEPTION("Undefined model key in DMM.")
|
||||
parse_grid(grid_models[model_key], xcrd, ycrd, zcrd, no_changeturf || zexpansion)
|
||||
CHECK_TICK
|
||||
|
||||
maxx = max(maxx, xcrd)
|
||||
@@ -160,11 +142,12 @@ var/global/dmm_suite/preloader/_preloader = new
|
||||
if(bounds[1] == 1.#INF) // Shouldn't need to check every item
|
||||
return null
|
||||
else
|
||||
if(!measureOnly && !no_changeturf)
|
||||
for(var/t in block(locate(bounds[MAP_MINX], bounds[MAP_MINY], bounds[MAP_MINZ]), locate(bounds[MAP_MAXX], bounds[MAP_MAXY], bounds[MAP_MAXZ])))
|
||||
var/turf/T = t
|
||||
//we do this after we load everything in. if we don't; we'll have weird atmos bugs regarding atmos adjacent turfs
|
||||
T.AfterChange(TRUE)
|
||||
if(!measureOnly)
|
||||
if(!no_changeturf)
|
||||
for(var/t in block(locate(bounds[MAP_MINX], bounds[MAP_MINY], bounds[MAP_MINZ]), locate(bounds[MAP_MAXX], bounds[MAP_MAXY], bounds[MAP_MAXZ])))
|
||||
var/turf/T = t
|
||||
//we do this after we load everything in. if we don't; we'll have weird atmos bugs regarding atmos adjacent turfs
|
||||
T.AfterChange(TRUE)
|
||||
return bounds
|
||||
|
||||
/**
|
||||
@@ -184,7 +167,7 @@ var/global/dmm_suite/preloader/_preloader = new
|
||||
* 4) Instanciates the atom with its variables
|
||||
*
|
||||
*/
|
||||
/dmm_suite/proc/parse_grid(model as text, model_key, xcrd as num,ycrd as num,zcrd as num, no_changeturf as num)
|
||||
/dmm_suite/proc/parse_grid(model as text,xcrd as num,ycrd as num,zcrd as num, no_changeturf as num)
|
||||
/*Method parse_grid()
|
||||
- Accepts a text string containing a comma separated list of type paths of the
|
||||
same construction as those contained in a .dmm file, and instantiates them.
|
||||
@@ -238,24 +221,8 @@ var/global/dmm_suite/preloader/_preloader = new
|
||||
CHECK_TICK
|
||||
while(dpos != 0)
|
||||
|
||||
var/static/area_typecache = world.area ///area/space
|
||||
var/static/turf_typecache = world.turf ///turf/open/space/basic
|
||||
modelCache[model] = list(members, members_attributes)
|
||||
|
||||
if(!space && members.len == 2 && members_attributes.len == 2 && (area_typecache in members) && length(members_attributes[1]) == 0 && length(members_attributes[2]) == 0)
|
||||
if (turf_typecache in members)
|
||||
space = model_key
|
||||
if(no_changeturf)
|
||||
#ifdef TESTING
|
||||
++num_skipped
|
||||
#endif
|
||||
return
|
||||
#ifdef TESTING
|
||||
else if(/turf/open/space in members)
|
||||
testing("WARNING: FOUND BAD SPACE TURF AT KEY [model_key]! USE /turf/open/space/basic TO ENABLE MAPLOADER OPTIMIZATIONS!")
|
||||
#endif
|
||||
|
||||
var/L = list(members, members_attributes)
|
||||
modelCache[model] = L
|
||||
|
||||
////////////////
|
||||
//Instanciation
|
||||
|
||||
@@ -104,8 +104,13 @@ var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER
|
||||
|
||||
update_icon()
|
||||
|
||||
if(!T && latejoin.len)
|
||||
T = pick(latejoin) //Safety in case we cannot find the body's position
|
||||
if(!T)
|
||||
var/list/turfs = get_area_turfs(/area/shuttle/arrival)
|
||||
if(turfs.len)
|
||||
T = pick(turfs)
|
||||
else
|
||||
T = locate(round(world.maxx/2), round(world.maxy/2), ZLEVEL_STATION) //middle of the station
|
||||
|
||||
loc = T
|
||||
|
||||
if(!name) //To prevent nameless ghosts
|
||||
|
||||
@@ -300,6 +300,12 @@
|
||||
to_chat(src, alert("[rank] is not available. Please try another."))
|
||||
return 0
|
||||
|
||||
if(SSshuttle.arrivals)
|
||||
if(SSshuttle.arrivals.damaged && config.arrivals_shuttle_require_safe_latejoin)
|
||||
src << alert("The arrivals shuttle is currently malfunctioning! You cannot join.")
|
||||
return FALSE
|
||||
SSshuttle.arrivals.RequireUndocked(src)
|
||||
|
||||
//Remove the player from the join queue if he was in one and reset the timer
|
||||
ticker.queued_players -= src
|
||||
ticker.queue_delay = 4
|
||||
@@ -312,7 +318,7 @@
|
||||
character = equip
|
||||
|
||||
|
||||
var/D = pick(latejoin)
|
||||
var/D = get_turf(pick(latejoin))
|
||||
if(!D)
|
||||
for(var/turf/T in get_area_turfs(/area/shuttle/arrival))
|
||||
if(!T.density)
|
||||
@@ -326,6 +332,12 @@
|
||||
continue
|
||||
|
||||
character.loc = D
|
||||
character.update_parallax_teleport()
|
||||
|
||||
var/atom/movable/chair = locate(/obj/structure/chair) in character.loc
|
||||
if(chair)
|
||||
chair.buckle_mob(character)
|
||||
|
||||
ticker.minds += character.mind
|
||||
|
||||
var/mob/living/carbon/human/humanc
|
||||
@@ -334,7 +346,10 @@
|
||||
|
||||
if(humanc) //These procs all expect humans
|
||||
data_core.manifest_inject(humanc)
|
||||
AnnounceArrival(humanc, rank)
|
||||
if(SSshuttle.arrivals)
|
||||
SSshuttle.arrivals.QueueAnnounce(humanc, rank)
|
||||
else
|
||||
AnnounceArrival(humanc, rank)
|
||||
AddEmploymentContract(humanc)
|
||||
if(highlander)
|
||||
to_chat(humanc, "<span class='userdanger'><i>THERE CAN BE ONLY ONE!!!</i></span>")
|
||||
@@ -352,22 +367,6 @@
|
||||
ticker.mode.make_antag_chance(humanc)
|
||||
qdel(src)
|
||||
|
||||
/mob/new_player/proc/AnnounceArrival(var/mob/living/carbon/human/character, var/rank)
|
||||
if(ticker.current_state != GAME_STATE_PLAYING)
|
||||
return
|
||||
var/area/A = get_area(character)
|
||||
var/message = "<span class='game deadsay'><span class='name'>\
|
||||
[character.real_name]</span> ([rank]) has arrived at the station at \
|
||||
<span class='name'>[A.name]</span>.</span>"
|
||||
deadchat_broadcast(message, follow_target = character, message_type=DEADCHAT_ARRIVALRATTLE)
|
||||
if((!announcement_systems.len) || (!character.mind))
|
||||
return
|
||||
if((character.mind.assigned_role == "Cyborg") || (character.mind.assigned_role == character.mind.special_role))
|
||||
return
|
||||
|
||||
var/obj/machinery/announcement_system/announcer = pick(announcement_systems)
|
||||
announcer.announce("ARRIVAL", character.real_name, rank, list()) //make the list empty to make it announce it in common
|
||||
|
||||
/mob/new_player/proc/AddEmploymentContract(mob/living/carbon/human/employee)
|
||||
//TODO: figure out a way to exclude wizards/nukeops/demons from this.
|
||||
sleep(30)
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
/obj/docking_port/mobile/arrivals
|
||||
name = "arrivals shuttle"
|
||||
id = "arrivals"
|
||||
|
||||
dwidth = 3
|
||||
width = 7
|
||||
height = 15
|
||||
dir = WEST
|
||||
port_angle = 180
|
||||
|
||||
callTime = INFINITY
|
||||
ignitionTime = 50
|
||||
|
||||
roundstart_move = TRUE //force a call to dockRoundstart
|
||||
|
||||
var/sound_played
|
||||
var/damaged //too damaged to undock?
|
||||
var/list/areas //areas in our shuttle
|
||||
var/list/queued_announces //people coming in that we have to announce
|
||||
var/obj/machinery/requests_console/console
|
||||
var/force_depart = FALSE
|
||||
|
||||
/obj/docking_port/mobile/arrivals/Initialize(mapload)
|
||||
if(mapload)
|
||||
return TRUE //late initialize to make sure the latejoin list is populated
|
||||
|
||||
preferred_direction = dir
|
||||
|
||||
..()
|
||||
|
||||
if(SSshuttle.arrivals)
|
||||
WARNING("More than one arrivals docking_port placed on map!")
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
SSshuttle.arrivals = src
|
||||
|
||||
areas = list()
|
||||
|
||||
if(latejoin.len)
|
||||
WARNING("Map contains predefined latejoin spawn points and an arrivals shuttle. Using the arrivals shuttle.")
|
||||
|
||||
latejoin = list()
|
||||
for(var/area/shuttle/arrival/A in sortedAreas)
|
||||
for(var/obj/structure/chair/C in A)
|
||||
latejoin += C
|
||||
if(!console)
|
||||
console = locate(/obj/machinery/requests_console) in A
|
||||
areas += A
|
||||
|
||||
/obj/docking_port/mobile/arrivals/dockRoundstart()
|
||||
SSshuttle.generate_transit_dock(src)
|
||||
Launch()
|
||||
timer = world.time
|
||||
check()
|
||||
return TRUE
|
||||
|
||||
/obj/docking_port/mobile/arrivals/check()
|
||||
. = ..()
|
||||
|
||||
if(damaged)
|
||||
if(!CheckTurfsPressure())
|
||||
damaged = FALSE
|
||||
if(console)
|
||||
console.say("Repairs complete, launching soon.")
|
||||
return
|
||||
|
||||
//If this proc is high on the profiler add a cooldown to the stuff after this line
|
||||
|
||||
else if(CheckTurfsPressure())
|
||||
damaged = TRUE
|
||||
if(console)
|
||||
console.say("Alert, hull breach detected!")
|
||||
var/obj/machinery/announcement_system/announcer = pick(announcement_systems)
|
||||
announcer.announce("ARRIVALS_BROKEN", channels = list())
|
||||
if(mode != SHUTTLE_CALL)
|
||||
sound_played = FALSE
|
||||
mode = SHUTTLE_IDLE
|
||||
else
|
||||
SendToStation()
|
||||
return
|
||||
|
||||
var/found_awake = PersonCheck()
|
||||
if(mode == SHUTTLE_CALL)
|
||||
if(found_awake)
|
||||
SendToStation()
|
||||
else if(mode == SHUTTLE_IGNITING)
|
||||
if(found_awake && !force_depart)
|
||||
mode = SHUTTLE_IDLE
|
||||
sound_played = FALSE
|
||||
else if(!sound_played)
|
||||
hyperspace_sound(HYPERSPACE_WARMUP, areas)
|
||||
sound_played = TRUE
|
||||
else if(!found_awake)
|
||||
Launch(FALSE)
|
||||
|
||||
/obj/docking_port/mobile/arrivals/proc/CheckTurfsPressure()
|
||||
for(var/I in latejoin)
|
||||
var/turf/open/T = get_turf(I)
|
||||
var/pressure = T.air.return_pressure()
|
||||
if(pressure < HAZARD_LOW_PRESSURE || pressure > HAZARD_HIGH_PRESSURE) //simple safety check
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/docking_port/mobile/arrivals/proc/PersonCheck()
|
||||
for(var/A in areas)
|
||||
for(var/mob/living/L in A)
|
||||
//don't dock for braindead'
|
||||
if(L.key && L.client && L.stat != DEAD)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/docking_port/mobile/arrivals/proc/SendToStation()
|
||||
var/dockTime = config.arrivals_shuttle_dock_window
|
||||
if(mode == SHUTTLE_CALL && timeLeft(1) > dockTime)
|
||||
if(console)
|
||||
console.say(damaged ? "Initiating emergency docking for repairs!" : "Now approaching: [SSmapping.config.map_name].")
|
||||
hyperspace_sound(HYPERSPACE_LAUNCH, areas) //for the new guy
|
||||
setTimer(dockTime)
|
||||
|
||||
/obj/docking_port/mobile/arrivals/dock(obj/docking_port/stationary/S1, force=FALSE)
|
||||
var/docked = S1 == assigned_transit
|
||||
sound_played = FALSE
|
||||
if(docked) //about to launch
|
||||
if(!force_depart && PersonCheck())
|
||||
mode = SHUTTLE_IDLE
|
||||
if(console)
|
||||
console.say("Launch cancelled, lifeform dectected on board.")
|
||||
return
|
||||
force_depart = FALSE
|
||||
. = ..()
|
||||
if(!. && !docked && !damaged)
|
||||
console.say("Welcome to your new life, employees!")
|
||||
for(var/L in queued_announces)
|
||||
var/datum/callback/C = L
|
||||
C.Invoke()
|
||||
LAZYCLEARLIST(queued_announces)
|
||||
|
||||
/obj/docking_port/mobile/arrivals/check_effects()
|
||||
..()
|
||||
if(!sound_played && timeLeft(1) <= HYPERSPACE_END_TIME)
|
||||
sound_played = TRUE
|
||||
hyperspace_sound(HYPERSPACE_END, areas)
|
||||
|
||||
/obj/docking_port/mobile/arrivals/canDock(obj/docking_port/stationary/S)
|
||||
. = ..()
|
||||
if(. == SHUTTLE_ALREADY_DOCKED)
|
||||
. = SHUTTLE_CAN_DOCK
|
||||
|
||||
/obj/docking_port/mobile/arrivals/proc/Launch(pickingup)
|
||||
if(mode != SHUTTLE_CALL)
|
||||
if(pickingup)
|
||||
force_depart = TRUE
|
||||
if(console)
|
||||
console.say(pickingup ? "Departing immediately for new employee pickup." : "Shuttle departing.")
|
||||
request(SSshuttle.getDock("arrivals_stationary")) //we will intentionally never return SHUTTLE_ALREADY_DOCKED
|
||||
|
||||
/obj/docking_port/mobile/arrivals/proc/RequireUndocked(mob/user)
|
||||
if(mode == SHUTTLE_CALL || damaged)
|
||||
return
|
||||
|
||||
Launch(TRUE)
|
||||
|
||||
user << "<span class='notice'>Calling your shuttle. One moment...</span>"
|
||||
while(mode != SHUTTLE_CALL && !damaged)
|
||||
stoplag()
|
||||
|
||||
/obj/docking_port/mobile/arrivals/proc/QueueAnnounce(mob, rank)
|
||||
LAZYADD(queued_announces, CALLBACK(GLOBAL_PROC, .proc/AnnounceArrival, mob, rank))
|
||||
@@ -322,8 +322,10 @@
|
||||
|
||||
if(time_left <= 50 && !sound_played) //4 seconds left:REV UP THOSE ENGINES BOYS. - should sync up with the launch
|
||||
sound_played = 1 //Only rev them up once.
|
||||
for(var/area/shuttle/escape/E in world)
|
||||
E << 'sound/effects/hyperspace_begin.ogg'
|
||||
var/list/areas = list()
|
||||
for(var/area/shuttle/escape/E in sortedAreas)
|
||||
areas += E
|
||||
hyperspace_sound(HYPERSPACE_WARMUP, areas)
|
||||
|
||||
if(time_left <= 0 && !SSshuttle.emergencyNoEscape)
|
||||
//move each escape pod (or applicable spaceship) to its corresponding transit dock
|
||||
@@ -334,8 +336,10 @@
|
||||
M.enterTransit()
|
||||
|
||||
//now move the actual emergency shuttle to its transit dock
|
||||
for(var/area/shuttle/escape/E in world)
|
||||
E << 'sound/effects/hyperspace_progress.ogg'
|
||||
var/list/areas = list()
|
||||
for(var/area/shuttle/escape/E in sortedAreas)
|
||||
areas += E
|
||||
hyperspace_sound(HYPERSPACE_LAUNCH, areas)
|
||||
enterTransit()
|
||||
mode = SHUTTLE_ESCAPE
|
||||
launch_status = ENDGAME_LAUNCHED
|
||||
@@ -346,10 +350,13 @@
|
||||
SSshuttle.checkHostileEnvironment()
|
||||
|
||||
if(SHUTTLE_ESCAPE)
|
||||
if(sound_played && time_left <= HYPERSPACE_END_TIME)
|
||||
var/list/areas = list()
|
||||
for(var/area/shuttle/escape/E in sortedAreas)
|
||||
areas += E
|
||||
hyperspace_sound(HYPERSPACE_END, areas)
|
||||
if(areaInstance.parallax_movedir && time_left <= PARALLAX_LOOP_TIME)
|
||||
parallax_slowdown()
|
||||
for(var/area/shuttle/escape/E in world)
|
||||
E << 'sound/effects/hyperspace_end.ogg'
|
||||
for(var/A in SSshuttle.mobile)
|
||||
var/obj/docking_port/mobile/M = A
|
||||
if(M.launch_status == ENDGAME_LAUNCHED)
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
shuttledocked = 0
|
||||
for(var/obj/machinery/door/airlock/A in orange(1, src))
|
||||
A.shuttledocked = 0
|
||||
INVOKE_ASYNC(A, /obj/machinery/door/.proc/close)
|
||||
. = ..()
|
||||
shuttledocked = 1
|
||||
for(var/obj/machinery/door/airlock/A in orange(1, src))
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
//use this define to highlight docking port bounding boxes (ONLY FOR DEBUG USE)
|
||||
// #define DOCKING_PORT_HIGHLIGHT
|
||||
#ifdef TESTING
|
||||
#define DOCKING_PORT_HIGHLIGHT
|
||||
#endif
|
||||
|
||||
//NORTH default dir
|
||||
/obj/docking_port
|
||||
@@ -119,6 +121,7 @@
|
||||
var/turf/T1 = locate(L[3],L[4],z)
|
||||
for(var/turf/T in block(T0,T1))
|
||||
T.color = _color
|
||||
LAZYINITLIST(T.atom_colours)
|
||||
T.maptext = null
|
||||
if(_color)
|
||||
var/turf/T = locate(L[1], L[2], z)
|
||||
@@ -239,8 +242,7 @@
|
||||
|
||||
/obj/docking_port/mobile/Initialize(mapload)
|
||||
..()
|
||||
if(!mapload)
|
||||
return
|
||||
|
||||
var/area/A = get_area(src)
|
||||
if(istype(A, /area/shuttle))
|
||||
areaInstance = A
|
||||
@@ -312,6 +314,10 @@
|
||||
//call the shuttle to destination S
|
||||
/obj/docking_port/mobile/proc/request(obj/docking_port/stationary/S)
|
||||
if(!check_dock(S))
|
||||
testing("check_dock failed on request for [src]")
|
||||
return
|
||||
|
||||
if(mode == SHUTTLE_IGNITING && destination == S)
|
||||
return
|
||||
|
||||
switch(mode)
|
||||
@@ -709,4 +715,19 @@
|
||||
return S
|
||||
return null
|
||||
|
||||
/obj/docking_port/mobile/proc/hyperspace_sound(phase, list/areas)
|
||||
var/s
|
||||
switch(phase)
|
||||
if(HYPERSPACE_WARMUP)
|
||||
s = 'sound/effects/hyperspace_begin.ogg'
|
||||
if(HYPERSPACE_LAUNCH)
|
||||
s = 'sound/effects/hyperspace_progress.ogg'
|
||||
if(HYPERSPACE_END)
|
||||
s = 'sound/effects/hyperspace_end.ogg'
|
||||
else
|
||||
CRASH("Invalid hyperspace sound phase: [phase]")
|
||||
for(var/A in areas)
|
||||
for(var/obj/machinery/door/E in A) //dumb, I know, but playing it on the engines doesn't do it justice
|
||||
playsound(E, s, 100, FALSE, max(width, height) - world.view)
|
||||
|
||||
#undef DOCKING_PORT_HIGHLIGHT
|
||||
|
||||
Reference in New Issue
Block a user