Speed potion improvements (#87322)

## About The Pull Request
I've added a trait for when a speed potion is applied to the object.
This allows me to remove some args and variables from riding and
ridable, and allow fish past 2000 units of weight to have speed potions
applied to them without the risk of the slowdown being reset the next
time `update_size_and_weight()` is called.

Speed potions now also affect drag slowdown.

## Why It's Good For The Game
Small code improvement, leading to a possible balance change.
This fixes #38623.

## Changelog


🆑
balance: Speed potions now cancel drag slowdown too.
balance: Speed potions can be used on fish past 2000 units of weight.
fix: You can now speed up cardboard boxes with speed potions.
/🆑
This commit is contained in:
Ghom
2024-10-21 16:46:50 +03:00
committed by GitHub
parent f0c651da7b
commit 86aee083e3
11 changed files with 40 additions and 29 deletions
+2 -2
View File
@@ -47,7 +47,7 @@
COOLDOWN_DECLARE(vehicle_move_cooldown)
/datum/component/riding/Initialize(mob/living/riding_mob, force = FALSE, buckle_mob_flags= NONE, potion_boost = FALSE)
/datum/component/riding/Initialize(mob/living/riding_mob, force = FALSE, buckle_mob_flags= NONE)
if(!ismovable(parent))
return COMPONENT_INCOMPATIBLE
@@ -55,7 +55,7 @@
riding_mob.updating_glide_size = FALSE
ride_check_flags |= buckle_mob_flags
if(potion_boost)
if(HAS_TRAIT(parent, TRAIT_SPEED_POTIONED))
vehicle_move_delay = round(CONFIG_GET(number/movedelay/run_delay) * 0.85, 0.01)
/datum/component/riding/RegisterWithParent()
+5 -5
View File
@@ -12,7 +12,7 @@
/// abilities that are always blacklisted from sharing
var/list/blacklist_abilities = list()
/datum/component/riding/creature/Initialize(mob/living/riding_mob, force = FALSE, ride_check_flags = NONE, potion_boost = FALSE)
/datum/component/riding/creature/Initialize(mob/living/riding_mob, force = FALSE, ride_check_flags = NONE)
if(!isliving(parent))
return COMPONENT_INCOMPATIBLE
@@ -205,7 +205,7 @@
/datum/component/riding/creature/human
can_be_driven = FALSE
/datum/component/riding/creature/human/Initialize(mob/living/riding_mob, force = FALSE, ride_check_flags = NONE, potion_boost = FALSE)
/datum/component/riding/creature/human/Initialize(mob/living/riding_mob, force = FALSE, ride_check_flags = NONE)
. = ..()
var/mob/living/carbon/human/human_parent = parent
human_parent.add_movespeed_modifier(/datum/movespeed_modifier/human_carry)
@@ -446,7 +446,7 @@
/datum/component/riding/creature/goliath/deathmatch
keytype = null
/datum/component/riding/creature/goliath/Initialize(mob/living/riding_mob, force, ride_check_flags, potion_boost)
/datum/component/riding/creature/goliath/Initialize(mob/living/riding_mob, force, ride_check_flags)
. = ..()
var/mob/living/basic/mining/goliath/goliath = parent
goliath.add_movespeed_modifier(/datum/movespeed_modifier/goliath_mount)
@@ -514,7 +514,7 @@
. = ..()
set_riding_offsets(RIDING_OFFSET_ALL, list(TEXT_NORTH = list(17, 46), TEXT_SOUTH = list(17,51), TEXT_EAST = list(27, 46), TEXT_WEST = list(6, 46)))
/datum/component/riding/creature/leaper/Initialize(mob/living/riding_mob, force = FALSE, ride_check_flags = NONE, potion_boost = FALSE)
/datum/component/riding/creature/leaper/Initialize(mob/living/riding_mob, force = FALSE, ride_check_flags = NONE)
. = ..()
RegisterSignal(riding_mob, COMSIG_MOVABLE_POINTED, PROC_REF(attack_pointed))
@@ -536,7 +536,7 @@
require_minigame = TRUE
ride_check_flags = RIDER_NEEDS_ARM | UNBUCKLE_DISABLED_RIDER
/datum/component/riding/creature/raptor/Initialize(mob/living/riding_mob, force, ride_check_flags, potion_boost)
/datum/component/riding/creature/raptor/Initialize(mob/living/riding_mob, force, ride_check_flags)
. = ..()
RegisterSignal(parent, COMSIG_PROJECTILE_PREHIT, PROC_REF(on_bullet_hit))
RegisterSignal(parent, COMSIG_MOB_AFTER_APPLY_DAMAGE, PROC_REF(on_attacked))
@@ -1,6 +1,6 @@
// For any /obj/vehicle's that can be ridden
/datum/component/riding/vehicle/Initialize(mob/living/riding_mob, force = FALSE, ride_check_flags = (RIDER_NEEDS_LEGS | RIDER_NEEDS_ARMS), potion_boost = FALSE)
/datum/component/riding/vehicle/Initialize(mob/living/riding_mob, force = FALSE, ride_check_flags = (RIDER_NEEDS_LEGS | RIDER_NEEDS_ARMS))
if(!isvehicle(parent))
return COMPONENT_INCOMPATIBLE
return ..()