OmegaGamingHunters

ZC subscreens V3

Apr 27th, 2020
767
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 12.16 KB | None | 0 0
  1. //FinalSubscreens.zh
  2. //The Subscreen the player will see in this quest
  3. //Active Subscreen: Item Selection Menu
  4. //Passive Subscreen: Display's Health, Magic, Current Buttom Items, Counters
  5.  
  6. //Active Menu Pages
  7. //1. Item Screen
  8. //2. Status/Equipment Screen
  9. //3. Quest Collection Screen
  10. //4. Overworld/Dungeon Map Screen
  11. //5. Log Book
  12. //   -History/Lore
  13. //   -Journel Entries
  14. //   -Research
  15. //   -Monsters
  16. //   -Items
  17.  
  18. dmapdata script FinalActiveSubscreen
  19. {
  20.     void run()
  21.     {
  22.         //Transition Variables (In and out of the menu)
  23.         bool ActiveMenu_Transition = true; //The trigger that transitions the game into the menu
  24.         bool ActiveMenu_DeTransition = false; //The trigger that transitions the game out the menu
  25.         int ActiveMenu_Transition_Phase = 0; //The stage in the transition the menu is in
  26.         int ActiveMenu_DeTransition_Phase = 0; //The stage in the detransition the menu is in
  27.        
  28.         //Menu Variables
  29.         int ActiveMenu_Page = 1; //The Page the ActiveSubScreen is On
  30.         int ActiveMenu_Layer = 0; //The Layer the ActiveSubScreen is On
  31.         int ActiveMenu_X1 = 0; //X1 Position of the ActiveSubScreen
  32.         int ActiveMenu_Y1 = 176; //Y1 Position of the ActiveSubScreen
  33.         int ActiveMenu_X2 = 256; //X2 Position of the ActiveSubScreen
  34.         int ActiveMenu_Y2 = 176; //Y2 Position of the ActiveSubScreen
  35.        
  36.         //Cursor Variables
  37.         int Cursor_position = 0; //The position the cursor is at
  38.         int Item_index = 0; //The item the cursor is on
  39.  
  40.         do
  41.         {
  42.             //Transite into the menu
  43.             if (ActiveMenu_Transition)
  44.             {
  45.                 switch(ActiveMenu_Transition_Phase)
  46.                 {
  47.                     case 0:
  48.                         Audio->PlaySound(SFX_MENU_OPEN);
  49.                         ActiveMenu_Transition_Phase = 1;
  50.                         break;
  51.                     case 1:
  52.                         if (ActiveMenu_Y1 > 0)
  53.                         {
  54.                             ActiveMenu_Y1 -= 4;
  55.                         }
  56.                         else
  57.                         {
  58.                             ActiveMenu_Transition_Phase = 2;
  59.                         }
  60.                         break;
  61.                     case 2:
  62.                         ActiveMenu_Transition = false;
  63.                         break;
  64.                 }
  65.             }
  66.  
  67.             //Transite out of the menu
  68.             if (Input->Press[CB_START] and !ActiveMenu_Transition and !ActiveMenu_DeTransition)
  69.             {
  70.                 ActiveMenu_DeTransition = true;
  71.             }
  72.             else if (ActiveMenu_DeTransition)
  73.             {
  74.                 switch(ActiveMenu_DeTransition_Phase)
  75.                 {
  76.                     case 0:
  77.                         Audio->PlaySound(SFX_MENU_CLOSE);
  78.                         ActiveMenu_DeTransition_Phase = 1;
  79.                         break;
  80.                     case 1:
  81.                         if (ActiveMenu_Y1 < 176)
  82.                         {
  83.                             ActiveMenu_Y1 += 4;
  84.                         }
  85.                         else
  86.                         {
  87.                             ActiveMenu_DeTransition_Phase = 2;
  88.                         }
  89.                         break;
  90.                     case 2:
  91.                         ActiveMenu_DeTransition = false;
  92.                         break;
  93.                 }
  94.             }
  95.            
  96.             //Draw Background
  97.             Screen->Rectangle(ActiveMenu_Layer, ActiveMenu_X1, ActiveMenu_Y1, ActiveMenu_X2, ActiveMenu_Y2, Color_Black, 1, 0, 0, 0, true, OP_OPAQUE); //Background
  98.            
  99.  
  100.             if (ActiveMenu_Page == 1) //Item Screen
  101.             {
  102.                 //Drawing Text, Cursor, and Menu's
  103.                 Screen->DrawString(1, 128, ActiveMenu_Y1 + 10, FONT_LA, Color_White, Color_Black, TF_CENTERED, "Item Screen", OP_OPAQUE); //Item Screen Text
  104.                
  105.                 Screen->DrawTile(1, 10, ActiveMenu_Y1 + 20, 20053, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Top-Left Cornor
  106.                 Screen->DrawTile(1, 230, ActiveMenu_Y1 + 20, 20055, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Top-Right Cornor
  107.                 Screen->DrawTile(1, 10, ActiveMenu_Y1 + 84, 20093, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Bottom-Left Cornor
  108.                 Screen->DrawTile(1, 230, ActiveMenu_Y1 + 84, 20095, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Bottom-Right Cornor
  109.                 Screen->DrawTile(1, 26, ActiveMenu_Y1 + 20, 20054, 1, 1, 7, 204, 16, 0, 0, 0, 0, true, OP_OPAQUE); //Top-Edge
  110.                 Screen->DrawTile(1, 26, ActiveMenu_Y1 + 84, 20094, 1, 1, 7, 204, 16, 0, 0, 0, 0, true, OP_OPAQUE); //Bottom-Edge
  111.                 Screen->DrawTile(1, 10, ActiveMenu_Y1 + 36, 20073, 1, 1, 7, 16, 48, 0, 0, 0, 0, true, OP_OPAQUE); //Left-Edge
  112.                 Screen->DrawTile(1, 230, ActiveMenu_Y1 + 36, 20075, 1, 1, 7, 16, 48, 0, 0, 0, 0, true, OP_OPAQUE); //Right-Edge
  113.                
  114.                 Screen->DrawTile(1, 108, ActiveMenu_Y1 + 104, 20053, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Top-Left Cornor (Selected Item)
  115.                 Screen->DrawTile(1, 132, ActiveMenu_Y1 + 104, 20055, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Top-Right Cornor (Selected Item)
  116.                 Screen->DrawTile(1, 108, ActiveMenu_Y1 + 128, 20093, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Bottom-Left Cornor (Selected Item)
  117.                 Screen->DrawTile(1, 132, ActiveMenu_Y1 + 128, 20095, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Bottom-Right Cornor (Selected Item)
  118.                 Screen->DrawTile(1, 120, ActiveMenu_Y1 + 104, 20054, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Top-Edge Cornor (Selected Item)
  119.                 Screen->DrawTile(1, 120, ActiveMenu_Y1 + 136, 20054, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Bottom-Edge Cornor (Selected Item)
  120.                 Screen->DrawTile(1, 108, ActiveMenu_Y1 + 116, 20073, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Left-Edge Cornor (Selected Item)
  121.                 Screen->DrawTile(1, 132, ActiveMenu_Y1 + 116, 20075, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Right-Edge Cornor (Selected Item)
  122.                
  123.                 Screen->DrawTile(1, 20 + ((Cursor_position-(Floor(Cursor_position/11)*11))*20), (ActiveMenu_Y1 + 30)+(Floor(Cursor_position/11)*22), 5, 1, 1, 2, -1, -1, 0, 0, 0, 0, true, OP_OPAQUE); //Cursor
  124.                
  125.                 //Drawing Items
  126.                
  127.                 //Sword
  128.                 if (Hero->Item[I_SWORD4])
  129.                 {
  130.                     itemdata Sword = Game->LoadItemData(I_SWORD4);
  131.                     Screen->DrawTile(1, 20, ActiveMenu_Y1 + 30, Sword->Tile, 1, 1, Sword->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  132.                 }
  133.                 else if (Hero->Item[I_SWORD3])
  134.                 {
  135.                     itemdata Sword = Game->LoadItemData(I_SWORD3);
  136.                     Screen->DrawTile(1, 20, ActiveMenu_Y1 + 30, Sword->Tile, 1, 1, Sword->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  137.                 }
  138.                 else if (Hero->Item[I_SWORD2])
  139.                 {
  140.                     itemdata Sword = Game->LoadItemData(I_SWORD2);
  141.                     Screen->DrawTile(1, 20, ActiveMenu_Y1 + 30, Sword->Tile, 1, 1, Sword->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  142.                 }
  143.                 else if (Hero->Item[I_SWORD1])
  144.                 {
  145.                     itemdata Sword = Game->LoadItemData(I_SWORD1);
  146.                     Screen->DrawTile(1, 20, ActiveMenu_Y1 + 30, Sword->Tile, 1, 1, Sword->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  147.                 }              
  148.                 //Bombs
  149.                 if (Hero->Item[I_BOMB])
  150.                 {
  151.                     itemdata Bomb = Game->LoadItemData(I_BOMB);
  152.                     Screen->DrawTile(1, 40, ActiveMenu_Y1 + 30, Bomb->Tile, 1, 1, Bomb->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  153.                 }
  154.                 //Super Bombs
  155.                 if (Hero->Item[I_SBOMB])
  156.                 {
  157.                     itemdata SuperBomb = Game->LoadItemData(I_SBOMB);
  158.                     Screen->DrawTile(1, 60, ActiveMenu_Y1 + 30, SuperBomb->Tile, 1, 1, SuperBomb->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  159.                 }
  160.                 //Hammer
  161.                 if (Hero->Item[I_HAMMER])
  162.                 {
  163.                     itemdata Hammer = Game->LoadItemData(I_HAMMER);
  164.                     Screen->DrawTile(1, 80, ActiveMenu_Y1 + 30, Hammer->Tile, 1, 1, Hammer->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  165.                 }
  166.                 //Hookshot
  167.                 if (Hero->Item[I_HOOKSHOT2])
  168.                 {
  169.                     itemdata Hookshot = Game->LoadItemData(I_HOOKSHOT2);
  170.                     Screen->DrawTile(1, 100, ActiveMenu_Y1 + 30, Hookshot->Tile, 1, 1, Hookshot->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  171.                 }
  172.                 else if (Hero->Item[I_HOOKSHOT1])
  173.                 {
  174.                     itemdata Hookshot = Game->LoadItemData(I_HOOKSHOT1);
  175.                     Screen->DrawTile(1, 100, ActiveMenu_Y1 + 30, Hookshot->Tile, 1, 1, Hookshot->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  176.                 }
  177.                 //Bow & Arrow
  178.                 if (Hero->Item[I_BOW2])
  179.                 {
  180.                     itemdata Bow = Game->LoadItemData(I_BOW2);
  181.                     Screen->DrawTile(1, 24, ActiveMenu_Y1 + 52, Bow->Tile, 1, 1, Bow->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  182.                 }
  183.                 else if (Hero->Item[I_BOW1])
  184.                 {
  185.                     itemdata Bow = Game->LoadItemData(I_BOW1);
  186.                     Screen->DrawTile(1, 24, ActiveMenu_Y1 + 52, Bow->Tile, 1, 1, Bow->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  187.                 }
  188.                
  189.                 if (Hero->Item[I_ARROW3])
  190.                 {
  191.                     itemdata Arrow = Game->LoadItemData(I_ARROW3);
  192.                     Screen->DrawTile(1, 16, ActiveMenu_Y1 + 52, Arrow->Tile, 1, 1, Arrow->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  193.                 }
  194.                 else if (Hero->Item[I_ARROW2])
  195.                 {
  196.                     itemdata Arrow = Game->LoadItemData(I_ARROW2);
  197.                     Screen->DrawTile(1, 16, ActiveMenu_Y1 + 52, Arrow->Tile, 1, 1, Arrow->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  198.                 }
  199.                 else if (Hero->Item[I_ARROW1])
  200.                 {
  201.                     itemdata Arrow = Game->LoadItemData(I_ARROW1);
  202.                     Screen->DrawTile(1, 16, ActiveMenu_Y1 + 52, Arrow->Tile, 1, 1, Arrow->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  203.                 }
  204.                 //Bait
  205.                 if (Hero->Item[I_BAIT])
  206.                 {
  207.                     itemdata Bait = Game->LoadItemData(I_BAIT);
  208.                     Screen->DrawTile(1, 40, ActiveMenu_Y1 + 52, Bait->Tile, 1, 1, Bait->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  209.                 }
  210.                 //Boomerang
  211.                 if (Hero->Item[I_BRANG3])
  212.                 {
  213.                     itemdata Boomerang = Game->LoadItemData(I_BRANG3);
  214.                     Screen->DrawTile(1, 60, ActiveMenu_Y1 + 52, Boomerang->Tile, 1, 1, Boomerang->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  215.                 }
  216.                 else if (Hero->Item[I_BRANG2])
  217.                 {
  218.                     itemdata Boomerang = Game->LoadItemData(I_BRANG2);
  219.                     Screen->DrawTile(1, 60, ActiveMenu_Y1 + 52, Boomerang->Tile, 1, 1, Boomerang->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  220.                 }
  221.                 else if (Hero->Item[I_BRANG1])
  222.                 {
  223.                     itemdata Boomerang = Game->LoadItemData(I_BRANG1);
  224.                     Screen->DrawTile(1, 60, ActiveMenu_Y1 + 52, Boomerang->Tile, 1, 1, Boomerang->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  225.                 }
  226.                 //Candle
  227.                 if (Hero->Item[I_CANDLE2])
  228.                 {
  229.                     itemdata Candle = Game->LoadItemData(I_CANDLE2);
  230.                     Screen->DrawTile(1, 80, ActiveMenu_Y1 + 52, Candle->Tile, 1, 1, Candle->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  231.                 }
  232.                 else if (Hero->Item[I_CANDLE1])
  233.                 {
  234.                     itemdata Candle = Game->LoadItemData(I_CANDLE1);
  235.                     Screen->DrawTile(1, 80, ActiveMenu_Y1 + 52, Candle->Tile, 1, 1, Candle->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  236.                 }
  237.                 //Wand
  238.                 if (Hero->Item[I_WAND])
  239.                 {
  240.                     itemdata Wand = Game->LoadItemData(I_WAND);
  241.                     Screen->DrawTile(1, 100, ActiveMenu_Y1 + 52, Wand->Tile, 1, 1, Wand->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  242.                 }
  243.                
  244.                 //Cursor Movement and selection
  245.                 if (Input->Press[CB_RIGHT] and !ActiveMenu_Transition and !ActiveMenu_DeTransition)
  246.                 {
  247.                     Cursor_position++;
  248.                     Audio->PlaySound(SFX_CURSOR);
  249.                 }
  250.                 else if (Input->Press[CB_LEFT] and !ActiveMenu_Transition and !ActiveMenu_DeTransition)
  251.                 {
  252.                     Cursor_position--;
  253.                     Audio->PlaySound(SFX_CURSOR);
  254.                 }
  255.                 else if (Input->Press[CB_UP] and !ActiveMenu_Transition and !ActiveMenu_DeTransition)
  256.                 {
  257.                     Cursor_position -= 11;
  258.                     Audio->PlaySound(SFX_CURSOR);
  259.                 }
  260.                 else if (Input->Press[CB_DOWN] and !ActiveMenu_Transition and !ActiveMenu_DeTransition)
  261.                 {
  262.                     Cursor_position += 11;
  263.                     Audio->PlaySound(SFX_CURSOR);
  264.                 }
  265.                
  266.                 if(Cursor_position >= 33)
  267.                 {
  268.                     Cursor_position -= 33;
  269.                     Audio->PlaySound(SFX_CURSOR);
  270.                 }
  271.                 else if(Cursor_position < 0)
  272.                 {
  273.                     Cursor_position += 33;
  274.                     Audio->PlaySound(SFX_CURSOR);
  275.                 }
  276.                
  277.                 //Selected Item
  278.                 Item_index = Item_Locations[Cursor_position];
  279.                 itemdata id = Game->LoadItemData(Item_index);
  280.                 int str[512];
  281.                 id->GetName(str);
  282.                
  283.                 if (Item_index == 0)
  284.                 {
  285.                     Screen->DrawString(1, 128, ActiveMenu_Y1 + 148, FONT_LA, Color_White, Color_Black, TF_CENTERED, "", OP_OPAQUE); //(Selected Item) Item Name
  286.                 }
  287.                 else
  288.                 {
  289.                     Screen->DrawTile(1, 120, ActiveMenu_Y1 + 116, id->Tile, 1, 1, id->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  290.                     Screen->DrawString(1, 128, ActiveMenu_Y1 + 148, FONT_LA, Color_White, Color_Black, TF_CENTERED, str, OP_OPAQUE); //(Selected Item) Item Name
  291.                 }
  292.                
  293.                 if (Input->Press[CB_A] and !ActiveMenu_Transition and !ActiveMenu_DeTransition)
  294.                 {
  295.                     Hero->SetItemSlot(Item_index, 1, 1);
  296.                 }
  297.                 else if (Input->Press[CB_B] and !ActiveMenu_Transition and !ActiveMenu_DeTransition)
  298.                 {
  299.                     Hero->SetItemSlot(Item_index, 2, 1);
  300.                 }
  301.             }
  302.             else if (ActiveMenu_Page == 2)
  303.             {
  304.                 //Drawing Text, Cursor, and Menu's
  305.                 Screen->DrawString(1, 128, ActiveMenu_Y1 + 10, FONT_LA, Color_White, Color_Black, TF_CENTERED, "Equipment Screen", OP_OPAQUE); //Item Screen Text
  306.             }
  307.  
  308.             Waitframe();
  309.         }
  310.         until(ActiveMenu_DeTransition_Phase == 2 and ActiveMenu_DeTransition); //Stop running the menu
  311.     }
  312. }
  313.  
  314. dmapdata script FinalPassiveSubscreen
  315. {
  316.     void run()
  317.     {      
  318.         while(true)
  319.         {
  320.             // Passive subscreen draws
  321.             Waitframe();
  322.         }
  323.     }
  324. }
Advertisement
Add Comment
Please, Sign In to add comment