Rehti MMORPG  1.0.0
Rehti MMORPG is a free and open source MMORPG game.
PassiveNpc.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
5 #include "Npc.hpp"
6 
7 class PlayerCharacter;
8 
12 class PassiveNpc : public Npc
13 {
14 
15 public:
16  PassiveNpc(GameWorld* pGameWorld, std::string name, int baseDamage, int baseAccuracy, SpawnCoordinateBounds spawnCoordinateBounds, std::vector<std::string> chatResponses,
17  unsigned int id = 0, Coordinates location = Coordinates());
18 
19  ~PassiveNpc() = default;
20 
26  void update() override;
27 
28 private:
34  std::shared_ptr<PlayerCharacter> findAttackingPlayer();
35 };
GameWorld class. It contains all the player, npc, object and item instances.
Definition: GameWorld.hpp:16
Base NPC class. It represents a peaceful NPC that does not attack the player under any circumstances.
Definition: Npc.hpp:11
PassiveNpc is a type of Npc that attacks only if provoked.
Definition: PassiveNpc.hpp:13
void update() override
Updates the PassiveNpc.
Definition: PassiveNpc.cpp:22
std::shared_ptr< PlayerCharacter > findAttackingPlayer()
Finds out if there is a player attacking the PassiveNpc.
Definition: PassiveNpc.cpp:47
PassiveNpc(GameWorld *pGameWorld, std::string name, int baseDamage, int baseAccuracy, SpawnCoordinateBounds spawnCoordinateBounds, std::vector< std::string > chatResponses, unsigned int id=0, Coordinates location=Coordinates())
Definition: PassiveNpc.cpp:4
~PassiveNpc()=default
Class for a human player character.
Definition: PlayerCharacter.hpp:12
Struct for coordinates.
Definition: Coordinates.hpp:7
Contains the spawn coordinate bounds for a character.
Definition: CharacterReader.hpp:10