Wormhole jaunter fix (and replace lighting checks with simulated) and disk compartmentalizer fix

This commit is contained in:
Mark van Alphen
2019-06-03 21:44:01 +02:00
parent bab051a084
commit cd362d6bad
19 changed files with 154 additions and 100 deletions
+1 -1
View File
@@ -12,7 +12,7 @@
var/last_bumped = 0
var/pass_flags = 0
var/germ_level = GERM_LEVEL_AMBIENT // The higher the germ level, the more germ on the atom.
var/simulated = 1 //filter for actions - used by lighting overlays
var/simulated = TRUE //filter for actions - used by lighting overlays
var/atom_say_verb = "says"
var/dont_save = 0 // For atoms that are temporary by necessity - like lighting overlays
+6 -9
View File
@@ -380,23 +380,20 @@
//Overlays
/atom/movable/overlay
var/atom/master = null
anchored = 1
anchored = TRUE
simulated = FALSE
/atom/movable/overlay/New()
verbs.Cut()
return
/atom/movable/overlay/attackby(a, b, c)
if(src.master)
return src.master.attackby(a, b, c)
return
if(master)
return master.attackby(a, b, c)
/atom/movable/overlay/attack_hand(a, b, c)
if(src.master)
return src.master.attack_hand(a, b, c)
return
if(master)
return master.attack_hand(a, b, c)
/atom/movable/proc/water_act(volume, temperature, source, method = TOUCH) //amount of water acting : temperature of water in kelvin : object that called it (for shennagins)
return TRUE
@@ -181,8 +181,10 @@
S.Integrate(src)
return FALSE
/atom/movable/lighting_object/swarmer_act()
return FALSE
/atom/movable/swarmer_act()
if(!simulated)
return FALSE
return ..()
/obj/effect/swarmer_act()
return FALSE
+75 -27
View File
@@ -3,68 +3,116 @@
desc = "Looks unstable. Best to test it with the clown."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "portal"
density = 1
unacidable = 1//Can't destroy energy portals.
var/failchance = 5
density = TRUE
unacidable = TRUE
anchored = TRUE
var/obj/item/target = null
var/creator = null
anchored = 1
var/precision = 1 // how close to the portal you will teleport. 0 = on the portal, 1 = adjacent
var/can_multitool_to_remove = 0
var/failchance = 5
var/fail_icon = "portal1"
var/precision = TRUE // how close to the portal you will teleport. FALSE = on the portal, TRUE = adjacent
var/can_multitool_to_remove = FALSE
var/ignore_tele_proof_area_setting = FALSE
/obj/effect/portal/Bumped(mob/M as mob|obj)
teleport(M)
/obj/effect/portal/New(loc, turf/target, creator=null, lifespan=300)
/obj/effect/portal/New(loc, turf/target, creator = null, lifespan = 300)
..()
GLOB.portals += src
src.loc = loc
src.target = target
src.creator = creator
if(lifespan > 0)
spawn(lifespan)
qdel(src)
/obj/effect/portal/Destroy()
GLOB.portals -= src
if(istype(creator, /obj))
if(isobj(creator))
var/obj/O = creator
O.portal_destroyed(src)
creator = null
target = null
return ..()
/obj/effect/portal/proc/teleport(atom/movable/M as mob|obj)
if(istype(M, /obj/effect)) //sparks don't teleport
/obj/effect/portal/singularity_pull()
return
/obj/effect/portal/singularity_act()
return
/obj/effect/portal/Crossed(atom/movable/AM)
if(isobserver(AM))
return ..()
if(!teleport(AM))
return ..()
/obj/effect/portal/attack_tk(mob/user)
return
/obj/effect/portal/attack_hand(mob/user)
. = ..()
if(.)
return
if(M.anchored&&istype(M, /obj/mecha))
return
if(!( target ))
qdel(src)
return
if(istype(M, /atom/movable))
if(prob(failchance))
src.icon_state = "portal1"
if(!do_teleport(M, locate(rand(5, world.maxx - 5), rand(5, world.maxy -5), 3), 0, bypass_area_flag = ignore_tele_proof_area_setting)) // Try to send them to deep space.
invalid_teleport()
else
if(!do_teleport(M, target, precision, bypass_area_flag = ignore_tele_proof_area_setting)) // Try to send them to a turf adjacent to target.
invalid_teleport()
if(get_turf(user) == get_turf(src))
teleport(user)
if(Adjacent(user))
user.forceMove(get_turf(src))
/obj/effect/portal/attack_ghost(mob/dead/observer/O)
if(target)
O.forceMove(target)
/obj/effect/portal/attackby(obj/item/A, mob/user)
if(istype(A, /obj/item/multitool) && can_multitool_to_remove)
if(ismultitool(A) && can_multitool_to_remove)
qdel(src)
else if(user && Adjacent(user))
user.forceMove(get_turf(src))
return TRUE
/obj/effect/portal/proc/teleport(atom/movable/M, force = FALSE)
if(!istype(M))
return
if(iseffect(M) || !M.simulated)
return
if(M.anchored && ismecha(M))
return
if(!target)
qdel(src)
return
if(ismegafauna(M))
message_admins("[M] has used a portal at [ADMIN_VERBOSEJMP(src)] made by [key_name_admin(usr)].")
if(prob(failchance))
icon_state = fail_icon
if(!do_teleport(M, locate(rand(5, world.maxx - 5), rand(5, world.maxy -5), 3), 0, bypass_area_flag = ignore_tele_proof_area_setting)) // Try to send them to deep space.
invalid_teleport()
else
if(!do_teleport(M, target, precision, bypass_area_flag = ignore_tele_proof_area_setting)) // Try to send them to a turf adjacent to target.
invalid_teleport()
/obj/effect/portal/proc/invalid_teleport()
visible_message("<span class='warning'>[src] flickers and fails due to bluespace interference!</span>")
do_sparks(5, 0, loc)
qdel(src)
/obj/effect/portal/redspace
name = "redspace portal"
desc = "A portal capable of bypassing bluespace interference."
icon_state = "portal1"
failchance = 0
precision = 0
ignore_tele_proof_area_setting = TRUE
ignore_tele_proof_area_setting = TRUE
+2 -2
View File
@@ -8,7 +8,7 @@
canSmoothWith = list(/turf/simulated/floor/chasm)
density = TRUE //This will prevent hostile mobs from pathing into chasms, while the canpass override will still let it function like an open turf
var/static/list/falling_atoms = list() //Atoms currently falling into the chasm
var/static/list/forbidden_types = typecacheof(list(/obj/effect/portal, /obj/singularity, /obj/structure/stone_tile, /obj/item/projectile, /obj/effect/temp_visual, /obj/effect/collapse, /obj/effect/collapse, /atom/movable/lighting_object))
var/static/list/forbidden_types = typecacheof(list(/obj/effect/portal, /obj/singularity, /obj/structure/stone_tile, /obj/item/projectile, /obj/effect/temp_visual, /obj/effect/collapse, /obj/effect/collapse))
var/drop_x = 1
var/drop_y = 1
var/drop_z = 1
@@ -75,7 +75,7 @@
return FALSE
if(!isliving(AM) && !isobj(AM))
return FALSE
if(is_type_in_typecache(AM, forbidden_types) || AM.throwing)
if(is_type_in_typecache(AM, forbidden_types) || !AM.simulated || AM.throwing)
return FALSE
//Flies right over the chasm
if(isliving(AM))
+4 -4
View File
@@ -53,13 +53,13 @@
return FALSE
var/thing_to_check = src
if (AM)
if(AM)
thing_to_check = list(AM)
for(var/thing in thing_to_check)
if(istype(thing, /atom/movable/lighting_object) || istype(thing, /atom/movable/overlay))
continue
if(isobj(thing))
var/obj/O = thing
if(!O.simulated)
continue
if((O.resistance_flags & (LAVA_PROOF|INDESTRUCTIBLE)) || O.throwing)
continue
. = 1
@@ -71,7 +71,7 @@
O.resistance_flags &= ~FIRE_PROOF
O.fire_act(10000, 1000)
else if (isliving(thing))
else if(isliving(thing))
. = 1
var/mob/living/L = thing
if(L.flying)
+2 -4
View File
@@ -491,16 +491,14 @@
var/turf/T0 = src
for(var/X in T0.GetAllContents())
var/atom/A = X
if(!A.simulated)
continue
if(istype(A, /mob/dead))
continue
if(istype(A, /obj/effect/landmark))
continue
if(istype(A, /obj/docking_port))
continue
if(istype(A, /atom/movable/lighting_object))
continue
if(!A.simulated)
continue
qdel(A, force=TRUE)
T0.ChangeTurf(turf_type)