Project1

标题: 求助,关于物品分类和物品颜色 [打印本页]

作者: 旋涡    时间: 2014-5-1 20:59
标题: 求助,关于物品分类和物品颜色
为什么使用了物品分类的脚本,用数据库改物品颜色的脚本就用不了了?只能在装备上显示颜色?
大神求助~
作者: 奇奇​    时间: 2014-5-1 23:51
你觉得什么脚本也不提供,就凭一句描述,能有大神帮助得了你吗?难道还要大神们费尽周折去搜索【物品分类】和【用数据库改物品颜色的脚本】吗?
作者: 鱼剑浆糊    时间: 2014-5-4 19:09
你是不是用了[复杂物品分类脚本]和[数据库显示颜色脚本]? 这两个脚本默认都是在说明后面加上@XX的。。。。在脚本里把@换成其他的文字就好

RUBY 代码复制
  1. module RPG
  2.   class Skill
  3.     def description
  4.       description = @description.split(/@/)[0]
  5.       return description != nil ? description : ''
  6.     end
  7.     def name_color_66RPG
  8.       name_color = @description.split(/@/)[1]
  9.       return name_color != nil ? name_color.to_i : 0
  10.     end
  11.   end


比如把颜色代码里的@换成品质

RUBY 代码复制
  1. module RPG
  2.   class Skill
  3.     def description
  4.       description = @description.split(/品质/)[0]
  5.       return description != nil ? description : ''
  6.     end
  7.     def name_color_66RPG
  8.       name_color = @description.split(/品质/)[1]
  9.       return name_color != nil ? name_color.to_i : 0
  10.     end
  11.   end


然后在数据库里设置时就改成 品质1 @药品

游戏里就会显示数字1对应颜色,分类为药品的物品




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1