import { AchievementType , AchievementRewardType , Achievement , PermanentUpgrade } from '../../../../shared/interfaces' ; import { Player } from '../../../../shared/models' ; export class Tired extends Achievement { static readonly base = 10 ; static readonly statWatches = [ 'Character/Stamina/Spend' ] ; static readonly type = AchievementType . Special ; static descriptionForTier ( tier ) { let baseStr = `Gain +${ tier } Adventure Log Capacity
                   and +${ tier * 2 } Max Stamina for using ${ Math . pow ( Tired . base , tier ) . toLocaleString ( ) } stamina.` ; if ( tier >= 3 ) { baseStr = `${ baseStr } Personality: Restless.` ; } if ( tier >= 5 ) { baseStr = `${ baseStr } Title: Exhausted.` ; } return baseStr ; } static calculateTier ( player ) { const steps = player . $statistics . get ( 'Character/Stamina/Spend' ) ; return Math . floor ( Achievement . log ( steps , Tired . base ) ) ; } static rewardsForTier ( tier ) { const baseRewards = [ { type : AchievementRewardType . PermanentUpgrade , upgrades : { [ PermanentUpgrade . AdventureLogSizeBoost ] : tier } } , { type : AchievementRewardType . PermanentUpgrade , upgrades : { [ PermanentUpgrade . MaxStaminaBoost ] : tier * 2 } } ] ; if ( tier >= 3 ) { baseRewards . push ( { type : AchievementRewardType . Personality , personality : 'Restless' } ) ; } if ( tier >= 5 ) { baseRewards . push ( { type : AchievementRewardType . Title , title : 'Exhausted' } ) ; } return baseRewards ; } }