forked from YutaTachibana0310/SankouGoudou2019Summer
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BossLargeDamage.cpp
49 lines (40 loc) · 1.17 KB
/
BossLargeDamage.cpp
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
//=====================================
//
//ボス大ダメージ処理[BossLargeDamage.cpp]
//Author:GP12A332 21 立花雄太
//
//=====================================
#include "BossLargeDamage.h"
#include "BossEnemyActor.h"
/**************************************
マクロ定義
***************************************/
/**************************************
入場処理
***************************************/
void BossEnemyModel::BossLargeDamage::OnStart(BossEnemyModel * entity)
{
cntFrame = 0;
entity->level++;
if (entity->level == BossEnemyModel::Const::LevelMax)
entity->ChangeState(BossEnemyModel::State::Defeat);
}
/**************************************
更新処理
***************************************/
int BossEnemyModel::BossLargeDamage::OnUpdate(BossEnemyModel * entity)
{
cntFrame++;
int result = BossEnemyModel::State::LargeDamage;
const int AnimationChangeTiming = 15;
const int FinishTiming = 150;
if (cntFrame == AnimationChangeTiming)
{
entity->actor->ChangeAnimation(BossEnemyActor::AnimID::LargeDamage);
}
if(cntFrame == FinishTiming)
{
result = RandomRange(0, 100) < 50 ? BossEnemyModel::State::HomingAttack : BossEnemyModel::State::RebarAttack;
}
return result;
}