Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #TouhouDanmakufu[Single]
- #ScriptVersion[3]
- #Title["002 pastebin edit"]
- #Text[""]
- //#Image[]
- //#BGM["./whatever.mp3"]
- #include "script/default_system/Default_ShotConst.txt"
- let objBoss;
- let objScene = GetEnemyBossSceneObjectID();
- let frame = 0;
- let angleT = 22.5;
- @Event {
- alternative(GetEventType())
- case(EV_REQUEST_LIFE) {
- SetScriptResult(500);
- }
- case(EV_REQUEST_TIMER) {
- SetScriptResult(90);
- }
- case(EV_REQUEST_SPELL_SCORE) {
- SetScriptResult(150000);
- }
- }
- @Initialize {
- objBoss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
- ObjEnemy_Regist(objBoss);
- ObjMove_SetDestAtFrame(objBoss, GetCenterX(), 90, 30);
- ObjEnemyBossScene_StartSpell(objScene);
- TDrawLoop;
- TFinalize;
- TDrawDifficulty;
- }
- @MainLoop {
- ObjEnemy_SetIntersectionCircleToShot(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 32);
- ObjEnemy_SetIntersectionCircleToPlayer(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 24);
- frame++;
- if (frame % 60 == 0) {
- fire;
- }
- }
- //-----------------------------------------------------------------------------------------------------------------------
- task fire {
- if(ObjEnemy_GetInfo(objBoss, INFO_LIFE) <= 0) {
- return;
- }
- //Default kill to prevent (0,0) spawning
- loop(7) {
- CreateStraightLaserA1(ObjMove_GetX(objBoss) + 50 * cos(angleT), ObjMove_GetY(objBoss) + 50 * sin(angleT), angleT, 400, 15, 20, DS_BALL_S_RED, 40);
- CreateShotA1(ObjMove_GetX(objBoss) + 60 * cos(angleT), ObjMove_GetY(objBoss) + 60 * sin(angleT), 0.9, angleT, DS_BALL_S_RED, 70);
- CreateShotA1(ObjMove_GetX(objBoss) + 60 * cos(angleT), ObjMove_GetY(objBoss) + 60 * sin(angleT), 0.9, angleT + 10, DS_BALL_S_RED, 70);
- CreateShotA1(ObjMove_GetX(objBoss) + 60 * cos(angleT), ObjMove_GetY(objBoss) + 60 * sin(angleT), 0.9, angleT - 10, DS_BALL_S_RED, 70);
- CreateShotA1(ObjMove_GetX(objBoss) + 60 * cos(angleT), ObjMove_GetY(objBoss) + 60 * sin(angleT), 1.1, angleT + 5, DS_BALL_S_RED, 70);
- CreateShotA1(ObjMove_GetX(objBoss) + 60 * cos(angleT), ObjMove_GetY(objBoss) + 60 * sin(angleT), 1.1, angleT - 5, DS_BALL_S_RED, 70);
- CreateShotA1(ObjMove_GetX(objBoss) + 60 * cos(angleT), ObjMove_GetY(objBoss) + 60 * sin(angleT), 1.3, angleT, DS_BALL_S_RED, 70);
- angleT += 360/7;
- }
- angleT += 14.1;
- }
- task TDrawLoop {
- let imgExRumia = GetCurrentScriptDirectory() ~ "ExRumia.png";
- ObjPrim_SetTexture(objBoss, imgExRumia);
- ObjSprite2D_SetSourceRect(objBoss, 64, 1, 127, 64);
- ObjSprite2D_SetDestCenter(objBoss);
- }
- task TDrawDifficulty {
- let objText = ObjText_Create();
- ObjText_SetText(objText, "Testing");
- ObjText_SetFontSize(objText, 24);
- ObjText_SetFontType(objText, "Revue");
- ObjText_SetFontBold(objText, true);
- ObjText_SetFontColorTop(objText, 255, 255, 255);
- ObjText_SetFontColorBottom(objText, 255, 255, 255);
- ObjText_SetFontBorderType(objText, BORDER_FULL);
- ObjText_SetFontBorderColor(objText, 226, 176, 7);
- ObjText_SetFontBorderWidth(objText, 2);
- Obj_SetRenderPriority(objText, 0.01);
- ObjRender_SetX(objText, 428);
- ObjRender_SetY(objText, 12);
- }
- // funclib copied so it works
- function GetCenterX() {
- return GetStgFrameWidth() / 2;
- }
- function GetCenterY() {
- return GetStgFrameHeight() / 2;
- }
- function wait(n) {
- loop(n) {
- yield;
- }
- }
- function rand_int(min, max) {
- return round(rand(min, max));
- }
- task TFinalize {
- while(ObjEnemy_GetInfo(objBoss, INFO_LIFE) > 0) {
- yield;
- }
- if(ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SHOOTDOWN_COUNT) + ObjEnemyBossScene_GetInfo(objScene, INFO_PLAYER_SPELL_COUNT) == 0) { // this IF and anything in it will cause the spell to actually award score
- AddScore(truncate(ObjEnemyBossScene_GetInfo(objScene, INFO_SPELL_SCORE) / 10) * 10);
- }
- Obj_Delete(objBoss);
- DeleteShotAll(TYPE_ALL, TYPE_IMMEDIATE);
- SetAutoDeleteObject(true);
- CloseScript(GetOwnScriptID());
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement