Add chapter 2.10
This commit is contained in:
parent
f2f4c40c28
commit
a1ffc7b95d
@ -3,8 +3,8 @@ use specs::prelude::*;
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
components::{Monster, Position, Viewshed, WantsToMelee},
|
components::{Monster, Position, Viewshed, WantsToMelee},
|
||||||
map::Map,
|
Confusion,
|
||||||
Confusion, RunState,
|
map::Map, RunState,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub struct MonsterAI {}
|
pub struct MonsterAI {}
|
||||||
@ -43,7 +43,7 @@ impl<'a> System<'a> for MonsterAI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (entity, mut viewshed, _monster, mut pos) in
|
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;
|
let mut can_act = true;
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ impl<'a> System<'a> for MonsterAI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !can_act {
|
if !can_act {
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
let distance =
|
let distance =
|
||||||
|
@ -21,7 +21,7 @@ impl<'a> System<'a> for VisibilitySystem {
|
|||||||
let (mut map, entities, mut viewshed, pos, player) = data;
|
let (mut map, entities, mut viewshed, pos, player) = data;
|
||||||
for (ent, viewshed, pos) in (&entities, &mut viewshed, &pos).join() {
|
for (ent, viewshed, pos) in (&entities, &mut viewshed, &pos).join() {
|
||||||
if !viewshed.dirty {
|
if !viewshed.dirty {
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
viewshed.dirty = false;
|
viewshed.dirty = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user