mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-03 15:41:41 +00:00
MM: MM1: Actually deduct SP when casting spells in enhanced mode
This commit is contained in:
parent
45ea120eb7
commit
409b5809ba
2
NEWS.md
2
NEWS.md
@ -40,7 +40,7 @@ For a more comprehensive changelog of the latest experimental code, see:
|
||||
MM:
|
||||
- Added MT32/LAPC-1 support for Xeen engine.
|
||||
- Fixed Xeen regression which caused some sound effects to stop abruptly.
|
||||
- Fixed spell SP/gem requirements
|
||||
- Fixed spell SP/gem requirements in MM1 enhanced mode, and actually remove spell points & gems when spells are cast.
|
||||
|
||||
SCI:
|
||||
- Added support for Russian fan-translation of QFG3.
|
||||
|
@ -115,7 +115,7 @@ void SpellCasting::setSpell(const Character *chr, int lvl, int num) {
|
||||
|
||||
if (SPELLS_SP_GEMS[spellIndex] < 0 && chr->_sp._current < chr->_level._current)
|
||||
_spellState = SS_NOT_ENOUGH_SP;
|
||||
else if ((lvl - 1) > chr->_sp._current)
|
||||
else if (requiredSp > chr->_sp._current)
|
||||
_spellState = SS_NOT_ENOUGH_SP;
|
||||
|
||||
int requiredGems = ABS(SPELLS_SP_GEMS[spellIndex]);
|
||||
|
@ -206,8 +206,8 @@ void CastSpell::timeout() {
|
||||
|
||||
void CastSpell::performSpell(Character *chr) {
|
||||
Character &c = *g_globals->_currCharacter;
|
||||
c._sp._current = MAX(c._sp._current - _requiredSp, 0);
|
||||
c._gems = MAX(c._gems - _requiredGems, 0);
|
||||
c._sp._current = MAX((int)c._sp._current - _requiredSp, 0);
|
||||
c._gems = MAX((int)c._gems - _requiredGems, 0);
|
||||
|
||||
if (!isMagicAllowed()) {
|
||||
spellDone(STRING["spells.magic_doesnt_work"], 5);
|
||||
|
@ -172,6 +172,10 @@ void CastSpell::castSpell(Character *target) {
|
||||
if (_spellIndex == -1)
|
||||
return;
|
||||
|
||||
Character &c = *g_globals->_currCharacter;
|
||||
c._sp._current = MAX((int)c._sp._current - _requiredSp, 0);
|
||||
c._gems = MAX((int)c._gems - _requiredGems, 0);
|
||||
|
||||
if (!isMagicAllowed()) {
|
||||
g_events->send(InfoMessage(STRING["spells.magic_doesnt_work"]));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user