mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
[READY] The Portal Update - Linked portals, momentum conservation, and more! (#28055)
* THE PORTAL UPDATE * portal gun checks * damn functions * o_range(s) * Atmos Portals (#12) * Rod Form's damage now scales with how much it's upgraded * buffs chem grenades * Fix getrev runtime * Automatic changelog generation for PR #27948 [ci skip] * Automatic changelog generation for PR #27951 [ci skip] * Fixes admiral recall (#27861) * the man with the 2 shotguns that blasted me to the end of the world with dualwielding. nerf (#27978) * Beam rifles now slowdown while scoped (#27898) * Update beam_rifle.dm * Update beam_rifle.dm * Update beam_rifle.dm * Fixes a very silly clockwork false wall trick (#27996) * Fixes #27979 (#28002) * Automatic changelog generation for PR #28002 [ci skip] * Fixes #27989 : Riot suits no longer hide jumpsuits (#28003) * Fixes #27989 * remove tag * Automatic changelog generation for PR #28003 [ci skip] * Refactors a cooldown var to not require a spawn or sleep (#28011) * wat (#28012) * Remove spawns in favour of stacktrace calls, which don't stop the called (#28013) proc * Refactor another spawned cooldown var (#28014) * Come on, pathetic (#28015) * Refactor another spawn cooldown (#28016) * Goodbye spawn (#28017) * Another spawn timer (#28018) * Remove a commented out function (#28019) * Gotta go with the fro2.0 (#28010) * This doesn't do anything (#28020) * refactor another spawn cooldown (#28022) * Refactors another spawn cooldown var (#28023) * Refactor another spawn (#28024) * Refactor another spawn var (#28027) * woops * woops2 * atmos links! * unused * wew * ffs! * Forced updates * update * Update portals.dm * adjacent/atmospass checks * Create portals.dm * Update portals.dm * Update other_tools.dm * stuff * crossed * documentation * reee * no portal stacking! * woops
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
var/soundout //soundfile to play after teleportation
|
||||
var/force_teleport = 1 //if false, teleport will use Move() proc (dense objects will prevent teleportation)
|
||||
|
||||
|
||||
/datum/teleport/proc/start(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null)
|
||||
if(!initTeleport(arglist(args)))
|
||||
return 0
|
||||
@@ -100,21 +99,7 @@
|
||||
|
||||
var/turf/destturf
|
||||
var/turf/curturf = get_turf(teleatom)
|
||||
if(precision)
|
||||
var/list/posturfs = list()
|
||||
var/center = get_turf(destination)
|
||||
if(!center)
|
||||
center = destination
|
||||
for(var/turf/T in range(precision,center))
|
||||
if(T.is_transition_turf())
|
||||
continue // Avoid picking these.
|
||||
var/area/A = T.loc
|
||||
if(!A.noteleport)
|
||||
posturfs.Add(T)
|
||||
|
||||
destturf = safepick(posturfs)
|
||||
else
|
||||
destturf = get_turf(destination)
|
||||
destturf = get_teleport_turf(get_turf(destination), precision)
|
||||
|
||||
if(!destturf || !curturf || destturf.is_transition_turf())
|
||||
return 0
|
||||
@@ -124,13 +109,16 @@
|
||||
return 0
|
||||
|
||||
playSpecials(curturf,effectin,soundin)
|
||||
|
||||
if(force_teleport)
|
||||
teleatom.forceMove(destturf)
|
||||
if(ismegafauna(teleatom))
|
||||
message_admins("[teleatom] [ADMIN_FLW(teleatom)] has teleported from [ADMIN_COORDJMP(curturf)] to [ADMIN_COORDJMP(destturf)].")
|
||||
playSpecials(destturf,effectout,soundout)
|
||||
else
|
||||
if(teleatom.Move(destturf))
|
||||
playSpecials(destturf,effectout,soundout)
|
||||
if(ismegafauna(teleatom))
|
||||
message_admins("[teleatom] [ADMIN_FLW(teleatom)] has teleported from [ADMIN_COORDJMP(curturf)] to [ADMIN_COORDJMP(destturf)].")
|
||||
return 1
|
||||
|
||||
/datum/teleport/proc/teleport()
|
||||
@@ -225,3 +213,18 @@
|
||||
|
||||
// DING! You have passed the gauntlet, and are "probably" safe.
|
||||
return F
|
||||
|
||||
/proc/get_teleport_turfs(turf/center, precision = 0)
|
||||
if(!precision)
|
||||
return list(center)
|
||||
var/list/posturfs = list()
|
||||
for(var/turf/T in range(precision,center))
|
||||
if(T.is_transition_turf())
|
||||
continue // Avoid picking these.
|
||||
var/area/A = T.loc
|
||||
if(!A.noteleport)
|
||||
posturfs.Add(T)
|
||||
return posturfs
|
||||
|
||||
/proc/get_teleport_turf(turf/center, precision = 0)
|
||||
return safepick(get_teleport_turfs(center, precision))
|
||||
|
||||
Reference in New Issue
Block a user