WantsToApproach, WantsToFlee (functionality NYI)

This commit is contained in:
Llywelwyn 2023-08-15 17:31:18 +01:00
parent 9a9876349b
commit bb8cf69b86
3 changed files with 16 additions and 0 deletions

View file

@ -373,6 +373,16 @@ pub struct WantsToUseItem {
pub target: Option<rltk::Point>,
}
#[derive(Component, Debug, Serialize, Deserialize, Clone)]
pub struct WantsToApproach {
pub idx: i32,
}
#[derive(Component, Debug, Serialize, Deserialize, Clone)]
pub struct WantsToFlee {
pub indices: Vec<usize>, // Dijkstra
}
#[derive(Component, Debug, Serialize, Deserialize, Clone)]
pub struct Consumable {}

View file

@ -560,6 +560,8 @@ fn main() -> rltk::BError {
gs.ecs.register::<Confusion>();
gs.ecs.register::<MagicMapper>();
gs.ecs.register::<InBackpack>();
gs.ecs.register::<WantsToApproach>();
gs.ecs.register::<WantsToFlee>();
gs.ecs.register::<WantsToPickupItem>();
gs.ecs.register::<WantsToDropItem>();
gs.ecs.register::<WantsToRemoveItem>();

View file

@ -106,7 +106,9 @@ pub fn save_game(ecs: &mut World) {
Telepath,
Viewshed,
Wand,
WantsToApproach,
WantsToDropItem,
WantsToFlee,
WantsToMelee,
WantsToPickupItem,
WantsToRemoveItem,
@ -222,7 +224,9 @@ pub fn load_game(ecs: &mut World) {
Telepath,
Viewshed,
Wand,
WantsToApproach,
WantsToDropItem,
WantsToFlee,
WantsToMelee,
WantsToPickupItem,
WantsToRemoveItem,