Project1

标题: 日期,天气,昼夜系统(养成游戏可用)----进行修改 [打印本页]

作者: wingcyx    时间: 2008-5-8 02:23
标题: 日期,天气,昼夜系统(养成游戏可用)----进行修改
在游戏中出现了读取游戏错误!后来进过多次调试发现!原来是季节时间读取错误!

后来经过改进:修改一下代码!

windows time3 中 第452开始进行修改!

  def get_tone
    case $game_variables[$season]
    #春天的时间色调
    when 1
      case $game_variables[$hour]
      when 1,2
        $tone_R, $tone_G, $tone_B, $tone_K = [-187, -153, -102, 119]#午夜
      when 3
        $tone_R, $tone_G, $tone_B, $tone_K = [-51, -51, -51, 170]#凌晨
      when 4
        $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 40]#天刚亮
      when 5
        $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 0]#天全亮
      when 6
        if $game_variables[$min] >= 3
          $tone_R, $tone_G, $tone_B, $tone_K = [68, 68, 44, 204]#日正当中
        else
          $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 0]#天全亮
        end
      when 7,8
        $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 0]#天全亮
      when 9
        if $game_variables[$min] >= 3
          $tone_R, $tone_G, $tone_B, $tone_K = [68, 17, -17, 204]#日斜西
        else
          $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 0]#天全亮
        end
      when 10
        $tone_R, $tone_G, $tone_B, $tone_K = [68, 0, -17, 204]#黄昏
      when 11
        if $game_variables[$min] < 3
          $tone_R, $tone_G, $tone_B, $tone_K = [-51, -51, -51, 170]#天刚黑
        elsif $game_variables[$min] >= 3
          $tone_R, $tone_G, $tone_B, $tone_K = [-187, -153, -102, 119]#午夜
        end
      when 12
          $tone_R, $tone_G, $tone_B, $tone_K = [-187, -153, -102, 119]#午夜
      end #end case
      
    #夏天的时间色调
    when 2
      case $game_variables[$hour]
      when 1,2
        $tone_R, $tone_G, $tone_B, $tone_K = [-187, -153, -102, 119]#午夜
      when 3
        if $game_variables[$min] < 3
          $tone_R, $tone_G, $tone_B, $tone_K = [-51, -51, -51, 170]#凌晨
        elsif $game_variables[$min] >= 3
          $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 40]#天刚亮
        end
      when 4
        if $game_variables[$min] >= 3
          $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 0]#天全亮
        else
          $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 40]#天刚亮
        end
      when 5
          $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 0]#天全亮
      when 6
        if $game_variables[$min] >= 3
          $tone_R, $tone_G, $tone_B, $tone_K = [68, 68, 44, 204]#日正当中
        else
          $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 0]#天全亮
        end
      when 7,8,9
        $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 0]#天全亮
      when 10
        if $game_variables[$min] == 4
          $tone_R, $tone_G, $tone_B, $tone_K = [68, 0, -17, 204]#黄昏
        elsif $game_variables[$min] < 3
          $tone_R, $tone_G, $tone_B, $tone_K = [68, 17, -17, 204]#日斜西
        else
          $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 0]#天全亮
        end
      when 11
        if $game_variables[$min] < 3
          $tone_R, $tone_G, $tone_B, $tone_K = [-51, -51, -51, 170]#天刚黑
        elsif $game_variables[$min] >= 3
          $tone_R, $tone_G, $tone_B, $tone_K = [-187, -153, -102, 119]#午夜
        end
      when 12
          $tone_R, $tone_G, $tone_B, $tone_K = [-187, -153, -102, 119]#午夜
      end #end case
      
    #秋天的时间色调
    when 3
      case $game_variables[$hour]
      when 1
        $tone_R, $tone_G, $tone_B, $tone_K = [-187, -153, -102, 119]#午夜
      when 2,3
        $tone_R, $tone_G, $tone_B, $tone_K = [-51, -51, -51, 170]#凌晨
      when 4
        $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 40]#天刚亮
      when 5
        $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 0]#天全亮
      when 6
        if $game_variables[$min] >= 3
          $tone_R, $tone_G, $tone_B, $tone_K = [68, 68, 44, 204]#日正当中
        else
          $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 0]#天全亮
        end
      when 7,8
        $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 0]#天全亮
      when 9
        if $game_variables[$min] >= 3
          $tone_R, $tone_G, $tone_B, $tone_K = [68, 17, -17, 204]#日斜西
        else
          $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 0]#天全亮
        end
      when 10
        $tone_R, $tone_G, $tone_B, $tone_K = [68, 0, -17, 204]#黄昏
      when 11
        if $game_variables[$min] < 3
          $tone_R, $tone_G, $tone_B, $tone_K = [-51, -51, -51, 170]#天刚黑
        elsif $game_variables[$min] >= 3
          $tone_R, $tone_G, $tone_B, $tone_K = [-187, -153, -102, 119]#午夜
        end
      when 12
          $tone_R, $tone_G, $tone_B, $tone_K = [-187, -153, -102, 119]#午夜
      end #end case
    when 4
      
    #冬天的时间色调
      case $game_variables[$hour]
      when 1
        $tone_R, $tone_G, $tone_B, $tone_K = [-187, -153, -102, 119]#午夜
      when 2,3
        $tone_R, $tone_G, $tone_B, $tone_K = [-51, -51, -51, 170]#凌晨
      when 4
        if $game_variables[$min] >= 3
          $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 40]#天刚亮
        else
          $tone_R, $tone_G, $tone_B, $tone_K = [-51, -51, -51, 170]#凌晨
        end
      when 5
        $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 0]#天全亮
      when 6
        if $game_variables[$min] >= 3
          $tone_R, $tone_G, $tone_B, $tone_K = [68, 68, 44, 204]#日正当中
        else
          $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 0]#天全亮
        end
      when 7
        $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 0]#天全亮
      when 8
        $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 0]#天全亮
      when 9
        if $game_variables[$min] >= 3
          $tone_R, $tone_G, $tone_B, $tone_K = [68, 17, -17, 204]#日斜西
        else
          $tone_R, $tone_G, $tone_B, $tone_K = [0, 0, 0, 0]#天全亮
        end
      when 10
        $tone_R, $tone_G, $tone_B, $tone_K = [68, 0, -17, 204]#黄昏
      when 11
        if $game_variables[$min] < 3
          $tone_R, $tone_G, $tone_B, $tone_K = [-51, -51, -51, 170]#天刚黑
        elsif $game_variables[$min] >= 3
          $tone_R, $tone_G, $tone_B, $tone_K = [-187, -153, -102, 119]#午夜
        end
      when 12
          $tone_R, $tone_G, $tone_B, $tone_K = [-187, -153, -102, 119]#午夜
      end #end case
    end # end case
  end


这样游戏读取就不会再出现错误了! [LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: havealook    时间: 2008-5-8 02:25
LZ请发到技术区 - -,这里是提问区 [LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1