Fixed the overlay issue for now. This will need replacing.

This commit is contained in:
Zuhayr
2014-08-13 12:04:51 +09:30
parent 54ec5f0233
commit 649af28c77
3 changed files with 29 additions and 30 deletions

View File

@@ -113,6 +113,11 @@ datum/controller/game_controller/proc/setup_objects()
asteroid_ore_map = new /datum/ore_distribution() asteroid_ore_map = new /datum/ore_distribution()
asteroid_ore_map.populate_distribution_map() asteroid_ore_map.populate_distribution_map()
//Shitty hack to fix mining turf overlays, for some reason New() is not being called.
for(var/turf/simulated/floor/plating/airless/asteroid/T in world)
T.updateMineralOverlays()
T.name = "asteroid"
//Set up spawn points. //Set up spawn points.
populate_spawn_points() populate_spawn_points()
@@ -301,7 +306,7 @@ datum/controller/game_controller/proc/process_machines_power()
//check if the area has power for M's channel //check if the area has power for M's channel
//this will keep stat updated in case the machine is moved from one area to another. //this will keep stat updated in case the machine is moved from one area to another.
M.power_change(A) //we've already made sure A is a master area, above. M.power_change(A) //we've already made sure A is a master area, above.
if(!(M.stat & NOPOWER) && M.use_power) if(!(M.stat & NOPOWER) && M.use_power)
M.auto_use_power() M.auto_use_power()

View File

@@ -162,11 +162,6 @@ Deep minerals:
target_turf = locate(tx+j, ty+i, asteroid_z) target_turf = locate(tx+j, ty+i, asteroid_z)
//Very shitty fix for the asteroid turf overlays being screwy.
if(target_turf && istype(target_turf,/turf/simulated/floor/plating/airless/asteroid))
var/turf/simulated/floor/plating/airless/asteroid/T = target_turf
T.updateMineralOverlays()
if(target_turf && target_turf.has_resources) if(target_turf && target_turf.has_resources)
target_turf.resources = list() target_turf.resources = list()
target_turf.resources["silicates"] = rand(3,5) target_turf.resources["silicates"] = rand(3,5)

View File

@@ -27,9 +27,23 @@
has_resources = 1 has_resources = 1
/turf/simulated/mineral/New() /turf/simulated/mineral/New()
. = ..() . = ..()
MineralSpread() MineralSpread()
spawn(2)
var/list/step_overlays = list("s" = NORTH, "n" = SOUTH, "w" = EAST, "e" = WEST)
for(var/direction in step_overlays)
var/turf/turf_to_check = get_step(src,step_overlays[direction])
if(istype(turf_to_check,/turf/simulated/floor/plating/airless/asteroid))
var/turf/simulated/floor/plating/airless/asteroid/T = turf_to_check
T.updateMineralOverlays()
else if(istype(turf_to_check,/turf/space) || istype(turf_to_check,/turf/simulated/floor))
turf_to_check.overlays += image('icons/turf/walls.dmi', "rock_side_[direction]")
/turf/simulated/mineral/ex_act(severity) /turf/simulated/mineral/ex_act(severity)
switch(severity) switch(severity)
if(2.0) if(2.0)
@@ -122,7 +136,7 @@
var/datum/find/F = finds[1] var/datum/find/F = finds[1]
if(excavation_level + P.excavation_amount > F.excavation_required) if(excavation_level + P.excavation_amount > F.excavation_required)
//Chance to destroy / extract any finds here //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>" 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 : ""]." user << "\red You start [P.drill_verb][fail_message ? fail_message : ""]."
@@ -199,13 +213,6 @@
excav_overlay = "overlay_excv[excav_quadrant]_[rand(1,3)]" excav_overlay = "overlay_excv[excav_quadrant]_[rand(1,3)]"
overlays += excav_overlay overlays += excav_overlay
/* Nope.
//extract pesky minerals while we're excavating
while(excavation_minerals.len && excavation_level > excavation_minerals[excavation_minerals.len])
DropMineral()
pop(excavation_minerals)
mineralAmt-- */
//drop some rocks //drop some rocks
next_rock += P.excavation_amount * 10 next_rock += P.excavation_amount * 10
while(next_rock > 100) while(next_rock > 100)
@@ -254,6 +261,7 @@
M.apply_effect(25, IRRADIATE) M.apply_effect(25, IRRADIATE)
var/turf/simulated/floor/plating/airless/asteroid/N = ChangeTurf(/turf/simulated/floor/plating/airless/asteroid) var/turf/simulated/floor/plating/airless/asteroid/N = ChangeTurf(/turf/simulated/floor/plating/airless/asteroid)
for(var/i=0;i<rand(5);i++) N.overlay_detail = "asteroid[rand(0,9)]" //Add some rubble, you did just clear out a big chunk of rock.
N.updateMineralOverlays(1) N.updateMineralOverlays(1)
if(rand(1,500) == 1) if(rand(1,500) == 1)
@@ -346,7 +354,6 @@
. = ..() . = ..()
/turf/simulated/mineral/random/high_chance /turf/simulated/mineral/random/high_chance
mineralChance = 25 mineralChance = 25
mineralSpawnChanceList = list("Uranium" = 10, "Platinum" = 10, "Iron" = 20, "Coal" = 20, "Diamond" = 2, "Gold" = 10, "Silver" = 10, "Phoron" = 20) mineralSpawnChanceList = list("Uranium" = 10, "Platinum" = 10, "Iron" = 20, "Coal" = 20, "Diamond" = 2, "Gold" = 10, "Silver" = 10, "Phoron" = 20)
@@ -369,15 +376,11 @@
/turf/simulated/floor/plating/airless/asteroid/New() /turf/simulated/floor/plating/airless/asteroid/New()
var/proper_name = name . = ..()
name = proper_name
if(prob(20)) if(prob(20))
overlay_detail = "asteroid[rand(0,9)]" overlay_detail = "asteroid[rand(0,9)]"
updateMineralOverlays()
..()
/turf/simulated/floor/plating/airless/asteroid/ex_act(severity) /turf/simulated/floor/plating/airless/asteroid/ex_act(severity)
switch(severity) switch(severity)
if(3.0) if(3.0)
@@ -456,19 +459,16 @@
/turf/simulated/floor/plating/airless/asteroid/proc/updateMineralOverlays(var/update_neighbors) /turf/simulated/floor/plating/airless/asteroid/proc/updateMineralOverlays(var/update_neighbors)
world << "updateMineralOverlays called with [update_neighbors]." spawn(2)
spawn(1)
world << "spawn called"
overlays.Cut() overlays.Cut()
var/list/step_overlays = list(NORTH = "s", SOUTH = "n", EAST = "w", WEST = "e") 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)
if(istype(get_step(src, direction), /turf/space)) if(istype(get_step(src, step_overlays[direction]), /turf/space))
overlays += image('icons/turf/floors.dmi', "asteroid_edge_[step_overlays[direction]]") overlays += image('icons/turf/floors.dmi', "asteroid_edge_[direction]")
if(istype(get_step(src, direction), /turf/simulated/mineral)) if(istype(get_step(src, step_overlays[direction]), /turf/simulated/mineral))
overlays += image('icons/turf/walls.dmi', "rock_side_[step_overlays[direction]]") overlays += image('icons/turf/walls.dmi', "rock_side_[direction]")
if(overlay_detail) overlays += overlay_detail if(overlay_detail) overlays += overlay_detail
@@ -481,7 +481,6 @@
A = get_step(src, direction) A = get_step(src, direction)
A.updateMineralOverlays() A.updateMineralOverlays()
/turf/simulated/floor/plating/airless/asteroid/Entered(atom/movable/M as mob|obj) /turf/simulated/floor/plating/airless/asteroid/Entered(atom/movable/M as mob|obj)
..() ..()
if(istype(M,/mob/living/silicon/robot)) if(istype(M,/mob/living/silicon/robot))