if(my.STATE == 3)
{
my.ANIMATION += 7*time_step;
ent_animate(me,"attack",my.ANIMATION,ANM_CYCLE);
gegner_treffer = 1;
treffmich =0;
if (my.ANIMATION > 100)
{
treffmich =1; // create the spell
lebensenergie -= (random(5)) * 2.5 * time_step;
whamm_handle = media_play("ouch.wav",0,100);
my.ANIMATION -= 100; // continue the cycle from the beginning
}
/////////// enemy Kills ME?!//////////////////////////
while (vec_dist (player.x, my.x) > 205)
wait(1);
///////HIER HÄT ICH GERN NOCH DIE ABFRAGE WEGEN CAMERABLICK////////////////////////////////////
if (treffer && !treffer1)
{
my.skill88 -= (staerke) * 1.1 * time_step;
}
if (treffer1 && !treffer)
{
my.skill88 -= (staerke) * 1.0 * time_step;
}
if (schwert_treffer && !schwert_treffer1)
{
my.skill88 -= (staerke) * 2.0 * time_step;
}
if (schwert_treffer1 && !schwert_treffer)
{
my.skill88 -= (staerke) * 1.8 * time_step;
}
////////////////////////Sterben///////////////////////////////////
if (my.skill88 <=0)
{
my.STATE = 4;
}
if (vec_dist (player.x, my.x) > 190)
{
gegner_treffer =0;
my.STATE = 2;
}
}