查看: 2586|回复: 1

[已经解决] 法术多秒判定

[复制链接]
梦石
0
星屑
3850
在线时间
1899 小时
注册时间
2010-6-19
回帖
917
发表于 2022-9-9 23:10:12 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
找了个法术多秒系统,介绍说 秒的其他对象采用速度判定,并且作用己方多秒
  的时候,附加状态判定,即有该魔法附加的状态,秒的其他对象将变成没有该状态的角
  色。,但是发现个Bug,敌人没像角色那样有附加状态判定,导致比如对敌人用了法术,然后敌人身上
被附加了状态,下次再使用该法术的时候,还是优先以速度为判断,如何改成和角色一样,敌人身上有状态了就秒到没状态的敌人身上




  1. =begin
  2. ================================================================================
  3. ● 法术多秒系统介绍 BY-Kaiser.DS
  4. ================================================================================
  5. 『介绍』
  6.     ☆模拟网游[梦幻西游]的多秒系统,秒的其他对象采用速度判定,并且作用己方多秒
  7.   的时候,附加状态判定,即有该魔法附加的状态,秒的其他对象将变成没有该状态的角
  8.   色。
  9.    
  10. =end   

  11. class Scene_Battle
  12. def tg_xiuzheng(s)
  13.     for kds_dui in  $data_skills[@active_battler.current_action.skill_id].plus_state_set
  14.       if $game_party.smooth_target_actor(s).states.include?(kds_dui)
  15.          return true
  16.       end
  17.     end
  18.    return false
  19. end
  20. def tg_xiuzheng2(s)
  21.     for kds_dui in  $data_skills[@active_battler.current_action.skill_id].plus_state_set
  22.       if $game_troop.smooth_target_enemy(s).states.include?(kds_dui)
  23.          return true
  24.       end
  25.     end
  26.    return false
  27. end
  28. def dr_ac
  29.        index = @active_battler.current_action.target_index
  30.         $miao = 1
  31.        if @active_battler.current_action.kind == 1
  32.          @skill = $data_skills[@active_battler.current_action.skill_id]
  33.         if $data_skills[@skill.id].kds_miao > 1
  34.         @sudu = []
  35.         @guang = []
  36.         for s in 0..$game_party.actors.size-1
  37.           if $game_party.actors[s].hp != 0
  38.            @sudu.push($game_party.smooth_target_actor(s).agi)
  39.            @guang.push(s)
  40.           end
  41.         end
  42.         for a in 0..@sudu.size-1
  43.          for s in 0..@sudu.size-1
  44.           if s < @sudu.size-1 and @sudu[s] < @sudu[s+1]
  45.           elsif s < @sudu.size-1 and @sudu[s] > @sudu[s+1]
  46.            @abc = @sudu[s]
  47.            @sudu[s] = @sudu[s+1]
  48.            @sudu[s+1] = @abc
  49.            @bcd = @guang[s]
  50.            @guang[s] = @guang[s+1]
  51.            @guang[s+1] = @bcd
  52.           end
  53.          end
  54.         end
  55.         for s in 0..@sudu.size-1
  56.           if @guang[@sudu.size-1-s] == index
  57.           else
  58.             $miao += 1
  59.             @target_battlers.push($game_party.smooth_target_actor(@guang[@sudu.size-1 - s]))
  60.           end
  61.           if $miao == $data_skills[@skill.id].kds_miao
  62.            break
  63.           end
  64.         end
  65.         end
  66.       end
  67.     end
  68. def dr_dr
  69.       index = @active_battler.current_action.target_index
  70.         $miao = 1
  71.       if @active_battler.current_action.kind == 1
  72.          @skill = $data_skills[@active_battler.current_action.skill_id]
  73.         if $data_skills[@skill.id].kds_miao > 1
  74.         @sudu = []
  75.         @guang = []
  76.         for s in 0..$game_troop.enemies.size-1
  77.           if $game_troop.enemies[s].hp != 0 and @active_battler.current_action.kind == 1 and tg_xiuzheng2(s) == false
  78.            @sudu.push($game_troop.smooth_target_enemy(s).agi)
  79.            @guang.push(s)
  80.           end
  81.         end
  82.         for a in 0..@sudu.size-1
  83.          for s in 0..@sudu.size-1
  84.           if s < @sudu.size-1 and @sudu[s] < @sudu[s+1]
  85.           elsif s < @sudu.size-1 and @sudu[s] > @sudu[s+1]
  86.            @abc = @sudu[s]
  87.            @sudu[s] = @sudu[s+1]
  88.            @sudu[s+1] = @abc
  89.            @bcd = @guang[s]
  90.            @guang[s] = @guang[s+1]
  91.            @guang[s+1] = @bcd
  92.           end
  93.          end
  94.         end
  95.         for s in 0..@sudu.size-1
  96.           if @guang[@sudu.size-1-s] == index
  97.           else
  98.             $miao += 1
  99.             @target_battlers.push($game_troop.smooth_target_enemy(@guang[@sudu.size-1 - s]))
  100.           end
  101.           if $miao == $data_skills[@skill.id].kds_miao
  102.            break
  103.           end
  104.         end
  105.         end
  106.        end
  107.     end
  108. def ac_dr
  109.       index = @active_battler.current_action.target_index
  110.       if @active_battler.current_action.kind == 1
  111.         @skill = $data_skills[@active_battler.current_action.skill_id]
  112.         $miao = 1
  113.         if $data_skills[@skill.id].kds_miao > 1
  114.         @sudu = []
  115.         @guang = []
  116.         for s in 0..$game_troop.enemies.size-1
  117.           if $game_troop.enemies[s].hp != 0
  118.            @sudu.push($game_troop.smooth_target_enemy(s).agi)
  119.            @guang.push(s)
  120.           end
  121.         end
  122.         for a in 0..@sudu.size-1
  123.          for s in 0..@sudu.size-1
  124.           if s < @sudu.size-1 and @sudu[s] < @sudu[s+1]
  125.           elsif s < @sudu.size-1 and @sudu[s] > @sudu[s+1]
  126.            @abc = @sudu[s]
  127.            @sudu[s] = @sudu[s+1]
  128.            @sudu[s+1] = @abc
  129.            @bcd = @guang[s]
  130.            @guang[s] = @guang[s+1]
  131.            @guang[s+1] = @bcd
  132.           end
  133.          end
  134.         end
  135.         for s in 0..@sudu.size-1
  136.           if @guang[@sudu.size-1-s] == index
  137.           else
  138.             $miao += 1
  139.             @target_battlers.push($game_troop.smooth_target_enemy(@guang[@sudu.size-1 - s]))
  140.           end
  141.           if $miao == $data_skills[@skill.id].kds_miao
  142.            break
  143.           end
  144.         end
  145.         end
  146.        end
  147.     end
  148. def ac_ac
  149.       index = @active_battler.current_action.target_index
  150.       if @active_battler.current_action.kind == 1
  151.         @skill = $data_skills[@active_battler.current_action.skill_id]
  152.         $miao = 1
  153.         if $data_skills[@skill.id].kds_miao > 1
  154.         @sudu = []
  155.         @guang = []
  156.         for s in 0..$game_party.actors.size-1
  157.           if $game_party.actors[s].hp != 0 and @active_battler.current_action.kind == 1 and tg_xiuzheng(s) == false
  158.            @sudu.push($game_party.smooth_target_actor(s).agi)
  159.            @guang.push(s)
  160.           end
  161.         end
  162.         for a in 0..@sudu.size-1
  163.          for s in 0..@sudu.size-1
  164.           if s < @sudu.size-1 and @sudu[s] < @sudu[s+1]
  165.           elsif s < @sudu.size-1 and @sudu[s] > @sudu[s+1]
  166.            @abc = @sudu[s]
  167.            @sudu[s] = @sudu[s+1]
  168.            @sudu[s+1] = @abc
  169.            @bcd = @guang[s]
  170.            @guang[s] = @guang[s+1]
  171.            @guang[s+1] = @bcd
  172.           end
  173.          end
  174.         end
  175.         for s in 0..@sudu.size-1
  176.           if @guang[@sudu.size-1-s] == index
  177.           else
  178.             $miao += 1
  179.             @target_battlers.push($game_party.smooth_target_actor(@guang[@sudu.size-1 - s]))
  180.           end
  181.           if $miao == $data_skills[@skill.id].kds_miao
  182.            break
  183.           end
  184.         end
  185.       end
  186.     end
  187. end
  188. end
复制代码
梦石
0
星屑
3850
在线时间
1899 小时
注册时间
2010-6-19
回帖
917
 楼主| 发表于 2022-9-11 15:21:41 | 显示全部楼层
自行解决了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部