Advertisement
polectron

luminol

Apr 1st, 2020
512
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.30 KB | None | 0 0
  1. # frozen_string_literal: true
  2.  
  3. def lightsOn
  4.     $game_screen.start_tone_change(Tone.new(0, 0, 0), 10);
  5.     while $PokemonTemp.darknessSprite.radius<=255
  6.         Graphics.update
  7.         Input.update
  8.         pbUpdateSceneMap
  9.         $PokemonTemp.darknessSprite.radius += 5
  10.         $game_map.fog_opacity -= 20
  11.     end
  12.  
  13.     $PokemonGlobal.flashUsed = false
  14.     $PokemonTemp.darknessSprite.dispose
  15.     $game_map.fog_name = ""
  16.  
  17.     $game_switches[59] = false
  18.     $game_map.refresh
  19. end
  20.  
  21. def lightsOff(tone)
  22.     $PokemonGlobal.flashUsed = true
  23.     $PokemonTemp.darknessSprite = DarknessSprite.new
  24.     darkness = $PokemonTemp.darknessSprite
  25.     darkness.radius = 255
  26.    
  27.     $game_screen.start_tone_change(tone, 10);
  28.  
  29.     $game_map.fog_name = "guia1"
  30.     $game_map.fog_zoom = 100
  31.     $game_map.fog_opacity = 0
  32.     $scene.spriteset.fog.z = 1
  33.  
  34.     while darkness.radius>100
  35.         Graphics.update
  36.         Input.update
  37.         pbUpdateSceneMap
  38.         $game_map.fog_opacity += 5
  39.         darkness.radius -= 5
  40.     end
  41.  
  42.     $scene.spriteset.addUserSprite(darkness)
  43.  
  44.     $game_switches[59] = true
  45.     $game_map.refresh
  46. end
  47.  
  48. def lightsToggle(tone)
  49.     if !$PokemonTemp.darknessSprite || $PokemonTemp.darknessSprite.disposed?
  50.         lightsOff(tone)
  51.     else
  52.         lightsOn
  53.     end
  54. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement