mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-27 23:29:10 +01:00
Fix lost changes (#6633)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Raeschen <Raeschen@users.noreply.github.com> Co-authored-by: FluffMedic <109300046+FluffMedic@users.noreply.github.com> Co-authored-by: Victor Zisthus <56660717+VictorZisthus@users.noreply.github.com> Co-authored-by: Razgriz1032 <Razgriz1032@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: CHOMPStation2 <58959929+CHOMPStation2@users.noreply.github.com> Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: CHOMPStation2 <chompsation2@gmail.com> Co-authored-by: purplefoxy27 <38367315+purplefoxy27@users.noreply.github.com> Co-authored-by: Casey <a.roaming.shadow@gmail.com> Co-authored-by: Aroliacue <96730930+Aroliacue@users.noreply.github.com>
This commit is contained in:
co-authored by
Raeschen
FluffMedic
Victor Zisthus
Razgriz1032
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
CHOMPStation2
Heroman3003
CHOMPStation2
purplefoxy27
Casey
Aroliacue
parent
66ce5daf87
commit
071905fed5
@@ -55,9 +55,56 @@
|
||||
if(8)
|
||||
pixel_x = -32
|
||||
|
||||
/obj/structure/micro_tunnel/proc/find_destinations()
|
||||
var/list/destinations = list()
|
||||
var/turf/myturf = get_turf(src.loc)
|
||||
var/datum/planet/planet
|
||||
for(var/datum/planet/P in SSplanets.planets)
|
||||
if(myturf.z in P.expected_z_levels)
|
||||
planet = P
|
||||
else
|
||||
for(var/obj/structure/micro_tunnel/t in world)
|
||||
if(t == src)
|
||||
continue
|
||||
if(magic || t.magic)
|
||||
destinations |= t
|
||||
continue
|
||||
if(t.z == z)
|
||||
destinations |= t
|
||||
continue
|
||||
var/turf/targetturf = get_turf(t.loc)
|
||||
if(planet)
|
||||
if(targetturf.z in planet.expected_z_levels)
|
||||
destinations |= t
|
||||
continue
|
||||
else
|
||||
var/above = GetAbove(myturf)
|
||||
if(above && t.z == z + 1)
|
||||
destinations |= t
|
||||
continue
|
||||
var/below = GetBelow(myturf)
|
||||
if(below && t.z == z - 1)
|
||||
destinations |= t
|
||||
return destinations
|
||||
|
||||
/obj/structure/micro_tunnel/attack_hand(mob/living/user)
|
||||
if(!isliving(user))
|
||||
tunnel_interact(user)
|
||||
return ..()
|
||||
|
||||
/obj/structure/micro_tunnel/attack_generic(mob/user, damage, attack_verb)
|
||||
tunnel_interact(user)
|
||||
return ..()
|
||||
|
||||
/obj/structure/micro_tunnel/attack_robot(mob/living/user)
|
||||
var/turf/hole = get_turf(src) //Borgs can click stuff from far away, let's make sure they're next to the hole
|
||||
var/turf/borg = get_turf(user)
|
||||
if(hole.AdjacentQuick(borg))
|
||||
tunnel_interact(user)
|
||||
return ..()
|
||||
|
||||
/obj/structure/micro_tunnel/proc/tunnel_interact(mob/living/user)
|
||||
if(!isliving(user))
|
||||
return
|
||||
if(user.loc == src)
|
||||
var/list/our_options = list("Exit", "Move")
|
||||
|
||||
@@ -83,35 +130,7 @@
|
||||
to_chat(user, "<span class = 'warning'>You can't do that unless you're in \the [src].</span>")
|
||||
return
|
||||
|
||||
var/list/destinations = list()
|
||||
var/turf/myturf = get_turf(src.loc)
|
||||
var/datum/planet/planet
|
||||
for(var/datum/planet/P in SSplanets.planets)
|
||||
if(myturf.z in P.expected_z_levels)
|
||||
planet = P
|
||||
else
|
||||
for(var/obj/structure/micro_tunnel/t in world)
|
||||
if(t == src)
|
||||
continue
|
||||
if(magic || t.magic)
|
||||
destinations |= t
|
||||
continue
|
||||
if(t.z == z)
|
||||
destinations |= t
|
||||
continue
|
||||
var/turf/targetturf = get_turf(t.loc)
|
||||
if(planet)
|
||||
if(targetturf.z in planet.expected_z_levels)
|
||||
destinations |= t
|
||||
continue
|
||||
else
|
||||
var/above = GetAbove(myturf)
|
||||
if(above && t.z == z + 1)
|
||||
destinations |= t
|
||||
continue
|
||||
var/below = GetBelow(myturf)
|
||||
if(below && t.z == z - 1)
|
||||
destinations |= t
|
||||
var/list/destinations = find_destinations()
|
||||
|
||||
if(!destinations.len)
|
||||
to_chat(user, "<span class = 'warning'>There are no other tunnels connected to this one!</span>")
|
||||
@@ -212,10 +231,6 @@
|
||||
|
||||
return FALSE
|
||||
|
||||
/obj/structure/micro_tunnel/attack_generic(mob/user, damage, attack_verb)
|
||||
attack_hand(user)
|
||||
return ..()
|
||||
|
||||
/obj/structure/micro_tunnel/MouseDrop_T(mob/living/M, mob/living/user)
|
||||
. = ..()
|
||||
if(M != user)
|
||||
@@ -301,6 +316,9 @@
|
||||
to_chat(usr, "<span class = 'warning'>You can't do that unless you're in \the [src].</span>")
|
||||
return
|
||||
var/list/destinations = list()
|
||||
if(istype(src,/obj/structure/micro_tunnel)) //If we're in a tunnel let's also get the tunnel's destinations
|
||||
var/obj/structure/micro_tunnel/t = src
|
||||
destinations = t.find_destinations()
|
||||
var/turf/myturf = get_turf(src.loc)
|
||||
for(var/obj/o in range(1,myturf))
|
||||
if(!istype(o,/obj))
|
||||
|
||||
Reference in New Issue
Block a user