- Fixes Issue 910

- Changed mineral walls, they have their own type by mineral instead of a variable
- Now you can spawn the different mineral walls with the game panel
- Fixed the examining in walls, they will now show the text on the 'desc' var

 There are still some stuff out there with mineral walls, ugly chunks of code that does the same thing, two vars that have the same value and stuff like that. All of that will be purged, but, as always, to be continued~

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5061 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
aranclanos@hotmail.com
2012-11-14 13:29:30 +00:00
parent b86d90c6c2
commit 440c782a94
8 changed files with 131 additions and 145 deletions

View File

@@ -296,11 +296,10 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
spawn (0) target_tile.hotspot_expose(temperature, 400) spawn (0) target_tile.hotspot_expose(temperature, 400)
for(var/obj/structure/falsewall/plasma/F in range(3,src))//Hackish as fuck, but until temperature_expose works, there is nothing I can do -Sieve for(var/obj/structure/falsewall/plasma/F in range(3,src))//Hackish as fuck, but until temperature_expose works, there is nothing I can do -Sieve
var/turf/T = get_turf(F) var/turf/T = get_turf(F)
T.ReplaceWithMineralWall("plasma") T.ChangeTurf(/turf/simulated/wall/mineral/plasma/)
del (F) del (F)
for(var/turf/simulated/wall/mineral/W in range(3,src)) for(var/turf/simulated/wall/mineral/plasma/W in range(3,src))
if(mineral == "plasma") W.ignite((temperature/4))//Added so that you can't set off a massive chain reaction with a small flame
W.ignite((temperature/4))//Added so that you can't set off a massive chain reaction with a small flame
for(var/obj/machinery/door/airlock/plasma/D in range(3,src)) for(var/obj/machinery/door/airlock/plasma/D in range(3,src))
D.ignite(temperature/4) D.ignite(temperature/4)
new/obj/structure/door_assembly/door_assembly_0( src.loc ) new/obj/structure/door_assembly/door_assembly_0( src.loc )

View File

@@ -146,7 +146,7 @@
if(!mineral || mineral == "metal") if(!mineral || mineral == "metal")
T.ChangeTurf(/turf/simulated/wall) T.ChangeTurf(/turf/simulated/wall)
else else
T.ReplaceWithMineralWall(mineral) T.ChangeTurf(text2path("/turf/simulated/wall/mineral/[mineral]"))
del(src) del(src)
if( istype(W, /obj/item/weapon/weldingtool) ) if( istype(W, /obj/item/weapon/weldingtool) )
@@ -156,7 +156,7 @@
if(!mineral) if(!mineral)
T.ChangeTurf(/turf/simulated/wall) T.ChangeTurf(/turf/simulated/wall)
else else
T.ReplaceWithMineralWall(mineral) T.ChangeTurf(text2path("/turf/simulated/wall/mineral/[mineral]"))
if(mineral != "plasma")//Stupid shit keeps me from pushing the attackby() to plasma walls -Sieve if(mineral != "plasma")//Stupid shit keeps me from pushing the attackby() to plasma walls -Sieve
T = get_turf(src) T = get_turf(src)
T.attackby(W,user) T.attackby(W,user)
@@ -169,7 +169,7 @@
if(!mineral) if(!mineral)
T.ChangeTurf(/turf/simulated/wall) T.ChangeTurf(/turf/simulated/wall)
else else
T.ReplaceWithMineralWall(mineral) T.ChangeTurf(text2path("/turf/simulated/wall/mineral/[mineral]"))
if(mineral != "plasma") if(mineral != "plasma")
T = get_turf(src) T = get_turf(src)
T.attackby(W,user) T.attackby(W,user)
@@ -181,7 +181,7 @@
if(!mineral) if(!mineral)
T.ChangeTurf(/turf/simulated/wall) T.ChangeTurf(/turf/simulated/wall)
else else
T.ReplaceWithMineralWall(mineral) T.ChangeTurf(text2path("/turf/simulated/wall/mineral/[mineral]"))
T = get_turf(src) T = get_turf(src)
T.attackby(W,user) T.attackby(W,user)
del(src) del(src)
@@ -191,7 +191,7 @@
if(!mineral) if(!mineral)
T.ChangeTurf(/turf/simulated/wall) T.ChangeTurf(/turf/simulated/wall)
else else
T.ReplaceWithMineralWall(mineral) T.ChangeTurf(text2path("/turf/simulated/wall/mineral/[mineral]"))
if(mineral != "plasma") if(mineral != "plasma")
T = get_turf(src) T = get_turf(src)
T.attackby(W,user) T.attackby(W,user)
@@ -308,9 +308,8 @@
active = 1 active = 1
for(var/mob/living/L in range(3,src)) for(var/mob/living/L in range(3,src))
L.apply_effect(12,IRRADIATE,0) L.apply_effect(12,IRRADIATE,0)
for(var/turf/simulated/wall/mineral/T in range(3,src)) for(var/turf/simulated/wall/mineral/uranium/T in range(3,src))
if(T.mineral == "uranium") T.radiate()
T.radiate()
last_event = world.time last_event = world.time
active = null active = null
return return

View File

@@ -139,7 +139,7 @@
S.use(2) S.use(2)
user << "\blue You added the plating!" user << "\blue You added the plating!"
var/turf/Tsrc = get_turf(src) var/turf/Tsrc = get_turf(src)
Tsrc.ReplaceWithMineralWall("gold") Tsrc.ChangeTurf(/turf/simulated/wall/mineral/gold)
for(var/obj/machinery/atmospherics/pipe/P in Tsrc) for(var/obj/machinery/atmospherics/pipe/P in Tsrc)
P.layer = 1 P.layer = 1
for(var/turf/simulated/wall/mineral/X in Tsrc.loc) for(var/turf/simulated/wall/mineral/X in Tsrc.loc)
@@ -162,7 +162,7 @@
S.use(2) S.use(2)
user << "\blue You added the plating!" user << "\blue You added the plating!"
var/turf/Tsrc = get_turf(src) var/turf/Tsrc = get_turf(src)
Tsrc.ReplaceWithMineralWall("silver") Tsrc.ChangeTurf(/turf/simulated/wall/mineral/silver)
for(var/obj/machinery/atmospherics/pipe/P in Tsrc) for(var/obj/machinery/atmospherics/pipe/P in Tsrc)
P.layer = 1 P.layer = 1
for(var/turf/simulated/wall/mineral/X in Tsrc.loc) for(var/turf/simulated/wall/mineral/X in Tsrc.loc)
@@ -185,7 +185,7 @@
S.use(2) S.use(2)
user << "\blue You added the plating!" user << "\blue You added the plating!"
var/turf/Tsrc = get_turf(src) var/turf/Tsrc = get_turf(src)
Tsrc.ReplaceWithMineralWall("diamond") Tsrc.ChangeTurf(/turf/simulated/wall/mineral/diamond)
for(var/obj/machinery/atmospherics/pipe/P in Tsrc) for(var/obj/machinery/atmospherics/pipe/P in Tsrc)
P.layer = 1 P.layer = 1
for(var/turf/simulated/wall/mineral/X in Tsrc.loc) for(var/turf/simulated/wall/mineral/X in Tsrc.loc)
@@ -208,7 +208,7 @@
S.use(2) S.use(2)
user << "\blue You added the plating!" user << "\blue You added the plating!"
var/turf/Tsrc = get_turf(src) var/turf/Tsrc = get_turf(src)
Tsrc.ReplaceWithMineralWall("uranium") Tsrc.ChangeTurf(/turf/simulated/wall/mineral/uranium)
for(var/obj/machinery/atmospherics/pipe/P in Tsrc) for(var/obj/machinery/atmospherics/pipe/P in Tsrc)
P.layer = 1 P.layer = 1
for(var/turf/simulated/wall/mineral/X in Tsrc.loc) for(var/turf/simulated/wall/mineral/X in Tsrc.loc)
@@ -231,7 +231,7 @@
S.use(2) S.use(2)
user << "\blue You added the plating!" user << "\blue You added the plating!"
var/turf/Tsrc = get_turf(src) var/turf/Tsrc = get_turf(src)
Tsrc.ReplaceWithMineralWall("plasma") Tsrc.ChangeTurf(/turf/simulated/wall/mineral/plasma)
for(var/obj/machinery/atmospherics/pipe/P in Tsrc) for(var/obj/machinery/atmospherics/pipe/P in Tsrc)
P.layer = 1 P.layer = 1
for(var/turf/simulated/wall/mineral/X in Tsrc.loc) for(var/turf/simulated/wall/mineral/X in Tsrc.loc)
@@ -254,7 +254,7 @@
S.use(2) S.use(2)
user << "\blue You added the plating!" user << "\blue You added the plating!"
var/turf/Tsrc = get_turf(src) var/turf/Tsrc = get_turf(src)
Tsrc.ReplaceWithMineralWall("clown") Tsrc.ChangeTurf(/turf/simulated/wall/mineral/clown)
for(var/obj/machinery/atmospherics/pipe/P in Tsrc) for(var/obj/machinery/atmospherics/pipe/P in Tsrc)
P.layer = 1 P.layer = 1
for(var/turf/simulated/wall/mineral/X in Tsrc.loc) for(var/turf/simulated/wall/mineral/X in Tsrc.loc)
@@ -277,7 +277,7 @@
S.use(2) S.use(2)
user << "\blue You added the plating!" user << "\blue You added the plating!"
var/turf/Tsrc = get_turf(src) var/turf/Tsrc = get_turf(src)
Tsrc.ReplaceWithMineralWall("sandstone") Tsrc.ChangeTurf(/turf/simulated/wall/mineral/sandstone)
for(var/obj/machinery/atmospherics/pipe/P in Tsrc) for(var/obj/machinery/atmospherics/pipe/P in Tsrc)
P.layer = 1 P.layer = 1
for(var/turf/simulated/wall/mineral/X in Tsrc.loc) for(var/turf/simulated/wall/mineral/X in Tsrc.loc)

View File

@@ -122,7 +122,7 @@
/turf/simulated/wall/examine() /turf/simulated/wall/examine()
set src in oview(1) set src in oview(1)
usr << "It looks like a regular wall." usr << "[desc]."
return return
/turf/simulated/wall/ex_act(severity) /turf/simulated/wall/ex_act(severity)

View File

@@ -5,91 +5,93 @@
var/last_event = 0 var/last_event = 0
var/active = null var/active = null
/turf/simulated/wall/mineral/New() /turf/simulated/wall/mineral/gold
switch(mineral) name = "gold wall"
if("gold") desc = "A wall with gold plating. Swag!"
name = "gold wall" icon_state = "gold0"
desc = "A wall with gold plating. Swag!" walltype = "gold"
icon_state = "gold0" mineral = "gold"
walltype = "gold" //var/electro = 1
// var/electro = 1 //var/shocked = null
// var/shocked = null
if("silver")
name = "silver wall"
desc = "A wall with silver plating. Shiny!"
icon_state = "silver0"
walltype = "silver"
// var/electro = 0.75
// var/shocked = null
if("diamond")
name = "diamond wall"
desc = "A wall with diamond plating. You monster."
icon_state = "diamond0"
walltype = "diamond"
if("uranium")
name = "uranium wall"
desc = "A wall with uranium plating. This is probably a bad idea."
icon_state = "uranium0"
walltype = "uranium"
if("plasma")
name = "plasma wall"
desc = "A wall with plasma plating. This is definately a bad idea."
icon_state = "plasma0"
walltype = "plasma"
if("clown")
name = "bananium wall"
desc = "A wall with bananium plating. Honk!"
icon_state = "clown0"
walltype = "clown"
if("sandstone")
name = "sandstone wall"
desc = "A wall with sandstone plating."
icon_state = "sandstone0"
walltype = "sandstone"
..()
/turf/simulated/wall/mineral/proc/radiate() /turf/simulated/wall/mineral/silver
name = "silver wall"
desc = "A wall with silver plating. Shiny!"
icon_state = "silver0"
walltype = "silver"
//var/electro = 0.75
//var/shocked = null
/turf/simulated/wall/mineral/diamond
name = "diamond wall"
desc = "A wall with diamond plating. You monster."
icon_state = "diamond0"
walltype = "diamond"
mineral = "diamond"
/turf/simulated/wall/mineral/clown
name = "bananium wall"
desc = "A wall with bananium plating. Honk!"
icon_state = "clown0"
walltype = "clown"
mineral = "clown"
/turf/simulated/wall/mineral/sandstone
name = "sandstone wall"
desc = "A wall with sandstone plating."
icon_state = "sandstone0"
walltype = "sandstone"
mineral = "sandstone"
/turf/simulated/wall/mineral/uranium
name = "uranium wall"
desc = "A wall with uranium plating. This is probably a bad idea."
icon_state = "uranium0"
walltype = "uranium"
mineral = "uranium"
/turf/simulated/wall/mineral/uranium/proc/radiate()
if(!active) if(!active)
if(world.time > last_event+15) if(world.time > last_event+15)
active = 1 active = 1
for(var/mob/living/L in range(3,src)) for(var/mob/living/L in range(3,src))
L.apply_effect(12,IRRADIATE,0) L.apply_effect(12,IRRADIATE,0)
for(var/turf/simulated/wall/mineral/T in range(3,src)) for(var/turf/simulated/wall/mineral/uranium/T in range(3,src))
if(T.mineral == "uranium") T.radiate()
T.radiate()
last_event = world.time last_event = world.time
active = null active = null
return return
return return
/*/turf/simulated/wall/mineral/proc/shock() /turf/simulated/wall/mineral/uranium/attack_hand(mob/user as mob)
if (electrocute_mob(user, C, src)) radiate()
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
return 1
else
return 0
*/
/turf/simulated/wall/mineral/attack_hand(mob/user as mob)
if(mineral == "uranium")
radiate()
..() ..()
/turf/simulated/wall/mineral/attackby(obj/item/weapon/W as obj, mob/user as mob) /turf/simulated/wall/mineral/uranium/attackby(obj/item/weapon/W as obj, mob/user as mob)
if((mineral == "plasma") && W) radiate()
if(is_hot(W) > 300)//If the temperature of the object is over 300, then ignite
ignite(is_hot(W)) /turf/simulated/wall/mineral/uranium/Bumped(AM as mob|obj)
return radiate()
if(mineral == "uranium") ..()
radiate()
/turf/simulated/wall/mineral/plasma
name = "plasma wall"
desc = "A wall with plasma plating. This is definately a bad idea."
icon_state = "plasma0"
walltype = "plasma"
mineral = "plasma"
/turf/simulated/wall/mineral/plasma/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(is_hot(W) > 300)//If the temperature of the object is over 300, then ignite
ignite(is_hot(W))
return
// if((mineral == "gold") || (mineral == "silver")) // if((mineral == "gold") || (mineral == "silver"))
// if(shocked) // if(shocked)
// shock() // shock()
..() ..()
/turf/simulated/wall/mineral/proc/PlasmaBurn(temperature) /turf/simulated/wall/mineral/plasma/proc/PlasmaBurn(temperature)
spawn(2) spawn(2)
new /obj/structure/girder(src) new /obj/structure/girder(src)
src.ChangeTurf(/turf/simulated/floor) src.ChangeTurf(/turf/simulated/floor)
@@ -104,33 +106,34 @@
spawn (0) target_tile.hotspot_expose(temperature, 400) spawn (0) target_tile.hotspot_expose(temperature, 400)
for(var/obj/structure/falsewall/plasma/F in range(3,src))//Hackish as fuck, but until temperature_expose works, there is nothing I can do -Sieve for(var/obj/structure/falsewall/plasma/F in range(3,src))//Hackish as fuck, but until temperature_expose works, there is nothing I can do -Sieve
var/turf/T = get_turf(F) var/turf/T = get_turf(F)
T.ReplaceWithMineralWall("plasma") T.ChangeTurf(/turf/simulated/wall/mineral/plasma/)
del (F) del (F)
for(var/turf/simulated/wall/mineral/W in range(3,src)) for(var/turf/simulated/wall/mineral/plasma/W in range(3,src))
if(mineral == "plasma") W.ignite((temperature/4))//Added so that you can't set off a massive chain reaction with a small flame
W.ignite((temperature/4))//Added so that you can't set off a massive chain reaction with a small flame
for(var/obj/machinery/door/airlock/plasma/D in range(3,src)) for(var/obj/machinery/door/airlock/plasma/D in range(3,src))
D.ignite(temperature/4) D.ignite(temperature/4)
/turf/simulated/wall/mineral/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)//Doesn't fucking work because walls don't interact with air :( /turf/simulated/wall/mineral/plasma/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)//Doesn't fucking work because walls don't interact with air :(
if(mineral == "plasma") if(exposed_temperature > 300)
if(exposed_temperature > 300) PlasmaBurn(exposed_temperature)
PlasmaBurn(exposed_temperature)
/turf/simulated/wall/mineral/proc/ignite(exposed_temperature) /turf/simulated/wall/mineral/plasma/proc/ignite(exposed_temperature)
if(mineral == "plasma") if(exposed_temperature > 300)
if(exposed_temperature > 300) PlasmaBurn(exposed_temperature)
PlasmaBurn(exposed_temperature)
/turf/simulated/wall/mineral/Bumped(AM as mob|obj) /turf/simulated/wall/mineral/plasma/bullet_act(var/obj/item/projectile/Proj)
if(mineral == "uranium") if(istype(Proj,/obj/item/projectile/beam))
radiate() PlasmaBurn(2500)
else if(istype(Proj,/obj/item/projectile/ion))
PlasmaBurn(500)
..() ..()
/turf/simulated/wall/mineral/bullet_act(var/obj/item/projectile/Proj) /*/turf/simulated/wall/mineral/proc/shock()
if(mineral == "plasma") if (electrocute_mob(user, C, src))
if(istype(Proj,/obj/item/projectile/beam)) var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
PlasmaBurn(2500) s.set_up(5, 1, src)
else if(istype(Proj,/obj/item/projectile/ion)) s.start()
PlasmaBurn(500) return 1
..() else
return 0
*/

View File

@@ -217,9 +217,8 @@
var/old_lumcount = lighting_lumcount - initial(lighting_lumcount) var/old_lumcount = lighting_lumcount - initial(lighting_lumcount)
if(N in typesof(/turf/simulated)) if(N in typesof(/turf/simulated/floor))
var/turf/simulated/W = new N( locate(src.x, src.y, src.z) ) var/turf/simulated/W = new N( locate(src.x, src.y, src.z) )
W.Assimilate_Air() W.Assimilate_Air()
W.lighting_lumcount += old_lumcount W.lighting_lumcount += old_lumcount
@@ -234,7 +233,6 @@
return W return W
else else
var/turf/W = new N( locate(src.x, src.y, src.z) ) var/turf/W = new N( locate(src.x, src.y, src.z) )
W.lighting_lumcount += old_lumcount W.lighting_lumcount += old_lumcount
if(old_lumcount != W.lighting_lumcount) if(old_lumcount != W.lighting_lumcount)
W.lighting_changed = 1 W.lighting_changed = 1
@@ -272,31 +270,10 @@
air.toxins = (atox/max(turf_count,1)) air.toxins = (atox/max(turf_count,1))
air.temperature = (atemp/max(turf_count,1))//Trace gases can get bant air.temperature = (atemp/max(turf_count,1))//Trace gases can get bant
/turf/proc/ReplaceWithFloor()
return
/turf/proc/ReplaceWithLattice() /turf/proc/ReplaceWithLattice()
src.ChangeTurf(/turf/space) src.ChangeTurf(/turf/space)
new /obj/structure/lattice( locate(src.x, src.y, src.z) ) new /obj/structure/lattice( locate(src.x, src.y, src.z) )
/turf/proc/ReplaceWithMineralWall(var/ore)
var/old_icon = icon_state
var/old_lumcount = lighting_lumcount - initial(lighting_lumcount)
var/turf/simulated/wall/mineral/S = new /turf/simulated/wall/mineral( locate(src.x, src.y, src.z) )
S.lighting_lumcount += old_lumcount
if(old_lumcount != S.lighting_lumcount)
S.lighting_changed = 1
lighting_controller.changed_turfs += S
S.icon_old = old_icon
S.mineral = ore
S.New()//Hackish as fuck, but what can you do? -Sieve //build it into the goddamn new() call up there ^ ~Carn
//e.g. new(turf/loc, mineral)
S.levelupdate()
return S
/turf/proc/kill_creatures(mob/U = null)//Will kill people/creatures and damage mechs./N /turf/proc/kill_creatures(mob/U = null)//Will kill people/creatures and damage mechs./N
//Useful to batch-add creatures to the list. //Useful to batch-add creatures to the list.
for(var/mob/living/M in src) for(var/mob/living/M in src)

View File

@@ -1524,16 +1524,21 @@
if(target) if(target)
for (var/path in paths) for (var/path in paths)
for (var/i = 0; i < number; i++) for (var/i = 0; i < number; i++)
var/atom/O = new path(target) if(path in typesof(/turf))
if(O) var/turf/O = target
O.dir = obj_dir var/turf/N = O.ChangeTurf(path)
if(obj_name) if(N)
O.name = obj_name if(obj_name)
if(istype(O,/mob)) N.name = obj_name
var/mob/M = O else
M.real_name = obj_name var/atom/O = new path(target)
if(O)
O.dir = obj_dir
if(obj_name)
O.name = obj_name
if(istype(O,/mob))
var/mob/M = O
M.real_name = obj_name
if (number == 1) if (number == 1)
log_admin("[key_name(usr)] created a [english_list(paths)]") log_admin("[key_name(usr)] created a [english_list(paths)]")

View File

@@ -171,6 +171,8 @@
spreadChance = 0 spreadChance = 0
spread = 0 spread = 0
/*
commented out in r5061, I left it because of the shroom thingies
/turf/simulated/mineral/ReplaceWithFloor() /turf/simulated/mineral/ReplaceWithFloor()
if(!icon_old) icon_old = icon_state if(!icon_old) icon_old = icon_state
@@ -197,7 +199,7 @@
W.fullUpdateMineralOverlays() W.fullUpdateMineralOverlays()
W.levelupdate() W.levelupdate()
return W return W
*/
/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)
@@ -248,7 +250,8 @@
new /obj/item/weapon/ore/diamond(src) new /obj/item/weapon/ore/diamond(src)
if (src.mineralName == "Clown") if (src.mineralName == "Clown")
new /obj/item/weapon/ore/clown(src) new /obj/item/weapon/ore/clown(src)
ReplaceWithFloor() var/turf/simulated/floor/plating/airless/asteroid/N = ChangeTurf(/turf/simulated/floor/plating/airless/asteroid)
N.fullUpdateMineralOverlays()
return return
/* /*