Project1

标题: 撤退成功率问题。 [打印本页]

作者: 白魔导师宝儿    时间: 2014-3-12 13:20
标题: 撤退成功率问题。
请问如果队伍中有1号角色的话,撤退成功为80%
如果队伍没有没有1号角色的话,再按默认的成功率计算
请问要怎么做
作者: 彭格列第XI代    时间: 2014-3-12 17:57
在撤退判断的代码那加入判断,判断1号角色是否在队伍中
作者: 正太君    时间: 2014-3-12 20:51
  1.   #--------------------------------------------------------------------------
  2.   # ● 逃跑处理
  3.   #--------------------------------------------------------------------------
  4.   def process_escape
  5.     @info_viewport.visible = false
  6.     @message_window.visible = true
  7.     text = sprintf(Vocab::EscapeStart, $game_party.name)
  8.     $game_message.texts.push(text)
  9.     if $game_troop.preemptive
  10.       success = true
  11.     else
  12.       success = (rand(100) < @escape_ratio)
  13.       # 加下面一句就行了
  14.       success = (rand(100) < 80) if $game_party.members.include?($game_actors[1])
  15.     end
  16.     Sound.play_escape
  17.     if success
  18.       wait_for_message
  19.       battle_end(1)
  20.     else
  21.       @escape_ratio += 10
  22.       $game_message.texts.push('\.' + Vocab::EscapeFailure)
  23.       wait_for_message
  24.       $game_party.clear_actions
  25.       start_main
  26.     end
  27.   end
复制代码

作者: 白魔导师宝儿    时间: 2014-3-14 12:48
正太君 发表于 2014-3-12 20:51

多谢测试可行{:7_305:}




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1