Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #TouhouDanmakufu[Player]
- #Menu[Kirisame Marisa]
- #Text[Ordinary Magician
- (Speed Type)
- Speed: Fast
- Normal Shot: Illusion Laser
- Focus Shot: Magic Missile
- Spellcard: Love Sign "Master Spark"
- Seal Attack: Reduces Extra Danmaku. Lasts 8 Seconds]
- #ReplayName[Marisa]
- #Image[]
- #ScriptVersion[2]
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////
- script_player_main
- {
- //Variables
- /*** *** *** General *** *** ***/
- let CSD = GetCurrentScriptDirectory;
- let ShotData = CSD ~ "MarisaShot.txt";
- /*** *** *** Image Var *** *** ***/
- let ImgPlayer = CSD ~ "pl00.png";
- let ImgBullet = CSD ~ "MarisaShot.png";
- let imgba = CSD ~ "SealEffect.png";
- let ReimuX = [0,32,64,96,128,160,192,224,0,32,64,96,128,160,192,224,0,32,64,96,128,160,192,224];
- let ReimuY = [0,0,0,0,0,0,0,0,48,48,48,48,48,48,48,48,96,96,96,96,96,96,96,96];
- let ReimuPose = 0;
- let ReimuFrame = 0;
- /*** *** *** Control Var *** *** ***/
- let rcount = 0; //Rotation
- let count = -1;
- let fcount = -1; //Frame Counter
- let scount = 600; //Seal Counter
- let IsLaserExists = false;
- /*** *** *** Common Data *** *** ***/
- SetCommonData("SealCounter", GetCommonDataDefault("SealCounter", 0));
- SetCommonData("SealStatus", false);
- /*** *** ** Functions *** *** ***/
- function FindAngle(X1, Y1, X2, Y2) {return (atan2(Y2-Y1, X2-X1));}
- task DrawOption (x, y)
- {
- SetRenderState(ADD);
- SetGraphicAngle(0, 0, rcount*-5);
- SetGraphicScale(1.5, 1.5);
- DrawGraphic(x, y);
- SetRenderState(ALPHA);
- SetGraphicAngle(0, 0, rcount*5);
- SetGraphicScale(1, 1);
- DrawGraphic(x, y);
- }
- /*** *** *** Main Shot *** *** ***/
- task BlackOut(long){
- let id = Obj_Create(OBJ_EFFECT);
- let sca = 0;
- let alpha = 150;
- let rgb = [0,0,0];
- let die = 0;
- ObjEffect_SetTexture(id,imgba);
- ObjEffect_SetRenderState(id,ALPHA);
- ObjEffect_SetPrimitiveType(id,PRIMITIVE_TRIANGLESTRIP);
- ObjEffect_SetLayer(id,0);
- ObjEffect_CreateVertex(id,4);
- ObjEffect_SetVertexXY(id,0,400/-2,400/-2);
- ObjEffect_SetVertexXY(id,1,400/-2,400/2);
- ObjEffect_SetVertexXY(id,2,400/2,400/-2);
- ObjEffect_SetVertexXY(id,3,400/2,400/2);
- ObjEffect_SetVertexUV(id,0,0,0);
- ObjEffect_SetVertexUV(id,1,0,400);
- ObjEffect_SetVertexUV(id,2,400,0);
- ObjEffect_SetVertexUV(id,3,400,400);
- loop{
- die++;
- if(sca<3){sca+=0.05;}
- Obj_SetPosition(id,GetPlayerX,GetPlayerY);
- ObjEffect_SetScale(id,sca,sca);
- ObjEffect_SetVertexColor(id,0,alpha,rgb[0],rgb[1],rgb[2]);
- ObjEffect_SetVertexColor(id,1,alpha,rgb[0],rgb[1],rgb[2]);
- ObjEffect_SetVertexColor(id,2,alpha,rgb[0],rgb[1],rgb[2]);
- ObjEffect_SetVertexColor(id,3,alpha,rgb[0],rgb[1],rgb[2]);
- if(die>long){
- if(alpha>0){alpha-=15;}
- if(alpha<=0){Obj_Delete(id);}
- }
- yield;
- }
- }
- ///////////////////////////////////////////////////////////////////////////////
- @Initialize
- {
- LoadGraphic(ImgPlayer);
- LoadGraphic(ImgBullet);
- LoadGraphic(imgba);
- LoadPlayerShotData(ShotData);
- SetSpeed(5,2.5);
- }
- ///////////////////////////////////////////////////////////////////////////////
- @MainLoop
- {
- SetIntersectionCircle(GetPlayerX, GetPlayerY, 0);
- /*** *** *** Fire Logic *** *** ***/
- if(GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD && count == -1)
- {
- count = 0;
- }
- if(GetKeyState(VK_SHOT) == KEY_PUSH || GetKeyState(VK_SHOT) == KEY_HOLD && fcount == -1)
- {
- fcount = 0;
- }
- if(count >=0) {count++;}
- if(fcount >=0) {fcount++;}
- //Main Shot
- if(count == 5)
- {
- CreatePlayerShot01(GetPlayerX - 45, GetPlayerY + 5, 30, 260, 0.02, 100, 3);
- CreatePlayerShot01(GetPlayerX + 25, GetPlayerY + 30, 30, 270, 0.02, 100, 3);
- CreatePlayerShot01(GetPlayerX - 25, GetPlayerY + 30, 30, 270, 0.02, 100, 3);
- CreatePlayerShot01(GetPlayerX + 45, GetPlayerY + 5, 30, 280, 0.02, 100, 3);
- count = -1;
- }
- if((GetKeyState(VK_SHOT) == KEY_FREE)){fcount = -1;}
- /*** *** *** Drawing Logic *** *** ***/
- if(GetKeyState(VK_LEFT) == KEY_HOLD || GetKeyState(VK_RIGHT) == KEY_HOLD)
- {ReimuFrame += 1;}
- else
- {ReimuFrame += 1.75;}
- rcount++;
- /*** *** *** Seal Logic *** *** ***/
- if(GetKeyState(VK_USER) == KEY_PUSH && GetPlayerBomb >= 2 && GetCommonData("SealStatus") == false)
- {
- AddBomb(-2);
- SetCommonData("SealStatus", true);
- DeleteEnemyShot(ALL);
- BlackOut(600);
- }
- if(GetCommonData("SealStatus") == true)
- {
- scount--;
- }
- if(scount == 0)
- {
- SetCommonData("SealStatus", false);
- scount = 600;
- }
- yield;
- }
- ///////////////////////////////////////////////////////////////////////////////
- @DrawLoop
- {
- /*** *** *** Reimu Graphics *** *** ***/
- SetTexture(ImgPlayer);
- SetRenderState(ALPHA);
- if(GetKeyState(VK_RIGHT)==KEY_PUSH || GetKeyState(VK_RIGHT)==KEY_HOLD){
- if(ReimuFrame>=4){ReimuPose++;ReimuFrame=0;}
- if(ReimuPose==24){
- ReimuPose=20;
- } else if(ReimuPose<16||ReimuPose>24){
- ReimuPose=16;
- }
- }else if(GetKeyState(VK_LEFT)==KEY_PUSH || GetKeyState(VK_LEFT)==KEY_HOLD){
- if(ReimuFrame>=4){ReimuPose++;ReimuFrame=0;}
- if(ReimuPose==16){
- ReimuPose=12;
- } else if(ReimuPose<8||ReimuPose>16){
- ReimuPose=8;
- }
- }else{
- if(ReimuFrame>=8){ReimuPose++;ReimuFrame=0;}
- if(ReimuPose>=8){
- ReimuPose=0;
- }
- }
- if(ReimuPose>=32){ReimuPose=0};
- SetGraphicRect(ReimuX[ReimuPose],ReimuY[ReimuPose],ReimuX[ReimuPose]+32, ReimuY[ReimuPose]+48);
- SetGraphicAngle(0, 0, 0);
- DrawGraphic(GetPlayerX, GetPlayerY);
- /*** *** *** Options *** *** ***/
- SetTexture(ImgPlayer);
- SetGraphicRect(86, 148, 102, 164);
- DrawOption (GetPlayerX + 25, GetPlayerY + 30);
- DrawOption (GetPlayerX + 45, GetPlayerY + 5);
- DrawOption (GetPlayerX - 25, GetPlayerY + 30);
- DrawOption (GetPlayerX - 45, GetPlayerY + 5);
- }
- ///////////////////////////////////////////////////////////////////////////////
- @SpellCard
- {
- UseSpellCard("FantasySeal", 0);
- }
- ///////////////////////////////////////////////////////////////////////////////
- @Missed
- {
- }
- ///////////////////////////////////////////////////////////////////////////////
- @Finalize
- {
- }
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- #PlayerShotData
- ShotImage = ".\pl00.png"
- ShotData
- {
- //Main Shot
- id = 1
- rect = (68,148,82,180)
- render = ADD
- alpha = 255
- }
- ShotData
- {
- //Magic Missile
- id = 2
- rect = (88,148,104,180)
- render = ADD
- alpha = 255
- }
- ShotData
- {
- //Laser
- id = 3
- rect = (256, 0, 270, 316)
- render = ADD
- alpha = 200
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement