ScarletBlackMarket/script/game/Non3.dnh

355 lines
8.1 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#TouhouDanmakufu[Single]
#ScriptVersion[3]
#Title["Remilia Nonspell 3"]
#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:
// Trail Burst
- Density of red bubble spiral
- Angular velocity of bubbles
- Speed of bubbles
- Density of each bullet curve left behind
- Delay between each bullet in curve
- Delay between each bullet curve
- Movement speed of bullet curve
- Delay between trail and aimed burst
*/
int[] denseTrailSpiral = [7, 8, 10];
float[] wvelTrailBubble = [2.5, 3.5, 4.5];
float[] spdTrailBubble = [13, 14, 16];
int[] denseTrailCurve = [1, 1, 1];
int[] delayCurveIndividual = [0, 0, 0];
int[] delayCurve = [8, 7, 6];
float[] speedCurve = [5, 6, 7];
int[] delayTrailAimed = [110, 100, 90];
/*
// Aimed Burst
- Density of red bubble spiral
- Angular velocity of bubbles
- Speed of bubbles
- Delay between each bullet left behind
- Bullet acceleration
- Bullet max speed
// Final Trail Burst
See trail burst above but x2.
- Delay between the two trail burst
*/
int[] denseAimedSpiral = [9, 10, 11];
float[] wvelAimedBubble = [1.15, 1.35, 1.7];
float[] spdAimedBubble = [12, 14, 16];
int[] delayAimed = [12, 10, 8];
float[] accelAimed = [8/60, 9/50, 10/40];
float[] maxspdAimed = [8, 9, 10];
int[] delayBeforeAim = [40, 30, 20];
int[] delayFinalBurst = [45, 35, 30];
int[] thresholdStopSpin = [80, 70, 60];
// 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 = 1; // 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 1:
Reference to Remi final from EoSD (Red Magic/Scarlet Gensokyo).
Fires red bubbles that leave behind trails of bullets.
See: My BHA5 scripts second nonspell
Parameters:
// Trail Burst
- Density of red bubble spiral
- Angular velocity of bubbles
- Speed of bubbles
- Density of each bullet curve left behind
- Delay between each bullet in curve
- Delay between each bullet curve
- Movement speed of bullet curve
- Delay between trail and aimed burst
// Aimed Burst
- Density of red bubble spiral
- Angular velocity of bubbles
- Speed of bubbles
- Delay between each bullet left behind
- Bullet acceleration
- Bullet max speed
// Final Trail Burst
See trail burst above but x2.
- Delay between the two trail burst
*/
task mainTask {
while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > 0){
FireTrail(rand(1.5*STG_WIDTH/8, 2.5*STG_WIDTH/8));
FireAimed(rand(6.5*STG_WIDTH/8, 7.5*STG_WIDTH/8));
wait(delayTrailAimed[difficultySelect]/2);
FireAimed(rand(1.5*STG_WIDTH/8, 2.5*STG_WIDTH/8));
FireTrail(rand(6.5*STG_WIDTH/8, 7.5*STG_WIDTH/8));
wait(delayTrailAimed[difficultySelect]*1.25);
}
}
function <void> FireTrail(destX){
//float destX = rand(1.5*STG_WIDTH/8, 2.5*STG_WIDTH/8);
ObjMove_SetDestAtFrame(bossObj, destX, STG_HEIGHT/4, 30, LERP_DECELERATE);
wait(30);
float ang = GetAngleToPlayer(bossObj);
loop(denseTrailSpiral[difficultySelect]){
int shot = CreateShotA2(bossX, bossY, spdTrailBubble[difficultySelect], ang, 0, spdTrailBubble[difficultySelect], wvelTrailBubble[difficultySelect], KEV_BUBBLE_RED, 5);
ObjMove_AddPatternA2(shot, thresholdStopSpin[difficultySelect], NO_CHANGE, NO_CHANGE, NO_CHANGE, NO_CHANGE, wvelTrailBubble[difficultySelect]*0.25);
if(ObjEnemy_GetInfo(bossObj, INFO_LIFE) == 0){Obj_Delete(shot);}
else{
_Delay(shot, 10);
_BulletRescale(shot, 0.85, true, 1);
Shoot1;
}
_ShotTrail(shot, ang);
ang += 360/denseTrailSpiral[difficultySelect];
}
wait(delayTrailAimed[difficultySelect]);
}
task _ShotTrail(shot, ang){
wait(10);
int del = 5;
async{
ObjShot_SetAutoDelete(shot, false);
wait(thresholdStopSpin[difficultySelect]+30);
ObjShot_SetAutoDelete(shot, true);
}
while(!Obj_IsDeleted(shot) && ObjMove_GetY(shot) <= STG_HEIGHT-30 && ObjEnemy_GetInfo(bossObj, INFO_LIFE) > 0){
Shoot2;
loop(denseTrailCurve[difficultySelect]){
float x2 = ObjMove_GetX(shot);
float y2 = ObjMove_GetY(shot);
let bullet = CreateShotA1(x2, y2, 0, ObjMove_GetAngle(shot), KEV_AURABALL_RED, 15);
if(Obj_IsDeleted(shot)){Obj_Delete(bullet);}
Obj_SetRenderPriorityI(bullet, Obj_GetRenderPriorityI(shot)+1);
ObjMove_AddPatternA2(bullet, 60, NO_CHANGE, NO_CHANGE, -accelAimed[difficultySelect], -speedCurve[difficultySelect], 0);
_BulletRescale(bullet, 0.6, true, 1);
_Delay(bullet, 15);
wait(delayCurveIndividual[difficultySelect]);
}
wait(delayCurve[difficultySelect]);
del += 5;
}
}
function <void> FireAimed(destX){
//float destX = rand(6.5*STG_WIDTH/8, 7.5*STG_WIDTH/8);
ObjMove_SetDestAtFrame(bossObj, destX, STG_HEIGHT/4, 30, LERP_DECELERATE);
wait(30);
float ang = GetAngleToPlayer(bossObj);
loop(denseAimedSpiral[difficultySelect]){
int shot = CreateShotA2(bossX, bossY, spdAimedBubble[difficultySelect], ang, 0, spdAimedBubble[difficultySelect], -1*wvelAimedBubble[difficultySelect], KEV_BUBBLE_LAVENDER, 5);
ObjMove_AddPatternA2(shot, thresholdStopSpin[difficultySelect], NO_CHANGE, NO_CHANGE, NO_CHANGE, NO_CHANGE, wvelTrailBubble[difficultySelect]*-0.25); // Stop spinning after a while
if(ObjEnemy_GetInfo(bossObj, INFO_LIFE) == 0){Obj_Delete(shot);}
else{
_Delay(shot, 10);
_BulletRescale(shot, 0.85, true, 1);
Shoot1;
}
_ShotAimed(shot, ang);
ang += 360/denseAimedSpiral[difficultySelect];
}
wait(delayTrailAimed[difficultySelect]);
}
task _ShotAimed(shot, ang){
wait(10);
int del = 1;
async{
ObjShot_SetAutoDelete(shot, false);
wait(thresholdStopSpin[difficultySelect]+30);
ObjShot_SetAutoDelete(shot, true);
}
while(!Obj_IsDeleted(shot) && ObjMove_GetY(shot) <= STG_HEIGHT-30 && ObjEnemy_GetInfo(bossObj, INFO_LIFE) > 0){
Shoot2;
float x2 = ObjMove_GetX(shot);
float y2 = ObjMove_GetY(shot);
let bullet = CreateShotA1(x2, y2, 0, ObjMove_GetAngle(shot), KEV_KNIFE_LAVENDER, 15);
if(Obj_IsDeleted(shot)){Obj_Delete(bullet);}
Obj_SetRenderPriorityI(bullet, Obj_GetRenderPriorityI(shot)+1);
Pattern(bullet, del);
task Pattern(bullet, del){
float ang = ObjMove_GetAngle(bullet);
ascent(i in 0..10){
ObjMove_AddPatternA2(bullet, delayBeforeAim[difficultySelect]-del+i, NO_CHANGE, Interpolate_Decelerate(ang, GetAngleToPlayer(bullet), i/10), accelAimed[difficultySelect], maxspdAimed[difficultySelect], 0);
yield;
}
}
_BulletRescale(bullet, 1.25, true, 1);
_Delay(bullet, 15);
wait(delayAimed[difficultySelect]);
del += 1;
}
ObjMove_AddPatternA2(shot, 80, NO_CHANGE, NO_CHANGE, NO_CHANGE, NO_CHANGE, 0); // Stop spinning after a while
}
task endingnew(){
while(ObjEnemy_GetInfo(bossObj, INFO_LIFE)>0){
yield;
}
_GoToBrazil(objScene, bossObj, 12, 24);
wait(120);
ObjSound_SetVolumeRate(fire2, 20);
CloseScript(GetOwnScriptID);
}