Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function castbar(seconds, spell, sound, size, width){
- PlaySE(sound);
- let alpha = 255;
- let angle = 0;
- let numcasts = 0;
- let green = 0;
- let string = "Casting:" ~ spell;
- let variable = 180;
- let obj = ObjPrim_Create(OBJ_SPRITE_2D);
- Obj_SetRenderPriority(obj, 0.9);
- ObjPrim_SetTexture(obj, GetCurrentScriptDirectory~"tricky_system/img/Default_System.png");
- ObjSprite2D_SetSourceRect(obj, 1, 1, 127, 7);
- ObjSprite2D_SetDestRect(obj, GetStgFrameWidth+60, GetStgFrameHeight/2+65, GetStgFrameWidth+70, GetStgFrameHeight/2+65);
- ObjRender_SetColor(obj, 255, 165, 0);
- ObjRender_SetAlpha(obj, 255);
- ObjMove_SetX(obj, GetStgFrameWidth/2);
- ObjMove_SetY(obj, GetStgFrameHeight/2);
- ObjRender_SetScaleXYZ(obj, 1, 1, 1);
- let objText = ObjText_Create();
- ObjText_SetFontType(objText, "Corbel");
- ObjText_SetText(objText, spell);
- ObjText_SetFontSize(objText, size);
- ObjText_SetFontBold(objText, true);
- ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER);
- ObjText_SetMaxWidth(objText, width);
- ObjText_SetFontColorTop(objText, 224, 255, 255);
- ObjText_SetFontColorBottom(objText, 128, 128, 255);
- ObjText_SetFontBorderType(objText, BORDER_FULL);
- ObjText_SetFontBorderColor(objText,0, 0, 0);
- ObjText_SetFontBorderWidth(objText, 1);
- Obj_SetRenderPriority(objText, 0.9);
- ObjRender_SetX(objText, GetStgFrameWidth/2+225);
- ObjRender_SetY(objText, GetStgFrameHeight/2+25);
- loop(seconds){
- variable-=180/seconds;
- ObjSprite2D_SetDestRect(obj, GetStgFrameWidth+60, GetStgFrameHeight/2+(180+65), GetStgFrameWidth+70, (GetStgFrameHeight/2+65)+variable);
- if(GetVirtualKeyState(VK_USER1)==KEY_PUSH && GetCommonData("interruptavail", false)==true){
- ObjRender_SetColor(obj, 0, 255, 0);
- PlaySE(counterspell);
- StopSound(sound);
- wait2(15);
- loop(30){
- alpha-=255/30;
- ObjRender_SetAlpha(objText, alpha);
- ObjRender_SetAlpha(obj, alpha);
- yield;
- }
- return true;
- Obj_Delete(obj); break; }
- wait2(1);
- }
- StopSound(sound);
- ObjRender_SetColor(obj, 255, 0, 0);
- if(sound == firecast){ PlaySE(fireball); }
- if(spell == "Fireball"){ loop(10){ ascent(i in 0..9){ CreateDNHShotA1(GetEnemyX, GetEnemyY, 0.5+(i/3.15), angletoplayer(objEnemy)+angle+rand((-(9-i))*2, (9-i)*2), SP01, 10); } angle+=360/10; }}
- if(spell == "Pyroblast"){ loop(10){ ascent(i in 0..25){ CreateDNHShotA1(GetEnemyX, GetEnemyY, 0.25+(i/8.3333333), angletoplayer(objEnemy)+rand(-i-10, i+10)+angle, SP01, 10); } angle+=360/10; }}
- wait2(15);
- loop(30){
- alpha-=255/30;
- ObjRender_SetAlpha(objText, alpha);
- ObjRender_SetAlpha(obj, alpha);
- wait2(1);
- }
- return false;
- Obj_Delete(obj);
- function wait2(w){ loop(w){ if (popped==true){ StopSound(sound); Obj_Delete(objText); Obj_Delete(obj); } yield; } }
- }
- task attack1{
- wait(120);
- let numcasts = 0;
- let one = 1;
- let angle2 = 0;
- let color = 0;
- let angle3 = 0;
- loop{
- numcasts++;
- if(castbar(15, "Fireball", firecast, 20, 60) == true){
- //wait(15);
- }
- else{
- //wait(15);
- }
- if(numcasts>=6){
- PlaySE(charge2);
- TCharge01(objEnemy, 3, 45, 255, 0, 0);
- wait(60);
- castbar(120, "Pyroblast", firecast, 18, 80);
- numcasts = 0;
- wait(60);
- }
- if(popped==true){break;}
- }
- }
- task DestroyBoss{
- SetCommonData("petals", false);
- popped=true;
- StopSlow(TARGET_ALL);
- loop(10){ yield; }
- Obj_Delete(objEnemy);
- loop(45){ yield; }
- CloseScript(GetOwnScriptID());
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement