Advertisement
ZoriaRPG

FFC Exta / Additional Secret Items on a Screen

Nov 19th, 2016
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.76 KB | None | 0 0
  1. //Additional Items on a Screen
  2. //v0.2
  3.  
  4. const int KEY_PRIORITY_LEVEL_NORMAL = 0; //Level keys have priority, when using a key.
  5. const int KEY_PRIORITY_NORMAL_LEVEL = 1; //Normal keys have priority, when using a key.
  6.  
  7. const int SFX_SECRET_ITEM = 63;
  8. const int COND_KILL_ALL_ENEMIES = 1;
  9. const int COND_KILL_SPECIFIC_ENEMY = 2;
  10. const int COND_TRIGGERED_BY_ITEM = 3;
  11. const int COND_TRIGGERED_BY_LWEAPON = 4;
  12. const int COND_TRIGGERED_BY_EWEAPON = 5;
  13. const int COND_TRIGGERED_BY_COLLISION = 6;
  14. const int COND_TRIGGERED_BY_COMBO = 7;
  15. const int COND_CHEST_UNLOCKD = 8;
  16. const int COND_CHEST_UNLOCKD_SLASH = 9;
  17. const int COND_CHEST_LOCKED = 10;
  18. const int COND_CHEST_BOSSLOCKED = 11;
  19.  
  20.  
  21.  
  22. const int COLLISION_PAIR_
  23.  
  24. ffc script ExtraItem{
  25.     void run(int condition, int itm, int reg, int dat, int collision_pair, int sfx, int required_pointer, int item_needed_first, int combo){
  26.         bool triggered = false;
  27.         bool ignore_npx = false;
  28.         bool itemCreated = false;
  29.         bool itemTaken = false;
  30.         item i;
  31.         while(true){
  32.             if ( ! triggered ) {
  33.                 if ( condition == COND_KILL_ALL_ENEMIES ) {
  34.                     if ( !Screen->NumNPCs ) triggered = true;
  35.                     for ( int q = 1; q < Screen->NumNPCs(); q++ ) {
  36.                         npc n = Screen->LoadNPC(q);
  37.                         if ( q->Type == NPCT_GUY || q->Type == NPCT_TRAP || q->Type == NPCT_ROCK
  38.                             || q->Type == NPCT_FAIRY ) {
  39.                                 ignore_npc = true;
  40.                                 continue;
  41.                         }
  42.                         else {
  43.                             ignore_npc = false;
  44.                             break;
  45.                         }
  46.                     }
  47.                     if ( ignore_npc ) triggered = true;
  48.                 }
  49.                
  50.                 //If a chest type
  51.                     //If a normal chest
  52.                     //check if Link is standing in front of it
  53.                     //If so,a nd hepresses a button
  54.                     //change the chest combo ++
  55.                     //make the item
  56.                
  57.                     //if it is a slash chest
  58.                     //if link slashes it
  59.                     //change the chest combo ++
  60.                     //make the item
  61.                
  62.                     //if it is a locked chest
  63.                     //and link is in front of it
  64.                     //and has a key or Lkey
  65.                     //and presses up for a few seconds
  66.                     //remove a key, normal keys have priority
  67.                         //or lkeys have priority
  68.                         //! WE NEED AN OPTION FOR THIS
  69.                     //change the chest combo ++
  70.                     //make the item
  71.                
  72.                     //if it is a boss lock chest
  73.                     //and link has LItem BOSSKEY
  74.                     //and is standing in front of it for a few seconds
  75.                     //open it, and change the chest combo ++
  76.                     //make the item
  77.                
  78.                 Waitframe();
  79.             }
  80.             if ( triggered && !itemTaken && !itemCreated ) {
  81.                 itemCreated = true;
  82.                 if ( sfx ) Game->PlaySound(sfx);
  83.                 else Game->PlaySound(SFX_SECRET_ITEM);
  84.                 i = Screen->CreateItem(itm);
  85.                 i->X = this->X;
  86.                 i->Y = this->Y;
  87.                 if ( LinkCollision(i) ) itemTaken = true;
  88.                 Waitframe();
  89.             }
  90.             if ( triggered && itemCreated && !itemTaken && LinkCollision(i) ) itemTaken = true;
  91.             Waitframe();
  92.         }
  93.     }
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement