reworking the shoving people action.

This commit is contained in:
Ghommie
2019-10-01 23:13:08 +02:00
parent 340f8498a3
commit cfcd325778
5 changed files with 49 additions and 42 deletions
+3
View File
@@ -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))
@@ -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("<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(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)
+6
View File
@@ -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