diff --git a/code/game/objects/assemblies.dm b/code/game/objects/assemblies.dm index c79e60282fe..9447870ee06 100644 --- a/code/game/objects/assemblies.dm +++ b/code/game/objects/assemblies.dm @@ -178,13 +178,14 @@ else - icon_state = "" + icon_state = "wall" flick("fwall_closing", src) sleep(15) src.density = 1 src.sd_SetOpacity(1) var/turf/T = src.loc T.sd_LumUpdate() + src.relativewall() attackby(obj/item/weapon/W as obj, mob/user as mob) diff --git a/code/game/smoothwall.dm b/code/game/smoothwall.dm new file mode 100644 index 00000000000..dd063d202aa --- /dev/null +++ b/code/game/smoothwall.dm @@ -0,0 +1,72 @@ +//Separate dm because it relates to two types of atoms + ease of removal in case it's needed. +//Also assemblies.dm for falsewall checking for this when used. + +/atom/proc/relativewall() //atom because it should be useable both for walls and false walls + + var/junction = 0 //will be used to determine from which side the wall is connected to other walls + + for(var/turf/simulated/wall/W in orange(src,1)) + if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls + junction |= get_dir(src,W) + + for(var/obj/falsewall/W in orange(src,1)) + if(abs(src.x-W.x)-abs(src.y-W.y)) //doesn't count diagonal walls + junction |= get_dir(src,W) + + if(istype(src,/turf/simulated/wall/r_wall)) + src.icon_state = "rwall[junction]" + else + src.icon_state = "wall[junction]" + +/* When we have animations for different directions of falsewalls, then it'd be needed. Not now. + if(istype(src,/obj/falsewall)) //saving the junctions for the falsewall because it changes icon_state often instead of once + var/obj/falsewall/F = src + F.junctions = junction +*/ + return + +/turf/simulated/wall/New() + + for(var/turf/simulated/wall/W in range(src,1)) + W.relativewall() + + for(var/obj/falsewall/W in range(src,1)) + W.relativewall() + + ..() + +/obj/falsewall/New() + + for(var/turf/simulated/wall/W in range(src,1)) + W.relativewall() + + for(var/obj/falsewall/W in range(src,1)) + W.relativewall() + + ..() + +/turf/simulated/wall/Del() + + var/temploc = src.loc + + spawn(10) + for(var/turf/simulated/wall/W in range(temploc,1)) + W.relativewall() + + for(var/obj/falsewall/W in range(temploc,1)) + W.relativewall() + + ..() + +/turf/falsewall/Del() + + var/temploc = src.loc + + spawn(10) + for(var/turf/simulated/wall/W in range(temploc,1)) + W.relativewall() + + for(var/obj/falsewall/W in range(temploc,1)) + W.relativewall() + + ..() \ No newline at end of file diff --git a/goonstation.dme b/goonstation.dme index 038624b536b..28994037ea8 100644 --- a/goonstation.dme +++ b/goonstation.dme @@ -253,6 +253,7 @@ #include "code\game\hud.dm" #include "code\game\landmarks.dm" #include "code\game\master_controller.dm" +#include "code\game\smoothwall.dm" #include "code\game\sound.dm" #include "code\game\status.dm" #include "code\game\supplyshuttle.dm" diff --git a/icons/turf/walls.dmi b/icons/turf/walls.dmi index 18ec15976db..08eeeda1d9d 100644 Binary files a/icons/turf/walls.dmi and b/icons/turf/walls.dmi differ