Merge branch 'ythern/more_unique_abilities' into 'master'

Ythern/roshwalr kit

See merge request veloren/veloren!3692
This commit is contained in:
Marcel 2022-11-15 09:58:06 +00:00
commit 997c5a4e61
17 changed files with 329 additions and 5 deletions

View File

@ -258,6 +258,13 @@
secondary: "common.abilities.custom.quadmedbasic.triplestrike",
abilities: [],
),
Custom("Roshwalr"): (
primary: "common.abilities.custom.roshwalr.doublehusk",
secondary: "common.abilities.custom.roshwalr.slowcharge",
abilities: [
Simple(None, "common.abilities.custom.roshwalr.freezeshockwave"),
],
),
Custom("Basilisk"): (
primary: "common.abilities.custom.basilisk.petrify",
secondary: "common.abilities.custom.basilisk.triplestrike",

View File

@ -0,0 +1,43 @@
ComboMelee(
stage_data: [
(
stage: 1,
base_damage: 28.0,
damage_increase: 0,
base_poise_damage: 7.5,
poise_damage_increase: 0,
knockback: 3.0,
range: 3,
angle: 75.0,
base_buildup_duration: 1.2,
base_swing_duration: 0.07,
hit_timing: 0.5,
base_recover_duration: 0.3,
forward_movement: 0.25,
damage_kind: Piercing,
),
(
stage: 2,
base_damage: 28.0,
damage_increase: 0,
base_poise_damage: 7.5,
poise_damage_increase: 0,
knockback: 3.0,
range: 3,
angle: 75.0,
base_buildup_duration: 0.2,
base_swing_duration: 0.07,
hit_timing: 0.5,
base_recover_duration: 0.6,
forward_movement: 0.25,
damage_kind: Piercing,
),
],
initial_energy_gain: 5,
max_energy_gain: 5,
energy_increase: 0,
speed_increase: 0.0,
max_speed_increase: 0.0,
scales_from_combo: 0,
ori_modifier: 0.65,
)

View File

@ -0,0 +1,23 @@
Shockwave(
energy_cost: 0,
buildup_duration: 1.5,
swing_duration: 0.15,
recover_duration: 2.0,
damage: 15.0,
poise_damage: 10,
knockback: (strength: 3.0, direction: Up),
shockwave_angle: 270.0,
shockwave_vertical_angle: 15.0,
shockwave_speed: 20.0,
shockwave_duration: 0.8,
requires_ground: true,
move_efficiency: 0.2,
damage_kind: Piercing,
specifier: IceSpikes,
damage_effect: Some(Buff((
kind: Frozen,
dur_secs: 4.0,
strength: DamageFraction(0.1),
chance: 1,
))),
)

View File

@ -0,0 +1,27 @@
DashMelee(
energy_cost: 0,
melee_constructor: (
kind: Bash(
damage: 14.0,
poise: 28.0,
knockback: 8.0,
energy_regen: 0.0,
),
scaled: Some(Bash(
damage: 65.0,
poise: 35.0,
knockback: 14.0,
energy_regen: 0.0,
)),
range: 2.5,
angle: 45.0,
),
energy_drain: 0,
forward_speed: 1.0,
buildup_duration: 1.0,
charge_duration: 5,
swing_duration: 0.1,
recover_duration: 2.2,
ori_modifier: 0.3,
charge_through: false,
)

View File

@ -0,0 +1,14 @@
ItemDef(
name: "Roshwalr's Thick Skin",
description: "testing123",
kind: Armor((
kind: Chest,
stats: Direct((
protection: Some(Normal(100.0)),
poise_resilience: Some(Normal(2.0)),
energy_max: Some(10),
)),
)),
quality: Epic,
tags: [],
)

View File

@ -0,0 +1,21 @@
ItemDef(
name: "Roshwalr",
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("Roshwalr")),
)

View File

@ -1,5 +1,5 @@
[
(2.0, Item("common.items.crafting_ing.hide.rugged_hide")),
(2.0, ItemQuantity("common.items.crafting_ing.hide.rugged_hide", 1, 3)),
(1.0, ItemQuantity("common.items.crafting_ing.animal_misc.icy_fang", 2, 4)),
(1.0, ItemQuantity("common.items.crafting_ing.animal_misc.long_tusk", 2, 2)),
]

View File

@ -8,7 +8,7 @@ SpawnEntry (
(1, (1, 1, "common.entity.wild.aggressive.akhlut")),
(1, (1, 1, "common.entity.wild.aggressive.icedrake")),
(1, (1, 3, "common.entity.wild.aggressive.snow_raptor")),
(1, (1, 3, "common.entity.wild.aggressive.roshwalr")),
(1, (1, 1, "common.entity.wild.aggressive.roshwalr")),
(5, (5, 20, "common.entity.wild.peaceful.penguin")),
],
spawn_mode: Land,

View File

@ -282,6 +282,7 @@ impl<'a> From<&'a Body> for Psyche {
quadruped_medium::Species::Dreadhorn => 0.2,
quadruped_medium::Species::Bonerattler => 0.0,
quadruped_medium::Species::Tiger => 0.1,
quadruped_medium::Species::Roshwalr => 0.0,
_ => 0.3,
},
Body::QuadrupedLow(quadruped_low) => match quadruped_low.species {

View File

@ -693,7 +693,7 @@ impl Body {
quadruped_medium::Species::Bonerattler => 50,
quadruped_medium::Species::Deer => 50,
quadruped_medium::Species::Hirdrasil => 70,
quadruped_medium::Species::Roshwalr => 280,
quadruped_medium::Species::Roshwalr => 500,
quadruped_medium::Species::Donkey => 55,
quadruped_medium::Species::Zebra => 55,
quadruped_medium::Species::Antelope => 45,

View File

@ -556,13 +556,15 @@ fn default_main_tool(body: &Body) -> Item {
"common.items.npc_weapons.unique.quadmedjump",
)),
quadruped_medium::Species::Tuskram
| quadruped_medium::Species::Roshwalr
| quadruped_medium::Species::Moose
| quadruped_medium::Species::Dreadhorn
| quadruped_medium::Species::Mammoth
| quadruped_medium::Species::Ngoubou => Some(Item::new_from_asset_expect(
"common.items.npc_weapons.unique.quadmedcharge",
)),
quadruped_medium::Species::Roshwalr => Some(Item::new_from_asset_expect(
"common.items.npc_weapons.unique.roshwalr",
)),
quadruped_medium::Species::Highland
| quadruped_medium::Species::Cattle
| quadruped_medium::Species::Yak => Some(Item::new_from_asset_expect(
@ -921,6 +923,12 @@ impl LoadoutBuilder {
},
_ => None,
},
Body::QuadrupedMedium(body) => match body.species {
quadruped_medium::Species::Roshwalr => {
Some("common.items.npc_armor.quadruped_medium.roshwalr")
},
_ => None,
},
Body::Theropod(body) => match body.species {
theropod::Species::Archaeos
| theropod::Species::Yale

View File

@ -824,6 +824,7 @@ impl<'a> AgentData<'a> {
circle_time: 1,
},
"Quad Med Basic" => Tactic::QuadMedBasic,
"Roshwalr" => Tactic::Roshwalr,
"Asp" | "Maneater" => Tactic::QuadLowRanged,
"Quad Low Breathe" | "Quad Low Beam" | "Basilisk" => {
Tactic::QuadLowBeam
@ -1139,6 +1140,9 @@ impl<'a> AgentData<'a> {
tgt_data,
read_data,
),
Tactic::Roshwalr => {
self.handle_roshwalr_attack(agent, controller, &attack_data, tgt_data, read_data)
},
Tactic::OrganAura => {
self.handle_organ_aura_attack(agent, controller, &attack_data, tgt_data, read_data)
},

View File

@ -3507,6 +3507,61 @@ impl<'a> AgentData<'a> {
);
}
pub fn handle_roshwalr_attack(
&self,
agent: &mut Agent,
controller: &mut Controller,
attack_data: &AttackData,
tgt_data: &TargetData,
read_data: &ReadData,
) {
const SLOW_CHARGE_RANGE: f32 = 12.5;
const SHOCKWAVE_RANGE: f32 = 12.5;
const SHOCKWAVE_TIMER: f32 = 15.0;
const MELEE_RANGE: f32 = 4.0;
enum ActionStateFCounters {
FCounterRoshwalrAttack = 0,
}
agent.action_state.counters[ActionStateFCounters::FCounterRoshwalrAttack as usize] +=
read_data.dt.0;
if matches!(self.char_state, CharacterState::DashMelee(c) if !matches!(c.stage_section, StageSection::Recover))
{
// If already charging, keep charging if not in recover
controller.push_basic_input(InputKind::Ability(0));
} else if attack_data.dist_sqrd < SHOCKWAVE_RANGE.powi(2) && attack_data.angle < 270.0 {
if agent.action_state.counters[ActionStateFCounters::FCounterRoshwalrAttack as usize]
> SHOCKWAVE_TIMER
{
// Use shockwave if timer has gone for long enough
controller.push_basic_input(InputKind::Ability(0));
if matches!(self.char_state, CharacterState::Shockwave(_)) {
// Resets action counter when using shockwave
agent.action_state.counters
[ActionStateFCounters::FCounterRoshwalrAttack as usize] = 0.0;
}
} else if attack_data.dist_sqrd < MELEE_RANGE.powi(2) && attack_data.angle < 135.0 {
// Basic attack if in melee range
controller.push_basic_input(InputKind::Primary);
}
} else if attack_data.dist_sqrd > SLOW_CHARGE_RANGE.powi(2) {
// Use slow charge if outside the range
controller.push_basic_input(InputKind::Secondary);
}
// Always attempt to path towards target
self.path_toward_target(
agent,
controller,
tgt_data.pos.0,
read_data,
Path::Partial,
None,
);
}
pub fn handle_harvester_attack(
&self,
agent: &mut Agent,

View File

@ -137,6 +137,7 @@ pub enum Tactic {
OrganAura,
Dagon,
Cardinal,
Roshwalr,
}
#[derive(SystemData)]

View File

@ -7,13 +7,14 @@ pub mod idle;
pub mod jump;
pub mod leapmelee;
pub mod run;
pub mod shockwave;
pub mod stunned;
// Reexports
pub use self::{
alpha::AlphaAnimation, beta::BetaAnimation, dash::DashAnimation, feed::FeedAnimation,
hoof::HoofAnimation, idle::IdleAnimation, jump::JumpAnimation, leapmelee::LeapMeleeAnimation,
run::RunAnimation, stunned::StunnedAnimation,
run::RunAnimation, shockwave::ShockwaveAnimation, stunned::StunnedAnimation,
};
use super::{make_bone, vek::*, FigureBoneData, Offsets, Skeleton};

View File

@ -0,0 +1,91 @@
use super::{
super::{vek::*, Animation},
QuadrupedMediumSkeleton, SkeletonAttr,
};
use common::states::utils::StageSection;
//use std::ops::Rem;
use std::f32::consts::PI;
pub struct ShockwaveAnimation;
impl Animation for ShockwaveAnimation {
type Dependency<'a> = (f32, f32, Option<StageSection>, f32);
type Skeleton = QuadrupedMediumSkeleton;
#[cfg(feature = "use-dyn-lib")]
const UPDATE_FN: &'static [u8] = b"quadruped_medium_shockwave\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_medium_shockwave")]
fn update_skeleton_inner<'a>(
skeleton: &Self::Skeleton,
(_velocity, global_time, stage_section, timer): Self::Dependency<'a>,
anim_time: f32,
_rate: &mut f32,
_s_a: &SkeletonAttr,
) -> Self::Skeleton {
let mut next = (*skeleton).clone();
let (movement1base, chargemovementbase, movement2base, movement3, legtell) =
match stage_section {
Some(StageSection::Buildup) => (anim_time.sqrt(), 0.0, 0.0, 0.0, anim_time),
Some(StageSection::Charge) => (1.0, 1.0, 0.0, 0.0, 0.0),
Some(StageSection::Action) => (1.0, 1.0, anim_time.powi(4), 0.0, 0.2),
Some(StageSection::Recover) => (1.0, 1.0, 1.0, anim_time, 0.0),
_ => (0.0, 0.0, 0.0, 0.0, 0.0),
};
let pullback = 1.0 - movement3;
let subtract = global_time - timer;
let check = subtract - subtract.trunc();
let mirror = (check - 0.5).signum();
let twitch1 = (mirror * movement1base * 3.5).sin();
let twitch1fast = (mirror * movement1base * 45.0).sin();
//let twitch3 = (mirror * movement3 * 4.0).sin();
//let movement1 = mirror * movement1base * pullback;
//let movement2 = mirror * movement2base * pullback;
let movement1abs = movement1base * pullback;
let movement2abs = movement2base * pullback;
//let legtwitch = (legtell * 6.0).sin() * pullback;
let legswing = legtell * pullback;
let short = ((1.0 / (0.72 + 0.28 * ((anim_time * 16.0_f32 + PI * 0.25).sin()).powi(2)))
.sqrt())
* ((anim_time * 16.0_f32 + PI * 0.25).sin())
* chargemovementbase
* pullback;
let shortalt = (anim_time * 16.0_f32 + PI * 0.25).sin() * chargemovementbase * pullback;
next.head.orientation = Quaternion::rotation_x(movement1abs * -0.2 + movement2abs * 0.8)
* Quaternion::rotation_z(short * -0.06 + twitch1 * 0.2);
next.neck.orientation = Quaternion::rotation_x(movement1abs * -0.2 + movement2abs * 0.5)
* Quaternion::rotation_z(short * 0.15 + twitch1 * 0.2);
next.jaw.orientation = Quaternion::rotation_x(
twitch1fast * 0.2
+ movement1abs * -0.3
+ movement2abs * 1.2
+ chargemovementbase * -0.5,
);
next.torso_front.orientation = Quaternion::rotation_z(twitch1 * 0.06)
* Quaternion::rotation_y(short * 0.06)
* Quaternion::rotation_x(legswing * 0.06);
next.tail.orientation = Quaternion::rotation_x(
0.15 + movement1abs * -0.4 + movement2abs * 0.2 + chargemovementbase * 0.2,
) * Quaternion::rotation_z(shortalt * 0.15);
next.leg_fl.orientation = Quaternion::rotation_x(legswing * 1.4);
next.foot_fl.orientation = Quaternion::rotation_x(legswing * -0.5);
next.leg_bl.orientation = Quaternion::rotation_x(legswing * 0.3);
next.foot_bl.orientation = Quaternion::rotation_x(legswing * -0.3);
next.leg_fr.orientation = Quaternion::rotation_x(legswing * 1.4);
next.foot_fr.orientation = Quaternion::rotation_x(legswing * -0.5);
next.leg_br.orientation = Quaternion::rotation_x(legswing * 0.3);
next.foot_br.orientation = Quaternion::rotation_x(legswing * -0.3);
next
}
}

View File

@ -2471,6 +2471,34 @@ impl FigureMgr {
skeleton_attr,
)
},
CharacterState::Shockwave(s) => {
let stage_time = s.timer.as_secs_f32();
let stage_progress = match s.stage_section {
StageSection::Buildup => {
stage_time / s.static_data.buildup_duration.as_secs_f32()
},
StageSection::Charge => stage_time,
StageSection::Action => {
stage_time / s.static_data.swing_duration.as_secs_f32()
},
StageSection::Recover => {
stage_time / s.static_data.recover_duration.as_secs_f32()
},
_ => 0.0,
};
anim::quadruped_medium::ShockwaveAnimation::update_skeleton(
&target_base,
(
rel_vel.magnitude(),
time,
Some(s.stage_section),
state.state_time,
),
stage_progress,
&mut state_animation_rate,
skeleton_attr,
)
},
CharacterState::LeapMelee(s) => {
let stage_time = s.timer.as_secs_f32();
let stage_progress = match s.stage_section {