赞 | 0 |
VIP | 465 |
好人卡 | 35 |
积分 | 11 |
经验 | 27106 |
最后登录 | 2020-5-5 |
在线时间 | 404 小时 |
Lv3.寻梦者 永久的旅行者
- 梦石
- 1
- 星屑
- 110
- 在线时间
- 404 小时
- 注册时间
- 2006-12-13
- 帖子
- 3091
|
改是改好了,但是对任何副作用不负责,也没有售后服务。
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
- class Scene_Battle
- #--------------------------------------------------------------------------
- # ● 设置物品或特技对像方的战斗者
- # scope : 特技或者是物品的范围
- #--------------------------------------------------------------------------
- def set_target_battlers(scope)
- # 行动方的战斗者是敌人的情况下
- if @active_battler.is_a?(Game_Enemy)
- # 效果范围分支
- case scope
- when 1 # 敌单体
- index = @active_battler.current_action.target_index
- @target_battlers.push($game_party.smooth_target_actor(index))
- when 2 # 敌全体
- for actor in 0...[$game_party.actors.size,4].min
- if $game_party.actors[actor].exist?
- @target_battlers.push($game_party.actors[actor])
- end
- end
- when 3 # 我方单体
- index = @active_battler.current_action.target_index
- @target_battlers.push($game_troop.smooth_target_enemy(index))
- when 4 # 我方全体
- for enemy in $game_troop.enemies
- if enemy.exist?
- @target_battlers.push(enemy)
- end
- end
- when 5 # 我方单体 (HP 0)
- index = @active_battler.current_action.target_index
- enemy = $game_troop.enemies[index]
- if enemy != nil and enemy.hp0?
- @target_battlers.push(enemy)
- end
- when 6 # 我方全体 (HP 0)
- for enemy in $game_troop.enemies
- if enemy != nil and enemy.hp0?
- @target_battlers.push(enemy)
- end
- end
- when 7 # 使用者
- @target_battlers.push(@active_battler)
- end
- end
- # 行动方的战斗者是角色的情况下
- if @active_battler.is_a?(Game_Actor)
- # 效果范围分支
- case scope
- when 1 # 敌单体
- index = @active_battler.current_action.target_index
- @target_battlers.push($game_troop.smooth_target_enemy(index))
- when 2 # 敌全体
- for enemy in $game_troop.enemies
- if enemy.exist?
- @target_battlers.push(enemy)
- end
- end
- when 3 # 我方单体
- index = @active_battler.current_action.target_index
- @target_battlers.push($game_party.smooth_target_actor(index))
- when 4 # 我方全体
- for actor in 0...[$game_party.actors.size,4].min
- if $game_party.actors[actor].exist?
- @target_battlers.push($game_party.actors[actor])
- end
- end
- when 5 # 我方单体 (HP 0)
- index = @active_battler.current_action.target_index
- actor = $game_party.actors[index]
- if actor != nil and actor.hp0?
- @target_battlers.push(actor)
- end
- when 6 # 我方全体 (HP 0)
- for actor in 0...[$game_party.actors.size,4].min
- if $game_party.actors[actor] != nil and $game_party.actors[actor].hp0?
- @target_battlers.push($game_party.actors[actor])
- end
- end
- when 7 # 使用者
- @target_battlers.push(@active_battler)
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 生成行动循序
- #--------------------------------------------------------------------------
- def make_action_orders
- # 初始化序列 @action_battlers
- @action_battlers = []
- # 添加敌人到 @action_battlers 序列
- for enemy in $game_troop.enemies
- @action_battlers.push(enemy)
- end
- # 添加角色到 @action_battlers 序列
- for actor in 0...[$game_party.actors.size,4].min
- @action_battlers.push($game_party.actors[actor])
- end
- # 确定全体的行动速度
- for battler in @action_battlers
- battler.make_action_speed
- end
- # 按照行动速度从大到小排列
- @action_battlers.sort! {|a,b|
- b.current_action.speed - a.current_action.speed }
- end
- #--------------------------------------------------------------------------
- # ● 开始结束战斗回合
- #--------------------------------------------------------------------------
- def start_phase5
- # 转移到回合 5
- @phase = 5
- # 演奏战斗结束 ME
- $game_system.me_play($game_system.battle_end_me)
- # 还原为战斗开始前的 BGM
- $game_system.bgm_play($game_temp.map_bgm)
- # 初始化 EXP、金钱、宝物
- exp = 0
- gold = 0
- treasures = []
- # 循环
- for enemy in $game_troop.enemies
- # 敌人不是隐藏状态的情况下
- unless enemy.hidden
- # 获得 EXP、增加金钱
- exp += enemy.exp
- gold += enemy.gold
- # 出现宝物判定
- if rand(100) < enemy.treasure_prob
- if enemy.item_id > 0
- treasures.push($data_items[enemy.item_id])
- end
- if enemy.weapon_id > 0
- treasures.push($data_weapons[enemy.weapon_id])
- end
- if enemy.armor_id > 0
- treasures.push($data_armors[enemy.armor_id])
- end
- end
- end
- end
- # 限制宝物数为 6 个
- treasures = treasures[0..5]
- # 获得 EXP
- for i in 0...[$game_party.actors.size,4].min
- actor = $game_party.actors[i]
- if actor.cant_get_exp? == false
- last_level = actor.level
- actor.exp += exp
- if actor.level > last_level
- @status_window.level_up(i)
- end
- end
- end
- # 获得金钱
- $game_party.gain_gold(gold)
- # 获得宝物
- for item in treasures
- case item
- when RPG::Item
- $game_party.gain_item(item.id, 1)
- when RPG::Weapon
- $game_party.gain_weapon(item.id, 1)
- when RPG::Armor
- $game_party.gain_armor(item.id, 1)
- end
- end
- # 生成战斗结果窗口
- @result_window = Window_BattleResult.new(exp, gold, treasures)
- # 设置等待计数
- @phase5_wait_count = 100
- end
- #--------------------------------------------------------------------------
- # ● 转到输入下一个角色的命令
- #--------------------------------------------------------------------------
- def phase3_next_actor
- # 循环
- begin
- # 角色的明灭效果 OFF
- if @active_battler != nil
- @active_battler.blink = false
- end
- # 最后的角色的情况
- if @actor_index == [$game_party.actors.size-1,3].min
- # 开始主回合
- start_phase4
- return
- end
- # 推进角色索引
- @actor_index += 1
- @active_battler = $game_party.actors[@actor_index]
- @active_battler.blink = true
- # 如果角色是在无法接受指令的状态就再试
- end until @active_battler.inputable?
- # 设置角色的命令窗口
- phase3_setup_command_window
- end
- end
- class Arrow_Actor < Arrow_Base
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- super
- # 光标右
- if Input.repeat?(Input::RIGHT)
- $game_system.se_play($data_system.cursor_se)
- @index += 1
- @index %= [$game_party.actors.size,4].min
- end
- # 光标左
- if Input.repeat?(Input::LEFT)
- $game_system.se_play($data_system.cursor_se)
- @index += $game_party.actors.size - 1
- @index %= [$game_party.actors.size,4].min
- end
- # 设置活动块坐标
- if self.actor != nil
- self.x = self.actor.screen_x
- self.y = self.actor.screen_y
- end
- end
- end
- #==============================================================================
- # ■ Window_Target
- #------------------------------------------------------------------------------
- # 物品画面与特技画面的、使用对像角色选择窗口。
- #==============================================================================
- class Window_Target < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 336, 480)
- self.contents = Bitmap.new(width - 32, $game_party.actors.size*112)
- self.z += 10
- @item_max = $game_party.actors.size
- @top_row = 0
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- for i in 0...$game_party.actors.size
- x = 4
- y = i * 112
- actor = $game_party.actors[i]
- draw_actor_name(actor, x, y)
- draw_actor_class(actor, x + 144, y)
- draw_actor_level(actor, x + 8, y + 32)
- draw_actor_state(actor, x + 8, y + 64)
- draw_actor_hp(actor, x + 152, y + 32)
- draw_actor_sp(actor, x + 152, y + 64)
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新光标矩形
- #--------------------------------------------------------------------------
- def update_cursor_rect
- # 光标位置 -1 为全选、-2 以下为单独选择 (使用者自身)
- if @index <= -2
- self.cursor_rect.set(0, (@index + 10) * 112, self.width - 32, 96)
- elsif @index == -1
- self.cursor_rect.set(0, 0, self.width - 32, @item_max * 112 - 20)
- else
- tpy = @index * 112 - self.oy
- self.cursor_rect.set(0, tpy, self.width - 32, 96)
- if @index < @top_row
- @top_row = @index
- self.oy = @top_row *112
- end
- if @index > @top_row+3
- @top_row = @index-3
- self.oy = @top_row *112
- end
- end
- end
- end
- ###############################################################################
- #==============================================================================
- # Game_System
- #------------------------------------------------------------------------------
- # 添加内容
- #==============================================================================
- class Game_System
- attr_accessor :mission #现在执行的任务
- attr_accessor :partmission
- alias carol3_ini initialize
- def initialize
- carol3_ini
- @mission = ""
- @partmission = []
- end
- end
- #==============================================================================
- # ■ Scene_Title
- #------------------------------------------------------------------------------
- # 处理标题画面的类。
- #==============================================================================
- class Scene_Title
- alias carol3_title1 main
- def main
- $map_infos = load_data("Data/MapInfos.rxdata")
- for key in $map_infos.keys
- $map_infos[key] = $map_infos[key].name
- end
- $任务 = ""
- $支线 = nil
- $支线完成 = nil
- carol3_title1
- end
- end
- class Scene_Map
- alias carol3_update update
- def update
- carol3_update
- if $支线 != nil
- for i in 0...$game_system.partmission.size
- if $game_system.partmission[i] == $支线
- $支线 = nil
- break
- end
- end
- if $支线 != nil
- $game_system.partmission.push($支线)
- $支线 = nil
- end
- end
- if $支线完成 != nil
- for i in 0...$game_system.partmission.size
- if $game_system.partmission[i] == $支线完成
- $game_system.partmission.delete($game_system.partmission[i])
- break
- end
- end
- $支线完成 = nil
- end
- end
- end
- #==============================================================================
- # Window_MenuStatus
- #------------------------------------------------------------------------------
- # 显示菜单画面和同伴状态的窗口。
- #==============================================================================
- class Window_MenuStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化目标
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 480, 384)
- self.contents = Bitmap.new(width - 32, $game_party.actors.size*90-5)
- refresh
- @top_row = 0
- self.active = false
- self.index = -1
- @position = 0
- @count = 0
- @oldposition = 0
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @item_max = $game_party.actors.size
- for i in 0...$game_party.actors.size
- x = 64
- y = i * 90
- if i <=3
- self.contents.font.color = Color.new(255,255,0,255)
- self.contents.draw_text(x,y,340,32,"[出战]",2)
- self.contents.font.color = normal_color
- else
- self.contents.font.color = Color.new(128,128,128,255)
- self.contents.draw_text(x,y,340,32,"[待机]",2)
- self.contents.font.color = normal_color
- end
- actor = $game_party.actors[i]
- draw_actor_graphic(actor, x - 40, y + 50)
- draw_actor_name(actor, x, y)
- draw_actor_class(actor, x + 144, y)
- draw_actor_level(actor, x, y + 25)
- draw_actor_state(actor, x + 90, y + 25)
- draw_actor_exp(actor, x, y + 50)
- draw_actor_hp(actor, x + 236, y + 25)
- draw_actor_sp(actor, x + 236, y + 50)
- end
- end
- #--------------------------------------------------------------------------
- # ● 绘制行走图
- #--------------------------------------------------------------------------
- def draw_actor_active_graphic(actor, x, y)
- bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
- cw = bitmap.width / 4
- ch = bitmap.height / 4
- p = @position * cw
- src_rect = Rect.new(p, 0, cw, ch)
- self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
- end
- #--------------------------------------------------------------------------
- # ● 刷新光标矩形
- #--------------------------------------------------------------------------
- def update_cursor_rect
- if @index < 0
- self.cursor_rect.empty
- else
- tpy = @index * 90-5 - self.oy
- self.cursor_rect.set(0, tpy , self.width - 32, 90)
- if @index < @top_row
- @top_row = @index
- self.oy = @top_row *90-5
- end
- if @index > @top_row+3
- @top_row = @index-3
- self.oy = @top_row *90-5
- end
- end
- end
- end
- class Game_Party
- #--------------------------------------------------------------------------
- # ● 全灭判定
- #--------------------------------------------------------------------------
- def all_dead?
- # 同伴人数为 0 的情况下
- if $game_party.actors.size == 0
- return false
- end
- # 同伴中无人 HP 在 0 以上
- for i in 0..3
- if @actors[i] != nil and@actors[i].hp >0
- return false
- end
- end
- # 全灭
- return true
- end
- #--------------------------------------------------------------------------
- # ● 加入同伴
- # actor_id : 角色 ID
- #--------------------------------------------------------------------------
- def add_actor(actor_id)
- # 获取角色
- actor = $game_actors[actor_id]
- # 同伴人数未满 4 人、本角色不在队伍中的情况下
- if not @actors.include?(actor)
- # 添加角色
- @actors.push(actor)
- # 还原主角
- $game_player.refresh
- end
- end
- end
- #==============================================================================
- # ■ Game_Map
- #------------------------------------------------------------------------------
- # 处理地图的类。包含卷动以及可以通行的判断功能。
- # 本类的实例请参考 $game_map 。
- #==============================================================================
- class Game_Map
- def name
- return $map_infos[@map_id]
- end
- end
- #==============================================================================
- # Window_RecordBook
- #------------------------------------------------------------------------------
- # 菜单界面表示信息的窗口
- #==============================================================================
- class Window_RecordBook < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对象
- #--------------------------------------------------------------------------
- def initialize
- super(160, 384, 480, 480)
- self.contents = Bitmap.new(width - 32, height - 32)
- if $任务 == ""
- $任务 = $game_system.mission
- else
- $game_system.mission = $任务
- end
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- self.contents.font.color = system_color
- self.contents.font.size = 20
- cx = self.contents.text_size("现在地点").width + 24
- self.contents.draw_text(4, 0, cx, 24, "现在地点")
- self.contents.font.color = normal_color
- self.contents.draw_text(4 + cx, 0, 444 - cx, 24, $game_map.name.to_s)
- self.contents.font.color = system_color
- cx = self.contents.text_size("主线任务").width + 24
- self.contents.draw_text(4, 32, cx, 24, "主线任务")
- self.contents.font.color = Color.new(240,250,75,255)
- self.contents.draw_text(4 + cx, 32, 444 - cx, 24, $game_system.mission.to_s)
- self.contents.font.color = system_color
- cx = self.contents.text_size("支线任务").width + 24
- self.contents.draw_text(4, 96, cx, 24, "支线任务")
- self.contents.font.color = normal_color
- for i in 0...$game_system.partmission.size
- self.contents.draw_text(4 + cx, 96 + i * 32, 444 - cx, 24, $game_system.partmission[i].to_s)
- end
- end
- end
- #==============================================================================
- # ■ Scene_Menu
- #------------------------------------------------------------------------------
- # 处理菜单画面的类。
- #==============================================================================
- class Scene_Menu
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # menu_index : 命令光标的初期位置
- #--------------------------------------------------------------------------
- def initialize(menu_index = 0)
- @menu_index = menu_index
- @切换状态暂停 = ""
- end
- #--------------------------------------------------------------------------
- # ● 主处理
- #--------------------------------------------------------------------------
- def main
- # 生成命令窗口
- s1 = " 使用物品"#$data_system.words.item
- s2 = " 使用技能"#$data_system.words.skill
- s3 = " 更改装备"#$data_system.words.equip
- s4 = " 查看状态"
- s5 = " 储存游戏"
- s6 = " 结束游戏"
- s7 = " 调整队伍"
- s8 = " 查看任务"
- @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7, s8])
- @command_window.index = @menu_index
- # 同伴人数为 0 的情况下
- if $game_party.actors.size == 0
- # 物品、特技、装备、状态无效化
- @command_window.disable_item(0)
- @command_window.disable_item(1)
- @command_window.disable_item(2)
- @command_window.disable_item(3)
- end
- # 禁止存档的情况下
- if $game_system.save_disabled
- # 存档无效
- @command_window.disable_item(4)
- end
- # 生成游戏时间窗口
- @playtime_window = Window_PlayTime.new
- @playtime_window.x = 0
- @playtime_window.y = 288
- # 生成金钱窗口
- @gold_window = Window_Gold.new
- @gold_window.x = 0
- @gold_window.y = 416
- # 生成状态窗口
- @status_window = Window_MenuStatus.new
- @status_window.x = 160
- @status_window.y = 0
- #—— 生成天书窗口
- @recordbook_window = Window_RecordBook.new
- @recordbook_window.z = 1000
- #—— 生成外边框窗口
- @outside_window = Window_Outside.new
- @outside_window.visible = true
- @outside_window.z = 1001
- # 执行过渡
- Graphics.transition
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update
- # 如果切换画面就中断循环
- if $scene != self
- break
- end
- end
- # 准备过渡
- Graphics.freeze
- # 释放窗口
- @command_window.dispose
- @playtime_window.dispose
- @gold_window.dispose
- @status_window.dispose
- @outside_window.dispose
- @recordbook_window.dispose
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- # 刷新窗口
- @command_window.update
- @playtime_window.update
- @gold_window.update
- @status_window.update
- # 命令窗口被激活的情况下: 调用 update_command
- if @command_window.active
- update_command
- return
- end
- # 状态窗口被激活的情况下: 调用 update_status
- if @status_window.active
- update_status
- return
- end
- if @outside_window.visible == false
- update_recordbook
- 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
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- # 同伴人数为 0、存档、游戏结束以外的场合
- if $game_party.actors.size == 0 and @command_window.index < 4
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 命令窗口的光标位置分支
- case @command_window.index
- when 0 # 物品
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 切换到物品画面
- $scene = Scene_Item.new
- when 1 # 特技
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 激活状态窗口
- @command_window.active = false
- @status_window.active = true
- @status_window.index = 0
- when 2 # 装备
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 激活状态窗口
- @command_window.active = false
- @status_window.active = true
- @status_window.index = 0
- when 3 # 状态
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 激活状态窗口
- @command_window.active = false
- @status_window.active = true
- @status_window.index = 0
- when 4 # 存档
- # 禁止存档的情况下
- if $game_system.save_disabled
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 切换到存档画面
- $scene = Scene_Save.new
- when 5 # 游戏结束
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 切换到游戏结束画面
- $scene = Scene_End.new
- when 6
- $game_system.se_play($data_system.decision_se)
- @checker = 0
- @command_window.active = false
- @status_window.active = true
- @status_window.index = 0
- when 7 # 查看任务
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- @command_window.active = false
- @outside_window.visible = false
- end
- return
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面 (查看天书的情况下)
- #--------------------------------------------------------------------------
- def update_recordbook
- if @切换状态暂停 == "天书消失"
- if @recordbook_window.y < 384
- @recordbook_window.y +=64
- @status_window.y -= 16
- return
- else
- @切换状态暂停 = ""
- @outside_window.visible = true
- @command_window.active = true
- end
- else
- if @recordbook_window.y >0
- @recordbook_window.y -= 32
- @status_window.y += 8
- return
- else
- @status_window.visible = false
- if Input.trigger?(Input::B)
- @切换状态暂停 = "天书消失"
- $game_system.se_play($data_system.cancel_se)
- @status_window.visible = true
- return
- end
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面 (状态窗口被激活的情况下)
- #--------------------------------------------------------------------------
- def update_status
- # 按下 B 键的情况下
- if Input.trigger?(Input::B)
- # 演奏取消 SE
- $game_system.se_play($data_system.cancel_se)
- # 激活命令窗口
- @command_window.active = true
- @status_window.active = false
- @status_window.index = -1
- return
- end
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- # 命令窗口的光标位置分支
- case @command_window.index
- when 1 # 特技
- # 本角色的行动限制在 2 以上的情况下
- if $game_party.actors[@status_window.index].restriction >= 2
- # 演奏冻结 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 切换到特技画面
- $scene = Scene_Skill.new(@status_window.index)
- when 2 # 装备
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 切换的装备画面
- $scene = Scene_Equip.new(@status_window.index)
- when 3 # 状态
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 切换到状态画面
- $scene = Scene_Status.new(@status_window.index)
- when 6
- $game_system.se_play($data_system.decision_se)
- if @checker == 0
- @changer = $game_party.actors[@status_window.index]
- @where = @status_window.index
- @checker = 1
- else
- $game_party.actors[@where] = $game_party.actors[@status_window.index]
- $game_party.actors[@status_window.index] = @changer
- @checker = 0
- @status_window.refresh
- end
- end
- return
- end
- end
- end
- #==============================================================================
- # Window_Outside
- #------------------------------------------------------------------------------
- # 外边框窗口
- #==============================================================================
- class Window_Outside < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对象
- #--------------------------------------------------------------------------
- def initialize
- super(160, 384, 480, 96)
- self.back_opacity = 0
- end
- end
- #==============================================================================
- # ■ Window_PlayTime
- #------------------------------------------------------------------------------
- # 菜单画面的系统时间表示
- #==============================================================================
- class Window_PlayTime < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 160, 128)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.contents.font.size = 18
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- self.contents.font.color = system_color
- self.contents.font.color = text_color(6)
- time = Time.now
- text = time.strftime("%x %X")
- self.contents.draw_text(-2, 32, 130, 32, text, 2)
- @total_sec = Graphics.frame_count / Graphics.frame_rate
- hour = @total_sec / 60 / 60
- min = @total_sec / 60 % 60
- sec = @total_sec % 60
- text = sprintf("%02d:%02d:%02d", hour, min, sec)
- self.contents.font.color = normal_color
- self.contents.draw_text(4, 0, 160, 32, "日期与游戏时间")
- self.contents.draw_text(-2, 64, 130, 32, text, 2)
- end
- #--------------------------------------------------------------------------
- # ● 更新
- #--------------------------------------------------------------------------
- def update
- super
- if Graphics.frame_count / Graphics.frame_rate != @total_sec
- refresh
- end
- end
- end
-
- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
复制代码
要继续开辩论会的话请各位到水区或开水区开帖继续...
谢谢合作。 |
|