mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-13 09:05:11 +01:00
Locker based combat, evolved. (#60000)
* Locker bullying, reloaded. * Start work on refactoring the whole gosh damn thing * I'm stuck. * Checkpoint * Restart work: Lets get this scrap to compile * Workin on it, having to swtich back to walls project * Revert "Restart work: Lets get this scrap to compile" This reverts commit baa1814fd1ed2c86f2009a54a90d9306264762fc. * Compiles (Check), Signals are backwards (Fix) * 90% complete yet again I have grown powerful * I HAVE GOT IT WORKING PERFECTLY * Removes a small part of commented code * Perfection*
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
ADD_TRAIT(src, TRAIT_AGEUSIA, NO_TONGUE_TRAIT)
|
||||
|
||||
GLOB.carbon_list += src
|
||||
RegisterSignal(src, COMSIG_LIVING_DEATH, .proc/attach_rot)
|
||||
RegisterSignal(src, COMSIG_CARBON_DISARM_COLLIDE, .proc/disarm_collision)
|
||||
|
||||
/mob/living/carbon/Destroy()
|
||||
//This must be done first, so the mob ghosts correctly before DNA etc is nulled
|
||||
@@ -1291,3 +1293,14 @@
|
||||
/mob/living/carbon/proc/attach_rot()
|
||||
if(mob_biotypes & (MOB_ORGANIC|MOB_UNDEAD))
|
||||
AddComponent(/datum/component/rot, 6 MINUTES, 10 MINUTES, 1)
|
||||
|
||||
/mob/living/carbon/proc/disarm_collision(mob/living/carbon/collateral, mob/living/carbon/shover, mob/living/carbon/target)
|
||||
SIGNAL_HANDLER
|
||||
target.Knockdown(SHOVE_KNOCKDOWN_HUMAN)
|
||||
if(!collateral.is_shove_knockdown_blocked())
|
||||
collateral.Knockdown(SHOVE_KNOCKDOWN_COLLATERAL)
|
||||
target.visible_message(span_danger("[shover] shoves [target.name] into [collateral.name]!"),
|
||||
span_userdanger("You're shoved into [collateral.name] by [shover]!"), span_hear("You hear aggressive shuffling followed by a loud thud!"), COMBAT_MESSAGE_RANGE, src)
|
||||
to_chat(src, span_danger("You shove [target.name] into [collateral.name]!"))
|
||||
log_combat(src, target, "shoved", "into [collateral.name]")
|
||||
return COMSIG_CARBON_SHOVE_HANDLED
|
||||
|
||||
@@ -258,10 +258,16 @@
|
||||
var/shove_dir = get_dir(loc, target_oldturf)
|
||||
var/turf/target_shove_turf = get_step(target.loc, shove_dir)
|
||||
var/mob/living/carbon/target_collateral_carbon
|
||||
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
|
||||
|
||||
var/handled = FALSE
|
||||
for(var/atom/movable/every_single_thing_but_target as anything in target_shove_turf.contents - target)
|
||||
if(SEND_SIGNAL(every_single_thing_but_target, COMSIG_CARBON_DISARM_COLLIDE, src, target) & COMSIG_CARBON_SHOVE_HANDLED)
|
||||
handled = TRUE
|
||||
break
|
||||
if(!handled)
|
||||
SEND_SIGNAL(target, COMSIG_CARBON_DISARM_COLLIDE, src, target)
|
||||
if(handled)
|
||||
return //We are using an object's disarm collision reaction instead of base disarm reactions.
|
||||
//Thank you based whoneedsspace
|
||||
target_collateral_carbon = locate(/mob/living/carbon) in target_shove_turf.contents
|
||||
|
||||
@@ -274,8 +280,6 @@
|
||||
else
|
||||
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(target.IsKnockdown() && !target.IsParalyzed())
|
||||
@@ -299,34 +303,12 @@
|
||||
if(obj_content.flags_1 & ON_BORDER_1 && obj_content.dir == turn(shove_dir, 180) && obj_content.density)
|
||||
directional_blocked = TRUE
|
||||
break
|
||||
if((!target_table && !target_collateral_carbon && !target_disposal_bin) || directional_blocked)
|
||||
if((!target_collateral_carbon) || directional_blocked)
|
||||
target.Knockdown(SHOVE_KNOCKDOWN_SOLID)
|
||||
target.visible_message(span_danger("[name] shoves [target.name], knocking [target.p_them()] down!"),
|
||||
span_userdanger("You're knocked down from a shove by [name]!"), span_hear("You hear aggressive shuffling followed by a loud thud!"), COMBAT_MESSAGE_RANGE, src)
|
||||
to_chat(src, span_danger("You shove [target.name], knocking [target.p_them()] down!"))
|
||||
log_combat(src, target, "shoved", "knocking them down")
|
||||
else if(target_table)
|
||||
target.Knockdown(SHOVE_KNOCKDOWN_TABLE)
|
||||
target.visible_message(span_danger("[name] shoves [target.name] onto \the [target_table]!"),
|
||||
span_userdanger("You're shoved onto \the [target_table] by [name]!"), span_hear("You hear aggressive shuffling followed by a loud thud!"), COMBAT_MESSAGE_RANGE, src)
|
||||
to_chat(src, span_danger("You shove [target.name] onto \the [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(src, target, "shoved", "onto [target_table] (table)")
|
||||
else if(target_collateral_carbon)
|
||||
target.Knockdown(SHOVE_KNOCKDOWN_HUMAN)
|
||||
if(!target_collateral_carbon.is_shove_knockdown_blocked())
|
||||
target_collateral_carbon.Knockdown(SHOVE_KNOCKDOWN_COLLATERAL)
|
||||
target.visible_message(span_danger("[name] shoves [target.name] into [target_collateral_carbon.name]!"),
|
||||
span_userdanger("You're shoved into [target_collateral_carbon.name] by [name]!"), span_hear("You hear aggressive shuffling followed by a loud thud!"), COMBAT_MESSAGE_RANGE, src)
|
||||
to_chat(src, span_danger("You shove [target.name] into [target_collateral_carbon.name]!"))
|
||||
log_combat(src, target, "shoved", "into [target_collateral_carbon.name]")
|
||||
else if(target_disposal_bin)
|
||||
target.Knockdown(SHOVE_KNOCKDOWN_SOLID)
|
||||
target.forceMove(target_disposal_bin)
|
||||
target.visible_message(span_danger("[name] shoves [target.name] into \the [target_disposal_bin]!"),
|
||||
span_userdanger("You're shoved into \the [target_disposal_bin] by [name]!"), span_hear("You hear aggressive shuffling followed by a loud thud!"), COMBAT_MESSAGE_RANGE, src)
|
||||
to_chat(src, span_danger("You shove [target.name] into \the [target_disposal_bin]!"))
|
||||
log_combat(src, target, "shoved", "into [target_disposal_bin] (disposal bin)")
|
||||
else
|
||||
target.visible_message(span_danger("[name] shoves [target.name]!"),
|
||||
span_userdanger("You're shoved by [name]!"), span_hear("You hear aggressive shuffling!"), COMBAT_MESSAGE_RANGE, src)
|
||||
|
||||
Reference in New Issue
Block a user