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

Project1

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

双手持用的武器

[复制链接]

闇吼者の災悪眷族
不気味存在締造者

梦石
0
星屑
1366
在线时间
2881 小时
注册时间
2014-7-29
帖子
6491
跳转到指定楼层
1
发表于 2015-4-27 19:47:01 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 三途亚梦 于 2016-9-24 12:13 编辑

RUBY 代码复制
  1. #==============================================================================
  2. # +++ 双手持用武器 +++
  3. #==============================================================================
  4. # 提问区应求脚本 By 三途亚梦
  5. # 脚本原地址:[url]https://rpg.blue/thread-377264-1-1.html[/url]
  6. #==============================================================================
  7. # ★ 在数据库武器中备注[双手](中括号必要),则该武器为双手持用武器。
  8. # 双手持用武器:该武器需要双手使用,装备时会自动卸下其它武器和盾牌。
  9. #==============================================================================
  10. # ■ Game_Actor
  11. #------------------------------------------------------------------------------
  12. #  管理角色的类。
  13. #==============================================================================
  14. class Game_Actor < Game_Battler
  15.   #--------------------------------------------------------------------------
  16.   # ● 更换装备
  17.   #     slot_id : 装备栏 ID
  18.   #     item    : 武器/护甲(为 nil 时装备解除)
  19.   #--------------------------------------------------------------------------
  20.   alias amu_20150427_change_equip change_equip
  21.   def change_equip(slot_id, item)
  22.     if item != nil && item.note.include?("[双手]")
  23.       @equips.each_with_index do |weapon|
  24.         if weapon.object != nil && (weapon.object.etype_id == 0 || weapon.object.etype_id == 1)
  25.           trade_item_with_party(nil, weapon.object)
  26.           weapon.object = nil
  27.         end
  28.       end
  29.     elsif item != nil && item.etype_id == 1
  30.       @equips.each_with_index do |weapon|
  31.         if weapon.object != nil && weapon.object.note.include?("[双手]")
  32.           trade_item_with_party(nil, weapon.object)
  33.           weapon.object = nil
  34.         end
  35.       end
  36.     end
  37.     amu_20150427_change_equip(slot_id, item)
  38.   end
  39. end
拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

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

GMT+8, 2024-4-28 02:09

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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