faction table, applying factions to mobs, and querying reactions

This commit is contained in:
Llywelwyn 2023-08-15 15:56:00 +01:00
parent 0375c31acf
commit 76d835021b
11 changed files with 108 additions and 13 deletions

View file

@ -1,6 +1,6 @@
use super::{
ai::NORMAL_SPEED, gamesystem, gamesystem::attr_bonus, random_table::RandomTable, raws, Attribute, Attributes,
Clock, Energy, EquipmentChanged, HungerClock, HungerState, Map, Name, Player, Pool, Pools, Position, Rect,
Clock, Energy, EquipmentChanged, Faction, HungerClock, HungerState, Map, Name, Player, Pool, Pools, Position, Rect,
Renderable, SerializeMe, Skill, Skills, TileType, Viewshed,
};
use rltk::{RandomNumberGenerator, RGB};
@ -36,6 +36,7 @@ pub fn player(ecs: &mut World, player_x: i32, player_y: i32) -> Entity {
render_order: 0,
})
.with(Player {})
.with(Faction { name: "player".to_string() })
.with(Viewshed { visible_tiles: Vec::new(), range: 12, dirty: true })
.with(Name { name: "you".to_string(), plural: "you".to_string() })
.with(HungerClock { state: HungerState::Satiated, duration: 200 })