From 440c782a9421f63ea88dce66a5eac1aeca00daca Mon Sep 17 00:00:00 2001 From: "aranclanos@hotmail.com" Date: Wed, 14 Nov 2012 13:29:30 +0000 Subject: [PATCH] - 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 --- code/game/machinery/doors/airlock.dm | 7 +- code/game/objects/structures/false_walls.dm | 15 +- code/game/objects/structures/girders.dm | 14 +- code/game/turfs/simulated/walls.dm | 2 +- code/game/turfs/simulated/walls_mineral.dm | 181 ++++++++++---------- code/game/turfs/turf.dm | 25 +-- code/modules/admin/topic.dm | 25 +-- code/modules/mining/mine_turfs.dm | 7 +- 8 files changed, 131 insertions(+), 145 deletions(-) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index b695f77e4f..b2faad4162 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -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) 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) - T.ReplaceWithMineralWall("plasma") + T.ChangeTurf(/turf/simulated/wall/mineral/plasma/) del (F) - for(var/turf/simulated/wall/mineral/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 + for(var/turf/simulated/wall/mineral/plasma/W in range(3,src)) + 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)) D.ignite(temperature/4) new/obj/structure/door_assembly/door_assembly_0( src.loc ) diff --git a/code/game/objects/structures/false_walls.dm b/code/game/objects/structures/false_walls.dm index fc67a6111a..ed90589855 100644 --- a/code/game/objects/structures/false_walls.dm +++ b/code/game/objects/structures/false_walls.dm @@ -146,7 +146,7 @@ if(!mineral || mineral == "metal") T.ChangeTurf(/turf/simulated/wall) else - T.ReplaceWithMineralWall(mineral) + T.ChangeTurf(text2path("/turf/simulated/wall/mineral/[mineral]")) del(src) if( istype(W, /obj/item/weapon/weldingtool) ) @@ -156,7 +156,7 @@ if(!mineral) T.ChangeTurf(/turf/simulated/wall) 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 T = get_turf(src) T.attackby(W,user) @@ -169,7 +169,7 @@ if(!mineral) T.ChangeTurf(/turf/simulated/wall) else - T.ReplaceWithMineralWall(mineral) + T.ChangeTurf(text2path("/turf/simulated/wall/mineral/[mineral]")) if(mineral != "plasma") T = get_turf(src) T.attackby(W,user) @@ -181,7 +181,7 @@ if(!mineral) T.ChangeTurf(/turf/simulated/wall) else - T.ReplaceWithMineralWall(mineral) + T.ChangeTurf(text2path("/turf/simulated/wall/mineral/[mineral]")) T = get_turf(src) T.attackby(W,user) del(src) @@ -191,7 +191,7 @@ if(!mineral) T.ChangeTurf(/turf/simulated/wall) else - T.ReplaceWithMineralWall(mineral) + T.ChangeTurf(text2path("/turf/simulated/wall/mineral/[mineral]")) if(mineral != "plasma") T = get_turf(src) T.attackby(W,user) @@ -308,9 +308,8 @@ active = 1 for(var/mob/living/L in range(3,src)) L.apply_effect(12,IRRADIATE,0) - for(var/turf/simulated/wall/mineral/T in range(3,src)) - if(T.mineral == "uranium") - T.radiate() + for(var/turf/simulated/wall/mineral/uranium/T in range(3,src)) + T.radiate() last_event = world.time active = null return diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index a71b6104f6..9e735b16cc 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -139,7 +139,7 @@ S.use(2) user << "\blue You added the plating!" 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) P.layer = 1 for(var/turf/simulated/wall/mineral/X in Tsrc.loc) @@ -162,7 +162,7 @@ S.use(2) user << "\blue You added the plating!" 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) P.layer = 1 for(var/turf/simulated/wall/mineral/X in Tsrc.loc) @@ -185,7 +185,7 @@ S.use(2) user << "\blue You added the plating!" 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) P.layer = 1 for(var/turf/simulated/wall/mineral/X in Tsrc.loc) @@ -208,7 +208,7 @@ S.use(2) user << "\blue You added the plating!" 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) P.layer = 1 for(var/turf/simulated/wall/mineral/X in Tsrc.loc) @@ -231,7 +231,7 @@ S.use(2) user << "\blue You added the plating!" 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) P.layer = 1 for(var/turf/simulated/wall/mineral/X in Tsrc.loc) @@ -254,7 +254,7 @@ S.use(2) user << "\blue You added the plating!" 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) P.layer = 1 for(var/turf/simulated/wall/mineral/X in Tsrc.loc) @@ -277,7 +277,7 @@ S.use(2) user << "\blue You added the plating!" 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) P.layer = 1 for(var/turf/simulated/wall/mineral/X in Tsrc.loc) diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 5e45ddcd04..1cff3ce641 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -122,7 +122,7 @@ /turf/simulated/wall/examine() set src in oview(1) - usr << "It looks like a regular wall." + usr << "[desc]." return /turf/simulated/wall/ex_act(severity) diff --git a/code/game/turfs/simulated/walls_mineral.dm b/code/game/turfs/simulated/walls_mineral.dm index a0b09923f6..4ffd724712 100644 --- a/code/game/turfs/simulated/walls_mineral.dm +++ b/code/game/turfs/simulated/walls_mineral.dm @@ -5,91 +5,93 @@ var/last_event = 0 var/active = null -/turf/simulated/wall/mineral/New() - switch(mineral) - if("gold") - name = "gold wall" - desc = "A wall with gold plating. Swag!" - icon_state = "gold0" - walltype = "gold" -// var/electro = 1 -// 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/gold + name = "gold wall" + desc = "A wall with gold plating. Swag!" + icon_state = "gold0" + walltype = "gold" + mineral = "gold" + //var/electro = 1 + //var/shocked = null -/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(world.time > last_event+15) active = 1 for(var/mob/living/L in range(3,src)) L.apply_effect(12,IRRADIATE,0) - for(var/turf/simulated/wall/mineral/T in range(3,src)) - if(T.mineral == "uranium") - T.radiate() + for(var/turf/simulated/wall/mineral/uranium/T in range(3,src)) + T.radiate() last_event = world.time active = null return return -/*/turf/simulated/wall/mineral/proc/shock() - if (electrocute_mob(user, C, src)) - 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/uranium/attack_hand(mob/user as mob) + radiate() ..() -/turf/simulated/wall/mineral/attackby(obj/item/weapon/W as obj, mob/user as mob) - if((mineral == "plasma") && W) - if(is_hot(W) > 300)//If the temperature of the object is over 300, then ignite - ignite(is_hot(W)) - return - if(mineral == "uranium") - radiate() +/turf/simulated/wall/mineral/uranium/attackby(obj/item/weapon/W as obj, mob/user as mob) + radiate() + +/turf/simulated/wall/mineral/uranium/Bumped(AM as mob|obj) + 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(shocked) // shock() ..() -/turf/simulated/wall/mineral/proc/PlasmaBurn(temperature) +/turf/simulated/wall/mineral/plasma/proc/PlasmaBurn(temperature) spawn(2) new /obj/structure/girder(src) src.ChangeTurf(/turf/simulated/floor) @@ -104,33 +106,34 @@ 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 var/turf/T = get_turf(F) - T.ReplaceWithMineralWall("plasma") + T.ChangeTurf(/turf/simulated/wall/mineral/plasma/) del (F) - for(var/turf/simulated/wall/mineral/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 + for(var/turf/simulated/wall/mineral/plasma/W in range(3,src)) + 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)) 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 :( - if(mineral == "plasma") - if(exposed_temperature > 300) - PlasmaBurn(exposed_temperature) +/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(exposed_temperature > 300) + PlasmaBurn(exposed_temperature) -/turf/simulated/wall/mineral/proc/ignite(exposed_temperature) - if(mineral == "plasma") - if(exposed_temperature > 300) - PlasmaBurn(exposed_temperature) +/turf/simulated/wall/mineral/plasma/proc/ignite(exposed_temperature) + if(exposed_temperature > 300) + PlasmaBurn(exposed_temperature) -/turf/simulated/wall/mineral/Bumped(AM as mob|obj) - if(mineral == "uranium") - radiate() +/turf/simulated/wall/mineral/plasma/bullet_act(var/obj/item/projectile/Proj) + if(istype(Proj,/obj/item/projectile/beam)) + PlasmaBurn(2500) + else if(istype(Proj,/obj/item/projectile/ion)) + PlasmaBurn(500) ..() -/turf/simulated/wall/mineral/bullet_act(var/obj/item/projectile/Proj) - if(mineral == "plasma") - if(istype(Proj,/obj/item/projectile/beam)) - PlasmaBurn(2500) - else if(istype(Proj,/obj/item/projectile/ion)) - PlasmaBurn(500) - ..() \ No newline at end of file +/*/turf/simulated/wall/mineral/proc/shock() + if (electrocute_mob(user, C, src)) + 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 + */ \ No newline at end of file diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 686b132229..5024aee2c8 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -217,9 +217,8 @@ 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) ) - W.Assimilate_Air() W.lighting_lumcount += old_lumcount @@ -234,7 +233,6 @@ return W else var/turf/W = new N( locate(src.x, src.y, src.z) ) - W.lighting_lumcount += old_lumcount if(old_lumcount != W.lighting_lumcount) W.lighting_changed = 1 @@ -272,31 +270,10 @@ air.toxins = (atox/max(turf_count,1)) air.temperature = (atemp/max(turf_count,1))//Trace gases can get bant -/turf/proc/ReplaceWithFloor() - return - /turf/proc/ReplaceWithLattice() src.ChangeTurf(/turf/space) 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 //Useful to batch-add creatures to the list. for(var/mob/living/M in src) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 4a004149cd..52e077f5ee 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1524,16 +1524,21 @@ if(target) for (var/path in paths) for (var/i = 0; i < number; i++) - 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(path in typesof(/turf)) + var/turf/O = target + var/turf/N = O.ChangeTurf(path) + if(N) + if(obj_name) + N.name = obj_name + else + 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) log_admin("[key_name(usr)] created a [english_list(paths)]") diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index 7e28043c2a..2d992fede6 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -171,6 +171,8 @@ spreadChance = 0 spread = 0 +/* +commented out in r5061, I left it because of the shroom thingies /turf/simulated/mineral/ReplaceWithFloor() if(!icon_old) icon_old = icon_state @@ -197,7 +199,7 @@ W.fullUpdateMineralOverlays() W.levelupdate() return W - +*/ /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) if (src.mineralName == "Clown") 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 /*