mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Make action durations constants
This commit is contained in:
parent
869535e5a2
commit
72564cf8b4
@ -8,6 +8,9 @@ use specs::{Entities, Join, Read, ReadStorage, System, WriteStorage};
|
||||
use std::time::Duration;
|
||||
use vek::*;
|
||||
|
||||
pub const WIELD_DURATION: Duration = Duration::from_millis(300);
|
||||
pub const ATTACK_DURATION: Duration = Duration::from_millis(300);
|
||||
|
||||
const BASE_DMG: i32 = 10;
|
||||
const BLOCK_EFFICIENCY: f32 = 0.9;
|
||||
|
||||
|
@ -1,3 +1,7 @@
|
||||
use super::{
|
||||
combat::{ATTACK_DURATION, WIELD_DURATION},
|
||||
movement::ROLL_DURATION,
|
||||
};
|
||||
use crate::{
|
||||
comp::{
|
||||
ActionState::*, Body, CharacterState, Controller, MovementState::*, PhysicsState, Stats,
|
||||
@ -97,7 +101,7 @@ impl<'a> System<'a> for Sys {
|
||||
&& (character.movement == Stand || character.movement == Run)
|
||||
{
|
||||
character.action = Wield {
|
||||
time_left: Duration::from_millis(300),
|
||||
time_left: WIELD_DURATION,
|
||||
};
|
||||
}
|
||||
|
||||
@ -111,7 +115,7 @@ impl<'a> System<'a> for Sys {
|
||||
if let Wield { time_left } = character.action {
|
||||
if time_left == Duration::default() {
|
||||
character.action = Attack {
|
||||
time_left: Duration::from_millis(300),
|
||||
time_left: ATTACK_DURATION,
|
||||
applied: false,
|
||||
};
|
||||
}
|
||||
@ -137,7 +141,7 @@ impl<'a> System<'a> for Sys {
|
||||
&& physics.on_ground
|
||||
{
|
||||
character.movement = Roll {
|
||||
time_left: Duration::from_millis(600),
|
||||
time_left: ROLL_DURATION,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,8 @@ use specs::{Entities, Join, Read, ReadExpect, ReadStorage, System, WriteStorage}
|
||||
use std::time::Duration;
|
||||
use vek::*;
|
||||
|
||||
pub const ROLL_DURATION: Duration = Duration::from_millis(600);
|
||||
|
||||
const HUMANOID_ACCEL: f32 = 70.0;
|
||||
const HUMANOID_SPEED: f32 = 120.0;
|
||||
const WIELD_ACCEL: f32 = 70.0;
|
||||
|
Loading…
Reference in New Issue
Block a user