mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
adlet npc work
This commit is contained in:
parent
9fbc759ccd
commit
c8bb0050ad
@ -542,6 +542,14 @@
|
||||
],
|
||||
),
|
||||
// TODO: Allow ability sets to expand other ability sets
|
||||
Custom("Ice Drake"): (
|
||||
primary: Simple(None, "common.abilities.custom.icedrake.triplestrike"),
|
||||
secondary: Simple(None, "common.abilities.custom.icedrake.singlestrike"),
|
||||
abilities: [
|
||||
Simple(None, "common.abilities.custom.icedrake.icebombs"),
|
||||
Simple(None, "common.abilities.custom.icedrake.icebreath"),
|
||||
],
|
||||
),
|
||||
Custom("Dagon"): (
|
||||
primary: Simple(None, "common.abilities.custom.dagon.dagonbombs"),
|
||||
secondary: Simple(None, "common.abilities.custom.dagon.seaurchins"),
|
||||
|
16
assets/common/abilities/custom/icedrake/icebombs.ron
Normal file
16
assets/common/abilities/custom/icedrake/icebombs.ron
Normal file
@ -0,0 +1,16 @@
|
||||
BasicRanged(
|
||||
energy_cost: 0,
|
||||
buildup_duration: 0.5,
|
||||
recover_duration: 0.9,
|
||||
projectile: IceBomb(
|
||||
damage: 30.0,
|
||||
radius: 3.0,
|
||||
knockback: 12.0,
|
||||
min_falloff: 0.1,
|
||||
),
|
||||
projectile_body: Object(IceBomb),
|
||||
projectile_speed: 25.0,
|
||||
num_projectiles: 5,
|
||||
projectile_spread: 0.07,
|
||||
move_efficiency: 0.3,
|
||||
)
|
19
assets/common/abilities/custom/icedrake/icebreath.ron
Normal file
19
assets/common/abilities/custom/icedrake/icebreath.ron
Normal file
@ -0,0 +1,19 @@
|
||||
BasicBeam(
|
||||
buildup_duration: 0.8,
|
||||
recover_duration: 0.5,
|
||||
beam_duration: 0.5,
|
||||
damage: 10.0,
|
||||
tick_rate: 3.0,
|
||||
range: 15.0,
|
||||
max_angle: 22.5,
|
||||
damage_effect: Some(Buff((
|
||||
kind: Frozen,
|
||||
dur_secs: 10.0,
|
||||
strength: DamageFraction(0.5),
|
||||
chance: 0.25,
|
||||
))),
|
||||
energy_regen: 0,
|
||||
energy_drain: 0,
|
||||
ori_rate: 0.3,
|
||||
specifier: Frost,
|
||||
)
|
27
assets/common/abilities/custom/icedrake/singlestrike.ron
Normal file
27
assets/common/abilities/custom/icedrake/singlestrike.ron
Normal file
@ -0,0 +1,27 @@
|
||||
ComboMelee(
|
||||
stage_data: [
|
||||
(
|
||||
stage: 1,
|
||||
base_damage: 40.0,
|
||||
damage_increase: 0,
|
||||
base_poise_damage: 28,
|
||||
poise_damage_increase: 0,
|
||||
knockback: 3.0,
|
||||
range: 2.0,
|
||||
angle: 60.0,
|
||||
base_buildup_duration: 1.2,
|
||||
base_swing_duration: 0.07,
|
||||
hit_timing: 0.5,
|
||||
base_recover_duration: 0.8,
|
||||
forward_movement: 3.0,
|
||||
damage_kind: Crushing,
|
||||
),
|
||||
],
|
||||
initial_energy_gain: 0,
|
||||
max_energy_gain: 0,
|
||||
energy_increase: 0,
|
||||
speed_increase: 0.0,
|
||||
max_speed_increase: 0.0,
|
||||
scales_from_combo: 0,
|
||||
ori_modifier: 0.6,
|
||||
)
|
59
assets/common/abilities/custom/icedrake/triplestrike.ron
Normal file
59
assets/common/abilities/custom/icedrake/triplestrike.ron
Normal file
@ -0,0 +1,59 @@
|
||||
ComboMelee(
|
||||
stage_data: [
|
||||
(
|
||||
stage: 1,
|
||||
base_damage: 28.0,
|
||||
damage_increase: 0,
|
||||
base_poise_damage: 15,
|
||||
poise_damage_increase: 0,
|
||||
knockback: 3.0,
|
||||
range: 2.2,
|
||||
angle: 30.0,
|
||||
base_buildup_duration: 1.3,
|
||||
base_swing_duration: 0.07,
|
||||
hit_timing: 0.5,
|
||||
base_recover_duration: 0.6,
|
||||
forward_movement: 2.0,
|
||||
damage_kind: Crushing,
|
||||
),
|
||||
(
|
||||
stage: 2,
|
||||
base_damage: 28.0,
|
||||
damage_increase: 0,
|
||||
base_poise_damage: 18,
|
||||
poise_damage_increase: 0,
|
||||
knockback: 3.0,
|
||||
range: 2.2,
|
||||
angle: 30.0,
|
||||
base_buildup_duration: 0.8,
|
||||
base_swing_duration: 0.07,
|
||||
hit_timing: 0.5,
|
||||
base_recover_duration: 0.6,
|
||||
forward_movement: 1.5,
|
||||
damage_kind: Crushing,
|
||||
),
|
||||
(
|
||||
stage: 3,
|
||||
base_damage: 28.0,
|
||||
damage_increase: 0,
|
||||
base_poise_damage: 20,
|
||||
poise_damage_increase: 0,
|
||||
knockback: 3.0,
|
||||
range: 2.2,
|
||||
angle: 30.0,
|
||||
base_buildup_duration: 0.8,
|
||||
base_swing_duration: 0.07,
|
||||
hit_timing: 0.5,
|
||||
base_recover_duration: 0.6,
|
||||
forward_movement: 1.5,
|
||||
damage_kind: Crushing,
|
||||
),
|
||||
],
|
||||
initial_energy_gain: 0,
|
||||
max_energy_gain: 0,
|
||||
energy_increase: 0,
|
||||
speed_increase: 0.0,
|
||||
max_speed_increase: 0.0,
|
||||
scales_from_combo: 0,
|
||||
ori_modifier: 0.65,
|
||||
)
|
21
assets/common/items/npc_weapons/unique/icedrake.ron
Normal file
21
assets/common/items/npc_weapons/unique/icedrake.ron
Normal file
@ -0,0 +1,21 @@
|
||||
ItemDef(
|
||||
name: "Ice Drake",
|
||||
description: "testing123",
|
||||
kind: Tool((
|
||||
kind: Natural,
|
||||
hands: Two,
|
||||
stats: (
|
||||
equip_time_secs: 0.01,
|
||||
power: 1.0,
|
||||
effect_power: 1.0,
|
||||
speed: 1.0,
|
||||
crit_chance: 0.0625,
|
||||
range: 1.0,
|
||||
energy_efficiency: 1.0,
|
||||
buff_strength: 1.0,
|
||||
),
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_spec: Some(Custom("Ice Drake")),
|
||||
)
|
@ -607,6 +607,9 @@ fn default_main_tool(body: &Body) -> Item {
|
||||
quadruped_low::Species::Basilisk => Some(Item::new_from_asset_expect(
|
||||
"common.items.npc_weapons.unique.basilisk",
|
||||
)),
|
||||
quadruped_low::Species::Icedrake => Some(Item::new_from_asset_expect(
|
||||
"common.items.npc_weapons.unique.icedrake",
|
||||
)),
|
||||
_ => Some(Item::new_from_asset_expect(
|
||||
"common.items.npc_weapons.unique.quadlowbasic",
|
||||
)),
|
||||
|
@ -7,7 +7,7 @@ use std::f32::consts::PI;
|
||||
|
||||
pub struct ShootAnimation;
|
||||
|
||||
type ShootAnimationDependency = (
|
||||
type ShootAnimationDependency<'a> = (
|
||||
Option<ToolKind>,
|
||||
Vec3<f32>,
|
||||
Vec3<f32>,
|
||||
@ -17,10 +17,11 @@ type ShootAnimationDependency = (
|
||||
f32,
|
||||
Option<StageSection>,
|
||||
f32,
|
||||
Option<&'a str>,
|
||||
);
|
||||
|
||||
impl Animation for ShootAnimation {
|
||||
type Dependency<'a> = ShootAnimationDependency;
|
||||
type Dependency<'a> = ShootAnimationDependency<'a>;
|
||||
type Skeleton = BipedSmallSkeleton;
|
||||
|
||||
#[cfg(feature = "use-dyn-lib")]
|
||||
@ -40,6 +41,7 @@ impl Animation for ShootAnimation {
|
||||
_acc_vel,
|
||||
stage_section,
|
||||
_timer,
|
||||
ability_id,
|
||||
): Self::Dependency<'_>,
|
||||
anim_time: f32,
|
||||
_rate: &mut f32,
|
||||
@ -69,46 +71,106 @@ impl Animation for ShootAnimation {
|
||||
next.tail.orientation = Quaternion::rotation_x(0.05 * fastalt * speednormcancel)
|
||||
* Quaternion::rotation_z(fast * 0.15 * speednormcancel);
|
||||
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
match ability_id {
|
||||
Some("common.abilities.adlet.hunter.throw") => {
|
||||
next.main.position = Vec3::new(8.0, -7.0, 2.0);
|
||||
next.main.orientation = Quaternion::rotation_x(PI / -2.0);
|
||||
|
||||
next.hand_l.position = Vec3::new(s_a.grip.0 * 4.0, 0.0, s_a.grip.2);
|
||||
next.hand_r.position = Vec3::new(-s_a.grip.0 * 4.0, 0.0, s_a.grip.2);
|
||||
next.hand_l.position = Vec3::new(s_a.grip.0 * 4.0, 0.0, s_a.grip.2);
|
||||
next.hand_r.position = Vec3::new(5.0, -2.0, s_a.grip.2);
|
||||
|
||||
next.hand_l.orientation = Quaternion::rotation_x(0.0);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(0.0);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(0.0);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
|
||||
},
|
||||
Some("common.abilities.adlet.tracker.trap") => {
|
||||
next.main.position = Vec3::new(10.0, 0.0, 9.0);
|
||||
|
||||
next.hand_l.position = Vec3::new(s_a.grip.0 * 4.0, 0.0, s_a.grip.2);
|
||||
next.hand_r.position = Vec3::new(5.0, -2.0, s_a.grip.2);
|
||||
|
||||
next.hand_l.orientation = Quaternion::rotation_x(0.0);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0);
|
||||
},
|
||||
_ => {
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0);
|
||||
|
||||
next.hand_l.position = Vec3::new(s_a.grip.0 * 4.0, 0.0, s_a.grip.2);
|
||||
next.hand_r.position = Vec3::new(-s_a.grip.0 * 4.0, 0.0, s_a.grip.2);
|
||||
|
||||
next.hand_l.orientation = Quaternion::rotation_x(0.0);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(0.0);
|
||||
},
|
||||
};
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Bow) => {
|
||||
let (move1base, move2base, move3) = match stage_section {
|
||||
Some(StageSection::Buildup) => (anim_time, 0.0, 0.0),
|
||||
Some(StageSection::Action) => (1.0, anim_time.powf(0.25), 0.0),
|
||||
Some(StageSection::Recover) => (1.0, 1.0, anim_time),
|
||||
_ => (0.0, 0.0, 0.0),
|
||||
};
|
||||
let pullback = 1.0 - move3;
|
||||
let move1abs = move1base * pullback;
|
||||
let move2abs = move2base * pullback;
|
||||
next.control_l.position = Vec3::new(
|
||||
1.0 - s_a.grip.0 * 2.0 + move2abs * -4.0,
|
||||
move2abs * -8.0,
|
||||
0.0,
|
||||
);
|
||||
next.control_r.position = Vec3::new(-1.0 + s_a.grip.0 * 2.0, 6.0, -2.0);
|
||||
Some(ToolKind::Bow) => match ability_id {
|
||||
Some("common.abilities.adlet.tracker.trap") => {
|
||||
let (move1base, move2base, move3) = match stage_section {
|
||||
Some(StageSection::Buildup) => (anim_time, 0.0, 0.0),
|
||||
Some(StageSection::Action) => (1.0, anim_time.powf(0.25), 0.0),
|
||||
Some(StageSection::Recover) => (1.0, 1.0, anim_time),
|
||||
_ => (0.0, 0.0, 0.0),
|
||||
};
|
||||
let pullback = 1.0 - move3;
|
||||
let move1abs = move1base * pullback;
|
||||
let move2abs = move2base * pullback;
|
||||
|
||||
next.control.position = Vec3::new(
|
||||
-1.0,
|
||||
2.0 + move1abs * 3.0 + s_a.grip.2,
|
||||
3.0 + move1abs * 7.0 - s_a.grip.2 / 2.5 + s_a.grip.0 * -2.0,
|
||||
);
|
||||
next.control_l.position = Vec3::new(
|
||||
0.0,
|
||||
0.0 + move1abs * 4.0 + move2abs * -4.0,
|
||||
-2.0 + move1abs * -8.0,
|
||||
);
|
||||
next.control_r.position = Vec3::new(-1.0 + s_a.grip.0 * 2.0, 2.0, -2.0);
|
||||
|
||||
next.control_l.orientation =
|
||||
Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_y(-0.3);
|
||||
next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + s_a.grip.0 * 0.2)
|
||||
* Quaternion::rotation_y(0.5 + s_a.grip.0 * 0.2);
|
||||
next.control.position = Vec3::new(
|
||||
-1.0,
|
||||
0.0 + move1abs * -8.0 + move2abs * 8.0 + s_a.grip.2,
|
||||
3.0 + move1abs * 7.0 - s_a.grip.2 / 2.5 + s_a.grip.0 * -2.0,
|
||||
);
|
||||
|
||||
next.control.orientation = Quaternion::rotation_x(-0.3 + move1abs * 0.4)
|
||||
* Quaternion::rotation_y(0.5 * speednorm);
|
||||
next.control_l.orientation =
|
||||
Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_y(-0.3);
|
||||
next.control_r.orientation =
|
||||
Quaternion::rotation_x(PI / 2.0 + s_a.grip.0 * 0.2)
|
||||
* Quaternion::rotation_y(0.5 + s_a.grip.0 * 0.2);
|
||||
|
||||
next.control.orientation =
|
||||
Quaternion::rotation_x(-0.3 + move1abs * 0.5 + move2abs * -0.5)
|
||||
* Quaternion::rotation_y(0.5 * speednorm);
|
||||
},
|
||||
_ => {
|
||||
let (move1base, move2base, move3) = match stage_section {
|
||||
Some(StageSection::Buildup) => (anim_time, 0.0, 0.0),
|
||||
Some(StageSection::Action) => (1.0, anim_time.powf(0.25), 0.0),
|
||||
Some(StageSection::Recover) => (1.0, 1.0, anim_time),
|
||||
_ => (0.0, 0.0, 0.0),
|
||||
};
|
||||
let pullback = 1.0 - move3;
|
||||
let move1abs = move1base * pullback;
|
||||
let move2abs = move2base * pullback;
|
||||
next.control_l.position = Vec3::new(
|
||||
1.0 - s_a.grip.0 * 2.0 + move2abs * -4.0,
|
||||
move2abs * -8.0,
|
||||
0.0,
|
||||
);
|
||||
next.control_r.position = Vec3::new(-1.0 + s_a.grip.0 * 2.0, 6.0, -2.0);
|
||||
|
||||
next.control.position = Vec3::new(
|
||||
-1.0,
|
||||
2.0 + move1abs * 3.0 + s_a.grip.2,
|
||||
3.0 + move1abs * 7.0 - s_a.grip.2 / 2.5 + s_a.grip.0 * -2.0,
|
||||
);
|
||||
|
||||
next.control_l.orientation =
|
||||
Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_y(-0.3);
|
||||
next.control_r.orientation =
|
||||
Quaternion::rotation_x(PI / 2.0 + s_a.grip.0 * 0.2)
|
||||
* Quaternion::rotation_y(0.5 + s_a.grip.0 * 0.2);
|
||||
|
||||
next.control.orientation = Quaternion::rotation_x(-0.3 + move1abs * 0.4)
|
||||
* Quaternion::rotation_y(0.5 * speednorm);
|
||||
},
|
||||
},
|
||||
Some(ToolKind::Blowgun) => {
|
||||
let (move1base, move2base, move3) = match stage_section {
|
||||
@ -175,6 +237,43 @@ impl Animation for ShootAnimation {
|
||||
* Quaternion::rotation_y(-0.2 * speednorm)
|
||||
* Quaternion::rotation_z(0.5 + move1abs * 0.6);
|
||||
},
|
||||
Some(ToolKind::Spear) => {
|
||||
let (move1base, move2base, move3) = match stage_section {
|
||||
Some(StageSection::Buildup) => (anim_time, 0.0, 0.0),
|
||||
Some(StageSection::Action) => (1.0, anim_time.powf(0.25), 0.0),
|
||||
Some(StageSection::Recover) => (1.0, 1.0, anim_time),
|
||||
_ => (0.0, 0.0, 0.0),
|
||||
};
|
||||
let pullback = 1.0 - move3;
|
||||
let move1abs = move1base * pullback;
|
||||
let move2abs = move2base * pullback;
|
||||
|
||||
next.control_l.position = Vec3::new(
|
||||
0.0,
|
||||
0.0 + move1abs * 4.0 + move2abs * -4.0,
|
||||
-2.0 + move1abs * -8.0,
|
||||
);
|
||||
next.control_r.position = Vec3::new(
|
||||
-1.0 + s_a.grip.0 * 2.0,
|
||||
2.0 + move3 * -4.0,
|
||||
-2.0 + move3 * -4.0,
|
||||
);
|
||||
|
||||
next.control.position = Vec3::new(
|
||||
-1.0,
|
||||
0.0 + move1abs * -8.0 + move2abs * 8.0 + s_a.grip.2,
|
||||
3.0 + move1abs * 7.0 - s_a.grip.2 / 2.5 + s_a.grip.0 * -2.0,
|
||||
);
|
||||
|
||||
next.control_l.orientation =
|
||||
Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_y(-0.3);
|
||||
next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + s_a.grip.0 * 0.2)
|
||||
* Quaternion::rotation_y(0.5 + s_a.grip.0 * 0.2 + move3 * -1.5);
|
||||
|
||||
next.control.orientation =
|
||||
Quaternion::rotation_x(-0.3 + move1abs * 0.5 + move2abs * -0.5 + move3 * 0.5)
|
||||
* Quaternion::rotation_y(0.5 * speednorm);
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
|
||||
|
@ -3760,6 +3760,7 @@ impl FigureMgr {
|
||||
state.acc_vel,
|
||||
Some(s.stage_section),
|
||||
state.state_time,
|
||||
ability_id,
|
||||
),
|
||||
stage_progress,
|
||||
&mut state_animation_rate,
|
||||
@ -3791,6 +3792,7 @@ impl FigureMgr {
|
||||
state.acc_vel,
|
||||
Some(s.stage_section),
|
||||
state.state_time,
|
||||
ability_id,
|
||||
),
|
||||
stage_progress,
|
||||
&mut state_animation_rate,
|
||||
@ -3854,6 +3856,7 @@ impl FigureMgr {
|
||||
state.acc_vel,
|
||||
Some(s.stage_section),
|
||||
state.state_time,
|
||||
ability_id,
|
||||
),
|
||||
stage_progress,
|
||||
&mut state_animation_rate,
|
||||
|
Loading…
Reference in New Issue
Block a user