CrazyLemon RPD changes

This commit is contained in:
Kyep
2018-08-15 22:36:53 -07:00
parent 7cebfc20c4
commit 1e894f11ee
6 changed files with 30 additions and 10 deletions
+4
View File
@@ -305,6 +305,10 @@
/atom/proc/rpd_act()
return
/atom/proc/rpd_blocksusage()
// Atoms that return TRUE prevent RPDs placing any kind of pipes on their turf.
return FALSE
/atom/proc/hitby(atom/movable/AM, skipcatch, hitpush, blocked)
if(density && !has_gravity(AM)) //thrown stuff bounces off dense stuff in no grav, unless the thrown stuff ends up inside what it hit(embedding, bola, etc...).
addtimer(CALLBACK(src, .proc/hitby_react, AM), 2)
+2 -1
View File
@@ -140,6 +140,7 @@
//update the name and icon of the pipe item depending on the type
/obj/item/pipe/rpd_act(mob/user, obj/item/rpd/our_rpd)
. = TRUE
if(our_rpd.mode == RPD_ROTATE_MODE)
rotate()
else if(our_rpd.mode == RPD_FLIP_MODE)
@@ -147,7 +148,7 @@
else if(our_rpd.mode == RPD_DELETE_MODE)
our_rpd.delete_single_pipe(user, src)
else
..()
return ..()
/obj/item/pipe/proc/update(var/obj/machinery/atmospherics/make_from)
name = "[get_pipe_name(pipe_type, PIPETYPE_ATMOS)] fitting"
+2
View File
@@ -541,6 +541,8 @@
/obj/machinery/shieldwall/attack_hand(mob/user as mob)
return
/obj/machinery/shieldwall/rpd_blocksusage()
return TRUE
/obj/machinery/shieldwall/process()
if(needs_power)
+20 -4
View File
@@ -192,11 +192,27 @@ var/list/pipemenu = list(
return
if(world.time < lastused + spawndelay)
return
var/turf/T = get_turf(target)
for(var/obj/machinery/shieldwall/S in T)
to_chat(user, "<span class='warning'>[S] blocks access!</span>")
return
target.rpd_act(user, src) //Handle RPD effects in separate procs
if(target != T)
// We only check the rpd_act of the target if it isn't the turf, because otherwise
// (A) blocked turfs can be acted on, and (B) unblocked turfs get acted on twice.
if(target.rpd_act(user, src) == TRUE)
// If the object we are clicking on has a valid RPD interaction for just that specific object, do that and nothing else.
// Example: clicking on a pipe with a RPD in rotate mode should rotate that pipe and ignore everything else on the tile.
return
// If we get this far, we have to check every object in the tile, to make sure that none of them block RPD usage on this tile.
// This is done by calling rpd_blocksusage on every /obj in the tile. If any block usage, fail at this point.
for(var/obj/O in T)
if(O.rpd_blocksusage() == TRUE)
to_chat(user, "<span class='warning'>[O] blocks the [src]!</span>")
return
// If we get here, then we're effectively acting on the turf, probably placing a pipe.
T.rpd_act(user, src)
#undef RPD_COOLDOWN_TIME
#undef RPD_WALLBUILD_TIME
-4
View File
@@ -71,10 +71,6 @@
SSnanoui.close_uis(src)
return ..()
/obj/rpd_act(mob/user, obj/item/rpd/our_rpd)
var/turf/T = get_turf(src) //This preserves RPD behaviour on specific turfs
T.rpd_act(user, our_rpd)
/obj/proc/process()
set waitfor = 0
processing_objects.Remove(src)
@@ -258,6 +258,7 @@
return
/obj/structure/disposalconstruct/rpd_act(mob/user, obj/item/rpd/our_rpd)
. = TRUE
if(our_rpd.mode == RPD_ROTATE_MODE)
rotate()
else if(our_rpd.mode == RPD_FLIP_MODE)
@@ -265,4 +266,4 @@
else if(our_rpd.mode == RPD_DELETE_MODE)
our_rpd.delete_single_pipe(user, src)
else
..()
return ..()