Aldeia RPG

Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Suporte ao desenvolvimento de jogos


2 participantes

    Tempo dinâmico e Hora do Sistema

    Leandroteix
    Leandroteix
    Semi-Experiente
    Semi-Experiente


    Mensagens : 103
    Créditos : 19

    Sistema - Tempo dinâmico e Hora do Sistema Empty Tempo dinâmico e Hora do Sistema

    Mensagem por Leandroteix Dom Out 21, 2012 8:55 pm

    Sistema Tempo dinâmico e Hora do Sistema
    Versão: 1,0
    Autor: ThallionDarkshine (sem crédito necessário)
    Data: 25 de maio de 2012

    Histórico de versões

    2012.5.35 - Versão original

    Planejadas versões futuras

    Suporte para MAWS (Sistema de Meteorologia Modificado Avançado)

    Descrição

    Quando o jogo começa, o sistema meteorológico escolhe um tempo aleatório do dia. A tela muda de tons como o tempo passa, a cada minuto tendo uma certa quantidade de segundos especificado na configuração. Depois de um período de tempo aleatório, o tempo muda, ou ao normal, chuva, tempestade, neve, nevoeiro ou nuvens. A tempestade inclui um raio aleatório também.

    Características

    Pode desativar tempo aleatório
    Tempo muda dinamicamente
    Coloque (em) em nome do mapa para desativar tempo
    Alterar matiz tela com a hora do dia

    Imagens
    Spoiler:

    Instruções

    Para usar, coloque diretamente sob principal.
    Para ligar ou desligar o tempo aleatório (substituir verdadeiro com false para desativar):
    Código:
    $weather.rand_weather = true
    $weather.update

    Para alterar o da variância do tempo:
    Código:
    $weather.varience =


    Para alterar a base de tempo entre as mudanças climáticas:
    Código:
    $weather.base = 

    Para alterar o segundo equivalente de um minuto de tempo real:
    Código:
    $weather.min_equiv =



    Script:
    Código:
    module Weather_Config
      # Config
     
      WEATHER_VARIENCE = 520
      WEATHER_BASE = 200
      RANDOM_WEATHER = true
      MIN_EQUIV = 1/40
    end
     
    class Weather
      attr_accessor :varience
      attr_accessor :base
      attr_accessor :rand_weather
      attr_accessor :min_equiv
     
      def initialize
        @varience = Weather_Config::WEATHER_VARIENCE
        @base = Weather_Config::WEATHER_BASE
        @rand_weather = Weather_Config::RANDOM_WEATHER
        @min_equiv = Weather_Config::MIN_EQUIV
        @counter = [0, 0]
        @time = rand(24) * 60
        @wthr = 0
        hour = @time / 60
        if hour > 13
          change = hour - 14
        else
          change = 12 - hour
        end
        red = change * -9
        green = change * -9
        blue = change * -9
        gray = change * 12
        $game_screen.start_tone_change(Tone.new(red, green, blue, gray), 0)
        @weather_change = rand(@varience) + @base
        @red = red
        @green = green
        @blue = blue
        @s_hour = hour
        @s_wthr = 0
      end
     
      def rand_weather=(bool)
        @rand_weather = bool
        if @rand_weather == false
          $game_screen.weather(0, 0, 0)
          $game_system.bgs_fade(5)
          @wthr = 0
          $game_map.fog_name = ""
        end
      end
     
      def update
        if $game_temp.inside == true
          @counter[1] = nil
          $game_screen.weather(0, 0, 0)
        else
          @counter[1] = 0 if @counter[1] == nil
        end
        @counter[0] += 1
        @counter[1] += 1 if @counter[1] != nil
       
        if @counter[0] > Graphics.frame_rate * @min_equiv
          @time = (@time + 1) % (24 * 60 + 1)
          @counter[0] = 0
          hour = @time / 60
          if hour > 13
            change = hour - 14
          else
            change = 12 - hour
          end
          red = change * -9
          green = change * -9
          blue = change * -9
          gray = change * 12
          if @rand_weather == true
            if @counter[1] != nil and @counter[1] > @weather_change
              @lightning = false
              rnd = rand(8)
              case rnd
                when 0
                  $game_screen.weather(0, 0, 60)
                  $game_system.bgs_fade(10)
                when 1
                  $game_screen.weather(0, 0, 60)
                  $game_system.bgs_fade(10)
                  $game_screen.weather(1, rand(10), 200)
                  bgs = RPG::AudioFile.new("005-Rain01", 80, 100)
                  $game_system.bgs_play(bgs)
                when 2
                  $game_screen.weather(0, 0, 60)
                  $game_system.bgs_fade(10)
                  $game_screen.weather(2, rand(10), 200)
                  @lightning = true
                  bgs = RPG::AudioFile.new("007-Rain03", 100, 100)
                  $game_system.bgs_play(bgs)
                when 3
                  $game_screen.weather(0, 0, 60)
                  $game_system.bgs_fade(10)
                  $game_screen.weather(3, rand(10), 200)
                when 4
                  unless @wthr == 4
                    $game_screen.weather(0, 0, 60)
                    $game_system.bgs_fade(10)
                    $game_map.fog_name = "001-Fog01"
                    $game_map.fog_hue = 0
                    @fog_opac = rand(75) + 100
                    $game_map.fog_opacity = 0
                    $game_map.fog_sx = (rand(5) + 1) * 2
                    $game_map.fog_sy = (rand(5) + 1) * 2
                  end
                when 5
                  unless @wthr == 5
                    $game_screen.weather(0, 0, 60)
                    $game_system.bgs_fade(10)
                    $game_map.fog_name = "002-Clouds01"
                    $game_map.fog_hue = 0
                    @fog_opac = rand(75) + 50
                    $game_map.fog_opacity = 0
                    $game_map.fog_sx = (rand(5) + 1) * 4
                    $game_map.fog_sy = (rand(5) + 1) * 4
                  end
                when 6
                  $game_screen.weather(0, 0, 60)
                  $game_system.bgs_fade(10)
                when 7
                  $game_screen.weather(0, 0, 60)
                  $game_system.bgs_fade(10)
              end
              @wthr = rnd
              @weather_change = rand(@varience) + @base
              @counter[1] = 0
            end
            case @wthr
              when 1
                red -= 20
                blue -= 15
                green -= 20
              when 2
                red -= 30
                blue -= 20
                green -= 30
              when 3
                red += 5
                blue += 10
                green += 5
              when 4
                red -= 5
                green -= 5
                gray -= 20
            end
          end
          if @wthr != @s_wthr or hour != @s_hour 
            $game_screen.start_tone_change(Tone.new(red, green, blue, gray), 60)
          end
         
          if (@wthr == 4 or @wthr == 5) and $game_map.fog_opacity != @fog_opac
            $game_map.fog_opacity += 1
          else
            if $game_map.fog_name != ""
              $game_map.fog_opacity -= 1
              if $game_map.fog_opacity == 0
                $game_map.fog_name = ""
                $game_map.fog_sx = 0
                $game_map.fog_sy = 0
              end
            end
          end
         
          if @lightning == true
            if rand(120) == 0
              $game_screen.start_flash(Color.new(255, 255, 255), rand(9) + 1)
            end
          end
        end
      end
    end
     
    class Scene_Map
      alias dwt_orig_update update
     
      def update
        $weather.update
        dwt_orig_update
      end
    end
     
    class Scene_Title
      alias dwt_orig_command_new_game command_new_game
     
      def command_new_game
        dwt_orig_command_new_game
        $weather = Weather.new
      end
    end
     
    class Game_Temp
      attr_accessor :inside
     
      alias dwt_orig_init initialize
     
      def initialize
        dwt_orig_init
        @inside = false
      end
    end
     
    class Scene_Save
      alias dwt_orig_write_save_data write_save_data
     
      def write_save_data(file)
        dwt_orig_write_save_data(file)
        Marshal.dump($weather, file)
      end
    end
     
    class Scene_Load
      alias dwt_orig_read_save_data read_save_data
     
      def read_save_data(file)
        dwt_orig_read_save_data(file)
        $weather = Marshal.load(file)
      end
    end

    Crédito

    ThallionDarkshine

    Obrigado

    Minha irmã, a quem eu fiz isso como parte de um jogo para.

    Suporte

    Basta postar quaisquer questões aqui.

    Problemas de compatibilidade conhecidos

    Não que eu saiba.

    Programa demonstrativo

    https://rapidshare.com/files/2898565759/Weather_Demo.exe

    Notas do Autor

    Nada

    Termos de Utilização

    Usar livremente, sem crédito necessário.

    Leandroteix - Tradução do Tópico.
    Samuka_Maker
    Samuka_Maker
    Aldeia Friend
    Aldeia Friend


    Medalhas : Sistema - Tempo dinâmico e Hora do Sistema WBLhI
    Mensagens : 1204
    Créditos : 127

    Sistema - Tempo dinâmico e Hora do Sistema Empty Re: Tempo dinâmico e Hora do Sistema

    Mensagem por Samuka_Maker Dom Out 21, 2012 9:15 pm

    é um bom system amigo, usarei ele no tlbh *-*, eu ia faser um mas nao precise de tanto trabalho e.e
    vlws
    Successful


    _________________

    Life rpg maker, suporte para criacao de jgoos online eoffline, link do forum:(v2.0)
    http://liferpgmakerv2.forumais.com/

    Sistema - Tempo dinâmico e Hora do Sistema 6f4EA

    Sistema - Tempo dinâmico e Hora do Sistema Bxvno
    Tópico original/Tópico de Recrutamento

      Data/hora atual: Dom maio 19, 2024 5:18 pm