42 lines
915 B
Rust
42 lines
915 B
Rust
use world::Chunk;
|
|
use world::HasMap;
|
|
use world::Map;
|
|
use tile::Tile;
|
|
|
|
#[allow(dead_code)]
|
|
#[derive(Clone, Copy, Debug)]
|
|
enum Behavior {
|
|
Fixed = 0x00,
|
|
Wander = 0x01,
|
|
Follow = 0x80,
|
|
Attack = 0xFF,
|
|
}
|
|
|
|
#[derive(Clone, Copy)]
|
|
pub struct Town {
|
|
map: Chunk,
|
|
_npc_tile1: [Tile; 32],
|
|
_npc_x1: [u8; 32],
|
|
_npc_y1: [u8; 32],
|
|
_npc_tile2: [Tile; 32],
|
|
_npc_x2: [u8; 32],
|
|
_npc_y2: [u8; 32],
|
|
_npc_behavior: [Behavior; 32],
|
|
_npc_talk_idx: [u8; 32],
|
|
}
|
|
|
|
impl HasMap for Town {
|
|
fn map(&self) -> &Map {
|
|
&self.map
|
|
}
|
|
}
|
|
|
|
// 0x400 32 tile for NPCs 0-31
|
|
// 0x420 32 start_x for NPCs 0-31
|
|
// 0x440 32 start_y for NPCs 0-31
|
|
// 0x460 32 repitition of 0x400-0x41F
|
|
// 0x480 32 repitition of 0x420-0x43F
|
|
// 0x4A0 32 repitition of 0x440-0x45F
|
|
// 0x4C0 32 movement_behavior for NPCs 0-31 (0x0-fixed, 0x1-wander, 0x80-follow, 0xFF-attack)
|
|
// 0x4E0 32 conversion index (tlk file) for NPCs 0-31
|