From 3bd93d58a8fcae599b5eec34587d6a7ea2ffa410 Mon Sep 17 00:00:00 2001 From: "johnsonmt88@gmail.com" Date: Thu, 5 Jul 2012 21:06:44 +0000 Subject: [PATCH] git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3990 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/dna.dm | 5 +- code/game/magic/cultist/runes.dm | 25 +- code/game/objects/items.dm | 2 +- code/game/objects/structures.dm | 412 +++++++++++++++++-------------- 4 files changed, 242 insertions(+), 202 deletions(-) diff --git a/code/game/dna.dm b/code/game/dna.dm index 455b43f601..ca694b1b9c 100644 --- a/code/game/dna.dm +++ b/code/game/dna.dm @@ -699,7 +699,10 @@ //G = null // search for ghosts, if the corpse is empty and the scanner is connected to a cloner - if(locate(/obj/machinery/computer/cloning, get_step(src, EAST))) + if(locate(/obj/machinery/computer/cloning, get_step(src, NORTH)) \ + || locate(/obj/machinery/computer/cloning, get_step(src, SOUTH)) \ + || locate(/obj/machinery/computer/cloning, get_step(src, EAST)) \ + || locate(/obj/machinery/computer/cloning, get_step(src, WEST))) if (!M.client) for(var/mob/dead/observer/ghost in world) diff --git a/code/game/magic/cultist/runes.dm b/code/game/magic/cultist/runes.dm index 211da01769..a817ecfba3 100644 --- a/code/game/magic/cultist/runes.dm +++ b/code/game/magic/cultist/runes.dm @@ -476,11 +476,11 @@ var/list/sacrificed = list() T.imbue = "deafen" imbued_from = R break - /*if(R.word1==worddestr && R.word2==wordsee && R.word3==wordother) //blind + if(R.word1==worddestr && R.word2==wordsee && R.word3==wordother) //blind T = new(src.loc) T.imbue = "blind" imbued_from = R - break*/ + break if(R.word1==wordself && R.word2==wordother && R.word3==wordtech) //communicat T = new(src.loc) T.imbue = "communicate" @@ -863,7 +863,7 @@ var/list/sacrificed = list() return fizzle() else var/affected = 0 - for(var/mob/living/carbon/C in viewers(usr)) + for(var/mob/living/carbon/C in view(2,usr)) if (iscultist(C)) continue var/obj/item/weapon/nullrod/N = locate() in C @@ -997,13 +997,20 @@ var/list/sacrificed = list() usr.whisper("N'ath reth sh'yro eth d'raggathnor!") usr.visible_message("\red Rune disappears with a flash of red light, and a set of armor appears on you..", \ "\red You are blinded by the flash of red light! After you're able to see again, you see that you are now wearing a set of armor.") - user.equip_if_possible(new /obj/item/clothing/shoes/cult(user), user.slot_shoes) - user.equip_if_possible(new /obj/item/clothing/suit/cultrobes/alt(user), user.slot_wear_suit) + user.equip_if_possible(new /obj/item/clothing/head/culthood/alt(user), user.slot_head) - //user.equip_if_possible(new /obj/item/clothing/gloves/black(user), user.slot_gloves) - //user.equip_if_possible(new /obj/item/clothing/suit/magusred(user), user.slot_wear_suit) - //user.equip_if_possible(new /obj/item/clothing/head/magus(user), user.slot_head) - user.equip_if_possible(new /obj/item/weapon/melee/cultblade(user), user.slot_r_hand) + user.equip_if_possible(new /obj/item/clothing/suit/cultrobes/alt(user), user.slot_wear_suit) + user.equip_if_possible(new /obj/item/clothing/shoes/cult(user), user.slot_shoes) user.equip_if_possible(new /obj/item/weapon/storage/backpack/cultpack(user), user.slot_back) + if(!user.equip_if_possible(new /obj/item/weapon/melee/cultblade(user), user.slot_r_hand)) + user.equip_if_possible(new /obj/item/weapon/melee/cultblade(user), user.slot_l_hand) + + user.update_inv_head(0) + user.update_inv_wear_suit(0) + user.update_inv_shoes(0) + user.update_inv_back(0) + user.update_inv_l_hand(0) + user.update_inv_r_hand() + del(src) return diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 27a1f5223f..2aa51adac3 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -390,7 +390,7 @@ if(!(user.zone_sel.selecting == ("head")) || !istype(M, /mob/living/carbon/human)) return ..() - if(!(locate(/obj/machinery/optable, M.loc) && M.resting)) + if( !(locate(/obj/machinery/optable, M.loc) && M.resting) && ( !(locate(/obj/structure/table/, M.loc) && M.lying) && prob(50) ) ) return ..() var/mob/living/carbon/human/H = M diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index 8e50795117..c30946f8d3 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -30,90 +30,41 @@ obj/structure/meteorhit(obj/O as obj) var/state = 0 attackby(obj/item/W as obj, mob/user as mob) - if(istype(W, /obj/item/weapon/wrench) && state == 0 && anchored && !istype(src,/obj/structure/girder/displaced)) - playsound(src.loc, 'Ratchet.ogg', 100, 1) - user << "\blue Now disassembling the girder" - if(do_after(user,40)) - user << "\blue You dissasembled the girder!" - new /obj/item/stack/sheet/metal(get_turf(src)) - del(src) + if(istype(W, /obj/item/weapon/wrench) && state == 0) + if(anchored && !istype(src,/obj/structure/girder/displaced)) + playsound(src.loc, 'Ratchet.ogg', 100, 1) + user << "\blue Now disassembling the girder" + if(do_after(user,40)) + if(!src) return + user << "\blue You dissasembled the girder!" + new /obj/item/stack/sheet/metal(get_turf(src)) + del(src) + else if(!anchored) + playsound(src.loc, 'Ratchet.ogg', 100, 1) + user << "\blue Now securing the girder" + if(get_turf(user, 40)) + user << "\blue You secured the girder!" + new/obj/structure/girder( src.loc ) + del(src) else if(istype(W, /obj/item/weapon/pickaxe/plasmacutter)) user << "\blue Now slicing apart the girder" if(do_after(user,30)) + if(!src) return user << "\blue You slice apart the girder!" - new /obj/item/stack/sheet/metal(get_turf(src)) - del(src) + new /obj/item/stack/sheet/metal(get_turf(src)) + del(src) else if(istype(W, /obj/item/weapon/pickaxe/diamonddrill)) user << "\blue You drill through the girder!" new /obj/item/stack/sheet/metal(get_turf(src)) del(src) - else if(istype(W, /obj/item/stack/sheet) && !anchored) - switch(W.type) - if(/obj/item/stack/sheet/metal) - W:use(2) - user << "\blue You create a false wall! Push on it to open or close the passage." - new /obj/structure/falsewall (src.loc) - if(/obj/item/stack/sheet/plasteel) - W:use(2) - user << "\blue You create a false wall! Push on it to open or close the passage." - new /obj/structure/falserwall (src.loc) - if(/obj/item/stack/sheet/gold) - W:use(2) - user << "\blue You create a false wall! Push on it to open or close the passage." - new /obj/structure/falsewall/gold (src.loc) - if(/obj/item/stack/sheet/silver) - W:use(2) - user << "\blue You create a false wall! Push on it to open or close the passage." - new /obj/structure/falsewall/silver (src.loc) - if(/obj/item/stack/sheet/diamond) - W:use(2) - user << "\blue You create a false wall! Push on it to open or close the passage." - new /obj/structure/falsewall/diamond (src.loc) - if(/obj/item/stack/sheet/uranium) - W:use(2) - user << "\blue You create a false wall! Push on it to open or close the passage." - new /obj/structure/falsewall/uranium (src.loc) - if(/obj/item/stack/sheet/plasma) - W:use(2) - user << "\blue You create a false wall! Push on it to open or close the passage." - new /obj/structure/falsewall/plasma (src.loc) - if(/obj/item/stack/sheet/clown) - W:use(2) - user << "\blue You create a false wall! Push on it to open or close the passage." - new /obj/structure/falsewall/clown (src.loc) - if(/obj/item/stack/sheet/sandstone) - W:use(2) - user << "\blue You create a false wall! Push on it to open or close the passage." - new /obj/structure/falsewall/sandstone (src.loc) -/* if(/obj/item/stack/sheet/wood) - W:use(2) - user << "\blue You create a false wall! Push on it to open or close the passage." - new /obj/structure/falsewall/wood (src.loc)*/ - add_hiddenprint(usr) - del(src) - - -/* else if((istype(W, /obj/item/stack/sheet/metal)) && (W:amount >= 2) && istype(src,/obj/structure/girder/displaced)) - W:use(2) - user << "\blue You create a false wall! Push on it to open or close the passage." - new /obj/structure/falsewall (src.loc) - add_hiddenprint(usr) - del(src) - else if(istype(W, /obj/item/stack/sheet/plasteel) && istype(src,/obj/structure/girder/displaced)) - W:use(2) - user << "\blue You create a false r wall! Push on it to open or close the passage." - new /obj/structure/falserwall (src.loc) - add_hiddenprint(usr) - del(src)*/ - - else if(istype(W, /obj/item/weapon/screwdriver) && state == 2 && istype(src,/obj/structure/girder/reinforced)) playsound(src.loc, 'Screwdriver.ogg', 100, 1) user << "\blue Now unsecuring support struts" if(do_after(user,40)) + if(!src) return user << "\blue You unsecured the support struts!" state = 1 @@ -121,6 +72,7 @@ obj/structure/meteorhit(obj/O as obj) playsound(src.loc, 'Wirecutter.ogg', 100, 1) user << "\blue Now removing support struts" if(do_after(user,40)) + if(!src) return user << "\blue You removed the support struts!" new/obj/structure/girder( src.loc ) del(src) @@ -129,156 +81,226 @@ obj/structure/meteorhit(obj/O as obj) playsound(src.loc, 'Crowbar.ogg', 100, 1) user << "\blue Now dislodging the girder" if(do_after(user, 40)) + if(!src) return user << "\blue You dislodged the girder!" new/obj/structure/girder/displaced( src.loc ) del(src) - else if(istype(W, /obj/item/weapon/wrench) && state == 0 && !anchored ) - playsound(src.loc, 'Ratchet.ogg', 100, 1) - user << "\blue Now securing the girder" - if(get_turf(user, 40)) - user << "\blue You secured the girder!" - new/obj/structure/girder( src.loc ) - del(src) + else if(istype(W, /obj/item/stack/sheet)) - else if((istype(W, /obj/item/stack/sheet)) && (W:amount >= 2)) - switch(W.type) + var/obj/item/stack/sheet/S = W + switch(S.type) if(/obj/item/stack/sheet/metal) - user << "\blue Now adding plating..." - if (do_after(user,40)) - user << "\blue You added the plating!" - var/turf/Tsrc = get_turf(src) - Tsrc.ReplaceWithWall() - for(var/obj/machinery/atmospherics/pipe/P in Tsrc) - P.layer = 1 - for(var/turf/simulated/wall/X in Tsrc.loc) - if(X) X.add_hiddenprint(usr) - if (W) W:use(2) - del(src) - return - - if (/obj/item/stack/sheet/plasteel) - if (src.icon_state == "reinforced") //Time to finalize! - user << "\blue Now finalising reinforced wall." - if(do_after(user, 50)) - user << "\blue Wall fully reinforced!" + if(!anchored) + if(S.amount < 2) return + S.use(2) + user << "\blue You create a false wall! Push on it to open or close the passage." + new /obj/structure/falsewall (src.loc) + else + if(S.amount < 2) return ..() + user << "\blue Now adding plating..." + if (do_after(user,40)) + if(!src || !S || S.amount < 2) return + S.use(2) + user << "\blue You added the plating!" var/turf/Tsrc = get_turf(src) - Tsrc.ReplaceWithRWall() + Tsrc.ReplaceWithWall() for(var/obj/machinery/atmospherics/pipe/P in Tsrc) P.layer = 1 - for(var/turf/simulated/wall/r_wall/X in Tsrc.loc) + for(var/turf/simulated/wall/X in Tsrc.loc) if(X) X.add_hiddenprint(usr) - if (W) - W:use(1) del(src) return + + if(/obj/item/stack/sheet/plasteel) + if(!anchored) + if(S.amount < 2) return + S.use(2) + user << "\blue You create a false wall! Push on it to open or close the passage." + new /obj/structure/falserwall (src.loc) else - user << "\blue Now reinforcing girders" - if (do_after(user,60)) - user << "\blue Girders reinforced!" - W:use(1) - new/obj/structure/girder/reinforced( src.loc ) - del(src) - return + if (src.icon_state == "reinforced") //I cant believe someone would actually write this line of code... + if(S.amount < 1) return ..() + user << "\blue Now finalising reinforced wall." + if(do_after(user, 50)) + if(!src || !S || S.amount < 1) return + S.use(1) + user << "\blue Wall fully reinforced!" + var/turf/Tsrc = get_turf(src) + Tsrc.ReplaceWithRWall() + for(var/obj/machinery/atmospherics/pipe/P in Tsrc) + P.layer = 1 + for(var/turf/simulated/wall/r_wall/X in Tsrc.loc) + if(X) X.add_hiddenprint(usr) + del(src) + return + else + if(S.amount < 1) return ..() + user << "\blue Now reinforcing girders" + if (do_after(user,60)) + if(!src || !S || S.amount < 1) return + S.use(1) + user << "\blue Girders reinforced!" + new/obj/structure/girder/reinforced( src.loc ) + del(src) + return if(/obj/item/stack/sheet/gold) - user << "\blue Now adding plating..." - if (do_after(user,40)) - user << "\blue You added the plating!" - var/turf/Tsrc = get_turf(src) - Tsrc.ReplaceWithMineralWall("gold") - for(var/obj/machinery/atmospherics/pipe/P in Tsrc) - P.layer = 1 - for(var/turf/simulated/wall/mineral/X in Tsrc.loc) - if(X) X.add_hiddenprint(usr) - if (W) W:use(2) - del(src) - return + if(!anchored) + if(S.amount < 2) return + S.use(2) + user << "\blue You create a false wall! Push on it to open or close the passage." + new /obj/structure/falsewall/gold (src.loc) + else + if(S.amount < 2) return ..() + user << "\blue Now adding plating..." + if (do_after(user,40)) + if(!src || !S || S.amount < 2) return + S.use(2) + user << "\blue You added the plating!" + var/turf/Tsrc = get_turf(src) + Tsrc.ReplaceWithMineralWall("gold") + for(var/obj/machinery/atmospherics/pipe/P in Tsrc) + P.layer = 1 + for(var/turf/simulated/wall/mineral/X in Tsrc.loc) + if(X) X.add_hiddenprint(usr) + del(src) + return if(/obj/item/stack/sheet/silver) - user << "\blue Now adding plating..." - if (do_after(user,40)) - user << "\blue You added the plating!" - var/turf/Tsrc = get_turf(src) - Tsrc.ReplaceWithMineralWall("silver") - for(var/obj/machinery/atmospherics/pipe/P in Tsrc) - P.layer = 1 - for(var/turf/simulated/wall/mineral/X in Tsrc.loc) - if(X) X.add_hiddenprint(usr) - if (W) W:use(2) - del(src) - return + if(!anchored) + if(S.amount < 2) return + S.use(2) + user << "\blue You create a false wall! Push on it to open or close the passage." + new /obj/structure/falsewall/silver (src.loc) + else + if(S.amount < 2) return ..() + user << "\blue Now adding plating..." + if (do_after(user,40)) + if(!src || !S || S.amount < 2) return + S.use(2) + user << "\blue You added the plating!" + var/turf/Tsrc = get_turf(src) + Tsrc.ReplaceWithMineralWall("silver") + for(var/obj/machinery/atmospherics/pipe/P in Tsrc) + P.layer = 1 + for(var/turf/simulated/wall/mineral/X in Tsrc.loc) + if(X) X.add_hiddenprint(usr) + del(src) + return if(/obj/item/stack/sheet/diamond) - user << "\blue Now adding plating..." - if (do_after(user,40)) - user << "\blue You added the plating!" - var/turf/Tsrc = get_turf(src) - Tsrc.ReplaceWithMineralWall("diamond") - for(var/obj/machinery/atmospherics/pipe/P in Tsrc) - P.layer = 1 - for(var/turf/simulated/wall/mineral/X in Tsrc.loc) - if(X) X.add_hiddenprint(usr) - if (W) W:use(2) - del(src) - return + if(!anchored) + if(S.amount < 2) return + S.use(2) + user << "\blue You create a false wall! Push on it to open or close the passage." + new /obj/structure/falsewall/diamond (src.loc) + else + if(S.amount < 2) return ..() + user << "\blue Now adding plating..." + if (do_after(user,40)) + if(!src || !S || S.amount < 2) return + S.use(2) + user << "\blue You added the plating!" + var/turf/Tsrc = get_turf(src) + Tsrc.ReplaceWithMineralWall("diamond") + for(var/obj/machinery/atmospherics/pipe/P in Tsrc) + P.layer = 1 + for(var/turf/simulated/wall/mineral/X in Tsrc.loc) + if(X) X.add_hiddenprint(usr) + del(src) + return if(/obj/item/stack/sheet/uranium) - user << "\blue Now adding plating..." - if (do_after(user,40)) - user << "\blue You added the plating!" - var/turf/Tsrc = get_turf(src) - Tsrc.ReplaceWithMineralWall("uranium") - for(var/obj/machinery/atmospherics/pipe/P in Tsrc) - P.layer = 1 - for(var/turf/simulated/wall/mineral/X in Tsrc.loc) - if(X) X.add_hiddenprint(usr) - if (W) W:use(2) - del(src) - return + if(!anchored) + if(S.amount < 2) return + S.use(2) + user << "\blue You create a false wall! Push on it to open or close the passage." + new /obj/structure/falsewall/uranium (src.loc) + else + if(S.amount < 2) return ..() + user << "\blue Now adding plating..." + if (do_after(user,40)) + if(!src || !S || S.amount < 2) return + S.use(2) + user << "\blue You added the plating!" + var/turf/Tsrc = get_turf(src) + Tsrc.ReplaceWithMineralWall("uranium") + for(var/obj/machinery/atmospherics/pipe/P in Tsrc) + P.layer = 1 + for(var/turf/simulated/wall/mineral/X in Tsrc.loc) + if(X) X.add_hiddenprint(usr) + del(src) + return if(/obj/item/stack/sheet/plasma) - user << "\blue Now adding plating..." - if (do_after(user,40)) - user << "\blue You added the plating!" - var/turf/Tsrc = get_turf(src) - Tsrc.ReplaceWithMineralWall("plasma") - for(var/obj/machinery/atmospherics/pipe/P in Tsrc) - P.layer = 1 - for(var/turf/simulated/wall/mineral/X in Tsrc.loc) - if(X) X.add_hiddenprint(usr) - if (W) W:use(2) - del(src) - return + if(!anchored) + if(S.amount < 2) return + S.use(2) + user << "\blue You create a false wall! Push on it to open or close the passage." + new /obj/structure/falsewall/plasma (src.loc) + else + if(S.amount < 2) return ..() + user << "\blue Now adding plating..." + if (do_after(user,40)) + if(!src || !S || S.amount < 2) return + S.use(2) + user << "\blue You added the plating!" + var/turf/Tsrc = get_turf(src) + Tsrc.ReplaceWithMineralWall("plasma") + for(var/obj/machinery/atmospherics/pipe/P in Tsrc) + P.layer = 1 + for(var/turf/simulated/wall/mineral/X in Tsrc.loc) + if(X) X.add_hiddenprint(usr) + del(src) + return if(/obj/item/stack/sheet/clown) - user << "\blue Now adding plating..." - if (do_after(user,40)) - user << "\blue You added the plating!" - var/turf/Tsrc = get_turf(src) - Tsrc.ReplaceWithMineralWall("clown") - for(var/obj/machinery/atmospherics/pipe/P in Tsrc) - P.layer = 1 - for(var/turf/simulated/wall/mineral/X in Tsrc.loc) - if(X) X.add_hiddenprint(usr) - if (W) W:use(2) - del(src) - return + if(!anchored) + if(S.amount < 2) return + S.use(2) + user << "\blue You create a false wall! Push on it to open or close the passage." + new /obj/structure/falsewall/clown (src.loc) + else + if(S.amount < 2) return ..() + user << "\blue Now adding plating..." + if (do_after(user,40)) + if(!src || !S || S.amount < 2) return + user << "\blue You added the plating!" + var/turf/Tsrc = get_turf(src) + Tsrc.ReplaceWithMineralWall("clown") + for(var/obj/machinery/atmospherics/pipe/P in Tsrc) + P.layer = 1 + for(var/turf/simulated/wall/mineral/X in Tsrc.loc) + if(X) X.add_hiddenprint(usr) + del(src) + return if(/obj/item/stack/sheet/sandstone) - user << "\blue Now adding plating..." - if (do_after(user,40)) - user << "\blue You added the plating!" - var/turf/Tsrc = get_turf(src) - Tsrc.ReplaceWithMineralWall("sandstone") - for(var/obj/machinery/atmospherics/pipe/P in Tsrc) - P.layer = 1 - for(var/turf/simulated/wall/mineral/X in Tsrc.loc) - if(X) X.add_hiddenprint(usr) - if (W) W:use(2) - del(src) - return + if(!anchored) + if(S.amount < 2) return + S.use(2) + user << "\blue You create a false wall! Push on it to open or close the passage." + new /obj/structure/falsewall/sandstone (src.loc) + else + if(S.amount < 2) return ..() + user << "\blue Now adding plating..." + if (do_after(user,40)) + if(!src || !S || S.amount < 2) return + S.use(2) + user << "\blue You added the plating!" + var/turf/Tsrc = get_turf(src) + Tsrc.ReplaceWithMineralWall("sandstone") + for(var/obj/machinery/atmospherics/pipe/P in Tsrc) + P.layer = 1 + for(var/turf/simulated/wall/mineral/X in Tsrc.loc) + if(X) X.add_hiddenprint(usr) + del(src) + return + + add_hiddenprint(usr) + del(src) else if(istype(W, /obj/item/pipe)) var/obj/item/pipe/P = W @@ -467,6 +489,14 @@ obj/structure/meteorhit(obj/O as obj) radiate() ..() +/obj/structure/falsewall/update_icon()//Calling icon_update will refresh the smoothwalls if it's closed, otherwise it will make sure the icon is correct if it's open + ..() + if(density) + icon_state = "[mineral]0" + src.relativewall() + else + icon_state = "[mineral]fwall_open" + /obj/structure/falsewall/attackby(obj/item/weapon/W as obj, mob/user as mob) if(istype(W, /obj/item/weapon/screwdriver)) var/turf/T = get_turf(src)