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

Project1

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

[已经过期] 像RMVX那样的文字战报

[复制链接]

Lv1.梦旅人

梦石
0
星屑
103
在线时间
159 小时
注册时间
2010-7-4
帖子
44
跳转到指定楼层
1
发表于 2013-9-3 09:39:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
在战斗的同时用文字显示战斗信息,
比如
角色阿尔西斯发动了十字斩,攻击了幽灵1
幽灵1陷入了眩晕状态
幽灵1的眩晕状态解除了
幽灵1攻击了阿尔西斯
阿尔西斯使用了恢复剂,恢复了200点生命

Lv3.寻梦者

梦石
0
星屑
2744
在线时间
2630 小时
注册时间
2013-1-16
帖子
5657

贵宾

2
发表于 2013-9-3 10:01:07 手机端发表。 | 只看该作者
直接用vx就好了啊,如果就这么一个要求的话

点评

已经完成30%了,VX用不惯  发表于 2013-9-3 10:08
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (版主)

梦石
20
星屑
1840
在线时间
6925 小时
注册时间
2012-12-14
帖子
11485

短篇十战斗者组别冠军开拓者贵宾短篇九勇士组亚军

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

  1249. class Window_Down < Window_Selectable
  1250.   #--------------------------------------------------------------------------
  1251.   # ● 初始化对像
  1252.   #--------------------------------------------------------------------------
  1253.   def initialize
  1254.     super(0, 240, 330, 240)
  1255.     @column_max = 1
  1256.     self.opacity = 0
  1257.     if $a != nil and $a.size < 21
  1258.       self.index = $a.size/2
  1259.       elsif $a != nil and $a.size > 20
  1260.       self.index = 9
  1261.     end  
  1262.     refresh
  1263.     self.active = false
  1264.   end
  1265.   #--------------------------------------------------------------------------
  1266.   # ● 刷新
  1267.   #--------------------------------------------------------------------------
  1268.   def refresh
  1269.     if self.contents != nil
  1270.       self.contents.dispose
  1271.       self.contents = nil
  1272.     end
  1273.     if $a != nil and $a.size < Blue::Blue_max + 1
  1274.       @item_max = $a.size
  1275.       elsif $a != nil and $a.size > Blue::Blue_max
  1276.       @item_max = Blue::Blue_max
  1277.     end  
  1278.     if @item_max > 0
  1279.       self.contents = Bitmap.new(width - 32, row_max * 16)
  1280.       for i in 0...@item_max
  1281.          draw_item(i)
  1282.       end
  1283.     end
  1284.   end
  1285.   def item_max
  1286.     return @item_max
  1287.   end  
  1288.   #--------------------------------------------------------------------------
  1289.   # ● 描绘项目
  1290.   #     index : 项目编号
  1291.   #--------------------------------------------------------------------------
  1292.   def draw_item(index)
  1293.     if $a.size < Blue::Blue_max + 1
  1294.      item = $a[index]
  1295.      else
  1296.      item = $a[index + $a.size - Blue::Blue_max]
  1297.     end
  1298.     x = 0
  1299.     y = index * 16
  1300.     self.contents.font.size = 14
  1301.     self.contents.font.color = Color.new(-170,-170,-170,255)
  1302.     self.contents.draw_text(x + 6, y + 1, self.contents.text_size(item).width, 16, item, 0)
  1303.     self.contents.font.color = normal_color
  1304.     self.contents.draw_text(x + 5, y, self.contents.text_size(item).width, 16, item, 0)
  1305.   end
  1306.   #--------------------------------------
  1307.   #  ● 刷新光标
  1308.   #--------------------------------------
  1309.   def update_cursor_rect
  1310.     # 光标位置不满 0 的情况下
  1311.     if @index < 0
  1312.       self.cursor_rect.empty
  1313.       return
  1314.     end
  1315.     # 获取当前的行
  1316.     row = @index / @column_max
  1317.     # 当前行被显示开头行前面的情况下
  1318.     if row < self.top_row
  1319.       # 从当前行向开头行滚动
  1320.       self.top_row = row
  1321.     end
  1322.     # 当前行被显示末尾行之后的情况下
  1323.     if row > self.top_row + (self.page_row_max - 1)
  1324.       # 从当前行向末尾滚动
  1325.       self.top_row = row - (self.page_row_max - 1)
  1326.     end
  1327.     # 计算光标的宽
  1328.     cursor_width = self.width / @column_max - 32
  1329.     cursor_width = 0
  1330.     # 计算光标坐标
  1331.     x = @index % @column_max * (cursor_width + 32)
  1332.     y = @index / @column_max * 32 - self.oy
  1333.     # 更新国标矩形
  1334.     self.cursor_rect.set(x, y, cursor_width, 16)
  1335.   end
  1336. end
复制代码
我只知道有这个脚本,不知道楼主合不合适

评分

参与人数 1星屑 +56 收起 理由
弗雷德 + 56 感谢回答。

查看全部评分

大家好,这里是晨露的说。请多多指教。
刚入门RM软件制作,请大家多多帮助我哦。
落雪君的欢乐像素教程,欢迎查阅。

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-29 20:29

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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