XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

SpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 1 Star 0
返回提交历史

XFEstudio/SpaceNinjaServer

feat: bounty item reward (#1595)

Re #388 same as before I think this only missing `Field Bounties` and `Arcana Isolation Vault` Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1595 Reviewed-by: Sainan <sainan@calamity.inc> Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>

b429eed4
AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
提交于

代码差异

1 个文件 +133 -8
Modified src/services/missionInventoryUpdateService.ts +133 -8
@@ -732,7 +732,7 @@ export const addMissionRewards = async (
732 732 const endlessJob = syndicateEntry.Jobs.find(j => j.endless);
733 733 if (endlessJob) {
734 734 const index = rewardInfo.JobStage % endlessJob.xpAmounts.length;
735 const excess = Math.floor(rewardInfo.JobStage / endlessJob.xpAmounts.length);
735 const excess = Math.floor(rewardInfo.JobStage / (endlessJob.xpAmounts.length - 1));
736 736 medallionAmount = Math.floor(endlessJob.xpAmounts[index] * (1 + 0.15000001 * excess));
737 737 }
738 738 }
@@ -907,15 +907,140 @@ function getRandomMissionDrops(RewardInfo: IRewardInfo, tierOverride: number | u
907 907
908 908 let rotations: number[] = [];
909 909 if (RewardInfo.jobId) {
910 if (RewardInfo.JobTier! >= 0) {
911 const id = RewardInfo.jobId.split("_")[3];
912 const syndicateInfo = getWorldState().SyndicateMissions.find(x => x._id.$oid == id);
913 if (syndicateInfo) {
914 const jobInfo = syndicateInfo.Jobs![RewardInfo.JobTier!];
915 rewardManifests = [jobInfo.rewards];
916 rotations = [RewardInfo.JobStage!];
910 if (RewardInfo.JobStage! >= 0) {
911 // eslint-disable-next-line @typescript-eslint/no-unused-vars
912 const [jobType, tierStr, hubNode, syndicateId, locationTag] = RewardInfo.jobId.split("_");
913 const tier = Number(tierStr);
914 let isEndlessJob = false;
915 if (syndicateId) {
916 const worldState = getWorldState();
917 let syndicateEntry = worldState.SyndicateMissions.find(m => m._id.$oid === syndicateId);
918 if (!syndicateEntry) syndicateEntry = worldState.SyndicateMissions.find(m => m.Tag === syndicateId);
919
920 if (syndicateEntry && syndicateEntry.Jobs) {
921 let job = syndicateEntry.Jobs[tier];
922
923 if (syndicateEntry.Tag === "EntratiSyndicate") {
924 const vault = syndicateEntry.Jobs.find(j => j.locationTag === locationTag);
925 if (vault) job = vault;
926 // if (
927 // [
928 // "DeimosRuinsExterminateBounty",
929 // "DeimosRuinsEscortBounty",
930 // "DeimosRuinsMistBounty",
931 // "DeimosRuinsPurifyBounty",
932 // "DeimosRuinsSacBounty"
933 // ].some(ending => jobType.endsWith(ending))
934 // ) {
935 // job.rewards = "TODO"; // Droptable for Arcana Isolation Vault
936 // }
937 if (
938 [
939 "DeimosEndlessAreaDefenseBounty",
940 "DeimosEndlessExcavateBounty",
941 "DeimosEndlessPurifyBounty"
942 ].some(ending => jobType.endsWith(ending))
943 ) {
944 const endlessJob = syndicateEntry.Jobs.find(j => j.endless);
945 if (endlessJob) {
946 isEndlessJob = true;
947 job = endlessJob;
948 const excess = Math.floor(RewardInfo.JobStage! / (job.xpAmounts.length - 1));
949
950 const rotationIndexes = [0, 0, 1, 2];
951 const rotationIndex = rotationIndexes[excess % rotationIndexes.length];
952 const dropTable = [
953 "/Lotus/Types/Game/MissionDecks/DeimosMissionRewards/TierBTableARewards",
954 "/Lotus/Types/Game/MissionDecks/DeimosMissionRewards/TierBTableBRewards",
955 "/Lotus/Types/Game/MissionDecks/DeimosMissionRewards/TierBTableCRewards"
956 ];
957 job.rewards = dropTable[rotationIndex];
958 }
959 }
960 } else if (syndicateEntry.Tag === "SolarisSyndicate") {
961 if (jobType.endsWith("Heists/HeistProfitTakerBountyOne") && RewardInfo.JobStage == 2) {
962 job = {
963 rewards:
964 "/Lotus/Types/Game/MissionDecks/HeistJobMissionRewards/HeistTierATableARewards",
965 masteryReq: 0,
966 minEnemyLevel: 40,
967 maxEnemyLevel: 60,
968 xpAmounts: [1000]
969 };
970 RewardInfo.Q = false; // Just in case
971 } else {
972 const tierMap = {
973 Two: "B",
974 Three: "C",
975 Four: "D"
976 };
977
978 for (const [key, tier] of Object.entries(tierMap)) {
979 if (jobType.endsWith(`Heists/HeistProfitTakerBounty${key}`)) {
980 job = {
981 rewards: `/Lotus/Types/Game/MissionDecks/HeistJobMissionRewards/HeistTier${tier}TableARewards`,
982 masteryReq: 0,
983 minEnemyLevel: 40,
984 maxEnemyLevel: 60,
985 xpAmounts: [1000]
986 };
987 RewardInfo.Q = false; // Just in case
988 break;
989 }
990 }
991 }
992 }
993 rewardManifests = [job.rewards];
994 rotations = [RewardInfo.JobStage! % (job.xpAmounts.length - 1)];
995 if (
996 RewardInfo.Q &&
997 (RewardInfo.JobStage === job.xpAmounts.length - 1 || job.isVault) &&
998 !isEndlessJob
999 ) {
1000 rewardManifests.push(job.rewards);
1001 rotations.push(ExportRewards[job.rewards].length - 1);
1002 }
1003 }
917 1004 }
918 1005 }
1006 } else if (RewardInfo.challengeMissionId) {
1007 const rewardTables: Record<string, string[]> = {
1008 EntratiLabSyndicate: [
1009 "/Lotus/Types/Game/MissionDecks/EntratiLabJobMissionReward/TierATableRewards",
1010 "/Lotus/Types/Game/MissionDecks/EntratiLabJobMissionReward/TierBTableRewards",
1011 "/Lotus/Types/Game/MissionDecks/EntratiLabJobMissionReward/TierCTableRewards",
1012 "/Lotus/Types/Game/MissionDecks/EntratiLabJobMissionReward/TierDTableRewards",
1013 "/Lotus/Types/Game/MissionDecks/EntratiLabJobMissionReward/TierETableRewards"
1014 ],
1015 ZarimanSyndicate: [
1016 "/Lotus/Types/Game/MissionDecks/ZarimanJobMissionRewards/TierATableRewards",
1017 "/Lotus/Types/Game/MissionDecks/ZarimanJobMissionRewards/TierBTableRewards",
1018 "/Lotus/Types/Game/MissionDecks/ZarimanJobMissionRewards/TierCTableRewards",
1019 "/Lotus/Types/Game/MissionDecks/ZarimanJobMissionRewards/TierDTableRewards",
1020 "/Lotus/Types/Game/MissionDecks/ZarimanJobMissionRewards/TierETableRewards"
1021 ],
1022 HexSyndicate: [
1023 "/Lotus/Types/Game/MissionDecks/1999MissionRewards/TierABountyRewards",
1024 "/Lotus/Types/Game/MissionDecks/1999MissionRewards/TierBBountyRewards",
1025 "/Lotus/Types/Game/MissionDecks/1999MissionRewards/TierCBountyRewards",
1026 "/Lotus/Types/Game/MissionDecks/1999MissionRewards/TierDBountyRewards",
1027 "/Lotus/Types/Game/MissionDecks/1999MissionRewards/TierEBountyRewards",
1028 "/Lotus/Types/Game/MissionDecks/1999MissionRewards/TierFBountyRewards",
1029 "/Lotus/Types/Game/MissionDecks/1999MissionRewards/InfestedLichBountyRewards"
1030 ]
1031 };
1032
1033 const [syndicateTag, tierStr] = RewardInfo.challengeMissionId.split("_");
1034 const tier = Number(tierStr);
1035
1036 const rewardTable = rewardTables[syndicateTag][tier];
1037
1038 if (rewardTable) {
1039 rewardManifests = [rewardTable];
1040 rotations = [0];
1041 } else {
1042 logger.error(`Unknown syndicate or tier: ${RewardInfo.challengeMissionId}`);
1043 }
919 1044 } else if (RewardInfo.VaultsCracked) {
920 1045 // For Spy missions, e.g. 3 vaults cracked = A, B, C
921 1046 for (let i = 0; i != RewardInfo.VaultsCracked; ++i) {