设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1705|回复: 1
打印 上一主题 下一主题

[已经解决] 关于【即时消息脚本】修改

[复制链接]

Lv1.梦旅人

梦石
0
星屑
106
在线时间
223 小时
注册时间
2013-6-15
帖子
449
跳转到指定楼层
1
发表于 2016-1-5 18:54:17 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
这是不知道什么时候找到的一个脚本,可以在左下角显示文字。如下图所示:

但是这个脚本有太多功能我是不需要的
各位大神能不能帮我修改下,修改成只要我输入$am="(内容)",才有内容显示。
其他入对话显示文字、战斗显示文字等功能一律不要。
游戏连接如下:(还没开始做就放弃了,只是个不成熟的想法,抛砖引玉)
漫画家.rar (353.18 KB, 下载次数: 54)
脚本如下:
RUBY 代码复制
  1. #------------------制作by bluefool,转载请保留------------------
  2. module Blue
  3.   #这个是控制显示最近的多少条信息的,当超出一屏能显示的值的话可通过先按一下shift
  4.   #然后用上下翻看内容。再按一次shift则解除激活
  5.   Blue_max = 9
  6.   #这个填写进如游戏时生成的系统语言,
  7.   INTRO = "欢迎使用即时消息窗口,有什么建议可以联系bluefool,请从左至右依次运行事件体验功能."
  8.   #战斗画面时即时消息窗口的x坐标
  9.   BATAM_X = 0
  10.   #战斗画面时即时消息窗口的y坐标
  11.   BATAM_Y = 90
  12.   #用于清空hash表,可以不管它,但不要让Blue_max大于它,当然,它的值也可以改变
  13.   NAM_MAX = 20
  14.   #主要传递信息参数为函数$am,参见脚本内容
  15. end
  16. #-------------------------------------------
  17. class Scene_Load < Scene_File
  18.   #--------------------------------------------------------------------------
  19.   # ● 确定时的处理
  20.   #--------------------------------------------------------------------------
  21.   def on_decision(filename)
  22.     # 文件不存在的情况下
  23.     unless FileTest.exist?(filename)
  24.       # 演奏冻结 SE
  25.       $game_system.se_play($data_system.buzzer_se)
  26.       return
  27.     end
  28.     # 演奏读档 SE
  29.     $game_system.se_play($data_system.load_se)
  30.     # 写入存档数据
  31.     file = File.open(filename, "rb")
  32.     read_save_data(file)
  33.     file.close
  34.     # 还原 BGM、BGS
  35.     $game_system.bgm_play($game_system.playing_bgm)
  36.     $game_system.bgs_play($game_system.playing_bgs)
  37.     # 刷新地图 (执行并行事件)
  38.     $a = {}
  39.     $game_map.update
  40.     # 切换到地图画面
  41.     $scene = Scene_Map.new
  42.   end
  43. end  
  44. class Game_Player < Game_Character
  45.   def update
  46.     # 本地变量记录移动信息
  47.     last_moving = moving?
  48.     # 移动中、事件执行中、强制移动路线中、
  49.     # 信息窗口一个也不显示的时候
  50.     unless moving? or $game_system.map_interpreter.running? or
  51.            @move_route_forcing or $game_temp.message_window_showing or $ccc == 1
  52.       case Input.dir4
  53.       when 2
  54.         move_down
  55.       when 4
  56.         move_left
  57.       when 6
  58.         move_right
  59.       when 8
  60.         move_up
  61.       end
  62.     end
  63.     # 本地变量记忆坐标
  64.     last_real_x = @real_x
  65.     last_real_y = @real_y
  66.     super
  67.     # 角色向下移动、画面上的位置在中央下方的情况下
  68.     if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
  69.       # 画面向下卷动
  70.       $game_map.scroll_down(@real_y - last_real_y)
  71.     end
  72.     # 角色向左移动、画面上的位置在中央左方的情况下
  73.     if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
  74.       # 画面向左卷动
  75.       $game_map.scroll_left(last_real_x - @real_x)
  76.     end
  77.     # 角色向右移动、画面上的位置在中央右方的情况下
  78.     if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
  79.       # 画面向右卷动
  80.       $game_map.scroll_right(@real_x - last_real_x)
  81.     end
  82.     # 角色向上移动、画面上的位置在中央上方的情况下
  83.     if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
  84.       # 画面向上卷动
  85.       $game_map.scroll_up(last_real_y - @real_y)
  86.     end
  87.     # 不在移动中的情况下
  88.     unless moving?
  89.       # 上次主角移动中的情况
  90.       if last_moving
  91.         # 与同位置的事件接触就判定为事件启动
  92.         result = check_event_trigger_here([1,2])
  93.         # 没有可以启动的事件的情况下
  94.         if result == false
  95.           # 调试模式为 ON 并且按下 CTRL 键的情况下除外
  96.           unless $DEBUG and Input.press?(Input::CTRL)
  97.             # 遇敌计数下降
  98.             if @encounter_count > 0
  99.               @encounter_count -= 1
  100.             end
  101.           end
  102.         end
  103.       end
  104.       # 按下 C 键的情况下
  105.       if Input.trigger?(Input::C)
  106.         # 判定为同位置以及正面的事件启动
  107.         check_event_trigger_here([0])
  108.         check_event_trigger_there([0,1,2])
  109.       end
  110.     end
  111.   end
  112. end  
  113. #==============================================================================
  114. # ■ Scene_Title
  115. #------------------------------------------------------------------------------
  116. #  处理标题画面的类。
  117. #==============================================================================
  118.  
  119. class Scene_Title
  120.   #--------------------------------------------------------------------------
  121.   # ● 命令 : 新游戏
  122.   #--------------------------------------------------------------------------
  123.   def command_new_game
  124.     # 演奏确定 SE
  125.     $game_system.se_play($data_system.decision_se)
  126.     # 停止 BGM
  127.     Audio.bgm_stop
  128.     # 重置测量游戏时间用的画面计数器
  129.     Graphics.frame_count = 0
  130.     # 生成各种游戏对像
  131.     $game_temp          = Game_Temp.new
  132.     $game_system        = Game_System.new
  133.     $game_switches      = Game_Switches.new
  134.     $game_variables     = Game_Variables.new
  135.     $game_self_switches = Game_SelfSwitches.new
  136.     $game_screen        = Game_Screen.new
  137.     $game_actors        = Game_Actors.new
  138.     $game_party         = Game_Party.new
  139.     $game_troop         = Game_Troop.new
  140.     $game_map           = Game_Map.new
  141.     $game_player        = Game_Player.new
  142.     # 设置初期同伴位置
  143.     $game_party.setup_starting_members
  144.     # 设置初期位置的地图
  145.     $game_map.setup($data_system.start_map_id)
  146.     # 主角向初期位置移动
  147.     $game_player.moveto($data_system.start_x, $data_system.start_y)
  148.     # 刷新主角
  149.     $game_player.refresh
  150.     # 执行地图设置的 BGM 与 BGS 的自动切换
  151.     $game_map.autoplay
  152.     # 刷新地图 (执行并行事件)
  153.     $game_map.update
  154.     $a = {}
  155.     $am = Blue::INTRO
  156.     $ccc = 0
  157.     # 切换地图画面
  158.     $scene = Scene_Map.new
  159.   end
  160.   #--------------------------------------------------------------------------
  161.   # ● 命令 : 继续
  162.   #--------------------------------------------------------------------------
  163.   def command_continue
  164.     # 继续无效的情况下
  165.     unless @continue_enabled
  166.       # 演奏无效 SE
  167.       $game_system.se_play($data_system.buzzer_se)
  168.       return
  169.     end
  170.     # 演奏确定 SE
  171.     $game_system.se_play($data_system.decision_se)
  172.     # 切换到读档画面
  173.     $scene = Scene_Load.new
  174.   end
  175.   #--------------------------------------------------------------------------
  176.   # ● 命令 : 退出
  177.   #--------------------------------------------------------------------------
  178.   def command_shutdown
  179.     # 演奏确定 SE
  180.     $game_system.se_play($data_system.decision_se)
  181.     # BGM、BGS、ME 的淡入淡出
  182.     Audio.bgm_fade(800)
  183.     Audio.bgs_fade(800)
  184.     Audio.me_fade(800)
  185.     # 退出
  186.     $scene = nil
  187.   end
  188.   #--------------------------------------------------------------------------
  189.   # ● 战斗测试
  190.   #--------------------------------------------------------------------------
  191.   def battle_test
  192.     # 载入数据库 (战斗测试用)
  193.     $data_actors        = load_data("Data/BT_Actors.rxdata")
  194.     $data_classes       = load_data("Data/BT_Classes.rxdata")
  195.     $data_skills        = load_data("Data/BT_Skills.rxdata")
  196.     $data_items         = load_data("Data/BT_Items.rxdata")
  197.     $data_weapons       = load_data("Data/BT_Weapons.rxdata")
  198.     $data_armors        = load_data("Data/BT_Armors.rxdata")
  199.     $data_enemies       = load_data("Data/BT_Enemies.rxdata")
  200.     $data_troops        = load_data("Data/BT_Troops.rxdata")
  201.     $data_states        = load_data("Data/BT_States.rxdata")
  202.     $data_animations    = load_data("Data/BT_Animations.rxdata")
  203.     $data_tilesets      = load_data("Data/BT_Tilesets.rxdata")
  204.     $data_common_events = load_data("Data/BT_CommonEvents.rxdata")
  205.     $data_system        = load_data("Data/BT_System.rxdata")
  206.     # 重置测量游戏时间用的画面计数器
  207.     Graphics.frame_count = 0
  208.     # 生成各种游戏对像
  209.     $game_temp          = Game_Temp.new
  210.     $game_system        = Game_System.new
  211.     $game_switches      = Game_Switches.new
  212.     $game_variables     = Game_Variables.new
  213.     $game_self_switches = Game_SelfSwitches.new
  214.     $game_screen        = Game_Screen.new
  215.     $game_actors        = Game_Actors.new
  216.     $game_party         = Game_Party.new
  217.     $game_troop         = Game_Troop.new
  218.     $game_map           = Game_Map.new
  219.     $game_player        = Game_Player.new
  220.     $a = {0=>"进入战斗测试."}
  221.     # 设置战斗测试用同伴
  222.     $game_party.setup_battle_test_members
  223.     # 设置队伍 ID、可以逃走标志、战斗背景
  224.     $game_temp.battle_troop_id = $data_system.test_troop_id
  225.     $game_temp.battle_can_escape = true
  226.     $game_map.battleback_name = $data_system.battleback_name
  227.     # 演奏战斗开始 BGM
  228.     $game_system.se_play($data_system.battle_start_se)
  229.     # 演奏战斗 BGM
  230.     $game_system.bgm_play($game_system.battle_bgm)
  231.     # 切换到战斗画面
  232.     $scene = Scene_Battle.new
  233.   end
  234. end
  235. #-------------------------------------------------------
  236. class Scene_Map
  237.   #--------------------------------------------------------------------------
  238.   # ● 主处理
  239.   #--------------------------------------------------------------------------
  240.   def main
  241.     @spriteset = Spriteset_Map.new
  242.     @message_window = Window_Message.new
  243.     @down_window = Window_Down.new
  244.     Graphics.transition
  245.     # 主循环
  246.     loop do
  247.       Graphics.update
  248.       Input.update
  249.       update
  250.       if $scene != self
  251.         break
  252.       end
  253.     end
  254.     Graphics.freeze
  255.     @spriteset.dispose
  256.     @message_window.dispose
  257.     @down_window.dispose
  258.     if $scene.is_a?(Scene_Title)
  259.       Graphics.transition
  260.       Graphics.freeze
  261.     end
  262.     @am_size = $a.size
  263.   end
  264.   #---------------------
  265.   def bluefool_sort
  266.     if $am != nil
  267.        if $a.size > Blue::NAM_MAX
  268.           a_temp = {}
  269.           j = 0
  270.           for i in ($a.size - Blue::Blue_max)...$a.size
  271.             a_temp[j] = $a[i]
  272.             j += 1
  273.           end  
  274.          $a = a_temp
  275.        end  
  276.        if $am.length < 54
  277.           $a[$a.size] = $am
  278.         else
  279.           while $am.length > 53
  280.             i = 53
  281.             while (/\W/ =~ $am[i-3,3]) != nil
  282.               i -= 1
  283.             end
  284.             $a[$a.size] = $am[0,i]
  285.             $am = $am[i ,$am.length - i]
  286.           end
  287.           $a[$a.size] = $am
  288.        end
  289.        $am = nil
  290.     end
  291.   end  
  292.   #--------------------------------------------------------------------------
  293.   # ● 刷新画面
  294.   #--------------------------------------------------------------------------
  295.   def update
  296.     # 循环
  297.     loop do
  298.       # 按照地图、实例、主角的顺序刷新
  299.       # (本更新顺序不会在的满足事件的执行条件下成为给予角色瞬间移动
  300.       #  的机会的重要因素)
  301.       $game_map.update
  302.       $game_system.map_interpreter.update
  303.       $game_player.update
  304.       # 系统 (计时器)、画面刷新
  305.       $game_system.update
  306.       $game_screen.update
  307.       # 如果主角在场所移动中就中断循环
  308.       unless $game_temp.player_transferring
  309.         break
  310.       end
  311.       # 执行场所移动
  312.       transfer_player
  313.       # 处理过渡中的情况下、中断循环
  314.       if $game_temp.transition_processing
  315.         break
  316.       end
  317.     end
  318.     # 刷新活动块
  319.     @spriteset.update
  320.     # 刷新信息窗口
  321.     @message_window.update
  322.     # 游戏结束的情况下
  323.     if $game_temp.gameover
  324.       # 切换的游戏结束画面
  325.       $scene = Scene_Gameover.new
  326.       return
  327.     end
  328.     # 返回标题画面的情况下
  329.     if $game_temp.to_title
  330.       # 切换到标题画面
  331.       $scene = Scene_Title.new
  332.       return
  333.     end
  334.     # 处理过渡中的情况下
  335.     if $game_temp.transition_processing
  336.       # 清除过渡处理中标志
  337.       $game_temp.transition_processing = false
  338.       # 执行过渡
  339.       if $game_temp.transition_name == ""
  340.         Graphics.transition(20)
  341.       else
  342.         Graphics.transition(40, "Graphics/Transitions/" +
  343.           $game_temp.transition_name)
  344.       end
  345.     end
  346.     # 显示信息窗口中的情况下
  347.     if $game_temp.message_window_showing
  348.       return
  349.     end
  350.     # 遇敌计数为 0 且、且遇敌列表不为空的情况下
  351.     if $game_player.encounter_count == 0 and $game_map.encounter_list != []
  352.       # 不是在事件执行中或者禁止遇敌中
  353.       unless $game_system.map_interpreter.running? or
  354.              $game_system.encounter_disabled
  355.         # 确定队伍
  356.         n = rand($game_map.encounter_list.size)
  357.         troop_id = $game_map.encounter_list[n]
  358.         # 队伍有效的话
  359.         if $data_troops[troop_id] != nil
  360.           # 设置调用战斗标志
  361.           $game_temp.battle_calling = true
  362.           $game_temp.battle_troop_id = troop_id
  363.           $game_temp.battle_can_escape = true
  364.           $game_temp.battle_can_lose = false
  365.           $game_temp.battle_proc = nil
  366.         end
  367.       end
  368.     end
  369.     #---------------------------------------------
  370.     bluefool_sort
  371.     if @am_size != $a.size
  372.        @down_window.refresh
  373.        if $a != nil and $a.size < Blue::Blue_max + 1
  374.         @down_window.index = $a.size/2 - 1
  375.         elsif $a != nil and $a.size > Blue::Blue_max
  376.         @down_window.index = Blue::Blue_max/2 - 1
  377.        end  
  378.        @am_size = $a.size
  379.     end  
  380.     if Input.trigger?(Input::A)
  381.       if @down_window.active == false
  382.         @down_window.active = true
  383.         $ccc = 1
  384.       else
  385.         @down_window.active = false
  386.         $ccc = 0
  387.       end  
  388.     end
  389.     if Input.trigger?(Input::DOWN)#输入DOWN键的情况
  390.       if @down_window.active == true and @down_window.index < (@down_window.item_max-1)/2
  391.         @down_window.index += 1
  392.       end  
  393.     end  
  394.     if Input.trigger?(Input::UP)#输入UP键的情况
  395.       if @down_window.active == true and @down_window.index > 0
  396.         @down_window.index -= 1
  397.       end  
  398.     end  
  399.     #----------------------------------------------
  400.     # 按下 B 键的情况下
  401.     if Input.trigger?(Input::B)
  402.       # 不是在事件执行中或菜单禁止中
  403.       unless $game_system.map_interpreter.running? or
  404.              $game_system.menu_disabled
  405.         # 设置菜单调用标志以及 SE 演奏
  406.         $game_temp.menu_calling = true
  407.         $game_temp.menu_beep = true
  408.       end
  409.     end
  410.     # 调试模式为 ON 并且按下 F9 键的情况下
  411.     if $DEBUG and Input.press?(Input::F9)
  412.       # 设置调用调试标志
  413.       $game_temp.debug_calling = true
  414.     end
  415.     # 不在主角移动中的情况下
  416.     unless $game_player.moving?
  417.       # 执行各种画面的调用
  418.       if $game_temp.battle_calling
  419.         call_battle
  420.       elsif $game_temp.shop_calling
  421.         call_shop
  422.       elsif $game_temp.name_calling
  423.         call_name
  424.       elsif $game_temp.menu_calling
  425.         call_menu
  426.       elsif $game_temp.save_calling
  427.         call_save
  428.       elsif $game_temp.debug_calling
  429.         call_debug
  430.       end
  431.     end
  432.   end
  433. end
  434. class Game_Battler
  435.   def bluefool_sort
  436.       if $am != nil
  437.         if $am.length < 54
  438.            $a[$a.size] = $am
  439.         else
  440.            while $am.length > 53
  441.              i = 53
  442.              while (/\W/ =~ $am[i-3,3]) != nil
  443.               i -= 1
  444.              end
  445.              $a[$a.size] = $am[0,i]
  446.              $am = $am[i ,$am.length - i]
  447.            end
  448.            $a[$a.size] = $am
  449.         end
  450.        $am = nil
  451.       end
  452.   end
  453.   #--------------------------------------------------------------------------
  454.   # ● 应用连续伤害效果
  455.   #--------------------------------------------------------------------------
  456.   def slip_damage_effect
  457.     # 设置伤害
  458.     self.damage = self.maxhp / 10
  459.     # 分散
  460.     if self.damage.abs > 0
  461.       amp = [self.damage.abs * 15 / 100, 1].max
  462.       self.damage += rand(amp+1) + rand(amp+1) - amp
  463.     end
  464.     # HP 的伤害减法运算
  465.     self.hp -= self.damage
  466.     if self.damage > 0
  467.       $am = "异常状态使#{self.name}受到了#{self.damage}点伤害."
  468.     elsif self.damage < 0
  469.       $am = "异常状态使#{self.name}恢复了#{self.damage.abs}点#{$data_system.words.hp}"
  470.     end
  471.     bluefool_sort
  472.     # 过程结束
  473.     return true
  474.   end
  475.   #--------------------------------------------------------------------------
  476.   # ● 应用通常攻击效果
  477.   #     attacker : 攻击者 (battler)
  478.   #--------------------------------------------------------------------------
  479.   def attack_effect(attacker)
  480.     # 清除会心一击标志
  481.     self.critical = false
  482.     # 第一命中判定
  483.     hit_result = (rand(100) < attacker.hit)
  484.     # 命中的情况下
  485.     if hit_result == true
  486.       # 计算基本伤害
  487.       atk = [attacker.atk - self.pdef / 2, 0].max
  488.       self.damage = atk * (20 + attacker.str) / 20
  489.       # 属性修正
  490.       self.damage *= elements_correct(attacker.element_set)
  491.       self.damage /= 100
  492.       # 伤害符号正确的情况下
  493.       if self.damage > 0
  494.         # 会心一击修正
  495.         if rand(100) < 4 * attacker.dex / self.agi
  496.           self.damage *= 2
  497.           self.critical = true
  498.         end
  499.         # 防御修正
  500.         if self.guarding?
  501.           self.damage /= 2
  502.         end
  503.       end
  504.       # 分散
  505.       if self.damage.abs > 0
  506.         amp = [self.damage.abs * 15 / 100, 1].max
  507.         self.damage += rand(amp+1) + rand(amp+1) - amp
  508.       end
  509.       # 第二命中判定
  510.       eva = 8 * self.agi / attacker.dex + self.eva
  511.       hit = self.damage < 0 ? 100 : 100 - eva
  512.       hit = self.cant_evade? ? 100 : hit
  513.       hit_result = (rand(100) < hit)
  514.     end
  515.     # 命中的情况下
  516.     if hit_result == true
  517.       # 状态冲击解除
  518.       remove_states_shock
  519.       # HP 的伤害计算
  520.       self.hp -= self.damage
  521.       $am = "#{attacker.name}对#{self.name}造成了#{self.damage}伤害."
  522.       bluefool_sort
  523.       # 状态变化
  524.       @state_changed = false
  525.       states_plus(attacker.plus_state_set)
  526.       states_minus(attacker.minus_state_set)
  527.     # Miss 的情况下
  528.     else
  529.       # 伤害设置为 "Miss"
  530.       self.damage = "Miss"
  531.       $am = "#{attacker.name}击空了."
  532.       bluefool_sort
  533.       # 清除会心一击标志
  534.       self.critical = false
  535.     end
  536.     # 过程结束
  537.     return true
  538.   end
  539.   #--------------------------------------------------------------------------
  540.   # ● 应用特技效果
  541.   #     user  : 特技的使用者 (battler)
  542.   #     skill : 特技
  543.   #--------------------------------------------------------------------------
  544.   def skill_effect(user, skill)
  545.     # 清除会心一击标志
  546.     self.critical = false
  547.     # 特技的效果范围是 HP 1 以上的己方、自己的 HP 为 0、
  548.     # 或者特技的效果范围是 HP 0 的己方、自己的 HP 为 1 以上的情况下
  549.     if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
  550.        ((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
  551.       # 过程结束
  552.       return false
  553.     end
  554.     # 清除有效标志
  555.     effective = false
  556.     # 公共事件 ID 是有效的情况下,设置为有效标志
  557.     effective |= skill.common_event_id > 0
  558.     # 第一命中判定
  559.     hit = skill.hit
  560.     if skill.atk_f > 0
  561.       hit *= user.hit / 100
  562.     end
  563.     hit_result = (rand(100) < hit)
  564.     # 不确定的特技的情况下设置为有效标志
  565.     effective |= hit < 100
  566.     # 命中的情况下
  567.     if hit_result == true
  568.       # 计算威力
  569.       power = skill.power + user.atk * skill.atk_f / 100
  570.       if power > 0
  571.         power -= self.pdef * skill.pdef_f / 200
  572.         power -= self.mdef * skill.mdef_f / 200
  573.         power = [power, 0].max
  574.       end
  575.       # 计算倍率
  576.       rate = 20
  577.       rate += (user.str * skill.str_f / 100)
  578.       rate += (user.dex * skill.dex_f / 100)
  579.       rate += (user.agi * skill.agi_f / 100)
  580.       rate += (user.int * skill.int_f / 100)
  581.       # 计算基本伤害
  582.       self.damage = power * rate / 20
  583.       # 属性修正
  584.       self.damage *= elements_correct(skill.element_set)
  585.       self.damage /= 100
  586.       # 伤害符号正确的情况下
  587.       if self.damage > 0
  588.         # 防御修正
  589.         if self.guarding?
  590.           self.damage /= 2
  591.         end
  592.       end
  593.       # 分散
  594.       if skill.variance > 0 and self.damage.abs > 0
  595.         amp = [self.damage.abs * skill.variance / 100, 1].max
  596.         self.damage += rand(amp+1) + rand(amp+1) - amp
  597.       end
  598.       # 第二命中判定
  599.       eva = 8 * self.agi / user.dex + self.eva
  600.       hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
  601.       hit = self.cant_evade? ? 100 : hit
  602.       hit_result = (rand(100) < hit)
  603.       # 不确定的特技的情况下设置为有效标志
  604.       effective |= hit < 100
  605.     end
  606.     # 命中的情况下
  607.     if hit_result == true
  608.       # 威力 0 以外的物理攻击的情况下
  609.       if skill.power != 0 and skill.atk_f > 0
  610.         # 状态冲击解除
  611.         remove_states_shock
  612.         # 设置有效标志
  613.         effective = true
  614.       end
  615.       # HP 的伤害减法运算
  616.       last_hp = self.hp
  617.       self.hp -= self.damage
  618.         if self.damage > 0
  619.          $am = "#{user.name}对#{self.name}造成了#{self.damage}伤害."
  620.          elsif self.damage < 0
  621.           if user == self
  622.            $am = "#{user.name}恢复了自己#{self.damage.abs}点#{$data_system.words.hp}."
  623.            else
  624.            $am = "#{user.name}恢复了#{self.name}#{self.damage.abs}点#{$data_system.words.hp}."
  625.           end
  626.         end
  627.       bluefool_sort
  628.       effective |= self.hp != last_hp
  629.       # 状态变化
  630.       @state_changed = false
  631.       effective |= states_plus(skill.plus_state_set)
  632.       effective |= states_minus(skill.minus_state_set)
  633.       # 威力为 0 的场合
  634.       if skill.power == 0
  635.         # 伤害设置为空的字串
  636.         self.damage = ""
  637.         # 状态没有变化的情况下
  638.         unless @state_changed
  639.           # 伤害设置为 "Miss"
  640.           self.damage = "Miss"
  641.           $am = "#{user.name}没有击中."
  642.           bluefool_sort
  643.         end
  644.       end
  645.     # Miss 的情况下
  646.     else
  647.       # 伤害设置为 "Miss"
  648.       self.damage = "Miss"
  649.       $am = "#{user.name}没有击中."
  650.       bluefool_sort
  651.     end
  652.     # 不在战斗中的情况下
  653.     unless $game_temp.in_battle
  654.       # 伤害设置为 nil
  655.       self.damage = nil
  656.     end
  657.     # 过程结束
  658.     return effective
  659.   end
  660. end
  661. class Scene_Battle
  662.   #--------------------------------------------------------------------------
  663.   # ● 刷新画面 (主回合步骤 1 : 准备行动)
  664.   #--------------------------------------------------------------------------
  665.   def update_phase4_step1
  666.     # 隐藏帮助窗口
  667.     @help_window.visible = false
  668.     # 判定胜败
  669.     if judge
  670.       # 胜利或者失败的情况下 : 过程结束
  671.       return
  672.     end
  673.     # 强制行动的战斗者不存在的情况下
  674.     if $game_temp.forcing_battler == nil
  675.       # 设置战斗事件
  676.       setup_battle_event
  677.       # 执行战斗事件中的情况下
  678.       if $game_system.battle_interpreter.running?
  679.         return
  680.       end
  681.     end
  682.     # 强制行动的战斗者存在的情况下
  683.     if $game_temp.forcing_battler != nil
  684.       # 在头部添加后移动
  685.       @action_battlers.delete($game_temp.forcing_battler)
  686.       @action_battlers.unshift($game_temp.forcing_battler)
  687.     end
  688.     # 未行动的战斗者不存在的情况下 (全员已经行动)
  689.     if @action_battlers.size == 0
  690.       # 开始同伴命令回合
  691.       start_phase2
  692.       return
  693.     end
  694.     # 初始化动画 ID 和公共事件 ID
  695.     @animation1_id = 0
  696.     @animation2_id = 0
  697.     @common_event_id = 0
  698.     # 未行动的战斗者移动到序列的头部
  699.     @active_battler = @action_battlers.shift
  700.     # 如果已经在战斗之外的情况下
  701.     if @active_battler.index == nil
  702.       return
  703.     end
  704.     # 连续伤害
  705.     if @active_battler.hp > 0 and @active_battler.slip_damage?
  706.       @active_battler.slip_damage_effect
  707.       @active_battler.damage_pop = true
  708.       @down_window.refresh
  709.     end
  710.     # 自然解除状态
  711.     @active_battler.remove_states_auto
  712.     # 刷新状态窗口
  713.     @status_window.refresh
  714.     # 移至步骤 2
  715.     @phase4_step = 2
  716.   end
  717.   #--------------------------------------------------------------------------
  718.   # ● 开始结束战斗回合
  719.   #--------------------------------------------------------------------------
  720.   def start_phase5
  721.     # 转移到回合 5
  722.     @phase = 5
  723.     # 演奏战斗结束 ME
  724.     $game_system.me_play($game_system.battle_end_me)
  725.     # 还原为战斗开始前的 BGM
  726.     $game_system.bgm_play($game_temp.map_bgm)
  727.     # 初始化 EXP、金钱、宝物
  728.     exp = 0
  729.     gold = 0
  730.     treasures = []
  731.     # 循环
  732.     for enemy in $game_troop.enemies
  733.       # 敌人不是隐藏状态的情况下
  734.       unless enemy.hidden
  735.         # 获得 EXP、增加金钱
  736.         exp += enemy.exp
  737.         gold += enemy.gold
  738.         # 出现宝物判定
  739.         if rand(100) < enemy.treasure_prob
  740.           if enemy.item_id > 0
  741.             treasures.push($data_items[enemy.item_id])
  742.           end
  743.           if enemy.weapon_id > 0
  744.             treasures.push($data_weapons[enemy.weapon_id])
  745.           end
  746.           if enemy.armor_id > 0
  747.             treasures.push($data_armors[enemy.armor_id])
  748.           end
  749.         end
  750.       end
  751.     end
  752.     # 限制宝物数为 6 个
  753.     treasures = treasures[0..5]
  754.     # 获得 EXP
  755.     for i in 0...$game_party.actors.size
  756.       actor = $game_party.actors[i]
  757.       if actor.cant_get_exp? == false
  758.         last_level = actor.level
  759.         actor.exp += exp
  760.         if actor.level > last_level
  761.           @status_window.level_up(i)
  762.         end
  763.       end
  764.     end
  765.     # 获得金钱
  766.     $game_party.gain_gold(gold)
  767.     $am = "获得#{exp}经验,#{gold}#{$data_system.words.gold}"
  768.     bluefool_sort
  769.     @down_window.refresh
  770.     # 获得宝物
  771.     for item in treasures
  772.       case item
  773.       when RPG::Item
  774.         $game_party.gain_item(item.id, 1)
  775.         $am = "获得#{$data_items[item.id].name}"
  776.         bluefool_sort
  777.       when RPG::Weapon
  778.         $game_party.gain_weapon(item.id, 1)
  779.         $am = "获得#{$data_weapons[item.id].name}"
  780.         bluefool_sort
  781.       when RPG::Armor
  782.         $game_party.gain_armor(item.id, 1)
  783.         $am = "获得#{$data_armors[item.id].name}"
  784.         bluefool_sort
  785.       end
  786.       @down_window.refresh
  787.     end
  788.     # 生成战斗结果窗口
  789.     @result_window = Window_BattleResult.new(exp, gold, treasures)
  790.     # 设置等待计数
  791.     @phase5_wait_count = 100
  792.   end
  793.   #--------------------------------------------------------------------------
  794.   # ● 生成基本行动结果
  795.   #--------------------------------------------------------------------------
  796.   def make_basic_action_result
  797.     # 攻击的情况下
  798.     if @active_battler.current_action.basic == 0
  799.       # 设置攻击 ID
  800.       @animation1_id = @active_battler.animation1_id
  801.       @animation2_id = @active_battler.animation2_id
  802.       # 行动方的战斗者是敌人的情况下
  803.       if @active_battler.is_a?(Game_Enemy)
  804.         if @active_battler.restriction == 3
  805.           target = $game_troop.random_target_enemy
  806.         elsif @active_battler.restriction == 2
  807.           target = $game_party.random_target_actor
  808.         else
  809.           index = @active_battler.current_action.target_index
  810.           target = $game_party.smooth_target_actor(index)
  811.         end
  812.       end
  813.       # 行动方的战斗者是角色的情况下
  814.       if @active_battler.is_a?(Game_Actor)
  815.         if @active_battler.restriction == 3
  816.           target = $game_party.random_target_actor
  817.         elsif @active_battler.restriction == 2
  818.           target = $game_troop.random_target_enemy
  819.         else
  820.           index = @active_battler.current_action.target_index
  821.           target = $game_troop.smooth_target_enemy(index)
  822.         end
  823.       end
  824.       # 设置对像方的战斗者序列
  825.       @target_battlers = [target]
  826.       for target in @target_battlers
  827.         $am = "#{@active_battler.name}对#{target.name}发起了进攻!"
  828.         bluefool_sort
  829.         target.attack_effect(@active_battler)
  830.       end
  831.       return
  832.     end
  833.     # 防御的情况下
  834.     if @active_battler.current_action.basic == 1
  835.       @help_window.set_text($data_system.words.guard, 1)
  836.       $am = "#{@active_battler.name}选择了防御."
  837.       bluefool_sort
  838.       return
  839.     end
  840.     # 逃跑的情况下
  841.     if @active_battler.is_a?(Game_Enemy) and
  842.        @active_battler.current_action.basic == 2
  843.       #  帮助窗口显示"逃跑"
  844.       @help_window.set_text("逃跑", 1)
  845.       # 逃跑
  846.       @active_battler.escape
  847.       return
  848.     end
  849.     # 什么也不做的情况下
  850.     if @active_battler.current_action.basic == 3
  851.       # 清除强制行动对像的战斗者
  852.       $game_temp.forcing_battler = nil
  853.       # 移至步骤 1
  854.       @phase4_step = 1
  855.       return
  856.     end
  857.   end
  858.   #--------------------------------------------------------------------------
  859.   # ● 生成特技行动结果
  860.   #--------------------------------------------------------------------------
  861.   def make_skill_action_result
  862.     # 获取特技
  863.     @skill = $data_skills[@active_battler.current_action.skill_id]
  864.     # 如果不是强制行动
  865.     unless @active_battler.current_action.forcing
  866.       # 因为 SP 耗尽而无法使用的情况下
  867.       unless @active_battler.skill_can_use?(@skill.id)
  868.         # 清除强制行动对像的战斗者
  869.         $game_temp.forcing_battler = nil
  870.         # 移至步骤 1
  871.         @phase4_step = 1
  872.         return
  873.       end
  874.     end
  875.     # 消耗 SP
  876.     @active_battler.sp -= @skill.sp_cost
  877.     # 刷新状态窗口
  878.     @status_window.refresh
  879.     # 在帮助窗口显示特技名
  880.     @help_window.set_text(@skill.name, 1)
  881.     # 设置动画 ID
  882.     @animation1_id = @skill.animation1_id
  883.     @animation2_id = @skill.animation2_id
  884.     # 设置公共事件 ID
  885.     @common_event_id = @skill.common_event_id
  886.     # 设置对像侧战斗者
  887.     set_target_battlers(@skill.scope)
  888.     # 应用特技效果
  889.     for target in @target_battlers
  890.       case @skill.scope
  891.       when 1  
  892.        $am = "#{@active_battler.name}使用#{@skill.name}攻击#{target.name}!"
  893.       when 2  
  894.        $am = "#{@active_battler.name}使用#{@skill.name}攻击#{target.name}!"
  895.       when 7  
  896.         $am = "#{@active_battler.name}对自己使用#{@skill.name}."
  897.       else
  898.         if target == @active_battler
  899.           $am = "#{@active_battler.name}对自己使用#{@skill.name}."
  900.           else
  901.           $am = "#{@active_battler.name}对#{target.name}使用#{@skill.name}."
  902.         end  
  903.       end
  904.       bluefool_sort
  905.       target.skill_effect(@active_battler, @skill)
  906.     end
  907.   end
  908.   #--------------------------------------------------------------------------
  909.   # ● 生成物品行动结果
  910.   #--------------------------------------------------------------------------
  911.   def make_item_action_result
  912.     # 获取物品
  913.     @item = $data_items[@active_battler.current_action.item_id]
  914.     # 因为物品耗尽而无法使用的情况下
  915.     unless $game_party.item_can_use?(@item.id)
  916.       # 移至步骤 1
  917.       @phase4_step = 1
  918.       return
  919.     end
  920.     # 消耗品的情况下
  921.     if @item.consumable
  922.       # 使用的物品减 1
  923.       $game_party.lose_item(@item.id, 1)
  924.     end
  925.     # 在帮助窗口显示物品名
  926.     @help_window.set_text(@item.name, 1)
  927.     # 设置动画 ID
  928.     @animation1_id = @item.animation1_id
  929.     @animation2_id = @item.animation2_id
  930.     # 设置公共事件 ID
  931.     @common_event_id = @item.common_event_id
  932.     # 确定对像
  933.     index = @active_battler.current_action.target_index
  934.     target = $game_party.smooth_target_actor(index)
  935.     # 设置对像侧战斗者
  936.     set_target_battlers(@item.scope)
  937.     # 应用物品效果
  938.     for target in @target_battlers
  939.       target.item_effect(@item)
  940.       if target == @active_battler
  941.         $am = "#{@active_battler.name}对自己使用了#{@item.name}"
  942.        else
  943.         $am = "#{@active_battler.name}对#{target.name}使用了#{@item.name}"
  944.       end
  945.       bluefool_sort
  946.     end
  947.   end
  948.   #--------------------------------------------------------------------------
  949.   # ● 刷新画面 (主回合步骤 4 : 对像方动画)
  950.   #--------------------------------------------------------------------------
  951.   def update_phase4_step4
  952.     # 对像方动画
  953.     for target in @target_battlers
  954.       target.animation_id = @animation2_id
  955.       target.animation_hit = (target.damage != "Miss")
  956.     end
  957.     @down_window.refresh
  958.     @wait_count = 8
  959.     # 移至步骤 5
  960.     @phase4_step = 5
  961.   end
  962.   def bluefool_sort
  963.       if $am != nil
  964.        if $a.size > Blue::NAM_MAX
  965.           a_temp = {}
  966.           j = 0
  967.           for i in ($a.size - Blue::Blue_max)...$a.size
  968.             a_temp[j] = $a[i]
  969.             j += 1
  970.           end  
  971.          $a = a_temp
  972.        end  
  973.         if $am.length < 54
  974.            $a[$a.size] = $am
  975.         else
  976.            while $am.length > 53
  977.              i = 53
  978.              while (/\W/ =~ $am[i-3,3]) != nil
  979.               i -= 1
  980.              end
  981.              $a[$a.size] = $am[0,i]
  982.              $am = $am[i ,$am.length - i]
  983.            end
  984.            $a[$a.size] = $am
  985.         end
  986.        $am = nil
  987.       end
  988.   end
  989.   def main
  990.     $am = "队伍进入战斗!"
  991.     bluefool_sort
  992.     $game_temp.in_battle = true
  993.     $game_temp.battle_turn = 0
  994.     $game_temp.battle_event_flags.clear
  995.     $game_temp.battle_abort = false
  996.     $game_temp.battle_main_phase = false
  997.     $game_temp.battleback_name = $game_map.battleback_name
  998.     $game_temp.forcing_battler = nil
  999.     $game_system.battle_interpreter.setup(nil, 0)
  1000.     @troop_id = $game_temp.battle_troop_id
  1001.     $game_troop.setup(@troop_id)
  1002.     #生成角色命令窗口
  1003.     s1 = $data_system.words.attack
  1004.     s2 = $data_system.words.skill
  1005.     s3 = $data_system.words.guard
  1006.     s4 = $data_system.words.item
  1007.     @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
  1008.     @actor_command_window.y = 160
  1009.     @actor_command_window.back_opacity = 160
  1010.     @actor_command_window.active = false
  1011.     @actor_command_window.visible = false
  1012.     # 生成其它窗口
  1013.     @party_command_window = Window_PartyCommand.new
  1014.     @help_window = Window_Help.new
  1015.     @help_window.back_opacity = 160
  1016.     @help_window.visible = false
  1017.     @status_window = Window_BattleStatus.new
  1018.     @message_window = Window_Message.new
  1019.     @down_window = Window_Down.new
  1020.     @down_window.y = Blue::BATAM_Y
  1021.     @down_window.z = @actor_command_window.z - 10
  1022.     # 生成活动块
  1023.     @spriteset = Spriteset_Battle.new
  1024.     # 初始化等待计数
  1025.     @wait_count = 0
  1026.     # 执行过渡
  1027.     if $data_system.battle_transition == ""
  1028.       Graphics.transition(20)
  1029.     else
  1030.       Graphics.transition(40, "Graphics/Transitions/" +
  1031.         $data_system.battle_transition)
  1032.     end
  1033.     # 开始自由战斗回合
  1034.     start_phase1
  1035.     # 主循环
  1036.     loop do
  1037.       Graphics.update
  1038.       Input.update
  1039.       update
  1040.       if $scene != self
  1041.         break
  1042.       end
  1043.     end
  1044.     # 刷新地图
  1045.     $game_map.refresh
  1046.     # 准备过渡
  1047.     Graphics.freeze
  1048.     # 释放窗口
  1049.     @actor_command_window.dispose
  1050.     @party_command_window.dispose
  1051.     @help_window.dispose
  1052.     @status_window.dispose
  1053.     @message_window.dispose
  1054.     @down_window.dispose
  1055.     $am = "战斗结束"
  1056.     bluefool_sort
  1057.     if @skill_window != nil
  1058.       @skill_window.dispose
  1059.     end
  1060.     if @item_window != nil
  1061.       @item_window.dispose
  1062.     end
  1063.     if @result_window != nil
  1064.       @result_window.dispose
  1065.     end
  1066.     # 释放活动块
  1067.     @spriteset.dispose
  1068.     # 标题画面切换中的情况
  1069.     if $scene.is_a?(Scene_Title)
  1070.       # 淡入淡出画面
  1071.       Graphics.transition
  1072.       Graphics.freeze
  1073.     end
  1074.     # 战斗测试或者游戏结束以外的画面切换中的情况
  1075.     if $BTEST and not $scene.is_a?(Scene_Gameover)
  1076.       $scene = nil
  1077.     end
  1078.   end
  1079. end
  1080. #---------------------------------------------------------
  1081. class Interpreter
  1082.   def bluefool_sort
  1083.       if $am != nil
  1084.        if $a.size > Blue::NAM_MAX
  1085.           a_temp = {}
  1086.           j = 0
  1087.           for i in ($a.size - Blue::Blue_max)...$a.size
  1088.             a_temp[j] = $a[i]
  1089.             j += 1
  1090.           end  
  1091.          $a = a_temp
  1092.        end  
  1093.         if $am.length < 54
  1094.            $a[$a.size] = $am
  1095.         else
  1096.            while $am.length > 53
  1097.              i = 53
  1098.              while (/\W/ =~ $am[i-3,3]) != nil
  1099.               i -= 1
  1100.              end
  1101.              $a[$a.size] = $am[0,i]
  1102.              $am = $am[i ,$am.length - i]
  1103.            end
  1104.            $a[$a.size] = $am
  1105.         end
  1106.        $am = nil
  1107.       end
  1108.   end
  1109.   def command_101
  1110.     if $game_temp.message_text != nil
  1111.       return false
  1112.     end
  1113.     # 设置信息结束后待机和返回调用标志
  1114.     @message_waiting = true
  1115.     $game_temp.message_proc = Proc.new { @message_waiting = false }
  1116.     # message_text 设置为 1 行
  1117.     $game_temp.message_text = @list[@index].parameters[0] + "\n"
  1118.     if (@list[@index].parameters[0]).split(/\\/)[1] != nil
  1119.      $am = @list[@index].parameters[0].split(/\\/)[0]
  1120.      else
  1121.      $am = @list[@index].parameters[0]
  1122.     end  
  1123.     bluefool_sort
  1124.     line_count = 1
  1125.     # 循环
  1126.     loop do
  1127.       # 下一个事件指令为文章两行以上的情况
  1128.       if @list[@index+1].code == 401
  1129.         # message_text 添加到第 2 行以下
  1130.         $game_temp.message_text += @list[@index+1].parameters[0] + "\n"
  1131.         $am = @list[@index+1].parameters[0]
  1132.         bluefool_sort
  1133.         line_count += 1
  1134.       # 事件指令不在文章两行以下的情况
  1135.       else
  1136.         # 下一个事件指令为显示选择项的情况下
  1137.         if @list[@index+1].code == 102
  1138.           # 如果选择项能收纳在画面里
  1139.           if @list[@index+1].parameters[0].size <= 4 - line_count
  1140.             # 推进索引
  1141.             @index += 1
  1142.             # 设置选择项
  1143.             $game_temp.choice_start = line_count
  1144.             setup_choices(@list[@index].parameters)
  1145.           end
  1146.         # 下一个事件指令为处理输入数值的情况下
  1147.         elsif @list[@index+1].code == 103
  1148.           # 如果数值输入窗口能收纳在画面里
  1149.           if line_count < 4
  1150.             # 推进索引
  1151.             @index += 1
  1152.             # 设置输入数值
  1153.             $game_temp.num_input_start = line_count
  1154.             $game_temp.num_input_variable_id = @list[@index].parameters[0]
  1155.             $game_temp.num_input_digits_max = @list[@index].parameters[1]
  1156.           end
  1157.         end
  1158.         # 继续
  1159.         return true
  1160.       end
  1161.       # 推进索引
  1162.       @index += 1
  1163.     end
  1164.   end
  1165.   def command_125
  1166.     value = operate_value(@parameters[0], @parameters[1], @parameters[2])
  1167.     $game_party.gain_gold(value)
  1168.     if value >= 0
  1169.       $am = "#{$game_party.actors[0].name}得到了#{value}#{$data_system.words.gold}"
  1170.     else
  1171.       $am = "#{$game_party.actors[0].name}失去了#{value.abs.to_s}#{$data_system.words.gold}"
  1172.     end  
  1173.     bluefool_sort
  1174.     Audio.se_play("Audio/SE/"+"006-System06",100,100)
  1175.     return true
  1176.   end
  1177.   def command_126
  1178.     value = operate_value(@parameters[1], @parameters[2], @parameters[3])
  1179.     # 增减物品
  1180.     $game_party.gain_item(@parameters[0], value)
  1181.     if value >= 0
  1182.       $am = "#{$game_party.actors[0].name}得到了#{value.abs.to_s}个#{$data_items[@parameters[0]].name}"
  1183.     else
  1184.       $am = "#{$game_party.actors[0].name}失去了#{value.abs.to_s}个#{$data_items[@parameters[0]].name}"
  1185.     end
  1186.     bluefool_sort
  1187.     Audio.se_play("Audio/SE/"+"006-System06",100,100)
  1188.     return true
  1189.   end
  1190.   def command_127
  1191.     value = operate_value(@parameters[1], @parameters[2], @parameters[3])
  1192.     # 增减武器
  1193.     $game_party.gain_weapon(@parameters[0], value)
  1194.     if value >= 0
  1195.       $am = "#{$game_party.actors[0].name}得到了#{value.abs.to_s}个#{$data_weapons[@parameters[0]].name}"
  1196.     else
  1197.       $am = "#{$game_party.actors[0].name}失去了#{value.abs.to_s}个#{$data_weapons[@parameters[0]].name}"
  1198.     end
  1199.     bluefool_sort
  1200.     Audio.se_play("Audio/SE/"+"006-System06",100,100)
  1201.     return true
  1202.   end
  1203.   def command_128
  1204.     value = operate_value(@parameters[1], @parameters[2], @parameters[3])
  1205.     # 增减防具
  1206.     $game_party.gain_armor(@parameters[0], value)
  1207.     if value >= 0
  1208.       $am = "#{$game_party.actors[0].name}得到了#{value.abs.to_s}个#{$data_armors[@parameters[0]].name}"
  1209.     else
  1210.       $am = "#{$game_party.actors[0].name}失去了#{value.abs.to_s}个#{$data_armors[@parameters[0]].name}"
  1211.     end
  1212.     bluefool_sort
  1213.     Audio.se_play("Audio/SE/"+"006-System06",100,100)
  1214.     return true
  1215.   end
  1216.   def command_129
  1217.     # 获取角色
  1218.     actor = $game_actors[@parameters[0]]
  1219.     # 角色有效的情况下
  1220.     if actor != nil
  1221.       # 操作分支
  1222.       if @parameters[1] == 0
  1223.         if @parameters[2] == 1
  1224.           $game_actors[@parameters[0]].setup(@parameters[0])
  1225.         end
  1226.         $game_party.add_actor(@parameters[0])
  1227.         Audio.me_play("Audio/ME/"+"002-Victory02",100,100)
  1228.         $am = "#{$game_actors[@parameters[0]].name}加入队伍!"
  1229.         bluefool_sort
  1230.       else
  1231.         $game_party.remove_actor(@parameters[0])
  1232.         Audio.me_play("Audio/ME/"+"015-Mystery01",100,100)
  1233.         $am = "#{$game_actors[@parameters[0]].name}离开队伍!"
  1234.         bluefool_sort
  1235.       end
  1236.     end
  1237.    # 继续
  1238.     return true
  1239.   end
  1240.   #-------------------------
  1241. end
  1242. #==============================================================================
  1243. # ■ Window_Down
  1244. #------------------------------------------------------------------------------
  1245. #   信息窗口。
  1246. #==============================================================================
  1247.  
  1248. class Window_Down < Window_Selectable
  1249.   #--------------------------------------------------------------------------
  1250.   # ● 初始化对像
  1251.   #--------------------------------------------------------------------------
  1252.   def initialize
  1253.     super(0, 240, 330, 240)
  1254.     @column_max = 1
  1255.     self.opacity = 0
  1256.     if $a != nil and $a.size < 21
  1257.       self.index = $a.size/2
  1258.       elsif $a != nil and $a.size > 20
  1259.       self.index = 9
  1260.     end  
  1261.     refresh
  1262.     self.active = false
  1263.   end
  1264.   #--------------------------------------------------------------------------
  1265.   # ● 刷新
  1266.   #--------------------------------------------------------------------------
  1267.   def refresh
  1268.     if self.contents != nil
  1269.       self.contents.dispose
  1270.       self.contents = nil
  1271.     end
  1272.     if $a != nil and $a.size < Blue::Blue_max + 1
  1273.       @item_max = $a.size
  1274.       elsif $a != nil and $a.size > Blue::Blue_max
  1275.       @item_max = Blue::Blue_max
  1276.     end  
  1277.     if @item_max > 0
  1278.       self.contents = Bitmap.new(width - 32, row_max * 16)
  1279.       for i in 0...@item_max
  1280.          draw_item(i)
  1281.       end
  1282.     end
  1283.   end
  1284.   def item_max
  1285.     return @item_max
  1286.   end  
  1287.   #--------------------------------------------------------------------------
  1288.   # ● 描绘项目
  1289.   #     index : 项目编号
  1290.   #--------------------------------------------------------------------------
  1291.   def draw_item(index)
  1292.     if $a.size < Blue::Blue_max + 1
  1293.      item = $a[index]
  1294.      else
  1295.      item = $a[index + $a.size - Blue::Blue_max]
  1296.     end
  1297.     x = 0
  1298.     y = index * 16
  1299.     self.contents.font.size = 14
  1300.     self.contents.font.color = Color.new(-170,-170,-170,255)
  1301.     self.contents.draw_text(x + 6, y + 1, self.contents.text_size(item).width, 16, item, 0)
  1302.     self.contents.font.color = normal_color
  1303.     self.contents.draw_text(x + 5, y, self.contents.text_size(item).width, 16, item, 0)
  1304.   end
  1305.   #--------------------------------------
  1306.   #  ● 刷新光标
  1307.   #--------------------------------------
  1308.   def update_cursor_rect
  1309.     # 光标位置不满 0 的情况下
  1310.     if @index < 0
  1311.       self.cursor_rect.empty
  1312.       return
  1313.     end
  1314.     # 获取当前的行
  1315.     row = @index / @column_max
  1316.     # 当前行被显示开头行前面的情况下
  1317.     if row < self.top_row
  1318.       # 从当前行向开头行滚动
  1319.       self.top_row = row
  1320.     end
  1321.     # 当前行被显示末尾行之后的情况下
  1322.     if row > self.top_row + (self.page_row_max - 1)
  1323.       # 从当前行向末尾滚动
  1324.       self.top_row = row - (self.page_row_max - 1)
  1325.     end
  1326.     # 计算光标的宽
  1327.     cursor_width = self.width / @column_max - 32
  1328.     cursor_width = 0
  1329.     # 计算光标坐标
  1330.     x = @index % @column_max * (cursor_width + 32)
  1331.     y = @index / @column_max * 32 - self.oy
  1332.     # 更新国标矩形
  1333.     self.cursor_rect.set(x, y, cursor_width, 16)
  1334.   end
  1335. end





评分

参与人数 1星屑 +35 收起 理由
RyanBern + 35 手动认可奖励

查看全部评分

全新的脚本,全新的素材?
太天真了你们
有了新脚本新素材反而会让你的工作量成倍增加
在做游戏的道路上不要被一切辅助因素蒙蔽了双眼
其实默认系统的素材脚本就可以做出好游戏
好好想想你们最初接触RM这软件时的震撼和激动吧

Lv3.寻梦者

梦石
0
星屑
1759
在线时间
2524 小时
注册时间
2010-10-12
帖子
1454

开拓者

2
发表于 2016-1-6 01:58:21 | 只看该作者
RUBY 代码复制
  1. #------------------制作by bluefool,转载请保留------------------
  2. module Blue
  3.   #这个是控制显示最近的多少条信息的,当超出一屏能显示的值的话可通过先按一下shift
  4.   #然后用上下翻看内容。再按一次shift则解除激活
  5.   Blue_max = 9
  6.   #战斗画面时即时消息窗口的x坐标
  7.   BATAM_X = 0
  8.   #战斗画面时即时消息窗口的y坐标
  9.   BATAM_Y = 90
  10.   #用于清空hash表,可以不管它,但不要让Blue_max大于它,当然,它的值也可以改变
  11.   NAM_MAX = 20
  12.   #主要传递信息参数为函数$am,参见脚本内容
  13. end
  14. #-------------------------------------------
  15. class Scene_Load < Scene_File
  16.   #--------------------------------------------------------------------------
  17.   # ● 确定时的处理
  18.   #--------------------------------------------------------------------------
  19.   def on_decision(filename)
  20.     # 文件不存在的情况下
  21.     unless FileTest.exist?(filename)
  22.       # 演奏冻结 SE
  23.       $game_system.se_play($data_system.buzzer_se)
  24.       return
  25.     end
  26.     # 演奏读档 SE
  27.     $game_system.se_play($data_system.load_se)
  28.     # 写入存档数据
  29.     file = File.open(filename, "rb")
  30.     read_save_data(file)
  31.     file.close
  32.     # 还原 BGM、BGS
  33.     $game_system.bgm_play($game_system.playing_bgm)
  34.     $game_system.bgs_play($game_system.playing_bgs)
  35.     # 刷新地图 (执行并行事件)
  36.     $a = {}
  37.     $game_map.update
  38.     # 切换到地图画面
  39.     $scene = Scene_Map.new
  40.   end
  41. end  
  42. class Game_Player < Game_Character
  43.   def update
  44.     # 本地变量记录移动信息
  45.     last_moving = moving?
  46.     # 移动中、事件执行中、强制移动路线中、
  47.     # 信息窗口一个也不显示的时候
  48.     unless moving? or $game_system.map_interpreter.running? or
  49.            @move_route_forcing or $game_temp.message_window_showing or $ccc == 1
  50.       case Input.dir4
  51.       when 2
  52.         move_down
  53.       when 4
  54.         move_left
  55.       when 6
  56.         move_right
  57.       when 8
  58.         move_up
  59.       end
  60.     end
  61.     # 本地变量记忆坐标
  62.     last_real_x = @real_x
  63.     last_real_y = @real_y
  64.     super
  65.     # 角色向下移动、画面上的位置在中央下方的情况下
  66.     if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
  67.       # 画面向下卷动
  68.       $game_map.scroll_down(@real_y - last_real_y)
  69.     end
  70.     # 角色向左移动、画面上的位置在中央左方的情况下
  71.     if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
  72.       # 画面向左卷动
  73.       $game_map.scroll_left(last_real_x - @real_x)
  74.     end
  75.     # 角色向右移动、画面上的位置在中央右方的情况下
  76.     if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
  77.       # 画面向右卷动
  78.       $game_map.scroll_right(@real_x - last_real_x)
  79.     end
  80.     # 角色向上移动、画面上的位置在中央上方的情况下
  81.     if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
  82.       # 画面向上卷动
  83.       $game_map.scroll_up(last_real_y - @real_y)
  84.     end
  85.     # 不在移动中的情况下
  86.     unless moving?
  87.       # 上次主角移动中的情况
  88.       if last_moving
  89.         # 与同位置的事件接触就判定为事件启动
  90.         result = check_event_trigger_here([1,2])
  91.         # 没有可以启动的事件的情况下
  92.         if result == false
  93.           # 调试模式为 ON 并且按下 CTRL 键的情况下除外
  94.           unless $DEBUG and Input.press?(Input::CTRL)
  95.             # 遇敌计数下降
  96.             if @encounter_count > 0
  97.               @encounter_count -= 1
  98.             end
  99.           end
  100.         end
  101.       end
  102.       # 按下 C 键的情况下
  103.       if Input.trigger?(Input::C)
  104.         # 判定为同位置以及正面的事件启动
  105.         check_event_trigger_here([0])
  106.         check_event_trigger_there([0,1,2])
  107.       end
  108.     end
  109.   end
  110. end  
  111. #==============================================================================
  112. # ■ Scene_Title
  113. #------------------------------------------------------------------------------
  114. #  处理标题画面的类。
  115. #==============================================================================
  116.  
  117. class Scene_Title
  118.   #--------------------------------------------------------------------------
  119.   # ● 命令 : 新游戏
  120.   #--------------------------------------------------------------------------
  121.   def command_new_game
  122.     # 演奏确定 SE
  123.     $game_system.se_play($data_system.decision_se)
  124.     # 停止 BGM
  125.     Audio.bgm_stop
  126.     # 重置测量游戏时间用的画面计数器
  127.     Graphics.frame_count = 0
  128.     # 生成各种游戏对像
  129.     $game_temp          = Game_Temp.new
  130.     $game_system        = Game_System.new
  131.     $game_switches      = Game_Switches.new
  132.     $game_variables     = Game_Variables.new
  133.     $game_self_switches = Game_SelfSwitches.new
  134.     $game_screen        = Game_Screen.new
  135.     $game_actors        = Game_Actors.new
  136.     $game_party         = Game_Party.new
  137.     $game_troop         = Game_Troop.new
  138.     $game_map           = Game_Map.new
  139.     $game_player        = Game_Player.new
  140.     # 设置初期同伴位置
  141.     $game_party.setup_starting_members
  142.     # 设置初期位置的地图
  143.     $game_map.setup($data_system.start_map_id)
  144.     # 主角向初期位置移动
  145.     $game_player.moveto($data_system.start_x, $data_system.start_y)
  146.     # 刷新主角
  147.     $game_player.refresh
  148.     # 执行地图设置的 BGM 与 BGS 的自动切换
  149.     $game_map.autoplay
  150.     # 刷新地图 (执行并行事件)
  151.     $game_map.update
  152.     $a = {}
  153.     $ccc = 0
  154.     # 切换地图画面
  155.     $scene = Scene_Map.new
  156.   end
  157.   #--------------------------------------------------------------------------
  158.   # ● 命令 : 继续
  159.   #--------------------------------------------------------------------------
  160.   def command_continue
  161.     # 继续无效的情况下
  162.     unless @continue_enabled
  163.       # 演奏无效 SE
  164.       $game_system.se_play($data_system.buzzer_se)
  165.       return
  166.     end
  167.     # 演奏确定 SE
  168.     $game_system.se_play($data_system.decision_se)
  169.     # 切换到读档画面
  170.     $scene = Scene_Load.new
  171.   end
  172.   #--------------------------------------------------------------------------
  173.   # ● 命令 : 退出
  174.   #--------------------------------------------------------------------------
  175.   def command_shutdown
  176.     # 演奏确定 SE
  177.     $game_system.se_play($data_system.decision_se)
  178.     # BGM、BGS、ME 的淡入淡出
  179.     Audio.bgm_fade(800)
  180.     Audio.bgs_fade(800)
  181.     Audio.me_fade(800)
  182.     # 退出
  183.     $scene = nil
  184.   end
  185.   #--------------------------------------------------------------------------
  186.   # ● 战斗测试
  187.   #--------------------------------------------------------------------------
  188.   def battle_test
  189.     # 载入数据库 (战斗测试用)
  190.     $data_actors        = load_data("Data/BT_Actors.rxdata")
  191.     $data_classes       = load_data("Data/BT_Classes.rxdata")
  192.     $data_skills        = load_data("Data/BT_Skills.rxdata")
  193.     $data_items         = load_data("Data/BT_Items.rxdata")
  194.     $data_weapons       = load_data("Data/BT_Weapons.rxdata")
  195.     $data_armors        = load_data("Data/BT_Armors.rxdata")
  196.     $data_enemies       = load_data("Data/BT_Enemies.rxdata")
  197.     $data_troops        = load_data("Data/BT_Troops.rxdata")
  198.     $data_states        = load_data("Data/BT_States.rxdata")
  199.     $data_animations    = load_data("Data/BT_Animations.rxdata")
  200.     $data_tilesets      = load_data("Data/BT_Tilesets.rxdata")
  201.     $data_common_events = load_data("Data/BT_CommonEvents.rxdata")
  202.     $data_system        = load_data("Data/BT_System.rxdata")
  203.     # 重置测量游戏时间用的画面计数器
  204.     Graphics.frame_count = 0
  205.     # 生成各种游戏对像
  206.     $game_temp          = Game_Temp.new
  207.     $game_system        = Game_System.new
  208.     $game_switches      = Game_Switches.new
  209.     $game_variables     = Game_Variables.new
  210.     $game_self_switches = Game_SelfSwitches.new
  211.     $game_screen        = Game_Screen.new
  212.     $game_actors        = Game_Actors.new
  213.     $game_party         = Game_Party.new
  214.     $game_troop         = Game_Troop.new
  215.     $game_map           = Game_Map.new
  216.     $game_player        = Game_Player.new
  217.     # 设置战斗测试用同伴
  218.     $game_party.setup_battle_test_members
  219.     # 设置队伍 ID、可以逃走标志、战斗背景
  220.     $game_temp.battle_troop_id = $data_system.test_troop_id
  221.     $game_temp.battle_can_escape = true
  222.     $game_map.battleback_name = $data_system.battleback_name
  223.     # 演奏战斗开始 BGM
  224.     $game_system.se_play($data_system.battle_start_se)
  225.     # 演奏战斗 BGM
  226.     $game_system.bgm_play($game_system.battle_bgm)
  227.     # 切换到战斗画面
  228.     $scene = Scene_Battle.new
  229.   end
  230. end
  231. #-------------------------------------------------------
  232. class Scene_Map
  233.   #--------------------------------------------------------------------------
  234.   # ● 主处理
  235.   #--------------------------------------------------------------------------
  236.   def main
  237.     @spriteset = Spriteset_Map.new
  238.     @message_window = Window_Message.new
  239.     @down_window = Window_Down.new
  240.     Graphics.transition
  241.     # 主循环
  242.     loop do
  243.       Graphics.update
  244.       Input.update
  245.       update
  246.       if $scene != self
  247.         break
  248.       end
  249.     end
  250.     Graphics.freeze
  251.     @spriteset.dispose
  252.     @message_window.dispose
  253.     @down_window.dispose
  254.     if $scene.is_a?(Scene_Title)
  255.       Graphics.transition
  256.       Graphics.freeze
  257.     end
  258.     @am_size = $a.size
  259.   end
  260.   #---------------------
  261.   def bluefool_sort
  262.     if $am != nil
  263.        if $a.size > Blue::NAM_MAX
  264.           a_temp = {}
  265.           j = 0
  266.           for i in ($a.size - Blue::Blue_max)...$a.size
  267.             a_temp[j] = $a[i]
  268.             j += 1
  269.           end  
  270.          $a = a_temp
  271.        end  
  272.        if $am.length < 54
  273.           $a[$a.size] = $am
  274.         else
  275.           while $am.length > 53
  276.             i = 53
  277.             while (/\W/ =~ $am[i-3,3]) != nil
  278.               i -= 1
  279.             end
  280.             $a[$a.size] = $am[0,i]
  281.             $am = $am[i ,$am.length - i]
  282.           end
  283.           $a[$a.size] = $am
  284.        end
  285.        $am = nil
  286.     end
  287.   end  
  288.   #--------------------------------------------------------------------------
  289.   # ● 刷新画面
  290.   #--------------------------------------------------------------------------
  291.   def update
  292.     # 循环
  293.     loop do
  294.       # 按照地图、实例、主角的顺序刷新
  295.       # (本更新顺序不会在的满足事件的执行条件下成为给予角色瞬间移动
  296.       #  的机会的重要因素)
  297.       $game_map.update
  298.       $game_system.map_interpreter.update
  299.       $game_player.update
  300.       # 系统 (计时器)、画面刷新
  301.       $game_system.update
  302.       $game_screen.update
  303.       # 如果主角在场所移动中就中断循环
  304.       unless $game_temp.player_transferring
  305.         break
  306.       end
  307.       # 执行场所移动
  308.       transfer_player
  309.       # 处理过渡中的情况下、中断循环
  310.       if $game_temp.transition_processing
  311.         break
  312.       end
  313.     end
  314.     # 刷新活动块
  315.     @spriteset.update
  316.     # 刷新信息窗口
  317.     @message_window.update
  318.     # 游戏结束的情况下
  319.     if $game_temp.gameover
  320.       # 切换的游戏结束画面
  321.       $scene = Scene_Gameover.new
  322.       return
  323.     end
  324.     # 返回标题画面的情况下
  325.     if $game_temp.to_title
  326.       # 切换到标题画面
  327.       $scene = Scene_Title.new
  328.       return
  329.     end
  330.     # 处理过渡中的情况下
  331.     if $game_temp.transition_processing
  332.       # 清除过渡处理中标志
  333.       $game_temp.transition_processing = false
  334.       # 执行过渡
  335.       if $game_temp.transition_name == ""
  336.         Graphics.transition(20)
  337.       else
  338.         Graphics.transition(40, "Graphics/Transitions/" +
  339.           $game_temp.transition_name)
  340.       end
  341.     end
  342.     # 显示信息窗口中的情况下
  343.     if $game_temp.message_window_showing
  344.       return
  345.     end
  346.     # 遇敌计数为 0 且、且遇敌列表不为空的情况下
  347.     if $game_player.encounter_count == 0 and $game_map.encounter_list != []
  348.       # 不是在事件执行中或者禁止遇敌中
  349.       unless $game_system.map_interpreter.running? or
  350.              $game_system.encounter_disabled
  351.         # 确定队伍
  352.         n = rand($game_map.encounter_list.size)
  353.         troop_id = $game_map.encounter_list[n]
  354.         # 队伍有效的话
  355.         if $data_troops[troop_id] != nil
  356.           # 设置调用战斗标志
  357.           $game_temp.battle_calling = true
  358.           $game_temp.battle_troop_id = troop_id
  359.           $game_temp.battle_can_escape = true
  360.           $game_temp.battle_can_lose = false
  361.           $game_temp.battle_proc = nil
  362.         end
  363.       end
  364.     end
  365.     #---------------------------------------------
  366.     bluefool_sort
  367.     if @am_size != $a.size
  368.        @down_window.refresh
  369.        if $a != nil and $a.size < Blue::Blue_max + 1
  370.         @down_window.index = $a.size/2 - 1
  371.         elsif $a != nil and $a.size > Blue::Blue_max
  372.         @down_window.index = Blue::Blue_max/2 - 1
  373.        end  
  374.        @am_size = $a.size
  375.     end  
  376.     if Input.trigger?(Input::A)
  377.       if @down_window.active == false
  378.         @down_window.active = true
  379.         $ccc = 1
  380.       else
  381.         @down_window.active = false
  382.         $ccc = 0
  383.       end  
  384.     end
  385.     if Input.trigger?(Input::DOWN)#输入DOWN键的情况
  386.       if @down_window.active == true and @down_window.index < (@down_window.item_max-1)/2
  387.         @down_window.index += 1
  388.       end  
  389.     end  
  390.     if Input.trigger?(Input::UP)#输入UP键的情况
  391.       if @down_window.active == true and @down_window.index > 0
  392.         @down_window.index -= 1
  393.       end  
  394.     end  
  395.     #----------------------------------------------
  396.     # 按下 B 键的情况下
  397.     if Input.trigger?(Input::B)
  398.       # 不是在事件执行中或菜单禁止中
  399.       unless $game_system.map_interpreter.running? or
  400.              $game_system.menu_disabled
  401.         # 设置菜单调用标志以及 SE 演奏
  402.         $game_temp.menu_calling = true
  403.         $game_temp.menu_beep = true
  404.       end
  405.     end
  406.     # 调试模式为 ON 并且按下 F9 键的情况下
  407.     if $DEBUG and Input.press?(Input::F9)
  408.       # 设置调用调试标志
  409.       $game_temp.debug_calling = true
  410.     end
  411.     # 不在主角移动中的情况下
  412.     unless $game_player.moving?
  413.       # 执行各种画面的调用
  414.       if $game_temp.battle_calling
  415.         call_battle
  416.       elsif $game_temp.shop_calling
  417.         call_shop
  418.       elsif $game_temp.name_calling
  419.         call_name
  420.       elsif $game_temp.menu_calling
  421.         call_menu
  422.       elsif $game_temp.save_calling
  423.         call_save
  424.       elsif $game_temp.debug_calling
  425.         call_debug
  426.       end
  427.     end
  428.   end
  429. end
  430. #---------------------------------------------------------
  431. class Interpreter
  432.   def bluefool_sort
  433.       if $am != nil
  434.        if $a.size > Blue::NAM_MAX
  435.           a_temp = {}
  436.           j = 0
  437.           for i in ($a.size - Blue::Blue_max)...$a.size
  438.             a_temp[j] = $a[i]
  439.             j += 1
  440.           end  
  441.          $a = a_temp
  442.        end  
  443.         if $am.length < 54
  444.            $a[$a.size] = $am
  445.         else
  446.            while $am.length > 53
  447.              i = 53
  448.              while (/\W/ =~ $am[i-3,3]) != nil
  449.               i -= 1
  450.              end
  451.              $a[$a.size] = $am[0,i]
  452.              $am = $am[i ,$am.length - i]
  453.            end
  454.            $a[$a.size] = $am
  455.         end
  456.        $am = nil
  457.       end
  458.   end
  459. end
  460. #==============================================================================
  461. # ■ Window_Down
  462. #------------------------------------------------------------------------------
  463. #   信息窗口。
  464. #==============================================================================
  465.  
  466. class Window_Down < Window_Selectable
  467.   #--------------------------------------------------------------------------
  468.   # ● 初始化对像
  469.   #--------------------------------------------------------------------------
  470.   def initialize
  471.     super(0, 240, 330, 240)
  472.     @column_max = 1
  473.     self.opacity = 0
  474.     if $a != nil and $a.size < 21
  475.       self.index = $a.size/2
  476.       elsif $a != nil and $a.size > 20
  477.       self.index = 9
  478.     end  
  479.     refresh
  480.     self.active = false
  481.   end
  482.   #--------------------------------------------------------------------------
  483.   # ● 刷新
  484.   #--------------------------------------------------------------------------
  485.   def refresh
  486.     if self.contents != nil
  487.       self.contents.dispose
  488.       self.contents = nil
  489.     end
  490.     if $a != nil and $a.size < Blue::Blue_max + 1
  491.       @item_max = $a.size
  492.       elsif $a != nil and $a.size > Blue::Blue_max
  493.       @item_max = Blue::Blue_max
  494.     end  
  495.     if @item_max > 0
  496.       self.contents = Bitmap.new(width - 32, row_max * 16)
  497.       for i in 0...@item_max
  498.          draw_item(i)
  499.       end
  500.     end
  501.   end
  502.   def item_max
  503.     return @item_max
  504.   end  
  505.   #--------------------------------------------------------------------------
  506.   # ● 描绘项目
  507.   #     index : 项目编号
  508.   #--------------------------------------------------------------------------
  509.   def draw_item(index)
  510.     if $a.size < Blue::Blue_max + 1
  511.      item = $a[index]
  512.      else
  513.      item = $a[index + $a.size - Blue::Blue_max]
  514.     end
  515.     x = 0
  516.     y = index * 16
  517.     self.contents.font.size = 14
  518.     self.contents.font.color = Color.new(-170,-170,-170,255)
  519.     self.contents.draw_text(x + 6, y + 1, self.contents.text_size(item).width, 16, item, 0)
  520.     self.contents.font.color = normal_color
  521.     self.contents.draw_text(x + 5, y, self.contents.text_size(item).width, 16, item, 0)
  522.   end
  523.   #--------------------------------------
  524.   #  ● 刷新光标
  525.   #--------------------------------------
  526.   def update_cursor_rect
  527.     # 光标位置不满 0 的情况下
  528.     if @index < 0
  529.       self.cursor_rect.empty
  530.       return
  531.     end
  532.     # 获取当前的行
  533.     row = @index / @column_max
  534.     # 当前行被显示开头行前面的情况下
  535.     if row < self.top_row
  536.       # 从当前行向开头行滚动
  537.       self.top_row = row
  538.     end
  539.     # 当前行被显示末尾行之后的情况下
  540.     if row > self.top_row + (self.page_row_max - 1)
  541.       # 从当前行向末尾滚动
  542.       self.top_row = row - (self.page_row_max - 1)
  543.     end
  544.     # 计算光标的宽
  545.     cursor_width = self.width / @column_max - 32
  546.     cursor_width = 0
  547.     # 计算光标坐标
  548.     x = @index % @column_max * (cursor_width + 32)
  549.     y = @index / @column_max * 32 - self.oy
  550.     # 更新国标矩形
  551.     self.cursor_rect.set(x, y, cursor_width, 16)
  552.   end
  553. end




我就删了个大概。没有细看,但是至少现在除了手动的$am其他都删了





评分

参与人数 2星屑 +45 梦石 +1 收起 理由
RyanBern + 1 认可答案
神木大人 + 45 认可答案

查看全部评分


回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-22 19:38

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表