コード例 #1
0
ファイル: statsextensions.cpp プロジェクト: dhardy/openmw
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    MWScript::InterpreterContext& context
                        = static_cast<MWScript::InterpreterContext&> (runtime.getContext());

                    std::string id = runtime.getStringLiteral (runtime[0].mInteger);
                    runtime.pop();

                    MWWorld::Ptr ptr = context.getWorld().getPtr (id, false);

                    if (mIndex==0 && MWWorld::Class::get (ptr).hasItemHealth (ptr))
                    {
                        // health is a special case
                        Interpreter::Type_Integer value =
                            MWWorld::Class::get (ptr).getItemMaxHealth (ptr);
                        runtime.push (value);

                        return;
                    }

                    Interpreter::Type_Integer value =
                        MWWorld::Class::get (ptr).getCreatureStats (ptr).mDynamic[mIndex].
                        getCurrent();

                    runtime.push (value);
                }
コード例 #2
0
ファイル: cellextensions.cpp プロジェクト: Chiur/openmw
 virtual void execute (Interpreter::Runtime& runtime)
 {
     MWWorld::CellStore *cell = MWBase::Environment::get().getWorld()->getPlayerPtr().getCell();
     if (cell->getCell()->hasWater())
         runtime.push (cell->getWaterLevel());
     else
         runtime.push (-std::numeric_limits<float>().max());
 }
コード例 #3
0
ファイル: cellextensions.cpp プロジェクト: devnexen/openmw
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    if (!MWMechanics::getPlayer().isInCell())
                    {
                        runtime.push (0);
                        return;
                    }

                    bool interior =
                        !MWMechanics::getPlayer().getCell()->getCell()->isExterior();

                    runtime.push (interior ? 1 : 0);
                }
コード例 #4
0
ファイル: cellextensions.cpp プロジェクト: AAlderman/openmw
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    if (!MWBase::Environment::get().getWorld()->getPlayerPtr().isInCell())
                    {
                        runtime.push (0);
                        return;
                    }

                    bool interior =
                        !MWBase::Environment::get().getWorld()->getPlayerPtr().getCell()->getCell()->isExterior();

                    runtime.push (interior ? 1 : 0);
                }
コード例 #5
0
ファイル: cellextensions.cpp プロジェクト: Kafou1/openmw
 virtual void execute (Interpreter::Runtime& runtime)
 {
     if (!MWMechanics::getPlayer().isInCell())
     {
         runtime.push(0.f);
         return;
     }
     MWWorld::CellStore *cell = MWMechanics::getPlayer().getCell();
     if (cell->getCell()->hasWater())
         runtime.push (cell->getWaterLevel());
     else
         runtime.push (-std::numeric_limits<float>::max());
 }
コード例 #6
0
ファイル: containerextensions.cpp プロジェクト: 4DA/openmw
                virtual void execute(Interpreter::Runtime &runtime)
                {
                    MWWorld::Ptr ptr = R()(runtime);

                    MWWorld::InventoryStore& invStore = MWWorld::Class::get(ptr).getInventoryStore (ptr);
                    MWWorld::ContainerStoreIterator it = invStore.getSlot (MWWorld::InventoryStore::Slot_CarriedRight);
                    if (it == invStore.end() || it->getTypeName () != typeid(ESM::Weapon).name())
                    {
                        runtime.push(-1);
                        return;
                    }

                    runtime.push(it->get<ESM::Weapon>()->mBase->mData.mType);
                }
コード例 #7
0
ファイル: cellextensions.cpp プロジェクト: devnexen/openmw
 virtual void execute (Interpreter::Runtime& runtime)
 {
     if (!MWMechanics::getPlayer().isInCell())
     {
         runtime.push(0.f);
         return;
     }
     MWWorld::CellStore *cell = MWMechanics::getPlayer().getCell();
     if (cell->isExterior())
         runtime.push(0.f); // vanilla oddity, return 0 even though water is actually at -1
     else if (cell->getCell()->hasWater())
         runtime.push (cell->getWaterLevel());
     else
         runtime.push (-std::numeric_limits<float>::max());
 }
コード例 #8
0
ファイル: controlextensions.cpp プロジェクト: Allofich/openmw
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    MWWorld::Ptr ptr = R()(runtime);

                    MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats(ptr);
                    runtime.push (stats.getMovementFlag (MWMechanics::CreatureStats::Flag_ForceSneak));
                }
コード例 #9
0
ファイル: aiextensions.cpp プロジェクト: ace13/openmw
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    MWWorld::Ptr ptr = R()(runtime);

                    runtime.push(ptr.getClass().getCreatureStats (ptr).getAiSetting (
                                     (MWMechanics::CreatureStats::AiSetting)mIndex).getModified());
                }
コード例 #10
0
ファイル: miscextensions.cpp プロジェクト: UIKit0/openmw
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    float param = runtime[0].mFloat;
                    runtime.pop();

                    runtime.push(std::sqrt (param));
                }
コード例 #11
0
ファイル: dialogueextensions.cpp プロジェクト: 0xmono/openmw
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    MWWorld::Ptr ptr = R()(runtime);

                    MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayerPtr();

                    runtime.push (ptr.getClass().getNpcStats (ptr).isSameFaction (player.getClass().getNpcStats (player)));
                }
コード例 #12
0
ファイル: aiextensions.cpp プロジェクト: ace13/openmw
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    MWWorld::Ptr ptr = R()(runtime);

                    Interpreter::Type_Integer value = ptr.getClass().getCreatureStats (ptr).getAiSequence().getLastRunTypeId();

                    runtime.push (value);
                }
コード例 #13
0
ファイル: cellextensions.cpp プロジェクト: valistar/openmw
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    bool interior =
                        MWBase::Environment::get().getWorld()->getPlayer().getPlayer().getCell()->cell->mData.mFlags &
                            ESM::Cell::Interior;

                    runtime.push (interior ? 1 : 0);
                }
コード例 #14
0
ファイル: miscextensions.cpp プロジェクト: UIKit0/openmw
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    MWWorld::Ptr ptr = R()(runtime);
                    std::string id = runtime.getStringLiteral(runtime[0].mInteger);
                    runtime.pop();

                    runtime.push(MWWorld::Class::get(ptr).getCreatureStats(ptr).getActiveSpells().isSpellActive(id));
                }
コード例 #15
0
ファイル: aiextensions.cpp プロジェクト: tdunn19/openmw
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    MWWorld::Ptr ptr = R()(runtime);

                    Interpreter::Type_Integer value = MWWorld::Class::get (ptr).getCreatureStats (ptr).getAiSequence().isPackageDone();

                    runtime.push (value);
                }
コード例 #16
0
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    MWWorld::Ptr ptr = R()(runtime);

                    MWMechanics::NpcStats& npcStats = MWWorld::Class::get(ptr).getNpcStats (ptr);

                    runtime.push (npcStats.getMovementFlag (MWMechanics::NpcStats::Flag_ForceSneak));
                }
コード例 #17
0
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    InterpreterContext& context =
                        static_cast<InterpreterContext&> (runtime.getContext());

                    MWWorld::Ptr ptr = context.getReference();

                    runtime.push (MWBase::Environment::get().getWindowManager()->readPressedButton());
                }
コード例 #18
0
ファイル: miscextensions.cpp プロジェクト: Gohan1989/openmw
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    InterpreterContext& context =
                        static_cast<InterpreterContext&> (runtime.getContext());

                    MWWorld::Ptr ptr = context.getReference();

                    runtime.push (context.hasBeenActivated (ptr));
                }
コード例 #19
0
ファイル: controlextensions.cpp プロジェクト: Allofich/openmw
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->getPlayerPtr();
                    const MWWorld::Class &cls = ptr.getClass();

                    bool isSneaking = MWBase::Environment::get().getMechanicsManager()->isSneaking(ptr);

                    runtime.push (isSneaking && cls.getCreatureStats(ptr).getStance(MWMechanics::CreatureStats::Stance_Sneak));
                }
コード例 #20
0
ファイル: containerextensions.cpp プロジェクト: 4DA/openmw
                virtual void execute(Interpreter::Runtime &runtime)
                {
                    MWWorld::Ptr ptr = R()(runtime);

                    std::string item = runtime.getStringLiteral (runtime[0].mInteger);
                    runtime.pop();

                    MWWorld::InventoryStore& invStore = MWWorld::Class::get(ptr).getInventoryStore (ptr);
                    for (int slot = 0; slot < MWWorld::InventoryStore::Slots; ++slot)
                    {
                        MWWorld::ContainerStoreIterator it = invStore.getSlot (slot);
                        if (it != invStore.end() && Misc::StringUtils::ciEqual(it->getCellRef().mRefID, item))
                        {
                            runtime.push(1);
                            return;
                        }
                    }
                    runtime.push(0);
                }
コード例 #21
0
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    MWWorld::Ptr ptr = R()(runtime);

                    int index = runtime[0].mInteger;
                    runtime.pop();

                    runtime.push (MWBase::Environment::get().getSoundManager()->getSoundPlaying (
                        ptr, runtime.getStringLiteral (index)));
                }
コード例 #22
0
ファイル: dialogueextensions.cpp プロジェクト: 0xmono/openmw
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    std::string quest = runtime.getStringLiteral (runtime[0].mInteger);
                    runtime.pop();

                    int index = MWBase::Environment::get().getJournal()->getJournalIndex (quest);

                    runtime.push (index);

                }
コード例 #23
0
ファイル: miscextensions.cpp プロジェクト: UIKit0/openmw
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    MWWorld::Ptr ptr = R()(runtime);

                    int key = runtime[0].mInteger;
                    runtime.pop();

                    runtime.push (MWWorld::Class::get(ptr).getCreatureStats (ptr).getMagicEffects ().get (
                                      MWMechanics::EffectKey(key)).mMagnitude > 0);
                }
コード例 #24
0
ファイル: miscextensions.cpp プロジェクト: UIKit0/openmw
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    MWWorld::Ptr ptr = R()(runtime);

                    std::string objectID = runtime.getStringLiteral (runtime[0].mInteger);
                    runtime.pop();

                    MWMechanics::CreatureStats &stats = MWWorld::Class::get(ptr).getCreatureStats(ptr);
                    runtime.push(::Misc::StringUtils::ciEqual(objectID, stats.getLastHitObject()));
                }
コード例 #25
0
ファイル: statsextensions.cpp プロジェクト: hanikesn/openmw
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    MWWorld::Ptr ptr = R()(runtime);

                    Interpreter::Type_Integer value =
                        MWWorld::Class::get (ptr).getCreatureStats (ptr).mAttributes[mIndex].
                        getModified();

                    runtime.push (value);
                }
コード例 #26
0
            virtual void execute (Interpreter::Runtime& runtime)
            {
                std::string faction1 = runtime.getStringLiteral (runtime[0].mInteger);
                runtime.pop();

                std::string faction2 = runtime.getStringLiteral (runtime[0].mInteger);
                runtime.pop();

                runtime.push(MWBase::Environment::get().getDialogueManager()
                             ->getFactionReaction(faction1, faction2));
            }
コード例 #27
0
ファイル: cellextensions.cpp プロジェクト: devnexen/openmw
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    std::string name = runtime.getStringLiteral (runtime[0].mInteger);
                    runtime.pop();

                    if (!MWMechanics::getPlayer().isInCell())
                    {
                        runtime.push(0);
                        return;
                    }
                    const MWWorld::CellStore *cell = MWMechanics::getPlayer().getCell();

                    std::string current = MWBase::Environment::get().getWorld()->getCellName(cell);
                    Misc::StringUtils::lowerCaseInPlace(current);

                    bool match = current.length()>=name.length() &&
                        current.substr (0, name.length())==name;

                    runtime.push (match ? 1 : 0);
                }
コード例 #28
0
ファイル: containerextensions.cpp プロジェクト: 4DA/openmw
                virtual void execute(Interpreter::Runtime &runtime)
                {
                    MWWorld::Ptr ptr = R()(runtime);
      
		    const std::string &name = runtime.getStringLiteral (runtime[0].mInteger);
                    runtime.pop();

                    MWWorld::InventoryStore& invStore = MWWorld::Class::get(ptr).getInventoryStore (ptr);
                    for (MWWorld::ContainerStoreIterator it = invStore.begin(MWWorld::ContainerStore::Type_Miscellaneous);
                         it != invStore.end(); ++it)
                    {

                        if (Misc::StringUtils::ciEqual(it->getCellRef().mSoul, name))
                        {
                            runtime.push(1);
                            return;
                        }
                    }
                    runtime.push(0);
                }
コード例 #29
0
ファイル: aiextensions.cpp プロジェクト: ace13/openmw
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    MWWorld::Ptr observer = R()(runtime);
                    std::string actorID = runtime.getStringLiteral (runtime[0].mInteger);
                    runtime.pop();

                    MWWorld::Ptr actor = MWBase::Environment::get().getWorld()->getPtr(actorID, true);

                    if(!actor.getClass().isActor() || !observer.getClass().isActor())
                    {
                        runtime.push(0);
                        return;
                    }

                    Interpreter::Type_Integer value =
                            MWBase::Environment::get().getWorld()->getLOS(observer, actor) &&
                            MWBase::Environment::get().getMechanicsManager()->awarenessCheck(actor, observer);

                    runtime.push (value);
                }
コード例 #30
0
ファイル: statsextensions.cpp プロジェクト: hanikesn/openmw
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    MWWorld::Ptr ptr = R()(runtime);

                    if (mIndex==0 && MWWorld::Class::get (ptr).hasItemHealth (ptr))
                    {
                        // health is a special case
                        Interpreter::Type_Integer value =
                            MWWorld::Class::get (ptr).getItemMaxHealth (ptr);
                        runtime.push (value);

                        return;
                    }

                    Interpreter::Type_Integer value =
                        MWWorld::Class::get (ptr).getCreatureStats (ptr).mDynamic[mIndex].
                        getCurrent();

                    runtime.push (value);
                }