Added music
This commit is contained in:
1 parent
7db9ca8f70
commit
84f9fa37a8
13 files changed
+118
-8
No files matched your search
@@ -1516,9 +1516,32 @@ namespace ZL
|
||||
dialogueSystem.update(static_cast<int>(delta));
|
||||
updateTriggerZones(player->state.position);
|
||||
}
|
||||
|
||||
bool npcAttacking = false;
|
||||
|
||||
for (auto& npc : npcs)
|
||||
{
|
||||
npc->update(delta, resolver);
|
||||
|
||||
if (npc->state.enabled && npc->state.canAttack && (!npc->state.pathWaypoints.empty() || npc->state.battle_state != 0) && npc->getHp() > 0.f)
|
||||
{
|
||||
//std::cout << "[NPC] NPC '" << npc->state.npcId << "' is attacking target index " << npc->state.attackTargetIndex << std::endl;
|
||||
npcAttacking = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (state.isDarklands)
|
||||
{
|
||||
if (npcAttacking && !playBattleMusic)
|
||||
{
|
||||
playBattleMusic = true;
|
||||
if (requestDarklandsPlayBattleMusic) requestDarklandsPlayBattleMusic();
|
||||
}
|
||||
else if (!npcAttacking && playBattleMusic)
|
||||
{
|
||||
playBattleMusic = false;
|
||||
if (requestDarklandsPlayNormalMusic) requestDarklandsPlayNormalMusic();
|
||||
}
|
||||
}
|
||||
|
||||
resolveCharacterCollisions();
|
||||
|
||||
Reference in new issue
Block a user