mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-15 19:19:55 +00:00
4b30a44816
Previously, all crime witnesses stopped being hostile to a respawning player for as long as the player's diedSinceArrestAttempt was true. That meant that, in an area with no guards to arrest the player, crime witnesses did not enage in combat with the player at all ever again until diedSinceArrestAttempt became false. This commit makes it so the time of the last crime is recorded for each witness, and that is then compared with the time of the LocalPlayer's last death for a one-time crime forgiveness during that player's current life. This is essentially a gameplay adjustment for "singleplayer with respawns," and will have to be reworked to make sense for every player in multiplayer, though that requires reworking the crime system as a whole and is thus on hold.
111 lines
3.5 KiB
C++
111 lines
3.5 KiB
C++
#ifndef OPENMW_LOCALPLAYER_HPP
|
|
#define OPENMW_LOCALPLAYER_HPP
|
|
|
|
#include <components/openmw-mp/Base/BasePlayer.hpp>
|
|
#include "../mwworld/ptr.hpp"
|
|
#include <RakNetTypes.h>
|
|
|
|
namespace mwmp
|
|
{
|
|
class Networking;
|
|
class LocalPlayer : public BasePlayer
|
|
{
|
|
public:
|
|
|
|
LocalPlayer();
|
|
virtual ~LocalPlayer();
|
|
|
|
time_t deathTime;
|
|
|
|
void update();
|
|
|
|
bool processCharGen();
|
|
bool hasFinishedCharGen();
|
|
|
|
void updateStatsDynamic(bool forceUpdate = false);
|
|
void updateAttributes(bool forceUpdate = false);
|
|
void updateSkills(bool forceUpdate = false);
|
|
void updateLevel(bool forceUpdate = false);
|
|
void updateBounty(bool forceUpdate = false);
|
|
void updateReputation(bool forceUpdate = false);
|
|
void updatePosition(bool forceUpdate = false);
|
|
void updateCell(bool forceUpdate = false);
|
|
void updateEquipment(bool forceUpdate = false);
|
|
void updateInventory(bool forceUpdate = false);
|
|
void updateAttack();
|
|
void updateAnimFlags(bool forceUpdate = false);
|
|
|
|
void addItems();
|
|
void addSpells();
|
|
void addJournalItems();
|
|
void addTopics();
|
|
|
|
void removeItems();
|
|
void removeSpells();
|
|
|
|
void resurrect();
|
|
|
|
void closeInventoryWindows();
|
|
|
|
void setCharacter();
|
|
void setDynamicStats();
|
|
void setAttributes();
|
|
void setSkills();
|
|
void setLevel();
|
|
void setBounty();
|
|
void setReputation();
|
|
void setPosition();
|
|
void setMomentum();
|
|
void setCell();
|
|
void setClass();
|
|
void setEquipment();
|
|
void setInventory();
|
|
void setSpellbook();
|
|
void setQuickKeys();
|
|
void setFactions();
|
|
void setKills();
|
|
void setBooks();
|
|
void setShapeshift();
|
|
void setMarkLocation();
|
|
void setSelectedSpell();
|
|
|
|
void sendClass();
|
|
void sendInventory();
|
|
void sendSpellbook();
|
|
void sendCellStates();
|
|
void sendSpellAddition(std::string id);
|
|
void sendSpellAddition(const ESM::Spell& spell);
|
|
void sendSpellRemoval(std::string id);
|
|
void sendSpellRemoval(const ESM::Spell& spell);
|
|
void sendQuickKey(unsigned short slot, int type, const std::string& itemId = "");
|
|
void sendJournalEntry(const std::string& quest, int index, const MWWorld::Ptr& actor);
|
|
void sendJournalIndex(const std::string& quest, int index);
|
|
void sendFactionRank(const std::string& factionId, int rank);
|
|
void sendFactionExpulsionState(const std::string& factionId, bool isExpelled);
|
|
void sendFactionReputation(const std::string& factionId, int reputation);
|
|
void sendTopic(const std::string& topic);
|
|
void sendKill(const std::string& refId, int number);
|
|
void sendBook(const std::string& bookId);
|
|
void sendScale(float newScale);
|
|
void sendWerewolfState(bool isWerewolf);
|
|
void sendMarkLocation(const ESM::Cell& newMarkCell, const ESM::Position& newMarkPosition);
|
|
void sendSelectedSpell(const std::string& newSelectedSpellId);
|
|
|
|
void clearCellStates();
|
|
void clearCurrentContainer();
|
|
|
|
void storeCellState(const ESM::Cell& cell, int stateType);
|
|
void storeCurrentContainer(const MWWorld::Ptr& container);
|
|
|
|
void playAnimation();
|
|
void playSpeech();
|
|
|
|
MWWorld::Ptr getPlayerPtr();
|
|
|
|
private:
|
|
Networking *getNetworking();
|
|
|
|
};
|
|
}
|
|
|
|
#endif //OPENMW_LOCALPLAYER_HPP
|