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

Project1

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

[已经解决] 整合物品颜色和物品分类两个剧本

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
帖子
1516
1
发表于 2015-10-25 17:42:52 | 显示全部楼层
本帖最后由 汪汪 于 2015-10-25 18:02 编辑

#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
#
# 脚本功能:给不同物品显示不同颜色,类似暗黑破坏神,比如套装为绿色,超级为金色
#           可以更改的种类包括物品、防具、特技、武器。
#
# 使用方法:对于不想为白色表示的物品,在描述中最后添加@6,@4一类的即可。
#           数字为颜色编号,和对话框中的一样。
# ——————————————————————————————————————

  class Skill
    def description
      description = @description.split(/@/)[0]
      return description != nil ? description : ''
    end
    def name_color_66RPG
      name_color = @description.split(/@/)[1]
      return name_color != nil ? name_color.to_i : 0
    end
  end
  class Weapon
    def description
      description = @description.split(/@/)[0]
      return description != nil ? description : ''
    end
    def name_color_66RPG
      name_color = @description.split(/@/)[1]
      return name_color != nil ? name_color.to_i : 0
    end
  end
  class Item
    def description
      description = @description.split(/@/)[0]
      return description != nil ? description : ''
    end
    def name_color_66RPG
      name_color = @description.split(/@/)[1]
      return name_color != nil ? name_color.to_i : 0
    end
  end
  class Armor
    def description
      description = @description.split(/@/)[0]
      return description != nil ? description : ''
    end
    def name_color_66RPG
      name_color = @description.split(/@/)[1]
      return name != nil ? name_color.to_i : 0
    end
  end
end


把这里面的  split(/@/)[1]  中的[1]改成[2],然后先写上面那个脚本的,再加这个脚本的.

评分

参与人数 1星屑 +90 收起 理由
RyanBern + 90 塞糖

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-5 22:32

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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