查看: 3961|回复: 2

[已经解决] [已解决]轩辕剑菜单中,效果范围无时无法使用

[复制链接]

素材区好人

梦石
5
星屑
12712
在线时间
4359 小时
注册时间
2011-7-21
回帖
2270

超评测参与极短28参与极短27参与极短26参与极短25参与极短24参与极短23参与极短22参与极短21参与

发表于 2020-3-2 23:55:08 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 无忧谷主幻 于 2020-3-5 12:44 编辑

虽然换成己方单体,己方全体,使用者后就可以用了,但感觉像是角色吃了该物品似的
轩辕菜单 复杂物品分类.zip (1.03 MB, 下载次数: 56)
梦石
0
星屑
2862
在线时间
144 小时
注册时间
2018-6-29
回帖
19

R考场第七期纪念奖

发表于 2020-3-3 09:45:41 | 显示全部楼层
经过了几次测试,效果范围为“无”时可以使用了。改过的地方,搜“宝箱君”就找到了,不行的话就当参考了。(虽然不知道这么改为什么会成功就是了23333)
  1. #==============================================================================
  2. #复杂物品分类轩辕菜单整合版。脚本来自66RPG。物品分类原作者:柳柳
  3. #轩辕剑菜单原作者:亿万星辰      整合:hktk
  4. #==============================================================================
  5. #==============================================================================
  6. # ■ Window_ItemCommand
  7. #==============================================================================

  8. class Window_ItemCommand < Window_Selectable
  9.   attr_accessor :commands
  10.   #--------------------------------------------------------------------------
  11.   # ● 初始化,生成commands窗口
  12.   #--------------------------------------------------------------------------
  13.   def initialize
  14.     super(160, 64, 161, 352)
  15.     @commands = []
  16.     #————————生成commands窗口
  17.     for i in 1...$data_items.size
  18.       if $game_party.item_number(i) > 0
  19.         push = true
  20.         for com in @commands
  21.           if com == $data_items[i].desc
  22.             push = false
  23.           end
  24.         end
  25.         if push == true
  26.           @commands.push($data_items[i].desc)
  27.         end
  28.       end
  29.     end
  30.     for i in 1...$data_weapons.size
  31.       if $game_party.weapon_number(i) > 0
  32.         push = true
  33.         for com in @commands
  34.           if com == $data_weapons[i].desc
  35.             push = false
  36.           end
  37.         end
  38.         if push == true
  39.           @commands.push($data_weapons[i].desc)
  40.         end
  41.       end
  42.     end
  43.     for i in 1...$data_armors.size
  44.       if $game_party.armor_number(i) > 0
  45.         push = true
  46.         for com in @commands
  47.           if com == $data_armors[i].desc
  48.             push = false
  49.           end
  50.         end
  51.         if push == true
  52.           @commands.push($data_armors[i].desc)
  53.         end
  54.       end
  55.     end
  56.     if @commands == []
  57.       @commands.push("普通物品")
  58.     end      
  59.     @item_max = @commands.size
  60.     self.contents = Bitmap.new(width - 32, @item_max * 32)
  61.     refresh
  62.     self.index = 0
  63.   end
  64.   #--------------------------------------------------------------------------
  65.   #--------------------------------------------------------------------------
  66.   def refresh
  67.     self.contents.clear
  68.     for i in 0...@item_max
  69.       draw_item(i, normal_color)
  70.     end
  71.   end
  72.   #--------------------------------------------------------------------------
  73.   #--------------------------------------------------------------------------
  74.   def draw_item(index, color)
  75.     self.contents.font.color = color
  76.     y = index * 32
  77.     self.contents.draw_text(4, y, 128, 32, @commands[index])
  78.   end
  79.   #--------------------------------------------------------------------------
  80.   # 只描绘原文字
  81.   #--------------------------------------------------------------------------
  82.   def update_help
  83.     @help_window.set_text(@commands[self.index])
  84.   end
  85. end
  86. #==============================================================================
  87. # ■ Window_ItemList
  88. #==============================================================================

  89. class Window_ItemList < Window_Selectable
  90.   #--------------------------------------------------------------------------
  91.   #--------------------------------------------------------------------------
  92.   def initialize
  93.     super(321, 64, 319, 352)
  94.     refresh
  95.     self.index = 0
  96.   end
  97.   #--------------------------------------------------------------------------
  98.   #--------------------------------------------------------------------------
  99.   def item
  100.     return @data[self.index]
  101.   end
  102.   #--------------------------------------------------------------------------
  103.   #--------------------------------------------------------------------------
  104.   def refresh
  105.     if self.contents != nil
  106.       self.contents.dispose
  107.       self.contents = nil
  108.     end
  109.     @data = []
  110.   end
  111.   #--------------------------------------------------------------------------
  112.   #--------------------------------------------------------------------------
  113.   def set_item(command)
  114.     refresh
  115.     for i in 1...$data_items.size
  116.       if $game_party.item_number(i) > 0 and $data_items[i].desc == command
  117.         @data.push($data_items[i])
  118.       end
  119.     end
  120.     for i in 1...$data_weapons.size
  121.       if $game_party.weapon_number(i) > 0 and $data_weapons[i].desc == command
  122.         @data.push($data_weapons[i])
  123.       end
  124.     end
  125.     for i in 1...$data_armors.size
  126.       if $game_party.armor_number(i) > 0 and $data_armors[i].desc == command
  127.         @data.push($data_armors[i])
  128.       end
  129.     end
  130.     @item_max = @data.size
  131.     if @item_max > 0
  132.       self.contents = Bitmap.new(width - 32, row_max * 32)
  133.       self.contents.clear
  134.       for i in 0...@item_max
  135.         draw_item(i)
  136.       end
  137.     end
  138.   end
  139.   #--------------------------------------------------------------------------
  140.   #--------------------------------------------------------------------------
  141.   def item_number
  142.     return @item_max
  143.   end
  144.   #--------------------------------------------------------------------------
  145.   #--------------------------------------------------------------------------
  146.   def draw_item(index)
  147.     item = @data[index]
  148.     case item
  149.     when RPG::Item
  150.       number = $game_party.item_number(item.id)
  151.     when RPG::Weapon
  152.       number = $game_party.weapon_number(item.id)
  153.     when RPG::Armor
  154.       number = $game_party.armor_number(item.id)
  155.     end
  156.     if item.is_a?(RPG::Item) and
  157.       $game_party.item_can_use?(item.id)
  158.       self.contents.font.color = normal_color
  159.     else
  160.       self.contents.font.color = disabled_color
  161.     end
  162.     x = 4
  163.     y = index * 32
  164.     bitmap = RPG::Cache.icon(item.icon_name)
  165.     opacity = self.contents.font.color == normal_color ? 255 : 128
  166.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
  167.     self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
  168.     self.contents.draw_text(x + 250, y, 16, 32, ":", 1)
  169.     self.contents.draw_text(x + 258, y, 24, 32, number.to_s, 2)
  170.   end
  171.   #--------------------------------------------------------------------------
  172.   #--------------------------------------------------------------------------
  173.   def update_help
  174.     @help_window.set_text(self.item == nil ? "" : self.item.description)
  175.   end
  176. end
  177. #==============================================================================
  178. #复杂物品分类轩辕菜单整合版。脚本来自66RPG。物品分类原作者:柳柳
  179. #轩辕剑菜单原作者:亿万星辰      整合:hktk
  180. #==============================================================================
  181. #==============================================================================
  182. # ■ Scene_Item
  183. #==============================================================================
  184. class Scene_Item
  185.   def main
  186. #==============================================================================
  187. #这段脚本是为了风格与 轩辕剑菜单 吻合加的。(基本上直接拷过来的)
  188. #==============================================================================
  189.     @command_window = Window_MenuCommand.new(0)
  190.     @gold_window = Window_Gold.new
  191.     @gold_window.x = 0
  192.     @gold_window.y = 416
  193.     @status_window = Window_MenuStatus.new
  194.     @status_window.x = 0
  195.     @status_window.y = 64
  196.     @dummy_window = Window_Base.new(160, 64, 480, 416)
  197.     @dummy_window.back_opacity = 0
  198.     @dummy_sprite = Sprite.new(Viewport.new(160, 64, 480, 416))
  199.     @old_index = @menu_index
  200. #  item  是轩辕剑菜单的物品默认背景图,如果你修改了,也要将这里修改。
  201.     @dummy_sprite.bitmap = Bitmap.new("Graphics/Pictures/item")
  202. #==============================================================================
  203. #这里开始时正式脚本
  204. #==============================================================================
  205.     @itemcommand_window = Window_ItemCommand.new
  206.     @itemcommand_window.opacity = 180
  207.     @command_index = @itemcommand_window.index
  208.     @itemlist_window = Window_ItemList.new
  209.     @itemlist_window.active = false
  210.     @itemlist_window.opacity = 180
  211.     @help_window = Window_Help_New.new
  212.     @help_window.x = 160
  213.     @help_window.y = 416
  214.     @itemcommand_window.help_window = @help_window
  215.     @itemlist_window.help_window = @help_window
  216.     @itemlist_window.set_item(@itemcommand_window.commands[@command_index])
  217.     Graphics.transition
  218.     loop do
  219.       Graphics.update
  220.       Input.update
  221.       update
  222.       if $scene != self
  223.         break
  224.       end
  225.     end
  226.     Graphics.freeze
  227.     @itemcommand_window.dispose
  228.     @itemlist_window.dispose
  229.     @help_window.dispose
  230. #这里是关闭前面那些轩辕剑菜单的各种东西。
  231.     @command_window.dispose
  232.     @gold_window.dispose
  233.     @status_window.dispose
  234.     @dummy_window.dispose
  235.     @dummy_sprite.dispose
  236.   end
  237. #==============================================================================
  238. #刷新内容总算法
  239. #==============================================================================
  240.   def update
  241.     @itemcommand_window.update
  242.     @itemlist_window.update
  243.     @help_window.update
  244.     if @command_index != @itemcommand_window.index
  245.       @command_index = @itemcommand_window.index
  246.       @itemlist_window.set_item(@itemcommand_window.commands[@command_index])
  247.     end
  248.     if @itemcommand_window.active
  249.       update_itemcommand
  250.       return
  251.     end
  252.     if @itemlist_window.active
  253.       update_itemlist
  254.       return
  255.     end
  256.     if @status_window.active
  257.       update_target
  258.       return
  259.     end
  260.   end
  261. #------------------------------------------------------------------------------
  262. #刷新种类菜单
  263. #------------------------------------------------------------------------------
  264.   def update_itemcommand
  265.     if Input.trigger?(Input::B)
  266.       $game_system.se_play($data_system.cancel_se)
  267.       $scene = Scene_Menu.new(0)
  268.       return
  269.     end
  270.     if Input.trigger?(Input::C)
  271.       if @itemlist_window.item_number == 0
  272.         $game_system.se_play($data_system.buzzer_se)
  273.         return
  274.       end
  275.       $game_system.se_play($data_system.decision_se)
  276.       @itemcommand_window.active = false
  277.       @itemlist_window.active = true
  278.       @itemlist_window.index = 0
  279.       return
  280.     end
  281.   end
  282. #------------------------------------------------------------------------------
  283. #刷新物品菜单
  284. #------------------------------------------------------------------------------
  285.   def update_itemlist
  286.     if Input.trigger?(Input::B)
  287.       $game_system.se_play($data_system.cancel_se)
  288.       @itemlist_update = false
  289.       @itemcommand_update = true
  290.       @command_window.active = true
  291.       @itemcommand_window.active = true
  292.       @itemlist_window.active = false
  293.       @itemlist_window.index = 0
  294.       @itemcommand_window.index = @command_index
  295.       return
  296.     end
  297.     if Input.trigger?(Input::C)
  298.       @item = @itemlist_window.item
  299.       unless @item.is_a?(RPG::Item)
  300.         $game_system.se_play($data_system.buzzer_se)
  301.         return
  302.       end
  303.       unless $game_party.item_can_use?(@item.id)
  304.         $game_system.se_play($data_system.buzzer_se)
  305.         return
  306.       end
  307.       $game_system.se_play($data_system.decision_se)
  308.       if @item.scope >= 3
  309.         @itemlist_window.active = false
  310.         @status_window.x = 0
  311.         @status_window.visible = true
  312.         @status_window.active = true
  313.         if @item.scope == 4 || @item.scope == 6
  314.           @status_window.index = -1
  315.         else
  316.           @status_window.index = 0
  317.         end
  318.       if Input.trigger?(Input::C)
  319.       @item = @itemlist_window.item
  320.       unless @item.is_a?(RPG::Item)
  321.         $game_system.se_play($data_system.buzzer_se)
  322.         return
  323.       end
  324.     end #改过的地方==宝箱君
  325.     else
  326.         if @item.common_event_id > 0
  327.           $game_temp.common_event_id = @item.common_event_id
  328.           $game_system.se_play(@item.menu_se)
  329.           if @item.consumable
  330.             $game_party.lose_item(@item.id, 1)  #@item_window<=>@itemlist_window
  331.             @itemlist_window.draw_item(@itemlist_window.index) #改过的地方==宝箱君
  332.           end
  333. #改过的地方===============================宝箱君
  334. =begin
  335.           @item_help_window.dispose
  336.           @itemlist_window.dispose
  337.           @equip_window.dispose
  338. =end
  339. #改过的地方===============================宝箱君
  340.           $scene = Scene_Map.new
  341.           return
  342.         end
  343.       end
  344.       return
  345.     end
  346.   end
  347. #==============================================================================
  348. #刷新光标
  349. #==============================================================================
  350.   def update_target
  351.     if Input.trigger?(Input::B)
  352.       $game_system.se_play($data_system.cancel_se)
  353.       unless $game_party.item_can_use?(@item.id)
  354.         @itemlist_window.refresh
  355.       end
  356.       @itemlist_window.active = true
  357.       @status_window.index = -2
  358.       @status_window.active = false
  359.       @itemlist_window.set_item(@itemcommand_window.commands[@command_index])
  360.       return
  361.     end
  362.     if Input.trigger?(Input::C)
  363.       if $game_party.item_number(@item.id) == 0
  364.         $game_system.se_play($data_system.buzzer_se)
  365.         return
  366.       end
  367.       if @status_window.index == -1
  368.         used = false
  369.         for i in $game_party.actors
  370.           used |= i.item_effect(@item)
  371.         end
  372.       end
  373.       if @status_window.index >= 0
  374.         target = $game_party.actors[@status_window.index]
  375.         used = target.item_effect(@item)
  376.       end
  377.       if used
  378.         $game_system.se_play(@item.menu_se)
  379.         if @item.consumable
  380.           $game_party.lose_item(@item.id, 1)
  381.           @itemlist_window.draw_item(@itemlist_window.index)
  382.           @itemlist_window.set_item(@itemcommand_window.commands[@command_index])
  383.         end
  384.         @status_window.refresh
  385.         if $game_party.all_dead?
  386.           $scene = Scene_Gameover.new
  387.           return
  388.         end
  389.         if @item.common_event_id > 0
  390.           $game_temp.common_event_id = @item.common_event_id
  391.           $scene = Scene_Map.new
  392.           return
  393.         end
  394.       end
  395.       unless used
  396.         $game_system.se_play($data_system.buzzer_se)
  397.       end
  398.       return
  399.     end
  400.   end
  401. end
  402. #end 改过的地方==宝箱君
  403. #==============================================================================
  404. # ■ RPG物品分类追加定义
  405. #==============================================================================
  406. module RPG
  407.   class Weapon
  408.     def description
  409.       description = @description.split(/@/)[0]
  410.       return description != nil ? description : ''
  411.     end
  412.     def desc
  413.       desc = @description.split(/@/)[1]
  414.       return desc != nil ? desc : "普通物品"
  415.     end
  416.   end
  417.   class Item
  418.     def description
  419.       description = @description.split(/@/)[0]
  420.       return description != nil ? description : ''
  421.     end
  422.     def desc
  423.       desc = @description.split(/@/)[1]
  424.       return desc != nil ? desc : "普通物品"
  425.     end
  426.   end
  427.   class Armor
  428.     def description
  429.       description = @description.split(/@/)[0]
  430.       return description != nil ? description : ''
  431.     end
  432.     def desc
  433.       desc = @description.split(/@/)[1]
  434.       return desc != nil ? desc : "普通物品"
  435.     end
  436.   end
  437. end
复制代码

点评

谢谢,已解决  发表于 2020-3-5 12:44

评分

参与人数 2星屑 +80 赞 +2 收起 理由
RyanBern + 80 + 1 认可答案
无忧谷主幻 + 1 认可答案

查看全部评分

回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部