mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Added var denoting which direction is fore of the ship. Adjusting speed now applies movement effect on ship's zlevel. Added working engines system. Only defined type currently is thermal engine. Acceleration is now based on total thrust and ship's mass. Added engine control console. Changed shuttle control console to use custom interface to pick destinations. Shuttles can now go between any types of sectors, not just ship->sector. Shuttles cannot return to base if they are too far on overmap. Moved helm computer to NanoUI. Helm computer now stores navigation data records instead of polling info from actual overmap objects every time. Metaobjects now can define if sector is well known, in which case it will be automatically added to helm computer records on creation. Can add and delete records.
35 lines
1.0 KiB
Plaintext
35 lines
1.0 KiB
Plaintext
//Zlevel where overmap objects should be
|
|
#define OVERMAP_ZLEVEL 1
|
|
//How far from the edge of overmap zlevel could randomly placed objects spawn
|
|
#define OVERMAP_EDGE 7
|
|
|
|
//list used to track which zlevels are being 'moved' by the proc below
|
|
var/list/moving_levels = list()
|
|
//Proc to 'move' stars in spess
|
|
//yes it looks ugly, but it should only fire when state actually change.
|
|
//null direction stops movement
|
|
proc/toggle_move_stars(zlevel, direction)
|
|
if(!zlevel)
|
|
return
|
|
|
|
var/gen_dir = null
|
|
if(direction & (NORTH|SOUTH))
|
|
gen_dir += "ns"
|
|
else if(direction & (EAST|WEST))
|
|
gen_dir += "ew"
|
|
if(!direction)
|
|
gen_dir = null
|
|
|
|
if (moving_levels["zlevel"] != gen_dir)
|
|
moving_levels["zlevel"] = gen_dir
|
|
for(var/turf/space/S in world)
|
|
if(S.z == zlevel)
|
|
spawn(0)
|
|
var/turf/T = S
|
|
if(!gen_dir)
|
|
T.icon_state = "[((T.x + T.y) ^ ~(T.x * T.y) + T.z) % 25]"
|
|
else
|
|
T.icon_state = "speedspace_[gen_dir]_[rand(1,15)]"
|
|
for(var/atom/movable/AM in T)
|
|
if (!AM.anchored)
|
|
AM.throw_at(get_step(T,reverse_direction(direction)), 5, 1) |