update
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user