mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 23:06:41 +00:00
Implement Resurrect instruction
This commit is contained in:
parent
b4230f716e
commit
55c5d7cee4
5 changed files with 25 additions and 3 deletions
|
@ -266,8 +266,10 @@ namespace MWMechanics
|
||||||
if (mDead)
|
if (mDead)
|
||||||
{
|
{
|
||||||
if (mDynamic[0].getCurrent()<1)
|
if (mDynamic[0].getCurrent()<1)
|
||||||
mDynamic[0].setCurrent (1);
|
{
|
||||||
|
mDynamic[0].setModified(mDynamic[0].getModified(), 1);
|
||||||
|
mDynamic[0].setCurrent(1);
|
||||||
|
}
|
||||||
if (mDynamic[0].getCurrent()>=1)
|
if (mDynamic[0].getCurrent()>=1)
|
||||||
mDead = false;
|
mDead = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -366,4 +366,6 @@ op 0x200022b: RemoveSpellEffects
|
||||||
op 0x200022c: RemoveSpellEffects, explicit
|
op 0x200022c: RemoveSpellEffects, explicit
|
||||||
op 0x200022d: RemoveEffects
|
op 0x200022d: RemoveEffects
|
||||||
op 0x200022e: RemoveEffects, explicit
|
op 0x200022e: RemoveEffects, explicit
|
||||||
|
op 0x200022f: Resurrect
|
||||||
|
op 0x2000230: Resurrect, explicit
|
||||||
opcodes 0x200022f-0x3ffffff unused
|
opcodes 0x200022f-0x3ffffff unused
|
||||||
|
|
|
@ -1104,6 +1104,18 @@ namespace MWScript
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <class R>
|
||||||
|
class OpResurrect : public Interpreter::Opcode0
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
virtual void execute (Interpreter::Runtime& runtime)
|
||||||
|
{
|
||||||
|
MWWorld::Ptr ptr = R()(runtime);
|
||||||
|
ptr.getClass().getCreatureStats(ptr).resurrect();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void installOpcodes (Interpreter::Interpreter& interpreter)
|
void installOpcodes (Interpreter::Interpreter& interpreter)
|
||||||
{
|
{
|
||||||
for (int i=0; i<Compiler::Stats::numberOfAttributes; ++i)
|
for (int i=0; i<Compiler::Stats::numberOfAttributes; ++i)
|
||||||
|
@ -1170,7 +1182,9 @@ namespace MWScript
|
||||||
interpreter.installSegment5 (Compiler::Stats::opcodeRemoveSpellEffects, new OpRemoveSpellEffects<ImplicitRef>);
|
interpreter.installSegment5 (Compiler::Stats::opcodeRemoveSpellEffects, new OpRemoveSpellEffects<ImplicitRef>);
|
||||||
interpreter.installSegment5 (Compiler::Stats::opcodeRemoveSpellEffectsExplicit,
|
interpreter.installSegment5 (Compiler::Stats::opcodeRemoveSpellEffectsExplicit,
|
||||||
new OpRemoveSpellEffects<ExplicitRef>);
|
new OpRemoveSpellEffects<ExplicitRef>);
|
||||||
|
interpreter.installSegment5 (Compiler::Stats::opcodeResurrect, new OpResurrect<ImplicitRef>);
|
||||||
|
interpreter.installSegment5 (Compiler::Stats::opcodeResurrectExplicit,
|
||||||
|
new OpResurrect<ExplicitRef>);
|
||||||
interpreter.installSegment5 (Compiler::Stats::opcodeRemoveEffects, new OpRemoveEffects<ImplicitRef>);
|
interpreter.installSegment5 (Compiler::Stats::opcodeRemoveEffects, new OpRemoveEffects<ImplicitRef>);
|
||||||
interpreter.installSegment5 (Compiler::Stats::opcodeRemoveEffectsExplicit,
|
interpreter.installSegment5 (Compiler::Stats::opcodeRemoveEffectsExplicit,
|
||||||
new OpRemoveEffects<ExplicitRef>);
|
new OpRemoveEffects<ExplicitRef>);
|
||||||
|
|
|
@ -395,6 +395,8 @@ namespace Compiler
|
||||||
opcodeRemoveSpellEffectsExplicit);
|
opcodeRemoveSpellEffectsExplicit);
|
||||||
extensions.registerInstruction ("removeeffects", "l", opcodeRemoveEffects,
|
extensions.registerInstruction ("removeeffects", "l", opcodeRemoveEffects,
|
||||||
opcodeRemoveEffectsExplicit);
|
opcodeRemoveEffectsExplicit);
|
||||||
|
extensions.registerInstruction ("resurrect", "", opcodeResurrect,
|
||||||
|
opcodeResurrectExplicit);
|
||||||
extensions.registerFunction ("getspell", 'l', "c", opcodeGetSpell, opcodeGetSpellExplicit);
|
extensions.registerFunction ("getspell", 'l', "c", opcodeGetSpell, opcodeGetSpellExplicit);
|
||||||
|
|
||||||
extensions.registerInstruction("pcraiserank","/S",opcodePCRaiseRank);
|
extensions.registerInstruction("pcraiserank","/S",opcodePCRaiseRank);
|
||||||
|
|
|
@ -374,6 +374,8 @@ namespace Compiler
|
||||||
const int opcodeRemoveSpellEffectsExplicit = 0x200022c;
|
const int opcodeRemoveSpellEffectsExplicit = 0x200022c;
|
||||||
const int opcodeRemoveEffects = 0x200022d;
|
const int opcodeRemoveEffects = 0x200022d;
|
||||||
const int opcodeRemoveEffectsExplicit = 0x200022e;
|
const int opcodeRemoveEffectsExplicit = 0x200022e;
|
||||||
|
const int opcodeResurrect = 0x200022f;
|
||||||
|
const int opcodeResurrectExplicit = 0x2000230;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Transformation
|
namespace Transformation
|
||||||
|
|
Loading…
Reference in a new issue