| 1631 | } |
| 1632 | |
| 1633 | void NPCHazard::Upd_OilOoze(F32 dt) |
| 1634 | { |
| 1635 | static F32 seg_pam[2] = { 0.15f, 0.75f }; |
| 1636 | HAZBall* ball = &this->custdata.ball; |
| 1637 | |
| 1638 | if (this->pam_interp <= seg_pam[0]) |
| 1639 | { |
| 1640 | ball->rad_cur = (ball->rad_max - ball->rad_min) * EASE(this->pam_interp / seg_pam[0]); |
| 1641 | ball->rad_cur += ball->rad_min; |
| 1642 | } |
| 1643 | else if (this->pam_interp >= seg_pam[1]) |
| 1644 | { |
| 1645 | ball->rad_cur = (ball->rad_max - ball->rad_min) * |
| 1646 | EASE(1.0f - ((this->pam_interp - seg_pam[1]) / (1.0f - seg_pam[1]))); |
| 1647 | ball->rad_cur += ball->rad_min; |
| 1648 | } |
| 1649 | else |
| 1650 | { |
| 1651 | ball->rad_cur = ball->rad_max; |
| 1652 | } |
| 1653 | |
| 1654 | if (this->flg_hazard & 0x8 && HAZ_AvailablePool() > 5) |
| 1655 | { |
| 1656 | if (KickOilBurst()) |
| 1657 | { |
| 1658 | this->flg_hazard |= 0x40; |
| 1659 | } |
| 1660 | } |
| 1661 | |
| 1662 | if (this->flg_hazard & 0x8) |
| 1663 | { |
| 1664 | this->tmr_nextglob = 1.5f * (0.25f * (xurand() - 0.5f)) + 1.5f; |
| 1665 | } |
| 1666 | |
| 1667 | if (this->tmr_nextglob < 0.0f && this->tmr_remain > 1.0f) |
| 1668 | { |
| 1669 | if (KickOilGlobby()) |
| 1670 | { |
| 1671 | this->flg_hazard |= 0x40; |
| 1672 | } |
| 1673 | |
| 1674 | this->tmr_nextglob = 1.5f * (0.25f * (xurand() - 0.5f)) + 1.5f; |
| 1675 | } |
| 1676 | |
| 1677 | this->tmr_nextglob = -1.0f > this->tmr_nextglob - dt ? -1.0f : this->tmr_nextglob - dt; |
| 1678 | |
| 1679 | if (this->flg_hazard & 0x2000 && !(globals.player.DamageTimer > 0.0f) && |
| 1680 | ColPlyrSphere(ball->rad_cur)) |
| 1681 | { |
| 1682 | NPCC_Slick_MakePlayerSlip(this->npc_owner); |
| 1683 | } |
| 1684 | |
| 1685 | if (--this->cnt_nextemit < 0) |
| 1686 | { |
| 1687 | this->cnt_nextemit = 10; |
| 1688 | |
| 1689 | F32 rad_use = 0.75f * ball->rad_cur; |
| 1690 | xVec3 pos_emit = this->pos_hazard; |
nothing calls this directly
no test coverage detected