ZoriaRPG

Set Day/Night Palette for Binx

Jun 21st, 2018
136
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void DoDayNightPalette()
  2. {
  3.     dmapdata dm = Game->LoadDMapData(Game->GetCurDMap());
  4.     int type = dm->Type;
  5.     if ( type == DMT_INTERIOR )
  6.     {
  7.         //CLEAR PALETTE TO BASE IF NEEDED
  8.         return;
  9.     }
  10.     if ( type == DMT_DUNGEON )
  11.     {
  12.         //CLEAR PALETTE TO BASE IF NEEDED
  13.         return;
  14.     }
  15.     if ( Time[TIME_HOUR] <= 5 )
  16.     {
  17.         CYCLE = SUNRISE;
  18.         Game->DMapPalette[Game->GetCurDMap()] = SUNRISE_PAL;
  19.         return;
  20.     }
  21.     else if (  Time[TIME_HOUR] <= 11 )
  22.     {
  23.         CYCLE = DAY;
  24.         Game->DMapPalette[Game->GetCurDMap()] = DAY_PAL;
  25.         return;
  26.     }
  27.     else if (  Time[TIME_HOUR] <= 17 )
  28.     {
  29.         CYCLE = SUNSET;
  30.         Game->DMapPalette[Game->GetCurDMap()] = SUNRISET_PAL;
  31.         return;
  32.     }
  33.     else
  34.     {
  35.         CYCLE = NIGHT;
  36.         Game->DMapPalette[Game->GetCurDMap()] = NIGHT_PAL;
  37.         return;
  38.     }
  39. }
RAW Paste Data