示例#1
0
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    InterpreterContext& context =
                        static_cast<InterpreterContext&> (runtime.getContext());

                    context.getInputManager().setGuiMode(mDialogue);
                }
示例#2
0
        MWWorld::Ptr operator() (Interpreter::Runtime& runtime) const
        {
            MWScript::InterpreterContext& context
                = static_cast<MWScript::InterpreterContext&> (runtime.getContext());

            return context.getReference();
        }
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    InterpreterContext& context
                        = static_cast<InterpreterContext&> (runtime.getContext());

                    context.getWorld().toggleCollisionMode();
                }
示例#4
0
                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);
                }
示例#5
0
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    InterpreterContext& context =
                        static_cast<InterpreterContext&> (runtime.getContext());

                    context.getWindowManager().allow (mWindow);
                }
示例#6
0
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    InterpreterContext& context =
                        static_cast<InterpreterContext&> (runtime.getContext());

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

                    context.executeActivation();
                }
示例#7
0
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    InterpreterContext& context =
                        static_cast<InterpreterContext&> (runtime.getContext());

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

                    runtime.push (context.hasBeenActivated (ptr));
                }
示例#8
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());
                }
示例#9
0
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    InterpreterContext& context
                        = static_cast<InterpreterContext&> (runtime.getContext());

                    bool enabled = MWBase::Environment::get().getMechanicsManager()->toggleAI();

                    context.report (enabled ? "AI -> On" : "AI -> Off");
                }
示例#10
0
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    InterpreterContext& context
                        = static_cast<InterpreterContext&> (runtime.getContext());

                    bool enabled = MWBase::Environment::get().getWorld()->toggleCollisionMode();

                    context.report (enabled ? "Collision -> On" : "Collision -> Off");
                }
示例#11
0
            virtual void execute (Interpreter::Runtime& runtime)
            {
                InterpreterContext& context =
                    static_cast<InterpreterContext&> (runtime.getContext());

                bool enabled =
                    MWBase::Environment::get().getWorld()->toggleRenderMode (MWBase::World::Render_Pathgrid);

                context.report (enabled ?
                    "Path Grid rendering -> On" : "Path Grid Rendering -> Off");
            }
示例#12
0
            virtual void execute(Interpreter::Runtime &runtime)
            {
                bool state = MWBase::Environment::get().getWindowManager()->toggleGui();
                runtime.getContext().report(state ? "GUI -> On" : "GUI -> Off");

                if (!state)
                {
                    while (MWBase::Environment::get().getWindowManager()->getMode() != MWGui::GM_None) // don't use isGuiMode, or we get an infinite loop for modal message boxes!
                        MWBase::Environment::get().getWindowManager()->popGuiMode();
                }
            }
示例#13
0
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    InterpreterContext& context =
                        static_cast<InterpreterContext&> (runtime.getContext());

                    bool enabled =
                        MWBase::Environment::get().getWorld()->toggleRenderMode (MWWorld::World::Render_CollisionDebug);

                    context.report (enabled ?
                        "Collision Mesh Rendering -> On" : "Collision Mesh Rendering -> Off");
                }
示例#14
0
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    MWScript::InterpreterContext& context
                        = static_cast<MWScript::InterpreterContext&> (runtime.getContext());

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

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

                    runtime.push (value);
                }
示例#15
0
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    MWScript::InterpreterContext& context
                        = static_cast<MWScript::InterpreterContext&> (runtime.getContext());

                    Interpreter::Type_Integer value = runtime[0].mInteger;
                    runtime.pop();

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

                    MWWorld::Class::get (ptr).getCreatureStats (ptr).mAttributes[mIndex].
                        setModified (value, 0);
                }
示例#16
0
            virtual void execute(Interpreter::Runtime &runtime)
            {
                InterpreterContext& context =
                    static_cast<InterpreterContext&> (runtime.getContext());

                MWBase::World *world =
                    MWBase::Environment::get().getWorld();

                if (world->toggleVanityMode(sActivate)) {
                    context.report(sActivate ? "Vanity Mode -> On" : "Vanity Mode -> Off");
                    sActivate = !sActivate;
                } else {
                    context.report("Vanity Mode -> No");
                }
            }
示例#17
0
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    MWScript::InterpreterContext& context
                        = static_cast<MWScript::InterpreterContext&> (runtime.getContext());

                    Interpreter::Type_Integer diff = runtime[0].mInteger;
                    runtime.pop();

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

                    MWMechanics::CreatureStats& stats = MWWorld::Class::get (ptr).getCreatureStats (ptr);

                    Interpreter::Type_Integer current = stats.mDynamic[mIndex].getCurrent();

                    stats.mDynamic[mIndex].setCurrent (diff + current);
                }
示例#18
0
                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();

                    Interpreter::Type_Integer value = runtime[0].mInteger;
                    runtime.pop();

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

                    MWWorld::Class::get (ptr).getCreatureStats (ptr).mAttributes[mIndex].
                        setModified (value, 0);
                }
示例#19
0
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    MWWorld::Ptr ptr = R()(runtime);

                    if (!ptr.getRefData().isEnabled())
                        return;

                    if (!ptr.getClass().isActor())
                    {
                        const std::string error = "Warning: \"forcegreeting\" command works only for actors.";
                        runtime.getContext().report(error);
                        Log(Debug::Warning) << error;
                        return;
                    }

                    MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Dialogue, ptr);
                }
示例#20
0
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    MWWorld::Ptr ptr = R()(runtime);

                    MWScript::InterpreterContext& context
                        = static_cast<MWScript::InterpreterContext&> (runtime.getContext());

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

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

                    MWBase::Environment::get().getSoundManager()->say (ptr, file);

                    if (MWBase::Environment::get().getWindowManager ()->getSubtitlesEnabled())
                        context.messageBox (text);
                }
示例#21
0
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    MWScript::InterpreterContext& context
                        = static_cast<MWScript::InterpreterContext&> (runtime.getContext());

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

                    MWMechanics::CreatureStats& stats = MWWorld::Class::get (ptr).getCreatureStats (ptr);

                    Interpreter::Type_Float value = 0;

                    Interpreter::Type_Float max = stats.mDynamic[mIndex].getModified();

                    if (max>0)
                        value = stats.mDynamic[mIndex].getCurrent() / max;

                    runtime.push (value);
                }
示例#22
0
                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);

                    MWMechanics::CreatureStats& stats =
                        MWWorld::Class::get (ptr).getCreatureStats (ptr);

                    Interpreter::Type_Float value = 0;

                    Interpreter::Type_Float max = stats.mDynamic[mIndex].getModified();

                    if (max>0)
                        value = stats.mDynamic[mIndex].getCurrent() / max;

                    runtime.push (value);
                }
示例#23
0
                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();

                    Interpreter::Type_Integer diff = runtime[0].mInteger;
                    runtime.pop();

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

                    MWMechanics::CreatureStats& stats =
                        MWWorld::Class::get (ptr).getCreatureStats (ptr);

                    Interpreter::Type_Integer current = stats.mDynamic[mIndex].getCurrent();

                    stats.mDynamic[mIndex].setModified (
                        diff + stats.mDynamic[mIndex].getModified(), 0);

                    stats.mDynamic[mIndex].setCurrent (diff + current);
                }
示例#24
0
 virtual void execute (Interpreter::Runtime& runtime)
 {
     runtime.getContext().report(MWBase::Environment::get().getWindowManager()->toggleFogOfWar() ? "Fog of war -> On"
                                                                                                 : "Fog of war -> Off");
 }
示例#25
0
 virtual void execute (Interpreter::Runtime& runtime)
 {
     runtime.push (static_cast<InterpreterContext&> (
         runtime.getContext()).hasBeenActivated());
 } 
示例#26
0
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    bool enabled = MWBase::Environment::get().getMechanicsManager()->toggleAI();

                    runtime.getContext().report (enabled ? "AI -> On" : "AI -> Off");
                }
示例#27
0
                virtual void execute (Interpreter::Runtime& runtime)
                {
                    bool enabled = MWBase::Environment::get().getWorld()->toggleCollisionMode();

                    runtime.getContext().report (enabled ? "Collision -> On" : "Collision -> Off");
                }