Advertisement
ZoriaRPG

ZC Secret Triger Cutscene & Goddess Cubes

Nov 14th, 2016
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.99 KB | None | 0 0
  1. const int GODDESS_CUBE_REG = 6;
  2. const int GODDESS_CUBE_REVEAL_TIME = 300;
  3. const int GODDESS_CUBE_SPRITE = 10;
  4. const int GODDESS_CUBE_SPRITE_X = 4;
  5. const int GODDESS_CUBE_SPRITE_Y = 4;
  6.  
  7.  
  8. ffc script GoddessCube{
  9.     void run(int dmap, int screen, int swordlevel){
  10.         int q; lweapon l; lweapon sprite;
  11.         if ( Screen->D[GODDESS_CUBE_REG] ){
  12.             this->Data++; This->Script = 0;
  13.             Quit();
  14.         }
  15.         while(true){
  16.             if ( !Screen->D[GODDESS_CUBE_REG] ) {
  17.                 for ( q = 1; q <= Screen->NumLWeapons(); q++ ) {
  18.                     l = Screen->LoadLWeapon(q);
  19.                     if ( l->ID == LW_SWORD ) {
  20.                         if ( l->Level >= swordlevel ) {
  21.                             if ( Collision(l,this) ){
  22.                                 //mark the reveal on this screen.
  23.                                 Screen->D[GODDESS_CUBE_REG] = 1;
  24.                                 //Animation effect
  25.                                 sprite = Screen->CreateLWeapon(LW_SPARKLE);
  26.                                 sparkle->CollDetection = false;
  27.                                 sparkle->UseSprite(GODDESS_CUBE_SPRITE);
  28.                                 sparkle->X = this->X + GODDESS_CUBE_SPRITE_X ; sparkle->Y = this->Y + GODDESS_CUBE_SPRITE_Y;
  29.                                 Waitframes(sprite->NumFrames);
  30.                                 this->Data++;
  31.                                 //Draw the reveal:
  32.                                
  33.                                 for ( q = 0; q < GODDESS_CUBE_REVEAL_TIME; q++ ) {
  34.                                     Screen->DrawScreen(7, DMapToMap(dmap), screen, 0, 0, 0);
  35.                                     FreezeAllExceptFFCs();
  36.                                     SuspendGhostZH();
  37.                                     WaitNoAction();
  38.                                 }
  39.                                 UnfreezeAll()
  40.                                 ResumeGhostZH();
  41.                             }
  42.                         }
  43.                     }
  44.                 }
  45.             }
  46.             Waitframe();
  47.         }
  48.     }
  49. }
  50.  
  51. ffc script GoddessChest{
  52.     void run(){
  53.         //If the chest is triggered...
  54.         if ( Screen->D[GODDESS_CUBE_REG] ) {
  55.             //if the chest is already opened, and the item taken...
  56.             if ( Screen->State[ST_ITEM] ) {
  57.                 ComboD[ComboAt(this->X,this->Y)] +=2;
  58.                 ComboT[ComboAt(this->X,this->Y)] = 0;
  59.                 ComboS[ComboAt(this->X,this->Y)] = 4;
  60.             }
  61.             //if the chest is unopened...
  62.             else { //make the chest
  63.                 ComboD[ComboAt(this->X,this->Y)]++;
  64.                 ComboT[ComboAt(this->X,this->Y)] = CT_CHEST;
  65.                 ComboS[ComboAt(this->X,this->Y)] = 4;
  66.             }
  67.         }
  68.     }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement