Files
siliconsandGitHub 5823fb93e7 migrates to github actions + sync tgui to main's, removes a bunch of dead maps and code and reworks how submap loading is done (#2917)
* move phoronlock define

* t

* force rename

* nuke unneeded things

* don't do that

* tgui sync?

* changes

* unit testing module

* backend

* tools update

* aaah

* go and stay go

* path replace

* move everything

* toss out more stuff

* remove

* fine those can stay

* dependencies.sh

* ruin datum move + rename

* level assets why did you guys put the turfs in my atmosphers folder grr

* more moving

* basemap, force stuff

* fix that desync meme

* move more stuff

* move those too

* repath

* get rid of useless initializers

* hacky patchy

* reservations

* alright

* tgui

* changelog example

* checksum

* md5

* errors

* more

* turf empty

* stop

* fix

* bad kwarg

* let's get those in again

* alright

* rid of that

* huh

* newlines

* newlines

* folder

* mood

* woops

* readme

* might as well trim now

* let's go

* fuck it tether isn't being used anyways lol

* ok

* empty files go

* tether is demoted

* sorry but this goes too

* okay

* make that work too

* ok

* wow.

* whew

* Fix

* fixes

* ok

* sigh

* fix

* fix

* aah.

* rust_g logging

* update rust g file

* fix

* funny

* Fix

* map issues

* fix

* initialize hints

* solves some problems

* those too

* ok

* pills

* let's do that.

* hit that too

* runtime

* add that too

* alright

* fix

* fix

* fix

* Fix

* add

* fix

* wildwest, what have they done to you...

* do that too'
git push

* fixes

* fixes

* fixes

* pack this tightly

* let's not have empty files

* sigh

* fix

* FUCK OFF

* fix icon

* rip old mapmerge

* zz

* woo yeah woo yeah

* logging

* fix

* better logs

* GRRRRRR

* last commit??

* awful
2021-04-01 16:07:03 -05:00

56 lines
1.6 KiB
Plaintext

/datum/random_map/building
descriptor = "generic room"
limit_x = 7
limit_y = 7
/datum/random_map/building/generate_map()
for(var/x = 1, x <= limit_x, x++)
for(var/y = 1, y <= limit_y, y++)
var/current_cell = get_map_cell(x,y)
if(!current_cell)
continue
if(x == 1 || y == 1 || x == limit_x || y == limit_y)
map[current_cell] = WALL_CHAR
else
map[current_cell] = FLOOR_CHAR
/datum/random_map/building/handle_post_overlay_on(var/datum/random_map/target_map, var/tx, var/ty)
var/list/possible_doors
for(var/x = 1, x <= limit_x, x++)
for(var/y = 1, y <= limit_y, y++)
var/current_cell = get_map_cell(x,y)
if(!current_cell)
continue
if(!(x == 1 || y == 1 || x == limit_x || y == limit_y))
continue
if(tx+x > target_map.limit_x)
continue
if(ty+y > target_map.limit_y)
continue
var/place_door
// #.# ... .## ##.
// #X# #X# .X. .X. == place a door
// ... # # .## ##.
// (tx+x)-1,(ty+y-1) (tx+x),(ty+y)-1 (tx+x)+1,(ty+y)-1
// (tx+x)-1,(ty+y) (tx+x),(ty+y) (tx+x)+1,(ty+y)
// (tx+x)-1,(ty+y+1) (tx+x),(ty+y)+1 (tx+x)+1,(ty+y)+1
if(place_door)
possible_doors |= target_map.get_map_cell(tx+x,ty+y)
if(possible_doors.len)
// Place at least one door.
var/placing_door = pick(possible_doors)
possible_doors -= placing_door
target_map.map[placing_door] = DOOR_CHAR
// Keep placing doors until we get bored or lose interest.
while(possible_doors && !prob(30))
placing_door = pick(possible_doors)
possible_doors -= placing_door
target_map.map[placing_door] = DOOR_CHAR
return