Remove numeric magic school ids and deprecate the enum

macos_ci_fix
Evil Eye 8 months ago
parent 4c3acfbcc0
commit 6ed5cbb7d0

@ -71,7 +71,7 @@ message(STATUS "Configuring OpenMW...")
set(OPENMW_VERSION_MAJOR 0)
set(OPENMW_VERSION_MINOR 49)
set(OPENMW_VERSION_RELEASE 0)
set(OPENMW_LUA_API_REVISION 48)
set(OPENMW_LUA_API_REVISION 49)
set(OPENMW_VERSION_COMMITHASH "")
set(OPENMW_VERSION_TAGHASH "")

@ -184,7 +184,7 @@ namespace MWLua
return sol::nil;
};
// TODO: deprecate this and provide access to the store instead
// deprecated, use core.stats.Skill
sol::table skills(context.mLua->sol(), sol::create);
api["SKILL"] = LuaUtil::makeStrictReadOnly(skills);
for (int i = 0; i < ESM::Skill::Length; ++i)
@ -197,7 +197,7 @@ namespace MWLua
skills[key] = id;
}
// TODO: deprecate this and provide access to the store instead
// deprecated, use core.stats.Attribute
sol::table attributes(context.mLua->sol(), sol::create);
api["ATTRIBUTE"] = LuaUtil::makeStrictReadOnly(attributes);
for (int i = 0; i < ESM::Attribute::Length; ++i)

@ -203,13 +203,14 @@ namespace MWLua
{ "Touch", ESM::RT_Touch },
{ "Target", ESM::RT_Target },
}));
magicApi["SCHOOL"] = LuaUtil::makeStrictReadOnly(context.mLua->tableFromPairs<std::string_view, int>({
{ "Alteration", 0 },
{ "Conjuration", 1 },
{ "Destruction", 2 },
{ "Illusion", 3 },
{ "Mysticism", 4 },
{ "Restoration", 5 },
// deprecated, use core.stats.Skill
magicApi["SCHOOL"] = LuaUtil::makeStrictReadOnly(context.mLua->tableFromPairs<std::string_view, std::string>({
{ "Alteration", ESM::RefId(ESM::Skill::Alteration).serializeText() },
{ "Conjuration", ESM::RefId(ESM::Skill::Conjuration).serializeText() },
{ "Destruction", ESM::RefId(ESM::Skill::Destruction).serializeText() },
{ "Illusion", ESM::RefId(ESM::Skill::Illusion).serializeText() },
{ "Mysticism", ESM::RefId(ESM::Skill::Mysticism).serializeText() },
{ "Restoration", ESM::RefId(ESM::Skill::Restoration).serializeText() },
}));
magicApi["SPELL_TYPE"]
= LuaUtil::makeStrictReadOnly(context.mLua->tableFromPairs<std::string_view, ESM::Spell::SpellType>({
@ -406,7 +407,7 @@ namespace MWLua
->mValue.getString();
});
magicEffectT["school"] = sol::readonly_property(
[](const ESM::MagicEffect& rec) -> int { return ESM::MagicSchool::skillRefIdToIndex(rec.mData.mSchool); });
[](const ESM::MagicEffect& rec) -> std::string { return rec.mData.mSchool.serializeText(); });
magicEffectT["baseCost"]
= sol::readonly_property([](const ESM::MagicEffect& rec) -> float { return rec.mData.mBaseCost; });
magicEffectT["color"] = sol::readonly_property([](const ESM::MagicEffect& rec) -> Misc::Color {

@ -333,8 +333,8 @@
---
-- @type ActiveSpellEffect
-- @field #string affectedSkill @{#SKILL} or nil
-- @field #string affectedAttribute @{#ATTRIBUTE} or nil
-- @field #string affectedSkill Optional skill ID
-- @field #string affectedAttribute Optional attribute ID
-- @field #string id Magic effect id
-- @field #string name Localized name of the effect
-- @field #number magnitudeThisFrame The magnitude of the effect in the current frame. This will be a new random number between minMagnitude and maxMagnitude every frame. Or nil if the effect has no magnitude.
@ -498,17 +498,17 @@
-- @field #number Target Ranged spell
--- Possible @{#MagicSchool} values
--- Possible @{#MagicSchool} values (DEPRECATED use @{#Skill})
-- @field [parent=#Magic] #MagicSchool SCHOOL
--- `core.magic.SCHOOL`
-- @type MagicSchool
-- @field #number Alteration Alteration
-- @field #number Conjuration Conjuration
-- @field #number Destruction Destruction
-- @field #number Illusion Illusion
-- @field #number Mysticism Mysticism
-- @field #number Restoration Restoration
-- @field #string Alteration alteration
-- @field #string Conjuration conjuration
-- @field #string Destruction destruction
-- @field #string Illusion illusion
-- @field #string Mysticism mysticism
-- @field #string Restoration restoration
--- Possible @{#MagicEffectId} values
@ -720,7 +720,7 @@
-- @field #string id Effect ID
-- @field #string icon Effect Icon Path
-- @field #string name Localized name of the effect
-- @field #number school @{#MagicSchool}
-- @field #string school Skill ID
-- @field #number baseCost
-- @field openmw.util#Color color
-- @field #boolean harmful
@ -728,8 +728,8 @@
---
-- @type MagicEffectWithParams
-- @field #MagicEffect effect @{#MagicEffect}
-- @field #string affectedSkill @{#SKILL} or nil
-- @field #string affectedAttribute @{#ATTRIBUTE} or nil
-- @field #string affectedSkill Optional skill ID
-- @field #string affectedAttribute Optional attribute ID
-- @field #number range
-- @field #number area
-- @field #number magnitudeMin
@ -738,8 +738,8 @@
---
-- @type ActiveEffect
-- @field #string affectedSkill @{#SKILL} or nil
-- @field #string affectedAttribute @{#ATTRIBUTE} or nil
-- @field #string affectedSkill Optional skill ID
-- @field #string affectedAttribute Optional attribute ID
-- @field #string id Effect id string
-- @field #string name Localized name of the effect
-- @field #number magnitude

Loading…
Cancel
Save