设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1975|回复: 1
打印 上一主题 下一主题

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

[复制链接]

Lv3.寻梦者

梦石
0
星屑
3181
在线时间
1863 小时
注册时间
2010-6-19
帖子
1205
跳转到指定楼层
1
发表于 2022-9-9 23:10:12 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

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




RUBY 代码复制
  1. =begin
  2. ================================================================================
  3.  ● 法术多秒系统介绍 BY-Kaiser.DS
  4. ================================================================================
  5. 『介绍』
  6.     ☆模拟网游[梦幻西游]的多秒系统,秒的其他对象采用速度判定,并且作用己方多秒
  7.   的时候,附加状态判定,即有该魔法附加的状态,秒的其他对象将变成没有该状态的角
  8.   色。
  9.     
  10. =end   
  11.  
  12. class Scene_Battle
  13. def tg_xiuzheng(s)
  14.     for kds_dui in  $data_skills[@active_battler.current_action.skill_id].plus_state_set
  15.       if $game_party.smooth_target_actor(s).states.include?(kds_dui)
  16.          return true
  17.       end
  18.     end
  19.    return false
  20. end
  21. def tg_xiuzheng2(s)
  22.     for kds_dui in  $data_skills[@active_battler.current_action.skill_id].plus_state_set
  23.       if $game_troop.smooth_target_enemy(s).states.include?(kds_dui)
  24.          return true
  25.       end
  26.     end
  27.    return false
  28. end
  29. def dr_ac
  30.        index = @active_battler.current_action.target_index
  31.         $miao = 1
  32.        if @active_battler.current_action.kind == 1
  33.          @skill = $data_skills[@active_battler.current_action.skill_id]
  34.         if $data_skills[@skill.id].kds_miao > 1
  35.         @sudu = []
  36.         @guang = []
  37.         for s in 0..$game_party.actors.size-1
  38.           if $game_party.actors[s].hp != 0
  39.            @sudu.push($game_party.smooth_target_actor(s).agi)
  40.            @guang.push(s)
  41.           end
  42.         end
  43.         for a in 0..@sudu.size-1
  44.          for s in 0..@sudu.size-1
  45.           if s < @sudu.size-1 and @sudu[s] < @sudu[s+1]
  46.           elsif s < @sudu.size-1 and @sudu[s] > @sudu[s+1]
  47.            @abc = @sudu[s]
  48.            @sudu[s] = @sudu[s+1]
  49.            @sudu[s+1] = @abc
  50.            @bcd = @guang[s]
  51.            @guang[s] = @guang[s+1]
  52.            @guang[s+1] = @bcd
  53.           end
  54.          end
  55.         end
  56.         for s in 0..@sudu.size-1
  57.           if @guang[@sudu.size-1-s] == index
  58.           else
  59.             $miao += 1
  60.             @target_battlers.push($game_party.smooth_target_actor(@guang[@sudu.size-1 - s]))
  61.           end
  62.           if $miao == $data_skills[@skill.id].kds_miao
  63.            break
  64.           end
  65.         end
  66.         end
  67.       end
  68.     end
  69. def dr_dr
  70.       index = @active_battler.current_action.target_index
  71.         $miao = 1
  72.       if @active_battler.current_action.kind == 1
  73.          @skill = $data_skills[@active_battler.current_action.skill_id]
  74.         if $data_skills[@skill.id].kds_miao > 1
  75.         @sudu = []
  76.         @guang = []
  77.         for s in 0..$game_troop.enemies.size-1
  78.           if $game_troop.enemies[s].hp != 0 and @active_battler.current_action.kind == 1 and tg_xiuzheng2(s) == false
  79.            @sudu.push($game_troop.smooth_target_enemy(s).agi)
  80.            @guang.push(s)
  81.           end
  82.         end
  83.         for a in 0..@sudu.size-1
  84.          for s in 0..@sudu.size-1
  85.           if s < @sudu.size-1 and @sudu[s] < @sudu[s+1]
  86.           elsif s < @sudu.size-1 and @sudu[s] > @sudu[s+1]
  87.            @abc = @sudu[s]
  88.            @sudu[s] = @sudu[s+1]
  89.            @sudu[s+1] = @abc
  90.            @bcd = @guang[s]
  91.            @guang[s] = @guang[s+1]
  92.            @guang[s+1] = @bcd
  93.           end
  94.          end
  95.         end
  96.         for s in 0..@sudu.size-1
  97.           if @guang[@sudu.size-1-s] == index
  98.           else
  99.             $miao += 1
  100.             @target_battlers.push($game_troop.smooth_target_enemy(@guang[@sudu.size-1 - s]))
  101.           end
  102.           if $miao == $data_skills[@skill.id].kds_miao
  103.            break
  104.           end
  105.         end
  106.         end
  107.        end
  108.     end
  109. def ac_dr
  110.       index = @active_battler.current_action.target_index
  111.       if @active_battler.current_action.kind == 1
  112.         @skill = $data_skills[@active_battler.current_action.skill_id]
  113.         $miao = 1
  114.         if $data_skills[@skill.id].kds_miao > 1
  115.         @sudu = []
  116.         @guang = []
  117.         for s in 0..$game_troop.enemies.size-1
  118.           if $game_troop.enemies[s].hp != 0
  119.            @sudu.push($game_troop.smooth_target_enemy(s).agi)
  120.            @guang.push(s)
  121.           end
  122.         end
  123.         for a in 0..@sudu.size-1
  124.          for s in 0..@sudu.size-1
  125.           if s < @sudu.size-1 and @sudu[s] < @sudu[s+1]
  126.           elsif s < @sudu.size-1 and @sudu[s] > @sudu[s+1]
  127.            @abc = @sudu[s]
  128.            @sudu[s] = @sudu[s+1]
  129.            @sudu[s+1] = @abc
  130.            @bcd = @guang[s]
  131.            @guang[s] = @guang[s+1]
  132.            @guang[s+1] = @bcd
  133.           end
  134.          end
  135.         end
  136.         for s in 0..@sudu.size-1
  137.           if @guang[@sudu.size-1-s] == index
  138.           else
  139.             $miao += 1
  140.             @target_battlers.push($game_troop.smooth_target_enemy(@guang[@sudu.size-1 - s]))
  141.           end
  142.           if $miao == $data_skills[@skill.id].kds_miao
  143.            break
  144.           end
  145.         end
  146.         end
  147.        end
  148.     end
  149. def ac_ac
  150.       index = @active_battler.current_action.target_index
  151.       if @active_battler.current_action.kind == 1
  152.         @skill = $data_skills[@active_battler.current_action.skill_id]
  153.         $miao = 1
  154.         if $data_skills[@skill.id].kds_miao > 1
  155.         @sudu = []
  156.         @guang = []
  157.         for s in 0..$game_party.actors.size-1
  158.           if $game_party.actors[s].hp != 0 and @active_battler.current_action.kind == 1 and tg_xiuzheng(s) == false
  159.            @sudu.push($game_party.smooth_target_actor(s).agi)
  160.            @guang.push(s)
  161.           end
  162.         end
  163.         for a in 0..@sudu.size-1
  164.          for s in 0..@sudu.size-1
  165.           if s < @sudu.size-1 and @sudu[s] < @sudu[s+1]
  166.           elsif s < @sudu.size-1 and @sudu[s] > @sudu[s+1]
  167.            @abc = @sudu[s]
  168.            @sudu[s] = @sudu[s+1]
  169.            @sudu[s+1] = @abc
  170.            @bcd = @guang[s]
  171.            @guang[s] = @guang[s+1]
  172.            @guang[s+1] = @bcd
  173.           end
  174.          end
  175.         end
  176.         for s in 0..@sudu.size-1
  177.           if @guang[@sudu.size-1-s] == index
  178.           else
  179.             $miao += 1
  180.             @target_battlers.push($game_party.smooth_target_actor(@guang[@sudu.size-1 - s]))
  181.           end
  182.           if $miao == $data_skills[@skill.id].kds_miao
  183.            break
  184.           end
  185.         end
  186.       end
  187.     end
  188. end
  189. end

Lv3.寻梦者

梦石
0
星屑
3181
在线时间
1863 小时
注册时间
2010-6-19
帖子
1205
2
 楼主| 发表于 2022-9-11 15:21:41 | 只看该作者
自行解决了
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-27 11:49

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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