diff --git a/code/__DEFINES/_flags.dm b/code/__DEFINES/_flags.dm index 4dff2007b39..d27f0c1e5e0 100644 --- a/code/__DEFINES/_flags.dm +++ b/code/__DEFINES/_flags.dm @@ -144,6 +144,8 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204 #define UNLIMITED_FISHING (1<<19) /// This area is prevented from having gravity (ie. space, nearstation, or outside solars) #define NO_GRAVITY (1<<20) +/// This area can be teleported in, but -only- to locations within that same area. +#define LOCAL_TELEPORT (1<<21) /* These defines are used specifically with the atom/pass_flags bitmask diff --git a/code/datums/actions/items/vortex_recall.dm b/code/datums/actions/items/vortex_recall.dm index 50702933f1d..70107dd044e 100644 --- a/code/datums/actions/items/vortex_recall.dm +++ b/code/datums/actions/items/vortex_recall.dm @@ -5,11 +5,11 @@ button_icon_state = "vortex_recall" /datum/action/item_action/vortex_recall/IsAvailable(feedback = FALSE) - var/area/current_area = get_area(target) - if(!current_area || current_area.area_flags & NOTELEPORT) + if(!istype(target, /obj/item/hierophant_club)) + return + var/obj/item/hierophant_club/teleport_stick = target + if(teleport_stick.teleporting) + return FALSE + if(teleport_stick.beacon && !check_teleport_valid(owner, get_turf(teleport_stick.beacon), TELEPORT_CHANNEL_FREE)) return FALSE - if(istype(target, /obj/item/hierophant_club)) - var/obj/item/hierophant_club/teleport_stick = target - if(teleport_stick.teleporting) - return FALSE return ..() diff --git a/code/datums/components/dejavu.dm b/code/datums/components/dejavu.dm index fefa9d7e6be..38bec8a25c6 100644 --- a/code/datums/components/dejavu.dm +++ b/code/datums/components/dejavu.dm @@ -81,8 +81,7 @@ //comes after healing so new limbs comically drop to the floor if(starting_turf) - var/area/destination_area = starting_turf.loc - if(destination_area.area_flags & NOTELEPORT) + if(check_teleport_valid(parent, starting_turf)) to_chat(parent, span_warning("For some reason, your head aches and fills with mental fog when you try to think of where you were... It feels like you're now going against some dull, unstoppable universal force.")) else var/atom/movable/master = parent diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm index b51f7097a9f..8b57ce3c422 100644 --- a/code/datums/helper_datums/teleport.dm +++ b/code/datums/helper_datums/teleport.dm @@ -227,6 +227,10 @@ if((origin_area.area_flags & NOTELEPORT) || (destination_area.area_flags & NOTELEPORT)) return FALSE + // If one of the areas you're trying to tp to has local_teleport, and they're not the same, return. + if(((origin_area.area_flags & LOCAL_TELEPORT) || (destination_area.area_flags & LOCAL_TELEPORT)) && destination_area != origin_area) + return FALSE + if(SEND_SIGNAL(teleported_atom, COMSIG_MOVABLE_TELEPORTING, destination, channel) & COMPONENT_BLOCK_TELEPORT) return FALSE diff --git a/code/game/machinery/computer/teleporter.dm b/code/game/machinery/computer/teleporter.dm index 74e6d22e363..7e34dae7025 100644 --- a/code/game/machinery/computer/teleporter.dm +++ b/code/game/machinery/computer/teleporter.dm @@ -233,8 +233,7 @@ return FALSE if(is_centcom_level(T.z) || is_away_level(T.z)) return FALSE - var/area/A = get_area(T) - if(!A || (A.area_flags & NOTELEPORT)) + if(!check_teleport_valid(AM, get_turf(src))) return FALSE return TRUE diff --git a/code/game/objects/effects/anomalies/anomalies_bluespace.dm b/code/game/objects/effects/anomalies/anomalies_bluespace.dm index 5c941050bfd..7ab83ed0e38 100644 --- a/code/game/objects/effects/anomalies/anomalies_bluespace.dm +++ b/code/game/objects/effects/anomalies/anomalies_bluespace.dm @@ -40,8 +40,7 @@ continue if(is_centcom_level(turf.z) || is_away_level(turf.z)) continue - var/area/area = get_area(turf) - if(!area || (area.area_flags & NOTELEPORT)) + if(!check_teleport_valid(src, turf)) continue possible += beacon diff --git a/code/game/objects/items/implants/security/implant_beacon.dm b/code/game/objects/items/implants/security/implant_beacon.dm index 5851566d06a..126d0e8f1b4 100644 --- a/code/game/objects/items/implants/security/implant_beacon.dm +++ b/code/game/objects/items/implants/security/implant_beacon.dm @@ -25,7 +25,7 @@ var/list/info_shown = ..() var/area/destination_area = get_area(imp_in) - if(isnull(destination_area) || (destination_area.area_flags & NOTELEPORT)) + if(isnull(destination_area) || check_teleport_valid(imp_in, usr)) info_shown["Status"] = "Implant carrier teleport signal cannot be reached!" else var/turf/turf_to_check = get_turf(imp_in) diff --git a/code/game/objects/items/teleportation.dm b/code/game/objects/items/teleportation.dm index ad62f3c0867..4ceae79f673 100644 --- a/code/game/objects/items/teleportation.dm +++ b/code/game/objects/items/teleportation.dm @@ -176,8 +176,7 @@ if(!target) computer.target_ref = null continue - var/area/computer_area = get_area(target) - if(!computer_area || (computer_area.area_flags & NOTELEPORT)) + if(!check_teleport_valid(user, get_turf(computer), TELEPORT_CHANNEL_BLUESPACE)) continue if(!computer.power_station || !computer.power_station.teleporter_hub) @@ -235,8 +234,7 @@ continue //putting them at the edge is dumb if(dangerous_turf.y > world.maxy - PORTAL_DANGEROUS_EDGE_LIMIT || dangerous_turf.y < PORTAL_DANGEROUS_EDGE_LIMIT) continue - var/area/dangerous_area = dangerous_turf.loc - if(dangerous_area.area_flags & NOTELEPORT) + if(!check_teleport_valid(src, teleport_location)) continue dangerous_turfs += dangerous_turf @@ -252,8 +250,7 @@ to_chat(user, span_notice("[src] vibrates, then stops. Maybe you should try something else.")) return - var/area/teleport_area = get_area(teleport_target) - if (teleport_area.area_flags & NOTELEPORT) + if(!check_teleport_valid(src, teleport_target)) to_chat(user, span_notice("[src] is malfunctioning.")) return @@ -288,8 +285,7 @@ ///Is, for some reason, separate from the teleport target's check in try_create_portal_to() /obj/item/hand_tele/proc/can_teleport_notifies(mob/user) var/turf/current_location = get_turf(user) - var/area/current_area = current_location.loc - if (!current_location || (current_area.area_flags & NOTELEPORT) || is_away_level(current_location.z) || !isturf(user.loc)) + if (!current_location || check_teleport_valid(src, current_location) || is_away_level(current_location.z) || !isturf(user.loc)) to_chat(user, span_notice("[src] is malfunctioning.")) return FALSE @@ -455,10 +451,9 @@ playsound(destination, SFX_PORTAL_ENTER, 50, 1, SHORT_RANGE_SOUND_EXTRARANGE) /obj/item/syndicate_teleporter/proc/malfunctioning(mob/guy_teleporting, turf/current_location) - var/area/current_area = get_area(current_location) if(!current_location) return TRUE - if(current_area.area_flags & NOTELEPORT) + if(!check_teleport_valid(src, current_location)) return TRUE if(is_away_level(current_location.z)) return TRUE diff --git a/code/modules/bitrunning/areas.dm b/code/modules/bitrunning/areas.dm index f0ad122effc..74c6aa3c15c 100644 --- a/code/modules/bitrunning/areas.dm +++ b/code/modules/bitrunning/areas.dm @@ -14,7 +14,7 @@ name = "Virtual Domain Ruins" icon_state = "bit_ruin" icon = 'icons/area/areas_station.dmi' - area_flags = UNIQUE_AREA | NOTELEPORT | EVENT_PROTECTED | HIDDEN_AREA | UNLIMITED_FISHING + area_flags = UNIQUE_AREA | LOCAL_TELEPORT | EVENT_PROTECTED | HIDDEN_AREA | UNLIMITED_FISHING default_gravity = STANDARD_GRAVITY requires_power = FALSE @@ -26,7 +26,7 @@ /area/virtual_domain/safehouse name = "Virtual Domain Safehouse" - area_flags = UNIQUE_AREA | NOTELEPORT | EVENT_PROTECTED | VIRTUAL_SAFE_AREA | UNLIMITED_FISHING + area_flags = UNIQUE_AREA | LOCAL_TELEPORT | EVENT_PROTECTED | VIRTUAL_SAFE_AREA | UNLIMITED_FISHING icon_state = "bit_safe" requires_power = FALSE sound_environment = SOUND_ENVIRONMENT_ROOM @@ -36,30 +36,30 @@ /area/lavaland/surface/outdoors/virtual_domain name = "Virtual Domain Lava Ruins" icon_state = "bit_ruin" - area_flags = UNIQUE_AREA | NOTELEPORT | EVENT_PROTECTED | HIDDEN_AREA | UNLIMITED_FISHING + area_flags = UNIQUE_AREA | LOCAL_TELEPORT | EVENT_PROTECTED | HIDDEN_AREA | UNLIMITED_FISHING /area/icemoon/underground/explored/virtual_domain name = "Virtual Domain Ice Ruins" icon_state = "bit_ice" - area_flags = UNIQUE_AREA | NOTELEPORT | EVENT_PROTECTED | HIDDEN_AREA | UNLIMITED_FISHING + area_flags = UNIQUE_AREA | LOCAL_TELEPORT | EVENT_PROTECTED | HIDDEN_AREA | UNLIMITED_FISHING /area/ruin/space/virtual_domain name = "Virtual Domain Unexplored Location" icon = 'icons/area/areas_station.dmi' icon_state = "bit_ruin" - area_flags = UNIQUE_AREA | NOTELEPORT | EVENT_PROTECTED | HIDDEN_AREA | UNLIMITED_FISHING + area_flags = UNIQUE_AREA | LOCAL_TELEPORT | EVENT_PROTECTED | HIDDEN_AREA | UNLIMITED_FISHING /area/space/virtual_domain name = "Virtual Domain Space" icon = 'icons/area/areas_station.dmi' icon_state = "bit_space" - area_flags = UNIQUE_AREA | NOTELEPORT | EVENT_PROTECTED | HIDDEN_AREA | UNLIMITED_FISHING + area_flags = UNIQUE_AREA | LOCAL_TELEPORT | EVENT_PROTECTED | HIDDEN_AREA | UNLIMITED_FISHING ///Areas that virtual entities should not be in /area/virtual_domain/protected_space name = "Virtual Domain Safe Zone" - area_flags = UNIQUE_AREA | NOTELEPORT | EVENT_PROTECTED | VIRTUAL_SAFE_AREA | UNLIMITED_FISHING + area_flags = UNIQUE_AREA | LOCAL_TELEPORT | EVENT_PROTECTED | VIRTUAL_SAFE_AREA | UNLIMITED_FISHING icon_state = "bit_safe" /area/virtual_domain/protected_space/fullbright diff --git a/code/modules/deathmatch/deathmatch_loadouts.dm b/code/modules/deathmatch/deathmatch_loadouts.dm index b80ec573419..3c015c96f92 100644 --- a/code/modules/deathmatch/deathmatch_loadouts.dm +++ b/code/modules/deathmatch/deathmatch_loadouts.dm @@ -950,7 +950,7 @@ back = /obj/item/storage/backpack/cultpack backpack_contents = list( - /obj/item/restraints/legcuffs/bola/cult, + /obj/item/reagent_containers/cup/beaker/unholywater, /obj/item/reagent_containers/cup/beaker/unholywater, ) @@ -978,7 +978,7 @@ back = /obj/item/storage/backpack/cultpack backpack_contents = list( - /obj/item/reagent_containers/cup/beaker/unholywater, + /obj/item/restraints/legcuffs/bola/cult, /obj/item/reagent_containers/cup/beaker/unholywater, /obj/item/reagent_containers/cup/beaker/unholywater, ) @@ -1086,15 +1086,14 @@ knowledge_to_grant = list( /datum/heretic_knowledge/cosmic_grasp, - /datum/heretic_knowledge/moon_grasp, ) spells_to_add = list( /datum/action/cooldown/spell/touch/mansus_grasp, /datum/action/cooldown/spell/pointed/projectile/star_blast, /datum/action/cooldown/spell/touch/star_touch, - /datum/action/cooldown/spell/pointed/mind_gate, /datum/action/cooldown/spell/aoe/void_pull, + /datum/action/cooldown/spell/pointed/void_phase, ) // Chaplain! No spells (other than smoke), but strong armor and weapons, and immune to others' spells diff --git a/code/modules/deathmatch/deathmatch_mapping.dm b/code/modules/deathmatch/deathmatch_mapping.dm index 62058629cdb..7ef314a917b 100644 --- a/code/modules/deathmatch/deathmatch_mapping.dm +++ b/code/modules/deathmatch/deathmatch_mapping.dm @@ -2,7 +2,7 @@ name = "Deathmatch Arena" requires_power = FALSE default_gravity = STANDARD_GRAVITY - area_flags = UNIQUE_AREA | NOTELEPORT | EVENT_PROTECTED | QUIET_LOGS | NO_DEATH_MESSAGE | BINARY_JAMMING + area_flags = UNIQUE_AREA | LOCAL_TELEPORT | EVENT_PROTECTED | QUIET_LOGS | NO_DEATH_MESSAGE | BINARY_JAMMING /area/deathmatch/fullbright static_lighting = FALSE diff --git a/code/modules/mining/lavaland/tendril_loot.dm b/code/modules/mining/lavaland/tendril_loot.dm index ee3170a624b..498874e0ce0 100644 --- a/code/modules/mining/lavaland/tendril_loot.dm +++ b/code/modules/mining/lavaland/tendril_loot.dm @@ -324,8 +324,7 @@ /obj/item/warp_cube/attack_self(mob/user) var/turf/current_location = get_turf(user) - var/area/current_area = current_location.loc - if(!linked || (current_area.area_flags & NOTELEPORT)) + if(!linked || !check_teleport_valid(src, current_location)) to_chat(user, span_warning("[src] fizzles uselessly.")) return if(teleporting) diff --git a/code/modules/mod/modules/modules_timeline.dm b/code/modules/mod/modules/modules_timeline.dm index da36c2153d0..d16f45f3545 100644 --- a/code/modules/mod/modules/modules_timeline.dm +++ b/code/modules/mod/modules/modules_timeline.dm @@ -159,7 +159,7 @@ /obj/item/mod/module/timeline_jumper/used() var/area/noteleport_check = get_area(mod.wearer) - if(noteleport_check && noteleport_check.area_flags & NOTELEPORT) + if(noteleport_check && check_teleport_valid(mod.wearer, get_turf(mod.wearer))) to_chat(mod.wearer, span_danger("Some dull, universal force is between you and the [phased_mob ? "current timeline" : "stream between timelines"].")) return FALSE return ..() diff --git a/code/modules/research/xenobiology/crossbreeding/consuming.dm b/code/modules/research/xenobiology/crossbreeding/consuming.dm index 28d987e3e3a..92aa82c5dc3 100644 --- a/code/modules/research/xenobiology/crossbreeding/consuming.dm +++ b/code/modules/research/xenobiology/crossbreeding/consuming.dm @@ -227,11 +227,6 @@ Consuming extracts: taste = "sugar and starlight" /obj/item/slime_cookie/bluespace/do_effect(mob/living/eater, mob/user) - var/area/eater_area = get_area(eater) - if (eater_area.area_flags & NOTELEPORT) - fail_effect(eater) - return - var/list/area_turfs = get_area_turfs(get_area(get_turf(eater))) var/turf/target diff --git a/code/modules/spells/spell_types/jaunt/_jaunt.dm b/code/modules/spells/spell_types/jaunt/_jaunt.dm index c4255dc175b..5a50f8ad29f 100644 --- a/code/modules/spells/spell_types/jaunt/_jaunt.dm +++ b/code/modules/spells/spell_types/jaunt/_jaunt.dm @@ -42,7 +42,7 @@ if(!owner_area || !owner_turf) return FALSE // nullspaced? - if(owner_area.area_flags & NOTELEPORT) + if(!check_teleport_valid(owner, owner_turf, TELEPORT_CHANNEL_MAGIC)) if(feedback) to_chat(owner, span_danger("Some dull, universal force is stopping you from jaunting here.")) return FALSE diff --git a/code/modules/vehicles/mecha/_mecha.dm b/code/modules/vehicles/mecha/_mecha.dm index 301f3a71158..202eba2e798 100644 --- a/code/modules/vehicles/mecha/_mecha.dm +++ b/code/modules/vehicles/mecha/_mecha.dm @@ -432,8 +432,7 @@ if(phase_state) flick(phase_state, src) var/turf/destination_turf = get_step(loc, movement_dir) - var/area/destination_area = destination_turf.loc - if(destination_area.area_flags & NOTELEPORT || SSmapping.level_trait(destination_turf.z, ZTRAIT_NOPHASE)) + if(check_teleport_valid(src, destination_turf) || SSmapping.level_trait(destination_turf.z, ZTRAIT_NOPHASE)) return FALSE return TRUE diff --git a/code/modules/vehicles/mecha/equipment/tools/other_tools.dm b/code/modules/vehicles/mecha/equipment/tools/other_tools.dm index 15cc3e6b8cd..77517dde12e 100644 --- a/code/modules/vehicles/mecha/equipment/tools/other_tools.dm +++ b/code/modules/vehicles/mecha/equipment/tools/other_tools.dm @@ -14,8 +14,7 @@ var/teleport_range = 7 /obj/item/mecha_parts/mecha_equipment/teleporter/action(mob/source, atom/target, list/modifiers) - var/area/ourarea = get_area(src) - if(!action_checks(target) || ourarea.area_flags & NOTELEPORT) + if(!action_checks(target) || check_teleport_valid(source, target, TELEPORT_CHANNEL_BLUESPACE)) return var/turf/T = get_turf(target) if(T && (loc.z == T.z) && (get_dist(loc, T) <= teleport_range)) @@ -36,8 +35,7 @@ /obj/item/mecha_parts/mecha_equipment/wormhole_generator/action(mob/source, atom/target, list/modifiers) - var/area/ourarea = get_area(src) - if(!action_checks(target) || ourarea.area_flags & NOTELEPORT) + if(!action_checks(target) || check_teleport_valid(source, target, TELEPORT_CHANNEL_WORMHOLE)) return var/area/targetarea = pick(get_areas_in_range(100, chassis)) if(!targetarea)//Literally middle of nowhere how did you even get here