Add PV[name,value] ACS check

This commit is contained in:
Bryan Ashby 2020-06-15 19:28:32 -06:00
parent 9e9dc9af89
commit dd08cd68e7
No known key found for this signature in database
GPG key ID: B49EB437951D2542
4 changed files with 19 additions and 1 deletions

View file

@ -1055,6 +1055,14 @@ function peg$parse(input, options) {
}
const points = user.getPropertyAsNumber(UserProps.AchievementTotalPoints) || 0;
return !isNan(value) && points >= value;
},
PV : function userPropValue() {
if (!user || !Array.isArray(value) || value.length !== 2) {
return false;
}
const [propName, propValue] = value;
const actualPropValue = user.getProperty(propName);
return actualPropValue === propValue;
}
}[acsCode](value);
} catch (e) {