1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-04 12:39:55 +00:00

Allow creatures to play Attack voiceover

This commit is contained in:
Capostrophic 2019-01-26 16:50:19 +03:00
parent cec55119ca
commit b33016d89f

View File

@ -555,13 +555,13 @@ namespace MWMechanics
if (actor.getClass().isNpc()) if (actor.getClass().isNpc())
{ {
baseDelay = store.get<ESM::GameSetting>().find("fCombatDelayNPC")->mValue.getFloat(); baseDelay = store.get<ESM::GameSetting>().find("fCombatDelayNPC")->mValue.getFloat();
}
//say a provoking combat phrase // Say a provoking combat phrase
int chance = store.get<ESM::GameSetting>().find("iVoiceAttackOdds")->mValue.getInteger(); const int iVoiceAttackOdds = store.get<ESM::GameSetting>().find("iVoiceAttackOdds")->mValue.getInteger();
if (Misc::Rng::roll0to99() < chance) if (Misc::Rng::roll0to99() < iVoiceAttackOdds)
{ {
MWBase::Environment::get().getDialogueManager()->say(actor, "attack"); MWBase::Environment::get().getDialogueManager()->say(actor, "attack");
}
} }
mAttackCooldown = std::min(baseDelay + 0.01 * Misc::Rng::roll0to99(), baseDelay + 0.9); mAttackCooldown = std::min(baseDelay + 0.01 * Misc::Rng::roll0to99(), baseDelay + 0.9);
} }