Fashy

RSONMSG - 2

Apr 14th, 2020
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.75 KB | None | 0 0
  1. --=====================--#
  2. # Rhyan Sound Message :| #
  3. #--=============--==================================================================#                                                                                  
  4. # Falando sério, se quiser usar, usa. Créditos são necessários.                     #
  5. # apreciado.             #==========================================================#
  6. #                        #
  7. # Tenha bom uso.         #
  8. #------------------------#
  9.  
  10. module RSONMSG
  11.   Rsonmsg = true # <- Aqui ativa/desativa o script, caso queira.
  12.   Volume_SE = 75  # <- Volumo da SE.
  13.   SE = "se_talking" # <- Define qual vai ser a SE do sonzinho. Não é necessário...
  14.   #...colocar o ".ogg".
  15.  
  16.   Frequencia = 6 # <- Defina a frequência de sonzinhos. (Aumentar faz com que...
  17.   #...a quantidade sonzinhos diminua. Diminuir faz o contrário (aumenta a...
  18.   # quantidade de sonzinhos. Entendeu?
  19.  
  20. end
  21.  
  22. class Window_Message < Window_Base
  23.  
  24.   alias :rsonmsg_wait_for_one_character :wait_for_one_character
  25.   alias :rsonmsg_initialize :initialize
  26.  
  27.   def initialize
  28.     rsonmsg_initialize
  29.     @ccount = 0
  30.     @frequency = rand(RSONMSG::Frequencia) + 1 # <- Aqui basicamente faz com que o sonzinho tenha...
  31.     #...frequências randõmicas, o que causa ilusão de "fala".
  32.   end
  33.  
  34.   def wait_for_one_character
  35.     rsonmsg_wait_for_one_character
  36.    
  37.     if RSONMSG::Rsonmsg == true # <- Se o script estiver ativo, ele executa tudo.
  38.       if @ccount == @frequency
  39.         RPG::SE.new(RSONMSG::SE, @vol = RSONMSG::Volume_SE).play # <- Toca a SE.
  40.         @ccount = 0
  41.         @frequency = rand(RSONMSG::Frequencia) + 1 # <- Outra parte do sistema de randomização da frequência.
  42.       else
  43.         @ccount +=1
  44.       end
  45.     end
  46.   end
  47. end
Advertisement
Add Comment
Please, Sign In to add comment