more foolproofing.

This commit is contained in:
Ghommie
2019-10-02 00:37:02 +02:00
parent e635a05d16
commit 81fc0c1b32
5 changed files with 27 additions and 14 deletions
+1
View File
@@ -10,6 +10,7 @@
#define UNIQUE_RENAME (1<<6) // can you customize the description/name of the thing?
#define USES_TGUI (1<<7) //put on things that use tgui on ui_interact instead of custom/old UI.
#define FROZEN (1<<8)
#define SHOVABLE_ONTO (1<<9) //called on turf.shove_act() to consider whether an object should have a niche effect (defined in their own shove_act()) when someone is pushed onto it, or do a sanity CanPass() check.
// If you add new ones, be sure to add them to /obj/Initialize as well for complete mapping support
+1
View File
@@ -235,6 +235,7 @@
SEND_SIGNAL(src, COMSIG_ATOM_BULLET_ACT, P, def_zone)
. = P.on_hit(src, 0, def_zone)
//used on altdisarm() for special interactions between the shoved victim (target) and the src, with user being the one shoving the target on it.
/atom/proc/shove_act(mob/living/target, mob/living/user)
return FALSE
+2 -1
View File
@@ -21,6 +21,7 @@
anchored = TRUE
layer = TABLE_LAYER
climbable = TRUE
obj_flags = CAN_BE_HIT|SHOVABLE_ONTO
pass_flags = LETPASSTHROW //You can throw objects over this, despite it's density.")
var/frame = /obj/structure/table_frame
var/framestack = /obj/item/stack/rods
@@ -141,7 +142,7 @@
target.Knockdown(SHOVE_KNOCKDOWN_TABLE)
user.visible_message("<span class='danger'>[user.name] shoves [target.name] onto \the [src]!</span>",
"<span class='danger'>You shove [target.name] onto \the [src]!</span>", null, COMBAT_MESSAGE_RANGE)
target.throw_at(src, 1, 1, null, FALSE) //1 speed throws with no spin are basically just forcemoves with a hard collision check
target.forceMove(src.loc)
log_combat(user, target, "shoved", "onto [src] (table)")
return TRUE
+10 -3
View File
@@ -382,10 +382,17 @@
if(ismob(A) || .)
A.ratvar_act()
/turf/shove_act(mob/living/target, mob/living/user)
//called on /datum/species/proc/altdisarm()
/turf/shove_act(mob/living/target, mob/living/user, pre_act = FALSE)
var/list/possibilities
for(var/obj/O in contents)
if(O.shove_act(target, user))
return TRUE
if(CHECK_BITFIELD(O.obj_flags, SHOVABLE_ONTO))
LAZYADD(possibilities)
else if(!O.CanPass(target, src))
return FALSE
if(possibilities)
var/obj/O = pick(possibilities)
return O.shove_act(target, user)
return FALSE
/turf/proc/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)
+13 -10
View File
@@ -141,16 +141,7 @@
if(!pushing)
to_chat(user, "<span class='warning'>[target] doesn't fit inside [src]!</span>")
return FALSE
/obj/machinery/disposal/bin/shove_act(mob/living/target, mob/living/user)
if(can_stuff_mob_in(target, user, TRUE))
target.Knockdown(SHOVE_KNOCKDOWN_SOLID)
target.forceMove(src)
user.visible_message("<span class='danger'>[user.name] shoves [target.name] into \the [src]!</span>",
"<span class='danger'>You shove [target.name] into \the [src]!</span>", null, COMBAT_MESSAGE_RANGE)
log_combat(user, target, "shoved", "into [src] (disposal bin)")
return TRUE
return FALSE
return TRUE
/obj/machinery/disposal/relaymove(mob/user)
attempt_escape(user)
@@ -280,6 +271,7 @@
desc = "A pneumatic waste disposal unit."
icon_state = "disposal"
var/datum/oracle_ui/themed/nano/ui
obj_flags = CAN_BE_HIT | USES_TGUI | SHOVABLE_ONTO
/obj/machinery/disposal/bin/Initialize(mapload, obj/structure/disposalconstruct/make_from)
. = ..()
@@ -375,6 +367,17 @@
else
return ..()
/obj/machinery/disposal/bin/shove_act(mob/living/target, mob/living/user)
if(can_stuff_mob_in(target, user, TRUE))
target.Knockdown(SHOVE_KNOCKDOWN_SOLID)
target.forceMove(src)
user.visible_message("<span class='danger'>[user.name] shoves [target.name] into \the [src]!</span>",
"<span class='danger'>You shove [target.name] into \the [src]!</span>", null, COMBAT_MESSAGE_RANGE)
log_combat(user, target, "shoved", "into [src] (disposal bin)")
return TRUE
return FALSE
/obj/machinery/disposal/bin/flush()
..()
full_pressure = FALSE