From 340f8498a39974ff774a6651baba011f036c02fb Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Tue, 1 Oct 2019 22:11:41 +0200 Subject: [PATCH 1/7] Fixes some more issues with shoving people. --- .../mob/living/carbon/human/species.dm | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index d2e8cab240..c91d4b1fca 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1821,12 +1821,15 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) if(!target.resting) target.adjustStaminaLoss(5) + if(target.is_shove_knockdown_blocked()) + return var/turf/target_oldturf = target.loc var/shove_dir = get_dir(user.loc, target_oldturf) var/turf/target_shove_turf = get_step(target.loc, shove_dir) var/mob/living/carbon/human/target_collateral_human var/obj/structure/table/target_table + var/obj/machinery/disposal/bin/target_disposal_bin var/shove_blocked = FALSE //Used to check if a shove is blocked so that if it is knockdown logic can be applied //Thank you based whoneedsspace @@ -1836,23 +1839,11 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) else target.Move(target_shove_turf, shove_dir) if(get_turf(target) == target_oldturf) - if(target_shove_turf.density) - shove_blocked = TRUE - else - var/thoushallnotpass = FALSE - for(var/obj/O in target_shove_turf) - if(istype(O, /obj/structure/table)) - target_table = O - else if(!O.CanPass(src, target_shove_turf)) - shove_blocked = TRUE - thoushallnotpass = TRUE - if(thoushallnotpass) - target_table = null + target_table = locate(/obj/structure/table) in target_shove_turf.contents + target_disposal_bin = locate(/obj/machinery/disposal/bin) in target_shove_turf.contents + shove_blocked = TRUE - if(target.is_shove_knockdown_blocked()) - return - - if(shove_blocked || target_table) + if(shove_blocked && !target.buckled) var/directional_blocked = FALSE if(shove_dir in GLOB.cardinals) //Directional checks to make sure that we're not shoving through a windoor or something like that var/target_turf = get_turf(target) @@ -1866,7 +1857,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) directional_blocked = TRUE break var/targetatrest = target.resting - if(((!target_table && !target_collateral_human) || directional_blocked) && !targetatrest) + if(((!target_table && !(target_disposal_bin && target.Adjacent(target_disposal_bin)) && !target_collateral_human) || directional_blocked) && !targetatrest) target.Knockdown(SHOVE_KNOCKDOWN_SOLID) user.visible_message("[user.name] shoves [target.name], knocking them down!", "You shove [target.name], knocking them down!", null, COMBAT_MESSAGE_RANGE) @@ -1876,8 +1867,8 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) target.Knockdown(SHOVE_KNOCKDOWN_TABLE) user.visible_message("[user.name] shoves [target.name] onto \the [target_table]!", "You shove [target.name] onto \the [target_table]!", null, COMBAT_MESSAGE_RANGE) - target.forceMove(target_shove_turf) - log_combat(user, target, "shoved", "onto [target_table]") + target.throw_at(target_table, 1, 1, null, FALSE) //1 speed throws with no spin are basically just forcemoves with a hard collision check + log_combat(user, target, "shoved", "onto [target_table] (table)") else if(target_collateral_human && !targetatrest) target.Knockdown(SHOVE_KNOCKDOWN_HUMAN) if(!target_collateral_human.resting) @@ -1885,6 +1876,12 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) user.visible_message("[user.name] shoves [target.name] into [target_collateral_human.name]!", "You shove [target.name] into [target_collateral_human.name]!", null, COMBAT_MESSAGE_RANGE) log_combat(user, target, "shoved", "into [target_collateral_human.name]") + else if(target_disposal_bin) + target.Knockdown(SHOVE_KNOCKDOWN_SOLID) + target.forceMove(target_disposal_bin) + user.visible_message("[user.name] shoves [target.name] into \the [target_disposal_bin]!", + "You shove [target.name] into \the [target_disposal_bin]!", null, COMBAT_MESSAGE_RANGE) + log_combat(user, target, "shoved", "into [target_disposal_bin] (disposal bin)") else user.visible_message("[user.name] shoves [target.name]!", From cfcd3257781194cf37b380da5bf107f35c2a15a9 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Tue, 1 Oct 2019 23:13:08 +0200 Subject: [PATCH 2/7] reworking the shoving people action. --- code/game/atoms.dm | 3 ++ code/game/objects/structures/tables_racks.dm | 11 ++++++ code/game/turfs/turf.dm | 6 +++ .../mob/living/carbon/human/species.dm | 38 +++---------------- code/modules/recycling/disposal/bin.dm | 33 +++++++++++----- 5 files changed, 49 insertions(+), 42 deletions(-) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 6665e4d59b..09f32c215d 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -235,6 +235,9 @@ SEND_SIGNAL(src, COMSIG_ATOM_BULLET_ACT, P, def_zone) . = P.on_hit(src, 0, def_zone) +/atom/proc/shove_act(mob/living/target, mob/living/user) + return FALSE + /atom/proc/in_contents_of(container)//can take class or object instance as argument if(ispath(container)) if(istype(src.loc, container)) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index cd9b595f0a..3ec6f783be 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -136,6 +136,17 @@ var/mob/living/carbon/human/H = pushed_mob SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "table", /datum/mood_event/table) +/obj/structure/table/shove_act(mob/living/target, mob/living/user) + if(target.Adjacent(src)) + if(!target.resting) + target.Knockdown(SHOVE_KNOCKDOWN_TABLE) + user.visible_message("[user.name] shoves [target.name] onto \the [src]!", + "You shove [target.name] onto \the [src]!", null, COMBAT_MESSAGE_RANGE) + target.throw_at(target_table, 1, 1, null, FALSE) //1 speed throws with no spin are basically just forcemoves with a hard collision check + log_combat(user, target, "shoved", "onto [src] (table)") + return TRUE + return FALSE + /obj/structure/table/attackby(obj/item/I, mob/user, params) if(!(flags_1 & NODECONSTRUCT_1)) if(istype(I, /obj/item/screwdriver) && deconstruction_ready) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 7110ff4405..e1835a2b1e 100755 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -382,6 +382,12 @@ if(ismob(A) || .) A.ratvar_act() +/turf/proc/shove_act(mob/living/target, mob/living/user) + for(var/obj/O in contents) + if(O.shove_act(target, user)) + return TRUE + return FALSE + /turf/proc/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir) underlay_appearance.icon = icon underlay_appearance.icon_state = icon_state diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index c91d4b1fca..2a6333832c 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1828,60 +1828,32 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) var/shove_dir = get_dir(user.loc, target_oldturf) var/turf/target_shove_turf = get_step(target.loc, shove_dir) var/mob/living/carbon/human/target_collateral_human - var/obj/structure/table/target_table - var/obj/machinery/disposal/bin/target_disposal_bin var/shove_blocked = FALSE //Used to check if a shove is blocked so that if it is knockdown logic can be applied //Thank you based whoneedsspace target_collateral_human = locate(/mob/living/carbon/human) in target_shove_turf.contents - if(target_collateral_human) + if(target_collateral_human && target_collateral_human.resting) shove_blocked = TRUE else + target_collateral_human = null target.Move(target_shove_turf, shove_dir) if(get_turf(target) == target_oldturf) - target_table = locate(/obj/structure/table) in target_shove_turf.contents - target_disposal_bin = locate(/obj/machinery/disposal/bin) in target_shove_turf.contents shove_blocked = TRUE if(shove_blocked && !target.buckled) - var/directional_blocked = FALSE - if(shove_dir in GLOB.cardinals) //Directional checks to make sure that we're not shoving through a windoor or something like that - var/target_turf = get_turf(target) - for(var/obj/O in target_turf) - if(O.flags_1 & ON_BORDER_1 && O.dir == shove_dir && O.density) - directional_blocked = TRUE - break - if(target_turf != target_shove_turf) //Make sure that we don't run the exact same check twice on the same tile - for(var/obj/O in target_shove_turf) - if(O.flags_1 & ON_BORDER_1 && O.dir == turn(shove_dir, 180) && O.density) - directional_blocked = TRUE - break + var/directional_blocked = !target.Adjacent(target_shove_turf) var/targetatrest = target.resting - if(((!target_table && !(target_disposal_bin && target.Adjacent(target_disposal_bin)) && !target_collateral_human) || directional_blocked) && !targetatrest) + if((directional_blocked || (!target_collateral_human && !target_turf.shove_act(target, user))) && !targetatrest) target.Knockdown(SHOVE_KNOCKDOWN_SOLID) user.visible_message("[user.name] shoves [target.name], knocking them down!", "You shove [target.name], knocking them down!", null, COMBAT_MESSAGE_RANGE) log_combat(user, target, "shoved", "knocking them down") - else if(target_table) - if(!targetatrest) - target.Knockdown(SHOVE_KNOCKDOWN_TABLE) - user.visible_message("[user.name] shoves [target.name] onto \the [target_table]!", - "You shove [target.name] onto \the [target_table]!", null, COMBAT_MESSAGE_RANGE) - target.throw_at(target_table, 1, 1, null, FALSE) //1 speed throws with no spin are basically just forcemoves with a hard collision check - log_combat(user, target, "shoved", "onto [target_table] (table)") else if(target_collateral_human && !targetatrest) target.Knockdown(SHOVE_KNOCKDOWN_HUMAN) - if(!target_collateral_human.resting) - target_collateral_human.Knockdown(SHOVE_KNOCKDOWN_COLLATERAL) + target_collateral_human.Knockdown(SHOVE_KNOCKDOWN_COLLATERAL) user.visible_message("[user.name] shoves [target.name] into [target_collateral_human.name]!", "You shove [target.name] into [target_collateral_human.name]!", null, COMBAT_MESSAGE_RANGE) log_combat(user, target, "shoved", "into [target_collateral_human.name]") - else if(target_disposal_bin) - target.Knockdown(SHOVE_KNOCKDOWN_SOLID) - target.forceMove(target_disposal_bin) - user.visible_message("[user.name] shoves [target.name] into \the [target_disposal_bin]!", - "You shove [target.name] into \the [target_disposal_bin]!", null, COMBAT_MESSAGE_RANGE) - log_combat(user, target, "shoved", "into [target_disposal_bin] (disposal bin)") else user.visible_message("[user.name] shoves [target.name]!", diff --git a/code/modules/recycling/disposal/bin.dm b/code/modules/recycling/disposal/bin.dm index 082b1a7d11..fb638d3825 100644 --- a/code/modules/recycling/disposal/bin.dm +++ b/code/modules/recycling/disposal/bin.dm @@ -111,14 +111,7 @@ stuff_mob_in(target, user) /obj/machinery/disposal/proc/stuff_mob_in(mob/living/target, mob/living/user) - if(!iscarbon(user) && !user.ventcrawler) //only carbon and ventcrawlers can climb into disposal by themselves. - return - if(!isturf(user.loc)) //No magically doing it from inside closets - return - if(target.buckled || target.has_buckled_mobs()) - return - if(target.mob_size > MOB_SIZE_HUMAN) - to_chat(user, "[target] doesn't fit inside [src]!") + if(!can_stuff_mob_in(target, user)) return add_fingerprint(user) if(user == target) @@ -137,6 +130,28 @@ target.LAssailant = user update_icon() +/obj/machinery/disposal/proc/can_stuff_mob_in(mob/living/target, mob/living/user, pushing = FALSE) + if(!pushing && !iscarbon(user) && !user.ventcrawler) //only carbon and ventcrawlers can climb into disposal by themselves. + return FALSE + if(!isturf(user.loc)) //No magically doing it from inside closets + return FALSE + if(target.buckled || target.has_buckled_mobs()) + return FALSE + if(target.mob_size > MOB_SIZE_HUMAN) + if(!pushing) + to_chat(user, "[target] doesn't fit inside [src]!") + return FALSE + +/obj/machinery/disposal/bin/shove_act(mob/living/target, mob/living/user) + if(target.Adjacent(src) && can_stuff_mob_in(target, user, TRUE)) + target.Knockdown(SHOVE_KNOCKDOWN_SOLID) + target.forceMove(src) + user.visible_message("[user.name] shoves [target.name] into \the [src]!", + "You shove [target.name] into \the [src]!", null, COMBAT_MESSAGE_RANGE) + log_combat(user, target, "shoved", "into [src] (disposal bin)") + return TRUE + return FALSE + /obj/machinery/disposal/relaymove(mob/user) attempt_escape(user) @@ -305,7 +320,7 @@ if(Adjacent(user)) return TRUE return ..() - + /obj/machinery/disposal/bin/oui_data(mob/user) var/list/data = list() From d2300765b2cd9016e19acf5afc27e83c15589a22 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Tue, 1 Oct 2019 23:16:47 +0200 Subject: [PATCH 3/7] adjacency checks. --- code/game/objects/structures/tables_racks.dm | 16 +++++++--------- code/modules/mob/living/carbon/human/species.dm | 2 +- code/modules/recycling/disposal/bin.dm | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 3ec6f783be..a7ea7d3c82 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -137,15 +137,13 @@ SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "table", /datum/mood_event/table) /obj/structure/table/shove_act(mob/living/target, mob/living/user) - if(target.Adjacent(src)) - if(!target.resting) - target.Knockdown(SHOVE_KNOCKDOWN_TABLE) - user.visible_message("[user.name] shoves [target.name] onto \the [src]!", - "You shove [target.name] onto \the [src]!", null, COMBAT_MESSAGE_RANGE) - target.throw_at(target_table, 1, 1, null, FALSE) //1 speed throws with no spin are basically just forcemoves with a hard collision check - log_combat(user, target, "shoved", "onto [src] (table)") - return TRUE - return FALSE + if(!target.resting) + target.Knockdown(SHOVE_KNOCKDOWN_TABLE) + user.visible_message("[user.name] shoves [target.name] onto \the [src]!", + "You shove [target.name] onto \the [src]!", null, COMBAT_MESSAGE_RANGE) + target.throw_at(target_table, 1, 1, null, FALSE) //1 speed throws with no spin are basically just forcemoves with a hard collision check + log_combat(user, target, "shoved", "onto [src] (table)") + return TRUE /obj/structure/table/attackby(obj/item/I, mob/user, params) if(!(flags_1 & NODECONSTRUCT_1)) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 2a6333832c..48b9e810c8 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1843,7 +1843,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) if(shove_blocked && !target.buckled) var/directional_blocked = !target.Adjacent(target_shove_turf) var/targetatrest = target.resting - if((directional_blocked || (!target_collateral_human && !target_turf.shove_act(target, user))) && !targetatrest) + if((directional_blocked || (!target_collateral_human && !target_shove_turf.shove_act(target, user))) && !targetatrest) target.Knockdown(SHOVE_KNOCKDOWN_SOLID) user.visible_message("[user.name] shoves [target.name], knocking them down!", "You shove [target.name], knocking them down!", null, COMBAT_MESSAGE_RANGE) diff --git a/code/modules/recycling/disposal/bin.dm b/code/modules/recycling/disposal/bin.dm index fb638d3825..9798ecc948 100644 --- a/code/modules/recycling/disposal/bin.dm +++ b/code/modules/recycling/disposal/bin.dm @@ -143,7 +143,7 @@ return FALSE /obj/machinery/disposal/bin/shove_act(mob/living/target, mob/living/user) - if(target.Adjacent(src) && can_stuff_mob_in(target, user, TRUE)) + if(can_stuff_mob_in(target, user, TRUE)) target.Knockdown(SHOVE_KNOCKDOWN_SOLID) target.forceMove(src) user.visible_message("[user.name] shoves [target.name] into \the [src]!", From e635a05d16da081000c0415cc0f6330c629e3997 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Tue, 1 Oct 2019 23:43:38 +0200 Subject: [PATCH 4/7] errors. --- code/game/objects/structures/tables_racks.dm | 2 +- code/game/turfs/turf.dm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index a7ea7d3c82..1f1d667648 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -141,7 +141,7 @@ target.Knockdown(SHOVE_KNOCKDOWN_TABLE) user.visible_message("[user.name] shoves [target.name] onto \the [src]!", "You shove [target.name] onto \the [src]!", null, COMBAT_MESSAGE_RANGE) - target.throw_at(target_table, 1, 1, null, FALSE) //1 speed throws with no spin are basically just forcemoves with a hard collision check + target.throw_at(src, 1, 1, null, FALSE) //1 speed throws with no spin are basically just forcemoves with a hard collision check log_combat(user, target, "shoved", "onto [src] (table)") return TRUE diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index e1835a2b1e..7f3f7fae40 100755 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -382,7 +382,7 @@ if(ismob(A) || .) A.ratvar_act() -/turf/proc/shove_act(mob/living/target, mob/living/user) +/turf/shove_act(mob/living/target, mob/living/user) for(var/obj/O in contents) if(O.shove_act(target, user)) return TRUE From 81fc0c1b323e539e2c34dd9a49696919cc9bee33 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Wed, 2 Oct 2019 00:37:02 +0200 Subject: [PATCH 5/7] more foolproofing. --- code/__DEFINES/obj_flags.dm | 1 + code/game/atoms.dm | 1 + code/game/objects/structures/tables_racks.dm | 3 ++- code/game/turfs/turf.dm | 13 ++++++++--- code/modules/recycling/disposal/bin.dm | 23 +++++++++++--------- 5 files changed, 27 insertions(+), 14 deletions(-) diff --git a/code/__DEFINES/obj_flags.dm b/code/__DEFINES/obj_flags.dm index 01d95d7ff9..8d6c0644cf 100644 --- a/code/__DEFINES/obj_flags.dm +++ b/code/__DEFINES/obj_flags.dm @@ -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 diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 09f32c215d..8922ac60e1 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -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 diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 1f1d667648..b17d585385 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -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("[user.name] shoves [target.name] onto \the [src]!", "You shove [target.name] onto \the [src]!", 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 diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 7f3f7fae40..5331e76ae0 100755 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -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) diff --git a/code/modules/recycling/disposal/bin.dm b/code/modules/recycling/disposal/bin.dm index 9798ecc948..24d7d0300b 100644 --- a/code/modules/recycling/disposal/bin.dm +++ b/code/modules/recycling/disposal/bin.dm @@ -141,16 +141,7 @@ if(!pushing) to_chat(user, "[target] doesn't fit inside [src]!") 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("[user.name] shoves [target.name] into \the [src]!", - "You shove [target.name] into \the [src]!", 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("[user.name] shoves [target.name] into \the [src]!", + "You shove [target.name] into \the [src]!", 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 From 2a84162c597cd293970078b2dc0b3ff4516a3afe Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Wed, 2 Oct 2019 00:38:58 +0200 Subject: [PATCH 6/7] incorrect number of macro arguments --- code/game/turfs/turf.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 5331e76ae0..181b72e4a2 100755 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -387,7 +387,7 @@ var/list/possibilities for(var/obj/O in contents) if(CHECK_BITFIELD(O.obj_flags, SHOVABLE_ONTO)) - LAZYADD(possibilities) + LAZYADD(possibilities, O) else if(!O.CanPass(target, src)) return FALSE if(possibilities) From d245a9d28db0822477aba0bb7d39d87a297a1c37 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Wed, 2 Oct 2019 00:42:19 +0200 Subject: [PATCH 7/7] addendum --- code/game/atoms.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 8922ac60e1..7c9dc3f4fe 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -236,6 +236,7 @@ . = 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. +// IMPORTANT: if you wish to add a new own shove_act() to a certain object, remember to add SHOVABLE_ONTO to its obj_flags bitfied var first. /atom/proc/shove_act(mob/living/target, mob/living/user) return FALSE