-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIRROR] [no gbp] fixes not being able to walk over mook corpses and …
…turns it all to a element [MDB IGNORE] (#24497) (#214) * [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 :cl: fix: fixes not being able to walk over or pull mook corpses /:cl: * [no gbp] fixes not being able to walk over mook corpses and turns it all to a element --------- Co-authored-by: SkyratBot <[email protected]> Co-authored-by: Ben10Omintrix <[email protected]>
- Loading branch information
1 parent
bdc32c0
commit 55b1d0a
Showing
6 changed files
with
75 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters