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

Feature/worldboss fe qa 4 #6955

Merged
merged 3 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ protected void Awake()
var preRaiderState = WorldBossStates.GetPreRaiderState(avatarAddress);
foreach (var notification in notificationsSeasonReward)
{
if (preRaiderState is null)
{
notification.SetActive(false);
return;
}

notification.SetActive(!isOnSeason && !preRaiderState.HasClaimedReward);
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Linq;
using System;
using System.Linq;
using Nekoyume.Blockchain;
using Nekoyume.Helper;
using Nekoyume.L10n;
Expand Down Expand Up @@ -59,19 +60,21 @@ public void Set(WorldBossState worldBossState, RaiderState raider, int raidId, b
var tableSheets = Game.Game.instance.TableSheets;
var contributeSheet = tableSheets.WorldBossContributionRewardSheet;
var contributeRow = contributeSheet.Values.FirstOrDefault(r => r.BossId == raidRow.BossId);
if (contributeRow == null)
if (contributeRow == null || worldBossState == null)
{
NcDebug.LogError($"Not found WorldBossContributionRewardSheet for bossId: {raidRow.BossId}");
NcDebug.LogError($"Not found WorldBoss Data: {raidRow.BossId}");
return;
}
rewardItem.Set(contributeRow);

var worldBossTotalDamage = worldBossState.TotalDamage;
worldBossTotalDamageText.text = $"{worldBossTotalDamage:N0}";

if (raider == null)
{
claimButton.SetCondition(() => false);
claimButton.UpdateObjects();

worldBossTotalDamageText.text = "0";
userTotalDamageText.text = "0 (0%)";

foreach (var rewardItemView in rewardItems)
Expand All @@ -85,10 +88,7 @@ public void Set(WorldBossState worldBossState, RaiderState raider, int raidId, b
claimButton.SetCondition(() => canClaim);
claimButton.UpdateObjects();

var worldBossTotalDamage = worldBossState?.TotalDamage ?? 0;
var userTotalDamage = raider?.TotalScore ?? 0;

worldBossTotalDamageText.text = $"{worldBossTotalDamage:N0}";
var userTotalDamage = raider.TotalScore;
float ratio = 0;
if (worldBossTotalDamage > 0)
{
Expand All @@ -113,7 +113,7 @@ public void Set(WorldBossState worldBossState, RaiderState raider, int raidId, b
if (!string.IsNullOrEmpty(currentItem.Ticker))
{
var amount = (decimal)currentItem.Count * (decimal)ratio;
if (amount <= 0)
if (Math.Floor(amount) <= 0)
{
continue;
}
Expand Down
Loading