| 
 
| 赞 | 0 |  
| VIP | 4 |  
| 好人卡 | 43 |  
| 积分 | 94 |  
| 经验 | 75226 |  
| 最后登录 | 2019-3-3 |  
| 在线时间 | 1131 小时 |  
 Lv4.逐梦者 
	梦石3 星屑6420 在线时间1131 小时注册时间2007-12-26帖子2402 | 
| 想做一个普通攻击反弹的效果,比如攻击方击中20号状态的目标,伤害就反弹给对方随机一个成员。分别在Game_Battler 3 和 Scene_Battle 4 添加以下部分脚本,但是战斗测试时总是在一个队员成功反弹之后,下一个队员攻击就会命中敌人,也就是说敌人的反弹状态成功一次然后无效一次,以这样的规律交替(我设置的战斗角色是两个),求解决 
 Game_Battler 3 的● 应用通常攻击效果 下 if hit_result == true 下面添加(大约49行)
 Scene_Battle 4的● 生成基本行动结果 下红色字体是添加的部分复制代码      if self.state?(20) 
        $attack_return1 = true  #XXOO调用反弹的开关
      else
        $attack_return1 = false
      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
 if $attack_return1 == true
 target = $game_party.smooth_target_actor(rand(2))  #XXOO敌人反弹随机目标
 else
 target = $game_troop.smooth_target_enemy(index)
 end
 end
 end
 | 
 |