1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-28 23:36:42 +00:00

Issue #219: implemented disease filters

This commit is contained in:
Marc Zinnschlag 2012-11-10 11:08:36 +01:00
parent c425b3f4a3
commit eb4e72aaa7
4 changed files with 24 additions and 13 deletions

View file

@ -117,14 +117,6 @@ namespace MWDialogue
if(!selectCompare<int,int>(comp,0,select.mI)) return false; if(!selectCompare<int,int>(comp,0,select.mI)) return false;
break; 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 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;

View file

@ -11,6 +11,8 @@
#include "../mwworld/containerstore.hpp" #include "../mwworld/containerstore.hpp"
#include "../mwmechanics/npcstats.hpp" #include "../mwmechanics/npcstats.hpp"
#include "../mwmechanics/creaturestats.hpp"
#include "../mwmechanics/magiceffects.hpp"
#include "selectwrapper.hpp" #include "selectwrapper.hpp"
@ -232,6 +234,8 @@ int MWDialogue::Filter::getSelectStructInteger (const SelectWrapper& select) con
bool MWDialogue::Filter::getSelectStructBoolean (const SelectWrapper& select) const bool MWDialogue::Filter::getSelectStructBoolean (const SelectWrapper& select) const
{ {
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
switch (select.getFunction()) switch (select.getFunction())
{ {
case SelectWrapper::Function_Id: case SelectWrapper::Function_Id:
@ -255,12 +259,22 @@ bool MWDialogue::Filter::getSelectStructBoolean (const SelectWrapper& select) co
return toLower (mActor.getCell()->mCell->mName)==select.getName(); return toLower (mActor.getCell()->mCell->mName)==select.getName();
case SelectWrapper::Function_SameFaction: case SelectWrapper::Function_SameFaction:
{
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
return MWWorld::Class::get (mActor).getNpcStats (mActor).isSameFaction ( return MWWorld::Class::get (mActor).getNpcStats (mActor).isSameFaction (
MWWorld::Class::get (player).getNpcStats (player)); 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: default:

View file

@ -61,8 +61,11 @@ MWDialogue::SelectWrapper::Function MWDialogue::SelectWrapper::decodeFunction()
switch (index) switch (index)
{ {
case 40: return Function_PcCommonDisease;
case 41: return Function_PcBlightDisease;
case 46: return Function_SameFaction; case 46: return Function_SameFaction;
case 50: return Function_Choice; case 50: return Function_Choice;
case 58: return Function_PcCorprus;
} }
return Function_None; 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_Id, Function_Faction, Function_Class, Function_Race, Function_Cell,
Function_SameFaction, Function_SameFaction,
Function_PcCommonDisease, Function_PcBlightDisease, Function_PcCorprus,
Function_None // end marker Function_None // end marker
}; };

View file

@ -25,7 +25,8 @@ namespace MWDialogue
Function_Local, Function_Local,
Function_Global, Function_Global,
Function_SameFaction, Function_SameFaction,
Function_Choice Function_Choice,
Function_PcCommonDisease, Function_PcBlightDisease, Function_PcCorprus
}; };
enum Type enum Type