Add hunger: Reformat
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
use rltk::Point;
|
||||
use specs::prelude::*;
|
||||
|
||||
use crate::particle_system::ParticleBuilder;
|
||||
use crate::{
|
||||
components::{Monster, Position, Viewshed, WantsToMelee},
|
||||
Confusion,
|
||||
map::Map, RunState,
|
||||
map::Map,
|
||||
Confusion, RunState,
|
||||
};
|
||||
use crate::particle_system::ParticleBuilder;
|
||||
|
||||
pub struct MonsterAI {}
|
||||
|
||||
@@ -23,7 +23,7 @@ impl<'a> System<'a> for MonsterAI {
|
||||
WriteStorage<'a, Position>,
|
||||
WriteStorage<'a, WantsToMelee>,
|
||||
WriteStorage<'a, Confusion>,
|
||||
WriteExpect<'a, ParticleBuilder>
|
||||
WriteExpect<'a, ParticleBuilder>,
|
||||
);
|
||||
|
||||
fn run(&mut self, data: Self::SystemData) {
|
||||
@@ -38,7 +38,7 @@ impl<'a> System<'a> for MonsterAI {
|
||||
mut position,
|
||||
mut wants_to_melee,
|
||||
mut confused,
|
||||
mut particle_builder
|
||||
mut particle_builder,
|
||||
) = data;
|
||||
|
||||
if *runstate != RunState::MonsterTurn {
|
||||
@@ -46,7 +46,7 @@ impl<'a> System<'a> for MonsterAI {
|
||||
}
|
||||
|
||||
for (entity, mut viewshed, _monster, mut pos) in
|
||||
(&entities, &mut viewshed, &monster, &mut position).join()
|
||||
(&entities, &mut viewshed, &monster, &mut position).join()
|
||||
{
|
||||
let mut can_act = true;
|
||||
|
||||
@@ -57,7 +57,14 @@ impl<'a> System<'a> for MonsterAI {
|
||||
}
|
||||
can_act = false;
|
||||
|
||||
particle_builder.request(pos.x, pos.y, rltk::RGB::named(rltk::MAGENTA), rltk::RGB::named(rltk::BLACK), rltk::to_cp437('?'), 200.);
|
||||
particle_builder.request(
|
||||
pos.x,
|
||||
pos.y,
|
||||
rltk::RGB::named(rltk::MAGENTA),
|
||||
rltk::RGB::named(rltk::BLACK),
|
||||
rltk::to_cp437('?'),
|
||||
200.,
|
||||
);
|
||||
}
|
||||
|
||||
if !can_act {
|
||||
|
Reference in New Issue
Block a user