Honor RoM off-hand and ranged equipment slots
This commit is contained in:
1 parent
0206fda9e2
commit
7449abdad2
15 files changed
+150
-29
No files matched your search
+15
-2
@@ -4045,6 +4045,7 @@ export const useCombatStore = create<CombatState>((set, get) => ({
|
||||
ownerId: PLAYER_EQUIPMENT_OWNER_ID,
|
||||
ownerKind: "player",
|
||||
classId,
|
||||
secondaryClassId,
|
||||
specializationId,
|
||||
role: gearRole,
|
||||
level: progression.level,
|
||||
@@ -4110,6 +4111,7 @@ export const useCombatStore = create<CombatState>((set, get) => ({
|
||||
ownerId: PLAYER_EQUIPMENT_OWNER_ID,
|
||||
ownerKind: "player",
|
||||
classId: state.classId,
|
||||
secondaryClassId: state.secondaryClassId,
|
||||
specializationId: state.specializationId,
|
||||
role: state.gearRole,
|
||||
level: state.level,
|
||||
@@ -4382,9 +4384,12 @@ export const useCombatStore = create<CombatState>((set, get) => ({
|
||||
|
||||
equipItem: (instanceId, ownerId = PLAYER_EQUIPMENT_OWNER_ID) => {
|
||||
const state = get();
|
||||
const ownerMember = ownerId === PLAYER_EQUIPMENT_OWNER_ID
|
||||
? null
|
||||
: usePartyStore.getState().members.find((member) => member.id === ownerId);
|
||||
const ownerClassId = ownerId === PLAYER_EQUIPMENT_OWNER_ID
|
||||
? state.classId
|
||||
: usePartyStore.getState().members.find((member) => member.id === ownerId)?.classId;
|
||||
: ownerMember?.classId;
|
||||
if (!ownerClassId) {
|
||||
set({ feedback: nextFeedback("error", "That party member is not available.") });
|
||||
return false;
|
||||
@@ -4395,6 +4400,10 @@ export const useCombatStore = create<CombatState>((set, get) => ({
|
||||
ownerId,
|
||||
ownerClassId,
|
||||
instanceId,
|
||||
{
|
||||
secondaryClassId: ownerId === PLAYER_EQUIPMENT_OWNER_ID ? state.secondaryClassId : ownerMember?.secondaryClassId,
|
||||
level: ownerId === PLAYER_EQUIPMENT_OWNER_ID ? state.level : ownerMember?.level,
|
||||
},
|
||||
);
|
||||
if (!change.ok) {
|
||||
set({ feedback: nextFeedback("error", change.reason ?? "That item cannot be equipped.") });
|
||||
@@ -4403,11 +4412,12 @@ export const useCombatStore = create<CombatState>((set, get) => ({
|
||||
const item = state.inventory.find((candidate) => candidate.instanceId === instanceId);
|
||||
const ownerName = ownerId === PLAYER_EQUIPMENT_OWNER_ID
|
||||
? "You"
|
||||
: usePartyStore.getState().members.find((member) => member.id === ownerId)?.name ?? "Companion";
|
||||
: ownerMember?.name ?? "Companion";
|
||||
const gearStats = state.specializationId !== null || state.classId.startsWith("rom-") ? resolvedEquipmentStats(change.assignments, state.inventory, {
|
||||
ownerId: PLAYER_EQUIPMENT_OWNER_ID,
|
||||
ownerKind: "player",
|
||||
classId: state.classId,
|
||||
secondaryClassId: state.secondaryClassId,
|
||||
specializationId: state.specializationId,
|
||||
role: state.gearRole,
|
||||
level: state.level,
|
||||
@@ -4458,6 +4468,7 @@ export const useCombatStore = create<CombatState>((set, get) => ({
|
||||
ownerId: PLAYER_EQUIPMENT_OWNER_ID,
|
||||
ownerKind: "player",
|
||||
classId: state.classId,
|
||||
secondaryClassId: state.secondaryClassId,
|
||||
specializationId: state.specializationId,
|
||||
role: state.gearRole,
|
||||
level: state.level,
|
||||
@@ -5040,6 +5051,7 @@ export const useCombatStore = create<CombatState>((set, get) => ({
|
||||
ownerId: PLAYER_EQUIPMENT_OWNER_ID,
|
||||
ownerKind: "player",
|
||||
classId: state.classId,
|
||||
secondaryClassId: state.secondaryClassId,
|
||||
specializationId: state.specializationId,
|
||||
role: state.gearRole,
|
||||
level: state.level,
|
||||
@@ -5356,6 +5368,7 @@ export const useCombatStore = create<CombatState>((set, get) => ({
|
||||
ownerId: PLAYER_EQUIPMENT_OWNER_ID,
|
||||
ownerKind: "player",
|
||||
classId: state.classId,
|
||||
secondaryClassId: state.secondaryClassId,
|
||||
specializationId: state.specializationId,
|
||||
role: state.gearRole,
|
||||
level: state.level,
|
||||
|
||||
Reference in new issue
Block a user