Fixed clippy errors and added SFX

This commit is contained in:
jiminycrick 2020-10-14 15:30:58 -07:00
parent 95c36cc3fb
commit 512d881cd2
4 changed files with 56 additions and 52 deletions

View File

@ -73,7 +73,6 @@
),
GliderClose: (
files: [
// Event Missing or not implemented?
"voxygen.audio.sfx.glider_close",
],
threshold: 0.5,
@ -112,12 +111,18 @@
],
threshold: 0.7,
),
Attack(DashMelee, Sword): (
Attack(DashMelee(Swing), Sword): (
files: [
"voxygen.audio.sfx.abilities.sword_dash",
],
threshold: 0.8,
),
Attack(SpinMelee(Swing), Sword): (
files: [
"voxygen.audio.sfx.abilities.swing_sword",
],
threshold: 0.7,
),
Inventory(CollectedTool(Sword)): (
files: [
"voxygen.audio.sfx.inventory.pickup_sword",
@ -146,9 +151,15 @@
],
threshold: 0.7,
),
Attack(LeapMelee, Hammer): (
Attack(ChargedMelee(Swing), Hammer): (
files: [
//
"voxygen.audio.sfx.abilities.swing",
],
threshold: 0.7,
),
Attack(LeapMelee(Swing), Hammer): (
files: [
"voxygen.audio.sfx.abilities.swing",
],
threshold: 0.8,
),
@ -180,7 +191,13 @@
],
threshold: 0.7,
),
Attack(SpinMelee, Axe): (
Attack(SpinMelee(Swing), Axe): (
files: [
"voxygen.audio.sfx.abilities.swing",
],
threshold: 0.8,
),
Attack(LeapMelee(Swing), Axe): (
files: [
"voxygen.audio.sfx.abilities.swing",
],
@ -276,7 +293,7 @@
],
threshold: 0.8,
),
Attack(DashMelee, Dagger): (
Attack(DashMelee(Swing), Dagger): (
files: [
"voxygen.audio.sfx.abilities.sword_dash",
],

View File

@ -18,13 +18,13 @@ pub enum CharacterAbilityType {
BasicMelee,
BasicRanged,
Boost,
ChargedMelee,
ChargedMelee(StageSection),
ChargedRanged,
DashMelee,
DashMelee(StageSection),
BasicBlock,
ComboMelee(StageSection, u32),
LeapMelee,
SpinMelee,
LeapMelee(StageSection),
SpinMelee(StageSection),
GroundShockwave,
BasicBeam,
RepeaterRanged,
@ -36,12 +36,12 @@ impl From<&CharacterState> for CharacterAbilityType {
CharacterState::BasicMelee(_) => Self::BasicMelee,
CharacterState::BasicRanged(_) => Self::BasicRanged,
CharacterState::Boost(_) => Self::Boost,
CharacterState::DashMelee(_) => Self::DashMelee,
CharacterState::DashMelee(data) => Self::DashMelee(data.stage_section),
CharacterState::BasicBlock => Self::BasicBlock,
CharacterState::LeapMelee(_) => Self::LeapMelee,
CharacterState::LeapMelee(data) => Self::LeapMelee(data.stage_section),
CharacterState::ComboMelee(data) => Self::ComboMelee(data.stage_section, data.stage),
CharacterState::SpinMelee(_) => Self::SpinMelee,
CharacterState::ChargedMelee(_) => Self::ChargedMelee,
CharacterState::SpinMelee(data) => Self::SpinMelee(data.stage_section),
CharacterState::ChargedMelee(data) => Self::ChargedMelee(data.stage_section),
CharacterState::ChargedRanged(_) => Self::ChargedRanged,
CharacterState::GroundShockwave(_) => Self::ChargedRanged,
CharacterState::BasicBeam(_) => Self::BasicBeam,

View File

@ -178,19 +178,8 @@ impl CharacterBehavior for Data {
},
StageSection::Recover => {
if self.static_data.leap == None {
if !data.physics.on_ground {
// Lands
update.character = CharacterState::RepeaterRanged(Data {
static_data: self.static_data.clone(),
timer: self
.timer
.checked_add(Duration::from_secs_f32(data.dt.0))
.unwrap_or_default(),
stage_section: self.stage_section,
reps_remaining: self.reps_remaining,
});
} else if self.timer < self.static_data.recover_duration {
// Recovers from attack
if !data.physics.on_ground || self.timer < self.static_data.recover_duration {
// Lands or recovers from attack in air
update.character = CharacterState::RepeaterRanged(Data {
static_data: self.static_data.clone(),
timer: self
@ -204,25 +193,23 @@ impl CharacterBehavior for Data {
// Done
update.character = CharacterState::Wielding;
}
} else if data.physics.on_ground {
// Done
update.character = CharacterState::Wielding;
} else if self.timer < self.static_data.recover_duration {
// Recovers from attack
update.character = CharacterState::RepeaterRanged(Data {
static_data: self.static_data.clone(),
timer: self
.timer
.checked_add(Duration::from_secs_f32(data.dt.0))
.unwrap_or_default(),
stage_section: self.stage_section,
reps_remaining: self.reps_remaining,
});
} else {
if data.physics.on_ground {
// Done
update.character = CharacterState::Wielding;
} else if self.timer < self.static_data.recover_duration {
// Recovers from attack
update.character = CharacterState::RepeaterRanged(Data {
static_data: self.static_data.clone(),
timer: self
.timer
.checked_add(Duration::from_secs_f32(data.dt.0))
.unwrap_or_default(),
stage_section: self.stage_section,
reps_remaining: self.reps_remaining,
});
} else {
// Done
update.character = CharacterState::Wielding;
}
// Done
update.character = CharacterState::Wielding;
}
},
_ => {

View File

@ -1,12 +1,5 @@
(
servers: {
"Veloren Alpha": (
characters: {
24: (
hotbar_slots: (None, None, None, None, None, Some(Inventory(0)), Some(Inventory(1)), None, None, None),
),
},
),
"Singleplayer": (
characters: {
2: (
@ -14,5 +7,12 @@
),
},
),
"Veloren Alpha": (
characters: {
24: (
hotbar_slots: (None, None, None, None, None, Some(Inventory(0)), Some(Inventory(1)), None, None, None),
),
},
),
},
)