91 lines
1.9 KiB
C++
91 lines
1.9 KiB
C++
#pragma once
|
|
#include "Core/Interface/Damageable.h"
|
|
#include "Core/Object/GameObject.h"
|
|
|
|
struct MonsterStatData;
|
|
struct ItemStatData;
|
|
|
|
struct MonsterStatData
|
|
{
|
|
MonsterStatData() :
|
|
HP(0),
|
|
Attack(0),
|
|
Defence(0),
|
|
DropItemPrice(0)
|
|
{
|
|
}
|
|
|
|
MonsterStatData(const std::string& Name, const std::string& DropItemName, const int HP, const int Attack, const int Defence, const int DropItemPrice) :
|
|
Name(Name),
|
|
DropItemName(DropItemName),
|
|
HP(HP),
|
|
Attack(Attack),
|
|
Defence(Defence),
|
|
DropItemPrice(DropItemPrice)
|
|
{
|
|
}
|
|
|
|
MonsterStatData(const MonsterStatData& Other) :
|
|
Name(Other.Name),
|
|
DropItemName(Other.DropItemName),
|
|
HP(Other.HP),
|
|
Attack(Other.Attack),
|
|
Defence(Other.Defence),
|
|
DropItemPrice(Other.DropItemPrice)
|
|
{
|
|
}
|
|
|
|
MonsterStatData(MonsterStatData&& Other) noexcept :
|
|
Name(std::move(Other.Name)),
|
|
DropItemName(std::move(Other.DropItemName)),
|
|
HP(Other.HP),
|
|
Attack(Other.Attack),
|
|
Defence(Other.Defence),
|
|
DropItemPrice(Other.DropItemPrice)
|
|
{
|
|
}
|
|
|
|
MonsterStatData& operator=(const MonsterStatData& Other)
|
|
{
|
|
(*this).Name = Other.Name;
|
|
(*this).DropItemName = Other.DropItemName;
|
|
(*this).HP = Other.HP;
|
|
(*this).Attack = Other.Attack;
|
|
(*this).Defence = Other.Defence;
|
|
(*this).DropItemPrice = Other.DropItemPrice;
|
|
return *this;
|
|
}
|
|
|
|
std::string Name;
|
|
std::string DropItemName;
|
|
int HP;
|
|
int Attack;
|
|
int Defence;
|
|
int DropItemPrice;
|
|
};
|
|
|
|
class Monster : public GameObject, public IDamageable
|
|
{
|
|
public:
|
|
Monster() = default;
|
|
Monster(MonsterStatData&& Desc);
|
|
~Monster() override;
|
|
|
|
virtual void Attack(class Player* Target);
|
|
virtual void Release();
|
|
void TakeDamage(int Amount) override;
|
|
bool IsDead() override;
|
|
void Reset() override;
|
|
|
|
std::string GetName() const;
|
|
std::string GetDropItemName() const;
|
|
int GetDropItemPrice() const;
|
|
int GetHP() const;
|
|
int GetAttack() const;
|
|
int GetDefence() const;
|
|
|
|
protected:
|
|
MonsterStatData MonsterData;
|
|
MonsterStatData OriginalData;
|
|
};
|