返回提交历史
Modified
src/services/itemDataService.ts
+74
-48
Modified
src/services/purchaseService.ts
+1
-1
XFEstudio/SpaceNinjaServer
chore: add supplemental weapon credits costs for u7 (#3846)
Closes #3842 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3846 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
7ab178de
代码差异
2 个文件
+75
-49
@@ -1857,6 +1857,27 @@ export const getMissionDeck = (uniqueName: string): TMissionDeck | undefined =>
1857
1857
return ExportRewards[uniqueName];
1858
1858
};
1859
1859
1860
const u7WeaponCosts: Record<string, number> = {
1861
"/Lotus/Weapons/Tenno/Pistol/HeavyPistol": 35_000,
1862
"/Lotus/Weapons/Tenno/Akimbo/AkimboPistol": 12_000,
1863
"/Lotus/Weapons/Tenno/Pistol/AutoPistol": 15_000,
1864
"/Lotus/Weapons/Tenno/Pistol/HandShotGun": 35_000,
1865
"/Lotus/Weapons/Tenno/Pistol/Pistol": 4_000,
1866
"/Lotus/Weapons/Tenno/Pistol/BurstPistol": 12_000,
1867
"/Lotus/Weapons/Tenno/Rifle/BurstRifle": 12_000,
1868
"/Lotus/Weapons/Tenno/Rifle/StartingRifle": 8_000,
1869
"/Lotus/Weapons/Tenno/Rifle/HeavyRifle": 50_000,
1870
"/Lotus/Weapons/Tenno/Rifle/SemiAutoRifle": 50_000,
1871
"/Lotus/Weapons/Tenno/Shotgun/FullAutoShotgun": 50_000,
1872
"/Lotus/Weapons/Tenno/Rifle/SniperRifle": 50_000,
1873
"/Lotus/Weapons/Tenno/Rifle/Rifle": 10_000,
1874
"/Lotus/Weapons/Tenno/Shotgun/Shotgun": 17_500,
1875
"/Lotus/Weapons/Tenno/Melee/LongSword/LongSword": 15_000,
1876
"/Lotus/Weapons/Tenno/Melee/Fist/Fist": 30_000,
1877
"/Lotus/Weapons/Tenno/Melee/DualShortSword/DualShortSword": 45_000,
1878
"/Lotus/Weapons/Tenno/Melee/Staff/Staff": 15_000
1879
};
1880
1860
1881
export const getPrice = (
1861
1882
storeItemName: string,
1862
1883
quantity: number = 1,
@@ -1866,7 +1887,7 @@ export const getPrice = (
1866
1887
): number => {
1867
1888
const isBundle = storeItemName in ExportBundles;
1868
1889
const internalName = isBundle ? storeItemName : fromStoreItem(storeItemName);
1869
let price: number | undefined;
1890
1870
1891
{
1871
1892
const { FlashSales } = getWorldState(buildLabel);
1872
1893
const flashSale = FlashSales.find(s => s.TypeName == internalName);
@@ -1878,10 +1899,17 @@ export const getPrice = (
1878
1899
}
1879
1900
}
1880
1901
}
1881
const isBooster = storeItemName in ExportBoosters;
1882
if (isBooster) {
1883
price = 40 * (durability + 1);
1884
} else if (isBundle) {
1902
1903
if (storeItemName in ExportBoosters) {
1904
return 40 * (durability + 1);
1905
}
1906
1907
if (!usePremium && version_compare(buildLabel, gameToBuildVersion["8.0.0"]) < 0 && internalName in u7WeaponCosts) {
1908
return u7WeaponCosts[internalName];
1909
}
1910
1911
let price: number | undefined;
1912
if (isBundle) {
1885
1913
const bundle = getBundle(storeItemName, buildLabel)!;
1886
1914
if (usePremium && bundle.platinumCost) {
1887
1915
price = ExportBundles[storeItemName].platinumCost;
@@ -1901,56 +1929,54 @@ export const getPrice = (
1901
1929
const discount = typeof bundle.packageDiscount === "number" ? bundle.packageDiscount : 0.25;
1902
1930
price = Math.round(sum * (1 - discount));
1903
1931
}
1932
} else if (internalName in ExportBoosterPacks) {
1933
if (usePremium) price = ExportBoosterPacks[internalName].platinumCost;
1904
1934
} else {
1905
if (internalName in ExportBoosterPacks) {
1906
if (usePremium) price = ExportBoosterPacks[internalName].platinumCost;
1935
const categories = [
1936
ExportBundles,
1937
ExportCreditBundles,
1938
ExportCustoms,
1939
ExportFlavour,
1940
ExportGear,
1941
ExportRecipes,
1942
ExportResources,
1943
ExportSentinels,
1944
ExportWarframes,
1945
ExportWeapons
1946
];
1947
const category = categories.find(c => internalName in c);
1948
if (category) {
1949
const item = category[internalName];
1950
if (usePremium && "platinumCost" in item) {
1951
price = item.platinumCost;
1952
} else if (!usePremium && "creditsCost" in item) {
1953
price = item.creditsCost;
1954
}
1907
1955
} else {
1908
const categories = [
1909
ExportBundles,
1910
ExportCreditBundles,
1911
ExportCustoms,
1912
ExportFlavour,
1913
ExportGear,
1914
ExportRecipes,
1915
ExportResources,
1916
ExportSentinels,
1917
ExportWarframes,
1918
ExportWeapons
1919
];
1920
const category = categories.find(c => internalName in c);
1921
if (category) {
1922
const item = category[internalName];
1923
if (usePremium && "platinumCost" in item) {
1924
price = item.platinumCost;
1925
} else if (!usePremium && "creditsCost" in item) {
1926
price = item.creditsCost;
1927
}
1928
} else {
1929
const recipe = getRecipe(internalName);
1930
if (recipe) {
1931
if (usePremium && "platinumCost" in recipe) {
1932
price = recipe.platinumCost;
1933
} else if (!usePremium && "creditsCost" in recipe) {
1934
price = recipe.creditsCost;
1935
}
1956
const recipe = getRecipe(internalName);
1957
if (recipe) {
1958
if (usePremium && "platinumCost" in recipe) {
1959
price = recipe.platinumCost;
1960
} else if (!usePremium && "creditsCost" in recipe) {
1961
price = recipe.creditsCost;
1936
1962
}
1937
1963
}
1964
}
1938
1965
1939
if (usePremium) {
1940
if (version_compare(buildLabel, gameToBuildVersion["18.16.0"]) < 0) {
1941
if (internalName == "/Lotus/Powersuits/Mag/Mag") {
1942
price = ExportWarframes["/Lotus/Powersuits/Loki/Loki"].platinumCost;
1943
} else if (internalName == "/Lotus/Powersuits/Loki/Loki") {
1944
price = ExportWarframes["/Lotus/Powersuits/Mag/Mag"].platinumCost;
1945
}
1946
}
1947
if (version_compare(buildLabel, gameToBuildVersion["18.0.2"]) < 0) {
1948
if (internalName == "/Lotus/Upgrades/Skins/Dragon/DragonAltHelmet") price = 40;
1966
if (usePremium) {
1967
if (version_compare(buildLabel, gameToBuildVersion["18.16.0"]) < 0) {
1968
if (internalName == "/Lotus/Powersuits/Mag/Mag") {
1969
price = ExportWarframes["/Lotus/Powersuits/Loki/Loki"].platinumCost;
1970
} else if (internalName == "/Lotus/Powersuits/Loki/Loki") {
1971
price = ExportWarframes["/Lotus/Powersuits/Mag/Mag"].platinumCost;
1949
1972
}
1950
} else {
1951
// I'm not sure when they stopped selling it
1952
if (storeItemName == "/Lotus/StoreItems/Types/Restoratives/Cipher") price = 250;
1953
1973
}
1974
if (version_compare(buildLabel, gameToBuildVersion["18.0.2"]) < 0) {
1975
if (internalName == "/Lotus/Upgrades/Skins/Dragon/DragonAltHelmet") price = 40;
1976
}
1977
} else {
1978
// I'm not sure when they stopped selling it
1979
if (storeItemName == "/Lotus/StoreItems/Types/Restoratives/Cipher") price = 250;
1954
1980
}
1955
1981
}
1956
1982
@@ -218,7 +218,7 @@ export const handlePurchase = async (
218
218
switch (purchaseRequest.PurchaseParams.Source) {
219
219
case PurchaseSource.Market:
220
220
if (!purchaseRequest.PurchaseParams.ExpectedPrice) {
221
logger.debug(`client didn't provide ExpectedPrice, attempt to get it from PE+`);
221
logger.debug(`client didn't provide ExpectedPrice`);
222
222
purchaseRequest.PurchaseParams.ExpectedPrice = getPrice(
223
223
purchaseRequest.PurchaseParams.StoreItem,
224
224
purchaseRequest.PurchaseParams.Quantity,