Almost match CPlayerState::CalculateItemCollectionRate

Former-commit-id: 4d53116169
This commit is contained in:
Henrique Gemignani Passos Lima 2022-10-04 21:15:07 +03:00
parent 80ac406bc4
commit cc5b5a3cd9
2 changed files with 12 additions and 8 deletions
include/MetroidPrime/Player
src/MetroidPrime/Player

View File

@ -125,7 +125,7 @@ public:
void EnableItem(EItemType type);
bool HasPowerUp(EItemType type) const;
uint GetPowerUp(EItemType type);
uint GetItemCapacity(EItemType type) const;
int GetItemCapacity(EItemType type) const;
uint GetItemAmount(EItemType type) const;
void DecrPickUp(EItemType type, int amount);
void IncrPickUp(EItemType type, int amount);

View File

@ -271,7 +271,7 @@ uint CPlayerState::GetItemAmount(CPlayerState::EItemType type) const {
return 0;
}
uint CPlayerState::GetItemCapacity(CPlayerState::EItemType type) const {
int CPlayerState::GetItemCapacity(CPlayerState::EItemType type) const {
if (type < 0 || kIT_Max - 1 < type) {
return 0;
}
@ -413,15 +413,19 @@ void CPlayerState::SetIsFusionEnabled(bool val) { x0_26_fusion = val; }
int CPlayerState::GetTotalPickupCount() const { return 99; }
int CPlayerState::CalculateItemCollectionRate() const {
int total = GetItemCapacity(kIT_PowerBombs);
int total = 0;
int pbCount = GetItemCapacity(kIT_PowerBombs);
if (pbCount >= 4)
pbCount = pbCount - 3;
if (total >= 4)
total -= 3;
total += GetItemCapacity(kIT_WaveBeam);
total += GetItemCapacity(kIT_IceBeam);
int iceBeam = GetItemCapacity(kIT_IceBeam);
total += GetItemCapacity(kIT_PlasmaBeam);
total += GetItemCapacity(kIT_Missiles) / 5;
total += GetItemCapacity(kIT_MorphBallBombs);
int aux = total + GetItemCapacity(kIT_MorphBallBombs);
total = aux + pbCount;
total += GetItemCapacity(kIT_Flamethrower);
total += GetItemCapacity(kIT_ThermalVisor);
total += GetItemCapacity(kIT_ChargeBeam);
@ -448,7 +452,7 @@ int CPlayerState::CalculateItemCollectionRate() const {
total += GetItemCapacity(kIT_World);
total += GetItemCapacity(kIT_Spirit);
total += GetItemCapacity(kIT_Newborn);
return total + GetItemCapacity(kIT_Wavebuster);
return iceBeam + total + GetItemCapacity(kIT_Wavebuster);
}
int CPlayerState::GetMissileCostForAltAttack() const {