mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Balanced abilities and insert ability id into animations.
This commit is contained in:
parent
aea4a43b65
commit
66f9cf22fc
@ -3,51 +3,33 @@ ComboMelee2(
|
||||
(
|
||||
melee_constructor: (
|
||||
kind: Slash(
|
||||
damage: 5.0,
|
||||
poise: 0.0,
|
||||
knockback: 0.0,
|
||||
energy_regen: 5.0,
|
||||
damage: 7,
|
||||
poise: 0,
|
||||
knockback: 0,
|
||||
energy_regen: 5,
|
||||
),
|
||||
range: 3.0,
|
||||
angle: 45.0,
|
||||
),
|
||||
buildup_duration: 0.5,
|
||||
buildup_duration: 0.3,
|
||||
swing_duration: 0.1,
|
||||
hit_timing: 0.5,
|
||||
recover_duration: 0.3,
|
||||
recover_duration: 0.5,
|
||||
forward_movement: 0.0,
|
||||
ori_modifier: 0.6,
|
||||
),
|
||||
(
|
||||
melee_constructor: (
|
||||
kind: Slash(
|
||||
damage: 10.0,
|
||||
poise: 0.0,
|
||||
knockback: 0.0,
|
||||
energy_regen: 5.0,
|
||||
damage: 10,
|
||||
poise: 0,
|
||||
knockback: 0,
|
||||
energy_regen: 10,
|
||||
),
|
||||
range: 3.0,
|
||||
angle: 45.0,
|
||||
),
|
||||
buildup_duration: 0.5,
|
||||
swing_duration: 0.1,
|
||||
hit_timing: 0.5,
|
||||
recover_duration: 0.3,
|
||||
forward_movement: 0.0,
|
||||
ori_modifier: 0.6,
|
||||
),
|
||||
(
|
||||
melee_constructor: (
|
||||
kind: Slash(
|
||||
damage: 15.0,
|
||||
poise: 0.0,
|
||||
knockback: 0.0,
|
||||
energy_regen: 5.0,
|
||||
),
|
||||
range: 3.0,
|
||||
angle: 45.0,
|
||||
),
|
||||
buildup_duration: 0.5,
|
||||
buildup_duration: 0.3,
|
||||
swing_duration: 0.1,
|
||||
hit_timing: 0.5,
|
||||
recover_duration: 0.3,
|
||||
@ -57,9 +39,5 @@ ComboMelee2(
|
||||
],
|
||||
meta: (
|
||||
kind: Some(Sword(Balanced)),
|
||||
capabilities: (
|
||||
// Roll
|
||||
bits: 0b00000001,
|
||||
),
|
||||
),
|
||||
)
|
@ -1,27 +1,17 @@
|
||||
FinisherMelee(
|
||||
energy_cost: 40,
|
||||
buildup_duration: 0.2,
|
||||
swing_duration: 0.05,
|
||||
recover_duration: 0.2,
|
||||
energy_cost: 30,
|
||||
buildup_duration: 0.4,
|
||||
swing_duration: 0.1,
|
||||
recover_duration: 0.4,
|
||||
melee_constructor: (
|
||||
kind: Slash(
|
||||
damage: 0,
|
||||
damage: 30,
|
||||
poise: 0,
|
||||
knockback: 0,
|
||||
energy_regen: 0,
|
||||
energy_regen: 10,
|
||||
),
|
||||
range: 3.0,
|
||||
angle: 10.0,
|
||||
scaled: Some(Slash(
|
||||
damage: 25,
|
||||
poise: 0,
|
||||
knockback: 0,
|
||||
energy_regen: 0,
|
||||
)),
|
||||
angle: 15.0,
|
||||
),
|
||||
minimum_combo: 10,
|
||||
scaling: Some((
|
||||
target: Attack,
|
||||
kind: Linear,
|
||||
)),
|
||||
)
|
@ -1,25 +1,25 @@
|
||||
// TODO: Make actual ability, just for testing right now
|
||||
BasicMelee(
|
||||
energy_cost: 50,
|
||||
buildup_duration: 0.3,
|
||||
swing_duration: 0.1,
|
||||
recover_duration: 0.2,
|
||||
melee_constructor: (
|
||||
kind: Stab(
|
||||
damage: 10,
|
||||
poise: 0,
|
||||
knockback: 0,
|
||||
energy_regen: 0,
|
||||
ComboMelee2(
|
||||
strikes: [
|
||||
(
|
||||
melee_constructor: (
|
||||
kind: Slash(
|
||||
damage: 15,
|
||||
poise: 0,
|
||||
knockback: 0,
|
||||
energy_regen: 5,
|
||||
),
|
||||
range: 6.0,
|
||||
angle: 5.0,
|
||||
),
|
||||
buildup_duration: 0.3,
|
||||
swing_duration: 0.1,
|
||||
hit_timing: 0.6,
|
||||
recover_duration: 0.5,
|
||||
forward_movement: 0.0,
|
||||
ori_modifier: 0.6,
|
||||
),
|
||||
range: 5.0,
|
||||
angle: 10.0,
|
||||
),
|
||||
ori_modifier: 1.0,
|
||||
],
|
||||
meta: (
|
||||
kind: Some(Sword(Balanced)),
|
||||
capabilities: (
|
||||
// Block
|
||||
bits: 0b00000010,
|
||||
),
|
||||
),
|
||||
)
|
||||
)
|
@ -231,7 +231,7 @@ pub enum AbilityInput {
|
||||
Auxiliary(usize),
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Serialize, Deserialize, Debug)]
|
||||
#[derive(Copy, Clone, Serialize, Deserialize, Debug, PartialEq)]
|
||||
pub enum Ability {
|
||||
ToolPrimary,
|
||||
ToolSecondary,
|
||||
@ -2355,20 +2355,11 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
|
||||
pub struct AbilityMeta {
|
||||
pub kind: Option<AbilityKind>,
|
||||
#[serde(default)]
|
||||
pub capabilities: InterruptCapability,
|
||||
}
|
||||
|
||||
impl Default for AbilityMeta {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
kind: None,
|
||||
capabilities: InterruptCapability::NONE,
|
||||
}
|
||||
}
|
||||
pub capabilities: Capability,
|
||||
}
|
||||
|
||||
// Only extend this if it is needed to control certain functionality of
|
||||
@ -2394,8 +2385,7 @@ pub enum SwordStance {
|
||||
|
||||
bitflags::bitflags! {
|
||||
#[derive(Default, Serialize, Deserialize)]
|
||||
pub struct InterruptCapability: u8 {
|
||||
const NONE = 0b00000000;
|
||||
pub struct Capability: u8 {
|
||||
const ROLL = 0b00000001;
|
||||
const BLOCK = 0b00000010;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ use crate::{
|
||||
astar::Astar,
|
||||
combat,
|
||||
comp::{
|
||||
ability::{AbilityMeta, InterruptCapability},
|
||||
ability::{Ability, AbilityInput, AbilityMeta, Capability},
|
||||
arthropod, biped_large, biped_small,
|
||||
character_state::OutputEvents,
|
||||
inventory::slot::{ArmorSlot, EquipSlot, Slot},
|
||||
@ -1063,16 +1063,12 @@ pub fn handle_interrupts(
|
||||
matches!(stage_section, StageSection::Buildup)
|
||||
});
|
||||
let interruptible = data.character.ability_info().map_or(false, |info| {
|
||||
info.ability_meta
|
||||
.capabilities
|
||||
.contains(InterruptCapability::ROLL)
|
||||
info.ability_meta.capabilities.contains(Capability::ROLL)
|
||||
});
|
||||
in_buildup || interruptible
|
||||
};
|
||||
let can_block = data.character.ability_info().map_or(false, |info| {
|
||||
info.ability_meta
|
||||
.capabilities
|
||||
.contains(InterruptCapability::BLOCK)
|
||||
info.ability_meta.capabilities.contains(Capability::BLOCK)
|
||||
});
|
||||
if can_dodge {
|
||||
handle_dodge_input(data, update);
|
||||
@ -1250,6 +1246,7 @@ pub struct AbilityInfo {
|
||||
pub input: InputKind,
|
||||
pub input_attr: Option<InputAttr>,
|
||||
pub ability_meta: AbilityMeta,
|
||||
pub ability: Option<Ability>,
|
||||
}
|
||||
|
||||
impl AbilityInfo {
|
||||
@ -1270,6 +1267,9 @@ impl AbilityInfo {
|
||||
Some(HandInfo::from_main_tool(hands, from_offhand)),
|
||||
)
|
||||
});
|
||||
let ability = Option::<AbilityInput>::from(input)
|
||||
.zip(data.active_abilities)
|
||||
.map(|(i, a)| a.get_ability(i, data.inventory, Some(data.skill_set)));
|
||||
|
||||
Self {
|
||||
tool,
|
||||
@ -1277,6 +1277,7 @@ impl AbilityInfo {
|
||||
input,
|
||||
input_attr: data.controller.queued_inputs.get(&input).copied(),
|
||||
ability_meta,
|
||||
ability,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -914,6 +914,12 @@ impl FigureMgr {
|
||||
let second_tool_spec = second_tool_spec.as_deref();
|
||||
let hands = (active_tool_hand, second_tool_hand);
|
||||
|
||||
let ability_id = character.and_then(|c| {
|
||||
c.ability_info()
|
||||
.and_then(|a| a.ability)
|
||||
.and_then(|a| a.ability_id(inventory))
|
||||
});
|
||||
|
||||
// If a mount exists, get its animated mounting transform and its position
|
||||
let mount_transform_pos = (|| -> Option<_> {
|
||||
let mount = is_rider?.mount;
|
||||
|
Loading…
Reference in New Issue
Block a user