mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
renamed vine summon abilities; brief comments for body_dist and it usage for harvester
This commit is contained in:
parent
789379f44e
commit
493b4b8fd3
@ -772,8 +772,8 @@
|
||||
secondary: Simple(None, "common.abilities.custom.harvester.firebreath"),
|
||||
abilities: [
|
||||
Simple(None, "common.abilities.custom.harvester.explodingpumpkin"),
|
||||
Simple(None, "common.abilities.custom.harvester.ensnaringvines_0"),
|
||||
Simple(None, "common.abilities.custom.harvester.ensnaringvines_1"),
|
||||
Simple(None, "common.abilities.custom.harvester.ensnaringvines_sparse"),
|
||||
Simple(None, "common.abilities.custom.harvester.ensnaringvines_dense"),
|
||||
],
|
||||
),
|
||||
// TODO: Allow ability sets to expand other ability sets
|
||||
|
@ -1204,6 +1204,8 @@ impl<'a> AgentData<'a> {
|
||||
// Wield the weapon as running towards the target
|
||||
controller.push_action(ControlAction::Wield);
|
||||
|
||||
// Information for attack checks
|
||||
// 'min_attack_dist' uses DEFAULT_ATTACK_RANGE, while 'body_dist' does not
|
||||
let self_radius = self.body.map_or(0.5, |b| b.max_radius()) * self.scale;
|
||||
let self_attack_range =
|
||||
(self.body.map_or(0.5, |b| b.max_radius()) + DEFAULT_ATTACK_RANGE) * self.scale;
|
||||
|
@ -4764,8 +4764,8 @@ impl<'a> AgentData<'a> {
|
||||
// Secondary: firebreath
|
||||
// Abilities:
|
||||
// 0: explosivepumpkin
|
||||
// 1: ensaring_vines_0
|
||||
// 2: ensaring_vines_1
|
||||
// 1: ensaringvines_sparse
|
||||
// 2: ensaringvines_dense
|
||||
|
||||
// --- setup ---
|
||||
|
||||
@ -4854,6 +4854,7 @@ impl<'a> AgentData<'a> {
|
||||
}
|
||||
}
|
||||
// close range
|
||||
// 0.75 multiplier tuned to start melee attack while suitably in range
|
||||
else if attack_data.dist_sqrd < (attack_data.body_dist + 0.75 * MELEE_RANGE).powi(2) {
|
||||
if matches!(self.char_state, CharacterState::BasicBeam(c) if c.timer < Duration::from_secs_f32(FIREBREATH_SHORT_TIME))
|
||||
{
|
||||
@ -4894,7 +4895,9 @@ impl<'a> AgentData<'a> {
|
||||
{
|
||||
// start using firebreath
|
||||
controller.push_basic_input(InputKind::Secondary);
|
||||
} else if agent.combat_state.timers[ActionStateTimers::SinceCloseMixup as usize] > CLOSE_MIXUP_COOLDOWN {
|
||||
} else if agent.combat_state.timers[ActionStateTimers::SinceCloseMixup as usize]
|
||||
> CLOSE_MIXUP_COOLDOWN
|
||||
{
|
||||
// throw pumpkin
|
||||
controller.push_basic_input(InputKind::Ability(0));
|
||||
}
|
||||
@ -4910,6 +4913,7 @@ impl<'a> AgentData<'a> {
|
||||
}
|
||||
|
||||
// closing gap
|
||||
// 0.4 multiplier tuned to get comfortably in melee range
|
||||
if !(attack_data.dist_sqrd < (attack_data.body_dist + 0.4 * MELEE_RANGE).powi(2)) {
|
||||
self.path_toward_target(
|
||||
agent,
|
||||
|
@ -113,8 +113,8 @@ impl Animation for SpriteSummonAnimation {
|
||||
* Quaternion::rotation_y(move2 * -0.1);
|
||||
},
|
||||
Some(ToolKind::Natural) => match ability_id {
|
||||
Some("common.abilities.custom.harvester.ensnaringvines_0")
|
||||
| Some("common.abilities.custom.harvester.ensnaringvines_1") => {
|
||||
Some("common.abilities.custom.harvester.ensnaringvines_sparse")
|
||||
| Some("common.abilities.custom.harvester.ensnaringvines_dense") => {
|
||||
let (move1, move1pow, move2, move3) = match stage_section {
|
||||
Some(StageSection::Buildup) => (anim_time, anim_time.powf(0.1), 0.0, 0.0),
|
||||
Some(StageSection::Action) => {
|
||||
|
Loading…
Reference in New Issue
Block a user