mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Aim fireballs at feet
AI aims fireballs at the target’s feet, for a slight improvement in splash damage.
This commit is contained in:
parent
bd93e72f79
commit
034041fd4f
@ -33,6 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Updated client facing error messages to be localizable strings
|
- Updated client facing error messages to be localizable strings
|
||||||
- Nerfed some skill values
|
- Nerfed some skill values
|
||||||
- Tweaked critical chance of legendary weapons
|
- Tweaked critical chance of legendary weapons
|
||||||
|
- Agents using fireball projectiles aim at the feet instead of the eyes
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ use common::{
|
|||||||
tool::{AbilitySpec, ToolKind},
|
tool::{AbilitySpec, ToolKind},
|
||||||
ConsumableKind, Item, ItemDesc, ItemKind,
|
ConsumableKind, Item, ItemDesc, ItemKind,
|
||||||
},
|
},
|
||||||
|
projectile::ProjectileConstructor,
|
||||||
skills::{AxeSkill, BowSkill, HammerSkill, SceptreSkill, Skill, StaffSkill, SwordSkill},
|
skills::{AxeSkill, BowSkill, HammerSkill, SceptreSkill, Skill, StaffSkill, SwordSkill},
|
||||||
Agent, Alignment, BehaviorCapability, BehaviorState, Body, CharacterAbility,
|
Agent, Alignment, BehaviorCapability, BehaviorState, Body, CharacterAbility,
|
||||||
CharacterState, Combo, ControlAction, ControlEvent, Controller, Energy, Health,
|
CharacterState, Combo, ControlAction, ControlEvent, Controller, Energy, Health,
|
||||||
@ -1807,7 +1808,8 @@ impl<'a> AgentData<'a> {
|
|||||||
|
|
||||||
let eye_offset = self.body.map_or(0.0, |b| b.eye_height());
|
let eye_offset = self.body.map_or(0.0, |b| b.eye_height());
|
||||||
|
|
||||||
let tgt_eye_offset = tgt_data.body.map_or(0.0, |b| b.eye_height()) +
|
let tgt_eye_height = tgt_data.body.map_or(0.0, |b| b.eye_height());
|
||||||
|
let tgt_eye_offset = tgt_eye_height +
|
||||||
// Special case for jumping attacks to jump at the body
|
// Special case for jumping attacks to jump at the body
|
||||||
// of the target and not the ground around the target
|
// of the target and not the ground around the target
|
||||||
// For the ranged it is to shoot at the feet and not
|
// For the ranged it is to shoot at the feet and not
|
||||||
@ -1854,6 +1856,15 @@ impl<'a> AgentData<'a> {
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
CharacterState::BasicRanged(c) => {
|
CharacterState::BasicRanged(c) => {
|
||||||
|
let offset_z = match c.static_data.projectile {
|
||||||
|
// Aim fireballs at feet instead of eyes for splash damage
|
||||||
|
ProjectileConstructor::Fireball {
|
||||||
|
damage: _,
|
||||||
|
radius: _,
|
||||||
|
energy_regen: _,
|
||||||
|
} => 0.0,
|
||||||
|
_ => tgt_eye_offset,
|
||||||
|
};
|
||||||
let projectile_speed = c.static_data.projectile_speed;
|
let projectile_speed = c.static_data.projectile_speed;
|
||||||
aim_projectile(
|
aim_projectile(
|
||||||
projectile_speed,
|
projectile_speed,
|
||||||
@ -1864,7 +1875,7 @@ impl<'a> AgentData<'a> {
|
|||||||
Vec3::new(
|
Vec3::new(
|
||||||
tgt_data.pos.0.x,
|
tgt_data.pos.0.x,
|
||||||
tgt_data.pos.0.y,
|
tgt_data.pos.0.y,
|
||||||
tgt_data.pos.0.z + tgt_eye_offset,
|
tgt_data.pos.0.z + offset_z,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user