speedier weapons initial testing

This commit is contained in:
jshipsey
2021-02-11 01:05:33 -05:00
parent f8a6a48b41
commit d8eeffeacd
7 changed files with 134 additions and 165 deletions

View File

@ -9,9 +9,9 @@ ComboMelee(
knockback: 8.0, knockback: 8.0,
range: 3.5, range: 3.5,
angle: 50.0, angle: 50.0,
base_buildup_duration: 0.35, base_buildup_duration: 0.3,
base_swing_duration: 0.075, base_swing_duration: 0.075,
base_recover_duration: 0.4, base_recover_duration: 0.3,
forward_movement: 0.5, forward_movement: 0.5,
), ),
( (
@ -23,9 +23,9 @@ ComboMelee(
knockback: 12.0, knockback: 12.0,
range: 3.5, range: 3.5,
angle: 30.0, angle: 30.0,
base_buildup_duration: 0.5, base_buildup_duration: 0.4,
base_swing_duration: 0.1, base_swing_duration: 0.1,
base_recover_duration: 0.5, base_recover_duration: 0.4,
forward_movement: 0.25, forward_movement: 0.25,
), ),
], ],

View File

@ -8,7 +8,7 @@ ComboMelee(
knockback: 10.0, knockback: 10.0,
range: 4.5, range: 4.5,
angle: 50.0, angle: 50.0,
base_buildup_duration: 0.5, base_buildup_duration: 0.4,
base_swing_duration: 0.1, base_swing_duration: 0.1,
base_recover_duration: 0.2, base_recover_duration: 0.2,
forward_movement: 0.0, forward_movement: 0.0,

View File

@ -9,9 +9,9 @@ ComboMelee(
knockback: 10.0, knockback: 10.0,
range: 4.0, range: 4.0,
angle: 30.0, angle: 30.0,
base_buildup_duration: 0.35, base_buildup_duration: 0.2,
base_swing_duration: 0.1, base_swing_duration: 0.075,
base_recover_duration: 0.4, base_recover_duration: 0.2,
forward_movement: 0.5, forward_movement: 0.5,
), ),
( (
@ -22,10 +22,10 @@ ComboMelee(
poise_damage_increase: 0, poise_damage_increase: 0,
knockback: 12.0, knockback: 12.0,
range: 3.5, range: 3.5,
angle: 180.0, angle: 40.0,
base_buildup_duration: 0.4, base_buildup_duration: 0.15,
base_swing_duration: 0.6, base_swing_duration: 0.1,
base_recover_duration: 0.4, base_recover_duration: 0.3,
forward_movement: 0.0, forward_movement: 0.0,
), ),
( (
@ -37,9 +37,9 @@ ComboMelee(
knockback: 14.0, knockback: 14.0,
range: 6.0, range: 6.0,
angle: 10.0, angle: 10.0,
base_buildup_duration: 0.5, base_buildup_duration: 0.3,
base_swing_duration: 0.2, base_swing_duration: 0.1,
base_recover_duration: 0.3, base_recover_duration: 0.2,
forward_movement: 1.2, forward_movement: 1.2,
), ),
], ],

View File

@ -1,13 +1,12 @@
ItemDef( ItemDef(
name: "Sahagin", name: "Sahagin",
description: "Ceremonial attire used by members.", description: "Ceremonial attire used by members..",
kind: Armor( kind: Armor((
(
kind: Foot("Sahagin"), kind: Foot("Sahagin"),
stats: ( stats: (
protection: Normal(2.0)), protection: Normal(2.0),
poise_resilience: Normal(0.3), poise_resilience: Normal(1.0),
)
), ),
)),
quality: Low, quality: Low,
) )

View File

@ -1,13 +1,12 @@
ItemDef( ItemDef(
name: "Sahagin", name: "Sahagin",
description: "Ceremonial attire used by members.", description: "Ceremonial attire used by members..",
kind: Armor( kind: Armor((
(
kind: Pants("Sahagin"), kind: Pants("Sahagin"),
stats: ( stats: (
protection: Normal(2.0)), protection: Normal(2.0),
poise_resilience: Normal(3.0), poise_resilience: Normal(1.0),
)
), ),
)),
quality: Low, quality: Low,
) )

View File

@ -31,23 +31,15 @@ impl Animation for SpinAnimation {
*rate = 1.0; *rate = 1.0;
let mut next = (*skeleton).clone(); let mut next = (*skeleton).clone();
let lab = 1.0; let (movement1base, movement2base, movement3) = match stage_section {
let (movement1, movement2, movement3) = match stage_section {
Some(StageSection::Buildup) => ((anim_time as f32).powf(0.25), 0.0, 0.0), Some(StageSection::Buildup) => ((anim_time as f32).powf(0.25), 0.0, 0.0),
Some(StageSection::Swing) => (1.0, (anim_time as f32).powf(1.8), 0.0), Some(StageSection::Swing) => (1.0, anim_time as f32, 0.0),
Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powi(4)), Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powi(4)),
_ => (0.0, 0.0, 0.0), _ => (0.0, 0.0, 0.0),
}; };
let pullback = 1.0 - movement3;
let foot = (((5.0) let movement1 = movement1base * pullback;
/ (1.1 + 3.9 * ((anim_time as f32 * lab as f32 * 10.32).sin()).powi(2))) let movement2 = movement2base * pullback;
.sqrt())
* ((anim_time as f32 * lab as f32 * 10.32).sin());
let decel = (anim_time as f32 * 16.0 * lab as f32).min(PI / 2.0).sin();
let spin = (anim_time as f32 * 2.8 * lab as f32).sin();
let spinhalf = (anim_time as f32 * 1.4 * lab as f32).sin();
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
@ -64,20 +56,21 @@ impl Animation for SpinAnimation {
Quaternion::rotation_x(s_a.shr.3) * Quaternion::rotation_y(s_a.shr.4); Quaternion::rotation_x(s_a.shr.3) * Quaternion::rotation_y(s_a.shr.4);
next.control.position = Vec3::new( next.control.position = Vec3::new(
s_a.sc.0 + movement1 * 2.0 + movement2 * -4.0 + movement3 * -7.0, s_a.sc.0 + movement1 * 2.0 + movement2 * -12.0 + movement3 * -7.0,
s_a.sc.1 + 8.0 + movement1 * 0.6 + movement3 * -10.0, s_a.sc.1 + 8.0 + movement1 * 0.6 + movement2 * -9.0 + movement3 * -10.0,
s_a.sc.2 + 1.0 + movement1 * 0.6 + movement2 * 1.5 + movement3 * -4.0, s_a.sc.2 + 1.0 + movement1 * 0.6 + movement2 * 1.5 + movement3 * -4.0,
); );
next.control.orientation = next.control.orientation =
Quaternion::rotation_x(-0.5 + s_a.sc.3 + movement1 * -1.2) Quaternion::rotation_x(-0.5 + s_a.sc.3 + movement1 * -1.2)
* Quaternion::rotation_y(s_a.sc.4 - 0.6 + movement1 * 1.0) * Quaternion::rotation_y(
* Quaternion::rotation_z(s_a.sc.5 + 0.1 + movement1 * 1.57); s_a.sc.4 - 0.6 + movement1 * 0.0 + movement2 * -1.3,
)
* Quaternion::rotation_z(s_a.sc.5 + 0.1 + movement1 * -1.57);
next.head.position = Vec3::new( next.head.position = Vec3::new(
0.0 + 2.0 + movement2 * -2.0, 0.0 + 2.0 + movement2 * -2.0,
2.0 + movement2 * -2.0 + s_a.head.0, 2.0 + movement2 * -2.0 + s_a.head.0,
s_a.head.1, s_a.head.1,
); );
next.head.orientation = Quaternion::rotation_z(movement2 * -0.4);
next.chest.orientation = Quaternion::rotation_x(movement2 * 0.15) next.chest.orientation = Quaternion::rotation_x(movement2 * 0.15)
* Quaternion::rotation_y(movement1 * -0.1 + movement2 * 0.3 + movement3 * -0.1) * Quaternion::rotation_y(movement1 * -0.1 + movement2 * 0.3 + movement3 * -0.1)
@ -91,10 +84,8 @@ impl Animation for SpinAnimation {
next.shorts.orientation = Quaternion::rotation_x(movement1 * 0.1) next.shorts.orientation = Quaternion::rotation_x(movement1 * 0.1)
* Quaternion::rotation_z(movement2.sin() * 1.5); * Quaternion::rotation_z(movement2.sin() * 1.5);
next.head.orientation = Quaternion::rotation_y(movement1 * 0.1 - movement2 * -0.1) next.head.orientation = Quaternion::rotation_y(movement1 * 0.1 + movement2 * -0.1)
* Quaternion::rotation_z(1.07 + movement1 * 0.4 + movement2 * -1.5); * Quaternion::rotation_z(1.07 + movement1 * 0.4 + movement2 * -1.1);
next.torso.orientation = Quaternion::rotation_z(movement2 * 6.28);
}, },
Some(ToolKind::Axe) => { Some(ToolKind::Axe) => {
@ -115,111 +106,55 @@ impl Animation for SpinAnimation {
}; };
next.control.position = Vec3::new( next.control.position = Vec3::new(
s_a.ac.0 + (-3.0 + movement1 * 0.0 + movement2 * -2.0) * (1.0 - movement3), s_a.ac.0 + (-3.0 + movement1 * 0.0 + movement2 * -2.0),
s_a.ac.1 + (-3.5 + movement1 * -4.6 + movement2 * 5.0) * (1.0 - movement3), s_a.ac.1 + (-3.5 + movement1 * -4.6 + movement2 * 5.0),
s_a.ac.2 + (-11.0 + movement1 * 10.0 + movement2 * -4.0) * (1.0 - movement3), s_a.ac.2 + (-11.0 + movement1 * 10.0 + movement2 * -4.0),
); );
next.control.orientation = Quaternion::rotation_x( next.control.orientation =
s_a.ac.3 + (-2.6 + movement1 * 0.0 + movement2 * -0.6) * (1.0 - movement3), Quaternion::rotation_x(s_a.ac.3 + (-2.6 + movement1 * 0.0 + movement2 * -0.6))
) * Quaternion::rotation_y( * Quaternion::rotation_y(
s_a.ac.4 + (0.2 + movement1 * -0.5 + movement2 * 0.0) * (1.0 - movement3), s_a.ac.4 + (0.2 + movement1 * -0.5 + movement2 * 0.0),
) * Quaternion::rotation_z( )
s_a.ac.5 + (-0.5 + movement1 * -3.0 + movement2 * 0.5) * (1.0 - movement3), * Quaternion::rotation_z(
s_a.ac.5 + (-0.5 + movement1 * -3.0 + movement2 * 0.5),
); );
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1); next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
next.chest.orientation = next.chest.orientation = Quaternion::rotation_x(0.4 + movement2 * -0.5)
Quaternion::rotation_x((0.4 + movement2 * -0.5) * (1.0 - movement3)) * Quaternion::rotation_y(movement1 * -0.1 + movement2 * 0.0)
* Quaternion::rotation_y( * Quaternion::rotation_z(0.5 + movement1 * -0.6 + movement2 * 0.6);
(0.0 + movement1 * -0.1 + movement2 * 0.0) * (1.0 - movement3),
)
* Quaternion::rotation_z(
(0.5 + movement1 * -0.6 + movement2 * 0.6) * (1.0 - movement3),
);
next.belt.orientation = Quaternion::rotation_x(movement1 * -0.2 + movement2 * 0.2); next.belt.orientation = Quaternion::rotation_x(movement1 * -0.2 + movement2 * 0.2);
next.shorts.orientation = next.shorts.orientation =
Quaternion::rotation_x(0.0 + movement1 * -0.2 + movement2 * 0.2); Quaternion::rotation_x(movement1 * -0.2 + movement2 * 0.2);
next.head.orientation = next.head.orientation = Quaternion::rotation_y(movement1 * 0.0 + movement3 * -0.0)
Quaternion::rotation_y(0.0 + movement1 * 0.0 + movement3 * -0.0) * Quaternion::rotation_z(1.0 + movement1 * -0.5 + movement2 * 0.0);
* Quaternion::rotation_z(
(1.0 + movement1 * -0.5 + movement2 * 0.0) * (1.0 - movement3),
);
next.torso.position = Vec3::new( next.torso.position = Vec3::new(
0.0, 0.0,
0.0, 0.0,
(-1.0 -1.0 + 1.0 * (movement1 * 0.5 * PI).sin()
+ 1.0 * (movement1 * 0.5 * PI).sin() + 1.0 * (movement2 * 0.5 * PI + 0.5 * PI).sin(),
+ 1.0 * (movement2 * 0.5 * PI + 0.5 * PI).sin())
* (1.0 - movement3),
);
next.torso.orientation = Quaternion::rotation_z(
movement1.powi(2) * -6.0 + movement2 * -1.7 + movement3 * 1.4,
); );
next.torso.orientation =
Quaternion::rotation_z(movement1.powi(2) * -6.0 + movement2 * -1.7);
next.foot_l.position = Vec3::new( next.foot_l.position = Vec3::new(
-s_a.foot.0 + (movement1 * -1.0 + movement2 * -3.0) * (1.0 - movement3), -s_a.foot.0 + (movement1 * -1.0 + movement2 * -3.0),
s_a.foot.1, s_a.foot.1,
s_a.foot.2 + (movement2 * 6.0) * (1.0 - movement3), s_a.foot.2 + (movement2 * 6.0),
); );
next.foot_l.orientation = next.foot_l.orientation = Quaternion::rotation_x(movement1 * 0.2 + movement2 * 0.5)
Quaternion::rotation_x((movement1 * 0.2 + movement2 * 0.5) * (1.0 - movement3)) * Quaternion::rotation_y(movement2 * 0.5);
* Quaternion::rotation_y((movement2 * 0.5) * (1.0 - movement3));
next.foot_r.position = Vec3::new( next.foot_r.position = Vec3::new(
s_a.foot.0, s_a.foot.0,
s_a.foot.1 + (movement1 * -2.0 + movement2 * -3.0) * (1.0 - movement3), s_a.foot.1 + (movement1 * -2.0 + movement2 * -3.0),
s_a.foot.2, s_a.foot.2,
); );
next.foot_r.orientation = Quaternion::rotation_x( next.foot_r.orientation =
(movement1 * -0.5 + movement2 * -0.5) * (1.0 - movement3), Quaternion::rotation_x(movement1 * -0.5 + movement2 * -0.5);
);
},
Some(ToolKind::Hammer) => {
next.hand_l.position = Vec3::new(-0.75, -1.0, -2.5);
next.hand_l.orientation = Quaternion::rotation_x(1.27);
next.hand_r.position = Vec3::new(0.75, -1.5, -5.5);
next.hand_r.orientation = Quaternion::rotation_x(1.27);
next.main.position = Vec3::new(0.0, 6.0, -1.0);
next.main.orientation = Quaternion::rotation_x(-0.3)
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0);
next.control.position = Vec3::new(-4.5 + spinhalf * 4.0, 11.0, 8.0);
next.control.orientation = Quaternion::rotation_x(-1.7)
* Quaternion::rotation_y(0.2 + spin * -2.0)
* Quaternion::rotation_z(1.4 + spin * 0.1);
next.head.position = Vec3::new(0.0, -1.0 + s_a.head.0 + spin * -0.8, s_a.head.1);
next.head.orientation = Quaternion::rotation_z(spin * -0.25)
* Quaternion::rotation_x(0.0 + spin * -0.1)
* Quaternion::rotation_y(spin * -0.2);
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
next.chest.orientation = Quaternion::rotation_z(spin * 0.1)
* Quaternion::rotation_x(0.0 + spin * 0.1)
* Quaternion::rotation_y(decel * -0.2);
next.belt.position = Vec3::new(0.0, 0.0, -2.0);
next.belt.orientation = next.chest.orientation * -0.1;
next.shorts.position = Vec3::new(0.0, 0.0, -5.0);
next.belt.orientation = next.chest.orientation * -0.08;
next.torso.orientation = Quaternion::rotation_z((spin * 7.0).max(0.3));
next.foot_l.position = Vec3::new(-s_a.foot.0, foot * 1.0, s_a.foot.2);
next.foot_l.orientation = Quaternion::rotation_x(foot * -1.2);
next.foot_r.position = Vec3::new(s_a.foot.0, foot * -1.0, s_a.foot.2);
next.foot_r.orientation = Quaternion::rotation_x(foot * 1.2);
next.lantern.orientation =
Quaternion::rotation_x(spin * -0.7 + 0.4) * Quaternion::rotation_y(spin * 0.4);
next.foot_r.orientation = Quaternion::rotation_x(foot * 1.2);
next.lantern.orientation =
Quaternion::rotation_x(spin * -0.7 + 0.4) * Quaternion::rotation_y(spin * 0.4);
}, },
_ => {}, _ => {},
} }

View File

@ -798,7 +798,9 @@ impl Floor {
)) ))
.with_name("Outcast Leader".to_string()) .with_name("Outcast Leader".to_string())
.with_loot_drop(comp::Item::new_from_asset_expect(chosen)) .with_loot_drop(comp::Item::new_from_asset_expect(chosen))
.with_loadout_config(loadout_builder::LoadoutConfig::Outcast) .with_loadout_config(
loadout_builder::LoadoutConfig::Outcast,
)
.with_skillset_config( .with_skillset_config(
common::skillset_builder::SkillSetConfig::Outcast, common::skillset_builder::SkillSetConfig::Outcast,
) )
@ -860,27 +862,14 @@ impl Floor {
], ],
3 => vec![ 3 => vec![
EntityInfo::at(tile_wcenter.map(|e| e as f32)) EntityInfo::at(tile_wcenter.map(|e| e as f32))
.with_body(comp::Body::Humanoid( .with_body(comp::Body::BipedLarge(
comp::humanoid::Body::random() comp::biped_large::Body::random_with(
dynamic_rng,
&comp::biped_large::Species::Minotaur,
),
)) ))
.with_name("Cultist Acolyte".to_string()) .with_name("Minotaur".to_string())
.with_loot_drop(comp::Item::new_from_asset_expect(chosen)) .with_loot_drop(comp::Item::new_from_asset_expect(chosen)),
.with_loadout_config(loadout_builder::LoadoutConfig::CultistAcolyte)
.with_skillset_config(
common::skillset_builder::SkillSetConfig::CultistAcolyte
)
.with_scale(2.0)
.with_main_tool(comp::Item::new_from_asset_expect(
match dynamic_rng.gen_range(0..6) {
0 => "common.items.weapons.axe.malachite_axe-0",
1..=2 => "common.items.weapons.sword.cultist",
3 =>
"common.items.weapons.hammer.cultist_purp_2h-0",
4 => "common.items.weapons.staff.cultist_staff",
_ => "common.items.weapons.bow.bone-1",
},
),);
2
], ],
4 => vec![ 4 => vec![
EntityInfo::at(tile_wcenter.map(|e| e as f32)) EntityInfo::at(tile_wcenter.map(|e| e as f32))
@ -903,7 +892,9 @@ impl Floor {
)) ))
.with_name("Mindflayer".to_string()) .with_name("Mindflayer".to_string())
.with_loot_drop(comp::Item::new_from_asset_expect(chosen)) .with_loot_drop(comp::Item::new_from_asset_expect(chosen))
.with_skillset_config(common::skillset_builder::SkillSetConfig::Mindflayer), .with_skillset_config(
common::skillset_builder::SkillSetConfig::Mindflayer,
),
], ],
_ => { _ => {
vec![EntityInfo::at(tile_wcenter.map(|e| e as f32)).with_body( vec![EntityInfo::at(tile_wcenter.map(|e| e as f32)).with_body(
@ -1003,13 +994,58 @@ impl Floor {
], ],
2 => vec![ 2 => vec![
EntityInfo::at(tile_wcenter.map(|e| e as f32)) EntityInfo::at(tile_wcenter.map(|e| e as f32))
.with_body(comp::Body::QuadrupedMedium( .with_body(comp::Body::QuadrupedLow(
comp::quadruped_medium::Body::random_with( comp::quadruped_low::Body::random_with(
dynamic_rng, dynamic_rng,
&comp::quadruped_medium::Species::Tarasque, &comp::quadruped_low::Species::Hakulaq,
), ),
)) ))
.with_name("Tarasque".to_string()) .with_name("Hakulaq".to_string())
.with_loot_drop(comp::Item::new_from_asset_expect(chosen)),
EntityInfo::at(tile_wcenter.map(|e| e as f32))
.with_body(comp::Body::QuadrupedLow(
comp::quadruped_low::Body::random_with(
dynamic_rng,
&comp::quadruped_low::Species::Hakulaq,
),
))
.with_name("Hakulaq".to_string())
.with_loot_drop(comp::Item::new_from_asset_expect(chosen)),
EntityInfo::at(tile_wcenter.map(|e| e as f32))
.with_body(comp::Body::QuadrupedLow(
comp::quadruped_low::Body::random_with(
dynamic_rng,
&comp::quadruped_low::Species::Hakulaq,
),
))
.with_name("Hakulaq".to_string())
.with_loot_drop(comp::Item::new_from_asset_expect(chosen)),
EntityInfo::at(tile_wcenter.map(|e| e as f32))
.with_body(comp::Body::QuadrupedLow(
comp::quadruped_low::Body::random_with(
dynamic_rng,
&comp::quadruped_low::Species::Hakulaq,
),
))
.with_name("Hakulaq".to_string())
.with_loot_drop(comp::Item::new_from_asset_expect(chosen)),
EntityInfo::at(tile_wcenter.map(|e| e as f32))
.with_body(comp::Body::QuadrupedLow(
comp::quadruped_low::Body::random_with(
dynamic_rng,
&comp::quadruped_low::Species::Hakulaq,
),
))
.with_name("Hakulaq".to_string())
.with_loot_drop(comp::Item::new_from_asset_expect(chosen)),
EntityInfo::at(tile_wcenter.map(|e| e as f32))
.with_body(comp::Body::QuadrupedLow(
comp::quadruped_low::Body::random_with(
dynamic_rng,
&comp::quadruped_low::Species::Hakulaq,
),
))
.with_name("Hakulaq".to_string())
.with_loot_drop(comp::Item::new_from_asset_expect(chosen)), .with_loot_drop(comp::Item::new_from_asset_expect(chosen)),
], ],
3 => vec![ 3 => vec![