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

XFESpaceNinjaServer

A simple server for a small space ninja game

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

XFEstudio/XFESpaceNinjaServer

feat: classic bounty version check (#3219)

Allows to show them properly on old versions Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3219 Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com> Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>

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

代码差异

3 个文件 +79 -44
Modified src/constants/gameToBuildVersion.ts +2 -0
@@ -23,6 +23,8 @@ const gameToBuildVersion = {
23 23 "29.10.0": "2021.03.19.10.30",
24 24 "29.6.8": "2021.01.25.08.49",
25 25 "29.3.1": "2020.11.04.18.58",
26 "29.0.0": "2018.11.08.14.45",
27 "28.3.0": "2020.08.12.19.57",
26 28 "28.0.0": "2020.06.12.16.46",
27 29 "27.2.0": "2020.03.05.16.06",
28 30 "26.0.0": "2019.10.31.22.42",
Modified src/services/missionInventoryUpdateService.ts +2 -2
@@ -1490,7 +1490,7 @@ export const addMissionRewards = async (
1490 1490 const [jobType, unkIndex, hubNode, syndicateMissionId] = rewardInfo.jobId.split("_");
1491 1491 const syndicateMissions: ISyndicateMissionInfo[] = [];
1492 1492 if (syndicateMissionId) {
1493 pushClassicBounties(syndicateMissions, idToBountyCycle(syndicateMissionId));
1493 pushClassicBounties(syndicateMissions, idToBountyCycle(syndicateMissionId), account.BuildLabel);
1494 1494 }
1495 1495 let syndicateEntry: ISyndicateMissionInfo | IGoal | undefined = syndicateMissions.find(
1496 1496 m => m._id.$oid === syndicateMissionId
@@ -2053,7 +2053,7 @@ function getRandomMissionDrops(
2053 2053 if (syndicateMissionId) {
2054 2054 const syndicateMissions: ISyndicateMissionInfo[] = [];
2055 2055 if (syndicateMissionId) {
2056 pushClassicBounties(syndicateMissions, idToBountyCycle(syndicateMissionId));
2056 pushClassicBounties(syndicateMissions, idToBountyCycle(syndicateMissionId), account.BuildLabel);
2057 2057 }
2058 2058 let syndicateEntry: ISyndicateMissionInfo | IGoal | undefined = syndicateMissions.find(
2059 2059 m => m._id.$oid === syndicateMissionId
Modified src/services/worldStateService.ts +75 -42
@@ -672,7 +672,11 @@ const generateXpAmounts = (rng: SRng, stageCount: number, minXp: number, maxXp:
672 672 //console.log(generateXpAmounts(new SRng(1337n), 4, 15, 15)); // [4, 4, 4, 5]
673 673 //console.log(generateXpAmounts(new SRng(1337n), 4, 20, 20)); // [5, 5, 5, 7]
674 674
675 export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[], bountyCycle: number): void => {
675 export const pushClassicBounties = (
676 syndicateMissions: ISyndicateMissionInfo[],
677 bountyCycle: number,
678 buildLabel?: string
679 ): void => {
676 680 const table = String.fromCharCode(65 + (bountyCycle % 3));
677 681 const vaultTable = String.fromCharCode(65 + ((bountyCycle + 1) % 3));
678 682 const deimosDTable = String.fromCharCode(65 + (bountyCycle % 2));
@@ -681,7 +685,7 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
681 685 const bountyCycleStart = bountyCycle * 9000000;
682 686 const bountyCycleEnd = bountyCycleStart + 9000000;
683 687
684 {
688 if (buildLabel && version_compare(buildLabel, gameToBuildVersion["22.0.0"]) >= 0) {
685 689 const rng = new SRng(seed);
686 690 const pool = [...eidolonJobs];
687 691 syndicateMissions.push({
@@ -697,7 +701,10 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
697 701 {
698 702 jobType: rng.randomElementPop(pool),
699 703 rewards: `/Lotus/Types/Game/MissionDecks/EidolonJobMissionRewards/TierATable${table}Rewards`,
700 masteryReq: 0,
704 // Should be U22.10
705 ...(version_compare(buildLabel, gameToBuildVersion["22.13.4"]) >= 0 && {
706 masteryReq: 0
707 }),
701 708 minEnemyLevel: 5,
702 709 maxEnemyLevel: 15,
703 710 xpAmounts: generateXpAmounts(rng, 3, 1000, 1500)
@@ -705,7 +712,9 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
705 712 {
706 713 jobType: rng.randomElementPop(pool),
707 714 rewards: `/Lotus/Types/Game/MissionDecks/EidolonJobMissionRewards/TierBTable${table}Rewards`,
708 masteryReq: 1,
715 ...(version_compare(buildLabel, gameToBuildVersion["22.13.4"]) >= 0 && {
716 masteryReq: 1
717 }),
709 718 minEnemyLevel: 10,
710 719 maxEnemyLevel: 30,
711 720 xpAmounts: generateXpAmounts(rng, 3, 1750, 2250)
@@ -713,7 +722,9 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
713 722 {
714 723 jobType: rng.randomElementPop(pool),
715 724 rewards: `/Lotus/Types/Game/MissionDecks/EidolonJobMissionRewards/TierCTable${table}Rewards`,
716 masteryReq: 2,
725 ...(version_compare(buildLabel, gameToBuildVersion["22.13.4"]) >= 0 && {
726 masteryReq: 2
727 }),
717 728 minEnemyLevel: 20,
718 729 maxEnemyLevel: 40,
719 730 xpAmounts: generateXpAmounts(rng, 4, 2500, 3000)
@@ -721,7 +732,9 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
721 732 {
722 733 jobType: rng.randomElementPop(pool),
723 734 rewards: `/Lotus/Types/Game/MissionDecks/EidolonJobMissionRewards/TierDTable${table}Rewards`,
724 masteryReq: 3,
735 ...(version_compare(buildLabel, gameToBuildVersion["22.13.4"]) >= 0 && {
736 masteryReq: 3
737 }),
725 738 minEnemyLevel: 30,
726 739 maxEnemyLevel: 50,
727 740 xpAmounts: generateXpAmounts(rng, 5, 3250, 3750)
@@ -729,32 +742,43 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
729 742 {
730 743 jobType: rng.randomElementPop(pool),
731 744 rewards: `/Lotus/Types/Game/MissionDecks/EidolonJobMissionRewards/TierETable${table}Rewards`,
732 masteryReq: 5,
745 ...(version_compare(buildLabel, gameToBuildVersion["22.13.4"]) >= 0 && {
746 masteryReq: 4
747 }),
733 748 minEnemyLevel: 40,
734 749 maxEnemyLevel: 60,
735 750 xpAmounts: generateXpAmounts(rng, 5, 4000, 4500)
736 751 },
737 {
738 jobType: rng.randomElementPop(pool),
739 rewards: `/Lotus/Types/Game/MissionDecks/EidolonJobMissionRewards/TierETable${table}Rewards`,
740 masteryReq: 10,
741 minEnemyLevel: 100,
742 maxEnemyLevel: 100,
743 xpAmounts: [840, 840, 840, 840, 1660]
744 },
745 {
746 jobType: rng.randomElement(eidolonNarmerJobs),
747 rewards: `/Lotus/Types/Game/MissionDecks/EidolonJobMissionRewards/NarmerTable${table}Rewards`,
748 masteryReq: 0,
749 minEnemyLevel: 50,
750 maxEnemyLevel: 70,
751 xpAmounts: generateXpAmounts(rng, 5, 4500, 5000)
752 }
752 // U28.1
753 ...(version_compare(buildLabel, gameToBuildVersion["28.3.0"]) >= 0
754 ? [
755 {
756 jobType: rng.randomElementPop(pool),
757 rewards: `/Lotus/Types/Game/MissionDecks/EidolonJobMissionRewards/TierETable${table}Rewards`,
758 masteryReq: 10,
759 minEnemyLevel: 100,
760 maxEnemyLevel: 100,
761 xpAmounts: [840, 840, 840, 840, 1660]
762 }
763 ]
764 : []),
765 ...(version_compare(buildLabel, gameToBuildVersion["31.0.0"]) >= 0
766 ? [
767 {
768 jobType: rng.randomElement(eidolonNarmerJobs),
769 rewards: `/Lotus/Types/Game/MissionDecks/EidolonJobMissionRewards/NarmerTable${table}Rewards`,
770 masteryReq: 0,
771 minEnemyLevel: 50,
772 maxEnemyLevel: 70,
773 xpAmounts: generateXpAmounts(rng, 5, 4500, 5000)
774 }
775 ]
776 : [])
753 777 ]
754 778 });
755 779 }
756 780
757 {
781 if (buildLabel && version_compare(buildLabel, gameToBuildVersion["24.0.0"]) >= 0) {
758 782 const rng = new SRng(seed);
759 783 const pool = [...venusJobs];
760 784 syndicateMissions.push({
@@ -807,27 +831,36 @@ export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[],
807 831 maxEnemyLevel: 60,
808 832 xpAmounts: generateXpAmounts(rng, 5, 4000, 4500)
809 833 },
810 {
811 jobType: rng.randomElementPop(pool),
812 rewards: `/Lotus/Types/Game/MissionDecks/VenusJobMissionRewards/VenusTierETable${table}Rewards`,
813 masteryReq: 10,
814 minEnemyLevel: 100,
815 maxEnemyLevel: 100,
816 xpAmounts: [840, 840, 840, 840, 1660]
817 },
818 {
819 jobType: rng.randomElement(venusNarmerJobs),
820 rewards: "/Lotus/Types/Game/MissionDecks/EidolonJobMissionRewards/NarmerTableBRewards",
821 masteryReq: 0,
822 minEnemyLevel: 50,
823 maxEnemyLevel: 70,
824 xpAmounts: generateXpAmounts(rng, 5, 4500, 5000)
825 }
834 // U28.1
835 ...(version_compare(buildLabel, gameToBuildVersion["28.3.0"]) >= 0
836 ? [
837 {
838 jobType: rng.randomElementPop(pool),
839 rewards: `/Lotus/Types/Game/MissionDecks/VenusJobMissionRewards/VenusTierETable${table}Rewards`,
840 masteryReq: 10,
841 minEnemyLevel: 100,
842 maxEnemyLevel: 100,
843 xpAmounts: [840, 840, 840, 840, 1660]
844 }
845 ]
846 : []),
847 ...(version_compare(buildLabel, gameToBuildVersion["31.0.0"]) >= 0
848 ? [
849 {
850 jobType: rng.randomElement(venusNarmerJobs),
851 rewards: "/Lotus/Types/Game/MissionDecks/EidolonJobMissionRewards/NarmerTableBRewards",
852 masteryReq: 0,
853 minEnemyLevel: 50,
854 maxEnemyLevel: 70,
855 xpAmounts: generateXpAmounts(rng, 5, 4500, 5000)
856 }
857 ]
858 : [])
826 859 ]
827 860 });
828 861 }
829 862
830 {
863 if (buildLabel && version_compare(buildLabel, gameToBuildVersion["29.0.0"]) >= 0) {
831 864 const rng = new SRng(seed);
832 865 const pool = [...microplanetJobs];
833 866 syndicateMissions.push({
@@ -3412,7 +3445,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
3412 3445 Nodes: []
3413 3446 });
3414 3447
3415 pushClassicBounties(worldState.SyndicateMissions, bountyCycle);
3448 pushClassicBounties(worldState.SyndicateMissions, bountyCycle, buildLabel);
3416 3449 } while (isBeforeNextExpectedWorldStateRefresh(timeMs, bountyCycleEnd) && ++bountyCycle);
3417 3450
3418 3451 const ghoulsCycleDay = day % 21;