注册会员 登录
Project1 返回首页

鼠窝 https://rpg.blue/?335626 [收藏] [复制] [分享] [RSS] ~外站脚本图书馆~

日志

物品分类

已有 808 次阅读2014-5-27 21:52 |个人分类:外站脚本

 
=begin
===============================================================================
 Expanded Item Categories (25/01/2013)
-------------------------------------------------------------------------------
 Created By: Shadowmaster/Shadowmaster9000/Shadowpasta
 (www.crimson-castle.co.uk)
 
===============================================================================
 Information
-------------------------------------------------------------------------------
 This script adds more categories to your item and shop menus, such as
 seperate armor categories, and a category for all items together. This script
 also allows you to change the order that the categories appear in, as well
 as how many appear on the screen at the same time.
 
 As a bonus, this script fixes a bug with horizontal window scrolling through
 commands that prevented you from viewing all items if the maximum number of
 items was double the amount of the maximum viewable at once.
 
===============================================================================
 How to Use
-------------------------------------------------------------------------------
 Place this script under Materials, preferably below any item altering scripts.
 
 Further down are some options you can change to your liking.
===============================================================================
 Required
-------------------------------------------------------------------------------
 Nothing.
 
===============================================================================
 Change log
-------------------------------------------------------------------------------
 v1.0: First release. (25/01/2013)
===============================================================================
 Terms of Use
-------------------------------------------------------------------------------
 * Free to use for both commercial and non-commerical projects.
 * Credit me if used.
 * Do not claim this as your own.
 * You're free to post this on other websites, but please credit me and keep
 the header intact.
 * If you want to release any modifications/add-ons for this script, you must
 use the same Terms of Use as this script uses.
 * If you want to use your own seperate Terms of Use for your version or
 add-ons of this script, you must contact me at http://www.rpgmakervxace.net
 or www.crimson-castle.co.uk
===============================================================================
=end
$imported = {} if $imported.nil?
$imported["ExpandedItemCategories"] = true
module Itemlist
 
#==============================================================================
# ** List of Categories
#------------------------------------------------------------------------------
#  Below are the list of categories available in this script. You can change
#  the order of the categories to your pleasing, as well as their names and
#  even remove any categories you don't want. I will record the list of all
#  available categories here if in case you forget any of them.
#
#  :all_item         (Displays all items)
#  :item             (Displays normal items)
#  :weapon           (Displays all weapons)
#  :armor            (Displays all armor gear)
#  :armor_shield     (Displays shields only)
#  :armor_head       (Displays head gear only)
#  :armor_body       (Displays body gear only)
#  :armor_accessory  (Displays accessories only)
#  :key_item         (Displays key items)
#==============================================================================
 
  Categories =[ # Do not remove this.
      [:all_item, "All"],
      [:item, "Items"],
      [:weapon, "Weapons"], 
      [:armor, "Armors"],
      [:armor_shield, "Shields"],
      [:armor_head, "Head Gear"],
      [:armor_body, "Body Gear"],
      [:armor_accessory, "Accessories"],
      [:key_item, "Key Items"],
    ] # Do not remove this.
#==============================================================================
# ** Category Help Descriptions
#------------------------------------------------------------------------------
#  These set what text appears in the help window when you are viewing the
#  item categories. If you want to leave them blank, just leave empty ""
#  behind.
#==============================================================================
   
  All_Item_Help_Info = "Viewing all items."
  Item_Help_Info = "Viewing normal items."
  Weapon_Help_Info = "Viewing all weapons."
  Armor_Help_Info = "Viewing all armors."
  Armor_Shield_Help_Info = "Viewing all shields."
  Armor_Head_Help_Info = "Viewing head gear."
  Armor_Body_Help_Info = "Viewing body gear."
  Armor_Accessory_Help_Info = "Viewing accessories."
  Key_Item_Help_Info = "Viewing important items."
 
#==============================================================================
# ** Max Columns
#------------------------------------------------------------------------------
#  This sets how many item categories you can view on the screen at one time.
#  If the number of item categories exceed the number of maximum columns, you
#  will be able to scroll through the window to see the rest of the item
#  categories.
#==============================================================================
  Max_Columns = 4
end
#==============================================================================
# ** DO NOT edit anything below this unless if you know what you're doing!
#==============================================================================
     
class RPG::Armor
  def armor_shield?
    @etype_id == 1
  end
  def armor_head?
    @etype_id == 2
  end
  def armor_body?
    @etype_id == 3
  end
  def armor_accessory?
    @etype_id == 4
  end
 
end
#==============================================================================
# ** Window_HorzCommand
#------------------------------------------------------------------------------
#  This is a command window for the horizontal selection format.
#==============================================================================
class Window_HorzCommand < Window_Command
  #--------------------------------------------------------------------------
  # * Set Leading Digits
  #--------------------------------------------------------------------------
  def top_col=(col)
    col = 0 if col < 0
    self.ox = col * (item_width + spacing)
  end
end
#==============================================================================
# ** Window_ItemCategory
#------------------------------------------------------------------------------
#  This window is for selecting a category of normal items and equipment
# on the item screen or shop screen.
#==============================================================================
class Window_ItemCategory < Window_HorzCommand
  #--------------------------------------------------------------------------
  # * Get Digit Count
  #--------------------------------------------------------------------------
  def col_max
    return Itemlist::Max_Columns
  end
  #--------------------------------------------------------------------------
  # * Create Command List
  #--------------------------------------------------------------------------
  def make_command_list
    Itemlist::Categories.each { |symbol, label|
          add_command(label, symbol)
        }
  end
  #--------------------------------------------------------------------------
  # * Update Help Text
  #--------------------------------------------------------------------------
  def update_help
    @help_window.clear
    case current_symbol
    when :all_item
      @help_window.set_text(Itemlist::All_Item_Help_Info)
    when :item
      @help_window.set_text(Itemlist::Item_Help_Info)
    when :weapon
      @help_window.set_text(Itemlist::Weapon_Help_Info)
    when :armor
      @help_window.set_text(Itemlist::Armor_Help_Info)
    when :armor_shield
      @help_window.set_text(Itemlist::Armor_Shield_Help_Info)
    when :armor_head
      @help_window.set_text(Itemlist::Armor_Head_Help_Info)
    when :armor_body
      @help_window.set_text(Itemlist::Armor_Body_Help_Info)
    when :armor_accessory
      @help_window.set_text(Itemlist::Armor_Accessory_Help_Info)
    when :key_item
      @help_window.set_text(Itemlist::Key_Item_Help_Info)
    else
      @help_window.clear
    end
  end
end
#==============================================================================
# ** Window_ItemList
#------------------------------------------------------------------------------
#  This window displays a list of party items on the item screen.
#==============================================================================
class Window_ItemList < Window_Selectable
  #--------------------------------------------------------------------------
  # * Include in Item List?
  #--------------------------------------------------------------------------
  def include?(item)
    case @category
    when :all_item
      item.is_a?(RPG::Item) || item.is_a?(RPG::Weapon) || item.is_a?(RPG::Armor)
    when :item
      item.is_a?(RPG::Item) && !item.key_item?
    when :weapon
      item.is_a?(RPG::Weapon)
    when :armor
      item.is_a?(RPG::Armor)
    when :armor_shield
      item.is_a?(RPG::Armor) && item.armor_shield?
    when :armor_head
      item.is_a?(RPG::Armor) && item.armor_head?
    when :armor_body
      item.is_a?(RPG::Armor) && item.armor_body?
    when :armor_accessory
      item.is_a?(RPG::Armor) && item.armor_accessory?
    when :key_item
      item.is_a?(RPG::Item) && item.key_item?
    else
      false
    end
  end
end
#==============================================================================
# ** Scene_Shop
#------------------------------------------------------------------------------
#  This class performs shop screen processing.
#==============================================================================
class Scene_Shop < Scene_MenuBase
  #--------------------------------------------------------------------------
  # * Start Processing
  #--------------------------------------------------------------------------
  alias start_itemlist start
  def start
    super
    start_itemlist
    @help_window.clear
  end
  #--------------------------------------------------------------------------
  # * Category [Cancel]
  #--------------------------------------------------------------------------
  alias on_category_cancel_itemlist on_category_cancel
  def on_category_cancel
    on_category_cancel_itemlist
    @help_window.clear
  end
end

鸡蛋

鲜花

评论 (0 个评论)

facelist doodle 涂鸦笔

您需要登录后才可以评论 登录 | 注册会员

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

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

GMT+8, 2024-3-29 20:57

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

返回顶部