mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Addressed review
This commit is contained in:
parent
1301fff800
commit
5c675fdbe2
@ -280,11 +280,11 @@ impl Ability {
|
|||||||
.map(|i| &i.item_config_expect().abilities)
|
.map(|i| &i.item_config_expect().abilities)
|
||||||
};
|
};
|
||||||
|
|
||||||
let contextual_id = |auxiliary_kind: Option<&'a AbilityKind<_>>| -> Option<&'a str> {
|
let contextual_id = |kind: Option<&'a AbilityKind<_>>| -> Option<&'a str> {
|
||||||
if let Some(AbilityKind::Contextualized {
|
if let Some(AbilityKind::Contextualized {
|
||||||
pseudo_id,
|
pseudo_id,
|
||||||
abilities: _,
|
abilities: _,
|
||||||
}) = auxiliary_kind
|
}) = kind
|
||||||
{
|
{
|
||||||
Some(pseudo_id.as_str())
|
Some(pseudo_id.as_str())
|
||||||
} else {
|
} else {
|
||||||
@ -2320,9 +2320,6 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState {
|
|||||||
exhausted: false,
|
exhausted: false,
|
||||||
start_next_strike: false,
|
start_next_strike: false,
|
||||||
timer: Duration::default(),
|
timer: Duration::default(),
|
||||||
// If ability is a stance, if starting from wielding, get ready to enter stance,
|
|
||||||
// otherwise enter stance immediately, otherwise if not a stance immediately begin
|
|
||||||
// the strike
|
|
||||||
stage_section: StageSection::Buildup,
|
stage_section: StageSection::Buildup,
|
||||||
completed_strikes: 0,
|
completed_strikes: 0,
|
||||||
}),
|
}),
|
||||||
@ -2795,7 +2792,7 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState {
|
|||||||
ability_info,
|
ability_info,
|
||||||
},
|
},
|
||||||
timer: Duration::default(),
|
timer: Duration::default(),
|
||||||
stage_section: if data.vel.0.z < 0.0 || buildup_duration.is_none() {
|
stage_section: if data.vel.0.z < -*vertical_speed || buildup_duration.is_none() {
|
||||||
StageSection::Movement
|
StageSection::Movement
|
||||||
} else {
|
} else {
|
||||||
StageSection::Buildup
|
StageSection::Buildup
|
||||||
@ -2861,6 +2858,7 @@ pub struct AbilityMeta {
|
|||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub capabilities: Capability,
|
pub capabilities: Capability,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
|
/// This is an event that gets emitted when the ability is first activated
|
||||||
pub init_event: Option<AbilityInitEvent>,
|
pub init_event: Option<AbilityInitEvent>,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub requirements: AbilityRequirements,
|
pub requirements: AbilityRequirements,
|
||||||
@ -2894,8 +2892,8 @@ bitflags::bitflags! {
|
|||||||
#[derive(Default, Serialize, Deserialize)]
|
#[derive(Default, Serialize, Deserialize)]
|
||||||
// If more are ever needed, first check if any not used anymore, as some were only used in intermediary stages so may be free
|
// If more are ever needed, first check if any not used anymore, as some were only used in intermediary stages so may be free
|
||||||
pub struct Capability: u8 {
|
pub struct Capability: u8 {
|
||||||
// Allows rolls to interrupt the ability at any point for free, not just during buildup
|
// There used to be a capability here, to keep ordering the same below this is now a placeholder
|
||||||
const ROLL_INTERRUPTS_FREE = 0b00000001;
|
const PLACEHOLDER = 0b00000001;
|
||||||
// Allows blocking to interrupt the ability at any point
|
// Allows blocking to interrupt the ability at any point
|
||||||
const BLOCK_INTERRUPT = 0b00000010;
|
const BLOCK_INTERRUPT = 0b00000010;
|
||||||
// When the ability is in the buildup section, it counts as a block with 50% DR
|
// When the ability is in the buildup section, it counts as a block with 50% DR
|
||||||
|
@ -341,14 +341,19 @@ impl<T> AbilityKind<T> {
|
|||||||
AbilityKind::Contextualized {
|
AbilityKind::Contextualized {
|
||||||
pseudo_id: _,
|
pseudo_id: _,
|
||||||
abilities,
|
abilities,
|
||||||
} => abilities
|
} => {
|
||||||
.get(&context)
|
// In the event that the ability from the current context is not unlocked with
|
||||||
.and_then(|(s, a)| unlocked(*s, a))
|
// the required skill, try falling back to the ability from this input that does
|
||||||
.or_else(|| {
|
// not require a context
|
||||||
abilities
|
abilities
|
||||||
.get(&AbilityContext::None)
|
.get(&context)
|
||||||
.and_then(|(s, a)| unlocked(*s, a))
|
.and_then(|(s, a)| unlocked(*s, a))
|
||||||
}),
|
.or_else(|| {
|
||||||
|
abilities
|
||||||
|
.get(&AbilityContext::None)
|
||||||
|
.and_then(|(s, a)| unlocked(*s, a))
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,10 +91,6 @@ fn main() -> io::Result<()> {
|
|||||||
.unwrap(),
|
.unwrap(),
|
||||||
);
|
);
|
||||||
|
|
||||||
// agent and world imported here so that mim-alloc can be used when hot
|
|
||||||
// reloading these crates without separately declaring mim-alloc as the
|
|
||||||
// allocator in those crates (doing so causes UB when a vec (and presumably
|
|
||||||
// other allocations) are passed to a dynlib and resized within that dynlib)
|
|
||||||
#[cfg(feature = "hot-agent")]
|
#[cfg(feature = "hot-agent")]
|
||||||
{
|
{
|
||||||
agent::init();
|
agent::init();
|
||||||
|
@ -3,7 +3,7 @@ use super::{
|
|||||||
CharacterSkeleton, SkeletonAttr,
|
CharacterSkeleton, SkeletonAttr,
|
||||||
};
|
};
|
||||||
use common::states::utils::{AbilityInfo, StageSection};
|
use common::states::utils::{AbilityInfo, StageSection};
|
||||||
use core::f32::consts::PI;
|
use core::f32::consts::{PI, TAU};
|
||||||
|
|
||||||
pub struct DiveMeleeAnimation;
|
pub struct DiveMeleeAnimation;
|
||||||
impl Animation for DiveMeleeAnimation {
|
impl Animation for DiveMeleeAnimation {
|
||||||
@ -70,7 +70,7 @@ impl Animation for DiveMeleeAnimation {
|
|||||||
next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
|
next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5);
|
||||||
next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
|
next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
|
||||||
next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
|
next.control.orientation = Quaternion::rotation_x(s_a.sc.3);
|
||||||
next.torso.orientation.rotate_x(move1alt * -6.28);
|
next.torso.orientation.rotate_x(move1alt * -TAU);
|
||||||
|
|
||||||
next.torso.orientation.rotate_x(move1 * -0.8);
|
next.torso.orientation.rotate_x(move1 * -0.8);
|
||||||
next.control.orientation.rotate_x(move1 * 1.5);
|
next.control.orientation.rotate_x(move1 * 1.5);
|
||||||
|
Loading…
Reference in New Issue
Block a user