forked from mirror/openmw-tes3mp
Adjust combat mechanics
- Projectiles can not trigger critical hits - Critical hits are only possible if the target is not in combat (Fixes #1669) - Hand-to-hand deals damage to health during entire duration of knockdown animation (including standing up)
This commit is contained in:
parent
90a96cd7d8
commit
804f1a5e59
3 changed files with 18 additions and 21 deletions
|
@ -600,8 +600,8 @@ namespace MWClass
|
||||||
damage = stats.getSkill(weapskill).getModified();
|
damage = stats.getSkill(weapskill).getModified();
|
||||||
damage *= minstrike + ((maxstrike-minstrike)*stats.getAttackStrength());
|
damage *= minstrike + ((maxstrike-minstrike)*stats.getAttackStrength());
|
||||||
|
|
||||||
healthdmg = (otherstats.getFatigue().getCurrent() < 1.0f)
|
healthdmg = (otherstats.getMagicEffects().get(ESM::MagicEffect::Paralyze).mMagnitude > 0)
|
||||||
|| (otherstats.getMagicEffects().get(ESM::MagicEffect::Paralyze).mMagnitude > 0);
|
|| otherstats.getKnockedDown();
|
||||||
if(stats.isWerewolf())
|
if(stats.isWerewolf())
|
||||||
{
|
{
|
||||||
healthdmg = true;
|
healthdmg = true;
|
||||||
|
@ -623,15 +623,21 @@ namespace MWClass
|
||||||
sndMgr->playSound3D(victim, "Hand To Hand Hit", 1.0f, 1.0f);
|
sndMgr->playSound3D(victim, "Hand To Hand Hit", 1.0f, 1.0f);
|
||||||
}
|
}
|
||||||
if(ptr.getRefData().getHandle() == "player")
|
if(ptr.getRefData().getHandle() == "player")
|
||||||
|
{
|
||||||
skillUsageSucceeded(ptr, weapskill, 0);
|
skillUsageSucceeded(ptr, weapskill, 0);
|
||||||
|
|
||||||
bool detected = MWBase::Environment::get().getMechanicsManager()->awarenessCheck(ptr, victim);
|
const MWMechanics::AiSequence& seq = victim.getClass().getCreatureStats(victim).getAiSequence();
|
||||||
if(!detected)
|
|
||||||
|
bool unaware = !seq.isInCombat()
|
||||||
|
&& !MWBase::Environment::get().getMechanicsManager()->awarenessCheck(ptr, victim);
|
||||||
|
if(unaware)
|
||||||
{
|
{
|
||||||
damage *= store.find("fCombatCriticalStrikeMult")->getFloat();
|
damage *= store.find("fCombatCriticalStrikeMult")->getFloat();
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sTargetCriticalStrike}");
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sTargetCriticalStrike}");
|
||||||
MWBase::Environment::get().getSoundManager()->playSound3D(victim, "critical damage", 1.0f, 1.0f);
|
MWBase::Environment::get().getSoundManager()->playSound3D(victim, "critical damage", 1.0f, 1.0f);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (othercls.getCreatureStats(victim).getKnockedDown())
|
if (othercls.getCreatureStats(victim).getKnockedDown())
|
||||||
damage *= store.find("fCombatKODamageMult")->getFloat();
|
damage *= store.find("fCombatKODamageMult")->getFloat();
|
||||||
|
|
||||||
|
|
|
@ -147,11 +147,7 @@ namespace MWMechanics
|
||||||
float resistance = std::min(100.f, stats.getMagicEffects().get(ESM::MagicEffect::ResistNormalWeapons).mMagnitude
|
float resistance = std::min(100.f, stats.getMagicEffects().get(ESM::MagicEffect::ResistNormalWeapons).mMagnitude
|
||||||
- stats.getMagicEffects().get(ESM::MagicEffect::WeaknessToNormalWeapons).mMagnitude);
|
- stats.getMagicEffects().get(ESM::MagicEffect::WeaknessToNormalWeapons).mMagnitude);
|
||||||
|
|
||||||
float multiplier = 0;
|
float multiplier = 1.f - resistance / 100.f;
|
||||||
if (resistance >= 0)
|
|
||||||
multiplier = 1 - resistance / 100.f;
|
|
||||||
else
|
|
||||||
multiplier = -(resistance-100) / 100.f;
|
|
||||||
|
|
||||||
if (!(weapon.get<ESM::Weapon>()->mBase->mData.mFlags & ESM::Weapon::Silver
|
if (!(weapon.get<ESM::Weapon>()->mBase->mData.mFlags & ESM::Weapon::Silver
|
||||||
|| weapon.get<ESM::Weapon>()->mBase->mData.mFlags & ESM::Weapon::Magical))
|
|| weapon.get<ESM::Weapon>()->mBase->mData.mFlags & ESM::Weapon::Magical))
|
||||||
|
@ -213,16 +209,10 @@ namespace MWMechanics
|
||||||
damage *= fDamageStrengthBase +
|
damage *= fDamageStrengthBase +
|
||||||
(attackerStats.getAttribute(ESM::Attribute::Strength).getModified() * fDamageStrengthMult * 0.1);
|
(attackerStats.getAttribute(ESM::Attribute::Strength).getModified() * fDamageStrengthMult * 0.1);
|
||||||
|
|
||||||
|
|
||||||
if(attacker.getRefData().getHandle() == "player")
|
if(attacker.getRefData().getHandle() == "player")
|
||||||
attacker.getClass().skillUsageSucceeded(attacker, weapskill, 0);
|
attacker.getClass().skillUsageSucceeded(attacker, weapskill, 0);
|
||||||
|
|
||||||
bool detected = MWBase::Environment::get().getMechanicsManager()->awarenessCheck(attacker, victim);
|
|
||||||
if(!detected)
|
|
||||||
{
|
|
||||||
damage *= gmst.find("fCombatCriticalStrikeMult")->getFloat();
|
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sTargetCriticalStrike}");
|
|
||||||
MWBase::Environment::get().getSoundManager()->playSound3D(victim, "critical damage", 1.0f, 1.0f);
|
|
||||||
}
|
|
||||||
if (victim.getClass().getCreatureStats(victim).getKnockedDown())
|
if (victim.getClass().getCreatureStats(victim).getKnockedDown())
|
||||||
damage *= gmst.find("fCombatKODamageMult")->getFloat();
|
damage *= gmst.find("fCombatKODamageMult")->getFloat();
|
||||||
|
|
||||||
|
|
|
@ -208,7 +208,8 @@ namespace MWMechanics
|
||||||
float getEvasion() const;
|
float getEvasion() const;
|
||||||
|
|
||||||
void setKnockedDown(bool value);
|
void setKnockedDown(bool value);
|
||||||
///Returns true for the entire duration of the actor being knocked down
|
/// Returns true for the entire duration of the actor being knocked down or knocked out,
|
||||||
|
/// including transition animations (falling down & standing up)
|
||||||
bool getKnockedDown() const;
|
bool getKnockedDown() const;
|
||||||
void setKnockedDownOneFrame(bool value);
|
void setKnockedDownOneFrame(bool value);
|
||||||
///Returns true only for the first frame of the actor being knocked out; used for "onKnockedOut" command
|
///Returns true only for the first frame of the actor being knocked out; used for "onKnockedOut" command
|
||||||
|
|
Loading…
Reference in a new issue