diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 1b1a8f07c83..859af746b47 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -276,6 +276,22 @@ H.gib() however DM also has a dot variable, accessed just as ```.``` on it's own, defaulting to a value of null, now what's special about the dot operator is that it is automatically returned (as in the ```return``` statment) at the end of a proc, provided the proc does not already manually return (```return count``` for example). Why is this special? well the ```return``` statement should ideally be free from overhead (functionally free, of course nothing's free) but DM fails to fulfill this, DM's return statement is actually fairly costly for what it does and for what it's used for. With ```.``` being everpresent in every proc can we use it as a temporary variable? Of course we can! However the ```.``` operator cannot replace a typecasted variable, it can hold data any other var in DM can, it just can't be accessed as one, however the ```.``` operator is compatible with a few operators that look weird but work perfectly fine, such as: ```.++``` for incrementing ```.'s``` value, or ```.[1]``` for accessing the first element of ```.``` (provided it's a list). +## Globals versus Static + +Byond has a var keyword, called global. This var keyword is for vars inside of types. IE: + +``` +mob + var + global + thing = 1 +``` +It DOES NOT mean that you can access it everywhere like a global var, instead It means that that var will only exist once for all instances of its type, in this case that var will only exist once for all mobs, ie its shared across everything in it's type. (much more like the keyword static in other languages like php/c++/c#/java) + +Isn't that confusing? + +There is also an undocumented keyword static, that has the same behaviour as global but more correctly describes byond's behaviour. Therefore we always use static instead of global where we need it as it reduces suprise when reading byond code. + ## Pull Request Process There is no strict process when it comes to merging pull requests, pull requests will sometimes take a while before they are looked at by a maintainer, the bigger the change the more time it will take before they are accepted into the code. Every team member is a volunteer who is giving up their own time to help maintain and contribute, so please be nice. Here are some helpful ways to make it easier for you and for the maintainer when making a pull request. diff --git a/_maps/RandomRuins/LavaRuins/lavaland_surface_ash_walker1.dmm b/_maps/RandomRuins/LavaRuins/lavaland_surface_ash_walker1.dmm index f219cfcc992..a6c92c7610c 100644 --- a/_maps/RandomRuins/LavaRuins/lavaland_surface_ash_walker1.dmm +++ b/_maps/RandomRuins/LavaRuins/lavaland_surface_ash_walker1.dmm @@ -145,7 +145,7 @@ /area/ruin/unpowered) "u" = ( /obj/structure/closet/crate/engineering, -/obj/item/weapon/rcd/loaded, +/obj/item/weapon/construction/rcd/loaded, /turf/open/floor/engine/cult{ baseturf = /turf/open/floor/plating/lava/smooth }, diff --git a/_maps/map_files/debug/runtimestation.dmm b/_maps/map_files/debug/runtimestation.dmm index b3facda8d26..2c90bf7f22f 100644 --- a/_maps/map_files/debug/runtimestation.dmm +++ b/_maps/map_files/debug/runtimestation.dmm @@ -1,3 +1,4 @@ + "aa" = (/turf/open/space/basic,/area/space) "ab" = (/obj/structure/lattice,/turf/open/space,/area/space) "ac" = (/turf/open/space,/area/space/nearstation) @@ -87,7 +88,7 @@ "bI" = (/obj/structure/table,/turf/open/floor/plasteel,/area/bridge) "bJ" = (/obj/structure/table,/obj/item/weapon/card/id/captains_spare,/turf/open/floor/plasteel,/area/bridge) "bK" = (/obj/structure/table,/obj/item/weapon/storage/backpack/holding,/turf/open/floor/plasteel,/area/bridge) -"bL" = (/obj/structure/table,/obj/item/weapon/rcd_ammo/large,/obj/item/weapon/rcd_ammo/large,/obj/item/weapon/rcd_ammo/large,/obj/item/weapon/rcd,/turf/open/floor/plasteel,/area/bridge) +"bL" = (/obj/structure/table,/obj/item/weapon/rcd_ammo/large,/obj/item/weapon/rcd_ammo/large,/obj/item/weapon/rcd_ammo/large,/obj/item/weapon/construction/rcd,/turf/open/floor/plasteel,/area/bridge) "bM" = (/obj/structure/closet/secure_closet/hop,/turf/open/floor/plasteel/blue/side{dir = 4},/area/bridge) "bN" = (/obj/machinery/atmospherics/pipe/simple/supply/hidden,/turf/open/floor/plasteel,/area/hallway/primary/central) "bO" = (/obj/structure/cable{d1 = 1;d2 = 2;icon_state = "1-2"},/turf/open/floor/plasteel,/area/hallway/primary/central) @@ -200,56 +201,2810 @@ "dR" = (/obj/structure/table,/obj/item/device/flashlight{pixel_y = 5},/turf/open/floor/plasteel,/area/storage/primary) (1,1,1) = {" -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaababababababababababababababababababababababababababababababababababababaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadadadadadadadadadaeaeaeaeaeaeaeadadadadadadadadadadadadadadadadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafafafafafafafadagagagagacacacadafafafafafafafafafafafafafafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafahahahahahahahagaiaiagacacacajajajajakakakakakakakakakakafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafahalamamamamahaganaoagagajajajapaqarakasatauavavavavavakafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafahawaxayayazahagaiaAaBaBaCaDaCaDaEaFakaGaHaIavaJaKaLavakafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafahaMawaNaOaPahagaQaRagagajajajaSaTaDaUaVaWaXavaKavaKaYakafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafahaZbabbbcaPahagaiaiagacacacajbdbebfakbgbhaIavaLbiaJavakafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafahbjbkblbmbnahagagagagacacacajbobebpakbqbraIavavavavavakafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafahbsbtahahahbububvbvbvbvbvbububwbxajakakakakbybybybybybyafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadbzbAbBbCbDbEbFbubGbHbIbJbKbLbMbubNbObPbQbRbSbTbybUbVbWbXbyafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacbYafbZcacbcccccccdcecfcfcfcfcfcgchcicjccccccccccckclcmcmcmcnafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacbYafbZbObNbEbEcobucpcqcqcqcqcqcrcsctbEbEbEbEbEcobycucmcmcmbybybyacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacbYafbZbObNbEbEbEbucvbvbucwbubvbucsbNbEbEbEbEbEbEcxcucmcmcycnczcnacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacbYafbZbObCcAcAcAcBcCcDcDcDcDcDcDcEcFcAcAcAcAcAcAcGcHcmcmcmbybybyacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacbYafbZbObNbEbEbEbEbEbEbEbEbEbEbEbObNbEbEbEbEbEbEbycIcmcmcmcnafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadbzbAbObNbEbEbEbEbEbEbEbEbEbEbEbObNbEbEbEbEbEbEbycJcKcLcMbyafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafcNcOcPcQcQcNcRcRcRcNcQcQcNcScTcUcScScScVcVcVbybybybybybyafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafcNcWcXcYcYcYcYcYcYcYcYcYcZcSdadbdcdddedfdgdhdidjdkdldlcSafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafcNdmdndndndndndndndndndndocSdpdldcdqdrdsdtdudvdwdkdldxcSafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafcNdydndndndndndndndndndndzcSdldldAdBdBdBdBdBdBdBdCdldlcSafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafcNdydndndndndndndndndndndzcSdldldldldldldldldldldldldlcSafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafcNdydndndndndndndndndndndzcSdldldDdEdEdEdEdEdEdEdFdldlcSafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafcNdydndndndndndndndndndndzdGdldldcdHdHdHdHdHdHdHdkdldlcSafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafcNdydndndndndndndndndndndzdGdldldcdIdIdIdIdIdIdIdkdldlcSafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafcNdydndndndndndndndndndndzcSdldldAdBdBdBdBdBdBdBdCdldlcSafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafcNdydndndndndndndndndndndzcSdldldldldldldldldldldldldlcSafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafcNdydndndndndndndndndndndzcSdldldDdEdEdEdEdEdEdEdFdldlcSafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafcNdmdndndndndndndndndndndocSdpdldcdJdJdJdJdJdJdJdkdldxcSafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafcNdKdLdLdLdLdLdLdLdLdLdLdMcSdldldcdNdOdNdNdPdQdRdkdldlcSafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafcNcNcNcNcNcNcNcNcNcNcNcNcNcScScScScScScScScScScScScScScSafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadafafafafafafafafafafafafafafafafafafafafafafafafafafafafafafadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacadadadadadadadadadadadadadadadadadadadadadadadadadadadadadadadadacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaabacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacacabaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaababababababababababababababababababababababababababababababababababababaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +"} +(2,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +"} +(3,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +"} +(4,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +"} +(5,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +"} +(6,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +"} +(7,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +"} +(8,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +"} +(9,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(10,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(11,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +ad +ad +ad +ad +ad +ad +ad +ad +ad +bY +bY +bY +bY +bY +ad +ad +ad +ad +ad +ad +ad +ad +ad +ad +ad +ad +ad +ad +ad +ad +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(12,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +af +af +af +af +af +af +af +af +bz +af +af +af +af +af +bz +af +af +af +af +af +af +af +af +af +af +af +af +af +af +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(13,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +af +ah +ah +ah +ah +ah +ah +ah +bA +bZ +bZ +bZ +bZ +bZ +bA +cN +cN +cN +cN +cN +cN +cN +cN +cN +cN +cN +cN +cN +cN +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(14,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +af +ah +al +aw +aM +aZ +bj +bs +bB +ca +bO +bO +bO +bO +bO +cO +cW +dm +dy +dy +dy +dy +dy +dy +dy +dy +dm +dK +cN +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(15,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +af +ah +am +ax +aw +ba +bk +bt +bC +cb +bN +bN +bC +bN +bN +cP +cX +dn +dn +dn +dn +dn +dn +dn +dn +dn +dn +dL +cN +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(16,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +af +ah +am +ay +aN +bb +bl +ah +bD +cc +bE +bE +cA +bE +bE +cQ +cY +dn +dn +dn +dn +dn +dn +dn +dn +dn +dn +dL +cN +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(17,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +af +ah +am +ay +aO +bc +bm +ah +bE +cc +bE +bE +cA +bE +bE +cQ +cY +dn +dn +dn +dn +dn +dn +dn +dn +dn +dn +dL +cN +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(18,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +af +ah +am +az +aP +aP +bn +ah +bF +cc +co +bE +cA +bE +bE +cN +cY +dn +dn +dn +dn +dn +dn +dn +dn +dn +dn +dL +cN +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(19,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +ad +ah +ah +ah +ah +ah +ah +bu +bu +cd +bu +bu +cB +bE +bE +cR +cY +dn +dn +dn +dn +dn +dn +dn +dn +dn +dn +dL +cN +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(20,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ae +ag +ag +ag +ag +ag +ag +ag +bu +bG +ce +cp +cv +cC +bE +bE +cR +cY +dn +dn +dn +dn +dn +dn +dn +dn +dn +dn +dL +cN +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(21,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ae +ag +ai +an +ai +aQ +ai +ag +bv +bH +cf +cq +bv +cD +bE +bE +cR +cY +dn +dn +dn +dn +dn +dn +dn +dn +dn +dn +dL +cN +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(22,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ae +ag +ai +ao +aA +aR +ai +ag +bv +bI +cf +cq +bu +cD +bE +bE +cN +cY +dn +dn +dn +dn +dn +dn +dn +dn +dn +dn +dL +cN +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(23,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ae +ag +ag +ag +aB +ag +ag +ag +bv +bJ +cf +cq +cw +cD +bE +bE +cQ +cY +dn +dn +dn +dn +dn +dn +dn +dn +dn +dn +dL +cN +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(24,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ae +ac +ac +ag +aB +ag +ac +ac +bv +bK +cf +cq +bu +cD +bE +bE +cQ +cY +dn +dn +dn +dn +dn +dn +dn +dn +dn +dn +dL +cN +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(25,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ae +ac +ac +aj +aC +aj +ac +ac +bv +bL +cf +cq +bv +cD +bE +bE +cN +cZ +do +dz +dz +dz +dz +dz +dz +dz +dz +do +dM +cN +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(26,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ae +ac +ac +aj +aD +aj +ac +ac +bu +bM +cg +cr +bu +cD +bE +bE +cS +cS +cS +cS +cS +cS +dG +dG +cS +cS +cS +cS +cS +cS +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(27,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +ad +aj +aj +aC +aj +aj +aj +bu +bu +ch +cs +cs +cE +bO +bO +cT +da +dp +dl +dl +dl +dl +dl +dl +dl +dl +dp +dl +cS +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(28,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +af +aj +ap +aD +aS +bd +bo +bw +bN +ci +ct +bN +cF +bN +bN +cU +db +dl +dl +dl +dl +dl +dl +dl +dl +dl +dl +dl +cS +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(29,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +af +aj +aq +aE +aT +be +be +bx +bO +cj +bE +bE +cA +bE +bE +cS +dc +dc +dA +dl +dD +dc +dc +dA +dl +dD +dc +dc +cS +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(30,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +af +aj +ar +aF +aD +bf +bp +aj +bP +cc +bE +bE +cA +bE +bE +cS +dd +dq +dB +dl +dE +dH +dI +dB +dl +dE +dJ +dN +cS +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(31,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +af +ak +ak +ak +aU +ak +ak +ak +bQ +cc +bE +bE +cA +bE +bE +cS +de +dr +dB +dl +dE +dH +dI +dB +dl +dE +dJ +dO +cS +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(32,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +af +ak +as +aG +aV +bg +bq +ak +bR +cc +bE +bE +cA +bE +bE +cV +df +ds +dB +dl +dE +dH +dI +dB +dl +dE +dJ +dN +cS +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(33,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +af +ak +at +aH +aW +bh +br +ak +bS +cc +bE +bE +cA +bE +bE +cV +dg +dt +dB +dl +dE +dH +dI +dB +dl +dE +dJ +dN +cS +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(34,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +af +ak +au +aI +aX +aI +aI +ak +bT +cc +co +bE +cA +bE +bE +cV +dh +du +dB +dl +dE +dH +dI +dB +dl +dE +dJ +dP +cS +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(35,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +af +ak +av +av +av +av +av +by +by +ck +by +cx +cG +by +by +by +di +dv +dB +dl +dE +dH +dI +dB +dl +dE +dJ +dQ +cS +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(36,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +af +ak +av +aJ +aK +aL +av +by +bU +cl +cu +cu +cH +cI +cJ +by +dj +dw +dB +dl +dE +dH +dI +dB +dl +dE +dJ +dR +cS +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(37,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +af +ak +av +aK +av +bi +av +by +bV +cm +cm +cm +cm +cm +cK +by +dk +dk +dC +dl +dF +dk +dk +dC +dl +dF +dk +dk +cS +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(38,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +af +ak +av +aL +aK +aJ +av +by +bW +cm +cm +cm +cm +cm +cL +by +dl +dl +dl +dl +dl +dl +dl +dl +dl +dl +dl +dl +cS +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(39,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +af +ak +av +av +aY +av +av +by +bX +cm +cm +cy +cm +cm +cM +by +dl +dx +dl +dl +dl +dl +dl +dl +dl +dl +dx +dl +cS +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(40,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +af +ak +ak +ak +ak +ak +ak +by +by +cn +by +cn +by +cn +by +by +cS +cS +cS +cS +cS +cS +cS +cS +cS +cS +cS +cS +cS +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(41,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +af +af +af +af +af +af +af +af +af +af +by +cz +by +af +af +af +af +af +af +af +af +af +af +af +af +af +af +af +af +af +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(42,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ad +ad +ad +ad +ad +ad +ad +ad +ad +ad +ad +by +cn +by +ad +ad +ad +ad +ad +ad +ad +ad +ad +ad +ad +ad +ad +ad +ad +ad +ad +ad +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(43,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ac +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(44,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +ab +aa +aa +aa +aa +aa +aa +aa +aa +"} +(45,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +"} +(46,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +"} +(47,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +"} +(48,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +"} +(49,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +"} +(50,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +"} +(51,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +"} +(52,1,1) = {" +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa +aa "} diff --git a/_maps/shuttles/emergency_pubby.dmm b/_maps/shuttles/emergency_pubby.dmm index d73b5563b33..ced48fe48b9 100644 --- a/_maps/shuttles/emergency_pubby.dmm +++ b/_maps/shuttles/emergency_pubby.dmm @@ -177,6 +177,9 @@ /obj/item/weapon/twohanded/required/kirbyplants{ icon_state = "plant-22" }, +/obj/machinery/light{ + dir = 1 + }, /turf/open/floor/mineral/titanium/blue, /area/shuttle/escape) "aG" = ( @@ -421,11 +424,11 @@ ab ab ab ab -aI +ao aL aL aL -aT +ao ab ab ab @@ -445,7 +448,7 @@ ao ao ao ao -ao +aT ab aV aY @@ -525,7 +528,7 @@ ao ao ao ao -ao +aT ab aW aZ @@ -541,11 +544,11 @@ ab ab ab ab -aI +ao aK aK aK -aT +ao ab ab ab diff --git a/code/__DATASTRUCTURES/globals.dm b/code/__DATASTRUCTURES/globals.dm index f9b5281212e..bcc860245fe 100644 --- a/code/__DATASTRUCTURES/globals.dm +++ b/code/__DATASTRUCTURES/globals.dm @@ -16,6 +16,7 @@ #define GLOBAL_PROTECT(X) #endif +#define GLOBAL_REAL_VAR(X) var/global/##X #define GLOBAL_REAL(X, Typepath) var/global##Typepath/##X #define GLOBAL_RAW(X) /datum/controller/global_vars/var/global##X diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 28e4a262fdc..5b0bdbc11e2 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -37,6 +37,9 @@ #define BODYPART_ORGANIC 1 #define BODYPART_ROBOTIC 2 +#define DEFAULT_BODYPART_ICON_ORGANIC 'icons/mob/human_parts_greyscale.dmi' +#define DEFAULT_BODYPART_ICON_ROBOTIC 'icons/mob/augments.dmi' + #define MONKEY_BODYPART "monkey" #define ALIEN_BODYPART "alien" #define LARVA_BODYPART "larva" diff --git a/code/__DEFINES/sound.dm b/code/__DEFINES/sound.dm index 94ed5dc7b98..77c263cadad 100644 --- a/code/__DEFINES/sound.dm +++ b/code/__DEFINES/sound.dm @@ -2,7 +2,10 @@ #define CHANNEL_LOBBYMUSIC 1024 #define CHANNEL_ADMIN 1023 #define CHANNEL_VOX 1022 +#define CHANNEL_JUKEBOX 1021 //THIS SHOULD ALWAYS BE THE LOWEST ONE! //KEEP IT UPDATED -#define CHANNEL_HIGHEST_AVAILABLE 1021 + +#define CHANNEL_HIGHEST_AVAILABLE 1020 + diff --git a/code/orphaned_procs/AStar.dm b/code/__HELPERS/AStar.dm similarity index 100% rename from code/orphaned_procs/AStar.dm rename to code/__HELPERS/AStar.dm diff --git a/code/orphaned_procs/priority_announce.dm b/code/__HELPERS/priority_announce.dm similarity index 100% rename from code/orphaned_procs/priority_announce.dm rename to code/__HELPERS/priority_announce.dm diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index 853ff4fb6ad..f78c40fbe15 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -19,7 +19,7 @@ return copytext(sqltext, 2, lentext(sqltext));//Quote() adds quotes around input, we already do that /proc/format_table_name(table as text) - return GLOB.sqlfdbktableprefix + table + return global.sqlfdbktableprefix + table /* * Text sanitization diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index e1c34dc0c9c..73b4c33620b 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1279,6 +1279,9 @@ proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types()) #define QDEL_IN(item, time) addtimer(CALLBACK(GLOBAL_PROC, .proc/qdel, item), time, TIMER_STOPPABLE) #define QDEL_NULL(item) qdel(item); item = null +#define QDEL_LIST(L) if(L) { for(var/I in L) qdel(I); L.Cut(); } +#define QDEL_LIST_ASSOC(L) if(L) { for(var/I in L) { qdel(L[I]); qdel(I); } L.Cut(); } +#define QDEL_LIST_ASSOC_VAL(L) if(L) { for(var/I in L) qel(L[I]); L.Cut(); } /proc/random_nukecode() var/val = rand(0, 99999) diff --git a/code/_globalvars/configuration.dm b/code/_globalvars/configuration.dm index e8833f77aa0..23bfdd39870 100644 --- a/code/_globalvars/configuration.dm +++ b/code/_globalvars/configuration.dm @@ -23,20 +23,6 @@ GLOBAL_VAR_INIT(tinted_weldhelh, TRUE) GLOBAL_VAR_INIT(Debug, FALSE) // global debug switch GLOBAL_VAR_INIT(Debug2, FALSE) -//Server API key -GLOBAL_VAR_INIT(comms_key, "default_pwd") -GLOBAL_PROTECT(comms_key) -GLOBAL_VAR_INIT(comms_allowed, FALSE) //By default, the server does not allow messages to be sent to it, unless the key is strong enough (this is to prevent misconfigured servers from becoming vulnerable) -GLOBAL_PROTECT(comms_allowed) - -GLOBAL_VAR(medal_hub) -GLOBAL_PROTECT(medal_hub) -GLOBAL_VAR_INIT(medal_pass, " ") -GLOBAL_PROTECT(medal_pass) -GLOBAL_VAR_INIT(medals_enabled, TRUE) //will be auto set to false if the game fails contacting the medal hub to prevent unneeded calls. -GLOBAL_PROTECT(medals_enabled) - - //This was a define, but I changed it to a variable so it can be changed in-game.(kept the all-caps definition because... code...) -Errorage GLOBAL_VAR_INIT(MAX_EX_DEVESTATION_RANGE, 3) GLOBAL_VAR_INIT(MAX_EX_HEAVY_RANGE, 7) diff --git a/code/_globalvars/database.dm b/code/_globalvars/database.dm deleted file mode 100644 index 8ba72517ce6..00000000000 --- a/code/_globalvars/database.dm +++ /dev/null @@ -1,19 +0,0 @@ - // MySQL configuration - -GLOBAL_VAR_INIT(sqladdress, "localhost") -GLOBAL_PROTECT(sqladdress) -GLOBAL_VAR_INIT(sqlport, "3306") -GLOBAL_PROTECT(sqlport) -GLOBAL_VAR_INIT(sqlfdbkdb, "test") -GLOBAL_PROTECT(sqlfdbkdb) -GLOBAL_VAR_INIT(sqlfdbklogin, "root") -GLOBAL_PROTECT(sqlfdbklogin) -GLOBAL_VAR_INIT(sqlfdbkpass, "") -GLOBAL_PROTECT(sqlfdbkpass) -GLOBAL_VAR_INIT(sqlfdbktableprefix, "erro_") //backwords compatibility with downstream server hosts -GLOBAL_PROTECT(sqlfdbktableprefix) - -//Database connections -//A connection is established on world creation. Ideally, the connection dies when the server restarts (After feedback logging.). -GLOBAL_DATUM_INIT(dbcon, /DBConnection, new) //Feedback database (New database) -GLOBAL_PROTECT(dbcon) diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm index ea89f3e4e7c..a7763236e6e 100644 --- a/code/_globalvars/misc.dm +++ b/code/_globalvars/misc.dm @@ -6,4 +6,16 @@ GLOBAL_VAR_INIT(timezoneOffset, 0) // The difference betwen midnight (of the hos // However it'd be ok to use for accessing attack logs and such too, which are even laggier. GLOBAL_VAR_INIT(fileaccess_timer, 0) -GLOBAL_VAR_INIT(TAB, " ") \ No newline at end of file +GLOBAL_VAR_INIT(TAB, " ") + +GLOBAL_DATUM(data_core, /datum/datacore) + +GLOBAL_VAR_INIT(CELLRATE, 0.002) // multiplier for watts per tick <> cell storage (eg: .002 means if there is a load of 1000 watts, 20 units will be taken from a cell per second) +GLOBAL_VAR_INIT(CHARGELEVEL, 0.001) // Cap for how fast cells charge, as a percentage-per-tick (.001 means cellcharge is capped to 1% per second) + +GLOBAL_LIST_EMPTY(powernets) + +//Database connections +//A connection is established on world creation. Ideally, the connection dies when the server restarts (After feedback logging.). +GLOBAL_DATUM_INIT(dbcon, /DBConnection, new) //Feedback database (New database) +GLOBAL_PROTECT(dbcon) \ No newline at end of file diff --git a/code/_globalvars/sensitive.dm b/code/_globalvars/sensitive.dm new file mode 100644 index 00000000000..786287f96fd --- /dev/null +++ b/code/_globalvars/sensitive.dm @@ -0,0 +1,16 @@ +//Server API key +GLOBAL_REAL_VAR(comms_key) = "default_pwd" +GLOBAL_REAL_VAR(comms_allowed) = FALSE //By default, the server does not allow messages to be sent to it, unless the key is strong enough (this is to prevent misconfigured servers from becoming vulnerable) + +GLOBAL_REAL_VAR(medal_hub) +GLOBAL_REAL_VAR(medal_pass) = " " +GLOBAL_REAL_VAR(medals_enabled) = TRUE //will be auto set to false if the game fails contacting the medal hub to prevent unneeded calls. + +// MySQL configuration + +GLOBAL_REAL_VAR(sqladdress) = "localhost" +GLOBAL_REAL_VAR(sqlport) = "3306" +GLOBAL_REAL_VAR(sqlfdbkdb) = "test" +GLOBAL_REAL_VAR(sqlfdbklogin) = "root" +GLOBAL_REAL_VAR(sqlfdbkpass) = "" +GLOBAL_REAL_VAR(sqlfdbktableprefix) = "erro_" \ No newline at end of file diff --git a/code/_globalvars/station.dm b/code/_globalvars/station.dm deleted file mode 100644 index 7af03b7ce35..00000000000 --- a/code/_globalvars/station.dm +++ /dev/null @@ -1,6 +0,0 @@ -GLOBAL_DATUM(data_core, /datum/datacore) - -GLOBAL_VAR_INIT(CELLRATE, 0.002) // multiplier for watts per tick <> cell storage (eg: .002 means if there is a load of 1000 watts, 20 units will be taken from a cell per second) -GLOBAL_VAR_INIT(CHARGELEVEL, 0.001) // Cap for how fast cells charge, as a percentage-per-tick (.001 means cellcharge is capped to 1% per second) - -GLOBAL_LIST_EMPTY(powernets) \ No newline at end of file diff --git a/code/_onclick/cyborg.dm b/code/_onclick/cyborg.dm index 578e6cd3789..c52b3441db2 100644 --- a/code/_onclick/cyborg.dm +++ b/code/_onclick/cyborg.dm @@ -22,6 +22,9 @@ if(modifiers["shift"] && modifiers["ctrl"]) CtrlShiftClickOn(A) return + if(modifiers["shift"] && modifiers["middle"]) + ShiftMiddleClickOn(A) + return if(modifiers["middle"]) MiddleClickOn(A) return diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index e83cfadedf5..9c8fe9750a9 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -266,8 +266,8 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." icon_state = "no-servants-caches" var/static/list/scripture_states = list(SCRIPTURE_DRIVER = TRUE, SCRIPTURE_SCRIPT = FALSE, SCRIPTURE_APPLICATION = FALSE, SCRIPTURE_REVENANT = FALSE, SCRIPTURE_JUDGEMENT = FALSE) -/obj/screen/alert/clockwork/scripture_reqs/New() - ..() +/obj/screen/alert/clockwork/scripture_reqs/Initialize() + . = ..() START_PROCESSING(SSprocessing, src) process() diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 95fc6aa6228..1aa1f3d4fac 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -276,6 +276,18 @@ qdel(M) votable_modes += "secret" + Reload() + +/datum/configuration/proc/Reload() + load("config/config.txt") + load("config/game_options.txt","game_options") + loadsql("config/dbconfig.txt") + if (maprotation) + loadmaplist("config/maps.txt") + + // apply some settings from config.. + GLOB.abandon_allowed = respawn + /datum/configuration/proc/load(filename, type = "config") //the type can also be game_options, in which case it uses a different switch. not making it separate to not copypaste code - Urist var/list/Lines = file2list(filename) @@ -305,109 +317,109 @@ if(type == "config") switch(name) if("hub") - config.hub = 1 + hub = 1 if("admin_legacy_system") - config.admin_legacy_system = 1 + admin_legacy_system = 1 if("ban_legacy_system") - config.ban_legacy_system = 1 + ban_legacy_system = 1 if("use_age_restriction_for_jobs") - config.use_age_restriction_for_jobs = 1 + use_age_restriction_for_jobs = 1 if("use_account_age_for_jobs") - config.use_account_age_for_jobs = 1 + use_account_age_for_jobs = 1 if("lobby_countdown") - config.lobby_countdown = text2num(value) + lobby_countdown = text2num(value) if("round_end_countdown") - config.round_end_countdown = text2num(value) + round_end_countdown = text2num(value) if("log_ooc") - config.log_ooc = 1 + log_ooc = 1 if("log_access") - config.log_access = 1 + log_access = 1 if("log_say") - config.log_say = 1 + log_say = 1 if("log_admin") - config.log_admin = 1 + log_admin = 1 if("log_prayer") - config.log_prayer = 1 + log_prayer = 1 if("log_law") - config.log_law = 1 + log_law = 1 if("log_game") - config.log_game = 1 + log_game = 1 if("log_vote") - config.log_vote = 1 + log_vote = 1 if("log_whisper") - config.log_whisper = 1 + log_whisper = 1 if("log_attack") - config.log_attack = 1 + log_attack = 1 if("log_emote") - config.log_emote = 1 + log_emote = 1 if("log_adminchat") - config.log_adminchat = 1 + log_adminchat = 1 if("log_pda") - config.log_pda = 1 + log_pda = 1 if("log_hrefs") - config.log_hrefs = 1 + log_hrefs = 1 if("log_twitter") - config.log_twitter = 1 + log_twitter = 1 if("log_world_topic") - config.log_world_topic = 1 + log_world_topic = 1 if("allow_admin_ooccolor") - config.allow_admin_ooccolor = 1 + allow_admin_ooccolor = 1 if("allow_vote_restart") - config.allow_vote_restart = 1 + allow_vote_restart = 1 if("allow_vote_mode") - config.allow_vote_mode = 1 + allow_vote_mode = 1 if("no_dead_vote") - config.vote_no_dead = 1 + vote_no_dead = 1 if("default_no_vote") - config.vote_no_default = 1 + vote_no_default = 1 if("vote_delay") - config.vote_delay = text2num(value) + vote_delay = text2num(value) if("vote_period") - config.vote_period = text2num(value) + vote_period = text2num(value) if("norespawn") - config.respawn = 0 + respawn = 0 if("servername") - config.server_name = value + server_name = value if("serversqlname") - config.server_sql_name = value + server_sql_name = value if("stationname") - config.station_name = value + station_name = value if("hostedby") - config.hostedby = value + hostedby = value if("server") - config.server = value + server = value if("banappeals") - config.banappeals = value + banappeals = value if("wikiurl") - config.wikiurl = value + wikiurl = value if("forumurl") - config.forumurl = value + forumurl = value if("rulesurl") - config.rulesurl = value + rulesurl = value if("githuburl") - config.githuburl = value + githuburl = value if("githubrepoid") - config.githubrepoid = value + githubrepoid = value if("guest_jobban") - config.guest_jobban = 1 + guest_jobban = 1 if("guest_ban") GLOB.guests_allowed = 0 if("usewhitelist") - config.usewhitelist = TRUE + usewhitelist = TRUE if("allow_metadata") - config.allow_Metadata = 1 + allow_Metadata = 1 if("kick_inactive") if(value < 1) value = INACTIVITY_KICK - config.kick_inactive = value + kick_inactive = value if("load_jobs_from_txt") load_jobs_from_txt = 1 if("forbid_singulo_possession") forbid_singulo_possession = 1 if("popup_admin_pm") - config.popup_admin_pm = 1 + popup_admin_pm = 1 if("allow_holidays") - config.allow_holidays = 1 + allow_holidays = 1 if("useircbot") useircbot = 1 if("ticklag") @@ -421,9 +433,9 @@ if("automute_on") automute_on = 1 if("comms_key") - GLOB.comms_key = value + global.comms_key = value if(value != "default_pwd" && length(value) > 6) //It's the default value or less than 6 characters long, warn badmins - GLOB.comms_allowed = 1 + global.comms_allowed = 1 if("cross_server_address") cross_address = value if(value != "byond:\\address:port") @@ -437,46 +449,46 @@ if(value != "byond:\\address:port") allow_panic_bunker_bounce = 1 if("medal_hub_address") - GLOB.medal_hub = value + global.medal_hub = value if("medal_hub_password") - GLOB.medal_pass = value + global.medal_pass = value if("show_irc_name") - config.showircname = 1 + showircname = 1 if("see_own_notes") - config.see_own_notes = 1 + see_own_notes = 1 if("soft_popcap") - config.soft_popcap = text2num(value) + soft_popcap = text2num(value) if("hard_popcap") - config.hard_popcap = text2num(value) + hard_popcap = text2num(value) if("extreme_popcap") - config.extreme_popcap = text2num(value) + extreme_popcap = text2num(value) if("soft_popcap_message") - config.soft_popcap_message = value + soft_popcap_message = value if("hard_popcap_message") - config.hard_popcap_message = value + hard_popcap_message = value if("extreme_popcap_message") - config.extreme_popcap_message = value + extreme_popcap_message = value if("panic_bunker") - config.panic_bunker = 1 + panic_bunker = 1 if("notify_new_player_age") - config.notify_new_player_age = text2num(value) + notify_new_player_age = text2num(value) if("irc_first_connection_alert") - config.irc_first_connection_alert = 1 + irc_first_connection_alert = 1 if("check_randomizer") - config.check_randomizer = 1 + check_randomizer = 1 if("ipintel_email") if (value != "ch@nge.me") - config.ipintel_email = value + ipintel_email = value if("ipintel_rating_bad") - config.ipintel_rating_bad = text2num(value) + ipintel_rating_bad = text2num(value) if("ipintel_domain") - config.ipintel_domain = value + ipintel_domain = value if("ipintel_save_good") - config.ipintel_save_good = text2num(value) + ipintel_save_good = text2num(value) if("ipintel_save_bad") - config.ipintel_save_bad = text2num(value) + ipintel_save_bad = text2num(value) if("aggressive_changelog") - config.aggressive_changelog = 1 + aggressive_changelog = 1 if("log_runtimes") log_runtimes = TRUE var/newlog = file("data/logs/runtimes/runtime-[time2text(world.realtime, "YYYY-MM-DD")].log") @@ -484,39 +496,39 @@ world.log << "Now logging runtimes to data/logs/runtimes/runtime-[time2text(world.realtime, "YYYY-MM-DD")].log" GLOB.runtime_diary = newlog if("autoconvert_notes") - config.autoconvert_notes = 1 + autoconvert_notes = 1 if("allow_webclient") - config.allowwebclient = 1 + allowwebclient = 1 if("webclient_only_byond_members") - config.webclientmembersonly = 1 + webclientmembersonly = 1 if("announce_admin_logout") - config.announce_admin_logout = 1 + announce_admin_logout = 1 if("announce_admin_login") - config.announce_admin_login = 1 + announce_admin_login = 1 if("maprotation") - config.maprotation = 1 + maprotation = 1 if("allow_map_voting") - config.allow_map_voting = text2num(value) + allow_map_voting = text2num(value) if("maprotationchancedelta") - config.maprotatechancedelta = text2num(value) + maprotatechancedelta = text2num(value) if("autoadmin") - config.autoadmin = 1 + autoadmin = 1 if(value) - config.autoadmin_rank = ckeyEx(value) + autoadmin_rank = ckeyEx(value) if("generate_minimaps") - config.generate_minimaps = 1 + generate_minimaps = 1 if("client_warn_version") - config.client_warn_version = text2num(value) + client_warn_version = text2num(value) if("client_warn_message") - config.client_warn_message = value + client_warn_message = value if("client_error_version") - config.client_error_version = text2num(value) + client_error_version = text2num(value) if("client_error_message") - config.client_error_message = value + client_error_message = value if("minute_topic_limit") - config.minutetopiclimit = text2num(value) + minutetopiclimit = text2num(value) if("second_topic_limit") - config.secondtopiclimit = text2num(value) + secondtopiclimit = text2num(value) if("error_cooldown") error_cooldown = text2num(value) if("error_limit") @@ -531,75 +543,75 @@ else if(type == "game_options") switch(name) if("damage_multiplier") - config.damage_multiplier = text2num(value) + damage_multiplier = text2num(value) if("revival_pod_plants") - config.revival_pod_plants = text2num(value) + revival_pod_plants = text2num(value) if("revival_cloning") - config.revival_cloning = text2num(value) + revival_cloning = text2num(value) if("revival_brain_life") - config.revival_brain_life = text2num(value) + revival_brain_life = text2num(value) if("rename_cyborg") - config.rename_cyborg = 1 + rename_cyborg = 1 if("ooc_during_round") - config.ooc_during_round = 1 + ooc_during_round = 1 if("emojis") - config.emojis = 1 + emojis = 1 if("run_delay") - config.run_speed = text2num(value) + run_speed = text2num(value) if("walk_delay") - config.walk_speed = text2num(value) + walk_speed = text2num(value) if("human_delay") - config.human_delay = text2num(value) + human_delay = text2num(value) if("robot_delay") - config.robot_delay = text2num(value) + robot_delay = text2num(value) if("monkey_delay") - config.monkey_delay = text2num(value) + monkey_delay = text2num(value) if("alien_delay") - config.alien_delay = text2num(value) + alien_delay = text2num(value) if("slime_delay") - config.slime_delay = text2num(value) + slime_delay = text2num(value) if("animal_delay") - config.animal_delay = text2num(value) + animal_delay = text2num(value) if("alert_red_upto") - config.alert_desc_red_upto = value + alert_desc_red_upto = value if("alert_red_downto") - config.alert_desc_red_downto = value + alert_desc_red_downto = value if("alert_blue_downto") - config.alert_desc_blue_downto = value + alert_desc_blue_downto = value if("alert_blue_upto") - config.alert_desc_blue_upto = value + alert_desc_blue_upto = value if("alert_green") - config.alert_desc_green = value + alert_desc_green = value if("alert_delta") - config.alert_desc_delta = value + alert_desc_delta = value if("no_intercept_report") - config.intercept = 0 + intercept = 0 if("assistants_have_maint_access") - config.jobs_have_maint_access |= ASSISTANTS_HAVE_MAINT_ACCESS + jobs_have_maint_access |= ASSISTANTS_HAVE_MAINT_ACCESS if("security_has_maint_access") - config.jobs_have_maint_access |= SECURITY_HAS_MAINT_ACCESS + jobs_have_maint_access |= SECURITY_HAS_MAINT_ACCESS if("everyone_has_maint_access") - config.jobs_have_maint_access |= EVERYONE_HAS_MAINT_ACCESS + jobs_have_maint_access |= EVERYONE_HAS_MAINT_ACCESS if("sec_start_brig") - config.sec_start_brig = 1 + sec_start_brig = 1 if("gateway_delay") - config.gateway_delay = text2num(value) + gateway_delay = text2num(value) if("continuous") var/mode_name = lowertext(value) - if(mode_name in config.modes) - config.continuous[mode_name] = 1 + if(mode_name in modes) + continuous[mode_name] = 1 else GLOB.diary << "Unknown continuous configuration definition: [mode_name]." if("midround_antag") var/mode_name = lowertext(value) - if(mode_name in config.modes) - config.midround_antag[mode_name] = 1 + if(mode_name in modes) + midround_antag[mode_name] = 1 else GLOB.diary << "Unknown midround antagonist configuration definition: [mode_name]." if("midround_antag_time_check") - config.midround_antag_time_check = text2num(value) + midround_antag_time_check = text2num(value) if("midround_antag_life_check") - config.midround_antag_life_check = text2num(value) + midround_antag_life_check = text2num(value) if("min_pop") var/pop_pos = findtext(value, " ") var/mode_name = null @@ -608,8 +620,8 @@ if(pop_pos) mode_name = lowertext(copytext(value, 1, pop_pos)) mode_value = copytext(value, pop_pos + 1) - if(mode_name in config.modes) - config.min_pop[mode_name] = text2num(mode_value) + if(mode_name in modes) + min_pop[mode_name] = text2num(mode_value) else GLOB.diary << "Unknown minimum population configuration definition: [mode_name]." else @@ -622,28 +634,28 @@ if(pop_pos) mode_name = lowertext(copytext(value, 1, pop_pos)) mode_value = copytext(value, pop_pos + 1) - if(mode_name in config.modes) - config.max_pop[mode_name] = text2num(mode_value) + if(mode_name in modes) + max_pop[mode_name] = text2num(mode_value) else GLOB.diary << "Unknown maximum population configuration definition: [mode_name]." else GLOB.diary << "Incorrect maximum population configuration definition: [mode_name] [mode_value]." if("shuttle_refuel_delay") - config.shuttle_refuel_delay = text2num(value) + shuttle_refuel_delay = text2num(value) if("show_game_type_odds") - config.show_game_type_odds = 1 + show_game_type_odds = 1 if("ghost_interaction") - config.ghost_interaction = 1 + ghost_interaction = 1 if("traitor_scaling_coeff") - config.traitor_scaling_coeff = text2num(value) + traitor_scaling_coeff = text2num(value) if("changeling_scaling_coeff") - config.changeling_scaling_coeff = text2num(value) + changeling_scaling_coeff = text2num(value) if("security_scaling_coeff") - config.security_scaling_coeff = text2num(value) + security_scaling_coeff = text2num(value) if("abductor_scaling_coeff") - config.abductor_scaling_coeff = text2num(value) + abductor_scaling_coeff = text2num(value) if("traitor_objectives_amount") - config.traitor_objectives_amount = text2num(value) + traitor_objectives_amount = text2num(value) if("probability") var/prob_pos = findtext(value, " ") var/prob_name = null @@ -652,51 +664,51 @@ if(prob_pos) prob_name = lowertext(copytext(value, 1, prob_pos)) prob_value = copytext(value, prob_pos + 1) - if(prob_name in config.modes) - config.probabilities[prob_name] = text2num(prob_value) + if(prob_name in modes) + probabilities[prob_name] = text2num(prob_value) else GLOB.diary << "Unknown game mode probability configuration definition: [prob_name]." else GLOB.diary << "Incorrect probability configuration definition: [prob_name] [prob_value]." if("protect_roles_from_antagonist") - config.protect_roles_from_antagonist = 1 + protect_roles_from_antagonist = 1 if("protect_assistant_from_antagonist") - config.protect_assistant_from_antagonist = 1 + protect_assistant_from_antagonist = 1 if("enforce_human_authority") - config.enforce_human_authority = 1 + enforce_human_authority = 1 if("allow_latejoin_antagonists") - config.allow_latejoin_antagonists = 1 + allow_latejoin_antagonists = 1 if("allow_random_events") - config.allow_random_events = 1 + allow_random_events = 1 if("events_min_time_mul") - config.events_min_time_mul = text2num(value) + events_min_time_mul = text2num(value) if("events_min_players_mul") - config.events_min_players_mul = text2num(value) + events_min_players_mul = text2num(value) if("minimal_access_threshold") - config.minimal_access_threshold = text2num(value) + minimal_access_threshold = text2num(value) if("jobs_have_minimal_access") - config.jobs_have_minimal_access = 1 + jobs_have_minimal_access = 1 if("humans_need_surnames") humans_need_surnames = 1 if("force_random_names") - config.force_random_names = 1 + force_random_names = 1 if("allow_ai") - config.allow_ai = 1 + allow_ai = 1 if("disable_secborg") - config.forbid_secborg = 1 + forbid_secborg = 1 if("disable_peaceborg") - config.forbid_peaceborg = 1 + forbid_peaceborg = 1 if("silent_ai") - config.silent_ai = 1 + silent_ai = 1 if("silent_borg") - config.silent_borg = 1 + silent_borg = 1 if("sandbox_autoclose") - config.sandbox_autoclose = 1 + sandbox_autoclose = 1 if("default_laws") - config.default_laws = text2num(value) + default_laws = text2num(value) if("random_laws") var/law_id = lowertext(value) lawids += law_id @@ -711,9 +723,9 @@ law_weights[lawid] = weight if("silicon_max_law_amount") - config.silicon_max_law_amount = text2num(value) + silicon_max_law_amount = text2num(value) if("join_with_mutant_race") - config.mutant_races = 1 + mutant_races = 1 if("roundstart_races") var/race_id = lowertext(value) for(var/species_id in GLOB.species_list) @@ -721,25 +733,25 @@ roundstart_races += GLOB.species_list[species_id] GLOB.roundstart_species[species_id] = GLOB.species_list[species_id] if("join_with_mutant_humans") - config.mutant_humans = 1 + mutant_humans = 1 if("assistant_cap") - config.assistant_cap = text2num(value) + assistant_cap = text2num(value) if("starlight") - config.starlight = 1 + starlight = 1 if("grey_assistants") - config.grey_assistants = 1 + grey_assistants = 1 if("lavaland_budget") - config.lavaland_budget = text2num(value) + lavaland_budget = text2num(value) if("space_budget") - config.space_budget = text2num(value) + space_budget = text2num(value) if("no_summon_guns") - config.no_summon_guns = 1 + no_summon_guns = 1 if("no_summon_magic") - config.no_summon_magic = 1 + no_summon_magic = 1 if("no_summon_events") - config.no_summon_events = 1 + no_summon_events = 1 if("reactionary_explosions") - config.reactionary_explosions = 1 + reactionary_explosions = 1 if("bombcap") var/BombCap = text2num(value) if (!BombCap) @@ -753,13 +765,13 @@ GLOB.MAX_EX_FLASH_RANGE = BombCap GLOB.MAX_EX_FLAME_RANGE = BombCap if("arrivals_shuttle_dock_window") - config.arrivals_shuttle_dock_window = max(PARALLAX_LOOP_TIME, text2num(value)) + arrivals_shuttle_dock_window = max(PARALLAX_LOOP_TIME, text2num(value)) if("arrivals_shuttle_require_safe_latejoin") - config.arrivals_shuttle_require_safe_latejoin = text2num(value) + arrivals_shuttle_require_safe_latejoin = text2num(value) if ("mentor_mobname_only") - config.mentors_mobname_only = 1 + mentors_mobname_only = 1 if ("mentor_legacy_system") - config.mentor_legacy_system = 1 + mentor_legacy_system = 1 else GLOB.diary << "Unknown setting in configuration: '[name]'" @@ -810,9 +822,9 @@ if ("weight","voteweight") currentmap.voteweight = text2num(data) if ("default","defaultmap") - config.defaultmap = currentmap + defaultmap = currentmap if ("endmap") - config.maplist[currentmap.map_name] = currentmap + maplist[currentmap.map_name] = currentmap currentmap = null else GLOB.diary << "Unknown command in map vote config: '[command]'" @@ -845,19 +857,19 @@ switch(name) if("sql_enabled") - config.sql_enabled = 1 + sql_enabled = 1 if("address") - GLOB.sqladdress = value + global.sqladdress = value if("port") - GLOB.sqlport = value + global.sqlport = value if("feedback_database") - GLOB.sqlfdbkdb = value + global.sqlfdbkdb = value if("feedback_login") - GLOB.sqlfdbklogin = value + global.sqlfdbklogin = value if("feedback_password") - GLOB.sqlfdbkpass = value + global.sqlfdbkpass = value if("feedback_tableprefix") - GLOB.sqlfdbktableprefix = value + global.sqlfdbktableprefix = value else GLOB.diary << "Unknown setting in configuration: '[name]'" @@ -915,4 +927,4 @@ if(!statclick) statclick = new/obj/effect/statclick/debug(null, "Edit", src) - stat("[name]:", statclick) \ No newline at end of file + stat("[name]:", statclick) diff --git a/code/controllers/master.dm b/code/controllers/master.dm index 259524bb0c9..b4c5bc7d6d7 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -10,6 +10,10 @@ //This is the ABSOLUTE ONLY THING that should init globally like this GLOBAL_REAL(Master, /datum/controller/master) = new +//THIS IS THE INIT ORDER +//Master -> SSPreInit -> GLOB -> world -> config -> SSInit -> Failsafe +//GOT IT MEMORIZED? + GLOBAL_VAR_INIT(MC_restart_clear, 0) GLOBAL_VAR_INIT(MC_restart_timeout, 0) GLOBAL_VAR_INIT(MC_restart_count, 0) @@ -65,7 +69,7 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING) else init_subtypes(/datum/controller/subsystem, subsystems) Master = src - + if(!GLOB) new /datum/controller/global_vars diff --git a/code/controllers/subsystem/garbage.dm b/code/controllers/subsystem/garbage.dm index 1fff5c64304..f0bfb6a76a2 100644 --- a/code/controllers/subsystem/garbage.dm +++ b/code/controllers/subsystem/garbage.dm @@ -47,6 +47,21 @@ SUBSYSTEM_DEF(garbage) msg += "TGR:[round((totalgcs/(totaldels+totalgcs))*100, 0.01)]%" ..(msg) +/datum/controller/subsystem/garbage/Shutdown() + //Adds the del() log to world.log in a format condensable by the runtime condenser found in tools + if(didntgc.len || sleptDestroy.len) + var/list/dellog = list() + for(var/path in didntgc) + dellog += "Path : [path] \n" + dellog += "Failures : [didntgc[path]] \n" + if(path in sleptDestroy) + dellog += "Sleeps : [sleptDestroy[path]] \n" + sleptDestroy -= path + for(var/path in sleptDestroy) + dellog += "Path : [path] \n" + dellog += "Sleeps : [sleptDestroy[path]] \n" + log_world(dellog.Join()) + /datum/controller/subsystem/garbage/fire() HandleToBeQueued() if(state == SS_RUNNING) diff --git a/code/datums/action.dm b/code/datums/action.dm index 03b293b13dc..63de6b19e37 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -198,6 +198,9 @@ if(target == C.internal) button.icon_state = "template_active" +/datum/action/item_action/pick_color + name = "Choose A Color" + /datum/action/item_action/toggle_mister name = "Toggle Mister" diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 81079c5621f..c40f39eb192 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -340,7 +340,7 @@ target="_parent._top" onmouseclick="this.focus()" style="background-color:#ffffff"> - <option value>Select option</option> + <option value selected>Select option</option> [dropdownoptions_html.Join()] </select> </form> @@ -1084,7 +1084,7 @@ if("augment") if(ishuman(C)) if(BP) - BP.change_bodypart_status(BODYPART_ROBOTIC, 1) + BP.change_bodypart_status(BODYPART_ROBOTIC, TRUE, TRUE) else to_chat(usr, "[C] doesn't have such bodypart.") else diff --git a/code/datums/dna.dm b/code/datums/dna.dm index ecc3e121f08..51509382582 100644 --- a/code/datums/dna.dm +++ b/code/datums/dna.dm @@ -247,13 +247,10 @@ dna.struc_enzymes = se domutcheck() - give_genitals(1) - if(mrace || newfeatures || ui) update_body() update_hair() update_body_parts() - update_genitals() update_mutations_overlay() diff --git a/code/datums/martial/krav_maga.dm b/code/datums/martial/krav_maga.dm index 1a193db87ba..5bc9b0588b6 100644 --- a/code/datums/martial/krav_maga.dm +++ b/code/datums/martial/krav_maga.dm @@ -12,9 +12,13 @@ if(owner.incapacitated()) to_chat(owner, "<span class='warning'>You can't use Krav Maga while you're incapacitated.</span>") return - owner.visible_message("<span class='danger'>[owner] assumes the Neck Chop stance!</span>", "<b><i>Your next attack will be a Neck Chop.</i></b>") var/mob/living/carbon/human/H = owner - H.martial_art.streak = "neck_chop" + if (H.martial_art.streak == "neck_chop") + owner.visible_message("<span class='danger'>[owner] assumes a neutral stance.</span>", "<b><i>Your next attack is cleared.</i></b>") + H.martial_art.streak = "" + else + owner.visible_message("<span class='danger'>[owner] assumes the Neck Chop stance!</span>", "<b><i>Your next attack will be a Neck Chop.</i></b>") + H.martial_art.streak = "neck_chop" /datum/action/leg_sweep name = "Leg Sweep - Trips the victim, knocking them down for a brief moment." @@ -24,9 +28,13 @@ if(owner.incapacitated()) to_chat(owner, "<span class='warning'>You can't use Krav Maga while you're incapacitated.</span>") return - owner.visible_message("<span class='danger'>[owner] assumes the Leg Sweep stance!</span>", "<b><i>Your next attack will be a Leg Sweep.</i></b>") var/mob/living/carbon/human/H = owner - H.martial_art.streak = "leg_sweep" + if (H.martial_art.streak == "leg_sweep") + owner.visible_message("<span class='danger'>[owner] assumes a neutral stance.</span>", "<b><i>Your next attack is cleared.</i></b>") + H.martial_art.streak = "" + else + owner.visible_message("<span class='danger'>[owner] assumes the Leg Sweep stance!</span>", "<b><i>Your next attack will be a Leg Sweep.</i></b>") + H.martial_art.streak = "leg_sweep" /datum/action/lung_punch//referred to internally as 'quick choke' name = "Lung Punch - Delivers a strong punch just above the victim's abdomen, constraining the lungs. The victim will be unable to breathe for a short time." @@ -36,9 +44,13 @@ if(owner.incapacitated()) to_chat(owner, "<span class='warning'>You can't use Krav Maga while you're incapacitated.</span>") return - owner.visible_message("<span class='danger'>[owner] assumes the Lung Punch stance!</span>", "<b><i>Your next attack will be a Lung Punch.</i></b>") var/mob/living/carbon/human/H = owner - H.martial_art.streak = "quick_choke"//internal name for lung punch + if (H.martial_art.streak == "quick_choke") + owner.visible_message("<span class='danger'>[owner] assumes a neutral stance.</span>", "<b><i>Your next attack is cleared.</i></b>") + H.martial_art.streak = "" + else + owner.visible_message("<span class='danger'>[owner] assumes the Lung Punch stance!</span>", "<b><i>Your next attack will be a Lung Punch.</i></b>") + H.martial_art.streak = "quick_choke"//internal name for lung punch /datum/martial_art/krav_maga/teach(var/mob/living/carbon/human/H,var/make_temporary=0) ..() diff --git a/code/datums/riding.dm b/code/datums/riding.dm index aa167307036..c069e0cdeb2 100644 --- a/code/datums/riding.dm +++ b/code/datums/riding.dm @@ -335,11 +335,11 @@ /datum/riding/human/ride_check(mob/living/M) var/mob/living/carbon/human/H = ridden //IF this runtimes I'm blaming the admins. if(M.incapacitated(FALSE, TRUE) || H.incapacitated(FALSE, TRUE)) - M.visible_message("<span class='boldwarning'>[M] falls off of [ridden]!</span>") + M.visible_message("<span class='warning'>[M] falls off [ridden]!</span>") Unbuckle(M) return FALSE if(M.restrained(TRUE)) - M.visible_message("<span class='boldwarning'>[M] can't hang onto [ridden] with their hands cuffed!</span>") //Honestly this should put the ridden mob in a chokehold. + M.visible_message("<span class='warning'>[M] can't hang onto [ridden] with their hands cuffed!</span>") //Honestly this should put the ridden mob in a chokehold. Unbuckle(M) return FALSE if(H.pulling == M) @@ -375,7 +375,7 @@ ridden.unbuckle_mob(user) user.Weaken(3) user.Stun(3) - user.visible_message("<span class='boldwarning'>[ridden] pushes [user] off of them!</span>") + user.visible_message("<span class='warning'>[ridden] pushes [user] off of them!</span>") /datum/riding/cyborg keytype = null @@ -436,7 +436,7 @@ var/turf/target = get_edge_target_turf(ridden, ridden.dir) var/turf/targetm = get_step(get_turf(ridden), ridden.dir) M.Move(targetm) - M.visible_message("<span class='boldwarning'>[M] is thrown clear of [ridden]!</span>") + M.visible_message("<span class='warning'>[M] is thrown clear of [ridden]!</span>") M.throw_at(target, 14, 5, ridden) M.Weaken(3) diff --git a/code/game/area/Space_Station_13_areas.dm b/code/game/area/Space_Station_13_areas.dm index ee369d73f72..426ab3220dd 100644 --- a/code/game/area/Space_Station_13_areas.dm +++ b/code/game/area/Space_Station_13_areas.dm @@ -80,8 +80,8 @@ NOTE: there are two lists of areas in the end of this file: centcom and station name = "Asteroid - Artifact" icon_state = "cave" -/area/asteroid/artifactroom/New() - ..() +/area/asteroid/artifactroom/Initialize() + . = ..() set_dynamic_lighting() /area/planet/clown diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 4395e5155af..f346da191aa 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -25,7 +25,7 @@ var/lightswitch = 1 var/requires_power = 1 - var/always_unpowered = 0 // This gets overriden to 1 for space in area/New(). + var/always_unpowered = 0 // This gets overriden to 1 for space in area/Initialize(). var/outdoors = 0 //For space, the asteroid, lavaland, etc. Used with blueprints to determine if we are adding a new area (vs editing a station room) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index c7ee05888c0..ed04e8f529c 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -445,10 +445,10 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons) /atom/proc/ratvar_act() return -/atom/proc/rcd_vals(mob/user, obj/item/weapon/rcd/the_rcd) +/atom/proc/rcd_vals(mob/user, obj/item/weapon/construction/rcd/the_rcd) return FALSE -/atom/proc/rcd_act(mob/user, obj/item/weapon/rcd/the_rcd, passed_mode) +/atom/proc/rcd_act(mob/user, obj/item/weapon/construction/rcd/the_rcd, passed_mode) return FALSE /atom/proc/storage_contents_dump_act(obj/item/weapon/storage/src_object, mob/user) diff --git a/code/game/gamemodes/antag_spawner.dm b/code/game/gamemodes/antag_spawner.dm index 61b64337f12..74c16cf1322 100644 --- a/code/game/gamemodes/antag_spawner.dm +++ b/code/game/gamemodes/antag_spawner.dm @@ -162,9 +162,7 @@ used = 1 var/mob/dead/observer/theghost = pick(nuke_candidates) spawn_antag(theghost.client, get_turf(src), "syndieborg") - var/datum/effect_system/spark_spread/S = new /datum/effect_system/spark_spread - S.set_up(4, 1, src) - S.start() + do_sparks(4, TRUE, src) qdel(src) else to_chat(user, "<span class='warning'>Unable to connect to Syndicate command. Please wait and try again later or use the teleporter on your uplink to get your points refunded.</span>") diff --git a/code/game/gamemodes/blob/blobs/core.dm b/code/game/gamemodes/blob/blobs/core.dm index 9c41d7b99b5..7ae47f4c0e6 100644 --- a/code/game/gamemodes/blob/blobs/core.dm +++ b/code/game/gamemodes/blob/blobs/core.dm @@ -15,7 +15,7 @@ var/point_rate = 2 -/obj/structure/blob/core/New(loc, client/new_overmind = null, new_rate = 2, placed = 0) +/obj/structure/blob/core/Initialize(mapload, client/new_overmind = null, new_rate = 2, placed = 0) GLOB.blob_cores += src START_PROCESSING(SSobj, src) GLOB.poi_list |= src @@ -25,7 +25,7 @@ if(overmind) update_icon() point_rate = new_rate - ..() + . = ..() /obj/structure/blob/core/scannerreport() return "Directs the blob's expansion, gradually expands, and sustains nearby blob spores and blobbernauts." diff --git a/code/game/gamemodes/blob/blobs/node.dm b/code/game/gamemodes/blob/blobs/node.dm index fcb2bf9be22..d778323ac23 100644 --- a/code/game/gamemodes/blob/blobs/node.dm +++ b/code/game/gamemodes/blob/blobs/node.dm @@ -10,10 +10,10 @@ point_return = 25 -/obj/structure/blob/node/New(loc) +/obj/structure/blob/node/Initialize() GLOB.blob_nodes += src START_PROCESSING(SSobj, src) - ..() + . = ..() /obj/structure/blob/node/scannerreport() return "Gradually expands and sustains nearby blob spores and blobbernauts." diff --git a/code/game/gamemodes/blob/theblob.dm b/code/game/gamemodes/blob/theblob.dm index 1931629e62a..3ae9e3e8d63 100644 --- a/code/game/gamemodes/blob/theblob.dm +++ b/code/game/gamemodes/blob/theblob.dm @@ -21,14 +21,14 @@ var/mob/camera/blob/overmind -/obj/structure/blob/New(loc) +/obj/structure/blob/Initialize() var/area/Ablob = get_area(loc) if(Ablob.blob_allowed) //Is this area allowed for winning as blob? GLOB.blobs_legit += src GLOB.blobs += src //Keep track of the blob in the normal list either way setDir(pick(GLOB.cardinal)) update_icon() - ..() + .= ..() ConsumeTile() if(atmosblock) CanAtmosPass = ATMOS_PASS_NO @@ -99,7 +99,7 @@ var/list/blobs_to_affect = list() for(var/obj/structure/blob/B in urange(claim_range, src, 1)) blobs_to_affect += B - shuffle(blobs_to_affect) + shuffle_inplace(blobs_to_affect) for(var/L in blobs_to_affect) var/obj/structure/blob/B = L if(!B.overmind && !istype(B, /obj/structure/blob/core) && prob(30)) diff --git a/code/game/gamemodes/changeling/powers/fleshmend.dm b/code/game/gamemodes/changeling/powers/fleshmend.dm index 1809e6c8c84..dd9d4a8634e 100644 --- a/code/game/gamemodes/changeling/powers/fleshmend.dm +++ b/code/game/gamemodes/changeling/powers/fleshmend.dm @@ -11,8 +11,8 @@ // divided by healing_ticks to get heal/tick var/total_healing = 100 -/obj/effect/proc_holder/changeling/fleshmend/New() - ..() +/obj/effect/proc_holder/changeling/fleshmend/Initialize() + . = ..() START_PROCESSING(SSobj, src) /obj/effect/proc_holder/changeling/fleshmend/Destroy() diff --git a/code/game/gamemodes/changeling/powers/mutations.dm b/code/game/gamemodes/changeling/powers/mutations.dm index 57db295d53d..54e8ea1e38a 100644 --- a/code/game/gamemodes/changeling/powers/mutations.dm +++ b/code/game/gamemodes/changeling/powers/mutations.dm @@ -162,8 +162,8 @@ sharpness = IS_SHARP var/can_drop = FALSE -/obj/item/weapon/melee/arm_blade/New(location,silent,synthetic) - ..() +/obj/item/weapon/melee/arm_blade/Initialize(mapload,silent,synthetic) + . = ..() if(ismob(loc) && !silent) loc.visible_message("<span class='warning'>A grotesque blade forms around [loc.name]\'s arm!</span>", "<span class='warning'>Our arm twists and mutates, transforming it into a deadly blade.</span>", "<span class='italics'>You hear organic matter ripping and tearing!</span>") if(synthetic) @@ -240,8 +240,8 @@ throw_range = 0 throw_speed = 0 -/obj/item/weapon/gun/magic/tentacle/New(location,silent) - ..() +/obj/item/weapon/gun/magic/tentacle/Initialize(mapload, silent) + . = ..() if(ismob(loc)) if(!silent) loc.visible_message("<span class='warning'>[loc.name]\'s arm starts stretching inhumanly!</span>", "<span class='warning'>Our arm twists and mutates, transforming it into a tentacle.</span>", "<span class='italics'>You hear organic matter ripping and tearing!</span>") @@ -266,9 +266,9 @@ firing_effect_type = null var/obj/item/weapon/gun/magic/tentacle/gun //the item that shot it -/obj/item/ammo_casing/magic/tentacle/New(obj/item/weapon/gun/magic/tentacle/tentacle_gun) - gun = tentacle_gun - ..() +/obj/item/ammo_casing/magic/tentacle/Initialize() + gun = loc + . = ..() /obj/item/ammo_casing/magic/tentacle/Destroy() gun = null @@ -285,9 +285,9 @@ var/chain var/obj/item/ammo_casing/magic/tentacle/source //the item that shot it -/obj/item/projectile/tentacle/New(obj/item/ammo_casing/magic/tentacle/tentacle_casing) - source = tentacle_casing - ..() +/obj/item/projectile/tentacle/Initialize() + source = loc + . = ..() /obj/item/projectile/tentacle/fire(setAngle) if(firer) @@ -407,8 +407,8 @@ var/remaining_uses //Set by the changeling ability. -/obj/item/weapon/shield/changeling/New() - ..() +/obj/item/weapon/shield/changeling/Initialize() + . = ..() if(ismob(loc)) loc.visible_message("<span class='warning'>The end of [loc.name]\'s hand inflates rapidly, forming a huge shield-like mass!</span>", "<span class='warning'>We inflate our hand into a strong shield.</span>", "<span class='italics'>You hear organic matter ripping and tearing!</span>") @@ -452,8 +452,8 @@ allowed = list(/obj/item/device/flashlight, /obj/item/weapon/tank/internals/emergency_oxygen, /obj/item/weapon/tank/internals/oxygen) armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0, fire = 90, acid = 90) //No armor at all. -/obj/item/clothing/suit/space/changeling/New() - ..() +/obj/item/clothing/suit/space/changeling/Initialize() + . = ..() if(ismob(loc)) loc.visible_message("<span class='warning'>[loc.name]\'s flesh rapidly inflates, forming a bloated mass around their body!</span>", "<span class='warning'>We inflate our flesh, creating a spaceproof suit!</span>", "<span class='italics'>You hear organic matter ripping and tearing!</span>") START_PROCESSING(SSobj, src) @@ -501,8 +501,8 @@ cold_protection = 0 heat_protection = 0 -/obj/item/clothing/suit/armor/changeling/New() - ..() +/obj/item/clothing/suit/armor/changeling/Initialize() + . = ..() if(ismob(loc)) loc.visible_message("<span class='warning'>[loc.name]\'s flesh turns black, quickly transforming into a hard, chitinous mass!</span>", "<span class='warning'>We harden our flesh, creating a suit of armor!</span>", "<span class='italics'>You hear organic matter ripping and tearing!</span>") diff --git a/code/game/gamemodes/clock_cult/clock_helpers/clock_powerdrain.dm b/code/game/gamemodes/clock_cult/clock_helpers/clock_powerdrain.dm index 2691036cf1e..705273876c2 100644 --- a/code/game/gamemodes/clock_cult/clock_helpers/clock_powerdrain.dm +++ b/code/game/gamemodes/clock_cult/clock_helpers/clock_powerdrain.dm @@ -21,10 +21,8 @@ if(!charge && !panel_open) panel_open = TRUE icon_state = "[initial(icon_state)]-o" - var/datum/effect_system/spark_spread/spks = new(get_turf(src)) - spks.set_up(10, 0, get_turf(src)) - spks.start() - visible_message("<span class='warning'>[src]'s panel flies open with a flurry of spark</span>") + do_sparks(10, FALSE, src) + visible_message("<span class='warning'>[src]'s panel flies open with a flurry of sparks!</span>") update_icon() /obj/item/weapon/stock_parts/cell/power_drain(clockcult_user) diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index e58a7912b2a..f471dc3477c 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -124,7 +124,7 @@ structure_check() searches for nearby cultist structures required for the invoca if(allow_excess_invokers) chanters += invokers else - shuffle(invokers) + shuffle_inplace(invokers) for(var/i in 1 to req_cultists) var/L = pick_n_take(invokers) if(L) diff --git a/code/game/gamemodes/devil/devil_game_mode.dm b/code/game/gamemodes/devil/devil_game_mode.dm index 70775dfe9d9..9a528a12406 100644 --- a/code/game/gamemodes/devil/devil_game_mode.dm +++ b/code/game/gamemodes/devil/devil_game_mode.dm @@ -50,12 +50,16 @@ /datum/game_mode/devil/post_setup() for(var/datum/mind/devil in devils) - spawn(rand(10,100)) - finalize_devil(devil, TRUE) - spawn(100) - add_devil_objectives(devil, objective_count) //This has to be in a separate loop, as we need devil names to be generated before we give objectives in devil agent. - devil.announceDevilLaws() - devil.announce_objectives() + post_setup_finalize(devil) modePlayer += devils ..() return 1 + +/datum/game_mode/devil/proc/post_setup_finalize(datum/mind/devil) + set waitfor = FALSE + sleep(rand(10,100)) + finalize_devil(devil, TRUE) + sleep(100) + add_devil_objectives(devil, objective_count) //This has to be in a separate loop, as we need devil names to be generated before we give objectives in devil agent. + devil.announceDevilLaws() + devil.announce_objectives() \ No newline at end of file diff --git a/code/game/gamemodes/devil/game_mode.dm b/code/game/gamemodes/devil/game_mode.dm index f311a289e0c..515a6e4c97c 100644 --- a/code/game/gamemodes/devil/game_mode.dm +++ b/code/game/gamemodes/devil/game_mode.dm @@ -31,7 +31,7 @@ /datum/game_mode/proc/finalize_devil(datum/mind/devil_mind, ascendable = FALSE) - + set waitfor = FALSE var/trueName= randomDevilName() devil_mind.devilinfo = devilInfo(trueName, 1) @@ -39,14 +39,14 @@ devil_mind.store_memory("Your devilic true name is [devil_mind.devilinfo.truename]<br>[GLOB.lawlorify[LAW][devil_mind.devilinfo.ban]]<br>You may not use violence to coerce someone into selling their soul.<br>You may not directly and knowingly physically harm a devil, other than yourself.<br>[GLOB.lawlorify[LAW][devil_mind.devilinfo.bane]]<br>[GLOB.lawlorify[LAW][devil_mind.devilinfo.obligation]]<br>[GLOB.lawlorify[LAW][devil_mind.devilinfo.banish]]<br>") devil_mind.devilinfo.owner = devil_mind devil_mind.devilinfo.give_base_spells(1) - spawn(10) - devil_mind.devilinfo.update_hud() - if(devil_mind.assigned_role == "Clown" && ishuman(devil_mind.current)) - var/mob/living/carbon/human/S = devil_mind.current - to_chat(S, "<span class='notice'>Your infernal nature has allowed you to overcome your clownishness.</span>") - S.dna.remove_mutation(CLOWNMUT) if(issilicon(devil_mind.current)) add_law_sixsixsix(devil_mind.current) + sleep(10) + devil_mind.devilinfo.update_hud() + if(devil_mind.assigned_role == "Clown" && ishuman(devil_mind.current)) + var/mob/living/carbon/human/S = devil_mind.current + to_chat(S, "<span class='notice'>Your infernal nature has allowed you to overcome your clownishness.</span>") + S.dna.remove_mutation(CLOWNMUT) /datum/game_mode/proc/add_devil_objectives(datum/mind/devil_mind, quantity) var/list/validtypes = list(/datum/objective/devil/soulquantity, /datum/objective/devil/soulquality, /datum/objective/devil/sintouch, /datum/objective/devil/buy_target) diff --git a/code/game/gamemodes/devil/true_devil/_true_devil.dm b/code/game/gamemodes/devil/true_devil/_true_devil.dm index 7f908756b9c..eb2921c9662 100644 --- a/code/game/gamemodes/devil/true_devil/_true_devil.dm +++ b/code/game/gamemodes/devil/true_devil/_true_devil.dm @@ -60,8 +60,7 @@ stat = DEAD ..(gibbed) drop_all_held_items() - spawn (0) - mind.devilinfo.beginResurrectionCheck(src) + INVOKE_ASYNC(mind.devilinfo, /datum/devilinfo/proc/beginResurrectionCheck, src) /mob/living/carbon/true_devil/examine(mob/user) diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 7dda5a619ea..2564d1b2629 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -75,11 +75,10 @@ ///Everyone should now be on the station and have their normal gear. This is the place to give the special roles extra things -/datum/game_mode/proc/post_setup(report=0) //Gamemodes can override the intercept report. Passing a 1 as the argument will force a report. +/datum/game_mode/proc/post_setup(report) //Gamemodes can override the intercept report. Passing TRUE as the argument will force a report. if(!report) report = config.intercept - spawn (ROUNDSTART_LOGOUT_REPORT_TIME) - display_roundstart_logout_report() + addtimer(CALLBACK(GLOBAL_PROC, .proc/display_roundstart_logout_report), ROUNDSTART_LOGOUT_REPORT_TIME) feedback_set_details("round_start","[time2text(world.realtime)]") if(SSticker && SSticker.mode) @@ -88,8 +87,7 @@ feedback_set_details("revision","[GLOB.revdata.commit]") feedback_set_details("server_ip","[world.internet_address]:[world.port]") if(report) - spawn (rand(waittime_l, waittime_h)) - send_intercept(0) + addtimer(CALLBACK(src, .proc/send_intercept, 0), rand(waittime_l, waittime_h)) generate_station_goals() GLOB.start_state = new /datum/station_state() GLOB.start_state.count(1) @@ -105,6 +103,7 @@ ///Allows rounds to basically be "rerolled" should the initial premise fall through. Also known as mulligan antags. /datum/game_mode/proc/convert_roundtype() + set waitfor = FALSE var/list/living_crew = list() for(var/mob/Player in GLOB.mob_list) @@ -158,15 +157,16 @@ message_admins("The roundtype will be converted. If you have other plans for the station or feel the station is too messed up to inhabit <A HREF='?_src_=holder;toggle_midround_antag=\ref[usr]'>stop the creation of antags</A> or <A HREF='?_src_=holder;end_round=\ref[usr]'>end the round now</A>.") - spawn(rand(600,1800)) //somewhere between 1 and 3 minutes from now - if(!config.midround_antag[SSticker.mode.config_tag]) - round_converted = 0 - return 1 - for(var/mob/living/carbon/human/H in antag_candidates) - replacementmode.make_antag_chance(H) - round_converted = 2 - message_admins("-- IMPORTANT: The roundtype has been converted to [replacementmode.name], antagonists may have been created! --") - return 1 + . = 1 + sleep(rand(600,1800)) + //somewhere between 1 and 3 minutes from now + if(!config.midround_antag[SSticker.mode.config_tag]) + round_converted = 0 + return 1 + for(var/mob/living/carbon/human/H in antag_candidates) + replacementmode.make_antag_chance(H) + round_converted = 2 + message_admins("-- IMPORTANT: The roundtype has been converted to [replacementmode.name], antagonists may have been created! --") ///Called by the gameSSticker diff --git a/code/game/gamemodes/gang/dominator.dm b/code/game/gamemodes/gang/dominator.dm index 1e48e69d399..54099070cdd 100644 --- a/code/game/gamemodes/gang/dominator.dm +++ b/code/game/gamemodes/gang/dominator.dm @@ -24,7 +24,7 @@ set_light(2) GLOB.poi_list |= src spark_system = new - spark_system.set_up(5, 1, src) + spark_system.set_up(5, TRUE, src) countdown = new(src) /obj/machinery/dominator/examine(mob/user) @@ -129,9 +129,8 @@ set_broken() GLOB.poi_list.Remove(src) gang = null - qdel(spark_system) - qdel(countdown) - countdown = null + QDEL_NULL(spark_system) + QDEL_NULL(countdown) STOP_PROCESSING(SSmachines, src) return ..() diff --git a/code/game/gamemodes/gang/gang.dm b/code/game/gamemodes/gang/gang.dm index 51a9d211957..22ca4b22987 100644 --- a/code/game/gamemodes/gang/gang.dm +++ b/code/game/gamemodes/gang/gang.dm @@ -73,15 +73,16 @@ GLOBAL_LIST_INIT(gang_colors_pool, list("red","orange","yellow","green","blue"," /datum/game_mode/gang/post_setup() - spawn(rand(10,100)) - for(var/datum/gang/G in gangs) - for(var/datum/mind/boss_mind in G.bosses) - G.add_gang_hud(boss_mind) - forge_gang_objectives(boss_mind) - greet_gang(boss_mind) - equip_gang(boss_mind.current,G) - modePlayer += boss_mind + set waitfor = FALSE ..() + sleep(rand(10,100)) + for(var/datum/gang/G in gangs) + for(var/datum/mind/boss_mind in G.bosses) + G.add_gang_hud(boss_mind) + forge_gang_objectives(boss_mind) + greet_gang(boss_mind) + equip_gang(boss_mind.current,G) + modePlayer += boss_mind /datum/game_mode/proc/forge_gang_objectives(datum/mind/boss_mind) diff --git a/code/game/gamemodes/gang/gang_pen.dm b/code/game/gamemodes/gang/gang_pen.dm index 5045c274857..0e01532190b 100644 --- a/code/game/gamemodes/gang/gang_pen.dm +++ b/code/game/gamemodes/gang/gang_pen.dm @@ -36,6 +36,7 @@ ..() /obj/item/weapon/pen/gang/proc/cooldown(datum/gang/gang) + set waitfor = FALSE var/cooldown_time = 600+(600*gang.bosses.len) // 1recruiter=2mins, 2recruiters=3mins, 3recruiters=4mins cooldown = 1 @@ -52,8 +53,8 @@ if(charges) cooldown_time = 50 - spawn(cooldown_time) - cooldown = 0 - icon_state = "pen" - var/mob/M = get(src, /mob) - to_chat(M, "<span class='notice'>\icon[src] [src][(src.loc == M)?(""):(" in your [src.loc]")] vibrates softly. It is ready to be used again.</span>") + sleep(cooldown_time) + cooldown = 0 + icon_state = "pen" + var/mob/M = get(src, /mob) + to_chat(M, "<span class='notice'>\icon[src] [src][(src.loc == M)?(""):(" in your [src.loc]")] vibrates softly. It is ready to be used again.</span>") diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm index d581af11b94..a7c466e746b 100644 --- a/code/game/gamemodes/malfunction/Malf_Modules.dm +++ b/code/game/gamemodes/malfunction/Malf_Modules.dm @@ -192,19 +192,20 @@ set category = "Malfunction" set name = "Destroy RCDs" set desc = "Detonate all RCDs on the station, while sparing onboard cyborg RCDs." + set waitfor = FALSE if(!canUseTopic() || malf_cooldown) return for(var/I in GLOB.rcd_list) - if(!istype(I, /obj/item/weapon/rcd/borg)) //Ensures that cyborg RCDs are spared. - var/obj/item/weapon/rcd/RCD = I + if(!istype(I, /obj/item/weapon/construction/rcd/borg)) //Ensures that cyborg RCDs are spared. + var/obj/item/weapon/construction/rcd/RCD = I RCD.detonate_pulse() to_chat(src, "<span class='warning'>RCD detonation pulse emitted.</span>") - malf_cooldown = 1 - spawn(100) - malf_cooldown = 0 + malf_cooldown = TRUE + sleep(100) + malf_cooldown = FALSE /datum/AI_Module/large/mecha_domination module_name = "Viral Mech Domination" diff --git a/code/game/gamemodes/miniantags/borer/borer.dm b/code/game/gamemodes/miniantags/borer/borer.dm index a8bfab458a2..122d2c34ba5 100644 --- a/code/game/gamemodes/miniantags/borer/borer.dm +++ b/code/game/gamemodes/miniantags/borer/borer.dm @@ -1072,4 +1072,4 @@ GLOBAL_VAR_INIT(total_borer_hosts_needed, 10) /datum/action/innate/borer/jumpstart_host/Activate() var/mob/living/simple_animal/borer/B = owner - B.jumpstart() + B.jumpstart() \ No newline at end of file diff --git a/code/game/gamemodes/sandbox/h_sandbox.dm b/code/game/gamemodes/sandbox/h_sandbox.dm index 722fabc81df..6b308357ecf 100644 --- a/code/game/gamemodes/sandbox/h_sandbox.dm +++ b/code/game/gamemodes/sandbox/h_sandbox.dm @@ -218,7 +218,7 @@ GLOBAL_VAR_INIT(hsboxspawn, TRUE) if("hsbrcd") if(!GLOB.hsboxspawn) return - new/obj/item/weapon/rcd/combat(usr.loc) + new/obj/item/weapon/construction/rcd/combat(usr.loc) // // New sandbox airlock maker diff --git a/code/game/gamemodes/traitor/double_agents.dm b/code/game/gamemodes/traitor/double_agents.dm index 68b92eea70c..992e10fa22a 100644 --- a/code/game/gamemodes/traitor/double_agents.dm +++ b/code/game/gamemodes/traitor/double_agents.dm @@ -65,7 +65,7 @@ // As soon as we get 3 or 4 extra latejoin traitors, make them traitors and kill each other. if(late_joining_list.len >= rand(3, 4)) // True randomness - shuffle(late_joining_list) + shuffle_inplace(late_joining_list) // Reset the target_list, it'll be used again in force_traitor_objectives target_list = list() diff --git a/code/game/gamemodes/wizard/artefact.dm b/code/game/gamemodes/wizard/artefact.dm index 2a5eaef2997..13084fab643 100644 --- a/code/game/gamemodes/wizard/artefact.dm +++ b/code/game/gamemodes/wizard/artefact.dm @@ -329,7 +329,7 @@ if("cyborg") for(var/X in M.bodyparts) var/obj/item/bodypart/affecting = X - affecting.change_bodypart_status(BODYPART_ROBOTIC) + affecting.change_bodypart_status(BODYPART_ROBOTIC, FALSE, TRUE) M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/eyepatch(M), slot_glasses) M.put_in_hands_or_del(sword) diff --git a/code/game/gamemodes/wizard/raginmages.dm b/code/game/gamemodes/wizard/raginmages.dm index c9831d83471..01eb8a52c49 100644 --- a/code/game/gamemodes/wizard/raginmages.dm +++ b/code/game/gamemodes/wizard/raginmages.dm @@ -117,7 +117,7 @@ mages_made-- return else - shuffle(candidates) + shuffle_inplace(candidates) for(var/mob/i in candidates) if(!i || !i.client) continue //Dont bother removing them from the list since we only grab one wizard diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 433470bf1b9..78dce54101d 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -126,6 +126,15 @@ if (is_operational() && (!isnull(occupant)) && (occupant.stat != DEAD)) to_chat(user, "Current clone cycle is [round(get_completion())]% complete.") +/obj/machinery/clonepod/return_air() + // We want to simulate the clone not being in contact with + // the atmosphere, so we'll put them in a constant pressure + // nitrogen. They'll breathe through the chemicals we pump into them. + var/static/datum/gas_mixture/immutable/cloner/GM //global so that there's only one instance made for all cloning pods + if(!GM) + GM = new + return GM + /obj/machinery/clonepod/proc/get_completion() . = (100 * ((occupant.health + 100) / (heal_level + 100))) diff --git a/code/game/machinery/computer/camera_advanced.dm b/code/game/machinery/computer/camera_advanced.dm index f0adeac2266..39cdb1478cb 100644 --- a/code/game/machinery/computer/camera_advanced.dm +++ b/code/game/machinery/computer/camera_advanced.dm @@ -92,6 +92,12 @@ obj/machinery/computer/camera_advanced/attack_ai(mob/user) var/eye_initialized = 0 var/visible_icon = 0 var/image/user_image = null + +/mob/camera/aiEye/remote/update_remote_sight(mob/living/user) + user.see_invisible = SEE_INVISIBLE_LIVING //can't see ghosts through cameras + user.sight = 0 + user.see_in_dark = 2 + return 1 /mob/camera/aiEye/remote/Destroy() eye_user = null diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index 2a2c02f72ba..74fcf77ce52 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -35,7 +35,7 @@ return ..() /obj/machinery/computer/Initialize() - ..() + . = ..() power_change() /obj/machinery/computer/process() diff --git a/code/game/machinery/dance_machine.dm b/code/game/machinery/dance_machine.dm new file mode 100644 index 00000000000..0876e5c1f7b --- /dev/null +++ b/code/game/machinery/dance_machine.dm @@ -0,0 +1,514 @@ +// DISCO DANCE MACHINE - For engineering power optimization incentive nurturing test system (POINTS) + +/obj/machinery/disco + name = "radiant dance machine mark IV" + desc = "The first three prototypes were discontinued after mass casualty incidents." + icon = 'icons/obj/lighting.dmi' + icon_state = "disco0" + anchored = FALSE + verb_say = "states" + density = TRUE + req_access = list(GLOB.access_engine) + var/active = FALSE + var/list/rangers = list() + var/list/listeners = list() + var/charge = 35 + var/stop = 0 + var/list/available = list() + var/list/select_name = list() + var/list/spotlights = list() + var/list/sparkles = list() + var/static/list/songs = list( + new /datum/track("Engineering's Basic Beat", 'sound/misc/disco.ogg', 600, 5), + new /datum/track("Engineering's Domination Dance", 'sound/misc/e1m1.ogg', 950, 6), + new /datum/track("Engineering's Superiority Shimmy", 'sound/misc/Paradox.ogg', 2400, 4), + new /datum/track("Engineering's Ultimate High-Energy Hustle", 'sound/misc/boogie2.ogg', 1770, 5), + ) + var/datum/track/selection = null + +/datum/track + var/song_name = "generic" + var/song_path = null + var/song_length = 0 + var/song_beat = 0 + +/datum/track/New(name, path, length, beat) + song_name = name + song_path = path + song_length = length + song_beat = beat + +/obj/machinery/disco/Initialize() + ..() + selection = songs[1] + + +/obj/machinery/disco/Destroy() + dance_over() + return ..() + +/obj/machinery/disco/attackby(obj/item/O, mob/user, params) + if(!active) + if(istype(O, /obj/item/weapon/wrench)) + if(!anchored && !isinspace()) + to_chat(user,"<span class='notice'>You secure the [src] to the floor.</span>") + anchored = TRUE + else if(anchored) + to_chat(user,"<span class='notice'>You unsecure and disconnect the [src].</span>") + anchored = FALSE + playsound(src, 'sound/items/Deconstruct.ogg', 50, 1) + return + return ..() + +/obj/machinery/disco/update_icon() + if(active) + icon_state = "disco1" + else + icon_state = "disco0" + ..() + + +/obj/machinery/disco/interact(mob/user) + if (!anchored) + to_chat(user,"<span class='warning'>This device must be anchored by a wrench!</span>") + return + if(!allowed(user)) + to_chat(user,"<span class='warning'>Error: Access Denied - Message: Only the engineering department can be trusted with this kind of power.</span>") + playsound(src, 'sound/misc/compiler-failure.ogg', 50, 1) + return + if(!Adjacent(user) && !isAI(user)) + return + user.set_machine(src) + var/list/dat = list() + dat +="<div class='statusDisplay' style='text-align:center'>" + dat += "<b><A href='?src=\ref[src];action=toggle'>[!active ? "BREAK IT DOWN" : "SHUT IT DOWN"]<b></A><br>" + dat += "</div><br>" + dat += "<A href='?src=\ref[src];action=select'> Select Track</A><br>" + dat += "Track Selected: [selection.song_name]<br>" + dat += "Track Length: [selection.song_length/10] seconds<br><br>" + dat += "<br>DJ's Soundboard:<b><br>" + dat +="<div class='statusDisplay'><div style='text-align:center'>" + dat += "<A href='?src=\ref[src];action=horn'>Air Horn</A> " + dat += "<A href='?src=\ref[src];action=alert'>Station Alert</A> " + dat += "<A href='?src=\ref[src];action=siren'>Warning Siren</A> " + dat += "<A href='?src=\ref[src];action=honk'>Honk</A><br>" + dat += "<A href='?src=\ref[src];action=pump'>Shotgun Pump</A>" + dat += "<A href='?src=\ref[src];action=pop'>Gunshot</A>" + dat += "<A href='?src=\ref[src];action=saber'>Esword</A>" + dat += "<A href='?src=\ref[src];action=harm'>Harm Alarm</A>" + var/datum/browser/popup = new(user, "vending", "Radiance Dance Machine - Mark IV", 400, 350) + popup.set_content(dat.Join()) + popup.open() + + +/obj/machinery/disco/Topic(href, href_list) + if(..()) + return + add_fingerprint(usr) + switch(href_list["action"]) + if("toggle") + if (QDELETED(src)) + return + if(!active) + if(stop > world.time) + to_chat(usr, "<span class='warning'>Error: The device is still resetting from the last activation, it will be ready again in [round((stop-world.time)/10)] seconds.</span>") + playsound(src, 'sound/misc/compiler-failure.ogg', 50, 1) + return + active = TRUE + update_icon() + dance_setup() + START_PROCESSING(SSobj, src) + lights_spin() + updateUsrDialog() + else if(active) + active = FALSE + STOP_PROCESSING(SSobj, src) + update_icon() + dance_over() + stop = world.time + 300 + updateUsrDialog() + if("select") + if(active) + to_chat(usr, "<span class='warning'>Error: You cannot change the song until the current one is over.</span>") + return + check_GBP() + select_name = input(usr, "Choose your song", "Track:") as null|anything in available + if (QDELETED(src)) + return + for(var/datum/track/S in songs) + if(select_name == S.song_name) + selection = S + break + updateUsrDialog() + if("horn") + deejay('sound/items/AirHorn2.ogg') + if("alert") + deejay('sound/misc/notice1.ogg') + if("siren") + deejay('sound/machines/engine_alert1.ogg') + if("honk") + deejay('sound/items/bikehorn.ogg') + if("pump") + deejay('sound/weapons/shotgunpump.ogg') + if("pop") + deejay('sound/weapons/Gunshot3.ogg') + if("saber") + deejay('sound/weapons/saberon.ogg') + if("harm") + deejay('sound/AI/harmalarm.ogg') + +/obj/machinery/disco/proc/deejay(var/S) + if (QDELETED(src) || !active || charge < 5) + to_chat(usr, "<span class='warning'>The device is not able to play more DJ sounds at this time.</span>") + return + charge -= 5 + playsound(src, S,300,1) + +/obj/machinery/disco/proc/check_GBP() + available |= "Engineering's Basic Beat" + available |= "Engineering's Domination Dance" + available |= "Engineering's Superiority Shimmy" + available |= "Engineering's Ultimate High-Energy Hustle" + + +/obj/machinery/disco/proc/dance_setup() + stop = world.time + selection.song_length + var/turf/cen = get_turf(src) + FOR_DVIEW(var/turf/t, 3, get_turf(src),INVISIBILITY_LIGHTING) + if(t.x == cen.x && t.y > cen.y) + var/obj/item/device/flashlight/spotlight/L = new /obj/item/device/flashlight/spotlight(t) + L.light_color = "red" + L.light_power = 30-(get_dist(src,L)*8) + L.range = 1+get_dist(src, L) + spotlights+=L + continue + if(t.x == cen.x && t.y < cen.y) + var/obj/item/device/flashlight/spotlight/L = new /obj/item/device/flashlight/spotlight(t) + L.light_color = "purple" + L.light_power = 30-(get_dist(src,L)*8) + L.range = 1+get_dist(src, L) + spotlights+=L + continue + if(t.x > cen.x && t.y == cen.y) + var/obj/item/device/flashlight/spotlight/L = new /obj/item/device/flashlight/spotlight(t) + L.light_color = "#ffff00" + L.light_power = 30-(get_dist(src,L)*8) + L.range = 1+get_dist(src, L) + spotlights+=L + continue + if(t.x < cen.x && t.y == cen.y) + var/obj/item/device/flashlight/spotlight/L = new /obj/item/device/flashlight/spotlight(t) + L.light_color = "green" + L.light_power = 30-(get_dist(src,L)*8) + L.range = 1+get_dist(src, L) + spotlights+=L + continue + if((t.x+1 == cen.x && t.y+1 == cen.y) || (t.x+2==cen.x && t.y+2 == cen.y)) + var/obj/item/device/flashlight/spotlight/L = new /obj/item/device/flashlight/spotlight(t) + L.light_color = "sw" + L.light_power = 30-(get_dist(src,L)*8) + L.range = 1.4+get_dist(src, L) + spotlights+=L + continue + if((t.x-1 == cen.x && t.y-1 == cen.y) || (t.x-2==cen.x && t.y-2 == cen.y)) + var/obj/item/device/flashlight/spotlight/L = new /obj/item/device/flashlight/spotlight(t) + L.light_color = "ne" + L.light_power = 30-(get_dist(src,L)*8) + L.range = 1.4+get_dist(src, L) + spotlights+=L + continue + if((t.x-1 == cen.x && t.y+1 == cen.y) || (t.x-2==cen.x && t.y+2 == cen.y)) + var/obj/item/device/flashlight/spotlight/L = new /obj/item/device/flashlight/spotlight(t) + L.light_color = "se" + L.light_power = 30-(get_dist(src,L)*8) + L.range = 1.4+get_dist(src, L) + spotlights+=L + continue + if((t.x+1 == cen.x && t.y-1 == cen.y) || (t.x+2==cen.x && t.y-2 == cen.y)) + var/obj/item/device/flashlight/spotlight/L = new /obj/item/device/flashlight/spotlight(t) + L.light_color = "nw" + L.light_power = 30-(get_dist(src,L)*8) + L.range = 1.4+get_dist(src, L) + spotlights+=L + continue + continue + +/obj/machinery/disco/proc/hierofunk() + for(var/i in 1 to 10) + spawn_atom_to_turf(/obj/effect/overlay/temp/hierophant/telegraph/edge, src, 1, FALSE) + sleep(5) + +/obj/machinery/disco/proc/lights_spin() + for(var/i in 1 to 25) + if(QDELETED(src) || !active) + return + var/obj/effect/overlay/sparkles/S = new /obj/effect/overlay/sparkles(src) + S.alpha = 0 + sparkles += S + switch(i) + if(1 to 8) + S.orbit(src, 30, TRUE, 60, 36, TRUE, FALSE) + if(9 to 16) + S.orbit(src, 62, TRUE, 60, 36, TRUE, FALSE) + if(17 to 24) + S.orbit(src, 95, TRUE, 60, 36, TRUE, FALSE) + if(25) + S.pixel_y = 7 + S.forceMove(get_turf(src)) + sleep(7) + if(selection.song_name == "Engineering's Ultimate High-Energy Hustle") + sleep(280) + for(var/obj/reveal in sparkles) + reveal.alpha = 255 + while(active) + for(var/obj/item/device/flashlight/spotlight/glow in spotlights) // The multiples reflects custom adjustments to each colors after dozens of tests + if(QDELETED(src) || !active || QDELETED(glow)) + return + if(glow.light_color == "red") + glow.light_color = "nw" + glow.light_power = glow.light_power * 1.48 + glow.light_range = 0 + glow.update_light() + continue + if(glow.light_color == "nw") + glow.light_color = "green" + glow.light_range = glow.range * 1.1 + glow.light_power = glow.light_power * 2 // Any changes to power must come in pairs to neutralize it for other colors + glow.update_light() + continue + if(glow.light_color == "green") + glow.light_color = "sw" + glow.light_power = glow.light_power * 0.5 + glow.light_range = 0 + glow.update_light() + continue + if(glow.light_color == "sw") + glow.light_color = "purple" + glow.light_power = glow.light_power * 2.27 + glow.light_range = glow.range * 1.15 + glow.update_light() + continue + if(glow.light_color == "purple") + glow.light_color = "se" + glow.light_power = glow.light_power * 0.44 + glow.light_range = 0 + glow.update_light() + continue + if(glow.light_color == "se") + glow.light_color = "#ffff00" + glow.light_range = glow.range * 0.9 + glow.update_light() + continue + if(glow.light_color == "#ffff00") + glow.light_color = "ne" + glow.light_range = 0 + glow.update_light() + continue + if(glow.light_color == "ne") + glow.light_color = "red" + glow.light_power = glow.light_power * 0.68 + glow.light_range = glow.range * 0.85 + glow.update_light() + continue + if(prob(2)) // Unique effects for the dance floor that show up randomly to mix things up + INVOKE_ASYNC(src, .proc/hierofunk) + sleep(selection.song_beat) + + +/obj/machinery/disco/proc/dance(var/mob/living/carbon/M) //Show your moves + + switch(rand(0,9)) + if(0 to 1) + dance2(M) + if(2 to 3) + dance3(M) + if(4 to 6) + dance4(M) + if(7 to 9) + dance5(M) + +/obj/machinery/disco/proc/dance2(var/mob/living/carbon/M) + set waitfor = 0 + for(var/i = 1, i < 10, i++) + M.SpinAnimation(15,1) + M.setDir(pick(GLOB.cardinal)) + sleep(8) + +/obj/machinery/disco/proc/dance3(var/mob/living/carbon/M) + var/matrix/initial_matrix = matrix(M.transform) + for(var/i in 1 to 6) + if (!M) + return + M.SpinAnimation(7,1) + M.setDir(pick(GLOB.cardinal)) + for (var/x in 1 to 12) + sleep(1) + if (!M) + return + if (i<5) + initial_matrix = matrix(M.transform) + initial_matrix.Translate(0,1) + animate(M, transform = initial_matrix, time = 1, loop = 0) + if (i>4) + initial_matrix = matrix(M.transform) + initial_matrix.Translate(0,-2) + animate(M, transform = initial_matrix, time = 1, loop = 0) + M.setDir(turn(M.dir, 90)) + switch (M.dir) + if (NORTH) + initial_matrix = matrix(M.transform) + initial_matrix.Translate(0,3) + animate(M, transform = initial_matrix, time = 1, loop = 0) + if (SOUTH) + initial_matrix = matrix(M.transform) + initial_matrix.Translate(0,-3) + animate(M, transform = initial_matrix, time = 1, loop = 0) + if (EAST) + initial_matrix = matrix(M.transform) + initial_matrix.Translate(3,0) + animate(M, transform = initial_matrix, time = 1, loop = 0) + if (WEST) + initial_matrix = matrix(M.transform) + initial_matrix.Translate(-3,0) + animate(M, transform = initial_matrix, time = 1, loop = 0) + sleep(10) + animate(M, transform = null, time = 1, loop = 0) + + +/obj/machinery/disco/proc/dance4(var/mob/living/carbon/M) + var/speed = rand(1,3) + set waitfor = 0 + var/time = 30 + while(time) + sleep(speed) + for(var/i in 1 to speed) + M.setDir(pick(GLOB.cardinal)) + M.lay_down(TRUE) + time-- + +/obj/machinery/disco/proc/dance5(var/mob/living/carbon/M) + INVOKE_ASYNC(M, .proc/dance5helper) + var/matrix/initial_matrix = matrix(M.transform) + for (var/i in 1 to 60) + if (!M) + return + if (i<31) + initial_matrix = matrix(M.transform) + initial_matrix.Translate(0,1) + animate(M, transform = initial_matrix, time = 1, loop = 0) + if (i>30) + initial_matrix = matrix(M.transform) + initial_matrix.Translate(0,-1) + animate(M, transform = initial_matrix, time = 1, loop = 0) + M.setDir(turn(M.dir, 90)) + switch (M.dir) + if (NORTH) + initial_matrix = matrix(M.transform) + initial_matrix.Translate(0,3) + animate(M, transform = initial_matrix, time = 1, loop = 0) + if (SOUTH) + initial_matrix = matrix(M.transform) + initial_matrix.Translate(0,-3) + animate(M, transform = initial_matrix, time = 1, loop = 0) + if (EAST) + initial_matrix = matrix(M.transform) + initial_matrix.Translate(3,0) + animate(M, transform = initial_matrix, time = 1, loop = 0) + if (WEST) + initial_matrix = matrix(M.transform) + initial_matrix.Translate(-3,0) + animate(M, transform = initial_matrix, time = 1, loop = 0) + sleep (1) + animate(M, transform = null, time = 1, loop = 0) + +/obj/machinery/disco/proc/dance5helper(var/mob/living/carbon/M) + if (M) + animate(M, transform = matrix(180, MATRIX_ROTATE), time = 1, loop = 0) + sleep (70) + if (M) + animate(M, transform = null, time = 1, loop = 0) + +/mob/living/carbon/proc/dancey() // Dance5 except independent of the machine if admins want to meme it up + INVOKE_ASYNC(src, .proc/danceyhelper) + var/matrix/initial_matrix = matrix(transform) + for (var/i in 1 to 60) + if (!src) + return + if (i<31) + initial_matrix = matrix(transform) + initial_matrix.Translate(0,1) + transform = initial_matrix + animate(src, transform, time = 1, loop = 0) + if (i>30) + initial_matrix = matrix(transform) + initial_matrix.Translate(0,-1) + transform = initial_matrix + animate(src, transform, time = 1, loop = 0) + setDir(turn(src.dir, 90)) + switch (dir) + if (NORTH) + initial_matrix = matrix(transform) + initial_matrix.Translate(0,3) + animate(src, transform, time = 1, loop = 0) + if (SOUTH) + initial_matrix = matrix(transform) + initial_matrix.Translate(0,-3) + animate(src, transform, time = 1, loop = 0) + if (EAST) + initial_matrix = matrix(transform) + initial_matrix.Translate(3,0) + animate(src, transform, time = 1, loop = 0) + if (WEST) + initial_matrix = matrix(transform) + initial_matrix.Translate(-3,0) + animate(src, transform, time = 1, loop = 0) + sleep (1) + animate(src, transform = null, time = 1, loop = 0) + +/mob/living/carbon/proc/danceyhelper() + if (src) + animate(src, transform = matrix(180, MATRIX_ROTATE), time = 1, loop = 0) + sleep (70) + if (src) + animate(src, transform = null, time = 1, loop = 0) + + +/obj/machinery/disco/proc/dance_over() + for(var/obj/item/device/flashlight/spotlight/SL in spotlights) + qdel(SL) + spotlights.Cut() + for(var/obj/effect/overlay/sparkles/SP in sparkles) + qdel(SP) + sparkles.Cut() + rangers.Cut() + for(var/mob/living/L in listeners) + if(!L || !L.client) + continue + L.stop_sound_channel(CHANNEL_JUKEBOX) + listeners.Cut() + + +/obj/machinery/disco/process() + if(charge<35) + charge += 1 + if(world.time < stop && active) + rangers = list() + for(var/mob/living/M in range(9,src)) + rangers += M + if(!(listeners[M])) + M.playsound_local(get_turf(M), selection.song_path, 100, channel = CHANNEL_JUKEBOX) + listeners[M] = TRUE + if(prob(5+(allowed(M)*4))) + dance(M) + for(var/mob/living/L in listeners) + if(!(L in rangers)) + listeners -= L + if(!L || !L.client) + continue + L.stop_sound_channel(CHANNEL_JUKEBOX) + else if(active) + STOP_PROCESSING(SSobj, src) + dance_over() + playsound(src,'sound/machines/terminal_off.ogg',50,1) + active = FALSE + icon_state = "disco0" diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index df5366024b4..147e07fe1da 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -339,9 +339,7 @@ return FALSE //Already shocked someone recently? if(!prob(prb)) return FALSE //you lucked out, no shock for you - var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread - s.set_up(5, 1, src) - s.start() //sparks always. + do_sparks(5, TRUE, src) var/tmp/check_range = TRUE if(electrocute_mob(user, get_area(src), src, 1, check_range)) hasShocked = TRUE @@ -1542,13 +1540,13 @@ ae.loc = src.loc qdel(src) -/obj/machinery/door/airlock/rcd_vals(mob/user, obj/item/weapon/rcd/the_rcd) +/obj/machinery/door/airlock/rcd_vals(mob/user, obj/item/weapon/construction/rcd/the_rcd) switch(the_rcd.mode) if(RCD_DECONSTRUCT) return list("mode" = RCD_DECONSTRUCT, "delay" = 50, "cost" = 32) return FALSE -/obj/machinery/door/airlock/rcd_act(mob/user, obj/item/weapon/rcd/the_rcd, passed_mode) +/obj/machinery/door/airlock/rcd_act(mob/user, obj/item/weapon/construction/rcd/the_rcd, passed_mode) switch(passed_mode) if(RCD_DECONSTRUCT) to_chat(user, "<span class='notice'>You deconstruct the airlock.</span>") diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index fae47406b81..b37db06ac28 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -212,6 +212,11 @@ if(..()) return . = TRUE + + if(!allowed(usr)) + to_chat(usr, "<span class='warning'>Access denied.</span>") + return FALSE + switch(action) if("time") var/value = text2num(params["adjust"]) diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index f28e6cdbdb9..ae8c1ac1c48 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -97,7 +97,7 @@ Possible to do for anyone motivated enough: /obj/machinery/holopad/interact(mob/living/carbon/human/user) //Carn: Hologram requests. if(!istype(user)) return - if(user.stat || stat & (NOPOWER|BROKEN)) + if(user.stat || !is_operational()) return user.set_machine(src) var/dat @@ -112,7 +112,7 @@ Possible to do for anyone motivated enough: popup.open() /obj/machinery/holopad/Topic(href, href_list) - if(..()) + if(..() || !is_operational()) return if (href_list["AIrequest"]) if(last_request + 200 < world.time) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 137a492b3a9..6cd8e75798f 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -127,7 +127,7 @@ Class Procs: /obj/machinery/Initialize() if (!armor) armor = list(melee = 25, bullet = 10, laser = 10, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 70) - ..() + . = ..() GLOB.machines += src if(!speed_process) START_PROCESSING(SSmachines, src) diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index c8c1854344b..3de0b85820f 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -528,7 +528,7 @@ if(icon_vend) //Show the vending animation if needed flick(icon_vend,src) new R.product_path(get_turf(src)) - feedback_add_details("vending_machine_usage","[R.product_path]|[src.type]") + feedback_add_details("vending_machine_usage","[src.type]|[R.product_path]") vend_ready = 1 return @@ -1052,7 +1052,7 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C icon_state = "engivend" icon_deny = "engivend-deny" req_access_txt = "11" //Engineering Equipment access - products = list(/obj/item/clothing/glasses/meson/engine = 2,/obj/item/device/multitool = 4,/obj/item/weapon/electronics/airlock = 10,/obj/item/weapon/electronics/apc = 10,/obj/item/weapon/electronics/airalarm = 10,/obj/item/weapon/stock_parts/cell/high = 10, /obj/item/weapon/rcd/loaded = 3, /obj/item/device/geiger_counter = 5) + products = list(/obj/item/clothing/glasses/meson/engine = 2,/obj/item/device/multitool = 4,/obj/item/weapon/electronics/airlock = 10,/obj/item/weapon/electronics/apc = 10,/obj/item/weapon/electronics/airalarm = 10,/obj/item/weapon/stock_parts/cell/high = 10, /obj/item/weapon/construction/rcd/loaded = 3, /obj/item/device/geiger_counter = 5) contraband = list(/obj/item/weapon/stock_parts/cell/potato = 3) premium = list(/obj/item/weapon/storage/belt/utility = 3) armor = list(melee = 100, bullet = 100, laser = 100, energy = 100, bomb = 0, bio = 0, rad = 0, fire = 100, acid = 50) diff --git a/code/game/machinery/wishgranter.dm b/code/game/machinery/wishgranter.dm index cdaea6f875d..1866295a8f3 100644 --- a/code/game/machinery/wishgranter.dm +++ b/code/game/machinery/wishgranter.dm @@ -50,4 +50,4 @@ to_chat(user, "You have a very bad feeling about this.") - return \ No newline at end of file + return diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 99aad7743f4..25ba38c51c4 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -119,8 +119,8 @@ hud_possible = list (DIAG_STAT_HUD, DIAG_BATT_HUD, DIAG_MECH_HUD, DIAG_TRACK_HUD) -/obj/mecha/New() - ..() +/obj/mecha/Initialize() + . = ..() events = new icon_state += "-open" add_radio() diff --git a/code/game/objects/effects/effect_system/effect_system.dm b/code/game/objects/effects/effect_system/effect_system.dm index 34b20fde6f3..fe7216801b6 100644 --- a/code/game/objects/effects/effect_system/effect_system.dm +++ b/code/game/objects/effects/effect_system/effect_system.dm @@ -23,7 +23,7 @@ would spawn and follow the beaker, even if it is carried or thrown. /datum/effect_system var/number = 3 - var/cardinals = 0 + var/cardinals = FALSE var/turf/location var/atom/holder var/effect_type @@ -34,7 +34,7 @@ would spawn and follow the beaker, even if it is carried or thrown. location = null return ..() -/datum/effect_system/proc/set_up(n = 3, c = 0, loca) +/datum/effect_system/proc/set_up(n = 3, c = FALSE, loca) if(n > 10) n = 10 number = n diff --git a/code/game/objects/effects/effect_system/effects_sparks.dm b/code/game/objects/effects/effect_system/effects_sparks.dm index 054416efc24..997c7af1246 100644 --- a/code/game/objects/effects/effect_system/effects_sparks.dm +++ b/code/game/objects/effects/effect_system/effects_sparks.dm @@ -5,6 +5,17 @@ // will always spawn at the items location. ///////////////////////////////////////////// +/proc/do_sparks(n, c, source) + // n - number of sparks + // c - cardinals, bool, do the sparks only move in cardinal directions? + // source - source of the sparks. + + var/datum/effect_system/spark_spread/sparks = new + sparks.set_up(n, c, source) + sparks.start() + qdel(sparks) + + /obj/effect/particle_effect/sparks name = "sparks" icon_state = "sparks" diff --git a/code/game/objects/effects/overlays.dm b/code/game/objects/effects/overlays.dm index e83ecda8094..3d62e850e84 100644 --- a/code/game/objects/effects/overlays.dm +++ b/code/game/objects/effects/overlays.dm @@ -210,6 +210,11 @@ icon_state = "smoke" duration = 50 +/obj/effect/overlay/temp/fire + icon = 'icons/effects/fire.dmi' + icon_state = "3" + duration = 20 + /obj/effect/overlay/temp/cult randomdir = 0 duration = 10 @@ -608,3 +613,8 @@ name = "Coconuts" icon = 'icons/misc/beach.dmi' icon_state = "coconuts" + +/obj/effect/overlay/sparkles + name = "sparkles" + icon = 'icons/effects/effects.dmi' + icon_state = "shieldsparkles" diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index b0876e394d2..fa2dee2495f 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -1,5 +1,9 @@ GLOBAL_DATUM_INIT(fire_overlay, /image, image("icon" = 'icons/effects/fire.dmi', "icon_state" = "fire")) +GLOBAL_VAR_INIT(rpg_loot_items, FALSE) +// if true, everyone item when created will have its name changed to be +// more... RPG-like. + /obj/item name = "item" icon = 'icons/obj/items.dmi' @@ -99,14 +103,19 @@ GLOBAL_DATUM_INIT(fire_overlay, /image, image("icon" = 'icons/effects/fire.dmi', // non-clothing items var/datum/dog_fashion/dog_fashion = null + var/datum/rpg_loot/rpg_loot = null + /obj/item/Initialize() if (!materials) materials = list() - ..() + . = ..() for(var/path in actions_types) new path(src) actions_types = null + if(GLOB.rpg_loot_items) + rpg_loot = new(src) + /obj/item/Destroy() flags &= ~DROPDEL //prevent reqdels if(ismob(loc)) @@ -114,6 +123,7 @@ GLOBAL_DATUM_INIT(fire_overlay, /image, image("icon" = 'icons/effects/fire.dmi', m.temporarilyRemoveItemFromInventory(src, TRUE) for(var/X in actions) qdel(X) + QDEL_NULL(rpg_loot) return ..() /obj/item/device diff --git a/code/game/objects/items/charter.dm b/code/game/objects/items/charter.dm index e5f4ac1cb75..98e03ef18ca 100644 --- a/code/game/objects/items/charter.dm +++ b/code/game/objects/items/charter.dm @@ -86,7 +86,7 @@ name = "station charter for [station_name()]" desc = "An official document entrusting the governance of \ [station_name()] and surrounding space to Captain [uname]." - + feedback_set_details("station_renames","[station_name()]") if(!unlimited_uses) used = TRUE diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index c97fc18b8ec..433e095c249 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -307,7 +307,7 @@ // Glowsticks, in the uncomfortable range of similar to flares, // but not similar enough to make it worth a refactor /obj/item/device/flashlight/glowstick - name = "green glowstick" + name = "glowstick" desc = "A military-grade glowstick." w_class = WEIGHT_CLASS_SMALL brightness_on = 4 @@ -363,6 +363,11 @@ . = ..() if(.) user.visible_message("<span class='notice'>[user] cracks and shakes [src].</span>", "<span class='notice'>You crack and shake [src], turning it on!</span>") + activate() + +/obj/item/device/flashlight/glowstick/proc/activate() + if(!on) + on = TRUE START_PROCESSING(SSobj, src) /obj/item/device/flashlight/glowstick/red @@ -402,6 +407,20 @@ color = initial(glowtype.color) . = ..() +/obj/item/device/flashlight/spotlight //invisible lighting source + name = "disco lighting" + icon_state = null + light_color = null + brightness_on = 0 + light_range = 0 + light_power = 10 + alpha = 0 + layer = 0 + on = TRUE + anchored = TRUE + var/range = null + resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF + /obj/item/device/flashlight/flashdark name = "flashdark" desc = "A strange device manufactured with mysterious elements that somehow emits darkness. Or maybe it just sucks in light? Nobody knows for sure." diff --git a/code/game/objects/items/weapons/RCD.dm b/code/game/objects/items/weapons/RCD.dm index dbb3149a385..f8e716ea694 100644 --- a/code/game/objects/items/weapons/RCD.dm +++ b/code/game/objects/items/weapons/RCD.dm @@ -1,14 +1,14 @@ - +#define GLOW_MODE 3 +#define LIGHT_MODE 2 +#define REMOVE_MODE 1 /* CONTAINS: RCD +ARCD */ -/obj/item/weapon/rcd - name = "rapid-construction-device (RCD)" - desc = "A device used to rapidly build and deconstruct walls and floors." - icon = 'icons/obj/tools.dmi' - icon_state = "rcd" + +obj/item/weapon/construction opacity = 0 density = 0 anchored = 0 @@ -25,30 +25,114 @@ RCD resistance_flags = FIRE_PROOF var/datum/effect_system/spark_spread/spark_system var/matter = 0 - var/max_matter = 160 - var/working = 0 + var/max_matter = 100 + var/sheetmultiplier = 4 //Controls the amount of matter added for each glass/metal sheet, triple for plasteel + var/plasteelmultiplier = 3 //Plasteel is worth 3 times more than glass or metal + var/no_ammo_message = "<span class='warning'>The \'Low Ammo\' light on the device blinks yellow.</span>" + +/obj/item/weapon/construction/Initialize() + ..() + desc = "A [src]. It currently holds [matter]/[max_matter] matter-units." + spark_system = new /datum/effect_system/spark_spread + spark_system.set_up(5, 0, src) + spark_system.attach(src) + + +/obj/item/weapon/construction/Destroy() + QDEL_NULL(spark_system) + . = ..() + +/obj/item/weapon/construction/attackby(obj/item/weapon/W, mob/user, params) + if(iscyborg(user)) + return + var/loaded = 0 + if(istype(W, /obj/item/weapon/rcd_ammo)) + var/obj/item/weapon/rcd_ammo/R = W + if((matter + R.ammoamt) > max_matter) + to_chat(user, "<span class='warning'>The [src] can't hold any more matter-units!</span>") + return + qdel(W) + matter += R.ammoamt + playsound(src.loc, 'sound/machines/click.ogg', 50, 1) + loaded = 1 + else if(istype(W, /obj/item/stack/sheet/metal) || istype(W, /obj/item/stack/sheet/glass)) + loaded = loadwithsheets(W, sheetmultiplier, user) + else if(istype(W, /obj/item/stack/sheet/plasteel)) + loaded = loadwithsheets(W, plasteelmultiplier*sheetmultiplier, user) //Plasteel is worth 3 times more than glass or metal + if(loaded) + to_chat(user, "<span class='notice'>The [src] now holds [matter]/[max_matter] matter-units.</span>") + desc = "A RCD. It currently holds [matter]/[max_matter] matter-units." + else + return ..() + +/obj/item/weapon/construction/proc/loadwithsheets(obj/item/stack/sheet/S, value, mob/user) + var/maxsheets = round((max_matter-matter)/value) //calculate the max number of sheets that will fit in RCD + if(maxsheets > 0) + var/amount_to_use = min(S.amount, maxsheets) + S.use(amount_to_use) + matter += value*amount_to_use + playsound(src.loc, 'sound/machines/click.ogg', 50, 1) + to_chat(user, "<span class='notice'>You insert [amount_to_use] [S.name] sheets into the [src]. </span>") + return 1 + to_chat(user, "<span class='warning'>You can't insert any more [S.name] sheets into the [src]!") + return 0 + +/obj/item/weapon/construction/proc/activate() + playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) + +/obj/item/weapon/construction/attack_self(mob/user) + playsound(src.loc, 'sound/effects/pop.ogg', 50, 0) + if(prob(20)) + spark_system.start() + +/obj/item/weapon/construction/proc/useResource(amount, mob/user) + if(matter < amount) + if(user) + to_chat(user, no_ammo_message) + return 0 + matter -= amount + desc = "A [src]. It currently holds [matter]/[max_matter] matter-units." + return 1 + +/obj/item/weapon/construction/proc/checkResource(amount, mob/user) + . = matter >= amount + if(!. && user) + to_chat(user, no_ammo_message) + return . + +/obj/item/weapon/construction/proc/range_check(atom/A, mob/user) + if(!(A in view(7, get_turf(user)))) + to_chat(user, "<span class='warning'>The \'Out of Range\' light on the [src] blinks red.</span>") + return FALSE + +/obj/item/weapon/construction/proc/prox_check(proximity) + if(!proximity) + return + + +/obj/item/weapon/construction/rcd + name = "rapid-construction-device (RCD)" + desc = "A device used to rapidly build and deconstruct walls and floors." + icon = 'icons/obj/tools.dmi' + icon_state = "rcd" + max_matter = 160 var/mode = 1 var/canRturf = 0 + var/ranged = FALSE var/airlock_type = /obj/machinery/door/airlock var/window_type = /obj/structure/window/fulltile var/advanced_airlock_setting = 1 //Set to 1 if you want more paintjobs available - var/sheetmultiplier = 4 //Controls the amount of matter added for each glass/metal sheet, triple for plasteel - var/plasteelmultiplier = 3 //Plasteel is worth 3 times more than glass or metal - var/list/conf_access = null var/use_one_access = 0 //If the airlock should require ALL or only ONE of the listed accesses. - var/delay_mod = 1 - var/no_ammo_message = "<span class='warning'>The \'Low Ammo\' light on \ - the RCD blinks yellow.</span>" -/obj/item/weapon/rcd/suicide_act(mob/user) +/obj/item/weapon/construction/rcd/suicide_act(mob/user) user.visible_message("<span class='suicide'>[user] sets the RCD to 'Wall' and points it down [user.p_their()] throat! It looks like [user.p_theyre()] trying to commit suicide..</span>") return (BRUTELOSS) -/obj/item/weapon/rcd/verb/toggle_window_type() +/obj/item/weapon/construction/rcd/verb/toggle_window_type() set name = "Toggle Window Type" set category = "Object" set src in usr // What does this do? @@ -64,7 +148,7 @@ RCD to_chat(usr, "<span class='notice'>You change \the [src]'s window mode to [window_type_name].</span>") -/obj/item/weapon/rcd/verb/change_airlock_access() +/obj/item/weapon/construction/rcd/verb/change_airlock_access() set name = "Change Airlock Access" set category = "Object" set src in usr @@ -79,7 +163,6 @@ RCD var/t1 = text("") - if(use_one_access) t1 += "Restriction Type: <a href='?src=\ref[src];access=one'>At least one access required</a><br>" else @@ -114,7 +197,7 @@ RCD popup.open() onclose(usr, "airlock") -/obj/item/weapon/rcd/Topic(href, href_list) +/obj/item/weapon/construction/rcd/Topic(href, href_list) ..() if (usr.stat || usr.restrained()) return @@ -127,7 +210,7 @@ RCD change_airlock_access() -/obj/item/weapon/rcd/proc/toggle_access(acc) +/obj/item/weapon/construction/rcd/proc/toggle_access(acc) if (acc == "all") conf_access = null else if(acc == "one") @@ -145,7 +228,7 @@ RCD if (!conf_access.len) conf_access = null -/obj/item/weapon/rcd/verb/change_airlock_setting() +/obj/item/weapon/construction/rcd/verb/change_airlock_setting() set name = "Change Airlock Setting" set category = "Object" set src in usr @@ -207,59 +290,16 @@ RCD airlock_type = /obj/machinery/door/airlock -/obj/item/weapon/rcd/New() +/obj/item/weapon/construction/rcd/New() ..() - desc = "An RCD. It currently holds [matter]/[max_matter] matter-units." - src.spark_system = new /datum/effect_system/spark_spread - spark_system.set_up(5, 0, src) - spark_system.attach(src) GLOB.rcd_list += src - -/obj/item/weapon/rcd/Destroy() - qdel(spark_system) - spark_system = null +/obj/item/weapon/construction/rcd/Destroy() GLOB.rcd_list -= src . = ..() -/obj/item/weapon/rcd/attackby(obj/item/weapon/W, mob/user, params) - if(iscyborg(user)) //Make sure cyborgs can't load their RCDs - return - var/loaded = 0 - if(istype(W, /obj/item/weapon/rcd_ammo)) - var/obj/item/weapon/rcd_ammo/R = W - if((matter + R.ammoamt) > max_matter) - to_chat(user, "<span class='warning'>The RCD can't hold any more matter-units!</span>") - return - qdel(W) - matter += R.ammoamt - playsound(src.loc, 'sound/machines/click.ogg', 50, 1) - loaded = 1 - else if(istype(W, /obj/item/stack/sheet/metal) || istype(W, /obj/item/stack/sheet/glass)) - loaded = loadwithsheets(W, sheetmultiplier, user) - else if(istype(W, /obj/item/stack/sheet/plasteel)) - loaded = loadwithsheets(W, plasteelmultiplier*sheetmultiplier, user) //Plasteel is worth 3 times more than glass or metal - if(loaded) - to_chat(user, "<span class='notice'>The RCD now holds [matter]/[max_matter] matter-units.</span>") - desc = "A RCD. It currently holds [matter]/[max_matter] matter-units." - else - return ..() - -/obj/item/weapon/rcd/proc/loadwithsheets(obj/item/stack/sheet/S, value, mob/user) - var/maxsheets = round((max_matter-matter)/value) //calculate the max number of sheets that will fit in RCD - if(maxsheets > 0) - var/amount_to_use = min(S.amount, maxsheets) - S.use(amount_to_use) - matter += value*amount_to_use - playsound(src.loc, 'sound/machines/click.ogg', 50, 1) - to_chat(user, "<span class='notice'>You insert [amount_to_use] [S.name] sheets into the RCD. </span>") - return 1 - to_chat(user, "<span class='warning'>You can't insert any more [S.name] sheets into the RCD!") - return 0 - -/obj/item/weapon/rcd/attack_self(mob/user) - //Change the mode - playsound(src.loc, 'sound/effects/pop.ogg', 50, 0) +/obj/item/weapon/construction/rcd/attack_self(mob/user) + ..() switch(mode) if(1) mode = 2 @@ -274,16 +314,14 @@ RCD mode = 1 to_chat(user, "<span class='notice'>You change RCD's mode to 'Floor & Walls'.</span>") - if(prob(20)) - src.spark_system.start() - -/obj/item/weapon/rcd/proc/activate() - playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1) - - -/obj/item/weapon/rcd/afterattack(atom/A, mob/user, proximity) - if(!proximity) +/obj/item/weapon/construction/rcd/proc/target_check(atom/A, mob/user) // only returns true for stuff the device can actually work with + if((isturf(A) && A.density && mode==RCD_DECONSTRUCT) || (isturf(A) && !A.density) || (istype(A, /obj/machinery/door/airlock) && mode==RCD_DECONSTRUCT) || istype(A, /obj/structure/grille) || (istype(A, /obj/structure/window) && mode==RCD_DECONSTRUCT) || istype(A, /obj/structure/girder)) + return TRUE + else return FALSE + +/obj/item/weapon/construction/rcd/afterattack(atom/A, mob/user, proximity) + prox_check() var/list/rcd_results = A.rcd_vals(user, src) if(!rcd_results) return FALSE @@ -295,40 +333,26 @@ RCD playsound(src.loc, 'sound/machines/click.ogg', 50, 1) return TRUE -/obj/item/weapon/rcd/proc/useResource(amount, mob/user) - if(matter < amount) - if(user) - to_chat(user, no_ammo_message) - return 0 - matter -= amount - desc = "An RCD. It currently holds [matter]/[max_matter] matter-units." - return 1 - -/obj/item/weapon/rcd/proc/checkResource(amount, mob/user) - . = matter >= amount - if(!. && user) - to_chat(user, no_ammo_message) - return . -/obj/item/weapon/rcd/proc/detonate_pulse() +/obj/item/weapon/construction/rcd/proc/detonate_pulse() audible_message("<span class='danger'><b>[src] begins to vibrate and \ buzz loudly!</b></span>","<span class='danger'><b>[src] begins \ vibrating violently!</b></span>") // 5 seconds to get rid of it addtimer(CALLBACK(src, .proc/detonate_pulse_explode), 50) -/obj/item/weapon/rcd/proc/detonate_pulse_explode() +/obj/item/weapon/construction/rcd/proc/detonate_pulse_explode() explosion(src, 0, 0, 3, 1, flame_range = 1) qdel(src) -/obj/item/weapon/rcd/borg/New() +/obj/item/weapon/construction/rcd/borg/New() ..() no_ammo_message = "<span class='warning'>Insufficient charge.</span>" desc = "A device used to rapidly build walls and floors." canRturf = 1 -/obj/item/weapon/rcd/borg/useResource(amount, mob/user) +/obj/item/weapon/construction/rcd/borg/useResource(amount, mob/user) if(!iscyborg(user)) return 0 var/mob/living/silicon/robot/borgy = user @@ -341,7 +365,7 @@ RCD to_chat(user, no_ammo_message) return . -/obj/item/weapon/rcd/borg/checkResource(amount, mob/user) +/obj/item/weapon/construction/rcd/borg/checkResource(amount, mob/user) if(!iscyborg(user)) return 0 var/mob/living/silicon/robot/borgy = user @@ -354,10 +378,10 @@ RCD to_chat(user, no_ammo_message) return . -/obj/item/weapon/rcd/loaded +/obj/item/weapon/construction/rcd/loaded matter = 160 -/obj/item/weapon/rcd/combat +/obj/item/weapon/construction/rcd/combat name = "industrial RCD" max_matter = 500 matter = 500 @@ -378,7 +402,188 @@ RCD ammoamt = 160 -/obj/item/weapon/rcd/admin +/obj/item/weapon/construction/rcd/admin name = "admin RCD" max_matter = INFINITY matter = INFINITY + + +// Ranged RCD + + +/obj/item/weapon/construction/rcd/arcd + name = "advanced rapid-construction-device (ARCD)" + desc = "A prototype RCD with ranged capability and extended capacity" + max_matter = 300 + matter = 300 + delay_mod = 0.6 + ranged = TRUE + icon_state = "arcd" + +/obj/item/weapon/construction/rcd/arcd/afterattack(atom/A, mob/user) + range_check(A,user) + if(target_check(A,user)) + user.Beam(A,icon_state="rped_upgrade",time=30) + ..() + + + +// RAPID LIGHTING DEVICE + + + +/obj/item/weapon/construction/rld + name = "rapid-light-device (RLD)" + desc = "A device used to rapidly provide lighting sources to an area." + icon = 'icons/obj/tools.dmi' + icon_state = "rld-5" + matter = 200 + max_matter = 200 + var/mode = LIGHT_MODE + actions_types = list(/datum/action/item_action/pick_color) + + var/wallcost = 10 + var/floorcost = 15 + var/launchcost = 5 + var/deconcost = 10 + + var/walldelay = 10 + var/floordelay = 10 + var/decondelay = 15 + + var/color_choice = null + + +/obj/item/weapon/construction/rld/ui_action_click(mob/user, var/datum/action/A) + if(istype(A, /datum/action/item_action/pick_color)) + color_choice = input(user,"Choose Color") as color + else + ..() + +/obj/item/weapon/construction/rld/update_icon() + icon_state = "rld-[round(matter/35)]" + ..() + + +/obj/item/weapon/construction/rld/attack_self(mob/user) + ..() + switch(mode) + if(REMOVE_MODE) + mode = LIGHT_MODE + to_chat(user, "<span class='notice'>You change RLD's mode to 'Permanent Light Construction'.</span>") + if(LIGHT_MODE) + mode = GLOW_MODE + to_chat(user, "<span class='notice'>You change RLD's mode to 'Light Launcher'.</span>") + if(GLOW_MODE) + mode = REMOVE_MODE + to_chat(user, "<span class='notice'>You change RLD's mode to 'Deconstruct'.</span>") + + +/obj/item/weapon/construction/rld/proc/checkdupes(var/target) + . = list() + var/turf/checking = get_turf(target) + for(var/obj/machinery/light/dupe in checking) + if(istype(dupe, /obj/machinery/light)) + . |= dupe + + +/obj/item/weapon/construction/rld/afterattack(atom/A, mob/user) + range_check(A,user) + var/turf/start = get_turf(src) + switch(mode) + if(REMOVE_MODE) + if(istype(A, /obj/machinery/light/)) + if(checkResource(deconcost, user)) + to_chat(user, "<span class='notice'>You start deconstructing [A]...</span>") + user.Beam(A,icon_state="nzcrentrs_power",time=15) + playsound(src.loc, 'sound/machines/click.ogg', 50, 1) + if(do_after(user, decondelay, target = A)) + if(!useResource(deconcost, user)) + return 0 + activate() + qdel(A) + return TRUE + return FALSE + if(LIGHT_MODE) + if(iswallturf(A)) + var/turf/closed/wall/W = A + if(checkResource(floorcost, user)) + to_chat(user, "<span class='notice'>You start building a wall light...</span>") + user.Beam(A,icon_state="nzcrentrs_power",time=15) + playsound(src.loc, 'sound/machines/click.ogg', 50, 1) + playsound(src.loc, 'sound/effects/light_flicker.ogg', 50, 0) + if(do_after(user, floordelay, target = A)) + if(!istype(W)) + return FALSE + var/list/candidates = list() + var/turf/open/winner = null + var/winning_dist = null + for(var/direction in GLOB.cardinal) + var/turf/C = get_step(W, direction) + var/list/dupes = checkdupes(C) + if(start.CanAtmosPass(C) && !dupes.len) + candidates += C + if(!candidates.len) + to_chat(user, "<span class='warning'>Valid target not found...</span>") + playsound(src.loc, 'sound/misc/compiler-failure.ogg', 30, 1) + return FALSE + for(var/turf/open/O in candidates) + if(istype(O)) + var/x0 = O.x + var/y0 = O.y + var/contender = cheap_hypotenuse(start.x, start.y, x0, y0) + if(!winner) + winner = O + winning_dist = contender + else + if(contender < winning_dist) // lower is better + winner = O + winning_dist = contender + activate() + if(!useResource(wallcost, user)) + return FALSE + var/light = get_turf(winner) + var/align = get_dir(winner, A) + var/obj/machinery/light/L = new /obj/machinery/light(light) + L.dir = align + L.color = color_choice + L.light_color = L.color + return TRUE + return FALSE + + if(isfloorturf(A)) + var/turf/open/floor/F = A + if(checkResource(floorcost, user)) + to_chat(user, "<span class='notice'>You start building a floor light...</span>") + user.Beam(A,icon_state="nzcrentrs_power",time=15) + playsound(src.loc, 'sound/machines/click.ogg', 50, 1) + playsound(src.loc, 'sound/effects/light_flicker.ogg', 50, 1) + if(do_after(user, floordelay, target = A)) + if(!istype(F)) + return 0 + if(!useResource(floorcost, user)) + return 0 + activate() + var/destination = get_turf(A) + var/obj/machinery/light/floor/FL = new /obj/machinery/light/floor(destination) + FL.color = color_choice + FL.light_color = FL.color + return TRUE + return FALSE + + if(GLOW_MODE) + if(useResource(launchcost, user)) + activate() + to_chat(user, "<span class='notice'>You fire a glowstick!</span>") + var/obj/item/device/flashlight/glowstick/G = new /obj/item/device/flashlight/glowstick(start) + G.color = color_choice + G.light_color = G.color + G.throw_at(A, 9, 3, user) + G.on = TRUE + G.update_brightness() + return TRUE + return FALSE + +#undef GLOW_MODE +#undef LIGHT_MODE +#undef REMOVE_MODE diff --git a/code/game/objects/items/weapons/extinguisher.dm b/code/game/objects/items/weapons/extinguisher.dm index 580c5d86051..da8d4fe97e0 100644 --- a/code/game/objects/items/weapons/extinguisher.dm +++ b/code/game/objects/items/weapons/extinguisher.dm @@ -94,6 +94,9 @@ return 0 /obj/item/weapon/extinguisher/afterattack(atom/target, mob/user , flag) + // Make it so the extinguisher doesn't spray yourself when you click your inventory items + if (target.loc == user) + return //TODO; Add support for reagents in water. if(refilling) refilling = FALSE diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index 3d8174df2a2..49cc9755463 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -45,10 +45,7 @@ if(do_mob(user, C, 30) && (C.get_num_arms() >= 2 || C.get_arm_ignore())) apply_cuffs(C,user) to_chat(user, "<span class='notice'>You handcuff [C].</span>") - if(istype(src, /obj/item/weapon/restraints/handcuffs/cable)) - feedback_add_details("handcuffs","C") - else - feedback_add_details("handcuffs","H") + feedback_add_details("handcuffs","[type]") add_logs(user, C, "handcuffed") else @@ -247,7 +244,7 @@ var/armed = 0 var/trap_damage = 20 -/obj/item/weapon/restraints/legcuffs/beartrap/New() +/obj/item/weapon/restraints/legcuffs/beartrap/Initialize() ..() icon_state = "[initial(icon_state)][armed]" @@ -278,7 +275,7 @@ C.legcuffed = src src.loc = C C.update_inv_legcuffed() - feedback_add_details("handcuffs","B") //Yes, I know they're legcuffs. Don't change this, no need for an extra variable. The "B" is used to tell them apart. + feedback_add_details("handcuffs","[type]") else if(isanimal(L)) var/mob/living/simple_animal/SA = L if(SA.mob_size > MOB_SIZE_TINY) @@ -307,9 +304,7 @@ /obj/item/weapon/restraints/legcuffs/beartrap/energy/proc/dissipate() if(!istype(loc, /mob)) - var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread - sparks.set_up(1, 1, src) - sparks.start() + do_sparks(1, TRUE, src) qdel(src) /obj/item/weapon/restraints/legcuffs/beartrap/energy/attack_hand(mob/user) @@ -341,7 +336,7 @@ C.legcuffed = src src.loc = C C.update_inv_legcuffed() - feedback_add_details("handcuffs","B") + feedback_add_details("handcuffs","[type]") to_chat(C, "<span class='userdanger'>\The [src] ensnares you!</span>") C.Weaken(weaken) diff --git a/code/game/objects/items/weapons/implants/implant_explosive.dm b/code/game/objects/items/weapons/implants/implant_explosive.dm index ad7079fee1c..369effbe7c4 100644 --- a/code/game/objects/items/weapons/implants/implant_explosive.dm +++ b/code/game/objects/items/weapons/implants/implant_explosive.dm @@ -31,7 +31,7 @@ /obj/item/weapon/implant/explosive/activate(cause) if(!cause || !imp_in || active) return 0 - if(cause == "action_button" || !popup) + if(cause == "action_button" && !popup) popup = TRUE var/response = alert(imp_in, "Are you sure you want to activate your [name]? This will cause you to explode!", "[name] Confirmation", "Yes", "No") popup = FALSE diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 0b36647b986..002c7773b47 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -106,6 +106,8 @@ /obj/item/weapon/twohanded/equip_to_best_slot(mob/M) if(..()) + if(istype(src, /obj/item/weapon/twohanded/required)) + return // unwield forces twohanded-required items to be dropped. unwield(M) return diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index d7fa0f10842..a93abfbf9df 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -12,7 +12,7 @@ /obj/structure/Initialize() if (!armor) armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 50) - ..() + . = ..() if(smooth) queue_smooth(src) queue_smooth_neighbors(src) diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index 8724136b87b..b3b83553c23 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -139,7 +139,7 @@ ..() for(var/i in 1 to 4) new /obj/item/weapon/rcd_ammo(src) - new /obj/item/weapon/rcd(src) + new /obj/item/weapon/construction/rcd(src) /obj/structure/closet/crate/science name = "science crate" diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index dfd2574bbb8..be1b49074d1 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -242,7 +242,7 @@ /obj/structure/displaycase/captain alert = 1 start_showpiece_type = /obj/item/weapon/gun/energy/laser/captain - req_access = list(GLOB.access_captain) + req_access = list(GLOB.access_cent_specops) /obj/structure/displaycase/labcage name = "lab cage" diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index 4a3ab87770d..9f37710d78d 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -396,7 +396,7 @@ new/obj/item/stack/sheet/runed_metal/(get_turf(src), 1) qdel(src) -/obj/structure/girder/rcd_vals(mob/user, obj/item/weapon/rcd/the_rcd) +/obj/structure/girder/rcd_vals(mob/user, obj/item/weapon/construction/rcd/the_rcd) switch(the_rcd.mode) if(RCD_FLOORWALL) return list("mode" = RCD_FLOORWALL, "delay" = 20, "cost" = 8) @@ -404,7 +404,7 @@ return list("mode" = RCD_DECONSTRUCT, "delay" = 20, "cost" = 13) return FALSE -/obj/structure/girder/rcd_act(mob/user, obj/item/weapon/rcd/the_rcd, passed_mode) +/obj/structure/girder/rcd_act(mob/user, obj/item/weapon/construction/rcd/the_rcd, passed_mode) var/turf/T = get_turf(src) switch(passed_mode) if(RCD_FLOORWALL) diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 478b3273b29..2dc159d4828 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -18,7 +18,7 @@ var/grille_type = null var/broken_type = /obj/structure/grille/broken -/obj/structure/grille/rcd_vals(mob/user, obj/item/weapon/rcd/the_rcd) +/obj/structure/grille/rcd_vals(mob/user, obj/item/weapon/construction/rcd/the_rcd) switch(the_rcd.mode) if(RCD_DECONSTRUCT) return list("mode" = RCD_DECONSTRUCT, "delay" = 20, "cost" = 5) @@ -26,7 +26,7 @@ return list("mode" = RCD_WINDOWGRILLE, "delay" = 40, "cost" = 10) return FALSE -/obj/structure/grille/rcd_act(mob/user, var/obj/item/weapon/rcd/the_rcd, passed_mode) +/obj/structure/grille/rcd_act(mob/user, var/obj/item/weapon/construction/rcd/the_rcd, passed_mode) switch(passed_mode) if(RCD_DECONSTRUCT) to_chat(user, "<span class='notice'>You deconstruct the grille.</span>") diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index b388fd78cfe..a13858296ac 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -188,8 +188,10 @@ GLOBAL_LIST_EMPTY(crematoriums) /obj/structure/bodycontainer/crematorium/proc/cremate(mob/user) if(locked) return //don't let you cremate something twice or w/e + // Make sure we don't delete the actual morgue and its tray + var/list/conts = GetAllContents() - src - connected - if(contents.len <= 1) + if(conts.len <= 1) audible_message("<span class='italics'>You hear a hollow crackle.</span>") return @@ -199,7 +201,7 @@ GLOBAL_LIST_EMPTY(crematoriums) locked = 1 update_icon() - for(var/mob/living/M in contents) + for(var/mob/living/M in conts) if (M.stat != DEAD) M.emote("scream") if(user) @@ -212,7 +214,7 @@ GLOBAL_LIST_EMPTY(crematoriums) M.ghostize() qdel(M) - for(var/obj/O in contents) //obj instead of obj/item so that bodybags and ashes get destroyed. We dont want tons and tons of ash piling up + for(var/obj/O in conts) //obj instead of obj/item so that bodybags and ashes get destroyed. We dont want tons and tons of ash piling up if(O != connected) //Creamtorium does not burn hot enough to destroy the tray qdel(O) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index d5bcb8b60b5..c6c2ef358bc 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -57,13 +57,13 @@ if(rods) debris += new /obj/item/stack/rods(src, rods) -/obj/structure/window/rcd_vals(mob/user, obj/item/weapon/rcd/the_rcd) +/obj/structure/window/rcd_vals(mob/user, obj/item/weapon/construction/rcd/the_rcd) switch(the_rcd.mode) if(RCD_DECONSTRUCT) return list("mode" = RCD_DECONSTRUCT, "delay" = 20, "cost" = 5) return FALSE -/obj/structure/window/rcd_act(mob/user, var/obj/item/weapon/rcd/the_rcd) +/obj/structure/window/rcd_act(mob/user, var/obj/item/weapon/construction/rcd/the_rcd) switch(the_rcd.mode) if(RCD_DECONSTRUCT) to_chat(user, "<span class='notice'>You deconstruct the window.</span>") diff --git a/code/game/sound.dm b/code/game/sound.dm index d6ed179aba2..8d0c20d63d7 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -134,18 +134,6 @@ soundin = pick('sound/machines/terminal_button01.ogg', 'sound/machines/terminal_button02.ogg', 'sound/machines/terminal_button03.ogg', \ 'sound/machines/terminal_button04.ogg', 'sound/machines/terminal_button05.ogg', 'sound/machines/terminal_button06.ogg', \ 'sound/machines/terminal_button07.ogg', 'sound/machines/terminal_button08.ogg') - //Vore sounds - if ("digestion_sounds") - soundin = pick('sound/vore/digest1.ogg', 'sound/vore/digest2.ogg', 'sound/vore/digest3.ogg', \ - 'sound/vore/digest4.ogg', 'sound/vore/digest5.ogg', 'sound/vore/digest6.ogg', \ - 'sound/vore/digest7.ogg', 'sound/vore/digest8.ogg', 'sound/vore/digest9.ogg', \ - 'sound/vore/digest10.ogg','sound/vore/digest11.ogg', 'sound/vore/digest12.ogg') - if ("death_gurgles") - soundin = pick('sound/vore/death1.ogg', 'sound/vore/death2.ogg', 'sound/vore/death3.ogg', \ - 'sound/vore/death4.ogg', 'sound/vore/death5.ogg', 'sound/vore/death6.ogg', \ - 'sound/vore/death7.ogg', 'sound/vore/death8.ogg', 'sound/vore/death9.ogg', 'sound/vore/death10.ogg') - if ("struggle_sounds") - soundin = pick('sound/vore/squish1.ogg', 'sound/vore/squish2.ogg', 'sound/vore/squish3.ogg', 'sound/vore/squish4.ogg') return soundin /proc/playsound_global(file, repeat=0, wait, channel, volume) diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index 98c28256e92..5f581fba63f 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -200,7 +200,7 @@ /turf/open/floor/acid_melt() ChangeTurf(baseturf) -/turf/open/floor/rcd_vals(mob/user, obj/item/weapon/rcd/the_rcd) +/turf/open/floor/rcd_vals(mob/user, obj/item/weapon/construction/rcd/the_rcd) switch(the_rcd.mode) if(RCD_FLOORWALL) return list("mode" = RCD_FLOORWALL, "delay" = 20, "cost" = 16) @@ -212,7 +212,7 @@ return list("mode" = RCD_WINDOWGRILLE, "delay" = 40, "cost" = 4) return FALSE -/turf/open/floor/rcd_act(mob/user, obj/item/weapon/rcd/the_rcd, passed_mode) +/turf/open/floor/rcd_act(mob/user, obj/item/weapon/construction/rcd/the_rcd, passed_mode) switch(passed_mode) if(RCD_FLOORWALL) to_chat(user, "<span class='notice'>You build a wall.</span>") diff --git a/code/game/turfs/simulated/minerals.dm b/code/game/turfs/simulated/minerals.dm index ba84d0ff113..d418c0a48a5 100644 --- a/code/game/turfs/simulated/minerals.dm +++ b/code/game/turfs/simulated/minerals.dm @@ -44,7 +44,6 @@ /turf/closed/mineral/attackby(obj/item/weapon/pickaxe/P, mob/user, params) - if (!user.IsAdvancedToolUser()) to_chat(usr, "<span class='warning'>You don't have the dexterity to do this!</span>") return @@ -67,18 +66,16 @@ feedback_add_details("pick_used_mining","[P.type]") else return attack_hand(user) - return /turf/closed/mineral/proc/gets_drilled() if (mineralType && (src.mineralAmt > 0) && (src.mineralAmt < 11)) var/i - for (i=0;i<mineralAmt;i++) + for(i in 1 to mineralAmt) new mineralType(src) - feedback_add_details("ore_mined","[mineralType]|[mineralAmt]") + feedback_add_details("ore_mined",mineralType) ChangeTurf(turf_type, defer_change) addtimer(CALLBACK(src, .proc/AfterChange), 1, TIMER_UNIQUE) playsound(src, 'sound/effects/break_stone.ogg', 50, 1) //beautiful destruction - return /turf/closed/mineral/attack_animal(mob/living/simple_animal/user) if(user.environment_smash >= 2) diff --git a/code/game/turfs/simulated/wall/reinf_walls.dm b/code/game/turfs/simulated/wall/reinf_walls.dm index c1eff8e4154..c15e478c499 100644 --- a/code/game/turfs/simulated/wall/reinf_walls.dm +++ b/code/game/turfs/simulated/wall/reinf_walls.dm @@ -251,12 +251,12 @@ if(prob(30)) dismantle_wall() -/turf/closed/wall/r_wall/rcd_vals(mob/user, obj/item/weapon/rcd/the_rcd) +/turf/closed/wall/r_wall/rcd_vals(mob/user, obj/item/weapon/construction/rcd/the_rcd) if(!the_rcd.canRturf) return FALSE return ..() -/turf/closed/wall/r_wall/rcd_act(mob/user, obj/item/weapon/rcd/the_rcd, passed_mode) +/turf/closed/wall/r_wall/rcd_act(mob/user, obj/item/weapon/construction/rcd/the_rcd, passed_mode) if(!the_rcd.canRturf) return FALSE return ..() diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 2fd5b4433ff..1aea3d7dbc4 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -258,13 +258,13 @@ /turf/closed/wall/acid_melt() dismantle_wall(1) -/turf/closed/wall/rcd_vals(mob/user, obj/item/weapon/rcd/the_rcd) +/turf/closed/wall/rcd_vals(mob/user, obj/item/weapon/construction/rcd/the_rcd) switch(the_rcd.mode) if(RCD_DECONSTRUCT) return list("mode" = RCD_DECONSTRUCT, "delay" = 40, "cost" = 26) return FALSE -/turf/closed/wall/rcd_act(mob/user, obj/item/weapon/rcd/the_rcd, passed_mode) +/turf/closed/wall/rcd_act(mob/user, obj/item/weapon/construction/rcd/the_rcd, passed_mode) switch(passed_mode) if(RCD_DECONSTRUCT) to_chat(user, "<span class='notice'>You deconstruct the wall.</span>") diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index 7262569762e..6c1e2743cd5 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -12,7 +12,7 @@ var/destination_x var/destination_y - var/global/datum/gas_mixture/space/space_gas = new + var/global/datum/gas_mixture/immutable/space/space_gas = new plane = PLANE_SPACE light_power = 0.25 dynamic_lighting = DYNAMIC_LIGHTING_DISABLED @@ -159,18 +159,29 @@ return 0 -/turf/open/space/rcd_vals(mob/user, obj/item/weapon/rcd/the_rcd) +/turf/open/space/rcd_vals(mob/user, obj/item/weapon/construction/rcd/the_rcd) if(!CanBuildHere()) return FALSE + switch(the_rcd.mode) if(RCD_FLOORWALL) return list("mode" = RCD_FLOORWALL, "delay" = 0, "cost" = 2) return FALSE -/turf/open/space/rcd_act(mob/user, obj/item/weapon/rcd/the_rcd, passed_mode) +/turf/open/space/rcd_act(mob/user, obj/item/weapon/construction/rcd/the_rcd, passed_mode) switch(passed_mode) if(RCD_FLOORWALL) to_chat(user, "<span class='notice'>You build a floor.</span>") ChangeTurf(/turf/open/floor/plating) return TRUE - return FALSE \ No newline at end of file + return FALSE + +/turf/open/space/ReplaceWithLattice() + var/dest_x = destination_x + var/dest_y = destination_y + var/dest_z = destination_z + ..() + destination_x = dest_x + destination_y = dest_y + destination_z = dest_z + diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index 93d034cc32a..fc3c2ccd057 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -172,7 +172,7 @@ message["message_sender"] = source message["message"] = msg message["source"] = "([config.cross_name])" - message["key"] = GLOB.comms_key + message["key"] = global.comms_key message["crossmessage"] = type world.Export("[config.cross_address]?[list2params(message)]") diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 55fc078cf14..92c36347f5f 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -755,11 +755,11 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that if(!holder) return - GLOB.medals_enabled = !GLOB.medals_enabled + global.medals_enabled = !global.medals_enabled - message_admins("<span class='adminnotice'>[key_name_admin(src)] [GLOB.medals_enabled ? "disabled" : "enabled"] the medal hub lockout.</span>") + message_admins("<span class='adminnotice'>[key_name_admin(src)] [global.medals_enabled ? "disabled" : "enabled"] the medal hub lockout.</span>") feedback_add_details("admin_verb","Toggle Medal Disable") // If... - log_admin("[key_name(src)] [GLOB.medals_enabled ? "disabled" : "enabled"] the medal hub lockout.") + log_admin("[key_name(src)] [global.medals_enabled ? "disabled" : "enabled"] the medal hub lockout.") /client/proc/view_runtimes() set category = "Debug" diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index 0f2ce94d31d..d7b06ee9c87 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -224,7 +224,7 @@ var/agentcount = 0 for(var/i = 0, i<numagents,i++) - shuffle(candidates) //More shuffles means more randoms + shuffle_inplace(candidates) //More shuffles means more randoms for(var/mob/j in candidates) if(!j || !j.client) candidates.Remove(j) diff --git a/code/modules/atmospherics/environmental/LINDA_turf_tile.dm b/code/modules/atmospherics/environmental/LINDA_turf_tile.dm index f78f1724d8b..7e9df7d22ce 100644 --- a/code/modules/atmospherics/environmental/LINDA_turf_tile.dm +++ b/code/modules/atmospherics/environmental/LINDA_turf_tile.dm @@ -322,10 +322,10 @@ for(var/t in turf_list) var/turf/open/T = t - if (space_is_all_consuming && !space_in_group && istype(T.air, /datum/gas_mixture/space)) + if (space_is_all_consuming && !space_in_group && istype(T.air, /datum/gas_mixture/immutable/space)) space_in_group = 1 qdel(A) - A = new/datum/gas_mixture/space() + A = new/datum/gas_mixture/immutable/space() A.merge(T.air) for(var/id in A_gases) diff --git a/code/modules/atmospherics/gasmixtures/immutable_mixtures.dm b/code/modules/atmospherics/gasmixtures/immutable_mixtures.dm new file mode 100644 index 00000000000..7dc112434f6 --- /dev/null +++ b/code/modules/atmospherics/gasmixtures/immutable_mixtures.dm @@ -0,0 +1,81 @@ +//"immutable" gas mixture used for immutable calculations +//it can be changed, but any changes will ultimately be undone before they can have any effect + +/datum/gas_mixture/immutable + var/initial_temperature + +/datum/gas_mixture/immutable/proc/reset_gas_mix() + temperature = initial_temperature + temperature_archived = initial_temperature + +/datum/gas_mixture/immutable/New() + ..() + reset_gas_mix() + +/datum/gas_mixture/immutable/garbage_collect() + reset_gas_mix() + +/datum/gas_mixture/immutable/archive() + return 1 //nothing changes, so we do nothing and the archive is successful + +/datum/gas_mixture/immutable/merge() + return 0 //we're immutable. + +/datum/gas_mixture/immutable/heat_capacity_archived() + return heat_capacity() + +/datum/gas_mixture/immutable/share(datum/gas_mixture/sharer, atmos_adjacent_turfs = 4) + . = ..(sharer, 0) + reset_gas_mix() + +/datum/gas_mixture/immutable/after_share() + temperature = initial_temperature + reset_gas_mix() + +/datum/gas_mixture/immutable/react() + return 0 //we're immutable. + +/datum/gas_mixture/immutable/copy() + return new type //we're immutable, so we can just return a new instance. + +/datum/gas_mixture/immutable/copy_from() + return 0 //we're immutable. + +/datum/gas_mixture/immutable/copy_from_turf() + return 0 //we're immutable. + +/datum/gas_mixture/immutable/parse_gas_string() + return 0 //we're immutable. + +/datum/gas_mixture/immutable/temperature_share(datum/gas_mixture/sharer, conduction_coefficient, sharer_temperature, sharer_heat_capacity) + . = ..() + temperature = initial_temperature + +//used by space tiles +/datum/gas_mixture/immutable/space + initial_temperature = TCMB + +/datum/gas_mixture/immutable/space/garbage_collect() + gases.Cut() //clever way of ensuring we always are empty. + +/datum/gas_mixture/immutable/space/heat_capacity() + return 7000 + +/datum/gas_mixture/immutable/space/remove() + return copy() //we're always empty, so we can just return a copy. + +/datum/gas_mixture/immutable/space/remove_ratio() + return copy() //we're always empty, so we can just return a copy. + + +//used by cloners +/datum/gas_mixture/immutable/cloner + initial_temperature = T20C + +/datum/gas_mixture/immutable/cloner/reset_gas_mix() + assert_gas("n2") + gases["n2"][MOLES] = MOLES_O2STANDARD + MOLES_N2STANDARD + ..() + +/datum/gas_mixture/immutable/cloner/heat_capacity() + return (MOLES_O2STANDARD + MOLES_N2STANDARD)*20 //specific heat of nitrogen is 20 diff --git a/code/modules/cargo/exports/tools.dm b/code/modules/cargo/exports/tools.dm index 71b778e931f..683f2c08cc0 100644 --- a/code/modules/cargo/exports/tools.dm +++ b/code/modules/cargo/exports/tools.dm @@ -105,7 +105,7 @@ /datum/export/rcd cost = 100 // 15 metal -> 75 credits, +25 credits for production unit_name = "rapid construction device" - export_types = list(/obj/item/weapon/rcd) + export_types = list(/obj/item/weapon/construction/rcd) /datum/export/rcd_ammo cost = 15 // 1.5 metal, 1 glass -> 12.5 credits, +2.5 credits diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index b4de0ebb0d1..b78d4d5ff47 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -279,7 +279,7 @@ GLOBAL_LIST(external_rsc_urls) add_admin_verbs() to_chat(src, get_message_output("memo")) adminGreet() - if((GLOB.comms_key == "default_pwd" || length(GLOB.comms_key) <= 6) && GLOB.comms_allowed) //It's the default value or less than 6 characters long, but it somehow didn't disable comms. + if((global.comms_key == "default_pwd" || length(global.comms_key) <= 6) && global.comms_allowed) //It's the default value or less than 6 characters long, but it somehow didn't disable comms. to_chat(src, "<span class='danger'>The server's API key is either too short or is the default value! Consider changing it immediately!</span>") /* if(mentor && !holder) diff --git a/code/modules/clothing/outfits/ert.dm b/code/modules/clothing/outfits/ert.dm index 83a8747252e..b3f74b038fa 100644 --- a/code/modules/clothing/outfits/ert.dm +++ b/code/modules/clothing/outfits/ert.dm @@ -139,7 +139,7 @@ /obj/item/weapon/melee/baton/loaded=1,\ /obj/item/clothing/mask/gas/sechailer=1,\ /obj/item/weapon/gun/energy/e_gun=1,\ - /obj/item/weapon/rcd/loaded=1) + /obj/item/weapon/construction/rcd/loaded=1) /datum/outfit/ert/engineer/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) ..() @@ -158,7 +158,7 @@ /obj/item/weapon/melee/baton/loaded=1,\ /obj/item/clothing/mask/gas/sechailer/swat=1,\ /obj/item/weapon/gun/energy/pulse/pistol/loyalpin=1,\ - /obj/item/weapon/rcd/combat=1) + /obj/item/weapon/construction/rcd/combat=1) /datum/outfit/centcom_official diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index 6cc485a34c9..d8a0c97f51c 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -67,7 +67,7 @@ obj_integrity = 300 max_integrity = 300 armor = list(melee = 10, bullet = 5, laser = 10, energy = 5, bomb = 10, bio = 100, rad = 75, fire = 50, acid = 75) - allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank/internals,/obj/item/device/t_scanner, /obj/item/weapon/rcd, /obj/item/weapon/pipe_dispenser) + allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank/internals,/obj/item/device/t_scanner, /obj/item/weapon/construction/rcd, /obj/item/weapon/pipe_dispenser) siemens_coefficient = 0 var/obj/item/clothing/head/helmet/space/hardsuit/helmet actions_types = list(/datum/action/item_action/toggle_helmet) diff --git a/code/modules/clothing/suits/miscellaneous.dm b/code/modules/clothing/suits/miscellaneous.dm index 5b8a4ab50e4..7c9c72437f6 100644 --- a/code/modules/clothing/suits/miscellaneous.dm +++ b/code/modules/clothing/suits/miscellaneous.dm @@ -493,7 +493,7 @@ icon_state = "coatengineer" item_state = "coatengineer" armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 20, fire = 30, acid = 45) - allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank/internals/emergency_oxygen,/obj/item/device/t_scanner, /obj/item/weapon/rcd, /obj/item/weapon/pipe_dispenser) + allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank/internals/emergency_oxygen,/obj/item/device/t_scanner, /obj/item/weapon/construction/rcd, /obj/item/weapon/pipe_dispenser) hoodtype = /obj/item/clothing/head/hooded/winterhood/engineering /obj/item/clothing/head/hooded/winterhood/engineering diff --git a/code/modules/events/_event.dm b/code/modules/events/_event.dm index 9b97dddb0e7..4046e7dcb80 100644 --- a/code/modules/events/_event.dm +++ b/code/modules/events/_event.dm @@ -78,7 +78,7 @@ triggering = FALSE message_admins("[key_name_admin(usr)] cancelled event [name].") log_admin_private("[key_name(usr)] cancelled event [name].") - feedback_add_details("admin_verb","Cancel Event: [typepath]") + feedback_add_details("event_admin_cancelled","[typepath]") /datum/round_event_control/proc/runEvent(random) var/datum/round_event/E = new typepath() diff --git a/code/modules/events/ghost_role.dm b/code/modules/events/ghost_role.dm index 87b72c5590f..93eff54b270 100644 --- a/code/modules/events/ghost_role.dm +++ b/code/modules/events/ghost_role.dm @@ -63,7 +63,7 @@ else regular_candidates = list() - shuffle(regular_candidates) + shuffle_inplace(regular_candidates) var/list/candidates = priority_candidates + regular_candidates diff --git a/code/modules/events/shuttle_loan.dm b/code/modules/events/shuttle_loan.dm index c3d3505e391..60d7535e5a7 100644 --- a/code/modules/events/shuttle_loan.dm +++ b/code/modules/events/shuttle_loan.dm @@ -7,7 +7,7 @@ /datum/round_event_control/shuttle_loan - name = "Shuttle loan" + name = "Shuttle Loan" typepath = /datum/round_event/shuttle_loan max_occurrences = 1 earliest_start = 4000 diff --git a/code/modules/events/spacevine.dm b/code/modules/events/spacevine.dm index 5dc56ceac89..a80147ccc73 100644 --- a/code/modules/events/spacevine.dm +++ b/code/modules/events/spacevine.dm @@ -19,7 +19,7 @@ if(turfs.len) //Pick a turf to spawn at if we can var/turf/T = pick(turfs) - new/obj/effect/spacevine_controller(T) //spawn a controller at turf + new /datum/spacevine_controller(T) //spawn a controller at turf /datum/spacevine_mutation @@ -80,12 +80,7 @@ /datum/spacevine_mutation/space_covering/New() . = ..() if(!coverable_turfs) - coverable_turfs = typecacheof(list( - /turf/open/space - )) - coverable_turfs -= typecacheof(list( - /turf/open/space/transit - )) + coverable_turfs = typecacheof(list(/turf/open/space)) - /turf/open/space/transit /datum/spacevine_mutation/space_covering/on_grow(obj/structure/spacevine/holder) process_mutation(holder) @@ -324,10 +319,10 @@ obj_integrity = 50 max_integrity = 50 var/energy = 0 - var/obj/effect/spacevine_controller/master = null + var/datum/spacevine_controller/master = null var/list/mutations = list() -/obj/structure/spacevine/New() +/obj/structure/spacevine/Initialize() ..() add_atom_colour("#ffffff", FIXED_COLOUR_PRIORITY) @@ -347,13 +342,7 @@ for(var/datum/spacevine_mutation/SM in mutations) SM.on_death(src) if(master) - master.vines -= src - master.growth_queue -= src - if(!master.vines.len) - var/obj/item/seeds/kudzu/KZ = new(loc) - KZ.mutations |= mutations - KZ.set_potency(master.mutativeness * 10) - KZ.set_production((master.spread_cap / initial(master.spread_cap)) * 5) + master.VineDestroyed(src) mutations = list() set_opacity(0) if(has_buckled_mobs()) @@ -428,41 +417,49 @@ /obj/structure/spacevine/attack_alien(mob/living/user) eat(user) -/obj/effect/spacevine_controller - invisibility = INVISIBILITY_ABSTRACT - var/list/obj/structure/spacevine/vines = list() - var/list/growth_queue = list() +/datum/spacevine_controller + var/list/obj/structure/spacevine/vines + var/list/growth_queue var/spread_multiplier = 5 var/spread_cap = 30 - var/list/GLOB.mutations_list = list() + var/list/vine_mutations_list var/mutativeness = 1 -/obj/effect/spacevine_controller/New(loc, list/muts, potency, production) - add_atom_colour("#ffffff", FIXED_COLOUR_PRIORITY) - spawn_spacevine_piece(loc, , muts) +/datum/spacevine_controller/New(turf/location, list/muts, potency, production) + spawn_spacevine_piece(location, null, muts) START_PROCESSING(SSobj, src) - init_subtypes(/datum/spacevine_mutation/, GLOB.mutations_list) + vines = list() + growth_queue = list() + vine_mutations_list = list() + init_subtypes(/datum/spacevine_mutation/, vine_mutations_list) if(potency != null) mutativeness = potency / 10 if(production != null) spread_cap *= production / 5 spread_multiplier /= production / 5 - ..() -/obj/effect/spacevine_controller/ex_act() //only killing all vines will end this suffering - return +/datum/spacevine_controller/vv_drop_down/vv_get_dropdown() + . = ..() + . += "---" + .["Delete Vines"] = "?_src_=\ref[src];purge_vines=1" -/obj/effect/spacevine_controller/singularity_act() - return +/datum/spacevine_controller/Topic(href, href_list) + if(..() || !check_rights(R_ADMIN, FALSE)) + return + + if(href_list["purge_vines"]) + if(alert(usr, "Are you sure you want to delete this spacevine cluster?", "Delete Vines", "Yes", "No") != "Yes") + return + DeleteVines() -/obj/effect/spacevine_controller/singularity_pull() - return +/datum/spacevine_controller/proc/DeleteVines() //this is kill + QDEL_LIST(vines) //this will also qdel us -/obj/effect/spacevine_controller/Destroy() +/datum/spacevine_controller/Destroy() STOP_PROCESSING(SSobj, src) return ..() -/obj/effect/spacevine_controller/proc/spawn_spacevine_piece(turf/location, obj/structure/spacevine/parent, list/muts) +/datum/spacevine_controller/proc/spawn_spacevine_piece(turf/location, obj/structure/spacevine/parent, list/muts) var/obj/structure/spacevine/SV = new(location) growth_queue += SV vines += SV @@ -476,17 +473,28 @@ var/parentcolor = parent.atom_colours[FIXED_COLOUR_PRIORITY] SV.add_atom_colour(parentcolor, FIXED_COLOUR_PRIORITY) if(prob(mutativeness)) - var/datum/spacevine_mutation/randmut = pick(GLOB.mutations_list - SV.mutations) + var/datum/spacevine_mutation/randmut = pick(vine_mutations_list - SV.mutations) randmut.add_mutation_to_vinepiece(SV) for(var/datum/spacevine_mutation/SM in SV.mutations) SM.on_birth(SV) -/obj/effect/spacevine_controller/process() - if(!vines) +/datum/spacevine_controller/proc/VineDestroyed(obj/structure/spacevine/S) + S.master = null + vines -= S + growth_queue -= S + if(!vines.len) + var/obj/item/seeds/kudzu/KZ = new(S.loc) + KZ.mutations |= S.mutations + KZ.set_potency(mutativeness * 10) + KZ.set_production((spread_cap / initial(spread_cap)) * 5) + qdel(src) + +/datum/spacevine_controller/process() + if(!LAZYLEN(vines)) qdel(src) //space vines exterminated. Remove the controller return - if(!growth_queue) + if(!LAZYLEN(growth_queue)) qdel(src) //Sanity check return diff --git a/code/modules/events/wizard/rpgloot.dm b/code/modules/events/wizard/rpgloot.dm index d651400baa0..98ae7ba6aa5 100644 --- a/code/modules/events/wizard/rpgloot.dm +++ b/code/modules/events/wizard/rpgloot.dm @@ -6,27 +6,10 @@ earliest_start = 0 /datum/round_event/wizard/rpgloot/start() - var/list/prefixespositive = list("greater", "major", "blessed", "superior", "enpowered", "honed", "true", "glorious", "robust") - var/list/prefixesnegative = list("lesser", "minor", "blighted", "inferior", "enfeebled", "rusted", "unsteady", "tragic", "gimped") - var/list/suffixes = list("orc slaying", "elf slaying", "corgi slaying", "strength", "dexterity", "constitution", "intelligence", "wisdom", "charisma", "the forest", "the hills", "the plains", "the sea", "the sun", "the moon", "the void", "the world", "the fool", "many secrets", "many tales", "many colors", "rending", "sundering", "the night", "the day") - var/upgrade_scroll_chance = 0 + var/upgrade_scroll_chance = 0 for(var/obj/item/I in world) - if(istype(I,/obj/item/organ/)) - continue - var/quality = pick(1;15, 2;14, 2;13, 2;12, 3;11, 3;10, 3;9, 4;8, 4;7, 4;6, 5;5, 5;4, 5;3, 6;2, 6;1, 6;0) - if(prob(50)) - quality = -quality - if(quality > 0) - I.name = "[pick(prefixespositive)] [I.name] of [pick(suffixes)] +[quality]" - else if(quality < 0) - I.name = "[pick(prefixesnegative)] [I.name] of [pick(suffixes)] [quality]" - else - I.name = "[I.name] of [pick(suffixes)]" - - I.force = max(0,I.force + quality) - I.throwforce = max(0,I.throwforce + quality) - for(var/value in I.armor) - I.armor[value] += quality + if(!istype(I.rpg_loot)) + I.rpg_loot = new(I) if(istype(I,/obj/item/weapon/storage)) var/obj/item/weapon/storage/S = I @@ -36,28 +19,97 @@ upgrade_scroll_chance = max(0,upgrade_scroll_chance-100) upgrade_scroll_chance += 25 + GLOB.rpg_loot_items = TRUE + /obj/item/upgradescroll - name = "Item Fortification Scroll" + name = "item fortification scroll" desc = "Somehow, this piece of paper can be applied to items to make them \"better\". Apparently there's a risk of losing the item if it's already \"too good\". <i>This all feels so arbitrary...</i>" icon = 'icons/obj/wizard.dmi' icon_state = "scroll" w_class = WEIGHT_CLASS_TINY + var/upgrade_amount = 1 + var/can_backfire = TRUE + var/one_use = TRUE + /obj/item/upgradescroll/afterattack(obj/item/target, mob/user , proximity) if(!proximity || !istype(target)) return - var/quality = target.force - initial(target.force) - if(quality > 9 && prob((quality - 9)*10)) - to_chat(user, "<span class='danger'>[target] catches fire!</span>") - if(target.resistance_flags & (LAVA_PROOF|FIRE_PROOF)) - target.resistance_flags &= ~(LAVA_PROOF|FIRE_PROOF) - target.resistance_flags |= FLAMMABLE - target.fire_act() + + var/datum/rpg_loot/rpg_loot_datum = target.rpg_loot + if(!istype(rpg_loot_datum)) + rpg_loot_datum = new /datum/rpg_loot(target) + + var/quality = rpg_loot_datum.quality + + if(can_backfire && (quality > 9 && prob((quality - 9)*10))) + to_chat(user, "<span class='danger'>[target] violently glows blue for a while, then evaporates.</span>") + target.burn() + else + to_chat(user, "<span class='notice'>[target] glows blue and seems vaguely \"better\"!</span>") + rpg_loot_datum.modify(upgrade_amount) + + if(one_use) qdel(src) - return - target.force += 1 - target.throwforce += 1 - for(var/value in target.armor) - target.armor[value] += 1 - to_chat(user, "<span class='notice'>[target] glows blue and seems vaguely \"better\"!</span>") - qdel(src) + +/obj/item/upgradescroll/unlimited + name = "unlimited foolproof item fortification scroll" + desc = "Somehow, this piece of paper can be applied to items to make them \"better\". This scroll is made from the tongues of dead paper wizards, and can be used an unlimited number of times, with no drawbacks." + one_use = FALSE + can_backfire = FALSE + +/datum/rpg_loot + var/positive_prefix = "okay" + var/negative_prefix = "weak" + var/suffix = "something profound" + var/quality = 0 + + var/obj/item/attached + var/original_name + +/datum/rpg_loot/New(attached_item=null) + attached = attached_item + + randomise() + +/datum/rpg_loot/Destroy() + attached = null + +/datum/rpg_loot/proc/randomise() + var/static/list/prefixespositive = list("greater", "major", "blessed", "superior", "enpowered", "honed", "true", "glorious", "robust") + var/static/list/prefixesnegative = list("lesser", "minor", "blighted", "inferior", "enfeebled", "rusted", "unsteady", "tragic", "gimped") + var/static/list/suffixes = list("orc slaying", "elf slaying", "corgi slaying", "strength", "dexterity", "constitution", "intelligence", "wisdom", "charisma", "the forest", "the hills", "the plains", "the sea", "the sun", "the moon", "the void", "the world", "the fool", "many secrets", "many tales", "many colors", "rending", "sundering", "the night", "the day") + + var/new_quality = pick(1;15, 2;14, 2;13, 2;12, 3;11, 3;10, 3;9, 4;8, 4;7, 4;6, 5;5, 5;4, 5;3, 6;2, 6;1, 6;0) + + suffix = pick(suffixes) + positive_prefix = pick(prefixespositive) + negative_prefix = pick(prefixesnegative) + + if(prob(50)) + new_quality = -new_quality + + modify(new_quality) + +/datum/rpg_loot/proc/rename() + var/obj/item/I = attached + if(!original_name) + original_name = I.name + if(quality < 0) + I.name = "[negative_prefix] [original_name] of [suffix] [quality]" + else if(quality == 0) + I.name = "[original_name] of [suffix]" + else if(quality > 0) + I.name = "[positive_prefix] [original_name] of [suffix] +[quality]" + +/datum/rpg_loot/proc/modify(quality_mod) + var/obj/item/I = attached + quality += quality_mod + + I.force = max(0,I.force + quality_mod) + I.throwforce = max(0,I.throwforce + quality_mod) + + for(var/value in I.armor) + I.armor[value] += quality + + rename() diff --git a/code/modules/events/wizard/shuffle.dm b/code/modules/events/wizard/shuffle.dm index e1db0666740..b6fe96ba976 100644 --- a/code/modules/events/wizard/shuffle.dm +++ b/code/modules/events/wizard/shuffle.dm @@ -21,8 +21,8 @@ if(!mobs) return - shuffle(moblocs) - shuffle(mobs) + shuffle_inplace(moblocs) + shuffle_inplace(mobs) for(var/mob/living/carbon/human/H in mobs) if(!moblocs) @@ -55,8 +55,8 @@ if(!mobs) return - shuffle(mobnames) - shuffle(mobs) + shuffle_inplace(mobnames) + shuffle_inplace(mobs) for(var/mob/living/carbon/human/H in mobs) if(!mobnames) @@ -89,7 +89,7 @@ if(!mobs) return - shuffle(mobs) + shuffle_inplace(mobs) var/obj/effect/proc_holder/spell/targeted/mind_transfer/swapper = new /obj/effect/proc_holder/spell/targeted/mind_transfer while(mobs.len > 1) diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index d735d8e534f..cd034a11174 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -538,7 +538,7 @@ Gunshots/explosions/opening doors/less rare audio (done) /obj/item/device/radio/headset/syndicate, /obj/item/weapon/grenade/plastic/c4,\ /obj/item/device/powersink, /obj/item/weapon/storage/box/syndie_kit,\ /obj/item/toy/syndicateballoon, /obj/item/weapon/gun/energy/laser/captain,\ - /obj/item/weapon/hand_tele, /obj/item/weapon/rcd, /obj/item/weapon/tank/jetpack,\ + /obj/item/weapon/hand_tele, /obj/item/weapon/construction/rcd, /obj/item/weapon/tank/jetpack,\ /obj/item/clothing/under/rank/captain, /obj/item/device/aicard,\ /obj/item/clothing/shoes/magboots, /obj/item/areaeditor/blueprints, /obj/item/weapon/disk/nuclear,\ /obj/item/clothing/suit/space/nasavoid, /obj/item/weapon/tank) @@ -673,7 +673,6 @@ Gunshots/explosions/opening doors/less rare audio (done) QDEL_IN(O, 300) - /obj/effect/hallucination/bolts var/list/doors = list() diff --git a/code/modules/games/cas.dm b/code/modules/games/cas.dm index 4cc32d9d6ad..c34325c9041 100644 --- a/code/modules/games/cas.dm +++ b/code/modules/games/cas.dm @@ -51,7 +51,7 @@ P.name = "Blank Card" P.card_icon = "cas_white" cards += P - shuffle(cards) // distribute blank cards throughout deck + shuffle_inplace(cards) // distribute blank cards throughout deck ..() /obj/item/toy/cards/deck/cas/attack_hand(mob/user) diff --git a/code/modules/holodeck/area_copy.dm b/code/modules/holodeck/area_copy.dm index 09eee814b2f..e8cde84d012 100644 --- a/code/modules/holodeck/area_copy.dm +++ b/code/modules/holodeck/area_copy.dm @@ -1,5 +1,5 @@ //Vars that will not be copied when using /DuplicateObject -GLOBAL_LIST_INIT(duplicate_forbidden_vars,list("area","type","loc","locs","vars", "parent","parent_type", "verbs","ckey","key","power_supply","contents","reagents","stat","x","y","z","group","atmos_adjacent_turfs")) +GLOBAL_LIST_INIT(duplicate_forbidden_vars,list("tag","area","type","loc","locs","vars", "parent","parent_type", "verbs","ckey","key","power_supply","contents","reagents","stat","x","y","z","group","atmos_adjacent_turfs")) /proc/DuplicateObject(atom/original, perfectcopy = TRUE, sameloc = FALSE, atom/newloc = null, nerf = FALSE, holoitem=FALSE) if(!original) diff --git a/code/modules/hydroponics/grown/kudzu.dm b/code/modules/hydroponics/grown/kudzu.dm index d5cf0f0b97c..60ff69a323c 100644 --- a/code/modules/hydroponics/grown/kudzu.dm +++ b/code/modules/hydroponics/grown/kudzu.dm @@ -38,7 +38,7 @@ to_chat(user, "<span class='notice'>You plant [src].</span>") message_admins("Kudzu planted by [ADMIN_LOOKUPFLW(user)] at [ADMIN_COORDJMP(user)]",0,1) investigate_log("was planted by [key_name(user)] at [COORD(user)]","botany") - new /obj/effect/spacevine_controller(user.loc, mutations, potency, production) + new /datum/spacevine_controller(get_turf(user), mutations, potency, production) qdel(src) /obj/item/seeds/kudzu/attack_self(mob/user) diff --git a/code/modules/hydroponics/plant_genes.dm b/code/modules/hydroponics/plant_genes.dm index 15f5fc948da..31bb564a06f 100644 --- a/code/modules/hydroponics/plant_genes.dm +++ b/code/modules/hydroponics/plant_genes.dm @@ -374,7 +374,7 @@ if(CG) // 10x charge for deafult cell charge gene - 20 000 with 100 potency. pocell.maxcharge *= CG.rate*1000 pocell.charge = pocell.maxcharge - pocell.name = "[G] battery" + pocell.name = "[G.name] battery" pocell.desc = "A rechargable plant based power cell. This one has a power rating of [pocell.maxcharge], and you should not swallow it." if(G.reagents.has_reagent("plasma", 2)) diff --git a/code/modules/mapping/map_template.dm b/code/modules/mapping/map_template.dm index ca576d24e6e..d47c4da04b2 100644 --- a/code/modules/mapping/map_template.dm +++ b/code/modules/mapping/map_template.dm @@ -46,7 +46,7 @@ var/x = round(world.maxx/2) var/y = round(world.maxy/2) - var/list/bounds = maploader.load_map(get_file(), x, y) + var/list/bounds = maploader.load_map(file(mappath), x, y) if(!bounds) return FALSE @@ -67,7 +67,7 @@ if(T.y+height > world.maxy) return - var/list/bounds = maploader.load_map(get_file(), T.x, T.y, T.z, cropMap=TRUE) + var/list/bounds = maploader.load_map(file(mappath), T.x, T.y, T.z, cropMap=TRUE) if(!bounds) return @@ -77,13 +77,6 @@ log_game("[name] loaded at at [T.x],[T.y],[T.z]") return TRUE -/datum/map_template/proc/get_file() - if(mappath) - . = file(mappath) - - if(!.) - world.log << "The file of [src] ([mappath]) appears to be empty/non-existent." - /datum/map_template/proc/get_affected_turfs(turf/T, centered = FALSE) var/turf/placement = T if(centered) diff --git a/code/modules/mining/aux_base_camera.dm b/code/modules/mining/aux_base_camera.dm index fcbced3210d..ebcd35f6df9 100644 --- a/code/modules/mining/aux_base_camera.dm +++ b/code/modules/mining/aux_base_camera.dm @@ -20,7 +20,7 @@ dir = direct //This camera eye is visible as a drone, and needs to keep the dir updated ..() -/obj/item/weapon/rcd/internal //Base console's internal RCD. Roundstart consoles are filled, rebuilt cosoles start empty. +/obj/item/weapon/construction/rcd/internal //Base console's internal RCD. Roundstart consoles are filled, rebuilt cosoles start empty. name = "internal RCD" max_matter = 600 //Bigger container and faster speeds due to being specialized and stationary. no_ammo_message = "<span class='warning'>Internal matter exhausted. Please add additional materials.</span>" @@ -30,7 +30,7 @@ name = "base contruction console" desc = "An industrial computer integrated with a camera-assisted rapid construction drone." networks = list("SS13") - var/obj/item/weapon/rcd/internal/RCD //Internal RCD. The computer passes user commands to this in order to avoid massive copypaste. + var/obj/item/weapon/construction/rcd/internal/RCD //Internal RCD. The computer passes user commands to this in order to avoid massive copypaste. circuit = /obj/item/weapon/circuitboard/computer/base_construction off_action = new/datum/action/innate/camera_off/base_construction var/datum/action/innate/aux_base/switch_mode/switch_mode_action = new //Action for switching the RCD's build modes @@ -50,7 +50,7 @@ /obj/machinery/computer/camera_advanced/base_construction/New() ..() - RCD = new /obj/item/weapon/rcd/internal(src) + RCD = new /obj/item/weapon/construction/rcd/internal(src) /obj/machinery/computer/camera_advanced/base_construction/Initialize(mapload) ..() @@ -117,7 +117,7 @@ remote_eye = C.remote_control B = target if(!B.RCD) //The console must always have an RCD. - B.RCD = new /obj/item/weapon/rcd/internal(src) //If the RCD is lost somehow, make a new (empty) one! + B.RCD = new /obj/item/weapon/construction/rcd/internal(src) //If the RCD is lost somehow, make a new (empty) one! /datum/action/innate/aux_base/proc/check_spot() //Check a loction to see if it is inside the aux base at the station. Camera visbility checks omitted so as to not hinder construction. diff --git a/code/modules/mining/equipment.dm b/code/modules/mining/equipment.dm index 2b10ab05531..02a752c2d76 100644 --- a/code/modules/mining/equipment.dm +++ b/code/modules/mining/equipment.dm @@ -68,7 +68,7 @@ /obj/item/device/wormhole_jaunter/attack_self(mob/user) user.visible_message("<span class='notice'>[user.name] activates the [src.name]!</span>") - feedback_add_details("jaunter", "U") // user activated + feedback_add_details("jaunter", "User") // user activated activate(user) /obj/item/device/wormhole_jaunter/proc/turf_check(mob/user) @@ -124,13 +124,13 @@ if(triggered) usr.visible_message("<span class='warning'>The [src] overloads and activates!</span>") - feedback_add_details("jaunter","E") // EMP accidental activation + feedback_add_details("jaunter","EMP") // EMP accidental activation activate(usr) /obj/item/device/wormhole_jaunter/proc/chasm_react(mob/user) if(user.get_item_by_slot(slot_belt) == src) to_chat(user, "Your [src] activates, saving you from the chasm!</span>") - feedback_add_details("jaunter","C") // chasm automatic activation + feedback_add_details("jaunter","Chasm") // chasm automatic activation activate(user) else to_chat(user, "The [src] is not attached to your belt, preventing it from saving you from the chasm. RIP.</span>") diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm index 630359d402b..92a764d10cc 100644 --- a/code/modules/mining/lavaland/necropolis_chests.dm +++ b/code/modules/mining/lavaland/necropolis_chests.dm @@ -87,7 +87,7 @@ user.sight |= SEE_MOBS icon_state = "lantern" wisp.orbit(user, 20) - feedback_add_details("wisp_lantern","F") // freed + feedback_add_details("wisp_lantern","Freed") // freed else to_chat(user, "<span class='notice'>You return the wisp to the lantern.</span>") @@ -102,7 +102,7 @@ wisp.stop_orbit() wisp.loc = src icon_state = "lantern-blue" - feedback_add_details("wisp_lantern","R") // returned + feedback_add_details("wisp_lantern","Returned") // returned /obj/item/device/wisp_lantern/Initialize() ..() @@ -229,7 +229,7 @@ /obj/item/device/immortality_talisman/attack_self(mob/user) if(cooldown < world.time) - feedback_add_details("immortality_talisman","U") // usage + feedback_add_details("immortality_talisman","Activated") // usage cooldown = world.time + 600 user.visible_message("<span class='danger'>[user] vanishes from reality, leaving a a hole in [user.p_their()] place!</span>") var/obj/effect/immortality_talisman/Z = new(get_turf(src.loc)) diff --git a/code/modules/mining/machine_vending.dm b/code/modules/mining/machine_vending.dm index 526f726c522..dc6bc87d189 100644 --- a/code/modules/mining/machine_vending.dm +++ b/code/modules/mining/machine_vending.dm @@ -51,9 +51,6 @@ new /datum/data/mining_equipment("Drone Ranged Upgrade",/obj/item/device/mine_bot_ugprade/cooldown, 600), new /datum/data/mining_equipment("Drone AI Upgrade", /obj/item/slimepotion/sentience/mining, 1000), new /datum/data/mining_equipment("Jump Boots", /obj/item/clothing/shoes/bhop, 2500), - new /datum/data/mining_equipment("Survival Knife", /obj/item/weapon/kitchen/knife/combat/survival, 350), - new /datum/data/mining_equipment("Stimpack", /obj/item/weapon/reagent_containers/hypospray/medipen/stimpack, 250), - new /datum/data/mining_equipment("Stimpack Economy Pack",/obj/item/weapon/storage/box/medipens/utility, 1000) ) /datum/data/mining_equipment diff --git a/code/modules/mob/living/carbon/alien/emote.dm b/code/modules/mob/living/carbon/alien/emote.dm new file mode 100644 index 00000000000..e97bb785bfb --- /dev/null +++ b/code/modules/mob/living/carbon/alien/emote.dm @@ -0,0 +1,30 @@ +/datum/emote/living/alien + mob_type_allowed_typecache = list(/mob/living/carbon/alien) + +/datum/emote/living/alien/gnarl + key = "gnarl" + key_third_person = "gnarls" + message = "gnarls and shows its teeth..." + +/datum/emote/living/alien/hiss + key = "hiss" + key_third_person = "hisses" + message_alien = "hisses." + message_larva = "hisses softly." + +/datum/emote/living/alien/hiss/run_emote(mob/user, params) + . = ..() + if(. && isalienadult(user)) + playsound(user.loc, "hiss", 40, 1, 1) + +/datum/emote/living/alien/roar + key = "roar" + key_third_person = "roars" + message_alien = "roars" + message_larva = "softly roars" + emote_type = EMOTE_AUDIBLE + +/datum/emote/living/alien/roar/run_emote(mob/user, params) + . = ..() + if(. && isalienadult(user)) + playsound(user.loc, 'sound/voice/hiss5.ogg', 40, 1, 1) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/alien/humanoid/emote.dm b/code/modules/mob/living/carbon/alien/humanoid/emote.dm deleted file mode 100644 index c6501be3576..00000000000 --- a/code/modules/mob/living/carbon/alien/humanoid/emote.dm +++ /dev/null @@ -1,88 +0,0 @@ -/mob/living/carbon/alien/humanoid/emote(act,m_type=1,message = null) - - var/param = null - if (findtext(act, "-", 1, null)) - var/t1 = findtext(act, "-", 1, null) - param = copytext(act, t1 + 1, length(act) + 1) - act = copytext(act, 1, t1) - - var/muzzled = is_muzzled() - - switch(act) //Alphabetical please - if ("deathgasp","deathgasps") - message = "<span class='name'>[src]</span> lets out a waning guttural screech, green blood bubbling from its maw..." - m_type = 2 - - if ("gnarl","gnarls") - if (!muzzled) - message = "<span class='name'>[src]</span> gnarls and shows its teeth.." - m_type = 2 - - if ("hiss","hisses") - if(!muzzled) - message = "<span class='name'>[src]</span> hisses." - m_type = 2 - - if ("me") - ..() - return - - if ("moan","moans") - message = "<span class='name'>[src]</span> moans!" - m_type = 2 - - if ("roar","roars") - if (!muzzled) - message = "<span class='name'>[src]</span> roars." - m_type = 2 - - if ("roll","rolls") - if (!src.restrained()) - message = "<span class='name'>[src]</span> rolls." - m_type = 1 - - if ("scratch","scratches") - if (!src.restrained()) - message = "<span class='name'>[src]</span> scratches." - m_type = 1 - - if ("screech","screeches") - if (!muzzled) - message = "<span class='name'>[src]</span> screeches." - m_type = 2 - - if ("shiver","shivers") - message = "<span class='name'>[src]</span> shivers." - m_type = 2 - - if ("sign","signs") - if (!src.restrained()) - message = text("<span class='name'>[src]</span> signs[].", (text2num(param) ? text(" the number []", text2num(param)) : null)) - m_type = 1 - - if ("tail") - message = "<span class='name'>[src]</span> waves its tail." - m_type = 1 - - if ("help") //This is an exception - src << "Help for xenomorph emotes. You can use these emotes with say \"*emote\":\n\naflap, airguitar, blink, blink_r, blush, bow, burp, choke, chucke, clap, collapse, cough, dance, deathgasp, drool, flap, frown, gasp, giggle, glare-(none)/mob, gnarl, hiss, jump, laugh, look-atom, me, moan, nod, point-atom, roar, roll, scream, scratch, screech, shake, shiver, sign-#, sit, smile, sneeze, sniff, snore, stare-(none)/mob, sulk, sway, tail, tremble, twitch, twitch_s, wave, whimper, wink, yawn" - - else - ..(act) - - if ((message && src.stat == 0)) - log_emote("[name]/[key] : [message]") - if (act == "roar") - playsound(src.loc, 'sound/voice/hiss5.ogg', 40, 1, 1) - - if (act == "hiss") - playsound(src.loc, "hiss", 40, 1, 1) - - if (act == "deathgasp") - playsound(src.loc, 'sound/voice/hiss6.ogg', 80, 1, 1) - - if (m_type & 1) - visible_message(message) - else - audible_message(message) - return \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 6349e48edc4..213477674af 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -234,9 +234,11 @@ if(usr.canUseTopic(src, BE_CLOSE, NO_DEXTERY)) if(href_list["embedded_object"]) - var/obj/item/I = locate(href_list["embedded_object"]) - var/obj/item/bodypart/L = locate(href_list["embedded_limb"]) - if(!I || !L || I.loc != src || !(I in L.embedded_objects)) //no item, no limb, or item is not in limb or in the person anymore + var/obj/item/bodypart/L = locate(href_list["embedded_limb"]) in bodyparts + if(!L) + return + var/obj/item/I = locate(href_list["embedded_object"]) in L.embedded_objects + if(!I || I.loc != src) //no item, no limb, or item is not in limb or in the person anymore return var/time_taken = I.embedded_unsafe_removal_time*I.w_class usr.visible_message("<span class='warning'>[usr] attempts to remove [I] from their [L.name].</span>","<span class='notice'>You attempt to remove [I] from your [L.name]... (It will take [time_taken/10] seconds.)</span>") @@ -921,18 +923,14 @@ return if(!riding_datum) riding_datum = new /datum/riding/human(src) - if(buckled_mobs && ((M in buckled_mobs) || (buckled_mobs.len >= max_buckled_mobs))) - return - if(buckled) //NO INFINITE STACKING!! - return - if(M.stat != CONSCIOUS) + if(buckled_mobs && ((M in buckled_mobs) || (buckled_mobs.len >= max_buckled_mobs)) || buckled || (M.stat != CONSCIOUS)) return if(iscarbon(M)) if(M.incapacitated(FALSE, TRUE) || incapacitated(FALSE, TRUE)) - M.visible_message("<span class='boldwarning'>[M] can't hang onto [src]!</span>") + M.visible_message("<span class='warning'>[M] can't hang onto [src]!</span>") return if(!riding_datum.equip_buckle_inhands(M, 2)) //MAKE SURE THIS IS LAST!! - M.visible_message("<span class='boldwarning'>[M] can't climb onto [src] because [M.p_their()] hands are full!</span>") + M.visible_message("<span class='warning'>[M] can't climb onto [src]!</span>") return . = ..(M, force, check_loc) stop_pulling() diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index d41b90ed3dc..d34ea0b0a48 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -685,7 +685,7 @@ to_chat(src, "\t [status == "OK" ? "\blue" : "\red"] Your [LB.name] is [status].") for(var/obj/item/I in LB.embedded_objects) - to_chat(src, "\t <a href='byond://?src=\ref[src];embedded_object=\ref[I];embedded_limb=\ref[LB]'>\red There is \a [I] embedded in your [LB.name]!</a>") + to_chat(src, "\t <a href='byond://?src=\ref[src];embedded_object=\ref[I];embedded_limb=\ref[LB]'class='warning'> There is \a [I] embedded in your [LB.name]!</a>") for(var/t in missing) to_chat(src, "<span class='boldannounce'>Your [parse_zone(t)] is missing!</span>") diff --git a/code/modules/mob/living/carbon/human/interactive.dm b/code/modules/mob/living/carbon/human/interactive.dm index 744e8f9844b..f80e949ede4 100644 --- a/code/modules/mob/living/carbon/human/interactive.dm +++ b/code/modules/mob/living/carbon/human/interactive.dm @@ -277,7 +277,7 @@ for(var/X in bodyparts) var/obj/item/bodypart/BP = X if(prob((FUZZY_CHANCE_LOW+FUZZY_CHANCE_HIGH)/4)) - BP.change_bodypart_status(BODYPART_ROBOTIC) + BP.change_bodypart_status(BODYPART_ROBOTIC, FALSE, TRUE) update_icons() update_damage_overlays() functions = list("nearbyscan","combat","shitcurity","chatter") // stop customize adding multiple copies of a function diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 2afa202bfa3..331fc5fc956 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -141,7 +141,7 @@ return not_handled //For future deeper overrides -/mob/living/carbon/human/doUnEquip(obj/item/I, force, newloc, no_move, invdrop) +/mob/living/carbon/human/doUnEquip(obj/item/I, force, newloc, no_move, invdrop = TRUE) . = ..() //See mob.dm for an explanation on this and some rage about people copypasting instead of calling ..() like they should. if(!. || !I) return diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 57bfb426235..8a062b9e336 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -117,6 +117,12 @@ if(thing && (!thing.species_exception || !is_type_in_list(src,thing.species_exception))) C.dropItemToGround(thing) + // this needs to be FIRST because qdel calls update_body which checks if we have DIGITIGRADE legs or not and if not then removes DIGITIGRADE from species_traits + if(("legs" in C.dna.species.mutant_bodyparts) && C.dna.features["legs"] == "Digitigrade Legs") + species_traits += DIGITIGRADE + if(DIGITIGRADE in species_traits) + C.Digitigrade_Leg_Swap(FALSE) + var/obj/item/organ/heart/heart = C.getorganslot("heart") var/obj/item/organ/lungs/lungs = C.getorganslot("lungs") var/obj/item/organ/appendix/appendix = C.getorganslot("appendix") @@ -157,10 +163,7 @@ if(exotic_bloodtype && C.dna.blood_type != exotic_bloodtype) C.dna.blood_type = exotic_bloodtype - if(("legs" in C.dna.species.mutant_bodyparts) && C.dna.features["legs"] == "Digitigrade Legs") - species_traits += DIGITIGRADE - if(DIGITIGRADE in species_traits) - C.Digitigrade_Leg_Swap(FALSE) + if(NOAROUSAL in species_traits) C.canbearoused = FALSE else diff --git a/code/modules/mob/living/carbon/human/species_types/android.dm b/code/modules/mob/living/carbon/human/species_types/android.dm index 3a6a45b7218..f211de52bc8 100644 --- a/code/modules/mob/living/carbon/human/species_types/android.dm +++ b/code/modules/mob/living/carbon/human/species_types/android.dm @@ -12,10 +12,10 @@ . = ..() for(var/X in C.bodyparts) var/obj/item/bodypart/O = X - O.change_bodypart_status(BODYPART_ROBOTIC) + O.change_bodypart_status(BODYPART_ROBOTIC, 0, 1) /datum/species/android/on_species_loss(mob/living/carbon/C) . = ..() for(var/X in C.bodyparts) var/obj/item/bodypart/O = X - O.change_bodypart_status(BODYPART_ORGANIC) \ No newline at end of file + O.change_bodypart_status(BODYPART_ORGANIC,FALSE, TRUE) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/monkey/combat.dm b/code/modules/mob/living/carbon/monkey/combat.dm index 7eed766eaab..c6c50252d75 100644 --- a/code/modules/mob/living/carbon/monkey/combat.dm +++ b/code/modules/mob/living/carbon/monkey/combat.dm @@ -132,6 +132,10 @@ return 0 /mob/living/carbon/monkey/proc/handle_combat() + // Don't do any AI if inside another mob (devoured) + if (ismob(loc)) + // Really no idea what needs to be returned but everything else is TRUE + return TRUE if(on_fire || buckled || restrained()) if(!resisting && prob(MONKEY_RESIST_PROB)) diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 4abba829beb..39040b983cc 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -287,7 +287,7 @@ basic_modules = list( /obj/item/device/assembly/flash/cyborg, /obj/item/borg/sight/meson, - /obj/item/weapon/rcd/borg, + /obj/item/weapon/construction/rcd/borg, /obj/item/weapon/pipe_dispenser, /obj/item/weapon/extinguisher, /obj/item/weapon/weldingtool/largetank/cyborg, diff --git a/code/modules/mob/living/simple_animal/guardian/guardian.dm b/code/modules/mob/living/simple_animal/guardian/guardian.dm index 1eec40c264f..e49e4120478 100644 --- a/code/modules/mob/living/simple_animal/guardian/guardian.dm +++ b/code/modules/mob/living/simple_animal/guardian/guardian.dm @@ -338,7 +338,7 @@ GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians to_chat(src, "<span class='danger'><B>You don't have another mode!</span></B>") /mob/living/simple_animal/hostile/guardian/proc/ToggleLight() - if(!luminosity) + if(light_range<3) to_chat(src, "<span class='notice'>You activate your light.</span>") set_light(3) else diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm index 24b8b9b1ee6..2e64ee526e7 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm @@ -326,7 +326,7 @@ Difficulty: Hard pools_to_remove = get_pools(get_turf(target), 1) pools -= pools_to_remove if(pools.len) - shuffle(pools) + shuffle_inplace(pools) found_bloodpool = pick(pools) if(found_bloodpool) visible_message("<span class='danger'>[src] sinks into the blood...</span>") diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm index dcb37610cf2..8af5c76f5be 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm @@ -118,7 +118,7 @@ if(admin_spawned) return FALSE - if(GLOB.medal_hub && GLOB.medal_pass && GLOB.medals_enabled) + if(global.medal_hub && global.medal_pass && global.medals_enabled) for(var/mob/living/L in view(7,src)) if(L.stat) continue @@ -135,11 +135,11 @@ if(!player || !medal) return - if(GLOB.medal_hub && GLOB.medal_pass && GLOB.medals_enabled) + if(global.medal_hub && global.medal_pass && global.medals_enabled) spawn() - var/result = world.SetMedal(medal, player, GLOB.medal_hub, GLOB.medal_pass) + var/result = world.SetMedal(medal, player, global.medal_hub, global.medal_pass) if(isnull(result)) - GLOB.medals_enabled = FALSE + global.medals_enabled = FALSE log_game("MEDAL ERROR: Could not contact hub to award medal:[medal] player:[player.ckey]") message_admins("Error! Failed to contact hub to award [medal] medal to [player.ckey]!") else if (result) @@ -150,7 +150,7 @@ if(!score || !player) return - if(GLOB.medal_hub && GLOB.medal_pass && GLOB.medals_enabled) + if(global.medal_hub && global.medal_pass && global.medals_enabled) spawn() var/list/oldscore = GetScore(score,player,1) @@ -164,10 +164,10 @@ var/newscoreparam = list2params(oldscore) - var/result = world.SetScores(player.ckey, newscoreparam, GLOB.medal_hub, GLOB.medal_pass) + var/result = world.SetScores(player.ckey, newscoreparam, global.medal_hub, global.medal_pass) if(isnull(result)) - GLOB.medals_enabled = FALSE + global.medals_enabled = FALSE log_game("SCORE ERROR: Could not contact hub to set score. Score:[score] player:[player.ckey]") message_admins("Error! Failed to contact hub to set [score] score for [player.ckey]!") @@ -176,11 +176,11 @@ if(!score || !player) return - if(GLOB.medal_hub && GLOB.medal_pass && GLOB.medals_enabled) + if(global.medal_hub && global.medal_pass && global.medals_enabled) - var/scoreget = world.GetScores(player.ckey, score, GLOB.medal_hub, GLOB.medal_pass) + var/scoreget = world.GetScores(player.ckey, score, global.medal_hub, global.medal_pass) if(isnull(scoreget)) - GLOB.medals_enabled = FALSE + global.medals_enabled = FALSE log_game("SCORE ERROR: Could not contact hub to get score. Score:[score] player:[player.ckey]") message_admins("Error! Failed to contact hub to get score: [score] for [player.ckey]!") return @@ -197,12 +197,12 @@ if(!player || !medal) return - if(GLOB.medal_hub && GLOB.medal_pass && GLOB.medals_enabled) + if(global.medal_hub && global.medal_pass && global.medals_enabled) - var/result = world.GetMedal(medal, player, GLOB.medal_hub, GLOB.medal_pass) + var/result = world.GetMedal(medal, player, global.medal_hub, global.medal_pass) if(isnull(result)) - GLOB.medals_enabled = FALSE + global.medals_enabled = FALSE log_game("MEDAL ERROR: Could not contact hub to get medal:[medal] player:[player.ckey]") message_admins("Error! Failed to contact hub to get [medal] medal for [player.ckey]!") else if (result) @@ -212,12 +212,12 @@ if(!player || !medal) return - if(GLOB.medal_hub && GLOB.medal_pass && GLOB.medals_enabled) + if(global.medal_hub && global.medal_pass && global.medals_enabled) - var/result = world.ClearMedal(medal, player, GLOB.medal_hub, GLOB.medal_pass) + var/result = world.ClearMedal(medal, player, global.medal_hub, global.medal_pass) if(isnull(result)) - GLOB.medals_enabled = FALSE + global.medals_enabled = FALSE log_game("MEDAL ERROR: Could not contact hub to clear medal:[medal] player:[player.ckey]") message_admins("Error! Failed to contact hub to clear [medal] medal for [player.ckey]!") else if (result) @@ -227,6 +227,6 @@ /proc/ClearScore(client/player) - world.SetScores(player.ckey, "", GLOB.medal_hub, GLOB.medal_pass) + world.SetScores(player.ckey, "", global.medal_hub, global.medal_pass) #undef MEDAL_PREFIX diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm index 0afd30e137f..ca0ef6a7ea7 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm @@ -1014,7 +1014,7 @@ last_tendril = FALSE break if(last_tendril && !admin_spawned) - if(GLOB.medal_hub && GLOB.medal_pass && GLOB.medals_enabled) + if(global.medal_hub && global.medal_pass && global.medals_enabled) for(var/mob/living/L in view(7,src)) if(L.stat) continue diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 6a11e28e802..72fe84de458 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -253,7 +253,7 @@ /obj/item/weapon/paper/proc/openhelp(mob/user) - user << browse({"<HTML><HEAD><TITLE>Pen Help</TITLE></HEAD> + user << browse({"<HTML><HEAD><TITLE>Paper Help</TITLE></HEAD> <BODY> <b><center>Crayon&Pen commands</center></b><br> <br> @@ -279,6 +279,9 @@ if(usr.stat || usr.restrained()) return + if(href_list["help"]) + openhelp(usr) + return if(href_list["write"]) var/id = href_list["write"] var/t = stripped_multiline_input("Enter what you want to write:", "Write", no_trim=TRUE) @@ -303,7 +306,7 @@ info += t // Oh, he wants to edit to the end of the file, let him. updateinfolinks() i.on_write(src,usr) - usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info_links]<HR>[stamps]</BODY></HTML>", "window=[name]") // Update the window + usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info_links]<HR>[stamps]</BODY><div align='right'style='position:fixed;bottom:0;font-style:bold;'><A href='?src=\ref[src];help=1'>\[?\]</A></div></HTML>", "window=[name]") // Update the window update_icon() @@ -318,7 +321,7 @@ if(istype(P, /obj/item/weapon/pen) || istype(P, /obj/item/toy/crayon)) if(user.is_literate()) - user << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info_links]<HR>[stamps]</BODY></HTML>", "window=[name]") + user << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info_links]<HR>[stamps]</BODY><div align='right'style='position:fixed;bottom:0;font-style:bold;'><A href='?src=\ref[src];help=1'>\[?\]</A></div></HTML>", "window=[name]") return else to_chat(user, "<span class='notice'>You don't know how to read or write.</span>") diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm index 2b9c212d177..401c745b0f2 100644 --- a/code/modules/paperwork/photocopier.dm +++ b/code/modules/paperwork/photocopier.dm @@ -89,6 +89,10 @@ c.fields = copy.fields c.update_icon() c.updateinfolinks() + c.stamps = copy.stamps + if(copy.stamped) + c.stamped = copy.stamped.Copy() + c.copy_overlays(copy, TRUE) toner-- busy = 1 sleep(15) diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 5ea803ed745..133fad1b4d8 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -350,9 +350,7 @@ else to_chat(user, "<span class='userdanger'>You stick \the [W] into the light socket!</span>") if(has_power() && (W.flags & CONDUCT)) - var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread - s.set_up(3, 1, src) - s.start() + do_sparks(3, TRUE, src) if (prob(75)) electrocute_mob(user, get_area(src), src, rand(0.7,1.0), TRUE) else @@ -523,9 +521,7 @@ if(status == LIGHT_OK || status == LIGHT_BURNED) playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1) if(on) - var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread - s.set_up(3, 1, src) - s.start() + do_sparks(3, TRUE, src) status = LIGHT_BROKEN update() @@ -653,3 +649,14 @@ force = 5 playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1) update() + + +/obj/machinery/light/floor + name = "floor light" + icon = 'icons/obj/lighting.dmi' + base_state = "floor" // base description and icon_state + icon_state = "floor1" + brightness = 4 + layer = 2.5 + light_type = /obj/item/weapon/light/bulb + fitting = "bulb" diff --git a/code/modules/power/singularity/containment_field.dm b/code/modules/power/singularity/containment_field.dm index 5f2c050c17c..c3bf399ed13 100644 --- a/code/modules/power/singularity/containment_field.dm +++ b/code/modules/power/singularity/containment_field.dm @@ -123,9 +123,7 @@ if(hasShocked) return 0 hasShocked = 1 - var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread - s.set_up(5, 1, AM.loc) - s.start() + do_sparks(5, TRUE, AM.loc) var/atom/target = get_edge_target_turf(AM, get_dir(src, get_step_away(AM, src))) AM.throw_at(target, 200, 4) addtimer(CALLBACK(src, .proc/clear_shock), 5) diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index 1fa2bf23767..50a24b76ffa 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -1,5 +1,3 @@ - - /obj/machinery/power/emitter name = "Emitter" desc = "A heavy duty industrial laser.\n<span class='notice'>Alt-click to rotate it clockwise.</span>" @@ -9,6 +7,11 @@ anchored = 0 density = 1 req_access = list(GLOB.access_engine_equip) + + // The following 3 vars are mostly for the prototype + var/manual = FALSE + var/charge = 0 + var/atom/target = null use_power = 0 idle_power_usage = 10 @@ -28,6 +31,8 @@ var/projectile_sound = 'sound/weapons/emitter.ogg' + var/datum/effect_system/spark_spread/sparks + /obj/machinery/power/emitter/New() ..() var/obj/item/weapon/circuitboard/machine/B = new /obj/item/weapon/circuitboard/machine/emitter(null) @@ -87,11 +92,15 @@ if(state == 2 && anchored) connect_to_network() + sparks = new + sparks.set_up(5, TRUE, src) + /obj/machinery/power/emitter/Destroy() if(SSticker && SSticker.current_state == GAME_STATE_PLAYING) message_admins("Emitter deleted at ([x],[y],[z] - <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)",0,1) log_game("Emitter deleted at ([x],[y],[z])") investigate_log("<font color='red'>deleted</font> at ([x],[y],[z]) at [get_area(src)]","singulo") + QDEL_NULL(sparks) return ..() /obj/machinery/power/emitter/update_icon() @@ -168,9 +177,11 @@ investigate_log("lost power and turned <font color='red'>off</font> at [get_area(src)]","singulo") log_game("Emitter lost power in ([x],[y],[z])") return - if(!check_delay()) + if(charge <=80) + charge+=5 + if(!check_delay() || manual == TRUE) return FALSE - fire_beam() + fire_beam(target) /obj/machinery/power/emitter/proc/check_delay() if((src.last_shot + src.fire_delay) <= world.time) @@ -186,36 +197,62 @@ add_load(active_power_usage) fire_beam() -/obj/machinery/power/emitter/proc/fire_beam() - src.last_shot = world.time - if(src.shot_number < 3) - src.fire_delay = 20 - src.shot_number ++ - else - src.fire_delay = rand(minimum_fire_delay,maximum_fire_delay) - src.shot_number = 0 - var/obj/item/projectile/A = new projectile_type(src.loc) - A.setDir(src.dir) - playsound(src.loc, projectile_sound, 25, 1) +/obj/machinery/power/emitter/proc/fire_beam(atom/targeted_atom, mob/user) + var/turf/targets_from = get_turf(src) + if(targeted_atom == user|| targeted_atom == targets_from) + return + var/obj/item/projectile/P = new projectile_type(targets_from) + playsound(src.loc, projectile_sound, 50, 1) if(prob(35)) - var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread - s.set_up(5, 1, src) - s.start() + sparks.start() switch(dir) if(NORTH) - A.yo = 20 - A.xo = 0 + P.yo = 20 + P.xo = 0 + if(NORTHEAST) + P.yo = 20 + P.xo = 20 if(EAST) - A.yo = 0 - A.xo = 20 + P.yo = 0 + P.xo = 20 + if(SOUTHEAST) + P.yo = -20 + P.xo = 20 if(WEST) - A.yo = 0 - A.xo = -20 + P.yo = 0 + P.xo = -20 + if(SOUTHWEST) + P.yo = -20 + P.xo = -20 + if(NORTHWEST) + P.yo = 20 + P.xo = -20 else // Any other - A.yo = -20 - A.xo = 0 - A.starting = loc - A.fire() + P.yo = -20 + P.xo = 0 + if(target) + P.yo = targeted_atom.y - targets_from.y + P.xo = targeted_atom.x - targets_from.x + P.current = targets_from + P.starting = targets_from + P.firer = src + P.original = targeted_atom + if(!manual) + last_shot = world.time + if(shot_number < 3) + fire_delay = 20 + shot_number ++ + else + fire_delay = rand(minimum_fire_delay,maximum_fire_delay) + shot_number = 0 + if(!target) + P.setDir(src.dir) + P.starting = loc + else + if(QDELETED(target)) + target = null + P.fire() + return P /obj/machinery/power/emitter/can_be_unfasten_wrench(mob/user, silent) if(state == EM_WELDED) @@ -308,3 +345,148 @@ emagged = 1 if(user) user.visible_message("[user.name] emags the [src.name].","<span class='notice'>You short out the lock.</span>") + + +/obj/machinery/power/emitter/prototype + name = "Prototype Emitter" + icon = 'icons/obj/turrets.dmi' + icon_state = "protoemitter" + icon_state_on = "protoemitter_+a" + can_buckle = TRUE + buckle_lying = 0 + var/view_range = 12 + var/datum/action/innate/protoemitter/firing/auto + +//BUCKLE HOOKS + +/obj/machinery/power/emitter/prototype/unbuckle_mob(mob/living/buckled_mob,force = 0) + playsound(src,'sound/mecha/mechmove01.ogg', 50, 1) + manual = FALSE + for(var/obj/item/I in buckled_mob.held_items) + if(istype(I, /obj/item/weapon/turret_control)) + qdel(I) + if(istype(buckled_mob)) + buckled_mob.pixel_x = 0 + buckled_mob.pixel_y = 0 + if(buckled_mob.client) + buckled_mob.client.change_view(world.view) + auto.Remove(buckled_mob) + . = ..() + +/obj/machinery/power/emitter/prototype/user_buckle_mob(mob/living/M, mob/living/carbon/user) + if(user.incapacitated() || !istype(user)) + return + for(var/atom/movable/A in get_turf(src)) + if(A.density && (A != src && A != M)) + return + M.forceMove(get_turf(src)) + ..() + playsound(src,'sound/mecha/mechmove01.ogg', 50, 1) + M.pixel_y = 14 + layer = 4.1 + if(M.client) + M.client.change_view(view_range) + if(!auto) + auto = new() + auto.Grant(M, src) + +/datum/action/innate/protoemitter + check_flags = AB_CHECK_RESTRAINED | AB_CHECK_STUNNED | AB_CHECK_CONSCIOUS + var/obj/machinery/power/emitter/prototype/PE + var/mob/living/carbon/U + + +/datum/action/innate/protoemitter/Grant(mob/living/carbon/L, obj/machinery/power/emitter/prototype/proto) + PE = proto + U = L + . = ..() + +/datum/action/innate/protoemitter/firing + name = "Switch to Manual Firing" + desc = "The emitter will only fire on your command and at your designated target" + button_icon_state = "mech_zoom_on" + +/datum/action/innate/protoemitter/firing/Activate() + if(PE.manual) + playsound(PE,'sound/mecha/mechmove01.ogg', 50, 1) + PE.manual = FALSE + name = "Switch to Manual Firing" + desc = "The emitter will only fire on your command and at your designated target" + button_icon_state = "mech_zoom_on" + for(var/obj/item/I in U.held_items) + if(istype(I, /obj/item/weapon/turret_control)) + qdel(I) + UpdateButtonIcon() + return + else + playsound(PE,'sound/mecha/mechmove01.ogg', 50, 1) + name = "Switch to Automatic Firing" + desc = "Emitters will switch to periodic firing at your last target" + button_icon_state = "mech_zoom_off" + PE.manual = TRUE + for(var/V in U.held_items) + var/obj/item/I = V + if(istype(I)) + if(U.dropItemToGround(I)) + var/obj/item/weapon/turret_control/TC = new /obj/item/weapon/turret_control() + U.put_in_hands(TC) + else //Entries in the list should only ever be items or null, so if it's not an item, we can assume it's an empty hand + var/obj/item/weapon/turret_control/TC = new /obj/item/weapon/turret_control() + U.put_in_hands(TC) + UpdateButtonIcon() + + +/obj/item/weapon/turret_control + name = "turret controls" + icon_state = "offhand" + w_class = WEIGHT_CLASS_HUGE + flags = ABSTRACT | NODROP + resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF | NOBLUDGEON + var/delay = 0 + +/obj/item/weapon/turret_control/afterattack(atom/targeted_atom, mob/user) + ..() + var/obj/machinery/power/emitter/E = user.buckled + E.setDir(get_dir(E,targeted_atom)) + user.setDir(E.dir) + switch(E.dir) + if(NORTH) + E.layer = 3.9 + user.pixel_x = 0 + user.pixel_y = -14 + if(NORTHEAST) + E.layer = 3.9 + user.pixel_x = -8 + user.pixel_y = -12 + if(EAST) + E.layer = 4.1 + user.pixel_x = -14 + user.pixel_y = 0 + if(SOUTHEAST) + E.layer = 3.9 + user.pixel_x = -8 + user.pixel_y = 12 + if(SOUTH) + E.layer = 4.1 + user.pixel_x = 0 + user.pixel_y = 14 + if(SOUTHWEST) + E.layer = 3.9 + user.pixel_x = 8 + user.pixel_y = 12 + if(WEST) + E.layer = 4.1 + user.pixel_x = 14 + user.pixel_y = 0 + if(NORTHWEST) + E.layer = 3.9 + user.pixel_x = 8 + user.pixel_y = -12 + + if(E.charge >= 10 && world.time > delay) + E.charge -= 10 + E.target = targeted_atom + E.fire_beam(targeted_atom, user) + delay = world.time + 10 + else if (E.charge < 10) + playsound(get_turf(user),'sound/machines/buzz-sigh.ogg', 50, 1) diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index de0d230a39c..e03eaf944ac 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -152,9 +152,7 @@ return var/obj/structure/cable/N = T.get_cable_node() //get the connecting node cable, if there's one if (prob(50) && electrocute_mob(usr, N, N, 1, TRUE)) //animate the electrocution if uncautious and unlucky - var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread - s.set_up(5, 1, src) - s.start() + do_sparks(5, TRUE, src) return C.use(10) diff --git a/code/modules/power/terminal.dm b/code/modules/power/terminal.dm index bfe94d55164..5cae8b3c911 100644 --- a/code/modules/power/terminal.dm +++ b/code/modules/power/terminal.dm @@ -62,9 +62,7 @@ if(do_after(user, 50*W.toolspeed, target = src)) if(!master || master.can_terminal_dismantle()) if(prob(50) && electrocute_mob(user, powernet, src, 1, TRUE)) - var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread - s.set_up(5, 1, master) - s.start() + do_sparks(5, TRUE, master) return new /obj/item/stack/cable_coil(loc, 10) to_chat(user, "<span class='notice'>You cut the cables and dismantle the power terminal.</span>") diff --git a/code/modules/projectiles/pins.dm b/code/modules/projectiles/pins.dm index 907082cc8b7..2347cc3c7c1 100644 --- a/code/modules/projectiles/pins.dm +++ b/code/modules/projectiles/pins.dm @@ -95,9 +95,8 @@ var/obj/item/weapon/implant/req_implant = null /obj/item/device/firing_pin/implant/pin_auth(mob/living/user) - if(iscarbon(user)) - var/mob/living/carbon/C = user - for(var/obj/item/weapon/implant/I in C.implants) + if(istype(user)) + for(var/obj/item/weapon/implant/I in user.implants) if(req_implant && I.type == req_implant) return 1 return 0 diff --git a/code/modules/projectiles/projectile/bullets.dm b/code/modules/projectiles/projectile/bullets.dm index 9ac83c5f5f2..7ef0d315616 100644 --- a/code/modules/projectiles/projectile/bullets.dm +++ b/code/modules/projectiles/projectile/bullets.dm @@ -49,10 +49,8 @@ ..() /obj/item/projectile/bullet/pellet/weak/on_range() - var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread - sparks.set_up(1, 1, src) - sparks.start() - ..() + do_sparks(1, TRUE, src) + ..() /obj/item/projectile/bullet/pellet/overload damage = 3 @@ -66,11 +64,9 @@ explosion(target, 0, 0, 2) /obj/item/projectile/bullet/pellet/overload/on_range() - explosion(src, 0, 0, 2) - var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread - sparks.set_up(3, 3, src) - sparks.start() - ..() + explosion(src, 0, 0, 2) + do_sparks(3, TRUE, src) + ..() /obj/item/projectile/bullet/midbullet damage = 20 diff --git a/code/modules/projectiles/projectile/energy.dm b/code/modules/projectiles/projectile/energy.dm index 980ff11211e..fca31019ff1 100644 --- a/code/modules/projectiles/projectile/energy.dm +++ b/code/modules/projectiles/projectile/energy.dm @@ -21,9 +21,7 @@ /obj/item/projectile/energy/electrode/on_hit(atom/target, blocked = 0) . = ..() if(!ismob(target) || blocked >= 100) //Fully blocked by mob or collided with dense object - burst into sparks! - var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread - sparks.set_up(1, 1, src) - sparks.start() + do_sparks(1, TRUE, src) else if(iscarbon(target)) var/mob/living/carbon/C = target if(C.dna && C.dna.check_mutation(HULK)) @@ -32,9 +30,7 @@ addtimer(CALLBACK(C, /mob/living/carbon.proc/do_jitter_animation, jitter), 5) /obj/item/projectile/energy/electrode/on_range() //to ensure the bolt sparks when it reaches the end of its range if it didn't hit a target yet - var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread - sparks.set_up(1, 1, src) - sparks.start() + do_sparks(1, TRUE, src) ..() /obj/item/projectile/energy/net @@ -45,7 +41,7 @@ hitsound = 'sound/weapons/taserhit.ogg' range = 10 -/obj/item/projectile/energy/net/New() +/obj/item/projectile/energy/net/Initialize() ..() SpinAnimation() @@ -53,13 +49,11 @@ if(isliving(target)) var/turf/Tloc = get_turf(target) if(!locate(/obj/effect/nettingportal) in Tloc) - new/obj/effect/nettingportal(Tloc) + new /obj/effect/nettingportal(Tloc) ..() /obj/item/projectile/energy/net/on_range() - var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread - sparks.set_up(1, 1, src) - sparks.start() + do_sparks(1, TRUE, src) ..() /obj/effect/nettingportal @@ -69,7 +63,7 @@ icon_state = "dragnetfield" anchored = 1 -/obj/effect/nettingportal/New() +/obj/effect/nettingportal/Initialize() ..() set_light(3) var/obj/item/device/radio/beacon/teletarget = null @@ -77,16 +71,18 @@ if(com.target) if(com.power_station && com.power_station.teleporter_hub && com.power_station.engaged) teletarget = com.target + + addtimer(CALLBACK(src, .proc/pop, teletarget), 30) + +/obj/effect/nettingportal/proc/pop(teletarget) if(teletarget) - spawn(30) - for(var/mob/living/L in get_turf(src)) - do_teleport(L, teletarget, 2)//teleport what's in the tile to the beacon - qdel(src) + for(var/mob/living/L in get_turf(src)) + do_teleport(L, teletarget, 2)//teleport what's in the tile to the beacon else - spawn(30) - for(var/mob/living/L in get_turf(src)) - do_teleport(L, L, 15) //Otherwise it just warps you off somewhere. - qdel(src) + for(var/mob/living/L in get_turf(src)) + do_teleport(L, L, 15) //Otherwise it just warps you off somewhere. + + qdel(src) /obj/item/projectile/energy/trap @@ -106,7 +102,7 @@ ..() /obj/item/projectile/energy/trap/on_range() - new/obj/item/weapon/restraints/legcuffs/beartrap/energy(loc) + new /obj/item/weapon/restraints/legcuffs/beartrap/energy(loc) ..() /obj/item/projectile/energy/trap/cyborg @@ -119,21 +115,16 @@ /obj/item/projectile/energy/trap/cyborg/on_hit(atom/target, blocked = 0) if(!ismob(target) || blocked >= 100) - var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread - sparks.set_up(1, 1, src) - sparks.start() + do_sparks(1, TRUE, src) qdel(src) if(iscarbon(target)) var/obj/item/weapon/restraints/legcuffs/beartrap/B = new /obj/item/weapon/restraints/legcuffs/beartrap/energy/cyborg(get_turf(target)) B.Crossed(target) - spawn(10) - qdel(src) + QDEL_IN(src, 10) ..() /obj/item/projectile/energy/trap/cyborg/on_range() - var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread - sparks.set_up(1, 1, src) - sparks.start() + do_sparks(1, TRUE, src) qdel(src) /obj/item/projectile/energy/declone diff --git a/code/modules/reagents/chemistry/reagents/blob_reagents.dm b/code/modules/reagents/chemistry/reagents/blob_reagents.dm index e940081db39..948da607f83 100644 --- a/code/modules/reagents/chemistry/reagents/blob_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/blob_reagents.dm @@ -261,7 +261,6 @@ color = "#EFD65A" complementary_color = "#00E5B1" message_living = ", and you feel a horrible tingling sensation" - var/datum/effect_system/spark_spread/spark_system = new/datum/effect_system/spark_spread() /datum/reagent/blob/energized_jelly/reaction_mob(mob/living/M, method=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/O) reac_volume = ..() @@ -272,8 +271,7 @@ /datum/reagent/blob/energized_jelly/damage_reaction(obj/structure/blob/B, damage, damage_type, damage_flag) if((damage_flag == "melee" || damage_flag == "bullet" || damage_flag == "laser") && B.obj_integrity - damage <= 0 && prob(10)) - spark_system.set_up(rand(2, 4), 0, B) - spark_system.start() + do_sparks(rand(2, 4), FALSE, B) return ..() /datum/reagent/blob/energized_jelly/tesla_reaction(obj/structure/blob/B, power) diff --git a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm index 0357f0dbdc4..805aa936d43 100644 --- a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm +++ b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm @@ -216,9 +216,7 @@ if(holder.has_reagent("stabilizing_agent")) return var/location = get_turf(holder.my_atom) - var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread - s.set_up(2, 1, location) - s.start() + do_sparks(2, TRUE, location) for(var/mob/living/carbon/C in get_hearers_in_view(created_volume/3, location)) if(C.flash_act()) if(get_dist(C, location) < 4) @@ -235,9 +233,7 @@ /datum/chemical_reaction/flash_powder_flash/on_reaction(datum/reagents/holder, created_volume) var/location = get_turf(holder.my_atom) - var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread - s.set_up(2, 1, location) - s.start() + do_sparks(2, TRUE, location) for(var/mob/living/carbon/C in get_hearers_in_view(created_volume/10, location)) if(C.flash_act()) if(get_dist(C, location) < 4) @@ -402,4 +398,4 @@ required_reagents = list("nitrous_oxide" = 1) strengthdiv = 7 required_temp = 575 - modifier = 1 \ No newline at end of file + modifier = 1 diff --git a/code/modules/reagents/chemistry/recipes/slime_extracts.dm b/code/modules/reagents/chemistry/recipes/slime_extracts.dm index 7246a26ce5c..f270fa567fa 100644 --- a/code/modules/reagents/chemistry/recipes/slime_extracts.dm +++ b/code/modules/reagents/chemistry/recipes/slime_extracts.dm @@ -1,8 +1,11 @@ /datum/chemical_reaction/slime + var/deletes_extract = TRUE /datum/chemical_reaction/slime/on_reaction(datum/reagents/holder) - delete_extract(holder) + feedback_add_details("slime_cores_used","[type]") + if(deletes_extract) + delete_extract(holder) /datum/chemical_reaction/slime/proc/delete_extract(datum/reagents/holder) var/obj/item/slime_extract/M = holder.my_atom @@ -19,12 +22,9 @@ required_other = 1 /datum/chemical_reaction/slime/slimespawn/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") var/mob/living/simple_animal/slime/S S = new(get_turf(holder.my_atom), "grey") - S.visible_message("<span class='danger'>Infused with plasma, the \ - core begins to quiver and grow, and soon a new baby slime \ - emerges from it!</span>") + S.visible_message("<span class='danger'>Infused with plasma, the core begins to quiver and grow, and a new baby slime emerges from it!</span>") ..() /datum/chemical_reaction/slime/slimeinaprov @@ -35,10 +35,6 @@ required_other = 1 required_container = /obj/item/slime_extract/grey -/datum/chemical_reaction/slime/slimeinaprov/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - ..() - /datum/chemical_reaction/slime/slimemonkey name = "Slime Monkey" id = "m_monkey" @@ -47,10 +43,8 @@ required_other = 1 /datum/chemical_reaction/slime/slimemonkey/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - for(var/i = 1, i <= 3, i++) - var /obj/item/weapon/reagent_containers/food/snacks/monkeycube/M = new /obj/item/weapon/reagent_containers/food/snacks/monkeycube - M.loc = get_turf(holder.my_atom) + for(var/i in 1 to 3) + new /obj/item/weapon/reagent_containers/food/snacks/monkeycube(get_turf(holder.my_atom)) ..() //Green @@ -62,10 +56,6 @@ required_other = 1 required_container = /obj/item/slime_extract/green -/datum/chemical_reaction/slime/slimemutate/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - ..() - //Mutated Green /datum/chemical_reaction/slime/slimemutate_unstable name = "Unstable Mutation Toxin" @@ -76,10 +66,6 @@ required_container = /obj/item/slime_extract/green mix_message = "<span class='info'>The mixture rapidly expands and contracts, its appearance shifting into a sickening green.</span>" -/datum/chemical_reaction/slime/slimemutate_unstable/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - ..() - //Metal /datum/chemical_reaction/slime/slimemetal name = "Slime Metal" @@ -89,10 +75,9 @@ required_other = 1 /datum/chemical_reaction/slime/slimemetal/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") var/turf/location = get_turf(holder.my_atom) - new /obj/item/stack/sheet/plasteel (location, 5) - new /obj/item/stack/sheet/metal (location, 15) + new /obj/item/stack/sheet/plasteel(location, 5) + new /obj/item/stack/sheet/metal(location, 15) ..() /datum/chemical_reaction/slime/slimeglass @@ -103,60 +88,49 @@ required_other = 1 /datum/chemical_reaction/slime/slimeglass/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") var/turf/location = get_turf(holder.my_atom) - new /obj/item/stack/sheet/rglass (location, 5) - new /obj/item/stack/sheet/glass (location, 15) + new /obj/item/stack/sheet/rglass(location, 5) + new /obj/item/stack/sheet/glass(location, 15) ..() //Gold -/datum/chemical_reaction/slime/slimecrit +/datum/chemical_reaction/slime/slimemobspawn name = "Slime Crit" id = "m_tele" required_reagents = list("plasma" = 1) required_container = /obj/item/slime_extract/gold required_other = 1 + deletes_extract = FALSE //we do delete, but we don't do so instantly -/datum/chemical_reaction/slime/slimecrit/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") +/datum/chemical_reaction/slime/slimemobspawn/on_reaction(datum/reagents/holder) var/turf/T = get_turf(holder.my_atom) - T.visible_message("<span class='danger'>The slime extract begins to vibrate violently !</span>") - addtimer(CALLBACK(src, .proc/chemical_mob_spawn, holder, 5, "Gold Slime"), 50) + summon_mobs(T) var/obj/item/slime_extract/M = holder.my_atom deltimer(M.qdel_timer) + ..() M.qdel_timer = addtimer(CALLBACK(src, .proc/delete_extract, holder), 55, TIMER_STOPPABLE) -/datum/chemical_reaction/slime/slimecritlesser +/datum/chemical_reaction/slime/slimemobspawn/proc/summon_mobs(datum/reagents/holder, turf/T) + T.visible_message("<span class='danger'>The slime extract begins to vibrate violently!</span>") + addtimer(CALLBACK(src, .proc/chemical_mob_spawn, holder, 5, "Gold Slime"), 50) + +/datum/chemical_reaction/slime/slimemobspawn/lesser name = "Slime Crit Lesser" id = "m_tele3" required_reagents = list("blood" = 1) - required_container = /obj/item/slime_extract/gold - required_other = 1 -/datum/chemical_reaction/slime/slimecritlesser/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/turf/T = get_turf(holder.my_atom) - T.visible_message("<span class='danger'>The slime extract begins to vibrate violently !</span>") +/datum/chemical_reaction/slime/slimemobspawn/lesser/summon_mobs(datum/reagents/holder, turf/T) + T.visible_message("<span class='danger'>The slime extract begins to vibrate violently!</span>") addtimer(CALLBACK(src, .proc/chemical_mob_spawn, holder, 3, "Lesser Gold Slime", "neutral"), 50) - var/obj/item/slime_extract/M = holder.my_atom - deltimer(M.qdel_timer) - M.qdel_timer = addtimer(CALLBACK(src, .proc/delete_extract, holder), 55, TIMER_STOPPABLE) -/datum/chemical_reaction/slime/slimecritfriendly +/datum/chemical_reaction/slime/slimemobspawn/friendly name = "Slime Crit Friendly" id = "m_tele5" required_reagents = list("water" = 1) - required_container = /obj/item/slime_extract/gold - required_other = 1 -/datum/chemical_reaction/slime/slimecritfriendly/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/turf/T = get_turf(holder.my_atom) - T.visible_message("<span class='danger'>The slime extract begins to vibrate adorably !</span>") +/datum/chemical_reaction/slime/slimemobspawn/friendly/summon_mobs(datum/reagents/holder, turf/T) + T.visible_message("<span class='danger'>The slime extract begins to vibrate adorably!</span>") addtimer(CALLBACK(src, .proc/chemical_mob_spawn, holder, 1, "Friendly Gold Slime", "neutral"), 50) - var/obj/item/slime_extract/M = holder.my_atom - deltimer(M.qdel_timer) - M.qdel_timer = addtimer(CALLBACK(src, .proc/delete_extract, holder), 55, TIMER_STOPPABLE) //Silver /datum/chemical_reaction/slime/slimebork @@ -167,8 +141,24 @@ required_other = 1 /datum/chemical_reaction/slime/slimebork/on_reaction(datum/reagents/holder) + //BORK BORK BORK + var/list/borks = getborks() + var/turf/T = get_turf(holder.my_atom) - feedback_add_details("slime_cores_used","[type]") + playsound(T, 'sound/effects/phasein.ogg', 100, 1) + + for(var/mob/living/carbon/C in viewers(T, null)) + C.flash_act() + + for(var/i in 1 to 4 + rand(1,2)) + var/chosen = pick(borks) + var/obj/B = new chosen(T) + if(prob(50)) + for(var/j in 1 to rand(1, 3)) + step(B, pick(NORTH,SOUTH,EAST,WEST)) + ..() + +/datum/chemical_reaction/slime/slimebork/proc/getborks() var/list/blocked = list(/obj/item/weapon/reagent_containers/food/snacks, /obj/item/weapon/reagent_containers/food/snacks/store/bread, /obj/item/weapon/reagent_containers/food/snacks/breadslice, @@ -188,53 +178,15 @@ ) blocked |= typesof(/obj/item/weapon/reagent_containers/food/snacks/customizable) - var/list/borks = typesof(/obj/item/weapon/reagent_containers/food/snacks) - blocked - // BORK BORK BORK - - playsound(get_turf(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1) - - for(var/mob/living/carbon/C in viewers(get_turf(holder.my_atom), null)) - C.flash_act() - - for(var/i = 1, i <= 4 + rand(1,2), i++) - var/chosen = pick(borks) - var/obj/B = new chosen - if(B) - B.loc = get_turf(holder.my_atom) - if(prob(50)) - for(var/j = 1, j <= rand(1, 3), j++) - step(B, pick(NORTH,SOUTH,EAST,WEST)) - ..() - + return typesof(/obj/item/weapon/reagent_containers/food/snacks) - blocked -/datum/chemical_reaction/slime/slimebork2 +/datum/chemical_reaction/slime/slimebork/drinks name = "Slime Bork 2" id = "m_tele4" required_reagents = list("water" = 1) - required_container = /obj/item/slime_extract/silver - required_other = 1 - -/datum/chemical_reaction/slime/slimebork2/on_reaction(datum/reagents/holder) - - feedback_add_details("slime_cores_used","[type]") - var/list/borks = subtypesof(/obj/item/weapon/reagent_containers/food/drinks) - // BORK BORK BORK - - playsound(get_turf(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1) - - for(var/mob/living/carbon/M in viewers(get_turf(holder.my_atom), null)) - M.flash_act() - - for(var/i = 1, i <= 4 + rand(1,2), i++) - var/chosen = pick(borks) - var/obj/B = new chosen - if(B) - B.loc = get_turf(holder.my_atom) - if(prob(50)) - for(var/j = 1, j <= rand(1, 3), j++) - step(B, pick(NORTH,SOUTH,EAST,WEST)) - ..() +/datum/chemical_reaction/slime/slimebork/drinks/getborks() + return subtypesof(/obj/item/weapon/reagent_containers/food/drinks) //Blue /datum/chemical_reaction/slime/slimefrost @@ -245,11 +197,6 @@ required_container = /obj/item/slime_extract/blue required_other = 1 -/datum/chemical_reaction/slime/slimefrost/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - ..() - - /datum/chemical_reaction/slime/slimestabilizer name = "Slime Stabilizer" id = "m_slimestabilizer" @@ -258,12 +205,9 @@ required_other = 1 /datum/chemical_reaction/slime/slimestabilizer/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/obj/item/slimepotion/stabilizer/P = new /obj/item/slimepotion/stabilizer - P.loc = get_turf(holder.my_atom) + new /obj/item/slimepotion/stabilizer(get_turf(holder.my_atom)) ..() - /datum/chemical_reaction/slime/slimefoam name = "Slime Foam" id = "m_foam" @@ -272,11 +216,6 @@ required_container = /obj/item/slime_extract/blue required_other = 1 -/datum/chemical_reaction/slime/slimefoam/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - ..() - - //Dark Blue /datum/chemical_reaction/slime/slimefreeze name = "Slime Freeze" @@ -286,12 +225,12 @@ required_other = 1 /datum/chemical_reaction/slime/slimefreeze/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") var/turf/T = get_turf(holder.my_atom) T.visible_message("<span class='danger'>The slime extract begins to vibrate adorably!</span>") addtimer(CALLBACK(src, .proc/freeze, holder), 50) var/obj/item/slime_extract/M = holder.my_atom deltimer(M.qdel_timer) + ..() M.qdel_timer = addtimer(CALLBACK(src, .proc/delete_extract, holder), 55, TIMER_STOPPABLE) /datum/chemical_reaction/slime/slimefreeze/proc/freeze(datum/reagents/holder) @@ -300,8 +239,6 @@ if(istype(T)) T.atmos_spawn_air("freon=50;TEMP=120") - - /datum/chemical_reaction/slime/slimefireproof name = "Slime Fireproof" id = "m_fireproof" @@ -310,9 +247,7 @@ required_other = 1 /datum/chemical_reaction/slime/slimefireproof/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/obj/item/slimepotion/fireproof/P = new /obj/item/slimepotion/fireproof - P.loc = get_turf(holder.my_atom) + new /obj/item/slimepotion/fireproof(get_turf(holder.my_atom)) ..() //Orange @@ -324,24 +259,21 @@ required_container = /obj/item/slime_extract/orange required_other = 1 -/datum/chemical_reaction/slime/slimecasp/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - ..() - /datum/chemical_reaction/slime/slimefire name = "Slime fire" id = "m_fire" required_reagents = list("plasma" = 1) required_container = /obj/item/slime_extract/orange required_other = 1 + deletes_extract = FALSE /datum/chemical_reaction/slime/slimefire/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/turf/TU = get_turf(holder.my_atom) - TU.visible_message("<span class='danger'>The slime extract begins to vibrate adorably!</span>") + var/turf/T = get_turf(holder.my_atom) + T.visible_message("<span class='danger'>The slime extract begins to vibrate adorably!</span>") addtimer(CALLBACK(src, .proc/slime_burn, holder), 50) var/obj/item/slime_extract/M = holder.my_atom deltimer(M.qdel_timer) + ..() M.qdel_timer = addtimer(CALLBACK(src, .proc/delete_extract, holder), 55, TIMER_STOPPABLE) /datum/chemical_reaction/slime/slimefire/proc/slime_burn(datum/reagents/holder) @@ -359,12 +291,7 @@ required_container = /obj/item/slime_extract/orange required_other = 1 -/datum/chemical_reaction/slime/slimesmoke/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - ..() - //Yellow - /datum/chemical_reaction/slime/slimeoverload name = "Slime EMP" id = "m_emp" @@ -373,11 +300,9 @@ required_other = 1 /datum/chemical_reaction/slime/slimeoverload/on_reaction(datum/reagents/holder, created_volume) - feedback_add_details("slime_cores_used","[type]") empulse(get_turf(holder.my_atom), 3, 7) ..() - /datum/chemical_reaction/slime/slimecell name = "Slime Powercell" id = "m_cell" @@ -386,9 +311,7 @@ required_other = 1 /datum/chemical_reaction/slime/slimecell/on_reaction(datum/reagents/holder, created_volume) - feedback_add_details("slime_cores_used","[type]") - var/obj/item/weapon/stock_parts/cell/high/slime/P = new /obj/item/weapon/stock_parts/cell/high/slime - P.loc = get_turf(holder.my_atom) + new /obj/item/weapon/stock_parts/cell/high/slime(get_turf(holder.my_atom)) ..() /datum/chemical_reaction/slime/slimeglow @@ -399,15 +322,12 @@ required_other = 1 /datum/chemical_reaction/slime/slimeglow/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") var/turf/T = get_turf(holder.my_atom) T.visible_message("<span class='danger'>The slime begins to emit a soft light. Squeezing it will cause it to grow brightly.</span>") - var/obj/item/device/flashlight/slime/F = new /obj/item/device/flashlight/slime - F.loc = get_turf(holder.my_atom) + new /obj/item/device/flashlight/slime(T) ..() //Purple - /datum/chemical_reaction/slime/slimepsteroid name = "Slime Steroid" id = "m_steroid" @@ -416,9 +336,7 @@ required_other = 1 /datum/chemical_reaction/slime/slimepsteroid/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/obj/item/slimepotion/steroid/P = new /obj/item/slimepotion/steroid - P.loc = get_turf(holder.my_atom) + new /obj/item/slimepotion/steroid(get_turf(holder.my_atom)) ..() /datum/chemical_reaction/slime/slimejam @@ -429,11 +347,6 @@ required_container = /obj/item/slime_extract/purple required_other = 1 -/datum/chemical_reaction/slime/slimejam/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - ..() - - //Dark Purple /datum/chemical_reaction/slime/slimeplasma name = "Slime Plasma" @@ -443,9 +356,7 @@ required_other = 1 /datum/chemical_reaction/slime/slimeplasma/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/turf/location = get_turf(holder.my_atom) - new /obj/item/stack/sheet/mineral/plasma (location, 3) + new /obj/item/stack/sheet/mineral/plasma(get_turf(holder.my_atom), 3) ..() //Red @@ -458,9 +369,7 @@ required_other = 1 /datum/chemical_reaction/slime/slimemutator/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/obj/item/slimepotion/mutator/P = new /obj/item/slimepotion/mutator - P.loc = get_turf(holder.my_atom) + new /obj/item/slimepotion/mutator(get_turf(holder.my_atom)) ..() /datum/chemical_reaction/slime/slimebloodlust @@ -471,13 +380,11 @@ required_other = 1 /datum/chemical_reaction/slime/slimebloodlust/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") for(var/mob/living/simple_animal/slime/slime in viewers(get_turf(holder.my_atom), null)) slime.rabid = 1 slime.visible_message("<span class='danger'>The [slime] is driven into a frenzy!</span>") ..() - /datum/chemical_reaction/slime/slimespeed name = "Slime Speed" id = "m_speed" @@ -486,12 +393,9 @@ required_other = 1 /datum/chemical_reaction/slime/slimespeed/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/obj/item/slimepotion/speed/P = new /obj/item/slimepotion/speed - P.loc = get_turf(holder.my_atom) + new /obj/item/slimepotion/speed(get_turf(holder.my_atom)) ..() - //Pink /datum/chemical_reaction/slime/docility name = "Docility Potion" @@ -501,9 +405,7 @@ required_other = 1 /datum/chemical_reaction/slime/docility/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/obj/item/slimepotion/docility/P = new /obj/item/slimepotion/docility - P.loc = get_turf(holder.my_atom) + new /obj/item/slimepotion/docility(get_turf(holder.my_atom)) ..() /datum/chemical_reaction/slime/gender @@ -514,9 +416,7 @@ required_other = 1 /datum/chemical_reaction/slime/gender/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/obj/item/slimepotion/genderchange/G = new /obj/item/slimepotion/genderchange - G.loc = get_turf(holder.my_atom) + new /obj/item/slimepotion/genderchange(get_turf(holder.my_atom)) ..() //Black @@ -528,10 +428,6 @@ required_other = 1 required_container = /obj/item/slime_extract/black -/datum/chemical_reaction/slime/slimemutate2/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - ..() - //Oil /datum/chemical_reaction/slime/slimeexplosion name = "Slime Explosion" @@ -539,9 +435,9 @@ required_reagents = list("plasma" = 1) required_container = /obj/item/slime_extract/oil required_other = 1 + deletes_extract = FALSE /datum/chemical_reaction/slime/slimeexplosion/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") var/turf/T = get_turf(holder.my_atom) var/lastkey = holder.my_atom.fingerprintslast var/touch_msg = "N/A" @@ -554,6 +450,7 @@ addtimer(CALLBACK(src, .proc/boom, holder), 50) var/obj/item/slime_extract/M = holder.my_atom deltimer(M.qdel_timer) + ..() M.qdel_timer = addtimer(CALLBACK(src, .proc/delete_extract, holder), 55, TIMER_STOPPABLE) /datum/chemical_reaction/slime/slimeexplosion/proc/boom(datum/reagents/holder) @@ -569,10 +466,6 @@ required_container = /obj/item/slime_extract/oil required_other = 1 -/datum/chemical_reaction/slime/slimecornoil/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - ..() - //Light Pink /datum/chemical_reaction/slime/slimepotion2 name = "Slime Potion 2" @@ -582,9 +475,7 @@ required_other = 1 /datum/chemical_reaction/slime/slimepotion2/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/obj/item/slimepotion/sentience/P = new /obj/item/slimepotion/sentience - P.loc = get_turf(holder.my_atom) + new /obj/item/slimepotion/sentience ..() //Adamantine @@ -596,10 +487,7 @@ required_other = 1 /datum/chemical_reaction/slime/slimegolem/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/obj/effect/golemrune/Z = new /obj/effect/golemrune - Z.loc = get_turf(holder.my_atom) - notify_ghosts("Golem rune created in [get_area(Z)].", 'sound/effects/ghost2.ogg', source = Z) + new /obj/effect/golemrune(get_turf(holder.my_atom)) ..() /datum/chemical_reaction/slime/slimegolem2 @@ -610,9 +498,7 @@ required_other = 1 /datum/chemical_reaction/slime/slimegolem2/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/obj/item/golem_shell/artificial/Z = new /obj/item/golem_shell/artificial - Z.loc = get_turf(holder.my_atom) + new /obj/item/golem_shell/artificial(get_turf(holder.my_atom)) ..() //Bluespace @@ -624,10 +510,7 @@ required_other = 1 /datum/chemical_reaction/slime/slimefloor2/on_reaction(datum/reagents/holder, created_volume) - feedback_add_details("slime_cores_used","[type]") - var/obj/item/stack/tile/bluespace/P = new /obj/item/stack/tile/bluespace - P.amount = 25 - P.loc = get_turf(holder.my_atom) + new /obj/item/stack/tile/bluespace(get_turf(holder.my_atom), 25) ..() @@ -639,10 +522,8 @@ required_other = 1 /datum/chemical_reaction/slime/slimecrystal/on_reaction(datum/reagents/holder, created_volume) - feedback_add_details("slime_cores_used","[type]") - if(holder.my_atom) - var/obj/item/weapon/ore/bluespace_crystal/BC = new(get_turf(holder.my_atom)) - BC.visible_message("<span class='notice'>The [BC.name] appears out of thin air!</span>") + var/obj/item/weapon/ore/bluespace_crystal/BC = new (get_turf(holder.my_atom)) + BC.visible_message("<span class='notice'>The [BC.name] appears out of thin air!</span>") ..() //Cerulean @@ -654,12 +535,9 @@ required_other = 1 /datum/chemical_reaction/slime/slimepsteroid2/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/obj/item/slimepotion/enhancer/P = new /obj/item/slimepotion/enhancer - P.loc = get_turf(holder.my_atom) + new /obj/item/slimepotion/enhancer(get_turf(holder.my_atom)) ..() - /datum/chemical_reaction/slime/slime_territory name = "Slime Territory" id = "s_territory" @@ -668,9 +546,7 @@ required_other = 1 /datum/chemical_reaction/slime/slime_territory/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/obj/item/areaeditor/blueprints/slime/P = new /obj/item/areaeditor/blueprints/slime - P.loc = get_turf(holder.my_atom) + new /obj/item/areaeditor/blueprints/slime(get_turf(holder.my_atom)) ..() //Sepia @@ -682,15 +558,12 @@ required_other = 1 /datum/chemical_reaction/slime/slimestop/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/mob/mob = get_mob_by_key(holder.my_atom.fingerprintslast) var/obj/effect/timestop/T = new /obj/effect/timestop - T.loc = get_turf(holder.my_atom) - T.immune += mob + T.forceMove(get_turf(holder.my_atom)) + T.immune += get_mob_by_key(holder.my_atom.fingerprintslast) T.timestop() ..() - /datum/chemical_reaction/slime/slimecamera name = "Slime Camera" id = "m_camera" @@ -699,11 +572,8 @@ required_other = 1 /datum/chemical_reaction/slime/slimecamera/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/obj/item/device/camera/P = new /obj/item/device/camera - P.loc = get_turf(holder.my_atom) - var/obj/item/device/camera_film/Z = new /obj/item/device/camera_film - Z.loc = get_turf(holder.my_atom) + new /obj/item/device/camera(get_turf(holder.my_atom)) + new /obj/item/device/camera_film(get_turf(holder.my_atom)) ..() /datum/chemical_reaction/slime/slimefloor @@ -714,16 +584,10 @@ required_other = 1 /datum/chemical_reaction/slime/slimefloor/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/obj/item/stack/tile/sepia/P = new /obj/item/stack/tile/sepia - P.amount = 25 - P.loc = get_turf(holder.my_atom) + new /obj/item/stack/tile/sepia(get_turf(holder.my_atom), 25) ..() - //Pyrite - - /datum/chemical_reaction/slime/slimepaint name = "Slime Paint" id = "s_paint" @@ -732,15 +596,10 @@ required_other = 1 /datum/chemical_reaction/slime/slimepaint/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/list/paints = subtypesof(/obj/item/weapon/paint) - var/chosen = pick(paints) - var/obj/P = new chosen - if(P) - P.loc = get_turf(holder.my_atom) + var/chosen = pick(subtypesof(/obj/item/weapon/paint)) + new chosen(get_turf(holder.my_atom)) ..() - /datum/chemical_reaction/slime/slimecrayon name = "Slime Crayon" id = "s_crayon" @@ -749,12 +608,8 @@ required_other = 1 /datum/chemical_reaction/slime/slimecrayon/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/list/crayons = difflist(subtypesof(/obj/item/toy/crayon),typesof(/obj/item/toy/crayon/spraycan)) - var/chosen = pick(crayons) - var/obj/P = new chosen - if(P) - P.loc = get_turf(holder.my_atom) + var/chosen = pick(difflist(subtypesof(/obj/item/toy/crayon),typesof(/obj/item/toy/crayon/spraycan))) + new chosen(get_turf(holder.my_atom)) ..() //Rainbow :o) @@ -766,12 +621,8 @@ required_container = /obj/item/slime_extract/rainbow /datum/chemical_reaction/slime/slimeRNG/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/mob/living/simple_animal/slime/random/S - S = new(get_turf(holder.my_atom)) - S.visible_message("<span class='danger'>Infused with plasma, the \ - core begins to quiver and grow, and soon a new baby slime emerges \ - from it!</span>") + var/mob/living/simple_animal/slime/random/S = new (get_turf(holder.my_atom)) + S.visible_message("<span class='danger'>Infused with plasma, the core begins to quiver and grow, and a new baby slime emerges from it!</span>") ..() /datum/chemical_reaction/slime/slime_transfer @@ -782,9 +633,7 @@ required_container = /obj/item/slime_extract/rainbow /datum/chemical_reaction/slime/slime_transfer/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - var/obj/item/slimepotion/transference/P = new /obj/item/slimepotion/transference - P.loc = get_turf(holder.my_atom) + new /obj/item/slimepotion/transference(get_turf(holder.my_atom)) ..() /datum/chemical_reaction/slime/flight_potion @@ -795,7 +644,6 @@ required_container = /obj/item/slime_extract/rainbow /datum/chemical_reaction/slime/flight_potion/on_reaction(datum/reagents/holder) - feedback_add_details("slime_cores_used","[type]") - new/obj/item/weapon/reagent_containers/glass/bottle/potion/flight(get_turf(holder.my_atom)) + new /obj/item/weapon/reagent_containers/glass/bottle/potion/flight(get_turf(holder.my_atom)) ..() diff --git a/code/modules/reagents/reagent_containers/spray.dm b/code/modules/reagents/reagent_containers/spray.dm index 46f97541163..34d422da92f 100644 --- a/code/modules/reagents/reagent_containers/spray.dm +++ b/code/modules/reagents/reagent_containers/spray.dm @@ -61,7 +61,7 @@ /obj/item/weapon/reagent_containers/spray/proc/spray(atom/A) - var/range = max(min(spray_range, get_dist(src, A)), 1) + var/range = max(min(current_range, get_dist(src, A)), 1) var/obj/effect/decal/chempuff/D = new /obj/effect/decal/chempuff(get_turf(src)) D.create_reagents(amount_per_transfer_from_this) var/puff_reagent_left = range //how many turf, mob or dense objet we can react with before we consider the chem puff consumed @@ -169,6 +169,12 @@ amount_per_transfer_from_this = 5 list_reagents = list("condensedcapsaicin" = 40) +// Fix pepperspraying yourself +/obj/item/weapon/reagent_containers/spray/pepper/afterattack(atom/A as mob|obj, mob/user) + if (A.loc == user) + return + ..() + //water flower /obj/item/weapon/reagent_containers/spray/waterflower name = "water flower" @@ -200,6 +206,11 @@ volume = 600 origin_tech = "combat=3;materials=3;engineering=3" +/obj/item/weapon/reagent_containers/spray/chemsprayer/afterattack(atom/A as mob|obj, mob/user) + // Make it so the bioterror spray doesn't spray yourself when you click your inventory items + if (A.loc == user) + return + ..() /obj/item/weapon/reagent_containers/spray/chemsprayer/spray(atom/A) var/direction = get_dir(src, A) diff --git a/code/modules/research/designs/autolathe_designs.dm b/code/modules/research/designs/autolathe_designs.dm index 28b5a893a98..9f2fbda1f34 100644 --- a/code/modules/research/designs/autolathe_designs.dm +++ b/code/modules/research/designs/autolathe_designs.dm @@ -581,7 +581,7 @@ id = "rcd" build_type = AUTOLATHE materials = list(MAT_METAL = 30000) - build_path = /obj/item/weapon/rcd + build_path = /obj/item/weapon/construction/rcd category = list("hacked", "Construction") /datum/design/rpd diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm index e9bc3537155..c8f580cc34c 100644 --- a/code/modules/research/experimentor.dm +++ b/code/modules/research/experimentor.dm @@ -73,7 +73,7 @@ valid_items += rand(1,max(2,35-probWeight)) valid_items += I - if(ispath(I,/obj/item/weapon/rcd) || ispath(I,/obj/item/weapon/grenade) || ispath(I,/obj/item/device/aicard) || ispath(I,/obj/item/weapon/storage/backpack/holding) || ispath(I,/obj/item/slime_extract) || ispath(I,/obj/item/device/onetankbomb) || ispath(I,/obj/item/device/transfer_valve)) + if(ispath(I,/obj/item/weapon/construction/rcd) || ispath(I,/obj/item/weapon/grenade) || ispath(I,/obj/item/device/aicard) || ispath(I,/obj/item/weapon/storage/backpack/holding) || ispath(I,/obj/item/slime_extract) || ispath(I,/obj/item/device/onetankbomb) || ispath(I,/obj/item/device/transfer_valve)) var/obj/item/tempCheck = I if(initial(tempCheck.icon_state) != null) critical_items += I diff --git a/code/modules/research/rdmachines.dm b/code/modules/research/rdmachines.dm index 741c13a14aa..4dfcf3ff85f 100644 --- a/code/modules/research/rdmachines.dm +++ b/code/modules/research/rdmachines.dm @@ -30,9 +30,7 @@ return 0 if(!prob(prb)) return 0 - var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread - s.set_up(5, 1, src) - s.start() + do_sparks(5, TRUE, src) if (electrocute_mob(user, get_area(src), src, 0.7, TRUE)) return 1 else diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index f31cd011312..38d742c5be0 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -482,9 +482,14 @@ resistance_flags = LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF layer = TURF_LAYER -/obj/effect/golemrune/New() - ..() +/obj/effect/golemrune/Initialize() + . = ..() START_PROCESSING(SSobj, src) + notify_ghosts("Golem rune created in [get_area(src)].", 'sound/effects/ghost2.ogg', source = src) + +/obj/effect/golemrune/Destroy() + STOP_PROCESSING(SSobj, src) + return ..() /obj/effect/golemrune/process() var/mob/dead/observer/ghost diff --git a/code/modules/spells/spell.dm b/code/modules/spells/spell.dm index 3de937a15e5..bdab8b6c226 100644 --- a/code/modules/spells/spell.dm +++ b/code/modules/spells/spell.dm @@ -295,9 +295,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th if(isliving(target) && message) to_chat(target, text("[message]")) if(sparks_spread) - var/datum/effect_system/spark_spread/sparks = new - sparks.set_up(sparks_amt, 0, location) //no idea what the 0 is - sparks.start() + do_sparks(sparks_amt, FALSE, location) if(smoke_spread) if(smoke_spread == 1) var/datum/effect_system/smoke_spread/smoke = new diff --git a/code/modules/spells/spell_types/godhand.dm b/code/modules/spells/spell_types/godhand.dm index c1d9707ce43..20d223354b7 100644 --- a/code/modules/spells/spell_types/godhand.dm +++ b/code/modules/spells/spell_types/godhand.dm @@ -50,9 +50,7 @@ if(!proximity || target == user || !ismob(target) || !iscarbon(user) || user.lying || user.handcuffed) //exploding after touching yourself would be bad return var/mob/M = target - var/datum/effect_system/spark_spread/sparks = new - sparks.set_up(4, 0, M.loc) //no idea what the 0 is - sparks.start() + do_sparks(4, FALSE, M.loc) M.gib() ..() @@ -73,4 +71,4 @@ var/mob/living/M = target M.Stun(2) M.petrify() - ..() \ No newline at end of file + ..() diff --git a/code/modules/surgery/bodyparts/bodyparts.dm b/code/modules/surgery/bodyparts/bodyparts.dm index 167ccf62f72..56d35be23b3 100644 --- a/code/modules/surgery/bodyparts/bodyparts.dm +++ b/code/modules/surgery/bodyparts/bodyparts.dm @@ -183,13 +183,20 @@ //Change organ status -/obj/item/bodypart/proc/change_bodypart_status(new_limb_status, heal_limb) +/obj/item/bodypart/proc/change_bodypart_status(new_limb_status, heal_limb, change_icon_to_default) status = new_limb_status if(heal_limb) burn_dam = 0 brute_dam = 0 brutestate = 0 burnstate = 0 + + if(change_icon_to_default) + if(status == BODYPART_ORGANIC) + icon = DEFAULT_BODYPART_ICON_ORGANIC + else if(status == BODYPART_ROBOTIC) + icon = DEFAULT_BODYPART_ICON_ROBOTIC + if(owner) owner.updatehealth() owner.update_body() //if our head becomes robotic, we remove the lizard horns and human hair. diff --git a/code/modules/surgery/bodyparts/robot_bodyparts.dm b/code/modules/surgery/bodyparts/robot_bodyparts.dm index d9b51a19a50..00a01e2d2e4 100644 --- a/code/modules/surgery/bodyparts/robot_bodyparts.dm +++ b/code/modules/surgery/bodyparts/robot_bodyparts.dm @@ -187,5 +187,5 @@ name = "surplus prosthetic right leg" desc = "A skeletal, robotic limb. Outdated and fragile, but it's still better than nothing." icon = 'icons/mob/surplus_augments.dmi' - icon_state = "surplus_r_leg" + icon_state = "r_leg" max_damage = 20 diff --git a/code/modules/surgery/limb_augmentation.dm b/code/modules/surgery/limb_augmentation.dm index e25c06cffba..aaea6de1d50 100644 --- a/code/modules/surgery/limb_augmentation.dm +++ b/code/modules/surgery/limb_augmentation.dm @@ -50,7 +50,7 @@ /datum/surgery_step/add_limb/success(mob/user, mob/living/carbon/target, target_zone, obj/item/bodypart/tool, datum/surgery/surgery) if(L) user.visible_message("[user] successfully augments [target]'s [parse_zone(target_zone)]!", "<span class='notice'>You successfully augment [target]'s [parse_zone(target_zone)].</span>") - L.change_bodypart_status(BODYPART_ROBOTIC, 1) + L.change_bodypart_status(BODYPART_ROBOTIC, TRUE) L.icon = tool.icon L.max_damage = tool.max_damage user.drop_item() diff --git a/code/modules/surgery/remove_embedded_object.dm b/code/modules/surgery/remove_embedded_object.dm index f2c1e143b6f..b791586e22c 100644 --- a/code/modules/surgery/remove_embedded_object.dm +++ b/code/modules/surgery/remove_embedded_object.dm @@ -28,6 +28,8 @@ objects++ I.loc = get_turf(H) L.embedded_objects -= I + if(!H.has_embedded_objects()) + H.clear_alert("embeddedobject") if(objects > 0) user.visible_message("[user] sucessfully removes [objects] objects from [H]'s [L]!", "<span class='notice'>You successfully remove [objects] objects from [H]'s [L.name].</span>") diff --git a/code/modules/telesci/telepad.dm b/code/modules/telesci/telepad.dm index e681a0693d4..d4e49215ad6 100644 --- a/code/modules/telesci/telepad.dm +++ b/code/modules/telesci/telepad.dm @@ -167,8 +167,6 @@ /obj/item/weapon/rcs/emag_act(mob/user) if(!emagged) - emagged = 1 - var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread - s.set_up(5, 1, src) - s.start() + emagged = TRUE + do_sparks(5, TRUE, src) to_chat(user, "<span class='caution'>You emag the RCS. Click on it to toggle between modes.</span>") diff --git a/code/modules/telesci/telesci_computer.dm b/code/modules/telesci/telesci_computer.dm index d9d5486736e..8b4ff36c054 100644 --- a/code/modules/telesci/telesci_computer.dm +++ b/code/modules/telesci/telesci_computer.dm @@ -139,20 +139,14 @@ var/datum/browser/popup = new(user, "telesci", name, 300, 500) popup.set_content(t) popup.open() - return /obj/machinery/computer/telescience/proc/sparks() if(telepad) - var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread - s.set_up(5, 1, get_turf(telepad)) - s.start() - else - return + do_sparks(5, TRUE, get_turf(telepad)) /obj/machinery/computer/telescience/proc/telefail() sparks() visible_message("<span class='warning'>The telepad weakly fizzles.</span>") - return /obj/machinery/computer/telescience/proc/doteleport(mob/user) @@ -201,9 +195,7 @@ // use a lot of power use_power(power * 10) - var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread - s.set_up(5, 1, get_turf(telepad)) - s.start() + do_sparks(5, TRUE, get_turf(telepad)) temp_msg = "Teleport successful.<BR>" if(teles_left < 10) @@ -211,10 +203,7 @@ else temp_msg += "Data printed below." - var/sparks = get_turf(target) - var/datum/effect_system/spark_spread/y = new /datum/effect_system/spark_spread - y.set_up(5, 1, sparks) - y.start() + do_sparks(5, TRUE, get_turf(target)) var/turf/source = target var/turf/dest = get_turf(telepad) diff --git a/code/modules/tooltip/tooltip.dm b/code/modules/tooltip/tooltip.dm index 11d60ca07b8..5d074286ebc 100644 --- a/code/modules/tooltip/tooltip.dm +++ b/code/modules/tooltip/tooltip.dm @@ -34,7 +34,6 @@ Notes: /datum/tooltip var/client/owner var/control = "mainwindow.tooltip" - var/file = 'code/modules/tooltip/tooltip.html' var/showing = 0 var/queueHide = 0 var/init = 0 @@ -43,7 +42,7 @@ Notes: /datum/tooltip/New(client/C) if (C) src.owner = C - src.owner << browse(file2text(src.file), "window=[src.control]") + src.owner << browse(file2text('code/modules/tooltip/tooltip.html'), "window=[src.control]") ..() diff --git a/code/modules/uplink/uplink_item.dm b/code/modules/uplink/uplink_item.dm index dd33cb0b1bf..9ed0565ee77 100644 --- a/code/modules/uplink/uplink_item.dm +++ b/code/modules/uplink/uplink_item.dm @@ -88,7 +88,7 @@ GLOBAL_LIST_EMPTY(uplink_items) // Global list so we only initialize this once. /datum/uplink_item/proc/spawn_item(turf/loc, obj/item/device/uplink/U) if(item) - feedback_add_details("traitor_uplink_items_bought", "[item]") + feedback_add_details("traitor_uplink_items_bought", "[name]|[cost]") return new item(loc) /datum/uplink_item/proc/buy(mob/user, obj/item/device/uplink/U) @@ -127,7 +127,7 @@ GLOBAL_LIST_EMPTY(uplink_items) // Global list so we only initialize this once. if(src in GLOB.uplink_items) GLOB.uplink_items -= src //Take us out instead of leaving a null! return ..() - + //Discounts (dynamically filled above) /datum/uplink_item/discounts category = "Discounted Gear" @@ -1158,6 +1158,7 @@ GLOBAL_LIST_EMPTY(uplink_items) // Global list so we only initialize this once. /datum/uplink_item/cyber_implants/spawn_item(turf/loc, obj/item/device/uplink/U) if(item) if(istype(item, /obj/item/organ)) + feedback_add_details("traitor_uplink_items_bought", "[item]|[cost]") return new /obj/item/weapon/storage/box/cyber_implants(loc, item) else return ..() @@ -1325,12 +1326,12 @@ GLOBAL_LIST_EMPTY(uplink_items) // Global list so we only initialize this once. new I.item(C) U.purchase_log += "<big>\icon[I.item]</big>" + feedback_add_details("traitor_uplink_items_bought", "[name]|[cost]") return C /datum/uplink_item/badass/random name = "Random Item" - desc = "Picking this will purchase a random item. Useful if you have some TC to spare or if you haven't \ - decided on a strategy yet." + desc = "Picking this will purchase a random item. Useful if you have some TC to spare or if you haven't decided on a strategy yet." item = /obj/item/weapon/paper cost = 0 cant_discount = TRUE @@ -1351,5 +1352,6 @@ GLOBAL_LIST_EMPTY(uplink_items) // Global list so we only initialize this once. var/datum/uplink_item/I = pick(possible_items) U.telecrystals -= I.cost U.spent_telecrystals += I.cost - feedback_add_details("traitor_uplink_items_bought","RN") + feedback_add_details("traitor_uplink_items_bought","[name]|[I.cost]") + feedback_add_details("traitor_random_uplink_items_gotten","[I.name]") return new I.item(loc) diff --git a/code/orphaned_procs/dbcore.dm b/code/orphaned_procs/dbcore.dm index a073780ea05..23b4fd0eb15 100644 --- a/code/orphaned_procs/dbcore.dm +++ b/code/orphaned_procs/dbcore.dm @@ -63,11 +63,11 @@ DBConnection/proc/Connect() if(failed_connections > FAILED_DB_CONNECTION_CUTOFF) //If it failed to establish a connection more than 5 times in a row, don't bother attempting to connect anymore. return FALSE - var/user = GLOB.sqlfdbklogin - var/pass = GLOB.sqlfdbkpass - var/db = GLOB.sqlfdbkdb - var/address = GLOB.sqladdress - var/port = GLOB.sqlport + var/user = global.sqlfdbklogin + var/pass = global.sqlfdbkpass + var/db = global.sqlfdbkdb + var/address = global.sqladdress + var/port = global.sqlport doConnect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]") . = IsConnected() @@ -98,7 +98,7 @@ DBConnection/proc/ErrorMsg() return _dm_db_error_msg(_db_con) DBConnection/proc/SelectDB(database_name,dbi) if(IsConnected()) Disconnect() //return Connect("[dbi?"[dbi]":"dbi:mysql:[database_name]:[DB_SERVER]:[DB_PORT]"]",user,password) - return Connect("[dbi?"[dbi]":"dbi:mysql:[database_name]:[GLOB.sqladdress]:[GLOB.sqlport]"]",user,password) + return Connect("[dbi?"[dbi]":"dbi:mysql:[database_name]:[global.sqladdress]:[global.sqlport]"]",user,password) DBConnection/proc/NewQuery(sql_query,cursor_handler=src.default_cursor) return new/DBQuery(sql_query,src,cursor_handler) diff --git a/code/world.dm b/code/world.dm index 1b42af425c9..233138ba302 100644 --- a/code/world.dm +++ b/code/world.dm @@ -35,7 +35,7 @@ GLOB.changelog_hash = md5('html/changelog.html') //used for telling if the changelog has changed recently make_datum_references_lists() //initialises global lists for referencing frequently used datums (so that we only ever do it once) - load_configuration() + config = new GLOB.revdata.DownloadPRDetails() load_mode() load_motd() @@ -65,7 +65,7 @@ GLOB.diary << "TOPIC: \"[T]\", from:[addr], master:[master], key:[key]" var/list/input = params2list(T) - var/key_valid = (GLOB.comms_allowed && input["key"] == GLOB.comms_key) + var/key_valid = (global.comms_allowed && input["key"] == global.comms_key) var/static/last_irc_status = 0 if("ping" in input) @@ -211,14 +211,6 @@ /world/proc/OnReboot(reason, feedback_c, feedback_r, round_end_sound_sent) feedback_set_details("[feedback_c]","[feedback_r]") log_game("<span class='boldannounce'>Rebooting World. [reason]</span>") -#ifdef dellogging - var/log = file("data/logs/del.log") - log << time2text(world.realtime) - for(var/index in del_counter) - var/count = del_counter[index] - if(count > 10) - log << "#[count]\t[index]" -#endif if(GLOB.blackbox) GLOB.blackbox.save_all_data_to_sql() Master.Shutdown() //run SS shutdowns @@ -273,18 +265,6 @@ /world/proc/load_motd() GLOB.join_motd = file2text("config/motd.txt") + "<br>" + GLOB.revdata.GetTestMergeInfo() -/world/proc/load_configuration() - config = new /datum/configuration() - config.load("config/config.txt") - config.load("config/game_options.txt","game_options") - config.loadsql("config/dbconfig.txt") - if (config.maprotation) - config.loadmaplist("config/maps.txt") - - // apply some settings from config.. - GLOB.abandon_allowed = config.respawn - - /world/proc/update_status() var/s = "" @@ -334,4 +314,4 @@ if (features) s += ": [jointext(features, ", ")]" - status = s \ No newline at end of file + status = s diff --git a/sound/ambience/ambivapor1.ogg b/sound/ambience/ambivapor1.ogg index 3ac83daeade..4374f46710d 100644 Binary files a/sound/ambience/ambivapor1.ogg and b/sound/ambience/ambivapor1.ogg differ diff --git a/sound/ambience/title1.ogg b/sound/ambience/title1.ogg index 6d689d475f2..1858f38e338 100644 Binary files a/sound/ambience/title1.ogg and b/sound/ambience/title1.ogg differ diff --git a/sound/ambience/title2.ogg b/sound/ambience/title2.ogg index af8cc5caae1..94e78f83c19 100644 Binary files a/sound/ambience/title2.ogg and b/sound/ambience/title2.ogg differ diff --git a/sound/ambience/title3.ogg b/sound/ambience/title3.ogg index 9632d259e15..cd1e4835a5c 100644 Binary files a/sound/ambience/title3.ogg and b/sound/ambience/title3.ogg differ diff --git a/sound/ambience/title4.ogg b/sound/ambience/title4.ogg index 61873497fa0..12f70b3d2c0 100644 Binary files a/sound/ambience/title4.ogg and b/sound/ambience/title4.ogg differ diff --git a/sound/machines/engine_alert1.ogg b/sound/machines/engine_alert1.ogg new file mode 100644 index 00000000000..fadec78891f Binary files /dev/null and b/sound/machines/engine_alert1.ogg differ diff --git a/sound/machines/engine_alert2.ogg b/sound/machines/engine_alert2.ogg new file mode 100644 index 00000000000..83f693617a7 Binary files /dev/null and b/sound/machines/engine_alert2.ogg differ diff --git a/sound/misc/Paradox.ogg b/sound/misc/Paradox.ogg new file mode 100644 index 00000000000..c28403578d5 Binary files /dev/null and b/sound/misc/Paradox.ogg differ diff --git a/sound/misc/airraid.ogg b/sound/misc/airraid.ogg new file mode 100644 index 00000000000..820eaccf91d Binary files /dev/null and b/sound/misc/airraid.ogg differ diff --git a/sound/misc/boogie2.ogg b/sound/misc/boogie2.ogg new file mode 100644 index 00000000000..e9cdb973a21 Binary files /dev/null and b/sound/misc/boogie2.ogg differ diff --git a/sound/misc/disco.ogg b/sound/misc/disco.ogg new file mode 100644 index 00000000000..5e15c8ccc01 Binary files /dev/null and b/sound/misc/disco.ogg differ diff --git a/sound/misc/superior.ogg b/sound/misc/superior.ogg new file mode 100644 index 00000000000..e9cdb973a21 Binary files /dev/null and b/sound/misc/superior.ogg differ diff --git a/sound/misc/ultimate.ogg b/sound/misc/ultimate.ogg new file mode 100644 index 00000000000..0674a553135 Binary files /dev/null and b/sound/misc/ultimate.ogg differ diff --git a/tgstation.dme b/tgstation.dme index 171e998234a..c4f4e2e1edb 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -72,6 +72,7 @@ #include "code\__HELPERS\_lists.dm" #include "code\__HELPERS\_logging.dm" #include "code\__HELPERS\_string_lists.dm" +#include "code\__HELPERS\AStar.dm" #include "code\__HELPERS\bandetect.dm" #include "code\__HELPERS\cmp.dm" #include "code\__HELPERS\files.dm" @@ -84,6 +85,7 @@ #include "code\__HELPERS\matrices.dm" #include "code\__HELPERS\mobs.dm" #include "code\__HELPERS\names.dm" +#include "code\__HELPERS\priority_announce.dm" #include "code\__HELPERS\pronouns.dm" #include "code\__HELPERS\radio.dm" #include "code\__HELPERS\sanitize_values.dm" @@ -98,12 +100,11 @@ #include "code\__HELPERS\sorts\MergeSort.dm" #include "code\__HELPERS\sorts\TimSort.dm" #include "code\_globalvars\configuration.dm" -#include "code\_globalvars\database.dm" #include "code\_globalvars\game_modes.dm" #include "code\_globalvars\genetics.dm" #include "code\_globalvars\logging.dm" #include "code\_globalvars\misc.dm" -#include "code\_globalvars\station.dm" +#include "code\_globalvars\sensitive.dm" #include "code\_globalvars\lists\flavor_misc.dm" #include "code\_globalvars\lists\mapping.dm" #include "code\_globalvars\lists\mobs.dm" @@ -531,6 +532,7 @@ #include "code\game\machinery\cell_charger.dm" #include "code\game\machinery\cloning.dm" #include "code\game\machinery\constructable_frame.dm" +#include "code\game\machinery\dance_machine.dm" #include "code\game\machinery\deployable.dm" #include "code\game\machinery\dna_scanner.dm" #include "code\game\machinery\doppler_array.dm" @@ -1062,6 +1064,7 @@ #include "code\modules\atmospherics\environmental\LINDA_turf_tile.dm" #include "code\modules\atmospherics\gasmixtures\gas_mixture.dm" #include "code\modules\atmospherics\gasmixtures\gas_types.dm" +#include "code\modules\atmospherics\gasmixtures\immutable_mixtures.dm" #include "code\modules\atmospherics\gasmixtures\reactions.dm" #include "code\modules\atmospherics\gasmixtures\space_mixture.dm" #include "code\modules\atmospherics\machinery\airalarm.dm" @@ -1535,6 +1538,7 @@ #include "code\modules\mob\living\carbon\alien\alien_defense.dm" #include "code\modules\mob\living\carbon\alien\damage_procs.dm" #include "code\modules\mob\living\carbon\alien\death.dm" +#include "code\modules\mob\living\carbon\alien\emote.dm" #include "code\modules\mob\living\carbon\alien\life.dm" #include "code\modules\mob\living\carbon\alien\login.dm" #include "code\modules\mob\living\carbon\alien\logout.dm" @@ -2144,9 +2148,7 @@ #include "code\modules\VR\vr_sleeper.dm" #include "code\modules\zombie\items.dm" #include "code\modules\zombie\organs.dm" -#include "code\orphaned_procs\AStar.dm" #include "code\orphaned_procs\dbcore.dm" -#include "code\orphaned_procs\priority_announce.dm" #include "code\orphaned_procs\statistics.dm" #include "interface\interface.dm" #include "interface\stylesheet.dm" diff --git a/tools/github_webhook_processor.php b/tools/github_webhook_processor.php index 06a3b2ae2dc..9eaa7aef775 100644 --- a/tools/github_webhook_processor.php +++ b/tools/github_webhook_processor.php @@ -194,7 +194,7 @@ function handle_pr($payload) { case 'edited': case 'synchronize': tag_pr($payload, false); - break; + return; case 'reopened': $action = $payload['action']; break; @@ -241,14 +241,20 @@ function checkchangelog($payload, $merge = false, $compile = true) { return; } $body = $payload['pull_request']['body']; + + $tags = array(); + + if(preg_match('/(?i)(fix|fixes|fixed|resolve|resolves|resolved)\s*#[0-9]+/',$body)) //github autoclose syntax + $tags[] = 'Fix'; + $body = str_replace("\r\n", "\n", $body); $body = explode("\n", $body); + $username = $payload['pull_request']['user']['login']; $incltag = false; $changelogbody = array(); $currentchangelogblock = array(); $foundcltag = false; - $tags = array(); foreach ($body as $line) { $line = trim($line); if (substr($line,0,4) == ':cl:' || substr($line,0,4) == '🆑') {