mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix typos
This commit is contained in:
parent
abdd5e3906
commit
120ee6b6c0
@ -162,7 +162,7 @@ impl WeatherLerp {
|
|||||||
self.old = mem::replace(&mut self.new, (weather, Instant::now()));
|
self.old = mem::replace(&mut self.new, (weather, Instant::now()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Make impprovements to this interpolation, it's main issue is assuming
|
// TODO: Make improvements to this interpolation, it's main issue is assuming
|
||||||
// that updates come at regular intervals.
|
// that updates come at regular intervals.
|
||||||
fn update(&mut self, to_update: &mut WeatherGrid) {
|
fn update(&mut self, to_update: &mut WeatherGrid) {
|
||||||
prof_span!("WeatherLerp::update");
|
prof_span!("WeatherLerp::update");
|
||||||
|
@ -214,7 +214,7 @@ pub fn find_root() -> Option<PathBuf> {
|
|||||||
if path.join(".git").exists() {
|
if path.join(".git").exists() {
|
||||||
return Some(path);
|
return Some(path);
|
||||||
}
|
}
|
||||||
// Search .git directory in parent directries
|
// Search .git directory in parent directories
|
||||||
for ancestor in path.ancestors().take(10) {
|
for ancestor in path.ancestors().take(10) {
|
||||||
if ancestor.join(".git").exists() {
|
if ancestor.join(".git").exists() {
|
||||||
return Some(ancestor.to_path_buf());
|
return Some(ancestor.to_path_buf());
|
||||||
@ -505,7 +505,7 @@ pub mod asset_tweak {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Convinient macro to quickly tweak value.
|
/// Convenient macro to quickly tweak value.
|
||||||
///
|
///
|
||||||
/// Will use [Specifier]`::Tweak` specifier and call
|
/// Will use [Specifier]`::Tweak` specifier and call
|
||||||
/// [tweak_expect] if passed only name
|
/// [tweak_expect] if passed only name
|
||||||
@ -556,7 +556,7 @@ pub mod asset_tweak {
|
|||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Convinient macro to quickly tweak value from some existing path.
|
/// Convenient macro to quickly tweak value from some existing path.
|
||||||
///
|
///
|
||||||
/// Will use [Specifier]`::Asset` specifier and call
|
/// Will use [Specifier]`::Asset` specifier and call
|
||||||
/// [tweak_expect] if passed only name
|
/// [tweak_expect] if passed only name
|
||||||
|
@ -23,7 +23,7 @@ const RUST_LOG_ENV: &str = "RUST_LOG";
|
|||||||
/// following in your environment.
|
/// following in your environment.
|
||||||
/// `RUST_LOG="veloren_voxygen=trace"`
|
/// `RUST_LOG="veloren_voxygen=trace"`
|
||||||
///
|
///
|
||||||
/// more complex tracing can be done by concatenating with a `,` as seperator:
|
/// more complex tracing can be done by concatenating with a `,` as separator:
|
||||||
/// - warn for `prometheus_hyper`, `dot_vox`, `gfx_device_gl::factory,
|
/// - warn for `prometheus_hyper`, `dot_vox`, `gfx_device_gl::factory,
|
||||||
/// `gfx_device_gl::shade` trace for `veloren_voxygen`, info for everything
|
/// `gfx_device_gl::shade` trace for `veloren_voxygen`, info for everything
|
||||||
/// else
|
/// else
|
||||||
|
@ -31,7 +31,7 @@ pub enum ClientMsg {
|
|||||||
pub enum ClientType {
|
pub enum ClientType {
|
||||||
/// Regular Client like Voxygen who plays the game
|
/// Regular Client like Voxygen who plays the game
|
||||||
Game,
|
Game,
|
||||||
/// A Chatonly client, which doesn't want to connect via its character
|
/// A Chat-only client, which doesn't want to connect via its character
|
||||||
ChatOnly,
|
ChatOnly,
|
||||||
/// A unprivileged bot, e.g. to request world information
|
/// A unprivileged bot, e.g. to request world information
|
||||||
/// Or a privileged bot, e.g. to run admin commands used by server-cli
|
/// Or a privileged bot, e.g. to run admin commands used by server-cli
|
||||||
|
@ -76,7 +76,7 @@ pub trait PackingFormula: Copy {
|
|||||||
/// A wide, short image. Shares the advantage of not wasting space with
|
/// A wide, short image. Shares the advantage of not wasting space with
|
||||||
/// TallPacking (which is strictly worse, and was moved to benchmark code in
|
/// TallPacking (which is strictly worse, and was moved to benchmark code in
|
||||||
/// `world`), but faster to compress and smaller since PNG compresses each
|
/// `world`), but faster to compress and smaller since PNG compresses each
|
||||||
/// row indepedently, so a wide image has fewer calls to the compressor. FLIP_X
|
/// row independently, so a wide image has fewer calls to the compressor. FLIP_X
|
||||||
/// has the same spatial locality preserving behavior as with TallPacking.
|
/// has the same spatial locality preserving behavior as with TallPacking.
|
||||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
|
||||||
pub struct WidePacking<const FLIP_X: bool>();
|
pub struct WidePacking<const FLIP_X: bool>();
|
||||||
|
@ -7,7 +7,7 @@ use std::{
|
|||||||
|
|
||||||
// If you want to migrate assets.
|
// If you want to migrate assets.
|
||||||
// 1) Copy-paste old asset type to own module
|
// 1) Copy-paste old asset type to own module
|
||||||
// 2) Copy-pase new asset type to own module
|
// 2) Copy-paste new asset type to own module
|
||||||
// (don't forget to add serde derive-s, import if needed)
|
// (don't forget to add serde derive-s, import if needed)
|
||||||
// 3) impl From<old asset> for new asset.
|
// 3) impl From<old asset> for new asset.
|
||||||
// 4) Reference old and new assets in old and new modules
|
// 4) Reference old and new assets in old and new modules
|
||||||
|
@ -135,7 +135,7 @@ lazy_static! {
|
|||||||
pub static ref BUFF_PARSER: HashMap<String, BuffKind> = {
|
pub static ref BUFF_PARSER: HashMap<String, BuffKind> = {
|
||||||
let string_from_buff = |kind| match kind {
|
let string_from_buff = |kind| match kind {
|
||||||
BuffKind::Burning => "burning",
|
BuffKind::Burning => "burning",
|
||||||
BuffKind::Regeneration => "regeration",
|
BuffKind::Regeneration => "regeneration",
|
||||||
BuffKind::Saturation => "saturation",
|
BuffKind::Saturation => "saturation",
|
||||||
BuffKind::Bleeding => "bleeding",
|
BuffKind::Bleeding => "bleeding",
|
||||||
BuffKind::Cursed => "cursed",
|
BuffKind::Cursed => "cursed",
|
||||||
|
@ -352,7 +352,7 @@ impl Attack {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
CombatEffect::Lifesteal(l) => {
|
CombatEffect::Lifesteal(l) => {
|
||||||
// Not modified by strength_modifer as damage already is
|
// Not modified by strength_modifier as damage already is
|
||||||
if let Some(attacker_entity) = attacker.map(|a| a.entity) {
|
if let Some(attacker_entity) = attacker.map(|a| a.entity) {
|
||||||
let change = HealthChange {
|
let change = HealthChange {
|
||||||
amount: applied_damage * l,
|
amount: applied_damage * l,
|
||||||
@ -499,7 +499,7 @@ impl Attack {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
CombatEffect::Lifesteal(l) => {
|
CombatEffect::Lifesteal(l) => {
|
||||||
// Not modified by strength_modifer as damage already is
|
// Not modified by strength_modifier as damage already is
|
||||||
if let Some(attacker_entity) = attacker.map(|a| a.entity) {
|
if let Some(attacker_entity) = attacker.map(|a| a.entity) {
|
||||||
let change = HealthChange {
|
let change = HealthChange {
|
||||||
amount: accumulated_damage * l,
|
amount: accumulated_damage * l,
|
||||||
@ -1162,7 +1162,7 @@ pub fn compute_crit_mult(inventory: Option<&Inventory>, msm: &MaterialStatManife
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Computes the energy reward modifer from worn armor
|
/// Computes the energy reward modifier from worn armor
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
pub fn compute_energy_reward_mod(inventory: Option<&Inventory>, msm: &MaterialStatManifest) -> f32 {
|
pub fn compute_energy_reward_mod(inventory: Option<&Inventory>, msm: &MaterialStatManifest) -> f32 {
|
||||||
// Starts with a value of 1.0 when summing the stats from each armor piece, and
|
// Starts with a value of 1.0 when summing the stats from each armor piece, and
|
||||||
|
@ -217,7 +217,7 @@ impl<'a> From<&'a Body> for Psyche {
|
|||||||
quadruped_small::Species::Goat => 0.5,
|
quadruped_small::Species::Goat => 0.5,
|
||||||
quadruped_small::Species::Porcupine => 0.7,
|
quadruped_small::Species::Porcupine => 0.7,
|
||||||
quadruped_small::Species::Turtle => 0.7,
|
quadruped_small::Species::Turtle => 0.7,
|
||||||
// FIXME: This is to balance for enemy rats in dunegeons
|
// FIXME: This is to balance for enemy rats in dungeons
|
||||||
// Normal rats should probably always flee.
|
// Normal rats should probably always flee.
|
||||||
quadruped_small::Species::Rat => 0.0,
|
quadruped_small::Species::Rat => 0.0,
|
||||||
quadruped_small::Species::Beaver => 0.7,
|
quadruped_small::Species::Beaver => 0.7,
|
||||||
@ -546,7 +546,7 @@ impl Agent {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Makes agent aggresive without warning
|
/// Makes agent aggressive without warning
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn with_aggro_no_warn(mut self) -> Self {
|
pub fn with_aggro_no_warn(mut self) -> Self {
|
||||||
self.psyche.aggro_dist = None;
|
self.psyche.aggro_dist = None;
|
||||||
|
@ -289,7 +289,7 @@ impl Body {
|
|||||||
Body::FishSmall(_) => 1.0,
|
Body::FishSmall(_) => 1.0,
|
||||||
Body::Golem(_) => 10_000.0,
|
Body::Golem(_) => 10_000.0,
|
||||||
Body::Humanoid(humanoid) => {
|
Body::Humanoid(humanoid) => {
|
||||||
// Understand that chaning the mass values can have effects
|
// Understand that changing the mass values can have effects
|
||||||
// on multiple systems.
|
// on multiple systems.
|
||||||
//
|
//
|
||||||
// If you want to change that value, consult with
|
// If you want to change that value, consult with
|
||||||
@ -568,8 +568,8 @@ impl Body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// How far away other entities should try to be. Will be added uppon the other
|
// How far away other entities should try to be. Will be added upon the other
|
||||||
// entitys spacing_radius. So an entity with 2.0 and an entity with 3.0 will
|
// entity's spacing_radius. So an entity with 2.0 and an entity with 3.0 will
|
||||||
// lead to that both entities will try to keep 5.0 units away from each
|
// lead to that both entities will try to keep 5.0 units away from each
|
||||||
// other.
|
// other.
|
||||||
pub fn spacing_radius(&self) -> f32 {
|
pub fn spacing_radius(&self) -> f32 {
|
||||||
|
@ -131,7 +131,7 @@ pub enum UtteranceKind {
|
|||||||
Greeting,
|
Greeting,
|
||||||
Scream,
|
Scream,
|
||||||
/* Death,
|
/* Death,
|
||||||
* TODO: Wait for more post-death features (i.e. animiations) before implementing death
|
* TODO: Wait for more post-death features (i.e. animations) before implementing death
|
||||||
* sounds */
|
* sounds */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ impl Body {
|
|||||||
) -> Vec3<f32> {
|
) -> Vec3<f32> {
|
||||||
let v_sq = rel_flow.0.magnitude_squared();
|
let v_sq = rel_flow.0.magnitude_squared();
|
||||||
if v_sq < 0.25 {
|
if v_sq < 0.25 {
|
||||||
// don't bother with miniscule forces
|
// don't bother with minuscule forces
|
||||||
Vec3::zero()
|
Vec3::zero()
|
||||||
} else {
|
} else {
|
||||||
let rel_flow_dir = Dir::new(rel_flow.0 / v_sq.sqrt());
|
let rel_flow_dir = Dir::new(rel_flow.0 / v_sq.sqrt());
|
||||||
|
@ -87,7 +87,7 @@ impl ItemSpec {
|
|||||||
.map(drop)
|
.map(drop)
|
||||||
.map_err(ValidationError::ItemAssetError),
|
.map_err(ValidationError::ItemAssetError),
|
||||||
ItemSpec::Choice(choices) => {
|
ItemSpec::Choice(choices) => {
|
||||||
// TODO: check for sanity of weigts?
|
// TODO: check for sanity of weights?
|
||||||
for (_weight, choice) in choices {
|
for (_weight, choice) in choices {
|
||||||
if let Some(item) = choice {
|
if let Some(item) = choice {
|
||||||
item.validate()?;
|
item.validate()?;
|
||||||
@ -212,7 +212,7 @@ impl Base {
|
|||||||
/// If you want programing API of loadout creation,
|
/// If you want programing API of loadout creation,
|
||||||
/// use `LoadoutBuilder` instead.
|
/// use `LoadoutBuilder` instead.
|
||||||
///
|
///
|
||||||
/// For examples of assets, see `assets/test/ladout/ok` folder.
|
/// For examples of assets, see `assets/test/loadout/ok` folder.
|
||||||
#[derive(Debug, Deserialize, Clone, Default)]
|
#[derive(Debug, Deserialize, Clone, Default)]
|
||||||
#[serde(deny_unknown_fields)]
|
#[serde(deny_unknown_fields)]
|
||||||
pub struct LoadoutSpec {
|
pub struct LoadoutSpec {
|
||||||
@ -1161,8 +1161,8 @@ mod tests {
|
|||||||
|
|
||||||
// Testing different species
|
// Testing different species
|
||||||
//
|
//
|
||||||
// Things that will be catched - invalid assets paths for
|
// Things that will be caught - invalid assets paths for
|
||||||
// creating default main hand tool or equipement without config
|
// creating default main hand tool or equipment without config
|
||||||
#[test]
|
#[test]
|
||||||
fn test_loadout_species() {
|
fn test_loadout_species() {
|
||||||
macro_rules! test_species {
|
macro_rules! test_species {
|
||||||
|
@ -61,7 +61,7 @@ pub enum Meta {
|
|||||||
// that this field should be either Default or Unchanged
|
// that this field should be either Default or Unchanged
|
||||||
// depending on how it is used.
|
// depending on how it is used.
|
||||||
//
|
//
|
||||||
// When we will use exension manifests more, it would be nicer to
|
// When we will use extension manifests more, it would be nicer to
|
||||||
// split EntityBase and EntityExtension to different structs.
|
// split EntityBase and EntityExtension to different structs.
|
||||||
//
|
//
|
||||||
// Fields which have Uninit enum kind
|
// Fields which have Uninit enum kind
|
||||||
@ -69,7 +69,7 @@ pub enum Meta {
|
|||||||
// and required (or renamed to Default) in EntityBase
|
// and required (or renamed to Default) in EntityBase
|
||||||
/// Struct for EntityInfo manifest.
|
/// Struct for EntityInfo manifest.
|
||||||
///
|
///
|
||||||
/// Intended to use with .ron files as base definion or
|
/// Intended to use with .ron files as base definition or
|
||||||
/// in rare cases as extension manifest.
|
/// in rare cases as extension manifest.
|
||||||
/// Pure data struct, doesn't do anything until evaluated with EntityInfo.
|
/// Pure data struct, doesn't do anything until evaluated with EntityInfo.
|
||||||
///
|
///
|
||||||
|
@ -33,7 +33,7 @@ pub struct StaticData {
|
|||||||
pub recover_duration: Duration,
|
pub recover_duration: Duration,
|
||||||
/// How many creatures the state should summon
|
/// How many creatures the state should summon
|
||||||
pub summon_amount: u32,
|
pub summon_amount: u32,
|
||||||
/// Range of the summons relative to the summonner
|
/// Range of the summons relative to the summoner
|
||||||
pub summon_distance: (f32, f32),
|
pub summon_distance: (f32, f32),
|
||||||
/// Information about the summoned creature
|
/// Information about the summoned creature
|
||||||
pub summon_info: SummonInfo,
|
pub summon_info: SummonInfo,
|
||||||
@ -161,7 +161,7 @@ impl CharacterBehavior for Data {
|
|||||||
.cast()
|
.cast()
|
||||||
.0;
|
.0;
|
||||||
|
|
||||||
// If a duration is specified, create a projectile componenent for the npc
|
// If a duration is specified, create a projectile component for the npc
|
||||||
let projectile = self.static_data.duration.map(|duration| Projectile {
|
let projectile = self.static_data.duration.map(|duration| Projectile {
|
||||||
hit_solid: Vec::new(),
|
hit_solid: Vec::new(),
|
||||||
hit_entity: Vec::new(),
|
hit_entity: Vec::new(),
|
||||||
|
@ -173,7 +173,7 @@ impl CharacterBehavior for Data {
|
|||||||
.get(self.stage as usize - 1)
|
.get(self.stage as usize - 1)
|
||||||
.map_or(0, |_| self.stage as usize - 1);
|
.map_or(0, |_| self.stage as usize - 1);
|
||||||
|
|
||||||
let speed_modifer = 1.0
|
let speed_modifier = 1.0
|
||||||
+ self.static_data.max_speed_increase
|
+ self.static_data.max_speed_increase
|
||||||
* (1.0 - self.static_data.speed_increase.powi(combo_counter as i32));
|
* (1.0 - self.static_data.speed_increase.powi(combo_counter as i32));
|
||||||
|
|
||||||
@ -190,7 +190,7 @@ impl CharacterBehavior for Data {
|
|||||||
// Build up
|
// Build up
|
||||||
update.character = CharacterState::ComboMelee(Data {
|
update.character = CharacterState::ComboMelee(Data {
|
||||||
static_data: self.static_data.clone(),
|
static_data: self.static_data.clone(),
|
||||||
timer: tick_attack_or_default(data, self.timer, Some(speed_modifer)),
|
timer: tick_attack_or_default(data, self.timer, Some(speed_modifier)),
|
||||||
..*self
|
..*self
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -315,7 +315,7 @@ impl CharacterBehavior for Data {
|
|||||||
// Swings
|
// Swings
|
||||||
update.character = CharacterState::ComboMelee(Data {
|
update.character = CharacterState::ComboMelee(Data {
|
||||||
static_data: self.static_data.clone(),
|
static_data: self.static_data.clone(),
|
||||||
timer: tick_attack_or_default(data, self.timer, Some(speed_modifer)),
|
timer: tick_attack_or_default(data, self.timer, Some(speed_modifier)),
|
||||||
..*self
|
..*self
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -339,7 +339,7 @@ impl CharacterBehavior for Data {
|
|||||||
// Recovers
|
// Recovers
|
||||||
update.character = CharacterState::ComboMelee(Data {
|
update.character = CharacterState::ComboMelee(Data {
|
||||||
static_data: self.static_data.clone(),
|
static_data: self.static_data.clone(),
|
||||||
timer: tick_attack_or_default(data, self.timer, Some(speed_modifer)),
|
timer: tick_attack_or_default(data, self.timer, Some(speed_modifier)),
|
||||||
..*self
|
..*self
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -22,7 +22,7 @@ pub struct StaticData {
|
|||||||
pub buildup_duration: Duration,
|
pub buildup_duration: Duration,
|
||||||
/// How long the state charges for until it reaches max damage
|
/// How long the state charges for until it reaches max damage
|
||||||
pub charge_duration: Duration,
|
pub charge_duration: Duration,
|
||||||
/// Suration of state spent in swing
|
/// Duration of state spent in swing
|
||||||
pub swing_duration: Duration,
|
pub swing_duration: Duration,
|
||||||
/// How long the state has until exiting
|
/// How long the state has until exiting
|
||||||
pub recover_duration: Duration,
|
pub recover_duration: Duration,
|
||||||
|
@ -86,7 +86,7 @@ impl BlockKind {
|
|||||||
#[inline]
|
#[inline]
|
||||||
pub const fn is_filled(&self) -> bool { !self.is_fluid() }
|
pub const fn is_filled(&self) -> bool { !self.is_fluid() }
|
||||||
|
|
||||||
/// Determine whether the block has an RGB color storaged in the attribute
|
/// Determine whether the block has an RGB color stored in the attribute
|
||||||
/// fields.
|
/// fields.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub const fn has_color(&self) -> bool { self.is_filled() }
|
pub const fn has_color(&self) -> bool { self.is_filled() }
|
||||||
|
@ -116,7 +116,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
if frame_time <= 0.0 {
|
if frame_time <= 0.0 {
|
||||||
return (server_events, add_hit_entities, outcomes);
|
return (server_events, add_hit_entities, outcomes);
|
||||||
}
|
}
|
||||||
// Note: min() probably uneeded
|
// Note: min() probably unneeded
|
||||||
let time_since_creation = (time - creation_time) as f32;
|
let time_since_creation = (time - creation_time) as f32;
|
||||||
let frame_start_dist =
|
let frame_start_dist =
|
||||||
(beam_segment.speed * (time_since_creation - frame_time)).max(0.0);
|
(beam_segment.speed * (time_since_creation - frame_time)).max(0.0);
|
||||||
|
@ -86,7 +86,7 @@ fn fall_simple() -> Result<(), Box<dyn Error>> {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
/// will fall in 20 x DT and 2 x 10*DT steps. compare the end result and make
|
/// will fall in 20 x DT and 2 x 10*DT steps. compare the end result and make
|
||||||
/// log the "error" between both caluclation
|
/// log the "error" between both calculations
|
||||||
fn fall_dt_speed_diff() -> Result<(), Box<dyn Error>> {
|
fn fall_dt_speed_diff() -> Result<(), Box<dyn Error>> {
|
||||||
let mut sstate = utils::setup();
|
let mut sstate = utils::setup();
|
||||||
let mut fstate = utils::setup();
|
let mut fstate = utils::setup();
|
||||||
@ -213,7 +213,7 @@ fn walk_max() -> Result<(), Box<dyn Error>> {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
/// will run in 20 x DT and 2 x 10*DT steps. compare the end result and make
|
/// will run in 20 x DT and 2 x 10*DT steps. compare the end result and make
|
||||||
/// log the "error" between both caluclation
|
/// log the "error" between both calculations
|
||||||
fn walk_dt_speed_diff() -> Result<(), Box<dyn Error>> {
|
fn walk_dt_speed_diff() -> Result<(), Box<dyn Error>> {
|
||||||
let mut sstate = utils::setup();
|
let mut sstate = utils::setup();
|
||||||
let mut fstate = utils::setup();
|
let mut fstate = utils::setup();
|
||||||
|
@ -461,7 +461,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn initframe_rubish() {
|
fn initframe_rubbish() {
|
||||||
let mut buffer = BytesMut::from(&b"dtrgwcser"[..]);
|
let mut buffer = BytesMut::from(&b"dtrgwcser"[..]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
InitFrame::read_frame(&mut buffer),
|
InitFrame::read_frame(&mut buffer),
|
||||||
|
@ -160,7 +160,7 @@ pub struct StreamParams {
|
|||||||
/// via their [`ConnectAddr`], or [`listen`] passively for [`connected`]
|
/// via their [`ConnectAddr`], or [`listen`] passively for [`connected`]
|
||||||
/// [`Participants`] via [`ListenAddr`].
|
/// [`Participants`] via [`ListenAddr`].
|
||||||
///
|
///
|
||||||
/// Too guarantee a clean shutdown, the [`Runtime`] MUST NOT be droped before
|
/// Too guarantee a clean shutdown, the [`Runtime`] MUST NOT be dropped before
|
||||||
/// the Network.
|
/// the Network.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
@ -516,7 +516,7 @@ impl Network {
|
|||||||
};
|
};
|
||||||
if let Ok(return_s) = return_s {
|
if let Ok(return_s) = return_s {
|
||||||
if return_s.send(()).is_err() {
|
if return_s.send(()).is_err() {
|
||||||
warn!("Network::drop stoped after a timeout and didn't wait for our shutdown");
|
warn!("Network::drop stopped after a timeout and didn't wait for our shutdown");
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
debug!("Network has shut down");
|
debug!("Network has shut down");
|
||||||
@ -550,7 +550,7 @@ impl Participant {
|
|||||||
/// # Arguments
|
/// # Arguments
|
||||||
/// * `prio` - defines which stream is processed first when limited on
|
/// * `prio` - defines which stream is processed first when limited on
|
||||||
/// bandwidth. See [`Prio`] for documentation.
|
/// bandwidth. See [`Prio`] for documentation.
|
||||||
/// * `promises` - use a combination of you prefered [`Promises`], see the
|
/// * `promises` - use a combination of you preferred [`Promises`], see the
|
||||||
/// link for further documentation. You can combine them, e.g.
|
/// link for further documentation. You can combine them, e.g.
|
||||||
/// `Promises::ORDERED | Promises::CONSISTENCY` The Stream will then
|
/// `Promises::ORDERED | Promises::CONSISTENCY` The Stream will then
|
||||||
/// guarantee that those promises are met.
|
/// guarantee that those promises are met.
|
||||||
@ -1177,7 +1177,7 @@ where
|
|||||||
},
|
},
|
||||||
Err(TryRecvError::Closed) => panic!("{}{}", name, CHANNEL_ERR),
|
Err(TryRecvError::Closed) => panic!("{}{}", name, CHANNEL_ERR),
|
||||||
Err(TryRecvError::Empty) => {
|
Err(TryRecvError::Empty) => {
|
||||||
trace!("activly sleeping");
|
trace!("actively sleeping");
|
||||||
cnt += 1;
|
cnt += 1;
|
||||||
if cnt > 10 {
|
if cnt > 10 {
|
||||||
error!("Timeout waiting for shutdown, dropping");
|
error!("Timeout waiting for shutdown, dropping");
|
||||||
@ -1222,7 +1222,7 @@ impl Drop for Participant {
|
|||||||
debug!("Shutting down Participant");
|
debug!("Shutting down Participant");
|
||||||
|
|
||||||
match self.a2s_disconnect_s.try_lock() {
|
match self.a2s_disconnect_s.try_lock() {
|
||||||
Err(e) => debug!(?e, "Participant is beeing dropped by Network right now"),
|
Err(e) => debug!(?e, "Participant is being dropped by Network right now"),
|
||||||
Ok(mut s) => match s.take() {
|
Ok(mut s) => match s.take() {
|
||||||
None => info!("Participant already has been shutdown gracefully"),
|
None => info!("Participant already has been shutdown gracefully"),
|
||||||
Some(a2s_disconnect_s) => {
|
Some(a2s_disconnect_s) => {
|
||||||
|
@ -623,7 +623,7 @@ impl UnreliableDrain for QuicDrain {
|
|||||||
match self.reliables.entry(sid) {
|
match self.reliables.entry(sid) {
|
||||||
Entry::Occupied(mut occupied) => occupied.get_mut().write_all(&data.data).await,
|
Entry::Occupied(mut occupied) => occupied.get_mut().write_all(&data.data).await,
|
||||||
Entry::Vacant(vacant) => {
|
Entry::Vacant(vacant) => {
|
||||||
// IF the buffer is empty this was created localy and WE are allowed to
|
// IF the buffer is empty this was created locally and WE are allowed to
|
||||||
// open_bi(), if not, we NEED to block on sendstreams_r
|
// open_bi(), if not, we NEED to block on sendstreams_r
|
||||||
if data.data.is_empty() {
|
if data.data.is_empty() {
|
||||||
let (mut sendstream, recvstream) =
|
let (mut sendstream, recvstream) =
|
||||||
|
@ -121,7 +121,7 @@ pub mod event {
|
|||||||
/// #[event_handler]
|
/// #[event_handler]
|
||||||
/// pub fn on_command_testplugin(command: ChatCommandEvent) -> Result<Vec<String>, String> {
|
/// pub fn on_command_testplugin(command: ChatCommandEvent) -> Result<Vec<String>, String> {
|
||||||
/// Ok(vec![format!(
|
/// Ok(vec![format!(
|
||||||
/// "Player of id {:?} named {} with {:?} sended command with args {:?}",
|
/// "Player of id {:?} named {} with {:?} sent command with args {:?}",
|
||||||
/// command.player.id,
|
/// command.player.id,
|
||||||
/// command
|
/// command
|
||||||
/// .player
|
/// .player
|
||||||
|
@ -100,7 +100,7 @@ static mut BUFFERS: Vec<u8> = Vec::new();
|
|||||||
|
|
||||||
/// Allocate buffer from wasm linear memory
|
/// Allocate buffer from wasm linear memory
|
||||||
/// # Safety
|
/// # Safety
|
||||||
/// This function should never be used only intented to by used by the host
|
/// This function should never be used only intended to by used by the host
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub unsafe fn wasm_prepare_buffer(size: i32) -> i64 {
|
pub unsafe fn wasm_prepare_buffer(size: i32) -> i64 {
|
||||||
BUFFERS = vec![0u8; size as usize];
|
BUFFERS = vec![0u8; size as usize];
|
||||||
|
@ -101,7 +101,7 @@ impl Client {
|
|||||||
| ServerGeneral::CharacterSuccess => {
|
| ServerGeneral::CharacterSuccess => {
|
||||||
self.character_screen_stream.lock().unwrap().send(g)
|
self.character_screen_stream.lock().unwrap().send(g)
|
||||||
},
|
},
|
||||||
//Ingame related
|
//In-game related
|
||||||
ServerGeneral::GroupUpdate(_)
|
ServerGeneral::GroupUpdate(_)
|
||||||
| ServerGeneral::Invite { .. }
|
| ServerGeneral::Invite { .. }
|
||||||
| ServerGeneral::InvitePending(_)
|
| ServerGeneral::InvitePending(_)
|
||||||
@ -175,7 +175,7 @@ impl Client {
|
|||||||
| ServerGeneral::CharacterSuccess => {
|
| ServerGeneral::CharacterSuccess => {
|
||||||
PreparedMsg::new(1, &g, &self.character_screen_stream_params)
|
PreparedMsg::new(1, &g, &self.character_screen_stream_params)
|
||||||
},
|
},
|
||||||
//Ingame related
|
//In-game related
|
||||||
ServerGeneral::GroupUpdate(_)
|
ServerGeneral::GroupUpdate(_)
|
||||||
| ServerGeneral::Invite { .. }
|
| ServerGeneral::Invite { .. }
|
||||||
| ServerGeneral::InvitePending(_)
|
| ServerGeneral::InvitePending(_)
|
||||||
@ -192,7 +192,7 @@ impl Client {
|
|||||||
| ServerGeneral::WeatherUpdate(_) => {
|
| ServerGeneral::WeatherUpdate(_) => {
|
||||||
PreparedMsg::new(2, &g, &self.in_game_stream_params)
|
PreparedMsg::new(2, &g, &self.in_game_stream_params)
|
||||||
},
|
},
|
||||||
//Ingame related, terrain
|
//In-game related, terrain
|
||||||
ServerGeneral::TerrainChunkUpdate { .. }
|
ServerGeneral::TerrainChunkUpdate { .. }
|
||||||
| ServerGeneral::LodZoneUpdate { .. }
|
| ServerGeneral::LodZoneUpdate { .. }
|
||||||
| ServerGeneral::TerrainBlockUpdates(_) => {
|
| ServerGeneral::TerrainBlockUpdates(_) => {
|
||||||
|
@ -972,12 +972,12 @@ fn handle_time(
|
|||||||
// 'developer commentary' mode created by digging up the long-decayed
|
// 'developer commentary' mode created by digging up the long-decayed
|
||||||
// skeletons of the Veloren team, measuring various attributes of their
|
// skeletons of the Veloren team, measuring various attributes of their
|
||||||
// jawlines, and using them to recreate their voices. But how to go about
|
// jawlines, and using them to recreate their voices. But how to go about
|
||||||
// this Herculean task? This code is jibberish! The last of the core Rust
|
// this Herculean task? This code is gibberish! The last of the core Rust
|
||||||
// dev team died exactly 337,194 years ago! Rust is now a long-forgotten
|
// dev team died exactly 337,194 years ago! Rust is now a long-forgotten
|
||||||
// dialect of the ancient ones, lost to the sands of time. Ashes to ashes,
|
// dialect of the ancient ones, lost to the sands of time. Ashes to ashes,
|
||||||
// dust to dust. When all hope is lost, one particularly intrepid
|
// dust to dust. When all hope is lost, one particularly intrepid
|
||||||
// post-human hominid exployed by the 'Veloren Revival Corp' (no doubt we
|
// post-human hominid exployed by the 'Veloren Revival Corp' (no doubt we
|
||||||
// still won't have gotted rid of this blasted 'capitalism' thing by then)
|
// still won't have gotten rid of this blasted 'capitalism' thing by then)
|
||||||
// might notice, after years of searching, a particularly curious
|
// might notice, after years of searching, a particularly curious
|
||||||
// inscription within the code. The letters `D`, `A`, `Y`. Curious! She
|
// inscription within the code. The letters `D`, `A`, `Y`. Curious! She
|
||||||
// consults the post-human hominid scholars of the old. Care to empathise
|
// consults the post-human hominid scholars of the old. Care to empathise
|
||||||
@ -986,7 +986,7 @@ fn handle_time(
|
|||||||
// 'day' in the post-human hominid language, which is of course universal.
|
// 'day' in the post-human hominid language, which is of course universal.
|
||||||
// Imagine also her surprise when, after much further translating, she
|
// Imagine also her surprise when, after much further translating, she
|
||||||
// finds a comment predicting her very existence and her struggle to
|
// finds a comment predicting her very existence and her struggle to
|
||||||
// decode this great mystery. Rejoyce! The Veloren Revival Corp. may now
|
// decode this great mystery. Rejoice! The Veloren Revival Corp. may now
|
||||||
// persist with their great Ultimate Edition DLC because the day period
|
// persist with their great Ultimate Edition DLC because the day period
|
||||||
// might now be changed because they have found the constant that controls
|
// might now be changed because they have found the constant that controls
|
||||||
// it! Everybody was henceforth happy until the end of time.
|
// it! Everybody was henceforth happy until the end of time.
|
||||||
@ -2778,7 +2778,7 @@ spawn_rate {:?} "#,
|
|||||||
server.notify_client(client, ServerGeneral::server_msg(ChatType::CommandInfo, s));
|
server.notify_client(client, ServerGeneral::server_msg(ChatType::CommandInfo, s));
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
Err("Not a pregenerated chunk.".into())
|
Err("Not a pre-generated chunk.".into())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,8 @@ impl ConnectionHandler {
|
|||||||
Some(Err(e)) => {
|
Some(Err(e)) => {
|
||||||
error!(
|
error!(
|
||||||
?e,
|
?e,
|
||||||
"Stopping Conection Handler, no new connections can be made to server now!"
|
"Stopping Connection Handler, no new connections can be made to server \
|
||||||
|
now!"
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
},
|
},
|
||||||
|
@ -131,7 +131,7 @@ pub fn handle_create_npc(
|
|||||||
.map(|g| (g, c))
|
.map(|g| (g, c))
|
||||||
})
|
})
|
||||||
.map(|(g, c)| {
|
.map(|(g, c)| {
|
||||||
// Might be unneccessary, but maybe pets can somehow have map
|
// Might be unnecessary, but maybe pets can somehow have map
|
||||||
// markers in the future
|
// markers in the future
|
||||||
update_map_markers(&map_markers, &uids, c, &group_change);
|
update_map_markers(&map_markers, &uids, c, &group_change);
|
||||||
c.send_fallible(ServerGeneral::GroupUpdate(g));
|
c.send_fallible(ServerGeneral::GroupUpdate(g));
|
||||||
|
@ -222,7 +222,7 @@ pub fn handle_group(server: &mut Server, entity: Entity, manip: GroupManip) {
|
|||||||
"You were removed from the group.",
|
"You were removed from the group.",
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
// Tell kicker that they were succesful
|
// Tell kicker that they were successful
|
||||||
if let Some(client) = clients.get(entity) {
|
if let Some(client) = clients.get(entity) {
|
||||||
client.send_fallible(ServerGeneral::server_msg(
|
client.send_fallible(ServerGeneral::server_msg(
|
||||||
ChatType::Meta,
|
ChatType::Meta,
|
||||||
|
@ -504,7 +504,7 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv
|
|||||||
if let Some(pos) = ecs.read_storage::<comp::Pos>().get(entity) {
|
if let Some(pos) = ecs.read_storage::<comp::Pos>().get(entity) {
|
||||||
let mut merged_stacks = false;
|
let mut merged_stacks = false;
|
||||||
|
|
||||||
// If both slots have items and we're attemping to drag from one stack
|
// If both slots have items and we're attempting to drag from one stack
|
||||||
// into another, stack the items.
|
// into another, stack the items.
|
||||||
if let (Slot::Inventory(slot_a), Slot::Inventory(slot_b)) = (a, b) {
|
if let (Slot::Inventory(slot_a), Slot::Inventory(slot_b)) = (a, b) {
|
||||||
merged_stacks |= inventory.merge_stack_into(slot_a, slot_b);
|
merged_stacks |= inventory.merge_stack_into(slot_a, slot_b);
|
||||||
@ -538,7 +538,7 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv
|
|||||||
let ability_map = state.ecs().read_resource::<AbilityMap>();
|
let ability_map = state.ecs().read_resource::<AbilityMap>();
|
||||||
let msm = state.ecs().read_resource::<MaterialStatManifest>();
|
let msm = state.ecs().read_resource::<MaterialStatManifest>();
|
||||||
|
|
||||||
// If both slots have items and we're attemping to split from one stack
|
// If both slots have items and we're attempting to split from one stack
|
||||||
// into another, ensure that they are the same type of item. If they are
|
// into another, ensure that they are the same type of item. If they are
|
||||||
// the same type do nothing, as you don't want to overwrite the existing item.
|
// the same type do nothing, as you don't want to overwrite the existing item.
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ pub fn handle_invite(server: &mut Server, inviter: Entity, invitee_uid: Uid, kin
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mut invite_sent = false;
|
let mut invite_sent = false;
|
||||||
// Returns true if insertion was succesful
|
// Returns true if insertion was successful
|
||||||
let mut send_invite = || {
|
let mut send_invite = || {
|
||||||
match invites.insert(invitee, Invite { inviter, kind }) {
|
match invites.insert(invitee, Invite { inviter, kind }) {
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
|
@ -1385,7 +1385,7 @@ impl Server {
|
|||||||
let world_dims_chunks = self.world.sim().get_size();
|
let world_dims_chunks = self.world.sim().get_size();
|
||||||
let world_dims_blocks = TerrainChunkSize::blocks(world_dims_chunks);
|
let world_dims_blocks = TerrainChunkSize::blocks(world_dims_chunks);
|
||||||
// NOTE: origin is in the corner of the map
|
// NOTE: origin is in the corner of the map
|
||||||
// TODO: extend this function to have picking a random position or specifiying a
|
// TODO: extend this function to have picking a random position or specifying a
|
||||||
// position as options
|
// position as options
|
||||||
//let mut rng = rand::thread_rng();
|
//let mut rng = rand::thread_rng();
|
||||||
// // Pick a random position but not to close to the edge
|
// // Pick a random position but not to close to the edge
|
||||||
|
@ -199,7 +199,7 @@ fn tool_kind_to_string(tool: Option<comp::item::tool::ToolKind>) -> String {
|
|||||||
Some(Blowgun) => "Blowgun",
|
Some(Blowgun) => "Blowgun",
|
||||||
Some(Pick) => "Pick",
|
Some(Pick) => "Pick",
|
||||||
|
|
||||||
// Toolkinds that are not anticipated to have many active aiblities (if any at all)
|
// Toolkinds that are not anticipated to have many active abilities (if any at all)
|
||||||
Some(Farming) => "Farming",
|
Some(Farming) => "Farming",
|
||||||
Some(Debug) => "Debug",
|
Some(Debug) => "Debug",
|
||||||
Some(Natural) => "Natural",
|
Some(Natural) => "Natural",
|
||||||
|
@ -47,7 +47,7 @@ const BIRD_MEDIUM_ROSTER: &[comp::bird_medium::Species] = &[
|
|||||||
];
|
];
|
||||||
|
|
||||||
const BIRD_LARGE_ROSTER: &[comp::bird_large::Species] = &[
|
const BIRD_LARGE_ROSTER: &[comp::bird_large::Species] = &[
|
||||||
// Flame Wyvern not incuded until proper introduction
|
// Flame Wyvern not included until proper introduction
|
||||||
comp::bird_large::Species::Phoenix,
|
comp::bird_large::Species::Phoenix,
|
||||||
comp::bird_large::Species::Cockatrice,
|
comp::bird_large::Species::Cockatrice,
|
||||||
comp::bird_large::Species::Roc,
|
comp::bird_large::Species::Roc,
|
||||||
|
@ -477,7 +477,7 @@ mod v1 {
|
|||||||
|
|
||||||
impl Banlist {
|
impl Banlist {
|
||||||
/// Attempt to perform the ban action `action` for the user with UUID
|
/// Attempt to perform the ban action `action` for the user with UUID
|
||||||
/// `uuid` and username `username`, starting from itme `now`
|
/// `uuid` and username `username`, starting from time `now`
|
||||||
/// (the information about the banning party will
|
/// (the information about the banning party will
|
||||||
/// be in the `action` record), with a settings file maintained at path
|
/// be in the `action` record), with a settings file maintained at path
|
||||||
/// root `data_dir`.
|
/// root `data_dir`.
|
||||||
|
@ -83,8 +83,8 @@ pub trait EditableSetting: Clone + Default {
|
|||||||
file.seek(SeekFrom::Start(0))?;
|
file.seek(SeekFrom::Start(0))?;
|
||||||
ron::de::from_reader(file)
|
ron::de::from_reader(file)
|
||||||
.map(|legacy| Ok((Version::Old, Self::Legacy::into(legacy))))
|
.map(|legacy| Ok((Version::Old, Self::Legacy::into(legacy))))
|
||||||
// When both legacy and nonlegacy have parse errors, prioritize the
|
// When both legacy and non-legacy have parse errors, prioritize the
|
||||||
// nonlegacy one, since we can't tell which one is "right" and legacy
|
// non-legacy one, since we can't tell which one is "right" and legacy
|
||||||
// formats are simple, early, and uncommon enough that we expect
|
// formats are simple, early, and uncommon enough that we expect
|
||||||
// few parse errors in those.
|
// few parse errors in those.
|
||||||
.or(Err(orig_err))
|
.or(Err(orig_err))
|
||||||
|
@ -157,7 +157,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
// Default to looking in orientation direction
|
// Default to looking in orientation direction
|
||||||
// (can be overridden below)
|
// (can be overridden below)
|
||||||
//
|
//
|
||||||
// This definetly breaks LeapMelee and
|
// This definitely breaks LeapMelee and
|
||||||
// probably not only that, do we really need this at all?
|
// probably not only that, do we really need this at all?
|
||||||
controller.reset();
|
controller.reset();
|
||||||
controller.inputs.look_dir = ori.look_dir();
|
controller.inputs.look_dir = ori.look_dir();
|
||||||
@ -1359,7 +1359,7 @@ impl<'a> AgentData<'a> {
|
|||||||
let balance1: f32 = prices.balance(&pending.offers, &inventories, who, false);
|
let balance1: f32 = prices.balance(&pending.offers, &inventories, who, false);
|
||||||
if balance0 >= balance1 {
|
if balance0 >= balance1 {
|
||||||
// If the trade is favourable to us, only send an accept message if we're
|
// If the trade is favourable to us, only send an accept message if we're
|
||||||
// not already accepting (since otherwise, spamclicking the accept button
|
// not already accepting (since otherwise, spam-clicking the accept button
|
||||||
// results in lagging and moving to the review phase of an unfavorable trade
|
// results in lagging and moving to the review phase of an unfavorable trade
|
||||||
// (although since the phase is included in the message, this shouldn't
|
// (although since the phase is included in the message, this shouldn't
|
||||||
// result in fully accepting an unfavourable trade))
|
// result in fully accepting an unfavourable trade))
|
||||||
@ -2174,7 +2174,7 @@ impl<'a> AgentData<'a> {
|
|||||||
let sound_pos = Pos(sound.pos);
|
let sound_pos = Pos(sound.pos);
|
||||||
let dist_sqrd = self.pos.0.distance_squared(sound_pos.0);
|
let dist_sqrd = self.pos.0.distance_squared(sound_pos.0);
|
||||||
// NOTE: There is an implicit distance requirement given that sound volume
|
// NOTE: There is an implicit distance requirement given that sound volume
|
||||||
// disipates as it travels, but we will not want to flee if a sound is super
|
// dissipates as it travels, but we will not want to flee if a sound is super
|
||||||
// loud but heard from a great distance, regardless of how loud it was.
|
// loud but heard from a great distance, regardless of how loud it was.
|
||||||
// `is_close` is this limiter.
|
// `is_close` is this limiter.
|
||||||
let is_close = dist_sqrd < 35.0_f32.powi(2);
|
let is_close = dist_sqrd < 35.0_f32.powi(2);
|
||||||
|
@ -1411,7 +1411,7 @@ impl<'a> AgentData<'a> {
|
|||||||
const MINION_SUMMON_THRESHOLD: f32 = 0.20;
|
const MINION_SUMMON_THRESHOLD: f32 = 0.20;
|
||||||
let health_fraction = self.health.map_or(0.5, |h| h.fraction());
|
let health_fraction = self.health.map_or(0.5, |h| h.fraction());
|
||||||
// Sets counter at start of combat, using `condition` to keep track of whether
|
// Sets counter at start of combat, using `condition` to keep track of whether
|
||||||
// it was already intitialized
|
// it was already initialized
|
||||||
if !agent.action_state.condition {
|
if !agent.action_state.condition {
|
||||||
agent.action_state.counter = 1.0 - MINION_SUMMON_THRESHOLD;
|
agent.action_state.counter = 1.0 - MINION_SUMMON_THRESHOLD;
|
||||||
agent.action_state.condition = true;
|
agent.action_state.condition = true;
|
||||||
@ -2152,7 +2152,7 @@ impl<'a> AgentData<'a> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Sets counter at start of combat, using `condition` to keep track of whether
|
// Sets counter at start of combat, using `condition` to keep track of whether
|
||||||
// it was already intitialized
|
// it was already initialized
|
||||||
if !agent.action_state.condition {
|
if !agent.action_state.condition {
|
||||||
agent.action_state.counter = 1.0 - MINION_SUMMON_THRESHOLD;
|
agent.action_state.counter = 1.0 - MINION_SUMMON_THRESHOLD;
|
||||||
agent.action_state.condition = true;
|
agent.action_state.condition = true;
|
||||||
|
@ -71,7 +71,7 @@ impl AttackData {
|
|||||||
|
|
||||||
#[derive(Eq, PartialEq)]
|
#[derive(Eq, PartialEq)]
|
||||||
// When adding a new variant, first decide if it should instead fall under one
|
// When adding a new variant, first decide if it should instead fall under one
|
||||||
// of the pre-exisitng tactics
|
// of the pre-existing tactics
|
||||||
pub enum Tactic {
|
pub enum Tactic {
|
||||||
// General tactics
|
// General tactics
|
||||||
SimpleMelee,
|
SimpleMelee,
|
||||||
|
@ -46,11 +46,11 @@ impl Animation for IdleAnimation {
|
|||||||
let breathe = if s_a.beast {
|
let breathe = if s_a.beast {
|
||||||
// Controls for the beast breathing
|
// Controls for the beast breathing
|
||||||
let intensity = 0.04;
|
let intensity = 0.04;
|
||||||
let lenght = 1.5;
|
let length = 1.5;
|
||||||
let chop = 0.2;
|
let chop = 0.2;
|
||||||
let chop_freq = 60.0;
|
let chop_freq = 60.0;
|
||||||
intensity * (lenght * anim_time).sin()
|
intensity * (length * anim_time).sin()
|
||||||
+ 0.05 * chop * (anim_time * chop_freq).sin() * (anim_time * lenght).cos()
|
+ 0.05 * chop * (anim_time * chop_freq).sin() * (anim_time * length).cos()
|
||||||
} else {
|
} else {
|
||||||
0.0
|
0.0
|
||||||
};
|
};
|
||||||
|
@ -59,7 +59,7 @@ impl Animation for DashAnimation {
|
|||||||
let speedmult = 0.8;
|
let speedmult = 0.8;
|
||||||
let lab: f32 = 0.6; //6
|
let lab: f32 = 0.6; //6
|
||||||
|
|
||||||
// acc_vel and anim_time mix to make sure phase lenght isn't starting at
|
// acc_vel and anim_time mix to make sure phase length isn't starting at
|
||||||
// +infinite
|
// +infinite
|
||||||
let mixed_vel = acc_vel + anim_time * 5.0; //sets run frequency using speed, with anim_time setting a floor
|
let mixed_vel = acc_vel + anim_time * 5.0; //sets run frequency using speed, with anim_time setting a floor
|
||||||
|
|
||||||
|
@ -53,12 +53,12 @@ fn compare_lang_with_reference(
|
|||||||
i18n_references: &RawLanguage<LocalizationEntryState>,
|
i18n_references: &RawLanguage<LocalizationEntryState>,
|
||||||
repo: &git2::Repository,
|
repo: &git2::Repository,
|
||||||
) {
|
) {
|
||||||
// git graph decendent of is slow, so we cache it
|
// git graph descendant of is slow, so we cache it
|
||||||
let mut graph_decendent_of_cache = HashMap::new();
|
let mut graph_descendant_of_cache = HashMap::new();
|
||||||
|
|
||||||
let mut cached_graph_descendant_of = |commit, ancestor| -> bool {
|
let mut cached_graph_descendant_of = |commit, ancestor| -> bool {
|
||||||
let key = (commit, ancestor);
|
let key = (commit, ancestor);
|
||||||
match graph_decendent_of_cache.entry(key) {
|
match graph_descendant_of_cache.entry(key) {
|
||||||
Entry::Occupied(entry) => {
|
Entry::Occupied(entry) => {
|
||||||
return *entry.get();
|
return *entry.get();
|
||||||
},
|
},
|
||||||
|
@ -35,7 +35,7 @@ pub struct Art {
|
|||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub modifications: String,
|
pub modifications: String,
|
||||||
/// Any additional attribution notes that may be desired and/or required by
|
/// Any additional attribution notes that may be desired and/or required by
|
||||||
/// the respactive license that can't be conveyed or would be awkward to
|
/// the respective license that can't be conveyed or would be awkward to
|
||||||
/// convey with the other provided fields.
|
/// convey with the other provided fields.
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub notes: String,
|
pub notes: String,
|
||||||
@ -45,7 +45,7 @@ pub struct Art {
|
|||||||
pub struct Contributor {
|
pub struct Contributor {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
/// Short note or description of the contributions
|
/// Short note or description of the contributions
|
||||||
/// Optional, can be left empty/ommitted
|
/// Optional, can be left empty/omitted
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub contributions: String,
|
pub contributions: String,
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ pub struct State {
|
|||||||
ids: Ids,
|
ids: Ids,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::enum_variant_names)] //think about renaming to ToogleEvent
|
#[allow(clippy::enum_variant_names)] //think about renaming to ToggleEvent
|
||||||
pub enum Event {
|
pub enum Event {
|
||||||
ToggleBag,
|
ToggleBag,
|
||||||
ToggleSettings,
|
ToggleSettings,
|
||||||
|
@ -883,7 +883,7 @@ mod tests {
|
|||||||
Ok(("say".to_string(), vec!["Hello World".to_string()]));
|
Ok(("say".to_string(), vec!["Hello World".to_string()]));
|
||||||
assert_eq!(parse_cmd(r#"say "Hello World""#), expected);
|
assert_eq!(parse_cmd(r#"say "Hello World""#), expected);
|
||||||
|
|
||||||
// Note: \n in the exptected gets expanded by rust to a newline character, thats
|
// Note: \n in the expected gets expanded by rust to a newline character, that's
|
||||||
// why we must not use a raw string in the expected
|
// why we must not use a raw string in the expected
|
||||||
let expected: Result<(String, Vec<String>), String> =
|
let expected: Result<(String, Vec<String>), String> =
|
||||||
Ok(("say".to_string(), vec!["Hello\nWorld".to_string()]));
|
Ok(("say".to_string(), vec!["Hello\nWorld".to_string()]));
|
||||||
|
@ -274,14 +274,14 @@ pub struct State {
|
|||||||
enum SearchFilter {
|
enum SearchFilter {
|
||||||
None,
|
None,
|
||||||
Input,
|
Input,
|
||||||
Nonexistant,
|
Nonexistent,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SearchFilter {
|
impl SearchFilter {
|
||||||
fn parse_from_str(string: &str) -> Self {
|
fn parse_from_str(string: &str) -> Self {
|
||||||
match string {
|
match string {
|
||||||
"input" => Self::Input,
|
"input" => Self::Input,
|
||||||
_ => Self::Nonexistant,
|
_ => Self::Nonexistent,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -581,7 +581,7 @@ impl<'a> Widget for Crafting<'a> {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
SearchFilter::Nonexistant => false,
|
SearchFilter::Nonexistent => false,
|
||||||
})
|
})
|
||||||
.map(|(name, recipe)| {
|
.map(|(name, recipe)| {
|
||||||
let has_materials = self.client.available_recipes().get(name.as_str()).is_some();
|
let has_materials = self.client.available_recipes().get(name.as_str()).is_some();
|
||||||
@ -612,7 +612,7 @@ impl<'a> Widget for Crafting<'a> {
|
|||||||
// TODO: Get input filtering to work here, probably requires
|
// TODO: Get input filtering to work here, probably requires
|
||||||
// checking component recipe book?
|
// checking component recipe book?
|
||||||
SearchFilter::Input => false,
|
SearchFilter::Input => false,
|
||||||
SearchFilter::Nonexistant => false,
|
SearchFilter::Nonexistent => false,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.map(|(recipe_name, (recipe, _))| {
|
.map(|(recipe_name, (recipe, _))| {
|
||||||
|
@ -1125,7 +1125,7 @@ impl<'a> Widget for Interface<'a> {
|
|||||||
.color(TEXT_COLOR)
|
.color(TEXT_COLOR)
|
||||||
.set(state.ids.experience_numbers_title, ui);
|
.set(state.ids.experience_numbers_title, ui);
|
||||||
|
|
||||||
// Acuumulate Experience Gained
|
// Accumulate Experience Gained
|
||||||
let accum_experience = ToggleButton::new(
|
let accum_experience = ToggleButton::new(
|
||||||
self.global_state.settings.interface.accum_experience,
|
self.global_state.settings.interface.accum_experience,
|
||||||
self.imgs.checkbox,
|
self.imgs.checkbox,
|
||||||
|
@ -12,7 +12,7 @@ impl<T: Copy + Pod> Consts<T> {
|
|||||||
/// Create a new `Const<T>`.
|
/// Create a new `Const<T>`.
|
||||||
pub fn new(device: &wgpu::Device, len: usize) -> Self {
|
pub fn new(device: &wgpu::Device, len: usize) -> Self {
|
||||||
Self {
|
Self {
|
||||||
// TODO: examine if all our consts need to be updateable
|
// TODO: examine if all our consts need to be updatable
|
||||||
buf: DynamicBuffer::new(device, len, wgpu::BufferUsage::UNIFORM),
|
buf: DynamicBuffer::new(device, len, wgpu::BufferUsage::UNIFORM),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -214,7 +214,7 @@ impl BloomPipelines {
|
|||||||
dst_factor: wgpu::BlendFactor::One,
|
dst_factor: wgpu::BlendFactor::One,
|
||||||
operation: wgpu::BlendOperation::Add,
|
operation: wgpu::BlendOperation::Add,
|
||||||
},
|
},
|
||||||
// We don't reaaly use this but we need something here..
|
// We don't really use this but we need something here..
|
||||||
alpha: wgpu::BlendComponent::REPLACE,
|
alpha: wgpu::BlendComponent::REPLACE,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
@ -31,7 +31,7 @@ impl VertexTrait for Vertex {
|
|||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Copy, Clone, Debug, Zeroable, Pod)]
|
#[derive(Copy, Clone, Debug, Zeroable, Pod)]
|
||||||
pub struct Locals {
|
pub struct Locals {
|
||||||
/// pos is [f32; 4] instead of [f32; 3] so that Locals's size is a multiple
|
/// pos is [f32; 4] instead of [f32; 3] so that Locals' size is a multiple
|
||||||
/// of 8 bytes (which is required by gfx), the last component is ignored
|
/// of 8 bytes (which is required by gfx), the last component is ignored
|
||||||
/// by the shader
|
/// by the shader
|
||||||
pub pos: [f32; 4],
|
pub pos: [f32; 4],
|
||||||
|
@ -23,7 +23,7 @@ use {common_base::span, egui_wgpu_backend::ScreenDescriptor, egui_winit_platform
|
|||||||
enum Pipelines<'frame> {
|
enum Pipelines<'frame> {
|
||||||
Interface(&'frame super::InterfacePipelines),
|
Interface(&'frame super::InterfacePipelines),
|
||||||
All(&'frame super::Pipelines),
|
All(&'frame super::Pipelines),
|
||||||
// Should never be in this state for now but we need this to accound for super::State::Nothing
|
// Should never be in this state for now but we need this to account for super::State::Nothing
|
||||||
None,
|
None,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ impl<'frame> Pipelines<'frame> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Borrow the fields we need from the renderer so that the GpuProfiler can be
|
// Borrow the fields we need from the renderer so that the GpuProfiler can be
|
||||||
// disjointly borrowed mutably
|
// disjointedly borrowed mutably
|
||||||
struct RendererBorrow<'frame> {
|
struct RendererBorrow<'frame> {
|
||||||
queue: &'frame wgpu::Queue,
|
queue: &'frame wgpu::Queue,
|
||||||
device: &'frame wgpu::Device,
|
device: &'frame wgpu::Device,
|
||||||
@ -371,7 +371,7 @@ impl<'frame> Drawer<'frame> {
|
|||||||
label,
|
label,
|
||||||
&bloom_pipelines.upsample,
|
&bloom_pipelines.upsample,
|
||||||
if index + 2 == bloom::NUM_SIZES {
|
if index + 2 == bloom::NUM_SIZES {
|
||||||
// Clear for the final image since that is just stuff from the pervious frame.
|
// Clear for the final image since that is just stuff from the previous frame.
|
||||||
wgpu::LoadOp::Clear(wgpu::Color::TRANSPARENT)
|
wgpu::LoadOp::Clear(wgpu::Color::TRANSPARENT)
|
||||||
} else {
|
} else {
|
||||||
// Add to less blurred images to get gradient of blur instead of a smudge>
|
// Add to less blurred images to get gradient of blur instead of a smudge>
|
||||||
|
@ -242,11 +242,11 @@ fn clamp_and_modulate(ori: Vec3<f32>) -> Vec3<f32> {
|
|||||||
/// though the logic for why it should be okay to pass them directly is probably
|
/// though the logic for why it should be okay to pass them directly is probably
|
||||||
/// sound (they are both valid z values in the range, so gl_FragCoord.w will be
|
/// sound (they are both valid z values in the range, so gl_FragCoord.w will be
|
||||||
/// assigned to this, meaning if they are imprecise enough then the whole
|
/// assigned to this, meaning if they are imprecise enough then the whole
|
||||||
/// calculation will be similarly imprecies).
|
/// calculation will be similarly imprecise).
|
||||||
///
|
///
|
||||||
/// TODO: Since it's a bit confusing that n and f are not always near and far,
|
/// TODO: Since it's a bit confusing that n and f are not always near and far,
|
||||||
/// and a negative near plane can (probably) be emulated with simple actions on
|
/// and a negative near plane can (probably) be emulated with simple actions on
|
||||||
/// the perspective matrix, consider removing this functionailty and replacing
|
/// the perspective matrix, consider removing this functionality and replacing
|
||||||
/// our assertion with a single condition: `(1/far) * (1/near) < (1/near)²`.
|
/// our assertion with a single condition: `(1/far) * (1/near) < (1/near)²`.
|
||||||
pub fn perspective_lh_zo_general<T>(
|
pub fn perspective_lh_zo_general<T>(
|
||||||
fov_y_radians: T,
|
fov_y_radians: T,
|
||||||
@ -381,8 +381,8 @@ impl Camera {
|
|||||||
Vec3::new(0.0, 0.0, -1.0),
|
Vec3::new(0.0, 0.0, -1.0),
|
||||||
Vec3::new(0.0, 0.0, 1.0),
|
Vec3::new(0.0, 0.0, 1.0),
|
||||||
];
|
];
|
||||||
// Calculate new frustom location as there may have been lerp towards tgt_dist
|
// Calculate new frustum location as there may have been lerp towards tgt_dist
|
||||||
// Without this, there will be camera jumpig back and forth in some scenarios
|
// Without this, there will be camera jumping back and forth in some scenarios
|
||||||
// TODO: Optimize and fix clipping still happening if self.dist << self.tgt_dist
|
// TODO: Optimize and fix clipping still happening if self.dist << self.tgt_dist
|
||||||
|
|
||||||
// Use tgt_dist, as otherwise we end up in loop due to dist depending on frustum
|
// Use tgt_dist, as otherwise we end up in loop due to dist depending on frustum
|
||||||
@ -703,7 +703,7 @@ impl Camera {
|
|||||||
|
|
||||||
/// Get the mode of the camera
|
/// Get the mode of the camera
|
||||||
pub fn get_mode(&self) -> CameraMode {
|
pub fn get_mode(&self) -> CameraMode {
|
||||||
// Perfom a bit of a trick... don't report first-person until the camera has
|
// Perform a bit of a trick... don't report first-person until the camera has
|
||||||
// lerped close enough to the player.
|
// lerped close enough to the player.
|
||||||
match self.mode {
|
match self.mode {
|
||||||
CameraMode::FirstPerson if self.dist < 0.5 => CameraMode::FirstPerson,
|
CameraMode::FirstPerson if self.dist < 0.5 => CameraMode::FirstPerson,
|
||||||
|
@ -111,8 +111,8 @@ impl DebugShape {
|
|||||||
// stretch to radius
|
// stretch to radius
|
||||||
let a = a * *radius;
|
let a = a * *radius;
|
||||||
// rotate to 90 degrees to get needed shift
|
// rotate to 90 degrees to get needed shift
|
||||||
let ortoghonal = Quaternion::rotation_z(PI / 2.0);
|
let orthogonal = Quaternion::rotation_z(PI / 2.0);
|
||||||
let shift = ortoghonal * a;
|
let shift = orthogonal * a;
|
||||||
|
|
||||||
// bottom points
|
// bottom points
|
||||||
let a0 = p0 + shift;
|
let a0 = p0 + shift;
|
||||||
|
@ -152,7 +152,7 @@ impl Lod {
|
|||||||
self.zone_objects
|
self.zone_objects
|
||||||
.retain(|p, _| client.lod_zones().contains_key(p));
|
.retain(|p, _| client.lod_zones().contains_key(p));
|
||||||
|
|
||||||
// Determine visiblity of zones based on view frustum
|
// Determine visibility of zones based on view frustum
|
||||||
let camera::Dependents {
|
let camera::Dependents {
|
||||||
view_mat,
|
view_mat,
|
||||||
proj_mat_treeculler,
|
proj_mat_treeculler,
|
||||||
|
@ -98,7 +98,7 @@ impl ExportVol {
|
|||||||
// File format defined at https://github.com/ephtracy/voxel-model
|
// File format defined at https://github.com/ephtracy/voxel-model
|
||||||
|
|
||||||
fn write_i32(file: &mut File, value: i32) -> Result {
|
fn write_i32(file: &mut File, value: i32) -> Result {
|
||||||
// The spec doesn't specify endianess?!?
|
// The spec doesn't specify endianness?!?
|
||||||
file.write_all(&value.to_le_bytes())
|
file.write_all(&value.to_le_bytes())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ impl<'a> Canvas<'a> {
|
|||||||
|
|
||||||
/// Blit a structure on to the canvas at the given position.
|
/// Blit a structure on to the canvas at the given position.
|
||||||
///
|
///
|
||||||
/// Note that this function should be called with identitical parameters by
|
/// Note that this function should be called with identical parameters by
|
||||||
/// all chunks within the bounds of the structure to avoid cut-offs
|
/// all chunks within the bounds of the structure to avoid cut-offs
|
||||||
/// occurring at chunk borders. Deterministic RNG is advised!
|
/// occurring at chunk borders. Deterministic RNG is advised!
|
||||||
pub fn blit_structure(
|
pub fn blit_structure(
|
||||||
|
@ -1119,7 +1119,7 @@ fn erode(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
debug!(
|
debug!(
|
||||||
"(Done precomputation, time={:?}ms).",
|
"(Done pre-computation, time={:?}ms).",
|
||||||
start_time.elapsed().as_millis()
|
start_time.elapsed().as_millis()
|
||||||
);
|
);
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
|
@ -1331,7 +1331,7 @@ impl Floor {
|
|||||||
sprites.push((floor_sprite, floor_sprite_fill.clone()));
|
sprites.push((floor_sprite, floor_sprite_fill.clone()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Place a glowing purple septagonal star inscribed in a circle in the boss room
|
// Place a glowing purple heptagonal star inscribed in a circle in the boss room
|
||||||
if let Some(boss_room_center) = boss_room_center {
|
if let Some(boss_room_center) = boss_room_center {
|
||||||
let magic_circle_bb = painter.prim(Primitive::Cylinder(Aabb {
|
let magic_circle_bb = painter.prim(Primitive::Cylinder(Aabb {
|
||||||
min: (boss_room_center - 3 * Vec2::broadcast(TILE_SIZE) / 2).with_z(floor_z - 1),
|
min: (boss_room_center - 3 * Vec2::broadcast(TILE_SIZE) / 2).with_z(floor_z - 1),
|
||||||
@ -1346,7 +1346,7 @@ impl Floor {
|
|||||||
|
|
||||||
// Place pillars and pillar lights facing the pillars
|
// Place pillars and pillar lights facing the pillars
|
||||||
for (pos, pillar, lights) in pillars.iter() {
|
for (pos, pillar, lights) in pillars.iter() {
|
||||||
// Avoid placing pillars that would cover the septagonal star
|
// Avoid placing pillars that would cover the heptagonal star
|
||||||
if let Some(boss_room_center) = boss_room_center {
|
if let Some(boss_room_center) = boss_room_center {
|
||||||
if pos.distance_squared(boss_room_center) < (3 * TILE_SIZE / 2).pow(2) {
|
if pos.distance_squared(boss_room_center) < (3 * TILE_SIZE / 2).pow(2) {
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user