From 43e4d64179532b26009c76fff78be15455ebf3d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E6=B1=89?= <5725748+qin_and_han_dynasties@user.noreply.gitee.com> Date: Sat, 25 Apr 2026 16:22:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=9A=84=E5=A5=96=E5=8A=B1?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA=E5=85=AC=E5=BC=8F=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E7=9A=84=E7=81=B5=E7=9F=B3=E5=A5=96=E5=8A=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/DailyMissionService.cs | 18 ++++++++++++++++++ Build_God_Game/src/api/dailyMission.ts | 1 + Build_God_Game/src/assets/images/mission.svg | 2 +- Build_God_Game/src/views/DailyMissionView.vue | 7 +++++++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Build_God_Api/Build_God_Api/Services/DailyMissionService.cs b/Build_God_Api/Build_God_Api/Services/DailyMissionService.cs index 8cd0775..63dccab 100644 --- a/Build_God_Api/Build_God_Api/Services/DailyMissionService.cs +++ b/Build_God_Api/Build_God_Api/Services/DailyMissionService.cs @@ -47,6 +47,7 @@ namespace Build_God_Api.Services public bool IsFromYesterday { get; set; } public DateTime AssignedDate { get; set; } public int ExpReward { get; set; } + public int MoneyReward { get; set; } public int TodayClaimedCount { get; set; } public int TodayTotalCount { get; set; } public List Rewards { get; set; } = new(); @@ -102,6 +103,18 @@ namespace Build_God_Api.Services return coefficient * levelId * levelId * levelId; } + private int CalculateMoneyReward(MissionDifficulty difficulty, int levelId) + { + var rate = difficulty switch + { + MissionDifficulty.Normal => 1, + MissionDifficulty.Hard => 2, + MissionDifficulty.Purgatory => 3, + _ => 1 + }; + return (int)(100 * rate * (1 + (levelId - 10) * 0.1m)); + } + private DateTime GetBeijingTime() { return TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, BeijingTimeZone); @@ -158,6 +171,7 @@ namespace Build_God_Api.Services IsFromYesterday = dm.IsFromYesterday, AssignedDate = dm.AssignedDate, ExpReward = CalculateExpReward(mission.Difficulty, character.LevelId), + MoneyReward = CalculateMoneyReward(mission.Difficulty, character.LevelId), TodayClaimedCount = todayClaimedCount, TodayTotalCount = todayTotalCount, MissionType = mission.Type, @@ -258,6 +272,10 @@ namespace Build_God_Api.Services character.CurrentExp += expReward; _logger.LogInformation("角色 {CharacterId} 领取任务奖励:经验 +{ExpReward}", characterId, expReward); + var moneyReward = CalculateMoneyReward(mission.Difficulty, character.LevelId); + character.Money += moneyReward; + _logger.LogInformation("角色 {CharacterId} 领取任务奖励:灵石 +{MoneyReward}", characterId, moneyReward); + if (mission.Rewards != null) { foreach (var reward in mission.Rewards) diff --git a/Build_God_Game/src/api/dailyMission.ts b/Build_God_Game/src/api/dailyMission.ts index 1eca7a1..c427ea6 100644 --- a/Build_God_Game/src/api/dailyMission.ts +++ b/Build_God_Game/src/api/dailyMission.ts @@ -60,6 +60,7 @@ export interface DailyMission { isFromYesterday: boolean assignedDate: string expReward: number + moneyReward: number todayClaimedCount: number todayTotalCount: number rewards: MissionReward[] diff --git a/Build_God_Game/src/assets/images/mission.svg b/Build_God_Game/src/assets/images/mission.svg index 6b51a6d..5439787 100644 --- a/Build_God_Game/src/assets/images/mission.svg +++ b/Build_God_Game/src/assets/images/mission.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/Build_God_Game/src/views/DailyMissionView.vue b/Build_God_Game/src/views/DailyMissionView.vue index 1ef3128..014821e 100644 --- a/Build_God_Game/src/views/DailyMissionView.vue +++ b/Build_God_Game/src/views/DailyMissionView.vue @@ -197,6 +197,7 @@ const MissionCardContent = defineComponent({ : null, h('div', { class: 'card-rewards' }, [ h('span', { class: 'reward-item exp-reward' }, `✨${props.mission.expReward}`), + h('span', { class: 'reward-item money-reward' }, `💰${props.mission.moneyReward}`), ...props.mission.rewards.slice(0, 2).map((reward: any) => h('span', { class: 'reward-item' }, `${getRewardIcon(reward.rewardType)}${reward.count}`) ), @@ -560,6 +561,12 @@ const MissionCardContent = defineComponent({ color: #ffd700; } +.money-reward { + background: rgba(34, 197, 94, 0.1); + border-color: rgba(34, 197, 94, 0.3); + color: #22c55e; +} + .reward-more { background: rgba(255, 255, 255, 0.1); color: #888888;