aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--devtools/create_kyradat/create_kyradat.cpp42
-rw-r--r--devtools/create_kyradat/create_kyradat.h14
-rw-r--r--devtools/create_kyradat/games.cpp28
-rw-r--r--devtools/create_kyradat/tables.cpp28
-rw-r--r--engines/kyra/chargen.cpp2
-rw-r--r--engines/kyra/eobcommon.cpp24
-rw-r--r--engines/kyra/eobcommon.h12
-rw-r--r--engines/kyra/resource.h14
-rw-r--r--engines/kyra/staticres_eob.cpp16
9 files changed, 90 insertions, 90 deletions
diff --git a/devtools/create_kyradat/create_kyradat.cpp b/devtools/create_kyradat/create_kyradat.cpp
index 11e868f3ed..d500cbd686 100644
--- a/devtools/create_kyradat/create_kyradat.cpp
+++ b/devtools/create_kyradat/create_kyradat.cpp
@@ -228,13 +228,13 @@ const ExtractFilename extractFilenames[] = {
{ kEobBaseChargenRaceMinStats, k3TypeRaw16to8, false },
{ kEobBaseChargenRaceMaxStats, kLolTypeRaw16, false },
- { kEobBaseConstModTable1, kTypeRawData, false },
- { kEobBaseConstModTable2, kTypeRawData, false },
- { kEobBaseConstModTable3, kTypeRawData, false },
- { kEobBaseConstModTable4, kTypeRawData, false },
- { kEobBaseConstModLvlIndex, kTypeRawData, false },
- { kEobBaseConstModDiv, kTypeRawData, false },
- { kEobBaseConstModExt, kTypeRawData, false },
+ { kEobBaseSaveThrowTable1, kTypeRawData, false },
+ { kEobBaseSaveThrowTable2, kTypeRawData, false },
+ { kEobBaseSaveThrowTable3, kTypeRawData, false },
+ { kEobBaseSaveThrowTable4, kTypeRawData, false },
+ { kEobBaseSaveThrwLvlIndex, kTypeRawData, false },
+ { kEobBaseSaveThrwModDiv, kTypeRawData, false },
+ { kEobBaseSaveThrwModExt, kTypeRawData, false },
{ kEobBasePryDoorStrings, kTypeStringList, true },
{ kEobBaseWarningStrings, kTypeStringList, true },
@@ -1369,20 +1369,20 @@ const char *getIdString(const int id) {
return "kEobBaseChargenRaceMinStats";
case kEobBaseChargenRaceMaxStats:
return "kEobBaseChargenRaceMaxStats";
- case kEobBaseConstModTable1:
- return "kEobBaseConstModTable1";
- case kEobBaseConstModTable2:
- return "kEobBaseConstModTable2";
- case kEobBaseConstModTable3:
- return "kEobBaseConstModTable3";
- case kEobBaseConstModTable4:
- return "kEobBaseConstModTable4";
- case kEobBaseConstModLvlIndex:
- return "kEobBaseConstModLvlIndex";
- case kEobBaseConstModDiv:
- return "kEobBaseConstModDiv";
- case kEobBaseConstModExt:
- return "kEobBaseConstModExt";
+ case kEobBaseSaveThrowTable1:
+ return "kEobBaseSaveThrowTable1";
+ case kEobBaseSaveThrowTable2:
+ return "kEobBaseSaveThrowTable2";
+ case kEobBaseSaveThrowTable3:
+ return "kEobBaseSaveThrowTable3";
+ case kEobBaseSaveThrowTable4:
+ return "kEobBaseSaveThrowTable4";
+ case kEobBaseSaveThrwLvlIndex:
+ return "kEobBaseSaveThrwLvlIndex";
+ case kEobBaseSaveThrwModDiv:
+ return "kEobBaseSaveThrwModDiv";
+ case kEobBaseSaveThrwModExt:
+ return "kEobBaseSaveThrwModExt";
case kEobBasePryDoorStrings:
return "kEobBasePryDoorStrings";
case kEobBaseWarningStrings:
diff --git a/devtools/create_kyradat/create_kyradat.h b/devtools/create_kyradat/create_kyradat.h
index 4ac94755e7..08b71ee515 100644
--- a/devtools/create_kyradat/create_kyradat.h
+++ b/devtools/create_kyradat/create_kyradat.h
@@ -204,13 +204,13 @@ enum kExtractID {
kEobBaseChargenRaceMinStats,
kEobBaseChargenRaceMaxStats,
- kEobBaseConstModTable1,
- kEobBaseConstModTable2,
- kEobBaseConstModTable3,
- kEobBaseConstModTable4,
- kEobBaseConstModLvlIndex,
- kEobBaseConstModDiv,
- kEobBaseConstModExt,
+ kEobBaseSaveThrowTable1,
+ kEobBaseSaveThrowTable2,
+ kEobBaseSaveThrowTable3,
+ kEobBaseSaveThrowTable4,
+ kEobBaseSaveThrwLvlIndex,
+ kEobBaseSaveThrwModDiv,
+ kEobBaseSaveThrwModExt,
kEobBasePryDoorStrings,
kEobBaseWarningStrings,
diff --git a/devtools/create_kyradat/games.cpp b/devtools/create_kyradat/games.cpp
index cc81abaa39..65c1a23d0c 100644
--- a/devtools/create_kyradat/games.cpp
+++ b/devtools/create_kyradat/games.cpp
@@ -1046,13 +1046,13 @@ const int eob1FloppyNeed[] = {
kEobBaseChargenRaceMinStats,
kEobBaseChargenRaceMaxStats,
- kEobBaseConstModTable1,
- kEobBaseConstModTable2,
- kEobBaseConstModTable3,
- kEobBaseConstModTable4,
- kEobBaseConstModLvlIndex,
- kEobBaseConstModDiv,
- kEobBaseConstModExt,
+ kEobBaseSaveThrowTable1,
+ kEobBaseSaveThrowTable2,
+ kEobBaseSaveThrowTable3,
+ kEobBaseSaveThrowTable4,
+ kEobBaseSaveThrwLvlIndex,
+ kEobBaseSaveThrwModDiv,
+ kEobBaseSaveThrwModExt,
kEob1MainMenuStrings,
kEob1BonusStrings,
@@ -1313,13 +1313,13 @@ const int eob2FloppyNeed[] = {
kEobBaseChargenRaceMinStats,
kEobBaseChargenRaceMaxStats,
- kEobBaseConstModTable1,
- kEobBaseConstModTable2,
- kEobBaseConstModTable3,
- kEobBaseConstModTable4,
- kEobBaseConstModLvlIndex,
- kEobBaseConstModDiv,
- kEobBaseConstModExt,
+ kEobBaseSaveThrowTable1,
+ kEobBaseSaveThrowTable2,
+ kEobBaseSaveThrowTable3,
+ kEobBaseSaveThrowTable4,
+ kEobBaseSaveThrwLvlIndex,
+ kEobBaseSaveThrwModDiv,
+ kEobBaseSaveThrwModExt,
kEobBasePryDoorStrings,
kEobBaseWarningStrings,
diff --git a/devtools/create_kyradat/tables.cpp b/devtools/create_kyradat/tables.cpp
index 064b3c80ae..c8547804ba 100644
--- a/devtools/create_kyradat/tables.cpp
+++ b/devtools/create_kyradat/tables.cpp
@@ -1401,37 +1401,37 @@ const ExtractEntrySearchData kEobBaseChargenRaceMaxStatsProvider[] = {
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEobBaseConstModTable1Provider[] = {
+const ExtractEntrySearchData kEobBaseSaveThrowTable1Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000032, 0x00000214, { { 0x3D, 0x89, 0x30, 0x0A, 0x5C, 0x4A, 0x0F, 0xC3, 0xC7, 0x6B, 0x72, 0x7C, 0x12, 0x51, 0x8D, 0x8E } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEobBaseConstModTable2Provider[] = {
+const ExtractEntrySearchData kEobBaseSaveThrowTable2Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000019, 0x000000E7, { { 0xF4, 0x0D, 0xDF, 0xA3, 0x23, 0x71, 0x76, 0x2A, 0xC5, 0x6F, 0xF1, 0x59, 0x5F, 0x45, 0x73, 0x05 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEobBaseConstModTable3Provider[] = {
+const ExtractEntrySearchData kEobBaseSaveThrowTable3Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000023, 0x00000155, { { 0x42, 0x98, 0x84, 0x00, 0x70, 0x8A, 0x7B, 0x26, 0xC0, 0x96, 0xA3, 0x28, 0x41, 0x36, 0x4B, 0x21 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEobBaseConstModTable4Provider[] = {
+const ExtractEntrySearchData kEobBaseSaveThrowTable4Provider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x0000001E, 0x0000013B, { { 0xAB, 0x84, 0x2B, 0x0A, 0xC2, 0x46, 0xFF, 0x83, 0x03, 0xF8, 0x3F, 0x32, 0x53, 0xA2, 0x95, 0x65 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEobBaseConstModLvlIndexProvider[] = {
+const ExtractEntrySearchData kEobBaseSaveThrwLvlIndexProvider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000006, 0x00000070, { { 0x57, 0x48, 0x5F, 0x75, 0x79, 0xD4, 0xAA, 0x7D, 0xB7, 0xEB, 0x19, 0x9F, 0xCF, 0x99, 0x29, 0x29 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEobBaseConstModDivProvider[] = {
+const ExtractEntrySearchData kEobBaseSaveThrwModDivProvider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000006, 0x00000012, { { 0x50, 0x29, 0x51, 0x65, 0x0B, 0xF1, 0xCC, 0xDA, 0x2C, 0xA4, 0x7E, 0xEE, 0x20, 0xB0, 0x29, 0xB1 } } } },
EXTRACT_END_ENTRY
};
-const ExtractEntrySearchData kEobBaseConstModExtProvider[] = {
+const ExtractEntrySearchData kEobBaseSaveThrwModExtProvider[] = {
{ UNK_LANG, kPlatformUnknown, { 0x00000006, 0x00000030, { { 0x07, 0x7D, 0x61, 0x1C, 0x95, 0xEC, 0x9A, 0xCE, 0xA1, 0x29, 0x83, 0x2F, 0xCA, 0x95, 0x95, 0xF5 } } } },
EXTRACT_END_ENTRY
};
@@ -3860,13 +3860,13 @@ const ExtractEntry extractProviders[] = {
{ kEobBaseChargenRaceMinStats, kEobBaseChargenRaceMinStatsProvider },
{ kEobBaseChargenRaceMaxStats, kEobBaseChargenRaceMaxStatsProvider },
- { kEobBaseConstModTable1, kEobBaseConstModTable1Provider },
- { kEobBaseConstModTable2, kEobBaseConstModTable2Provider },
- { kEobBaseConstModTable3, kEobBaseConstModTable3Provider },
- { kEobBaseConstModTable4, kEobBaseConstModTable4Provider },
- { kEobBaseConstModLvlIndex, kEobBaseConstModLvlIndexProvider },
- { kEobBaseConstModDiv, kEobBaseConstModDivProvider },
- { kEobBaseConstModExt, kEobBaseConstModExtProvider },
+ { kEobBaseSaveThrowTable1, kEobBaseSaveThrowTable1Provider },
+ { kEobBaseSaveThrowTable2, kEobBaseSaveThrowTable2Provider },
+ { kEobBaseSaveThrowTable3, kEobBaseSaveThrowTable3Provider },
+ { kEobBaseSaveThrowTable4, kEobBaseSaveThrowTable4Provider },
+ { kEobBaseSaveThrwLvlIndex, kEobBaseSaveThrwLvlIndexProvider },
+ { kEobBaseSaveThrwModDiv, kEobBaseSaveThrwModDivProvider },
+ { kEobBaseSaveThrwModExt, kEobBaseSaveThrwModExtProvider },
{ kEobBasePryDoorStrings, kEobBasePryDoorStringsProvider },
{ kEobBaseWarningStrings, kEobBaseWarningStringsProvider },
diff --git a/engines/kyra/chargen.cpp b/engines/kyra/chargen.cpp
index 5231093133..a288359092 100644
--- a/engines/kyra/chargen.cpp
+++ b/engines/kyra/chargen.cpp
@@ -639,7 +639,7 @@ void CharacterGenerator::generateStats(int index) {
_chargenMaxStats[i] = _chargenRaceMaxStats[rc * 6 + i];
}
- if (_vm->_charClassModUnk[c->cClass])
+ if (_vm->_charClassModifier[c->cClass])
_chargenMaxStats[0] = 18;
uint16 sv[6];
diff --git a/engines/kyra/eobcommon.cpp b/engines/kyra/eobcommon.cpp
index 9e75be017c..6f58d3a4f6 100644
--- a/engines/kyra/eobcommon.cpp
+++ b/engines/kyra/eobcommon.cpp
@@ -157,7 +157,7 @@ EobCoreEngine::EobCoreEngine(OSystem *system, const GameFlags &flags) : LolEobBa
_mainMenuStrings = _levelGainStrings = _monsterSpecAttStrings = _characterGuiStringsHp = _characterGuiStringsWp = _characterGuiStringsWr = _characterGuiStringsSt =
_characterGuiStringsIn = _characterStatusStrings7 = _characterStatusStrings8 = _characterStatusStrings9 = _characterStatusStrings12 = _characterStatusStrings13 = 0;
- _classModifierFlags = _constModLevelIndex = _constModDiv = _constModExt = _wandTypes = _drawObjPosIndex = _flightObjFlipIndex = _expObjectTblIndex =
+ _classModifierFlags = _saveThrowLevelIndex = _saveThrowModDiv = _saveThrowModExt = _wandTypes = _drawObjPosIndex = _flightObjFlipIndex = _expObjectTblIndex =
_expObjectShpStart = _expObjectTlMode = _expObjectAnimTbl1 = _expObjectAnimTbl2 = _expObjectAnimTbl3 = 0;
_monsterStepTable0 = _monsterStepTable1 = _monsterStepTable2 = _monsterStepTable3 = _projectileWeaponAmmoTypes = _flightObjShpMap = _flightObjSclIndex = 0;
_monsterCloseAttPosTable1 = _monsterCloseAttPosTable2 = _monsterCloseAttChkTable1 = _monsterCloseAttChkTable2 = _monsterCloseAttDstTable1 = _monsterCloseAttDstTable2 = 0;
@@ -190,7 +190,7 @@ EobCoreEngine::EobCoreEngine(OSystem *system, const GameFlags &flags) : LolEobBa
_mnNumWord = _numSpells = _mageSpellListSize = _spellLevelsMageSize = _spellLevelsClericSize = 0;
_inventorySlotsX = _slotValidationFlags = _encodeMonsterShpTable = 0;
memset(_expRequirementTables, 0, sizeof(_expRequirementTables));
- memset(_constModTables, 0, sizeof(_constModTables));
+ memset(_saveThrowTables, 0, sizeof(_saveThrowTables));
memset(_doorType, 0, sizeof(_doorType));
memset(_noDoorSwitch, 0, sizeof(_noDoorSwitch));
memset(_scriptTimers, 0, sizeof(_scriptTimers));
@@ -1867,7 +1867,7 @@ int EobCoreEngine::calcCharacterDamage(int charIndex, int times, int itemOrPips,
EobCharacter *c = &_characters[charIndex];
if (savingThrowType != 5) {
- if (trySavingThrow(c, _charClassModUnk[c->cClass], c->level[0], savingThrowType, c->raceSex >> 1 /*fix bug in original code by adding a right shift*/))
+ if (trySavingThrow(c, _charClassModifier[c->cClass], c->level[0], savingThrowType, c->raceSex >> 1 /*fix bug in original code by adding a right shift*/))
s = savingThrowReduceDamage(savingThrowEffect, s);
}
@@ -2197,7 +2197,7 @@ bool EobCoreEngine::trySavingThrow(void *target, int hpModifier, int level, int
if (type == 5)
return false;
- int s = getConstModifierTableValue(hpModifier, level, type);
+ int s = getSaveThrowModifier(hpModifier, level, type);
if (((race == 3 || race == 5) && (type == 4 || type == 1 || type == 0)) || (race == 4 && (type == 4 || type == 1))) {
EobCharacter *c = (EobCharacter*)target;
s -= constMod[c->constitutionCur];
@@ -2207,15 +2207,15 @@ bool EobCoreEngine::trySavingThrow(void *target, int hpModifier, int level, int
}
bool EobCoreEngine::specialAttackSavingThrow(int charIndex, int type) {
- return trySavingThrow(&_characters[charIndex], _charClassModUnk[_characters[charIndex].cClass], _characters[charIndex].level[0], type, _characters[charIndex].raceSex >> 1);
+ return trySavingThrow(&_characters[charIndex], _charClassModifier[_characters[charIndex].cClass], _characters[charIndex].level[0], type, _characters[charIndex].raceSex >> 1);
}
-int EobCoreEngine::getConstModifierTableValue(int hpModifier, int level, int b) {
- const uint8 *tbl = _constModTables[hpModifier];
- if (_constModLevelIndex[hpModifier] < level)
- level = _constModLevelIndex[hpModifier];
- level /= _constModDiv[hpModifier];
- level += (_constModExt[hpModifier] * b);
+int EobCoreEngine::getSaveThrowModifier(int hpModifier, int level, int type) {
+ const uint8 *tbl = _saveThrowTables[hpModifier];
+ if (_saveThrowLevelIndex[hpModifier] < level)
+ level = _saveThrowLevelIndex[hpModifier];
+ level /= _saveThrowModDiv[hpModifier];
+ level += (_saveThrowModExt[hpModifier] * type);
return tbl[level];
}
@@ -2281,7 +2281,7 @@ int EobCoreEngine::getMonsterAcHitChanceModifier(int charIndex, int monsterAc) {
static const uint8 mod2[] = { 1, 1, 2, 1 };
int l = _characters[charIndex].level[0] - 1;
- int cm = _charClassModUnk[_characters[charIndex].cClass];
+ int cm = _charClassModifier[_characters[charIndex].cClass];
return (20 - ((l / mod1[cm]) * mod2[cm])) - monsterAc;
}
diff --git a/engines/kyra/eobcommon.h b/engines/kyra/eobcommon.h
index 795b0178d2..e4c06fefcd 100644
--- a/engines/kyra/eobcommon.h
+++ b/engines/kyra/eobcommon.h
@@ -326,7 +326,7 @@ protected:
static const uint8 _hpIncrPerLevel[];
static const uint8 _numLevelsPerClass[];
static const int16 _hpConstModifiers[];
- static const uint8 _charClassModUnk[];
+ static const uint8 _charClassModifier[];
const uint8 *_classModifierFlags;
@@ -406,10 +406,10 @@ protected:
const char *const *_levelGainStrings;
const uint32 *_expRequirementTables[6];
- const uint8 *_constModTables[6];
- const uint8 *_constModLevelIndex;
- const uint8 *_constModDiv;
- const uint8 *_constModExt;
+ const uint8 *_saveThrowTables[6];
+ const uint8 *_saveThrowLevelIndex;
+ const uint8 *_saveThrowModDiv;
+ const uint8 *_saveThrowModExt;
const EobCharacter *_npcPreset;
int _npcSequenceSub;
@@ -891,7 +891,7 @@ protected:
int calcDamageModifers(int charIndex, EobMonsterInPlay *m, int item, int itemType, int useStrModifier);
bool trySavingThrow(void *target, int hpModifier, int level, int type, int race);
bool specialAttackSavingThrow(int charIndex, int type);
- int getConstModifierTableValue(int hpModifier, int level, int b);
+ int getSaveThrowModifier(int hpModifier, int level, int type);
bool calcDamageCheckItemType(int itemType);
int savingThrowReduceDamage(int savingThrowEffect, int damage);
bool tryMonsterAttackEvasion(EobMonsterInPlay *m);
diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h
index a7060cdf6d..8edfd0a174 100644
--- a/engines/kyra/resource.h
+++ b/engines/kyra/resource.h
@@ -277,13 +277,13 @@ enum KyraResources {
kEobBaseChargenRaceMinStats,
kEobBaseChargenRaceMaxStats,
- kEobBaseConstModTable1,
- kEobBaseConstModTable2,
- kEobBaseConstModTable3,
- kEobBaseConstModTable4,
- kEobBaseConstModLvlIndex,
- kEobBaseConstModDiv,
- kEobBaseConstModExt,
+ kEobBaseSaveThrowTable1,
+ kEobBaseSaveThrowTable2,
+ kEobBaseSaveThrowTable3,
+ kEobBaseSaveThrowTable4,
+ kEobBaseSaveThrwLvlIndex,
+ kEobBaseSaveThrwModDiv,
+ kEobBaseSaveThrwModExt,
kEobBasePryDoorStrings,
kEobBaseWarningStrings,
diff --git a/engines/kyra/staticres_eob.cpp b/engines/kyra/staticres_eob.cpp
index 72b09e45b4..ec5d184c28 100644
--- a/engines/kyra/staticres_eob.cpp
+++ b/engines/kyra/staticres_eob.cpp
@@ -274,7 +274,7 @@ const int8 EobCoreEngine::_characterClassType[] = {
const int16 EobCoreEngine::_hpConstModifiers[] = { -1, -3, -2, -2, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 6, 6, 7, 7 };
-const uint8 EobCoreEngine::_charClassModUnk[] = {
+const uint8 EobCoreEngine::_charClassModifier[] = {
0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02,
0x00, 0x00, 0x02
};
@@ -436,13 +436,13 @@ void EobCoreEngine::initStaticResource() {
_classModifierFlags = _staticres->loadRawData(kEobBaseClassModifierFlags, temp);
- _constModTables[0] = _constModTables[4] = _constModTables[5] = _staticres->loadRawData(kEobBaseConstModTable1, temp);
- _constModTables[1] = _staticres->loadRawData(kEobBaseConstModTable2, temp);
- _constModTables[2] = _staticres->loadRawData(kEobBaseConstModTable3, temp);
- _constModTables[3] = _staticres->loadRawData(kEobBaseConstModTable4, temp);
- _constModLevelIndex = _staticres->loadRawData(kEobBaseConstModLvlIndex, temp);
- _constModDiv = _staticres->loadRawData(kEobBaseConstModDiv, temp);
- _constModExt = _staticres->loadRawData(kEobBaseConstModExt, temp);
+ _saveThrowTables[0] = _saveThrowTables[4] = _saveThrowTables[5] = _staticres->loadRawData(kEobBaseSaveThrowTable1, temp);
+ _saveThrowTables[1] = _staticres->loadRawData(kEobBaseSaveThrowTable2, temp);
+ _saveThrowTables[2] = _staticres->loadRawData(kEobBaseSaveThrowTable3, temp);
+ _saveThrowTables[3] = _staticres->loadRawData(kEobBaseSaveThrowTable4, temp);
+ _saveThrowLevelIndex = _staticres->loadRawData(kEobBaseSaveThrwLvlIndex, temp);
+ _saveThrowModDiv = _staticres->loadRawData(kEobBaseSaveThrwModDiv, temp);
+ _saveThrowModExt = _staticres->loadRawData(kEobBaseSaveThrwModExt, temp);
_encodeMonsterShpTable = _staticres->loadRawDataBe16(kEobBaseEncodeMonsterDefs, temp);
_npcPreset = _staticres->loadEobNpcData(kEobBaseNpcPresets, temp);