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

Method damageSources

source/game/items/StarActiveItem.cpp:169–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169List<DamageSource> ActiveItem::damageSources() const {
170 List<DamageSource> damageSources = m_damageSources.get();
171 for (auto ds : m_itemDamageSources.get()) {
172 if (ds.damageArea.is<PolyF>()) {
173 auto& poly = ds.damageArea.get<PolyF>();
174 poly.rotate(m_armAngle.get());
175 if (owner()->facingDirection() == Direction::Left)
176 poly.flipHorizontal(0.0f);
177 poly.translate(handPosition(Vec2F()));
178 } else if (ds.damageArea.is<Line2F>()) {
179 auto& line = ds.damageArea.get<Line2F>();
180 line.rotate(m_armAngle.get());
181 if (owner()->facingDirection() == Direction::Left)
182 line.flipHorizontal(0.0f);
183 line.translate(handPosition(Vec2F()));
184 }
185 damageSources.append(std::move(ds));
186 }
187 return damageSources;
188}
189
190List<PolyF> ActiveItem::shieldPolys() const {
191 List<PolyF> shieldPolys = m_shieldPolys.get();

Callers

nothing calls this directly

Calls 6

getMethod · 0.45
rotateMethod · 0.45
facingDirectionMethod · 0.45
flipHorizontalMethod · 0.45
translateMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected