#==============================================================================
# 变量控制完美时间天气系统 V0.90 整合与重制作:牛肉面
# 原地图显变量脚本来自66rpg
# 请使用本人配套范例工程
#==============================================================================
VAR_SWITCH = 5 # 工作开关
VAR_REFRESH_SWITCH = 6 # 强制刷新
COLOURMAPID = [] # 使用天气明暗效果的地图ID
#1、把窗口由透明变为不透明(包括第一次使用时),2、游戏中用脚本更改了$var
$var = []
$var = [[2,20,0],[1,70,0],[6,130,0],[5,210,0],[3,260,0]]
#所有需要显示在地图并且刷新的变量,可在游戏中用脚本更改。
#格式:[变量编号,x坐标,y坐标]
#==============================================================================
# ■ Window_XY
#------------------------------------------------------------------------------
# 显示坐标的窗口。
#==============================================================================
class Window_MapVar < Window_Base #注意前面那个window_var是文件名
#--------------------------------------------------------------------------
# ● 初始化窗口
#--------------------------------------------------------------------------
def initialize
#=======================此处可任意调整窗口位置
super(0,0,640,64)
# 窗口内容的不透明度
self.contents_opacity=255
self.contents = Bitmap.new(width - 32, height - 32)
self.z=9999
#=======================
@var_value_old = -1
@var = $var
@var_a = []
for var_draw in $var
@var_a[var_draw[0]] = $game_variables[var_draw[0]]
end
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
if $game_switches[VAR_SWITCH]
@var = $var # 记录现在变量数组结构
self.contents.clear # 清除以前的东西
for var_draw in @var
@var_a[var_draw[0]] = $game_variables[var_draw[0]] # 记录现在的游戏变量
self.contents.draw_text(var_draw[1],var_draw[2],640,32,@var_a[var_draw[0]].to_s)
self.contents.draw_text(45, 0, 32, 32, '时')
self.contents.draw_text(95, 0, 32, 32, '分')
self.contents.draw_text(185, 0, 32, 32, '年')
self.contents.draw_text(235, 0, 32, 32, '月')
self.contents.draw_text(285, 0, 32, 32, '日')
#self.contents.draw_text(330, 0, 64, 32, '星期')
@game_variables = $game_variables
case @game_variables[20]# 控制窗口背景变量 1显示0消失
when 1
self.opacity=150 # 窗口的不透明度
self.back_opacity=150 # 窗口背景的不透明度
when 0
self.opacity=0
self.back_opacity=0
end
case @game_variables[4]
when 1
self.contents.draw_text(330, 0, 96, 32, '星期一')
when 2
self.contents.draw_text(330, 0, 96, 32, '星期二')
when 3
self.contents.draw_text(330, 0, 96, 32, '星期三')
when 4
self.contents.draw_text(330, 0, 96, 32, '星期四')
when 5
self.contents.draw_text(330, 0, 96, 32, '星期五')
when 6
self.contents.draw_text(330, 0, 96, 32, '星期六')
when 7
self.contents.draw_text(330, 0, 96, 32, '星期日')
else
self.contents.draw_text(330, 0, 96, 32, '星期日')
end
case @game_variables[7]
when 1
self.contents.draw_text(420, 0, 64, 32, '春季')
when 2
self.contents.draw_text(420, 0, 64, 32, '夏天')
when 3
self.contents.draw_text(420, 0, 64, 32, '秋日')
when 4
self.contents.draw_text(420, 0, 64, 32, '寒冬')
end
@game_switches = $game_switches
if COLOURMAPID.include?($game_map.map_id)
#@game_switches[4]
case @game_variables[2]
when 1
$game_screen.start_tone_change(Tone.new(-136,-136,-85,34),5)
when 2
$game_screen.start_tone_change(Tone.new(-102,-102,-68,17),5)
when 3
$game_screen.start_tone_change(Tone.new(-102,-102,-68,17),5)
when 4
$game_screen.start_tone_change(Tone.new(-51,-51,-85,0),5)
when 5
$game_screen.start_tone_change(Tone.new(-51,-51,-85,0),5)
when 6
$game_screen.start_tone_change(Tone.new(-17,-17,-51,0),5)
when 7
$game_screen.start_tone_change(Tone.new(-17,-17,-51,0),5)
when 8
$game_screen.start_tone_change(Tone.new(0,0,0,0),5)
when 9
$game_screen.start_tone_change(Tone.new(0,0,0,0),5)
when 10
$game_screen.start_tone_change(Tone.new(0,0,0,0),5)
when 11
$game_screen.start_tone_change(Tone.new(34,34,0,0),5)
when 12
$game_screen.start_tone_change(Tone.new(34,34,0,0),5)
when 13
$game_screen.start_tone_change(Tone.new(34,34,0,0),5)
when 14
$game_screen.start_tone_change(Tone.new(17,17,0,0),5)
when 15
$game_screen.start_tone_change(Tone.new(17,17,0,0),5)
when 16
$game_screen.start_tone_change(Tone.new(17,17,0,0),5)
when 17
$game_screen.start_tone_change(Tone.new(-17,-34,-68,0),5)
when 18
$game_screen.start_tone_change(Tone.new(-17,-34,-68,0),5)
when 19
$game_screen.start_tone_change(Tone.new(-102,-102,-68,17),5)
when 20
$game_screen.start_tone_change(Tone.new(-102,-102,-68,17),5)
when 21
$game_screen.start_tone_change(Tone.new(-102,-102,-68,17),5)
when 22
$game_screen.start_tone_change(Tone.new(-136,-136,-85,34),5)
when 23
$game_screen.start_tone_change(Tone.new(-136,-136,-85,34),5)
when 0
$game_screen.start_tone_change(Tone.new(-136,-136,-85,34),5)
end
else
$game_screen.start_tone_change(Tone.new(0,0,0,0),5)
end
end
end
end
#--------------------------------------------------------------------------
# ● 判断文字刷新。节约内存用
#--------------------------------------------------------------------------
def judge
for var_draw in $var
if @var_a[var_draw[0]] != $game_variables[var_draw[0]] #如果现在记录的变量和游戏变量不同,刷新
return true
end
end
if $game_switches[VAR_REFRESH_SWITCH] # 强制刷新的时候,刷新
$game_switches[VAR_REFRESH_SWITCH] = false
return true
end
return false
end
end
class Scene_Map
alias var_66rpg_main main
def main
@var_window = Window_MapVar.new
# @var_window.opacity = 0
var_66rpg_main
@var_window.dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
alias var_66rpg_update update
def update
var_66rpg_update
if $game_switches[VAR_SWITCH]
@var_window.visible = true
@var_window.refresh
#if @var_window.judge
else
@var_window.visible = false
end
end
end
#==============================================================================
# 变量控制完美时间天气系统 V0.90 整合与重制作:牛肉面
# 原地图显变量脚本来自66rpg
# 请使用本人配套范例工程
#==============================================================================
VAR_SWITCH = 5 # 工作开关
VAR_REFRESH_SWITCH = 6 # 强制刷新
COLOURMAPID = [] # 使用天气明暗效果的地图ID
#1、把窗口由透明变为不透明(包括第一次使用时),2、游戏中用脚本更改了$var
$var = []
$var = [[2,20,0],[1,70,0],[6,130,0],[5,210,0],[3,260,0]]
#所有需要显示在地图并且刷新的变量,可在游戏中用脚本更改。
#格式:[变量编号,x坐标,y坐标]
#==============================================================================
# ■ Window_XY
#------------------------------------------------------------------------------
# 显示坐标的窗口。
#==============================================================================
class Window_MapVar < Window_Base #注意前面那个window_var是文件名
#--------------------------------------------------------------------------
# ● 初始化窗口
#--------------------------------------------------------------------------
def initialize
#=======================此处可任意调整窗口位置
super(0,0,640,64)
# 窗口内容的不透明度
self.contents_opacity=255
self.contents = Bitmap.new(width - 32, height - 32)
self.z=9999
#=======================
@var_value_old = -1
@var = $var
@var_a = []
for var_draw in $var
@var_a[var_draw[0]] = $game_variables[var_draw[0]]
end
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
if $game_switches[VAR_SWITCH]
@var = $var # 记录现在变量数组结构
self.contents.clear # 清除以前的东西
for var_draw in @var
@var_a[var_draw[0]] = $game_variables[var_draw[0]] # 记录现在的游戏变量
self.contents.draw_text(var_draw[1],var_draw[2],640,32,@var_a[var_draw[0]].to_s)
self.contents.draw_text(45, 0, 32, 32, '时')
self.contents.draw_text(95, 0, 32, 32, '分')
self.contents.draw_text(185, 0, 32, 32, '年')
self.contents.draw_text(235, 0, 32, 32, '月')
self.contents.draw_text(285, 0, 32, 32, '日')
#self.contents.draw_text(330, 0, 64, 32, '星期')
@game_variables = $game_variables
case @game_variables[20]# 控制窗口背景变量 1显示0消失
when 1
self.opacity=150 # 窗口的不透明度
self.back_opacity=150 # 窗口背景的不透明度
when 0
self.opacity=0
self.back_opacity=0
end
case @game_variables[4]
when 1
self.contents.draw_text(330, 0, 96, 32, '星期一')
when 2
self.contents.draw_text(330, 0, 96, 32, '星期二')
when 3
self.contents.draw_text(330, 0, 96, 32, '星期三')
when 4
self.contents.draw_text(330, 0, 96, 32, '星期四')
when 5
self.contents.draw_text(330, 0, 96, 32, '星期五')
when 6
self.contents.draw_text(330, 0, 96, 32, '星期六')
when 7
self.contents.draw_text(330, 0, 96, 32, '星期日')
else
self.contents.draw_text(330, 0, 96, 32, '星期日')
end
case @game_variables[7]
when 1
self.contents.draw_text(420, 0, 64, 32, '春季')
when 2
self.contents.draw_text(420, 0, 64, 32, '夏天')
when 3
self.contents.draw_text(420, 0, 64, 32, '秋日')
when 4
self.contents.draw_text(420, 0, 64, 32, '寒冬')
end
@game_switches = $game_switches
if COLOURMAPID.include?($game_map.map_id)
#@game_switches[4]
case @game_variables[2]
when 1
$game_screen.start_tone_change(Tone.new(-136,-136,-85,34),5)
when 2
$game_screen.start_tone_change(Tone.new(-102,-102,-68,17),5)
when 3
$game_screen.start_tone_change(Tone.new(-102,-102,-68,17),5)
when 4
$game_screen.start_tone_change(Tone.new(-51,-51,-85,0),5)
when 5
$game_screen.start_tone_change(Tone.new(-51,-51,-85,0),5)
when 6
$game_screen.start_tone_change(Tone.new(-17,-17,-51,0),5)
when 7
$game_screen.start_tone_change(Tone.new(-17,-17,-51,0),5)
when 8
$game_screen.start_tone_change(Tone.new(0,0,0,0),5)
when 9
$game_screen.start_tone_change(Tone.new(0,0,0,0),5)
when 10
$game_screen.start_tone_change(Tone.new(0,0,0,0),5)
when 11
$game_screen.start_tone_change(Tone.new(34,34,0,0),5)
when 12
$game_screen.start_tone_change(Tone.new(34,34,0,0),5)
when 13
$game_screen.start_tone_change(Tone.new(34,34,0,0),5)
when 14
$game_screen.start_tone_change(Tone.new(17,17,0,0),5)
when 15
$game_screen.start_tone_change(Tone.new(17,17,0,0),5)
when 16
$game_screen.start_tone_change(Tone.new(17,17,0,0),5)
when 17
$game_screen.start_tone_change(Tone.new(-17,-34,-68,0),5)
when 18
$game_screen.start_tone_change(Tone.new(-17,-34,-68,0),5)
when 19
$game_screen.start_tone_change(Tone.new(-102,-102,-68,17),5)
when 20
$game_screen.start_tone_change(Tone.new(-102,-102,-68,17),5)
when 21
$game_screen.start_tone_change(Tone.new(-102,-102,-68,17),5)
when 22
$game_screen.start_tone_change(Tone.new(-136,-136,-85,34),5)
when 23
$game_screen.start_tone_change(Tone.new(-136,-136,-85,34),5)
when 0
$game_screen.start_tone_change(Tone.new(-136,-136,-85,34),5)
end
else
$game_screen.start_tone_change(Tone.new(0,0,0,0),5)
end
end
end
end
#--------------------------------------------------------------------------
# ● 判断文字刷新。节约内存用
#--------------------------------------------------------------------------
def judge
for var_draw in $var
if @var_a[var_draw[0]] != $game_variables[var_draw[0]] #如果现在记录的变量和游戏变量不同,刷新
return true
end
end
if $game_switches[VAR_REFRESH_SWITCH] # 强制刷新的时候,刷新
$game_switches[VAR_REFRESH_SWITCH] = false
return true
end
return false
end
end
class Scene_Map
alias var_66rpg_main main
def main
@var_window = Window_MapVar.new
# @var_window.opacity = 0
var_66rpg_main
@var_window.dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
alias var_66rpg_update update
def update
var_66rpg_update
if $game_switches[VAR_SWITCH]
@var_window.visible = true
@var_window.refresh
#if @var_window.judge
else
@var_window.visible = false
end
end
end