+ ACS: AC for achievement count check

+ ACS: AP for achievement point check
+ User minutes used on the system are now tracked
+ MCI: TO for total time spent online system (friendly format)
* Fix up a couple ACS bugs with |value|
* Fix formatting of achievement text
+ Add more achievements
* Fix achievement duration formatting
This commit is contained in:
Bryan Ashby 2019-01-10 20:34:52 -07:00
parent 091a9ae2c7
commit 2788c37492
12 changed files with 149 additions and 27 deletions

View file

@ -1004,7 +1004,7 @@ function peg$parse(input, options) {
TW : function termWidth() {
return !isNaN(value) && _.get(client, 'term.termWidth', 0) >= value;
},
ID : function isUserId(value) {
ID : function isUserId() {
if(!user) {
return false;
}
@ -1024,6 +1024,20 @@ function peg$parse(input, options) {
const midnight = now.clone().startOf('day')
const minutesPastMidnight = now.diff(midnight, 'minutes');
return !isNaN(value) && minutesPastMidnight >= value;
},
AC : function achievementCount() {
if(!user) {
return false;
}
const count = user.getPropertyAsNumber(UserProps.AchievementTotalCount) || 0;
return !isNan(value) && points >= value;
},
AP : function achievementPoints() {
if(!user) {
return false;
}
const points = user.getPropertyAsNumber(UserProps.AchievementTotalPoints) || 0;
return !isNan(value) && points >= value;
}
}[acsCode](value);
} catch (e) {