forked from YutaTachibana0310/SankouGoudou2019Summer
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BossHomingAttack.cpp
64 lines (54 loc) · 1.39 KB
/
BossHomingAttack.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//=====================================
//
//ボスホーミングアタック処理[BossHomingAttack.cpp]
//Author:GP12A332 21 立花雄太
//
//=====================================
#include "BossHomingAttack.h"
#include "BossEnemyActor.h"
/**************************************
マクロ定義
***************************************/
/**************************************
入場処理
***************************************/
void BossEnemyModel::BossHomingAttack::OnStart(BossEnemyModel *entity)
{
cntFrame = 0;
//アニメーション遷移
entity->actor->ChangeAnimation(BossEnemyActor::AnimID::Attack01);
//バレットチャージ開始
entity->StartBulletCharge();
}
/**************************************
更新処理
***************************************/
int BossEnemyModel::BossHomingAttack::OnUpdate(BossEnemyModel* entity)
{
cntFrame++;
const int LoopMax[BossEnemyModel::Const::LevelMax] = { 2, 3, 4 };
const int NotifyTiming = 90;
const int FireTiming = 120;
const int LoopTiming = 150;
const int FinishTiming = 300;
int result = BossEnemyModel::State::HomingAttack;
if (cntFrame == NotifyTiming)
{
entity->NotifyBullet();
}
if (cntFrame == FireTiming)
{
entity->FireBullet();
}
if (cntFrame == LoopTiming && entity->cntAttack < LoopMax[entity->level])
{
entity->cntAttack++;
OnStart(entity);
}
if (cntFrame == FinishTiming)
{
entity->cntLoop++;
result = BossEnemyModel::State::Idle;
}
return result;
}