Advertisement
ZoriaRPG

Shovel Game for JudasRising (Preliminary)

Apr 3rd, 2018
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 17.48 KB | None | 0 0
  1. const int MISC_GAMES = 5; //Link->Misc[]
  2. const int GT_SHOVEL = 1; //bit for Link->Misc[MISC_GAMES]
  3.  
  4. bool IsShovelGame()
  5. {
  6.     return (Link->Misc[MISC_GAMES]&GT_SHOVEL);
  7. }
  8.  
  9. void IsShovelGame(bool s)
  10. {
  11.     if ( s )
  12.     {
  13.         Link->Misc[MISC_GAMES] |= GT_SHOVEL;
  14.     }
  15.     else    Link->Misc[MISC_GAMES] |= ~GT_SHOVEL;
  16. }
  17.  
  18.  
  19.  
  20. const int SHOVEL_GAME_RUNNING = 0; //index for shovelgame[]
  21. const int SHOVEL_GAME_TIMER = 1; //index for shovelgame[]
  22. const int SHOVEL_GAME_ACTIVE = 2; //index for shovelgame[]
  23. const int SHOVEL_GAME_HAS_SHOVEL = 3; //index for shovelgame[]
  24.  
  25. const int SHOVEL_GAME_LINE_Y = 50; //Y position of invisible line.
  26.  
  27. const int SHOVEL_GAME_TIMER_X
  28. const int SHOVEL_GAME_TIMER_Y
  29. const int SHOVEL_GAME_TIMER_FONT
  30. const int SHOVEL_GAME_TIMER_COLOUR
  31. const int SHOVEL_GAME_TIMER_VALUE //DEFAULT
  32.  
  33. const int SHOVEL_GAME_MESSAGE_GAMEOVER
  34.  
  35. const int SHOVEL_GAME_GUY_DISTX = 10;
  36. const int SHOVEL_GAME_GUY_DISTY = 10;
  37. const int SHOVEL_GAME_COST = 60;
  38. const int SHOVEL_GAME_BUTTON_A = 1;
  39. const int SHOVEL_GAME_BUTTON_B = 1;
  40. const int SHOVEL_GAME_BUTTON_L = 1;
  41. const int SHOVEL_GAME_BUTTON_R = 1;
  42. const int SHOVEL_GAME_BUTTON_EX1 = 1;
  43. const int SHOVEL_GAME_BUTTON_EX2 = 1;
  44. const int SHOVEL_GAME_BUTTON_EX3 = 1;
  45. const int SHOVEL_GAME_BUTTON_EX4 = 1;
  46.  
  47. //const int SHOVEL_GAME_
  48. //const int SHOVEL_GAME_
  49. //const int SHOVEL_GAME_
  50. //const int SHOVEL_GAME_
  51.  
  52.  
  53.  
  54. ffc script ShovelGame
  55. {
  56.     void run(int time, int cost)
  57.     {
  58.        
  59.         int shovelgame[256];
  60.         //0 == timer
  61.         //1 == running
  62.         item shovelgameitems[256];
  63.         itemdata shovelgame id[256];
  64.         shovelgame[SHOVEL_GAME_ACTIVE] = 1;
  65.         shovelgame[SHOVEL_GAME_HAS_SHOVEL] = Link->Item[I_SHOVEL];
  66.         while(shovelgame[SHOVEL_GAME_ACTIVE])
  67.         {
  68.             //Draw guy
  69.            
  70.            
  71.             //and below or to the right of him
  72.             if ( Below(this) || RightOf(this) )
  73.             {
  74.                 //if Link is facing the guy
  75.                 if ( Facing(this) )
  76.                 {
  77.                     //and within a set distance
  78.                     if ( DistX(Link->X, this->X, SHOVEL_GAME_GUY_DISTX) )
  79.                     {
  80.                         if ( DistY(Link->Y, this->Y, SHOVEL_GAME_GUY_DISTX) )
  81.                         {
  82.                             //and presses the correct button
  83.                             if ( PressShovelGameButton() )
  84.                             {
  85.                                 //create yes/no tango menu
  86.                                 //if menu returns (1) then the game is running
  87.                                 shovelgame[SHOVEL_GAME_RUNNING] = ShovelGameMenu();
  88.                             }
  89.                         }
  90.                     }
  91.                 }
  92.             }
  93.            
  94.            
  95.            
  96.             //while runnning
  97.             while(shovelgame[SHOVEL_GAME_RUNNING])
  98.                
  99.             {
  100.                 //if Link doesnt have the shovel, give it to him here:
  101.                
  102.                 if ( !shovelgame[SHOVEL_GAME_HAS_SHOVEL] )
  103.                 {
  104.                     if ( !Link->Item[I_SHOVEL] ) Link->Item[I_SHOVEL] = true;
  105.                     //Set the shovel as the active B item.
  106.                 }
  107.                 while(Link->Y < SHOVEL_GAME_LINE_Y ) { Waitframe(); continue; }
  108.                 //wait for Link to cross the invisible line
  109.                 //once he does...
  110.                
  111.                 shovelgame[SHOVEL_GAME_TIMER] = Cond(time > 0, time, SHOVEL_GAME_TIMER_VALUE); //set the timer
  112.                
  113.                 while(shovelgame[SHOVEL_GAME_TIMER]-- > -1 )
  114.                 {
  115.                     //while the timer is above -1
  116.                
  117.                     //set game running
  118.                     IsShovelGame(true);
  119.                     //display the game time.
  120.                    
  121.                     Waitframe(); continue;
  122.                     //if the timer expires, end the game.
  123.                 }
  124.            
  125.                 Waitframe(); continue;
  126.             }
  127.        
  128.             //Game is over.
  129.            
  130.             //Show a message
  131.             Screen->Message(SHOVEL_GAME_MESSAGE_GAMEOVER);
  132.             //set game off
  133.            
  134.             //take the shovel away if Link does not own one.
  135.            
  136.             if ( !shovelgame[SHOVEL_GAME_HAS_SHOVEL] )
  137.             {
  138.                 if ( Link->Item[I_SHOVEL] ) Link->Item[I_SHOVEL] = false;
  139.                 //Set the shovel as the active B item.
  140.             }
  141.                
  142.             IsShovelGame(false);
  143.            
  144.             Waitframe(); continue;
  145.         }
  146.        
  147.         //if you want the guy to say something else, or if you want to offer a new game,
  148.         //then, you could do that.
  149.        
  150.     }  
  151.     bool PressShovelGameButton()
  152.     {
  153.         if ( SHOVEL_GAME_BUTTON_A && Link->PressA )
  154.         {
  155.             Link->PressA = false; Link->InputA = false; return true;
  156.         }
  157.         if ( SHOVEL_GAME_BUTTON_B && Link->PressB )
  158.         {
  159.             Link->PressB = false; Link->InputB = false; return true;
  160.         }
  161.         if ( SHOVEL_GAME_BUTTON_L && Link->PressL )
  162.         {
  163.             Link->PressL = false; Link->InputL = false; return true;
  164.         }
  165.         if ( SHOVEL_GAME_BUTTON_R && Link->PressR )
  166.         {
  167.             Link->PressR = false; Link->InputR = false; return true;
  168.         }
  169.         if ( SHOVEL_GAME_BUTTON_EX1 && Link->PressEx1 )
  170.         {
  171.             Link->PressEx1 = false; Link->InputEx1 = false; return true;
  172.         }
  173.         if ( SHOVEL_GAME_BUTTON_EX2 && Link->PressEx2 )
  174.         {
  175.             Link->PressEx2 = false; Link->InputEx2 = false; return true;
  176.         }
  177.         if ( SHOVEL_GAME_BUTTON_EX3 && Link->PressEx3 )
  178.         {
  179.             Link->PressEx3 = false; Link->InputEx3 = false; return true;
  180.         }
  181.         if ( SHOVEL_GAME_BUTTON_EX4 && Link->PressEx4 )
  182.         {
  183.             Link->PressEx4 = false; Link->InputEx4 = false; return true;
  184.         }
  185.         return false;
  186.     }
  187.        
  188.     }
  189. }
  190.  
  191. //Huzzah, this script now uses a way more practical injection model for usage! ~Lunaria
  192.  
  193. //The combo type for generic digging on overworld.
  194. const int Shovel_ComboType = 143;   //Script 2 (143) is default for this.
  195.  
  196.  
  197. //The flag to dig on to trigger secrets. (Does not need to be on a digable combo type!)
  198. const int Shovel_SecretFlag = 99;   //General Purpose 2  (99) is default for this.
  199.  
  200.  
  201. //Digging on proper combos will change the combo to this one:
  202. const int Shovel_DugCombo = 969;        //Change to 0 to use the screens undercombo instead.
  203.  
  204.  
  205. //Start of 8 combos in a row for the dig animation. (Up 1, Down 1, Left 1, Right 1, Up 2, Down 2, Left 2, Right 2)
  206. const int Shovel_Anima_Start = 3780;
  207. //Start of 4 combos for the dirt clut
  208. const int Shovel_FlyingDirt = 3788;
  209.  
  210.  
  211.  
  212. //FFC slot for the shovel script. This now uses an FFC slot because fancier animation, woo!
  213. const int Shovel_FFC_Script = 168;
  214.  
  215.  
  216. // This is the sound to be played when you successfully dig.
  217. const int Shovel_Sound = 74;
  218. // The sound to be played when you attempt to dig an undiggable combo.
  219. const int Shovel_Fail = 101;
  220. // The secret sound to be played when you dig a secret.
  221. const int Shovel_SecretSFX = 27;
  222.  
  223. item script Shovel{
  224.     void run(){
  225.         int s_dig[]="Shovel_Diggy";
  226.         int s_dig_game="Shovel_Diggy_Game";
  227.         int useScript = Cond(IsShovelGame(), s_dig_game, s_dig);
  228.         if(Link->Z > 0) return;
  229.         //int args[] = {103,0,0,0,0,0,0,0};
  230.         RunFFCScript(useScript, NULL);
  231.        
  232.        
  233.     }
  234. }
  235.  
  236.  
  237. ffc script Shovel_Diggy_Game{
  238.   void run(){
  239.     int chance;
  240.     int itemdrop;
  241.     int itemlocx;
  242.     int itemlocy;
  243.     // Link->Action=LA_ATTACKING;
  244.    
  245.     item ShovelLoot;
  246.    
  247.     bool DigSuccess = false;
  248.    
  249.     int DigComboX;
  250.     int DigComboY;
  251.     if(Link->Dir == 0){
  252.         DigComboX = Link->X + 8;
  253.         DigComboY = Link->Y - 2;
  254.     }
  255.     else if(Link->Dir == 1){
  256.         DigComboX = Link->X + 8;
  257.         DigComboY = Link->Y + 18;
  258.     }
  259.     else if(Link->Dir == 2){
  260.         DigComboX = Link->X - 2;
  261.         DigComboY = Link->Y + 8;
  262.     }
  263.     else if(Link->Dir == 3){
  264.         DigComboX = Link->X + 18;
  265.         DigComboY = Link->Y + 8;
  266.     }
  267.    
  268.     int DigComboX2 = ComboAt(DigComboX,DigComboY) % 16;
  269.     DigComboX2 = DigComboX2 * 16;
  270.     int DigComboY2 = ComboAt(DigComboX,DigComboY) / 16;
  271.     DigComboY2 = Floor(DigComboY2);
  272.     DigComboY2 = DigComboY2 * 16;
  273.    
  274.    
  275.     for(int i; i != 10; i ++){
  276.         Link->Invisible = true;
  277.        
  278.         Screen->FastCombo(2, Link->X, Link->Y, Shovel_Anima_Start + Link->Dir, 6, OP_OPAQUE);
  279.         NoAction();
  280.        
  281.         Waitframe();
  282.         Link->Invisible = false;
  283.     }
  284.  
  285.    
  286.     if(Screen->ComboT[ComboAt(DigComboX,DigComboY)] != Shovel_ComboType
  287.     && Screen->ComboI[ComboAt(DigComboX,DigComboY)] != Shovel_SecretFlag
  288.     && Screen->ComboF[ComboAt(DigComboX,DigComboY)] != Shovel_SecretFlag){
  289.        Game->PlaySound(Shovel_Fail);
  290.     }
  291.     else{
  292.        
  293.        Game->PlaySound(Shovel_Sound);
  294.        DigSuccess = true;
  295.        
  296.        chance=Rand(100)+1;
  297.        
  298.        if(Screen->ComboT[ComboAt(DigComboX,DigComboY)] == Shovel_ComboType && Screen->ComboI[ComboAt(DigComboX,DigComboY)] == Shovel_SecretFlag){
  299.            
  300.            Screen->ComboD[ComboAt(DigComboX,DigComboY)] = Screen->UnderCombo;
  301.            chance = 101;
  302.            
  303.        }
  304.        else if(Screen->ComboF[ComboAt(DigComboX,DigComboY)] == Shovel_SecretFlag || Screen->ComboI[ComboAt(DigComboX,DigComboY)] == Shovel_SecretFlag){
  305.            Game->PlaySound(Shovel_SecretSFX);
  306.            Screen->TriggerSecrets();
  307.            Screen->State[ST_SECRET] = true;
  308.            chance = 101;
  309.        }
  310.        else{
  311.            Screen->ComboD[ComboAt(DigComboX,DigComboY)] = Screen->UnderCombo;
  312.            
  313.            if(Shovel_DugCombo > 0){
  314.                Screen->ComboD[ComboAt(DigComboX,DigComboY)] = Shovel_DugCombo;
  315.            }
  316.        }
  317.    
  318.     //Define special SHovel game Drops, here: -Z
  319.        
  320.         //Drop ratio is the current number minus the last one.
  321.        itemdrop = ShovelDigItem();
  322.  
  323.        if(Link->Dir==0){    //Spawn location
  324.            itemlocx=Link->X;
  325.            itemlocy=Link->Y-16;
  326.        }
  327.        if(Link->Dir==1){
  328.            itemlocx=Link->X;
  329.            itemlocy=Link->Y+16;
  330.        }
  331.        if(Link->Dir==2){
  332.            itemlocx=Link->X-16;
  333.            itemlocy=Link->Y;
  334.        }
  335.        if(Link->Dir==3){
  336.            itemlocx=Link->X+16;
  337.            itemlocy=Link->Y;
  338.        }
  339.  
  340.        if(itemdrop != -999){
  341.            ShovelLoot=Screen->CreateItem(itemdrop);
  342.            ShovelLoot->X=itemlocx;
  343.            ShovelLoot->Y=itemlocy;
  344.            ShovelLoot->Z=2;
  345.            ShovelLoot->Jump = 2;
  346.            ShovelLoot->Pickup=IP_TIMEOUT;
  347.        }
  348.     }
  349.    
  350.     int shovel_item_dir = Link->Dir;
  351.     int DirtClutX = DigComboX2;
  352.     int DirtClutY = DigComboY2;
  353.    
  354.    
  355.     for(int i; i != 10; i ++){
  356.         Link->Invisible = true;
  357.        
  358.         Screen->FastCombo(2, Link->X, Link->Y, Shovel_Anima_Start + 4 + Link->Dir, 6, OP_OPAQUE);
  359.         NoAction();
  360.        
  361.         if(i < 5){
  362.            
  363.             if(shovel_item_dir == 0)DirtClutY --;
  364.             if(shovel_item_dir == 1 && i % 2 == 0)DirtClutY ++;
  365.            
  366.             //sideways
  367.             if(shovel_item_dir > 1)DirtClutY --;
  368.             if(shovel_item_dir == 3)DirtClutX = DigComboX + (i / 2);
  369.             if(shovel_item_dir == 2)DirtClutX = DigComboX - (i / 2);
  370.            
  371.         }
  372.         else{
  373.            
  374.             if(shovel_item_dir == 0 && i % 2 == 0)DirtClutY --;
  375.             if(shovel_item_dir == 1)DirtClutY ++;
  376.            
  377.             //sideways
  378.             if(shovel_item_dir > 1)DirtClutY ++;
  379.             if(shovel_item_dir == 3)DirtClutX = DigComboX + (i / 2);
  380.             if(shovel_item_dir == 2)DirtClutX = DigComboX - (i / 2);
  381.            
  382.         }
  383.         if(DigSuccess)Screen->FastCombo(2, DirtClutX, DirtClutY, Shovel_FlyingDirt + shovel_item_dir, 6, OP_OPAQUE);
  384.        
  385.        
  386.         if(Screen->ComboS[ComboAt(ShovelLoot->X + 8, ShovelLoot->Y + 8)] == 0){
  387.            
  388.             if(shovel_item_dir == 0)ShovelLoot->Y --;
  389.             else if(shovel_item_dir == 1)ShovelLoot->Y ++;
  390.             else if(shovel_item_dir == 2)ShovelLoot->X --;
  391.             else if(shovel_item_dir == 3)ShovelLoot->X ++;
  392.            
  393.         }
  394.        
  395.        
  396.         Waitframe();
  397.         Link->Invisible = false;
  398.     }
  399.    
  400.     while(ShovelLoot->Z > 0){
  401.        
  402.         if(Screen->ComboS[ComboAt(ShovelLoot->X + 8, ShovelLoot->Y + 8)] == 0){
  403.            
  404.             if(shovel_item_dir == 0)ShovelLoot->Y --;
  405.             else if(shovel_item_dir == 1)ShovelLoot->Y ++;
  406.             else if(shovel_item_dir == 2)ShovelLoot->X --;
  407.             else if(shovel_item_dir == 3)ShovelLoot->X ++;
  408.            
  409.         }
  410.        
  411.         Waitframe();
  412.        
  413.     }
  414.    
  415.   }
  416.   int ShovelDigItem()
  417.     {
  418.         int prizeChances[100]=
  419.         {
  420.             //Define shovel game prizes, here.
  421.             0,0,0,0,0,0,0,0,0,0,
  422.             2,2,2,2,2,2,2,2,2,2,
  423.             34,34,34,
  424.             1,1,1,1,1,
  425.             87,-999, //29
  426.             //30
  427.             -999,-999,-999,-999,-999,-999,-999,-999,-999,-999,
  428.             //40
  429.             -999,-999,-999,-999,-999,-999,-999,-999,-999,-999,
  430.             //50
  431.             -999,-999,-999,-999,-999,-999,-999,-999,-999,-999,
  432.             //60
  433.             -999,-999,-999,-999,-999,-999,-999,-999,-999,-999,
  434.             //70
  435.             -999,-999,-999,-999,-999,-999,-999,-999,-999,-999,
  436.             //80
  437.             -999,-999,-999,-999,-999,-999,-999,-999,-999,-999,
  438.             //90
  439.             -999,-999,-999,-999,-999,-999,-999,-999,-999,-999,
  440.         };
  441.         int specialPrizeChances[100]=
  442.         {
  443.             //Define special prizes here.
  444.             0,0,0,0,0,0,0,0,0,0,
  445.             2,2,2,2,2,2,2,2,2,2,
  446.             34,34,34,
  447.             1,1,1,1,1,
  448.             87,-999, //29
  449.             //30
  450.             -999,-999,-999,-999,-999,-999,-999,-999,-999,-999,
  451.             //40
  452.             -999,-999,-999,-999,-999,-999,-999,-999,-999,-999,
  453.             //50
  454.             -999,-999,-999,-999,-999,-999,-999,-999,-999,-999,
  455.             //60
  456.             -999,-999,-999,-999,-999,-999,-999,-999,-999,-999,
  457.             //70
  458.             -999,-999,-999,-999,-999,-999,-999,-999,-999,-999,
  459.             //80
  460.             -999,-999,-999,-999,-999,-999,-999,-999,-999,-999,
  461.             //90
  462.             -999,-999,-999,-999,-999,-999,-999,-999,-999,-999,
  463.         };
  464.         if ( !GetScreenDBit(SHOVELGAME_D, SHOVELGAME_BIT) )
  465.             return specialPrizeChances[Rand(0,99)];
  466.         else return prizeChances[Rand(0,99)];
  467.     }
  468. }
  469.  
  470.  
  471. ffc script Shovel_Diggy{
  472.   void run(){
  473.     int chance;
  474.     int itemdrop;
  475.     int itemlocx;
  476.     int itemlocy;
  477.     // Link->Action=LA_ATTACKING;
  478.    
  479.     item ShovelLoot;
  480.    
  481.     bool DigSuccess = false;
  482.    
  483.     int DigComboX;
  484.     int DigComboY;
  485.     if(Link->Dir == 0){
  486.         DigComboX = Link->X + 8;
  487.         DigComboY = Link->Y - 2;
  488.     }
  489.     else if(Link->Dir == 1){
  490.         DigComboX = Link->X + 8;
  491.         DigComboY = Link->Y + 18;
  492.     }
  493.     else if(Link->Dir == 2){
  494.         DigComboX = Link->X - 2;
  495.         DigComboY = Link->Y + 8;
  496.     }
  497.     else if(Link->Dir == 3){
  498.         DigComboX = Link->X + 18;
  499.         DigComboY = Link->Y + 8;
  500.     }
  501.    
  502.     int DigComboX2 = ComboAt(DigComboX,DigComboY) % 16;
  503.     DigComboX2 = DigComboX2 * 16;
  504.     int DigComboY2 = ComboAt(DigComboX,DigComboY) / 16;
  505.     DigComboY2 = Floor(DigComboY2);
  506.     DigComboY2 = DigComboY2 * 16;
  507.    
  508.    
  509.     for(int i; i != 10; i ++){
  510.         Link->Invisible = true;
  511.        
  512.         Screen->FastCombo(2, Link->X, Link->Y, Shovel_Anima_Start + Link->Dir, 6, OP_OPAQUE);
  513.         NoAction();
  514.        
  515.         Waitframe();
  516.         Link->Invisible = false;
  517.     }
  518.  
  519.    
  520.     if(Screen->ComboT[ComboAt(DigComboX,DigComboY)] != Shovel_ComboType
  521.     && Screen->ComboI[ComboAt(DigComboX,DigComboY)] != Shovel_SecretFlag
  522.     && Screen->ComboF[ComboAt(DigComboX,DigComboY)] != Shovel_SecretFlag){
  523.        Game->PlaySound(Shovel_Fail);
  524.     }
  525.     else{
  526.        
  527.        Game->PlaySound(Shovel_Sound);
  528.        DigSuccess = true;
  529.        
  530.        chance=Rand(100)+1;
  531.        
  532.        if(Screen->ComboT[ComboAt(DigComboX,DigComboY)] == Shovel_ComboType && Screen->ComboI[ComboAt(DigComboX,DigComboY)] == Shovel_SecretFlag){
  533.            
  534.            Screen->ComboD[ComboAt(DigComboX,DigComboY)] = Screen->UnderCombo;
  535.            chance = 101;
  536.            
  537.        }
  538.        else if(Screen->ComboF[ComboAt(DigComboX,DigComboY)] == Shovel_SecretFlag || Screen->ComboI[ComboAt(DigComboX,DigComboY)] == Shovel_SecretFlag){
  539.            Game->PlaySound(Shovel_SecretSFX);
  540.            Screen->TriggerSecrets();
  541.            Screen->State[ST_SECRET] = true;
  542.            chance = 101;
  543.        }
  544.        else{
  545.            Screen->ComboD[ComboAt(DigComboX,DigComboY)] = Screen->UnderCombo;
  546.            
  547.            if(Shovel_DugCombo > 0){
  548.                Screen->ComboD[ComboAt(DigComboX,DigComboY)] = Shovel_DugCombo;
  549.            }
  550.        }
  551.        
  552.         //Drop ratio is the current number minus the last one.
  553.        if(chance<=10){      //10%
  554.            itemdrop = 0;    //1 rupee
  555.        }
  556.        else if(chance<=20){ //10%
  557.            itemdrop = 2;    //Recovery heart
  558.        }
  559.        else if(chance<=23){ //3%
  560.            itemdrop = 34;   //Fairy
  561.        }
  562.        else if(chance<=27){ //4%
  563.            itemdrop = 1;    //5 Rupee
  564.        }
  565.        else if(chance<=28){ //1%
  566.            itemdrop = 87;   //100 Rupee
  567.        }
  568.        else{
  569.            itemdrop = - 999;    //No item drop
  570.        }
  571.  
  572.        if(Link->Dir==0){    //Spawn location
  573.            itemlocx=Link->X;
  574.            itemlocy=Link->Y-16;
  575.        }
  576.        if(Link->Dir==1){
  577.            itemlocx=Link->X;
  578.            itemlocy=Link->Y+16;
  579.        }
  580.        if(Link->Dir==2){
  581.            itemlocx=Link->X-16;
  582.            itemlocy=Link->Y;
  583.        }
  584.        if(Link->Dir==3){
  585.            itemlocx=Link->X+16;
  586.            itemlocy=Link->Y;
  587.        }
  588.  
  589.        if(itemdrop != -999){
  590.            ShovelLoot=Screen->CreateItem(itemdrop);
  591.            ShovelLoot->X=itemlocx;
  592.            ShovelLoot->Y=itemlocy;
  593.            ShovelLoot->Z=2;
  594.            ShovelLoot->Jump = 2;
  595.            ShovelLoot->Pickup=IP_TIMEOUT;
  596.        }
  597.     }
  598.    
  599.     int shovel_item_dir = Link->Dir;
  600.     int DirtClutX = DigComboX2;
  601.     int DirtClutY = DigComboY2;
  602.    
  603.    
  604.     for(int i; i != 10; i ++){
  605.         Link->Invisible = true;
  606.        
  607.         Screen->FastCombo(2, Link->X, Link->Y, Shovel_Anima_Start + 4 + Link->Dir, 6, OP_OPAQUE);
  608.         NoAction();
  609.        
  610.         if(i < 5){
  611.            
  612.             if(shovel_item_dir == 0)DirtClutY --;
  613.             if(shovel_item_dir == 1 && i % 2 == 0)DirtClutY ++;
  614.            
  615.             //sideways
  616.             if(shovel_item_dir > 1)DirtClutY --;
  617.             if(shovel_item_dir == 3)DirtClutX = DigComboX + (i / 2);
  618.             if(shovel_item_dir == 2)DirtClutX = DigComboX - (i / 2);
  619.            
  620.         }
  621.         else{
  622.            
  623.             if(shovel_item_dir == 0 && i % 2 == 0)DirtClutY --;
  624.             if(shovel_item_dir == 1)DirtClutY ++;
  625.            
  626.             //sideways
  627.             if(shovel_item_dir > 1)DirtClutY ++;
  628.             if(shovel_item_dir == 3)DirtClutX = DigComboX + (i / 2);
  629.             if(shovel_item_dir == 2)DirtClutX = DigComboX - (i / 2);
  630.            
  631.         }
  632.         if(DigSuccess)Screen->FastCombo(2, DirtClutX, DirtClutY, Shovel_FlyingDirt + shovel_item_dir, 6, OP_OPAQUE);
  633.        
  634.        
  635.         if(Screen->ComboS[ComboAt(ShovelLoot->X + 8, ShovelLoot->Y + 8)] == 0){
  636.            
  637.             if(shovel_item_dir == 0)ShovelLoot->Y --;
  638.             else if(shovel_item_dir == 1)ShovelLoot->Y ++;
  639.             else if(shovel_item_dir == 2)ShovelLoot->X --;
  640.             else if(shovel_item_dir == 3)ShovelLoot->X ++;
  641.            
  642.         }
  643.        
  644.        
  645.         Waitframe();
  646.         Link->Invisible = false;
  647.     }
  648.    
  649.     while(ShovelLoot->Z > 0){
  650.        
  651.         if(Screen->ComboS[ComboAt(ShovelLoot->X + 8, ShovelLoot->Y + 8)] == 0){
  652.            
  653.             if(shovel_item_dir == 0)ShovelLoot->Y --;
  654.             else if(shovel_item_dir == 1)ShovelLoot->Y ++;
  655.             else if(shovel_item_dir == 2)ShovelLoot->X --;
  656.             else if(shovel_item_dir == 3)ShovelLoot->X ++;
  657.            
  658.         }
  659.        
  660.         Waitframe();
  661.        
  662.     }
  663.    
  664.   }
  665. }
  666.  
  667. ffc script Shovel_SP_DigPoint{
  668.     void run(int Replace_Combo, int Replace_CSet, int Secret_Item){
  669.        
  670.         //  just script a FFC as "dig point" that changes it's combo to something specific when dug
  671.         //  probably the best solution
  672.         //  since you could define on the fly what you'd want it to be
  673.        
  674.        
  675.         if(Screen->State[ST_SECRET] == false){
  676.            
  677.            
  678.         }
  679.         else{
  680.            
  681.            
  682.            
  683.         }
  684.        
  685.     }
  686. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement