| 赞 | 0  | 
 
| VIP | 4 | 
 
| 好人卡 | 43 | 
 
| 积分 | 94 | 
 
| 经验 | 75226 | 
 
| 最后登录 | 2019-3-3 | 
 
| 在线时间 | 1131 小时 | 
 
 
 
 
 
Lv4.逐梦者 
	- 梦石
 - 3 
 
        - 星屑
 - 6420 
 
        - 在线时间
 - 1131 小时
 
        - 注册时间
 - 2007-12-26
 
        - 帖子
 - 2402
 
 
 
 | 
	
 本帖最后由 幻耶 于 2012-4-1 06:57 编辑  
 
按照标记改以下地方,前一半在Game_Battler3,后一半在Scene_Battle4。 
假设19号是反射状态。要反弹特技的话,在Game_Battler3 的应用特技效果里添加前一半在相应位置,只是把attacker改成user即可 
 
Game_Battler3下 
 #######################################(这部分添加在class这行下面) 
  attr_accessor :reflect 
  ####################################### 
 
  #-------------------------------------------------------------------------- 
  # ● 应用通常攻击效果 
  #     attacker : 攻击者 (battler) 
  #-------------------------------------------------------------------------- 
  def attack_effect(attacker) 
     
    ######################################### 
    self.reflect = false 
    ######################################### 
     
    # 清除会心一击标志 
    self.critical = false 
    # 第一命中判定 
    hit_result = (rand(100) < attacker.hit) 
    # 命中的情况下 
    if hit_result == true 
      # 计算基本伤害 
      atk = [attacker.atk - self.pdef / 2, 0].max 
      self.damage = atk * (20 + attacker.str) / 20 
      # 属性修正 
      self.damage *= elements_correct(attacker.element_set) 
      self.damage /= 100 
      # 伤害符号正确的情况下 
      if self.damage > 0 
        # 会心一击修正 
        if rand(100) < 4 * attacker.dex / self.agi 
          self.damage *= 2 
          self.critical = true 
        end 
        # 防御修正 
        if self.guarding? 
          self.damage /= 2 
        end 
      end 
      # 分散 
      if self.damage.abs > 0 
        amp = [self.damage.abs * 15 / 100, 1].max 
        self.damage += rand(amp+1) + rand(amp+1) - amp 
      end 
      # 第二命中判定 
      eva = 8 * self.agi / attacker.dex + self.eva 
      hit = self.damage < 0 ? 100 : 100 - eva 
      hit = self.cant_evade? ? 100 : hit 
      hit_result = (rand(100) < hit) 
    end 
    # 命中的情况下 
    if hit_result == true 
      # 状态冲击解除 
      remove_states_shock 
       
             ################################### 
          if self.states.include?(19) 
            self.reflect = true 
            attacker.damage = self.damage 
            attacker.hp -= attacker.damage 
            self.damage = 0 
            return true 
           else 
             # HP 的伤害计算 
             self.hp -= self.damage 
          end 
          ################################### 
 
 
 
 
 
 
Scene_Battle4 下 
  #-------------------------------------------------------------------------- 
  # ● 刷新画面 (主回合步骤 4 : 对像方动画) 
  #-------------------------------------------------------------------------- 
  def update_phase4_step4 
    # 对像方动画 
    for target in @target_battlers 
       
      ############################################ 
      if target.reflect != true 
      target.animation_id = @animation2_id  
      target.animation_hit = (target.damage != "Miss") 
      else 
      @active_battler.animation_id = @animation2_id 
      @active_battler.animation_hit = true 
      end 
      ############################################ 
 
    end 
    # 限制动画长度、最低 8 帧 
    @wait_count = 8 
    # 移至步骤 5 
    @phase4_step = 5 
  end 
  #-------------------------------------------------------------------------- 
  # ● 刷新画面 (主回合步骤 5 : 显示伤害) 
  #-------------------------------------------------------------------------- 
  def update_phase4_step5 
     
    ##################################### 
    @active_battler.damage_pop = true if @active_battler.damage != nil 
    ##################################### 
 
     
    # 隐藏帮助窗口 
    @help_window.visible = false 
    # 刷新状态窗口 
    @status_window.refresh 
    # 显示伤害 
    for target in @target_battlers 
      if target.damage != nil 
        target.damage_pop = true 
      end 
    end 
    # 移至步骤 6 
    @phase4_step = 6 
  end |   
 
 
 
 |