Fixes a few bugs with stargazer targeting and attacks (#89068)

<!-- 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

Fixes #89060 and a few other inconsistencies that I think aren't
reported yet. In particular, these are:
- Ordering the Stargazer to attack a window, machinery, and essentially
anything that isn't a wall or person will result in refusal. This
behavior was different.
- The spell to remotely command the Stargazer doesn't work.
- The shift-hover radial menu is weirdly offset.

I'm still trying to figure out what makes the mob not attack windows
unlike before, so I'll set it as a draft until I fix it.

## Why It's Good For The Game

Summoning an elder god bound to your will would be even better if it was
actually bound to your will.

## 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 its 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. -->

🆑
fix: The Stargazer, a cosmic heretic's ascension, can be properly
commanded once more.
code: Basic mob pets can now target objects, or objects and walls by
using two new targeting strategies.
/🆑

<!-- 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. -->
This commit is contained in:
StaringGasMask
2025-01-23 22:07:59 +01:00
committed by GitHub
parent 5381f615e8
commit bae82830f2
5 changed files with 20 additions and 4 deletions
@@ -4,12 +4,18 @@
var/attack_until_past_stat = HARD_CRIT
/// If we can try to closed turfs or not
var/attack_closed_turf = FALSE
/// If we want it to attack ALL OBJECTS
var/attack_obj = FALSE
///Returns true or false depending on if the target can be attacked by the mob
/datum/targeting_strategy/basic/not_friends/can_attack(mob/living/living_mob, atom/target, vision_range)
if(attack_closed_turf && isclosedturf(target))
return TRUE
if(attack_obj && isobj(target))
if(!(target.resistance_flags & INDESTRUCTIBLE))
return TRUE
if(target in living_mob.ai_controller.blackboard[BB_FRIENDS_LIST])
return FALSE
@@ -22,6 +28,15 @@
/datum/targeting_strategy/basic/not_friends/attack_closed_turfs
attack_closed_turf = TRUE
//Allows mobs to target objs. In case you want your mob to target these without going after walls
/datum/targeting_strategy/basic/not_friends/attack_objs
attack_obj = TRUE
//Let us target everything that needs targeting, just like they used to.
/datum/targeting_strategy/basic/not_friends/attack_everything
attack_closed_turf = TRUE
attack_obj = TRUE
/// Subtype that allows us to target items while deftly avoiding attacking our allies. Be careful when it comes to targeting items as an AI could get trapped targeting something it can't destroy.
/datum/targeting_strategy/basic/not_friends/allow_items