UI: Show hints of Gang mechanic in pre-endgame (#2723)

This commit is contained in:
catloversg
2026-05-07 05:22:43 +07:00
committed by GitHub
parent 2ab144cff2
commit eb431145ee
9 changed files with 216 additions and 106 deletions
+26
View File
@@ -0,0 +1,26 @@
import { Result } from "@nsdefs";
import { Player } from "@player";
import { FactionName } from "../Enums";
import { GangConstants } from "./data/Constants";
export function canCreateGang(faction: FactionName): Result {
if (Player.gang) {
return { success: false, message: "You already have a gang." };
}
const checkResult = Player.canAccessGang();
if (!checkResult.success) {
return { success: false, message: checkResult.message };
}
if (!GangConstants.Names.includes(faction)) {
return {
success: false,
message: `${faction} does not allow creating a gang. You can only do that with ${GangConstants.Names.join(
", ",
)}.`,
};
}
if (!Player.factions.includes(faction)) {
return { success: false, message: `You are not a member of ${faction}.` };
}
return { success: true };
}