Skip to content

Commit

Permalink
can not reward multiple panel mission
Browse files Browse the repository at this point in the history
  • Loading branch information
moonheart committed May 19, 2024
1 parent a0aa69f commit 6d953b2
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions MementoMori/MementoMoriFuncs.Ops.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2061,6 +2061,7 @@ await ExecuteQuickAction(async (log, token) =>
{
var notReceived1 = info1.SelectMany(x => x.MissionStatusHistory[MissionStatusType.NotReceived]).ToList();
missionIds.AddRange(notReceived1);
await RewardMission();

var unfinishedIds1 = info1
.SelectMany(d => d.MissionStatusHistory)
Expand All @@ -2071,6 +2072,7 @@ await ExecuteQuickAction(async (log, token) =>
{
var notReceived2 = info2.SelectMany(x => x.MissionStatusHistory[MissionStatusType.NotReceived]).ToList();
missionIds.AddRange(notReceived2);
await RewardMission();

var unfinishedIds2 = info2
.SelectMany(d => d.MissionStatusHistory)
Expand All @@ -2081,19 +2083,31 @@ await ExecuteQuickAction(async (log, token) =>
{
var notReceived3 = info3.SelectMany(x => x.MissionStatusHistory[MissionStatusType.NotReceived]).ToList();
missionIds.AddRange(notReceived3);
await RewardMission();
}
}
}
else
{
var notReceived = missionInfo.UserMissionDtoInfoDict.Values.SelectMany(d => d.SelectMany(x => x.GetNotReceivedIdList()));
missionIds.AddRange(notReceived);
await RewardMission();
}
}

var rewardMissionResponse = await GetResponse<RewardMissionRequest, RewardMissionResponse>(new RewardMissionRequest() {TargetMissionIdList = missionIds});
rewardMissionResponse.RewardInfo.ItemList.PrintUserItems(log);
rewardMissionResponse.RewardInfo.CharacterList.PrintCharacterDtos(log);

async Task RewardMission()
{
if (missionIds.Count == 0)
{
return;
}

var rewardMissionResponse = await GetResponse<RewardMissionRequest, RewardMissionResponse>(new RewardMissionRequest() {TargetMissionIdList = missionIds});
rewardMissionResponse.RewardInfo.ItemList.PrintUserItems(log);
rewardMissionResponse.RewardInfo.CharacterList.PrintCharacterDtos(log);
missionIds.Clear();
}
});
}

Expand Down

0 comments on commit 6d953b2

Please sign in to comment.