add getSaleInfos
This commit is contained in:
parent
6d12d90877
commit
675d445b93
@ -15,62 +15,65 @@ export const modularWeaponSaleController: RequestHandler = (_req, res) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const today: number = Math.trunc(Date.now() / 86400000);
|
|
||||||
const kitgunIsPrimary: boolean = (today & 1) != 0;
|
|
||||||
res.json({
|
res.json({
|
||||||
SaleInfos: [
|
SaleInfos: getSaleInfos(partTypeToParts, Math.trunc(Date.now() / 86400000))
|
||||||
getModularWeaponSale(
|
|
||||||
partTypeToParts,
|
|
||||||
today,
|
|
||||||
"Ostron",
|
|
||||||
["LWPT_HILT", "LWPT_BLADE", "LWPT_HILT_WEIGHT"],
|
|
||||||
() => "/Lotus/Weapons/Ostron/Melee/LotusModularWeapon"
|
|
||||||
),
|
|
||||||
getModularWeaponSale(
|
|
||||||
partTypeToParts,
|
|
||||||
today,
|
|
||||||
"SolarisUnitedHoverboard",
|
|
||||||
["LWPT_HB_DECK", "LWPT_HB_ENGINE", "LWPT_HB_FRONT", "LWPT_HB_JET"],
|
|
||||||
() => "/Lotus/Types/Vehicles/Hoverboard/HoverboardSuit"
|
|
||||||
),
|
|
||||||
getModularWeaponSale(
|
|
||||||
partTypeToParts,
|
|
||||||
today,
|
|
||||||
"SolarisUnitedMoaPet",
|
|
||||||
["LWPT_MOA_LEG", "LWPT_MOA_HEAD", "LWPT_MOA_ENGINE", "LWPT_MOA_PAYLOAD"],
|
|
||||||
() => "/Lotus/Types/Friendly/Pets/MoaPets/MoaPetPowerSuit"
|
|
||||||
),
|
|
||||||
getModularWeaponSale(
|
|
||||||
partTypeToParts,
|
|
||||||
today,
|
|
||||||
"SolarisUnitedKitGun",
|
|
||||||
[
|
|
||||||
kitgunIsPrimary ? "LWPT_GUN_PRIMARY_HANDLE" : "LWPT_GUN_SECONDARY_HANDLE",
|
|
||||||
"LWPT_GUN_BARREL",
|
|
||||||
"LWPT_GUN_CLIP"
|
|
||||||
],
|
|
||||||
(parts: string[]) => {
|
|
||||||
const barrel = parts[1];
|
|
||||||
const gunType = ExportWeapons[barrel].gunType!;
|
|
||||||
if (kitgunIsPrimary) {
|
|
||||||
return {
|
|
||||||
GT_RIFLE: "/Lotus/Weapons/SolarisUnited/Primary/LotusModularPrimary",
|
|
||||||
GT_SHOTGUN: "/Lotus/Weapons/SolarisUnited/Primary/LotusModularPrimaryShotgun",
|
|
||||||
GT_BEAM: "/Lotus/Weapons/SolarisUnited/Primary/LotusModularPrimaryBeam"
|
|
||||||
}[gunType];
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
GT_RIFLE: "/Lotus/Weapons/SolarisUnited/Secondary/LotusModularSecondary",
|
|
||||||
GT_SHOTGUN: "/Lotus/Weapons/SolarisUnited/Secondary/LotusModularSecondaryShotgun",
|
|
||||||
GT_BEAM: "/Lotus/Weapons/SolarisUnited/Secondary/LotusModularSecondaryBeam"
|
|
||||||
}[gunType];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getSaleInfos = (partTypeToParts: Record<string, string[]>, day: number): IModularWeaponSaleInfo[] => {
|
||||||
|
const kitgunIsPrimary: boolean = (day & 1) != 0;
|
||||||
|
return [
|
||||||
|
getModularWeaponSale(
|
||||||
|
partTypeToParts,
|
||||||
|
day,
|
||||||
|
"Ostron",
|
||||||
|
["LWPT_HILT", "LWPT_BLADE", "LWPT_HILT_WEIGHT"],
|
||||||
|
() => "/Lotus/Weapons/Ostron/Melee/LotusModularWeapon"
|
||||||
|
),
|
||||||
|
getModularWeaponSale(
|
||||||
|
partTypeToParts,
|
||||||
|
day,
|
||||||
|
"SolarisUnitedHoverboard",
|
||||||
|
["LWPT_HB_DECK", "LWPT_HB_ENGINE", "LWPT_HB_FRONT", "LWPT_HB_JET"],
|
||||||
|
() => "/Lotus/Types/Vehicles/Hoverboard/HoverboardSuit"
|
||||||
|
),
|
||||||
|
getModularWeaponSale(
|
||||||
|
partTypeToParts,
|
||||||
|
day,
|
||||||
|
"SolarisUnitedMoaPet",
|
||||||
|
["LWPT_MOA_LEG", "LWPT_MOA_HEAD", "LWPT_MOA_ENGINE", "LWPT_MOA_PAYLOAD"],
|
||||||
|
() => "/Lotus/Types/Friendly/Pets/MoaPets/MoaPetPowerSuit"
|
||||||
|
),
|
||||||
|
getModularWeaponSale(
|
||||||
|
partTypeToParts,
|
||||||
|
day,
|
||||||
|
"SolarisUnitedKitGun",
|
||||||
|
[
|
||||||
|
kitgunIsPrimary ? "LWPT_GUN_PRIMARY_HANDLE" : "LWPT_GUN_SECONDARY_HANDLE",
|
||||||
|
"LWPT_GUN_BARREL",
|
||||||
|
"LWPT_GUN_CLIP"
|
||||||
|
],
|
||||||
|
(parts: string[]) => {
|
||||||
|
const barrel = parts[1];
|
||||||
|
const gunType = ExportWeapons[barrel].gunType!;
|
||||||
|
if (kitgunIsPrimary) {
|
||||||
|
return {
|
||||||
|
GT_RIFLE: "/Lotus/Weapons/SolarisUnited/Primary/LotusModularPrimary",
|
||||||
|
GT_SHOTGUN: "/Lotus/Weapons/SolarisUnited/Primary/LotusModularPrimaryShotgun",
|
||||||
|
GT_BEAM: "/Lotus/Weapons/SolarisUnited/Primary/LotusModularPrimaryBeam"
|
||||||
|
}[gunType];
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
GT_RIFLE: "/Lotus/Weapons/SolarisUnited/Secondary/LotusModularSecondary",
|
||||||
|
GT_SHOTGUN: "/Lotus/Weapons/SolarisUnited/Secondary/LotusModularSecondaryShotgun",
|
||||||
|
GT_BEAM: "/Lotus/Weapons/SolarisUnited/Secondary/LotusModularSecondaryBeam"
|
||||||
|
}[gunType];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
const priceFactor: Record<string, number> = {
|
const priceFactor: Record<string, number> = {
|
||||||
Ostron: 0.9,
|
Ostron: 0.9,
|
||||||
SolarisUnitedHoverboard: 0.85,
|
SolarisUnitedHoverboard: 0.85,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user