MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / queryHit

Method queryHit

source/game/StarNpc.cpp:304–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302}
303
304Maybe<HitType> Npc::queryHit(DamageSource const& source) const {
305 if (!inWorld() || !m_statusController->resourcePositive("health") || m_statusController->statPositive("invulnerable"))
306 return {};
307
308 if (m_tools->queryShieldHit(source))
309 return HitType::ShieldHit;
310
311 if (source.intersectsWithPoly(world()->geometry(), m_movementController->collisionBody()))
312 return HitType::Hit;
313
314 return {};
315}
316
317Maybe<PolyF> Npc::hitPoly() const {
318 return m_movementController->collisionBody();

Callers

nothing calls this directly

Calls 6

queryShieldHitMethod · 0.80
intersectsWithPolyMethod · 0.80
resourcePositiveMethod · 0.45
statPositiveMethod · 0.45
geometryMethod · 0.45
collisionBodyMethod · 0.45

Tested by

no test coverage detected