mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
Adds a new area flag, LOCAL_TELEPORT, given to virtual domains and deathmatch arenas. (#88756)
## About The Pull Request Adds a new area flag, LOCAL_TELEPORT. This flag allows teleports ONLY in the same area that the teleport is used. This allows for short range hijinks without enabling long range exploits, and thus it's given to DMs and domains. Changed almost all area_flags & NO_TELEPORT checks to use check_teleport() (as now areas may use local_teleport instead, and this lets them check for multiple things instead) Thus I re-added Void Phase to the heretic scribe in DM and shuffled some stuff around (realizing now i neglected to doublecheck if blade breaking tps you to station. need to check just in case) ## Why It's Good For The Game It sucks you can't use teleporting abilities in temporary areas, so this is a good way to allow this to still happen without opening the way for gamebreaking exploits. ## Changelog 🆑 code: Adds a new area flag, LOCAL_TELEPORT, given to virtual domains and deathmatch arenas. code: Re-added Void Phase to Heretic Scribes in Deathmatch's Ragnarok map. /🆑
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 ..()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 ..()
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user