BlackFeather 发表于 2010-4-3 12:52:32

再发个脚本!

#战斗后定量恢复HP/MP
#收集,修改 BY 玄天
#原作者:日站。其版权由其原作者拥有,任何人不得非法使用。


#HP回復量(百分率)
HP_DAMAGE_POINT = 15

#SP回復量(百分率)
SP_DAMAGE_POINT = 15

#HP分散量 0为不散乱(100回復量、分散度15 = 85~115)
HP_DAMAGE_UNEVEN = 15

#SP分散量 0为不散乱(100回復量、分散度15 = 85~115)
SP_DAMAGE_UNEVEN = 15

#是否演示动画。false为不使用;true为使用
ANIMATION_POP = false

#动画号码,即资料库『动画』中的动画代码
ANIMATION_ID = 15

#损坏表示
DAMAGE_POP = false


#========================下面基本不用修改==============================


#==============================================================================
# ■ Game_Battler (分割定義 3)
#------------------------------------------------------------------------------
#  バトラーを扱うクラスです。このクラスは Game_Actor クラスと Game_Enemy クラ
# スのスーパークラスとして使用されます。
#==============================================================================

class Game_Battler
  #--------------------------------------------------------------------------
  # ● 戦闘後HP回復
  #--------------------------------------------------------------------------
  def hp_recover
    # SP回復量を設定
    self.damage = self.maxhp * SP_DAMAGE_POINT / 100
    if SP_DAMAGE_UNEVEN > 0
      amp = .max
      self.damage += rand(amp+1) + rand(amp+1) - amp
    end
    self.sp += self.damage
    # HP回復量を設定
    self.damage = self.maxhp * HP_DAMAGE_POINT / 100
    if HP_DAMAGE_UNEVEN > 0
      amp = .max
      self.damage += rand(amp+1) + rand(amp+1) - amp
    end
    self.damage = -self.damage
    # HP に回復量を加算
    self.hp -= self.damage
    # メソッド終了
    return
  end
end

#-------------------------------------------------------------------------------

#==============================================================================
# ■ Scene_Battle (分割定義 2)
#------------------------------------------------------------------------------
#  バトル画面の処理を行うクラスです。
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # ● アフターバトルフェーズ開始
  #--------------------------------------------------------------------------
  alias start_phase5_battler_recover start_phase5
  def start_phase5
    for i in 0...$game_party.actors.size
      actor = $game_party.actors
      next if actor.dead?
      actor.hp_recover
      if DAMAGE_POP
        actor.damage_pop = true
      end
      if ANIMATION_POP
        actor.animation_id = ANIMATION_ID
      end
    end
    # 元の処理を実行
    start_phase5_battler_recover
  end
end

反正不是我写的……懒得讲了
页: [1]
查看完整版本: 再发个脚本!