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

Project1

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

[已经解决] 怎样装备多个武器

[复制链接]

Lv1.梦旅人

梦石
0
星屑
136
在线时间
12 小时
注册时间
2018-12-30
帖子
10
跳转到指定楼层
1
发表于 2019-3-16 22:36:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
20星屑
比如武器一栏装备5,6个

Lv4.逐梦者

梦石
10
星屑
7052
在线时间
644 小时
注册时间
2017-1-9
帖子
584

我没有哭开拓者

2
发表于 2019-3-16 22:36:43 | 只看该作者
  1. #==============================================================================
  2. # +++ 装备栏风格扩展 +++
  3. #  by:VIPArcher [email: [email protected]]
  4. #  -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。
  5. #==============================================================================
  6. #  ■ 新增装备风格
  7. # 使用说明:在角色备注栏/职业备注栏里备注 <slot_type:x> 则角色变为x号装备风格,
  8. #   一个角色有多个风格同时存在时,最终返回风格编号x最大的那个风格。
  9. #   在防具上备注<etype_id:x>则把该防具设置为第x种类型,默认占用了0-4,追加的由5开始
  10. #   在任何有备注框的地方备注 <fix_equips:x> 固定该位置的装备,固定多个则换行再写
  11. #   在任何有备注框的地方备注 <seal_equips:x> 禁用该位置的装备,禁用多个则换行再写
  12. #   在角色备注栏备注<ini_equips:[a,b,c...n]> 初始化初始装备(此备注将使数据库的初
  13. #   始装备设置失效,并且请把装备对应好位置和确认装备该位置可以装备该装备。)
  14. #   在角色备注栏备注<add_equips:[h,i,j...n]> 追加初始装备(和上面是一样的意思,
  15. #   但是这种不会让数据库的设置无效,只会在后面追加上初始装备。)具体请自己摸索吧
  16. #==============================================================================
  17. $VIPArcherScript ||= {};$VIPArcherScript[:slot_type] = __FILE__ #20140803
  18. #==============================================================================
  19. # ★ 设定部分 ★
  20. #==============================================================================
  21. module VIPArcher

  22.   ETYPE_ADD_NAME = [] #设置要增加的装备位置的名字

  23.   SLOT_TYPE = {
  24.   0 => [0,1,2,3,4],    # 普通  
  25.   1 => [0,0,2,3,4],    # 双持武器 (这两个是默认的风格)
  26.   2 => [0,0,0,0,0,1,2,3,4],    # 除了盾牌以外还能装备5个武器
  27.   # 从这里开始添加装备风格

  28.   } # <= 这个大括号不能删
  29.   #--------------------------------------------------------------------------
  30.   # ● 追加装备位置用语
  31.   #--------------------------------------------------------------------------
  32.   def Vocab.etype(etype_id)
  33.     etype_name = $data_system.terms.etypes + ETYPE_ADD_NAME
  34.     etype_name[etype_id]
  35.   end
  36. end
  37. #==============================================================================
  38. # ☆ 设定结束 ☆
  39. #==============================================================================
  40. class RPG::Actor < RPG::BaseItem
  41.   #--------------------------------------------------------------------------
  42.   # ● 初始装备数组
  43.   #--------------------------------------------------------------------------
  44.   alias vip_20141119_equips equips
  45.   def equips
  46.     add_equips = []
  47.     $1.split(",").each {|item|add_equips.push item.to_i} if
  48.     @note =~ /<(?:ini_equips|初始装备)[:]\[(.+?)\]>/i
  49.     return add_equips if add_equips != []
  50.     $1.split(",").each {|item|add_equips.push item.to_i} if
  51.     @note =~ /<(?:add_equips|追加初始装备)[:]\[(.+?)\]>/i
  52.     vip_20141119_equips.clone + add_equips
  53.   end
  54. end
  55. #-------------------------------------------------------------------------------
  56. class RPG::Armor < RPG::EquipItem
  57.   #--------------------------------------------------------------------------
  58.   # ● 装备类型
  59.   #--------------------------------------------------------------------------
  60.   def etype_id
  61.     return @note =~ /<(?:etype_id|装备类型)[:]\s*(.*)>/i ? $1.to_i : @etype_id
  62.   end
  63. end
  64. #-------------------------------------------------------------------------------
  65. class Game_BattlerBase
  66.   #--------------------------------------------------------------------------
  67.   # ● 获取装备风格
  68.   #--------------------------------------------------------------------------
  69.   def slot_type
  70.     slot =[]
  71.     feature_objects.each {|obj| slot.push $1.to_i if
  72.     obj.note  =~ /<(?:slot_type|装备风格)[:]\s*(.*)>/i }
  73.     return slot.max || 0
  74.   end
  75.   #--------------------------------------------------------------------------
  76.   # ● 判定是否固定装备
  77.   #--------------------------------------------------------------------------
  78.   alias vip_20141119_equip_type_fixed? equip_type_fixed?
  79.   def equip_type_fixed?(etype_id)
  80.     fixed_type = []
  81.     feature_objects.each {|obj| obj.note.split(/[\r\n]+/).each {|line|
  82.     fixed_type.push $1.to_i if line =~ /<(?:fix_equips|固定装备)[:]\s*(.*)>/i}}
  83.     fixed_type.include?(etype_id) || vip_20141119_equip_type_fixed?(etype_id)
  84.   end
  85.   #--------------------------------------------------------------------------
  86.   # ● 判定装备是否被禁用
  87.   #--------------------------------------------------------------------------
  88.   alias vip_20141119_equip_type_sealed? equip_type_sealed?
  89.   def equip_type_sealed?(etype_id)
  90.     sealed_type = []
  91.     feature_objects.each {|obj| obj.note.split(/[\r\n]+/).each {|line|
  92.     sealed_type.push $1.to_i if line =~ /<(?:seal_equips|禁用装备)[:]\s*(.*)>/i}}
  93.     sealed_type.include?(etype_id) || vip_20141119_equip_type_sealed?(etype_id)
  94.   end
  95. end
  96. #-------------------------------------------------------------------------------
  97. class Game_Actor < Game_Battler
  98.   #--------------------------------------------------------------------------
  99.   # ● 初始化装备
  100.   #     # 方法覆盖,可能引起冲突
  101.   #--------------------------------------------------------------------------
  102.   def init_equips(equips)
  103.     type_size = VIPArcher::SLOT_TYPE.values.max_by{|type|type.size}.size
  104.     @equips = Array.new(type_size) { Game_BaseItem.new }
  105.     equips.each_with_index do |item_id, i|
  106.       etype_id = index_to_etype_id(i)
  107.       slot_id = empty_slot(etype_id)
  108.       @equips[slot_id].set_equip(etype_id == 0, item_id) if slot_id
  109.     end
  110.     refresh
  111.   end
  112.   #--------------------------------------------------------------------------
  113.   # ● 获取装备栏的数组
  114.   #--------------------------------------------------------------------------
  115.   alias vip_20140803_es equip_slots
  116.   def equip_slots
  117.     return VIPArcher::SLOT_TYPE[slot_type] if
  118.     VIPArcher::SLOT_TYPE[slot_type] != nil
  119.     vip_20140803_es
  120.   end
  121. end
  122. #-------------------------------------------------------------------------------
  123. class Scene_Equip < Scene_MenuBase
  124.   #--------------------------------------------------------------------------
  125.   # ● 生成装备栏窗口
  126.   #--------------------------------------------------------------------------
  127.   alias slot_vip_create_slot_window create_slot_window
  128.   def create_slot_window
  129.     slot_vip_create_slot_window
  130.     @slot_window.create_contents
  131.     @slot_window.refresh
  132.   end
  133.   #--------------------------------------------------------------------------
  134.   # ● 物品“确定”
  135.   #--------------------------------------------------------------------------
  136.   alias slot_vip_on_item_ok on_item_ok
  137.   def on_item_ok
  138.     slot_vip_on_item_ok
  139.     @slot_window.create_contents
  140.     @slot_window.refresh
  141.   end
  142.   #--------------------------------------------------------------------------
  143.   # ● 指令“全部卸下”
  144.   #--------------------------------------------------------------------------
  145.   alias slot_vip_command_clear command_clear
  146.   def command_clear
  147.     slot_vip_command_clear
  148.     @slot_window.create_contents
  149.     @slot_window.refresh
  150.   end
  151.   #--------------------------------------------------------------------------
  152.   # ● 指令“最强装备”
  153.   #--------------------------------------------------------------------------
  154.   alias slot_vip_command_optimize command_optimize
  155.   def command_optimize
  156.     slot_vip_command_optimize
  157.     @slot_window.create_contents
  158.     @slot_window.refresh
  159.   end
  160.   #--------------------------------------------------------------------------
  161.   # ● 切换角色
  162.   #--------------------------------------------------------------------------
  163.   alias slot_vip_on_actor_change on_actor_change
  164.   def on_actor_change
  165.     slot_vip_on_actor_change
  166.     @slot_window.create_contents
  167.     @slot_window.refresh
  168.   end
  169. end
复制代码
这个B天天摸鱼,快点来个谁把他从被窝里拖出来
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-25 23:14

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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