赞 | 0 |
VIP | 187 |
好人卡 | 12 |
积分 | 1 |
经验 | 6042 |
最后登录 | 2012-10-8 |
在线时间 | 333 小时 |
Lv1.梦旅人 穿越一季:朔
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 333 小时
- 注册时间
- 2007-4-11
- 帖子
- 5369
|
本帖最后由 塑望 于 2009-7-3 12:50 编辑
- #--------------------------------------------------------------------------
- # 使用方法:打开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
复制代码 ------------------
补充:因为无聊,所以现在把上面修改成了支持昼夜的 =_= 原版点以下地址飞过去
http://rpg.blue/viewthread.php?tid=125202
--------------
自己定义以上变量的数值。如48号变量定义为10 那么就是10点 其他类推。时间运行速度自己改。
昼夜系统除外的房间自己定义即可
仅供参考而已。。。。 |
|