Skip to content

Commit

Permalink
Artifact science stuff (#1307)
Browse files Browse the repository at this point in the history
* daedalusdock #675 port

* my first TGUI, and its amazing <3

* small TGUI fix

* lets use nuclear payloads to remove some unnecessary code
  • Loading branch information
Gboster-0 authored Mar 26, 2024
1 parent d76dfdc commit fcc99c6
Show file tree
Hide file tree
Showing 7 changed files with 286 additions and 201 deletions.
2 changes: 1 addition & 1 deletion _maps/_basemap.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//area#define LOWMEMORYMODE //uncomment this to load centcom and runtime station and thats it.
//#define LOWMEMORYMODE //uncomment this to load centcom and runtime station and thats it.

#include "map_files\generic\CentCom.dmm"

Expand Down
9 changes: 9 additions & 0 deletions code/__DEFINES/~monkestation/asteroids.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/// Used in asteroid composition lists to indicate a skip
#define SKIP "skip"

#define islevelbaseturf(A) istype(A, SSmapping.level_trait(A.z, ZTRAIT_BASETURF) || /turf/open/space)

// Mining template rarities
#define MINING_NO_RANDOM_SPAWN -1
#define MINING_COMMON 1
Expand All @@ -14,3 +16,10 @@
stoplag(); \
SSatoms.map_loader_begin(REF(template)); \
}

// error codes for the asteroid magnet
#define MAGNET_ERROR_KEY_BUSY 1
#define MAGNET_ERROR_KEY_USED_COORD 2
#define MAGNET_ERROR_KEY_COOLDOWN 3
#define MAGNET_ERROR_KEY_MOB 4
#define MAGNET_ERROR_KEY_NO_COORD 5
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

/// Cleanup our currently loaded mining template
/proc/CleanupAsteroidMagnet(turf/center, size)
var/list/turfs_to_destroy = ReserveTurfsForAsteroidGeneration(center, size, space_only = FALSE)
var/list/turfs_to_destroy = ReserveTurfsForAsteroidGeneration(center, size, baseturf_only = FALSE)
for(var/turf/T as anything in turfs_to_destroy)
CHECK_TICK

Expand All @@ -88,12 +88,12 @@
T.ChangeTurf(/turf/baseturf_bottom)

/// Sanitizes a block of turfs to prevent writing over undesired locations
/proc/ReserveTurfsForAsteroidGeneration(turf/center, size, space_only = TRUE)
/proc/ReserveTurfsForAsteroidGeneration(turf/center, size, baseturf_only = TRUE)
. = list()

var/list/turfs = RANGE_TURFS(size, center)
for(var/turf/T as anything in turfs)
if(space_only && !isspaceturf(T))
if(baseturf_only && !islevelbaseturf(T))
continue
if(!(istype(T.loc, /area/station/cargo/mining/asteroid_magnet)))
continue
Expand Down
Loading

0 comments on commit fcc99c6

Please sign in to comment.