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;
|
iss >> ifunction;
|
||||||
switch(ifunction)
|
switch(ifunction)
|
||||||
{
|
{
|
||||||
case 39://PC Expelled
|
|
||||||
if(!selectCompare<int,int>(comp,0,select.mI)) return false;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 43://PC Crime level
|
case 43://PC Crime level
|
||||||
if(!selectCompare<int,int>(comp,0,select.mI)) return false;
|
if(!selectCompare<int,int>(comp,0,select.mI)) return false;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -295,6 +295,19 @@ bool MWDialogue::Filter::getSelectStructBoolean (const SelectWrapper& select) co
|
||||||
return MWWorld::Class::get (player).getCreatureStats (player).
|
return MWWorld::Class::get (player).getCreatureStats (player).
|
||||||
getMagicEffects().get (132).mMagnitude!=0;
|
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:
|
default:
|
||||||
|
|
||||||
throw std::runtime_error ("unknown boolean select function");
|
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 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 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;
|
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 40: return Function_PcCommonDisease;
|
||||||
case 41: return Function_PcBlightDisease;
|
case 41: return Function_PcBlightDisease;
|
||||||
// 42-45
|
// 42-45
|
||||||
|
@ -191,6 +192,7 @@ MWDialogue::SelectWrapper::Type MWDialogue::SelectWrapper::getType() const
|
||||||
Function_Id, Function_Faction, Function_Class, Function_Race, Function_Cell,
|
Function_Id, Function_Faction, Function_Class, Function_Race, Function_Cell,
|
||||||
Function_SameFaction,
|
Function_SameFaction,
|
||||||
Function_PcCommonDisease, Function_PcBlightDisease, Function_PcCorprus,
|
Function_PcCommonDisease, Function_PcBlightDisease, Function_PcCorprus,
|
||||||
|
Function_PcExpelled,
|
||||||
Function_None // end marker
|
Function_None // end marker
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,8 @@ namespace MWDialogue
|
||||||
Function_Choice,
|
Function_Choice,
|
||||||
Function_PcCommonDisease, Function_PcBlightDisease, Function_PcCorprus,
|
Function_PcCommonDisease, Function_PcBlightDisease, Function_PcCorprus,
|
||||||
Function_AiSetting,
|
Function_AiSetting,
|
||||||
Function_PcAttribute, Function_PcSkill
|
Function_PcAttribute, Function_PcSkill,
|
||||||
|
Function_PcExpelled
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Type
|
enum Type
|
||||||
|
|
|
@ -81,6 +81,11 @@ std::map<std::string, int>& MWMechanics::NpcStats::getFactionRanks()
|
||||||
return mFactionRank;
|
return mFactionRank;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::set<std::string>& MWMechanics::NpcStats::getExpelled()
|
||||||
|
{
|
||||||
|
return mExpelled;
|
||||||
|
}
|
||||||
|
|
||||||
const std::map<std::string, int>& MWMechanics::NpcStats::getFactionRanks() const
|
const std::map<std::string, int>& MWMechanics::NpcStats::getFactionRanks() const
|
||||||
{
|
{
|
||||||
return mFactionRank;
|
return mFactionRank;
|
||||||
|
|
|
@ -47,6 +47,7 @@ namespace MWMechanics
|
||||||
unsigned int mMovementFlags;
|
unsigned int mMovementFlags;
|
||||||
Stat<float> mSkill[27];
|
Stat<float> mSkill[27];
|
||||||
int mBounty;
|
int mBounty;
|
||||||
|
std::set<std::string> mExpelled;
|
||||||
|
|
||||||
int mLevelProgress; // 0-10
|
int mLevelProgress; // 0-10
|
||||||
|
|
||||||
|
@ -76,6 +77,8 @@ namespace MWMechanics
|
||||||
|
|
||||||
std::map<std::string, int>& getFactionRanks();
|
std::map<std::string, int>& getFactionRanks();
|
||||||
|
|
||||||
|
std::set<std::string>& getExpelled();
|
||||||
|
|
||||||
bool isSameFaction (const NpcStats& npcStats) const;
|
bool isSameFaction (const NpcStats& npcStats) const;
|
||||||
///< Do *this and \a npcStats share a faction?
|
///< Do *this and \a npcStats share a faction?
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue