forked from YutaTachibana0310/SankouGoudou2019Summer
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBossRebarAttack.cpp
59 lines (49 loc) · 1.35 KB
/
BossRebarAttack.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
//=====================================
//
//ボス鉄筋アタック処理[BossRebarAttack.cpp]
//Author:GP12A332 21 立花雄太
//
//=====================================
#include "BossRebarAttack.h"
#include "BossEnemyActor.h"
/**************************************
マクロ定義
***************************************/
/**************************************
入場処理
***************************************/
void BossEnemyModel::BossRebarAttack::OnStart(BossEnemyModel* entity)
{
cntFrame = 0;
//アニメーション遷移
entity->actor->ChangeAnimation(BossEnemyActor::AnimID::Attack02);
}
/**************************************
更新処理
***************************************/
int BossEnemyModel::BossRebarAttack::OnUpdate(BossEnemyModel* entity)
{
const int RebarSetTime = 60;
const int RebarMoveDuration = 85;
const int RebarAttackTime = 200;
const int RebarThrowDuration = 180;
const int LoopTime = 210;
const int FinishTime[BossEnemyModel::Const::LevelMax] = { 300, 360, 420 };
cntFrame++;
int result = BossEnemyModel::State::RebarAttack;
if (cntFrame == RebarSetTime)
{
const int RebarNum[Const::LevelMax] = { 3, 6, 9 };
entity->SetRebar(RebarNum[entity->level]);
}
if (cntFrame == RebarAttackTime)
{
entity->ThrowRebar();
}
if (cntFrame == FinishTime[entity->level])
{
result = BossEnemyModel::State::Idle;
entity->cntLoop++;
}
return result;
}