mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-03 00:46:55 +02:00
* some functions have been written
* added CConsoleHandler to interact with user (it should be testing - only, the real console should be as in h3) pathfinder MAY work now, but it isn't tested
This commit is contained in:
@ -827,40 +827,10 @@ char & CMapHandler::undVisAccess(int x, int y)
|
||||
|
||||
int CMapHandler::getCost(int3 &a, int3 &b, CHeroInstance *hero)
|
||||
{
|
||||
int ret = 1500; //basic value
|
||||
switch(hero->getLowestCreatureSpeed())
|
||||
{
|
||||
case 0: case 1: case 2: case 3: case 4:
|
||||
{
|
||||
ret+=0;
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
ret+=100;
|
||||
break;
|
||||
}
|
||||
case 6: case 7:
|
||||
{
|
||||
ret+=200;
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
{
|
||||
ret+=300;
|
||||
break;
|
||||
}
|
||||
case 9: case 10:
|
||||
{
|
||||
ret+=400;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
ret+=500;
|
||||
break;
|
||||
}
|
||||
}
|
||||
int ret = hero->type->heroClass->terrCosts[CGI->mh->ttiles[a.x][a.y][a.z].malle];
|
||||
if(!(a.x==b.x || a.y==b.y))
|
||||
ret*=1.4142;
|
||||
|
||||
return ret; //TODO: finish it
|
||||
//TODO: use hero's pathfinding skill during calculating cost
|
||||
return ret;
|
||||
}
|
Reference in New Issue
Block a user