here the fixed version, testet and is work.
action enemy_dummy()
{
set(my,SHADOW);
my.entity_type = 2;
my.emask |= ENABLE_SCAN;
while(1)
{
if(my.hit_by_player != 1)
{
my.skill1 += 3*time_step;
my.skill1 %= 100;
ent_animate(me,"stand",my.skill1,ANM_CYCLE);
}
if(my.hit_by_player == 1)
{
if(player.animblend == attack_a)
{
my.skill1 += 3*time_step;
ent_animate(me,"hit_a",my.skill1,ANM_CYCLE);
my.skill1 %= 100;
my.move_x = player.move_x;
my.move_y = player.move_y;
c_move(my, nullvector, my.move_x, USE_BOX | IGNORE_PASSABLE | GLIDE);
if((player.animblend == blend) || (player.animblend < attack_a) || (my.animblend > attack_f))
{
my.hit_by_player = 0;
}
}
if(player.animblend == attack_b)
{
my.skill1 += 3*time_step;
ent_animate(me,"hit_b",my.skill1,ANM_CYCLE);
my.skill1 %= 100;
my.move_x = player.move_x;
my.move_y = player.move_y;
c_move(my, nullvector, my.move_x, USE_BOX | IGNORE_PASSABLE | GLIDE);
if((player.animblend == blend) || (player.animblend < attack_a) || (my.animblend > attack_f))
{
my.hit_by_player = 0;
}
}
if(player.animblend == attack_c)
{
my.skill1 += 3*time_step;
ent_animate(me,"hit_c",my.skill1,ANM_CYCLE);
my.skill1 %= 100;
my.move_x = player.move_x;
my.move_y = player.move_y;
c_move(my, nullvector, my.move_x, USE_BOX | IGNORE_PASSABLE | GLIDE);
if((player.animblend == blend) || (player.animblend < attack_a) || (my.animblend > attack_f))
{
my.hit_by_player = 0;
}
}
if(player.animblend == attack_d)
{
my.skill1 += 3*time_step;
ent_animate(me,"hit_d",my.skill1,ANM_CYCLE);
my.skill1 %= 100;
my.move_x = player.move_x;
my.move_y = player.move_y;
c_move(my, nullvector, my.move_x, USE_BOX | IGNORE_PASSABLE | GLIDE);
if((player.animblend == blend) || (player.animblend < attack_a) || (my.animblend > attack_f))
{
my.hit_by_player = 0;
}
}
if(player.animblend == attack_e)
{
my.skill1 += 3*time_step;
ent_animate(me,"hit_e",my.skill1,ANM_CYCLE);
my.skill1 %= 100;
my.move_x = player.move_x;
my.move_y = player.move_y;
c_move(my, nullvector, my.move_x, USE_BOX | IGNORE_PASSABLE | GLIDE);
}
if(player.animblend == attack_f)
{
my.skill1 += 3*time_step;
ent_animate(me,"hit_f",my.skill1,ANM_CYCLE);
my.skill1 %= 100;
my.move_x = player.move_x;
my.move_y = player.move_y;
c_move(my, nullvector, my.move_x, USE_BOX | IGNORE_PASSABLE | GLIDE);
if((player.animblend == blend) || (player.animblend < attack_a) || (my.animblend > attack_f))
{
my.hit_by_player = 0;
}
}
}
if((player.animblend == blend) || (player.animblend < attack_a) || (my.animblend > attack_f))
{
my.hit_by_player = 0;
}
wait(1);
if(((player.animblend >= stand) && (target_enemy == me) && (player_lock_on == 0))
&& ((player.animblend < attack_a) || (player.animblend > attack_f)))
{
target_enemy = NULL;
}
if((target_enemy == my) && (vec_dist(my.x, player.x) > 500))
{
target_enemy = NULL;
}
wait(1);
}
}