atomising item use: hunger effect
This commit is contained in:
parent
18eae23a4c
commit
931f600625
13 changed files with 455 additions and 360 deletions
|
|
@ -8,3 +8,13 @@ pub fn entity_position(ecs: &World, target: Entity) -> Option<usize> {
|
|||
}
|
||||
return None;
|
||||
}
|
||||
|
||||
pub fn aoe_tiles(map: &Map, target: rltk::Point, radius: i32) -> Vec<usize> {
|
||||
let mut blast_tiles = rltk::field_of_view(target, radius, &*map);
|
||||
blast_tiles.retain(|p| p.x > 0 && p.x < map.width - 1 && p.y > 0 && p.y < map.height - 1);
|
||||
let mut result = Vec::new();
|
||||
for t in blast_tiles.iter() {
|
||||
result.push(map.xy_idx(t.x, t.y));
|
||||
}
|
||||
result
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue