Add attack scripts to fighter manifest

This commit is contained in:
2026-08-30 00:08:20 +02:00
parent 1e5ba52b17
commit af0e567332
6 changed files with 29 additions and 21 deletions
@@ -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);
+5 -2
View File
@@ -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"
}
)
+5
View File
@@ -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 {
+2 -3
View File
@@ -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)]
-3
View File
@@ -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
View File
@@ -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(),