if(strstr(strlwr((char*)ZGetGameClient()->GetStageName()), "[nj]"))
{
int i = rand() % 6 + 1; //6 Different numbers, start from 1, not from 0
//For case 3 and 4
float fSecondJumpSpeed = WALL_JUMP2_SIDE_VELOCITY;
rvector right;
CrossProduct(&right,m_Direction,rvector(0,0,1));
//End for case 3 and 4
AddVelocity(rvector(0,0,800));
switch(i)
{
case 1:
case 5:
m_nWallJump2Dir=7;
AddVelocity(rvector(0,0,1000));
break;
case 2:
case 6:
m_nWallJump2Dir=6;
AddVelocity(rvector(0,0,1000));
break;
case 3:
m_nWallJump2Dir=4;
AddVelocity(fSecondJumpSpeed*-right);
AddVelocity(rvector(0,0,1300));
break;
case 4:
m_nWallJump2Dir=5;
AddVelocity(fSecondJumpSpeed*right);
AddVelocity(rvector(0,0,1300));
break;
}
}
else if(m_nWallJumpDir.Ref()==1)
{
if(ZIsActionKeyPressed(ZACTION_FORWARD))
{
m_nWallJump2Dir=6;
SetVelocity(jump2*50.f);
}
else
{
m_nWallJump2Dir=7;
AddVelocity(jump2*300.f);
}
AddVelocity(rvector(0,0,1400));
}else
{
float fSecondJumpSpeed = WALL_JUMP2_SIDE_VELOCITY;
rvector right;
CrossProduct(&right,m_Direction,rvector(0,0,1));
jump2= (m_nWallJumpDir.Ref()==0) ? -right : right;
if(m_nWallJumpDir.Ref()==0)
m_nWallJump2Dir=4;
else
m_nWallJump2Dir=5;
AddVelocity(fSecondJumpSpeed*jump2);
AddVelocity(rvector(0,0,1300));
}