red raptors are now able to attack while ridden (#92455)

## About The Pull Request
red raptors will now be able to retaliate against mobs adjacent to it
while ridden.

## Why It's Good For The Game
red raptors dont have much use compared to its colleagues. this gives it
a bit of a unique purpose and makes it a viable option to have out on
the field

## Changelog
🆑
balance: red raptors are now able to attack while ridden
/🆑
This commit is contained in:
Ben10Omintrix
2025-08-26 03:33:46 +03:00
committed by GitHub
parent 9a62104871
commit db9e3cf9dd
6 changed files with 26 additions and 4 deletions

View File

@@ -1067,6 +1067,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
/// trait that prevents AI controllers from planning detached from ai_status to prevent weird state stuff.
#define TRAIT_AI_PAUSED "TRAIT_AI_PAUSED"
///trait that stops our ai controlled mob from moving at all due to ai planning
#define TRAIT_AI_MOVEMENT_HALTED "ai_movement_halted"
/// this is used to bypass tongue language restrictions but not tongue disabilities
#define TRAIT_TOWER_OF_BABEL "tower_of_babel"

View File

@@ -29,6 +29,12 @@
// This rider must be our friend
#define JUST_FRIEND_RIDERS (1<<5)
///Flags relating to our AI controller when ridden
//do we halt planning while ridden?
#define RIDING_PAUSE_AI_PLANNING (1<<0)
//do we halt movement while ridden?
#define RIDING_PAUSE_AI_MOVEMENT (1<<1)
//car_traits flags
///Will this car kidnap people by ramming into them?
#define CAN_KIDNAP (1<<0)

View File

@@ -8,6 +8,7 @@
GLOBAL_LIST_INIT(traits_by_type, list(
/atom = list(
"TRAIT_AI_PAUSED" = TRAIT_AI_PAUSED,
"TRAIT_AI_MOVEMENT_HALTED" = TRAIT_AI_MOVEMENT_HALTED,
"TRAIT_BANNED_FROM_CARGO_SHUTTLE" = TRAIT_BANNED_FROM_CARGO_SHUTTLE,
"TRAIT_BEAUTY_APPLIED" = TRAIT_BEAUTY_APPLIED,
"TRAIT_BEING_SHOCKED" = TRAIT_BEING_SHOCKED,

View File

@@ -37,6 +37,9 @@
if((controller.ai_traits & STOP_MOVING_WHEN_PULLED) && pawn.pulledby) //Need to store more state. Annoying.
return FALSE
if(HAS_TRAIT(pawn, TRAIT_AI_MOVEMENT_HALTED))
return FALSE
if(!isturf(pawn.loc)) //No moving if not on a turf
return FALSE

View File

@@ -11,6 +11,8 @@
var/list/override_unsharable_abilities = list()
/// abilities that are always blacklisted from sharing
var/list/blacklist_abilities = list()
/// flag that determine how our ai acts while ridden
var/ai_behavior_while_ridden = RIDING_PAUSE_AI_PLANNING | RIDING_PAUSE_AI_MOVEMENT
/datum/component/riding/creature/Initialize(mob/living/riding_mob, force = FALSE, ride_check_flags = NONE)
if(!isliving(parent))
@@ -35,7 +37,7 @@
if(isanimal(parent))
var/mob/living/simple_animal/simple_parent = parent
simple_parent.stop_automated_movement = FALSE
REMOVE_TRAIT(parent, TRAIT_AI_PAUSED, REF(src))
parent.remove_traits(list(TRAIT_AI_PAUSED, TRAIT_AI_MOVEMENT_HALTED), REF(src))
return ..()
/datum/component/riding/creature/RegisterWithParent()
@@ -83,7 +85,10 @@
rider.layer = initial(rider.layer)
if(can_be_driven)
//let the player take over if they should be controlling movement
ADD_TRAIT(ridden, TRAIT_AI_PAUSED, REF(src))
if(ai_behavior_while_ridden & RIDING_PAUSE_AI_PLANNING)
ADD_TRAIT(ridden, TRAIT_AI_PAUSED, REF(src))
if(ai_behavior_while_ridden & RIDING_PAUSE_AI_MOVEMENT)
ADD_TRAIT(ridden, TRAIT_AI_MOVEMENT_HALTED, REF(src))
return ..()
/datum/component/riding/creature/vehicle_mob_unbuckle(mob/living/formerly_ridden, mob/living/former_rider, force = FALSE)
@@ -92,7 +97,7 @@
former_rider.log_message("is no longer riding [formerly_ridden].", LOG_GAME, color="pink")
remove_abilities(former_rider)
if(!formerly_ridden.buckled_mobs.len)
REMOVE_TRAIT(formerly_ridden, TRAIT_AI_PAUSED, REF(src))
formerly_ridden.remove_traits(list(TRAIT_AI_PAUSED, TRAIT_AI_MOVEMENT_HALTED), REF(src))
// We gotta reset those layers at some point, don't we?
former_rider.layer = MOB_LAYER
formerly_ridden.layer = MOB_LAYER
@@ -674,3 +679,6 @@
/datum/component/riding/creature/raptor/fast
vehicle_move_delay = 1.5
/datum/component/riding/creature/raptor/combat
ai_behavior_while_ridden = RIDING_PAUSE_AI_MOVEMENT

View File

@@ -56,7 +56,7 @@ GLOBAL_LIST_EMPTY(raptor_population)
/datum/pet_command/move,
/datum/pet_command/free,
/datum/pet_command/attack,
/datum/pet_command/follow/start_active,
/datum/pet_command/follow,
/datum/pet_command/fetch,
)
///things we inherited from our parent
@@ -225,6 +225,7 @@ GLOBAL_LIST_EMPTY(raptor_population)
melee_damage_lower = 15
melee_damage_upper = 20
raptor_color = RAPTOR_RED
ridable_component = /datum/component/riding/creature/raptor/combat
dex_description = "A resilient breed of raptors, battle-tested and bred for the purpose of humbling its foes in combat, \
This breed demonstrates higher combat capabilities than its peers and oozes ruthless aggression."
child_path = /mob/living/basic/raptor/baby_raptor/red