幻想森林

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1318|回复: 0

防禦SP回復

[复制链接]

27

主题

94

帖子

854

积分

⑤进阶

积分
854
发表于 2005-10-7 19:40:23 | 显示全部楼层 |阅读模式
防禦單是傷害減半好像沒什麼用,
這次就將防禦時增加回復SP3%吧!

在Class Battle_Scene的method make_basic_result加上一句。



#--------------------------------------------------------------------------
  # ● 生成基本行動結果
  #--------------------------------------------------------------------------
  def make_basic_action_result
    # 攻擊的情況下
    if @active_battler.current_action.basic == 0
      # 設置攻擊 ID
      @animation1_id = @active_battler.animation1_id
      @animation2_id = @active_battler.animation2_id
      # 行動方的戰鬥者是敵人的情況下
      if @active_battler.is_a?(Game_Enemy)
        if @active_battler.restriction == 3
          target = $game_troop.random_target_enemy
        elsif @active_battler.restriction == 2
          target = $game_party.random_target_actor
        else
          index = @active_battler.current_action.target_index
          target = $game_party.smooth_target_actor(index)
        end
      end
      # 行動方的戰鬥者是角色的情況下
      if @active_battler.is_a?(Game_Actor)
        if @active_battler.restriction == 3
          target = $game_party.random_target_actor
        elsif @active_battler.restriction == 2
          target = $game_troop.random_target_enemy
        else
          index = @active_battler.current_action.target_index
          target = $game_troop.smooth_target_enemy(index)
        end
      end
      # 設置對像方的戰鬥者序列
      @target_battlers = [target]
      # 應用通常攻擊效果
      for target in @target_battlers
        target.attack_effect(@active_battler)
      end
      return
    end
    # 防禦的情況下
    if @active_battler.current_action.basic == 1
      # 幫助窗口顯示"防禦"
      @help_window.set_text($data_system.words.guard, 1)
      @active_battler.sp  += (@active_battler.maxsp *3/100 ).to_i    #計算回復SP
      @active_battler.sp = [@active_battler.sp , @active_battler.maxsp].min
      return
    end
    # 逃跑的情況下
    if @active_battler.is_a?(Game_Enemy) and
       @active_battler.current_action.basic == 2
      #  幫助窗口顯示"逃跑"
      @help_window.set_text("逃跑", 1)
      # 逃跑
      @active_battler.escape
      return
    end
    # 什麼也不做的情況下
    if @active_battler.current_action.basic == 3
      # 清除強製行動對像的戰鬥者
      $game_temp.forcing_battler = nil
      # 移至步驟 1
      @phase4_step = 1
      return
    end
  end


只要改一改算式就可以更改回復SP的量。
回復HP也是差不多,自己試試吧!


歡迎到天空工作室討論及參考更多教學文章
http://skystudio.no-ip.com
天空工作室 http://skystudio.no-ip.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|幻想森林

GMT+8, 2025-6-24 10:54 , Processed in 0.014900 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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