Rehti MMORPG  1.0.0
Rehti MMORPG is a free and open source MMORPG game.
PlayerCharacter.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
5 #include "../skill/SkillSet.hpp"
6 #include "Entity.hpp"
7 
11 class PlayerCharacter : public Entity
12 {
13 public:
14  PlayerCharacter(GameWorld* pGameWorld, std::string name, int baseDamage, int baseAccuracy, SpawnCoordinateBounds spawnCoordinateBounds, unsigned int id = 0, Coordinates location = Coordinates());
15 
16  ~PlayerCharacter() = default;
17 
21  void update();
22 
26  void respawn();
27 
32  void attack(Entity& target) override;
33 };
Base pure virtual Entity class. Different types of enities inherit this.
Definition: Entity.hpp:17
GameWorld class. It contains all the player, npc, object and item instances.
Definition: GameWorld.hpp:16
Class for a human player character.
Definition: PlayerCharacter.hpp:12
PlayerCharacter(GameWorld *pGameWorld, std::string name, int baseDamage, int baseAccuracy, SpawnCoordinateBounds spawnCoordinateBounds, unsigned int id=0, Coordinates location=Coordinates())
Definition: PlayerCharacter.cpp:5
void attack(Entity &target) override
Performs player's attack on target entity. Calculates hit chance and damage, and on succesful hit app...
Definition: PlayerCharacter.cpp:51
void respawn()
Function that drops player's items and sets an active RespawnAction. Called when player dies.
Definition: PlayerCharacter.cpp:34
void update()
Calls act() function for player's current action, if the player has one. Update is called when server...
Definition: PlayerCharacter.cpp:25
~PlayerCharacter()=default
Struct for coordinates.
Definition: Coordinates.hpp:7
Contains the spawn coordinate bounds for a character.
Definition: CharacterReader.hpp:10