Advertisement
ywkls

Partner Plate

Feb 7th, 2020
132
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Handle switches that must be held down.
  2. ffc script Partner_Plate{
  3. void run(int DMap_Mirror, int DMap_Labrynna){
  4. int i;
  5. int Combo_Array[176];
  6. int loc;
  7. int loc_2;
  8. int PressCount;
  9. int SwitchCount;
  10. for(i= 0;i<=175;i++){
  11. Combo_Array[i]= -1;
  12. if(ComboFI(i,CF_BLOCKTRIGGER)){
  13. Combo_Array[i]= Screen->ComboD[i];
  14. SwitchCount++;
  15. }
  16. }
  17. int Labrynna_Switch;
  18. int Mirror_Switch;
  19.  
  20. while(!Screen->State[ST_SECRET]){
  21. if(DestinyVars[CURRENT_OVERWORLD]==LABRYNNA_OVERWORLD){
  22. loc= ComboAt(DestinyVars[LINK_X_LABRYNNA]+8,
  23. DestinyVars[LINK_Y_LABRYNNA]+8);
  24. if(Is_Switch(loc)){
  25. Screen->ComboD[loc]++;
  26. Labrynna_Switch= loc;
  27. }
  28. else{
  29. if(loc!=Labrynna_Switch){
  30. if(Combo_Array[Labrynna_Switch]!=-1){
  31. Screen->ComboD[Labrynna_Switch]=Combo_Array[Labrynna_Switch];
  32. loc=0;
  33. Labrynna_Switch= 0;
  34. }
  35. }
  36. }
  37. if(Game->GetCurDMapScreen()==DestinyVars[SCREEN_MIRROR]
  38. && DestinyVars[DMAP_MIRROR]==DMap_Mirror){
  39. loc_2=ComboAt(DestinyVars[LINK_X_MIRROR]+8,
  40. DestinyVars[LINK_Y_MIRROR]+8);
  41. if(Is_Switch(loc_2)){
  42. Screen->ComboD[loc_2]++;
  43. Mirror_Switch= loc_2;
  44. }
  45. else{
  46. if(loc_2!=Mirror_Switch){
  47. if(Combo_Array[Mirror_Switch]!=-1){
  48. Screen->ComboD[Mirror_Switch]=Combo_Array[Mirror_Switch];
  49. loc_2=0;
  50. Mirror_Switch= 0;
  51. }
  52. }
  53. }
  54. }
  55. }
  56. else if(DestinyVars[CURRENT_OVERWORLD]==MIRROR_OVERWORLD){
  57. loc= ComboAt(DestinyVars[LINK_X_LABRYNNA]+8,
  58. DestinyVars[LINK_Y_LABRYNNA]+8);
  59. if(Is_Switch(loc)){
  60. Screen->ComboD[loc]++;
  61. Labrynna_Switch= loc;
  62. }
  63. else{
  64. if(loc!=Labrynna_Switch){
  65. if(Combo_Array[Labrynna_Switch]!=-1){
  66. Screen->ComboD[Labrynna_Switch]=Combo_Array[Labrynna_Switch];
  67. loc=0;
  68. Labrynna_Switch= 0;
  69. }
  70. }
  71. }
  72. if(Game->GetCurDMapScreen()==DestinyVars[SCREEN_MIRROR]
  73. && DestinyVars[DMAP_MIRROR]==DMap_Mirror){
  74. loc_2=ComboAt(DestinyVars[LINK_X_MIRROR]+8,
  75. DestinyVars[LINK_Y_MIRROR]+8);
  76. if(Is_Switch(loc_2)){
  77. Screen->ComboD[loc_2]++;
  78. Mirror_Switch= loc_2;
  79. }
  80. else{
  81. if(loc_2!=Mirror_Switch){
  82. if(Combo_Array[Mirror_Switch]!=-1){
  83. Screen->ComboD[Mirror_Switch]=Combo_Array[Mirror_Switch];
  84. loc_2=0;
  85. Mirror_Switch= 0;
  86. }
  87. }
  88. }
  89. }
  90. }
  91. PressCount= 0;
  92. for(i= 0;i<=175;i++){
  93. if(loc==i){
  94. if(Combo_Array[i]!=-1){
  95. if(Combo_Array[i]!=Screen->ComboD[loc]){
  96. PressCount++;
  97. Game->PlaySound(SFX_SWITCH_PUSH);
  98. }
  99. }
  100. }
  101. if(loc_2==i){
  102. if(Combo_Array[i]!=-1){
  103. if(Combo_Array[i]!=Screen->ComboD[loc_2]){
  104. PressCount++;
  105. Game->PlaySound(SFX_SWITCH_PUSH);
  106. }
  107. }
  108. }
  109. if(PressCount>=SwitchCount){
  110. Screen->State[ST_SECRET]=true;
  111. Screen->TriggerSecrets();
  112. Game->PlaySound(SFX_SECRET);
  113. break;
  114. }
  115. }
  116. Waitframe();
  117. }
  118. }
  119. }
  120.  
  121. bool Is_Switch(int loc){
  122. return ComboFIT(loc,CF_BLOCKTRIGGER,CT_NONE);
  123. }
  124.  
  125. const int SFX_SWITCH_PUSH= 91;
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement