Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #TouhouDanmakufu[Single]
- #ScriptVersion[3]
- #Title["Rumia's Wall crush"]
- #Text["WIP"]
- #include "script/default_system/Default_ShotConst.txt"
- let objBoss;
- let count = 0;
- @Event{
- alternative(GetEventType())
- case(EV_REQUEST_LIFE){
- SetScriptResult(2000);
- }
- case(EV_REQUEST_TIMER){
- SetScriptResult(60);
- }
- case(EV_REQUEST_SPELL_SCORE){
- SetScriptResult(1000000);
- }
- }
- @Initialize{
- objBoss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
- ObjEnemy_Regist(objBoss);
- let imgExRumia = GetCurrentScriptDirectory() ~ "ExRumia.png";
- ObjPrim_SetTexture(objBoss, imgExRumia);
- ObjSprite2D_SetSourceRect(objBoss, 64, 1, 127, 64);
- ObjSprite2D_SetDestCenter(objBoss);
- ObjMove_SetDestAtFrame(objBoss, GetCenterX(), 60, 60);
- TFinalize;
- Laser;
- }
- @MainLoop{
- ObjEnemy_SetIntersectionCircleToShot(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 32);
- ObjEnemy_SetIntersectionCircleToPlayer(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 24);
- if(count % 30 == 0){
- fire;
- }
- count++;
- yield;
- }
- task fire{
- if(ObjEnemy_GetInfo(objBoss, INFO_LIFE) <= 0){return;} //Default kill to prevent (0,0) spawning
- let angleT = GetAngleToPlayer(objBoss);
- CreateStraightLaserA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), GetAngleToPlayer(objBoss), 512, 20, 60, 1002, 60);
- CreateShotA1(380, 90, 2, 180, DS_BALL_S_RED, 50);
- CreateShotA1(380, 110, 2, 180, DS_BALL_S_RED, 50);
- CreateShotA1(380, 130, 2, 180, DS_BALL_S_RED, 50);
- CreateShotA1(380, 150, 2, 180, DS_BALL_S_RED, 50);
- CreateShotA1(380, 170, 2, 180, DS_BALL_S_RED, 50);
- CreateShotA1(380, 190, 2, 180, DS_BALL_S_RED, 50);
- CreateShotA1(380, 210, 2, 180, DS_BALL_S_RED, 50);
- CreateShotA1(380, 230, 2, 180, DS_BALL_S_RED, 50);
- CreateShotA1(380, 250, 2, 180, DS_BALL_S_RED, 50);
- CreateShotA1(0, 80, -2, -180, DS_BALL_S_RED, 50);
- CreateShotA1(0, 100, -2, -180, DS_BALL_S_RED, 50);
- CreateShotA1(0, 120, -2, -180, DS_BALL_S_RED, 50);
- CreateShotA1(0, 140, -2, -180, DS_BALL_S_RED, 50);
- CreateShotA1(0, 160, -2, -180, DS_BALL_S_RED, 50);
- CreateShotA1(0, 180, -2, -180, DS_BALL_S_RED, 50);
- CreateShotA1(0, 200, -2, -180, DS_BALL_S_RED, 50);
- CreateShotA1(0, 220, -2, -180, DS_BALL_S_RED, 50);
- CreateShotA1(0, 240, -2, -180, DS_BALL_S_RED, 50);
- }
- task TFinalize {
- while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0){yield;}
- Obj_Delete(objBoss);
- DeleteShotAll(TYPE_ALL, TYPE_IMMEDIATE);
- SetAutoDeleteObject(true);
- CloseScript(GetOwnScriptID());
- return;
- }
- task Laser {
- let angleT = 0; //Base angle faces directly right
- loop(6){ //A ring of 6 lasers
- let obj = CreateStraightLaserA1(ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), angleT, 512, 24, 20, 1003, 60);
- ObjStLaser_SetSource(obj, false); //Do not show the laser source
- ObjLaser_SetGrazeInvalidFrame(obj, 5); //Allows for up to 1 graze each 5 frames
- ObjLaser_SetInvalidLength(obj, 5, 5); //5 percent of each end of the laser is safe
- angleT += 360/6; //Increments by 60 degrees clockwise each time the block is run
- }
- }
- function GetCenterX(){
- return GetStgFrameWidth() / 2;
- }
- function GetCenterY(){
- return GetStgFrameHeight() / 2;
- }
- function wait(n){
- loop(n){yield;}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement