Files
vrtue/src/town.rs
2016-03-10 13:11:18 -08:00

42 lines
907 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