script_enemy_main {
#include_function ".\bosslib\Boss.dnh"
let imgBoss = GetCurrentScriptDirectory ~ "img\wriggle.png";
@Initialize {
CreateDebugWindow;
InitializeStbBoss;
LoadGraphic(imgBoss);
SetTexture(imgBoss);
SetGraphicRect(0, 0, 48, 64);
SetX(GetClipMinX);
SetY(GetClipMinY);
SetStbMovePosition03(GetCenterX, GetClipMinY+130, 20, 8);
Attack;
}
@MainLoop {
OutputDebugString(0, "current picture", GetCurrentPicture);
yield;
}
@DrawLoop {
DrawGraphic(GetX, GetY);
}
@Finalize {
}
task Attack {
Wait(72);
loop {
loop {
CrystalLineSeed(GetX, GetY, 0, 0, BLUE03, 15);
if(GetCurrentPicture > 1){ break; }
Wait(72);
SetStbMovePosition03(GetCenterX+rand(40, 80), GetClipMinY+rand(120, 200), 20, 5);
if(GetCurrentPicture > 1){ break; }
Wait(72*3);
CrystalLineSeed(GetX, GetY, 0, 0, BLUE03, 15);
if(GetCurrentPicture > 1){ break; }
Wait(72);
SetStbMovePosition03(GetCenterX-rand(40, 80), GetClipMinY+rand(120, 200), 20, 5);
if(GetCurrentPicture > 1){ break; }
Wait(72*3);
}
loop {
let random = rand(0, 360);
Wait(72);
CrystalLineSeed(GetX, GetY, 0, 0, BLUE03, 15);
Wait(36);
CrystalLineSeed(GetX, GetY, 0, 0, BLUE03, 15);
Wait(36);
CrystalLineSeed(GetX, GetY, 0, 0, BLUE03, 15);
Wait(72);
SetStbMovePosition03(GetCenterX+rand(40, 80), GetClipMinY+rand(120, 200), 20, 5);
random = rand(0, 360);
Wait(72);
CrystalLineSeed(GetX, GetY, 0, 0, BLUE03, 15);
Wait(36);
CrystalLineSeed(GetX, GetY, 0, 0, BLUE03, 15);
Wait(36);
CrystalLineSeed(GetX, GetY, 0, 0, BLUE03, 15);
Wait(72);
SetStbMovePosition03(GetCenterX-rand(40, 80), GetClipMinY+rand(120, 200), 20, 5);
}
}
}
task CurvyBullets(angle){
loop(12){
ascent(i in 0..10){
CurvyBullet(GetX, GetY, 3, angle+i*36, YELLOW01, 10);
}
Wait(6);
}
}
task StraightBullets(angle){
loop(12){
ascent(i in 0..10){
ObjStbShot_Initialize(GetX, GetY, 3, angle+i*36, YELLOW02, 10, 100, 12, YELLOW);
}
Wait(17);
}
}
task CurvyBullet(x, y, speed, angle, graphic, delay){
let obj = ObjStbShot_Initialize(x, y, speed, angle, graphic, delay, 50, 8, YELLOW);
Wait(delay);
loop(30){
ObjStbShot_SetAngle(obj, ObjStbShot_GetAngle(obj)+1.5);
Wait(1);
}
Wait(4);
loop(60){
ObjStbShot_SetAngle(obj, ObjStbShot_GetAngle(obj)-1.5);
Wait(1);
}
Wait(4);
loop(60){
ObjStbShot_SetAngle(obj, ObjStbShot_GetAngle(obj)+1.5);
Wait(1);
}
Wait(4);
loop(60){
ObjStbShot_SetAngle(obj, ObjStbShot_GetAngle(obj)-1.5);
Wait(1);
}
}
task CrystalLineSeed(x, y, speed, angle, graphic, delay){
let obj = ObjStbShot_Initialize(x, y, speed, angle, graphic, delay, 150, 32, BLUE);
Wait(delay);
loop(10){
ascent(i in -2..3){
DownCrystal(ObjStbShot_GetX(obj), ObjStbShot_GetY(obj), i, 3, BLUE23, 10);
UpCrystal(ObjStbShot_GetX(obj), ObjStbShot_GetY(obj), i, 3, BLUE23, 10);
ObjStbShot_Initialize(x, y, 2, 0, RED23, delay, 150, 32, RED);
ObjStbShot_Initialize(x, y, 2, 180, RED23, delay, 150, 32, RED);
}
Wait(57);
}
ObjStbShot_FadeDelete(obj);
}
task DownCrystal(x, y, xspeed, yspeed, graphic, delay){
let obj = ObjStbShot_Initialize(x, y, yspeed, 90, graphic, delay, 50, 6, BLUE);
Wait(delay);
while(!Obj_BeDeleted(obj)){
ObjStbShot_SetX(obj, ObjStbShot_GetX(obj)+xspeed);
Wait(1);
}
}
task UpCrystal(x, y, xspeed, yspeed, graphic, delay){
let obj = ObjStbShot_Initialize(x, y, yspeed, 270, graphic, delay, 50, 6, BLUE);
Wait(delay);
while(!Obj_BeDeleted(obj)){
ObjStbShot_SetX(obj, ObjStbShot_GetX(obj)+xspeed);
Wait(1);
}
}
}
There you go. I made a few changes since the image was made so it couldn't be cheesed by staying above/to either side of the boss, and this is far from the final version.