mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-06 08:15:34 +00:00
Implement GetSpellReadied instruction
This commit is contained in:
parent
c0fbcf413f
commit
2a7d610f87
4 changed files with 22 additions and 2 deletions
|
@ -368,4 +368,6 @@ op 0x200022d: RemoveEffects
|
|||
op 0x200022e: RemoveEffects, explicit
|
||||
op 0x200022f: Resurrect
|
||||
op 0x2000230: Resurrect, explicit
|
||||
opcodes 0x200022f-0x3ffffff unused
|
||||
op 0x2000231: GetSpellReadied
|
||||
op 0x2000232: GetSpellReadied, explicit
|
||||
opcodes 0x2000233-0x3ffffff unused
|
||||
|
|
|
@ -465,7 +465,20 @@ namespace MWScript
|
|||
{
|
||||
MWWorld::Ptr ptr = R()(runtime);
|
||||
|
||||
runtime.push(MWWorld::Class::get(ptr).getNpcStats (ptr).getDrawState () == MWMechanics::DrawState_Weapon);
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -776,6 +789,8 @@ namespace MWScript
|
|||
interpreter.installSegment5 (Compiler::Misc::opcodeGetAttackedExplicit, new OpGetAttacked<ExplicitRef>);
|
||||
interpreter.installSegment5 (Compiler::Misc::opcodeGetWeaponDrawn, new OpGetWeaponDrawn<ImplicitRef>);
|
||||
interpreter.installSegment5 (Compiler::Misc::opcodeGetWeaponDrawnExplicit, new OpGetWeaponDrawn<ExplicitRef>);
|
||||
interpreter.installSegment5 (Compiler::Misc::opcodeGetSpellReadied, new OpGetSpellReadied<ImplicitRef>);
|
||||
interpreter.installSegment5 (Compiler::Misc::opcodeGetSpellReadiedExplicit, new OpGetSpellReadied<ExplicitRef>);
|
||||
interpreter.installSegment5 (Compiler::Misc::opcodeGetSpellEffects, new OpGetSpellEffects<ImplicitRef>);
|
||||
interpreter.installSegment5 (Compiler::Misc::opcodeGetSpellEffectsExplicit, new OpGetSpellEffects<ExplicitRef>);
|
||||
interpreter.installSegment5 (Compiler::Misc::opcodeGetCurrentTime, new OpGetCurrentTime);
|
||||
|
|
|
@ -251,6 +251,7 @@ namespace Compiler
|
|||
extensions.registerInstruction ("dropsoulgem", "c", opcodeDropSoulGem, opcodeDropSoulGemExplicit);
|
||||
extensions.registerFunction ("getattacked", 'l', "", opcodeGetAttacked, opcodeGetAttackedExplicit);
|
||||
extensions.registerFunction ("getweapondrawn", 'l', "", opcodeGetWeaponDrawn, opcodeGetWeaponDrawnExplicit);
|
||||
extensions.registerFunction ("getspellreadied", 'l', "", opcodeGetSpellReadied, opcodeGetSpellReadiedExplicit);
|
||||
extensions.registerFunction ("getspelleffects", 'l', "c", opcodeGetSpellEffects, opcodeGetSpellEffectsExplicit);
|
||||
extensions.registerFunction ("getcurrenttime", 'f', "", opcodeGetCurrentTime);
|
||||
extensions.registerInstruction ("setdelete", "l", opcodeSetDelete, opcodeSetDeleteExplicit);
|
||||
|
|
|
@ -205,6 +205,8 @@ namespace Compiler
|
|||
const int opcodeGetAttackedExplicit = 0x20001d4;
|
||||
const int opcodeGetWeaponDrawn = 0x20001d7;
|
||||
const int opcodeGetWeaponDrawnExplicit = 0x20001d8;
|
||||
const int opcodeGetSpellReadied = 0x2000231;
|
||||
const int opcodeGetSpellReadiedExplicit = 0x2000232;
|
||||
const int opcodeGetSpellEffects = 0x20001db;
|
||||
const int opcodeGetSpellEffectsExplicit = 0x20001dc;
|
||||
const int opcodeGetCurrentTime = 0x20001dd;
|
||||
|
|
Loading…
Reference in a new issue