aboutsummaryrefslogtreecommitdiff
path: root/engines/dm/menus.cpp
diff options
context:
space:
mode:
authorBendegúz Nagy2016-08-26 22:38:51 +0200
committerBendegúz Nagy2016-08-26 23:02:22 +0200
commitc392f7e9772ad2d5a23b6c8407afa0f32ce4ebbc (patch)
treeabe345704697afa3654496bc844fa3f37be37671 /engines/dm/menus.cpp
parentb820a36d3a94e9510e313144378b789efe954fe4 (diff)
downloadscummvm-rg350-c392f7e9772ad2d5a23b6c8407afa0f32ce4ebbc.tar.gz
scummvm-rg350-c392f7e9772ad2d5a23b6c8407afa0f32ce4ebbc.tar.bz2
scummvm-rg350-c392f7e9772ad2d5a23b6c8407afa0f32ce4ebbc.zip
DM: Add F0390_MENUS_RefreshActionAreaAndSetChampionDirectionMaximumDamageReceived
Diffstat (limited to 'engines/dm/menus.cpp')
-rw-r--r--engines/dm/menus.cpp56
1 files changed, 54 insertions, 2 deletions
diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp
index f83fa6ecab..25ed432621 100644
--- a/engines/dm/menus.cpp
+++ b/engines/dm/menus.cpp
@@ -38,8 +38,9 @@ namespace DM {
byte gPalChangesActionAreaObjectIcon[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0}; // @ G0498_auc_Graphic560_PaletteChanges_ActionAreaObjectIcon
MenuMan::MenuMan(DMEngine *vm) : _vm(vm) {
- _shouldRefreshActionArea = false;
+ _refreshActionArea = false;
_actionAreaContainsIcons = false;
+ _actionDamage = 0;
}
void MenuMan::drawMovementArrows() {
@@ -57,7 +58,7 @@ void MenuMan::clearActingChampion() {
cm._champions[cm._actingChampionOrdinal].setAttributeFlag(kChampionAttributeActionHand, true);
cm.drawChampionState((ChampionIndex)cm._actingChampionOrdinal);
cm._actingChampionOrdinal = _vm->indexToOrdinal(kChampionNone);
- _shouldRefreshActionArea = true;
+ _refreshActionArea = true;
}
}
@@ -118,4 +119,55 @@ void MenuMan::drawDisabledMenu() {
}
}
+void MenuMan::refreshActionAreaAndSetChampDirMaxDamageReceived() {
+ ChampionMan &champMan = *_vm->_championMan;
+
+ if (!champMan._partyChampionCount)
+ return;
+
+ Champion *champ = nullptr;
+ if (champMan._partyIsSleeping || champMan._candidateChampionOrdinal) {
+ if (champMan._actingChampionOrdinal) {
+ clearActingChampion();
+ return;
+ }
+ if (!champMan._candidateChampionOrdinal)
+ return;
+ } else {
+ champ = champMan._champions;
+ int16 champIndex = kChampionFirst;
+
+ do {
+ if ((champIndex != champMan._leaderIndex)
+ && (_vm->indexToOrdinal(champIndex) != champMan._actingChampionOrdinal)
+ && (champ->_maximumDamageReceived)
+ && (champ->_dir != champ->_directionMaximumDamageReceived)) {
+
+ champ->_dir = (direction)champ->_directionMaximumDamageReceived;
+ champ->setAttributeFlag(kChampionAttributeIcon, true);
+ champMan.drawChampionState((ChampionIndex)champIndex);
+ }
+ champ->_maximumDamageReceived = 0;
+ champ++;
+ champIndex++;
+ } while (champIndex < champMan._partyChampionCount);
+ }
+
+ if (_refreshActionArea) {
+ if (!champMan._actingChampionOrdinal) {
+ if (_actionDamage) {
+ warning("MISSING CODE: F0385_MENUS_DrawActionDamage");
+ _actionDamage = 0;
+ } else {
+ _actionAreaContainsIcons = true;
+ warning("MISSING CODE: F0387_MENUS_DrawActionArea");
+ }
+ } else {
+ _actionAreaContainsIcons = false;
+ champ->setAttributeFlag(kChampionAttributeActionHand, true);
+ champMan.drawChampionState((ChampionIndex)_vm->ordinalToIndex(champMan._actingChampionOrdinal));
+ warning("MISSING CODE: F0387_MENUS_DrawActionArea");
+ }
+ }
+}
}