Новичок
-
Автор темы
- #1
C++:
void Resolver::AntiFreestand(Player* pEnemy, float& y, float flLeftDamage, float flRightDamage, float flRightFraction, float flLeftFraction, float flToMe, int& iShotsMissed)
{
if (flLeftDamage >= 15 && flRightDamage >= 15)
{
//too much damage to both sides bruteforce!
switch (iShotsMissed)
{
case 0:
y = flToMe + 180;
break;
case 1:
y = flToMe + 110;
break;
case 2:
y = flToMe - 110;
break;
case 3:
y = flToMe + 180;
break;
case 5:
y = flToMe + 90;
break;
case 6:
y = flToMe - 90;
break;
case 7:
y = flToMe + 75;
break;
case 8:
y = flToMe - 75;
break;
case 9:
y = flToMe + 50;
break;
case 10:
y = flToMe - 50;
break;
case 11:
y = flToMe + 0;
break;
case 12:
y = flToMe - 0;
break;
case 13:
iShotsMissed = 0;
break;
}
}
else
{
if (flLeftDamage <= 0 && flRightDamage <= 0)
{
//no damage at all use edge
if (flRightFraction == flLeftFraction)
{
switch (iShotsMissed)
{
case 0:
y = flToMe + 180;
break;
case 1:
y = flToMe + 110;
break;
case 2:
y = flToMe - 110;
break;
case 3:
y = flToMe + 180;
break;
case 5:
y = flToMe + 90;
break;
case 6:
y = flToMe - 90;
break;
case 7:
y = flToMe + 75;
break;
case 8:
y = flToMe - 75;
break;
case 9:
y = flToMe + 50;
break;
case 10:
y = flToMe - 50;
break;
case 11:
y = flToMe + 0;
break;
case 12:
y = flToMe - 0;
break;
case 13:
iShotsMissed = 0;
break;
}
}
else
if (flRightFraction < flLeftFraction)
{
//negative
switch (iShotsMissed)
{
case 0:
y = flToMe + 180;
break;
case 1:
y = flToMe + 110;
break;
case 2:
y = flToMe - 110;
break;
case 3:
y = flToMe + 180;
break;
case 5:
y = flToMe + 90;
break;
case 6:
y = flToMe - 90;
break;
case 7:
y = flToMe + 75;
break;
case 8:
y = flToMe - 75;
break;
case 9:
y = flToMe + 50;
break;
case 10:
y = flToMe - 50;
break;
case 11:
y = flToMe + 0;
break;
case 12:
y = flToMe - 0;
break;
case 13:
iShotsMissed = 0;
break;
}
}
else
{
switch (iShotsMissed)
{
case 0:
y = flToMe + 180;
break;
case 1:
y = flToMe + 110;
break;
case 2:
y = flToMe - 110;
break;
case 3:
y = flToMe + 180;
break;
case 5:
y = flToMe + 90;
break;
case 6:
y = flToMe - 90;
break;
case 7:
y = flToMe + 75;
break;
case 8:
y = flToMe - 75;
break;
case 9:
y = flToMe + 50;
break;
case 10:
y = flToMe - 50;
break;
case 11:
y = flToMe + 0;
break;
case 12:
y = flToMe - 0;
break;
case 13:
iShotsMissed = 0;
break;
}
}
}
else
{
//got some damage turn damage based
if (flLeftDamage == flRightDamage)
{
switch (iShotsMissed)
{
case 0:
y = flToMe + 180;
break;
case 1:
y = flToMe + 110;
break;
case 2:
y = flToMe - 110;
break;
case 3:
y = flToMe + 180;
break;
case 5:
y = flToMe + 90;
break;
case 6:
y = flToMe - 90;
break;
case 7:
y = flToMe + 75;
break;
case 8:
y = flToMe - 75;
break;
case 9:
y = flToMe + 50;
break;
case 10:
y = flToMe - 50;
break;
case 11:
y = flToMe + 0;
break;
case 12:
y = flToMe - 0;
break;
case 13:
iShotsMissed = 0;
break;
}
}
else
if (flLeftDamage > flRightDamage)
{
//negative
switch (iShotsMissed)
{
case 0:
y = flToMe - 110.f;
break;
case 1:
y = flToMe + 180;
break;
case 2:
y = flToMe + 110.f;
break;
case 3:
y = flToMe - 180;
break;
case 4:
y = flToMe - 90;
break;
case 5:
y = flToMe + 90.f;
break;
case 6:
y = flToMe + 0.f;
break;
case 7:
y = flToMe - 0.f;
case 8:
iShotsMissed = 0;
break;
}
}
else
{
switch (iShotsMissed)
{
case 0:
y = flToMe - 110.f;
break;
case 1:
y = flToMe + 180;
break;
case 2:
y = flToMe + 110.f;
break;
case 3:
y = flToMe - 180;
break;
case 4:
y = flToMe - 90;
break;
case 5:
y = flToMe + 90.f;
break;
case 6:
y = flToMe + 0.f;
break;
case 7:
y = flToMe - 0.f;
case 8:
iShotsMissed = 0;
break;
}
}
}
}
}
good shit peti