mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
ori addition to combomelee
This commit is contained in:
parent
3114fc2f7e
commit
f6043b7e53
@ -36,4 +36,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.6,
|
max_speed_increase: 0.6,
|
||||||
scales_from_combo: 2,
|
scales_from_combo: 2,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -36,4 +36,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
@ -20,4 +20,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.4,
|
max_speed_increase: 0.4,
|
||||||
scales_from_combo: 2,
|
scales_from_combo: 2,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -36,4 +36,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
@ -36,4 +36,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 2,
|
scales_from_combo: 2,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
@ -50,4 +50,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.8,
|
max_speed_increase: 0.8,
|
||||||
scales_from_combo: 2,
|
scales_from_combo: 2,
|
||||||
is_interruptible: true,
|
is_interruptible: true,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -36,4 +36,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
@ -50,4 +50,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -50,4 +50,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -22,4 +22,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -50,4 +50,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -22,4 +22,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -50,4 +50,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -50,4 +50,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -64,4 +64,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -22,4 +22,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -50,4 +50,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -22,4 +22,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -50,4 +50,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -36,4 +36,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -36,4 +36,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -50,4 +50,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -22,4 +22,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -22,4 +22,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -22,4 +22,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -50,4 +50,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -22,4 +22,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -50,4 +50,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -22,4 +22,5 @@ ComboMelee(
|
|||||||
max_speed_increase: 0.0,
|
max_speed_increase: 0.0,
|
||||||
scales_from_combo: 0,
|
scales_from_combo: 0,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
ori_modifier: 1.0,
|
||||||
)
|
)
|
||||||
|
@ -138,6 +138,7 @@ pub enum CharacterAbility {
|
|||||||
max_speed_increase: f32,
|
max_speed_increase: f32,
|
||||||
scales_from_combo: u32,
|
scales_from_combo: u32,
|
||||||
is_interruptible: bool,
|
is_interruptible: bool,
|
||||||
|
ori_modifier: f32,
|
||||||
},
|
},
|
||||||
LeapMelee {
|
LeapMelee {
|
||||||
energy_cost: f32,
|
energy_cost: f32,
|
||||||
@ -1309,6 +1310,7 @@ impl From<(&CharacterAbility, AbilityInfo)> for CharacterState {
|
|||||||
max_speed_increase,
|
max_speed_increase,
|
||||||
scales_from_combo,
|
scales_from_combo,
|
||||||
is_interruptible,
|
is_interruptible,
|
||||||
|
ori_modifier,
|
||||||
} => CharacterState::ComboMelee(combo_melee::Data {
|
} => CharacterState::ComboMelee(combo_melee::Data {
|
||||||
static_data: combo_melee::StaticData {
|
static_data: combo_melee::StaticData {
|
||||||
num_stages: stage_data.len() as u32,
|
num_stages: stage_data.len() as u32,
|
||||||
@ -1320,6 +1322,7 @@ impl From<(&CharacterAbility, AbilityInfo)> for CharacterState {
|
|||||||
max_speed_increase: *max_speed_increase,
|
max_speed_increase: *max_speed_increase,
|
||||||
scales_from_combo: *scales_from_combo,
|
scales_from_combo: *scales_from_combo,
|
||||||
is_interruptible: *is_interruptible,
|
is_interruptible: *is_interruptible,
|
||||||
|
ori_modifier: *ori_modifier as f32,
|
||||||
ability_info,
|
ability_info,
|
||||||
},
|
},
|
||||||
stage: 1,
|
stage: 1,
|
||||||
|
@ -52,6 +52,7 @@ impl CharacterBehavior for Data {
|
|||||||
|
|
||||||
handle_move(data, &mut update, 0.7);
|
handle_move(data, &mut update, 0.7);
|
||||||
handle_jump(data, &mut update, 1.0);
|
handle_jump(data, &mut update, 1.0);
|
||||||
|
handle_orientation(data, &mut update, 0.35);
|
||||||
|
|
||||||
match self.stage_section {
|
match self.stage_section {
|
||||||
StageSection::Buildup => {
|
StageSection::Buildup => {
|
||||||
|
@ -97,6 +97,8 @@ pub struct StaticData {
|
|||||||
pub scales_from_combo: u32,
|
pub scales_from_combo: u32,
|
||||||
/// Whether the state can be interrupted by other abilities
|
/// Whether the state can be interrupted by other abilities
|
||||||
pub is_interruptible: bool,
|
pub is_interruptible: bool,
|
||||||
|
/// xxx
|
||||||
|
pub ori_modifier: f32,
|
||||||
/// What key is used to press ability
|
/// What key is used to press ability
|
||||||
pub ability_info: AbilityInfo,
|
pub ability_info: AbilityInfo,
|
||||||
}
|
}
|
||||||
@ -120,7 +122,6 @@ impl CharacterBehavior for Data {
|
|||||||
let mut update = StateUpdate::from(data);
|
let mut update = StateUpdate::from(data);
|
||||||
|
|
||||||
handle_move(data, &mut update, 0.6);
|
handle_move(data, &mut update, 0.6);
|
||||||
handle_orientation(data, &mut update, 0.2);
|
|
||||||
|
|
||||||
let stage_index = (self.stage - 1) as usize;
|
let stage_index = (self.stage - 1) as usize;
|
||||||
|
|
||||||
@ -135,6 +136,8 @@ impl CharacterBehavior for Data {
|
|||||||
match self.stage_section {
|
match self.stage_section {
|
||||||
StageSection::Buildup => {
|
StageSection::Buildup => {
|
||||||
if self.timer < self.static_data.stage_data[stage_index].base_buildup_duration {
|
if self.timer < self.static_data.stage_data[stage_index].base_buildup_duration {
|
||||||
|
handle_orientation(data, &mut update, 0.35*self.static_data.ori_modifier);
|
||||||
|
|
||||||
// Build up
|
// Build up
|
||||||
update.character = CharacterState::ComboMelee(Data {
|
update.character = CharacterState::ComboMelee(Data {
|
||||||
static_data: self.static_data.clone(),
|
static_data: self.static_data.clone(),
|
||||||
@ -228,6 +231,8 @@ impl CharacterBehavior for Data {
|
|||||||
},
|
},
|
||||||
StageSection::Swing => {
|
StageSection::Swing => {
|
||||||
if self.timer < self.static_data.stage_data[stage_index].base_swing_duration {
|
if self.timer < self.static_data.stage_data[stage_index].base_swing_duration {
|
||||||
|
handle_orientation(data, &mut update, 0.35*self.static_data.ori_modifier);
|
||||||
|
|
||||||
// Forward movement
|
// Forward movement
|
||||||
handle_forced_movement(
|
handle_forced_movement(
|
||||||
data,
|
data,
|
||||||
@ -259,6 +264,7 @@ impl CharacterBehavior for Data {
|
|||||||
},
|
},
|
||||||
StageSection::Recover => {
|
StageSection::Recover => {
|
||||||
if self.timer < self.static_data.stage_data[stage_index].base_recover_duration {
|
if self.timer < self.static_data.stage_data[stage_index].base_recover_duration {
|
||||||
|
handle_orientation(data, &mut update, 0.60*self.static_data.ori_modifier);
|
||||||
// Recovers
|
// Recovers
|
||||||
update.character = CharacterState::ComboMelee(Data {
|
update.character = CharacterState::ComboMelee(Data {
|
||||||
static_data: self.static_data.clone(),
|
static_data: self.static_data.clone(),
|
||||||
|
@ -138,14 +138,14 @@ impl Body {
|
|||||||
Body::BirdLarge(_) => 7.0,
|
Body::BirdLarge(_) => 7.0,
|
||||||
Body::FishSmall(_) => 7.0,
|
Body::FishSmall(_) => 7.0,
|
||||||
Body::BipedLarge(_) => 1.6,
|
Body::BipedLarge(_) => 1.6,
|
||||||
Body::BipedSmall(_) => 2.4,
|
Body::BipedSmall(_) => 3.0,
|
||||||
Body::Object(_) => 2.0,
|
Body::Object(_) => 2.0,
|
||||||
Body::Golem(_) => 0.8,
|
Body::Golem(_) => 0.8,
|
||||||
Body::Theropod(theropod) => match theropod.species {
|
Body::Theropod(theropod) => match theropod.species {
|
||||||
theropod::Species::Archaeos => 0.5,
|
theropod::Species::Archaeos => 1.0,
|
||||||
theropod::Species::Odonto => 0.5,
|
theropod::Species::Odonto => 1.0,
|
||||||
theropod::Species::Ntouka => 0.5,
|
theropod::Species::Ntouka => 1.0,
|
||||||
_ => 1.4,
|
_ => 2.0,
|
||||||
},
|
},
|
||||||
Body::QuadrupedLow(quadruped_low) => match quadruped_low.species {
|
Body::QuadrupedLow(quadruped_low) => match quadruped_low.species {
|
||||||
quadruped_low::Species::Monitor => 1.8,
|
quadruped_low::Species::Monitor => 1.8,
|
||||||
|
@ -132,6 +132,7 @@ fn matches_ability_stage() {
|
|||||||
max_speed_increase: 0.8,
|
max_speed_increase: 0.8,
|
||||||
scales_from_combo: 2,
|
scales_from_combo: 2,
|
||||||
is_interruptible: true,
|
is_interruptible: true,
|
||||||
|
ori_modifier: 1.0,
|
||||||
ability_info: empty_ability_info(),
|
ability_info: empty_ability_info(),
|
||||||
},
|
},
|
||||||
stage: 1,
|
stage: 1,
|
||||||
@ -189,6 +190,7 @@ fn ignores_different_ability_stage() {
|
|||||||
max_speed_increase: 0.8,
|
max_speed_increase: 0.8,
|
||||||
scales_from_combo: 2,
|
scales_from_combo: 2,
|
||||||
is_interruptible: true,
|
is_interruptible: true,
|
||||||
|
ori_modifier: 1.0,
|
||||||
ability_info: empty_ability_info(),
|
ability_info: empty_ability_info(),
|
||||||
},
|
},
|
||||||
stage: 1,
|
stage: 1,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user