Odd...
I'm having trouble with this code. It's giving me a mismatch error for some reason... a reason that I can't see.
script_enemy_main{
let CSD = GetCurrentScriptDirectory;
let imgBoss = CSD ~ "Materials\Graphics\PlaceholderBoss.png";
#include_function ".\ExpandedShotDatav4\shot_replace.dnh";
@Initialize{
SetLife(1000);
SetDamageRate(25,15);
SetTimer(40);
SetScore(1000);
SetMovePosition01(GetCenterX,GetCenterY-150,5);
LoadGraphic(imgBoss);
ShotInit;
CutIn(KOUMA,"Collapse Sign "\""Burial in the Collapsing Cavern"\","",0,0,0,0);
mainTask;
}
@MainLoop{
SetCollisionA(GetX,GetY,32);
SetCollisionB(GetX,GetY,16);
yield;
}
@DrawLoop{
SetTexture(imgBoss);
SetRenderState(ALPHA);
SetAlpha(255);
SetGraphicRect(0,0,64,64);
SetGraphicScale(1,1);
SetGraphicAngle(0,0,0);
DrawGraphic(GetX,GetY);
}
@BackGround{
}
@Finalize{
DeleteGraphic(imgBoss);
}
task mainTask{
collapseroutine;
move;
}
task collapseroutine{
let shotchoice = [52, 155, 164, 207]
loop{
CreateShotA(1,rand_int(GetClipMinX,GetClipMaxX),GetClipMinY,10);
SetShotDataA_XY(1,0,rand(-1,1),0,0,0.07,0,3,shotchoice[rand_int(0,3)]);
FireShot(1);
wait(30);
}
}
task move{
loop{
SetMovePositionRandom01(200,50,4,GetClipMinX,GetClipMinY,GetClipMaxX,GetCenterY-75);
earthfans;
wait(120);
}
}
task earthfans{
let angle = GetAngleToPlayer;
ascent[a in 3..8]{
ascent in [b in -5..6]{
CreateShotA(1,GetX,GetY,5);
SetShotDataA(1,0,1,angle+90+10*b,0,0,0,37);
SetShotDataA(1,10*a,0,angle+rand_int(-5,5),0,0,0,37);
SetShotDataA(1,90-10*a,NULL,0,0,0,37);
FireShot(1);
CreateShotA(1,GetX,GetY,5);
SetShotDataA(1,0,1,angle-90+10*b,0,0,0,37);
SetShotDataA(1,10*a,0,angle+rand_int(-5,5),0,0,0,37);
SetShotDataA(1,90-10*a,NULL,0,0,0,37);
FireShot(1);
}
}
}
function wait(w){
loop(w){yield;}
}
}