ori addition to combomelee

This commit is contained in:
jshipsey 2021-04-29 22:59:29 -04:00
parent cdcbebc978
commit dc5a38f1e8
34 changed files with 47 additions and 6 deletions

View File

@ -36,4 +36,5 @@ ComboMelee(
max_speed_increase: 0.6,
scales_from_combo: 2,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -36,4 +36,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -20,4 +20,5 @@ ComboMelee(
max_speed_increase: 0.4,
scales_from_combo: 2,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -36,4 +36,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -36,4 +36,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 2,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -50,4 +50,5 @@ ComboMelee(
max_speed_increase: 0.8,
scales_from_combo: 2,
is_interruptible: true,
ori_modifier: 1.0,
)

View File

@ -36,4 +36,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -50,4 +50,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -50,4 +50,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -22,4 +22,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -50,4 +50,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -22,4 +22,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -50,4 +50,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -50,4 +50,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -64,4 +64,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -22,4 +22,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -50,4 +50,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -22,4 +22,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -50,4 +50,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -36,4 +36,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -36,4 +36,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -50,4 +50,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -22,4 +22,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -22,4 +22,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -22,4 +22,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -50,4 +50,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -22,4 +22,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -50,4 +50,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -22,4 +22,5 @@ ComboMelee(
max_speed_increase: 0.0,
scales_from_combo: 0,
is_interruptible: false,
ori_modifier: 1.0,
)

View File

@ -138,6 +138,7 @@ pub enum CharacterAbility {
max_speed_increase: f32,
scales_from_combo: u32,
is_interruptible: bool,
ori_modifier: f32,
},
LeapMelee {
energy_cost: f32,
@ -1309,6 +1310,7 @@ impl From<(&CharacterAbility, AbilityInfo)> for CharacterState {
max_speed_increase,
scales_from_combo,
is_interruptible,
ori_modifier,
} => CharacterState::ComboMelee(combo_melee::Data {
static_data: combo_melee::StaticData {
num_stages: stage_data.len() as u32,
@ -1320,6 +1322,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: *ori_modifier as f32,
ability_info,
},
stage: 1,

View File

@ -52,6 +52,7 @@ impl CharacterBehavior for Data {
handle_move(data, &mut update, 0.7);
handle_jump(data, &mut update, 1.0);
handle_orientation(data, &mut update, 0.35);
match self.stage_section {
StageSection::Buildup => {

View File

@ -97,6 +97,8 @@ pub struct StaticData {
pub scales_from_combo: u32,
/// Whether the state can be interrupted by other abilities
pub is_interruptible: bool,
/// xxx
pub ori_modifier: f32,
/// What key is used to press ability
pub ability_info: AbilityInfo,
}
@ -120,7 +122,6 @@ impl CharacterBehavior for Data {
let mut update = StateUpdate::from(data);
handle_move(data, &mut update, 0.6);
handle_orientation(data, &mut update, 0.2);
let stage_index = (self.stage - 1) as usize;
@ -135,6 +136,8 @@ impl CharacterBehavior for Data {
match self.stage_section {
StageSection::Buildup => {
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
update.character = CharacterState::ComboMelee(Data {
static_data: self.static_data.clone(),
@ -228,6 +231,8 @@ impl CharacterBehavior for Data {
},
StageSection::Swing => {
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
handle_forced_movement(
data,
@ -259,6 +264,7 @@ impl CharacterBehavior for Data {
},
StageSection::Recover => {
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
update.character = CharacterState::ComboMelee(Data {
static_data: self.static_data.clone(),

View File

@ -138,14 +138,14 @@ impl Body {
Body::BirdLarge(_) => 7.0,
Body::FishSmall(_) => 7.0,
Body::BipedLarge(_) => 1.6,
Body::BipedSmall(_) => 2.4,
Body::BipedSmall(_) => 3.0,
Body::Object(_) => 2.0,
Body::Golem(_) => 0.8,
Body::Theropod(theropod) => match theropod.species {
theropod::Species::Archaeos => 0.5,
theropod::Species::Odonto => 0.5,
theropod::Species::Ntouka => 0.5,
_ => 1.4,
theropod::Species::Archaeos => 1.0,
theropod::Species::Odonto => 1.0,
theropod::Species::Ntouka => 1.0,
_ => 2.0,
},
Body::QuadrupedLow(quadruped_low) => match quadruped_low.species {
quadruped_low::Species::Monitor => 1.8,

View File

@ -132,6 +132,7 @@ fn matches_ability_stage() {
max_speed_increase: 0.8,
scales_from_combo: 2,
is_interruptible: true,
ori_modifier: 1.0,
ability_info: empty_ability_info(),
},
stage: 1,
@ -189,6 +190,7 @@ fn ignores_different_ability_stage() {
max_speed_increase: 0.8,
scales_from_combo: 2,
is_interruptible: true,
ori_modifier: 1.0,
ability_info: empty_ability_info(),
},
stage: 1,