diff --git a/cockatrice/src/messagelogwidget.cpp b/cockatrice/src/messagelogwidget.cpp index a1fffb25..6b89c7e6 100644 --- a/cockatrice/src/messagelogwidget.cpp +++ b/cockatrice/src/messagelogwidget.cpp @@ -803,8 +803,8 @@ void MessageLogWidget::logSetActivePhase(int phase) case 1: phaseName = tr("upkeep step"); break; case 2: phaseName = tr("draw step"); break; case 3: phaseName = tr("first main phase"); break; - case 4: phaseName = tr("beginning of combat step"); soundEngine->startCombat(); break; - case 5: phaseName = tr("declare attackers step"); break; + case 4: phaseName = tr("beginning of combat step"); break; + case 5: phaseName = tr("declare attackers step"); soundEngine->attack(); break; case 6: phaseName = tr("declare blockers step"); break; case 7: phaseName = tr("combat damage step"); break; case 8: phaseName = tr("end of combat step"); break; diff --git a/cockatrice/src/soundengine.cpp b/cockatrice/src/soundengine.cpp index 98e53651..e3192726 100644 --- a/cockatrice/src/soundengine.cpp +++ b/cockatrice/src/soundengine.cpp @@ -17,13 +17,13 @@ SoundEngine::SoundEngine(QObject *parent) lastTapPlayed = QDateTime::currentDateTime(); lastEndStepPlayed = QDateTime::currentDateTime(); - lastStartCombatPlayed = QDateTime::currentDateTime(); + lastAttackStepPlayed = QDateTime::currentDateTime(); } void SoundEngine::cacheData() { static const QStringList fileNames = QStringList() - << "end_step" << "tap" << "player_joined" << "start_combat"; + << "end_step" << "tap" << "player_joined" << "attack"; for (int i = 0; i < fileNames.size(); ++i) { QFile file(settingsCache->getSoundPath() + "/" + fileNames[i] + ".raw"); if(!file.exists()) @@ -95,8 +95,8 @@ void SoundEngine::playerJoined() } -void SoundEngine::startCombat() { - if (lastStartCombatPlayed.secsTo(QDateTime::currentDateTime()) >= 1) - playSound("start_combat"); - lastStartCombatPlayed = QDateTime::currentDateTime(); +void SoundEngine::attack() { + if (lastAttackStepPlayed.secsTo(QDateTime::currentDateTime()) >= 1) + playSound("attack"); + lastAttackStepPlayed = QDateTime::currentDateTime(); } diff --git a/cockatrice/src/soundengine.h b/cockatrice/src/soundengine.h index ea23d7af..fb1cbd73 100644 --- a/cockatrice/src/soundengine.h +++ b/cockatrice/src/soundengine.h @@ -17,7 +17,7 @@ private: QAudioOutput *audio; QDateTime lastTapPlayed; QDateTime lastEndStepPlayed; - QDateTime lastStartCombatPlayed; + QDateTime lastAttackStepPlayed; private slots: void cacheData(); void soundEnabledChanged(); @@ -27,7 +27,7 @@ public slots: void endStep(); void tap(); void playerJoined(); - void startCombat(); + void attack(); }; extern SoundEngine *soundEngine; diff --git a/sounds/attack.raw b/sounds/attack.raw new file mode 100644 index 00000000..d9edd2a2 Binary files /dev/null and b/sounds/attack.raw differ