ScarletBlackMarket/script/game/Non2.dnh

260 lines
5.9 KiB
Plaintext

#TouhouDanmakufu[Single]
#ScriptVersion[3]
#Title["Remilia Nonspell 2"]
#Text["yassification"]
#System["script/KevinSystem/Kevin_System.txt"]
int difficultySelect = 0;
let objScene = GetEnemyBossSceneObjectID();
let csd = GetCurrentScriptDirectory();
let bossObj;
float bossX = 0;
float bossY = 0;
float playerY = 0;
float playerX = 0;
let aniframe = 0;
let aniframe2 = 0;
let spellsnd = ObjSound_Create();
let bossdiesnd = ObjSound_Create();
/*Parameters:
+ Laser ring density
+ Laser spin speed
+ Spiral density
+ Spiral speed
+ Spiral angle offset
+ Spiral delay
*/
int[] denseLaser = [7, 8, 9];
float[] speedspinLaser = [0.35, 0.35, 0.35];
int[] timeLaser = [60, 70, 80];
int[] timeDelayLaser = [45, 40, 30];
int[] denseSpiral = [5, 6, 7];
float[] angleoffsetSpiral = [1.618*8, 1.618*7, 1.618*6];
float[] speedSpiral = [8.5, 9.5, 10.5];
int[] delaySpiral = [5, 5, 4];
/*
*/
// Includes ahoy
#include "script/KevinSystem/Universal_Lib.txt" // The library to include all libraries :sans: :nail_care:
@Initialize {
//SetIntersectionVisualization(true);
SetAutoDeleteObject(true);
_InitDifficulty(difficultySelect);
//difficultySelect = 0; // debug
SetShotAutoDeleteClip(64, 64, 64, 64);
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, GetCommonData("Boss Position X", STG_WIDTH/2), GetCommonData("Boss Position Y", STG_HEIGHT/2));
ObjEnemy_SetMaximumDamage(bossObj, 999);
_RenderBoss(bossObj);
mainTask();
_FadeInvincibility(bossObj, 150, 150, 1);
endingnew();
}
@Event {
alternative(GetEventType())
case(EV_REQUEST_LIFE) {
SetScriptResult(3000);
}
case(EV_REQUEST_TIMER) {
SetScriptResult(25);
}
}
@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), 180);
yield;
}
@Finalize {
}
/*Nonspell 2 (Patchouli):
Non-directional Laser with Bubble Spiral
Parameters:
+ Laser ring density
+ Laser spin speed
+ Spiral density
+ Spiral speed
+ Spiral angle offset
*/
task mainTask {
ObjMove_SetDestAtFrame(bossObj, STG_WIDTH/2, STG_HEIGHT/6+30, 45, LERP_DECELERATE);
wait(60);
int multiplier = 1;
while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > 0){
ascent(i in 0..denseLaser[difficultySelect]){
SpawnNDLaser(i, multiplier);
}
wait(timeDelayLaser[difficultySelect]);
float ang = 0;
loop(90/delaySpiral[difficultySelect]){
float ang2 = ang;
loop(denseSpiral[difficultySelect]){
int shot = CreateShotA1(bossX, bossY, speedSpiral[difficultySelect], ang2, KEV_BUBBLE_RED, 10);
if (multiplier == -1) {ObjShot_SetGraphic(shot, KEV_BUBBLE_AQUA);}
else{}
if(ObjEnemy_GetInfo(bossObj, INFO_LIFE) <= 0){Obj_Delete(shot);}
else{
_Delay(shot, 10);
_BulletRescale(shot, 0.65, true, 1);
Shoot1;
}
ang2 += 360/denseSpiral[difficultySelect];
}
ang += angleoffsetSpiral[difficultySelect]*-multiplier;
wait(delaySpiral[difficultySelect]);
}
multiplier *= -1;
yield;
}
}
task SpawnNDLaser(int ID, int multiplier){
float objcount = 0;
int obj = CreateStraightLaserA1(bossX + -45*cos(ID*360/denseLaser[difficultySelect]), bossY + -45*sin(ID*360/denseLaser[difficultySelect]), ID * 360/denseLaser[difficultySelect], STG_HEIGHT*1.5, 100, timeLaser[difficultySelect], KEV_AMULET_RED, timeDelayLaser[difficultySelect]);
if(ObjEnemy_GetInfo(bossObj, INFO_LIFE) == 0){Obj_Delete(obj);}
int shot = CreateShotA1(bossX + 120*cos(ID*360/denseLaser[difficultySelect]), bossY + 120*sin(ID*360/denseLaser[difficultySelect]), 0, ID * 360/denseLaser[difficultySelect], KEV_AURABALL_RED, 10);
if(ObjEnemy_GetInfo(bossObj, INFO_LIFE) == 0){Obj_Delete(shot);}
else{
_Delay(shot, 10);
_BulletRescale(shot, 2, true, 1);
Shoot1;
}
if(multiplier == -1){
ObjShot_SetGraphic(obj, KEV_AMULET_AQUA);
ObjShot_SetGraphic(shot, KEV_AURABALL_AQUA);
}
ObjShot_SetAutoDelete(obj, false);
ObjShot_SetAutoDelete(shot, false);
ObjRender_SetBlendType(obj, BLEND_ADD_ARGB);
ObjRender_SetBlendType(shot, BLEND_ADD_ARGB);
ObjLaser_SetInvalidLength(obj, 0.25, 0.25);
ObjStLaser_SetSource(obj, true);
ObjStLaser_SetEnd(obj, true);
ObjStLaser_SetEndGraphic(obj, ObjShot_GetImageID(obj)-33);
async{
wait(timeDelayLaser[difficultySelect]);
Shoot2;
}
while(!Obj_IsDeleted(obj)){
ObjMove_SetPosition(obj, bossX + -45*cos(ID*360/denseLaser[difficultySelect] + objcount), bossY + -45 * sin(ID*360/denseLaser[difficultySelect] + objcount));
ObjMove_SetPosition(shot, bossX + 120*cos(ID*360/denseLaser[difficultySelect] + objcount), bossY + 120*sin(ID*360/denseLaser[difficultySelect] + objcount));
ObjStLaser_SetAngle(obj, ID*360/denseLaser[difficultySelect] + objcount);
objcount += speedspinLaser[difficultySelect]*multiplier;
yield;
}
ObjShot_FadeDelete(shot);
}
/*task SpawnNDLaser(ID, multiplier){
let objcount = 0;
let obj = CreateStraightLaserA1(ObjMove_GetX(bossObj) + 60*cos(ID*360/denseLaser[difficultySelect]), ObjMove_GetY(bossObj) + 60*sin(ID*360/denseLaser[difficultySelect]), ID * 360/denseLaser[difficultySelect], 512, 24, 300, KEV_AMULET_RED, 60);
while(!Obj_IsDeleted(obj)){
ObjMove_SetPosition(obj, ObjMove_GetX(bossObj) + 60*cos(ID*360/denseLaser[difficultySelect] + objcount), ObjMove_GetY(bossObj) + 60*sin(ID*360/denseLaser[difficultySelect] + objcount));
ObjStLaser_SetAngle(obj, ID*360/denseLaser[difficultySelect] + objcount);
//objcount += 1 * multiplier;
objcount += 0.5;
yield;
}
}*/
task endingnew(){
while(ObjEnemy_GetInfo(bossObj, INFO_LIFE)>0){
yield;
}
_GoToBrazil(objScene, bossObj, 12, 24);
wait(120);
ObjSound_SetVolumeRate(fire2, 20);
CloseScript(GetOwnScriptID);
}