mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-29 05:17:58 +03:00
Implement magic effect script instructions (Feature #1489)
This commit is contained in:
parent
d8943aef2f
commit
2db50da8dd
11 changed files with 240 additions and 20 deletions
|
@ -370,6 +370,16 @@ namespace Compiler
|
|||
"mercantile", "speechcraft", "handtohand"
|
||||
};
|
||||
|
||||
static const char *magicEffects[numberOfMagicEffects] =
|
||||
{
|
||||
"resistmagicka", "resistfire", "resistfrost", "resistshock",
|
||||
"resistdisease", "resistblight", "resistcorprus", "resistpoison",
|
||||
"resistparalysis", "resistnormalweapons", "waterbreathing", "chameleon",
|
||||
"waterwalking", "swimspeed", "superjump", "flying",
|
||||
"armorbonus", "castpenalty", "silence", "blindness",
|
||||
"paralysis", "invisible", "attackbonus", "defendbonus"
|
||||
};
|
||||
|
||||
std::string get ("get");
|
||||
std::string set ("set");
|
||||
std::string mod ("mod");
|
||||
|
@ -418,6 +428,18 @@ namespace Compiler
|
|||
opcodeModSkill+i, opcodeModSkillExplicit+i);
|
||||
}
|
||||
|
||||
for (int i=0; i<numberOfMagicEffects; ++i)
|
||||
{
|
||||
extensions.registerFunction (get + magicEffects[i], 'l', "",
|
||||
opcodeGetMagicEffect+i, opcodeGetMagicEffectExplicit+i);
|
||||
|
||||
extensions.registerInstruction (set + magicEffects[i], "l",
|
||||
opcodeSetMagicEffect+i, opcodeSetMagicEffectExplicit+i);
|
||||
|
||||
extensions.registerInstruction(mod + magicEffects[i], "l",
|
||||
opcodeModMagicEffect+i, opcodeModMagicEffectExplicit+i);
|
||||
}
|
||||
|
||||
extensions.registerFunction ("getpccrimelevel", 'f', "", opcodeGetPCCrimeLevel);
|
||||
extensions.registerInstruction ("setpccrimelevel", "f", opcodeSetPCCrimeLevel);
|
||||
extensions.registerInstruction ("modpccrimelevel", "f", opcodeModPCCrimeLevel);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue