mirror of https://github.com/OpenMW/openmw.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
1.8 KiB
C++
75 lines
1.8 KiB
C++
12 years ago
|
#ifndef OPENMW_ESM_FACT_H
|
||
|
#define OPENMW_ESM_FACT_H
|
||
15 years ago
|
|
||
12 years ago
|
#include <string>
|
||
11 years ago
|
#include <map>
|
||
12 years ago
|
|
||
14 years ago
|
namespace ESM
|
||
|
{
|
||
15 years ago
|
|
||
12 years ago
|
class ESMReader;
|
||
|
class ESMWriter;
|
||
|
|
||
15 years ago
|
/*
|
||
|
* Faction definitions
|
||
|
*/
|
||
|
|
||
|
// Requirements for each rank
|
||
|
struct RankData
|
||
|
{
|
||
12 years ago
|
int mAttribute1, mAttribute2; // Attribute level
|
||
15 years ago
|
|
||
5 years ago
|
// Skill level (faction skills given in
|
||
14 years ago
|
// skillID below.) You need one skill at
|
||
5 years ago
|
// level 'mPrimarySkill' and two skills at level
|
||
|
// 'mFavouredSkill' to advance to this rank.
|
||
|
int mPrimarySkill, mFavouredSkill;
|
||
15 years ago
|
|
||
12 years ago
|
int mFactReaction; // Reaction from faction members
|
||
15 years ago
|
};
|
||
|
|
||
12 years ago
|
struct Faction
|
||
15 years ago
|
{
|
||
11 years ago
|
static unsigned int sRecordId;
|
||
10 years ago
|
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
|
||
3 years ago
|
static std::string_view getRecordType() { return "Faction"; }
|
||
11 years ago
|
|
||
3 years ago
|
unsigned int mRecordFlags;
|
||
12 years ago
|
std::string mId, mName;
|
||
15 years ago
|
|
||
14 years ago
|
struct FADTstruct
|
||
|
{
|
||
|
// Which attributes we like
|
||
12 years ago
|
int mAttribute[2];
|
||
15 years ago
|
|
||
12 years ago
|
RankData mRankData[10];
|
||
15 years ago
|
|
||
11 years ago
|
int mSkills[7]; // IDs of skills this faction require
|
||
|
// Each element will either contain an ESM::Skill index, or -1.
|
||
|
|
||
12 years ago
|
int mIsHidden; // 1 - hidden from player
|
||
12 years ago
|
|
||
|
int& getSkill (int index, bool ignored = false);
|
||
|
///< Throws an exception for invalid values of \a index.
|
||
|
|
||
|
int getSkill (int index, bool ignored = false) const;
|
||
|
///< Throws an exception for invalid values of \a index.
|
||
14 years ago
|
}; // 240 bytes
|
||
15 years ago
|
|
||
12 years ago
|
FADTstruct mData;
|
||
15 years ago
|
|
||
11 years ago
|
// <Faction ID, Reaction>
|
||
|
std::map<std::string, int> mReactions;
|
||
15 years ago
|
|
||
14 years ago
|
// Name of faction ranks (may be empty for NPC factions)
|
||
12 years ago
|
std::string mRanks[10];
|
||
15 years ago
|
|
||
10 years ago
|
void load(ESMReader &esm, bool &isDeleted);
|
||
|
void save(ESMWriter &esm, bool isDeleted = false) const;
|
||
12 years ago
|
|
||
|
void blank();
|
||
|
///< Set record to default state (does not touch the ID/index).
|
||
15 years ago
|
};
|
||
|
}
|
||
|
#endif
|