mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-04 22:14:25 +02:00
Support for sanctuary.
Minor fix.
This commit is contained in:
parent
1e30045541
commit
44ee8e47b7
@ -482,13 +482,25 @@ void CGObjectInstance::onHeroVisit( const CGHeroInstance * h ) const
|
|||||||
{
|
{
|
||||||
switch(ID)
|
switch(ID)
|
||||||
{
|
{
|
||||||
case 95:
|
case 80: //Sanctuary
|
||||||
|
{
|
||||||
|
InfoWindow iw;
|
||||||
|
iw.player = h->tempOwner;
|
||||||
|
iw.soundID = soundBase::GETPROTECTION;
|
||||||
|
iw.text.addTxt(MetaString::ADVOB_TXT, 114); //You enter the sanctuary and immediately feel as if a great weight has been lifted off your shoulders. You feel safe here.
|
||||||
|
cb->sendAndApply(&iw);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 95: //Tavern
|
||||||
|
{
|
||||||
OpenWindow ow;
|
OpenWindow ow;
|
||||||
ow.window = OpenWindow::TAVERN_WINDOW;
|
ow.window = OpenWindow::TAVERN_WINDOW;
|
||||||
ow.id1 = h->id;
|
ow.id1 = h->id;
|
||||||
ow.id2 = id;
|
ow.id2 = id;
|
||||||
cb->sendAndApply(&ow);
|
cb->sendAndApply(&ow);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ui8 CGObjectInstance::getPassableness() const
|
ui8 CGObjectInstance::getPassableness() const
|
||||||
@ -982,10 +994,10 @@ void CGHeroInstance::initObj()
|
|||||||
bonus.type = Bonus::PRIMARY_SKILL; //TODO: limit to specific creature type
|
bonus.type = Bonus::PRIMARY_SKILL; //TODO: limit to specific creature type
|
||||||
bonus.valType = Bonus::ADDITIVE_VALUE;
|
bonus.valType = Bonus::ADDITIVE_VALUE;
|
||||||
bonus.subtype = 1; //attack
|
bonus.subtype = 1; //attack
|
||||||
bonus.val = level * (*creatures)[it->additionalinfo]->attack / (*creatures)[it->additionalinfo]->level /20;
|
bonus.val = level * (*creatures)[it->additionalinfo]->attack / creLevel /20;
|
||||||
speciality.bonuses.push_back (bonus);
|
speciality.bonuses.push_back (bonus);
|
||||||
bonus.subtype = 2; //defense
|
bonus.subtype = 2; //defense
|
||||||
bonus.val = level * (*creatures)[it->additionalinfo]->defence / (*creatures)[it->additionalinfo]->level /20;
|
bonus.val = level * (*creatures)[it->additionalinfo]->defence / creLevel /20;
|
||||||
speciality.bonuses.push_back (bonus);
|
speciality.bonuses.push_back (bonus);
|
||||||
bonus.type = Bonus::STACKS_SPEED;
|
bonus.type = Bonus::STACKS_SPEED;
|
||||||
bonus.val = 1; //+1 speed
|
bonus.val = 1; //+1 speed
|
||||||
|
@ -2171,6 +2171,11 @@ void CGameState::calculatePaths(const CGHeroInstance *hero, CPathsInfo &out, int
|
|||||||
node.accessible = CGPathNode::BLOCKED;
|
node.accessible = CGPathNode::BLOCKED;
|
||||||
}
|
}
|
||||||
else if(tinfo->visitable)
|
else if(tinfo->visitable)
|
||||||
|
{
|
||||||
|
//hero is protected in Sanctuary
|
||||||
|
if(tinfo->visitableObjects.front()->ID == 80 && tinfo->visitableObjects.back()->ID == HEROI_TYPE && tinfo->visitableObjects.back()->tempOwner != hero->tempOwner)
|
||||||
|
node.accessible = CGPathNode::BLOCKED;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
for(size_t ii = 0; ii < tinfo->visitableObjects.size(); ii++)
|
for(size_t ii = 0; ii < tinfo->visitableObjects.size(); ii++)
|
||||||
{
|
{
|
||||||
@ -2190,6 +2195,7 @@ void CGameState::calculatePaths(const CGHeroInstance *hero, CPathsInfo &out, int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (map->isInTheMap(guardingCreaturePosition(int3(i, j, k)))
|
else if (map->isInTheMap(guardingCreaturePosition(int3(i, j, k)))
|
||||||
&& tinfo->blockingObjects.size() == 0)
|
&& tinfo->blockingObjects.size() == 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user