mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 20:36:40 +00:00
Move classes to types.NPC
This commit is contained in:
parent
81da58478d
commit
ae4eafdfd4
4 changed files with 35 additions and 36 deletions
|
@ -37,7 +37,6 @@
|
|||
|
||||
#include "camerabindings.hpp"
|
||||
#include "cellbindings.hpp"
|
||||
#include "classbindings.hpp"
|
||||
#include "debugbindings.hpp"
|
||||
#include "factionbindings.hpp"
|
||||
#include "inputbindings.hpp"
|
||||
|
@ -158,12 +157,9 @@ namespace MWLua
|
|||
api["magic"] = initCoreMagicBindings(context);
|
||||
api["stats"] = initCoreStatsBindings(context);
|
||||
|
||||
sol::table character(lua->sol(), sol::create);
|
||||
initCoreFactionBindings(context);
|
||||
character["factions"] = &MWBase::Environment::get().getWorld()->getStore().get<ESM::Faction>();
|
||||
api["factions"] = &MWBase::Environment::get().getWorld()->getStore().get<ESM::Faction>();
|
||||
|
||||
character["classes"] = initCoreClassBindings(context);
|
||||
api["character"] = LuaUtil::makeReadOnly(character);
|
||||
api["l10n"] = LuaUtil::initL10nLoader(lua->sol(), MWBase::Environment::get().getL10nManager());
|
||||
const MWWorld::Store<ESM::GameSetting>* gmstStore
|
||||
= &MWBase::Environment::get().getESMStore()->get<ESM::GameSetting>();
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <apps/openmw/mwworld/class.hpp>
|
||||
#include <apps/openmw/mwworld/esmstore.hpp>
|
||||
|
||||
#include "../classbindings.hpp"
|
||||
#include "../localscripts.hpp"
|
||||
#include "../stats.hpp"
|
||||
|
||||
|
@ -81,6 +82,9 @@ namespace MWLua
|
|||
record["baseGold"] = sol::readonly_property([](const ESM::NPC& rec) -> int { return rec.mNpdt.mGold; });
|
||||
addActorServicesBindings<ESM::NPC>(record, context);
|
||||
|
||||
sol::table character(lua, sol::create);
|
||||
character["classes"] = initCoreClassBindings(context);
|
||||
npc["character"] = LuaUtil::makeReadOnly(character);
|
||||
// This function is game-specific, in future we should replace it with something more universal.
|
||||
npc["isWerewolf"] = [](const Object& o) {
|
||||
const MWWorld::Class& cls = o.ptr().getClass();
|
||||
|
|
|
@ -12,24 +12,7 @@
|
|||
|
||||
---
|
||||
-- A read-only list of all @{#FactionRecord}s in the world database.
|
||||
-- @field [parent=#Character] #list<#FactionRecord> factions
|
||||
|
||||
--- @{#Character}: Class and Character Data
|
||||
-- @field [parent=#core] #Character character
|
||||
|
||||
|
||||
--- @{#Classes}: Class Data
|
||||
-- @field [parent=#Character] #Classes classes
|
||||
|
||||
---
|
||||
-- A read-only list of all @{#ClassRecord}s in the world database.
|
||||
-- @field [parent=#Classes] #list<#ClassRecord> records
|
||||
|
||||
---
|
||||
-- Returns a read-only @{#ClassRecord}
|
||||
-- @function [parent=#Classes] record
|
||||
-- @param #string recordId
|
||||
-- @return #ClassRecord
|
||||
-- @field [parent=#core] #list<#FactionRecord> factions
|
||||
|
||||
---
|
||||
-- Terminates the game and quits to the OS. Should be used only for testing purposes.
|
||||
|
@ -889,19 +872,6 @@
|
|||
-- @field #string failureSound VFS path to the failure sound
|
||||
-- @field #string hitSound VFS path to the hit sound
|
||||
|
||||
---
|
||||
-- Class data record
|
||||
-- @type ClassRecord
|
||||
-- @field #string id Class id
|
||||
-- @field #string name Class name
|
||||
-- @field #list<#string> attributes A read-only list containing the specialized attributes of the class.
|
||||
-- @field #list<#string> majorSkills A read-only list containing the major skills of the class.
|
||||
-- @field #list<#string> minorSkills A read-only list containing the minor skills of the class.
|
||||
-- @field #string description Class description
|
||||
-- @field #boolean isPlayable True if the player can play as this class
|
||||
-- @field #string specialization Class specialization. Either combat, magic, or stealth.
|
||||
|
||||
|
||||
---
|
||||
-- Faction data record
|
||||
-- @type FactionRecord
|
||||
|
|
|
@ -872,6 +872,35 @@
|
|||
-- @param openmw.core#GameObject actor
|
||||
-- @return #number
|
||||
|
||||
--- @{#Character}: Class and Character Data
|
||||
-- @field [parent=#NPC] #Character character
|
||||
|
||||
|
||||
--- @{#Classes}: Class Data
|
||||
-- @field [parent=#Character] #Classes classes
|
||||
|
||||
---
|
||||
-- A read-only list of all @{#ClassRecord}s in the world database.
|
||||
-- @field [parent=#Classes] #list<#ClassRecord> records
|
||||
|
||||
---
|
||||
-- Returns a read-only @{#ClassRecord}
|
||||
-- @function [parent=#Classes] record
|
||||
-- @param #string recordId
|
||||
-- @return #ClassRecord
|
||||
|
||||
---
|
||||
-- Class data record
|
||||
-- @type ClassRecord
|
||||
-- @field #string id Class id
|
||||
-- @field #string name Class name
|
||||
-- @field #list<#string> attributes A read-only list containing the specialized attributes of the class.
|
||||
-- @field #list<#string> majorSkills A read-only list containing the major skills of the class.
|
||||
-- @field #list<#string> minorSkills A read-only list containing the minor skills of the class.
|
||||
-- @field #string description Class description
|
||||
-- @field #boolean isPlayable True if the player can play as this class
|
||||
-- @field #string specialization Class specialization. Either combat, magic, or stealth.
|
||||
|
||||
---
|
||||
-- Whether the NPC or player is in the werewolf form at the moment.
|
||||
-- @function [parent=#NPC] isWerewolf
|
||||
|
|
Loading…
Reference in a new issue