#TouhouDanmakufu[Single] #ScriptVersion[3] #Title["Winter Games"] #Text["This bitch empty - would you like to yeet?"] #System["script/KevinSystem/Kevin_System.txt"] float rank = 1; // Increases through time let RANK_PTR = LoadCommonDataValuePointer("Rank", 1); let objScene = GetEnemyBossSceneObjectID(); let csd = GetCurrentScriptDirectory(); let bossObj; float bossX = 0; float bossY = 0; float playerY = 0; float playerX = 0; bool bossIntro = false; let spellsnd = ObjSound_Create(); let bossdiesnd = ObjSound_Create(); int[] enmFly = []; int[] enmGround = []; int[] rankAvg = []; let POINTER_CHAIN = LoadAreaCommonDataValuePointer("PIV", "ChainAmount", 1); //let SYSTEMID_PTR_2 = LoadAreaCommonDataValuePointer("ScriptID", "SystemID", 0); // Includes ahoy #include "script/KevinSystem/Universal_Lib.txt" #include "script/Jam10/GunnerParade_EnmLib.dnh" #include "script/Jam10/GunnerParade_ConstLib.dnh" #include "script/KevinSystem/kevin_system/Lib_Const.dnh" @Initialize { //SetIntersectionVisualization(true); SetAutoDeleteObject(true); SetCommonData("Rank", clamp(GetCommonData("Rank", 1), RANK_MIN, RANK_MAX)); //difficultySelect = _InitDifficulty(difficultySelect); //difficultySelect = 2; // debug if(!IsCommonDataAreaExists("PIV")){ CreateCommonDataArea("PIV"); SetAreaCommonData("PIV", "currentvalue", 10000); } else{} // Create the boss object itself bossObj = ObjEnemy_Create(OBJ_ENEMY_BOSS); ObjEnemy_Regist(bossObj); ObjMove_SetPosition(bossObj, STG_WIDTH/2, -256); ObjEnemy_SetDamageRate(bossObj, 0, 0); _RenderBossFight(bossObj); SetEnemyAutoDeleteClip(160, 160, 160, 160); //testTask(); //groundTask(); flyingTask(); //UpdateDrops(); bossFight(); curEnmManage(); //SetCommonData("Rank", 9); //_FadeInvincibility(bossObj, 150, 150, 1); //endingnew(); } @Event { alternative(GetEventType()) case(EV_REQUEST_LIFE) { SetScriptResult(HP_MAX); } case(EV_REQUEST_IS_DURABLE_SPELL) { SetScriptResult(false); } case(EV_REQUEST_TIMER) { SetScriptResult(STAGE_LENGTH); //SetScriptResult(BOSS_LENGTH+5); } } @MainLoop { playerY = GetPlayerY(); playerX = GetPlayerX(); //The player position is ALWAYS UPDATED bossX = ObjMove_GetX(bossObj); bossY = ObjMove_GetY(bossObj); ObjEnemy_SetIntersectionCircleToShot(bossObj, ObjMove_GetX(bossObj), ObjMove_GetY(bossObj), 192); yield; } @Finalize { } // This array contains ONLY FLYING ENEMIES task groundTask(){ wait(90); while(ObjEnemyBossScene_GetInfo(objScene, INFO_TIMER) > BOSS_LENGTH){ WaveGround1(); wait(max(5, 15-rank)); if(ObjEnemyBossScene_GetInfo(objScene, INFO_TIMER) <= BOSS_LENGTH){break;} if(GetCommonData("Ground Loops Cleared", 0)/3 == 0 && rank > 3){ WaveGround2(playerX); wait(max(5, 15-rank)); if(ObjEnemyBossScene_GetInfo(objScene, INFO_TIMER) <= BOSS_LENGTH){break;} SetCommonData("Rank", clamp(GetCommonData("Rank", 1)+0.5, 1, RANK_MAX)); } SetCommonData("Ground Loops Cleared", GetCommonData("Ground Loops Cleared", 0)+1); yield; } } task flyingTask(){ wait(30); while(ObjEnemyBossScene_GetInfo(objScene, INFO_TIMER) > BOSS_LENGTH){ Wave1(); wait(max(5, 20-4*rank)); if(ObjEnemyBossScene_GetInfo(objScene, INFO_TIMER) <= BOSS_LENGTH){break;} Wave2(); wait(max(5, 20-4*rank)); if(ObjEnemyBossScene_GetInfo(objScene, INFO_TIMER) <= BOSS_LENGTH){break;} if(rank > 4 || GetCommonData("Flying Loops Cleared", 0) > 3){ WaveGround1(); wait(max(5, 20-4*rank)); if(ObjEnemyBossScene_GetInfo(objScene, INFO_TIMER) <= BOSS_LENGTH){break;} } Wave3(); wait(max(5, 20-4*rank)); if(ObjEnemyBossScene_GetInfo(objScene, INFO_TIMER) <= BOSS_LENGTH){break;} Wave5(); wait(max(5, 20-4*rank)); if(ObjEnemyBossScene_GetInfo(objScene, INFO_TIMER) <= BOSS_LENGTH){break;} SetCommonData("Rank", clamp(GetCommonData("Rank", 1)+0.5, 1, RANK_MAX)); Wave4(); wait(max(5, 20-4*rank)); if(ObjEnemyBossScene_GetInfo(objScene, INFO_TIMER) <= BOSS_LENGTH){break;} Wave1(); wait(max(5, 20-4*rank)); if(ObjEnemyBossScene_GetInfo(objScene, INFO_TIMER) <= BOSS_LENGTH){break;} if(rank > 7 || GetCommonData("Flying Loops Cleared", 0) > 5){ WaveGround2(playerX); wait(max(5, 20-4*rank)); if(ObjEnemyBossScene_GetInfo(objScene, INFO_TIMER) <= BOSS_LENGTH){break;} } SetCommonData("Flying Loops Cleared", GetCommonData("Flying Loops Cleared", 0)+1); SetCommonData("Rank", clamp(GetCommonData("Rank", 1)+0.5, 1, RANK_MAX)); yield; } } task curEnmManage(){ SetCommonData("Flying Loops Cleared", 0); SetCommonData("Ground Loops Cleared", 0); RankManagement(); int[] allEnm = []; while(true){ enmGround = []; enmFly = []; allEnm = GetIntersectionRegistedEnemyID(); for each (int enm in ref allEnm){ if(Obj_GetRenderPriorityI(enm) <= 37){enmGround ~= [enm];} else if(Obj_GetRenderPriorityI(enm) >= 38 && Obj_GetRenderPriorityI(enm) < 41){enmFly ~= [enm];} else{} } wait(10); } } task _BossExplosion(){ float enmX = 0, enmY = 0; while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > 0){ enmX = ObjMove_GetX(bossObj); enmY = ObjMove_GetY(bossObj); yield; } //NotifyEventAll(EV_DROP_POINT_ENEMY, [enmX, enmY], timer, maxTimer, minPoint, maxPoint); DeleteShotAll(TYPE_ALL, TYPE_ITEM); SetPlayerInvincibilityFrame(300); ObjSound_Play(bossBoom); Obj_SetRenderPriorityI(bossObj, 30); NotifyEvent(GetCommonDataPtr(SYSTEMID_PTR, 0), EV_EXPLODE, [enmX, enmY]); _ObjShake(bossObj, 190, 60); loop(30){ //LoadEx(bossBoom, "script/game/resourceLib/bigBoom.ogg", 30 * SFXVol); ObjSound_Play(bossBoom); NotifyEvent(GetCommonDataPtr(SYSTEMID_PTR, 0), EV_EXPLODE, [bossX+rand(-240, 240), bossY+rand(-150, 150)]); wait(6); } ObjMove_SetDestAtFrame(bossObj, bossX, STG_HEIGHT+512, 120, LERP_ACCELERATE); float ang = ObjRender_GetAngleZ(bossObj); ascent(i in 0..120){ ObjRender_SetAngleZ(bossObj, Interpolate_Accelerate(ang, ang+180, i/120)); yield; } //wait(); _EndShake(120, 90); loop(120){ NotifyEvent(GetCommonDataPtr(SYSTEMID_PTR, 0), EV_EXPLODE, [bossX+rand(-240, 240), STG_HEIGHT+rand(0, -150)]); } ObjSound_Play(bossBoom); EndBonus(); //_ScorePopup(float enmX, float enmY, int pointNum, int pivNum); // NotifyEvent is faster than NotifyEventAll, considering how the item event will be called many times. } task EndBonus(){ while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > 0){ //WriteLog(ObjEnemyBossScene_GetInfo(objScene, INFO_TIMER)); //wait(30); yield; } ObjEnemy_SetLife(bossObj, -1); let timer = ObjEnemyBossScene_GetInfo(objScene, INFO_TIMERF); //WriteLog(timer); // Bonus Calculations: // (Time Remaining + Ground Loops Cleared + Flying Loops Cleared + Average Rank) * 10000 function _CreateBonusText(float x, y, fontSize, int colorBorder, string text){ int objText = CreateTextObject( x, y, fontSize, "", "GravityRegular5", 0xFFFFFF, 0xFFFFFF, colorBorder, 4, 71 ); ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER); TTextScroll(objText, text); } wait(120); float rankAvgFinal = 0; float rankSum = 0; ascent(i in -1..length(rankAvg)-1){ rankSum += rankAvg[i]; } rankAvgFinal = rankSum/length(rankAvg); _CreateBonusText(STG_WIDTH/2, STG_HEIGHT/2-220, 30, 0xCF007A, "LIVES REMAINING: " ~ IntToString(GetPlayerLife())); _CreateBonusText(STG_WIDTH/2, STG_HEIGHT/2-180, 30, 0x3500CF, "TIME REMAINING: " ~ vtos("5.2f", timer/60)); _CreateBonusText(STG_WIDTH/2, STG_HEIGHT/2-140, 30, 0xCF6100, "ENEMIES DEFEATED: " ~ IntToString(GetCommonDataPtr(GROUNDENM_PTR, 0) + GetCommonDataPtr(FLYINGENM_PTR, 0))); _CreateBonusText(STG_WIDTH/2, STG_HEIGHT/2-100, 30, 0xCF0000, "AVERAGE RANK LV: " ~ vtos("5.2f", rankAvgFinal)); _CreateBonusText(STG_WIDTH/2, STG_HEIGHT/2, 30, 0xFFA300, "END BONUS:"); wait(120); float multiplierBonus = (GetPlayerLife() + timer/60 + GetCommonDataPtr(GROUNDENM_PTR, 0)/5 + GetCommonDataPtr(FLYINGENM_PTR, 0)/5 + rankAvgFinal) * 30; int scoreBonus = (trunc ( (multiplierBonus * 100000) / 100 ) * 10); _CreateBonusText(STG_WIDTH/2, STG_HEIGHT/2+60, 60, 0xFFA300, DigitToCommaArray(scoreBonus)); AddScore(scoreBonus); wait(60); if(!IsReplay()){SetCommonData("Run Score", GetScore());} else{SetCommonData("Run Score", 0);} Obj_Delete(bossObj); CloseScript(GetOwnScriptID()); } task RankManagement(){ //SetCommonData("Rank", 9); //SetCommonData("Rank", 10); // Rank increase let textRank = CreateTextObject( STG_WIDTH-15, STG_HEIGHT/14, 24, "RANK:", "GravityBold8", 0xFFFFFF, 0xFFFFFF, 0xAE22FF, 5, 71 ); ObjText_SetHorizontalAlignment(textRank, ALIGNMENT_RIGHT); async{ while(true){ rank = trunc(GetCommonData("Rank", 1)); if(rank >= RANK_MAX){ObjText_SetText(textRank, "RANK LV [font sz=32 oc=(193, 0, 99)]MAX");} else{ObjText_SetText(textRank, "RANK LV [font sz=45 oc=(193, 0, 99)]" ~ IntToString(rank));} //SetCommonData("Rank", 9); wait(45); } } async{ while(true){ if(ObjMove_GetY(GetPlayerObjectID()) < GetStgFrameHeight()/6){ ObjRender_SetAlpha(textRank, 60); } else{ ObjRender_SetAlpha(textRank, 255); } yield; } } async{ while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > 0){ rankAvg ~= [rank]; wait(60); } } // Per frame rank increase. +1 rank per 10 seconds (+0.1 rank per second, +1/600 rank per frame), rank 10 at 100 seconds if no specials, bombs or deaths happen async{ while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > 0){ SetCommonDataPtr(RANK_PTR, clamp(GetCommonDataPtr(RANK_PTR, 1)+1/600, RANK_MIN, RANK_MAX_TRUE)); yield; } } // Rank on HUD async{ let textRank = CreateTextObject( 1500, 660, 48, "", "Origami Mommy", 0xFF9294, 0xFFFFFF, 0x8F0507, 8, 19 ); ObjText_SetHorizontalAlignment(textRank, ALIGNMENT_CENTER); let textRankRange = CreateTextObject( 1820, 618, 24, "", "Unispace", 0xA9FFD0, 0xFFFFFF, 0x8F0507, 2, 19 ); while(true){ ObjText_SetText(textRank, IntToString(rank)); ObjText_SetText(textRankRange, "LV." ~ IntToString(RANK_MIN) ~ "[r][font oy=4 tc=(255, 114, 189)]LV." ~ IntToString(RANK_MAX_TRUE) ~ "[r][font oy=8 tc=(255, 147, 138)]" ~ rtos("00.00", GetCommonData("Rank", 1))); yield; } } } task testTask(){ wait(15); while(ObjEnemyBossScene_GetInfo(objScene, INFO_TIMER) > 20){ Wave5(); SetCommonData("Rank", clamp(GetCommonData("Rank", 1)+1, 1, RANK_MAX)); SetCommonData("Ground Loops Cleared", GetCommonData("Ground Loops Cleared", 0)+1); SetCommonData("Flying Loops Cleared", GetCommonData("Flying Loops Cleared", 0)+1); yield; } } ///////////// BOSS HANDLING ///////////// task bossFight(){ while(ObjEnemyBossScene_GetInfo(objScene, INFO_TIMERF) > BOSS_LENGTH*60){ yield; } NotifyEventAll(EV_BOSS_MUSIC, 1); bossIntro = true; BossIntro(); BossPhase1(); // Rings BossPhase2(); //BossPhase3(); // Umbrella waves return; } function BossIntro(){ bool bossCurrentlyIntro = true; ObjMove_SetDestAtFrame(bossObj, STG_WIDTH * 3/4, STG_HEIGHT/2, 60, LERP_DECELERATE); async{ int timer = ObjEnemyBossScene_GetInfo(objScene, INFO_TIMERF); while(bossCurrentlyIntro){ ObjEnemyBossScene_SetSpellTimer(objScene, timer); SetForbidPlayerShot(true); SetForbidPlayerSpell(true); ObjEnemy_SetDamageRate(bossObj, 0, 0); yield; } SetForbidPlayerShot(false); SetForbidPlayerSpell(false); ObjEnemy_SetDamageRate(bossObj, 0, 0); } wait(60); bossCurrentlyIntro = false; } function BossPhase1(){ ObjMove_SetDestAtFrame(bossObj, STG_WIDTH * 3/4, STG_HEIGHT/2, 60, LERP_DECELERATE); wait(10); _FadeInvincibility(bossObj, 90, 90, 0.5); int dense = FUNC_LERP_LINEAR(12, 15, rank/RANK_MAX); int del1 = FUNC_LERP_LINEAR(5, 3, rank/RANK_MAX); int del2 = FUNC_LERP_LINEAR(80, 60, rank/RANK_MAX); int ringNum = FUNC_LERP_LINEAR(6, 9, rank/RANK_MAX); int accelTime = FUNC_LERP_LINEAR(30, 25, rank/RANK_MAX); float spd = FUNC_LERP_ACCEL(10, 13, rank/RANK_MAX); float angStart = rand(0, 360); PhaseBonusCalculation(PHASE1_LIMIT, "[font oc=(98, 0, 164) wg=800]Withering Flower"); async{ while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > PHASE1_LIMIT){ float baseAng = rand(0, 360); ascent(i in 0..ringNum){ float ang = baseAng + 180/ringNum * i; float[] ringPos = [bossX + sin(ang) * 60, bossY + cos(ang) * 60]; Shoot2; ascent(k in 0..dense){ int bullet = CreateShotA2(ringPos[0], ringPos[1], spd, k * 360/dense, -spd/accelTime, 0, KEV_LEAF_AQUA, 10); ObjMove_AddPatternA2(bullet, accelTime*1.25, NO_CHANGE, NO_CHANGE, spd/accelTime, spd, 0); _Delay(bullet, 10); } wait(del1); } wait(del2-30); ObjMove_SetDestAtFrame(bossObj, STG_WIDTH*3/4 + rand(-128, 192), playerY, 30, LERP_DECELERATE); wait(30); } } while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > PHASE1_LIMIT){ yield; } ObjEnemy_SetDamageRate(bossObj, 0, 0); DeleteShotAll(TYPE_ALL, TYPE_ITEM); wait(60); return; } // Phase 2: Travelers Clad in White function BossPhase2(){ int fanDense = FUNC_LERP_LINEAR(3, 6, rank/RANK_MAX); int fanStack = FUNC_LERP_LINEAR(2, 4, rank/RANK_MAX); int fanRange = FUNC_LERP_LINEAR(4, 7, rank/RANK_MAX); int del = FUNC_LERP_LINEAR(45, 60, rank/RANK_MAX); float spd = FUNC_LERP_ACCEL(8, 11, rank/RANK_MAX); float moveSpd = FUNC_LERP_ACCEL(3, 6, rank/RANK_MAX); float ang = 180; ObjMove_SetDestAtFrame(bossObj, STG_WIDTH * 5/6, STG_HEIGHT/2, 60, LERP_DECELERATE); _FadeInvincibility(bossObj, 90, 90, 0.5); PhaseBonusCalculation(PHASE2_LIMIT, "[font oc=(98, 0, 164) wg=800]Travelers Clad in White"); async{ while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > PHASE2_LIMIT){ ObjMove_SetY(bossObj, STG_HEIGHT/2 + STG_HEIGHT/5 * sin(ang)); ang += moveSpd; yield; } ObjEnemy_SetDamageRate(bossObj, 0, 0); DeleteShotAll(TYPE_ALL, TYPE_ITEM); _BossExplosion(); } async{ while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > PHASE2_LIMIT){ WaveGround2(playerX); //wait(30); } } async{ while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > PHASE2_LIMIT){ CreateFan (bossObj, fanDense, KEV_BALL_AQUA, fanStack, 0, fanRange, spd, spd/1.1, 1, 0, 0, PATTERN_FAN_AIMED, false ); wait(del); } } while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > PHASE2_LIMIT){ yield; } ObjEnemy_SetDamageRate(bossObj, 0, 0); DeleteShotAll(TYPE_ALL, TYPE_ITEM); wait(45); return; } /* function BossPhase3(){ ObjMove_SetDestAtFrame(bossObj, STG_WIDTH/2, STG_HEIGHT/5, 60, LERP_DECELERATE); PhaseBonusCalculation(PHASE3_LIMIT, "[font oc=(98, 0, 164) wg=800]Paving a Rainbow Sky"); _FadeInvincibility(bossObj, 90, 90, 0.25); wait(30); float numKilled = 0; // BIRD float bulletNum = FUNC_LERP_LINEAR(8, 12, rank/RANK_MAX); float bulletSpd = FUNC_LERP_ACCEL(6.25, 7.25, rank/RANK_MAX); float birdWvel = FUNC_LERP_ACCEL(1.2, 2, rank/RANK_MAX); int bulletDel = FUNC_LERP_LINEAR(10, 5, rank/RANK_MAX); int bulletWait = FUNC_LERP_LINEAR(45, 35, rank/RANK_MAX); float birdSpd = FUNC_LERP_ACCEL(9, 11.2, rank/RANK_MAX); float birdNum = FUNC_LERP_LINEAR(10, 15, rank/RANK_MAX); int spawnDel = FUNC_LERP_ACCEL(80, 60, rank/RANK_MAX); // Bullet lines int linenum = FUNC_LERP_LINEAR(14, 17, rank/RANK_MAX); int del = FUNC_LERP_ACCEL(4, 2, rank/RANK_MAX); int del2 = FUNC_LERP_ACCEL(8, 5, rank/RANK_MAX); float spd = FUNC_LERP_ACCEL(9, 11, rank/RANK_MAX); float ang = rand(80, 100); async{ while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > PHASE3_LIMIT){yield;} ObjEnemy_SetDamageRate(bossObj, 0, 0); DeleteShotAll(TYPE_ALL, TYPE_ITEM); _BossExplosion(); } task _SummonBirdEx(float startAng, float wvel, int num){ int umbrella = _SmallWitch( 41, bulletDel * bulletNum, bossX, bossY ); bool isFinishMove = false; ObjMove_SetAngle(umbrella, startAng); ObjRender_SetAngleZ(umbrella, startAng); ObjMove_SetAngularVelocity(umbrella, wvel); ObjMove_SetSpeed(umbrella, birdSpd); ObjMove_AddPatternA2(umbrella, 60, NO_CHANGE, NO_CHANGE, NO_CHANGE, NO_CHANGE, wvel/10); async{ while(!Obj_IsDeleted(umbrella)){ ObjRender_SetAngleZ(umbrella, ObjMove_GetAngle(umbrella)); yield; } numKilled++; ObjEnemy_SetDamageRate(bossObj, numKilled * 2.5, numKilled * 2.5); // 33 enemies put dmg rate to 100 } int num2 = 0; ascent(i in 0..num){ float lerpNum1 = i; float lerpNum2 = num; ObjEnemy_SetDamageRate(umbrella, FUNC_LERP_LINEAR(10, 50, lerpNum1/lerpNum2), FUNC_LERP_LINEAR(10, 50, lerpNum1/lerpNum2)); int color = KEV_LEAF_RED + num2; int bullet = CreateShotA1(ObjMove_GetX(umbrella), ObjMove_GetY(umbrella), 0, wvel < 0 ? ObjMove_GetAngle(umbrella) : ObjMove_GetAngle(umbrella), color, 5); if(ObjEnemy_GetInfo(bossObj, INFO_LIFE) <= 0 || Obj_IsDeleted(umbrella)){Obj_Delete(bullet);} else{ _Delay(bullet, 5); _BulletRescale(bullet, 0.75, true, 0.25); BulletAction(bullet, lerpNum1, lerpNum2); Shoot1; } wait(bulletDel); num2++; if (num2 > (KEV_BALL_PINK - KEV_BALL_RED)){num2 = 0;} } task BulletAction(ID, lerpNum1, lerpNum2){ while(!isFinishMove){yield;} if(Obj_IsDeleted(ID)){return;} else{ ObjMove_AddPatternA2(ID, 0, NO_CHANGE, NO_CHANGE, FUNC_LERP_LINEAR(bulletSpd/1.5, bulletSpd, lerpNum1/lerpNum2)/FUNC_LERP_LINEAR(bulletWait, bulletWait/1.5, lerpNum1/lerpNum2), FUNC_LERP_LINEAR(bulletSpd/1.5, bulletSpd, lerpNum1/lerpNum2), 0); } } isFinishMove = true; ObjEnemy_SetDamageRate(umbrella, 100, 100); } while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > PHASE3_LIMIT){ float randAng = rand(0, 360); ascent(i in 0..birdNum){ _SummonBirdEx(i * 360/birdNum + randAng, birdWvel, bulletNum); } wait(spawnDel); randAng = rand(0, 360); ascent(i in 0..birdNum){ _SummonBirdEx(i * 360/birdNum + randAng, -birdWvel, bulletNum); } wait(spawnDel); } return; } */ task PhaseBonusCalculation(int HPthreshold, string spellName){ int curRank = rank; int scoreBase = 1000000 * curRank; int scoreBonus = GetAreaCommonData("PIV", "currentvalue", 1000)*100; int i = 0; // 20 seconds function _CreateBonusText(float x, y, fontSize, int colorBorder, string text){ let objText = CreateTextObject( x, y, fontSize, text, "GravityBold8", 0xFFFFFF, 0xFFFFFF, colorBorder, fontSize/10, 71 ); ObjText_SetHorizontalAlignment(objText, ALIGNMENT_RIGHT); return objText; } let scoreText = _CreateBonusText(STG_WIDTH-12, STG_HEIGHT/9+36, 24, 0x000000, ""); while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > HPthreshold){ scoreBase = trunc(Interpolate_Smooth(1000000 * curRank, 100000 * curRank, i/1200)/10)*10; i = min(1200, i+1); scoreBonus = scoreBase * GetCommonDataPtr(POINTER_CHAIN, 1); ObjText_SetText(scoreText, spellName ~ "[r][font sz=16]BONUS: [font oc=(255, 136, 0)]" ~ IntToString(scoreBonus)); yield; } AddScore(scoreBonus); async{ ObjText_SetText(scoreText, "[font sz=32 oc=(164, 0, 90)]SCORE BONUS:[r][font sz=32 wg=800 oc=(255, 136, 0)]" ~ DigitToCommaArray(trunc(scoreBonus/10)*10)); ChargeBreakSFX; wait(60); Obj_Delete(scoreText); } } ///////////// ENEMY HANDLING (NOT BOSS) ///////////// /* function WaveGround1(){ float speedMove = baseMoveSpeed1L * (1 + MoveSpeedRankMultiplierH * rank); int invin = FUNC_LERP_DECEL(WG1_invinTimeMax, WG1_invinTimeMin, rank/RANK_MAX); _SignPlatform1( 34, invin, STG_WIDTH/4, -128, speedMove ); wait(invin); while(length(enmGround) > 1){yield;} _SignPlatform1( 34, invin, 3*STG_WIDTH/4, -128, speedMove ); wait(invin); while(length(enmGround) > 1){yield;} return; } function WaveGround1A(){ float speedMove = baseMoveSpeed1L * (1 + MoveSpeedRankMultiplierL * rank); int invin = FUNC_LERP_DECEL(WG1A_invinTimeMax, WG1A_invinTimeMin, rank/RANK_MAX); int num = FUNC_LERP_DECEL(WG1A_bulletNumMin, WG1A_bulletNumMax, rank/RANK_MAX); float spd = FUNC_LERP_DECEL(WG1A_bulletSpdMin, WG1A_bulletSpdMax, rank/RANK_MAX); float del = FUNC_LERP_DECEL(WG1A_bulletDelayMin, WG1A_bulletDelayMax, rank/RANK_MAX); int[] signs1 = _SignPlatform1A( 34, invin, 2*STG_WIDTH/7-64, -128, speedMove ); for each (int sign in ref signs1){ Atk(sign); } int[] signs2 = _SignPlatform1A( 34, invin, 5*STG_WIDTH/7+64, -128, speedMove ); for each (int sign in ref signs2){ Atk(sign); } task Atk(int ID){ async{ while(!Obj_IsDeleted(ID) && ObjMove_GetY(ID) <= STG_HEIGHT - 128 && GetObjectDistance(ID, GetPlayerObjectID()) > popcornHitbox * 2){ CreateFan( ID, num, KEV_BALL_PINK, 1, GetAngleToPlayer(ID), 2.25, spd, spd/1.5, 0.75, ObjMove_GetX(ID), ObjMove_GetY(ID), PATTERN_FAN, false ); wait(del); } } } wait(invin); while(length(enmGround) > 1){yield;} return; } function WaveGround2(){ float speedMove = baseMoveSpeedVL * (1 + MoveSpeedRankMultiplierL * rank); int invin = FUNC_LERP_DECEL(WG2_invinTimeMax, WG2_invinTimeMin, rank/RANK_MAX); int del = FUNC_LERP_DECEL(WG2_bulletDelayMax, WG2_bulletDelayMin, rank/RANK_MAX); int num = FUNC_LERP_DECEL(WG2_bulletNumMin, WG2_bulletNumMax, rank/RANK_MAX); float spd = FUNC_LERP_DECEL(WG2_bulletSpdMin, WG2_bulletSpdMax, rank/RANK_MAX); float space = FUNC_LERP_DECEL(WG2_angRangeMin, WG2_angRangeMax, rank/RANK_MAX); float aimAng = 0; task Atk(int ID){ async{ while(!Obj_IsDeleted(ID) && ObjMove_GetY(ID) <= STG_HEIGHT * 6/7 && GetObjectDistance(ID, GetPlayerObjectID()) > popcornHitbox * 3){ float posX = 128 * cos(GetAngleToPlayer(ID)); float posY = 128 * sin(GetAngleToPlayer(ID)); CreateFan( ID, num, KEV_FIRE_RED, 1, GetAngleToPlayer(ID), space, spd, spd/1.5, 1, posX, posY, PATTERN_FAN, false ); wait(del); } } while(!Obj_IsDeleted(ID)){ ObjRender_SetAngleZ(ID, atan2(playerY - ObjMove_GetY(ID), playerX - ObjMove_GetX(ID))); aimAng = atan2(playerY - ObjMove_GetY(ID), playerX - ObjMove_GetX(ID)); yield; } } int[] enmArr = _CreateCannonBush( 35, invin, 2*STG_WIDTH/7, -128, speedMove ); for each(int enm in ref enmArr){ Atk(enm); } wait(invin); while(length(enmGround) > 0){yield;} int[] enmArr2 = _CreateCannonBush( 34, invin, 5*STG_WIDTH/7, -128, speedMove ); for each(int enm in ref enmArr2){ Atk(enm); } wait(invin); while(length(enmGround) > 0){yield;} return; } // Rybb function WaveGround3(){ float speedMove = baseMoveSpeedVL * (1 + MoveSpeedRankMultiplierVL * rank); int dense = FUNC_LERP_DECEL(WG3_spiralDenseMin, WG3_spiralDenseMax, rank/RANK_MAX); int num = FUNC_LERP_DECEL(WG3_spiralNumMin, WG3_spiralNumMax, rank/RANK_MAX); int del = FUNC_LERP_DECEL(WG3_spiralDelayMax, WG3_spiralDelayMin, rank/RANK_MAX); float spd = FUNC_LERP_DECEL(WG3_spiralSpdMin, WG3_spiralSpdMax, rank/RANK_MAX); int ship = _CreateRybb( 36, del*3, playerX, -180, speedMove ); async{ while(!Obj_IsDeleted(ship)){ if (ObjMove_GetY(ship) <= 0) {ObjEnemy_SetDamageRate(ship, 0, 0);} else if (ObjMove_GetY(ship) <= FUNC_LERP_LINEAR(180, 60, rank/RANK_MAX)) {ObjEnemy_SetDamageRate(ship, 25, 0);} else {ObjEnemy_SetDamageRate(ship, 100, 100);} yield; } } int i = 0; float startAng = 0; while(!Obj_IsDeleted(ship)){ int dir = i % 2 == 0 ? 1 : -1; float startAng = i % 2 == 0 ? rand(-5, 0) : rand(0, 5); ascent(i in 0..num){ ascent(k in 0..dense){ int bullet = CreateShotA1(ObjMove_GetX(ship), ObjMove_GetY(ship), FUNC_LERP_LINEAR(spd, spd, i/num), startAng + k * 360/dense + dir * i * 4, KEV_BALL_ORANGE, 5+i); _BulletRescale(bullet, 0.6, true, 0.25); _Delay(bullet, 5+i*2); } } Shoot1; wait(del); i++; } } function WaveGround4(){ int del = FUNC_LERP_DECEL(WG4_bulletDelayMax, WG4_bulletDelayMin, rank/RANK_MAX); int num = FUNC_LERP_DECEL(WG4_enmNumMin, WG4_enmNumMax, rank/RANK_MAX); float enmspd = rand(baseMoveSpeedH * (1 + MoveSpeedRankMultiplierL*rank), baseMoveSpeedVH * (1 + MoveSpeedRankMultiplierL*rank)); float spd = FUNC_LERP_DECEL(WG4_bulletSpdMin, WG4_bulletSpdMax, rank/RANK_MAX); int time = FUNC_LERP_DECEL(WG4_invinTimeMax, WG4_invinTimeMin, rank/RANK_MAX); float bushspd = baseMoveSpeedVL * (1 + MoveSpeedRankMultiplierVL*rank); float x = 0, y = 0; int bussy = _CreateDangerBush( 34, time, STG_WIDTH/2, -128, bushspd ); async{ wait(time/2); while(!Obj_IsDeleted(bussy)){ x = ObjMove_GetX(bussy); y = ObjMove_GetY(bussy); yield; } if( (y > STG_HEIGHT+64) ) { return; } // Release bussy busses loop(num){ int enm = _SmallFairy( 38, time/2, x, y ); int debris = _CreateBushRemnant( 35, time/2, x, y ); enmPattern(enm); enmPattern2(debris); } task enmPattern(int ID){ float valueX = clamp([rand(-enmspd*1, -enmspd*0.25), rand(enmspd*0.25, enmspd*1)][rand_int(0, 1)], -12, 12); float valueY = -enmspd * rand(1, 1.5); ObjMove_AddPatternB2(ID, 0, valueX, valueY, -valueX/45, -valueY/45, valueX/20, -valueY/1.25); while(!Obj_IsDeleted(ID) && ObjMove_GetY(ID) > 0 && ObjMove_GetY(ID) < STG_HEIGHT * 7/8){ if (ObjMove_GetSpeedY(ID) <= -valueY/24) {ObjEnemy_SetDamageRate(ID, 0, 0);} else {ObjEnemy_SetDamageRate(ID, 100, 100);} ObjMove_SetY(ID, clamp(ObjMove_GetY(ID), 0, STG_HEIGHT+99999999)); int bullet = CreateShotA1(ObjMove_GetX(ID), ObjMove_GetY(ID), spd, GetAngleToPlayer(ID), KEV_BALL_LAVENDER, 5); _BulletRescale(bullet, 0.75, true, 0.25); _Delay(bullet, 5); Shoot1; wait(del); } } task enmPattern2(int ID){ float valueX = clamp([rand(-enmspd*1.25, -enmspd*0.75), rand(enmspd*1.25, enmspd*0.75)][rand_int(0, 1)], -12, 12); float valueY = -enmspd * rand(1, 1.5); ObjMove_AddPatternB2(ID, 0, valueX, valueY, -valueX/35, -valueY/35, valueX/12.5, -valueY); //ObjRender_SetAlpha(ID, 160); while(!Obj_IsDeleted(ID)){ if (ObjMove_GetSpeedY(ID) <= -valueY/24) {ObjEnemy_SetDamageRate(ID, 0, 0);} else {ObjEnemy_SetDamageRate(ID, 100, 100);} ObjMove_SetY(ID, clamp(ObjMove_GetY(ID), 0, STG_HEIGHT+99999999)); ObjRender_SetAngleZ(ID, ObjRender_GetAngleZ(ID)+3); yield; } } } wait(time/2); while(length(enmGround) > 0){yield;} return; } function WaveGround5(){ float speedMove = baseMoveSpeedVL * (1 + MoveSpeedRankMultiplierVL * rank) * 0.5; int num = FUNC_LERP_DECEL(WG5_bulletNumMin, WG5_bulletNumMax, rank/RANK_MAX); int del = FUNC_LERP_DECEL(WG5_bulletDelayMax, WG5_bulletDelayMin, rank/RANK_MAX); float spd = FUNC_LERP_DECEL(WG5_bulletSpdMin, WG5_bulletSpdMax, rank/RANK_MAX); float[] moveX = [[180, -1.5], [0, 1.5]][GetCommonData("Flying Loops Cleared", 0) % 2]; int ship = _CreateDecker( 37, del*3, playerX, -180, speedMove ); async{ if(GetCommonData("Rush", false) == true){WaveGround3();} else{} } async{ while(!Obj_IsDeleted(ship)){ ObjMove_SetSpeedY(ship, speedMove); ObjMove_SetX(ship, STG_WIDTH/2 + STG_WIDTH/2 * cos(moveX[0])); if (ObjMove_GetY(ship) <= 0) {ObjEnemy_SetDamageRate(ship, 0, 0);} else if (ObjMove_GetY(ship) <= FUNC_LERP_LINEAR(180, 60, rank/RANK_MAX)) {ObjEnemy_SetDamageRate(ship, 25, 0);} else {ObjEnemy_SetDamageRate(ship, 100, 100);} moveX[0] += moveX[1]; yield; } } int i = 0; float startAng = 0; while(!Obj_IsDeleted(ship)){ int x = i % 2 == 0 ? 64 : -64; ascent(i in 0..num){ int bullet = CreateShotA1(ObjMove_GetX(ship)+x, ObjMove_GetY(ship)+160, FUNC_LERP_LINEAR(spd, spd*1.5, i/num), 90, KEV_LEAF_ORANGE, 5); _BulletRescale(bullet, 0.75, true, 0.25); _Delay(bullet, 10); ObjShot_SetDelayMotionEnable(bullet, true); } Shoot1; wait(del); i++; } } function WaveGround6(){ SetCommonData("Rush", true); WaveGround5(); SetCommonData("Rush", false); } */ function Wave1(){ int num = FUNC_LERP_ACCEL(W1_fairyNumMin, W1_fairyNumMax, rank/RANK_MAX); int decel = FUNC_LERP_ACCEL(W1_decelTimeMax, W1_decelTimeMin, rank/RANK_MAX); int del = FUNC_LERP_ACCEL(W1_bulletDelayMax, W1_bulletDelayMin, rank/RANK_MAX); int spawndel = FUNC_LERP_ACCEL(W1_spawnDelayMax, W1_spawnDelayMin, rank/RANK_MAX); float spd = FUNC_LERP_ACCEL(W1_bulletSpdMin, W1_bulletSpdMax, rank/RANK_MAX); float movespd = baseMoveSpeedH * (1 + MoveSpeedRankMultiplierL*rank); task CreateEnemyA(float startY){ int enm = _SmallFairy( 40, decel+del*2, GetStgFrameWidth()+128, startY ); ObjMove_AddPatternA2(enm, 0, movespd*2, 180, -movespd*2/decel, 0, 0); ObjMove_AddPatternA2(enm, decel, NO_CHANGE, NO_CHANGE, movespd/decel, movespd, 0); wait(decel); while(!Obj_IsDeleted(enm) && ObjMove_GetX(enm) > STG_WIDTH * 1/8){ int bullet = CreateShotA1(ObjMove_GetX(enm), ObjMove_GetY(enm), spd, GetAngleToPlayer(enm), KEV_BALL_PURPLE, 5); _Delay(bullet, 5); Shoot1; wait(del); } } ascent(i in 1..6){ CreateEnemyA(i * STG_HEIGHT/6); if(i != 6){wait(spawndel);} else{} } while(length(enmFly) > 1){yield;} ascent(i in 1..6){ CreateEnemyA((6-i) * STG_HEIGHT/6); if(i != 6){wait(spawndel);} else{} } while(length(enmFly) > 1){yield;} return; } function Wave2(){ int num = FUNC_LERP_ACCEL(W2_fairyNumMin, W2_fairyNumMax, rank/RANK_MAX); int bulletnum = FUNC_LERP_ACCEL(W2_bulletfanNumMin, W2_bulletfanNumMax, rank/RANK_MAX); int del = FUNC_LERP_ACCEL(W2_bulletDelayMax, W2_bulletDelayMin, rank/RANK_MAX); int spawndel = FUNC_LERP_ACCEL(W2_spawnDelayMax, W2_spawnDelayMin, rank/RANK_MAX); float spd = FUNC_LERP_ACCEL(W2_bulletSpdMin, W2_bulletSpdMax, rank/RANK_MAX); float movespd = baseMoveSpeedM * (1 + MoveSpeedRankMultiplierL*rank); float range = FUNC_LERP_ACCEL(W2_rangeMin, W2_rangeMax, rank/RANK_MAX); float[] spdrange = [-4, 4]; task CreateEnemyA(float startX, float startY, float angMove){ float ang = 180; int enm = _Spirit( 40, del, startX, startY ); async{ while(!Obj_IsDeleted(enm)){ //ObjMove_SetSpeed(enm, ) ObjMove_AddPatternB1(enm, 0, -movespd, sin(ang) * spdrange[1]); ang += 3.5; yield; } } async{ wait(spawndel); while(!Obj_IsDeleted(enm) & ObjMove_GetX(enm) > STG_WIDTH * 1/8){ int bullet = CreateFan ( enm, bulletnum, KEV_FIRESMALL_AQUA, 1, 0, range, spd, spd/1.5, 1, 0, 0, PATTERN_FAN_AIMED, false ); //_Delay(bullet, 5); Shoot1; wait(del); } } } ascent(i in 0..num){ float y = playerY; y = clamp(y, STG_HEIGHT * 1/5, STG_HEIGHT * 4/5); CreateEnemyA(STG_WIDTH+128, y, 0); if(i != num){wait(spawndel);} else{} } while(length(enmFly) > 1){yield;} ascent(i in 0..num){ float y = playerY; y = clamp(y, STG_HEIGHT * 1/5, STG_HEIGHT * 4/5); CreateEnemyA(STG_WIDTH+128, y, 0); if(i != num){wait(spawndel);} else{} } while(length(enmFly) > 1){yield;} return; } function Wave3(){ int num = FUNC_LERP_ACCEL(W3_fairyNumMin, W3_fairyNumMax, rank/RANK_MAX); int del = FUNC_LERP_ACCEL(W3_bulletDelayMax, W3_bulletDelayMin, rank/RANK_MAX); int bulletnum = FUNC_LERP_ACCEL(W3_bulletfanNumMin, W3_bulletfanNumMax, rank/RANK_MAX); int spawndel = FUNC_LERP_ACCEL(W3_spawnDelayMax, W3_spawnDelayMin, rank/RANK_MAX); float spd = FUNC_LERP_ACCEL(W3_bulletSpdMin, W3_bulletSpdMax, rank/RANK_MAX); float movespd = baseMoveSpeedH * (1 + MoveSpeedRankMultiplierL*rank); float range = FUNC_LERP_ACCEL(W3_rangeMin, W3_rangeMax, rank/RANK_MAX); float[] rangemove = [2.5, 4]; int counter = 1; task CreateEnemyA(float startX, float startY, float spd){ float ang = rand(0, 180); float spdMax = rand(rangemove[0], rangemove[1]); int enm = _MushroomFairy( 40, del*3, startX, startY ); async{ while(!Obj_IsDeleted(enm)){ //ObjMove_SetSpeed(enm, ) ObjMove_AddPatternB1(enm, 0, sin(ang) * spdMax, spd); ang += 3; yield; } } async{ while(!Obj_IsDeleted(enm)){ if(ObjMove_GetY(enm) > STG_HEIGHT+128 || ObjMove_GetY(enm) < -128){ Obj_Delete(enm); break; } if(ObjMove_GetY(enm) < STG_HEIGHT && ObjMove_GetY(enm) > 0){ if (spd < 0){ int bullet = CreateShotA1(ObjMove_GetX(enm), ObjMove_GetY(enm), spd, GetAngleToPlayer(enm)+180, KEV_FIRELARGE_PURPLE, 10); ObjRender_SetAngleZ(bullet, 180); _Delay(bullet, 10); } else{ int bullet = CreateShotA1(ObjMove_GetX(enm), ObjMove_GetY(enm), spd, GetAngleToPlayer(enm), KEV_FIRELARGE_PURPLE, 10); _Delay(bullet, 10); } //_Delay(bullet, 5); Shoot1; } wait(del); } } } ascent(i in 0..num){ CreateEnemyA(rand(STG_WIDTH*6/8, STG_WIDTH*7/8), counter >= 1 ? -128 : STG_HEIGHT+128, movespd*counter); counter *= -1; if(i != num){wait(spawndel);} else{} } while(length(enmFly) > 1){yield;} return; } function Wave4(){ int num = FUNC_LERP_ACCEL(W4_fairyNumMin, W4_fairyNumMax, rank/RANK_MAX); int del = FUNC_LERP_ACCEL(W4_bulletDelayMax, W4_bulletDelayMin, rank/RANK_MAX); int bulletnum = FUNC_LERP_ACCEL(W4_bulletNumMin, W4_bulletNumMax, rank/RANK_MAX); int spawndel = FUNC_LERP_ACCEL(W4_spawnDelayMax, W4_spawnDelayMin, rank/RANK_MAX); float spd = FUNC_LERP_ACCEL(W4_bulletSpdMin, W4_bulletSpdMax, rank/RANK_MAX); float movespd = baseMoveSpeedH * (1 + MoveSpeedRankMultiplierL*rank); int stoptime = FUNC_LERP_LINEAR(W4_stopTimeMax, W4_stopTimeMin, rank/RANK_MAX); int counter = 1; task CreateEnemyA(float startX, float startY, float angle){ int enm = _MushroomFairyAlt( 40, del*3, startX, startY ); ObjMove_AddPatternA1(enm, 0, movespd, rand(angle-5, angle+5)); ObjMove_SetAngularVelocity(enm, rand(-0.1, 0.1)); async{ while(!Obj_IsDeleted(enm)){ if(ObjMove_GetY(enm) > STG_HEIGHT+128 || ObjMove_GetY(enm) < -128){ Obj_Delete(enm); break; } yield; } } async{ while(!Obj_IsDeleted(enm)){ if(ObjMove_GetY(enm) < STG_HEIGHT && ObjMove_GetY(enm) > 0){ ascent(i in 0..bulletnum){ int bullet = CreateShotA1(ObjMove_GetX(enm), ObjMove_GetY(enm), 0, 180, KEV_FIRESMALL_AQUA, 10); //ObjRender_SetAngleZ(bullet, 180); _Delay(bullet, 10); ObjMove_AddPatternA2(bullet, stoptime, NO_CHANGE, NO_CHANGE, spd/stoptime, spd, 0); Shoot1; wait(del); } } wait(del*3); } } } ascent(i in 0..num){ CreateEnemyA(rand(STG_WIDTH*6.5/8, STG_WIDTH*7/8), counter >= 1 ? -128 : STG_HEIGHT+128, counter >= 1 ? 90 : 270); counter *= -1; if(i != num){wait(spawndel);} else{} } while(length(enmFly) > 1){yield;} return; } function Wave5(){ int num = FUNC_LERP_LINEAR(W5_fairyNumMin, W5_fairyNumMax, rank/RANK_MAX); int spawndel = FUNC_LERP_ACCEL(W4_spawnDelayMax, W4_spawnDelayMin, rank/RANK_MAX); float spd = FUNC_LERP_ACCEL(W4_bulletSpdMin, W4_bulletSpdMax, rank/RANK_MAX); float movetime = FUNC_LERP_LINEAR(W5_moveTimeMin, W5_moveTimeMax, rank/RANK_MAX); float movespeed = FUNC_LERP_LINEAR(16, 18, rank/RANK_MAX); task CreateEnemyA(float startX, float startY, float movespeed){ int enm = _SmallFairy( 40, 30, startX, startY ); ObjEnemy_SetDamageRate(enm, 0, 0); ObjMove_AddPatternB2(enm, 0, 0, movespeed, 0, -movespeed/movetime, 0, -movespeed); async{ while(!Obj_IsDeleted(enm)){ if(ObjMove_GetY(enm) > STG_HEIGHT+128 || ObjMove_GetY(enm) < -128){ Obj_Delete(enm); break; } yield; } } async{ wait(movetime); ObjEnemy_SetDamageRate(enm, 100, 100); if(!Obj_IsDeleted(enm)){ int bullet = CreateShotA1(ObjMove_GetX(enm), ObjMove_GetY(enm), spd, GetAngleToPlayer(enm), KEV_BALL_PURPLE, 5); Shoot1; _Delay(bullet, 5); } } } float x = rand(STG_WIDTH*4/7, STG_WIDTH*5.25/7); ascent(k in 0..num){ CreateEnemyA(x + k * 84, -96, movespeed); } wait(spawndel); x = rand(STG_WIDTH*4/7, STG_WIDTH*5/7); ascent(k in 0..num){ CreateEnemyA(x + k * 84, STG_HEIGHT+96, -movespeed); } while(length(enmFly) > 1){yield;} return; } function WaveGround1(){ int dense = FUNC_LERP_LINEAR(WG1_ringDenseMin, WG1_ringDenseMax, rank/RANK_MAX); float spd = FUNC_LERP_LINEAR(WG1_bulletSpdMin, WG1_bulletSpdMax, rank/RANK_MAX); int del = FUNC_LERP_ACCEL(WG1_bulletDelayMax, WG1_bulletDelayMin, rank/RANK_MAX); float movespd = baseMoveSpeedM * (1 + MoveSpeedRankMultiplierL*rank); task CreateEnemyA(float startX, float startY, float angle){ int enm = _MushroomFairyAlt( 36, del*3, startX, startY ); ObjMove_AddPatternA1(enm, 0, movespd, 180); async{ while(!Obj_IsDeleted(enm)){ if(ObjMove_GetY(enm) > STG_HEIGHT+128 || ObjMove_GetY(enm) < -128 || ObjMove_GetX(enm) < -128 || ObjMove_GetX(enm) > STG_WIDTH+128){ Obj_Delete(enm); break; } yield; } } async{ while(!Obj_IsDeleted(enm)){ float ang = rand(0, 360); if(ObjMove_GetY(enm) < STG_HEIGHT && ObjMove_GetY(enm) > 0){ ascent(i in 0..dense){ int bullet = CreateShotA1(ObjMove_GetX(enm), ObjMove_GetY(enm), spd, ang + i * 360/dense, KEV_FIRESMALL_AQUA, 10); //ObjRender_SetAngleZ(bullet, 180); _Delay(bullet, 10); Shoot2; } } wait(del); } } } if(rank <= 5){ CreateEnemyA(STG_WIDTH+128, STG_HEIGHT * 1/5, 180); CreateEnemyA(STG_WIDTH+128, STG_HEIGHT * 4/5, 180); } else{ CreateEnemyA(STG_WIDTH+128, STG_HEIGHT * 1/5, 180); CreateEnemyA(STG_WIDTH+128, STG_HEIGHT * 1/2, 180); CreateEnemyA(STG_WIDTH+128, STG_HEIGHT * 4/5, 180); } while(length(enmGround) > 1){yield;} } function WaveGround2(float pos){ float speedMove = baseMoveSpeed1L * (1 + MoveSpeedRankMultiplierL * rank); int dense = FUNC_LERP_DECEL(WG2_spiralDenseMin, WG2_spiralDenseMax, rank/RANK_MAX); int num = FUNC_LERP_DECEL(WG2_spiralNumMin, WG2_spiralNumMax, rank/RANK_MAX); int del = FUNC_LERP_DECEL(WG2_spiralDelayMax, WG2_spiralDelayMin, rank/RANK_MAX); float spd = FUNC_LERP_DECEL(WG2_spiralSpdMin, WG2_spiralSpdMax, rank/RANK_MAX); float k = pos; k = clamp(k, STG_HEIGHT * 1/5, STG_HEIGHT * 4/5); int ship = _YukiOnna( 36, del*3, STG_WIDTH+128, k ); ObjMove_AddPatternA1(ship, 0, speedMove, 180); async{ while(!Obj_IsDeleted(ship)){ if (ObjMove_GetX(ship) <= 0) {ObjEnemy_SetDamageRate(ship, 0, 0);} else if (ObjMove_GetX(ship) <= FUNC_LERP_LINEAR(STG_WIDTH-240, STG_WIDTH-120, rank/RANK_MAX)) {ObjEnemy_SetDamageRate(ship, 40, 40);} else {ObjEnemy_SetDamageRate(ship, 100, 100);} yield; } } int i = 0; float startAng = 0; while(!Obj_IsDeleted(ship)){ int dir = i % 2 == 0 ? 1 : -1; float startAng = i % 2 == 0 ? rand(-5, 0) : rand(0, 5); ascent(i in 0..num){ ascent(k in 0..dense){ int bullet = CreateShotA1(ObjMove_GetX(ship), ObjMove_GetY(ship), FUNC_LERP_LINEAR(spd, spd, i/num), startAng + k * 360/dense + dir * i * 4, KEV_BALL_LAVENDER, 5+i); _Delay(bullet, 5+i*2); } } Shoot2; wait(del); i++; } } /* function Wave3(){ int linenum = FUNC_LERP_LINEAR(W3_bulletLineNumMin, W3_bulletLineNumMax, rank/RANK_MAX); int dense = FUNC_LERP_LINEAR(W3_bulletDenseMin, W3_bulletDenseMax, rank/RANK_MAX); int del = FUNC_LERP_ACCEL(W3_bulletDelayMax, W3_bulletDelayMin, rank/RANK_MAX); int zakodel = FUNC_LERP_ACCEL(W3_zakospawnDelayMax, W3_zakospawnDelayMin, rank/RANK_MAX); float spd = FUNC_LERP_ACCEL(W3_bulletSpdMin, W3_bulletSpdMax, rank/RANK_MAX); float movespd = baseMoveSpeed1L * (1 + MoveSpeedRankMultiplierL*rank); float zakomovespd = baseMoveSpeedVH * (1 + MoveSpeedRankMultiplierL*rank); float angmovespd =FUNC_LERP_ACCEL(W3_angleMoveSpdMin, W3_angleMoveSpdMax, rank/RANK_MAX); float startX = [0, STG_WIDTH][GetCommonData("Flying Loops Cleared", 0) % 2]; float[] moveX = [[180, -angmovespd], [0, angmovespd]][GetCommonData("Flying Loops Cleared", 0) % 2]; float angStart = rand(0, 360); int i = 0; int enmLarge = _LargeDancer( 40, 90, startX, -144 ); async{ while(!Obj_IsDeleted(enmLarge)){ ObjMove_SetSpeedY(enmLarge, movespd); ObjMove_SetX(enmLarge, STG_WIDTH/2 + STG_WIDTH/2 * cos(moveX[0])); if (ObjMove_GetY(enmLarge) <= FUNC_LERP_LINEAR(144, 48, rank/RANK_MAX)) {ObjEnemy_SetDamageRate(enmLarge, 0, 0);} else {ObjEnemy_SetDamageRate(enmLarge, 100, 100);} moveX[0] += moveX[1]; yield; } } while(!Obj_IsDeleted(enmLarge)){ int shot = CreateFan(enmLarge, 1, KEV_LEAF_LAVENDER, linenum, angStart+i*1*360/dense, 0, spd/1.25, spd, 0.75, 0, 0, PATTERN_FAN, false ); int shot2 = CreateFan(enmLarge, 1, KEV_LEAF_LAVENDER, linenum, angStart+(180+angStart)+i*(-1)*360/dense, 0, spd/1.25, spd, 0.75, 0, 0, PATTERN_FAN, false ); Shoot2; i++; wait(del); } // FUCK YOU HERE'S SOME ZAKO task CreateEnemyA(float startX){ int enm = _SmallFairy( 39, zakomovespd*2, startX, -64 ); ObjMove_AddPatternA1(enm, 0, zakomovespd*1.5, atan2(playerY - (-64), playerX - startX)); async{ while(!Obj_IsDeleted(enm)){ if (ObjMove_GetY(enm) <= 64) {ObjEnemy_SetDamageRate(enm, 0, 0);} else {ObjEnemy_SetDamageRate(enm, 400, 400);} yield; } } while(!Obj_IsDeleted(enm) && ObjMove_GetY(enm) < STG_HEIGHT * 6/7){ int bullet = CreateShotA1(ObjMove_GetX(enm), ObjMove_GetY(enm), spd*1.2, GetAngleToPlayer(enm), KEV_BALL_LAVENDER, 5); _BulletRescale(bullet, 0.75, true, 0.25); _Delay(bullet, 5); Shoot1; wait(del*10); } } ascent(i in 1..7){ CreateEnemyA(i * STG_WIDTH/7); if(i != 7){wait(zakodel);} else{} } ascent(i in 1..7){ CreateEnemyA((7-i) * STG_WIDTH/7); if(i != 7){wait(zakodel);} else{} } while(length(enmFly) > 1){yield;} return; } function Wave4(){ int del = FUNC_LERP_ACCEL(W4_bulletDelayMax, W4_bulletDelayMin, rank/RANK_MAX); float spd = FUNC_LERP_ACCEL(W4_bulletSpdMin, W4_bulletSpdMax, rank/RANK_MAX); int spawndel = FUNC_LERP_ACCEL(W4_spawnDelayMax, W4_spawnDelayMin, rank/RANK_MAX); int invin = FUNC_LERP_ACCEL(W4_invinTimeMax, W4_invinTimeMin, rank/RANK_MAX); float movespd = baseMoveSpeedH * (1 + MoveSpeedRankMultiplierVL*rank); task CreateEnemyA(float startX){ int enm = _Oni( 41, invin, startX, -128 ); ObjMove_AddPatternA1(enm, 0, movespd, 90); while(!Obj_IsDeleted(enm) && ObjMove_GetY(enm) < STG_HEIGHT * 4/5){ if (ObjMove_GetY(enm) <= 128) {ObjEnemy_SetDamageRate(enm, 0, 0);} else {ObjEnemy_SetDamageRate(enm, 100, 100);} int bullet = CreateShotA1(ObjMove_GetX(enm), ObjMove_GetY(enm), spd, GetAngleToPlayer(enm), KEV_FIRE_PINK, 5); _BulletRescale(bullet, 1, true, 1); _Delay(bullet, 5); Shoot2; wait(del); } } ascent(i in 1..6){ CreateEnemyA(1.5*STG_WIDTH/8 + 96); CreateEnemyA(1.5*STG_WIDTH/8 - 96); if(i != 6){wait(spawndel);} else{} } while(length(enmFly) > 1){yield;} ascent(i in 1..6){ CreateEnemyA(6.5*STG_WIDTH/8 - 96); CreateEnemyA(6.5*STG_WIDTH/8 + 96); if(i != 6){wait(spawndel);} else{} } while(length(enmFly) > 1){yield;} return; } function Wave5(){ float acceltime = FUNC_LERP_ACCEL(W5_accelTimeMax, W5_accelTimeMin, rank/RANK_MAX); float bulletwait = FUNC_LERP_ACCEL(W5_bulletWaitTimeMax, W5_bulletWaitTimeMin, rank/RANK_MAX); float spd = FUNC_LERP_ACCEL(W5_bulletSpdMin, W5_bulletSpdMax, rank/RANK_MAX); float angrange = FUNC_LERP_ACCEL(W5_angRangeMin, W5_angRangeMax, rank/RANK_MAX); float del = FUNC_LERP_ACCEL(W5_bulletDelayMax, W5_bulletDelayMin, rank/RANK_MAX); float spawndel = FUNC_LERP_ACCEL(W4_spawnDelayMax, W4_spawnDelayMin, rank/RANK_MAX); float movespd = min(baseMoveSpeedVH * (1 + MoveSpeedRankMultiplierH * rank) * 1.2, 18); task CreateEnemyA(float startX){ float angMove = atan2(playerY - (-96), playerX - startX); int enm = _SmallWitch( 40, del*20, startX, -96 ); ObjMove_AddPatternA1(enm, 0, movespd, angMove); ObjRender_SetAngleZ(enm, angMove); while(!Obj_IsDeleted(enm) && ObjMove_GetY(enm) < STG_HEIGHT * 1/2){ if (ObjMove_GetY(enm) <= 128) {ObjEnemy_SetDamageRate(enm, 0, 0);} else {ObjEnemy_SetDamageRate(enm, 100, 100);} int bullet = CreateShotA1(ObjMove_GetX(enm), ObjMove_GetY(enm), 0, angMove+rand(-angrange, angrange), KEV_LEAF_PINK, 5); _BulletRescale(bullet, 0.75, true, 1); _Delay(bullet, 5); ObjMove_AddPatternA2(bullet, bulletwait, NO_CHANGE, NO_CHANGE, spd/acceltime, spd, 0); wait(del); } } ChargeSFX; ascent(i in 1..7){ CreateEnemyA(i * STG_WIDTH/7); if(i != 7){wait(spawndel);} else{} } while(length(enmFly) > 1){yield;} ChargeSFX; ascent(i in 1..7){ CreateEnemyA((7-i) * STG_WIDTH/7); if(i != 7){wait(spawndel);} else{} } while(length(enmFly) > 1){yield;} return; } function Wave6(){ int dense = FUNC_LERP_LINEAR(W6_spiralDenseMin, W6_spiralDenseMax, rank/RANK_MAX); int del = FUNC_LERP_ACCEL(W6_bulletDelayMax, W6_bulletDelayMin, rank/RANK_MAX); int zakodel = FUNC_LERP_ACCEL(W6_zakospawnDelayMax, W6_zakospawnDelayMin, rank/RANK_MAX); int waittime = FUNC_LERP_ACCEL(W6_bulletWaitTimeMax, W6_bulletWaitTimeMin, rank/RANK_MAX); float spd = FUNC_LERP_ACCEL(W6_bulletSpdMin, W6_bulletSpdMax, rank/RANK_MAX); float angoff = FUNC_LERP_ACCEL(W6_spiralAngOffsetMax, W6_spiralAngOffsetMin, rank/RANK_MAX); float movespd = baseMoveSpeedM * (1 + MoveSpeedRankMultiplierL*rank); float zakomovespd = baseMoveSpeedVH * (1 + MoveSpeedRankMultiplierL*rank); float space = FUNC_LERP_ACCEL(W6_angRangeMin, W6_angRangeMax, rank/RANK_MAX); int bulletnum = FUNC_LERP_LINEAR(W6_bulletNumMin, W6_bulletNumMax, rank/RANK_MAX); float angStart = rand(0, 360); int i = 0; int enmLarge = _LargeWitch( 40, 90, playerX, -144 ); async{ ObjMove_AddPatternA1(enmLarge, 0, movespd, 90); while(!Obj_IsDeleted(enmLarge)){ if (ObjMove_GetY(enmLarge) <= FUNC_LERP_LINEAR(144, 48, rank/RANK_MAX)) {ObjEnemy_SetDamageRate(enmLarge, 15, 15);} else {ObjEnemy_SetDamageRate(enmLarge, 100, 100);} yield; } } while(!Obj_IsDeleted(enmLarge) && ObjMove_GetY(enmLarge) <= STG_HEIGHT * 7/8){ ascent(i in 0..dense){ int bullet = CreateShotA1(ObjMove_GetX(enmLarge) + 64 * cos(angStart + i * 360/dense), ObjMove_GetY(enmLarge) + 64 * sin(angStart + i * 360/dense), 0, angStart + i * 360/dense, KEV_LEAF_PINK, 5); _BulletRescale(bullet, 0.75, true, 0.25); _Delay(bullet, 5); ObjMove_AddPatternA2(bullet, waittime, NO_CHANGE, NO_CHANGE, spd/waittime, spd, 0); } angStart += angoff; Shoot2; wait(del); } task CreateEnemyA(float startX){ float time = waittime/2; int enm = _Oni( 39, waittime*1.5, startX, -64 ); ObjEnemy_SetDamageRate(enm, 0, 0); ObjMove_SetDestAtFrame(enm, startX, STG_HEIGHT * 1/8, time, LERP_DECELERATE); wait(time-1); ObjMove_AddPatternA2(enm, time, NO_CHANGE, 90, zakomovespd/waittime, zakomovespd, 0); async{ while(!Obj_IsDeleted(enm)){ if (ObjMove_GetY(enm) <= 0) {ObjEnemy_SetDamageRate(enm, 0, 0);} else {ObjEnemy_SetDamageRate(enm, 200, 200);} yield; } } while(!Obj_IsDeleted(enm) && ObjMove_GetY(enm) < STG_HEIGHT * 6/7){ CreateFan( enm, bulletnum, KEV_FIRE_PINK, 1, GetAngleToPlayer(enm), space, spd*1.25, spd*1.25/1.5, 1, 0, 0, PATTERN_FAN, false ); wait(del*999); } } ascent(i in 1..8){ CreateEnemyA(i * STG_WIDTH/8); } wait(waittime/2); while(length(enmFly) > 1){yield;} return; } */ task _EndShake(shaketime, intensity){ float baseintensity = intensity; float shakeno = shaketime; ascent(i in 0..shakeno){ Set2DCameraFocusX(GetStgFrameWidth/2 + rand(-intensity, intensity)); Set2DCameraFocusY(GetStgFrameHeight/2 + rand(-intensity, intensity)); intensity = Interpolate_Decelerate(0, baseintensity, 1-i/shakeno); shaketime--; yield; } while(shaketime > 0){yield;} Set2DCameraFocusX(GetStgFrameWidth/2); Set2DCameraFocusY(GetStgFrameHeight/2); yield; } task _ObjShake(objID, shaketime, intensity){ float baseX = ObjMove_GetX(objID); float baseY = ObjMove_GetY(objID); float baseintensity = intensity; float shakeno = shaketime; ascent(i in 0..shakeno){ ObjMove_SetPosition(objID, baseX + rand(-intensity, intensity), baseY + rand(-intensity, intensity)/2); intensity = Interpolate_Decelerate(0, baseintensity, 1-i/shakeno); shaketime--; yield; } while(shaketime > 0){yield;} ObjMove_SetPosition(objID, baseX, baseY); yield; }