-
Notifications
You must be signed in to change notification settings - Fork 0
/
Character.h
52 lines (42 loc) · 985 Bytes
/
Character.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once
#include "Obj.h"
class CCharacter :
public CObj
{
protected:
CCharacter();
CCharacter(const CCharacter& character);
virtual ~CCharacter() = 0;
protected:
CHARACTERINFO m_tInfo;
public:
CHARACTERINFO GetCharacterInfo() const
{
return m_tInfo;
}
void SetCharacterInfo(int iAtMin, int iAtMax, int iArMin, int iArMax,
int iHP, int iMP, int iLevel, int iExp);
virtual int GetDamage()
{
return rand() % (m_tInfo.iAttackMax - m_tInfo.iAttackMin + 1)
+ m_tInfo.iAttackMin;
}
virtual int GetArmor()
{
return rand() % (m_tInfo.iArmorMax - m_tInfo.iArmorMin + 1)
+ m_tInfo.iArmorMin;
}
bool Damage(int iDamage);
bool AddExp(int iExp);
bool CheckLevelUp();
void DropExp();
void FullHPMP();
void LevelUp();
void AddLevelUpStatus(const LEVELUPINFO& tInfo);
public:
virtual bool Init();
virtual void Render();
virtual CCharacter* Clone() = 0;
virtual void Save(class CFileStream* pFile);
virtual void Load(class CFileStream* pFile);
};