mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
+37






![tgstation-ci[bot] <179393467+tgstation-ci[bot]@users.noreply.github.com>](/assets/img/avatar_default.png)


Alexis
GitHub
tgstation-ci[bot] <179393467+tgstation-ci[bot]@users.noreply.github.com>
ArcaneMusic
MrMelbert
Rhials
rageguy505
LemonInTheDark
John Willard
Aliceee2ch
Time-Green
Tsar-Salat
SmArtKar
Maxipat
SyncIt21
deltanedas
SimplyLogan
loganuk
Leland Kemble
FalloutFalcon
Roxy
Lucy
siliconOpossum
Isratosh
TheRyeGuyWhoWillNowDie
Neocloudy
Alexander V.
ElGitificador
Twaticus
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bloop
Cameron Lennox
Tim
Iamgoofball
Layzu666
Arturlang
_0Steven
mrmanlikesbt
Ben10Omintrix
John F. Kennedy
Cursor
Josh
Josh Powell
Yobrocharlie
Hardly3D
shayoki
LT3
21b4095dfd
Upstream 04/17/2026 fixes https://github.com/Bubberstation/Bubberstation/issues/5549 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: tgstation-ci[bot] <179393467+tgstation-ci[bot]@users.noreply.github.com> Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com> Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Co-authored-by: Rhials <28870487+Rhials@users.noreply.github.com> Co-authored-by: rageguy505 <54517726+rageguy505@users.noreply.github.com> Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Co-authored-by: Aliceee2ch <160794176+Aliceee2ch@users.noreply.github.com> Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com> Co-authored-by: Tsar-Salat <62388554+Tsar-Salat@users.noreply.github.com> Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com> Co-authored-by: Maxipat <108554989+Maxipat112@users.noreply.github.com> Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com> Co-authored-by: SimplyLogan <47579821+loganuk@users.noreply.github.com> Co-authored-by: loganuk <fakeemail123@aol.com> Co-authored-by: Leland Kemble <70413276+lelandkemble@users.noreply.github.com> Co-authored-by: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com> Co-authored-by: Roxy <75404941+TealSeer@users.noreply.github.com> Co-authored-by: Lucy <lucy@absolucy.moe> Co-authored-by: siliconOpossum <138069572+siliconOpossum@users.noreply.github.com> Co-authored-by: Isratosh <Isratosh@hotmail.com> Co-authored-by: TheRyeGuyWhoWillNowDie <70169560+TheRyeGuyWhoWillNowDie@users.noreply.github.com> Co-authored-by: Neocloudy <88008002+Neocloudy@users.noreply.github.com> Co-authored-by: Alexander V. <volas@ya.ru> Co-authored-by: ElGitificador <168473461+ElGitificador@users.noreply.github.com> Co-authored-by: Twaticus <46540570+Twaticus@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> Co-authored-by: Cameron Lennox <killer65311@gmail.com> Co-authored-by: Tim <timothymtorres@gmail.com> Co-authored-by: Iamgoofball <iamgoofball@gmail.com> Co-authored-by: Layzu666 <121319428+Layzu666@users.noreply.github.com> Co-authored-by: Arturlang <24881678+Arturlang@users.noreply.github.com> Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com> Co-authored-by: mrmanlikesbt <99309552+mrmanlikesbt@users.noreply.github.com> Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com> Co-authored-by: John F. Kennedy <54908920+MacaroniCritter@users.noreply.github.com> Co-authored-by: Cursor <102828457+theselfish@users.noreply.github.com> Co-authored-by: Josh <josh.adam.powell@gmail.com> Co-authored-by: Josh Powell <josh.powell@softwire.com> Co-authored-by: Yobrocharlie <Charliemiller5617@gmail.com> Co-authored-by: Hardly3D <66234359+Hardly3D@users.noreply.github.com> Co-authored-by: shayoki <96078776+shayoki@users.noreply.github.com> Co-authored-by: LT3 <83487515+lessthnthree@users.noreply.github.com>
179 lines
5.5 KiB
Plaintext
179 lines
5.5 KiB
Plaintext
/obj/vehicle/sealed
|
|
flags_1 = PREVENT_CONTENTS_EXPLOSION_1
|
|
interaction_flags_atom = parent_type::interaction_flags_atom | INTERACT_ATOM_IGNORE_MOBILITY
|
|
interaction_flags_mouse_drop = NEED_HANDS
|
|
|
|
var/enter_delay = 2 SECONDS
|
|
var/mouse_pointer
|
|
var/headlights_toggle = FALSE
|
|
///Determines which occupants provide access when bumping into doors
|
|
var/access_provider_flags = VEHICLE_CONTROL_DRIVE
|
|
|
|
/obj/vehicle/sealed/Initialize(mapload)
|
|
. = ..()
|
|
RegisterSignal(src, COMSIG_SUPERMATTER_CONSUMED, PROC_REF(on_entered_supermatter))
|
|
|
|
/obj/vehicle/sealed/generate_actions()
|
|
. = ..()
|
|
initialize_passenger_action_type(/datum/action/vehicle/sealed/climb_out)
|
|
|
|
/obj/vehicle/sealed/generate_action_type()
|
|
var/datum/action/vehicle/sealed/E = ..()
|
|
. = E
|
|
if(istype(E))
|
|
E.vehicle_entered_target = src
|
|
|
|
/obj/vehicle/sealed/mouse_drop_receive(atom/dropping, mob/M, params)
|
|
if(!istype(dropping) || !istype(M))
|
|
return ..()
|
|
if(M == dropping)
|
|
mob_try_enter(M)
|
|
return ..()
|
|
|
|
/obj/vehicle/sealed/Exited(atom/movable/gone, direction)
|
|
. = ..()
|
|
if(ismob(gone))
|
|
remove_occupant(gone)
|
|
|
|
// so that we can check the access of the vehicle's occupants. Ridden vehicles do this in the riding component, but these don't have that
|
|
/obj/vehicle/sealed/Bump(atom/A)
|
|
. = ..()
|
|
if(istype(A, /obj/machinery/door))
|
|
var/obj/machinery/door/conditionalwall = A
|
|
for(var/mob/occupant as anything in return_controllers_with_flag(access_provider_flags))
|
|
if(conditionalwall.try_safety_unlock(occupant) || !conditionalwall.can_open_with_hands)
|
|
return
|
|
conditionalwall.bumpopen(occupant)
|
|
|
|
/obj/vehicle/sealed/after_add_occupant(mob/M)
|
|
. = ..()
|
|
ADD_TRAIT(M, TRAIT_HANDS_BLOCKED, VEHICLE_TRAIT)
|
|
|
|
|
|
/obj/vehicle/sealed/after_remove_occupant(mob/M)
|
|
. = ..()
|
|
REMOVE_TRAIT(M, TRAIT_HANDS_BLOCKED, VEHICLE_TRAIT)
|
|
|
|
|
|
/obj/vehicle/sealed/proc/mob_try_enter(mob/rider)
|
|
if(!istype(rider))
|
|
return FALSE
|
|
var/enter_delay = get_enter_delay(rider)
|
|
if (enter_delay == 0)
|
|
if (enter_checks(rider))
|
|
mob_enter(rider)
|
|
return TRUE
|
|
return FALSE
|
|
if (do_after(rider, enter_delay, src, timed_action_flags = IGNORE_HELD_ITEM, extra_checks = CALLBACK(src, PROC_REF(enter_checks), rider)))
|
|
mob_enter(rider)
|
|
return TRUE
|
|
return FALSE
|
|
|
|
/// returns enter do_after delay for the given mob in ticks
|
|
/obj/vehicle/sealed/proc/get_enter_delay(mob/M)
|
|
return enter_delay
|
|
|
|
///Extra checks to perform during the do_after to enter the vehicle
|
|
/obj/vehicle/sealed/proc/enter_checks(mob/M)
|
|
return occupant_amount() < max_occupants
|
|
|
|
/obj/vehicle/sealed/proc/mob_enter(mob/M, silent = FALSE)
|
|
if(!istype(M))
|
|
return FALSE
|
|
if(!silent)
|
|
M.visible_message(span_notice("[M] climbs into \the [src]!"))
|
|
M.forceMove(src)
|
|
add_occupant(M)
|
|
return TRUE
|
|
|
|
/obj/vehicle/sealed/proc/mob_try_exit(mob/M, mob/user, silent = FALSE, randomstep = FALSE)
|
|
mob_exit(M, silent, randomstep)
|
|
|
|
/obj/vehicle/sealed/proc/mob_exit(mob/M, silent = FALSE, randomstep = FALSE)
|
|
if(!istype(M))
|
|
return FALSE
|
|
remove_occupant(M)
|
|
if(!isAI(M))//This is the ONE mob we don't want to be moved to the vehicle that should be handled when used
|
|
M.forceMove(exit_location(M))
|
|
else
|
|
return TRUE
|
|
if(randomstep)
|
|
var/turf/target_turf = get_step(exit_location(M), pick(GLOB.cardinals))
|
|
M.throw_at(target_turf, 5, 10)
|
|
|
|
if(!silent)
|
|
M.visible_message(span_notice("[M] drops out of \the [src]!"))
|
|
return TRUE
|
|
|
|
/obj/vehicle/sealed/proc/exit_location(M)
|
|
return drop_location()
|
|
|
|
/obj/vehicle/sealed/item_interaction(mob/living/user, obj/item/tool, list/modifiers)
|
|
if(!key_type || is_key(inserted_key) || !is_key(tool))
|
|
return NONE
|
|
|
|
if(!user.transferItemToLoc(tool, src))
|
|
to_chat(user, span_warning("[tool] seems to be stuck to your hand!"))
|
|
return ITEM_INTERACT_BLOCKING
|
|
|
|
to_chat(user, span_notice("You insert [tool] into [src]."))
|
|
if(inserted_key) // Just in case there's an invalid key
|
|
inserted_key.forceMove(drop_location())
|
|
inserted_key = tool
|
|
inserted_key.forceMove(src)
|
|
return ITEM_INTERACT_SUCCESS
|
|
|
|
/obj/vehicle/sealed/proc/remove_key(mob/user)
|
|
if(!inserted_key)
|
|
to_chat(user, span_warning("There is no key in [src]!"))
|
|
return
|
|
if(!is_occupant(user) || !(occupants[user] & VEHICLE_CONTROL_DRIVE))
|
|
to_chat(user, span_warning("You must be driving [src] to remove [src]'s key!"))
|
|
return
|
|
to_chat(user, span_notice("You remove [inserted_key] from [src]."))
|
|
if(!HAS_TRAIT(user, TRAIT_HANDS_BLOCKED))
|
|
user.put_in_hands(inserted_key)
|
|
else
|
|
inserted_key.equip_to_best_slot(user)
|
|
inserted_key = null
|
|
|
|
/obj/vehicle/sealed/Destroy()
|
|
dump_mobs()
|
|
return ..()
|
|
|
|
/obj/vehicle/sealed/proc/dump_mobs(randomstep = TRUE)
|
|
for(var/i in occupants)
|
|
mob_exit(i, randomstep = randomstep)
|
|
if(iscarbon(i))
|
|
var/mob/living/carbon/Carbon = i
|
|
Carbon.Paralyze(40)
|
|
|
|
/obj/vehicle/sealed/proc/dump_specific_mobs(flag, randomstep = TRUE)
|
|
for(var/i in occupants)
|
|
if(!(occupants[i] & flag))
|
|
continue
|
|
mob_exit(i, randomstep = randomstep)
|
|
if(iscarbon(i))
|
|
var/mob/living/carbon/C = i
|
|
C.Paralyze(40)
|
|
|
|
|
|
/obj/vehicle/sealed/AllowDrop()
|
|
return FALSE
|
|
|
|
/obj/vehicle/sealed/relaymove(mob/living/user, direction)
|
|
if(canmove)
|
|
vehicle_move(direction)
|
|
return TRUE
|
|
|
|
/// Sinced sealed vehicles (cars and mechs) don't have riding components, the actual movement is handled here from [/obj/vehicle/sealed/proc/relaymove]
|
|
/obj/vehicle/sealed/proc/vehicle_move(direction)
|
|
return FALSE
|
|
|
|
/// When we touch a crystal, kill everything inside us
|
|
/obj/vehicle/sealed/proc/on_entered_supermatter(atom/movable/vehicle, atom/movable/supermatter)
|
|
SIGNAL_HANDLER
|
|
for (var/mob/passenger as anything in occupants)
|
|
if(!isAI(passenger))
|
|
passenger.Bump(supermatter)
|