赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 2510 |
最后登录 | 2016-2-28 |
在线时间 | 23 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 23 小时
- 注册时间
- 2015-7-30
- 帖子
- 85
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 SadSlime 于 2015-9-20 18:41 编辑
$achtime={} class Interpreter def get_ach(id) if FileTest.exist?("Achievement/Ach#{id}.rxdata") else save_data(0,"Achievements/Ach#{id}.rxdata") time = Time.now $achtime[id]=time.strftime("%Y.%m.%d %H:%M") save_data($achtime[id],"Achievements/achievements.rxdata") end end end#interpreterend if FileTest.exist?("Achievements") else Dir.mkdir('Achievements') end save_data("未获得","Achievements/achievements.rxdata") class Window_Command_Achievement < Window_Selectable def initialize(actors=4) super(0, 0, 245, 428) self.contents = Bitmap.new(width - 32, height - 32) #=============================================================================== @commands = [ "接受任务" ,"初出茅庐" ,"情报队员" ,"潜入怪岛" ,"突出重围" ,"登通天塔" ,"资深玩家" ,"大神是也" ,"超神之速" ,"初食药剂" ,"暂时提速" ,"加速飞起" ,"双重提速" ,"复活水晶" ,"清除五怪" ,"死了又生" ,"掌控生死" ,"家具收藏" ,"二楼扩建" ,"三楼扩建" ,"钻石!!" ,"铁镐坏了" ,"游戏大神" ,"吓屎作者" ,""] @item_max = 25 #最大数量 #=============================================================================== @column_max = 2 @max=@item_max-=1 for x in 0..@max draw_item(x, normal_color) end self.index = 0 end def draw_item(index, color) @长度=32 @间隙=110 @宽度=90 self.contents.font.color = color x = 4 + index % 2 * @间隙 y = index / 2 * @长度 rect = Rect.new(x, y, @宽度, @长度) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) self.contents.draw_text(rect, @commands[index], 1) end def update_cursor_rect x = 4 + index % 2 * @间隙 y = index / 2 * @长度 self.cursor_rect.set(x, y, @宽度, @长度) end end class Window_Achievement < Window_Base def initialize super(0, 0, 395, 264) self.contents = Bitmap.new(width - 32, height - 32) refresh end def refresh self.contents.clear case $value #=============================================================================== when 0 if FileTest.exist?("Achievements/Ach1.rxdata") $获得状况="已获得" else $获得状况="未获得" end self.contents.font.color=normal_color self.contents.draw_text(0, 0, width, 50*2, " 成就信息:",0) if FileTest.exist?("Achievements/Ach1.rxdata") self.contents.font.color=normal_color else self.contents.font.color=disabled_color end self.contents.draw_text(0, 0, width, 50*3, " 获得状况:#{$获得状况}",0) self.contents.draw_text(0, 0, width, 50*4, " 获得时间:"+$achtime[1].to_s,0) self.contents.font.color=normal_color #=============================================================================== when 1 if FileTest.exist?("Achievements/Ach2.rxdata") $获得状况="已获得" else $获得状况="未获得" end self.contents.font.color=normal_color self.contents.draw_text(0, 0, width, 50*2, " 成就信息:",0) if FileTest.exist?("Achievements/Ach2.rxdata") self.contents.font.color=normal_color else self.contents.font.color=disabled_color end self.contents.draw_text(0, 0, width, 50*3, " 获得状况:#{$获得状况}",0) self.contents.draw_text(0, 0, width, 50*4, " 获得时间:"+$achtime[2].to_s,0) self.contents.font.color=normal_color #=============================================================================== end end end #============================================================================== # ■ Achievement #------------------------------------------------------------------------------ # 处理成就画面的类。 #============================================================================== class Achievement #-------------------------------------------------------------------------- # ● 主处理 #-------------------------------------------------------------------------- def main @command_window = Window_Command_Achievement.new @achievement_window = Window_Achievement.new @achievement_window.x = 245 @achievement_window.y = 0 # 执行过渡 Graphics.transition # 主循环 loop do # 刷新游戏画面 Graphics.update # 刷新输入信息 Input.update # 刷新画面 update # 如果切换画面就中断循环 if $scene != self break end end # 准备过渡 Graphics.freeze # 释放窗口 @command_window.dispose @achievement_window.dispose end def update # 刷新窗口 @command_window.update @achievement_window.update $value = @command_window.index @achievement_window.refresh if Input.trigger?(Input::B) # 演奏取消 SE $game_system.se_play($data_system.cancel_se) # 切换的地图画面 $scene = Scene_Map.new return end end def update_command # 按下 B 键的情况下 if Input.trigger?(Input::B) # 演奏取消 SE $game_system.se_play($data_system.cancel_se) # 切换的地图画面 $scene = Scene_Map.new return end end end#achend
$achtime={}
class Interpreter
def get_ach(id)
if FileTest.exist?("Achievement/Ach#{id}.rxdata")
else
save_data(0,"Achievements/Ach#{id}.rxdata")
time = Time.now
$achtime[id]=time.strftime("%Y.%m.%d %H:%M")
save_data($achtime[id],"Achievements/achievements.rxdata")
end
end
end#interpreterend
if FileTest.exist?("Achievements")
else
Dir.mkdir('Achievements')
end
save_data("未获得","Achievements/achievements.rxdata")
class Window_Command_Achievement < Window_Selectable
def initialize(actors=4)
super(0, 0, 245, 428)
self.contents = Bitmap.new(width - 32, height - 32)
#===============================================================================
@commands = [
"接受任务"
,"初出茅庐"
,"情报队员"
,"潜入怪岛"
,"突出重围"
,"登通天塔"
,"资深玩家"
,"大神是也"
,"超神之速"
,"初食药剂"
,"暂时提速"
,"加速飞起"
,"双重提速"
,"复活水晶"
,"清除五怪"
,"死了又生"
,"掌控生死"
,"家具收藏"
,"二楼扩建"
,"三楼扩建"
,"钻石!!"
,"铁镐坏了"
,"游戏大神"
,"吓屎作者"
,""]
@item_max = 25 #最大数量
#===============================================================================
@column_max = 2
@max=@item_max-=1
for x in 0..@max
draw_item(x, normal_color)
end
self.index = 0
end
def draw_item(index, color)
@长度=32
@间隙=110
@宽度=90
self.contents.font.color = color
x = 4 + index % 2 * @间隙
y = index / 2 * @长度
rect = Rect.new(x, y, @宽度, @长度)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index], 1)
end
def update_cursor_rect
x = 4 + index % 2 * @间隙
y = index / 2 * @长度
self.cursor_rect.set(x, y, @宽度, @长度)
end
end
class Window_Achievement < Window_Base
def initialize
super(0, 0, 395, 264)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
case $value
#===============================================================================
when 0
if FileTest.exist?("Achievements/Ach1.rxdata")
$获得状况="已获得"
else
$获得状况="未获得"
end
self.contents.font.color=normal_color
self.contents.draw_text(0, 0, width, 50*2, " 成就信息:",0)
if FileTest.exist?("Achievements/Ach1.rxdata")
self.contents.font.color=normal_color
else
self.contents.font.color=disabled_color
end
self.contents.draw_text(0, 0, width, 50*3, " 获得状况:#{$获得状况}",0)
self.contents.draw_text(0, 0, width, 50*4, " 获得时间:"+$achtime[1].to_s,0)
self.contents.font.color=normal_color
#===============================================================================
when 1
if FileTest.exist?("Achievements/Ach2.rxdata")
$获得状况="已获得"
else
$获得状况="未获得"
end
self.contents.font.color=normal_color
self.contents.draw_text(0, 0, width, 50*2, " 成就信息:",0)
if FileTest.exist?("Achievements/Ach2.rxdata")
self.contents.font.color=normal_color
else
self.contents.font.color=disabled_color
end
self.contents.draw_text(0, 0, width, 50*3, " 获得状况:#{$获得状况}",0)
self.contents.draw_text(0, 0, width, 50*4, " 获得时间:"+$achtime[2].to_s,0)
self.contents.font.color=normal_color
#===============================================================================
end
end
end
#==============================================================================
# ■ Achievement
#------------------------------------------------------------------------------
# 处理成就画面的类。
#==============================================================================
class Achievement
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
def main
@command_window = Window_Command_Achievement.new
@achievement_window = Window_Achievement.new
@achievement_window.x = 245
@achievement_window.y = 0
# 执行过渡
Graphics.transition
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 刷新画面
update
# 如果切换画面就中断循环
if $scene != self
break
end
end
# 准备过渡
Graphics.freeze
# 释放窗口
@command_window.dispose
@achievement_window.dispose
end
def update
# 刷新窗口
@command_window.update
@achievement_window.update
$value = @command_window.index
@achievement_window.refresh
if Input.trigger?(Input::B)
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
# 切换的地图画面
$scene = Scene_Map.new
return
end
end
def update_command
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# 演奏取消 SE
$game_system.se_play($data_system.cancel_se)
# 切换的地图画面
$scene = Scene_Map.new
return
end
end
end#achend
一个成就脚本,原脚本是在选择窗口显示的成就名字直接给出成就名字,我想改成未获得的成就显示的名字是“????” |
评分
-
查看全部评分
|