-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIRROR] Adds tram throwing mobs through glass windows (#2048)
* Adds tram throwing mobs through glass windows (#81284) ## About The Pull Request - Adds a PASSWINDOW flag so that you can throw mobs through window panes, smashing them - Being thrown into the tram window by event only (not player thrown) has a chance to break through the window - Reduced throw range of tram emergency stop ## Why It's Good For The Game Sometimes you don't want them to bounce off the window when they hit, rather comically fly through it. ## Changelog :cl: LT3 add: The tram has been equipped with enhanced safety glass to reduce the severity of crew injuries /:cl: * Adds tram throwing mobs through glass windows --------- Co-authored-by: NovaBot <[email protected]> Co-authored-by: lessthanthree <[email protected]>
- Loading branch information
1 parent
bbbcadf
commit 67e738c
Showing
16 changed files
with
269 additions
and
232 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* # Window Smashing | ||
* An element you put on mobs to let them smash through walls on movement | ||
* For example, throwing someone through a glass window | ||
*/ | ||
/datum/element/window_smashing | ||
|
||
/datum/element/window_smashing/Attach(datum/target, duration = 1.5 SECONDS) | ||
. = ..() | ||
if(!isliving(target)) | ||
return ELEMENT_INCOMPATIBLE | ||
var/mob/living/living_target = target | ||
RegisterSignal(living_target, COMSIG_MOVABLE_MOVED, PROC_REF(flying_window_smash)) | ||
passwindow_on(target, TRAM_PASSENGER_TRAIT) | ||
addtimer(CALLBACK(src, PROC_REF(Detach), living_target), duration) | ||
|
||
/// Smash any windows that the mob is flying through | ||
/datum/element/window_smashing/proc/flying_window_smash(atom/movable/flying_mob, atom/old_loc, direction) | ||
SIGNAL_HANDLER | ||
var/turf/target_turf = get_turf(flying_mob) | ||
for(var/obj/structure/tram/tram_wall in target_turf) | ||
tram_wall.smash_and_injure(flying_mob, old_loc, direction) | ||
|
||
for(var/obj/structure/window/window in target_turf) | ||
window.smash_and_injure(flying_mob, old_loc, direction) | ||
|
||
/datum/element/window_smashing/Detach(datum/source) | ||
UnregisterSignal(source, COMSIG_MOVABLE_MOVED) | ||
passwindow_off(source, TRAM_PASSENGER_TRAIT) | ||
return ..() |
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
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