-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBar.h
58 lines (56 loc) · 971 Bytes
/
Bar.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
52
53
54
55
56
57
58
#pragma once
#include "GameObject.h"
#ifndef BAR_H_
#define BAR_H_
class Bar: public GameObject
{
public:
Bar(int barnumber1) :GameObject(0, 0, 0, 1, 0, 0,0, false)
{
maxbar = 0;
numnow = 0;
barnumber = barnumber1;
};
virtual void born()
{
SetSize(1.0);
SetAlive(true);
finishb = true;
}
virtual void action()
{
SetVarImg(1, numnow / maxbar);
};
virtual void Underattack(){};
virtual int TellType(){ return barnumber; };
virtual bool IsSkill(){ return false; };
virtual bool AfterBlur(){ return true; };
virtual bool NeedToDestroyWhenBossArrive(){ return false; };
inline void Link(int num, int max)
{
if (num <= max)
{
if (numnow < num)
numnow += (num - numnow) / 10;
if (numnow > num)
numnow -= (numnow - num) / 10;
maxbar = max;
}
else
{
numnow = max;
maxbar = max;
}
if (max == 0)
{
numnow = 0;
maxbar = 100;
}
};
~Bar();
private:
float numnow;
float maxbar;
int barnumber;
};
#endif