Cirno2022/script/game/Non1.dnh

267 lines
5.4 KiB
Plaintext
Raw Normal View History

#TouhouDanmakufu[Single]
#ScriptVersion[3]
#Title["Remilia Nonspell 1"]
#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:
- Density of red bubble spiral
- Delay between red bubble firing
- Speed of red bubbles
- Density of each bullet curve
- Angle difference between each bullet in curve
- Density of blue spiral (how many curves in one spiral)?
- Delay of blue firing
- Speed of blue spiral*/
int[] denseBubble = [8, 9, 10];
int[] delayBubble = [15, 12, 10];
float[] speedBubble = [8, 9, 9];
int[] denseCurve = [5, 6, 7];
float[] offsetCurve = [2, 2.4, 4.25];
int[] denseSpiral = [6, 7, 8];
int[] delaySpiral = [10, 8, 10];
int[] speedSpiral = [6, 8, 8];
// Includes ahoy
#include "script/KevinSystem/Universal_Lib.txt" // The library to include all libraries :sans: :nail_care:
@Initialize {
//SetIntersectionVisualization(true);
SetAutoDeleteObject(true);
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_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 1:
Reference to Remi non 1 from EoSD.
Remi fires a light spiral of red bubbles while also firing a spiral of blue bullet curves in reverse.
Parameters:
- Density of red bubble spiral
- Delay between red bubble firing
- Speed of red bubbles
- Density of each bullet curve
- Angle difference between each bullet in curve
- Density of blue spiral (how many curves in one spiral)?
- Delay of blue firing
- Speed of blue spiral
*/
task mainTask {
MoveToPosition();
FireBubble();
FireSpiral();
}
function <void> MoveToPosition(){
ObjMove_SetDestAtFrame(bossObj, STG_WIDTH/2, STG_HEIGHT/6+30, 90, LERP_DECELERATE);
wait(90);
}
task FireBubble(){
float ang = GetAngleToPlayer(bossObj);
int multiplier = 1;
if(difficultySelect < 1){
while(!ObjEnemy_GetInfo(bossObj, INFO_LIFE) <= 0){
loop(8){
ascent(i in 0..denseBubble[difficultySelect]){
int shot = CreateShotA1(bossX, bossY, speedBubble[difficultySelect], ang + 360/(denseBubble[difficultySelect])*i, KEV_BUBBLE_RED, 0);
if(ObjEnemy_GetInfo(bossObj, INFO_LIFE) == 0){Obj_Delete(shot);}
else{
_Delay(shot, 10);
_BulletRescale(shot, 0.65, true, 1);
Shoot2;
}
}
wait(delayBubble[difficultySelect]);
ang += (360/(denseBubble[difficultySelect]))/3;
}
ang = GetAngleToPlayer(bossObj);
}
}
else{
while(!ObjEnemy_GetInfo(bossObj, INFO_LIFE) <= 0){
loop(8){
ascent(i in 0..denseBubble[difficultySelect]){
int shot = CreateShotA1(bossX, bossY, speedBubble[difficultySelect], ang + 360/(denseBubble[difficultySelect])*i, KEV_BUBBLE_RED, 0);
if(ObjEnemy_GetInfo(bossObj, INFO_LIFE) == 0){Obj_Delete(shot);}
else{
_Delay(shot, 10);
_BulletRescale(shot, 0.65, true, 1);
Shoot2;
}
}
wait(delayBubble[difficultySelect]);
ang += (360/(denseBubble[difficultySelect]))/3*multiplier;
}
ang = GetAngleToPlayer(bossObj);
multiplier *= -1;
}
}
}
task FireSpiral(){
float startAng = 0;
float startAngWhole = 0;
int multiplier = 1;
while(!ObjEnemy_GetInfo(bossObj, INFO_LIFE) <= 0){
startAngWhole = GetAngleToPlayer(bossObj);
startAng = startAngWhole;
loop(5){
ascent(i in 0..denseCurve[difficultySelect]){
startAng -= offsetCurve[difficultySelect]*multiplier;
ascent(j in -1..denseSpiral[difficultySelect]){
float ang = startAng + (360/denseSpiral[difficultySelect])*j;
int bullet = CreateShotA1(bossX, bossY, speedSpiral[difficultySelect], ang, KEV_BALL_AQUA, 5);
if(ObjEnemy_GetInfo(bossObj, INFO_LIFE) <= 0){Obj_Delete(bullet);}
else{
_Delay(bullet, 5);
_BulletRescale(bullet, 0.6, true, 1);
Obj_SetRenderPriorityI(bullet, 51);
ObjRender_SetBlendType(bullet, BLEND_ALPHA);
}
}
//Shoot2;
wait(2);
}
startAng -= (360/(denseSpiral[difficultySelect]))/2;
wait(delaySpiral[difficultySelect]);
if(difficultySelect >= 1){multiplier *= -1;} else {} // Special behaviour for Hyper/Unparalleled
}
}
}
task endingnew(){
while(ObjEnemy_GetInfo(bossObj, INFO_LIFE)>0){
yield;
}
_GoToBrazil(objScene, bossObj, 12, 24);
wait(120);
ObjSound_SetVolumeRate(fire2, 20);
CloseScript(GetOwnScriptID);
}