[Feature] Add Water Line of Sight Checks (#3408)

* [Feature] Add Water Line of Sight Checks

This adds rules to enable or disable checks for spells and autofire to prevent casting or autofire from landing if the player or bot do not match their targets plane in regards to water.

Currently players and bots can cast or autofire if they are not in the water but their target is and vice versa, this should not be possible.

RuleB(Combat, WaterMatchRequiredForAutoFireLoS) set to True (default) checks that both parties are in or out of the water for AutoFire to work.

RuleB(Spells, WaterMatchRequiredForLoS) set to True (default) checks that both parties are in or out of the water for spells to land.

* Cleanup.

* Cleanup.

* Cleanup.

---------

Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
This commit is contained in:
nytmyr
2023-06-17 12:32:15 -05:00
committed by GitHub
parent 75391d96f4
commit 0cf454dc29
6 changed files with 49 additions and 13 deletions
+1
View File
@@ -753,6 +753,7 @@ public:
bool CheckLosFN(Mob* other);
bool CheckLosFN(float posX, float posY, float posZ, float mobSize);
static bool CheckLosFN(glm::vec3 posWatcher, float sizeWatcher, glm::vec3 posTarget, float sizeTarget);
virtual bool CheckWaterLoS(Mob* m);
inline void SetLastLosState(bool value) { last_los_check = value; }
inline bool CheckLastLosState() const { return last_los_check; }
std::string GetMobDescription();