commit 1746c4ee569b722ee5b966795f340199bcbc8117 Author: kevinmonitor Date: Mon Aug 22 16:59:37 2022 +0700 Boss Mode/Full boss fight added. Remilia sprite, background and ability card artworksadded. diff --git a/3drender/3dtimebicht.dnh b/3drender/3dtimebicht.dnh new file mode 100644 index 0000000..8ca842b --- /dev/null +++ b/3drender/3dtimebicht.dnh @@ -0,0 +1,187 @@ +// 3D STAGE TUTORIAL + +// X : horizontal, Y : vertical, Z : depth (close/near) + +// Stage script -> Set textures + +#TouhouDanmakufu[Stage] +#Title["3D Stages"] +#Text["Stage script for 3D practice"] +#ScriptVersion[3] +#System["script/KevinSystem/Kevin_System.txt"] + +let CSD = GetCurrentScriptDirectory; +let texturefloor = CSD ~ "sprite/dafloorEX.png"; +let texturewall = CSD ~ "sprite/damagicwall.png"; +let texturefog = CSD ~ "sprite/cardbg4.png"; + +// REMEMBER : set variable texturefloor as png because my ass internet +// can't download a simple png + +// ------- Function to create one floor piece -------// + +/* +SetAngleXYZ? + ++ Rotates/flips the 3D sprite around a X, Y, Z axis. ++ Direction is influenced by HOW THE CAMERA IS SET -> Setting the camera +correctly is important! + +X : horizontal +Y : vertical +Z : depth + +*/ + +function FloorCreation(locX,locY,locZ){ + let floorObj = ObjPrim_Create(OBJ_SPRITE_3D); + ObjPrim_SetTexture(floorObj,texturefloor); + Obj_SetRenderPriorityI(floorObj,20); + ObjSprite3D_SetSourceDestRect(floorObj,0,0,512,512); + ObjRender_SetScaleXYZ(floorObj,1,1,0); + ObjRender_SetZWrite(floorObj,true); + + ObjRender_SetAngleXYZ(floorObj,90,0,0); // Floor-styled render + + ObjRender_SetPosition(floorObj,locX,locY,locZ); // Positioning of floor, notice function parameters +} + +function WallCreation(locX,locY,locZ){ + let floorObj = ObjPrim_Create(OBJ_SPRITE_3D); + ObjPrim_SetTexture(floorObj,texturewall); + Obj_SetRenderPriorityI(floorObj,20); + ObjSprite3D_SetSourceDestRect(floorObj,0,0,1024,1024); + ObjRender_SetScaleXYZ(floorObj,0.5,1,0); + ObjRender_SetZWrite(floorObj,true); + + ObjRender_SetAngleXYZ(floorObj,0,90,0); // Wall-styled render + + ObjRender_SetPosition(floorObj,locX,locY,locZ); + +} + +function FogCreation(locX,locY,locZ){ + let floorObj = ObjPrim_Create(OBJ_SPRITE_3D); + ObjPrim_SetTexture(floorObj,texturefog); + Obj_SetRenderPriorityI(floorObj,20); + ObjSprite3D_SetSourceDestRect(floorObj,0,0,1024,1024); // Fully covers screen + ObjRender_SetScaleXYZ(floorObj,4,4,0); + ObjRender_SetZWrite(floorObj,true); + + // ObjRender_SetAngleXYZ(floorObj,0,0,0); -> NOT USED, + // as the fog will always be facing player + + ObjSprite3D_SetBillboard(floorObj,true); + ObjRender_SetPosition(floorObj,locX,locY,locZ); + +} + +@Initialize{ + // Call the task to start stage renders + //SetIntersectionVisualization(true); + StageTime; + scrollitbabe; +} + +@Event{ + +} + +@MainLoop{ + yield; +} + +@Finalize{ + +} + +task StageTime{ + + // Fog construction + SetFogEnable(true); + SetFogParam(1024,1536,20,15,35); + FogCreation(0,0,2048); + + // Stage construction, like cardboard house building + ascent(i in 0..4){ + FloorCreation(0,0,512*i); + yield; + } + ascent (i in 0..4){ + WallCreation(-256,256,512*i); + yield; + } + ascent (i in 0..4){ + WallCreation(256,256,512*i); + yield; + } + +} + +// Stage scrolling + +/* Guide : CAMERAS????? + +* AZIMUTH * + +SetCameraAzimuthAngle(0); - ????? +SetCameraElevationAngle(0); - How HIGH the camera is +SetCameraRadius(0); - How FAR the camera is + +* FOCUS * + +SetCameraFocusX(0); +SetCameraFocusY(0); +SetCameraFocusZ(0); + +* ????? * + +SetCameraYaw(0); +SetCameraPitch(0); +SetCameraRoll(0); +*/ +task scrollitbabe{ + let scroll = 0; + let ang = 0; + let theyaeur = -180; + // CAMERA SYSTEM handled here + + // Min/max camera render distance + SetCameraPerspectiveClip(16,6000); + + // Camera settings - TBE (to be explained) + async{ + loop{ + SetCameraAzimuthAngle(theyaeur); + theyaeur = Interpolate_Decelerate(-105, -115, cos(NormalizeAngle(ang))); + ang += 1; + yield; + } + } + + + SetCameraElevationAngle(15); + SetCameraRadius(64); + SetCameraFocusX(0); + SetCameraFocusY(512); + SetCameraFocusZ(-512); + + /* GUIDE : The scroll illusion + + Make a variable, add it to CameraZ + Count the variable to move CameraZ forward + At a certain point, reset it back to the beginning + Add fog, profit(?) */ + + loop{ + SetCameraFocusZ(-512+scroll); + if(scroll > 512){ + scroll = 0; + } + scroll+=24; + yield; + } + + // Maintaining the perfect illusion with Fog +} + diff --git a/3drender/all of these are taken from other scripts.txt b/3drender/all of these are taken from other scripts.txt new file mode 100644 index 0000000..e69de29 diff --git a/3drender/alright bestie learn these camera settings.PNG b/3drender/alright bestie learn these camera settings.PNG new file mode 100644 index 0000000..eda8172 Binary files /dev/null and b/3drender/alright bestie learn these camera settings.PNG differ diff --git a/3drender/simplicity_sakuraboogaloo.dnh b/3drender/simplicity_sakuraboogaloo.dnh new file mode 100644 index 0000000..39c1c27 --- /dev/null +++ b/3drender/simplicity_sakuraboogaloo.dnh @@ -0,0 +1,274 @@ +#TouhouDanmakufu[Single] +#ScriptVersion[3] +#Title["the fruit of your labors, part 1"] +#Text["ayyy lmao"] + +// Declaring variables + +// Boss positions + Boss graphic + Shot sheet + let bossObj; + let bossX = 0; //These are important + let bossY = 0; + + //Animation frames + let aniframe = 0; + let aniframe2 = 0; + + let imgBoss = "script/basic4/sprite/enm_yuyuko.png"; + let angleO = 90; + let wintery = "script/basic4/sprite/cardbg3.png"; + let sakura = "script/basic4/sprite/cardbg4.png"; + + let spellSFX = "script/basic4/sounds/cardstart.wav"; + let bossdefeatSFX = "script/basic4/sounds/bossdie.wav"; + + #include "script/default_system/Default_ShotConst.txt" // Shot sheet goes here, include DOES NOT include semicolon + #include "script/default_system/Default_Effect.txt" + +// Hell + +@Initialize { + + // Auto-delete objects when script ends + SetAutoDeleteObject(true); + + // Define a bossObj is boss, register into script + bossObj = ObjEnemy_Create(OBJ_ENEMY_BOSS); + ObjEnemy_Regist(bossObj); + + // Start position OUTSIDE playing bounds + ObjMove_SetPosition(bossObj,192,-100); + // Moving boss to x, y location at speed + ObjMove_SetDestAtSpeed(bossObj,192,120,4); + + // Load sounds + + LoadSound(spellSFX); + LoadSound(bossdefeatSFX); + + //Play sounds + + PlaySE(spellSFX); + + mainTask; +} + +@Event { + // Setting boss timer and life + alternative(GetEventType()) + + case(EV_REQUEST_LIFE) { + SetScriptResult(2500); + } + + case(EV_REQUEST_TIMER) { + SetScriptResult(30); + } + + case(EV_REQUEST_SPELL_SCORE) { + SetScriptResult(2500000); + } + +} + +//MainLoop - everything always happens, all the time +@MainLoop { + bossX = ObjMove_GetX(bossObj); + bossY = ObjMove_GetY(bossObj); + //The boss position is ALWAYS UPDATED + + // Collision for the shots and player + ObjEnemy_SetIntersectionCircleToShot(bossObj, bossX, bossY, 36); + ObjEnemy_SetIntersectionCircleToShot(bossObj, bossX, bossY, 18); + yield; // yielding mainloop tells the script to "look for other tasks" to perform +} + +@Finalize { + +} + +//Creating functions for simplicity +function wait(w) {loop(w) {yield;}} + +task mainTask { + renderBoss; + render; + BossMove; + ending; + shotyeet; +} + +// NEW : BACKGROUNDS AND SPELL OVERLAYS + +// Note : textures are objects + +task render { + let scrollTex = 0; + + // BG + let bgObj = ObjPrim_Create(OBJ_SPRITE_2D); + // NOTE : Obj_SetRenderPriorityI DIFFERENT FROM Obj_SetRenderPriority + Obj_SetRenderPriorityI(bgObj,20); + ObjPrim_SetTexture(bgObj,wintery); + ObjSprite2D_SetSourceRect(bgObj,0,0,512,512); + ObjSprite2D_SetDestRect(bgObj,0,0,GetStgFrameWidth,GetStgFrameHeight); + + // SPELL BG + let spellObj = ObjPrim_Create(OBJ_SPRITE_2D); + // RENDER PRIORITY NOTICE : OVERLAY ABOVE BG + Obj_SetRenderPriorityI(spellObj,21); + ObjPrim_SetTexture(spellObj,sakura); + ObjRender_SetBlendType(spellObj,BLEND_ADD_ARGB); // Blending option : ADDITIVE + Alpha + RGB (opacity + glow) + ObjRender_SetAlpha(spellObj,240); + ObjSprite2D_SetSourceRect(spellObj,0,0,1024,1024); + ObjSprite2D_SetDestRect(spellObj,0,0,GetStgFrameWidth,GetStgFrameHeight); + + // Scroll overlay while boss is alive + while(!Obj_IsDeleted(bossObj)){ + ObjSprite2D_SetSourceRect(spellObj,0-scrollTex,0-scrollTex,1024-scrollTex,1024-scrollTex); + scrollTex+=1; + yield; + } + Obj_Delete(spellObj); +} + +task fire { + let playerdir; + let newdir; + playerdir = GetAngleToPlayer(bossObj); + CreateShotA1(bossX,bossY,5,playerdir+10,55,5); + CreateShotA1(bossX,bossY,5,playerdir+5,55,5); + CreateShotA1(bossX,bossY,5,playerdir,55,5); + CreateShotA1(bossX,bossY,5,playerdir-5,55,5); + CreateShotA1(bossX,bossY,5,playerdir-10,55,5); + newdir = playerdir-15; + wait(5); + + loop(40){ + CreateShotA1(bossX,bossY,5,newdir+10,55,5); + CreateShotA1(bossX,bossY,5,newdir+5,55,5); + CreateShotA1(bossX,bossY,5,newdir,55,5); + CreateShotA1(bossX,bossY,5,newdir-5,55,5); + CreateShotA1(bossX,bossY,5,newdir-10,55,5); + newdir = newdir-15; + wait(5); + } +} + +task renderBoss { + // Declare local variables, used for this task only + let dir; + let speed; + + // Moved from @Initialize + + // Giving the bossObj a "texture" + ObjPrim_SetTexture(bossObj, imgBoss); + // Which part to render -> remember to base this on the sprite itself + ObjSprite2D_SetSourceRect(bossObj,0,0,128,128); + // Moving our boss around from "true centre" + ObjSprite2D_SetDestCenter(bossObj); + // Scaling the boss sprite + ObjRender_SetScaleXYZ(bossObj,1.2,1.2,0); + // While the boss is not defeated yet + + while (!Obj_IsDeleted(bossObj)){ // "!" mark means "OPPOSITE of whatever comes next, meaning overall : While boss is NOT DELETED" + + // Update boss speed/direction + dir = ObjMove_GetAngle(bossObj); + speed = ObjMove_GetSpeed(bossObj); + + // Actual code for animation handling + + // Idle animation + if(speed == 0){ + ObjRender_SetAngleXYZ(bossObj,0,0,0); + + // if (aniframe....) -> IF the aniframe is this value, SHOW this sprite image + if (aniframe < 15){ObjSprite2D_SetSourceRect(bossObj,0,0,128,128);} + if (aniframe >= 15 && aniframe < 30){ObjSprite2D_SetSourceRect(bossObj,0,128,128,256);} + if (aniframe >= 30 && aniframe < 45){ObjSprite2D_SetSourceRect(bossObj,0,256,128,384);} + if (aniframe >= 45){ObjSprite2D_SetSourceRect(bossObj,128,128,256,256);} + } + // Left/Right animation + else if (cos(dir)<0){ + + aniframe2=0; + aniframe2+=2; + if(aniframe2 > 60){aniframe2 = 15;} + + ObjRender_SetAngleXYZ(bossObj,0,0,0); + if (aniframe2 < 15){ObjSprite2D_SetSourceRect(bossObj,256,0,384,128);} + if (aniframe2 >= 15){ObjSprite2D_SetSourceRect(bossObj,256,128,384,256);} + } + + else if (cos(dir)>0){ + + aniframe2=0; + aniframe2+=2; + if(aniframe2 > 60){aniframe2 = 15;} + + ObjRender_SetAngleXYZ(bossObj,0,0,0); + if (aniframe2 < 15){ObjSprite2D_SetSourceRect(bossObj,256,256,384,384);} + if (aniframe2 >= 15){ObjSprite2D_SetSourceRect(bossObj,256,384,384,512);} + } + + //Counting aniframe - ++ = up 1 per frame + aniframe+=2; + //Resetting aniframe if over predefined value + if(aniframe > 60){aniframe = 0;} + + // These two code lines above will ensure the idle loop. + + yield; + } +} + +task BossMove{ + + wait(60); + fire; + wait(250); + + loop{ + while(ObjEnemy_GetInfo(bossObj,INFO_LIFE)<=0){return;} + ObjMove_SetDestAtSpeed(bossObj,rand(10,280),bossY,3); + wait(30); + fire; + wait(250); + yield; + } + +} + +task ending{ + // While the boss is still alive, keep yielding (script works normally) + + while(ObjEnemy_GetInfo(bossObj,INFO_LIFE)>0){ + yield; + } + + DeleteShotAll(TYPE_ALL,TYPE_ITEM); + PlaySE(bossdefeatSFX); + TExplosionA(bossX,bossY,10,0.5); + wait(120); + PlaySE(bossdefeatSFX); + Obj_Delete(bossObj); + TExplosionA(bossX,bossY,10,0.5); + wait(120); + CloseScript(GetOwnScriptID); +} + +// I SPENT TWO DAYS TO FIGURE THIS OUT LMAO + +task shotyeet{ + while(ObjEnemy_GetInfo(bossObj,INFO_LIFE)>0){ + yield; + } + + loop{ + DeleteShotAll(TYPE_ALL,TYPE_ITEM); + yield; + } + +} \ No newline at end of file diff --git a/3drender/sounds/bossdie.wav b/3drender/sounds/bossdie.wav new file mode 100644 index 0000000..3020f3e Binary files /dev/null and b/3drender/sounds/bossdie.wav differ diff --git a/3drender/sounds/cardget.wav b/3drender/sounds/cardget.wav new file mode 100644 index 0000000..9f7a6c6 Binary files /dev/null and b/3drender/sounds/cardget.wav differ diff --git a/3drender/sounds/cardstart.wav b/3drender/sounds/cardstart.wav new file mode 100644 index 0000000..ab3dcb1 Binary files /dev/null and b/3drender/sounds/cardstart.wav differ diff --git a/3drender/sounds/hina.mp3 b/3drender/sounds/hina.mp3 new file mode 100644 index 0000000..8c6f424 Binary files /dev/null and b/3drender/sounds/hina.mp3 differ diff --git a/3drender/sprite/cardbg3.png b/3drender/sprite/cardbg3.png new file mode 100644 index 0000000..abe2443 Binary files /dev/null and b/3drender/sprite/cardbg3.png differ diff --git a/3drender/sprite/cardbg4.png b/3drender/sprite/cardbg4.png new file mode 100644 index 0000000..00da818 Binary files /dev/null and b/3drender/sprite/cardbg4.png differ diff --git a/3drender/sprite/cirno.png b/3drender/sprite/cirno.png new file mode 100644 index 0000000..5cdd601 Binary files /dev/null and b/3drender/sprite/cirno.png differ diff --git a/3drender/sprite/dafloor.png b/3drender/sprite/dafloor.png new file mode 100644 index 0000000..ab7c265 Binary files /dev/null and b/3drender/sprite/dafloor.png differ diff --git a/3drender/sprite/dafloorEX.png b/3drender/sprite/dafloorEX.png new file mode 100644 index 0000000..abe2443 Binary files /dev/null and b/3drender/sprite/dafloorEX.png differ diff --git a/3drender/sprite/damagicwall.png b/3drender/sprite/damagicwall.png new file mode 100644 index 0000000..2540816 Binary files /dev/null and b/3drender/sprite/damagicwall.png differ diff --git a/3drender/sprite/enm_yuyuko.png b/3drender/sprite/enm_yuyuko.png new file mode 100644 index 0000000..99edb57 Binary files /dev/null and b/3drender/sprite/enm_yuyuko.png differ diff --git a/3drender/sprite/iamp_yuyu.png b/3drender/sprite/iamp_yuyu.png new file mode 100644 index 0000000..b1c57a2 Binary files /dev/null and b/3drender/sprite/iamp_yuyu.png differ diff --git a/3drender/sprite/quicknote_yuyuko.txt b/3drender/sprite/quicknote_yuyuko.txt new file mode 100644 index 0000000..ae0198a --- /dev/null +++ b/3drender/sprite/quicknote_yuyuko.txt @@ -0,0 +1 @@ +128 x 128 = 1 sprite (yuyuko) \ No newline at end of file diff --git a/ExRumia/DPS.dnh b/ExRumia/DPS.dnh new file mode 100644 index 0000000..5f94d6d --- /dev/null +++ b/ExRumia/DPS.dnh @@ -0,0 +1,245 @@ +#TouhouDanmakufu[Single] +#ScriptVersion[3] +#Title["DPS Test"] +#Text["thank you Daniel WishMakers"] +#System["script/KevinSystem/Kevin_System.txt"] + +//let shotSheet = GetCurrentScriptDirectory() ~ "./../shot/shot.txt"; + +int bossObj; // This is enemy 1 + +int enm2, enm3; // This is enemy 2 and 3 + +let timer = 0; +let timer2 = 0; +let timer3 = 0; +let timer4 = 0; + +//let phase = 0; +let angle = 0; +let angle2 = 0; +let angle3 = 0; +let angle4 = 0; + +let x = 0; +let y = 0; + +let image_angle = 0; +let HP = 10000000; //- (100 * difficulty); + +// This is for the damage showing +let gl_curDPS = 0; +let gl_curDPS2 = 0; +let gl_curDPS3 = 0; + +let gl_TimeSpent = 0; +let gl_TutorialStr = ""; +const let STR_START = "Release SHOT before testing DPS."; +const let STR_GO = "Press and hold SHOT to start testing DPS."; +const let STR_FINISH = "Release SHOT when you are finished testing DPS."; + +//#include "script/BHA5/script/Lib/BHA5_Lib.txt" + +#include "script/KevinSystem/Universal_Lib.txt" // The library to include all libraries :sans: :nail_care: + +@Event{ + alternative(GetEventType()) + case(EV_REQUEST_LIFE){ + SetScriptResult(HP); + } + case(EV_REQUEST_TIMER){ + SetScriptResult(9999); + } + case(EV_REQUEST_SPELL_SCORE){ + SetScriptResult(1000000); + } +} + +@Initialize{ + //Shot sheet + //LoadTexture(shotSheet); + //LoadEnemyShotData(shotSheet); + + SetPlayerLife(20); + + //Boss registration + bossObj = ObjEnemy_Create(OBJ_ENEMY_BOSS); + ObjEnemy_Regist(bossObj); + //SetIntersectionVisualization(true); + + let imgExRumia = GetModuleDirectory() ~ "script/ExRumia/ExRumia.png"; + ObjPrim_SetTexture(bossObj, imgExRumia); + ObjSprite2D_SetSourceRect(bossObj, 64, 1, 127, 64); + ObjSprite2D_SetDestCenter(bossObj); + ObjRender_SetScaleXYZ(bossObj, 1.5, 1.5, 1); + ObjRender_SetColor(bossObj, 0xB93C3C); + ObjMove_SetDestAtFrame(bossObj, STG_WIDTH/2, 550, 1); + + enm2 = ObjEnemy_Create(OBJ_ENEMY); + ObjEnemy_Regist(enm2); + //SetIntersectionVisualization(true); + + //let imgExRumia = GetModuleDirectory() ~ "script/ExRumia/ExRumia.png"; + ObjPrim_SetTexture(enm2, imgExRumia); + ObjSprite2D_SetSourceRect(enm2, 64, 1, 127, 64); + ObjSprite2D_SetDestCenter(enm2); + ObjRender_SetScaleXYZ(enm2, 1.5, 1.5, 1); + ObjRender_SetColor(enm2, 0xDC5959); + ObjMove_SetDestAtFrame(enm2, STG_WIDTH/2, 300, 1); + + ObjEnemy_SetMaximumDamage(enm2, 2000); + + enm3 = ObjEnemy_Create(OBJ_ENEMY); + ObjEnemy_Regist(enm3); + //SetIntersectionVisualization(true); + + //let imgExRumia = GetModuleDirectory() ~ "script/ExRumia/ExRumia.png"; + ObjPrim_SetTexture(enm3, imgExRumia); + ObjSprite2D_SetSourceRect(enm3, 64, 1, 127, 64); + ObjSprite2D_SetDestCenter(enm3); + ObjRender_SetScaleXYZ(enm3, 1.5, 1.5, 1); + ObjRender_SetColor(enm3, 0xFF8383); + ObjMove_SetDestAtFrame(enm3, STG_WIDTH/2, 50, 1); + + ObjEnemy_SetMaximumDamage(enm3, 2000); + + ObjEnemy_SetMaximumDamage(bossObj, 2000); + + main; + display; + TFinalize; +} + +@MainLoop{ + + ObjEnemy_SetIntersectionCircleToShot(bossObj,ObjMove_GetX(bossObj),ObjMove_GetY(bossObj),128); + ObjEnemy_SetIntersectionCircleToShot(enm2,ObjMove_GetX(enm2),ObjMove_GetY(enm2),128); + ObjEnemy_SetIntersectionCircleToShot(enm3,ObjMove_GetX(enm3),ObjMove_GetY(enm3),128); + + //ObjEnemy_SetIntersectionCircleToPlayer(bossObj,ObjMove_GetX(bossObj),ObjMove_GetY(bossObj),32); + + timer++; + timer2++; + x = ObjMove_GetX(bossObj); + y = ObjMove_GetY(bossObj); + ObjRender_SetAngleZ(bossObj,image_angle); + + //main; + yield; +} + +task TFinalize { + while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > 0){yield;} + Obj_Delete(bossObj); + DeleteShotAll(TYPE_ALL, TYPE_IMMEDIATE); + SetAutoDeleteObject(true); + CloseScript(GetOwnScriptID()); + return; +} + +task display { + let objText = CreateTextObject(100,300, 24, "Release SHOT to start testing DPS."); + let objMain = CreateTextObject(100,400, 24, "Avg DPS (Front): [r]Frames: "); + let objMain2 = CreateTextObject(100,500, 24, "Avg DPS (Middle): "); + let objMain3 = CreateTextObject(100,600, 24, "Avg DPS (Back): "); + + loop { + ObjText_SetText(objText, gl_TutorialStr); + ObjText_SetText(objMain, StringFormat("Avg DPS (Front): %f[r]Frames: %d", "fd", gl_curDPS, gl_TimeSpent)); + ObjText_SetText(objMain2, StringFormat("Avg DPS (Middle): %f", "f", gl_curDPS2)); + ObjText_SetText(objMain3, StringFormat("Avg DPS (Back): %f", "f", gl_curDPS3)); + yield; + } +} + +// thanks wish + +task main { + let count = 0; + let damage = 0; + let damage2 = 0; + let damage3 = 0; + + loop { + //Reinitialize + count = 0; + damage = 0; + damage2 = 0; + damage3 = 0; + ObjEnemy_SetLife(bossObj, HP); + ObjEnemy_SetLife(enm2, HP); + ObjEnemy_SetLife(enm3, HP); + gl_TutorialStr = STR_START; + + //Wait for shot to not be held. + while(count < 60) { + if (CheckShotRelease) { + count++; + } + else { + count = 0; + } + yield; + } + + //Wait until player starts pressing SHOT. + count = 0; + gl_TutorialStr = STR_GO; + + while(!CheckShotHeld) { + yield; + } + + while(CheckShotHeld) { + count++; + damage += (HP - ObjEnemy_GetInfo(bossObj, INFO_LIFE)); + damage2 += (HP - ObjEnemy_GetInfo(enm2, INFO_LIFE)); + damage3 += (HP - ObjEnemy_GetInfo(enm3, INFO_LIFE)); + ObjEnemy_SetLife(bossObj, HP); + ObjEnemy_SetLife(enm2, HP); + ObjEnemy_SetLife(enm3, HP); + gl_TimeSpent = count; + if (count % 60 == 0) { + gl_curDPS = damage; + gl_curDPS2 = damage2; + gl_curDPS3 = damage3; + gl_TutorialStr = STR_FINISH; + damage = 0; + damage2 = 0; + damage3 = 0; + } + yield; + } + + } +} + +function CheckShotRelease { + return ((GetVirtualKeyState(VK_SHOT) == KEY_PULL) || (GetVirtualKeyState(VK_SHOT) == KEY_FREE)); +} + +function CheckShotHeld { + return ((GetVirtualKeyState(VK_SHOT) == KEY_PUSH) || (GetVirtualKeyState(VK_SHOT) == KEY_HOLD)); +} + +//mkm fxn +function CreateTextObject(let mx, let my, let size, let text) +{ + let obj = ObjText_Create(); + ObjText_SetText(obj, text); + ObjText_SetFontSize(obj, size); + ObjText_SetFontBold(obj, true); + ObjText_SetFontColorTop(obj, 128, 128, 255); + ObjText_SetFontColorBottom(obj, 64, 64, 255); + ObjText_SetFontBorderType(obj, BORDER_FULL); + ObjText_SetFontBorderColor(obj,255, 255, 255); + ObjText_SetFontBorderWidth(obj, 2); + Obj_SetRenderPriorityI(obj, 10); + ObjRender_SetX(obj, mx); + ObjRender_SetY(obj, my); + return obj; +} + + + + diff --git a/ExRumia/ExRumia(星符「ミッドナイトレヴァリエ」).jpg b/ExRumia/ExRumia(星符「ミッドナイトレヴァリエ」).jpg new file mode 100644 index 0000000..f227107 Binary files /dev/null and b/ExRumia/ExRumia(星符「ミッドナイトレヴァリエ」).jpg differ diff --git a/ExRumia/ExRumia.png b/ExRumia/ExRumia.png new file mode 100644 index 0000000..1a065a8 Binary files /dev/null and b/ExRumia/ExRumia.png differ diff --git a/ExRumia/ExRumia01.txt b/ExRumia/ExRumia01.txt new file mode 100644 index 0000000..31be75d Binary files /dev/null and b/ExRumia/ExRumia01.txt differ diff --git a/ExRumia/ExRumiaSpell01.txt b/ExRumia/ExRumiaSpell01.txt new file mode 100644 index 0000000..ed0cd8a Binary files /dev/null and b/ExRumia/ExRumiaSpell01.txt differ diff --git a/ExRumia/ExRumia_Package_Main.txt b/ExRumia/ExRumia_Package_Main.txt new file mode 100644 index 0000000..7827208 Binary files /dev/null and b/ExRumia/ExRumia_Package_Main.txt differ diff --git a/ExRumia/ExRumia_Package_ReplaySelectScene.txt b/ExRumia/ExRumia_Package_ReplaySelectScene.txt new file mode 100644 index 0000000..400c08d Binary files /dev/null and b/ExRumia/ExRumia_Package_ReplaySelectScene.txt differ diff --git a/ExRumia/ExRumia_Plural.txt b/ExRumia/ExRumia_Plural.txt new file mode 100644 index 0000000..4e10328 Binary files /dev/null and b/ExRumia/ExRumia_Plural.txt differ diff --git a/ExRumia/ExRumia_Stage.txt b/ExRumia/ExRumia_Stage.txt new file mode 100644 index 0000000..c63a5f3 Binary files /dev/null and b/ExRumia/ExRumia_Stage.txt differ diff --git a/ExRumia/Title.png b/ExRumia/Title.png new file mode 100644 index 0000000..48fcf53 Binary files /dev/null and b/ExRumia/Title.png differ diff --git a/ExRumia/replay/ExRumia_Stage_replay01.dat b/ExRumia/replay/ExRumia_Stage_replay01.dat new file mode 100644 index 0000000..b68b194 Binary files /dev/null and b/ExRumia/replay/ExRumia_Stage_replay01.dat differ diff --git a/Gay_Package.dnh b/Gay_Package.dnh new file mode 100644 index 0000000..5987498 Binary files /dev/null and b/Gay_Package.dnh differ diff --git a/KevinSound/bfxr_Charge.wav b/KevinSound/bfxr_Charge.wav new file mode 100644 index 0000000..4189ad1 Binary files /dev/null and b/KevinSound/bfxr_Charge.wav differ diff --git a/KevinSound/bfxr_EnemyBoom.wav b/KevinSound/bfxr_EnemyBoom.wav new file mode 100644 index 0000000..e642deb Binary files /dev/null and b/KevinSound/bfxr_EnemyBoom.wav differ diff --git a/KevinSound/bfxr_ExtendLegacy.wav b/KevinSound/bfxr_ExtendLegacy.wav new file mode 100644 index 0000000..1b3c22e Binary files /dev/null and b/KevinSound/bfxr_ExtendLegacy.wav differ diff --git a/KevinSound/bfxr_Pause.wav b/KevinSound/bfxr_Pause.wav new file mode 100644 index 0000000..5d4c354 Binary files /dev/null and b/KevinSound/bfxr_Pause.wav differ diff --git a/KevinSound/bfxr_RinnoBomb.wav b/KevinSound/bfxr_RinnoBomb.wav new file mode 100644 index 0000000..00d3b5b Binary files /dev/null and b/KevinSound/bfxr_RinnoBomb.wav differ diff --git a/KevinSound/bfxr_Select.wav b/KevinSound/bfxr_Select.wav new file mode 100644 index 0000000..2159021 Binary files /dev/null and b/KevinSound/bfxr_Select.wav differ diff --git a/KevinSound/bfxr_Shoot1.wav b/KevinSound/bfxr_Shoot1.wav new file mode 100644 index 0000000..cb0d724 Binary files /dev/null and b/KevinSound/bfxr_Shoot1.wav differ diff --git a/KevinSound/bfxr_Shoot2.wav b/KevinSound/bfxr_Shoot2.wav new file mode 100644 index 0000000..e6b7c32 Binary files /dev/null and b/KevinSound/bfxr_Shoot2.wav differ diff --git a/KevinSystem/Default_Background_IceMountain.txt b/KevinSystem/Default_Background_IceMountain.txt new file mode 100644 index 0000000..96074eb Binary files /dev/null and b/KevinSystem/Default_Background_IceMountain.txt differ diff --git a/KevinSystem/Default_Effect.txt b/KevinSystem/Default_Effect.txt new file mode 100644 index 0000000..bd0f0d3 Binary files /dev/null and b/KevinSystem/Default_Effect.txt differ diff --git a/KevinSystem/Default_EndScene.txt b/KevinSystem/Default_EndScene.txt new file mode 100644 index 0000000..1656d86 Binary files /dev/null and b/KevinSystem/Default_EndScene.txt differ diff --git a/KevinSystem/Default_Pause.txt b/KevinSystem/Default_Pause.txt new file mode 100644 index 0000000..38222f6 Binary files /dev/null and b/KevinSystem/Default_Pause.txt differ diff --git a/KevinSystem/Default_ReplaySaveScene.txt b/KevinSystem/Default_ReplaySaveScene.txt new file mode 100644 index 0000000..73a97ec Binary files /dev/null and b/KevinSystem/Default_ReplaySaveScene.txt differ diff --git a/KevinSystem/Default_ShotConst.txt b/KevinSystem/Default_ShotConst.txt new file mode 100644 index 0000000..00b50a9 Binary files /dev/null and b/KevinSystem/Default_ShotConst.txt differ diff --git a/KevinSystem/Default_ShotData.txt b/KevinSystem/Default_ShotData.txt new file mode 100644 index 0000000..ac117e2 Binary files /dev/null and b/KevinSystem/Default_ShotData.txt differ diff --git a/KevinSystem/Default_System_MagicCircle.txt b/KevinSystem/Default_System_MagicCircle.txt new file mode 100644 index 0000000..a25a0c3 Binary files /dev/null and b/KevinSystem/Default_System_MagicCircle.txt differ diff --git a/KevinSystem/GeneralSoundLib.txt b/KevinSystem/GeneralSoundLib.txt new file mode 100644 index 0000000..72819bb --- /dev/null +++ b/KevinSystem/GeneralSoundLib.txt @@ -0,0 +1,113 @@ +// Sound effects for boss go here. + +let lib = GetModuleDirectory() ~ "./script/KevinSystem/RyannSFX/ryannlib/"; +let libKev = "script/KevinSound/"; + +let SFXVol = GetAreaCommonData("Config", "SEVol", 100) * 0.01; + +// Sound paths + +let defeatsnd = lib ~ "../bossdie.wav"; +let lw = lib ~ "sp_lastword.wav"; + +let bullet1 = libKev ~ "bfxr_Shoot1.wav"; // Regular bullet sound +let bullet2 = libKev ~ "bfxr_Shoot2.wav"; // Shiny bullet sound + +let bullet3 = lib ~ "se_explode.wav"; +let lightning1 = lib ~ "se_don00.wav"; // Lightning sound 1/Explosion sound +let lightning2 = lib ~ "se_kira02.wav"; // Lightning sound 2 +let laze = lib ~ "se_lazer01.wav"; // Laser sound +let lazeB = lib ~ "se_lazer00.wav"; +let slash = lib ~ "se_slash.ogg"; + +let pause = libKev ~ "bfxr_Pause.wav"; +let chargeA = libKev ~ "bfxr_Charge.wav"; + +let selection = libKev ~ "se_select00.wav"; +let thunder = lib ~ "se_boon00.wav"; // Thunder/delay laser sound +let bomb = lib ~ "se_nep00.wav"; + +let extend = libKev ~ "bfxr_ExtendLegacy.wav"; // Clear game! + +let lenenwarn = lib ~ "../lenenwarning.wav"; +let chargeB = lib ~ "se_ch01.wav"; + +// Sound objects declarations + +let warnsfx = ObjSound_Create(); +let lwmusic = ObjSound_Create(); +let fire1 = ObjSound_Create(); +let fire2 = ObjSound_Create(); +let fire3 = ObjSound_Create(); +let light1 = ObjSound_Create(); +let light2 = ObjSound_Create(); +let laser = ObjSound_Create(); +let laserB = ObjSound_Create(); +let charge = ObjSound_Create(); +let phase = ObjSound_Create(); +let grz = ObjSound_Create(); +let swing = ObjSound_Create(); +let pausesfx = ObjSound_Create(); +let choose = ObjSound_Create(); +let thundersfx = ObjSound_Create(); +let bombsfx = ObjSound_Create(); +let extendsfx = ObjSound_Create(); +let icebreak = ObjSound_Create(); +let entrance = ObjSound_Create(); + +int sfxBoom = ObjSound_Create(); + +// Merge function that loads sounds and significantly decreases volume +// so the ears do not die from SFX overload. + +function LoadEx(targetobj, targetpath, targetvol){ + + ObjSound_Load(targetobj, targetpath); + ObjSound_SetVolumeRate(targetobj, targetvol * SFXVol); + ObjSound_SetSoundDivision(targetobj, SOUND_SE); +} + +task _SoundTask{ + + LoadEx(lwmusic, lw, 80); + LoadEx(fire1, bullet1, 35); + LoadEx(fire2, bullet2, 35); + LoadEx(light1, lightning1, 20); + LoadEx(light2, lightning2, 20); + LoadEx(laser, laze, 20); + LoadEx(laserB, lazeB, 20); + //LoadEx(grz, graze, 20); + LoadEx(swing, slash, 20); + LoadEx(pausesfx, pause, 20); + LoadEx(choose, selection, 18); + LoadEx(thundersfx, thunder, 25); + LoadEx(charge, chargeA, 40); + LoadEx(phase, chargeB, 25); + LoadEx(fire3, bullet3, 35); + LoadEx(bombsfx, bomb, 50); + LoadEx(extendsfx, extend, 50); + LoadEx(warnsfx, lenenwarn, 30); + LoadEx(icebreak, lib ~ "se_don00.wav", 60); + LoadEx(entrance, lib ~ "se_gun00.wav", 60); + + LoadEx(sfxBoom, libKev ~ "bfxr_EnemyBoom.wav", 45); +} + +// Functions to load sounds in scripts + +task Shoot1{ObjSound_Play(fire1); return;} +task Shoot2{ObjSound_Play(fire2); return;} +task Shoot3{ObjSound_Play(fire3); return;} +task Lit1{ObjSound_Play(light1); return;} +task Lit2{ObjSound_Play(light2); return;} +task GrazeSFX{ObjSound_Play(grz); return;} +task SwordSlashSFX{ObjSound_Play(swing); return;} +task PauseGameSFX{ObjSound_Play(pausesfx); return;} +task SelectOptionSFX{ObjSound_Play(choose); return;} +task LaserSFX{ObjSound_Play(laser); return;} +task LaserBSFX{ObjSound_Play(laserB); return;} +task ThunderSFX{ObjSound_Play(thundersfx); return;} +task ChargeSFX{ObjSound_Play(charge); return;} +task ChargeBreakSFX{ObjSound_Play(phase); return;} +task BombSFX{ObjSound_Play(bombsfx); return;} +task ExtendSFX{ObjSound_Play(extendsfx); return;} \ No newline at end of file diff --git a/KevinSystem/KevinShot/KevinShot_Alt_HD.png b/KevinSystem/KevinShot/KevinShot_Alt_HD.png new file mode 100644 index 0000000..446509f Binary files /dev/null and b/KevinSystem/KevinShot/KevinShot_Alt_HD.png differ diff --git a/KevinSystem/KevinShot/KevinShot_Alt_HD_Fireball.png b/KevinSystem/KevinShot/KevinShot_Alt_HD_Fireball.png new file mode 100644 index 0000000..a972d15 Binary files /dev/null and b/KevinSystem/KevinShot/KevinShot_Alt_HD_Fireball.png differ diff --git a/KevinSystem/KevinShot/misc.txt b/KevinSystem/KevinShot/misc.txt new file mode 100644 index 0000000..8dd8c0e --- /dev/null +++ b/KevinSystem/KevinShot/misc.txt @@ -0,0 +1,33 @@ +/* +For Danmakufu users. + +These functions are meant to be used alongside my pastel shotsheet due to the very high native resolution. +*/ + +// Bullet rescaling task, also has functionality for setting a new hitbox size relative to the new bullet graphic size. I highly recommend leaving hitboxscale to true. + +task _BulletRescale(target, float scale, bool hitboxscale, hitboxlevel){ + + ObjRender_SetScaleXYZ(target, scale, scale, 1); + + if (hitboxscale){ + ObjShot_SetIntersectionScaleXY(target, scale*hitboxlevel, scale*hitboxlevel); // Note the formula. The hitbox will have been scaled accordingly along with the bullet graphic, but you can use hitboxlevel to adjust the scale further. + return; + } + + else{return;} + +} + +// Delay task, provided by Naudiz (@Naudogs). For best effects, ensure destscale is equal to the resized scale of the bullet graphic, and orgscale be larger than it. + +task _Delay(target, del, orgscale, destscale, orgalpha, destalpha){ + + ObjShot_SetDelay(target, del); + ObjShot_SetDelayGraphic(target, ObjShot_GetImageID(target)); // unless you already have the ID in the function somewhere, in which case you can just use that, or use any other graphic + ObjShot_SetDelayMode(target, DELAY_LERP, LERP_ACCELERATE, LERP_DECELERATE); // delay mode, scale lerp, alpha lerp. Check ph3sx's New Functions Documentation.txt for more details. + ObjShot_SetDelayScaleParameter(target, destscale, orgscale, del); // lerps from orgscale to destscale scale in del frames (use the value from ObjShot_SetDelay for del) + ObjShot_SetDelayAlphaParameter(target, destalpha, orgalpha, del); // lerps from orgalpha to destalpha scale in del frames (use the value from ObjShot_SetDelay for del) + return; + +} \ No newline at end of file diff --git a/KevinSystem/KevinShot/readme.txt b/KevinSystem/KevinShot/readme.txt new file mode 100644 index 0000000..29850da --- /dev/null +++ b/KevinSystem/KevinShot/readme.txt @@ -0,0 +1,28 @@ +Kevin's Ultra HD/4K Pastel Shotsheet + +0.10a + +-------- + +Thank you for downloading and using my pastel shotsheet! + +This shotsheet features various common bullet types in a variety of "pastel" colors - colors lighter than your usual bullet graphics, but they should hopefully still be just as visible nonetheless. It has a *very* big native resolution (the first sheet is 4096x4096, with each bullet graphic being 256x256), and therefore is meant to be used with a similarly large game resolution and/or bullet rescaling functions. (See misc.txt for information regarding the latter in Danmakufu). It comes pre-packed with shot data and shot constant sheets meant for instant use in Danmakufu. + +The shotsheet is still heavily incomplete. In the works is a second sheet (4096x2048) featuring more bullet types (fireballs, lasers, bubbles), some changes to existing bullet graphics to improve aesthetic and visibility, and half-size versions for regular HD reoslutions. + +How to use: + +Extract the directory to an appropriate location in your project and to load them, just include the shot constant text file in your script file (shotconst_4K.txt). +-------- +The shot sheet images can be used in other engines as well. However it is the responsibility of the user to port the shot sheet data themselves. + +The shot sheet images are free to use NON-COMMERCIALLY. Please credit me (Kevinmonitor/Kevin Mink) fully! + +You are free to modify the shot sheets. Please state so if you do so however (for example, in the credits for your project you put a "modified by the author with permission" next to my attribution). + +Please do not redistribute these shotsheets on your own. +-------- +CONTACT: + +Discord: Kevinmonitor#6745 +Twitter: @kevinminh_alt diff --git a/KevinSystem/KevinShot/shotconst_HD.txt b/KevinSystem/KevinShot/shotconst_HD.txt new file mode 100644 index 0000000..0801a19 --- /dev/null +++ b/KevinSystem/KevinShot/shotconst_HD.txt @@ -0,0 +1,108 @@ + +local +{ + LoadTextureEx(GetCurrentScriptDirectory ~ "./KevinShot_Alt_HD.png", true, true); + LoadTextureEx(GetCurrentScriptDirectory ~ "./KevinShot_Alt_HD_Fireball.png", true, true); + LoadEnemyShotData(GetCurrentScriptDirectory ~ "shotdata_HD.txt"); + LoadEnemyShotData(GetCurrentScriptDirectory ~ "shotdata_HD_2.txt"); +} + +const KEV_BALL_RED = 2000; +const KEV_BALL_ORANGE = 2001; +const KEV_BALL_YELLOW = 2002; +const KEV_BALL_GREEN = 2003; +const KEV_BALL_AQUA = 2004; +const KEV_BALL_LAVENDER = 2005; +const KEV_BALL_PURPLE = 2006; +const KEV_BALL_PINK = 2007; +const KEV_BALL_WHITE = 2008; + +const KEV_PEOPLE_RED = 2011; +const KEV_PEOPLE_ORANGE = 2012; +const KEV_PEOPLE_YELLOW = 2013; +const KEV_PEOPLE_GREEN = 2014; +const KEV_PEOPLE_AQUA = 2015; +const KEV_PEOPLE_LAVENDER = 2016; +const KEV_PEOPLE_PURPLE = 2017; +const KEV_PEOPLE_PINK = 2018; +const KEV_PEOPLE_WHITE = 2019; + +const KEV_LEAF_RED = 2022; +const KEV_LEAF_ORANGE = 2023; +const KEV_LEAF_YELLOW = 2024; +const KEV_LEAF_GREEN = 2025; +const KEV_LEAF_AQUA = 2026; +const KEV_LEAF_LAVENDER = 2027; +const KEV_LEAF_PURPLE = 2028; +const KEV_LEAF_PINK = 2029; +const KEV_LEAF_WHITE = 2030; + +const KEV_AMULET_RED = 2033; +const KEV_AMULET_ORANGE = 2034; +const KEV_AMULET_YELLOW = 2035; +const KEV_AMULET_GREEN = 2036; +const KEV_AMULET_AQUA = 2037; +const KEV_AMULET_LAVENDER = 2038; +const KEV_AMULET_PURPLE = 2039; +const KEV_AMULET_PINK = 2040; +const KEV_AMULET_WHITE = 2041; + +const KEV_ARROW_RED = 2044; +const KEV_ARROW_ORANGE = 2045; +const KEV_ARROW_YELLOW = 2046; +const KEV_ARROW_GREEN = 2047; +const KEV_ARROW_AQUA = 2048; +const KEV_ARROW_LAVENDER = 2049; +const KEV_ARROW_PURPLE = 2050; +const KEV_ARROW_PINK = 2051; +const KEV_ARROW_WHITE = 2052; + +const KEV_BUTTERFLY_RED = 2055; +const KEV_BUTTERFLY_ORANGE = 2056; +const KEV_BUTTERFLY_YELLOW = 2057; +const KEV_BUTTERFLY_GREEN = 2058; +const KEV_BUTTERFLY_AQUA = 2059; +const KEV_BUTTERFLY_LAVENDER = 2060; +const KEV_BUTTERFLY_PURPLE = 2061; +const KEV_BUTTERFLY_PINK = 2062; +const KEV_BUTTERFLY_WHITE = 2063; + +const KEV_AURABALL_RED = 2066; +const KEV_AURABALL_ORANGE = 2067; +const KEV_AURABALL_YELLOW = 2068; +const KEV_AURABALL_GREEN = 2069; +const KEV_AURABALL_AQUA = 2070; +const KEV_AURABALL_LAVENDER = 2071; +const KEV_AURABALL_PURPLE = 2072; +const KEV_AURABALL_PINK = 2073; +const KEV_AURABALL_WHITE = 2074; + +const KEV_FIRE_RED = 2075; +const KEV_FIRE_ORANGE = 2076; +const KEV_FIRE_YELLOW = 2077; +const KEV_FIRE_GREEN = 2078; +const KEV_FIRE_AQUA = 2079; +const KEV_FIRE_LAVENDER = 2080; +const KEV_FIRE_PURPLE = 2081; +const KEV_FIRE_PINK = 2082; +const KEV_FIRE_WHITE = 2083; + +const KEV_BUBBLE_RED = 2086; +const KEV_BUBBLE_ORANGE = 2087; +const KEV_BUBBLE_YELLOW = 2088; +const KEV_BUBBLE_GREEN = 2089; +const KEV_BUBBLE_AQUA = 2090; +const KEV_BUBBLE_LAVENDER = 2091; +const KEV_BUBBLE_PURPLE = 2092; +const KEV_BUBBLE_PINK = 2093; + +const KEV_KNIFE_RED = 2096; +const KEV_KNIFE_ORANGE = 2097; +const KEV_KNIFE_YELLOW = 2098; +const KEV_KNIFE_GREEN = 2099; +const KEV_KNIFE_AQUA = 2100; +const KEV_KNIFE_LAVENDER = 2101; +const KEV_KNIFE_PURPLE = 2102; +const KEV_KNIFE_PINK = 2103; + + diff --git a/KevinSystem/KevinShot/shotdata_HD.txt b/KevinSystem/KevinShot/shotdata_HD.txt new file mode 100644 index 0000000..f849ce5 --- /dev/null +++ b/KevinSystem/KevinShot/shotdata_HD.txt @@ -0,0 +1,100 @@ +#UserShotData + +shot_image = "./KevinShot_Alt_HD.png" + +ShotData { id = 2000 rect = (0,0,128,128) collision = 26 delay_color = (255,255,255) } //RED +ShotData { id = 2001 rect = (128,0,256,128) collision = 26 delay_color = (255,255,255) } //ORANGE +ShotData { id = 2002 rect = (256,0,384,128) collision = 26 delay_color = (255,255,255) } //YELLOW +ShotData { id = 2003 rect = (384,0,512,128) collision = 26 delay_color = (255,255,255) } //GREEN +ShotData { id = 2004 rect = (512,0,640,128) collision = 26 delay_color = (255,255,255) } //AQUA +ShotData { id = 2005 rect = (640,0,768,128) collision = 26 delay_color = (255,255,255) } //LAVENDER +ShotData { id = 2006 rect = (768,0,896,128) collision = 26 delay_color = (255,255,255) } //PURPLE +ShotData { id = 2007 rect = (896,0,1024,128) collision = 26 delay_color = (255,255,255) } //PINK +ShotData { id = 2008 rect = (1024,0,1152,128) collision = 26 delay_color = (255,255,255) } //WHITE + +ShotData { id = 2011 rect = (0,128,128,256) collision = (17,0,-7) delay_color = (255,255,255) } //RED +ShotData { id = 2012 rect = (128,128,256,256) collision = (17,0,-7) delay_color = (255,255,255) } //ORANGE +ShotData { id = 2013 rect = (256,128,384,256) collision = (17,0,-7) delay_color = (255,255,255) } //YELLOW +ShotData { id = 2014 rect = (384,128,512,256) collision = (17,0,-7) delay_color = (255,255,255) } //GREEN +ShotData { id = 2015 rect = (512,128,640,256) collision = (17,0,-7) delay_color = (255,255,255) } //AQUA +ShotData { id = 2016 rect = (640,128,768,256) collision = (17,0,-7) delay_color = (255,255,255) } //LAVENDER +ShotData { id = 2017 rect = (768,128,896,256) collision = (17,0,-7) delay_color = (255,255,255) } //PURPLE +ShotData { id = 2018 rect = (896,128,1024,256) collision = (17,0,-7) delay_color = (255,255,255) } //PINK +ShotData { id = 2019 rect = (1024,128,1152,256) collision = (17,0,-7) delay_color = (255,255,255) } //WHITE + +ShotData { id = 2022 rect = (0,256,128,384) collision = (8,0,6) collision = (8,0,-6) delay_color = (255,255,255) } //RED +ShotData { id = 2023 rect = (128,256,256,384) collision = (8,0,6) collision = (8,0,-6) delay_color = (255,255,255) } //ORANGE +ShotData { id = 2024 rect = (256,256,384,384) collision = (8,0,6) collision = (8,0,-6) delay_color = (255,255,255) } //YELLOW +ShotData { id = 2025 rect = (384,256,512,384) collision = (8,0,6) collision = (8,0,-6) delay_color = (255,255,255) } //GREEN +ShotData { id = 2026 rect = (512,256,640,384) collision = (8,0,6) collision = (8,0,-6) delay_color = (255,255,255) } //AQUA +ShotData { id = 2027 rect = (640,256,768,384) collision = (8,0,6) collision = (8,0,-6) delay_color = (255,255,255) } //LAVENDER +ShotData { id = 2028 rect = (768,256,896,384) collision = (8,0,6) collision = (8,0,-6) delay_color = (255,255,255) } //PURPLE +ShotData { id = 2029 rect = (896,256,1024,384) collision = (8,0,6) collision = (8,0,-6) delay_color = (255,255,255) } //PINK +ShotData { id = 2030 rect = (1024,256,1152,384) collision = (8,0,6) collision = (8,0,-6) delay_color = (255,255,255) } //WHITE + +ShotData { id = 2033 rect = (0,384,128,512) collision = (28,0,0) delay_color = (255,255,255) } //RED +ShotData { id = 2034 rect = (128,384,256,512) collision = (28,0,0) delay_color = (255,255,255) } //ORANGE +ShotData { id = 2035 rect = (256,384,384,512) collision = (28,0,0) delay_color = (255,255,255) } //YELLOW +ShotData { id = 2036 rect = (384,384,512,512) collision = (28,0,0) delay_color = (255,255,255) } //GREEN +ShotData { id = 2037 rect = (512,384,640,512) collision = (28,0,0) delay_color = (255,255,255) } //AQUA +ShotData { id = 2038 rect = (640,384,768,512) collision = (28,0,0) delay_color = (255,255,255) } //LAVENDER +ShotData { id = 2039 rect = (768,384,896,512) collision = (28,0,0) delay_color = (255,255,255) } //PURPLE +ShotData { id = 2040 rect = (896,384,1024,512) collision = (28,0,0) delay_color = (255,255,255) } //PINK +ShotData { id = 2041 rect = (1024,384,1152,512) collision = (28,0,0) delay_color = (255,255,255) } //WHITE + +ShotData { id = 2044 rect = (0,512,128,640) collision = (8,0,20) delay_color = (255,255,255) } //RED +ShotData { id = 2045 rect = (128,512,256,640) collision = (8,0,20) delay_color = (255,255,255) } //ORANGE +ShotData { id = 2046 rect = (256,512,384,640) collision = (8,0,20) delay_color = (255,255,255) } //YELLOW +ShotData { id = 2047 rect = (384,512,512,640) collision = (8,0,20) delay_color = (255,255,255) } //GREEN +ShotData { id = 2048 rect = (512,512,640,640) collision = (8,0,20) delay_color = (255,255,255) } //AQUA +ShotData { id = 2049 rect = (640,512,768,640) collision = (8,0,20) delay_color = (255,255,255) } //LAVENDER +ShotData { id = 2050 rect = (768,512,896,640) collision = (8,0,20) delay_color = (255,255,255) } //PURPLE +ShotData { id = 2051 rect = (896,512,1024,640) collision = (8,0,20) delay_color = (255,255,255) } //PINK +ShotData { id = 2052 rect = (1024,512,1152,640) collision = (8,0,20) delay_color = (255,255,255) } //WHITE + +ShotData { id = 2055 rect = (0,640,128,768) collision = 12 delay_color = (255,255,255) } //RED +ShotData { id = 2056 rect = (128,640,256,768) collision = 12 delay_color = (255,255,255) } //ORANGE +ShotData { id = 2057 rect = (256,640,384,768) collision = 12 delay_color = (255,255,255) } //YELLOW +ShotData { id = 2058 rect = (384,640,512,768) collision = 12 delay_color = (255,255,255) } //GREEN +ShotData { id = 2059 rect = (512,640,640,768) collision = 12 delay_color = (255,255,255) } //AQUA +ShotData { id = 2060 rect = (640,640,768,768) collision = 12 delay_color = (255,255,255) } //LAVENDER +ShotData { id = 2061 rect = (768,640,896,768) collision = 12 delay_color = (255,255,255) } //PURPLE +ShotData { id = 2062 rect = (896,640,1024,768) collision = 12 delay_color = (255,255,255) } //PINK +ShotData { id = 2063 rect = (1024,640,1152,768) collision = 12 delay_color = (255,255,255) } //WHITE + +ShotData { id = 2066 rect = (0,768,128,896) collision = 18 delay_color = (255,255,255) } //RED +ShotData { id = 2067 rect = (128,768,256,896) collision = 18 delay_color = (255,255,255) } //ORANGE +ShotData { id = 2068 rect = (256,768,384,896) collision = 18 delay_color = (255,255,255) } //YELLOW +ShotData { id = 2069 rect = (384,768,512,896) collision = 18 delay_color = (255,255,255) } //GREEN +ShotData { id = 2070 rect = (512,768,640,896) collision = 18 delay_color = (255,255,255) } //AQUA +ShotData { id = 2071 rect = (640,768,768,896) collision = 18 delay_color = (255,255,255) } //LAVENDER +ShotData { id = 2072 rect = (768,768,896,896) collision = 18 delay_color = (255,255,255) } //PURPLE +ShotData { id = 2073 rect = (896,768,1024,896) collision = 18 delay_color = (255,255,255) } //PINK +ShotData { id = 2074 rect = (1024,768,1152,896) collision = 18 delay_color = (255,255,255) } //WHITE + +75 -> 83: fireballs + +ShotData { id = 2086 rect = (0,896,256,1152) collision = 48 delay_color = (255,255,255) } //RED +ShotData { id = 2087 rect = (256,896,512,1152) collision = 48 delay_color = (255,255,255) } //ORANGE +ShotData { id = 2088 rect = (512,896,768,1152) collision = 48 delay_color = (255,255,255) } //YELLOW +ShotData { id = 2089 rect = (768,896,1024,1152) collision = 48 delay_color = (255,255,255) } //GREEN +ShotData { id = 2090 rect = (1024,896,1280,1152) collision = 48 delay_color = (255,255,255) } //AQUA +ShotData { id = 2091 rect = (1280,896,1536,1152) collision = 48 delay_color = (255,255,255) } //LAVENDER +ShotData { id = 2092 rect = (1536,896,1792,1152) collision = 48 delay_color = (255,255,255) } //PURPLE +ShotData { id = 2093 rect = (1792,896,2048,1152) collision = 48 delay_color = (255,255,255) } //PINK + +ShotData { id = 2096 rect = (0,1152,128,1280) collision = (8.5,0,-9.5) collision = (8.5,0,6.5) collision = (8.5,0,19.5) collision = (6.5,0,32.5) delay_color = (255,255,255) } //RED +ShotData { id = 2097 rect = (128,1152,256,1280) collision = (8.5,0,-9.5) collision = (8.5,0,6.5) collision = (8.5,0,19.5) collision = (6.5,0,32.5) delay_color = (255,255,255) } //ORANGE +ShotData { id = 2098 rect = (256,1152,384,1280) collision = (8.5,0,-9.5) collision = (8.5,0,6.5) collision = (8.5,0,19.5) collision = (6.5,0,32.5) delay_color = (255,255,255) } //YELLOW +ShotData { id = 2099 rect = (384,1152,512,1280) collision = (8.5,0,-9.5) collision = (8.5,0,6.5) collision = (8.5,0,19.5) collision = (6.5,0,32.5) delay_color = (255,255,255) } //GREEN +ShotData { id = 2100 rect = (512,1152,640,1280) collision = (8.5,0,-9.5) collision = (8.5,0,6.5) collision = (8.5,0,19.5) collision = (6.5,0,32.5) delay_color = (255,255,255) } //AQUA +ShotData { id = 2101 rect = (640,1152,768,1280) collision = (8.5,0,-9.5) collision = (8.5,0,6.5) collision = (8.5,0,19.5) collision = (6.5,0,32.5) delay_color = (255,255,255) } //LAVENDER +ShotData { id = 2102 rect = (768,1152,896,1280) collision = (8.5,0,-9.5) collision = (8.5,0,6.5) collision = (8.5,0,19.5) collision = (6.5,0,32.5) delay_color = (255,255,255) } //PURPLE +ShotData { id = 2103 rect = (896,1152,1024,1280) collision = (8.5,0,-9.5) collision = (8.5,0,6.5) collision = (8.5,0,19.5) collision = (6.5,0,32.5) delay_color = (255,255,255) } //PINK +ShotData { id = 2104 rect = (1024,1152,1152,1280) collision = (8.5,0,-9.5) collision = (8.5,0,6.5) collision = (8.5,0,19.5) collision = (6.5,0,32.5) delay_color = (255,255,255) } //WHITE +ShotData { id = 2105 rect = (1152,1152,1280,1280) collision = (8.5,0,-9.5) collision = (8.5,0,6.5) collision = (8.5,0,19.5) collision = (6.5,0,32.5) delay_color = (255,255,255) } // +ShotData { id = 2106 rect = (1280,1152,1408,1280) collision = (8.5,0,-9.5) collision = (8.5,0,6.5) collision = (8.5,0,19.5) collision = (6.5,0,32.5) delay_color = (255,255,255) } // + + + + diff --git a/KevinSystem/KevinShot/shotdata_HD_2.txt b/KevinSystem/KevinShot/shotdata_HD_2.txt new file mode 100644 index 0000000..aa52f63 --- /dev/null +++ b/KevinSystem/KevinShot/shotdata_HD_2.txt @@ -0,0 +1,13 @@ +#UserShotData + +shot_image = "./KevinShot_Alt_HD_Fireball.png" + +ShotData { id = 2075 AnimationData { animation_data = ( 4, 0, 0, 128, 128); animation_data = ( 4, 128, 0, 256, 128); animation_data = ( 4, 256, 0, 384, 128); animation_data = ( 4, 384, 0, 512, 128); animation_data = ( 4, 512, 0, 640, 128); } render = ADD_ARGB collision = 13 delay_color = (255,255,255) } //RED +ShotData { id = 2076 AnimationData { animation_data = ( 4, 0, 128, 128, 256); animation_data = ( 4, 128, 128, 256, 256); animation_data = ( 4, 256, 128, 384, 256); animation_data = ( 4, 384, 128, 512, 256); animation_data = ( 4, 512, 128, 640, 256); } render = ADD_ARGB collision = 13 delay_color = (255,255,255) } //ORANGE +ShotData { id = 2077 AnimationData { animation_data = ( 4, 0, 256, 128, 384); animation_data = ( 4, 128, 256, 256, 384); animation_data = ( 4, 256, 256, 384, 384); animation_data = ( 4, 384, 256, 512, 384); animation_data = ( 4, 512, 256, 640, 384); } render = ADD_ARGB collision = 13 delay_color = (255,255,255) } //YELLOW +ShotData { id = 2078 AnimationData { animation_data = ( 4, 0, 384, 128, 512); animation_data = ( 4, 128, 384, 256, 512); animation_data = ( 4, 256, 384, 384, 512); animation_data = ( 4, 384, 384, 512, 512); animation_data = ( 4, 512, 384, 640, 512); } render = ADD_ARGB collision = 13 delay_color = (255,255,255) } //GREEN +ShotData { id = 2079 AnimationData { animation_data = ( 4, 0, 512, 128, 640); animation_data = ( 4, 128, 512, 256, 640); animation_data = ( 4, 256, 512, 384, 640); animation_data = ( 4, 384, 512, 512, 640); animation_data = ( 4, 512, 512, 640, 640); } render = ADD_ARGB collision = 13 delay_color = (255,255,255) } //AQUA +ShotData { id = 2080 AnimationData { animation_data = ( 4, 0, 640, 128, 768); animation_data = ( 4, 128, 640, 256, 768); animation_data = ( 4, 256, 640, 384, 768); animation_data = ( 4, 384, 640, 512, 768); animation_data = ( 4, 512, 640, 640, 768); } render = ADD_ARGB collision = 13 delay_color = (255,255,255) } //LAVENDER +ShotData { id = 2081 AnimationData { animation_data = ( 4, 0, 768, 128, 896); animation_data = ( 4, 128, 768, 256, 896); animation_data = ( 4, 256, 768, 384, 896); animation_data = ( 4, 384, 768, 512, 896); animation_data = ( 4, 512, 768, 640, 896); } render = ADD_ARGB collision = 13 delay_color = (255,255,255) } //PURPLE +ShotData { id = 2082 AnimationData { animation_data = ( 4, 0, 896, 128, 1024); animation_data = ( 4, 128, 896, 256, 1024); animation_data = ( 4, 256, 896, 384, 1024); animation_data = ( 4, 384, 896, 512, 1024); animation_data = ( 4, 512, 896, 640, 1024); } render = ADD_ARGB collision = 13 delay_color = (255,255,255) } //PINK +ShotData { id = 2083 AnimationData { animation_data = ( 4, 0, 1024, 128, 1152); animation_data = ( 4, 128, 1024, 256, 1152); animation_data = ( 4, 256, 1024, 384, 1152); animation_data = ( 4, 384, 1024, 512, 1152); animation_data = ( 4, 512, 1024, 640, 1152); } render = ADD_ARGB collision = 13 delay_color = (255,255,255) } //WHITE diff --git a/KevinSystem/Kevin_PlayerLib.txt b/KevinSystem/Kevin_PlayerLib.txt new file mode 100644 index 0000000..735ce60 --- /dev/null +++ b/KevinSystem/Kevin_PlayerLib.txt @@ -0,0 +1,345 @@ +/* -------------------------------------------------------------------- + + UNIVERSAL/GENERAL FUNCTIONS USED FOR PLAYERS + + These functions may/will be reused for future scripts as well. + + -------------------------------------------------------------------- +*/ + +#include "script/KevinSystem/kevin_system/Kevin_ItemConst.txt" +#include "script/KevinSystem/kevin_system/Kevin_ItemLib.txt" + +float universalAlpha = GetAreaCommonData("Config", "PlayerShotOpacity", 60); + +task _DeleteEffect(obj){ + ObjRender_SetBlendType(obj, BLEND_ADD_ARGB); + Obj_SetRenderPriorityI(obj, 41); + ascent(i in 0..30){ + ObjRender_SetAlpha(obj, Interpolate_Decelerate(100*(universalAlpha/100), 0, i/30)); + ObjRender_SetScaleXYZ(obj, Interpolate_Decelerate(0.5, 1.5, i/30)); + ObjMove_SetSpeed(obj, 12); + yield; + } + Obj_Delete(obj); +} + +// Renders player movement. Assumes that all sprites are ORGANIZED HORIZONTALLY IN THE SHEET. +// flipscale can only be 1 or -1. + +task _RenderPlayerMovement(int obj, int frame, int offsetleft, int offsettop, int width, int height, float flipscale, int frameno, int speed){ + + ObjSprite2D_SetSourceRect(obj, offsetleft+width*floor(frame/speed), offsettop, width+width*floor(frame/speed), offsettop+height); + ObjRender_SetScaleX(objPlayer, flipscale); + +} + +// Bullet rescaling... for player shots. +task _BulletRescalePlayer(int target, float scale, bool hitboxscale, float hitboxlevel){ + ObjRender_SetScaleXYZ(target, scale, scale, 1); + if (hitboxscale){ + ObjShot_SetIntersectionScaleXY(target, scale*hitboxlevel, scale*hitboxlevel); + } +} + +// Handles death/respawn sigil. Assumes sigils are 512x512 in size. +// If death is true (the player dies), the circle expands outwards. Otherwise (the player bombs/respawns), it shrinks inwards. + +task _SigilCall(bool death, texture, int rectleft, int recttop, int rectright, int rectbottom, int objPlayer, int time){ + + let DeathCircle = ObjPrim_Create(OBJ_SPRITE_2D); + + ObjPrim_SetTexture(DeathCircle,teamimg); + ObjSprite2D_SetSourceRect(DeathCircle, rectleft, recttop, rectright, rectbottom); + ObjSprite2D_SetDestCenter(DeathCircle); + ObjRender_SetBlendType(DeathCircle,BLEND_ALPHA); + ObjRender_SetAlpha(DeathCircle,255); + + ObjRender_SetPosition(DeathCircle,GetPlayerX(),GetPlayerY(),1); + Obj_SetRenderPriorityI(DeathCircle,Obj_GetRenderPriorityI(objPlayer)-1); + + alternative(death) + case(true){ + ascent(i in 0..time){ + float scaliealpha = Interpolate_Decelerate(255, 0, i/time); + float scaliesize = Interpolate_Decelerate(0.1, 1.5, i/time); + ObjRender_SetAlpha(DeathCircle, scaliealpha); + ObjRender_SetPosition(DeathCircle,GetPlayerX(),GetPlayerY(),1); + ObjRender_SetScaleXYZ(DeathCircle, scaliesize, scaliesize, 1); + yield; + } + } + case(false){ + ascent(i in 0..time){ + float scaliealpha = Interpolate_Accelerate(255, 0, i/time); + float scaliesize = Interpolate_Accelerate(1.5, 0.1, i/time); + ObjRender_SetAlpha(DeathCircle, scaliealpha); + ObjRender_SetPosition(DeathCircle,GetPlayerX(),GetPlayerY(),1); + ObjRender_SetScaleXYZ(DeathCircle, scaliesize, scaliesize, 1); + yield; + } + } + + + while(ObjRender_GetAlpha(DeathCircle) > 0){yield;} + Obj_Delete(DeathCircle); + +} + +// Handles the hitbox and its aura. What the fuck. + +task _HitboxRender( + bool playerdeathbool, int objPlayer, texture_hbox, texture_aura, + int rectleft_hbox, int recttop_hbox, int rectright_hbox, int rectbottom_hbox, + int rectleft_aura, int recttop_aura, int rectright_aura, int rectbottom_aura, + float scale_hbox, float scale_aura){ + + // Handle hitbox + bool visible = false; + int hitbox = ObjPrim_Create(OBJ_SPRITE_2D); + + ObjPrim_SetTexture(hitbox, texture_hbox); + ObjSprite2D_SetSourceRect(hitbox, rectleft_hbox, recttop_hbox, rectright_hbox, rectbottom_hbox); + ObjSprite2D_SetDestCenter(hitbox); + ObjRender_SetScaleXYZ(hitbox, scale_hbox, scale_hbox, 1); + ObjRender_SetBlendType(hitbox, BLEND_ALPHA); + Obj_SetRenderPriorityI(hitbox, 79); + + Obj_SetVisible(hitbox, false); + + // Handle hitbox's aura + + int aura = ObjPrim_Create(OBJ_SPRITE_2D); + + ObjPrim_SetTexture(aura, texture_aura); + ObjSprite2D_SetSourceRect(aura, rectleft_aura, recttop_aura, rectright_aura, rectbottom_aura); + ObjSprite2D_SetDestCenter(aura); + ObjRender_SetScaleXYZ(aura, scale_aura, scale_aura, 1); + ObjRender_SetAlpha(aura, 70); + //ObjRender_SetBlendType(aura, BLEND_ADD_ARGB); + Obj_SetRenderPriorityI(aura, Obj_GetRenderPriorityI(objPlayer)+3); + + Obj_SetVisible(aura, false); + + loop{ + if (visible && (!Obj_IsVisible(objPlayer) || GetVirtualKeyState(VK_SLOWMOVE) != KEY_HOLD)){ + visible = false; + Obj_SetVisible(hitbox, false); + Obj_SetVisible(aura, false); + } + else if (!visible && (Obj_IsVisible(objPlayer) && (GetVirtualKeyState(VK_SLOWMOVE) == KEY_HOLD || GetVirtualKeyState(VK_SLOWMOVE) == KEY_PUSH))){ + visible = true; + Obj_SetVisible(aura, true); + Obj_SetVisible(hitbox, true); + async{ + while(Obj_IsVisible(aura)){ + float curang = ObjRender_GetAngleZ(aura); + ObjRender_SetAngleZ(aura, curang+1); + yield; + } + } + async{ + ascent(i in 0..20){ + float scalie = Interpolate_Decelerate(scale_aura*1.5, scale_aura, i/20); + ObjRender_SetScaleXYZ(aura, scalie, scalie, 1); + yield; + } + } + + async{ + ascent(i in 0..20){ + float scalie = Interpolate_Decelerate(0, 80, i/20); + ObjRender_SetAlpha(aura, scalie); + yield; + } + } + } + ObjRender_SetPosition(hitbox, ObjMove_GetX(objPlayer), ObjMove_GetY(objPlayer), 1); + ObjRender_SetPosition(aura, ObjMove_GetX(objPlayer), ObjMove_GetY(objPlayer), 1); + yield; + } + +} + +/* +Simple function that handles player options. These options simply follow the player at an offset - they do not have any trajectories of their own like spinning around the player, etc. +If the options have animations, set triggeranimation to true and adjust the number of frames + speed using delay and frameno. +If the options rotate (in place), set triggerspin to true and adjust spinning speed using spinspeed. +If the options only appear unfocused or focused, set either onlyFocus or onlyUnfocus to true. Setting both to true or false makes the options always visible. +*/ + +function PlayerOption( + float offsetx, float offsety, + texture, + int left, int top, int right, int bottom, float scale, + int width, int animdelay, int frameno, bool triggeranimation, + bool triggerspin, float spinspeed, + bool onlyFocus, bool onlyUnfocus + ){ + + let option = ObjPrim_Create(OBJ_SPRITE_2D); + bool visible; + int animate = 0; + float optx; + float opty; + + ObjPrim_SetTexture(option, texture); + ObjSprite2D_SetSourceRect(option, left, top, right-1, bottom-1); // Allows the options to spin smoothly should the user choose to do so. + ObjSprite2D_SetDestCenter(option); + ObjRender_SetScaleXYZ(option, scale); + ObjRender_SetBlendType(option, BLEND_ALPHA); + ObjRender_SetAlpha(option, 225); + Obj_SetRenderPriorityI(option, 41); + ObjRender_SetPosition(option, offsetx, offsety, 1); + + // Animation + async{ + while(triggeranimation){ + ObjSprite2D_SetSourceRect(option, left+width*floor(animate/animdelay), top, right+width*floor(animate/animdelay)-1, bottom-1); + animate++; + if (animate >= animdelay*frameno){animate = 0;} + yield; + } + } + + // Rotation + async{ + float i = 0; + while(triggerspin){ + //ObjRender_SetPosition(option, GetPlayerX()+offsetx, GetPlayerY()+offsety, 1); + ObjRender_SetAngleZ(option, i); + i += spinspeed; + yield; + } + } + + // Follow + async{ + while(true){ + ObjRender_SetPosition(option, GetPlayerX()+offsetx, GetPlayerY()+offsety, 1); + yield; + } + } + + // Visibility + async{ + // Always visible + if((onlyFocus && onlyUnfocus) || (!onlyFocus && !onlyUnfocus)) { + loop + { + if(GetPlayerState != STATE_NORMAL && GetPlayerState != STATE_HIT){ObjRender_SetAlpha(option, max(0, ObjRender_GetAlpha(option)-15)); visible = false;} + else {ObjRender_SetAlpha(option, min(225, ObjRender_GetAlpha(option)+15)); visible = true;} + yield; + } + } + // Visible when focused only + else if(onlyFocus && !onlyUnfocus){ + loop + { + if((GetPlayerState != STATE_NORMAL && GetPlayerState != STATE_HIT) || GetVirtualKeyState(VK_SLOWMOVE) == KEY_FREE){ObjRender_SetAlpha(option, max(0, ObjRender_GetAlpha(option)-15)); visible = false;} + else {ObjRender_SetAlpha(option, min(225, ObjRender_GetAlpha(option)+15)); visible = true;} + yield; + } + } + // Visible when unfocused only + else if(!onlyFocus && onlyUnfocus){ + loop + { + if((GetPlayerState != STATE_NORMAL && GetPlayerState != STATE_HIT) || GetVirtualKeyState(VK_SLOWMOVE) != KEY_FREE){ObjRender_SetAlpha(option, max(0, ObjRender_GetAlpha(option)-15)); visible = false;} + else {ObjRender_SetAlpha(option, min(225, ObjRender_GetAlpha(option)+15)); visible = true;} + yield; + } + } + } + + function _FadeIn(){ + ascent(i in 0..15){ + ObjRender_SetAlpha(option, Interpolate_Decelerate(0, 225, i/15)); + yield; + } + } + + function _FadeOut(){ + ascent(i in 0..15){ + ObjRender_SetAlpha(option, Interpolate_Decelerate(225, 0, i/15)); + yield; + } + } + + return option; +} + +/* +------------------------------------------------------ + + POINTBLANK-PIV MECHANIC FUNCTIONS + Will be optimized somewhere down the line. + +------------------------------------------------------ +*/ + +// Selects an enemy in the @MainLoop-updated _enemyArray, executes _PetalDrop, and adds it to _existArray so the task isn't called again for the same enemy. maxX and maxY are the bounds of the playing field. + +task _Mechanic(bool playerdeathbool, int[] _enemyArray, int [] _existArray, float maxX, float maxY, int objPlayer, int bossScene, int maxrate, int addrate, float adddist){ + while(!playerdeathbool){ + _enemyArray = GetIntersectionRegistedEnemyID(); + bossScene = GetEnemyBossSceneObjectID(); + for each (int enemy in ref _enemyArray){ + float enemyX = ObjMove_GetX(enemy); + float enemyY = ObjMove_GetY(enemy); + if (0 < enemyX && enemyX < maxX && 0 < enemyY && enemyY < maxY && !contains(_existArray, enemy)){ + _PetalDrop(enemy, playerdeathbool, objPlayer, bossScene, maxrate, addrate, adddist); + _existArray = _existArray ~ [enemy]; + } + else{continue;} + } + yield; + } +} + +// Checks the boss scene type (nonspell/spell/last spell/invalid), the ID of the player object, and the target enemy. Drops petals with a type and drop rate that depends on the boss scene type and how close the player is to the target enemy. The last three parameters control the drop rate, and are significantly higher for Erika & Tenshi. + +task _PetalDrop(int target, bool playerdeathbool, int objPlayer, int bossScene, int maxrate, int addrate, float adddist){ + + while(!Obj_IsDeleted(target) && !playerdeathbool){ + float dist = hypot(ObjMove_GetX(target)-ObjMove_GetX(objPlayer), ObjMove_GetY(target)-ObjMove_GetY(objPlayer)); + let atktype = GetEnemyBossSceneObjectID(); + if(dist <= (GetStgFrameHeight()-100) && atktype != ID_INVALID && ObjEnemy_GetInfo(target, INFO_SHOT_HIT_COUNT) >= 1){ + + NotifyEventAll(EV_PIV_250, [ObjMove_GetX(target), ObjMove_GetY(target)]); + wait(maxrate + addrate*floor(dist/adddist)); + + } + else{yield;} + } + +} + +function _Create2DImage(imgpath, int[] rectarray){ + + int imgname = ObjPrim_Create(OBJ_SPRITE_2D); + ObjPrim_SetTexture(imgname, imgpath); + ObjSprite2D_SetSourceRect(imgname, rectarray); + ObjSprite2D_SetDestCenter(imgname); + //ObjRender_SetPosition(imgname, positionstart) + + return imgname; +} + +task _DeathbombWarning(imgpath, int[] imgrectarray, int deathbombframes, float basescale){ + + int circle = _Create2DImage(imgpath, imgrectarray); + Obj_SetRenderPriorityI(circle, 75); + ObjRender_SetAlpha(circle, 255); + ObjRender_SetPosition(circle, ObjRender_GetX(GetPlayerObjectID()), ObjRender_GetY(GetPlayerObjectID()), 1); + ObjRender_SetBlendType(circle, BLEND_INV_DESTRGB); + + ascent(i in 0..deathbombframes-1){ + ObjRender_SetScaleXYZ(circle, Interpolate_Accelerate(basescale, 0, i/(deathbombframes-1))); + yield; + } + + Obj_Delete(circle); + return; + +} \ No newline at end of file diff --git a/KevinSystem/Kevin_System.txt b/KevinSystem/Kevin_System.txt new file mode 100644 index 0000000..bfbe9f3 --- /dev/null +++ b/KevinSystem/Kevin_System.txt @@ -0,0 +1,862 @@ + +// SYSTEM FOR STATION GAME +let dirCurrent = GetCurrentScriptDirectory(); + +// Change accordingly! + +int offsetX = 1551; +int baseY = 155; +int spaceY = 135; +float scale = 1.15*1.6; + +int sel = 0; //" + +// Item, life, spell graphics + +let graphicimg = dirCurrent ~ "./img/yo.png"; +let lifebarimg = dirCurrent ~ "./img/lifebar.png"; +LoadTextureEx(graphicimg, true, true); + +/* +Lifebar empty = (5, 5, 534, 34) +Lifebar split = (6, 38, 18, 74) +Lifebar full = (5, 78, 16, 108) + +*/ + +// + +//#include "./../script/soundtask.txt" + +#include "script/KevinSystem/GeneralSoundLib.txt" + +@Initialize +{ + _SoundTask(); + + SetStgFrame(504, 0, 1415, 997, 20, 80); + + sel = prand_int(0, 99); + + SetPauseScriptPath(GetCurrentScriptDirectory() ~ "kevin_system/Kevin_Pause.txt"); + SetEndSceneScriptPath(GetCurrentScriptDirectory() ~ "kevin_system/Kevin_EndScene.txt"); + SetReplaySaveSceneScriptPath(GetCurrentScriptDirectory() ~ "kevin_system/Kevin_ReplaySave.txt"); + + InitFrame(); + + //TInstallFont(); Moved to package. + + TScore(); + //TGraze(); + //SetPlayerLife(9); + + LifeDisplay(); + SpellDisplay(); + + //THighScore(); + TValueDisplay(); + + StartItemScript(dirCurrent ~ "./kevin_system/KevinSystem_Item.txt"); + + //TExtendSystem(); + TBossLife(); + TBossTimer(); + TCurrentFps(); + TReplayFps(); + //_SoundTask; +} + +@MainLoop +{ + yield; +} + +@Event +{ + alternative(GetEventType()) + case(EV_START_BOSS_SPELL) + { + let path = dirCurrent ~ "Default_System_MagicCircle.txt"; + let id = LoadScript(path); + StartScript(id); + } + case(EV_GAIN_SPELL) + { + let objScene = GetEnemyBossSceneObjectID(); + let spellbonus = ObjEnemyBossScene_GetInfo(objScene, INFO_SPELL_SCORE); + TScoreAward(spellbonus); + } +} + +function CreateTextObject( + float mx, my, size, + string text, font, + int colorTop, colorBottom, + int borderColor, borderWidth, + int renderPriority + ){ + + let obj = ObjText_Create(); + ObjText_SetText(obj, text); + ObjText_SetFontSize(obj, size); + ObjText_SetFontType(obj, font); + ObjText_SetFontColorTop(obj, colorTop); + ObjText_SetFontColorBottom(obj, colorBottom); + ObjText_SetFontBorderType(obj, BORDER_FULL); + ObjText_SetFontBorderColor(obj, borderColor); + ObjText_SetFontBorderWidth(obj, borderWidth); + Obj_SetRenderPriorityI(obj, renderPriority); + ObjRender_SetX(obj, mx); + ObjRender_SetY(obj, my); + return obj; + +} + +// Grants extends based on score + +task TExtendSystem(){ + + // NEXT: Text (y around 650?) (x around 2250?) + + /*let NextText = + + CreateTextObject( + 1625, 465, 30, + "NEXT:", "Connecting Chain Handserif", + 0xA70053, 0xA70053, + 0xFFFFFF, 2, + 1 + );*/ + + //ObjText_SetFontBold(NextText, true); + // Indicates the score threshold needed for the next extend + + let ExtendThresholdText = + + CreateTextObject( + 250, 960, 24, + "", "Exotc350 DmBd BT", + 0xA70053, 0xA70053, + 0xFFFFFF, 2, + 21 + ); + + ObjText_SetFontBold(ExtendThresholdText, true); + ObjText_SetHorizontalAlignment(ExtendThresholdText, ALIGNMENT_RIGHT); + + int count = 0; + // Millions + let req = [ + + ]; + + if(GetCommonData("Difficulty", "Arcade") == "Arcade"){req = [20, 80, 200, 500, 800, 1200, 2500, 5000];} + else{req = [15, 50, 100, 180, 300, 600, 1000, 2000, 4000];} + + let next = 0; + + loop{ + count = (trunc(GetScore())/10)*10; + if(next <= length(req)-1){ + if(count >= req[next]*1000000){ + next++; + SetPlayerLife(GetPlayerLife+1); + ExtendSFX; + ExtendEffect; + } + } + if(next != 8){ObjText_SetText(ExtendThresholdText, "NEXT: " ~ DigitToCommaArray(req[next]*1000000));} + else{ObjText_SetText(ExtendThresholdText, "MAX EXTEND");} + yield; + } +} + +task ExtendEffect(){ + + int time = 30; + int timeDisappear = 30; + + float x = GetPlayerX(); + float y = GetPlayerY()-90; + + int extendText = CreateTextObject( + x, y, 75, + "Life[r]Extend!", "Exotc350 DmBd BT", + 0xFF61AE, 0xFFFFFF, + 0x5E0064, 6, + 42 + ); + + ObjText_SetLinePitch(extendText, -2); + ObjText_SetFontBold(extendText, true); + ObjText_SetHorizontalAlignment(extendText, ALIGNMENT_CENTER); + + ascent(i in 0..time){ + ObjRender_SetY(extendText, Interpolate_Decelerate(y, y-120, i/time)); + yield; + } + + wait(15); + + ascent(i in 0..timeDisappear){ + ObjRender_SetAlpha(extendText, Interpolate_Decelerate(255, 0, i/timeDisappear)); + yield; + } + Obj_Delete(extendText); + +} + +//---------------------------------------------------- +//枠外の背景表示 +//---------------------------------------------------- +function InitFrame() +{ + let path = GetCurrentScriptDirectory() ~ "img/ThiccHUD.png"; + //if(false){path = GetCurrentScriptDirectory() ~ "img/literallywhat.png";} + //else{path = GetCurrentScriptDirectory() ~ "img/altHUD.png";} + let obj = ObjPrim_Create(OBJ_SPRITE_2D); + LoadTextureEx(path, true, true); + ObjPrim_SetTexture(obj, path); + //ObjRender_SetScaleXYZ(obj, 0.5, 0.5, 1); + ObjRender_SetTextureFilterMag(obj, FILTER_NONE); + ObjRender_SetTextureFilterMin(obj, FILTER_NONE); + ObjRender_SetTextureFilterMip(obj, FILTER_NONE); + Obj_SetRenderPriority(obj, 0); + ObjSprite2D_SetSourceRect(obj, 0, 0, GetScreenWidth(), GetScreenHeight()); + ObjSprite2D_SetDestRect(obj, 0, 0, GetScreenWidth(), GetScreenHeight()); + + int diffText = CreateTextObject( + offsetX+150, baseY*0.3, 60, + "", "Exotc350 DmBd BT", + 0xFFFFFF, 0xFFFFFF, + 0xFFFFFF, 3, + 1 + ); + + ObjText_SetFontBold(diffText, true); + ObjText_SetHorizontalAlignment(diffText, ALIGNMENT_CENTER); + + /* + if(GetCommonData("Difficulty", "Arcade") == "Arcade"){ + ObjText_SetText(diffText, "Arcade Mode"); + ObjText_SetFontColorTop(diffText, 0x8100CE); + ObjText_SetFontColorBottom(diffText,0xAC7DFF); + ObjText_SetFontBorderType(diffText, BORDER_FULL); + ObjText_SetFontBorderColor(diffText, 0xFFFFFF); + } + + else{ + ObjText_SetText(diffText, "Gentle Mode"); + ObjText_SetFontColorTop(diffText, 0xFF993F); + ObjText_SetFontColorBottom(diffText,0xFFCFA6); + ObjText_SetFontBorderType(diffText, BORDER_FULL); + ObjText_SetFontBorderColor(diffText, 0xFFFFFF); + } + */ +} + +//---------------------------------------------------- +//スコア表示 +//---------------------------------------------------- + +task THighScore(){ + + let objScoreNo = ObjText_Create(); + ObjText_SetFontSize(objScoreNo, 58); + ObjText_SetFontBold(objScoreNo, true); + ObjText_SetFontType(objScoreNo, "Anke Calligraph"); + ObjText_SetFontColorTop(objScoreNo, 0xFFA157); + ObjText_SetFontColorBottom(objScoreNo,0xFFC232); + ObjText_SetFontBorderType(objScoreNo, BORDER_FULL); + ObjText_SetFontBorderColor(objScoreNo, 0xFFFFFF); + ObjText_SetFontBorderWidth(objScoreNo, 3); + //ObjText_SetFontWeight(objScoreNo, 1000); + Obj_SetRenderPriorityI(objScoreNo, 1); + ObjRender_SetX(objScoreNo, offsetX-10); // Subject to change + ObjRender_SetY(objScoreNo, baseY*0.8); // Same as above + + while(true){ + let score = GetAreaCommonData("hiscoredata", "hiscore", 0); + score = min(score,999999999990); + let yass = DigitToCommaArray(score); + ObjText_SetText(objScoreNo, yass); + yield; + } +} + +task TScore(){ + // New score system using rtos + + // For score with zeroes at the end: Truncate score/10, and then multiply it by 10 + + let objScore = ObjText_Create(); + ObjText_SetFontSize(objScore, 24); + ObjText_SetFontBold(objScore, true); + ObjText_SetFontType(objScore, "Exotc350 DmBd BT"); + ObjText_SetFontColorTop(objScore,0xFFFFFF); + ObjText_SetFontColorBottom(objScore,0xFFFFFF); + ObjText_SetFontBorderType(objScore, BORDER_FULL); + ObjText_SetFontBorderColor(objScore, 0x25379D); + ObjText_SetFontBorderWidth(objScore, 3); + ObjText_SetText(objScore, "SCORE"); + //ObjText_SetFontWeight(objScore, 1000); + Obj_SetRenderPriorityI(objScore, 79); + ObjRender_SetX(objScore, 12); // Subject to change + ObjRender_SetY(objScore, 48); // Same as above + Obj_SetVisible(objScore, false); + + let objScoreNo = ObjText_Create(); + ObjText_SetFontSize(objScoreNo, 40); + ObjText_SetFontBold(objScoreNo, true); + ObjText_SetFontType(objScoreNo, "Origami Mommy"); + ObjText_SetFontColorTop(objScoreNo,0xFFFFFF); + ObjText_SetFontColorBottom(objScoreNo,0xFFFFFF); + ObjText_SetFontBorderType(objScoreNo, BORDER_FULL); + ObjText_SetFontBorderColor(objScoreNo, 0x25379D); + ObjText_SetFontBorderWidth(objScoreNo, 4); + //ObjText_SetFontWeight(objScoreNo, 1000); + Obj_SetRenderPriorityI(objScoreNo, 79); + ObjText_SetSidePitch(objScoreNo, -3); + ObjRender_SetX(objScoreNo, 10); // Subject to change + ObjRender_SetY(objScoreNo, 10); // Same as above + + while(true){ + let score = trunc(GetScore()/10) * 10; + score = min(score,999999999990); + let yass = DigitToCommaArray(score); + ObjText_SetText(objScoreNo, yass); + + if(ObjMove_GetY(GetPlayerObjectID()) < GetStgFrameHeight()/6){ + ObjRender_SetAlpha(objScore, 60); + ObjRender_SetAlpha(objScoreNo, 60); + } + else{ + ObjRender_SetAlpha(objScore, 255); + ObjRender_SetAlpha(objScoreNo, 255); + } + + yield; + } +} + +function DigitToCommaArray(num){ //Natashinitai + + let srcStr = IntToString(num); + let res = []; + let nChar = 0; + for(let i = length(srcStr) - 1; i >= 0; i--){ + res = [srcStr[i]] ~ res; + nChar++; + if(nChar % 3 == 0 && i > 0) res = "," ~ res; + } + return res; + +} + +//---------------------------------------------------- +//Graze表示 +//---------------------------------------------------- +task TGraze() +{ + let grazenum = ObjText_Create(); + ObjText_SetFontSize(grazenum, 58); + ObjText_SetFontBold(grazenum, true); + ObjText_SetFontType(grazenum, "Anke Calligraph"); + ObjText_SetFontColorTop(grazenum, 0x8898A3); + ObjText_SetFontColorBottom(grazenum, 0xD2E0FF); + ObjText_SetFontBorderType(grazenum, BORDER_FULL); + ObjText_SetFontBorderColor(grazenum, 0xFFFFFF); + ObjText_SetFontBorderWidth(grazenum, 3); + Obj_SetRenderPriorityI(grazenum, 1); + ObjRender_SetX(grazenum, offsetX-10); + ObjRender_SetY(grazenum, baseY*0.8+spaceY*5); + + while(true){ + let graze = GetGraze(); + + ObjText_SetText(grazenum, rtos("00000", graze)); + yield; + } +} + +task TValueDisplay(){ + + let objPIV = ObjText_Create(); + ObjText_SetFontSize(objPIV, 21); + ObjText_SetFontBold(objPIV, true); + ObjText_SetFontType(objPIV, "Exotc350 DmBd BT"); + ObjText_SetFontColorTop(objPIV,0xFFFFFF); + ObjText_SetFontColorBottom(objPIV,0xFFFFFF); + ObjText_SetFontBorderType(objPIV, BORDER_FULL); + ObjText_SetFontBorderColor(objPIV, 0xDC47C8); + ObjText_SetFontBorderWidth(objPIV, 3); + ObjText_SetText(objPIV, "MULTIPLIER"); + ObjText_SetHorizontalAlignment(objPIV, ALIGNMENT_RIGHT); + //ObjText_SetFontWeight(objPIV, 1000); + Obj_SetRenderPriorityI(objPIV, 79); + ObjRender_SetX(objPIV, GetStgFrameWidth()-15); // Subject to change + ObjRender_SetY(objPIV, 44); // Same as above + + let objPIVNum = ObjText_Create(); + ObjText_SetFontSize(objPIVNum, 30); + ObjText_SetFontBold(objPIVNum, true); + ObjText_SetFontType(objPIVNum, "Origami Mommy"); + ObjText_SetFontColorTop(objPIVNum,0xFFFFFF); + ObjText_SetFontColorBottom(objPIVNum,0xFFFFFF); + ObjText_SetFontBorderType(objPIVNum, BORDER_FULL); + ObjText_SetFontBorderColor(objPIVNum, 0xDC47C8); + ObjText_SetFontBorderWidth(objPIVNum, 4); + ObjText_SetHorizontalAlignment(objPIVNum, ALIGNMENT_RIGHT); + //ObjText_SetFontWeight(objPIVNum, 1000); + Obj_SetRenderPriorityI(objPIVNum, 79); + ObjRender_SetX(objPIVNum, GetStgFrameWidth()-12); // Subject to change + ObjRender_SetY(objPIVNum, 10); // Same as above + // DEBUG + //Obj_SetVisible(objPIV, false); + + while(true){ + let value = GetAreaCommonData("PIV", "currentvalue", 0); + value = min(value,9999999990); + //PIVMultiplierValue = value/1000; + let yass = vtos("5.2f", value/10000); + ObjText_SetText(objPIVNum, yass ~ "x"); + + if(ObjMove_GetY(GetPlayerObjectID()) < GetStgFrameHeight()/6){ + ObjRender_SetAlpha(objPIV, 60); + ObjRender_SetAlpha(objPIVNum, 60); + } + else{ + ObjRender_SetAlpha(objPIV, 255); + ObjRender_SetAlpha(objPIVNum, 255); + } + yield; + } + +} + +//---------------------------------------------------- +//残機表示 +//---------------------------------------------------- +/*task TPlayerLife +{ + let lifenum = ObjText_Create(); + ObjText_SetFontSize(lifenum, 22); + ObjText_SetFontBold(lifenum, false); + ObjText_SetFontType(lifenum, "Unispace"); + ObjText_SetFontColorTop(lifenum,255,255,255); + ObjText_SetFontColorBottom(lifenum,255,255,255); + Obj_SetRenderPriorityI(lifenum, 1); + ObjRender_SetX(lifenum,507); + ObjRender_SetY(lifenum,101); + + while(true){ + let liferemain = GetPlayerLife(); + + ObjText_SetText(lifenum, rtos("00", liferemain)); + yield; + } +}*/ + +//---------------------------------------------------- +//残スペル表示 +//---------------------------------------------------- +task TPlayerSpell +{ + let spellnum = ObjText_Create(); + ObjText_SetFontSize(spellnum, 22); + ObjText_SetFontBold(spellnum, false); + ObjText_SetFontType(spellnum, "Unispace"); + ObjText_SetFontColorTop(spellnum,255,255,255); + ObjText_SetFontColorBottom(spellnum,255,255,255); + Obj_SetRenderPriorityI(spellnum, 1); + ObjRender_SetX(spellnum,offsetX); + ObjRender_SetY(spellnum,baseY+spaceY*3); + + while(true){ + let spellremain = GetPlayerSpell(); + + ObjText_SetText(spellnum, rtos("00", spellremain)); + yield; + } +} + +// New life task +task LifeDisplay(){ + +// oh god oh no + let liferemain; + let lifecounter = ObjPrim_Create(OBJ_SPRITE_LIST_2D); + let lifeshow = graphicimg; + Obj_SetRenderPriorityI(lifecounter, 1); + ObjPrim_SetTexture(lifecounter, lifeshow); + //ObjSpriteList2D_SetSourceRect(lifecounter, 256, 0, 384, 128); + //ObjRender_SetScaleXYZ(lifecounter, 0.5, 0.5, 1); + //ObjSpriteList2D_SetDestCenter(lifecounter); + + loop{ + ObjSpriteList2D_ClearVertexCount(lifecounter); + ObjSpriteList2D_SetSourceRect(lifecounter, 256, 0, 384, 128); + ObjSpriteList2D_SetDestCenter(lifecounter); + ObjRender_SetScaleXYZ(lifecounter, 0.26*scale, 0.26*scale, 1); + liferemain = GetPlayerLife(); + ascent(i in 0..liferemain){ + ObjRender_SetPosition(lifecounter, 550-10+i*25, 1040, 0); + ObjSpriteList2D_AddVertex(lifecounter); + } + yield; + } + +} +// New spell task +task SpellDisplay{ + + let spellremain; + let spellcounter = ObjPrim_Create(OBJ_SPRITE_LIST_2D); + let spellshow = graphicimg; + Obj_SetRenderPriorityI(spellcounter, 1); + ObjPrim_SetTexture(spellcounter, spellshow); + + loop{ + ObjSpriteList2D_ClearVertexCount(spellcounter); + ObjSpriteList2D_SetSourceRect(spellcounter, 384, 0, 512, 128); + ObjSpriteList2D_SetDestCenter(spellcounter); + ObjRender_SetScaleXYZ(spellcounter, 0.26*scale, 0.26*scale, 1); + spellremain = GetPlayerSpell(); + ascent(i in 0..spellremain){ + ObjRender_SetPosition(spellcounter, 1000+10+i*25, 1040, 0); + ObjSpriteList2D_AddVertex(spellcounter); + } + yield; + } +} +//---------------------------------------------------- +// Edited ExRumia system +//---------------------------------------------------- +task TBossLife + +// Lifebar starts at x = 352, ends at x = 925 +{ + let path = lifebarimg; + let obj = ObjPrim_Create(OBJ_SPRITE_LIST_2D); + let objStar = ObjPrim_Create(OBJ_SPRITE_LIST_2D); + let objDivision = ObjPrim_Create(OBJ_SPRITE_LIST_2D); + let objLifebar = ObjPrim_Create(OBJ_SPRITE_LIST_2D); + //bool BossExist = false; + + ObjPrim_SetTexture(obj, path); + Obj_SetRenderPriorityI(obj, 72); + ObjRender_SetAlpha(obj, 255); + + ObjPrim_SetTexture(objStar, path); + Obj_SetRenderPriorityI(objStar, 70); + + ObjPrim_SetTexture(objDivision, path); + Obj_SetRenderPriorityI(objDivision, 72); + + ObjPrim_SetTexture(objLifebar, path); + Obj_SetRenderPriorityI(objLifebar, 70); + ObjRender_SetAlpha(objLifebar, 140); + //Obj_SetVisible(objLifebar, false); + + let lastRemStep = -1; + let lifeRateRender = 0; + + let objScene = ID_INVALID; + loop + { + objScene = GetEnemyBossSceneObjectID(); + ObjSpriteList2D_ClearVertexCount(obj); + ObjSpriteList2D_ClearVertexCount(objLifebar); + ObjSpriteList2D_ClearVertexCount(objStar); + ObjSpriteList2D_ClearVertexCount(objDivision); + if(objScene != ID_INVALID) + { + //BossExist = true; + ObjSpriteList2D_SetSourceRect(objLifebar, 8, 6, 801, 50); + ObjSpriteList2D_SetDestCenter(objLifebar); + ObjRender_SetScaleXYZ(objLifebar, 1.12, 1.25, 1); + ascent (i in 0..1){ + ObjRender_SetPosition(objLifebar, 455, 90, 1); + ObjSpriteList2D_AddVertex(objLifebar); + } + RenderActiveLife(); + + } + yield; + } + + /*task RenderLifebar(){ + ObjSprite2D_SetSourceRect(objLifebar, 5, 5, 534, 34); + ObjSprite2D_SetDestCenter(objLifebar); + ObjRender_SetPosition(objLifebar, 352, 20, 1); + while(BossExist){ + Obj_SetVisible(objLifebar, true); + yield; + } + }*/ + + function RenderActiveLife() + { + //残りステップ + let countRemStep = ObjEnemyBossScene_GetInfo(objScene, INFO_REMAIN_STEP_COUNT); + if(lastRemStep != countRemStep) + { + //ステップが変化 + lifeRateRender = 0; + } + + //Overall active life + let lifeTotalMax = ObjEnemyBossScene_GetInfo(objScene, INFO_ACTIVE_STEP_TOTAL_MAX_LIFE); + let lifeTotal = ObjEnemyBossScene_GetInfo(objScene, INFO_ACTIVE_STEP_TOTAL_LIFE); + let lifeRate = min(lifeTotal / lifeTotalMax, lifeRateRender); + ObjSpriteList2D_SetSourceRect(obj, 7, 119, 800, 159); + ObjSpriteList2D_SetDestRect(obj, 11, 70, 12 + (890-2) * lifeRate, 110); + ObjRender_SetColorHSV(obj, -60, 384, 384); + ObjSpriteList2D_AddVertex(obj); + ObjRender_SetBlendType(obj, BLEND_ALPHA); + + //Life "division" bar + ObjSpriteList2D_SetSourceRect(objDivision, 8, 56, 27, 111); + //ObjRender_SetColorHSV(objDivision, 32, 255, 255); + let listLifeDiv = [0] ~ ObjEnemyBossScene_GetInfo(objScene, INFO_ACTIVE_STEP_LIFE_RATE_LIST); + ascent(iDiv in 1 .. length(listLifeDiv)-1) + { + let rate = listLifeDiv[iDiv]; + let x = (GetStgFrameWidth()) * 0.98 * (1-rate); + ObjSpriteList2D_SetDestRect(objDivision, x-4, 62, x+24, 118); + ObjSpriteList2D_AddVertex(objDivision); + } + + //Boss star rendering + ObjRender_SetScaleXYZ(objStar, 0.6, 0.6, 1); + ObjSpriteList2D_SetSourceRect(objStar, 0, 169, 268, 430); + Obj_SetRenderPriority(objStar, 1); + ascent(iStep in 0 .. countRemStep) + { + ObjRender_SetPosition(objStar, GetStgFrameWidth()*1.6, 35+45*iStep, 1); + ObjSpriteList2D_SetDestCenter(objStar); + ObjSpriteList2D_AddVertex(objStar); + } + + lifeRateRender += 0.01; + lifeRateRender = min(lifeRateRender, 1); + lastRemStep = countRemStep; + + if(ObjMove_GetY(GetPlayerObjectID()) < GetStgFrameHeight()/6){ + ObjRender_SetAlpha(obj, 60); + ObjRender_SetAlpha(obj, 30); + } + else{ + ObjRender_SetAlpha(obj, 255); + ObjRender_SetAlpha(objLifebar, 140); + } + } +} + +//---------------------------------------------------- +//タイマー表示 +//---------------------------------------------------- +task TBossTimer +{ + let textTimer = ObjText_Create(); + ObjText_SetFontSize(textTimer, 35); + ObjText_SetFontType(textTimer, "Connecting Chain Handserif"); + + //ObjText_SetMaxWidth(textTimer, GetStgFrameWidth()/6); + ObjText_SetHorizontalAlignment(textTimer, ALIGNMENT_CENTER); + + ObjText_SetFontBold(textTimer, true); + ObjText_SetFontColorTop(textTimer, 0xFFFFFF); + ObjText_SetFontColorBottom(textTimer, 0xFFFFFF); + ObjText_SetFontBorderType(textTimer, BORDER_FULL); + ObjText_SetFontBorderColor(textTimer, 0xA639F0); + ObjText_SetFontBorderWidth(textTimer, 3.4); + Obj_SetRenderPriorityI(textTimer, 73); + ObjRender_SetX(textTimer, GetStgFrameWidth()/8-10); + ObjRender_SetY(textTimer, 110); + Obj_SetVisible(textTimer, true); + + let pathDigit = GetCurrentScriptDirectory() ~ "img/Default_SystemDigit.png"; + + let obj = ObjPrim_Create(OBJ_SPRITE_LIST_2D); + ObjPrim_SetTexture(obj, lifebarimg); + ObjRender_SetBlendType(obj, BLEND_ADD_RGB); + Obj_SetRenderPriority(obj, 0.75); + //ObjRender_SetY(obj, 38); + let count = 2; + + let objScene = ID_INVALID; + loop + { + objScene = GetEnemyBossSceneObjectID(); + ObjSpriteList2D_ClearVertexCount(obj); + if(objScene != ID_INVALID) + { + Obj_SetVisible(textTimer, true); + RenderTimer(); + } + else{Obj_SetVisible(textTimer, false); + } + yield; + } + + task RenderTimer() + { + let timer = ObjEnemyBossScene_GetInfo(objScene, INFO_TIMERF)/60; + timer = min(timer, 99.99); + ObjText_SetText(textTimer, "TIME: " ~ rtos("00.00", timer)); + ObjSpriteList2D_SetSourceRect(obj, 404, 225, 537, 374); + ObjRender_SetScaleXYZ(obj, 0.38, 0.38, 1); + ObjSpriteList2D_SetDestCenter(obj); + ObjRender_SetPosition(obj, 4*GetStgFrameWidth()/5+62, GetStgFrameHeight()/8-25, 1); + //ObjSpriteList2D_AddVertex(obj); + if(ObjEnemyBossScene_GetInfo(objScene, INFO_TIMER) <= 10 && ObjEnemyBossScene_GetInfo(objScene, INFO_TIMER) > 0){ + if(ObjEnemyBossScene_GetInfo(objScene, INFO_TIMERF) % 60 == 0){_Timeout();} + ObjText_SetFontBorderColor(textTimer, 0xF0396C); + } + else{} + if(ObjMove_GetY(GetPlayerObjectID()) < GetStgFrameHeight()/6){ + ObjRender_SetAlpha(textTimer, 60); + } + else{ + ObjRender_SetAlpha(textTimer, 255); + } + yield; + } + + task _Timeout(){ // HOLY FUCK THE TIMER IS RUNNING OUT BITCH + + ascent(i in 0..30){ + ObjText_SetFontSize(textTimer, Interpolate_Decelerate(80, 45, i/30)); + //ObjRender_SetScaleXYZ(obj, Interpolate_Decelerate(0.6, 0.38, i/30)); + yield; + } + + } +} + +task TScoreAward(dascore){ + + let objText = ObjText_Create(); + int x = rand_int(0, 99); + + RegularAward; + + task RegularAward{ + + let fontsizearray = [70, 70, 70, 65, 60, 65, 70, 70, 70, 40, 40]; + let textarray = ["So Cool Bestie!", "Bimbo Eliminated!", "Wig Snatched!", "Neutralized Boss Sexiness!", "Gay Rights Confirmed!", "Himbo Kisses!", "Slay Button Hit!", "Yass!!!!", "Gatekept, Gaslit, Girlbossed!", "Spell Card Capture!"]; + + int y = rand_int(0, length(textarray)-2); + + ObjText_SetText(objText, textarray[y]); // Selects a random capture text from the array + ObjText_SetFontSize(objText, fontsizearray[y]*1.5); + ObjText_SetFontType(objText, "Exotc350 DmBd BT"); + + //ObjText_SetMaxWidth(objText, GetStgFrameWidth()); + ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER); + + ObjText_SetFontBold(objText, true); + ObjText_SetFontColorTop(objText, 0xFFD34D); + ObjText_SetFontColorBottom(objText, 0xFFF2CA); + ObjText_SetFontBorderType(objText, BORDER_FULL); + ObjText_SetFontBorderColor(objText,0, 0, 0); + ObjText_SetFontBorderWidth(objText, 3); + Obj_SetRenderPriority(objText, 0.6); + ObjRender_SetX(objText, GetStgFrameWidth()/2); + ObjRender_SetY(objText, GetStgFrameHeight()/5); + } + + let scorefinal = trunc(dascore/10) * 10; + let scorescene = GetEnemyBossSceneObjectID(); + + if (ObjEnemyBossScene_GetInfo(scorescene, INFO_PLAYER_SHOOTDOWN_COUNT) == 0 && + ObjEnemyBossScene_GetInfo(scorescene, INFO_PLAYER_SPELL_COUNT) == 0){ + AddScore(scorefinal); + } + + let strScore = "Capture Bonus +" ~ DigitToCommaArray(scorefinal); + let objScore = ObjText_Create(); + ObjText_SetText(objScore, strScore); + ObjText_SetFontSize(objScore, 85); + ObjText_SetFontType(objScore, "Anke Calligraph"); + + ObjText_SetMaxWidth(objScore, GetStgFrameWidth()); + ObjText_SetHorizontalAlignment(objScore, ALIGNMENT_CENTER); + + ObjText_SetFontBold(objScore, true); + ObjText_SetFontColorTop(objScore, 0x9C2400); + ObjText_SetFontColorBottom(objScore, 0xFF982A); + ObjText_SetFontBorderType(objScore, BORDER_FULL); + ObjText_SetFontBorderColor(objScore, 255, 255, 255); + ObjText_SetFontBorderWidth(objScore, 3); + Obj_SetRenderPriority(objScore, 0.6); + ObjRender_SetX(objScore, GetStgFrameWidth()/2 - (GetStgFrameWidth()/2-5)); + ObjRender_SetY(objScore, GetStgFrameHeight()/3.2-15); + + wait(120); + + Obj_Delete(objText); + Obj_Delete(objScore); + +} +//---------------------------------------------------- +//FPS表示 +//---------------------------------------------------- +task TCurrentFps() +{ + let objText = ObjText_Create(); + ObjText_SetFontSize(objText, 48); + ObjText_SetFontBold(objText, true); + ObjText_SetFontType(objText, "Anke Calligraph"); + ObjText_SetFontColorTop(objText, 0x6747FF); + ObjText_SetFontColorBottom(objText, 0xAEC4FF); + ObjText_SetFontBorderType(objText, BORDER_FULL); + ObjText_SetFontBorderColor(objText, 255, 255, 255); + ObjText_SetFontBorderWidth(objText, 1.5); + ObjText_SetHorizontalAlignment(objText, ALIGNMENT_RIGHT); + ObjText_SetMaxWidth(objText, GetScreenWidth() - 8); + Obj_SetRenderPriority(objText, 1.0); + ObjRender_SetX(objText, 0); + ObjRender_SetY(objText, GetScreenHeight() - 48); + + loop + { + let fps = GetCurrentFps(); + let text = vtos("1.2f", fps) ~ "fps"; + ObjText_SetText(objText, text); + yield; + } +} + +task TReplayFps() +{ + if(!IsReplay()){return;} + + let objText = ObjText_Create(); + ObjText_SetFontSize(objText, 12); + ObjText_SetFontBold(objText, true); + ObjText_SetFontColorTop(objText, 128, 128, 255); + ObjText_SetFontColorBottom(objText, 64, 64, 255); + ObjText_SetFontBorderType(objText, BORDER_FULL); + ObjText_SetFontBorderColor(objText,255, 255, 255); + ObjText_SetFontBorderWidth(objText, 1); + Obj_SetRenderPriority(objText, 1.0); + + let px = GetStgFrameLeft() + GetStgFrameWidth() - 18; + let py = GetStgFrameTop() + GetScreenHeight() - 14; + ObjRender_SetX(objText, px); + ObjRender_SetY(objText, py); + + loop + { + let fps = GetReplayFps(); + let text = vtos("02d", fps); + ObjText_SetText(objText, text); + yield; + } +} + +//---------------------------------------------------- +//ユーティリティ +//---------------------------------------------------- diff --git a/KevinSystem/PlayerSFX/CK Music Factory/air01.wav b/KevinSystem/PlayerSFX/CK Music Factory/air01.wav new file mode 100644 index 0000000..bc2c0ed Binary files /dev/null and b/KevinSystem/PlayerSFX/CK Music Factory/air01.wav differ diff --git a/KevinSystem/PlayerSFX/CK Music Factory/air02.wav b/KevinSystem/PlayerSFX/CK Music Factory/air02.wav new file mode 100644 index 0000000..f7e5ed8 Binary files /dev/null and b/KevinSystem/PlayerSFX/CK Music Factory/air02.wav differ diff --git a/KevinSystem/PlayerSFX/CK Music Factory/laser01.wav b/KevinSystem/PlayerSFX/CK Music Factory/laser01.wav new file mode 100644 index 0000000..b41bae2 Binary files /dev/null and b/KevinSystem/PlayerSFX/CK Music Factory/laser01.wav differ diff --git a/KevinSystem/PlayerSFX/CK Music Factory/slash01.wav b/KevinSystem/PlayerSFX/CK Music Factory/slash01.wav new file mode 100644 index 0000000..364dfca Binary files /dev/null and b/KevinSystem/PlayerSFX/CK Music Factory/slash01.wav differ diff --git a/KevinSystem/PlayerSFX/CK Music Factory/wind01.wav b/KevinSystem/PlayerSFX/CK Music Factory/wind01.wav new file mode 100644 index 0000000..5941d52 Binary files /dev/null and b/KevinSystem/PlayerSFX/CK Music Factory/wind01.wav differ diff --git a/KevinSystem/PlayerSFX/TAM Music Factory/se04.wav b/KevinSystem/PlayerSFX/TAM Music Factory/se04.wav new file mode 100644 index 0000000..ca33890 Binary files /dev/null and b/KevinSystem/PlayerSFX/TAM Music Factory/se04.wav differ diff --git a/KevinSystem/PlayerSFX/TAM Music Factory/status4.wav b/KevinSystem/PlayerSFX/TAM Music Factory/status4.wav new file mode 100644 index 0000000..1227a08 Binary files /dev/null and b/KevinSystem/PlayerSFX/TAM Music Factory/status4.wav differ diff --git a/KevinSystem/PlayerSFX/TAM Music Factory/tama2.wav b/KevinSystem/PlayerSFX/TAM Music Factory/tama2.wav new file mode 100644 index 0000000..d542bbd Binary files /dev/null and b/KevinSystem/PlayerSFX/TAM Music Factory/tama2.wav differ diff --git a/KevinSystem/PlayerSFX/bfxr_Base.wav b/KevinSystem/PlayerSFX/bfxr_Base.wav new file mode 100644 index 0000000..15e3f00 Binary files /dev/null and b/KevinSystem/PlayerSFX/bfxr_Base.wav differ diff --git a/KevinSystem/PlayerSFX/bfxr_Graze.wav b/KevinSystem/PlayerSFX/bfxr_Graze.wav new file mode 100644 index 0000000..4c662e6 Binary files /dev/null and b/KevinSystem/PlayerSFX/bfxr_Graze.wav differ diff --git a/KevinSystem/PlayerSFX/bfxr_PlayerHit.wav b/KevinSystem/PlayerSFX/bfxr_PlayerHit.wav new file mode 100644 index 0000000..971a3b1 Binary files /dev/null and b/KevinSystem/PlayerSFX/bfxr_PlayerHit.wav differ diff --git a/KevinSystem/PlayerSFX/bfxr_PlayerShootdown.wav b/KevinSystem/PlayerSFX/bfxr_PlayerShootdown.wav new file mode 100644 index 0000000..8efe834 Binary files /dev/null and b/KevinSystem/PlayerSFX/bfxr_PlayerShootdown.wav differ diff --git a/KevinSystem/PlayerSFX/bfxr_arabqueenhousama.wav b/KevinSystem/PlayerSFX/bfxr_arabqueenhousama.wav new file mode 100644 index 0000000..d24862e Binary files /dev/null and b/KevinSystem/PlayerSFX/bfxr_arabqueenhousama.wav differ diff --git a/KevinSystem/PlayerSFX/bfxr_basefire.wav b/KevinSystem/PlayerSFX/bfxr_basefire.wav new file mode 100644 index 0000000..dff783c Binary files /dev/null and b/KevinSystem/PlayerSFX/bfxr_basefire.wav differ diff --git a/KevinSystem/PlayerSFX/bfxr_fire.wav b/KevinSystem/PlayerSFX/bfxr_fire.wav new file mode 100644 index 0000000..6c241e4 Binary files /dev/null and b/KevinSystem/PlayerSFX/bfxr_fire.wav differ diff --git a/KevinSystem/PlayerSFX/bfxr_kyliejennerarabqueen.wav b/KevinSystem/PlayerSFX/bfxr_kyliejennerarabqueen.wav new file mode 100644 index 0000000..327dbb5 Binary files /dev/null and b/KevinSystem/PlayerSFX/bfxr_kyliejennerarabqueen.wav differ diff --git a/KevinSystem/PlayerSFX/bfxr_laseractivate.wav b/KevinSystem/PlayerSFX/bfxr_laseractivate.wav new file mode 100644 index 0000000..321befd Binary files /dev/null and b/KevinSystem/PlayerSFX/bfxr_laseractivate.wav differ diff --git a/KevinSystem/PlayerSFX/bfxr_laserdeactivate.wav b/KevinSystem/PlayerSFX/bfxr_laserdeactivate.wav new file mode 100644 index 0000000..2a05c53 Binary files /dev/null and b/KevinSystem/PlayerSFX/bfxr_laserdeactivate.wav differ diff --git a/KevinSystem/PlayerSFX/bfxr_missileexplode.wav b/KevinSystem/PlayerSFX/bfxr_missileexplode.wav new file mode 100644 index 0000000..243de5e Binary files /dev/null and b/KevinSystem/PlayerSFX/bfxr_missileexplode.wav differ diff --git a/KevinSystem/PlayerSFX/bfxr_scythecall.wav b/KevinSystem/PlayerSFX/bfxr_scythecall.wav new file mode 100644 index 0000000..99b3040 Binary files /dev/null and b/KevinSystem/PlayerSFX/bfxr_scythecall.wav differ diff --git a/KevinSystem/PlayerSFX/bfxr_splash.wav b/KevinSystem/PlayerSFX/bfxr_splash.wav new file mode 100644 index 0000000..6a4d49d Binary files /dev/null and b/KevinSystem/PlayerSFX/bfxr_splash.wav differ diff --git a/KevinSystem/PlayerSFX/bfxr_teleporthigh.wav b/KevinSystem/PlayerSFX/bfxr_teleporthigh.wav new file mode 100644 index 0000000..a493cf0 Binary files /dev/null and b/KevinSystem/PlayerSFX/bfxr_teleporthigh.wav differ diff --git a/KevinSystem/PlayerSFX/bfxr_teleportlow.wav b/KevinSystem/PlayerSFX/bfxr_teleportlow.wav new file mode 100644 index 0000000..2e8b8b2 Binary files /dev/null and b/KevinSystem/PlayerSFX/bfxr_teleportlow.wav differ diff --git a/KevinSystem/PlayerSFX/bfxr_watershoot.wav b/KevinSystem/PlayerSFX/bfxr_watershoot.wav new file mode 100644 index 0000000..6cfced3 Binary files /dev/null and b/KevinSystem/PlayerSFX/bfxr_watershoot.wav differ diff --git a/KevinSystem/PlayerSFX/birdcall05.wav b/KevinSystem/PlayerSFX/birdcall05.wav new file mode 100644 index 0000000..ec6c7b9 Binary files /dev/null and b/KevinSystem/PlayerSFX/birdcall05.wav differ diff --git a/KevinSystem/PlayerSFX/laser01.wav b/KevinSystem/PlayerSFX/laser01.wav new file mode 100644 index 0000000..b41bae2 Binary files /dev/null and b/KevinSystem/PlayerSFX/laser01.wav differ diff --git a/KevinSystem/PlayerSFX/magic21.wav b/KevinSystem/PlayerSFX/magic21.wav new file mode 100644 index 0000000..19714fe Binary files /dev/null and b/KevinSystem/PlayerSFX/magic21.wav differ diff --git a/KevinSystem/PlayerSFX/se_nep00.wav b/KevinSystem/PlayerSFX/se_nep00.wav new file mode 100644 index 0000000..32b0608 Binary files /dev/null and b/KevinSystem/PlayerSFX/se_nep00.wav differ diff --git a/KevinSystem/PlayerSFX/se_old_kira01.wav b/KevinSystem/PlayerSFX/se_old_kira01.wav new file mode 100644 index 0000000..9f5835a Binary files /dev/null and b/KevinSystem/PlayerSFX/se_old_kira01.wav differ diff --git a/KevinSystem/PlayerSFX/slash01.wav b/KevinSystem/PlayerSFX/slash01.wav new file mode 100644 index 0000000..5941d52 Binary files /dev/null and b/KevinSystem/PlayerSFX/slash01.wav differ diff --git a/KevinSystem/PlayerSFX/tama2.wav b/KevinSystem/PlayerSFX/tama2.wav new file mode 100644 index 0000000..d542bbd Binary files /dev/null and b/KevinSystem/PlayerSFX/tama2.wav differ diff --git a/KevinSystem/PlayerSoundLib.dnh b/KevinSystem/PlayerSoundLib.dnh new file mode 100644 index 0000000..357502c --- /dev/null +++ b/KevinSystem/PlayerSoundLib.dnh @@ -0,0 +1,64 @@ +// Sound effects for player scripts go here. + +// Link to sound folder + +let sddir = GetCurrentScriptDirectory() ~ "./PlayerSFX"; +//let sddir = GetCurrentScriptDirectory() ~ "./sound"; + +let SFXVol = GetAreaCommonData("Config", "SEVol", 100) * 0.01; + +// Function for loading and setting volume of a sound object +function LoadEx(targetobj, targetpath, targetvol){ + + ObjSound_Load(targetobj, targetpath); + ObjSound_SetVolumeRate(targetobj, targetvol * SFXVol); + ObjSound_SetSoundDivision(targetobj, SOUND_SE); + +} + +// Universal sounds +let baseshot = sddir ~ "./bfxr_Base.wav"; +let bomb = sddir ~ "./bfxr_kyliejennerarabqueen.wav"; +let ded = sddir ~ "./bfxr_PlayerShootdown.wav"; +let hit = sddir ~ "./bfxr_PlayerHit.wav"; +let graze = sddir ~ "./bfxr_Graze.wav"; + +let basesfx = ObjSound_Create(); +let bombsfx = ObjSound_Create(); +let deathsfx = ObjSound_Create(); +let predeathsfx = ObjSound_Create(); +let grazesfx = ObjSound_Create(); +/**/ +// Marisa & Housui's sounds, "inferno" is shared with Eri/Ten + +let teleporthigh = sddir ~ "./bfxr_teleporthigh.wav"; +let teleportlow = sddir ~ "./bfxr_teleportlow.wav"; +let missileboom = ObjSound_Create(); +let inferno = ObjSound_Create(); +let bombhousui = ObjSound_Create(); + +// Pankevin & Kouda's sounds + +let orbfront = ObjSound_Create(); +let orbback = ObjSound_Create(); +let scythecall = ObjSound_Create(); +let splash = ObjSound_Create(); +let scythefire = ObjSound_Create(); + +task _SoundTask(){ + LoadEx(basesfx, baseshot, 20); + LoadEx(bombsfx, bomb, 75); + LoadEx(deathsfx, ded, 40); + LoadEx(predeathsfx, hit, 100); + + LoadEx(orbfront, teleporthigh, 20); + LoadEx(orbback, teleportlow, 20); + LoadEx(scythecall, sddir ~ "./bfxr_scythecall.wav", 15); + LoadEx(splash, sddir ~ "./bfxr_splash.wav", 12.5); + LoadEx(scythefire, sddir ~ "./bfxr_watershoot.wav", 8); + + LoadEx(missileboom, sddir ~ "./bfxr_missileexplode.wav", 18); + LoadEx(inferno, sddir ~ "./bfxr_fire.wav", 20); + LoadEx(bombhousui, sddir ~ "./bfxr_arabqueenhousama.wav", 35); + LoadEx(grazesfx, graze, 40); +} diff --git a/KevinSystem/RyannSFX/ItemSFX/bfxr_GetItem1.wav b/KevinSystem/RyannSFX/ItemSFX/bfxr_GetItem1.wav new file mode 100644 index 0000000..b616c81 Binary files /dev/null and b/KevinSystem/RyannSFX/ItemSFX/bfxr_GetItem1.wav differ diff --git a/KevinSystem/RyannSFX/ItemSFX/bfxr_GetItemCancel.wav b/KevinSystem/RyannSFX/ItemSFX/bfxr_GetItemCancel.wav new file mode 100644 index 0000000..b37096c Binary files /dev/null and b/KevinSystem/RyannSFX/ItemSFX/bfxr_GetItemCancel.wav differ diff --git a/KevinSystem/RyannSFX/ItemSFX/bfxr_GetItemSpecial.wav b/KevinSystem/RyannSFX/ItemSFX/bfxr_GetItemSpecial.wav new file mode 100644 index 0000000..df2bfa3 Binary files /dev/null and b/KevinSystem/RyannSFX/ItemSFX/bfxr_GetItemSpecial.wav differ diff --git a/KevinSystem/RyannSFX/ItemSFX/bfxr_LifeExtend.wav b/KevinSystem/RyannSFX/ItemSFX/bfxr_LifeExtend.wav new file mode 100644 index 0000000..f58d225 Binary files /dev/null and b/KevinSystem/RyannSFX/ItemSFX/bfxr_LifeExtend.wav differ diff --git a/KevinSystem/RyannSFX/ItemSFX/bfxr_SpellExtend.wav b/KevinSystem/RyannSFX/ItemSFX/bfxr_SpellExtend.wav new file mode 100644 index 0000000..5978006 Binary files /dev/null and b/KevinSystem/RyannSFX/ItemSFX/bfxr_SpellExtend.wav differ diff --git a/KevinSystem/Universal_EnemyLib.dnh b/KevinSystem/Universal_EnemyLib.dnh new file mode 100644 index 0000000..5f2a1e1 --- /dev/null +++ b/KevinSystem/Universal_EnemyLib.dnh @@ -0,0 +1,937 @@ +/* + +////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////// + + UNIVERSAL LIBRARY FOR ENEMY-RELATED FUNCTIONS + +////////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////////// + +*/ + +// Code by Kevinmonitor with some assistance. +/* + +///////////// ENEMY SPAWNING DURING STAGES ///////////// + +*/ + +task _InitDifficulty(int diffInt){ + + if(GetCommonData("Difficulty", "Normal") == "Normal"){ + diffInt = 0; + } + + else if(GetCommonData("Difficulty", "Normal") == "Hyper"){ + diffInt = 1; + } + + else if(GetCommonData("Difficulty", "Normal") == "Unparalleled"){ + diffInt = 2; + } + + return; +} + +// Explosion Sound Effects + +task _RenderBoss(int enemy){ + + int aniidle = 0; + + string tex = "script/game/resourceLib/Spritesheet_StationJam.png"; + + LoadTextureEx(tex, true, true); + + ObjPrim_SetTexture(enemy, tex); + ObjSprite2D_SetSourceRect(enemy, 1280, 0, 1280+256, 256); + 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); + + while(!Obj_IsDeleted(enemy)){ + + yield; + + } +} + +task _RenderMidboss(int enemy){ + + int aniidle = 0; + + string tex = "script/game/StageLib/BossAsset.png"; + + LoadTextureEx(tex, true, true); + + int nameText = CreateTextObject( + GetStgFrameWidth()*0.38, 10, 42, + "MIDBOSS: Kobiko", "Connecting Chain Handserif", + 0xBA8AFF, 0xFFFFFF, + 0x552A9C, 3, + 1 + ); + + ObjText_SetFontBold(nameText, true); + ObjPrim_SetTexture(enemy, tex); + ObjSprite2D_SetSourceRect(enemy, 768, 0, 768+512, 512); + ObjSprite2D_SetDestCenter(enemy); + ObjRender_SetScaleXYZ(enemy, 0.5); + + _BossMarker(enemy, tex, 512, 256, 768, 512, 0.45, 30); + + while(!Obj_IsDeleted(enemy)){ + + yield; + + } +} + +task _FadeInSpawn( + int enemyID, + float spawnX, float spawnY, + float destX, float destY, + float spawnScale, float destScale, + int time){ + + ObjMove_SetPosition(enemyID, spawnX, spawnY); + ObjRender_SetAlpha(enemyID, 0); + + ObjMove_SetDestAtFrame(enemyID, destX, destY, time, LERP_DECELERATE); + + ascent(i in 0..time){ + ObjRender_SetAlpha(enemyID, Interpolate_Decelerate(0, 255, i/time)); + ObjRender_SetScaleXYZ(enemyID, Interpolate_Decelerate(spawnScale, destScale, i/time)); + yield; + } + + } + +int itemScript = LoadScriptInThread("script/KevinSystem/kevin_system/KevinSystem_Item.txt"); +StartScript(itemScript); + +// Creates an enemy and spawns them using _FadeInSpawn. Shooting and movement tasks not covered. +// Task also handles deleting the enemy after their life reaches 0. + +/* +BhestieBlue: 0, 0, 256, 256 +BhestieGreen: 256, 0, 512, 256 +GaySamoyed: 0, 256, 256, 512 +EvilSamoyed: 256, 256, 512, 512 +*/ + +function _CreateEnemy( + float spawnX, float spawnY, float destX, float destY, int spawntime, + float spawnScale, float destScale, + float health, float sizeHitbox, float sizeHurtbox, + texture, + int rectLeft, int rectTop, int rectRight, int rectBottom){ + + // Essentials + int enemyID = ObjEnemy_Create(OBJ_ENEMY); + ObjEnemy_Regist(enemyID); + ObjEnemy_SetLife(enemyID, health); + ObjEnemy_SetAutoDelete(enemyID, true); + + // TBA: Handle animations + ObjPrim_SetTexture(enemyID, texture); + ObjSprite2D_SetSourceRect(enemyID, rectLeft, rectTop, rectRight, rectBottom); + ObjSprite2D_SetDestCenter(enemyID); + + // Spawning + _FadeInSpawn(enemyID, spawnX, spawnY, destX, destY, spawnScale, destScale, spawntime); + _HandleEnemyWellbeing(enemyID, sizeHitbox, sizeHurtbox); + + return enemyID; + + } + +// Special overload for creating hitbox/hurtboxless enemies. + +function _CreateEnemy( + bool intersectionrender, + float spawnX, float spawnY, float destX, float destY, int spawntime, + float spawnScale, float destScale, + float health, float sizeHitbox, float sizeHurtbox, + texture, + int rectLeft, int rectTop, int rectRight, int rectBottom){ + + // Essentials + int enemyID = ObjEnemy_Create(OBJ_ENEMY); + ObjEnemy_Regist(enemyID); + ObjEnemy_SetLife(enemyID, health); + ObjEnemy_SetAutoDelete(enemyID, true); + + // TBA: Handle animations + ObjPrim_SetTexture(enemyID, texture); + ObjSprite2D_SetSourceRect(enemyID, rectLeft, rectTop, rectRight, rectBottom); + ObjSprite2D_SetDestCenter(enemyID); + + // Spawning + _FadeInSpawn(enemyID, spawnX, spawnY, destX, destY, spawnScale, destScale, spawntime); + if (intersectionrender){_HandleEnemyWellbeing(enemyID, sizeHitbox, sizeHurtbox);} + else{} + + return enemyID; + + } + + +// Hitbox and deletion + +task _HandleEnemyWellbeing(int enemyID, float sizeHitbox, float sizeHurtbox){ + + while(ObjEnemy_GetInfo(enemyID, INFO_LIFE) > 0){ + ObjEnemy_SetIntersectionCircleToShot(enemyID, ObjMove_GetX(enemyID), ObjMove_GetY(enemyID), sizeHitbox); + ObjEnemy_SetIntersectionCircleToPlayer(enemyID, ObjMove_GetX(enemyID), ObjMove_GetY(enemyID), sizeHurtbox); + yield; + } + Obj_Delete(enemyID); +} + + +// Fading invincibility for bosses/enemies (with parameters for wait times and fade times, and a separate multiplier for bomb damage rate (final spells)) + +task _FadeInvincibility(int target, int waittime, int fadetime, float bombmultiplier){ + + float x = 0; + ObjEnemy_SetDamageRate(target, 0, 0); + wait(waittime); + ascent(i in 0..fadetime){ + x = Interpolate_Accelerate(0, 100, i/fadetime); + ObjEnemy_SetDamageRate(target, x, x*bombmultiplier); + yield; + } + +} + +/* +///////////// HANDLING THE END OF SINGLES (DURING BOSS/MIDBOSS FIGHTS) ///////////// + +To-do: Move item creation to the item script(s) + +*/ + +////// NEW ////// + +task _GoToBrazil( + int targetscene, targetenemy, + int maxitemdrop, int minitemdrop){ + + while(ObjEnemy_GetInfo(targetenemy, INFO_LIFE)>0){ + yield; + } + + maxitemdrop = 14; + minitemdrop = 7; + + int finalItemDrop = 0; + let itemType = POINT_RAINBOW; + + int maxTimer = ObjEnemyBossScene_GetInfo(targetscene, INFO_ORGTIMERF); + int killTimer = ObjEnemyBossScene_GetInfo(targetscene, INFO_TIMERF); + + bool isnon = ObjEnemyBossScene_GetInfo(targetscene, INFO_IS_SPELL); + + // If the boss is killed within the first 1/5 of the timer, drop full items + + if(killTimer >= maxTimer*(4/5)) {finalItemDrop = maxitemdrop;} + + // Starting from the rest of the timer, the maximum items that can be dropped is equal to 4/5 of the max drop amount + + else{finalItemDrop = Interpolate_Decelerate(minitemdrop, maxitemdrop*(4/5), killTimer/(maxTimer*4/5));} + + // If the player has lost a life, lock the number of items to the lowest possible + + if(ObjEnemyBossScene_GetInfo(targetscene, INFO_PLAYER_SHOOTDOWN_COUNT) > 0){ + finalItemDrop = minitemdrop; + itemType = POINT_REGULAR; + } + + DeleteShotAll(TYPE_ALL,TYPE_ITEM); + + SetPlayerInvincibilityFrame(120); + + // Common Data + + NotifyEventAll(EV_SINGLE_ITEM_DROP, ObjMove_GetX(targetenemy), ObjMove_GetY(targetenemy), finalItemDrop, itemType); + + wait(120); + + float[] enemyPos = [ObjMove_GetX(targetenemy), ObjMove_GetY(targetenemy)]; + + SetCommonData("Entering PIV", GetAreaCommonData("PIV", "currentvalue", 10000)); + SetCommonData("Boss Position X", enemyPos[0]); + SetCommonData("Boss Position Y", enemyPos[1]); + + Obj_Delete(targetenemy); + +} + +////// OLD/LEGACY ////// +// Basic post-death handling after every attack (Duo). + +function _GoToBrazilDuo(targetscene, targetenemy, targetenemyA, targetenemyB, returnXA, returnYA, returnXB, returnYB, bool isnon, int itemdropamount){ + + while(ObjEnemy_GetInfo(targetenemy, INFO_LIFE) > 0){ + yield; + } + + DeleteShotAll(TYPE_ALL,TYPE_ITEM); + SetPlayerInvincibilityFrame(120); + + // returnX and returnY are the boss positions they return to at the end of every pattern. (I'm too lazy for common data...) + + ObjMove_CancelMovement(targetenemyA); ObjMove_CancelMovement(targetenemyB); + + ObjMove_SetDestAtFrame(targetenemyA, returnXA, returnYA, 45, LERP_DECELERATE); + ObjMove_SetDestAtFrame(targetenemyB, returnXB, returnYB, 45, LERP_DECELERATE); + + async{ + wait(45); + ObjMove_CancelMovement(targetenemyA); ObjMove_CancelMovement(targetenemyB); + ObjMove_SetDestAtFrame(targetenemyA, returnXA, returnYA, 15, LERP_DECELERATE); + ObjMove_SetDestAtFrame(targetenemyB, returnXB, returnYB, 15, LERP_DECELERATE); + ObjMove_SetProcessMovement(targetenemyA, false); + ObjMove_SetProcessMovement(targetenemyB, false); + return; + } + + alternative(isnon) + + case(true){_NonspellItemDrop(targetscene, targetenemyA, itemdropamount); _NonspellItemDrop(targetscene, targetenemyB, itemdropamount);} + + others{_SpellItemDrop(targetscene, targetenemyA, itemdropamount); _SpellItemDrop(targetscene, targetenemyB, itemdropamount);} + + wait(120); + + Obj_Delete(targetenemy); + Obj_Delete(targetenemyA); + Obj_Delete(targetenemyB); + +} + +// Basic post-death handling after every attack (Solo). + +task _GoToBrazil(targetscene, targetenemy, returnX, returnY, bool isnon, int itemdropamount){ + + while(ObjEnemy_GetInfo(targetenemy, INFO_LIFE)>0){ + yield; + } + + DeleteShotAll(TYPE_ALL,TYPE_ITEM); + + SetPlayerInvincibilityFrame(120); + + // ITS COMMON DATA TIME BITCHES + + float[] enemyPos = [ObjMove_GetX(targetenemy), ObjMove_GetY(targetenemy)]; + SetCommonData("Boss Position", enemyPos); + + alternative(isnon) + case(true){_NonspellItemDrop(targetscene, targetenemy, itemdropamount);} + others{_NonspellItemDrop(targetscene, targetenemy, itemdropamount);} + + wait(120); + + Obj_Delete(targetenemy); + +} + +task _GoToBrazilMidboss(targetscene, targetenemy, bool isnon, int itemdropamount){ + + while(ObjEnemy_GetInfo(targetenemy, INFO_LIFE)>0){ + yield; + } + + DeleteShotAll(TYPE_ALL,TYPE_ITEM); + + SetPlayerInvincibilityFrame(120); + + // ITS COMMON DATA TIME BITCHES + + float[] enemyPos = [ObjMove_GetX(targetenemy), ObjMove_GetY(targetenemy)]; + SetCommonData("Boss Position", enemyPos); + + alternative(isnon) + case(true){_NonspellItemDrop(targetscene, targetenemy, itemdropamount);} + others{_NonspellItemDrop(targetscene, targetenemy, itemdropamount);} + + wait(60); + + ObjMove_SetDestAtFrame(targetenemy, enemyPos[0], -150, 45, LERP_SMOOTHER); + + wait(45); + + Obj_Delete(targetenemy); + +} + +// Used after end of last spell for dramatic effect. NOTE TO SELF: REPLACE SOUND & GRAPHICAL EFFECTS + +task _ByeBitch(targetscene, targetenemy){ + + while(ObjEnemyBossScene_GetInfo(targetscene, INFO_CURRENT_LIFE) > 0){ + yield; + } + + /*ObjSound_Load(death, defeatsnd); + ObjSound_SetVolumeRate(death, 30); + ObjSound_SetFade(death, 5);*/ + + let x = ObjMove_GetX(targetenemy); + let y = ObjMove_GetY(targetenemy); + + StartSlow(TARGET_ALL, 30); + SetPlayerInvincibilityFrame(180); + DeleteShotAll(TYPE_ALL,TYPE_ITEM); + //ObjSound_Play(death); + TExplosionA(x,y,10,0.5); + wait(120); + + StopSlow(TARGET_ALL); + //ObjSound_Play(death); + //Obj_Delete(target); + TExplosionA(x,y,10,0.5); + wait(120); + +} + +function _ByeBitches(int targetscene, int targetboss, int targetenemyA, int targetenemyB, int itemdropamount){ + + //wait(120); + + loop{ + float life = ObjEnemy_GetInfo(targetboss, INFO_LIFE); + if(life > 0){yield;} + else{break;} + } + + int death = ObjSound_Create(); + ObjSound_Load(death, defeatsnd); + ObjSound_SetVolumeRate(death, 40); + ObjSound_SetFade(death, 7.5); + + StartSlow(TARGET_ALL, 30); + SetPlayerInvincibilityFrame(180); + DeleteShotAll(TYPE_ALL,TYPE_ITEM); + ObjSound_Play(death); + TExplosionA(ObjMove_GetX(targetenemyA), ObjMove_GetY(targetenemyA), 10, 0.5); + TExplosionA(ObjMove_GetX(targetenemyB), ObjMove_GetY(targetenemyB), 10, 0.5); + wait(120); + + _SpellItemDrop(targetscene, targetenemyA, itemdropamount); + _SpellItemDrop(targetscene, targetenemyB, itemdropamount); + + StopSlow(TARGET_ALL); + + ObjSound_Play(death); + + TExplosionA(ObjMove_GetX(targetenemyA), ObjMove_GetY(targetenemyA), 10, 0.5); + TExplosionA(ObjMove_GetX(targetenemyB), ObjMove_GetY(targetenemyB), 10, 0.5); + + Obj_Delete(targetboss); + Obj_Delete(targetenemyA); + Obj_Delete(targetenemyB); + + wait(120); + +} + +/* + +//////////////// GRAPHICAL/VISUAL-RELATED TASKS AND FUNCTIONS //////////////// + +*/ + +// Handles boss markers during boss fights. + +task _BossMarker(int targetenemy, markertex, int left, int top, int right, int bottom, float scale, float heightoffset){ + + int marker = ObjPrim_Create(OBJ_SPRITE_2D); + ObjPrim_SetTexture(marker, markertex); + ObjSprite2D_SetSourceRect(marker, left, top, right, bottom); + ObjSprite2D_SetDestCenter(marker); + ObjRender_SetScaleXYZ(marker, scale); + Obj_SetRenderPriorityI(marker, 19); + ObjRender_SetAlpha(marker, 255); + //ObjRender_SetY(marker, GetStgFrameHeight()+heightoffset); + + while(!Obj_IsDeleted(targetenemy)){ + ObjRender_SetPosition(marker, ObjRender_GetX(targetenemy)+(GetScreenWidth()-GetStgFrameWidth())/2, GetStgFrameHeight()+heightoffset+(GetScreenHeight()-GetStgFrameHeight())/2, 1); + yield; + } + + Obj_Delete(marker); +} + +// Tasks that handle calling a spellcard. No spell card history. + +task _DuoCutin( + image1, image2, + int rectleft, int recttop, int rectright, int rectbottom, + int spellID, string spellname, + float textsize, float bordersize, int bordercolor, int bonusbordercolor, + float textstartx, float textendx, int render1, int render2 + ){ + + // Handle the appearance and disappearances of the images + + // 0 = upwards, 1 = downwards || 0 = left, 1 = right + + // Handle the spell text + + int spelltext = ObjText_Create(); + ObjText_SetText(spelltext, spellname); + ObjText_SetFontType(spelltext, "Connecting Chain Handserif"); + + ObjText_SetFontSize(spelltext, textsize); + ObjText_SetFontColorTop(spelltext, 255, 255, 255); + ObjText_SetFontColorBottom(spelltext, 255, 255, 255); + ObjText_SetFontBorderType(spelltext, BORDER_FULL); + ObjText_SetFontBorderColor(spelltext, bordercolor); + ObjText_SetFontBorderWidth(spelltext, bordersize); + + ObjText_SetHorizontalAlignment(spelltext, ALIGNMENT_RIGHT); + ObjText_SetMaxWidth(spelltext, GetStgFrameWidth); + Obj_SetRenderPriorityI(spelltext, 79); + ObjRender_SetPosition(spelltext, textstartx, GetStgFrameHeight/8-10, 0); // WIP + ObjRender_SetAlpha(spelltext, 255); + + // Handle the spell bonus + + let objBonus = ObjText_Create(); + ObjText_SetFontSize(objBonus, 38); + ObjText_SetFontBold(objBonus, true); + ObjText_SetFontType(objBonus, "Anke Calligraph"); + ObjText_SetFontColorTop(objBonus, 255, 255, 255); + ObjText_SetFontColorBottom(objBonus, 255, 255, 255); + ObjText_SetFontBorderType(objBonus, BORDER_FULL); + ObjText_SetFontBorderColor(objBonus, bonusbordercolor); + ObjText_SetFontBorderWidth(objBonus, 2); + + ObjText_SetHorizontalAlignment(objBonus, ALIGNMENT_RIGHT); + ObjText_SetMaxWidth(objBonus, GetStgFrameWidth-24); + Obj_SetRenderPriorityI(objBonus, 79); + ObjRender_SetPosition(objBonus, textendx, GetStgFrameHeight/8+12, 0); // WIP + ObjRender_SetAlpha(objBonus, 255); + + async{ + while(ObjEnemyBossScene_GetInfo(spellID, INFO_PLAYER_SHOOTDOWN_COUNT) == 0 && ObjEnemyBossScene_GetInfo(spellID, INFO_PLAYER_SPELL_COUNT) == 0) + { + int score = trunc(ObjEnemyBossScene_GetInfo(spellID, INFO_SPELL_SCORE)/10) * 10; + score = min(score, 9999999990); + let yass = DigitToCommaArray(score); + ObjText_SetText(objBonus, yass); + yield; + } + ObjText_SetText(objBonus, ":("); + } + + // Actually call the tasks and functions here + + // Mm + + int objCutin1 = _Create2DImage(image1, rectleft, recttop, rectright, rectbottom); + int objCutin2 = _Create2DImage(image2, rectleft, recttop, rectright, rectbottom); + + Obj_SetRenderPriorityI(objCutin1, render1); + Obj_SetRenderPriorityI(objCutin2, render2); + + _MoveVertical(objCutin1, 0, 0); + _MoveVertical(objCutin2, 1, 1); + + //WriteLog(ObjRender_GetY(objCutin1)); + + //_MoveIntoPlace(spelltext, textstartx, textendx); + _FadeAtPlayer(spelltext); + _FadeAtPlayer(objBonus); + + while(ObjEnemyBossScene_GetInfo(spellID, INFO_CURRENT_LIFE) > 0){yield;} + + Obj_Delete(spelltext); + Obj_Delete(objBonus); + + //return; + +} + +task _SoloCutin( + image, + int rectleft, int recttop, int rectright, int rectbottom, + int bossID, int spellID, string spellname, + float textsize, float bordersize, int bordercolor, int bonusbordercolor, + float textstartx, float texty, int render + ){ + + // Handle the spell text + + int spelltext = ObjText_Create(); + ObjText_SetText(spelltext, spellname); + ObjText_SetFontType(spelltext, "Connecting Chain Handserif"); + + ObjText_SetFontSize(spelltext, textsize); + ObjText_SetFontColorTop(spelltext, 255, 255, 255); + ObjText_SetFontColorBottom(spelltext, 255, 255, 255); + ObjText_SetFontBorderType(spelltext, BORDER_FULL); + ObjText_SetFontBorderColor(spelltext, bordercolor); + ObjText_SetFontBorderWidth(spelltext, bordersize); + + ObjText_SetHorizontalAlignment(spelltext, ALIGNMENT_LEFT); + //ObjText_SetMaxWidth(spelltext, GetStgFrameWidth); + Obj_SetRenderPriorityI(spelltext, 79); + ObjRender_SetPosition(spelltext, textstartx, texty, 0); // WIP + ObjRender_SetAlpha(spelltext, 255); + + // Handle the spell bonus + + let objBonus = ObjText_Create(); + ObjText_SetFontSize(objBonus, textsize*1.25); + ObjText_SetFontBold(objBonus, true); + ObjText_SetFontType(objBonus, "Anke Calligraph"); + ObjText_SetFontColorTop(objBonus, 255, 255, 255); + ObjText_SetFontColorBottom(objBonus, 255, 255, 255); + ObjText_SetFontBorderType(objBonus, BORDER_FULL); + ObjText_SetFontBorderColor(objBonus, bonusbordercolor); + ObjText_SetFontBorderWidth(objBonus, 2); + + ObjText_SetHorizontalAlignment(objBonus, ALIGNMENT_LEFT); + //ObjText_SetMaxWidth(objBonus, GetStgFrameWidth-24); + Obj_SetRenderPriorityI(objBonus, 79); + ObjRender_SetPosition(objBonus, textstartx, texty+textsize-5, 0); // WIP + ObjRender_SetAlpha(objBonus, 255); + + async{ + while(ObjEnemyBossScene_GetInfo(spellID, INFO_PLAYER_SHOOTDOWN_COUNT) == 0 && ObjEnemyBossScene_GetInfo(spellID, INFO_PLAYER_SPELL_COUNT) == 0) + { + int score = trunc(ObjEnemyBossScene_GetInfo(spellID, INFO_SPELL_SCORE)/10) * 10; + score = min(score, 9999999990); + let yass = DigitToCommaArray(score); + ObjText_SetText(objBonus, "Bonus: " ~ yass); + yield; + } + ObjText_SetText(objBonus, "Bonus Failed..."); + } + + // Actually call the tasks and functions here + + // Mm + + int objCutin = _Create2DImage(image, rectleft, recttop, rectright, rectbottom); + + Obj_SetRenderPriorityI(objCutin, render); + + _MoveDiagonal(objCutin, GetStgFrameWidth()*1.25, -120, GetStgFrameWidth()/2, GetStgFrameHeight()/2, -120, GetStgFrameHeight()*1.25); + //WriteLog(Obj_IsVisible(spelltext)); + + //_MoveIntoPlace(spelltext, textstartx, textendx); + _FadeAtPlayer(spelltext); + _FadeAtPlayer(objBonus); + + while(ObjEnemyBossScene_GetInfo(spellID, INFO_CURRENT_LIFE) > 0){yield;} + + Obj_Delete(spelltext); + Obj_Delete(objBonus); + + //return; + +} + +function DigitToCommaArray(num){ //Natashinitai + + let srcStr = IntToString(num); + let res = []; + let nChar = 0; + for(let i = length(srcStr) - 1; i >= 0; i--){ + res = [srcStr[i]] ~ res; + nChar++; + if(nChar % 3 == 0 && i > 0) res = "," ~ res; + } + return res; + +} + +// Tasks meant to be used with cutin tasks. + +task _MoveVertical(int target, int move, int widthposition){ + + float positionstart = [GetStgFrameHeight()*1.5, -GetStgFrameHeight()][move]; + float positionmid = GetStgFrameHeight()/2; + float positionend = [-GetStgFrameHeight()*1.5, GetStgFrameHeight()*1.5][move]; + + float positionhort = [3*GetStgFrameWidth/8, 6*GetStgFrameWidth/8][widthposition]; + + ObjRender_SetPosition(target, positionhort, positionstart, 0); + + ascent(i in 0..30){ + ObjRender_SetY(target, Interpolate_Decelerate(positionstart, positionmid, i/30)); + yield; + } + + wait(30); + + ascent(i in 0..30){ + ObjRender_SetY(target, Interpolate_Accelerate(positionmid, positionend, i/30)); + yield; + } + + Obj_Delete(target); + + return; + +} + +task _MoveDiagonal(int target, int startx, int starty, int midx, int midy, int endx, int endy){ + + //" + + ObjRender_SetPosition(target, startx, endx, 1); + + ascent(i in 0..30){ + ObjRender_SetPosition(target, Interpolate_Decelerate(startx, midx, i/30), Interpolate_Decelerate(starty, midy, i/30), 1); + ObjRender_SetAlpha(target, Interpolate_Decelerate(0, 255, i/30)); + yield; + } + + wait(30); + + ascent(i in 0..30){ + ObjRender_SetPosition(target, Interpolate_Decelerate(midx, endx, i/30), Interpolate_Decelerate(midy, endy, i/30), 1); + ObjRender_SetAlpha(target, Interpolate_Decelerate(255, 0, i/30)); + yield; + } + + return; + +} + +task _MoveIntoPlace(int target, int startx, int endx){ + ascent(i in 0..30){ + ObjRender_SetX(target, Interpolate_Decelerate(startx, endx, i/30)); + ObjRender_SetAlpha(target, Interpolate_Decelerate(0, 255, i/30)); + yield; + } + return; +} + +task _FadeAtPlayer(int target){ + wait(30); + while(!Obj_IsDeleted(target)){ + int player = GetPlayerObjectID(); + if(ObjRender_GetY(player) <= GetStgFrameHeight()/3.5){ObjRender_SetAlpha(target, 60);} + else{ObjRender_SetAlpha(target, 255);} + yield; + } + return; +} + +// Enemy render tasks + +/* +These render tasks assume the order of the spritesheet goes like this: + +Idle Idle2 Idle3 ... +Left Left2 Left3 ... +Right + +*/ + +task _RenderEnemyMovement(int obj, int frame, int offsetleft, int offsettop, int width, int height, float flipscale, int frameno, int speed){ + + ObjSprite2D_SetSourceRect(obj, offsetleft+width*floor(frame/speed), offsettop, width+width*floor(frame/speed), offsettop+height); + ObjRender_SetScaleX(obj, flipscale); + +} + +task _EnemyRenderFull(int enemyobj, int texture, int offsetleft, int offsettop, int width, int height, int framenoidle, int framenomovement, int speed){ + + int aniidle = 0; + int animove = 0; + + while(!Obj_IsDeleted(enemyobj)){ + + float dir = ObjMove_GetAngle(enemyobj); + float speed = ObjMove_GetSpeed(enemyobj); + + // Idle + if (speed == 0){ + _RenderEnemyMovement(enemyobj, aniidle, offsetleft, offsettop, width, height, 1, framenoidle, speed); + aniidle++; + if(aniidle >= speed*framenoidle){aniidle = 0;} + } + // Left + else if (cos(dir) < 0){ + _RenderEnemyMovement(enemyobj, aniidle, offsetleft, offsettop+height, width, height*2, 1, framenomovement, speed); + animove++; + if(animove >= speed*framenomovement){animove = 0;} + } + // Right + else if (cos(dir) > 0){ + _RenderEnemyMovement(enemyobj, aniidle, offsetleft, offsettop+height*2, width, height*3, 1, framenomovement, speed); + animove++; + if(animove >= speed*framenomovement){animove = 0;} + } + yield; + } +} + +// Enemy deletion/explosion effects. + +// This particle list is used for all instances of the effect. + +task _EffectListPreRender( + int targetList, + texture, int[] rect + ){ + + ObjPrim_SetTexture(targetList, texture); + + Obj_SetRenderPriorityI(targetList, 39); + ObjPrim_SetPrimitiveType(targetList, PRIMITIVE_TRIANGLELIST); + ObjPrim_SetVertexCount(targetList, 4); + + ObjRender_SetBlendType(targetList, BLEND_ALPHA); + + // Left-top, right-top, left-bottom, right-bottom + + ObjPrim_SetVertexUVT(targetList, 0, rect[0], rect[1]); + ObjPrim_SetVertexUVT(targetList, 1, rect[2], rect[1]); + ObjPrim_SetVertexUVT(targetList, 2, rect[0], rect[3]); + ObjPrim_SetVertexUVT(targetList, 3, rect[2], rect[3]); + + // Vertex positions are offset with deltas so that the sprite is centered + + float dU = (rect[2] - rect[0])/2; + float dV = (rect[3] - rect[1])/2; + + ObjPrim_SetVertexPosition(targetList, 0, -dU, -dV, 1); + ObjPrim_SetVertexPosition(targetList, 1, dU, -dV, 1); + ObjPrim_SetVertexPosition(targetList, 2, -dU, dV, 1); + ObjPrim_SetVertexPosition(targetList, 3, dU, dV, 1); + + ObjPrim_SetVertexIndex(targetList, [0, 1, 2, 1, 2, 3]); + + } + +// Drop a number of point items and petals depending on how fast you kill the enemy and how close you are to them. + +task _EnemyItemDrop( + int ID, + int minPoint, int minPIV, + int maxPoint, int maxPIV, + int maxTimer, int maxDist + ){ + + //wait(spawnTime+5); + float enmX = ObjMove_GetX(ID), enmY = ObjMove_GetY(ID); + int Bitch = ID; + float timer = 1; + float dmgCheck = 0; + + ObjEnemy_SetDamageRate(Bitch, 100, 100); + + while(ObjEnemy_GetInfo(Bitch, INFO_LIFE) > 0){ + enmX = ObjMove_GetX(Bitch); + enmY = ObjMove_GetY(Bitch); + dmgCheck = ObjEnemy_GetInfo(Bitch, INFO_DAMAGE_PREVIOUS_FRAME); + timer++; + yield; + } + + if( + (-96 < enmX && enmX < STG_WIDTH+96) + && + (-96 < enmY && enmY < STG_HEIGHT+96) + ) + + { + _ExplosionEffect(enmX, enmY, PetalEffect); + //_ScorePopup(float enmX, float enmY, int pointNum, int pivNum); + + // NotifyEvent is faster than NotifyEventAll, considering how the item event will be called many times. + + NotifyEvent(itemScript, EV_DROP_POINT_ENEMY, [enmX, enmY], timer, maxTimer, minPoint, maxPoint); + NotifyEvent(itemScript, EV_DROP_PIV_ENEMY, GetPlayerObjectID(), [enmX, enmY], minPIV, maxPIV, maxDist); + } + +} + +// Enemy go Boom + +/* +5 flower petals appear from the enemy and spin outwards. +Their angle constantly changes and their alpha lowers over time. +*/ + +task _ExplosionEffect(float enmX, float enmY, int targetList){ + + int i = 0; + int effectLength = 45; + int effectNum = 5; + int dir = 1; + + TExplosionA(enmX, enmY, 255/effectLength, 9/effectLength); + + /*ascent(i in 0..effectNum){ + _CreatePetal(rand(5, 10)*dir, rand(5, 10)*dir, rand(0, 360)); + dir *= -1; + //_CreatePetal(rand(50, 80), rand(-80, -50), rand(0, 360)); + }*/ + + _CreatePetal(rand(8, 11), rand(-8, -11), rand(0, 360)); + _CreatePetal(rand(-11, -8), rand(-2, 2), rand(0, 360)); + _CreatePetal(rand(8, 8), rand(-2, 2), rand(0, 360)); + _CreatePetal(rand(-11, -8), rand(8, 11), rand(0, 360)); + _CreatePetal(rand(8, 11), rand(8, 11), rand(0, 360)); + + ObjSound_Play(sfxBoom); + + // Create a petal with: + // x offset every frame, y offset every frame + + task _CreatePetal(float spdX, float spdY, float baseAng){ + + float x = enmX, y = enmY; + let x_speed = spdX; + let y_speed = spdY; + let z_add = rand(-5, 5); + + ascent(i in 0..effectLength){ + _PetalMovement(Interpolate_Decelerate(1.5, 0.5, i/effectLength), Interpolate_Decelerate(255, 0, i/effectLength)); + yield; + } + + task _PetalMovement(scale, alpha){ + + ObjParticleList_SetScale(targetList, scale); + ObjParticleList_SetAngleZ(targetList, baseAng); + ObjParticleList_SetPosition(targetList, x, y, 1); + ObjParticleList_SetAlpha(targetList, alpha); + + //Submits the current data to an instance, cleared every frame. + ObjParticleList_AddInstance(targetList); + + x += x_speed; + y += y_speed; + baseAng += z_add; + + yield; + + } + + } + +} \ No newline at end of file diff --git a/KevinSystem/Universal_Lib.txt b/KevinSystem/Universal_Lib.txt new file mode 100644 index 0000000..ff799b9 --- /dev/null +++ b/KevinSystem/Universal_Lib.txt @@ -0,0 +1,339 @@ +/* -------------------------------------------------------------------- + + /////////////// UNIVERSAL/GENERAL LIBRARY ///////////////// + + A library meant for universal functions and including other libraries. + + -------------------------------------------------------------------- +*/ + +#include "script/KevinSystem/kevin_system/Kevin_ItemLib.txt" +#include "script/KevinSystem/kevin_system/Kevin_ItemConst.txt" +#include "script/default_system/Default_Effect.txt" // Probably change this somewhere down the line. + +#include "script/KevinSystem/GeneralSoundLib.txt" // Ryannlib momento +//#include "script/KevinSystem/TerraShot2x/shot_const.dnh" + +#include "script/KevinSystem/Universal_EnemyLib.dnh" + +#include "script/KevinSystem/KevinShot/shotconst_HD.txt" + +// Convenience constants + +const STG_WIDTH = GetStgFrameWidth(); +const STG_HEIGHT = GetStgFrameHeight(); + +InstallFont("script/KevinSystem/font/Connecting Chain Handserif.ttf"); +InstallFont("script/KevinSystem/font/AnkeCall.ttf"); + +// Placeholder + +let invalid = "script/KevinSystem/img/lol.png"; +let testEnemyTex = "script/game/StageLib/TestEnemy.png"; + +LoadTextureEx(invalid, true, true); +LoadTextureEx(testEnemyTex, true, true); + +int PetalEffect = ObjParticleList_Create(OBJ_PARTICLE_LIST_2D); + +_EffectListPreRender(PetalEffect, testEnemyTex, [512, 0, 768, 256]); +_SoundTask; + +// Simple text object creation (adapted from mkm) + +function CreateTextObject( + float mx, my, size, + string text, font, + int colorTop, colorBottom, + int borderColor, borderWidth, + int renderPriority + ){ + + let obj = ObjText_Create(); + ObjText_SetText(obj, text); + ObjText_SetFontSize(obj, size); + ObjText_SetFontType(obj, font); + ObjText_SetFontColorTop(obj, colorTop); + ObjText_SetFontColorBottom(obj, colorBottom); + ObjText_SetFontBorderType(obj, BORDER_FULL); + ObjText_SetFontBorderColor(obj, borderColor); + ObjText_SetFontBorderWidth(obj, borderWidth); + Obj_SetRenderPriorityI(obj, renderPriority); + ObjRender_SetX(obj, mx); + ObjRender_SetY(obj, my); + return obj; + +} + +// Simple 2D image creation + +function _Create2DImage(imgpath, int rectleft, int recttop, int rectright, int rectbottom){ + + int imgname = ObjPrim_Create(OBJ_SPRITE_2D); + ObjPrim_SetTexture(imgname, imgpath); + ObjSprite2D_SetSourceRect(imgname, rectleft, recttop, rectright, rectbottom); + ObjSprite2D_SetDestCenter(imgname); + //ObjRender_SetPosition(imgname, positionstart) + + return imgname; +} + +// Overload that uses arrays instead + +function _Create2DImage(imgpath, int[] rectarray){ + + int imgname = ObjPrim_Create(OBJ_SPRITE_2D); + ObjPrim_SetTexture(imgname, imgpath); + ObjSprite2D_SetSourceRect(imgname, rectarray); + ObjSprite2D_SetDestCenter(imgname); + //ObjRender_SetPosition(imgname, positionstart) + + return imgname; +} + +// Task to make bullet fade after a certain time, bullet loses hitbox while fading + +task _EnemyShotFade(int target, int time, bool fadedelay, float delaymultiplier){ + ObjShot_SetDeleteFrame(target, time); + if (fadedelay){ + wait(time-time/delaymultiplier); + ObjShot_SetIntersectionEnable(target, false); + ascent(i in 0..time/delaymultiplier){ + ObjRender_SetAlpha(target, Interpolate_Smoother(ObjRender_GetAlpha(target), 0, i/(time/delaymultiplier))); + yield; + } + } + else{ + ascent(i in 0..time){ + ObjRender_SetAlpha(target, Interpolate_Smoother(ObjRender_GetAlpha(target), 0, i/time)); + yield; + } + } + return; +} + +// Delay function by Naudiz + +task _Delay(target, del){ + + ObjShot_SetDelay(target, del); + ObjShot_SetDelayGraphic(target, ObjShot_GetImageID(target)); // unless you already have the ID in the function somewhere, in which case you can just use that, or use any other graphic + ObjShot_SetDelayMode(target, DELAY_LERP, LERP_ACCELERATE, LERP_DECELERATE); // delay mode, scale lerp, alpha lerp (these are the modes I use in my entry) + ObjShot_SetDelayScaleParameter(target, 1, 2, del); // lerps from 2 to 1 scale in del frames (use the value from ObjShot_SetDelay for del) + ObjShot_SetDelayAlphaParameter(target, 1, 0, del); // lerps from 0 to 1 (255) alpha in del frames + + return; +} + +// Overloads by me + +task _Delay(target, del, orgscale, destscale, orgalpha, destalpha, scalelerp, alphalerp){ + + ObjShot_SetDelay(target, del); + ObjShot_SetDelayGraphic(target, ObjShot_GetImageID(target)); + ObjShot_SetDelayMode(target, DELAY_LERP, scalelerp, alphalerp); + ObjShot_SetDelayScaleParameter(target, destscale, orgscale, del); + ObjShot_SetDelayAlphaParameter(target, destalpha, orgalpha, del); + return; + +} + +task _Delay(target, del, orgscale, destscale, orgalpha, destalpha){ + + ObjShot_SetDelay(target, del); + ObjShot_SetDelayGraphic(target, ObjShot_GetImageID(target)); + ObjShot_SetDelayMode(target, DELAY_LERP, LERP_ACCELERATE, LERP_DECELERATE); + ObjShot_SetDelayScaleParameter(target, destscale, orgscale, del); + ObjShot_SetDelayAlphaParameter(target, destalpha, orgalpha, del); + return; + +} + +task _Delay(target, del, orgscale, orgalpha){ + + ObjShot_SetDelay(target, del); + ObjShot_SetDelayGraphic(target, ObjShot_GetImageID(target)); + ObjShot_SetDelayMode(target, DELAY_LERP, LERP_ACCELERATE, LERP_DECELERATE); + ObjShot_SetDelayScaleParameter(target, 1, orgscale, del); + ObjShot_SetDelayAlphaParameter(target, 1, orgalpha, del); + return; + +} + +// Rescales the bullet. Very important. + +task _BulletRescale(target, float scale, bool hitboxscale, hitboxlevel){ + + ObjRender_SetScaleXYZ(target, scale, scale, 1); + + if (hitboxscale){ + ObjShot_SetIntersectionScaleXY(target, scale*hitboxlevel, scale*hitboxlevel); + return; + } + + else{return;} + +} + +// Item drop functions. + +//////////// TO-DO: Move all item creation to the item script, rendering both of these tasks obsolete. //////////// + +task _NonspellItemDrop(int targetscene, int targetenemy, int itemamount){ + + float ex = ObjMove_GetX(targetenemy); + float ey = ObjMove_GetY(targetenemy); + + if(ObjEnemyBossScene_GetInfo(targetscene, INFO_PLAYER_SHOOTDOWN_COUNT) == 0){ + loop(itemamount){ + CreateScoreItem(POINT_REGULAR, rand(ex-90, ex+90), rand(ey-90, ey+90)); + } + } + else{ + loop(trunc(itemamount/2)){ + CreateScoreItem(POINT_REGULAR, rand(ex-90, ex+90), rand(ey-90, ey+90)); + } + } + +} + +task _SpellItemDrop(int targetscene, int targetenemy, int itemamount){ + + float ex = ObjMove_GetX(targetenemy); + float ey = ObjMove_GetY(targetenemy); + + if(ObjEnemyBossScene_GetInfo(targetscene, INFO_PLAYER_SHOOTDOWN_COUNT) == 0 && ObjEnemyBossScene_GetInfo(targetscene, INFO_PLAYER_SPELL_COUNT) == 0){ + loop(itemamount){ + CreateScoreItem(POINT_BHESTIE, rand(ex-90, ex+90), rand(ey-90, ey+90)); + } + } + else if (ObjEnemyBossScene_GetInfo(targetscene, INFO_PLAYER_SHOOTDOWN_COUNT) == 0 && ObjEnemyBossScene_GetInfo(targetscene, INFO_PLAYER_SPELL_COUNT) >= 0){ + loop(trunc(itemamount/2)){ + CreateScoreItem(POINT_BHESTIE, rand(ex-90, ex+90), rand(ey-90, ey+90)); + } + } + else{} + +} + +// By Neck_Logo + +task _CreateCustomTelegraphLine( + float posX_, float posY_, + float initAngle_, float destAngle_, + float initLength_, float destLength_, + float initWidth_, float destWidth_, + int color_, int maxAlpha_, + float growthTime_, float lifeTime_, float fadeTime_ + ) // damn this is some cursed indenting + { + int scene = GetEnemyBossSceneObjectID(); + + let _shotF_Telegraph_Line = ObjParticleList_Create(OBJ_PARTICLE_LIST_2D); + ObjPrim_SetTexture(_shotF_Telegraph_Line, invalid); + + Obj_SetRenderPriorityI(_shotF_Telegraph_Line, 39); + ObjPrim_SetPrimitiveType(_shotF_Telegraph_Line, PRIMITIVE_TRIANGLELIST); + ObjPrim_SetVertexCount(_shotF_Telegraph_Line, 4); + + ObjRender_SetBlendType(_shotF_Telegraph_Line, BLEND_ALPHA); + + // + + float dU = 0.5, dV = 0.5; + // Left-top, right-top, left-bottom, right-bottom + + ObjPrim_SetVertexUVT(_shotF_Telegraph_Line, 0, 0, 0); + ObjPrim_SetVertexUVT(_shotF_Telegraph_Line, 1, 1, 0); + ObjPrim_SetVertexUVT(_shotF_Telegraph_Line, 2, 0, 1); + ObjPrim_SetVertexUVT(_shotF_Telegraph_Line, 3, 1, 1); + + // Vertex positions are offset with deltas so that the sprite is centered + + ObjPrim_SetVertexPosition(_shotF_Telegraph_Line, 0, -dU, -dV, 1); + ObjPrim_SetVertexPosition(_shotF_Telegraph_Line, 1, dU, -dV, 1); + ObjPrim_SetVertexPosition(_shotF_Telegraph_Line, 2, -dU, dV, 1); + ObjPrim_SetVertexPosition(_shotF_Telegraph_Line, 3, dU, dV, 1); + + ObjPrim_SetVertexIndex(_shotF_Telegraph_Line, [0, 1, 2, 1, 2, 3]); + + float angle = initAngle_; + float span = initLength_; + float width = initWidth_; + int alpha = 0; + + //_CreateParticleList(); + _TelegraphLineControl(); + + if(scene != ID_INVALID){ + // growth phase + for (int i = 1; i <= growthTime_ && 0 < ObjEnemyBossScene_GetInfo(scene, INFO_ACTIVE_STEP_TOTAL_LIFE); i++) { + width = Interpolate_Decelerate(initWidth_, destWidth_, i / growthTime_); + alpha = Interpolate_Decelerate(0, maxAlpha_+32, i / growthTime_); + RenderTelegraphLine(); + yield; + } + + // static phase + for (int j = 1; j <= lifeTime_ && 0 < ObjEnemyBossScene_GetInfo(scene, INFO_ACTIVE_STEP_TOTAL_LIFE); j++) { + RenderTelegraphLine(); + yield; + } + + if (!(0 < ObjEnemyBossScene_GetInfo(scene, INFO_ACTIVE_STEP_TOTAL_LIFE))) fadeTime_ = min(fadeTime_, 25); + + } + + else{ + for (int i = 1; i <= growthTime_ ; i++) { + width = Interpolate_Decelerate(initWidth_, destWidth_, i / growthTime_); + alpha = Interpolate_Decelerate(0, maxAlpha_+32, i / growthTime_); + RenderTelegraphLine(); + yield; + } + + // static phase + for (int j = 1; j <= lifeTime_; j++) { + RenderTelegraphLine(); + yield; + } + + } + + destWidth_ = width; + maxAlpha_ = alpha; + + // deletion phase + for (int k = 1; k <= fadeTime_; k++) { + width = Interpolate_Accelerate(destWidth_, destWidth_ - (destWidth_ - initWidth_) / 2, k / fadeTime_); + alpha = Interpolate_Accelerate(maxAlpha_+32, 0, k / fadeTime_); + RenderTelegraphLine(); + yield; + } + + Obj_Delete(_shotF_Telegraph_Line); + + task _TelegraphLineControl() { + for (int l = 1; l <= growthTime_ + lifeTime_; l++) { + angle = Interpolate_Decelerate(initAngle_, destAngle_, l / (growthTime_ + lifeTime_)); + span = Interpolate_Decelerate(initLength_, destLength_, l / (growthTime_ + lifeTime_)); + yield; + } + } + + function RenderTelegraphLine() { + + float midX = posX_ + span * cos(angle) + (width / 2) * cos(angle + 90); + float midY = posY_ + span * sin(angle) + (width / 2) * sin(angle + 90); + + ObjParticleList_SetPosition(_shotF_Telegraph_Line, midX, midY, 1); + ObjParticleList_SetScale(_shotF_Telegraph_Line, span, width, 1); + ObjParticleList_SetAngleZ(_shotF_Telegraph_Line, angle); + ObjParticleList_SetColor(_shotF_Telegraph_Line, color_); + ObjParticleList_SetAlpha(_shotF_Telegraph_Line, alpha); + ObjParticleList_AddInstance(_shotF_Telegraph_Line); + + } + + //return _shotF_Telegraph_Line; +} diff --git a/KevinSystem/font/AnkeCall.ttf b/KevinSystem/font/AnkeCall.ttf new file mode 100644 index 0000000..0750e2c Binary files /dev/null and b/KevinSystem/font/AnkeCall.ttf differ diff --git a/KevinSystem/font/Connecting Chain Handserif.ttf b/KevinSystem/font/Connecting Chain Handserif.ttf new file mode 100644 index 0000000..5da2352 Binary files /dev/null and b/KevinSystem/font/Connecting Chain Handserif.ttf differ diff --git a/KevinSystem/font/Exotic 350 Demi Bold BT.ttf b/KevinSystem/font/Exotic 350 Demi Bold BT.ttf new file mode 100644 index 0000000..a52b433 Binary files /dev/null and b/KevinSystem/font/Exotic 350 Demi Bold BT.ttf differ diff --git a/KevinSystem/font/FOT-NewCinemaAStd-D_1.otf b/KevinSystem/font/FOT-NewCinemaAStd-D_1.otf new file mode 100644 index 0000000..32665c5 Binary files /dev/null and b/KevinSystem/font/FOT-NewCinemaAStd-D_1.otf differ diff --git a/KevinSystem/font/Revue Regular.ttf b/KevinSystem/font/Revue Regular.ttf new file mode 100644 index 0000000..493921f Binary files /dev/null and b/KevinSystem/font/Revue Regular.ttf differ diff --git a/KevinSystem/font/Uni Sans Heavy.otf b/KevinSystem/font/Uni Sans Heavy.otf new file mode 100644 index 0000000..facd333 Binary files /dev/null and b/KevinSystem/font/Uni Sans Heavy.otf differ diff --git a/KevinSystem/font/YasashisaGothicBold-V2.otf b/KevinSystem/font/YasashisaGothicBold-V2.otf new file mode 100644 index 0000000..41b475b Binary files /dev/null and b/KevinSystem/font/YasashisaGothicBold-V2.otf differ diff --git a/KevinSystem/font/origa___.ttf b/KevinSystem/font/origa___.ttf new file mode 100644 index 0000000..61615f2 Binary files /dev/null and b/KevinSystem/font/origa___.ttf differ diff --git a/KevinSystem/font/unispace rg.ttf b/KevinSystem/font/unispace rg.ttf new file mode 100644 index 0000000..66284c3 Binary files /dev/null and b/KevinSystem/font/unispace rg.ttf differ diff --git a/KevinSystem/img/Default_Background_IceMountain.bmp b/KevinSystem/img/Default_Background_IceMountain.bmp new file mode 100644 index 0000000..61db0b6 Binary files /dev/null and b/KevinSystem/img/Default_Background_IceMountain.bmp differ diff --git a/KevinSystem/img/Default_Background_IceMountain.mqo b/KevinSystem/img/Default_Background_IceMountain.mqo new file mode 100644 index 0000000..f2388aa --- /dev/null +++ b/KevinSystem/img/Default_Background_IceMountain.mqo @@ -0,0 +1,249 @@ +Metasequoia Document +Format Text Ver 1.0 + +Scene { + pos -30.1096 -34.3943 789.2167 + lookat 0.0000 0.0000 0.0000 + head -1.8300 + pich 0.5300 + ortho 0 + zoom2 2.0091 + amb 0.250 0.250 0.250 +} +Material 1 { + "mat0" shader(3) col(1.000 1.000 1.000 1.000) dif(1.000) amb(0.600) emi(0.000) spc(0.000) power(1.00) tex("Default_Background_IceMountain.bmp") +} +Object "obj0" { + visible 15 + locking 0 + shading 1 + facet 59.5 + color 0.898 0.498 0.698 + color_type 0 + vertex 121 { + 500.0000 0.0000 500.0000 + 400.0000 0.0000 500.0000 + 400.0000 0.0000 400.0000 + 500.0000 0.0000 400.0000 + 300.0000 0.0000 500.0000 + 300.0000 0.0000 400.0000 + 200.0000 0.0000 500.0000 + 200.0000 0.0000 400.0000 + 100.0000 0.0000 500.0000 + 100.0000 0.0000 400.0000 + 0.0000 0.0000 500.0000 + 0.0000 0.0000 400.0000 + -100.0000 0.0000 500.0000 + -100.0000 0.0000 400.0000 + -200.0000 0.0000 500.0000 + -200.0000 0.0000 400.0000 + -300.0000 0.0000 500.0000 + -300.0000 0.0000 400.0000 + -400.0000 0.0000 500.0000 + -400.0000 0.0000 400.0000 + -500.0000 0.0000 500.0000 + -500.0000 0.0000 400.0000 + 400.0000 0.0000 300.0000 + 500.0000 0.0000 300.0000 + 300.0000 0.0000 300.0000 + 181.9993 25.4220 251.4612 + 87.5351 67.6823 172.7408 + 44.9009 66.8717 169.9153 + -84.3673 81.3440 243.9148 + -165.8140 45.4173 301.9575 + -265.8140 45.4173 301.9575 + -400.0000 0.0000 300.0000 + -500.0000 0.0000 300.0000 + 400.0000 0.0000 200.0000 + 500.0000 0.0000 200.0000 + 298.8597 14.8172 185.7207 + 126.2485 97.3682 134.2916 + 23.1660 119.7628 65.2812 + -48.3018 103.9974 84.5904 + -78.9084 75.3832 146.5701 + -165.8140 45.4173 201.9575 + -265.8140 45.4173 201.9575 + -400.0000 0.0000 200.0000 + -500.0000 0.0000 200.0000 + 400.0000 0.0000 100.0000 + 500.0000 0.0000 100.0000 + 255.6389 58.0200 114.1542 + 142.7559 56.0312 43.6297 + 36.2995 41.0596 -5.4791 + -62.4664 75.8076 -4.6157 + -140.5926 75.4124 49.9508 + -231.5631 8.7596 76.5071 + -300.0000 0.0000 100.0000 + -400.0000 0.0000 100.0000 + -500.0000 0.0000 100.0000 + 400.0000 0.0000 0.0000 + 500.0000 0.0000 0.0000 + 221.8938 66.4581 1.9473 + 143.8961 41.2140 -42.0910 + 15.1947 34.4286 -102.5772 + -71.9221 36.4174 -32.0527 + -158.7284 63.2710 -47.6829 + -211.9965 33.8983 -68.7922 + -280.4333 25.1387 -45.2993 + -400.0000 0.0000 0.0000 + -500.0000 0.0000 0.0000 + 400.0000 0.0000 -100.0000 + 500.0000 0.0000 -100.0000 + 300.0000 0.0000 -100.0000 + 200.0000 0.0000 -100.0000 + 28.0779 36.4174 -132.0527 + -71.9221 36.4174 -132.0527 + -109.7092 10.8928 -120.7280 + -174.9080 20.0401 -134.2268 + -274.9080 20.0401 -134.2268 + -400.0000 0.0000 -100.0000 + -500.0000 0.0000 -100.0000 + 400.0000 0.0000 -200.0000 + 500.0000 0.0000 -200.0000 + 258.7267 31.4519 -195.8992 + 154.2999 93.4632 -171.4050 + 83.7472 49.4622 -230.7452 + -16.2528 49.4622 -230.7452 + -139.3118 37.0325 -183.7692 + -214.2198 57.0726 -217.9960 + -274.9080 20.0401 -234.2268 + -400.0000 0.0000 -200.0000 + -500.0000 0.0000 -200.0000 + 400.0000 0.0000 -300.0000 + 500.0000 0.0000 -300.0000 + 287.1706 10.4937 -295.7311 + 187.1706 10.4937 -295.7311 + 125.2088 40.5356 -370.5968 + 25.2089 40.5356 -370.5968 + -139.3118 37.0325 -283.7693 + -239.3118 37.0325 -283.7693 + -300.0000 0.0000 -300.0000 + -400.0000 0.0000 -300.0000 + -500.0000 0.0000 -300.0000 + 400.0000 0.0000 -400.0000 + 500.0000 0.0000 -400.0000 + 300.0000 0.0000 -400.0000 + 200.0000 0.0000 -400.0000 + 100.0000 0.0000 -400.0000 + 0.0000 0.0000 -400.0000 + -100.0000 0.0000 -400.0000 + -200.0000 0.0000 -400.0000 + -300.0000 0.0000 -400.0000 + -400.0000 0.0000 -400.0000 + -500.0000 0.0000 -400.0000 + 400.0000 0.0000 -500.0000 + 500.0000 0.0000 -500.0000 + 300.0000 0.0000 -500.0000 + 200.0000 0.0000 -500.0000 + 100.0000 0.0000 -500.0000 + 0.0000 0.0000 -500.0000 + -100.0000 0.0000 -500.0000 + -200.0000 0.0000 -500.0000 + -300.0000 0.0000 -500.0000 + -400.0000 0.0000 -500.0000 + -500.0000 0.0000 -500.0000 + } + face 100 { + 4 V(0 1 2 3) M(0) UV(0.00000 0.00000 0.10000 0.00000 0.10000 0.10000 0.00000 0.10000) + 4 V(1 4 5 2) M(0) UV(0.10000 0.00000 0.20000 0.00000 0.20000 0.10000 0.10000 0.10000) + 4 V(4 6 7 5) M(0) UV(0.20000 0.00000 0.30000 0.00000 0.30000 0.10000 0.20000 0.10000) + 4 V(6 8 9 7) M(0) UV(0.30000 0.00000 0.40000 0.00000 0.40000 0.10000 0.30000 0.10000) + 4 V(8 10 11 9) M(0) UV(0.40000 0.00000 0.50000 0.00000 0.50000 0.10000 0.40000 0.10000) + 4 V(10 12 13 11) M(0) UV(0.50000 0.00000 0.60000 0.00000 0.60000 0.10000 0.50000 0.10000) + 4 V(12 14 15 13) M(0) UV(0.60000 0.00000 0.70000 0.00000 0.70000 0.10000 0.60000 0.10000) + 4 V(14 16 17 15) M(0) UV(0.70000 0.00000 0.80000 0.00000 0.80000 0.10000 0.70000 0.10000) + 4 V(16 18 19 17) M(0) UV(0.80000 0.00000 0.90000 0.00000 0.90000 0.10000 0.80000 0.10000) + 4 V(18 20 21 19) M(0) UV(0.90000 0.00000 1.00000 0.00000 1.00000 0.10000 0.90000 0.10000) + 4 V(3 2 22 23) M(0) UV(0.00000 0.10000 0.10000 0.10000 0.10000 0.20000 0.00000 0.20000) + 4 V(2 5 24 22) M(0) UV(0.10000 0.10000 0.20000 0.10000 0.20000 0.20000 0.10000 0.20000) + 4 V(5 7 25 24) M(0) UV(0.20000 0.10000 0.30000 0.10000 0.30000 0.20000 0.20000 0.20000) + 4 V(7 9 26 25) M(0) UV(0.30000 0.10000 0.40000 0.10000 0.40000 0.20000 0.30000 0.20000) + 4 V(9 11 27 26) M(0) UV(0.40000 0.10000 0.50000 0.10000 0.50000 0.20000 0.40000 0.20000) + 4 V(11 13 28 27) M(0) UV(0.50000 0.10000 0.60000 0.10000 0.60000 0.20000 0.50000 0.20000) + 4 V(13 15 29 28) M(0) UV(0.60000 0.10000 0.70000 0.10000 0.70000 0.20000 0.60000 0.20000) + 4 V(15 17 30 29) M(0) UV(0.70000 0.10000 0.80000 0.10000 0.80000 0.20000 0.70000 0.20000) + 4 V(17 19 31 30) M(0) UV(0.80000 0.10000 0.90000 0.10000 0.90000 0.20000 0.80000 0.20000) + 4 V(19 21 32 31) M(0) UV(0.90000 0.10000 1.00000 0.10000 1.00000 0.20000 0.90000 0.20000) + 4 V(23 22 33 34) M(0) UV(0.00000 0.20000 0.10000 0.20000 0.10000 0.30000 0.00000 0.30000) + 4 V(22 24 35 33) M(0) UV(0.10000 0.20000 0.20000 0.20000 0.20000 0.30000 0.10000 0.30000) + 4 V(24 25 36 35) M(0) UV(0.20000 0.20000 0.30000 0.20000 0.30000 0.30000 0.20000 0.30000) + 4 V(25 26 37 36) M(0) UV(0.30000 0.20000 0.40000 0.20000 0.40000 0.30000 0.30000 0.30000) + 4 V(26 27 38 37) M(0) UV(0.40000 0.20000 0.50000 0.20000 0.50000 0.30000 0.40000 0.30000) + 4 V(27 28 39 38) M(0) UV(0.50000 0.20000 0.60000 0.20000 0.60000 0.30000 0.50000 0.30000) + 4 V(28 29 40 39) M(0) UV(0.60000 0.20000 0.70000 0.20000 0.70000 0.30000 0.60000 0.30000) + 4 V(29 30 41 40) M(0) UV(0.70000 0.20000 0.80000 0.20000 0.80000 0.30000 0.70000 0.30000) + 4 V(30 31 42 41) M(0) UV(0.80000 0.20000 0.90000 0.20000 0.90000 0.30000 0.80000 0.30000) + 4 V(31 32 43 42) M(0) UV(0.90000 0.20000 1.00000 0.20000 1.00000 0.30000 0.90000 0.30000) + 4 V(34 33 44 45) M(0) UV(0.00000 0.30000 0.10000 0.30000 0.10000 0.40000 0.00000 0.40000) + 4 V(33 35 46 44) M(0) UV(0.10000 0.30000 0.20000 0.30000 0.20000 0.40000 0.10000 0.40000) + 4 V(35 36 47 46) M(0) UV(0.20000 0.30000 0.30000 0.30000 0.30000 0.40000 0.20000 0.40000) + 4 V(36 37 48 47) M(0) UV(0.30000 0.30000 0.40000 0.30000 0.40000 0.40000 0.30000 0.40000) + 4 V(37 38 49 48) M(0) UV(0.40000 0.30000 0.50000 0.30000 0.50000 0.40000 0.40000 0.40000) + 4 V(38 39 50 49) M(0) UV(0.50000 0.30000 0.60000 0.30000 0.60000 0.40000 0.50000 0.40000) + 4 V(39 40 51 50) M(0) UV(0.60000 0.30000 0.70000 0.30000 0.70000 0.40000 0.60000 0.40000) + 4 V(40 41 52 51) M(0) UV(0.70000 0.30000 0.80000 0.30000 0.80000 0.40000 0.70000 0.40000) + 4 V(41 42 53 52) M(0) UV(0.80000 0.30000 0.90000 0.30000 0.90000 0.40000 0.80000 0.40000) + 4 V(42 43 54 53) M(0) UV(0.90000 0.30000 1.00000 0.30000 1.00000 0.40000 0.90000 0.40000) + 4 V(45 44 55 56) M(0) UV(0.00000 0.40000 0.10000 0.40000 0.10000 0.50000 0.00000 0.50000) + 4 V(44 46 57 55) M(0) UV(0.10000 0.40000 0.20000 0.40000 0.20000 0.50000 0.10000 0.50000) + 4 V(46 47 58 57) M(0) UV(0.20000 0.40000 0.30000 0.40000 0.30000 0.50000 0.20000 0.50000) + 4 V(47 48 59 58) M(0) UV(0.30000 0.40000 0.40000 0.40000 0.40000 0.50000 0.30000 0.50000) + 4 V(48 49 60 59) M(0) UV(0.40000 0.40000 0.50000 0.40000 0.50000 0.50000 0.40000 0.50000) + 4 V(49 50 61 60) M(0) UV(0.50000 0.40000 0.60000 0.40000 0.60000 0.50000 0.50000 0.50000) + 4 V(50 51 62 61) M(0) UV(0.60000 0.40000 0.70000 0.40000 0.70000 0.50000 0.60000 0.50000) + 4 V(51 52 63 62) M(0) UV(0.70000 0.40000 0.80000 0.40000 0.80000 0.50000 0.70000 0.50000) + 4 V(52 53 64 63) M(0) UV(0.80000 0.40000 0.90000 0.40000 0.90000 0.50000 0.80000 0.50000) + 4 V(53 54 65 64) M(0) UV(0.90000 0.40000 1.00000 0.40000 1.00000 0.50000 0.90000 0.50000) + 4 V(56 55 66 67) M(0) UV(0.00000 0.50000 0.10000 0.50000 0.10000 0.60000 0.00000 0.60000) + 4 V(55 57 68 66) M(0) UV(0.10000 0.50000 0.20000 0.50000 0.20000 0.60000 0.10000 0.60000) + 4 V(57 58 69 68) M(0) UV(0.20000 0.50000 0.30000 0.50000 0.30000 0.60000 0.20000 0.60000) + 4 V(58 59 70 69) M(0) UV(0.30000 0.50000 0.40000 0.50000 0.40000 0.60000 0.30000 0.60000) + 4 V(59 60 71 70) M(0) UV(0.40000 0.50000 0.50000 0.50000 0.50000 0.60000 0.40000 0.60000) + 4 V(60 61 72 71) M(0) UV(0.50000 0.50000 0.60000 0.50000 0.60000 0.60000 0.50000 0.60000) + 4 V(61 62 73 72) M(0) UV(0.60000 0.50000 0.70000 0.50000 0.70000 0.60000 0.60000 0.60000) + 4 V(62 63 74 73) M(0) UV(0.70000 0.50000 0.80000 0.50000 0.80000 0.60000 0.70000 0.60000) + 4 V(63 64 75 74) M(0) UV(0.80000 0.50000 0.90000 0.50000 0.90000 0.60000 0.80000 0.60000) + 4 V(64 65 76 75) M(0) UV(0.90000 0.50000 1.00000 0.50000 1.00000 0.60000 0.90000 0.60000) + 4 V(67 66 77 78) M(0) UV(0.00000 0.60000 0.10000 0.60000 0.10000 0.70000 0.00000 0.70000) + 4 V(66 68 79 77) M(0) UV(0.10000 0.60000 0.20000 0.60000 0.20000 0.70000 0.10000 0.70000) + 4 V(68 69 80 79) M(0) UV(0.20000 0.60000 0.30000 0.60000 0.30000 0.70000 0.20000 0.70000) + 4 V(69 70 81 80) M(0) UV(0.30000 0.60000 0.40000 0.60000 0.40000 0.70000 0.30000 0.70000) + 4 V(70 71 82 81) M(0) UV(0.40000 0.60000 0.50000 0.60000 0.50000 0.70000 0.40000 0.70000) + 4 V(71 72 83 82) M(0) UV(0.50000 0.60000 0.60000 0.60000 0.60000 0.70000 0.50000 0.70000) + 4 V(72 73 84 83) M(0) UV(0.60000 0.60000 0.70000 0.60000 0.70000 0.70000 0.60000 0.70000) + 4 V(73 74 85 84) M(0) UV(0.70000 0.60000 0.80000 0.60000 0.80000 0.70000 0.70000 0.70000) + 4 V(74 75 86 85) M(0) UV(0.80000 0.60000 0.90000 0.60000 0.90000 0.70000 0.80000 0.70000) + 4 V(75 76 87 86) M(0) UV(0.90000 0.60000 1.00000 0.60000 1.00000 0.70000 0.90000 0.70000) + 4 V(78 77 88 89) M(0) UV(0.00000 0.70000 0.10000 0.70000 0.10000 0.80000 0.00000 0.80000) + 4 V(77 79 90 88) M(0) UV(0.10000 0.70000 0.20000 0.70000 0.20000 0.80000 0.10000 0.80000) + 4 V(79 80 91 90) M(0) UV(0.20000 0.70000 0.30000 0.70000 0.30000 0.80000 0.20000 0.80000) + 4 V(80 81 92 91) M(0) UV(0.30000 0.70000 0.40000 0.70000 0.40000 0.80000 0.30000 0.80000) + 4 V(81 82 93 92) M(0) UV(0.40000 0.70000 0.50000 0.70000 0.50000 0.80000 0.40000 0.80000) + 4 V(82 83 94 93) M(0) UV(0.50000 0.70000 0.60000 0.70000 0.60000 0.80000 0.50000 0.80000) + 4 V(83 84 95 94) M(0) UV(0.60000 0.70000 0.70000 0.70000 0.70000 0.80000 0.60000 0.80000) + 4 V(84 85 96 95) M(0) UV(0.70000 0.70000 0.80000 0.70000 0.80000 0.80000 0.70000 0.80000) + 4 V(85 86 97 96) M(0) UV(0.80000 0.70000 0.90000 0.70000 0.90000 0.80000 0.80000 0.80000) + 4 V(86 87 98 97) M(0) UV(0.90000 0.70000 1.00000 0.70000 1.00000 0.80000 0.90000 0.80000) + 4 V(89 88 99 100) M(0) UV(0.00000 0.80000 0.10000 0.80000 0.10000 0.90000 0.00000 0.90000) + 4 V(88 90 101 99) M(0) UV(0.10000 0.80000 0.20000 0.80000 0.20000 0.90000 0.10000 0.90000) + 4 V(90 91 102 101) M(0) UV(0.20000 0.80000 0.30000 0.80000 0.30000 0.90000 0.20000 0.90000) + 4 V(91 92 103 102) M(0) UV(0.30000 0.80000 0.40000 0.80000 0.40000 0.90000 0.30000 0.90000) + 4 V(92 93 104 103) M(0) UV(0.40000 0.80000 0.50000 0.80000 0.50000 0.90000 0.40000 0.90000) + 4 V(93 94 105 104) M(0) UV(0.50000 0.80000 0.60000 0.80000 0.60000 0.90000 0.50000 0.90000) + 4 V(94 95 106 105) M(0) UV(0.60000 0.80000 0.70000 0.80000 0.70000 0.90000 0.60000 0.90000) + 4 V(95 96 107 106) M(0) UV(0.70000 0.80000 0.80000 0.80000 0.80000 0.90000 0.70000 0.90000) + 4 V(96 97 108 107) M(0) UV(0.80000 0.80000 0.90000 0.80000 0.90000 0.90000 0.80000 0.90000) + 4 V(97 98 109 108) M(0) UV(0.90000 0.80000 1.00000 0.80000 1.00000 0.90000 0.90000 0.90000) + 4 V(100 99 110 111) M(0) UV(0.00000 0.90000 0.10000 0.90000 0.10000 1.00000 0.00000 1.00000) + 4 V(99 101 112 110) M(0) UV(0.10000 0.90000 0.20000 0.90000 0.20000 1.00000 0.10000 1.00000) + 4 V(101 102 113 112) M(0) UV(0.20000 0.90000 0.30000 0.90000 0.30000 1.00000 0.20000 1.00000) + 4 V(102 103 114 113) M(0) UV(0.30000 0.90000 0.40000 0.90000 0.40000 1.00000 0.30000 1.00000) + 4 V(103 104 115 114) M(0) UV(0.40000 0.90000 0.50000 0.90000 0.50000 1.00000 0.40000 1.00000) + 4 V(104 105 116 115) M(0) UV(0.50000 0.90000 0.60000 0.90000 0.60000 1.00000 0.50000 1.00000) + 4 V(105 106 117 116) M(0) UV(0.60000 0.90000 0.70000 0.90000 0.70000 1.00000 0.60000 1.00000) + 4 V(106 107 118 117) M(0) UV(0.70000 0.90000 0.80000 0.90000 0.80000 1.00000 0.70000 1.00000) + 4 V(107 108 119 118) M(0) UV(0.80000 0.90000 0.90000 0.90000 0.90000 1.00000 0.80000 1.00000) + 4 V(108 109 120 119) M(0) UV(0.90000 0.90000 1.00000 0.90000 1.00000 1.00000 0.90000 1.00000) + } +} +Eof diff --git a/KevinSystem/img/Default_Background_IceMountain_Spell01.png b/KevinSystem/img/Default_Background_IceMountain_Spell01.png new file mode 100644 index 0000000..119af7d Binary files /dev/null and b/KevinSystem/img/Default_Background_IceMountain_Spell01.png differ diff --git a/KevinSystem/img/Default_Background_IceMountain_Spell02.png b/KevinSystem/img/Default_Background_IceMountain_Spell02.png new file mode 100644 index 0000000..c5f0a8a Binary files /dev/null and b/KevinSystem/img/Default_Background_IceMountain_Spell02.png differ diff --git a/KevinSystem/img/Default_Effect.png b/KevinSystem/img/Default_Effect.png new file mode 100644 index 0000000..61b968d Binary files /dev/null and b/KevinSystem/img/Default_Effect.png differ diff --git a/KevinSystem/img/Default_MagicCircle.png b/KevinSystem/img/Default_MagicCircle.png new file mode 100644 index 0000000..0e0d6a1 Binary files /dev/null and b/KevinSystem/img/Default_MagicCircle.png differ diff --git a/KevinSystem/img/Default_Shot.png b/KevinSystem/img/Default_Shot.png new file mode 100644 index 0000000..4cacac2 Binary files /dev/null and b/KevinSystem/img/Default_Shot.png differ diff --git a/KevinSystem/img/Default_System.png b/KevinSystem/img/Default_System.png new file mode 100644 index 0000000..99f86c3 Binary files /dev/null and b/KevinSystem/img/Default_System.png differ diff --git a/KevinSystem/img/Default_SystemBackground.png b/KevinSystem/img/Default_SystemBackground.png new file mode 100644 index 0000000..975f560 Binary files /dev/null and b/KevinSystem/img/Default_SystemBackground.png differ diff --git a/KevinSystem/img/Default_SystemDigit.png b/KevinSystem/img/Default_SystemDigit.png new file mode 100644 index 0000000..4bb15dc Binary files /dev/null and b/KevinSystem/img/Default_SystemDigit.png differ diff --git a/KevinSystem/img/ThiccHUD.png b/KevinSystem/img/ThiccHUD.png new file mode 100644 index 0000000..7130de7 Binary files /dev/null and b/KevinSystem/img/ThiccHUD.png differ diff --git a/KevinSystem/img/ThiccHUD_JP.png b/KevinSystem/img/ThiccHUD_JP.png new file mode 100644 index 0000000..f6263ca Binary files /dev/null and b/KevinSystem/img/ThiccHUD_JP.png differ diff --git a/KevinSystem/img/lifebar.png b/KevinSystem/img/lifebar.png new file mode 100644 index 0000000..b016e5c Binary files /dev/null and b/KevinSystem/img/lifebar.png differ diff --git a/KevinSystem/img/lifebarOLD.png b/KevinSystem/img/lifebarOLD.png new file mode 100644 index 0000000..87e44c4 Binary files /dev/null and b/KevinSystem/img/lifebarOLD.png differ diff --git a/KevinSystem/img/lol.png b/KevinSystem/img/lol.png new file mode 100644 index 0000000..9193bb9 Binary files /dev/null and b/KevinSystem/img/lol.png differ diff --git a/KevinSystem/img/textbox.png b/KevinSystem/img/textbox.png new file mode 100644 index 0000000..c4ce329 Binary files /dev/null and b/KevinSystem/img/textbox.png differ diff --git a/KevinSystem/img/yo.png b/KevinSystem/img/yo.png new file mode 100644 index 0000000..0e9864e Binary files /dev/null and b/KevinSystem/img/yo.png differ diff --git a/KevinSystem/kevin_system/ItemSoundLib.txt b/KevinSystem/kevin_system/ItemSoundLib.txt new file mode 100644 index 0000000..d554aa5 --- /dev/null +++ b/KevinSystem/kevin_system/ItemSoundLib.txt @@ -0,0 +1,34 @@ +// Sound effects for items go here. + +let itemlib = GetModuleDirectory() ~ "./script/KevinSystem/RyannSFX/ItemSFX/"; +let SFXVol = GetAreaCommonData("Config", "SEVol", 100) * 0.01; + +// Sound objects declarations + +let SpellSFX = ObjSound_Create(); +let LifeSFX = ObjSound_Create(); +let CancelSFX = ObjSound_Create(); +let RegularItemSFX = ObjSound_Create(); +let SpecialItemSFX = ObjSound_Create(); + +// Merge function that loads sounds and significantly decreases volume +// so the ears do not die from SFX overload. + +function LoadEx(targetobj, targetpath, targetvol){ + + ObjSound_Load(targetobj, targetpath); + ObjSound_SetVolumeRate(targetobj, targetvol * SFXVol); + ObjSound_SetSoundDivision(targetobj, SOUND_SE); + +} + +task _ItemSoundTask{ + + LoadEx(SpellSFX, itemlib ~ "bfxr_SpellExtend.wav", 80); + LoadEx(LifeSFX, itemlib ~ "bfxr_LifeExtend.wav", 80); + LoadEx(CancelSFX, itemlib ~ "bfxr_GetItemCancel.wav", 20); + LoadEx(RegularItemSFX, itemlib ~ "bfxr_GetItem1.wav", 40); + LoadEx(SpecialItemSFX, itemlib ~ "bfxr_GetItemSpecial.wav", 40); +} + +// Functions to load sounds in scripts diff --git a/KevinSystem/kevin_system/KevinSystem_Item.txt b/KevinSystem/kevin_system/KevinSystem_Item.txt new file mode 100644 index 0000000..509a212 --- /dev/null +++ b/KevinSystem/kevin_system/KevinSystem_Item.txt @@ -0,0 +1,276 @@ +// Item script + +#include "./Kevin_ItemConst.txt" +#include "./Kevin_ItemLib.txt" +#include "./ItemSoundLib.txt" +//#include "./Kevin_ItemData.txt; + +float PIV = 0; + +@Initialize{ + SetAutoDeleteObject(true); + _ItemSoundTask(); + SetDefaultBonusItemEnable(false); + LoadItemData(GetCurrentScriptDirectory ~ "./Kevin_ItemData.txt"); +} + +@MainLoop{ + PIV = GetAreaCommonData("PIV", "currentvalue", 0); + yield; +} + +@Event +{ + alternative (GetEventType()) + case (EV_GET_ITEM){ + + let obj = GetEventArgument(0); + + alternative(obj) + + case(POINT_REGULAR) { AddScore(GetAreaCommonData("PIV", "currentvalue", 0)); ObjSound_Play(CancelSFX);} + case(POINT_BHESTIE) { AddScore(2*GetAreaCommonData("PIV", "currentvalue", 0)); ObjSound_Play(SpecialItemSFX);} + case(POINT_RAINBOW) { AddScore(2*GetAreaCommonData("PIV", "currentvalue", 0)); ObjSound_Play(SpecialItemSFX);} + case(POINT_CANCEL) { AddScore(0.05*GetAreaCommonData("PIV", "currentvalue", 0)); ObjSound_Play(CancelSFX);} + + case(EXTEND_LIFE) { AddScore(PIV); SetPlayerLife(GetPlayerLife()+1); ObjSound_Play(SpellSFX);} + case(EXTEND_SPELL) { AddScore(PIV); SetPlayerSpell(GetPlayerSpell()+1); ObjSound_Play(SpecialItemSFX);} + + case(PIV_100) { SetAreaCommonData("PIV", "currentvalue", GetAreaCommonData("PIV", "currentvalue", 0)+100);} //ObjSound_Play(CancelSFX);} + case(PIV_250) { SetAreaCommonData("PIV", "currentvalue", GetAreaCommonData("PIV", "currentvalue", 0)+250);} //ObjSound_Play(CancelSFX);} + case(PIV_500) { SetAreaCommonData("PIV", "currentvalue", GetAreaCommonData("PIV", "currentvalue", 0)+500);} //ObjSound_Play(CancelSFX);} + + } + + case (EV_DELETE_SHOT_TO_ITEM){ + + float[] position = GetEventArgument(1); + CreateCancelItem(position[0], position[1]); + + } + + case (EV_CANCEL_ITEM) { + + let obj = GetEventArgument(0); + let type = GetEventArgument(1); + + _CancelHandling(obj, type); + + } + + case (EV_COLLECT_ITEM){ + + let obj = GetEventArgument(0); + let type = GetEventArgument(1); + let typeCollect = GetEventArgument(2); + + //WriteLog(type); + _MoveToPlayer(obj, type, typeCollect); // Separate task is used to move the object to the player at customized speeds. + + } + + // Drops point items depending on how close you were to the enemy when you killed them. + /* + Event arguments: + + 0: PlayerID + 1: EnemyID + 2: Minimum number of point items + 3: Maximum number of point items + + */ + + case(EV_DROP_POINT_ENEMY){ + + _DropPointItem(GetEventArgument(0), GetEventArgument(1), GetEventArgument(2), GetEventArgument(3), GetEventArgument(4)); + + } + + case(EV_DROP_PIV_ENEMY){ + + _DropPIVItemEnemy(GetEventArgument(0), GetEventArgument(1), GetEventArgument(2), GetEventArgument(3), GetEventArgument(4)); + + } + + // Event arguments: Enemy X, Enemy Y, Item Drop Amount, Item Drop Type + case(EV_SINGLE_ITEM_DROP){ + + loop(GetEventArgument(2)){ + CreateScoreItem(GetEventArgument(3), + GetEventArgument(0)+rand(-100, 100), GetEventArgument(1)+rand(-100, 100)); + } + + } + + case(EV_DROP_EXTEND){ + CreateExtendItem(EXTEND_LIFE, GetEventArgument(0), GetEventArgument(1)); + } +} + +task _CancelHandling(int IDItem, int typeItem){ + + ObjMove_CancelMovement(IDItem); + + while(GetPlayerState() != STATE_NORMAL){yield;} + + _MoveToPlayer(IDItem, typeItem, 0); + +} + +// Timer is counted in frames (60 frames = 1 second) + +task _DropPointItem(float[] posEnm, int killTimer, int maxTimer, int pointMin, int pointMax){ + + // If the player kills enemy within maxTimer, the enemy drops the maximum amount of point items + + int pointFinal = Interpolate_Smooth(pointMin, pointMax, min(1, maxTimer/killTimer)); + //WriteLog(pointFinal); + + loop(pointFinal){ + + CreateScoreItem(POINT_REGULAR, posEnm[0]+rand(-60, 60), posEnm[1]+rand(-60, 60)); + + } + + _ScorePopup(posEnm[0], posEnm[1], "POINT", pointFinal); + + return; + + +} + +task _DropPIVItemEnemy(int IDPlayer, float[] posEnm, int pointMin, int pointMax, int bestDist){ + + // If the player is within at MOST "bestDist" from the enemy, the enemy drops the maximum amount of PIV items + + float curDist = hypot(posEnm[0]-ObjMove_GetX(IDPlayer), posEnm[1]-ObjMove_GetY(IDPlayer)); + + int pointFinal = Interpolate_Smooth(pointMin, pointMax, min(1, bestDist/curDist)); + //WriteLog(pointFinal); + + loop(pointFinal){ + + CreatePIVItem(PIV_250, posEnm[0]+rand(-60, 60), posEnm[1]+rand(-60, 60)); + + } + + _ScorePopup(posEnm[0], posEnm[1], "PIV", pointFinal); + + return; + + +} + +task _MoveToPlayer(obj, type, typeCollect){ + + ObjItem_SetAutoDelete(obj, true); + ObjMove_SetAcceleration(obj, 1); + //ObjMove_SetMaxSpeed(obj, 2); + + // The max speed of movement differs based on item. + alternative(type) + + case(POINT_CANCEL) { ObjMove_SetMaxSpeed(obj, 23); } + + case(PIV_100) { ObjMove_SetMaxSpeed(obj, 18); } + case(PIV_250) { ObjMove_SetMaxSpeed(obj, 18); } + case(PIV_500) { ObjMove_SetMaxSpeed(obj, 18); } + + case(POINT_REGULAR) { ObjMove_SetMaxSpeed(obj, 20); } + case(POINT_RAINBOW) { ObjMove_SetMaxSpeed(obj, 20); } + case(POINT_BHESTIE) { ObjMove_SetMaxSpeed(obj, 20); } + others { ObjMove_SetMaxSpeed(obj, 25); } + + while (!Obj_IsDeleted(obj)) { + ObjMove_SetAngle(obj, GetAngleToPlayer(obj)); + //WriteLog(ObjMove_GetSpeed(obj)); + yield; + } + +} + + +// Text popups. When enemy is defeated, text objects appear showing the number of PIV and point items collected. + +function CreateTextObject( + float mx, my, size, + string text, font, + int colorTop, colorBottom, + int borderColor, borderWidth, + int renderPriority + ){ + + let obj = ObjText_Create(); + ObjText_SetText(obj, text); + ObjText_SetFontSize(obj, size); + ObjText_SetFontType(obj, font); + ObjText_SetFontColorTop(obj, colorTop); + ObjText_SetFontColorBottom(obj, colorBottom); + ObjText_SetFontBorderType(obj, BORDER_FULL); + ObjText_SetFontBorderColor(obj, borderColor); + ObjText_SetFontBorderWidth(obj, borderWidth); + Obj_SetRenderPriorityI(obj, renderPriority); + ObjRender_SetX(obj, mx); + ObjRender_SetY(obj, my); + return obj; + +} + +task _ScorePopup(float enmX, float enmY, string type, int itemNum){ + + float offset = 72; // Vertical space between the 2 scoretexts + float time = 30; // Time that the text objects (appear+)last on screen + float timeDisappear = 15; // Fade time + float size = 75; + float yDes = 60; // Destination text object moves to, relative to enmY + string font = "Unispace"; + float borderSize = 6; + + if (type == "POINT"){ + + int pointText = CreateTextObject( + enmX, enmY, size, + "x" ~ IntToString(itemNum), font, + 0x7699FF, 0xFFFFFF, + 0x2A00C0, borderSize, + 42 + ); + ObjText_SetHorizontalAlignment(pointText, ALIGNMENT_CENTER); + + ascent(i in 0..time){ + ObjRender_SetY(pointText, Interpolate_Decelerate(enmY, enmY-yDes, i/time)); + yield; + } + + ascent(i in 0..timeDisappear){ + ObjRender_SetAlpha(pointText, Interpolate_Decelerate(255, 0, i/timeDisappear)); + yield; + } + Obj_Delete(pointText); + } + + else{ + int pivText = CreateTextObject( + enmX, enmY+offset, size, + "x" ~ IntToString(itemNum), font, + 0xFFB4EC, 0xFFFFFF, + 0xB200AD, borderSize, + 42 + ); + + ObjText_SetHorizontalAlignment(pivText, ALIGNMENT_CENTER); + + ascent(i in 0..time){ + ObjRender_SetY(pivText, Interpolate_Decelerate(enmY+offset, enmY+offset-yDes, i/time)); + yield; + } + + ascent(i in 0..timeDisappear){ + ObjRender_SetAlpha(pivText, Interpolate_Decelerate(255, 0, i/timeDisappear)); + yield; + } + + Obj_Delete(pivText); + } + +} diff --git a/KevinSystem/kevin_system/Kevin_EndScene.txt b/KevinSystem/kevin_system/Kevin_EndScene.txt new file mode 100644 index 0000000..303df7f --- /dev/null +++ b/KevinSystem/kevin_system/Kevin_EndScene.txt @@ -0,0 +1,263 @@ +//一時停止中スクリプト + +#include "script/KevinSystem/GeneralSoundLib.txt" + +int STGWIDTH = GetStgFrameWidth(); +int STGHEIGHT = GetStgFrameHeight(); + +@Initialize +{ + _SoundTask(); + ExtendSFX; + SetAutoDeleteObject(true); + TBackgroundNew(0, 0); + TMenu(); +} + +@MainLoop +{ + yield; +} + +@Finalize +{ +} + + +task TBackgroundNew(renderX, renderY){ + + let objText = ObjText_Create(); + ObjText_SetText(objText, "Thank you for playing![r]Until the next pride..."); + ObjText_SetFontSize(objText, 36); + ObjText_SetFontType(objText, "Connecting Chain Handserif"); + + //ObjText_SetMaxWidth(objText, GetScreenWidth/2); + ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER); + + ObjText_SetFontBold(objText, true); + ObjText_SetFontColorTop(objText, 255, 255, 255); + ObjText_SetFontColorBottom(objText, 255, 255, 255); + ObjText_SetFontBorderType(objText, BORDER_FULL); + ObjText_SetFontBorderColor(objText, 0x7D39D9); + ObjText_SetFontBorderWidth(objText, 2); + Obj_SetRenderPriorityI(objText, 10); + ObjRender_SetX(objText, GetScreenWidth/2); + ObjRender_SetY(objText, 8*STGHEIGHT/9); + + let obj = ObjPrim_Create(OBJ_SPRITE_2D); + Obj_SetRenderPriorityI(obj, 1); + + let currentFrameTexture = GetTransitionRenderTargetName(); + + ObjPrim_SetTexture(obj, currentFrameTexture); + ObjSprite2D_SetSourceRect(obj, 0, 0, GetScreenWidth(), GetScreenHeight()); + ObjSprite2D_SetDestRect(obj, 0, 0, GetScreenWidth(), GetScreenHeight()); + + ObjRender_SetColor(obj, 0x593DA3); + +} + +task TBackground +{ + task TVertex(var index, var left, var top, var right, var bottom) + { + ObjPrim_SetVertexPosition(obj, index + 0, left, top, 0); + ObjPrim_SetVertexPosition(obj, index + 1, left, bottom, 0); + ObjPrim_SetVertexPosition(obj, index + 2, right, top, 0); + ObjPrim_SetVertexPosition(obj, index + 3, right, top, 0); + ObjPrim_SetVertexPosition(obj, index + 4, left, bottom, 0); + ObjPrim_SetVertexPosition(obj, index + 5, right, bottom, 0); + + ObjPrim_SetVertexUVT(obj, index + 0, left, top); + ObjPrim_SetVertexUVT(obj, index + 1, left, bottom); + ObjPrim_SetVertexUVT(obj, index + 2, right, top); + ObjPrim_SetVertexUVT(obj, index + 3, right, top); + ObjPrim_SetVertexUVT(obj, index + 4, left, bottom); + ObjPrim_SetVertexUVT(obj, index + 5, right, bottom); + + //STGシーン内のみアニメーション + if(left >= 341 && right <= 937 && top >= 45 && bottom <= 677) + { + let alpha = 255; + while(alpha >= 128) + { + ObjPrim_SetVertexAlpha(obj, index + 0, alpha); + ObjPrim_SetVertexAlpha(obj, index + 1, alpha/2); + ObjPrim_SetVertexAlpha(obj, index + 2, alpha/2); + ObjPrim_SetVertexAlpha(obj, index + 3, alpha/2); + ObjPrim_SetVertexAlpha(obj, index + 4, alpha/2); + ObjPrim_SetVertexAlpha(obj, index + 5, alpha); + alpha -= 255 / frame; + + yield; + } + } + } + + //分割設定 + let frame = 30; + let countH = 20; //分割数 + let countV = 30; + let width = 1280 / countH; + let height = 720 / countV; + let target = GetTransitionRenderTargetName(); + let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D); //2D頂点ブジェクト生成 + ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLELIST); + ObjPrim_SetVertexCount(obj, countH * countV * 6); + Obj_SetRenderPriorityI(obj, 0); //描画優先度を設定 + ObjPrim_SetTexture(obj, target); //テクスチャを設定 + + ascent(ix in 0.. countH) + { + ascent(iy in 0.. countV) + { + let index = (ix + iy * countH) * 6; + let left = ix * width; + let right = left + width; + let top = iy * height; + let bottom = top + height; + TVertex(index, left, top, right, bottom); + } + } + +} +task TMenu +{ + let selectIndex = 0;//選択位置 + function TMenuItem(let index, let mx, let my, let text) + { + function CreateTextObject(let mx, let my, let text) + { + let obj = ObjText_Create(); + ObjText_SetText(obj, text); + ObjText_SetFontSize(obj, 65); + ObjText_SetFontType(obj, "Connecting Chain Handserif"); + ObjText_SetFontBold(obj, true); + ObjText_SetHorizontalAlignment(obj, ALIGNMENT_CENTER); + //ObjText_SetMaxWidth(obj, STGWIDTH); + ObjText_SetFontColorTop(obj, 155, 45, 175); + ObjText_SetFontColorBottom(obj, 200, 80, 255); + ObjText_SetFontBorderType(obj, BORDER_FULL); + ObjText_SetFontBorderColor(obj, 255, 255, 255); + ObjText_SetFontBorderWidth(obj, 3.5); + Obj_SetRenderPriorityI(obj, 10); + ObjRender_SetX(obj, mx); + ObjRender_SetY(obj, my); + return obj; + } + + let objText = CreateTextObject(mx, my, text); + let objSelect = CreateTextObject(mx, my, text); + ObjRender_SetBlendType(objSelect, BLEND_ADD_RGB); + + async{ + loop + { + Obj_SetVisible(objSelect, index == selectIndex); + yield; + } + } + + return objText; + } + + //メニュー配置 + + let textchoices = ["End of a Journey"]; + int x = prand_int(0, length(textchoices)-1); + let objText = ObjText_Create(); + ObjText_SetText(objText, textchoices[x]); + ObjText_SetFontSize(objText, 150); + ObjText_SetFontType(objText, "Anke Calligraph"); + + //ObjText_SetMaxWidth(objText, STGWIDTH); + ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER); + + ObjText_SetFontBold(objText, true); + ObjText_SetFontColorTop(objText, 75, 255, 255); + ObjText_SetFontColorBottom(objText, 180, 255, 255); + ObjText_SetFontBorderType(objText, BORDER_FULL); + ObjText_SetFontBorderColor(objText,0, 0, 0); + ObjText_SetFontBorderWidth(objText, 3); + Obj_SetRenderPriorityI(objText, 10); + ObjRender_SetX(objText, GetScreenWidth/2); + ObjRender_SetY(objText, 100); + + let mx = GetScreenWidth/2; + let my = GetScreenHeight/4; + let texts = ["Save A Replay", "Depart From The Market", "Re-enter The Parade"]; + var countMenu = length(texts); + ascent(var iText in 0 .. countMenu) + { + int text = TMenuItem(iText, mx, my, texts[iText]); + my += 75; + } + + //キー状態がリセットされるまで待機 + while(GetVirtualKeyState(VK_PAUSE) != KEY_FREE){yield;} + + //メニュー選択処理 + let frameKeyHold = 0;//キー押しっぱなしフレーム数 + //PauseGameSFX; + + function CheckShotRelease { + return (GetVirtualKeyState(VK_OK) == KEY_HOLD); + } + + int countA = 0; + + loop + { + //決定 + if(CheckShotRelease){yield; continue;} + + if(GetVirtualKeyState(VK_OK) == KEY_PUSH) + { + let listResult = [RESULT_SAVE_REPLAY, RESULT_END, RESULT_RETRY]; + SetScriptResult(listResult[selectIndex]); + CloseScript(GetOwnScriptID()); + return; + } + + //カーソル移動 + if(GetVirtualKeyState(VK_UP) == KEY_PUSH) + { + selectIndex--; + } + else if(GetVirtualKeyState(VK_DOWN) == KEY_PUSH) + { + selectIndex++; + } + else if(GetVirtualKeyState(VK_UP) == KEY_HOLD) + { + frameKeyHold++; + if(frameKeyHold == 30 || (frameKeyHold > 30 && (frameKeyHold % 10 == 0))) + { + selectIndex--; + } + } + else if(GetVirtualKeyState(VK_DOWN) == KEY_HOLD) + { + frameKeyHold++; + if(frameKeyHold == 30 || (frameKeyHold > 30 && (frameKeyHold % 10 == 0))) + { + selectIndex++; + } + } + else + { + frameKeyHold = 0; + } + + if(selectIndex < 0) + { + selectIndex = countMenu - 1; + } + else + { + selectIndex %= countMenu; + } + + yield; + } +} \ No newline at end of file diff --git a/KevinSystem/kevin_system/Kevin_ItemConst.txt b/KevinSystem/kevin_system/Kevin_ItemConst.txt new file mode 100644 index 0000000..2019ca2 --- /dev/null +++ b/KevinSystem/kevin_system/Kevin_ItemConst.txt @@ -0,0 +1,13 @@ + +const POINT_REGULAR = 1; +const POINT_RAINBOW = 2; +const POINT_BHESTIE = 3; +const POINT_CANCEL = 4; + +const EXTEND_LIFE = 5; +const EXTEND_SPELL = 6; + +const PIV_100 = 7; +const PIV_250 = 8; +const PIV_500 = 9; +const FRAGMENT_SPELL = 10; \ No newline at end of file diff --git a/KevinSystem/kevin_system/Kevin_ItemData.txt b/KevinSystem/kevin_system/Kevin_ItemData.txt new file mode 100644 index 0000000..68ed57c --- /dev/null +++ b/KevinSystem/kevin_system/Kevin_ItemData.txt @@ -0,0 +1,16 @@ +#UserItemData + +item_image = "./../img/yo.png" + +ItemData { id=1 rect=(256,256,384,384) } // Regular Point Item (PIV) +ItemData { id=2 rect=(384,128,512,256) } // Homosexual Point Item (PIV * 2) +ItemData { id=3 rect=(256,128,384,256) } // Bhestie Point Item (PIV * 2, 25% chance of drop) +ItemData { id=4 rect=(512,0,640,128) } // Cancel Item (PIV * O.2), erase bullets via bombs + +ItemData { id=5 rect=(0,256,128,384) } // 1-up Item +ItemData { id=6 rect=(128,256,256,384) } // Spell Item + +ItemData { id=7 rect=(256,384,384,512) fixed_angle = false angular_velocity = 3} // Green PIV Item (+100) +ItemData { id=8 rect=(384,384,512,512) fixed_angle = false angular_velocity = 3} // Pink PIV Item (+250) +ItemData { id=9 rect=(384,256,512,384) fixed_angle = false angular_velocity = 3} // Gold PIV Item (+500) +ItemData { id=10 rect=(128,384,256,512) } // Spell Piece \ No newline at end of file diff --git a/KevinSystem/kevin_system/Kevin_ItemLib.txt b/KevinSystem/kevin_system/Kevin_ItemLib.txt new file mode 100644 index 0000000..4c10846 --- /dev/null +++ b/KevinSystem/kevin_system/Kevin_ItemLib.txt @@ -0,0 +1,146 @@ +// Valid types: PIV_100, PIV_250, PIV_500 + +float universalItemAlpha = GetAreaCommonData("Config", "ItemOpacity", 60); + +const EV_DROP_POINT_ENEMY = EV_USER + 200i; +const EV_DROP_PIV_ENEMY = EV_USER + 201i; +const EV_SINGLE_ITEM_DROP = EV_USER + 202i; +const EV_DROP_EXTEND = EV_USER + 203i; + +function CreatePIVItem(itemtype, x, y){ + + let PIVItem = CreateItemU1(itemtype, x, y, 0); + ObjItem_SetDefaultCollectMovement(PIVItem, false); + + async{ + wait(20); + ObjMove_SetMaxSpeed(PIVItem, 24); + ObjItem_SetMoveToPlayer(PIVItem, true); + } + + //ObjItem_SetAutoCollectEnableFlags(PIVItem, ITEM_AUTOCOLLECT_ALL); + + ObjItem_SetIntersectionRadius(PIVItem, 60); + + ObjRender_SetScaleXYZ(PIVItem, 0.85, 0.85, 1); + ObjRender_SetAlpha(PIVItem, 255*(universalItemAlpha/100)); + + async{ + while(!Obj_IsDeleted(PIVItem)){ + float angz = ObjRender_GetAngleZ(PIVItem); + ObjRender_SetAngleZ(PIVItem, angz+3.5); + yield; + } + } + + return PIVItem; +} + +// Valid types: POINT_REGULAR, POINT_BHESTIE, POINT_RAINBOW +function CreateScoreItem(itemtype, x, y){ + let ScoreItem = CreateItemU1(itemtype, x + rand(-60, 60), y + rand(-60, 60), 0); + ObjItem_SetDefaultCollectMovement(ScoreItem, false); + + async{ + wait(45); + ObjItem_SetMoveToPlayer(ScoreItem, true); + } + + //ObjItem_SetAutoCollectEnableFlags(ScoreItem, ITEM_AUTOCOLLECT_ALL); + + ObjItem_SetIntersectionRadius(ScoreItem, 60); + ObjItem_SetRenderScoreEnable(ScoreItem, false); + + //ObjRender_SetScaleXYZ(ScoreItem, 0.7, 0.7, 1); + ObjRender_SetAlpha(ScoreItem, 255*(universalItemAlpha/100)); + + //ObjMove_AddPatternA2(ScoreItem, 60, NO_CHANGE, 90, 0.12, 5.45, 0); + + return ScoreItem; +} + +function CreateCancelItem(x, y){ + + let CancelItem = CreateItemU1(POINT_CANCEL, x, y, 0); + ObjItem_SetDefaultCollectMovement(CancelItem, false); + + async{ + wait(45); + ObjItem_SetMoveToPlayer(CancelItem, true); + ObjMove_SetMaxSpeed(CancelItem, 24); + } + + ObjItem_SetAutoCollectEnableFlags(CancelItem, ITEM_AUTOCOLLECT_ALL); + ObjItem_SetRenderScoreEnable(CancelItem, false); + + ObjItem_SetIntersectionRadius(CancelItem, 60); + + ObjRender_SetScaleXYZ(CancelItem, 0.6, 0.6, 1); + ObjRender_SetAlpha(CancelItem, 255*(universalItemAlpha/100)); + + async{ + while(!Obj_IsDeleted(CancelItem)){ + float angz = ObjRender_GetAngleZ(CancelItem); + ObjRender_SetAngleZ(CancelItem, angz+2); + yield; + } + } + + return CancelItem; + +} +// Valid types: EXTEND_LIFE, EXTEND_SPELL +function CreateExtendItem(itemtype, x, y){ + + let ExtendItem = CreateItemU2(itemtype, x, y, x, y-125, 0); + ObjItem_SetDefaultCollectMovement(ExtendItem, false); + //ObjItem_SetMoveToPlayer(ExtendItem, true); + ObjItem_SetAutoCollectEnableFlags(ExtendItem, ITEM_AUTOCOLLECT_ALL); + + ObjRender_SetScaleXYZ(ExtendItem, 1.5, 1.5, 1); + Obj_SetRenderPriorityI(ExtendItem, 49); + + async{ + wait(30); + ObjItem_SetMoveToPlayer(ExtendItem, true); + //ObjMove_SetMaxSpeed(CancelItem, 24); + } + + return ExtendItem; +} + +// Summoning the actual items + +function NonspellItemDrop(scene, x, y){ + + if(ObjEnemyBossScene_GetInfo(scene, INFO_PLAYER_SHOOTDOWN_COUNT) == 0){ + loop(14){ + CreateScoreItem(POINT_REGULAR, x+rand(-75, 75), y+rand(-45, 45)); + } + } + else{ + loop(8){ + CreateScoreItem(POINT_REGULAR, x+rand(-75, 75), y+rand(-45, 45)); + } + } + +} + +function SpellItemDrop(scene, x, y){ + + if(ObjEnemyBossScene_GetInfo(scene, INFO_PLAYER_SHOOTDOWN_COUNT) == 0 && ObjEnemyBossScene_GetInfo(scene, INFO_PLAYER_SPELL_COUNT) == 0){ + loop(20){ + CreateScoreItem(POINT_BHESTIE, x+rand(-75, 75), y+rand(-45, 45)); + } + loop(10){ + CreateScoreItem(POINT_REGULAR, x+rand(-75, 75), y+rand(-45, 45)); + } + } + else if(ObjEnemyBossScene_GetInfo(scene, INFO_PLAYER_SHOOTDOWN_COUNT) == 0 && ObjEnemyBossScene_GetInfo(scene, INFO_PLAYER_SPELL_COUNT) >> 0){ + loop(12){ + CreateScoreItem(POINT_REGULAR, x+rand(-75, 75), y+rand(-45, 45)); + } + } + else{} + +} diff --git a/KevinSystem/kevin_system/Kevin_Pause.txt b/KevinSystem/kevin_system/Kevin_Pause.txt new file mode 100644 index 0000000..8a12c3f --- /dev/null +++ b/KevinSystem/kevin_system/Kevin_Pause.txt @@ -0,0 +1,298 @@ +//一時停止中スクリプト +//#include "./../../script/soundtask.txt" +#include "script/KevinSystem/GeneralSoundLib.txt" + +int STGWIDTH = GetStgFrameWidth(); +int STGHEIGHT = GetStgFrameHeight(); + +@Initialize +{ + _SoundTask(); + PauseGameSFX; + SetAutoDeleteObject(true); + //TBackground(); + TBackgroundNew(0, 0); + TMenu(); + TFunFact(); + //_SoundTask; +} + +@MainLoop +{ + yield; +} + +@Finalize +{ +} + +task TFunFact(){ + + //int y = 0; + + let textchoices = [ + "The sun is just a really hot egg tart, if you think about it.", + "Gay people.", + "You know what else is as cool as gay Touhous? It's Kouji Kouda[r]from the hit anime \"Boku no Hero Academia\"- *turns into a Kouda plushie*", + "Thanks for playing this game! I hope you enjoyed my gay Touhou endeavours.", + "You can set the amount of starting lives you have in the configurations menu.[r]If you have trouble with difficult patterns or stage sections, now you can blast right through them!" + ]; + int x = prand_int(0, length(textchoices)-1); + //y = length(textchoices); + + let objText = ObjText_Create(); + ObjText_SetText(objText, textchoices[x]); + ObjText_SetFontSize(objText, 36); + ObjText_SetFontType(objText, "Connecting Chain Handserif"); + + //ObjText_SetMaxWidth(objText, GetScreenWidth/2); + ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER); + + ObjText_SetFontBold(objText, true); + ObjText_SetFontColorTop(objText, 255, 255, 255); + ObjText_SetFontColorBottom(objText, 255, 255, 255); + ObjText_SetFontBorderType(objText, BORDER_FULL); + ObjText_SetFontBorderColor(objText, 0x7D39D9); + ObjText_SetFontBorderWidth(objText, 2); + Obj_SetRenderPriorityI(objText, 10); + ObjRender_SetX(objText, GetScreenWidth/2); + ObjRender_SetY(objText, 8*STGHEIGHT/9); + +} + +// renderX and renderY will be TOP-LEFT COORDS +task TBackgroundNew(float renderX, renderY){ + + let obj = ObjPrim_Create(OBJ_SPRITE_2D); + Obj_SetRenderPriorityI(obj, 1); + + let currentFrameTexture = GetTransitionRenderTargetName(); + + ObjPrim_SetTexture(obj, currentFrameTexture); + ObjSprite2D_SetSourceRect(obj, 0, 0, GetScreenWidth(), GetScreenHeight()); + ObjSprite2D_SetDestRect(obj, 0, 0, GetScreenWidth(), GetScreenHeight()); + + ObjRender_SetColor(obj, 0x593DA3); + +} + +task TBackground +{ + task TVertex(var index, var left, var top, var right, var bottom) + { + ObjPrim_SetVertexPosition(obj, index + 0, left, top, 0); + ObjPrim_SetVertexPosition(obj, index + 1, left, bottom, 0); + ObjPrim_SetVertexPosition(obj, index + 2, right, top, 0); + ObjPrim_SetVertexPosition(obj, index + 3, right, top, 0); + ObjPrim_SetVertexPosition(obj, index + 4, left, bottom, 0); + ObjPrim_SetVertexPosition(obj, index + 5, right, bottom, 0); + + ObjPrim_SetVertexUVT(obj, index + 0, left, top); + ObjPrim_SetVertexUVT(obj, index + 1, left, bottom); + ObjPrim_SetVertexUVT(obj, index + 2, right, top); + ObjPrim_SetVertexUVT(obj, index + 3, right, top); + ObjPrim_SetVertexUVT(obj, index + 4, left, bottom); + ObjPrim_SetVertexUVT(obj, index + 5, right, bottom); + + //STGシーン内のみアニメーション + if(left >= 341 && right <= 937 && top >= 45 && bottom <= 677) + { + let alpha = 255; + while(alpha >= 128) + { + ObjPrim_SetVertexAlpha(obj, index + 0, alpha); + ObjPrim_SetVertexAlpha(obj, index + 1, alpha/2); + ObjPrim_SetVertexAlpha(obj, index + 2, alpha/2); + ObjPrim_SetVertexAlpha(obj, index + 3, alpha/2); + ObjPrim_SetVertexAlpha(obj, index + 4, alpha/2); + ObjPrim_SetVertexAlpha(obj, index + 5, alpha); + alpha -= 255 / frame; + + yield; + } + } + } + + //分割設定 + let frame = 30; + let countH = 20; //分割数 + let countV = 30; + let width = 1280 / countH; + let height = 720 / countV; + let target = GetTransitionRenderTargetName(); + let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D); //2D頂点ブジェクト生成 + ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLELIST); + ObjPrim_SetVertexCount(obj, countH * countV * 6); + Obj_SetRenderPriorityI(obj, 0); //描画優先度を設定 + ObjPrim_SetTexture(obj, target); //テクスチャを設定 + + ascent(ix in 0.. countH) + { + ascent(iy in 0.. countV) + { + let index = (ix + iy * countH) * 6; + let left = ix * width; + let right = left + width; + let top = iy * height; + let bottom = top + height; + TVertex(index, left, top, right, bottom); + } + } + +} + +task TMenu +{ + let selectIndex = 0;//選択位置 + function TMenuItem(let index, let mx, let my, let text) + { + function CreateTextObject(let mx, let my, let text) + { + let obj = ObjText_Create(); + ObjText_SetText(obj, text); + ObjText_SetFontSize(obj, 65); + ObjText_SetFontType(obj, "Connecting Chain Handserif"); + ObjText_SetFontBold(obj, true); + ObjText_SetHorizontalAlignment(obj, ALIGNMENT_CENTER); + //ObjText_SetMaxWidth(obj, STGWIDTH); + ObjText_SetFontColorTop(obj, 155, 45, 175); + ObjText_SetFontColorBottom(obj, 200, 80, 255); + ObjText_SetFontBorderType(obj, BORDER_FULL); + ObjText_SetFontBorderColor(obj, 255, 255, 255); + ObjText_SetFontBorderWidth(obj, 3.5); + Obj_SetRenderPriorityI(obj, 10); + ObjRender_SetX(obj, mx); + ObjRender_SetY(obj, my); + return obj; + } + + let objText = CreateTextObject(mx, my, text); + let objSelect = CreateTextObject(mx, my, text); + ObjRender_SetBlendType(objSelect, BLEND_ADD_RGB); + + async{ + loop + { + Obj_SetVisible(objSelect, index == selectIndex); + yield; + } + } + + return objText; + } + + //メニュー配置 + + let textchoices = ["Market Moratorium", "Respite from the Parade", "Worthy Rest"]; + int x = prand_int(0, length(textchoices)-1); + let objText = ObjText_Create(); + ObjText_SetText(objText, textchoices[x]); + ObjText_SetFontSize(objText, 150); + ObjText_SetFontType(objText, "Anke Calligraph"); + + //ObjText_SetMaxWidth(objText, STGWIDTH); + ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER); + + ObjText_SetFontBold(objText, true); + ObjText_SetFontColorTop(objText, 75, 255, 255); + ObjText_SetFontColorBottom(objText, 180, 255, 255); + ObjText_SetFontBorderType(objText, BORDER_FULL); + ObjText_SetFontBorderColor(objText,0, 0, 0); + ObjText_SetFontBorderWidth(objText, 3); + Obj_SetRenderPriorityI(objText, 10); + ObjRender_SetX(objText, GetScreenWidth/2); + ObjRender_SetY(objText, 100); + + let mx = GetScreenWidth/2; + let my = GetScreenHeight/4; + let texts = ["Resume The Faceoff", "Accept Your Losses", "Take Another Shot"]; + var countMenu = length(texts); + ascent(var iText in 0 .. countMenu) + { + int text = TMenuItem(iText, mx, my, texts[iText]); + my += 75; + } + + //キー状態がリセットされるまで待機 + while(GetVirtualKeyState(VK_PAUSE) != KEY_FREE){yield;} + + //メニュー選択処理 + let frameKeyHold = 0;//キー押しっぱなしフレーム数 + //PauseGameSFX; + loop + { + //決定 + if(GetVirtualKeyState(VK_OK) == KEY_PULL) + { + let listResult = [RESULT_CANCEL, RESULT_END, RESULT_RETRY]; + SetScriptResult(listResult[selectIndex]); + CloseScript(GetOwnScriptID()); + return; + } + + //キャンセル + if(GetVirtualKeyState(VK_CANCEL) == KEY_PULL || GetVirtualKeyState(VK_PAUSE) == KEY_PULL) + { + SetScriptResult(RESULT_CANCEL); + CloseScript(GetOwnScriptID()); + return; + } + + //カーソル移動 + if(GetVirtualKeyState(VK_UP) == KEY_PUSH) + { + SelectOptionSFX; + selectIndex--; + } + else if(GetVirtualKeyState(VK_DOWN) == KEY_PUSH) + { + SelectOptionSFX; + selectIndex++; + } + else if(GetVirtualKeyState(VK_UP) == KEY_HOLD) + { + frameKeyHold++; + if(frameKeyHold == 30 || (frameKeyHold > 30 && (frameKeyHold % 10 == 0))) + { + SelectOptionSFX; + selectIndex--; + } + } + else if(GetVirtualKeyState(VK_DOWN) == KEY_HOLD) + { + frameKeyHold++; + if(frameKeyHold == 30 || (frameKeyHold > 30 && (frameKeyHold % 10 == 0))) + { + SelectOptionSFX; + selectIndex++; + } + } + else + { + frameKeyHold = 0; + } + + if(selectIndex < 0) + { + selectIndex = countMenu - 1; + } + else + { + selectIndex %= countMenu; + } + if(GetKeyState(KEY_R) == KEY_PUSH){ + SetScriptResult(RESULT_RETRY); + CloseScript(GetOwnScriptID()); + return; + } + if(GetKeyState(KEY_Q) == KEY_PUSH){ + SetScriptResult(RESULT_END); + CloseScript(GetOwnScriptID()); + return; + } + yield; + } +} + + + diff --git a/KevinSystem/kevin_system/Kevin_ReplaySave.txt b/KevinSystem/kevin_system/Kevin_ReplaySave.txt new file mode 100644 index 0000000..121540b --- /dev/null +++ b/KevinSystem/kevin_system/Kevin_ReplaySave.txt @@ -0,0 +1,421 @@ +//リプレイ保存スクリプト + +int STGWIDTH = GetStgFrameWidth(); +int STGHEIGHT = GetStgFrameHeight(); + +@Initialize +{ + SetAutoDeleteObject(true); + LoadReplayList(); + + TBackgroundNew(0, 0); + TReplayIndexSelection(); +} + +@MainLoop +{ + yield; +} + +@Finalize +{ +} + +let MENU_INDEX_SELECTION = 1; +let MENU_NAME_ENTRY = 2; +let menuMode = MENU_INDEX_SELECTION; + +function CreateTextObject(let mx, let my, float size, let text) +{ + let obj = ObjText_Create(); + ObjText_SetText(obj, text); + ObjText_SetFontSize(obj, size); + ObjText_SetFontType(obj, "Unispace"); + ObjText_SetFontBold(obj, true); + ObjText_SetHorizontalAlignment(obj, ALIGNMENT_LEFT); + //ObjText_SetMaxWidth(obj, STGWIDTH); + ObjText_SetFontColorTop(obj, 155, 45, 175); + ObjText_SetFontColorBottom(obj, 200, 80, 255); + ObjText_SetFontBorderType(obj, BORDER_FULL); + ObjText_SetFontBorderColor(obj, 255, 255, 255); + ObjText_SetFontBorderWidth(obj, 3); + Obj_SetRenderPriorityI(obj, 10); + ObjRender_SetX(obj, mx); + ObjRender_SetY(obj, my); + return obj; +} + +// renderX and renderY will be TOP-LEFT COORDS +task TBackgroundNew(float renderX, renderY){ + + let obj = ObjPrim_Create(OBJ_SPRITE_2D); + Obj_SetRenderPriorityI(obj, 1); + + let currentFrameTexture = GetTransitionRenderTargetName(); + + ObjPrim_SetTexture(obj, currentFrameTexture); + ObjSprite2D_SetSourceRect(obj, 0, 0, GetScreenWidth(), GetScreenHeight()); + ObjSprite2D_SetDestRect(obj, 0, 0, GetScreenWidth(), GetScreenHeight()); + + ObjRender_SetColor(obj, 0x593DA3); + +} + +task TReplayIndexSelection() +{ + let cursorY = 0; + let page = 0; + let countMaxItem = REPLAY_INDEX_DIGIT_MAX - REPLAY_INDEX_DIGIT_MIN + 1; + let countItemPerPage = 20; + let pageMax = trunc((countMaxItem - 1) / countItemPerPage); + pageMax = max(pageMax, 1); + let lastPageMaxCursorY = trunc(countMaxItem / countItemPerPage); + + task TMenuItem(let itemY) + { + let objText = CreateTextObject(90, 45 + 50 * itemY, 35, ""); + let objSelect = CreateTextObject(90, 45 + 50 * itemY, 35, ""); + ObjRender_SetAlpha(objText, 125); + ObjRender_SetAlpha(objSelect, 80); + ObjRender_SetBlendType(objSelect, BLEND_ADD_ARGB); + + let oldPage = -1; + while(menuMode == MENU_INDEX_SELECTION) + { + if(page != oldPage) + { + let index = page * countItemPerPage + itemY + 1; + let text = rtos("00", index) ~ " "; + if(IsValidReplayIndex(index)) + { + text = text ~ vtos("-8s", GetReplayInfo(index, REPLAY_USER_NAME)) ~ " "; + text = text ~ GetReplayInfo(index, REPLAY_DATE_TIME) ~ " "; + text = text ~ rtos("000000000000", GetReplayInfo(index, REPLAY_TOTAL_SCORE)) ~ " "; + text = text ~ GetReplayInfo(index, REPLAY_PLAYER_NAME) ~ " "; + text = text ~ GetReplayUserData(index, "Difficulty"); + + /*SetReplayUserData("Starting Lives", GetCommonData("Starting Lives Selected", 5)); + SetReplayUserData("Player Team", GetReplayInfo(index, REPLAY_PLAYER_NAME)); + SetReplayUserData("Difficulty", GetCommonData("Difficulty", "Arcade"));*/ + + } + else + { + text = text ~ "Entry Blank"; + } + ObjText_SetText(objText, text); + ObjText_SetText(objSelect, text); + oldPage = page; + } + + if(page == pageMax && itemY >= lastPageMaxCursorY) + { + Obj_SetVisible(objText, false); + Obj_SetVisible(objSelect, false); + } + else + { + Obj_SetVisible(objText, true); + Obj_SetVisible(objSelect, itemY == cursorY); + } + + yield; + } + Obj_Delete(objText); + Obj_Delete(objSelect); + } + + ascent(let iItem in 0 .. countItemPerPage) + { + TMenuItem(iItem); + } + + //キー状態がリセットされるまで待機 + while(GetVirtualKeyState(VK_OK) != KEY_FREE){yield;} + + //キー処理 + let frameKeyHold = 0;//キー押しっぱなしフレーム数 + while(menuMode == MENU_INDEX_SELECTION) + { + //決定 + if(GetVirtualKeyState(VK_OK) == KEY_PULL) + { + menuMode = MENU_NAME_ENTRY; + let index = page * countItemPerPage + cursorY + 1; + TNameEntry(index); + + break; + } + + if(GetVirtualKeyState(VK_CANCEL) == KEY_PUSH){ + SetScriptResult(RESULT_END); + CloseScript(GetOwnScriptID()); + } + + //カーソル移動 + if(GetVirtualKeyState(VK_UP) == KEY_PUSH || GetVirtualKeyState(VK_UP) == KEY_HOLD) + { + frameKeyHold++; + if(GetVirtualKeyState(VK_UP) == KEY_PUSH || + frameKeyHold == 20 || + (frameKeyHold > 20 && (frameKeyHold % 10 == 0))) + { + cursorY--; + } + } + else if(GetVirtualKeyState(VK_DOWN) == KEY_PUSH || GetVirtualKeyState(VK_DOWN) == KEY_HOLD) + { + frameKeyHold++; + if(GetVirtualKeyState(VK_DOWN) == KEY_PUSH || + frameKeyHold == 20 || + (frameKeyHold > 20 && (frameKeyHold % 10 == 0))) + { + cursorY++; + } + } + else if(GetVirtualKeyState(VK_LEFT) == KEY_PUSH || GetVirtualKeyState(VK_LEFT) == KEY_HOLD) + { + frameKeyHold++; + if(GetVirtualKeyState(VK_LEFT) == KEY_PUSH || + frameKeyHold == 20 || + (frameKeyHold > 20 && (frameKeyHold % 10 == 0))) + { + page--; + } + } + else if(GetVirtualKeyState(VK_RIGHT) == KEY_PUSH || GetVirtualKeyState(VK_RIGHT) == KEY_HOLD) + { + frameKeyHold++; + if(GetVirtualKeyState(VK_RIGHT) == KEY_PUSH || + frameKeyHold == 20 || + (frameKeyHold > 20 && (frameKeyHold % 10 == 0))) + { + page++; + } + } + else + { + frameKeyHold = 0; + } + + if(page < 0) + { + page = pageMax; + } + else if(page > pageMax) + { + page = 0; + } + + if(page != pageMax) + { + if(cursorY < 0) + { + cursorY = countItemPerPage - 1; + } + else if(cursorY >= countItemPerPage) + { + cursorY = 0; + } + } + else + { + if(cursorY < 0) + { + cursorY = lastPageMaxCursorY - 1; + } + else if(cursorY >= lastPageMaxCursorY) + { + cursorY = 0; + } + } + + yield; + } + +} + + +task TNameEntry(let replayIndex) +{ + let strTextIn = + [ + ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P"], + ["Q","R","S","T","U","V","W","X","Y","Z",".",",",":",";","_","@"], + ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p"], + ["q","r","s","t","u","v","w","x","y","z","+","-","/","*","=","%"], + ["0","1","2","3","4","5","6","7","8","9","0","!","?","'","\"","$"], + ["(",")","{","}","[","]","<",">","&","#","|","~","^"," "," ","終"] + ]; + + let strTextView = + [ + ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P"], + ["Q","R","S","T","U","V","W","X","Y","Z",".",",",":",";","_","@"], + ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p"], + ["q","r","s","t","u","v","w","x","y","z","+","-","/","*","=","%"], + ["0","1","2","3","4","5","6","7","8","9","0","!","?","'","\"","$"], + ["(",")","{","}","&osb;","&csb;","<",">","&","#","|","~","^"," "," ","»"] + ]; + + let cursorX = 0; + let cursorY = 0; + let maxCursorX = length(strTextIn[0]); + let maxCursorY = length(strTextIn); + + task TMenuItem(let itemX, let itemY) + { + let objText = CreateTextObject(360 + GetStgFrameWidth()/4 + itemX * 42, 400 + itemY * 42, 40, strTextView[itemY][itemX]); + let objSelect = CreateTextObject(360 + GetStgFrameWidth()/4+ itemX * 42, 400 + itemY * 42, 40, strTextView[itemY][itemX]); + ObjRender_SetBlendType(objSelect, BLEND_ADD_ARGB); + + while(menuMode == MENU_NAME_ENTRY) + { + Obj_SetVisible(objSelect, itemX == cursorX && itemY == cursorY); + yield; + } + Obj_Delete(objText); + Obj_Delete(objSelect); + } + + ascent(let iY in 0..maxCursorY) + { + ascent(let iX in 0 .. maxCursorX) + { + TMenuItem(iX, iY); + } + } + + //キー状態がリセットされるまで待機 + while(GetVirtualKeyState(VK_OK) != KEY_FREE){yield;} + + //入力済み文字 + let userName = ""; + let objName = CreateTextObject(360+GetStgFrameWidth()/4, 200, 45, ""); + task TNameCursor() + { + let objCursor = CreateTextObject(360+GetStgFrameWidth()/4, 200, 45, "_"); + while(menuMode == MENU_NAME_ENTRY) + { + let nameLength = length(userName); + ObjRender_SetX(objCursor, 360+GetStgFrameWidth()/4 + nameLength * 30); + Obj_SetVisible(objCursor, nameLength < 8); + yield; + } + Obj_Delete(objCursor); + } + TNameCursor; + + //キー処理 + let frameKeyHold = 0;//キー押しっぱなしフレーム数 + while(menuMode == MENU_NAME_ENTRY) + { + + if(GetVirtualKeyState(VK_OK) == KEY_PULL) + { + //決定 + let nameLength = length(userName); + if(cursorX == maxCursorX-1 && cursorY == maxCursorY-1) + { + //終了キー + if(nameLength == 0) + { + userName = "Gay"; + } + else + { + SetReplayUserData("Starting Lives", GetCommonData("Starting Lives Selected", 5)); + SetReplayUserData("Player Team", GetCommonData("Player Team", "ByakMiko")); + SetReplayUserData("Difficulty", GetCommonData("Difficulty", "Arcade")); + SetReplayUserData("Dialogue Skip", GetCommonData("Dialogue Skip Mode", 0)); + SaveReplay(replayIndex, userName); + SetScriptResult(RESULT_END); + CloseScript(GetOwnScriptID()); + return; + } + } + else if(nameLength < 8) + { + userName = userName ~ strTextIn[cursorY][cursorX]; + } + } + if(GetVirtualKeyState(VK_CANCEL) == KEY_PULL) + { + //キャンセル + let nameLength = length(userName); + if(nameLength > 0) + { + userName = userName[0..nameLength-1]; + } + else{menuMode = MENU_INDEX_SELECTION; TReplayIndexSelection(); break;} + } + ObjText_SetText(objName, userName); + + //カーソル移動 + if(GetVirtualKeyState(VK_UP) == KEY_PUSH || GetVirtualKeyState(VK_UP) == KEY_HOLD) + { + frameKeyHold++; + if(GetVirtualKeyState(VK_UP) == KEY_PUSH || + frameKeyHold == 20 || + (frameKeyHold > 20 && (frameKeyHold % 10 == 0))) + { + cursorY--; + } + } + else if(GetVirtualKeyState(VK_DOWN) == KEY_PUSH || GetVirtualKeyState(VK_DOWN) == KEY_HOLD) + { + frameKeyHold++; + if(GetVirtualKeyState(VK_DOWN) == KEY_PUSH || + frameKeyHold == 20 || + (frameKeyHold > 20 && (frameKeyHold % 10 == 0))) + { + cursorY++; + } + } + else if(GetVirtualKeyState(VK_LEFT) == KEY_PUSH || GetVirtualKeyState(VK_LEFT) == KEY_HOLD) + { + frameKeyHold++; + if(GetVirtualKeyState(VK_LEFT) == KEY_PUSH || + frameKeyHold == 20 || + (frameKeyHold > 20 && (frameKeyHold % 10 == 0))) + { + cursorX--; + } + } + else if(GetVirtualKeyState(VK_RIGHT) == KEY_PUSH || GetVirtualKeyState(VK_RIGHT) == KEY_HOLD) + { + frameKeyHold++; + if(GetVirtualKeyState(VK_RIGHT) == KEY_PUSH || + frameKeyHold == 20 || + (frameKeyHold > 20 && (frameKeyHold % 10 == 0))) + { + cursorX++; + } + } + else + { + frameKeyHold = 0; + } + + if(cursorX < 0) + { + cursorX = maxCursorX-1; + } + else if(cursorX >= maxCursorX) + { + cursorX = 0; + } + + if(cursorY < 0) + { + cursorY = maxCursorY-1; + } + else if(cursorY >= maxCursorY) + { + cursorY = 0; + } + + yield; + } +} + diff --git a/KevinSystem/kevin_system/Legacy (1280x720)/KevinSystem_Item.txt b/KevinSystem/kevin_system/Legacy (1280x720)/KevinSystem_Item.txt new file mode 100644 index 0000000..b23af13 --- /dev/null +++ b/KevinSystem/kevin_system/Legacy (1280x720)/KevinSystem_Item.txt @@ -0,0 +1,46 @@ +// Item script + +#include "./Kevin_ItemConst.txt" +#include "./Kevin_ItemLib.txt" +//#include "./Kevin_ItemData.txt" + +@Initialize{ + SetAutoDeleteObject(true); + SetDefaultBonusItemEnable(true); + LoadItemData(GetCurrentScriptDirectory ~ "./Kevin_ItemData.txt"); +} + +@MainLoop{ + yield; +} + +@Event +{ + alternative (GetEventType) + case (EV_GET_ITEM){ + + let obj = GetEventArgument(0); + + alternative(obj) + + case(POINT_REGULAR){ AddScore(GetAreaCommonData("PIV", "currentvalue", 0));} + case(POINT_BHESTIE){ AddScore(2*GetAreaCommonData("PIV", "currentvalue", 0));} + case(EXTEND_LIFE){ AddScore(50000); SetPlayerLife(GetPlayerLife()+1);} + case(EXTEND_SPELL){ AddScore(50000); SetPlayerSpell(GetPlayerSpell()+1);} + case(PIV_100){ SetAreaCommonData("PIV", "currentvalue", GetAreaCommonData("PIV", "currentvalue", 0)+100);} + case(PIV_250){ SetAreaCommonData("PIV", "currentvalue", GetAreaCommonData("PIV", "currentvalue", 0)+250);} + case(PIV_500){ SetAreaCommonData("PIV", "currentvalue", GetAreaCommonData("PIV", "currentvalue", 0)+500);} + + } + + case (EV_DELETE_SHOT_TO_ITEM){ + + } + + case (EV_COLLECT_ITEM){ + let obj = GetEventArgument(1); + ObjMove_SetAcceleration(obj, 0.85); + ObjMove_SetMaxSpeed(obj, 12); + } + +} \ No newline at end of file diff --git a/KevinSystem/kevin_system/Legacy (1280x720)/Kevin_EndScene.txt b/KevinSystem/kevin_system/Legacy (1280x720)/Kevin_EndScene.txt new file mode 100644 index 0000000..1717c91 --- /dev/null +++ b/KevinSystem/kevin_system/Legacy (1280x720)/Kevin_EndScene.txt @@ -0,0 +1,292 @@ +//一時停止中スクリプト + +#include "script/KevinSystem/GeneralSoundLib.txt" + +int STGWIDTH = GetStgFrameWidth(); +int STGHEIGHT = GetStgFrameHeight(); + +@Initialize +{ + _SoundTask(); + ExtendSFX; + SetAutoDeleteObject(true); + TBackgroundNew(0, 0); + TMenu(); +} + +@MainLoop +{ + yield; +} + +@Finalize +{ +} + + +task TBackgroundNew(renderX, renderY){ + + let clearText = ObjText_Create(); + ObjText_SetText(clearText, "Congratulations on clearing the game![r]Until the next convocation..."); + ObjText_SetFontSize(clearText, 18.5); + ObjText_SetFontType(clearText, "Connecting Chain Handserif"); + + ObjText_SetMaxWidth(clearText, STGWIDTH); + ObjText_SetHorizontalAlignment(clearText, ALIGNMENT_CENTER); + + ObjText_SetFontBold(clearText, true); + ObjText_SetFontColorTop(clearText, 255, 255, 255); + ObjText_SetFontColorBottom(clearText, 255, 255, 255); + ObjText_SetFontBorderType(clearText, BORDER_FULL); + ObjText_SetFontBorderColor(clearText, 0x7D39D9); + ObjText_SetFontBorderWidth(clearText, 2); + Obj_SetRenderPriorityI(clearText, 10); + ObjRender_SetX(clearText, STGWIDTH-255); + ObjRender_SetY(clearText, STGHEIGHT-75); + + // Render semi-transparent primitive background + task TRenderPrim(selection){ + + // Thank you for the PrimMaker Ferase :omegaflooshed: + + ObjRender_SetPosition(selection, renderX+640, renderY+360, 0); // Since the render priority of the r.target is under 20 + + // Set up vert 0 + ObjPrim_SetVertexPosition(selection,0,-640,-360,0); + ObjPrim_SetVertexColor(selection,0,0xA487FF); + ObjPrim_SetVertexUVT(selection, 0, 0, 0); + // Set up vert 1 + ObjPrim_SetVertexPosition(selection,1,640,-360,0); + ObjPrim_SetVertexColor(selection,1,0xA487FF); + ObjPrim_SetVertexUVT(selection, 1, 1280, 0); + // Set up vert 2 + ObjPrim_SetVertexPosition(selection,2,640,360,0); + ObjPrim_SetVertexColor(selection,2,0xA487FF); + ObjPrim_SetVertexUVT(selection, 2, 1280, 720); + // Set up vert 3 + ObjPrim_SetVertexPosition(selection,3,640,360,0); + ObjPrim_SetVertexColor(selection,3,0xF187FF); + ObjPrim_SetVertexUVT(selection, 3, 1280, 720); + // Set up vert 4 + ObjPrim_SetVertexPosition(selection,4,-640,360,0); + ObjPrim_SetVertexColor(selection,4,0xF187FF); + ObjPrim_SetVertexUVT(selection, 4, 0, 720); + // Set up vert 5 + ObjPrim_SetVertexPosition(selection,5,-640,-360,0); + ObjPrim_SetVertexColor(selection,5,0xF187FF); + ObjPrim_SetVertexUVT(selection, 5, 0, 0); + + for(int i = 0; i <= 5; i++){ + ObjPrim_SetVertexAlpha(selection, i, 100); + } + } + + // Render... the render target??? + let objBG = ObjPrim_Create(OBJ_PRIMITIVE_2D); + ObjPrim_SetPrimitiveType(objBG, PRIMITIVE_TRIANGLELIST); + ObjPrim_SetVertexCount(objBG, 6); + let target = "target"; + CreateRenderTargetEx(target, 1280, 720); + ObjPrim_SetTexture(objBG, target); + //SetInvalidRenderPriorityA1(20, 80); + RenderToTextureA1(target, 0, 100, true); + //RenderToTextureB1(target, objBG, true); + Obj_SetRenderPriorityI(objBG, 0); + TRenderPrim(objBG); + +} + +task TBackground +{ + task TVertex(var index, var left, var top, var right, var bottom) + { + ObjPrim_SetVertexPosition(obj, index + 0, left, top, 0); + ObjPrim_SetVertexPosition(obj, index + 1, left, bottom, 0); + ObjPrim_SetVertexPosition(obj, index + 2, right, top, 0); + ObjPrim_SetVertexPosition(obj, index + 3, right, top, 0); + ObjPrim_SetVertexPosition(obj, index + 4, left, bottom, 0); + ObjPrim_SetVertexPosition(obj, index + 5, right, bottom, 0); + + ObjPrim_SetVertexUVT(obj, index + 0, left, top); + ObjPrim_SetVertexUVT(obj, index + 1, left, bottom); + ObjPrim_SetVertexUVT(obj, index + 2, right, top); + ObjPrim_SetVertexUVT(obj, index + 3, right, top); + ObjPrim_SetVertexUVT(obj, index + 4, left, bottom); + ObjPrim_SetVertexUVT(obj, index + 5, right, bottom); + + //STGシーン内のみアニメーション + if(left >= 341 && right <= 937 && top >= 45 && bottom <= 677) + { + let alpha = 255; + while(alpha >= 128) + { + ObjPrim_SetVertexAlpha(obj, index + 0, alpha); + ObjPrim_SetVertexAlpha(obj, index + 1, alpha/2); + ObjPrim_SetVertexAlpha(obj, index + 2, alpha/2); + ObjPrim_SetVertexAlpha(obj, index + 3, alpha/2); + ObjPrim_SetVertexAlpha(obj, index + 4, alpha/2); + ObjPrim_SetVertexAlpha(obj, index + 5, alpha); + alpha -= 255 / frame; + + yield; + } + } + } + + //分割設定 + let frame = 30; + let countH = 20; //分割数 + let countV = 30; + let width = 1280 / countH; + let height = 720 / countV; + let target = GetTransitionRenderTargetName(); + let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D); //2D頂点ブジェクト生成 + ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLELIST); + ObjPrim_SetVertexCount(obj, countH * countV * 6); + Obj_SetRenderPriorityI(obj, 0); //描画優先度を設定 + ObjPrim_SetTexture(obj, target); //テクスチャを設定 + + ascent(ix in 0.. countH) + { + ascent(iy in 0.. countV) + { + let index = (ix + iy * countH) * 6; + let left = ix * width; + let right = left + width; + let top = iy * height; + let bottom = top + height; + TVertex(index, left, top, right, bottom); + } + } + +} + +task TMenu +{ + let selectIndex = 0;//選択位置 + task TMenuItem(let index, let mx, let my, let text) + { + function CreateTextObject(let mx, let my, let text) + { + let obj = ObjText_Create(); + ObjText_SetText(obj, text); + ObjText_SetFontSize(obj, 35); + ObjText_SetFontType(obj, "Exotc350 DmBd BT"); + ObjText_SetFontBold(obj, true); + ObjText_SetHorizontalAlignment(obj, ALIGNMENT_CENTER); + ObjText_SetMaxWidth(obj, STGWIDTH); + ObjText_SetFontColorTop(obj, 155, 45, 175); + ObjText_SetFontColorBottom(obj, 200, 80, 255); + ObjText_SetFontBorderType(obj, BORDER_FULL); + ObjText_SetFontBorderColor(obj, 255, 255, 255); + ObjText_SetFontBorderWidth(obj, 1.75); + Obj_SetRenderPriorityI(obj, 10); + ObjRender_SetX(obj, mx); + ObjRender_SetY(obj, my); + return obj; + } + + let objText = CreateTextObject(mx, my, text); + let objSelect = CreateTextObject(mx, my, text); + ObjRender_SetBlendType(objSelect, BLEND_ADD_RGB); + loop + { + Obj_SetVisible(objSelect, index == selectIndex); + yield; + } + } + + //メニュー配置 + let objText = ObjText_Create(); + ObjText_SetText(objText, "End of a Duel"); + ObjText_SetFontSize(objText, 50); + ObjText_SetFontType(objText, "Exotc350 DmBd BT"); + + ObjText_SetMaxWidth(objText, STGWIDTH); + ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER); + + ObjText_SetFontBold(objText, true); + ObjText_SetFontColorTop(objText, 75, 255, 255); + ObjText_SetFontColorBottom(objText, 180, 255, 255); + ObjText_SetFontBorderType(objText, BORDER_FULL); + ObjText_SetFontBorderColor(objText,0, 0, 0); + ObjText_SetFontBorderWidth(objText, 3); + Obj_SetRenderPriorityI(objText, 10); + ObjRender_SetX(objText, STGWIDTH-255); + ObjRender_SetY(objText, 100); + + let mx = STGWIDTH-255; + let my = 175; + let texts = ["Record Your Victories", "Leave The Battlefield", "Go For A Rematch"]; + var countMenu = length(texts); + ascent(var iText in 0 .. countMenu) + { + TMenuItem(iText, mx, my, texts[iText]); + my += 45; + } + + //キー状態がリセットされるまで待機 + while(GetVirtualKeyState(VK_OK) != KEY_FREE){yield;} + + //メニュー選択処理 + let frameKeyHold = 0;//キー押しっぱなしフレーム数 + loop + { + //決定 + if(GetVirtualKeyState(VK_OK) == KEY_PULL) + { + let listResult = [RESULT_SAVE_REPLAY, RESULT_END, RESULT_RETRY]; + SetScriptResult(listResult[selectIndex]); + CloseScript(GetOwnScriptID()); + return; + } + + //カーソル移動 + if(GetVirtualKeyState(VK_UP) == KEY_PUSH) + { + SelectOptionSFX; + selectIndex--; + } + else if(GetVirtualKeyState(VK_DOWN) == KEY_PUSH) + { + SelectOptionSFX; + selectIndex++; + } + else if(GetVirtualKeyState(VK_UP) == KEY_HOLD) + { + frameKeyHold++; + if(frameKeyHold == 30 || (frameKeyHold > 30 && (frameKeyHold % 10 == 0))) + { + SelectOptionSFX; + selectIndex--; + } + } + else if(GetVirtualKeyState(VK_DOWN) == KEY_HOLD) + { + frameKeyHold++; + if(frameKeyHold == 30 || (frameKeyHold > 30 && (frameKeyHold % 10 == 0))) + { + SelectOptionSFX; + selectIndex++; + } + } + else + { + frameKeyHold = 0; + } + + if(selectIndex < 0) + { + selectIndex = countMenu - 1; + } + else + { + selectIndex %= countMenu; + } + + yield; + } +} + + + diff --git a/KevinSystem/kevin_system/Legacy (1280x720)/Kevin_ItemConst.txt b/KevinSystem/kevin_system/Legacy (1280x720)/Kevin_ItemConst.txt new file mode 100644 index 0000000..c951481 --- /dev/null +++ b/KevinSystem/kevin_system/Legacy (1280x720)/Kevin_ItemConst.txt @@ -0,0 +1,7 @@ +const POINT_REGULAR = 1; +const POINT_BHESTIE = 2; +const EXTEND_LIFE = 3; +const EXTEND_SPELL = 4; +const PIV_100 = 5; +const PIV_250 = 6; +const PIV_500 = 7; \ No newline at end of file diff --git a/KevinSystem/kevin_system/Legacy (1280x720)/Kevin_ItemData.txt b/KevinSystem/kevin_system/Legacy (1280x720)/Kevin_ItemData.txt new file mode 100644 index 0000000..f32d9bb --- /dev/null +++ b/KevinSystem/kevin_system/Legacy (1280x720)/Kevin_ItemData.txt @@ -0,0 +1,11 @@ +#UserItemData + +item_image = "./../img/yo.png" + +ItemData { id=1 rect=(256,256,384,384) } // Regular Point Item (PIV) +ItemData { id=2 rect=(384,128,512,256) } // Bhestie Point Item (PIV * 2) +ItemData { id=3 rect=(0,256,128,384) } // 1-up Item +ItemData { id=4 rect=(128,256,256,384) } // Spell Item +ItemData { id=5 rect=(256,384,384,512) fixed_angle = false angular_velocity = 3} // Green PIV Item (+100) +ItemData { id=6 rect=(384,384,512,512) fixed_angle = false angular_velocity = 3} // Pink PIV Item (+250) +ItemData { id=7 rect=(384,256,512,384) fixed_angle = false angular_velocity = 3} // Gold PIV Item (+500) diff --git a/KevinSystem/kevin_system/Legacy (1280x720)/Kevin_ItemLib.txt b/KevinSystem/kevin_system/Legacy (1280x720)/Kevin_ItemLib.txt new file mode 100644 index 0000000..777d751 --- /dev/null +++ b/KevinSystem/kevin_system/Legacy (1280x720)/Kevin_ItemLib.txt @@ -0,0 +1,92 @@ +// Valid types: PIV_100, PIV_250, PIV_500 + +function CreatePIVItem(itemtype, x, y){ + let PIVItem = CreateItemU2(itemtype, x, y, x-10, y-10, 100); + + ObjItem_SetMoveToPlayer(PIVItem, true); + ObjItem_SetAutoDelete(PIVItem, false); + + ObjItem_SetAutoCollectEnableFlags(PIVItem, ITEM_AUTOCOLLECT_ALL); + ObjItem_SetRenderScoreEnable(PIVItem, false); + + ObjItem_SetIntersectionRadius(PIVItem, 60); + + ObjRender_SetScaleXYZ(PIVItem, 0.3, 0.3, 1); + ObjRender_SetAlpha(PIVItem, 125); + + async{ + while(!Obj_IsDeleted(PIVItem)){ + float angz = ObjRender_GetAngleZ(PIVItem); + ObjRender_SetAngleZ(PIVItem, angz+5); + yield; + } + } + + return PIVItem; +} + +// Valid types: POINT_REGULAR, POINT_BHESTIE +function CreateScoreItem(itemtype, x, y){ + let ScoreItem = CreateItemU2(itemtype, x, y, x-30, y-30, 0); + + ObjItem_SetAutoCollectEnableFlags(ScoreItem, ITEM_AUTOCOLLECT_ALL); + ObjItem_SetAutoDelete(ScoreItem, false); + + ObjItem_SetIntersectionRadius(ScoreItem, 60); + ObjItem_SetRenderScoreEnable(ScoreItem, false); + + ObjRender_SetScaleXYZ(ScoreItem, 0.4, 0.4, 1); + ObjRender_SetAlpha(ScoreItem, 200); + + ObjMove_AddPatternA2(ScoreItem, 60, NO_CHANGE, 90, 0.12, 5.45, 0); + + return ScoreItem; +} + +// Valid types: EXTEND_LIFE, EXTEND_SPELL +function CreateExtendItem(itemtype, x, y){ + + let ExtendItem = CreateItemU2(itemtype, x, y, x-15, y-15, 0); + ObjItem_SetMoveToPlayer(ExtendItem, true); + ObjItem_SetAutoCollectEnableFlags(ExtendItem, ITEM_AUTOCOLLECT_ALL); + + ObjRender_SetScaleXYZ(ExtendItem, 0.5, 0.5, 1); + + return ExtendItem; +} + +// Summoning the actual items + +function NonspellItemDrop(scene, x, y){ + + if(ObjEnemyBossScene_GetInfo(scene, INFO_PLAYER_SHOOTDOWN_COUNT) == 0){ + loop(14){ + CreateScoreItem(POINT_REGULAR, x+rand(-75, 75), y+rand(-45, 45)); + } + } + else{ + loop(8){ + CreateScoreItem(POINT_REGULAR, x+rand(-75, 75), y+rand(-45, 45)); + } + } + +} + +function SpellItemDrop(scene, x, y){ + + if(ObjEnemyBossScene_GetInfo(scene, INFO_PLAYER_SHOOTDOWN_COUNT) == 0 && ObjEnemyBossScene_GetInfo(scene, INFO_PLAYER_SPELL_COUNT) == 0){ + loop(20){ + CreateScoreItem(POINT_BHESTIE, x+rand(-75, 75), y+rand(-45, 45)); + } + loop(10){ + CreateScoreItem(POINT_REGULAR, x+rand(-75, 75), y+rand(-45, 45)); + } + } + else if(ObjEnemyBossScene_GetInfo(scene, INFO_PLAYER_SHOOTDOWN_COUNT) == 0 && ObjEnemyBossScene_GetInfo(scene, INFO_PLAYER_SPELL_COUNT) >> 0){ + loop(12){ + CreateScoreItem(POINT_REGULAR, x+rand(-75, 75), y+rand(-45, 45)); + } + } + else{} + +} \ No newline at end of file diff --git a/KevinSystem/kevin_system/Legacy (1280x720)/Kevin_Pause.txt b/KevinSystem/kevin_system/Legacy (1280x720)/Kevin_Pause.txt new file mode 100644 index 0000000..5eaa64e --- /dev/null +++ b/KevinSystem/kevin_system/Legacy (1280x720)/Kevin_Pause.txt @@ -0,0 +1,335 @@ +//一時停止中スクリプト +//#include "./../../script/soundtask.txt" +#include "script/KevinSystem/GeneralSoundLib.txt" + +int STGWIDTH = GetStgFrameWidth(); +int STGHEIGHT = GetStgFrameHeight(); + +@Initialize +{ + _SoundTask(); + PauseGameSFX; + SetAutoDeleteObject(true); + //TBackground(); + TBackgroundNew(0, 0); + TMenu(); + TFunFact(); + //_SoundTask; +} + +@MainLoop +{ + yield; +} + +@Finalize +{ +} + +task TFunFact(){ + + //int y = 0; + + let textchoices = [ + "Even though her parents gave her an entire crash course[r]on how royals enjoy tea, Erika is more a coffee fan.", + "Pankevin is terrified of heights, but loves rollercoasters & thrill rides.[r]He only rides the ones with shoulder harnesses to feel safer,[r]and always goes with Kouda.", + "Rachel has been exterminated at least twice by Housui[r]for constantly nagging her to let Rachel experiment.", + "There are a total of 18 fun facts on this pause menu,[r]including this one. How many have you found?", + "The creator of this game is incredibly self-indulgent.[r]You probably figured out this one, though...", + "Connecting Chain Handserif is the creator's favorite font.[r]As a Brazilian once said, \"this bitch is[r]hyperfixated on that font\".", + "Pankevin is acquainted with a duck who casts ice magic in the[r]Outside World. His name is Caleb.", + "Marisa and Housui often duel in the Forest of Magic.[r]Their antics have incited Alice's wrath so much that[r]she just doesn't care anymore.", + "Whenever Tenshi and Shion organize banquets at the Hakurei Shrine,[r]Erika is the self-appointed taste tester of the food.[r]It's gone from \"unbearable\" to \"passable\" according to her.", + "Kouda always has a pair of fluffy cat-ear headphones on hand wherever[r]he goes, so he can plop them on when he's overwhelmed by loud sounds.[r]Pankevin keeps the headphones for Kouda in his huge quiver[r]when they're traveling together.", + "Tenshi and Erika were planning to bring Shion along for[r]their adventures, but the latter was exhausted after[r]the oil overflow incident and stayed out.[r](If Shion came along, they would be too powerful...)", + "Housui's favorite food are amarylis flowers.[r]...That's what she says, but it's probably just mochi.", + "Inside Pankevin's huge quiver, there are many refillable water containers,[r]a portable sketchbook & watercolor set, some snacks, and a pair of[r]fluffy cat-ear headphones for Kouda.", + "Pankevin = Panda + Kevin, not Pansexual x Kevin. Pankevin is bi.", + "Thank you for playing this game! It means a lot to me :D", + "Erika Rankyuu debuted in the creator's first game, Enigma of the Storm. [r]It was made for a bullet hell game contest in a Discord server.", + "Housui Henkawa debuted in Unstable and Unimaginable Power, [r]a Touhou fangame. It's very well-crafted and polished, so go ahead[r]and play it! Housui's the Extra boss, by the way.", + "Housui is not bald.", + ]; + int x = prand_int(0, length(textchoices)-1); + //y = length(textchoices); + + let objText = ObjText_Create(); + ObjText_SetText(objText, textchoices[x]); + ObjText_SetFontSize(objText, 18.5); + ObjText_SetFontType(objText, "Connecting Chain Handserif"); + + ObjText_SetMaxWidth(objText, STGWIDTH); + ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER); + + ObjText_SetFontBold(objText, true); + ObjText_SetFontColorTop(objText, 255, 255, 255); + ObjText_SetFontColorBottom(objText, 255, 255, 255); + ObjText_SetFontBorderType(objText, BORDER_FULL); + ObjText_SetFontBorderColor(objText, 0x7D39D9); + ObjText_SetFontBorderWidth(objText, 2); + Obj_SetRenderPriorityI(objText, 10); + ObjRender_SetX(objText, STGWIDTH-255); + ObjRender_SetY(objText, STGHEIGHT-75); + +} + +// renderX and renderY will be TOP-LEFT COORDS +task TBackgroundNew(renderX, renderY){ + // Render semi-transparent primitive background + task TRenderPrim(selection){ + + // Thank you for the PrimMaker Ferase :omegaflooshed: + + ObjRender_SetPosition(selection, renderX+640, renderY+360, 0); // Since the render priority of the r.target is under 20 + + // Set up vert 0 + ObjPrim_SetVertexPosition(selection,0,-640,-360,0); + ObjPrim_SetVertexColor(selection,0,0xA487FF); + ObjPrim_SetVertexUVT(selection, 0, 0, 0); + // Set up vert 1 + ObjPrim_SetVertexPosition(selection,1,640,-360,0); + ObjPrim_SetVertexColor(selection,1,0xA487FF); + ObjPrim_SetVertexUVT(selection, 1, 1280, 0); + // Set up vert 2 + ObjPrim_SetVertexPosition(selection,2,640,360,0); + ObjPrim_SetVertexColor(selection,2,0xA487FF); + ObjPrim_SetVertexUVT(selection, 2, 1280, 720); + // Set up vert 3 + ObjPrim_SetVertexPosition(selection,3,640,360,0); + ObjPrim_SetVertexColor(selection,3,0xF187FF); + ObjPrim_SetVertexUVT(selection, 3, 1280, 720); + // Set up vert 4 + ObjPrim_SetVertexPosition(selection,4,-640,360,0); + ObjPrim_SetVertexColor(selection,4,0xF187FF); + ObjPrim_SetVertexUVT(selection, 4, 0, 720); + // Set up vert 5 + ObjPrim_SetVertexPosition(selection,5,-640,-360,0); + ObjPrim_SetVertexColor(selection,5,0xF187FF); + ObjPrim_SetVertexUVT(selection, 5, 0, 0); + + for(int i = 0; i <= 5; i++){ + ObjPrim_SetVertexAlpha(selection, i, 100); + } + } + + // Render... the render target??? + let objBG = ObjPrim_Create(OBJ_PRIMITIVE_2D); + ObjPrim_SetPrimitiveType(objBG, PRIMITIVE_TRIANGLELIST); + ObjPrim_SetVertexCount(objBG, 6); + let target = "target"; + CreateRenderTargetEx(target, 1280, 720); + ObjPrim_SetTexture(objBG, target); + //SetInvalidRenderPriorityA1(20, 80); + RenderToTextureA1(target, 0, 100, true); + //RenderToTextureB1(target, objBG, true); + Obj_SetRenderPriorityI(objBG, 0); + TRenderPrim(objBG); + +} + +task TBackground +{ + task TVertex(var index, var left, var top, var right, var bottom) + { + ObjPrim_SetVertexPosition(obj, index + 0, left, top, 0); + ObjPrim_SetVertexPosition(obj, index + 1, left, bottom, 0); + ObjPrim_SetVertexPosition(obj, index + 2, right, top, 0); + ObjPrim_SetVertexPosition(obj, index + 3, right, top, 0); + ObjPrim_SetVertexPosition(obj, index + 4, left, bottom, 0); + ObjPrim_SetVertexPosition(obj, index + 5, right, bottom, 0); + + ObjPrim_SetVertexUVT(obj, index + 0, left, top); + ObjPrim_SetVertexUVT(obj, index + 1, left, bottom); + ObjPrim_SetVertexUVT(obj, index + 2, right, top); + ObjPrim_SetVertexUVT(obj, index + 3, right, top); + ObjPrim_SetVertexUVT(obj, index + 4, left, bottom); + ObjPrim_SetVertexUVT(obj, index + 5, right, bottom); + + //STGシーン内のみアニメーション + if(left >= 341 && right <= 937 && top >= 45 && bottom <= 677) + { + let alpha = 255; + while(alpha >= 128) + { + ObjPrim_SetVertexAlpha(obj, index + 0, alpha); + ObjPrim_SetVertexAlpha(obj, index + 1, alpha/2); + ObjPrim_SetVertexAlpha(obj, index + 2, alpha/2); + ObjPrim_SetVertexAlpha(obj, index + 3, alpha/2); + ObjPrim_SetVertexAlpha(obj, index + 4, alpha/2); + ObjPrim_SetVertexAlpha(obj, index + 5, alpha); + alpha -= 255 / frame; + + yield; + } + } + } + + //分割設定 + let frame = 30; + let countH = 20; //分割数 + let countV = 30; + let width = 1280 / countH; + let height = 720 / countV; + let target = GetTransitionRenderTargetName(); + let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D); //2D頂点ブジェクト生成 + ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLELIST); + ObjPrim_SetVertexCount(obj, countH * countV * 6); + Obj_SetRenderPriorityI(obj, 0); //描画優先度を設定 + ObjPrim_SetTexture(obj, target); //テクスチャを設定 + + ascent(ix in 0.. countH) + { + ascent(iy in 0.. countV) + { + let index = (ix + iy * countH) * 6; + let left = ix * width; + let right = left + width; + let top = iy * height; + let bottom = top + height; + TVertex(index, left, top, right, bottom); + } + } + +} + +task TMenu +{ + let selectIndex = 0;//選択位置 + task TMenuItem(let index, let mx, let my, let text) + { + function CreateTextObject(let mx, let my, let text) + { + let obj = ObjText_Create(); + ObjText_SetText(obj, text); + ObjText_SetFontSize(obj, 35); + ObjText_SetFontType(obj, "Exotc350 DmBd BT"); + ObjText_SetFontBold(obj, true); + ObjText_SetHorizontalAlignment(obj, ALIGNMENT_CENTER); + ObjText_SetMaxWidth(obj, STGWIDTH); + ObjText_SetFontColorTop(obj, 155, 45, 175); + ObjText_SetFontColorBottom(obj, 200, 80, 255); + ObjText_SetFontBorderType(obj, BORDER_FULL); + ObjText_SetFontBorderColor(obj, 255, 255, 255); + ObjText_SetFontBorderWidth(obj, 1.75); + Obj_SetRenderPriorityI(obj, 10); + ObjRender_SetX(obj, mx); + ObjRender_SetY(obj, my); + return obj; + } + + let objText = CreateTextObject(mx, my, text); + let objSelect = CreateTextObject(mx, my, text); + ObjRender_SetBlendType(objSelect, BLEND_ADD_RGB); + loop + { + Obj_SetVisible(objSelect, index == selectIndex); + yield; + } + } + + //メニュー配置 + int x = prand_int(0, 6); + let textchoices = ["A Brief Respite", "Yassification Paused", "Tea Time", "Heroic Moratorium", "World Comes to A Halt","A Moment to Breathe", "Players are Resting Warmly"]; + + let objText = ObjText_Create(); + ObjText_SetText(objText, textchoices[x]); + ObjText_SetFontSize(objText, 50); + ObjText_SetFontType(objText, "Exotc350 DmBd BT"); + + ObjText_SetMaxWidth(objText, STGWIDTH); + ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER); + + ObjText_SetFontBold(objText, true); + ObjText_SetFontColorTop(objText, 75, 255, 255); + ObjText_SetFontColorBottom(objText, 180, 255, 255); + ObjText_SetFontBorderType(objText, BORDER_FULL); + ObjText_SetFontBorderColor(objText,0, 0, 0); + ObjText_SetFontBorderWidth(objText, 3); + Obj_SetRenderPriorityI(objText, 10); + ObjRender_SetX(objText, STGWIDTH-255); + ObjRender_SetY(objText, 100); + + let mx = STGWIDTH-255; + let my = 175; + let texts = ["Resume The Faceoff", "Accept Your Losses", "Take Another Shot"]; + var countMenu = length(texts); + ascent(var iText in 0 .. countMenu) + { + TMenuItem(iText, mx, my, texts[iText]); + my += 45; + } + + //キー状態がリセットされるまで待機 + while(GetVirtualKeyState(VK_PAUSE) != KEY_FREE){yield;} + + //メニュー選択処理 + let frameKeyHold = 0;//キー押しっぱなしフレーム数 + //PauseGameSFX; + loop + { + //決定 + if(GetVirtualKeyState(VK_OK) == KEY_PULL) + { + let listResult = [RESULT_CANCEL, RESULT_END, RESULT_RETRY]; + SetScriptResult(listResult[selectIndex]); + CloseScript(GetOwnScriptID()); + return; + } + + //キャンセル + if(GetVirtualKeyState(VK_CANCEL) == KEY_PULL || GetVirtualKeyState(VK_PAUSE) == KEY_PULL) + { + SetScriptResult(RESULT_CANCEL); + CloseScript(GetOwnScriptID()); + return; + } + + //カーソル移動 + if(GetVirtualKeyState(VK_UP) == KEY_PUSH) + { + SelectOptionSFX; + selectIndex--; + } + else if(GetVirtualKeyState(VK_DOWN) == KEY_PUSH) + { + SelectOptionSFX; + selectIndex++; + } + else if(GetVirtualKeyState(VK_UP) == KEY_HOLD) + { + frameKeyHold++; + if(frameKeyHold == 30 || (frameKeyHold > 30 && (frameKeyHold % 10 == 0))) + { + SelectOptionSFX; + selectIndex--; + } + } + else if(GetVirtualKeyState(VK_DOWN) == KEY_HOLD) + { + frameKeyHold++; + if(frameKeyHold == 30 || (frameKeyHold > 30 && (frameKeyHold % 10 == 0))) + { + SelectOptionSFX; + selectIndex++; + } + } + else + { + frameKeyHold = 0; + } + + if(selectIndex < 0) + { + selectIndex = countMenu - 1; + } + else + { + selectIndex %= countMenu; + } + + yield; + } +} + + + diff --git a/KevinSystem/kevin_system/Legacy (1280x720)/Kevin_ReplaySave.txt b/KevinSystem/kevin_system/Legacy (1280x720)/Kevin_ReplaySave.txt new file mode 100644 index 0000000..34feff8 --- /dev/null +++ b/KevinSystem/kevin_system/Legacy (1280x720)/Kevin_ReplaySave.txt @@ -0,0 +1,453 @@ +//リプレイ保存スクリプト + +int STGWIDTH = GetStgFrameWidth(); +int STGHEIGHT = GetStgFrameHeight(); + +@Initialize +{ + SetAutoDeleteObject(true); + LoadReplayList(); + + TBackgroundNew(0, 0); + TReplayIndexSelection(); +} + +@MainLoop +{ + yield; +} + +@Finalize +{ +} + +let MENU_INDEX_SELECTION = 1; +let MENU_NAME_ENTRY = 2; +let menuMode = MENU_INDEX_SELECTION; + +function CreateTextObject(let mx, let my, float size, let text) +{ + let obj = ObjText_Create(); + ObjText_SetText(obj, text); + ObjText_SetFontSize(obj, size); + ObjText_SetFontType(obj, "Unispace"); + ObjText_SetFontBold(obj, true); + //ObjText_SetHorizontalAlignment(obj, ALIGNMENT_CENTER); + ObjText_SetMaxWidth(obj, STGWIDTH); + ObjText_SetFontColorTop(obj, 155, 45, 175); + ObjText_SetFontColorBottom(obj, 200, 80, 255); + ObjText_SetFontBorderType(obj, BORDER_FULL); + ObjText_SetFontBorderColor(obj, 255, 255, 255); + ObjText_SetFontBorderWidth(obj, 1.75); + Obj_SetRenderPriorityI(obj, 10); + ObjRender_SetX(obj, mx); + ObjRender_SetY(obj, my); + return obj; +} + +// renderX and renderY will be TOP-LEFT COORDS +task TBackgroundNew(renderX, renderY){ + // Render semi-transparent primitive background + task TRenderPrim(selection){ + + // Thank you for the PrimMaker Ferase :omegaflooshed: + + ObjRender_SetPosition(selection, renderX+640, renderY+360, 0); // Since the render priority of the r.target is under 20 + + // Set up vert 0 + ObjPrim_SetVertexPosition(selection,0,-640,-360,0); + ObjPrim_SetVertexColor(selection,0,0xA487FF); + ObjPrim_SetVertexUVT(selection, 0, 0, 0); + // Set up vert 1 + ObjPrim_SetVertexPosition(selection,1,640,-360,0); + ObjPrim_SetVertexColor(selection,1,0xA487FF); + ObjPrim_SetVertexUVT(selection, 1, 1280, 0); + // Set up vert 2 + ObjPrim_SetVertexPosition(selection,2,640,360,0); + ObjPrim_SetVertexColor(selection,2,0xA487FF); + ObjPrim_SetVertexUVT(selection, 2, 1280, 720); + // Set up vert 3 + ObjPrim_SetVertexPosition(selection,3,640,360,0); + ObjPrim_SetVertexColor(selection,3,0xF187FF); + ObjPrim_SetVertexUVT(selection, 3, 1280, 720); + // Set up vert 4 + ObjPrim_SetVertexPosition(selection,4,-640,360,0); + ObjPrim_SetVertexColor(selection,4,0xF187FF); + ObjPrim_SetVertexUVT(selection, 4, 0, 720); + // Set up vert 5 + ObjPrim_SetVertexPosition(selection,5,-640,-360,0); + ObjPrim_SetVertexColor(selection,5,0xF187FF); + ObjPrim_SetVertexUVT(selection, 5, 0, 0); + + for(int i = 0; i <= 5; i++){ + ObjPrim_SetVertexAlpha(selection, i, 100); + } + } + + // Render... the render target??? + let objBG = ObjPrim_Create(OBJ_PRIMITIVE_2D); + ObjPrim_SetPrimitiveType(objBG, PRIMITIVE_TRIANGLELIST); + ObjPrim_SetVertexCount(objBG, 6); + let target = "target"; + CreateRenderTargetEx(target, STGWIDTH, STGHEIGHT); + ObjPrim_SetTexture(objBG, target); + //SetInvalidRenderPriorityA1(20, 80); + RenderToTextureA1(target, 0, 100, true); + //RenderToTextureB1(target, objBG, true); + Obj_SetRenderPriorityI(objBG, 0); + TRenderPrim(objBG); + +} + +task TBackground +{ + let target = GetTransitionRenderTargetName(); + let obj = ObjPrim_Create(OBJ_SPRITE_2D); + ObjPrim_SetTexture(obj, target); + Obj_SetRenderPriority(obj, 0.1); + ObjSprite2D_SetSourceRect(obj, 0, 0, 640, 480); + ObjSprite2D_SetDestCenter(obj); + ObjRender_SetPosition(obj, 320, 240, 0); + ObjRender_SetAlpha(obj, 64); +} + +task TReplayIndexSelection() +{ + let cursorY = 0; + let page = 0; + let countMaxItem = REPLAY_INDEX_DIGIT_MAX - REPLAY_INDEX_DIGIT_MIN + 1; + let countItemPerPage = 10; + let pageMax = trunc((countMaxItem - 1) / countItemPerPage); + pageMax = max(pageMax, 1); + let lastPageMaxCursorY = trunc(countMaxItem / countItemPerPage); + + task TMenuItem(let itemY) + { + let objText = CreateTextObject(341, 90 + 30 * itemY, 25, ""); + let objSelect = CreateTextObject(341, 90 + 30 * itemY, 25, ""); + ObjRender_SetBlendType(objSelect, BLEND_ADD_RGB); + + let oldPage = -1; + while(menuMode == MENU_INDEX_SELECTION) + { + if(page != oldPage) + { + let index = page * countItemPerPage + itemY + 1; + let text = rtos("00", index) ~ " "; + if(IsValidReplayIndex(index)) + { + text = text ~ vtos("-8s", GetReplayInfo(index, REPLAY_USER_NAME)) ~ " "; + text = text ~ GetReplayInfo(index, REPLAY_DATE_TIME) ~ " "; + text = text ~ rtos("000000000000", GetReplayInfo(index, REPLAY_TOTAL_SCORE)) ~ " "; + } + else + { + text = text ~ "No Data"; + } + ObjText_SetText(objText, text); + ObjText_SetText(objSelect, text); + oldPage = page; + } + + if(page == pageMax && itemY >= lastPageMaxCursorY) + { + Obj_SetVisible(objText, false); + Obj_SetVisible(objSelect, false); + } + else + { + Obj_SetVisible(objText, true); + Obj_SetVisible(objSelect, itemY == cursorY); + } + + yield; + } + Obj_Delete(objText); + Obj_Delete(objSelect); + } + + ascent(let iItem in 0 .. countItemPerPage) + { + TMenuItem(iItem); + } + + //キー状態がリセットされるまで待機 + while(GetVirtualKeyState(VK_OK) != KEY_FREE){yield;} + + //キー処理 + let frameKeyHold = 0;//キー押しっぱなしフレーム数 + while(menuMode == MENU_INDEX_SELECTION) + { + //決定 + if(GetVirtualKeyState(VK_OK) == KEY_PULL) + { + menuMode = MENU_NAME_ENTRY; + let index = page * countItemPerPage + cursorY + 1; + TNameEntry(index); + + break; + } + + //カーソル移動 + if(GetVirtualKeyState(VK_UP) == KEY_PUSH || GetVirtualKeyState(VK_UP) == KEY_HOLD) + { + frameKeyHold++; + if(GetVirtualKeyState(VK_UP) == KEY_PUSH || + frameKeyHold == 20 || + (frameKeyHold > 20 && (frameKeyHold % 10 == 0))) + { + cursorY--; + } + } + else if(GetVirtualKeyState(VK_DOWN) == KEY_PUSH || GetVirtualKeyState(VK_DOWN) == KEY_HOLD) + { + frameKeyHold++; + if(GetVirtualKeyState(VK_DOWN) == KEY_PUSH || + frameKeyHold == 20 || + (frameKeyHold > 20 && (frameKeyHold % 10 == 0))) + { + cursorY++; + } + } + else if(GetVirtualKeyState(VK_LEFT) == KEY_PUSH || GetVirtualKeyState(VK_LEFT) == KEY_HOLD) + { + frameKeyHold++; + if(GetVirtualKeyState(VK_LEFT) == KEY_PUSH || + frameKeyHold == 20 || + (frameKeyHold > 20 && (frameKeyHold % 10 == 0))) + { + page--; + } + } + else if(GetVirtualKeyState(VK_RIGHT) == KEY_PUSH || GetVirtualKeyState(VK_RIGHT) == KEY_HOLD) + { + frameKeyHold++; + if(GetVirtualKeyState(VK_RIGHT) == KEY_PUSH || + frameKeyHold == 20 || + (frameKeyHold > 20 && (frameKeyHold % 10 == 0))) + { + page++; + } + } + else + { + frameKeyHold = 0; + } + + if(page < 0) + { + page = pageMax; + } + else if(page > pageMax) + { + page = 0; + } + + if(page != pageMax) + { + if(cursorY < 0) + { + cursorY = countItemPerPage - 1; + } + else if(cursorY >= countItemPerPage) + { + cursorY = 0; + } + } + else + { + if(cursorY < 0) + { + cursorY = lastPageMaxCursorY - 1; + } + else if(cursorY >= lastPageMaxCursorY) + { + cursorY = 0; + } + } + + yield; + } + +} + + +task TNameEntry(let replayIndex) +{ + let strTextIn = + [ + ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P"], + ["Q","R","S","T","U","V","W","X","Y","Z",".",",",":",";","_","@"], + ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p"], + ["q","r","s","t","u","v","w","x","y","z","+","-","/","*","=","%"], + ["0","1","2","3","4","5","6","7","8","9","0","!","?","'","\"","$"], + ["(",")","{","}","[","]","<",">","&","#","|","~","^"," "," ","終"] + ]; + + let strTextView = + [ + ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P"], + ["Q","R","S","T","U","V","W","X","Y","Z",".",",",":",";","_","@"], + ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p"], + ["q","r","s","t","u","v","w","x","y","z","+","-","/","*","=","%"], + ["0","1","2","3","4","5","6","7","8","9","0","!","?","'","\"","$"], + ["(",")","{","}","&osb;","&csb;","<",">","&","#","|","~","^"," "," ","»"] + ]; + + let cursorX = 0; + let cursorY = 0; + let maxCursorX = length(strTextIn[0]); + let maxCursorY = length(strTextIn); + + task TMenuItem(let itemX, let itemY) + { + let objText = CreateTextObject(341 + GetStgFrameWidth()/5.4 + itemX * 24, 255 + itemY * 24, 22, strTextView[itemY][itemX]); + let objSelect = CreateTextObject(341 + GetStgFrameWidth()/5.4 + itemX * 24, 255 + itemY * 24, 22, strTextView[itemY][itemX]); + ObjRender_SetBlendType(objSelect, BLEND_ADD_ARGB); + + while(menuMode == MENU_NAME_ENTRY) + { + Obj_SetVisible(objSelect, itemX == cursorX && itemY == cursorY); + yield; + } + Obj_Delete(objText); + Obj_Delete(objSelect); + } + + ascent(let iY in 0..maxCursorY) + { + ascent(let iX in 0 .. maxCursorX) + { + TMenuItem(iX, iY); + } + } + + //キー状態がリセットされるまで待機 + while(GetVirtualKeyState(VK_OK) != KEY_FREE){yield;} + + //入力済み文字 + let userName = ""; + let objName = CreateTextObject(341+GetStgFrameWidth()/4, 125, 28, ""); + task TNameCursor() + { + let objCursor = CreateTextObject(341+GetStgFrameWidth()/4, 125, 28, "_"); + while(menuMode == MENU_NAME_ENTRY) + { + let nameLength = length(userName); + ObjRender_SetX(objCursor, 341+GetStgFrameWidth()/4 + nameLength * 17); + Obj_SetVisible(objCursor, nameLength < 8); + yield; + } + Obj_Delete(objCursor); + } + TNameCursor; + + //キー処理 + let frameKeyHold = 0;//キー押しっぱなしフレーム数 + while(menuMode == MENU_NAME_ENTRY) + { + + if(GetVirtualKeyState(VK_OK) == KEY_PULL) + { + //決定 + let nameLength = length(userName); + if(cursorX == maxCursorX-1 && cursorY == maxCursorY-1) + { + //終了キー + if(nameLength == 0) + { + userName = "No Name"; + } + else + { + SaveReplay(replayIndex, userName); + SetScriptResult(RESULT_END); + CloseScript(GetOwnScriptID()); + return; + } + } + else if(nameLength < 8) + { + userName = userName ~ strTextIn[cursorY][cursorX]; + } + } + if(GetVirtualKeyState(VK_CANCEL) == KEY_PULL) + { + //キャンセル + let nameLength = length(userName); + if(nameLength > 0) + { + userName = userName[0..nameLength-1]; + } + else{menuMode = MENU_INDEX_SELECTION; TReplayIndexSelection(); break;} + } + ObjText_SetText(objName, userName); + + //カーソル移動 + if(GetVirtualKeyState(VK_UP) == KEY_PUSH || GetVirtualKeyState(VK_UP) == KEY_HOLD) + { + frameKeyHold++; + if(GetVirtualKeyState(VK_UP) == KEY_PUSH || + frameKeyHold == 20 || + (frameKeyHold > 20 && (frameKeyHold % 10 == 0))) + { + cursorY--; + } + } + else if(GetVirtualKeyState(VK_DOWN) == KEY_PUSH || GetVirtualKeyState(VK_DOWN) == KEY_HOLD) + { + frameKeyHold++; + if(GetVirtualKeyState(VK_DOWN) == KEY_PUSH || + frameKeyHold == 20 || + (frameKeyHold > 20 && (frameKeyHold % 10 == 0))) + { + cursorY++; + } + } + else if(GetVirtualKeyState(VK_LEFT) == KEY_PUSH || GetVirtualKeyState(VK_LEFT) == KEY_HOLD) + { + frameKeyHold++; + if(GetVirtualKeyState(VK_LEFT) == KEY_PUSH || + frameKeyHold == 20 || + (frameKeyHold > 20 && (frameKeyHold % 10 == 0))) + { + cursorX--; + } + } + else if(GetVirtualKeyState(VK_RIGHT) == KEY_PUSH || GetVirtualKeyState(VK_RIGHT) == KEY_HOLD) + { + frameKeyHold++; + if(GetVirtualKeyState(VK_RIGHT) == KEY_PUSH || + frameKeyHold == 20 || + (frameKeyHold > 20 && (frameKeyHold % 10 == 0))) + { + cursorX++; + } + } + else + { + frameKeyHold = 0; + } + + if(cursorX < 0) + { + cursorX = maxCursorX-1; + } + else if(cursorX >= maxCursorX) + { + cursorX = 0; + } + + if(cursorY < 0) + { + cursorY = maxCursorY-1; + } + else if(cursorY >= maxCursorY) + { + cursorY = 0; + } + + yield; + } +} + diff --git a/KevinSystem/kevin_system/Legacy (1280x720)/ValueLib.txt b/KevinSystem/kevin_system/Legacy (1280x720)/ValueLib.txt new file mode 100644 index 0000000..e69de29 diff --git a/KevinSystem/kevin_system/ValueLib.txt b/KevinSystem/kevin_system/ValueLib.txt new file mode 100644 index 0000000..e69de29 diff --git a/KevinSystem/se/e/seGetSpellCardBonus.wav b/KevinSystem/se/e/seGetSpellCardBonus.wav new file mode 100644 index 0000000..dec1071 Binary files /dev/null and b/KevinSystem/se/e/seGetSpellCardBonus.wav differ diff --git a/KevinSystem/se/e/seUseSpellCard.wav b/KevinSystem/se/e/seUseSpellCard.wav new file mode 100644 index 0000000..bab7a69 Binary files /dev/null and b/KevinSystem/se/e/seUseSpellCard.wav differ diff --git a/default_system/Default_Background_IceMountain.txt b/default_system/Default_Background_IceMountain.txt new file mode 100644 index 0000000..96074eb Binary files /dev/null and b/default_system/Default_Background_IceMountain.txt differ diff --git a/default_system/Default_Effect.txt b/default_system/Default_Effect.txt new file mode 100644 index 0000000..ba67736 Binary files /dev/null and b/default_system/Default_Effect.txt differ diff --git a/default_system/Default_EndScene.txt b/default_system/Default_EndScene.txt new file mode 100644 index 0000000..1656d86 Binary files /dev/null and b/default_system/Default_EndScene.txt differ diff --git a/default_system/Default_Pause.txt b/default_system/Default_Pause.txt new file mode 100644 index 0000000..38222f6 Binary files /dev/null and b/default_system/Default_Pause.txt differ diff --git a/default_system/Default_ReplaySaveScene.txt b/default_system/Default_ReplaySaveScene.txt new file mode 100644 index 0000000..73a97ec Binary files /dev/null and b/default_system/Default_ReplaySaveScene.txt differ diff --git a/default_system/Default_ShotConst.txt b/default_system/Default_ShotConst.txt new file mode 100644 index 0000000..00b50a9 Binary files /dev/null and b/default_system/Default_ShotConst.txt differ diff --git a/default_system/Default_ShotData.txt b/default_system/Default_ShotData.txt new file mode 100644 index 0000000..ac117e2 Binary files /dev/null and b/default_system/Default_ShotData.txt differ diff --git a/default_system/Default_System.txt b/default_system/Default_System.txt new file mode 100644 index 0000000..74124d8 Binary files /dev/null and b/default_system/Default_System.txt differ diff --git a/default_system/Default_System_MagicCircle.txt b/default_system/Default_System_MagicCircle.txt new file mode 100644 index 0000000..ceec98d Binary files /dev/null and b/default_system/Default_System_MagicCircle.txt differ diff --git a/default_system/img/Default_Background_IceMountain.bmp b/default_system/img/Default_Background_IceMountain.bmp new file mode 100644 index 0000000..61db0b6 Binary files /dev/null and b/default_system/img/Default_Background_IceMountain.bmp differ diff --git a/default_system/img/Default_Background_IceMountain.mqo b/default_system/img/Default_Background_IceMountain.mqo new file mode 100644 index 0000000..f2388aa --- /dev/null +++ b/default_system/img/Default_Background_IceMountain.mqo @@ -0,0 +1,249 @@ +Metasequoia Document +Format Text Ver 1.0 + +Scene { + pos -30.1096 -34.3943 789.2167 + lookat 0.0000 0.0000 0.0000 + head -1.8300 + pich 0.5300 + ortho 0 + zoom2 2.0091 + amb 0.250 0.250 0.250 +} +Material 1 { + "mat0" shader(3) col(1.000 1.000 1.000 1.000) dif(1.000) amb(0.600) emi(0.000) spc(0.000) power(1.00) tex("Default_Background_IceMountain.bmp") +} +Object "obj0" { + visible 15 + locking 0 + shading 1 + facet 59.5 + color 0.898 0.498 0.698 + color_type 0 + vertex 121 { + 500.0000 0.0000 500.0000 + 400.0000 0.0000 500.0000 + 400.0000 0.0000 400.0000 + 500.0000 0.0000 400.0000 + 300.0000 0.0000 500.0000 + 300.0000 0.0000 400.0000 + 200.0000 0.0000 500.0000 + 200.0000 0.0000 400.0000 + 100.0000 0.0000 500.0000 + 100.0000 0.0000 400.0000 + 0.0000 0.0000 500.0000 + 0.0000 0.0000 400.0000 + -100.0000 0.0000 500.0000 + -100.0000 0.0000 400.0000 + -200.0000 0.0000 500.0000 + -200.0000 0.0000 400.0000 + -300.0000 0.0000 500.0000 + -300.0000 0.0000 400.0000 + -400.0000 0.0000 500.0000 + -400.0000 0.0000 400.0000 + -500.0000 0.0000 500.0000 + -500.0000 0.0000 400.0000 + 400.0000 0.0000 300.0000 + 500.0000 0.0000 300.0000 + 300.0000 0.0000 300.0000 + 181.9993 25.4220 251.4612 + 87.5351 67.6823 172.7408 + 44.9009 66.8717 169.9153 + -84.3673 81.3440 243.9148 + -165.8140 45.4173 301.9575 + -265.8140 45.4173 301.9575 + -400.0000 0.0000 300.0000 + -500.0000 0.0000 300.0000 + 400.0000 0.0000 200.0000 + 500.0000 0.0000 200.0000 + 298.8597 14.8172 185.7207 + 126.2485 97.3682 134.2916 + 23.1660 119.7628 65.2812 + -48.3018 103.9974 84.5904 + -78.9084 75.3832 146.5701 + -165.8140 45.4173 201.9575 + -265.8140 45.4173 201.9575 + -400.0000 0.0000 200.0000 + -500.0000 0.0000 200.0000 + 400.0000 0.0000 100.0000 + 500.0000 0.0000 100.0000 + 255.6389 58.0200 114.1542 + 142.7559 56.0312 43.6297 + 36.2995 41.0596 -5.4791 + -62.4664 75.8076 -4.6157 + -140.5926 75.4124 49.9508 + -231.5631 8.7596 76.5071 + -300.0000 0.0000 100.0000 + -400.0000 0.0000 100.0000 + -500.0000 0.0000 100.0000 + 400.0000 0.0000 0.0000 + 500.0000 0.0000 0.0000 + 221.8938 66.4581 1.9473 + 143.8961 41.2140 -42.0910 + 15.1947 34.4286 -102.5772 + -71.9221 36.4174 -32.0527 + -158.7284 63.2710 -47.6829 + -211.9965 33.8983 -68.7922 + -280.4333 25.1387 -45.2993 + -400.0000 0.0000 0.0000 + -500.0000 0.0000 0.0000 + 400.0000 0.0000 -100.0000 + 500.0000 0.0000 -100.0000 + 300.0000 0.0000 -100.0000 + 200.0000 0.0000 -100.0000 + 28.0779 36.4174 -132.0527 + -71.9221 36.4174 -132.0527 + -109.7092 10.8928 -120.7280 + -174.9080 20.0401 -134.2268 + -274.9080 20.0401 -134.2268 + -400.0000 0.0000 -100.0000 + -500.0000 0.0000 -100.0000 + 400.0000 0.0000 -200.0000 + 500.0000 0.0000 -200.0000 + 258.7267 31.4519 -195.8992 + 154.2999 93.4632 -171.4050 + 83.7472 49.4622 -230.7452 + -16.2528 49.4622 -230.7452 + -139.3118 37.0325 -183.7692 + -214.2198 57.0726 -217.9960 + -274.9080 20.0401 -234.2268 + -400.0000 0.0000 -200.0000 + -500.0000 0.0000 -200.0000 + 400.0000 0.0000 -300.0000 + 500.0000 0.0000 -300.0000 + 287.1706 10.4937 -295.7311 + 187.1706 10.4937 -295.7311 + 125.2088 40.5356 -370.5968 + 25.2089 40.5356 -370.5968 + -139.3118 37.0325 -283.7693 + -239.3118 37.0325 -283.7693 + -300.0000 0.0000 -300.0000 + -400.0000 0.0000 -300.0000 + -500.0000 0.0000 -300.0000 + 400.0000 0.0000 -400.0000 + 500.0000 0.0000 -400.0000 + 300.0000 0.0000 -400.0000 + 200.0000 0.0000 -400.0000 + 100.0000 0.0000 -400.0000 + 0.0000 0.0000 -400.0000 + -100.0000 0.0000 -400.0000 + -200.0000 0.0000 -400.0000 + -300.0000 0.0000 -400.0000 + -400.0000 0.0000 -400.0000 + -500.0000 0.0000 -400.0000 + 400.0000 0.0000 -500.0000 + 500.0000 0.0000 -500.0000 + 300.0000 0.0000 -500.0000 + 200.0000 0.0000 -500.0000 + 100.0000 0.0000 -500.0000 + 0.0000 0.0000 -500.0000 + -100.0000 0.0000 -500.0000 + -200.0000 0.0000 -500.0000 + -300.0000 0.0000 -500.0000 + -400.0000 0.0000 -500.0000 + -500.0000 0.0000 -500.0000 + } + face 100 { + 4 V(0 1 2 3) M(0) UV(0.00000 0.00000 0.10000 0.00000 0.10000 0.10000 0.00000 0.10000) + 4 V(1 4 5 2) M(0) UV(0.10000 0.00000 0.20000 0.00000 0.20000 0.10000 0.10000 0.10000) + 4 V(4 6 7 5) M(0) UV(0.20000 0.00000 0.30000 0.00000 0.30000 0.10000 0.20000 0.10000) + 4 V(6 8 9 7) M(0) UV(0.30000 0.00000 0.40000 0.00000 0.40000 0.10000 0.30000 0.10000) + 4 V(8 10 11 9) M(0) UV(0.40000 0.00000 0.50000 0.00000 0.50000 0.10000 0.40000 0.10000) + 4 V(10 12 13 11) M(0) UV(0.50000 0.00000 0.60000 0.00000 0.60000 0.10000 0.50000 0.10000) + 4 V(12 14 15 13) M(0) UV(0.60000 0.00000 0.70000 0.00000 0.70000 0.10000 0.60000 0.10000) + 4 V(14 16 17 15) M(0) UV(0.70000 0.00000 0.80000 0.00000 0.80000 0.10000 0.70000 0.10000) + 4 V(16 18 19 17) M(0) UV(0.80000 0.00000 0.90000 0.00000 0.90000 0.10000 0.80000 0.10000) + 4 V(18 20 21 19) M(0) UV(0.90000 0.00000 1.00000 0.00000 1.00000 0.10000 0.90000 0.10000) + 4 V(3 2 22 23) M(0) UV(0.00000 0.10000 0.10000 0.10000 0.10000 0.20000 0.00000 0.20000) + 4 V(2 5 24 22) M(0) UV(0.10000 0.10000 0.20000 0.10000 0.20000 0.20000 0.10000 0.20000) + 4 V(5 7 25 24) M(0) UV(0.20000 0.10000 0.30000 0.10000 0.30000 0.20000 0.20000 0.20000) + 4 V(7 9 26 25) M(0) UV(0.30000 0.10000 0.40000 0.10000 0.40000 0.20000 0.30000 0.20000) + 4 V(9 11 27 26) M(0) UV(0.40000 0.10000 0.50000 0.10000 0.50000 0.20000 0.40000 0.20000) + 4 V(11 13 28 27) M(0) UV(0.50000 0.10000 0.60000 0.10000 0.60000 0.20000 0.50000 0.20000) + 4 V(13 15 29 28) M(0) UV(0.60000 0.10000 0.70000 0.10000 0.70000 0.20000 0.60000 0.20000) + 4 V(15 17 30 29) M(0) UV(0.70000 0.10000 0.80000 0.10000 0.80000 0.20000 0.70000 0.20000) + 4 V(17 19 31 30) M(0) UV(0.80000 0.10000 0.90000 0.10000 0.90000 0.20000 0.80000 0.20000) + 4 V(19 21 32 31) M(0) UV(0.90000 0.10000 1.00000 0.10000 1.00000 0.20000 0.90000 0.20000) + 4 V(23 22 33 34) M(0) UV(0.00000 0.20000 0.10000 0.20000 0.10000 0.30000 0.00000 0.30000) + 4 V(22 24 35 33) M(0) UV(0.10000 0.20000 0.20000 0.20000 0.20000 0.30000 0.10000 0.30000) + 4 V(24 25 36 35) M(0) UV(0.20000 0.20000 0.30000 0.20000 0.30000 0.30000 0.20000 0.30000) + 4 V(25 26 37 36) M(0) UV(0.30000 0.20000 0.40000 0.20000 0.40000 0.30000 0.30000 0.30000) + 4 V(26 27 38 37) M(0) UV(0.40000 0.20000 0.50000 0.20000 0.50000 0.30000 0.40000 0.30000) + 4 V(27 28 39 38) M(0) UV(0.50000 0.20000 0.60000 0.20000 0.60000 0.30000 0.50000 0.30000) + 4 V(28 29 40 39) M(0) UV(0.60000 0.20000 0.70000 0.20000 0.70000 0.30000 0.60000 0.30000) + 4 V(29 30 41 40) M(0) UV(0.70000 0.20000 0.80000 0.20000 0.80000 0.30000 0.70000 0.30000) + 4 V(30 31 42 41) M(0) UV(0.80000 0.20000 0.90000 0.20000 0.90000 0.30000 0.80000 0.30000) + 4 V(31 32 43 42) M(0) UV(0.90000 0.20000 1.00000 0.20000 1.00000 0.30000 0.90000 0.30000) + 4 V(34 33 44 45) M(0) UV(0.00000 0.30000 0.10000 0.30000 0.10000 0.40000 0.00000 0.40000) + 4 V(33 35 46 44) M(0) UV(0.10000 0.30000 0.20000 0.30000 0.20000 0.40000 0.10000 0.40000) + 4 V(35 36 47 46) M(0) UV(0.20000 0.30000 0.30000 0.30000 0.30000 0.40000 0.20000 0.40000) + 4 V(36 37 48 47) M(0) UV(0.30000 0.30000 0.40000 0.30000 0.40000 0.40000 0.30000 0.40000) + 4 V(37 38 49 48) M(0) UV(0.40000 0.30000 0.50000 0.30000 0.50000 0.40000 0.40000 0.40000) + 4 V(38 39 50 49) M(0) UV(0.50000 0.30000 0.60000 0.30000 0.60000 0.40000 0.50000 0.40000) + 4 V(39 40 51 50) M(0) UV(0.60000 0.30000 0.70000 0.30000 0.70000 0.40000 0.60000 0.40000) + 4 V(40 41 52 51) M(0) UV(0.70000 0.30000 0.80000 0.30000 0.80000 0.40000 0.70000 0.40000) + 4 V(41 42 53 52) M(0) UV(0.80000 0.30000 0.90000 0.30000 0.90000 0.40000 0.80000 0.40000) + 4 V(42 43 54 53) M(0) UV(0.90000 0.30000 1.00000 0.30000 1.00000 0.40000 0.90000 0.40000) + 4 V(45 44 55 56) M(0) UV(0.00000 0.40000 0.10000 0.40000 0.10000 0.50000 0.00000 0.50000) + 4 V(44 46 57 55) M(0) UV(0.10000 0.40000 0.20000 0.40000 0.20000 0.50000 0.10000 0.50000) + 4 V(46 47 58 57) M(0) UV(0.20000 0.40000 0.30000 0.40000 0.30000 0.50000 0.20000 0.50000) + 4 V(47 48 59 58) M(0) UV(0.30000 0.40000 0.40000 0.40000 0.40000 0.50000 0.30000 0.50000) + 4 V(48 49 60 59) M(0) UV(0.40000 0.40000 0.50000 0.40000 0.50000 0.50000 0.40000 0.50000) + 4 V(49 50 61 60) M(0) UV(0.50000 0.40000 0.60000 0.40000 0.60000 0.50000 0.50000 0.50000) + 4 V(50 51 62 61) M(0) UV(0.60000 0.40000 0.70000 0.40000 0.70000 0.50000 0.60000 0.50000) + 4 V(51 52 63 62) M(0) UV(0.70000 0.40000 0.80000 0.40000 0.80000 0.50000 0.70000 0.50000) + 4 V(52 53 64 63) M(0) UV(0.80000 0.40000 0.90000 0.40000 0.90000 0.50000 0.80000 0.50000) + 4 V(53 54 65 64) M(0) UV(0.90000 0.40000 1.00000 0.40000 1.00000 0.50000 0.90000 0.50000) + 4 V(56 55 66 67) M(0) UV(0.00000 0.50000 0.10000 0.50000 0.10000 0.60000 0.00000 0.60000) + 4 V(55 57 68 66) M(0) UV(0.10000 0.50000 0.20000 0.50000 0.20000 0.60000 0.10000 0.60000) + 4 V(57 58 69 68) M(0) UV(0.20000 0.50000 0.30000 0.50000 0.30000 0.60000 0.20000 0.60000) + 4 V(58 59 70 69) M(0) UV(0.30000 0.50000 0.40000 0.50000 0.40000 0.60000 0.30000 0.60000) + 4 V(59 60 71 70) M(0) UV(0.40000 0.50000 0.50000 0.50000 0.50000 0.60000 0.40000 0.60000) + 4 V(60 61 72 71) M(0) UV(0.50000 0.50000 0.60000 0.50000 0.60000 0.60000 0.50000 0.60000) + 4 V(61 62 73 72) M(0) UV(0.60000 0.50000 0.70000 0.50000 0.70000 0.60000 0.60000 0.60000) + 4 V(62 63 74 73) M(0) UV(0.70000 0.50000 0.80000 0.50000 0.80000 0.60000 0.70000 0.60000) + 4 V(63 64 75 74) M(0) UV(0.80000 0.50000 0.90000 0.50000 0.90000 0.60000 0.80000 0.60000) + 4 V(64 65 76 75) M(0) UV(0.90000 0.50000 1.00000 0.50000 1.00000 0.60000 0.90000 0.60000) + 4 V(67 66 77 78) M(0) UV(0.00000 0.60000 0.10000 0.60000 0.10000 0.70000 0.00000 0.70000) + 4 V(66 68 79 77) M(0) UV(0.10000 0.60000 0.20000 0.60000 0.20000 0.70000 0.10000 0.70000) + 4 V(68 69 80 79) M(0) UV(0.20000 0.60000 0.30000 0.60000 0.30000 0.70000 0.20000 0.70000) + 4 V(69 70 81 80) M(0) UV(0.30000 0.60000 0.40000 0.60000 0.40000 0.70000 0.30000 0.70000) + 4 V(70 71 82 81) M(0) UV(0.40000 0.60000 0.50000 0.60000 0.50000 0.70000 0.40000 0.70000) + 4 V(71 72 83 82) M(0) UV(0.50000 0.60000 0.60000 0.60000 0.60000 0.70000 0.50000 0.70000) + 4 V(72 73 84 83) M(0) UV(0.60000 0.60000 0.70000 0.60000 0.70000 0.70000 0.60000 0.70000) + 4 V(73 74 85 84) M(0) UV(0.70000 0.60000 0.80000 0.60000 0.80000 0.70000 0.70000 0.70000) + 4 V(74 75 86 85) M(0) UV(0.80000 0.60000 0.90000 0.60000 0.90000 0.70000 0.80000 0.70000) + 4 V(75 76 87 86) M(0) UV(0.90000 0.60000 1.00000 0.60000 1.00000 0.70000 0.90000 0.70000) + 4 V(78 77 88 89) M(0) UV(0.00000 0.70000 0.10000 0.70000 0.10000 0.80000 0.00000 0.80000) + 4 V(77 79 90 88) M(0) UV(0.10000 0.70000 0.20000 0.70000 0.20000 0.80000 0.10000 0.80000) + 4 V(79 80 91 90) M(0) UV(0.20000 0.70000 0.30000 0.70000 0.30000 0.80000 0.20000 0.80000) + 4 V(80 81 92 91) M(0) UV(0.30000 0.70000 0.40000 0.70000 0.40000 0.80000 0.30000 0.80000) + 4 V(81 82 93 92) M(0) UV(0.40000 0.70000 0.50000 0.70000 0.50000 0.80000 0.40000 0.80000) + 4 V(82 83 94 93) M(0) UV(0.50000 0.70000 0.60000 0.70000 0.60000 0.80000 0.50000 0.80000) + 4 V(83 84 95 94) M(0) UV(0.60000 0.70000 0.70000 0.70000 0.70000 0.80000 0.60000 0.80000) + 4 V(84 85 96 95) M(0) UV(0.70000 0.70000 0.80000 0.70000 0.80000 0.80000 0.70000 0.80000) + 4 V(85 86 97 96) M(0) UV(0.80000 0.70000 0.90000 0.70000 0.90000 0.80000 0.80000 0.80000) + 4 V(86 87 98 97) M(0) UV(0.90000 0.70000 1.00000 0.70000 1.00000 0.80000 0.90000 0.80000) + 4 V(89 88 99 100) M(0) UV(0.00000 0.80000 0.10000 0.80000 0.10000 0.90000 0.00000 0.90000) + 4 V(88 90 101 99) M(0) UV(0.10000 0.80000 0.20000 0.80000 0.20000 0.90000 0.10000 0.90000) + 4 V(90 91 102 101) M(0) UV(0.20000 0.80000 0.30000 0.80000 0.30000 0.90000 0.20000 0.90000) + 4 V(91 92 103 102) M(0) UV(0.30000 0.80000 0.40000 0.80000 0.40000 0.90000 0.30000 0.90000) + 4 V(92 93 104 103) M(0) UV(0.40000 0.80000 0.50000 0.80000 0.50000 0.90000 0.40000 0.90000) + 4 V(93 94 105 104) M(0) UV(0.50000 0.80000 0.60000 0.80000 0.60000 0.90000 0.50000 0.90000) + 4 V(94 95 106 105) M(0) UV(0.60000 0.80000 0.70000 0.80000 0.70000 0.90000 0.60000 0.90000) + 4 V(95 96 107 106) M(0) UV(0.70000 0.80000 0.80000 0.80000 0.80000 0.90000 0.70000 0.90000) + 4 V(96 97 108 107) M(0) UV(0.80000 0.80000 0.90000 0.80000 0.90000 0.90000 0.80000 0.90000) + 4 V(97 98 109 108) M(0) UV(0.90000 0.80000 1.00000 0.80000 1.00000 0.90000 0.90000 0.90000) + 4 V(100 99 110 111) M(0) UV(0.00000 0.90000 0.10000 0.90000 0.10000 1.00000 0.00000 1.00000) + 4 V(99 101 112 110) M(0) UV(0.10000 0.90000 0.20000 0.90000 0.20000 1.00000 0.10000 1.00000) + 4 V(101 102 113 112) M(0) UV(0.20000 0.90000 0.30000 0.90000 0.30000 1.00000 0.20000 1.00000) + 4 V(102 103 114 113) M(0) UV(0.30000 0.90000 0.40000 0.90000 0.40000 1.00000 0.30000 1.00000) + 4 V(103 104 115 114) M(0) UV(0.40000 0.90000 0.50000 0.90000 0.50000 1.00000 0.40000 1.00000) + 4 V(104 105 116 115) M(0) UV(0.50000 0.90000 0.60000 0.90000 0.60000 1.00000 0.50000 1.00000) + 4 V(105 106 117 116) M(0) UV(0.60000 0.90000 0.70000 0.90000 0.70000 1.00000 0.60000 1.00000) + 4 V(106 107 118 117) M(0) UV(0.70000 0.90000 0.80000 0.90000 0.80000 1.00000 0.70000 1.00000) + 4 V(107 108 119 118) M(0) UV(0.80000 0.90000 0.90000 0.90000 0.90000 1.00000 0.80000 1.00000) + 4 V(108 109 120 119) M(0) UV(0.90000 0.90000 1.00000 0.90000 1.00000 1.00000 0.90000 1.00000) + } +} +Eof diff --git a/default_system/img/Default_Background_IceMountain_Spell01.png b/default_system/img/Default_Background_IceMountain_Spell01.png new file mode 100644 index 0000000..119af7d Binary files /dev/null and b/default_system/img/Default_Background_IceMountain_Spell01.png differ diff --git a/default_system/img/Default_Background_IceMountain_Spell02.png b/default_system/img/Default_Background_IceMountain_Spell02.png new file mode 100644 index 0000000..c5f0a8a Binary files /dev/null and b/default_system/img/Default_Background_IceMountain_Spell02.png differ diff --git a/default_system/img/Default_Effect.png b/default_system/img/Default_Effect.png new file mode 100644 index 0000000..61b968d Binary files /dev/null and b/default_system/img/Default_Effect.png differ diff --git a/default_system/img/Default_MagicCircle.png b/default_system/img/Default_MagicCircle.png new file mode 100644 index 0000000..0e0d6a1 Binary files /dev/null and b/default_system/img/Default_MagicCircle.png differ diff --git a/default_system/img/Default_Shot.png b/default_system/img/Default_Shot.png new file mode 100644 index 0000000..4cacac2 Binary files /dev/null and b/default_system/img/Default_Shot.png differ diff --git a/default_system/img/Default_System.png b/default_system/img/Default_System.png new file mode 100644 index 0000000..99f86c3 Binary files /dev/null and b/default_system/img/Default_System.png differ diff --git a/default_system/img/Default_SystemBackground.png b/default_system/img/Default_SystemBackground.png new file mode 100644 index 0000000..975f560 Binary files /dev/null and b/default_system/img/Default_SystemBackground.png differ diff --git a/default_system/img/Default_SystemDigit.png b/default_system/img/Default_SystemDigit.png new file mode 100644 index 0000000..4bb15dc Binary files /dev/null and b/default_system/img/Default_SystemDigit.png differ diff --git a/default_system/se/seGetSpellCardBonus.wav b/default_system/se/seGetSpellCardBonus.wav new file mode 100644 index 0000000..dec1071 Binary files /dev/null and b/default_system/se/seGetSpellCardBonus.wav differ diff --git a/default_system/se/seUseSpellCard.wav b/default_system/se/seUseSpellCard.wav new file mode 100644 index 0000000..bab7a69 Binary files /dev/null and b/default_system/se/seUseSpellCard.wav differ diff --git a/game/Boss_Plural.dnh b/game/Boss_Plural.dnh new file mode 100644 index 0000000..6d8e359 --- /dev/null +++ b/game/Boss_Plural.dnh @@ -0,0 +1,70 @@ +#TouhouDanmakufu[Plural] +#ScriptVersion[3] +#Title["Boss Plural"] +#Text["..."] +#System["script/KevinSystem/Kevin_System.txt"] +//#Player["script/KevinPackage/KevinScript_Players/PankevKouda/KevKou_Main.dnh", "script/KevinPackage/KevinScript_Players/MariHousui/MariHousui_Main.dnh"] + +let csd = GetCurrentScriptDirectory(); + +let obj = ObjEnemyBossScene_Create(); + +#include "script/KevinSystem/Universal_Lib.txt" +#include "script/game/Stage_Background.dnh" + +@Event{ + +} + +@Initialize{ + + if(!IsCommonDataAreaExists("PIV")){ + CreateCommonDataArea("PIV"); + SetAreaCommonData("PIV", "currentvalue", 10000); + } + else{} + + SetAutoDeleteObject(true); + _ScrollBackground(); + PluralTask(); + +} + +@MainLoop{ + yield; +} + +@Finalize +{ +} + + +/* TO DO: + ++ Single *syncing* - ensure that the boss stays at the same position +*/ +// Task to handle the plural's boss scene + +task PluralTask(){ + // Registering individual singles + + ObjEnemyBossScene_Add(obj, 0, csd ~ "Non1.dnh"); + ObjEnemyBossScene_Add(obj, 0, csd ~ "Spell1.dnh"); + ObjEnemyBossScene_Add(obj, 0, csd ~ "Non2.dnh"); + ObjEnemyBossScene_Add(obj, 0, csd ~ "Spell2.dnh"); + ObjEnemyBossScene_Add(obj, 0, csd ~ "Non3.dnh"); + ObjEnemyBossScene_Add(obj, 0, csd ~ "Spell3.dnh"); + + // Loading and registering the boss scene + ObjEnemyBossScene_LoadInThread(obj); + ObjEnemyBossScene_Regist(obj); + + while(!Obj_IsDeleted(obj)){ + yield; + } + + _ExplosionEffect(GetCommonData("Boss Position X", STG_WIDTH/2), GetCommonData("Boss Position Y", STG_WIDTH/2), PetalEffect); + SetAutoDeleteObject(true); + wait(120); + CloseScript(GetOwnScriptID()); +} \ No newline at end of file diff --git a/game/Non1.dnh b/game/Non1.dnh new file mode 100644 index 0000000..ff394b2 --- /dev/null +++ b/game/Non1.dnh @@ -0,0 +1,266 @@ +#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, 7, 7]; +float[] offsetCurve = [2, 2.8, 4.2]; +int[] denseSpiral = [6, 8, 9]; +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); + + _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, 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 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 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); + +} + + diff --git a/game/Non2.dnh b/game/Non2.dnh new file mode 100644 index 0000000..de8979c --- /dev/null +++ b/game/Non2.dnh @@ -0,0 +1,259 @@ +#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); + +} + + diff --git a/game/Non3.dnh b/game/Non3.dnh new file mode 100644 index 0000000..e6f0b59 --- /dev/null +++ b/game/Non3.dnh @@ -0,0 +1,354 @@ +#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); + + _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 script’s 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 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 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); + +} + + diff --git a/game/Spell1.dnh b/game/Spell1.dnh new file mode 100644 index 0000000..06f2e01 --- /dev/null +++ b/game/Spell1.dnh @@ -0,0 +1,341 @@ +#TouhouDanmakufu[Single] +#ScriptVersion[3] +#Title["Remilia Spell 1 (Remilia Card)"] +#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: + +- Remilia wait time +- Spiral density +- Spiral angle offset per frame + +- Ring density +- Ring (max) speed +- Delays between rings + +*/ + +int[] denseSpiral = [6, 7, 8]; +float[] angleoffsetSpiral = [1.618*7, 1.618*6, 1.618*5]; +float[] speedSpiral = [8, 9.25, 11]; + +int[] denseRing = [10, 12, 14]; +float[] maxspeedRing = [7.5, 8.5, 10]; +int[] deceltimeRing = [20, 25, 32]; +int[] acceltimeRing = [60, 50, 40]; + +// Remilia takes 36 frames. Preferably, pick a number 36 can divide with. + +int[] delayRing = [9, 6, 5]; + +// How much time Remilia takes to charge her attack and you get to GTFO. + +int[] waittimeRemi = [80, 70, 60]; + +string tex = "script/game/resourceLib/Spritesheet_StationJam.png"; +//LoadTextureEx(tex, true, false); + +// Includes ahoy + +#include "script/KevinSystem/Universal_Lib.txt" // The library to include all libraries :sans: :nail_care: + +@Initialize { + + //SetIntersectionVisualization(true); + + SetAutoDeleteObject(true); + LoadTextureEx(tex, true, false); + + _InitDifficulty(difficultySelect); + + //difficultySelect = 2; // 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); + + //WriteLog(spellPIV); + WriteLog(ObjEnemyBossScene_GetInfo(objScene, INFO_SPELL_SCORE)); + + mainTask(); + _FadeInvincibility(bossObj, 150, 150, 1); + endingnew(); +} + +@Event { + + alternative(GetEventType()) + + case(EV_REQUEST_LIFE) { + SetScriptResult(4000); + } + + case(EV_REQUEST_TIMER) { + SetScriptResult(40); + } + +} + +@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 { + +} + +/* + +Remi Spell 1 + +Remi moves to your current position (takes 36 frames), fires a dense star of stars (lol) that fades away quickly, and waits a set number of frames before repeating. After 3 waves of this, she moves to the middle and shoots a thick spiral of fireballs that requires you to spin around the screen for a bit. +She also leaves behind trails of rings with every dash. + +Remilia takes 36 frames to move to you each time. -> delay between rings: 9, 6, 5 + +Parameters: + +- Remilia wait time +- Spiral density +- Spiral speed +- Spiral angle offset per frame + +- Ring density +- Ring speed +- Delays between rings + +*/ + +task mainTask { + + int multiplier = 1; + + ObjMove_SetDestAtFrame(bossObj, STG_WIDTH/2, STG_HEIGHT/2 + , 45, LERP_DECELERATE); + + wait(45); + + _UseCard(); + + while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > 0){ + + loop(3){ + _VampireChase(); + } + FitfulNightmare(multiplier); + wait(90); + multiplier *= -1; + + } + +} + +function _UseCard(){ + + // Remi spell + + int cardImg = _Create2DImage(tex, [0, 256, 256, 512]); + + ObjRender_SetPosition(cardImg, bossX, bossY, 0); + + ascent(i in 0..30){ + ObjRender_SetY(cardImg, Interpolate_Decelerate(bossY, bossY - 256, i/30)); + ObjRender_SetAlpha(cardImg, Interpolate_Decelerate(0, 255, i/30)); + yield; + } + + wait(30); + + ascent(i in 0..15){ + ObjRender_SetAlpha(cardImg, Interpolate_Decelerate(255, 0, i/15)); + yield; + } + + Obj_Delete(cardImg); + +} + +function _VampireChase(){ + + float chaseX = playerX; + float chaseY = playerY; + + ChargeSFX; + + ObjMove_SetDestAtFrame(bossObj, Interpolate_Decelerate(bossX, chaseX, -0.08), Interpolate_Decelerate(bossY, chaseY, -0.08), 30, LERP_DECELERATE); + wait(25); + + ObjMove_SetDestAtFrame(bossObj, Interpolate_Decelerate(bossX, chaseX, 1), Interpolate_Decelerate(bossY, chaseY, 1), 36, LERP_DECELERATE); + + float ang = GetAngleToPlayer(bossObj); + + loop(36/delayRing){ + + ascent(i in 0..denseRing[difficultySelect]){ + int shot = CreateShotA2(bossX, bossY, maxspeedRing[difficultySelect], ang + 360/denseRing[difficultySelect] * i, -maxspeedRing[difficultySelect]/deceltimeRing[difficultySelect], 0, 0, KEV_AURABALL_RED, 10); + if(ObjEnemy_GetInfo(bossObj, INFO_LIFE) <= 0){Obj_Delete(shot);} + else{ + _Delay(shot, 10); + ObjMove_AddPatternA2(shot, 30, NO_CHANGE, NO_CHANGE, maxspeedRing[difficultySelect]/acceltimeRing[difficultySelect], maxspeedRing[difficultySelect], 0); + _BulletRescale(shot, 0.6, true, 1); + Shoot2; + } + } + + ang += 18; + wait(delayRing); + + } + + //wait(36); + + // BOOM + _FireExplosion(bossObj); + + wait(waittimeRemi[difficultySelect]); + +} + +function FitfulNightmare(int spin){ + + ObjMove_SetDestAtFrame(bossObj, STG_WIDTH/2, STG_HEIGHT/3, 60, LERP_DECELERATE); + ChargeSFX; + + wait(75); + + float ang = 0; + + loop(40){ + float ang2 = ang; + + loop(denseSpiral[difficultySelect]){ + + int shot = CreateShotA1(bossX, bossY, speedSpiral[difficultySelect], ang2, KEV_KNIFE_RED, 10); + if(ObjEnemy_GetInfo(bossObj, INFO_LIFE) <= 0){Obj_Delete(shot);} + else{ + _Delay(shot, 10); + _BulletRescale(shot, 1.25, true, 1); + Shoot1; + } + + ang2 += 360/denseSpiral[difficultySelect]*spin; + + } + + ang += angleoffsetSpiral[difficultySelect]; + wait(3); + } + +} + +task _FireExplosion(int target){ + + int objPattern = ObjPatternShot_Create(); + + ObjPatternShot_SetParentObject(objPattern, target); + + if(ObjEnemy_GetInfo(bossObj, INFO_LIFE) == 0){Obj_Delete(objPattern); return;} + + ObjPatternShot_SetPatternType(objPattern, PATTERN_SCATTER_ANGLE); + ObjPatternShot_SetShotType(objPattern, OBJ_SHOT); + ObjPatternShot_SetInitialBlendMode(objPattern, BLEND_ADD_ARGB); + + ObjPatternShot_SetShotCount(objPattern, 24, 6); + ObjPatternShot_SetSpeed(objPattern, 18, 2); + ObjPatternShot_SetAngle(objPattern, 360, 360); + + ObjPatternShot_SetDelay(objPattern, 5); + ObjPatternShot_SetGraphic(objPattern, KEV_LEAF_RED); + + Shoot2; + int[] arrayPattern = ObjPatternShot_FireReturn(objPattern); + + int i = 0; + + for each (int bullet in ref arrayPattern){ + + _BulletRescale(bullet, 1.2, true, 1); + _Delay(bullet, 15); + + Obj_SetRenderPriorityI(bullet, 50); + + _DeletionHandling(bullet, waittimeRemi[difficultySelect]+i); + + //ObjMove_SetAcceleration(bullet, -0.25); + //ObjMove_SetMaxSpeed(bullet, 5); + } + +} + +task _DeletionHandling(int target, int frameDel){ + + float spd = ObjMove_GetSpeed(target); + + ObjMove_SetAcceleration(target, -spd/[30, 34, 38][difficultySelect]); + ObjMove_SetMaxSpeed(target, 0.2); + + wait(frameDel); + ObjShot_FadeDelete(target); + +} + +task endingnew(){ + + while(ObjEnemy_GetInfo(bossObj, INFO_LIFE)>0){ + yield; + } + + _GoToBrazil(objScene, bossObj, 12, 24); + wait(120); + ObjSound_SetVolumeRate(fire2, 20); + + CloseScript(GetOwnScriptID); + +} + + diff --git a/game/Spell2.dnh b/game/Spell2.dnh new file mode 100644 index 0000000..b7454d5 --- /dev/null +++ b/game/Spell2.dnh @@ -0,0 +1,469 @@ +#TouhouDanmakufu[Single] +#ScriptVersion[3] +#Title["Remilia Spell 2 (Patchouli Card)"] +#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: + +- Line density +- Line speed +- Line delay + +- Ring density +- Ring max speed +- Delays between rings +- Remilia charge time + +- Aim speed + +*/ + +int[] denseLine = [3, 4, 5]; +int[] speedLine = [8.5, 10, 12]; +float[] delayLine = [23, 20, 18]; + +int[] denseRing = [10, 12, 14]; +float[] maxspeedRing = [8, 9, 11]; +int[] deceltimeRing = [20, 30, 40]; +int[] acceltimeRing = [60, 45, 35]; + +// Remilia takes 36 frames to charge down the screen. Preferably, pick a number 36 can divide with. + +int[] ringDelay = [12, 9, 6]; + +// How much time Remilia takes to charge her attack and you get to GTFO. + +int[] chargetimeRemi = [75, 60, 50]; +float[] maxspeedBookAim = [10, 12, 15]; + +int[] bookArray = []; // it's a secret tool that will help us later +bool bookShooting = false; // it's a secret tool that will help us later + +string tex = "script/game/resourceLib/Spritesheet_StationJam.png"; + +// Includes ahoy + +#include "script/KevinSystem/Universal_Lib.txt" // The library to include all libraries :sans: :nail_care: + +@Initialize { + + //SetIntersectionVisualization(true); + + SetAutoDeleteObject(true); + LoadTextureEx(tex, true, false); + + _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); + + //WriteLog(spellPIV); + WriteLog(ObjEnemyBossScene_GetInfo(objScene, INFO_SPELL_SCORE)); + + mainTask(); + _FadeInvincibility(bossObj, 150, 150, 1); + endingnew(); +} + +@Event { + + alternative(GetEventType()) + + case(EV_REQUEST_LIFE) { + SetScriptResult(2500); + } + + case(EV_REQUEST_TIMER) { + SetScriptResult(40); + } + + // Start firing from books + case(EV_USER+999){ + bookShooting = true; + } + + // Stop firing from books + case(EV_USER+1000){ + bookShooting = false; + } + +} + +@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 { + +} + +/* + +Spell 2 (Patchouli): + +Remilia summons 5 books (5 elements) (see Philosopher's Stone). These books move to the top of the screen and fire downwards lines that restrict horizontal movement. +Remilia constantly will charge down at the player's horizontal position, leaving behind red rings. The player must weave through the lines of the books. +After 3 charges, the books turn into bats that aim for the player, leaving trails of bullets in their wake. Remilia re-calls 5 books and then the pattern restarts. + +Note: Books = Enemies with no registered intersection + +Parameters: + +- Line density +- Line speed +- Line delay + +- Ring density +- Ring speed +- Delays between rings +- Remilia charge time +- Remilia charge delay + +- Aim speed + +*/ + +task mainTask { + + ObjMove_SetDestAtFrame(bossObj, STG_WIDTH/2, STG_HEIGHT/2 + , 45, LERP_DECELERATE); + wait(45); + + _UseCard(); + // Create 5 books + + CreateBook([0, 0, 256, 256], STG_WIDTH*1/6, 0.65, KEV_LEAF_RED); + CreateBook([256, 0, 512, 256], STG_WIDTH*2/6, 0.65, KEV_LEAF_AQUA); + CreateBook([512, 0, 768, 256], STG_WIDTH*3/6, 0.65, KEV_LEAF_ORANGE); + CreateBook([768, 0, 1024, 256], STG_WIDTH*4/6, 0.65, KEV_LEAF_WHITE); + CreateBook([1024, 0, 1280, 256], STG_WIDTH*5/6, 0.65, KEV_LEAF_GREEN); + + bookShooting = true; + + // It takes 60 seconds for the books to start firing.. + + wait(60+delayLine[difficultySelect]*3); + + // Repeat 3 times: Choose an area based on the player's position, charge down there while firing fireballs + rings, then return to same position. + + while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > 0){ + + if(playerX <= STG_WIDTH/6 && playerY >= 0){ + ChargeAttack(0.5*STG_WIDTH/6, 0); + } + + else if(playerX <= 2*STG_WIDTH/6 && playerY >= STG_WIDTH/6){ + ChargeAttack(1.5*STG_WIDTH/6, 1); + } + + else if(playerX <= 3*STG_WIDTH/6 && playerY >= 2*STG_WIDTH/6){ + ChargeAttack(2.5*STG_WIDTH/6, 2); + } + + else if(playerX <= 4*STG_WIDTH/6 && playerY >= 3*STG_WIDTH/6){ + ChargeAttack(3.5*STG_WIDTH/6, 3); + } + + else if(playerX <= 5*STG_WIDTH/6 && playerY >= 4*STG_WIDTH/6){ + ChargeAttack(4.5*STG_WIDTH/6, 4); + } + + else{ + ChargeAttack(5.5*STG_WIDTH/6, 5); + } + + yield; + + } + + // Aim books at the player. + + // Remove books from bookArray and then restart pattern. + +} + +function _UseCard(){ + + // Remi spell + + int cardImg = _Create2DImage(tex, [256, 256, 512, 512]); + + ObjRender_SetPosition(cardImg, bossX, bossY, 0); + + ascent(i in 0..30){ + ObjRender_SetY(cardImg, Interpolate_Decelerate(bossY, bossY - 256, i/30)); + ObjRender_SetAlpha(cardImg, Interpolate_Decelerate(0, 255, i/30)); + yield; + } + + wait(30); + + ascent(i in 0..15){ + ObjRender_SetAlpha(cardImg, Interpolate_Decelerate(255, 0, i/15)); + yield; + } + + Obj_Delete(cardImg); + +} + +/* +Fire: 0, 0, 256, 256 +Water: 256, 0, 512, 256 +Wood: 512, 0, 768, 256 +Metal: 768, 0, 1024, 256 +Earth: 1024, 0, 1280, 256 +*/ + +function ChargeAttack(float x, int colorselect){ + + ObjMove_SetDestAtFrame(bossObj, x, STG_HEIGHT/7, 30, LERP_DECELERATE); + wait(30); + + _CreateCustomTelegraphLine( + x, 0, + 90, 90, + 3333, 3333, + 0, STG_WIDTH/6, + 0xDC7171, 220, + 15, chargetimeRemi[difficultySelect], 15 + ); + + wait(chargetimeRemi[difficultySelect]-30); + + // MOVEEEEE BITCH + + ObjMove_SetDestAtFrame(bossObj, x, STG_HEIGHT/9, 30, LERP_DECELERATE); + wait(25); + + //ObjEnemy_SetDamageRate(bossObj, 0, 0); + ObjMove_SetDestAtFrame(bossObj, x, STG_HEIGHT*1.2, 36, LERP_DECELERATE); + + float ang = GetAngleToPlayer(bossObj); + + async{ + loop(36){ + loop(2){ + int shot = CreateShotA1(bossX+rand(-STG_HEIGHT/12, STG_HEIGHT/12), bossY, 18, rand(269, 271), KEV_FIRE_RED, 5); + if(ObjEnemy_GetInfo(bossObj, INFO_LIFE) <= 0){Obj_Delete(shot);} + else{ + _Delay(shot, 5); + _BulletRescale(shot, 0.85, true, 1); + Shoot2; + } + } + wait(1); + } + ObjEnemy_SetDamageRate(bossObj, 0, 0); + } + + int color = [KEV_AURABALL_RED, KEV_AURABALL_AQUA, KEV_AURABALL_ORANGE, KEV_AURABALL_WHITE, KEV_AURABALL_GREEN, KEV_AURABALL_PINK][colorselect]; + + loop(36/ringDelay){ + + ascent(i in 0..denseRing[difficultySelect]){ + int shot = CreateShotA2(bossX, bossY, maxspeedRing[difficultySelect], ang + 360/denseRing[difficultySelect] * i, -maxspeedRing[difficultySelect]/deceltimeRing[difficultySelect], 0, 0, color, 10); + if(ObjEnemy_GetInfo(bossObj, INFO_LIFE) <= 0){Obj_Delete(shot);} + else{ + _Delay(shot, 10); + ObjMove_AddPatternA2(shot, 30, NO_CHANGE, NO_CHANGE, maxspeedRing[difficultySelect]/acceltimeRing[difficultySelect], maxspeedRing[difficultySelect], 0); + _BulletRescale(shot, 0.6, true, 1); + //Shoot1; + } + } + wait(ringDelay); + + } + + wait(45); + + ObjMove_SetPosition(bossObj, STG_WIDTH/2, -256); + ObjMove_SetDestAtFrame(bossObj, STG_WIDTH/2, STG_HEIGHT/2, 30, LERP_DECELERATE); + + wait(15); + ObjEnemy_SetDamageRate(bossObj, 100, 100); + + wait(75); + +} + +task CreateBook( + int[] rect, + int destX, + float scaleEnm, int graphicBullet + ){ + + int book = _CreateEnemy( + false, + bossX, bossY, destX, STG_HEIGHT/7.5, 60, + scaleEnm, scaleEnm, + 99999, -1, -1, + tex, + rect[0], rect[1], rect[2], rect[3] + ); + + Obj_SetRenderPriorityI(book, 39); + + ObjEnemy_SetEnableIntersectionPositionFetching(book, false); // so the lock-on shot doesn't home onto the books + bookArray ~= [book]; + + // Fire task + async{ + + wait(60); + + while(!Obj_IsDeleted(book) && bookShooting){ + + loop(denseLine[difficultySelect]){ + int shot = CreateShotA1(ObjMove_GetX(book), ObjMove_GetY(book), speedLine[difficultySelect], 90, graphicBullet, 15); + if(ObjEnemy_GetInfo(bossObj, INFO_LIFE) <= 0){Obj_Delete(shot);} + else{ + _Delay(shot, 10); + _BulletRescale(shot, 0.85, true, 1); + Shoot1; + } + wait([3, 4, 4][difficultySelect]); + } + + wait(delayLine[difficultySelect]); + + } + + + } + + async{ + while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > 0){ + yield; + } + Obj_Delete(book); + + } + + async{ + + wait(60); + + while(bookShooting){ + + ascent(i in 0..24){ + int shot = CreateShotA1(ObjMove_GetX(book), ObjMove_GetY(book), 12, Interpolate_Smoother(190, 350, i/24), graphicBullet+44, 15); + if(ObjEnemy_GetInfo(bossObj, INFO_LIFE) <= 0){Obj_Delete(shot);} + else{ + _Delay(shot, 0); + _BulletRescale(shot, 0.5, true, 1); + } + } + + wait(delayLine[difficultySelect]); + } + } + +} + +function CreateFan (int parent, int way, int graphic, int stack, + float ang, float angspace, float spd1, float spd2, float scale, + int type){ + + int objPattern = ObjPatternShot_Create(); + + ObjPatternShot_SetParentObject(objPattern, parent); + + if(ObjEnemyBossScene_GetInfo(GetEnemyBossSceneObjectID(), INFO_CURRENT_LIFE) == 0){Obj_Delete(objPattern); return;} + + ObjPatternShot_SetPatternType(objPattern, PATTERN_LINE); // 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; + int[] arrayPattern = ObjPatternShot_FireReturn(objPattern); + + for each (int bullet in ref arrayPattern){ + _BulletRescale(bullet, scale, true, 1); + _Delay(bullet, 10); + _EnemyShotFade(bullet, 600, true, 2.5); // Placeholder + Obj_SetRenderPriorityI(bullet, 51); + //if (reflect) {_ReflectToPlayer(bullet);} + } + + async{ + wait(600); + Obj_Delete(objPattern); + return; + } + + return objPattern; + +} + +task endingnew(){ + + while(ObjEnemy_GetInfo(bossObj, INFO_LIFE)>0){ + yield; + } + + _GoToBrazil(objScene, bossObj, 12, 24); + wait(120); + ObjSound_SetVolumeRate(fire2, 20); + + CloseScript(GetOwnScriptID); + +} + + diff --git a/game/Spell3.dnh b/game/Spell3.dnh new file mode 100644 index 0000000..661fd43 --- /dev/null +++ b/game/Spell3.dnh @@ -0,0 +1,389 @@ +#TouhouDanmakufu[Single] +#ScriptVersion[3] +#Title["Remilia Spell 3 (Sakuya Card)"] +#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: + +- Movement speed (in frames) +- Ring density +- Ring speed + +- Density of one knife line +- Speed of knives + +- Number of knife rings +- Density of each knife ring +- Speed of each knife ring +*/ + +int[] frameMove = [9*27, 9*25, 9*23]; // Divisible by 9 +int[] denseRing = [14, 16, 20]; +int[] speedRing = [4, 5, 6]; + +int[] denseKnifeLine = [4, 5, 6]; +float[] speedKnife = [8, 10, 12]; +float[] spaceKnifeFan = [4, 6, 8]; + +int[] ringcountKnife = [3, 5, 7]; +int[] ringdenseKnife = [10, 12, 14]; +float[] ringspeedKnife = [8, 9, 10]; + +// Includes ahoy +string tex = "script/game/resourceLib/Spritesheet_StationJam.png"; +//LoadTextureEx(tex, true, false); + +#include "script/KevinSystem/Universal_Lib.txt" // The library to include all libraries :sans: :nail_care: + +@Initialize { + + //SetIntersectionVisualization(true); + + SetAutoDeleteObject(true); + LoadTextureEx(tex, true, false); + + _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); + + //WriteLog(spellPIV); + WriteLog(ObjEnemyBossScene_GetInfo(objScene, INFO_SPELL_SCORE)); + + mainTask(); + _FadeInvincibility(bossObj, 150, 150, 1); + endingnew(); +} + +@Event { + + alternative(GetEventType()) + + case(EV_REQUEST_LIFE) { + SetScriptResult(5200); + } + + case(EV_REQUEST_TIMER) { + SetScriptResult(40); + } + +} + +@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 { + +} + +/* + +Spell 3 (Sakuya): + +Remilia moves to the horizontal middle and starts slowly moving from top to bottom, firing slow red rings. As she moves, she fires bursts of knives to the sides that reflect off the walls towards the player (one burst per 3 rings). +When she reaches the bottom, she fires a large burst of knives everywhere, following the same reflecting formula. + +Parameters: + +- Movement speed (in frames) +- Ring density +- Ring speed + +- Density of one knife line +- Speed of knives + +- Number of knife rings +- Density of each knife ring +- Speed of each knife ring + +*/ + +task mainTask { + + ObjMove_SetDestAtFrame(bossObj, STG_WIDTH/2, STG_HEIGHT/2 + , 45, LERP_DECELERATE); + wait(45); + + _UseCard(); + + _Warn(); + wait(45); + + while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > 0){ + + MoveToBottom(); + //BurstAttack(); + //wait(360); + wait(frameMove[difficultySelect]*1.75); + } + +} + +function _UseCard(){ + + // Remi spell + + int cardImg = _Create2DImage(tex, [512, 256, 768, 512]); + + ObjRender_SetPosition(cardImg, bossX, bossY, 0); + + ascent(i in 0..30){ + ObjRender_SetY(cardImg, Interpolate_Decelerate(bossY, bossY - 256, i/30)); + ObjRender_SetAlpha(cardImg, Interpolate_Decelerate(0, 255, i/30)); + yield; + } + + wait(30); + + ascent(i in 0..15){ + ObjRender_SetAlpha(cardImg, Interpolate_Decelerate(255, 0, i/15)); + yield; + } + + Obj_Delete(cardImg); + +} + +task _Warn(){ + + int time = 30; + int timeDisappear = 45; + + int pointText = CreateTextObject( + STG_WIDTH/2, 5.5*STG_HEIGHT/6, 120, + "WATCH OUT!", "Exotc350 DmBd BT", + 0xFF6868, 0xFFFFFF, + 0x800E0E, 6, + 51 + ); + ObjText_SetHorizontalAlignment(pointText, ALIGNMENT_CENTER); + + ascent(i in 0..time){ + ObjRender_SetAlpha(pointText, Interpolate_Decelerate(0, 255, i/time)); + ObjRender_SetY(pointText, Interpolate_Decelerate(5.2*STG_HEIGHT/6, 5*STG_HEIGHT/6, i/time)); + yield; + } + + wait(30); + + ascent(i in 0..timeDisappear){ + ObjRender_SetAlpha(pointText, Interpolate_Decelerate(255, 0, i/timeDisappear)); + yield; + } + Obj_Delete(pointText); + +} + +function MoveToBottom(){ + + float x = GetPlayerX(); + + ObjMove_SetDestAtFrame(bossObj, x, STG_HEIGHT/7, 45, LERP_DECELERATE); + wait(60); + + // Anti-cheese + + async{ + loop(60){ + int shot = CreateShotA1(bossX, bossY, 15, rand(180, 360), KEV_BUBBLE_RED, 10); + if(ObjEnemy_GetInfo(bossObj, INFO_LIFE) == 0){Obj_Delete(shot);} + else{ + _Delay(shot, 10); + _BulletRescale(shot, 0.8, true, 1); + Shoot1; + } + yield; + } + } + + // Slow movement + + ObjMove_SetDestAtFrame(bossObj, x, 5.5*STG_HEIGHT/6, frameMove[difficultySelect], LERP_SMOOTHER); + + async{ + loop(9){ + + float ang = GetAngleToPlayer(bossObj); + float[] spawn = [bossX+rand(-30, 30), bossY+rand(-30, 30)]; + + ascent(i in -1..denseRing[difficultySelect]-1){ + int shot = CreateShotA2(spawn[0], spawn[1], speedRing[difficultySelect], ang+(360/denseRing[difficultySelect])*i, -speedRing[difficultySelect]/[30, 35, 40][difficultySelect], 0, KEV_AURABALL_RED, 10); + if(ObjEnemy_GetInfo(bossObj, INFO_LIFE) == 0){Obj_Delete(shot);} + else{ + ObjMove_AddPatternA2(shot, frameMove[difficultySelect]/1.5, NO_CHANGE, NO_CHANGE, speedRing[difficultySelect]/45, speedRing[difficultySelect], 0); + _Delay(shot, 10); + _BulletRescale(shot, 0.6, true, 1); + Shoot1; + } + } + + wait(frameMove[difficultySelect]/9); + } + + // If you're at bottom, you die. (Hyper and above) + + if(difficultySelect >= 0){ + loop([6, 7, 9][difficultySelect]){ + + float ang = GetAngleToPlayer(bossObj); + float[] spawn = [bossX+rand(-25, 25), bossY+rand(-25, 25)]; + + ascent(i in -1..denseRing[difficultySelect]-1){ + int shot = CreateShotA2(spawn[0], spawn[1], speedRing[difficultySelect]*2.5, ang+(360/denseRing[difficultySelect])*i, -speedRing[difficultySelect]*2.5/[30, 40, 45][difficultySelect], speedRing[difficultySelect]*[0.3, 0.2, 0.1][difficultySelect], KEV_KNIFE_LAVENDER, 10); + if(ObjEnemy_GetInfo(bossObj, INFO_LIFE) == 0){Obj_Delete(shot);} + else{ + ObjMove_AddPatternA2(shot, 90, NO_CHANGE, NO_CHANGE, speedRing[difficultySelect]/45, speedRing[difficultySelect]*[1.65, 1.4, 1.25][difficultySelect], 0); + _Delay(shot, 10); + //ObjRender_SetBlendType(shot, BLEND_ADD_ARGB); + _BulletRescale(shot, 1.25, true, 1); + Shoot2; + if(difficultySelect >= 1){_ReflectToPlayer(shot);} + } + } + + wait(frameMove[difficultySelect]/36); + } + } + + } + + async{ + loop(3){ + + CreateFan(3, KEV_KNIFE_LAVENDER, denseKnifeLine[difficultySelect], + 0, spaceKnifeFan[difficultySelect], speedKnife[difficultySelect]/1.18, speedKnife[difficultySelect], 1.25, + PATTERN_FAN, true); + + CreateFan(3, KEV_KNIFE_LAVENDER, denseKnifeLine[difficultySelect], + 180, spaceKnifeFan[difficultySelect], speedKnife[difficultySelect]/1.18, speedKnife[difficultySelect], 1.25, + PATTERN_FAN, true); + + wait(frameMove[difficultySelect]/3); + } + } + +} + +function CreateFan (int way, int graphic, int stack, + float ang, float angspace, float spd1, float spd2, float scale, + int type, bool reflect){ + + int objPattern = ObjPatternShot_Create(); + + ObjPatternShot_SetParentObject(objPattern, bossObj); + + 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; + int[] arrayPattern = ObjPatternShot_FireReturn(objPattern); + + for each (int bullet in ref arrayPattern){ + _BulletRescale(bullet, scale, true, 1); + _Delay(bullet, 10); + _EnemyShotFade(bullet, 600, true, 2.5); // Placeholder + Obj_SetRenderPriorityI(bullet, 51); + if (reflect) {_ReflectToPlayer(bullet);} + } + + async{ + wait(600); + Obj_Delete(objPattern); + return; + } + + return objPattern; + +} + +task _ReflectToPlayer(int target){ + + ObjShot_SetAutoDelete(target, false); + + while(!Obj_IsDeleted(target)){ + if(ObjEnemy_GetInfo(bossObj, INFO_LIFE) == 0){Obj_Delete(target); return;} + if (ObjMove_GetX(target) <= -15 || ObjMove_GetX(target) >= GetStgFrameWidth()+15){ + ObjMove_AddPatternA4(target, 0, NO_CHANGE, 0, NO_CHANGE, NO_CHANGE, 0, KEV_KNIFE_GREEN, GetPlayerObjectID()); + Shoot1; + ObjShot_SetAutoDelete(target, true); + break; + } + yield; + } + +} + +task endingnew(){ + + while(ObjEnemy_GetInfo(bossObj, INFO_LIFE)>0){ + yield; + } + + _GoToBrazil(objScene, bossObj, 12, 24); + wait(120); + ObjSound_SetVolumeRate(fire2, 20); + + CloseScript(GetOwnScriptID); + +} + + diff --git a/game/Spell4.dnh b/game/Spell4.dnh new file mode 100644 index 0000000..0248e32 --- /dev/null +++ b/game/Spell4.dnh @@ -0,0 +1,218 @@ +#TouhouDanmakufu[Single] +#ScriptVersion[3] +#Title["Remilia Spell 4 (Meiling Card)"] +#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 = [3, 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.25, 1.4, 1.75]; +float[] spdAimedBubble = [12, 14, 16]; + +int[] delayAimed = [11, 9, 7]; +float[] accelAimed = [6/60, 8/50, 10/40]; +float[] maxspdAimed = [7, 8, 9]; + +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); + + _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); + + // PLACEHOLDER! + let imgExRumia = GetModuleDirectory() ~ "script/ExRumia/ExRumia.png"; + ObjPrim_SetTexture(bossObj, imgExRumia); + ObjSprite2D_SetSourceRect(bossObj, 64, 1, 127, 64); + ObjSprite2D_SetDestCenter(bossObj); + ObjRender_SetScaleXYZ(bossObj, 2, 2, 1); + ObjRender_SetColor(bossObj, 0xB93C3C); + ObjMove_SetDestAtFrame(bossObj, STG_WIDTH/2, 550, 1); + // PLACEHOLDER! + + /*_SoloCutin( + "script/invalid.png", + 0, 0, 1, 1, + bossObj, objScene, "\"Euphoric Blooming of a New Market\"", + 40, 4, 0x2868B9, 0x1D115D, + 10, STG_HEIGHT*1/10-30, 41 + );*/ + + //WriteLog(spellPIV); + WriteLog(ObjEnemyBossScene_GetInfo(objScene, INFO_SPELL_SCORE)); + + 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 { + +} + +/* + +Red rain bullets start falling from above in an oscillating/sine wave pattern. Remilia herself fires rainbow bullet bursts that are gravity-manipulated (see Chimata’s first or third spell in my Pride Jam script) + +Parameters: + +// Red Rain + +- Number of rain spawners +- Start x +- End x +- Angle offset value for oscillation +- Delay between bullet spawns +- Bullet acceleration +- Bullet maxspeed + +// Rainbow Burst (see Meiling's Colorful Light Chaos Dance) -> how the hell do I do this????? + +- Spiral density +- Number of spiral "arms" +- y speed acceleration +- max y speed + +*/ + +task mainTask { + + while(ObjEnemy_GetInfo(bossObj, INFO_LIFE) > 0){ + + yield; + + } + +} + +task endingnew(){ + + while(ObjEnemy_GetInfo(bossObj, INFO_LIFE)>0){ + yield; + } + + _GoToBrazil(objScene, bossObj, 12, 24); + wait(120); + ObjSound_SetVolumeRate(fire2, 20); + + CloseScript(GetOwnScriptID); + +} + + diff --git a/game/Stage_Background.dnh b/game/Stage_Background.dnh new file mode 100644 index 0000000..903b3a7 --- /dev/null +++ b/game/Stage_Background.dnh @@ -0,0 +1,87 @@ +let bossBG = "script/game/resourceLib/BGFight.png"; +let sound = ObjSound_Create(); +let alphaMax = 255*((GetAreaCommonData("Config", "BGOpacity", 100))/100); +let blipVol = GetAreaCommonData("Config", "SEVol", 100) * 0.01; + +ObjSound_Load(sound, "script/game/resourceLib/dialogueblip.wav"); +ObjSound_SetVolumeRate(sound, 100 * blipVol); +ObjSound_SetSoundDivision(sound, SOUND_SE); + +//LoadSound("script/game/StageLib/dialogueblip.wav"); + +LoadTextureEx(bossBG, true, true); + +function _ScrollBackground(){ + + int BossImg = _Create2DImage(bossBG, [0, 0, 910, 1200]); + ObjRender_SetPosition(BossImg, STG_WIDTH/2, STG_HEIGHT/2-150, 0); + Obj_SetRenderPriorityI(BossImg, 24); + + ascent(i in 0..30){ + ObjRender_SetAlpha(BossImg, Interpolate_Decelerate(0, alphaMax, i/30)); + yield; + } + + Dialogue(); + //ObjRender_SetAlpha(BossImg, 255*((GetAreaCommonData("Config", "BGOpacity", 100))/100)); + +} + +function Dialogue(){ + + int objText = CreateTextObject( + + STG_WIDTH/2, 2*STG_HEIGHT/5+125, 45, + " ", "Origami Mommy", + 0x9F9FFF, 0xDCD6FF, + 0x000000, 3, + 71 + + ); + + ObjText_SetHorizontalAlignment(objText, ALIGNMENT_CENTER); + TTextScroll(objText, "AN AWESOME VAMPIRE/IS CONFLICT WITH US//KEEP YOUR SEXINESS"); + + Obj_Delete(objText); + +} + +// by Mugenri! + +function TTextScroll(int obj_, string text_) { //Makes text fill gradually in text boxes + + bool dialogEnd = false; + bool sentenceEnd = false; + string[] tempStrings = SplitString(text_, "/"); //use / for newlines instead of [r] + string tempString = ""; + char lastChar; + int waitTime; + + async{ + while(!dialogEnd){ + if(sentenceEnd){wait(4); continue;} + else{ObjSound_Play(sound); wait(4);} + } + } + + if (GetVirtualKeyState(VK_OK) == KEY_PUSH) { //Prevents skipping the yield + SetVirtualKeyState(VK_OK, KEY_FREE); + } + + ascent (i in 0..length(tempStrings)) { //list of substrings + ascent (j in 0..length(tempStrings[i])) { //for each character in a substring + tempString ~= [tempStrings[i][j]]; + lastChar = tempString[-1]; + ObjText_SetText(obj_, tempString); + if([tempStrings[i][j]] == "." || + [tempStrings[i][j]] == "," || + [tempStrings[i][j]] == "!" ) {sentenceEnd = true; wait(10);} + else {wait(2); sentenceEnd = false;} + } + tempString ~= ['[','r',']']; //append a newline after each substring + } + + dialogEnd = true; + wait(90); + +} \ No newline at end of file diff --git a/game/replay/Non1_replay01.dat b/game/replay/Non1_replay01.dat new file mode 100644 index 0000000..293c621 Binary files /dev/null and b/game/replay/Non1_replay01.dat differ diff --git a/game/replay/Non1_replay02.dat b/game/replay/Non1_replay02.dat new file mode 100644 index 0000000..551a29f Binary files /dev/null and b/game/replay/Non1_replay02.dat differ diff --git a/game/replay/Non2_replay01.dat b/game/replay/Non2_replay01.dat new file mode 100644 index 0000000..b2478b6 Binary files /dev/null and b/game/replay/Non2_replay01.dat differ diff --git a/game/replay/Non2_replay02.dat b/game/replay/Non2_replay02.dat new file mode 100644 index 0000000..5c9e6f9 Binary files /dev/null and b/game/replay/Non2_replay02.dat differ diff --git a/game/replay/Non3_replay01.dat b/game/replay/Non3_replay01.dat new file mode 100644 index 0000000..e7c6464 Binary files /dev/null and b/game/replay/Non3_replay01.dat differ diff --git a/game/replay/Spell1_replay01.dat b/game/replay/Spell1_replay01.dat new file mode 100644 index 0000000..5e9c15c Binary files /dev/null and b/game/replay/Spell1_replay01.dat differ diff --git a/game/replay/Spell1_replay03.dat b/game/replay/Spell1_replay03.dat new file mode 100644 index 0000000..7d504a3 Binary files /dev/null and b/game/replay/Spell1_replay03.dat differ diff --git a/game/replay/Spell1_replay04.dat b/game/replay/Spell1_replay04.dat new file mode 100644 index 0000000..645b74d Binary files /dev/null and b/game/replay/Spell1_replay04.dat differ diff --git a/game/replay/Spell2_replay01.dat b/game/replay/Spell2_replay01.dat new file mode 100644 index 0000000..82410ba Binary files /dev/null and b/game/replay/Spell2_replay01.dat differ diff --git a/game/replay/Spell3_replay01.dat b/game/replay/Spell3_replay01.dat new file mode 100644 index 0000000..acaf4e7 Binary files /dev/null and b/game/replay/Spell3_replay01.dat differ diff --git a/game/replay/Spell3_replay02.dat b/game/replay/Spell3_replay02.dat new file mode 100644 index 0000000..583ca97 Binary files /dev/null and b/game/replay/Spell3_replay02.dat differ diff --git a/game/resourceLib/BGFight.png b/game/resourceLib/BGFight.png new file mode 100644 index 0000000..0a5233d Binary files /dev/null and b/game/resourceLib/BGFight.png differ diff --git a/game/resourceLib/Spritesheet_StationJam.png b/game/resourceLib/Spritesheet_StationJam.png new file mode 100644 index 0000000..3edb277 Binary files /dev/null and b/game/resourceLib/Spritesheet_StationJam.png differ diff --git a/game/resourceLib/abilitycards-patchouli.png b/game/resourceLib/abilitycards-patchouli.png new file mode 100644 index 0000000..35cf0bb Binary files /dev/null and b/game/resourceLib/abilitycards-patchouli.png differ diff --git a/game/resourceLib/abilitycards-remilia.png b/game/resourceLib/abilitycards-remilia.png new file mode 100644 index 0000000..a4a406d Binary files /dev/null and b/game/resourceLib/abilitycards-remilia.png differ diff --git a/game/resourceLib/abilitycards-sakuya.png b/game/resourceLib/abilitycards-sakuya.png new file mode 100644 index 0000000..4dd32fb Binary files /dev/null and b/game/resourceLib/abilitycards-sakuya.png differ diff --git a/game/resourceLib/bossTheme.ogg b/game/resourceLib/bossTheme.ogg new file mode 100644 index 0000000..85d638b Binary files /dev/null and b/game/resourceLib/bossTheme.ogg differ diff --git a/game/resourceLib/dialogueblip.wav b/game/resourceLib/dialogueblip.wav new file mode 100644 index 0000000..8f78fc7 Binary files /dev/null and b/game/resourceLib/dialogueblip.wav differ diff --git a/game/resourceLib/remiboss.png b/game/resourceLib/remiboss.png new file mode 100644 index 0000000..25e93c5 Binary files /dev/null and b/game/resourceLib/remiboss.png differ diff --git a/game/resourceLib/yassBackground.mdp b/game/resourceLib/yassBackground.mdp new file mode 100644 index 0000000..195defd Binary files /dev/null and b/game/resourceLib/yassBackground.mdp differ diff --git a/player/Chimata/Chimata_Function.dnh b/player/Chimata/Chimata_Function.dnh new file mode 100644 index 0000000..7aeb7b9 --- /dev/null +++ b/player/Chimata/Chimata_Function.dnh @@ -0,0 +1,115 @@ + +task _LaserSpriteRender( + img, int target, float targetAng, + int rectLeft, int rectTop, int rectRight, int rectBottom, + float scaleX, float scaleY, int renderPriority, float alpha, + float scaleSpeed + ){ + + let lasersprite = ObjPrim_Create(OBJ_SPRITE_2D); + + ObjPrim_SetTexture(lasersprite, img); + ObjSprite2D_SetSourceRect(lasersprite, rectLeft, rectTop, rectRight, rectBottom); + ObjRender_SetScaleXYZ(lasersprite, 0, scaleY, 1); + ObjSprite2D_SetDestRect(lasersprite, -(rectRight-rectLeft)/2, 0, (rectRight-rectLeft)/2, rectTop-rectBottom); + Obj_SetRenderPriorityI(lasersprite, renderPriority); + ObjRender_SetAlpha(lasersprite, 0); + ObjRender_SetBlendType(lasersprite, BLEND_ADD_ARGB); + + async{ + loop{ + int[] EnemyList = ObjCol_GetListOfIntersectedEnemyID(target); + if(GetVirtualKeyState(VK_SHOT) != KEY_FREE && GetVirtualKeyState(VK_SLOWMOVE) != KEY_FREE && !ripplayer && IsPermitPlayerShot){ + + // Assumes the intersecting color is right next to the right of the original color + + if (length(EnemyList) > 0) {ObjSprite2D_SetSourceRect(lasersprite, rectRight, rectTop, rectRight+(rectRight-rectLeft), rectBottom);} + else{ObjSprite2D_SetSourceRect(lasersprite, rectLeft, rectTop, rectRight, rectBottom);} + float targetx = ObjRender_GetX(target); + float targety = ObjRender_GetY(target); + ObjRender_SetScaleX(lasersprite, min(scaleX+rand(-0.025, 0.025), ObjRender_GetScaleX(lasersprite) + scaleSpeed)); + ObjRender_SetAlpha(lasersprite, min(alpha, ObjRender_GetAlpha(lasersprite)+alpha/5)); + ObjRender_SetAngleZ(lasersprite, targetAng); + ObjRender_SetPosition(lasersprite, targetx, targety, 1); + yield; + } + else{ + ObjRender_SetScaleX(lasersprite, max(0, ObjRender_GetScaleX(lasersprite) - scaleSpeed)); + ObjRender_SetAlpha(lasersprite, max(0, ObjRender_GetAlpha(lasersprite)-alpha/5)); + yield; + } + yield; + } + } + +} + +function _RenderLaser(target, float ang, float maxintersectX, float maxLength, float width, float speedLength, float dmg){ /* */ + + float angRender = asin(maxintersectX/absolute(maxLength)); + //int laser = CreatePlayerShotA1(ObjRender_GetX(target), ObjRender_GetY(target), 0, ang, dmg, 9999999, 0); + int laser = CreateStraightLaserA1(ObjRender_GetX(target), ObjRender_GetY(target), ang-90, maxLength, width, 9999999, 0, 1); + ObjLaser_SetInvalidLength(laser, 0, 0); + ObjShot_SetDamage(laser, dmg); + ObjShot_SetAutoDelete(laser, false); + Obj_SetRenderPriorityI(laser, 38); + _Follow(laser, target); + + _LaserSpriteRender( + teamimg, laser, ang, + 3072, 0, 3072+256, 256, + 0.45, 20, 38, 240, + 0.14 + ); + + // When shot key is being held, create a line intersection that stretches across the laser. + + /* + Calculations: + + startx: x of target + + starty: y of target + + endx: x of laser + + endy: maxLength + + width = width of laser + */ + async{ + + loop{ + + if(GetVirtualKeyState(VK_SHOT) != KEY_FREE && GetVirtualKeyState(VK_SLOWMOVE) != KEY_FREE && !ripplayer && IsPermitPlayerShot){ + + if(shotspeed % 5 == 0){ObjSound_Play(inferno);} + ObjShot_SetIntersectionEnable(laser, true); + //ObjShot_SetIntersectionLine(laser, ObjRender_GetX(target), ObjRender_GetY(target), ObjRender_GetX(target)+maxintersectX, -maxLength, width); + //WriteLog(ObjMove_GetX(laserfwd)); + yield; + + } + + else{ObjShot_SetIntersectionEnable(laser, false); yield;} + + } + + } + + // After shot key is released, let the laser leave and then delete it. + + return laser; +} + + +task _Follow(follower, followed){ + + while(!Obj_IsDeleted(follower)){ + float x = ObjRender_GetX(followed); + float y = ObjRender_GetY(followed); + ObjMove_SetPosition(follower, x, y); + yield; + } + +} \ No newline at end of file diff --git a/player/Chimata/Chimata_Main.dnh b/player/Chimata/Chimata_Main.dnh new file mode 100644 index 0000000..6edd669 --- /dev/null +++ b/player/Chimata/Chimata_Main.dnh @@ -0,0 +1,736 @@ +#TouhouDanmakufu[Player] +#ScriptVersion[3] +#ID["Chimata"] +#Title["Chimata Tenkyuu"] +#Text["Shot Type: Blank Card Set[r]Spell Card: Shield of Market Regulation"] + +//#Image["./mariremi_lib/mariremi_illust.png"] + +#ReplayName["Chimata"] + +#include "script/KevinSystem/Kevin_PlayerLib.txt" +#include "script/KevinSystem/PlayerSoundLib.dnh" + +#include "./Chimata_Function.dnh" +#include "./Chimata_ShotConst.dnh" + +#include "script/KevinSystem/kevin_system/Kevin_ItemConst.txt" +#include "script/KevinSystem/kevin_system/Kevin_ItemLib.txt" + +let csd = GetCurrentScriptDirectory(); + +// Global Variables + +float maxX = GetStgFrameWidth(); +float maxY = GetStgFrameHeight(); + +// Images & Sound + +let teamimg = csd ~ "./playerlib/Chimata_Sheet.png"; +LoadTextureEx(teamimg, true, true); +//ObjRender_SetTextureFilterMip(teamimg, FILTER_LINEAR); + +let sndpath = csd ~ "./sound"; + +// Other stuff + +float playerX = 0; +float playerY = 0; + +let objPlayer = GetPlayerObjectID(); +int plrender = Obj_GetRenderPriorityI(objPlayer); + +bool ripplayer = false; +float shotspeed = 0; +float bombrand = 0; + +bool bombenable = false; +bool focusactive = false; +bool ishoming = false; + +int[] _enemyArray = []; // Prepare an array to store enemy IDs for Kouda's homing shot +int[] _existArray = []; +int[] _shotArray = []; + +int grazecounter = 0; // For basic graze = PIV mechanic + +float[] PlayerSpd = [10, 5.35]; + +// Custom events for scoring mechanic + +const EV_PIV_100 = EV_USER + 100i; // Normal enemies and nons +const EV_PIV_250 = EV_USER + 101i; // Spells +const EV_PIV_500 = EV_USER + 102i; // Last Spells +const EV_PIV_2000 = EV_USER + 103i; // What. + +@Initialize{ + + if(!IsCommonDataAreaExists("PIV")){ + CreateCommonDataArea("PIV"); + SetAreaCommonData("PIV", "currentvalue", 10000); + } + else{} + + SetPlayerStateEndEnable(true); + + // Stuff + parameterrender(); + playerrender(); + Obj_SetRenderPriorityI(objPlayer, 43); + plrender = Obj_GetRenderPriorityI(objPlayer); + _SoundTask(); + + //SetIntersectionVisualization(true); // Debug + + _Mechanic(ripplayer, _enemyArray, _existArray, GetStgFrameWidth(), GetStgFrameHeight(), objPlayer, GetEnemyBossSceneObjectID(), 5, 2, 80); + + _HitboxRender(ripplayer, objPlayer, teamimg, teamimg, 1280, 512, 1408, 640, 1536, 896, 2048, 1408, 0.3, 0.65); + SetShotAutoDeleteClip(256, 256, 256, 256); + + // Shot functions + + //_CAVELaser(); + _ShotType(); + //UniversalAlphaHandle(_shotArray); + + // Shot data loading + LoadPlayerShotData(csd ~ "./Chimata_ShotData.dnh"); +} + +@MainLoop{ + _enemyArray = GetIntersectionRegistedEnemyID; + shotspeed += 1; // Managing the shot rate + //_shotArray = GetAllShotID(TARGET_PLAYER); + //UniversalAlphaHandle(_shotArray); + playerX = ObjMove_GetX(objPlayer); + playerY = ObjMove_GetY(objPlayer); + yield; +} + +@Event{ + alternative(GetEventType) + + // Delete effect + case(EV_DELETE_SHOT_PLAYER){ + let graphic = GetEventArgument(2); + float[] position = GetEventArgument(1); + let obj = CreatePlayerShotA1(position[0], position[1], 0, ObjMove_GetAngle(GetEventArgument(0)), 0, 99999, graphic); + ObjShot_SetIntersectionEnable(obj, false); _DeleteEffect(obj); + //if(graphic == ELECTRIC_FIRE_ALT) {_DeleteEffectAlt(obj);} + //else{_DeleteEffect(obj);} + } + + // PIV-item spawning events + case(EV_PIV_100){ + let arg = GetEventArgument(0); + CreatePIVItem(PIV_100, arg[0], arg[1]); + } + + case(EV_PIV_250){ + let arg = GetEventArgument(0); + CreatePIVItem(PIV_250, arg[0], arg[1]); + } + + case(EV_PIV_500){ + let arg = GetEventArgument(0); + CreatePIVItem(PIV_500, arg[0], arg[1]); + } + + // Basic functionality events + case(EV_REQUEST_SPELL){ + let bomb = GetPlayerSpell(); + + if (bomb >= 1){ + SetScriptResult(true); + SetPlayerSpell(bomb - 1); + _Bomb(); + _SigilCall(false, teamimg, 768+256, 512, 768+512, 768, objPlayer, GetPlayerInvincibilityFrame()); + } + + else { + SetScriptResult(false); + } + } + + case(EV_HIT){ + ObjSound_Play(predeathsfx); + _DeathbombWarning(teamimg, [1536, 384, 1536+512, 384+512], 15, 0.75); + } + + case(EV_PLAYER_SHOOTDOWN){ + ObjSound_Play(deathsfx); + ripplayer = true; + _SigilCall(true, teamimg, 768, 512, 768+256, 768, objPlayer, 120); + } + + case(EV_PLAYER_REBIRTH){ + ripplayer = false; + SetPlayerInvincibilityFrame(180); + _SigilCall(false, teamimg, 768+256, 512, 768+512, 768, objPlayer, 150); + SetPlayerSpell( max(2,GetPlayerSpell()) ); + } + + case(EV_GRAZE){ + grazecounter += GetEventArgument(0); + ObjSound_Play(grazesfx); + while(grazecounter >= 10){ + SetAreaCommonData("PIV", "currentvalue", GetAreaCommonData("PIV", "currentvalue")+10); + grazecounter -= 10; + } + } +} + +@Finalize{ + +} + +// Homing + +task _HomeShot(int option_) { + + int shot_ = 0; + + float duration = 1; + float durationOption = 99999; + + bool homingBool = false; + + float basepenetrate = ObjShot_GetPenetration(shot_); + float basedmg = ObjShot_GetDamage(shot_); + + // + + for (int t = 0i; t < durationOption && !Obj_IsDeleted(option_); t++) { + + // Checks if enemies are on screen. If enemies are visible, enable homing for the shots. + // _enemyArray is an array containing all enemy IDs, and is constantly updated in @MainLoop. + + if (0 < length(_enemyArray)) { + float targetDist = 2000; // Arbitrary number (???) + int targetID = 0; + + // Checks distance of every enemy on screen. + + for each (int enemy in ref _enemyArray) { + float enemyX = ObjMove_GetX(enemy); + float enemyY = ObjMove_GetY(enemy); + if (0 < enemyX && enemyX < maxX && 0 < enemyY && enemyY < maxY) { + + // Returns the hypotenuse of the triangle formed by the x & y distances between the shot and the enemy. + + float shotDist = hypot(enemyX - ObjMove_GetX(objPlayer), enemyY - ObjMove_GetY(objPlayer)); + + // Locks the shot onto the enemy. + + if (shotDist < targetDist) { + targetDist = shotDist; + targetID = enemy; + homingBool = true; + } + } + } + + // Code to handle the actual homing. + + if (homingBool) { + for (int f = 0; t < durationOption && !Obj_IsDeleted(option_) && !Obj_IsDeleted(targetID) && ObjEnemy_GetInfo(targetID, INFO_LIFE) != 0 && GetVirtualKeyState(VK_SLOWMOVE) != KEY_FREE; t++) { + + ObjShot_SetAutoDelete(option_, false); + + float shotAngle = NormalizeAngle(ObjMove_GetAngle(option_)); // Angle of the player shot + float targetAngle = NormalizeAngle(atan2(ObjMove_GetY(targetID) - ObjMove_GetY(option_), ObjMove_GetX(targetID) - ObjMove_GetX(option_))); // Returns angle from the shot to the enemy. + float angleDistance = AngularDistance(shotAngle, targetAngle); // Angular distance between enemy and player shot + float homeRate = Interpolate_Decelerate(0, 0.75, min(15, f) / 15); + // Homing speed? + ObjMove_SetAngle(option_, Interpolate_Decelerate(shotAngle, shotAngle + angleDistance, homeRate)); // Interpolate_Necko + f++; + yield; + } + } + + /*if (homingBool) { + for (int f = 0; t < duration && !Obj_IsDeleted(shot_) && !Obj_IsDeleted(targetID) && ObjEnemy_GetInfo(targetID, INFO_LIFE) != 0 && !ObjCol_IsIntersected(shot_); t++) { + ObjShot_SetAutoDelete(shot_, false); + + float shotAngle = NormalizeAngle(ObjMove_GetAngle(shot_)); // Angle of the player shot + float targetAngle = NormalizeAngle(atan2(ObjMove_GetY(targetID) - ObjMove_GetY(shot_), ObjMove_GetX(targetID) - ObjMove_GetX(shot_))); // Returns angle from the shot to the enemy. + float angleDistance = AngularDistance(shotAngle, targetAngle); // Angular distance between enemy and player shot + float homeRate = Interpolate_Decelerate(0, 0.75, min(60, f) / 60); + // Homing speed? + ObjMove_SetAngle(shot_, Interpolate_Accelerate(shotAngle, shotAngle + angleDistance, 1)); // Interpolate_Necko + f++; + yield; + } + ObjShot_SetAutoDelete(shot_, true); + ObjMove_SetAngularVelocity(shot_, 0); + homingBool = false; + }*/ + } + + yield; + } +} + +task _SwingBehaviour(target){ + float ang = 0; + Obj_SetRenderPriorityI(target, 42); + while(true){ + ObjRender_SetAngleZ(target, 0+20*sin(ang)); + ang += 360/120; + yield; + } + } + +task _ShotType(){ + + // Offsets for 4 front options + + // Alternative player option function + + function PlayerOption( + float offsetx, float offsety, + texture, + int left, int top, int right, int bottom, float scale, + int width, int animdelay, int frameno, bool triggeranimation, + bool triggerspin, float spinspeed, + bool onlyFocus, bool onlyUnfocus + ){ + // IMPORTANT! + let option = ObjShot_Create(OBJ_SHOT); + ObjShot_Regist(option); + ObjShot_SetAutoDelete(option, false); + ObjShot_SetGraphic(option, 3); + ObjShot_SetPenetration(option, 9999^9999); + ObjShot_SetDamage(option, 0); + ObjShot_SetIntersectionEnable(option, false); + ObjMove_SetAngle(option, 270); + // + + bool visible; + int animate = 0; + float optx; + float opty; + + ObjRender_SetScaleXYZ(option, scale); + ObjRender_SetBlendType(option, BLEND_ALPHA); + ObjRender_SetAlpha(option, 225); + Obj_SetRenderPriorityI(option, 41); + ObjRender_SetPosition(option, offsetx, offsety, 1); + + // Animation + async{ + while(triggeranimation){ + ObjSprite2D_SetSourceRect(option, left+width*floor(animate/animdelay), top, right+width*floor(animate/animdelay)-1, bottom-1); + animate++; + if (animate >= animdelay*frameno){animate = 0;} + yield; + } + } + + // Rotation + async{ + float i = 0; + while(triggerspin){ + //ObjRender_SetPosition(option, GetPlayerX()+offsetx, GetPlayerY()+offsety, 1); + ObjRender_SetAngleZ(option, i); + i += spinspeed; + yield; + } + } + + // Follow + async{ + while(true){ + ObjMove_SetPosition(option, GetPlayerX()+offsetx, GetPlayerY()+offsety); + yield; + } + } + + // Visibility + async{ + // Always visible + if((onlyFocus && onlyUnfocus) || (!onlyFocus && !onlyUnfocus)) { + loop + { + if(GetPlayerState != STATE_NORMAL && GetPlayerState != STATE_HIT){ObjRender_SetAlpha(option, max(0, ObjRender_GetAlpha(option)-15)); visible = false;} + else {ObjRender_SetAlpha(option, min(225, ObjRender_GetAlpha(option)+15)); visible = true;} + yield; + } + } + // Visible when focused only + else if(onlyFocus && !onlyUnfocus){ + loop + { + if((GetPlayerState != STATE_NORMAL && GetPlayerState != STATE_HIT) || GetVirtualKeyState(VK_SLOWMOVE) == KEY_FREE){ObjRender_SetAlpha(option, max(0, ObjRender_GetAlpha(option)-15)); visible = false;} + else {ObjRender_SetAlpha(option, min(225, ObjRender_GetAlpha(option)+15)); visible = true;} + yield; + } + } + // Visible when unfocused only + else if(!onlyFocus && onlyUnfocus){ + loop + { + if((GetPlayerState != STATE_NORMAL && GetPlayerState != STATE_HIT) || GetVirtualKeyState(VK_SLOWMOVE) != KEY_FREE){ObjRender_SetAlpha(option, max(0, ObjRender_GetAlpha(option)-15)); visible = false;} + else {ObjRender_SetAlpha(option, min(225, ObjRender_GetAlpha(option)+15)); visible = true;} + yield; + } + } + } + + function _FadeIn(){ + ascent(i in 0..15){ + ObjRender_SetAlpha(option, Interpolate_Decelerate(0, 225, i/15)); + yield; + } + } + + function _FadeOut(){ + ascent(i in 0..15){ + ObjRender_SetAlpha(option, Interpolate_Decelerate(225, 0, i/15)); + yield; + } + } + + return option; + + } + + float offsetX1 = 125; + float offsetX2 = offsetX1 * 2; + float offsetY1 = 75; + + // Array that contains static/unchanging values for the PlayerOption + + let val = [0, 512, 256, 768, 0.3, 256, 1, 1, false, false, 0, true, true]; + + // Option handling (right -> rightmost -> left -> leftmost) + + float[][] offsetArray = [[offsetX1, offsetY1], [offsetX2, 0], [-offsetX1, offsetY1], [-offsetX2, 0]]; + + int opt1 = PlayerOption( + offsetArray[0][0], offsetArray[0][1], + teamimg, + val[0], val[1], val[2], val[3], val[4], + val[5], val[6], val[7], val[8], + val[9], val[10], + val[11], val[12]); + + int opt2 = PlayerOption( + offsetArray[1][0], offsetArray[1][1], + teamimg, + val[0], val[1], val[2], val[3], val[4], + val[5], val[6], val[7], val[8], + val[9], val[10], + val[11], val[12]); + + int opt3 = PlayerOption( + offsetArray[2][0], offsetArray[2][1], + teamimg, + val[0], val[1], val[2], val[3], val[4], + val[5], val[6], val[7], val[8], + val[9], val[10], + val[11], val[12]); + + int opt4 = PlayerOption( + offsetArray[3][0], offsetArray[3][1], + teamimg, + val[0], val[1], val[2], val[3], val[4], + val[5], val[6], val[7], val[8], + val[9], val[10], + val[11], val[12]); + + int[] optArray = [opt1, opt2, opt3, opt4]; + + _HomingStars(optArray[0], 0); _HomeShot(optArray[0]); + _HomingStars(optArray[1], 1); _HomeShot(optArray[1]); + _HomingStars(optArray[2], 2); _HomeShot(optArray[2]); + _HomingStars(optArray[3], 3); _HomeShot(optArray[3]); + + task _HomingStars(option, value){ + + loop{ + + if(GetVirtualKeyState(VK_SLOWMOVE) != KEY_FREE){ + + async{ + + if(value == 0){ + + ascent(i in 0..15){ + ObjMove_SetX(option, Interpolate_Decelerate(ObjMove_GetX(option), playerX+offsetX1, i/15)); + ObjMove_SetY(option, Interpolate_Decelerate(ObjMove_GetY(option), playerY+offsetY1, i/15)); + yield; + } + + } + + else if(value == 1){ + + ascent(i in 0..15){ + ObjMove_SetX(option, Interpolate_Decelerate(ObjMove_GetX(option), playerX+offsetX1*2, i/15)); + ObjMove_SetY(option, Interpolate_Decelerate(ObjMove_GetY(option), playerY, i/15)); + yield; + } + + } + + else if(value == 2){ + + ascent(i in 0..15){ + ObjMove_SetX(option, Interpolate_Decelerate(ObjMove_GetX(option), playerX-offsetX1, i/15)); + ObjMove_SetY(option, Interpolate_Decelerate(ObjMove_GetY(option), playerY+offsetY1, i/15)); + yield; + } + + } + + else if(value == 3){ + + ascent(i in 0..15){ + ObjMove_SetX(option, Interpolate_Decelerate(ObjMove_GetX(option), playerX-offsetX1*2, i/15)); + ObjMove_SetY(option, Interpolate_Decelerate(ObjMove_GetY(option), playerY, i/15)); + yield; + } + + } + + } + + async{ + if(GetVirtualKeyState(VK_SHOT) != KEY_FREE && IsPermitPlayerShot && !ripplayer){ + + if(shotspeed % 5 == 0){ + float x = ObjRender_GetX(option); + float y = ObjRender_GetY(option); + + ascent(i in -1..1){ + let shotA = CreatePlayerShotA1(-50+x+25-50*i, y, 50, ObjMove_GetAngle(option), 2, 1.1, 2); + _BulletRescalePlayer(shotA, 0.7, true, 1); + ObjRender_SetAlpha(shotA, 255*(universalAlpha/100)); + Obj_SetRenderPriorityI(shotA, 39); + ObjSound_Play(basesfx); + + } + } + } + } + + } + + else{ + + async{ + + if(value == 0){ + + ascent(i in 0..15){ + ObjMove_SetAngle(option, Interpolate_Decelerate(ObjMove_GetAngle(option), 275, i/15)); + ObjMove_SetX(option, Interpolate_Decelerate(ObjMove_GetX(option), playerX+offsetX1*0.45, i/15)); + ObjMove_SetY(option, Interpolate_Decelerate(ObjMove_GetY(option), playerY+offsetY1, i/15)); + yield; + } + + } + + else if(value == 1){ + + ascent(i in 0..15){ + ObjMove_SetAngle(option, Interpolate_Decelerate(ObjMove_GetAngle(option), 295, i/15)); + ObjMove_SetX(option, Interpolate_Decelerate(ObjMove_GetX(option), playerX+offsetX1*0.75, i/15)); + ObjMove_SetY(option, Interpolate_Decelerate(ObjMove_GetY(option), playerY, i/15)); + yield; + } + + } + + else if(value == 2){ + + ascent(i in 0..15){ + ObjMove_SetAngle(option, Interpolate_Decelerate(ObjMove_GetAngle(option), 265, i/15)); + ObjMove_SetX(option, Interpolate_Decelerate(ObjMove_GetX(option), playerX-offsetX1*0.45, i/15)); + ObjMove_SetY(option, Interpolate_Decelerate(ObjMove_GetY(option), playerY+offsetY1, i/15)); + yield; + } + + } + + else if(value == 3){ + + ascent(i in 0..15){ + ObjMove_SetAngle(option, Interpolate_Decelerate(ObjMove_GetAngle(option), 245, i/15)); + ObjMove_SetX(option, Interpolate_Decelerate(ObjMove_GetX(option), playerX-offsetX1*0.75, i/15)); + ObjMove_SetY(option, Interpolate_Decelerate(ObjMove_GetY(option), playerY, i/15)); + yield; + } + + } + + } + + async{ + if(GetVirtualKeyState(VK_SHOT) != KEY_FREE && IsPermitPlayerShot && !ripplayer){ + + if(shotspeed % 5 == 0){ + float x = ObjRender_GetX(option); + float y = ObjRender_GetY(option); + + ascent(i in -1..1){ + let shotA = CreatePlayerShotA1(-50+x+25-50*i, y, 50, ObjMove_GetAngle(option), 2.6, 1.1, 1); + _BulletRescalePlayer(shotA, 0.7, true, 1); + ObjRender_SetAlpha(shotA, 255*(universalAlpha/100)); + Obj_SetRenderPriorityI(shotA, 39); + ObjSound_Play(basesfx); + + } + } + } + } + + } + + + yield; + } + + } + +} + +// Basic player parameters + +task parameterrender(){ + + SetPlayerItemScope(120); + SetPlayerLife(9); // Debug + SetPlayerSpell(2); + SetPlayerSpeed(PlayerSpd[0], PlayerSpd[1]); // (original: 5.25/2.0) + SetPlayerRebirthFrame(12); + SetPlayerAutoItemCollectLine(GetStgFrameHeight/3); + SetPlayerRebirthLossFrame(0); + ObjPlayer_AddIntersectionCircleA1(objPlayer, 0, 0, 1.25, 40); + +} + +// Renders the shottype +// Player sprites + +task playerrender(){ + + // Why is this movement code so cursed jesus fucking christ + + float scale = 0.32; // Scalies + int frame = 0; + + ObjPrim_SetTexture(objPlayer, teamimg); + ObjSprite2D_SetSourceRect(objPlayer, 0, 0, 400, 400); + ObjSprite2D_SetDestCenter(objPlayer); + Obj_SetRenderPriorityI(objPlayer, 42); + ObjRender_SetScaleXYZ(objPlayer, scale, scale, 1); + + // Lower "speed" parameter = FASTER SPEED + + // FOR WHEN ONLY IDLE SPRITES ARE DONE + + loop{ + frame++; + _RenderPlayerMovement(objPlayer, frame, 0, 0, 400, 400, scale, 4, 6); + if (frame >= (5*4-1)){frame = 0;} + yield; + } + +} + +task PointblankPlacebo(target, scale, multiplier){ + int len = 10; + while(GetObjectDistance(target, objPlayer) < 90){ + _BulletRescalePlayer(target, scale*multiplier, true, multiplier); // Pointblank + yield; + } + ascent(i in 0..len){ + _BulletRescalePlayer(target, Interpolate_Decelerate(scale*multiplier, scale, i/len), true, Interpolate_Decelerate(multiplier, 1, i/len)); + yield; + } +} + +task Fadein(target, len){ + ascent(i in 0..len){ + _BulletRescalePlayer(target, Interpolate_Decelerate(0.4, 0.7, i/len), true, Interpolate_Decelerate(0.4, 0.7, i/len)); + //ObjRender_SetBlendType(target, BLEND_ADD_ARGB); + yield; + } + ObjRender_SetBlendType(target, BLEND_ALPHA); +} + +task Fadein(target, len, targetscale, targetscalehitbox){ + ascent(i in 0..len){ + _BulletRescalePlayer(target, Interpolate_Decelerate(0.1, targetscale, i/len), true, Interpolate_Decelerate(1, targetscalehitbox, i/len)); + //ObjRender_SetBlendType(target, BLEND_ADD_ARGB); + yield; + } + ObjRender_SetBlendType(target, BLEND_ALPHA); +} + +// Handling of bomb + +task _Bomb(){ + + // Preparation + SetForbidPlayerShot(true); + SetForbidPlayerSpell(true); + SetPlayerInvincibilityFrame(32*3+32*3+42*3+120+45); + // Spell object + let manageObj = GetSpellManageObject(); // SPELL BEGINS + ObjSpell_Regist(manageObj); + ObjSound_Play(bombsfx); + SetPlayerSpeed(PlayerSpd[0]*1.5, PlayerSpd[0]*1.5); + + int hakkero = CreatePlayerShotA1(playerX, playerY, 0, 0, 12, 999999, 4); + ObjShot_SetIntersectionEnable(hakkero, true); + ObjShot_SetEraseShot(hakkero, true); + ObjShot_SetSpellFactor(hakkero, true); + + async{ + ascent(i in 0..45){ + _BulletRescalePlayer(hakkero, Interpolate_Decelerate(0.1, 1, i/45), true, 1); + ObjRender_SetAlpha(hakkero, Interpolate_Decelerate(0, 255, i/45)); + yield; + } + } + + ascent(i in 0..240){ + ObjMove_SetPosition(hakkero, playerX, playerY); + yield; + } + + // Cleanup, end of spell + ObjShot_FadeDelete(hakkero); + SetPlayerSpeed(PlayerSpd[0], PlayerSpd[1]); + SetForbidPlayerShot(false); + wait(60); + SetForbidPlayerSpell(false); + Obj_Delete(manageObj); // !!! IMPORTANT !!! + +} + +// Screenshake function for bomb's duration - adapted from Sparen's tutorials + +task _BombShake(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; +} + diff --git a/player/Chimata/Chimata_ShotConst.dnh b/player/Chimata/Chimata_ShotConst.dnh new file mode 100644 index 0000000..b3dd32f --- /dev/null +++ b/player/Chimata/Chimata_ShotConst.dnh @@ -0,0 +1,12 @@ +let current = GetCurrentScriptDirectory(); +let path = current ~ "Chimata_ShotData.dnh"; +LoadPlayerShotData(path); +// ----- + +const HOMING_STAR = 1; +const ELECTRIC_FIRE = 2; +const BASE = 3; +const ELECTRIC_FIRE_ALT = 5; +const LOCKON_KNIFE = 6; + + diff --git a/player/Chimata/Chimata_ShotData.dnh b/player/Chimata/Chimata_ShotData.dnh new file mode 100644 index 0000000..79b828e --- /dev/null +++ b/player/Chimata/Chimata_ShotData.dnh @@ -0,0 +1,48 @@ +shot_image = "./playerlib/Chimata_Sheet.png" + +ShotData{ + id = 0 // Dummy + rect = (0,0,0,0) + render = ALPHA + alpha = 0 + collision = 32 +} + +// Money + +ShotData{ + id = 1 + rect = (256, 512, 512, 896) + render = ALPHA + alpha = 255 + collision = (128, 0, 74) // Hitbox of arrows is not centered on the sprite +} + +// Knìfe + +ShotData{ + id = 2 + rect = (512, 512, 768, 896) + render = ALPHA + alpha = 200 + collision = (128, 0, 74) // Hitbox of arrows is not centered on the sprite +} + +ShotData{ + id = 3 + rect = (0, 512, 256, 768) + render = ALPHA + alpha = 255 + collision = (128, 0, 74) // Hitbox of arrows is not centered on the sprite +} + +// Bomb + +ShotData{ + id = 4 + rect = (0, 896, 512, 1408) + render = ADD_ARGB + angular_velocity = 5; + alpha = 255 + collision = 160 +} \ No newline at end of file diff --git a/player/Chimata/desc.txt b/player/Chimata/desc.txt new file mode 100644 index 0000000..e69de29 diff --git a/player/Chimata/playerlib/Chimata_Sheet.png b/player/Chimata/playerlib/Chimata_Sheet.png new file mode 100644 index 0000000..eca20b1 Binary files /dev/null and b/player/Chimata/playerlib/Chimata_Sheet.png differ diff --git a/player/Chimata/sound/CK Music Factory/air01.wav b/player/Chimata/sound/CK Music Factory/air01.wav new file mode 100644 index 0000000..bc2c0ed Binary files /dev/null and b/player/Chimata/sound/CK Music Factory/air01.wav differ diff --git a/player/Chimata/sound/CK Music Factory/air02.wav b/player/Chimata/sound/CK Music Factory/air02.wav new file mode 100644 index 0000000..f7e5ed8 Binary files /dev/null and b/player/Chimata/sound/CK Music Factory/air02.wav differ diff --git a/player/Chimata/sound/CK Music Factory/laser01.wav b/player/Chimata/sound/CK Music Factory/laser01.wav new file mode 100644 index 0000000..b41bae2 Binary files /dev/null and b/player/Chimata/sound/CK Music Factory/laser01.wav differ diff --git a/player/Chimata/sound/CK Music Factory/slash01.wav b/player/Chimata/sound/CK Music Factory/slash01.wav new file mode 100644 index 0000000..364dfca Binary files /dev/null and b/player/Chimata/sound/CK Music Factory/slash01.wav differ diff --git a/player/Chimata/sound/CK Music Factory/wind01.wav b/player/Chimata/sound/CK Music Factory/wind01.wav new file mode 100644 index 0000000..5941d52 Binary files /dev/null and b/player/Chimata/sound/CK Music Factory/wind01.wav differ diff --git a/player/Chimata/sound/TAM Music Factory/se04.wav b/player/Chimata/sound/TAM Music Factory/se04.wav new file mode 100644 index 0000000..ca33890 Binary files /dev/null and b/player/Chimata/sound/TAM Music Factory/se04.wav differ diff --git a/player/Chimata/sound/TAM Music Factory/status4.wav b/player/Chimata/sound/TAM Music Factory/status4.wav new file mode 100644 index 0000000..1227a08 Binary files /dev/null and b/player/Chimata/sound/TAM Music Factory/status4.wav differ diff --git a/player/Chimata/sound/TAM Music Factory/tama2.wav b/player/Chimata/sound/TAM Music Factory/tama2.wav new file mode 100644 index 0000000..d542bbd Binary files /dev/null and b/player/Chimata/sound/TAM Music Factory/tama2.wav differ diff --git a/player/Chimata/sound/bfxr_scythecall.wav b/player/Chimata/sound/bfxr_scythecall.wav new file mode 100644 index 0000000..99b3040 Binary files /dev/null and b/player/Chimata/sound/bfxr_scythecall.wav differ diff --git a/player/Chimata/sound/bfxr_splash.wav b/player/Chimata/sound/bfxr_splash.wav new file mode 100644 index 0000000..6a4d49d Binary files /dev/null and b/player/Chimata/sound/bfxr_splash.wav differ diff --git a/player/Chimata/sound/bfxr_teleporthigh.wav b/player/Chimata/sound/bfxr_teleporthigh.wav new file mode 100644 index 0000000..cc8b9ae --- /dev/null +++ b/player/Chimata/sound/bfxr_teleporthigh.wav @@ -0,0 +1 @@ +2,0.57,,0.3442,,0.2691,0.3,0.2179,,0.3445,,,,,,,,,,,0.2992,,0.5139,,,1,,,,,,,masterVolume \ No newline at end of file diff --git a/player/Chimata/sound/bfxr_teleportlow.wav b/player/Chimata/sound/bfxr_teleportlow.wav new file mode 100644 index 0000000..d55ce4b Binary files /dev/null and b/player/Chimata/sound/bfxr_teleportlow.wav differ diff --git a/player/Chimata/sound/bfxr_watershoot.wav b/player/Chimata/sound/bfxr_watershoot.wav new file mode 100644 index 0000000..6cfced3 Binary files /dev/null and b/player/Chimata/sound/bfxr_watershoot.wav differ diff --git a/player/Chimata/sound/birdcall05.wav b/player/Chimata/sound/birdcall05.wav new file mode 100644 index 0000000..ec6c7b9 Binary files /dev/null and b/player/Chimata/sound/birdcall05.wav differ diff --git a/player/Chimata/sound/hit01.wav b/player/Chimata/sound/hit01.wav new file mode 100644 index 0000000..0698a04 Binary files /dev/null and b/player/Chimata/sound/hit01.wav differ diff --git a/player/Chimata/sound/laser01.wav b/player/Chimata/sound/laser01.wav new file mode 100644 index 0000000..b41bae2 Binary files /dev/null and b/player/Chimata/sound/laser01.wav differ diff --git a/player/Chimata/sound/magic21.wav b/player/Chimata/sound/magic21.wav new file mode 100644 index 0000000..19714fe Binary files /dev/null and b/player/Chimata/sound/magic21.wav differ diff --git a/player/Chimata/sound/slash01.wav b/player/Chimata/sound/slash01.wav new file mode 100644 index 0000000..5941d52 Binary files /dev/null and b/player/Chimata/sound/slash01.wav differ diff --git a/player/Chimata/sound/tama2.wav b/player/Chimata/sound/tama2.wav new file mode 100644 index 0000000..d542bbd Binary files /dev/null and b/player/Chimata/sound/tama2.wav differ diff --git a/sample/Effect01.png b/sample/Effect01.png new file mode 100644 index 0000000..b9496d8 Binary files /dev/null and b/sample/Effect01.png differ diff --git a/sample/Effect02.png b/sample/Effect02.png new file mode 100644 index 0000000..9f20aa7 Binary files /dev/null and b/sample/Effect02.png differ diff --git a/sample/ExRumia.png b/sample/ExRumia.png new file mode 100644 index 0000000..1a065a8 Binary files /dev/null and b/sample/ExRumia.png differ diff --git a/sample/SampleA01.txt b/sample/SampleA01.txt new file mode 100644 index 0000000..7a7ac34 Binary files /dev/null and b/sample/SampleA01.txt differ diff --git a/sample/SampleA02.txt b/sample/SampleA02.txt new file mode 100644 index 0000000..d23d518 Binary files /dev/null and b/sample/SampleA02.txt differ diff --git a/sample/SampleA03.txt b/sample/SampleA03.txt new file mode 100644 index 0000000..9ce822f Binary files /dev/null and b/sample/SampleA03.txt differ diff --git a/sample/SampleB01.txt b/sample/SampleB01.txt new file mode 100644 index 0000000..3e7ee9f --- /dev/null +++ b/sample/SampleB01.txt @@ -0,0 +1,103 @@ +#TouhouDanmakufu[Single] +#ScriptVersion[3] +#Title["SampleB01"] +#Text["SampleB01: ObjPatternShot Demonstrations[r] Powered by Junko"] + +#include "script/default_system/Default_ShotConst.txt" + +let objEnemy; +let frame = 0; + +@Event { + alternative(GetEventType()) + case(EV_REQUEST_LIFE) { + SetScriptResult(500); + } +} + +@Initialize { + objEnemy = ObjEnemy_Create(OBJ_ENEMY_BOSS); + ObjEnemy_Regist(objEnemy); + + let imgExRumia = GetCurrentScriptDirectory ~ "ExRumia.png"; + ObjPrim_SetTexture(objEnemy, imgExRumia); + ObjSprite2D_SetSourceRect(objEnemy, 64, 1, 127, 64); + ObjSprite2D_SetDestCenter(objEnemy); + + let cx = GetStgFrameWidth() / 2; + ObjMove_SetDestAtFrame(objEnemy, cx, 120, 60); + + SetPlayerInvincibilityFrame(600000); + + TShot(); +} + +@MainLoop { + let ex = ObjMove_GetX(objEnemy); + let ey = ObjMove_GetY(objEnemy); + + ObjEnemy_SetIntersectionCircleToShot(objEnemy, ex, ey, 32); + ObjEnemy_SetIntersectionCircleToPlayer(objEnemy, ex, ey, 24); + + yield; + + if (ObjEnemy_GetInfo(objEnemy, INFO_LIFE) <= 0) { + Obj_Delete(objEnemy); + CloseScript(GetOwnScriptID()); + return; + } +} + +task TShot() { + let objPattern1 = ObjPatternShot_Create(); + + ObjPatternShot_SetParentObject(objPattern1, objEnemy); + + ObjPatternShot_SetDelay(objPattern1, 12); + ObjPatternShot_SetGraphic(objPattern1, DS_BALL_S_RED); + + ObjPatternShot_SetSpeed(objPattern1, 2, 1); + ObjPatternShot_SetAngle(objPattern1, 90, 0); + + ObjPatternShot_SetPatternType(objPattern1, PATTERN_RING); + ObjPatternShot_SetShotCount(objPattern1, 22, 1); + + ObjPatternShot_SetShootRadius(objPattern1, 48); + + let objPattern2 = ObjPatternShot_Create(); + ObjPatternShot_CopySettings(objPattern2, objPattern1); + + ObjPatternShot_SetGraphic(objPattern2, DS_BALL_S_PURPLE); + + ObjPatternShot_SetSpeed(objPattern2, 1, 1); + + ObjPatternShot_SetShotCount(objPattern2, 10, 1); + + wait(60); + + let frame = 0; + while (ObjEnemy_GetInfo(objEnemy, INFO_LIFE) > 0) { + if (frame % 30 == 0) { + ObjPatternShot_SetBasePointOffsetCircle(objPattern1, rand(0, 360), 32); + ObjPatternShot_Fire(objPattern1); + } + + if (frame % 40 == 0 && frame > 75) { + for each (iX in [288, 96]) { + ObjPatternShot_SetBasePoint(objPattern2, iX, 144); + ObjPatternShot_SetBasePointOffsetCircle(objPattern2, rand(0, 360), 32); + + ObjPatternShot_SetAngle(objPattern2, rand(0, 360), 0); + + ObjPatternShot_Fire(objPattern2); + } + } + + frame++; + yield; + } + + Obj_Delete(objPattern1); + Obj_Delete(objPattern2); +} + diff --git a/sample/SampleB02.txt b/sample/SampleB02.txt new file mode 100644 index 0000000..45dab5b --- /dev/null +++ b/sample/SampleB02.txt @@ -0,0 +1,81 @@ +#TouhouDanmakufu[Single] +#ScriptVersion[3] +#Title["SampleB02"] +#Text["SampleB02: ObjPatternShot Transforms 1"] + +#include "script/default_system/Default_ShotConst.txt" + +let objEnemy; +let frame = 0; + +@Event { + alternative(GetEventType()) + case(EV_REQUEST_LIFE) { + SetScriptResult(500); + } +} + +@Initialize { + objEnemy = ObjEnemy_Create(OBJ_ENEMY_BOSS); + ObjEnemy_Regist(objEnemy); + + let imgExRumia = GetCurrentScriptDirectory ~ "ExRumia.png"; + ObjPrim_SetTexture(objEnemy, imgExRumia); + ObjSprite2D_SetSourceRect(objEnemy, 64, 1, 127, 64); + ObjSprite2D_SetDestCenter(objEnemy); + + let cx = GetStgFrameWidth() / 2; + ObjMove_SetDestAtFrame(objEnemy, cx, 120, 60); + + TShot(); +} + +@MainLoop { + let ex = ObjMove_GetX(objEnemy); + let ey = ObjMove_GetY(objEnemy); + + ObjEnemy_SetIntersectionCircleToShot(objEnemy, ex, ey, 32); + ObjEnemy_SetIntersectionCircleToPlayer(objEnemy, ex, ey, 24); + + yield; + + if (ObjEnemy_GetInfo(objEnemy, INFO_LIFE) <= 0) { + Obj_Delete(objEnemy); + CloseScript(GetOwnScriptID()); + return; + } +} + +task TShot() { + let objPattern = ObjPatternShot_Create(); + + ObjPatternShot_SetParentObject(objPattern, objEnemy); + ObjPatternShot_SetPatternType(objPattern, PATTERN_ARROW); + + ObjPatternShot_SetDelay(objPattern, 12); + ObjPatternShot_SetGraphic(objPattern, DS_SCALE_BLUE); + + ObjPatternShot_SetSpeed(objPattern, 1.5, 1.2); + + ObjPatternShot_SetShotCount(objPattern, 3, 5); + + ObjPatternShot_AddTransform(objPattern, TRANSFORM_WAIT, 20); + ObjPatternShot_AddTransform(objPattern, TRANSFORM_ADD_SPEED_ANGLE, 900, 0, 0.015, 0); + + ObjPatternShot_SetShootRadius(objPattern, 32); + + wait(60); + + let frame = 0; + while (ObjEnemy_GetInfo(objEnemy, INFO_LIFE) > 0) { + ObjPatternShot_SetAngle(objPattern, rand(0, 360), 6); + + let ang_vel = 6.4 * sin(frame * 8); + ObjPatternShot_SetTransform(objPattern, 2, TRANSFORM_ANGULAR_MOVE, 30, ang_vel, 2); + + ObjPatternShot_Fire(objPattern); + + frame++; + wait(10); + } +} \ No newline at end of file diff --git a/sample/SampleB03.txt b/sample/SampleB03.txt new file mode 100644 index 0000000..2b6356b --- /dev/null +++ b/sample/SampleB03.txt @@ -0,0 +1,86 @@ +#TouhouDanmakufu[Single] +#ScriptVersion[3] +#Title["SampleB03"] +#Text["SampleB03: ObjPatternShot Transforms 2 : Transform Harder"] + +#include "script/default_system/Default_ShotConst.txt" + +let objEnemy; +let frame = 0; + +@Event { + alternative(GetEventType()) + case(EV_REQUEST_LIFE) { + SetScriptResult(500); + } +} + +@Initialize { + objEnemy = ObjEnemy_Create(OBJ_ENEMY_BOSS); + ObjEnemy_Regist(objEnemy); + + let imgExRumia = GetCurrentScriptDirectory ~ "ExRumia.png"; + ObjPrim_SetTexture(objEnemy, imgExRumia); + ObjSprite2D_SetSourceRect(objEnemy, 64, 1, 127, 64); + ObjSprite2D_SetDestCenter(objEnemy); + + let cx = GetStgFrameWidth() / 2; + ObjMove_SetDestAtFrame(objEnemy, cx, 120, 60); + + SetPlayerInvincibilityFrame(600000); + + TShot(); +} + +@MainLoop { + let ex = ObjMove_GetX(objEnemy); + let ey = ObjMove_GetY(objEnemy); + + ObjEnemy_SetIntersectionCircleToShot(objEnemy, ex, ey, 32); + ObjEnemy_SetIntersectionCircleToPlayer(objEnemy, ex, ey, 24); + + yield; + + if (ObjEnemy_GetInfo(objEnemy, INFO_LIFE) <= 0) { + Obj_Delete(objEnemy); + CloseScript(GetOwnScriptID()); + return; + } +} + +task TShot() { + let objPattern = ObjPatternShot_Create(); + + ObjPatternShot_SetParentObject(objPattern, objEnemy); + ObjPatternShot_SetPatternType(objPattern, PATTERN_RING); + + ObjPatternShot_SetDelay(objPattern, 12); + ObjPatternShot_SetGraphic(objPattern, DS_BALL_S_RED); + + ObjPatternShot_SetSpeed(objPattern, 2, 1.2); + + ObjPatternShot_SetShotCount(objPattern, 16, 1); + ObjPatternShot_SetInitialBlendMode(objPattern, BLEND_ADD_ARGB); + + ObjPatternShot_AddTransform(objPattern, TRANSFORM_WAIT, 20); + ObjPatternShot_AddTransform(objPattern, TRANSFORM_N_DECEL_CHANGE, 25, 5, 1, 2.7, 10.12); //Think of Aunn's first spell + ObjPatternShot_AddTransform(objPattern, TRANSFORM_ADDPATTERN_A1, 0, 0, NO_CHANGE); + ObjPatternShot_AddTransform(objPattern, TRANSFORM_WAIT, 60); + ObjPatternShot_AddTransform(objPattern, TRANSFORM_BLEND_CHANGE, BLEND_ALPHA); + ObjPatternShot_AddTransform(objPattern, TRANSFORM_GRAPHIC_CHANGE, DS_RICE_S_RED); + ObjPatternShot_AddTransform(objPattern, TRANSFORM_TO_SPEED_ANGLE, 60, 1.8, NO_CHANGE); + + wait(60); + + let frame = 0; + while (ObjEnemy_GetInfo(objEnemy, INFO_LIFE) > 0) { + ObjPatternShot_SetAngle(objPattern, rand(0, 360), 0); + + ObjPatternShot_SetTransform(objPattern, 1, TRANSFORM_N_DECEL_CHANGE, 25, 5, 1, 2.7, 14 * sin(frame * 6)); + + ObjPatternShot_Fire(objPattern); + + frame++; + wait(4); + } +} \ No newline at end of file diff --git a/sample/SampleB04.txt b/sample/SampleB04.txt new file mode 100644 index 0000000..0a31b6d --- /dev/null +++ b/sample/SampleB04.txt @@ -0,0 +1,87 @@ +#TouhouDanmakufu[Single] +#ScriptVersion[3] +#Title["SampleB04"] +#Text["SampleB04: ObjPatternShot Transforms 3 : 14 Werewolves[r]Transformation"] + +#include "script/default_system/Default_ShotConst.txt" + +let objEnemy; +let frame = 0; + +@Event { + alternative(GetEventType()) + case(EV_REQUEST_LIFE) { + SetScriptResult(2500); + } +} + +@Initialize { + objEnemy = ObjEnemy_Create(OBJ_ENEMY_BOSS); + ObjEnemy_Regist(objEnemy); + + let imgExRumia = GetCurrentScriptDirectory ~ "ExRumia.png"; + ObjPrim_SetTexture(objEnemy, imgExRumia); + ObjSprite2D_SetSourceRect(objEnemy, 64, 1, 127, 64); + ObjSprite2D_SetDestCenter(objEnemy); + + SetPlayerInvincibilityFrame(6000000); + ObjMove_SetDestAtFrame(objEnemy, 192, 224, 60); + + TShot(); +} + +@MainLoop { + let ex = ObjMove_GetX(objEnemy); + let ey = ObjMove_GetY(objEnemy); + + ObjEnemy_SetIntersectionCircleToShot(objEnemy, ex, ey, 32); + ObjEnemy_SetIntersectionCircleToPlayer(objEnemy, ex, ey, 24); + + yield; + + if (ObjEnemy_GetInfo(objEnemy, INFO_LIFE) <= 0) { + Obj_Delete(objEnemy); + CloseScript(GetOwnScriptID()); + return; + } +} + +task TShot() { + wait(90); + while (ObjEnemy_GetInfo(objEnemy, INFO_LIFE) > 0) { + _TShot(1, DS_RICE_M_PURPLE); + wait(330); + _TShot(-1, DS_RICE_M_RED); + wait(330); + } +} + +task _TShot(dir, graphic) { + if (ObjEnemy_GetInfo(objEnemy, INFO_LIFE) <= 0) { return; } + + let objPattern = ObjPatternShot_Create(); + + ObjPatternShot_SetParentObject(objPattern, objEnemy); + ObjPatternShot_SetPatternType(objPattern, PATTERN_RING); + ObjPatternShot_SetShotType(objPattern, OBJ_CURVE_LASER); + + ObjPatternShot_SetDelay(objPattern, 0); + ObjPatternShot_SetGraphic(objPattern, graphic); + + ObjPatternShot_SetAngle(objPattern, rand(0, 360), 0); + ObjPatternShot_SetSpeed(objPattern, 6, 6); + + ObjPatternShot_SetShotCount(objPattern, 28, 1); + ObjPatternShot_SetLaserParameter(objPattern, 8, 128); + + ObjPatternShot_AddTransform(objPattern, TRANSFORM_ADD_SPEED_ANGLE, 30, 0, 0, -8 * dir); + ObjPatternShot_AddTransform(objPattern, TRANSFORM_ADD_SPEED_ANGLE, 30, 30, 0, 8 * dir); + ObjPatternShot_AddTransform(objPattern, TRANSFORM_ADD_SPEED_ANGLE, 30, 60, -0.12, -4 * dir); + ObjPatternShot_AddTransform(objPattern, TRANSFORM_ADD_SPEED_ANGLE, 30, 90, 0, 4 * dir); + ObjPatternShot_AddTransform(objPattern, TRANSFORM_ADD_SPEED_ANGLE, 30, 120, 0, -8 * dir); + ObjPatternShot_AddTransform(objPattern, TRANSFORM_ADD_SPEED_ANGLE, 45, 150, 0, 7 * dir); + + ObjPatternShot_Fire(objPattern); + + Obj_Delete(objPattern); +} diff --git a/sample/SampleE01.txt b/sample/SampleE01.txt new file mode 100644 index 0000000..57c8e14 Binary files /dev/null and b/sample/SampleE01.txt differ diff --git a/sample/SampleE02.txt b/sample/SampleE02.txt new file mode 100644 index 0000000..f46ac86 Binary files /dev/null and b/sample/SampleE02.txt differ diff --git a/sample/SamplePS01.txt b/sample/SamplePS01.txt new file mode 100644 index 0000000..6f01cb3 --- /dev/null +++ b/sample/SamplePS01.txt @@ -0,0 +1,40 @@ +#東方弾幕風[Stage] +#ScriptVersion[3] +#Title["SamplePS01"] +#Text["SamplePS01:ピクセルシェーダ:モノトーン"] +#Background["script/default_system/Default_Background_IceMountain.txt"] + +@Initialize +{ + TSamplePS1(); +} + +@MainLoop +{ + yield; +} + +task TSamplePS1 +{ + //パス設定 + let dir = GetCurrentScriptDirectory(); + let pathShader = dir ~ "SamplePS01_HLSL.txt"; + + //シェーダ生成 + let objShader = ObjShader_Create(); + ObjShader_SetShaderF(objShader, pathShader); + ObjShader_SetTechnique(objShader, "TecMonotone"); + + loop + { + //特定の描画優先度にシェーダを適応 + SetShaderI(objShader, 0, 100); + loop(180){yield;} + + //シェーダ解除 + ResetShaderI(0, 100); + loop(180){yield;} + } + +} + diff --git a/sample/SamplePS01_HLSL.txt b/sample/SamplePS01_HLSL.txt new file mode 100644 index 0000000..afb8140 --- /dev/null +++ b/sample/SamplePS01_HLSL.txt @@ -0,0 +1,59 @@ +//================================================================ +//ݒl +//Texture +sampler sampler0_ : register(s0); + +//================================================================ +//-------------------------------- +//sNZVF[_͒l +struct PS_INPUT +{ + float4 diffuse : COLOR0; //fBt[YF + float2 texCoord : TEXCOORD0; //eNX`W + float2 vPos : VPOS; //`W +}; + +//-------------------------------- +//sNZVF[_o͒l +struct PS_OUTPUT +{ + float4 color : COLOR0; //o͐F +}; + + +//================================================================ +// VF[_ +//-------------------------------- +//sNZVF[_ +PS_OUTPUT PsMonotone( PS_INPUT In ) : COLOR0 +{ + PS_OUTPUT Out; + + //eNX`̐F + float4 colorTexture = tex2D(sampler0_, In.texCoord); + + //_fBt[YF + float4 colorDiffuse = In.diffuse; + + // + float4 color = colorTexture * colorDiffuse; + + //mg[̌vZ + Out.color.rgb = ( color.r + color.g + color.b ) * 0.3333f; + Out.color.a = color.a; + + return Out; +} + + +//================================================================ +//-------------------------------- +//technique +technique TecMonotone +{ + pass P0 + { + PixelShader = compile ps_3_0 PsMonotone(); + } +} + diff --git a/sample/SamplePS02.txt b/sample/SamplePS02.txt new file mode 100644 index 0000000..fef61a5 --- /dev/null +++ b/sample/SamplePS02.txt @@ -0,0 +1,36 @@ +#東方弾幕風[Stage] +#ScriptVersion[3] +#Title["SamplePS02"] +#Text["SamplePS02:ピクセルシェーダ:マスク"] +#Background["script/default_system/Default_Background_IceMountain.txt"] + +@Initialize +{ + TSamplePS2(); +} + +@MainLoop +{ + yield; +} + +task TSamplePS2 +{ + //パス設定 + let dir = GetCurrentScriptDirectory(); + let pathShader = dir ~ "SamplePS02_HLSL.txt"; + + //シェーダ生成 + let objShader = ObjShader_Create(); + ObjShader_SetShaderF(objShader, pathShader); + ObjShader_SetTechnique(objShader, "TecMask"); + + //シェーダにマスク画像を設定 + let pathMask = dir ~ "SamplePS02_Mask.png"; + ObjShader_SetTexture(objShader, "textureMask_", pathMask); + + //特定の描画優先度にシェーダを適応 + SetShaderI(objShader, 30, 100); + +} + diff --git a/sample/SamplePS02_HLSL.txt b/sample/SamplePS02_HLSL.txt new file mode 100644 index 0000000..694a5f6 --- /dev/null +++ b/sample/SamplePS02_HLSL.txt @@ -0,0 +1,85 @@ +//================================================================ +//ݒl +//Texture +sampler sampler0_ : register(s0); + +//-------------------------------- +//}XNpeNX` +//ʕ(}XNeNX`TCY) +const float SCREEN_WIDTH = 640; +const float SCREEN_HEIGHT = 480; +texture textureMask_; +sampler samplerMask_ = sampler_state +{ + Texture = ; +}; + + +//================================================================ +//-------------------------------- +//sNZVF[_͒l +struct PS_INPUT +{ + float4 diffuse : COLOR0; //fBt[YF + float2 texCoord : TEXCOORD0; //eNX`W + float2 vPos : VPOS; //`W +}; + +//-------------------------------- +//sNZVF[_o͒l +struct PS_OUTPUT +{ + float4 color : COLOR0; //o͐F +}; + + +//================================================================ +// VF[_ +//-------------------------------- +//sNZVF[_ +PS_OUTPUT PsMask( PS_INPUT In ) : COLOR0 +{ + PS_OUTPUT Out; + + //eNX`̐F + float4 colorTexture = tex2D(sampler0_, In.texCoord); + + //_fBt[YF + float4 colorDiffuse = In.diffuse; + + // + float4 color = colorTexture * colorDiffuse; + Out.color = color; + if(color.a > 0) + { + //-------------------------------- + //}XNp̃eNX`F擾 + //UVł̈ʒu͉摜t@C̉ƍ̊ + //Ⴆ΁A640x480̉摜̈ʒu(320,240)UVł0.5,0.5ɂȂB + float2 maskUV; + + //`悩}XNpeNX`̈ʒuvZ + maskUV.x = In.vPos.x / SCREEN_WIDTH; + maskUV.y = In.vPos.y / SCREEN_HEIGHT; + float4 colorMask = tex2D(samplerMask_, maskUV); + + //}XNRGBlo͌ʂ̃lƂč + Out.color.a = ( colorMask.r + colorMask.g + colorMask.b ) * 0.3333f * color.a; + } + + + return Out; +} + + +//================================================================ +//-------------------------------- +//technique +technique TecMask +{ + pass P0 + { + PixelShader = compile ps_3_0 PsMask(); + } +} + diff --git a/sample/SamplePS02_Mask.png b/sample/SamplePS02_Mask.png new file mode 100644 index 0000000..90b87aa Binary files /dev/null and b/sample/SamplePS02_Mask.png differ diff --git a/sample/SamplePS03.txt b/sample/SamplePS03.txt new file mode 100644 index 0000000..cad4ec1 --- /dev/null +++ b/sample/SamplePS03.txt @@ -0,0 +1,193 @@ +#東方弾幕風[Single] +#ScriptVersion[3] +#Title["SamplePS03"] +#Text["SamplePS03:ピクセルシェーダ:ボス周囲のゆらぎエフェクト"] +#Background["script/default_system/Default_Background_IceMountain.txt"] + + +//デフォルト弾画像をロード +#include"script/default_system/Default_ShotConst.txt" + +//---------------------------------------------------- +//グローバル変数宣言 +//この位置で宣言した変数はスクリプト全体で有効です。 +//ただしこの箇所での変数への代入は、定数以外の代入は行えません。 +//(実行順序が保障されないため乱数などの使用はできません) +//---------------------------------------------------- +let objEnemy; //敵オブジェクト +let objPlayer; //自機オブジェクト +let frame = 0; //敵動作に使用するカウンタ(@MainLoopで1づつ増加させます) + +//---------------------------------------------------- +//敵の動作 +//---------------------------------------------------- +@Event +{ + alternative(GetEventType()) + case(EV_REQUEST_LIFE) + { + //敵ライフを要求された + SetScriptResult(500);//ライフを500に設定 + } +} + +@Initialize +{ + //自機オブジェクト取得 + objPlayer = GetPlayerObjectID(); + + //敵オブジェクトを生成し登録 + objEnemy = ObjEnemy_Create(OBJ_ENEMY_BOSS); + ObjEnemy_Regist(objEnemy); + + //敵画像の設定 + let imgExRumia = GetCurrentScriptDirectory ~ "ExRumia.png"; //敵画像ファイル + ObjPrim_SetTexture(objEnemy, imgExRumia); //画像ファイルを読み込む + ObjSprite2D_SetSourceRect(objEnemy, 64, 1, 127, 64); //描画元矩形を(64,1) - (127,64)に設定 + ObjSprite2D_SetDestCenter(objEnemy); //描画先を中心(0, 0)に設定 + + //座標(cx, 120)へ60フレームかけて移動する + let cx = GetStgFrameWidth() / 2;//STGシーンの中心x座標を取得 + ObjMove_SetDestAtFrame(objEnemy, cx, 120, 60); + + //let objScene = GetEnemyBossSceneObjectID(); + //ObjEnemyBossScene_StartSpell(objScene); + + TWaveCircle(); +} + +@MainLoop +{ + //敵の座標を取得 + let ex = ObjMove_GetX(objEnemy); + let ey = ObjMove_GetY(objEnemy); + + if(frame == 90) + { + let px = GetPlayerX(); + ObjMove_SetDestAtFrame(objEnemy, rand(192-100, 192+100), rand(50, 200), 60); + } + + if(frame == 180) + { + //frameが180になったら実行される部分 + //自機の座標を取得 + let px = GetPlayerX(); + let py = GetPlayerY(); + + //敵からみた自機方向の角度を求める。 + let angleToPlayer = atan2(py - ey, px - ex); + + //angleを-30から15ずつ増加させ5WAYにする + let angle=0; + while(angle<360) + {//(angle:15°間隔で0~360まで) + //一定時間で自機方向へ角度を変える弾 + //弾を作成する。 + let obj = CreateShotA2(ex, ey, 5, angle, -0.10, 1, DS_RICE_S_BLUE, 30); + //発射後60フレーム目に、自機方向を基準に角度変更するように設定 + ObjMove_AddPatternA4(obj, 60, 3, 0, 0, 0, 3, objPlayer, NO_CHANGE); + angle += 15; + } + + frame = 0;//弾を出したらframeを0にする + } + + //当たり判定登録 + ObjEnemy_SetIntersectionCircleToShot(objEnemy, ex, ey, 32);//当たり判定(自機弾用)登録 + ObjEnemy_SetIntersectionCircleToPlayer(objEnemy, ex, ey, 24);//当たり判定(体当たり用)登録 + + //カウンタに1追加 + frame++; + + //ライフ0処理 + if(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) <= 0) + { + //ライフが0になったら即座に終了 + //本来は爆発エフェクトのタスクを登録し、 + //エフェクト終了を待って、スクリプトを終了します。 + yield; + Obj_Delete(objEnemy); + CloseScript(GetOwnScriptID()); + return; + } + + yield; +} + + +//---------------------------------------------------- +//ボス周囲のゆらぎエフェクト +//---------------------------------------------------- +task TWaveCircle() +{ + //レンダリングターゲットに使用するテクスチャ + let renderTexture = GetReservedRenderTargetName(0); + + let frame = 0; //フレーム + let baseEffectRadius = 128; //基準エフェクト半径 + let outerFluct = 16; //エフェクト半径の最大変化量 + let effectRadius = 0; //エフェクト半径 + + + let priEffectMin = 20; //エフェクトをかける最小優先度 + let priEffectMax = 28; //エフェクトをかける最大優先度 + + //背景のみエフェクトの対象とする + //エフェクトの描画でまかなえるため、 + //優先度20~28の通常描画を無効にする。 + SetInvalidRenderPriorityA1(priEffectMin, priEffectMax); + + let frameWidth = GetStgFrameWidth(); + let frameHeight = GetStgFrameHeight(); + let frameLeft = GetStgFrameLeft(); + let frameRight = frameLeft + frameWidth; + let frameTop = GetStgFrameTop(); + let frameBottom = frameTop + frameHeight; + + + //-------------------------------- + //ゆがみオブジェクト + let objWave = ObjPrim_Create(OBJ_SPRITE_2D); //2Dスプライトオブジェクト生成 + Obj_SetRenderPriorityI(objWave, 25); //描画優先度を設定 + ObjPrim_SetTexture(objWave, renderTexture); //テクスチャを設定 + ObjSprite2D_SetSourceRect(objWave, frameLeft, frameTop, frameRight, frameBottom); + ObjSprite2D_SetDestRect(objWave, 0, 0, frameWidth, frameHeight); + Obj_SetRenderPriorityI(objWave, priEffectMax + 1); + + //ゆがみオブジェクトにシェーダを設定 + let pathShader = GetCurrentScriptDirectory ~ "SamplePS03_HLSL.txt"; + ObjShader_SetShaderF(objWave, pathShader); + ObjShader_SetTechnique(objWave, "TecWave"); + + + //ボスのライフが0になるまでエフェクトをかける。 + let objEnemy = GetEnemyBossObjectID[0]; + while(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) > 0) + { + //エフェクト半径 + effectRadius = baseEffectRadius + outerFluct * sin(frame*4); + + let enemyX = ObjMove_GetX(objEnemy); //敵座標X + let enemyY = ObjMove_GetY(objEnemy); //敵座標Y + + //-------------------------------- + //優先度20~28(背景)をエフェクト用のテクスチャに描画 + //シェーダ解除 + RenderToTextureA1(renderTexture, priEffectMin, priEffectMax, true); + + //-------------------------------- + //シェーダにパラメータを設定 + ObjShader_SetFloat(objWave, "frame_", frame); + ObjShader_SetFloat(objWave, "enemyX_", enemyX + frameLeft); + ObjShader_SetFloat(objWave, "enemyY_", enemyY + frameTop); + ObjShader_SetFloat(objWave, "waveRadius_", effectRadius); + + frame++; + yield; + } + + //エフェクト用オブジェクト削除 + Obj_Delete(objWave); + ClearInvalidRenderPriority(); +} diff --git a/sample/SamplePS03_HLSL.txt b/sample/SamplePS03_HLSL.txt new file mode 100644 index 0000000..0705a31 --- /dev/null +++ b/sample/SamplePS03_HLSL.txt @@ -0,0 +1,107 @@ + +//================================================================ +//ݒl +//Texture +sampler sampler0_ : register(s0); + +//-------------------------------- +//䂪ݐpp[^ +static const float RENDER_WIDTH = 1024; //_OeNX`̕ +static const float RENDER_HEIGHT = 1024; //_OeNX`̍ + +float frame_; //t[ +float enemyX_; //G̈ʒuX +float enemyY_; //G̈ʒuY +float waveRadius_; //GtFNg̔a + + +//================================================================ +//-------------------------------- +//sNZVF[_͒l +struct PS_INPUT +{ + float4 diffuse : COLOR0; //fBt[YF + float2 texCoord : TEXCOORD0; //eNX`W + float2 vPos : VPOS; //`W +}; + +//-------------------------------- +//sNZVF[_o͒l +struct PS_OUTPUT +{ + float4 color : COLOR0; //o͐F +}; + + +//================================================================ +// VF[_ +//-------------------------------- +//sNZVF[_ +PS_OUTPUT PsWave( PS_INPUT In ) : COLOR0 +{ + PS_OUTPUT Out; + + //-------------------------------- + //炬vZ + float dist2 = pow(In.vPos.x-enemyX_ ,2) + pow(In.vPos.y-enemyY_ ,2); + float dist = sqrt(dist2); + float sinTheta = (In.vPos.y - enemyY_) / dist; + float cosTheta = (In.vPos.x - enemyX_) / dist; + + //cݍ쐬psinɎgppxp[^ + float angle = In.vPos.y - enemyY_ + In.vPos.x - enemyX_ + frame_; + angle = radians(angle); + + //YsNZ̘c݂̔avZ + //GtFNga1/16ő̘cݕƂ + float waveRadius = waveRadius_ + waveRadius_/16 * (-1 + sin(angle)); + + //S狗قlje + float powerRatio = (waveRadius - dist) / waveRadius; + if(powerRatio < 0){powerRatio = 0;} + + //F擾ʒũoCAXl + float biasRadius = waveRadius * powerRatio; + float biasX = biasRadius * cosTheta; + float biasY = biasRadius * sinTheta; + + //eNX`̐F擾ʒu + float2 texUV; + texUV.x = -biasX / RENDER_WIDTH + In.texCoord.x; + texUV.y = -biasY / RENDER_HEIGHT + In.texCoord.y; + + + //-------------------------------- + //eNX`̐F + float4 colorTexture = tex2D(sampler0_, texUV); + + //_fBt[YF + float4 colorDiffuse = In.diffuse; + + // + float4 color = colorTexture * colorDiffuse; + + //FԂۂω + if(powerRatio > 0) + { + color.g = color.g * (1 - powerRatio); + color.b = color.b * (1 - powerRatio); + } + + Out.color = color; + + return Out; +} + + +//================================================================ +//-------------------------------- +//technique +technique TecWave +{ + pass P0 + { + PixelShader = compile ps_3_0 PsWave(); + } +} + diff --git a/sample/SampleRB01.txt b/sample/SampleRB01.txt new file mode 100644 index 0000000..7b86ccb Binary files /dev/null and b/sample/SampleRB01.txt differ diff --git a/sample/SampleRB02.txt b/sample/SampleRB02.txt new file mode 100644 index 0000000..af6bdb5 Binary files /dev/null and b/sample/SampleRB02.txt differ diff --git a/sample/SampleRB03.txt b/sample/SampleRB03.txt new file mode 100644 index 0000000..e8c5850 Binary files /dev/null and b/sample/SampleRB03.txt differ diff --git a/sample/SampleRC01.txt b/sample/SampleRC01.txt new file mode 100644 index 0000000..95f3658 --- /dev/null +++ b/sample/SampleRC01.txt @@ -0,0 +1,78 @@ +#TouhouDanmakufu[Stage] +#ScriptVersion[3] +#Title["SampleRC01"] +#Text["SampleRC01: Particle Rendering"] + +@Initialize { + TSample(); +} + +@MainLoop { + yield; +} + +task TSample() { + let dir = GetCurrentScriptDirectory(); + + let obj = ObjParticleList_Create(OBJ_PARTICLE_LIST_2D); + + Obj_SetRenderPriorityI(obj, 21); + ObjPrim_SetTexture(obj, dir ~ "Effect01.png"); + + ObjRender_SetBlendType(obj, BLEND_ADD_ARGB); + + //You may treat a 2D particle list object as a 2D primitive object. + ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLELIST); + ObjPrim_SetVertexCount(obj, 4); + + ObjPrim_SetVertexUVT(obj, 0, 140, 39); + ObjPrim_SetVertexUVT(obj, 1, 186, 39); + ObjPrim_SetVertexUVT(obj, 2, 140, 86); + ObjPrim_SetVertexUVT(obj, 3, 186, 86); + ObjPrim_SetVertexPosition(obj, 0, -46 / 2, -47 / 2, 1); + ObjPrim_SetVertexPosition(obj, 1, 46 / 2, -47 / 2, 1); + ObjPrim_SetVertexPosition(obj, 2, -46 / 2, 47 / 2, 1); + ObjPrim_SetVertexPosition(obj, 3, 46 / 2, 47 / 2, 1); + + //This is absolutely necessary, rendering will not be performed otherwise. + ObjPrim_SetVertexIndex(obj, [0, 1, 2, 1, 2, 3]); + + loop { + CreateParticle(); + yield; + } + + task CreateParticle() { + let x = rand(0, 384); + let y = rand(0, 448); + let x_speed = rand(-1, 1); + let y_speed = rand(-1, 1); + let z_angle = rand(0, 360); + let z_add = rand(-5, 5); + let scale = rand(0.3, 0.7); + + let timer_begin = floor(rand(10, 30 + 1)); + ascent (i in 0..timer_begin) Update(Interpolate_Smooth(0, 1, i / (timer_begin - 1))); + + loop (rand(30, 90)) Update(1); + + let timer_end = floor(rand(10, 30 + 1)); + descent (i in 0..timer_end) Update(Interpolate_Smooth(0, 1, i / (timer_end - 1))); + + function Update(mul_scale) { + //Sets up instance data. + ObjParticleList_SetScale(obj, scale * mul_scale, scale * mul_scale, 1); + ObjParticleList_SetAngle(obj, 0, 0, z_angle); + ObjParticleList_SetPosition(obj, x, y, 1); + + //Submits the current data to an instance, cleared every frame. + ObjParticleList_AddInstance(obj); + + x += x_speed; + y += y_speed; + z_angle += z_add; + yield; + } + } +} + diff --git a/sample/SampleRC02.txt b/sample/SampleRC02.txt new file mode 100644 index 0000000..21f50ad --- /dev/null +++ b/sample/SampleRC02.txt @@ -0,0 +1,75 @@ +#TouhouDanmakufu[Stage] +#ScriptVersion[3] +#Title["SampleRC02"] +#Text["SampleRC02: Particle Rendering (Custom Shader)"] + +@Initialize { + TSample(); +} + +@MainLoop { + yield; +} + +task TSample() { + let dir = GetCurrentScriptDirectory(); + + let obj = ObjParticleList_Create(OBJ_PARTICLE_LIST_2D); + + Obj_SetRenderPriorityI(obj, 21); + ObjPrim_SetTexture(obj, dir ~ "Effect01.png"); + + ObjRender_SetBlendType(obj, BLEND_ADD_ARGB); + + //You may also treat a 2D particle list object as a 2D sprite object. + ObjSprite2D_SetSourceRect(obj, 140, 39, 186, 86); + ObjSprite2D_SetDestCenter(obj); + + //This is absolutely necessary, rendering will not be performed otherwise. + ObjPrim_SetVertexIndex(obj, [0, 1, 2, 3]); + + ObjShader_SetShaderF(obj, dir ~ "SampleRC02_HLSL.txt"); + ObjShader_SetTechnique(obj, "Render"); + + loop { + CreateParticle(); + yield; + } + + task CreateParticle() { + let x = rand(0, 384); + let y = rand(0, 448); + let x_speed = rand(-1, 1); + let y_speed = rand(-1, 1); + let z_angle = rand(0, 360); + let z_add = rand(-5, 5); + let scale = rand(0.3, 0.7); + + let timer_begin = floor(rand(10, 30 + 1)); + ascent (i in 0..timer_begin) Update(Interpolate_Smooth(0, 1, i / (timer_begin - 1))); + + loop (rand(30, 90)) Update(1); + + let timer_end = floor(rand(10, 30 + 1)); + descent (i in 0..timer_end) Update(Interpolate_Smooth(0, 1, i / (timer_end - 1))); + + function Update(mul_scale) { + //Sets up instance data. + ObjParticleList_SetScale(obj, scale * mul_scale, scale * mul_scale, 1); + ObjParticleList_SetAngle(obj, 0, 0, z_angle); + ObjParticleList_SetPosition(obj, x, y, 1); + + //Three slots are provided. You may put anything here, as long as they are floats. + ObjParticleList_SetExtraData(obj, y / 448, 0, 0); + + //Submits the current data to an instance, cleared every frame. + ObjParticleList_AddInstance(obj); + + x += x_speed; + y += y_speed; + z_angle += z_add; + yield; + } + } +} + diff --git a/sample/SampleRC02_HLSL.txt b/sample/SampleRC02_HLSL.txt new file mode 100644 index 0000000..b7c61c6 --- /dev/null +++ b/sample/SampleRC02_HLSL.txt @@ -0,0 +1,81 @@ +sampler samp0_ : register(s0); + +//The 4-by-4 matrix linked to WORLDVIEWPROJ semantic is provided by the engine. +// It is used to transform world coordinates to device coordinates. +float4x4 g_mWorldViewProj : WORLDVIEWPROJ : register(c0); + +struct VS_INPUT { + //Vertex data + float4 position : POSITION; + float4 diffuse : COLOR0; + float2 texCoord : TEXCOORD0; + + //Instance data + float4 i_color : COLOR1; + float4 i_xyz_pos_x_scale : TEXCOORD1; //Pack: (x pos, y pos, z pos, x scale) + float4 i_yz_scale_xy_ang : TEXCOORD2; //Pack: (y scale, z scale, x angle, y angle) + float4 i_z_ang_extra : TEXCOORD3; //Pack: (z angle, extra 1, extra 2, extra 3) +}; +struct PS_INPUT { + float4 position : POSITION; + float4 diffuse : COLOR0; + float2 texCoord : TEXCOORD0; + float exAlpha : FOG; +}; + +PS_INPUT mainVS(VS_INPUT inVs) { + PS_INPUT outVs; + + float3 t_scale = float3(inVs.i_xyz_pos_x_scale.w, inVs.i_yz_scale_xy_ang.xy); + + float2 ax = float2(sin(inVs.i_yz_scale_xy_ang.z), cos(inVs.i_yz_scale_xy_ang.z)); + float2 ay = float2(sin(inVs.i_yz_scale_xy_ang.w), cos(inVs.i_yz_scale_xy_ang.w)); + float2 az = float2(sin(inVs.i_z_ang_extra.x), cos(inVs.i_z_ang_extra.x)); + + //Creates the transformation matrix. + float4x4 matInstance = float4x4( + float4( + t_scale.x * (ay.y * az.y - ax.x * ay.x * az.x), + t_scale.x * (-ax.y * az.x), + t_scale.x * (ay.x * az.y + ax.x * ay.y * az.x), + 0 + ), + float4( + t_scale.y * (ay.y * az.x + ax.x * ay.x * az.y), + t_scale.y * (ax.y * az.y), + t_scale.y * (ay.x * az.x - ax.x * ay.y * az.y), + 0 + ), + float4( + t_scale.z * (-ax.y * ay.x), + t_scale.z * (ax.x), + t_scale.z * (ax.y * ay.y), + 0 + ), + float4(inVs.i_xyz_pos_x_scale.x, inVs.i_xyz_pos_x_scale.y, inVs.i_xyz_pos_x_scale.z, 1) + ); + + outVs.diffuse = inVs.diffuse * inVs.i_color; + outVs.texCoord = inVs.texCoord; + outVs.position = mul(inVs.position, matInstance); + outVs.position = mul(outVs.position, g_mWorldViewProj); + outVs.position.z = 1.0f; + outVs.exAlpha = saturate(inVs.i_z_ang_extra.y); + + return outVs; +} + +float4 mainPS(PS_INPUT inPs) : COLOR0 { + float4 color = tex2D(samp0_, inPs.texCoord) * inPs.diffuse; + color.a *= inPs.exAlpha; + + return color; +} + +technique Render { + pass P0 { + VertexShader = compile vs_2_0 mainVS(); + PixelShader = compile ps_3_0 mainPS(); + } +} + diff --git a/sample/SampleRC03.txt b/sample/SampleRC03.txt new file mode 100644 index 0000000..6e2b8a7 --- /dev/null +++ b/sample/SampleRC03.txt @@ -0,0 +1,87 @@ +#TouhouDanmakufu[Stage] +#ScriptVersion[3] +#Title["SampleRC03"] +#Text["SampleRC03: Particle Rendering (Custom Shader, 3D)"] + +@Initialize { + SetFogParam(256, 1000, 0, 0, 0); + + TSample(); +} + +@MainLoop { + yield; +} + +task TSample() { + let dir = GetCurrentScriptDirectory(); + + let obj = ObjParticleList_Create(OBJ_PARTICLE_LIST_3D); + + Obj_SetRenderPriorityI(obj, 21); + ObjPrim_SetTexture(obj, dir ~ "Effect01.png"); + + ObjRender_SetBlendType(obj, BLEND_ADD_ARGB); + + //You may treat a 3D particle list object as either a 3D primitive object or a 3D sprite object. + ObjSprite3D_SetSourceRect(obj, 140, 39, 186, 86); + ObjSprite3D_SetDestRect(obj, -46 / 2, -47 / 2, 46 / 2, 47 / 2); + + //This is absolutely necessary, rendering will not be performed otherwise. + ObjPrim_SetVertexIndex(obj, [0, 1, 2, 3]); + + ObjShader_SetShaderF(obj, dir ~ "SampleRC03_HLSL.txt"); + ObjShader_SetTechnique(obj, "Render"); + + loop { + loop (7) CreateParticle(); + yield; + } + + task CreateParticle() { + let x = rand(-700, 700); + let y = rand(-700, 700); + let z = rand(-700, 700); + + let x_speed = rand(-2, 2); + let y_speed = rand(-2, 2); + let z_speed = rand(-2, 2); + + let x_angle = rand(0, 360); + let y_angle = rand(0, 360); + let z_angle = rand(0, 360); + let x_add = rand(-5, 5); + let y_add = rand(-5, 5); + let z_add = rand(-5, 5); + + let scale = rand(0.3, 0.7); + + let timer_begin = floor(rand(10, 30 + 1)); + ascent (i in 0..timer_begin) Update(Interpolate_Smooth(0, 1, i / (timer_begin - 1))); + + loop (rand(30, 90)) Update(1); + + let timer_end = floor(rand(10, 30 + 1)); + descent (i in 0..timer_end) Update(Interpolate_Smooth(0, 1, i / (timer_end - 1))); + + function Update(mul_scale) { + //Sets up instance data. + let tmp_sc = scale * mul_scale; + ObjParticleList_SetScale(obj, tmp_sc, tmp_sc, tmp_sc); + ObjParticleList_SetAngle(obj, x_angle, y_angle, z_angle); + ObjParticleList_SetPosition(obj, x, y, z); + + //Submits the current data to an instance, cleared every frame. + ObjParticleList_AddInstance(obj); + + x += x_speed; + y += y_speed; + z += z_speed; + x_angle += x_add; + y_angle += y_add; + z_angle += z_add; + yield; + } + } +} + diff --git a/sample/SampleRC03_HLSL.txt b/sample/SampleRC03_HLSL.txt new file mode 100644 index 0000000..d734665 --- /dev/null +++ b/sample/SampleRC03_HLSL.txt @@ -0,0 +1,108 @@ +sampler samp0_ : register(s0); + +//The following semantic-linked global variables are provided by the engine. +// WORLD (float4x4) +// The camera matrix. This can be ignored when the particle lists are not intended to be billboarded. +// VIEW (float4x4) +// The view matrix. Used to transform world coordinates to camera coordinates. +// PROJECTION (float4x4) +// The projection matrix. Used to transform camera coordinates to device coordinates. +// FOGENABLE (bool) +// A boolean indicating whether fog was enabled for the particle list object. +// FOGCOLOR (float4) +// The color of the fog set with SetFogParam. The packing format is (r, g, b, a). +// FOGDIST (float2) +// The ranges of the fog set with SetFogParam. The packing format is (fog start, fog end). +float4x4 g_mCamera : WORLD : register(c0); +float4x4 g_mView : VIEW : register(c4); +float4x4 g_mProj : PROJECTION : register(c8); +bool g_bUseFog : FOGENABLE : register(b0) = false; +float4 g_vFogColor : FOGCOLOR : register(c12) = float4(0.0f, 0.0f, 0.0f, 0.0f); +float2 g_vFogDist : FOGDIST : register(c13) = float2(0.0f, 256.0f); + +struct VS_INPUT { + //Vertex data + float4 position : POSITION; + float4 diffuse : COLOR0; + float2 texCoord : TEXCOORD0; + + //Instance data + float4 i_color : COLOR1; + float4 i_xyz_pos_x_scale : TEXCOORD1; //Pack: (x pos, y pos, z pos, x scale) + float4 i_yz_scale_xy_ang : TEXCOORD2; //Pack: (y scale, z scale, x angle, y angle) + float4 i_z_ang_extra : TEXCOORD3; //Pack: (z angle, extra 1, extra 2, extra 3) +}; +struct PS_INPUT { + float4 position : POSITION; + float4 diffuse : COLOR0; + float2 texCoord : TEXCOORD0; + float fogBlend : FOG; +}; + +PS_INPUT mainVS(VS_INPUT inVs) { + PS_INPUT outVs; + + float3 t_scale = float3(inVs.i_xyz_pos_x_scale.w, inVs.i_yz_scale_xy_ang.xy); + + float2 ax = float2(sin(inVs.i_yz_scale_xy_ang.z), cos(inVs.i_yz_scale_xy_ang.z)); + float2 ay = float2(sin(inVs.i_yz_scale_xy_ang.w), cos(inVs.i_yz_scale_xy_ang.w)); + float2 az = float2(sin(inVs.i_z_ang_extra.x), cos(inVs.i_z_ang_extra.x)); + + //Creates the transformation matrix. + //Calculate positions later after transformation with g_mCamera. Necessary for billboarded sprites to render correctly. + float4x4 matInstance = float4x4( + float4( + t_scale.x * (ay.y * az.y - ax.x * ay.x * az.x), + t_scale.x * (-ax.y * az.x), + t_scale.x * (ay.x * az.y + ax.x * ay.y * az.x), + 0 + ), + float4( + t_scale.y * (ay.y * az.x + ax.x * ay.x * az.y), + t_scale.y * (ax.y * az.y), + t_scale.y * (ay.x * az.x - ax.x * ay.y * az.y), + 0 + ), + float4( + t_scale.z * (-ax.y * ay.x), + t_scale.z * (ax.x), + t_scale.z * (ax.y * ay.y), + 0 + ), + float4(0, 0, 0, 1) + ); + + outVs.diffuse = inVs.diffuse * inVs.i_color; + outVs.texCoord = inVs.texCoord; + + outVs.position = mul(inVs.position, matInstance); + outVs.position = mul(outVs.position, g_mCamera); + //After billboarding has been accounted for, add the instance positions. + outVs.position.xyz += inVs.i_xyz_pos_x_scale.xyz; + outVs.position = mul(outVs.position, g_mView); + + //Compute fog while the position is in camera space. + if (g_bUseFog) + outVs.fogBlend = saturate((g_vFogDist.y - outVs.position.z) / (g_vFogDist.y - g_vFogDist.x)); + + outVs.position = mul(outVs.position, g_mProj); + + return outVs; +} + +float4 mainPS(PS_INPUT inPs) : COLOR0 { + float4 color = tex2D(samp0_, inPs.texCoord); + + if (g_bUseFog) + color.rgb = lerp(g_vFogColor.rgb, color.rgb, inPs.fogBlend); + + return (color * inPs.diffuse); +} + +technique Render { + pass P0 { + VertexShader = compile vs_3_0 mainVS(); + PixelShader = compile ps_3_0 mainPS(); + } +} + diff --git a/sample/SampleVS01.txt b/sample/SampleVS01.txt new file mode 100644 index 0000000..b9dcfb6 --- /dev/null +++ b/sample/SampleVS01.txt @@ -0,0 +1,64 @@ +#TouhouDanmakufu[Stage] +#ScriptVersion[3] +#Title["SampleVS01"] +#Text["SampleVS01: Basic Vertex Shaders"] + +@Initialize { + TSample(); +} + +@MainLoop { + if (GetKeyState(KEY_Q) == KEY_PUSH) + CloseStgScene(); + yield; +} + +task TSample() { + let dir = GetCurrentScriptDirectory(); + let path = dir ~ "../default_system/img/Default_Background_IceMountain_Spell01.png"; + + let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D); + Obj_SetRenderPriorityI(obj, 23); + ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP); + ObjPrim_SetTexture(obj, path); + + //Please do not actually use 10000 vertices + let VC = 5000; + + ObjPrim_SetVertexCount(obj, VC * 2); + ObjRender_SetPosition(obj, 192, 224, 1); + + ascent (i in 0..VC) { + let v_angle = 360 / (VC - 1) * i; + let tex_v = 1 / (VC - 1) * i; + ObjPrim_SetVertexPosition(obj, i * 2, 0, 0, 1); + ObjPrim_SetVertexPosition(obj, i * 2 + 1, 240 * cos(v_angle), 240 * sin(v_angle), 1); + ObjPrim_SetVertexUV(obj, i * 2, 0, tex_v); + ObjPrim_SetVertexUV(obj, i * 2 + 1, 1, tex_v); + } + + //Enables vertex shader rendering. + //If this is set to true and a vertex+pixel shader isn't used, rendering will always fail. + ObjRender_SetVertexShaderRenderingMode(obj, true); + + ObjShader_SetShaderF(obj, dir ~ "SampleVS01_HLSL.txt"); + ObjShader_SetTechnique(obj, "Render"); + + let t = 0; + while (true) { + ObjShader_SetFloat(obj, "frame_", t); + /* + //Equivalent to these + ascent(i in 0..VC){ + let tex_v = 1 / (VC - 1) * i; + ObjPrim_SetVertexUV(obj, i * 2, 0 - t, tex_v); + ObjPrim_SetVertexUV(obj, i * 2 + 1, 1 - t, tex_v); + } + */ + + t += 0.006; + t %= 1; + yield; + } +} + diff --git a/sample/SampleVS01_HLSL.txt b/sample/SampleVS01_HLSL.txt new file mode 100644 index 0000000..f94f62d --- /dev/null +++ b/sample/SampleVS01_HLSL.txt @@ -0,0 +1,53 @@ +sampler samp0_ : register(s0); + +//2 top-level semantics are provided by the engine in the case of 2D render objects: +// WORLD: +// Contains the transformation matrix of the render object. +// VIEWPROJECTION: +// Contains the projection*camera matrix, used for correctly tranforming vertices to screen-space coordinates. +float4x4 g_mWorld : WORLD; +float4x4 g_mViewProj : VIEWPROJECTION; + +float frame_; + +struct VS_INPUT { + float4 position : POSITION; + float4 diffuse : COLOR0; + float2 texCoord : TEXCOORD0; +}; +struct PS_INPUT { + float4 position : POSITION; + float4 diffuse : COLOR0; + float2 texCoord : TEXCOORD0; +}; +struct PS_OUTPUT { + float4 color : COLOR0; +}; + +PS_INPUT mainVS(VS_INPUT inVs) { + PS_INPUT outVs; + + outVs.diffuse = inVs.diffuse; + outVs.texCoord = inVs.texCoord; + outVs.position = mul(inVs.position, g_mWorld); + outVs.position = mul(outVs.position, g_mViewProj); + outVs.position.z = 1.0f; + + return outVs; +} + +PS_OUTPUT mainPS(PS_INPUT inPs) { + PS_OUTPUT outPs; + + outPs.color = tex2D(samp0_, inPs.texCoord - float2(frame_, 0)) * inPs.diffuse; + + return outPs; +} + +technique Render { + pass P0 { + VertexShader = compile vs_2_0 mainVS(); + PixelShader = compile ps_2_0 mainPS(); + } +} + diff --git a/sample/SampleVS02.txt b/sample/SampleVS02.txt new file mode 100644 index 0000000..94b68b2 --- /dev/null +++ b/sample/SampleVS02.txt @@ -0,0 +1,164 @@ +#TouhouDanmakufu[Single] +#ScriptVersion[3] +#Title["SampleVS02"] +#Text["SampleVS02: Vertex Shader-Based Distortion Effect"] +#Background["script/default_system/Default_Background_IceMountain.txt"] + +#include "script/default_system/Default_ShotConst.txt" + +let objEnemy; +let objPlayer; +let frame = 0; + +@Event { + alternative(GetEventType()) + case(EV_REQUEST_LIFE) { + SetScriptResult(500); + } +} + +@Initialize { + objPlayer = GetPlayerObjectID(); + + objEnemy = ObjEnemy_Create(OBJ_ENEMY_BOSS); + ObjEnemy_Regist(objEnemy); + + let imgExRumia = GetCurrentScriptDirectory ~ "ExRumia.png"; + ObjPrim_SetTexture(objEnemy, imgExRumia); + ObjSprite2D_SetSourceRect(objEnemy, 64, 1, 127, 64); + ObjSprite2D_SetDestCenter(objEnemy); + + let cx = GetStgFrameWidth() / 2; + ObjMove_SetDestAtFrame(objEnemy, cx, 180, 60); + + TWaveCircle(); + TFinalize(); +} + +@MainLoop { + let ex = ObjMove_GetX(objEnemy); + let ey = ObjMove_GetY(objEnemy); + + if (frame == 120) { + let px = GetPlayerX(); + ObjMove_SetDestAtFrame(objEnemy, rand(192 - 80, 192 + 80), rand(100, 230), 40); + //ObjMove_SetDestAtFrame(objEnemy, 0, rand(120, 300), 40); + + frame = 0; + } + + ObjEnemy_SetIntersectionCircleToShot(objEnemy, ex, ey, 32); + + frame++; + yield; +} + +task TWaveCircle() { + wait(60); + + let color = [1, 0.065, 0.065]; + let renderTexture = GetReservedRenderTargetName(0); + + let stripWave = []; + + let countEdge = 32; + let countStrip = 4; + let maxRadius = 128; + + let frameLeft = GetStgFrameLeft(); + let frameTop = GetStgFrameTop(); + + let objWave = ObjPrim_Create(OBJ_PRIMITIVE_2D); + + Obj_SetRenderPriorityI(objWave, 26); + ObjPrim_SetPrimitiveType(objWave, PRIMITIVE_TRIANGLELIST); + ObjPrim_SetTexture(objWave, renderTexture); + + ObjPrim_SetVertexCount(objWave, countEdge * countStrip * 6); + + ascent (i in 0..countStrip) { + let stripWidth = maxRadius / (countStrip - 1); + let rInEdge = stripWidth * i; + FillRingVertex(i * countEdge * 6, rInEdge, rInEdge + stripWidth); + } + + ObjRender_SetVertexShaderRenderingMode(objWave, true); + ObjShader_SetShaderF(objWave, GetCurrentScriptDirectory() ~ "SampleVS02_HLSL.txt"); + ObjShader_SetTechnique(objWave, "Render"); + + let ex = ObjMove_GetX(objEnemy); + let ey = ObjMove_GetY(objEnemy); + + let nowRadius = 0; + + let t = 0; + while (!Obj_IsDeleted(objEnemy)) { + ex = ObjMove_GetX(objEnemy); + ey = ObjMove_GetY(objEnemy); + + if(nowRadius < maxRadius){ + let tmp = sin((t + 1) / 50 * 90); + nowRadius = maxRadius * tmp; + } + + Update(); + } + { + let _radius = nowRadius; + + descent(i in 0..30){ + let tmp = sin((i + 1) / 30 * 90); + nowRadius = _radius * tmp; + + Update(); + } + } + + Obj_Delete(objWave); + + function Update() { + RenderToTextureA1(renderTexture, 20, 25, true); + + ObjShader_SetFloat(objWave, "frame_", t); + ObjShader_SetFloat(objWave, "waveSine_", 0.8 + sin(t * 5) * 0.5); + ObjShader_SetFloatArray(objWave, "waveRadius_", [nowRadius, maxRadius]); + + ObjShader_SetFloatArray(objWave, "enemyPos_", [ex + frameLeft, ey + frameTop]); + ObjShader_SetFloatArray(objWave, "waveColor_", color); + + //ObjRender_SetPosition(objWave, ex, ey, 1); + + t++; + yield; + } + + function FillRingVertex(vi_start, r_inner, r_outer) { + ascent (i in 0..countEdge) { + let vi = vi_start + i * 6; + let v_angle = 360 / (countEdge - 1); + let s1 = sin(v_angle * i); + let c1 = cos(v_angle * i); + let s2 = sin(v_angle * (i + 1)); + let c2 = cos(v_angle * (i + 1)); + ObjPrim_SetVertexPosition(objWave, vi + 0, r_inner * c1, r_inner * s1, 1); + ObjPrim_SetVertexPosition(objWave, vi + 1, r_outer * c1, r_outer * s1, 1); + ObjPrim_SetVertexPosition(objWave, vi + 2, r_inner * c2, r_inner * s2, 1); + ObjPrim_SetVertexPosition(objWave, vi + 3, r_outer * c1, r_outer * s1, 1); + ObjPrim_SetVertexPosition(objWave, vi + 4, r_inner * c2, r_inner * s2, 1); + ObjPrim_SetVertexPosition(objWave, vi + 5, r_outer * c2, r_outer * s2, 1); + ObjPrim_SetVertexUVT(objWave, vi + 0, r_inner * c1, r_inner * s1); + ObjPrim_SetVertexUVT(objWave, vi + 1, r_outer * c1, r_outer * s1); + ObjPrim_SetVertexUVT(objWave, vi + 2, r_inner * c2, r_inner * s2); + ObjPrim_SetVertexUVT(objWave, vi + 3, r_outer * c1, r_outer * s1); + ObjPrim_SetVertexUVT(objWave, vi + 4, r_inner * c2, r_inner * s2); + ObjPrim_SetVertexUVT(objWave, vi + 5, r_outer * c2, r_outer * s2); + } + } +} + +task TFinalize(){ + while (ObjEnemy_GetInfo(objEnemy, INFO_LIFE) > 0) { yield; } + Obj_Delete(objEnemy); + wait(120); + CloseScript(GetOwnScriptID()); +} \ No newline at end of file diff --git a/sample/SampleVS02_HLSL.txt b/sample/SampleVS02_HLSL.txt new file mode 100644 index 0000000..97be4c9 --- /dev/null +++ b/sample/SampleVS02_HLSL.txt @@ -0,0 +1,80 @@ +sampler samp0_ : register(s0); + +//2 top-level semantics are provided by the engine in the case of 2D render objects: +// WORLD: +// Contains the transformation matrix of the render object. +// VIEWPROJECTION: +// Contains the projection*camera matrix, used for correctly tranforming vertices to screen-space coordinates. +float4x4 g_mViewProj : VIEWPROJECTION; + +float frame_; +float2 waveRadius_; +float waveSine_; +float2 enemyPos_; +float2 framePos_; +float3 waveColor_; + +static const float RENDER_LEFT = 32.5f / 1024.0f; //mininum render width +static const float RENDER_TOP = 16.5f / 512.0f; //maximum render width +static const float RENDER_RIGHT = 415.5f / 1024.0f; //mininum render height +static const float RENDER_BOTTOM = 463.5f / 512.0f; //maximum render height +static const float2 SCREEN_SPACE = float2(1024.0f, 512.0f); + +struct VS_INPUT { + float4 position : POSITION; + float4 diffuse : COLOR0; + float2 texCoord : TEXCOORD0; +}; +struct PS_INPUT { + float4 position : POSITION; + float4 diffuse : COLOR0; + float2 texCoord : TEXCOORD0; + float blend : FOG; +}; +struct PS_OUTPUT { + float4 color : COLOR0; +}; + +PS_INPUT mainVS(VS_INPUT inVs) { + PS_INPUT outVs; + + float mul_scale = waveRadius_.x / waveRadius_.y; + float2 posVertex = inVs.position.xy * mul_scale; + + float dist = length(inVs.position.xy * mul_scale); + outVs.blend = saturate((waveRadius_.x - dist) / waveRadius_.x); + + float2 cos_sin = posVertex.xy / dist; + float2 distortPos = cos_sin.xy * waveRadius_.x * min(outVs.blend, 0.22f) * 0.5f * waveSine_; + distortPos.x += (cos_sin.x * outVs.blend) * 16.0f; + distortPos.y += (cos_sin.y * outVs.blend) * 16.0f; + + outVs.texCoord = inVs.texCoord * mul_scale + enemyPos_ / SCREEN_SPACE; + outVs.position = mul(float4(posVertex + enemyPos_ + distortPos, inVs.position.zw), g_mViewProj); + outVs.position.zw = (float2)1.0f; + outVs.diffuse = inVs.diffuse; + + return outVs; +} + +PS_OUTPUT mainPS(PS_INPUT inPs) { + PS_OUTPUT outPs; + + inPs.texCoord.x = clamp(inPs.texCoord.x, RENDER_LEFT, RENDER_RIGHT); + inPs.texCoord.y = clamp(inPs.texCoord.y, RENDER_TOP, RENDER_BOTTOM); + + float3 colorRGB = tex2D(samp0_, inPs.texCoord).rgb; + colorRGB.rgb -= (1.0f - waveColor_.xyz) * inPs.blend; + + outPs.color = float4(colorRGB, 1.0f) * inPs.diffuse; + + return outPs; +} + +technique Render { + pass P0 { + VertexShader = compile vs_3_0 mainVS(); + PixelShader = compile ps_3_0 mainPS(); + } +} + diff --git a/sample/SampleVS03.txt b/sample/SampleVS03.txt new file mode 100644 index 0000000..2c4e617 --- /dev/null +++ b/sample/SampleVS03.txt @@ -0,0 +1,74 @@ +#TouhouDanmakufu[Stage] +#ScriptVersion[3] +#Title["SampleVS03"] +#Text["SampleVS03: Basic Vertex Shaders (3D)"] + +@Initialize { + SetCameraFocusX(0); + SetCameraFocusY(0); + SetCameraFocusZ(0); + SetCameraRadius(800); + SetCameraElevationAngle(35); + SetCameraAzimuthAngle(0); + + SetFogParam(0, 768, 64, 0, 0); + + TSample(); +} + +@MainLoop { + if (GetKeyState(KEY_Q) == KEY_PUSH) + CloseStgScene(); + yield; +} + +task TSample() { + let dir = GetCurrentScriptDirectory(); + let path = dir ~ "../default_system/img/Default_Background_IceMountain_Spell01.png"; + + let obj = ObjPrim_Create(OBJ_PRIMITIVE_3D); + Obj_SetRenderPriorityI(obj, 22); + ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP); + ObjPrim_SetTexture(obj, path); + + let VC = 5000; + + ObjPrim_SetVertexCount(obj, VC * 2); + ObjRender_SetPosition(obj, 320, 240, 1); + + ascent (i in 0..VC) { + let v_angle = 360 / (VC - 1) * i; + let tex_v = 1 / (VC - 1) * i; + ObjPrim_SetVertexPosition(obj, i * 2, 0, 0, 1); + ObjPrim_SetVertexPosition(obj, i * 2 + 1, 256 * cos(v_angle), 256 * sin(v_angle), 1); + ObjPrim_SetVertexUV(obj, i * 2, 0, tex_v); + ObjPrim_SetVertexUV(obj, i * 2 + 1, 1, tex_v); + } + + //Enables vertex shader rendering. + //If this is set to true and a vertex+pixel shader isn't used, rendering will always fail. + ObjRender_SetVertexShaderRenderingMode(obj, true); + + ObjShader_SetShaderF(obj, dir ~ "SampleVS03_HLSL.txt"); + ObjShader_SetTechnique(obj, "Render"); + + let t = 0; + while (true) { + ObjRender_SetAngleX(obj, -90); + ObjRender_SetAngleZ(obj, t * 70); + + ObjShader_SetFloat(obj, "frame_", t); + /* + //Equivalent to these + ascent(i in 0..VC){ + let tex_v = 1 / (VC - 1) * i; + ObjPrim_SetVertexUV(obj, i * 2, 0 - t, tex_v); + ObjPrim_SetVertexUV(obj, i * 2 + 1, 1 - t, tex_v); + } + */ + + t += 0.003; + yield; + } +} + diff --git a/sample/SampleVS03_HLSL.txt b/sample/SampleVS03_HLSL.txt new file mode 100644 index 0000000..40e4a53 --- /dev/null +++ b/sample/SampleVS03_HLSL.txt @@ -0,0 +1,64 @@ +sampler sampler0_ : register(s0); + +//The following semantic-linked global variables are provided by the engine. +// WORLD (float4x4) +// The transformation matrix of the render object. +// VIEW (float4x4) +// The view matrix. Used to transform world coordinates to camera coordinates. +// PROJECTION (float4x4) +// The projection matrix. Used to transform camera coordinates to device coordinates. +// FOGENABLE (bool) +// A boolean indicating whether fog was enabled for the render object. +// FOGCOLOR (float4) +// The color of the fog set with SetFogParam. The packing format is (r, g, b, a). +// FOGDIST (float2) +// The ranges of the fog set with SetFogParam. The packing format is (fog start, fog end). + +float4x4 g_mWorld : WORLD : register(c0); +float4x4 g_mView : VIEW : register(c4); +float4x4 g_mProj : PROJECTION : register(c8); + +float4 g_vFogColor : FOGCOLOR : register(c12); +float2 g_vFogDist : FOGDIST : register(c13); + +float frame_; + +struct VS_INPUT { + float4 position : POSITION; + float4 diffuse : COLOR0; + float2 texCoord : TEXCOORD0; +}; +struct VS_OUTPUT { + float4 position : POSITION; + float4 diffuse : COLOR0; + float2 texCoord : TEXCOORD0; + float fog : FOG; +}; + +VS_OUTPUT mainVS(VS_INPUT InVs) { + VS_OUTPUT OutVs; + + OutVs.diffuse = InVs.diffuse; + OutVs.texCoord = InVs.texCoord - float2(frame_, 0); + OutVs.position = mul(InVs.position, g_mWorld); + OutVs.position = mul(OutVs.position, g_mView); + + OutVs.fog = saturate((g_vFogDist.y - OutVs.position.z) / (g_vFogDist.y - g_vFogDist.x)); + + OutVs.position = mul(OutVs.position, g_mProj); + + return OutVs; +} + +float4 mainPS(VS_OUTPUT InPs) : COLOR0 { + float4 color = tex2D(sampler0_, InPs.texCoord); + color.rgb = lerp(g_vFogColor.rgb, color.rgb, InPs.fog); + return color * InPs.diffuse; +} + +technique Render { + pass P0 { + VertexShader = compile vs_3_0 mainVS(); + PixelShader = compile ps_3_0 mainPS(); + } +} \ No newline at end of file