Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #TouhouDanmakufu[Single]
- #ScriptVersion[3]
- #Title["004 pastebin edit"]
- #Text[""]
- //#Image[]
- //#BGM["./whatever.mp3"]
- #include "script/default_system/Default_ShotConst.txt"
- let objBoss;
- let objScene = GetEnemyBossSceneObjectID();
- let frame = -60;
- let angleT = 0;
- @Event {
- alternative(GetEventType())
- case(EV_REQUEST_LIFE) {
- SetScriptResult(500);
- }
- case(EV_REQUEST_TIMER) {
- SetScriptResult(60);
- }
- case(EV_REQUEST_SPELL_SCORE) {
- SetScriptResult(15000);
- }
- }
- @Initialize {
- objBoss = ObjEnemy_Create(OBJ_ENEMY_BOSS);
- ObjEnemy_Regist(objBoss);
- ObjMove_SetDestAtFrame(objBoss, GetCenterX(), 60, 30);
- ObjEnemyBossScene_StartSpell(objScene);
- TDrawLoop;
- TFinalize;
- }
- @MainLoop {
- ObjEnemy_SetIntersectionCircleToShot(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 32);
- ObjEnemy_SetIntersectionCircleToPlayer(objBoss, ObjMove_GetX(objBoss), ObjMove_GetY(objBoss), 24);
- frame++;
- if (frame % 12 == 0) {
- fire;
- }
- yield;
- }
- //-----------------------------------------------------------------------------------------------------------------------
- task fire{
- if(ObjEnemy_GetInfo(objBoss, INFO_LIFE) <= 0) {
- return;
- } //Default kill to prevent (0,0) spawning
- let bulletmult = 3;
- loop (bulletmult) {
- let objShot1 = CreateShotA2(ObjMove_GetX(objBoss) + 40 * cos(angleT), ObjMove_GetY(objBoss) + 40 * sin(angleT), 0.6, angleT, (0.2/60), 1.1, DS_BALL_S_RED, 20);
- ObjMove_SetAngularVelocity(objShot1, 0.4);
- BulletCommands1(objShot1);
- angleT += 360/bulletmult;
- }
- angleT += 19.1;
- }
- task BulletCommands1(obj){
- wait(120);
- ObjShot_SetGraphic(obj, DS_BALL_S_BLUE);
- ObjMove_SetAngularVelocity(obj, -0.4);
- wait(200);
- ObjShot_SetGraphic(obj, DS_BALL_S_RED);
- ObjMove_SetAngularVelocity(obj, 0.4);
- }
- task TDrawLoop {
- let imgExRumia = GetCurrentScriptDirectory() ~ "ExRumia.png";
- ObjPrim_SetTexture(objBoss, imgExRumia);
- ObjSprite2D_SetSourceRect(objBoss, 64, 1, 127, 64);
- ObjSprite2D_SetDestCenter(objBoss);
- }
- //-----------------------------------------------------------------------------------------------------------------------
- // 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