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

Method queryHit

source/game/StarMonster.cpp:233–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231}
232
233Maybe<HitType> Monster::queryHit(DamageSource const& source) const {
234 if (!inWorld() || m_knockedOut || m_statusController->statPositive("invulnerable"))
235 return {};
236
237 if (source.intersectsWithPoly(world()->geometry(), hitPoly().get()))
238 return HitType::Hit;
239
240 return {};
241}
242
243Maybe<PolyF> Monster::hitPoly() const {
244 PolyF hitBody = m_monsterVariant.selfDamagePoly;

Callers

nothing calls this directly

Calls 4

intersectsWithPolyMethod · 0.80
statPositiveMethod · 0.45
geometryMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected