renamed vine summon abilities; brief comments for body_dist and it usage for harvester

This commit is contained in:
horblegorble 2024-06-16 11:32:45 +10:00
parent 789379f44e
commit 493b4b8fd3
6 changed files with 13 additions and 7 deletions

View File

@ -772,8 +772,8 @@
secondary: Simple(None, "common.abilities.custom.harvester.firebreath"), secondary: Simple(None, "common.abilities.custom.harvester.firebreath"),
abilities: [ abilities: [
Simple(None, "common.abilities.custom.harvester.explodingpumpkin"), Simple(None, "common.abilities.custom.harvester.explodingpumpkin"),
Simple(None, "common.abilities.custom.harvester.ensnaringvines_0"), Simple(None, "common.abilities.custom.harvester.ensnaringvines_sparse"),
Simple(None, "common.abilities.custom.harvester.ensnaringvines_1"), Simple(None, "common.abilities.custom.harvester.ensnaringvines_dense"),
], ],
), ),
// TODO: Allow ability sets to expand other ability sets // TODO: Allow ability sets to expand other ability sets

View File

@ -1204,6 +1204,8 @@ impl<'a> AgentData<'a> {
// Wield the weapon as running towards the target // Wield the weapon as running towards the target
controller.push_action(ControlAction::Wield); 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_radius = self.body.map_or(0.5, |b| b.max_radius()) * self.scale;
let self_attack_range = let self_attack_range =
(self.body.map_or(0.5, |b| b.max_radius()) + DEFAULT_ATTACK_RANGE) * self.scale; (self.body.map_or(0.5, |b| b.max_radius()) + DEFAULT_ATTACK_RANGE) * self.scale;

View File

@ -4764,8 +4764,8 @@ impl<'a> AgentData<'a> {
// Secondary: firebreath // Secondary: firebreath
// Abilities: // Abilities:
// 0: explosivepumpkin // 0: explosivepumpkin
// 1: ensaring_vines_0 // 1: ensaringvines_sparse
// 2: ensaring_vines_1 // 2: ensaringvines_dense
// --- setup --- // --- setup ---
@ -4854,6 +4854,7 @@ impl<'a> AgentData<'a> {
} }
} }
// close range // 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) { 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)) 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 // start using firebreath
controller.push_basic_input(InputKind::Secondary); 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 // throw pumpkin
controller.push_basic_input(InputKind::Ability(0)); controller.push_basic_input(InputKind::Ability(0));
} }
@ -4910,6 +4913,7 @@ impl<'a> AgentData<'a> {
} }
// closing gap // 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)) { if !(attack_data.dist_sqrd < (attack_data.body_dist + 0.4 * MELEE_RANGE).powi(2)) {
self.path_toward_target( self.path_toward_target(
agent, agent,

View File

@ -113,8 +113,8 @@ impl Animation for SpriteSummonAnimation {
* Quaternion::rotation_y(move2 * -0.1); * Quaternion::rotation_y(move2 * -0.1);
}, },
Some(ToolKind::Natural) => match ability_id { Some(ToolKind::Natural) => match ability_id {
Some("common.abilities.custom.harvester.ensnaringvines_0") Some("common.abilities.custom.harvester.ensnaringvines_sparse")
| Some("common.abilities.custom.harvester.ensnaringvines_1") => { | Some("common.abilities.custom.harvester.ensnaringvines_dense") => {
let (move1, move1pow, move2, move3) = match stage_section { let (move1, move1pow, move2, move3) = match stage_section {
Some(StageSection::Buildup) => (anim_time, anim_time.powf(0.1), 0.0, 0.0), Some(StageSection::Buildup) => (anim_time, anim_time.powf(0.1), 0.0, 0.0),
Some(StageSection::Action) => { Some(StageSection::Action) => {