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

Project1

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

[已经解决] 找到的装备限制等级脚本~求救

[复制链接]
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2010-7-1
帖子
14
跳转到指定楼层
1
发表于 2010-7-1 14:39:51 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽

Lv1.梦旅人

梦石
0
星屑
50
在线时间
111 小时
注册时间
2010-6-26
帖子
80
2
发表于 2010-7-1 15:21:19 | 只看该作者
:(
我把完整版的脚本发给楼主吧

module RPG
class Weapon
    def level
     return 1 if @description.split(/LV/)[1] == nil
     return @description.split(/LV/)[1]
   end
   def str
     return 1 if @description.split(/STR/)[1] == nil
     return @description.split(/STR/)[1]
   end
   def dex
     return 1 if @description.split(/DEX/)[1] == nil
     return @description.split(/DEX/)[1]
   end
   def agi
     return 1 if @description.split(/AGI/)[1] == nil
     return @description.split(/AGI/)[1]
   end
   def int
     return 1 if @description.split(/INT/)[1] == nil
     return @description.split(/INT/)[1]
   end
#    def description      
#      return @description.split(/LV/)[0] + "{装备等级" + level + "}"
#    end
end
class Armor
    def level
     return 1 if @description.split(/LV/)[1] == nil
     return @description.split(/LV/)[1]
   end
   def str
     return 1 if @description.split(/STR/)[1] == nil
     return @description.split(/STR/)[1]
   end
   def dex
     return 1 if @description.split(/DEX/)[1] == nil
     return @description.split(/DEX/)[1]
   end
   def agi
     return 1 if @description.split(/AGI/)[1] == nil
     return @description.split(/AGI/)[1]
   end
   def int
     return 1 if @description.split(/INT/)[1] == nil
     return @description.split(/INT/)[1]
   end
#    def description      
#      return @description.split(/LV/)[0] + "{装备等级" + level + "}"
#    end
end
end

class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● 可以装备判定
#     item : 物品
#--------------------------------------------------------------------------
def equipable?(item)
   # 武器的情况
   if item.is_a?(RPG::Weapon)
     # 包含当前的职业可以装备武器的场合
     if $data_classes[@class_id].weapon_set.include?(item.id) and item.level.to_i<=@level
       if item.str.to_i<= str and item.dex.to_i<= dex and item.agi.to_i<= agi and item.int.to_i<= int
       return true
       end
     end
   end
   # 防具的情况
   if item.is_a?(RPG::Armor)
     # 不包含当前的职业可以装备武器的场合
     if $data_classes[@class_id].armor_set.include?(item.id) and item.level.to_i<=@level
       if item.str.to_i<= str and item.dex.to_i<= dex and item.agi.to_i<= agi and item.int.to_i<= int
       return true
       end
     end
   end
   return false
end
end
#==============================================================================
# ■ Window_EquipItem
#------------------------------------------------------------------------------
#  装备画面、显示浏览变更装备的候补物品的窗口。
#==============================================================================

class Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # 添加可以装备的武器
    if @equip_type == 0
      weapon_set = $data_classes[@actor.class_id].weapon_set
      for i in 1...$data_weapons.size
        if $game_party.weapon_number(i) > 0 and weapon_set.include?(i) and @actor.equipable?($data_weapons[i])
          @data.push($data_weapons[i])
        end
      end
    end
    # 添加可以装备的防具
    if @equip_type != 0
      armor_set = $data_classes[@actor.class_id].armor_set
      for i in 1...$data_armors.size
        if $game_party.armor_number(i) > 0 and armor_set.include?(i) and @actor.equipable?($data_armors[i])
          if $data_armors[i].kind == @equip_type-1
            @data.push($data_armors[i])
          end
        end
      end
    end
    # 添加空白
    @data.push(nil)
    # 生成位图、描绘全部项目
    @item_max = @data.size
    self.contents = Bitmap.new(width - 32, row_max * 32)
    for i in 0...@item_max-1
      draw_item(i)
    end
end
end

使用方法:
在数据库中设置,比如
我的游戏里面的
寒冥紫霜枪:用上等寒冥石铸成的宝枪!世间难得一见.攻击力+196武力+30凝神+16.适用等级:Lv34
就是在描述最后添加"Lv"字样,后面加上等级。
你可以像我一样弄成“适用等级:”这样子的。:D

点评

谢啦.我现在搞懂了  发表于 2010-7-1 15:59
楼主用的似乎和你不是同一个脚本……|||||  发表于 2010-7-1 15:26

评分

参与人数 1星屑 +200 收起 理由
「旅」 + 200 正确解答~

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
77 小时
注册时间
2007-1-6
帖子
304

短篇八橙光组季军

3
发表于 2010-7-1 15:22:34 | 只看该作者
本帖最后由 burst_TNT 于 2010-7-1 15:25 编辑

在数据库里设定装备的时候,装备描述后面加W再加等级,如铜盔的描述【铜制的头盔。W10】,即代表10级以上才能装备铜盔。

评分

参与人数 1星屑 +200 收起 理由
「旅」 + 200 正确解答~

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
111 小时
注册时间
2010-6-26
帖子
80
4
发表于 2010-7-1 15:22:47 | 只看该作者
寒冥紫霜枪:用上等寒冥石铸成的宝枪!世间难得一见.攻击力+196武力+30凝神+16.适用等级
:   Lv34
就是在描述最后添加"Lv"字样,后面加上等级。
你可以像我一样弄成“适用等级:”这样子的。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
111 小时
注册时间
2010-6-26
帖子
80
5
发表于 2010-7-1 15:23:05 | 只看该作者
寒冥紫霜枪:用上等寒冥石铸成的宝枪!世间难得一见.攻击力+196武力+30凝神+16.适用等级
:   Lv34
就是在描述最后添加"Lv"字样,后面加上等级。
你可以像我一样弄成“适用等级:”这样子的。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
111 小时
注册时间
2010-6-26
帖子
80
6
发表于 2010-7-1 15:25:05 | 只看该作者
回复 burst_TNT 的帖子
:P

楼主看看这位兄台能否解决你的问题哈

   
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-21 05:48

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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