赞 | 5 |
VIP | 359 |
好人卡 | 195 |
积分 | 3 |
经验 | 560179 |
最后登录 | 2024-11-20 |
在线时间 | 1374 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 280
- 在线时间
- 1374 小时
- 注册时间
- 2005-10-16
- 帖子
- 5113
|
- #==========================================================================
- # ■ Window_Base
- #--------------------------------------------------------------------------
- # 游戏中全部窗口的超级程序。
- # 由 Kevin Chang 制作,发布请保留原作者讯息。
- #==========================================================================
- class Window_Base < Window
- #------------------------------------------------------------------------
- #●日夜控制系统初始控制设定
- #------------------------------------------------------------------------
- Ctrl_daylight_sys = 6 #日夜控制系统开关编号,预设 开关6
- Ctrl_in_house = 5 #屋内/洞穴亮度恢复开关编号,预设 开关5
- Ctrl_morning = 4 #晨间作息开关编号,预设 开关4
- Ctrl_day = 1 #日间作息开关编号,预设 开关1
- Ctrl_afternoon = 2 #午间作息开关编号,预设 开关2
- Ctrl_night = 3 #夜间作息开关编号,预设 开关3
-
- $Ctrl_Set_hour = 6 #设定起始时间(小时)之变量编号,默认 变数6
- $Day_sec = 6 #时间轴秒的进制 预设为 6 进制(0~5)
- $Day_min = 6 #ㄧ小时几分钟的进制 预设为 6 进制(0~5)
- $Day_hour = 11 #每天为几小时的进制 预设为 12 小时1天(0~11)
- #------------------------------------------------------------------------
- # ● 初始化对像
- # x : 窗口的 X 坐标
- # y : 窗口的 Y 坐标
- # width : 窗口的宽
- # height : 窗口的宽
- #------------------------------------------------------------------------
- def initialize(x, y, width, height)
- super()
- @windowskin_name = $game_system.windowskin_name
- self.windowskin = RPG::Cache.windowskin(@windowskin_name)
- self.x = x
- self.y = y
- self.width = width
- self.height = height
- self.z = 100
- end
- #------------------------------------------------------------------------
- #洞穴 屋内亮度正常化
- #------------------------------------------------------------------------
- def inside_normal
- if $game_switches[Ctrl_in_house] == true
- $game_screen.start_tone_change(Tone.new(0,0,0,0),5)
- end
- end
- #------------------------------------------------------------------------
- #---------------------------------------
- #时段使用图案代表
- #---------------------------------------
- def show_day #时段图案函式
- testname=$hour.to_s#将角色ID编号,转成字符串变量(to_s) 并存到testname
- bitmap=Bitmap.new("Graphics/pictures/#{testname}")#取出路径Graphics/pictures/下 testname 文件名的图
- src_rect=Rect.new(0,0,bitmap.width,bitmap.height)
- self.contents.blt(20,4,bitmap,src_rect)
- end
-
- #---------------------------------------
- #-----------------------------------------
- #天气变化
- #-----------------------------------------
- def weather_decision
- if $game_switches[Ctrl_in_house] == true
- $game_screen.weather(0, 3, 1)
- else
- w_d = rand(100)
- if w_d >= 0 and w_d <= 80
- $game_screen.weather(0, 3, 50) #正常(类型0正常1雨天2刮风3下雪,强度,时间/10)
- else
- if w_d > 80 and w_d <= 90
- $game_screen.weather(1, 5, 50)#雨天
- else
- if w_d > 90 and w_d <= 100
- $game_screen.weather(1, 10, 500)#刮风
- end
- end
- end
- end
- end
- #---------------------------------------
- #------------各时间颜色变化---------------------
- def the_time
- case $hour
- when 11
- #self.contents.draw_text(0, 0, 120, 32, "『夜』")
- $game_screen.start_tone_change(Tone.new(-136,-136,0,136),50)
- inside_normal
- #show_day #设定时段图案
- weather_decision
- $game_switches[Ctrl_morning] = false #晨间作息开关
- $game_switches[Ctrl_day] = false #日间作息开关
- $game_switches[Ctrl_afternoon] = false #午间作息开关
- $game_switches[Ctrl_night] = true #夜间作息开关
-
- when 0
- #self.contents.draw_text(0, 0, 120, 32, "『晨』")
- $game_screen.start_tone_change(Tone.new(0,0,85,85),50)
- inside_normal
- #show_day #设定时段图案
- weather_decision
- $game_switches[Ctrl_morning] = true #晨间作息开关
- $game_switches[Ctrl_day] = false #日间作息开关
- $game_switches[Ctrl_afternoon] = false #午间作息开关
- $game_switches[Ctrl_night] = false #夜间作息开关
-
- when 1
- #self.contents.draw_text(0, 0, 120, 32, "『晨』")
- $game_screen.start_tone_change(Tone.new(0,0,51,68),50)
- inside_normal
- #show_day #设定时段图案
- weather_decision
- $game_switches[Ctrl_morning] = true #晨间作息开关
- $game_switches[Ctrl_day] = false #日间作息开关
- $game_switches[Ctrl_afternoon] = false #午间作息开关
- $game_switches[Ctrl_night] = false #夜间作息开关
-
- when 2
- #self.contents.draw_text(0, 0, 120, 32, "『晨』")
- $game_screen.start_tone_change(Tone.new(0,0,0,40),50)
- inside_normal
- #show_day #设定时段图案
- weather_decision
- $game_switches[Ctrl_morning] = true #晨间作息开关
- $game_switches[Ctrl_day] = false #日间作息开关
- $game_switches[Ctrl_afternoon] = false #午间作息开关
- $game_switches[Ctrl_night] = false #夜间作息开关
-
- when 3
- #self.contents.draw_text(0, 0, 120, 32, "『日』")
- $game_screen.start_tone_change(Tone.new(0,0,0,0),50)
- inside_normal
- #show_day #设定时段图案
- weather_decision
- $game_switches[Ctrl_morning] = false #晨间作息开关
- $game_switches[Ctrl_day] = true #日间作息开关
- $game_switches[Ctrl_afternoon] = false #午间作息开关
- $game_switches[Ctrl_night] = false #夜间作息开关
-
- when 4
- #self.contents.draw_text(0, 0, 120, 32, "『日』")
- $game_screen.start_tone_change(Tone.new(50,0,0,0),50)
- inside_normal
- #show_day #设定时段图案
- weather_decision
- $game_switches[Ctrl_morning] = false #晨间作息开关
- $game_switches[Ctrl_day] = true #日间作息开关
- $game_switches[Ctrl_afternoon] = false #午间作息开关
- $game_switches[Ctrl_night] = false #夜间作息开关
-
- when 5
- #self.contents.draw_text(0, 0, 120, 32, "『日』")
- $game_screen.start_tone_change(Tone.new(100,34,51,0),50)
- inside_normal
- #show_day #设定时段图案
- weather_decision
- $game_switches[Ctrl_morning] = false #晨间作息开关
- $game_switches[Ctrl_day] = true #日间作息开关
- $game_switches[Ctrl_afternoon] = false #午间作息开关
- $game_switches[Ctrl_night] = false #夜间作息开关
-
- when 6
- #self.contents.draw_text(0, 0, 120, 32, "『午』")
- $game_screen.start_tone_change(Tone.new(100,34,-17,68),50)
- inside_normal
- #show_day #设定时段图案
- weather_decision
- $game_switches[Ctrl_morning] = false #晨间作息开关
- $game_switches[Ctrl_day] = false #日间作息开关
- $game_switches[Ctrl_afternoon] = true #午间作息开关
- $game_switches[Ctrl_night] = false #夜间作息开关
-
- when 7
- #self.contents.draw_text(0, 0, 120, 32, "『午』")
- $game_screen.start_tone_change(Tone.new(100,34,-20,170),50)
- inside_normal
- #show_day #设定时段图案
- weather_decision
- $game_switches[Ctrl_morning] = false #晨间作息开关
- $game_switches[Ctrl_day] = false #日间作息开关
- $game_switches[Ctrl_afternoon] = true #午间作息开关
- $game_switches[Ctrl_night] = false #夜间作息开关
-
- when 8
- #self.contents.draw_text(0, 0, 120, 32, "『午』")
- $game_screen.start_tone_change(Tone.new(68,0,-17,204),50)
- inside_normal
- #show_day #设定时段图案
- weather_decision
- $game_switches[Ctrl_morning] = false #晨间作息开关
- $game_switches[Ctrl_day] = false #日间作息开关
- $game_switches[Ctrl_afternoon] = true #午间作息开关
- $game_switches[Ctrl_night] = false #夜间作息开关
-
- when 9
- #self.contents.draw_text(0, 0, 120, 32, "『夜』")
- $game_screen.start_tone_change(Tone.new(0,0,0,204),50)
- inside_normal
- #show_day #设定时段图案
- weather_decision
- $game_switches[Ctrl_morning] = false #晨间作息开关
- $game_switches[Ctrl_day] = false #日间作息开关
- $game_switches[Ctrl_afternoon] = false #午间作息开关
- $game_switches[Ctrl_night] = true #夜间作息开关
-
- when 10
- #self.contents.draw_text(0, 0, 120, 32, "『夜』")
- $game_screen.start_tone_change(Tone.new(-51,-51,-51,170),50)
- inside_normal
- #show_day #设定时段图案
- weather_decision
- $game_switches[Ctrl_morning] = false #晨间作息开关
- $game_switches[Ctrl_day] = false #日间作息开关
- $game_switches[Ctrl_afternoon] = false #午间作息开关
- $game_switches[Ctrl_night] = true #夜间作息开关
-
- end #end case
- $game_map.need_refresh = true
- end
- end
- #==========================================================================
- #==========================================================================
- # ■ Window_DayLight
- #--------------------------------------------------------------------------
- # 显示日夜/时间的窗口。
- #==========================================================================
- class Window_DayLight < Window_Base
- #--------------------------------------------
- #时间轴的进制
- #--------------------------------------------
- $sec_count = $Day_sec#5 #时间轴的进制 预设为 5 进制
- $min_count = $Day_min#5 #ㄧ小时几分钟的进制 预设为5进制
- $hour_count = $Day_hour#12 #每天为几小时的进制 预设为12小时1天
- #------------------------------------------------------------------------
- # ● 初始化窗口
- #------------------------------------------------------------------------
- def initialize
- super(0, 0, 160, 60) #(X,Y,宽,高)
- self.contents = Bitmap.new(width - 32, height - 32)
- $hour = 0
- $set_hour = $game_variables[$Ctrl_Set_hour]
- refresh
- end
- #------------------------------------------------------------------------
- # ● 初始化对象
- #------------------------------------------------------------------------
- def refresh
- self.contents.clear
- self.back_opacity = 0 #背景透明
- self.opacity = 0 #外框透明
- if $hour > $hour_count #当计时时间超过实际时间
- Graphics.frame_count = 0 #定时器归零
- $set_hour = 0
- end
- if $game_switches[Ctrl_daylight_sys] == false
- [url=home.php?mod=space&uid=10453]@color[/url] = $game_variables[11] #设定变量11的值,来改变字时间体颜色
- self.contents.font.color = text_color(@color)
- @total_sec = Graphics.frame_count / Graphics.frame_rate
- $hour = (@total_sec / $sec_count /$sec_count %$hour_count) + $set_hour
- $min = @total_sec / $sec_count % $min_count
- $sec = @total_sec % $sec_count
- text = sprintf("T:%02d:%02d", $hour, $min)
- #self.contents.font.color = Color.new(255,255,255,255)#设定颜色(R,G,B,亮度)
- self.contents.draw_text(25, 5, 100, 20, text, 2)#(x,y宽,高,变量,字型颜色)
- the_time
- end
- end
- #------------------------------------------------------------------------
- # ● 刷新
- #------------------------------------------------------------------------
- def update
- super
- if Graphics.frame_count / Graphics.frame_rate != @total_sec
- refresh
- end
- end
- end
- #--------------------------------------------------------------------------#==========================================================================
- # ■ Scene_Map
- #--------------------------------------------------------------------------
- # 处理地图画面的程序。
- #==========================================================================
- class Scene_Map
- def main
- # 生成游戏时间窗口
- @daylight_window = Window_DayLight.new
- @daylight_window.x = 450
- @daylight_window.y = 0
- # 生成活动块
- @spriteset = Spriteset_Map.new
- # 生成讯息窗口
- @message_window = Window_Message.new
- # 执行过渡
- Graphics.transition
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入讯息
- Input.update
- # 刷新画面
- update
- # 如果画面切换的话就中断循环
- if $scene != self
- break
- end
- end
- # 准备过渡
- Graphics.freeze
- # 释放活动块
- @spriteset.dispose
- @daylight_window.dispose #释放时间窗口
- # 释放讯息窗口
- @message_window.dispose
- # 标题画面切换中的情况下
- if $scene.is_a?(Scene_Title)
- # 淡入淡出画面
- Graphics.transition
- Graphics.freeze
- end
- end
-
- alias daylight_sys_update update
- def update
- @daylight_window.update #刷新时间显示
- daylight_sys_update
- end
- end
复制代码 没时间细看了,老实说这个脚本看着有点晕…… |
评分
-
查看全部评分
|