1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Implemented Scuttle Boat and Dimension Door spells.

Fixed #417 and #418.
Moved / refactored some code. Minor fixes.
This commit is contained in:
Michał W. Urbańczyk
2010-03-20 22:17:19 +00:00
parent 047849a23e
commit 80f49badc9
27 changed files with 775 additions and 666 deletions

View File

@@ -51,7 +51,7 @@ void SpellbookInteractiveArea::clickLeft(tribool down, bool previousState)
void SpellbookInteractiveArea::clickRight(tribool down, bool previousState)
{
adventureInt->handleRightClick(textOnRclick, down, this);
adventureInt->handleRightClick(textOnRclick, down);
}
void SpellbookInteractiveArea::hover(bool on)
@@ -688,13 +688,14 @@ void CSpellWindow::SpellArea::clickLeft(tribool down, bool previousState)
}
else
{
using namespace Spells;
int spell = mySpell;
const CGHeroInstance *h = owner->myHero;
owner->fexitb();
switch(spell)
{
case 0: //summon boat
case SUMMON_BOAT:
{
int3 pos = h->bestLocation();
if(pos.x < 0)
@@ -703,6 +704,21 @@ void CSpellWindow::SpellArea::clickLeft(tribool down, bool previousState)
return;
}
}
break;
case SCUTTLE_BOAT:
case DIMENSION_DOOR:
adventureInt->enterCastingMode(sp);
return;
case VISIONS:
case VIEW_EARTH:
case DISGUISE:
case VIEW_AIR:
case FLY:
case WATER_WALK:
case TOWN_PORTAL:
break;
default:
assert(0);
}
LOCPLINT->cb->castSpell(h, spell);