import { AchievementType , AchievementRewardType , Achievement , Stat } from '../../../../shared/interfaces' ; import { Player } from '../../../../shared/models' ; export class Collector extends Achievement { static readonly base = 25 ; static readonly statWatches = [ 'Item/Collectible/Find' ] ; static readonly type = AchievementType . Explore ; static descriptionForTier ( tier ) { let baseStr = `Gain +${ tier }% to all primary stats for finding ${ ( tier * Collector . base ) . toLocaleString ( ) } collectibles.` ; if ( tier >= 5 ) { baseStr = `${ baseStr } Title: Collector of Collectibles.` ; } return baseStr ; } static calculateTier ( player ) { const steps = player . $collectibles . getFoundCollectibles ( ) ; return Math . floor ( steps / Collector . base ) ; } static rewardsForTier ( tier ) { const baseRewards = [ { type : AchievementRewardType . StatMultipliers , stats : { [ Stat . STR ] : 1 + ( tier * 0.01 ) , [ Stat . DEX ] : 1 + ( tier * 0.01 ) , [ Stat . CON ] : 1 + ( tier * 0.01 ) , [ Stat . INT ] : 1 + ( tier * 0.01 ) , [ Stat . AGI ] : 1 + ( tier * 0.01 ) , [ Stat . LUK ] : 1 + ( tier * 0.01 ) } } ] ; if ( tier >= 5 ) { baseRewards . push ( { type : AchievementRewardType . Title , title : 'Collector of Collectibles' } ) ; } return baseRewards ; } }