2010-07-05 13:15:49 +02:00
|
|
|
|
|
|
|
#include "miscextensions.hpp"
|
|
|
|
|
2013-08-13 19:18:21 -07:00
|
|
|
#include <cstdlib>
|
|
|
|
|
2010-07-05 13:15:49 +02:00
|
|
|
#include <components/compiler/extensions.hpp>
|
2013-08-06 20:38:41 -04:00
|
|
|
#include <components/compiler/opcodes.hpp>
|
2013-08-13 04:36:20 -07:00
|
|
|
#include <components/compiler/locals.hpp>
|
2010-07-05 13:15:49 +02:00
|
|
|
|
|
|
|
#include <components/interpreter/interpreter.hpp>
|
|
|
|
#include <components/interpreter/runtime.hpp>
|
|
|
|
#include <components/interpreter/opcodes.hpp>
|
|
|
|
|
2014-02-23 20:11:05 +01:00
|
|
|
#include <components/esm/loadmgef.hpp>
|
|
|
|
#include <components/esm/loadcrea.hpp>
|
|
|
|
|
2012-04-23 15:27:03 +02:00
|
|
|
#include "../mwbase/environment.hpp"
|
2012-09-19 03:11:23 +02:00
|
|
|
#include "../mwbase/windowmanager.hpp"
|
2013-08-13 04:36:20 -07:00
|
|
|
#include "../mwbase/scriptmanager.hpp"
|
2012-04-23 15:27:03 +02:00
|
|
|
|
2010-08-30 12:30:34 +02:00
|
|
|
#include "../mwworld/class.hpp"
|
2014-04-05 10:26:14 -04:00
|
|
|
#include "../mwworld/player.hpp"
|
2013-01-07 18:16:50 +00:00
|
|
|
#include "../mwworld/containerstore.hpp"
|
2014-02-23 20:11:05 +01:00
|
|
|
#include "../mwworld/esmstore.hpp"
|
2014-07-01 21:41:23 +02:00
|
|
|
#include "../mwworld/cellstore.hpp"
|
2012-11-24 02:02:49 +01:00
|
|
|
|
|
|
|
#include "../mwmechanics/npcstats.hpp"
|
2012-11-24 02:15:55 +01:00
|
|
|
#include "../mwmechanics/creaturestats.hpp"
|
2014-01-03 04:09:52 +01:00
|
|
|
#include "../mwmechanics/spellcasting.hpp"
|
2010-08-30 12:30:34 +02:00
|
|
|
|
2010-12-31 19:09:25 +01:00
|
|
|
#include "interpretercontext.hpp"
|
|
|
|
#include "ref.hpp"
|
|
|
|
|
2014-12-17 01:05:32 +01:00
|
|
|
namespace
|
|
|
|
{
|
|
|
|
|
|
|
|
void addToLevList(ESM::LeveledListBase* list, const std::string& itemId, int level)
|
|
|
|
{
|
|
|
|
for (std::vector<ESM::LeveledListBase::LevelItem>::iterator it = list->mList.begin(); it != list->mList.end();)
|
|
|
|
{
|
|
|
|
if (it->mLevel == level && itemId == it->mId)
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ESM::LeveledListBase::LevelItem item;
|
|
|
|
item.mId = itemId;
|
|
|
|
item.mLevel = level;
|
|
|
|
list->mList.push_back(item);
|
|
|
|
}
|
|
|
|
|
|
|
|
void removeFromLevList(ESM::LeveledListBase* list, const std::string& itemId, int level)
|
|
|
|
{
|
|
|
|
// level of -1 removes all items with that itemId
|
|
|
|
for (std::vector<ESM::LeveledListBase::LevelItem>::iterator it = list->mList.begin(); it != list->mList.end();)
|
|
|
|
{
|
|
|
|
if (level != -1 && it->mLevel != level)
|
|
|
|
{
|
|
|
|
++it;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (Misc::StringUtils::ciEqual(itemId, it->mId))
|
|
|
|
it = list->mList.erase(it);
|
|
|
|
else
|
|
|
|
++it;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2010-07-05 13:15:49 +02:00
|
|
|
namespace MWScript
|
|
|
|
{
|
|
|
|
namespace Misc
|
|
|
|
{
|
2012-09-25 02:35:50 +02:00
|
|
|
class OpPlayBink : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
std::string name = runtime.getStringLiteral (runtime[0].mInteger);
|
|
|
|
runtime.pop();
|
|
|
|
|
2013-01-07 13:19:52 +01:00
|
|
|
bool allowSkipping = runtime[0].mInteger;
|
|
|
|
runtime.pop();
|
|
|
|
|
2014-03-27 19:10:15 +01:00
|
|
|
MWBase::Environment::get().getWindowManager()->playVideo (name, allowSkipping);
|
2012-09-25 02:35:50 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-09-19 03:11:23 +02:00
|
|
|
class OpGetPcSleep : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
runtime.push (MWBase::Environment::get().getWindowManager ()->getPlayerSleeping());
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-01-05 19:08:12 +01:00
|
|
|
class OpGetPcJumping : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
MWBase::World* world = MWBase::Environment::get().getWorld();
|
2014-01-08 18:39:44 +01:00
|
|
|
MWWorld::Ptr player = world->getPlayerPtr();
|
2014-01-05 19:08:12 +01:00
|
|
|
runtime.push (!world->isOnGround(player) && !world->isFlying(player));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-09-29 09:41:34 +02:00
|
|
|
class OpWakeUpPc : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
MWBase::Environment::get().getWindowManager ()->wakeUpPlayer();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-07-05 13:15:49 +02:00
|
|
|
class OpXBox : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
2010-08-03 22:43:53 +02:00
|
|
|
|
2010-07-05 13:15:49 +02:00
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
runtime.push (0);
|
2010-08-03 22:43:53 +02:00
|
|
|
}
|
2010-07-05 13:15:49 +02:00
|
|
|
};
|
2010-08-03 22:43:53 +02:00
|
|
|
|
2010-07-06 10:25:42 +02:00
|
|
|
class OpOnActivate : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
2010-08-03 22:43:53 +02:00
|
|
|
|
2010-07-06 10:25:42 +02:00
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
2010-08-03 22:43:53 +02:00
|
|
|
InterpreterContext& context =
|
|
|
|
static_cast<InterpreterContext&> (runtime.getContext());
|
|
|
|
|
|
|
|
MWWorld::Ptr ptr = context.getReference();
|
|
|
|
|
|
|
|
runtime.push (context.hasBeenActivated (ptr));
|
|
|
|
}
|
2010-07-06 10:25:42 +02:00
|
|
|
};
|
2010-08-03 22:43:53 +02:00
|
|
|
|
2014-05-28 19:23:50 +02:00
|
|
|
template <class R>
|
2010-08-05 15:52:07 +02:00
|
|
|
class OpActivate : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
InterpreterContext& context =
|
|
|
|
static_cast<InterpreterContext&> (runtime.getContext());
|
|
|
|
|
2014-05-28 19:23:50 +02:00
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
2014-06-13 00:01:29 +02:00
|
|
|
context.executeActivation(ptr, MWBase::Environment::get().getWorld()->getPlayerPtr());
|
2010-08-05 15:52:07 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-12-31 19:09:25 +01:00
|
|
|
template<class R>
|
2010-08-30 12:30:34 +02:00
|
|
|
class OpLock : public Interpreter::Opcode1
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
|
|
|
{
|
2010-12-31 19:09:25 +01:00
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
2010-08-30 12:30:34 +02:00
|
|
|
|
2014-05-25 14:13:07 +02:00
|
|
|
Interpreter::Type_Integer lockLevel = ptr.getCellRef().getLockLevel();
|
2014-04-23 13:02:51 -04:00
|
|
|
if(lockLevel==0) { //no lock level was ever set, set to 100 as default
|
2014-04-23 05:19:34 -04:00
|
|
|
lockLevel = 100;
|
|
|
|
}
|
2010-08-30 12:30:34 +02:00
|
|
|
|
|
|
|
if (arg0==1)
|
|
|
|
{
|
|
|
|
lockLevel = runtime[0].mInteger;
|
|
|
|
runtime.pop();
|
|
|
|
}
|
|
|
|
|
2014-05-22 20:37:22 +02:00
|
|
|
ptr.getClass().lock (ptr, lockLevel);
|
2014-07-22 17:55:54 +02:00
|
|
|
|
|
|
|
// Instantly reset door to closed state
|
|
|
|
// This is done when using Lock in scripts, but not when using Lock spells.
|
2014-09-11 05:48:46 +02:00
|
|
|
if (ptr.getTypeName() == typeid(ESM::Door).name() && !ptr.getCellRef().getTeleport())
|
2014-07-22 17:55:54 +02:00
|
|
|
{
|
|
|
|
MWBase::Environment::get().getWorld()->activateDoor(ptr, 0);
|
|
|
|
MWBase::Environment::get().getWorld()->localRotateObject(ptr, 0, 0, 0);
|
|
|
|
}
|
2010-08-30 12:30:34 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-12-31 19:09:25 +01:00
|
|
|
template<class R>
|
2010-08-30 12:30:34 +02:00
|
|
|
class OpUnlock : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
2010-12-31 19:09:25 +01:00
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
2010-08-30 12:30:34 +02:00
|
|
|
|
2014-05-22 20:37:22 +02:00
|
|
|
ptr.getClass().unlock (ptr);
|
2010-08-30 12:30:34 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-03-16 09:09:45 +01:00
|
|
|
class OpToggleCollisionDebug : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
InterpreterContext& context =
|
|
|
|
static_cast<InterpreterContext&> (runtime.getContext());
|
|
|
|
|
2011-04-26 21:38:21 +02:00
|
|
|
bool enabled =
|
2012-07-03 12:30:50 +02:00
|
|
|
MWBase::Environment::get().getWorld()->toggleRenderMode (MWBase::World::Render_CollisionDebug);
|
2011-04-26 21:38:21 +02:00
|
|
|
|
2011-04-26 21:48:13 +02:00
|
|
|
context.report (enabled ?
|
2012-02-18 16:06:03 +01:00
|
|
|
"Collision Mesh Rendering -> On" : "Collision Mesh Rendering -> Off");
|
|
|
|
}
|
|
|
|
};
|
2012-03-08 01:03:46 +04:00
|
|
|
|
2012-11-20 02:20:54 +01:00
|
|
|
|
|
|
|
class OpToggleCollisionBoxes : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
InterpreterContext& context =
|
|
|
|
static_cast<InterpreterContext&> (runtime.getContext());
|
|
|
|
|
|
|
|
bool enabled =
|
|
|
|
MWBase::Environment::get().getWorld()->toggleRenderMode (MWBase::World::Render_BoundingBoxes);
|
|
|
|
|
|
|
|
context.report (enabled ?
|
|
|
|
"Bounding Box Rendering -> On" : "Bounding Box Rendering -> Off");
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-02-18 16:06:03 +01:00
|
|
|
class OpToggleWireframe : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
InterpreterContext& context =
|
|
|
|
static_cast<InterpreterContext&> (runtime.getContext());
|
|
|
|
|
|
|
|
bool enabled =
|
2012-07-03 12:30:50 +02:00
|
|
|
MWBase::Environment::get().getWorld()->toggleRenderMode (MWBase::World::Render_Wireframe);
|
2012-02-18 16:06:03 +01:00
|
|
|
|
|
|
|
context.report (enabled ?
|
|
|
|
"Wireframe Rendering -> On" : "Wireframe Rendering -> Off");
|
2011-03-16 09:09:45 +01:00
|
|
|
}
|
|
|
|
};
|
2012-03-08 01:03:46 +04:00
|
|
|
|
2012-03-08 01:09:06 +04:00
|
|
|
class OpTogglePathgrid : public Interpreter::Opcode0
|
2012-03-08 01:03:46 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
InterpreterContext& context =
|
|
|
|
static_cast<InterpreterContext&> (runtime.getContext());
|
|
|
|
|
|
|
|
bool enabled =
|
2012-07-03 12:30:50 +02:00
|
|
|
MWBase::Environment::get().getWorld()->toggleRenderMode (MWBase::World::Render_Pathgrid);
|
2012-03-08 01:03:46 +04:00
|
|
|
|
|
|
|
context.report (enabled ?
|
|
|
|
"Path Grid rendering -> On" : "Path Grid Rendering -> Off");
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-02-18 18:25:28 +01:00
|
|
|
class OpFadeIn : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
Interpreter::Type_Float time = runtime[0].mFloat;
|
|
|
|
runtime.pop();
|
2012-03-08 01:03:46 +04:00
|
|
|
|
2014-12-01 19:13:04 +01:00
|
|
|
MWBase::Environment::get().getWindowManager()->fadeScreenIn(time, false);
|
2012-02-18 18:25:28 +01:00
|
|
|
}
|
|
|
|
};
|
2012-03-08 01:03:46 +04:00
|
|
|
|
2012-02-18 18:25:28 +01:00
|
|
|
class OpFadeOut : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
Interpreter::Type_Float time = runtime[0].mFloat;
|
|
|
|
runtime.pop();
|
2012-03-08 01:03:46 +04:00
|
|
|
|
2014-12-01 19:13:04 +01:00
|
|
|
MWBase::Environment::get().getWindowManager()->fadeScreenOut(time, false);
|
2012-02-18 18:25:28 +01:00
|
|
|
}
|
|
|
|
};
|
2012-03-08 01:03:46 +04:00
|
|
|
|
2012-02-18 18:25:28 +01:00
|
|
|
class OpFadeTo : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
Interpreter::Type_Float alpha = runtime[0].mFloat;
|
|
|
|
runtime.pop();
|
2012-03-08 01:03:46 +04:00
|
|
|
|
2012-02-18 18:25:28 +01:00
|
|
|
Interpreter::Type_Float time = runtime[0].mFloat;
|
|
|
|
runtime.pop();
|
2012-03-08 01:03:46 +04:00
|
|
|
|
2014-12-01 19:13:04 +01:00
|
|
|
MWBase::Environment::get().getWindowManager()->fadeScreenTo(alpha, time, false);
|
2012-02-18 18:25:28 +01:00
|
|
|
}
|
|
|
|
};
|
2010-08-30 12:30:34 +02:00
|
|
|
|
2012-03-29 18:33:08 +02:00
|
|
|
class OpToggleWater : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
2014-05-16 09:21:08 +02:00
|
|
|
runtime.getContext().report(MWBase::Environment::get().getWorld()->toggleWater() ? "Water -> On"
|
|
|
|
: "Water -> Off");
|
2012-03-29 18:33:08 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-09-30 15:53:27 +02:00
|
|
|
class OpToggleWorld : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
runtime.getContext().report(MWBase::Environment::get().getWorld()->toggleWorld() ? "World -> On"
|
|
|
|
: "World -> Off");
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-06-07 12:36:51 +02:00
|
|
|
class OpDontSaveObject : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
// We are ignoring the DontSaveObject statement for now. Probably not worth
|
2014-04-23 05:12:07 -04:00
|
|
|
// bothering with. The incompatibility we are creating should be marginal at most.
|
2012-06-07 12:36:51 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-12-11 20:57:25 +01:00
|
|
|
class OpPcForce1stPerson : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
if (!MWBase::Environment::get().getWorld()->isFirstPerson())
|
|
|
|
MWBase::Environment::get().getWorld()->togglePOV();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class OpPcForce3rdPerson : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
if (MWBase::Environment::get().getWorld()->isFirstPerson())
|
|
|
|
MWBase::Environment::get().getWorld()->togglePOV();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class OpPcGet3rdPerson : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void execute(Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
runtime.push(!MWBase::Environment::get().getWorld()->isFirstPerson());
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-08-18 18:05:10 +04:00
|
|
|
class OpToggleVanityMode : public Interpreter::Opcode0
|
|
|
|
{
|
2012-08-19 10:37:51 +04:00
|
|
|
static bool sActivate;
|
|
|
|
|
2012-08-18 18:05:10 +04:00
|
|
|
public:
|
2013-01-08 11:17:19 +01:00
|
|
|
|
2012-08-18 18:05:10 +04:00
|
|
|
virtual void execute(Interpreter::Runtime &runtime)
|
|
|
|
{
|
|
|
|
InterpreterContext& context =
|
|
|
|
static_cast<InterpreterContext&> (runtime.getContext());
|
|
|
|
|
|
|
|
MWBase::World *world =
|
|
|
|
MWBase::Environment::get().getWorld();
|
|
|
|
|
2013-04-27 01:24:36 -07:00
|
|
|
if (world->toggleVanityMode(sActivate)) {
|
|
|
|
context.report(sActivate ? "Vanity Mode -> On" : "Vanity Mode -> Off");
|
2012-08-19 10:37:51 +04:00
|
|
|
sActivate = !sActivate;
|
2012-08-18 18:05:10 +04:00
|
|
|
} else {
|
|
|
|
context.report("Vanity Mode -> No");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
2012-08-19 10:37:51 +04:00
|
|
|
bool OpToggleVanityMode::sActivate = true;
|
2012-08-18 18:05:10 +04:00
|
|
|
|
2012-11-23 21:31:10 +01:00
|
|
|
template <class R>
|
|
|
|
class OpGetLocked : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
2014-05-25 14:13:07 +02:00
|
|
|
runtime.push (ptr.getCellRef().getLockLevel() > 0);
|
2012-11-23 21:31:10 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-11-24 02:15:55 +01:00
|
|
|
template <class R>
|
|
|
|
class OpGetEffect : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
2013-08-13 19:18:21 -07:00
|
|
|
std::string effect = runtime.getStringLiteral(runtime[0].mInteger);
|
2012-11-24 02:15:55 +01:00
|
|
|
runtime.pop();
|
|
|
|
|
2013-08-13 19:18:21 -07:00
|
|
|
char *end;
|
|
|
|
long key = strtol(effect.c_str(), &end, 10);
|
|
|
|
if(key < 0 || key > 32767 || *end != '\0')
|
|
|
|
key = ESM::MagicEffect::effectStringToId(effect);
|
|
|
|
|
2014-05-22 20:37:22 +02:00
|
|
|
runtime.push(ptr.getClass().getCreatureStats(ptr).getMagicEffects().get(
|
2014-08-16 22:38:22 +02:00
|
|
|
MWMechanics::EffectKey(key)).getMagnitude() > 0);
|
2012-11-24 02:15:55 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-01-07 18:16:50 +00:00
|
|
|
template<class R>
|
|
|
|
class OpAddSoulGem : public Interpreter::Opcode0
|
2013-01-08 11:17:19 +01:00
|
|
|
{
|
2013-01-07 18:16:50 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
2013-01-08 11:17:19 +01:00
|
|
|
{
|
2013-01-07 18:16:50 +00:00
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
std::string creature = runtime.getStringLiteral (runtime[0].mInteger);
|
|
|
|
runtime.pop();
|
2013-01-08 11:17:19 +01:00
|
|
|
|
2013-01-07 18:16:50 +00:00
|
|
|
std::string gem = runtime.getStringLiteral (runtime[0].mInteger);
|
|
|
|
runtime.pop();
|
2013-01-08 11:17:19 +01:00
|
|
|
|
2013-01-07 21:08:04 +00:00
|
|
|
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
|
|
|
store.get<ESM::Creature>().find(creature); // This line throws an exception if it can't find the creature
|
2013-01-07 18:16:50 +00:00
|
|
|
|
2013-11-21 04:11:06 +01:00
|
|
|
MWWorld::Ptr item = *ptr.getClass().getContainerStore(ptr).add(gem, 1, ptr);
|
2014-05-25 14:13:07 +02:00
|
|
|
item.getCellRef().setSoul(creature);
|
2013-01-08 11:17:19 +01:00
|
|
|
}
|
2013-01-07 18:16:50 +00:00
|
|
|
};
|
2012-11-24 02:15:55 +01:00
|
|
|
|
2013-01-07 21:08:04 +00:00
|
|
|
template<class R>
|
2014-02-13 09:52:44 +01:00
|
|
|
class OpRemoveSoulGem : public Interpreter::Opcode1
|
2013-01-08 11:17:19 +01:00
|
|
|
{
|
2013-01-07 21:08:04 +00:00
|
|
|
public:
|
|
|
|
|
2014-02-13 09:52:44 +01:00
|
|
|
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
|
2013-01-08 11:17:19 +01:00
|
|
|
{
|
2013-01-07 21:08:04 +00:00
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
std::string soul = runtime.getStringLiteral (runtime[0].mInteger);
|
|
|
|
runtime.pop();
|
|
|
|
|
2014-02-13 09:52:44 +01:00
|
|
|
// throw away additional arguments
|
|
|
|
for (unsigned int i=0; i<arg0; ++i)
|
|
|
|
runtime.pop();
|
|
|
|
|
2014-05-22 20:37:22 +02:00
|
|
|
MWWorld::ContainerStore& store = ptr.getClass().getContainerStore (ptr);
|
2014-01-14 06:13:30 +01:00
|
|
|
for (MWWorld::ContainerStoreIterator it = store.begin(); it != store.end(); ++it)
|
|
|
|
{
|
2014-05-25 14:13:07 +02:00
|
|
|
if (::Misc::StringUtils::ciEqual(it->getCellRef().getSoul(), soul))
|
2014-01-14 06:13:30 +01:00
|
|
|
{
|
|
|
|
store.remove(*it, 1, ptr);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2013-01-08 11:17:19 +01:00
|
|
|
}
|
2013-01-07 21:08:04 +00:00
|
|
|
};
|
|
|
|
|
2013-01-09 21:16:45 +00:00
|
|
|
template<class R>
|
|
|
|
class OpDrop : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
std::string item = runtime.getStringLiteral (runtime[0].mInteger);
|
|
|
|
runtime.pop();
|
|
|
|
|
2013-01-09 22:55:28 +00:00
|
|
|
Interpreter::Type_Integer amount = runtime[0].mInteger;
|
|
|
|
runtime.pop();
|
|
|
|
|
2013-04-06 19:25:29 +02:00
|
|
|
if (amount<0)
|
|
|
|
throw std::runtime_error ("amount must be non-negative");
|
|
|
|
|
|
|
|
// no-op
|
|
|
|
if (amount == 0)
|
|
|
|
return;
|
|
|
|
|
2014-05-22 20:37:22 +02:00
|
|
|
MWWorld::ContainerStore& store = ptr.getClass().getContainerStore (ptr);
|
2013-01-09 21:16:45 +00:00
|
|
|
|
|
|
|
|
2013-08-13 01:19:33 +02:00
|
|
|
int toRemove = amount;
|
2013-01-09 21:16:45 +00:00
|
|
|
for (MWWorld::ContainerStoreIterator iter (store.begin()); iter!=store.end(); ++iter)
|
|
|
|
{
|
2014-05-25 14:13:07 +02:00
|
|
|
if (::Misc::StringUtils::ciEqual(iter->getCellRef().getRefId(), item))
|
2013-01-09 21:16:45 +00:00
|
|
|
{
|
2013-08-13 01:19:33 +02:00
|
|
|
int removed = store.remove(*iter, toRemove, ptr);
|
2014-10-24 12:46:14 +02:00
|
|
|
MWWorld::Ptr dropped = MWBase::Environment::get().getWorld()->dropObjectOnGround(ptr, *iter, removed);
|
|
|
|
dropped.getCellRef().setOwner("");
|
2013-01-09 22:55:28 +00:00
|
|
|
|
2013-08-13 01:19:33 +02:00
|
|
|
toRemove -= removed;
|
|
|
|
|
|
|
|
if (toRemove <= 0)
|
|
|
|
break;
|
2013-01-09 21:16:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template<class R>
|
|
|
|
class OpDropSoulGem : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
std::string soul = runtime.getStringLiteral (runtime[0].mInteger);
|
|
|
|
runtime.pop();
|
|
|
|
|
2014-05-22 20:37:22 +02:00
|
|
|
MWWorld::ContainerStore& store = ptr.getClass().getContainerStore (ptr);
|
2013-01-09 21:16:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
for (MWWorld::ContainerStoreIterator iter (store.begin()); iter!=store.end(); ++iter)
|
|
|
|
{
|
2014-05-25 14:13:07 +02:00
|
|
|
if (::Misc::StringUtils::ciEqual(iter->getCellRef().getSoul(), soul))
|
2013-01-09 21:16:45 +00:00
|
|
|
{
|
2013-08-13 01:19:33 +02:00
|
|
|
MWBase::Environment::get().getWorld()->dropObjectOnGround(ptr, *iter, 1);
|
|
|
|
store.remove(*iter, 1, ptr);
|
2013-01-09 21:16:45 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-11-24 02:48:53 +01:00
|
|
|
template <class R>
|
|
|
|
class OpGetAttacked : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
2014-05-22 20:37:22 +02:00
|
|
|
runtime.push(ptr.getClass().getCreatureStats (ptr).getAttacked ());
|
2012-11-24 02:48:53 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-11-24 03:04:26 +01:00
|
|
|
template <class R>
|
|
|
|
class OpGetWeaponDrawn : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
2014-01-03 22:55:17 +01:00
|
|
|
runtime.push(ptr.getClass().getNpcStats (ptr).getDrawState () == MWMechanics::DrawState_Weapon);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R>
|
|
|
|
class OpGetSpellReadied : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
runtime.push(ptr.getClass().getNpcStats (ptr).getDrawState () == MWMechanics::DrawState_Spell);
|
2012-11-24 03:04:26 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-11-25 01:26:29 +01:00
|
|
|
template <class R>
|
|
|
|
class OpGetSpellEffects : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
std::string id = runtime.getStringLiteral(runtime[0].mInteger);
|
|
|
|
runtime.pop();
|
|
|
|
|
2014-05-22 20:37:22 +02:00
|
|
|
runtime.push(ptr.getClass().getCreatureStats(ptr).getActiveSpells().isSpellActive(id));
|
2012-11-25 01:26:29 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-11-25 01:54:37 +01:00
|
|
|
class OpGetCurrentTime : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
runtime.push(MWBase::Environment::get().getWorld()->getTimeStamp().getHour());
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-11-27 06:54:13 +01:00
|
|
|
template <class R>
|
|
|
|
class OpSetDelete : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
2012-11-28 01:30:18 +01:00
|
|
|
int parameter = runtime[0].mInteger;
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
if (parameter == 1)
|
2013-10-16 18:39:29 +02:00
|
|
|
MWBase::Environment::get().getWorld()->deleteObject(ptr);
|
2014-12-06 21:08:18 +01:00
|
|
|
else if (parameter == 0)
|
|
|
|
MWBase::Environment::get().getWorld()->undeleteObject(ptr);
|
|
|
|
else
|
|
|
|
throw std::runtime_error("SetDelete: unexpected parameter");
|
2012-11-27 06:54:13 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class OpGetSquareRoot : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
float param = runtime[0].mFloat;
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
runtime.push(std::sqrt (param));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-04-28 11:13:21 +02:00
|
|
|
template <class R>
|
|
|
|
class OpFall : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-05-01 11:15:43 +02:00
|
|
|
template <class R>
|
|
|
|
class OpGetStandingPc : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
runtime.push (MWBase::Environment::get().getWorld()->getPlayerStandingOn(ptr));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R>
|
|
|
|
class OpGetStandingActor : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
runtime.push (MWBase::Environment::get().getWorld()->getActorStandingOn(ptr));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-07-29 19:01:40 +02:00
|
|
|
template <class R>
|
|
|
|
class OpGetCollidingPc : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
2014-09-26 14:16:46 +02:00
|
|
|
runtime.push (MWBase::Environment::get().getWorld()->getPlayerCollidingWith(ptr));
|
2014-07-29 19:01:40 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R>
|
|
|
|
class OpGetCollidingActor : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
2014-09-26 14:16:46 +02:00
|
|
|
runtime.push (MWBase::Environment::get().getWorld()->getActorCollidingWith(ptr));
|
2014-07-29 19:01:40 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R>
|
|
|
|
class OpHurtStandingActor : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
float healthDiffPerSecond = runtime[0].mFloat;
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
MWBase::Environment::get().getWorld()->hurtStandingActors(ptr, healthDiffPerSecond);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class R>
|
|
|
|
class OpHurtCollidingActor : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
float healthDiffPerSecond = runtime[0].mFloat;
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
MWBase::Environment::get().getWorld()->hurtCollidingActors(ptr, healthDiffPerSecond);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-05-01 11:42:24 +02:00
|
|
|
class OpGetWindSpeed : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
runtime.push(MWBase::Environment::get().getWorld()->getWindSpeed());
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-07-26 08:08:52 -07:00
|
|
|
template <class R>
|
|
|
|
class OpHitOnMe : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
std::string objectID = runtime.getStringLiteral (runtime[0].mInteger);
|
|
|
|
runtime.pop();
|
|
|
|
|
2014-05-22 20:37:22 +02:00
|
|
|
MWMechanics::CreatureStats &stats = ptr.getClass().getCreatureStats(ptr);
|
2013-07-26 08:08:52 -07:00
|
|
|
runtime.push(::Misc::StringUtils::ciEqual(objectID, stats.getLastHitObject()));
|
2014-12-11 22:00:31 +01:00
|
|
|
|
|
|
|
stats.setLastHitObject(std::string());
|
2013-07-26 08:08:52 -07:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-12-11 22:25:41 +01:00
|
|
|
template <class R>
|
|
|
|
class OpHitAttemptOnMe : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
std::string objectID = runtime.getStringLiteral (runtime[0].mInteger);
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
MWMechanics::CreatureStats &stats = ptr.getClass().getCreatureStats(ptr);
|
|
|
|
runtime.push(::Misc::StringUtils::ciEqual(objectID, stats.getLastHitAttemptObject()));
|
|
|
|
|
|
|
|
stats.setLastHitAttemptObject(std::string());
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-07-27 00:14:55 -07:00
|
|
|
template <bool Enable>
|
|
|
|
class OpEnableTeleporting : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
|
|
|
world->enableTeleporting(Enable);
|
|
|
|
}
|
|
|
|
};
|
2013-10-02 15:12:41 +02:00
|
|
|
|
|
|
|
template <bool Enable>
|
|
|
|
class OpEnableLevitation : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
|
|
|
world->enableLevitation(Enable);
|
|
|
|
}
|
|
|
|
};
|
2010-08-03 22:43:53 +02:00
|
|
|
|
2013-08-13 17:31:15 -07:00
|
|
|
template <class R>
|
|
|
|
class OpShowVars : public Interpreter::Opcode0
|
2013-08-13 04:36:20 -07:00
|
|
|
{
|
|
|
|
void printLocalVars(Interpreter::Runtime &runtime, const MWWorld::Ptr &ptr)
|
|
|
|
{
|
|
|
|
std::stringstream str;
|
|
|
|
|
2014-05-22 20:37:22 +02:00
|
|
|
const std::string script = ptr.getClass().getScript(ptr);
|
2013-08-13 04:36:20 -07:00
|
|
|
if(script.empty())
|
2014-05-25 14:13:07 +02:00
|
|
|
str<< ptr.getCellRef().getRefId()<<" ("<<ptr.getRefData().getHandle()<<") does not have a script.";
|
2013-08-13 04:36:20 -07:00
|
|
|
else
|
|
|
|
{
|
2014-05-25 14:13:07 +02:00
|
|
|
str<< "Local variables for "<<ptr.getCellRef().getRefId()<<" ("<<ptr.getRefData().getHandle()<<")";
|
2013-08-13 04:36:20 -07:00
|
|
|
|
|
|
|
const Locals &locals = ptr.getRefData().getLocals();
|
|
|
|
const Compiler::Locals &complocals = MWBase::Environment::get().getScriptManager()->getLocals(script);
|
|
|
|
|
|
|
|
const std::vector<std::string> *names = &complocals.get('s');
|
|
|
|
for(size_t i = 0;i < names->size();++i)
|
|
|
|
{
|
|
|
|
if(i >= locals.mShorts.size())
|
|
|
|
break;
|
|
|
|
str<<std::endl<< " "<<(*names)[i]<<" = "<<locals.mShorts[i]<<" (short)";
|
|
|
|
}
|
|
|
|
names = &complocals.get('l');
|
|
|
|
for(size_t i = 0;i < names->size();++i)
|
|
|
|
{
|
|
|
|
if(i >= locals.mLongs.size())
|
|
|
|
break;
|
|
|
|
str<<std::endl<< " "<<(*names)[i]<<" = "<<locals.mLongs[i]<<" (long)";
|
|
|
|
}
|
|
|
|
names = &complocals.get('f');
|
|
|
|
for(size_t i = 0;i < names->size();++i)
|
|
|
|
{
|
|
|
|
if(i >= locals.mFloats.size())
|
|
|
|
break;
|
|
|
|
str<<std::endl<< " "<<(*names)[i]<<" = "<<locals.mFloats[i]<<" (float)";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
runtime.getContext().report(str.str());
|
|
|
|
}
|
|
|
|
|
|
|
|
void printGlobalVars(Interpreter::Runtime &runtime)
|
|
|
|
{
|
2013-12-10 15:22:38 +01:00
|
|
|
InterpreterContext& context =
|
|
|
|
static_cast<InterpreterContext&> (runtime.getContext());
|
2013-11-28 09:10:38 +01:00
|
|
|
|
2013-08-13 04:36:20 -07:00
|
|
|
std::stringstream str;
|
|
|
|
str<< "Global variables:";
|
|
|
|
|
|
|
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
2013-12-10 15:22:38 +01:00
|
|
|
std::vector<std::string> names = context.getGlobals();
|
2013-08-13 04:36:20 -07:00
|
|
|
for(size_t i = 0;i < names.size();++i)
|
|
|
|
{
|
2013-11-28 09:10:38 +01:00
|
|
|
char type = world->getGlobalVariableType (names[i]);
|
|
|
|
str << std::endl << " " << names[i] << " = ";
|
|
|
|
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case 's':
|
|
|
|
|
|
|
|
str << context.getGlobalShort (names[i]) << " (short)";
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'l':
|
|
|
|
|
|
|
|
str << context.getGlobalLong (names[i]) << " (long)";
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'f':
|
|
|
|
|
|
|
|
str << context.getGlobalFloat (names[i]) << " (float)";
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
str << "<unknown type>";
|
|
|
|
}
|
2013-08-13 04:36:20 -07:00
|
|
|
}
|
|
|
|
|
2013-11-28 09:10:38 +01:00
|
|
|
context.report (str.str());
|
2013-08-13 04:36:20 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual void execute(Interpreter::Runtime& runtime)
|
|
|
|
{
|
2014-01-09 02:14:08 +01:00
|
|
|
MWWorld::Ptr ptr = R()(runtime, false);
|
|
|
|
if (!ptr.isEmpty())
|
2013-08-13 04:36:20 -07:00
|
|
|
printLocalVars(runtime, ptr);
|
2014-01-09 02:14:08 +01:00
|
|
|
else
|
|
|
|
{
|
2013-08-13 04:36:20 -07:00
|
|
|
// No reference, no problem.
|
|
|
|
printGlobalVars(runtime);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-08-24 21:19:12 -04:00
|
|
|
class OpToggleGodMode : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
InterpreterContext& context = static_cast<InterpreterContext&> (runtime.getContext());
|
|
|
|
|
|
|
|
bool enabled = MWBase::Environment::get().getWorld()->toggleGodMode();
|
|
|
|
|
2013-08-29 20:25:36 -04:00
|
|
|
context.report (enabled ? "God Mode -> On" : "God Mode -> Off");
|
2013-08-24 21:19:12 -04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-01-03 04:09:52 +01:00
|
|
|
template <class R>
|
|
|
|
class OpCast : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
std::string spell = runtime.getStringLiteral (runtime[0].mInteger);
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
std::string targetId = ::Misc::StringUtils::lowerCase(runtime.getStringLiteral (runtime[0].mInteger));
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
MWWorld::Ptr target = MWBase::Environment::get().getWorld()->getPtr (targetId, false);
|
|
|
|
|
|
|
|
MWMechanics::CastSpell cast(ptr, target);
|
2014-01-20 15:48:06 +01:00
|
|
|
cast.mHitPosition = Ogre::Vector3(target.getRefData().getPosition().pos);
|
2014-10-09 01:39:35 +02:00
|
|
|
cast.mAlwaysSucceed = true;
|
2014-01-03 04:09:52 +01:00
|
|
|
cast.cast(spell);
|
|
|
|
}
|
|
|
|
};
|
2013-08-13 04:36:20 -07:00
|
|
|
|
2014-01-03 04:44:50 +01:00
|
|
|
template <class R>
|
|
|
|
class OpExplodeSpell : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
std::string spell = runtime.getStringLiteral (runtime[0].mInteger);
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
MWMechanics::CastSpell cast(ptr, ptr);
|
2014-01-20 15:48:06 +01:00
|
|
|
cast.mHitPosition = Ogre::Vector3(ptr.getRefData().getPosition().pos);
|
2014-10-09 01:39:35 +02:00
|
|
|
cast.mAlwaysSucceed = true;
|
2014-01-03 04:44:50 +01:00
|
|
|
cast.cast(spell);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-01-09 01:49:58 +01:00
|
|
|
class OpGoToJail : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void execute (Interpreter::Runtime& runtime)
|
|
|
|
{
|
|
|
|
MWBase::World* world = MWBase::Environment::get().getWorld();
|
2014-01-11 06:47:58 +01:00
|
|
|
world->goToJail();
|
2014-01-09 01:49:58 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class OpPayFine : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void execute(Interpreter::Runtime &runtime)
|
|
|
|
{
|
|
|
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
|
|
|
player.getClass().getNpcStats(player).setBounty(0);
|
2014-04-19 19:03:31 -04:00
|
|
|
MWBase::Environment::get().getWorld()->confiscateStolenItems(player);
|
2014-04-05 10:26:14 -04:00
|
|
|
MWBase::Environment::get().getWorld()->getPlayer().recordCrimeId();
|
2014-01-09 01:49:58 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class OpPayFineThief : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void execute(Interpreter::Runtime &runtime)
|
|
|
|
{
|
|
|
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
|
|
|
player.getClass().getNpcStats(player).setBounty(0);
|
2014-04-05 10:26:14 -04:00
|
|
|
MWBase::Environment::get().getWorld()->getPlayer().recordCrimeId();
|
2014-01-09 01:49:58 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-02-02 15:35:18 +01:00
|
|
|
class OpGetPcInJail : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime &runtime)
|
|
|
|
{
|
|
|
|
/// \todo implement jail check
|
|
|
|
runtime.push (0);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class OpGetPcTraveling : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void execute (Interpreter::Runtime &runtime)
|
|
|
|
{
|
|
|
|
/// \todo implement traveling check
|
|
|
|
runtime.push (0);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-06-15 15:15:59 +02:00
|
|
|
template <class R>
|
|
|
|
class OpBetaComment : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void execute(Interpreter::Runtime &runtime)
|
|
|
|
{
|
|
|
|
MWWorld::Ptr ptr = R()(runtime);
|
|
|
|
|
|
|
|
std::stringstream msg;
|
|
|
|
|
|
|
|
msg << "Content file: ";
|
|
|
|
|
|
|
|
if (ptr.getCellRef().getRefNum().mContentFile == -1)
|
|
|
|
msg << "[None]" << std::endl;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
std::vector<std::string> contentFiles = MWBase::Environment::get().getWorld()->getContentFiles();
|
2014-06-27 08:37:41 +02:00
|
|
|
|
|
|
|
msg << contentFiles.at (ptr.getCellRef().getRefNum().mContentFile) << std::endl;
|
2014-06-15 15:15:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
msg << "RefID: " << ptr.getCellRef().getRefId() << std::endl;
|
|
|
|
|
|
|
|
if (ptr.isInCell())
|
|
|
|
{
|
|
|
|
MWWorld::CellStore* cell = ptr.getCell();
|
|
|
|
msg << "Cell: " << MWBase::Environment::get().getWorld()->getCellName(cell) << std::endl;
|
2014-07-01 21:41:23 +02:00
|
|
|
if (cell->getCell()->isExterior())
|
|
|
|
msg << "Grid: " << cell->getCell()->getGridX() << " " << cell->getCell()->getGridY() << std::endl;
|
2014-06-15 15:15:59 +02:00
|
|
|
Ogre::Vector3 pos (ptr.getRefData().getPosition().pos);
|
|
|
|
msg << "Coordinates: " << pos << std::endl;
|
2014-11-28 16:02:43 +01:00
|
|
|
msg << "Model: " << ptr.getClass().getModel(ptr) << std::endl;
|
|
|
|
if (!ptr.getClass().getScript(ptr).empty())
|
|
|
|
msg << "Script: " << ptr.getClass().getScript(ptr) << std::endl;
|
2014-06-15 15:15:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
std::string notes = runtime.getStringLiteral (runtime[0].mInteger);
|
|
|
|
runtime.pop();
|
|
|
|
if (!notes.empty())
|
|
|
|
msg << "Notes: " << notes << std::endl;
|
|
|
|
|
|
|
|
runtime.getContext().report(msg.str());
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-12-17 01:05:32 +01:00
|
|
|
class OpAddToLevCreature : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void execute(Interpreter::Runtime &runtime)
|
|
|
|
{
|
|
|
|
const std::string& levId = runtime.getStringLiteral(runtime[0].mInteger);
|
|
|
|
runtime.pop();
|
|
|
|
const std::string& creatureId = runtime.getStringLiteral(runtime[0].mInteger);
|
|
|
|
runtime.pop();
|
|
|
|
int level = runtime[0].mInteger;
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
ESM::CreatureLevList listCopy = *MWBase::Environment::get().getWorld()->getStore().get<ESM::CreatureLevList>().find(levId);
|
|
|
|
addToLevList(&listCopy, creatureId, level);
|
|
|
|
MWBase::Environment::get().getWorld()->createOverrideRecord(listCopy);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class OpRemoveFromLevCreature : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void execute(Interpreter::Runtime &runtime)
|
|
|
|
{
|
|
|
|
const std::string& levId = runtime.getStringLiteral(runtime[0].mInteger);
|
|
|
|
runtime.pop();
|
|
|
|
const std::string& creatureId = runtime.getStringLiteral(runtime[0].mInteger);
|
|
|
|
runtime.pop();
|
|
|
|
int level = runtime[0].mInteger;
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
ESM::CreatureLevList listCopy = *MWBase::Environment::get().getWorld()->getStore().get<ESM::CreatureLevList>().find(levId);
|
|
|
|
removeFromLevList(&listCopy, creatureId, level);
|
|
|
|
MWBase::Environment::get().getWorld()->createOverrideRecord(listCopy);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class OpAddToLevItem : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void execute(Interpreter::Runtime &runtime)
|
|
|
|
{
|
|
|
|
const std::string& levId = runtime.getStringLiteral(runtime[0].mInteger);
|
|
|
|
runtime.pop();
|
|
|
|
const std::string& itemId = runtime.getStringLiteral(runtime[0].mInteger);
|
|
|
|
runtime.pop();
|
|
|
|
int level = runtime[0].mInteger;
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
ESM::ItemLevList listCopy = *MWBase::Environment::get().getWorld()->getStore().get<ESM::ItemLevList>().find(levId);
|
|
|
|
addToLevList(&listCopy, itemId, level);
|
|
|
|
MWBase::Environment::get().getWorld()->createOverrideRecord(listCopy);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class OpRemoveFromLevItem : public Interpreter::Opcode0
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void execute(Interpreter::Runtime &runtime)
|
|
|
|
{
|
|
|
|
const std::string& levId = runtime.getStringLiteral(runtime[0].mInteger);
|
|
|
|
runtime.pop();
|
|
|
|
const std::string& itemId = runtime.getStringLiteral(runtime[0].mInteger);
|
|
|
|
runtime.pop();
|
|
|
|
int level = runtime[0].mInteger;
|
|
|
|
runtime.pop();
|
|
|
|
|
|
|
|
ESM::ItemLevList listCopy = *MWBase::Environment::get().getWorld()->getStore().get<ESM::ItemLevList>().find(levId);
|
|
|
|
removeFromLevList(&listCopy, itemId, level);
|
|
|
|
MWBase::Environment::get().getWorld()->createOverrideRecord(listCopy);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-07-05 13:15:49 +02:00
|
|
|
void installOpcodes (Interpreter::Interpreter& interpreter)
|
|
|
|
{
|
2013-08-06 20:38:41 -04:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeXBox, new OpXBox);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeOnActivate, new OpOnActivate);
|
2014-05-28 19:23:50 +02:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeActivate, new OpActivate<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeActivateExplicit, new OpActivate<ExplicitRef>);
|
2013-08-06 20:38:41 -04:00
|
|
|
interpreter.installSegment3 (Compiler::Misc::opcodeLock, new OpLock<ImplicitRef>);
|
|
|
|
interpreter.installSegment3 (Compiler::Misc::opcodeLockExplicit, new OpLock<ExplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeUnlock, new OpUnlock<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeUnlockExplicit, new OpUnlock<ExplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeToggleCollisionDebug, new OpToggleCollisionDebug);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeToggleCollisionBoxes, new OpToggleCollisionBoxes);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeToggleWireframe, new OpToggleWireframe);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeFadeIn, new OpFadeIn);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeFadeOut, new OpFadeOut);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeFadeTo, new OpFadeTo);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeTogglePathgrid, new OpTogglePathgrid);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeToggleWater, new OpToggleWater);
|
2014-09-30 15:53:27 +02:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeToggleWorld, new OpToggleWorld);
|
2013-08-06 20:38:41 -04:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeDontSaveObject, new OpDontSaveObject);
|
2014-12-11 20:57:25 +01:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodePcForce1stPerson, new OpPcForce1stPerson);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodePcForce3rdPerson, new OpPcForce3rdPerson);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodePcGet3rdPerson, new OpPcGet3rdPerson);
|
2013-08-06 20:38:41 -04:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeToggleVanityMode, new OpToggleVanityMode);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetPcSleep, new OpGetPcSleep);
|
2014-01-05 19:08:12 +01:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetPcJumping, new OpGetPcJumping);
|
2013-08-06 20:38:41 -04:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeWakeUpPc, new OpWakeUpPc);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodePlayBink, new OpPlayBink);
|
2014-01-09 01:49:58 +01:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodePayFine, new OpPayFine);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodePayFineThief, new OpPayFineThief);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGoToJail, new OpGoToJail);
|
2013-08-06 20:38:41 -04:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetLocked, new OpGetLocked<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetLockedExplicit, new OpGetLocked<ExplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetEffect, new OpGetEffect<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetEffectExplicit, new OpGetEffect<ExplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeAddSoulGem, new OpAddSoulGem<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeAddSoulGemExplicit, new OpAddSoulGem<ExplicitRef>);
|
2014-02-13 09:52:44 +01:00
|
|
|
interpreter.installSegment3 (Compiler::Misc::opcodeRemoveSoulGem, new OpRemoveSoulGem<ImplicitRef>);
|
|
|
|
interpreter.installSegment3 (Compiler::Misc::opcodeRemoveSoulGemExplicit, new OpRemoveSoulGem<ExplicitRef>);
|
2013-08-06 20:38:41 -04:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeDrop, new OpDrop<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeDropExplicit, new OpDrop<ExplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeDropSoulGem, new OpDropSoulGem<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeDropSoulGemExplicit, new OpDropSoulGem<ExplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetAttacked, new OpGetAttacked<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetAttackedExplicit, new OpGetAttacked<ExplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetWeaponDrawn, new OpGetWeaponDrawn<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetWeaponDrawnExplicit, new OpGetWeaponDrawn<ExplicitRef>);
|
2014-01-03 22:55:17 +01:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetSpellReadied, new OpGetSpellReadied<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetSpellReadiedExplicit, new OpGetSpellReadied<ExplicitRef>);
|
2013-08-06 20:38:41 -04:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetSpellEffects, new OpGetSpellEffects<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetSpellEffectsExplicit, new OpGetSpellEffects<ExplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetCurrentTime, new OpGetCurrentTime);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeSetDelete, new OpSetDelete<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeSetDeleteExplicit, new OpSetDelete<ExplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetSquareRoot, new OpGetSquareRoot);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeFall, new OpFall<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeFallExplicit, new OpFall<ExplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetStandingPc, new OpGetStandingPc<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetStandingPcExplicit, new OpGetStandingPc<ExplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetStandingActor, new OpGetStandingActor<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetStandingActorExplicit, new OpGetStandingActor<ExplicitRef>);
|
2014-07-29 19:01:40 +02:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetCollidingPc, new OpGetCollidingPc<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetCollidingPcExplicit, new OpGetCollidingPc<ExplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetCollidingActor, new OpGetCollidingActor<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetCollidingActorExplicit, new OpGetCollidingActor<ExplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeHurtStandingActor, new OpHurtStandingActor<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeHurtStandingActorExplicit, new OpHurtStandingActor<ExplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeHurtCollidingActor, new OpHurtCollidingActor<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeHurtCollidingActorExplicit, new OpHurtCollidingActor<ExplicitRef>);
|
2013-08-06 20:38:41 -04:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetWindSpeed, new OpGetWindSpeed);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeHitOnMe, new OpHitOnMe<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeHitOnMeExplicit, new OpHitOnMe<ExplicitRef>);
|
2014-12-11 22:25:41 +01:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeHitAttemptOnMe, new OpHitAttemptOnMe<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeHitAttemptOnMeExplicit, new OpHitAttemptOnMe<ExplicitRef>);
|
2013-08-06 20:38:41 -04:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeDisableTeleporting, new OpEnableTeleporting<false>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeEnableTeleporting, new OpEnableTeleporting<true>);
|
2013-08-13 17:31:15 -07:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeShowVars, new OpShowVars<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeShowVarsExplicit, new OpShowVars<ExplicitRef>);
|
2013-08-24 21:19:12 -04:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeToggleGodMode, new OpToggleGodMode);
|
2013-10-02 15:12:41 +02:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeDisableLevitation, new OpEnableLevitation<false>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeEnableLevitation, new OpEnableLevitation<true>);
|
2014-01-03 04:09:52 +01:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeCast, new OpCast<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeCastExplicit, new OpCast<ExplicitRef>);
|
2014-01-03 04:44:50 +01:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeExplodeSpell, new OpExplodeSpell<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeExplodeSpellExplicit, new OpExplodeSpell<ExplicitRef>);
|
2014-02-02 15:35:18 +01:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetPcInJail, new OpGetPcInJail);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeGetPcTraveling, new OpGetPcTraveling);
|
2014-06-15 15:15:59 +02:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeBetaComment, new OpBetaComment<ImplicitRef>);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeBetaCommentExplicit, new OpBetaComment<ExplicitRef>);
|
2014-12-17 01:05:32 +01:00
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeAddToLevCreature, new OpAddToLevCreature);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeRemoveFromLevCreature, new OpRemoveFromLevCreature);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeAddToLevItem, new OpAddToLevItem);
|
|
|
|
interpreter.installSegment5 (Compiler::Misc::opcodeRemoveFromLevItem, new OpRemoveFromLevItem);
|
2010-08-03 22:43:53 +02:00
|
|
|
}
|
|
|
|
}
|
2010-07-05 13:15:49 +02:00
|
|
|
}
|