mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-28 10:31:59 +00:00
* [no gbp] fixes not being able to walk over mook corpses and turns it all to a element (#79054) ## About The Pull Request fixes not being able to move over or pull mook corpses and now mobs changing their forces on death is a element ## Why It's Good For The Game fixes not being able to move over or pull mook corpses ## Changelog 🆑 fix: fixes not being able to walk over or pull mook corpses /🆑 * [no gbp] fixes not being able to walk over mook corpses and turns it all to a element --------- Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
50 lines
1.4 KiB
Plaintext
50 lines
1.4 KiB
Plaintext
/**
|
|
* Element to change a mob's move forces on death and reset them on living
|
|
*/
|
|
/datum/element/change_force_on_death
|
|
element_flags = ELEMENT_BESPOKE
|
|
argument_hash_start_idx = 2
|
|
///Our move force
|
|
var/move_force
|
|
/// our resist move force
|
|
var/move_resist
|
|
/// how much we resist pulling
|
|
var/pull_force
|
|
|
|
/datum/element/change_force_on_death/Attach(datum/target, move_force, move_resist, pull_force)
|
|
. = ..()
|
|
|
|
if(!isliving(target))
|
|
return ELEMENT_INCOMPATIBLE
|
|
|
|
RegisterSignal(target, COMSIG_LIVING_DEATH, PROC_REF(on_death))
|
|
RegisterSignal(target, COMSIG_LIVING_REVIVE, PROC_REF(on_revive))
|
|
|
|
if(!isnull(move_force))
|
|
src.move_force = move_force
|
|
if(!isnull(move_resist))
|
|
src.move_resist = move_resist
|
|
if(!isnull(pull_force))
|
|
src.pull_force = pull_force
|
|
|
|
/datum/element/change_force_on_death/Detach(datum/target)
|
|
. = ..()
|
|
UnregisterSignal(target, list(COMSIG_LIVING_DEATH, COMSIG_LIVING_REVIVE))
|
|
|
|
/datum/element/change_force_on_death/proc/on_death(mob/living/source)
|
|
SIGNAL_HANDLER
|
|
|
|
if(!isnull(move_force))
|
|
source.move_force = move_force
|
|
if(!isnull(move_resist))
|
|
source.move_resist = move_resist
|
|
if(!isnull(pull_force))
|
|
source.pull_force = pull_force
|
|
|
|
/datum/element/change_force_on_death/proc/on_revive(mob/living/source)
|
|
SIGNAL_HANDLER
|
|
|
|
source.move_force = initial(source.move_force)
|
|
source.move_resist = initial(source.move_resist)
|
|
source.pull_force = initial(source.pull_force)
|