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

Project1

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

[已经解决] 想請問VA能不能做到異常狀態一次只解除一層

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1013
在线时间
104 小时
注册时间
2016-6-24
帖子
45
跳转到指定楼层
1
发表于 2021-11-17 20:21:10 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式

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

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

x
class Game_Battler

  STATE_UPGRADE = {
    97 => [97, 98, 99, 100, 101],        # 11、12、13号状态为三个等级。通过添加10号状态来叠加升级。

    205 => [205, 206, 207, 208, 209],        
    566 => [566, 567, 568, 569, 570],        

  }

  alias as_20141212 add_state
  def add_state(id)
    levels = STATE_UPGRADE[id]
    return as_20141212(id) unless levels
    index = levels.index { |state| state?(state) } # 当前等级
    return as_20141212(id) unless index
    return if index == levels.size - 1   # 已经达到最高等级
    remove_state levels[index]
    as_20141212 levels[index + 1]
  end

end



各位大大大家好,小弟之前使用了這款腳本
讓燒傷這個異常狀態可以最多疊五層

但是我不希望讓玩家使用治癒魔法一次就將五層給解除掉
而是使用一次治癒解除一層

不知道有沒有什麼好方法能夠辦到呢?

Lv3.寻梦者

梦石
0
星屑
1013
在线时间
104 小时
注册时间
2016-6-24
帖子
45
2
 楼主| 发表于 2021-11-17 21:46:33 | 显示全部楼层
  alias as_20141212 add_state
  def add_state(id)
    levels = STATE_UPGRADE[id]
    return as_20141212(id) unless levels
    index = levels.index { |state| state?(state) } # 当前等级
    return as_20141212(id) unless index
    return if index == levels.size - 1   # 已经达到最高等级
    remove_state levels[index]
    as_20141212 levels[index + 1]
  end
  alias rs_20211117 remove_state
  def remove_state(state_id)
    for i in STATE_UPGRADE
      levels = i[1] if i[1].include?(state_id)
    end
    return rs_20211117(state_id) unless levels
    index = levels.index { |state| state?(state) }
    return rs_20211117(state_id) unless index
    rs_20211117(levels[index])
    return if index == 0
    add_state(levels[index - 1])
  end
end


附加狀態是疊層數 那解除狀態應該是減層數...是我哪裡寫錯了嗎
解除層數沒有把狀態減少一層

点评

可以做到了 謝謝大大的協助  发表于 2021-11-18 14:18
2L改了一下, 要是不行那我也没辙了,,,  发表于 2021-11-18 09:35
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-6 14:03

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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