feat(golemancy): Phase 1 - Component-based construction system data definitions
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m18s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m18s
- Add new golem component types (Core, Frame, MindCircuit, Enchantment) - Create 4 Core tiers, 7 Frames, 4 Mind Circuits, 8 Enchantments - Rewrite golem utils for component-based stat computation - Update GolemancyState with new fields (golemDesigns, golemLoadout, activeGolems) - Update combat store, actions, and pipelines for new golem system - Rewrite GolemancyTab with component selection UI - Update fabricator discipline perks for new system - Add comprehensive tests for component registries and utilities - All files under 400 lines, all 743 tests passing
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import type { SerializedGolemDesign } from '../types/game';
|
||||
|
||||
export function addGolemDesign(set: (fn: (s: any) => any) => void, design: SerializedGolemDesign) {
|
||||
set((s: any) => {
|
||||
const golemDesigns = { ...s.golemancy.golemDesigns, [design.id]: design };
|
||||
const entry = { designId: design.id, design, enabled: true };
|
||||
const golemLoadout = [...s.golemancy.golemLoadout, entry];
|
||||
return { golemancy: { ...s.golemancy, golemDesigns, golemLoadout } };
|
||||
});
|
||||
}
|
||||
|
||||
export function removeGolemDesign(set: (fn: (s: any) => any) => void, designId: string) {
|
||||
set((s: any) => {
|
||||
const golemDesigns = { ...s.golemancy.golemDesigns };
|
||||
delete golemDesigns[designId];
|
||||
const golemLoadout = s.golemancy.golemLoadout.filter((e: any) => e.designId !== designId);
|
||||
return { golemancy: { ...s.golemancy, golemDesigns, golemLoadout } };
|
||||
});
|
||||
}
|
||||
|
||||
export function toggleGolemLoadoutEntry(set: (fn: (s: any) => any) => void, designId: string) {
|
||||
set((s: any) => {
|
||||
const golemLoadout = s.golemancy.golemLoadout.map((e: any) =>
|
||||
e.designId === designId ? { ...e, enabled: !e.enabled } : e,
|
||||
);
|
||||
return { golemancy: { ...s.golemancy, golemLoadout } };
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user