[Scummvm-git-logs] scummvm master -> 3e66ccbe4ba3dc4750e604cca7a3105843056bb1
Strangerke
noreply at scummvm.org
Sat Jan 18 19:14:55 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
3e66ccbe4b GOT: small refactoring, renaming in boss1 and boss2
Commit: 3e66ccbe4ba3dc4750e604cca7a3105843056bb1
https://github.com/scummvm/scummvm/commit/3e66ccbe4ba3dc4750e604cca7a3105843056bb1
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2025-01-18T20:14:13+01:00
Commit Message:
GOT: small refactoring, renaming in boss1 and boss2
Changed paths:
engines/got/game/back.cpp
engines/got/game/back.h
engines/got/game/boss1.cpp
engines/got/game/boss1.h
engines/got/game/boss2.cpp
engines/got/game/boss2.h
engines/got/game/move_patterns.cpp
engines/got/views/game.cpp
engines/got/views/game_content.cpp
diff --git a/engines/got/game/back.cpp b/engines/got/game/back.cpp
index bd86703b7c1..ed4ece6ad98 100644
--- a/engines/got/game/back.cpp
+++ b/engines/got/game/back.cpp
@@ -146,14 +146,14 @@ void showLevelDone() {
if (GAME1 && _G(new_level) == BOSS_LEVEL1) {
if (!_G(setup)._bossDead[0]) {
if (!_G(auto_load))
- boss_level1();
+ boss1SetupLevel();
f = false;
}
}
if (GAME2 && _G(new_level) == BOSS_LEVEL2) {
if (!_G(setup)._bossDead[1]) {
if (!_G(auto_load))
- boss_level2();
+ boss2SetupLevel();
f = false;
}
}
@@ -173,6 +173,7 @@ void showLevelDone() {
if (_G(startup))
f = false;
+
if (f)
music_play(_G(levelMusic), false);
}
@@ -306,13 +307,13 @@ void selectItem() {
}
}
-int actorSpeaks(Actor *actor, int index, int item) {
+void actorSpeaks(const Actor *actor, int index, int item) {
if (actor->_type != 4)
- return 0;
+ return;
int v = atoi(actor->_name);
if (v < 1 || v > 20)
- return 0;
+ return;
long lind = (long)_G(current_level);
lind = lind * 1000;
@@ -330,8 +331,6 @@ int actorSpeaks(Actor *actor, int index, int item) {
_G(thor)->_show = 0;
_G(exit_flag) = 2;
}
-
- return 1;
}
} // namespace Got
diff --git a/engines/got/game/back.h b/engines/got/game/back.h
index 00674f45c5b..773698bf536 100644
--- a/engines/got/game/back.h
+++ b/engines/got/game/back.h
@@ -45,7 +45,7 @@ extern void removeObjects(int y, int x);
extern void placeTile(int x, int y, int tile);
extern int backgroundTile(int x, int y);
extern void selectItem();
-extern int actorSpeaks(Actor *actor, int index, int item);
+extern void actorSpeaks(const Actor *actor, int index, int item);
} // namespace Got
diff --git a/engines/got/game/boss1.cpp b/engines/got/game/boss1.cpp
index 509e840da47..643a3607869 100644
--- a/engines/got/game/boss1.cpp
+++ b/engines/got/game/boss1.cpp
@@ -34,84 +34,82 @@ namespace Got {
static int boss1_dead();
-int boss1_movement(Actor *actr) {
- int x1, y1;
-
+int boss1Movement(Actor *actor) {
bool f = false;
if (_G(boss_dead))
return boss1_dead();
- int d = actr->_lastDir;
- if (actr->_edgeCounter) {
- actr->_edgeCounter--;
+ int d = actor->_lastDir;
+ int x1 = actor->_x;
+ int y1 = actor->_y;
+
+ if (actor->_edgeCounter) {
+ actor->_edgeCounter--;
goto done;
}
- x1 = actr->_x;
- y1 = actr->_y;
-
- if (overlap(actr->_x + 2, actr->_y + 8, actr->_x + 30, actr->_y + 30,
+ if (overlap(actor->_x + 2, actor->_y + 8, actor->_x + 30, actor->_y + 30,
_G(thor)->_x, _G(thor)->_y + 8, _G(thor)->_x + 15, _G(thor)->_y + 15)) {
- thor_damaged(actr);
+ thor_damaged(actor);
}
- if (actr->_temp3) { //start striking
- actr->_temp3--;
- if (!actr->_temp3)
+ if (actor->_temp3) { //start striking
+ actor->_temp3--;
+ if (!actor->_temp3)
play_sound(BOSS11, false);
if (_G(hourglass_flag))
- actr->_numMoves = 3;
+ actor->_numMoves = 3;
else
- actr->_numMoves = 6;
+ actor->_numMoves = 6;
goto done0;
}
// Strike
- if (actr->_temp1) {
- actr->_temp1--;
- if (actr->_x < (_G(thor_x1) + 12))
- actr->_temp1 = 0;
- actr->_temp2 = 1;
+ if (actor->_temp1) {
+ actor->_temp1--;
+ if (actor->_x < (_G(thor_x1) + 12))
+ actor->_temp1 = 0;
+ actor->_temp2 = 1;
d = 2;
- actr->_x -= 2;
+ actor->_x -= 2;
- if (overlap(actr->_x + 2, actr->_y + 8, actr->_x + 32, actr->_y + 30,
+ if (overlap(actor->_x + 2, actor->_y + 8, actor->_x + 32, actor->_y + 30,
_G(thor)->_x, _G(thor)->_y + 8, _G(thor)->_x + 15, _G(thor)->_y + 15)) {
- actr->_temp1 = 0;
+ actor->_temp1 = 0;
goto done1;
}
- actr->_nextFrame = 3;
- actr->_numMoves = _G(setup)._difficultyLevel + 2;
+ actor->_nextFrame = 3;
+ actor->_numMoves = _G(setup)._difficultyLevel + 2;
goto done1;
}
- if (actr->_temp2) { // Retreating
- if (actr->_x < 256) {
+ if (actor->_temp2) { // Retreating
+ if (actor->_x < 256) {
d = 3;
- actr->_x += 2;
- if (overlap(actr->_x + 2, actr->_y + 8, actr->_x + 32, actr->_y + 30,
+ actor->_x += 2;
+ if (overlap(actor->_x + 2, actor->_y + 8, actor->_x + 32, actor->_y + 30,
_G(thor)->_x, _G(thor)->_y + 8, _G(thor)->_x + 15, _G(thor)->_y + 15)) {
goto done1;
}
- actr->_numMoves = _G(setup)._difficultyLevel + 1;
+ actor->_numMoves = _G(setup)._difficultyLevel + 1;
goto done0;
}
- actr->_temp2 = 0;
+ actor->_temp2 = 0;
}
- if (actr->_x > _G(thor_x1) && ABS((_G(thor_y1)) - (actr->_y + 20)) < 8) {
- actr->_temp3 = 75;
- actr->_temp1 = 130;
- actr->_temp2 = 0;
+ if (actor->_x > _G(thor_x1) && ABS((_G(thor_y1)) - (actor->_y + 20)) < 8) {
+ actor->_temp3 = 75;
+ actor->_temp1 = 130;
+ actor->_temp2 = 0;
}
- if (actr->_counter) {
- actr->_counter--;
+ if (actor->_counter) {
+ actor->_counter--;
switch (d) {
case 1:
case 3:
@@ -122,14 +120,14 @@ int boss1_movement(Actor *actr) {
if (!check_move2(x1, y1, &_G(actor[5])))
f = true;
else {
- actr->_x = _G(actor[5])._x;
- actr->_y = _G(actor[5])._y - 16;
+ actor->_x = _G(actor[5])._x;
+ actor->_y = _G(actor[5])._y - 16;
}
break;
case 0:
case 2:
y1 -= 2;
- if (!check_move2(x1, y1, actr))
+ if (!check_move2(x1, y1, actor))
f = true;
break;
@@ -140,9 +138,9 @@ int boss1_movement(Actor *actr) {
f = true;
if (f) {
- actr->_counter = g_events->getRandomNumber(10, 99);
+ actor->_counter = g_events->getRandomNumber(10, 99);
d = g_events->getRandomNumber(1);
- actr->_edgeCounter = 20;
+ actor->_edgeCounter = 20;
}
done:
@@ -150,40 +148,40 @@ done:
d -= 2;
done0:
- next_frame(actr);
- if (actr->_nextFrame == 3)
- actr->_nextFrame = 0;
+ next_frame(actor);
+ if (actor->_nextFrame == 3)
+ actor->_nextFrame = 0;
done1:
- actr->_lastDir = d;
+ actor->_lastDir = d;
- _G(actor[4])._nextFrame = actr->_nextFrame;
- _G(actor[5])._nextFrame = actr->_nextFrame;
- _G(actor[6])._nextFrame = actr->_nextFrame;
+ _G(actor[4])._nextFrame = actor->_nextFrame;
+ _G(actor[5])._nextFrame = actor->_nextFrame;
+ _G(actor[6])._nextFrame = actor->_nextFrame;
_G(actor[4])._lastDir = d;
_G(actor[5])._lastDir = d;
_G(actor[6])._lastDir = d;
- _G(actor[4])._x = actr->_x + 16;
- _G(actor[4])._y = actr->_y;
- _G(actor[5])._x = actr->_x;
- _G(actor[5])._y = actr->_y + 16;
- _G(actor[6])._x = actr->_x + 16;
- _G(actor[6])._y = actr->_y + 16;
- _G(actor[4])._numMoves = actr->_numMoves;
- _G(actor[5])._numMoves = actr->_numMoves;
- _G(actor[6])._numMoves = actr->_numMoves;
-
- if (actr->_directions == 1)
+ _G(actor[4])._x = actor->_x + 16;
+ _G(actor[4])._y = actor->_y;
+ _G(actor[5])._x = actor->_x;
+ _G(actor[5])._y = actor->_y + 16;
+ _G(actor[6])._x = actor->_x + 16;
+ _G(actor[6])._y = actor->_y + 16;
+ _G(actor[4])._numMoves = actor->_numMoves;
+ _G(actor[5])._numMoves = actor->_numMoves;
+ _G(actor[6])._numMoves = actor->_numMoves;
+
+ if (actor->_directions == 1)
return 0;
return d;
}
-void check_boss1_hit(Actor *actr, int x1, int y1, int x2, int y2, int act_num) {
- if (actr->_moveType == 15 && act_num == 4) {
+void boss1CheckHit(const Actor *actor, int x1, int y1, int x2, int y2, int act_num) {
+ if (actor->_moveType == 15 && act_num == 4) {
if ((!_G(actor[3])._vulnerableCountdown) && (_G(actor[3])._nextFrame != 3) &&
- overlap(x1, y1, x2, y2, actr->_x + 6, actr->_y + 4, actr->_x + 14, actr->_y + 20)) {
+ overlap(x1, y1, x2, y2, actor->_x + 6, actor->_y + 4, actor->_x + 14, actor->_y + 20)) {
actor_damaged(&_G(actor[3]), _G(hammer)->_hitStrength);
if (_G(cheat) && _G(key_flag[_Z]))
_G(actor[3])._health = 0;
@@ -206,7 +204,7 @@ void check_boss1_hit(Actor *actr, int x1, int y1, int x2, int y2, int act_num) {
}
}
-void boss_level1() {
+void boss1SetupLevel() {
setup_boss(1);
_G(boss_active) = true;
music_pause();
@@ -218,9 +216,7 @@ void boss_level1() {
static int boss1_dead() {
_G(hourglass_flag) = 0;
if (_G(boss_dead)) {
- int rep;
-
- for (rep = 0; rep < 4; rep++) {
+ for (int rep = 0; rep < 4; rep++) {
int x1 = _G(actor[3 + rep])._lastX[_G(pge)];
int y1 = _G(actor[3 + rep])._lastY[_G(pge)];
int x = _G(actor[3 + rep])._x;
@@ -248,7 +244,7 @@ static int boss1_dead() {
play_sound(EXPLODE, true);
_G(boss_dead) = true;
- for (rep = 7; rep < MAX_ACTORS; rep++) {
+ for (int rep = 7; rep < MAX_ACTORS; rep++) {
if (_G(actor[rep])._active)
actor_destroyed(&_G(actor[rep]));
}
@@ -257,13 +253,13 @@ static int boss1_dead() {
return _G(actor[3])._lastDir;
}
-void closing_sequence1() {
+void boss1ClosingSequence1() {
_G(game_over) = true;
music_play(4, true);
odinSpeaks(1001, 13, "CLOSING");
}
-void closing_sequence1_2() {
+void boss1ClosingSequence2() {
_G(thor_info)._armor = 1;
load_new_thor();
_G(thor)->_dir = 1;
@@ -271,13 +267,13 @@ void closing_sequence1_2() {
fill_score(20, "CLOSING");
}
-void closing_sequence1_3() {
+void boss1ClosingSequence3() {
fill_health();
fill_magic();
odinSpeaks(1002, 0, "CLOSING");
}
-void closing_sequence1_4() {
+void boss1ClosingSequence4() {
for (int rep = 0; rep < 16; rep++)
_G(scrn)._actorType[rep] = 0;
diff --git a/engines/got/game/boss1.h b/engines/got/game/boss1.h
index dc1d0c58f86..4f8a5f89037 100644
--- a/engines/got/game/boss1.h
+++ b/engines/got/game/boss1.h
@@ -27,13 +27,13 @@
namespace Got {
// Boss 1 - Snake (Jormangund)
-extern int boss1_movement(Actor *actr);
-extern void check_boss1_hit(Actor *actr, int x1, int y1, int x2, int y2, int act_num);
-extern void boss_level1();
-extern void closing_sequence1();
-extern void closing_sequence1_2();
-extern void closing_sequence1_3();
-extern void closing_sequence1_4();
+extern int boss1Movement(Actor *actor);
+extern void boss1CheckHit(const Actor *actor, int x1, int y1, int x2, int y2, int act_num);
+extern void boss1SetupLevel();
+extern void boss1ClosingSequence1();
+extern void boss1ClosingSequence2();
+extern void boss1ClosingSequence3();
+extern void boss1ClosingSequence4();
} // namespace Got
diff --git a/engines/got/game/boss2.cpp b/engines/got/game/boss2.cpp
index f7aa451e530..383a57731f8 100644
--- a/engines/got/game/boss2.cpp
+++ b/engines/got/game/boss2.cpp
@@ -41,71 +41,76 @@ static const byte EXPLOSION[] = {
};
static bool expf[60];
-static byte num_skulls; // Hehe
-static byte num_spikes;
-static bool drop_flag;
+static byte numSkulls;
+static byte numSpikes;
+static bool dropFlag;
static byte su[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-static int boss2a_movement(Actor *actr);
-static int boss2b_movement(Actor *actr);
-static int boss2_die();
-static void boss_set(int d, int x, int y);
+static int boss2MovementExplode(Actor *actor);
+static int boss2MovementShake(Actor *actor);
+static int boss2Die();
+static void bossSet(byte d, int x, int y);
-int boss2_movement(Actor *actr) {
+int boss2Movement(Actor *actor) {
switch (_G(setup)._difficultyLevel) {
case 0:
- num_skulls = 3;
- num_spikes = 5;
+ numSkulls = 3;
+ numSpikes = 5;
break;
+
case 1:
- num_skulls = 6;
- num_spikes = 8;
+ numSkulls = 6;
+ numSpikes = 8;
break;
+
case 2:
- num_skulls = 9;
- num_spikes = 11;
+ numSkulls = 9;
+ numSpikes = 11;
+ break;
+
+ default:
break;
}
if (_G(boss_dead))
- return boss2_die();
+ return boss2Die();
- if (actr->_i1) {
- if (actr->_i1 == 1)
- return boss2a_movement(actr);
+ if (actor->_i1) {
+ if (actor->_i1 == 1)
+ return boss2MovementExplode(actor);
- return boss2b_movement(actr);
+ return boss2MovementShake(actor);
}
- int d = actr->_lastDir;
- int x = actr->_x;
+ byte d = actor->_lastDir;
+ int x = actor->_x;
- if (actr->_temp6)
- actr->_temp6--;
+ if (actor->_temp6)
+ actor->_temp6--;
- if (!actr->_temp6) {
+ if (!actor->_temp6) {
bool f = false;
- drop_flag = false;
+ dropFlag = false;
- if (actr->_temp5)
- actr->_temp5--;
+ if (actor->_temp5)
+ actor->_temp5--;
- if (!actr->_temp5)
+ if (!actor->_temp5)
f = true;
else {
if (d == 2) {
if (x > 18)
- actr->_x -= 2;
+ actor->_x -= 2;
else
f = true;
} else if (d == 3) {
if (x < 272)
- actr->_x += 2;
+ actor->_x += 2;
else
f = true;
}
}
if (f) {
- actr->_temp5 = _G(rand1) + 60;
+ actor->_temp5 = _G(rand1) + 60;
if (d == 2)
d = 3;
else
@@ -113,41 +118,41 @@ int boss2_movement(Actor *actr) {
}
}
- const int count = actr->_frameCount - 1;
+ const int count = actor->_frameCount - 1;
if (count <= 0) {
- actr->_nextFrame++;
- if (actr->_nextFrame > 2)
- actr->_nextFrame = 0;
- actr->_frameCount = actr->_frameSpeed;
+ actor->_nextFrame++;
+ if (actor->_nextFrame > 2)
+ actor->_nextFrame = 0;
+ actor->_frameCount = actor->_frameSpeed;
} else
- actr->_frameCount = count;
+ actor->_frameCount = count;
- x = actr->_x;
- if (actr->_currNumShots < num_skulls && !drop_flag) {
+ x = actor->_x;
+ if (actor->_currNumShots < numSkulls && !dropFlag) {
if (x == 48 || x == 112 || x == 176 || x == 240) {
- drop_flag = true;
+ dropFlag = true;
_G(actor[3])._temp6 = 40;
- actor_always_shoots(actr, 1);
+ actor_always_shoots(actor, 1);
play_sound(FALL, false);
- _G(actor[actr->_shotActor])._x = actr->_x + 12;
- _G(actor[actr->_shotActor])._y = actr->_y + 32;
- _G(actor[actr->_shotActor])._temp2 = 0;
- _G(actor[actr->_shotActor])._temp3 = 4;
- _G(actor[actr->_shotActor])._temp4 = 4;
+ _G(actor[actor->_shotActor])._x = actor->_x + 12;
+ _G(actor[actor->_shotActor])._y = actor->_y + 32;
+ _G(actor[actor->_shotActor])._temp2 = 0;
+ _G(actor[actor->_shotActor])._temp3 = 4;
+ _G(actor[actor->_shotActor])._temp4 = 4;
}
}
- boss_set(d, x, actr->_y);
+ bossSet(d, x, actor->_y);
- if (actr->_directions == 1)
+ if (actor->_directions == 1)
return 0;
return d;
}
-static void boss_set(int d, int x, int y) {
+static void bossSet(byte d, int x, int y) {
_G(actor[4])._nextFrame = _G(actor[3])._nextFrame;
_G(actor[5])._nextFrame = _G(actor[3])._nextFrame;
_G(actor[6])._nextFrame = _G(actor[3])._nextFrame;
@@ -163,10 +168,8 @@ static void boss_set(int d, int x, int y) {
_G(actor[6])._y = y + 16;
}
-void check_boss2_hit(Actor *actr, int x1, int y1, int x2, int y2, int act_num) {
+void boss2CheckHit(Actor *actor, int x1, int y1, int x2, int y2, int act_num) {
if ((!_G(actor[3])._vulnerableCountdown)) {
- int rep;
-
actor_damaged(&_G(actor[3]), _G(hammer)->_hitStrength);
_G(actor[3])._health -= 10;
if (_G(actor[3])._health == 50) {
@@ -177,7 +180,8 @@ void check_boss2_hit(Actor *actr, int x1, int y1, int x2, int y2, int act_num) {
_G(actor[3])._i1 = 1;
_G(actor[3])._i2 = 0;
memset(expf, 0, 60);
- for (rep = 7; rep < MAX_ACTORS; rep++) {
+
+ for (int rep = 7; rep < MAX_ACTORS; rep++) {
if (_G(actor[rep])._active)
actor_destroyed(&_G(actor[rep]));
}
@@ -188,15 +192,15 @@ void check_boss2_hit(Actor *actr, int x1, int y1, int x2, int y2, int act_num) {
_G(actor[3])._moveCountdown = 75;
_G(actor[3])._vulnerableCountdown = 75;
_G(actor[3])._nextFrame = 1;
-
- for (rep = 4; rep < 7; rep++) {
+
+ for (int rep = 4; rep < 7; rep++) {
_G(actor[rep])._nextFrame = 1;
_G(actor[rep])._moveCountdown = 50;
}
if (_G(actor[3])._health == 0) {
_G(boss_dead) = true;
- for (rep = 7; rep < MAX_ACTORS; rep++) {
+ for (int rep = 7; rep < MAX_ACTORS; rep++) {
if (_G(actor[rep])._active)
actor_destroyed(&_G(actor[rep]));
}
@@ -204,21 +208,21 @@ void check_boss2_hit(Actor *actr, int x1, int y1, int x2, int y2, int act_num) {
}
}
-void boss_level2() {
+void boss2SetupLevel() {
setup_boss(2);
_G(boss_active) = true;
music_pause();
play_sound(BOSS11, true);
_G(timer_cnt) = 0;
- drop_flag = false;
+ dropFlag = false;
Common::fill(su, su + 18, 0);
g_events->send("Game", GameMessage("PAUSE", 40));
music_play(7, true);
}
-static int boss2_die() {
+static int boss2Die() {
_G(hourglass_flag) = 0;
_G(thunder_flag) = 0;
if (_G(boss_dead)) {
@@ -257,14 +261,14 @@ static int boss2_die() {
}
// Boss - skull (explode)
-static int boss2a_movement(Actor *actr) {
- next_frame(actr);
- _G(actor[4])._nextFrame = actr->_nextFrame;
- _G(actor[5])._nextFrame = actr->_nextFrame;
- _G(actor[6])._nextFrame = actr->_nextFrame;
- actr->_vulnerableCountdown = 20;
+static int boss2MovementExplode(Actor *actor) {
+ next_frame(actor);
+ _G(actor[4])._nextFrame = actor->_nextFrame;
+ _G(actor[5])._nextFrame = actor->_nextFrame;
+ _G(actor[6])._nextFrame = actor->_nextFrame;
+ actor->_vulnerableCountdown = 20;
- if (actr->_currNumShots || _G(actor[5])._currNumShots)
+ if (actor->_currNumShots || _G(actor[5])._currNumShots)
return 0;
play_sound(EXPLODE, true);
@@ -297,7 +301,7 @@ static int boss2a_movement(Actor *actr) {
}
// Boss - skull - shake
-static int boss2b_movement(Actor *actr) {
+static int boss2MovementShake(Actor *actor) {
int rep, an, hx;
if (_G(hammer)->_active && _G(hammer)->_moveType != 5) {
@@ -316,39 +320,39 @@ static int boss2b_movement(Actor *actr) {
}
}
}
- if (actr->_i4) {
- actr->_i4--;
- if (!actr->_i4)
+ if (actor->_i4) {
+ actor->_i4--;
+ if (!actor->_i4)
_G(thunder_flag) = 0;
}
- if (!actr->_i2) {
- if (actr->_x < 144)
- actr->_x += 2;
- else if (actr->_x > 144)
- actr->_x -= 2;
+ if (!actor->_i2) {
+ if (actor->_x < 144)
+ actor->_x += 2;
+ else if (actor->_x > 144)
+ actor->_x -= 2;
else {
- actr->_i2 = 1;
- actr->_i3 = 0;
+ actor->_i2 = 1;
+ actor->_i3 = 0;
}
goto done;
}
if (_G(actor[4])._currNumShots)
goto done;
- if (!actr->_i3) {
- actr->_i3 = g_events->getRandomNumber(2, 3);
+ if (!actor->_i3) {
+ actor->_i3 = g_events->getRandomNumber(2, 3);
}
- if (actr->_i3 == 2)
- actr->_x -= 2;
+ if (actor->_i3 == 2)
+ actor->_x -= 2;
else
- actr->_x += 2;
+ actor->_x += 2;
- if (actr->_x < 20 || actr->_x > 270) {
+ if (actor->_x < 20 || actor->_x > 270) {
_G(thunder_flag) = 100;
- actr->_i4 = 50;
+ actor->_i4 = 50;
play_sound(EXPLODE, true);
- actr->_i2 = 0;
+ actor->_i2 = 0;
Common::fill(su, su + 18, 0);
actor_always_shoots(&_G(actor[4]), 1);
@@ -359,8 +363,8 @@ static int boss2b_movement(Actor *actr) {
su[hx] = 1;
_G(actor[an])._nextFrame = g_events->getRandomNumber(3);
- for (rep = 0; rep < num_spikes; rep++) {
- while (1) {
+ for (rep = 0; rep < numSpikes; rep++) {
+ while (true) {
hx = g_events->getRandomNumber(17);
if (!su[hx])
break;
@@ -375,17 +379,17 @@ static int boss2b_movement(Actor *actr) {
}
done:
- next_frame(actr);
- boss_set(actr->_dir, actr->_x, actr->_y);
+ next_frame(actor);
+ bossSet(actor->_dir, actor->_x, actor->_y);
return 0;
}
-void closing_sequence2() {
+void boss2ClosingSequence1() {
music_play(6, true);
odinSpeaks(1001, 0, "CLOSING");
}
-void closing_sequence2_2() {
+void boss2ClosingSequence2() {
_G(thor_info)._armor = 10;
load_new_thor();
_G(thor)->_dir = 1;
@@ -394,13 +398,13 @@ void closing_sequence2_2() {
fill_score(20, "CLOSING");
}
-void closing_sequence2_3() {
+void boss2ClosingSequence3() {
fill_health();
fill_magic();
odinSpeaks(1002, 0, "CLOSING");
}
-void closing_sequence2_4() {
+void boss2ClosingSequence4() {
for (int rep = 0; rep < 16; rep++)
_G(scrn)._actorType[rep] = 0;
diff --git a/engines/got/game/boss2.h b/engines/got/game/boss2.h
index 66a75702d3d..2ef18c136a6 100644
--- a/engines/got/game/boss2.h
+++ b/engines/got/game/boss2.h
@@ -27,13 +27,13 @@
namespace Got {
// Boss 2 - Skull (Nognir)
-extern int boss2_movement(Actor *actr);
-extern void check_boss2_hit(Actor *actr, int x1, int y1, int x2, int y2, int act_num);
-extern void boss_level2();
-extern void closing_sequence2();
-extern void closing_sequence2_2();
-extern void closing_sequence2_3();
-extern void closing_sequence2_4();
+extern int boss2Movement(Actor *actor);
+extern void boss2CheckHit(Actor *actor, int x1, int y1, int x2, int y2, int act_num);
+extern void boss2SetupLevel();
+extern void boss2ClosingSequence1();
+extern void boss2ClosingSequence2();
+extern void boss2ClosingSequence3();
+extern void boss2ClosingSequence4();
} // namespace Got
diff --git a/engines/got/game/move_patterns.cpp b/engines/got/game/move_patterns.cpp
index 98df4ea5514..62460e2f0a1 100644
--- a/engines/got/game/move_patterns.cpp
+++ b/engines/got/game/move_patterns.cpp
@@ -411,10 +411,10 @@ int check_move1(int x, int y, Actor *actr) {
if (_G(boss_active) && !GAME3) {
switch (_G(area)) {
case 1:
- check_boss1_hit(act, x1, y1, x2, y2, i);
+ boss1CheckHit(act, x1, y1, x2, y2, i);
break;
case 2:
- check_boss2_hit(act, x1, y1, x2, y2, i);
+ boss2CheckHit(act, x1, y1, x2, y2, i);
break;
default:
// Area 3 boss Loki isn't checked here
@@ -1761,7 +1761,7 @@ int movement_nineteen(Actor *actr) {
int movement_twenty(Actor *actr) {
if (GAME1)
// Boss - snake
- return boss1_movement(actr);
+ return boss1Movement(actr);
return movement_one(actr);
}
@@ -2078,7 +2078,7 @@ int movement_twentyfive(Actor *actr) {
int movement_twentysix(Actor *actr) {
if (GAME2)
- return boss2_movement(actr);
+ return boss2Movement(actr);
if (GAME3)
return boss3_movement(actr);
@@ -2087,7 +2087,7 @@ int movement_twentysix(Actor *actr) {
int movement_twentyseven(Actor *actr) {
if (GAME2)
- return boss2_movement(actr);
+ return boss2Movement(actr);
return movement_one(actr);
}
diff --git a/engines/got/views/game.cpp b/engines/got/views/game.cpp
index c1a5d0928de..460634c2530 100644
--- a/engines/got/views/game.cpp
+++ b/engines/got/views/game.cpp
@@ -56,9 +56,9 @@ bool Game::msgKeypress(const KeypressMessage &msg) {
if (gDebugLevel > 0) {
// Hack used for testing end-game sequence
if (GAME1 && _G(current_level) == BOSS_LEVEL1)
- closing_sequence1();
+ boss1ClosingSequence1();
else if (GAME2 && _G(current_level) == BOSS_LEVEL2)
- closing_sequence2();
+ boss2ClosingSequence1();
else if (GAME3 && _G(current_level) == BOSS_LEVEL3)
closing_sequence3();
}
diff --git a/engines/got/views/game_content.cpp b/engines/got/views/game_content.cpp
index 7aaf560e1b4..d20d286c145 100644
--- a/engines/got/views/game_content.cpp
+++ b/engines/got/views/game_content.cpp
@@ -400,10 +400,10 @@ void GameContent::checkForBossDead() {
if (_G(boss_active)) {
switch (_G(area)) {
case 1:
- closing_sequence1();
+ boss1ClosingSequence1();
break;
case 2:
- closing_sequence2();
+ boss2ClosingSequence1();
break;
case 3:
closing_sequence3();
@@ -699,10 +699,10 @@ void GameContent::closingSequence() {
case 2:
switch (area) {
case 1:
- closing_sequence1_2();
+ boss1ClosingSequence2();
break;
case 2:
- closing_sequence2_2();
+ boss2ClosingSequence2();
break;
case 3:
closing_sequence3_2();
@@ -715,10 +715,10 @@ void GameContent::closingSequence() {
case 3:
switch (area) {
case 1:
- closing_sequence1_3();
+ boss1ClosingSequence3();
break;
case 2:
- closing_sequence2_3();
+ boss2ClosingSequence3();
break;
case 3:
closing_sequence3_3();
@@ -733,10 +733,10 @@ void GameContent::closingSequence() {
switch (area) {
case 1:
- closing_sequence1_4();
+ boss1ClosingSequence4();
break;
case 2:
- closing_sequence2_4();
+ boss2ClosingSequence4();
break;
default:
break;
More information about the Scummvm-git-logs
mailing list