forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic Heretic Mobs: The Rest of Them (tgstation#78757)
## About The Pull Request Raw Prophet and Armsy had fun stuff going on and merited their own PRs, but the rest of these guys are basically just statblocks with abilities so I converted them all at once. Rust Walkers are present in a ruin and so have new AI which will actually use their abilities. They rust the area around where they spawn and throw their rust blast at people. I also gave Flesh Stalkers AI even though nobody has put them in a map because I thought it would be cool. This adds an AI behaviour where if they're not doing anything else they will turn into an animal and chill until someone's been around them for a bit, before attacking. They will also use EMP almost immediately upon performing their ambush, which kills the lights in that room. Spooky! To support this I needed to make some changes to let AI continue processing and targetting correctly while shapeshifted. I didn't give Maids or Ash Spirits AI because they'd be really boring. Other changes: I made the maid in the mirror flicker when it takes examine damage because the `visible_message` says it does but despite having the power, nobody made it actually flicker... ## Why It's Good For The Game No more simple mob heretic summons. ## Changelog :cl: refactor: Rust Walkers, Ash Spirits, Flesh Stalkers, and The Maid in the Mirror now use the basic mob framework. Please report any unusual behaviour. /:cl: --------- Co-authored-by: MrMelbert <[email protected]>
- Loading branch information
Showing
26 changed files
with
265 additions
and
180 deletions.
There are no files selected for viewing
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
41 changes: 41 additions & 0 deletions
41
code/datums/ai/basic_mobs/basic_subtrees/shapechange_ambush.dm
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,41 @@ | ||
/// Shapeshift when we have no target, until someone has been nearby for long enough | ||
/datum/ai_planning_subtree/shapechange_ambush | ||
operational_datums = list(/datum/component/ai_target_timer) | ||
/// Key where we keep our ability | ||
var/ability_key = BB_SHAPESHIFT_ACTION | ||
/// Key where we keep our target | ||
var/target_key = BB_BASIC_MOB_CURRENT_TARGET | ||
/// How long to lull our target into a false sense of security | ||
var/minimum_target_time = 8 SECONDS | ||
|
||
/datum/ai_planning_subtree/shapechange_ambush/SelectBehaviors(datum/ai_controller/controller, seconds_per_tick) | ||
var/mob/living/living_pawn = controller.pawn | ||
var/is_shifted = ismob(living_pawn.loc) | ||
var/has_target = controller.blackboard_key_exists(target_key) | ||
var/datum/action/cooldown/using_action = controller.blackboard[ability_key] | ||
|
||
if (!is_shifted) | ||
if (has_target) | ||
return // We're busy | ||
|
||
if (using_action?.IsAvailable()) | ||
controller.queue_behavior(/datum/ai_behavior/use_mob_ability/shapeshift, BB_SHAPESHIFT_ACTION) // Shift | ||
return SUBTREE_RETURN_FINISH_PLANNING | ||
|
||
if (!has_target || !using_action?.IsAvailable()) | ||
return SUBTREE_RETURN_FINISH_PLANNING // Lie in wait | ||
var/time_on_target = controller.blackboard[BB_BASIC_MOB_HAS_TARGET_TIME] || 0 | ||
if (time_on_target < minimum_target_time) | ||
return // Wait a bit longer | ||
controller.queue_behavior(/datum/ai_behavior/use_mob_ability/shapeshift, BB_SHAPESHIFT_ACTION) // Surprise! | ||
|
||
/// Selects a random shapeshift ability before shifting | ||
/datum/ai_behavior/use_mob_ability/shapeshift | ||
|
||
/datum/ai_behavior/use_mob_ability/shapeshift/setup(datum/ai_controller/controller, ability_key) | ||
var/datum/action/cooldown/spell/shapeshift/using_action = controller.blackboard[ability_key] | ||
if (!using_action?.IsAvailable()) | ||
return FALSE | ||
if (isnull(using_action.shapeshift_type)) // If we don't have a shape then pick one, AI can't use context wheels | ||
using_action.shapeshift_type = pick(using_action.possible_shapes) | ||
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
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,25 @@ | ||
/** | ||
* Player-only mob which is fast, can jaunt a short distance, and is dangerous at close range | ||
*/ | ||
/mob/living/basic/heretic_summon/ash_spirit | ||
name = "Ash Spirit" | ||
real_name = "Ashy" | ||
desc = "A manifestation of ash, trailing a perpetual cloud of short-lived cinders." | ||
icon_state = "ash_walker" | ||
icon_living = "ash_walker" | ||
maxHealth = 75 | ||
health = 75 | ||
melee_damage_lower = 15 | ||
melee_damage_upper = 20 | ||
sight = SEE_TURFS | ||
|
||
/mob/living/basic/heretic_summon/ash_spirit/Initialize(mapload) | ||
. = ..() | ||
var/static/list/actions_to_add = list( | ||
/datum/action/cooldown/spell/fire_sworn, | ||
/datum/action/cooldown/spell/jaunt/ethereal_jaunt/ash, | ||
/datum/action/cooldown/spell/pointed/cleave, | ||
) | ||
for (var/action in actions_to_add) | ||
var/datum/action/cooldown/new_action = new action(src) | ||
new_action.Grant(src) |
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,46 @@ | ||
/// Durable ambush mob with an EMP ability | ||
/mob/living/basic/heretic_summon/stalker | ||
name = "Flesh Stalker" | ||
real_name = "Flesh Stalker" | ||
desc = "An abomination cobbled together from varied remains. Its appearance changes slightly every time you blink." | ||
icon_state = "stalker" | ||
icon_living = "stalker" | ||
maxHealth = 150 | ||
health = 150 | ||
melee_damage_lower = 15 | ||
melee_damage_upper = 20 | ||
sight = SEE_MOBS | ||
ai_controller = /datum/ai_controller/basic_controller/stalker | ||
/// Associative list of action types we would like to have, and what blackboard key (if any) to put it in | ||
var/static/list/actions_to_add = list( | ||
/datum/action/cooldown/spell/emp/eldritch = BB_GENERIC_ACTION, | ||
/datum/action/cooldown/spell/jaunt/ethereal_jaunt/ash = null, | ||
/datum/action/cooldown/spell/shapeshift/eldritch = BB_SHAPESHIFT_ACTION, | ||
) | ||
|
||
/mob/living/basic/heretic_summon/stalker/Initialize(mapload) | ||
. = ..() | ||
AddComponent(/datum/component/ai_target_timer) | ||
for (var/action_type in actions_to_add) | ||
var/datum/action/new_action = new action_type(src) | ||
new_action.Grant(src) | ||
var/blackboard_key = actions_to_add[action_type] | ||
if (!isnull(blackboard_key)) | ||
ai_controller?.set_blackboard_key(blackboard_key, new_action) | ||
|
||
/// Changes shape and lies in wait when it has no target, uses EMP and attacks once it does | ||
/datum/ai_controller/basic_controller/stalker | ||
ai_traits = CAN_ACT_IN_STASIS | ||
blackboard = list( | ||
BB_TARGETTING_DATUM = new /datum/targetting_datum/basic, | ||
) | ||
|
||
ai_movement = /datum/ai_movement/basic_avoidance | ||
idle_behavior = /datum/idle_behavior/idle_random_walk | ||
planning_subtrees = list( | ||
/datum/ai_planning_subtree/simple_find_target, | ||
/datum/ai_planning_subtree/shapechange_ambush, | ||
/datum/ai_planning_subtree/use_mob_ability, | ||
/datum/ai_planning_subtree/attack_obstacle_in_path, | ||
/datum/ai_planning_subtree/basic_melee_attack_subtree, | ||
) |
Oops, something went wrong.