The Mapping Update
Cleans up the map (again) Makes mining code more better
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
icon = 'icons/turf/floors.dmi'
|
||||
icon_state = "asteroid"
|
||||
icon_plating = "asteroid"
|
||||
postdig_icon_change = TRUE
|
||||
footstep = FOOTSTEP_SAND
|
||||
barefootstep = FOOTSTEP_SAND
|
||||
clawfootstep = FOOTSTEP_SAND
|
||||
@@ -16,13 +15,19 @@
|
||||
/// Environment type for the turf
|
||||
var/environment_type = "asteroid"
|
||||
/// Base turf type to be created by the tunnel
|
||||
var/turf_type = /turf/open/floor/plating/asteroid //Because caves do whacky shit to revert to normal
|
||||
/// Probability the floor has a different icon state
|
||||
var/turf_type = /turf/open/floor/plating/asteroid
|
||||
/// Probability floor has a different icon state
|
||||
var/floor_variance = 20
|
||||
attachment_holes = FALSE
|
||||
/// Itemstack to drop when dug by a shovel
|
||||
var/obj/item/stack/digResult = /obj/item/stack/ore/glass/basalt
|
||||
/// Whether the turf has been dug or not
|
||||
var/dug
|
||||
/// Whether to change the turf's icon_state to "[base_icon_state]_dug" when its dugged up
|
||||
postdig_icon_change = TRUE
|
||||
|
||||
// /turf/open/floor/plating/asteroid/setup_broken_states()
|
||||
// return list("asteroid_dug")
|
||||
|
||||
/turf/open/floor/plating/asteroid/Initialize()
|
||||
var/proper_name = name
|
||||
@@ -33,19 +38,18 @@
|
||||
|
||||
/// Drops itemstack when dug and changes icon
|
||||
/turf/open/floor/plating/asteroid/proc/getDug()
|
||||
dug = TRUE
|
||||
new digResult(src, 5)
|
||||
if(postdig_icon_change)
|
||||
if(!postdig_icon)
|
||||
icon_plating = "[environment_type]_dug"
|
||||
icon_state = "[environment_type]_dug"
|
||||
dug = TRUE
|
||||
icon_plating = "[environment_type]_dug"
|
||||
icon_state = "[environment_type]_dug"
|
||||
|
||||
/// If the user can dig the turf
|
||||
/turf/open/floor/plating/asteroid/proc/can_dig(mob/user)
|
||||
if(!dug)
|
||||
return TRUE
|
||||
if(user)
|
||||
to_chat(user, "<span class='notice'>Looks like someone has dug here already.</span>")
|
||||
to_chat(user, "<span class='warning'>Looks like someone has dug here already!</span>")
|
||||
|
||||
/turf/open/floor/plating/asteroid/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
|
||||
return
|
||||
@@ -59,6 +63,9 @@
|
||||
/turf/open/floor/plating/asteroid/MakeDry()
|
||||
return
|
||||
|
||||
// /turf/open/floor/plating/asteroid/crush()
|
||||
// return
|
||||
|
||||
/turf/open/floor/plating/asteroid/attackby(obj/item/W, mob/user, params)
|
||||
. = ..()
|
||||
if(!.)
|
||||
@@ -99,6 +106,9 @@
|
||||
floor_variance = 15
|
||||
digResult = /obj/item/stack/ore/glass/basalt
|
||||
|
||||
// /turf/open/floor/plating/asteroid/basalt/setup_broken_states()
|
||||
// return list("basalt_dug")
|
||||
|
||||
/turf/open/floor/plating/asteroid/basalt/lava //lava underneath
|
||||
baseturfs = /turf/open/lava/smooth
|
||||
|
||||
@@ -128,280 +138,16 @@
|
||||
planetary_atmos = TRUE
|
||||
baseturfs = /turf/open/lava/smooth/lava_land_surface
|
||||
|
||||
|
||||
|
||||
// /turf/open/floor/plating/asteroid/lowpressure
|
||||
// initial_gas_mix = OPENTURF_LOW_PRESSURE
|
||||
// baseturfs = /turf/open/floor/plating/asteroid/lowpressure
|
||||
// turf_type = /turf/open/floor/plating/asteroid/lowpressure
|
||||
|
||||
/turf/open/floor/plating/asteroid/airless
|
||||
initial_gas_mix = AIRLESS_ATMOS
|
||||
baseturfs = /turf/open/floor/plating/asteroid/airless
|
||||
turf_type = /turf/open/floor/plating/asteroid/airless
|
||||
|
||||
|
||||
#define SPAWN_MEGAFAUNA "bluh bluh huge boss"
|
||||
#define SPAWN_BUBBLEGUM 6
|
||||
|
||||
/turf/open/floor/plating/asteroid/airless/cave
|
||||
/// Length of the tunnel
|
||||
var/length = 100
|
||||
/// Mobs that can spawn in the tunnel, weighted list
|
||||
var/list/mob_spawn_list
|
||||
/// Megafauna that can spawn in the tunnel, weighted list
|
||||
var/list/megafauna_spawn_list
|
||||
/// Flora that can spawn in the tunnel, weighted list
|
||||
var/list/flora_spawn_list
|
||||
//terrain to spawn weighted list
|
||||
var/list/terrain_spawn_list
|
||||
/// Turf type to choose when spawning in tunnel at 1% chance, weighted list
|
||||
var/list/choose_turf_type
|
||||
/// if the tunnel should keep being created
|
||||
var/sanity = 1
|
||||
/// Cave direction to move
|
||||
var/forward_cave_dir = 1
|
||||
/// Backwards cave direction for tracking
|
||||
var/backward_cave_dir = 2
|
||||
/// If the tunnel is moving backwards
|
||||
var/going_backwards = TRUE
|
||||
/// If this is a cave creating type
|
||||
var/has_data = FALSE
|
||||
/// The non-cave creating type
|
||||
var/data_having_type = /turf/open/floor/plating/asteroid/airless/cave/has_data
|
||||
/// Option tunnel width, wegihted list
|
||||
var/list/pick_tunnel_width
|
||||
turf_type = /turf/open/floor/plating/asteroid/airless
|
||||
|
||||
/turf/open/floor/plating/asteroid/airless/cave/has_data //subtype for producing a tunnel with given data
|
||||
has_data = TRUE
|
||||
|
||||
/turf/open/floor/plating/asteroid/airless/cave/volcanic
|
||||
mob_spawn_list = list(/mob/living/simple_animal/hostile/asteroid/goliath/beast/random = 50, /obj/structure/spawner/lavaland/goliath = 3, \
|
||||
/mob/living/simple_animal/hostile/asteroid/basilisk/watcher/random = 40, /obj/structure/spawner/lavaland = 2, \
|
||||
/mob/living/simple_animal/hostile/asteroid/hivelord/legion/random = 30, /obj/structure/spawner/lavaland/legion = 3, \
|
||||
SPAWN_MEGAFAUNA = 6, /mob/living/simple_animal/hostile/asteroid/goldgrub = 10)
|
||||
|
||||
data_having_type = /turf/open/floor/plating/asteroid/airless/cave/volcanic/has_data
|
||||
turf_type = /turf/open/floor/plating/asteroid/basalt/lava_land_surface
|
||||
initial_gas_mix = LAVALAND_DEFAULT_ATMOS
|
||||
|
||||
/turf/open/floor/plating/asteroid/airless/cave/volcanic/has_data //subtype for producing a tunnel with given data
|
||||
has_data = TRUE
|
||||
|
||||
/turf/open/floor/plating/asteroid/airless/cave/snow
|
||||
gender = PLURAL
|
||||
name = "snow"
|
||||
desc = "Looks cold."
|
||||
icon = 'icons/turf/snow.dmi'
|
||||
baseturfs = /turf/open/floor/plating/asteroid/snow/icemoon
|
||||
icon_state = "snow"
|
||||
icon_plating = "snow"
|
||||
initial_gas_mix = ICEMOON_DEFAULT_ATMOS
|
||||
slowdown = 2
|
||||
environment_type = "snow"
|
||||
flags_1 = NONE
|
||||
planetary_atmos = TRUE
|
||||
burnt_states = list("snow_dug")
|
||||
bullet_sizzle = TRUE
|
||||
bullet_bounce_sound = null
|
||||
digResult = /obj/item/stack/sheet/mineral/snow
|
||||
mob_spawn_list = list(/mob/living/simple_animal/hostile/asteroid/wolf = 50, /obj/structure/spawner/ice_moon = 3, \
|
||||
/mob/living/simple_animal/hostile/asteroid/polarbear = 30, /obj/structure/spawner/ice_moon/polarbear = 3, \
|
||||
/mob/living/simple_animal/hostile/asteroid/hivelord/legion/snow = 50, /mob/living/simple_animal/hostile/asteroid/goldgrub = 10, \
|
||||
/mob/living/simple_animal/hostile/asteroid/lobstrosity = 15)
|
||||
flora_spawn_list = list(/obj/structure/flora/tree/pine = 2, /obj/structure/flora/grass/both = 12, /obj/structure/flora/rock/icy = 6, /obj/structure/flora/rock/pile/icy = 6)
|
||||
data_having_type = /turf/open/floor/plating/asteroid/airless/cave/snow/has_data
|
||||
turf_type = /turf/open/floor/plating/asteroid/snow/icemoon
|
||||
choose_turf_type = list(/turf/open/floor/plating/asteroid/snow/icemoon = 19, /turf/open/floor/plating/ice/icemoon = 1)
|
||||
pick_tunnel_width = list("1" = 6, "2" = 1)
|
||||
|
||||
/turf/open/floor/plating/asteroid/airless/cave/snow/underground
|
||||
mob_spawn_list = list(/mob/living/simple_animal/hostile/asteroid/ice_demon = 50, /obj/structure/spawner/ice_moon/demonic_portal = 3, \
|
||||
/mob/living/simple_animal/hostile/asteroid/ice_whelp = 30, /obj/structure/spawner/ice_moon/demonic_portal/ice_whelp = 3, \
|
||||
/mob/living/simple_animal/hostile/asteroid/hivelord/legion/snow = 50, /obj/structure/spawner/ice_moon/demonic_portal/snowlegion = 3)
|
||||
flora_spawn_list = list(/obj/structure/flora/rock/icy = 6, /obj/structure/flora/rock/pile/icy = 6)
|
||||
data_having_type = /turf/open/floor/plating/asteroid/airless/cave/snow/underground/has_data
|
||||
choose_turf_type = null
|
||||
|
||||
/turf/open/floor/plating/asteroid/airless/cave/snow/has_data //subtype for producing a tunnel with given data
|
||||
has_data = TRUE
|
||||
|
||||
/turf/open/floor/plating/asteroid/airless/cave/snow/underground/has_data //subtype for producing a tunnel with given data
|
||||
has_data = TRUE
|
||||
|
||||
/turf/open/floor/plating/asteroid/airless/cave/Initialize()
|
||||
if (!mob_spawn_list)
|
||||
mob_spawn_list = list(/mob/living/simple_animal/hostile/asteroid/goldgrub = 1, /mob/living/simple_animal/hostile/asteroid/goliath = 5, /mob/living/simple_animal/hostile/asteroid/basilisk = 4, /mob/living/simple_animal/hostile/asteroid/hivelord = 3)
|
||||
if (!megafauna_spawn_list)
|
||||
megafauna_spawn_list = list(/mob/living/simple_animal/hostile/megafauna/dragon = 4, /mob/living/simple_animal/hostile/megafauna/colossus = 2, /mob/living/simple_animal/hostile/megafauna/bubblegum = SPAWN_BUBBLEGUM)
|
||||
if (!flora_spawn_list)
|
||||
flora_spawn_list = list(/obj/structure/flora/ash/leaf_shroom = 2 , /obj/structure/flora/ash/cap_shroom = 2 , /obj/structure/flora/ash/stem_shroom = 2 , /obj/structure/flora/ash/cacti = 1, /obj/structure/flora/ash/tall_shroom = 2)
|
||||
if(!terrain_spawn_list)
|
||||
terrain_spawn_list = list(/obj/structure/geyser/random = 1)
|
||||
. = ..()
|
||||
if(!has_data)
|
||||
produce_tunnel_from_data()
|
||||
|
||||
/// Sets the tunnel length and direction
|
||||
/turf/open/floor/plating/asteroid/airless/cave/proc/get_cave_data(set_length, exclude_dir = -1)
|
||||
// If set_length (arg1) isn't defined, get a random length; otherwise assign our length to the length arg.
|
||||
if(!set_length)
|
||||
length = rand(25, 50)
|
||||
else
|
||||
length = set_length
|
||||
|
||||
// Get our directiosn
|
||||
forward_cave_dir = pick(GLOB.alldirs - exclude_dir)
|
||||
// Get the opposite direction of our facing direction
|
||||
backward_cave_dir = angle2dir(dir2angle(forward_cave_dir) + 180)
|
||||
|
||||
/// Gets the tunnel length and direction then makes the tunnel
|
||||
/turf/open/floor/plating/asteroid/airless/cave/proc/produce_tunnel_from_data(tunnel_length, excluded_dir = -1)
|
||||
get_cave_data(tunnel_length, excluded_dir)
|
||||
// Make our tunnels
|
||||
make_tunnel(forward_cave_dir)
|
||||
if(going_backwards)
|
||||
make_tunnel(backward_cave_dir)
|
||||
// Kill ourselves by replacing ourselves with a normal floor.
|
||||
SpawnFloor(src)
|
||||
|
||||
/**
|
||||
* Makes the tunnel and spawns things inside of it
|
||||
*
|
||||
* Picks a tunnel width for the tunnel and then starts spawning turfs in the direction it moves in
|
||||
* Can randomly change directions of the tunnel, stops if it hits the edge of the map, or a no tunnel area
|
||||
* Can randomly make new tunnels out of itself
|
||||
*
|
||||
*/
|
||||
/turf/open/floor/plating/asteroid/airless/cave/proc/make_tunnel(dir)
|
||||
var/turf/closed/mineral/tunnel = src
|
||||
var/next_angle = pick(45, -45)
|
||||
|
||||
var/tunnel_width = 1
|
||||
if(pick_tunnel_width)
|
||||
tunnel_width = text2num(pickweight(pick_tunnel_width))
|
||||
|
||||
for(var/i = 0; i < length; i++)
|
||||
if(!sanity)
|
||||
break
|
||||
|
||||
var/list/L = list(45)
|
||||
if(ISODD(dir2angle(dir))) // We're going at an angle and we want thick angled tunnels.
|
||||
L += -45
|
||||
|
||||
// Expand the edges of our tunnel
|
||||
for(var/edge_angle in L)
|
||||
var/turf/closed/mineral/edge = tunnel
|
||||
for(var/current_tunnel_width = 1 to tunnel_width)
|
||||
edge = get_step(edge, angle2dir(dir2angle(dir) + edge_angle))
|
||||
if(istype(edge))
|
||||
SpawnFloor(edge)
|
||||
|
||||
if(!sanity)
|
||||
break
|
||||
|
||||
// Move our tunnel forward
|
||||
tunnel = get_step(tunnel, dir)
|
||||
|
||||
if(istype(tunnel))
|
||||
// Small chance to have forks in our tunnel; otherwise dig our tunnel.
|
||||
if(i > 3 && prob(20))
|
||||
if(isarea(tunnel.loc))
|
||||
|
||||
var/area/A = tunnel.loc
|
||||
if(!A.tunnel_allowed)
|
||||
sanity = 0
|
||||
break
|
||||
var/turf/open/floor/plating/asteroid/airless/cave/C = tunnel.ChangeTurf(data_having_type, null, CHANGETURF_IGNORE_AIR)
|
||||
C.going_backwards = FALSE
|
||||
C.produce_tunnel_from_data(rand(10, 15), dir)
|
||||
else
|
||||
SpawnFloor(tunnel)
|
||||
else //if(!istype(tunnel, parent)) // We hit space/normal/wall, stop our tunnel.
|
||||
break
|
||||
|
||||
// Chance to change our direction left or right.
|
||||
if(i > 2 && prob(33))
|
||||
// We can't go a full loop though
|
||||
next_angle = -next_angle
|
||||
setDir(angle2dir(dir2angle(dir) )+ next_angle)
|
||||
|
||||
|
||||
/// Spawns the floor of the tunnel and any type of structure or mob it can have
|
||||
/turf/open/floor/plating/asteroid/airless/cave/proc/SpawnFloor(turf/T)
|
||||
var/area/A = T.loc
|
||||
if(!A.tunnel_allowed)
|
||||
sanity = 0
|
||||
return
|
||||
if(choose_turf_type)
|
||||
turf_type = pickweight(choose_turf_type)
|
||||
if(turf_type == initial(turf_type)) // Don't spawn different turf types under flora or terrain
|
||||
var/spawned_flora = FALSE
|
||||
if(is_mining_level(z))
|
||||
spawned_flora = SpawnFlora(T)
|
||||
if(!spawned_flora) // no rocks beneath mob spawners / mobs.
|
||||
SpawnMonster(T)
|
||||
SpawnTerrain(T)
|
||||
T.ChangeTurf(turf_type, null, CHANGETURF_IGNORE_AIR)
|
||||
|
||||
/turf/open/floor/plating/asteroid/airless/cave/proc/SpawnTerrain(turf/T)
|
||||
if(prob(1))
|
||||
if(istype(loc, /area/mine/explored) || istype(loc, /area/lavaland/surface/outdoors/explored))
|
||||
return
|
||||
var/randumb = pickweight(terrain_spawn_list)
|
||||
for(var/obj/structure/geyser/F in range(7, T))
|
||||
if(istype(F, randumb))
|
||||
return
|
||||
new randumb(T)
|
||||
|
||||
/// Spawns a random mob or megafauna in the tunnel
|
||||
/turf/open/floor/plating/asteroid/airless/cave/proc/SpawnMonster(turf/T)
|
||||
if(!isarea(loc))
|
||||
return
|
||||
var/area/A = loc
|
||||
if(prob(30))
|
||||
if(!A.mob_spawn_allowed)
|
||||
return
|
||||
var/randumb = pickweight(mob_spawn_list)
|
||||
if(!randumb)
|
||||
return
|
||||
while(randumb == SPAWN_MEGAFAUNA)
|
||||
if(A.megafauna_spawn_allowed && megafauna_spawn_list && megafauna_spawn_list.len) //this is danger. it's boss time.
|
||||
var/maybe_boss = pickweight(megafauna_spawn_list)
|
||||
if(megafauna_spawn_list[maybe_boss])
|
||||
randumb = maybe_boss
|
||||
if(ispath(maybe_boss, /mob/living/simple_animal/hostile/megafauna/bubblegum)) //there can be only one bubblegum, so don't waste spawns on it
|
||||
megafauna_spawn_list[maybe_boss] = 0
|
||||
else //this is not danger, don't spawn a boss, spawn something else
|
||||
randumb = pickweight(mob_spawn_list)
|
||||
|
||||
for(var/mob/living/simple_animal/hostile/H in urange(12,T)) //prevents mob clumps
|
||||
if((ispath(randumb, /mob/living/simple_animal/hostile/megafauna) || ismegafauna(H)) && get_dist(src, H) <= 7)
|
||||
return //if there's a megafauna within standard view don't spawn anything at all
|
||||
if(ispath(randumb, /mob/living/simple_animal/hostile/asteroid) || istype(H, /mob/living/simple_animal/hostile/asteroid))
|
||||
return //if the random is a standard mob, avoid spawning if there's another one within 12 tiles
|
||||
if((ispath(randumb, /obj/structure/spawner/lavaland) || istype(H, /obj/structure/spawner/lavaland)) && get_dist(src, H) <= 2)
|
||||
return //prevents tendrils spawning in each other's collapse range
|
||||
|
||||
new randumb(T)
|
||||
return TRUE
|
||||
|
||||
#undef SPAWN_MEGAFAUNA
|
||||
#undef SPAWN_BUBBLEGUM
|
||||
|
||||
/// Spawns a random flora in the tunnel, can spawn clumps of them.
|
||||
/turf/open/floor/plating/asteroid/airless/cave/proc/SpawnFlora(turf/T)
|
||||
if(prob(12))
|
||||
if(isarea(loc))
|
||||
var/area/A = loc
|
||||
if(!A.flora_allowed)
|
||||
return
|
||||
var/randumb = pickweight(flora_spawn_list)
|
||||
if(!randumb)
|
||||
return
|
||||
for(var/obj/structure/flora/F in range(4, T)) // Allows for growing patches, but not ridiculous stacks of flora
|
||||
if(!istype(F, randumb))
|
||||
return
|
||||
new randumb(T)
|
||||
return TRUE
|
||||
|
||||
/turf/open/floor/plating/asteroid/snow
|
||||
gender = PLURAL
|
||||
name = "snow"
|
||||
@@ -420,6 +166,9 @@
|
||||
bullet_bounce_sound = null
|
||||
digResult = /obj/item/stack/sheet/mineral/snow
|
||||
|
||||
// /turf/open/floor/plating/asteroid/snow/setup_broken_states()
|
||||
// return list("snow_dug")
|
||||
|
||||
/turf/open/floor/plating/asteroid/snow/burn_tile()
|
||||
if(!burnt)
|
||||
visible_message("<span class='danger'>[src] melts away!.</span>")
|
||||
@@ -430,8 +179,9 @@
|
||||
return FALSE
|
||||
|
||||
/turf/open/floor/plating/asteroid/snow/icemoon
|
||||
baseturfs = /turf/open/floor/plating/asteroid/snow/icemoon
|
||||
baseturfs = /turf/open/openspace/icemoon
|
||||
initial_gas_mix = ICEMOON_DEFAULT_ATMOS
|
||||
slowdown = 0
|
||||
|
||||
/turf/open/lava/plasma/ice_moon
|
||||
initial_gas_mix = ICEMOON_DEFAULT_ATMOS
|
||||
@@ -442,24 +192,22 @@
|
||||
name = "icy snow"
|
||||
desc = "Looks colder."
|
||||
baseturfs = /turf/open/floor/plating/asteroid/snow/ice
|
||||
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120"
|
||||
initial_gas_mix = "n2=82;plasma=24;TEMP=120"
|
||||
floor_variance = 0
|
||||
icon_state = "snow-ice"
|
||||
icon_plating = "snow-ice"
|
||||
environment_type = "snow_cavern"
|
||||
environment_type = "snow-ice"
|
||||
footstep = FOOTSTEP_FLOOR
|
||||
barefootstep = FOOTSTEP_HARD_BAREFOOT
|
||||
clawfootstep = FOOTSTEP_HARD_CLAW
|
||||
heavyfootstep = FOOTSTEP_GENERIC_HEAVY
|
||||
|
||||
// /turf/open/floor/plating/asteroid/snow/ice/setup_broken_states()
|
||||
// return list("snow-ice")
|
||||
/turf/open/floor/plating/asteroid/snow/ice/icemoon
|
||||
baseturfs = /turf/open/floor/plating/asteroid/snow/ice/icemoon
|
||||
initial_gas_mix = ICEMOON_DEFAULT_ATMOS
|
||||
planetary_atmos = TRUE
|
||||
|
||||
/turf/open/floor/plating/asteroid/snow/ice/icemoon/solarpanel
|
||||
icon = 'icons/turf/floors.dmi'
|
||||
icon_state = "solarpanel"
|
||||
slowdown = 0
|
||||
|
||||
/turf/open/floor/plating/asteroid/snow/ice/burn_tile()
|
||||
return FALSE
|
||||
|
||||
Reference in New Issue
Block a user