aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBendegúz Nagy2016-07-12 14:38:52 +0200
committerBendegúz Nagy2016-08-26 23:02:22 +0200
commit1e8dfd7bb6b86ce5d4d2827bf692b217afbb07b1 (patch)
treed1cde75f53b7c8a59f5e244141b9066e9a56da6d /engines
parent0f107cead2b59c9e67fc50996df49d4e86918f48 (diff)
downloadscummvm-rg350-1e8dfd7bb6b86ce5d4d2827bf692b217afbb07b1.tar.gz
scummvm-rg350-1e8dfd7bb6b86ce5d4d2827bf692b217afbb07b1.tar.bz2
scummvm-rg350-1e8dfd7bb6b86ce5d4d2827bf692b217afbb07b1.zip
DM: Add f370_commandProcessType100_clickInSpellArea
Diffstat (limited to 'engines')
-rw-r--r--engines/dm/champion.cpp30
-rw-r--r--engines/dm/champion.h53
-rw-r--r--engines/dm/dungeonman.cpp2
-rw-r--r--engines/dm/dungeonman.h1
-rw-r--r--engines/dm/eventman.cpp112
-rw-r--r--engines/dm/eventman.h2
-rw-r--r--engines/dm/inventory.cpp27
-rw-r--r--engines/dm/menus.cpp411
-rw-r--r--engines/dm/menus.h12
-rw-r--r--engines/dm/movesens.cpp5
10 files changed, 635 insertions, 20 deletions
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp
index fdbdc0914c..906c95bf47 100644
--- a/engines/dm/champion.cpp
+++ b/engines/dm/champion.cpp
@@ -1298,7 +1298,7 @@ void ChampionMan::f302_processCommands28to65_clickOnSlotBox(uint16 slotBoxIndex)
}
if (L0906_T_SlotThing != Thing::_none) {
f300_getObjectRemovedFromSlot(L0903_ui_ChampionIndex, L0904_ui_SlotIndex);
- f297_putObjectInLeaderHand(L0906_T_SlotThing, false);
+ f297_putObjectInLeaderHand(L0906_T_SlotThing, false);
}
if (L0905_T_LeaderHandObject != Thing::_none) {
_vm->_championMan->f301_addObjectInSlot((ChampionIndex)L0903_ui_ChampionIndex, L0905_T_LeaderHandObject, (ChampionSlot)L0904_ui_SlotIndex);
@@ -1307,6 +1307,34 @@ void ChampionMan::f302_processCommands28to65_clickOnSlotBox(uint16 slotBoxIndex)
_vm->_eventMan->f77_hideMouse();
}
+bool ChampionMan::f327_isProjectileSpellCast(uint16 champIndex, Thing thing, int16 kineticEnergy, uint16 requiredManaAmount) {
+ int16 L0991_i_StepEnergy;
+ Champion* L0992_ps_Champion;
+
+ L0992_ps_Champion = &_vm->_championMan->_gK71_champions[champIndex];
+ if (L0992_ps_Champion->_currMana < requiredManaAmount) {
+ return false;
+ }
+ L0992_ps_Champion->_currMana -= requiredManaAmount;
+ setFlag(L0992_ps_Champion->_attributes, k0x0100_ChampionAttributeStatistics);
+ L0991_i_StepEnergy = 10 - MIN(8, L0992_ps_Champion->_maxMana >> 3);
+ if (kineticEnergy < (L0991_i_StepEnergy << 2)) {
+ kineticEnergy += 3;
+ L0991_i_StepEnergy--;
+ }
+ f326_championShootProjectile(L0992_ps_Champion, thing, kineticEnergy, 90, L0991_i_StepEnergy);
+ return true; // fix BUG_01
+}
+
+void ChampionMan::f326_championShootProjectile(Champion* champ, Thing thing, int16 kineticEnergy, int16 attack, int16 stepEnergy) {
+ uint16 L0990_ui_Direction;
+
+ L0990_ui_Direction = champ->_dir;
+ _vm->_projexpl->f212_projectileCreate(thing, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY, M21_normalizeModulo4((((champ->_cell - L0990_ui_Direction + 1) & 0x0002) >> 1) + L0990_ui_Direction), (direction)L0990_ui_Direction, kineticEnergy, attack, stepEnergy);
+ _vm->_g311_projectileDisableMovementTicks = 4;
+ _vm->_g312_lastProjectileDisabledMovementDirection = L0990_ui_Direction;
+}
+
ChampionIndex ChampionMan::f285_getIndexInCell(int16 cell) {
for (uint16 i = 0; i < _g305_partyChampionCount; ++i) {
if ((_gK71_champions[i]._cell == cell) && _gK71_champions[i]._currHealth)
diff --git a/engines/dm/champion.h b/engines/dm/champion.h
index 37ca363e50..2bae7c5947 100644
--- a/engines/dm/champion.h
+++ b/engines/dm/champion.h
@@ -448,7 +448,53 @@ public:
#define k0x8000_maskUseSharpDefense 0x8000 // @ MASK0x8000_USE_SHARP_DEFENSE
#define k0x8000_mergeCycles 0x8000 // @ MASK0x8000_MERGE_CYCLES
-extern const char *g417_baseSkillName[4];
+// TODO: localization
+extern const char *g417_baseSkillName[4]; // @ G0417_apc_BaseSkillNames
+
+#define k0_spellCastFailure 0 // @ C0_SPELL_CAST_FAILURE
+#define k1_spellCastSuccess 1 // @ C1_SPELL_CAST_SUCCESS
+#define k3_spellCastFailureNeedsFlask 3 // @ C3_SPELL_CAST_FAILURE_NEEDS_FLASK
+
+#define k0_failureNeedsMorePractice 0 // @ C00_FAILURE_NEEDS_MORE_PRACTICE
+#define k1_failureMeaninglessSpell 1 // @ C01_FAILURE_MEANINGLESS_SPELL
+#define k10_failureNeedsFlaskInHand 10 // @ C10_FAILURE_NEEDS_FLASK_IN_HAND
+#define k11_failureNeedsMagicMapInHand 11 // @ C11_FAILURE_NEEDS_MAGIC_MAP_IN_HAND
+
+#define k1_spellKindPotion 1 // @ C1_SPELL_KIND_POTION
+#define k2_spellKindProjectile 2 // @ C2_SPELL_KIND_PROJECTILE
+#define k3_spellKindOther 3 // @ C3_SPELL_KIND_OTHER
+#define k4_spellKindMagicMap 4 // @ C4_SPELL_KIND_MAGIC_MAP
+
+#define k4_spellType_projectileOpenDoor 4 // @ C4_SPELL_TYPE_PROJECTILE_OPEN_DOOR
+#define k0_spellType_otherLight 0 // @ C0_SPELL_TYPE_OTHER_LIGHT
+#define k1_spellType_otherDarkness 1 // @ C1_SPELL_TYPE_OTHER_DARKNESS
+#define k2_spellType_otherThievesEye 2 // @ C2_SPELL_TYPE_OTHER_THIEVES_EYE
+#define k3_spellType_otherInvisibility 3 // @ C3_SPELL_TYPE_OTHER_INVISIBILITY
+#define k4_spellType_otherPartyShield 4 // @ C4_SPELL_TYPE_OTHER_PARTY_SHIELD
+#define k5_spellType_otherMagicTorch 5 // @ C5_SPELL_TYPE_OTHER_MAGIC_TORCH
+#define k6_spellType_otherFootprints 6 // @ C6_SPELL_TYPE_OTHER_FOOTPRINTS
+#define k7_spellType_otherZokathra 7 // @ C7_SPELL_TYPE_OTHER_ZOKATHRA
+#define k8_spellType_otherFireshield 8 // @ C8_SPELL_TYPE_OTHER_FIRESHIELD
+#define k0_spellType_magicMap0 0 // @ C0_SPELL_TYPE_MAGIC_MAP
+#define k1_spellType_magicMap1 1 // @ C1_SPELL_TYPE_MAGIC_MAP
+#define k2_spellType_magicMap2 2 // @ C2_SPELL_TYPE_MAGIC_MAP
+#define k3_spellType_magicMap3 3 // @ C3_SPELL_TYPE_MAGIC_MAP
+
+class Spell {
+public:
+ Spell() {}
+ Spell(int32 symbols, byte baseSkillReq, byte skillIndex, uint16 attributes)
+ : _symbols(symbols), _baseRequiredSkillLevel(baseSkillReq), _skillIndex(skillIndex), _attributes(attributes) {}
+
+ int32 _symbols; /* Most significant byte: 0 (spell definition does not include power symbol) / not 0 (spell definition includes power symbol) */
+ byte _baseRequiredSkillLevel;
+ byte _skillIndex;
+ uint16 _attributes; /* Bits 15-10: Duration, Bits 9-4: Type, Bits 3-0: Kind */
+
+ uint16 M67_spellKind() { return _attributes & 0xF; } // @ M67_SPELL_KIND
+ uint16 M68_spellType() { return (_attributes >> 4) & 0x3F; } // @ M68_SPELL_TYPE
+ uint16 M69_spellDurration() { return (_attributes >> 10) & 0x3F; } // @ M69_SPELL_DURATION
+}; // @ SPELL
class ChampionMan {
DMEngine *_vm;
@@ -526,8 +572,9 @@ public:
void f293_drawAllChampionStates(); // @ F0293_CHAMPION_DrawAllChampionStates
void f283_viAltarRebirth(uint16 champIndex); // @ F0283_CHAMPION_ViAltarRebirth
void f302_processCommands28to65_clickOnSlotBox(uint16 slotBoxIndex); // @ F0302_CHAMPION_ProcessCommands28To65_ClickOnSlotBox
-
-
+ bool f327_isProjectileSpellCast(uint16 champIndex, Thing thing, int16 kineticEnergy, uint16 requiredManaAmount); // @ F0327_CHAMPION_IsProjectileSpellCast
+ void f326_championShootProjectile(Champion *champ, Thing thing, int16 kineticEnergy,
+ int16 attack, int16 stepEnergy); // @ F0326_CHAMPION_ShootProjectile
};
diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp
index d88363a0b3..7d916196b4 100644
--- a/engines/dm/dungeonman.cpp
+++ b/engines/dm/dungeonman.cpp
@@ -1252,7 +1252,7 @@ uint16 DungeonMan::f140_getObjectWeight(Thing thing) {
};
Junk* junk;
- uint16 weight;
+ uint16 weight = (uint16)-1; // initialization is not present in original
if (thing == Thing::_none)
return 0;
diff --git a/engines/dm/dungeonman.h b/engines/dm/dungeonman.h
index ca01034d96..305a9219d9 100644
--- a/engines/dm/dungeonman.h
+++ b/engines/dm/dungeonman.h
@@ -452,6 +452,7 @@ public:
void setType(PotionType val) { _attributes = (_attributes & ~(0x7F << 8)) | ((val & 0x7F) << 8); }
Thing getNextThing() { return _nextThing; }
uint16 getPower() { return _attributes & 0xFF; }
+ void setPower(uint16 val) { _attributes = (_attributes & ~0xFF) | (val & 0xFF); }
uint16 getDoNotDiscard() { return (_attributes >> 15) & 1; }
}; // @ POTION
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp
index f74c8067af..6be06e6040 100644
--- a/engines/dm/eventman.cpp
+++ b/engines/dm/eventman.cpp
@@ -661,7 +661,7 @@ void EventManager::f380_processCommandQueue() {
}
if ((cmdType >= k28_CommandClickOnSlotBoxInventoryReadyHand) && (cmdType < (k65_CommandClickOnSlotBoxChest_8 + 1))) {
if (_vm->_championMan->_g411_leaderIndex != kM1_ChampionNone) {
- warning(false, "MISSING CODE: F0302_CHAMPION_ProcessCommands28To65_ClickOnSlotBox(cmdType - k20_CommandClickOnSlotBoxChampion_0_StatusBoxReadyHand);");
+ _vm->_championMan->f302_processCommands28to65_clickOnSlotBox(cmdType - k20_CommandClickOnSlotBoxChampion_0_StatusBoxReadyHand);
}
return;
}
@@ -679,7 +679,7 @@ void EventManager::f380_processCommandQueue() {
}
if (cmdType == k100_CommandClickInSpellArea) {
if ((!_vm->_championMan->_g299_candidateChampionOrdinal) && (_vm->_championMan->_g514_magicCasterChampionIndex != kM1_ChampionNone)) {
- warning(false, "MISSING CODE: F0370_COMMAND_ProcessType100_ClickInSpellArea(L1161_i_CommandX, L1162_i_CommandY);");
+ f370_commandProcessType100_clickInSpellArea(L1161_i_CommandX, L1162_i_CommandY);
}
return;
}
@@ -1304,7 +1304,7 @@ void EventManager::f367_commandProcessTypes12to27_clickInChampionStatusBox(uint1
void EventManager::f70_mouseProcessCommands125To128_clickOnChampionIcon(uint16 champIconIndex) {
static Box G0621_s_Box_MousePointer_ChampionIconShadow = Box(2, 20, 2, 15);
static Box G0622_s_Box_MousePointer_ChampionIcon = Box(0, 18, 0, 13);
- static byte G0045_auc_Graphic562_PaletteChanges_MousePointerIconShadow[16] = {0, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 0, 120, 120, 120};
+ static byte G0045_auc_Graphic562_PaletteChanges_MousePointerIconShadow[16] = {0, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 0, 120, 120, 120};
uint16 L0052_ui_ChampionIconIndex;
int16 L0053_i_ChampionIndex;
@@ -1359,4 +1359,110 @@ void EventManager::f70_mouseProcessCommands125To128_clickOnChampionIcon(uint16 c
_gK100_preventBuildPointerScreenArea = false;
f73_buildpointerScreenArea(_mousePos.x, _mousePos.y);
}
+
+void EventManager::f370_commandProcessType100_clickInSpellArea(uint16 posX, uint16 posY) {
+ int16 L1132_i_Command;
+ int16 L1133_i_ChampionIndex;
+
+
+ L1133_i_ChampionIndex = kM1_ChampionNone;
+ if (posY <= 48) {
+ switch (_vm->_championMan->_g514_magicCasterChampionIndex) {
+ case 0:
+ if ((posX >= 280) && (posX <= 291)) {
+ L1133_i_ChampionIndex = 1;
+ } else {
+ if ((posX >= 294) && (posX <= 305)) {
+ L1133_i_ChampionIndex = 2;
+ } else {
+ if (posX >= 308) {
+ L1133_i_ChampionIndex = 3;
+ }
+ }
+ }
+ break;
+ case 1:
+ if ((posX >= 233) && (posX <= 244)) {
+ L1133_i_ChampionIndex = 0;
+ } else {
+ if ((posX >= 294) && (posX <= 305)) {
+ L1133_i_ChampionIndex = 2;
+ } else {
+ if (posX >= 308) {
+ L1133_i_ChampionIndex = 3;
+ }
+ }
+ }
+ break;
+ case 2:
+ if ((posX >= 233) && (posX <= 244)) {
+ L1133_i_ChampionIndex = 0;
+ } else {
+ if ((posX >= 247) && (posX <= 258)) {
+ L1133_i_ChampionIndex = 1;
+ } else {
+ if (posX >= 308) {
+ L1133_i_ChampionIndex = 3;
+ }
+ }
+ }
+ break;
+ case 3:
+ if ((posX >= 247) && (posX <= 258)) {
+ L1133_i_ChampionIndex = 1;
+ } else {
+ if ((posX >= 261) && (posX <= 272)) {
+ L1133_i_ChampionIndex = 2;
+ } else {
+ if (posX <= 244) {
+ L1133_i_ChampionIndex = 0;
+ }
+ }
+ }
+ }
+ if ((L1133_i_ChampionIndex != kM1_ChampionNone) && (L1133_i_ChampionIndex < _vm->_championMan->_g305_partyChampionCount)) {
+ _vm->_menuMan->f394_setMagicCasterAndDrawSpellArea(L1133_i_ChampionIndex);
+ }
+ return;
+ }
+ L1132_i_Command = _vm->_eventMan->f358_getCommandTypeFromMouseInput(g454_MouseInput_SpellArea, Common::Point(posX, posY), k1_LeftMouseButton);
+ if (L1132_i_Command != k0_CommandNone) {
+ f369_commandProcessTypes101To108_clickInSpellSymbolsArea((CommandType)L1132_i_Command);
+ }
+}
+
+void EventManager::f369_commandProcessTypes101To108_clickInSpellSymbolsArea(CommandType cmdType) {
+ static Box G0464_as_Graphic561_Box_SpellSymbolsAndDelete[7] = {
+ /* { X1, X2, Y1, Y2 } */
+ Box(235, 247, 51, 61), /* Symbol 1 */
+ Box(249, 261, 51, 61), /* Symbol 2 */
+ Box(263, 275, 51, 61), /* Symbol 3 */
+ Box(277, 289, 51, 61), /* Symbol 4 */
+ Box(291, 303, 51, 61), /* Symbol 5 */
+ Box(305, 317, 51, 61), /* Symbol 6 */
+ Box(305, 318, 63, 73)}; /* Delete */
+
+ uint16 L1130_ui_SymbolIndex;
+ Box* L1131_ps_Box;
+
+
+ if (cmdType == k108_CommandClickInSpeallAreaCastSpell) {
+ if (_vm->_championMan->_gK71_champions[_vm->_championMan->_g514_magicCasterChampionIndex]._symbols[0] == '\0') {
+ return;
+ }
+ warning(false, "MISSING CODE: F0362_COMMAND_HighlightBoxEnable");
+ _vm->_g321_stopWaitingForPlayerInput = _vm->_menuMan->f408_getClickOnSpellCastResult();
+ return;
+ }
+ L1130_ui_SymbolIndex = cmdType - k101_CommandClickInSpellAreaSymbol_1;
+ L1131_ps_Box = &G0464_as_Graphic561_Box_SpellSymbolsAndDelete[L1130_ui_SymbolIndex];
+ warning(false, "MISSING CODE: F0362_COMMAND_HighlightBoxEnable");
+ _vm->f22_delay(1);
+ warning(false, "MISSING CODE: F0363_COMMAND_HighlightBoxDisable");
+ if (L1130_ui_SymbolIndex < 6) {
+ _vm->_menuMan->f399_addChampionSymbol(L1130_ui_SymbolIndex);
+ } else {
+ _vm->_menuMan->f400_deleteChampionSymbol();
+ }
+}
} // end of namespace DM
diff --git a/engines/dm/eventman.h b/engines/dm/eventman.h
index 742582652c..7ad24a7e88 100644
--- a/engines/dm/eventman.h
+++ b/engines/dm/eventman.h
@@ -300,6 +300,8 @@ public:
void f367_commandProcessTypes12to27_clickInChampionStatusBox(uint16 champIndex, int16 posX,
int16 posY); // @ F0367_COMMAND_ProcessTypes12To27_ClickInChampionStatusBox
void f70_mouseProcessCommands125To128_clickOnChampionIcon(uint16 champIconIndex); // @ F0070_MOUSE_ProcessCommands125To128_ClickOnChampionIcon
+ void f370_commandProcessType100_clickInSpellArea(uint16 posX, uint16 posY); // @ F0370_COMMAND_ProcessType100_ClickInSpellArea
+ void f369_commandProcessTypes101To108_clickInSpellSymbolsArea(CommandType cmdType); // @ F0369_COMMAND_ProcessTypes101To108_ClickInSpellSymbolsArea_CPSE
};
diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp
index a0c6e57e9c..1a15d44d30 100644
--- a/engines/dm/inventory.cpp
+++ b/engines/dm/inventory.cpp
@@ -675,6 +675,24 @@ void InventoryMan::f338_decreaseTorchesLightPower() {
}
void InventoryMan::f351_drawChampionSkillsAndStatistics() {
+ // TODO: localization
+ static char* G0428_apc_SkillLevelNames[15] = {
+ "NEOPHYTE",
+ "NOVICE",
+ "APPRENTICE",
+ "JOURNEYMAN",
+ "CRAFTSMAN",
+ "ARTISAN",
+ "ADEPT",
+ "EXPERT",
+ "` MASTER",
+ "a MASTER",
+ "b MASTER",
+ "c MASTER",
+ "d MASTER",
+ "e MASTER",
+ "ARCHMASTER"};
+
uint16 L1090_ui_Multiple;
#define AL1090_ui_SkillIndex L1090_ui_Multiple
#define AL1090_ui_StatisticIndex L1090_ui_Multiple
@@ -699,16 +717,9 @@ void InventoryMan::f351_drawChampionSkillsAndStatistics() {
AL1092_i_SkillLevel = MIN((uint16)16, _vm->_championMan->f303_getSkillLevel(L1093_ui_ChampionIndex, AL1090_ui_SkillIndex | k0x8000_IgnoreTemporaryExperience));
if (AL1092_i_SkillLevel == 1)
continue;
-#ifdef COMPILE17_DM10aEN_DM10bEN_DM11EN_DM12EN_CSB20EN_CSB21EN_DMDEMO20EN_DM20EN_DM21EN_DM22EN /* CHANGE4_00_LOCALIZATION Translation to German language */
strcpy(L1097_ac_String, G0428_apc_SkillLevelNames[AL1092_i_SkillLevel - 2]);
strcat(L1097_ac_String, " ");
- strcat(L1097_ac_String, G0417_apc_BaseSkillNames[AL1090_ui_SkillIndex]);
-#endif
-#ifdef COMPILE36_DM12GE_DM13aFR_DM13bFR_DM20GE_DM20FR_DM22GE /* CHANGE4_00_LOCALIZATION Translation to German language */
- strcpy(L1097_ac_String, G0417_apc_BaseSkillNames[AL1090_ui_SkillIndex]);
- strcat(L1097_ac_String, " ");
- strcat(L1097_ac_String, G0428_apc_SkillLevelNames[AL1092_i_SkillLevel - 2]);
-#endif
+ strcat(L1097_ac_String, g417_baseSkillName[AL1090_ui_SkillIndex]);
_vm->_textMan->f52_printToViewport(108, L1091_i_Y, k13_ColorLightestGray, L1097_ac_String);
L1091_i_Y += 7;
}
diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp
index d63cab0012..d35ec7553a 100644
--- a/engines/dm/menus.cpp
+++ b/engines/dm/menus.cpp
@@ -33,6 +33,8 @@
#include "inventory.h"
#include "text.h"
#include "eventman.h"
+#include "timeline.h"
+#include "movesens.h"
namespace DM {
@@ -402,4 +404,413 @@ void MenuMan::f457_drawEnabledMenus() {
}
}
+int16 MenuMan::f408_getClickOnSpellCastResult() {
+ int16 L1259_i_SpellCastResult;
+ Champion* L1260_ps_Champion;
+
+
+ L1260_ps_Champion = &_vm->_championMan->_gK71_champions[_vm->_championMan->_g514_magicCasterChampionIndex];
+ _vm->_eventMan->f78_showMouse();
+ warning(false, "MISSING CODE: F0363_COMMAND_HighlightBoxDisable");
+ if ((L1259_i_SpellCastResult = f412_getChampionSpellCastResult(_vm->_championMan->_g514_magicCasterChampionIndex)) != k3_spellCastFailureNeedsFlask) {
+ L1260_ps_Champion->_symbols[0] = '\0';
+ f397_drawAvailableSymbols(L1260_ps_Champion->_symbolStep = 0);
+ f398_drawChampionSymbols(L1260_ps_Champion);
+ } else {
+ L1259_i_SpellCastResult = k0_spellCastFailure;
+ }
+ _vm->_eventMan->f77_hideMouse();
+ return L1259_i_SpellCastResult;
+}
+
+int16 MenuMan::f412_getChampionSpellCastResult(uint16 champIndex) {
+ uint16 L1267_ui_Multiple;
+#define AL1267_ui_SkillLevel L1267_ui_Multiple
+#define AL1267_ui_LightPower L1267_ui_Multiple
+#define AL1267_ui_SpellPower L1267_ui_Multiple
+#define AL1267_ui_Ticks L1267_ui_Multiple
+ int16 L1268_i_PowerSymbolOrdinal;
+ uint16 L1269_ui_Multiple;
+#define AL1269_ui_RequiredSkillLevel L1269_ui_Multiple
+#define AL1269_ui_EmptyFlaskWeight L1269_ui_Multiple
+#define AL1269_ui_Ticks L1269_ui_Multiple
+ Champion* L1270_ps_Champion;
+ Spell* L1271_ps_Spell;
+ Thing L1272_T_Object;
+ uint16 L1273_ui_Experience;
+ int16 L1274_i_MissingSkillLevelCount;
+ Potion* L1275_ps_Potion;
+ TimelineEvent L1276_s_Event;
+ Junk* L1277_ps_Junk;
+
+
+ if (champIndex >= _vm->_championMan->_g305_partyChampionCount) {
+ return k0_spellCastFailure;
+ }
+ L1270_ps_Champion = &_vm->_championMan->_gK71_champions[champIndex];
+ if (!(L1270_ps_Champion->_currHealth)) {
+ return k0_spellCastFailure;
+ }
+ if ((L1271_ps_Spell = f409_getSpellFromSymbols((unsigned char *)L1270_ps_Champion->_symbols)) == 0) {
+ f410_menusPrintSpellFailureMessage(L1270_ps_Champion, k1_spellCastSuccess, 0);
+ return k0_spellCastFailure;
+ }
+ L1268_i_PowerSymbolOrdinal = L1270_ps_Champion->_symbols[0] - '_'; /* Values 1 to 6 */
+ L1273_ui_Experience = _vm->getRandomNumber(8) + ((AL1269_ui_RequiredSkillLevel = L1271_ps_Spell->_baseRequiredSkillLevel + L1268_i_PowerSymbolOrdinal) << 4) + ((_vm->M1_ordinalToIndex(L1268_i_PowerSymbolOrdinal) * L1271_ps_Spell->_baseRequiredSkillLevel) << 3) + (AL1269_ui_RequiredSkillLevel * AL1269_ui_RequiredSkillLevel);
+ AL1267_ui_SkillLevel = _vm->_championMan->f303_getSkillLevel(champIndex, L1271_ps_Spell->_skillIndex);
+ if (AL1267_ui_SkillLevel < AL1269_ui_RequiredSkillLevel) {
+ L1274_i_MissingSkillLevelCount = AL1269_ui_RequiredSkillLevel - AL1267_ui_SkillLevel;
+ while (L1274_i_MissingSkillLevelCount--) {
+ if (_vm->getRandomNumber(128) > MIN(L1270_ps_Champion->_statistics[k3_ChampionStatWisdom][k1_ChampionStatCurrent] + 15, 115)) {
+ _vm->_championMan->f304_addSkillExperience(champIndex, L1271_ps_Spell->_skillIndex, L1273_ui_Experience >> (AL1269_ui_RequiredSkillLevel - AL1267_ui_SkillLevel));
+ f410_menusPrintSpellFailureMessage(L1270_ps_Champion, k0_failureNeedsMorePractice, L1271_ps_Spell->_skillIndex);
+ return k0_spellCastFailure;
+ }
+ }
+ }
+ switch (L1271_ps_Spell->M67_spellKind()) {
+ case k1_spellKindPotion:
+ if ((L1275_ps_Potion = f411_getEmptyFlaskInHand(L1270_ps_Champion, &L1272_T_Object)) == NULL) {
+ f410_menusPrintSpellFailureMessage(L1270_ps_Champion, k10_failureNeedsFlaskInHand, 0);
+ return k3_spellCastFailureNeedsFlask;
+ }
+ AL1269_ui_EmptyFlaskWeight = _vm->_dungeonMan->f140_getObjectWeight(L1272_T_Object);
+ L1275_ps_Potion->setType((PotionType)L1271_ps_Spell->M68_spellType());
+ L1275_ps_Potion->setPower(_vm->getRandomNumber(16) + (L1268_i_PowerSymbolOrdinal * 40));
+ L1270_ps_Champion->_load += _vm->_dungeonMan->f140_getObjectWeight(L1272_T_Object) - AL1269_ui_EmptyFlaskWeight;
+ _vm->_championMan->f296_drawChangedObjectIcons();
+ if (_vm->_inventoryMan->_g432_inventoryChampionOrdinal == _vm->M0_indexToOrdinal(champIndex)) {
+ setFlag(L1270_ps_Champion->_attributes, k0x0200_ChampionAttributeLoad);
+ _vm->_championMan->f292_drawChampionState((ChampionIndex)champIndex);
+ }
+ break;
+ case k2_spellKindProjectile:
+ if (L1270_ps_Champion->_dir != _vm->_dungeonMan->_g308_partyDir) {
+ L1270_ps_Champion->_dir = _vm->_dungeonMan->_g308_partyDir;
+ setFlag(L1270_ps_Champion->_attributes, k0x0400_ChampionAttributeIcon);
+ _vm->_championMan->f292_drawChampionState((ChampionIndex)champIndex);
+ }
+ if (L1271_ps_Spell->M68_spellType() == k4_spellType_projectileOpenDoor) {
+ AL1267_ui_SkillLevel <<= 1;
+ }
+ _vm->_championMan->f327_isProjectileSpellCast(champIndex, Thing(L1271_ps_Spell->M68_spellType() + Thing::_firstExplosion.toUint16()), f26_getBoundedValue(21, (L1268_i_PowerSymbolOrdinal + 2) * (4 + (AL1267_ui_SkillLevel << 1)), 255), 0);
+ break;
+ case k3_spellKindOther:
+ L1276_s_Event._priority = 0;
+ AL1267_ui_SpellPower = (L1268_i_PowerSymbolOrdinal + 1) << 2;
+ switch (L1271_ps_Spell->M68_spellType()) {
+ case k0_spellType_otherLight:
+ AL1269_ui_Ticks = 10000 + ((AL1267_ui_SpellPower - 8) << 9);
+ AL1267_ui_LightPower = (AL1267_ui_SpellPower >> 1);
+ AL1267_ui_LightPower--;
+ goto T0412019;
+ case k5_spellType_otherMagicTorch:
+ AL1269_ui_Ticks = 2000 + ((AL1267_ui_SpellPower - 3) << 7);
+ AL1267_ui_LightPower = (AL1267_ui_SpellPower >> 2);
+ AL1267_ui_LightPower++;
+T0412019:
+ _vm->_championMan->_g407_party._magicalLightAmount += g39_LightPowerToLightAmount[AL1267_ui_LightPower];
+ f404_createEvent70_light(-AL1267_ui_LightPower, AL1269_ui_Ticks);
+ break;
+ case k1_spellType_otherDarkness:
+ AL1267_ui_LightPower = (AL1267_ui_SpellPower >> 2);
+ _vm->_championMan->_g407_party._magicalLightAmount -= g39_LightPowerToLightAmount[AL1267_ui_LightPower];
+ f404_createEvent70_light(AL1267_ui_LightPower, 98);
+ break;
+ case k2_spellType_otherThievesEye:
+ L1276_s_Event._type = k73_TMEventTypeThievesEye;
+ _vm->_championMan->_g407_party._event73Count_ThievesEye++;
+ AL1267_ui_SpellPower = (AL1267_ui_SpellPower >> 1);
+ goto T0412032;
+ case k3_spellType_otherInvisibility:
+ L1276_s_Event._type = k71_TMEventTypeInvisibility;
+ _vm->_championMan->_g407_party._event71Count_Invisibility++;
+ goto T0412033;
+ case k4_spellType_otherPartyShield:
+ L1276_s_Event._type = k74_TMEventTypePartyShield;
+ L1276_s_Event._B._defense = AL1267_ui_SpellPower;
+ if (_vm->_championMan->_g407_party._shieldDefense > 50) {
+ L1276_s_Event._B._defense >>= 2;
+ }
+ _vm->_championMan->_g407_party._shieldDefense += L1276_s_Event._B._defense;
+ _vm->_timeline->f260_timelineRefreshAllChampionStatusBoxes();
+ goto T0412032;
+ case k6_spellType_otherFootprints:
+ L1276_s_Event._type = k79_TMEventTypeFootprints;
+ _vm->_championMan->_g407_party._event79Count_Footprints++;
+ _vm->_championMan->_g407_party._firstScentIndex = _vm->_championMan->_g407_party._scentCount;
+ if (L1268_i_PowerSymbolOrdinal < 3) {
+ _vm->_championMan->_g407_party._lastScentIndex = _vm->_championMan->_g407_party._firstScentIndex;
+ } else {
+ _vm->_championMan->_g407_party._lastScentIndex = 0;
+ }
+T0412032:
+ AL1267_ui_Ticks = AL1267_ui_SpellPower * AL1267_ui_SpellPower;
+T0412033:
+ M33_setMapAndTime(L1276_s_Event._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_g313_gameTime + AL1267_ui_Ticks);
+ _vm->_timeline->f238_addEventGetEventIndex(&L1276_s_Event);
+ break;
+ case k7_spellType_otherZokathra:
+ if ((L1272_T_Object = _vm->_dungeonMan->f166_getUnusedThing(k10_JunkThingType)) == Thing::_none)
+ break;
+ L1277_ps_Junk = (Junk*)_vm->_dungeonMan->f156_getThingData(L1272_T_Object);
+ L1277_ps_Junk->setType(k51_JunkTypeZokathra);
+ ChampionSlot AL1267_ui_SlotIndex;
+ if (L1270_ps_Champion->_slots[k0_ChampionSlotReadyHand] == Thing::_none) {
+ AL1267_ui_SlotIndex = k0_ChampionSlotReadyHand;
+ } else {
+ if (L1270_ps_Champion->_slots[k1_ChampionSlotActionHand] == Thing::_none) {
+ AL1267_ui_SlotIndex = k1_ChampionSlotActionHand;
+ } else {
+ AL1267_ui_SlotIndex = kM1_ChampionSlotLeaderHand;
+ }
+ }
+ if ((AL1267_ui_SlotIndex == k0_ChampionSlotReadyHand) || (AL1267_ui_SlotIndex == k1_ChampionSlotActionHand)) {
+ _vm->_championMan->f301_addObjectInSlot((ChampionIndex)champIndex, L1272_T_Object, AL1267_ui_SlotIndex);
+ _vm->_championMan->f292_drawChampionState((ChampionIndex)champIndex);
+ } else {
+ _vm->_movsens->f267_getMoveResult(L1272_T_Object, kM1_MapXNotOnASquare, 0, _vm->_dungeonMan->_g306_partyMapX, _vm->_dungeonMan->_g307_partyMapY);
+ }
+ break;
+ case k8_spellType_otherFireshield:
+ f403_isPartySpellOrFireShieldSuccessful(L1270_ps_Champion, false, (AL1267_ui_SpellPower * AL1267_ui_SpellPower) + 100, false);
+ }
+ }
+ _vm->_championMan->f304_addSkillExperience(champIndex, L1271_ps_Spell->_skillIndex, L1273_ui_Experience);
+ _vm->_championMan->f330_disableAction(champIndex, L1271_ps_Spell->M69_spellDurration());
+ return k1_spellCastSuccess;
+}
+
+Spell* MenuMan::f409_getSpellFromSymbols(byte* symbols) {
+ static Spell G0487_as_Graphic560_Spells[25] = {
+ /* { Symbols, BaseRequiredSkillLevel, SkillIndex, Attributes } */
+ Spell(0x00666F00, 2, 15, 0x7843),
+ Spell(0x00667073, 1, 18, 0x4863),
+ Spell(0x00686D77, 3, 17, 0xB433),
+ Spell(0x00686C00, 3, 19, 0x6C72),
+ Spell(0x00686D76, 3, 18, 0x8423),
+ Spell(0x00686E76, 4, 17, 0x7822),
+ Spell(0x00686F76, 4, 17, 0x5803),
+ Spell(0x00690000, 1, 16, 0x3C53),
+ Spell(0x00696F00, 3, 16, 0xA802),
+ Spell(0x00697072, 4, 13, 0x3C71),
+ Spell(0x00697075, 4, 15, 0x7083),
+ Spell(0x006A6D00, 1, 18, 0x5032),
+ Spell(0x006A6C00, 1, 19, 0x4062),
+ Spell(0x006A6F77, 1, 15, 0x3013),
+ Spell(0x006B0000, 1, 17, 0x3C42),
+ Spell(0x00667000, 2, 15, 0x64C1),
+ Spell(0x00660000, 2, 13, 0x3CB1),
+ Spell(0x00667074, 4, 13, 0x3C81),
+ Spell(0x00667075, 4, 13, 0x3C91),
+ Spell(0x00670000, 1, 13, 0x80E1),
+ Spell(0x00677000, 1, 13, 0x68A1),
+ Spell(0x00687073, 4, 13, 0x3C61),
+ Spell(0x006B7076, 3, 2, 0xFCD1),
+ Spell(0x006B6C00, 2, 19, 0x7831),
+ Spell(0x006B6E76, 0, 3, 0x3C73)};
+
+
+ int32 L1261_l_Symbols;
+ int16 L1262_i_Multiple;
+#define AL1262_i_BitShiftCount L1262_i_Multiple
+#define AL1262_i_SpellIndex L1262_i_Multiple
+ Spell* L1263_ps_Spell;
+
+
+ if (*(symbols + 1)) {
+ AL1262_i_BitShiftCount = 24;
+ L1261_l_Symbols = 0;
+ do {
+ L1261_l_Symbols |= (long)*symbols++ << AL1262_i_BitShiftCount;
+ } while (*symbols && ((AL1262_i_BitShiftCount -= 8) >= 0));
+ L1263_ps_Spell = G0487_as_Graphic560_Spells;
+ AL1262_i_SpellIndex = 25;
+ while (AL1262_i_SpellIndex--) {
+ if (L1263_ps_Spell->_symbols & 0xFF000000) { /* If byte 1 of spell is not 0 then the spell includes the power symbol */
+ if (L1261_l_Symbols == L1263_ps_Spell->_symbols) { /* Compare champion symbols, including power symbol, with spell (never used with actual spells) */
+ return L1263_ps_Spell;
+ }
+ } else {
+ if ((L1261_l_Symbols & 0x00FFFFFF) == L1263_ps_Spell->_symbols) { /* Compare champion symbols, except power symbol, with spell */
+ return L1263_ps_Spell;
+ }
+ }
+ L1263_ps_Spell++;
+ }
+ }
+ return NULL;
+}
+
+void MenuMan::f410_menusPrintSpellFailureMessage(Champion* champ, uint16 failureType, uint16 skillIndex) {
+ char* L1264_pc_Message = nullptr;
+
+ if (skillIndex > k3_ChampionSkillWizard) {
+ skillIndex = (skillIndex - 4) / 4;
+ }
+ _vm->_textMan->f51_messageAreaPrintLineFeed();
+ _vm->_textMan->f47_messageAreaPrintMessage(k4_ColorCyan, champ->_name);
+ switch (failureType) {
+ case k0_failureNeedsMorePractice:
+ // TODO: localization
+ _vm->_textMan->f47_messageAreaPrintMessage(k4_ColorCyan, " NEEDS MORE PRACTICE WITH THIS ");
+ _vm->_textMan->f47_messageAreaPrintMessage(k4_ColorCyan, g417_baseSkillName[skillIndex]);
+ L1264_pc_Message = " SPELL.";
+ break;
+ case k1_failureMeaninglessSpell:
+ L1264_pc_Message = " MUMBLES A MEANINGLESS SPELL."; // TODO: localization
+ break;
+ case k10_failureNeedsFlaskInHand:
+ L1264_pc_Message = " NEEDS AN EMPTY FLASK IN HAND FOR POTION."; // TODO: localization
+ break;
+ }
+ _vm->_textMan->f47_messageAreaPrintMessage(k4_ColorCyan, L1264_pc_Message);
+}
+
+Potion* MenuMan::f411_getEmptyFlaskInHand(Champion* champ, Thing* potionThing) {
+ Thing L1265_T_Thing;
+ int16 L1266_i_SlotIndex;
+
+ for (L1266_i_SlotIndex = k2_ChampionSlotHead; --L1266_i_SlotIndex >= k0_ChampionSlotReadyHand; ) {
+ if (((L1265_T_Thing = champ->_slots[L1266_i_SlotIndex]) != Thing::_none) && (_vm->_objectMan->f33_getIconIndex(L1265_T_Thing) == k195_IconIndicePotionEmptyFlask)) {
+ *potionThing = L1265_T_Thing;
+ return (Potion*)_vm->_dungeonMan->f156_getThingData(L1265_T_Thing);
+ }
+ }
+ return nullptr;
+}
+
+void MenuMan::f404_createEvent70_light(int16 lightPower, int16 ticks) {
+ TimelineEvent L1241_s_Event;
+
+ L1241_s_Event._type = k70_TMEventTypeLight;
+ L1241_s_Event._B._lightPower = lightPower;
+ M33_setMapAndTime(L1241_s_Event._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_g313_gameTime + ticks);
+ L1241_s_Event._priority = 0;
+ _vm->_timeline->f238_addEventGetEventIndex(&L1241_s_Event);
+ _vm->_inventoryMan->f337_setDungeonViewPalette();
+}
+
+bool MenuMan::f403_isPartySpellOrFireShieldSuccessful(Champion* champ, bool spellShield, uint16 ticks, bool useMana) {
+ bool L1239_B_IsPartySpellOrFireShieldSuccessful;
+ TimelineEvent L1240_s_Event;
+
+
+ L1239_B_IsPartySpellOrFireShieldSuccessful = true;
+ if (useMana) {
+ if (champ->_currMana == 0) {
+ return false;
+ }
+ if (champ->_currMana < 4) {
+ ticks >>= 1;
+ champ->_currMana = 0;
+ L1239_B_IsPartySpellOrFireShieldSuccessful = false;
+ } else {
+ champ->_currMana -= 4;
+ }
+ }
+ L1240_s_Event._B._defense = ticks >> 5;
+ if (spellShield) {
+ L1240_s_Event._type = k77_TMEventTypeSpellShield;
+ if (_vm->_championMan->_g407_party._spellShieldDefense > 50) {
+ L1240_s_Event._B._defense >>= 2;
+ }
+ _vm->_championMan->_g407_party._spellShieldDefense += L1240_s_Event._B._defense;
+ } else {
+ L1240_s_Event._type = k78_TMEventTypeFireShield;
+ if (_vm->_championMan->_g407_party._fireShieldDefense > 50) {
+ L1240_s_Event._B._defense >>= 2;
+ }
+ _vm->_championMan->_g407_party._fireShieldDefense += L1240_s_Event._B._defense;
+ }
+ L1240_s_Event._priority = 0;
+ M33_setMapAndTime(L1240_s_Event._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_g313_gameTime + ticks);
+ _vm->_timeline->f238_addEventGetEventIndex(&L1240_s_Event);
+ _vm->_timeline->f260_timelineRefreshAllChampionStatusBoxes();
+ return L1239_B_IsPartySpellOrFireShieldSuccessful;
+}
+
+void MenuMan::f397_drawAvailableSymbols(uint16 symbolStep) {
+ uint16 L1214_ui_Counter;
+ int16 L1215_i_X;
+ char L1216_c_Character;
+ char L1217_ac_String[2];
+
+ L1217_ac_String[1] = '\0';
+ L1216_c_Character = 96 + 6 * symbolStep;
+ L1215_i_X = 225;
+ for (L1214_ui_Counter = 0; L1214_ui_Counter < 6; L1214_ui_Counter++) {
+ L1217_ac_String[0] = L1216_c_Character++;
+ _vm->_textMan->f53_printToLogicalScreen(L1215_i_X += 14, 58, k4_ColorCyan, k0_ColorBlack, L1217_ac_String);
+ }
+}
+
+void MenuMan::f398_drawChampionSymbols(Champion* champ) {
+ uint16 L1218_ui_SymbolIndex;
+ int16 L1219_i_X;
+ uint16 L1220_ui_SymbolCount;
+ char L1221_ac_String[2];
+
+
+ L1220_ui_SymbolCount = strlen(champ->_symbols);
+ L1219_i_X = 232;
+ L1221_ac_String[1] = '\0';
+ for (L1218_ui_SymbolIndex = 0; L1218_ui_SymbolIndex < 4; L1218_ui_SymbolIndex++) {
+ if (L1218_ui_SymbolIndex >= L1220_ui_SymbolCount) {
+ L1221_ac_String[0] = ' ';
+ } else {
+ L1221_ac_String[0] = champ->_symbols[L1218_ui_SymbolIndex];
+ }
+ _vm->_textMan->f53_printToLogicalScreen(L1219_i_X += 9, 70, k4_ColorCyan, k0_ColorBlack, L1221_ac_String);
+ }
+}
+
+void MenuMan::f399_addChampionSymbol(int16 symbolIndex) {
+ static byte G0485_aauc_Graphic560_SymbolBaseManaCost[4][6] = {
+ {1, 2, 3, 4, 5, 6}, /* Power 1 */
+ {2, 3, 4, 5, 6, 7}, /* Power 2 */
+ {4, 5, 6, 7, 7, 9}, /* Power 3 */
+ {2, 2, 3, 4, 6, 7}}; /* Power 4 */
+ static byte G0486_auc_Graphic560_SymbolManaCostMultiplier[6] = {8, 12, 16, 20, 24, 28};
+
+ uint16 L1222_ui_SymbolStep;
+ uint16 L1223_ui_ManaCost;
+ uint16 L1224_ui_SymbolIndex;
+ Champion* L1225_ps_Champion;
+
+ L1225_ps_Champion = &_vm->_championMan->_gK71_champions[_vm->_championMan->_g514_magicCasterChampionIndex];
+ L1222_ui_SymbolStep = L1225_ps_Champion->_symbolStep;
+ L1223_ui_ManaCost = G0485_aauc_Graphic560_SymbolBaseManaCost[L1222_ui_SymbolStep][symbolIndex];
+ if (L1222_ui_SymbolStep) {
+ L1223_ui_ManaCost = (L1223_ui_ManaCost * G0486_auc_Graphic560_SymbolManaCostMultiplier[L1224_ui_SymbolIndex = L1225_ps_Champion->_symbols[0] - 96]) >> 3;
+ }
+ if (L1223_ui_ManaCost <= L1225_ps_Champion->_currMana) {
+ L1225_ps_Champion->_currMana -= L1223_ui_ManaCost;
+ setFlag(L1225_ps_Champion->_attributes, k0x0100_ChampionAttributeStatistics);
+ L1225_ps_Champion->_symbols[L1222_ui_SymbolStep] = 96 + (L1222_ui_SymbolStep * 6) + symbolIndex;
+ L1225_ps_Champion->_symbols[L1222_ui_SymbolStep + 1] = '\0';
+ L1225_ps_Champion->_symbolStep = L1222_ui_SymbolStep = returnNextVal(L1222_ui_SymbolStep);
+ _vm->_eventMan->f78_showMouse();
+ f397_drawAvailableSymbols(L1222_ui_SymbolStep);
+ f398_drawChampionSymbols(L1225_ps_Champion);
+ _vm->_championMan->f292_drawChampionState(_vm->_championMan->_g514_magicCasterChampionIndex);
+ _vm->_eventMan->f77_hideMouse();
+ }
+}
+
+void MenuMan::f400_deleteChampionSymbol() {
+ int16 L1226_ui_SymbolStep;
+ Champion* L1228_ps_Champion;
+
+ L1228_ps_Champion = &_vm->_championMan->_gK71_champions[_vm->_championMan->_g514_magicCasterChampionIndex];
+ if (!strlen(L1228_ps_Champion->_symbols)) {
+ return;
+ }
+ L1228_ps_Champion->_symbolStep = L1226_ui_SymbolStep = returnPrevVal(L1228_ps_Champion->_symbolStep);
+ L1228_ps_Champion->_symbols[L1226_ui_SymbolStep] = '\0';
+ _vm->_eventMan->f78_showMouse();
+ f397_drawAvailableSymbols(L1226_ui_SymbolStep);
+ f398_drawChampionSymbols(L1228_ps_Champion);
+ _vm->_eventMan->f77_hideMouse();
+}
}
diff --git a/engines/dm/menus.h b/engines/dm/menus.h
index 9c93fd00a7..0aabcab3f0 100644
--- a/engines/dm/menus.h
+++ b/engines/dm/menus.h
@@ -30,6 +30,7 @@
#include "dm.h"
#include "champion.h"
+#include "dungeonman.h"
namespace DM {
@@ -73,6 +74,17 @@ public:
void f392_buildSpellAreaLine(int16 spellAreaBitmapLine);// @ F0392_MENUS_BuildSpellAreaLine
void f394_setMagicCasterAndDrawSpellArea(int16 champIndex); // @ F0394_MENUS_SetMagicCasterAndDrawSpellArea
void f457_drawEnabledMenus(); // @ F0457_START_DrawEnabledMenus_CPSF
+ int16 f408_getClickOnSpellCastResult(); // @ F0408_MENUS_GetClickOnSpellCastResult
+ int16 f412_getChampionSpellCastResult(uint16 champIndex); // @ F0412_MENUS_GetChampionSpellCastResult
+ Spell *f409_getSpellFromSymbols(byte *symbols); // @ F0409_MENUS_GetSpellFromSymbols
+ void f410_menusPrintSpellFailureMessage(Champion *champ, uint16 failureType, uint16 skillIndex); // @ F0410_MENUS_PrintSpellFailureMessage
+ Potion *f411_getEmptyFlaskInHand(Champion *champ, Thing *potionThing); // @ F0411_MENUS_GetEmptyFlaskInHand
+ void f404_createEvent70_light(int16 lightPower, int16 ticks); // @ F0404_MENUS_CreateEvent70_Light
+ bool f403_isPartySpellOrFireShieldSuccessful(Champion *champ, bool spellShield, uint16 ticks, bool useMana); // @ F0403_MENUS_IsPartySpellOrFireShieldSuccessful
+ void f397_drawAvailableSymbols(uint16 symbolStep); // @ F0397_MENUS_DrawAvailableSymbols
+ void f398_drawChampionSymbols(Champion *champ); // @ F0398_MENUS_DrawChampionSymbols
+ void f399_addChampionSymbol(int16 symbolIndex); // @ F0399_MENUS_AddChampionSymbol
+ void f400_deleteChampionSymbol(); // @ F0400_MENUS_DeleteChampionSymbol
};
}
diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp
index f154053b87..6cb159a205 100644
--- a/engines/dm/movesens.cpp
+++ b/engines/dm/movesens.cpp
@@ -845,10 +845,7 @@ void MovesensMan::f276_sensorProcessThingAdditionOrRemoval(uint16 mapX, uint16 m
goto T0276079;
break;
case k5_SensorFloorPartyOnStairs:
- // Strangerke: Only present in v2.1, but it fixes a bug so we'll keep it.
-#ifdef COMPILE52_CSB21EN /* CHANGE8_05_FIX The wrong variable is replaced by the correct variable in the condition. The test should not be on L0771_ui_ThingType but on L0767_i_ThingType */
- if ((L0767_i_ThingType != kM1_PartyThingType) || (M34_SQUARE_TYPE(L0777_ui_Square) != k3_ElementTypeStairs))
-#endif
+ if ((L0767_i_ThingType != kM1_PartyThingType) || (Square(L0777_ui_Square).getType() != k3_ElementTypeStairs))
goto T0276079;
break;
case k6_SensorFloorGroupGenerator: