From 4bba349cb667f7ec10eb8c7f5cc877f91e8136d1 Mon Sep 17 00:00:00 2001 From: Citinited Date: Sun, 11 Mar 2018 03:44:42 +0000 Subject: [PATCH 1/2] Adds RPD_ALLOWED_HERE flag to deny use of the RPD to certain turf types --- code/__DEFINES/flags.dm | 1 + code/game/objects/items/weapons/rpd.dm | 5 ++++- code/game/turfs/simulated.dm | 1 + code/game/turfs/simulated/shuttle.dm | 1 + code/game/turfs/space/space.dm | 1 + code/game/turfs/space/transit.dm | 1 + 6 files changed, 9 insertions(+), 1 deletion(-) diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index a03ba7c9d4c..b0b7bb991e5 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -66,6 +66,7 @@ //turf-only flags #define NOJAUNT 1 +#define RPD_ALLOWED_HERE 2//By default, RPD is disabled on turfs. //ITEM INVENTORY SLOT BITMASKS #define SLOT_OCLOTHING 1 diff --git a/code/game/objects/items/weapons/rpd.dm b/code/game/objects/items/weapons/rpd.dm index 2bb948cddeb..744d77ce71b 100644 --- a/code/game/objects/items/weapons/rpd.dm +++ b/code/game/objects/items/weapons/rpd.dm @@ -180,7 +180,10 @@ var/list/pipemenu = list( /obj/item/weapon/rpd/afterattack(atom/target, mob/user, proximity) ..() var/turf/T = get_turf(target) - if(src.loc != user || ismob(target) || istype(target, /obj/structure/window) || !proximity || world.time < lastused + spawndelay) + if(loc != user || ismob(target) || istype(target, /obj/structure/window) || !proximity || world.time < lastused + spawndelay) + return + if(!(T.flags & RPD_ALLOWED_HERE)) + to_chat(user, "[src] beeps, \"Unable to interface with [T]. Please try again later.\"") return if(mode == ATMOS_MODE && !istype(T, /turf/simulated/shuttle)) //No pipes on shuttles nerds if(istype(T, /turf/simulated/wall)) //Drilling into walls takes time diff --git a/code/game/turfs/simulated.dm b/code/game/turfs/simulated.dm index 61f622c071f..89c40be8641 100644 --- a/code/game/turfs/simulated.dm +++ b/code/game/turfs/simulated.dm @@ -4,6 +4,7 @@ var/image/wet_overlay = null var/thermite = 0 + flags = RPD_ALLOWED_HERE oxygen = MOLES_O2STANDARD nitrogen = MOLES_N2STANDARD var/to_be_destroyed = 0 //Used for fire, if a melting temperature was reached, it will be destroyed diff --git a/code/game/turfs/simulated/shuttle.dm b/code/game/turfs/simulated/shuttle.dm index 6ab60fffd99..0c5e6c08f6b 100644 --- a/code/game/turfs/simulated/shuttle.dm +++ b/code/game/turfs/simulated/shuttle.dm @@ -1,6 +1,7 @@ /turf/simulated/shuttle name = "shuttle" icon = 'icons/turf/shuttle.dmi' + flags = null thermal_conductivity = 0.05 heat_capacity = 0 layer = 2 diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index 7f185bf0e64..9225def20f6 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -3,6 +3,7 @@ name = "\proper space" icon_state = "0" dynamic_lighting = 0 + flags = RPD_ALLOWED_HERE luminosity = 1 temperature = TCMB diff --git a/code/game/turfs/space/transit.dm b/code/game/turfs/space/transit.dm index 9feda5d78a7..611ff1656f3 100644 --- a/code/game/turfs/space/transit.dm +++ b/code/game/turfs/space/transit.dm @@ -1,4 +1,5 @@ /turf/space/transit + flags = null var/pushdirection // push things that get caught in the transit tile this direction //Overwrite because we dont want people building rods in space. From 6441dde560d57a7b09552e29c15696bc57264ea1 Mon Sep 17 00:00:00 2001 From: Citinited Date: Mon, 12 Mar 2018 19:20:15 +0000 Subject: [PATCH 2/2] Removes some obsolete code --- code/game/objects/items/weapons/rpd.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/weapons/rpd.dm b/code/game/objects/items/weapons/rpd.dm index 744d77ce71b..85d50a6ad12 100644 --- a/code/game/objects/items/weapons/rpd.dm +++ b/code/game/objects/items/weapons/rpd.dm @@ -185,7 +185,7 @@ var/list/pipemenu = list( if(!(T.flags & RPD_ALLOWED_HERE)) to_chat(user, "[src] beeps, \"Unable to interface with [T]. Please try again later.\"") return - if(mode == ATMOS_MODE && !istype(T, /turf/simulated/shuttle)) //No pipes on shuttles nerds + if(mode == ATMOS_MODE) if(istype(T, /turf/simulated/wall)) //Drilling into walls takes time playsound(loc, "sound/weapons/circsawhit.ogg", 50, 1) user.visible_message("[user] starts drilling a hole in [T]...", "You start drilling a hole in [T]...", "You hear a drill.")