mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 10:53:51 +00:00
Remove static method MWWorld::Class::get(&Ptr)
It was just adding a level of indirection to Ptr.getClass(). All the call were replaced by that instead. The number of lines changed is important, but the change itself is trivial, so everything should be fine. :)
This commit is contained in:
parent
20cfdd4b43
commit
1e4a854433
82 changed files with 453 additions and 459 deletions
|
@ -492,11 +492,11 @@ void OMW::Engine::activate()
|
||||||
MWScript::InterpreterContext interpreterContext (&ptr.getRefData().getLocals(), ptr);
|
MWScript::InterpreterContext interpreterContext (&ptr.getRefData().getLocals(), ptr);
|
||||||
|
|
||||||
boost::shared_ptr<MWWorld::Action> action =
|
boost::shared_ptr<MWWorld::Action> action =
|
||||||
MWWorld::Class::get (ptr).activate (ptr, MWBase::Environment::get().getWorld()->getPlayerPtr());
|
ptr.getClass().activate (ptr, MWBase::Environment::get().getWorld()->getPlayerPtr());
|
||||||
|
|
||||||
interpreterContext.activate (ptr, action);
|
interpreterContext.activate (ptr, action);
|
||||||
|
|
||||||
std::string script = MWWorld::Class::get (ptr).getScript (ptr);
|
std::string script = ptr.getClass().getScript (ptr);
|
||||||
|
|
||||||
MWBase::Environment::get().getWorld()->breakInvisibility(MWBase::Environment::get().getWorld()->getPlayerPtr());
|
MWBase::Environment::get().getWorld()->breakInvisibility(MWBase::Environment::get().getWorld()->getPlayerPtr());
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ namespace MWClass
|
||||||
|
|
||||||
boost::shared_ptr<MWWorld::Action> Activator::activate(const MWWorld::Ptr &ptr, const MWWorld::Ptr &actor) const
|
boost::shared_ptr<MWWorld::Action> Activator::activate(const MWWorld::Ptr &ptr, const MWWorld::Ptr &actor) const
|
||||||
{
|
{
|
||||||
if(get(actor).isNpc() && get(actor).getNpcStats(actor).isWerewolf())
|
if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf())
|
||||||
{
|
{
|
||||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||||
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfActivator");
|
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfActivator");
|
||||||
|
|
|
@ -295,7 +295,7 @@ namespace MWClass
|
||||||
return std::make_pair(0, "#{sInventoryMessage1}");
|
return std::make_pair(0, "#{sInventoryMessage1}");
|
||||||
|
|
||||||
// slots that this item can be equipped in
|
// slots that this item can be equipped in
|
||||||
std::pair<std::vector<int>, bool> slots_ = MWWorld::Class::get(ptr).getEquipmentSlots(ptr);
|
std::pair<std::vector<int>, bool> slots_ = ptr.getClass().getEquipmentSlots(ptr);
|
||||||
|
|
||||||
if (slots_.first.empty())
|
if (slots_.first.empty())
|
||||||
return std::make_pair(0, "");
|
return std::make_pair(0, "");
|
||||||
|
|
|
@ -61,7 +61,7 @@ namespace MWClass
|
||||||
boost::shared_ptr<MWWorld::Action> Book::activate (const MWWorld::Ptr& ptr,
|
boost::shared_ptr<MWWorld::Action> Book::activate (const MWWorld::Ptr& ptr,
|
||||||
const MWWorld::Ptr& actor) const
|
const MWWorld::Ptr& actor) const
|
||||||
{
|
{
|
||||||
if(get(actor).isNpc() && get(actor).getNpcStats(actor).isWerewolf())
|
if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf())
|
||||||
{
|
{
|
||||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||||
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfItem");
|
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfItem");
|
||||||
|
|
|
@ -233,7 +233,7 @@ namespace MWClass
|
||||||
std::pair<int, std::string> Clothing::canBeEquipped(const MWWorld::Ptr &ptr, const MWWorld::Ptr &npc) const
|
std::pair<int, std::string> Clothing::canBeEquipped(const MWWorld::Ptr &ptr, const MWWorld::Ptr &npc) const
|
||||||
{
|
{
|
||||||
// slots that this item can be equipped in
|
// slots that this item can be equipped in
|
||||||
std::pair<std::vector<int>, bool> slots_ = MWWorld::Class::get(ptr).getEquipmentSlots(ptr);
|
std::pair<std::vector<int>, bool> slots_ = ptr.getClass().getEquipmentSlots(ptr);
|
||||||
|
|
||||||
if (slots_.first.empty())
|
if (slots_.first.empty())
|
||||||
return std::make_pair(0, "");
|
return std::make_pair(0, "");
|
||||||
|
|
|
@ -112,7 +112,7 @@ namespace MWClass
|
||||||
if (!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory))
|
if (!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory))
|
||||||
return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction ());
|
return boost::shared_ptr<MWWorld::Action> (new MWWorld::NullAction ());
|
||||||
|
|
||||||
if(get(actor).isNpc() && get(actor).getNpcStats(actor).isWerewolf())
|
if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf())
|
||||||
{
|
{
|
||||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||||
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfContainer");
|
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfContainer");
|
||||||
|
@ -127,7 +127,7 @@ namespace MWClass
|
||||||
const std::string trapActivationSound = "Disarm Trap Fail";
|
const std::string trapActivationSound = "Disarm Trap Fail";
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
||||||
MWWorld::InventoryStore& invStore = MWWorld::Class::get(player).getInventoryStore(player);
|
MWWorld::InventoryStore& invStore = player.getClass().getInventoryStore(player);
|
||||||
|
|
||||||
bool needKey = ptr.getCellRef().mLockLevel > 0;
|
bool needKey = ptr.getCellRef().mLockLevel > 0;
|
||||||
bool hasKey = false;
|
bool hasKey = false;
|
||||||
|
@ -143,7 +143,7 @@ namespace MWClass
|
||||||
if (refId == keyId)
|
if (refId == keyId)
|
||||||
{
|
{
|
||||||
hasKey = true;
|
hasKey = true;
|
||||||
keyName = MWWorld::Class::get(*it).getName(*it);
|
keyName = it->getClass().getName(*it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -277,7 +277,7 @@ namespace MWClass
|
||||||
|
|
||||||
if (!weapon.isEmpty())
|
if (!weapon.isEmpty())
|
||||||
{
|
{
|
||||||
const bool weaphashealth = get(weapon).hasItemHealth(weapon);
|
const bool weaphashealth = weapon.getClass().hasItemHealth(weapon);
|
||||||
const unsigned char *attack = NULL;
|
const unsigned char *attack = NULL;
|
||||||
if(type == ESM::Weapon::AT_Chop)
|
if(type == ESM::Weapon::AT_Chop)
|
||||||
attack = weapon.get<ESM::Weapon>()->mBase->mData.mChop;
|
attack = weapon.get<ESM::Weapon>()->mBase->mData.mChop;
|
||||||
|
@ -354,7 +354,7 @@ namespace MWClass
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!object.isEmpty())
|
if(!object.isEmpty())
|
||||||
getCreatureStats(ptr).setLastHitObject(MWWorld::Class::get(object).getId(object));
|
getCreatureStats(ptr).setLastHitObject(object.getClass().getId(object));
|
||||||
|
|
||||||
if(!attacker.isEmpty() && attacker.getRefData().getHandle() == "player")
|
if(!attacker.isEmpty() && attacker.getRefData().getHandle() == "player")
|
||||||
{
|
{
|
||||||
|
@ -444,7 +444,7 @@ namespace MWClass
|
||||||
boost::shared_ptr<MWWorld::Action> Creature::activate (const MWWorld::Ptr& ptr,
|
boost::shared_ptr<MWWorld::Action> Creature::activate (const MWWorld::Ptr& ptr,
|
||||||
const MWWorld::Ptr& actor) const
|
const MWWorld::Ptr& actor) const
|
||||||
{
|
{
|
||||||
if(get(actor).isNpc() && get(actor).getNpcStats(actor).isWerewolf())
|
if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf())
|
||||||
{
|
{
|
||||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||||
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfCreature");
|
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfCreature");
|
||||||
|
|
|
@ -99,7 +99,7 @@ namespace MWClass
|
||||||
const std::string lockedSound = "LockedDoor";
|
const std::string lockedSound = "LockedDoor";
|
||||||
const std::string trapActivationSound = "Disarm Trap Fail";
|
const std::string trapActivationSound = "Disarm Trap Fail";
|
||||||
|
|
||||||
MWWorld::ContainerStore &invStore = get(actor).getContainerStore(actor);
|
MWWorld::ContainerStore &invStore = actor.getClass().getContainerStore(actor);
|
||||||
|
|
||||||
bool needKey = ptr.getCellRef().mLockLevel > 0;
|
bool needKey = ptr.getCellRef().mLockLevel > 0;
|
||||||
bool hasKey = false;
|
bool hasKey = false;
|
||||||
|
@ -115,7 +115,7 @@ namespace MWClass
|
||||||
if (refId == keyId)
|
if (refId == keyId)
|
||||||
{
|
{
|
||||||
hasKey = true;
|
hasKey = true;
|
||||||
keyName = get(*it).getName(*it);
|
keyName = it->getClass().getName(*it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -153,7 +153,7 @@ namespace MWClass
|
||||||
}
|
}
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
||||||
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(player).getNpcStats (player);
|
MWMechanics::NpcStats& npcStats = player.getClass().getNpcStats (player);
|
||||||
int alchemySkill = npcStats.getSkill (ESM::Skill::Alchemy).getBase();
|
int alchemySkill = npcStats.getSkill (ESM::Skill::Alchemy).getBase();
|
||||||
|
|
||||||
static const float fWortChanceValue =
|
static const float fWortChanceValue =
|
||||||
|
|
|
@ -250,7 +250,7 @@ namespace MWClass
|
||||||
|
|
||||||
std::pair<int, std::string> Light::canBeEquipped(const MWWorld::Ptr &ptr, const MWWorld::Ptr &npc) const
|
std::pair<int, std::string> Light::canBeEquipped(const MWWorld::Ptr &ptr, const MWWorld::Ptr &npc) const
|
||||||
{
|
{
|
||||||
MWWorld::InventoryStore& invStore = MWWorld::Class::get(npc).getInventoryStore(npc);
|
MWWorld::InventoryStore& invStore = npc.getClass().getInventoryStore(npc);
|
||||||
MWWorld::ContainerStoreIterator weapon = invStore.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
|
MWWorld::ContainerStoreIterator weapon = invStore.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
|
||||||
|
|
||||||
if(weapon == invStore.end())
|
if(weapon == invStore.end())
|
||||||
|
|
|
@ -484,10 +484,10 @@ namespace MWClass
|
||||||
if(victim.isEmpty()) // Didn't hit anything
|
if(victim.isEmpty()) // Didn't hit anything
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const MWWorld::Class &othercls = MWWorld::Class::get(victim);
|
const MWWorld::Class &othercls = victim.getClass();
|
||||||
if(!othercls.isActor()) // Can't hit non-actors
|
if(!othercls.isActor()) // Can't hit non-actors
|
||||||
return;
|
return;
|
||||||
MWMechanics::CreatureStats &otherstats = victim.getClass().getCreatureStats(victim);
|
MWMechanics::CreatureStats &otherstats = othercls.getCreatureStats(victim);
|
||||||
if(otherstats.isDead()) // Can't hit dead actors
|
if(otherstats.isDead()) // Can't hit dead actors
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -496,7 +496,7 @@ namespace MWClass
|
||||||
|
|
||||||
int weapskill = ESM::Skill::HandToHand;
|
int weapskill = ESM::Skill::HandToHand;
|
||||||
if(!weapon.isEmpty())
|
if(!weapon.isEmpty())
|
||||||
weapskill = get(weapon).getEquipmentSkill(weapon);
|
weapskill = weapon.getClass().getEquipmentSkill(weapon);
|
||||||
|
|
||||||
float hitchance = MWMechanics::getHitChance(ptr, victim, ptr.getClass().getSkill(ptr, weapskill));
|
float hitchance = MWMechanics::getHitChance(ptr, victim, ptr.getClass().getSkill(ptr, weapskill));
|
||||||
|
|
||||||
|
@ -511,7 +511,7 @@ namespace MWClass
|
||||||
MWMechanics::NpcStats &stats = getNpcStats(ptr);
|
MWMechanics::NpcStats &stats = getNpcStats(ptr);
|
||||||
if(!weapon.isEmpty())
|
if(!weapon.isEmpty())
|
||||||
{
|
{
|
||||||
const bool weaphashealth = get(weapon).hasItemHealth(weapon);
|
const bool weaphashealth = weapon.getClass().hasItemHealth(weapon);
|
||||||
const unsigned char *attack = NULL;
|
const unsigned char *attack = NULL;
|
||||||
if(type == ESM::Weapon::AT_Chop)
|
if(type == ESM::Weapon::AT_Chop)
|
||||||
attack = weapon.get<ESM::Weapon>()->mBase->mData.mChop;
|
attack = weapon.get<ESM::Weapon>()->mBase->mData.mChop;
|
||||||
|
@ -637,7 +637,7 @@ namespace MWClass
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!object.isEmpty())
|
if(!object.isEmpty())
|
||||||
getCreatureStats(ptr).setLastHitObject(get(object).getId(object));
|
getCreatureStats(ptr).setLastHitObject(object.getClass().getId(object));
|
||||||
|
|
||||||
if(!attacker.isEmpty() && attacker.getRefData().getHandle() == "player")
|
if(!attacker.isEmpty() && attacker.getRefData().getHandle() == "player")
|
||||||
{
|
{
|
||||||
|
@ -716,9 +716,9 @@ namespace MWClass
|
||||||
inv.unequipItem(armor, ptr);
|
inv.unequipItem(armor, ptr);
|
||||||
|
|
||||||
if (ptr.getRefData().getHandle() == "player")
|
if (ptr.getRefData().getHandle() == "player")
|
||||||
skillUsageSucceeded(ptr, get(armor).getEquipmentSkill(armor), 0);
|
skillUsageSucceeded(ptr, armor.getClass().getEquipmentSkill(armor), 0);
|
||||||
|
|
||||||
switch(get(armor).getEquipmentSkill(armor))
|
switch(armor.getClass().getEquipmentSkill(armor))
|
||||||
{
|
{
|
||||||
case ESM::Skill::LightArmor:
|
case ESM::Skill::LightArmor:
|
||||||
sndMgr->playSound3D(ptr, "Light Armor Hit", 1.0f, 1.0f);
|
sndMgr->playSound3D(ptr, "Light Armor Hit", 1.0f, 1.0f);
|
||||||
|
@ -802,7 +802,7 @@ namespace MWClass
|
||||||
if(ptr.getRefData().getHandle() == "player")
|
if(ptr.getRefData().getHandle() == "player")
|
||||||
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionTalk(actor));
|
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionTalk(actor));
|
||||||
|
|
||||||
if(get(actor).isNpc() && get(actor).getNpcStats(actor).isWerewolf())
|
if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf())
|
||||||
{
|
{
|
||||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||||
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfNPC");
|
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfNPC");
|
||||||
|
@ -814,7 +814,7 @@ namespace MWClass
|
||||||
}
|
}
|
||||||
if(getCreatureStats(ptr).isDead())
|
if(getCreatureStats(ptr).isDead())
|
||||||
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionOpen(ptr, true));
|
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionOpen(ptr, true));
|
||||||
if(get(ptr).getCreatureStats(ptr).isHostile())
|
if(ptr.getClass().getCreatureStats(ptr).isHostile())
|
||||||
return boost::shared_ptr<MWWorld::Action>(new MWWorld::FailedAction("#{sActorInCombat}"));
|
return boost::shared_ptr<MWWorld::Action>(new MWWorld::FailedAction("#{sActorInCombat}"));
|
||||||
if(getCreatureStats(actor).getStance(MWMechanics::CreatureStats::Stance_Sneak))
|
if(getCreatureStats(actor).getStance(MWMechanics::CreatureStats::Stance_Sneak))
|
||||||
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionOpen(ptr)); // stealing
|
return boost::shared_ptr<MWWorld::Action>(new MWWorld::ActionOpen(ptr)); // stealing
|
||||||
|
@ -943,7 +943,7 @@ namespace MWClass
|
||||||
|
|
||||||
if (fallHeight >= fallDistanceMin)
|
if (fallHeight >= fallDistanceMin)
|
||||||
{
|
{
|
||||||
const float acrobaticsSkill = MWWorld::Class::get(ptr).getNpcStats (ptr).getSkill(ESM::Skill::Acrobatics).getModified();
|
const float acrobaticsSkill = ptr.getClass().getNpcStats (ptr).getSkill(ESM::Skill::Acrobatics).getModified();
|
||||||
const NpcCustomData *npcdata = static_cast<const NpcCustomData*>(ptr.getRefData().getCustomData());
|
const NpcCustomData *npcdata = static_cast<const NpcCustomData*>(ptr.getRefData().getCustomData());
|
||||||
const float jumpSpellBonus = npcdata->mNpcStats.getMagicEffects().get(ESM::MagicEffect::Jump).mMagnitude;
|
const float jumpSpellBonus = npcdata->mNpcStats.getMagicEffects().get(ESM::MagicEffect::Jump).mMagnitude;
|
||||||
const float fallAcroBase = gmst.find("fFallAcroBase")->getFloat();
|
const float fallAcroBase = gmst.find("fFallAcroBase")->getFloat();
|
||||||
|
@ -1107,7 +1107,7 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
MWWorld::LiveCellRef<ESM::Armor> *ref = it->get<ESM::Armor>();
|
MWWorld::LiveCellRef<ESM::Armor> *ref = it->get<ESM::Armor>();
|
||||||
|
|
||||||
int armorSkillType = MWWorld::Class::get(*it).getEquipmentSkill(*it);
|
int armorSkillType = it->getClass().getEquipmentSkill(*it);
|
||||||
int armorSkill = stats.getSkill(armorSkillType).getModified();
|
int armorSkill = stats.getSkill(armorSkillType).getModified();
|
||||||
|
|
||||||
if(ref->mBase->mData.mWeight == 0)
|
if(ref->mBase->mData.mWeight == 0)
|
||||||
|
@ -1177,7 +1177,7 @@ namespace MWClass
|
||||||
if(boots == inv.end() || boots->getTypeName() != typeid(ESM::Armor).name())
|
if(boots == inv.end() || boots->getTypeName() != typeid(ESM::Armor).name())
|
||||||
return "FootBareLeft";
|
return "FootBareLeft";
|
||||||
|
|
||||||
switch(Class::get(*boots).getEquipmentSkill(*boots))
|
switch(boots->getClass().getEquipmentSkill(*boots))
|
||||||
{
|
{
|
||||||
case ESM::Skill::LightArmor:
|
case ESM::Skill::LightArmor:
|
||||||
return "FootLightLeft";
|
return "FootLightLeft";
|
||||||
|
@ -1204,7 +1204,7 @@ namespace MWClass
|
||||||
if(boots == inv.end() || boots->getTypeName() != typeid(ESM::Armor).name())
|
if(boots == inv.end() || boots->getTypeName() != typeid(ESM::Armor).name())
|
||||||
return "FootBareRight";
|
return "FootBareRight";
|
||||||
|
|
||||||
switch(Class::get(*boots).getEquipmentSkill(*boots))
|
switch(boots->getClass().getEquipmentSkill(*boots))
|
||||||
{
|
{
|
||||||
case ESM::Skill::LightArmor:
|
case ESM::Skill::LightArmor:
|
||||||
return "FootLightRight";
|
return "FootLightRight";
|
||||||
|
|
|
@ -133,7 +133,7 @@ namespace MWClass
|
||||||
|
|
||||||
// hide effects the player doesnt know about
|
// hide effects the player doesnt know about
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
||||||
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(player).getNpcStats (player);
|
MWMechanics::NpcStats& npcStats = player.getClass().getNpcStats (player);
|
||||||
int alchemySkill = npcStats.getSkill (ESM::Skill::Alchemy).getBase();
|
int alchemySkill = npcStats.getSkill (ESM::Skill::Alchemy).getBase();
|
||||||
int i=0;
|
int i=0;
|
||||||
static const float fWortChanceValue =
|
static const float fWortChanceValue =
|
||||||
|
|
|
@ -392,7 +392,7 @@ namespace MWClass
|
||||||
if (ptr.getCellRef().mCharge == 0)
|
if (ptr.getCellRef().mCharge == 0)
|
||||||
return std::make_pair(0, "#{sInventoryMessage1}");
|
return std::make_pair(0, "#{sInventoryMessage1}");
|
||||||
|
|
||||||
std::pair<std::vector<int>, bool> slots_ = MWWorld::Class::get(ptr).getEquipmentSlots(ptr);
|
std::pair<std::vector<int>, bool> slots_ = ptr.getClass().getEquipmentSlots(ptr);
|
||||||
|
|
||||||
if (slots_.first.empty())
|
if (slots_.first.empty())
|
||||||
return std::make_pair (0, "");
|
return std::make_pair (0, "");
|
||||||
|
|
|
@ -134,13 +134,13 @@ namespace MWDialogue
|
||||||
|
|
||||||
mActor = actor;
|
mActor = actor;
|
||||||
|
|
||||||
MWMechanics::CreatureStats& creatureStats = MWWorld::Class::get (actor).getCreatureStats (actor);
|
MWMechanics::CreatureStats& creatureStats = actor.getClass().getCreatureStats (actor);
|
||||||
mTalkedTo = creatureStats.hasTalkedToPlayer();
|
mTalkedTo = creatureStats.hasTalkedToPlayer();
|
||||||
|
|
||||||
mActorKnownTopics.clear();
|
mActorKnownTopics.clear();
|
||||||
|
|
||||||
MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow();
|
MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow();
|
||||||
win->startDialogue(actor, MWWorld::Class::get (actor).getName (actor));
|
win->startDialogue(actor, actor.getClass().getName (actor));
|
||||||
|
|
||||||
//setup the list of topics known by the actor. Topics who are also on the knownTopics list will be added to the GUI
|
//setup the list of topics known by the actor. Topics who are also on the knownTopics list will be added to the GUI
|
||||||
updateTopics();
|
updateTopics();
|
||||||
|
@ -194,7 +194,7 @@ namespace MWDialogue
|
||||||
|
|
||||||
Compiler::Locals locals;
|
Compiler::Locals locals;
|
||||||
|
|
||||||
std::string actorScript = MWWorld::Class::get (mActor).getScript (mActor);
|
std::string actorScript = mActor.getClass().getScript (mActor);
|
||||||
|
|
||||||
if (!actorScript.empty())
|
if (!actorScript.empty())
|
||||||
{
|
{
|
||||||
|
@ -435,7 +435,7 @@ namespace MWDialogue
|
||||||
// Apply disposition change to NPC's base disposition
|
// Apply disposition change to NPC's base disposition
|
||||||
if (mActor.getClass().isNpc())
|
if (mActor.getClass().isNpc())
|
||||||
{
|
{
|
||||||
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(mActor).getNpcStats(mActor);
|
MWMechanics::NpcStats& npcStats = mActor.getClass().getNpcStats(mActor);
|
||||||
npcStats.setBaseDisposition(npcStats.getBaseDisposition() + mPermanentDispositionChange);
|
npcStats.setBaseDisposition(npcStats.getBaseDisposition() + mPermanentDispositionChange);
|
||||||
}
|
}
|
||||||
mPermanentDispositionChange = 0;
|
mPermanentDispositionChange = 0;
|
||||||
|
|
|
@ -25,7 +25,7 @@ bool MWDialogue::Filter::testActor (const ESM::DialInfo& info) const
|
||||||
// actor id
|
// actor id
|
||||||
if (!info.mActor.empty())
|
if (!info.mActor.empty())
|
||||||
{
|
{
|
||||||
if ( !Misc::StringUtils::ciEqual(info.mActor, MWWorld::Class::get (mActor).getId (mActor)))
|
if ( !Misc::StringUtils::ciEqual(info.mActor, mActor.getClass().getId (mActor)))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (isCreature)
|
else if (isCreature)
|
||||||
|
@ -64,7 +64,7 @@ bool MWDialogue::Filter::testActor (const ESM::DialInfo& info) const
|
||||||
if (isCreature)
|
if (isCreature)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
MWMechanics::NpcStats& stats = MWWorld::Class::get (mActor).getNpcStats (mActor);
|
MWMechanics::NpcStats& stats = mActor.getClass().getNpcStats (mActor);
|
||||||
std::map<std::string, int>::iterator iter = stats.getFactionRanks().find ( Misc::StringUtils::lowerCase (info.mFaction));
|
std::map<std::string, int>::iterator iter = stats.getFactionRanks().find ( Misc::StringUtils::lowerCase (info.mFaction));
|
||||||
|
|
||||||
if (iter==stats.getFactionRanks().end())
|
if (iter==stats.getFactionRanks().end())
|
||||||
|
@ -98,7 +98,7 @@ bool MWDialogue::Filter::testPlayer (const ESM::DialInfo& info) const
|
||||||
// check player faction
|
// check player faction
|
||||||
if (!info.mPcFaction.empty())
|
if (!info.mPcFaction.empty())
|
||||||
{
|
{
|
||||||
MWMechanics::NpcStats& stats = MWWorld::Class::get (player).getNpcStats (player);
|
MWMechanics::NpcStats& stats = player.getClass().getNpcStats (player);
|
||||||
std::map<std::string,int>::iterator iter = stats.getFactionRanks().find (Misc::StringUtils::lowerCase (info.mPcFaction));
|
std::map<std::string,int>::iterator iter = stats.getFactionRanks().find (Misc::StringUtils::lowerCase (info.mPcFaction));
|
||||||
|
|
||||||
if(iter==stats.getFactionRanks().end())
|
if(iter==stats.getFactionRanks().end())
|
||||||
|
@ -182,7 +182,7 @@ bool MWDialogue::Filter::testSelectStructNumeric (const SelectWrapper& select) c
|
||||||
|
|
||||||
case SelectWrapper::Function_Local:
|
case SelectWrapper::Function_Local:
|
||||||
{
|
{
|
||||||
std::string scriptName = MWWorld::Class::get (mActor).getScript (mActor);
|
std::string scriptName = mActor.getClass().getScript (mActor);
|
||||||
|
|
||||||
if (scriptName.empty())
|
if (scriptName.empty())
|
||||||
return false; // no script
|
return false; // no script
|
||||||
|
@ -220,8 +220,8 @@ bool MWDialogue::Filter::testSelectStructNumeric (const SelectWrapper& select) c
|
||||||
{
|
{
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
|
|
||||||
float ratio = MWWorld::Class::get (player).getCreatureStats (player).getHealth().getCurrent() /
|
float ratio = player.getClass().getCreatureStats (player).getHealth().getCurrent() /
|
||||||
MWWorld::Class::get (player).getCreatureStats (player).getHealth().getModified();
|
player.getClass().getCreatureStats (player).getHealth().getModified();
|
||||||
|
|
||||||
return select.selectCompare (static_cast<int>(ratio*100));
|
return select.selectCompare (static_cast<int>(ratio*100));
|
||||||
}
|
}
|
||||||
|
@ -230,7 +230,7 @@ bool MWDialogue::Filter::testSelectStructNumeric (const SelectWrapper& select) c
|
||||||
{
|
{
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
|
|
||||||
float value = MWWorld::Class::get (player).getCreatureStats (player).
|
float value = player.getClass().getCreatureStats (player).
|
||||||
getDynamic (select.getArgument()).getCurrent();
|
getDynamic (select.getArgument()).getCurrent();
|
||||||
|
|
||||||
return select.selectCompare (value);
|
return select.selectCompare (value);
|
||||||
|
@ -238,8 +238,8 @@ bool MWDialogue::Filter::testSelectStructNumeric (const SelectWrapper& select) c
|
||||||
|
|
||||||
case SelectWrapper::Function_HealthPercent:
|
case SelectWrapper::Function_HealthPercent:
|
||||||
{
|
{
|
||||||
float ratio = MWWorld::Class::get (mActor).getCreatureStats (mActor).getHealth().getCurrent() /
|
float ratio = mActor.getClass().getCreatureStats (mActor).getHealth().getCurrent() /
|
||||||
MWWorld::Class::get (mActor).getCreatureStats (mActor).getHealth().getModified();
|
mActor.getClass().getCreatureStats (mActor).getHealth().getModified();
|
||||||
|
|
||||||
return select.selectCompare (ratio);
|
return select.selectCompare (ratio);
|
||||||
}
|
}
|
||||||
|
@ -262,7 +262,7 @@ int MWDialogue::Filter::getSelectStructInteger (const SelectWrapper& select) con
|
||||||
|
|
||||||
case SelectWrapper::Function_Item:
|
case SelectWrapper::Function_Item:
|
||||||
{
|
{
|
||||||
MWWorld::ContainerStore& store = MWWorld::Class::get (player).getContainerStore (player);
|
MWWorld::ContainerStore& store = player.getClass().getContainerStore (player);
|
||||||
|
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
|
|
||||||
|
@ -285,29 +285,29 @@ int MWDialogue::Filter::getSelectStructInteger (const SelectWrapper& select) con
|
||||||
|
|
||||||
case SelectWrapper::Function_AiSetting:
|
case SelectWrapper::Function_AiSetting:
|
||||||
|
|
||||||
return MWWorld::Class::get (mActor).getCreatureStats (mActor).getAiSetting (
|
return mActor.getClass().getCreatureStats (mActor).getAiSetting (
|
||||||
(MWMechanics::CreatureStats::AiSetting)select.getArgument()).getModified();
|
(MWMechanics::CreatureStats::AiSetting)select.getArgument()).getModified();
|
||||||
|
|
||||||
case SelectWrapper::Function_PcAttribute:
|
case SelectWrapper::Function_PcAttribute:
|
||||||
|
|
||||||
return MWWorld::Class::get (player).getCreatureStats (player).
|
return player.getClass().getCreatureStats (player).
|
||||||
getAttribute (select.getArgument()).getModified();
|
getAttribute (select.getArgument()).getModified();
|
||||||
|
|
||||||
case SelectWrapper::Function_PcSkill:
|
case SelectWrapper::Function_PcSkill:
|
||||||
|
|
||||||
return static_cast<int> (MWWorld::Class::get (player).
|
return static_cast<int> (player.getClass().
|
||||||
getNpcStats (player).getSkill (select.getArgument()).getModified());
|
getNpcStats (player).getSkill (select.getArgument()).getModified());
|
||||||
|
|
||||||
case SelectWrapper::Function_FriendlyHit:
|
case SelectWrapper::Function_FriendlyHit:
|
||||||
{
|
{
|
||||||
int hits = MWWorld::Class::get (mActor).getCreatureStats (mActor).getFriendlyHits();
|
int hits = mActor.getClass().getCreatureStats (mActor).getFriendlyHits();
|
||||||
|
|
||||||
return hits>4 ? 4 : hits;
|
return hits>4 ? 4 : hits;
|
||||||
}
|
}
|
||||||
|
|
||||||
case SelectWrapper::Function_PcLevel:
|
case SelectWrapper::Function_PcLevel:
|
||||||
|
|
||||||
return MWWorld::Class::get (player).getCreatureStats (player).getLevel();
|
return player.getClass().getCreatureStats (player).getLevel();
|
||||||
|
|
||||||
case SelectWrapper::Function_PcGender:
|
case SelectWrapper::Function_PcGender:
|
||||||
|
|
||||||
|
@ -315,7 +315,7 @@ int MWDialogue::Filter::getSelectStructInteger (const SelectWrapper& select) con
|
||||||
|
|
||||||
case SelectWrapper::Function_PcClothingModifier:
|
case SelectWrapper::Function_PcClothingModifier:
|
||||||
{
|
{
|
||||||
MWWorld::InventoryStore& store = MWWorld::Class::get (player).getInventoryStore (player);
|
MWWorld::InventoryStore& store = player.getClass().getInventoryStore (player);
|
||||||
|
|
||||||
int value = 0;
|
int value = 0;
|
||||||
|
|
||||||
|
@ -324,7 +324,7 @@ int MWDialogue::Filter::getSelectStructInteger (const SelectWrapper& select) con
|
||||||
MWWorld::ContainerStoreIterator slot = store.getSlot (i);
|
MWWorld::ContainerStoreIterator slot = store.getSlot (i);
|
||||||
|
|
||||||
if (slot!=store.end())
|
if (slot!=store.end())
|
||||||
value += MWWorld::Class::get (*slot).getValue (*slot);
|
value += slot->getClass().getValue (*slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
|
@ -332,15 +332,15 @@ int MWDialogue::Filter::getSelectStructInteger (const SelectWrapper& select) con
|
||||||
|
|
||||||
case SelectWrapper::Function_PcCrimeLevel:
|
case SelectWrapper::Function_PcCrimeLevel:
|
||||||
|
|
||||||
return MWWorld::Class::get (player).getNpcStats (player).getBounty();
|
return player.getClass().getNpcStats (player).getBounty();
|
||||||
|
|
||||||
case SelectWrapper::Function_RankRequirement:
|
case SelectWrapper::Function_RankRequirement:
|
||||||
{
|
{
|
||||||
if (MWWorld::Class::get (mActor).getNpcStats (mActor).getFactionRanks().empty())
|
if (mActor.getClass().getNpcStats (mActor).getFactionRanks().empty())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
std::string faction =
|
std::string faction =
|
||||||
MWWorld::Class::get (mActor).getNpcStats (mActor).getFactionRanks().begin()->first;
|
mActor.getClass().getNpcStats (mActor).getFactionRanks().begin()->first;
|
||||||
|
|
||||||
int rank = getFactionRank (player, faction);
|
int rank = getFactionRank (player, faction);
|
||||||
|
|
||||||
|
@ -360,11 +360,11 @@ int MWDialogue::Filter::getSelectStructInteger (const SelectWrapper& select) con
|
||||||
|
|
||||||
case SelectWrapper::Function_Level:
|
case SelectWrapper::Function_Level:
|
||||||
|
|
||||||
return MWWorld::Class::get (mActor).getCreatureStats (mActor).getLevel();
|
return mActor.getClass().getCreatureStats (mActor).getLevel();
|
||||||
|
|
||||||
case SelectWrapper::Function_PCReputation:
|
case SelectWrapper::Function_PCReputation:
|
||||||
|
|
||||||
return MWWorld::Class::get (player).getNpcStats (player).getReputation();
|
return player.getClass().getNpcStats (player).getReputation();
|
||||||
|
|
||||||
case SelectWrapper::Function_Weather:
|
case SelectWrapper::Function_Weather:
|
||||||
|
|
||||||
|
@ -372,15 +372,15 @@ int MWDialogue::Filter::getSelectStructInteger (const SelectWrapper& select) con
|
||||||
|
|
||||||
case SelectWrapper::Function_Reputation:
|
case SelectWrapper::Function_Reputation:
|
||||||
|
|
||||||
return MWWorld::Class::get (mActor).getNpcStats (mActor).getReputation();
|
return mActor.getClass().getNpcStats (mActor).getReputation();
|
||||||
|
|
||||||
case SelectWrapper::Function_FactionRankDiff:
|
case SelectWrapper::Function_FactionRankDiff:
|
||||||
{
|
{
|
||||||
if (MWWorld::Class::get (mActor).getNpcStats (mActor).getFactionRanks().empty())
|
if (mActor.getClass().getNpcStats (mActor).getFactionRanks().empty())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
std::pair<std::string, int> faction =
|
std::pair<std::string, int> faction =
|
||||||
*MWWorld::Class::get (mActor).getNpcStats (mActor).getFactionRanks().begin();
|
*mActor.getClass().getNpcStats (mActor).getFactionRanks().begin();
|
||||||
|
|
||||||
int rank = getFactionRank (player, faction.first);
|
int rank = getFactionRank (player, faction.first);
|
||||||
|
|
||||||
|
@ -389,25 +389,25 @@ int MWDialogue::Filter::getSelectStructInteger (const SelectWrapper& select) con
|
||||||
|
|
||||||
case SelectWrapper::Function_WerewolfKills:
|
case SelectWrapper::Function_WerewolfKills:
|
||||||
|
|
||||||
return MWWorld::Class::get (player).getNpcStats (player).getWerewolfKills();
|
return player.getClass().getNpcStats (player).getWerewolfKills();
|
||||||
|
|
||||||
case SelectWrapper::Function_RankLow:
|
case SelectWrapper::Function_RankLow:
|
||||||
case SelectWrapper::Function_RankHigh:
|
case SelectWrapper::Function_RankHigh:
|
||||||
{
|
{
|
||||||
bool low = select.getFunction()==SelectWrapper::Function_RankLow;
|
bool low = select.getFunction()==SelectWrapper::Function_RankLow;
|
||||||
|
|
||||||
if (MWWorld::Class::get (mActor).getNpcStats (mActor).getFactionRanks().empty())
|
if (mActor.getClass().getNpcStats (mActor).getFactionRanks().empty())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
std::string factionId =
|
std::string factionId =
|
||||||
MWWorld::Class::get (mActor).getNpcStats (mActor).getFactionRanks().begin()->first;
|
mActor.getClass().getNpcStats (mActor).getFactionRanks().begin()->first;
|
||||||
|
|
||||||
int value = 0;
|
int value = 0;
|
||||||
|
|
||||||
const ESM::Faction& faction =
|
const ESM::Faction& faction =
|
||||||
*MWBase::Environment::get().getWorld()->getStore().get<ESM::Faction>().find (factionId);
|
*MWBase::Environment::get().getWorld()->getStore().get<ESM::Faction>().find (factionId);
|
||||||
|
|
||||||
MWMechanics::NpcStats& playerStats = MWWorld::Class::get (player).getNpcStats (player);
|
MWMechanics::NpcStats& playerStats = player.getClass().getNpcStats (player);
|
||||||
|
|
||||||
for (std::vector<ESM::Faction::Reaction>::const_iterator iter (faction.mReactions.begin());
|
for (std::vector<ESM::Faction::Reaction>::const_iterator iter (faction.mReactions.begin());
|
||||||
iter!=faction.mReactions.end(); ++iter)
|
iter!=faction.mReactions.end(); ++iter)
|
||||||
|
@ -436,7 +436,7 @@ bool MWDialogue::Filter::getSelectStructBoolean (const SelectWrapper& select) co
|
||||||
|
|
||||||
case SelectWrapper::Function_NotId:
|
case SelectWrapper::Function_NotId:
|
||||||
|
|
||||||
return !Misc::StringUtils::ciEqual(MWWorld::Class::get (mActor).getId (mActor), select.getName());
|
return !Misc::StringUtils::ciEqual(mActor.getClass().getId (mActor), select.getName());
|
||||||
|
|
||||||
case SelectWrapper::Function_NotFaction:
|
case SelectWrapper::Function_NotFaction:
|
||||||
|
|
||||||
|
@ -456,7 +456,7 @@ bool MWDialogue::Filter::getSelectStructBoolean (const SelectWrapper& select) co
|
||||||
|
|
||||||
case SelectWrapper::Function_NotLocal:
|
case SelectWrapper::Function_NotLocal:
|
||||||
{
|
{
|
||||||
std::string scriptName = MWWorld::Class::get (mActor).getScript (mActor);
|
std::string scriptName = mActor.getClass().getScript (mActor);
|
||||||
|
|
||||||
if (scriptName.empty())
|
if (scriptName.empty())
|
||||||
// This actor has no attached script, so there is no local variable
|
// This actor has no attached script, so there is no local variable
|
||||||
|
@ -489,36 +489,36 @@ bool MWDialogue::Filter::getSelectStructBoolean (const SelectWrapper& select) co
|
||||||
|
|
||||||
case SelectWrapper::Function_SameFaction:
|
case SelectWrapper::Function_SameFaction:
|
||||||
|
|
||||||
return MWWorld::Class::get (mActor).getNpcStats (mActor).isSameFaction (
|
return mActor.getClass().getNpcStats (mActor).isSameFaction (
|
||||||
MWWorld::Class::get (player).getNpcStats (player));
|
player.getClass().getNpcStats (player));
|
||||||
|
|
||||||
case SelectWrapper::Function_PcCommonDisease:
|
case SelectWrapper::Function_PcCommonDisease:
|
||||||
|
|
||||||
return MWWorld::Class::get (player).getCreatureStats (player).hasCommonDisease();
|
return player.getClass().getCreatureStats (player).hasCommonDisease();
|
||||||
|
|
||||||
case SelectWrapper::Function_PcBlightDisease:
|
case SelectWrapper::Function_PcBlightDisease:
|
||||||
|
|
||||||
return MWWorld::Class::get (player).getCreatureStats (player).hasBlightDisease();
|
return player.getClass().getCreatureStats (player).hasBlightDisease();
|
||||||
|
|
||||||
case SelectWrapper::Function_PcCorprus:
|
case SelectWrapper::Function_PcCorprus:
|
||||||
|
|
||||||
return MWWorld::Class::get (player).getCreatureStats (player).
|
return player.getClass().getCreatureStats (player).
|
||||||
getMagicEffects().get (ESM::MagicEffect::Corprus).mMagnitude!=0;
|
getMagicEffects().get (ESM::MagicEffect::Corprus).mMagnitude!=0;
|
||||||
|
|
||||||
case SelectWrapper::Function_PcExpelled:
|
case SelectWrapper::Function_PcExpelled:
|
||||||
{
|
{
|
||||||
if (MWWorld::Class::get (mActor).getNpcStats (mActor).getFactionRanks().empty())
|
if (mActor.getClass().getNpcStats (mActor).getFactionRanks().empty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
std::string faction =
|
std::string faction =
|
||||||
MWWorld::Class::get (mActor).getNpcStats (mActor).getFactionRanks().begin()->first;
|
mActor.getClass().getNpcStats (mActor).getFactionRanks().begin()->first;
|
||||||
|
|
||||||
return player.getClass().getNpcStats(player).getExpelled(faction);
|
return player.getClass().getNpcStats(player).getExpelled(faction);
|
||||||
}
|
}
|
||||||
|
|
||||||
case SelectWrapper::Function_PcVampire:
|
case SelectWrapper::Function_PcVampire:
|
||||||
|
|
||||||
return MWWorld::Class::get (player).getCreatureStats(player).getMagicEffects().
|
return player.getClass().getCreatureStats(player).getMagicEffects().
|
||||||
get(ESM::MagicEffect::Vampirism).mMagnitude > 0;
|
get(ESM::MagicEffect::Vampirism).mMagnitude > 0;
|
||||||
|
|
||||||
case SelectWrapper::Function_TalkedToPc:
|
case SelectWrapper::Function_TalkedToPc:
|
||||||
|
@ -527,7 +527,7 @@ bool MWDialogue::Filter::getSelectStructBoolean (const SelectWrapper& select) co
|
||||||
|
|
||||||
case SelectWrapper::Function_Alarmed:
|
case SelectWrapper::Function_Alarmed:
|
||||||
|
|
||||||
return MWWorld::Class::get (mActor).getCreatureStats (mActor).isAlarmed();
|
return mActor.getClass().getCreatureStats (mActor).isAlarmed();
|
||||||
|
|
||||||
case SelectWrapper::Function_Detected:
|
case SelectWrapper::Function_Detected:
|
||||||
|
|
||||||
|
@ -535,11 +535,11 @@ bool MWDialogue::Filter::getSelectStructBoolean (const SelectWrapper& select) co
|
||||||
|
|
||||||
case SelectWrapper::Function_Attacked:
|
case SelectWrapper::Function_Attacked:
|
||||||
|
|
||||||
return MWWorld::Class::get (mActor).getCreatureStats (mActor).getAttacked();
|
return mActor.getClass().getCreatureStats (mActor).getAttacked();
|
||||||
|
|
||||||
case SelectWrapper::Function_ShouldAttack:
|
case SelectWrapper::Function_ShouldAttack:
|
||||||
|
|
||||||
return MWWorld::Class::get (mActor).getCreatureStats (mActor).isHostile();
|
return mActor.getClass().getCreatureStats (mActor).isHostile();
|
||||||
|
|
||||||
case SelectWrapper::Function_CreatureTargetted:
|
case SelectWrapper::Function_CreatureTargetted:
|
||||||
|
|
||||||
|
@ -547,7 +547,7 @@ bool MWDialogue::Filter::getSelectStructBoolean (const SelectWrapper& select) co
|
||||||
|
|
||||||
case SelectWrapper::Function_Werewolf:
|
case SelectWrapper::Function_Werewolf:
|
||||||
|
|
||||||
return MWWorld::Class::get (mActor).getNpcStats (mActor).isWerewolf();
|
return mActor.getClass().getNpcStats (mActor).isWerewolf();
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
|
@ -557,7 +557,7 @@ bool MWDialogue::Filter::getSelectStructBoolean (const SelectWrapper& select) co
|
||||||
|
|
||||||
int MWDialogue::Filter::getFactionRank (const MWWorld::Ptr& actor, const std::string& factionId) const
|
int MWDialogue::Filter::getFactionRank (const MWWorld::Ptr& actor, const std::string& factionId) const
|
||||||
{
|
{
|
||||||
MWMechanics::NpcStats& stats = MWWorld::Class::get (actor).getNpcStats (actor);
|
MWMechanics::NpcStats& stats = actor.getClass().getNpcStats (actor);
|
||||||
|
|
||||||
std::map<std::string, int>::const_iterator iter = stats.getFactionRanks().find (factionId);
|
std::map<std::string, int>::const_iterator iter = stats.getFactionRanks().find (factionId);
|
||||||
|
|
||||||
|
@ -573,13 +573,13 @@ bool MWDialogue::Filter::hasFactionRankSkillRequirements (const MWWorld::Ptr& ac
|
||||||
if (rank<0 || rank>=10)
|
if (rank<0 || rank>=10)
|
||||||
throw std::runtime_error ("rank index out of range");
|
throw std::runtime_error ("rank index out of range");
|
||||||
|
|
||||||
if (!MWWorld::Class::get (actor).getNpcStats (actor).hasSkillsForRank (factionId, rank))
|
if (!actor.getClass().getNpcStats (actor).hasSkillsForRank (factionId, rank))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const ESM::Faction& faction =
|
const ESM::Faction& faction =
|
||||||
*MWBase::Environment::get().getWorld()->getStore().get<ESM::Faction>().find (factionId);
|
*MWBase::Environment::get().getWorld()->getStore().get<ESM::Faction>().find (factionId);
|
||||||
|
|
||||||
MWMechanics::CreatureStats& stats = MWWorld::Class::get (actor).getCreatureStats (actor);
|
MWMechanics::CreatureStats& stats = actor.getClass().getCreatureStats (actor);
|
||||||
|
|
||||||
return stats.getAttribute (faction.mData.mAttribute[0]).getBase()>=faction.mData.mRankData[rank].mAttribute1 &&
|
return stats.getAttribute (faction.mData.mAttribute[0]).getBase()>=faction.mData.mRankData[rank].mAttribute1 &&
|
||||||
stats.getAttribute (faction.mData.mAttribute[1]).getBase()>=faction.mData.mRankData[rank].mAttribute2;
|
stats.getAttribute (faction.mData.mAttribute[1]).getBase()>=faction.mData.mRankData[rank].mAttribute2;
|
||||||
|
@ -591,7 +591,7 @@ bool MWDialogue::Filter::hasFactionRankReputationRequirements (const MWWorld::Pt
|
||||||
if (rank<0 || rank>=10)
|
if (rank<0 || rank>=10)
|
||||||
throw std::runtime_error ("rank index out of range");
|
throw std::runtime_error ("rank index out of range");
|
||||||
|
|
||||||
MWMechanics::NpcStats& stats = MWWorld::Class::get (actor).getNpcStats (actor);
|
MWMechanics::NpcStats& stats = actor.getClass().getNpcStats (actor);
|
||||||
|
|
||||||
const ESM::Faction& faction =
|
const ESM::Faction& faction =
|
||||||
*MWBase::Environment::get().getWorld()->getStore().get<ESM::Faction>().find (factionId);
|
*MWBase::Environment::get().getWorld()->getStore().get<ESM::Faction>().find (factionId);
|
||||||
|
|
|
@ -19,7 +19,7 @@ namespace
|
||||||
std::string getIconPath(MWWorld::Ptr ptr)
|
std::string getIconPath(MWWorld::Ptr ptr)
|
||||||
{
|
{
|
||||||
std::string path = std::string("icons\\");
|
std::string path = std::string("icons\\");
|
||||||
path += MWWorld::Class::get(ptr).getInventoryIcon(ptr);
|
path += ptr.getClass().getInventoryIcon(ptr);
|
||||||
int pos = path.rfind(".");
|
int pos = path.rfind(".");
|
||||||
path.erase(pos);
|
path.erase(pos);
|
||||||
path.append(".dds");
|
path.append(".dds");
|
||||||
|
@ -174,7 +174,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
update();
|
update();
|
||||||
|
|
||||||
std::string sound = MWWorld::Class::get(item).getUpSoundId(item);
|
std::string sound = item.getClass().getUpSoundId(item);
|
||||||
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace
|
||||||
void updatePlayerHealth()
|
void updatePlayerHealth()
|
||||||
{
|
{
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(player).getNpcStats(player);
|
MWMechanics::NpcStats& npcStats = player.getClass().getNpcStats(player);
|
||||||
npcStats.updateHealth();
|
npcStats.updateHealth();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -220,7 +220,7 @@ namespace MWGui
|
||||||
|
|
||||||
{
|
{
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
const MWMechanics::CreatureStats& stats = MWWorld::Class::get(player).getCreatureStats(player);
|
const MWMechanics::CreatureStats& stats = player.getClass().getCreatureStats(player);
|
||||||
|
|
||||||
mReviewDialog->setHealth ( stats.getHealth() );
|
mReviewDialog->setHealth ( stats.getHealth() );
|
||||||
mReviewDialog->setMagicka( stats.getMagicka() );
|
mReviewDialog->setMagicka( stats.getMagicka() );
|
||||||
|
|
|
@ -61,7 +61,7 @@ void CompanionWindow::onItemSelected(int index)
|
||||||
if (count > 1 && !shift)
|
if (count > 1 && !shift)
|
||||||
{
|
{
|
||||||
CountDialog* dialog = MWBase::Environment::get().getWindowManager()->getCountDialog();
|
CountDialog* dialog = MWBase::Environment::get().getWindowManager()->getCountDialog();
|
||||||
dialog->open(MWWorld::Class::get(object).getName(object), "#{sTake}", count);
|
dialog->open(object.getClass().getName(object), "#{sTake}", count);
|
||||||
dialog->eventOkClicked.clear();
|
dialog->eventOkClicked.clear();
|
||||||
dialog->eventOkClicked += MyGUI::newDelegate(this, &CompanionWindow::dragItem);
|
dialog->eventOkClicked += MyGUI::newDelegate(this, &CompanionWindow::dragItem);
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ void CompanionWindow::open(const MWWorld::Ptr& npc)
|
||||||
mSortModel = new SortFilterItemModel(mModel);
|
mSortModel = new SortFilterItemModel(mModel);
|
||||||
mItemView->setModel(mSortModel);
|
mItemView->setModel(mSortModel);
|
||||||
|
|
||||||
setTitle(MWWorld::Class::get(npc).getName(npc));
|
setTitle(npc.getClass().getName(npc));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompanionWindow::onFrame()
|
void CompanionWindow::onFrame()
|
||||||
|
@ -104,22 +104,22 @@ void CompanionWindow::updateEncumbranceBar()
|
||||||
{
|
{
|
||||||
if (mPtr.isEmpty())
|
if (mPtr.isEmpty())
|
||||||
return;
|
return;
|
||||||
float capacity = MWWorld::Class::get(mPtr).getCapacity(mPtr);
|
float capacity = mPtr.getClass().getCapacity(mPtr);
|
||||||
float encumbrance = MWWorld::Class::get(mPtr).getEncumbrance(mPtr);
|
float encumbrance = mPtr.getClass().getEncumbrance(mPtr);
|
||||||
mEncumbranceBar->setValue(encumbrance, capacity);
|
mEncumbranceBar->setValue(encumbrance, capacity);
|
||||||
|
|
||||||
if (mPtr.getTypeName() != typeid(ESM::NPC).name())
|
if (mPtr.getTypeName() != typeid(ESM::NPC).name())
|
||||||
mProfitLabel->setCaption("");
|
mProfitLabel->setCaption("");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MWMechanics::NpcStats& stats = MWWorld::Class::get(mPtr).getNpcStats(mPtr);
|
MWMechanics::NpcStats& stats = mPtr.getClass().getNpcStats(mPtr);
|
||||||
mProfitLabel->setCaptionWithReplacing("#{sProfitValue} " + boost::lexical_cast<std::string>(stats.getProfit()));
|
mProfitLabel->setCaptionWithReplacing("#{sProfitValue} " + boost::lexical_cast<std::string>(stats.getProfit()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CompanionWindow::onCloseButtonClicked(MyGUI::Widget* _sender)
|
void CompanionWindow::onCloseButtonClicked(MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
if (mPtr.getTypeName() == typeid(ESM::NPC).name() && MWWorld::Class::get(mPtr).getNpcStats(mPtr).getProfit() < 0)
|
if (mPtr.getTypeName() == typeid(ESM::NPC).name() && mPtr.getClass().getNpcStats(mPtr).getProfit() < 0)
|
||||||
{
|
{
|
||||||
std::vector<std::string> buttons;
|
std::vector<std::string> buttons;
|
||||||
buttons.push_back("#{sCompanionWarningButtonOne}");
|
buttons.push_back("#{sCompanionWarningButtonOne}");
|
||||||
|
@ -135,8 +135,8 @@ void CompanionWindow::onMessageBoxButtonClicked(int button)
|
||||||
{
|
{
|
||||||
if (button == 0)
|
if (button == 0)
|
||||||
{
|
{
|
||||||
mPtr.getRefData().getLocals().setVarByInt(MWWorld::Class::get(mPtr).getScript(mPtr),
|
mPtr.getRefData().getLocals().setVarByInt(mPtr.getClass().getScript(mPtr),
|
||||||
"minimumProfit", MWWorld::Class::get(mPtr).getNpcStats(mPtr).getProfit());
|
"minimumProfit", mPtr.getClass().getNpcStats(mPtr).getProfit());
|
||||||
|
|
||||||
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Companion);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Companion);
|
||||||
MWBase::Environment::get().getDialogueManager()->startDialogue (mPtr);
|
MWBase::Environment::get().getDialogueManager()->startDialogue (mPtr);
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace MWGui
|
||||||
mIsOnDragAndDrop = true;
|
mIsOnDragAndDrop = true;
|
||||||
mDragAndDropWidget->setVisible(true);
|
mDragAndDropWidget->setVisible(true);
|
||||||
|
|
||||||
std::string sound = MWWorld::Class::get(mItem.mBase).getUpSoundId(mItem.mBase);
|
std::string sound = mItem.mBase.getClass().getUpSoundId(mItem.mBase);
|
||||||
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
||||||
|
|
||||||
if (mSourceSortModel)
|
if (mSourceSortModel)
|
||||||
|
@ -47,7 +47,7 @@ namespace MWGui
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string path = std::string("icons\\");
|
std::string path = std::string("icons\\");
|
||||||
path += MWWorld::Class::get(mItem.mBase).getInventoryIcon(mItem.mBase);
|
path += mItem.mBase.getClass().getInventoryIcon(mItem.mBase);
|
||||||
MyGUI::ImageBox* baseWidget = mDragAndDropWidget->createWidget<MyGUI::ImageBox>
|
MyGUI::ImageBox* baseWidget = mDragAndDropWidget->createWidget<MyGUI::ImageBox>
|
||||||
("ImageBox", MyGUI::IntCoord(0, 0, 42, 42), MyGUI::Align::Default);
|
("ImageBox", MyGUI::IntCoord(0, 0, 42, 42), MyGUI::Align::Default);
|
||||||
mDraggedWidget = baseWidget;
|
mDraggedWidget = baseWidget;
|
||||||
|
@ -76,7 +76,7 @@ namespace MWGui
|
||||||
|
|
||||||
void DragAndDrop::drop(ItemModel *targetModel, ItemView *targetView)
|
void DragAndDrop::drop(ItemModel *targetModel, ItemView *targetView)
|
||||||
{
|
{
|
||||||
std::string sound = MWWorld::Class::get(mItem.mBase).getDownSoundId(mItem.mBase);
|
std::string sound = mItem.mBase.getClass().getDownSoundId(mItem.mBase);
|
||||||
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
||||||
|
|
||||||
mDragAndDropWidget->setVisible(false);
|
mDragAndDropWidget->setVisible(false);
|
||||||
|
@ -155,7 +155,7 @@ namespace MWGui
|
||||||
if (count > 1 && !shift)
|
if (count > 1 && !shift)
|
||||||
{
|
{
|
||||||
CountDialog* dialog = MWBase::Environment::get().getWindowManager()->getCountDialog();
|
CountDialog* dialog = MWBase::Environment::get().getWindowManager()->getCountDialog();
|
||||||
dialog->open(MWWorld::Class::get(object).getName(object), "#{sTake}", count);
|
dialog->open(object.getClass().getName(object), "#{sTake}", count);
|
||||||
dialog->eventOkClicked.clear();
|
dialog->eventOkClicked.clear();
|
||||||
dialog->eventOkClicked += MyGUI::newDelegate(this, &ContainerWindow::dragItem);
|
dialog->eventOkClicked += MyGUI::newDelegate(this, &ContainerWindow::dragItem);
|
||||||
}
|
}
|
||||||
|
@ -177,8 +177,8 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
// check that we don't exceed container capacity
|
// check that we don't exceed container capacity
|
||||||
MWWorld::Ptr item = mDragAndDrop->mItem.mBase;
|
MWWorld::Ptr item = mDragAndDrop->mItem.mBase;
|
||||||
float weight = MWWorld::Class::get(item).getWeight(item) * mDragAndDrop->mDraggedCount;
|
float weight = item.getClass().getWeight(item) * mDragAndDrop->mDraggedCount;
|
||||||
if (MWWorld::Class::get(mPtr).getCapacity(mPtr) < MWWorld::Class::get(mPtr).getEncumbrance(mPtr) + weight)
|
if (mPtr.getClass().getCapacity(mPtr) < mPtr.getClass().getEncumbrance(mPtr) + weight)
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sContentsMessage3}");
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sContentsMessage3}");
|
||||||
return;
|
return;
|
||||||
|
@ -227,7 +227,7 @@ namespace MWGui
|
||||||
|
|
||||||
// Careful here. setTitle may cause size updates, causing itemview redraw, so make sure to do it last
|
// Careful here. setTitle may cause size updates, causing itemview redraw, so make sure to do it last
|
||||||
// or we end up using a possibly invalid model.
|
// or we end up using a possibly invalid model.
|
||||||
setTitle(MWWorld::Class::get(container).getName(container));
|
setTitle(container.getClass().getName(container));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContainerWindow::onKeyPressed(MyGUI::Widget *_sender, MyGUI::KeyCode _key, MyGUI::Char _char)
|
void ContainerWindow::onKeyPressed(MyGUI::Widget *_sender, MyGUI::KeyCode _key, MyGUI::Char _char)
|
||||||
|
@ -284,7 +284,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
// play the sound of the first object
|
// play the sound of the first object
|
||||||
MWWorld::Ptr item = mModel->getItem(i).mBase;
|
MWWorld::Ptr item = mModel->getItem(i).mBase;
|
||||||
std::string sound = MWWorld::Class::get(item).getUpSoundId(item);
|
std::string sound = item.getClass().getUpSoundId(item);
|
||||||
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -306,7 +306,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
onTakeAllButtonClicked(mTakeButton);
|
onTakeAllButtonClicked(mTakeButton);
|
||||||
|
|
||||||
if (MWWorld::Class::get(mPtr).isPersistent(mPtr))
|
if (mPtr.getClass().isPersistent(mPtr))
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sDisposeCorpseFail}");
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sDisposeCorpseFail}");
|
||||||
else
|
else
|
||||||
MWBase::Environment::get().getWorld()->deleteObject(mPtr);
|
MWBase::Environment::get().getWorld()->deleteObject(mPtr);
|
||||||
|
|
|
@ -85,7 +85,7 @@ void ContainerItemModel::removeItem (const ItemStack& item, size_t count)
|
||||||
|
|
||||||
for (std::vector<MWWorld::Ptr>::iterator source = mItemSources.begin(); source != mItemSources.end(); ++source)
|
for (std::vector<MWWorld::Ptr>::iterator source = mItemSources.begin(); source != mItemSources.end(); ++source)
|
||||||
{
|
{
|
||||||
MWWorld::ContainerStore& store = MWWorld::Class::get(*source).getContainerStore(*source);
|
MWWorld::ContainerStore& store = source->getClass().getContainerStore(*source);
|
||||||
|
|
||||||
for (MWWorld::ContainerStoreIterator it = store.begin(); it != store.end(); ++it)
|
for (MWWorld::ContainerStoreIterator it = store.begin(); it != store.end(); ++it)
|
||||||
{
|
{
|
||||||
|
@ -120,7 +120,7 @@ void ContainerItemModel::update()
|
||||||
mItems.clear();
|
mItems.clear();
|
||||||
for (std::vector<MWWorld::Ptr>::iterator source = mItemSources.begin(); source != mItemSources.end(); ++source)
|
for (std::vector<MWWorld::Ptr>::iterator source = mItemSources.begin(); source != mItemSources.end(); ++source)
|
||||||
{
|
{
|
||||||
MWWorld::ContainerStore& store = MWWorld::Class::get(*source).getContainerStore(*source);
|
MWWorld::ContainerStore& store = source->getClass().getContainerStore(*source);
|
||||||
|
|
||||||
for (MWWorld::ContainerStoreIterator it = store.begin(); it != store.end(); ++it)
|
for (MWWorld::ContainerStoreIterator it = store.begin(); it != store.end(); ++it)
|
||||||
{
|
{
|
||||||
|
|
|
@ -386,8 +386,8 @@ namespace MWGui
|
||||||
mTopicLinks.clear();
|
mTopicLinks.clear();
|
||||||
mKeywordSearch.clear();
|
mKeywordSearch.clear();
|
||||||
|
|
||||||
bool isCompanion = !MWWorld::Class::get(mPtr).getScript(mPtr).empty()
|
bool isCompanion = !mPtr.getClass().getScript(mPtr).empty()
|
||||||
&& mPtr.getRefData().getLocals().getIntVar(MWWorld::Class::get(mPtr).getScript(mPtr), "companion");
|
&& mPtr.getRefData().getLocals().getIntVar(mPtr.getClass().getScript(mPtr), "companion");
|
||||||
|
|
||||||
bool anyService = mServices > 0 || isCompanion || mPtr.getTypeName() == typeid(ESM::NPC).name();
|
bool anyService = mServices > 0 || isCompanion || mPtr.getTypeName() == typeid(ESM::NPC).name();
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ namespace MWGui
|
||||||
|
|
||||||
MyGUI::ImageBox* image = mSoulBox->createWidget<MyGUI::ImageBox>("ImageBox", MyGUI::IntCoord(0, 0, 32, 32), MyGUI::Align::Default);
|
MyGUI::ImageBox* image = mSoulBox->createWidget<MyGUI::ImageBox>("ImageBox", MyGUI::IntCoord(0, 0, 32, 32), MyGUI::Align::Default);
|
||||||
std::string path = std::string("icons\\");
|
std::string path = std::string("icons\\");
|
||||||
path += MWWorld::Class::get(soulgem).getInventoryIcon(soulgem);
|
path += soulgem.getClass().getInventoryIcon(soulgem);
|
||||||
int pos = path.rfind(".");
|
int pos = path.rfind(".");
|
||||||
path.erase(pos);
|
path.erase(pos);
|
||||||
path.append(".dds");
|
path.append(".dds");
|
||||||
|
@ -164,7 +164,7 @@ namespace MWGui
|
||||||
|
|
||||||
MyGUI::ImageBox* image = mItemBox->createWidget<MyGUI::ImageBox>("ImageBox", MyGUI::IntCoord(0, 0, 32, 32), MyGUI::Align::Default);
|
MyGUI::ImageBox* image = mItemBox->createWidget<MyGUI::ImageBox>("ImageBox", MyGUI::IntCoord(0, 0, 32, 32), MyGUI::Align::Default);
|
||||||
std::string path = std::string("icons\\");
|
std::string path = std::string("icons\\");
|
||||||
path += MWWorld::Class::get(item).getInventoryIcon(item);
|
path += item.getClass().getInventoryIcon(item);
|
||||||
int pos = path.rfind(".");
|
int pos = path.rfind(".");
|
||||||
path.erase(pos);
|
path.erase(pos);
|
||||||
path.append(".dds");
|
path.append(".dds");
|
||||||
|
@ -207,7 +207,7 @@ namespace MWGui
|
||||||
|
|
||||||
MyGUI::ImageBox* image = mSoulBox->createWidget<MyGUI::ImageBox>("ImageBox", MyGUI::IntCoord(0, 0, 32, 32), MyGUI::Align::Default);
|
MyGUI::ImageBox* image = mSoulBox->createWidget<MyGUI::ImageBox>("ImageBox", MyGUI::IntCoord(0, 0, 32, 32), MyGUI::Align::Default);
|
||||||
std::string path = std::string("icons\\");
|
std::string path = std::string("icons\\");
|
||||||
path += MWWorld::Class::get(item).getInventoryIcon(item);
|
path += item.getClass().getInventoryIcon(item);
|
||||||
int pos = path.rfind(".");
|
int pos = path.rfind(".");
|
||||||
path.erase(pos);
|
path.erase(pos);
|
||||||
path.append(".dds");
|
path.append(".dds");
|
||||||
|
|
|
@ -348,7 +348,7 @@ namespace MWGui
|
||||||
void HUD::onWeaponClicked(MyGUI::Widget* _sender)
|
void HUD::onWeaponClicked(MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
const MWWorld::Ptr& player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
const MWWorld::Ptr& player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
if (MWWorld::Class::get(player).getNpcStats(player).isWerewolf())
|
if (player.getClass().getNpcStats(player).isWerewolf())
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sWerewolfRefusal}");
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sWerewolfRefusal}");
|
||||||
return;
|
return;
|
||||||
|
@ -360,7 +360,7 @@ namespace MWGui
|
||||||
void HUD::onMagicClicked(MyGUI::Widget* _sender)
|
void HUD::onMagicClicked(MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
const MWWorld::Ptr& player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
const MWWorld::Ptr& player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
if (MWWorld::Class::get(player).getNpcStats(player).isWerewolf())
|
if (player.getClass().getNpcStats(player).isWerewolf())
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sWerewolfRefusal}");
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sWerewolfRefusal}");
|
||||||
return;
|
return;
|
||||||
|
@ -443,7 +443,7 @@ namespace MWGui
|
||||||
|
|
||||||
void HUD::setSelectedEnchantItem(const MWWorld::Ptr& item, int chargePercent)
|
void HUD::setSelectedEnchantItem(const MWWorld::Ptr& item, int chargePercent)
|
||||||
{
|
{
|
||||||
std::string itemName = MWWorld::Class::get(item).getName(item);
|
std::string itemName = item.getClass().getName(item);
|
||||||
if (itemName != mSpellName && mSpellVisible)
|
if (itemName != mSpellName && mSpellVisible)
|
||||||
{
|
{
|
||||||
mWeaponSpellTimer = 5.0f;
|
mWeaponSpellTimer = 5.0f;
|
||||||
|
@ -466,7 +466,7 @@ namespace MWGui
|
||||||
, MyGUI::Align::Stretch);
|
, MyGUI::Align::Stretch);
|
||||||
|
|
||||||
std::string path = std::string("icons\\");
|
std::string path = std::string("icons\\");
|
||||||
path+=MWWorld::Class::get(item).getInventoryIcon(item);
|
path+=item.getClass().getInventoryIcon(item);
|
||||||
Widgets::fixTexturePath(path);
|
Widgets::fixTexturePath(path);
|
||||||
itemBox->setImageTexture(path);
|
itemBox->setImageTexture(path);
|
||||||
itemBox->setNeedMouseFocus(false);
|
itemBox->setNeedMouseFocus(false);
|
||||||
|
@ -474,7 +474,7 @@ namespace MWGui
|
||||||
|
|
||||||
void HUD::setSelectedWeapon(const MWWorld::Ptr& item, int durabilityPercent)
|
void HUD::setSelectedWeapon(const MWWorld::Ptr& item, int durabilityPercent)
|
||||||
{
|
{
|
||||||
std::string itemName = MWWorld::Class::get(item).getName(item);
|
std::string itemName = item.getClass().getName(item);
|
||||||
if (itemName != mWeaponName && mWeaponVisible)
|
if (itemName != mWeaponName && mWeaponVisible)
|
||||||
{
|
{
|
||||||
mWeaponSpellTimer = 5.0f;
|
mWeaponSpellTimer = 5.0f;
|
||||||
|
@ -493,10 +493,10 @@ namespace MWGui
|
||||||
MyGUI::Gui::getInstance().destroyWidget(mWeapImage->getChildAt(0));
|
MyGUI::Gui::getInstance().destroyWidget(mWeapImage->getChildAt(0));
|
||||||
|
|
||||||
std::string path = std::string("icons\\");
|
std::string path = std::string("icons\\");
|
||||||
path+=MWWorld::Class::get(item).getInventoryIcon(item);
|
path+=item.getClass().getInventoryIcon(item);
|
||||||
Widgets::fixTexturePath(path);
|
Widgets::fixTexturePath(path);
|
||||||
|
|
||||||
if (MWWorld::Class::get(item).getEnchantment(item) != "")
|
if (item.getClass().getEnchantment(item) != "")
|
||||||
{
|
{
|
||||||
mWeapImage->setImageTexture("textures\\menu_icon_magic_mini.dds");
|
mWeapImage->setImageTexture("textures\\menu_icon_magic_mini.dds");
|
||||||
MyGUI::ImageBox* itemBox = mWeapImage->createWidgetReal<MyGUI::ImageBox>("ImageBox", MyGUI::FloatCoord(0,0,1,1)
|
MyGUI::ImageBox* itemBox = mWeapImage->createWidgetReal<MyGUI::ImageBox>("ImageBox", MyGUI::FloatCoord(0,0,1,1)
|
||||||
|
@ -545,7 +545,7 @@ namespace MWGui
|
||||||
|
|
||||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
MWWorld::Ptr player = world->getPlayerPtr();
|
MWWorld::Ptr player = world->getPlayerPtr();
|
||||||
if (MWWorld::Class::get(player).getNpcStats(player).isWerewolf())
|
if (player.getClass().getNpcStats(player).isWerewolf())
|
||||||
mWeapImage->setImageTexture("icons\\k\\tx_werewolf_hand.dds");
|
mWeapImage->setImageTexture("icons\\k\\tx_werewolf_hand.dds");
|
||||||
else
|
else
|
||||||
mWeapImage->setImageTexture("icons\\k\\stealth_handtohand.dds");
|
mWeapImage->setImageTexture("icons\\k\\stealth_handtohand.dds");
|
||||||
|
@ -636,7 +636,7 @@ namespace MWGui
|
||||||
|
|
||||||
void HUD::updateEnemyHealthBar()
|
void HUD::updateEnemyHealthBar()
|
||||||
{
|
{
|
||||||
MWMechanics::CreatureStats& stats = MWWorld::Class::get(mEnemy).getCreatureStats(mEnemy);
|
MWMechanics::CreatureStats& stats = mEnemy.getClass().getCreatureStats(mEnemy);
|
||||||
mEnemyHealth->setProgressRange(100);
|
mEnemyHealth->setProgressRange(100);
|
||||||
// Health is usually cast to int before displaying. Actors die whenever they are < 1 health.
|
// Health is usually cast to int before displaying. Actors die whenever they are < 1 health.
|
||||||
// Therefore any value < 1 should show as an empty health bar. We do the same in statswindow :)
|
// Therefore any value < 1 should show as an empty health bar. We do the same in statswindow :)
|
||||||
|
|
|
@ -50,7 +50,7 @@ MWWorld::Ptr InventoryItemModel::copyItem (const ItemStack& item, size_t count,
|
||||||
|
|
||||||
void InventoryItemModel::removeItem (const ItemStack& item, size_t count)
|
void InventoryItemModel::removeItem (const ItemStack& item, size_t count)
|
||||||
{
|
{
|
||||||
MWWorld::ContainerStore& store = MWWorld::Class::get(mActor).getContainerStore(mActor);
|
MWWorld::ContainerStore& store = mActor.getClass().getContainerStore(mActor);
|
||||||
int removed = store.remove(item.mBase, count, mActor);
|
int removed = store.remove(item.mBase, count, mActor);
|
||||||
|
|
||||||
if (removed == 0)
|
if (removed == 0)
|
||||||
|
@ -77,7 +77,7 @@ MWWorld::Ptr InventoryItemModel::moveItem(const ItemStack &item, size_t count, I
|
||||||
|
|
||||||
void InventoryItemModel::update()
|
void InventoryItemModel::update()
|
||||||
{
|
{
|
||||||
MWWorld::ContainerStore& store = MWWorld::Class::get(mActor).getContainerStore(mActor);
|
MWWorld::ContainerStore& store = mActor.getClass().getContainerStore(mActor);
|
||||||
|
|
||||||
mItems.clear();
|
mItems.clear();
|
||||||
|
|
||||||
|
|
|
@ -162,7 +162,7 @@ namespace MWGui
|
||||||
}
|
}
|
||||||
|
|
||||||
const ItemStack& item = mTradeModel->getItem(index);
|
const ItemStack& item = mTradeModel->getItem(index);
|
||||||
std::string sound = MWWorld::Class::get(item.mBase).getDownSoundId(item.mBase);
|
std::string sound = item.mBase.getClass().getDownSoundId(item.mBase);
|
||||||
|
|
||||||
MWWorld::Ptr object = item.mBase;
|
MWWorld::Ptr object = item.mBase;
|
||||||
int count = item.mCount;
|
int count = item.mCount;
|
||||||
|
@ -184,7 +184,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
// check if merchant accepts item
|
// check if merchant accepts item
|
||||||
int services = MWBase::Environment::get().getWindowManager()->getTradeWindow()->getMerchantServices();
|
int services = MWBase::Environment::get().getWindowManager()->getTradeWindow()->getMerchantServices();
|
||||||
if (!MWWorld::Class::get(object).canSell(object, services))
|
if (!object.getClass().canSell(object, services))
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
||||||
MWBase::Environment::get().getWindowManager()->
|
MWBase::Environment::get().getWindowManager()->
|
||||||
|
@ -197,7 +197,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
CountDialog* dialog = MWBase::Environment::get().getWindowManager()->getCountDialog();
|
CountDialog* dialog = MWBase::Environment::get().getWindowManager()->getCountDialog();
|
||||||
std::string message = mTrading ? "#{sQuanityMenuMessage01}" : "#{sTake}";
|
std::string message = mTrading ? "#{sQuanityMenuMessage01}" : "#{sTake}";
|
||||||
dialog->open(MWWorld::Class::get(object).getName(object), message, count);
|
dialog->open(object.getClass().getName(object), message, count);
|
||||||
dialog->eventOkClicked.clear();
|
dialog->eventOkClicked.clear();
|
||||||
if (mTrading)
|
if (mTrading)
|
||||||
dialog->eventOkClicked += MyGUI::newDelegate(this, &InventoryWindow::sellItem);
|
dialog->eventOkClicked += MyGUI::newDelegate(this, &InventoryWindow::sellItem);
|
||||||
|
@ -223,7 +223,7 @@ namespace MWGui
|
||||||
const ItemStack& item = mTradeModel->getItem(mSelectedItem);
|
const ItemStack& item = mTradeModel->getItem(mSelectedItem);
|
||||||
if (item.mType == ItemStack::Type_Equipped)
|
if (item.mType == ItemStack::Type_Equipped)
|
||||||
{
|
{
|
||||||
MWWorld::InventoryStore& invStore = MWWorld::Class::get(mPtr).getInventoryStore(mPtr);
|
MWWorld::InventoryStore& invStore = mPtr.getClass().getInventoryStore(mPtr);
|
||||||
MWWorld::Ptr newStack = *invStore.unequipItem(item.mBase, mPtr);
|
MWWorld::Ptr newStack = *invStore.unequipItem(item.mBase, mPtr);
|
||||||
|
|
||||||
// The unequipped item was re-stacked. We have to update the index
|
// The unequipped item was re-stacked. We have to update the index
|
||||||
|
@ -259,7 +259,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
ensureSelectedItemUnequipped();
|
ensureSelectedItemUnequipped();
|
||||||
const ItemStack& item = mTradeModel->getItem(mSelectedItem);
|
const ItemStack& item = mTradeModel->getItem(mSelectedItem);
|
||||||
std::string sound = MWWorld::Class::get(item.mBase).getDownSoundId(item.mBase);
|
std::string sound = item.mBase.getClass().getDownSoundId(item.mBase);
|
||||||
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
||||||
|
|
||||||
if (item.mType == ItemStack::Type_Barter)
|
if (item.mType == ItemStack::Type_Barter)
|
||||||
|
@ -382,7 +382,7 @@ namespace MWGui
|
||||||
|
|
||||||
if (script.empty() || ptr.getRefData().getLocals().getIntVar(script, "pcskipequip") == 0)
|
if (script.empty() || ptr.getRefData().getLocals().getIntVar(script, "pcskipequip") == 0)
|
||||||
{
|
{
|
||||||
boost::shared_ptr<MWWorld::Action> action = MWWorld::Class::get(ptr).use(ptr);
|
boost::shared_ptr<MWWorld::Action> action = ptr.getClass().use(ptr);
|
||||||
|
|
||||||
action->execute (MWBase::Environment::get().getWorld()->getPlayerPtr());
|
action->execute (MWBase::Environment::get().getWorld()->getPlayerPtr());
|
||||||
|
|
||||||
|
@ -447,7 +447,7 @@ namespace MWGui
|
||||||
if (slot == -1)
|
if (slot == -1)
|
||||||
return MWWorld::Ptr();
|
return MWWorld::Ptr();
|
||||||
|
|
||||||
MWWorld::InventoryStore& invStore = MWWorld::Class::get(mPtr).getInventoryStore(mPtr);
|
MWWorld::InventoryStore& invStore = mPtr.getClass().getInventoryStore(mPtr);
|
||||||
if(invStore.getSlot(slot) != invStore.end())
|
if(invStore.getSlot(slot) != invStore.end())
|
||||||
{
|
{
|
||||||
MWWorld::Ptr item = *invStore.getSlot(slot);
|
MWWorld::Ptr item = *invStore.getSlot(slot);
|
||||||
|
@ -466,8 +466,8 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
|
|
||||||
float capacity = MWWorld::Class::get(player).getCapacity(player);
|
float capacity = player.getClass().getCapacity(player);
|
||||||
float encumbrance = MWWorld::Class::get(player).getEncumbrance(player);
|
float encumbrance = player.getClass().getEncumbrance(player);
|
||||||
mEncumbranceBar->setValue(encumbrance, capacity);
|
mEncumbranceBar->setValue(encumbrance, capacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -498,9 +498,9 @@ namespace MWGui
|
||||||
mAvatarImage->setImageTile(MyGUI::IntSize(std::min(512, size.width), std::min(1024, size.height)));
|
mAvatarImage->setImageTile(MyGUI::IntSize(std::min(512, size.width), std::min(1024, size.height)));
|
||||||
|
|
||||||
mArmorRating->setCaptionWithReplacing ("#{sArmor}: "
|
mArmorRating->setCaptionWithReplacing ("#{sArmor}: "
|
||||||
+ boost::lexical_cast<std::string>(static_cast<int>(MWWorld::Class::get(mPtr).getArmorRating(mPtr))));
|
+ boost::lexical_cast<std::string>(static_cast<int>(mPtr.getClass().getArmorRating(mPtr))));
|
||||||
if (mArmorRating->getTextSize().width > mArmorRating->getSize().width)
|
if (mArmorRating->getTextSize().width > mArmorRating->getSize().width)
|
||||||
mArmorRating->setCaptionWithReplacing (boost::lexical_cast<std::string>(static_cast<int>(MWWorld::Class::get(mPtr).getArmorRating(mPtr))));
|
mArmorRating->setCaptionWithReplacing (boost::lexical_cast<std::string>(static_cast<int>(mPtr.getClass().getArmorRating(mPtr))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -534,7 +534,7 @@ namespace MWGui
|
||||||
&& (type != typeid(ESM::Potion).name()))
|
&& (type != typeid(ESM::Potion).name()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (MWWorld::Class::get(object).getName(object) == "") // objects without name presented to user can never be picked up
|
if (object.getClass().getName(object) == "") // objects without name presented to user can never be picked up
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int count = object.getRefData().getCount();
|
int count = object.getRefData().getCount();
|
||||||
|
|
|
@ -13,7 +13,7 @@ namespace MWGui
|
||||||
, mType(Type_Normal)
|
, mType(Type_Normal)
|
||||||
, mBase(base)
|
, mBase(base)
|
||||||
{
|
{
|
||||||
if (MWWorld::Class::get(base).getEnchantment(base) != "")
|
if (base.getClass().getEnchantment(base) != "")
|
||||||
mFlags |= Flag_Enchanted;
|
mFlags |= Flag_Enchanted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ void ItemView::update()
|
||||||
|
|
||||||
/// \todo performance improvement: don't create/destroy all the widgets everytime the container window changes size, only reposition them
|
/// \todo performance improvement: don't create/destroy all the widgets everytime the container window changes size, only reposition them
|
||||||
std::string path = std::string("icons\\");
|
std::string path = std::string("icons\\");
|
||||||
path += MWWorld::Class::get(item.mBase).getInventoryIcon(item.mBase);
|
path += item.mBase.getClass().getInventoryIcon(item.mBase);
|
||||||
|
|
||||||
// background widget (for the "equipped" frame and magic item background image)
|
// background widget (for the "equipped" frame and magic item background image)
|
||||||
bool isMagic = (item.mFlags & ItemStack::Flag_Enchanted);
|
bool isMagic = (item.mFlags & ItemStack::Flag_Enchanted);
|
||||||
|
|
|
@ -61,8 +61,8 @@ namespace MWGui
|
||||||
void LevelupDialog::setAttributeValues()
|
void LevelupDialog::setAttributeValues()
|
||||||
{
|
{
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
||||||
MWMechanics::CreatureStats& creatureStats = MWWorld::Class::get(player).getCreatureStats (player);
|
MWMechanics::CreatureStats& creatureStats = player.getClass().getCreatureStats (player);
|
||||||
MWMechanics::NpcStats& pcStats = MWWorld::Class::get(player).getNpcStats (player);
|
MWMechanics::NpcStats& pcStats = player.getClass().getNpcStats (player);
|
||||||
|
|
||||||
for (int i=0; i<8; ++i)
|
for (int i=0; i<8; ++i)
|
||||||
{
|
{
|
||||||
|
@ -117,8 +117,8 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
MWWorld::Ptr player = world->getPlayerPtr();
|
MWWorld::Ptr player = world->getPlayerPtr();
|
||||||
MWMechanics::CreatureStats& creatureStats = MWWorld::Class::get(player).getCreatureStats (player);
|
MWMechanics::CreatureStats& creatureStats = player.getClass().getCreatureStats (player);
|
||||||
MWMechanics::NpcStats& pcStats = MWWorld::Class::get(player).getNpcStats (player);
|
MWMechanics::NpcStats& pcStats = player.getClass().getNpcStats (player);
|
||||||
|
|
||||||
mSpentAttributes.clear();
|
mSpentAttributes.clear();
|
||||||
resetCoins();
|
resetCoins();
|
||||||
|
@ -172,7 +172,7 @@ namespace MWGui
|
||||||
void LevelupDialog::onOkButtonClicked (MyGUI::Widget* sender)
|
void LevelupDialog::onOkButtonClicked (MyGUI::Widget* sender)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
||||||
MWMechanics::NpcStats& pcStats = MWWorld::Class::get(player).getNpcStats (player);
|
MWMechanics::NpcStats& pcStats = player.getClass().getNpcStats (player);
|
||||||
|
|
||||||
if (mSpentAttributes.size() < 3)
|
if (mSpentAttributes.size() < 3)
|
||||||
MWBase::Environment::get().getWindowManager ()->messageBox("#{sNotifyMessage36}");
|
MWBase::Environment::get().getWindowManager ()->messageBox("#{sNotifyMessage36}");
|
||||||
|
|
|
@ -39,19 +39,19 @@ void MerchantRepair::startRepair(const MWWorld::Ptr &actor)
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
int playerGold = player.getClass().getContainerStore(player).count(MWWorld::ContainerStore::sGoldId);
|
int playerGold = player.getClass().getContainerStore(player).count(MWWorld::ContainerStore::sGoldId);
|
||||||
|
|
||||||
MWWorld::ContainerStore& store = MWWorld::Class::get(player).getContainerStore(player);
|
MWWorld::ContainerStore& store = player.getClass().getContainerStore(player);
|
||||||
int categories = MWWorld::ContainerStore::Type_Weapon | MWWorld::ContainerStore::Type_Armor;
|
int categories = MWWorld::ContainerStore::Type_Weapon | MWWorld::ContainerStore::Type_Armor;
|
||||||
for (MWWorld::ContainerStoreIterator iter (store.begin(categories));
|
for (MWWorld::ContainerStoreIterator iter (store.begin(categories));
|
||||||
iter!=store.end(); ++iter)
|
iter!=store.end(); ++iter)
|
||||||
{
|
{
|
||||||
if (MWWorld::Class::get(*iter).hasItemHealth(*iter))
|
if (iter->getClass().hasItemHealth(*iter))
|
||||||
{
|
{
|
||||||
int maxDurability = MWWorld::Class::get(*iter).getItemMaxHealth(*iter);
|
int maxDurability = iter->getClass().getItemMaxHealth(*iter);
|
||||||
int durability = (iter->getCellRef().mCharge == -1) ? maxDurability : iter->getCellRef().mCharge;
|
int durability = (iter->getCellRef().mCharge == -1) ? maxDurability : iter->getCellRef().mCharge;
|
||||||
if (maxDurability == durability)
|
if (maxDurability == durability)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int basePrice = MWWorld::Class::get(*iter).getValue(*iter);
|
int basePrice = iter->getClass().getValue(*iter);
|
||||||
float fRepairMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
|
float fRepairMult = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
|
||||||
.find("fRepairMult")->getFloat();
|
.find("fRepairMult")->getFloat();
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ void MerchantRepair::startRepair(const MWWorld::Ptr &actor)
|
||||||
int price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mActor, x, true);
|
int price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mActor, x, true);
|
||||||
|
|
||||||
|
|
||||||
std::string name = MWWorld::Class::get(*iter).getName(*iter)
|
std::string name = iter->getClass().getName(*iter)
|
||||||
+ " - " + boost::lexical_cast<std::string>(price)
|
+ " - " + boost::lexical_cast<std::string>(price)
|
||||||
+ MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
|
+ MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
|
||||||
.find("sgp")->getString();;
|
.find("sgp")->getString();;
|
||||||
|
@ -114,7 +114,7 @@ void MerchantRepair::onRepairButtonClick(MyGUI::Widget *sender)
|
||||||
{
|
{
|
||||||
// repair
|
// repair
|
||||||
MWWorld::Ptr item = *sender->getUserData<MWWorld::Ptr>();
|
MWWorld::Ptr item = *sender->getUserData<MWWorld::Ptr>();
|
||||||
item.getCellRef().mCharge = MWWorld::Class::get(item).getItemMaxHealth(item);
|
item.getCellRef().mCharge = item.getClass().getItemMaxHealth(item);
|
||||||
|
|
||||||
MWBase::Environment::get().getSoundManager()->playSound("Repair",1,1);
|
MWBase::Environment::get().getSoundManager()->playSound("Repair",1,1);
|
||||||
|
|
||||||
|
|
|
@ -166,7 +166,7 @@ namespace MWGui
|
||||||
frame->eventMouseButtonClick += MyGUI::newDelegate(this, &QuickKeysMenu::onQuickKeyButtonClicked);
|
frame->eventMouseButtonClick += MyGUI::newDelegate(this, &QuickKeysMenu::onQuickKeyButtonClicked);
|
||||||
MyGUI::ImageBox* image = frame->createWidget<MyGUI::ImageBox>("ImageBox", MyGUI::IntCoord(5, 5, 32, 32), MyGUI::Align::Default);
|
MyGUI::ImageBox* image = frame->createWidget<MyGUI::ImageBox>("ImageBox", MyGUI::IntCoord(5, 5, 32, 32), MyGUI::Align::Default);
|
||||||
std::string path = std::string("icons\\");
|
std::string path = std::string("icons\\");
|
||||||
path += MWWorld::Class::get(item).getInventoryIcon(item);
|
path += item.getClass().getInventoryIcon(item);
|
||||||
int pos = path.rfind(".");
|
int pos = path.rfind(".");
|
||||||
path.erase(pos);
|
path.erase(pos);
|
||||||
path.append(".dds");
|
path.append(".dds");
|
||||||
|
@ -200,7 +200,7 @@ namespace MWGui
|
||||||
|
|
||||||
MyGUI::ImageBox* image = frame->createWidget<MyGUI::ImageBox>("ImageBox", MyGUI::IntCoord(5, 5, 32, 32), MyGUI::Align::Default);
|
MyGUI::ImageBox* image = frame->createWidget<MyGUI::ImageBox>("ImageBox", MyGUI::IntCoord(5, 5, 32, 32), MyGUI::Align::Default);
|
||||||
std::string path = std::string("icons\\");
|
std::string path = std::string("icons\\");
|
||||||
path += MWWorld::Class::get(item).getInventoryIcon(item);
|
path += item.getClass().getInventoryIcon(item);
|
||||||
int pos = path.rfind(".");
|
int pos = path.rfind(".");
|
||||||
path.erase(pos);
|
path.erase(pos);
|
||||||
path.append(".dds");
|
path.append(".dds");
|
||||||
|
@ -265,7 +265,7 @@ namespace MWGui
|
||||||
QuickKeyType type = *button->getUserData<QuickKeyType>();
|
QuickKeyType type = *button->getUserData<QuickKeyType>();
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
MWWorld::InventoryStore& store = MWWorld::Class::get(player).getInventoryStore(player);
|
MWWorld::InventoryStore& store = player.getClass().getInventoryStore(player);
|
||||||
|
|
||||||
if (type == Type_Item || type == Type_MagicItem)
|
if (type == Type_Item || type == Type_MagicItem)
|
||||||
{
|
{
|
||||||
|
@ -290,7 +290,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
// No replacement was found
|
// No replacement was found
|
||||||
MWBase::Environment::get().getWindowManager ()->messageBox (
|
MWBase::Environment::get().getWindowManager ()->messageBox (
|
||||||
"#{sQuickMenu5} " + MWWorld::Class::get(item).getName(item));
|
"#{sQuickMenu5} " + item.getClass().getName(item));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -330,7 +330,7 @@ namespace MWGui
|
||||||
assert(it != store.end());
|
assert(it != store.end());
|
||||||
|
|
||||||
// equip, if it can be equipped
|
// equip, if it can be equipped
|
||||||
if (!MWWorld::Class::get(item).getEquipmentSlots(item).first.empty())
|
if (!item.getClass().getEquipmentSlots(item).first.empty())
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->useItem(item);
|
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->useItem(item);
|
||||||
}
|
}
|
||||||
|
@ -522,8 +522,8 @@ namespace MWGui
|
||||||
const int spellHeight = 18;
|
const int spellHeight = 18;
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
MWWorld::InventoryStore& store = MWWorld::Class::get(player).getInventoryStore(player);
|
MWWorld::InventoryStore& store = player.getClass().getInventoryStore(player);
|
||||||
MWMechanics::CreatureStats& stats = MWWorld::Class::get(player).getCreatureStats(player);
|
MWMechanics::CreatureStats& stats = player.getClass().getCreatureStats(player);
|
||||||
MWMechanics::Spells& spells = stats.getSpells();
|
MWMechanics::Spells& spells = stats.getSpells();
|
||||||
|
|
||||||
/// \todo lots of copy&pasted code from SpellWindow
|
/// \todo lots of copy&pasted code from SpellWindow
|
||||||
|
@ -566,7 +566,7 @@ namespace MWGui
|
||||||
std::vector<MWWorld::Ptr> items;
|
std::vector<MWWorld::Ptr> items;
|
||||||
for (MWWorld::ContainerStoreIterator it(store.begin()); it != store.end(); ++it)
|
for (MWWorld::ContainerStoreIterator it(store.begin()); it != store.end(); ++it)
|
||||||
{
|
{
|
||||||
std::string enchantId = MWWorld::Class::get(*it).getEnchantment(*it);
|
std::string enchantId = it->getClass().getEnchantment(*it);
|
||||||
if (enchantId != "")
|
if (enchantId != "")
|
||||||
{
|
{
|
||||||
// only add items with "Cast once" or "Cast on use"
|
// only add items with "Cast once" or "Cast on use"
|
||||||
|
@ -645,7 +645,7 @@ namespace MWGui
|
||||||
|
|
||||||
MyGUI::Button* t = mMagicList->createWidget<MyGUI::Button>(equipped ? "SpellText" : "SpellTextUnequipped",
|
MyGUI::Button* t = mMagicList->createWidget<MyGUI::Button>(equipped ? "SpellText" : "SpellTextUnequipped",
|
||||||
MyGUI::IntCoord(4, mHeight, mWidth-8, spellHeight), MyGUI::Align::Left | MyGUI::Align::Top);
|
MyGUI::IntCoord(4, mHeight, mWidth-8, spellHeight), MyGUI::Align::Left | MyGUI::Align::Top);
|
||||||
t->setCaption(MWWorld::Class::get(item).getName(item));
|
t->setCaption(item.getClass().getName(item));
|
||||||
t->setTextAlign(MyGUI::Align::Left);
|
t->setTextAlign(MyGUI::Align::Left);
|
||||||
t->setUserData(item);
|
t->setUserData(item);
|
||||||
t->setUserString("ToolTipType", "ItemPtr");
|
t->setUserString("ToolTipType", "ItemPtr");
|
||||||
|
|
|
@ -41,7 +41,7 @@ void Recharge::open()
|
||||||
void Recharge::start (const MWWorld::Ptr &item)
|
void Recharge::start (const MWWorld::Ptr &item)
|
||||||
{
|
{
|
||||||
std::string path = std::string("icons\\");
|
std::string path = std::string("icons\\");
|
||||||
path += MWWorld::Class::get(item).getInventoryIcon(item);
|
path += item.getClass().getInventoryIcon(item);
|
||||||
int pos = path.rfind(".");
|
int pos = path.rfind(".");
|
||||||
path.erase(pos);
|
path.erase(pos);
|
||||||
path.append(".dds");
|
path.append(".dds");
|
||||||
|
@ -85,7 +85,7 @@ void Recharge::updateView()
|
||||||
int currentY = 0;
|
int currentY = 0;
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
MWWorld::ContainerStore& store = MWWorld::Class::get(player).getContainerStore(player);
|
MWWorld::ContainerStore& store = player.getClass().getContainerStore(player);
|
||||||
for (MWWorld::ContainerStoreIterator iter (store.begin());
|
for (MWWorld::ContainerStoreIterator iter (store.begin());
|
||||||
iter!=store.end(); ++iter)
|
iter!=store.end(); ++iter)
|
||||||
{
|
{
|
||||||
|
@ -99,14 +99,14 @@ void Recharge::updateView()
|
||||||
|
|
||||||
MyGUI::TextBox* text = mView->createWidget<MyGUI::TextBox> (
|
MyGUI::TextBox* text = mView->createWidget<MyGUI::TextBox> (
|
||||||
"SandText", MyGUI::IntCoord(8, currentY, mView->getWidth()-8, 18), MyGUI::Align::Default);
|
"SandText", MyGUI::IntCoord(8, currentY, mView->getWidth()-8, 18), MyGUI::Align::Default);
|
||||||
text->setCaption(MWWorld::Class::get(*iter).getName(*iter));
|
text->setCaption(iter->getClass().getName(*iter));
|
||||||
text->setNeedMouseFocus(false);
|
text->setNeedMouseFocus(false);
|
||||||
currentY += 19;
|
currentY += 19;
|
||||||
|
|
||||||
MyGUI::ImageBox* icon = mView->createWidget<MyGUI::ImageBox> (
|
MyGUI::ImageBox* icon = mView->createWidget<MyGUI::ImageBox> (
|
||||||
"ImageBox", MyGUI::IntCoord(16, currentY, 32, 32), MyGUI::Align::Default);
|
"ImageBox", MyGUI::IntCoord(16, currentY, 32, 32), MyGUI::Align::Default);
|
||||||
std::string path = std::string("icons\\");
|
std::string path = std::string("icons\\");
|
||||||
path += MWWorld::Class::get(*iter).getInventoryIcon(*iter);
|
path += iter->getClass().getInventoryIcon(*iter);
|
||||||
int pos = path.rfind(".");
|
int pos = path.rfind(".");
|
||||||
path.erase(pos);
|
path.erase(pos);
|
||||||
path.append(".dds");
|
path.append(".dds");
|
||||||
|
|
|
@ -40,7 +40,7 @@ void Repair::startRepairItem(const MWWorld::Ptr &item)
|
||||||
mRepair.setTool(item);
|
mRepair.setTool(item);
|
||||||
|
|
||||||
std::string path = std::string("icons\\");
|
std::string path = std::string("icons\\");
|
||||||
path += MWWorld::Class::get(item).getInventoryIcon(item);
|
path += item.getClass().getInventoryIcon(item);
|
||||||
int pos = path.rfind(".");
|
int pos = path.rfind(".");
|
||||||
path.erase(pos);
|
path.erase(pos);
|
||||||
path.append(".dds");
|
path.append(".dds");
|
||||||
|
@ -90,28 +90,28 @@ void Repair::updateRepairView()
|
||||||
int currentY = 0;
|
int currentY = 0;
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
MWWorld::ContainerStore& store = MWWorld::Class::get(player).getContainerStore(player);
|
MWWorld::ContainerStore& store = player.getClass().getContainerStore(player);
|
||||||
int categories = MWWorld::ContainerStore::Type_Weapon | MWWorld::ContainerStore::Type_Armor;
|
int categories = MWWorld::ContainerStore::Type_Weapon | MWWorld::ContainerStore::Type_Armor;
|
||||||
for (MWWorld::ContainerStoreIterator iter (store.begin(categories));
|
for (MWWorld::ContainerStoreIterator iter (store.begin(categories));
|
||||||
iter!=store.end(); ++iter)
|
iter!=store.end(); ++iter)
|
||||||
{
|
{
|
||||||
if (MWWorld::Class::get(*iter).hasItemHealth(*iter))
|
if (iter->getClass().hasItemHealth(*iter))
|
||||||
{
|
{
|
||||||
int maxDurability = MWWorld::Class::get(*iter).getItemMaxHealth(*iter);
|
int maxDurability = iter->getClass().getItemMaxHealth(*iter);
|
||||||
int durability = (iter->getCellRef().mCharge == -1) ? maxDurability : iter->getCellRef().mCharge;
|
int durability = (iter->getCellRef().mCharge == -1) ? maxDurability : iter->getCellRef().mCharge;
|
||||||
if (maxDurability == durability)
|
if (maxDurability == durability)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
MyGUI::TextBox* text = mRepairView->createWidget<MyGUI::TextBox> (
|
MyGUI::TextBox* text = mRepairView->createWidget<MyGUI::TextBox> (
|
||||||
"SandText", MyGUI::IntCoord(8, currentY, mRepairView->getWidth()-8, 18), MyGUI::Align::Default);
|
"SandText", MyGUI::IntCoord(8, currentY, mRepairView->getWidth()-8, 18), MyGUI::Align::Default);
|
||||||
text->setCaption(MWWorld::Class::get(*iter).getName(*iter));
|
text->setCaption(iter->getClass().getName(*iter));
|
||||||
text->setNeedMouseFocus(false);
|
text->setNeedMouseFocus(false);
|
||||||
currentY += 19;
|
currentY += 19;
|
||||||
|
|
||||||
MyGUI::ImageBox* icon = mRepairView->createWidget<MyGUI::ImageBox> (
|
MyGUI::ImageBox* icon = mRepairView->createWidget<MyGUI::ImageBox> (
|
||||||
"ImageBox", MyGUI::IntCoord(16, currentY, 32, 32), MyGUI::Align::Default);
|
"ImageBox", MyGUI::IntCoord(16, currentY, 32, 32), MyGUI::Align::Default);
|
||||||
std::string path = std::string("icons\\");
|
std::string path = std::string("icons\\");
|
||||||
path += MWWorld::Class::get(*iter).getInventoryIcon(*iter);
|
path += iter->getClass().getInventoryIcon(*iter);
|
||||||
int pos = path.rfind(".");
|
int pos = path.rfind(".");
|
||||||
path.erase(pos);
|
path.erase(pos);
|
||||||
path.append(".dds");
|
path.append(".dds");
|
||||||
|
|
|
@ -47,8 +47,8 @@ namespace
|
||||||
|
|
||||||
if (left.mBase.getTypeName() == right.mBase.getTypeName())
|
if (left.mBase.getTypeName() == right.mBase.getTypeName())
|
||||||
{
|
{
|
||||||
int cmp = MWWorld::Class::get(left.mBase).getName(left.mBase).compare(
|
int cmp = left.mBase.getClass().getName(left.mBase).compare(
|
||||||
MWWorld::Class::get(right.mBase).getName(right.mBase));
|
right.mBase.getClass().getName(right.mBase));
|
||||||
return cmp < 0;
|
return cmp < 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -83,7 +83,7 @@ namespace MWGui
|
||||||
mPtr = actor;
|
mPtr = actor;
|
||||||
clearSpells();
|
clearSpells();
|
||||||
|
|
||||||
MWMechanics::Spells& merchantSpells = MWWorld::Class::get (actor).getCreatureStats (actor).getSpells();
|
MWMechanics::Spells& merchantSpells = actor.getClass().getCreatureStats (actor).getSpells();
|
||||||
|
|
||||||
for (MWMechanics::Spells::TIterator iter = merchantSpells.begin(); iter!=merchantSpells.end(); ++iter)
|
for (MWMechanics::Spells::TIterator iter = merchantSpells.begin(); iter!=merchantSpells.end(); ++iter)
|
||||||
{
|
{
|
||||||
|
@ -107,7 +107,7 @@ namespace MWGui
|
||||||
bool SpellBuyingWindow::playerHasSpell(const std::string &id)
|
bool SpellBuyingWindow::playerHasSpell(const std::string &id)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
MWMechanics::Spells& playerSpells = MWWorld::Class::get (player).getCreatureStats (player).getSpells();
|
MWMechanics::Spells& playerSpells = player.getClass().getCreatureStats (player).getSpells();
|
||||||
for (MWMechanics::Spells::TIterator it = playerSpells.begin(); it != playerSpells.end(); ++it)
|
for (MWMechanics::Spells::TIterator it = playerSpells.begin(); it != playerSpells.end(); ++it)
|
||||||
{
|
{
|
||||||
if (Misc::StringUtils::ciEqual(id, it->first))
|
if (Misc::StringUtils::ciEqual(id, it->first))
|
||||||
|
@ -121,7 +121,7 @@ namespace MWGui
|
||||||
int price = *_sender->getUserData<int>();
|
int price = *_sender->getUserData<int>();
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
MWMechanics::CreatureStats& stats = MWWorld::Class::get(player).getCreatureStats(player);
|
MWMechanics::CreatureStats& stats = player.getClass().getCreatureStats(player);
|
||||||
MWMechanics::Spells& spells = stats.getSpells();
|
MWMechanics::Spells& spells = stats.getSpells();
|
||||||
spells.add (mSpellsWidgetMap.find(_sender)->second);
|
spells.add (mSpellsWidgetMap.find(_sender)->second);
|
||||||
player.getClass().getContainerStore(player).remove(MWWorld::ContainerStore::sGoldId, price, player);
|
player.getClass().getContainerStore(player).remove(MWWorld::ContainerStore::sGoldId, price, player);
|
||||||
|
|
|
@ -353,7 +353,7 @@ namespace MWGui
|
||||||
|
|
||||||
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->createRecord(mSpell);
|
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->createRecord(mSpell);
|
||||||
|
|
||||||
MWMechanics::CreatureStats& stats = MWWorld::Class::get(player).getCreatureStats(player);
|
MWMechanics::CreatureStats& stats = player.getClass().getCreatureStats(player);
|
||||||
MWMechanics::Spells& spells = stats.getSpells();
|
MWMechanics::Spells& spells = stats.getSpells();
|
||||||
spells.add (spell->mId);
|
spells.add (spell->mId);
|
||||||
|
|
||||||
|
@ -445,7 +445,7 @@ namespace MWGui
|
||||||
// get the list of magic effects that are known to the player
|
// get the list of magic effects that are known to the player
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
MWMechanics::CreatureStats& stats = MWWorld::Class::get(player).getCreatureStats(player);
|
MWMechanics::CreatureStats& stats = player.getClass().getCreatureStats(player);
|
||||||
MWMechanics::Spells& spells = stats.getSpells();
|
MWMechanics::Spells& spells = stats.getSpells();
|
||||||
|
|
||||||
std::vector<short> knownEffects;
|
std::vector<short> knownEffects;
|
||||||
|
|
|
@ -40,14 +40,14 @@ namespace MWGui
|
||||||
// TODO: Tracking add/remove/expire would be better than force updating every frame
|
// TODO: Tracking add/remove/expire would be better than force updating every frame
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
const MWMechanics::CreatureStats& stats = MWWorld::Class::get(player).getCreatureStats(player);
|
const MWMechanics::CreatureStats& stats = player.getClass().getCreatureStats(player);
|
||||||
|
|
||||||
|
|
||||||
EffectSourceVisitor visitor;
|
EffectSourceVisitor visitor;
|
||||||
|
|
||||||
// permanent item enchantments & permanent spells
|
// permanent item enchantments & permanent spells
|
||||||
visitor.mIsPermanent = true;
|
visitor.mIsPermanent = true;
|
||||||
MWWorld::InventoryStore& store = MWWorld::Class::get(player).getInventoryStore(player);
|
MWWorld::InventoryStore& store = player.getClass().getInventoryStore(player);
|
||||||
store.visitEffectSources(visitor);
|
store.visitEffectSources(visitor);
|
||||||
stats.getSpells().visitEffectSources(visitor);
|
stats.getSpells().visitEffectSources(visitor);
|
||||||
|
|
||||||
|
|
|
@ -84,8 +84,8 @@ namespace MWGui
|
||||||
// retrieve all player spells, divide them into Powers and Spells and sort them
|
// retrieve all player spells, divide them into Powers and Spells and sort them
|
||||||
std::vector<std::string> spellList;
|
std::vector<std::string> spellList;
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
MWWorld::InventoryStore& store = MWWorld::Class::get(player).getInventoryStore(player);
|
MWWorld::InventoryStore& store = player.getClass().getInventoryStore(player);
|
||||||
MWMechanics::CreatureStats& stats = MWWorld::Class::get(player).getCreatureStats(player);
|
MWMechanics::CreatureStats& stats = player.getClass().getCreatureStats(player);
|
||||||
MWMechanics::Spells& spells = stats.getSpells();
|
MWMechanics::Spells& spells = stats.getSpells();
|
||||||
|
|
||||||
for (MWMechanics::Spells::TIterator it = spells.begin(); it != spells.end(); ++it)
|
for (MWMechanics::Spells::TIterator it = spells.begin(); it != spells.end(); ++it)
|
||||||
|
@ -122,7 +122,7 @@ namespace MWGui
|
||||||
std::vector<MWWorld::Ptr> items;
|
std::vector<MWWorld::Ptr> items;
|
||||||
for (MWWorld::ContainerStoreIterator it(store.begin()); it != store.end(); ++it)
|
for (MWWorld::ContainerStoreIterator it(store.begin()); it != store.end(); ++it)
|
||||||
{
|
{
|
||||||
std::string enchantId = MWWorld::Class::get(*it).getEnchantment(*it);
|
std::string enchantId = it->getClass().getEnchantment(*it);
|
||||||
if (enchantId != "")
|
if (enchantId != "")
|
||||||
{
|
{
|
||||||
// only add items with "Cast once" or "Cast on use"
|
// only add items with "Cast once" or "Cast on use"
|
||||||
|
@ -203,7 +203,7 @@ namespace MWGui
|
||||||
MWWorld::Ptr item = *it;
|
MWWorld::Ptr item = *it;
|
||||||
|
|
||||||
const ESM::Enchantment* enchant =
|
const ESM::Enchantment* enchant =
|
||||||
esmStore.get<ESM::Enchantment>().find(MWWorld::Class::get(item).getEnchantment(item));
|
esmStore.get<ESM::Enchantment>().find(item.getClass().getEnchantment(item));
|
||||||
|
|
||||||
// check if the item is currently equipped (will display in a different color)
|
// check if the item is currently equipped (will display in a different color)
|
||||||
bool equipped = false;
|
bool equipped = false;
|
||||||
|
@ -218,7 +218,7 @@ namespace MWGui
|
||||||
|
|
||||||
MyGUI::Button* t = mSpellView->createWidget<MyGUI::Button>(equipped ? "SpellText" : "SpellTextUnequipped",
|
MyGUI::Button* t = mSpellView->createWidget<MyGUI::Button>(equipped ? "SpellText" : "SpellTextUnequipped",
|
||||||
MyGUI::IntCoord(4, mHeight, mWidth-8, spellHeight), MyGUI::Align::Left | MyGUI::Align::Top);
|
MyGUI::IntCoord(4, mHeight, mWidth-8, spellHeight), MyGUI::Align::Left | MyGUI::Align::Top);
|
||||||
t->setCaption(MWWorld::Class::get(item).getName(item));
|
t->setCaption(item.getClass().getName(item));
|
||||||
t->setTextAlign(MyGUI::Align::Left);
|
t->setTextAlign(MyGUI::Align::Left);
|
||||||
t->setUserData(item);
|
t->setUserData(item);
|
||||||
t->setUserString("ToolTipType", "ItemPtr");
|
t->setUserString("ToolTipType", "ItemPtr");
|
||||||
|
@ -300,7 +300,7 @@ namespace MWGui
|
||||||
void SpellWindow::onEnchantedItemSelected(MyGUI::Widget* _sender)
|
void SpellWindow::onEnchantedItemSelected(MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
MWWorld::InventoryStore& store = MWWorld::Class::get(player).getInventoryStore(player);
|
MWWorld::InventoryStore& store = player.getClass().getInventoryStore(player);
|
||||||
MWWorld::Ptr item = *_sender->getUserData<MWWorld::Ptr>();
|
MWWorld::Ptr item = *_sender->getUserData<MWWorld::Ptr>();
|
||||||
|
|
||||||
// retrieve ContainerStoreIterator to the item
|
// retrieve ContainerStoreIterator to the item
|
||||||
|
@ -316,7 +316,7 @@ namespace MWGui
|
||||||
|
|
||||||
// equip, if it can be equipped and is not already equipped
|
// equip, if it can be equipped and is not already equipped
|
||||||
if (_sender->getUserString("Equipped") == "false"
|
if (_sender->getUserString("Equipped") == "false"
|
||||||
&& !MWWorld::Class::get(item).getEquipmentSlots(item).first.empty())
|
&& !item.getClass().getEquipmentSlots(item).first.empty())
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->useItem(item);
|
MWBase::Environment::get().getWindowManager()->getInventoryWindow()->useItem(item);
|
||||||
}
|
}
|
||||||
|
@ -330,7 +330,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
std::string spellId = _sender->getUserString("Spell");
|
std::string spellId = _sender->getUserString("Spell");
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
MWWorld::InventoryStore& store = MWWorld::Class::get(player).getInventoryStore(player);
|
MWWorld::InventoryStore& store = player.getClass().getInventoryStore(player);
|
||||||
|
|
||||||
if (MyGUI::InputManager::getInstance().isShiftPressed())
|
if (MyGUI::InputManager::getInstance().isShiftPressed())
|
||||||
{
|
{
|
||||||
|
@ -384,7 +384,7 @@ namespace MWGui
|
||||||
void SpellWindow::onDeleteSpellAccept()
|
void SpellWindow::onDeleteSpellAccept()
|
||||||
{
|
{
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
MWMechanics::CreatureStats& stats = MWWorld::Class::get(player).getCreatureStats(player);
|
MWMechanics::CreatureStats& stats = player.getClass().getCreatureStats(player);
|
||||||
MWMechanics::Spells& spells = stats.getSpells();
|
MWMechanics::Spells& spells = stats.getSpells();
|
||||||
|
|
||||||
if (MWBase::Environment::get().getWindowManager()->getSelectedSpell() == mSpellToDelete)
|
if (MWBase::Environment::get().getWindowManager()->getSelectedSpell() == mSpellToDelete)
|
||||||
|
|
|
@ -228,7 +228,7 @@ namespace MWGui
|
||||||
NoDrop::onFrame(dt);
|
NoDrop::onFrame(dt);
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
const MWMechanics::NpcStats &PCstats = MWWorld::Class::get(player).getNpcStats(player);
|
const MWMechanics::NpcStats &PCstats = player.getClass().getNpcStats(player);
|
||||||
|
|
||||||
// level progress
|
// level progress
|
||||||
MyGUI::Widget* levelWidget;
|
MyGUI::Widget* levelWidget;
|
||||||
|
@ -459,7 +459,7 @@ namespace MWGui
|
||||||
addSeparator(coord1, coord2);
|
addSeparator(coord1, coord2);
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
const MWMechanics::NpcStats &PCstats = MWWorld::Class::get(player).getNpcStats(player);
|
const MWMechanics::NpcStats &PCstats = player.getClass().getNpcStats(player);
|
||||||
const std::set<std::string> &expelled = PCstats.getExpelled();
|
const std::set<std::string> &expelled = PCstats.getExpelled();
|
||||||
|
|
||||||
addGroup(MWBase::Environment::get().getWindowManager()->getGameSettingString("sFaction", "Faction"), coord1, coord2);
|
addGroup(MWBase::Environment::get().getWindowManager()->getGameSettingString("sFaction", "Faction"), coord1, coord2);
|
||||||
|
|
|
@ -89,7 +89,7 @@ namespace MWGui
|
||||||
if (mFocusObject.isEmpty ())
|
if (mFocusObject.isEmpty ())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const MWWorld::Class& objectclass = MWWorld::Class::get (mFocusObject);
|
const MWWorld::Class& objectclass = mFocusObject.getClass();
|
||||||
|
|
||||||
MyGUI::IntSize tooltipSize;
|
MyGUI::IntSize tooltipSize;
|
||||||
if ((!objectclass.hasToolTip(mFocusObject))&&(MWBase::Environment::get().getWindowManager()->getMode() == GM_Console))
|
if ((!objectclass.hasToolTip(mFocusObject))&&(MWBase::Environment::get().getWindowManager()->getMode() == GM_Console))
|
||||||
|
@ -305,7 +305,7 @@ namespace MWGui
|
||||||
|
|
||||||
MyGUI::IntSize tooltipSize;
|
MyGUI::IntSize tooltipSize;
|
||||||
|
|
||||||
const MWWorld::Class& object = MWWorld::Class::get (mFocusObject);
|
const MWWorld::Class& object = mFocusObject.getClass();
|
||||||
if (!object.hasToolTip(mFocusObject))
|
if (!object.hasToolTip(mFocusObject))
|
||||||
{
|
{
|
||||||
mDynamicToolTipBox->setVisible(false);
|
mDynamicToolTipBox->setVisible(false);
|
||||||
|
|
|
@ -138,7 +138,7 @@ namespace MWGui
|
||||||
|
|
||||||
int services = 0;
|
int services = 0;
|
||||||
if (!mMerchant.isEmpty())
|
if (!mMerchant.isEmpty())
|
||||||
services = MWWorld::Class::get(mMerchant).getServices(mMerchant);
|
services = mMerchant.getClass().getServices(mMerchant);
|
||||||
|
|
||||||
mItems.clear();
|
mItems.clear();
|
||||||
// add regular items
|
// add regular items
|
||||||
|
@ -150,7 +150,7 @@ namespace MWGui
|
||||||
MWWorld::Ptr base = item.mBase;
|
MWWorld::Ptr base = item.mBase;
|
||||||
if(Misc::StringUtils::ciEqual(base.getCellRef().mRefID, MWWorld::ContainerStore::sGoldId))
|
if(Misc::StringUtils::ciEqual(base.getCellRef().mRefID, MWWorld::ContainerStore::sGoldId))
|
||||||
continue;
|
continue;
|
||||||
if(!MWWorld::Class::get(base).canSell(base, services))
|
if(!base.getClass().canSell(base, services))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Bound items may not be bought
|
// Bound items may not be bought
|
||||||
|
@ -164,7 +164,7 @@ namespace MWGui
|
||||||
if(mMerchant.getClass().hasInventoryStore(mMerchant))
|
if(mMerchant.getClass().hasInventoryStore(mMerchant))
|
||||||
{
|
{
|
||||||
bool isEquipped = false;
|
bool isEquipped = false;
|
||||||
MWWorld::InventoryStore& store = MWWorld::Class::get(mMerchant).getInventoryStore(mMerchant);
|
MWWorld::InventoryStore& store = mMerchant.getClass().getInventoryStore(mMerchant);
|
||||||
for (int slot=0; slot<MWWorld::InventoryStore::Slots; ++slot)
|
for (int slot=0; slot<MWWorld::InventoryStore::Slots; ++slot)
|
||||||
{
|
{
|
||||||
MWWorld::ContainerStoreIterator equipped = store.getSlot(slot);
|
MWWorld::ContainerStoreIterator equipped = store.getSlot(slot);
|
||||||
|
|
|
@ -102,7 +102,7 @@ namespace MWGui
|
||||||
|
|
||||||
// Careful here. setTitle may cause size updates, causing itemview redraw, so make sure to do it last
|
// Careful here. setTitle may cause size updates, causing itemview redraw, so make sure to do it last
|
||||||
// or we end up using a possibly invalid model.
|
// or we end up using a possibly invalid model.
|
||||||
setTitle(MWWorld::Class::get(actor).getName(actor));
|
setTitle(actor.getClass().getName(actor));
|
||||||
|
|
||||||
onFilterChanged(mFilterAll);
|
onFilterChanged(mFilterAll);
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ namespace MWGui
|
||||||
|
|
||||||
int TradeWindow::getMerchantServices()
|
int TradeWindow::getMerchantServices()
|
||||||
{
|
{
|
||||||
return MWWorld::Class::get(mPtr).getServices(mPtr);
|
return mPtr.getClass().getServices(mPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TradeWindow::onItemSelected (int index)
|
void TradeWindow::onItemSelected (int index)
|
||||||
|
@ -150,7 +150,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
CountDialog* dialog = MWBase::Environment::get().getWindowManager()->getCountDialog();
|
CountDialog* dialog = MWBase::Environment::get().getWindowManager()->getCountDialog();
|
||||||
std::string message = "#{sQuanityMenuMessage02}";
|
std::string message = "#{sQuanityMenuMessage02}";
|
||||||
dialog->open(MWWorld::Class::get(object).getName(object), message, count);
|
dialog->open(object.getClass().getName(object), message, count);
|
||||||
dialog->eventOkClicked.clear();
|
dialog->eventOkClicked.clear();
|
||||||
dialog->eventOkClicked += MyGUI::newDelegate(this, &TradeWindow::sellItem);
|
dialog->eventOkClicked += MyGUI::newDelegate(this, &TradeWindow::sellItem);
|
||||||
mItemToSell = mSortModel->mapToSource(index);
|
mItemToSell = mSortModel->mapToSource(index);
|
||||||
|
@ -165,7 +165,7 @@ namespace MWGui
|
||||||
void TradeWindow::sellItem(MyGUI::Widget* sender, int count)
|
void TradeWindow::sellItem(MyGUI::Widget* sender, int count)
|
||||||
{
|
{
|
||||||
const ItemStack& item = mTradeModel->getItem(mItemToSell);
|
const ItemStack& item = mTradeModel->getItem(mItemToSell);
|
||||||
std::string sound = MWWorld::Class::get(item.mBase).getDownSoundId(item.mBase);
|
std::string sound = item.mBase.getClass().getDownSoundId(item.mBase);
|
||||||
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
|
||||||
|
|
||||||
TradeItemModel* playerTradeModel = MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getTradeModel();
|
TradeItemModel* playerTradeModel = MWBase::Environment::get().getWindowManager()->getInventoryWindow()->getTradeModel();
|
||||||
|
@ -208,7 +208,7 @@ namespace MWGui
|
||||||
|
|
||||||
void TradeWindow::addOrRemoveGold(int amount, const MWWorld::Ptr& actor)
|
void TradeWindow::addOrRemoveGold(int amount, const MWWorld::Ptr& actor)
|
||||||
{
|
{
|
||||||
MWWorld::ContainerStore& store = MWWorld::Class::get(actor).getContainerStore(actor);
|
MWWorld::ContainerStore& store = actor.getClass().getContainerStore(actor);
|
||||||
|
|
||||||
if (amount > 0)
|
if (amount > 0)
|
||||||
{
|
{
|
||||||
|
@ -442,7 +442,7 @@ namespace MWGui
|
||||||
|
|
||||||
void TradeWindow::sellToNpc(const MWWorld::Ptr& item, int count, bool boughtItem)
|
void TradeWindow::sellToNpc(const MWWorld::Ptr& item, int count, bool boughtItem)
|
||||||
{
|
{
|
||||||
int diff = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr, MWWorld::Class::get(item).getValue(item) * count, boughtItem);
|
int diff = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr, item.getClass().getValue(item) * count, boughtItem);
|
||||||
|
|
||||||
mCurrentBalance += diff;
|
mCurrentBalance += diff;
|
||||||
mCurrentMerchantOffer += diff;
|
mCurrentMerchantOffer += diff;
|
||||||
|
@ -452,7 +452,7 @@ namespace MWGui
|
||||||
|
|
||||||
void TradeWindow::buyFromNpc(const MWWorld::Ptr& item, int count, bool soldItem)
|
void TradeWindow::buyFromNpc(const MWWorld::Ptr& item, int count, bool soldItem)
|
||||||
{
|
{
|
||||||
int diff = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr, MWWorld::Class::get(item).getValue(item) * count, !soldItem);
|
int diff = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr, item.getClass().getValue(item) * count, !soldItem);
|
||||||
|
|
||||||
mCurrentBalance -= diff;
|
mCurrentBalance -= diff;
|
||||||
mCurrentMerchantOffer -= diff;
|
mCurrentMerchantOffer -= diff;
|
||||||
|
|
|
@ -44,7 +44,7 @@ namespace MWGui
|
||||||
|
|
||||||
mPlayerGold->setCaptionWithReplacing("#{sGold}: " + boost::lexical_cast<std::string>(playerGold));
|
mPlayerGold->setCaptionWithReplacing("#{sGold}: " + boost::lexical_cast<std::string>(playerGold));
|
||||||
|
|
||||||
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(actor).getNpcStats (actor);
|
MWMechanics::NpcStats& npcStats = actor.getClass().getNpcStats (actor);
|
||||||
|
|
||||||
// NPC can train you in his best 3 skills
|
// NPC can train you in his best 3 skills
|
||||||
std::vector< std::pair<int, int> > bestSkills;
|
std::vector< std::pair<int, int> > bestSkills;
|
||||||
|
@ -73,7 +73,7 @@ namespace MWGui
|
||||||
MyGUI::EnumeratorWidgetPtr widgets = mTrainingOptions->getEnumerator ();
|
MyGUI::EnumeratorWidgetPtr widgets = mTrainingOptions->getEnumerator ();
|
||||||
MyGUI::Gui::getInstance ().destroyWidgets (widgets);
|
MyGUI::Gui::getInstance ().destroyWidgets (widgets);
|
||||||
|
|
||||||
MWMechanics::NpcStats& pcStats = MWWorld::Class::get(player).getNpcStats (player);
|
MWMechanics::NpcStats& pcStats = player.getClass().getNpcStats (player);
|
||||||
|
|
||||||
const MWWorld::Store<ESM::GameSetting> &gmst =
|
const MWWorld::Store<ESM::GameSetting> &gmst =
|
||||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||||
|
@ -115,7 +115,7 @@ namespace MWGui
|
||||||
int skillId = *sender->getUserData<int>();
|
int skillId = *sender->getUserData<int>();
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
||||||
MWMechanics::NpcStats& pcStats = MWWorld::Class::get(player).getNpcStats (player);
|
MWMechanics::NpcStats& pcStats = player.getClass().getNpcStats (player);
|
||||||
|
|
||||||
const MWWorld::ESMStore &store =
|
const MWWorld::ESMStore &store =
|
||||||
MWBase::Environment::get().getWorld()->getStore();
|
MWBase::Environment::get().getWorld()->getStore();
|
||||||
|
@ -123,7 +123,7 @@ namespace MWGui
|
||||||
int price = pcStats.getSkill (skillId).getBase() * store.get<ESM::GameSetting>().find("iTrainingMod")->getInt ();
|
int price = pcStats.getSkill (skillId).getBase() * store.get<ESM::GameSetting>().find("iTrainingMod")->getInt ();
|
||||||
price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr,price,true);
|
price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mPtr,price,true);
|
||||||
|
|
||||||
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(mPtr).getNpcStats (mPtr);
|
MWMechanics::NpcStats& npcStats = mPtr.getClass().getNpcStats (mPtr);
|
||||||
if (npcStats.getSkill (skillId).getBase () <= pcStats.getSkill (skillId).getBase ())
|
if (npcStats.getSkill (skillId).getBase () <= pcStats.getSkill (skillId).getBase ())
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox ("#{sServiceTrainingWords}");
|
MWBase::Environment::get().getWindowManager()->messageBox ("#{sServiceTrainingWords}");
|
||||||
|
|
|
@ -161,7 +161,7 @@ namespace MWGui
|
||||||
MWBase::Environment::get().getWorld()->changeToExteriorCell(pos);
|
MWBase::Environment::get().getWorld()->changeToExteriorCell(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
MWWorld::Class::get(player).adjustPosition(player);
|
player.getClass().adjustPosition(player);
|
||||||
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Travel);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Travel);
|
||||||
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue);
|
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Dialogue);
|
||||||
MWBase::Environment::get().getWorld ()->getFader ()->fadeOut(0);
|
MWBase::Environment::get().getWorld ()->getFader ()->fadeOut(0);
|
||||||
|
|
|
@ -171,11 +171,11 @@ namespace MWGui
|
||||||
void WaitDialog::setCanRest (bool canRest)
|
void WaitDialog::setCanRest (bool canRest)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
MWMechanics::CreatureStats& stats = MWWorld::Class::get(player).getCreatureStats(player);
|
MWMechanics::CreatureStats& stats = player.getClass().getCreatureStats(player);
|
||||||
bool full = (stats.getFatigue().getCurrent() >= stats.getFatigue().getModified())
|
bool full = (stats.getFatigue().getCurrent() >= stats.getFatigue().getModified())
|
||||||
&& (stats.getHealth().getCurrent() >= stats.getHealth().getModified())
|
&& (stats.getHealth().getCurrent() >= stats.getHealth().getModified())
|
||||||
&& (stats.getMagicka().getCurrent() >= stats.getMagicka().getModified());
|
&& (stats.getMagicka().getCurrent() >= stats.getMagicka().getModified());
|
||||||
MWMechanics::NpcStats& npcstats = MWWorld::Class::get(player).getNpcStats(player);
|
MWMechanics::NpcStats& npcstats = player.getClass().getNpcStats(player);
|
||||||
bool werewolf = npcstats.isWerewolf();
|
bool werewolf = npcstats.isWerewolf();
|
||||||
|
|
||||||
mUntilHealedButton->setVisible(canRest && !full);
|
mUntilHealedButton->setVisible(canRest && !full);
|
||||||
|
@ -231,7 +231,7 @@ namespace MWGui
|
||||||
mWaiting = false;
|
mWaiting = false;
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
const MWMechanics::NpcStats &pcstats = MWWorld::Class::get(player).getNpcStats(player);
|
const MWMechanics::NpcStats &pcstats = player.getClass().getNpcStats(player);
|
||||||
|
|
||||||
// trigger levelup if possible
|
// trigger levelup if possible
|
||||||
const MWWorld::Store<ESM::GameSetting> &gmst =
|
const MWWorld::Store<ESM::GameSetting> &gmst =
|
||||||
|
|
|
@ -1027,20 +1027,20 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
mSelectedSpell = "";
|
mSelectedSpell = "";
|
||||||
const ESM::Enchantment* ench = MWBase::Environment::get().getWorld()->getStore().get<ESM::Enchantment>()
|
const ESM::Enchantment* ench = MWBase::Environment::get().getWorld()->getStore().get<ESM::Enchantment>()
|
||||||
.find(MWWorld::Class::get(item).getEnchantment(item));
|
.find(item.getClass().getEnchantment(item));
|
||||||
|
|
||||||
int chargePercent = (item.getCellRef().mEnchantmentCharge == -1) ? 100
|
int chargePercent = (item.getCellRef().mEnchantmentCharge == -1) ? 100
|
||||||
: (item.getCellRef().mEnchantmentCharge / static_cast<float>(ench->mData.mCharge) * 100);
|
: (item.getCellRef().mEnchantmentCharge / static_cast<float>(ench->mData.mCharge) * 100);
|
||||||
mHud->setSelectedEnchantItem(item, chargePercent);
|
mHud->setSelectedEnchantItem(item, chargePercent);
|
||||||
mSpellWindow->setTitle(MWWorld::Class::get(item).getName(item));
|
mSpellWindow->setTitle(item.getClass().getName(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowManager::setSelectedWeapon(const MWWorld::Ptr& item)
|
void WindowManager::setSelectedWeapon(const MWWorld::Ptr& item)
|
||||||
{
|
{
|
||||||
int durabilityPercent = (item.getCellRef().mCharge == -1) ? 100
|
int durabilityPercent = (item.getCellRef().mCharge == -1) ? 100
|
||||||
: (item.getCellRef().mCharge / static_cast<float>(MWWorld::Class::get(item).getItemMaxHealth(item)) * 100);
|
: (item.getCellRef().mCharge / static_cast<float>(item.getClass().getItemMaxHealth(item)) * 100);
|
||||||
mHud->setSelectedWeapon(item, durabilityPercent);
|
mHud->setSelectedWeapon(item, durabilityPercent);
|
||||||
mInventoryWindow->setTitle(MWWorld::Class::get(item).getName(item));
|
mInventoryWindow->setTitle(item.getClass().getName(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowManager::unsetSelectedSpell()
|
void WindowManager::unsetSelectedSpell()
|
||||||
|
|
|
@ -172,7 +172,7 @@ namespace MWInput
|
||||||
|
|
||||||
if (action == A_Use)
|
if (action == A_Use)
|
||||||
{
|
{
|
||||||
MWWorld::Class::get(mPlayer->getPlayer()).getCreatureStats(mPlayer->getPlayer()).setAttackingOrSpell(currentValue);
|
mPlayer->getPlayer().getClass().getCreatureStats(mPlayer->getPlayer()).setAttackingOrSpell(currentValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentValue == 1)
|
if (currentValue == 1)
|
||||||
|
@ -359,7 +359,7 @@ namespace MWInput
|
||||||
{
|
{
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
||||||
mOverencumberedMessageDelay -= dt;
|
mOverencumberedMessageDelay -= dt;
|
||||||
if (MWWorld::Class::get(player).getEncumbrance(player) >= MWWorld::Class::get(player).getCapacity(player))
|
if (player.getClass().getEncumbrance(player) >= player.getClass().getCapacity(player))
|
||||||
{
|
{
|
||||||
mPlayer->setAutoMove (false);
|
mPlayer->setAutoMove (false);
|
||||||
if (mOverencumberedMessageDelay <= 0)
|
if (mOverencumberedMessageDelay <= 0)
|
||||||
|
@ -664,7 +664,7 @@ namespace MWInput
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Not allowed if no spell selected
|
// Not allowed if no spell selected
|
||||||
MWWorld::InventoryStore& inventory = MWWorld::Class::get(mPlayer->getPlayer()).getInventoryStore(mPlayer->getPlayer());
|
MWWorld::InventoryStore& inventory = mPlayer->getPlayer().getClass().getInventoryStore(mPlayer->getPlayer());
|
||||||
if (MWBase::Environment::get().getWindowManager()->getSelectedSpell().empty() &&
|
if (MWBase::Environment::get().getWindowManager()->getSelectedSpell().empty() &&
|
||||||
inventory.getSelectedEnchantItem() == inventory.end())
|
inventory.getSelectedEnchantItem() == inventory.end())
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -187,7 +187,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
void Actors::engageCombat (const MWWorld::Ptr& actor1, const MWWorld::Ptr& actor2, bool againstPlayer)
|
void Actors::engageCombat (const MWWorld::Ptr& actor1, const MWWorld::Ptr& actor2, bool againstPlayer)
|
||||||
{
|
{
|
||||||
CreatureStats& creatureStats = MWWorld::Class::get(actor1).getCreatureStats(actor1);
|
CreatureStats& creatureStats = actor1.getClass().getCreatureStats(actor1);
|
||||||
|
|
||||||
if (againstPlayer && creatureStats.isHostile()) return; // already fighting against player
|
if (againstPlayer && creatureStats.isHostile()) return; // already fighting against player
|
||||||
|
|
||||||
|
@ -244,13 +244,13 @@ namespace MWMechanics
|
||||||
|
|
||||||
void Actors::adjustMagicEffects (const MWWorld::Ptr& creature)
|
void Actors::adjustMagicEffects (const MWWorld::Ptr& creature)
|
||||||
{
|
{
|
||||||
CreatureStats& creatureStats = MWWorld::Class::get (creature).getCreatureStats (creature);
|
CreatureStats& creatureStats = creature.getClass().getCreatureStats (creature);
|
||||||
|
|
||||||
MagicEffects now = creatureStats.getSpells().getMagicEffects();
|
MagicEffects now = creatureStats.getSpells().getMagicEffects();
|
||||||
|
|
||||||
if (creature.getTypeName()==typeid (ESM::NPC).name())
|
if (creature.getTypeName()==typeid (ESM::NPC).name())
|
||||||
{
|
{
|
||||||
MWWorld::InventoryStore& store = MWWorld::Class::get (creature).getInventoryStore (creature);
|
MWWorld::InventoryStore& store = creature.getClass().getInventoryStore (creature);
|
||||||
now += store.getMagicEffects();
|
now += store.getMagicEffects();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
void Actors::calculateDynamicStats (const MWWorld::Ptr& ptr)
|
void Actors::calculateDynamicStats (const MWWorld::Ptr& ptr)
|
||||||
{
|
{
|
||||||
CreatureStats& creatureStats = MWWorld::Class::get (ptr).getCreatureStats (ptr);
|
CreatureStats& creatureStats = ptr.getClass().getCreatureStats (ptr);
|
||||||
|
|
||||||
int strength = creatureStats.getAttribute(ESM::Attribute::Strength).getBase();
|
int strength = creatureStats.getAttribute(ESM::Attribute::Strength).getBase();
|
||||||
int intelligence = creatureStats.getAttribute(ESM::Attribute::Intelligence).getBase();
|
int intelligence = creatureStats.getAttribute(ESM::Attribute::Intelligence).getBase();
|
||||||
|
@ -333,7 +333,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
void Actors::calculateCreatureStatModifiers (const MWWorld::Ptr& ptr, float duration)
|
void Actors::calculateCreatureStatModifiers (const MWWorld::Ptr& ptr, float duration)
|
||||||
{
|
{
|
||||||
CreatureStats &creatureStats = MWWorld::Class::get(ptr).getCreatureStats(ptr);
|
CreatureStats &creatureStats = ptr.getClass().getCreatureStats(ptr);
|
||||||
const MagicEffects &effects = creatureStats.getMagicEffects();
|
const MagicEffects &effects = creatureStats.getMagicEffects();
|
||||||
|
|
||||||
// attributes
|
// attributes
|
||||||
|
@ -600,7 +600,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
void Actors::calculateNpcStatModifiers (const MWWorld::Ptr& ptr)
|
void Actors::calculateNpcStatModifiers (const MWWorld::Ptr& ptr)
|
||||||
{
|
{
|
||||||
NpcStats &npcStats = MWWorld::Class::get(ptr).getNpcStats(ptr);
|
NpcStats &npcStats = ptr.getClass().getNpcStats(ptr);
|
||||||
const MagicEffects &effects = npcStats.getMagicEffects();
|
const MagicEffects &effects = npcStats.getMagicEffects();
|
||||||
|
|
||||||
// skills
|
// skills
|
||||||
|
@ -656,7 +656,7 @@ namespace MWMechanics
|
||||||
{
|
{
|
||||||
bool isPlayer = ptr.getRefData().getHandle()=="player";
|
bool isPlayer = ptr.getRefData().getHandle()=="player";
|
||||||
|
|
||||||
MWWorld::InventoryStore &inventoryStore = MWWorld::Class::get(ptr).getInventoryStore(ptr);
|
MWWorld::InventoryStore &inventoryStore = ptr.getClass().getInventoryStore(ptr);
|
||||||
MWWorld::ContainerStoreIterator heldIter =
|
MWWorld::ContainerStoreIterator heldIter =
|
||||||
inventoryStore.getSlot(MWWorld::InventoryStore::Slot_CarriedLeft);
|
inventoryStore.getSlot(MWWorld::InventoryStore::Slot_CarriedLeft);
|
||||||
/**
|
/**
|
||||||
|
@ -678,7 +678,7 @@ namespace MWMechanics
|
||||||
{
|
{
|
||||||
if (torch != inventoryStore.end())
|
if (torch != inventoryStore.end())
|
||||||
{
|
{
|
||||||
if (!MWWorld::Class::get (ptr).getCreatureStats (ptr).isHostile())
|
if (!ptr.getClass().getCreatureStats (ptr).isHostile())
|
||||||
{
|
{
|
||||||
// For non-hostile NPCs, unequip whatever is in the left slot in favor of a light.
|
// For non-hostile NPCs, unequip whatever is in the left slot in favor of a light.
|
||||||
if (heldIter != inventoryStore.end() && heldIter->getTypeName() != typeid(ESM::Light).name())
|
if (heldIter != inventoryStore.end() && heldIter->getTypeName() != typeid(ESM::Light).name())
|
||||||
|
@ -755,8 +755,8 @@ namespace MWMechanics
|
||||||
if (ptr != player && ptr.getClass().isNpc())
|
if (ptr != player && ptr.getClass().isNpc())
|
||||||
{
|
{
|
||||||
// get stats of witness
|
// get stats of witness
|
||||||
CreatureStats& creatureStats = MWWorld::Class::get(ptr).getCreatureStats(ptr);
|
CreatureStats& creatureStats = ptr.getClass().getCreatureStats(ptr);
|
||||||
NpcStats& npcStats = MWWorld::Class::get(ptr).getNpcStats(ptr);
|
NpcStats& npcStats = ptr.getClass().getNpcStats(ptr);
|
||||||
|
|
||||||
if (ptr.getClass().isClass(ptr, "Guard") && creatureStats.getAiSequence().getTypeId() != AiPackage::TypeIdPursue && !creatureStats.isHostile())
|
if (ptr.getClass().isClass(ptr, "Guard") && creatureStats.getAiSequence().getTypeId() != AiPackage::TypeIdPursue && !creatureStats.isHostile())
|
||||||
{
|
{
|
||||||
|
@ -824,7 +824,7 @@ namespace MWMechanics
|
||||||
void Actors::addActor (const MWWorld::Ptr& ptr, bool updateImmediately)
|
void Actors::addActor (const MWWorld::Ptr& ptr, bool updateImmediately)
|
||||||
{
|
{
|
||||||
// erase previous death events since we are currently only tracking them while in an active cell
|
// erase previous death events since we are currently only tracking them while in an active cell
|
||||||
MWWorld::Class::get(ptr).getCreatureStats(ptr).clearHasDied();
|
ptr.getClass().getCreatureStats(ptr).clearHasDied();
|
||||||
|
|
||||||
removeActor(ptr);
|
removeActor(ptr);
|
||||||
|
|
||||||
|
@ -964,7 +964,7 @@ namespace MWMechanics
|
||||||
// Kill dead actors, update some variables
|
// Kill dead actors, update some variables
|
||||||
for(PtrControllerMap::iterator iter(mActors.begin()); iter != mActors.end(); ++iter)
|
for(PtrControllerMap::iterator iter(mActors.begin()); iter != mActors.end(); ++iter)
|
||||||
{
|
{
|
||||||
const MWWorld::Class &cls = MWWorld::Class::get(iter->first);
|
const MWWorld::Class &cls = iter->first.getClass();
|
||||||
CreatureStats &stats = cls.getCreatureStats(iter->first);
|
CreatureStats &stats = cls.getCreatureStats(iter->first);
|
||||||
|
|
||||||
//KnockedOutOneFrameLogic
|
//KnockedOutOneFrameLogic
|
||||||
|
@ -1137,7 +1137,7 @@ namespace MWMechanics
|
||||||
std::list<MWWorld::Ptr> list;
|
std::list<MWWorld::Ptr> list;
|
||||||
for(PtrControllerMap::iterator iter(mActors.begin());iter != mActors.end();iter++)
|
for(PtrControllerMap::iterator iter(mActors.begin());iter != mActors.end();iter++)
|
||||||
{
|
{
|
||||||
const MWWorld::Class &cls = MWWorld::Class::get(iter->first);
|
const MWWorld::Class &cls = iter->first.getClass();
|
||||||
CreatureStats &stats = cls.getCreatureStats(iter->first);
|
CreatureStats &stats = cls.getCreatureStats(iter->first);
|
||||||
if(!stats.isDead() && stats.getAiSequence().getTypeId() == AiPackage::TypeIdFollow)
|
if(!stats.isDead() && stats.getAiSequence().getTypeId() == AiPackage::TypeIdFollow)
|
||||||
{
|
{
|
||||||
|
@ -1158,7 +1158,7 @@ namespace MWMechanics
|
||||||
neighbors); //only care about those within the alarm disance
|
neighbors); //only care about those within the alarm disance
|
||||||
for(std::vector<MWWorld::Ptr>::iterator iter(neighbors.begin());iter != neighbors.end();iter++)
|
for(std::vector<MWWorld::Ptr>::iterator iter(neighbors.begin());iter != neighbors.end();iter++)
|
||||||
{
|
{
|
||||||
const MWWorld::Class &cls = MWWorld::Class::get(*iter);
|
const MWWorld::Class &cls = iter->getClass();
|
||||||
CreatureStats &stats = cls.getCreatureStats(*iter);
|
CreatureStats &stats = cls.getCreatureStats(*iter);
|
||||||
if(!stats.isDead() && stats.getAiSequence().getTypeId() == AiPackage::TypeIdCombat)
|
if(!stats.isDead() && stats.getAiSequence().getTypeId() == AiPackage::TypeIdCombat)
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,7 +32,7 @@ bool MWMechanics::AiActivate::execute (const MWWorld::Ptr& actor,float duration)
|
||||||
if(distance(dest, pos.pos[0], pos.pos[1], pos.pos[2]) < 200) { //Stop when you get close
|
if(distance(dest, pos.pos[0], pos.pos[1], pos.pos[2]) < 200) { //Stop when you get close
|
||||||
actor.getClass().getMovementSettings(actor).mPosition[1] = 0;
|
actor.getClass().getMovementSettings(actor).mPosition[1] = 0;
|
||||||
MWWorld::Ptr target = MWBase::Environment::get().getWorld()->getPtr(mObjectId,false);
|
MWWorld::Ptr target = MWBase::Environment::get().getWorld()->getPtr(mObjectId,false);
|
||||||
MWWorld::Class::get(target).activate(target,actor).get()->execute(actor); //Arrest player
|
target.getClass().activate(target,actor).get()->execute(actor); //Arrest player
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -63,7 +63,7 @@ bool MWMechanics::AiAvoidDoor::execute (const MWWorld::Ptr& actor,float duration
|
||||||
MWBase::Environment::get().getMechanicsManager()->getActorsInRange(Ogre::Vector3(pos.pos[0],pos.pos[1],pos.pos[2]),100,actors);
|
MWBase::Environment::get().getMechanicsManager()->getActorsInRange(Ogre::Vector3(pos.pos[0],pos.pos[1],pos.pos[2]),100,actors);
|
||||||
for(std::vector<MWWorld::Ptr>::iterator it = actors.begin(); it != actors.end(); it++) {
|
for(std::vector<MWWorld::Ptr>::iterator it = actors.begin(); it != actors.end(); it++) {
|
||||||
if(*it != MWBase::Environment::get().getWorld()->getPlayerPtr()) { //Not the player
|
if(*it != MWBase::Environment::get().getWorld()->getPlayerPtr()) { //Not the player
|
||||||
MWMechanics::AiSequence& seq = MWWorld::Class::get(*it).getCreatureStats(*it).getAiSequence();
|
MWMechanics::AiSequence& seq = it->getClass().getCreatureStats(*it).getAiSequence();
|
||||||
if(seq.getTypeId() != MWMechanics::AiPackage::TypeIdAvoidDoor) { //Only add it once
|
if(seq.getTypeId() != MWMechanics::AiPackage::TypeIdAvoidDoor) { //Only add it once
|
||||||
seq.stack(MWMechanics::AiAvoidDoor(mDoorPtr),*it);
|
seq.stack(MWMechanics::AiAvoidDoor(mDoorPtr),*it);
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@ namespace MWMechanics
|
||||||
{
|
{
|
||||||
// Stop moving if the player is to far away
|
// Stop moving if the player is to far away
|
||||||
MWBase::Environment::get().getMechanicsManager()->playAnimationGroup(actor, "idle3", 0, 1);
|
MWBase::Environment::get().getMechanicsManager()->playAnimationGroup(actor, "idle3", 0, 1);
|
||||||
MWWorld::Class::get(actor).getMovementSettings(actor).mPosition[1] = 0;
|
actor.getClass().getMovementSettings(actor).mPosition[1] = 0;
|
||||||
mMaxDist = 330;
|
mMaxDist = 330;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -572,7 +572,7 @@ namespace MWMechanics
|
||||||
void AiWander::stopWalking(const MWWorld::Ptr& actor)
|
void AiWander::stopWalking(const MWWorld::Ptr& actor)
|
||||||
{
|
{
|
||||||
mPathFinder.clearPath();
|
mPathFinder.clearPath();
|
||||||
MWWorld::Class::get(actor).getMovementSettings(actor).mPosition[1] = 0;
|
actor.getClass().getMovementSettings(actor).mPosition[1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AiWander::playIdle(const MWWorld::Ptr& actor, unsigned short idleSelect)
|
void AiWander::playIdle(const MWWorld::Ptr& actor, unsigned short idleSelect)
|
||||||
|
|
|
@ -292,13 +292,13 @@ void MWMechanics::Alchemy::addPotion (const std::string& name)
|
||||||
|
|
||||||
void MWMechanics::Alchemy::increaseSkill()
|
void MWMechanics::Alchemy::increaseSkill()
|
||||||
{
|
{
|
||||||
MWWorld::Class::get (mAlchemist).skillUsageSucceeded (mAlchemist, ESM::Skill::Alchemy, 0);
|
mAlchemist.getClass().skillUsageSucceeded (mAlchemist, ESM::Skill::Alchemy, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
float MWMechanics::Alchemy::getChance() const
|
float MWMechanics::Alchemy::getChance() const
|
||||||
{
|
{
|
||||||
const CreatureStats& creatureStats = MWWorld::Class::get (mAlchemist).getCreatureStats (mAlchemist);
|
const CreatureStats& creatureStats = mAlchemist.getClass().getCreatureStats (mAlchemist);
|
||||||
const NpcStats& npcStats = MWWorld::Class::get (mAlchemist).getNpcStats (mAlchemist);
|
const NpcStats& npcStats = mAlchemist.getClass().getNpcStats (mAlchemist);
|
||||||
|
|
||||||
return
|
return
|
||||||
(npcStats.getSkill (ESM::Skill::Alchemy).getModified() +
|
(npcStats.getSkill (ESM::Skill::Alchemy).getModified() +
|
||||||
|
@ -331,7 +331,7 @@ void MWMechanics::Alchemy::setAlchemist (const MWWorld::Ptr& npc)
|
||||||
|
|
||||||
mEffects.clear();
|
mEffects.clear();
|
||||||
|
|
||||||
MWWorld::ContainerStore& store = MWWorld::Class::get (npc).getContainerStore (npc);
|
MWWorld::ContainerStore& store = npc.getClass().getContainerStore (npc);
|
||||||
|
|
||||||
for (MWWorld::ContainerStoreIterator iter (store.begin (MWWorld::ContainerStore::Type_Apparatus));
|
for (MWWorld::ContainerStoreIterator iter (store.begin (MWWorld::ContainerStore::Type_Apparatus));
|
||||||
iter!=store.end(); ++iter)
|
iter!=store.end(); ++iter)
|
||||||
|
|
|
@ -459,7 +459,7 @@ CharacterController::CharacterController(const MWWorld::Ptr &ptr, MWRender::Anim
|
||||||
if(!mAnimation)
|
if(!mAnimation)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const MWWorld::Class &cls = MWWorld::Class::get(mPtr);
|
const MWWorld::Class &cls = mPtr.getClass();
|
||||||
if(cls.isActor())
|
if(cls.isActor())
|
||||||
{
|
{
|
||||||
/* Accumulate along X/Y only for now, until we can figure out how we should
|
/* Accumulate along X/Y only for now, until we can figure out how we should
|
||||||
|
@ -549,7 +549,7 @@ bool CharacterController::updateCreatureState()
|
||||||
|
|
||||||
bool CharacterController::updateWeaponState()
|
bool CharacterController::updateWeaponState()
|
||||||
{
|
{
|
||||||
const MWWorld::Class &cls = MWWorld::Class::get(mPtr);
|
const MWWorld::Class &cls = mPtr.getClass();
|
||||||
CreatureStats &stats = cls.getCreatureStats(mPtr);
|
CreatureStats &stats = cls.getCreatureStats(mPtr);
|
||||||
WeaponType weaptype = WeapType_None;
|
WeaponType weaptype = WeapType_None;
|
||||||
MWWorld::InventoryStore &inv = cls.getInventoryStore(mPtr);
|
MWWorld::InventoryStore &inv = cls.getInventoryStore(mPtr);
|
||||||
|
@ -601,8 +601,8 @@ bool CharacterController::updateWeaponState()
|
||||||
if(weapon != inv.end() && !(weaptype == WeapType_None && mWeaponType == WeapType_Spell))
|
if(weapon != inv.end() && !(weaptype == WeapType_None && mWeaponType == WeapType_Spell))
|
||||||
{
|
{
|
||||||
std::string soundid = (weaptype == WeapType_None) ?
|
std::string soundid = (weaptype == WeapType_None) ?
|
||||||
MWWorld::Class::get(*weapon).getDownSoundId(*weapon) :
|
weapon->getClass().getDownSoundId(*weapon) :
|
||||||
MWWorld::Class::get(*weapon).getUpSoundId(*weapon);
|
weapon->getClass().getUpSoundId(*weapon);
|
||||||
if(!soundid.empty())
|
if(!soundid.empty())
|
||||||
{
|
{
|
||||||
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
||||||
|
@ -983,7 +983,7 @@ bool CharacterController::updateWeaponState()
|
||||||
void CharacterController::update(float duration)
|
void CharacterController::update(float duration)
|
||||||
{
|
{
|
||||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
const MWWorld::Class &cls = MWWorld::Class::get(mPtr);
|
const MWWorld::Class &cls = mPtr.getClass();
|
||||||
Ogre::Vector3 movement(0.0f);
|
Ogre::Vector3 movement(0.0f);
|
||||||
|
|
||||||
updateVisibility();
|
updateVisibility();
|
||||||
|
|
|
@ -52,7 +52,7 @@ namespace MWMechanics
|
||||||
bool Enchanting::create()
|
bool Enchanting::create()
|
||||||
{
|
{
|
||||||
const MWWorld::Ptr& player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
const MWWorld::Ptr& player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
MWWorld::ContainerStore& store = MWWorld::Class::get(player).getContainerStore(player);
|
MWWorld::ContainerStore& store = player.getClass().getContainerStore(player);
|
||||||
ESM::Enchantment enchantment;
|
ESM::Enchantment enchantment;
|
||||||
enchantment.mData.mCharge = getGemCharge();
|
enchantment.mData.mCharge = getGemCharge();
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ namespace MWMechanics
|
||||||
if(getEnchantChance()<std::rand()/static_cast<double> (RAND_MAX)*100)
|
if(getEnchantChance()<std::rand()/static_cast<double> (RAND_MAX)*100)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
MWWorld::Class::get (mEnchanter).skillUsageSucceeded (mEnchanter, ESM::Skill::Enchant, 2);
|
mEnchanter.getClass().skillUsageSucceeded (mEnchanter, ESM::Skill::Enchant, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mCastStyle==ESM::Enchantment::ConstantEffect)
|
if(mCastStyle==ESM::Enchantment::ConstantEffect)
|
||||||
|
@ -84,7 +84,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
// Apply the enchantment
|
// Apply the enchantment
|
||||||
const ESM::Enchantment *enchantmentPtr = MWBase::Environment::get().getWorld()->createRecord (enchantment);
|
const ESM::Enchantment *enchantmentPtr = MWBase::Environment::get().getWorld()->createRecord (enchantment);
|
||||||
MWWorld::Class::get(newItemPtr).applyEnchantment(newItemPtr, enchantmentPtr->mId, getGemCharge(), mNewItemName);
|
newItemPtr.getClass().applyEnchantment(newItemPtr, enchantmentPtr->mId, getGemCharge(), mNewItemName);
|
||||||
|
|
||||||
// Add the new item to player inventory and remove the old one
|
// Add the new item to player inventory and remove the old one
|
||||||
store.remove(mOldItemPtr, 1, player);
|
store.remove(mOldItemPtr, 1, player);
|
||||||
|
@ -212,7 +212,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
const float enchantCost = getEnchantPoints();
|
const float enchantCost = getEnchantPoints();
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
MWMechanics::NpcStats &stats = MWWorld::Class::get(player).getNpcStats(player);
|
MWMechanics::NpcStats &stats = player.getClass().getNpcStats(player);
|
||||||
int eSkill = stats.getSkill(ESM::Skill::Enchant).getModified();
|
int eSkill = stats.getSkill(ESM::Skill::Enchant).getModified();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -277,7 +277,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
float Enchanting::getEnchantChance() const
|
float Enchanting::getEnchantChance() const
|
||||||
{
|
{
|
||||||
const NpcStats& npcStats = MWWorld::Class::get (mEnchanter).getNpcStats (mEnchanter);
|
const NpcStats& npcStats = mEnchanter.getClass().getNpcStats (mEnchanter);
|
||||||
|
|
||||||
float chance1 = (npcStats.getSkill (ESM::Skill::Enchant).getModified() +
|
float chance1 = (npcStats.getSkill (ESM::Skill::Enchant).getModified() +
|
||||||
(0.25 * npcStats.getAttribute (ESM::Attribute::Intelligence).getModified())
|
(0.25 * npcStats.getAttribute (ESM::Attribute::Intelligence).getModified())
|
||||||
|
@ -295,7 +295,7 @@ namespace MWMechanics
|
||||||
void Enchanting::payForEnchantment() const
|
void Enchanting::payForEnchantment() const
|
||||||
{
|
{
|
||||||
const MWWorld::Ptr& player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
const MWWorld::Ptr& player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
MWWorld::ContainerStore& store = MWWorld::Class::get(player).getContainerStore(player);
|
MWWorld::ContainerStore& store = player.getClass().getContainerStore(player);
|
||||||
|
|
||||||
store.remove(MWWorld::ContainerStore::sGoldId, getEnchantPrice(), player);
|
store.remove(MWWorld::ContainerStore::sGoldId, getEnchantPrice(), player);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,8 +49,8 @@ namespace MWMechanics
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
|
|
||||||
MWMechanics::CreatureStats& creatureStats = MWWorld::Class::get (ptr).getCreatureStats (ptr);
|
MWMechanics::CreatureStats& creatureStats = ptr.getClass().getCreatureStats (ptr);
|
||||||
MWMechanics::NpcStats& npcStats = MWWorld::Class::get (ptr).getNpcStats (ptr);
|
MWMechanics::NpcStats& npcStats = ptr.getClass().getNpcStats (ptr);
|
||||||
|
|
||||||
const ESM::NPC *player = ptr.get<ESM::NPC>()->mBase;
|
const ESM::NPC *player = ptr.get<ESM::NPC>()->mBase;
|
||||||
|
|
||||||
|
@ -215,7 +215,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
void MechanicsManager::add(const MWWorld::Ptr& ptr)
|
void MechanicsManager::add(const MWWorld::Ptr& ptr)
|
||||||
{
|
{
|
||||||
if(MWWorld::Class::get(ptr).isActor())
|
if(ptr.getClass().isActor())
|
||||||
mActors.addActor(ptr);
|
mActors.addActor(ptr);
|
||||||
else
|
else
|
||||||
mObjects.addObject(ptr);
|
mObjects.addObject(ptr);
|
||||||
|
@ -234,7 +234,7 @@ namespace MWMechanics
|
||||||
if(old == mWatched)
|
if(old == mWatched)
|
||||||
mWatched = ptr;
|
mWatched = ptr;
|
||||||
|
|
||||||
if(MWWorld::Class::get(ptr).isActor())
|
if(ptr.getClass().isActor())
|
||||||
mActors.updateActor(old, ptr);
|
mActors.updateActor(old, ptr);
|
||||||
else
|
else
|
||||||
mObjects.updateObject(old, ptr);
|
mObjects.updateObject(old, ptr);
|
||||||
|
@ -475,13 +475,13 @@ namespace MWMechanics
|
||||||
|
|
||||||
int MechanicsManager::getDerivedDisposition(const MWWorld::Ptr& ptr)
|
int MechanicsManager::getDerivedDisposition(const MWWorld::Ptr& ptr)
|
||||||
{
|
{
|
||||||
const MWMechanics::NpcStats& npcSkill = MWWorld::Class::get(ptr).getNpcStats(ptr);
|
const MWMechanics::NpcStats& npcSkill = ptr.getClass().getNpcStats(ptr);
|
||||||
float x = npcSkill.getBaseDisposition();
|
float x = npcSkill.getBaseDisposition();
|
||||||
|
|
||||||
MWWorld::LiveCellRef<ESM::NPC>* npc = ptr.get<ESM::NPC>();
|
MWWorld::LiveCellRef<ESM::NPC>* npc = ptr.get<ESM::NPC>();
|
||||||
MWWorld::Ptr playerPtr = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr playerPtr = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
MWWorld::LiveCellRef<ESM::NPC>* player = playerPtr.get<ESM::NPC>();
|
MWWorld::LiveCellRef<ESM::NPC>* player = playerPtr.get<ESM::NPC>();
|
||||||
const MWMechanics::NpcStats &playerStats = MWWorld::Class::get(playerPtr).getNpcStats(playerPtr);
|
const MWMechanics::NpcStats &playerStats = playerPtr.getClass().getNpcStats(playerPtr);
|
||||||
|
|
||||||
if (Misc::StringUtils::ciEqual(npc->mBase->mRace, player->mBase->mRace))
|
if (Misc::StringUtils::ciEqual(npc->mBase->mRace, player->mBase->mRace))
|
||||||
x += MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fDispRaceMod")->getFloat();
|
x += MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fDispRaceMod")->getFloat();
|
||||||
|
@ -547,10 +547,10 @@ namespace MWMechanics
|
||||||
if (ptr.getTypeName() == typeid(ESM::Creature).name())
|
if (ptr.getTypeName() == typeid(ESM::Creature).name())
|
||||||
return basePrice;
|
return basePrice;
|
||||||
|
|
||||||
const MWMechanics::NpcStats &sellerStats = MWWorld::Class::get(ptr).getNpcStats(ptr);
|
const MWMechanics::NpcStats &sellerStats = ptr.getClass().getNpcStats(ptr);
|
||||||
|
|
||||||
MWWorld::Ptr playerPtr = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr playerPtr = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
const MWMechanics::NpcStats &playerStats = MWWorld::Class::get(playerPtr).getNpcStats(playerPtr);
|
const MWMechanics::NpcStats &playerStats = playerPtr.getClass().getNpcStats(playerPtr);
|
||||||
|
|
||||||
// I suppose the temporary disposition change _has_ to be considered here,
|
// I suppose the temporary disposition change _has_ to be considered here,
|
||||||
// otherwise one would get different prices when exiting and re-entering the dialogue window...
|
// otherwise one would get different prices when exiting and re-entering the dialogue window...
|
||||||
|
@ -592,10 +592,10 @@ namespace MWMechanics
|
||||||
const MWWorld::Store<ESM::GameSetting> &gmst =
|
const MWWorld::Store<ESM::GameSetting> &gmst =
|
||||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
||||||
|
|
||||||
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(npc).getNpcStats(npc);
|
MWMechanics::NpcStats& npcStats = npc.getClass().getNpcStats(npc);
|
||||||
|
|
||||||
MWWorld::Ptr playerPtr = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr playerPtr = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
const MWMechanics::NpcStats &playerStats = MWWorld::Class::get(playerPtr).getNpcStats(playerPtr);
|
const MWMechanics::NpcStats &playerStats = playerPtr.getClass().getNpcStats(playerPtr);
|
||||||
|
|
||||||
float persTerm = playerStats.getAttribute(ESM::Attribute::Personality).getModified()
|
float persTerm = playerStats.getAttribute(ESM::Attribute::Personality).getModified()
|
||||||
/ gmst.find("fPersonalityMod")->getFloat();
|
/ gmst.find("fPersonalityMod")->getFloat();
|
||||||
|
@ -741,27 +741,27 @@ namespace MWMechanics
|
||||||
|
|
||||||
void MechanicsManager::forceStateUpdate(const MWWorld::Ptr &ptr)
|
void MechanicsManager::forceStateUpdate(const MWWorld::Ptr &ptr)
|
||||||
{
|
{
|
||||||
if(MWWorld::Class::get(ptr).isActor())
|
if(ptr.getClass().isActor())
|
||||||
mActors.forceStateUpdate(ptr);
|
mActors.forceStateUpdate(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MechanicsManager::playAnimationGroup(const MWWorld::Ptr& ptr, const std::string& groupName, int mode, int number)
|
void MechanicsManager::playAnimationGroup(const MWWorld::Ptr& ptr, const std::string& groupName, int mode, int number)
|
||||||
{
|
{
|
||||||
if(MWWorld::Class::get(ptr).isActor())
|
if(ptr.getClass().isActor())
|
||||||
mActors.playAnimationGroup(ptr, groupName, mode, number);
|
mActors.playAnimationGroup(ptr, groupName, mode, number);
|
||||||
else
|
else
|
||||||
mObjects.playAnimationGroup(ptr, groupName, mode, number);
|
mObjects.playAnimationGroup(ptr, groupName, mode, number);
|
||||||
}
|
}
|
||||||
void MechanicsManager::skipAnimation(const MWWorld::Ptr& ptr)
|
void MechanicsManager::skipAnimation(const MWWorld::Ptr& ptr)
|
||||||
{
|
{
|
||||||
if(MWWorld::Class::get(ptr).isActor())
|
if(ptr.getClass().isActor())
|
||||||
mActors.skipAnimation(ptr);
|
mActors.skipAnimation(ptr);
|
||||||
else
|
else
|
||||||
mObjects.skipAnimation(ptr);
|
mObjects.skipAnimation(ptr);
|
||||||
}
|
}
|
||||||
bool MechanicsManager::checkAnimationPlaying(const MWWorld::Ptr& ptr, const std::string &groupName)
|
bool MechanicsManager::checkAnimationPlaying(const MWWorld::Ptr& ptr, const std::string &groupName)
|
||||||
{
|
{
|
||||||
if(MWWorld::Class::get(ptr).isActor())
|
if(ptr.getClass().isActor())
|
||||||
return mActors.checkAnimationPlaying(ptr, groupName);
|
return mActors.checkAnimationPlaying(ptr, groupName);
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -31,8 +31,8 @@ void Repair::repair(const MWWorld::Ptr &itemToRepair)
|
||||||
int uses = (mTool.getCellRef().mCharge != -1) ? mTool.getCellRef().mCharge : ref->mBase->mData.mUses;
|
int uses = (mTool.getCellRef().mCharge != -1) ? mTool.getCellRef().mCharge : ref->mBase->mData.mUses;
|
||||||
mTool.getCellRef().mCharge = uses-1;
|
mTool.getCellRef().mCharge = uses-1;
|
||||||
|
|
||||||
MWMechanics::CreatureStats& stats = MWWorld::Class::get(player).getCreatureStats(player);
|
MWMechanics::CreatureStats& stats = player.getClass().getCreatureStats(player);
|
||||||
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(player).getNpcStats(player);
|
MWMechanics::NpcStats& npcStats = player.getClass().getNpcStats(player);
|
||||||
|
|
||||||
float fatigueTerm = stats.getFatigueTerm();
|
float fatigueTerm = stats.getFatigueTerm();
|
||||||
int pcStrength = stats.getAttribute(ESM::Attribute::Strength).getModified();
|
int pcStrength = stats.getAttribute(ESM::Attribute::Strength).getModified();
|
||||||
|
@ -55,15 +55,15 @@ void Repair::repair(const MWWorld::Ptr &itemToRepair)
|
||||||
// repair by 'y' points
|
// repair by 'y' points
|
||||||
itemToRepair.getCellRef().mCharge += y;
|
itemToRepair.getCellRef().mCharge += y;
|
||||||
itemToRepair.getCellRef().mCharge = std::min(itemToRepair.getCellRef().mCharge,
|
itemToRepair.getCellRef().mCharge = std::min(itemToRepair.getCellRef().mCharge,
|
||||||
MWWorld::Class::get(itemToRepair).getItemMaxHealth(itemToRepair));
|
itemToRepair.getClass().getItemMaxHealth(itemToRepair));
|
||||||
|
|
||||||
// set the OnPCRepair variable on the item's script
|
// set the OnPCRepair variable on the item's script
|
||||||
std::string script = MWWorld::Class::get(itemToRepair).getScript(itemToRepair);
|
std::string script = itemToRepair.getClass().getScript(itemToRepair);
|
||||||
if(script != "")
|
if(script != "")
|
||||||
itemToRepair.getRefData().getLocals().setVarByInt(script, "onpcrepair", 1);
|
itemToRepair.getRefData().getLocals().setVarByInt(script, "onpcrepair", 1);
|
||||||
|
|
||||||
// increase skill
|
// increase skill
|
||||||
MWWorld::Class::get(player).skillUsageSucceeded(player, ESM::Skill::Armorer, 0);
|
player.getClass().skillUsageSucceeded(player, ESM::Skill::Armorer, 0);
|
||||||
|
|
||||||
MWBase::Environment::get().getSoundManager()->playSound("Repair",1,1);
|
MWBase::Environment::get().getSoundManager()->playSound("Repair",1,1);
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sRepairSuccess}");
|
MWBase::Environment::get().getWindowManager()->messageBox("#{sRepairSuccess}");
|
||||||
|
@ -78,14 +78,14 @@ void Repair::repair(const MWWorld::Ptr &itemToRepair)
|
||||||
if (mTool.getCellRef().mCharge == 0)
|
if (mTool.getCellRef().mCharge == 0)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
MWWorld::ContainerStore& store = MWWorld::Class::get(player).getContainerStore(player);
|
MWWorld::ContainerStore& store = player.getClass().getContainerStore(player);
|
||||||
|
|
||||||
store.remove(mTool, 1, player);
|
store.remove(mTool, 1, player);
|
||||||
|
|
||||||
std::string message = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
|
std::string message = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
|
||||||
.find("sNotifyMessage51")->getString();
|
.find("sNotifyMessage51")->getString();
|
||||||
|
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox((boost::format(message) % MWWorld::Class::get(mTool).getName(mTool)).str());
|
MWBase::Environment::get().getWindowManager()->messageBox((boost::format(message) % mTool.getClass().getName(mTool)).str());
|
||||||
|
|
||||||
// try to find a new tool of the same ID
|
// try to find a new tool of the same ID
|
||||||
for (MWWorld::ContainerStoreIterator iter (store.begin());
|
for (MWWorld::ContainerStoreIterator iter (store.begin());
|
||||||
|
|
|
@ -18,8 +18,8 @@ namespace MWMechanics
|
||||||
Security::Security(const MWWorld::Ptr &actor)
|
Security::Security(const MWWorld::Ptr &actor)
|
||||||
: mActor(actor)
|
: mActor(actor)
|
||||||
{
|
{
|
||||||
CreatureStats& creatureStats = MWWorld::Class::get(actor).getCreatureStats(actor);
|
CreatureStats& creatureStats = actor.getClass().getCreatureStats(actor);
|
||||||
NpcStats& npcStats = MWWorld::Class::get(actor).getNpcStats(actor);
|
NpcStats& npcStats = actor.getClass().getNpcStats(actor);
|
||||||
mAgility = creatureStats.getAttribute(ESM::Attribute::Agility).getModified();
|
mAgility = creatureStats.getAttribute(ESM::Attribute::Agility).getModified();
|
||||||
mLuck = creatureStats.getAttribute(ESM::Attribute::Luck).getModified();
|
mLuck = creatureStats.getAttribute(ESM::Attribute::Luck).getModified();
|
||||||
mSecuritySkill = npcStats.getSkill(ESM::Skill::Security).getModified();
|
mSecuritySkill = npcStats.getSkill(ESM::Skill::Security).getModified();
|
||||||
|
@ -51,10 +51,10 @@ namespace MWMechanics
|
||||||
int roll = static_cast<float> (std::rand()) / RAND_MAX * 100;
|
int roll = static_cast<float> (std::rand()) / RAND_MAX * 100;
|
||||||
if (roll <= x)
|
if (roll <= x)
|
||||||
{
|
{
|
||||||
MWWorld::Class::get(lock).unlock(lock);
|
lock.getClass().unlock(lock);
|
||||||
resultMessage = "#{sLockSuccess}";
|
resultMessage = "#{sLockSuccess}";
|
||||||
resultSound = "Open Lock";
|
resultSound = "Open Lock";
|
||||||
MWWorld::Class::get(mActor).skillUsageSucceeded(mActor, ESM::Skill::Security, 1);
|
mActor.getClass().skillUsageSucceeded(mActor, ESM::Skill::Security, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
resultMessage = "#{sLockFail}";
|
resultMessage = "#{sLockFail}";
|
||||||
|
@ -97,7 +97,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
resultSound = "Disarm Trap";
|
resultSound = "Disarm Trap";
|
||||||
resultMessage = "#{sTrapSuccess}";
|
resultMessage = "#{sTrapSuccess}";
|
||||||
MWWorld::Class::get(mActor).skillUsageSucceeded(mActor, ESM::Skill::Security, 0);
|
mActor.getClass().skillUsageSucceeded(mActor, ESM::Skill::Security, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
resultMessage = "#{sTrapFail}";
|
resultMessage = "#{sTrapFail}";
|
||||||
|
|
|
@ -118,7 +118,7 @@ namespace MWRender
|
||||||
0, true, (renderHeadOnly() ? NpcAnimation::VM_HeadOnly : NpcAnimation::VM_Normal));
|
0, true, (renderHeadOnly() ? NpcAnimation::VM_HeadOnly : NpcAnimation::VM_Normal));
|
||||||
|
|
||||||
float scale=1.f;
|
float scale=1.f;
|
||||||
MWWorld::Class::get(mCharacter).adjustScale(mCharacter, scale);
|
mCharacter.getClass().adjustScale(mCharacter, scale);
|
||||||
mNode->setScale(Ogre::Vector3(scale));
|
mNode->setScale(Ogre::Vector3(scale));
|
||||||
|
|
||||||
mCamera->setPosition(mPosition * mNode->getScale());
|
mCamera->setPosition(mPosition * mNode->getScale());
|
||||||
|
|
|
@ -237,7 +237,7 @@ void NpcAnimation::updateNpcBase()
|
||||||
void NpcAnimation::updateParts()
|
void NpcAnimation::updateParts()
|
||||||
{
|
{
|
||||||
mAlpha = 1.f;
|
mAlpha = 1.f;
|
||||||
const MWWorld::Class &cls = MWWorld::Class::get(mPtr);
|
const MWWorld::Class &cls = mPtr.getClass();
|
||||||
MWWorld::InventoryStore &inv = cls.getInventoryStore(mPtr);
|
MWWorld::InventoryStore &inv = cls.getInventoryStore(mPtr);
|
||||||
|
|
||||||
NpcType curType = Type_Normal;
|
NpcType curType = Type_Normal;
|
||||||
|
@ -668,12 +668,12 @@ void NpcAnimation::showWeapons(bool showWeapon)
|
||||||
mShowWeapons = showWeapon;
|
mShowWeapons = showWeapon;
|
||||||
if(showWeapon)
|
if(showWeapon)
|
||||||
{
|
{
|
||||||
MWWorld::InventoryStore &inv = MWWorld::Class::get(mPtr).getInventoryStore(mPtr);
|
MWWorld::InventoryStore &inv = mPtr.getClass().getInventoryStore(mPtr);
|
||||||
MWWorld::ContainerStoreIterator weapon = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
|
MWWorld::ContainerStoreIterator weapon = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
|
||||||
if(weapon != inv.end())
|
if(weapon != inv.end())
|
||||||
{
|
{
|
||||||
Ogre::Vector3 glowColor = getEnchantmentColor(*weapon);
|
Ogre::Vector3 glowColor = getEnchantmentColor(*weapon);
|
||||||
std::string mesh = MWWorld::Class::get(*weapon).getModel(*weapon);
|
std::string mesh = weapon->getClass().getModel(*weapon);
|
||||||
addOrReplaceIndividualPart(ESM::PRT_Weapon, MWWorld::InventoryStore::Slot_CarriedRight, 1,
|
addOrReplaceIndividualPart(ESM::PRT_Weapon, MWWorld::InventoryStore::Slot_CarriedRight, 1,
|
||||||
mesh, !weapon->getClass().getEnchantment(*weapon).empty(), &glowColor);
|
mesh, !weapon->getClass().getEnchantment(*weapon).empty(), &glowColor);
|
||||||
|
|
||||||
|
@ -701,13 +701,13 @@ void NpcAnimation::showWeapons(bool showWeapon)
|
||||||
void NpcAnimation::showCarriedLeft(bool show)
|
void NpcAnimation::showCarriedLeft(bool show)
|
||||||
{
|
{
|
||||||
mShowCarriedLeft = show;
|
mShowCarriedLeft = show;
|
||||||
MWWorld::InventoryStore &inv = MWWorld::Class::get(mPtr).getInventoryStore(mPtr);
|
MWWorld::InventoryStore &inv = mPtr.getClass().getInventoryStore(mPtr);
|
||||||
MWWorld::ContainerStoreIterator iter = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedLeft);
|
MWWorld::ContainerStoreIterator iter = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedLeft);
|
||||||
|
|
||||||
if(show && iter != inv.end())
|
if(show && iter != inv.end())
|
||||||
{
|
{
|
||||||
Ogre::Vector3 glowColor = getEnchantmentColor(*iter);
|
Ogre::Vector3 glowColor = getEnchantmentColor(*iter);
|
||||||
std::string mesh = MWWorld::Class::get(*iter).getModel(*iter);
|
std::string mesh = iter->getClass().getModel(*iter);
|
||||||
if (addOrReplaceIndividualPart(ESM::PRT_Shield, MWWorld::InventoryStore::Slot_CarriedLeft, 1,
|
if (addOrReplaceIndividualPart(ESM::PRT_Shield, MWWorld::InventoryStore::Slot_CarriedLeft, 1,
|
||||||
mesh, !iter->getClass().getEnchantment(*iter).empty(), &glowColor))
|
mesh, !iter->getClass().getEnchantment(*iter).empty(), &glowColor))
|
||||||
{
|
{
|
||||||
|
|
|
@ -249,7 +249,7 @@ void RenderingManager::cellAdded (MWWorld::CellStore *store)
|
||||||
|
|
||||||
void RenderingManager::addObject (const MWWorld::Ptr& ptr){
|
void RenderingManager::addObject (const MWWorld::Ptr& ptr){
|
||||||
const MWWorld::Class& class_ =
|
const MWWorld::Class& class_ =
|
||||||
MWWorld::Class::get (ptr);
|
ptr.getClass();
|
||||||
class_.insertObjectRendering(ptr, *this);
|
class_.insertObjectRendering(ptr, *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -279,7 +279,7 @@ void RenderingManager::rotateObject(const MWWorld::Ptr &ptr)
|
||||||
mCamera->rotateCamera(-rot, false);
|
mCamera->rotateCamera(-rot, false);
|
||||||
|
|
||||||
Ogre::Quaternion newo = Ogre::Quaternion(Ogre::Radian(rot.z), Ogre::Vector3::NEGATIVE_UNIT_Z);
|
Ogre::Quaternion newo = Ogre::Quaternion(Ogre::Radian(rot.z), Ogre::Vector3::NEGATIVE_UNIT_Z);
|
||||||
if(!MWWorld::Class::get(ptr).isActor())
|
if(!ptr.getClass().isActor())
|
||||||
newo = Ogre::Quaternion(Ogre::Radian(rot.x), Ogre::Vector3::NEGATIVE_UNIT_X) *
|
newo = Ogre::Quaternion(Ogre::Radian(rot.x), Ogre::Vector3::NEGATIVE_UNIT_X) *
|
||||||
Ogre::Quaternion(Ogre::Radian(rot.y), Ogre::Vector3::NEGATIVE_UNIT_Y) * newo;
|
Ogre::Quaternion(Ogre::Radian(rot.y), Ogre::Vector3::NEGATIVE_UNIT_Y) * newo;
|
||||||
ptr.getRefData().getBaseNode()->setOrientation(newo);
|
ptr.getRefData().getBaseNode()->setOrientation(newo);
|
||||||
|
@ -294,7 +294,7 @@ RenderingManager::updateObjectCell(const MWWorld::Ptr &old, const MWWorld::Ptr &
|
||||||
Ogre::SceneNode *parent = child->getParentSceneNode();
|
Ogre::SceneNode *parent = child->getParentSceneNode();
|
||||||
parent->removeChild(child);
|
parent->removeChild(child);
|
||||||
|
|
||||||
if (MWWorld::Class::get(old).isActor()) {
|
if (old.getClass().isActor()) {
|
||||||
mActors->updateObjectCell(old, cur);
|
mActors->updateObjectCell(old, cur);
|
||||||
} else {
|
} else {
|
||||||
mObjects->updateObjectCell(old, cur);
|
mObjects->updateObjectCell(old, cur);
|
||||||
|
@ -314,7 +314,7 @@ void RenderingManager::rebuildPtr(const MWWorld::Ptr &ptr)
|
||||||
NpcAnimation *anim = NULL;
|
NpcAnimation *anim = NULL;
|
||||||
if(ptr.getRefData().getHandle() == "player")
|
if(ptr.getRefData().getHandle() == "player")
|
||||||
anim = mPlayerAnimation;
|
anim = mPlayerAnimation;
|
||||||
else if(MWWorld::Class::get(ptr).isActor())
|
else if(ptr.getClass().isActor())
|
||||||
anim = dynamic_cast<NpcAnimation*>(mActors->getAnimation(ptr));
|
anim = dynamic_cast<NpcAnimation*>(mActors->getAnimation(ptr));
|
||||||
if(anim)
|
if(anim)
|
||||||
{
|
{
|
||||||
|
@ -337,7 +337,7 @@ void RenderingManager::update (float duration, bool paused)
|
||||||
|
|
||||||
MWWorld::Ptr player = world->getPlayerPtr();
|
MWWorld::Ptr player = world->getPlayerPtr();
|
||||||
|
|
||||||
int blind = MWWorld::Class::get(player).getCreatureStats(player).getMagicEffects().get(ESM::MagicEffect::Blind).mMagnitude;
|
int blind = player.getClass().getCreatureStats(player).getMagicEffects().get(ESM::MagicEffect::Blind).mMagnitude;
|
||||||
mRendering.getFader()->setFactor(std::max(0.f, 1.f-(blind / 100.f)));
|
mRendering.getFader()->setFactor(std::max(0.f, 1.f-(blind / 100.f)));
|
||||||
setAmbientMode();
|
setAmbientMode();
|
||||||
|
|
||||||
|
@ -599,7 +599,7 @@ void RenderingManager::setAmbientColour(const Ogre::ColourValue& colour)
|
||||||
mAmbientColor = colour;
|
mAmbientColor = colour;
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
int nightEye = MWWorld::Class::get(player).getCreatureStats(player).getMagicEffects().get(ESM::MagicEffect::NightEye).mMagnitude;
|
int nightEye = player.getClass().getCreatureStats(player).getMagicEffects().get(ESM::MagicEffect::NightEye).mMagnitude;
|
||||||
Ogre::ColourValue final = colour;
|
Ogre::ColourValue final = colour;
|
||||||
final += Ogre::ColourValue(0.7,0.7,0.7,0) * std::min(1.f, (nightEye/100.f));
|
final += Ogre::ColourValue(0.7,0.7,0.7,0) * std::min(1.f, (nightEye/100.f));
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace MWScript
|
||||||
for (unsigned int i=0; i<arg0; ++i) runtime.pop();
|
for (unsigned int i=0; i<arg0; ++i) runtime.pop();
|
||||||
|
|
||||||
MWMechanics::AiActivate activatePackage(objectID);
|
MWMechanics::AiActivate activatePackage(objectID);
|
||||||
MWWorld::Class::get (ptr).getCreatureStats (ptr).getAiSequence().stack(activatePackage, ptr);
|
ptr.getClass().getCreatureStats (ptr).getAiSequence().stack(activatePackage, ptr);
|
||||||
std::cout << "AiActivate" << std::endl;
|
std::cout << "AiActivate" << std::endl;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -74,7 +74,7 @@ namespace MWScript
|
||||||
for (unsigned int i=0; i<arg0; ++i) runtime.pop();
|
for (unsigned int i=0; i<arg0; ++i) runtime.pop();
|
||||||
|
|
||||||
MWMechanics::AiTravel travelPackage(x, y, z);
|
MWMechanics::AiTravel travelPackage(x, y, z);
|
||||||
MWWorld::Class::get (ptr).getCreatureStats (ptr).getAiSequence().stack(travelPackage, ptr);
|
ptr.getClass().getCreatureStats (ptr).getAiSequence().stack(travelPackage, ptr);
|
||||||
|
|
||||||
std::cout << "AiTravel: " << x << ", " << y << ", " << z << std::endl;
|
std::cout << "AiTravel: " << x << ", " << y << ", " << z << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,7 @@ namespace MWScript
|
||||||
for (unsigned int i=0; i<arg0; ++i) runtime.pop();
|
for (unsigned int i=0; i<arg0; ++i) runtime.pop();
|
||||||
|
|
||||||
MWMechanics::AiEscort escortPackage(actorID, duration, x, y, z);
|
MWMechanics::AiEscort escortPackage(actorID, duration, x, y, z);
|
||||||
MWWorld::Class::get (ptr).getCreatureStats (ptr).getAiSequence().stack(escortPackage, ptr);
|
ptr.getClass().getCreatureStats (ptr).getAiSequence().stack(escortPackage, ptr);
|
||||||
|
|
||||||
std::cout << "AiEscort: " << x << ", " << y << ", " << z << ", " << duration
|
std::cout << "AiEscort: " << x << ", " << y << ", " << z << ", " << duration
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
@ -146,7 +146,7 @@ namespace MWScript
|
||||||
for (unsigned int i=0; i<arg0; ++i) runtime.pop();
|
for (unsigned int i=0; i<arg0; ++i) runtime.pop();
|
||||||
|
|
||||||
MWMechanics::AiEscort escortPackage(actorID, cellID, duration, x, y, z);
|
MWMechanics::AiEscort escortPackage(actorID, cellID, duration, x, y, z);
|
||||||
MWWorld::Class::get (ptr).getCreatureStats (ptr).getAiSequence().stack(escortPackage, ptr);
|
ptr.getClass().getCreatureStats (ptr).getAiSequence().stack(escortPackage, ptr);
|
||||||
|
|
||||||
std::cout << "AiEscort: " << x << ", " << y << ", " << z << ", " << duration
|
std::cout << "AiEscort: " << x << ", " << y << ", " << z << ", " << duration
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
@ -162,7 +162,7 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
|
||||||
Interpreter::Type_Integer value = MWWorld::Class::get (ptr).getCreatureStats (ptr).getAiSequence().isPackageDone();
|
Interpreter::Type_Integer value = ptr.getClass().getCreatureStats (ptr).getAiSequence().isPackageDone();
|
||||||
|
|
||||||
runtime.push (value);
|
runtime.push (value);
|
||||||
}
|
}
|
||||||
|
@ -210,7 +210,7 @@ namespace MWScript
|
||||||
for (unsigned int i=0; i<arg0; ++i) runtime.pop();
|
for (unsigned int i=0; i<arg0; ++i) runtime.pop();
|
||||||
|
|
||||||
MWMechanics::AiWander wanderPackage(range, duration, time, idleList, repeat);
|
MWMechanics::AiWander wanderPackage(range, duration, time, idleList, repeat);
|
||||||
MWWorld::Class::get (ptr).getCreatureStats (ptr).getAiSequence().stack(wanderPackage, ptr);
|
ptr.getClass().getCreatureStats (ptr).getAiSequence().stack(wanderPackage, ptr);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
|
||||||
runtime.push(MWWorld::Class::get (ptr).getCreatureStats (ptr).getAiSetting (
|
runtime.push(ptr.getClass().getCreatureStats (ptr).getAiSetting (
|
||||||
(MWMechanics::CreatureStats::AiSetting)mIndex).getModified());
|
(MWMechanics::CreatureStats::AiSetting)mIndex).getModified());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -245,8 +245,8 @@ namespace MWScript
|
||||||
MWMechanics::CreatureStats::AiSetting setting
|
MWMechanics::CreatureStats::AiSetting setting
|
||||||
= MWMechanics::CreatureStats::AiSetting(mIndex);
|
= MWMechanics::CreatureStats::AiSetting(mIndex);
|
||||||
|
|
||||||
MWWorld::Class::get (ptr).getCreatureStats (ptr).setAiSetting (setting,
|
ptr.getClass().getCreatureStats (ptr).setAiSetting (setting,
|
||||||
MWWorld::Class::get (ptr).getCreatureStats (ptr).getAiSetting (setting).getBase() + value);
|
ptr.getClass().getCreatureStats (ptr).getAiSetting (setting).getBase() + value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
template<class R>
|
template<class R>
|
||||||
|
@ -298,7 +298,7 @@ namespace MWScript
|
||||||
for (unsigned int i=0; i<arg0; ++i) runtime.pop();
|
for (unsigned int i=0; i<arg0; ++i) runtime.pop();
|
||||||
|
|
||||||
MWMechanics::AiFollow followPackage(actorID, duration, x, y ,z);
|
MWMechanics::AiFollow followPackage(actorID, duration, x, y ,z);
|
||||||
MWWorld::Class::get (ptr).getCreatureStats (ptr).getAiSequence().stack(followPackage, ptr);
|
ptr.getClass().getCreatureStats (ptr).getAiSequence().stack(followPackage, ptr);
|
||||||
|
|
||||||
std::cout << "AiFollow: " << actorID << ", " << x << ", " << y << ", " << z << ", " << duration
|
std::cout << "AiFollow: " << actorID << ", " << x << ", " << y << ", " << z << ", " << duration
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
@ -336,7 +336,7 @@ namespace MWScript
|
||||||
for (unsigned int i=0; i<arg0; ++i) runtime.pop();
|
for (unsigned int i=0; i<arg0; ++i) runtime.pop();
|
||||||
|
|
||||||
MWMechanics::AiFollow followPackage(actorID, cellID, duration, x, y ,z);
|
MWMechanics::AiFollow followPackage(actorID, cellID, duration, x, y ,z);
|
||||||
MWWorld::Class::get (ptr).getCreatureStats (ptr).getAiSequence().stack(followPackage, ptr);
|
ptr.getClass().getCreatureStats (ptr).getAiSequence().stack(followPackage, ptr);
|
||||||
std::cout << "AiFollow: " << actorID << ", " << x << ", " << y << ", " << z << ", " << duration
|
std::cout << "AiFollow: " << actorID << ", " << x << ", " << y << ", " << z << ", " << duration
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
|
@ -351,7 +351,7 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
|
||||||
Interpreter::Type_Integer value = MWWorld::Class::get (ptr).getCreatureStats (ptr).getAiSequence().getLastRunTypeId();
|
Interpreter::Type_Integer value = ptr.getClass().getCreatureStats (ptr).getAiSequence().getLastRunTypeId();
|
||||||
|
|
||||||
runtime.push (value);
|
runtime.push (value);
|
||||||
}
|
}
|
||||||
|
@ -411,7 +411,7 @@ namespace MWScript
|
||||||
std::string testedTargetId = runtime.getStringLiteral (runtime[0].mInteger);
|
std::string testedTargetId = runtime.getStringLiteral (runtime[0].mInteger);
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
const MWMechanics::CreatureStats& creatureStats = MWWorld::Class::get(actor).getCreatureStats(actor);
|
const MWMechanics::CreatureStats& creatureStats = actor.getClass().getCreatureStats(actor);
|
||||||
std::string currentTargetId;
|
std::string currentTargetId;
|
||||||
|
|
||||||
bool targetsAreEqual = false;
|
bool targetsAreEqual = false;
|
||||||
|
@ -447,7 +447,7 @@ namespace MWScript
|
||||||
virtual void execute (Interpreter::Runtime& runtime)
|
virtual void execute (Interpreter::Runtime& runtime)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr actor = R()(runtime);
|
MWWorld::Ptr actor = R()(runtime);
|
||||||
MWMechanics::CreatureStats& creatureStats = MWWorld::Class::get(actor).getCreatureStats(actor);
|
MWMechanics::CreatureStats& creatureStats = actor.getClass().getCreatureStats(actor);
|
||||||
creatureStats.getAiSequence().stopCombat();
|
creatureStats.getAiSequence().stopCombat();
|
||||||
creatureStats.setHostile(false);
|
creatureStats.setHostile(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->getPtr (id, false);
|
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->getPtr (id, false);
|
||||||
|
|
||||||
script = MWWorld::Class::get (ptr).getScript (ptr);
|
script = ptr.getClass().getScript (ptr);
|
||||||
reference = true;
|
reference = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ namespace MWScript
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MWWorld::ContainerStore& store = MWWorld::Class::get (ptr).getContainerStore (ptr);
|
MWWorld::ContainerStore& store = ptr.getClass().getContainerStore (ptr);
|
||||||
|
|
||||||
std::string itemName;
|
std::string itemName;
|
||||||
for (MWWorld::ContainerStoreIterator iter(store.begin()); iter != store.end(); ++iter)
|
for (MWWorld::ContainerStoreIterator iter(store.begin()); iter != store.end(); ++iter)
|
||||||
|
@ -231,7 +231,7 @@ namespace MWScript
|
||||||
throw std::runtime_error ("armor index out of range");
|
throw std::runtime_error ("armor index out of range");
|
||||||
}
|
}
|
||||||
|
|
||||||
MWWorld::InventoryStore& invStore = MWWorld::Class::get(ptr).getInventoryStore (ptr);
|
MWWorld::InventoryStore& invStore = ptr.getClass().getInventoryStore (ptr);
|
||||||
|
|
||||||
MWWorld::ContainerStoreIterator it = invStore.getSlot (slot);
|
MWWorld::ContainerStoreIterator it = invStore.getSlot (slot);
|
||||||
if (it == invStore.end() || it->getTypeName () != typeid(ESM::Armor).name())
|
if (it == invStore.end() || it->getTypeName () != typeid(ESM::Armor).name())
|
||||||
|
@ -240,7 +240,7 @@ namespace MWScript
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int skill = MWWorld::Class::get(*it).getEquipmentSkill (*it) ;
|
int skill = it->getClass().getEquipmentSkill (*it) ;
|
||||||
if (skill == ESM::Skill::HeavyArmor)
|
if (skill == ESM::Skill::HeavyArmor)
|
||||||
runtime.push(2);
|
runtime.push(2);
|
||||||
else if (skill == ESM::Skill::MediumArmor)
|
else if (skill == ESM::Skill::MediumArmor)
|
||||||
|
@ -264,7 +264,7 @@ namespace MWScript
|
||||||
std::string item = runtime.getStringLiteral (runtime[0].mInteger);
|
std::string item = runtime.getStringLiteral (runtime[0].mInteger);
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
MWWorld::InventoryStore& invStore = MWWorld::Class::get(ptr).getInventoryStore (ptr);
|
MWWorld::InventoryStore& invStore = ptr.getClass().getInventoryStore (ptr);
|
||||||
for (int slot = 0; slot < MWWorld::InventoryStore::Slots; ++slot)
|
for (int slot = 0; slot < MWWorld::InventoryStore::Slots; ++slot)
|
||||||
{
|
{
|
||||||
MWWorld::ContainerStoreIterator it = invStore.getSlot (slot);
|
MWWorld::ContainerStoreIterator it = invStore.getSlot (slot);
|
||||||
|
@ -290,7 +290,7 @@ namespace MWScript
|
||||||
const std::string &name = runtime.getStringLiteral (runtime[0].mInteger);
|
const std::string &name = runtime.getStringLiteral (runtime[0].mInteger);
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
MWWorld::InventoryStore& invStore = MWWorld::Class::get(ptr).getInventoryStore (ptr);
|
MWWorld::InventoryStore& invStore = ptr.getClass().getInventoryStore (ptr);
|
||||||
for (MWWorld::ContainerStoreIterator it = invStore.begin(MWWorld::ContainerStore::Type_Miscellaneous);
|
for (MWWorld::ContainerStoreIterator it = invStore.begin(MWWorld::ContainerStore::Type_Miscellaneous);
|
||||||
it != invStore.end(); ++it)
|
it != invStore.end(); ++it)
|
||||||
{
|
{
|
||||||
|
@ -314,7 +314,7 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
|
||||||
MWWorld::InventoryStore& invStore = MWWorld::Class::get(ptr).getInventoryStore (ptr);
|
MWWorld::InventoryStore& invStore = ptr.getClass().getInventoryStore (ptr);
|
||||||
MWWorld::ContainerStoreIterator it = invStore.getSlot (MWWorld::InventoryStore::Slot_CarriedRight);
|
MWWorld::ContainerStoreIterator it = invStore.getSlot (MWWorld::InventoryStore::Slot_CarriedRight);
|
||||||
if (it == invStore.end() || it->getTypeName () != typeid(ESM::Weapon).name())
|
if (it == invStore.end() || it->getTypeName () != typeid(ESM::Weapon).name())
|
||||||
{
|
{
|
||||||
|
|
|
@ -141,7 +141,7 @@ namespace MWScript
|
||||||
Interpreter::Type_Integer value = runtime[0].mInteger;
|
Interpreter::Type_Integer value = runtime[0].mInteger;
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
MWWorld::Class::get(ptr).getNpcStats (ptr).setReputation (MWWorld::Class::get(ptr).getNpcStats (ptr).getReputation () + value);
|
ptr.getClass().getNpcStats (ptr).setReputation (ptr.getClass().getNpcStats (ptr).getReputation () + value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ namespace MWScript
|
||||||
Interpreter::Type_Integer value = runtime[0].mInteger;
|
Interpreter::Type_Integer value = runtime[0].mInteger;
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
MWWorld::Class::get(ptr).getNpcStats (ptr).setReputation (value);
|
ptr.getClass().getNpcStats (ptr).setReputation (value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
|
||||||
runtime.push (MWWorld::Class::get(ptr).getNpcStats (ptr).getReputation ());
|
runtime.push (ptr.getClass().getNpcStats (ptr).getReputation ());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ namespace MWScript
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
||||||
|
|
||||||
runtime.push (MWWorld::Class::get(ptr).getNpcStats (ptr).isSameFaction (MWWorld::Class::get(player).getNpcStats (player)));
|
runtime.push (ptr.getClass().getNpcStats (ptr).isSameFaction (player.getClass().getNpcStats (player)));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
const MWWorld::Ptr ptr = getReference (id, false);
|
const MWWorld::Ptr ptr = getReference (id, false);
|
||||||
|
|
||||||
id = MWWorld::Class::get (ptr).getScript (ptr);
|
id = ptr.getClass().getScript (ptr);
|
||||||
|
|
||||||
ptr.getRefData().setLocals (
|
ptr.getRefData().setLocals (
|
||||||
*MWBase::Environment::get().getWorld()->getStore().get<ESM::Script>().find (id));
|
*MWBase::Environment::get().getWorld()->getStore().get<ESM::Script>().find (id));
|
||||||
|
@ -86,7 +86,7 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
const MWWorld::Ptr ptr = getReference (id, false);
|
const MWWorld::Ptr ptr = getReference (id, false);
|
||||||
|
|
||||||
id = MWWorld::Class::get (ptr).getScript (ptr);
|
id = ptr.getClass().getScript (ptr);
|
||||||
|
|
||||||
ptr.getRefData().setLocals (
|
ptr.getRefData().setLocals (
|
||||||
*MWBase::Environment::get().getWorld()->getStore().get<ESM::Script>().find (id));
|
*MWBase::Environment::get().getWorld()->getStore().get<ESM::Script>().find (id));
|
||||||
|
@ -263,7 +263,7 @@ namespace MWScript
|
||||||
|
|
||||||
std::string InterpreterContext::getNPCRank() const
|
std::string InterpreterContext::getNPCRank() const
|
||||||
{
|
{
|
||||||
std::map<std::string, int> ranks = MWWorld::Class::get (mReference).getNpcStats (mReference).getFactionRanks();
|
std::map<std::string, int> ranks = mReference.getClass().getNpcStats (mReference).getFactionRanks();
|
||||||
std::map<std::string, int>::const_iterator it = ranks.begin();
|
std::map<std::string, int>::const_iterator it = ranks.begin();
|
||||||
|
|
||||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
|
@ -299,9 +299,9 @@ namespace MWScript
|
||||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
MWWorld::Ptr player = world->getPlayerPtr();
|
MWWorld::Ptr player = world->getPlayerPtr();
|
||||||
|
|
||||||
std::string factionId = MWWorld::Class::get (mReference).getNpcStats (mReference).getFactionRanks().begin()->first;
|
std::string factionId = mReference.getClass().getNpcStats (mReference).getFactionRanks().begin()->first;
|
||||||
|
|
||||||
std::map<std::string, int> ranks = MWWorld::Class::get (player).getNpcStats (player).getFactionRanks();
|
std::map<std::string, int> ranks = player.getClass().getNpcStats (player).getFactionRanks();
|
||||||
std::map<std::string, int>::const_iterator it = ranks.find(factionId);
|
std::map<std::string, int>::const_iterator it = ranks.find(factionId);
|
||||||
int rank = -1;
|
int rank = -1;
|
||||||
if (it != ranks.end())
|
if (it != ranks.end())
|
||||||
|
@ -326,9 +326,9 @@ namespace MWScript
|
||||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
MWWorld::Ptr player = world->getPlayerPtr();
|
MWWorld::Ptr player = world->getPlayerPtr();
|
||||||
|
|
||||||
std::string factionId = MWWorld::Class::get (mReference).getNpcStats (mReference).getFactionRanks().begin()->first;
|
std::string factionId = mReference.getClass().getNpcStats (mReference).getFactionRanks().begin()->first;
|
||||||
|
|
||||||
std::map<std::string, int> ranks = MWWorld::Class::get (player).getNpcStats (player).getFactionRanks();
|
std::map<std::string, int> ranks = player.getClass().getNpcStats (player).getFactionRanks();
|
||||||
std::map<std::string, int>::const_iterator it = ranks.find(factionId);
|
std::map<std::string, int>::const_iterator it = ranks.find(factionId);
|
||||||
int rank = -1;
|
int rank = -1;
|
||||||
if (it != ranks.end())
|
if (it != ranks.end())
|
||||||
|
@ -353,7 +353,7 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
MWWorld::Ptr player = world->getPlayerPtr();
|
MWWorld::Ptr player = world->getPlayerPtr();
|
||||||
return MWWorld::Class::get (player).getNpcStats (player).getBounty();
|
return player.getClass().getNpcStats (player).getBounty();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string InterpreterContext::getCurrentCellName() const
|
std::string InterpreterContext::getCurrentCellName() const
|
||||||
|
|
|
@ -142,7 +142,7 @@ namespace MWScript
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
MWWorld::Class::get (ptr).lock (ptr, lockLevel);
|
ptr.getClass().lock (ptr, lockLevel);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
|
||||||
MWWorld::Class::get (ptr).unlock (ptr);
|
ptr.getClass().unlock (ptr);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -345,7 +345,7 @@ namespace MWScript
|
||||||
if(key < 0 || key > 32767 || *end != '\0')
|
if(key < 0 || key > 32767 || *end != '\0')
|
||||||
key = ESM::MagicEffect::effectStringToId(effect);
|
key = ESM::MagicEffect::effectStringToId(effect);
|
||||||
|
|
||||||
runtime.push(MWWorld::Class::get(ptr).getCreatureStats(ptr).getMagicEffects().get(
|
runtime.push(ptr.getClass().getCreatureStats(ptr).getMagicEffects().get(
|
||||||
MWMechanics::EffectKey(key)).mMagnitude > 0);
|
MWMechanics::EffectKey(key)).mMagnitude > 0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -389,7 +389,7 @@ namespace MWScript
|
||||||
for (unsigned int i=0; i<arg0; ++i)
|
for (unsigned int i=0; i<arg0; ++i)
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
MWWorld::ContainerStore& store = MWWorld::Class::get (ptr).getContainerStore (ptr);
|
MWWorld::ContainerStore& store = ptr.getClass().getContainerStore (ptr);
|
||||||
for (MWWorld::ContainerStoreIterator it = store.begin(); it != store.end(); ++it)
|
for (MWWorld::ContainerStoreIterator it = store.begin(); it != store.end(); ++it)
|
||||||
{
|
{
|
||||||
if (::Misc::StringUtils::ciEqual(it->getCellRef().mSoul, soul))
|
if (::Misc::StringUtils::ciEqual(it->getCellRef().mSoul, soul))
|
||||||
|
@ -424,7 +424,7 @@ namespace MWScript
|
||||||
if (amount == 0)
|
if (amount == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MWWorld::ContainerStore& store = MWWorld::Class::get (ptr).getContainerStore (ptr);
|
MWWorld::ContainerStore& store = ptr.getClass().getContainerStore (ptr);
|
||||||
|
|
||||||
|
|
||||||
int toRemove = amount;
|
int toRemove = amount;
|
||||||
|
@ -457,7 +457,7 @@ namespace MWScript
|
||||||
std::string soul = runtime.getStringLiteral (runtime[0].mInteger);
|
std::string soul = runtime.getStringLiteral (runtime[0].mInteger);
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
MWWorld::ContainerStore& store = MWWorld::Class::get (ptr).getContainerStore (ptr);
|
MWWorld::ContainerStore& store = ptr.getClass().getContainerStore (ptr);
|
||||||
|
|
||||||
|
|
||||||
for (MWWorld::ContainerStoreIterator iter (store.begin()); iter!=store.end(); ++iter)
|
for (MWWorld::ContainerStoreIterator iter (store.begin()); iter!=store.end(); ++iter)
|
||||||
|
@ -481,7 +481,7 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
|
||||||
runtime.push(MWWorld::Class::get(ptr).getCreatureStats (ptr).getAttacked ());
|
runtime.push(ptr.getClass().getCreatureStats (ptr).getAttacked ());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -522,7 +522,7 @@ namespace MWScript
|
||||||
std::string id = runtime.getStringLiteral(runtime[0].mInteger);
|
std::string id = runtime.getStringLiteral(runtime[0].mInteger);
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
runtime.push(MWWorld::Class::get(ptr).getCreatureStats(ptr).getActiveSpells().isSpellActive(id));
|
runtime.push(ptr.getClass().getCreatureStats(ptr).getActiveSpells().isSpellActive(id));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -621,7 +621,7 @@ namespace MWScript
|
||||||
std::string objectID = runtime.getStringLiteral (runtime[0].mInteger);
|
std::string objectID = runtime.getStringLiteral (runtime[0].mInteger);
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
MWMechanics::CreatureStats &stats = MWWorld::Class::get(ptr).getCreatureStats(ptr);
|
MWMechanics::CreatureStats &stats = ptr.getClass().getCreatureStats(ptr);
|
||||||
runtime.push(::Misc::StringUtils::ciEqual(objectID, stats.getLastHitObject()));
|
runtime.push(::Misc::StringUtils::ciEqual(objectID, stats.getLastHitObject()));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -657,7 +657,7 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
std::stringstream str;
|
std::stringstream str;
|
||||||
|
|
||||||
const std::string script = MWWorld::Class::get(ptr).getScript(ptr);
|
const std::string script = ptr.getClass().getScript(ptr);
|
||||||
if(script.empty())
|
if(script.empty())
|
||||||
str<< ptr.getCellRef().mRefID<<" ("<<ptr.getRefData().getHandle()<<") does not have a script.";
|
str<< ptr.getCellRef().mRefID<<" ("<<ptr.getRefData().getHandle()<<") does not have a script.";
|
||||||
else
|
else
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace
|
||||||
{
|
{
|
||||||
std::string getDialogueActorFaction(MWWorld::Ptr actor)
|
std::string getDialogueActorFaction(MWWorld::Ptr actor)
|
||||||
{
|
{
|
||||||
const MWMechanics::NpcStats &stats = MWWorld::Class::get (actor).getNpcStats (actor);
|
const MWMechanics::NpcStats &stats = actor.getClass().getNpcStats (actor);
|
||||||
|
|
||||||
if (stats.getFactionRanks().empty())
|
if (stats.getFactionRanks().empty())
|
||||||
throw std::runtime_error (
|
throw std::runtime_error (
|
||||||
|
@ -55,7 +55,7 @@ namespace MWScript
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
|
||||||
Interpreter::Type_Integer value =
|
Interpreter::Type_Integer value =
|
||||||
MWWorld::Class::get (ptr)
|
ptr.getClass()
|
||||||
.getCreatureStats (ptr)
|
.getCreatureStats (ptr)
|
||||||
.getLevel();
|
.getLevel();
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ namespace MWScript
|
||||||
Interpreter::Type_Integer value = runtime[0].mInteger;
|
Interpreter::Type_Integer value = runtime[0].mInteger;
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
MWWorld::Class::get (ptr)
|
ptr.getClass()
|
||||||
.getCreatureStats (ptr)
|
.getCreatureStats (ptr)
|
||||||
.setLevel(value);
|
.setLevel(value);
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ namespace MWScript
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
|
||||||
Interpreter::Type_Integer value =
|
Interpreter::Type_Integer value =
|
||||||
MWWorld::Class::get (ptr)
|
ptr.getClass()
|
||||||
.getCreatureStats (ptr)
|
.getCreatureStats (ptr)
|
||||||
.getAttribute(mIndex)
|
.getAttribute(mIndex)
|
||||||
.getModified();
|
.getModified();
|
||||||
|
@ -142,7 +142,7 @@ namespace MWScript
|
||||||
Interpreter::Type_Integer value = runtime[0].mInteger;
|
Interpreter::Type_Integer value = runtime[0].mInteger;
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
MWMechanics::AttributeValue attribute = MWWorld::Class::get(ptr)
|
MWMechanics::AttributeValue attribute = ptr.getClass()
|
||||||
.getCreatureStats(ptr)
|
.getCreatureStats(ptr)
|
||||||
.getAttribute(mIndex);
|
.getAttribute(mIndex);
|
||||||
|
|
||||||
|
@ -165,13 +165,13 @@ namespace MWScript
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
Interpreter::Type_Float value;
|
Interpreter::Type_Float value;
|
||||||
|
|
||||||
if (mIndex==0 && MWWorld::Class::get (ptr).hasItemHealth (ptr))
|
if (mIndex==0 && ptr.getClass().hasItemHealth (ptr))
|
||||||
{
|
{
|
||||||
// health is a special case
|
// health is a special case
|
||||||
value = MWWorld::Class::get (ptr).getItemMaxHealth (ptr);
|
value = ptr.getClass().getItemMaxHealth (ptr);
|
||||||
} else {
|
} else {
|
||||||
value =
|
value =
|
||||||
MWWorld::Class::get(ptr)
|
ptr.getClass()
|
||||||
.getCreatureStats(ptr)
|
.getCreatureStats(ptr)
|
||||||
.getDynamic(mIndex)
|
.getDynamic(mIndex)
|
||||||
.getCurrent();
|
.getCurrent();
|
||||||
|
@ -196,13 +196,13 @@ namespace MWScript
|
||||||
Interpreter::Type_Float value = runtime[0].mFloat;
|
Interpreter::Type_Float value = runtime[0].mFloat;
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
MWMechanics::DynamicStat<float> stat (MWWorld::Class::get (ptr).getCreatureStats (ptr)
|
MWMechanics::DynamicStat<float> stat (ptr.getClass().getCreatureStats (ptr)
|
||||||
.getDynamic (mIndex));
|
.getDynamic (mIndex));
|
||||||
|
|
||||||
stat.setModified (value, 0);
|
stat.setModified (value, 0);
|
||||||
stat.setCurrent(value);
|
stat.setCurrent(value);
|
||||||
|
|
||||||
MWWorld::Class::get (ptr).getCreatureStats (ptr).setDynamic (mIndex, stat);
|
ptr.getClass().getCreatureStats (ptr).setDynamic (mIndex, stat);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -222,18 +222,18 @@ namespace MWScript
|
||||||
Interpreter::Type_Float diff = runtime[0].mFloat;
|
Interpreter::Type_Float diff = runtime[0].mFloat;
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
MWMechanics::CreatureStats& stats = MWWorld::Class::get (ptr).getCreatureStats (ptr);
|
MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats (ptr);
|
||||||
|
|
||||||
Interpreter::Type_Float current = stats.getDynamic(mIndex).getCurrent();
|
Interpreter::Type_Float current = stats.getDynamic(mIndex).getCurrent();
|
||||||
|
|
||||||
MWMechanics::DynamicStat<float> stat (MWWorld::Class::get (ptr).getCreatureStats (ptr)
|
MWMechanics::DynamicStat<float> stat (ptr.getClass().getCreatureStats (ptr)
|
||||||
.getDynamic (mIndex));
|
.getDynamic (mIndex));
|
||||||
|
|
||||||
stat.setModified (diff + stat.getModified(), 0);
|
stat.setModified (diff + stat.getModified(), 0);
|
||||||
|
|
||||||
stat.setCurrent (diff + current);
|
stat.setCurrent (diff + current);
|
||||||
|
|
||||||
MWWorld::Class::get (ptr).getCreatureStats (ptr).setDynamic (mIndex, stat);
|
ptr.getClass().getCreatureStats (ptr).setDynamic (mIndex, stat);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -253,16 +253,16 @@ namespace MWScript
|
||||||
Interpreter::Type_Float diff = runtime[0].mFloat;
|
Interpreter::Type_Float diff = runtime[0].mFloat;
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
MWMechanics::CreatureStats& stats = MWWorld::Class::get (ptr).getCreatureStats (ptr);
|
MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats (ptr);
|
||||||
|
|
||||||
Interpreter::Type_Float current = stats.getDynamic(mIndex).getCurrent();
|
Interpreter::Type_Float current = stats.getDynamic(mIndex).getCurrent();
|
||||||
|
|
||||||
MWMechanics::DynamicStat<float> stat (MWWorld::Class::get (ptr).getCreatureStats (ptr)
|
MWMechanics::DynamicStat<float> stat (ptr.getClass().getCreatureStats (ptr)
|
||||||
.getDynamic (mIndex));
|
.getDynamic (mIndex));
|
||||||
|
|
||||||
stat.setCurrent (diff + current);
|
stat.setCurrent (diff + current);
|
||||||
|
|
||||||
MWWorld::Class::get (ptr).getCreatureStats (ptr).setDynamic (mIndex, stat);
|
ptr.getClass().getCreatureStats (ptr).setDynamic (mIndex, stat);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -279,7 +279,7 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
|
||||||
MWMechanics::CreatureStats& stats = MWWorld::Class::get (ptr).getCreatureStats (ptr);
|
MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats (ptr);
|
||||||
|
|
||||||
Interpreter::Type_Float value = 0;
|
Interpreter::Type_Float value = 0;
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ namespace MWScript
|
||||||
Interpreter::Type_Integer value = runtime[0].mInteger;
|
Interpreter::Type_Integer value = runtime[0].mInteger;
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
MWMechanics::NpcStats& stats = MWWorld::Class::get (ptr).getNpcStats (ptr);
|
MWMechanics::NpcStats& stats = ptr.getClass().getNpcStats (ptr);
|
||||||
|
|
||||||
MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
|
MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
|
||||||
|
|
||||||
|
@ -386,7 +386,7 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
MWWorld::Ptr player = world->getPlayerPtr();
|
MWWorld::Ptr player = world->getPlayerPtr();
|
||||||
runtime.push (static_cast <Interpreter::Type_Float> (MWWorld::Class::get (player).getNpcStats (player).getBounty()));
|
runtime.push (static_cast <Interpreter::Type_Float> (player.getClass().getNpcStats (player).getBounty()));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -399,7 +399,7 @@ namespace MWScript
|
||||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
MWWorld::Ptr player = world->getPlayerPtr();
|
MWWorld::Ptr player = world->getPlayerPtr();
|
||||||
|
|
||||||
MWWorld::Class::get (player).getNpcStats (player).setBounty(runtime[0].mFloat);
|
player.getClass().getNpcStats (player).setBounty(runtime[0].mFloat);
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -413,7 +413,7 @@ namespace MWScript
|
||||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
MWWorld::Ptr player = world->getPlayerPtr();
|
MWWorld::Ptr player = world->getPlayerPtr();
|
||||||
|
|
||||||
MWWorld::Class::get (player).getNpcStats (player).setBounty(runtime[0].mFloat + MWWorld::Class::get (player).getNpcStats (player).getBounty());
|
player.getClass().getNpcStats (player).setBounty(runtime[0].mFloat + player.getClass().getNpcStats (player).getBounty());
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -433,7 +433,7 @@ namespace MWScript
|
||||||
// make sure a spell with this ID actually exists.
|
// make sure a spell with this ID actually exists.
|
||||||
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find (id);
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find (id);
|
||||||
|
|
||||||
MWWorld::Class::get (ptr).getCreatureStats (ptr).getSpells().add (id);
|
ptr.getClass().getCreatureStats (ptr).getSpells().add (id);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -449,7 +449,7 @@ namespace MWScript
|
||||||
std::string id = runtime.getStringLiteral (runtime[0].mInteger);
|
std::string id = runtime.getStringLiteral (runtime[0].mInteger);
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
MWWorld::Class::get (ptr).getCreatureStats (ptr).getSpells().remove (id);
|
ptr.getClass().getCreatureStats (ptr).getSpells().remove (id);
|
||||||
|
|
||||||
MWBase::WindowManager *wm = MWBase::Environment::get().getWindowManager();
|
MWBase::WindowManager *wm = MWBase::Environment::get().getWindowManager();
|
||||||
|
|
||||||
|
@ -473,7 +473,7 @@ namespace MWScript
|
||||||
std::string spellid = runtime.getStringLiteral (runtime[0].mInteger);
|
std::string spellid = runtime.getStringLiteral (runtime[0].mInteger);
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
MWWorld::Class::get (ptr).getCreatureStats (ptr).getActiveSpells().removeEffects(spellid);
|
ptr.getClass().getCreatureStats (ptr).getActiveSpells().removeEffects(spellid);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -489,7 +489,7 @@ namespace MWScript
|
||||||
Interpreter::Type_Integer effectId = runtime[0].mInteger;
|
Interpreter::Type_Integer effectId = runtime[0].mInteger;
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
MWWorld::Class::get (ptr).getCreatureStats (ptr).getActiveSpells().purgeEffect(effectId);
|
ptr.getClass().getCreatureStats (ptr).getActiveSpells().purgeEffect(effectId);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -509,8 +509,8 @@ namespace MWScript
|
||||||
Interpreter::Type_Integer value = 0;
|
Interpreter::Type_Integer value = 0;
|
||||||
|
|
||||||
for (MWMechanics::Spells::TIterator iter (
|
for (MWMechanics::Spells::TIterator iter (
|
||||||
MWWorld::Class::get (ptr).getCreatureStats (ptr).getSpells().begin());
|
ptr.getClass().getCreatureStats (ptr).getSpells().begin());
|
||||||
iter!=MWWorld::Class::get (ptr).getCreatureStats (ptr).getSpells().end(); ++iter)
|
iter!=ptr.getClass().getCreatureStats (ptr).getSpells().end(); ++iter)
|
||||||
if (iter->first==id)
|
if (iter->first==id)
|
||||||
{
|
{
|
||||||
value = 1;
|
value = 1;
|
||||||
|
@ -544,9 +544,9 @@ namespace MWScript
|
||||||
if(factionID != "")
|
if(factionID != "")
|
||||||
{
|
{
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
if(MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().find(factionID) == MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().end())
|
if(player.getClass().getNpcStats(player).getFactionRanks().find(factionID) == player.getClass().getNpcStats(player).getFactionRanks().end())
|
||||||
{
|
{
|
||||||
MWWorld::Class::get(player).getNpcStats(player).getFactionRanks()[factionID] = 0;
|
player.getClass().getNpcStats(player).getFactionRanks()[factionID] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -575,13 +575,13 @@ namespace MWScript
|
||||||
if(factionID != "")
|
if(factionID != "")
|
||||||
{
|
{
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
if(MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().find(factionID) == MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().end())
|
if(player.getClass().getNpcStats(player).getFactionRanks().find(factionID) == player.getClass().getNpcStats(player).getFactionRanks().end())
|
||||||
{
|
{
|
||||||
MWWorld::Class::get(player).getNpcStats(player).getFactionRanks()[factionID] = 0;
|
player.getClass().getNpcStats(player).getFactionRanks()[factionID] = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MWWorld::Class::get(player).getNpcStats(player).getFactionRanks()[factionID] = MWWorld::Class::get(player).getNpcStats(player).getFactionRanks()[factionID] +1;
|
player.getClass().getNpcStats(player).getFactionRanks()[factionID] = player.getClass().getNpcStats(player).getFactionRanks()[factionID] +1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -610,9 +610,9 @@ namespace MWScript
|
||||||
if(factionID != "")
|
if(factionID != "")
|
||||||
{
|
{
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
if(MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().find(factionID) != MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().end())
|
if(player.getClass().getNpcStats(player).getFactionRanks().find(factionID) != player.getClass().getNpcStats(player).getFactionRanks().end())
|
||||||
{
|
{
|
||||||
MWWorld::Class::get(player).getNpcStats(player).getFactionRanks()[factionID] = MWWorld::Class::get(player).getNpcStats(player).getFactionRanks()[factionID] -1;
|
player.getClass().getNpcStats(player).getFactionRanks()[factionID] = player.getClass().getNpcStats(player).getFactionRanks()[factionID] -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -635,22 +635,22 @@ namespace MWScript
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().empty())
|
if(ptr.getClass().getNpcStats(ptr).getFactionRanks().empty())
|
||||||
{
|
{
|
||||||
factionID = "";
|
factionID = "";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
factionID = MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().begin()->first;
|
factionID = ptr.getClass().getNpcStats(ptr).getFactionRanks().begin()->first;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
::Misc::StringUtils::toLower(factionID);
|
::Misc::StringUtils::toLower(factionID);
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
if(factionID!="")
|
if(factionID!="")
|
||||||
{
|
{
|
||||||
if(MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().find(factionID) != MWWorld::Class::get(player).getNpcStats(player).getFactionRanks().end())
|
if(player.getClass().getNpcStats(player).getFactionRanks().find(factionID) != player.getClass().getNpcStats(player).getFactionRanks().end())
|
||||||
{
|
{
|
||||||
runtime.push(MWWorld::Class::get(player).getNpcStats(player).getFactionRanks()[factionID]);
|
runtime.push(player.getClass().getNpcStats(player).getFactionRanks()[factionID]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -676,8 +676,8 @@ namespace MWScript
|
||||||
Interpreter::Type_Integer value = runtime[0].mInteger;
|
Interpreter::Type_Integer value = runtime[0].mInteger;
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
MWWorld::Class::get (ptr).getNpcStats (ptr).setBaseDisposition
|
ptr.getClass().getNpcStats (ptr).setBaseDisposition
|
||||||
(MWWorld::Class::get (ptr).getNpcStats (ptr).getBaseDisposition() + value);
|
(ptr.getClass().getNpcStats (ptr).getBaseDisposition() + value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -693,7 +693,7 @@ namespace MWScript
|
||||||
Interpreter::Type_Integer value = runtime[0].mInteger;
|
Interpreter::Type_Integer value = runtime[0].mInteger;
|
||||||
runtime.pop();
|
runtime.pop();
|
||||||
|
|
||||||
MWWorld::Class::get (ptr).getNpcStats (ptr).setBaseDisposition (value);
|
ptr.getClass().getNpcStats (ptr).setBaseDisposition (value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -739,8 +739,8 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
|
||||||
if (!MWWorld::Class::get (ptr).getNpcStats (ptr).getFactionRanks().empty())
|
if (!ptr.getClass().getNpcStats (ptr).getFactionRanks().empty())
|
||||||
factionId = MWWorld::Class::get (ptr).getNpcStats (ptr).getFactionRanks().begin()->first;
|
factionId = ptr.getClass().getNpcStats (ptr).getFactionRanks().begin()->first;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (factionId.empty())
|
if (factionId.empty())
|
||||||
|
@ -750,7 +750,7 @@ namespace MWScript
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
runtime.push (
|
runtime.push (
|
||||||
MWWorld::Class::get (player).getNpcStats (player).getFactionReputation (factionId));
|
player.getClass().getNpcStats (player).getFactionReputation (factionId));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -775,8 +775,8 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
|
||||||
if (!MWWorld::Class::get (ptr).getNpcStats (ptr).getFactionRanks().empty())
|
if (!ptr.getClass().getNpcStats (ptr).getFactionRanks().empty())
|
||||||
factionId = MWWorld::Class::get (ptr).getNpcStats (ptr).getFactionRanks().begin()->first;
|
factionId = ptr.getClass().getNpcStats (ptr).getFactionRanks().begin()->first;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (factionId.empty())
|
if (factionId.empty())
|
||||||
|
@ -785,7 +785,7 @@ namespace MWScript
|
||||||
::Misc::StringUtils::toLower (factionId);
|
::Misc::StringUtils::toLower (factionId);
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
MWWorld::Class::get (player).getNpcStats (player).setFactionReputation (factionId, value);
|
player.getClass().getNpcStats (player).setFactionReputation (factionId, value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -810,8 +810,8 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
|
||||||
if (!MWWorld::Class::get (ptr).getNpcStats (ptr).getFactionRanks().empty())
|
if (!ptr.getClass().getNpcStats (ptr).getFactionRanks().empty())
|
||||||
factionId = MWWorld::Class::get (ptr).getNpcStats (ptr).getFactionRanks().begin()->first;
|
factionId = ptr.getClass().getNpcStats (ptr).getFactionRanks().begin()->first;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (factionId.empty())
|
if (factionId.empty())
|
||||||
|
@ -820,8 +820,8 @@ namespace MWScript
|
||||||
::Misc::StringUtils::toLower (factionId);
|
::Misc::StringUtils::toLower (factionId);
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
MWWorld::Class::get (player).getNpcStats (player).setFactionReputation (factionId,
|
player.getClass().getNpcStats (player).setFactionReputation (factionId,
|
||||||
MWWorld::Class::get (player).getNpcStats (player).getFactionReputation (factionId)+
|
player.getClass().getNpcStats (player).getFactionReputation (factionId)+
|
||||||
value);
|
value);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -835,7 +835,7 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
|
||||||
runtime.push (MWWorld::Class::get (ptr).getCreatureStats (ptr).hasCommonDisease());
|
runtime.push (ptr.getClass().getCreatureStats (ptr).hasCommonDisease());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -848,7 +848,7 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
|
||||||
runtime.push (MWWorld::Class::get (ptr).getCreatureStats (ptr).hasBlightDisease());
|
runtime.push (ptr.getClass().getCreatureStats (ptr).hasBlightDisease());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -880,7 +880,7 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
||||||
|
|
||||||
runtime.push (MWWorld::Class::get(ptr).getNpcStats (ptr).getWerewolfKills ());
|
runtime.push (ptr.getClass().getNpcStats (ptr).getWerewolfKills ());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -901,13 +901,13 @@ namespace MWScript
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().empty())
|
if(ptr.getClass().getNpcStats(ptr).getFactionRanks().empty())
|
||||||
{
|
{
|
||||||
factionID = "";
|
factionID = "";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
factionID = MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().begin()->first;
|
factionID = ptr.getClass().getNpcStats(ptr).getFactionRanks().begin()->first;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
::Misc::StringUtils::toLower(factionID);
|
::Misc::StringUtils::toLower(factionID);
|
||||||
|
@ -939,13 +939,13 @@ namespace MWScript
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
if(MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().empty())
|
if(ptr.getClass().getNpcStats(ptr).getFactionRanks().empty())
|
||||||
{
|
{
|
||||||
factionID = "";
|
factionID = "";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
factionID = MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().begin()->first;
|
factionID = ptr.getClass().getNpcStats(ptr).getFactionRanks().begin()->first;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
|
@ -972,13 +972,13 @@ namespace MWScript
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
if(MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().empty())
|
if(ptr.getClass().getNpcStats(ptr).getFactionRanks().empty())
|
||||||
{
|
{
|
||||||
factionID = "";
|
factionID = "";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
factionID = MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().begin()->first;
|
factionID = ptr.getClass().getNpcStats(ptr).getFactionRanks().begin()->first;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
|
@ -997,11 +997,11 @@ namespace MWScript
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
|
||||||
std::string factionID = "";
|
std::string factionID = "";
|
||||||
if(MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().empty())
|
if(ptr.getClass().getNpcStats(ptr).getFactionRanks().empty())
|
||||||
return;
|
return;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
factionID = MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().begin()->first;
|
factionID = ptr.getClass().getNpcStats(ptr).getFactionRanks().begin()->first;
|
||||||
}
|
}
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
|
|
||||||
|
@ -1009,7 +1009,7 @@ namespace MWScript
|
||||||
if (ptr == player)
|
if (ptr == player)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::map<std::string, int>& ranks = MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks ();
|
std::map<std::string, int>& ranks = ptr.getClass().getNpcStats(ptr).getFactionRanks ();
|
||||||
ranks[factionID] = ranks[factionID]+1;
|
ranks[factionID] = ranks[factionID]+1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1024,11 +1024,11 @@ namespace MWScript
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
|
||||||
std::string factionID = "";
|
std::string factionID = "";
|
||||||
if(MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().empty())
|
if(ptr.getClass().getNpcStats(ptr).getFactionRanks().empty())
|
||||||
return;
|
return;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
factionID = MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks().begin()->first;
|
factionID = ptr.getClass().getNpcStats(ptr).getFactionRanks().begin()->first;
|
||||||
}
|
}
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
|
|
||||||
|
@ -1036,7 +1036,7 @@ namespace MWScript
|
||||||
if (ptr == player)
|
if (ptr == player)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::map<std::string, int>& ranks = MWWorld::Class::get(ptr).getNpcStats(ptr).getFactionRanks ();
|
std::map<std::string, int>& ranks = ptr.getClass().getNpcStats(ptr).getFactionRanks ();
|
||||||
ranks[factionID] = ranks[factionID]-1;
|
ranks[factionID] = ranks[factionID]-1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1051,10 +1051,10 @@ namespace MWScript
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
|
||||||
Interpreter::Type_Integer value =
|
Interpreter::Type_Integer value =
|
||||||
MWWorld::Class::get (ptr).getCreatureStats (ptr).hasDied();
|
ptr.getClass().getCreatureStats (ptr).hasDied();
|
||||||
|
|
||||||
if (value)
|
if (value)
|
||||||
MWWorld::Class::get (ptr).getCreatureStats (ptr).clearHasDied();
|
ptr.getClass().getCreatureStats (ptr).clearHasDied();
|
||||||
|
|
||||||
runtime.push (value);
|
runtime.push (value);
|
||||||
}
|
}
|
||||||
|
@ -1070,7 +1070,7 @@ namespace MWScript
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
|
||||||
Interpreter::Type_Integer value =
|
Interpreter::Type_Integer value =
|
||||||
MWWorld::Class::get (ptr).getCreatureStats (ptr).getKnockedDownOneFrame();
|
ptr.getClass().getCreatureStats (ptr).getKnockedDownOneFrame();
|
||||||
|
|
||||||
runtime.push (value);
|
runtime.push (value);
|
||||||
}
|
}
|
||||||
|
@ -1084,7 +1084,7 @@ namespace MWScript
|
||||||
virtual void execute (Interpreter::Runtime& runtime)
|
virtual void execute (Interpreter::Runtime& runtime)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = R()(runtime);
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
runtime.push(MWWorld::Class::get(ptr).getNpcStats(ptr).isWerewolf());
|
runtime.push(ptr.getClass().getNpcStats(ptr).isWerewolf());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -319,7 +319,7 @@ namespace MWScript
|
||||||
}
|
}
|
||||||
MWBase::Environment::get().getWorld()->rotateObject(ptr,ax,ay,zRot);
|
MWBase::Environment::get().getWorld()->rotateObject(ptr,ax,ay,zRot);
|
||||||
|
|
||||||
MWWorld::Class::get(ptr).adjustPosition(ptr);
|
ptr.getClass().adjustPosition(ptr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -366,7 +366,7 @@ namespace MWScript
|
||||||
zRot = zRot/60.;
|
zRot = zRot/60.;
|
||||||
}
|
}
|
||||||
MWBase::Environment::get().getWorld()->rotateObject(ptr,ax,ay,zRot);
|
MWBase::Environment::get().getWorld()->rotateObject(ptr,ax,ay,zRot);
|
||||||
MWWorld::Class::get(ptr).adjustPosition(ptr);
|
ptr.getClass().adjustPosition(ptr);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWorld()->breakInvisibility(actor);
|
MWBase::Environment::get().getWorld()->breakInvisibility(actor);
|
||||||
|
|
||||||
MWWorld::Class::get (getTarget()).apply (getTarget(), mId, actor);
|
getTarget().getClass().apply (getTarget(), mId, actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWorld()->breakInvisibility(actor);
|
MWBase::Environment::get().getWorld()->breakInvisibility(actor);
|
||||||
|
|
||||||
if (MWWorld::Class::get (getTarget()).apply (getTarget(), mId, actor) && mUsageType!=-1)
|
if (getTarget().getClass().apply (getTarget(), mId, actor) && mUsageType!=-1)
|
||||||
MWWorld::Class::get (getTarget()).skillUsageSucceeded (actor, mSkillIndex, mUsageType);
|
getTarget().getClass().skillUsageSucceeded (actor, mSkillIndex, mUsageType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,10 +20,10 @@ namespace MWWorld
|
||||||
getTarget().getContainerStore()->remove(getTarget(), 1, actor);
|
getTarget().getContainerStore()->remove(getTarget(), 1, actor);
|
||||||
|
|
||||||
// apply to actor
|
// apply to actor
|
||||||
std::string id = Class::get (getTarget()).getId (getTarget());
|
std::string id = getTarget().getClass().getId (getTarget());
|
||||||
|
|
||||||
if (Class::get (actor).apply (actor, id, actor))
|
if (actor.getClass().apply (actor, id, actor))
|
||||||
Class::get (actor).skillUsageSucceeded (actor, ESM::Skill::Alchemy, 1);
|
actor.getClass().skillUsageSucceeded (actor, ESM::Skill::Alchemy, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
ActionEat::ActionEat (const MWWorld::Ptr& object) : Action (false, object) {}
|
ActionEat::ActionEat (const MWWorld::Ptr& object) : Action (false, object) {}
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
|
|
||||||
// slots that this item can be equipped in
|
// slots that this item can be equipped in
|
||||||
std::pair<std::vector<int>, bool> slots_ = MWWorld::Class::get(getTarget()).getEquipmentSlots(getTarget());
|
std::pair<std::vector<int>, bool> slots_ = getTarget().getClass().getEquipmentSlots(getTarget());
|
||||||
|
|
||||||
// retrieve ContainerStoreIterator to the item
|
// retrieve ContainerStoreIterator to the item
|
||||||
MWWorld::ContainerStoreIterator it = invStore.begin();
|
MWWorld::ContainerStoreIterator it = invStore.begin();
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();
|
||||||
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(player).getNpcStats (player);
|
MWMechanics::NpcStats& npcStats = player.getClass().getNpcStats (player);
|
||||||
|
|
||||||
// Skill gain from books
|
// Skill gain from books
|
||||||
if (ref->mBase->mData.mSkillID >= 0 && ref->mBase->mData.mSkillID < ESM::Skill::Length
|
if (ref->mBase->mData.mSkillID >= 0 && ref->mBase->mData.mSkillID < ESM::Skill::Length
|
||||||
|
|
|
@ -36,7 +36,7 @@ namespace
|
||||||
MWWorld::Ptr container (&*iter, 0);
|
MWWorld::Ptr container (&*iter, 0);
|
||||||
|
|
||||||
MWWorld::Ptr ptr =
|
MWWorld::Ptr ptr =
|
||||||
MWWorld::Class::get (container).getContainerStore (container).search (id);
|
container.getClass().getContainerStore (container).search (id);
|
||||||
|
|
||||||
if (!ptr.isEmpty())
|
if (!ptr.isEmpty())
|
||||||
return ptr;
|
return ptr;
|
||||||
|
|
|
@ -323,7 +323,7 @@ namespace MWWorld
|
||||||
if(!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory))
|
if(!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory))
|
||||||
return boost::shared_ptr<Action>(new NullAction());
|
return boost::shared_ptr<Action>(new NullAction());
|
||||||
|
|
||||||
if(get(actor).isNpc() && get(actor).getNpcStats(actor).isWerewolf())
|
if(actor.getClass().isNpc() && actor.getClass().getNpcStats(actor).isWerewolf())
|
||||||
{
|
{
|
||||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||||
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfItem");
|
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfItem");
|
||||||
|
|
|
@ -325,12 +325,6 @@ namespace MWWorld
|
||||||
static const Class& get (const std::string& key);
|
static const Class& get (const std::string& key);
|
||||||
///< If there is no class for this \a key, an exception is thrown.
|
///< If there is no class for this \a key, an exception is thrown.
|
||||||
|
|
||||||
static const Class& get (const Ptr& ptr)
|
|
||||||
{
|
|
||||||
return ptr.getClass();
|
|
||||||
}
|
|
||||||
///< If there is no class for this pointer, an exception is thrown.
|
|
||||||
|
|
||||||
static void registerClass (const std::string& key, boost::shared_ptr<Class> instance);
|
static void registerClass (const std::string& key, boost::shared_ptr<Class> instance);
|
||||||
|
|
||||||
virtual int getBaseGold(const MWWorld::Ptr& ptr) const;
|
virtual int getBaseGold(const MWWorld::Ptr& ptr) const;
|
||||||
|
|
|
@ -142,8 +142,8 @@ void MWWorld::ContainerStore::unstack(const Ptr &ptr, const Ptr& container)
|
||||||
|
|
||||||
bool MWWorld::ContainerStore::stacks(const Ptr& ptr1, const Ptr& ptr2)
|
bool MWWorld::ContainerStore::stacks(const Ptr& ptr1, const Ptr& ptr2)
|
||||||
{
|
{
|
||||||
const MWWorld::Class& cls1 = MWWorld::Class::get(ptr1);
|
const MWWorld::Class& cls1 = ptr1.getClass();
|
||||||
const MWWorld::Class& cls2 = MWWorld::Class::get(ptr2);
|
const MWWorld::Class& cls2 = ptr2.getClass();
|
||||||
|
|
||||||
if (!Misc::StringUtils::ciEqual(ptr1.getCellRef().mRefID, ptr2.getCellRef().mRefID))
|
if (!Misc::StringUtils::ciEqual(ptr1.getCellRef().mRefID, ptr2.getCellRef().mRefID))
|
||||||
return false;
|
return false;
|
||||||
|
@ -226,14 +226,14 @@ MWWorld::ContainerStoreIterator MWWorld::ContainerStore::add (const Ptr& itemPtr
|
||||||
item.getCellRef().mPos.pos[1] = 0;
|
item.getCellRef().mPos.pos[1] = 0;
|
||||||
item.getCellRef().mPos.pos[2] = 0;
|
item.getCellRef().mPos.pos[2] = 0;
|
||||||
|
|
||||||
std::string script = MWWorld::Class::get(item).getScript(item);
|
std::string script = item.getClass().getScript(item);
|
||||||
if(script != "")
|
if(script != "")
|
||||||
{
|
{
|
||||||
CellStore *cell;
|
CellStore *cell;
|
||||||
|
|
||||||
MWBase::Environment::get().getWorld()->getLocalScripts().add(script, item);
|
MWBase::Environment::get().getWorld()->getLocalScripts().add(script, item);
|
||||||
|
|
||||||
if(&(MWWorld::Class::get (player).getContainerStore (player)) == this)
|
if(&(player.getClass().getContainerStore (player)) == this)
|
||||||
{
|
{
|
||||||
cell = 0; // Items in player's inventory have cell set to 0, so their scripts will never be removed
|
cell = 0; // Items in player's inventory have cell set to 0, so their scripts will never be removed
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ void MWWorld::InventoryStore::equip (int slot, const ContainerStoreIterator& ite
|
||||||
|
|
||||||
std::pair<std::vector<int>, bool> slots_;
|
std::pair<std::vector<int>, bool> slots_;
|
||||||
|
|
||||||
slots_ = Class::get (*iterator).getEquipmentSlots (*iterator);
|
slots_ = iterator->getClass().getEquipmentSlots (*iterator);
|
||||||
|
|
||||||
if (std::find (slots_.first.begin(), slots_.first.end(), slot)==slots_.first.end())
|
if (std::find (slots_.first.begin(), slots_.first.end(), slot)==slots_.first.end())
|
||||||
throw std::runtime_error ("invalid slot");
|
throw std::runtime_error ("invalid slot");
|
||||||
|
@ -258,7 +258,7 @@ void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& actor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(MWWorld::Class::get (test).canBeEquipped (test, actor).first)
|
switch(test.getClass().canBeEquipped (test, actor).first)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
continue;
|
continue;
|
||||||
|
@ -325,7 +325,7 @@ void MWWorld::InventoryStore::updateMagicEffects(const Ptr& actor)
|
||||||
if (*iter==end())
|
if (*iter==end())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
std::string enchantmentId = MWWorld::Class::get (**iter).getEnchantment (**iter);
|
std::string enchantmentId = (*iter)->getClass().getEnchantment (**iter);
|
||||||
|
|
||||||
if (!enchantmentId.empty())
|
if (!enchantmentId.empty())
|
||||||
{
|
{
|
||||||
|
@ -441,7 +441,7 @@ bool MWWorld::InventoryStore::stacks(const Ptr& ptr1, const Ptr& ptr2)
|
||||||
{
|
{
|
||||||
if (*iter != end() && (ptr1 == **iter || ptr2 == **iter))
|
if (*iter != end() && (ptr1 == **iter || ptr2 == **iter))
|
||||||
{
|
{
|
||||||
bool stackWhenEquipped = MWWorld::Class::get(**iter).getEquipmentSlots(**iter).second;
|
bool stackWhenEquipped = (*iter)->getClass().getEquipmentSlots(**iter).second;
|
||||||
if (!stackWhenEquipped)
|
if (!stackWhenEquipped)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -527,7 +527,7 @@ MWWorld::ContainerStoreIterator MWWorld::InventoryStore::unequipSlot(int slot, c
|
||||||
if (actor.getRefData().getHandle() == "player")
|
if (actor.getRefData().getHandle() == "player")
|
||||||
{
|
{
|
||||||
// Unset OnPCEquip Variable on item's script, if it has a script with that variable declared
|
// Unset OnPCEquip Variable on item's script, if it has a script with that variable declared
|
||||||
const std::string& script = Class::get(*it).getScript(*it);
|
const std::string& script = it->getClass().getScript(*it);
|
||||||
if (script != "")
|
if (script != "")
|
||||||
(*it).getRefData().getLocals().setVarByInt(script, "onpcequip", 0);
|
(*it).getRefData().getLocals().setVarByInt(script, "onpcequip", 0);
|
||||||
|
|
||||||
|
@ -579,7 +579,7 @@ void MWWorld::InventoryStore::visitEffectSources(MWMechanics::EffectSourceVisito
|
||||||
if (*iter==end())
|
if (*iter==end())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
std::string enchantmentId = MWWorld::Class::get (**iter).getEnchantment (**iter);
|
std::string enchantmentId = (*iter)->getClass().getEnchantment (**iter);
|
||||||
if (enchantmentId.empty())
|
if (enchantmentId.empty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
@ -36,10 +36,10 @@ namespace
|
||||||
|
|
||||||
MWWorld::Ptr containerPtr (&*iter, cell);
|
MWWorld::Ptr containerPtr (&*iter, cell);
|
||||||
|
|
||||||
MWWorld::ContainerStore& container = MWWorld::Class::get(containerPtr).getContainerStore(containerPtr);
|
MWWorld::ContainerStore& container = containerPtr.getClass().getContainerStore(containerPtr);
|
||||||
for(MWWorld::ContainerStoreIterator it3 = container.begin(); it3 != container.end(); ++it3)
|
for(MWWorld::ContainerStoreIterator it3 = container.begin(); it3 != container.end(); ++it3)
|
||||||
{
|
{
|
||||||
std::string script = MWWorld::Class::get(*it3).getScript(*it3);
|
std::string script = it3->getClass().getScript(*it3);
|
||||||
if(script != "")
|
if(script != "")
|
||||||
{
|
{
|
||||||
MWWorld::Ptr item = *it3;
|
MWWorld::Ptr item = *it3;
|
||||||
|
|
|
@ -538,7 +538,7 @@ namespace MWWorld
|
||||||
|
|
||||||
void PhysicsSystem::addObject (const Ptr& ptr, bool placeable)
|
void PhysicsSystem::addObject (const Ptr& ptr, bool placeable)
|
||||||
{
|
{
|
||||||
std::string mesh = MWWorld::Class::get(ptr).getModel(ptr);
|
std::string mesh = ptr.getClass().getModel(ptr);
|
||||||
Ogre::SceneNode* node = ptr.getRefData().getBaseNode();
|
Ogre::SceneNode* node = ptr.getRefData().getBaseNode();
|
||||||
handleToMesh[node->getName()] = mesh;
|
handleToMesh[node->getName()] = mesh;
|
||||||
OEngine::Physic::RigidBody* body = mEngine->createAndAdjustRigidBody(
|
OEngine::Physic::RigidBody* body = mEngine->createAndAdjustRigidBody(
|
||||||
|
@ -550,7 +550,7 @@ namespace MWWorld
|
||||||
|
|
||||||
void PhysicsSystem::addActor (const Ptr& ptr)
|
void PhysicsSystem::addActor (const Ptr& ptr)
|
||||||
{
|
{
|
||||||
std::string mesh = MWWorld::Class::get(ptr).getModel(ptr);
|
std::string mesh = ptr.getClass().getModel(ptr);
|
||||||
Ogre::SceneNode* node = ptr.getRefData().getBaseNode();
|
Ogre::SceneNode* node = ptr.getRefData().getBaseNode();
|
||||||
//TODO:optimize this. Searching the std::map isn't very efficient i think.
|
//TODO:optimize this. Searching the std::map isn't very efficient i think.
|
||||||
mEngine->addCharacter(node->getName(), mesh, node->getPosition(), node->getScale().x, node->getOrientation());
|
mEngine->addCharacter(node->getName(), mesh, node->getPosition(), node->getScale().x, node->getOrientation());
|
||||||
|
@ -651,7 +651,7 @@ namespace MWWorld
|
||||||
|
|
||||||
bool PhysicsSystem::getObjectAABB(const MWWorld::Ptr &ptr, Ogre::Vector3 &min, Ogre::Vector3 &max)
|
bool PhysicsSystem::getObjectAABB(const MWWorld::Ptr &ptr, Ogre::Vector3 &min, Ogre::Vector3 &max)
|
||||||
{
|
{
|
||||||
std::string model = MWWorld::Class::get(ptr).getModel(ptr);
|
std::string model = ptr.getClass().getModel(ptr);
|
||||||
if (model.empty()) {
|
if (model.empty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ namespace MWWorld
|
||||||
void Player::setDrawState (MWMechanics::DrawState_ state)
|
void Player::setDrawState (MWMechanics::DrawState_ state)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = getPlayer();
|
MWWorld::Ptr ptr = getPlayer();
|
||||||
MWWorld::Class::get(ptr).getNpcStats(ptr).setDrawState (state);
|
ptr.getClass().getNpcStats(ptr).setDrawState (state);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Player::getAutoMove() const
|
bool Player::getAutoMove() const
|
||||||
|
@ -94,13 +94,13 @@ namespace MWWorld
|
||||||
if (mAutoMove)
|
if (mAutoMove)
|
||||||
value = 1;
|
value = 1;
|
||||||
|
|
||||||
MWWorld::Class::get (ptr).getMovementSettings (ptr).mPosition[1] = value;
|
ptr.getClass().getMovementSettings (ptr).mPosition[1] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::setLeftRight (int value)
|
void Player::setLeftRight (int value)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = getPlayer();
|
MWWorld::Ptr ptr = getPlayer();
|
||||||
MWWorld::Class::get (ptr).getMovementSettings (ptr).mPosition[0] = value;
|
ptr.getClass().getMovementSettings (ptr).mPosition[0] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::setForwardBackward (int value)
|
void Player::setForwardBackward (int value)
|
||||||
|
@ -112,13 +112,13 @@ namespace MWWorld
|
||||||
if (mAutoMove)
|
if (mAutoMove)
|
||||||
value = 1;
|
value = 1;
|
||||||
|
|
||||||
MWWorld::Class::get (ptr).getMovementSettings (ptr).mPosition[1] = value;
|
ptr.getClass().getMovementSettings (ptr).mPosition[1] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::setUpDown(int value)
|
void Player::setUpDown(int value)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = getPlayer();
|
MWWorld::Ptr ptr = getPlayer();
|
||||||
MWWorld::Class::get (ptr).getMovementSettings (ptr).mPosition[2] = value;
|
ptr.getClass().getMovementSettings (ptr).mPosition[2] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::setRunState(bool run)
|
void Player::setRunState(bool run)
|
||||||
|
@ -136,23 +136,23 @@ namespace MWWorld
|
||||||
void Player::yaw(float yaw)
|
void Player::yaw(float yaw)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = getPlayer();
|
MWWorld::Ptr ptr = getPlayer();
|
||||||
MWWorld::Class::get(ptr).getMovementSettings(ptr).mRotation[2] += yaw;
|
ptr.getClass().getMovementSettings(ptr).mRotation[2] += yaw;
|
||||||
}
|
}
|
||||||
void Player::pitch(float pitch)
|
void Player::pitch(float pitch)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = getPlayer();
|
MWWorld::Ptr ptr = getPlayer();
|
||||||
MWWorld::Class::get(ptr).getMovementSettings(ptr).mRotation[0] += pitch;
|
ptr.getClass().getMovementSettings(ptr).mRotation[0] += pitch;
|
||||||
}
|
}
|
||||||
void Player::roll(float roll)
|
void Player::roll(float roll)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = getPlayer();
|
MWWorld::Ptr ptr = getPlayer();
|
||||||
MWWorld::Class::get(ptr).getMovementSettings(ptr).mRotation[1] += roll;
|
ptr.getClass().getMovementSettings(ptr).mRotation[1] += roll;
|
||||||
}
|
}
|
||||||
|
|
||||||
MWMechanics::DrawState_ Player::getDrawState()
|
MWMechanics::DrawState_ Player::getDrawState()
|
||||||
{
|
{
|
||||||
MWWorld::Ptr ptr = getPlayer();
|
MWWorld::Ptr ptr = getPlayer();
|
||||||
return MWWorld::Class::get(ptr).getNpcStats(ptr).getDrawState();
|
return ptr.getClass().getNpcStats(ptr).getDrawState();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Player::wasTeleported() const
|
bool Player::wasTeleported() const
|
||||||
|
|
|
@ -198,7 +198,7 @@ namespace MWWorld
|
||||||
float z = Ogre::Radian(pos.rot[2]).valueDegrees();
|
float z = Ogre::Radian(pos.rot[2]).valueDegrees();
|
||||||
world->rotateObject(player, x, y, z);
|
world->rotateObject(player, x, y, z);
|
||||||
|
|
||||||
MWWorld::Class::get(player).adjustPosition(player);
|
player.getClass().adjustPosition(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
MWBase::MechanicsManager *mechMgr =
|
MWBase::MechanicsManager *mechMgr =
|
||||||
|
@ -399,7 +399,7 @@ namespace MWWorld
|
||||||
float z = Ogre::Radian(position.rot[2]).valueDegrees();
|
float z = Ogre::Radian(position.rot[2]).valueDegrees();
|
||||||
world->rotateObject(world->getPlayerPtr(), x, y, z);
|
world->rotateObject(world->getPlayerPtr(), x, y, z);
|
||||||
|
|
||||||
MWWorld::Class::get(world->getPlayerPtr()).adjustPosition(world->getPlayerPtr());
|
world->getPlayerPtr().getClass().adjustPosition(world->getPlayerPtr());
|
||||||
world->getFader()->fadeIn(0.5f);
|
world->getFader()->fadeIn(0.5f);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -482,7 +482,7 @@ namespace MWWorld
|
||||||
void Scene::addObjectToScene (const Ptr& ptr)
|
void Scene::addObjectToScene (const Ptr& ptr)
|
||||||
{
|
{
|
||||||
mRendering.addObject(ptr);
|
mRendering.addObject(ptr);
|
||||||
MWWorld::Class::get(ptr).insertObject(ptr, *mPhysics);
|
ptr.getClass().insertObject(ptr, *mPhysics);
|
||||||
MWBase::Environment::get().getWorld()->rotateObject(ptr, 0, 0, 0, true);
|
MWBase::Environment::get().getWorld()->rotateObject(ptr, 0, 0, 0, true);
|
||||||
MWBase::Environment::get().getWorld()->scaleObject(ptr, ptr.getCellRef().mScale);
|
MWBase::Environment::get().getWorld()->scaleObject(ptr, ptr.getCellRef().mScale);
|
||||||
}
|
}
|
||||||
|
|
|
@ -537,8 +537,8 @@ namespace MWWorld
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ptr ptr = Class::get (mPlayer->getPlayer()).
|
Ptr ptr = mPlayer->getPlayer().getClass()
|
||||||
getContainerStore (mPlayer->getPlayer()).search (lowerCaseName);
|
.getContainerStore(mPlayer->getPlayer()).search(lowerCaseName);
|
||||||
|
|
||||||
if (!ptr.isEmpty())
|
if (!ptr.isEmpty())
|
||||||
return ptr;
|
return ptr;
|
||||||
|
@ -589,10 +589,10 @@ namespace MWWorld
|
||||||
reference.getTypeName()==typeid (ESM::NPC).name() ||
|
reference.getTypeName()==typeid (ESM::NPC).name() ||
|
||||||
reference.getTypeName()==typeid (ESM::Creature).name())
|
reference.getTypeName()==typeid (ESM::Creature).name())
|
||||||
{
|
{
|
||||||
MWWorld::ContainerStore& container = MWWorld::Class::get(reference).getContainerStore(reference);
|
MWWorld::ContainerStore& container = reference.getClass().getContainerStore(reference);
|
||||||
for(MWWorld::ContainerStoreIterator it = container.begin(); it != container.end(); ++it)
|
for(MWWorld::ContainerStoreIterator it = container.begin(); it != container.end(); ++it)
|
||||||
{
|
{
|
||||||
std::string script = MWWorld::Class::get(*it).getScript(*it);
|
std::string script = it->getClass().getScript(*it);
|
||||||
if(script != "")
|
if(script != "")
|
||||||
{
|
{
|
||||||
MWWorld::Ptr item = *it;
|
MWWorld::Ptr item = *it;
|
||||||
|
@ -624,10 +624,10 @@ namespace MWWorld
|
||||||
reference.getTypeName()==typeid (ESM::NPC).name() ||
|
reference.getTypeName()==typeid (ESM::NPC).name() ||
|
||||||
reference.getTypeName()==typeid (ESM::Creature).name())
|
reference.getTypeName()==typeid (ESM::Creature).name())
|
||||||
{
|
{
|
||||||
MWWorld::ContainerStore& container = MWWorld::Class::get(reference).getContainerStore(reference);
|
MWWorld::ContainerStore& container = reference.getClass().getContainerStore(reference);
|
||||||
for(MWWorld::ContainerStoreIterator it = container.begin(); it != container.end(); ++it)
|
for(MWWorld::ContainerStoreIterator it = container.begin(); it != container.end(); ++it)
|
||||||
{
|
{
|
||||||
std::string script = MWWorld::Class::get(*it).getScript(*it);
|
std::string script = it->getClass().getScript(*it);
|
||||||
if(script != "")
|
if(script != "")
|
||||||
{
|
{
|
||||||
MWWorld::Ptr item = *it;
|
MWWorld::Ptr item = *it;
|
||||||
|
@ -976,14 +976,14 @@ namespace MWWorld
|
||||||
removeContainerScripts (ptr);
|
removeContainerScripts (ptr);
|
||||||
haveToMove = false;
|
haveToMove = false;
|
||||||
|
|
||||||
MWWorld::Ptr newPtr = MWWorld::Class::get(ptr)
|
MWWorld::Ptr newPtr = ptr.getClass()
|
||||||
.copyToCell(ptr, *newCell);
|
.copyToCell(ptr, *newCell);
|
||||||
newPtr.getRefData().setBaseNode(0);
|
newPtr.getRefData().setBaseNode(0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MWWorld::Ptr copy =
|
MWWorld::Ptr copy =
|
||||||
MWWorld::Class::get(ptr).copyToCell(ptr, *newCell, pos);
|
ptr.getClass().copyToCell(ptr, *newCell, pos);
|
||||||
|
|
||||||
mRendering->updateObjectCell(ptr, copy);
|
mRendering->updateObjectCell(ptr, copy);
|
||||||
MWBase::Environment::get().getSoundManager()->updatePtr (ptr, copy);
|
MWBase::Environment::get().getSoundManager()->updatePtr (ptr, copy);
|
||||||
|
@ -992,7 +992,7 @@ namespace MWWorld
|
||||||
mechMgr->updateCell(ptr, copy);
|
mechMgr->updateCell(ptr, copy);
|
||||||
|
|
||||||
std::string script =
|
std::string script =
|
||||||
MWWorld::Class::get(ptr).getScript(ptr);
|
ptr.getClass().getScript(ptr);
|
||||||
if (!script.empty())
|
if (!script.empty())
|
||||||
{
|
{
|
||||||
mLocalScripts.remove(ptr);
|
mLocalScripts.remove(ptr);
|
||||||
|
@ -1035,7 +1035,7 @@ namespace MWWorld
|
||||||
void World::scaleObject (const Ptr& ptr, float scale)
|
void World::scaleObject (const Ptr& ptr, float scale)
|
||||||
{
|
{
|
||||||
ptr.getCellRef().mScale = scale;
|
ptr.getCellRef().mScale = scale;
|
||||||
MWWorld::Class::get(ptr).adjustScale(ptr,scale);
|
ptr.getClass().adjustScale(ptr,scale);
|
||||||
|
|
||||||
if(ptr.getRefData().getBaseNode() == 0)
|
if(ptr.getRefData().getBaseNode() == 0)
|
||||||
return;
|
return;
|
||||||
|
@ -1062,7 +1062,7 @@ namespace MWWorld
|
||||||
objRot[2] = rot.z;
|
objRot[2] = rot.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Class::get(ptr).isActor())
|
if(ptr.getClass().isActor())
|
||||||
{
|
{
|
||||||
/* HACK? Actors shouldn't really be rotating around X (or Y), but
|
/* HACK? Actors shouldn't really be rotating around X (or Y), but
|
||||||
* currently it's done so for rotating the camera, which needs
|
* currently it's done so for rotating the camera, which needs
|
||||||
|
@ -1580,7 +1580,7 @@ namespace MWWorld
|
||||||
|
|
||||||
void World::PCDropped (const Ptr& item)
|
void World::PCDropped (const Ptr& item)
|
||||||
{
|
{
|
||||||
std::string script = MWWorld::Class::get(item).getScript(item);
|
std::string script = item.getClass().getScript(item);
|
||||||
|
|
||||||
// Set OnPCDrop Variable on item's script, if it has a script with that variable declared
|
// Set OnPCDrop Variable on item's script, if it has a script with that variable declared
|
||||||
if(script != "")
|
if(script != "")
|
||||||
|
@ -1648,13 +1648,13 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
|
|
||||||
MWWorld::Ptr dropped =
|
MWWorld::Ptr dropped =
|
||||||
MWWorld::Class::get(object).copyToCell(object, *cell, pos);
|
object.getClass().copyToCell(object, *cell, pos);
|
||||||
|
|
||||||
if (mWorldScene->isCellActive(*cell)) {
|
if (mWorldScene->isCellActive(*cell)) {
|
||||||
if (dropped.getRefData().isEnabled()) {
|
if (dropped.getRefData().isEnabled()) {
|
||||||
mWorldScene->addObjectToScene(dropped);
|
mWorldScene->addObjectToScene(dropped);
|
||||||
}
|
}
|
||||||
std::string script = MWWorld::Class::get(dropped).getScript(dropped);
|
std::string script = dropped.getClass().getScript(dropped);
|
||||||
if (!script.empty()) {
|
if (!script.empty()) {
|
||||||
mLocalScripts.add(script, dropped);
|
mLocalScripts.add(script, dropped);
|
||||||
}
|
}
|
||||||
|
@ -1863,7 +1863,7 @@ namespace MWWorld
|
||||||
if((!physactor->getOnGround()&&physactor->getCollisionMode()) || isUnderwater(currentCell, playerPos))
|
if((!physactor->getOnGround()&&physactor->getCollisionMode()) || isUnderwater(currentCell, playerPos))
|
||||||
return 2;
|
return 2;
|
||||||
if((currentCell->getCell()->mData.mFlags&ESM::Cell::NoSleep) ||
|
if((currentCell->getCell()->mData.mFlags&ESM::Cell::NoSleep) ||
|
||||||
Class::get(player).getNpcStats(player).isWerewolf())
|
player.getClass().getNpcStats(player).isWerewolf())
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2107,7 +2107,7 @@ namespace MWWorld
|
||||||
|
|
||||||
void World::setWerewolf(const MWWorld::Ptr& actor, bool werewolf)
|
void World::setWerewolf(const MWWorld::Ptr& actor, bool werewolf)
|
||||||
{
|
{
|
||||||
MWMechanics::NpcStats& npcStats = Class::get(actor).getNpcStats(actor);
|
MWMechanics::NpcStats& npcStats = actor.getClass().getNpcStats(actor);
|
||||||
|
|
||||||
// The actor does not have to change state
|
// The actor does not have to change state
|
||||||
if (npcStats.isWerewolf() == werewolf)
|
if (npcStats.isWerewolf() == werewolf)
|
||||||
|
@ -2119,7 +2119,7 @@ namespace MWWorld
|
||||||
// bones that do not even exist with the werewolf object root.
|
// bones that do not even exist with the werewolf object root.
|
||||||
// Therefore, make sure to unequip everything at once, and only fire the change event
|
// Therefore, make sure to unequip everything at once, and only fire the change event
|
||||||
// (which will rebuild the animation parts) afterwards. unequipAll will do this for us.
|
// (which will rebuild the animation parts) afterwards. unequipAll will do this for us.
|
||||||
MWWorld::InventoryStore& invStore = MWWorld::Class::get(actor).getInventoryStore(actor);
|
MWWorld::InventoryStore& invStore = actor.getClass().getInventoryStore(actor);
|
||||||
invStore.unequipAll(actor);
|
invStore.unequipAll(actor);
|
||||||
|
|
||||||
if(werewolf)
|
if(werewolf)
|
||||||
|
@ -2158,7 +2158,7 @@ namespace MWWorld
|
||||||
void World::applyWerewolfAcrobatics(const Ptr &actor)
|
void World::applyWerewolfAcrobatics(const Ptr &actor)
|
||||||
{
|
{
|
||||||
const Store<ESM::GameSetting> &gmst = getStore().get<ESM::GameSetting>();
|
const Store<ESM::GameSetting> &gmst = getStore().get<ESM::GameSetting>();
|
||||||
MWMechanics::NpcStats &stats = Class::get(actor).getNpcStats(actor);
|
MWMechanics::NpcStats &stats = actor.getClass().getNpcStats(actor);
|
||||||
|
|
||||||
stats.getSkill(ESM::Skill::Acrobatics).setBase(gmst.find("fWerewolfAcrobatics")->getFloat());
|
stats.getSkill(ESM::Skill::Acrobatics).setBase(gmst.find("fWerewolfAcrobatics")->getFloat());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue