Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- anim { "enemy.anm"; "stgenm01.anm"; }
- ecli { "default.ecl"; }
- #define ExampleMacro 10.0f
- //Note: you cannot have a comment on the same line as code at the moment!
- //=========================================================================================================================================
- // BOSS START
- //=========================================================================================================================================
- sub Boss()
- {
- var A;
- //Create the boss using script 0 from anm 2 (stgenm01.anm), and have it run Boss1()
- boss 2 0 "Boss1";
- destruct();
- }
- //=========================================================================================================================================
- // NONSPELL ONE
- //=========================================================================================================================================
- sub Boss1()
- {
- var angle count add fspeed accel time color wait1 wait2 rang ringcount cfspeed arclayers;
- //Set the spell counter (the stars in the corner)
- setRemainingSpells(4);
- //Set the life bar amount
- setLife(7500);
- //Set up this "step" of attacks
- new attacklist
- {
- //Add an attack using Boss1Card(), and have it start when the life drops below 1500 or 45 seconds have counted down, and use an orangeish color for its healthbar section
- attack 1500 45 Boss1Card argb(255,255,128,0);
- }
- //just a built in macro that sets this sub up as a nonspell
- nonspell;
- //Vars
- //A nifty function that sets a variable to a different value depending on the difficulty (int value; use setByDifficultyf for float values)
- setByDifficulty($count, 10, 11, 13, 15);
- setByDifficulty($time, 2, 1, 1, 1);
- setByDifficulty($wait1, 70, 60, 50, 40);
- setByDifficulty($wait2, 40, 35, 30, 30);
- setByDifficulty($ringcount, 18, 20, 22, 24);
- setByDifficulty($arclayers, 2, 2, 3, 3);
- //add = 1.2f / count
- 1.2f;
- float($count);
- dividef();
- movef(%add);
- //Push different values on the stack depending on the difficulty
- !E
- 5.0f;
- !N
- 5.2f;
- !H
- 5.4f;
- !L
- 5.6f;
- !ENHL
- float($count);
- dividef();
- movef(%accel);
- //Shots
- //Define a shot type
- new shot 0
- {
- //Shoots one shot, once
- count = 1 1;
- offset = 0.0f 0.0f;
- //Just fire a straight line at whatever angle it's set to
- aim = NORMAL;
- angle = 0.0f;
- //Use kunai color 0 (KUNAI is just a constant specific to shot definitions and setShotAppearance, it won't work anywhere else)
- graphic = KUNAI 0;
- speed = 3.0f;
- }
- new shot 1
- {
- //Shoots 4 shots if the difficulty is EASY, 4 if it's NORMAL, 6 if it's HARD, or 7 if it's LUNATIC, but only fire them once no matter the difficulty
- count = 4 5 6 7 1 1 1 1;
- offset = 0.0f 0.0f;
- //Fire a circle instead of a line
- aim = NORMAL_CIRCLE;
- angle = 0.0f;
- graphic = KUNAI 1;
- //Set the speed to 1.8 if the difficulty is EASY, 2.0 if it's NORMAL, 2.2 if it's HARD, or 2.4 if it's LUNATIC
- speed = 1.8f 2.0f 2.2f 2.4f;
- }
- new shot 2
- {
- count = 4 5 6 7 1 1 1 1;
- offset = 0.0f 0.0f;
- aim = NORMAL_CIRCLE;
- angle = 0.0f;
- graphic = KUNAI 2;
- speed = 1.8f 2.0f 2.2f 2.4f;
- }
- //Script
- //Infinite loops, yay
- loop -1 mainLoop
- //Charge effect
- charge();
- wait($wait1);
- this.angleToPlayer;
- float($count);
- 2.0f;
- dividef();
- int([-1.0f]);
- float([-1]);
- %add;
- multiplyf();
- subtractf();
- movef(%angle);
- %fspeed = 1.0f;
- $color = 0;
- //Finite loops, yay
- loop $count arcLoop
- shotSetAngle(0, %angle);
- shotSetSpeed(0, %fspeed);
- shotSetAppearance(0, FIREBALL_RED, 0);
- shotFire(0);
- shotSetAppearance(0, KUNAI, $color);
- shotFire(0);
- %cfspeed = %fspeed;
- loop $arclayers arcLayerLoop
- %fspeed -= 0.15f;
- shotSetSpeed(0, %fspeed);
- shotSetAppearance(0, FIREBALL_RED, 0);
- shotFire(0);
- shotSetAppearance(0, KUNAI, $color);
- shotFire(0);
- endloop arcLayerLoop
- %fspeed = %cfspeed;
- %angle += %add;
- %fspeed += %accel;
- $color;
- 1;
- add();
- 3;
- mod();
- move($color);
- wait($time);
- endloop arcLoop
- //Moves in a random direction within the set movement field
- bossMove(30, 4, 8.0f);
- wait($wait2);
- this.angleToPlayer;
- float($count);
- 1.5f;
- dividef();
- int([-1.0f]);
- float([-1]);
- %add;
- multiplyf();
- addf();
- movef(%angle);
- %fspeed = 1.0f;
- loop $count arcLoop2
- shotSetAngle(0, %angle);
- shotSetSpeed(0, %fspeed);
- shotSetAppearance(0, FIREBALL_RED, 0);
- shotFire(0);
- shotSetAppearance(0, KUNAI, $color);
- shotFire(0);
- %cfspeed = %fspeed;
- loop $arclayers arcLayerLoop2
- %fspeed -= 0.15f;
- shotSetSpeed(0, %fspeed);
- shotSetAppearance(0, FIREBALL_RED, 0);
- shotFire(0);
- shotSetAppearance(0, KUNAI, $color);
- shotFire(0);
- endloop arcLayerLoop2
- %fspeed = %cfspeed;
- %angle -= %add;
- %fspeed += %accel;
- $color;
- 1;
- add();
- 3;
- mod();
- move($color);
- wait($time);
- endloop arcLoop2
- charge();
- wait(30);
- %rang = randomPi;
- loop $ringcount ringLoop
- shotSetAngle(1, %rang);
- shotSetAppearance(1, FIREBALL_RED, 0);
- shotFire(1);
- shotSetAppearance(1, KUNAI, 1);
- shotFire(1);
- wait(3);
- 0.0f;
- %rang;
- subtractf();
- shotSetAngle(2, [-1.0f]);
- shotSetAppearance(2, FIREBALL_RED, 0);
- shotFire(2);
- shotSetAppearance(2, KUNAI, 2);
- shotFire(2);
- !EN
- %rang += 0.14f;
- !HL
- %rang += 0.1f;
- !ENHL
- wait(1);
- endloop ringLoop
- wait($wait2);
- bossMove(30, 4, 8.0f);
- wait($wait2);
- endloop mainLoop
- exit();
- }
- //=========================================================================================================================================
- // SPELL ONE
- //=========================================================================================================================================
- sub Boss1Card()
- {
- var count add angle1 angle2 n nadd1 nadd2 speed dummy;
- //A built in macro for spells; Tells the game that this is spell #1, the timer should be set to 45, the spell name should be "Spirit Control 'Possessed Coin'" (THTK doesn't like using escaped quotation marks so always use '), and when the spell ends Boss_Dead() should be called. I don't remember what the 5000000 is for but it's needed by the engine; I might abstract it away later on.
- spell 1 45 5000000 "Spirit Control 'Possessed Coin'" Boss_Dead;
- //Vars
- setByDifficulty($count, 30, 34, 38, 45);
- pi(2.0f);
- float($count);
- dividef();
- movef(%add);
- pi(8.0f);
- float($count);
- dividef();
- movef(%nadd1);
- pi(6.0f);
- float($count);
- dividef();
- movef(%nadd2);
- //Shots
- new shot 0
- {
- count = 2 2 3 3 1 1 1 1;
- offset = 0.0f 0.0f;
- aim = NORMAL_CIRCLE;
- angle = 0.0f;
- graphic = KUNAI 0;
- speed = 2.0f;
- //Automated pattern timeline!
- //Accelerate by 0.05 over 40 frames, once, and wait until it's done before continuing.
- pattern : 0 1 ACCELERATE 40 1 0.05f NULLF;
- //Change graphic to 19 and color 0, and continue without waiting.
- pattern : 1 0 CHANGE_GRAPHIC 19 0 NULLF NULLF;
- //Change angle relative to player to 0.0 and change speed to 1.5 every 2 frames, 20 times, and wait until it's done before continuing.
- pattern : 2 1 CHANGE_BY_PLAYER 2 20 0.0f 1.5f;
- //Change graphic to 4 and color 0, and continue without waiting.
- pattern : 3 0 CHANGE_GRAPHIC 4 0 NULLF NULLF;
- //Accelerate by 0.05 over 40 frames, once, and wait until it's done before continuing.
- pattern : 4 0 ACCELERATE 40 1 0.05f NULLF;
- }
- new shot 1
- {
- count = 3 3 4 4 1 1 1 1;
- offset = 0.0f 0.0f;
- aim = NORMAL_CIRCLE;
- angle = 0.0f;
- graphic = KUNAI 1;
- speed = 2.0f;
- pattern : 0 1 ACCELERATE 40 1 0.05f NULLF;
- }
- new shot 2
- {
- count = 4 4 5 5 2 2 2 2;
- offset = 0.0f 0.0f;
- aim = NORMAL_CIRCLE;
- angle = 0.0f;
- graphic = KUNAI 2;
- speed = 2.0f;
- pattern : 0 1 ACCELERATE 40 1 0.04f NULLF;
- }
- new shot 3
- {
- count = 2 2 3 3 1 1 1 1;
- offset = 0.0f 0.0f;
- aim = NORMAL_CIRCLE;
- angle = 0.0f;
- graphic = 19 1;
- speed = 2.0f;
- pattern : 0 1 ACCELERATE 40 1 0.05f NULLF;
- pattern : 1 0 CHANGE_GRAPHIC 19 1 NULLF NULLF;
- pattern : 2 1 CHANGE_BY_PLAYER 2 20 0.0f 1.5f;
- pattern : 3 0 CHANGE_GRAPHIC 19 1 NULLF NULLF;
- pattern : 4 0 ACCELERATE 40 1 0.05f NULLF;
- }
- new shot 4
- {
- count = 3 3 4 4 1 1 1 1;
- offset = 0.0f 0.0f;
- aim = NORMAL_CIRCLE;
- angle = 0.0f;
- graphic = FIREBALL_RED 0;
- speed = 2.0f;
- pattern : 0 1 ACCELERATE 40 1 0.05f NULLF;
- }
- new shot 5
- {
- count = 4 4 5 5 2 2 2 2;
- offset = 0.0f 0.0f;
- aim = NORMAL_CIRCLE;
- angle = 0.0f;
- graphic = FIREBALL_RED 0;
- speed = 2.0f;
- pattern : 0 1 ACCELERATE 40 1 0.04f NULLF;
- }
- //Script
- loop -1 mainLoop
- %angle1 = randomPi;
- %angle2 = randomPi;
- %n = randomPi;
- loop $count circleLoop
- circleXY(%speed, %dummy, %n, 1.5f);
- shotSetSpeed(0, %speed);
- shotSetAngle(0, %angle1);
- shotFire(0);
- shotSetSpeed(3, %speed);
- shotSetAngle(3, %angle1);
- shotFire(3);
- shotSetSpeed(1, %speed);
- shotSetAngle(1, %angle2);
- shotFire(1);
- shotSetSpeed(4, %speed);
- shotSetAngle(4, %angle2);
- shotFire(4);
- %n += %nadd1;
- %angle1 += %add;
- %angle2 -= %add;
- endloop circleLoop
- wait(40);
- doEffect(0, SPIRAL_PINK);
- wait(60);
- %angle1 = randomPi;
- %angle2 = randomPi;
- %n = randomPi;
- loop $count circleLoop2
- circleXY(%speed, %dummy, %n, 1.5f);
- shotSetSpeed(2, %speed);
- shotSetAngle(2, %angle1);
- shotFire(2);
- shotSetSpeed(5, %speed);
- shotSetAngle(5, %angle1);
- shotFire(5);
- shotSetSpeed(1, %speed);
- shotSetAngle(1, %angle2);
- shotFire(1);
- shotSetSpeed(4, %speed);
- shotSetAngle(4, %angle2);
- shotFire(4);
- %n += %nadd2;
- %angle1 += %add;
- %angle2 -= %add;
- endloop circleLoop2
- wait(40);
- endloop mainLoop
- //exit
- exit();
- }
- //=========================================================================================================================================
- // BOSS DEATH
- //=========================================================================================================================================
- sub Boss_Dead()
- {
- var ;
- setFlag(68);
- spellBreak();
- bossDeath();
- destruct();
- }
- //=========================================================================================================================================
- // MAIN
- //=========================================================================================================================================
- sub main()
- {
- var A B C;
- setFlag(16);
- ins_0();
- //wait(60);
- //dialogueStart(0);
- wait(360);
- waitForSubs();
- spawn("Boss", -144.0f, -16.0f, 40, 10000, POWER);
- waitForSubs();
- nextStage();
- //dialogueStart(1);
- //waitForSubs();
- wait(60);
- destruct();
- }
Add Comment
Please, Sign In to add comment