Skip to content

Commit a4c2992

Browse files
author
Chun-Yi
committed
Merge pull request #15 from wingzero0/master
修正血條,也把debug message去掉
2 parents d44918a + 149155b commit a4c2992

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

AIControl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ int AIControl::AddNPC(ACTORid npc, char * ActionFilename){
2424
ActorStateMachine* stm = new ActorStateMachine(npc, ActionFilename);
2525
this->npcStateMachineList.push_back(stm);
2626
stm->life = 10;
27+
stm->UpdateLifeBillboard();
2728
return 0;
2829
}
2930

ActorStateMachine.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ BOOL ActorStateMachine::UpdateEffectiveAttack(){
348348
actor.Object(this->character);
349349
float frame = actor.QueryCurrentFrame(0);
350350
//sprintf(debug, "%s frame:%lf\n", debug, frame );
351-
if (frame > 10.0){
351+
if (frame > 15.0){
352352
this->effectiveAttack = TRUE;
353353
}
354354
/*
@@ -410,12 +410,12 @@ int ActorStateMachine::AttackEnemy(float enemyPos[3], SHOT_CODE *shot_code){
410410

411411
if (this->currentAttackIndex == 0){
412412
if (cosine > 0.8){ // normal or heavy attack, only attack the front side enemy
413-
sprintf(debug, "%s attack power = %d\n",debug,1);
413+
//sprintf(debug, "%s attack power = %d\n",debug,1);
414414
return 1;
415415
}
416416
}else if (this->currentAttackIndex <= 3){
417417
if (cosine >= 0.0){
418-
sprintf(debug, "%s attack power = %d\n",debug,2);
418+
//sprintf(debug, "%s attack power = %d\n",debug,2);
419419
return 3;
420420
}
421421
}
@@ -466,7 +466,10 @@ void ActorStateMachine::TakeDamage(int damage, SHOT_CODE shot_code, float *attac
466466
}else {
467467
this->ChangeState(STATEDAMAGE, TRUE);
468468
}
469+
this->UpdateLifeBillboard();
470+
}
469471

472+
void ActorStateMachine::UpdateLifeBillboard(){
470473
FnBillBoard blood;
471474
blood.Object(bloodID, 0);
472475
float size[2];

ActorStateMachine.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,6 @@ class ActorStateMachine
7474
BOOL CheckEffectiveAttack();
7575
virtual int AttackEnemy(float enemyPos[3], SHOT_CODE *shot_code = NULL); // shot_code will be assgin a value after the call
7676
virtual void TakeDamage(int damage, SHOT_CODE shot_code, float* attackerPos);
77+
void UpdateLifeBillboard(); // billboard
7778
};
7879

LyubuStateMachine.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ int LyubuStateMachine::AttackEnemy(float enemyPos[3], SHOT_CODE *shot_code){
187187
if (this->attackKeyQueue[currentAttackIndex] == ULTIMATE_ATT){
188188
if (frame > 100){ // almost finish attack
189189
*shot_code = BIG_SHOT;
190-
sprintf(debug, "%s attack power = %d\n",debug,10);
190+
//sprintf(debug, "%s attack power = %d\n",debug,10);
191191
return 10;
192192
}
193193
*shot_code = STUCK_SHOT;
@@ -199,12 +199,12 @@ int LyubuStateMachine::AttackEnemy(float enemyPos[3], SHOT_CODE *shot_code){
199199
}
200200
}else if (this->currentAttackIndex <= 2){
201201
if (cosine >= 0.0){
202-
sprintf(debug, "%s attack power = %d\n",debug,2);
202+
//sprintf(debug, "%s attack power = %d\n",debug,2);
203203
return 2;
204204
}
205205
}else if (this->currentAttackIndex <= 3){
206206
if (cosine >= -1.0){
207-
sprintf(debug, "%s attack power = %d\n",debug,2);
207+
//sprintf(debug, "%s attack power = %d\n",debug,2);
208208
return 3;
209209
}
210210
}

Main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,7 @@ void Render(int skip){
528528
vp.Render(cID, TRUE, TRUE);
529529
PlayAction(skip);
530530
GetPosDetail(loopBuff);
531+
debug[0] = '\0';
531532
debug_message(debug,loopBuff);
532533
FnWorld gw;
533534
gw.Object(gID);

0 commit comments

Comments
 (0)