mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 07:08:00 +01:00
Basic blob mobs (#78520)
## About The Pull Request I remembered today that blob code is ass, especially blob spores. There's still a lot to improve but I cleaned up _some_ of it by converting these mobs. Now they use a newer framework and more signal handling as compared to circular references. I _expect_ the behaviour here to largely be the same as it was or similar. I haven't added anything fancy or new. This is a reasonably big PR but at least all of the files are small? Everything here touched every other thing enough that it didnt make sense to split up sorry. Other things I did in code: - Experimented with replacing the `mob/blob` subtype with a component. Don't know if this is genius or stupid. - AI subtree which just walks somewhere. We've used this behaviour a lot but never given it its own subtree. - Blob Spores and Zombies are two different mobs now instead of being one mob which just changes every single one of its properties. - Made a few living defence procs call super, because the only thing super does was send a signal and we weren't doing that for no reason. Also added a couple extra signals for intercepts we did not have. ## Changelog 🆑 fix: Blob spores will respond to rallies more reliably (it won't runtime every time they try and pathfind). fix: Blobbernaut pain animation overlays should align with the direction the mob is facing instead of always facing South refactor: Blob spores, zombies, and blobbernauts now all use the basic mob framework. They should work the same, but please report any issues. /🆑 --------- Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Co-authored-by: san7890 <the@san7890.com>
This commit is contained in:
co-authored by
MrMelbert
san7890
parent
2b9a07e5db
commit
517d33e6f0
@@ -6,6 +6,8 @@
|
||||
/datum/ai_behavior/travel_towards
|
||||
required_distance = 0
|
||||
behavior_flags = AI_BEHAVIOR_REQUIRE_MOVEMENT | AI_BEHAVIOR_CAN_PLAN_DURING_EXECUTION
|
||||
/// If true we will get rid of our target on completion
|
||||
var/clear_target = FALSE
|
||||
|
||||
/datum/ai_behavior/travel_towards/setup(datum/ai_controller/controller, target_key)
|
||||
. = ..()
|
||||
@@ -16,7 +18,15 @@
|
||||
|
||||
/datum/ai_behavior/travel_towards/perform(seconds_per_tick, datum/ai_controller/controller, target_key)
|
||||
. = ..()
|
||||
finish_action(controller, TRUE)
|
||||
finish_action(controller, TRUE, target_key)
|
||||
|
||||
/datum/ai_behavior/travel_towards/finish_action(datum/ai_controller/controller, succeeded, target_key)
|
||||
. = ..()
|
||||
if (clear_target)
|
||||
controller.clear_blackboard_key(target_key)
|
||||
|
||||
/datum/ai_behavior/travel_towards/stop_on_arrival
|
||||
clear_target = TRUE
|
||||
|
||||
/**
|
||||
* # Travel Towards Atom
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/// Simply walk to a location
|
||||
/datum/ai_planning_subtree/travel_to_point
|
||||
/// Blackboard key where we travel a place we walk to
|
||||
var/location_key = BB_TRAVEL_DESTINATION
|
||||
/// What do we do in order to travel
|
||||
var/travel_behaviour = /datum/ai_behavior/travel_towards
|
||||
|
||||
/datum/ai_planning_subtree/travel_to_point/SelectBehaviors(datum/ai_controller/controller, seconds_per_tick)
|
||||
. = ..()
|
||||
var/atom/target = controller.blackboard[location_key]
|
||||
if (QDELETED(target))
|
||||
return
|
||||
controller.queue_behavior(travel_behaviour, location_key)
|
||||
return SUBTREE_RETURN_FINISH_PLANNING
|
||||
|
||||
|
||||
/datum/ai_planning_subtree/travel_to_point/and_clear_target
|
||||
travel_behaviour = /datum/ai_behavior/travel_towards/stop_on_arrival
|
||||
Reference in New Issue
Block a user