Add attack scripts to fighter manifest
This commit is contained in:
@@ -0,0 +1,12 @@
|
|||||||
|
frame(3);
|
||||||
|
hitbox(0,
|
||||||
|
"Foot.L",
|
||||||
|
damage("5.0"),
|
||||||
|
vec3("0.0", "0.0", "0.0"),
|
||||||
|
fg32("20.0"),
|
||||||
|
angle_sakurai(),
|
||||||
|
knockback_normal(),
|
||||||
|
knockback("10.0"),
|
||||||
|
fg32("1.0")
|
||||||
|
);
|
||||||
|
frame(6);
|
||||||
@@ -34,9 +34,9 @@
|
|||||||
air_dodge_decay: "0.9"
|
air_dodge_decay: "0.9"
|
||||||
),
|
),
|
||||||
camera: (
|
camera: (
|
||||||
vertical_origin_offset: "10.0",
|
vertical_origin_offset: "8.0",
|
||||||
forward_extent: "25.5",
|
forward_extent: "25.5",
|
||||||
backward_extent: "2.5",
|
backward_extent: "8.5",
|
||||||
upward_extent: "15.0",
|
upward_extent: "15.0",
|
||||||
downward_extent: "5.0",
|
downward_extent: "5.0",
|
||||||
visibility_radius: "5.0",
|
visibility_radius: "5.0",
|
||||||
@@ -54,5 +54,8 @@
|
|||||||
DoubleJump: "PlyPurin5K_Share_ACTION_JumpAerialF1",
|
DoubleJump: "PlyPurin5K_Share_ACTION_JumpAerialF1",
|
||||||
Fall: "PlyPurin5K_Share_ACTION_Fall",
|
Fall: "PlyPurin5K_Share_ACTION_Fall",
|
||||||
Turn: "PlyPurin5K_Share_ACTION_Turn",
|
Turn: "PlyPurin5K_Share_ACTION_Turn",
|
||||||
|
},
|
||||||
|
attack_scripts: {
|
||||||
|
NAir: "fighters/test/scripts/fair.attack.rhai"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -59,6 +59,11 @@ impl AttackAngle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Reflect, PartialEq, Eq, Hash, Clone)]
|
||||||
|
pub enum AttackKind {
|
||||||
|
NAir
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Reflect, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Reflect, Serialize, Deserialize)]
|
||||||
#[reflect(opaque)]
|
#[reflect(opaque)]
|
||||||
pub struct AttackHitbox {
|
pub struct AttackHitbox {
|
||||||
|
|||||||
@@ -7,9 +7,7 @@ use strum::IntoEnumIterator;
|
|||||||
use strum_macros::EnumIter;
|
use strum_macros::EnumIter;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
AppState,
|
AppState, fighter::{FighterAttributes, FighterCameraProfile, animation::AnimKind, attack::AttackKind}, game_settings::GameSettings,
|
||||||
fighter::{FighterAttributes, FighterCameraProfile, animation::AnimKind},
|
|
||||||
game_settings::GameSettings,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, Reflect, EnumIter)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, Reflect, EnumIter)]
|
||||||
@@ -25,6 +23,7 @@ pub struct FighterManifest {
|
|||||||
pub attributes: FighterAttributes,
|
pub attributes: FighterAttributes,
|
||||||
pub camera: FighterCameraProfile,
|
pub camera: FighterCameraProfile,
|
||||||
pub animations: HashMap<AnimKind, String>,
|
pub animations: HashMap<AnimKind, String>,
|
||||||
|
pub attack_scripts: HashMap<AttackKind, String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Resource)]
|
#[derive(Resource)]
|
||||||
|
|||||||
@@ -158,9 +158,6 @@ pub fn postprocess_input(
|
|||||||
FighterCommands::SmashMoveLeft
|
FighterCommands::SmashMoveLeft
|
||||||
};
|
};
|
||||||
|
|
||||||
if !input.has_command(command_to_set) {
|
|
||||||
dbg!(command_to_set);
|
|
||||||
}
|
|
||||||
input.set_lifetime(command_to_set, game_settings.input_common.input_buffer_size);
|
input.set_lifetime(command_to_set, game_settings.input_common.input_buffer_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-13
@@ -7,19 +7,9 @@ use bevy_asset_loader::prelude::*;
|
|||||||
use bevy_ggrs::prelude::Session;
|
use bevy_ggrs::prelude::Session;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
AppState,
|
AppState, args::Args, fighter::{
|
||||||
args::Args,
|
FighterId, animation::AnimKind, attack::AttackKind, baked_animation::BakedFighterAnimations, manifest::{FighterManifest, FighterManifestRegistry}, spawn_fighter, visual::FighterAnimations,
|
||||||
fighter::{
|
}, math::{int::FGi32, vec::FGVec2}, netcode::{GGRSCfg, session::create_session}, scripting::FighterAttackScript, stage::{
|
||||||
FighterId,
|
|
||||||
animation::AnimKind,
|
|
||||||
baked_animation::BakedFighterAnimations,
|
|
||||||
manifest::{FighterManifest, FighterManifestRegistry},
|
|
||||||
spawn_fighter,
|
|
||||||
visual::FighterAnimations,
|
|
||||||
},
|
|
||||||
math::{int::FGi32, vec::FGVec2},
|
|
||||||
netcode::{GGRSCfg, session::create_session},
|
|
||||||
stage::{
|
|
||||||
self,
|
self,
|
||||||
manifest::{StageId, StageManifest, StageManifestRegistry},
|
manifest::{StageId, StageManifest, StageManifestRegistry},
|
||||||
},
|
},
|
||||||
@@ -41,6 +31,7 @@ pub struct SelectedFighterAssets {
|
|||||||
pub fighter: FighterId,
|
pub fighter: FighterId,
|
||||||
pub model: Handle<Gltf>,
|
pub model: Handle<Gltf>,
|
||||||
pub baked_animations: Handle<BakedFighterAnimations>,
|
pub baked_animations: Handle<BakedFighterAnimations>,
|
||||||
|
pub attack_scripts: HashMap<AttackKind, Handle<FighterAttackScript>>
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Resource)]
|
#[derive(Resource)]
|
||||||
@@ -82,6 +73,7 @@ impl MatchAssets {
|
|||||||
fighter: player.fighter,
|
fighter: player.fighter,
|
||||||
model: asset_server.load(manifest.model_path.clone()),
|
model: asset_server.load(manifest.model_path.clone()),
|
||||||
baked_animations: asset_server.load(manifest.baked_animation_path.clone()),
|
baked_animations: asset_server.load(manifest.baked_animation_path.clone()),
|
||||||
|
attack_scripts: manifest.attack_scripts.clone().into_iter().map(|(kind, path)| (kind, asset_server.load(path))).collect()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
|
|||||||
Reference in New Issue
Block a user