OpenFusion/src/Player.hpp
dongresource 0c8e209360 [WIP] Convert all chunk-related logic to the new system's semantics
Replaced all references to chunk->players and chunk->NPCs with
chunk->entities and all instances of the old NPCClass enum with
EntityType.

The server compiles but will not yet run properly.
2021-03-31 22:28:27 +02:00

101 lines
2.3 KiB
C++

#pragma once
#include <string>
#include <cstring>
#include "core/Core.hpp"
#include "Chunking.hpp"
#include "Entities.hpp"
#define ACTIVE_MISSION_COUNT 6
#define PC_MAXHEALTH(level) (925 + 75 * (level))
struct Player : public Entity {
int accountId;
int accountLevel; // permission level (see CN_ACCOUNT_LEVEL enums)
int64_t SerialKey;
int32_t iID;
uint64_t FEKey;
int level;
int HP;
int slot; // player slot, not nano slot
int16_t mentor;
int32_t money;
int32_t fusionmatter;
int32_t batteryW;
int32_t batteryN;
sPCStyle PCStyle;
sPCStyle2 PCStyle2;
sNano Nanos[NANO_COUNT]; // acquired nanos
int equippedNanos[3];
int activeNano; // active nano (index into Nanos)
int8_t iPCState;
int32_t iWarpLocationFlag;
int64_t aSkywayLocationFlag[2];
int32_t iConditionBitFlag;
int32_t iSelfConditionBitFlag;
int8_t iSpecialState;
//int x, y, z; in superclass
int angle;
int lastX, lastY, lastZ, lastAngle;
int recallX, recallY, recallZ, recallInstance; // also Lair entrances
//uint64_t instanceID; in superclass
sItemBase Equip[AEQUIP_COUNT];
sItemBase Inven[AINVEN_COUNT];
sItemBase Bank[ABANK_COUNT];
sItemTrade Trade[12];
int32_t moneyInTrade;
bool isTrading;
bool isTradeConfirm;
bool inCombat;
bool onMonkey;
int nanoDrainRate;
int healCooldown;
int pointDamage;
int groupDamage;
int fireRate;
int defense;
int64_t aQuestFlag[16];
int tasks[ACTIVE_MISSION_COUNT];
int RemainingNPCCount[ACTIVE_MISSION_COUNT][3];
sItemBase QInven[AQINVEN_COUNT];
int32_t CurrentMissionID;
sTimeLimitItemDeleteInfo2CL toRemoveVehicle;
int32_t iIDGroup;
int groupCnt;
int32_t groupIDs[4];
int32_t iGroupConditionBitFlag;
bool notify;
bool hidden;
bool unwarpable;
bool buddiesSynced;
int64_t buddyIDs[50];
bool isBuddyBlocked[50];
uint64_t iFirstUseFlag[2];
// in superclass:
//ChunkPos chunkPos;
//std::set<Chunk*> viewableChunks;
time_t lastHeartbeat;
int suspicionRating;
time_t lastShot;
std::vector<sItemBase> buyback;
Player() { type = EntityType::PLAYER; }
virtual void enterIntoViewOf(CNSocket *sock) override;
virtual void disappearFromViewOf(CNSocket *sock) override;
};