mirror of
https://github.com/VickScarlet/lifeRestart.git
synced 2026-04-06 04:58:18 +08:00
change triggered talents to a map + make age related talents multi-triggerable
This commit is contained in:
@@ -113,4 +113,17 @@ function checkProp(property, condition) {
|
||||
}
|
||||
}
|
||||
|
||||
export { checkCondition };
|
||||
function extractMaxTriggers(condition) {
|
||||
// Assuming only age related talents can be triggered multiple times.
|
||||
const RE_AGE_CONDITION = /AGE\?\[([0-9\,]+)\]/;
|
||||
const match_object = RE_AGE_CONDITION.exec(condition);
|
||||
if (match_object == null) {
|
||||
// Not age related, single trigger.
|
||||
return 1;
|
||||
}
|
||||
|
||||
const age_list = match_object[1].split(",");
|
||||
return age_list.length;
|
||||
}
|
||||
|
||||
export { checkCondition, extractMaxTriggers };
|
||||
Reference in New Issue
Block a user