NarumiSTG_HyperSnowDrifter/script/sample/SampleE02.txt

332 lines
22 KiB
Plaintext
Raw Normal View History

2023-01-26 11:34:56 +00:00
<EFBFBD><EFBFBD>#qg<71>e>_U^<5E><>[Single]
#ScriptVersion[3]
#Title["SampleE02"]
#Text["SampleE02<1A><>0<EFBFBD>0hT<68>Vn0<6E>0<EFBFBD>0N0<4E>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0"]
#Background["script/default_system/Default_Background_IceMountain.txt"]
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0>_;u<>P<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
#include"script/default_system/Default_ShotConst.txt"
//----------------------------------------------------
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0 Ype<70>[<00>
//S0n0MOng0<67>[<00>W0_0 Ypeo0<6F>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0hQSOg0 g<>Rg0Y00
//_0`0W0S0n0<6E>{@bg0n0 Ypex0n0<6E>NeQo00<>[pe<70>NYn0<6E>NeQo0L<30>H0~0[0<>00
//(<00>[L<><06><>^L0<4C>O<EFBFBD><4F>U0<55>0j0D0_0<5F>0qNpej0i0n0O(uo0g0M0~0[0<>0)
//----------------------------------------------------
let objEnemy; //ue<75>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
let objPlayer; //<00><>_j<5F>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
let frame = 0; //ue<75>R\Ok0O(uY0<59>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0(@MainLoopg01e0d0<64>X<EFBFBD>RU0[0~0Y0)
//----------------------------------------------------
//uen0<6E>R\O
//----------------------------------------------------
@Event
{
alternative(GetEventType())
case(EV_REQUEST_LIFE)
{
//ue<75>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD><30>BlU0<55>0_0
SetScriptResult(500);//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0500k0-<2D><>[
}
}
@Initialize
{
//<00><>_j<5F>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>S<EFBFBD>_
objPlayer = GetPlayerObjectID();
//ue<75>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0ubW0{v2<76>
objEnemy = ObjEnemy_Create(OBJ_ENEMY_BOSS);
ObjEnemy_Regist(objEnemy);
//ue;u<>Pn0-<2D><>[
let imgExRumia = GetCurrentScriptDirectory ~ "ExRumia.png"; //ue;u<>P<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
ObjPrim_SetTexture(objEnemy, imgExRumia); //;u<>P<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD><30>0<7F><30><EFBFBD>0
ObjSprite2D_SetSourceRect(objEnemy, 64, 1, 127, 64); //<00>c;uCQ<43>wb_<62>0(64,1) - (127,64)k0-<2D><>[
ObjSprite2D_SetDestCenter(objEnemy); //<00>c;uHQ<48>0-N<>_(0, 0)k0-<2D><>[
//<00>^j(cx, 120)x060<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0K0Q0f0<66>y<EFBFBD>RY0<59>0
let cx = GetStgFrameWidth() / 2;//STG<00>0<EFBFBD>0<EFBFBD>0n0-N<>_x<00>^j<>0<EFBFBD>S<EFBFBD>_
ObjMove_SetDestAtFrame(objEnemy, cx, 120, 60);
//let objScene = GetEnemyBossSceneObjectID();
//ObjEnemyBossScene_StartSpell(objScene);
TWaveCircle();
}
@MainLoop
{
//uen0<6E>^j<>0<EFBFBD>S<EFBFBD>_
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)
{
//frameL0180k0j0c0_0<5F>0<EFBFBD>[L<>U0<55>0<EFBFBD>0<EFBFBD><30>R
//<00><>_jn0<6E>^j<>0<EFBFBD>S<EFBFBD>_
let px = GetPlayerX();
let py = GetPlayerY();
//ueK0<4B>00_0<5F><30>_j<5F>eTn0҉<30>^<5E>0Bl<42>0<EFBFBD>00
let angleToPlayer = atan2(py - ey, px - ex);
//angle<00>0-30K0<4B>015Z0d0<64>X<EFBFBD>RU0[05WAYk0Y0<59>0
let angle=0;
while(angle<360)
{//(angle<1A>15<00><00><><EFBFBD><EFBFBD>g00^<5E>360~0g0)
//N<>[Bf<42><66>g0<67><30>_j<5F>eTx0҉<30>^<5E>0 YH0<48>0>_
//>_<>0\ObY0<59>00
let obj = CreateShotA2(ex, ey, 5, angle, -0.10, 1, DS_RICE_S_BLUE, 30);
//zv\<5C>_60<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>vk00<><30>_j<5F>eT<>0<EFBFBD>W<EFBFBD>nk0҉<30>^ Y<>fY0<59>0<EFBFBD>0F0k0-<2D><>[
ObjMove_AddPatternA4(obj, 60, 3, 0, 0, 0, 3, objPlayer, NO_CHANGE);
angle += 15;
}
frame = 0;//>_<>0<EFBFBD>QW0_0<5F>0frame<00>00k0Y0<59>0
}
//S__0<5F>0$R<>[{v2<76>
ObjEnemy_SetIntersectionCircleToShot(objEnemy, ex, ey, 32);//S__0<5F>0$R<>[(<00><>_j>_(u){v2<76>
ObjEnemy_SetIntersectionCircleToPlayer(objEnemy, ex, ey, 24);//S__0<5F>0$R<>[(SOS__0<5F>0(u){v2<76>
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0k01<00><><EFBFBD>R
frame++;
//<00>0<EFBFBD>0<EFBFBD>00<00>Qt
if(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) <= 0)
{
//<00>0<EFBFBD>0<EFBFBD>0L00k0j0c0_0<5F>0sS<73>^k0B}<7D>N
//,gego0rzv<7A>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0n0<6E>0<EFBFBD>0<EFBFBD>0<EFBFBD>0{v2<76>W00
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0B}<7D>N<EFBFBD>0<EFBFBD>_c0f00<>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0B}<7D>NW0~0Y00
yield;
Obj_Delete(objEnemy);
CloseScript(GetOwnScriptID());
return;
}
yield;
}
//----------------------------------------------------
//<00>0<EFBFBD>0hT<68>Vn0<6E>0<EFBFBD>0N0<4E>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
//----------------------------------------------------
task TWaveCircle()
{
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0k0O(uY0<59>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
let renderTexture = GetReservedRenderTargetName(0);
let frame = 0; //<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
let baseEffectRadius = 144; //<00>W<EFBFBD>n<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0JS<4A>_
let outerFluct = 16; //<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0JS<4A>_n0g'Y Y
let effectRadius = 0; //<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0JS<4A>_
let circleVertexCount = 16; //<00>Q<EFBFBD>0B0<42>0<EFBFBD>0Y0n0k0O(uY0<59>0<02><>pn0pe
let innerCircleCount = 4;
let priEffectMin = 20; //<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0K0Q0<51>0g\*QHQ<48>^
let priEffectMax = 28; //<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0K0Q0<51>0g'Y*QHQ<48>^
//̀ofn00<7F>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0n0<6E>[a<>h0Y0<59>0
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0n0<6E>c;ug0~0K0j0H0<48>0_0<5F>00
//*QHQ<48>^20^<5E>28n0<1A>8^<5E>c;u<>0!q<>Rk0Y0<59>00
SetInvalidRenderPriorityA1(priEffectMin, priEffectMax);
let frameWidth = GetStgFrameWidth();
let frameHeight = GetStgFrameHeight();
let frameLeft = GetStgFrameLeft();
let frameRight = frameLeft + frameWidth;
let frameTop = GetStgFrameTop();
let frameBottom = frameTop + frameHeight;
//--------------------------------
//<00>Qb_n0q_
let path = GetCurrentScriptDirectory() ~ "Effect02.png";
let objShadow = ObjPrim_Create(OBJ_SPRITE_2D); //2D<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0ub
Obj_SetRenderPriorityI(objShadow, 25); //<00>c;u*QHQ<48>^<5E>0-<2D><>[
ObjPrim_SetTexture(objShadow, path); //<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0-<2D><>[
ObjRender_SetBlendType(objShadow, BLEND_MULTIPLY);
ObjSprite2D_SetSourceRect(objShadow, 1, 1, 255, 255); //<00>c;uCQ-<2D><>[(44, 54)-(71,105)
ObjSprite2D_SetDestCenter(objShadow);
ObjRender_SetScaleXYZ(objShadow, 1.2, 1.2, 0);
//--------------------------------
//<00>Q<EFBFBD>Q
let objInnerC = ObjPrim_Create(OBJ_PRIMITIVE_2D);
Obj_SetRenderPriorityI(objInnerC, priEffectMax + 1);
ObjPrim_SetTexture(objInnerC, renderTexture);
ObjPrim_SetVertexCount(objInnerC, 6 * circleVertexCount * innerCircleCount);
//<00>QY^<5E><>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>g
let objOuterC = ObjPrim_Create(OBJ_PRIMITIVE_2D);
Obj_SetRenderPriorityI(objOuterC, priEffectMax + 1);
ObjPrim_SetTexture(objOuterC, renderTexture); //<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0-<2D><>[
ObjPrim_SetVertexCount(objOuterC, 3 * circleVertexCount);
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>gY<>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0
let objOuterE = ObjPrim_Create(OBJ_SPRITE_LIST_2D);
Obj_SetRenderPriorityI(objOuterE, priEffectMax + 1);
ObjPrim_SetTexture(objOuterE, renderTexture); //<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0-<2D><>[
//<00>0<EFBFBD>0n0<6E>0<EFBFBD>0<EFBFBD>0L00k0j0<6A>0~0g0<67>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0K0Q0<51>00
let objEnemy = GetEnemyBossObjectID[0];
while(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) > 0)
{
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0JS<4A>_
effectRadius = baseEffectRadius + outerFluct * sin(frame*4);
let enemyX = ObjMove_GetX(objEnemy); //ue<75>^jX
let enemyY = ObjMove_GetY(objEnemy); //ue<75>^jY
let circleLeft = enemyX - effectRadius + frameLeft; //<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>Qn0<6E>]<5D>z
let circleRight = enemyX + effectRadius + frameLeft; //<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>Qn0<6E>S<EFBFBD>z
let circleTop = enemyY - effectRadius + frameTop; //<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>Qn0
N<EFBFBD>z
let circleBottom = enemyY + effectRadius + frameTop; //<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>Qn0 N<>z
//--------------------------------
//*QHQ<48>^20^<5E>28(̀of)<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0(un0<6E>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0k0<6B>c;u
RenderToTextureA1(renderTexture, priEffectMin, priEffectMax, true);
//--------------------------------
//q_
ObjRender_SetPosition(objShadow, enemyX, enemyY, 0);
//--------------------------------
//<00>Q<EFBFBD>Q
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>Q<EFBFBD>Q<EFBFBD>0<EFBFBD>c;u
//<00>0<EFBFBD>0D0g0D0<44>0<EFBFBD><30>R
ObjRender_SetPosition(objInnerC, -frameLeft, -frameTop, 0);
ascent(let iPosI in 0 .. circleVertexCount)
{
let xyOldRadius = 0;
ascent(let iCircle in 0 .. innerCircleCount)
{
let vertexIndex = (iPosI * innerCircleCount + iCircle) * 6;
let angle1 = iPosI * (360 / circleVertexCount);
let angle2 = (iPosI + 1) * (360 / circleVertexCount);
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0n0UV<00>^j
let uvRadius1 = iCircle * effectRadius / innerCircleCount;
let uvRadius2 = (iCircle + 1) * effectRadius / innerCircleCount;
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0n0UV<00>^jh0<68>c;uHQn0XY<00>^j<>0 YSU0[0<>0S0h0g0<67>0<EFBFBD>0N0<4E>0h<30><68>sY0<59>0
let xyRadius1t = iCircle * effectRadius / innerCircleCount;
let xyRadius2t = (iCircle + 1) * effectRadius / innerCircleCount;
let xyRadius1 = xyOldRadius;
let xyBias = (xyRadius2t - xyRadius1t) / 2 + (xyRadius2t - xyRadius1t) * sin(frame*16 + (iCircle * 360 / innerCircleCount)) / 4;
let xyRadius2 = xyRadius2t + xyBias / ((innerCircleCount - iCircle + 1) / 2);
xyOldRadius = xyRadius2;
if(iCircle == innerCircleCount - 1)
{
xyRadius2 = uvRadius2;
}
//
N<18>n0<02><>p<EFBFBD>^j<>0-<2D><>[
let leftBias = enemyX + frameLeft;
let topBias = enemyY + frameTop;
ObjPrim_SetVertexPosition(objInnerC, vertexIndex , leftBias + xyRadius1 * cos(angle1), topBias + xyRadius1 * sin(angle1), 0);
ObjPrim_SetVertexPosition(objInnerC, vertexIndex+1, leftBias + xyRadius2 * cos(angle1), topBias + xyRadius2 * sin(angle1), 0);
ObjPrim_SetVertexPosition(objInnerC, vertexIndex+2, leftBias + xyRadius1 * cos(angle2), topBias + xyRadius1 * sin(angle2), 0);
ObjPrim_SetVertexPosition(objInnerC, vertexIndex+3, leftBias + xyRadius1 * cos(angle2), topBias + xyRadius1 * sin(angle2), 0);
ObjPrim_SetVertexPosition(objInnerC, vertexIndex+4, leftBias + xyRadius2 * cos(angle1), topBias + xyRadius2 * sin(angle1), 0);
ObjPrim_SetVertexPosition(objInnerC, vertexIndex+5, leftBias + xyRadius2 * cos(angle2), topBias + xyRadius2 * sin(angle2), 0);
ObjPrim_SetVertexUVT(objInnerC, vertexIndex , leftBias + uvRadius1 * cos(angle1), topBias + uvRadius1 * sin(angle1));
ObjPrim_SetVertexUVT(objInnerC, vertexIndex+1, leftBias + uvRadius2 * cos(angle1), topBias + uvRadius2 * sin(angle1));
ObjPrim_SetVertexUVT(objInnerC, vertexIndex+2, leftBias + uvRadius1 * cos(angle2), topBias + uvRadius1 * sin(angle2));
ObjPrim_SetVertexUVT(objInnerC, vertexIndex+3, leftBias + uvRadius1 * cos(angle2), topBias + uvRadius1 * sin(angle2));
ObjPrim_SetVertexUVT(objInnerC, vertexIndex+4, leftBias + uvRadius2 * cos(angle1), topBias + uvRadius2 * sin(angle1));
ObjPrim_SetVertexUVT(objInnerC, vertexIndex+5, leftBias + uvRadius2 * cos(angle2), topBias + uvRadius2 * sin(angle2));
}
}
//--------------------------------
//<00>QY^<5E><>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>g
//<00>c<EFBFBD>0D0g0D0<44>0<EFBFBD>Qn0YtPK0<4B>0<EFBFBD>wb_~0g0<67>0<EFBFBD>W<EFBFBD>0<EFBFBD>0
ObjRender_SetPosition(objOuterC, -frameLeft, -frameTop, 0);
ascent(let iPosO in 0 .. circleVertexCount)
{
let angle1 = iPosO * (360 / circleVertexCount);
let angle2 = (iPosO + 1) * (360 / circleVertexCount);
let rectX = 0;
let rectY = 0;
if(angle1 >= 0 && angle1 < 90)
{
rectX = circleRight;
rectY = circleBottom;
}
else if(angle1 >= 90 && angle1 < 180)
{
rectX = circleLeft;
rectY = circleBottom;
}
else if(angle1 >= 180 && angle1 < 270)
{
rectX = circleLeft;
rectY = circleTop;
}
else if(angle1 >= 270 && angle1 < 360)
{
rectX = circleRight;
rectY = circleTop;
}
let vertexIndex = iPosO * 3;
ObjPrim_SetVertexPosition(objOuterC, vertexIndex, enemyX + effectRadius * cos(angle1) + frameLeft, enemyY + effectRadius * sin(angle1) + frameTop, 0);
ObjPrim_SetVertexPosition(objOuterC, vertexIndex+1, rectX, rectY, 0);
ObjPrim_SetVertexPosition(objOuterC, vertexIndex+2, enemyX + effectRadius * cos(angle2) + frameLeft, enemyY + effectRadius * sin(angle2) + frameTop, 0);
ObjPrim_SetVertexUVT(objOuterC, vertexIndex, enemyX + effectRadius * cos(angle1) + frameLeft, enemyY + effectRadius * sin(angle1) + frameTop);
ObjPrim_SetVertexUVT(objOuterC, vertexIndex+1, rectX, rectY);
ObjPrim_SetVertexUVT(objOuterC, vertexIndex+2, enemyX + effectRadius * cos(angle2) + frameLeft, enemyY + effectRadius * sin(angle2) + frameTop);
}
//--------------------------------
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>gY
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>gYn0̀of<6F>0<EFBFBD>c;uY0<59>0
ObjSpriteList2D_ClearVertexCount(objOuterE);
ObjRender_SetPosition(objOuterE, -frameLeft, -frameTop, 0);
ObjSpriteList2D_SetSourceRect(objOuterE, frameLeft, frameTop, frameRight, circleTop + 1);
ObjSpriteList2D_SetDestRect(objOuterE, frameLeft, frameTop, frameRight, circleTop + 1);
ObjSpriteList2D_AddVertex(objOuterE);
ObjSpriteList2D_SetSourceRect(objOuterE, frameLeft, circleTop, circleLeft + 1, circleBottom);
ObjSpriteList2D_SetDestRect(objOuterE, frameLeft, circleTop, circleLeft + 1, circleBottom);
ObjSpriteList2D_AddVertex(objOuterE);
ObjSpriteList2D_SetSourceRect(objOuterE, circleRight, circleTop, frameRight, circleBottom);
ObjSpriteList2D_SetDestRect(objOuterE, circleRight, circleTop, frameRight, circleBottom);
ObjSpriteList2D_AddVertex(objOuterE);
ObjSpriteList2D_SetSourceRect(objOuterE, frameLeft, circleBottom, frameRight, frameBottom);
ObjSpriteList2D_SetDestRect(objOuterE, frameLeft, circleBottom, frameRight, frameBottom);
ObjSpriteList2D_AddVertex(objOuterE);
frame++;
yield;
}
//<00>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0(u<>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0JRd<52>
Obj_Delete(objInnerC);
Obj_Delete(objOuterC);
Obj_Delete(objOuterE);
Obj_Delete(objShadow);
ClearInvalidRenderPriority();
}