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"
|
||||
),
|
||||
camera: (
|
||||
vertical_origin_offset: "10.0",
|
||||
vertical_origin_offset: "8.0",
|
||||
forward_extent: "25.5",
|
||||
backward_extent: "2.5",
|
||||
backward_extent: "8.5",
|
||||
upward_extent: "15.0",
|
||||
downward_extent: "5.0",
|
||||
visibility_radius: "5.0",
|
||||
@@ -54,5 +54,8 @@
|
||||
DoubleJump: "PlyPurin5K_Share_ACTION_JumpAerialF1",
|
||||
Fall: "PlyPurin5K_Share_ACTION_Fall",
|
||||
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)]
|
||||
#[reflect(opaque)]
|
||||
pub struct AttackHitbox {
|
||||
|
||||
@@ -7,9 +7,7 @@ use strum::IntoEnumIterator;
|
||||
use strum_macros::EnumIter;
|
||||
|
||||
use crate::{
|
||||
AppState,
|
||||
fighter::{FighterAttributes, FighterCameraProfile, animation::AnimKind},
|
||||
game_settings::GameSettings,
|
||||
AppState, fighter::{FighterAttributes, FighterCameraProfile, animation::AnimKind, attack::AttackKind}, game_settings::GameSettings,
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, Reflect, EnumIter)]
|
||||
@@ -25,6 +23,7 @@ pub struct FighterManifest {
|
||||
pub attributes: FighterAttributes,
|
||||
pub camera: FighterCameraProfile,
|
||||
pub animations: HashMap<AnimKind, String>,
|
||||
pub attack_scripts: HashMap<AttackKind, String>,
|
||||
}
|
||||
|
||||
#[derive(Resource)]
|
||||
|
||||
@@ -158,9 +158,6 @@ pub fn postprocess_input(
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-13
@@ -7,19 +7,9 @@ use bevy_asset_loader::prelude::*;
|
||||
use bevy_ggrs::prelude::Session;
|
||||
|
||||
use crate::{
|
||||
AppState,
|
||||
args::Args,
|
||||
fighter::{
|
||||
FighterId,
|
||||
animation::AnimKind,
|
||||
baked_animation::BakedFighterAnimations,
|
||||
manifest::{FighterManifest, FighterManifestRegistry},
|
||||
spawn_fighter,
|
||||
visual::FighterAnimations,
|
||||
},
|
||||
math::{int::FGi32, vec::FGVec2},
|
||||
netcode::{GGRSCfg, session::create_session},
|
||||
stage::{
|
||||
AppState, args::Args, fighter::{
|
||||
FighterId, animation::AnimKind, attack::AttackKind, baked_animation::BakedFighterAnimations, manifest::{FighterManifest, FighterManifestRegistry}, spawn_fighter, visual::FighterAnimations,
|
||||
}, math::{int::FGi32, vec::FGVec2}, netcode::{GGRSCfg, session::create_session}, scripting::FighterAttackScript, stage::{
|
||||
self,
|
||||
manifest::{StageId, StageManifest, StageManifestRegistry},
|
||||
},
|
||||
@@ -41,6 +31,7 @@ pub struct SelectedFighterAssets {
|
||||
pub fighter: FighterId,
|
||||
pub model: Handle<Gltf>,
|
||||
pub baked_animations: Handle<BakedFighterAnimations>,
|
||||
pub attack_scripts: HashMap<AttackKind, Handle<FighterAttackScript>>
|
||||
}
|
||||
|
||||
#[derive(Resource)]
|
||||
@@ -82,6 +73,7 @@ impl MatchAssets {
|
||||
fighter: player.fighter,
|
||||
model: asset_server.load(manifest.model_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(),
|
||||
|
||||
Reference in New Issue
Block a user