diff --git a/baystation12.dme b/baystation12.dme index f21151ee986..943b12ee783 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -191,7 +191,6 @@ #include "code\game\atoms.dm" #include "code\game\atoms_movable.dm" #include "code\game\communications.dm" -#include "code\game\mining_surprise.dm" #include "code\game\response_team.dm" #include "code\game\shuttle_engines.dm" #include "code\game\skincmd.dm" @@ -933,9 +932,12 @@ #include "code\modules\mining\money_bag.dm" #include "code\modules\mining\ores_coins.dm" #include "code\modules\mining\satchel_ore_boxdm.dm" +#include "code\modules\mining\surprise.dm" #include "code\modules\mining\laborcamp\laborminerals.dm" #include "code\modules\mining\laborcamp\laborshuttle.dm" #include "code\modules\mining\laborcamp\laborstacker.dm" +#include "code\modules\mining\surprises\tg.dm" +#include "code\modules\mining\surprises\vg.dm" #include "code\modules\mob\abilities.dm" #include "code\modules\mob\death.dm" #include "code\modules\mob\emote.dm" diff --git a/code/game/mining_surprise.dm b/code/game/mining_surprise.dm deleted file mode 100644 index 0fa9dce0b3a..00000000000 --- a/code/game/mining_surprise.dm +++ /dev/null @@ -1,433 +0,0 @@ -#define CONTIGUOUS_WALLS 1 -#define CONTIGUOUS_FLOORS 2 - - -var/global/list/mining_surprises = typesof(/mining_surprise)-/mining_surprise - -/surprise_room - var/list/floors[0] - var/list/walls[0] - - var/size_x=0 - var/size_y=0 - -/mining_surprise - var/name = "Hidden Complex" - - //: Types of floor to use - var/list/floortypes[0] - var/list/walltypes[0] - var/list/spawntypes[0] - var/list/fluffitems[0] - - var/max_richness=2 - - //: How many rooms? - var/complex_max_size=1 - - var/room_size_max=5 - - var/flags=0 - - var/list/rooms=list() - var/list/goodies=list() - var/list/candidates=list() - - var/area/asteroid/artifactroom/complex_area - - proc/spawn_complex(var/atom/start_loc) - name = "[initial(name)] #[rand(100,999)]" - complex_area = new - complex_area.name = name - var/atom/pos=start_loc - var/nrooms=complex_max_size - var/maxtries=50 - var/l_size_x=0 - var/l_size_y=0 - while(nrooms && maxtries) - var/sx=rand(3,room_size_max) - var/sy=rand(3,room_size_max) - var/o_x=l_size_x?rand(0,l_size_x):0 - var/o_y=l_size_y?rand(0,l_size_y):0 - var/atom/npos - switch(pick(cardinal)) - if(NORTH) - npos=locate(pos.x+o_x, pos.y+sy-1, pos.z) - if(SOUTH) - npos=locate(pos.x+o_x, pos.y-sy+1, pos.z) - if(WEST) - npos=locate(pos.x-sx-1, pos.y+o_y, pos.z) - if(EAST) - npos=locate(pos.x+sx+1, pos.y+o_y, pos.z) - if(spawn_room(npos,sx,sy,1)) - pos=npos - l_size_x=sx - l_size_y=sy - else if(complex_max_size==nrooms) - // Failed to make first room, abort. - del(complex_area) - return 0 - else - maxtries-- - continue - nrooms-- - postProcessComplex() - message_admins("Complex spawned at [formatJumpTo(start_loc)]") - return 1 - - proc/postProcessRoom(var/surprise_room/room) - for(var/turf/floor in room.floors) - for(var/turf/T in floor.AdjacentTurfs()) - if(T in room.floors) - candidates|=T - break - - proc/postProcessComplex() - for(var/i=0;i<=rand(1,max_richness);i++) - if(!candidates.len) - return - var/turf/T = pick(candidates) - var/thing = pickweight(spawntypes) - if(thing==null) - continue - new thing(T) - candidates -= T - message_admins("Goodie [thing] spawned at [formatJumpTo(T)]") - - for(var/i=0;i<=rand(5,10);i++) - if(!candidates.len) - return - var/turf/T = pick(candidates) - var/thing = pickweight(fluffitems) - if(thing==null) - continue - new thing(T) - - proc/spawn_room(var/atom/start_loc, var/x_size, var/y_size, var/clean=0) - if(!check_complex_placement(start_loc,x_size,y_size)) - return 0 - - // If walls/floors are contiguous, pick them out. - var/wall_type - if(flags & CONTIGUOUS_WALLS) - wall_type = pickweight(walltypes) - - var/floor_type - if(flags & CONTIGUOUS_FLOORS) - floor_type = pickweight(floortypes) - - - var/list/walls[0] - var/list/floors[0] - for(var/x = 0,x0) + n = min(candidates.len,rand(min_to_place,max_to_place)) + if(n==0) + return 0 + for(var/i=0;i0) + var/turf/weed_turf = pick(w_cand) + w_cand -= weed_turf + if(weed_turf.density) + continue + if(locate(/obj/effect/alien) in weed_turf) + continue + if(weed_turf && !egged) + new /obj/effect/alien/weeds/node(weed_turf) + weeds += weed_turf + break + + for(var/e=0;e