From cb2a8c74dd1fcd5059346765f48c342efbdb9ade Mon Sep 17 00:00:00 2001 From: Mehdi Yousfi-Monod Date: Sun, 1 Sep 2024 15:26:58 +0200 Subject: [PATCH 1/4] FEAT: Expose starter spells --- apps/openmw/mwlua/magicbindings.cpp | 2 ++ files/lua_api/openmw/core.lua | 1 + 2 files changed, 3 insertions(+) diff --git a/apps/openmw/mwlua/magicbindings.cpp b/apps/openmw/mwlua/magicbindings.cpp index 8078537d5a..9498c68477 100644 --- a/apps/openmw/mwlua/magicbindings.cpp +++ b/apps/openmw/mwlua/magicbindings.cpp @@ -306,6 +306,8 @@ namespace MWLua spellT["cost"] = sol::readonly_property([](const ESM::Spell& rec) -> int { return rec.mData.mCost; }); spellT["alwaysSucceedFlag"] = sol::readonly_property( [](const ESM::Spell& rec) -> bool { return !!(rec.mData.mFlags & ESM::Spell::F_Always); }); + spellT["starterSpellFlag"] = sol::readonly_property( + [](const ESM::Spell& rec) -> bool { return !!(rec.mData.mFlags & ESM::Spell::F_PCStart); }); spellT["autocalcFlag"] = sol::readonly_property( [](const ESM::Spell& rec) -> bool { return !!(rec.mData.mFlags & ESM::Spell::F_Autocalc); }); spellT["effects"] = sol::readonly_property( diff --git a/files/lua_api/openmw/core.lua b/files/lua_api/openmw/core.lua index 6178fed08b..8a78a52441 100644 --- a/files/lua_api/openmw/core.lua +++ b/files/lua_api/openmw/core.lua @@ -679,6 +679,7 @@ -- @field #number cost -- @field #list<#MagicEffectWithParams> effects The effects (@{#MagicEffectWithParams}) of the spell -- @field #boolean alwaysSucceedFlag If set, the spell should ignore skill checks and always succeed. +-- @field #boolean starterSpellFlag If set, the spell can be selected as a player's starting spell. -- @field #boolean autocalcFlag If set, the casting cost should be computed based on the effect list rather than read from the cost field --- From 767d7bfecd7222b50c6c037f56aaa078b0230b60 Mon Sep 17 00:00:00 2001 From: Mehdi Yousfi-Monod Date: Sun, 1 Sep 2024 15:36:53 +0200 Subject: [PATCH 2/4] fixed indent --- apps/openmw/mwlua/magicbindings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwlua/magicbindings.cpp b/apps/openmw/mwlua/magicbindings.cpp index 9498c68477..b03ce706b6 100644 --- a/apps/openmw/mwlua/magicbindings.cpp +++ b/apps/openmw/mwlua/magicbindings.cpp @@ -307,7 +307,7 @@ namespace MWLua spellT["alwaysSucceedFlag"] = sol::readonly_property( [](const ESM::Spell& rec) -> bool { return !!(rec.mData.mFlags & ESM::Spell::F_Always); }); spellT["starterSpellFlag"] = sol::readonly_property( - [](const ESM::Spell& rec) -> bool { return !!(rec.mData.mFlags & ESM::Spell::F_PCStart); }); + [](const ESM::Spell& rec) -> bool { return !!(rec.mData.mFlags & ESM::Spell::F_PCStart); }); spellT["autocalcFlag"] = sol::readonly_property( [](const ESM::Spell& rec) -> bool { return !!(rec.mData.mFlags & ESM::Spell::F_Autocalc); }); spellT["effects"] = sol::readonly_property( From 0d9b1a579522fa96c3257bc8df364387c7b1a743 Mon Sep 17 00:00:00 2001 From: Mehdi Yousfi-Monod Date: Sun, 1 Sep 2024 15:46:44 +0200 Subject: [PATCH 3/4] updated authors and changelog --- AUTHORS.md | 1 + CHANGELOG.md | 1 + 2 files changed, 2 insertions(+) diff --git a/AUTHORS.md b/AUTHORS.md index 0ca5ee68c4..e5caf5fa58 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -156,6 +156,7 @@ Programmers Mateusz Malisz (malice) Max Henzerling (SaintMercury) megaton + Mehdi Yousfi-Monod (mym) Michael Hogan (Xethik) Michael Mc Donnell Michael Papageorgiou (werdanith) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14302c0a30..aef21779d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -262,6 +262,7 @@ Feature #8067: Support Game Mode on macOS Feature #8078: OpenMW-CS Terrain Equalize Tool Feature #8087: Creature movement flags are not exposed + Feature #8145: Starter spell flag is not exposed Task #5896: Do not use deprecated MyGUI properties Task #6085: Replace boost::filesystem with std::filesystem Task #6149: Dehardcode Lua API_REVISION From 20bd83b28015f32127c804fa239bd387ee5d10db Mon Sep 17 00:00:00 2001 From: Mehdi Yousfi-Monod Date: Tue, 3 Sep 2024 16:54:37 +0200 Subject: [PATCH 4/4] bumped Lua API version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e3688057b..43cd553de0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,7 +82,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 67) +set(OPENMW_LUA_API_REVISION 68) set(OPENMW_POSTPROCESSING_API_REVISION 1) set(OPENMW_VERSION_COMMITHASH "")