Skip to content

Commit

Permalink
Redesigns the city and fixes various issues
Browse files Browse the repository at this point in the history
  • Loading branch information
BurgerLUA committed Mar 21, 2024
1 parent d7209cf commit e2abff7
Show file tree
Hide file tree
Showing 30 changed files with 300,672 additions and 4,658 deletions.
75 changes: 62 additions & 13 deletions code/_core/obj/markers/prefab.dm
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
category = "house"
chance_none = 0
rotational_offset = 16
unique = TRUE

/obj/marker/prefab/alley
icon = 'icons/obj/markers/prefab_5x5.dmi'
Expand Down Expand Up @@ -217,9 +218,34 @@
dir = EAST
else
category = "city_street_straight"
if(prob(50)) dir = turn(dir,180)

. = ..()

/obj/marker/prefab/city/line_small
icon = 'icons/obj/markers/prefab_42x42_city.dmi'
icon_state = null
category = "city_street_straight_small" //or "city_street_corner_small"
unique = FALSE
rotational_offset = 42

/obj/marker/prefab/city/line_small/prepare_prefab()

if(dir in DIRECTIONS_INTERCARDINAL) //Corner
category = "city_street_corner_small"
switch(dir)
if(SOUTHWEST)
dir = SOUTH
if(NORTHWEST)
dir = WEST
if(NORTHEAST)
dir = NORTH
if(SOUTHEAST)
dir = EAST
else
category = "city_street_straight_small"

. = ..()

/obj/marker/prefab/city/intersection
icon = 'icons/obj/markers/prefab_64x64_city_intersection.dmi'
Expand All @@ -231,37 +257,60 @@
. = ..()
dir = pick(NORTH,EAST,SOUTH,WEST)



/obj/marker/prefab/city/sol_base
icon = 'icons/obj/markers/prefab_64x64_city_intersection.dmi'
icon_state = "t"
category = "sol_base"
/obj/marker/prefab/city/intersection_small
icon = 'icons/obj/markers/prefab_42x42_city_intersection.dmi'
icon_state = "cross"
category = "city_street_intersection_small"
unique = TRUE
rotational_offset = 42

/obj/marker/prefab/city/city_hall
icon = 'icons/obj/markers/prefab_64x64_city_offset.dmi' //Shitty solution but it works.
icon_state = null
category = "city_special"
unique = TRUE
/obj/marker/prefab/city/intersection_small/New(var/desired_loc)
. = ..()
dir = pick(NORTH,EAST,SOUTH,WEST)

/obj/marker/prefab/city/t_junction
icon = 'icons/obj/markers/prefab_64x64_city_intersection.dmi'
icon_state = "t"
category = "city_street_t"
unique = TRUE

/obj/marker/prefab/city/t_junction_small
icon = 'icons/obj/markers/prefab_42x42_city_intersection.dmi'
icon_state = "t"
category = "city_street_t_small"
unique = TRUE
rotational_offset = 42

/obj/marker/prefab/city/end
icon = 'icons/obj/markers/prefab_64x64_city_end.dmi'
icon_state = null
category = "city_street_end"
unique = FALSE
unique = TRUE

/obj/marker/prefab/city/end_small
icon = 'icons/obj/markers/prefab_42x42_city_end.dmi'
icon_state = null
category = "city_street_end_small"
unique = TRUE
rotational_offset = 42

/obj/marker/prefab/city/farm
icon = 'icons/obj/markers/prefab_64x64_farm.dmi'
icon_state = null
category = "farm"
unique = FALSE
unique = TRUE

/obj/marker/prefab/city/city_hall
icon = 'icons/obj/markers/prefab_64x64_city_offset.dmi' //Shitty solution but it works.
icon_state = null
category = "city_special"
unique = TRUE

/obj/marker/prefab/city/sol_base
icon = 'icons/obj/markers/prefab_64x64_city_intersection.dmi'
icon_state = "t"
category = "sol_base"
unique = TRUE

/obj/marker/prefab/city/parking
icon = 'icons/obj/markers/prefab_10x10.dmi'
Expand Down
62 changes: 14 additions & 48 deletions code/_core/world/subsystems/dmm_suite.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ SUBSYSTEM_DEF(dmm_suite)

var/list/valid_prefabs = list()

var/list/linked_prefabs_below = list()
var/list/linked_prefabs_above = list()

var/list/maps_to_load = list(
"maps/_core/mission.dmm",
"maps/_core/bluespace.dmm",
Expand Down Expand Up @@ -107,16 +104,9 @@ SUBSYSTEM_DEF(dmm_suite)
for(var/file in flist("[PREFABS_DIR][category]/"))
if(!has_suffix(file,".dmm"))
continue
if(has_suffix(file,"_below.dmm"))
var/linked_file = replacetextEx(file,"_below.dmm",".dmm")
linked_prefabs_below["[PREFABS_DIR][category]/[linked_file]"] = "[PREFABS_DIR][category]/[file]"
else if(has_suffix(file,"_above.dmm"))
var/linked_file = replacetextEx(file,"_above.dmm",".dmm")
linked_prefabs_above["[PREFABS_DIR][category]/[linked_file]"] = "[PREFABS_DIR][category]/[file]"
else
if(!valid_prefabs[category])
valid_prefabs[category] = list()
valid_prefabs[category] += "[PREFABS_DIR][category]/[file]"
if(!valid_prefabs[category])
valid_prefabs[category] = list()
valid_prefabs[category] += "[PREFABS_DIR][category]/[file]"

log_subsystem(name,"Found [length(valid_prefabs)] valid prefab sets.")
var/loaded_prefabs = 0
Expand All @@ -129,23 +119,23 @@ SUBSYSTEM_DEF(dmm_suite)
var/obj/marker/prefab/M = prefab_markers[1]
prefab_markers -= M
M.prepare_prefab()
if(!length(valid_prefabs[M.category]))
if(!not_enough[M.category])
not_enough[M.category] = 1
else
not_enough[M.category] += 1
continue
var/list/local_prefabs = valid_prefabs[M.category].Copy()
if(length(M.prefabs))
local_prefabs = local_prefabs & M.prefabs
if(!length(local_prefabs))
if(!length(valid_prefabs[M.category])) //Check global prefabs.
if(!not_enough[M.category])
not_enough[M.category] = 1
else
not_enough[M.category] += 1
continue
var/list/prefab_to_use = valid_prefabs[M.category]
if(length(M.prefabs)) //We have local prefabs.
prefab_to_use = prefab_to_use.Copy() & M.prefabs
if(!length(prefab_to_use)) //Check local prefabs.
if(!not_enough[M.category])
not_enough[M.category] = 1
else
not_enough[M.category] += 1
continue

M.chosen_file = pick(local_prefabs)
M.chosen_file = pick(prefab_to_use)
if(M.unique) valid_prefabs[M.category] -= M.chosen_file
var/map_contents = rustg_file_read(M.chosen_file)
var/desired_angle = 0
Expand All @@ -166,30 +156,6 @@ SUBSYSTEM_DEF(dmm_suite)
tag="[M.chosen_file]",
angleOffset = SIMPLIFY_DEGREES(desired_angle)
)
/*
if(linked_prefabs_below[M.chosen_file])
M.chosen_file_below = linked_prefabs_below[M.chosen_file]
var/chosen_map_contents = rustg_file_read(M.chosen_file_below)
dmm_suite.read_map(
chosen_map_contents,
M.x + M.offset_x,
M.y + M.offset_y,
M.z-1,
tag="[M.chosen_file_below]",
angleOffset = SIMPLIFY_DEGREES(desired_angle)
)
if(linked_prefabs_above[M.chosen_file])
M.chosen_file_above = linked_prefabs_above[M.chosen_file]
var/chosen_map_contents = rustg_file_read(M.chosen_file_above)
dmm_suite.read_map(
chosen_map_contents,
M.x + M.offset_x,
M.y + M.offset_y,
M.z+1,
tag="[M.chosen_file_above]",
angleOffset = SIMPLIFY_DEGREES(desired_angle)
)
*/
loaded_prefabs++


Expand Down
2 changes: 1 addition & 1 deletion code/_core/world/subsystems/turfs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ SUBSYSTEM_DEF(turf)
stored_boss_floor_icons += I


snow_line = rand(380,440)
snow_line = rand(420,450)
snow_num = 0.6+rand()*0.2

var/list/type_to_time = list()
Expand Down
Binary file added icons/obj/markers/prefab_42x42_city.dmi
Binary file not shown.
Binary file added icons/obj/markers/prefab_42x42_city_end.dmi
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit e2abff7

Please sign in to comment.