- The return of random mineral spawning
- Basic code for random mine generation: not yet implemented on the map
- removed the fluorescent lights at the entrance and replaced them with a light emitter (invisible object) to simulate the effect of transitioning into a dark mine. (need someone to test if right-clicking the plot gets the light emitter object in the context menu)

Map changes:
- Replaced some floor tiles with airless tiles on the abandoned, russian station.
- Slight changes to engineering intended to make room for expansion
- This was in the last update, but didn't point it out specifically: opened a new construction site just below the mining dock. I intend to build it up through the course of several updates into the mining processing and storage areas as the dock currently does not have enough space in it.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@858 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
baloh.matevz
2011-01-15 22:21:54 +00:00
parent 101fb71645
commit 44bf658fb8
2 changed files with 4459 additions and 4081 deletions
+397 -24
View File
@@ -1,3 +1,189 @@
/**********************Light************************/
//this item is intended to give the effect of entering the mine, so that light gradually fades
/obj/light_emitter
name = "Light-emtter"
anchored = 1
unacidable = 1
luminosity = 8
/**********************Random mine generator************************/
//this item is intended to give the effect of entering the mine, so that light gradually fades
/obj/mine_generator
name = "Random mine generator"
anchored = 1
unacidable = 1
var/turf/last_loc
var/turf/target_loc
var/turf/start_loc
var/randXParam //the value of these two parameters are generated by the code itself and used to
var/randYParam //determine the random XY parameters
var/mineDirection = 3
/*
0 = none
1 = N
2 = NNW
3 = NW
4 = WNW
5 = W
6 = WSW
7 = SW
8 = SSW
9 = S
10 = SSE
11 = SE
12 = ESE
13 = E
14 = ENE
15 = NE
16 = NNE
*/
/obj/mine_generator/New()
last_loc = src.loc
var/i
for(i = 0; i < 50; i++)
gererateTargetLoc()
//target_loc = locate(last_loc.x + rand(5), last_loc.y + rand(5), src.z)
fillWithAsteroids()
del(src)
return
/obj/mine_generator/proc/gererateTargetLoc() //this proc determines where the next square-room will end.
switch(mineDirection)
if(1)
randXParam = 0
randYParam = 4
if(2)
randXParam = 1
randYParam = 3
if(3)
randXParam = 2
randYParam = 2
if(4)
randXParam = 3
randYParam = 1
if(5)
randXParam = 4
randYParam = 0
if(6)
randXParam = 3
randYParam = -1
if(7)
randXParam = 2
randYParam = -2
if(8)
randXParam = 1
randYParam = -3
if(9)
randXParam = 0
randYParam = -4
if(10)
randXParam = -1
randYParam = -3
if(11)
randXParam = -2
randYParam = -2
if(12)
randXParam = -3
randYParam = -1
if(13)
randXParam = -4
randYParam = 0
if(14)
randXParam = -3
randYParam = 1
if(15)
randXParam = -2
randYParam = 2
if(16)
randXParam = -1
randYParam = 3
target_loc = last_loc
if (randXParam > 0)
target_loc = locate(target_loc.x+rand(randXParam),target_loc.y,src.z)
if (randYParam > 0)
target_loc = locate(target_loc.x,target_loc.y+rand(randYParam),src.z)
if (randXParam < 0)
target_loc = locate(target_loc.x-rand(-randXParam),target_loc.y,src.z)
if (randYParam < 0)
target_loc = locate(target_loc.x,target_loc.y-rand(-randXParam),src.z)
if (mineDirection == 1 || mineDirection == 5 || mineDirection == 9 || mineDirection == 13) //if N,S,E,W, turn quickly
if(prob(50))
mineDirection += 2
else
mineDirection -= 2
if(mineDirection < 1)
mineDirection += 16
else
if(prob(50))
if(prob(50))
mineDirection += 1
else
mineDirection -= 1
if(mineDirection < 1)
mineDirection += 16
return
/obj/mine_generator/proc/fillWithAsteroids()
if(last_loc)
start_loc = last_loc
if(start_loc && target_loc)
var/x1
var/y1
var/turf/line_start = start_loc
var/turf/column = line_start
if(start_loc.x <= target_loc.x)
if(start_loc.y <= target_loc.y) //GOING NORTH-EAST
for(y1 = start_loc.y; y1 <= target_loc.y; y1++)
for(x1 = start_loc.x; x1 <= target_loc.x; x1++)
new/turf/simulated/floor/airless/asteroid(column)
column = get_step(column,EAST)
line_start = get_step(line_start,NORTH)
column = line_start
last_loc = target_loc
return
else //GOING NORTH-WEST
for(y1 = start_loc.y; y1 >= target_loc.y; y1--)
for(x1 = start_loc.x; x1 <= target_loc.x; x1++)
new/turf/simulated/floor/airless/asteroid(column)
column = get_step(column,WEST)
line_start = get_step(line_start,NORTH)
column = line_start
last_loc = target_loc
return
else
if(start_loc.y <= target_loc.y) //GOING SOUTH-EAST
for(y1 = start_loc.y; y1 <= target_loc.y; y1++)
for(x1 = start_loc.x; x1 >= target_loc.x; x1--)
new/turf/simulated/floor/airless/asteroid(column)
column = get_step(column,EAST)
line_start = get_step(line_start,SOUTH)
column = line_start
last_loc = target_loc
return
else //GOING SOUTH-WEST
for(y1 = start_loc.y; y1 >= target_loc.y; y1--)
for(x1 = start_loc.x; x1 >= target_loc.x; x1--)
new/turf/simulated/floor/airless/asteroid(column)
column = get_step(column,WEST)
line_start = get_step(line_start,SOUTH)
column = line_start
last_loc = target_loc
return
return
/**********************Mine areas**************************/
/area/mine/explored
@@ -12,65 +198,154 @@
/area/mine/lobby
name = "Mining station"
requires_power = 0
luminosity = 1
icon_state = "mine"
sd_lighting = 0
/**********************Mineral deposits**************************/
/turf/simulated/mineral //wall piece
name = "Mineral deposit"
name = "Rock"
icon = 'walls.dmi'
icon_state = "rock"
oxygen = 0
nitrogen = 0
opacity = 1
density = 1
blocks_air = 1
temperature = TCMB
var/mineralName = ""
var/mineralAmt = 0
var/spread = 0 //will the seam spread?
var/spreadChance = 0 //the percentual chance of an ore spreading to the neighbouring tiles
/turf/simulated/mineral/urenium
/turf/simulated/mineral/Del()
return
/turf/simulated/mineral/ex_act(severity)
switch(severity)
if(3.0)
return
if(2.0)
if (prob(70))
src.mineralAmt -= 1 //some of the stuff gets blown up
src.gets_drilled()
if(1.0)
src.mineralAmt -= 2 //some of the stuff gets blown up
src.gets_drilled()
return
/turf/simulated/mineral/New()
if (mineralName && mineralAmt && spread && spreadChance)
if(prob(spreadChance))
if(istype(get_step(src, SOUTH), /turf/simulated/mineral/random))
new src.type(get_step(src, SOUTH))
if(prob(spreadChance))
if(istype(get_step(src, NORTH), /turf/simulated/mineral/random))
new src.type(get_step(src, NORTH))
if(prob(spreadChance))
if(istype(get_step(src, WEST), /turf/simulated/mineral/random))
new src.type(get_step(src, WEST))
if(prob(spreadChance))
if(istype(get_step(src, EAST), /turf/simulated/mineral/random))
new src.type(get_step(src, EAST))
return
/turf/simulated/mineral/random
name = "Mineral deposit"
var/mineralAmtList = list("Uranium" = 5, "Iron" = 5, "Diamond" = 5, "Gold" = 5, "Silver" = 5, "Plasma" = 5)
var/mineralSpawnChanceList = list("Uranium" = 5, "Iron" = 50, "Diamond" = 1, "Gold" = 5, "Silver" = 5, "Plasma" = 25)
var/mineralChance = 10 //means 10% chance of this plot changing to a mineral deposit
/turf/simulated/mineral/random/New()
if (prob(mineralChance))
var/mName = pickweight(mineralSpawnChanceList) //temp mineral name
//spawn(5)
if (mName)
var/turf/simulated/mineral/M
switch(mName)
if("Uranium")
M = new/turf/simulated/mineral/uranium(src)
if("Iron")
M = new/turf/simulated/mineral/iron(src)
if("Diamond")
M = new/turf/simulated/mineral/diamond(src)
if("Gold")
M = new/turf/simulated/mineral/gold(src)
if("Silver")
M = new/turf/simulated/mineral/silver(src)
if("Plasma")
M = new/turf/simulated/mineral/plasma(src)
if(M)
src = M
M.levelupdate()
return
/turf/simulated/mineral/random/Del()
return
/turf/simulated/mineral/uranium
name = "Uranium deposit"
icon_state = "rock_Uranium"
mineralName = "Uranium"
mineralAmt = 5
spreadChance = 10
spread = 1
/turf/simulated/mineral/iron
name = "Iron deposit"
icon_state = "rock_Iron"
mineralName = "Iron"
mineralAmt = 5
spreadChance = 25
spread = 1
/turf/simulated/mineral/diamond
name = "Diamond deposit"
icon_state = "rock_Diamond"
mineralName = "Diamond"
mineralAmt = 5
spreadChance = 10
spread = 1
/turf/simulated/mineral/gold
name = "Gold deposit"
icon_state = "rock_Gold"
mineralName = "Gold"
mineralAmt = 5
spreadChance = 10
spread = 1
/turf/simulated/mineral/silver
name = "Silver deposit"
icon_state = "rock_Silver"
mineralName = "Silver"
mineralAmt = 5
spreadChance = 10
spread = 1
/turf/simulated/mineral/plasma
name = "Plasma deposit"
icon_state = "rock_Plasma"
mineralName = "Plasma"
mineralAmt = 5
spreadChance = 25
spread = 1
/turf/simulated/mineral/clown
name = "Bananium deposit"
icon_state = "rock_Clown"
mineralName = "Clown"
mineralAmt = 2
mineralAmt = 3
spreadChance = 0
spread = 0
/turf/simulated/mineral/ReplaceWithFloor()
if(!icon_old) icon_old = icon_state
@@ -135,6 +410,19 @@
ReplaceWithFloor()
return
/*
/turf/simulated/mineral/proc/setRandomMinerals()
var/s = pickweight(list("uranium" = 5, "iron" = 50, "gold" = 5, "silver" = 5, "plasma" = 50, "diamond" = 1))
if (s)
mineralName = s
var/N = text2path("/turf/simulated/mineral/[s]")
if (N)
var/turf/simulated/mineral/M = new N
src = M
if (src.mineralName)
mineralAmt = 5
return*/
/**********************Asteroid**************************/
@@ -143,6 +431,9 @@
name = "Asteroid"
icon = 'floors.dmi'
icon_state = "asteroid"
oxygen = 0
nitrogen = 0
temperature = TCMB
var/seedName = "" //Name of the seed it contains
var/seedAmt = 0 //Ammount of the seed it contains
var/dug = 0 //0 = has not yet been dug, 1 = has already been dug
@@ -155,6 +446,9 @@
spawn(2)
updateMineralOverlays()
/turf/simulated/floor/airless/asteroid/ex_act(severity)
return
/turf/simulated/floor/airless/asteroid/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
usr << "\red You don't have the dexterity to do this!"
@@ -1103,6 +1397,11 @@
var/obj/machinery/mineral/output = null
var/amt_silver = 0 //amount of silver
var/amt_gold = 0 //amount of gold
var/amt_diamond = 0
var/amt_iron = 0
var/amt_plasma = 0
var/amt_uranium = 0
var/amt_clown = 0
var/newCoins = 0 //how many coins the machine made in it's last load
var/processing = 0
@@ -1116,16 +1415,33 @@
return
return
/obj/machinery/mineral/mint/process()
if (src.output && src.input)
var/obj/item/stack/sheet/O
O = locate(/obj/item/stack/sheet, input.loc)
if (istype(O,/obj/item/stack/sheet/gold))
amt_gold += 100
del(O)
if (istype(O,/obj/item/stack/sheet/silver))
amt_silver += 100
del(O)
if(O)
if (istype(O,/obj/item/stack/sheet/gold))
amt_gold += 100
del(O)
if (istype(O,/obj/item/stack/sheet/silver))
amt_silver += 100
del(O)
if (istype(O,/obj/item/stack/sheet/diamond))
amt_diamond += 100
del(O)
if (istype(O,/obj/item/stack/sheet/plasma))
amt_plasma += 100
del(O)
if (istype(O,/obj/item/weapon/ore/uranium))
amt_uranium += 100
del(O)
if (istype(O,/obj/item/stack/sheet/metal))
amt_iron += 100
del(O)
if (istype(O,/obj/item/stack/sheet/clown))
amt_clown += 100
del(O)
/obj/machinery/mineral/mint/attack_hand(user as mob)
@@ -1144,6 +1460,11 @@
dat += text("<br><br><font color='#ffcc00'><b>Gold inserterd: </b>[amt_gold]</font>")
dat += text("<br><br><font color='#888888'><b>Silver inserterd: </b>[amt_silver]</font>")
dat += text("<br><br><font color='#555555'><b>Iron inserterd: </b>[amt_iron]</font>")
dat += text("<br><br><font color='#8888FF'><b>Diamond inserterd: </b>[amt_diamond]</font>")
dat += text("<br><br><font color='#FF8800'><b>Plasma inserterd: </b>[amt_plasma]</font>")
dat += text("<br><br><font color='#008800'><b>Uranium inserterd: </b>[amt_uranium]</font>")
dat += text("<br><br><font color='#AAAA00'><b>Bananium inserterd: </b>[amt_clown]</font>")
dat += text("<br><br><A href='?src=\ref[src];makeCoins=[1]'>Make coins</A>")
dat += text("<br><br>found: <font color='green'><b>[newCoins]</b></font>")
@@ -1171,6 +1492,37 @@
newCoins++
src.updateUsrDialog()
sleep(5);
while(amt_diamond > 0)
new /obj/item/weapon/coin/diamond(output.loc)
amt_diamond -= 20
newCoins++
src.updateUsrDialog()
sleep(5);
while(amt_iron > 0)
new /obj/item/weapon/coin/iron(output.loc)
amt_iron -= 20
newCoins++
src.updateUsrDialog()
sleep(5);
while(amt_plasma > 0)
new /obj/item/weapon/coin/plasma(output.loc)
amt_plasma -= 20
newCoins++
src.updateUsrDialog()
sleep(5);
while(amt_uranium > 0)
new /obj/item/weapon/coin/uranium(output.loc)
amt_uranium -= 20
newCoins++
src.updateUsrDialog()
sleep(5);
while(amt_clown > 0)
new /obj/item/weapon/coin/clown(output.loc)
amt_clown -= 20
newCoins++
src.updateUsrDialog()
sleep(5);
processing = 0;
src.updateUsrDialog()
return
@@ -1200,6 +1552,26 @@
name = "Silver coin"
icon_state = "coin_silver"
/obj/item/weapon/coin/diamond
name = "Diamond coin"
icon_state = "coin_diamond"
/obj/item/weapon/coin/iron
name = "Iron coin"
icon_state = "coin_iron"
/obj/item/weapon/coin/plasma
name = "Solid plasma coin"
icon_state = "coin_plasma"
/obj/item/weapon/coin/uranium
name = "Uranium coin"
icon_state = "coin_uranium"
/obj/item/weapon/coin/clown
name = "Bananaium coin"
icon_state = "coin_clown"
/**********************Gas extractor**************************/
@@ -1307,10 +1679,10 @@
icon = 'items.dmi'
icon_state = "pickaxe"
flags = FPRINT | TABLEPASS| CONDUCT | ONBELT
force = 5.0
throwforce = 7.0
force = 15.0
throwforce = 4.0
item_state = "wrench"
w_class = 2.0
w_class = 4.0
m_amt = 50
/*****************************Shovel********************************/
@@ -1320,10 +1692,10 @@
icon = 'items.dmi'
icon_state = "shovel"
flags = FPRINT | TABLEPASS| CONDUCT | ONBELT
force = 5.0
throwforce = 7.0
force = 8.0
throwforce = 4.0
item_state = "wrench"
w_class = 2.0
w_class = 4.0
m_amt = 50
@@ -1404,6 +1776,7 @@
icon_state = "rail"
dir = 2
var/id = null //this is needed for switches to work Set to the same on the whole length of the track
anchored = 1
/**********************Rail intersection**************************/
@@ -1899,12 +2272,12 @@ for (var/client/C)
dat += text("<br><br><br><A href='?src=\ref[src];scrap=1'>Scrap current shuttle</A>")
else
dat += text("<b>Available ships to build:</b><br><br>")
dat += text("<A href='?src=\ref[src];ship=hopper'>Planet hopper</A> - Tiny, Slow<br>")
dat += text("<A href='?src=\ref[src];ship=bus'>Blunder Bus</A> - Small, Decent speed<br>")
dat += text("<A href='?src=\ref[src];ship=dinghy'>Space dinghy</A> - Medium size, Decent speed<br>")
dat += text("<A href='?src=\ref[src];ship=van'>Boxvan MMDLVIr</A> - Medium size, Decent speed<br>")
dat += text("<A href='?src=\ref[src];ship=secvan'>Boxvan MMDLVI - Security eidition</A> - Large, Rather slow<br>")
dat += text("<A href='?src=\ref[src];ship=station4'>Space station 4</A> - Huge, Slow<br>")
dat += text("<A href='?src=\ref[src];ship=hopper'>Planet hopper</A> - Tiny, Slow, 25000 metal<br>")
dat += text("<A href='?src=\ref[src];ship=bus'>Blunder Bus</A> - Small, Decent speed, 60000 metal<br>")
dat += text("<A href='?src=\ref[src];ship=dinghy'>Space dinghy</A> - Medium size, Decent speed, 100000 metal<br>")
dat += text("<A href='?src=\ref[src];ship=van'>Boxvan MMDLVIr</A> - Medium size, Decent speed, 120000 metal<br>")
dat += text("<A href='?src=\ref[src];ship=secvan'>Boxvan MMDLVI - Security eidition</A> - Large, Rather slow, 125000 metal<br>")
dat += text("<A href='?src=\ref[src];ship=station4'>Space station 4</A> - Huge, Slow, 250000 metal<br>")
user << browse("[dat]", "window=shipbuilder")