查看: 2974|回复: 2

[已经解决] 如何做出先制技能

[复制链接]
梦石
0
星屑
4017
在线时间
604 小时
注册时间
2017-4-21
回帖
177
发表于 2018-4-15 21:44:43 | 显示全部楼层 |阅读模式

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

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

×
如题
楼主大概有10几个技能想加入先制攻击效果
在论坛搜索一番,能用的好像只有

  def make_action_speed
    ####先发技能
    if(@current_action.kind == 1)##
      skill = $data_skills[@current_action.skill_id]
      if((skill.element_set).include?(($data_system.elements).index("绝对先发")))
        @current_action.speed = 9999
        return
      end
      if((skill.element_set).include?(($data_system.elements).index("绝对后发")))
        @current_action.speed = -9999
        return
      end
    end
    ####先发技能end
    @current_action.speed = agi + rand(agi/10)###rand(10 + agi / 4)
  end

在  # ● 确定动作速度  加入了上面脚本,奈何试不出使用方法
所以来求教了
梦石
0
星屑
4017
在线时间
604 小时
注册时间
2017-4-21
回帖
177
 楼主| 发表于 2018-4-15 22:00:34 | 显示全部楼层
本帖最后由 阮声悠悠 于 2018-4-16 00:23 编辑

另外,还找到了状态决定先制攻击的脚本
  1. #==============================================================================
  2. class Game_Battler
  3.   INITE_ID = [17,18,19]  #<=  先出手的状态ID。
  4.   #--------------------------------------------------------------------------
  5.   # ● 确定动作速度
  6.   #--------------------------------------------------------------------------
  7.   def make_action_speed
  8.     judeg = false
  9.     INITE_ID.each{|i| judeg = true if state?(i)}
  10.     @current_action.speed = agi + rand(10 + agi / 4) + (judeg ? 1000000 : 0)
  11.   end
  12. end
  13. #==============================================================================
复制代码


但我希望改成技能id来决定先制效果
所以
  1.   SKILL_ID = [23,24,25]  #<=  先出手的状态ID。
  2.   def make_action_speed
  3.     ####先发技能、先制攻击
  4.     judeg = false
  5.     SKILL_ID.each{|i| judeg = true if skill.id(i)}
  6.     @current_action.speed = agi+ (judeg ? 1000000 : 0)
  7.   end
复制代码

然后失败了!!!!!!

没有办法对点评做出回复,总之按照大大的改法亲测成功了
这里也放出代码,替换游戏def make_action_speed里面的脚本就可以了
[pre lang="ruby"]  def make_action_speed
    xzgj = [23,24,25]  #<=先发技能、先制攻击的技能id
    judeg = false
    xzgj.each{|i| judeg = true  if @current_action.skill_id == i && @current_action.kind == 1}
    @current_action.speed = agi+ (judeg ? 1000000 : 0)
  end[/pre]

点评

把skill那里改成 if @current_action.skill_id == i && @current_action.kind == 1  发表于 2018-4-16 00:05
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部