|
|
|
@ -599,6 +599,23 @@ namespace MWScript
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
|
|
|
|
|
MWMechanics::CreatureStats &stats = MWWorld::Class::get(ptr).getCreatureStats(ptr);
|
|
|
|
|
runtime.push(::Misc::StringUtils::ciEqual(objectID, stats.getLastHitObject()));
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const int opcodeXBox = 0x200000c;
|
|
|
|
|
const int opcodeOnActivate = 0x200000d;
|
|
|
|
|
const int opcodeActivate = 0x2000075;
|
|
|
|
@ -650,6 +667,9 @@ namespace MWScript
|
|
|
|
|
|
|
|
|
|
const int opcodePlayBink = 0x20001f7;
|
|
|
|
|
|
|
|
|
|
const int opcodeHitOnMe = 0x2000213;
|
|
|
|
|
const int opcodeHitOnMeExplicit = 0x2000214;
|
|
|
|
|
|
|
|
|
|
void registerExtensions (Compiler::Extensions& extensions)
|
|
|
|
|
{
|
|
|
|
|
extensions.registerFunction ("xbox", 'l', "", opcodeXBox);
|
|
|
|
@ -692,6 +712,7 @@ namespace MWScript
|
|
|
|
|
extensions.registerFunction ("getstandingpc", 'l', "", opcodeGetStandingPc, opcodeGetStandingPcExplicit);
|
|
|
|
|
extensions.registerFunction ("getstandingactor", 'l', "", opcodeGetStandingActor, opcodeGetStandingActorExplicit);
|
|
|
|
|
extensions.registerFunction ("getwindspeed", 'f', "", opcodeGetWindSpeed);
|
|
|
|
|
extensions.registerFunction ("hitonme", 'l', "S", opcodeHitOnMe, opcodeHitOnMeExplicit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void installOpcodes (Interpreter::Interpreter& interpreter)
|
|
|
|
@ -745,6 +766,8 @@ namespace MWScript
|
|
|
|
|
interpreter.installSegment5 (opcodeGetStandingActor, new OpGetStandingActor<ImplicitRef>);
|
|
|
|
|
interpreter.installSegment5 (opcodeGetStandingActorExplicit, new OpGetStandingActor<ExplicitRef>);
|
|
|
|
|
interpreter.installSegment5 (opcodeGetWindSpeed, new OpGetWindSpeed);
|
|
|
|
|
interpreter.installSegment5 (opcodeHitOnMe, new OpHitOnMe<ImplicitRef>);
|
|
|
|
|
interpreter.installSegment5 (opcodeHitOnMeExplicit, new OpHitOnMe<ExplicitRef>);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|