mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-18 05:26:56 +01:00
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may not be viewable. --> <!-- You can view Contributing.MD for a detailed description of the pull request process. --> ## About The Pull Request Moves a few checks if someone's flying/hovering to use the is_avoiding_ground check. It also removes the slowdown of a tile if you aren't actually stepping on it. This check does include more, like if you are only riding on something that's lifting you up enough, but unless it flies itself, it'll trigger what you may be avoiding, and in turn, will be affected by it (i.E falling down the chasm, there is no delay in my test, so no Yoshiing over a single tile.) Draft for now to see if there are more places to check for it, and as the balance change is big enough to warrant additional thoughts. ## Why It's Good For The Game Flying people no longer leave footprints, nor touch the ground for water or lava. Logically, they aren't even slowed down by the tiles. This heavily buffs flying, at least the ignoring the slowdown part, so that may be removed for the sake of balance. The rest should be more flavorful, or just making sense. ## Changelog <!-- If your PR modifies aspects of the game that can be concretely observed by players or admins you should add a changelog. If your change does NOT meet this description, remove this section. Be sure to properly mark your PRs to prevent unnecessary GBP loss. You can read up on GBP and it's effects on PRs in the tgstation guides for contributors. Please note that maintainers freely reserve the right to remove and add tags should they deem it appropriate. You can attempt to finagle the system all you want, but it's best to shoot for clear communication right off the bat. --> 🆑 tweak: If you aren't touching the ground, don't interact with things there. /🆑 <!-- Both 🆑's are required for the changelog to work! You can put your name to the right of the first 🆑 if you want to overwrite your GitHub username as author ingame. --> <!-- You can use multiple of the same prefix (they're only used for the icon ingame) and delete the unneeded ones. Despite some of the tags, changelogs should generally represent how a player might be affected by the changes rather than a summary of the PR's contents. --> --------- Co-authored-by: MarsMond <no@email>
75 lines
2.1 KiB
Plaintext
75 lines
2.1 KiB
Plaintext
//* This file is explicitly licensed under the MIT license. *//
|
|
//* Copyright (c) 2024 Citadel Station developers. *//
|
|
|
|
/**
|
|
* /obj only
|
|
*
|
|
* * too inefficient for /turf
|
|
* * not complex enough for /mob
|
|
*
|
|
* todo: multi-tile object support
|
|
*/
|
|
/datum/component/slippery
|
|
registered_type = /datum/component/slippery
|
|
|
|
var/slip_class = SLIP_CLASS_WATER
|
|
var/hard_strength = 5
|
|
var/soft_strength = 10
|
|
|
|
/datum/component/slippery/Initialize(slip_class, hard_strength, soft_strength)
|
|
if(!isobj(parent))
|
|
return COMPONENT_INCOMPATIBLE
|
|
. = ..()
|
|
if(. == COMPONENT_INCOMPATIBLE)
|
|
return
|
|
|
|
if(!isnull(slip_class))
|
|
src.slip_class = slip_class
|
|
if(!isnull(hard_strength))
|
|
src.hard_strength = hard_strength
|
|
if(!isnull(soft_strength))
|
|
src.soft_strength = soft_strength
|
|
|
|
/datum/component/slippery/RegisterWithParent()
|
|
RegisterSignal(parent, COMSIG_MOVABLE_MOVED, PROC_REF(on_move))
|
|
if(isturf(parent:loc))
|
|
RegisterSignal(parent:loc, COMSIG_ATOM_ENTERED, PROC_REF(on_enter))
|
|
|
|
/datum/component/slippery/UnregisterFromParent()
|
|
UnregisterSignal(parent, COMSIG_MOVABLE_MOVED)
|
|
if(isturf(parent:loc))
|
|
UnregisterSignal(parent:loc, COMSIG_ATOM_ENTERED)
|
|
|
|
/datum/component/slippery/proc/on_move(atom/movable/source, atom/old_loc)
|
|
var/atom/new_loc = source.loc
|
|
if(old_loc == new_loc)
|
|
return
|
|
if(isturf(old_loc))
|
|
UnregisterSignal(old_loc, COMSIG_ATOM_ENTERED)
|
|
if(isturf(new_loc))
|
|
RegisterSignal(new_loc, COMSIG_ATOM_ENTERED, PROC_REF(on_enter))
|
|
|
|
/datum/component/slippery/proc/on_enter(turf/source, atom/movable/entering, atom/old_loc)
|
|
if(source == parent)
|
|
return
|
|
// no more locker exploit
|
|
// basically, don't slip if they're exiting onto the tile we're on
|
|
if(old_loc?.loc == parent:loc)
|
|
return
|
|
if(!isliving(entering))
|
|
return
|
|
var/mob/living/living_entering = entering
|
|
// todo: refactor these
|
|
if(living_entering.is_incorporeal())
|
|
return
|
|
if(living_entering.resting)
|
|
return
|
|
if(!(living_entering.movement_type & MOVEMENT_GROUND) || living_entering.is_avoiding_ground())
|
|
return
|
|
// end
|
|
|
|
// check for yanks
|
|
spawn(0)
|
|
if(living_entering.loc == source)
|
|
living_entering.slip_act(slip_class, parent, hard_strength, soft_strength)
|