Files
Paradise/code/game/turfs/space/space.dm
Tigercat2000 288af9f92c Revert "Merge pull request #4739 from monster860/vg-parallax"
This reverts commit 451c934379, reversing
changes made to 64f26d999f.

Conflicts:
	SQL/paradise_schema.sql
	SQL/paradise_schema_prefixed.sql
2016-07-28 15:48:27 -07:00

202 lines
5.2 KiB
Plaintext

/turf/space
icon = 'icons/turf/space.dmi'
name = "\proper space"
icon_state = "0"
dynamic_lighting = 0
luminosity = 1
temperature = TCMB
thermal_conductivity = OPEN_HEAT_TRANSFER_COEFFICIENT
heat_capacity = 700000
var/destination_z
var/destination_x
var/destination_y
/turf/space/New()
. = ..()
if(!istype(src, /turf/space/transit))
icon_state = "[((x + y) ^ ~(x * y) + z) % 25]"
update_starlight()
/turf/space/Destroy()
return QDEL_HINT_LETMELIVE
/turf/space/proc/update_starlight()
if(!config.starlight)
return
if(locate(/turf/simulated) in orange(src,1))
set_light(config.starlight)
else
set_light(0)
/turf/space/attackby(obj/item/C as obj, mob/user as mob, params)
..()
if(istype(C, /obj/item/stack/rods))
var/obj/item/stack/rods/R = C
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
if(L)
if(R.use(1))
to_chat(user, "<span class='notice'>You begin constructing catwalk...</span>")
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
qdel(L)
ChangeTurf(/turf/simulated/floor/plating/airless/catwalk)
else
to_chat(user, "<span class='warning'>You need two rods to build a catwalk!</span>")
return
if(R.use(1))
to_chat(user, "<span class='notice'>Constructing support lattice...</span>")
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
ReplaceWithLattice()
else
to_chat(user, "<span class='warning'>You need one rod to build a lattice.</span>")
return
if(istype(C, /obj/item/stack/tile/plasteel))
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
if(L)
var/obj/item/stack/tile/plasteel/S = C
if(S.use(1))
qdel(L)
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
to_chat(user, "<span class='notice'>You build a floor.</span>")
ChangeTurf(/turf/simulated/floor/plating)
else
to_chat(user, "<span class='warning'>You need one floor tile to build a floor!</span>")
else
to_chat(user, "<span class='warning'>The plating is going to need some support! Place metal rods first.</span>")
/turf/space/Entered(atom/movable/A as mob|obj, atom/OL, ignoreRest = 0)
..()
if(destination_z && A && (src in A.locs))
A.x = destination_x
A.y = destination_y
A.z = destination_z
if(isliving(A))
var/mob/living/L = A
if(L.pulling)
var/turf/T = get_step(L.loc,turn(A.dir, 180))
L.pulling.loc = T
//now we're on the new z_level, proceed the space drifting
sleep(0)//Let a diagonal move finish, if necessary
A.newtonian_move(A.inertia_dir)
/turf/space/proc/Sandbox_Spacemove(atom/movable/A as mob|obj)
var/cur_x
var/cur_y
var/next_x
var/next_y
var/target_z
var/list/y_arr
if(src.x <= 1)
if(istype(A, /obj/effect/meteor)||istype(A, /obj/effect/space_dust))
qdel(A)
return
var/list/cur_pos = src.get_global_map_pos()
if(!cur_pos) return
cur_x = cur_pos["x"]
cur_y = cur_pos["y"]
next_x = (--cur_x||global_map.len)
y_arr = global_map[next_x]
target_z = y_arr[cur_y]
/*
//debug
to_chat(world, "Src.z = [src.z] in global map X = [cur_x], Y = [cur_y]")
to_chat(world, "Target Z = [target_z]")
to_chat(world, "Next X = [next_x]")
//debug
*/
if(target_z)
A.z = target_z
A.x = world.maxx - 2
spawn (0)
if((A && A.loc))
A.loc.Entered(A)
else if(src.x >= world.maxx)
if(istype(A, /obj/effect/meteor))
qdel(A)
return
var/list/cur_pos = src.get_global_map_pos()
if(!cur_pos) return
cur_x = cur_pos["x"]
cur_y = cur_pos["y"]
next_x = (++cur_x > global_map.len ? 1 : cur_x)
y_arr = global_map[next_x]
target_z = y_arr[cur_y]
/*
//debug
to_chat(world, "Src.z = [src.z] in global map X = [cur_x], Y = [cur_y]")
to_chat(world, "Target Z = [target_z]")
to_chat(world, "Next X = [next_x]")
//debug
*/
if(target_z)
A.z = target_z
A.x = 3
spawn (0)
if((A && A.loc))
A.loc.Entered(A)
else if(src.y <= 1)
if(istype(A, /obj/effect/meteor))
qdel(A)
return
var/list/cur_pos = src.get_global_map_pos()
if(!cur_pos) return
cur_x = cur_pos["x"]
cur_y = cur_pos["y"]
y_arr = global_map[cur_x]
next_y = (--cur_y||y_arr.len)
target_z = y_arr[next_y]
/*
//debug
to_chat(world, "Src.z = [src.z] in global map X = [cur_x], Y = [cur_y]")
to_chat(world, "Next Y = [next_y]")
to_chat(world, "Target Z = [target_z]")
//debug
*/
if(target_z)
A.z = target_z
A.y = world.maxy - 2
spawn (0)
if((A && A.loc))
A.loc.Entered(A)
else if(src.y >= world.maxy)
if(istype(A, /obj/effect/meteor)||istype(A, /obj/effect/space_dust))
qdel(A)
return
var/list/cur_pos = src.get_global_map_pos()
if(!cur_pos) return
cur_x = cur_pos["x"]
cur_y = cur_pos["y"]
y_arr = global_map[cur_x]
next_y = (++cur_y > y_arr.len ? 1 : cur_y)
target_z = y_arr[next_y]
/*
//debug
to_chat(world, "Src.z = [src.z] in global map X = [cur_x], Y = [cur_y]")
to_chat(world, "Next Y = [next_y]")
to_chat(world, "Target Z = [target_z]")
//debug
*/
if(target_z)
A.z = target_z
A.y = 3
spawn (0)
if((A && A.loc))
A.loc.Entered(A)
return
/turf/space/singularity_act()
return
/turf/space/can_have_cabling()
return 0