look here,my god!
boolean update_biathlon_run(int param_action)
{
action = param_action;
aa = - 4;
dx = delay_index;
delay_index = 0;
taskInterval = 120;
if (Main.track_y[p] > 0)
{
aa = - 5;
taskInterval = 110;
delay_index = 1;
}
if (Main.track_y[p] < 0)
{
aa = - 2;
taskInterval = 140;
delay_index = 2;
}
taskInterval += v >> 2;
max_period = 4;
processed = false;
if (action == prev_action)
{
action = 0;
}
else
{
pressed = false;
prev_action = action;
}
if (w_action != 0 && (mistake_cnt == 0))
{
if (period != 0) action = 0;
else
{
action = w_action;
pressed = false;
w_action = 0;
}
}
switch (action)
{
/*
case Canvas.KEY_NUM1:
finished = true;
state = Main.STATE_BIATHLON_RUN_FINISH;
state_delay = 40;
Main.finish_biathlon_run();
break;
*/
case -3:
case Canvas.KEY_NUM4:
if (!pressed && (delay_index != 2) && !finished)
{
if (period == 0)
{
if (man_index != 0 || begin)
{
man_index = 0;
pressed = processed = true;
}
}
else
{
mistake_cnt = 2;
if (period == 1) mistake_cnt = 1;
processed = pressed = true;
w_action = action;
}
}
break;
case -4:
case Canvas.KEY_NUM6:
if (!pressed && (delay_index != 2) && !finished)
{
if (period == 0)
{
if (man_index != 1 || begin)
{
man_index = 1;
pressed = processed = true;
}
}
else
{
mistake_cnt = 2;
if (period == 1) mistake_cnt = 1;
processed = pressed = true;
w_action = action;
}
}
break;
case -2:
case Canvas.KEY_NUM8:
if (!pressed && (delay_index == 2) && !finished)
{
if (period == 0)
{
man_index = 1;
pressed = processed = true;
}
else
{
mistake_cnt = 2;
processed = pressed = true;
w_action = action;
}
}
break;
case -7:
case Canvas.KEY_STAR:
processed = true;
Main.pause();
break;
case Main.NO_ACTION:
pressed = false;
prev_action = 0;
}
if (dx != delay_index || begin || processed)
{
if (dx == 2 && !processed) // from landing to horiz
{
man_index = 0;
}
a1 = man_index + 1 + (delay_index << 1);
}