mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-28 12:39:41 +00:00
Merge branch 'how-do-you-ambulate' into 'master'
FEAT(types): Expose creature flags See merge request OpenMW/openmw!4280
This commit is contained in:
commit
30a844ae71
4 changed files with 28 additions and 0 deletions
|
@ -257,6 +257,7 @@
|
|||
Feature #8034: (Lua) Containers should have respawning/organic flags
|
||||
Feature #8067: Support Game Mode on macOS
|
||||
Feature #8078: OpenMW-CS Terrain Equalize Tool
|
||||
Feature #8087: Creature movement flags are not exposed
|
||||
Task #5896: Do not use deprecated MyGUI properties
|
||||
Task #6085: Replace boost::filesystem with std::filesystem
|
||||
Task #6149: Dehardcode Lua API_REVISION
|
||||
|
|
|
@ -58,6 +58,20 @@ namespace MWLua
|
|||
res[index++] = attack;
|
||||
return LuaUtil::makeReadOnly(res);
|
||||
});
|
||||
record["canFly"] = sol::readonly_property(
|
||||
[](const ESM::Creature& rec) -> bool { return rec.mFlags & ESM::Creature::Flies; });
|
||||
record["canSwim"] = sol::readonly_property(
|
||||
[](const ESM::Creature& rec) -> bool { return rec.mFlags & ESM::Creature::Swims; });
|
||||
record["canUseWeapons"] = sol::readonly_property(
|
||||
[](const ESM::Creature& rec) -> bool { return rec.mFlags & ESM::Creature::Weapon; });
|
||||
record["canWalk"] = sol::readonly_property(
|
||||
[](const ESM::Creature& rec) -> bool { return rec.mFlags & ESM::Creature::Walks; });
|
||||
record["isBiped"] = sol::readonly_property(
|
||||
[](const ESM::Creature& rec) -> bool { return rec.mFlags & ESM::Creature::Bipedal; });
|
||||
record["isEssential"] = sol::readonly_property(
|
||||
[](const ESM::Creature& rec) -> bool { return rec.mFlags & ESM::Creature::Essential; });
|
||||
record["isRespawning"] = sol::readonly_property(
|
||||
[](const ESM::Creature& rec) -> bool { return rec.mFlags & ESM::Creature::Respawn; });
|
||||
|
||||
addActorServicesBindings<ESM::Creature>(record, context);
|
||||
}
|
||||
|
|
|
@ -95,7 +95,11 @@ namespace MWLua
|
|||
= sol::readonly_property([](const ESM::NPC& rec) -> std::string { return rec.mHead.serializeText(); });
|
||||
record["model"] = sol::readonly_property(
|
||||
[](const ESM::NPC& rec) -> std::string { return Misc::ResourceHelpers::correctMeshPath(rec.mModel); });
|
||||
record["isEssential"]
|
||||
= sol::readonly_property([](const ESM::NPC& rec) -> bool { return rec.mFlags & ESM::NPC::Essential; });
|
||||
record["isMale"] = sol::readonly_property([](const ESM::NPC& rec) -> bool { return rec.isMale(); });
|
||||
record["isRespawning"]
|
||||
= sol::readonly_property([](const ESM::NPC& rec) -> bool { return rec.mFlags & ESM::NPC::Respawn; });
|
||||
record["baseGold"] = sol::readonly_property([](const ESM::NPC& rec) -> int { return rec.mNpdt.mGold; });
|
||||
addActorServicesBindings<ESM::NPC>(record, context);
|
||||
|
||||
|
|
|
@ -847,6 +847,13 @@
|
|||
-- @field #list<#number> attack A table of the 3 randomly selected attacks used by creatures that do not carry weapons. The table consists of 6 numbers split into groups of 2 values corresponding to minimum and maximum damage in that order.
|
||||
-- @field #map<#string, #boolean> servicesOffered The services of the creature, in a table. Value is if the service is provided or not, and they are indexed by: Spells, Spellmaking, Enchanting, Training, Repair, Barter, Weapon, Armor, Clothing, Books, Ingredients, Picks, Probes, Lights, Apparatus, RepairItems, Misc, Potions, MagicItems, Travel.
|
||||
-- @field #list<#TravelDestination> travelDestinations A list of @{#TravelDestination}s for this creature.
|
||||
-- @field #boolean canFly whether the creature can fly
|
||||
-- @field #boolean canSwim whether the creature can swim
|
||||
-- @field #boolean canWalk whether the creature can walk
|
||||
-- @field #boolean canUseWeapons whether the creature can use weapons and shields
|
||||
-- @field #boolean isBiped whether the creature is a biped
|
||||
-- @field #boolean isEssential whether the creature is essential
|
||||
-- @field #boolean isRespawning whether the creature respawns after death
|
||||
|
||||
|
||||
--- @{#NPC} functions
|
||||
|
@ -1125,6 +1132,8 @@
|
|||
-- @field #bool isMale The gender setting of the NPC
|
||||
-- @field #map<#string, #boolean> servicesOffered The services of the NPC, in a table. Value is if the service is provided or not, and they are indexed by: Spells, Spellmaking, Enchanting, Training, Repair, Barter, Weapon, Armor, Clothing, Books, Ingredients, Picks, Probes, Lights, Apparatus, RepairItems, Misc, Potions, MagicItems, Travel.
|
||||
-- @field #list<#TravelDestination> travelDestinations A list of @{#TravelDestination}s for this NPC.
|
||||
-- @field #boolean isEssential whether the NPC is essential
|
||||
-- @field #boolean isRespawning whether the NPC respawns after death
|
||||
|
||||
---
|
||||
-- @type TravelDestination
|
||||
|
|
Loading…
Reference in a new issue