Update documentation for Sub-Task 3 completion
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 6m8s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 6m8s
- Marked Sub-Task 3 as completed in todo.md - Updated subtask_3_progress.md with completion status and notes
This commit is contained in:
+15
-4
@@ -46,7 +46,7 @@ import {
|
||||
type CraftingActions
|
||||
} from './crafting-slice';
|
||||
import { getActiveEquipmentSpells, type ActiveEquipmentSpell } from './utils/combat-utils';
|
||||
import { EQUIPMENT_TYPES } from './data/equipment';
|
||||
import { EQUIPMENT_TYPES, getValidSlotsForEquipmentType } from './data/equipment';
|
||||
import { ENCHANTMENT_EFFECTS, calculateEffectCapacityCost } from './data/enchantment-effects';
|
||||
import { ATTUNEMENTS_DEF, getTotalAttunementRegen, getAttunementConversionRate, getAttunementXPForLevel, MAX_ATTUNEMENT_LEVEL } from './data/attunements';
|
||||
import { GOLEMS_DEF, getGolemSlots, isGolemUnlocked, getGolemDamage, getGolemAttackSpeed, getGolemFloorDuration, canAffordGolemSummon, deductGolemSummonCost, canAffordGolemMaintenance, deductGolemMaintenance } from './data/golems';
|
||||
@@ -2212,12 +2212,18 @@ export const useGameStore = create<GameStore>()(
|
||||
if (!type) return false;
|
||||
|
||||
// Check if equipment can go in this slot
|
||||
const validSlots = type.category === 'accessory'
|
||||
? ['accessory1', 'accessory2']
|
||||
: [type.slot];
|
||||
const validSlots = getValidSlotsForEquipmentType(type);
|
||||
|
||||
if (!validSlots.includes(slot)) return false;
|
||||
|
||||
// BLOCK: Prevent equipping anything in offhand if a 2-handed weapon is in mainHand
|
||||
if (slot === 'offHand' && state.equippedInstances.mainHand) {
|
||||
const mainHandType = EQUIPMENT_TYPES[state.equippedInstances.mainHand];
|
||||
if (mainHandType?.twoHanded) {
|
||||
return false; // Cannot equip to offhand while 2H weapon is equipped
|
||||
}
|
||||
}
|
||||
|
||||
// Check if slot is occupied
|
||||
const currentEquipped = state.equippedInstances[slot];
|
||||
if (currentEquipped === instanceId) return true; // Already equipped here
|
||||
@@ -2233,6 +2239,11 @@ export const useGameStore = create<GameStore>()(
|
||||
// Equip to new slot
|
||||
newEquipped[slot] = instanceId;
|
||||
|
||||
// If equipping a 2-handed weapon to mainHand, clear offHand
|
||||
if (slot === 'mainHand' && type.twoHanded && newEquipped.offHand) {
|
||||
newEquipped.offHand = null;
|
||||
}
|
||||
|
||||
set(() => ({ equippedInstances: newEquipped }));
|
||||
return true;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user