Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #TouhouDanmakufu[Single]
- #ScriptVersion[3]
- #Title["Test script"]
- #Text["EX Rumia's First Spell Card : Star Sign?Midnight Reverie?"]
- #Image["./img/ExRumia(???????????????).png"]
- #Background["script/default_system/Default_Background_IceMountain1.txt"]
- #include"script/Project/Cutin.txt"
- #include"script/Project/Shot/ZUNShot_Const.txt"
- #include"script/default_system/Default_Effect.txt"
- #include"script/Project/Render.txt"
- let objEnemy;
- let score = 0;
- let fail = 0;
- let frame2 = 0;
- let frame = 0;
- let angle = 0;
- let objScene = GetEnemyBossSceneObjectID();
- let spellcard = "script/Project/se/se_cat00.wav";
- let Cutimg = "script/Project/CutKesima.png";
- let shot = "script/Project/se/heart.wav";
- let bConcentrationMotion = true;
- @Initialize
- {
- // CreateCommonDataArea("SpellFunctions");
- // LoadCommonDataAreaA1("SpellFunctions");
- objEnemy = ObjEnemy_Create(OBJ_ENEMY_BOSS);
- ObjEnemy_Regist(objEnemy);
- ObjEnemy_SetDamageRate(objEnemy, 100, 10);//Sets damage rate to 10%
- TRender(1);
- LoadSound(shot);
- LoadSound(spellcard);
- PlaySE(spellcard);
- TEnd;
- CutInS1(objEnemy, "BYAKUREN","Silient Breeze",Cutimg, 0, 0, 300, 400);
- ObjEnemyBossScene_StartSpell(objScene);
- DeleteShotAll(TYPE_ALL, TYPE_ITEM);//Removes all enemy bullets upon appearance
- let GetCenterY = GetStgFrameHeight() / 2;
- let GetCenterX = GetStgFrameWidth() / 2;//defines the variable cx as the horizontal middle of the stage. (Stage width / 2)
- ObjMove_SetDestAtFrame(objEnemy, GetCenterX, 120, 60);
- }
- @MainLoop
- {
- let px = GetPlayerX();
- let py = GetPlayerY();
- let GetX = ObjMove_GetX(objEnemy);
- let GetY = ObjMove_GetY(objEnemy);
- ObjEnemy_SetIntersectionCircleToShot(objEnemy, GetX, GetY, 32);//Sets the hitbox against player bullets
- ObjEnemy_SetIntersectionCircleToPlayer(objEnemy, GetX, GetY, 24);//Sets the hitbox against the player
- score = ObjEnemyBossScene_GetInfo(objScene,INFO_SPELL_SCORE);
- let angleToPlayer = atan2(py - GetY, px - GetX);
- frame++;
- frame2++;
- angle++;
- yield;
- if(frame==-120){
- loop(5){
- CreateShotA1(GetX,GetY,2,-angle,402,10);
- CreateShotA1(GetX,GetY,2,angle,401,10);
- angle +=360/5;
- }
- PlaySE(shot);
- frame = 100;
- }
- if(frame2==120){
- ObjMove_SetDestAtFrame(objEnemy, GetCenterX+rand(-150,150), GetY, 60);
- frame2 = 0;
- }
- if(ObjEnemyBossScene_GetInfo(objScene,INFO_PLAYER_SPELL_COUNT)>=1){
- fail = 1;
- }
- if(fail==1){
- score = 0;
- }
- }
- @Event
- {
- alternative(GetEventType())
- case(EV_REQUEST_LIFE)
- {
- SetScriptResult(500);//Sets the life to 1500
- }
- case(EV_REQUEST_TIMER)
- {
- SetScriptResult(90);//Sets the time limit to 60
- }
- case(EV_REQUEST_SPELL_SCORE)
- {
- SetScriptResult(100000);//Sets spellcard bonus to 30000 points
- }
- }
- //And other enemy controllers
- //----------------------------------------------------
- //End Standby tasks
- //----------------------------------------------------
- task TEnd
- {
- while(ObjEnemy_GetInfo(objEnemy, INFO_LIFE) > 0)
- {
- yield;
- }
- AddScore(score);
- let GetX = ObjMove_GetX(objEnemy);
- let GetY = ObjMove_GetY(objEnemy);
- TExplosionA(GetX, GetY, 10, 0.6);
- loop(30){yield;}
- Obj_Delete(objEnemy);
- CloseScript(GetOwnScriptID());
- DeleteShotAll(TYPE_ALL, TYPE_ITEM);//Removes all enemy bullets
- //When making plural scripts,
- //Deleting the enemy allows the plural script to proceed on to the next script.
- //Do not forget to delete the enemy.
- DeleteShotAll(TYPE_ALL, TYPE_ITEM);//Removes all enemy bullets
- loop(30){yield;}
- //Please close the script at the end
- CloseScript(GetOwnScriptID());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement