mirror of
https://github.com/OpenMW/openmw.git
synced 2025-12-25 21:33:06 +00:00
Merge branch 'livefactionreaction' into 'master'
Rename faction rank reaction to reputation Closes #8789 See merge request OpenMW/openmw!5037
This commit is contained in:
commit
5a022532fd
8 changed files with 20 additions and 13 deletions
|
|
@ -82,7 +82,7 @@ message(STATUS "Configuring OpenMW...")
|
|||
set(OPENMW_VERSION_MAJOR 0)
|
||||
set(OPENMW_VERSION_MINOR 51)
|
||||
set(OPENMW_VERSION_RELEASE 0)
|
||||
set(OPENMW_LUA_API_REVISION 107)
|
||||
set(OPENMW_LUA_API_REVISION 108)
|
||||
set(OPENMW_POSTPROCESSING_API_REVISION 4)
|
||||
|
||||
set(OPENMW_VERSION_COMMITHASH "")
|
||||
|
|
|
|||
|
|
@ -750,7 +750,7 @@ namespace EsmTool
|
|||
std::cout << " Attribute2 Requirement: " << mData.mData.mRankData[i].mAttribute2 << std::endl;
|
||||
std::cout << " One Skill at Level: " << mData.mData.mRankData[i].mPrimarySkill << std::endl;
|
||||
std::cout << " Two Skills at Level: " << mData.mData.mRankData[i].mFavouredSkill << std::endl;
|
||||
std::cout << " Faction Reaction: " << mData.mData.mRankData[i].mFactReaction << std::endl;
|
||||
std::cout << " Faction Reputation: " << mData.mData.mRankData[i].mFactReputation << std::endl;
|
||||
}
|
||||
for (const auto& reaction : mData.mReactions)
|
||||
std::cout << " Reaction: " << reaction.second << " = " << reaction.first << std::endl;
|
||||
|
|
|
|||
|
|
@ -1135,7 +1135,7 @@ namespace CSMWorld
|
|||
case 4:
|
||||
return rankData.mFavouredSkill;
|
||||
case 5:
|
||||
return rankData.mFactReaction;
|
||||
return rankData.mFactReputation;
|
||||
default:
|
||||
throw std::runtime_error("Rank subcolumn index out of range");
|
||||
}
|
||||
|
|
@ -1166,7 +1166,7 @@ namespace CSMWorld
|
|||
rankData.mFavouredSkill = value.toInt();
|
||||
break;
|
||||
case 5:
|
||||
rankData.mFactReaction = value.toInt();
|
||||
rankData.mFactReputation = value.toInt();
|
||||
break;
|
||||
default:
|
||||
throw std::runtime_error("Rank index out of range");
|
||||
|
|
|
|||
|
|
@ -708,7 +708,7 @@ bool MWDialogue::Filter::hasFactionRankReputationRequirements(
|
|||
|
||||
const ESM::Faction& faction = *MWBase::Environment::get().getESMStore()->get<ESM::Faction>().find(factionId);
|
||||
|
||||
return stats.getFactionReputation(factionId) >= faction.mData.mRankData.at(rank).mFactReaction;
|
||||
return stats.getFactionReputation(factionId) >= faction.mData.mRankData.at(rank).mFactReputation;
|
||||
}
|
||||
|
||||
MWDialogue::Filter::Filter(const MWWorld::Ptr& actor, int choice, bool talkedToPlayer)
|
||||
|
|
|
|||
|
|
@ -99,9 +99,15 @@ namespace MWLua
|
|||
};
|
||||
rankT["name"]
|
||||
= sol::readonly_property([](const FactionRank& rec) -> std::string_view { return rec.mRankName; });
|
||||
rankT["primarySkillValue"] = sol::readonly_property([](const FactionRank& rec) { return rec.mPrimarySkill; });
|
||||
rankT["favouredSkillValue"] = sol::readonly_property([](const FactionRank& rec) { return rec.mFavouredSkill; });
|
||||
rankT["factionReaction"] = sol::readonly_property([](const FactionRank& rec) { return rec.mFactReaction; });
|
||||
rankT["primarySkillValue"]
|
||||
= sol::readonly_property([](const FactionRank& rec) -> int { return rec.mPrimarySkill; });
|
||||
rankT["favouredSkillValue"]
|
||||
= sol::readonly_property([](const FactionRank& rec) -> int { return rec.mFavouredSkill; });
|
||||
rankT["factionReputation"]
|
||||
= sol::readonly_property([](const FactionRank& rec) -> int { return rec.mFactReputation; });
|
||||
// deprecated
|
||||
rankT["factionReaction"]
|
||||
= sol::readonly_property([](const FactionRank& rec) -> int { return rec.mFactReputation; });
|
||||
rankT["attributeValues"] = sol::readonly_property([lua = lua.lua_state()](const FactionRank& rec) {
|
||||
sol::table res(lua, sol::create);
|
||||
res.add(rec.mAttribute1);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ namespace ESM
|
|||
esm.getT(mAttribute2);
|
||||
esm.getT(mPrimarySkill);
|
||||
esm.getT(mFavouredSkill);
|
||||
esm.getT(mFactReaction);
|
||||
esm.getT(mFactReputation);
|
||||
}
|
||||
|
||||
void RankData::save(ESMWriter& esm) const
|
||||
|
|
@ -32,7 +32,7 @@ namespace ESM
|
|||
esm.writeT(mAttribute2);
|
||||
esm.writeT(mPrimarySkill);
|
||||
esm.writeT(mFavouredSkill);
|
||||
esm.writeT(mFactReaction);
|
||||
esm.writeT(mFactReputation);
|
||||
}
|
||||
|
||||
void Faction::FADTstruct::load(ESMReader& esm)
|
||||
|
|
@ -160,7 +160,7 @@ namespace ESM
|
|||
{
|
||||
mData.mRankData[i].mAttribute1 = mData.mRankData[i].mAttribute2 = 0;
|
||||
mData.mRankData[i].mPrimarySkill = mData.mRankData[i].mFavouredSkill = 0;
|
||||
mData.mRankData[i].mFactReaction = 0;
|
||||
mData.mRankData[i].mFactReputation = 0;
|
||||
|
||||
mRanks[i].clear();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ namespace ESM
|
|||
// 'mFavouredSkill' to advance to this rank.
|
||||
int32_t mPrimarySkill, mFavouredSkill;
|
||||
|
||||
int32_t mFactReaction; // Reaction from faction members
|
||||
int32_t mFactReputation; // Required faction rep
|
||||
|
||||
void load(ESMReader& esm);
|
||||
void save(ESMWriter& esm) const;
|
||||
|
|
|
|||
|
|
@ -1220,7 +1220,8 @@
|
|||
-- @field #list<#number> attributeValues Attributes values required to get this rank.
|
||||
-- @field #number primarySkillValue Primary skill value required to get this rank.
|
||||
-- @field #number favouredSkillValue Secondary skill value required to get this rank.
|
||||
-- @field #number factionReaction Reaction of faction members if player is in this faction.
|
||||
-- @field #number factionReputation Required amount of faction reputation to reach this rank.
|
||||
-- @field #number factionReaction (DEPRECATED) Returns the same as factionReputation.
|
||||
|
||||
--- @{#MWScripts}: MWScripts
|
||||
-- @field [parent=#core] #MWScript mwscripts
|
||||
|
|
|
|||
Loading…
Reference in a new issue