updating buff and debuff icons. separated COA classes from WoW classes on the character creation screen
This commit is contained in:
1 parent
b5c9bce1aa
commit
c00f3211ea
39 files changed
+2037
-208
No files matched your search
@@ -19,10 +19,10 @@ import {
|
||||
clampAppearance,
|
||||
classById,
|
||||
classesForRace,
|
||||
contentCategoryForRace,
|
||||
createDefaultAppearance,
|
||||
normalizeCharacterName,
|
||||
randomAppearance,
|
||||
raceSupportsCategory,
|
||||
racesForCategory,
|
||||
supportedGenders,
|
||||
validateCharacterName,
|
||||
@@ -100,7 +100,7 @@ function defaultDraft(categoryId: ContentCategoryId = "wow"): CharacterDraft {
|
||||
name: "",
|
||||
categoryId,
|
||||
raceId,
|
||||
classId: categoryId === "rom" ? "rom-priest" : "priest",
|
||||
classId: categoryId === "rom" ? "rom-priest" : categoryId === "coa" ? "barbarian" : "priest",
|
||||
gender: "female",
|
||||
appearance: createDefaultAppearance(),
|
||||
rotation: -12,
|
||||
@@ -165,16 +165,16 @@ export const useShellStore = create<ShellState>((set, get) => ({
|
||||
? { ...defaultDraft(patch.categoryId), name: state.draft.name, rotation: state.draft.rotation }
|
||||
: { ...state.draft, ...patch };
|
||||
if (patch.name !== undefined) next.name = normalizeCharacterName(patch.name);
|
||||
if (contentCategoryForRace(next.raceId) !== next.categoryId) {
|
||||
if (!raceSupportsCategory(next.raceId, next.categoryId)) {
|
||||
const targetRace = racesForCategory(next.categoryId)[0];
|
||||
next.raceId = targetRace.id;
|
||||
next.classId = classesForRace(targetRace.id)[0].id;
|
||||
next.classId = classesForRace(targetRace.id, next.categoryId)[0].id;
|
||||
next.gender = supportedGenders(targetRace.id)[0] ?? "male";
|
||||
next.appearance = createDefaultAppearance();
|
||||
}
|
||||
const availableGenders = supportedGenders(next.raceId);
|
||||
if (!availableGenders.includes(next.gender)) next.gender = availableGenders[0] ?? "male";
|
||||
const availableClasses = classesForRace(next.raceId);
|
||||
const availableClasses = classesForRace(next.raceId, next.categoryId);
|
||||
if (!availableClasses.some((definition) => definition.id === next.classId)) {
|
||||
next.classId = availableClasses[0].id;
|
||||
}
|
||||
@@ -201,7 +201,7 @@ export const useShellStore = create<ShellState>((set, get) => ({
|
||||
set({ notice: nameError });
|
||||
return false;
|
||||
}
|
||||
if (!classesForRace(draft.raceId).some((definition) => definition.id === draft.classId)) {
|
||||
if (!classesForRace(draft.raceId, draft.categoryId).some((definition) => definition.id === draft.classId)) {
|
||||
set({ notice: "That class is not available to the selected race." });
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user