MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / Upd_OilGlob

Method Upd_OilGlob

src/SB/Game/zNPCHazard.cpp:1782–1813  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1780}
1781
1782void NPCHazard::Upd_OilGlob(F32 dt)
1783{
1784 HAZShroom* shroom = &this->custdata.shroom;
1785
1786 F32 rat_quad = SQ(this->pam_interp) / SQ(0.25f);
1787 if (rat_quad <= 0.25f)
1788 {
1789 shroom->rad_cur = LERP(rat_quad, shroom->rad_min, shroom->rad_max);
1790 }
1791
1792 this->pos_hazard += shroom->vel_rise * dt;
1793 shroom->vel_rise += shroom->acc_rise * dt;
1794
1795 if (this->flg_hazard & 0x2000 && !(globals.player.DamageTimer > 0.0f) &&
1796 ColPlyrSphere(shroom->rad_cur))
1797 {
1798 NPCC_Slick_MakePlayerSlip(this->npc_owner);
1799 }
1800
1801 if (--this->cnt_nextemit < 0)
1802 {
1803 this->cnt_nextemit = 10;
1804
1805 F32 rad_use = 0.75f * shroom->rad_cur;
1806 xVec3 pos_emit = this->pos_hazard;
1807 pos_emit += *(xVec3*)this->At() * (2.0f * (xurand() - 0.5f) * rad_use);
1808 pos_emit += *(xVec3*)this->Right() * (2.0f * (xurand() - 0.5f) * rad_use);
1809 pos_emit += *(xVec3*)this->Up() * 0.1f;
1810
1811 NPAR_EmitOilVapors(&pos_emit);
1812 }
1813}
1814
1815void NPCHazard::Upd_FunFrag(F32 dt)
1816{

Callers

nothing calls this directly

Calls 6

AtMethod · 0.95
RightMethod · 0.95
UpMethod · 0.95
LERPFunction · 0.85
xurandFunction · 0.85
NPAR_EmitOilVaporsFunction · 0.85

Tested by

no test coverage detected