let texEnm = "script/Jam10/resourceLib/Jam10.png"; #include "script/Jam10/GunnerParade_ConstLib.dnh" float deadZone = STG_WIDTH - 32; float deadZoneB = STG_HEIGHT - 16; LoadTextureEx(texEnm, true, true); task _RenderBossFight(int enemy){ int aniidle = 0; //LoadTextureEx(tex, true, true); ObjPrim_SetTexture(enemy, texEnm); ObjSprite2D_SetSourceRect(enemy, bossRect[0], bossRect[1], bossRect[2], bossRect[3]); ObjSprite2D_SetDestCenter(enemy); ObjRender_SetScaleXYZ(enemy, 1); /* int nameText = CreateTextObject( GetStgFrameWidth()*0.3, 200, 25, "REMILIA SCARLET", "Origami Mommy", 0xFF5A5A, 0xFFFFFF, 0x791D1D, 3, 1 ); ObjRender_SetAngleZ(nameText, -90); ObjText_SetFontBold(nameText, true); */ //_BossMarker(enemy, tex, 512, 0, 768, 256, 0.45, 30); } function CreateUmbrellaEnemy( int renderPriority, int[] rect, float enmX, enmY, scale, hitbox, int invinTime, int killTime, int enmHealth, int itemDropPoint, int itemDropChain ){ // Spawns enemy. int enm = _CreateEnemy( enmX, enmY, enmX, enmY, 5, scale, scale, enmHealth, hitbox, 0, texEnm, rect[0], rect[1], rect[2], rect[3]); Obj_SetRenderPriorityI(enm, renderPriority); async{ while(!Obj_IsDeleted(enm)){ ObjRender_SetAngleZ(enm, ObjRender_GetAngleZ(enm)+1.5); yield; } } async{ ObjEnemy_SetDamageRate(enm, 0, 0); wait(invinTime); ObjEnemy_SetAutoDelete(enm, true); } _EnemyItemDrop( enm, true, itemDropPoint, itemDropChain, itemDropPoint*2+(GetCommonDataPtr(RANK_PTR, 1)-1)*2, itemDropChain*2+(GetCommonDataPtr(RANK_PTR, 1)-1)*2, killTime, hitbox*2.5 ); return enm; } function CreateFan (int parent, int way, int graphic, int stack, float ang, float angspace, float spd1, float spd2, float scaleBullet, int type, bool reflect){ int objPattern = ObjPatternShot_Create(); ObjPatternShot_SetParentObject(objPattern, parent); //if(ObjEnemyBossScene_GetInfo(GetEnemyBossSceneObjectID(), INFO_CURRENT_LIFE) == 0){Obj_Delete(objPattern); return;} ObjPatternShot_SetPatternType(objPattern, type); // PATTERN_FAN or PATTERN_FAN_AIMED ObjPatternShot_SetShotType(objPattern, OBJ_SHOT); ObjPatternShot_SetInitialBlendMode(objPattern, BLEND_ALPHA); ObjPatternShot_SetShotCount(objPattern, way, stack); ObjPatternShot_SetSpeed(objPattern, spd1, spd2); ObjPatternShot_SetAngle(objPattern, ang, angspace); ObjPatternShot_SetBasePointOffset(objPattern, 0, 0); //ObjPatternShot_SetDelay(objPattern, 15); ObjPatternShot_SetGraphic(objPattern, graphic); //Shoot2; let arrayPattern = ObjPatternShot_FireReturn(objPattern); ascent(i in -1..length(arrayPattern)-1){ _BulletRescale(arrayPattern[i], scaleBullet, true, 0.25); _Delay(arrayPattern[i], 5); //Obj_SetRenderPriorityI(arrayPattern[i], 51); } async{ wait(300); Obj_Delete(objPattern); return; } return objPattern; } // Overload function CreateFan (int parent, int way, int graphic, int stack, float ang, float angspace, float spd1, float spd2, float scaleBullet, float xOffset, float yOffset, int type, bool reflect){ int objPattern = ObjPatternShot_Create(); ObjPatternShot_SetParentObject(objPattern, parent); //if(ObjEnemyBossScene_GetInfo(GetEnemyBossSceneObjectID(), INFO_CURRENT_LIFE) == 0){Obj_Delete(objPattern); return;} ObjPatternShot_SetPatternType(objPattern, type); // PATTERN_FAN or PATTERN_FAN_AIMED ObjPatternShot_SetShotType(objPattern, OBJ_SHOT); ObjPatternShot_SetInitialBlendMode(objPattern, BLEND_ALPHA); ObjPatternShot_SetShotCount(objPattern, way, stack); ObjPatternShot_SetSpeed(objPattern, spd1, spd2); ObjPatternShot_SetAngle(objPattern, ang, angspace); ObjPatternShot_SetBasePointOffset(objPattern, xOffset, yOffset); //ObjPatternShot_SetDelay(objPattern, 15); ObjPatternShot_SetGraphic(objPattern, graphic); //Shoot2; let arrayPattern = ObjPatternShot_FireReturn(objPattern); ascent(i in -1..length(arrayPattern)-1){ _BulletRescale(arrayPattern[i], scaleBullet, true, 0.25); _Delay(arrayPattern[i], 5); //Obj_SetRenderPriorityI(arrayPattern[i], 51); } async{ wait(300); Obj_Delete(objPattern); return; } return objPattern; } // Enemy Type 1: Fairy (Wave 1, 2) function _SmallFairy( int renderPriority, invinTime, float enmX, float enmY ){ // Spawns enemy. int enm = _CreateEnemy( enmX, enmY, enmX, enmY, 5, smallEnemyScale, smallEnemyScale, popcornHP, smallEnemyHitbox, 0, texEnm, smallfairyRect[0], smallfairyRect[1], smallfairyRect[2], smallfairyRect[3]); Obj_SetRenderPriorityI(enm, renderPriority); int frame = 0; async{ while(!Obj_IsDeleted(enm)){ ObjSprite2D_SetSourceRect(enm, smallfairyRect[0]+128*floor(frame/6), smallfairyRect[1], smallfairyRect[2]+128*floor(frame/6), smallfairyRect[3]); frame++; if (frame >= (2*6-1)){frame = 0;} yield; } } async{ while(!Obj_IsDeleted(enm)){ if(ObjMove_GetX(enm) > deadZone){ObjEnemy_SetDamageRate(enm, 0, 0);} else{ObjEnemy_SetDamageRate(enm, 100, 100);} yield; } } _EnemyItemDrop( enm, true, smallFlyingEnm_itemPointMin, smallEnm_itemChainMin, smallFlyingEnm_itemPointMax, smallEnm_itemChainMax, invinTime*4, smallEnemyHitbox*2 ); return enm; } function _MushroomFairy( int renderPriority, invinTime, float enmX, float enmY ){ // Spawns enemy. int enm = _CreateEnemy( enmX, enmY, enmX, enmY, 5, smallEnemyScale, smallEnemyScale, mediumEnemyHP, medEnemyHitbox, 0, texEnm, mushroomfairyRect[0], mushroomfairyRect[1], mushroomfairyRect[2], mushroomfairyRect[3]); Obj_SetRenderPriorityI(enm, renderPriority); int frame = 0; async{ while(!Obj_IsDeleted(enm)){ ObjSprite2D_SetSourceRect(enm, mushroomfairyRect[0]+192*floor(frame/6), mushroomfairyRect[1], mushroomfairyRect[2]+192*floor(frame/6), mushroomfairyRect[3]); frame++; if (frame >= (2*6-1)){frame = 0;} yield; } } async{ while(!Obj_IsDeleted(enm)){ if(ObjMove_GetX(enm) > deadZone){ObjEnemy_SetDamageRate(enm, 0, 0);} else{ObjEnemy_SetDamageRate(enm, 100, 100);} yield; } } _EnemyItemDrop( enm, true, smallFlyingEnm_itemPointMin, smallEnm_itemChainMin, smallFlyingEnm_itemPointMax, smallEnm_itemChainMax, invinTime*5, smallEnemyHitbox*2 ); return enm; } function _MushroomFairyAlt( int renderPriority, invinTime, float enmX, float enmY ){ // Spawns enemy. int enm = _CreateEnemy( enmX, enmY, enmX, enmY, 5, smallEnemyScale, smallEnemyScale, mediumEnemyHP, medEnemyHitbox, 0, texEnm, mushroomfairyRect[0]+384, mushroomfairyRect[1], mushroomfairyRect[2]+384, mushroomfairyRect[3]); Obj_SetRenderPriorityI(enm, renderPriority); int frame = 0; async{ while(!Obj_IsDeleted(enm)){ ObjSprite2D_SetSourceRect(enm, mushroomfairyRect[0]+192*floor(frame/6)+384, mushroomfairyRect[1], mushroomfairyRect[2]+192*floor(frame/6)+384, mushroomfairyRect[3]); frame++; if (frame >= (2*6-1)){frame = 0;} yield; } } async{ while(!Obj_IsDeleted(enm)){ if(ObjMove_GetX(enm) > deadZone){ObjEnemy_SetDamageRate(enm, 0, 0);} else{ObjEnemy_SetDamageRate(enm, 100, 100);} yield; } } _EnemyItemDrop( enm, true, medFlyingEnm_itemPointMin, smallEnm_itemChainMin, medFlyingEnm_itemPointMax, smallEnm_itemChainMax, invinTime*5, smallEnemyHitbox*2 ); return enm; } function _YukiOnna( int renderPriority, invinTime, float enmX, float enmY ){ // Spawns enemy. int enm = _CreateEnemy( enmX, enmY, enmX, enmY, 5, smallEnemyScale, smallEnemyScale, largeEnemyHP, largeEnemyHitbox, 0, texEnm, yukionnaRect[0], yukionnaRect[1], yukionnaRect[2], yukionnaRect[3]); Obj_SetRenderPriorityI(enm, renderPriority); async{ while(!Obj_IsDeleted(enm)){ if(ObjMove_GetX(enm) > deadZone){ObjEnemy_SetDamageRate(enm, 0, 0);} else{ObjEnemy_SetDamageRate(enm, 100, 100);} yield; } } _EnemyItemDrop( enm, true, largeFlyingEnm_itemPointMin, smallEnm_itemChainMin, largeFlyingEnm_itemPointMax, smallEnm_itemChainMax, invinTime*6, largeEnemyHitbox*2 ); return enm; } // Enemy Type 2: Oni/Bird (Wave 4) function _Spirit( int renderPriority, invinTime, float enmX, float enmY ){ // Spawns enemy. int enm = _CreateEnemy( enmX, enmY, enmX, enmY, 5, smallEnemyScale, smallEnemyScale, smallEnemyHP, spiritHitbox, 0, texEnm, spiritRect[0], spiritRect[1], spiritRect[2], spiritRect[3]); Obj_SetRenderPriorityI(enm, renderPriority); int frame = 0; async{ while(!Obj_IsDeleted(enm)){ ObjSprite2D_SetSourceRect(enm, spiritRect[0]+128*floor(frame/6), spiritRect[1], spiritRect[2]+128*floor(frame/6), spiritRect[3]); frame++; if (frame >= (2*6-1)){frame = 0;} yield; } } async{ while(!Obj_IsDeleted(enm)){ if(ObjMove_GetX(enm) > deadZone){ObjEnemy_SetDamageRate(enm, 0, 0);} else{ObjEnemy_SetDamageRate(enm, 100, 100);} yield; } } _EnemyItemDrop( enm, true, smallFlyingEnm_itemPointMin, smallEnm_itemChainMin, smallFlyingEnm_itemPointMax, smallEnm_itemChainMax, invinTime*4, smallEnemyHitbox*2 ); return enm; } // Enemy Type 3: Witch/Dancer (Wave 5) /* function _SmallWitch( int renderPriority, invinTime, float enmX, float enmY ){ // Spawns enemy. int enm = _CreateEnemy( enmX, enmY, enmX, enmY, 5, smallEnemyScale, smallEnemyScale*1.5, smallEnemyHP, smallEnemyHitbox, 0, texEnm, smallwitchRect[0], smallwitchRect[1], smallwitchRect[2], smallwitchRect[3]); Obj_SetRenderPriorityI(enm, renderPriority); async{ ObjEnemy_SetDamageRate(enm, 0, 0); wait(5); ObjEnemy_SetAutoDelete(enm, true); wait(invinTime-5); ObjEnemy_SetDamageRate(enm, 100, 100); } _EnemyItemDrop( enm, true, smallFlyingEnm_itemPointMin, smallEnm_itemChainMin, smallFlyingEnm_itemPointMax, smallEnm_itemChainMax, invinTime*2, smallEnemyHitbox*2 ); return enm; } function _LargeWitch( int renderPriority, invinTime, float enmX, float enmY ){ // Spawns enemy. int enm = _CreateEnemy( enmX, enmY, enmX, enmY, 5, largeEnemyScale, largeEnemyScale, largeEnemyHP, largeEnemyHitbox, 0, texEnm, largewitchRect[0], largewitchRect[1], largewitchRect[2], largewitchRect[3]); Obj_SetRenderPriorityI(enm, renderPriority); async{ ObjEnemy_SetDamageRate(enm, 0, 0); wait(5); ObjEnemy_SetAutoDelete(enm, true); wait(invinTime-5); ObjEnemy_SetDamageRate(enm, 100, 100); } _EnemyItemDrop( enm, true, largeFlyingEnm_itemPointMin, largeEnm_itemChainMin, largeFlyingEnm_itemPointMax, largeEnm_itemChainMax, invinTime*2, largeEnemyHitbox*2 ); return enm; } function _LargeDancer( int renderPriority, invinTime, float enmX, float enmY ){ // Spawns enemy. int enm = _CreateEnemy( enmX, enmY, enmX, enmY, 5, largeEnemyScale, largeEnemyScale, largeEnemyHP, largeEnemyHitbox, 0, texEnm, largedancerRect[0], largedancerRect[1], largedancerRect[2], largedancerRect[3]); Obj_SetRenderPriorityI(enm, renderPriority); async{ ObjEnemy_SetDamageRate(enm, 0, 0); wait(5); ObjEnemy_SetAutoDelete(enm, true); wait(invinTime-5); ObjEnemy_SetDamageRate(enm, 100, 100); } _EnemyItemDrop( enm, true, largeFlyingEnm_itemPointMin, largeEnm_itemChainMin, largeFlyingEnm_itemPointMax, largeEnm_itemChainMax, invinTime*2, largeEnemyHitbox*2 ); return enm; } function _Fish( int renderPriority, invinTime, float enmX, float enmY ){ // Spawns enemy. int enm = _CreateEnemy( enmX, enmY, enmX, enmY, 5, smallEnemyScale, smallEnemyScale, smallEnemyHP, smallEnemyHitbox, 0, texEnm, 1280, 768, 1280+256, 768+256); Obj_SetRenderPriorityI(enm, renderPriority); async{ ObjEnemy_SetDamageRate(enm, 0, 0); wait(5); ObjEnemy_SetAutoDelete(enm, true); wait(invinTime-5); ObjEnemy_SetDamageRate(enm, 100, 100); } _EnemyItemDrop( enm, true, smallFlyingEnm_itemPointMin, smallEnm_itemChainMin, smallFlyingEnm_itemPointMax, smallEnm_itemChainMax, invinTime*2, smallEnemyHitbox*2 ); return enm; } // Ground Enemy 1 task _CreateSign1( int renderPriority, invinTime, float enmX, float enmY, float movespd ){ int enm = _CreateEnemy( enmX, enmY, enmX, enmY, 5, popcornScale, popcornScale, popcornHP, popcornHitbox, 0, texEnm, sign1Rect[0], sign1Rect[1], sign1Rect[2], sign1Rect[3]); Obj_SetRenderPriorityI(enm, renderPriority); ObjMove_SetSpeed(enm, movespd); ObjMove_SetAngle(enm, 90); async{ ObjEnemy_SetDamageRate(enm, 0, 0); wait(invinTime); ObjEnemy_SetAutoDelete(enm, true); } _EnemyItemDrop( enm, false, 1, smallEnm_itemChainMin, smallGroundEnm_itemAmmoMin, smallFlyingEnm_itemPointMax/2, smallEnm_itemChainMax, smallGroundEnm_itemAmmoMax, invinTime*2, popcornHitbox*2 ); } function _CreateSign1A( int renderPriority, invinTime, float enmX, float enmY, float movespd ){ int enm = _CreateEnemy( enmX, enmY, enmX, enmY, 5, popcornScale, popcornScale, popcornHP, popcornHitbox, 0, texEnm, sign2Rect[0], sign2Rect[1], sign2Rect[2], sign2Rect[3]); Obj_SetRenderPriorityI(enm, renderPriority); ObjMove_SetSpeed(enm, movespd); ObjMove_SetAngle(enm, 90); async{ ObjEnemy_SetDamageRate(enm, 0, 0); wait(invinTime); ObjEnemy_SetAutoDelete(enm, true); } _EnemyItemDrop( enm, false, smallFlyingEnm_itemPointMin, smallEnm_itemChainMin, smallGroundEnm_itemAmmoMin, smallFlyingEnm_itemPointMax, smallEnm_itemChainMax, smallGroundEnm_itemAmmoMax, invinTime*2, popcornHitbox*2 ); return enm; } // Ground Enemy 2 function _CreateCannon1( int renderPriority, invinTime, float enmX, float enmY, float movespd ){ int enm = _CreateEnemy( enmX, enmY, enmX, enmY, 5, 1, 1, mediumEnemyHP, largeEnemyHitbox, 0, texEnm, cannonRect[0], cannonRect[1], cannonRect[2], cannonRect[3]); Obj_SetRenderPriorityI(enm, renderPriority); ObjMove_SetSpeed(enm, movespd); ObjMove_SetAngle(enm, 90); async{ ObjEnemy_SetDamageRate(enm, 0, 0); wait(invinTime); ObjEnemy_SetAutoDelete(enm, true); } _EnemyItemDrop( enm, false, smallFlyingEnm_itemPointMin, mediumEnm_itemChainMin, medGroundEnm_itemAmmoMin, smallFlyingEnm_itemPointMax, mediumEnm_itemChainMax, medGroundEnm_itemAmmoMax, invinTime*3, largeEnemyHitbox*2 ); return enm; } // 6 signs task _SignPlatform1( int renderPriority, invinTime, float platformX, float platformY, float movespd ){ int enmPad = _CreateEnemy( false, platformX, platformY, platformX, platformY, 5, 0.6, 0.6, 999, 0, 0, texEnm, platformRect[0], platformRect[1], platformRect[2], platformRect[3]); float offsetX = 128, offsetY = 64; Obj_SetRenderPriorityI(enmPad, renderPriority); ObjMove_SetSpeed(enmPad, movespd); ObjMove_SetAngle(enmPad, 90); ObjEnemy_SetDamageRate(enmPad, 0, 0); async{ ascent(i in 0..3){ _CreateSign1( renderPriority+1, invinTime, platformX-128+(offsetX*2)-(offsetX*i), platformY-offsetY-offsetY*0.5, movespd ); } ascent(i in 0..3){ _CreateSign1( renderPriority+2, invinTime, platformX-128+(offsetX*2)-(offsetX*i), platformY+offsetY-offsetY*0.5, movespd ); } } wait(invinTime); ObjEnemy_SetAutoDelete(enmPad, true); } // 3 signs per platform, straight line function _SignPlatform1A( int renderPriority, invinTime, float platformX, float platformY, float movespd ){ int[] signs = []; int enmPad = _CreateEnemy( false, platformX, platformY, platformX, platformY, 5, 0.8, 0.8, 999, 0, 0, texEnm, platformRect[0], platformRect[1], platformRect[2], platformRect[3]); float offsetX = 128, offsetY = 64; Obj_SetRenderPriorityI(enmPad, renderPriority); ObjMove_SetSpeed(enmPad, movespd); ObjMove_SetAngle(enmPad, 90); ObjEnemy_SetDamageRate(enmPad, 0, 0); async{ ascent(i in 0..3){ int sign = _CreateSign1A( renderPriority+1, invinTime, platformX-128+(offsetX*2)-(offsetX*i), platformY-offsetY-offsetY*0.5, movespd ); signs ~= [sign]; } } async{ wait(invinTime); ObjEnemy_SetAutoDelete(enmPad, true); } return signs; } // A Bussy function _CreateCannonBush( int renderPriority, invinTime, float platformX, float platformY, float movespd ){ int[] signs = []; int enmPad = _CreateEnemy( false, platformX, platformY, platformX, platformY, 5, 1.2, 1.2, 999, 0, 0, texEnm, bushRect[0], bushRect[1], bushRect[2], bushRect[3]); float offsetX = 280, offsetY = 64; Obj_SetRenderPriorityI(enmPad, renderPriority); ObjMove_SetSpeed(enmPad, movespd); ObjMove_SetAngle(enmPad, 90); ObjEnemy_SetDamageRate(enmPad, 0, 0); async{ ascent(i in -1..1){ int enm = _CreateCannon1( renderPriority+1, invinTime, platformX-[135, -135][i], platformY, movespd ); signs ~= [enm]; } } async{ wait(invinTime); ObjEnemy_SetAutoDelete(enmPad, true); } return signs; } // A Bussy for Only The BIGGEST BITCHES IN TOWN (additional zako not included) function _CreateDangerBush( int renderPriority, invinTime, float platformX, float platformY, float movespd ){ int enmPad = _CreateEnemy( true, platformX, platformY, platformX, platformY, 5, 1, 1, largeEnemyHP, largeEnemyHitbox*2.5, 0, texEnm, bush2Rect[0], bush2Rect[1], bush2Rect[2], bush2Rect[3]); float offsetX = 280, offsetY = 64; float x = 0, y = 0; Obj_SetRenderPriorityI(enmPad, renderPriority); ObjMove_SetSpeed(enmPad, movespd); ObjMove_SetAngle(enmPad, 90); ObjEnemy_SetDamageRate(enmPad, 0, 0); // Sigil async{ if(GetCommonData("Ground Loops Cleared", 0) % 2 == 0 && GetCommonData("Ground Loops Cleared", 0) != 0 && GetCommonData("Difficulty", "Standard") != "Extra"){ int sigil = _Create2DImage(texEnm, [0, 1024, 512, 1536]); ObjRender_SetAlpha(sigil, 180); Obj_SetRenderPriorityI(sigil, Obj_GetRenderPriorityI(enmPad)+1); while(ObjEnemy_GetInfo(enmPad, INFO_LIFE) > 0){ ObjRender_SetPosition(sigil, ObjMove_GetX(enmPad), ObjMove_GetY(enmPad), 1); ObjRender_SetAngleZ(sigil, ObjRender_GetAngleZ(sigil)+1.5); yield; } Obj_Delete(sigil); } } // Drops async{ while(!Obj_IsDeleted(enmPad)){ x = ObjMove_GetX(enmPad); y = ObjMove_GetY(enmPad); if (y < STG_HEIGHT/8) {ObjEnemy_SetDamageRate(enmPad, 0, 0);} else {ObjEnemy_SetDamageRate(enmPad, 100, 100);} yield; } if( (-128 < x && x < STG_WIDTH+128) && (y < STG_HEIGHT+128) ) { DeleteShotInCircle(TYPE_SHOT, TYPE_ITEM, x, y, 256); ObjSound_Play(bossBoom); if(GetCommonData("Ground Loops Cleared", 0) % 2 == 0 && GetCommonData("Ground Loops Cleared", 0) != 0 && GetCommonData("Difficulty", "Standard") != "Extra"){CreateExtendItem(EXTEND_SPELL, x, y);} TExplosionA(x, y, 10, 0.5); } } // Shake async{ while(!Obj_IsDeleted(enmPad)){ float value = rand(-4, 4); ObjMove_SetPosition(enmPad, x + value, y + value); yield; } } async{ wait(invinTime); ObjEnemy_SetAutoDelete(enmPad, true); ObjEnemy_SetDamageRate(enmPad, 100, 100); } _EnemyItemDrop( enmPad, false, medFlyingEnm_itemPointMin, mediumEnm_itemChainMin, verylargeGroundEnm_itemAmmoMin, medFlyingEnm_itemPointMax, mediumEnm_itemChainMax, verylargeGroundEnm_itemAmmoMax, invinTime*3, largeEnemyHitbox*3.5 ); return enmPad; } function _CreateBushRemnant( int renderPriority, invinTime, float enmX, float enmY ){ // Spawns enemy. int enm = _CreateEnemy( enmX, enmY, enmX, enmY, 5, smallEnemyScale, smallEnemyScale, smallEnemyHP, smallEnemyHitbox, 0, texEnm, bush2ARect[0], bush2ARect[1], bush2ARect[2], bush2ARect[3]); Obj_SetRenderPriorityI(enm, renderPriority); async{ ObjEnemy_SetDamageRate(enm, 0, 0); wait(5); ObjEnemy_SetAutoDelete(enm, true); wait(invinTime-5); ObjEnemy_SetDamageRate(enm, 100, 100); } _EnemyItemDrop( enm, true, smallFlyingEnm_itemPointMin/2, smallEnm_itemChainMin/2, smallGroundEnm_itemAmmoMin, smallFlyingEnm_itemPointMax/2, smallEnm_itemChainMax/2, smallGroundEnm_itemAmmoMax, invinTime*2, smallEnemyHitbox*2 ); return enm; } // Ships function _CreateRybb( int renderPriority, invinTime, float enmX, float enmY, float moveSpd ){ int enm = _CreateEnemy( enmX, enmY, enmX, enmY, 5, 1.5, 1.5, largeEnemyAltHP, largeEnemyHitbox*2, 0, texEnm, rybbRect[0], rybbRect[1], rybbRect[2], rybbRect[3]); Obj_SetRenderPriorityI(enm, renderPriority); ObjMove_SetSpeed(enm, moveSpd); ObjMove_SetAngle(enm, 90); ObjRender_SetAngleZ(enm, 180); float x = 0, y = 0; async{ ObjEnemy_SetDamageRate(enm, 0, 0); wait(invinTime); ObjEnemy_SetDamageRate(enm, 100, 100); ObjEnemy_SetAutoDelete(enm, true); } async{ while(!Obj_IsDeleted(enm)){ x = ObjMove_GetX(enm); y = ObjMove_GetY(enm); yield; } if( (-128 < x && x < STG_WIDTH+128) && (y < STG_HEIGHT+128) ) { DeleteShotInCircle(TYPE_SHOT, TYPE_ITEM, x, y, 256); ObjSound_Play(bossBoom); TExplosionA(x, y, 10, 0.5); } } _EnemyItemDrop( enm, false, verylargeFlyingEnm_itemPointMin, largeEnm_itemChainMin, verylargeGroundEnm_itemAmmoMin, verylargeFlyingEnm_itemPointMax, largeEnm_itemChainMax, verylargeGroundEnm_itemAmmoMax, invinTime*2, largeEnemyHitbox*4 ); return enm; } function _CreateDecker( int renderPriority, invinTime, float enmX, float enmY, float moveSpd ){ int enm = _CreateEnemy( enmX, enmY, enmX, enmY, 5, 1.5, 1.5, largeEnemyAltHP, largeEnemyHitbox*2, 0, texEnm, deckerRect[0], deckerRect[1], deckerRect[2], deckerRect[3]); Obj_SetRenderPriorityI(enm, renderPriority); ObjRender_SetAngleZ(enm, 180); float x = 0, y = 0; async{ while(!Obj_IsDeleted(enm)){ x = ObjMove_GetX(enm); y = ObjMove_GetY(enm); yield; } if( (-128 < x && x < STG_WIDTH+128) && (y < STG_HEIGHT+128) ) { DeleteShotInCircle(TYPE_SHOT, TYPE_ITEM, x, y, 256); ObjSound_Play(bossBoom); TExplosionA(x, y, 10, 0.5); } } async{ ObjEnemy_SetDamageRate(enm, 0, 0); wait(invinTime); ObjEnemy_SetDamageRate(enm, 100, 100); ObjEnemy_SetAutoDelete(enm, true); } _EnemyItemDrop( enm, false, verylargeFlyingEnm_itemPointMin, largeEnm_itemChainMin, verylargeGroundEnm_itemAmmoMin, verylargeFlyingEnm_itemPointMax, largeEnm_itemChainMax, verylargeGroundEnm_itemAmmoMax, invinTime*2, largeEnemyHitbox*4 ); return enm; } // Formation 2 task _SmallFairyRing( int renderPriority, int graphicBullet, float enmX, enmY, int denseRing, float delayRing, float speedRing, float spdMove, angMove, scaleBullet ){ // Spawns enemy. int enm = _CreateEnemy( enmX, enmY, enmX, enmY, 5, smallEnemyScale, smallEnemyScale, smallEnemyHP, smallEnemyHitbox, 0, texEnm, 768, 0, 1024, 256); Obj_SetRenderPriorityI(enm, renderPriority); ObjMove_SetSpeed(enm, spdMove); ObjMove_SetAngle(enm, angMove); ObjEnemy_SetDamageRate(enm, 0, 0); wait(5); ObjEnemy_SetAutoDelete(enm, true); async{ wait(5); while(ObjEnemy_GetInfo(enm, INFO_LIFE) > 0){ if(ObjMove_GetX(enm) < STG_WIDTH && ObjMove_GetX(enm) > 0){ ascent(i in -1..denseRing){ int bullet = CreateShotA1(ObjMove_GetX(enm), ObjMove_GetY(enm), speedRing, GetAngleToPlayer(enm)+i*360/denseRing, graphicBullet, 10); _BulletRescale(bullet, scaleBullet, true, 1); _Delay(bullet, 10); if(ObjEnemy_GetInfo(enm, INFO_LIFE) <= 0){Obj_Delete(bullet);} else{ Shoot1; } } wait(delayRing); } else{yield;} } } _EnemyItemDrop( enm, true, 5, 3, 10+(GetCommonDataPtr(RANK_PTR, 1)-1)*2, 6+(GetCommonDataPtr(RANK_PTR, 1)-1)*1, 120, smallEnemyHitbox*2 ); } // Enemy Type 2 : Jack o Lanterns (ground enemies) // Formation 1: Groups of 8 mini-lanterns. Does nothing. // Formation 2: Groups of 4 midsize-lanterns. Fires aimed fans. task _CreateLanternSmall( int renderPriority, int graphicBullet, float angspaceFan, float speedFan1, float speedFan2, int widthFan, int stackFan, int delayFan, float enmX, enmY, speedMove, scaleBullet ){ int enm = _CreateEnemy( enmX, enmY, enmX, enmY, 5, popcornScale, popcornScale, popcornHP, popcornHitbox, 0, texEnm, 1024, 512, 1280, 768); Obj_SetRenderPriorityI(enm, renderPriority); ObjMove_SetSpeed(enm, speedMove); ObjMove_SetAngle(enm, 90); async{ ObjEnemy_SetDamageRate(enm, 0, 0); wait(15); ObjEnemy_SetAutoDelete(enm, true); } _EnemyItemDrop( enm, false, 6, 8, 10+round((GetCommonDataPtr(RANK_PTR, 1)-1)*1.5), 12+(GetCommonDataPtr(RANK_PTR, 1)-1)*1.5, 120, popcornHitbox*2 ); } task _CreateLanternMid( int renderPriority, int graphicBullet, float angspaceFan, float speedFan1, float speedFan2, int widthFan, int stackFan, int delayFan, float enmX, enmY, speedMove, scaleBullet ){ int enm = _CreateEnemy( enmX, enmY, enmX, enmY, 5, smallEnemyScale, smallEnemyScale, smallEnemyHP, smallEnemyHitbox, 0, texEnm, 1280, 768, 1536, 1024); Obj_SetRenderPriorityI(enm, renderPriority); ObjMove_SetSpeed(enm, speedMove); ObjMove_SetAngle(enm, 90); async{ ObjEnemy_SetDamageRate(enm, 0, 0); wait(15); ObjEnemy_SetAutoDelete(enm, true); } async{ wait(speedMove*2); while(ObjEnemy_GetInfo(enm, INFO_LIFE) > 0){ if(ObjMove_GetY(enm) < 10*STG_HEIGHT/12-100 && ObjMove_GetY(enm) > STG_HEIGHT/9){ int bullet = CreateFan(enm, widthFan, graphicBullet, stackFan, 0, angspaceFan, speedFan1, speedFan2, scaleBullet, PATTERN_FAN_AIMED, false); if(ObjEnemy_GetInfo(enm, INFO_LIFE) <= 0){Obj_Delete(bullet);} else{ Shoot1; } wait(delayFan); } else{yield;} } } _EnemyItemDrop( enm, false, 12, 10, 20+round((GetCommonDataPtr(RANK_PTR, 1)-1)*1.5), 16+(GetCommonDataPtr(RANK_PTR, 1)-1)*2, 120, smallEnemyHitbox*2 ); } task _SmallLanternFormation( int renderEnm, int graphicBullet, float padX, float padY, float angspaceFan, float speedFan1, float speedFan2, int widthFan, int stackFan, int delayFan, float scaleBullet, float speedMove ){ float offsetX = 80; float offsetY = 70; int enmPad = _CreateEnemy( false, padX, padY, padX, padY, 5, 1, 1, 999, 0, 0, texEnm, 1536, 256, 2048, 768); Obj_SetRenderPriorityI(enmPad, renderEnm-4); ObjMove_SetSpeed(enmPad, speedMove); ObjMove_SetAngle(enmPad, 90); ObjEnemy_SetDamageRate(enmPad, 0, 0); wait(5); ObjEnemy_SetAutoDelete(enmPad, true); async{ _CreateLanternSmall( renderEnm, graphicBullet, angspaceFan, speedFan1, speedFan2, widthFan, stackFan, delayFan, padX+offsetX, padY+offsetY, speedMove, scaleBullet ); _CreateLanternSmall( renderEnm, graphicBullet, angspaceFan, speedFan1, speedFan2, widthFan, stackFan, delayFan, padX-offsetX, padY+offsetY, speedMove, scaleBullet ); _CreateLanternSmall( renderEnm-1, graphicBullet, angspaceFan, speedFan1, speedFan2, widthFan, stackFan, delayFan, padX+offsetX, padY-offsetY, speedMove, scaleBullet ); _CreateLanternSmall( renderEnm-1, graphicBullet, angspaceFan, speedFan1, speedFan2, widthFan, stackFan, delayFan, padX-offsetX, padY-offsetY, speedMove, scaleBullet ); } } task _MidLanternFormation( int renderEnm, int graphicBullet, float padX, float padY, float angspaceFan, float speedFan1, float speedFan2, int widthFan, int stackFan, int delayFan, float scaleBullet, float speedMove ){ int enmPad = _CreateEnemy( false, padX, padY, padX, padY, 5, 0.75, 0.75, 999, 0, 0, texEnm, 1536, 256, 2048, 768); Obj_SetRenderPriorityI(enmPad, renderEnm-4); ObjMove_SetSpeed(enmPad, speedMove); ObjMove_SetAngle(enmPad, 90); ObjEnemy_SetDamageRate(enmPad, 0, 0); wait(5); ObjEnemy_SetAutoDelete(enmPad, true); async{ _CreateLanternMid( renderEnm, graphicBullet, angspaceFan, speedFan1, speedFan2, widthFan, stackFan, delayFan, padX-90, padY, speedMove, scaleBullet ); _CreateLanternMid( renderEnm, graphicBullet, angspaceFan, speedFan1, speedFan2, widthFan, stackFan, delayFan, padX+90, padY, speedMove, scaleBullet ); } } // Enemy Type 3: Will o the Wisps // Formation 1: Appears randomly on the top of the screen, slowly moving down while firing slow aimed bullets. // Formation 2: Flies from either side, moving horizontally. Fires bullets aimed straight down. function _SmallWisp( int renderPriority, spawnTime, invinTime, float enmX, enmY, spdMove, angMove, int graphicBullet, int delayBullet, int bulletAccelTime, float maxspeedBullet, float bulletAng, float scaleBullet ){ // Spawns enemy. int enm = _CreateEnemy( enmX, enmY, enmX, enmY, spawnTime, smallEnemyScale*0.5, smallEnemyScale, smallEnemyHP, smallEnemyHitbox, 0, texEnm, 768, 0, 1024, 256); Obj_SetRenderPriorityI(enm, renderPriority); ObjMove_SetSpeed(enm, 0); ObjMove_SetAngle(enm, angMove); async{ ObjEnemy_SetDamageRate(enm, 0, 0); wait(spawnTime); ObjEnemy_SetAutoDelete(enm, true); wait(invinTime - spawnTime); ObjEnemy_SetDamageRate(enm, 100, 100); } async{ wait(spawnTime); ObjMove_SetSpeed(enm, spdMove); while(ObjEnemy_GetInfo(enm, INFO_LIFE) > 0){ if(ObjMove_GetX(enm) < STG_WIDTH && ObjMove_GetX(enm) > 0){ int bullet = CreateShotA2(ObjMove_GetX(enm) + rand(-30, 30), ObjMove_GetY(enm) + rand(-30, 30), 0, bulletAng, maxspeedBullet/bulletAccelTime, maxspeedBullet, graphicBullet, 10); _BulletRescale(bullet, scaleBullet, true, 1); _Delay(bullet, 10); if(ObjEnemy_GetInfo(enm, INFO_LIFE) <= 0){Obj_Delete(bullet);} else{ Shoot1; } wait(delayBullet); } else{yield;} } } _EnemyItemDrop( enm, true, 5, 5, 10+(GetCommonDataPtr(RANK_PTR, 1)-1)*2, 10+(GetCommonDataPtr(RANK_PTR, 1)-1)*1, 120, smallEnemyHitbox*2 ); return enm; } // Enemy Type 4: Oni function _CreateOni( int renderPriority, int graphicBullet, bool bombdrop, float delayBullet, float speedBullet, float acceltimeBullet, float enmX, enmY, speedMoveEnm, scaleBullet ){ // Enemy has NO GRAPHIC int enm = _CreateEnemy( enmX, enmY, enmX, enmY, 5, largeEnemyScale, largeEnemyScale, largeEnemyHP, largeEnemyHitbox, 0, texEnm, 0, 256, 256, 512); Obj_SetRenderPriorityI(enm, renderPriority); ObjMove_SetSpeed(enm, speedMoveEnm); ObjMove_SetAngle(enm, 90); ObjEnemy_SetDamageRate(enm, 0, 0); async{ if(GetCommonData("Flying Loops Cleared", 0) % 2 == 0 && GetCommonData("Flying Loops Cleared", 0) != 0 && bombdrop){ int sigil = _Create2DImage(texEnm, [0, 1024, 512, 1536]); ObjRender_SetAlpha(sigil, 180); Obj_SetRenderPriorityI(sigil, Obj_GetRenderPriorityI(enm)-1); while(ObjEnemy_GetInfo(enm, INFO_LIFE) > 0){ ObjRender_SetPosition(sigil, ObjMove_GetX(enm), ObjMove_GetY(enm), 1); ObjRender_SetAngleZ(sigil, ObjRender_GetAngleZ(sigil)+3); yield; } Obj_Delete(sigil); } } async{ async{ float x = 0, y = 0; async{ wait(max(5, 10-GetCommonData("Rank", 0)*5)); while(ObjEnemy_GetInfo(enm, INFO_LIFE) > 0){ x = ObjMove_GetX(enm); y = ObjMove_GetY(enm); yield; } } wait(max(25, 60-GetCommonData("Rank", 1)*5)); while(ObjEnemy_GetInfo(enm, INFO_LIFE) > 0){yield;} if( (-128 < x && x < STG_WIDTH+128) && (y < STG_HEIGHT+128) ) { //DeleteShotInCircle(TYPE_SHOT, TYPE_ITEM, x, y, 384); //ObjSound_Play(bossBoom); if(GetCommonData("Flying Loops Cleared", 0) % 2 == 0 && GetCommonData("Flying Loops Cleared", 0) != 0 && bombdrop){CreateExtendItem(EXTEND_SPELL, x, y);} TExplosionA(x, y, 10, 0.5); } } wait(max(10, 20-GetCommonData("Rank", 1)*2)); ObjEnemy_SetAutoDelete(enm, true); async{ wait(5); while(ObjEnemy_GetInfo(enm, INFO_LIFE) > 0){ if(ObjMove_GetY(enm) < 11*STG_HEIGHT/12 && ObjMove_GetY(enm) > STG_HEIGHT/12){ float xspd = rand(-(2+GetCommonDataPtr(RANK_PTR, 1)*0.25), 2+GetCommonDataPtr(RANK_PTR, 1)*0.25); int bullet = CreateShotB2(ObjMove_GetX(enm), ObjMove_GetY(enm), xspd, -speedBullet, 0, speedBullet/(acceltimeBullet/2), xspd, speedBullet*1.5, graphicBullet, 10); if(Obj_IsDeleted(enm)){Obj_Delete(bullet); break;} else{ Shoot1; _BulletRescale(bullet, scaleBullet, true, 1); _Delay(bullet, 10); } wait(delayBullet); } else{yield;} yield; } } _EnemyItemDrop( enm, false, 18, 15, round(30+(GetCommonDataPtr(RANK_PTR, 1)-1)*1.5), round(24+(GetCommonDataPtr(RANK_PTR, 1)-1)*1.5), 180, largeEnemyHitbox*2.5 ); } return enm; //ObjEnemy_SetDamageRate(enm, 100, 150); } */