Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ncontinanza committed Jun 11, 2024
2 parents 9a218ac + 10db0d4 commit d363462
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 108 deletions.
8 changes: 8 additions & 0 deletions client/Assets/AddressableAssetsData/OSX.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/Assets/Scripts/AfkRewards/AfkRewardRate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ public class AfkRewardRate
{
public string kalineTreeLevelId;
public string currency;
public float rate;
public float daily_rate;
}
19 changes: 10 additions & 9 deletions client/Assets/Scripts/AfkRewards/KalineTreeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public class KalineTreeManager : MonoBehaviour
[SerializeField] GameObject insufficientCurrencyPopup;
[SerializeField] GameObject afkRewardDetailUI;
[SerializeField] GameObject afkRewardsContainer;
private const int SECONDS_IN_DAY = 86400;

private const int MINUTES_IN_DAY = 1440;

void Start()
{
Expand All @@ -37,11 +38,11 @@ public void ShowRewards()
Destroy(child.gameObject);
}

foreach (var afkReward in afkRewards.Where(reward => user.User.kalineTreeLevel.afkRewardRates.Any(rewardRate => rewardRate.rate > 0 && rewardRate.currency == reward.currency)))
foreach (var afkReward in afkRewards.Where(reward => user.User.kalineTreeLevel.afkRewardRates.Any(rewardRate => rewardRate.daily_rate > 0 && rewardRate.currency == reward.currency)))
{
GameObject afkRewardGO = Instantiate(afkRewardDetailUI, afkRewardsContainer.transform);
AfkRewardDetail afkRewardDetail = afkRewardGO.GetComponent<AfkRewardDetail>();
afkRewardDetail.SetData(GlobalUserData.Instance.AvailableCurrencies.Single(currency => currency.name == afkReward.currency).image, $"{afkReward.amount} ({user.User.kalineTreeLevel.afkRewardRates.Single(arr => arr.currency == afkReward.currency).rate * 60}/m)");
afkRewardDetail.SetData(GlobalUserData.Instance.AvailableCurrencies.Single(currency => currency.name == afkReward.currency).image, $"{afkReward.amount} ({user.User.kalineTreeLevel.afkRewardRates.Single(arr => arr.currency == afkReward.currency).daily_rate / (MINUTES_IN_DAY)}/m)");
}

confirmPopUp.SetActive(true);
Expand Down Expand Up @@ -115,23 +116,23 @@ private void SetAfkRewardRatesTexts(User user)
switch (afkRewardRate.currency)
{
case "Gold":
goldAfkRewardRate.text = GetAfkRewardRateText(afkRewardRate.rate);
goldAfkRewardRate.text = GetAfkRewardRateText(afkRewardRate.daily_rate);
break;
case "Hero Souls":
heroSoulsAfkRewardRate.text = GetAfkRewardRateText(afkRewardRate.rate);
heroSoulsAfkRewardRate.text = GetAfkRewardRateText(afkRewardRate.daily_rate);
break;
case "Experience":
experienceAfkRewardRate.text = GetAfkRewardRateText(afkRewardRate.rate);
experienceAfkRewardRate.text = GetAfkRewardRateText(afkRewardRate.daily_rate);
break;
case "Arcane Crystals":
arcaneCrystalsAfkRewardRate.text = GetAfkRewardRateText(afkRewardRate.rate);
arcaneCrystalsAfkRewardRate.text = GetAfkRewardRateText(afkRewardRate.daily_rate);
break;
}
}
}

private string GetAfkRewardRateText(float rate)
private string GetAfkRewardRateText(float daily_rate)
{
return $"{rate * SECONDS_IN_DAY}/day";
return $"{daily_rate}/day";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ private AfkRewardRate CreateAfkRewardRateFromData(Protobuf.Messages.AfkRewardRat
{
kalineTreeLevelId = afkRewardRateData.KalineTreeLevelId,
currency = afkRewardRateData.Currency.Name,
rate = afkRewardRateData.Rate
daily_rate = afkRewardRateData.DailyRate
};
}

Expand Down
2 changes: 1 addition & 1 deletion client/Assets/Scripts/Campaign/LevelData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class LevelData

public Dictionary<string, int> rewards = new Dictionary<string, int>();

// AFK Rewards rate granted
// AFK Rewards daily_rate granted
// These are how many a player makes in the maximum timespan available (12h now)
public Dictionary<Currency, int> afkCurrencyRate = new Dictionary<Currency, int>();

Expand Down
7 changes: 3 additions & 4 deletions client/Assets/Scripts/Dungeon/DungeonSettlementManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class DungeonSettlementManager : MonoBehaviour
[SerializeField] GameObject confirmPopUp;
[SerializeField] GameObject insufficientCurrencyPopup;
[SerializeField] GameObject levelUpButton;
private const int SECONDS_IN_DAY = 86400;

void Start()
{
Expand Down Expand Up @@ -76,7 +75,7 @@ private void SetAfkRewardRatesTexts(User user)
{
if (afkRewardRate.currency == "Supplies")
{
suppliesAfkRewardRate.text = GetAfkRewardRateText(afkRewardRate.rate);
suppliesAfkRewardRate.text = GetAfkRewardRateText(afkRewardRate.daily_rate);
}
else
{
Expand All @@ -85,8 +84,8 @@ private void SetAfkRewardRatesTexts(User user)
}
}

private string GetAfkRewardRateText(float rate)
private string GetAfkRewardRateText(float daily_rate)
{
return $"{rate * SECONDS_IN_DAY}/day";
return $"{daily_rate}/day";
}
}
Loading

0 comments on commit d363462

Please sign in to comment.