feat: add social interaction guards to brain and movement systems
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import {
|
||||
HUNGER_THRESHOLD, ENERGY_THRESHOLD, Direction,
|
||||
type Needs, type Movement, type NPCBrain, type Position,
|
||||
type Needs, type Movement, type NPCBrain, type Position, type SocialState,
|
||||
} from '@dflike/shared';
|
||||
import type { World } from '../ecs/World.js';
|
||||
import type { GameMap } from '../map/GameMap.js';
|
||||
@@ -32,6 +32,9 @@ export function npcBrainSystem(world: World, map: GameMap): void {
|
||||
const movement = world.getComponent<Movement>(entity, 'movement')!;
|
||||
const pos = world.getComponent<Position>(entity, 'position')!;
|
||||
|
||||
const socialState = world.getComponent<SocialState>(entity, 'socialState');
|
||||
if (socialState && socialState.phase !== 'none') continue;
|
||||
|
||||
// Skip if currently walking toward a goal
|
||||
if (movement.state === 'walking' && movement.path.length > 0) continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user