Merge branch 'timo-components' into 'master'

Better component states

See merge request veloren/veloren!458
This commit is contained in:
Timo Koesters 2019-08-26 15:47:43 +00:00
commit e5413360b6
36 changed files with 1089 additions and 767 deletions

251
Cargo.lock generated
View File

@ -123,12 +123,12 @@ dependencies = [
[[package]]
name = "autocfg"
version = "0.1.5"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "backtrace"
version = "0.3.34"
version = "0.3.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"backtrace-sys 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
@ -159,9 +159,9 @@ name = "bincode"
version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -194,7 +194,7 @@ dependencies = [
"clang-sys 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)",
"clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -220,12 +220,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "blake2b_simd"
version = "0.5.6"
version = "0.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
"constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -248,7 +248,7 @@ name = "c2-chacha"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -372,7 +372,7 @@ dependencies = [
"bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -459,7 +459,7 @@ source = "git+https://gitlab.com/veloren/conrod.git#d603363488870eae9df91ba45ba7
[[package]]
name = "constant_time_eq"
version = "0.1.3"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@ -540,7 +540,7 @@ dependencies = [
"alsa-sys 0.1.1 (git+https://github.com/desttinghim/cpal?rev=e7c086d0afc368a888ad133c3b1d928b16986130)",
"core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"coreaudio-rs 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",
"stdweb 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
@ -633,7 +633,7 @@ dependencies = [
"arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"crossbeam-utils 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -646,7 +646,7 @@ dependencies = [
"arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -659,7 +659,7 @@ dependencies = [
"arrayvec 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -683,7 +683,7 @@ version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -775,7 +775,7 @@ version = "4.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -832,7 +832,7 @@ name = "euc"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"vek 0.9.8 (registry+https://github.com/rust-lang/crates.io-index)",
"vek 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -859,7 +859,7 @@ name = "failure"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"backtrace 0.3.34 (registry+https://github.com/rust-lang/crates.io-index)",
"backtrace 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)",
"failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1025,7 +1025,7 @@ dependencies = [
[[package]]
name = "getrandom"
version = "0.1.9"
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1111,7 +1111,7 @@ dependencies = [
"glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1139,7 +1139,7 @@ dependencies = [
[[package]]
name = "gl_generator"
version = "0.13.0"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"khronos_api 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1152,7 +1152,7 @@ name = "gleam"
version = "0.6.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gl_generator 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gl_generator 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -1163,7 +1163,7 @@ dependencies = [
"bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1187,7 +1187,7 @@ name = "glsl-include"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1207,7 +1207,7 @@ dependencies = [
"glutin_gles2_sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin_glx_sys 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin_wgl_sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
"objc 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"osmesa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1287,7 +1287,7 @@ dependencies = [
"glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gtk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",
"pango 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1324,7 +1324,7 @@ name = "hashbrown"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -1362,7 +1362,7 @@ dependencies = [
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"enum_primitive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"gif 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
"jpeg-decoder 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
"jpeg-decoder 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
"num-iter 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
"num-rational 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1377,7 +1377,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"gif 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
"jpeg-decoder 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
"jpeg-decoder 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
"lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"num-iter 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
"num-rational 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1442,7 +1442,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "jpeg-decoder"
version = "0.1.15"
version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1470,7 +1470,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "lazy_static"
version = "1.3.0"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@ -1499,7 +1499,7 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1639,7 +1639,7 @@ dependencies = [
[[package]]
name = "minifb"
version = "0.12.0"
source = "git+https://github.com/emoon/rust_minifb.git#85459c8b437568e56331378532aa706fbbb5343d"
source = "git+https://github.com/emoon/rust_minifb.git#e20257db793bef59d62abe29dcd9b5408dd1f20d"
dependencies = [
"cast 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1713,7 +1713,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "msgbox"
version = "0.1.1"
source = "git+https://github.com/bekker/msgbox-rs.git#cff1e50e6e2de971a6995d9ce062d5e394a45d45"
source = "git+https://github.com/bekker/msgbox-rs.git#3310a258ac49d6c0b6eb1a6c71a6361eddb28a57"
dependencies = [
"cocoa 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gtk 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1838,7 +1838,7 @@ name = "num-complex"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1857,7 +1857,7 @@ name = "num-integer"
version = "0.1.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1866,7 +1866,7 @@ name = "num-iter"
version = "0.1.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1885,7 +1885,7 @@ name = "num-rational"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"num-bigint 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1904,7 +1904,7 @@ name = "num-traits"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -2146,8 +2146,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"piston-viewport 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -2192,7 +2192,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "pretty_env_logger"
version = "0.3.0"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2216,6 +2216,14 @@ dependencies = [
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "proc-macro2"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "quasi"
version = "0.32.0"
@ -2257,6 +2265,14 @@ dependencies = [
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "quote"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand"
version = "0.3.23"
@ -2295,7 +2311,7 @@ name = "rand"
version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2313,7 +2329,7 @@ name = "rand"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"getrandom 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"getrandom 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2325,7 +2341,7 @@ name = "rand_chacha"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -2356,7 +2372,7 @@ name = "rand_core"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"getrandom 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"getrandom 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -2411,7 +2427,7 @@ name = "rand_pcg"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -2441,7 +2457,7 @@ dependencies = [
"crossbeam-deque 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
"crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -2515,7 +2531,7 @@ dependencies = [
"claxon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"cpal 0.8.2 (git+https://github.com/desttinghim/cpal?rev=e7c086d0afc368a888ad133c3b1d928b16986130)",
"hound 3.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lewton 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)",
"minimp3 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -2527,7 +2543,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -2536,7 +2552,7 @@ version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"blake2b_simd 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"blake2b_simd 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)",
"crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -2624,7 +2640,7 @@ version = "0.32.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",
"num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2655,20 +2671,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "serde"
version = "1.0.98"
version = "1.0.99"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "serde_derive"
version = "1.0.98"
version = "1.0.99"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -2678,7 +2694,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
"ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -2686,7 +2702,7 @@ name = "shared_library"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -2755,7 +2771,7 @@ dependencies = [
"andrew 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-client 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2776,7 +2792,7 @@ dependencies = [
"mopa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"nonzero_signed 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)",
"shred 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
"shred-derive 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"shrev 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2797,8 +2813,8 @@ name = "sphynx"
version = "0.1.0"
source = "git+https://gitlab.com/veloren/sphynx.git?rev=11cdc7422568aaabd376c87242a60f636e68b40d#11cdc7422568aaabd376c87242a60f636e68b40d"
dependencies = [
"serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)",
"shred 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
"specs 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)",
"sum_type 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2852,6 +2868,16 @@ dependencies = [
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "syn"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "synstructure"
version = "0.10.2"
@ -2929,7 +2955,7 @@ name = "termcolor"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"wincolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -2937,7 +2963,7 @@ name = "textwrap"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -2945,7 +2971,7 @@ name = "thread_local"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -2981,7 +3007,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "unicode-width"
version = "0.1.5"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@ -2994,6 +3020,11 @@ name = "unicode-xid"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "unicode-xid"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "user32-sys"
version = "0.2.0"
@ -3025,14 +3056,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "vek"
version = "0.9.8"
version = "0.9.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"approx 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)",
"static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -3041,7 +3072,7 @@ name = "veloren-chat-cli"
version = "0.3.0"
dependencies = [
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"pretty_env_logger 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pretty_env_logger 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"veloren-client 0.3.0",
"veloren-common 0.3.0",
]
@ -3055,7 +3086,7 @@ dependencies = [
"num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"specs 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)",
"uvth 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"vek 0.9.8 (registry+https://github.com/rust-lang/crates.io-index)",
"vek 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
"veloren-common 0.3.0",
]
@ -3069,7 +3100,7 @@ dependencies = [
"find_folder 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"hashbrown 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.22.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"lz4-compress 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)",
@ -3078,13 +3109,13 @@ dependencies = [
"parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)",
"specs 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)",
"specs-idvs 0.1.0 (git+https://gitlab.com/veloren/specs-idvs.git)",
"sphynx 0.1.0 (git+https://gitlab.com/veloren/sphynx.git?rev=11cdc7422568aaabd376c87242a60f636e68b40d)",
"vek 0.9.8 (registry+https://github.com/rust-lang/crates.io-index)",
"vek 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -3094,16 +3125,16 @@ dependencies = [
"chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
"crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
"hashbrown 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"scan_fmt 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)",
"specs 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)",
"uvth 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"vek 0.9.8 (registry+https://github.com/rust-lang/crates.io-index)",
"vek 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
"veloren-common 0.3.0",
"veloren-world 0.3.0",
]
@ -3114,7 +3145,7 @@ version = "0.3.0"
dependencies = [
"heaptrack 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"pretty_env_logger 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pretty_env_logger 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"veloren-common 0.3.0",
"veloren-server 0.3.0",
]
@ -3123,7 +3154,7 @@ dependencies = [
name = "veloren-voxygen"
version = "0.3.0"
dependencies = [
"backtrace 0.3.34 (registry+https://github.com/rust-lang/crates.io-index)",
"backtrace 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)",
"conrod_core 0.63.0 (git+https://gitlab.com/veloren/conrod.git)",
"conrod_winit 0.63.0 (git+https://gitlab.com/veloren/conrod.git)",
"crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -3142,7 +3173,7 @@ dependencies = [
"hashbrown 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"heaptrack 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.22.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"msgbox 0.1.1 (git+https://github.com/bekker/msgbox-rs.git)",
"num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -3151,11 +3182,11 @@ dependencies = [
"rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rodio 0.8.1 (git+https://github.com/desttinghim/rodio.git?rev=dd93f905c1afefaac03c496a666ecab27d3e391b)",
"ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)",
"simplelog 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"specs 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)",
"vek 0.9.8 (registry+https://github.com/rust-lang/crates.io-index)",
"vek 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
"veloren-client 0.3.0",
"veloren-common 0.3.0",
"veloren-server 0.3.0",
@ -3167,12 +3198,12 @@ name = "veloren-world"
version = "0.3.0"
dependencies = [
"hashbrown 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"minifb 0.12.0 (git+https://github.com/emoon/rust_minifb.git)",
"noise 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"vek 0.9.8 (registry+https://github.com/rust-lang/crates.io-index)",
"vek 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
"veloren-common 0.3.0",
"zerocopy 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -3253,7 +3284,7 @@ version = "0.21.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -3303,7 +3334,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "wincolor"
version = "1.0.1"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
@ -3316,18 +3347,18 @@ version = "0.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"android_glue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"backtrace 0.3.34 (registry+https://github.com/rust-lang/crates.io-index)",
"backtrace 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cocoa 0.18.4 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"core-graphics 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"objc 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)",
"smithay-client-toolkit 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"wayland-client 0.21.13 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
@ -3348,7 +3379,7 @@ name = "x11-dl"
version = "2.18.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)",
"maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
@ -3400,8 +3431,8 @@ dependencies = [
"checksum atk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8dc233521f7bffd3042c31082ea71bd08820abf44bac938fb36591e20f76f39"
"checksum atom 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3c86699c3f02778ec07158376991c8f783dd1f2f95c579ffaf0738dc984b2fe2"
"checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90"
"checksum autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "22130e92352b948e7e82a49cdb0aa94f2211761117f29e052dd397c1ac33542b"
"checksum backtrace 0.3.34 (registry+https://github.com/rust-lang/crates.io-index)" = "b5164d292487f037ece34ec0de2fcede2faa162f085dd96d2385ab81b12765ba"
"checksum autocfg 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b671c8fb71b457dd4ae18c4ba1e59aa81793daacc361d82fcd410cef0d491875"
"checksum backtrace 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)" = "1371048253fa3bac6704bfd6bbfc922ee9bdcee8881330d40f308b81cc5adc55"
"checksum backtrace-sys 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "82a830b4ef2d1124a711c71d263c5abdc710ef8e907bd508c88be475cebc422b"
"checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e"
"checksum bincode 1.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9f04a5e50dc80b3d5d35320889053637d15011aed5e66b66b37ae798c65da6f7"
@ -3410,7 +3441,7 @@ dependencies = [
"checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4"
"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5"
"checksum bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d155346769a6855b86399e9bc3814ab343cd3d62c7e985113d46a0ec3c281fd"
"checksum blake2b_simd 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "461f4b879a8eb70c1debf7d0788a9a5ff15f1ea9d25925fea264ef4258bed6b2"
"checksum blake2b_simd 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bf775a81bb2d464e20ff170ac20316c7b08a43d11dbc72f0f82e8e8d3d6d0499"
"checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
"checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855"
"checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5"
@ -3438,7 +3469,7 @@ dependencies = [
"checksum conrod_core 0.63.0 (git+https://gitlab.com/veloren/conrod.git)" = "<none>"
"checksum conrod_derive 0.63.0 (git+https://gitlab.com/veloren/conrod.git)" = "<none>"
"checksum conrod_winit 0.63.0 (git+https://gitlab.com/veloren/conrod.git)" = "<none>"
"checksum constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e"
"checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120"
"checksum core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "286e0b41c3a20da26536c6000a280585d519fd07b3956b43aed8a79e9edce980"
"checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d"
"checksum core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "716c271e8613ace48344f723b60b900a93150271e5be206212d052bbc0883efa"
@ -3500,7 +3531,7 @@ dependencies = [
"checksum gdk-pixbuf 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c2d2199eba47ebcb9977ce28179649bdd59305ef465c4e6f9b65aaa41c24e6b5"
"checksum gdk-pixbuf-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df6a3b73e04fafc07f5ebc083f1096a773412e627828e1103a55e921f81187d8"
"checksum gdk-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3162ff940526ddff71bf1f630facee6b5e05d282d125ba0c4c803842819b80c3"
"checksum getrandom 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "2512b3191f22e2763a5db387f1c9409379772e2050841722eb4a8c4f497bf096"
"checksum getrandom 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "fc344b02d3868feb131e8b5fe2b9b0a1cc42942679af493061fc13b853243872"
"checksum gfx 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)" = "619e38a31e275efaf92c6a94f977db8aac396e3cb6998c176cfde32ce3239b69"
"checksum gfx_core 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4e1127b02a9d4fcc880091d8a0f4419efd598de4f1649edcd005c76e5792176f"
"checksum gfx_device_gl 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3fdb9c21d057f32d5a9fc7b8737a28e09a93006a095e0a129723b424cffd2003"
@ -3511,7 +3542,7 @@ dependencies = [
"checksum gio 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2db9fad8f1b0d4c7338a210a6cbdf081dcc1a3c223718c698c4f313f6c288acb"
"checksum gio-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2a57872499171d279f8577ce83837da4cae62b08dd32892236ed67ab7ea61030"
"checksum gl_generator 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "39a23d5e872a275135d66895d954269cf5e8661d234eb1c2480f4ce0d586acbd"
"checksum gl_generator 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1c08ca9be9c177722189cd6a956c9e604563a9c689587b548a8cd7d1d865b022"
"checksum gl_generator 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ca98bbde17256e02d17336a6bdb5a50f7d0ccacee502e191d3e3d0ec2f96f84a"
"checksum gleam 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)" = "cae10d7c99d0e77b4766e850a60898a17c1abaf01075531f1066f03dc7dc5fc5"
"checksum glib 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5e0be1b1432e227bcd1a9b28db9dc1474a7e7fd4227e08e16f35304f32d09b61"
"checksum glib-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "615bef979b5838526aee99241afc80cfb2e34a8735d4bcb8ec6072598c18a408"
@ -3541,11 +3572,11 @@ dependencies = [
"checksum instant 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d6706e8fb9de9be6143801a75747fa2209855b13d74ee994e30d86b38afdf77f"
"checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08"
"checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f"
"checksum jpeg-decoder 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "c8b7d43206b34b3f94ea9445174bda196e772049b9bddbc620c9d29b2d20110d"
"checksum jpeg-decoder 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "c1aae18ffeeae409c6622c3b6a7ee49792a7e5a062eea1b135fbb74e301792ba"
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
"checksum khronos_api 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"
"checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73"
"checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14"
"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
"checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f"
"checksum lewton 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8d542c1a317036c45c2aa1cf10cc9d403ca91eb2d333ef1a4917e5cb10628bd0"
"checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba"
@ -3626,14 +3657,16 @@ dependencies = [
"checksum png 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8422b27bb2c013dd97b9aef69e161ce262236f49aaf46a0489011c8ff0264602"
"checksum portpicker 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5b497d05c16fe00939445c00a4fe2fa4f3d3dfc9c0401a3ab5c577afda2debb9"
"checksum ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e3cbf9f658cdb5000fcf6f362b8ea2ba154b9f146a61c7a20d647034c6b6561b"
"checksum pretty_env_logger 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df8b3f4e0475def7d9c2e5de8e5a1306949849761e107b360d03e98eafaffd61"
"checksum pretty_env_logger 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "717ee476b1690853d222af4634056d830b5197ffd747726a9a1eee6da9f49074"
"checksum proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cd07deb3c6d1d9ff827999c7f9b04cdfd66b1b17ae508e14fe47b620f2282ae0"
"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
"checksum proc-macro2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c5c2380ae88876faae57698be9e9775e3544decad214599c3a6266cca6ac802"
"checksum quasi 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18c45c4854d6d1cf5d531db97c75880feb91c958b0720f4ec1057135fec358b3"
"checksum quasi_codegen 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "51b9e25fa23c044c1803f43ca59c98dac608976dd04ce799411edd58ece776d4"
"checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0"
"checksum quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1eca14c727ad12702eb4b6bfb5a232287dcf8385cb8ca83a3eeaf6519c44c408"
"checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1"
"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe"
"checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c"
"checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293"
"checksum rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9"
@ -3678,8 +3711,8 @@ dependencies = [
"checksum sdl2-sys 0.32.6 (registry+https://github.com/rust-lang/crates.io-index)" = "34e71125077d297d57e4c1acfe8981b5bdfbf5a20e7b589abfdcb33bf1127f86"
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
"checksum serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)" = "7fe5626ac617da2f2d9c48af5515a21d5a480dbd151e01bb1c355e26a3e68113"
"checksum serde_derive 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)" = "01e69e1b8a631f245467ee275b8c757b818653c6d704cdbcaeb56b56767b529c"
"checksum serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)" = "fec2851eb56d010dc9a21b89ca53ee75e6528bab60c11e89d38390904982da9f"
"checksum serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)" = "cb4dc18c61206b08dc98216c98faa0232f4337e1e1b8574551d5bad29ea1b425"
"checksum serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "051c49229f282f7c6f3813f8286cc1e3323e8051823fce42c7ea80fe13521704"
"checksum shared_library 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11"
"checksum shred 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6ea122e6133568144fcfb5888737d4ac776ebc959f989dd65b907136ac22bfed"
@ -3701,6 +3734,7 @@ dependencies = [
"checksum sum_type 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "da5b4a0c9f3c7c8e891e445a7c776627e208e8bba23ab680798066dd283e6a15"
"checksum svg_fmt 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20e5f95e89d737f30cd1f98a9af9a85c2a1cc162cfedfba5a0c54cf92d7206fc"
"checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5"
"checksum syn 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "66850e97125af79138385e9b88339cbcd037e3f28ceab8c5ad98e64f0f1f80bf"
"checksum synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "02353edf96d6e4dc81aea2d8490a7e9db177bf8acb0e951c24940bf866cb313f"
"checksum syntex 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a8f5e3aaa79319573d19938ea38d068056b826db9883a5d47f86c1cecc688f0e"
"checksum syntex_errors 0.58.1 (registry+https://github.com/rust-lang/crates.io-index)" = "867cc5c2d7140ae7eaad2ae9e8bf39cb18a67ca651b7834f88d46ca98faadb9c"
@ -3715,14 +3749,15 @@ dependencies = [
"checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f"
"checksum tuple_utils 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cbfecd7bb8f0a3e96b3b31c46af2677a55a588767c0091f484601424fcb20e7e"
"checksum ucd-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa9b3b49edd3468c0e6565d85783f51af95212b6fa3986a5500954f00b460874"
"checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526"
"checksum unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7007dbd421b92cc6e28410fe7362e2e0a2503394908f417b68ec8d1c364c4e20"
"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"
"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c"
"checksum user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ef4711d107b21b410a3a974b1204d9accc8b10dad75d8324b5d755de1617d47"
"checksum utf8-ranges 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b4ae116fef2b7fea257ed6440d3cfcff7f190865f170cdad00bb6465bf18ecba"
"checksum uvth 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e59a167890d173eb0fcd7a1b99b84dc05c521ae8d76599130b8e19bef287abbf"
"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
"checksum vek 0.9.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1c95e5c5c123ecdb4a1a27a590f053a6c6de4b6ea696f4f0ef99054ead450258"
"checksum vek 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)" = "144a7f53d9cd7d544beba89cf08eaaffd8c22ed24cc92ada7fd04ef904dcdc40"
"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
"checksum walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9658c94fa8b940eab2250bd5a457f9c48b748420d71293b165c8cdbe2f55f71e"
@ -3739,7 +3774,7 @@ dependencies = [
"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
"checksum winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9"
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
"checksum wincolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "561ed901ae465d6185fa7864d63fbd5720d0ef718366c9a4dc83cf6170d7e9ba"
"checksum wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96f5016b18804d24db43cebf3c77269e7569b8954a8464501c216cc5e070eaa9"
"checksum winit 0.19.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd67dc9e0f9e13da393d9b6fa13042f3aed9b2bb2db6717d72d4cc271970c415"
"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
"checksum x11-dl 2.18.4 (registry+https://github.com/rust-lang/crates.io-index)" = "be65e1342a3baae65439cd03306778831a3d133b0d20243a7fb83fd5cf403c58"

View File

@ -11,5 +11,5 @@ uvth = "3.1.1"
num_cpus = "1.10.1"
log = "0.4.8"
specs = "0.14.2"
vek = "0.9.8"
vek = { version = "0.9.9", features = ["serde"] }
hashbrown = { version = "0.5.0", features = ["serde", "nightly"] }

View File

@ -444,12 +444,12 @@ impl Client {
self.state.write_component(entity, ori);
}
}
ServerMsg::EntityActionState {
ServerMsg::EntityCharacterState {
entity,
action_state,
character_state,
} => {
if let Some(entity) = self.state.ecs().entity_from_uid(entity) {
self.state.write_component(entity, action_state);
self.state.write_component(entity, character_state);
}
}
ServerMsg::InventoryUpdate(inventory) => {

View File

@ -9,7 +9,7 @@ sphynx = { git = "https://gitlab.com/veloren/sphynx.git", features = ["serde1"],
specs-idvs = { git = "https://gitlab.com/veloren/specs-idvs.git" }
specs = { version = "0.14.2", features = ["serde", "nightly"] }
vek = { version = "0.9.8", features = ["serde"] }
vek = { version = "0.9.9", features = ["serde"] }
dot_vox = "4.0.0"
image = "0.22.0"
mio = "0.6.19"

View File

@ -188,8 +188,8 @@ impl Asset for String {
}
}
/// Lazy static to find and cache where the asset directory is.
lazy_static! {
/// Lazy static to find and cache where the asset directory is.
static ref ASSETS_PATH: PathBuf = {
let mut paths = Vec::new();

View File

@ -1,29 +0,0 @@
use specs::{Component, FlaggedStorage, HashMapStorage};
use specs_idvs::IDVStorage;
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
pub struct ActionState {
pub moving: bool,
pub on_ground: bool,
pub attacking: bool,
pub rolling: bool,
pub gliding: bool,
pub wielding: bool,
}
impl Default for ActionState {
fn default() -> Self {
Self {
moving: false,
on_ground: false,
attacking: false,
rolling: false,
gliding: false,
wielding: false,
}
}
}
impl Component for ActionState {
type Storage = FlaggedStorage<Self, HashMapStorage<Self>>;
}

View File

@ -8,6 +8,7 @@ pub enum Animation {
Jump,
Gliding,
Attack,
Block,
Roll,
Crun,
Cidle,

View File

@ -0,0 +1,77 @@
use specs::{Component, FlaggedStorage, HashMapStorage};
use specs_idvs::IDVStorage;
use std::time::Duration;
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
pub enum MovementState {
Stand,
Run,
Jump,
Glide,
Roll { time_left: Duration },
//Swim,
}
impl MovementState {
pub fn is_roll(&self) -> bool {
if let Self::Roll { .. } = self {
true
} else {
false
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
pub enum ActionState {
Idle,
Wield { time_left: Duration },
Attack { time_left: Duration, applied: bool },
Block { time_left: Duration },
//Carry,
}
impl ActionState {
pub fn is_wield(&self) -> bool {
if let Self::Wield { .. } = self {
true
} else {
false
}
}
pub fn is_attack(&self) -> bool {
if let Self::Attack { .. } = self {
true
} else {
false
}
}
pub fn is_block(&self) -> bool {
if let Self::Block { .. } = self {
true
} else {
false
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
pub struct CharacterState {
pub movement: MovementState,
pub action: ActionState,
}
impl Default for CharacterState {
fn default() -> Self {
Self {
movement: MovementState::Jump,
action: ActionState::Idle,
}
}
}
impl Component for CharacterState {
type Storage = FlaggedStorage<Self, HashMapStorage<Self>>;
}

View File

@ -5,8 +5,10 @@ use vek::*;
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct Controller {
pub move_dir: Vec2<f32>,
pub look_dir: Vec3<f32>,
pub jump: bool,
pub attack: bool,
pub block: bool,
pub roll: bool,
pub glide: bool,
pub respawn: bool,

View File

@ -2,101 +2,8 @@ use specs::{Component, FlaggedStorage, NullStorage};
use specs_idvs::IDVStorage;
use vek::*;
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
pub struct Respawning;
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct MoveDir(pub Vec2<f32>);
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct Wielding {
pub time: f32,
pub applied: bool,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct Attacking {
pub time: f32,
pub applied: bool,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct Rolling {
pub time: f32,
pub applied: bool,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct OnGround;
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct CanBuild;
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct Jumping;
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct Gliding;
impl Component for Respawning {
type Storage = NullStorage<Self>;
}
impl Wielding {
pub fn start() -> Self {
Self {
time: 0.0,
applied: false,
}
}
}
impl Attacking {
pub fn start() -> Self {
Self {
time: 0.0,
applied: false,
}
}
}
impl Rolling {
pub fn start() -> Self {
Self {
time: 0.0,
applied: false,
}
}
}
impl Component for MoveDir {
type Storage = IDVStorage<Self>;
}
impl Component for Wielding {
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
}
impl Component for Attacking {
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
}
impl Component for Rolling {
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
}
impl Component for OnGround {
type Storage = NullStorage<Self>;
}
impl Component for CanBuild {
type Storage = FlaggedStorage<Self, NullStorage<Self>>;
}
impl Component for Jumping {
type Storage = NullStorage<Self>;
}
impl Component for Gliding {
type Storage = FlaggedStorage<Self, NullStorage<Self>>;
}

View File

@ -1,8 +1,8 @@
mod action_state;
mod admin;
mod agent;
mod animation;
mod body;
mod character_state;
mod controller;
mod inputs;
mod inventory;
@ -13,18 +13,16 @@ mod stats;
mod visual;
// Reexports
pub use action_state::ActionState;
pub use admin::Admin;
pub use agent::Agent;
pub use animation::{Animation, AnimationInfo};
pub use body::{humanoid, object, quadruped, quadruped_medium, Body};
pub use character_state::{ActionState, CharacterState, MovementState};
pub use controller::Controller;
pub use inputs::{
Attacking, CanBuild, Gliding, Jumping, MoveDir, OnGround, Respawning, Rolling, Wielding,
};
pub use inputs::CanBuild;
pub use inventory::{item, Inventory, InventoryUpdate, Item};
pub use last::Last;
pub use phys::{ForceUpdate, Ori, Pos, Scale, Vel};
pub use phys::{ForceUpdate, Ori, PhysicsState, Pos, Scale, Vel};
pub use player::Player;
pub use stats::{Dying, Exp, HealthSource, Level, Stats};
pub use stats::{Exp, HealthSource, Level, Stats};
pub use visual::LightEmitter;

View File

@ -34,6 +34,16 @@ impl Component for Scale {
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
}
// PhysicsState
#[derive(Copy, Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PhysicsState {
pub on_ground: bool,
}
impl Component for PhysicsState {
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
}
// ForceUpdate
#[derive(Copy, Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct ForceUpdate;

View File

@ -1,47 +1,68 @@
use crate::comp;
use parking_lot::Mutex;
use specs::Entity as EcsEntity;
use std::{collections::VecDeque, ops::DerefMut};
use vek::*;
pub enum Event {
pub enum LocalEvent {
Jump(EcsEntity),
LandOnGround { entity: EcsEntity, vel: Vec3<f32> },
Explosion { pos: Vec3<f32>, radius: f32 },
}
#[derive(Default)]
pub struct EventBus {
queue: Mutex<VecDeque<Event>>,
pub enum ServerEvent {
Explosion {
pos: Vec3<f32>,
radius: f32,
},
Die {
entity: EcsEntity,
cause: comp::HealthSource,
},
Respawn(EcsEntity),
Shoot(EcsEntity),
}
impl EventBus {
pub fn emitter(&self) -> Emitter {
pub struct EventBus<E> {
queue: Mutex<VecDeque<E>>,
}
impl<E> Default for EventBus<E> {
fn default() -> Self {
Self {
queue: Mutex::new(VecDeque::new()),
}
}
}
impl<E> EventBus<E> {
pub fn emitter(&self) -> Emitter<E> {
Emitter {
bus: self,
events: VecDeque::new(),
}
}
pub fn emit(&self, event: Event) {
pub fn emit(&self, event: E) {
self.queue.lock().push_front(event);
}
pub fn recv_all(&self) -> impl ExactSizeIterator<Item = Event> {
pub fn recv_all(&self) -> impl ExactSizeIterator<Item = E> {
std::mem::replace(self.queue.lock().deref_mut(), VecDeque::new()).into_iter()
}
}
pub struct Emitter<'a> {
bus: &'a EventBus,
events: VecDeque<Event>,
pub struct Emitter<'a, E> {
bus: &'a EventBus<E>,
events: VecDeque<E>,
}
impl<'a> Emitter<'a> {
pub fn emit(&mut self, event: Event) {
impl<'a, E> Emitter<'a, E> {
pub fn emit(&mut self, event: E) {
self.events.push_front(event);
}
}
impl<'a> Drop for Emitter<'a> {
impl<'a, E> Drop for Emitter<'a, E> {
fn drop(&mut self) {
self.bus.queue.lock().append(&mut self.events);
}

View File

@ -51,9 +51,9 @@ pub enum ServerMsg {
entity: u64,
ori: comp::Ori,
},
EntityActionState {
EntityCharacterState {
entity: u64,
action_state: comp::ActionState,
character_state: comp::CharacterState,
},
InventoryUpdate(comp::Inventory),
TerrainChunkUpdate {

View File

@ -3,7 +3,7 @@ pub use sphynx::Uid;
use crate::{
comp,
event::EventBus,
event::{EventBus, LocalEvent, ServerEvent},
msg::{EcsCompPacket, EcsResPacket},
sys,
terrain::{Block, TerrainChunk, TerrainMap},
@ -42,6 +42,7 @@ pub struct DeltaTime(pub f32);
/// upper limit. If delta time exceeds this value, the game's physics will begin to produce time
/// lag. Ideally, we'd avoid such a situation.
const MAX_DELTA_TIME: f32 = 1.0;
const HUMANOID_JUMP_ACCEL: f32 = 18.0;
#[derive(Default)]
pub struct BlockChange {
@ -108,6 +109,7 @@ impl State {
}
// Create a new Sphynx ECS world.
// TODO: Split up registering into server and client (e.g. move EventBus<ServerEvent> to the server)
fn setup_sphynx_world(ecs: &mut sphynx::World<EcsCompPacket, EcsResPacket>) {
// Register server -> all clients synced components.
ecs.register_synced::<comp::Body>();
@ -122,7 +124,8 @@ impl State {
ecs.register::<comp::Controller>();
// Register components send directly from server -> all but one client
ecs.register::<comp::ActionState>();
ecs.register::<comp::CharacterState>();
ecs.register::<comp::PhysicsState>();
// Register components synced from client -> server -> all other clients
ecs.register::<comp::Pos>();
@ -132,27 +135,17 @@ impl State {
// Register client-local components
ecs.register::<comp::AnimationInfo>();
ecs.register::<comp::Jumping>();
// Register server-local components
ecs.register::<comp::Last<comp::Pos>>();
ecs.register::<comp::Last<comp::Vel>>();
ecs.register::<comp::Last<comp::Ori>>();
ecs.register::<comp::Last<comp::ActionState>>();
ecs.register::<comp::Last<comp::CharacterState>>();
ecs.register::<comp::Agent>();
ecs.register::<comp::Respawning>();
ecs.register::<comp::Dying>();
ecs.register::<comp::ForceUpdate>();
ecs.register::<comp::InventoryUpdate>();
ecs.register::<comp::Inventory>();
ecs.register::<comp::Admin>();
// Controller effects
ecs.register::<comp::MoveDir>();
ecs.register::<comp::OnGround>();
ecs.register::<comp::Attacking>();
ecs.register::<comp::Wielding>();
ecs.register::<comp::Rolling>();
ecs.register::<comp::Gliding>();
// Register synced resources used by the ECS.
ecs.add_resource_synced(TimeOfDay(0.0));
@ -163,7 +156,8 @@ impl State {
ecs.add_resource(TerrainMap::new().unwrap());
ecs.add_resource(BlockChange::default());
ecs.add_resource(TerrainChanges::default());
ecs.add_resource(EventBus::default());
ecs.add_resource(EventBus::<ServerEvent>::default());
ecs.add_resource(EventBus::<LocalEvent>::default());
}
/// Register a component with the state's ECS.
@ -320,6 +314,28 @@ impl State {
&mut self.ecs.write_resource::<BlockChange>().blocks,
Default::default(),
);
// Process local events
let events = self.ecs.read_resource::<EventBus<LocalEvent>>().recv_all();
for event in events {
let mut velocities = self.ecs.write_storage::<comp::Vel>();
match event {
LocalEvent::LandOnGround { entity, vel } => {
if let Some(stats) = self.ecs.write_storage::<comp::Stats>().get_mut(entity) {
let falldmg = (vel.z / 1.5 + 10.0) as i32;
if falldmg < 0 {
stats.health.change_by(falldmg, comp::HealthSource::World);
}
}
}
LocalEvent::Jump(entity) => {
if let Some(vel) = velocities.get_mut(entity) {
vel.0.z = HUMANOID_JUMP_ACCEL;
}
}
}
}
}
/// Clean up the state after a tick.

View File

@ -1,69 +0,0 @@
use crate::{
comp::{ActionState, Attacking, Controller, Gliding, OnGround, Rolling, Vel, Wielding},
sys::movement::MOVEMENT_THRESHOLD_VEL,
};
use specs::{Entities, Join, ReadStorage, System, WriteStorage};
/// This system will set the ActionState component as specified by other components
pub struct Sys;
impl<'a> System<'a> for Sys {
type SystemData = (
Entities<'a>,
ReadStorage<'a, Controller>,
ReadStorage<'a, Vel>,
ReadStorage<'a, OnGround>,
ReadStorage<'a, Gliding>,
ReadStorage<'a, Attacking>,
ReadStorage<'a, Wielding>,
ReadStorage<'a, Rolling>,
WriteStorage<'a, ActionState>,
);
fn run(
&mut self,
(
entities,
controllers, // To make sure it only runs on the single client and the server
velocities,
on_grounds,
glidings,
attackings,
wieldings,
rollings,
mut action_states,
): Self::SystemData,
) {
for (
_entity,
vel,
_controller,
on_ground,
gliding,
attacking,
wielding,
rolling,
action_state,
) in (
&entities,
&velocities,
&controllers,
on_grounds.maybe(),
glidings.maybe(),
attackings.maybe(),
wieldings.maybe(),
rollings.maybe(),
&mut action_states,
)
.join()
{
*action_state = ActionState {
on_ground: on_ground.is_some(),
moving: vel.0.magnitude_squared() > MOVEMENT_THRESHOLD_VEL.powf(2.0),
attacking: attacking.is_some(),
wielding: wielding.is_some(),
rolling: rolling.is_some(),
gliding: gliding.is_some(),
};
}
}
}

View File

@ -1,4 +1,4 @@
use crate::comp::{ActionState, Agent, Controller, Pos, Stats};
use crate::comp::{Agent, CharacterState, Controller, MovementState::Glide, Pos, Stats};
use rand::{seq::SliceRandom, thread_rng};
use specs::{Entities, Join, ReadStorage, System, WriteStorage};
use vek::*;
@ -10,14 +10,14 @@ impl<'a> System<'a> for Sys {
Entities<'a>,
ReadStorage<'a, Pos>,
ReadStorage<'a, Stats>,
ReadStorage<'a, ActionState>,
ReadStorage<'a, CharacterState>,
WriteStorage<'a, Agent>,
WriteStorage<'a, Controller>,
);
fn run(
&mut self,
(entities, positions, stats, action_states, mut agents, mut controllers): Self::SystemData,
(entities, positions, stats, character_states, mut agents, mut controllers): Self::SystemData,
) {
for (entity, pos, agent, controller) in
(&entities, &positions, &mut agents, &mut controllers).join()
@ -67,15 +67,17 @@ impl<'a> System<'a> for Sys {
const SIGHT_DIST: f32 = 30.0;
let mut choose_new = false;
if let Some((Some(target_pos), Some(target_stats), Some(a))) =
if let Some((Some(target_pos), Some(target_stats), Some(target_character))) =
target.map(|target| {
(
positions.get(target),
stats.get(target),
action_states.get(target),
character_states.get(target),
)
})
{
controller.look_dir = target_pos.0 - pos.0;
let dist = Vec2::<f32>::from(target_pos.0 - pos.0).magnitude();
if target_stats.is_dead {
choose_new = true;
@ -97,7 +99,8 @@ impl<'a> System<'a> for Sys {
controller.roll = true;
}
if a.gliding && target_pos.0.z > pos.0.z + 5.0 {
if target_character.movement == Glide && target_pos.0.z > pos.0.z + 5.0
{
controller.glide = true;
controller.jump = true;
}

View File

@ -1,8 +1,12 @@
use crate::{
comp::{ActionState, Animation, AnimationInfo},
comp::{
ActionState::*, Animation, AnimationInfo, CharacterState, MovementState::*, PhysicsState,
Stats,
},
state::DeltaTime,
};
use specs::{Entities, Join, Read, ReadStorage, System, WriteStorage};
use std::fmt::Debug;
/// This system will apply the animation that fits best to the users actions
pub struct Sys;
@ -10,37 +14,36 @@ impl<'a> System<'a> for Sys {
type SystemData = (
Entities<'a>,
Read<'a, DeltaTime>,
ReadStorage<'a, ActionState>,
ReadStorage<'a, Stats>,
ReadStorage<'a, CharacterState>,
ReadStorage<'a, PhysicsState>,
WriteStorage<'a, AnimationInfo>,
);
fn run(&mut self, (entities, dt, action_states, mut animation_infos): Self::SystemData) {
for (entity, a) in (&entities, &action_states).join() {
fn impossible_animation(message: &str) -> Animation {
warn!("{}", message);
Animation::Idle
fn run(
&mut self,
(entities, dt, stats, character_states, physics_states, mut animation_infos): Self::SystemData,
) {
for (entity, stats, character, physics) in
(&entities, &stats, &character_states, &physics_states).join()
{
if stats.is_dead {
continue;
}
let animation = match (
a.on_ground,
a.moving,
a.attacking,
a.gliding,
a.rolling,
a.wielding,
) {
(_, _, true, true, _, _) => impossible_animation("Attack while gliding"),
(_, _, true, _, true, _) => impossible_animation("Roll while attacking"),
(_, _, _, true, true, _) => impossible_animation("Roll while gliding"),
(_, false, _, _, true, _) => impossible_animation("Roll without moving"),
(_, true, false, false, true, _) => Animation::Roll,
(true, false, false, false, false, false) => Animation::Idle,
(true, true, false, false, false, false) => Animation::Run,
(false, _, false, false, false, false) => Animation::Jump,
(true, false, false, false, false, true) => Animation::Cidle,
(true, true, false, false, false, true) => Animation::Crun,
(false, _, false, false, false, true) => Animation::Cjump,
(_, _, false, true, false, _) => Animation::Gliding,
(_, _, true, false, false, _) => Animation::Attack,
let animation = match (physics.on_ground, &character.movement, &character.action) {
(_, Roll { .. }, Idle) => Animation::Roll,
(true, Stand, Idle) => Animation::Idle,
(true, Run, Idle) => Animation::Run,
(false, Jump, Idle) => Animation::Jump,
(true, Stand, Wield { .. }) => Animation::Cidle,
(true, Run, Wield { .. }) => Animation::Crun,
(false, Jump, Wield { .. }) => Animation::Cjump,
(_, Glide, Idle) => Animation::Gliding,
(_, _, Attack { .. }) => Animation::Attack,
(_, _, Block { .. }) => Animation::Block,
// Impossible animation (Caused by missing animations or syncing delays)
_ => Animation::Gliding,
};
let new_time = animation_infos

15
common/src/sys/cleanup.rs Normal file
View File

@ -0,0 +1,15 @@
use crate::comp::Controller;
use specs::{Entities, Join, System, WriteStorage};
use vek::*;
/// This system will allow NPCs to modify their controller
pub struct Sys;
impl<'a> System<'a> for Sys {
type SystemData = (Entities<'a>, WriteStorage<'a, Controller>);
fn run(&mut self, (entities, mut controllers): Self::SystemData) {
for controller in (&mut controllers).join() {
*controller = Controller::default();
}
}
}

View File

@ -1,8 +1,21 @@
use crate::{
comp::{Attacking, ForceUpdate, HealthSource, Ori, Pos, Stats, Vel, Wielding},
comp::{
ActionState::*, CharacterState, Controller, ForceUpdate, HealthSource, Ori, Pos, Stats, Vel,
},
state::{DeltaTime, Uid},
};
use specs::{Entities, Join, Read, ReadStorage, System, WriteStorage};
use std::time::Duration;
use vek::*;
const BASE_DMG: i32 = 10;
const BLOCK_EFFICIENCY: f32 = 0.9;
const ATTACK_RANGE: f32 = 4.0;
const BLOCK_ANGLE: f32 = 180.0;
const KNOCKBACK_XY: f32 = 2.0;
const KNOCKBACK_Z: f32 = 2.0;
/// This system is responsible for handling accepted inputs like moving or attacking
pub struct Sys;
@ -13,9 +26,9 @@ impl<'a> System<'a> for Sys {
Read<'a, DeltaTime>,
ReadStorage<'a, Pos>,
ReadStorage<'a, Ori>,
ReadStorage<'a, Controller>,
WriteStorage<'a, Vel>,
WriteStorage<'a, Attacking>,
WriteStorage<'a, Wielding>,
WriteStorage<'a, CharacterState>,
WriteStorage<'a, Stats>,
WriteStorage<'a, ForceUpdate>,
);
@ -28,60 +41,91 @@ impl<'a> System<'a> for Sys {
dt,
positions,
orientations,
controllers,
mut velocities,
mut attackings,
mut wieldings,
mut character_states,
mut stats,
mut force_updates,
): Self::SystemData,
) {
// Attacks
(&entities, &uids, &positions, &orientations, &mut attackings)
.join()
.filter_map(|(entity, uid, pos, ori, mut attacking)| {
if !attacking.applied {
// Go through all other entities
for (b, pos_b, mut vel_b, stat_b) in
(&entities, &positions, &mut velocities, &mut stats).join()
for (entity, uid, pos, ori, controller) in
(&entities, &uids, &positions, &orientations, &controllers).join()
{
// Go through all other entities
if let Some(Attack { time_left, applied }) =
&mut character_states.get(entity).map(|c| c.action)
{
if !*applied {
for (b, pos_b, ori_b, character_b, mut vel_b, stat_b) in (
&entities,
&positions,
&orientations,
&character_states,
&mut velocities,
&mut stats,
)
.join()
{
// 2D versions
let pos2 = Vec2::from(pos.0);
let pos_b2: Vec2<f32> = Vec2::from(pos_b.0);
let ori2 = Vec2::from(ori.0);
// Check if it is a hit
if entity != b
&& !stat_b.is_dead
&& pos.0.distance_squared(pos_b.0) < 50.0
&& ori.0.angle_between(pos_b.0 - pos.0).to_degrees() < 90.0
&& pos.0.distance_squared(pos_b.0) < ATTACK_RANGE.powi(2)
// TODO: Use size instead of 1.0
&& ori2.angle_between(pos_b2 - pos2) < (1.0 / pos2.distance(pos_b2)).atan()
{
let dmg = if character_b.action.is_block()
&& ori_b.0.angle_between(pos.0 - pos_b.0).to_degrees()
< BLOCK_ANGLE / 2.0
{
(BASE_DMG as f32 * (1.0 - BLOCK_EFFICIENCY)) as i32
} else {
BASE_DMG
};
// Deal damage
stat_b
.health
.change_by(-10, HealthSource::Attack { by: *uid }); // TODO: variable damage and weapon
vel_b.0 += (pos_b.0 - pos.0).normalized() * 2.0;
vel_b.0.z = 2.0;
.change_by(-dmg, HealthSource::Attack { by: *uid }); // TODO: variable damage and weapon
vel_b.0 += (pos_b.0 - pos.0).normalized() * KNOCKBACK_XY;
vel_b.0.z = KNOCKBACK_Z;
let _ = force_updates.insert(b, ForceUpdate);
}
}
attacking.applied = true;
}
if attacking.time > 0.5 {
Some(entity)
} else {
attacking.time += dt.0;
if let Some(Attack { time_left, applied }) =
&mut character_states.get_mut(entity).map(|c| &mut c.action)
{
// Only attack once
*applied = true;
None
if *time_left == Duration::default() {
if let Some(character) = &mut character_states.get_mut(entity) {
character.action = Wield {
time_left: Duration::default(),
};
}
} else {
*time_left = time_left
.checked_sub(Duration::from_secs_f32(dt.0))
.unwrap_or_default();
}
}
})
.collect::<Vec<_>>()
.into_iter()
.for_each(|e| {
attackings.remove(e);
});
{
// Wields
for wielding in (&mut wieldings).join() {
if !wielding.applied && wielding.time > 0.3 {
wielding.applied = true;
} else {
wielding.time += dt.0;
}
if let Some(Wield { time_left }) =
&mut character_states.get_mut(entity).map(|c| &mut c.action)
{
if *time_left != Duration::default() {
*time_left = time_left
.checked_sub(Duration::from_secs_f32(dt.0))
.unwrap_or_default();
}
}
}

View File

@ -1,125 +1,150 @@
use crate::comp::{
ActionState, Attacking, Body, Controller, Gliding, Jumping, MoveDir, Respawning, Rolling,
Stats, Vel, Wielding,
use crate::{
comp::{
ActionState::*, Body, CharacterState, Controller, MovementState::*, PhysicsState, Stats,
Vel,
},
event::{EventBus, LocalEvent, ServerEvent},
};
use specs::{Entities, Join, ReadStorage, System, WriteStorage};
use specs::{Entities, Join, Read, ReadStorage, System, WriteStorage};
use std::time::Duration;
/// This system is responsible for validating controller inputs
pub struct Sys;
impl<'a> System<'a> for Sys {
type SystemData = (
Entities<'a>,
Read<'a, EventBus<ServerEvent>>,
Read<'a, EventBus<LocalEvent>>,
WriteStorage<'a, Controller>,
ReadStorage<'a, Stats>,
ReadStorage<'a, Body>,
ReadStorage<'a, Vel>,
WriteStorage<'a, ActionState>,
WriteStorage<'a, MoveDir>,
WriteStorage<'a, Jumping>,
WriteStorage<'a, Attacking>,
WriteStorage<'a, Wielding>,
WriteStorage<'a, Rolling>,
WriteStorage<'a, Respawning>,
WriteStorage<'a, Gliding>,
ReadStorage<'a, PhysicsState>,
WriteStorage<'a, CharacterState>,
);
fn run(
&mut self,
(
entities,
server_bus,
local_bus,
mut controllers,
stats,
bodies,
velocities,
mut action_states,
mut move_dirs,
mut jumpings,
mut attackings,
mut wieldings,
mut rollings,
mut respawns,
mut glidings,
physics_states,
mut character_states,
): Self::SystemData,
) {
for (entity, controller, stats, body, vel, mut a) in (
let mut server_emitter = server_bus.emitter();
let mut local_emitter = local_bus.emitter();
for (entity, controller, stats, body, vel, physics, mut character) in (
&entities,
&mut controllers,
&stats,
&bodies,
&velocities,
// Although this is changed, it is only kept for this system
// as it will be replaced in the action state system
&mut action_states,
&physics_states,
&mut character_states,
)
.join()
{
if stats.is_dead {
// Respawn
if controller.respawn {
let _ = respawns.insert(entity, Respawning);
server_emitter.emit(ServerEvent::Respawn(entity));
}
continue;
}
// Move dir
if !a.rolling {
let _ = move_dirs.insert(
entity,
MoveDir(if controller.move_dir.magnitude_squared() > 1.0 {
controller.move_dir.normalized()
} else {
controller.move_dir
}),
);
// Move
controller.move_dir = if controller.move_dir.magnitude_squared() > 1.0 {
controller.move_dir.normalized()
} else {
controller.move_dir
};
if character.movement == Stand && controller.move_dir.magnitude_squared() > 0.0 {
character.movement = Run;
} else if character.movement == Run && controller.move_dir.magnitude_squared() == 0.0 {
character.movement = Stand;
}
// Look
controller.look_dir = controller
.look_dir
.try_normalized()
.unwrap_or(controller.move_dir.into());
// Glide
if controller.glide && !a.on_ground && !a.attacking && !a.rolling && body.is_humanoid()
// TODO: Check for glide ability/item
if controller.glide
&& !physics.on_ground
&& (character.action == Idle || character.action.is_wield())
&& character.movement == Jump
&& body.is_humanoid()
{
let _ = glidings.insert(entity, Gliding);
a.gliding = true;
} else {
let _ = glidings.remove(entity);
a.gliding = false;
character.movement = Glide;
} else if !controller.glide && character.movement == Glide {
character.movement = Jump;
}
// Wield
if controller.attack && !a.wielding && !a.gliding && !a.rolling {
let _ = wieldings.insert(entity, Wielding::start());
a.wielding = true;
if controller.attack
&& character.action == Idle
&& (character.movement == Stand || character.movement == Run)
{
character.action = Wield {
time_left: Duration::from_millis(300),
};
}
// Attack
if controller.attack
&& !a.attacking
&& wieldings.get(entity).map(|w| w.applied).unwrap_or(false)
&& !a.gliding
&& !a.rolling
&& (character.movement == Stand
|| character.movement == Run
|| character.movement == Jump)
{
let _ = attackings.insert(entity, Attacking::start());
a.attacking = true;
// TODO: Check if wield ability exists
if let Wield { time_left } = character.action {
if time_left == Duration::default() {
character.action = Attack {
time_left: Duration::from_millis(300),
applied: false,
};
}
}
}
// Block
if controller.block
&& (character.movement == Stand || character.movement == Run)
&& (character.action == Idle || character.action.is_wield())
{
character.action = Block {
time_left: Duration::from_secs(5),
};
} else if !controller.block && character.action.is_block() {
character.action = Idle;
}
// Roll
if controller.roll
&& !a.rolling
&& a.on_ground
&& a.moving
&& !a.attacking
&& !a.gliding
&& (character.action == Idle || character.action.is_wield())
&& character.movement == Run
&& physics.on_ground
{
let _ = rollings.insert(entity, Rolling::start());
a.rolling = true;
character.movement = Roll {
time_left: Duration::from_millis(600),
};
}
// Jump
if controller.jump && a.on_ground && vel.0.z <= 0.0 {
let _ = jumpings.insert(entity, Jumping);
a.on_ground = false;
if controller.jump && physics.on_ground && vel.0.z <= 0.0 {
local_emitter.emit(LocalEvent::Jump(entity));
}
// Reset the controller ready for the next tick
*controller = Controller::default();
}
}
}

View File

@ -1,6 +1,6 @@
mod action_state;
pub mod agent;
pub mod animation;
mod cleanup;
pub mod combat;
pub mod controller;
pub mod movement;
@ -13,24 +13,20 @@ use specs::DispatcherBuilder;
// System names
const AGENT_SYS: &str = "agent_sys";
const CONTROLLER_SYS: &str = "controller_sys";
const ACTION_STATE_SYS: &str = "action_state_sys";
const PHYS_SYS: &str = "phys_sys";
const MOVEMENT_SYS: &str = "movement_sys";
const COMBAT_SYS: &str = "combat_sys";
const ANIMATION_SYS: &str = "animation_sys";
const STATS_SYS: &str = "stats_sys";
const CLEANUP_SYS: &str = "cleanup_sys";
pub fn add_local_systems(dispatch_builder: &mut DispatcherBuilder) {
dispatch_builder.add(agent::Sys, AGENT_SYS, &[]);
dispatch_builder.add(controller::Sys, CONTROLLER_SYS, &[AGENT_SYS]);
dispatch_builder.add(phys::Sys, PHYS_SYS, &[CONTROLLER_SYS]);
dispatch_builder.add(movement::Sys, MOVEMENT_SYS, &[PHYS_SYS]);
dispatch_builder.add(
action_state::Sys,
ACTION_STATE_SYS,
&[CONTROLLER_SYS, PHYS_SYS],
);
dispatch_builder.add(combat::Sys, COMBAT_SYS, &[ACTION_STATE_SYS]);
dispatch_builder.add(animation::Sys, ANIMATION_SYS, &[ACTION_STATE_SYS]);
dispatch_builder.add(combat::Sys, COMBAT_SYS, &[CONTROLLER_SYS]);
dispatch_builder.add(animation::Sys, ANIMATION_SYS, &[MOVEMENT_SYS]);
dispatch_builder.add(stats::Sys, STATS_SYS, &[COMBAT_SYS]);
dispatch_builder.add(cleanup::Sys, CLEANUP_SYS, &[STATS_SYS, ANIMATION_SYS]);
}

View File

@ -1,10 +1,14 @@
use crate::{
comp::{ActionState, Jumping, MoveDir, OnGround, Ori, Pos, Rolling, Stats, Vel, Wielding},
comp::{
ActionState::*, CharacterState, Controller, MovementState::*, Ori, PhysicsState, Pos,
Stats, Vel,
},
state::DeltaTime,
terrain::TerrainMap,
vol::{ReadVol, Vox},
};
use specs::{Entities, Join, Read, ReadExpect, ReadStorage, System, WriteStorage};
use std::time::Duration;
use vek::*;
const HUMANOID_ACCEL: f32 = 70.0;
@ -13,9 +17,7 @@ const WIELD_ACCEL: f32 = 70.0;
const WIELD_SPEED: f32 = 120.0;
const HUMANOID_AIR_ACCEL: f32 = 10.0;
const HUMANOID_AIR_SPEED: f32 = 100.0;
const HUMANOID_JUMP_ACCEL: f32 = 18.0;
const ROLL_ACCEL: f32 = 160.0;
const ROLL_SPEED: f32 = 550.0;
const ROLL_SPEED: f32 = 13.0;
const GLIDE_ACCEL: f32 = 15.0;
const GLIDE_SPEED: f32 = 45.0;
// Gravity is 9.81 * 4, so this makes gravity equal to .15
@ -30,13 +32,10 @@ impl<'a> System<'a> for Sys {
Entities<'a>,
ReadExpect<'a, TerrainMap>,
Read<'a, DeltaTime>,
ReadStorage<'a, MoveDir>,
ReadStorage<'a, Stats>,
ReadStorage<'a, ActionState>,
WriteStorage<'a, Jumping>,
WriteStorage<'a, Wielding>,
WriteStorage<'a, Rolling>,
WriteStorage<'a, OnGround>,
ReadStorage<'a, Controller>,
ReadStorage<'a, PhysicsState>,
WriteStorage<'a, CharacterState>,
WriteStorage<'a, Pos>,
WriteStorage<'a, Vel>,
WriteStorage<'a, Ori>,
@ -48,107 +47,109 @@ impl<'a> System<'a> for Sys {
entities,
terrain,
dt,
move_dirs,
stats,
action_states,
mut jumpings,
mut wieldings,
mut rollings,
mut on_grounds,
controllers,
physics_states,
mut character_states,
mut positions,
mut velocities,
mut orientations,
): Self::SystemData,
) {
// Apply movement inputs
for (entity, stats, a, move_dir, mut pos, mut vel, mut ori) in (
for (entity, stats, controller, physics, mut character, mut pos, mut vel, mut ori) in (
&entities,
&stats,
&action_states,
move_dirs.maybe(),
&controllers,
&physics_states,
&mut character_states,
&mut positions,
&mut velocities,
&mut orientations,
)
.join()
{
// Disable while dead TODO: Replace with client states?
if stats.is_dead {
continue;
}
// Move player according to move_dir
if let Some(move_dir) = move_dir {
if character.movement.is_roll() {
vel.0 = Vec3::new(0.0, 0.0, vel.0.z)
+ controller
.move_dir
.try_normalized()
.unwrap_or(Vec2::from(vel.0).try_normalized().unwrap_or_default())
* ROLL_SPEED
} else {
// Move player according to move_dir
vel.0 += Vec2::broadcast(dt.0)
* move_dir.0
* match (a.on_ground, a.gliding, a.rolling, a.wielding) {
(true, false, false, false)
if vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) =>
{
* controller.move_dir
* match (physics.on_ground, &character.movement) {
(true, Run) if vel.0.magnitude_squared() < HUMANOID_SPEED.powf(2.0) => {
HUMANOID_ACCEL
}
(false, true, false, false)
if vel.0.magnitude_squared() < GLIDE_SPEED.powf(2.0) =>
{
(false, Glide) if vel.0.magnitude_squared() < GLIDE_SPEED.powf(2.0) => {
GLIDE_ACCEL
}
(false, false, false, false)
(false, Jump)
if vel.0.magnitude_squared() < HUMANOID_AIR_SPEED.powf(2.0) =>
{
HUMANOID_AIR_ACCEL
}
(true, false, true, _)
if vel.0.magnitude_squared() < ROLL_SPEED.powf(2.0) =>
{
ROLL_ACCEL
}
(true, false, false, true)
if vel.0.magnitude_squared() < WIELD_SPEED.powf(2.0) =>
{
WIELD_ACCEL
}
_ => 0.0,
};
// Set direction based on move direction when on the ground
let ori_dir = if a.gliding || a.rolling {
Vec2::from(vel.0)
} else {
move_dir.0
};
if ori_dir.magnitude_squared() > 0.0001
&& (ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared()
> 0.001
{
ori.0 = vek::ops::Slerp::slerp(
ori.0,
ori_dir.into(),
if a.on_ground { 12.0 } else { 2.0 } * dt.0,
);
}
}
// Jump
if jumpings.get(entity).is_some() {
vel.0.z = HUMANOID_JUMP_ACCEL;
jumpings.remove(entity);
// Set direction based on move direction when on the ground
let ori_dir = if character.action.is_wield()
|| character.action.is_attack()
|| character.action.is_block()
{
Vec2::from(controller.look_dir).normalized()
} else {
Vec2::from(vel.0)
};
if ori_dir.magnitude_squared() > 0.0001
&& (ori.0.normalized() - Vec3::from(ori_dir).normalized()).magnitude_squared()
> 0.001
{
ori.0 = vek::ops::Slerp::slerp(
ori.0,
ori_dir.into(),
if physics.on_ground { 12.0 } else { 2.0 } * dt.0,
);
}
// Glide
if a.gliding && vel.0.magnitude_squared() < GLIDE_SPEED.powf(2.0) && vel.0.z < 0.0 {
let _ = wieldings.remove(entity);
if character.movement == Glide
&& vel.0.magnitude_squared() < GLIDE_SPEED.powf(2.0)
&& vel.0.z < 0.0
{
character.action = Idle;
let lift = GLIDE_ANTIGRAV + vel.0.z.powf(2.0) * 0.2;
vel.0.z += dt.0 * lift * Vec2::<f32>::from(vel.0 * 0.15).magnitude().min(1.0);
}
// Roll
if let Some(time) = rollings.get_mut(entity).map(|r| &mut r.time) {
let _ = wieldings.remove(entity);
*time += dt.0;
if *time > 0.6 || !a.moving {
rollings.remove(entity);
if let Roll { time_left } = &mut character.movement {
character.action = Idle;
if *time_left == Duration::default() || vel.0.magnitude_squared() < 10.0 {
character.movement = Run;
} else {
*time_left = time_left
.checked_sub(Duration::from_secs_f32(dt.0))
.unwrap_or_default();
}
}
if physics.on_ground && (character.movement == Jump || character.movement == Glide) {
character.movement = Stand;
}
if !physics.on_ground && (character.movement == Stand || character.movement == Run) {
character.movement = Jump;
}
}
}
}

View File

@ -1,16 +1,14 @@
use crate::{
comp::HealthSource,
comp::{
ActionState, Body, Jumping, MoveDir, OnGround, Ori, Pos, Rolling, Scale, Stats, Vel,
Wielding,
use {
crate::{
comp::{Body, MovementState::*, Ori, PhysicsState, Pos, Scale, Stats, Vel},
event::{EventBus, LocalEvent},
state::DeltaTime,
terrain::TerrainMap,
vol::{ReadVol, Vox},
},
event::{Event, EventBus},
state::DeltaTime,
terrain::TerrainMap,
vol::{ReadVol, Vox},
specs::{Entities, Join, Read, ReadExpect, ReadStorage, System, WriteStorage},
vek::*,
};
use specs::{Entities, Join, Read, ReadExpect, ReadStorage, System, WriteStorage};
use vek::*;
const GRAVITY: f32 = 9.81 * 4.0;
const FRIC_GROUND: f32 = 0.15;
@ -36,11 +34,10 @@ impl<'a> System<'a> for Sys {
Entities<'a>,
ReadExpect<'a, TerrainMap>,
Read<'a, DeltaTime>,
Read<'a, EventBus>,
ReadStorage<'a, ActionState>,
Read<'a, EventBus<LocalEvent>>,
ReadStorage<'a, Scale>,
ReadStorage<'a, Body>,
WriteStorage<'a, OnGround>,
WriteStorage<'a, PhysicsState>,
WriteStorage<'a, Pos>,
WriteStorage<'a, Vel>,
WriteStorage<'a, Ori>,
@ -53,10 +50,9 @@ impl<'a> System<'a> for Sys {
terrain,
dt,
event_bus,
action_states,
scales,
bodies,
mut on_grounds,
mut physics_states,
mut positions,
mut velocities,
mut orientations,
@ -65,9 +61,8 @@ impl<'a> System<'a> for Sys {
let mut event_emitter = event_bus.emitter();
// Apply movement inputs
for (entity, a, scale, b, mut pos, mut vel, mut ori) in (
for (entity, scale, b, mut pos, mut vel, mut ori) in (
&entities,
&action_states,
scales.maybe(),
&bodies,
&mut positions,
@ -76,12 +71,13 @@ impl<'a> System<'a> for Sys {
)
.join()
{
let mut physics_state = physics_states.get(entity).cloned().unwrap_or_default();
let scale = scale.map(|s| s.0).unwrap_or(1.0);
// Integrate forces
// Friction is assumed to be a constant dependent on location
let friction = 50.0
* if on_grounds.get(entity).is_some() {
* if physics_state.on_ground {
FRIC_GROUND
} else {
FRIC_AIR
@ -128,8 +124,8 @@ impl<'a> System<'a> for Sys {
false
};
let was_on_ground = a.on_ground;
on_grounds.remove(entity); // Assume we're in the air - unless we can prove otherwise
let was_on_ground = physics_state.on_ground;
physics_state.on_ground = false;
let mut on_ground = false;
let mut attempts = 0; // Don't loop infinitely here
@ -215,7 +211,7 @@ impl<'a> System<'a> for Sys {
on_ground = true;
if !was_on_ground {
event_emitter.emit(Event::LandOnGround { entity, vel: vel.0 });
event_emitter.emit(LocalEvent::LandOnGround { entity, vel: vel.0 });
}
}
@ -229,7 +225,7 @@ impl<'a> System<'a> for Sys {
// ...and we're falling/standing OR there is a block *directly* beneath our current origin (note: not hitbox)...
&& (vel.0.z <= 0.0 || terrain
.get((pos.0 - Vec3::unit_z() * 0.1).map(|e| e.floor() as i32))
.map(|vox| !vox.is_empty())
.map(|vox| vox.is_solid())
.unwrap_or(false))
// ...and there is a collision with a block beneath our current hitbox...
&& collision_with(
@ -257,13 +253,12 @@ impl<'a> System<'a> for Sys {
if attempts == MAX_ATTEMPTS {
pos.0 = old_pos;
vel.0 = Vec3::zero();
break;
}
}
if on_ground {
let _ = on_grounds.insert(entity, OnGround);
physics_state.on_ground = true;
// If the space below us is free, then "snap" to the ground
} else if collision_with(pos.0 - Vec3::unit_z() * 1.05, near_iter.clone())
&& vel.0.z < 0.0
@ -271,8 +266,10 @@ impl<'a> System<'a> for Sys {
&& was_on_ground
{
pos.0.z = (pos.0.z - 0.05).floor();
let _ = on_grounds.insert(entity, OnGround);
physics_state.on_ground = true;
}
let _ = physics_states.insert(entity, physics_state);
}
// Apply pushback

View File

@ -1,5 +1,6 @@
use crate::{
comp::{Dying, HealthSource, Stats},
comp::{HealthSource, Stats},
event::{EventBus, ServerEvent},
state::DeltaTime,
};
use log::warn;
@ -11,27 +12,29 @@ impl<'a> System<'a> for Sys {
type SystemData = (
Entities<'a>,
Read<'a, DeltaTime>,
Read<'a, EventBus<ServerEvent>>,
WriteStorage<'a, Stats>,
WriteStorage<'a, Dying>,
);
fn run(&mut self, (entities, dt, mut stats, mut dyings): Self::SystemData) {
fn run(&mut self, (entities, dt, event_bus, mut stats): Self::SystemData) {
let mut event_emitter = event_bus.emitter();
for (entity, mut stat) in (&entities, &mut stats).join() {
if stat.should_die() && !stat.is_dead {
let _ = dyings.insert(
event_emitter.emit(ServerEvent::Die {
entity,
Dying {
cause: match stat.health.last_change {
Some(change) => change.2,
None => {
warn!("Nothing caused an entity to die!");
HealthSource::Unknown
}
},
cause: match stat.health.last_change {
Some(change) => change.2,
None => {
warn!("Nothing caused an entity to die!");
HealthSource::Unknown
}
},
);
});
stat.is_dead = true;
}
if let Some(change) = &mut stat.health.last_change {
change.1 += f64::from(dt.0);
}

View File

@ -10,7 +10,7 @@ world = { package = "veloren-world", path = "../world" }
log = "0.4.8"
specs = "0.14.2"
vek = "0.9.8"
vek = "0.9.9"
uvth = "3.1.1"
lazy_static = "1.3.0"
scan_fmt = "0.2.3"

View File

@ -6,7 +6,7 @@ use crate::Server;
use chrono::{NaiveTime, Timelike};
use common::{
comp,
event::{Event as GameEvent, EventBus},
event::{EventBus, ServerEvent},
msg::ServerMsg,
npc::{get_npc_name, NpcKind},
state::TimeOfDay,
@ -411,7 +411,7 @@ fn handle_spawn(server: &mut Server, entity: EcsEntity, args: String, action: &C
let body = kind_to_body(id);
server
.create_npc(pos, get_npc_name(id), body)
.create_npc(pos, comp::Stats::new(get_npc_name(id)), body)
.with(comp::Vel(vel))
.with(agent)
.build();
@ -741,8 +741,8 @@ fn handle_explosion(server: &mut Server, entity: EcsEntity, args: String, action
Some(pos) => server
.state
.ecs()
.read_resource::<EventBus>()
.emit(GameEvent::Explosion { pos: pos.0, radius }),
.read_resource::<EventBus<ServerEvent>>()
.emit(ServerEvent::Explosion { pos: pos.0, radius }),
None => server.clients.notify(
entity,
ServerMsg::private(String::from("You have no position!")),

View File

@ -18,7 +18,7 @@ use crate::{
};
use common::{
comp,
event::{Event as GameEvent, EventBus},
event::{EventBus, ServerEvent},
msg::{ClientMsg, ClientState, RequestStateError, ServerError, ServerInfo, ServerMsg},
net::PostOffice,
state::{BlockChange, State, TimeOfDay, Uid},
@ -87,7 +87,9 @@ impl Server {
state
.ecs_mut()
.add_resource(SpawnPoint(Vec3::new(16_384.0, 16_384.0, 512.0)));
state.ecs_mut().add_resource(EventBus::default());
state
.ecs_mut()
.add_resource(EventBus::<ServerEvent>::default());
// Set starting time for the server.
state.ecs_mut().write_resource::<TimeOfDay>().0 = settings.start_time;
@ -141,7 +143,7 @@ impl Server {
pub fn create_npc(
&mut self,
pos: comp::Pos,
name: String,
stats: comp::Stats,
body: comp::Body,
) -> EcsEntityBuilder {
self.state
@ -152,9 +154,8 @@ impl Server {
.with(comp::Ori(Vec3::unit_y()))
.with(comp::Controller::default())
.with(body)
.with(comp::Stats::new(name))
.with(comp::ActionState::default())
.with(comp::ForceUpdate)
.with(stats)
.with(comp::CharacterState::default())
}
/// Build a static object entity
@ -174,9 +175,23 @@ impl Server {
offset: Vec3::unit_z(),
..comp::LightEmitter::default()
})
//.with(comp::LightEmitter::default())
.with(comp::ActionState::default())
.with(comp::ForceUpdate)
//.with(comp::LightEmitter::default())
}
/// Build a projectile
pub fn create_projectile(
state: &mut State,
pos: comp::Pos,
vel: comp::Vel,
body: comp::Body,
) -> EcsEntityBuilder {
state
.ecs_mut()
.create_entity_synced()
.with(pos)
.with(vel)
.with(comp::Ori(Vec3::unit_y()))
.with(body)
}
pub fn create_player_character(
@ -195,7 +210,7 @@ impl Server {
state.write_component(entity, comp::Pos(spawn_point));
state.write_component(entity, comp::Vel(Vec3::zero()));
state.write_component(entity, comp::Ori(Vec3::unit_y()));
state.write_component(entity, comp::ActionState::default());
state.write_component(entity, comp::CharacterState::default());
state.write_component(entity, comp::Inventory::default());
state.write_component(entity, comp::InventoryUpdate);
// Make sure physics are accepted.
@ -218,21 +233,17 @@ impl Server {
/// Handle events coming through via the event bus
fn handle_events(&mut self) {
let terrain = self.state.ecs().read_resource::<TerrainMap>();
let mut block_change = self.state.ecs().write_resource::<BlockChange>();
let mut stats = self.state.ecs().write_storage::<comp::Stats>();
let events = self
.state
.ecs()
.read_resource::<EventBus<ServerEvent>>()
.recv_all();
for event in events {
let state = &mut self.state;
let clients = &mut self.clients;
for event in self.state.ecs().read_resource::<EventBus>().recv_all() {
match event {
GameEvent::LandOnGround { entity, vel } => {
if let Some(stats) = stats.get_mut(entity) {
let falldmg = (vel.z / 1.5 + 10.0) as i32;
if falldmg < 0 {
stats.health.change_by(falldmg, comp::HealthSource::World);
}
}
}
GameEvent::Explosion { pos, radius } => {
ServerEvent::Explosion { pos, radius } => {
const RAYS: usize = 500;
for _ in 0..RAYS {
@ -243,13 +254,105 @@ impl Server {
)
.normalized();
let _ = terrain
let ecs = state.ecs_mut();
let mut block_change = ecs.write_resource::<BlockChange>();
let _ = ecs
.read_resource::<TerrainMap>()
.ray(pos, pos + dir * radius)
.until(|_| rand::random::<f32>() < 0.05)
.for_each(|pos| block_change.set(pos, Block::empty()))
.cast();
}
}
ServerEvent::Shoot(entity) => {
let pos = state
.ecs()
.read_storage::<comp::Pos>()
.get(entity)
.unwrap()
.0;
Self::create_projectile(
state,
comp::Pos(pos),
comp::Vel(Vec3::new(0.0, 100.0, 3.0)),
comp::Body::Object(comp::object::Body::Bomb),
)
.build();
}
ServerEvent::Die { entity, cause } => {
let ecs = state.ecs_mut();
// Chat message
if let Some(player) = ecs.read_storage::<comp::Player>().get(entity) {
let msg = if let comp::HealthSource::Attack { by } = cause {
ecs.entity_from_uid(by.into()).and_then(|attacker| {
ecs.read_storage::<comp::Player>().get(attacker).map(
|attacker_alias| {
format!(
"{} was killed by {}",
&player.alias, &attacker_alias.alias
)
},
)
})
} else {
None
}
.unwrap_or(format!("{} died", &player.alias));
clients.notify_registered(ServerMsg::kill(msg));
}
{
// Give EXP to the client
let mut stats = ecs.write_storage::<comp::Stats>();
if let Some(entity_stats) = stats.get(entity).cloned() {
if let comp::HealthSource::Attack { by } = cause {
ecs.entity_from_uid(by.into()).map(|attacker| {
if let Some(attacker_stats) = stats.get_mut(attacker) {
// TODO: Discuss whether we should give EXP by Player Killing or not.
attacker_stats.exp.change_by(
entity_stats.health.maximum() as f64 / 10.0
+ entity_stats.level.level() as f64 * 10.0,
);
}
});
}
}
}
if let Some(client) = clients.get_mut(&entity) {
let _ = ecs.write_storage().insert(entity, comp::Vel(Vec3::zero()));
let _ = ecs.write_storage().insert(entity, comp::ForceUpdate);
client.force_state(ClientState::Dead);
} else {
let _ = state.ecs_mut().delete_entity_synced(entity);
}
}
ServerEvent::Respawn(entity) => {
// Only clients can respawn
if let Some(client) = clients.get_mut(&entity) {
client.allow_state(ClientState::Character);
state
.ecs_mut()
.write_storage::<comp::Stats>()
.get_mut(entity)
.map(|stats| stats.revive());
state
.ecs_mut()
.write_storage::<comp::Pos>()
.get_mut(entity)
.map(|pos| pos.0.z += 20.0);
let _ = state
.ecs_mut()
.write_storage()
.insert(entity, comp::ForceUpdate);
}
}
}
}
}
@ -348,16 +451,7 @@ impl Server {
scale = 2.5 + rand::random::<f32>();
}
self.state
.ecs_mut()
.create_entity_synced()
.with(comp::Pos(npc.pos))
.with(comp::Vel(Vec3::zero()))
.with(comp::Ori(Vec3::unit_y()))
.with(comp::Controller::default())
.with(body)
.with(stats)
.with(comp::ActionState::default())
self.create_npc(comp::Pos(npc.pos), stats, body)
.with(comp::Agent::enemy())
.with(comp::Scale(scale))
.build();
@ -475,13 +569,6 @@ impl Server {
// 7) Finish the tick, pass control back to the frontend.
// Cleanup
let ecs = self.state.ecs_mut();
for entity in ecs.entities().join() {
ecs.write_storage::<comp::Dying>().remove(entity);
ecs.write_storage::<comp::Respawning>().remove(entity);
}
Ok(frontend_events)
}
@ -885,12 +972,12 @@ impl Server {
state.write_component(entity, player);
// Sync physics of all entities
for (&uid, &pos, vel, ori, action_state) in (
for (&uid, &pos, vel, ori, character_state) in (
&state.ecs().read_storage::<Uid>(),
&state.ecs().read_storage::<comp::Pos>(), // We assume all these entities have a position
state.ecs().read_storage::<comp::Vel>().maybe(),
state.ecs().read_storage::<comp::Ori>().maybe(),
state.ecs().read_storage::<comp::ActionState>().maybe(),
state.ecs().read_storage::<comp::CharacterState>().maybe(),
)
.join()
{
@ -910,10 +997,10 @@ impl Server {
ori,
});
}
if let Some(action_state) = action_state.copied() {
client.notify(ServerMsg::EntityActionState {
if let Some(character_state) = character_state.copied() {
client.notify(ServerMsg::EntityCharacterState {
entity: uid.into(),
action_state,
character_state,
});
}
}
@ -928,84 +1015,7 @@ impl Server {
self.clients
.notify_registered(ServerMsg::EcsSync(self.state.ecs_mut().next_sync_package()));
// TODO: Move this into some new method like `handle_sys_outputs` right after ticking the world
// Handle deaths.
let ecs = self.state.ecs_mut();
let clients = &mut self.clients;
let todo_kill = (&ecs.entities(), &ecs.read_storage::<comp::Dying>())
.join()
.map(|(entity, dying)| {
// Chat message
if let Some(player) = ecs.read_storage::<comp::Player>().get(entity) {
let msg = if let comp::HealthSource::Attack { by } = dying.cause {
ecs.entity_from_uid(by.into()).and_then(|attacker| {
ecs.read_storage::<comp::Player>()
.get(attacker)
.map(|attacker_alias| {
format!(
"{} was killed by {}",
&player.alias, &attacker_alias.alias
)
})
})
} else {
None
}
.unwrap_or(format!("{} died", &player.alias));
clients.notify_registered(ServerMsg::kill(msg));
}
// Give EXP to the client
let mut stats = ecs.write_storage::<comp::Stats>();
if let Some(entity_stats) = stats.get(entity).cloned() {
if let comp::HealthSource::Attack { by } = dying.cause {
ecs.entity_from_uid(by.into()).map(|attacker| {
if let Some(attacker_stats) = stats.get_mut(attacker) {
// TODO: Discuss whether we should give EXP by Player Killing or not.
attacker_stats.exp.change_by(
entity_stats.health.maximum() as f64 / 10.0
+ entity_stats.level.level() as f64 * 10.0,
);
}
});
}
}
entity
})
.collect::<Vec<_>>();
// Actually kill them
for entity in todo_kill {
if let Some(client) = self.clients.get_mut(&entity) {
let _ = ecs.write_storage().insert(entity, comp::Vel(Vec3::zero()));
let _ = ecs.write_storage().insert(entity, comp::ForceUpdate);
client.force_state(ClientState::Dead);
} else {
let _ = ecs.delete_entity_synced(entity);
continue;
}
}
// Handle respawns
let todo_respawn = (&ecs.entities(), &ecs.read_storage::<comp::Respawning>())
.join()
.map(|(entity, _)| entity)
.collect::<Vec<EcsEntity>>();
for entity in todo_respawn {
if let Some(client) = self.clients.get_mut(&entity) {
client.allow_state(ClientState::Character);
ecs.write_storage::<comp::Stats>()
.get_mut(entity)
.map(|stats| stats.revive());
ecs.write_storage::<comp::Pos>()
.get_mut(entity)
.map(|pos| pos.0.z += 20.0);
let _ = ecs.write_storage().insert(entity, comp::ForceUpdate);
}
}
// Sync physics
for (entity, &uid, &pos, force_update) in (
@ -1043,7 +1053,7 @@ impl Server {
let mut last_pos = ecs.write_storage::<comp::Last<comp::Pos>>();
let mut last_vel = ecs.write_storage::<comp::Last<comp::Vel>>();
let mut last_ori = ecs.write_storage::<comp::Last<comp::Ori>>();
let mut last_action_state = ecs.write_storage::<comp::Last<comp::ActionState>>();
let mut last_character_state = ecs.write_storage::<comp::Last<comp::CharacterState>>();
if let Some(client_pos) = ecs.read_storage::<comp::Pos>().get(entity) {
if last_pos
@ -1099,16 +1109,19 @@ impl Server {
}
}
if let Some(client_action_state) = ecs.read_storage::<comp::ActionState>().get(entity) {
if last_action_state
if let Some(client_character_state) =
ecs.read_storage::<comp::CharacterState>().get(entity)
{
if last_character_state
.get(entity)
.map(|&l| l != *client_action_state)
.map(|&l| l != *client_character_state)
.unwrap_or(true)
{
let _ = last_action_state.insert(entity, comp::Last(*client_action_state));
let msg = ServerMsg::EntityActionState {
let _ =
last_character_state.insert(entity, comp::Last(*client_character_state));
let msg = ServerMsg::EntityCharacterState {
entity: uid.into(),
action_state: *client_action_state,
character_state: *client_character_state,
};
match force_update {
Some(_) => clients.notify_ingame_if(msg, in_vd),

View File

@ -30,7 +30,7 @@ euc = "0.3.0"
specs = "0.14.2"
# Mathematics
vek = "0.9.8"
vek = { version = "0.9.8", features = ["serde"] }
# discord
discord-rpc-sdk = { git = "https://github.com/Songtronix/rust-discord-rpc.git", optional = true }

View File

@ -0,0 +1,253 @@
use super::{
super::{Animation, SkeletonAttr},
CharacterSkeleton,
};
use common::comp::item::Tool;
use std::{f32::consts::PI, ops::Mul};
use vek::*;
pub struct Input {
pub attack: bool,
}
pub struct BlockAnimation;
impl Animation for BlockAnimation {
type Skeleton = CharacterSkeleton;
type Dependency = f64;
fn update_skeleton(
skeleton: &Self::Skeleton,
global_time: f64,
anim_time: f64,
skeleton_attr: &SkeletonAttr,
) -> Self::Skeleton {
let mut next = (*skeleton).clone();
let wave_ultra_slow = (anim_time as f32 * 3.0 + PI).sin();
let wave_ultra_slow_cos = (anim_time as f32 * 3.0 + PI).cos();
let wave_slow_cos = (anim_time as f32 * 6.0 + PI).cos();
let _wave_slow = (anim_time as f32 * 6.0 + PI).sin();
let _head_look = Vec2::new(
((global_time + anim_time) as f32 / 1.5)
.floor()
.mul(7331.0)
.sin()
* 0.3,
((global_time + anim_time) as f32 / 1.5)
.floor()
.mul(1337.0)
.sin()
* 0.15,
);
next.head.offset = Vec3::new(
0.0 + skeleton_attr.neck_right + wave_slow_cos * 0.2,
1.0 + skeleton_attr.neck_forward,
skeleton_attr.neck_height + 13.5 + wave_ultra_slow * 0.2,
);
next.head.ori = Quaternion::rotation_x(-0.25);
next.head.scale = Vec3::one() * 1.01 * skeleton_attr.head_scale;
next.chest.offset = Vec3::new(0.0 + wave_slow_cos * 0.2, 0.0, 5.0 + wave_ultra_slow * 0.2);
next.chest.ori =
Quaternion::rotation_x(-0.15) * Quaternion::rotation_y(wave_ultra_slow_cos * 0.01);
next.chest.scale = Vec3::one();
next.belt.offset = Vec3::new(0.0 + wave_slow_cos * 0.2, 0.0, 3.0 + wave_ultra_slow * 0.2);
next.belt.ori =
Quaternion::rotation_x(0.0) * Quaternion::rotation_y(wave_ultra_slow_cos * 0.008);
next.belt.scale = Vec3::one() * 1.01;
next.shorts.offset = Vec3::new(0.0 + wave_slow_cos * 0.2, 0.0, 1.0 + wave_ultra_slow * 0.2);
next.shorts.ori = Quaternion::rotation_x(0.1);
next.shorts.scale = Vec3::one();
match Tool::Hammer {
//TODO: Inventory
Tool::Sword => {
next.l_hand.offset = Vec3::new(-6.0, 3.5, 0.0 + wave_ultra_slow * 1.0);
next.l_hand.ori = Quaternion::rotation_x(-0.3);
next.l_hand.scale = Vec3::one() * 1.01;
next.r_hand.offset = Vec3::new(-6.0, 3.0, -2.0);
next.r_hand.ori = Quaternion::rotation_x(-0.3);
next.r_hand.scale = Vec3::one() * 1.01;
next.weapon.offset = Vec3::new(
-6.0 + skeleton_attr.weapon_x,
4.5 + skeleton_attr.weapon_y,
0.0,
);
next.weapon.ori = Quaternion::rotation_x(-0.3)
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0);
next.weapon.scale = Vec3::one();
}
Tool::Axe => {
next.l_hand.offset = Vec3::new(
-6.0 + wave_ultra_slow_cos * 1.0,
3.5 + wave_ultra_slow_cos * 0.5,
0.0 + wave_ultra_slow * 1.0,
);
next.l_hand.ori = Quaternion::rotation_x(-0.3);
next.l_hand.scale = Vec3::one() * 1.01;
next.r_hand.offset = Vec3::new(
-6.0 + wave_ultra_slow_cos * 1.0,
3.0 + wave_ultra_slow_cos * 0.5,
-2.0 + wave_ultra_slow * 1.0,
);
next.r_hand.ori = Quaternion::rotation_x(-0.3);
next.r_hand.scale = Vec3::one() * 1.01;
next.weapon.offset = Vec3::new(
-6.0 + skeleton_attr.weapon_x,
4.5 + skeleton_attr.weapon_y,
0.0 + wave_ultra_slow * 1.0,
);
next.weapon.ori = Quaternion::rotation_x(-0.3)
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0);
next.weapon.scale = Vec3::one();
}
Tool::Hammer => {
next.l_hand.offset = Vec3::new(-5.5, 9.0, 5.5);
next.l_hand.ori = Quaternion::rotation_x(-0.3)
* Quaternion::rotation_y(-1.57)
* Quaternion::rotation_z(0.5);
next.l_hand.scale = Vec3::one() * 1.01;
next.r_hand.offset = Vec3::new(8.4, 9.3, 5.5);
next.r_hand.ori = Quaternion::rotation_x(-0.3)
* Quaternion::rotation_y(-1.57)
* Quaternion::rotation_z(0.5);
next.r_hand.scale = Vec3::one() * 1.01;
next.weapon.offset = Vec3::new(
7.0 + skeleton_attr.weapon_x,
10.75 + skeleton_attr.weapon_y,
5.5,
);
next.weapon.ori = Quaternion::rotation_x(-0.3)
* Quaternion::rotation_y(-1.57)
* Quaternion::rotation_z(0.5);
next.weapon.scale = Vec3::one();
}
Tool::Staff => {
next.l_hand.offset = Vec3::new(
-6.0 + wave_ultra_slow_cos * 1.0,
3.5 + wave_ultra_slow_cos * 0.5,
0.0 + wave_ultra_slow * 1.0,
);
next.l_hand.ori = Quaternion::rotation_x(-0.3);
next.l_hand.scale = Vec3::one() * 1.01;
next.r_hand.offset = Vec3::new(
-6.0 + wave_ultra_slow_cos * 1.0,
3.0 + wave_ultra_slow_cos * 0.5,
-2.0 + wave_ultra_slow * 1.0,
);
next.r_hand.ori = Quaternion::rotation_x(-0.3);
next.r_hand.scale = Vec3::one() * 1.01;
next.weapon.offset = Vec3::new(
-6.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0,
4.5 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5,
0.0 + wave_ultra_slow * 1.0,
);
next.weapon.ori = Quaternion::rotation_x(-0.3)
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0);
next.weapon.scale = Vec3::one();
}
Tool::SwordShield => {
next.l_hand.offset = Vec3::new(
-6.0 + wave_ultra_slow_cos * 1.0,
3.5 + wave_ultra_slow_cos * 0.5,
0.0 + wave_ultra_slow * 1.0,
);
next.l_hand.ori = Quaternion::rotation_x(-0.3);
next.l_hand.scale = Vec3::one() * 1.01;
next.r_hand.offset = Vec3::new(
-6.0 + wave_ultra_slow_cos * 1.0,
3.0 + wave_ultra_slow_cos * 0.5,
-2.0 + wave_ultra_slow * 1.0,
);
next.r_hand.ori = Quaternion::rotation_x(-0.3);
next.r_hand.scale = Vec3::one() * 1.01;
next.weapon.offset = Vec3::new(
-6.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0,
4.5 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5,
0.0 + wave_ultra_slow * 1.0,
);
next.weapon.ori = Quaternion::rotation_x(-0.3)
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0);
next.weapon.scale = Vec3::one();
}
Tool::Bow => {
next.l_hand.offset = Vec3::new(
-6.0 + wave_ultra_slow_cos * 1.0,
3.5 + wave_ultra_slow_cos * 0.5,
0.0 + wave_ultra_slow * 1.0,
);
next.l_hand.ori = Quaternion::rotation_x(-0.3);
next.l_hand.scale = Vec3::one() * 1.01;
next.r_hand.offset = Vec3::new(
-6.0 + wave_ultra_slow_cos * 1.0,
3.0 + wave_ultra_slow_cos * 0.5,
-2.0 + wave_ultra_slow * 1.0,
);
next.r_hand.ori = Quaternion::rotation_x(-0.3);
next.r_hand.scale = Vec3::one() * 1.01;
next.weapon.offset = Vec3::new(
-6.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0,
4.5 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5,
0.0 + wave_ultra_slow * 1.0,
);
next.weapon.ori = Quaternion::rotation_x(-0.3)
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0);
next.weapon.scale = Vec3::one();
}
Tool::Daggers => {
next.l_hand.offset = Vec3::new(
-6.0 + wave_ultra_slow_cos * 1.0,
3.5 + wave_ultra_slow_cos * 0.5,
0.0 + wave_ultra_slow * 1.0,
);
next.l_hand.ori = Quaternion::rotation_x(-0.3);
next.l_hand.scale = Vec3::one() * 1.01;
next.r_hand.offset = Vec3::new(-6.0, 3.0, -2.0);
next.r_hand.ori = Quaternion::rotation_x(-0.3);
next.r_hand.scale = Vec3::one() * 1.01;
next.weapon.offset = Vec3::new(
-6.0 + skeleton_attr.weapon_x,
4.5 + skeleton_attr.weapon_y,
0.0,
);
next.weapon.ori = Quaternion::rotation_x(-0.3)
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0);
next.weapon.scale = Vec3::one();
}
}
next.l_foot.offset = Vec3::new(-3.4, 0.3, 8.0 + wave_ultra_slow_cos * 0.1);
next.l_foot.ori = Quaternion::rotation_x(-0.3);
next.l_foot.scale = Vec3::one();
next.r_foot.offset = Vec3::new(3.4, 1.2, 8.0 + wave_ultra_slow * 0.1);
next.r_foot.ori = Quaternion::rotation_x(0.3);
next.r_foot.scale = Vec3::one();
next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 4.7);
next.l_shoulder.ori = Quaternion::rotation_x(0.0);
next.l_shoulder.scale = Vec3::one() * 1.1;
next.r_shoulder.offset = Vec3::new(5.0, 0.0, 4.7);
next.r_shoulder.ori = Quaternion::rotation_x(0.0);
next.r_shoulder.scale = Vec3::one() * 1.1;
next.draw.offset = Vec3::new(0.0, 5.0, 0.0);
next.draw.ori = Quaternion::rotation_y(0.0);
next.draw.scale = Vec3::one() * 0.0;
next.torso.offset = Vec3::new(0.0, -0.2, 0.1) * skeleton_attr.scaler;
next.torso.ori = Quaternion::rotation_x(0.0);
next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler;
next
}
}

View File

@ -1,4 +1,5 @@
pub mod attack;
pub mod block;
pub mod cidle;
pub mod cjump;
pub mod crun;
@ -10,6 +11,7 @@ pub mod run;
// Reexports
pub use self::attack::AttackAnimation;
pub use self::block::BlockAnimation;
pub use self::cidle::CidleAnimation;
pub use self::cjump::CjumpAnimation;
pub use self::crun::CrunAnimation;

View File

@ -693,6 +693,12 @@ impl FigureMgr {
skeleton_attr,
)
}
comp::Animation::Block => anim::character::BlockAnimation::update_skeleton(
state.skeleton_mut(),
time,
animation_info.time,
skeleton_attr,
),
comp::Animation::Cjump => anim::character::CjumpAnimation::update_skeleton(
state.skeleton_mut(),
time,

View File

@ -2,7 +2,7 @@ use crate::{
hud::{DebugInfo, Event as HudEvent, Hud},
key_state::KeyState,
render::Renderer,
scene::{camera::Camera, Scene},
scene::Scene,
window::{Event, GameInput},
Direction, Error, GlobalState, PlayState, PlayStateResult,
};
@ -105,19 +105,19 @@ impl PlayState for SessionState {
self.client.borrow_mut().send_chat(cmd.to_string());
}
}
// Compute camera data
let get_cam_data = |camera: &Camera, client: &Client| {
let (view_mat, _, cam_pos) = camera.compute_dependents(client);
let cam_dir: Vec3<f32> = Vec3::from(view_mat.inverted() * -Vec4::unit_z());
(cam_dir, cam_pos)
};
// Game loop
let mut current_client_state = self.client.borrow().get_client_state();
while let ClientState::Pending | ClientState::Character | ClientState::Dead =
current_client_state
{
// Compute camera data
let (view_mat, _, cam_pos) = self
.scene
.camera()
.compute_dependents(&self.client.borrow());
let cam_dir: Vec3<f32> = Vec3::from(view_mat.inverted() * -Vec4::unit_z());
// Handle window events.
for event in global_state.window.fetch_events() {
// Pass all events to the ui first.
@ -142,8 +142,6 @@ impl PlayState for SessionState {
.get(client.entity())
.is_some()
{
let (cam_dir, cam_pos) = get_cam_data(&self.scene.camera(), &client);
let (d, b) = {
let terrain = client.state().terrain();
let ray = terrain.ray(cam_pos, cam_pos + cam_dir * 100.0).cast();
@ -160,32 +158,27 @@ impl PlayState for SessionState {
}
}
Event::InputUpdate(GameInput::SecondAttack, state) => {
if state {
let mut client = self.client.borrow_mut();
if client
Event::InputUpdate(GameInput::Block, state) => {
let mut client = self.client.borrow_mut();
if state
&& client
.state()
.read_storage::<comp::CanBuild>()
.get(client.entity())
.is_some()
{
let (cam_dir, cam_pos) =
get_cam_data(&self.scene.camera(), &client);
{
let (d, b) = {
let terrain = client.state().terrain();
let ray = terrain.ray(cam_pos, cam_pos + cam_dir * 100.0).cast();
(ray.0, if let Ok(Some(_)) = ray.1 { true } else { false })
};
let (d, b) = {
let terrain = client.state().terrain();
let ray =
terrain.ray(cam_pos, cam_pos + cam_dir * 100.0).cast();
(ray.0, if let Ok(Some(_)) = ray.1 { true } else { false })
};
if b {
let pos = (cam_pos + cam_dir * d).map(|e| e.floor() as i32);
client.remove_block(pos);
}
} else {
// TODO: Handle secondary attack
if b {
let pos = (cam_pos + cam_dir * d).map(|e| e.floor() as i32);
client.remove_block(pos);
}
} else {
self.controller.block = state;
}
}
Event::InputUpdate(GameInput::Roll, state) => {
@ -197,9 +190,6 @@ impl PlayState for SessionState {
.is_some()
{
if state {
let (cam_dir, cam_pos) =
get_cam_data(&self.scene.camera(), &client);
if let Ok(Some(block)) = client
.state()
.terrain()
@ -271,6 +261,8 @@ impl PlayState for SessionState {
let dir_vec = self.key_state.dir_vec();
self.controller.move_dir = unit_vecs.0 * dir_vec[0] + unit_vecs.1 * dir_vec[1];
self.controller.look_dir = cam_dir;
// Perform an in-game tick.
if let Err(err) = self.tick(clock.get_avg_delta()) {
error!("Failed to tick the scene: {:?}", err);

View File

@ -37,7 +37,7 @@ pub struct ControlSettings {
pub screenshot: KeyMouse,
pub toggle_ingame_ui: KeyMouse,
pub attack: KeyMouse,
pub second_attack: KeyMouse,
pub block: KeyMouse,
pub roll: KeyMouse,
pub interact: KeyMouse,
}
@ -69,7 +69,7 @@ impl Default for ControlSettings {
screenshot: KeyMouse::Key(VirtualKeyCode::F4),
toggle_ingame_ui: KeyMouse::Key(VirtualKeyCode::F6),
attack: KeyMouse::Mouse(MouseButton::Left),
second_attack: KeyMouse::Mouse(MouseButton::Right),
block: KeyMouse::Mouse(MouseButton::Right),
roll: KeyMouse::Mouse(MouseButton::Middle),
interact: KeyMouse::Key(VirtualKeyCode::E),
}

View File

@ -35,7 +35,7 @@ pub enum GameInput {
Screenshot,
ToggleIngameUi,
Attack,
SecondAttack,
Block,
Roll,
Respawn,
Interact,
@ -142,7 +142,7 @@ impl Window {
GameInput::ToggleIngameUi,
);
key_map.insert(settings.controls.attack, GameInput::Attack);
key_map.insert(settings.controls.second_attack, GameInput::SecondAttack);
key_map.insert(settings.controls.block, GameInput::Block);
key_map.insert(settings.controls.roll, GameInput::Roll);
key_map.insert(settings.controls.interact, GameInput::Interact);

View File

@ -6,7 +6,7 @@ edition = "2018"
[dependencies]
common = { package = "veloren-common", path = "../common" }
vek = "0.9.8"
vek = "0.9.9"
noise = "0.5.1"
hashbrown = { version = "0.5.0", features = ["serde", "nightly"] }
lazy_static = "1.3.0"