| 1780 | } |
| 1781 | |
| 1782 | void 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 | |
| 1815 | void NPCHazard::Upd_FunFrag(F32 dt) |
| 1816 | { |