| 赞 | 23 |
| VIP | 207 |
| 好人卡 | 31 |
| 积分 | 31 |
| 经验 | 48797 |
| 最后登录 | 2024-5-11 |
| 在线时间 | 1535 小时 |
Lv3.寻梦者 孤独守望
- 梦石
- 0
- 星屑
- 3134
- 在线时间
- 1535 小时
- 注册时间
- 2006-10-16
- 帖子
- 4321
 
|
嗯,问题不大,把Scene_Menu的刷新改一下就行了
- class Game_Player < Game_Character
- #--------------------------------------------------------------------------
- # ● 增加步数
- #--------------------------------------------------------------------------
- def increase_steps
- super
- # 不是强制移动路线的场合
- unless @move_route_forcing
- # 增加步数
- $game_variables[5] += 1
- # 步数是偶数的情况下
- if $game_party.steps % 2 == 0
- # 检查连续伤害
- $game_party.check_map_slip_damage
- end
- end
- end
- end
- #==============================================================================
- # ■ Window_PlayTime
- #------------------------------------------------------------------------------
- # 菜单画面显示游戏时间的窗口。
- #==============================================================================
- class Window_Time < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 180, 60)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.z = 110
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- self.contents.font.color = system_color
- self.contents.draw_text(0, 0, 140, 32, "时间",2)
- self.contents.font.color = normal_color
- time1 = [$game_variables[6],23].min
- time2 = [$game_variables[7],59].min
- self.contents.draw_text(-24, 0, 60, 32,time1.to_s,2)
- self.contents.draw_text(-24, 0, 100, 32,time2.to_s,2)
- self.contents.draw_text(-24, 0, 80, 32,":",2)
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- super
- if Graphics.frame_count / Graphics.frame_rate != @total_sec
- refresh
- end
- end
- end
- #==============================================================================
- # ■ Window_MenuStatus
- #------------------------------------------------------------------------------
- # 显示菜单画面和同伴状态的窗口。
- #==============================================================================
- $MT=9
- $MJ=9
- class Window_MenuStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化目标
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 420, 420)
- self.contents = Bitmap.new(width - 32, height - 32)
- refresh
- self.active = false
- self.index = -1
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @item_max = $game_party.actors.size
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- bitmap=Bitmap.new("Graphics/Pictures/face")
- src_rect = Rect.new(0, 0, 100, 100) #——可自己调整大小
- self.contents.blt(0, y, bitmap, src_rect)
- self.contents.font.color = normal_color
- #################################################################
- self.contents.draw_text(0, 120, 120, 32, "体力:", 3)
- self.contents.draw_text(20 + 96,120,100,32,"/",0)
- if $game_variables[1]>$MT
- $game_variables[1]=$MT
- end
- self.contents.draw_text(80, 120,120,32,$game_variables[1].to_s,0)
- self.contents.draw_text(20 + 128,120,100,32,$MT.to_s,0)
- ################################################################
- self.contents.draw_text(0, 150, 120, 32, "饥饿度:", 3)
- self.contents.draw_text(20 + 96,150,100,32,"/",0)
- if $game_variables[3]>$MT
- $game_variables[3]=$MT
- end
- self.contents.draw_text(80, 150,120,32,$game_variables[3].to_s,0)
- self.contents.draw_text(20 + 128,150,100,32,$MT.to_s,0)
- ###################################################################
- self.contents.draw_text(0, 200, 100, 32, "奋进力:", 3)
- self.contents.draw_text(80, 200, 120, 32, $game_variables[2].to_s, 2)
- ###################################################################
- self.contents.draw_text(0, 230, 100, 32, "和谐度:", 3)
- self.contents.draw_text(80, 230, 120, 32, $game_variables[4].to_s, 2)
- ######################################################################
- self.contents.draw_text(0, 260, 120, 32, "房屋清洁度:",3)
- self.contents.draw_text(80, 260, 120, 32, $game_variables[5].to_s , 2)
- ###############################################################
- self.contents.draw_text(0, 300, 100, 32, "金钱:", 3)
- self.contents.draw_text(80, 300, 120, 32, $game_party.gold.to_s, 2)
- ##################################################################
- #self.contents.font.color = system_color
- #self.contents.draw_text(0, 330, 120, 32, "步数")
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新光标矩形
- #--------------------------------------------------------------------------
- def update_cursor_rect
- if @index < 0
- self.cursor_rect.empty
- else
- self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
- end
- end
- end
- #==============================================================================
- # ■ Scene_Menu
- #------------------------------------------------------------------------------
- # 处理菜单画面的类。
- #==============================================================================
- class Scene_Menu
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # menu_index : 命令光标的初期位置
- #--------------------------------------------------------------------------
- def initialize(menu_index = 0)
- @menu_index = menu_index
- end
- #--------------------------------------------------------------------------
- # ● 主处理
- #--------------------------------------------------------------------------
- def main
- # 生成命令窗口
- s1 = "物品"
- s2 = "装备"
- s3 = "写日记"
- s4 = "离开菜单"
- @command_window = Window_Command.new(160, [s1, s2, s3, s4])
- @command_window.index = @menu_index
- @command_window.opacity = 0
- @command_window.x = 290
- @command_window.y = 50
- # 同伴人数为 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(2)
- end
- @steps = $game_variables[5]
- # 生成游戏时间窗口
- @playtime_window = Window_Time.new
- @playtime_window.x = 460
- @playtime_window.y = 0
- # 生成状态窗口
- @status_window = Window_MenuStatus.new
- @status_window.x = 50
- @status_window.y = 30
- # 执行过渡
- Graphics.transition
- # 主循环
- loop do
- # 刷新游戏画面
- Graphics.update
- # 刷新输入信息
- Input.update
- # 刷新画面
- update
- # 如果切换画面就中断循环
- if $scene != self
- break
- end
- end
- # 准备过渡
- Graphics.freeze
- # 释放窗口
- @command_window.dispose
- @playtime_window.dispose
- @status_window.dispose
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- # 刷新窗口
- @command_window.update
- @playtime_window.update
- @status_window.update
- # 命令窗口被激活的情况下: 调用 update_command
- if @command_window.active
- update_command
- 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
- $scene = Scene_Equip.new
- when 2 # 存档
- # 禁止存档的情况下
- 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 3 # 状态
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- $scene=Scene_End.new
- end
- return
- end
- end
- end
复制代码
修改的地方如下:
1.$MP改成了$MJ,见名知意,默认值为9
2.体力和饥饿度超过最大值会变成最大值
3.去掉了步数窗口,想恢复的话可以参考Window_Steps跟在后面编写
顺便说一句,LZ写脚本习惯貌似不是很好,乱了点~ 系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~ |
|