mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
# This is a combination of 2 commits.
# The first commit's message is: Rewriting the mining turfs to reduce worldstart lag. # This is the 2nd commit message: Map cleanup.
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
// Returns the lowest turf available on a given Z-level, defaults to asteroid for Polaris.
|
// Returns the lowest turf available on a given Z-level, defaults to asteroid for Polaris.
|
||||||
var/global/list/base_turf_by_z = list(
|
var/global/list/base_turf_by_z = list(
|
||||||
"1" = /turf/simulated/floor/asteroid,
|
"1" = /turf/simulated/mineral/floor,
|
||||||
"4" = /turf/simulated/floor/asteroid,
|
"4" = /turf/simulated/mineral/floor,
|
||||||
"5" = /turf/simulated/floor/asteroid
|
"5" = /turf/simulated/mineral/floor
|
||||||
)
|
)
|
||||||
|
|
||||||
proc/get_base_turf(var/z)
|
proc/get_base_turf(var/z)
|
||||||
|
|||||||
@@ -107,10 +107,6 @@
|
|||||||
for(var/obj/item/weapon/ore/ore in range(chassis,1))
|
for(var/obj/item/weapon/ore/ore in range(chassis,1))
|
||||||
if(get_dir(chassis,ore)&chassis.dir)
|
if(get_dir(chassis,ore)&chassis.dir)
|
||||||
ore.Move(ore_box)
|
ore.Move(ore_box)
|
||||||
else if(istype(target, /turf/simulated/floor/asteroid))
|
|
||||||
for(var/turf/simulated/floor/asteroid/M in range(chassis,1))
|
|
||||||
if(get_dir(chassis,M)&chassis.dir)
|
|
||||||
M.gets_dug()
|
|
||||||
log_message("Drilled through [target]")
|
log_message("Drilled through [target]")
|
||||||
if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment)
|
if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment)
|
||||||
var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo
|
var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo
|
||||||
@@ -160,15 +156,6 @@
|
|||||||
for(var/obj/item/weapon/ore/ore in range(chassis,1))
|
for(var/obj/item/weapon/ore/ore in range(chassis,1))
|
||||||
if(get_dir(chassis,ore)&chassis.dir)
|
if(get_dir(chassis,ore)&chassis.dir)
|
||||||
ore.Move(ore_box)
|
ore.Move(ore_box)
|
||||||
else if(istype(target,/turf/simulated/floor/asteroid))
|
|
||||||
for(var/turf/simulated/floor/asteroid/M in range(target,1))
|
|
||||||
M.gets_dug()
|
|
||||||
log_message("Drilled through [target]")
|
|
||||||
if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment)
|
|
||||||
var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo
|
|
||||||
if(ore_box)
|
|
||||||
for(var/obj/item/weapon/ore/ore in range(target,1))
|
|
||||||
ore.Move(ore_box)
|
|
||||||
else if(target.loc == C)
|
else if(target.loc == C)
|
||||||
log_message("Drilled through [target]")
|
log_message("Drilled through [target]")
|
||||||
target.ex_act(2)
|
target.ex_act(2)
|
||||||
|
|||||||
@@ -74,11 +74,7 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
//Drill through the flooring, if any.
|
//Drill through the flooring, if any.
|
||||||
if(istype(get_turf(src), /turf/simulated/floor/asteroid))
|
if(istype(get_turf(src), /turf/simulated/floor))
|
||||||
var/turf/simulated/floor/asteroid/T = get_turf(src)
|
|
||||||
if(!T.dug)
|
|
||||||
T.gets_dug()
|
|
||||||
else if(istype(get_turf(src), /turf/simulated/floor))
|
|
||||||
var/turf/simulated/floor/T = get_turf(src)
|
var/turf/simulated/floor/T = get_turf(src)
|
||||||
T.ex_act(2.0)
|
T.ex_act(2.0)
|
||||||
|
|
||||||
|
|||||||
@@ -235,7 +235,7 @@
|
|||||||
var/obj/item/stack/flag/F = locate() in get_turf(src)
|
var/obj/item/stack/flag/F = locate() in get_turf(src)
|
||||||
|
|
||||||
var/turf/T = get_turf(src)
|
var/turf/T = get_turf(src)
|
||||||
if(!T || !istype(T,/turf/simulated/floor/asteroid))
|
if(!T || !istype(T,/turf/simulated/mineral))
|
||||||
user << "The flag won't stand up in this terrain."
|
user << "The flag won't stand up in this terrain."
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
icon_state = "rock-dark"
|
icon_state = "rock-dark"
|
||||||
|
|
||||||
/turf/simulated/mineral //wall piece
|
/turf/simulated/mineral //wall piece
|
||||||
name = "Rock"
|
name = "rock"
|
||||||
icon = 'icons/turf/walls.dmi'
|
icon = 'icons/turf/walls.dmi'
|
||||||
icon_state = "rock"
|
icon_state = "rock"
|
||||||
oxygen = 0
|
oxygen = 0
|
||||||
@@ -14,11 +14,13 @@
|
|||||||
density = 1
|
density = 1
|
||||||
blocks_air = 1
|
blocks_air = 1
|
||||||
temperature = T0C
|
temperature = T0C
|
||||||
var/mined_turf = /turf/simulated/floor/asteroid
|
|
||||||
var/ore/mineral
|
var/ore/mineral
|
||||||
|
var/sand_dug
|
||||||
var/mined_ore = 0
|
var/mined_ore = 0
|
||||||
var/last_act = 0
|
var/last_act = 0
|
||||||
var/emitter_blasts_taken = 0 // EMITTER MINING! Muhehe.
|
var/emitter_blasts_taken = 0 // EMITTER MINING! Muhehe.
|
||||||
|
var/overlay_detail
|
||||||
|
|
||||||
var/datum/geosample/geologic_data
|
var/datum/geosample/geologic_data
|
||||||
var/excavation_level = 0
|
var/excavation_level = 0
|
||||||
@@ -28,26 +30,108 @@
|
|||||||
var/excav_overlay = ""
|
var/excav_overlay = ""
|
||||||
var/obj/item/weapon/last_find
|
var/obj/item/weapon/last_find
|
||||||
var/datum/artifact_find/artifact_find
|
var/datum/artifact_find/artifact_find
|
||||||
|
var/ignore_mapgen
|
||||||
|
|
||||||
has_resources = 1
|
has_resources = 1
|
||||||
|
|
||||||
/turf/simulated/mineral/New()
|
/turf/simulated/mineral/ignore_mapgen
|
||||||
spawn(0)
|
ignore_mapgen = 1
|
||||||
MineralSpread()
|
|
||||||
spawn(2)
|
|
||||||
updateMineralOverlays(1)
|
|
||||||
|
|
||||||
/turf/simulated/mineral/proc/updateMineralOverlays(var/update_neighbors)
|
/turf/simulated/mineral/floor
|
||||||
var/list/step_overlays = list("s" = NORTH, "n" = SOUTH, "w" = EAST, "e" = WEST)
|
name = "sand"
|
||||||
for(var/direction in step_overlays)
|
icon = 'icons/turf/flooring/asteroid.dmi'
|
||||||
var/turf/turf_to_check = get_step(src,step_overlays[direction])
|
icon_state = "asteroid"
|
||||||
if(update_neighbors && istype(turf_to_check,/turf/simulated/floor/asteroid))
|
density = 0
|
||||||
var/turf/simulated/floor/asteroid/T = turf_to_check
|
opacity = 0
|
||||||
T.updateMineralOverlays()
|
|
||||||
else if(istype(turf_to_check,/turf/space) || istype(turf_to_check,/turf/simulated/floor))
|
/turf/simulated/mineral/floor/ignore_mapgen
|
||||||
turf_to_check.overlays += image('icons/turf/walls.dmi', "rock_side_[direction]")
|
ignore_mapgen = 1
|
||||||
|
|
||||||
|
/turf/simulated/mineral/proc/make_floor()
|
||||||
|
if(!density && !opacity)
|
||||||
|
return
|
||||||
|
density = 0
|
||||||
|
opacity = 0
|
||||||
|
update_icon()
|
||||||
|
reconsider_lights()
|
||||||
|
|
||||||
|
/turf/simulated/mineral/proc/make_wall()
|
||||||
|
if(density && opacity)
|
||||||
|
return
|
||||||
|
density = 1
|
||||||
|
opacity = 1
|
||||||
|
update_icon()
|
||||||
|
reconsider_lights()
|
||||||
|
|
||||||
|
/turf/simulated/mineral/Entered(atom/movable/M as mob|obj)
|
||||||
|
. = ..()
|
||||||
|
if(istype(M,/mob/living/silicon/robot))
|
||||||
|
var/mob/living/silicon/robot/R = M
|
||||||
|
if(R.module)
|
||||||
|
if(istype(R.module_state_1,/obj/item/weapon/storage/bag/ore))
|
||||||
|
attackby(R.module_state_1,R)
|
||||||
|
else if(istype(R.module_state_2,/obj/item/weapon/storage/bag/ore))
|
||||||
|
attackby(R.module_state_2,R)
|
||||||
|
else if(istype(R.module_state_3,/obj/item/weapon/storage/bag/ore))
|
||||||
|
attackby(R.module_state_3,R)
|
||||||
|
else
|
||||||
|
return
|
||||||
|
|
||||||
|
/turf/simulated/mineral/initialize()
|
||||||
|
if(prob(20))
|
||||||
|
overlay_detail = "asteroid[rand(0,9)]"
|
||||||
|
if(density)
|
||||||
|
spawn(0)
|
||||||
|
MineralSpread()
|
||||||
|
update_icon(1)
|
||||||
|
|
||||||
|
/turf/simulated/mineral/update_icon(var/update_neighbors)
|
||||||
|
|
||||||
|
overlays.Cut()
|
||||||
|
var/list/step_overlays = list("n" = NORTH, "s" = SOUTH, "e" = EAST, "w" = WEST)
|
||||||
|
|
||||||
|
if(density)
|
||||||
|
if(mineral)
|
||||||
|
name = "[mineral.display_name] deposit"
|
||||||
|
else
|
||||||
|
name = "rock"
|
||||||
|
|
||||||
|
icon = 'icons/turf/walls.dmi'
|
||||||
|
icon_state = "rock"
|
||||||
|
|
||||||
|
for(var/direction in step_overlays)
|
||||||
|
var/turf/T = get_step(src,step_overlays[direction])
|
||||||
|
if(istype(T) && !T.density)
|
||||||
|
T.overlays += image('icons/turf/walls.dmi', "rock_side", dir = turn(step_overlays[direction], 180))
|
||||||
|
else
|
||||||
|
|
||||||
|
name = "sand"
|
||||||
|
icon = 'icons/turf/flooring/asteroid.dmi'
|
||||||
|
icon_state = "asteroid"
|
||||||
|
|
||||||
|
if(sand_dug)
|
||||||
|
overlays += image('icons/turf/flooring/asteroid.dmi', "dug_overlay")
|
||||||
|
|
||||||
|
for(var/direction in step_overlays)
|
||||||
|
if(istype(get_step(src, step_overlays[direction]), /turf/space))
|
||||||
|
overlays += image('icons/turf/flooring/asteroid.dmi', "asteroid_edges", dir = step_overlays[direction])
|
||||||
|
else
|
||||||
|
var/turf/simulated/mineral/M = get_step(src, step_overlays[direction])
|
||||||
|
if(istype(M) && M.density)
|
||||||
|
overlays += image('icons/turf/walls.dmi', "rock_side", dir = step_overlays[direction])
|
||||||
|
|
||||||
|
if(overlay_detail)
|
||||||
|
overlays |= image(icon = 'icons/turf/flooring/decals.dmi', icon_state = overlay_detail)
|
||||||
|
|
||||||
|
if(update_neighbors)
|
||||||
|
var/list/all_step_directions = list(NORTH,NORTHEAST,EAST,SOUTHEAST,SOUTH,SOUTHWEST,WEST,NORTHWEST)
|
||||||
|
for(var/direction in all_step_directions)
|
||||||
|
if(istype(get_step(src, direction), /turf/simulated/mineral))
|
||||||
|
var/turf/simulated/mineral/M = get_step(src, direction)
|
||||||
|
M.update_icon()
|
||||||
|
|
||||||
/turf/simulated/mineral/ex_act(severity)
|
/turf/simulated/mineral/ex_act(severity)
|
||||||
|
|
||||||
switch(severity)
|
switch(severity)
|
||||||
if(2.0)
|
if(2.0)
|
||||||
if (prob(70))
|
if (prob(70))
|
||||||
@@ -62,13 +146,17 @@
|
|||||||
// Emitter blasts
|
// Emitter blasts
|
||||||
if(istype(Proj, /obj/item/projectile/beam/emitter))
|
if(istype(Proj, /obj/item/projectile/beam/emitter))
|
||||||
emitter_blasts_taken++
|
emitter_blasts_taken++
|
||||||
|
|
||||||
if(emitter_blasts_taken > 2) // 3 blasts per tile
|
if(emitter_blasts_taken > 2) // 3 blasts per tile
|
||||||
mined_ore = 1
|
mined_ore = 1
|
||||||
GetDrilled()
|
GetDrilled()
|
||||||
|
|
||||||
/turf/simulated/mineral/Bumped(AM)
|
/turf/simulated/mineral/Bumped(AM)
|
||||||
|
|
||||||
. = ..()
|
. = ..()
|
||||||
|
|
||||||
|
if(!density)
|
||||||
|
return .
|
||||||
|
|
||||||
if(istype(AM,/mob/living/carbon/human))
|
if(istype(AM,/mob/living/carbon/human))
|
||||||
var/mob/living/carbon/human/H = AM
|
var/mob/living/carbon/human/H = AM
|
||||||
if((istype(H.l_hand,/obj/item/weapon/pickaxe)) && (!H.hand))
|
if((istype(H.l_hand,/obj/item/weapon/pickaxe)) && (!H.hand))
|
||||||
@@ -91,7 +179,7 @@
|
|||||||
for(var/trydir in cardinal)
|
for(var/trydir in cardinal)
|
||||||
if(prob(mineral.spread_chance))
|
if(prob(mineral.spread_chance))
|
||||||
var/turf/simulated/mineral/target_turf = get_step(src, trydir)
|
var/turf/simulated/mineral/target_turf = get_step(src, trydir)
|
||||||
if(istype(target_turf) && !target_turf.mineral)
|
if(istype(target_turf) && target_turf.density && !target_turf.mineral)
|
||||||
target_turf.mineral = mineral
|
target_turf.mineral = mineral
|
||||||
target_turf.UpdateMineral()
|
target_turf.UpdateMineral()
|
||||||
target_turf.MineralSpread()
|
target_turf.MineralSpread()
|
||||||
@@ -99,143 +187,185 @@
|
|||||||
|
|
||||||
/turf/simulated/mineral/proc/UpdateMineral()
|
/turf/simulated/mineral/proc/UpdateMineral()
|
||||||
clear_ore_effects()
|
clear_ore_effects()
|
||||||
if(!mineral)
|
if(mineral)
|
||||||
name = "\improper Rock"
|
new /obj/effect/mineral(src, mineral)
|
||||||
icon_state = "rock"
|
update_icon()
|
||||||
return
|
|
||||||
name = "\improper [mineral.display_name] deposit"
|
|
||||||
new /obj/effect/mineral(src, mineral)
|
|
||||||
|
|
||||||
//Not even going to touch this pile of spaghetti
|
//Not even going to touch this pile of spaghetti
|
||||||
/turf/simulated/mineral/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
/turf/simulated/mineral/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||||
|
|
||||||
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
|
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
|
||||||
usr << "\red You don't have the dexterity to do this!"
|
usr << "<span class='warning'>You don't have the dexterity to do this!</span>"
|
||||||
return
|
return
|
||||||
|
|
||||||
if (istype(W, /obj/item/device/core_sampler))
|
if(!density)
|
||||||
geologic_data.UpdateNearbyArtifactInfo(src)
|
|
||||||
var/obj/item/device/core_sampler/C = W
|
|
||||||
C.sample_item(src, user)
|
|
||||||
return
|
|
||||||
|
|
||||||
if (istype(W, /obj/item/device/depth_scanner))
|
var/list/usable_tools = list(
|
||||||
var/obj/item/device/depth_scanner/C = W
|
/obj/item/weapon/shovel,
|
||||||
C.scan_atom(user, src)
|
/obj/item/weapon/pickaxe/diamonddrill,
|
||||||
return
|
/obj/item/weapon/pickaxe/drill,
|
||||||
|
/obj/item/weapon/pickaxe/borgdrill
|
||||||
|
)
|
||||||
|
|
||||||
if (istype(W, /obj/item/device/measuring_tape))
|
var/valid_tool
|
||||||
var/obj/item/device/measuring_tape/P = W
|
for(var/valid_type in usable_tools)
|
||||||
user.visible_message("\blue[user] extends [P] towards [src].","\blue You extend [P] towards [src].")
|
if(istype(W,valid_type))
|
||||||
if(do_after(user,25))
|
valid_tool = 1
|
||||||
user << "\blue \icon[P] [src] has been excavated to a depth of [2*excavation_level]cm."
|
break
|
||||||
return
|
|
||||||
|
|
||||||
if (istype(W, /obj/item/weapon/pickaxe))
|
if(valid_tool)
|
||||||
var/turf/T = user.loc
|
if (sand_dug)
|
||||||
if (!( istype(T, /turf) ))
|
user << "<span class='warning'>This area has already been dug.</span>"
|
||||||
return
|
|
||||||
|
|
||||||
var/obj/item/weapon/pickaxe/P = W
|
|
||||||
if(last_act + P.digspeed > world.time)//prevents message spam
|
|
||||||
return
|
|
||||||
last_act = world.time
|
|
||||||
|
|
||||||
playsound(user, P.drill_sound, 20, 1)
|
|
||||||
|
|
||||||
//handle any archaeological finds we might uncover
|
|
||||||
var/fail_message
|
|
||||||
if(finds && finds.len)
|
|
||||||
var/datum/find/F = finds[1]
|
|
||||||
if(excavation_level + P.excavation_amount > F.excavation_required)
|
|
||||||
//Chance to destroy / extract any finds here
|
|
||||||
fail_message = ". <b>[pick("There is a crunching noise","[W] collides with some different rock","Part of the rock face crumbles away","Something breaks under [W]")]</b>"
|
|
||||||
|
|
||||||
user << "\red You start [P.drill_verb][fail_message ? fail_message : ""]."
|
|
||||||
|
|
||||||
if(fail_message && prob(90))
|
|
||||||
if(prob(25))
|
|
||||||
excavate_find(5, finds[1])
|
|
||||||
else if(prob(50))
|
|
||||||
finds.Remove(finds[1])
|
|
||||||
if(prob(50))
|
|
||||||
artifact_debris()
|
|
||||||
|
|
||||||
if(do_after(user,P.digspeed))
|
|
||||||
user << "\blue You finish [P.drill_verb] the rock."
|
|
||||||
|
|
||||||
if(finds && finds.len)
|
|
||||||
var/datum/find/F = finds[1]
|
|
||||||
if(round(excavation_level + P.excavation_amount) == F.excavation_required)
|
|
||||||
//Chance to extract any items here perfectly, otherwise just pull them out along with the rock surrounding them
|
|
||||||
if(excavation_level + P.excavation_amount > F.excavation_required)
|
|
||||||
//if you can get slightly over, perfect extraction
|
|
||||||
excavate_find(100, F)
|
|
||||||
else
|
|
||||||
excavate_find(80, F)
|
|
||||||
|
|
||||||
else if(excavation_level + P.excavation_amount > F.excavation_required - F.clearance_range)
|
|
||||||
//just pull the surrounding rock out
|
|
||||||
excavate_find(0, F)
|
|
||||||
|
|
||||||
if( excavation_level + P.excavation_amount >= 100 )
|
|
||||||
//if players have been excavating this turf, leave some rocky debris behind
|
|
||||||
var/obj/structure/boulder/B
|
|
||||||
if(artifact_find)
|
|
||||||
if( excavation_level > 0 || prob(15) )
|
|
||||||
//boulder with an artifact inside
|
|
||||||
B = new(src)
|
|
||||||
if(artifact_find)
|
|
||||||
B.artifact_find = artifact_find
|
|
||||||
else
|
|
||||||
artifact_debris(1)
|
|
||||||
else if(prob(15))
|
|
||||||
//empty boulder
|
|
||||||
B = new(src)
|
|
||||||
|
|
||||||
if(B)
|
|
||||||
GetDrilled(0)
|
|
||||||
else
|
|
||||||
GetDrilled(1)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
excavation_level += P.excavation_amount
|
var/turf/T = user.loc
|
||||||
|
if (!(istype(T)))
|
||||||
|
return
|
||||||
|
|
||||||
//archaeo overlays
|
user << "<span class='notice'>You start digging.</span>"
|
||||||
if(!archaeo_overlay && finds && finds.len)
|
playsound(user.loc, 'sound/effects/rustle1.ogg', 50, 1)
|
||||||
var/datum/find/F = finds[1]
|
|
||||||
if(F.excavation_required <= excavation_level + F.view_range)
|
|
||||||
archaeo_overlay = "overlay_archaeo[rand(1,3)]"
|
|
||||||
overlays += archaeo_overlay
|
|
||||||
|
|
||||||
//there's got to be a better way to do this
|
if(!do_after(user,40)) return
|
||||||
var/update_excav_overlay = 0
|
|
||||||
if(excavation_level >= 75)
|
|
||||||
if(excavation_level - P.excavation_amount < 75)
|
|
||||||
update_excav_overlay = 1
|
|
||||||
else if(excavation_level >= 50)
|
|
||||||
if(excavation_level - P.excavation_amount < 50)
|
|
||||||
update_excav_overlay = 1
|
|
||||||
else if(excavation_level >= 25)
|
|
||||||
if(excavation_level - P.excavation_amount < 25)
|
|
||||||
update_excav_overlay = 1
|
|
||||||
|
|
||||||
//update overlays displaying excavation level
|
user << "<span class='notice'>You dug a hole.</span>"
|
||||||
if( !(excav_overlay && excavation_level > 0) || update_excav_overlay )
|
GetDrilled()
|
||||||
var/excav_quadrant = round(excavation_level / 25) + 1
|
|
||||||
excav_overlay = "overlay_excv[excav_quadrant]_[rand(1,3)]"
|
|
||||||
overlays += excav_overlay
|
|
||||||
|
|
||||||
//drop some rocks
|
|
||||||
next_rock += P.excavation_amount * 10
|
|
||||||
while(next_rock > 100)
|
|
||||||
next_rock -= 100
|
|
||||||
var/obj/item/weapon/ore/O = new(src)
|
|
||||||
geologic_data.UpdateNearbyArtifactInfo(src)
|
|
||||||
O.geologic_data = geologic_data
|
|
||||||
|
|
||||||
|
else if(istype(W,/obj/item/weapon/storage/bag/ore))
|
||||||
|
var/obj/item/weapon/storage/bag/ore/S = W
|
||||||
|
if(S.collection_mode)
|
||||||
|
for(var/obj/item/weapon/ore/O in contents)
|
||||||
|
O.attackby(W,user)
|
||||||
|
return
|
||||||
|
else if(istype(W,/obj/item/weapon/storage/bag/fossils))
|
||||||
|
var/obj/item/weapon/storage/bag/fossils/S = W
|
||||||
|
if(S.collection_mode)
|
||||||
|
for(var/obj/item/weapon/fossil/F in contents)
|
||||||
|
F.attackby(W,user)
|
||||||
|
return
|
||||||
else
|
else
|
||||||
return attack_hand(user)
|
if (istype(W, /obj/item/device/core_sampler))
|
||||||
|
geologic_data.UpdateNearbyArtifactInfo(src)
|
||||||
|
var/obj/item/device/core_sampler/C = W
|
||||||
|
C.sample_item(src, user)
|
||||||
|
return
|
||||||
|
|
||||||
|
if (istype(W, /obj/item/device/depth_scanner))
|
||||||
|
var/obj/item/device/depth_scanner/C = W
|
||||||
|
C.scan_atom(user, src)
|
||||||
|
return
|
||||||
|
|
||||||
|
if (istype(W, /obj/item/device/measuring_tape))
|
||||||
|
var/obj/item/device/measuring_tape/P = W
|
||||||
|
user.visible_message("<span class='notice'>\The [user] extends \a [P] towards \the [src].</span>","<span class='notice'>You extend \the [P] towards \the [src].</span>")
|
||||||
|
if(do_after(user,25))
|
||||||
|
user << "<span class='notice'>\icon[P] [src] has been excavated to a depth of [2*excavation_level]cm.</span>"
|
||||||
|
return
|
||||||
|
|
||||||
|
if (istype(W, /obj/item/weapon/pickaxe))
|
||||||
|
var/turf/T = user.loc
|
||||||
|
if (!( istype(T, /turf) ))
|
||||||
|
return
|
||||||
|
|
||||||
|
var/obj/item/weapon/pickaxe/P = W
|
||||||
|
if(last_act + P.digspeed > world.time)//prevents message spam
|
||||||
|
return
|
||||||
|
last_act = world.time
|
||||||
|
|
||||||
|
playsound(user, P.drill_sound, 20, 1)
|
||||||
|
|
||||||
|
//handle any archaeological finds we might uncover
|
||||||
|
var/fail_message
|
||||||
|
if(finds && finds.len)
|
||||||
|
var/datum/find/F = finds[1]
|
||||||
|
if(excavation_level + P.excavation_amount > F.excavation_required)
|
||||||
|
//Chance to destroy / extract any finds here
|
||||||
|
fail_message = ". <b>[pick("There is a crunching noise","[W] collides with some different rock","Part of the rock face crumbles away","Something breaks under [W]")]</b>"
|
||||||
|
|
||||||
|
user << "<span class='notice'>You start [P.drill_verb][fail_message ? fail_message : ""].</span>"
|
||||||
|
|
||||||
|
if(fail_message && prob(90))
|
||||||
|
if(prob(25))
|
||||||
|
excavate_find(5, finds[1])
|
||||||
|
else if(prob(50))
|
||||||
|
finds.Remove(finds[1])
|
||||||
|
if(prob(50))
|
||||||
|
artifact_debris()
|
||||||
|
|
||||||
|
if(do_after(user,P.digspeed))
|
||||||
|
user << "<span class='notice'>You finish [P.drill_verb] \the [src].</span>"
|
||||||
|
|
||||||
|
if(finds && finds.len)
|
||||||
|
var/datum/find/F = finds[1]
|
||||||
|
if(round(excavation_level + P.excavation_amount) == F.excavation_required)
|
||||||
|
//Chance to extract any items here perfectly, otherwise just pull them out along with the rock surrounding them
|
||||||
|
if(excavation_level + P.excavation_amount > F.excavation_required)
|
||||||
|
//if you can get slightly over, perfect extraction
|
||||||
|
excavate_find(100, F)
|
||||||
|
else
|
||||||
|
excavate_find(80, F)
|
||||||
|
|
||||||
|
else if(excavation_level + P.excavation_amount > F.excavation_required - F.clearance_range)
|
||||||
|
//just pull the surrounding rock out
|
||||||
|
excavate_find(0, F)
|
||||||
|
|
||||||
|
if( excavation_level + P.excavation_amount >= 100 )
|
||||||
|
//if players have been excavating this turf, leave some rocky debris behind
|
||||||
|
var/obj/structure/boulder/B
|
||||||
|
if(artifact_find)
|
||||||
|
if( excavation_level > 0 || prob(15) )
|
||||||
|
//boulder with an artifact inside
|
||||||
|
B = new(src)
|
||||||
|
if(artifact_find)
|
||||||
|
B.artifact_find = artifact_find
|
||||||
|
else
|
||||||
|
artifact_debris(1)
|
||||||
|
else if(prob(15))
|
||||||
|
//empty boulder
|
||||||
|
B = new(src)
|
||||||
|
|
||||||
|
if(B)
|
||||||
|
GetDrilled(0)
|
||||||
|
else
|
||||||
|
GetDrilled(1)
|
||||||
|
return
|
||||||
|
|
||||||
|
excavation_level += P.excavation_amount
|
||||||
|
|
||||||
|
//archaeo overlays
|
||||||
|
if(!archaeo_overlay && finds && finds.len)
|
||||||
|
var/datum/find/F = finds[1]
|
||||||
|
if(F.excavation_required <= excavation_level + F.view_range)
|
||||||
|
archaeo_overlay = "overlay_archaeo[rand(1,3)]"
|
||||||
|
overlays += archaeo_overlay
|
||||||
|
|
||||||
|
//there's got to be a better way to do this
|
||||||
|
var/update_excav_overlay = 0
|
||||||
|
if(excavation_level >= 75)
|
||||||
|
if(excavation_level - P.excavation_amount < 75)
|
||||||
|
update_excav_overlay = 1
|
||||||
|
else if(excavation_level >= 50)
|
||||||
|
if(excavation_level - P.excavation_amount < 50)
|
||||||
|
update_excav_overlay = 1
|
||||||
|
else if(excavation_level >= 25)
|
||||||
|
if(excavation_level - P.excavation_amount < 25)
|
||||||
|
update_excav_overlay = 1
|
||||||
|
|
||||||
|
//update overlays displaying excavation level
|
||||||
|
if( !(excav_overlay && excavation_level > 0) || update_excav_overlay )
|
||||||
|
var/excav_quadrant = round(excavation_level / 25) + 1
|
||||||
|
excav_overlay = "overlay_excv[excav_quadrant]_[rand(1,3)]"
|
||||||
|
overlays += excav_overlay
|
||||||
|
|
||||||
|
//drop some rocks
|
||||||
|
next_rock += P.excavation_amount * 10
|
||||||
|
while(next_rock > 100)
|
||||||
|
next_rock -= 100
|
||||||
|
var/obj/item/weapon/ore/O = new(src)
|
||||||
|
geologic_data.UpdateNearbyArtifactInfo(src)
|
||||||
|
O.geologic_data = geologic_data
|
||||||
|
return
|
||||||
|
|
||||||
|
return attack_hand(user)
|
||||||
|
|
||||||
/turf/simulated/mineral/proc/clear_ore_effects()
|
/turf/simulated/mineral/proc/clear_ore_effects()
|
||||||
for(var/obj/effect/mineral/M in contents)
|
for(var/obj/effect/mineral/M in contents)
|
||||||
@@ -244,7 +374,6 @@
|
|||||||
/turf/simulated/mineral/proc/DropMineral()
|
/turf/simulated/mineral/proc/DropMineral()
|
||||||
if(!mineral)
|
if(!mineral)
|
||||||
return
|
return
|
||||||
|
|
||||||
clear_ore_effects()
|
clear_ore_effects()
|
||||||
var/obj/item/weapon/ore/O = new mineral.ore (src)
|
var/obj/item/weapon/ore/O = new mineral.ore (src)
|
||||||
if(istype(O))
|
if(istype(O))
|
||||||
@@ -253,7 +382,15 @@
|
|||||||
return O
|
return O
|
||||||
|
|
||||||
/turf/simulated/mineral/proc/GetDrilled(var/artifact_fail = 0)
|
/turf/simulated/mineral/proc/GetDrilled(var/artifact_fail = 0)
|
||||||
//var/destroyed = 0 //used for breaking strange rocks
|
|
||||||
|
if(!density)
|
||||||
|
if(!sand_dug)
|
||||||
|
sand_dug = 1
|
||||||
|
for(var/i=0;i<(rand(3)+2);i++)
|
||||||
|
new/obj/item/weapon/ore/glass(src)
|
||||||
|
update_icon()
|
||||||
|
return
|
||||||
|
|
||||||
if (mineral && mineral.result_amount)
|
if (mineral && mineral.result_amount)
|
||||||
|
|
||||||
//if the turf has already been excavated, some of it's ore has been removed
|
//if the turf has already been excavated, some of it's ore has been removed
|
||||||
@@ -267,7 +404,7 @@
|
|||||||
if(prob(50))
|
if(prob(50))
|
||||||
pain = 1
|
pain = 1
|
||||||
for(var/mob/living/M in range(src, 200))
|
for(var/mob/living/M in range(src, 200))
|
||||||
M << "<font color='red'><b>[pick("A high pitched [pick("keening","wailing","whistle")]","A rumbling noise like [pick("thunder","heavy machinery")]")] somehow penetrates your mind before fading away!</b></font>"
|
M << "<span class='danger'>[pick("A high-pitched [pick("keening","wailing","whistle")]","A rumbling noise like [pick("thunder","heavy machinery")]")] somehow penetrates your mind before fading away!</span>"
|
||||||
if(pain)
|
if(pain)
|
||||||
flick("pain",M.pain)
|
flick("pain",M.pain)
|
||||||
if(prob(50))
|
if(prob(50))
|
||||||
@@ -278,25 +415,17 @@
|
|||||||
M.Stun(5)
|
M.Stun(5)
|
||||||
M.apply_effect(25, IRRADIATE)
|
M.apply_effect(25, IRRADIATE)
|
||||||
|
|
||||||
|
|
||||||
var/list/step_overlays = list("n" = NORTH, "s" = SOUTH, "e" = EAST, "w" = WEST)
|
|
||||||
|
|
||||||
//Add some rubble, you did just clear out a big chunk of rock.
|
|
||||||
|
|
||||||
var/turf/simulated/floor/asteroid/N = ChangeTurf(mined_turf)
|
|
||||||
|
|
||||||
// Kill and update the space overlays around us.
|
// Kill and update the space overlays around us.
|
||||||
|
var/list/step_overlays = list("n" = NORTH, "s" = SOUTH, "e" = EAST, "w" = WEST)
|
||||||
for(var/direction in step_overlays)
|
for(var/direction in step_overlays)
|
||||||
var/turf/space/T = get_step(src, step_overlays[direction])
|
var/turf/space/T = get_step(src, step_overlays[direction])
|
||||||
if(istype(T))
|
if(istype(T))
|
||||||
T.overlays.Cut()
|
T.overlays.Cut()
|
||||||
for(var/next_direction in step_overlays)
|
for(var/next_direction in step_overlays)
|
||||||
if(istype(get_step(T, step_overlays[next_direction]),/turf/simulated/mineral))
|
if(istype(get_step(T, step_overlays[next_direction]),/turf/simulated/mineral))
|
||||||
T.overlays += image('icons/turf/walls.dmi', "rock_side_[next_direction]")
|
T.overlays += image('icons/turf/walls.dmi', "rock_side", dir = step_overlays[next_direction])
|
||||||
|
|
||||||
if(istype(N))
|
make_floor()
|
||||||
N.overlay_detail = "asteroid[rand(0,9)]"
|
|
||||||
N.updateMineralOverlays(1)
|
|
||||||
|
|
||||||
/turf/simulated/mineral/proc/excavate_find(var/prob_clean = 0, var/datum/find/F)
|
/turf/simulated/mineral/proc/excavate_find(var/prob_clean = 0, var/datum/find/F)
|
||||||
//with skill and luck, players can cleanly extract finds
|
//with skill and luck, players can cleanly extract finds
|
||||||
@@ -311,7 +440,7 @@
|
|||||||
|
|
||||||
//some find types delete the /obj/item/weapon/archaeological_find and replace it with something else, this handles when that happens
|
//some find types delete the /obj/item/weapon/archaeological_find and replace it with something else, this handles when that happens
|
||||||
//yuck
|
//yuck
|
||||||
var/display_name = "something"
|
var/display_name = "Something"
|
||||||
if(!X)
|
if(!X)
|
||||||
X = last_find
|
X = last_find
|
||||||
if(X)
|
if(X)
|
||||||
@@ -322,12 +451,11 @@
|
|||||||
var/obj/effect/suspension_field/S = locate() in src
|
var/obj/effect/suspension_field/S = locate() in src
|
||||||
if(!S || S.field_type != get_responsive_reagent(F.find_type))
|
if(!S || S.field_type != get_responsive_reagent(F.find_type))
|
||||||
if(X)
|
if(X)
|
||||||
visible_message("\red<b>[pick("[display_name] crumbles away into dust","[display_name] breaks apart")].</b>")
|
visible_message("<span class='danger'>\The [pick("[display_name] crumbles away into dust","[display_name] breaks apart")].</span>")
|
||||||
qdel(X)
|
qdel(X)
|
||||||
|
|
||||||
finds.Remove(F)
|
finds.Remove(F)
|
||||||
|
|
||||||
|
|
||||||
/turf/simulated/mineral/proc/artifact_debris(var/severity = 0)
|
/turf/simulated/mineral/proc/artifact_debris(var/severity = 0)
|
||||||
//cael's patented random limited drop componentized loot system!
|
//cael's patented random limited drop componentized loot system!
|
||||||
//sky's patented not-fucking-retarded overhaul!
|
//sky's patented not-fucking-retarded overhaul!
|
||||||
@@ -336,152 +464,24 @@
|
|||||||
for(var/j in 1 to rand(1, 3 + max(min(severity, 1), 0) * 2))
|
for(var/j in 1 to rand(1, 3 + max(min(severity, 1), 0) * 2))
|
||||||
switch(rand(1,7))
|
switch(rand(1,7))
|
||||||
if(1)
|
if(1)
|
||||||
var/obj/item/stack/rods/R = new(src)
|
new /obj/item/stack/rods(src, rand(5,25))
|
||||||
R.amount = rand(5,25)
|
|
||||||
|
|
||||||
if(2)
|
if(2)
|
||||||
var/obj/item/stack/material/plasteel/R = new(src)
|
new /obj/item/stack/material/plasteel(src, rand(5,25))
|
||||||
R.amount = rand(5,25)
|
|
||||||
|
|
||||||
if(3)
|
if(3)
|
||||||
var/obj/item/stack/material/steel/R = new(src)
|
new /obj/item/stack/material/steel(src, rand(5,25))
|
||||||
R.amount = rand(5,25)
|
|
||||||
|
|
||||||
if(4)
|
if(4)
|
||||||
var/obj/item/stack/material/plasteel/R = new(src)
|
new /obj/item/stack/material/plasteel(src, rand(5,25))
|
||||||
R.amount = rand(5,25)
|
|
||||||
|
|
||||||
if(5)
|
if(5)
|
||||||
var/quantity = rand(1,3)
|
for(var/i=1 to rand(1,3))
|
||||||
for(var/i=0, i<quantity, i++)
|
|
||||||
new /obj/item/weapon/material/shard(src)
|
new /obj/item/weapon/material/shard(src)
|
||||||
|
|
||||||
if(6)
|
if(6)
|
||||||
var/quantity = rand(1,3)
|
for(var/i=1 to rand(1,3))
|
||||||
for(var/i=0, i<quantity, i++)
|
|
||||||
new /obj/item/weapon/material/shard/phoron(src)
|
new /obj/item/weapon/material/shard/phoron(src)
|
||||||
|
|
||||||
if(7)
|
if(7)
|
||||||
var/obj/item/stack/material/uranium/R = new(src)
|
new /obj/item/stack/material/uranium(src, rand(5,25))
|
||||||
R.amount = rand(5,25)
|
|
||||||
|
|
||||||
/turf/simulated/mineral/random
|
/turf/simulated/mineral/proc/make_ore(var/rare_ore)
|
||||||
name = "Mineral deposit"
|
if(mineral)
|
||||||
var/mineralSpawnChanceList = list("Uranium" = 5, "Platinum" = 5, "Iron" = 35, "Coal" = 35, "Diamond" = 1, "Gold" = 5, "Silver" = 5, "Phoron" = 10)
|
|
||||||
var/mineralChance = 100 //10 //means 10% chance of this plot changing to a mineral deposit
|
|
||||||
|
|
||||||
/turf/simulated/mineral/random/New()
|
|
||||||
if (prob(mineralChance) && !mineral)
|
|
||||||
var/mineral_name = pickweight(mineralSpawnChanceList) //temp mineral name
|
|
||||||
mineral_name = lowertext(mineral_name)
|
|
||||||
if (mineral_name && (mineral_name in ore_data))
|
|
||||||
mineral = ore_data[mineral_name]
|
|
||||||
UpdateMineral()
|
|
||||||
|
|
||||||
. = ..()
|
|
||||||
|
|
||||||
/turf/simulated/mineral/random/high_chance
|
|
||||||
mineralChance = 100 //25
|
|
||||||
mineralSpawnChanceList = list("Uranium" = 10, "Platinum" = 10, "Iron" = 20, "Coal" = 20, "Diamond" = 2, "Gold" = 10, "Silver" = 10, "Phoron" = 20)
|
|
||||||
|
|
||||||
|
|
||||||
/**********************Asteroid**************************/
|
|
||||||
|
|
||||||
// Setting icon/icon_state initially will use these values when the turf is built on/replaced.
|
|
||||||
// This means you can put grass on the asteroid etc.
|
|
||||||
/turf/simulated/floor/asteroid
|
|
||||||
name = "sand"
|
|
||||||
icon = 'icons/turf/flooring/asteroid.dmi'
|
|
||||||
icon_state = "asteroid"
|
|
||||||
base_name = "sand"
|
|
||||||
base_desc = "Gritty and unpleasant."
|
|
||||||
base_icon = 'icons/turf/flooring/asteroid.dmi'
|
|
||||||
base_icon_state = "asteroid"
|
|
||||||
|
|
||||||
initial_flooring = null
|
|
||||||
oxygen = 0
|
|
||||||
nitrogen = 0
|
|
||||||
temperature = TCMB
|
|
||||||
var/dug = 0 //0 = has not yet been dug, 1 = has already been dug
|
|
||||||
var/overlay_detail
|
|
||||||
has_resources = 1
|
|
||||||
|
|
||||||
/turf/simulated/floor/asteroid/New()
|
|
||||||
|
|
||||||
if(prob(20))
|
|
||||||
overlay_detail = "asteroid[rand(0,9)]"
|
|
||||||
|
|
||||||
/turf/simulated/floor/asteroid/ex_act(severity)
|
|
||||||
switch(severity)
|
|
||||||
if(3.0)
|
|
||||||
return
|
|
||||||
if(2.0)
|
|
||||||
if (prob(70))
|
|
||||||
gets_dug()
|
|
||||||
if(1.0)
|
|
||||||
gets_dug()
|
|
||||||
return
|
|
||||||
|
|
||||||
/turf/simulated/floor/asteroid/is_plating()
|
|
||||||
return 0
|
|
||||||
|
|
||||||
/turf/simulated/floor/asteroid/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
|
||||||
|
|
||||||
if(!W || !user)
|
|
||||||
return 0
|
|
||||||
|
|
||||||
var/list/usable_tools = list(
|
|
||||||
/obj/item/weapon/shovel,
|
|
||||||
/obj/item/weapon/pickaxe/diamonddrill,
|
|
||||||
/obj/item/weapon/pickaxe/drill,
|
|
||||||
/obj/item/weapon/pickaxe/borgdrill
|
|
||||||
)
|
|
||||||
|
|
||||||
var/valid_tool
|
|
||||||
for(var/valid_type in usable_tools)
|
|
||||||
if(istype(W,valid_type))
|
|
||||||
valid_tool = 1
|
|
||||||
break
|
|
||||||
|
|
||||||
if(valid_tool)
|
|
||||||
if (dug)
|
|
||||||
user << "\red This area has already been dug"
|
|
||||||
return
|
|
||||||
|
|
||||||
var/turf/T = user.loc
|
|
||||||
if (!(istype(T)))
|
|
||||||
return
|
|
||||||
|
|
||||||
user << "\red You start digging."
|
|
||||||
playsound(user.loc, 'sound/effects/rustle1.ogg', 50, 1)
|
|
||||||
|
|
||||||
if(!do_after(user,40)) return
|
|
||||||
|
|
||||||
user << "\blue You dug a hole."
|
|
||||||
gets_dug()
|
|
||||||
|
|
||||||
else if(istype(W,/obj/item/weapon/storage/bag/ore))
|
|
||||||
var/obj/item/weapon/storage/bag/ore/S = W
|
|
||||||
if(S.collection_mode)
|
|
||||||
for(var/obj/item/weapon/ore/O in contents)
|
|
||||||
O.attackby(W,user)
|
|
||||||
return
|
|
||||||
else if(istype(W,/obj/item/weapon/storage/bag/fossils))
|
|
||||||
var/obj/item/weapon/storage/bag/fossils/S = W
|
|
||||||
if(S.collection_mode)
|
|
||||||
for(var/obj/item/weapon/fossil/F in contents)
|
|
||||||
F.attackby(W,user)
|
|
||||||
return
|
|
||||||
|
|
||||||
else if(istype(W, /obj/item/stack/rods))
|
|
||||||
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
|
|
||||||
if(L)
|
|
||||||
return
|
|
||||||
var/obj/item/stack/rods/R = W
|
|
||||||
if (R.use(1))
|
|
||||||
user << "<span class='notice'>Constructing support lattice ...</span>"
|
|
||||||
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
|
|
||||||
new /obj/structure/lattice(get_turf(src))
|
|
||||||
return
|
return
|
||||||
|
|
||||||
else if(istype(W, /obj/item/stack/tile/floor))
|
else if(istype(W, /obj/item/stack/tile/floor))
|
||||||
@@ -500,55 +500,9 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
else
|
else
|
||||||
..(W,user)
|
mineral_name = pickweight(list("Uranium" = 5, "Platinum" = 5, "Iron" = 35, "Coal" = 35, "Diamond" = 1, "Gold" = 5, "Silver" = 5, "Phoron" = 10))
|
||||||
return
|
mineral_name = lowertext(mineral_name)
|
||||||
|
if(mineral_name && (mineral_name in ore_data))
|
||||||
/turf/simulated/floor/asteroid/proc/gets_dug()
|
mineral = ore_data[mineral_name]
|
||||||
|
UpdateMineral()
|
||||||
if(dug)
|
update_icon()
|
||||||
return
|
|
||||||
|
|
||||||
for(var/i=0;i<(rand(3)+2);i++)
|
|
||||||
new/obj/item/weapon/ore/glass(src)
|
|
||||||
|
|
||||||
dug = 1
|
|
||||||
icon_state = "asteroid_dug"
|
|
||||||
return
|
|
||||||
|
|
||||||
/turf/simulated/floor/asteroid/proc/updateMineralOverlays(var/update_neighbors)
|
|
||||||
|
|
||||||
overlays.Cut()
|
|
||||||
|
|
||||||
var/list/step_overlays = list("n" = NORTH, "s" = SOUTH, "e" = EAST, "w" = WEST)
|
|
||||||
for(var/direction in step_overlays)
|
|
||||||
|
|
||||||
if(istype(get_step(src, step_overlays[direction]), /turf/space))
|
|
||||||
overlays += image('icons/turf/floors.dmi', "asteroid_edge_[direction]")
|
|
||||||
|
|
||||||
if(istype(get_step(src, step_overlays[direction]), /turf/simulated/mineral))
|
|
||||||
overlays += image('icons/turf/walls.dmi', "rock_side_[direction]")
|
|
||||||
|
|
||||||
//todo cache
|
|
||||||
if(overlay_detail) overlays |= image(icon = 'icons/turf/flooring/decals.dmi', icon_state = overlay_detail)
|
|
||||||
|
|
||||||
if(update_neighbors)
|
|
||||||
var/list/all_step_directions = list(NORTH,NORTHEAST,EAST,SOUTHEAST,SOUTH,SOUTHWEST,WEST,NORTHWEST)
|
|
||||||
for(var/direction in all_step_directions)
|
|
||||||
var/turf/simulated/floor/asteroid/A
|
|
||||||
if(istype(get_step(src, direction), /turf/simulated/floor/asteroid))
|
|
||||||
A = get_step(src, direction)
|
|
||||||
A.updateMineralOverlays()
|
|
||||||
|
|
||||||
/turf/simulated/floor/asteroid/Entered(atom/movable/M as mob|obj)
|
|
||||||
..()
|
|
||||||
if(istype(M,/mob/living/silicon/robot))
|
|
||||||
var/mob/living/silicon/robot/R = M
|
|
||||||
if(R.module)
|
|
||||||
if(istype(R.module_state_1,/obj/item/weapon/storage/bag/ore))
|
|
||||||
attackby(R.module_state_1,R)
|
|
||||||
else if(istype(R.module_state_2,/obj/item/weapon/storage/bag/ore))
|
|
||||||
attackby(R.module_state_2,R)
|
|
||||||
else if(istype(R.module_state_3,/obj/item/weapon/storage/bag/ore))
|
|
||||||
attackby(R.module_state_3,R)
|
|
||||||
else
|
|
||||||
return
|
|
||||||
|
|||||||
@@ -1,23 +1,10 @@
|
|||||||
/datum/random_map/automata/cave_system
|
/datum/random_map/automata/cave_system
|
||||||
iterations = 5
|
iterations = 5
|
||||||
descriptor = "moon caves"
|
descriptor = "moon caves"
|
||||||
wall_type = /turf/simulated/mineral
|
|
||||||
floor_type = /turf/simulated/floor/asteroid
|
|
||||||
target_turf_type = /turf/unsimulated/mask
|
|
||||||
var/mineral_sparse = /turf/simulated/mineral/random
|
|
||||||
var/mineral_rich = /turf/simulated/mineral/random/high_chance
|
|
||||||
var/list/ore_turfs = list()
|
var/list/ore_turfs = list()
|
||||||
|
|
||||||
/datum/random_map/automata/cave_system/get_appropriate_path(var/value)
|
/datum/random_map/automata/cave_system/get_appropriate_path(var/value)
|
||||||
switch(value)
|
return
|
||||||
if(DOOR_CHAR)
|
|
||||||
return mineral_sparse
|
|
||||||
if(EMPTY_CHAR)
|
|
||||||
return mineral_rich
|
|
||||||
if(FLOOR_CHAR)
|
|
||||||
return floor_type
|
|
||||||
if(WALL_CHAR)
|
|
||||||
return wall_type
|
|
||||||
|
|
||||||
/datum/random_map/automata/cave_system/get_map_char(var/value)
|
/datum/random_map/automata/cave_system/get_map_char(var/value)
|
||||||
switch(value)
|
switch(value)
|
||||||
@@ -50,3 +37,20 @@
|
|||||||
map[check_cell] = EMPTY_CHAR // Rare mineral block.
|
map[check_cell] = EMPTY_CHAR // Rare mineral block.
|
||||||
ore_count--
|
ore_count--
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
/datum/random_map/automata/cave_system/apply_to_turf(var/x,var/y)
|
||||||
|
var/current_cell = get_map_cell(x,y)
|
||||||
|
if(!current_cell)
|
||||||
|
return 0
|
||||||
|
var/turf/simulated/mineral/T = locate((origin_x-1)+x,(origin_y-1)+y,origin_z)
|
||||||
|
if(istype(T) && !T.ignore_mapgen)
|
||||||
|
if(map[current_cell] == FLOOR_CHAR)
|
||||||
|
T.make_floor()
|
||||||
|
else
|
||||||
|
T.make_wall()
|
||||||
|
if(map[current_cell] == DOOR_CHAR)
|
||||||
|
T.make_ore()
|
||||||
|
else if(map[current_cell] == EMPTY_CHAR)
|
||||||
|
T.make_ore(1)
|
||||||
|
get_additional_spawns(map[current_cell],T,get_spawn_dir(x, y))
|
||||||
|
return T
|
||||||
@@ -91,9 +91,7 @@ var/global/datum/global_init/init = new ()
|
|||||||
// Update all turfs to ensure everything looks good post-generation. Yes,
|
// Update all turfs to ensure everything looks good post-generation. Yes,
|
||||||
// it's brute-forcey, but frankly the alternative is a mine turf rewrite.
|
// it's brute-forcey, but frankly the alternative is a mine turf rewrite.
|
||||||
for(var/turf/simulated/mineral/M in world) // Ugh.
|
for(var/turf/simulated/mineral/M in world) // Ugh.
|
||||||
M.updateMineralOverlays()
|
M.update_icon()
|
||||||
for(var/turf/simulated/floor/asteroid/M in world) // Uuuuuugh.
|
|
||||||
M.updateMineralOverlays()
|
|
||||||
|
|
||||||
// Create autolathe recipes, as above.
|
// Create autolathe recipes, as above.
|
||||||
populate_lathe_recipes()
|
populate_lathe_recipes()
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.8 KiB |
@@ -1659,7 +1659,6 @@
|
|||||||
#include "code\modules\random_map\mazes\maze.dm"
|
#include "code\modules\random_map\mazes\maze.dm"
|
||||||
#include "code\modules\random_map\mazes\maze_cell.dm"
|
#include "code\modules\random_map\mazes\maze_cell.dm"
|
||||||
#include "code\modules\random_map\noise\desert.dm"
|
#include "code\modules\random_map\noise\desert.dm"
|
||||||
#include "code\modules\random_map\noise\magma.dm"
|
|
||||||
#include "code\modules\random_map\noise\noise.dm"
|
#include "code\modules\random_map\noise\noise.dm"
|
||||||
#include "code\modules\random_map\noise\ore.dm"
|
#include "code\modules\random_map\noise\ore.dm"
|
||||||
#include "code\modules\random_map\noise\tundra.dm"
|
#include "code\modules\random_map\noise\tundra.dm"
|
||||||
|
|||||||
Reference in New Issue
Block a user