mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 10:23:52 +00:00
Issue #219: implemented disease filters
This commit is contained in:
parent
c425b3f4a3
commit
eb4e72aaa7
4 changed files with 24 additions and 13 deletions
|
@ -117,14 +117,6 @@ namespace MWDialogue
|
|||
if(!selectCompare<int,int>(comp,0,select.mI)) return false;
|
||||
break;
|
||||
|
||||
case 40://PC Common Disease
|
||||
if(!selectCompare<int,int>(comp,0,select.mI)) return false;
|
||||
break;
|
||||
|
||||
case 41://PC Blight Disease
|
||||
if(!selectCompare<int,int>(comp,0,select.mI)) return false;
|
||||
break;
|
||||
|
||||
case 43://PC Crime level
|
||||
if(!selectCompare<int,int>(comp,0,select.mI)) return false;
|
||||
break;
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
#include "../mwworld/containerstore.hpp"
|
||||
|
||||
#include "../mwmechanics/npcstats.hpp"
|
||||
#include "../mwmechanics/creaturestats.hpp"
|
||||
#include "../mwmechanics/magiceffects.hpp"
|
||||
|
||||
#include "selectwrapper.hpp"
|
||||
|
||||
|
@ -232,6 +234,8 @@ int MWDialogue::Filter::getSelectStructInteger (const SelectWrapper& select) con
|
|||
|
||||
bool MWDialogue::Filter::getSelectStructBoolean (const SelectWrapper& select) const
|
||||
{
|
||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
||||
|
||||
switch (select.getFunction())
|
||||
{
|
||||
case SelectWrapper::Function_Id:
|
||||
|
@ -255,12 +259,22 @@ bool MWDialogue::Filter::getSelectStructBoolean (const SelectWrapper& select) co
|
|||
return toLower (mActor.getCell()->mCell->mName)==select.getName();
|
||||
|
||||
case SelectWrapper::Function_SameFaction:
|
||||
{
|
||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
||||
|
||||
return MWWorld::Class::get (mActor).getNpcStats (mActor).isSameFaction (
|
||||
MWWorld::Class::get (player).getNpcStats (player));
|
||||
}
|
||||
|
||||
case SelectWrapper::Function_PcCommonDisease:
|
||||
|
||||
return MWWorld::Class::get (player).getCreatureStats (player).hasCommonDisease();
|
||||
|
||||
case SelectWrapper::Function_PcBlightDisease:
|
||||
|
||||
return MWWorld::Class::get (player).getCreatureStats (player).hasBlightDisease();
|
||||
|
||||
case SelectWrapper::Function_PcCorprus:
|
||||
|
||||
return MWWorld::Class::get (player).getCreatureStats (player).
|
||||
getMagicEffects().get (132).mMagnitude!=0;
|
||||
|
||||
default:
|
||||
|
||||
|
|
|
@ -61,8 +61,11 @@ MWDialogue::SelectWrapper::Function MWDialogue::SelectWrapper::decodeFunction()
|
|||
|
||||
switch (index)
|
||||
{
|
||||
case 40: return Function_PcCommonDisease;
|
||||
case 41: return Function_PcBlightDisease;
|
||||
case 46: return Function_SameFaction;
|
||||
case 50: return Function_Choice;
|
||||
case 58: return Function_PcCorprus;
|
||||
}
|
||||
|
||||
return Function_None;
|
||||
|
@ -112,6 +115,7 @@ MWDialogue::SelectWrapper::Type MWDialogue::SelectWrapper::getType() const
|
|||
{
|
||||
Function_Id, Function_Faction, Function_Class, Function_Race, Function_Cell,
|
||||
Function_SameFaction,
|
||||
Function_PcCommonDisease, Function_PcBlightDisease, Function_PcCorprus,
|
||||
Function_None // end marker
|
||||
};
|
||||
|
||||
|
|
|
@ -25,7 +25,8 @@ namespace MWDialogue
|
|||
Function_Local,
|
||||
Function_Global,
|
||||
Function_SameFaction,
|
||||
Function_Choice
|
||||
Function_Choice,
|
||||
Function_PcCommonDisease, Function_PcBlightDisease, Function_PcCorprus
|
||||
};
|
||||
|
||||
enum Type
|
||||
|
|
Loading…
Reference in a new issue