| 
 
| 赞 | 0 |  
| VIP | 187 |  
| 好人卡 | 12 |  
| 积分 | 1 |  
| 经验 | 6042 |  
| 最后登录 | 2012-10-8 |  
| 在线时间 | 333 小时 |  
 Lv1.梦旅人 穿越一季:朔 
	梦石0 星屑50 在线时间333 小时注册时间2007-4-11帖子5369 
 | 
| 
本帖最后由 塑望 于 2009-7-3 12:52 编辑
x
加入我们,或者,欢迎回来。您需要 登录 才可以下载或查看,没有帐号?注册会员  
 效果:年,月,天,时,分,秒全部可以挂上变量 直接可以在如11点11分11秒开启某事件
 
 
 默认是50号开关 开启/关闭 时间窗口
 
 
 
 效果图
 
 ![]() 
 2009.05.19更新日志:
 1,直接可以在脚本定义所有内容。初始时间只需在地图定义个变量数值即可,因为算法已经代入到脚本里。修改运算幅度是脚本39行
 2,优化下。初始时间为星期一.0点0分0秒.添加日期功能(如年,月)自行添加
 
 2009.07.03更新日志:
 1,添加昼夜版.往下拉
 
 
 直接MAIN前插入
 工程(714KB):http://rpg.blue/upload_program/d ... ��作_123119477.rar(工程保留.不过里面脚本为事件关联算法.即在公共事件里定义时间算法.不推荐伸手党使用.伸手党自行复制以上脚本)复制代码#--------------------------------------------------------------------------
  # 使用方法:打开50号(默认)开启时间功能,关闭50号则窗口关闭
  # 
  # 如当周六晚8点 某商店才会开门(某事件在指定时间触发)
  #
  #定义时间算法在脚本39行
  #                                       66RPG 沉默一秒钟(塑望)
  #                                       Blog:hi.baidu.com/yuilife
  #转载请保留以上信息
  #--------------------------------------------------------------------------
class Window_Time < Window_Base
  
  $时间窗口开关 = 50 #时间的开关
  #----------以上为开关----------#
  #----------以下为变量----------#
  $天 = 49 #天的变量
  $时 = 48 #时的变量
  $分 = 47 #分的变量
  $秒 = 46 #秒的变量
  
  #--------------------------------------------------------------------------
  # ● 初始化对像 
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 250, 55) #窗口坐标以及大小
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 0
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 刷新  
  #--------------------------------------------------------------------------
  def refresh
    if $game_switches[$时间窗口开关]
    self.opacity = 255
    self.contents.font.color = system_color
    self.contents.font.size = 18
         $game_variables[$秒] += 0.2#日期运算速度这里改.秒的运算
   if $game_variables[$秒] >= 60
     $game_variables[$秒] = 0
     $game_variables[$分] += 1
   end 
   
   if $game_variables[$分] >= 60
     $game_variables[$分] = 0
     $game_variables[$时] += 1
   end 
   
   if $game_variables[$时] >= 24
     $game_variables[$时] = 0
     $game_variables[$天] += 1
   end
      if $game_variables[$天] >= 8
     $game_variables[$天] = 1
   end
  self.contents.clear
    if $game_variables[$时] >= 0 and $game_variables[$时] <= 12
      self.contents.draw_text(4, -2, 120, 32, "AM")
    elsif $game_variables[$时] >= 12 and $game_variables[$时] <= 24
      self.contents.draw_text(4, -2, 120, 32, "PM")
    end
    self.contents.font.color = system_color
    text = sprintf("星期"+"%01d  %02d:%02d:%02d", $game_variables[$天], $game_variables[$时], $game_variables[$分], $game_variables[$秒])
    self.contents.font.color = normal_color
    self.contents.draw_text(0, -2, 250, 32, text, 1)
  else
   self.contents.clear
    self.opacity = 0 
  end
end
#--------------------------------------------------------------------------
  # ● 刷新画面
  #--------------------------------------------------------------------------
  def update
    super
      refresh
  end
end
#以下请无视 =_=
class Scene_Map
  #--------------------------------------------------------------------------
  # ● 主处理
  #--------------------------------------------------------------------------
  def main
    # 生成活动块
    @spriteset = Spriteset_Map.new
    # 生成信息窗口
    @message_window = Window_Message.new
    @time_window = Window_Time.new 
    $game_variables[$天] = 1
    # 执行过渡
    Graphics.transition
    # 主循环
    loop do
      # 刷新游戏画面
      Graphics.update
      # 刷新输入信息
      Input.update
      # 刷新画面
      update
      # 如果画面切换的话就中断循环
      if $scene != self
        break
      end
    end
    # 准备过渡
    Graphics.freeze
    # 释放活动块
    @spriteset.dispose
    # 释放信息窗口
    @message_window.dispose
    @time_window.dispose
    # 标题画面切换中的情况下
    if $scene.is_a?(Scene_Title)
      # 淡入淡出画面
      Graphics.transition
      Graphics.freeze
    end
  end
alias timedate_update update
def update
  @time_window.update
   timedate_update
 end 
 end
 ------------------------------
 以下为昼夜版
 ----------------------------------
 复制代码#--------------------------------------------------------------------------
  # 使用方法:打开50号(默认)开启时间功能,关闭50号则窗口关闭
  #
  #
  #
  #
  #                                       66RPG 沉默一秒钟(塑望)
  #                                       Blog:hi.baidu.com/yuilife
  #(加入昼夜系统版。2.0版)
  #转载请保留以上信息
  #--------------------------------------------------------------------------
class Window_Time < Window_Base
  
  $时间窗口开关 = 50 #时间的开关
  #----------以上为开关----------#
  #----------以下为变量----------#
  $天 = 49 #天的变量
  $时 = 48 #时的变量
  $分 = 47 #分的变量
  $秒 = 46 #秒的变量
  $白天 = Tone.new(0,0,0,0)#白天的色调值
  $晚上 = Tone.new(-100,-100,-100,0)#夜晚的色调值
  HOUSE_ID = [2,3,4,5,6] #进入指定地图(ID)后不改变色调(天气).可以进行修改或添加
  
  #--------------------------------------------------------------------------
  # ● 初始化对像 
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 250, 55) #窗口坐标以及大小
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 0
    @id = $game_map.map_id
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 刷新  
  #--------------------------------------------------------------------------
  def refresh
    if $game_switches[$时间窗口开关]
    self.opacity = 255
    self.contents.font.color = system_color
    self.contents.font.size = 18
         $game_variables[$秒] += 0.1#日期速度
   if $game_variables[$秒] >= 60
     $game_variables[$秒] = 0
     $game_variables[$分] += 1
   end 
   
   if $game_variables[$分] >= 60
     $game_variables[$分] = 0
     $game_variables[$时] += 1
   end 
   
   if $game_variables[$时] >= 24
     $game_variables[$时] = 0
     $game_variables[$天] += 1
   end
      if $game_variables[$天] >= 8
     $game_variables[$天] = 1
   end
    self.contents.clear  
    if $game_variables[$时] >= 0 and $game_variables[$时] <= 12
      $game_screen.start_tone_change($白天,0)
      self.contents.draw_text(4, -2, 120, 32, "AM")
    elsif $game_variables[$时] >= 12 and $game_variables[$时] <= 24
      $game_screen.start_tone_change($晚上,0)
      self.contents.draw_text(4, -2, 120, 32, "PM")
    end
    if HOUSE_ID.include?($game_map.map_id)
        $game_screen.start_tone_change($白天,0)
      end  
    self.contents.font.color = system_color
    text = sprintf("星期"+"%01d  %02d:%02d:%02d", $game_variables[$天], $game_variables[$时], $game_variables[$分], $game_variables[$秒])
    self.contents.font.color = normal_color
    self.contents.draw_text(0, -2, 250, 32, text, 1)
  else
 self.contents.clear
    self.opacity = 0 
  end
end
#--------------------------------------------------------------------------
  # ● 刷新画面
  #--------------------------------------------------------------------------
  def update
    super
      refresh
  end
end
#以下请无视 =_=
class Scene_Map
  #--------------------------------------------------------------------------
  # ● 主处理
  #--------------------------------------------------------------------------
  def main
    # 生成活动块
    @spriteset = Spriteset_Map.new
    # 生成信息窗口
    @message_window = Window_Message.new
    @time_window = Window_Time.new 
    $game_variables[$天] = 1
    # 执行过渡
    Graphics.transition
    # 主循环
    loop do
      # 刷新游戏画面
      Graphics.update
      # 刷新输入信息
      Input.update
      # 刷新画面
      update
      # 如果画面切换的话就中断循环
      if $scene != self
        break
      end
    end
    # 准备过渡
    Graphics.freeze
    # 释放活动块
    @spriteset.dispose
    # 释放信息窗口
    @message_window.dispose
    @time_window.dispose
    # 标题画面切换中的情况下
    if $scene.is_a?(Scene_Title)
      # 淡入淡出画面
      Graphics.transition
      Graphics.freeze
    end
  end
alias timedate_update update
def update
  @time_window.update
   timedate_update
 end 
end
#end
 | 
 |