mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-29 09:15:33 +00:00
Function_CreatureTargetted should return '2' for werewolfs
This makes NPCs say the correct attack voice files when fighting a werewolf.
This commit is contained in:
parent
efa9ff3a76
commit
cc9af9562b
4 changed files with 16 additions and 17 deletions
|
@ -417,6 +417,21 @@ int MWDialogue::Filter::getSelectStructInteger (const SelectWrapper& select) con
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case SelectWrapper::Function_CreatureTargetted:
|
||||||
|
|
||||||
|
{
|
||||||
|
MWWorld::Ptr target;
|
||||||
|
mActor.getClass().getCreatureStats(mActor).getAiSequence().getCombatTarget(target);
|
||||||
|
if (target)
|
||||||
|
{
|
||||||
|
if (target.getClass().isNpc() && target.getClass().getNpcStats(target).isWerewolf())
|
||||||
|
return 2;
|
||||||
|
if (target.getTypeName() == typeid(ESM::Creature).name())
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
throw std::runtime_error ("unknown integer select function");
|
throw std::runtime_error ("unknown integer select function");
|
||||||
|
@ -532,10 +547,6 @@ bool MWDialogue::Filter::getSelectStructBoolean (const SelectWrapper& select) co
|
||||||
return MWBase::Environment::get().getMechanicsManager()->isAggressive(mActor,
|
return MWBase::Environment::get().getMechanicsManager()->isAggressive(mActor,
|
||||||
MWBase::Environment::get().getWorld()->getPlayerPtr());
|
MWBase::Environment::get().getWorld()->getPlayerPtr());
|
||||||
|
|
||||||
case SelectWrapper::Function_CreatureTargetted:
|
|
||||||
|
|
||||||
return mActor.getClass().getCreatureStats (mActor).getCreatureTargetted();
|
|
||||||
|
|
||||||
case SelectWrapper::Function_Werewolf:
|
case SelectWrapper::Function_Werewolf:
|
||||||
|
|
||||||
return mActor.getClass().getNpcStats (mActor).isWerewolf();
|
return mActor.getClass().getNpcStats (mActor).isWerewolf();
|
||||||
|
|
|
@ -205,6 +205,7 @@ MWDialogue::SelectWrapper::Type MWDialogue::SelectWrapper::getType() const
|
||||||
Function_Reputation, Function_FactionRankDiff,
|
Function_Reputation, Function_FactionRankDiff,
|
||||||
Function_WerewolfKills,
|
Function_WerewolfKills,
|
||||||
Function_RankLow, Function_RankHigh,
|
Function_RankLow, Function_RankHigh,
|
||||||
|
Function_CreatureTargetted,
|
||||||
Function_None // end marker
|
Function_None // end marker
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -225,7 +226,6 @@ MWDialogue::SelectWrapper::Type MWDialogue::SelectWrapper::getType() const
|
||||||
Function_PcVampire, Function_TalkedToPc,
|
Function_PcVampire, Function_TalkedToPc,
|
||||||
Function_Alarmed, Function_Detected,
|
Function_Alarmed, Function_Detected,
|
||||||
Function_Attacked, Function_ShouldAttack,
|
Function_Attacked, Function_ShouldAttack,
|
||||||
Function_CreatureTargetted,
|
|
||||||
Function_Werewolf,
|
Function_Werewolf,
|
||||||
Function_None // end marker
|
Function_None // end marker
|
||||||
};
|
};
|
||||||
|
|
|
@ -329,16 +329,6 @@ namespace MWMechanics
|
||||||
mAttacked = attacked;
|
mAttacked = attacked;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CreatureStats::getCreatureTargetted() const
|
|
||||||
{
|
|
||||||
MWWorld::Ptr targetPtr;
|
|
||||||
if (mAiSequence.getCombatTarget(targetPtr))
|
|
||||||
{
|
|
||||||
return targetPtr.getTypeName() == typeid(ESM::Creature).name();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
float CreatureStats::getEvasion() const
|
float CreatureStats::getEvasion() const
|
||||||
{
|
{
|
||||||
float evasion = (getAttribute(ESM::Attribute::Agility).getModified() / 5.0f) +
|
float evasion = (getAttribute(ESM::Attribute::Agility).getModified() / 5.0f) +
|
||||||
|
|
|
@ -199,8 +199,6 @@ namespace MWMechanics
|
||||||
bool getAttacked() const;
|
bool getAttacked() const;
|
||||||
void setAttacked (bool attacked);
|
void setAttacked (bool attacked);
|
||||||
|
|
||||||
bool getCreatureTargetted() const;
|
|
||||||
|
|
||||||
float getEvasion() const;
|
float getEvasion() const;
|
||||||
|
|
||||||
void setKnockedDown(bool value);
|
void setKnockedDown(bool value);
|
||||||
|
|
Loading…
Reference in a new issue