mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'james/fix-biped-large-roll' into 'master'
Make only humanoid agents attempt to roll See merge request veloren/veloren!1701
This commit is contained in:
commit
27796aac4e
@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Default inventory slots reduced to 18 - existing characters given 3x 6-slot bags as compensation
|
- Default inventory slots reduced to 18 - existing characters given 3x 6-slot bags as compensation
|
||||||
- Protection rating was moved to the top left of the loadout view
|
- Protection rating was moved to the top left of the loadout view
|
||||||
- Changed camera smoothing to be off by default.
|
- Changed camera smoothing to be off by default.
|
||||||
|
- Fixed AI behavior so only humanoids will attempt to roll
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
@ -565,7 +565,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
inputs.move_z = bearing.z;
|
inputs.move_z = bearing.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
if dist_sqrd < 16.0f32.powi(2)
|
if body.map(|b| b.is_humanoid()).unwrap_or(false) && dist_sqrd < 16.0f32.powi(2)
|
||||||
&& thread_rng().gen::<f32>() < 0.02
|
&& thread_rng().gen::<f32>() < 0.02
|
||||||
{
|
{
|
||||||
inputs.roll.set_state(true);
|
inputs.roll.set_state(true);
|
||||||
@ -614,7 +614,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
inputs.jump.set_state(bearing.z > 1.5);
|
inputs.jump.set_state(bearing.z > 1.5);
|
||||||
inputs.move_z = bearing.z;
|
inputs.move_z = bearing.z;
|
||||||
}
|
}
|
||||||
if dist_sqrd < 16.0f32.powi(2)
|
if body.map(|b| b.is_humanoid()).unwrap_or(false) && dist_sqrd < 16.0f32.powi(2)
|
||||||
&& thread_rng().gen::<f32>() < 0.02
|
&& thread_rng().gen::<f32>() < 0.02
|
||||||
{
|
{
|
||||||
inputs.roll.set_state(true);
|
inputs.roll.set_state(true);
|
||||||
@ -678,7 +678,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
inputs.move_z = bearing.z;
|
inputs.move_z = bearing.z;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if dist_sqrd < 16.0f32.powi(2)
|
if body.map(|b| b.is_humanoid()).unwrap_or(false) && dist_sqrd < 16.0f32.powi(2)
|
||||||
&& thread_rng().gen::<f32>() < 0.02
|
&& thread_rng().gen::<f32>() < 0.02
|
||||||
{
|
{
|
||||||
inputs.roll.set_state(true);
|
inputs.roll.set_state(true);
|
||||||
@ -737,7 +737,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
inputs.move_z = bearing.z;
|
inputs.move_z = bearing.z;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if dist_sqrd < 16.0f32.powi(2)
|
if body.map(|b| b.is_humanoid()).unwrap_or(false) && dist_sqrd < 16.0f32.powi(2)
|
||||||
&& thread_rng().gen::<f32>() < 0.02
|
&& thread_rng().gen::<f32>() < 0.02
|
||||||
{
|
{
|
||||||
inputs.roll.set_state(true);
|
inputs.roll.set_state(true);
|
||||||
@ -747,7 +747,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
Tactic::Bow => {
|
Tactic::Bow => {
|
||||||
if dist_sqrd < (2.0 * MIN_ATTACK_DIST * scale).powi(2) {
|
if body.map(|b| b.is_humanoid()).unwrap_or(false) && dist_sqrd < (2.0 * MIN_ATTACK_DIST * scale).powi(2) {
|
||||||
inputs.roll.set_state(true);
|
inputs.roll.set_state(true);
|
||||||
} else if dist_sqrd < MAX_CHASE_DIST.powi(2)
|
} else if dist_sqrd < MAX_CHASE_DIST.powi(2)
|
||||||
|| (dist_sqrd < SIGHT_DIST.powi(2) && !*been_close)
|
|| (dist_sqrd < SIGHT_DIST.powi(2) && !*been_close)
|
||||||
@ -803,7 +803,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
inputs.move_z = bearing.z;
|
inputs.move_z = bearing.z;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if dist_sqrd < 16.0f32.powi(2)
|
if body.map(|b| b.is_humanoid()).unwrap_or(false) && dist_sqrd < 16.0f32.powi(2)
|
||||||
&& thread_rng().gen::<f32>() < 0.02
|
&& thread_rng().gen::<f32>() < 0.02
|
||||||
{
|
{
|
||||||
inputs.roll.set_state(true);
|
inputs.roll.set_state(true);
|
||||||
@ -813,7 +813,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
Tactic::Staff => {
|
Tactic::Staff => {
|
||||||
if dist_sqrd < (MIN_ATTACK_DIST * scale).powi(2) {
|
if body.map(|b| b.is_humanoid()).unwrap_or(false) && dist_sqrd < (MIN_ATTACK_DIST * scale).powi(2) {
|
||||||
inputs.roll.set_state(true);
|
inputs.roll.set_state(true);
|
||||||
} else if dist_sqrd
|
} else if dist_sqrd
|
||||||
< (5.0 * MIN_ATTACK_DIST * scale).powi(2)
|
< (5.0 * MIN_ATTACK_DIST * scale).powi(2)
|
||||||
@ -880,7 +880,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
inputs.move_z = bearing.z;
|
inputs.move_z = bearing.z;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if dist_sqrd < 16.0f32.powi(2)
|
if body.map(|b| b.is_humanoid()).unwrap_or(false) && dist_sqrd < 16.0f32.powi(2)
|
||||||
&& thread_rng().gen::<f32>() < 0.02
|
&& thread_rng().gen::<f32>() < 0.02
|
||||||
{
|
{
|
||||||
inputs.roll.set_state(true);
|
inputs.roll.set_state(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user