This commit is contained in:
2025-12-08 03:00:36 +09:00
parent 135bf26332
commit 9540dd22a3
8 changed files with 627 additions and 326 deletions
@@ -105,6 +105,41 @@ class BattleAnimationWidgetState extends State<BattleAnimationWidget>
}
}
Future<void> animateDefense(VoidCallback onImpact) async {
// Defense: Wobble/Shake horizontally
_translateController.duration = const Duration(milliseconds: 800);
// Sequence: Left -> Right -> Center
_translateAnimation =
TweenSequence<Offset>([
TweenSequenceItem(
tween: Tween<Offset>(begin: Offset.zero, end: const Offset(-10, 0)),
weight: 25,
),
TweenSequenceItem(
tween: Tween<Offset>(
begin: const Offset(-10, 0),
end: const Offset(10, 0),
),
weight: 50,
),
TweenSequenceItem(
tween: Tween<Offset>(begin: const Offset(10, 0), end: Offset.zero),
weight: 25,
),
]).animate(
CurvedAnimation(
parent: _translateController,
curve: Curves.easeInOut,
),
);
await _translateController.forward();
if (!mounted) return;
onImpact();
_translateController.reset();
}
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
@@ -125,7 +125,7 @@ class CharacterStatusCard extends StatelessWidget {
),
const SizedBox(height: 8), // 아이콘과 정보 사이 간격
if (!isPlayer)
if (!isPlayer && !hideStats)
Consumer<BattleProvider>(
builder: (context, provider, child) {
if (provider.currentEnemyIntent != null && !character.isDead) {
@@ -286,6 +286,11 @@ class FloatingFeedbackTextState extends State<FloatingFeedbackText>
class FeedbackTextData {
final String id;
final Widget widget;
final String eventId; // To prevent duplicates
FeedbackTextData({required this.id, required this.widget});
FeedbackTextData({
required this.id,
required this.widget,
required this.eventId,
});
}