forked from teamnwah/openmw-tes3coop
Issue #219: added expelled status tracking; implemented expelled filter
This commit is contained in:
parent
bd2c772dae
commit
e97f3003ab
6 changed files with 26 additions and 6 deletions
|
@ -113,10 +113,6 @@ namespace MWDialogue
|
|||
iss >> ifunction;
|
||||
switch(ifunction)
|
||||
{
|
||||
case 39://PC Expelled
|
||||
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;
|
||||
|
|
|
@ -295,6 +295,19 @@ bool MWDialogue::Filter::getSelectStructBoolean (const SelectWrapper& select) co
|
|||
return MWWorld::Class::get (player).getCreatureStats (player).
|
||||
getMagicEffects().get (132).mMagnitude!=0;
|
||||
|
||||
case SelectWrapper::Function_PcExpelled:
|
||||
{
|
||||
if (MWWorld::Class::get (mActor).getNpcStats (mActor).getFactionRanks().empty())
|
||||
return false;
|
||||
|
||||
std::string faction =
|
||||
MWWorld::Class::get (mActor).getNpcStats (mActor).getFactionRanks().begin()->first;
|
||||
|
||||
std::set<std::string>& expelled = MWWorld::Class::get (player).getNpcStats (player).getExpelled();
|
||||
|
||||
return expelled.find (faction)!=expelled.end();
|
||||
}
|
||||
|
||||
default:
|
||||
|
||||
throw std::runtime_error ("unknown boolean select function");
|
||||
|
|
|
@ -66,7 +66,8 @@ MWDialogue::SelectWrapper::Function MWDialogue::SelectWrapper::decodeFunction()
|
|||
case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18: case 19: case 20:
|
||||
case 21: case 22: case 23: case 24: case 25: case 26: case 27: case 28: case 29: case 30:
|
||||
case 31: case 32: case 33: case 34: case 35: case 36: case 37: return Function_PcSkill;
|
||||
// 38, 39
|
||||
// 38
|
||||
case 39: return Function_PcExpelled;
|
||||
case 40: return Function_PcCommonDisease;
|
||||
case 41: return Function_PcBlightDisease;
|
||||
// 42-45
|
||||
|
@ -191,6 +192,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_PcExpelled,
|
||||
Function_None // end marker
|
||||
};
|
||||
|
||||
|
|
|
@ -28,7 +28,8 @@ namespace MWDialogue
|
|||
Function_Choice,
|
||||
Function_PcCommonDisease, Function_PcBlightDisease, Function_PcCorprus,
|
||||
Function_AiSetting,
|
||||
Function_PcAttribute, Function_PcSkill
|
||||
Function_PcAttribute, Function_PcSkill,
|
||||
Function_PcExpelled
|
||||
};
|
||||
|
||||
enum Type
|
||||
|
|
|
@ -81,6 +81,11 @@ std::map<std::string, int>& MWMechanics::NpcStats::getFactionRanks()
|
|||
return mFactionRank;
|
||||
}
|
||||
|
||||
std::set<std::string>& MWMechanics::NpcStats::getExpelled()
|
||||
{
|
||||
return mExpelled;
|
||||
}
|
||||
|
||||
const std::map<std::string, int>& MWMechanics::NpcStats::getFactionRanks() const
|
||||
{
|
||||
return mFactionRank;
|
||||
|
|
|
@ -47,6 +47,7 @@ namespace MWMechanics
|
|||
unsigned int mMovementFlags;
|
||||
Stat<float> mSkill[27];
|
||||
int mBounty;
|
||||
std::set<std::string> mExpelled;
|
||||
|
||||
int mLevelProgress; // 0-10
|
||||
|
||||
|
@ -75,6 +76,8 @@ namespace MWMechanics
|
|||
Stat<float>& getSkill (int index);
|
||||
|
||||
std::map<std::string, int>& getFactionRanks();
|
||||
|
||||
std::set<std::string>& getExpelled();
|
||||
|
||||
bool isSameFaction (const NpcStats& npcStats) const;
|
||||
///< Do *this and \a npcStats share a faction?
|
||||
|
|
Loading…
Reference in a new issue