From 3d07f763d1861c0821042c60ebe607c75ab6d95d Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Sat, 5 Jan 2019 19:04:19 -0700 Subject: [PATCH] Achievement improvement & more achievements --- art/themes/luciano_blocktronics/STATUS.ANS | Bin 4517 -> 4686 bytes config/achievements.hjson | 203 ++++++++++++++++----- core/achievement.js | 7 +- 3 files changed, 159 insertions(+), 51 deletions(-) diff --git a/art/themes/luciano_blocktronics/STATUS.ANS b/art/themes/luciano_blocktronics/STATUS.ANS index b90ed2d9ffede5f3db62c67ff44131899d870bca..679e21d691e6973dfd63e41c32257b29735eff56 100644 GIT binary patch delta 526 zcmZ3gd`@M;5lIEdU)z8IDI@%ytI(p)9Ep=lD; zzzQf1RsnW}XMiEp8HNUv7x0Tr_GNA20b2|-1Eg~DBsQDLd~A&zK<68QgeF(8YfL`C zwwWDj{$yJYeMZB{3)$ySHsn;8oXT;O4{8@!InabRoLZA3IH$9g>gNFOd2V8IMrLYRYHn&?2}IlETfEOyK#m7m zo19;oR|0d16~rm3j^Ky@8h@DYrZz+j6y^mb#c-8ClMtcn7yvPN^Fsc6jEqkwHwdZ% E0Ky)RGynhq delta 335 zcmX@7vQ&A(5oYOV!-;pbj0{bkfh=odvs?w~Xaj3wBM@zDo(mK-fyfx--oDMHaQik; z8YF7ES&uQ9nFYu)oV=8!RZBYB0;mqCKQBKeRY3u$8)%wAt`*1_vs_g_7c;0v!^xSf z(*z;HnFUZwOr0kmWEW-e3@|jCypTg=vKw0yGf>H7ZZ@0AZ0t)}fouco$rso(7>y=B zVxK>GE4$9*6&(9m%z$=IuH#UiJe_kMW6I>eT+%Eq-iAh#L%Ak0OGlec*5^{=fZJ=y zy=d}3E+tlwo1G^s^Hehf-8uORx8CHX9Q>2l@=Or{83zso>1a@RfIMnB*_rnSNQ=4i gWE;L`%!U@ulim1lf<(-mH+u=(V`Q|MtSO`l0RH`7od5s; diff --git a/config/achievements.hjson b/config/achievements.hjson index 4100d2dd..8f1babfe 100644 --- a/config/achievements.hjson +++ b/config/achievements.hjson @@ -1,5 +1,5 @@ /* - ./\/\.' ENiGMA½ Achievement Configuration -/--/-------- - -- - + ./\/\." ENiGMA½ Achievement Configuration -/--/-------- - -- - _____________________ _____ ____________________ __________\_ / \__ ____/\_ ____ \ /____/ / _____ __ \ / ______/ // /___jp! @@ -14,11 +14,11 @@ General Information ------------------------------- - - This configuration is in HJSON (http://hjson.org/) format. Strict to-spec - JSON is also perfectly valid. Use 'hjson' from npm to convert to/from JSON. + JSON is also perfectly valid. Use "hjson" from npm to convert to/from JSON. See http://hjson.org/ for more information and syntax. - Various editors and IDEs such as Sublime Text 3, Visual Studio Code, and so + Various editors and IDEs such as Sublime Text 3 Visual Studio Code and so on have syntax highlighting for the HJSON format which are highly recommended. ------------------------------- -- - - @@ -30,8 +30,11 @@ - Perhaps adding additional *levels* of triggers & points - Applying customizations via the achievements section in theme.hjson - Don't forget to RTFM ...er, uh... see the documentation for more information, and - don't be shy to ask for help: + Some tips: + - For 'userStat' types, see user_property.js + + Don"t forget to RTFM ...er uh... see the documentation for more information and + don"t be shy to ask for help: BBS : Xibalba @ xibalba.l33t.codes FTN : BBS Discussion on fsxNet or ArakNet @@ -39,51 +42,159 @@ Email : bryan@l33t.codes */ { - enabled : true, + enabled : true art : { - localHeader : 'achievement_local_header', - localFooter : 'achievement_local_footer', - globalHeader : 'achievement_global_header', - globalFooter : 'achievement_global_footer', - }, + localHeader: achievement_local_header + localFooter: achievement_local_footer + globalHeader: achievement_global_header + globalFooter: achievement_global_footer + } - achievements : { - user_login_count : { - type : 'userStat', - statName : 'login_count', - retroactive : true, + achievements: { + user_login_count: { + type: userStat + statName: login_count + retroactive: true + match: { + 2: { + title: "Return Caller" + globalText: "{userName} has returned to {boardName}!" + text: "You\"ve returned to {boardName}!" + points: 5 + } + 10: { + title: "{boardName} Curious" + globalText: "{userName} has logged into {boardName} {achievedValue} times!" + text: "You've logged into {boardName} {achievedValue} times!" + points: 5 + } + 25: { + title: "{boardName} Inquisitive" + globalText: "{userName} has logged into {boardName} {achievedValue} times!" + text: "You've logged into {boardName} {achievedValue} times!" + points: 10 + } + 100: { + title: "{boardName} Regular" + globalText: "{userName} has logged into {boardName} {achievedValue} times!" + text: "You've logged into {boardName} {achievedValue} times!" + points: 10 + } + 500: { + title: "{boardName} Addict" + globalText: "{userName} the BBS {boardName} addict has logged in {achievedValue} times!" + text: "You're a {boardName} addict! You've logged in {achievedValue} times!" + points: 25 + } + } + } - match : { - 2 : { - title : 'Return Caller', - globalText : '{userName} has returned to {boardName}!', - text : 'You\'ve returned to {boardName}!', - points : 5, - }, - 10 : { - title : '{achievedValue} Logins', - globalText : '{userName} has logged into {boardName} {achievedValue} times!', - text : 'You\'ve logged into {boardName} {achievedValue} times!', - points : 5, - }, - 25 : { - title : '{achievedValue} Logins', - globalText : '{userName} has logged into {boardName} {achievedValue} times!', - text : 'You\'ve logged into {boardName} {achievedValue} times!', - points : 10, - }, - 100 : { - title : '{boardName} Regular', - globalText : '{userName} has logged into {boardName} {achievedValue} times!', - text : 'You\'ve logged into {boardName} {achievedValue} times!', - points : 10, - }, - 500 : { - title : '{boardName} Addict', - globalText : '{userName} the BBS {boardName} addict has logged in {achievedValue} times!', - text : 'You\'re a {boardName} addict! You\'ve logged in {achievedValue} times!', - points : 25, + user_post_count: { + type: userStat + statName: post_count + retroactive: true + match: { + 5: { + title: "Poster" + globalText: "{userName} has posted {achievedValue} messages!" + text: "You've posted {achievedValue} messages!" + points: 5 + } + 20: { + title: "Poster... again!", + globalText: "{userName} has posted {achievedValue} messages!" + text: "You've posted {achievedValue} messages!" + points: 10 + } + 100: { + title: "Frequent Poster", + globalText: "{userName} has posted {achievedValue} messages!" + text: "You've posted {achievedValue} messages!" + points: 15 + } + 500: { + title: "Scribe" + globalText: "{userName} the scribe has posted {achievedValue} messages!" + text: "Such a scribe! You've posted {achievedValue} messages!" + points: 25 + } + } + } + + user_upload_count: { + type: userStat + statName: ul_total_count + retroactive: true + match: { + 1: { + title: "Uploader" + globalText: "{userName} has uploaded a file!" + text: "You've uploaded somthing!" + points: 5 + } + 10: { + title: "Moar Uploads!" + globalText: "{userName} has uploaded {achievedValue} files!" + text: "You've uploaded {achievedValue} files!" + points: 10 + } + 50: { + title: "Contributor" + globalText: "{userName} has uploaded {achievedValue} files!" + text: "You've uploaded {achievedValue} files!" + points: 20 + + } + 100: { + title: "Courier" + globalText: "Courier {userName} has uploaded {achievedValue} files!" + text: "You've uploaded {achievedValue} files!" + points: 25 + } + 200: { + title: "Must Be a Drop Site" + globalText: "{userName} has uploaded a whomping {achievedValue} files!" + text: "You've uploaded a whomping {achievedValue} files!" + points: 50 + } + } + } + + user_download_count: { + type: userStat + statName: dl_total_count + retroactive: true + match: { + 1: { + title: "Downloader" + globalText: "{userName} has downloaded a file!" + text: "You've downloaded somthing!" + points: 5 + } + 10: { + title: "Moar Downloads!" + globalText: "{userName} has downloaded {achievedValue} files!" + text: "You've downloaded {achievedValue} files!" + points: 10 + } + 50: { + title: "Leecher" + globalText: "{userName} has leeched {achievedValue} files!" + text: "You've leeched... er... downloaded {achievedValue} files!" + points: 15 + } + 100: { + title: "Hoarder" + globalText: "{userName} has downloaded {achievedValue} files!" + text: "Hoarding files? You've downloaded {achievedValue} files!" + points: 20 + } + 200: { + title: "Digital Archivist" + globalText: "{userName} the digital archivist has {achievedValue} files!" + text: "Building an archive? You've downloaded {achievedValue} files!" + points: 25 } } } diff --git a/core/achievement.js b/core/achievement.js index cc64779c..e5eecd87 100644 --- a/core/achievement.js +++ b/core/achievement.js @@ -159,10 +159,6 @@ class Achievements { return cb(null); } ); - - // :TODO: if enabled/etc., load achievements.hjson -> if theme achievements.hjson{}, merge @ display time? - // merge for local vs global (per theme) clients - // ...only merge/override text } loadAchievementHitCount(user, achievementTag, field, cb) { @@ -404,7 +400,8 @@ class Achievements { pause : true, }; if(headerArt || footerArt) { - interruptItems[itemType].contents = `${headerArt || ''}\r\n${pipeToAnsi(title)}\r\n${pipeToAnsi(itemText)}\r\n${footerArt || ''}`; + interruptItems[itemType].contents = + `${headerArt || ''}\r\n${pipeToAnsi(title)}\r\n${pipeToAnsi(itemText)}\r\n${footerArt || ''}`; } return callback(null); }