Enhance combat action feedback
This commit is contained in:
@@ -109,6 +109,51 @@ class SoundDirector {
|
||||
window.setTimeout(() => this.playTone(980, 0.12, 0.034, 'sine'), 168);
|
||||
}
|
||||
|
||||
playMeleeRush(mounted: boolean) {
|
||||
if (mounted) {
|
||||
this.playEffect('horse-gallop', { volume: 0.2, rate: 1.18, stopAfterMs: 360 });
|
||||
return;
|
||||
}
|
||||
|
||||
this.playEffect('footstep-walk', { volume: 0.2, rate: 1.35, stopAfterMs: 320 });
|
||||
}
|
||||
|
||||
playMeleeSwing(hit: boolean, critical: boolean) {
|
||||
this.playEffect('sword-slash', {
|
||||
volume: critical ? 0.62 : hit ? 0.52 : 0.38,
|
||||
rate: critical ? 0.94 : hit ? 1 : 1.1,
|
||||
stopAfterMs: 640
|
||||
});
|
||||
this.playTone(critical ? 180 : 220, 0.04, critical ? 0.03 : 0.02, 'sawtooth');
|
||||
}
|
||||
|
||||
playArrowShot() {
|
||||
this.playEffect('sword-slash', { volume: 0.18, rate: 1.58, stopAfterMs: 280 });
|
||||
this.playTone(760, 0.05, 0.012, 'triangle');
|
||||
window.setTimeout(() => this.playTone(1180, 0.045, 0.01, 'sine'), 46);
|
||||
}
|
||||
|
||||
playArrowImpact(hit: boolean, critical: boolean) {
|
||||
if (hit) {
|
||||
this.playEffect('combat-impact', { volume: critical ? 0.5 : 0.34, rate: critical ? 1.06 : 1.18, stopAfterMs: 420 });
|
||||
this.playTone(critical ? 260 : 340, 0.05, critical ? 0.026 : 0.018, 'square');
|
||||
return;
|
||||
}
|
||||
|
||||
this.playTone(940, 0.06, 0.011, 'sine');
|
||||
}
|
||||
|
||||
playStrategyPulse() {
|
||||
this.playEffect('strategy-cast', { volume: 0.44, rate: 0.96, stopAfterMs: 960 });
|
||||
this.playTone(460, 0.08, 0.012, 'sine');
|
||||
window.setTimeout(() => this.playTone(690, 0.08, 0.012, 'triangle'), 78);
|
||||
}
|
||||
|
||||
playItemLaunch() {
|
||||
this.playEffect('cart-roll', { volume: 0.34, rate: 1.06, stopAfterMs: 740 });
|
||||
this.playTone(180, 0.055, 0.02, 'sawtooth');
|
||||
}
|
||||
|
||||
playEffect(key: string, options: PlayEffectOptions = {}) {
|
||||
if (!this.started || this.muted) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user