#491: PlayerAction::TeleportToHub — moves player to hub spawn, clears dialogue/monologue/interaction buffer, Gauntlet-only with log warning. #520: ConfrontationDelivered event — Tier 2 animation shift, relationship state decrement (D-033), monologue spike emission. #519: Walk-away Phase 2 — NPC animation shift + routine deviation on dialogue exit (D-064). #498: Four new Gauntlet rooms — Interaction Gallery, Fog Theater, Crowd Plaza, Dialogue Room with constants and wiring. #514: blocked_entities Vec<u64> on ObserverSnapshot, protocol v9. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
52 lines
1.9 KiB
Rust
52 lines
1.9 KiB
Rust
//! Interaction Gallery — Room 4 (24x20)
|
|
//!
|
|
//! Tests D-057 (entity interaction vertical list, verb generation per type).
|
|
//!
|
|
//! Layout: One entity of each ObjectType to test that each type generates
|
|
//! the correct interaction verb(s). Container is already tested in
|
|
//! Inventory Warehouse, so this room covers the remaining 5 types.
|
|
//!
|
|
//! Observer position: (12, 10) relative = (14, 92) absolute, facing East.
|
|
//!
|
|
//! Entities (StableId 24-28):
|
|
//! obj_notice (8, 88) — Readable (Read verb)
|
|
//! obj_terminal (8, 94) — Terminal (Use verb)
|
|
//! obj_hatch (20, 88) — Door (Open/Close verb)
|
|
//! obj_pickup (20, 94) — Pickup (Pick up verb)
|
|
//! obj_bench (14, 96) — Furniture (Sit verb)
|
|
|
|
use bevy_app::prelude::*;
|
|
|
|
use crate::bridge::types::ObjectType;
|
|
use crate::knowledge::registry::{EntityRegistry, StableEntityId};
|
|
use crate::simulation::interaction::Interactable;
|
|
use crate::simulation::movement::TilePosition;
|
|
|
|
/// Room origin (top-left corner including walls).
|
|
const ORIGIN_X: i32 = 2;
|
|
const ORIGIN_Y: i32 = 82;
|
|
|
|
/// Object definitions: (name, relative_x, relative_y, object_type).
|
|
const OBJECTS: &[(&str, i32, i32, ObjectType)] = &[
|
|
("obj_notice", 6, 6, ObjectType::Readable),
|
|
("obj_terminal", 6, 12, ObjectType::Terminal),
|
|
("obj_hatch", 18, 6, ObjectType::Door),
|
|
("obj_pickup", 18, 12, ObjectType::Pickup),
|
|
("obj_bench", 12, 14, ObjectType::Furniture),
|
|
];
|
|
|
|
/// Spawn Interaction Gallery entities in canonical order (StableId 24-28).
|
|
pub fn spawn_entities(app: &mut App, registry: &mut EntityRegistry) {
|
|
for &(_name, rx, ry, obj_type) in OBJECTS {
|
|
let pos = TilePosition::new(ORIGIN_X + rx, ORIGIN_Y + ry, 0);
|
|
let entity = app
|
|
.world_mut()
|
|
.spawn((Interactable, obj_type, pos))
|
|
.id();
|
|
let sid = registry.register(entity);
|
|
app.world_mut()
|
|
.entity_mut(entity)
|
|
.insert(StableEntityId(sid));
|
|
}
|
|
}
|