You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
786 B
23 lines
786 B
|
3 weeks ago
|
import { StatisticsType } from '../game/GameDataEnums';
|
||
|
|
|
||
|
|
/** 看视频解锁 2 倍速所需累计次数 */
|
||
|
|
export const BATTLE_SPEED_UNLOCK_VIDEO_COUNT = 10;
|
||
|
|
|
||
|
|
export const BATTLE_SPEED_NORMAL = 1;
|
||
|
|
export const BATTLE_SPEED_FAST = 2;
|
||
|
|
|
||
|
|
export function getBattleSpeedVideoUnlockCount(): number {
|
||
|
|
return gg.data.getStatistics(StatisticsType.BattleSpeedVideoUnlockCount);
|
||
|
|
}
|
||
|
|
|
||
|
|
export function isBattleSpeedPermanentlyUnlocked(): boolean {
|
||
|
|
return getBattleSpeedVideoUnlockCount() >= BATTLE_SPEED_UNLOCK_VIDEO_COUNT;
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 累计看视频解锁次数 +1,返回最新次数 */
|
||
|
|
export function recordBattleSpeedVideoUnlock(): number {
|
||
|
|
const next = getBattleSpeedVideoUnlockCount() + 1;
|
||
|
|
gg.data.setStatistics(StatisticsType.BattleSpeedVideoUnlockCount, next);
|
||
|
|
return next;
|
||
|
|
}
|