OmegaGamingHunters

ZC subscreens

Apr 19th, 2020
2,045
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.75 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.         //declare variables here
  23.         bool ActiveMenu_Transition = true; //The trigger that transitions the game into the menu
  24.         int ActiveMenu_Transition_Phase = 0; //The stage in the transition the menu is in
  25.         int ActiveMenu_Background_Alpha = 64; //The transparency of the menu
  26.         int ActiveMenu_Menu_Alpha = 0; //The alpha for the menu and item's
  27.         int ActiveMenu_Alpha_Timer_1 = 0; //Timer for the pace of the alpha transition
  28.         int ActiveMenu_Alpha_Timer_2 = 0; //Timer for the pace of the alpha transition
  29.        
  30.         int ActiveMenu_Page = 1; //The Page the ActiveSubScreen is On
  31.         int ActiveMenu_Layer = 0; //The Layer the ActiveSubScreen is On
  32.         int ActiveMenu_X1 = 0; //X1 Position of the ActiveSubScreen
  33.         int ActiveMenu_Y1 = 176; //Y1 Position of the ActiveSubScreen
  34.         int ActiveMenu_X2 = 256; //X2 Position of the ActiveSubScreen
  35.         int ActiveMenu_Y2 = 176; //Y2 Position of the ActiveSubScreen
  36.        
  37.         do
  38.         {
  39.             //Transition Period
  40.             if (ActiveMenu_Transition == true)
  41.             {
  42.                 if (ActiveMenu_Transition_Phase == 0) //Sound Effect
  43.                 {
  44.                     Audio->PlaySound(SFX_MENU_OPEN);
  45.                     ActiveMenu_Transition_Phase = 1;
  46.                 }
  47.                 else if (ActiveMenu_Transition_Phase == 1) //Fade in the background
  48.                 {
  49.                     if (ActiveMenu_Y1 > 0)
  50.                     {
  51.                         ActiveMenu_Y1 -= 4;
  52.                     }
  53.                     else
  54.                     {
  55.                         ActiveMenu_Transition_Phase = 2;
  56.                     }
  57.                 }
  58.                 else
  59.                 {
  60.                     ActiveMenu_Transition = false;
  61.                 }
  62.             }
  63.             //Code for drawing the subscreen
  64.             Screen->Rectangle(ActiveMenu_Layer, ActiveMenu_X1, ActiveMenu_Y1, ActiveMenu_X2, ActiveMenu_Y2, Color_Black, 1, 0, 0, 0, true, 128); //Background
  65.            
  66.             //Item Screen
  67.             if (ActiveMenu_Page == 1)
  68.             {
  69.                 //Title
  70.                 Screen->DrawString(1, 128, ActiveMenu_Y1 + 10, FONT_LA, Color_White, Color_Black, TF_CENTERED, "Item Screen", 128);
  71.                
  72.                 //Menu
  73.                 Screen->DrawTile(1, 10, ActiveMenu_Y1 + 20, 20053, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, 128); //Top-Left Cornor
  74.                 Screen->DrawTile(1, 230, ActiveMenu_Y1 + 20, 20055, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, 128); //Top-Right Cornor
  75.                 Screen->DrawTile(1, 10, ActiveMenu_Y1 + 84, 20093, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, 128); //Bottom-Left Cornor
  76.                 Screen->DrawTile(1, 230, ActiveMenu_Y1 + 84, 20095, 1, 1, 7, -1, -1, 0, 0, 0, 0, true, 128); //Bottom-Right Cornor
  77.                 Screen->DrawTile(1, 26, ActiveMenu_Y1 + 20, 20054, 1, 1, 7, 204, 16, 0, 0, 0, 0, true, 128); //Top-Edge
  78.                 Screen->DrawTile(1, 26, ActiveMenu_Y1 + 84, 20094, 1, 1, 7, 204, 16, 0, 0, 0, 0, true, 128); //Bottom-Edge
  79.                 Screen->DrawTile(1, 10, ActiveMenu_Y1 + 36, 20073, 1, 1, 7, 16, 48, 0, 0, 0, 0, true, 128); //Left-Edge
  80.                 Screen->DrawTile(1, 230, ActiveMenu_Y1 + 36, 20075, 1, 1, 7, 16, 48, 0, 0, 0, 0, true, 128); //Right-Edge
  81.                
  82.                 //Drawing Items
  83.                 //Player's Sword
  84.                 if (Hero->Item[I_SWORD1] == true and Hero->Item[I_SWORD2] == false and Hero->Item[I_SWORD3] == false and Hero->Item[I_SWORD4] == false)
  85.                 {
  86.                     itemdata Sword = Game->LoadItemData(I_SWORD1);
  87.                     Screen->DrawTile(1, 20, ActiveMenu_Y1 + 30, Sword->Tile, 1, 1, Sword->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  88.                 }
  89.                 else if (Hero->Item[I_SWORD1] == true and Hero->Item[I_SWORD2] == true and Hero->Item[I_SWORD3] == false and Hero->Item[I_SWORD4] == false)
  90.                 {
  91.                     itemdata Sword = Game->LoadItemData(I_SWORD2);
  92.                     Screen->DrawTile(1, 20, ActiveMenu_Y1 + 30, Sword->Tile, 1, 1, Sword->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  93.                 }
  94.                 else if (Hero->Item[I_SWORD1] == true and Hero->Item[I_SWORD2] == true and Hero->Item[I_SWORD3] == true and Hero->Item[I_SWORD4] == false)
  95.                 {
  96.                     itemdata Sword = Game->LoadItemData(I_SWORD3);
  97.                     Screen->DrawTile(1, 20, ActiveMenu_Y1 + 30, Sword->Tile, 1, 1, Sword->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  98.                 }
  99.                 else if (Hero->Item[I_SWORD1] == true and Hero->Item[I_SWORD2] == true and Hero->Item[I_SWORD3] == true and Hero->Item[I_SWORD4] == true)
  100.                 {
  101.                     itemdata Sword = Game->LoadItemData(I_SWORD4);
  102.                     Screen->DrawTile(1, 20, ActiveMenu_Y1 + 30, Sword->Tile, 1, 1, Sword->CSet, -1, -1, 0, 0, 0, 0, true, 128);
  103.                 }
  104.             }
  105.             Waitframe();
  106.         }
  107.         until(Input->Press[CB_START] and ActiveMenu_Transition == false); //Stop running when the player presses start
  108.     }
  109. }
  110.  
  111. dmapdata script FinalPassiveSubscreen
  112. {
  113.     void run()
  114.     {      
  115.         while(true)
  116.         {
  117.             //Passive subscreen draws
  118.             Waitframe();
  119.         }
  120.     }
  121. }
Advertisement
Add Comment
Please, Sign In to add comment