aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2019-09-03 00:09:28 +0200
committerEugene Sandulenko2019-11-13 22:07:08 +0100
commitf7459b027c6d44ff20755a4b0e7d031d317425a0 (patch)
tree0053483b4af738c4465ea251a2cb652bd1d431eb
parent24edfa07ec63c43d9bbd3a1788195bf5f13b3dff (diff)
downloadscummvm-rg350-f7459b027c6d44ff20755a4b0e7d031d317425a0.tar.gz
scummvm-rg350-f7459b027c6d44ff20755a4b0e7d031d317425a0.tar.bz2
scummvm-rg350-f7459b027c6d44ff20755a4b0e7d031d317425a0.zip
GRIFFON: Added monsters enum
-rw-r--r--engines/griffon/combat.cpp11
-rw-r--r--engines/griffon/draw.cpp26
-rw-r--r--engines/griffon/engine.cpp97
-rw-r--r--engines/griffon/griffon.h16
-rw-r--r--engines/griffon/resources.cpp28
5 files changed, 92 insertions, 86 deletions
diff --git a/engines/griffon/combat.cpp b/engines/griffon/combat.cpp
index 1374ea5185..ecdcf55ee5 100644
--- a/engines/griffon/combat.cpp
+++ b/engines/griffon/combat.cpp
@@ -598,14 +598,15 @@ void GriffonEngine::damageNPC(int npcnum, int damage, int spell) {
addFloatText(line, _npcinfo[npcnum].x + 12 - 4 * strlen(line), _npcinfo[npcnum].y + 16, fcol);
- if (_npcinfo[npcnum].spriteset == 12)
+ if (_npcinfo[npcnum].spriteset == kMonsterBatKitty)
castSpell(9, _npcinfo[npcnum].x, _npcinfo[npcnum].y, _player.px, _player.py, npcnum);
// if enemy is killed
if (_npcinfo[npcnum].hp == 0) {
_player.exp = _player.exp + _npcinfo[npcnum].maxhp;
- if (_npcinfo[npcnum].spriteset == 1 || _npcinfo[npcnum].spriteset == 7 || _npcinfo[npcnum].spriteset == 6) {
+ if (_npcinfo[npcnum].spriteset == kMonsterBabyDragon || _npcinfo[npcnum].spriteset == kMonsterPriest ||
+ _npcinfo[npcnum].spriteset == kMonsterRedDragon) {
int ff = (int)(RND() * _player.level * 3);
if (ff == 0) {
float npx = _npcinfo[npcnum].x + 12;
@@ -619,7 +620,8 @@ void GriffonEngine::damageNPC(int npcnum, int damage, int spell) {
}
}
- if (_npcinfo[npcnum].spriteset == 2 || _npcinfo[npcnum].spriteset == 9 || _npcinfo[npcnum].spriteset == 4 || _npcinfo[npcnum].spriteset == 5) {
+ if (_npcinfo[npcnum].spriteset == kMonsterOneWing || _npcinfo[npcnum].spriteset == kMonsterTwoWing ||
+ _npcinfo[npcnum].spriteset == kMonsterBlackKnight || _npcinfo[npcnum].spriteset == kMonsterFireHydra) {
int ff = (int)(RND() * _player.level);
if (ff == 0) {
float npx = _npcinfo[npcnum].x + 12;
@@ -633,7 +635,8 @@ void GriffonEngine::damageNPC(int npcnum, int damage, int spell) {
}
}
- if (_npcinfo[npcnum].spriteset == 9 || _npcinfo[npcnum].spriteset == 10 || _npcinfo[npcnum].spriteset == 5) {
+ if (_npcinfo[npcnum].spriteset == kMonsterTwoWing || _npcinfo[npcnum].spriteset == kMonsterDragon2 ||
+ _npcinfo[npcnum].spriteset == kMonsterFireHydra) {
int ff = (int)(RND() * _player.level * 2);
if (ff == 0) {
float npx = _npcinfo[npcnum].x + 12;
diff --git a/engines/griffon/draw.cpp b/engines/griffon/draw.cpp
index fae2424bad..7d364f78b0 100644
--- a/engines/griffon/draw.cpp
+++ b/engines/griffon/draw.cpp
@@ -464,7 +464,7 @@ void GriffonEngine::drawNPCs(int mode) {
int wdir = _npcinfo[i].walkdir;
// spriteset1 specific
- if (_npcinfo[i].spriteset == 1) {
+ if (_npcinfo[i].spriteset == kMonsterBabyDragon) {
if (_npcinfo[i].attacking == 0) {
@@ -506,7 +506,7 @@ void GriffonEngine::drawNPCs(int mode) {
}
// onewing
- if (_npcinfo[i].spriteset == 2) {
+ if (_npcinfo[i].spriteset == kMonsterOneWing) {
for (int f = 0; f <= 7; f++) {
int s = _npcinfo[i].bodysection[f].sprite;
rcSrc.left = _animset2[s].x;
@@ -523,7 +523,7 @@ void GriffonEngine::drawNPCs(int mode) {
}
// twowing
- if (_npcinfo[i].spriteset == 9) {
+ if (_npcinfo[i].spriteset == kMonsterTwoWing) {
for (int f = 0; f <= 7; f++) {
int yp = 0;
@@ -545,7 +545,7 @@ void GriffonEngine::drawNPCs(int mode) {
// boss 1
- if (_npcinfo[i].spriteset == 3) {
+ if (_npcinfo[i].spriteset == kMonsterBoss1) {
if (_npcinfo[i].attacking == 0) {
int cframe = _npcinfo[i].cframe;
@@ -573,7 +573,7 @@ void GriffonEngine::drawNPCs(int mode) {
}
// black knight
- if (_npcinfo[i].spriteset == 4) {
+ if (_npcinfo[i].spriteset == kMonsterBlackKnight) {
if (_npcinfo[i].attacking == 0) {
int cframe = _npcinfo[i].cframe;
@@ -601,7 +601,7 @@ void GriffonEngine::drawNPCs(int mode) {
// firehydra
- if (_npcinfo[i].spriteset == 5) {
+ if (_npcinfo[i].spriteset == kMonsterFireHydra) {
for (int ff = 0; ff <= 2; ff++) {
if (_npcinfo[i].hp > 10 * ff * 20) {
rcSrc.left = 16 * (int)(RND() * 2);
@@ -654,7 +654,7 @@ void GriffonEngine::drawNPCs(int mode) {
}
// red dragon
- if (_npcinfo[i].spriteset == 6) {
+ if (_npcinfo[i].spriteset == kMonsterRedDragon) {
int cframe = _npcinfo[i].cframe;
rcSrc.left = (int)(cframe / 4) * 24;
@@ -677,7 +677,7 @@ void GriffonEngine::drawNPCs(int mode) {
}
// wizard
- if (_npcinfo[i].spriteset == 7) {
+ if (_npcinfo[i].spriteset == kMonsterPriest) {
// if(_npcinfo[i].attacking == 0) {
int cframe = _npcinfo[i].cframe;
@@ -715,7 +715,7 @@ void GriffonEngine::drawNPCs(int mode) {
// yellow dragon
- if (_npcinfo[i].spriteset == 8) {
+ if (_npcinfo[i].spriteset == kMonsterYellowDragon) {
int cframe = _npcinfo[i].cframe;
rcSrc.left = (int)(cframe / 4) * 24;
@@ -738,7 +738,7 @@ void GriffonEngine::drawNPCs(int mode) {
// dragon2
- if (_npcinfo[i].spriteset == 10) {
+ if (_npcinfo[i].spriteset == kMonsterDragon2) {
if (_npcinfo[i].attacking == 0) {
_npcinfo[i].floating = _npcinfo[i].floating + 0.25 * _fpsr;
while (_npcinfo[i].floating >= 16)
@@ -801,7 +801,7 @@ void GriffonEngine::drawNPCs(int mode) {
}
// end boss
- if (_npcinfo[i].spriteset == 11) {
+ if (_npcinfo[i].spriteset == kMonsterFinalBoss) {
_npcinfo[i].floating = _npcinfo[i].floating + .3 * _fpsr;
while (_npcinfo[i].floating >= 16)
@@ -931,7 +931,7 @@ void GriffonEngine::drawNPCs(int mode) {
}
// bat kitty
- if (_npcinfo[i].spriteset == 12) {
+ if (_npcinfo[i].spriteset == kMonsterBatKitty) {
_npcinfo[i].floating = _npcinfo[i].floating + 1 * _fpsr;
while (_npcinfo[i].floating >= 16)
_npcinfo[i].floating = _npcinfo[i].floating - 16;
@@ -998,7 +998,7 @@ void GriffonEngine::drawNPCs(int mode) {
int pass = 1;
- if (_npcinfo[i].spriteset == 3)
+ if (_npcinfo[i].spriteset == kMonsterBoss1)
pass = 0;
if (pass == 1)
drawOver(npx, npy);
diff --git a/engines/griffon/engine.cpp b/engines/griffon/engine.cpp
index 8809e8c817..4344b8d672 100644
--- a/engines/griffon/engine.cpp
+++ b/engines/griffon/engine.cpp
@@ -43,21 +43,8 @@
namespace Griffon {
// memo
-/*
- monsters
- 1 - baby dragon
- 2 - one wing
- 3 - boss 1
- 4 - black knight
- 5 - fire hydra
- 6 - red dragon
- 7 - priest
- 8 - yellow fire dragon
- 9 - two wing
-10 - dragon2
-11 - final boss
-12 - bat kitty
+/*
chests
0 - regular flask
11 - key chest
@@ -438,7 +425,7 @@ void GriffonEngine::updateNPCs() {
int pass = 0;
if (_npcinfo[i].attacking == 0)
pass = 1;
- if (_npcinfo[i].spriteset == 5)
+ if (_npcinfo[i].spriteset == kMonsterFireHydra)
pass = 1;
if (pass == 1) {
int moveup = 0;
@@ -454,7 +441,7 @@ void GriffonEngine::updateNPCs() {
float wspd = _npcinfo[i].walkspd / 4;
- if (_npcinfo[i].spriteset == 10)
+ if (_npcinfo[i].spriteset == kMonsterDragon2)
wspd = wspd * 2;
int wdir = _npcinfo[i].walkdir;
@@ -470,7 +457,7 @@ void GriffonEngine::updateNPCs() {
if (_npcinfo[i].pause > _ticks)
mode = -1;
- if (_npcinfo[i].spriteset == 2 && _npcinfo[i].castpause > _ticks)
+ if (_npcinfo[i].spriteset == kMonsterOneWing && _npcinfo[i].castpause > _ticks)
mode = -1;
if (mode == 3) {
@@ -601,7 +588,7 @@ void GriffonEngine::updateNPCs() {
float xp = (npx / 2 + 6);
float yp = (npy / 2 + 10);
- if (_npcinfo[i].spriteset == 10)
+ if (_npcinfo[i].spriteset == kMonsterDragon2)
wspd = wspd * 2;
float ii = wspd * _fpsr;
@@ -613,7 +600,7 @@ void GriffonEngine::updateNPCs() {
int sy = yp - ii;
uint32 *temp = (uint32 *)_clipbg->getBasePtr(sx, sy);
uint32 dq = *temp;
- if (_npcinfo[i].spriteset == 11)
+ if (_npcinfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0)
@@ -623,7 +610,7 @@ void GriffonEngine::updateNPCs() {
sy = yp - ii;
temp = (uint32 *)_clipbg->getBasePtr(sx, sy);
dq = *temp;
- if (_npcinfo[i].spriteset == 11)
+ if (_npcinfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0) {
movinup = 1;
@@ -635,7 +622,7 @@ void GriffonEngine::updateNPCs() {
sy = yp - ii;
temp = (uint32 *)_clipbg->getBasePtr(sx, sy);
dq = *temp;
- if (_npcinfo[i].spriteset == 11)
+ if (_npcinfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0) {
movinup = 1;
@@ -649,7 +636,7 @@ void GriffonEngine::updateNPCs() {
int sy = yp + ii;
uint32 *temp = (uint32 *)_clipbg->getBasePtr(sx, sy);
uint32 dq = *temp;
- if (_npcinfo[i].spriteset == 11)
+ if (_npcinfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0)
movindown = 1;
@@ -658,7 +645,7 @@ void GriffonEngine::updateNPCs() {
sy = yp + ii;
temp = (uint32 *)_clipbg->getBasePtr(sx, sy);
dq = *temp;
- if (_npcinfo[i].spriteset == 11)
+ if (_npcinfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0) {
movindown = 1;
@@ -670,7 +657,7 @@ void GriffonEngine::updateNPCs() {
sy = yp + ii;
temp = (uint32 *)_clipbg->getBasePtr(sx, sy);
dq = *temp;
- if (_npcinfo[i].spriteset == 11)
+ if (_npcinfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0) {
movindown = 1;
@@ -684,7 +671,7 @@ void GriffonEngine::updateNPCs() {
int sy = yp;
uint32 *temp = (uint32 *)_clipbg->getBasePtr(sx, sy);
uint32 dq = *temp;
- if (_npcinfo[i].spriteset == 11)
+ if (_npcinfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0)
movinleft = 1;
@@ -693,7 +680,7 @@ void GriffonEngine::updateNPCs() {
sy = yp - ii;
temp = (uint32 *)_clipbg->getBasePtr(sx, sy);
dq = *temp;
- if (_npcinfo[i].spriteset == 11)
+ if (_npcinfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0) {
movinleft = 1;
@@ -705,7 +692,7 @@ void GriffonEngine::updateNPCs() {
sy = yp + ii;
temp = (uint32 *)_clipbg->getBasePtr(sx, sy);
dq = *temp;
- if (_npcinfo[i].spriteset == 11)
+ if (_npcinfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0) {
movinleft = 1;
@@ -719,7 +706,7 @@ void GriffonEngine::updateNPCs() {
int sy = yp;
uint32 *temp = (uint32 *)_clipbg->getBasePtr(sx, sy);
uint32 dq = *temp;
- if (_npcinfo[i].spriteset == 11)
+ if (_npcinfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0)
movinright = 1;
@@ -728,7 +715,7 @@ void GriffonEngine::updateNPCs() {
sy = yp - ii;
temp = (uint32 *)_clipbg->getBasePtr(sx, sy);
dq = *temp;
- if (_npcinfo[i].spriteset == 11)
+ if (_npcinfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0) {
movinright = 1;
@@ -740,7 +727,7 @@ void GriffonEngine::updateNPCs() {
sy = yp + ii;
temp = (uint32 *)_clipbg->getBasePtr(sx, sy);
dq = *temp;
- if (_npcinfo[i].spriteset == 11)
+ if (_npcinfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0) {
movinright = 1;
@@ -771,7 +758,7 @@ void GriffonEngine::updateNPCs() {
float aspd = wspd;
- if (_npcinfo[i].spriteset == 10)
+ if (_npcinfo[i].spriteset == kMonsterDragon2)
aspd = wspd / 2;
xp = (npx / 2 + 6);
@@ -790,12 +777,12 @@ void GriffonEngine::updateNPCs() {
if (_triggerloc[lx][ly] > -1)
bgc = 1;
- if (_npcinfo[i].spriteset == 11)
+ if (_npcinfo[i].spriteset == kMonsterFinalBoss)
bgc = 0;
int rst = 0;
- if (_npcinfo[i].spriteset == 11) {
+ if (_npcinfo[i].spriteset == kMonsterFinalBoss) {
if (npx < 40 || npx > 280 || npy < 36 || npy > 204)
rst = 1;
}
@@ -833,7 +820,7 @@ void GriffonEngine::updateNPCs() {
}
// spriteset1 specific
- if (_npcinfo[i].spriteset == 1 && _npcinfo[i].attackattempt < _ticks) {
+ if (_npcinfo[i].spriteset == kMonsterBabyDragon && _npcinfo[i].attackattempt < _ticks) {
if (_npcinfo[i].attacknext < _ticks && _npcinfo[i].pause < _ticks && _npcinfo[i].attacking == 0) {
npx = _npcinfo[i].x;
npy = _npcinfo[i].y;
@@ -859,7 +846,7 @@ void GriffonEngine::updateNPCs() {
bool dospell = false;
// onewing specific
- if (_npcinfo[i].spriteset == 2) {
+ if (_npcinfo[i].spriteset == kMonsterOneWing) {
if (_npcinfo[i].attacknext < _ticks && _npcinfo[i].pause < _ticks && _npcinfo[i].attacking == 0) {
npx = _npcinfo[i].x;
npy = _npcinfo[i].y;
@@ -940,7 +927,7 @@ void GriffonEngine::updateNPCs() {
}
// boss1 specific and blackknight
- if (_npcinfo[i].spriteset == 3 || _npcinfo[i].spriteset == 4) {
+ if (_npcinfo[i].spriteset == kMonsterBoss1 || _npcinfo[i].spriteset == kMonsterBlackKnight) {
if (_npcinfo[i].attacknext < _ticks && _npcinfo[i].pause < _ticks && _npcinfo[i].attacking == 0) {
_npcinfo[i].attacking = 1;
_npcinfo[i].attackframe = 0;
@@ -956,7 +943,7 @@ void GriffonEngine::updateNPCs() {
// firehydra specific
- if (_npcinfo[i].spriteset == 5) {
+ if (_npcinfo[i].spriteset == kMonsterFireHydra) {
_npcinfo[i].swayspd = 4;
// sway code
@@ -1025,7 +1012,7 @@ void GriffonEngine::updateNPCs() {
}
// spriteset6 specific
- if (_npcinfo[i].spriteset == 6 && _npcinfo[i].attackattempt < _ticks) {
+ if (_npcinfo[i].spriteset == kMonsterRedDragon && _npcinfo[i].attackattempt < _ticks) {
if (_npcinfo[i].attacknext < _ticks && _npcinfo[i].pause < _ticks && _npcinfo[i].attacking == 0) {
npx = _npcinfo[i].x;
npy = _npcinfo[i].y;
@@ -1075,7 +1062,7 @@ void GriffonEngine::updateNPCs() {
}
// wizard1 specific
- if (_npcinfo[i].spriteset == 7) {
+ if (_npcinfo[i].spriteset == kMonsterPriest) {
if (_npcinfo[i].attacknext < _ticks && _npcinfo[i].pause < _ticks && _npcinfo[i].attacking == 0) {
_npcinfo[i].attacking = 1;
_npcinfo[i].attackframe = 0;
@@ -1091,7 +1078,7 @@ void GriffonEngine::updateNPCs() {
}
// spriteset6 specific
- if (_npcinfo[i].spriteset == 8 && _npcinfo[i].attackattempt < _ticks) {
+ if (_npcinfo[i].spriteset == kMonsterYellowDragon && _npcinfo[i].attackattempt < _ticks) {
if (_npcinfo[i].attacknext < _ticks && _npcinfo[i].pause < _ticks && _npcinfo[i].attacking == 0) {
npx = _npcinfo[i].x;
npy = _npcinfo[i].y;
@@ -1145,7 +1132,7 @@ void GriffonEngine::updateNPCs() {
}
// twowing specific
- if (_npcinfo[i].spriteset == 9) {
+ if (_npcinfo[i].spriteset == kMonsterTwoWing) {
if (_npcinfo[i].attacknext < _ticks && _npcinfo[i].pause < _ticks && _npcinfo[i].attacking == 0) {
npx = _npcinfo[i].bodysection[7].x;
npy = _npcinfo[i].bodysection[7].y;
@@ -1220,7 +1207,7 @@ void GriffonEngine::updateNPCs() {
}
// dragon2 specific
- if (_npcinfo[i].spriteset == 10 && _npcinfo[i].attackattempt < _ticks) {
+ if (_npcinfo[i].spriteset == kMonsterDragon2 && _npcinfo[i].attackattempt < _ticks) {
if (_npcinfo[i].attacknext < _ticks && _npcinfo[i].pause < _ticks && _npcinfo[i].attacking == 0) {
npx = _npcinfo[i].x;
npy = _npcinfo[i].y;
@@ -1245,7 +1232,7 @@ void GriffonEngine::updateNPCs() {
// endboss specific
- if (_npcinfo[i].spriteset == 11 && _npcinfo[i].attackattempt < _ticks) {
+ if (_npcinfo[i].spriteset == kMonsterFinalBoss && _npcinfo[i].attackattempt < _ticks) {
if (_npcinfo[i].attacknext < _ticks && _npcinfo[i].pause < _ticks && _npcinfo[i].attacking == 0) {
npx = _npcinfo[i].x;
npy = _npcinfo[i].y;
@@ -1287,7 +1274,7 @@ void GriffonEngine::updateNPCs() {
pass = 0;
if (_npcinfo[i].attacking == 1)
pass = 1;
- if (_npcinfo[i].spriteset == 5) {
+ if (_npcinfo[i].spriteset == kMonsterFireHydra) {
if (_npcinfo[i].attacking2[0] == 1)
pass = 1;
if (_npcinfo[i].attacking2[1] == 1)
@@ -1300,7 +1287,7 @@ void GriffonEngine::updateNPCs() {
int dist;
float damage;
// spriteset1 specific
- if (_npcinfo[i].spriteset == 1) {
+ if (_npcinfo[i].spriteset == kMonsterBabyDragon) {
_npcinfo[i].attackframe = _npcinfo[i].attackframe + _npcinfo[i].attackspd * _fpsr;
if (_npcinfo[i].attackframe >= 16) {
_npcinfo[i].attackframe = 0;
@@ -1330,7 +1317,7 @@ void GriffonEngine::updateNPCs() {
}
}
- if (_npcinfo[i].spriteset == 2) {
+ if (_npcinfo[i].spriteset == kMonsterOneWing) {
// targethead code
float xdif = _npcinfo[i].bodysection[7].x - _npcinfo[i].headtargetx[0];
float ydif = _npcinfo[i].bodysection[7].y - _npcinfo[i].headtargety[0];
@@ -1381,7 +1368,7 @@ void GriffonEngine::updateNPCs() {
// firehydra
- if (_npcinfo[i].spriteset == 5) {
+ if (_npcinfo[i].spriteset == kMonsterFireHydra) {
for (int ff = 0; ff <= 2; ff++) {
if (_npcinfo[i].attacking2[ff] == 1) {
float xdif = _npcinfo[i].bodysection[10 * ff + 9].x - _npcinfo[i].headtargetx[ff];
@@ -1435,7 +1422,7 @@ void GriffonEngine::updateNPCs() {
}
// twowing specific
- if (_npcinfo[i].spriteset == 9) {
+ if (_npcinfo[i].spriteset == kMonsterTwoWing) {
// targethead code
float xdif = _npcinfo[i].bodysection[7].x - _npcinfo[i].headtargetx[0];
float ydif = _npcinfo[i].bodysection[7].y - _npcinfo[i].headtargety[0];
@@ -1485,7 +1472,7 @@ void GriffonEngine::updateNPCs() {
}
// dragon 2 specific
- if (_npcinfo[i].spriteset == 10) {
+ if (_npcinfo[i].spriteset == kMonsterDragon2) {
_npcinfo[i].attackframe = _npcinfo[i].attackframe + _npcinfo[i].attackspd * _fpsr;
if (_npcinfo[i].attackframe >= 16) {
@@ -1515,7 +1502,7 @@ void GriffonEngine::updateNPCs() {
}
// endboss specific
- if (_npcinfo[i].spriteset == 11) {
+ if (_npcinfo[i].spriteset == kMonsterFinalBoss) {
_npcinfo[i].attackframe = _npcinfo[i].attackframe + _npcinfo[i].attackspd * _fpsr;
if (_npcinfo[i].attackframe >= 16) {
_npcinfo[i].attackframe = 0;
@@ -1727,7 +1714,7 @@ void GriffonEngine::updateSpells() {
if (spellinfo[i].damagewho == 1) {
// --------- boss 1 specific
- if (ABS(spellinfo[i].frame) < 0 && _npcinfo[spellinfo[i].npc].spriteset == 3) {
+ if (ABS(spellinfo[i].frame) < 0 && _npcinfo[spellinfo[i].npc].spriteset == kMonsterBoss1) {
int npc = spellinfo[i].npc;
_npcinfo[npc].attackframe = 0;
_npcinfo[npc].attacking = 0;
@@ -1738,7 +1725,7 @@ void GriffonEngine::updateSpells() {
// ---------------
// --------- blackknight specific
- if (ABS(spellinfo[i].frame) < 0 && _npcinfo[spellinfo[i].npc].spriteset == 4) {
+ if (ABS(spellinfo[i].frame) < 0 && _npcinfo[spellinfo[i].npc].spriteset == kMonsterBlackKnight) {
int npc = spellinfo[i].npc;
_npcinfo[npc].attackframe = 0;
_npcinfo[npc].attacking = 0;
@@ -2372,7 +2359,7 @@ void GriffonEngine::updateSpells() {
if (damage < 5)
damage = 5;
- if (_npcinfo[spellinfo[i].npc].spriteset == 12) {
+ if (_npcinfo[spellinfo[i].npc].spriteset == kMonsterBatKitty) {
if (damage < 50)
damage = 40 + (int)(RND() * 40);
}
@@ -2548,9 +2535,9 @@ void GriffonEngine::updateSpellsUnder() {
if ((abs(xdif) < 8 && abs(ydif) < 8)) {
float damage = (float)_player.spelldamage * (1.0 + RND() * 0.5) * (float)spellinfo[i].strength;
- if (_npcinfo[e].spriteset == 5)
+ if (_npcinfo[e].spriteset == kMonsterFireHydra)
damage = -damage;
- if (_npcinfo[e].spriteset == 11)
+ if (_npcinfo[e].spriteset == kMonsterFinalBoss)
damage = -damage;
if (_npcinfo[e].hp > 0 && _npcinfo[e].pause < _ticks) {
damageNPC(e, damage, 1);
diff --git a/engines/griffon/griffon.h b/engines/griffon/griffon.h
index e5b98adc14..704d6f6570 100644
--- a/engines/griffon/griffon.h
+++ b/engines/griffon/griffon.h
@@ -112,6 +112,22 @@ enum {
kScriptLever = 60 // lever
};
+// monsters
+enum {
+ kMonsterBabyDragon = 1, // baby dragon
+ kMonsterOneWing = 2, // one wing
+ kMonsterBoss1 = 3, // boss 1
+ kMonsterBlackKnight = 4, // black knight
+ kMonsterFireHydra = 5, // fire hydra
+ kMonsterRedDragon = 6, // red dragon
+ kMonsterPriest = 7, // priest
+ kMonsterYellowDragon = 8, // yellow fire dragon
+ kMonsterTwoWing = 9, // two wing
+ kMonsterDragon2 = 10, // dragon2
+ kMonsterFinalBoss = 11, // final boss
+ kMonsterBatKitty = 12 // bat kitty
+};
+
#define kEpsilon 0.001
diff --git a/engines/griffon/resources.cpp b/engines/griffon/resources.cpp
index d016a623bd..19c80e4f8b 100644
--- a/engines/griffon/resources.cpp
+++ b/engines/griffon/resources.cpp
@@ -488,7 +488,7 @@ void GriffonEngine::loadMap(int mapnum) {
INPUT("%i", &_npcinfo[i].script);
// baby dragon
- if (_npcinfo[i].spriteset == 1) {
+ if (_npcinfo[i].spriteset == kMonsterBabyDragon) {
_npcinfo[i].hp = 12;
_npcinfo[i].attackdelay = 2000;
@@ -502,7 +502,7 @@ void GriffonEngine::loadMap(int mapnum) {
}
// onewing
- if (_npcinfo[i].spriteset == 2) {
+ if (_npcinfo[i].spriteset == kMonsterOneWing) {
_npcinfo[i].hp = 200;
_npcinfo[i].attackdelay = 2000;
_npcinfo[i].swayspd = 1;
@@ -515,7 +515,7 @@ void GriffonEngine::loadMap(int mapnum) {
}
// boss1
- if (_npcinfo[i].spriteset == 3) {
+ if (_npcinfo[i].spriteset == kMonsterBoss1) {
_npcinfo[i].hp = 300;
_npcinfo[i].attackdelay = 2200;
@@ -526,7 +526,7 @@ void GriffonEngine::loadMap(int mapnum) {
}
// black knights
- if (_npcinfo[i].spriteset == 4) {
+ if (_npcinfo[i].spriteset == kMonsterBlackKnight) {
_npcinfo[i].hp = 200;
_npcinfo[i].attackdelay = 2800;
@@ -537,7 +537,7 @@ void GriffonEngine::loadMap(int mapnum) {
}
// boss2 firehydra
- if (_npcinfo[i].spriteset == 5) {
+ if (_npcinfo[i].spriteset == kMonsterFireHydra) {
_npcinfo[i].hp = 600;
_npcinfo[i].attackdelay = 2200;
@@ -550,7 +550,7 @@ void GriffonEngine::loadMap(int mapnum) {
}
// baby fire dragon
- if (_npcinfo[i].spriteset == 6) {
+ if (_npcinfo[i].spriteset == kMonsterRedDragon) {
_npcinfo[i].hp = 20;
_npcinfo[i].attackdelay = 1500;
@@ -564,7 +564,7 @@ void GriffonEngine::loadMap(int mapnum) {
}
// priest1
- if (_npcinfo[i].spriteset == 7) {
+ if (_npcinfo[i].spriteset == kMonsterPriest) {
_npcinfo[i].hp = 40;
_npcinfo[i].attackdelay = 5000;
@@ -578,7 +578,7 @@ void GriffonEngine::loadMap(int mapnum) {
}
// yellow fire dragon
- if (_npcinfo[i].spriteset == 8) {
+ if (_npcinfo[i].spriteset == kMonsterYellowDragon) {
_npcinfo[i].hp = 100;
_npcinfo[i].attackdelay = 1500;
@@ -592,7 +592,7 @@ void GriffonEngine::loadMap(int mapnum) {
}
// twowing
- if (_npcinfo[i].spriteset == 9) {
+ if (_npcinfo[i].spriteset == kMonsterTwoWing) {
_npcinfo[i].hp = 140;
_npcinfo[i].attackdelay = 2000;
_npcinfo[i].swayspd = 1;
@@ -606,7 +606,7 @@ void GriffonEngine::loadMap(int mapnum) {
}
// dragon2
- if (_npcinfo[i].spriteset == 10) {
+ if (_npcinfo[i].spriteset == kMonsterDragon2) {
_npcinfo[i].hp = 80;
_npcinfo[i].attackdelay = 1500;
@@ -619,7 +619,7 @@ void GriffonEngine::loadMap(int mapnum) {
}
// end boss
- if (_npcinfo[i].spriteset == 11) {
+ if (_npcinfo[i].spriteset == kMonsterFinalBoss) {
_npcinfo[i].hp = 1200;
_npcinfo[i].attackdelay = 2000;
@@ -632,7 +632,7 @@ void GriffonEngine::loadMap(int mapnum) {
}
// bat kitty
- if (_npcinfo[i].spriteset == 12) {
+ if (_npcinfo[i].spriteset == kMonsterBatKitty) {
_npcinfo[i].hp = 800;
_npcinfo[i].attackdelay = 2000;
@@ -655,7 +655,7 @@ void GriffonEngine::loadMap(int mapnum) {
_npcinfo[i].attackspd = 1.5;
_npcinfo[i].attacknext = _ticks + _npcinfo[i].attackdelay * (1 + RND() * 2);
- if (_npcinfo[i].spriteset == 2 || _npcinfo[i].spriteset == 9) {
+ if (_npcinfo[i].spriteset == kMonsterOneWing || _npcinfo[i].spriteset == kMonsterTwoWing) {
_npcinfo[i].bodysection[0].sprite = 0;
_npcinfo[i].bodysection[1].sprite = 1;
_npcinfo[i].bodysection[2].sprite = 2;
@@ -683,7 +683,7 @@ void GriffonEngine::loadMap(int mapnum) {
}
- if (_npcinfo[i].spriteset == 5) {
+ if (_npcinfo[i].spriteset == kMonsterFireHydra) {
for (int f = 0; f <= 29; f++) {
_npcinfo[i].bodysection[f].x = _npcinfo[i].x + 12;
_npcinfo[i].bodysection[f].y = _npcinfo[i].y + 14;