aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2019-10-31 08:32:24 +0100
committerEugene Sandulenko2019-11-13 22:07:08 +0100
commitb4b6f249f8ae965e295e395d268918b5b50613df (patch)
tree086951e1b585e2acd511ce1a20fa580be8e1bb86
parent9142bea88570f0b1dcf54ff84b3a421daabdab84 (diff)
downloadscummvm-rg350-b4b6f249f8ae965e295e395d268918b5b50613df.tar.gz
scummvm-rg350-b4b6f249f8ae965e295e395d268918b5b50613df.tar.bz2
scummvm-rg350-b4b6f249f8ae965e295e395d268918b5b50613df.zip
GRIFFON: More renaming
-rw-r--r--engines/griffon/combat.cpp194
-rw-r--r--engines/griffon/cutscenes.cpp4
-rw-r--r--engines/griffon/dialogs.cpp52
-rw-r--r--engines/griffon/draw.cpp244
-rw-r--r--engines/griffon/engine.cpp38
-rw-r--r--engines/griffon/gfx.cpp22
-rw-r--r--engines/griffon/griffon.cpp2
-rw-r--r--engines/griffon/griffon.h29
-rw-r--r--engines/griffon/input.cpp168
-rw-r--r--engines/griffon/logic.cpp1026
-rw-r--r--engines/griffon/resources.cpp472
-rw-r--r--engines/griffon/saveload.cpp4
12 files changed, 1127 insertions, 1128 deletions
diff --git a/engines/griffon/combat.cpp b/engines/griffon/combat.cpp
index 727973003d..ee76536716 100644
--- a/engines/griffon/combat.cpp
+++ b/engines/griffon/combat.cpp
@@ -67,7 +67,7 @@ void GriffonEngine::attack() {
_player.inventory[kInvFlask]++;
addFloatIcon(6, lx * 16, (ly - 1) * 16);
- _objmapf[_curMap][lx][ly - 1] = 1;
+ _objectMapFull[_curMap][lx][ly - 1] = 1;
if (config.effects) {
int snd = playSound(_sfx[kSndPowerUp]);
@@ -146,7 +146,7 @@ void GriffonEngine::attack() {
_objectMap[lx][ly - 1] = 3;
eventText("Found the Obsidian Shield!");
- _objmapf[4][1][2] = 1;
+ _objectMapFull[4][1][2] = 1;
return;
}
break;
@@ -184,7 +184,7 @@ void GriffonEngine::attack() {
setChannelVolume(snd, config.effectsvol);
}
- _objmapf[_curMap][lx][ly - 1] = 1;
+ _objectMapFull[_curMap][lx][ly - 1] = 1;
if (_objectInfo[o][4] == 1)
_objectMap[lx][ly - 1] = 3;
@@ -205,7 +205,7 @@ void GriffonEngine::attack() {
_player.inventory[kInvDoubleFlask]++;
addFloatIcon(12, lx * 16, (ly - 1) * 16);
- _objmapf[_curMap][lx][ly - 1] = 1;
+ _objectMapFull[_curMap][lx][ly - 1] = 1;
if (config.effects) {
int snd = playSound(_sfx[kSndPowerUp]);
@@ -233,7 +233,7 @@ void GriffonEngine::attack() {
_player.inventory[kInvDoubleFlask]++;
addFloatIcon(12, lx * 16, (ly - 1) * 16);
- _objmapf[_curMap][lx][ly - 1] = 1;
+ _objectMapFull[_curMap][lx][ly - 1] = 1;
if (config.effects) {
int snd = playSound(_sfx[kSndPowerUp]);
@@ -260,7 +260,7 @@ void GriffonEngine::attack() {
_player.inventory[kInvShock]++;
addFloatIcon(17, lx * 16, (ly - 1) * 16);
- _objmapf[_curMap][lx][ly - 1] = 1;
+ _objectMapFull[_curMap][lx][ly - 1] = 1;
if (config.effects) {
int snd = playSound(_sfx[kSndPowerUp]);
@@ -348,7 +348,7 @@ void GriffonEngine::attack() {
if (_objectInfo[o][4] == 1)
_objectMap[lx][ly - 1] = 3;
eventText("Found the Blood Sword!");
- _objmapf[4][1][2] = 1;
+ _objectMapFull[4][1][2] = 1;
return;
}
break;
@@ -366,7 +366,7 @@ void GriffonEngine::attack() {
if (_objectInfo[o][4] == 1)
_objectMap[lx][ly - 1] = 3;
eventText("Found the Entropy Shield!");
- _objmapf[4][1][2] = 1;
+ _objectMapFull[4][1][2] = 1;
return;
}
break;
@@ -384,7 +384,7 @@ void GriffonEngine::attack() {
if (_objectInfo[o][4] == 1)
_objectMap[lx][ly - 1] = 3;
eventText("Found the Rubyscale Armour!");
- _objmapf[4][1][2] = 1;
+ _objectMapFull[4][1][2] = 1;
return;
}
break;
@@ -393,12 +393,12 @@ void GriffonEngine::attack() {
}
}
- attacking = true;
+ _attacking = true;
_player.attackFrame = 0;
- movingup = false;
- movingdown = false;
- movingleft = false;
- movingright = false;
+ _movingUp = false;
+ _movingDown = false;
+ _movingLeft = false;
+ _movingRight = false;
for (int i = 0; i <= 15; i++) {
for (int a = 0; a <= 3; a++) {
@@ -411,12 +411,12 @@ void GriffonEngine::castSpell(int spellnum, float homex, float homey, float enem
// spellnum 7 = sprite 6 spitfire
for (int i = 0; i < kMaxSpell; i++) {
- if (ABS(spellinfo[i].frame) < kEpsilon) {
- spellinfo[i].homex = homex;
- spellinfo[i].homey = homey;
- spellinfo[i].enemyx = enemyx;
- spellinfo[i].enemyy = enemyy;
- spellinfo[i].spellnum = spellnum;
+ if (ABS(_spellInfo[i].frame) < kEpsilon) {
+ _spellInfo[i].homex = homex;
+ _spellInfo[i].homey = homey;
+ _spellInfo[i].enemyx = enemyx;
+ _spellInfo[i].enemyy = enemyy;
+ _spellInfo[i].spellnum = spellnum;
int dw = 0;
int npc = 0;
if (damagewho > 0) {
@@ -424,14 +424,14 @@ void GriffonEngine::castSpell(int spellnum, float homex, float homey, float enem
npc = damagewho;
}
- spellinfo[i].damagewho = dw;
- spellinfo[i].npc = npc;
+ _spellInfo[i].damagewho = dw;
+ _spellInfo[i].npc = npc;
- spellinfo[i].frame = 32.0f;
+ _spellInfo[i].frame = 32.0f;
if (damagewho == 0) {
- spellinfo[i].strength = _player.spellStrength / 100;
+ _spellInfo[i].strength = _player.spellStrength / 100;
if (ABS(_player.spellStrength - 100) < kEpsilon)
- spellinfo[i].strength = 1.5f;
+ _spellInfo[i].strength = 1.5f;
}
switch(spellnum) {
@@ -444,15 +444,15 @@ void GriffonEngine::castSpell(int spellnum, float homex, float homey, float enem
case 2:
// set earthslide vars
for (int f = 0; f <= 8; f++) {
- spellinfo[i].rocky[f] = 0;
- spellinfo[i].rockimg[f] = (int)(RND() * 4);
- spellinfo[i].rockdeflect[f] = ((int)(RND() * 128) - 64) * 1.5;
+ _spellInfo[i].rocky[f] = 0;
+ _spellInfo[i].rockimg[f] = (int)(RND() * 4);
+ _spellInfo[i].rockdeflect[f] = ((int)(RND() * 128) - 64) * 1.5;
}
break;
case 3:
// set fire vars
for (int f = 0; f <= 4; f++)
- spellinfo[i].legalive[f] = 32;
+ _spellInfo[i].legalive[f] = 32;
break;
case 5:
@@ -470,17 +470,17 @@ void GriffonEngine::castSpell(int spellnum, float homex, float homey, float enem
int ax = x * 16;
int ay = y * 16;
- spellinfo[i].fireballs[nballs][0] = ax;
- spellinfo[i].fireballs[nballs][1] = ay;
- spellinfo[i].fireballs[nballs][2] = 0;
- spellinfo[i].fireballs[nballs][3] = 0;
+ _spellInfo[i].fireballs[nballs][0] = ax;
+ _spellInfo[i].fireballs[nballs][1] = ay;
+ _spellInfo[i].fireballs[nballs][2] = 0;
+ _spellInfo[i].fireballs[nballs][3] = 0;
- spellinfo[i].ballon[nballs] = 1;
+ _spellInfo[i].ballon[nballs] = 1;
++nballs;
}
}
}
- spellinfo[i].nfballs = nballs;
+ _spellInfo[i].nfballs = nballs;
}
break;
case 8:
@@ -500,11 +500,11 @@ void GriffonEngine::castSpell(int spellnum, float homex, float homey, float enem
}
void GriffonEngine::checkHit() {
- if (attacking) {
- for (int i = 1; i <= _lastnpc; i++) {
- if (_npcinfo[i].hp > 0 && _npcinfo[i].pause < _ticks && (int)(RND() * 2) == 0) {
- float npx = _npcinfo[i].x;
- float npy = _npcinfo[i].y;
+ if (_attacking) {
+ for (int i = 1; i <= _lastNpc; i++) {
+ if (_npcInfo[i].hp > 0 && _npcInfo[i].pause < _ticks && (int)(RND() * 2) == 0) {
+ float npx = _npcInfo[i].x;
+ float npy = _npcInfo[i].y;
float xdif = _player.px - npx;
float ydif = _player.py - npy;
@@ -563,47 +563,47 @@ void GriffonEngine::damageNPC(int npcnum, int damage, int spell) {
damage = abs(damage);
if (heal == 0) {
- if (damage > _npcinfo[npcnum].hp) {
- ratio = (damage - _npcinfo[npcnum].hp) * 100 / damage;
- damage = _npcinfo[npcnum].hp;
+ if (damage > _npcInfo[npcnum].hp) {
+ ratio = (damage - _npcInfo[npcnum].hp) * 100 / damage;
+ damage = _npcInfo[npcnum].hp;
}
- _npcinfo[npcnum].hp -= damage;
- if (_npcinfo[npcnum].hp < 0)
- _npcinfo[npcnum].hp = 0;
+ _npcInfo[npcnum].hp -= damage;
+ if (_npcInfo[npcnum].hp < 0)
+ _npcInfo[npcnum].hp = 0;
sprintf(line, "-%i", damage);
fcol = 1;
} else {
- _npcinfo[npcnum].hp += damage;
- if (_npcinfo[npcnum].hp > _npcinfo[npcnum].maxhp)
- _npcinfo[npcnum].hp = _npcinfo[npcnum].maxhp;
+ _npcInfo[npcnum].hp += damage;
+ if (_npcInfo[npcnum].hp > _npcInfo[npcnum].maxhp)
+ _npcInfo[npcnum].hp = _npcInfo[npcnum].maxhp;
sprintf(line, "+%i", damage);
fcol = 5;
}
- _npcinfo[npcnum].pause = _ticks + 900;
+ _npcInfo[npcnum].pause = _ticks + 900;
if (spell == 0)
_player.attackStrength = ratio;
}
- addFloatText(line, _npcinfo[npcnum].x + 12 - 4 * strlen(line), _npcinfo[npcnum].y + 16, fcol);
+ addFloatText(line, _npcInfo[npcnum].x + 12 - 4 * strlen(line), _npcInfo[npcnum].y + 16, fcol);
- if (_npcinfo[npcnum].spriteset == kMonsterBatKitty)
- castSpell(9, _npcinfo[npcnum].x, _npcinfo[npcnum].y, _player.px, _player.py, npcnum);
+ 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 += _npcinfo[npcnum].maxhp;
+ if (_npcInfo[npcnum].hp == 0) {
+ _player.exp += _npcInfo[npcnum].maxhp;
- if (_npcinfo[npcnum].spriteset == kMonsterBabyDragon || _npcinfo[npcnum].spriteset == kMonsterPriest ||
- _npcinfo[npcnum].spriteset == kMonsterRedDragon) {
+ 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;
- float npy = _npcinfo[npcnum].y + 20;
+ float npx = _npcInfo[npcnum].x + 12;
+ float npy = _npcInfo[npcnum].y + 20;
int lx = (int)npx / 16;
int ly = (int)npy / 16;
@@ -613,12 +613,12 @@ void GriffonEngine::damageNPC(int npcnum, int damage, int spell) {
}
}
- if (_npcinfo[npcnum].spriteset == kMonsterOneWing || _npcinfo[npcnum].spriteset == kMonsterTwoWing ||
- _npcinfo[npcnum].spriteset == kMonsterBlackKnight || _npcinfo[npcnum].spriteset == kMonsterFireHydra) {
+ 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;
- float npy = _npcinfo[npcnum].y + 20;
+ float npx = _npcInfo[npcnum].x + 12;
+ float npy = _npcInfo[npcnum].y + 20;
int lx = (int)npx / 16;
int ly = (int)npy / 16;
@@ -628,12 +628,12 @@ void GriffonEngine::damageNPC(int npcnum, int damage, int spell) {
}
}
- if (_npcinfo[npcnum].spriteset == kMonsterTwoWing || _npcinfo[npcnum].spriteset == kMonsterDragon2 ||
- _npcinfo[npcnum].spriteset == kMonsterFireHydra) {
+ 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;
- float npy = _npcinfo[npcnum].y + 20;
+ float npx = _npcInfo[npcnum].x + 12;
+ float npy = _npcInfo[npcnum].y + 20;
int lx = (int)npx / 16;
int ly = (int)npy / 16;
@@ -644,10 +644,10 @@ void GriffonEngine::damageNPC(int npcnum, int damage, int spell) {
}
// academy master key chest script
- if (_npcinfo[npcnum].script == kScriptMasterKey) {
+ if (_npcInfo[npcnum].script == kScriptMasterKey) {
bool alive = false;
- for (int i = 1; i <= _lastnpc; i++) {
- if (_npcinfo[i].hp > 0)
+ for (int i = 1; i <= _lastNpc; i++) {
+ if (_npcInfo[i].hp > 0)
alive = true;
}
@@ -676,10 +676,10 @@ void GriffonEngine::damageNPC(int npcnum, int damage, int spell) {
}
// academy crystal chest script
- if (_npcinfo[npcnum].script == kScriptFindCrystal) {
+ if (_npcInfo[npcnum].script == kScriptFindCrystal) {
bool alive = false;
- for (int i = 1; i <= _lastnpc; i++) {
- if (_npcinfo[i].hp > 0)
+ for (int i = 1; i <= _lastNpc; i++) {
+ if (_npcInfo[i].hp > 0)
alive = true;
}
@@ -708,8 +708,8 @@ void GriffonEngine::damageNPC(int npcnum, int damage, int spell) {
}
// tower shield chest script
- if (_npcinfo[npcnum].script == kScriptFindShield && _scriptFlag[kScriptFindShield][0] == 0) {
- _triggerloc[9][7] = 5004;
+ if (_npcInfo[npcnum].script == kScriptFindShield && _scriptFlag[kScriptFindShield][0] == 0) {
+ _triggerLoc[9][7] = 5004;
int curTile = 40;
int curTileL = 0;
@@ -734,10 +734,10 @@ void GriffonEngine::damageNPC(int npcnum, int damage, int spell) {
}
// firehydra sword chest
- if (_npcinfo[npcnum].script == kScriptFindSword) {
+ if (_npcInfo[npcnum].script == kScriptFindSword) {
bool alive = false;
- for (int i = 1; i <= _lastnpc; i++) {
- if (_npcinfo[i].hp > 0)
+ for (int i = 1; i <= _lastNpc; i++) {
+ if (_npcInfo[i].hp > 0)
alive = true;
}
@@ -767,10 +767,10 @@ void GriffonEngine::damageNPC(int npcnum, int damage, int spell) {
}
// gardens master key script
- if (_npcinfo[npcnum].script == kScriptGardenMasterKey && _scriptFlag[kScriptKeyChest][0] == 0) {
+ if (_npcInfo[npcnum].script == kScriptGardenMasterKey && _scriptFlag[kScriptKeyChest][0] == 0) {
bool alive = false;
- for (int i = 1; i <= _lastnpc; i++) {
- if (_npcinfo[i].hp > 0)
+ for (int i = 1; i <= _lastNpc; i++) {
+ if (_npcInfo[i].hp > 0)
alive = true;
}
@@ -800,10 +800,10 @@ void GriffonEngine::damageNPC(int npcnum, int damage, int spell) {
// regular key chest 1
for (int s = 20; s <= 23; s++) {
- if (_npcinfo[npcnum].script == s && _scriptFlag[s][0] < 2) {
+ if (_npcInfo[npcnum].script == s && _scriptFlag[s][0] < 2) {
bool alive = false;
- for (int i = 1; i <= _lastnpc; i++) {
- if (_npcinfo[i].hp > 0)
+ for (int i = 1; i <= _lastNpc; i++) {
+ if (_npcInfo[i].hp > 0)
alive = true;
}
@@ -833,10 +833,10 @@ void GriffonEngine::damageNPC(int npcnum, int damage, int spell) {
}
// pickup lightning bomb
- if (_npcinfo[npcnum].script == kScriptLightningBomb && (_curMap == 41 && _scriptFlag[kScriptLightningBomb][1] == 0)) {
+ if (_npcInfo[npcnum].script == kScriptLightningBomb && (_curMap == 41 && _scriptFlag[kScriptLightningBomb][1] == 0)) {
bool alive = false;
- for (int i = 1; i <= _lastnpc; i++) {
- if (_npcinfo[i].hp > 0)
+ for (int i = 1; i <= _lastNpc; i++) {
+ if (_npcInfo[i].hp > 0)
alive = true;
}
@@ -863,10 +863,10 @@ void GriffonEngine::damageNPC(int npcnum, int damage, int spell) {
}
// citadel armour chest
- if (_npcinfo[npcnum].script == kScriptArmourChest) {
+ if (_npcInfo[npcnum].script == kScriptArmourChest) {
bool alive = false;
- for (int i = 1; i <= _lastnpc; i++) {
- if (_npcinfo[i].hp > 0)
+ for (int i = 1; i <= _lastNpc; i++) {
+ if (_npcInfo[i].hp > 0)
alive = true;
}
@@ -895,10 +895,10 @@ void GriffonEngine::damageNPC(int npcnum, int damage, int spell) {
}
// citadel master key script
- if (_npcinfo[npcnum].script == kScriptCitadelMasterKey && _scriptFlag[kScriptCitadelMasterKey][0] == 0) {
+ if (_npcInfo[npcnum].script == kScriptCitadelMasterKey && _scriptFlag[kScriptCitadelMasterKey][0] == 0) {
bool alive = false;
- for (int i = 1; i <= _lastnpc; i++) {
- if (_npcinfo[i].hp > 0)
+ for (int i = 1; i <= _lastNpc; i++) {
+ if (_npcInfo[i].hp > 0)
alive = true;
}
@@ -927,10 +927,10 @@ void GriffonEngine::damageNPC(int npcnum, int damage, int spell) {
}
// max ups
- if (_npcinfo[npcnum].script == kScriptGetSword3 && _scriptFlag[kScriptGetSword3][0] == 0) {
+ if (_npcInfo[npcnum].script == kScriptGetSword3 && _scriptFlag[kScriptGetSword3][0] == 0) {
bool alive = false;
- for (int i = 1; i <= _lastnpc; i++) {
- if (_npcinfo[i].hp > 0)
+ for (int i = 1; i <= _lastNpc; i++) {
+ if (_npcInfo[i].hp > 0)
alive = true;
}
@@ -1001,7 +1001,7 @@ void GriffonEngine::damageNPC(int npcnum, int damage, int spell) {
}
}
- if (_npcinfo[npcnum].script == kScriptEndOfGame)
+ if (_npcInfo[npcnum].script == kScriptEndOfGame)
endOfGame();
}
}
diff --git a/engines/griffon/cutscenes.cpp b/engines/griffon/cutscenes.cpp
index ce58ad9a78..994fcadb9e 100644
--- a/engines/griffon/cutscenes.cpp
+++ b/engines/griffon/cutscenes.cpp
@@ -495,8 +495,8 @@ void GriffonEngine::endOfGame() {
void GriffonEngine::theEnd() {
for (int i = 0; i < kMaxFloat; i++) {
- _floattext[i][0] = 0;
- _floaticon[i][0] = 0;
+ _floatText[i][0] = 0;
+ _floatIcon[i][0] = 0;
}
for (float y = 0; y < 100; y += _fpsr) {
diff --git a/engines/griffon/dialogs.cpp b/engines/griffon/dialogs.cpp
index 959cdfeff1..7d09d0e257 100644
--- a/engines/griffon/dialogs.cpp
+++ b/engines/griffon/dialogs.cpp
@@ -264,23 +264,23 @@ void GriffonEngine::configMenu() {
do {
_videoBuffer->fillRect(Common::Rect(0, 0, _videoBuffer->w, _videoBuffer->h), 0);
- rcDest.left = 256 + 256 * cos(PI / 180 * clouddeg * 40);
- rcDest.top = 192 + 192 * sin(PI / 180 * clouddeg * 40);
+ rcDest.left = 256 + 256 * cos(PI / 180 * _cloudAngle * 40);
+ rcDest.top = 192 + 192 * sin(PI / 180 * _cloudAngle * 40);
rcDest.setWidth(320);
rcDest.setHeight(240);
- cloudimg->setAlpha(128, true);
- cloudimg->blit(*_videoBuffer, 0, 0, Graphics::FLIP_NONE, &rcDest);
- cloudimg->setAlpha(64, true);
+ _cloudImg->setAlpha(128, true);
+ _cloudImg->blit(*_videoBuffer, 0, 0, Graphics::FLIP_NONE, &rcDest);
+ _cloudImg->setAlpha(64, true);
rcDest.left = 256;
rcDest.top = 192;
rcDest.setWidth(320);
rcDest.setHeight(240);
- cloudimg->setAlpha(128, true);
- cloudimg->blit(*_videoBuffer, 0, 0, Graphics::FLIP_NONE, &rcDest);
- cloudimg->setAlpha(64, true);
+ _cloudImg->setAlpha(128, true);
+ _cloudImg->blit(*_videoBuffer, 0, 0, Graphics::FLIP_NONE, &rcDest);
+ _cloudImg->setAlpha(64, true);
_videoBuffer->copyRectToSurface(configwindow->getPixels(), configwindow->pitch, 0, 0, configwindow->w, configwindow->h);
@@ -457,9 +457,9 @@ void GriffonEngine::configMenu() {
}
}
- clouddeg += 0.01 * _fpsr;
- while (clouddeg >= 360)
- clouddeg -= 360;
+ _cloudAngle += 0.01 * _fpsr;
+ while (_cloudAngle >= 360)
+ _cloudAngle -= 360;
g_system->delayMillis(10);
} while (!_shouldQuit && !exitMenu);
@@ -467,13 +467,13 @@ void GriffonEngine::configMenu() {
configwindow->free();
_itemTicks = _ticks + 210;
- cloudimg->setAlpha(64, true);
+ _cloudImg->setAlpha(64, true);
}
void GriffonEngine::saveLoadNew() {
float y = 0.0;
- clouddeg = 0;
+ _cloudAngle = 0;
_videoBuffer->setAlpha(255);
_saveLoadImg->setAlpha(192, true);
@@ -491,23 +491,23 @@ void GriffonEngine::saveLoadNew() {
y += 1 * _fpsr;
- rcDest.left = 256 + 256 * cos(PI / 180 * clouddeg * 40);
- rcDest.top = 192 + 192 * sin(PI / 180 * clouddeg * 40);
+ rcDest.left = 256 + 256 * cos(PI / 180 * _cloudAngle * 40);
+ rcDest.top = 192 + 192 * sin(PI / 180 * _cloudAngle * 40);
rcDest.setWidth(320);
rcDest.setHeight(240);
- cloudimg->setAlpha(128, true);
- cloudimg->blit(*_videoBuffer, 0, 0, Graphics::FLIP_NONE, &rcDest);
- cloudimg->setAlpha(64, true);
+ _cloudImg->setAlpha(128, true);
+ _cloudImg->blit(*_videoBuffer, 0, 0, Graphics::FLIP_NONE, &rcDest);
+ _cloudImg->setAlpha(64, true);
rcDest.left = 256;
rcDest.top = 192;
rcDest.setWidth(320);
rcDest.setHeight(240);
- cloudimg->setAlpha(128, true);
- cloudimg->blit(*_videoBuffer, 0, 0, Graphics::FLIP_NONE, &rcDest);
- cloudimg->setAlpha(64, true);
+ _cloudImg->setAlpha(128, true);
+ _cloudImg->blit(*_videoBuffer, 0, 0, Graphics::FLIP_NONE, &rcDest);
+ _cloudImg->setAlpha(64, true);
_saveLoadImg->blit(*_videoBuffer);
@@ -565,7 +565,7 @@ void GriffonEngine::saveLoadNew() {
if (loadState(currow - 1)) {
_player.walkSpeed = 1.1f;
_animSpeed = 0.5f;
- attacking = false;
+ _attacking = false;
_player.attackSpeed = 1.5f;
_playingGardens = false;
@@ -773,9 +773,9 @@ void GriffonEngine::saveLoadNew() {
_fp = 0;
}
- clouddeg += 0.01 * _fpsr;
- while (clouddeg >= 360)
- clouddeg -= 360;
+ _cloudAngle += 0.01 * _fpsr;
+ while (_cloudAngle >= 360)
+ _cloudAngle -= 360;
_itemyloc += 0.6 * _fpsr;
while (_itemyloc >= 16)
@@ -784,7 +784,7 @@ void GriffonEngine::saveLoadNew() {
g_system->delayMillis(10);
} while (!_shouldQuit);
- cloudimg->setAlpha(64, true);
+ _cloudImg->setAlpha(64, true);
}
diff --git a/engines/griffon/draw.cpp b/engines/griffon/draw.cpp
index 0710e89b71..70fb073f82 100644
--- a/engines/griffon/draw.cpp
+++ b/engines/griffon/draw.cpp
@@ -189,8 +189,8 @@ void GriffonEngine::drawHud() {
game_fillrect(_videoBuffer2, 0, 0, 320, 240, 0);
for (int i = 0; i < kMaxFloat; i++) {
- if (_floattext[i][0] > 0) {
- int fc = (int)_floattext[i][3];
+ if (_floatText[i][0] > 0) {
+ int fc = (int)_floatText[i][3];
int c = fc, c2 = 3;
if (fc == 4)
@@ -201,19 +201,19 @@ void GriffonEngine::drawHud() {
c2 = 2;
if (fc != 0) {
- drawString(_videoBuffer, _floatstri[i], (int)(_floattext[i][1]) + 0, (int)(_floattext[i][2]) - 1, c2);
- drawString(_videoBuffer, _floatstri[i], (int)(_floattext[i][1]) + 0, (int)(_floattext[i][2]) + 1, c2);
- drawString(_videoBuffer, _floatstri[i], (int)(_floattext[i][1]) - 1, (int)(_floattext[i][2]) + 0, c2);
- drawString(_videoBuffer, _floatstri[i], (int)(_floattext[i][1]) + 1, (int)(_floattext[i][2]) + 0, c2);
+ drawString(_videoBuffer, _floatStr[i], (int)(_floatText[i][1]) + 0, (int)(_floatText[i][2]) - 1, c2);
+ drawString(_videoBuffer, _floatStr[i], (int)(_floatText[i][1]) + 0, (int)(_floatText[i][2]) + 1, c2);
+ drawString(_videoBuffer, _floatStr[i], (int)(_floatText[i][1]) - 1, (int)(_floatText[i][2]) + 0, c2);
+ drawString(_videoBuffer, _floatStr[i], (int)(_floatText[i][1]) + 1, (int)(_floatText[i][2]) + 0, c2);
}
- drawString(_videoBuffer, _floatstri[i], (int)(_floattext[i][1]), (int)(_floattext[i][2]), c);
+ drawString(_videoBuffer, _floatStr[i], (int)(_floatText[i][1]), (int)(_floatText[i][2]), c);
}
- if (_floaticon[i][0] > 0) {
- int ico = _floaticon[i][3];
- int ix = _floaticon[i][1];
- int iy = _floaticon[i][2];
+ if (_floatIcon[i][0] > 0) {
+ int ico = _floatIcon[i][3];
+ int ix = _floatIcon[i][1];
+ int iy = _floatIcon[i][2];
rcDest.left = ix;
rcDest.top = iy;
@@ -425,13 +425,13 @@ void GriffonEngine::drawHud() {
}
if (_selEnemyOn) {
- if (_curEnemy > _lastnpc) {
- int pst = _curEnemy - _lastnpc - 1;
+ if (_curEnemy > _lastNpc) {
+ int pst = _curEnemy - _lastNpc - 1;
rcDest.left = _postInfo[pst][0];
rcDest.top = (float)(_postInfo[pst][1] - 4 - sin(3.141592 / 8 * _itemyloc));
} else {
- rcDest.left = _npcinfo[_curEnemy].x + 4;
- rcDest.top = (float)(_npcinfo[_curEnemy].y + 4 - 16 - sin(3.141592 / 8 * _itemyloc));
+ rcDest.left = _npcInfo[_curEnemy].x + 4;
+ rcDest.top = (float)(_npcInfo[_curEnemy].y + 4 - 16 - sin(3.141592 / 8 * _itemyloc));
}
_itemImg[13]->blit(*_videoBuffer, rcDest.left, rcDest.top);
@@ -453,20 +453,20 @@ void GriffonEngine::drawNPCs(int mode) {
if (_ysort[yy] > 0) {
int i = _ysort[yy];
- if (_npcinfo[i].hp > 0) {
- int npx = (int)(_npcinfo[i].x);
- int npy = (int)(_npcinfo[i].y);
+ if (_npcInfo[i].hp > 0) {
+ int npx = (int)(_npcInfo[i].x);
+ int npy = (int)(_npcInfo[i].y);
- int sprite = _npcinfo[i].spriteset;
+ int sprite = _npcInfo[i].spriteset;
- int wdir = _npcinfo[i].walkdir;
+ int wdir = _npcInfo[i].walkdir;
// spriteset1 specific
- if (_npcinfo[i].spriteset == kMonsterBabyDragon) {
+ if (_npcInfo[i].spriteset == kMonsterBabyDragon) {
- if (!_npcinfo[i].attacking) {
+ if (!_npcInfo[i].attacking) {
- int cframe = _npcinfo[i].cframe;
+ int cframe = _npcInfo[i].cframe;
rcSrc.left = (int)(cframe / 4) * 24;
rcSrc.top = wdir * 24;
@@ -478,15 +478,15 @@ void GriffonEngine::drawNPCs(int mode) {
rcDest.setWidth(24);
rcDest.setHeight(24);
- if (_npcinfo[i].pause > _ticks && _npcinfo[i].shake < _ticks) {
- _npcinfo[i].shake = _ticks + 50;
+ if (_npcInfo[i].pause > _ticks && _npcInfo[i].shake < _ticks) {
+ _npcInfo[i].shake = _ticks + 50;
rcDest.left += (int)(RND() * 3) - 1;
rcDest.top += (int)(RND() * 3) - 1;
}
_anims[sprite]->blit(*_videoBuffer, rcDest.left, rcDest.top, Graphics::FLIP_NONE, &rcSrc);
} else {
- int cframe = _npcinfo[i].cattackframe;
+ int cframe = _npcInfo[i].cattackframe;
rcSrc.left = (int)(cframe / 4) * 24;
rcSrc.top = wdir * 24;
@@ -504,16 +504,16 @@ void GriffonEngine::drawNPCs(int mode) {
}
// onewing
- if (_npcinfo[i].spriteset == kMonsterOneWing) {
+ if (_npcInfo[i].spriteset == kMonsterOneWing) {
for (int f = 0; f < 7; f++) {
- int s = _npcinfo[i].bodysection[f].sprite;
- rcSrc.left = _animset2[s].x;
- rcSrc.top = _animset2[s].y;
- rcSrc.setWidth(_animset2[s].w);
- rcSrc.setHeight(_animset2[s].h);
+ int s = _npcInfo[i].bodysection[f].sprite;
+ rcSrc.left = _animSet2[s].x;
+ rcSrc.top = _animSet2[s].y;
+ rcSrc.setWidth(_animSet2[s].w);
+ rcSrc.setHeight(_animSet2[s].h);
- rcDest.left = _npcinfo[i].bodysection[f].x - _animset2[s].xofs;
- rcDest.top = _npcinfo[i].bodysection[f].y - _animset2[s].yofs + 2;
+ rcDest.left = _npcInfo[i].bodysection[f].x - _animSet2[s].xofs;
+ rcDest.top = _npcInfo[i].bodysection[f].y - _animSet2[s].yofs + 2;
_anims[2]->blit(*_videoBuffer, rcDest.left, rcDest.top, Graphics::FLIP_NONE, &rcSrc);
}
@@ -521,20 +521,20 @@ void GriffonEngine::drawNPCs(int mode) {
}
// twowing
- if (_npcinfo[i].spriteset == kMonsterTwoWing) {
+ if (_npcInfo[i].spriteset == kMonsterTwoWing) {
for (int f = 0; f < 7; f++) {
int yp = 0;
if (f == 0 && (_curMap == 53 || _curMap == 57 || _curMap == 61 || _curMap == 65 || _curMap == 56 || _curMap > 66) && _scriptFlag[kScriptLever][0] > 0)
yp = 16;
- int s = _npcinfo[i].bodysection[f].sprite;
- rcSrc.left = _animset9[s].x;
- rcSrc.top = _animset9[s].y + yp;
- rcSrc.setWidth(_animset9[s].w);
- rcSrc.setHeight(_animset9[s].h);
+ int s = _npcInfo[i].bodysection[f].sprite;
+ rcSrc.left = _animSet9[s].x;
+ rcSrc.top = _animSet9[s].y + yp;
+ rcSrc.setWidth(_animSet9[s].w);
+ rcSrc.setHeight(_animSet9[s].h);
- rcDest.left = _npcinfo[i].bodysection[f].x - _animset9[s].xofs;
- rcDest.top = _npcinfo[i].bodysection[f].y - _animset9[s].yofs + 2;
+ rcDest.left = _npcInfo[i].bodysection[f].x - _animSet9[s].xofs;
+ rcDest.top = _npcInfo[i].bodysection[f].y - _animSet9[s].yofs + 2;
_anims[9]->blit(*_videoBuffer, rcDest.left, rcDest.top, Graphics::FLIP_NONE, &rcSrc);
}
@@ -543,9 +543,9 @@ void GriffonEngine::drawNPCs(int mode) {
// boss 1
- if (_npcinfo[i].spriteset == kMonsterBoss1) {
- if (!_npcinfo[i].attacking) {
- int cframe = _npcinfo[i].cframe;
+ if (_npcInfo[i].spriteset == kMonsterBoss1) {
+ if (!_npcInfo[i].attacking) {
+ int cframe = _npcInfo[i].cframe;
rcSrc.left = (int)(cframe / 4) * 24;
} else {
rcSrc.left = 4 * 24;
@@ -563,9 +563,9 @@ void GriffonEngine::drawNPCs(int mode) {
}
// black knight
- if (_npcinfo[i].spriteset == kMonsterBlackKnight) {
- if (!_npcinfo[i].attacking) {
- int cframe = _npcinfo[i].cframe;
+ if (_npcInfo[i].spriteset == kMonsterBlackKnight) {
+ if (!_npcInfo[i].attacking) {
+ int cframe = _npcInfo[i].cframe;
rcSrc.left = (int)(cframe / 4) * 24;
} else {
rcSrc.left = 4 * 24;
@@ -582,16 +582,16 @@ void GriffonEngine::drawNPCs(int mode) {
// firehydra
- if (_npcinfo[i].spriteset == kMonsterFireHydra) {
+ if (_npcInfo[i].spriteset == kMonsterFireHydra) {
for (int ff = 0; ff <= 2; ff++) {
- if (_npcinfo[i].hp > 10 * ff * 20) {
+ if (_npcInfo[i].hp > 10 * ff * 20) {
rcSrc.left = 16 * (int)(RND() * 2);
rcSrc.top = 80;
rcSrc.setWidth(16);
rcSrc.setHeight(16);
- rcDest.left = _npcinfo[i].bodysection[10 * ff].x - 8;
- rcDest.top = _npcinfo[i].bodysection[10 * ff].y - 8;
+ rcDest.left = _npcInfo[i].bodysection[10 * ff].x - 8;
+ rcDest.top = _npcInfo[i].bodysection[10 * ff].y - 8;
int x = 192 + ((int)(_itemyloc + ff * 5) % 3) * 64;
if (x > 255)
@@ -606,8 +606,8 @@ void GriffonEngine::drawNPCs(int mode) {
rcSrc.setWidth(16);
rcSrc.setHeight(16);
- rcDest.left = _npcinfo[i].bodysection[ff * 10 + f].x - 8 + (int)(RND() * 3) - 1;
- rcDest.top = _npcinfo[i].bodysection[ff * 10 + f].y - 8 + (int)(RND() * 3) - 1;
+ rcDest.left = _npcInfo[i].bodysection[ff * 10 + f].x - 8 + (int)(RND() * 3) - 1;
+ rcDest.top = _npcInfo[i].bodysection[ff * 10 + f].y - 8 + (int)(RND() * 3) - 1;
x = 192 + f % 3 * 64;
if (x > 255)
@@ -622,8 +622,8 @@ void GriffonEngine::drawNPCs(int mode) {
rcSrc.setWidth(42);
rcSrc.setHeight(36);
- rcDest.left = _npcinfo[i].bodysection[10 * ff + 9].x - 21;
- rcDest.top = _npcinfo[i].bodysection[10 * ff + 9].y - 21;
+ rcDest.left = _npcInfo[i].bodysection[10 * ff + 9].x - 21;
+ rcDest.top = _npcInfo[i].bodysection[10 * ff + 9].y - 21;
_spellImg->setAlpha(192, true);
_anims[5]->blit(*_videoBuffer, rcDest.left, rcDest.top, Graphics::FLIP_NONE, &rcSrc);
@@ -635,8 +635,8 @@ void GriffonEngine::drawNPCs(int mode) {
}
// red dragon
- if (_npcinfo[i].spriteset == kMonsterRedDragon) {
- int cframe = _npcinfo[i].cframe;
+ if (_npcInfo[i].spriteset == kMonsterRedDragon) {
+ int cframe = _npcInfo[i].cframe;
rcSrc.left = (int)(cframe / 4) * 24;
rcSrc.top = wdir * 24;
@@ -648,8 +648,8 @@ void GriffonEngine::drawNPCs(int mode) {
rcDest.setWidth(24);
rcDest.setHeight(24);
- if (_npcinfo[i].pause > _ticks && _npcinfo[i].shake < _ticks) {
- _npcinfo[i].shake = _ticks + 50;
+ if (_npcInfo[i].pause > _ticks && _npcInfo[i].shake < _ticks) {
+ _npcInfo[i].shake = _ticks + 50;
rcDest.left = rcDest.left + (int)(RND() * 3) - 1;
rcDest.top = rcDest.top + (int)(RND() * 3) - 1;
}
@@ -658,9 +658,9 @@ void GriffonEngine::drawNPCs(int mode) {
}
// wizard
- if (_npcinfo[i].spriteset == kMonsterPriest) {
+ if (_npcInfo[i].spriteset == kMonsterPriest) {
// if(_npcinfo[i].attacking == 0) {
- int cframe = _npcinfo[i].cframe;
+ int cframe = _npcInfo[i].cframe;
rcSrc.left = (int)(cframe / 4) * 24;
rcSrc.top = wdir * 24;
@@ -672,8 +672,8 @@ void GriffonEngine::drawNPCs(int mode) {
rcDest.setWidth(24);
rcDest.setHeight(24);
- if (_npcinfo[i].pause > _ticks && _npcinfo[i].shake < _ticks) {
- _npcinfo[i].shake = _ticks + 50;
+ if (_npcInfo[i].pause > _ticks && _npcInfo[i].shake < _ticks) {
+ _npcInfo[i].shake = _ticks + 50;
rcDest.left = rcDest.left + (int)(RND() * 3) - 1;
rcDest.top = rcDest.top + (int)(RND() * 3) - 1;
}
@@ -696,8 +696,8 @@ void GriffonEngine::drawNPCs(int mode) {
// yellow dragon
- if (_npcinfo[i].spriteset == kMonsterYellowDragon) {
- int cframe = _npcinfo[i].cframe;
+ if (_npcInfo[i].spriteset == kMonsterYellowDragon) {
+ int cframe = _npcInfo[i].cframe;
rcSrc.left = (int)(cframe / 4) * 24;
rcSrc.top = wdir * 24;
@@ -709,8 +709,8 @@ void GriffonEngine::drawNPCs(int mode) {
rcDest.setWidth(24);
rcDest.setHeight(24);
- if (_npcinfo[i].pause > _ticks && _npcinfo[i].shake < _ticks) {
- _npcinfo[i].shake = _ticks + 50;
+ if (_npcInfo[i].pause > _ticks && _npcInfo[i].shake < _ticks) {
+ _npcInfo[i].shake = _ticks + 50;
rcDest.left = rcDest.left + (int)(RND() * 3) - 1;
rcDest.top = rcDest.top + (int)(RND() * 3) - 1;
}
@@ -719,13 +719,13 @@ void GriffonEngine::drawNPCs(int mode) {
// dragon2
- if (_npcinfo[i].spriteset == kMonsterDragon2) {
- if (!_npcinfo[i].attacking) {
- _npcinfo[i].floating = _npcinfo[i].floating + 0.25 * _fpsr;
- while (_npcinfo[i].floating >= 16)
- _npcinfo[i].floating = _npcinfo[i].floating - 16;
+ if (_npcInfo[i].spriteset == kMonsterDragon2) {
+ if (!_npcInfo[i].attacking) {
+ _npcInfo[i].floating = _npcInfo[i].floating + 0.25 * _fpsr;
+ while (_npcInfo[i].floating >= 16)
+ _npcInfo[i].floating = _npcInfo[i].floating - 16;
- float frame = _npcinfo[i].frame;
+ float frame = _npcInfo[i].frame;
frame += 0.5 * _fpsr;
while (frame >= 16)
@@ -735,8 +735,8 @@ void GriffonEngine::drawNPCs(int mode) {
if (cframe < 0)
cframe = 0;
- _npcinfo[i].frame = frame;
- _npcinfo[i].cframe = cframe;
+ _npcInfo[i].frame = frame;
+ _npcInfo[i].cframe = cframe;
rcSrc.left = 74 * wdir;
rcSrc.top = (int)(cframe / 4) * 48;
@@ -744,23 +744,23 @@ void GriffonEngine::drawNPCs(int mode) {
rcSrc.setHeight(48);
rcDest.left = npx + 12 - 37;
- rcDest.top = (float)(npy + 12 - 32 - 3 * sin(3.141592 * 2 * _npcinfo[i].floating / 16));
+ rcDest.top = (float)(npy + 12 - 32 - 3 * sin(3.141592 * 2 * _npcInfo[i].floating / 16));
rcDest.setWidth(24);
rcDest.setHeight(24);
- if (_npcinfo[i].pause > _ticks && _npcinfo[i].shake < _ticks) {
- _npcinfo[i].shake = _ticks + 50;
+ if (_npcInfo[i].pause > _ticks && _npcInfo[i].shake < _ticks) {
+ _npcInfo[i].shake = _ticks + 50;
rcDest.left = rcDest.left + (int)(RND() * 3) - 1;
rcDest.top = rcDest.top + (int)(RND() * 3) - 1;
}
_anims[sprite]->blit(*_videoBuffer, rcDest.left, rcDest.top, Graphics::FLIP_NONE, &rcSrc);
} else {
- _npcinfo[i].floating = _npcinfo[i].floating + 0.25 * _fpsr;
- while (_npcinfo[i].floating >= 16)
- _npcinfo[i].floating = _npcinfo[i].floating - 16;
+ _npcInfo[i].floating = _npcInfo[i].floating + 0.25 * _fpsr;
+ while (_npcInfo[i].floating >= 16)
+ _npcInfo[i].floating = _npcInfo[i].floating - 16;
- int cframe = _npcinfo[i].cattackframe;
+ int cframe = _npcInfo[i].cattackframe;
rcSrc.left = 74 * wdir;
rcSrc.top = (int)(cframe / 4) * 48;
@@ -768,7 +768,7 @@ void GriffonEngine::drawNPCs(int mode) {
rcSrc.setHeight(48);
rcDest.left = npx + 12 - 37;
- rcDest.top = (float)(npy + 12 - 32 - 3 * sin(3.141592 * 2 * _npcinfo[i].floating / 16));
+ rcDest.top = (float)(npy + 12 - 32 - 3 * sin(3.141592 * 2 * _npcInfo[i].floating / 16));
rcDest.setWidth(24);
rcDest.setHeight(24);
@@ -777,23 +777,23 @@ void GriffonEngine::drawNPCs(int mode) {
}
// end boss
- if (_npcinfo[i].spriteset == kMonsterFinalBoss) {
+ if (_npcInfo[i].spriteset == kMonsterFinalBoss) {
- _npcinfo[i].floating = _npcinfo[i].floating + .3 * _fpsr;
- while (_npcinfo[i].floating >= 16)
- _npcinfo[i].floating = _npcinfo[i].floating - 16;
+ _npcInfo[i].floating = _npcInfo[i].floating + .3 * _fpsr;
+ while (_npcInfo[i].floating >= 16)
+ _npcInfo[i].floating = _npcInfo[i].floating - 16;
- float frame = _npcinfo[i].frame2;
+ float frame = _npcInfo[i].frame2;
frame += 0.5 * _fpsr;
while (frame >= 16)
frame -= 16;
- _npcinfo[i].frame2 = frame;
+ _npcInfo[i].frame2 = frame;
int sx = npx + 12 - 40;
- int sy = (float)(npy + 12 - 50 - 3 * sin(3.141592 * 2 * _npcinfo[i].floating / 16));
+ int sy = (float)(npy + 12 - 50 - 3 * sin(3.141592 * 2 * _npcInfo[i].floating / 16));
for (int fr = 0; fr <= 3; fr++) {
_spellImg->setAlpha(128 + (int)(RND() * 96), true);
@@ -833,7 +833,7 @@ void GriffonEngine::drawNPCs(int mode) {
int ydif = (yloc + 8) - (_player.py + 12);
if ((abs(xdif) < 8 && abs(ydif) < 8) && _player.pause < _ticks) {
- float damage = (float)_npcinfo[i].spelldamage * (1.0 + RND() * 0.5);
+ float damage = (float)_npcInfo[i].spelldamage * (1.0 + RND() * 0.5);
if (_player.hp > 0) {
damagePlayer(damage);
@@ -859,7 +859,7 @@ void GriffonEngine::drawNPCs(int mode) {
ydif = (yloc + 8) - (_player.py + 12);
if ((abs(xdif) < 8 && abs(ydif) < 8) && _player.pause < _ticks) {
- float damage = (float)_npcinfo[i].spelldamage * (1.0 + RND() * 0.5);
+ float damage = (float)_npcInfo[i].spelldamage * (1.0 + RND() * 0.5);
if (_player.hp > 0) {
damagePlayer(damage);
@@ -874,7 +874,7 @@ void GriffonEngine::drawNPCs(int mode) {
_spellImg->setAlpha(255, true);
- if (!_npcinfo[i].attacking) {
+ if (!_npcInfo[i].attacking) {
int cframe = (int)(frame);
rcSrc.left = 0;
rcSrc.top = 72 * (int)(cframe / 4);
@@ -884,15 +884,15 @@ void GriffonEngine::drawNPCs(int mode) {
rcDest.left = sx;
rcDest.top = sy;
- if (_npcinfo[i].pause > _ticks && _npcinfo[i].shake < _ticks) {
- _npcinfo[i].shake = _ticks + 50;
+ if (_npcInfo[i].pause > _ticks && _npcInfo[i].shake < _ticks) {
+ _npcInfo[i].shake = _ticks + 50;
rcDest.left = rcDest.top + (int)(RND() * 3) - 1;
rcDest.left = rcDest.top + (int)(RND() * 3) - 1;
}
_anims[sprite]->blit(*_videoBuffer, rcDest.left, rcDest.top, Graphics::FLIP_NONE, &rcSrc);
} else {
- int cframe = (int)(_npcinfo[i].cattackframe);
+ int cframe = (int)(_npcInfo[i].cattackframe);
rcSrc.left = 0;
rcSrc.top = 72 * (int)(cframe / 4);
@@ -907,12 +907,12 @@ void GriffonEngine::drawNPCs(int mode) {
}
// bat kitty
- 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;
+ 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;
- float frame = _npcinfo[i].frame;
+ float frame = _npcInfo[i].frame;
frame += 0.5 * _fpsr;
while (frame >= 16)
@@ -922,8 +922,8 @@ void GriffonEngine::drawNPCs(int mode) {
if (cframe < 0)
cframe = 0;
- _npcinfo[i].frame = frame;
- _npcinfo[i].cframe = cframe;
+ _npcInfo[i].frame = frame;
+ _npcInfo[i].cframe = cframe;
rcSrc.left = 0;
rcSrc.top = 0;
@@ -931,12 +931,12 @@ void GriffonEngine::drawNPCs(int mode) {
rcSrc.setHeight(80);
rcDest.left = npx + 12 - 50;
- rcDest.top = (float)(npy + 12 - 64 + 2 * sin(3.141592 * 2 * _npcinfo[i].floating / 16));
+ rcDest.top = (float)(npy + 12 - 64 + 2 * sin(3.141592 * 2 * _npcInfo[i].floating / 16));
rcDest.setWidth(99);
rcDest.setHeight(80);
- if (_npcinfo[i].pause > _ticks && _npcinfo[i].shake < _ticks) {
- _npcinfo[i].shake = _ticks + 50;
+ if (_npcInfo[i].pause > _ticks && _npcInfo[i].shake < _ticks) {
+ _npcInfo[i].shake = _ticks + 50;
rcDest.left = rcDest.left + (int)(RND() * 3) - 1;
rcDest.top = rcDest.top + (int)(RND() * 3) - 1;
}
@@ -955,7 +955,7 @@ void GriffonEngine::drawNPCs(int mode) {
rcDest.top = npy + 23;
- int ww = 14 * _npcinfo[i].hp / _npcinfo[i].maxhp;
+ int ww = 14 * _npcInfo[i].hp / _npcInfo[i].maxhp;
ww = CLIP(ww, 1, 14);
rcDest.setWidth(ww);
@@ -966,7 +966,7 @@ void GriffonEngine::drawNPCs(int mode) {
bool pass = true;
- if (_npcinfo[i].spriteset == kMonsterBoss1)
+ if (_npcInfo[i].spriteset == kMonsterBoss1)
pass = false;
if (pass)
@@ -1034,7 +1034,7 @@ void GriffonEngine::drawPlayer() {
if (_player.armour == 3)
f = 13;
- if (!attacking) {
+ if (!_attacking) {
rcSrc.left = (int)(_player.walkFrame / 4) * 24;
rcSrc.top = _player.walkDir * 24;
rcSrc.setWidth(24);
@@ -1148,12 +1148,12 @@ void GriffonEngine::drawView() {
if (_cloudsOn) {
Common::Rect rc;
- rc.left = (float)(256 + 256 * cos(3.141592 / 180 * clouddeg));
- rc.top = (float)(192 + 192 * sin(3.141592 / 180 * clouddeg));
+ rc.left = (float)(256 + 256 * cos(3.141592 / 180 * _cloudAngle));
+ rc.top = (float)(192 + 192 * sin(3.141592 / 180 * _cloudAngle));
rc.setWidth(320);
rc.setHeight(240);
- cloudimg->blit(*_videoBuffer, 0, 0, Graphics::FLIP_NONE, &rc);
+ _cloudImg->blit(*_videoBuffer, 0, 0, Graphics::FLIP_NONE, &rc);
}
drawHud();
@@ -1188,9 +1188,9 @@ void GriffonEngine::swash() {
_fp = 0;
}
- clouddeg += 0.01 * _fpsr;
- while (clouddeg >= 360)
- clouddeg = clouddeg - 360;
+ _cloudAngle += 0.01 * _fpsr;
+ while (_cloudAngle >= 360)
+ _cloudAngle = _cloudAngle - 360;
if (y > 10)
break;
@@ -1204,12 +1204,12 @@ void GriffonEngine::swash() {
_mapBg->blit(*_videoBuffer);
if (_cloudsOn) {
- rcDest.left = (float)(256 + 256 * cos(3.141592 / 180 * clouddeg));
- rcDest.top = (float)(192 + 192 * sin(3.141592 / 180 * clouddeg));
+ rcDest.left = (float)(256 + 256 * cos(3.141592 / 180 * _cloudAngle));
+ rcDest.top = (float)(192 + 192 * sin(3.141592 / 180 * _cloudAngle));
rcDest.setWidth(320);
rcDest.setHeight(240);
- cloudimg->blit(*_videoBuffer, 0, 0, Graphics::FLIP_NONE, &rcDest);
+ _cloudImg->blit(*_videoBuffer, 0, 0, Graphics::FLIP_NONE, &rcDest);
}
g_system->copyRectToScreen(_videoBuffer->getPixels(), _videoBuffer->pitch, 0, 0, _videoBuffer->w, _videoBuffer->h);
@@ -1231,9 +1231,9 @@ void GriffonEngine::swash() {
_fp = 0;
}
- clouddeg += 0.01 * _fpsr;
- while (clouddeg >= 360)
- clouddeg -= 360;
+ _cloudAngle += 0.01 * _fpsr;
+ while (_cloudAngle >= 360)
+ _cloudAngle -= 360;
if (y > 10)
break;
diff --git a/engines/griffon/engine.cpp b/engines/griffon/engine.cpp
index 9feca285e9..9aa1c1b78a 100644
--- a/engines/griffon/engine.cpp
+++ b/engines/griffon/engine.cpp
@@ -97,10 +97,10 @@ void GriffonEngine::updateEngine() {
_secsingame = _secsingame + 1;
}
- if (attacking) {
+ if (_attacking) {
_player.attackFrame += _player.attackSpeed * _fpsr;
if (_player.attackFrame >= 16) {
- attacking = false;
+ _attacking = false;
_player.attackFrame = 0;
_player.walkFrame = 0;
}
@@ -135,20 +135,20 @@ void GriffonEngine::updateEngine() {
}
for (int i = 0; i < kMaxFloat; i++) {
- if (_floattext[i][0] > 0) {
+ if (_floatText[i][0] > 0) {
float spd = 0.5 * _fpsr;
- _floattext[i][0] = _floattext[i][0] - spd;
- _floattext[i][2] = _floattext[i][2] - spd;
- if (_floattext[i][0] < 0)
- _floattext[i][0] = 0;
+ _floatText[i][0] = _floatText[i][0] - spd;
+ _floatText[i][2] = _floatText[i][2] - spd;
+ if (_floatText[i][0] < 0)
+ _floatText[i][0] = 0;
}
- if (_floaticon[i][0] > 0) {
+ if (_floatIcon[i][0] > 0) {
float spd = 0.5 * _fpsr;
- _floaticon[i][0] = _floaticon[i][0] - spd;
- _floaticon[i][2] = _floaticon[i][2] - spd;
- if (_floaticon[i][0] < 0)
- _floaticon[i][0] = 0;
+ _floatIcon[i][0] = _floatIcon[i][0] - spd;
+ _floatIcon[i][2] = _floatIcon[i][2] - spd;
+ if (_floatIcon[i][0] < 0)
+ _floatIcon[i][0] = 0;
}
}
@@ -215,14 +215,14 @@ void GriffonEngine::updateEngine() {
if (_roomLock) {
_roomLock = false;
- for (int i = 1; i <= _lastnpc; i++)
- if (_npcinfo[i].hp > 0)
+ for (int i = 1; i <= _lastNpc; i++)
+ if (_npcInfo[i].hp > 0)
_roomLock = true;
}
- clouddeg += 0.1 * _fpsr;
- while (clouddeg >= 360)
- clouddeg = clouddeg - 360;
+ _cloudAngle += 0.1 * _fpsr;
+ while (_cloudAngle >= 360)
+ _cloudAngle = _cloudAngle - 360;
_player.hpflash = _player.hpflash + 0.1 * _fpsr;
if (_player.hpflash >= 2) {
@@ -283,7 +283,7 @@ void GriffonEngine::newGame() {
_player.nextLevel = 0;
memset(_scriptFlag, 0, sizeof(_scriptFlag));
- memset(_objmapf, 0, sizeof(_objmapf));
+ memset(_objectMapFull, 0, sizeof(_objectMapFull));
memset(_roomLocks, 0, sizeof(_roomLocks));
_roomLocks[66] = 2;
@@ -296,7 +296,7 @@ void GriffonEngine::newGame() {
_player.walkSpeed = 1.1f;
_animSpeed = 0.5f;
- attacking = false;
+ _attacking = false;
_player.attackSpeed = 1.5f;
_player.sword = 1;
diff --git a/engines/griffon/gfx.cpp b/engines/griffon/gfx.cpp
index 2ba73a0f41..de28eba922 100644
--- a/engines/griffon/gfx.cpp
+++ b/engines/griffon/gfx.cpp
@@ -42,11 +42,11 @@ namespace Griffon {
void GriffonEngine::addFloatIcon(int ico, float xloc, float yloc) {
for (int i = 0; i < kMaxFloat; i++) {
- if (ABS(_floaticon[i][0]) < kEpsilon) {
- _floaticon[i][0] = 32;
- _floaticon[i][1] = xloc;
- _floaticon[i][2] = yloc;
- _floaticon[i][3] = ico;
+ if (ABS(_floatIcon[i][0]) < kEpsilon) {
+ _floatIcon[i][0] = 32;
+ _floatIcon[i][1] = xloc;
+ _floatIcon[i][2] = yloc;
+ _floatIcon[i][3] = ico;
return;
}
}
@@ -54,12 +54,12 @@ void GriffonEngine::addFloatIcon(int ico, float xloc, float yloc) {
void GriffonEngine::addFloatText(const char *stri, float xloc, float yloc, int col) {
for (int i = 0; i < kMaxFloat; i++) {
- if (ABS(_floattext[i][0]) < kEpsilon) {
- _floattext[i][0] = 32;
- _floattext[i][1] = xloc;
- _floattext[i][2] = yloc;
- _floattext[i][3] = col;
- strcpy(_floatstri[i], stri);
+ if (ABS(_floatText[i][0]) < kEpsilon) {
+ _floatText[i][0] = 32;
+ _floatText[i][1] = xloc;
+ _floatText[i][2] = yloc;
+ _floatText[i][3] = col;
+ strcpy(_floatStr[i], stri);
return;
}
}
diff --git a/engines/griffon/griffon.cpp b/engines/griffon/griffon.cpp
index 03cf396234..ad9b665f04 100644
--- a/engines/griffon/griffon.cpp
+++ b/engines/griffon/griffon.cpp
@@ -51,7 +51,7 @@ GriffonEngine::GriffonEngine(OSystem *syst) : Engine(syst) {
_musicChannel = -1;
_menuChannel = -1;
- clouddeg = 0.0f;
+ _cloudAngle = 0.0f;
for (int i = 0; i < 33; ++i) {
for (int j = 0; j < 6; ++j)
diff --git a/engines/griffon/griffon.h b/engines/griffon/griffon.h
index 34f3c3ef3a..556a7014cd 100644
--- a/engines/griffon/griffon.h
+++ b/engines/griffon/griffon.h
@@ -423,24 +423,23 @@ private:
// saveload info
Graphics::TransparentSurface *_saveLoadImg;
-
// post info
float _postInfo[21][3];
- int nposts;
+ int _postInfoNbr;
// cloud info
- Graphics::TransparentSurface *cloudimg;
- float clouddeg;
+ Graphics::TransparentSurface *_cloudImg;
+ float _cloudAngle;
int _cloudsOn;
// spell info
- Spell spellinfo[kMaxSpell];
+ Spell _spellInfo[kMaxSpell];
// player info
- bool movingup, movingdown, movingleft, movingright;
Player _player;
- bool attacking;
Player _playera;
+ bool _movingUp, _movingDown, _movingLeft, _movingRight;
+ bool _attacking;
int _asecstart;
// tile info
@@ -455,12 +454,12 @@ private:
float _playerattackofs[4][16][3];
// [dir] [frame] [x,y ofs, completed(0/1)]
- float _floattext[kMaxFloat][4]; // [id] [framesleft, x, y, col]
- char *_floatstri[kMaxFloat];
- float _floaticon[kMaxFloat][4]; // [id] [framesleft, x, y, ico]
+ float _floatText[kMaxFloat][4]; // [id] [framesleft, x, y, col]
+ char *_floatStr[kMaxFloat];
+ float _floatIcon[kMaxFloat][4]; // [id] [framesleft, x, y, ico]
// special for animset2
- AnimSet _animset2[7], _animset9[7];
+ AnimSet _animSet2[7], _animSet9[7];
// object info
float _objectFrame[256][2];
@@ -472,18 +471,18 @@ private:
// [objnum] [frame] [x] [y] [tile/layer]
int _objectMap[21][15];
- int _objmapf[1000][21][15];
+ int _objectMapFull[1000][21][15];
// [mapnum] x, y set to 1 to make this objmap spot stay at -1
// trigger info
int _triggers[10000][9];
// [map#][index], [var]
// map#,x,y
- int _triggerloc[320][240], _ntriggers;
+ int _triggerLoc[320][240], _triggerNbr;
// npc info
- NPC _npcinfo[kMaxNPC];
- int _lastnpc;
+ NPC _npcInfo[kMaxNPC];
+ int _lastNpc;
// music info
DataChunk *_mgardens, *_mgardens2, *_mgardens3, *_mgardens4, *_mboss, *_mmenu, *_mendofgame;
diff --git a/engines/griffon/input.cpp b/engines/griffon/input.cpp
index a1dba708a5..7f8f5992b0 100644
--- a/engines/griffon/input.cpp
+++ b/engines/griffon/input.cpp
@@ -47,7 +47,7 @@ void GriffonEngine::checkInputs() {
g_system->getEventManager()->pollEvent(_event);
- nposts = 0;
+ _postInfoNbr = 0;
for (int i = 0; i <= 20; i++) {
_postInfo[i][0] = 0;
@@ -58,14 +58,14 @@ void GriffonEngine::checkInputs() {
for (int y = 0; y <= 14; y++) {
int o = _objectMap[x][y];
if (_objectInfo[o][4] == 3) {
- _postInfo[nposts][0] = x * 16;
- _postInfo[nposts][1] = y * 16;
- nposts = nposts + 1;
+ _postInfo[_postInfoNbr][0] = x * 16;
+ _postInfo[_postInfoNbr][1] = y * 16;
+ _postInfoNbr = _postInfoNbr + 1;
}
}
}
- if (attacking || (_forcePause && !_itemSelOn))
+ if (_attacking || (_forcePause && !_itemSelOn))
return;
if (_event.type == Common::EVENT_QUIT) {
@@ -138,7 +138,7 @@ void GriffonEngine::checkInputs() {
}
if (_curItem == 2 && _player.inventory[kInvShock] > 0) {
- castSpell(8, _player.px, _player.py, _npcinfo[_curEnemy].x, _npcinfo[_curEnemy].y, 0);
+ castSpell(8, _player.px, _player.py, _npcInfo[_curEnemy].x, _npcInfo[_curEnemy].y, 0);
_forcePause = true;
@@ -175,7 +175,7 @@ void GriffonEngine::checkInputs() {
}
if (_curItem == 5 && _player.spellCharge[0] == 100) {
- castSpell(5, _player.px, _player.py, _npcinfo[_curEnemy].x, _npcinfo[_curEnemy].y, 0);
+ castSpell(5, _player.px, _player.py, _npcInfo[_curEnemy].x, _npcInfo[_curEnemy].y, 0);
_player.spellCharge[0] = 0;
@@ -187,10 +187,10 @@ void GriffonEngine::checkInputs() {
}
if (_curItem > 5 && _selEnemyOn) {
- if (_curEnemy <= _lastnpc) {
- castSpell(_curItem - 6, _player.px, _player.py, _npcinfo[_curEnemy].x, _npcinfo[_curEnemy].y, 0);
+ if (_curEnemy <= _lastNpc) {
+ castSpell(_curItem - 6, _player.px, _player.py, _npcInfo[_curEnemy].x, _npcInfo[_curEnemy].y, 0);
} else {
- int pst = _curEnemy - _lastnpc - 1;
+ int pst = _curEnemy - _lastNpc - 1;
castSpell(_curItem - 6, _player.px, _player.py, _postInfo[pst][0], _postInfo[pst][1], 0);
}
@@ -212,21 +212,21 @@ void GriffonEngine::checkInputs() {
int i = 0;
do {
- if (_npcinfo[i].hp > 0) {
+ if (_npcInfo[i].hp > 0) {
_curEnemy = i;
goto __exit_do;
}
i = i + 1;
- if (i == _lastnpc + 1) {
+ if (i == _lastNpc + 1) {
_selEnemyOn = false;
goto __exit_do;
}
} while (1);
__exit_do:
- if (nposts > 0 && !_selEnemyOn) {
+ if (_postInfoNbr > 0 && !_selEnemyOn) {
_selEnemyOn = true;
- _curEnemy = _lastnpc + 1;
+ _curEnemy = _lastNpc + 1;
}
}
@@ -250,23 +250,23 @@ __exit_do:
}
if (!_itemSelOn) {
- movingup = false;
- movingdown = false;
- movingleft = false;
- movingright = false;
+ _movingUp = false;
+ _movingDown = false;
+ _movingLeft = false;
+ _movingRight = false;
if (_event.kbd.keycode == Common::KEYCODE_UP)
- movingup = true;
+ _movingUp = true;
if (_event.kbd.keycode == Common::KEYCODE_DOWN)
- movingdown = true;
+ _movingDown = true;
if (_event.kbd.keycode == Common::KEYCODE_LEFT)
- movingleft = true;
+ _movingLeft = true;
if (_event.kbd.keycode == Common::KEYCODE_RIGHT)
- movingright = true;
+ _movingRight = true;
} else {
- movingup = false;
- movingdown = false;
- movingleft = false;
- movingright = false;
+ _movingUp = false;
+ _movingDown = false;
+ _movingLeft = false;
+ _movingRight = false;
if (_selEnemyOn) {
if (_itemTicks < _ticks) {
@@ -275,12 +275,12 @@ __exit_do:
do {
_curEnemy = _curEnemy - 1;
if (_curEnemy < 1)
- _curEnemy = _lastnpc + nposts;
+ _curEnemy = _lastNpc + _postInfoNbr;
if (_curEnemy == origin)
break;
- if (_curEnemy <= _lastnpc && _npcinfo[_curEnemy].hp > 0)
+ if (_curEnemy <= _lastNpc && _npcInfo[_curEnemy].hp > 0)
break;
- if (_curEnemy > _lastnpc)
+ if (_curEnemy > _lastNpc)
break;
} while (1);
_itemTicks = _ticks + ntickdelay;
@@ -289,23 +289,23 @@ __exit_do:
int origin = _curEnemy;
do {
_curEnemy = _curEnemy + 1;
- if (_curEnemy > _lastnpc + nposts)
+ if (_curEnemy > _lastNpc + _postInfoNbr)
_curEnemy = 1;
if (_curEnemy == origin)
break;
- if (_curEnemy <= _lastnpc && _npcinfo[_curEnemy].hp > 0)
+ if (_curEnemy <= _lastNpc && _npcInfo[_curEnemy].hp > 0)
break;
- if (_curEnemy > _lastnpc)
+ if (_curEnemy > _lastNpc)
break;
} while (1);
_itemTicks = _ticks + ntickdelay;
}
- if (_curEnemy > _lastnpc + nposts)
+ if (_curEnemy > _lastNpc + _postInfoNbr)
_curEnemy = 1;
if (_curEnemy < 1)
- _curEnemy = _lastnpc + nposts;
+ _curEnemy = _lastNpc + _postInfoNbr;
}
} else {
if (_itemTicks < _ticks) {
@@ -363,20 +363,20 @@ void GriffonEngine::handleWalking() {
int ly = (int)npy / 16;
int ramp = _rampData[lx][ly];
- if (ramp == 1 && movingup)
+ if (ramp == 1 && _movingUp)
spd *= 2;
- if (ramp == 1 && movingdown)
+ if (ramp == 1 && _movingDown)
spd *= 2;
- if (ramp == 2 && movingleft)
- movingup = true;
- if (ramp == 2 && movingright)
- movingdown = true;
+ if (ramp == 2 && _movingLeft)
+ _movingUp = true;
+ if (ramp == 2 && _movingRight)
+ _movingDown = true;
- if (ramp == 3 && movingright)
- movingup = true;
- if (ramp == 3 && movingleft)
- movingdown = true;
+ if (ramp == 3 && _movingRight)
+ _movingUp = true;
+ if (ramp == 3 && _movingLeft)
+ _movingDown = true;
unsigned int *temp/*, c*/, bgc;
@@ -393,75 +393,75 @@ void GriffonEngine::handleWalking() {
}
}
- if (movingup)
+ if (_movingUp)
_player.walkDir = 0;
- if (movingdown)
+ if (_movingDown)
_player.walkDir = 1;
- if (movingleft)
+ if (_movingLeft)
_player.walkDir = 2;
- if (movingright)
+ if (_movingRight)
_player.walkDir = 3;
- if (movingup && _clipSurround[1][0] == 0) {
+ if (_movingUp && _clipSurround[1][0] == 0) {
py -= spd;
_player.walkDir = 0;
- } else if (movingup && _clipSurround[1][0] > 0) {
+ } else if (_movingUp && _clipSurround[1][0] > 0) {
// move upleft
- if (!movingright && _clipSurround[0][0] == 0) {
+ if (!_movingRight && _clipSurround[0][0] == 0) {
py -= spd;
px -= spd;
}
// move upright
- if (!movingleft && _clipSurround[2][0] == 0) {
+ if (!_movingLeft && _clipSurround[2][0] == 0) {
py -= spd;
px += spd;
}
}
- if (movingdown && _clipSurround[1][2] == 0) {
+ if (_movingDown && _clipSurround[1][2] == 0) {
py += spd;
_player.walkDir = 1;
- } else if (movingdown && _clipSurround[1][2] > 0) {
+ } else if (_movingDown && _clipSurround[1][2] > 0) {
// move downleft
- if (movingright == 0 && _clipSurround[0][2] == 0) {
+ if (_movingRight == 0 && _clipSurround[0][2] == 0) {
py += spd;
px -= spd;
}
// move downright
- if (movingleft == 0 && _clipSurround[2][2] == 0) {
+ if (_movingLeft == 0 && _clipSurround[2][2] == 0) {
py += spd;
px += spd;
}
}
- if (movingleft && _clipSurround[0][1] == 0) {
+ if (_movingLeft && _clipSurround[0][1] == 0) {
px -= spd;
_player.walkDir = 2;
- } else if (movingleft && _clipSurround[0][1] > 0) {
+ } else if (_movingLeft && _clipSurround[0][1] > 0) {
// move leftup
- if (!movingdown && _clipSurround[0][0] == 0) {
+ if (!_movingDown && _clipSurround[0][0] == 0) {
py -= spd;
px -= spd;
}
// move leftdown
- if (!movingup && _clipSurround[0][2] == 0) {
+ if (!_movingUp && _clipSurround[0][2] == 0) {
py += spd;
px -= spd;
}
}
- if (movingright && _clipSurround[2][1] == 0) {
+ if (_movingRight && _clipSurround[2][1] == 0) {
px += spd;
_player.walkDir = 3;
- } else if (movingright && _clipSurround[2][1] > 0) {
+ } else if (_movingRight && _clipSurround[2][1] > 0) {
// move rightup
- if (!movingdown && _clipSurround[2][0] == 0) {
+ if (!_movingDown && _clipSurround[2][0] == 0) {
px += spd;
py -= spd;
}
// move rightdown
- if (!movingup && _clipSurround[2][2] == 0) {
+ if (!_movingUp && _clipSurround[2][2] == 0) {
py += spd;
px += spd;
}
@@ -490,10 +490,10 @@ void GriffonEngine::handleWalking() {
// push npc
if (pass == 1) {
- for (int i = 1; i <= _lastnpc; i++) {
- if (_npcinfo[i].hp > 0) {
- npx = _npcinfo[i].x;
- npy = _npcinfo[i].y;
+ for (int i = 1; i <= _lastNpc; i++) {
+ if (_npcInfo[i].hp > 0) {
+ npx = _npcInfo[i].x;
+ npy = _npcInfo[i].y;
opx = npx;
opy = npy;
@@ -503,20 +503,20 @@ void GriffonEngine::handleWalking() {
if (_player.walkDir == 0) {
if (abs(xdif) <= 8 && ydif > 0 && ydif < 8)
- _npcinfo[i].y -= spd;
+ _npcInfo[i].y -= spd;
} else if (_player.walkDir == 1) {
if (abs(xdif) <= 8 && ydif < 0 && ydif > -8)
- _npcinfo[i].y += spd;
+ _npcInfo[i].y += spd;
} else if (_player.walkDir == 2) {
if (abs(ydif) <= 8 && xdif > 0 && xdif < 8)
- _npcinfo[i].x -= spd;
+ _npcInfo[i].x -= spd;
} else if (_player.walkDir == 3) {
if (abs(ydif) <= 8 && xdif < 0 && xdif > -8)
- _npcinfo[i].x += spd;
+ _npcInfo[i].x += spd;
}
- npx = _npcinfo[i].x;
- npy = _npcinfo[i].y;
+ npx = _npcInfo[i].x;
+ npy = _npcInfo[i].y;
sx = (int)(npx / 2 + 6);
sy = (int)(npy / 2 + 10);
@@ -524,8 +524,8 @@ void GriffonEngine::handleWalking() {
bgc = *temp;
if (bgc > 0) {
- _npcinfo[i].x = opx;
- _npcinfo[i].y = opy;
+ _npcInfo[i].x = opx;
+ _npcInfo[i].y = opy;
}
}
}
@@ -552,7 +552,7 @@ void GriffonEngine::handleWalking() {
_player.inventory[kInvFlask]++;
addFloatIcon(6, lx * 16, ly * 16);
- _objmapf[_curMap][lx][ly] = 1;
+ _objectMapFull[_curMap][lx][ly] = 1;
if (config.effects) {
int snd = playSound(_sfx[kSndPowerUp]);
@@ -566,7 +566,7 @@ void GriffonEngine::handleWalking() {
_player.inventory[kInvDoubleFlask]++;
addFloatIcon(12, lx * 16, ly * 16);
- _objmapf[_curMap][lx][ly] = 1;
+ _objectMapFull[_curMap][lx][ly] = 1;
if (config.effects) {
int snd = playSound(_sfx[kSndPowerUp]);
@@ -580,7 +580,7 @@ void GriffonEngine::handleWalking() {
_player.inventory[kInvShock]++;
addFloatIcon(17, lx * 16, ly * 16);
- _objmapf[_curMap][lx][ly] = 1;
+ _objectMapFull[_curMap][lx][ly] = 1;
if (_curMap == 41)
_scriptFlag[kScriptLightningBomb][1] = 1;
@@ -597,7 +597,7 @@ void GriffonEngine::handleWalking() {
_player.inventory[kInvShock]++;
addFloatIcon(17, lx * 16, ly * 16);
- _objmapf[_curMap][lx][ly] = 1;
+ _objectMapFull[_curMap][lx][ly] = 1;
if (config.effects) {
int snd = playSound(_sfx[kSndPowerUp]);
@@ -617,8 +617,8 @@ void GriffonEngine::checkTrigger() {
_canUseKey = false;
- if (_triggerloc[lx][ly] > -1)
- processTrigger(_triggerloc[lx][ly]);
+ if (_triggerLoc[lx][ly] > -1)
+ processTrigger(_triggerLoc[lx][ly]);
}
void GriffonEngine::processTrigger(int trignum) {
@@ -682,8 +682,8 @@ void GriffonEngine::processTrigger(int trignum) {
}
for (int i = 0; i < kMaxFloat; i++) {
- _floattext[i][0] = 0;
- _floaticon[i][0] = 0;
+ _floatText[i][0] = 0;
+ _floatIcon[i][0] = 0;
}
}
diff --git a/engines/griffon/logic.cpp b/engines/griffon/logic.cpp
index 01ee9f01ff..1918cc333f 100644
--- a/engines/griffon/logic.cpp
+++ b/engines/griffon/logic.cpp
@@ -110,8 +110,8 @@ void GriffonEngine::updateY() {
_firsty = 2400;
_lasty = 0;
- for (int i = 1; i <= _lastnpc; i++) {
- int yy = (int)(_npcinfo[i].y * 10);
+ for (int i = 1; i <= _lastNpc; i++) {
+ int yy = (int)(_npcInfo[i].y * 10);
do {
if (_ysort[yy] == -1 || yy == 2400)
@@ -128,13 +128,13 @@ void GriffonEngine::updateY() {
}
void GriffonEngine::updateNPCs() {
- for (int i = 1; i <= _lastnpc; i++) {
- if (_npcinfo[i].hp > 0) {
+ for (int i = 1; i <= _lastNpc; i++) {
+ if (_npcInfo[i].hp > 0) {
// is npc walking
int pass = 0;
- if (!_npcinfo[i].attacking)
+ if (!_npcInfo[i].attacking)
pass = 1;
- if (_npcinfo[i].spriteset == kMonsterFireHydra)
+ if (_npcInfo[i].spriteset == kMonsterFireHydra)
pass = 1;
if (pass == 1) {
bool moveup = false;
@@ -142,31 +142,31 @@ void GriffonEngine::updateNPCs() {
bool moveleft = false;
bool moveright = false;
- float npx = _npcinfo[i].x;
- float npy = _npcinfo[i].y;
+ float npx = _npcInfo[i].x;
+ float npy = _npcInfo[i].y;
float onpx = npx;
float onpy = npy;
- float wspd = _npcinfo[i].walkspd / 4;
+ float wspd = _npcInfo[i].walkspd / 4;
- if (_npcinfo[i].spriteset == kMonsterDragon2)
+ if (_npcInfo[i].spriteset == kMonsterDragon2)
wspd = wspd * 2;
- int wdir = _npcinfo[i].walkdir;
+ int wdir = _npcInfo[i].walkdir;
- int mode = _npcinfo[i].movementmode;
+ int mode = _npcInfo[i].movementmode;
float xdif = _player.px - npx;
float ydif = _player.py - npy;
if (abs(xdif) < 4 * 16 && abs(ydif) < 4 * 16 && mode < 3)
mode = 0;
- if (_npcinfo[i].hp < _npcinfo[i].maxhp * 0.25)
+ if (_npcInfo[i].hp < _npcInfo[i].maxhp * 0.25)
mode = 3;
- if (_npcinfo[i].pause > _ticks)
+ if (_npcInfo[i].pause > _ticks)
mode = -1;
- if (_npcinfo[i].spriteset == kMonsterOneWing && _npcinfo[i].castpause > _ticks)
+ if (_npcInfo[i].spriteset == kMonsterOneWing && _npcInfo[i].castpause > _ticks)
mode = -1;
if (mode == 3) {
@@ -182,7 +182,7 @@ void GriffonEngine::updateNPCs() {
// *** aggressive
if (mode == 0) {
- wspd = _npcinfo[i].walkspd / 2;
+ wspd = _npcInfo[i].walkspd / 2;
xdif = _player.px - npx;
ydif = _player.py - npy;
@@ -213,15 +213,15 @@ void GriffonEngine::updateNPCs() {
// *** defensive
if (mode == 1) {
- int movingdir = _npcinfo[i].movingdir;
+ int movingdir = _npcInfo[i].movingdir;
- if (_npcinfo[i].ticks > _ticks + 100000)
- _npcinfo[i].ticks = _ticks;
+ if (_npcInfo[i].ticks > _ticks + 100000)
+ _npcInfo[i].ticks = _ticks;
- if (_npcinfo[i].ticks < _ticks) {
- _npcinfo[i].ticks = _ticks + 2000;
+ if (_npcInfo[i].ticks < _ticks) {
+ _npcInfo[i].ticks = _ticks + 2000;
movingdir = (int)(RND() * 8);
- _npcinfo[i].movingdir = movingdir;
+ _npcInfo[i].movingdir = movingdir;
}
if (movingdir == 0) {
@@ -260,7 +260,7 @@ void GriffonEngine::updateNPCs() {
// *** run away
if (mode == 3) {
- wspd = _npcinfo[i].walkspd / 2;
+ wspd = _npcInfo[i].walkspd / 2;
xdif = _player.px - npx;
ydif = _player.py - npy;
@@ -297,7 +297,7 @@ void GriffonEngine::updateNPCs() {
float xp = (npx / 2 + 6);
float yp = (npy / 2 + 10);
- if (_npcinfo[i].spriteset == kMonsterDragon2)
+ if (_npcInfo[i].spriteset == kMonsterDragon2)
wspd = wspd * 2;
float ii = wspd * _fpsr;
@@ -309,7 +309,7 @@ void GriffonEngine::updateNPCs() {
int sy = yp - ii;
uint32 *temp = (uint32 *)_clipBg->getBasePtr(sx, sy);
uint32 dq = *temp;
- if (_npcinfo[i].spriteset == kMonsterFinalBoss)
+ if (_npcInfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0)
@@ -319,7 +319,7 @@ void GriffonEngine::updateNPCs() {
sy = yp - ii;
temp = (uint32 *)_clipBg->getBasePtr(sx, sy);
dq = *temp;
- if (_npcinfo[i].spriteset == kMonsterFinalBoss)
+ if (_npcInfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0) {
movinup = true;
@@ -331,7 +331,7 @@ void GriffonEngine::updateNPCs() {
sy = yp - ii;
temp = (uint32 *)_clipBg->getBasePtr(sx, sy);
dq = *temp;
- if (_npcinfo[i].spriteset == kMonsterFinalBoss)
+ if (_npcInfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0) {
movinup = true;
@@ -345,7 +345,7 @@ void GriffonEngine::updateNPCs() {
int sy = yp + ii;
uint32 *temp = (uint32 *)_clipBg->getBasePtr(sx, sy);
uint32 dq = *temp;
- if (_npcinfo[i].spriteset == kMonsterFinalBoss)
+ if (_npcInfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0)
movindown = true;
@@ -354,7 +354,7 @@ void GriffonEngine::updateNPCs() {
sy = yp + ii;
temp = (uint32 *)_clipBg->getBasePtr(sx, sy);
dq = *temp;
- if (_npcinfo[i].spriteset == kMonsterFinalBoss)
+ if (_npcInfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0) {
movindown = true;
@@ -366,7 +366,7 @@ void GriffonEngine::updateNPCs() {
sy = yp + ii;
temp = (uint32 *)_clipBg->getBasePtr(sx, sy);
dq = *temp;
- if (_npcinfo[i].spriteset == kMonsterFinalBoss)
+ if (_npcInfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0) {
movindown = true;
@@ -380,7 +380,7 @@ void GriffonEngine::updateNPCs() {
int sy = yp;
uint32 *temp = (uint32 *)_clipBg->getBasePtr(sx, sy);
uint32 dq = *temp;
- if (_npcinfo[i].spriteset == kMonsterFinalBoss)
+ if (_npcInfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0)
movinleft = true;
@@ -389,7 +389,7 @@ void GriffonEngine::updateNPCs() {
sy = yp - ii;
temp = (uint32 *)_clipBg->getBasePtr(sx, sy);
dq = *temp;
- if (_npcinfo[i].spriteset == kMonsterFinalBoss)
+ if (_npcInfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0) {
movinleft = true;
@@ -401,7 +401,7 @@ void GriffonEngine::updateNPCs() {
sy = yp + ii;
temp = (uint32 *)_clipBg->getBasePtr(sx, sy);
dq = *temp;
- if (_npcinfo[i].spriteset == kMonsterFinalBoss)
+ if (_npcInfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0) {
movinleft = true;
@@ -415,7 +415,7 @@ void GriffonEngine::updateNPCs() {
int sy = yp;
uint32 *temp = (uint32 *)_clipBg->getBasePtr(sx, sy);
uint32 dq = *temp;
- if (_npcinfo[i].spriteset == kMonsterFinalBoss)
+ if (_npcInfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0)
movinright = true;
@@ -424,7 +424,7 @@ void GriffonEngine::updateNPCs() {
sy = yp - ii;
temp = (uint32 *)_clipBg->getBasePtr(sx, sy);
dq = *temp;
- if (_npcinfo[i].spriteset == kMonsterFinalBoss)
+ if (_npcInfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0) {
movinright = true;
@@ -436,7 +436,7 @@ void GriffonEngine::updateNPCs() {
sy = yp + ii;
temp = (uint32 *)_clipBg->getBasePtr(sx, sy);
dq = *temp;
- if (_npcinfo[i].spriteset == kMonsterFinalBoss)
+ if (_npcInfo[i].spriteset == kMonsterFinalBoss)
dq = 0;
if (dq == 0) {
movinright = true;
@@ -456,18 +456,18 @@ void GriffonEngine::updateNPCs() {
if (checkpass) {
pass = 0;
- if (npx >= _npcinfo[i].x1 * 16 - 8 && npx <= _npcinfo[i].x2 * 16 + 8 && npy >= _npcinfo[i].y1 * 16 - 8 && npy <= _npcinfo[i].y2 * 16 + 8)
+ if (npx >= _npcInfo[i].x1 * 16 - 8 && npx <= _npcInfo[i].x2 * 16 + 8 && npy >= _npcInfo[i].y1 * 16 - 8 && npy <= _npcInfo[i].y2 * 16 + 8)
pass = 1;
if (pass == 0) {
npx = onpx;
npy = onpy;
- _npcinfo[i].ticks = _ticks;
+ _npcInfo[i].ticks = _ticks;
}
}
float aspd = wspd;
- if (_npcinfo[i].spriteset == kMonsterDragon2)
+ if (_npcInfo[i].spriteset == kMonsterDragon2)
aspd = wspd / 2;
xp = (npx / 2 + 6);
@@ -484,14 +484,14 @@ void GriffonEngine::updateNPCs() {
int lx = (int)anpx / 16;
int ly = (int)anpy / 16;
- if (_triggerloc[lx][ly] > -1)
+ if (_triggerLoc[lx][ly] > -1)
bgc = 1;
- if (_npcinfo[i].spriteset == kMonsterFinalBoss)
+ if (_npcInfo[i].spriteset == kMonsterFinalBoss)
bgc = 0;
bool rst = false;
- if (_npcinfo[i].spriteset == kMonsterFinalBoss) {
+ if (_npcInfo[i].spriteset == kMonsterFinalBoss) {
if (npx < 40 || npx > 280 || npy < 36 || npy > 204)
rst = true;
}
@@ -501,17 +501,17 @@ void GriffonEngine::updateNPCs() {
npy = onpy;
}
- _npcinfo[i].x = npx;
- _npcinfo[i].y = npy;
+ _npcInfo[i].x = npx;
+ _npcInfo[i].y = npy;
- _npcinfo[i].walkdir = wdir;
- _npcinfo[i].moving = false;
+ _npcInfo[i].walkdir = wdir;
+ _npcInfo[i].moving = false;
if (npx != onpx || npy != onpy)
- _npcinfo[i].moving = true;
+ _npcInfo[i].moving = true;
- if (_npcinfo[i].moving) {
- float frame = _npcinfo[i].frame;
+ if (_npcInfo[i].moving) {
+ float frame = _npcInfo[i].frame;
frame += aspd * _fpsr;
while (frame >= 16)
@@ -521,29 +521,29 @@ void GriffonEngine::updateNPCs() {
if (cframe < 0)
cframe = 0;
- _npcinfo[i].frame = frame;
- _npcinfo[i].cframe = cframe;
+ _npcInfo[i].frame = frame;
+ _npcInfo[i].cframe = cframe;
}
// spriteset1 specific
- if (_npcinfo[i].spriteset == kMonsterBabyDragon && _npcinfo[i].attackattempt < _ticks) {
- if (_npcinfo[i].attacknext < _ticks && _npcinfo[i].pause < _ticks && !_npcinfo[i].attacking) {
- npx = _npcinfo[i].x;
- npy = _npcinfo[i].y;
+ if (_npcInfo[i].spriteset == kMonsterBabyDragon && _npcInfo[i].attackattempt < _ticks) {
+ if (_npcInfo[i].attacknext < _ticks && _npcInfo[i].pause < _ticks && !_npcInfo[i].attacking) {
+ npx = _npcInfo[i].x;
+ npy = _npcInfo[i].y;
xdif = _player.px - npx;
ydif = _player.py - npy;
if (abs(xdif) < 20 && abs(ydif) < 20) {
- _npcinfo[i].attackattempt = _ticks + 100;
+ _npcInfo[i].attackattempt = _ticks + 100;
if ((int)(RND() * 2) == 0) {
if (config.effects) {
int snd = playSound(_sfx[kSndEnemyHit]);
setChannelVolume(snd, config.effectsvol);
}
- _npcinfo[i].attacking = true;
- _npcinfo[i].attackframe = 0;
+ _npcInfo[i].attacking = true;
+ _npcInfo[i].attackframe = 0;
}
}
}
@@ -552,10 +552,10 @@ void GriffonEngine::updateNPCs() {
bool dospell = false;
// onewing specific
- if (_npcinfo[i].spriteset == kMonsterOneWing) {
- if (_npcinfo[i].attacknext < _ticks && _npcinfo[i].pause < _ticks && !_npcinfo[i].attacking) {
- npx = _npcinfo[i].x;
- npy = _npcinfo[i].y;
+ if (_npcInfo[i].spriteset == kMonsterOneWing) {
+ if (_npcInfo[i].attacknext < _ticks && _npcInfo[i].pause < _ticks && !_npcInfo[i].attacking) {
+ npx = _npcInfo[i].x;
+ npy = _npcInfo[i].y;
xdif = _player.px - npx;
ydif = _player.py - npy;
@@ -569,11 +569,11 @@ void GriffonEngine::updateNPCs() {
setChannelVolume(snd, config.effectsvol);
}
- _npcinfo[i].attacking = true;
- _npcinfo[i].attackframe = 0;
+ _npcInfo[i].attacking = true;
+ _npcInfo[i].attackframe = 0;
- _npcinfo[i].headtargetx[0] = _player.px + 12;
- _npcinfo[i].headtargety[0] = _player.py - 4;
+ _npcInfo[i].headtargetx[0] = _player.px + 12;
+ _npcInfo[i].headtargety[0] = _player.py - 4;
}
}
@@ -581,87 +581,87 @@ void GriffonEngine::updateNPCs() {
dospell = false;
- if (!_npcinfo[i].attacking && _npcinfo[i].castpause < _ticks) {
- _npcinfo[i].swayspd = _npcinfo[i].swayspd + _npcinfo[i].swayspd / 200 * _fpsr;
- if (_npcinfo[i].swayspd > 15) {
+ if (!_npcInfo[i].attacking && _npcInfo[i].castpause < _ticks) {
+ _npcInfo[i].swayspd = _npcInfo[i].swayspd + _npcInfo[i].swayspd / 200 * _fpsr;
+ if (_npcInfo[i].swayspd > 15) {
dospell = true;
- _npcinfo[i].swayspd = 1;
+ _npcInfo[i].swayspd = 1;
}
// sway code
- _npcinfo[i].swayangle = _npcinfo[i].swayangle + _npcinfo[i].swayspd * _fpsr;
- if (_npcinfo[i].swayangle >= 360)
- _npcinfo[i].swayangle = _npcinfo[i].swayangle - 360;
+ _npcInfo[i].swayangle = _npcInfo[i].swayangle + _npcInfo[i].swayspd * _fpsr;
+ if (_npcInfo[i].swayangle >= 360)
+ _npcInfo[i].swayangle = _npcInfo[i].swayangle - 360;
- _npcinfo[i].headtargetx[0] = _npcinfo[i].x + (24 - _npcinfo[i].swayspd / 2) * sin(3.14159 / 180 * _npcinfo[i].swayangle) + 12;
- _npcinfo[i].headtargety[0] = _npcinfo[i].y - 36 + 16 + 8 * sin(3.14159 * 2 / 180 * _npcinfo[i].swayangle);
+ _npcInfo[i].headtargetx[0] = _npcInfo[i].x + (24 - _npcInfo[i].swayspd / 2) * sin(3.14159 / 180 * _npcInfo[i].swayangle) + 12;
+ _npcInfo[i].headtargety[0] = _npcInfo[i].y - 36 + 16 + 8 * sin(3.14159 * 2 / 180 * _npcInfo[i].swayangle);
}
if (dospell) {
- _npcinfo[i].pause = _ticks + 3000;
- _npcinfo[i].attacknext = _ticks + 4500;
- _npcinfo[i].castpause = _ticks + 4500;
+ _npcInfo[i].pause = _ticks + 3000;
+ _npcInfo[i].attacknext = _ticks + 4500;
+ _npcInfo[i].castpause = _ticks + 4500;
- castSpell(3, _npcinfo[i].x, _npcinfo[i].y, _npcinfo[i].x, _npcinfo[i].y, i);
+ castSpell(3, _npcInfo[i].x, _npcInfo[i].y, _npcInfo[i].x, _npcInfo[i].y, i);
- _npcinfo[i].headtargetx[0] = _npcinfo[i].x;
- _npcinfo[i].headtargety[0] = _npcinfo[i].y - 36 + 16;
+ _npcInfo[i].headtargetx[0] = _npcInfo[i].x;
+ _npcInfo[i].headtargety[0] = _npcInfo[i].y - 36 + 16;
}
// targethead code
- xdif = _npcinfo[i].bodysection[7].x - _npcinfo[i].headtargetx[0];
- ydif = _npcinfo[i].bodysection[7].y - _npcinfo[i].headtargety[0];
+ xdif = _npcInfo[i].bodysection[7].x - _npcInfo[i].headtargetx[0];
+ ydif = _npcInfo[i].bodysection[7].y - _npcInfo[i].headtargety[0];
- _npcinfo[i].bodysection[7].x = _npcinfo[i].bodysection[7].x - xdif * 0.4 * _fpsr;
- _npcinfo[i].bodysection[7].y = _npcinfo[i].bodysection[7].y - ydif * 0.4 * _fpsr;
+ _npcInfo[i].bodysection[7].x = _npcInfo[i].bodysection[7].x - xdif * 0.4 * _fpsr;
+ _npcInfo[i].bodysection[7].y = _npcInfo[i].bodysection[7].y - ydif * 0.4 * _fpsr;
- _npcinfo[i].bodysection[0].x = _npcinfo[i].x + 12;
- _npcinfo[i].bodysection[0].y = _npcinfo[i].y + 12;
+ _npcInfo[i].bodysection[0].x = _npcInfo[i].x + 12;
+ _npcInfo[i].bodysection[0].y = _npcInfo[i].y + 12;
for (int f = 6; f >= 1; f--) {
- xdif = _npcinfo[i].bodysection[f + 1].x - _npcinfo[i].bodysection[f - 1].x;
- ydif = _npcinfo[i].bodysection[f + 1].y - _npcinfo[i].bodysection[f - 1].y;
+ xdif = _npcInfo[i].bodysection[f + 1].x - _npcInfo[i].bodysection[f - 1].x;
+ ydif = _npcInfo[i].bodysection[f + 1].y - _npcInfo[i].bodysection[f - 1].y;
- float tx = _npcinfo[i].bodysection[f - 1].x + xdif / 2;
- float ty = _npcinfo[i].bodysection[f - 1].y + ydif / 2;
+ float tx = _npcInfo[i].bodysection[f - 1].x + xdif / 2;
+ float ty = _npcInfo[i].bodysection[f - 1].y + ydif / 2;
- _npcinfo[i].bodysection[f].x = _npcinfo[i].bodysection[f].x - (_npcinfo[i].bodysection[f].x - tx) / 3;
- _npcinfo[i].bodysection[f].y = _npcinfo[i].bodysection[f].y - (_npcinfo[i].bodysection[f].y - ty) / 3;
+ _npcInfo[i].bodysection[f].x = _npcInfo[i].bodysection[f].x - (_npcInfo[i].bodysection[f].x - tx) / 3;
+ _npcInfo[i].bodysection[f].y = _npcInfo[i].bodysection[f].y - (_npcInfo[i].bodysection[f].y - ty) / 3;
}
}
// boss1 specific and blackknight
- if (_npcinfo[i].spriteset == kMonsterBoss1 || _npcinfo[i].spriteset == kMonsterBlackKnight) {
- if (_npcinfo[i].attacknext < _ticks && _npcinfo[i].pause < _ticks && !_npcinfo[i].attacking) {
- _npcinfo[i].attacking = true;
- _npcinfo[i].attackframe = 0;
+ if (_npcInfo[i].spriteset == kMonsterBoss1 || _npcInfo[i].spriteset == kMonsterBlackKnight) {
+ if (_npcInfo[i].attacknext < _ticks && _npcInfo[i].pause < _ticks && !_npcInfo[i].attacking) {
+ _npcInfo[i].attacking = true;
+ _npcInfo[i].attackframe = 0;
- castSpell(1, _npcinfo[i].x, _npcinfo[i].y, _player.px, _player.py, i);
+ castSpell(1, _npcInfo[i].x, _npcInfo[i].y, _player.px, _player.py, i);
}
- if (_npcinfo[i].castpause < _ticks) {
- castSpell(6, _npcinfo[i].x, _npcinfo[i].y, _player.px, _player.py, i);
- _npcinfo[i].castpause = _ticks + 12000;
+ if (_npcInfo[i].castpause < _ticks) {
+ castSpell(6, _npcInfo[i].x, _npcInfo[i].y, _player.px, _player.py, i);
+ _npcInfo[i].castpause = _ticks + 12000;
}
}
// firehydra specific
- if (_npcinfo[i].spriteset == kMonsterFireHydra) {
- _npcinfo[i].swayspd = 4;
+ if (_npcInfo[i].spriteset == kMonsterFireHydra) {
+ _npcInfo[i].swayspd = 4;
// sway code
- _npcinfo[i].swayangle = _npcinfo[i].swayangle + _npcinfo[i].swayspd * _fpsr;
- if (_npcinfo[i].swayangle >= 360)
- _npcinfo[i].swayangle = _npcinfo[i].swayangle - 360;
+ _npcInfo[i].swayangle = _npcInfo[i].swayangle + _npcInfo[i].swayspd * _fpsr;
+ if (_npcInfo[i].swayangle >= 360)
+ _npcInfo[i].swayangle = _npcInfo[i].swayangle - 360;
for (int ff = 0; ff <= 2; ff++) {
- if (_npcinfo[i].hp > 10 * ff * 20) {
- if (_npcinfo[i].pause < _ticks && _npcinfo[i].attacking2[ff] == 0 && _npcinfo[i].attacknext2[ff] < _ticks) {
- npx = _npcinfo[i].x;
- npy = _npcinfo[i].y;
+ if (_npcInfo[i].hp > 10 * ff * 20) {
+ if (_npcInfo[i].pause < _ticks && _npcInfo[i].attacking2[ff] == 0 && _npcInfo[i].attacknext2[ff] < _ticks) {
+ npx = _npcInfo[i].x;
+ npy = _npcInfo[i].y;
xdif = _player.px - npx;
ydif = _player.py - npy;
@@ -675,53 +675,53 @@ void GriffonEngine::updateNPCs() {
setChannelVolume(snd, config.effectsvol);
}
- _npcinfo[i].attacking = true;
- _npcinfo[i].attacking2[ff] = 1;
- _npcinfo[i].attackframe2[ff] = 0;
+ _npcInfo[i].attacking = true;
+ _npcInfo[i].attacking2[ff] = 1;
+ _npcInfo[i].attackframe2[ff] = 0;
- _npcinfo[i].headtargetx[ff] = _player.px + 12;
- _npcinfo[i].headtargety[ff] = _player.py - 4;
+ _npcInfo[i].headtargetx[ff] = _player.px + 12;
+ _npcInfo[i].headtargety[ff] = _player.py - 4;
- _npcinfo[i].swayangle = 0;
+ _npcInfo[i].swayangle = 0;
}
}
}
- if (_npcinfo[i].attacking2[ff] == 0) {
- _npcinfo[i].headtargetx[ff] = _npcinfo[i].x + 38 * sin(3.14159 / 180 * (_npcinfo[i].swayangle + 120 * ff)) + 12;
- _npcinfo[i].headtargety[ff] = _npcinfo[i].y - 46 + 16 + 16 * sin(3.14159 * 2 / 180 * (_npcinfo[i].swayangle + 120 * ff));
+ if (_npcInfo[i].attacking2[ff] == 0) {
+ _npcInfo[i].headtargetx[ff] = _npcInfo[i].x + 38 * sin(3.14159 / 180 * (_npcInfo[i].swayangle + 120 * ff)) + 12;
+ _npcInfo[i].headtargety[ff] = _npcInfo[i].y - 46 + 16 + 16 * sin(3.14159 * 2 / 180 * (_npcInfo[i].swayangle + 120 * ff));
}
// targethead code
- xdif = _npcinfo[i].bodysection[10 * ff + 9].x - _npcinfo[i].headtargetx[ff];
- ydif = _npcinfo[i].bodysection[10 * ff + 9].y - _npcinfo[i].headtargety[ff];
+ xdif = _npcInfo[i].bodysection[10 * ff + 9].x - _npcInfo[i].headtargetx[ff];
+ ydif = _npcInfo[i].bodysection[10 * ff + 9].y - _npcInfo[i].headtargety[ff];
- _npcinfo[i].bodysection[10 * ff + 9].x = _npcinfo[i].bodysection[10 * ff + 9].x - xdif * 0.4 * _fpsr;
- _npcinfo[i].bodysection[10 * ff + 9].y = _npcinfo[i].bodysection[10 * ff + 9].y - ydif * 0.4 * _fpsr;
+ _npcInfo[i].bodysection[10 * ff + 9].x = _npcInfo[i].bodysection[10 * ff + 9].x - xdif * 0.4 * _fpsr;
+ _npcInfo[i].bodysection[10 * ff + 9].y = _npcInfo[i].bodysection[10 * ff + 9].y - ydif * 0.4 * _fpsr;
- _npcinfo[i].bodysection[10 * ff].x = _npcinfo[i].x + 12 + 8 * cos(3.141592 * 2 * (_itemyloc / 16 + ff * 120 / 360));
- _npcinfo[i].bodysection[10 * ff].y = _npcinfo[i].y + 12 + 8 * sin(3.141592 * 2 * (_itemyloc / 16 + ff * 120 / 360));
+ _npcInfo[i].bodysection[10 * ff].x = _npcInfo[i].x + 12 + 8 * cos(3.141592 * 2 * (_itemyloc / 16 + ff * 120 / 360));
+ _npcInfo[i].bodysection[10 * ff].y = _npcInfo[i].y + 12 + 8 * sin(3.141592 * 2 * (_itemyloc / 16 + ff * 120 / 360));
for (int f = 8; f >= 1; f--) {
- xdif = _npcinfo[i].bodysection[ff * 10 + f + 1].x - _npcinfo[i].bodysection[ff * 10 + f - 1].x;
- ydif = _npcinfo[i].bodysection[ff * 10 + f + 1].y - _npcinfo[i].bodysection[ff * 10 + f - 1].y;
+ xdif = _npcInfo[i].bodysection[ff * 10 + f + 1].x - _npcInfo[i].bodysection[ff * 10 + f - 1].x;
+ ydif = _npcInfo[i].bodysection[ff * 10 + f + 1].y - _npcInfo[i].bodysection[ff * 10 + f - 1].y;
- float tx = _npcinfo[i].bodysection[ff * 10 + f - 1].x + xdif / 2;
- float ty = _npcinfo[i].bodysection[ff * 10 + f - 1].y + ydif / 2;
+ float tx = _npcInfo[i].bodysection[ff * 10 + f - 1].x + xdif / 2;
+ float ty = _npcInfo[i].bodysection[ff * 10 + f - 1].y + ydif / 2;
- _npcinfo[i].bodysection[ff * 10 + f].x = _npcinfo[i].bodysection[ff * 10 + f].x - (_npcinfo[i].bodysection[ff * 10 + f].x - tx) / 3;
- _npcinfo[i].bodysection[ff * 10 + f].y = _npcinfo[i].bodysection[ff * 10 + f].y - (_npcinfo[i].bodysection[ff * 10 + f].y - ty) / 3;
+ _npcInfo[i].bodysection[ff * 10 + f].x = _npcInfo[i].bodysection[ff * 10 + f].x - (_npcInfo[i].bodysection[ff * 10 + f].x - tx) / 3;
+ _npcInfo[i].bodysection[ff * 10 + f].y = _npcInfo[i].bodysection[ff * 10 + f].y - (_npcInfo[i].bodysection[ff * 10 + f].y - ty) / 3;
}
}
}
}
// spriteset6 specific
- if (_npcinfo[i].spriteset == kMonsterRedDragon && _npcinfo[i].attackattempt < _ticks) {
- if (_npcinfo[i].attacknext < _ticks && _npcinfo[i].pause < _ticks && !_npcinfo[i].attacking) {
- npx = _npcinfo[i].x;
- npy = _npcinfo[i].y;
+ if (_npcInfo[i].spriteset == kMonsterRedDragon && _npcInfo[i].attackattempt < _ticks) {
+ if (_npcInfo[i].attacknext < _ticks && _npcInfo[i].pause < _ticks && !_npcInfo[i].attacking) {
+ npx = _npcInfo[i].x;
+ npy = _npcInfo[i].y;
xdif = _player.px - npx;
ydif = _player.py - npy;
@@ -733,10 +733,10 @@ void GriffonEngine::updateNPCs() {
pass = 2;
if (pass > 0) {
- _npcinfo[i].attackattempt = _ticks + 100;
+ _npcInfo[i].attackattempt = _ticks + 100;
if ((int)(RND() * 2) == 0) {
- _npcinfo[i].attacking = true;
- _npcinfo[i].attackframe = 0;
+ _npcInfo[i].attacking = true;
+ _npcInfo[i].attackframe = 0;
float nnxa = 0, nnya = 0, nnxb = 0, nnyb = 0;
if (pass == 1 && xdif < 0) {
@@ -768,15 +768,15 @@ void GriffonEngine::updateNPCs() {
}
// wizard1 specific
- if (_npcinfo[i].spriteset == kMonsterPriest) {
- if (_npcinfo[i].attacknext < _ticks && _npcinfo[i].pause < _ticks && !_npcinfo[i].attacking) {
- _npcinfo[i].attacking = true;
- _npcinfo[i].attackframe = 0;
+ if (_npcInfo[i].spriteset == kMonsterPriest) {
+ if (_npcInfo[i].attacknext < _ticks && _npcInfo[i].pause < _ticks && !_npcInfo[i].attacking) {
+ _npcInfo[i].attacking = true;
+ _npcInfo[i].attackframe = 0;
- castSpell(9, _npcinfo[i].x, _npcinfo[i].y, _player.px, _player.py, i);
+ castSpell(9, _npcInfo[i].x, _npcInfo[i].y, _player.px, _player.py, i);
}
- if (_npcinfo[i].castpause < _ticks) {
+ if (_npcInfo[i].castpause < _ticks) {
// castSpell 6, _npcinfo[i].x, _npcinfo[i].y, _player.px, _player.py, i
// _npcinfo[i].castpause = _ticks + 12000
}
@@ -784,10 +784,10 @@ void GriffonEngine::updateNPCs() {
}
// spriteset6 specific
- if (_npcinfo[i].spriteset == kMonsterYellowDragon && _npcinfo[i].attackattempt < _ticks) {
- if (_npcinfo[i].attacknext < _ticks && _npcinfo[i].pause < _ticks && !_npcinfo[i].attacking) {
- npx = _npcinfo[i].x;
- npy = _npcinfo[i].y;
+ if (_npcInfo[i].spriteset == kMonsterYellowDragon && _npcInfo[i].attackattempt < _ticks) {
+ if (_npcInfo[i].attacknext < _ticks && _npcInfo[i].pause < _ticks && !_npcInfo[i].attacking) {
+ npx = _npcInfo[i].x;
+ npy = _npcInfo[i].y;
xdif = _player.px - npx;
ydif = _player.py - npy;
@@ -799,10 +799,10 @@ void GriffonEngine::updateNPCs() {
pass = 2;
if (pass > 0) {
- _npcinfo[i].attackattempt = _ticks + 100;
+ _npcInfo[i].attackattempt = _ticks + 100;
if ((int)(RND() * 2) == 0) {
- _npcinfo[i].attacking = true;
- _npcinfo[i].attackframe = 0;
+ _npcInfo[i].attacking = true;
+ _npcInfo[i].attackframe = 0;
float nnxa = 0, nnya = 0, nnxb = 0, nnyb = 0;
if (pass == 1 && xdif < 0) {
@@ -810,25 +810,25 @@ void GriffonEngine::updateNPCs() {
nnya = npy + 4;
nnxb = npx - 56 - 8;
nnyb = npy + 4;
- _npcinfo[i].walkdir = 2;
+ _npcInfo[i].walkdir = 2;
} else if (pass == 1 && xdif > 0) {
nnxa = npx + 16;
nnya = npy + 4;
nnxb = npx + 16 + 56;
nnyb = npy + 4;
- _npcinfo[i].walkdir = 3;
+ _npcInfo[i].walkdir = 3;
} else if (pass == 2 && ydif < 0) {
nnya = npy;
nnxa = npx + 4;
nnyb = npy - 56;
nnxb = npx + 4;
- _npcinfo[i].walkdir = 0;
+ _npcInfo[i].walkdir = 0;
} else if (pass == 2 && ydif > 0) {
nnya = npy + 20;
nnxa = npx + 4;
nnyb = npy + 20 + 56;
nnxb = npx + 4;
- _npcinfo[i].walkdir = 1;
+ _npcInfo[i].walkdir = 1;
}
castSpell(7, nnxa, nnya, nnxb, nnyb, i);
@@ -838,10 +838,10 @@ void GriffonEngine::updateNPCs() {
}
// twowing specific
- if (_npcinfo[i].spriteset == kMonsterTwoWing) {
- if (_npcinfo[i].attacknext < _ticks && _npcinfo[i].pause < _ticks && !_npcinfo[i].attacking) {
- npx = _npcinfo[i].bodysection[7].x;
- npy = _npcinfo[i].bodysection[7].y;
+ if (_npcInfo[i].spriteset == kMonsterTwoWing) {
+ if (_npcInfo[i].attacknext < _ticks && _npcInfo[i].pause < _ticks && !_npcInfo[i].attacking) {
+ npx = _npcInfo[i].bodysection[7].x;
+ npy = _npcInfo[i].bodysection[7].y;
xdif = _player.px - npx;
ydif = _player.py - npy;
@@ -855,82 +855,82 @@ void GriffonEngine::updateNPCs() {
setChannelVolume(snd, config.effectsvol);
}
- _npcinfo[i].attacking = true;
- _npcinfo[i].attackframe = 0;
+ _npcInfo[i].attacking = true;
+ _npcInfo[i].attackframe = 0;
- _npcinfo[i].headtargetx[0] = _player.px + 12;
- _npcinfo[i].headtargety[0] = _player.py - 4;
+ _npcInfo[i].headtargetx[0] = _player.px + 12;
+ _npcInfo[i].headtargety[0] = _player.py - 4;
}
}
}
- if (!_npcinfo[i].attacking && _npcinfo[i].castpause < _ticks) {
- _npcinfo[i].swayspd = 4;
+ if (!_npcInfo[i].attacking && _npcInfo[i].castpause < _ticks) {
+ _npcInfo[i].swayspd = 4;
// sway code
- _npcinfo[i].swayangle = _npcinfo[i].swayangle + _npcinfo[i].swayspd * _fpsr;
- if (_npcinfo[i].swayangle >= 360)
- _npcinfo[i].swayangle = _npcinfo[i].swayangle - 360;
+ _npcInfo[i].swayangle = _npcInfo[i].swayangle + _npcInfo[i].swayspd * _fpsr;
+ if (_npcInfo[i].swayangle >= 360)
+ _npcInfo[i].swayangle = _npcInfo[i].swayangle - 360;
- _npcinfo[i].headtargetx[0] = _npcinfo[i].x + (24 - _npcinfo[i].swayspd / 2) * sin(3.14159 / 180 * _npcinfo[i].swayangle) + 12;
- _npcinfo[i].headtargety[0] = _npcinfo[i].y - 36 + 16 + 8 * sin(3.14159 * 2 / 180 * _npcinfo[i].swayangle);
+ _npcInfo[i].headtargetx[0] = _npcInfo[i].x + (24 - _npcInfo[i].swayspd / 2) * sin(3.14159 / 180 * _npcInfo[i].swayangle) + 12;
+ _npcInfo[i].headtargety[0] = _npcInfo[i].y - 36 + 16 + 8 * sin(3.14159 * 2 / 180 * _npcInfo[i].swayangle);
}
if (dospell) {
- _npcinfo[i].pause = _ticks + 3000;
- _npcinfo[i].attacknext = _ticks + 5000;
- _npcinfo[i].castpause = _ticks + 3000;
+ _npcInfo[i].pause = _ticks + 3000;
+ _npcInfo[i].attacknext = _ticks + 5000;
+ _npcInfo[i].castpause = _ticks + 3000;
- castSpell(3, _npcinfo[i].x, _npcinfo[i].y, _npcinfo[i].x, _npcinfo[i].y, i);
+ castSpell(3, _npcInfo[i].x, _npcInfo[i].y, _npcInfo[i].x, _npcInfo[i].y, i);
- _npcinfo[i].headtargetx[0] = _npcinfo[i].x;
- _npcinfo[i].headtargety[0] = _npcinfo[i].y - 36 + 16;
+ _npcInfo[i].headtargetx[0] = _npcInfo[i].x;
+ _npcInfo[i].headtargety[0] = _npcInfo[i].y - 36 + 16;
}
// targethead code
- xdif = _npcinfo[i].bodysection[7].x - _npcinfo[i].headtargetx[0];
- ydif = _npcinfo[i].bodysection[7].y - _npcinfo[i].headtargety[0];
+ xdif = _npcInfo[i].bodysection[7].x - _npcInfo[i].headtargetx[0];
+ ydif = _npcInfo[i].bodysection[7].y - _npcInfo[i].headtargety[0];
- _npcinfo[i].bodysection[7].x = _npcinfo[i].bodysection[7].x - xdif * 0.4 * _fpsr;
- _npcinfo[i].bodysection[7].y = _npcinfo[i].bodysection[7].y - ydif * 0.4 * _fpsr;
+ _npcInfo[i].bodysection[7].x = _npcInfo[i].bodysection[7].x - xdif * 0.4 * _fpsr;
+ _npcInfo[i].bodysection[7].y = _npcInfo[i].bodysection[7].y - ydif * 0.4 * _fpsr;
- _npcinfo[i].bodysection[0].x = _npcinfo[i].x + 12;
- _npcinfo[i].bodysection[0].y = _npcinfo[i].y + 12;
+ _npcInfo[i].bodysection[0].x = _npcInfo[i].x + 12;
+ _npcInfo[i].bodysection[0].y = _npcInfo[i].y + 12;
for (int f = 6; f >= 1; f--) {
- xdif = _npcinfo[i].bodysection[f + 1].x - _npcinfo[i].bodysection[f - 1].x;
- ydif = _npcinfo[i].bodysection[f + 1].y - _npcinfo[i].bodysection[f - 1].y;
+ xdif = _npcInfo[i].bodysection[f + 1].x - _npcInfo[i].bodysection[f - 1].x;
+ ydif = _npcInfo[i].bodysection[f + 1].y - _npcInfo[i].bodysection[f - 1].y;
- float tx = _npcinfo[i].bodysection[f - 1].x + xdif / 2;
- float ty = _npcinfo[i].bodysection[f - 1].y + ydif / 2;
+ float tx = _npcInfo[i].bodysection[f - 1].x + xdif / 2;
+ float ty = _npcInfo[i].bodysection[f - 1].y + ydif / 2;
- _npcinfo[i].bodysection[f].x = _npcinfo[i].bodysection[f].x - (_npcinfo[i].bodysection[f].x - tx) / 3;
- _npcinfo[i].bodysection[f].y = _npcinfo[i].bodysection[f].y - (_npcinfo[i].bodysection[f].y - ty) / 3;
+ _npcInfo[i].bodysection[f].x = _npcInfo[i].bodysection[f].x - (_npcInfo[i].bodysection[f].x - tx) / 3;
+ _npcInfo[i].bodysection[f].y = _npcInfo[i].bodysection[f].y - (_npcInfo[i].bodysection[f].y - ty) / 3;
}
}
// dragon2 specific
- if (_npcinfo[i].spriteset == kMonsterDragon2 && _npcinfo[i].attackattempt < _ticks) {
- if (_npcinfo[i].attacknext < _ticks && _npcinfo[i].pause < _ticks && !_npcinfo[i].attacking) {
- npx = _npcinfo[i].x;
- npy = _npcinfo[i].y;
+ if (_npcInfo[i].spriteset == kMonsterDragon2 && _npcInfo[i].attackattempt < _ticks) {
+ if (_npcInfo[i].attacknext < _ticks && _npcInfo[i].pause < _ticks && !_npcInfo[i].attacking) {
+ npx = _npcInfo[i].x;
+ npy = _npcInfo[i].y;
xdif = _player.px - npx;
ydif = _player.py - npy;
if (abs(xdif) < 32 && abs(ydif) < 32) {
- _npcinfo[i].attackattempt = _ticks + 100;
+ _npcInfo[i].attackattempt = _ticks + 100;
if ((int)(RND() * 2) == 0) {
if (config.effects) {
int snd = playSound(_sfx[kSndEnemyHit]);
setChannelVolume(snd, config.effectsvol);
}
- _npcinfo[i].attacking = true;
- _npcinfo[i].attackframe = 0;
+ _npcInfo[i].attacking = true;
+ _npcInfo[i].attackframe = 0;
}
}
}
@@ -938,23 +938,23 @@ void GriffonEngine::updateNPCs() {
// endboss specific
- if (_npcinfo[i].spriteset == kMonsterFinalBoss && _npcinfo[i].attackattempt < _ticks) {
- if (_npcinfo[i].attacknext < _ticks && _npcinfo[i].pause < _ticks && !_npcinfo[i].attacking) {
- npx = _npcinfo[i].x;
- npy = _npcinfo[i].y;
+ if (_npcInfo[i].spriteset == kMonsterFinalBoss && _npcInfo[i].attackattempt < _ticks) {
+ if (_npcInfo[i].attacknext < _ticks && _npcInfo[i].pause < _ticks && !_npcInfo[i].attacking) {
+ npx = _npcInfo[i].x;
+ npy = _npcInfo[i].y;
xdif = _player.px - npx;
ydif = _player.py - npy;
if (abs(xdif) < 38 && abs(ydif) < 38) {
- _npcinfo[i].attackattempt = _ticks + 100;
+ _npcInfo[i].attackattempt = _ticks + 100;
if ((int)(RND() * 2) == 0) {
if (config.effects) {
int snd = playSound(_sfx[kSndIce]);
setChannelVolume(snd, config.effectsvol);
}
- _npcinfo[i].attacking = true;
- _npcinfo[i].attackframe = 0;
+ _npcInfo[i].attacking = true;
+ _npcInfo[i].attackframe = 0;
}
}
}
@@ -962,8 +962,8 @@ void GriffonEngine::updateNPCs() {
}
- float npx = _npcinfo[i].x;
- float npy = _npcinfo[i].y;
+ float npx = _npcInfo[i].x;
+ float npy = _npcInfo[i].y;
int xp = (npx / 2 + 6);
int yp = (npy / 2 + 10);
@@ -973,15 +973,15 @@ void GriffonEngine::updateNPCs() {
rcSrc.setWidth(3);
rcSrc.setHeight(3);
- if (_npcinfo[i].pause < _ticks)
+ if (_npcInfo[i].pause < _ticks)
_clipBg->fillRect(rcSrc, i);
pass = 0;
- if (_npcinfo[i].attacking)
+ if (_npcInfo[i].attacking)
pass = 1;
- if (_npcinfo[i].spriteset == kMonsterFireHydra) {
- if (_npcinfo[i].attacking2[0] || _npcinfo[i].attacking2[1] || _npcinfo[i].attacking2[2])
+ if (_npcInfo[i].spriteset == kMonsterFireHydra) {
+ if (_npcInfo[i].attacking2[0] || _npcInfo[i].attacking2[1] || _npcInfo[i].attacking2[2])
pass = 1;
}
@@ -989,18 +989,18 @@ void GriffonEngine::updateNPCs() {
int dist;
float damage;
// spriteset1 specific
- if (_npcinfo[i].spriteset == kMonsterBabyDragon) {
- _npcinfo[i].attackframe = _npcinfo[i].attackframe + _npcinfo[i].attackspd * _fpsr;
- if (_npcinfo[i].attackframe >= 16) {
- _npcinfo[i].attackframe = 0;
- _npcinfo[i].attacking = false;
- _npcinfo[i].attacknext = _ticks + _npcinfo[i].attackdelay;
+ if (_npcInfo[i].spriteset == kMonsterBabyDragon) {
+ _npcInfo[i].attackframe = _npcInfo[i].attackframe + _npcInfo[i].attackspd * _fpsr;
+ if (_npcInfo[i].attackframe >= 16) {
+ _npcInfo[i].attackframe = 0;
+ _npcInfo[i].attacking = false;
+ _npcInfo[i].attacknext = _ticks + _npcInfo[i].attackdelay;
}
- _npcinfo[i].cattackframe = (int)(_npcinfo[i].attackframe);
+ _npcInfo[i].cattackframe = (int)(_npcInfo[i].attackframe);
- npx = _npcinfo[i].x;
- npy = _npcinfo[i].y;
+ npx = _npcInfo[i].x;
+ npy = _npcInfo[i].y;
float xdif = _player.px - npx;
float ydif = _player.py - npy;
@@ -1008,50 +1008,50 @@ void GriffonEngine::updateNPCs() {
dist = 10;
if (abs(xdif) < dist && abs(ydif) < dist && _player.pause < _ticks) {
- _npcinfo[i].attacknext = _ticks + _npcinfo[i].attackdelay;
+ _npcInfo[i].attacknext = _ticks + _npcInfo[i].attackdelay;
// _npcinfo[i].attackframe = 0;
// _npcinfo[i].attacking = false;
- damage = (float)_npcinfo[i].attackdamage * (0.5 + RND() * 1.0);
+ damage = (float)_npcInfo[i].attackdamage * (0.5 + RND() * 1.0);
if (_player.hp > 0)
damagePlayer(damage);
}
}
- if (_npcinfo[i].spriteset == kMonsterOneWing) {
+ 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];
+ float xdif = _npcInfo[i].bodysection[7].x - _npcInfo[i].headtargetx[0];
+ float ydif = _npcInfo[i].bodysection[7].y - _npcInfo[i].headtargety[0];
- _npcinfo[i].bodysection[7].x = _npcinfo[i].bodysection[7].x - xdif * 0.4 * _fpsr;
- _npcinfo[i].bodysection[7].y = _npcinfo[i].bodysection[7].y - ydif * 0.4 * _fpsr;
+ _npcInfo[i].bodysection[7].x = _npcInfo[i].bodysection[7].x - xdif * 0.4 * _fpsr;
+ _npcInfo[i].bodysection[7].y = _npcInfo[i].bodysection[7].y - ydif * 0.4 * _fpsr;
- _npcinfo[i].bodysection[0].x = _npcinfo[i].x + 12;
- _npcinfo[i].bodysection[0].y = _npcinfo[i].y + 12;
+ _npcInfo[i].bodysection[0].x = _npcInfo[i].x + 12;
+ _npcInfo[i].bodysection[0].y = _npcInfo[i].y + 12;
for (int f = 6; f >= 1; f--) {
- xdif = _npcinfo[i].bodysection[f + 1].x - _npcinfo[i].bodysection[f - 1].x;
- ydif = _npcinfo[i].bodysection[f + 1].y - _npcinfo[i].bodysection[f - 1].y;
+ xdif = _npcInfo[i].bodysection[f + 1].x - _npcInfo[i].bodysection[f - 1].x;
+ ydif = _npcInfo[i].bodysection[f + 1].y - _npcInfo[i].bodysection[f - 1].y;
- float tx = _npcinfo[i].bodysection[f - 1].x + xdif / 2;
- float ty = _npcinfo[i].bodysection[f - 1].y + ydif / 2;
+ float tx = _npcInfo[i].bodysection[f - 1].x + xdif / 2;
+ float ty = _npcInfo[i].bodysection[f - 1].y + ydif / 2;
- _npcinfo[i].bodysection[f].x = _npcinfo[i].bodysection[f].x - (_npcinfo[i].bodysection[f].x - tx);
- _npcinfo[i].bodysection[f].y = _npcinfo[i].bodysection[f].y - (_npcinfo[i].bodysection[f].y - ty);
+ _npcInfo[i].bodysection[f].x = _npcInfo[i].bodysection[f].x - (_npcInfo[i].bodysection[f].x - tx);
+ _npcInfo[i].bodysection[f].y = _npcInfo[i].bodysection[f].y - (_npcInfo[i].bodysection[f].y - ty);
}
- _npcinfo[i].attackframe = _npcinfo[i].attackframe + _npcinfo[i].attackspd * _fpsr;
- if (_npcinfo[i].attackframe >= 16) {
- _npcinfo[i].attackframe = 0;
- _npcinfo[i].attacking = false;
- _npcinfo[i].attacknext = _ticks + _npcinfo[i].attackdelay;
+ _npcInfo[i].attackframe = _npcInfo[i].attackframe + _npcInfo[i].attackspd * _fpsr;
+ if (_npcInfo[i].attackframe >= 16) {
+ _npcInfo[i].attackframe = 0;
+ _npcInfo[i].attacking = false;
+ _npcInfo[i].attacknext = _ticks + _npcInfo[i].attackdelay;
}
- _npcinfo[i].cattackframe = (int)(_npcinfo[i].attackframe);
+ _npcInfo[i].cattackframe = (int)(_npcInfo[i].attackframe);
- npx = _npcinfo[i].bodysection[7].x;
- npy = (_npcinfo[i].bodysection[7].y + 16);
+ npx = _npcInfo[i].bodysection[7].x;
+ npy = (_npcInfo[i].bodysection[7].y + 16);
xdif = (_player.px + 12) - npx;
ydif = (_player.py + 12) - npy;
@@ -1059,10 +1059,10 @@ void GriffonEngine::updateNPCs() {
dist = 8;
if (abs(xdif) < dist && abs(ydif) < dist && _player.pause < _ticks) {
- _npcinfo[i].attacknext = _ticks + _npcinfo[i].attackdelay;
+ _npcInfo[i].attacknext = _ticks + _npcInfo[i].attackdelay;
// _npcinfo[i].attackframe = 0
// _npcinfo[i].attacking = false
- damage = (float)_npcinfo[i].attackdamage * (1.0 + (RND() * 0.5));
+ damage = (float)_npcInfo[i].attackdamage * (1.0 + (RND() * 0.5));
if (_player.hp > 0)
damagePlayer(damage);
}
@@ -1070,40 +1070,40 @@ void GriffonEngine::updateNPCs() {
// firehydra
- if (_npcinfo[i].spriteset == kMonsterFireHydra) {
+ if (_npcInfo[i].spriteset == kMonsterFireHydra) {
for (int ff = 0; ff <= 2; ff++) {
- if (_npcinfo[i].attacking2[ff]) {
- float xdif = _npcinfo[i].bodysection[10 * ff + 9].x - _npcinfo[i].headtargetx[ff];
- float ydif = _npcinfo[i].bodysection[10 * ff + 9].y - _npcinfo[i].headtargety[ff];
+ if (_npcInfo[i].attacking2[ff]) {
+ float xdif = _npcInfo[i].bodysection[10 * ff + 9].x - _npcInfo[i].headtargetx[ff];
+ float ydif = _npcInfo[i].bodysection[10 * ff + 9].y - _npcInfo[i].headtargety[ff];
- _npcinfo[i].bodysection[10 * ff + 9].x = _npcinfo[i].bodysection[10 * ff + 9].x - xdif * .2 * _fpsr;
- _npcinfo[i].bodysection[10 * ff + 9].y = _npcinfo[i].bodysection[10 * ff + 9].y - ydif * .2 * _fpsr;
+ _npcInfo[i].bodysection[10 * ff + 9].x = _npcInfo[i].bodysection[10 * ff + 9].x - xdif * .2 * _fpsr;
+ _npcInfo[i].bodysection[10 * ff + 9].y = _npcInfo[i].bodysection[10 * ff + 9].y - ydif * .2 * _fpsr;
- _npcinfo[i].bodysection[10 * ff].x = _npcinfo[i].x + 12 + 8 * cos(3.141592 * 2 * (_itemyloc / 16 + ff * 120 / 360));
- _npcinfo[i].bodysection[10 * ff].y = _npcinfo[i].y + 12 + 8 * sin(3.141592 * 2 * (_itemyloc / 16 + ff * 120 / 360));
+ _npcInfo[i].bodysection[10 * ff].x = _npcInfo[i].x + 12 + 8 * cos(3.141592 * 2 * (_itemyloc / 16 + ff * 120 / 360));
+ _npcInfo[i].bodysection[10 * ff].y = _npcInfo[i].y + 12 + 8 * sin(3.141592 * 2 * (_itemyloc / 16 + ff * 120 / 360));
for (int f = 8; f >= 1; f--) {
- xdif = _npcinfo[i].bodysection[ff * 10 + f + 1].x - _npcinfo[i].bodysection[ff * 10 + f - 1].x;
- ydif = _npcinfo[i].bodysection[ff * 10 + f + 1].y - _npcinfo[i].bodysection[ff * 10 + f - 1].y;
+ xdif = _npcInfo[i].bodysection[ff * 10 + f + 1].x - _npcInfo[i].bodysection[ff * 10 + f - 1].x;
+ ydif = _npcInfo[i].bodysection[ff * 10 + f + 1].y - _npcInfo[i].bodysection[ff * 10 + f - 1].y;
- float tx = _npcinfo[i].bodysection[ff * 10 + f - 1].x + xdif / 2;
- float ty = _npcinfo[i].bodysection[ff * 10 + f - 1].y + ydif / 2;
+ float tx = _npcInfo[i].bodysection[ff * 10 + f - 1].x + xdif / 2;
+ float ty = _npcInfo[i].bodysection[ff * 10 + f - 1].y + ydif / 2;
- _npcinfo[i].bodysection[ff * 10 + f].x = _npcinfo[i].bodysection[ff * 10 + f].x - (_npcinfo[i].bodysection[ff * 10 + f].x - tx) / 3;
- _npcinfo[i].bodysection[ff * 10 + f].y = _npcinfo[i].bodysection[ff * 10 + f].y - (_npcinfo[i].bodysection[ff * 10 + f].y - ty) / 3;
+ _npcInfo[i].bodysection[ff * 10 + f].x = _npcInfo[i].bodysection[ff * 10 + f].x - (_npcInfo[i].bodysection[ff * 10 + f].x - tx) / 3;
+ _npcInfo[i].bodysection[ff * 10 + f].y = _npcInfo[i].bodysection[ff * 10 + f].y - (_npcInfo[i].bodysection[ff * 10 + f].y - ty) / 3;
}
- _npcinfo[i].attackframe2[ff] = _npcinfo[i].attackframe2[ff] + _npcinfo[i].attackspd * _fpsr;
- if (_npcinfo[i].attackframe2[ff] >= 16) {
- _npcinfo[i].attackframe2[ff] = 0;
- _npcinfo[i].attacking2[ff] = false;
- _npcinfo[i].attacknext2[ff] = _ticks + _npcinfo[i].attackdelay;
+ _npcInfo[i].attackframe2[ff] = _npcInfo[i].attackframe2[ff] + _npcInfo[i].attackspd * _fpsr;
+ if (_npcInfo[i].attackframe2[ff] >= 16) {
+ _npcInfo[i].attackframe2[ff] = 0;
+ _npcInfo[i].attacking2[ff] = false;
+ _npcInfo[i].attacknext2[ff] = _ticks + _npcInfo[i].attackdelay;
}
- _npcinfo[i].cattackframe = (int)(_npcinfo[i].attackframe);
+ _npcInfo[i].cattackframe = (int)(_npcInfo[i].attackframe);
- npx = _npcinfo[i].bodysection[10 * ff + 9].x;
- npy = (_npcinfo[i].bodysection[10 * ff + 9].y + 16);
+ npx = _npcInfo[i].bodysection[10 * ff + 9].x;
+ npy = (_npcInfo[i].bodysection[10 * ff + 9].y + 16);
xdif = (_player.px + 12) - npx;
ydif = (_player.py + 12) - npy;
@@ -1111,10 +1111,10 @@ void GriffonEngine::updateNPCs() {
dist = 8;
if (abs(xdif) < dist && abs(ydif) < dist && _player.pause < _ticks) {
- _npcinfo[i].attacknext2[ff] = _ticks + _npcinfo[i].attackdelay;
+ _npcInfo[i].attacknext2[ff] = _ticks + _npcInfo[i].attackdelay;
// _npcinfo[i].attackframe2(ff) = 0
// _npcinfo[i].attacking2(ff) = false
- damage = (float)_npcinfo[i].attackdamage * (1.0 + RND() * 0.5);
+ damage = (float)_npcInfo[i].attackdamage * (1.0 + RND() * 0.5);
if (_player.hp > 0)
damagePlayer(damage);
}
@@ -1124,39 +1124,39 @@ void GriffonEngine::updateNPCs() {
}
// twowing specific
- if (_npcinfo[i].spriteset == kMonsterTwoWing) {
+ 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];
+ float xdif = _npcInfo[i].bodysection[7].x - _npcInfo[i].headtargetx[0];
+ float ydif = _npcInfo[i].bodysection[7].y - _npcInfo[i].headtargety[0];
- _npcinfo[i].bodysection[7].x = _npcinfo[i].bodysection[7].x - xdif * 0.4 * _fpsr;
- _npcinfo[i].bodysection[7].y = _npcinfo[i].bodysection[7].y - ydif * 0.4 * _fpsr;
+ _npcInfo[i].bodysection[7].x = _npcInfo[i].bodysection[7].x - xdif * 0.4 * _fpsr;
+ _npcInfo[i].bodysection[7].y = _npcInfo[i].bodysection[7].y - ydif * 0.4 * _fpsr;
- _npcinfo[i].bodysection[0].x = _npcinfo[i].x + 12;
- _npcinfo[i].bodysection[0].y = _npcinfo[i].y + 12;
+ _npcInfo[i].bodysection[0].x = _npcInfo[i].x + 12;
+ _npcInfo[i].bodysection[0].y = _npcInfo[i].y + 12;
for (int f = 6; f >= 1; f--) {
- xdif = _npcinfo[i].bodysection[f + 1].x - _npcinfo[i].bodysection[f - 1].x;
- ydif = _npcinfo[i].bodysection[f + 1].y - _npcinfo[i].bodysection[f - 1].y;
+ xdif = _npcInfo[i].bodysection[f + 1].x - _npcInfo[i].bodysection[f - 1].x;
+ ydif = _npcInfo[i].bodysection[f + 1].y - _npcInfo[i].bodysection[f - 1].y;
- float tx = _npcinfo[i].bodysection[f - 1].x + xdif / 2;
- float ty = _npcinfo[i].bodysection[f - 1].y + ydif / 2;
+ float tx = _npcInfo[i].bodysection[f - 1].x + xdif / 2;
+ float ty = _npcInfo[i].bodysection[f - 1].y + ydif / 2;
- _npcinfo[i].bodysection[f].x = _npcinfo[i].bodysection[f].x - (_npcinfo[i].bodysection[f].x - tx);
- _npcinfo[i].bodysection[f].y = _npcinfo[i].bodysection[f].y - (_npcinfo[i].bodysection[f].y - ty);
+ _npcInfo[i].bodysection[f].x = _npcInfo[i].bodysection[f].x - (_npcInfo[i].bodysection[f].x - tx);
+ _npcInfo[i].bodysection[f].y = _npcInfo[i].bodysection[f].y - (_npcInfo[i].bodysection[f].y - ty);
}
- _npcinfo[i].attackframe = _npcinfo[i].attackframe + _npcinfo[i].attackspd * _fpsr;
- if (_npcinfo[i].attackframe >= 16) {
- _npcinfo[i].attackframe = 0;
- _npcinfo[i].attacking = false;
- _npcinfo[i].attacknext = _ticks + _npcinfo[i].attackdelay;
+ _npcInfo[i].attackframe = _npcInfo[i].attackframe + _npcInfo[i].attackspd * _fpsr;
+ if (_npcInfo[i].attackframe >= 16) {
+ _npcInfo[i].attackframe = 0;
+ _npcInfo[i].attacking = false;
+ _npcInfo[i].attacknext = _ticks + _npcInfo[i].attackdelay;
}
- _npcinfo[i].cattackframe = (int)(_npcinfo[i].attackframe);
+ _npcInfo[i].cattackframe = (int)(_npcInfo[i].attackframe);
- npx = _npcinfo[i].bodysection[7].x;
- npy = (_npcinfo[i].bodysection[7].y + 16);
+ npx = _npcInfo[i].bodysection[7].x;
+ npy = (_npcInfo[i].bodysection[7].y + 16);
xdif = (_player.px + 12) - npx;
ydif = (_player.py + 12) - npy;
@@ -1164,58 +1164,58 @@ void GriffonEngine::updateNPCs() {
dist = 8;
if (abs(xdif) < dist && abs(ydif) < dist && _player.pause < _ticks) {
- _npcinfo[i].attacknext = _ticks + _npcinfo[i].attackdelay;
+ _npcInfo[i].attacknext = _ticks + _npcInfo[i].attackdelay;
// _npcinfo[i].attackframe = 0
// _npcinfo[i].attacking = false
- damage = (float)_npcinfo[i].attackdamage * (1.0 + RND() * 0.5);
+ damage = (float)_npcInfo[i].attackdamage * (1.0 + RND() * 0.5);
if (_player.hp > 0)
damagePlayer(damage);
}
}
// dragon 2 specific
- if (_npcinfo[i].spriteset == kMonsterDragon2) {
+ if (_npcInfo[i].spriteset == kMonsterDragon2) {
- _npcinfo[i].attackframe = _npcinfo[i].attackframe + _npcinfo[i].attackspd * _fpsr;
- if (_npcinfo[i].attackframe >= 16) {
- _npcinfo[i].attackframe = 0;
- _npcinfo[i].attacking = false;
- _npcinfo[i].attacknext = _ticks + _npcinfo[i].attackdelay;
+ _npcInfo[i].attackframe = _npcInfo[i].attackframe + _npcInfo[i].attackspd * _fpsr;
+ if (_npcInfo[i].attackframe >= 16) {
+ _npcInfo[i].attackframe = 0;
+ _npcInfo[i].attacking = false;
+ _npcInfo[i].attacknext = _ticks + _npcInfo[i].attackdelay;
}
- _npcinfo[i].cattackframe = (int)(_npcinfo[i].attackframe);
+ _npcInfo[i].cattackframe = (int)(_npcInfo[i].attackframe);
- npx = _npcinfo[i].x;
- npy = _npcinfo[i].y;
+ npx = _npcInfo[i].x;
+ npy = _npcInfo[i].y;
float xdif = _player.px - npx;
float ydif = _player.py - npy;
- dist = 16 + _npcinfo[i].attackframe;
+ dist = 16 + _npcInfo[i].attackframe;
if (abs(xdif) < dist && abs(ydif) < dist && _player.pause < _ticks) {
- _npcinfo[i].attacknext = _ticks + _npcinfo[i].attackdelay;
+ _npcInfo[i].attacknext = _ticks + _npcInfo[i].attackdelay;
// _npcinfo[i].attackframe = 0
// _npcinfo[i].attacking = false
- damage = (float)_npcinfo[i].attackdamage * (0.5 + RND() * 1.0);
+ damage = (float)_npcInfo[i].attackdamage * (0.5 + RND() * 1.0);
if (_player.hp > 0)
damagePlayer(damage);
}
}
// endboss specific
- if (_npcinfo[i].spriteset == kMonsterFinalBoss) {
- _npcinfo[i].attackframe = _npcinfo[i].attackframe + _npcinfo[i].attackspd * _fpsr;
- if (_npcinfo[i].attackframe >= 16) {
- _npcinfo[i].attackframe = 0;
- _npcinfo[i].attacking = false;
- _npcinfo[i].attacknext = _ticks + _npcinfo[i].attackdelay;
+ if (_npcInfo[i].spriteset == kMonsterFinalBoss) {
+ _npcInfo[i].attackframe = _npcInfo[i].attackframe + _npcInfo[i].attackspd * _fpsr;
+ if (_npcInfo[i].attackframe >= 16) {
+ _npcInfo[i].attackframe = 0;
+ _npcInfo[i].attacking = false;
+ _npcInfo[i].attacknext = _ticks + _npcInfo[i].attackdelay;
}
- _npcinfo[i].cattackframe = (int)(_npcinfo[i].attackframe);
+ _npcInfo[i].cattackframe = (int)(_npcInfo[i].attackframe);
- npx = _npcinfo[i].x;
- npy = _npcinfo[i].y;
+ npx = _npcInfo[i].x;
+ npy = _npcInfo[i].y;
float xdif = _player.px - npx;
float ydif = _player.py - npy;
@@ -1223,10 +1223,10 @@ void GriffonEngine::updateNPCs() {
dist = 36;
if (abs(xdif) < dist && abs(ydif) < dist && _player.pause < _ticks) {
- _npcinfo[i].attacknext = _ticks + _npcinfo[i].attackdelay;
+ _npcInfo[i].attacknext = _ticks + _npcInfo[i].attackdelay;
// _npcinfo[i].attackframe = 0
// _npcinfo[i].attacking = false
- damage = (float)_npcinfo[i].attackdamage * (0.5 + RND() * 1.0);
+ damage = (float)_npcInfo[i].attackdamage * (0.5 + RND() * 1.0);
if (_player.hp > 0)
damagePlayer(damage);
}
@@ -1241,12 +1241,12 @@ void GriffonEngine::updateSpells() {
float xloc = 0, yloc = 0;
for (int i = 0; i < kMaxSpell; i++) {
- if (spellinfo[i].frame > 0) {
- int spellnum = spellinfo[i].spellnum;
+ if (_spellInfo[i].frame > 0) {
+ int spellnum = _spellInfo[i].spellnum;
// water
if (spellnum == 0 && !_forcePause) {
- float fr = (32 - spellinfo[i].frame);
+ float fr = (32 - _spellInfo[i].frame);
int ll[4][2];
ll[0][0] = -2;
@@ -1269,8 +1269,8 @@ void GriffonEngine::updateSpells() {
rcSrc.setWidth(16);
rcSrc.setHeight(16);
- xloc = spellinfo[i].enemyx + 12 + ll[f][0] * 16;
- yloc = spellinfo[i].enemyy + 16 + ll[f][1] * 16;
+ xloc = _spellInfo[i].enemyx + 12 + ll[f][0] * 16;
+ yloc = _spellInfo[i].enemyy + 16 + ll[f][1] * 16;
rcDest.left = xloc;
rcDest.top = yloc;
@@ -1290,11 +1290,11 @@ void GriffonEngine::updateSpells() {
rcSrc.setWidth(16);
rcSrc.setHeight(16);
- float xst = spellinfo[i].enemyx + 12 + ll[f][0] * 16;
- float yst = spellinfo[i].enemyy + 16 + ll[f][1] * 16;
+ float xst = _spellInfo[i].enemyx + 12 + ll[f][0] * 16;
+ float yst = _spellInfo[i].enemyy + 16 + ll[f][1] * 16;
- float xi = (spellinfo[i].enemyx - xst) * 2 / 8;
- float yi = (spellinfo[i].enemyy - yst) * 2 / 8;
+ float xi = (_spellInfo[i].enemyx - xst) * 2 / 8;
+ float yi = (_spellInfo[i].enemyy - yst) * 2 / 8;
float fl = (fr - f * 4 - 8) / 2;
xloc = xst + xi * fl * fl;
@@ -1311,15 +1311,15 @@ void GriffonEngine::updateSpells() {
_spellImg->blit(*_videoBuffer, rcDest.left, rcDest.top, Graphics::FLIP_NONE, &rcSrc);
_spellImg->setAlpha(255, true);
- if (spellinfo[i].damagewho == 0) {
- for (int e = 1; e <= _lastnpc; e++) {
- float xdif = (xloc + 16) - (_npcinfo[e].x + 12);
- float ydif = (yloc + 16) - (_npcinfo[e].y + 12);
+ if (_spellInfo[i].damagewho == 0) {
+ for (int e = 1; e <= _lastNpc; e++) {
+ float xdif = (xloc + 16) - (_npcInfo[e].x + 12);
+ float ydif = (yloc + 16) - (_npcInfo[e].y + 12);
if ((abs(xdif) < 16 && abs(ydif) < 16)) {
- float damage = (float)_player.spellDamage * (1.0 + RND() * 0.5) * (float)spellinfo[i].strength;
+ float damage = (float)_player.spellDamage * (1.0 + RND() * 0.5) * (float)_spellInfo[i].strength;
- if (_npcinfo[e].hp > 0 && _npcinfo[e].pause < _ticks) {
+ if (_npcInfo[e].hp > 0 && _npcInfo[e].pause < _ticks) {
damageNPC(e, damage, 1);
if (config.effects) {
int snd = playSound(_sfx[kSndIce]);
@@ -1331,13 +1331,13 @@ void GriffonEngine::updateSpells() {
}
// check for post damage
- if (nposts > 0) {
- for (int e = 0; e <= nposts - 1; e++) {
+ if (_postInfoNbr > 0) {
+ for (int e = 0; e <= _postInfoNbr - 1; e++) {
float xdif = (xloc + 16) - (_postInfo[e][0] + 8);
float ydif = (yloc + 16) - (_postInfo[e][1] + 8);
if ((abs(xdif) < 16 && abs(ydif) < 16)) {
- _objmapf[_curMap][(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = 1;
+ _objectMapFull[_curMap][(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = 1;
_objectMap[(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = -1;
rcSrc.left = _postInfo[e][0] / 2;
@@ -1363,20 +1363,20 @@ void GriffonEngine::updateSpells() {
// metal
if (spellnum == 1 && !_forcePause) {
- int fr = (int)((32 - spellinfo[i].frame) * 4) % 3;
+ int fr = (int)((32 - _spellInfo[i].frame) * 4) % 3;
rcSrc.left = fr * 48;
rcSrc.top = 0;
rcSrc.setWidth(48);
rcSrc.setHeight(48);
- float c1 = (32 - spellinfo[i].frame) / 16;
+ float c1 = (32 - _spellInfo[i].frame) / 16;
- float halfx = (spellinfo[i].homex - 12) + ((spellinfo[i].enemyx - 12) - (spellinfo[i].homex - 12)) / 2;
- float halfy = (spellinfo[i].homey - 12) + ((spellinfo[i].enemyy - 12) - (spellinfo[i].homey - 12)) / 2;
+ float halfx = (_spellInfo[i].homex - 12) + ((_spellInfo[i].enemyx - 12) - (_spellInfo[i].homex - 12)) / 2;
+ float halfy = (_spellInfo[i].homey - 12) + ((_spellInfo[i].enemyy - 12) - (_spellInfo[i].homey - 12)) / 2;
- float wdth = (halfx - spellinfo[i].homex) * 1.2;
- float hight = (halfy - spellinfo[i].homey) * 1.2;
+ float wdth = (halfx - _spellInfo[i].homex) * 1.2;
+ float hight = (halfy - _spellInfo[i].homey) * 1.2;
xloc = halfx + wdth * cos(3.14159 + 3.14159 * 2 * c1);
yloc = halfy + hight * sin(3.14159 + 3.14159 * 2 * c1);
@@ -1386,19 +1386,19 @@ void GriffonEngine::updateSpells() {
_spellImg->blit(*_videoBuffer, rcDest.left, rcDest.top, Graphics::FLIP_NONE, &rcSrc);
- spellinfo[i].frame = spellinfo[i].frame - 0.2 * _fpsr;
- if (spellinfo[i].frame < 0)
- spellinfo[i].frame = 0;
+ _spellInfo[i].frame = _spellInfo[i].frame - 0.2 * _fpsr;
+ if (_spellInfo[i].frame < 0)
+ _spellInfo[i].frame = 0;
- if (spellinfo[i].damagewho == 0) {
- for (int e = 1; e <= _lastnpc; e++) {
- float xdif = (xloc + 24) - (_npcinfo[e].x + 12);
- float ydif = (yloc + 24) - (_npcinfo[e].y + 12);
+ if (_spellInfo[i].damagewho == 0) {
+ for (int e = 1; e <= _lastNpc; e++) {
+ float xdif = (xloc + 24) - (_npcInfo[e].x + 12);
+ float ydif = (yloc + 24) - (_npcInfo[e].y + 12);
if ((abs(xdif) < 24 && abs(ydif) < 24)) {
- float damage = (float)_player.spellDamage * (1.0 + RND() * 0.5) * (float)spellinfo[i].strength;
+ float damage = (float)_player.spellDamage * (1.0 + RND() * 0.5) * (float)_spellInfo[i].strength;
- if (_npcinfo[e].hp > 0 && _npcinfo[e].pause < _ticks) {
+ if (_npcInfo[e].hp > 0 && _npcInfo[e].pause < _ticks) {
damageNPC(e, damage, 1);
if (config.effects) {
int snd = playSound(_sfx[kSndMetalHit]);
@@ -1409,26 +1409,26 @@ void GriffonEngine::updateSpells() {
}
}
- if (spellinfo[i].damagewho == 1) {
+ if (_spellInfo[i].damagewho == 1) {
// --------- boss 1 specific
- if (ABS(spellinfo[i].frame) < 0 && _npcinfo[spellinfo[i].npc].spriteset == kMonsterBoss1) {
- int npc = spellinfo[i].npc;
- _npcinfo[npc].attackframe = 0;
- _npcinfo[npc].attacking = false;
+ if (ABS(_spellInfo[i].frame) < 0 && _npcInfo[_spellInfo[i].npc].spriteset == kMonsterBoss1) {
+ int npc = _spellInfo[i].npc;
+ _npcInfo[npc].attackframe = 0;
+ _npcInfo[npc].attacking = false;
- _npcinfo[npc].pause = _ticks + 1000;
- _npcinfo[npc].attacknext = _ticks + 4000;
+ _npcInfo[npc].pause = _ticks + 1000;
+ _npcInfo[npc].attacknext = _ticks + 4000;
}
// ---------------
// --------- blackknight specific
- if (ABS(spellinfo[i].frame) < 0 && _npcinfo[spellinfo[i].npc].spriteset == kMonsterBlackKnight) {
- int npc = spellinfo[i].npc;
- _npcinfo[npc].attackframe = 0;
- _npcinfo[npc].attacking = false;
+ if (ABS(_spellInfo[i].frame) < 0 && _npcInfo[_spellInfo[i].npc].spriteset == kMonsterBlackKnight) {
+ int npc = _spellInfo[i].npc;
+ _npcInfo[npc].attackframe = 0;
+ _npcInfo[npc].attacking = false;
- _npcinfo[npc].pause = _ticks + 1000;
- _npcinfo[npc].attacknext = _ticks + 3500;
+ _npcInfo[npc].pause = _ticks + 1000;
+ _npcInfo[npc].attacknext = _ticks + 3500;
}
// ---------------
@@ -1436,7 +1436,7 @@ void GriffonEngine::updateSpells() {
float ydif = (yloc + 24) - (_player.py + 12);
if ((abs(xdif) < 24 && abs(ydif) < 24) && _player.pause < _ticks) {
- float damage = (float)_npcinfo[spellinfo[i].npc].spelldamage * (1.0 + RND() * 0.5);
+ float damage = (float)_npcInfo[_spellInfo[i].npc].spelldamage * (1.0 + RND() * 0.5);
if (_player.hp > 0) {
damagePlayer(damage);
@@ -1450,13 +1450,13 @@ void GriffonEngine::updateSpells() {
// check for(int post damage
- if (nposts > 0) {
- for (int e = 0; e <= nposts - 1; e++) {
+ if (_postInfoNbr > 0) {
+ for (int e = 0; e <= _postInfoNbr - 1; e++) {
float xdif = (xloc + 24) - (_postInfo[e][0] + 8);
float ydif = (yloc + 24) - (_postInfo[e][1] + 8);
if ((abs(xdif) < 24 && abs(ydif) < 24)) {
- _objmapf[_curMap][(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = 1;
+ _objectMapFull[_curMap][(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = 1;
_objectMap[(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = -1;
rcSrc.left = _postInfo[e][0] / 2;
@@ -1479,27 +1479,27 @@ void GriffonEngine::updateSpells() {
// earth
if (spellnum == 2 && !_forcePause) {
- float hght = 240 - spellinfo[i].enemyy;
+ float hght = 240 - _spellInfo[i].enemyy;
for (int f = 8; f >= 0; f--) {
- float fr = (32 - spellinfo[i].frame);
+ float fr = (32 - _spellInfo[i].frame);
if (fr > f && fr < f + 16) {
- rcSrc.left = 32 * spellinfo[i].rockimg[f];
+ rcSrc.left = 32 * _spellInfo[i].rockimg[f];
rcSrc.top = 48;
rcSrc.setWidth(32);
rcSrc.setHeight(32);
bool scatter = false;
if (fr < 8 + f) {
- xloc = spellinfo[i].enemyx - 4;
- yloc = spellinfo[i].enemyy * (1 - cos(3.14159 / 2 * (fr - f) / 8)); // ^ 2;
+ xloc = _spellInfo[i].enemyx - 4;
+ yloc = _spellInfo[i].enemyy * (1 - cos(3.14159 / 2 * (fr - f) / 8)); // ^ 2;
yloc *= yloc;
} else {
scatter = true;
- xloc = spellinfo[i].enemyx - 4 - spellinfo[i].rockdeflect[f] * sin(3.14159 / 2 * ((fr - f) - 8) / 8);
- yloc = spellinfo[i].enemyy + hght * (1 - cos(3.14159 / 2 * ((fr - f) - 8) / 8));
+ xloc = _spellInfo[i].enemyx - 4 - _spellInfo[i].rockdeflect[f] * sin(3.14159 / 2 * ((fr - f) - 8) / 8);
+ yloc = _spellInfo[i].enemyy + hght * (1 - cos(3.14159 / 2 * ((fr - f) - 8) / 8));
}
rcDest.left = xloc;
@@ -1509,15 +1509,15 @@ void GriffonEngine::updateSpells() {
_spellImg->blit(*_videoBuffer, rcDest.left, rcDest.top, Graphics::FLIP_NONE, &rcSrc);
if (scatter) {
- if (spellinfo[i].damagewho == 0) {
- for (int e = 1; e <= _lastnpc; e++) {
- float xdif = (xloc + 16) - (_npcinfo[e].x + 12);
- float ydif = (yloc + 16) - (_npcinfo[e].y + 12);
+ if (_spellInfo[i].damagewho == 0) {
+ for (int e = 1; e <= _lastNpc; e++) {
+ float xdif = (xloc + 16) - (_npcInfo[e].x + 12);
+ float ydif = (yloc + 16) - (_npcInfo[e].y + 12);
if ((abs(xdif) < 16 && abs(ydif) < 16)) {
- float damage = (float)_player.spellDamage * (1.0 + RND() * 0.5) * (float)spellinfo[i].strength;
+ float damage = (float)_player.spellDamage * (1.0 + RND() * 0.5) * (float)_spellInfo[i].strength;
- if (_npcinfo[e].hp > 0 && _npcinfo[e].pause < _ticks) {
+ if (_npcInfo[e].hp > 0 && _npcInfo[e].pause < _ticks) {
damageNPC(e, damage, 1);
if (config.effects) {
int snd = playSound(_sfx[kSndRocks]);
@@ -1530,13 +1530,13 @@ void GriffonEngine::updateSpells() {
// check for(int post damage
- if (nposts > 0) {
- for (int e = 0; e <= nposts - 1; e++) {
+ if (_postInfoNbr > 0) {
+ for (int e = 0; e <= _postInfoNbr - 1; e++) {
float xdif = (xloc + 16) - (_postInfo[e][0] + 8);
float ydif = (yloc + 16) - (_postInfo[e][1] + 8);
if ((abs(xdif) < 16 && abs(ydif) < 16)) {
- _objmapf[_curMap][(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = 1;
+ _objectMapFull[_curMap][(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = 1;
_objectMap[(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = -1;
rcSrc.left = _postInfo[e][0] / 2;
@@ -1560,16 +1560,16 @@ void GriffonEngine::updateSpells() {
}
}
- spellinfo[i].frame = spellinfo[i].frame - 0.2 * _fpsr;
- if (spellinfo[i].frame < 0)
- spellinfo[i].frame = 0;
+ _spellInfo[i].frame = _spellInfo[i].frame - 0.2 * _fpsr;
+ if (_spellInfo[i].frame < 0)
+ _spellInfo[i].frame = 0;
}
// crystal
if (spellnum == 5) {
- float fra = (32 - spellinfo[i].frame);
- int fr = (int)((spellinfo[i].frame) * 2) % 8;
+ float fra = (32 - _spellInfo[i].frame);
+ int fr = (int)((_spellInfo[i].frame) * 2) % 8;
rcSrc.left = fr * 32;
rcSrc.top = 96 + 48;
@@ -1589,9 +1589,9 @@ void GriffonEngine::updateSpells() {
_spellImg->blit(*_videoBuffer, rcDest.left, rcDest.top, Graphics::FLIP_NONE, &rcSrc);
_spellImg->setAlpha(255, true);
- spellinfo[i].frame = spellinfo[i].frame - 0.3 * _fpsr;
- if (spellinfo[i].frame < 0) {
- spellinfo[i].frame = 0;
+ _spellInfo[i].frame = _spellInfo[i].frame - 0.3 * _fpsr;
+ if (_spellInfo[i].frame < 0) {
+ _spellInfo[i].frame = 0;
_forcePause = false;
float npx = _player.px + 12;
@@ -1666,8 +1666,8 @@ void GriffonEngine::updateSpells() {
// room fireballs
if (spellnum == 6 && !_forcePause) {
- if (spellinfo[i].frame > 16) {
- float fr = (32 - spellinfo[i].frame);
+ if (_spellInfo[i].frame > 16) {
+ float fr = (32 - _spellInfo[i].frame);
_spellImg->setAlpha(192 * sin(3.14159 * fr / 4), true);
@@ -1676,10 +1676,10 @@ void GriffonEngine::updateSpells() {
rcSrc.setWidth(16);
rcSrc.setHeight(16);
- for (int ff = 0; ff <= spellinfo[i].nfballs - 1; ff++) {
+ for (int ff = 0; ff <= _spellInfo[i].nfballs - 1; ff++) {
- xloc = spellinfo[i].fireballs[ff][0] + (int)(RND() * 3) - 1;
- yloc = spellinfo[i].fireballs[ff][1] + (int)(RND() * 3) - 1;
+ xloc = _spellInfo[i].fireballs[ff][0] + (int)(RND() * 3) - 1;
+ yloc = _spellInfo[i].fireballs[ff][1] + (int)(RND() * 3) - 1;
rcDest.left = xloc;
rcDest.top = yloc;
@@ -1696,9 +1696,9 @@ void GriffonEngine::updateSpells() {
rcSrc.setWidth(16);
rcSrc.setHeight(16);
- for (int ff = 0; ff <= spellinfo[i].nfballs - 1; ff++) {
- float ax = spellinfo[i].fireballs[ff][0];
- float ay = spellinfo[i].fireballs[ff][1];
+ for (int ff = 0; ff <= _spellInfo[i].nfballs - 1; ff++) {
+ float ax = _spellInfo[i].fireballs[ff][0];
+ float ay = _spellInfo[i].fireballs[ff][1];
float bx = _player.px + 4;
float by = _player.py + 4;
float d = sqrt((bx - ax) * (bx - ax) + (by - ay) * (by - ay));
@@ -1706,15 +1706,15 @@ void GriffonEngine::updateSpells() {
float tx = (bx - ax) / d;
float ty = (by - ay) / d;
- spellinfo[i].fireballs[ff][2] += tx * 1.2 * _fpsr;
- spellinfo[i].fireballs[ff][3] += ty * 1.2 * _fpsr;
+ _spellInfo[i].fireballs[ff][2] += tx * 1.2 * _fpsr;
+ _spellInfo[i].fireballs[ff][3] += ty * 1.2 * _fpsr;
- if (spellinfo[i].ballon[ff] == 1) {
- spellinfo[i].fireballs[ff][0] = ax + spellinfo[i].fireballs[ff][2] * 0.2 * _fpsr;
- spellinfo[i].fireballs[ff][1] = ay + spellinfo[i].fireballs[ff][3] * 0.2 * _fpsr;
+ if (_spellInfo[i].ballon[ff] == 1) {
+ _spellInfo[i].fireballs[ff][0] = ax + _spellInfo[i].fireballs[ff][2] * 0.2 * _fpsr;
+ _spellInfo[i].fireballs[ff][1] = ay + _spellInfo[i].fireballs[ff][3] * 0.2 * _fpsr;
- xloc = spellinfo[i].fireballs[ff][0] + (int)(RND() * 3) - 1;
- yloc = spellinfo[i].fireballs[ff][1] + (int)(RND() * 3) - 1;
+ xloc = _spellInfo[i].fireballs[ff][0] + (int)(RND() * 3) - 1;
+ yloc = _spellInfo[i].fireballs[ff][1] + (int)(RND() * 3) - 1;
rcDest.left = xloc;
rcDest.top = yloc;
@@ -1723,27 +1723,27 @@ void GriffonEngine::updateSpells() {
}
if (xloc < -1 || yloc < -1 || xloc > 304 || yloc > 224)
- spellinfo[i].ballon[ff] = 0;
+ _spellInfo[i].ballon[ff] = 0;
}
_spellImg->setAlpha(255, true);
}
- spellinfo[i].frame = spellinfo[i].frame - 0.2 * _fpsr;
- if (spellinfo[i].frame < 0)
- spellinfo[i].frame = 0;
+ _spellInfo[i].frame = _spellInfo[i].frame - 0.2 * _fpsr;
+ if (_spellInfo[i].frame < 0)
+ _spellInfo[i].frame = 0;
- if (spellinfo[i].damagewho == 1) {
- for (int ff = 0; ff <= spellinfo[i].nfballs - 1; ff++) {
- if (spellinfo[i].ballon[ff] == 1) {
- xloc = spellinfo[i].fireballs[ff][0] + (int)(RND() * 3) - 1;
- yloc = spellinfo[i].fireballs[ff][1] + (int)(RND() * 3) - 1;
+ if (_spellInfo[i].damagewho == 1) {
+ for (int ff = 0; ff <= _spellInfo[i].nfballs - 1; ff++) {
+ if (_spellInfo[i].ballon[ff] == 1) {
+ xloc = _spellInfo[i].fireballs[ff][0] + (int)(RND() * 3) - 1;
+ yloc = _spellInfo[i].fireballs[ff][1] + (int)(RND() * 3) - 1;
float xdif = (xloc + 8) - (_player.px + 12);
float ydif = (yloc + 8) - (_player.py + 12);
if ((abs(xdif) < 8 && abs(ydif) < 8) && _player.pause < _ticks) {
- float damage = _npcinfo[spellinfo[i].npc].spelldamage * (1 + RND() * 0.5) / 3;
+ float damage = _npcInfo[_spellInfo[i].npc].spelldamage * (1 + RND() * 0.5) / 3;
if (_player.hp > 0)
damagePlayer(damage);
@@ -1791,28 +1791,28 @@ void GriffonEngine::updateSpells() {
orn = rn;
- if (spellinfo[i].damagewho == 0) {
- for (int e = 1; e <= _lastnpc; e++) {
- float xdif = (x + 16) - (_npcinfo[e].x + 12);
- float ydif = (y + 16) - (_npcinfo[e].y + 12);
+ if (_spellInfo[i].damagewho == 0) {
+ for (int e = 1; e <= _lastNpc; e++) {
+ float xdif = (x + 16) - (_npcInfo[e].x + 12);
+ float ydif = (y + 16) - (_npcInfo[e].y + 12);
if ((abs(xdif) < 8 && abs(ydif) < 8)) {
float damage = 30 * (1 + RND() * 0.5);
- if (_npcinfo[e].hp > 0 && _npcinfo[e].pause < _ticks)
+ if (_npcInfo[e].hp > 0 && _npcInfo[e].pause < _ticks)
damageNPC(e, damage, 1);
}
}
}
// check for post damage
- if (nposts > 0) {
- for (int e = 0; e <= nposts - 1; e++) {
+ if (_postInfoNbr > 0) {
+ for (int e = 0; e <= _postInfoNbr - 1; e++) {
float xdif = (xloc + 16) - (_postInfo[e][0] + 8);
float ydif = (yloc + 16) - (_postInfo[e][1] + 8);
if ((abs(xdif) < 16 && abs(ydif) < 16)) {
- _objmapf[_curMap][(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = 1;
+ _objectMapFull[_curMap][(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = 1;
_objectMap[(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = -1;
rcSrc.left = _postInfo[e][0] / 2;
@@ -1848,28 +1848,28 @@ void GriffonEngine::updateSpells() {
orn = rn;
- if (spellinfo[i].damagewho == 0) {
- for (int e = 1; e <= _lastnpc; e++) {
- float xdif = (x + 16) - (_npcinfo[e].x + 12);
- float ydif = (y + 16) - (_npcinfo[e].y + 12);
+ if (_spellInfo[i].damagewho == 0) {
+ for (int e = 1; e <= _lastNpc; e++) {
+ float xdif = (x + 16) - (_npcInfo[e].x + 12);
+ float ydif = (y + 16) - (_npcInfo[e].y + 12);
if ((abs(xdif) < 8 && abs(ydif) < 8)) {
float damage = 30 * (1 + RND() * 0.5);
- if (_npcinfo[e].hp > 0 && _npcinfo[e].pause < _ticks)
+ if (_npcInfo[e].hp > 0 && _npcInfo[e].pause < _ticks)
damageNPC(e, damage, 1);
}
}
}
// check for post damage
- if (nposts > 0) {
- for (int e = 0; e <= nposts - 1; e++) {
+ if (_postInfoNbr > 0) {
+ for (int e = 0; e <= _postInfoNbr - 1; e++) {
float xdif = (xloc + 16) - (_postInfo[e][0] + 8);
float ydif = (yloc + 16) - (_postInfo[e][1] + 8);
if ((abs(xdif) < 16 && abs(ydif) < 16)) {
- _objmapf[_curMap][(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = 1;
+ _objectMapFull[_curMap][(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = 1;
_objectMap[(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = -1;
rcSrc.left = _postInfo[e][0] / 2;
@@ -1905,28 +1905,28 @@ void GriffonEngine::updateSpells() {
orn = rn;
- if (spellinfo[i].damagewho == 0) {
- for (int e = 1; e <= _lastnpc; e++) {
- float xdif = (x + 16) - (_npcinfo[e].x + 12);
- float ydif = (y + 16) - (_npcinfo[e].y + 12);
+ if (_spellInfo[i].damagewho == 0) {
+ for (int e = 1; e <= _lastNpc; e++) {
+ float xdif = (x + 16) - (_npcInfo[e].x + 12);
+ float ydif = (y + 16) - (_npcInfo[e].y + 12);
if ((abs(xdif) < 8 && abs(ydif) < 8)) {
float damage = 30 * (1 + RND() * 0.5);
- if (_npcinfo[e].hp > 0 && _npcinfo[e].pause < _ticks)
+ if (_npcInfo[e].hp > 0 && _npcInfo[e].pause < _ticks)
damageNPC(e, damage, 1);
}
}
}
// check for post damage
- if (nposts > 0) {
- for (int e = 0; e <= nposts - 1; e++) {
+ if (_postInfoNbr > 0) {
+ for (int e = 0; e <= _postInfoNbr - 1; e++) {
float xdif = (xloc + 16) - (_postInfo[e][0] + 8);
float ydif = (yloc + 16) - (_postInfo[e][1] + 8);
if ((abs(xdif) < 16 && abs(ydif) < 16)) {
- _objmapf[_curMap][(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = 1;
+ _objectMapFull[_curMap][(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = 1;
_objectMap[(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = -1;
rcSrc.left = _postInfo[e][0] / 2;
@@ -1962,28 +1962,28 @@ void GriffonEngine::updateSpells() {
orn = rn;
- if (spellinfo[i].damagewho == 0) {
- for (int e = 1; e <= _lastnpc; e++) {
- float xdif = (x + 16) - (_npcinfo[e].x + 12);
- float ydif = (y + 16) - (_npcinfo[e].y + 12);
+ if (_spellInfo[i].damagewho == 0) {
+ for (int e = 1; e <= _lastNpc; e++) {
+ float xdif = (x + 16) - (_npcInfo[e].x + 12);
+ float ydif = (y + 16) - (_npcInfo[e].y + 12);
if ((abs(xdif) < 8 && abs(ydif) < 8)) {
float damage = 30 * (1 + RND() * 0.5);
- if (_npcinfo[e].hp > 0 && _npcinfo[e].pause < _ticks)
+ if (_npcInfo[e].hp > 0 && _npcInfo[e].pause < _ticks)
damageNPC(e, damage, 1);
}
}
}
// check for post damage
- if (nposts > 0) {
- for (int e = 0; e <= nposts - 1; e++) {
+ if (_postInfoNbr > 0) {
+ for (int e = 0; e <= _postInfoNbr - 1; e++) {
float xdif = (xloc + 16) - (_postInfo[e][0] + 8);
float ydif = (yloc + 16) - (_postInfo[e][1] + 8);
if ((abs(xdif) < 16 && abs(ydif) < 16)) {
- _objmapf[_curMap][(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = 1;
+ _objectMapFull[_curMap][(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = 1;
_objectMap[(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = -1;
rcSrc.left = _postInfo[e][0] / 2;
@@ -2000,9 +2000,9 @@ void GriffonEngine::updateSpells() {
}
}
- spellinfo[i].frame -= 0.5 * _fpsr;
- if (spellinfo[i].frame < 0) {
- spellinfo[i].frame = 0;
+ _spellInfo[i].frame -= 0.5 * _fpsr;
+ if (_spellInfo[i].frame < 0) {
+ _spellInfo[i].frame = 0;
_forcePause = false;
}
}
@@ -2013,8 +2013,8 @@ void GriffonEngine::updateSpells() {
long cl2 = _videoBuffer->format.RGBToColor(142, 173, 191);
long cl3 = _videoBuffer->format.RGBToColor(240, 240, 240);
- int px = spellinfo[i].enemyx + 12;
- int py = spellinfo[i].enemyy + 24;
+ int px = _spellInfo[i].enemyx + 12;
+ int py = _spellInfo[i].enemyy + 24;
int apx = px + (int)(RND() * 20 - 10);
int apy = py + (int)(RND() * 20 - 10);
@@ -2040,7 +2040,7 @@ void GriffonEngine::updateSpells() {
orn = rn;
- if (spellinfo[i].damagewho == 1) {
+ if (_spellInfo[i].damagewho == 1) {
float xdif = (x + 8) - (_player.px + 12);
float ydif = (y + 8) - (_player.py + 12);
@@ -2049,7 +2049,7 @@ void GriffonEngine::updateSpells() {
if (damage < 5)
damage = 5;
- if ((_npcinfo[spellinfo[i].npc].spriteset == kMonsterBatKitty) && (damage < 50))
+ if ((_npcInfo[_spellInfo[i].npc].spriteset == kMonsterBatKitty) && (damage < 50))
damage = 40 + (int)(RND() * 40);
if (_player.hp > 0)
@@ -2059,12 +2059,12 @@ void GriffonEngine::updateSpells() {
}
}
- spellinfo[i].frame -= 0.5 * _fpsr;
- if (spellinfo[i].frame < 0) {
- spellinfo[i].frame = 0;
+ _spellInfo[i].frame -= 0.5 * _fpsr;
+ if (_spellInfo[i].frame < 0) {
+ _spellInfo[i].frame = 0;
- _npcinfo[spellinfo[i].npc].attacking = false;
- _npcinfo[spellinfo[i].npc].attacknext = _ticks + _npcinfo[spellinfo[i].npc].attackdelay;
+ _npcInfo[_spellInfo[i].npc].attacking = false;
+ _npcInfo[_spellInfo[i].npc].attacknext = _ticks + _npcInfo[_spellInfo[i].npc].attackdelay;
}
}
}
@@ -2076,21 +2076,21 @@ void GriffonEngine::updateSpellsUnder() {
return;
for (int i = 0; i < kMaxSpell; i++) {
- if (spellinfo[i].frame > 0) {
- int spellnum = spellinfo[i].spellnum;
+ if (_spellInfo[i].frame > 0) {
+ int spellnum = _spellInfo[i].spellnum;
// water
if (spellnum == 0) {
- int fra = (32 - spellinfo[i].frame);
- int fr = (int)((32 - spellinfo[i].frame) * 2) % 4;
+ int fra = (32 - _spellInfo[i].frame);
+ int fr = (int)((32 - _spellInfo[i].frame) * 2) % 4;
rcSrc.left = fr * 48;
rcSrc.top = 96;
rcSrc.setWidth(48);
rcSrc.setHeight(48);
- rcDest.left = spellinfo[i].enemyx - 12;
- rcDest.top = spellinfo[i].enemyy - 8;
+ rcDest.left = _spellInfo[i].enemyx - 12;
+ rcDest.top = _spellInfo[i].enemyy - 8;
int f = 160;
if (fra < 8)
@@ -2102,14 +2102,14 @@ void GriffonEngine::updateSpellsUnder() {
_spellImg->blit(*_videoBuffer, rcDest.left, rcDest.top, Graphics::FLIP_NONE, &rcSrc);
_spellImg->setAlpha(255, true);
- spellinfo[i].frame = spellinfo[i].frame - 0.2 * _fpsr;
- if (spellinfo[i].frame < 0)
- spellinfo[i].frame = 0;
+ _spellInfo[i].frame = _spellInfo[i].frame - 0.2 * _fpsr;
+ if (_spellInfo[i].frame < 0)
+ _spellInfo[i].frame = 0;
- for (f = 1; f <= _lastnpc; f++) {
- int xdif = spellinfo[i].enemyx - _npcinfo[f].x;
- int ydif = spellinfo[i].enemyy - _npcinfo[f].y;
+ for (f = 1; f <= _lastNpc; f++) {
+ int xdif = _spellInfo[i].enemyx - _npcInfo[f].x;
+ int ydif = _spellInfo[i].enemyy - _npcInfo[f].y;
float dist = sqrt((float)(xdif * xdif + ydif * ydif));
@@ -2119,8 +2119,8 @@ void GriffonEngine::updateSpellsUnder() {
if (dist > 5) {
float ratio = (1 - dist / 25);
- float newx = _npcinfo[f].x + ratio * xdif / 3 * _fpsr;
- float newy = _npcinfo[f].y + ratio * ydif / 3 * _fpsr;
+ float newx = _npcInfo[f].x + ratio * xdif / 3 * _fpsr;
+ float newy = _npcInfo[f].y + ratio * ydif / 3 * _fpsr;
int sx = (newx / 2 + 6);
int sy = (newy / 2 + 10);
@@ -2129,15 +2129,15 @@ void GriffonEngine::updateSpellsUnder() {
unsigned int dq = *temp;
if (dq == 0) {
- _npcinfo[f].x = newx;
- _npcinfo[f].y = newy;
+ _npcInfo[f].x = newx;
+ _npcInfo[f].y = newy;
// _npcinfo[f].castpause = _ticks + 200;
} else {
int xpass = 0;
int ypass = 0;
sx = (newx / 2 + 6);
- sy = (_npcinfo[f].y / 2 + 10);
+ sy = (_npcInfo[f].y / 2 + 10);
temp = (uint32 *)_clipBg->getBasePtr(sx, sy);
dq = *temp;
@@ -2145,7 +2145,7 @@ void GriffonEngine::updateSpellsUnder() {
xpass = 1;
- sx = (_npcinfo[f].x / 2 + 6);
+ sx = (_npcInfo[f].x / 2 + 6);
sy = (newy / 2 + 10);
temp = (uint32 *)_clipBg->getBasePtr(sx, sy);
dq = *temp;
@@ -2154,14 +2154,14 @@ void GriffonEngine::updateSpellsUnder() {
ypass = 1;
if (ypass == 1) {
- newx = _npcinfo[f].x;
+ newx = _npcInfo[f].x;
} else if (xpass == 1) {
- newy = _npcinfo[f].y;
+ newy = _npcInfo[f].y;
}
if (xpass == 1 || ypass == 1) {
- _npcinfo[f].x = newx;
- _npcinfo[f].y = newy;
+ _npcInfo[f].x = newx;
+ _npcInfo[f].y = newy;
// _npcinfo[f].castpause = _ticks + 200;
}
}
@@ -2171,7 +2171,7 @@ void GriffonEngine::updateSpellsUnder() {
// fire
if (spellnum == 3) {
- float fr = (32 - spellinfo[i].frame);
+ float fr = (32 - _spellInfo[i].frame);
fr = fr * fr * (1 - cos(3.14159 / 4 + 3.14159 / 4 * fr / 32));
@@ -2179,14 +2179,14 @@ void GriffonEngine::updateSpellsUnder() {
fr = 32;
float s = 8;
- if (spellinfo[i].frame < 8)
- s = spellinfo[i].frame;
+ if (_spellInfo[i].frame < 8)
+ s = _spellInfo[i].frame;
int fra = (int)fr;
for (int f = 0; f <= 4; f++) {
for (int x = 0; x <= fra; x += 2) {
- if (spellinfo[i].legalive[f] >= x) {
+ if (_spellInfo[i].legalive[f] >= x) {
_spellImg->setAlpha(192 * sin(3.14159 * x / 32) * s / 8, true);
float an = 360 / 5 * f + x / 32 * 180;
@@ -2196,8 +2196,8 @@ void GriffonEngine::updateSpellsUnder() {
rcSrc.setWidth(16);
rcSrc.setHeight(16);
- float xloc = (float)(spellinfo[i].enemyx + 4 + x * 2 * cos(3.14159 / 180 * an) + (int)(RND() * 3) - 1);
- float yloc = (float)(spellinfo[i].enemyy + 4 + x * 2 * sin(3.14159 / 180 * an) + (int)(RND() * 3) - 1);
+ float xloc = (float)(_spellInfo[i].enemyx + 4 + x * 2 * cos(3.14159 / 180 * an) + (int)(RND() * 3) - 1);
+ float yloc = (float)(_spellInfo[i].enemyy + 4 + x * 2 * sin(3.14159 / 180 * an) + (int)(RND() * 3) - 1);
rcDest.left = (int)xloc;
rcDest.top = (int)yloc;
@@ -2211,21 +2211,21 @@ void GriffonEngine::updateSpellsUnder() {
unsigned int dq = *temp;
if (dq > 1000 && x > 4)
- spellinfo[i].legalive[f] = x;
+ _spellInfo[i].legalive[f] = x;
- if (spellinfo[i].damagewho == 0) {
- for (int e = 1; e <= _lastnpc; e++) {
- float xdif = (xloc + 8) - (_npcinfo[e].x + 12);
- float ydif = (yloc + 8) - (_npcinfo[e].y + 12);
+ if (_spellInfo[i].damagewho == 0) {
+ for (int e = 1; e <= _lastNpc; e++) {
+ float xdif = (xloc + 8) - (_npcInfo[e].x + 12);
+ float ydif = (yloc + 8) - (_npcInfo[e].y + 12);
if ((abs(xdif) < 8 && abs(ydif) < 8)) {
- float damage = (float)_player.spellDamage * (1.0 + RND() * 0.5) * (float)spellinfo[i].strength;
+ float damage = (float)_player.spellDamage * (1.0 + RND() * 0.5) * (float)_spellInfo[i].strength;
- if (_npcinfo[e].spriteset == kMonsterFireHydra)
+ if (_npcInfo[e].spriteset == kMonsterFireHydra)
damage = -damage;
- if (_npcinfo[e].spriteset == kMonsterFinalBoss)
+ if (_npcInfo[e].spriteset == kMonsterFinalBoss)
damage = -damage;
- if (_npcinfo[e].hp > 0 && _npcinfo[e].pause < _ticks) {
+ if (_npcInfo[e].hp > 0 && _npcInfo[e].pause < _ticks) {
damageNPC(e, damage, 1);
if (config.effects) {
int snd = playSound(_sfx[kSndFire]);
@@ -2236,12 +2236,12 @@ void GriffonEngine::updateSpellsUnder() {
}
}
- if (spellinfo[i].damagewho == 1) {
+ if (_spellInfo[i].damagewho == 1) {
float xdif = (xloc + 8) - (_player.px + 12);
float ydif = (yloc + 8) - (_player.py + 12);
if ((abs(xdif) < 8 && abs(ydif) < 8) && _player.pause < _ticks) {
- float damage = (float)_npcinfo[spellinfo[i].npc].spelldamage * (1.0 + RND() * 0.5);
+ float damage = (float)_npcInfo[_spellInfo[i].npc].spelldamage * (1.0 + RND() * 0.5);
if (_player.hp > 0) {
damagePlayer(damage);
@@ -2255,13 +2255,13 @@ void GriffonEngine::updateSpellsUnder() {
}
// check for post damage
- if (nposts > 0) {
- for (int e = 0; e <= nposts - 1; e++) {
+ if (_postInfoNbr > 0) {
+ for (int e = 0; e <= _postInfoNbr - 1; e++) {
float xdif = (xloc + 8) - (_postInfo[e][0] + 8);
float ydif = (yloc + 8) - (_postInfo[e][1] + 8);
if ((abs(xdif) < 8 && abs(ydif) < 8)) {
- _objmapf[_curMap][(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = 1;
+ _objectMapFull[_curMap][(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = 1;
_objectMap[(int)_postInfo[e][0] / 16][(int)_postInfo[e][1] / 16] = -1;
rcSrc.left = _postInfo[e][0] / 2;
@@ -2287,9 +2287,9 @@ void GriffonEngine::updateSpellsUnder() {
_spellImg->setAlpha(255, true);
- spellinfo[i].frame = spellinfo[i].frame - 0.2 * _fpsr;
- if (spellinfo[i].frame < 0)
- spellinfo[i].frame = 0;
+ _spellInfo[i].frame = _spellInfo[i].frame - 0.2 * _fpsr;
+ if (_spellInfo[i].frame < 0)
+ _spellInfo[i].frame = 0;
}
@@ -2297,9 +2297,9 @@ void GriffonEngine::updateSpellsUnder() {
// sprite 6 spitfire
if (spellnum == 7) {
- float xspan = spellinfo[i].enemyx - spellinfo[i].homex;
- float yspan = spellinfo[i].enemyy - spellinfo[i].homey;
- float fr = (32 - spellinfo[i].frame);
+ float xspan = _spellInfo[i].enemyx - _spellInfo[i].homex;
+ float yspan = _spellInfo[i].enemyy - _spellInfo[i].homey;
+ float fr = (32 - _spellInfo[i].frame);
for (int f = 0; f <= 7; f++) {
int alpha = 0;
@@ -2320,8 +2320,8 @@ void GriffonEngine::updateSpellsUnder() {
rcSrc.setWidth(16);
rcSrc.setHeight(16);
- float xloc = spellinfo[i].homex + xspan / 7 * f;
- float yloc = spellinfo[i].homey + yspan / 7 * f - yy;
+ float xloc = _spellInfo[i].homex + xspan / 7 * f;
+ float yloc = _spellInfo[i].homey + yspan / 7 * f - yy;
rcDest.left = xloc;
rcDest.top = yloc;
@@ -2329,12 +2329,12 @@ void GriffonEngine::updateSpellsUnder() {
if (xloc > -16 && xloc < 320 && yloc > -16 && yloc < 240) {
_spellImg->blit(*_videoBuffer, rcDest.left, rcDest.top, Graphics::FLIP_NONE, &rcSrc);
- if (spellinfo[i].damagewho == 1) {
+ if (_spellInfo[i].damagewho == 1) {
float xdif = (xloc + 8) - (_player.px + 12);
float ydif = (yloc + 8) - (_player.py + 12);
if ((abs(xdif) < 8 && abs(ydif) < 8) && _player.pause < _ticks && alpha > 64) {
- float damage = (float)_npcinfo[spellinfo[i].npc].spelldamage * (1.0 + RND() * 0.5);
+ float damage = (float)_npcInfo[_spellInfo[i].npc].spelldamage * (1.0 + RND() * 0.5);
if (_player.hp > 0) {
damagePlayer(damage);
@@ -2352,13 +2352,13 @@ void GriffonEngine::updateSpellsUnder() {
}
_spellImg->setAlpha(255, true);
- spellinfo[i].frame = spellinfo[i].frame - 0.5 * _fpsr;
- if (spellinfo[i].frame < 0)
- spellinfo[i].frame = 0;
+ _spellInfo[i].frame = _spellInfo[i].frame - 0.5 * _fpsr;
+ if (_spellInfo[i].frame < 0)
+ _spellInfo[i].frame = 0;
- if (ABS(spellinfo[i].frame) < kEpsilon) {
- _npcinfo[spellinfo[i].npc].attacking = false;
- _npcinfo[spellinfo[i].npc].attacknext = _ticks + _npcinfo[spellinfo[i].npc].attackdelay;
+ if (ABS(_spellInfo[i].frame) < kEpsilon) {
+ _npcInfo[_spellInfo[i].npc].attacking = false;
+ _npcInfo[_spellInfo[i].npc].attacknext = _ticks + _npcInfo[_spellInfo[i].npc].attackdelay;
}
}
}
diff --git a/engines/griffon/resources.cpp b/engines/griffon/resources.cpp
index e881845d1a..6f5b7e087f 100644
--- a/engines/griffon/resources.cpp
+++ b/engines/griffon/resources.cpp
@@ -55,7 +55,7 @@ namespace Griffon {
void GriffonEngine::initialize() {
// init char *_floatstri[kMaxFloat]
for (int i = 0; i < kMaxFloat; i++)
- _floatstri[i] = (char *)malloc(64); // 64 bytes each string (should be enough)
+ _floatStr[i] = (char *)malloc(64); // 64 bytes each string (should be enough)
_video = new Graphics::TransparentSurface;
_video->create(320, 240, g_system->getScreenFormat());
@@ -79,8 +79,8 @@ void GriffonEngine::initialize() {
mapImg[i] = loadImage(name, true);
}
- cloudimg = loadImage("art/clouds.bmp", true);
- cloudimg->setAlpha(96, true);
+ _cloudImg = loadImage("art/clouds.bmp", true);
+ _cloudImg->setAlpha(96, true);
_saveLoadImg = loadImage("art/saveloadnew.bmp", true);
@@ -191,7 +191,7 @@ void GriffonEngine::loadMap(int mapnum) {
mapnum = mapnum + 100;
for (int i = 0; i < kMaxSpell; i++)
- spellinfo[i].frame = 0;
+ _spellInfo[i].frame = 0;
_roomLock = false;
@@ -215,7 +215,7 @@ void GriffonEngine::loadMap(int mapnum) {
for (int x = 0; x <= 319; x++) {
for (int y = 0; y <= 239; y++)
- _triggerloc[x][y] = -1;
+ _triggerLoc[x][y] = -1;
}
// read *.trg file
@@ -226,16 +226,16 @@ void GriffonEngine::loadMap(int mapnum) {
if (!file.isOpen())
error("Cannot open file %s", name);
- INPUT("%i", &_ntriggers);
+ INPUT("%i", &_triggerNbr);
- for (int i = 0; i < _ntriggers; i++) {
+ for (int i = 0; i < _triggerNbr; i++) {
int mapx, mapy, trig;
INPUT("%i", &mapx);
INPUT("%i", &mapy);
INPUT("%i", &trig);
- _triggerloc[mapx][mapy] = trig;
+ _triggerLoc[mapx][mapy] = trig;
}
file.close();
@@ -255,7 +255,7 @@ void GriffonEngine::loadMap(int mapnum) {
}
if (_scriptFlag[kScriptFindShield][0] == 1 && _curMap == 4) {
- _triggerloc[9][7] = 5004;
+ _triggerLoc[9][7] = 5004;
tempmap[9][7] = 41;
tempmap[9][7 + 40] = 0;
}
@@ -387,10 +387,10 @@ void GriffonEngine::loadMap(int mapnum) {
}
_lastObj = 0;
- _lastnpc = 0;
+ _lastNpc = 0;
for (int i = 0; i < kMaxNPC; i++)
- _npcinfo[i].onmap = false;
+ _npcInfo[i].onmap = false;
for (int x = 0; x <= 19; x++) {
for (int y = 0; y <= 19; y++) {
@@ -412,7 +412,7 @@ void GriffonEngine::loadMap(int mapnum) {
int o = tempmap[5 * 40 + x][y];
- if (_objmapf[_curMap][x][y] == 0) {
+ if (_objectMapFull[_curMap][x][y] == 0) {
_objectMap[x][y] = o;
if (_objectInfo[o][0] > 1) {
@@ -437,25 +437,25 @@ void GriffonEngine::loadMap(int mapnum) {
if (npc == 1) {
int o = tempmap[4 * 40 + x][y];
- if (o > _lastnpc)
- _lastnpc = o;
+ if (o > _lastNpc)
+ _lastNpc = o;
- _npcinfo[o].x = x * 16 - 4;
- _npcinfo[o].y = y * 16 - 5;
+ _npcInfo[o].x = x * 16 - 4;
+ _npcInfo[o].y = y * 16 - 5;
- _npcinfo[o].walkdir = 1;
- _npcinfo[o].onmap = true;
+ _npcInfo[o].walkdir = 1;
+ _npcInfo[o].onmap = true;
}
}
}
if (_curMap == 62 && _scriptFlag[kScriptGardenMasterKey][0] > 0)
- _lastnpc = 0;
+ _lastNpc = 0;
if (_curMap == 73 && _scriptFlag[kScriptArmourChest][0] > 0)
- _lastnpc = 0;
+ _lastNpc = 0;
if (_curMap == 81 && _scriptFlag[kScriptCitadelMasterKey][0] > 0)
- _lastnpc = 0;
+ _lastNpc = 0;
if (_curMap == 73 && _scriptFlag[kScriptArmourChest][0] == 0)
_roomLock = true;
@@ -475,262 +475,262 @@ void GriffonEngine::loadMap(int mapnum) {
error("Cannot open file %s", name);
for (int i = 0; i < kMaxNPC; i++) {
- INPUT("%i", &_npcinfo[i].spriteset);
- INPUT("%i", &_npcinfo[i].x1);
- INPUT("%i", &_npcinfo[i].y1);
- INPUT("%i", &_npcinfo[i].x2);
- INPUT("%i", &_npcinfo[i].y2);
- INPUT("%i", &_npcinfo[i].movementmode);
- INPUT("%i", &_npcinfo[i].hp);
- INPUT("%i", &_npcinfo[i].item1);
- INPUT("%i", &_npcinfo[i].item2);
- INPUT("%i", &_npcinfo[i].item3);
- INPUT("%i", &_npcinfo[i].script);
+ INPUT("%i", &_npcInfo[i].spriteset);
+ INPUT("%i", &_npcInfo[i].x1);
+ INPUT("%i", &_npcInfo[i].y1);
+ INPUT("%i", &_npcInfo[i].x2);
+ INPUT("%i", &_npcInfo[i].y2);
+ INPUT("%i", &_npcInfo[i].movementmode);
+ INPUT("%i", &_npcInfo[i].hp);
+ INPUT("%i", &_npcInfo[i].item1);
+ INPUT("%i", &_npcInfo[i].item2);
+ INPUT("%i", &_npcInfo[i].item3);
+ INPUT("%i", &_npcInfo[i].script);
// baby dragon
- if (_npcinfo[i].spriteset == kMonsterBabyDragon) {
- _npcinfo[i].hp = 12;
- _npcinfo[i].attackdelay = 2000;
+ if (_npcInfo[i].spriteset == kMonsterBabyDragon) {
+ _npcInfo[i].hp = 12;
+ _npcInfo[i].attackdelay = 2000;
- _npcinfo[i].attackdamage = 2;
- _npcinfo[i].spelldamage = 0;
+ _npcInfo[i].attackdamage = 2;
+ _npcInfo[i].spelldamage = 0;
- _npcinfo[i].walkspd = 1;
+ _npcInfo[i].walkspd = 1;
if (RND() * 5 == 0)
- _npcinfo[i].hp = 0;
+ _npcInfo[i].hp = 0;
}
// onewing
- if (_npcinfo[i].spriteset == kMonsterOneWing) {
- _npcinfo[i].hp = 200;
- _npcinfo[i].attackdelay = 2000;
- _npcinfo[i].swayspd = 1;
+ if (_npcInfo[i].spriteset == kMonsterOneWing) {
+ _npcInfo[i].hp = 200;
+ _npcInfo[i].attackdelay = 2000;
+ _npcInfo[i].swayspd = 1;
- _npcinfo[i].attackdamage = 24;
- _npcinfo[i].spelldamage = 30;
+ _npcInfo[i].attackdamage = 24;
+ _npcInfo[i].spelldamage = 30;
- _npcinfo[i].walkspd = 1.4f;
- _npcinfo[i].castpause = _ticks;
+ _npcInfo[i].walkspd = 1.4f;
+ _npcInfo[i].castpause = _ticks;
}
// boss1
- if (_npcinfo[i].spriteset == kMonsterBoss1) {
- _npcinfo[i].hp = 300;
- _npcinfo[i].attackdelay = 2200;
+ if (_npcInfo[i].spriteset == kMonsterBoss1) {
+ _npcInfo[i].hp = 300;
+ _npcInfo[i].attackdelay = 2200;
- _npcinfo[i].attackdamage = 0;
- _npcinfo[i].spelldamage = 30;
+ _npcInfo[i].attackdamage = 0;
+ _npcInfo[i].spelldamage = 30;
- _npcinfo[i].walkspd = 1.2f;
+ _npcInfo[i].walkspd = 1.2f;
}
// black knights
- if (_npcinfo[i].spriteset == kMonsterBlackKnight) {
- _npcinfo[i].hp = 200;
- _npcinfo[i].attackdelay = 2800;
+ if (_npcInfo[i].spriteset == kMonsterBlackKnight) {
+ _npcInfo[i].hp = 200;
+ _npcInfo[i].attackdelay = 2800;
- _npcinfo[i].attackdamage = 0;
- _npcinfo[i].spelldamage = 30;
+ _npcInfo[i].attackdamage = 0;
+ _npcInfo[i].spelldamage = 30;
- _npcinfo[i].walkspd = 1;
+ _npcInfo[i].walkspd = 1;
}
// boss2 firehydra
- if (_npcinfo[i].spriteset == kMonsterFireHydra) {
- _npcinfo[i].hp = 600;
- _npcinfo[i].attackdelay = 2200;
+ if (_npcInfo[i].spriteset == kMonsterFireHydra) {
+ _npcInfo[i].hp = 600;
+ _npcInfo[i].attackdelay = 2200;
- _npcinfo[i].attackdamage = 50;
- _npcinfo[i].spelldamage = 30;
+ _npcInfo[i].attackdamage = 50;
+ _npcInfo[i].spelldamage = 30;
- _npcinfo[i].walkspd = 1.3f;
+ _npcInfo[i].walkspd = 1.3f;
- _npcinfo[i].swayangle = 0;
+ _npcInfo[i].swayangle = 0;
}
// baby fire dragon
- if (_npcinfo[i].spriteset == kMonsterRedDragon) {
- _npcinfo[i].hp = 20;
- _npcinfo[i].attackdelay = 1500;
+ if (_npcInfo[i].spriteset == kMonsterRedDragon) {
+ _npcInfo[i].hp = 20;
+ _npcInfo[i].attackdelay = 1500;
- _npcinfo[i].attackdamage = 0;
- _npcinfo[i].spelldamage = 12;
+ _npcInfo[i].attackdamage = 0;
+ _npcInfo[i].spelldamage = 12;
- _npcinfo[i].walkspd = 1;
+ _npcInfo[i].walkspd = 1;
if (RND() * 5 == 0)
- _npcinfo[i].hp = 0;
+ _npcInfo[i].hp = 0;
}
// priest1
- if (_npcinfo[i].spriteset == kMonsterPriest) {
- _npcinfo[i].hp = 40;
- _npcinfo[i].attackdelay = 5000;
+ if (_npcInfo[i].spriteset == kMonsterPriest) {
+ _npcInfo[i].hp = 40;
+ _npcInfo[i].attackdelay = 5000;
- _npcinfo[i].attackdamage = 0;
- _npcinfo[i].spelldamage = 8;
+ _npcInfo[i].attackdamage = 0;
+ _npcInfo[i].spelldamage = 8;
- _npcinfo[i].walkspd = 1;
+ _npcInfo[i].walkspd = 1;
if (RND() * 8 == 0)
- _npcinfo[i].hp = 0;
+ _npcInfo[i].hp = 0;
}
// yellow fire dragon
- if (_npcinfo[i].spriteset == kMonsterYellowDragon) {
- _npcinfo[i].hp = 100;
- _npcinfo[i].attackdelay = 1500;
+ if (_npcInfo[i].spriteset == kMonsterYellowDragon) {
+ _npcInfo[i].hp = 100;
+ _npcInfo[i].attackdelay = 1500;
- _npcinfo[i].attackdamage = 0;
- _npcinfo[i].spelldamage = 24;
+ _npcInfo[i].attackdamage = 0;
+ _npcInfo[i].spelldamage = 24;
- _npcinfo[i].walkspd = 1;
+ _npcInfo[i].walkspd = 1;
if (RND() * 5 == 0)
- _npcinfo[i].hp = 0;
+ _npcInfo[i].hp = 0;
}
// twowing
- if (_npcinfo[i].spriteset == kMonsterTwoWing) {
- _npcinfo[i].hp = 140;
- _npcinfo[i].attackdelay = 2000;
- _npcinfo[i].swayspd = 1;
+ if (_npcInfo[i].spriteset == kMonsterTwoWing) {
+ _npcInfo[i].hp = 140;
+ _npcInfo[i].attackdelay = 2000;
+ _npcInfo[i].swayspd = 1;
- _npcinfo[i].attackdamage = 30;
- _npcinfo[i].spelldamage = 0;
+ _npcInfo[i].attackdamage = 30;
+ _npcInfo[i].spelldamage = 0;
- _npcinfo[i].walkspd = 1;
+ _npcInfo[i].walkspd = 1;
- _npcinfo[i].castpause = 0;
+ _npcInfo[i].castpause = 0;
}
// dragon2
- if (_npcinfo[i].spriteset == kMonsterDragon2) {
- _npcinfo[i].hp = 80;
- _npcinfo[i].attackdelay = 1500;
+ if (_npcInfo[i].spriteset == kMonsterDragon2) {
+ _npcInfo[i].hp = 80;
+ _npcInfo[i].attackdelay = 1500;
- _npcinfo[i].attackdamage = 24;
- _npcinfo[i].spelldamage = 0;
+ _npcInfo[i].attackdamage = 24;
+ _npcInfo[i].spelldamage = 0;
- _npcinfo[i].walkspd = 1;
+ _npcInfo[i].walkspd = 1;
- _npcinfo[i].floating = RND() * 16;
+ _npcInfo[i].floating = RND() * 16;
}
// end boss
- if (_npcinfo[i].spriteset == kMonsterFinalBoss) {
- _npcinfo[i].hp = 1200;
- _npcinfo[i].attackdelay = 2000;
+ if (_npcInfo[i].spriteset == kMonsterFinalBoss) {
+ _npcInfo[i].hp = 1200;
+ _npcInfo[i].attackdelay = 2000;
- _npcinfo[i].attackdamage = 100;
- _npcinfo[i].spelldamage = 60;
+ _npcInfo[i].attackdamage = 100;
+ _npcInfo[i].spelldamage = 60;
- _npcinfo[i].walkspd = 1;
+ _npcInfo[i].walkspd = 1;
- _npcinfo[i].floating = RND() * 16;
+ _npcInfo[i].floating = RND() * 16;
}
// bat kitty
- if (_npcinfo[i].spriteset == kMonsterBatKitty) {
- _npcinfo[i].hp = 800;
- _npcinfo[i].attackdelay = 2000;
+ if (_npcInfo[i].spriteset == kMonsterBatKitty) {
+ _npcInfo[i].hp = 800;
+ _npcInfo[i].attackdelay = 2000;
- _npcinfo[i].attackdamage = 100;
- _npcinfo[i].spelldamage = 50;
+ _npcInfo[i].attackdamage = 100;
+ _npcInfo[i].spelldamage = 50;
- _npcinfo[i].walkspd = 1;
+ _npcInfo[i].walkspd = 1;
- _npcinfo[i].floating = RND() * 16;
+ _npcInfo[i].floating = RND() * 16;
}
- if (!_npcinfo[i].onmap)
- _npcinfo[i].hp = 0;
-
- _npcinfo[i].maxhp = _npcinfo[i].hp;
-
- _npcinfo[i].attacking = false;
- _npcinfo[i].attackframe = 0;
- _npcinfo[i].cattackframe = 0;
- _npcinfo[i].attackspd = 1.5;
- _npcinfo[i].attacknext = _ticks + _npcinfo[i].attackdelay * (1 + RND() * 2);
-
- 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;
- _npcinfo[i].bodysection[3].sprite = 3;
- _npcinfo[i].bodysection[4].sprite = 4;
- _npcinfo[i].bodysection[5].sprite = 3;
- _npcinfo[i].bodysection[6].sprite = 3;
- _npcinfo[i].bodysection[7].sprite = 5;
-
- _npcinfo[i].bodysection[0].bonelength = 8;
- _npcinfo[i].bodysection[1].bonelength = 7;
- _npcinfo[i].bodysection[2].bonelength = 6;
- _npcinfo[i].bodysection[3].bonelength = 4;
- _npcinfo[i].bodysection[4].bonelength = 4;
- _npcinfo[i].bodysection[5].bonelength = 4;
- _npcinfo[i].bodysection[6].bonelength = 4;
+ if (!_npcInfo[i].onmap)
+ _npcInfo[i].hp = 0;
+
+ _npcInfo[i].maxhp = _npcInfo[i].hp;
+
+ _npcInfo[i].attacking = false;
+ _npcInfo[i].attackframe = 0;
+ _npcInfo[i].cattackframe = 0;
+ _npcInfo[i].attackspd = 1.5;
+ _npcInfo[i].attacknext = _ticks + _npcInfo[i].attackdelay * (1 + RND() * 2);
+
+ 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;
+ _npcInfo[i].bodysection[3].sprite = 3;
+ _npcInfo[i].bodysection[4].sprite = 4;
+ _npcInfo[i].bodysection[5].sprite = 3;
+ _npcInfo[i].bodysection[6].sprite = 3;
+ _npcInfo[i].bodysection[7].sprite = 5;
+
+ _npcInfo[i].bodysection[0].bonelength = 8;
+ _npcInfo[i].bodysection[1].bonelength = 7;
+ _npcInfo[i].bodysection[2].bonelength = 6;
+ _npcInfo[i].bodysection[3].bonelength = 4;
+ _npcInfo[i].bodysection[4].bonelength = 4;
+ _npcInfo[i].bodysection[5].bonelength = 4;
+ _npcInfo[i].bodysection[6].bonelength = 4;
for (int f = 0; f <= 7; f++) {
- _npcinfo[i].bodysection[f].x = _npcinfo[i].x + 12;
- _npcinfo[i].bodysection[f].y = _npcinfo[i].y + 14;
+ _npcInfo[i].bodysection[f].x = _npcInfo[i].x + 12;
+ _npcInfo[i].bodysection[f].y = _npcInfo[i].y + 14;
}
- _npcinfo[i].headtargetx[0] = _npcinfo[i].x + 12;
- _npcinfo[i].headtargety[0] = _npcinfo[i].y + 14;
+ _npcInfo[i].headtargetx[0] = _npcInfo[i].x + 12;
+ _npcInfo[i].headtargety[0] = _npcInfo[i].y + 14;
}
- if (_npcinfo[i].spriteset == kMonsterFireHydra) {
+ 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;
+ _npcInfo[i].bodysection[f].x = _npcInfo[i].x + 12;
+ _npcInfo[i].bodysection[f].y = _npcInfo[i].y + 14;
}
for (int f = 0; f <= 2; f++) {
- _npcinfo[i].headtargetx[f] = _npcinfo[i].x + 12;
- _npcinfo[i].headtargety[f] = _npcinfo[i].y + 14;
+ _npcInfo[i].headtargetx[f] = _npcInfo[i].x + 12;
+ _npcInfo[i].headtargety[f] = _npcInfo[i].y + 14;
- _npcinfo[i].attacking2[f] = false;
- _npcinfo[i].attackframe2[f] = 0;
+ _npcInfo[i].attacking2[f] = false;
+ _npcInfo[i].attackframe2[f] = 0;
}
}
- if (_npcinfo[i].script == kScriptMasterKey) {
+ if (_npcInfo[i].script == kScriptMasterKey) {
_roomLock = true;
if (_scriptFlag[kScriptMasterKey][0] > 0) {
_roomLock = false;
- _npcinfo[i].hp = 0;
+ _npcInfo[i].hp = 0;
}
}
- if (_npcinfo[i].script == kScriptFindCrystal) {
+ if (_npcInfo[i].script == kScriptFindCrystal) {
_roomLock = true;
if (_scriptFlag[kScriptFindCrystal][0] > 0) {
_roomLock = false;
- _npcinfo[i].hp = 0;
+ _npcInfo[i].hp = 0;
}
}
- if (_npcinfo[i].script == kScriptFindSword) {
+ if (_npcInfo[i].script == kScriptFindSword) {
_roomLock = true;
if (_scriptFlag[kScriptFindSword][0] > 0) {
_roomLock = false;
- _npcinfo[i].hp = 0;
+ _npcInfo[i].hp = 0;
}
}
- if (_npcinfo[i].script == kScriptGetSword3) {
+ if (_npcInfo[i].script == kScriptGetSword3) {
_roomLock = true;
if (_scriptFlag[kScriptGetSword3][0] > 0) {
_roomLock = false;
- _npcinfo[i].hp = 0;
+ _npcInfo[i].hp = 0;
}
}
- _npcinfo[i].pause = _ticks;
+ _npcInfo[i].pause = _ticks;
}
file.close();
@@ -967,92 +967,92 @@ void GriffonEngine::loadAnims() {
_anims[2] = loadImage("art/anims2.bmp", true);
// huge
- _animset2[0].xofs = 8;
- _animset2[0].yofs = 7;
- _animset2[0].x = 123;
- _animset2[0].y = 0;
- _animset2[0].w = 18;
- _animset2[0].h = 16;
+ _animSet2[0].xofs = 8;
+ _animSet2[0].yofs = 7;
+ _animSet2[0].x = 123;
+ _animSet2[0].y = 0;
+ _animSet2[0].w = 18;
+ _animSet2[0].h = 16;
// big
- _animset2[1].xofs = 7;
- _animset2[1].yofs = 7;
- _animset2[1].x = 107;
- _animset2[1].y = 0;
- _animset2[1].w = 16;
- _animset2[1].h = 14;
+ _animSet2[1].xofs = 7;
+ _animSet2[1].yofs = 7;
+ _animSet2[1].x = 107;
+ _animSet2[1].y = 0;
+ _animSet2[1].w = 16;
+ _animSet2[1].h = 14;
// med
- _animset2[2].xofs = 6;
- _animset2[2].yofs = 6;
- _animset2[2].x = 93;
- _animset2[2].y = 0;
- _animset2[2].w = 14;
- _animset2[2].h = 13;
+ _animSet2[2].xofs = 6;
+ _animSet2[2].yofs = 6;
+ _animSet2[2].x = 93;
+ _animSet2[2].y = 0;
+ _animSet2[2].w = 14;
+ _animSet2[2].h = 13;
// small
- _animset2[3].xofs = 4;
- _animset2[3].yofs = 4;
- _animset2[3].x = 83;
- _animset2[3].y = 0;
- _animset2[3].w = 10;
- _animset2[3].h = 10;
+ _animSet2[3].xofs = 4;
+ _animSet2[3].yofs = 4;
+ _animSet2[3].x = 83;
+ _animSet2[3].y = 0;
+ _animSet2[3].w = 10;
+ _animSet2[3].h = 10;
// wing
- _animset2[4].xofs = 4;
- _animset2[4].yofs = 20;
- _animset2[4].x = 42;
- _animset2[4].y = 0;
- _animset2[4].w = 41;
- _animset2[4].h = 33;
+ _animSet2[4].xofs = 4;
+ _animSet2[4].yofs = 20;
+ _animSet2[4].x = 42;
+ _animSet2[4].y = 0;
+ _animSet2[4].w = 41;
+ _animSet2[4].h = 33;
// head
- _animset2[5].xofs = 20;
- _animset2[5].yofs = 18;
- _animset2[5].x = 0;
- _animset2[5].y = 0;
- _animset2[5].w = 42;
- _animset2[5].h = 36;
+ _animSet2[5].xofs = 20;
+ _animSet2[5].yofs = 18;
+ _animSet2[5].x = 0;
+ _animSet2[5].y = 0;
+ _animSet2[5].w = 42;
+ _animSet2[5].h = 36;
_anims[9] = loadImage("art/anims9.bmp", true);
// huge
- _animset9[0].xofs = 8;
- _animset9[0].yofs = 7;
- _animset9[0].x = 154;
- _animset9[0].y = 0;
- _animset9[0].w = 18;
- _animset9[0].h = 16;
+ _animSet9[0].xofs = 8;
+ _animSet9[0].yofs = 7;
+ _animSet9[0].x = 154;
+ _animSet9[0].y = 0;
+ _animSet9[0].w = 18;
+ _animSet9[0].h = 16;
// big
- _animset9[1].xofs = 7;
- _animset9[1].yofs = 7;
- _animset9[1].x = 138;
- _animset9[1].y = 0;
- _animset9[1].w = 16;
- _animset9[1].h = 14;
+ _animSet9[1].xofs = 7;
+ _animSet9[1].yofs = 7;
+ _animSet9[1].x = 138;
+ _animSet9[1].y = 0;
+ _animSet9[1].w = 16;
+ _animSet9[1].h = 14;
// med
- _animset9[2].xofs = 6;
- _animset9[2].yofs = 6;
- _animset9[2].x = 93 + 31;
- _animset9[2].y = 0;
- _animset9[2].w = 14;
- _animset9[2].h = 13;
+ _animSet9[2].xofs = 6;
+ _animSet9[2].yofs = 6;
+ _animSet9[2].x = 93 + 31;
+ _animSet9[2].y = 0;
+ _animSet9[2].w = 14;
+ _animSet9[2].h = 13;
// small
- _animset9[3].xofs = 4;
- _animset9[3].yofs = 4;
- _animset9[3].x = 83 + 31;
- _animset9[3].y = 0;
- _animset9[3].w = 10;
- _animset9[3].h = 10;
+ _animSet9[3].xofs = 4;
+ _animSet9[3].yofs = 4;
+ _animSet9[3].x = 83 + 31;
+ _animSet9[3].y = 0;
+ _animSet9[3].w = 10;
+ _animSet9[3].h = 10;
// wing
- _animset9[4].xofs = 36;
- _animset9[4].yofs = 20;
- _animset9[4].x = 42;
- _animset9[4].y = 0;
- _animset9[4].w = 72;
- _animset9[4].h = 33;
+ _animSet9[4].xofs = 36;
+ _animSet9[4].yofs = 20;
+ _animSet9[4].x = 42;
+ _animSet9[4].y = 0;
+ _animSet9[4].w = 72;
+ _animSet9[4].h = 33;
// head
- _animset9[5].xofs = 20;
- _animset9[5].yofs = 18;
- _animset9[5].x = 0;
- _animset9[5].y = 0;
- _animset9[5].w = 42;
- _animset9[5].h = 36;
+ _animSet9[5].xofs = 20;
+ _animSet9[5].yofs = 18;
+ _animSet9[5].x = 0;
+ _animSet9[5].y = 0;
+ _animSet9[5].w = 42;
+ _animSet9[5].h = 36;
_anims[3] = loadImage("art/anims3.bmp", true);
_anims[4] = loadImage("art/anims4.bmp", true);
diff --git a/engines/griffon/saveload.cpp b/engines/griffon/saveload.cpp
index aab7bcb14a..42abff0c56 100644
--- a/engines/griffon/saveload.cpp
+++ b/engines/griffon/saveload.cpp
@@ -111,7 +111,7 @@ int GriffonEngine::loadState(int slotnum) {
for (int a = 0; a <= 999; a++) {
for (int b = 0; b <= 20; b++) {
for (int c = 0; c <= 14; c++) {
- INPUT("%i", &_objmapf[a][b][c]);
+ INPUT("%i", &_objectMapFull[a][b][c]);
}
}
}
@@ -236,7 +236,7 @@ int GriffonEngine::saveState(int slotnum) {
for (int a = 0; a <= 999; a++) {
for (int b = 0; b <= 20; b++) {
for (int c = 0; c <= 14; c++) {
- PRINT("%i", _objmapf[a][b][c]);
+ PRINT("%i", _objectMapFull[a][b][c]);
}
}
}