| 1761 | } |
| 1762 | |
| 1763 | bool AiPlanPath(Monster &monster) |
| 1764 | { |
| 1765 | if (monster.type().type != MT_GOLEM) { |
| 1766 | if (monster.activeForTicks == 0) |
| 1767 | return false; |
| 1768 | if (monster.mode != MonsterMode::Stand) |
| 1769 | return false; |
| 1770 | if (IsNoneOf(monster.goal, MonsterGoal::Normal, MonsterGoal::Move, MonsterGoal::Attack)) |
| 1771 | return false; |
| 1772 | if (monster.position.tile == GolemHoldingCell) |
| 1773 | return false; |
| 1774 | } |
| 1775 | |
| 1776 | bool clear = LineClear( |
| 1777 | [&monster](Point position) { return IsTileAvailable(monster, position); }, |
| 1778 | monster.position.tile, |
| 1779 | monster.enemyPosition); |
| 1780 | if (!clear || (monster.pathCount >= 5 && monster.pathCount < 8)) { |
| 1781 | if ((monster.flags & MFLAG_CAN_OPEN_DOOR) != 0) |
| 1782 | MonstCheckDoors(monster); |
| 1783 | monster.pathCount++; |
| 1784 | if (monster.pathCount < 5) |
| 1785 | return false; |
| 1786 | if (AiPlanWalk(monster)) |
| 1787 | return true; |
| 1788 | } |
| 1789 | |
| 1790 | if (monster.type().type != MT_GOLEM) |
| 1791 | monster.pathCount = 0; |
| 1792 | |
| 1793 | return false; |
| 1794 | } |
| 1795 | |
| 1796 | void AiAvoidance(Monster &monster) |
| 1797 | { |
no test coverage detected