Skip to content

Commit

Permalink
Merge branch 'main' into fix_out_of_map_fails
Browse files Browse the repository at this point in the history
  • Loading branch information
shanemadden committed Nov 28, 2023
2 parents a726f9b + 83bccf8 commit 1968921
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Unreleased

### Breaking:

- Change `TOWER_OPTIMAL_RANGE` and `TOWER_FALLOFF_RANGE` types to `u8` and `TOWER_FALLOFF` type
to `f64`
- Changed `RoomTerrain::new` and `game::map::get_room_terrain` return type to
`Option<RoomTerrain>`, returning `None` when the specified room is outside the server's
map
Expand Down
6 changes: 3 additions & 3 deletions src/constants/numbers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,10 @@ pub const TOWER_POWER_HEAL: u32 = 400;
pub const TOWER_POWER_REPAIR: u32 = 800;
/// Tower actions at a range beyond this distance suffer falloff penalties - see
/// [`TOWER_FALLOFF`].
pub const TOWER_OPTIMAL_RANGE: u32 = 5;
pub const TOWER_OPTIMAL_RANGE: u8 = 5;
/// Tower actions at a range greater than or equal to this distance suffer the
/// maxium falloff penalties - see [`TOWER_FALLOFF`].
pub const TOWER_FALLOFF_RANGE: u32 = 20;
pub const TOWER_FALLOFF_RANGE: u8 = 20;
/// Maximum percentage reduction in healing, repair, and attack effectiveness
/// for towers due to range.
///
Expand All @@ -415,7 +415,7 @@ pub const TOWER_FALLOFF_RANGE: u32 = 20;
/// ```
///
/// [source]: https://github.com/screeps/engine/blob/f02d16a44a00c35615ae227fc72a3c9a07a6a39a/src/processor/intents/towers/attack.js#L38
pub const TOWER_FALLOFF: f32 = 0.75;
pub const TOWER_FALLOFF: f64 = 0.75;

/// Initial hits for observer structures; consider using the
/// [`StructureType::initial_hits`] function.
Expand Down

0 comments on commit 1968921

Please sign in to comment.