diff --git a/src/ai/encumbrance_system.rs b/src/ai/encumbrance_system.rs index 53aaed3..0514eec 100644 --- a/src/ai/encumbrance_system.rs +++ b/src/ai/encumbrance_system.rs @@ -1,8 +1,7 @@ use crate::{ gamelog, Attributes, Burden, EquipmentChanged, Equipped, InBackpack, Item, Pools }; use specs::prelude::*; use std::collections::HashMap; - -pub const CARRY_CAPACITY_PER_STRENGTH: i32 = 8; +use crate::config::entity::CARRY_CAPACITY_PER_STRENGTH; pub struct EncumbranceSystem {} diff --git a/src/ai/mod.rs b/src/ai/mod.rs index 112f3c5..0fb5d1e 100644 --- a/src/ai/mod.rs +++ b/src/ai/mod.rs @@ -7,7 +7,7 @@ pub use quip_system::QuipSystem; mod regen_system; pub use regen_system::RegenSystem; mod encumbrance_system; -pub use encumbrance_system::{ EncumbranceSystem, CARRY_CAPACITY_PER_STRENGTH }; +pub use encumbrance_system::EncumbranceSystem; mod adjacent_ai_system; pub use adjacent_ai_system::AdjacentAI; mod visible_ai_system; diff --git a/src/camera.rs b/src/camera.rs index 0ec379f..d07e155 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -72,7 +72,7 @@ pub fn render_camera(ecs: &World, ctx: &mut Rltk) { if map.visible_tiles[idx] { draw = true; } else { - fg = fg.mul(crate::config::colours::NON_VISIBLE_MULTIPLIER); + fg = fg.mul(crate::config::visuals::NON_VISIBLE_MULTIPLIER); // We don't darken BG, because get_tile_renderables_for_id handles this. } diff --git a/src/config/entity.rs b/src/config/entity.rs index 7e5605b..8972442 100644 --- a/src/config/entity.rs +++ b/src/config/entity.rs @@ -1,5 +1,5 @@ -#[rustfmt::skip] pub const DEFAULT_VIEWSHED_STANDARD: i32 = 16; // Standard viewshed radius for almost all entities. +pub const CARRY_CAPACITY_PER_STRENGTH: i32 = 8; pub const NORMAL_SPEED: i32 = 12; // Normal speed for almost all entities. pub const TURN_COST_MULTIPLIER: i32 = 4; // How many ticks per turn for an entity with NORMAL_SPEED. diff --git a/src/effects/messages.rs b/src/config/messages.rs similarity index 100% rename from src/effects/messages.rs rename to src/config/messages.rs diff --git a/src/config/mod.rs b/src/config/mod.rs index 8bd5f63..689130c 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -1,3 +1,8 @@ pub mod entity; -pub mod colours; +pub mod visuals; pub mod glyphs; +pub mod messages; + +pub const SHOW_MAPGEN: bool = false; +pub const LOG_SPAWNING: bool = true; +pub const LOG_TICKS: bool = false; diff --git a/src/config/colours.rs b/src/config/visuals.rs similarity index 89% rename from src/config/colours.rs rename to src/config/visuals.rs index 444ca29..a77e679 100644 --- a/src/config/colours.rs +++ b/src/config/visuals.rs @@ -3,8 +3,12 @@ pub const MAX_DARKENING: f32 = 0.3; pub const START_DARKEN_AT_N_TILES: f32 = 9.0; pub const MAX_DARKEN_AT_N_TILES: f32 = 12.0; -pub const BLOODSTAIN_COLOUR: (u8, u8, u8) = (153, 0, 0); +pub const SHORT_PARTICLE_LIFETIME: f32 = 100.0; +pub const DEFAULT_PARTICLE_LIFETIME: f32 = 200.0; +pub const LONG_PARTICLE_LIFETIME: f32 = 300.0; +// THEMES +pub const BLOODSTAIN_COLOUR: (u8, u8, u8) = (153, 0, 0); // DEFAULT THEME pub const DEFAULT_BG_COLOUR: (u8, u8, u8) = (29, 50, 50); pub const WALL_COLOUR: (u8, u8, u8) = (229, 191, 94); @@ -23,6 +27,5 @@ pub const SAND_COLOUR: (u8, u8, u8) = (70, 70, 21); pub const SHALLOW_WATER_COLOUR: (u8, u8, u8) = (24, 47, 99); pub const DEEP_WATER_COLOUR: (u8, u8, u8) = (18, 33, 63); pub const BARS_COLOUR: (u8, u8, u8) = (100, 100, 100); - // FOREST THEME pub const FOREST_WALL_COLOUR: (u8, u8, u8) = (0, 153, 0); diff --git a/src/effects/mod.rs b/src/effects/mod.rs index 7d154f1..5341435 100644 --- a/src/effects/mod.rs +++ b/src/effects/mod.rs @@ -7,7 +7,6 @@ use std::sync::Mutex; mod damage; mod hunger; -mod messages; mod particles; mod targeting; mod triggers; diff --git a/src/effects/triggers.rs b/src/effects/triggers.rs index a89b6bb..82b1ebd 100644 --- a/src/effects/triggers.rs +++ b/src/effects/triggers.rs @@ -1,4 +1,4 @@ -use super::{ add_effect, get_noncursed, messages::*, particles, spatial, EffectType, Entity, Targets, World }; +use super::{ add_effect, get_noncursed, particles, spatial, EffectType, Entity, Targets, World }; use crate::{ gamelog, gui::item_colour_ecs, @@ -30,6 +30,7 @@ use crate::{ SingleActivation, BUC, }; +use crate::config::messages::*; use rltk::prelude::*; use specs::prelude::*; pub fn item_trigger(source: Option, item: Entity, target: &Targets, ecs: &mut World) { diff --git a/src/gui/mod.rs b/src/gui/mod.rs index aa9f15b..3d32b5c 100644 --- a/src/gui/mod.rs +++ b/src/gui/mod.rs @@ -1,5 +1,4 @@ use super::{ - ai::CARRY_CAPACITY_PER_STRENGTH, camera, gamelog, gamesystem, @@ -34,6 +33,7 @@ use super::{ Viewshed, BUC, }; +use crate::config::entity::CARRY_CAPACITY_PER_STRENGTH; use rltk::prelude::*; use specs::prelude::*; use std::collections::BTreeMap; diff --git a/src/main.rs b/src/main.rs index a8d653d..9eb6567 100644 --- a/src/main.rs +++ b/src/main.rs @@ -40,9 +40,7 @@ mod spatial; extern crate lazy_static; //Consts -pub const SHOW_MAPGEN: bool = false; -pub const LOG_SPAWNING: bool = true; -pub const LOG_TICKS: bool = false; +pub use config::{ SHOW_MAPGEN, LOG_SPAWNING, LOG_TICKS }; #[derive(PartialEq, Copy, Clone)] pub enum RunState { diff --git a/src/map/themes.rs b/src/map/themes.rs index d2788c9..64f11a0 100644 --- a/src/map/themes.rs +++ b/src/map/themes.rs @@ -1,6 +1,6 @@ use super::{ Map, Point, TileType }; use crate::config::glyphs::*; -use crate::config::colours::*; +use crate::config::visuals::*; use rltk::prelude::*; use std::ops::{ Add, Mul };