Changed how it moved golem.

This commit is contained in:
Sam 2021-01-20 17:22:24 -05:00
parent c888ec0535
commit aaad5e49cc
4 changed files with 6 additions and 4 deletions

1
Cargo.lock generated
View File

@ -5995,6 +5995,7 @@ dependencies = [
"hashbrown 0.9.1",
"image",
"indexmap",
"inline_tweak",
"lazy_static",
"num-derive",
"num-traits 0.2.14",

View File

@ -28,6 +28,7 @@ spin_sleep = "1.0"
tracing = { version = "0.1", default-features = false }
vek = { version = "0.12.0", features = ["serde"] }
uuid = { version = "0.8.1", default-features = false, features = ["serde", "v4"] }
inline_tweak = "1.0.2"
# Assets
assets_manager = {version = "0.4.2", features = ["bincode", "ron", "json", "hot-reloading"]}

View File

@ -7,6 +7,7 @@ use crate::{
},
Damage, DamageSource, GroupTarget, Knockback,
};
use inline_tweak::*;
use serde::{Deserialize, Serialize};
use std::time::Duration;
use vek::Vec3;
@ -68,7 +69,8 @@ impl CharacterBehavior for Data {
update.vel.0 = Vec3::new(0.0, 0.0, new_vel_z) + data.inputs.move_dir * 5.0;
},
Helicopter::Golem => {
update.vel.0 = Vec3::new(0.0, 0.0, 10.0) + data.inputs.move_dir * 20.0;
update.vel.0 =
Vec3::new(0.0, 0.0, tweak!(20.0)) + *data.inputs.look_dir * tweak!(25.0);
},
}

View File

@ -912,9 +912,7 @@ impl<'a> System<'a> for Sys {
..traversal_config
},
) {
if matches!(char_states.get(entity), Some(CharacterState::SpinMelee(_))) {
inputs.move_dir = (tgt_pos.0 - pos.0).xy().try_normalized().unwrap_or(Vec2::zero());
} else if can_see_tgt(&*terrain, pos, tgt_pos, dist_sqrd) {
if can_see_tgt(&*terrain, pos, tgt_pos, dist_sqrd) {
inputs.move_dir = bearing
.xy()
.try_normalized()