changed all user face commands to translatable, return reasons etc

This commit is contained in:
MomokoKoigakubo
2026-09-24 11:51:41 -04:00
parent 8fbd3bd527
commit 1e17acc4cf
8 changed files with 67 additions and 28 deletions
+15 -6
View File
@@ -42,22 +42,31 @@ export function canUnlock(regionID) {
WE ARE KEYING FOR THE KEY VALUE'S ORDER PRIOR TO PASSED REGION{RegionID}
the prior value has to be true for the passed region to unlock
*/
let answer = null;
let priorRegion = null;
for (const id in REGIONS) {
// never pass lagoon otherwise all conditions fail
if (REGIONS[id].order === order - 1) {
answer = id;
/*
again tdlr we get the key prior to the past key
so for example command canUnlock("seaside");
we are retrieving farm land for comparison
it's sequential you can't unlock zones non
out of order
*/
priorRegion = id;
}
}
// if first region is auto unlocked we will never meet this condition
if (answer === null) {
if (priorRegion === null) {
return { ok: false, reason: "missing_prior_region", requires: null };
}
//the region before this one must be open first
if (gates[answer] !== true) {
return { ok: false, reason: "missing_prior_region", requires: answer };
/*
the prior region before this one must be open first
*/
if (gates[priorRegion] !== true) {
return { ok: false, reason: "missing_prior_region", requires: priorRegion };
}
//they have to be able to pay for it.