mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-29 21:24:53 +00:00
XEEN: Add special case spell handling during combat
This commit is contained in:
parent
0f78fb9373
commit
da368f5e00
@ -527,8 +527,10 @@ void Interface::perform() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
Character *c = &party._activeParty[(spells._lastCaster < 0 ||
|
||||||
|
spells._lastCaster >= (int)party._activeParty.size()) ?
|
||||||
|
(int)party._activeParty.size() - 1 : spells._lastCaster];
|
||||||
do {
|
do {
|
||||||
Character *c = nullptr;
|
|
||||||
int spellId = CastSpell::show(_vm, c, _vm->_mode);
|
int spellId = CastSpell::show(_vm, c, _vm->_mode);
|
||||||
if (spellId == -1 || c == nullptr)
|
if (spellId == -1 || c == nullptr)
|
||||||
break;
|
break;
|
||||||
|
@ -126,13 +126,21 @@ int Spells::castSpell(Character *c, int spellId) {
|
|||||||
} else {
|
} else {
|
||||||
// Some spells have special handling
|
// Some spells have special handling
|
||||||
switch (spellId) {
|
switch (spellId) {
|
||||||
case 19:
|
case 19: // Enchant item
|
||||||
// Enchant item
|
case 21: // Etherialize
|
||||||
|
case 40: // Jump
|
||||||
|
case 44: // Lloyd's Beacon
|
||||||
|
case 66: // Super Shelter
|
||||||
|
case 69: // Teleport
|
||||||
|
case 71: // Town Portal
|
||||||
|
case 75: // Wizard Eye
|
||||||
if (_vm->_mode != MODE_COMBAT) {
|
if (_vm->_mode != MODE_COMBAT) {
|
||||||
enchantItem();
|
executeSpell(spellId);
|
||||||
} else {
|
} else {
|
||||||
// Return the spell costs and flag that another spell can be selected
|
// Return the spell costs and flag that another spell can be selected
|
||||||
addSpellCost(*c, spellId);
|
addSpellCost(*c, spellId);
|
||||||
|
ErrorDialog::show(_vm, Common::String::format(CANT_CAST_WHILE_ENGAGED,
|
||||||
|
_spellNames[spellId]));
|
||||||
result = -1;
|
result = -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user