mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
* Fixed #532 -> Catapult shoots now after keep/upper/lower tower
* Fixed turret projectile bug
This commit is contained in:
parent
53ce30f083
commit
431064cbf9
@ -1040,7 +1040,7 @@ bool CShootingAnim::init()
|
||||
spi.animStartDelay = CGI->creh->creatures[spi.creID]->attackClimaxFrame;
|
||||
owner->projectiles.push_back(spi);
|
||||
|
||||
//attack aniamtion
|
||||
//attack animation
|
||||
|
||||
shooting = true;
|
||||
|
||||
@ -3894,13 +3894,13 @@ Point CBattleHex::getXYUnitAnim(const int & hexNum, const bool & attacker, const
|
||||
switch(stack->position)
|
||||
{
|
||||
case -2: //keep
|
||||
ret = graphics->wallPositions[cbi->siegeH->town->town->typeID][12];
|
||||
ret = graphics->wallPositions[cbi->siegeH->town->town->typeID][17];
|
||||
break;
|
||||
case -3: //lower turret
|
||||
ret = graphics->wallPositions[cbi->siegeH->town->town->typeID][13];
|
||||
ret = graphics->wallPositions[cbi->siegeH->town->town->typeID][18];
|
||||
break;
|
||||
case -4: //upper turret
|
||||
ret = graphics->wallPositions[cbi->siegeH->town->town->typeID][14];
|
||||
ret = graphics->wallPositions[cbi->siegeH->town->town->typeID][19];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1425,26 +1425,25 @@ BattleInfo * BattleInfo::setupBattle( int3 tile, int terrain, int terType, const
|
||||
}
|
||||
//war machines added
|
||||
|
||||
switch(curB->siege) //adding towers
|
||||
if (curB->siege == 2 || curB->siege == 3)
|
||||
{
|
||||
// keep tower
|
||||
CStack * stack = curB->generateNewStack(CStackBasicDescriptor(149, 1), stacks.size(), false, 255, -2);
|
||||
stacks.push_back(stack);
|
||||
|
||||
case 3: //castle
|
||||
{//lower tower / upper tower
|
||||
if (curB->siege == 3)
|
||||
{
|
||||
// lower tower + upper tower
|
||||
CStack * stack = curB->generateNewStack(CStackBasicDescriptor(149, 1), stacks.size(), false, 255, -4);
|
||||
stacks.push_back(stack);
|
||||
stack = curB->generateNewStack(CStackBasicDescriptor(149, 1), stacks.size(), false, 255, -3);
|
||||
stacks.push_back(stack);
|
||||
}
|
||||
case 2: //citadel
|
||||
{//main tower
|
||||
CStack * stack = curB->generateNewStack(CStackBasicDescriptor(149, 1), stacks.size(), false, 255, -2);
|
||||
stacks.push_back(stack);
|
||||
}
|
||||
}
|
||||
|
||||
std::stable_sort(stacks.begin(),stacks.end(),cmpst);
|
||||
|
||||
//seting up siege
|
||||
//setting up siege
|
||||
if(town && town->hasFort())
|
||||
{
|
||||
for(int b=0; b<ARRAY_COUNT(curB->si.wallState); ++b)
|
||||
@ -2391,8 +2390,7 @@ bool CMP_stack::operator()( const CStack* a, const CStack* b )
|
||||
switch(phase)
|
||||
{
|
||||
case 0: //catapult moves after turrets
|
||||
return a->getCreature()->idNumber < b->getCreature()->idNumber; //catapult is 145 and turrets are 149
|
||||
//TODO? turrets order
|
||||
return a->getCreature()->idNumber > b->getCreature()->idNumber; //catapult is 145 and turrets are 149
|
||||
case 1: //fastest first, upper slot first
|
||||
{
|
||||
int as = a->Speed(turn), bs = b->Speed(turn);
|
||||
|
Loading…
Reference in New Issue
Block a user