| 1001 | } |
| 1002 | |
| 1003 | bool BattleUnit::hasLineToPosition(Vec3<float> targetPosition, bool useLOS) const |
| 1004 | { |
| 1005 | auto muzzleLocation = getMuzzleLocation(); |
| 1006 | // Map part that prevents Line to target |
| 1007 | auto cMap = tileObject->map.findCollision(muzzleLocation, targetPosition, mapPartSet, |
| 1008 | tileObject, useLOS); |
| 1009 | // Unit that prevents Line to target |
| 1010 | auto cUnitObj = |
| 1011 | useLOS ? Collision() |
| 1012 | : tileObject->map.findCollision(muzzleLocation, targetPosition, unitSet, tileObject); |
| 1013 | auto cUnit = cUnitObj ? std::static_pointer_cast<TileObjectBattleUnit>(cUnitObj.obj)->getUnit() |
| 1014 | : nullptr; |
| 1015 | // Condition: |
| 1016 | // No map part blocks Line |
| 1017 | return !cMap |
| 1018 | // No unit blocks Line |
| 1019 | && (!cUnit || |
| 1020 | owner->isRelatedTo(cUnit->owner) == Organisation::Relation::Hostile |
| 1021 | // If our head blocks brainsucker on it - no problem, hit will go versus brainsucker |
| 1022 | // anyway |
| 1023 | || cUnit->brainSucker); |
| 1024 | } |
| 1025 | |
| 1026 | int BattleUnit::getPsiChanceForEquipment(StateRef<BattleUnit> target, PsiStatus status, |
| 1027 | StateRef<AEquipmentType> item) |
nothing calls this directly
no test coverage detected