2011-01-04 15:58:22 +01:00
|
|
|
#ifndef GAME_MWWORLD_PLAYER_H
|
|
|
|
#define GAME_MWWORLD_PLAYER_H
|
2010-06-21 23:39:59 +02:00
|
|
|
|
2018-03-09 08:56:04 +04:00
|
|
|
#include <map>
|
|
|
|
|
2013-04-04 11:23:17 +02:00
|
|
|
#include "../mwworld/livecellref.hpp"
|
2010-07-05 12:09:04 +02:00
|
|
|
|
2012-04-08 12:25:33 +02:00
|
|
|
#include "../mwmechanics/drawstate.hpp"
|
2015-06-21 17:27:52 +02:00
|
|
|
|
|
|
|
#include <components/esm/attr.hpp>
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
|
|
|
#include <components/esm/refid.hpp>
|
2022-01-22 15:58:41 +01:00
|
|
|
#include <components/esm3/loadnpc.hpp>
|
|
|
|
#include <components/esm3/loadskil.hpp>
|
2012-04-08 12:25:33 +02:00
|
|
|
|
2013-04-04 11:23:17 +02:00
|
|
|
namespace ESM
|
|
|
|
{
|
2014-01-16 12:03:23 +01:00
|
|
|
class ESMWriter;
|
|
|
|
class ESMReader;
|
2013-04-04 11:23:17 +02:00
|
|
|
}
|
|
|
|
|
2014-04-28 11:29:57 +02:00
|
|
|
namespace Loading
|
|
|
|
{
|
|
|
|
class Listener;
|
|
|
|
}
|
|
|
|
|
2011-01-04 15:58:22 +01:00
|
|
|
namespace MWWorld
|
2010-06-21 23:39:59 +02:00
|
|
|
{
|
2012-07-03 13:55:53 +02:00
|
|
|
class CellStore;
|
2019-03-03 14:58:03 +03:00
|
|
|
class ConstPtr;
|
2012-07-03 13:55:53 +02:00
|
|
|
|
2011-01-08 15:11:37 +01:00
|
|
|
/// \brief NPC object representing the player and additional player data
|
2012-06-29 16:48:50 +02:00
|
|
|
class Player
|
2010-07-26 12:59:50 +02:00
|
|
|
{
|
2012-11-08 01:36:43 +04:00
|
|
|
LiveCellRef<ESM::NPC> mPlayer;
|
|
|
|
MWWorld::CellStore* mCellStore;
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
|
|
|
ESM::RefId mSign;
|
2012-11-08 01:36:43 +04:00
|
|
|
|
2015-06-03 19:41:19 +02:00
|
|
|
osg::Vec3f mLastKnownExteriorPosition;
|
2014-01-01 00:12:31 +01:00
|
|
|
|
2014-01-01 17:06:21 +01:00
|
|
|
ESM::Position mMarkedPosition;
|
2018-10-09 10:21:12 +04:00
|
|
|
// If no position was marked, this is nullptr
|
2014-01-01 17:06:21 +01:00
|
|
|
CellStore* mMarkedCell;
|
|
|
|
|
2013-12-31 20:40:23 +01:00
|
|
|
bool mTeleported;
|
2014-04-05 10:26:14 -04:00
|
|
|
|
|
|
|
int mCurrentCrimeId; // the id assigned witnesses
|
2014-05-03 12:23:22 +02:00
|
|
|
int mPaidCrimeId; // the last id paid off (0 bounty)
|
2014-04-24 22:47:45 -04:00
|
|
|
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
|
|
|
typedef std::map<ESM::RefId, ESM::RefId> PreviousItems; // previous equipped items, needed for bound spells
|
2018-03-09 08:56:04 +04:00
|
|
|
PreviousItems mPreviousItems;
|
|
|
|
|
2018-03-30 14:05:36 +03:00
|
|
|
// Saved stats prior to becoming a werewolf
|
2021-12-27 00:47:33 +01:00
|
|
|
float mSaveSkills[ESM::Skill::Length];
|
|
|
|
float mSaveAttributes[ESM::Attribute::Length];
|
2015-06-21 17:27:52 +02:00
|
|
|
|
2018-09-15 19:38:21 +04:00
|
|
|
bool mJumping;
|
2015-07-02 19:14:28 +02:00
|
|
|
|
2011-01-06 10:07:01 +01:00
|
|
|
public:
|
2015-07-02 18:11:24 +02:00
|
|
|
Player(const ESM::NPC* player);
|
2010-06-21 23:39:59 +02:00
|
|
|
|
2018-03-30 14:05:36 +03:00
|
|
|
void saveStats();
|
|
|
|
void restoreStats();
|
|
|
|
void setWerewolfStats();
|
2015-06-21 17:27:52 +02:00
|
|
|
|
2014-01-01 17:06:21 +01:00
|
|
|
// For mark/recall magic effects
|
2017-04-20 20:36:14 +09:00
|
|
|
void markPosition(CellStore* markedCell, const ESM::Position& markedPosition);
|
2014-01-01 17:06:21 +01:00
|
|
|
void getMarkedPosition(CellStore*& markedCell, ESM::Position& markedPosition) const;
|
|
|
|
|
2014-01-01 00:12:31 +01:00
|
|
|
/// Interiors can not always be mapped to a world position. However
|
|
|
|
/// world position is still required for divine / almsivi magic effects
|
|
|
|
/// and the player arrow on the global map.
|
2015-06-03 19:41:19 +02:00
|
|
|
void setLastKnownExteriorPosition(const osg::Vec3f& position) { mLastKnownExteriorPosition = position; }
|
|
|
|
osg::Vec3f getLastKnownExteriorPosition() const { return mLastKnownExteriorPosition; }
|
2014-01-01 00:12:31 +01:00
|
|
|
|
2013-05-15 17:54:18 +02:00
|
|
|
void set(const ESM::NPC* player);
|
|
|
|
|
2013-04-04 11:23:17 +02:00
|
|
|
void setCell(MWWorld::CellStore* cellStore);
|
2010-06-21 23:39:59 +02:00
|
|
|
|
2013-04-04 11:23:17 +02:00
|
|
|
MWWorld::Ptr getPlayer();
|
2019-03-03 14:58:03 +03:00
|
|
|
MWWorld::ConstPtr getConstPlayer() const;
|
2010-09-15 12:22:06 +02:00
|
|
|
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
|
|
|
void setBirthSign(const ESM::RefId& sign);
|
|
|
|
const ESM::RefId& getBirthSign() const;
|
2012-11-08 18:50:18 +04:00
|
|
|
|
2022-07-17 19:36:48 +03:00
|
|
|
void setDrawState(MWMechanics::DrawState state);
|
|
|
|
MWMechanics::DrawState getDrawState(); /// \todo constness
|
2012-04-08 12:25:33 +02:00
|
|
|
|
2015-11-14 02:43:24 +01:00
|
|
|
/// Activate the object under the crosshair, if any
|
|
|
|
void activate();
|
|
|
|
|
2013-06-12 16:07:46 +02:00
|
|
|
void yaw(float yaw);
|
|
|
|
void pitch(float pitch);
|
|
|
|
void roll(float roll);
|
2013-12-31 20:40:23 +01:00
|
|
|
|
|
|
|
bool wasTeleported() const;
|
|
|
|
void setTeleported(bool teleported);
|
2014-01-11 15:34:32 +01:00
|
|
|
|
2018-09-15 19:38:21 +04:00
|
|
|
void setJumping(bool jumping);
|
|
|
|
bool getJumping() const;
|
|
|
|
|
2014-04-27 20:54:22 -04:00
|
|
|
/// Checks all nearby actors to see if anyone has an aipackage against you
|
2014-04-24 22:47:45 -04:00
|
|
|
bool isInCombat();
|
|
|
|
|
2016-06-07 01:53:16 +02:00
|
|
|
bool enemiesNearby();
|
|
|
|
|
2014-01-11 15:34:32 +01:00
|
|
|
void clear();
|
2014-01-16 12:03:23 +01:00
|
|
|
|
2014-04-28 11:29:57 +02:00
|
|
|
void write(ESM::ESMWriter& writer, Loading::Listener& progress) const;
|
2014-01-16 12:03:23 +01:00
|
|
|
|
2015-01-22 19:04:59 +01:00
|
|
|
bool readRecord(ESM::ESMReader& reader, uint32_t type);
|
2014-04-05 10:26:14 -04:00
|
|
|
|
|
|
|
int getNewCrimeId(); // get new id for witnesses
|
2014-05-03 12:23:22 +02:00
|
|
|
void recordCrimeId(); // record the paid crime id when bounty is 0
|
|
|
|
int getCrimeId() const; // get the last paid crime id
|
2018-03-09 08:56:04 +04:00
|
|
|
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
|
|
|
void setPreviousItem(const ESM::RefId& boundItemId, const ESM::RefId& previousItemId);
|
|
|
|
ESM::RefId getPreviousItem(const ESM::RefId& boundItemId);
|
|
|
|
void erasePreviousItem(const ESM::RefId& boundItemId);
|
2020-01-09 13:55:14 +03:00
|
|
|
|
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type
The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID
Slowly going through all the changes to make, still hundreds of errors
a lot of functions/structures use std::string or stringview to designate an ID. So it takes time
Continues slowly replacing ids. There are technically more and more compilation errors
I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type
Continue moving forward, changes to the stores
slowly moving along
Starting to see the fruit of those changes.
still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type.
More replacements. Things are starting to get easier
I can see more and more often the issue is that the function is awaiting a RefId, but is given a string
there is less need to go down functions and to fix a long list of them.
Still moving forward, and for the first time error count is going down!
Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably
Cells are back to using string for the name, haven't fixed everything yet. Many other changes
Under the bar of 400 compilation errors.
more good progress <100 compile errors!
More progress
Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string
some more progress on other fronts
Mostly game settings clean
one error opened a lot of other errors. Down to 18, but more will prbably appear
only link errors left??
Fixed link errors
OpenMW compiles, and launches, with some issues, but still!
2022-09-25 13:17:09 +02:00
|
|
|
void setSelectedSpell(const ESM::RefId& spellId);
|
2022-05-05 00:57:15 +03:00
|
|
|
|
|
|
|
void update();
|
2011-01-18 15:20:36 +01:00
|
|
|
};
|
2010-06-21 23:39:59 +02:00
|
|
|
}
|
|
|
|
#endif
|