-
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] Reworks stop, drop, roll into a gradual, interruptable thing…
…, that repeats until extinguished [MDB IGNORE] (#662) * Reworks stop, drop, roll into a gradual, interruptable thing, that repeats until extinguished (#79694) --------- Co-authored-by: SkyratBot <[email protected]> Co-authored-by: MrMelbert <[email protected]>
- Loading branch information
1 parent
cc601e9
commit 7fc14dd
Showing
5 changed files
with
76 additions
and
14 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
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,66 @@ | ||
/datum/status_effect/stop_drop_roll | ||
id = "stop_drop_roll" | ||
alert_type = null | ||
|
||
tick_interval = 0.8 SECONDS | ||
|
||
/datum/status_effect/stop_drop_roll/on_apply() | ||
if(!iscarbon(owner)) | ||
return FALSE | ||
|
||
var/actual_interval = initial(tick_interval) | ||
if(!owner.Knockdown(actual_interval * 2, ignore_canstun = TRUE) || owner.body_position != LYING_DOWN) | ||
to_chat(owner, span_warning("You try to stop, drop, and roll - but you can't get on the ground!")) | ||
return FALSE | ||
|
||
RegisterSignal(owner, COMSIG_MOVABLE_MOVED, PROC_REF(stop_rolling)) | ||
RegisterSignal(owner, COMSIG_LIVING_SET_BODY_POSITION, PROC_REF(body_position_changed)) | ||
ADD_TRAIT(owner, TRAIT_HANDS_BLOCKED, id) // they're kinda busy! | ||
|
||
owner.visible_message( | ||
span_danger("[owner] rolls on the floor, trying to put [owner.p_them()]self out!"), | ||
span_notice("You stop, drop, and roll!"), | ||
) | ||
// Start with one weaker roll | ||
owner.spin(spintime = actual_interval, speed = actual_interval / 4) | ||
owner.adjust_fire_stacks(-0.25) | ||
return TRUE | ||
|
||
/datum/status_effect/stop_drop_roll/on_remove() | ||
UnregisterSignal(owner, list(COMSIG_MOVABLE_MOVED, COMSIG_LIVING_SET_BODY_POSITION)) | ||
REMOVE_TRAIT(owner, TRAIT_HANDS_BLOCKED, id) | ||
|
||
/datum/status_effect/stop_drop_roll/tick(seconds_between_ticks) | ||
if(HAS_TRAIT(owner, TRAIT_IMMOBILIZED) || HAS_TRAIT(owner, TRAIT_INCAPACITATED)) | ||
qdel(src) | ||
return | ||
|
||
var/actual_interval = initial(tick_interval) | ||
if(!owner.Knockdown(actual_interval * 1.2, ignore_canstun = TRUE)) | ||
stop_rolling() | ||
return | ||
|
||
owner.spin(spintime = actual_interval, speed = actual_interval / 4) | ||
owner.adjust_fire_stacks(-1) | ||
|
||
if(owner.fire_stacks > 0) | ||
return | ||
|
||
owner.visible_message( | ||
span_danger("[owner] successfully extinguishes [owner.p_them()]self!"), | ||
span_notice("You extinguish yourself."), | ||
) | ||
qdel(src) | ||
|
||
/datum/status_effect/stop_drop_roll/proc/stop_rolling(datum/source, ...) | ||
SIGNAL_HANDLER | ||
|
||
if(!QDELING(owner)) | ||
to_chat(owner, span_notice("You stop rolling around.")) | ||
qdel(src) | ||
|
||
/datum/status_effect/stop_drop_roll/proc/body_position_changed(datum/source, new_value, old_value) | ||
SIGNAL_HANDLER | ||
|
||
if(new_value != LYING_DOWN) | ||
stop_rolling() |
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