三连胜提交

This commit is contained in:
COMPUTER\EDY
2026-10-16 16:24:28 +08:00
parent 400e0f81b9
commit aa1e079d22
108 changed files with 13748 additions and 1002 deletions
+32
View File
@@ -0,0 +1,32 @@
export type StartBoostProp = "hourglass" | "rocket";
export interface StartBoostLoadout {
streak: number;
hourglass: boolean;
rocket: boolean;
spentHourglass?: boolean;
spentRocket?: boolean;
}
export function startBoostRewards(streak: number): { hourglass: number; rocket: number } {
return { hourglass: streak >= 3 ? 3 : streak > 0 ? 2 : 0,
rocket: streak >= 3 ? 2 : streak >= 2 ? 1 : 0 };
}
export function infiniteStartBoost(info: any, prop: StartBoostProp): boolean {
return Number(info[prop === "hourglass" ? "infiniteHourglassTime" : "infiniteRocketTime"]) > Date.now() / 1000;
}
export function canCarryStartBoost(info: any, prop: StartBoostProp): boolean {
return infiniteStartBoost(info, prop) || info[prop + "Amount"] > 0;
}
/** 原配置只在未开始的重开中复用;已使用的自选道具不重复扣。 */
export function consumeCarriedStartBoost(loadout: StartBoostLoadout, prop: StartBoostProp, info: any): boolean {
const spent = prop === "hourglass" ? "spentHourglass" : "spentRocket";
if (!loadout[prop] || loadout[spent]) return false;
loadout[spent] = true;
if (infiniteStartBoost(info, prop)) return false;
info[prop + "Amount"] = Math.max(0, (Number(info[prop + "Amount"]) || 0) - 1);
return true;
}