Project1
标题: 某职业脚本的问题 [打印本页]
作者: BQICEX 时间: 2011-3-6 18:19
标题: 某职业脚本的问题
本帖最后由 BQICEX 于 2011-3-6 18:22 编辑
就是下面这段脚本,在变更职业时会出现NoMethodError,找不到parameters。不过当角色变更成已加入队伍的角色的职业时就会没问题。请求修复方法。本人是脚本盲...- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # * 获取初始HP上限值资讯
- #--------------------------------------------------------------------------
- def base_maxhp
- return $data_actors[self.class.id].parameters[0, @level]
- end
- #--------------------------------------------------------------------------
- # * 获取初始MP上限值资讯
- #--------------------------------------------------------------------------
- def base_maxmp
- return $data_actors[self.class.id].parameters[1, @level]
- end
- #--------------------------------------------------------------------------
- # * 获取初始攻击力资讯
- #--------------------------------------------------------------------------
- def base_atk
- n = $data_actors[self.class.id].parameters[2, @level]
- for item in equips.compact do n += item.atk end
- return n
- end
- #--------------------------------------------------------------------------
- # * 获取初始防御力资讯
- #--------------------------------------------------------------------------
- def base_def
- n = $data_actors[self.class.id].parameters[3, @level]
- for item in equips.compact do n += item.def end
- return n
- end
- #--------------------------------------------------------------------------
- # * 获取初始精神意志力资讯
- #--------------------------------------------------------------------------
- def base_spi
- n = $data_actors[self.class.id].parameters[4, @level]
- for item in equips.compact do n += item.spi end
- return n
- end
- #--------------------------------------------------------------------------
- # * 获取初始机敏性资讯
- #--------------------------------------------------------------------------
- def base_agi
- n = $data_actors[self.class.id].parameters[5, @level]
- for item in equips.compact do n += item.agi end
- return n
- end
- end
复制代码