| 1 | #include "Player/PlayerCounterGetCoin.h" |
|---|---|
| 2 | |
| 3 | #include "Library/Math/MathUtil.h" |
| 4 | |
| 5 | PlayerCounterGetCoin::PlayerCounterGetCoin() = default; |
| 6 | |
| 7 | f32 PlayerCounterGetCoin::getCoinBoostRate() const { |
| 8 | return sead::Mathf::clampMin(val: mTimer / 90.0f, min_: 0.0f); |
| 9 | } |
| 10 | |
| 11 | void PlayerCounterGetCoin::countUp() { |
| 12 | mTimer = sead::Mathi::clampMax(val: mTimer + 90, max_: 720); |
| 13 | mDuration = 90; |
| 14 | } |
| 15 | |
| 16 | void PlayerCounterGetCoin::update() { |
| 17 | mTimer = al::converge(mTimer, 0, 1); |
| 18 | mDuration = al::converge(mDuration, 0, 1); |
| 19 | if (!mDuration) |
| 20 | mTimer = 0; |
| 21 | } |
| 22 |