Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: in-game configuration settings #102

Merged
merged 13 commits into from
Jun 23, 2024
34 changes: 17 additions & 17 deletions aplib.net-demo/Assets/Scripts/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,31 +231,31 @@ private void CheckAllValuesToBeValid()
}
}

public void CheckItemOverflow()
private void CheckItemOverflow()
{
TotalItemCount = AmmoItemAmount + HealthItemAmount + RageItemAmount;
if (TotalItemCount > GridVolume * _maxPercentage)
{
int maxCount = Mathf.CeilToInt(GridVolume * _maxPercentage / 3);

TotalItemCount = Mathf.CeilToInt(GridVolume * _maxPercentage);
AmmoItemAmount = maxCount;
HealthItemAmount = maxCount;
RageItemAmount = maxCount;
}
if (!(TotalItemCount > GridVolume * _maxPercentage)) return;
Tboefijn marked this conversation as resolved.
Show resolved Hide resolved

int maxCount = Mathf.CeilToInt(GridVolume * _maxPercentage / 3);

TotalItemCount = Mathf.CeilToInt(GridVolume * _maxPercentage);
AmmoItemAmount = maxCount;
HealthItemAmount = maxCount;
RageItemAmount = maxCount;
}

public void CheckEnemyOverflow()
private void CheckEnemyOverflow()
{
TotalEnemyCount = RangedEnemyAmount + MeleeEnemyAmount;
if (TotalEnemyCount > GridVolume * _maxPercentage)
{
int maxCount = Mathf.CeilToInt(GridVolume * _maxPercentage / 3);

TotalItemCount = Mathf.CeilToInt(GridVolume * _maxPercentage);
MeleeEnemyAmount = maxCount;
RangedEnemyAmount = maxCount;
}
if (!(TotalEnemyCount > GridVolume * _maxPercentage)) return;
Tboefijn marked this conversation as resolved.
Show resolved Hide resolved

int maxCount = Mathf.CeilToInt(GridVolume * _maxPercentage / 3);

TotalItemCount = Mathf.CeilToInt(GridVolume * _maxPercentage);
MeleeEnemyAmount = maxCount;
RangedEnemyAmount = maxCount;
}

/// <summary>
Expand Down