Attack system revamp (#82)
- Add crouch cancelling - Add IASA for aerial attacks - Add scaffolding for autocancel - Add hitbox group system - Add new ergonomic features for attack scripting - Add more information to the hitbox viewer - Improve the looks of debug capsules Reviewed-on: #82 Co-authored-by: Álex Román Núñez <eirexe@eirteam.moe>
This commit was merged in pull request #82.
This commit is contained in:
+18
-8
@@ -28,6 +28,7 @@ use crate::math::int::FGi32;
|
||||
use crate::math::vec::FGVec2;
|
||||
use crate::math::vec3::FGVec3;
|
||||
use crate::player::Player;
|
||||
use crate::scripting::FighterAttackScript;
|
||||
|
||||
pub fn debug_draw_ecb(
|
||||
ecbs: Query<(
|
||||
@@ -368,6 +369,7 @@ pub fn attack_debug(
|
||||
)>,
|
||||
mut gizmos: Gizmos,
|
||||
mut filled_gizmos: FilledGizmos,
|
||||
attack_scripts: Res<Assets<FighterAttackScript>>
|
||||
) {
|
||||
for (hitboxes, _matrices, _translation, _facing_direction, _frame) in query {
|
||||
if let Some(active_attack) = &hitboxes.0 {
|
||||
@@ -378,27 +380,35 @@ pub fn attack_debug(
|
||||
(solved_hitbox.capsule.start + solved_hitbox.capsule.end) * FGi32::lit("0.5");
|
||||
let length = (start - end).length();
|
||||
|
||||
let attack_capsule = Capsule3d {
|
||||
half_length: length * 0.5,
|
||||
radius: solved_hitbox.capsule.radius.to_num(),
|
||||
};
|
||||
|
||||
let aim_dir = (end - start).normalize_or(Vec3::Y);
|
||||
|
||||
let mut capsule_draw_trf = Transform::IDENTITY;
|
||||
capsule_draw_trf.translation = center.to_vec3();
|
||||
capsule_draw_trf.align(Dir3::Y, aim_dir, Dir3::X, aim_dir.any_orthonormal_vector());
|
||||
|
||||
let Some(script) = attack_scripts.get(&active_attack.script) else {
|
||||
continue;
|
||||
};
|
||||
|
||||
let hitbox_color = script.hitboxes.get(solved_hitbox.hitbox_idx).expect("This hitbox should be valid").get_debug_draw_color();
|
||||
/*
|
||||
let attack_capsule = Capsule3d {
|
||||
half_length: length * 0.5,
|
||||
radius: solved_hitbox.capsule.radius.to_num(),
|
||||
};
|
||||
gizmos.primitive_3d(
|
||||
&attack_capsule,
|
||||
capsule_draw_trf.to_isometry(),
|
||||
bevy::color::palettes::css::RED,
|
||||
);
|
||||
hitbox_color,
|
||||
);*/
|
||||
|
||||
let hitbox_inner_color = bevy::color::Srgba { alpha: 0.18, ..hitbox_color };
|
||||
|
||||
filled_gizmos.capsule(
|
||||
capsule_draw_trf.to_isometry(),
|
||||
solved_hitbox.capsule.radius.to_num(),
|
||||
length * 0.5,
|
||||
Color::srgba(1.0, 0.0, 0.0, 0.18),
|
||||
hitbox_inner_color,
|
||||
);
|
||||
|
||||
gizmos.cross(start, 1.0, bevy::color::palettes::css::GREEN);
|
||||
|
||||
Reference in New Issue
Block a user