#------------------制作by bluefool,转载请保留------------------module Blue #这个是控制显示最近的多少条信息的,当超出一屏能显示的值的话可通过先按一下shift #然后用上下翻看内容。再按一次shift则解除激活 Blue_max = 9 #战斗画面时即时消息窗口的x坐标 BATAM_X = 0 #战斗画面时即时消息窗口的y坐标 BATAM_Y = 90 #用于清空hash表,可以不管它,但不要让Blue_max大于它,当然,它的值也可以改变 NAM_MAX = 20 #主要传递信息参数为函数$am,参见脚本内容end#-------------------------------------------class Scene_Load < Scene_File #-------------------------------------------------------------------------- # ● 确定时的处理 #-------------------------------------------------------------------------- def on_decision(filename) # 文件不存在的情况下 unless FileTest.exist?(filename) # 演奏冻结 SE $game_system.se_play($data_system.buzzer_se) return end # 演奏读档 SE $game_system.se_play($data_system.load_se) # 写入存档数据 file = File.open(filename, "rb") read_save_data(file) file.close # 还原 BGM、BGS $game_system.bgm_play($game_system.playing_bgm) $game_system.bgs_play($game_system.playing_bgs) # 刷新地图 (执行并行事件) $a = {} $game_map.update # 切换到地图画面 $scene = Scene_Map.new endend class Game_Player < Game_Character def update # 本地变量记录移动信息 last_moving = moving? # 移动中、事件执行中、强制移动路线中、 # 信息窗口一个也不显示的时候 unless moving? or $game_system.map_interpreter.running? or @move_route_forcing or $game_temp.message_window_showing or $ccc == 1 case Input.dir4 when 2 move_down when 4 move_left when 6 move_right when 8 move_up end end # 本地变量记忆坐标 last_real_x = @real_x last_real_y = @real_y super # 角色向下移动、画面上的位置在中央下方的情况下 if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y # 画面向下卷动 $game_map.scroll_down(@real_y - last_real_y) end # 角色向左移动、画面上的位置在中央左方的情况下 if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X # 画面向左卷动 $game_map.scroll_left(last_real_x - @real_x) end # 角色向右移动、画面上的位置在中央右方的情况下 if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X # 画面向右卷动 $game_map.scroll_right(@real_x - last_real_x) end # 角色向上移动、画面上的位置在中央上方的情况下 if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y # 画面向上卷动 $game_map.scroll_up(last_real_y - @real_y) end # 不在移动中的情况下 unless moving? # 上次主角移动中的情况 if last_moving # 与同位置的事件接触就判定为事件启动 result = check_event_trigger_here([1,2]) # 没有可以启动的事件的情况下 if result == false # 调试模式为 ON 并且按下 CTRL 键的情况下除外 unless $DEBUG and Input.press?(Input::CTRL) # 遇敌计数下降 if @encounter_count > 0 @encounter_count -= 1 end end end end # 按下 C 键的情况下 if Input.trigger?(Input::C) # 判定为同位置以及正面的事件启动 check_event_trigger_here([0]) check_event_trigger_there([0,1,2]) end end endend #==============================================================================# ■ Scene_Title#------------------------------------------------------------------------------# 处理标题画面的类。#============================================================================== class Scene_Title #-------------------------------------------------------------------------- # ● 命令 : 新游戏 #-------------------------------------------------------------------------- def command_new_game # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 停止 BGM Audio.bgm_stop # 重置测量游戏时间用的画面计数器 Graphics.frame_count = 0 # 生成各种游戏对像 $game_temp = Game_Temp.new $game_system = Game_System.new $game_switches = Game_Switches.new $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_screen = Game_Screen.new $game_actors = Game_Actors.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new # 设置初期同伴位置 $game_party.setup_starting_members # 设置初期位置的地图 $game_map.setup($data_system.start_map_id) # 主角向初期位置移动 $game_player.moveto($data_system.start_x, $data_system.start_y) # 刷新主角 $game_player.refresh # 执行地图设置的 BGM 与 BGS 的自动切换 $game_map.autoplay # 刷新地图 (执行并行事件) $game_map.update $a = {} $ccc = 0 # 切换地图画面 $scene = Scene_Map.new end #-------------------------------------------------------------------------- # ● 命令 : 继续 #-------------------------------------------------------------------------- def command_continue # 继续无效的情况下 unless @continue_enabled # 演奏无效 SE $game_system.se_play($data_system.buzzer_se) return end # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 切换到读档画面 $scene = Scene_Load.new end #-------------------------------------------------------------------------- # ● 命令 : 退出 #-------------------------------------------------------------------------- def command_shutdown # 演奏确定 SE $game_system.se_play($data_system.decision_se) # BGM、BGS、ME 的淡入淡出 Audio.bgm_fade(800) Audio.bgs_fade(800) Audio.me_fade(800) # 退出 $scene = nil end #-------------------------------------------------------------------------- # ● 战斗测试 #-------------------------------------------------------------------------- def battle_test # 载入数据库 (战斗测试用) $data_actors = load_data("Data/BT_Actors.rxdata") $data_classes = load_data("Data/BT_Classes.rxdata") $data_skills = load_data("Data/BT_Skills.rxdata") $data_items = load_data("Data/BT_Items.rxdata") $data_weapons = load_data("Data/BT_Weapons.rxdata") $data_armors = load_data("Data/BT_Armors.rxdata") $data_enemies = load_data("Data/BT_Enemies.rxdata") $data_troops = load_data("Data/BT_Troops.rxdata") $data_states = load_data("Data/BT_States.rxdata") $data_animations = load_data("Data/BT_Animations.rxdata") $data_tilesets = load_data("Data/BT_Tilesets.rxdata") $data_common_events = load_data("Data/BT_CommonEvents.rxdata") $data_system = load_data("Data/BT_System.rxdata") # 重置测量游戏时间用的画面计数器 Graphics.frame_count = 0 # 生成各种游戏对像 $game_temp = Game_Temp.new $game_system = Game_System.new $game_switches = Game_Switches.new $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_screen = Game_Screen.new $game_actors = Game_Actors.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new # 设置战斗测试用同伴 $game_party.setup_battle_test_members # 设置队伍 ID、可以逃走标志、战斗背景 $game_temp.battle_troop_id = $data_system.test_troop_id $game_temp.battle_can_escape = true $game_map.battleback_name = $data_system.battleback_name # 演奏战斗开始 BGM $game_system.se_play($data_system.battle_start_se) # 演奏战斗 BGM $game_system.bgm_play($game_system.battle_bgm) # 切换到战斗画面 $scene = Scene_Battle.new endend#-------------------------------------------------------class Scene_Map #-------------------------------------------------------------------------- # ● 主处理 #-------------------------------------------------------------------------- def main @spriteset = Spriteset_Map.new @message_window = Window_Message.new @down_window = Window_Down.new Graphics.transition # 主循环 loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @spriteset.dispose @message_window.dispose @down_window.dispose if $scene.is_a?(Scene_Title) Graphics.transition Graphics.freeze end @am_size = $a.size end #--------------------- def bluefool_sort if $am != nil if $a.size > Blue::NAM_MAX a_temp = {} j = 0 for i in ($a.size - Blue::Blue_max)...$a.size a_temp[j] = $a[i] j += 1 end $a = a_temp end if $am.length < 54 $a[$a.size] = $am else while $am.length > 53 i = 53 while (/\W/ =~ $am[i-3,3]) != nil i -= 1 end $a[$a.size] = $am[0,i] $am = $am[i ,$am.length - i] end $a[$a.size] = $am end $am = nil end end #-------------------------------------------------------------------------- # ● 刷新画面 #-------------------------------------------------------------------------- def update # 循环 loop do # 按照地图、实例、主角的顺序刷新 # (本更新顺序不会在的满足事件的执行条件下成为给予角色瞬间移动 # 的机会的重要因素) $game_map.update $game_system.map_interpreter.update $game_player.update # 系统 (计时器)、画面刷新 $game_system.update $game_screen.update # 如果主角在场所移动中就中断循环 unless $game_temp.player_transferring break end # 执行场所移动 transfer_player # 处理过渡中的情况下、中断循环 if $game_temp.transition_processing break end end # 刷新活动块 @spriteset.update # 刷新信息窗口 @message_window.update # 游戏结束的情况下 if $game_temp.gameover # 切换的游戏结束画面 $scene = Scene_Gameover.new return end # 返回标题画面的情况下 if $game_temp.to_title # 切换到标题画面 $scene = Scene_Title.new return end # 处理过渡中的情况下 if $game_temp.transition_processing # 清除过渡处理中标志 $game_temp.transition_processing = false # 执行过渡 if $game_temp.transition_name == "" Graphics.transition(20) else Graphics.transition(40, "Graphics/Transitions/" + $game_temp.transition_name) end end # 显示信息窗口中的情况下 if $game_temp.message_window_showing return end # 遇敌计数为 0 且、且遇敌列表不为空的情况下 if $game_player.encounter_count == 0 and $game_map.encounter_list != [] # 不是在事件执行中或者禁止遇敌中 unless $game_system.map_interpreter.running? or $game_system.encounter_disabled # 确定队伍 n = rand($game_map.encounter_list.size) troop_id = $game_map.encounter_list[n] # 队伍有效的话 if $data_troops[troop_id] != nil # 设置调用战斗标志 $game_temp.battle_calling = true $game_temp.battle_troop_id = troop_id $game_temp.battle_can_escape = true $game_temp.battle_can_lose = false $game_temp.battle_proc = nil end end end #--------------------------------------------- bluefool_sort if @am_size != $a.size @down_window.refresh if $a != nil and $a.size < Blue::Blue_max + 1 @down_window.index = $a.size/2 - 1 elsif $a != nil and $a.size > Blue::Blue_max @down_window.index = Blue::Blue_max/2 - 1 end @am_size = $a.size end if Input.trigger?(Input::A) if @down_window.active == false @down_window.active = true $ccc = 1 else @down_window.active = false $ccc = 0 end end if Input.trigger?(Input::DOWN)#输入DOWN键的情况 if @down_window.active == true and @down_window.index < (@down_window.item_max-1)/2 @down_window.index += 1 end end if Input.trigger?(Input::UP)#输入UP键的情况 if @down_window.active == true and @down_window.index > 0 @down_window.index -= 1 end end #---------------------------------------------- # 按下 B 键的情况下 if Input.trigger?(Input::B) # 不是在事件执行中或菜单禁止中 unless $game_system.map_interpreter.running? or $game_system.menu_disabled # 设置菜单调用标志以及 SE 演奏 $game_temp.menu_calling = true $game_temp.menu_beep = true end end # 调试模式为 ON 并且按下 F9 键的情况下 if $DEBUG and Input.press?(Input::F9) # 设置调用调试标志 $game_temp.debug_calling = true end # 不在主角移动中的情况下 unless $game_player.moving? # 执行各种画面的调用 if $game_temp.battle_calling call_battle elsif $game_temp.shop_calling call_shop elsif $game_temp.name_calling call_name elsif $game_temp.menu_calling call_menu elsif $game_temp.save_calling call_save elsif $game_temp.debug_calling call_debug end end endend#---------------------------------------------------------class Interpreter def bluefool_sort if $am != nil if $a.size > Blue::NAM_MAX a_temp = {} j = 0 for i in ($a.size - Blue::Blue_max)...$a.size a_temp[j] = $a[i] j += 1 end $a = a_temp end if $am.length < 54 $a[$a.size] = $am else while $am.length > 53 i = 53 while (/\W/ =~ $am[i-3,3]) != nil i -= 1 end $a[$a.size] = $am[0,i] $am = $am[i ,$am.length - i] end $a[$a.size] = $am end $am = nil end endend#==============================================================================# ■ Window_Down#------------------------------------------------------------------------------# 信息窗口。#============================================================================== class Window_Down < Window_Selectable #-------------------------------------------------------------------------- # ● 初始化对像 #-------------------------------------------------------------------------- def initialize super(0, 240, 330, 240) @column_max = 1 self.opacity = 0 if $a != nil and $a.size < 21 self.index = $a.size/2 elsif $a != nil and $a.size > 20 self.index = 9 end refresh self.active = false end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh if self.contents != nil self.contents.dispose self.contents = nil end if $a != nil and $a.size < Blue::Blue_max + 1 @item_max = $a.size elsif $a != nil and $a.size > Blue::Blue_max @item_max = Blue::Blue_max end if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 16) for i in 0...@item_max draw_item(i) end end end def item_max return @item_max end #-------------------------------------------------------------------------- # ● 描绘项目 # index : 项目编号 #-------------------------------------------------------------------------- def draw_item(index) if $a.size < Blue::Blue_max + 1 item = $a[index] else item = $a[index + $a.size - Blue::Blue_max] end x = 0 y = index * 16 self.contents.font.size = 14 self.contents.font.color = Color.new(-170,-170,-170,255) self.contents.draw_text(x + 6, y + 1, self.contents.text_size(item).width, 16, item, 0) self.contents.font.color = normal_color self.contents.draw_text(x + 5, y, self.contents.text_size(item).width, 16, item, 0) end #-------------------------------------- # ● 刷新光标 #-------------------------------------- def update_cursor_rect # 光标位置不满 0 的情况下 if @index < 0 self.cursor_rect.empty return end # 获取当前的行 row = @index / @column_max # 当前行被显示开头行前面的情况下 if row < self.top_row # 从当前行向开头行滚动 self.top_row = row end # 当前行被显示末尾行之后的情况下 if row > self.top_row + (self.page_row_max - 1) # 从当前行向末尾滚动 self.top_row = row - (self.page_row_max - 1) end # 计算光标的宽 cursor_width = self.width / @column_max - 32 cursor_width = 0 # 计算光标坐标 x = @index % @column_max * (cursor_width + 32) y = @index / @column_max * 32 - self.oy # 更新国标矩形 self.cursor_rect.set(x, y, cursor_width, 16) endend
#------------------制作by bluefool,转载请保留------------------ module Blue #这个是控制显示最近的多少条信息的,当超出一屏能显示的值的话可通过先按一下shift #然后用上下翻看内容。再按一次shift则解除激活 Blue_max = 9 #战斗画面时即时消息窗口的x坐标 BATAM_X = 0 #战斗画面时即时消息窗口的y坐标 BATAM_Y = 90 #用于清空hash表,可以不管它,但不要让Blue_max大于它,当然,它的值也可以改变 NAM_MAX = 20 #主要传递信息参数为函数$am,参见脚本内容 end #------------------------------------------- class Scene_Load < Scene_File #-------------------------------------------------------------------------- # ● 确定时的处理 #-------------------------------------------------------------------------- def on_decision(filename) # 文件不存在的情况下 unless FileTest.exist?(filename) # 演奏冻结 SE $game_system.se_play($data_system.buzzer_se) return end # 演奏读档 SE $game_system.se_play($data_system.load_se) # 写入存档数据 file = File.open(filename, "rb") read_save_data(file) file.close # 还原 BGM、BGS $game_system.bgm_play($game_system.playing_bgm) $game_system.bgs_play($game_system.playing_bgs) # 刷新地图 (执行并行事件) $a = {} $game_map.update # 切换到地图画面 $scene = Scene_Map.new end end class Game_Player < Game_Character def update # 本地变量记录移动信息 last_moving = moving? # 移动中、事件执行中、强制移动路线中、 # 信息窗口一个也不显示的时候 unless moving? or $game_system.map_interpreter.running? or @move_route_forcing or $game_temp.message_window_showing or $ccc == 1 case Input.dir4 when 2 move_down when 4 move_left when 6 move_right when 8 move_up end end # 本地变量记忆坐标 last_real_x = @real_x last_real_y = @real_y super # 角色向下移动、画面上的位置在中央下方的情况下 if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y # 画面向下卷动 $game_map.scroll_down(@real_y - last_real_y) end # 角色向左移动、画面上的位置在中央左方的情况下 if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X # 画面向左卷动 $game_map.scroll_left(last_real_x - @real_x) end # 角色向右移动、画面上的位置在中央右方的情况下 if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X # 画面向右卷动 $game_map.scroll_right(@real_x - last_real_x) end # 角色向上移动、画面上的位置在中央上方的情况下 if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y # 画面向上卷动 $game_map.scroll_up(last_real_y - @real_y) end # 不在移动中的情况下 unless moving? # 上次主角移动中的情况 if last_moving # 与同位置的事件接触就判定为事件启动 result = check_event_trigger_here([1,2]) # 没有可以启动的事件的情况下 if result == false # 调试模式为 ON 并且按下 CTRL 键的情况下除外 unless $DEBUG and Input.press?(Input::CTRL) # 遇敌计数下降 if @encounter_count > 0 @encounter_count -= 1 end end end end # 按下 C 键的情况下 if Input.trigger?(Input::C) # 判定为同位置以及正面的事件启动 check_event_trigger_here([0]) check_event_trigger_there([0,1,2]) end end end end #============================================================================== # ■ Scene_Title #------------------------------------------------------------------------------ # 处理标题画面的类。 #============================================================================== class Scene_Title #-------------------------------------------------------------------------- # ● 命令 : 新游戏 #-------------------------------------------------------------------------- def command_new_game # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 停止 BGM Audio.bgm_stop # 重置测量游戏时间用的画面计数器 Graphics.frame_count = 0 # 生成各种游戏对像 $game_temp = Game_Temp.new $game_system = Game_System.new $game_switches = Game_Switches.new $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_screen = Game_Screen.new $game_actors = Game_Actors.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new # 设置初期同伴位置 $game_party.setup_starting_members # 设置初期位置的地图 $game_map.setup($data_system.start_map_id) # 主角向初期位置移动 $game_player.moveto($data_system.start_x, $data_system.start_y) # 刷新主角 $game_player.refresh # 执行地图设置的 BGM 与 BGS 的自动切换 $game_map.autoplay # 刷新地图 (执行并行事件) $game_map.update $a = {} $ccc = 0 # 切换地图画面 $scene = Scene_Map.new end #-------------------------------------------------------------------------- # ● 命令 : 继续 #-------------------------------------------------------------------------- def command_continue # 继续无效的情况下 unless @continue_enabled # 演奏无效 SE $game_system.se_play($data_system.buzzer_se) return end # 演奏确定 SE $game_system.se_play($data_system.decision_se) # 切换到读档画面 $scene = Scene_Load.new end #-------------------------------------------------------------------------- # ● 命令 : 退出 #-------------------------------------------------------------------------- def command_shutdown # 演奏确定 SE $game_system.se_play($data_system.decision_se) # BGM、BGS、ME 的淡入淡出 Audio.bgm_fade(800) Audio.bgs_fade(800) Audio.me_fade(800) # 退出 $scene = nil end #-------------------------------------------------------------------------- # ● 战斗测试 #-------------------------------------------------------------------------- def battle_test # 载入数据库 (战斗测试用) $data_actors = load_data("Data/BT_Actors.rxdata") $data_classes = load_data("Data/BT_Classes.rxdata") $data_skills = load_data("Data/BT_Skills.rxdata") $data_items = load_data("Data/BT_Items.rxdata") $data_weapons = load_data("Data/BT_Weapons.rxdata") $data_armors = load_data("Data/BT_Armors.rxdata") $data_enemies = load_data("Data/BT_Enemies.rxdata") $data_troops = load_data("Data/BT_Troops.rxdata") $data_states = load_data("Data/BT_States.rxdata") $data_animations = load_data("Data/BT_Animations.rxdata") $data_tilesets = load_data("Data/BT_Tilesets.rxdata") $data_common_events = load_data("Data/BT_CommonEvents.rxdata") $data_system = load_data("Data/BT_System.rxdata") # 重置测量游戏时间用的画面计数器 Graphics.frame_count = 0 # 生成各种游戏对像 $game_temp = Game_Temp.new $game_system = Game_System.new $game_switches = Game_Switches.new $game_variables = Game_Variables.new $game_self_switches = Game_SelfSwitches.new $game_screen = Game_Screen.new $game_actors = Game_Actors.new $game_party = Game_Party.new $game_troop = Game_Troop.new $game_map = Game_Map.new $game_player = Game_Player.new # 设置战斗测试用同伴 $game_party.setup_battle_test_members # 设置队伍 ID、可以逃走标志、战斗背景 $game_temp.battle_troop_id = $data_system.test_troop_id $game_temp.battle_can_escape = true $game_map.battleback_name = $data_system.battleback_name # 演奏战斗开始 BGM $game_system.se_play($data_system.battle_start_se) # 演奏战斗 BGM $game_system.bgm_play($game_system.battle_bgm) # 切换到战斗画面 $scene = Scene_Battle.new end end #------------------------------------------------------- class Scene_Map #-------------------------------------------------------------------------- # ● 主处理 #-------------------------------------------------------------------------- def main @spriteset = Spriteset_Map.new @message_window = Window_Message.new @down_window = Window_Down.new Graphics.transition # 主循环 loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @spriteset.dispose @message_window.dispose @down_window.dispose if $scene.is_a?(Scene_Title) Graphics.transition Graphics.freeze end @am_size = $a.size end #--------------------- def bluefool_sort if $am != nil if $a.size > Blue::NAM_MAX a_temp = {} j = 0 for i in ($a.size - Blue::Blue_max)...$a.size a_temp[j] = $a[i] j += 1 end $a = a_temp end if $am.length < 54 $a[$a.size] = $am else while $am.length > 53 i = 53 while (/\W/ =~ $am[i-3,3]) != nil i -= 1 end $a[$a.size] = $am[0,i] $am = $am[i ,$am.length - i] end $a[$a.size] = $am end $am = nil end end #-------------------------------------------------------------------------- # ● 刷新画面 #-------------------------------------------------------------------------- def update # 循环 loop do # 按照地图、实例、主角的顺序刷新 # (本更新顺序不会在的满足事件的执行条件下成为给予角色瞬间移动 # 的机会的重要因素) $game_map.update $game_system.map_interpreter.update $game_player.update # 系统 (计时器)、画面刷新 $game_system.update $game_screen.update # 如果主角在场所移动中就中断循环 unless $game_temp.player_transferring break end # 执行场所移动 transfer_player # 处理过渡中的情况下、中断循环 if $game_temp.transition_processing break end end # 刷新活动块 @spriteset.update # 刷新信息窗口 @message_window.update # 游戏结束的情况下 if $game_temp.gameover # 切换的游戏结束画面 $scene = Scene_Gameover.new return end # 返回标题画面的情况下 if $game_temp.to_title # 切换到标题画面 $scene = Scene_Title.new return end # 处理过渡中的情况下 if $game_temp.transition_processing # 清除过渡处理中标志 $game_temp.transition_processing = false # 执行过渡 if $game_temp.transition_name == "" Graphics.transition(20) else Graphics.transition(40, "Graphics/Transitions/" + $game_temp.transition_name) end end # 显示信息窗口中的情况下 if $game_temp.message_window_showing return end # 遇敌计数为 0 且、且遇敌列表不为空的情况下 if $game_player.encounter_count == 0 and $game_map.encounter_list != [] # 不是在事件执行中或者禁止遇敌中 unless $game_system.map_interpreter.running? or $game_system.encounter_disabled # 确定队伍 n = rand($game_map.encounter_list.size) troop_id = $game_map.encounter_list[n] # 队伍有效的话 if $data_troops[troop_id] != nil # 设置调用战斗标志 $game_temp.battle_calling = true $game_temp.battle_troop_id = troop_id $game_temp.battle_can_escape = true $game_temp.battle_can_lose = false $game_temp.battle_proc = nil end end end #--------------------------------------------- bluefool_sort if @am_size != $a.size @down_window.refresh if $a != nil and $a.size < Blue::Blue_max + 1 @down_window.index = $a.size/2 - 1 elsif $a != nil and $a.size > Blue::Blue_max @down_window.index = Blue::Blue_max/2 - 1 end @am_size = $a.size end if Input.trigger?(Input::A) if @down_window.active == false @down_window.active = true $ccc = 1 else @down_window.active = false $ccc = 0 end end if Input.trigger?(Input::DOWN)#输入DOWN键的情况 if @down_window.active == true and @down_window.index < (@down_window.item_max-1)/2 @down_window.index += 1 end end if Input.trigger?(Input::UP)#输入UP键的情况 if @down_window.active == true and @down_window.index > 0 @down_window.index -= 1 end end #---------------------------------------------- # 按下 B 键的情况下 if Input.trigger?(Input::B) # 不是在事件执行中或菜单禁止中 unless $game_system.map_interpreter.running? or $game_system.menu_disabled # 设置菜单调用标志以及 SE 演奏 $game_temp.menu_calling = true $game_temp.menu_beep = true end end # 调试模式为 ON 并且按下 F9 键的情况下 if $DEBUG and Input.press?(Input::F9) # 设置调用调试标志 $game_temp.debug_calling = true end # 不在主角移动中的情况下 unless $game_player.moving? # 执行各种画面的调用 if $game_temp.battle_calling call_battle elsif $game_temp.shop_calling call_shop elsif $game_temp.name_calling call_name elsif $game_temp.menu_calling call_menu elsif $game_temp.save_calling call_save elsif $game_temp.debug_calling call_debug end end end end #--------------------------------------------------------- class Interpreter def bluefool_sort if $am != nil if $a.size > Blue::NAM_MAX a_temp = {} j = 0 for i in ($a.size - Blue::Blue_max)...$a.size a_temp[j] = $a[i] j += 1 end $a = a_temp end if $am.length < 54 $a[$a.size] = $am else while $am.length > 53 i = 53 while (/\W/ =~ $am[i-3,3]) != nil i -= 1 end $a[$a.size] = $am[0,i] $am = $am[i ,$am.length - i] end $a[$a.size] = $am end $am = nil end end end #============================================================================== # ■ Window_Down #------------------------------------------------------------------------------ # 信息窗口。 #============================================================================== class Window_Down < Window_Selectable #-------------------------------------------------------------------------- # ● 初始化对像 #-------------------------------------------------------------------------- def initialize super(0, 240, 330, 240) @column_max = 1 self.opacity = 0 if $a != nil and $a.size < 21 self.index = $a.size/2 elsif $a != nil and $a.size > 20 self.index = 9 end refresh self.active = false end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh if self.contents != nil self.contents.dispose self.contents = nil end if $a != nil and $a.size < Blue::Blue_max + 1 @item_max = $a.size elsif $a != nil and $a.size > Blue::Blue_max @item_max = Blue::Blue_max end if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 16) for i in 0...@item_max draw_item(i) end end end def item_max return @item_max end #-------------------------------------------------------------------------- # ● 描绘项目 # index : 项目编号 #-------------------------------------------------------------------------- def draw_item(index) if $a.size < Blue::Blue_max + 1 item = $a[index] else item = $a[index + $a.size - Blue::Blue_max] end x = 0 y = index * 16 self.contents.font.size = 14 self.contents.font.color = Color.new(-170,-170,-170,255) self.contents.draw_text(x + 6, y + 1, self.contents.text_size(item).width, 16, item, 0) self.contents.font.color = normal_color self.contents.draw_text(x + 5, y, self.contents.text_size(item).width, 16, item, 0) end #-------------------------------------- # ● 刷新光标 #-------------------------------------- def update_cursor_rect # 光标位置不满 0 的情况下 if @index < 0 self.cursor_rect.empty return end # 获取当前的行 row = @index / @column_max # 当前行被显示开头行前面的情况下 if row < self.top_row # 从当前行向开头行滚动 self.top_row = row end # 当前行被显示末尾行之后的情况下 if row > self.top_row + (self.page_row_max - 1) # 从当前行向末尾滚动 self.top_row = row - (self.page_row_max - 1) end # 计算光标的宽 cursor_width = self.width / @column_max - 32 cursor_width = 0 # 计算光标坐标 x = @index % @column_max * (cursor_width + 32) y = @index / @column_max * 32 - self.oy # 更新国标矩形 self.cursor_rect.set(x, y, cursor_width, 16) end end
查看全部评分
折叠内容标题(非必须)
折叠内容
站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作
GMT+8, 2024-11-12 00:13
Powered by Discuz! X3.1
© 2001-2013 Comsenz Inc.