Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Midboss Script:
- #include"script/default_system/Default_ShotConst.txt"
- #include"script/default_system/Default_Effect.txt"
- #include"script/ShatteredSky/SYSTEM/common_enemy.dnh"
- #include"script/ShatteredSky/SYSTEM/common_enemy_boss.dnh"
- @Event{
- alternative(GetEventType())
- case(EV_REQUEST_LIFE)
- {
- SetScriptResult(1600);
- }
- case(EV_REQUEST_TIMER)
- {
- SetScriptResult(30);
- }
- }
- let F1;
- let Mark;
- @Initialize
- {
- F1 = ObjEnemy_Create(OBJ_ENEMY_BOSS);
- ObjEnemy_Regist(F1);
- ObjEnemy_SetDamageRate(F1,100,100);
- ObjEnemy_SetLife(F1,1600);
- Work;
- Render;
- Move;
- Marker;
- End;
- }
- @MainLoop
- {
- let ex = ObjMove_GetX(F1);
- let ey = ObjMove_GetY(F1);
- ObjEnemy_SetIntersectionCircleToShot(F1,ex,ey,10);
- ObjEnemy_SetIntersectionCircleToPlayer(F1,ex,ey,5);
- yield;
- }
- task Move{
- ObjMove_SetPosition(F1,50,-25);
- loop{
- ObjMove_SetDestAtFrame(F1, 250, 120, 60);
- wait(240);
- ObjMove_SetDestAtFrame(F1, 100, 120, 60);
- wait(120);
- ObjMove_SetDestAtFrame(F1, 175, 70, 60);
- wait(120);
- }
- }
- task Work{
- wait(90);
- while(!Obj_IsDeleted(F1))
- {
- let loopNr = 1;
- let frame = 20;
- let px = GetPlayerX();
- let py = GetPlayerY();
- let ex = ObjMove_GetX(F1);
- let ey = ObjMove_GetY(F1);
- let angleToPlayer = atan2(py - ey, px - ex);
- let rnd = rand_int(-10,10);
- loop (12){
- loop(4){
- let ang1 = angleToPlayer-90-rnd;
- let ang2 = angleToPlayer+90+rnd;
- let Shot1 = CreateShotA1(ex,ey,7*loopNr,ang1,DS_ICE_BLUE, 2);
- let Shot2 = CreateShotA1(ex,ey,7*loopNr,ang2,DS_ICE_BLUE, 2);
- ObjMove_AddPatternA2(Shot1, 10,0,ang1+90,0,0,0);
- ObjMove_AddPatternA2(Shot2, 10,0,ang2-90,0,0,0);
- ObjMove_AddPatternA2(Shot1, 50,0,ang1+90,0.3,1,2);
- ObjMove_AddPatternA2(Shot2, 50,0,ang2-90,0.3,-1,2);
- ObjMove_AddPatternA2(Shot1, 80,0,NO_CHANGE,0.3,0,2);
- ObjMove_AddPatternA2(Shot2, 80,0,NO_CHANGE,0.3,0,2);
- loopNr++;
- }
- loopNr = 0;
- wait(5);
- }
- wait(60);
- }
- }
- task Render{
- let imgEnemy = GetCurrentScriptDirectory ~ "/img/cirno2.png";
- ObjPrim_SetTexture(F1, imgEnemy);
- ObjSprite2D_SetSourceRect(F1, 0, 0, 35, 55);
- ObjSprite2D_SetDestCenter(F1);
- }
- task Marker{
- let Marker = "script/ShatteredSky/SYSTEM/img/EnemyMarker.png";
- Mark = ObjPrim_Create(OBJ_SPRITE_2D);
- ObjPrim_SetTexture(Mark, Marker);
- Obj_SetRenderPriority(Mark, 20);
- let ex = ObjMove_GetX(F1);
- ObjSprite2D_SetSourceRect(Mark, 0, 0, 50, 16);
- ObjSprite2D_SetDestCenter(Mark);
- while(!Obj_IsDeleted(F1)){
- ex = ObjMove_GetX(F1);
- ObjRender_SetX(Mark, ex+23);
- ObjRender_SetY(Mark, 470);
- ObjRender_SetZ(Mark,3);
- yield;
- }
- }
- task End
- {
- while(ObjEnemy_GetInfo(F1, INFO_LIFE) > 0)
- {
- yield;
- }
- let ex = ObjMove_GetX(F1);
- let ey = ObjMove_GetY(F1);
- PlaySFX("/Enemy/ExplosionBoss(PH).wav", 20);
- loop(10){
- DieAnimationBoss(ex,ey);
- }
- Obj_Delete(F1);
- Obj_Delete(Mark);
- DeleteShotAll(TYPE_ALL, TYPE_ITEM);
- loop(300){
- DeleteShotAll(TYPE_ALL, TYPE_ITEM);
- yield;
- }
- CloseScript(GetOwnScriptID());
- }
- STAGE SCRIPT:
- // #BGM["script/ShatteredSky/snd/BGM/S1_Road.ogg"]
- #include"script/ShatteredSky/SYSTEM/common_enemy.dnh"
- #include"script/ShatteredSky/SYSTEM/System.dnh"
- #include"script/ShatteredSky/Stg/Normal/EnemySt1/Dialogue1.txt"
- let LoadComplete = false;
- let BGMPath = "script/ShatteredSky/snd/BGM/S1_Road.ogg";
- let objBGM = ObjSound_Create;
- @Initialize
- {
- displayPlayerLife;
- DelShotifDeath;
- LoadSound(BGMPath);
- TaskStage1();
- }
- @MainLoop
- {
- yield;
- }
- @Finalize
- {
- }
- task TaskStage1
- {
- yield;
- let dir = GetCurrentScriptDirectory();
- let En1 = dir ~ "EnemySt1/EnemySt1_1a.txt";
- let En2 = dir ~ "EnemySt1/EnemySt1_1b.txt";
- let En2v = dir ~ "EnemySt1/EnemySt1_1bVortex.txt";
- let En3 = dir ~ "EnemySt1/EnemySt1_1c.txt";
- //cut here to make paste smaller
- let idScript130 = LoadScriptInThread(En7);
- let idScript131 = LoadScriptInThread(En7);
- let idScript132 = LoadScriptInThread(En7);
- wait(5);
- Music;
- wait(40);
- DifficultySplash;
- wait(40);
- ItemBorderLine;
- wait(40);
- StartScript(idScript);
- wait(15);
- //cut here to make paste smaller
- wait(10);
- StartScript(idScript85);
- wait(10);
- StartScript(idScript86);
- wait(90);
- StartScript(idScript88);
- StartScript(idScript87);
- wait(450);
- DeleteShotAll(TYPE_ALL, TYPE_ITEM);
- StartScript(idScriptMid);
- while(!IsCloseScript(idScriptMid) && GetPlayerState() != STATE_END)
- {
- yield;
- }
- wait(120);
- StartScript(idScript89);
- StartScript(idScript90);
- wait(25);
- //cut here to make paste smaller
- StartScript(idScript118);
- wait(25);
- StartScript(idScript119);
- wait(25);
- StartScript(idScript120);
- wait(240);
- SetForbidPlayerShot(true);
- SetForbidPlayerSpell(true);
- StartDialogue;
- }
- task ItemBorderLine{
- //removed to make paste smaller
- }
- task DifficultySplash{
- let DiffSplash = GetCurrentScriptDirectory ~ "EnemySt1/img/NormalSplash.png";
- let Diffy = ObjPrim_Create(OBJ_SPRITE_2D);
- Obj_SetRenderPriority(Diffy,20);
- ObjPrim_SetTexture(Diffy,DiffSplash);
- ObjSprite2D_SetSourceRect(Diffy, 0, 0, 70, 20);
- ObjSprite2D_SetDestRect(Diffy, 190, 25, 260, 45);
- let alp1 = 0;
- loop(25){
- ObjRender_SetAlpha(Diffy,alp1);
- loop(10){alp1++;}
- yield;
- }
- ObjRender_SetAlpha(Diffy,255);
- wait(120);
- loop(25){
- ObjRender_SetAlpha(Diffy,0);
- wait(1);
- ObjRender_SetAlpha(Diffy,255);
- wait(1);
- }
- ObjRender_SetAlpha(Diffy,0);
- ObjSprite2D_SetDestRect(Diffy, 500, 5, 570, 25);
- ObjRender_SetAlpha(Diffy,255);
- }
- task Music{
- PlayMusic(100);
- let MSplash = "script/ShatteredSky/img/BGM/S1_Road.png";
- let MSpla = ObjPrim_Create(OBJ_SPRITE_2D);
- ObjPrim_SetTexture(MSpla,MSplash);
- ObjSprite2D_SetSourceRect(MSpla, 0, 0, 300, 21);
- ObjSprite2D_SetDestCenter(MSpla);
- ObjSprite2D_SetDestRect(MSpla, 100, 426, 400, 447);
- let alp1 = 0;
- loop(20){
- ObjRender_SetAlpha(MSpla,alp1);
- loop(10){alp1++;}
- yield;
- }
- wait(250);
- loop(20){
- ObjRender_SetAlpha(MSpla,alp1);
- loop(10){alp1--;}
- yield;
- }
- ObjRender_SetAlpha(MSpla,0);
- }
- Part of an enemy script (they all work the same):
- task End
- {
- while(ObjEnemy_GetInfo(F1, INFO_LIFE) > 0)
- {
- yield;
- }
- let ex = ObjMove_GetX(F1);
- let ey = ObjMove_GetY(F1);
- PlaySFX("/Enemy/ExplosionNormal(PH).wav", 75);
- loop(5){
- DieAnimation(ex, ey);
- }
- Obj_Delete(F1);
- loop(240) { yield; }
- CloseScript(GetOwnScriptID());
- }
- Task PlaySFX(located in common_enemy.dnh)
- task PlaySFX(name, Volume){
- let SFXPath = "script/ShatteredSky/snd/SFX";
- let objSound = ObjSound_Create;
- ObjSound_SetSoundDivision(objSound,SOUND_SE);
- ObjSound_Load(objSound,SFXPath ~ name);
- ObjSound_SetVolumeRate(objSound,Volume);
- ObjSound_Play(objSound);
- loop(240) { yield; }
- // Obj_Delete(objSound);
- }
- Task PlayMusic (located in my own system.dnh)
- task PlayMusic(Volume){
- ObjSound_SetVolumeRate(objBGM,Volume);
- ObjSound_SetSoundDivision(objBGM,SOUND_BGM);
- ObjSound_SetRestartEnable(objBGM, true);
- ObjSound_SetLoopEnable(objBGM, true);
- ObjSound_SetLoopTime(objBGM, 1,204);
- ObjSound_Play(objBGM);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement