mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 02:54:41 +01:00
Merge pull request #10185 from Mitchs98/moveresist
Ports Move Force from TG
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
icon = 'icons/effects/effects.dmi'
|
||||
burn_state = LAVA_PROOF | FIRE_PROOF
|
||||
resistance_flags = INDESTRUCTIBLE
|
||||
anchored = 1
|
||||
can_be_hit = FALSE
|
||||
|
||||
/obj/effect/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
|
||||
|
||||
@@ -532,10 +532,10 @@ var/global/image/fire_overlay = image("icon" = 'icons/goonstation/effects/fire.d
|
||||
itempush = 0 // too light to push anything
|
||||
return A.hitby(src, 0, itempush)
|
||||
|
||||
/obj/item/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback)
|
||||
/obj/item/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback, force)
|
||||
thrownby = thrower
|
||||
callback = CALLBACK(src, .proc/after_throw, callback) //replace their callback with our own
|
||||
. = ..(target, range, speed, thrower, spin, diagonals_first, callback)
|
||||
. = ..(target, range, speed, thrower, spin, diagonals_first, callback, force)
|
||||
|
||||
/obj/item/proc/after_throw(datum/callback/callback)
|
||||
if(callback) //call the original callback
|
||||
|
||||
@@ -87,6 +87,17 @@
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/force_pushed(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
|
||||
return TRUE
|
||||
|
||||
/obj/move_crushed(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
|
||||
collision_damage(pusher, force, direction)
|
||||
return TRUE
|
||||
|
||||
/obj/proc/collision_damage(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
|
||||
var/amt = max(0, ((force - (move_resist * MOVE_FORCE_CRUSH_RATIO)) / (move_resist * MOVE_FORCE_CRUSH_RATIO)) * 10)
|
||||
take_damage(amt, BRUTE)
|
||||
|
||||
/obj/blob_act(obj/structure/blob/B)
|
||||
if(isturf(loc))
|
||||
var/turf/T = loc
|
||||
|
||||
Reference in New Issue
Block a user