Project1

标题: 脚本盗取系统怎么用 [打印本页]

作者: 300英雄    时间: 2015-10-5 12:15
标题: 脚本盗取系统怎么用
请问下各位怎么使用下脚本
作者: 300英雄    时间: 2015-10-5 12:17
#==============================================================================
#
# ▼ Yanfly Engine Ace - Steal Items v1.03
# -- Last Updated: 2012.01.09
# -- Level: Normal, Hard
# -- Requires: n/a
#
#==============================================================================

$imported = {} if $imported.nil?
$imported["YEA-StealItems"] = true

#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.01.09 - Bug Fixed: Snatch item crash.
# 2012.01.01 - Fixed definition overlap.
# 2011.12.30 - Added message to indicate an enemy has nothing left to steal.
# 2011.12.21 - Started Script and Finished.
#
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Stealing items has been something that's became a staple in many RPG's. It's
# a great way for players to acquire new items and a fun way, too. This script
# adds in the functionality to steal items through either blind stealing,
# stealing specific types, or stealing even specific items. Furthermore, this
# script gives the LUK stat more functionality by having it add to the success
# rate of stealing an item.
#
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# Actor Notetags - These notetags go in the actors notebox in the database.
# -----------------------------------------------------------------------------
# <steal rate: +x%>
# <steal rate: -x%>
# Sets the bonus steal rate to increase or decrease by x%.
#
# <steal type rate: +x%>
# <steal type rate: -x%>
# Sets the bonus steal rate for that specific type of item by +x% or -x%.
# Replace "type" with "item", "weapon", "armour", or "gold".
#
# -----------------------------------------------------------------------------
# Class Notetags - These notetags go in the class notebox in the database.
# -----------------------------------------------------------------------------
# <steal rate: +x%>
# <steal rate: -x%>
# Sets the bonus steal rate to increase or decrease by x%.
#
# <steal type rate: +x%>
# <steal type rate: -x%>
# Sets the bonus steal rate for that specific type of item by +x% or -x%.
# Replace "type" with "item", "weapon", "armour", or "gold".
#
# -----------------------------------------------------------------------------
# Skill Notetags - These notetags go in the skills notebox in the database.
# -----------------------------------------------------------------------------
# <steal>
# <steal: +x%>
# <steal: -x%>
# This gives the skill a blind steal property, allowing it to steal a random
# item the enemy has, if the enemy has any items to steal. If the 2nd/3rd tag
# is used, the success rate will increase by +x% (or decrease).
#
# <steal type>
# <steal type: +x%>
# <steal type: -x%>
# This gives the skill the ability to only be able to steal items of that type.
# Anything that is outside of that type list cannot be stolen. If the 2nd/3rd
# tag is used, the success rate will increase by +x% (or decrease). Replace
# "type" with "item", "weapon", "armour", or "gold". Insert multiple of these
# tags to increase the types that can be stolen.
#
# <snatch>
# <snatch: +x%>
# <snatch: -x%>
# This gives the skill a snatch property, which allows the player to select a
# specific stealable item on the enemy. If the 2nd/3rd tag is used, the
# success rate will increase by +x% (or decrease). Snatch only works for single
# target enemy skills.
#
# <snatch type>
# <snatch type: +x%>
# <snatch type: -x%>
# This gives the skill a snatch property, which allows the player to select a
# specific selectable item on the enemy. However, this tag limits the types of
# items that can be stolen. If the 2nd/3rd tag is used, the success rate will
# increase by +x% (or decrease). Replace "type" with "item", "weapon",
# "armour", or "gold". Insert multiple of these tags to increase the types
# that can be stolen. Snatch only works for single target enemy skills.
#
# -----------------------------------------------------------------------------
# Item Notetags - These notetags go in the items notebox in the database.
# -----------------------------------------------------------------------------
# <steal>
# <steal: +x%>
# <steal: -x%>
# This gives the item a blind steal property, allowing it to steal a random
# item the enemy has, if the enemy has any items to steal. If the 2nd/3rd tag
# is used, the success rate will increase by +x% (or decrease).
#
# <steal type>
# <steal type: +x%>
# <steal type: -x%>
# This gives the item the ability to only be able to steal items of that type.
# Anything that is outside of that type list cannot be stolen. If the 2nd/3rd
# tag is used, the success rate will increase by +x% (or decrease). Replace
# "type" with "item", "weapon", "armour", or "gold". Insert multiple of these
# tags to increase the types that can be stolen.
#
# <snatch>
# <snatch: +x%>
# <snatch: -x%>
# This gives the item a snatch property, which allows the player to select a
# specific stealable item on the enemy. If the 2nd/3rd tag is used, the
# success rate will increase by +x% (or decrease). Snatch only works for single
# target enemy skills.
#
# <snatch type>
# <snatch type: +x%>
# <snatch type: -x%>
# This gives the item a snatch property, which allows the player to select a
# specific selectable item on the enemy. However, this tag limits the types of
# items that can be stolen. If the 2nd/3rd tag is used, the success rate will
# increase by +x% (or decrease). Replace "type" with "item", "weapon",
# "armour", or "gold". Insert multiple of these tags to increase the types
# that can be stolen. Snatch only works for single target enemy skills.
#
# -----------------------------------------------------------------------------
# Weapon Notetags - These notetags go in the weapons notebox in the database.
# -----------------------------------------------------------------------------
# <steal rate: +x%>
# <steal rate: -x%>
# Sets the bonus steal rate to increase or decrease by x%.
#
# <steal type rate: +x%>
# <steal type rate: -x%>
# Sets the bonus steal rate for that specific type of item by +x% or -x%.
# Replace "type" with "item", "weapon", "armour", or "gold".
#
# -----------------------------------------------------------------------------
# Armour Notetags - These notetags go in the armours notebox in the database.
# -----------------------------------------------------------------------------
# <steal rate: +x%>
# <steal rate: -x%>
# Sets the bonus steal rate to increase or decrease by x%.
#
# <steal type rate: +x%>
# <steal type rate: -x%>
# Sets the bonus steal rate for that specific type of item by +x% or -x%.
# Replace "type" with "item", "weapon", "armour", or "gold".
#
# -----------------------------------------------------------------------------
# Enemy Notetags - These notetags go in the enemy notebox in the database.
# -----------------------------------------------------------------------------
# <steal Ix: y%>
# <steal Wx: y%>
# <steal Ax: y%>
# <steal Gx: y%>
# Gives enemy a stealable item, weapon, or armour (marked by I, W, or A) x at
# a rate of y percent. If G is used, that is how much gold can be stolen from
# the enemy. Insert multiples of this tag to increase the number of stolen
# items an enemy can possibly have.
#
# <steal rate: -x%>
# <steal rate: +x%>
# This is the defending modifier used for enemy. All success rate calculations
# will apply the defending enemy's steal rate against success.
#
# -----------------------------------------------------------------------------
# State Notetags - These notetags go in the states notebox in the database.
# -----------------------------------------------------------------------------
# <steal rate: +x%>
# <steal rate: -x%>
# Sets the bonus steal rate to increase or decrease by x%.
#
# <steal type rate: +x%>
# <steal type rate: -x%>
# Sets the bonus steal rate for that specific type of item by +x% or -x%.
# Replace "type" with "item", "weapon", "armour", or "gold".
#
#==============================================================================
# ▼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
#==============================================================================

module YEA
  module STEAL
   
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - General Steal Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # Adjust the general settings for stealing here. These settings involve
    # the text that appear, the sound effects played, the steal bonus rate,
    # and whether or not stealing a weapon or piece of armour will reduce the
    # enemy's stats, and various visual settings. Adjust them as you see fit.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    STEAL_FAIL_TEXT    = "%s couldn't steal an item."         # Failed steal.
    STEAL_SUCCESS_TEXT = "%s steals \ec[17]%s\ec[0] from %s!" # Successful.
    STEAL_EMPTY_TEXT   = "%s has nothing left to steal."      # Emptied out.
    SNATCH_RATE_TEXT   = "%1.2f%%"      # Percentage display for steal rate.
    SNATCH_RATE_SIZE   = 20             # Font size used for rate text.
   
    # These settings adjust the sound effect played when a successful steal
    # takes place and acquires one of the following item types:
    STEAL_ITEM_SFX   = RPG::SE.new("Item3", 80, 150)    # Item stolen.
    STEAL_WEAPON_SFX = RPG::SE.new("Equip1", 80, 150)   # Weapon stolen.
    STEAL_ARMOUR_SFX = RPG::SE.new("Equip2", 80, 150)   # Armour stolen.
    STEAL_GOLD_SFX   = RPG::SE.new("Coin", 80, 100)     # Gold stolen.
   
    # These settings here adjust the maximum and minimum success rates.
    MAXIMUM_RATE = 0.9999
    MINIMUM_RATE = 0.0001
   
    # Adjust the steal bonus rate (sbr) formula here. This is the bonus rate
    # that is added onto steal rates.
    STEAL_BONUS_RATE = "(user.luk/(512.0+user.luk))*0.3333"
   
    # If a weapon or piece of armour is stolen from an enemy, choose to lower
    # the enemy's stats relative to the stats of the piece of equipment?
    STEAL_LOWER_STATS = true
   
    # This sets the gold icon used for stealing items and shown in the snatch
    # window when an item selected for stealing.
    GOLD_ICON = 262
   
    # This is the description used for gold when gold is selected for snatching.
    GOLD_DESCRIPTION    = "Steal some Gold, the currency used everywhere."
    NOTHING_DESCRIPTION = "There is nothing to steal."
   
  end # STEAL
end # YEA

#==============================================================================
# ▼ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================

module YEA
  module REGEXP
  module BASEITEM
   
    STEAL_RATE = /<(?:STEAL_RATE|steal rate):[ ]([\+\-]\d+)([%%])>/i
    STEAL_ITEM_RATE =
      /<(?:STEAL|steal)[ ](.*)[ ](?:RATE|rate):[ ]([\+\-]\d+)([%%])>/i
   
  end # BASEITEM
  module USABLEITEM
   
    STEAL_BLIND = /<(.*)>/i
    STEAL_BLIND_RATE = /<(.*):[ ]([\+\-]\d+)([%%])>/i
    STEAL_ITEM  = /<(.*)[ ](.*)>/i
    STEAL_ITEM_RATE = /<(.*)[ ](.*):[ ]([\+\-]\d+)([%%])>/i
   
  end # USABLEITEM
  module ENEMY
   
    STEAL_ITEM = /<(?:STEAL|steal)[ ]([IWAG])(\d+):[ ](\d+)([%%])>/i
    STEAL_RATE = /<(?:STEAL_RATE|steal rate):[ ]([\+\-]\d+)([%%])>/i
   
  end # ENEMY
  end # REGEXP
end # YEA

#==============================================================================
# ■ Icon
#==============================================================================

module Icon
  
  #--------------------------------------------------------------------------
  # self.steal_gold
  #--------------------------------------------------------------------------
  def self.steal_gold; return YEA::STEAL::GOLD_ICON; end
   
end # Icon

#==============================================================================
# ■ Numeric
#==============================================================================

class Numeric
  
  #--------------------------------------------------------------------------
  # new method: group_digits
  #--------------------------------------------------------------------------
  unless $imported["YEA-CoreEngine"]
  def group; return self.to_s; end
  end # $imported["YEA-CoreEngine"]
   
end # Numeric

#==============================================================================
# ■ DataManager
#==============================================================================

module DataManager
  
  #--------------------------------------------------------------------------
  # alias method: load_database
  #--------------------------------------------------------------------------
  class <<self; alias load_database_steal load_database; end
  def self.load_database
    load_database_steal
    load_notetags_steal
  end
  
  #--------------------------------------------------------------------------
  # new method: load_notetags_steal
  #--------------------------------------------------------------------------
  def self.load_notetags_steal
    groups = [$data_enemies, $data_skills, $data_items, $data_actors,
      $data_classes, $data_weapons, $data_armors, $data_states]
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_notetags_steal
      end
    end
  end
  
end # DataManager

#==============================================================================
# ■ RPG::BaseItem
#==============================================================================

class RPG::BaseItem
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :steal_rate
  
  #--------------------------------------------------------------------------
  # common cache: load_notetags_steal
  #--------------------------------------------------------------------------
  def load_notetags_steal
    @steal_rate = [0.0, 0.0, 0.0, 0.0, 0.0]
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when YEA::REGEXP::BASEITEM::STEAL_RATE
        @steal_rate[0] = $1.to_i * 0.01
      when YEA::REGEXP::BASEITEM::STEAL_ITEM_RATE
        case $1.upcase
        when "ITEM", "ITEMS"
          @steal_rate[1] = $2.to_i * 0.01
        when "WEAPON", "WEAPONS"
          @steal_rate[2] = $2.to_i * 0.01
        when "ARMOUR", "ARMOURS", "ARMOR", "ARMORS"
          @steal_rate[3] = $2.to_i * 0.01
        when "GOLD"
          @steal_rate[4] = $2.to_i * 0.01
        else; next
        end
      end
    } # self.note.split
    #---
  end
  
end # RPG::BaseItem

#==============================================================================
# ■ RPG::UsableItem
#==============================================================================

class RPG::UsableItem < RPG::BaseItem
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :steal_type
  attr_accessor :steal_rate
  attr_accessor :steal_kind
  
  #--------------------------------------------------------------------------
  # common cache: load_notetags_steal
  #--------------------------------------------------------------------------
  def load_notetags_steal
    @steal_type = nil
    @steal_rate = [0.0, 0.0, 0.0, 0.0, 0.0]
    @steal_kind = []
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when YEA::REGEXP::USABLEITEM::STEAL_ITEM_RATE
        case $1.upcase
        when "STEAL"
          @steal_type = :steal
        when "SNATCH"
          @steal_type = :snatch
        else; next
        end
        case $2.upcase
        when "ITEM", "ITEMS"
          @steal_kind.push(1)
          @steal_rate[1] += $3.to_i * 0.01
        when "WEAPON", "WEAPONS"
          @steal_kind.push(2)
          @steal_rate[2] += $3.to_i * 0.01
        when "ARMOUR", "ARMOURS", "ARMOR", "ARMORS"
          @steal_kind.push(3)
          @steal_rate[3] += $3.to_i * 0.01
        when "GOLD"
          @steal_kind.push(4)
          @steal_rate[4] += $3.to_i * 0.01
        end
      when YEA::REGEXP::USABLEITEM::STEAL_ITEM
        case $1.upcase
        when "STEAL"
          @steal_type = :steal
        when "SNATCH"
          @steal_type = :snatch
        else; next
        end
        case $2.upcase
        when "ITEM", "ITEMS"
          @steal_kind.push(1)
        when "WEAPON", "WEAPONS"
          @steal_kind.push(2)
        when "ARMOUR", "ARMOURS", "ARMOR", "ARMORS"
          @steal_kind.push(3)
        when "GOLD"
          @steal_kind.push(4)
        end
      when YEA::REGEXP::USABLEITEM::STEAL_BLIND_RATE
        case $1.upcase
        when "STEAL"
          @steal_type = :steal
        when "SNATCH"
          @steal_type = :snatch
        else; next
        end
        @steal_rate[0] += $2.to_i * 0.01
        @steal_kind = [1, 2, 3, 4]
      when YEA::REGEXP::USABLEITEM::STEAL_BLIND
        case $1.upcase
        when "STEAL"
          @steal_type = :steal
        when "SNATCH"
          @steal_type = :snatch
        else; next
        end
        @steal_kind = [1, 2, 3, 4]
      end
    } # self.note.split
    #---
  end
  
end # class RPG::UsableItem

#==============================================================================
# ■ RPG::Enemy
#==============================================================================

class RPG::Enemy < RPG::BaseItem
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :stealable_items
  attr_accessor :steal_rate
  
  #--------------------------------------------------------------------------
  # common cache: load_notetags_steal
  #--------------------------------------------------------------------------
  def load_notetags_steal
    @stealable_items = []
    @steal_rate = 0.0
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when YEA::REGEXP::ENEMY::STEAL_ITEM
        case $1.upcase
        when "I"; type = 1
        when "W"; type = 2
        when "A"; type = 3
        when "G"; type = 4
        else; next
        end
        data_id = $2.to_i
        rate = $3.to_i * 0.01
        @stealable_items.push(RPG::Enemy::StealItem.new(type, data_id, rate))
      when YEA::REGEXP::ENEMY::STEAL_RATE
        @steal_rate = $1.to_i * 0.01
      end
    } # self.note.split
    #---
  end
  
end # RPG::Enemy

#==============================================================================
# ■ RPG::Enemy::StealItem
#==============================================================================

class RPG::Enemy::StealItem
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :kind
  attr_accessor :data_id
  attr_accessor :rate
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(kind = 0, data_id = 1, rate = 0.0)
    @kind = kind
    @data_id = data_id
    @rate = rate
  end
  
end # RPG::Enemy::StealItem

#==============================================================================
# ■ Game_Temp
#==============================================================================

class Game_Temp
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :steal_skill
  attr_accessor :snatch_target
  
  #--------------------------------------------------------------------------
  # alias method: initialize
  #--------------------------------------------------------------------------
  alias game_temp_initialize_steal initialize
  def initialize
    game_temp_initialize_steal
    @snatch_target = {}
  end
  
end # Game_Temp

#==============================================================================
# ■ Game_ActionResult
#==============================================================================

class Game_ActionResult
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :stolen_item
  
  #--------------------------------------------------------------------------
  # alias method: clear_hit_flags
  #--------------------------------------------------------------------------
  alias game_actionresult_clear_hit_flags_steal clear_hit_flags
  def clear_hit_flags
    game_actionresult_clear_hit_flags_steal
    @stolen_item = nil
  end
  
end # Game_ActionResult

#==============================================================================
# ■ Game_BattlerBase
#==============================================================================

class Game_BattlerBase
  
  #--------------------------------------------------------------------------
  # alias method: initialize
  #--------------------------------------------------------------------------
  alias game_battlerbase_initialize_steal initialize
  def initialize
    game_battlerbase_initialize_steal
    init_stealable_items unless self.is_a?(Game_Enemy)
  end
  
  #--------------------------------------------------------------------------
  # new method: init_stealable_items
  #--------------------------------------------------------------------------
  def init_stealable_items; @stealable_items = []; end
  
  #--------------------------------------------------------------------------
  # new method: stealable_items
  #--------------------------------------------------------------------------
  def stealable_items
    init_stealable_items if @stealable_items.nil?
    return @stealable_items
  end
  
  #--------------------------------------------------------------------------
  # new method: remove_stealable_item
  #--------------------------------------------------------------------------
  def remove_stealable_item(stealable_item)
    init_stealable_items if @stealable_items.nil?
    @stealable_items.delete(stealable_item)
  end
  
end # Game_BattlerBase

#==============================================================================
# ■ Game_Battler
#==============================================================================

class Game_Battler < Game_BattlerBase
  
  #--------------------------------------------------------------------------
  # alias method: item_user_effect
  #--------------------------------------------------------------------------
  alias game_battler_item_user_effect_steal item_user_effect
  def item_user_effect(user, item)
    game_battler_item_user_effect_steal(user, item)
    execute_steal_effect(user, item)
  end
  
  #--------------------------------------------------------------------------
  # new method: execute_steal_effect
  #--------------------------------------------------------------------------
  def execute_steal_effect(user, item)
    return if self.actor?
    return if self.actor? == user.actor?
    return if item.steal_type.nil?
    return if stealable_items == []
    apply_steal_effect(user, item) if item.steal_type == :steal
    apply_snatch_effect(user, item) if item.steal_type == :snatch
    lower_stats_steal_effect
  end
  
  #--------------------------------------------------------------------------
  # new method: apply_blind_steal_effect
  #--------------------------------------------------------------------------
  def lower_stats_steal_effect
    return unless YEA::STEAL::STEAL_LOWER_STATS
    return if @result.stolen_item.nil?
    case @result.stolen_item.kind
    when 2
      item = $data_weapons[@result.stolen_item.data_id]
    when 3
      item = $data_armors[@result.stolen_item.data_id]
    else; return
    end
    for i in 0...8
      add_param(i, -item.params[i])
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: apply_steal_effect
  #--------------------------------------------------------------------------
  def apply_steal_effect(user, item)
    for stealable_item in stealable_items
      next unless item.steal_kind.include?(stealable_item.kind)
      next unless (rand < calc_steal_ratio(user, item, stealable_item))
      @result.stolen_item = stealable_item
      @result.success = true
      break
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: calc_steal_ratio
  #--------------------------------------------------------------------------
  def calc_steal_ratio(user, item, stealable_item)
    rate = stealable_item.rate
    rate += item.steal_rate[0]
    rate += item.steal_rate[stealable_item.kind]
    rate += eval(YEA::STEAL::STEAL_BONUS_RATE)
    rate += user.bonus_steal_rate(0)
    rate += user.bonus_steal_rate(stealable_item.kind)
    rate += enemy.steal_rate
    max_rate = YEA::STEAL::MAXIMUM_RATE
    min_rate = YEA::STEAL::MINIMUM_RATE
    return [[max_rate, rate].min, min_rate].max
  end
  
  #--------------------------------------------------------------------------
  # new method: apply_snatch_effect
  #--------------------------------------------------------------------------
  def apply_snatch_effect(user, item)
    snatch_item = $game_temp.snatch_target[user]
    return unless stealable_items.include?(snatch_item)
    if rand < calc_steal_ratio(user, item, snatch_item)
      @result.stolen_item = snatch_item
      @result.success = true
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: bonus_steal_rate
  #--------------------------------------------------------------------------
  def bonus_steal_rate(kind)
    n = 0.0
    if actor?
      n += self.actor.steal_rate[kind]
      n += self.class.steal_rate[kind]
      for equip in equips
        next if equip.nil?
        n += equip.steal_rate[kind]
      end
    end
    for state in states
      next if state.nil?
      n += state.steal_rate[kind]
    end
    return n
  end
  
end # Game_Battler

#==============================================================================
# ■ Game_Enemy
#==============================================================================

class Game_Enemy < Game_Battler
  
  #--------------------------------------------------------------------------
  # alias method: initialize
  #--------------------------------------------------------------------------
  alias game_enemy_initialize_steal initialize
  def initialize(index, enemy_id)
    game_enemy_initialize_steal(index, enemy_id)
    init_stealable_items
  end
  
  #--------------------------------------------------------------------------
  # new method: init_stealable_items
  #--------------------------------------------------------------------------
  def init_stealable_items
    @stealable_items = enemy.stealable_items.clone
  end
  
end # Game_Enemy

#==============================================================================
# ■ Window_StealList
#==============================================================================

class Window_StealList < Window_Selectable
  
  #--------------------------------------------------------------------------
  # alias method: on_skill_ok
  #--------------------------------------------------------------------------
  def initialize(enemy_window)
    wh = fitting_height(4)
    super(0, Graphics.height - wh, Graphics.width, wh)
    self.z = 200
    deactivate
    hide
    @enemy_window = enemy_window
    @enemy = nil
  end
  
  #--------------------------------------------------------------------------
  # col_max
  #--------------------------------------------------------------------------
  def col_max; return 2; end
  
  #--------------------------------------------------------------------------
  # item_max
  #--------------------------------------------------------------------------
  def item_max; return @data ? @data.size : 1; end
   
  #--------------------------------------------------------------------------
  # item
  #--------------------------------------------------------------------------
  def item; @data[index]; end
  
  #--------------------------------------------------------------------------
  # current_item_enabled?
  #--------------------------------------------------------------------------
  def current_item_enabled?; return !item.nil?; end
  
  #--------------------------------------------------------------------------
  # alias method: on_skill_ok
  #--------------------------------------------------------------------------
  def refresh
    make_item_list
    create_contents
    draw_all_items
    show
    activate
    select(0)
  end
  
  #--------------------------------------------------------------------------
  # alias method: on_skill_ok
  #--------------------------------------------------------------------------
  def make_item_list
    @enemy = @enemy_window.enemy
    @data = @enemy.stealable_items.select {|item| include?(item) }
  end
  
  #--------------------------------------------------------------------------
  # include?
  #--------------------------------------------------------------------------
  def include?(item); return steal_skill.steal_kind.include?(item.kind); end
  
  #--------------------------------------------------------------------------
  # draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    return if item.nil?
    rect = item_rect(index)
    rect.width -= 4
    reset_font_settings
    draw_stolenitem_name(item, rect)
    draw_item_rate(item, rect)
  end
  
  #--------------------------------------------------------------------------
  # draw_stolenitem_name
  #--------------------------------------------------------------------------
  def draw_stolenitem_name(stolen_item, rect)
    case stolen_item.kind
    when 1; item = $data_items[stolen_item.data_id]
    when 2; item = $data_weapons[stolen_item.data_id]
    when 3; item = $data_armors[stolen_item.data_id]
    when 4
      draw_gold(stolen_item, rect)
      return
    end
    draw_item_name(item, rect.x, rect.y, true, rect.width - 24)
  end
  
  #--------------------------------------------------------------------------
  # draw_gold
  #--------------------------------------------------------------------------
  def draw_gold(stolen_item, rect)
    draw_icon(Icon.steal_gold, rect.x, rect.y)
    amount = stolen_item.data_id.group
    amount += Vocab.currency_unit
    draw_text(rect.x+24, rect.y, rect.width - 24, line_height, amount)
  end
  
  #--------------------------------------------------------------------------
  # steal_skill
  #--------------------------------------------------------------------------
  def steal_skill; return $game_temp.steal_skill; end
  
  #--------------------------------------------------------------------------
  # draw_item_rate
  #--------------------------------------------------------------------------
  def draw_item_rate(stolen_item, rect)
    user = BattleManager.actor
    rate = @enemy.calc_steal_ratio(user, steal_skill, stolen_item)
    fmt = YEA::STEAL::SNATCH_RATE_TEXT
    text = sprintf(fmt, rate * 100.0)
    contents.font.size = YEA::STEAL::SNATCH_RATE_SIZE
    draw_text(rect, text, 2)
  end
  
  #--------------------------------------------------------------------------
  # update_help
  #--------------------------------------------------------------------------
  def update_help
    if @data.nil? || item.nil?
      @help_window.set_text(YEA::STEAL::NOTHING_DESCRIPTION)
      return
    end
    case item.kind
    when 1; @help_window.set_text($data_items[item.data_id].description)
    when 2; @help_window.set_text($data_weapons[item.data_id].description)
    when 3; @help_window.set_text($data_armors[item.data_id].description)
    when 4; @help_window.set_text(YEA::STEAL::GOLD_DESCRIPTION)
    end
  end
  
end # Window_StealList

#==============================================================================
# ■ Scene_Battle
#==============================================================================

class Scene_Battle < Scene_Base
  
  #--------------------------------------------------------------------------
  # alias method: on_skill_ok
  #--------------------------------------------------------------------------
  alias scene_battle_create_enemy_window_steal create_enemy_window
  def create_enemy_window
    scene_battle_create_enemy_window_steal
    create_steallist_window
  end
  
  #--------------------------------------------------------------------------
  # alias method: on_skill_ok
  #--------------------------------------------------------------------------
  def create_steallist_window
    wy = @help_window.height
    @steallist_window = Window_StealList.new(@enemy_window)
    @steallist_window.help_window = @help_window
    @steallist_window.set_handler(:ok,     method(:on_steal_ok))
    @steallist_window.set_handler(:cancel, method(:on_steal_cancel))
  end
  
  #--------------------------------------------------------------------------
  # alias method: on_enemy_ok
  #--------------------------------------------------------------------------
  alias scene_battle_on_enemy_ok_steal on_enemy_ok
  def on_enemy_ok
    if show_steal_window?
      activate_steal_window
    else
      scene_battle_on_enemy_ok_steal
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: activate_steal_window
  #--------------------------------------------------------------------------
  def activate_steal_window
    @steallist_window.refresh
    if $imported["YEA-BattleEngine"]
      @skill_window.hide
      @item_window.hide
      @status_aid_window.hide
      @help_window.show
    else
      @info_viewport.visible = false
      @enemy_window.hide
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: show_steal_window?
  #--------------------------------------------------------------------------
  def show_steal_window?
    if @item_window.visible
      $game_temp.steal_skill = @item_window.item
    elsif @skill_window.visible
      $game_temp.steal_skill = @skill_window.item
    else
      return false
    end
    return false if $game_temp.steal_skill.for_friend?
    return false unless $game_temp.steal_skill.need_selection?
    return $game_temp.steal_skill.steal_type == :snatch
  end
  
  #--------------------------------------------------------------------------
  # new method: on_steal_ok
  #--------------------------------------------------------------------------
  def on_steal_ok
    $game_temp.snatch_target[BattleManager.actor] = @steallist_window.item
    show_hidden_steal_windows
    scene_battle_on_enemy_ok_steal
  end
  
  #--------------------------------------------------------------------------
  # new method: on_steal_cancel
  #--------------------------------------------------------------------------
  def on_steal_cancel
    show_hidden_steal_windows
    @enemy_window.show
    @enemy_window.activate
  end
  
  #--------------------------------------------------------------------------
  # new method: show_hidden_steal_windows
  #--------------------------------------------------------------------------
  def show_hidden_steal_windows
    @steallist_window.hide
    if $imported["YEA-BattleEngine"]
      @status_aid_window.show
      @item_window.show if @actor_command_window.current_symbol == :item
      @skill_window.show if @actor_command_window.current_symbol == :skill
    else
      @info_viewport.visible = true
    end
  end
  
  #--------------------------------------------------------------------------
  # alias method: apply_item_effects
  #--------------------------------------------------------------------------
  alias scene_battle_apply_item_effects_steal apply_item_effects
  def apply_item_effects(target, item)
    scene_battle_apply_item_effects_steal(target, item)
    apply_steal_results(target, item)
  end
  
  #--------------------------------------------------------------------------
  # new method: apply_steal_results
  #--------------------------------------------------------------------------
  def apply_steal_results(target, item)
    return if target.actor?
    return if item.steal_type.nil?
    if target.stealable_items.empty?
      fmt = YEA::STEAL::STEAL_EMPTY_TEXT
      text = sprintf(fmt, target.name)
    elsif target.result.stolen_item.nil?
      fmt = YEA::STEAL::STEAL_FAIL_TEXT
      text = sprintf(fmt, @subject.name)
    else
      fmt = YEA::STEAL::STEAL_SUCCESS_TEXT
      actor = @subject.name
      item = stolen_item_text(target)
      enemy = target.name
      text = sprintf(fmt, actor, item, enemy)
    end
    @log_window.add_text(text)
    3.times do @log_window.wait end
    @log_window.back_one
  end
  
  #--------------------------------------------------------------------------
  # new method: stolen_item_text
  #--------------------------------------------------------------------------
  def stolen_item_text(target)
    stolen_item = target.result.stolen_item
    target.remove_stealable_item(stolen_item)
    case stolen_item.kind
    when 1 # Item
      YEA::STEAL::STEAL_ITEM_SFX.play
      item = $data_items[stolen_item.data_id]
    when 2 # Weapon
      YEA::STEAL::STEAL_WEAPON_SFX.play
      item = $data_weapons[stolen_item.data_id]
    when 3 # Armour
      YEA::STEAL::STEAL_ARMOUR_SFX.play
      item = $data_armors[stolen_item.data_id]
    when 4 # Gold
      YEA::STEAL::STEAL_GOLD_SFX.play
      $game_party.gain_gold(stolen_item.data_id)
      fmt = "\ei[%d]%s%s"
      value = stolen_item.data_id.group
      return sprintf(fmt, Icon.steal_gold, value, Vocab.currency_unit)
    end
    $game_party.gain_item(item, 1)
    text = sprintf("\ei[%d]%s", item.icon_index, item.name)
    return text
  end
  
end # Scene_Battle

#==============================================================================
#
# ▼ End of File
#
#==============================================================================
作者: taroxd    时间: 2015-10-5 12:17
按照脚本注释上的内容写备注
作者: taroxd    时间: 2015-10-5 12:18
  1. #==============================================================================
  2. # ▼ Instructions
  3. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  4. # To install this script, open up your script editor and copy/paste this script
  5. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  6. #
  7. # -----------------------------------------------------------------------------
  8. # Actor Notetags - These notetags go in the actors notebox in the database.
  9. # -----------------------------------------------------------------------------
  10. # <steal rate: +x%>
  11. # <steal rate: -x%>
  12. # Sets the bonus steal rate to increase or decrease by x%.
  13. #
  14. # <steal type rate: +x%>
  15. # <steal type rate: -x%>
  16. # Sets the bonus steal rate for that specific type of item by +x% or -x%.
  17. # Replace "type" with "item", "weapon", "armour", or "gold".
  18. #
  19. # -----------------------------------------------------------------------------
  20. # Class Notetags - These notetags go in the class notebox in the database.
  21. # -----------------------------------------------------------------------------
  22. # <steal rate: +x%>
  23. # <steal rate: -x%>
  24. # Sets the bonus steal rate to increase or decrease by x%.
  25. #
  26. # <steal type rate: +x%>
  27. # <steal type rate: -x%>
  28. # Sets the bonus steal rate for that specific type of item by +x% or -x%.
  29. # Replace "type" with "item", "weapon", "armour", or "gold".
  30. #
  31. # -----------------------------------------------------------------------------
  32. # Skill Notetags - These notetags go in the skills notebox in the database.
  33. # -----------------------------------------------------------------------------
  34. # <steal>
  35. # <steal: +x%>
  36. # <steal: -x%>
  37. # This gives the skill a blind steal property, allowing it to steal a random
  38. # item the enemy has, if the enemy has any items to steal. If the 2nd/3rd tag
  39. # is used, the success rate will increase by +x% (or decrease).
  40. #
  41. # <steal type>
  42. # <steal type: +x%>
  43. # <steal type: -x%>
  44. # This gives the skill the ability to only be able to steal items of that type.
  45. # Anything that is outside of that type list cannot be stolen. If the 2nd/3rd
  46. # tag is used, the success rate will increase by +x% (or decrease). Replace
  47. # "type" with "item", "weapon", "armour", or "gold". Insert multiple of these
  48. # tags to increase the types that can be stolen.
  49. #
  50. # <snatch>
  51. # <snatch: +x%>
  52. # <snatch: -x%>
  53. # This gives the skill a snatch property, which allows the player to select a
  54. # specific stealable item on the enemy. If the 2nd/3rd tag is used, the
  55. # success rate will increase by +x% (or decrease). Snatch only works for single
  56. # target enemy skills.
  57. #
  58. # <snatch type>
  59. # <snatch type: +x%>
  60. # <snatch type: -x%>
  61. # This gives the skill a snatch property, which allows the player to select a
  62. # specific selectable item on the enemy. However, this tag limits the types of
  63. # items that can be stolen. If the 2nd/3rd tag is used, the success rate will
  64. # increase by +x% (or decrease). Replace "type" with "item", "weapon",
  65. # "armour", or "gold". Insert multiple of these tags to increase the types
  66. # that can be stolen. Snatch only works for single target enemy skills.
  67. #
  68. # -----------------------------------------------------------------------------
  69. # Item Notetags - These notetags go in the items notebox in the database.
  70. # -----------------------------------------------------------------------------
  71. # <steal>
  72. # <steal: +x%>
  73. # <steal: -x%>
  74. # This gives the item a blind steal property, allowing it to steal a random
  75. # item the enemy has, if the enemy has any items to steal. If the 2nd/3rd tag
  76. # is used, the success rate will increase by +x% (or decrease).
  77. #
  78. # <steal type>
  79. # <steal type: +x%>
  80. # <steal type: -x%>
  81. # This gives the item the ability to only be able to steal items of that type.
  82. # Anything that is outside of that type list cannot be stolen. If the 2nd/3rd
  83. # tag is used, the success rate will increase by +x% (or decrease). Replace
  84. # "type" with "item", "weapon", "armour", or "gold". Insert multiple of these
  85. # tags to increase the types that can be stolen.
  86. #
  87. # <snatch>
  88. # <snatch: +x%>
  89. # <snatch: -x%>
  90. # This gives the item a snatch property, which allows the player to select a
  91. # specific stealable item on the enemy. If the 2nd/3rd tag is used, the
  92. # success rate will increase by +x% (or decrease). Snatch only works for single
  93. # target enemy skills.
  94. #
  95. # <snatch type>
  96. # <snatch type: +x%>
  97. # <snatch type: -x%>
  98. # This gives the item a snatch property, which allows the player to select a
  99. # specific selectable item on the enemy. However, this tag limits the types of
  100. # items that can be stolen. If the 2nd/3rd tag is used, the success rate will
  101. # increase by +x% (or decrease). Replace "type" with "item", "weapon",
  102. # "armour", or "gold". Insert multiple of these tags to increase the types
  103. # that can be stolen. Snatch only works for single target enemy skills.
  104. #
  105. # -----------------------------------------------------------------------------
  106. # Weapon Notetags - These notetags go in the weapons notebox in the database.
  107. # -----------------------------------------------------------------------------
  108. # <steal rate: +x%>
  109. # <steal rate: -x%>
  110. # Sets the bonus steal rate to increase or decrease by x%.
  111. #
  112. # <steal type rate: +x%>
  113. # <steal type rate: -x%>
  114. # Sets the bonus steal rate for that specific type of item by +x% or -x%.
  115. # Replace "type" with "item", "weapon", "armour", or "gold".
  116. #
  117. # -----------------------------------------------------------------------------
  118. # Armour Notetags - These notetags go in the armours notebox in the database.
  119. # -----------------------------------------------------------------------------
  120. # <steal rate: +x%>
  121. # <steal rate: -x%>
  122. # Sets the bonus steal rate to increase or decrease by x%.
  123. #
  124. # <steal type rate: +x%>
  125. # <steal type rate: -x%>
  126. # Sets the bonus steal rate for that specific type of item by +x% or -x%.
  127. # Replace "type" with "item", "weapon", "armour", or "gold".
  128. #
  129. # -----------------------------------------------------------------------------
  130. # Enemy Notetags - These notetags go in the enemy notebox in the database.
  131. # -----------------------------------------------------------------------------
  132. # <steal Ix: y%>
  133. # <steal Wx: y%>
  134. # <steal Ax: y%>
  135. # <steal Gx: y%>
  136. # Gives enemy a stealable item, weapon, or armour (marked by I, W, or A) x at
  137. # a rate of y percent. If G is used, that is how much gold can be stolen from
  138. # the enemy. Insert multiples of this tag to increase the number of stolen
  139. # items an enemy can possibly have.
  140. #
  141. # <steal rate: -x%>
  142. # <steal rate: +x%>
  143. # This is the defending modifier used for enemy. All success rate calculations
  144. # will apply the defending enemy's steal rate against success.
  145. #
  146. # -----------------------------------------------------------------------------
  147. # State Notetags - These notetags go in the states notebox in the database.
  148. # -----------------------------------------------------------------------------
  149. # <steal rate: +x%>
  150. # <steal rate: -x%>
  151. # Sets the bonus steal rate to increase or decrease by x%.
  152. #
  153. # <steal type rate: +x%>
  154. # <steal type rate: -x%>
  155. # Sets the bonus steal rate for that specific type of item by +x% or -x%.
  156. # Replace "type" with "item", "weapon", "armour", or "gold".
  157. #
  158. #==============================================================================
  159. # ▼ Compatibility
  160. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  161. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  162. # it will run with RPG Maker VX without adjusting.
  163. #
  164. #==============================================================================

  165. module YEA
  166.   module STEAL
  167.    
  168.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  169.     # - General Steal Settings -
  170.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  171.     # Adjust the general settings for stealing here. These settings involve
  172.     # the text that appear, the sound effects played, the steal bonus rate,
  173.     # and whether or not stealing a weapon or piece of armour will reduce the
  174.     # enemy's stats, and various visual settings. Adjust them as you see fit.
  175.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  176.     STEAL_FAIL_TEXT    = "%s couldn't steal an item."         # Failed steal.
  177.     STEAL_SUCCESS_TEXT = "%s steals \ec[17]%s\ec[0] from %s!" # Successful.
  178.     STEAL_EMPTY_TEXT   = "%s has nothing left to steal."      # Emptied out.
  179.     SNATCH_RATE_TEXT   = "%1.2f%%"      # Percentage display for steal rate.
  180.     SNATCH_RATE_SIZE   = 20             # Font size used for rate text.
  181.    
  182.     # These settings adjust the sound effect played when a successful steal
  183.     # takes place and acquires one of the following item types:
  184.     STEAL_ITEM_SFX   = RPG::SE.new("Item3", 80, 150)    # Item stolen.
  185.     STEAL_WEAPON_SFX = RPG::SE.new("Equip1", 80, 150)   # Weapon stolen.
  186.     STEAL_ARMOUR_SFX = RPG::SE.new("Equip2", 80, 150)   # Armour stolen.
  187.     STEAL_GOLD_SFX   = RPG::SE.new("Coin", 80, 100)     # Gold stolen.
  188.    
  189.     # These settings here adjust the maximum and minimum success rates.
  190.     MAXIMUM_RATE = 0.9999
  191.     MINIMUM_RATE = 0.0001
  192.    
  193.     # Adjust the steal bonus rate (sbr) formula here. This is the bonus rate
  194.     # that is added onto steal rates.
  195.     STEAL_BONUS_RATE = "(user.luk/(512.0+user.luk))*0.3333"
  196.    
  197.     # If a weapon or piece of armour is stolen from an enemy, choose to lower
  198.     # the enemy's stats relative to the stats of the piece of equipment?
  199.     STEAL_LOWER_STATS = true
  200.    
  201.     # This sets the gold icon used for stealing items and shown in the snatch
  202.     # window when an item selected for stealing.
  203.     GOLD_ICON = 262
  204.    
  205.     # This is the description used for gold when gold is selected for snatching.
  206.     GOLD_DESCRIPTION    = "Steal some Gold, the currency used everywhere."
  207.     NOTHING_DESCRIPTION = "There is nothing to steal."
  208.    
  209.   end # STEAL
  210. end # YEA
复制代码

作者: 300英雄    时间: 2015-10-5 12:18
#==============================================================================
#
# ▼ Yanfly Engine Ace - Steal Items v1.03
# -- Last Updated: 2012.01.09
# -- Level: Normal, Hard
# -- Requires: n/a
#
#==============================================================================

$imported = {} if $imported.nil?
$imported["YEA-StealItems"] = true

#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.01.09 - Bug Fixed: Snatch item crash.
# 2012.01.01 - Fixed definition overlap.
# 2011.12.30 - Added message to indicate an enemy has nothing left to steal.
# 2011.12.21 - Started Script and Finished.
#
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Stealing items has been something that's became a staple in many RPG's. It's
# a great way for players to acquire new items and a fun way, too. This script
# adds in the functionality to steal items through either blind stealing,
# stealing specific types, or stealing even specific items. Furthermore, this
# script gives the LUK stat more functionality by having it add to the success
# rate of stealing an item.
#
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# Actor Notetags - These notetags go in the actors notebox in the database.
# -----------------------------------------------------------------------------
# <steal rate: +x%>
# <steal rate: -x%>
# Sets the bonus steal rate to increase or decrease by x%.
#
# <steal type rate: +x%>
# <steal type rate: -x%>
# Sets the bonus steal rate for that specific type of item by +x% or -x%.
# Replace "type" with "item", "weapon", "armour", or "gold".
#
# -----------------------------------------------------------------------------
# Class Notetags - These notetags go in the class notebox in the database.
# -----------------------------------------------------------------------------
# <steal rate: +x%>
# <steal rate: -x%>
# Sets the bonus steal rate to increase or decrease by x%.
#
# <steal type rate: +x%>
# <steal type rate: -x%>
# Sets the bonus steal rate for that specific type of item by +x% or -x%.
# Replace "type" with "item", "weapon", "armour", or "gold".
#
# -----------------------------------------------------------------------------
# Skill Notetags - These notetags go in the skills notebox in the database.
# -----------------------------------------------------------------------------
# <steal>
# <steal: +x%>
# <steal: -x%>
# This gives the skill a blind steal property, allowing it to steal a random
# item the enemy has, if the enemy has any items to steal. If the 2nd/3rd tag
# is used, the success rate will increase by +x% (or decrease).
#
# <steal type>
# <steal type: +x%>
# <steal type: -x%>
# This gives the skill the ability to only be able to steal items of that type.
# Anything that is outside of that type list cannot be stolen. If the 2nd/3rd
# tag is used, the success rate will increase by +x% (or decrease). Replace
# "type" with "item", "weapon", "armour", or "gold". Insert multiple of these
# tags to increase the types that can be stolen.
#
# <snatch>
# <snatch: +x%>
# <snatch: -x%>
# This gives the skill a snatch property, which allows the player to select a
# specific stealable item on the enemy. If the 2nd/3rd tag is used, the
# success rate will increase by +x% (or decrease). Snatch only works for single
# target enemy skills.
#
# <snatch type>
# <snatch type: +x%>
# <snatch type: -x%>
# This gives the skill a snatch property, which allows the player to select a
# specific selectable item on the enemy. However, this tag limits the types of
# items that can be stolen. If the 2nd/3rd tag is used, the success rate will
# increase by +x% (or decrease). Replace "type" with "item", "weapon",
# "armour", or "gold". Insert multiple of these tags to increase the types
# that can be stolen. Snatch only works for single target enemy skills.
#
# -----------------------------------------------------------------------------
# Item Notetags - These notetags go in the items notebox in the database.
# -----------------------------------------------------------------------------
# <steal>
# <steal: +x%>
# <steal: -x%>
# This gives the item a blind steal property, allowing it to steal a random
# item the enemy has, if the enemy has any items to steal. If the 2nd/3rd tag
# is used, the success rate will increase by +x% (or decrease).
#
# <steal type>
# <steal type: +x%>
# <steal type: -x%>
# This gives the item the ability to only be able to steal items of that type.
# Anything that is outside of that type list cannot be stolen. If the 2nd/3rd
# tag is used, the success rate will increase by +x% (or decrease). Replace
# "type" with "item", "weapon", "armour", or "gold". Insert multiple of these
# tags to increase the types that can be stolen.
#
# <snatch>
# <snatch: +x%>
# <snatch: -x%>
# This gives the item a snatch property, which allows the player to select a
# specific stealable item on the enemy. If the 2nd/3rd tag is used, the
# success rate will increase by +x% (or decrease). Snatch only works for single
# target enemy skills.
#
# <snatch type>
# <snatch type: +x%>
# <snatch type: -x%>
# This gives the item a snatch property, which allows the player to select a
# specific selectable item on the enemy. However, this tag limits the types of
# items that can be stolen. If the 2nd/3rd tag is used, the success rate will
# increase by +x% (or decrease). Replace "type" with "item", "weapon",
# "armour", or "gold". Insert multiple of these tags to increase the types
# that can be stolen. Snatch only works for single target enemy skills.
#
# -----------------------------------------------------------------------------
# Weapon Notetags - These notetags go in the weapons notebox in the database.
# -----------------------------------------------------------------------------
# <steal rate: +x%>
# <steal rate: -x%>
# Sets the bonus steal rate to increase or decrease by x%.
#
# <steal type rate: +x%>
# <steal type rate: -x%>
# Sets the bonus steal rate for that specific type of item by +x% or -x%.
# Replace "type" with "item", "weapon", "armour", or "gold".
#
# -----------------------------------------------------------------------------
# Armour Notetags - These notetags go in the armours notebox in the database.
# -----------------------------------------------------------------------------
# <steal rate: +x%>
# <steal rate: -x%>
# Sets the bonus steal rate to increase or decrease by x%.
#
# <steal type rate: +x%>
# <steal type rate: -x%>
# Sets the bonus steal rate for that specific type of item by +x% or -x%.
# Replace "type" with "item", "weapon", "armour", or "gold".
#
# -----------------------------------------------------------------------------
# Enemy Notetags - These notetags go in the enemy notebox in the database.
# -----------------------------------------------------------------------------
# <steal Ix: y%>
# <steal Wx: y%>
# <steal Ax: y%>
# <steal Gx: y%>
# Gives enemy a stealable item, weapon, or armour (marked by I, W, or A) x at
# a rate of y percent. If G is used, that is how much gold can be stolen from
# the enemy. Insert multiples of this tag to increase the number of stolen
# items an enemy can possibly have.
#
# <steal rate: -x%>
# <steal rate: +x%>
# This is the defending modifier used for enemy. All success rate calculations
# will apply the defending enemy's steal rate against success.
#
# -----------------------------------------------------------------------------
# State Notetags - These notetags go in the states notebox in the database.
# -----------------------------------------------------------------------------
# <steal rate: +x%>
# <steal rate: -x%>
# Sets the bonus steal rate to increase or decrease by x%.
#
# <steal type rate: +x%>
# <steal type rate: -x%>
# Sets the bonus steal rate for that specific type of item by +x% or -x%.
# Replace "type" with "item", "weapon", "armour", or "gold".
#
#==============================================================================
# ▼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
#==============================================================================

module YEA
  module STEAL
   
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - General Steal Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # Adjust the general settings for stealing here. These settings involve
    # the text that appear, the sound effects played, the steal bonus rate,
    # and whether or not stealing a weapon or piece of armour will reduce the
    # enemy's stats, and various visual settings. Adjust them as you see fit.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    STEAL_FAIL_TEXT    = "%s couldn't steal an item."         # Failed steal.
    STEAL_SUCCESS_TEXT = "%s steals \ec[17]%s\ec[0] from %s!" # Successful.
    STEAL_EMPTY_TEXT   = "%s has nothing left to steal."      # Emptied out.
    SNATCH_RATE_TEXT   = "%1.2f%%"      # Percentage display for steal rate.
    SNATCH_RATE_SIZE   = 20             # Font size used for rate text.
   
    # These settings adjust the sound effect played when a successful steal
    # takes place and acquires one of the following item types:
    STEAL_ITEM_SFX   = RPG::SE.new("Item3", 80, 150)    # Item stolen.
    STEAL_WEAPON_SFX = RPG::SE.new("Equip1", 80, 150)   # Weapon stolen.
    STEAL_ARMOUR_SFX = RPG::SE.new("Equip2", 80, 150)   # Armour stolen.
    STEAL_GOLD_SFX   = RPG::SE.new("Coin", 80, 100)     # Gold stolen.
   
    # These settings here adjust the maximum and minimum success rates.
    MAXIMUM_RATE = 0.9999
    MINIMUM_RATE = 0.0001
   
    # Adjust the steal bonus rate (sbr) formula here. This is the bonus rate
    # that is added onto steal rates.
    STEAL_BONUS_RATE = "(user.luk/(512.0+user.luk))*0.3333"
   
    # If a weapon or piece of armour is stolen from an enemy, choose to lower
    # the enemy's stats relative to the stats of the piece of equipment?
    STEAL_LOWER_STATS = true
   
    # This sets the gold icon used for stealing items and shown in the snatch
    # window when an item selected for stealing.
    GOLD_ICON = 262
   
    # This is the description used for gold when gold is selected for snatching.
    GOLD_DESCRIPTION    = "Steal some Gold, the currency used everywhere."
    NOTHING_DESCRIPTION = "There is nothing to steal."
   
  end # STEAL
end # YEA

#==============================================================================
# ▼ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================

module YEA
  module REGEXP
  module BASEITEM
   
    STEAL_RATE = /<(?:STEAL_RATE|steal rate):[ ]([\+\-]\d+)([%%])>/i
    STEAL_ITEM_RATE =
      /<(?:STEAL|steal)[ ](.*)[ ](?:RATE|rate):[ ]([\+\-]\d+)([%%])>/i
   
  end # BASEITEM
  module USABLEITEM
   
    STEAL_BLIND = /<(.*)>/i
    STEAL_BLIND_RATE = /<(.*):[ ]([\+\-]\d+)([%%])>/i
    STEAL_ITEM  = /<(.*)[ ](.*)>/i
    STEAL_ITEM_RATE = /<(.*)[ ](.*):[ ]([\+\-]\d+)([%%])>/i
   
  end # USABLEITEM
  module ENEMY
   
    STEAL_ITEM = /<(?:STEAL|steal)[ ]([IWAG])(\d+):[ ](\d+)([%%])>/i
    STEAL_RATE = /<(?:STEAL_RATE|steal rate):[ ]([\+\-]\d+)([%%])>/i
   
  end # ENEMY
  end # REGEXP
end # YEA

#==============================================================================
# ■ Icon
#==============================================================================

module Icon
  
  #--------------------------------------------------------------------------
  # self.steal_gold
  #--------------------------------------------------------------------------
  def self.steal_gold; return YEA::STEAL::GOLD_ICON; end
   
end # Icon

#==============================================================================
# ■ Numeric
#==============================================================================

class Numeric
  
  #--------------------------------------------------------------------------
  # new method: group_digits
  #--------------------------------------------------------------------------
  unless $imported["YEA-CoreEngine"]
  def group; return self.to_s; end
  end # $imported["YEA-CoreEngine"]
   
end # Numeric

#==============================================================================
# ■ DataManager
#==============================================================================

module DataManager
  
  #--------------------------------------------------------------------------
  # alias method: load_database
  #--------------------------------------------------------------------------
  class <<self; alias load_database_steal load_database; end
  def self.load_database
    load_database_steal
    load_notetags_steal
  end
  
  #--------------------------------------------------------------------------
  # new method: load_notetags_steal
  #--------------------------------------------------------------------------
  def self.load_notetags_steal
    groups = [$data_enemies, $data_skills, $data_items, $data_actors,
      $data_classes, $data_weapons, $data_armors, $data_states]
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_notetags_steal
      end
    end
  end
  
end # DataManager

#==============================================================================
# ■ RPG::BaseItem
#==============================================================================

class RPG::BaseItem
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :steal_rate
  
  #--------------------------------------------------------------------------
  # common cache: load_notetags_steal
  #--------------------------------------------------------------------------
  def load_notetags_steal
    @steal_rate = [0.0, 0.0, 0.0, 0.0, 0.0]
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when YEA::REGEXP::BASEITEM::STEAL_RATE
        @steal_rate[0] = $1.to_i * 0.01
      when YEA::REGEXP::BASEITEM::STEAL_ITEM_RATE
        case $1.upcase
        when "ITEM", "ITEMS"
          @steal_rate[1] = $2.to_i * 0.01
        when "WEAPON", "WEAPONS"
          @steal_rate[2] = $2.to_i * 0.01
        when "ARMOUR", "ARMOURS", "ARMOR", "ARMORS"
          @steal_rate[3] = $2.to_i * 0.01
        when "GOLD"
          @steal_rate[4] = $2.to_i * 0.01
        else; next
        end
      end
    } # self.note.split
    #---
  end
  
end # RPG::BaseItem

#==============================================================================
# ■ RPG::UsableItem
#==============================================================================

class RPG::UsableItem < RPG::BaseItem
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :steal_type
  attr_accessor :steal_rate
  attr_accessor :steal_kind
  
  #--------------------------------------------------------------------------
  # common cache: load_notetags_steal
  #--------------------------------------------------------------------------
  def load_notetags_steal
    @steal_type = nil
    @steal_rate = [0.0, 0.0, 0.0, 0.0, 0.0]
    @steal_kind = []
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when YEA::REGEXP::USABLEITEM::STEAL_ITEM_RATE
        case $1.upcase
        when "STEAL"
          @steal_type = :steal
        when "SNATCH"
          @steal_type = :snatch
        else; next
        end
        case $2.upcase
        when "ITEM", "ITEMS"
          @steal_kind.push(1)
          @steal_rate[1] += $3.to_i * 0.01
        when "WEAPON", "WEAPONS"
          @steal_kind.push(2)
          @steal_rate[2] += $3.to_i * 0.01
        when "ARMOUR", "ARMOURS", "ARMOR", "ARMORS"
          @steal_kind.push(3)
          @steal_rate[3] += $3.to_i * 0.01
        when "GOLD"
          @steal_kind.push(4)
          @steal_rate[4] += $3.to_i * 0.01
        end
      when YEA::REGEXP::USABLEITEM::STEAL_ITEM
        case $1.upcase
        when "STEAL"
          @steal_type = :steal
        when "SNATCH"
          @steal_type = :snatch
        else; next
        end
        case $2.upcase
        when "ITEM", "ITEMS"
          @steal_kind.push(1)
        when "WEAPON", "WEAPONS"
          @steal_kind.push(2)
        when "ARMOUR", "ARMOURS", "ARMOR", "ARMORS"
          @steal_kind.push(3)
        when "GOLD"
          @steal_kind.push(4)
        end
      when YEA::REGEXP::USABLEITEM::STEAL_BLIND_RATE
        case $1.upcase
        when "STEAL"
          @steal_type = :steal
        when "SNATCH"
          @steal_type = :snatch
        else; next
        end
        @steal_rate[0] += $2.to_i * 0.01
        @steal_kind = [1, 2, 3, 4]
      when YEA::REGEXP::USABLEITEM::STEAL_BLIND
        case $1.upcase
        when "STEAL"
          @steal_type = :steal
        when "SNATCH"
          @steal_type = :snatch
        else; next
        end
        @steal_kind = [1, 2, 3, 4]
      end
    } # self.note.split
    #---
  end
  
end # class RPG::UsableItem

#==============================================================================
# ■ RPG::Enemy
#==============================================================================

class RPG::Enemy < RPG::BaseItem
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :stealable_items
  attr_accessor :steal_rate
  
  #--------------------------------------------------------------------------
  # common cache: load_notetags_steal
  #--------------------------------------------------------------------------
  def load_notetags_steal
    @stealable_items = []
    @steal_rate = 0.0
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when YEA::REGEXP::ENEMY::STEAL_ITEM
        case $1.upcase
        when "I"; type = 1
        when "W"; type = 2
        when "A"; type = 3
        when "G"; type = 4
        else; next
        end
        data_id = $2.to_i
        rate = $3.to_i * 0.01
        @stealable_items.push(RPG::Enemy::StealItem.new(type, data_id, rate))
      when YEA::REGEXP::ENEMY::STEAL_RATE
        @steal_rate = $1.to_i * 0.01
      end
    } # self.note.split
    #---
  end
  
end # RPG::Enemy

#==============================================================================
# ■ RPG::Enemy::StealItem
#==============================================================================

class RPG::Enemy::StealItem
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :kind
  attr_accessor :data_id
  attr_accessor :rate
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(kind = 0, data_id = 1, rate = 0.0)
    @kind = kind
    @data_id = data_id
    @rate = rate
  end
  
end # RPG::Enemy::StealItem

#==============================================================================
# ■ Game_Temp
#==============================================================================

class Game_Temp
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :steal_skill
  attr_accessor :snatch_target
  
  #--------------------------------------------------------------------------
  # alias method: initialize
  #--------------------------------------------------------------------------
  alias game_temp_initialize_steal initialize
  def initialize
    game_temp_initialize_steal
    @snatch_target = {}
  end
  
end # Game_Temp

#==============================================================================
# ■ Game_ActionResult
#==============================================================================

class Game_ActionResult
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :stolen_item
  
  #--------------------------------------------------------------------------
  # alias method: clear_hit_flags
  #--------------------------------------------------------------------------
  alias game_actionresult_clear_hit_flags_steal clear_hit_flags
  def clear_hit_flags
    game_actionresult_clear_hit_flags_steal
    @stolen_item = nil
  end
  
end # Game_ActionResult

#==============================================================================
# ■ Game_BattlerBase
#==============================================================================

class Game_BattlerBase
  
  #--------------------------------------------------------------------------
  # alias method: initialize
  #--------------------------------------------------------------------------
  alias game_battlerbase_initialize_steal initialize
  def initialize
    game_battlerbase_initialize_steal
    init_stealable_items unless self.is_a?(Game_Enemy)
  end
  
  #--------------------------------------------------------------------------
  # new method: init_stealable_items
  #--------------------------------------------------------------------------
  def init_stealable_items; @stealable_items = []; end
  
  #--------------------------------------------------------------------------
  # new method: stealable_items
  #--------------------------------------------------------------------------
  def stealable_items
    init_stealable_items if @stealable_items.nil?
    return @stealable_items
  end
  
  #--------------------------------------------------------------------------
  # new method: remove_stealable_item
  #--------------------------------------------------------------------------
  def remove_stealable_item(stealable_item)
    init_stealable_items if @stealable_items.nil?
    @stealable_items.delete(stealable_item)
  end
  
end # Game_BattlerBase

#==============================================================================
# ■ Game_Battler
#==============================================================================

class Game_Battler < Game_BattlerBase
  
  #--------------------------------------------------------------------------
  # alias method: item_user_effect
  #--------------------------------------------------------------------------
  alias game_battler_item_user_effect_steal item_user_effect
  def item_user_effect(user, item)
    game_battler_item_user_effect_steal(user, item)
    execute_steal_effect(user, item)
  end
  
  #--------------------------------------------------------------------------
  # new method: execute_steal_effect
  #--------------------------------------------------------------------------
  def execute_steal_effect(user, item)
    return if self.actor?
    return if self.actor? == user.actor?
    return if item.steal_type.nil?
    return if stealable_items == []
    apply_steal_effect(user, item) if item.steal_type == :steal
    apply_snatch_effect(user, item) if item.steal_type == :snatch
    lower_stats_steal_effect
  end
  
  #--------------------------------------------------------------------------
  # new method: apply_blind_steal_effect
  #--------------------------------------------------------------------------
  def lower_stats_steal_effect
    return unless YEA::STEAL::STEAL_LOWER_STATS
    return if @result.stolen_item.nil?
    case @result.stolen_item.kind
    when 2
      item = $data_weapons[@result.stolen_item.data_id]
    when 3
      item = $data_armors[@result.stolen_item.data_id]
    else; return
    end
    for i in 0...8
      add_param(i, -item.params)
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: apply_steal_effect
  #--------------------------------------------------------------------------
  def apply_steal_effect(user, item)
    for stealable_item in stealable_items
      next unless item.steal_kind.include?(stealable_item.kind)
      next unless (rand < calc_steal_ratio(user, item, stealable_item))
      @result.stolen_item = stealable_item
      @result.success = true
      break
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: calc_steal_ratio
  #--------------------------------------------------------------------------
  def calc_steal_ratio(user, item, stealable_item)
    rate = stealable_item.rate
    rate += item.steal_rate[0]
    rate += item.steal_rate[stealable_item.kind]
    rate += eval(YEA::STEAL::STEAL_BONUS_RATE)
    rate += user.bonus_steal_rate(0)
    rate += user.bonus_steal_rate(stealable_item.kind)
    rate += enemy.steal_rate
    max_rate = YEA::STEAL::MAXIMUM_RATE
    min_rate = YEA::STEAL::MINIMUM_RATE
    return [[max_rate, rate].min, min_rate].max
  end
  
  #--------------------------------------------------------------------------
  # new method: apply_snatch_effect
  #--------------------------------------------------------------------------
  def apply_snatch_effect(user, item)
    snatch_item = $game_temp.snatch_target[user]
    return unless stealable_items.include?(snatch_item)
    if rand < calc_steal_ratio(user, item, snatch_item)
      @result.stolen_item = snatch_item
      @result.success = true
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: bonus_steal_rate
  #--------------------------------------------------------------------------
  def bonus_steal_rate(kind)
    n = 0.0
    if actor?
      n += self.actor.steal_rate[kind]
      n += self.class.steal_rate[kind]
      for equip in equips
        next if equip.nil?
        n += equip.steal_rate[kind]
      end
    end
    for state in states
      next if state.nil?
      n += state.steal_rate[kind]
    end
    return n
  end
  
end # Game_Battler

#==============================================================================
# ■ Game_Enemy
#==============================================================================

class Game_Enemy < Game_Battler
  
  #--------------------------------------------------------------------------
  # alias method: initialize
  #--------------------------------------------------------------------------
  alias game_enemy_initialize_steal initialize
  def initialize(index, enemy_id)
    game_enemy_initialize_steal(index, enemy_id)
    init_stealable_items
  end
  
  #--------------------------------------------------------------------------
  # new method: init_stealable_items
  #--------------------------------------------------------------------------
  def init_stealable_items
    @stealable_items = enemy.stealable_items.clone
  end
  
end # Game_Enemy

#==============================================================================
# ■ Window_StealList
#==============================================================================

class Window_StealList < Window_Selectable
  
  #--------------------------------------------------------------------------
  # alias method: on_skill_ok
  #--------------------------------------------------------------------------
  def initialize(enemy_window)
    wh = fitting_height(4)
    super(0, Graphics.height - wh, Graphics.width, wh)
    self.z = 200
    deactivate
    hide
    @enemy_window = enemy_window
    @enemy = nil
  end
  
  #--------------------------------------------------------------------------
  # col_max
  #--------------------------------------------------------------------------
  def col_max; return 2; end
  
  #--------------------------------------------------------------------------
  # item_max
  #--------------------------------------------------------------------------
  def item_max; return @data ? @data.size : 1; end
   
  #--------------------------------------------------------------------------
  # item
  #--------------------------------------------------------------------------
  def item; @data[index]; end
  
  #--------------------------------------------------------------------------
  # current_item_enabled?
  #--------------------------------------------------------------------------
  def current_item_enabled?; return !item.nil?; end
  
  #--------------------------------------------------------------------------
  # alias method: on_skill_ok
  #--------------------------------------------------------------------------
  def refresh
    make_item_list
    create_contents
    draw_all_items
    show
    activate
    select(0)
  end
  
  #--------------------------------------------------------------------------
  # alias method: on_skill_ok
  #--------------------------------------------------------------------------
  def make_item_list
    @enemy = @enemy_window.enemy
    @data = @enemy.stealable_items.select {|item| include?(item) }
  end
  
  #--------------------------------------------------------------------------
  # include?
  #--------------------------------------------------------------------------
  def include?(item); return steal_skill.steal_kind.include?(item.kind); end
  
  #--------------------------------------------------------------------------
  # draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    return if item.nil?
    rect = item_rect(index)
    rect.width -= 4
    reset_font_settings
    draw_stolenitem_name(item, rect)
    draw_item_rate(item, rect)
  end
  
  #--------------------------------------------------------------------------
  # draw_stolenitem_name
  #--------------------------------------------------------------------------
  def draw_stolenitem_name(stolen_item, rect)
    case stolen_item.kind
    when 1; item = $data_items[stolen_item.data_id]
    when 2; item = $data_weapons[stolen_item.data_id]
    when 3; item = $data_armors[stolen_item.data_id]
    when 4
      draw_gold(stolen_item, rect)
      return
    end
    draw_item_name(item, rect.x, rect.y, true, rect.width - 24)
  end
  
  #--------------------------------------------------------------------------
  # draw_gold
  #--------------------------------------------------------------------------
  def draw_gold(stolen_item, rect)
    draw_icon(Icon.steal_gold, rect.x, rect.y)
    amount = stolen_item.data_id.group
    amount += Vocab.currency_unit
    draw_text(rect.x+24, rect.y, rect.width - 24, line_height, amount)
  end
  
  #--------------------------------------------------------------------------
  # steal_skill
  #--------------------------------------------------------------------------
  def steal_skill; return $game_temp.steal_skill; end
  
  #--------------------------------------------------------------------------
  # draw_item_rate
  #--------------------------------------------------------------------------
  def draw_item_rate(stolen_item, rect)
    user = BattleManager.actor
    rate = @enemy.calc_steal_ratio(user, steal_skill, stolen_item)
    fmt = YEA::STEAL::SNATCH_RATE_TEXT
    text = sprintf(fmt, rate * 100.0)
    contents.font.size = YEA::STEAL::SNATCH_RATE_SIZE
    draw_text(rect, text, 2)
  end
  
  #--------------------------------------------------------------------------
  # update_help
  #--------------------------------------------------------------------------
  def update_help
    if @data.nil? || item.nil?
      @help_window.set_text(YEA::STEAL::NOTHING_DESCRIPTION)
      return
    end
    case item.kind
    when 1; @help_window.set_text($data_items[item.data_id].description)
    when 2; @help_window.set_text($data_weapons[item.data_id].description)
    when 3; @help_window.set_text($data_armors[item.data_id].description)
    when 4; @help_window.set_text(YEA::STEAL::GOLD_DESCRIPTION)
    end
  end
  
end # Window_StealList

#==============================================================================
# ■ Scene_Battle
#==============================================================================

class Scene_Battle < Scene_Base
  
  #--------------------------------------------------------------------------
  # alias method: on_skill_ok
  #--------------------------------------------------------------------------
  alias scene_battle_create_enemy_window_steal create_enemy_window
  def create_enemy_window
    scene_battle_create_enemy_window_steal
    create_steallist_window
  end
  
  #--------------------------------------------------------------------------
  # alias method: on_skill_ok
  #--------------------------------------------------------------------------
  def create_steallist_window
    wy = @help_window.height
    @steallist_window = Window_StealList.new(@enemy_window)
    @steallist_window.help_window = @help_window
    @steallist_window.set_handler(:ok,     method(:on_steal_ok))
    @steallist_window.set_handler(:cancel, method(:on_steal_cancel))
  end
  
  #--------------------------------------------------------------------------
  # alias method: on_enemy_ok
  #--------------------------------------------------------------------------
  alias scene_battle_on_enemy_ok_steal on_enemy_ok
  def on_enemy_ok
    if show_steal_window?
      activate_steal_window
    else
      scene_battle_on_enemy_ok_steal
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: activate_steal_window
  #--------------------------------------------------------------------------
  def activate_steal_window
    @steallist_window.refresh
    if $imported["YEA-BattleEngine"]
      @skill_window.hide
      @item_window.hide
      @status_aid_window.hide
      @help_window.show
    else
      @info_viewport.visible = false
      @enemy_window.hide
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: show_steal_window?
  #--------------------------------------------------------------------------
  def show_steal_window?
    if @item_window.visible
      $game_temp.steal_skill = @item_window.item
    elsif @skill_window.visible
      $game_temp.steal_skill = @skill_window.item
    else
      return false
    end
    return false if $game_temp.steal_skill.for_friend?
    return false unless $game_temp.steal_skill.need_selection?
    return $game_temp.steal_skill.steal_type == :snatch
  end
  
  #--------------------------------------------------------------------------
  # new method: on_steal_ok
  #--------------------------------------------------------------------------
  def on_steal_ok
    $game_temp.snatch_target[BattleManager.actor] = @steallist_window.item
    show_hidden_steal_windows
    scene_battle_on_enemy_ok_steal
  end
  
  #--------------------------------------------------------------------------
  # new method: on_steal_cancel
  #--------------------------------------------------------------------------
  def on_steal_cancel
    show_hidden_steal_windows
    @enemy_window.show
    @enemy_window.activate
  end
  
  #--------------------------------------------------------------------------
  # new method: show_hidden_steal_windows
  #--------------------------------------------------------------------------
  def show_hidden_steal_windows
    @steallist_window.hide
    if $imported["YEA-BattleEngine"]
      @status_aid_window.show
      @item_window.show if @actor_command_window.current_symbol == :item
      @skill_window.show if @actor_command_window.current_symbol == :skill
    else
      @info_viewport.visible = true
    end
  end
  
  #--------------------------------------------------------------------------
  # alias method: apply_item_effects
  #--------------------------------------------------------------------------
  alias scene_battle_apply_item_effects_steal apply_item_effects
  def apply_item_effects(target, item)
    scene_battle_apply_item_effects_steal(target, item)
    apply_steal_results(target, item)
  end
  
  #--------------------------------------------------------------------------
  # new method: apply_steal_results
  #--------------------------------------------------------------------------
  def apply_steal_results(target, item)
    return if target.actor?
    return if item.steal_type.nil?
    if target.stealable_items.empty?
      fmt = YEA::STEAL::STEAL_EMPTY_TEXT
      text = sprintf(fmt, target.name)
    elsif target.result.stolen_item.nil?
      fmt = YEA::STEAL::STEAL_FAIL_TEXT
      text = sprintf(fmt, @subject.name)
    else
      fmt = YEA::STEAL::STEAL_SUCCESS_TEXT
      actor = @subject.name
      item = stolen_item_text(target)
      enemy = target.name
      text = sprintf(fmt, actor, item, enemy)
    end
    @log_window.add_text(text)
    3.times do @log_window.wait end
    @log_window.back_one
  end
  
  #--------------------------------------------------------------------------
  # new method: stolen_item_text
  #--------------------------------------------------------------------------
  def stolen_item_text(target)
    stolen_item = target.result.stolen_item
    target.remove_stealable_item(stolen_item)
    case stolen_item.kind
    when 1 # Item
      YEA::STEAL::STEAL_ITEM_SFX.play
      item = $data_items[stolen_item.data_id]
    when 2 # Weapon
      YEA::STEAL::STEAL_WEAPON_SFX.play
      item = $data_weapons[stolen_item.data_id]
    when 3 # Armour
      YEA::STEAL::STEAL_ARMOUR_SFX.play
      item = $data_armors[stolen_item.data_id]
    when 4 # Gold
      YEA::STEAL::STEAL_GOLD_SFX.play
      $game_party.gain_gold(stolen_item.data_id)
      fmt = "\ei[%d]%s%s"
      value = stolen_item.data_id.group
      return sprintf(fmt, Icon.steal_gold, value, Vocab.currency_unit)
    end
    $game_party.gain_item(item, 1)
    text = sprintf("\ei[%d]%s", item.icon_index, item.name)
    return text
  end
  
end # Scene_Battle

#==============================================================================
#
# ▼ End of File
#
#==============================================================================

好像应该这样就能复制
作者: 300英雄    时间: 2015-10-5 12:20
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Steal Items v1.03
  4. # -- Last Updated: 2012.01.09
  5. # -- Level: Normal, Hard
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-StealItems"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.01.09 - Bug Fixed: Snatch item crash.
  15. # 2012.01.01 - Fixed definition overlap.
  16. # 2011.12.30 - Added message to indicate an enemy has nothing left to steal.
  17. # 2011.12.21 - Started Script and Finished.
  18. #
  19. #==============================================================================
  20. # ▼ Introduction
  21. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  22. # Stealing items has been something that's became a staple in many RPG's. It's
  23. # a great way for players to acquire new items and a fun way, too. This script
  24. # adds in the functionality to steal items through either blind stealing,
  25. # stealing specific types, or stealing even specific items. Furthermore, this
  26. # script gives the LUK stat more functionality by having it add to the success
  27. # rate of stealing an item.
  28. #
  29. #==============================================================================
  30. # ▼ Instructions
  31. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  32. # To install this script, open up your script editor and copy/paste this script
  33. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  34. #
  35. # -----------------------------------------------------------------------------
  36. # Actor Notetags - These notetags go in the actors notebox in the database.
  37. # -----------------------------------------------------------------------------
  38. # <steal rate: +x%>
  39. # <steal rate: -x%>
  40. # Sets the bonus steal rate to increase or decrease by x%.
  41. #
  42. # <steal type rate: +x%>
  43. # <steal type rate: -x%>
  44. # Sets the bonus steal rate for that specific type of item by +x% or -x%.
  45. # Replace "type" with "item", "weapon", "armour", or "gold".
  46. #
  47. # -----------------------------------------------------------------------------
  48. # Class Notetags - These notetags go in the class notebox in the database.
  49. # -----------------------------------------------------------------------------
  50. # <steal rate: +x%>
  51. # <steal rate: -x%>
  52. # Sets the bonus steal rate to increase or decrease by x%.
  53. #
  54. # <steal type rate: +x%>
  55. # <steal type rate: -x%>
  56. # Sets the bonus steal rate for that specific type of item by +x% or -x%.
  57. # Replace "type" with "item", "weapon", "armour", or "gold".
  58. #
  59. # -----------------------------------------------------------------------------
  60. # Skill Notetags - These notetags go in the skills notebox in the database.
  61. # -----------------------------------------------------------------------------
  62. # <steal>
  63. # <steal: +x%>
  64. # <steal: -x%>
  65. # This gives the skill a blind steal property, allowing it to steal a random
  66. # item the enemy has, if the enemy has any items to steal. If the 2nd/3rd tag
  67. # is used, the success rate will increase by +x% (or decrease).
  68. #
  69. # <steal type>
  70. # <steal type: +x%>
  71. # <steal type: -x%>
  72. # This gives the skill the ability to only be able to steal items of that type.
  73. # Anything that is outside of that type list cannot be stolen. If the 2nd/3rd
  74. # tag is used, the success rate will increase by +x% (or decrease). Replace
  75. # "type" with "item", "weapon", "armour", or "gold". Insert multiple of these
  76. # tags to increase the types that can be stolen.
  77. #
  78. # <snatch>
  79. # <snatch: +x%>
  80. # <snatch: -x%>
  81. # This gives the skill a snatch property, which allows the player to select a
  82. # specific stealable item on the enemy. If the 2nd/3rd tag is used, the
  83. # success rate will increase by +x% (or decrease). Snatch only works for single
  84. # target enemy skills.
  85. #
  86. # <snatch type>
  87. # <snatch type: +x%>
  88. # <snatch type: -x%>
  89. # This gives the skill a snatch property, which allows the player to select a
  90. # specific selectable item on the enemy. However, this tag limits the types of
  91. # items that can be stolen. If the 2nd/3rd tag is used, the success rate will
  92. # increase by +x% (or decrease). Replace "type" with "item", "weapon",
  93. # "armour", or "gold". Insert multiple of these tags to increase the types
  94. # that can be stolen. Snatch only works for single target enemy skills.
  95. #
  96. # -----------------------------------------------------------------------------
  97. # Item Notetags - These notetags go in the items notebox in the database.
  98. # -----------------------------------------------------------------------------
  99. # <steal>
  100. # <steal: +x%>
  101. # <steal: -x%>
  102. # This gives the item a blind steal property, allowing it to steal a random
  103. # item the enemy has, if the enemy has any items to steal. If the 2nd/3rd tag
  104. # is used, the success rate will increase by +x% (or decrease).
  105. #
  106. # <steal type>
  107. # <steal type: +x%>
  108. # <steal type: -x%>
  109. # This gives the item the ability to only be able to steal items of that type.
  110. # Anything that is outside of that type list cannot be stolen. If the 2nd/3rd
  111. # tag is used, the success rate will increase by +x% (or decrease). Replace
  112. # "type" with "item", "weapon", "armour", or "gold". Insert multiple of these
  113. # tags to increase the types that can be stolen.
  114. #
  115. # <snatch>
  116. # <snatch: +x%>
  117. # <snatch: -x%>
  118. # This gives the item a snatch property, which allows the player to select a
  119. # specific stealable item on the enemy. If the 2nd/3rd tag is used, the
  120. # success rate will increase by +x% (or decrease). Snatch only works for single
  121. # target enemy skills.
  122. #
  123. # <snatch type>
  124. # <snatch type: +x%>
  125. # <snatch type: -x%>
  126. # This gives the item a snatch property, which allows the player to select a
  127. # specific selectable item on the enemy. However, this tag limits the types of
  128. # items that can be stolen. If the 2nd/3rd tag is used, the success rate will
  129. # increase by +x% (or decrease). Replace "type" with "item", "weapon",
  130. # "armour", or "gold". Insert multiple of these tags to increase the types
  131. # that can be stolen. Snatch only works for single target enemy skills.
  132. #
  133. # -----------------------------------------------------------------------------
  134. # Weapon Notetags - These notetags go in the weapons notebox in the database.
  135. # -----------------------------------------------------------------------------
  136. # <steal rate: +x%>
  137. # <steal rate: -x%>
  138. # Sets the bonus steal rate to increase or decrease by x%.
  139. #
  140. # <steal type rate: +x%>
  141. # <steal type rate: -x%>
  142. # Sets the bonus steal rate for that specific type of item by +x% or -x%.
  143. # Replace "type" with "item", "weapon", "armour", or "gold".
  144. #
  145. # -----------------------------------------------------------------------------
  146. # Armour Notetags - These notetags go in the armours notebox in the database.
  147. # -----------------------------------------------------------------------------
  148. # <steal rate: +x%>
  149. # <steal rate: -x%>
  150. # Sets the bonus steal rate to increase or decrease by x%.
  151. #
  152. # <steal type rate: +x%>
  153. # <steal type rate: -x%>
  154. # Sets the bonus steal rate for that specific type of item by +x% or -x%.
  155. # Replace "type" with "item", "weapon", "armour", or "gold".
  156. #
  157. # -----------------------------------------------------------------------------
  158. # Enemy Notetags - These notetags go in the enemy notebox in the database.
  159. # -----------------------------------------------------------------------------
  160. # <steal Ix: y%>
  161. # <steal Wx: y%>
  162. # <steal Ax: y%>
  163. # <steal Gx: y%>
  164. # Gives enemy a stealable item, weapon, or armour (marked by I, W, or A) x at
  165. # a rate of y percent. If G is used, that is how much gold can be stolen from
  166. # the enemy. Insert multiples of this tag to increase the number of stolen
  167. # items an enemy can possibly have.
  168. #
  169. # <steal rate: -x%>
  170. # <steal rate: +x%>
  171. # This is the defending modifier used for enemy. All success rate calculations
  172. # will apply the defending enemy's steal rate against success.
  173. #
  174. # -----------------------------------------------------------------------------
  175. # State Notetags - These notetags go in the states notebox in the database.
  176. # -----------------------------------------------------------------------------
  177. # <steal rate: +x%>
  178. # <steal rate: -x%>
  179. # Sets the bonus steal rate to increase or decrease by x%.
  180. #
  181. # <steal type rate: +x%>
  182. # <steal type rate: -x%>
  183. # Sets the bonus steal rate for that specific type of item by +x% or -x%.
  184. # Replace "type" with "item", "weapon", "armour", or "gold".
  185. #
  186. #==============================================================================
  187. # ▼ Compatibility
  188. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  189. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  190. # it will run with RPG Maker VX without adjusting.
  191. #
  192. #==============================================================================

  193. module YEA
  194.   module STEAL
  195.    
  196.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  197.     # - General Steal Settings -
  198.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  199.     # Adjust the general settings for stealing here. These settings involve
  200.     # the text that appear, the sound effects played, the steal bonus rate,
  201.     # and whether or not stealing a weapon or piece of armour will reduce the
  202.     # enemy's stats, and various visual settings. Adjust them as you see fit.
  203.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  204.     STEAL_FAIL_TEXT    = "%s couldn't steal an item."         # Failed steal.
  205.     STEAL_SUCCESS_TEXT = "%s steals \ec[17]%s\ec[0] from %s!" # Successful.
  206.     STEAL_EMPTY_TEXT   = "%s has nothing left to steal."      # Emptied out.
  207.     SNATCH_RATE_TEXT   = "%1.2f%%"      # Percentage display for steal rate.
  208.     SNATCH_RATE_SIZE   = 20             # Font size used for rate text.
  209.    
  210.     # These settings adjust the sound effect played when a successful steal
  211.     # takes place and acquires one of the following item types:
  212.     STEAL_ITEM_SFX   = RPG::SE.new("Item3", 80, 150)    # Item stolen.
  213.     STEAL_WEAPON_SFX = RPG::SE.new("Equip1", 80, 150)   # Weapon stolen.
  214.     STEAL_ARMOUR_SFX = RPG::SE.new("Equip2", 80, 150)   # Armour stolen.
  215.     STEAL_GOLD_SFX   = RPG::SE.new("Coin", 80, 100)     # Gold stolen.
  216.    
  217.     # These settings here adjust the maximum and minimum success rates.
  218.     MAXIMUM_RATE = 0.9999
  219.     MINIMUM_RATE = 0.0001
  220.    
  221.     # Adjust the steal bonus rate (sbr) formula here. This is the bonus rate
  222.     # that is added onto steal rates.
  223.     STEAL_BONUS_RATE = "(user.luk/(512.0+user.luk))*0.3333"
  224.    
  225.     # If a weapon or piece of armour is stolen from an enemy, choose to lower
  226.     # the enemy's stats relative to the stats of the piece of equipment?
  227.     STEAL_LOWER_STATS = true
  228.    
  229.     # This sets the gold icon used for stealing items and shown in the snatch
  230.     # window when an item selected for stealing.
  231.     GOLD_ICON = 262
  232.    
  233.     # This is the description used for gold when gold is selected for snatching.
  234.     GOLD_DESCRIPTION    = "Steal some Gold, the currency used everywhere."
  235.     NOTHING_DESCRIPTION = "There is nothing to steal."
  236.    
  237.   end # STEAL
  238. end # YEA

  239. #==============================================================================
  240. # ▼ Editting anything past this point may potentially result in causing
  241. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  242. # halitosis so edit at your own risk.
  243. #==============================================================================

  244. module YEA
  245.   module REGEXP
  246.   module BASEITEM
  247.    
  248.     STEAL_RATE = /<(?:STEAL_RATE|steal rate):[ ]([\+\-]\d+)([%%])>/i
  249.     STEAL_ITEM_RATE =
  250.       /<(?:STEAL|steal)[ ](.*)[ ](?:RATE|rate):[ ]([\+\-]\d+)([%%])>/i
  251.    
  252.   end # BASEITEM
  253.   module USABLEITEM
  254.    
  255.     STEAL_BLIND = /<(.*)>/i
  256.     STEAL_BLIND_RATE = /<(.*):[ ]([\+\-]\d+)([%%])>/i
  257.     STEAL_ITEM  = /<(.*)[ ](.*)>/i
  258.     STEAL_ITEM_RATE = /<(.*)[ ](.*):[ ]([\+\-]\d+)([%%])>/i
  259.    
  260.   end # USABLEITEM
  261.   module ENEMY
  262.    
  263.     STEAL_ITEM = /<(?:STEAL|steal)[ ]([IWAG])(\d+):[ ](\d+)([%%])>/i
  264.     STEAL_RATE = /<(?:STEAL_RATE|steal rate):[ ]([\+\-]\d+)([%%])>/i
  265.    
  266.   end # ENEMY
  267.   end # REGEXP
  268. end # YEA

  269. #==============================================================================
  270. # ■ Icon
  271. #==============================================================================

  272. module Icon
  273.   
  274.   #--------------------------------------------------------------------------
  275.   # self.steal_gold
  276.   #--------------------------------------------------------------------------
  277.   def self.steal_gold; return YEA::STEAL::GOLD_ICON; end
  278.    
  279. end # Icon

  280. #==============================================================================
  281. # ■ Numeric
  282. #==============================================================================

  283. class Numeric
  284.   
  285.   #--------------------------------------------------------------------------
  286.   # new method: group_digits
  287.   #--------------------------------------------------------------------------
  288.   unless $imported["YEA-CoreEngine"]
  289.   def group; return self.to_s; end
  290.   end # $imported["YEA-CoreEngine"]
  291.    
  292. end # Numeric

  293. #==============================================================================
  294. # ■ DataManager
  295. #==============================================================================

  296. module DataManager
  297.   
  298.   #--------------------------------------------------------------------------
  299.   # alias method: load_database
  300.   #--------------------------------------------------------------------------
  301.   class <<self; alias load_database_steal load_database; end
  302.   def self.load_database
  303.     load_database_steal
  304.     load_notetags_steal
  305.   end
  306.   
  307.   #--------------------------------------------------------------------------
  308.   # new method: load_notetags_steal
  309.   #--------------------------------------------------------------------------
  310.   def self.load_notetags_steal
  311.     groups = [$data_enemies, $data_skills, $data_items, $data_actors,
  312.       $data_classes, $data_weapons, $data_armors, $data_states]
  313.     for group in groups
  314.       for obj in group
  315.         next if obj.nil?
  316.         obj.load_notetags_steal
  317.       end
  318.     end
  319.   end
  320.   
  321. end # DataManager

  322. #==============================================================================
  323. # ■ RPG::BaseItem
  324. #==============================================================================

  325. class RPG::BaseItem
  326.   
  327.   #--------------------------------------------------------------------------
  328.   # public instance variables
  329.   #--------------------------------------------------------------------------
  330.   attr_accessor :steal_rate
  331.   
  332.   #--------------------------------------------------------------------------
  333.   # common cache: load_notetags_steal
  334.   #--------------------------------------------------------------------------
  335.   def load_notetags_steal
  336.     @steal_rate = [0.0, 0.0, 0.0, 0.0, 0.0]
  337.     #---
  338.     self.note.split(/[\r\n]+/).each { |line|
  339.       case line
  340.       #---
  341.       when YEA::REGEXP::BASEITEM::STEAL_RATE
  342.         @steal_rate[0] = $1.to_i * 0.01
  343.       when YEA::REGEXP::BASEITEM::STEAL_ITEM_RATE
  344.         case $1.upcase
  345.         when "ITEM", "ITEMS"
  346.           @steal_rate[1] = $2.to_i * 0.01
  347.         when "WEAPON", "WEAPONS"
  348.           @steal_rate[2] = $2.to_i * 0.01
  349.         when "ARMOUR", "ARMOURS", "ARMOR", "ARMORS"
  350.           @steal_rate[3] = $2.to_i * 0.01
  351.         when "GOLD"
  352.           @steal_rate[4] = $2.to_i * 0.01
  353.         else; next
  354.         end
  355.       end
  356.     } # self.note.split
  357.     #---
  358.   end
  359.   
  360. end # RPG::BaseItem

  361. #==============================================================================
  362. # ■ RPG::UsableItem
  363. #==============================================================================

  364. class RPG::UsableItem < RPG::BaseItem
  365.   
  366.   #--------------------------------------------------------------------------
  367.   # public instance variables
  368.   #--------------------------------------------------------------------------
  369.   attr_accessor :steal_type
  370.   attr_accessor :steal_rate
  371.   attr_accessor :steal_kind
  372.   
  373.   #--------------------------------------------------------------------------
  374.   # common cache: load_notetags_steal
  375.   #--------------------------------------------------------------------------
  376.   def load_notetags_steal
  377.     @steal_type = nil
  378.     @steal_rate = [0.0, 0.0, 0.0, 0.0, 0.0]
  379.     @steal_kind = []
  380.     #---
  381.     self.note.split(/[\r\n]+/).each { |line|
  382.       case line
  383.       #---
  384.       when YEA::REGEXP::USABLEITEM::STEAL_ITEM_RATE
  385.         case $1.upcase
  386.         when "STEAL"
  387.           @steal_type = :steal
  388.         when "SNATCH"
  389.           @steal_type = :snatch
  390.         else; next
  391.         end
  392.         case $2.upcase
  393.         when "ITEM", "ITEMS"
  394.           @steal_kind.push(1)
  395.           @steal_rate[1] += $3.to_i * 0.01
  396.         when "WEAPON", "WEAPONS"
  397.           @steal_kind.push(2)
  398.           @steal_rate[2] += $3.to_i * 0.01
  399.         when "ARMOUR", "ARMOURS", "ARMOR", "ARMORS"
  400.           @steal_kind.push(3)
  401.           @steal_rate[3] += $3.to_i * 0.01
  402.         when "GOLD"
  403.           @steal_kind.push(4)
  404.           @steal_rate[4] += $3.to_i * 0.01
  405.         end
  406.       when YEA::REGEXP::USABLEITEM::STEAL_ITEM
  407.         case $1.upcase
  408.         when "STEAL"
  409.           @steal_type = :steal
  410.         when "SNATCH"
  411.           @steal_type = :snatch
  412.         else; next
  413.         end
  414.         case $2.upcase
  415.         when "ITEM", "ITEMS"
  416.           @steal_kind.push(1)
  417.         when "WEAPON", "WEAPONS"
  418.           @steal_kind.push(2)
  419.         when "ARMOUR", "ARMOURS", "ARMOR", "ARMORS"
  420.           @steal_kind.push(3)
  421.         when "GOLD"
  422.           @steal_kind.push(4)
  423.         end
  424.       when YEA::REGEXP::USABLEITEM::STEAL_BLIND_RATE
  425.         case $1.upcase
  426.         when "STEAL"
  427.           @steal_type = :steal
  428.         when "SNATCH"
  429.           @steal_type = :snatch
  430.         else; next
  431.         end
  432.         @steal_rate[0] += $2.to_i * 0.01
  433.         @steal_kind = [1, 2, 3, 4]
  434.       when YEA::REGEXP::USABLEITEM::STEAL_BLIND
  435.         case $1.upcase
  436.         when "STEAL"
  437.           @steal_type = :steal
  438.         when "SNATCH"
  439.           @steal_type = :snatch
  440.         else; next
  441.         end
  442.         @steal_kind = [1, 2, 3, 4]
  443.       end
  444.     } # self.note.split
  445.     #---
  446.   end
  447.   
  448. end # class RPG::UsableItem

  449. #==============================================================================
  450. # ■ RPG::Enemy
  451. #==============================================================================

  452. class RPG::Enemy < RPG::BaseItem
  453.   
  454.   #--------------------------------------------------------------------------
  455.   # public instance variables
  456.   #--------------------------------------------------------------------------
  457.   attr_accessor :stealable_items
  458.   attr_accessor :steal_rate
  459.   
  460.   #--------------------------------------------------------------------------
  461.   # common cache: load_notetags_steal
  462.   #--------------------------------------------------------------------------
  463.   def load_notetags_steal
  464.     @stealable_items = []
  465.     @steal_rate = 0.0
  466.     #---
  467.     self.note.split(/[\r\n]+/).each { |line|
  468.       case line
  469.       #---
  470.       when YEA::REGEXP::ENEMY::STEAL_ITEM
  471.         case $1.upcase
  472.         when "I"; type = 1
  473.         when "W"; type = 2
  474.         when "A"; type = 3
  475.         when "G"; type = 4
  476.         else; next
  477.         end
  478.         data_id = $2.to_i
  479.         rate = $3.to_i * 0.01
  480.         @stealable_items.push(RPG::Enemy::StealItem.new(type, data_id, rate))
  481.       when YEA::REGEXP::ENEMY::STEAL_RATE
  482.         @steal_rate = $1.to_i * 0.01
  483.       end
  484.     } # self.note.split
  485.     #---
  486.   end
  487.   
  488. end # RPG::Enemy

  489. #==============================================================================
  490. # ■ RPG::Enemy::StealItem
  491. #==============================================================================

  492. class RPG::Enemy::StealItem
  493.   
  494.   #--------------------------------------------------------------------------
  495.   # public instance variables
  496.   #--------------------------------------------------------------------------
  497.   attr_accessor :kind
  498.   attr_accessor :data_id
  499.   attr_accessor :rate
  500.   
  501.   #--------------------------------------------------------------------------
  502.   # initialize
  503.   #--------------------------------------------------------------------------
  504.   def initialize(kind = 0, data_id = 1, rate = 0.0)
  505.     @kind = kind
  506.     @data_id = data_id
  507.     @rate = rate
  508.   end
  509.   
  510. end # RPG::Enemy::StealItem

  511. #==============================================================================
  512. # ■ Game_Temp
  513. #==============================================================================

  514. class Game_Temp
  515.   
  516.   #--------------------------------------------------------------------------
  517.   # public instance variables
  518.   #--------------------------------------------------------------------------
  519.   attr_accessor :steal_skill
  520.   attr_accessor :snatch_target
  521.   
  522.   #--------------------------------------------------------------------------
  523.   # alias method: initialize
  524.   #--------------------------------------------------------------------------
  525.   alias game_temp_initialize_steal initialize
  526.   def initialize
  527.     game_temp_initialize_steal
  528.     @snatch_target = {}
  529.   end
  530.   
  531. end # Game_Temp

  532. #==============================================================================
  533. # ■ Game_ActionResult
  534. #==============================================================================

  535. class Game_ActionResult
  536.   
  537.   #--------------------------------------------------------------------------
  538.   # public instance variables
  539.   #--------------------------------------------------------------------------
  540.   attr_accessor :stolen_item
  541.   
  542.   #--------------------------------------------------------------------------
  543.   # alias method: clear_hit_flags
  544.   #--------------------------------------------------------------------------
  545.   alias game_actionresult_clear_hit_flags_steal clear_hit_flags
  546.   def clear_hit_flags
  547.     game_actionresult_clear_hit_flags_steal
  548.     @stolen_item = nil
  549.   end
  550.   
  551. end # Game_ActionResult

  552. #==============================================================================
  553. # ■ Game_BattlerBase
  554. #==============================================================================

  555. class Game_BattlerBase
  556.   
  557.   #--------------------------------------------------------------------------
  558.   # alias method: initialize
  559.   #--------------------------------------------------------------------------
  560.   alias game_battlerbase_initialize_steal initialize
  561.   def initialize
  562.     game_battlerbase_initialize_steal
  563.     init_stealable_items unless self.is_a?(Game_Enemy)
  564.   end
  565.   
  566.   #--------------------------------------------------------------------------
  567.   # new method: init_stealable_items
  568.   #--------------------------------------------------------------------------
  569.   def init_stealable_items; @stealable_items = []; end
  570.   
  571.   #--------------------------------------------------------------------------
  572.   # new method: stealable_items
  573.   #--------------------------------------------------------------------------
  574.   def stealable_items
  575.     init_stealable_items if @stealable_items.nil?
  576.     return @stealable_items
  577.   end
  578.   
  579.   #--------------------------------------------------------------------------
  580.   # new method: remove_stealable_item
  581.   #--------------------------------------------------------------------------
  582.   def remove_stealable_item(stealable_item)
  583.     init_stealable_items if @stealable_items.nil?
  584.     @stealable_items.delete(stealable_item)
  585.   end
  586.   
  587. end # Game_BattlerBase

  588. #==============================================================================
  589. # ■ Game_Battler
  590. #==============================================================================

  591. class Game_Battler < Game_BattlerBase
  592.   
  593.   #--------------------------------------------------------------------------
  594.   # alias method: item_user_effect
  595.   #--------------------------------------------------------------------------
  596.   alias game_battler_item_user_effect_steal item_user_effect
  597.   def item_user_effect(user, item)
  598.     game_battler_item_user_effect_steal(user, item)
  599.     execute_steal_effect(user, item)
  600.   end
  601.   
  602.   #--------------------------------------------------------------------------
  603.   # new method: execute_steal_effect
  604.   #--------------------------------------------------------------------------
  605.   def execute_steal_effect(user, item)
  606.     return if self.actor?
  607.     return if self.actor? == user.actor?
  608.     return if item.steal_type.nil?
  609.     return if stealable_items == []
  610.     apply_steal_effect(user, item) if item.steal_type == :steal
  611.     apply_snatch_effect(user, item) if item.steal_type == :snatch
  612.     lower_stats_steal_effect
  613.   end
  614.   
  615.   #--------------------------------------------------------------------------
  616.   # new method: apply_blind_steal_effect
  617.   #--------------------------------------------------------------------------
  618.   def lower_stats_steal_effect
  619.     return unless YEA::STEAL::STEAL_LOWER_STATS
  620.     return if @result.stolen_item.nil?
  621.     case @result.stolen_item.kind
  622.     when 2
  623.       item = $data_weapons[@result.stolen_item.data_id]
  624.     when 3
  625.       item = $data_armors[@result.stolen_item.data_id]
  626.     else; return
  627.     end
  628.     for i in 0...8
  629.       add_param(i, -item.params[i])
  630.     end
  631.   end
  632.   
  633.   #--------------------------------------------------------------------------
  634.   # new method: apply_steal_effect
  635.   #--------------------------------------------------------------------------
  636.   def apply_steal_effect(user, item)
  637.     for stealable_item in stealable_items
  638.       next unless item.steal_kind.include?(stealable_item.kind)
  639.       next unless (rand < calc_steal_ratio(user, item, stealable_item))
  640.       @result.stolen_item = stealable_item
  641.       @result.success = true
  642.       break
  643.     end
  644.   end
  645.   
  646.   #--------------------------------------------------------------------------
  647.   # new method: calc_steal_ratio
  648.   #--------------------------------------------------------------------------
  649.   def calc_steal_ratio(user, item, stealable_item)
  650.     rate = stealable_item.rate
  651.     rate += item.steal_rate[0]
  652.     rate += item.steal_rate[stealable_item.kind]
  653.     rate += eval(YEA::STEAL::STEAL_BONUS_RATE)
  654.     rate += user.bonus_steal_rate(0)
  655.     rate += user.bonus_steal_rate(stealable_item.kind)
  656.     rate += enemy.steal_rate
  657.     max_rate = YEA::STEAL::MAXIMUM_RATE
  658.     min_rate = YEA::STEAL::MINIMUM_RATE
  659.     return [[max_rate, rate].min, min_rate].max
  660.   end
  661.   
  662.   #--------------------------------------------------------------------------
  663.   # new method: apply_snatch_effect
  664.   #--------------------------------------------------------------------------
  665.   def apply_snatch_effect(user, item)
  666.     snatch_item = $game_temp.snatch_target[user]
  667.     return unless stealable_items.include?(snatch_item)
  668.     if rand < calc_steal_ratio(user, item, snatch_item)
  669.       @result.stolen_item = snatch_item
  670.       @result.success = true
  671.     end
  672.   end
  673.   
  674.   #--------------------------------------------------------------------------
  675.   # new method: bonus_steal_rate
  676.   #--------------------------------------------------------------------------
  677.   def bonus_steal_rate(kind)
  678.     n = 0.0
  679.     if actor?
  680.       n += self.actor.steal_rate[kind]
  681.       n += self.class.steal_rate[kind]
  682.       for equip in equips
  683.         next if equip.nil?
  684.         n += equip.steal_rate[kind]
  685.       end
  686.     end
  687.     for state in states
  688.       next if state.nil?
  689.       n += state.steal_rate[kind]
  690.     end
  691.     return n
  692.   end
  693.   
  694. end # Game_Battler

  695. #==============================================================================
  696. # ■ Game_Enemy
  697. #==============================================================================

  698. class Game_Enemy < Game_Battler
  699.   
  700.   #--------------------------------------------------------------------------
  701.   # alias method: initialize
  702.   #--------------------------------------------------------------------------
  703.   alias game_enemy_initialize_steal initialize
  704.   def initialize(index, enemy_id)
  705.     game_enemy_initialize_steal(index, enemy_id)
  706.     init_stealable_items
  707.   end
  708.   
  709.   #--------------------------------------------------------------------------
  710.   # new method: init_stealable_items
  711.   #--------------------------------------------------------------------------
  712.   def init_stealable_items
  713.     @stealable_items = enemy.stealable_items.clone
  714.   end
  715.   
  716. end # Game_Enemy

  717. #==============================================================================
  718. # ■ Window_StealList
  719. #==============================================================================

  720. class Window_StealList < Window_Selectable
  721.   
  722.   #--------------------------------------------------------------------------
  723.   # alias method: on_skill_ok
  724.   #--------------------------------------------------------------------------
  725.   def initialize(enemy_window)
  726.     wh = fitting_height(4)
  727.     super(0, Graphics.height - wh, Graphics.width, wh)
  728.     self.z = 200
  729.     deactivate
  730.     hide
  731.     @enemy_window = enemy_window
  732.     @enemy = nil
  733.   end
  734.   
  735.   #--------------------------------------------------------------------------
  736.   # col_max
  737.   #--------------------------------------------------------------------------
  738.   def col_max; return 2; end
  739.   
  740.   #--------------------------------------------------------------------------
  741.   # item_max
  742.   #--------------------------------------------------------------------------
  743.   def item_max; return @data ? @data.size : 1; end
  744.    
  745.   #--------------------------------------------------------------------------
  746.   # item
  747.   #--------------------------------------------------------------------------
  748.   def item; @data[index]; end
  749.   
  750.   #--------------------------------------------------------------------------
  751.   # current_item_enabled?
  752.   #--------------------------------------------------------------------------
  753.   def current_item_enabled?; return !item.nil?; end
  754.   
  755.   #--------------------------------------------------------------------------
  756.   # alias method: on_skill_ok
  757.   #--------------------------------------------------------------------------
  758.   def refresh
  759.     make_item_list
  760.     create_contents
  761.     draw_all_items
  762.     show
  763.     activate
  764.     select(0)
  765.   end
  766.   
  767.   #--------------------------------------------------------------------------
  768.   # alias method: on_skill_ok
  769.   #--------------------------------------------------------------------------
  770.   def make_item_list
  771.     @enemy = @enemy_window.enemy
  772.     @data = @enemy.stealable_items.select {|item| include?(item) }
  773.   end
  774.   
  775.   #--------------------------------------------------------------------------
  776.   # include?
  777.   #--------------------------------------------------------------------------
  778.   def include?(item); return steal_skill.steal_kind.include?(item.kind); end
  779.   
  780.   #--------------------------------------------------------------------------
  781.   # draw_item
  782.   #--------------------------------------------------------------------------
  783.   def draw_item(index)
  784.     item = @data[index]
  785.     return if item.nil?
  786.     rect = item_rect(index)
  787.     rect.width -= 4
  788.     reset_font_settings
  789.     draw_stolenitem_name(item, rect)
  790.     draw_item_rate(item, rect)
  791.   end
  792.   
  793.   #--------------------------------------------------------------------------
  794.   # draw_stolenitem_name
  795.   #--------------------------------------------------------------------------
  796.   def draw_stolenitem_name(stolen_item, rect)
  797.     case stolen_item.kind
  798.     when 1; item = $data_items[stolen_item.data_id]
  799.     when 2; item = $data_weapons[stolen_item.data_id]
  800.     when 3; item = $data_armors[stolen_item.data_id]
  801.     when 4
  802.       draw_gold(stolen_item, rect)
  803.       return
  804.     end
  805.     draw_item_name(item, rect.x, rect.y, true, rect.width - 24)
  806.   end
  807.   
  808.   #--------------------------------------------------------------------------
  809.   # draw_gold
  810.   #--------------------------------------------------------------------------
  811.   def draw_gold(stolen_item, rect)
  812.     draw_icon(Icon.steal_gold, rect.x, rect.y)
  813.     amount = stolen_item.data_id.group
  814.     amount += Vocab.currency_unit
  815.     draw_text(rect.x+24, rect.y, rect.width - 24, line_height, amount)
  816.   end
  817.   
  818.   #--------------------------------------------------------------------------
  819.   # steal_skill
  820.   #--------------------------------------------------------------------------
  821.   def steal_skill; return $game_temp.steal_skill; end
  822.   
  823.   #--------------------------------------------------------------------------
  824.   # draw_item_rate
  825.   #--------------------------------------------------------------------------
  826.   def draw_item_rate(stolen_item, rect)
  827.     user = BattleManager.actor
  828.     rate = @enemy.calc_steal_ratio(user, steal_skill, stolen_item)
  829.     fmt = YEA::STEAL::SNATCH_RATE_TEXT
  830.     text = sprintf(fmt, rate * 100.0)
  831.     contents.font.size = YEA::STEAL::SNATCH_RATE_SIZE
  832.     draw_text(rect, text, 2)
  833.   end
  834.   
  835.   #--------------------------------------------------------------------------
  836.   # update_help
  837.   #--------------------------------------------------------------------------
  838.   def update_help
  839.     if @data.nil? || item.nil?
  840.       @help_window.set_text(YEA::STEAL::NOTHING_DESCRIPTION)
  841.       return
  842.     end
  843.     case item.kind
  844.     when 1; @help_window.set_text($data_items[item.data_id].description)
  845.     when 2; @help_window.set_text($data_weapons[item.data_id].description)
  846.     when 3; @help_window.set_text($data_armors[item.data_id].description)
  847.     when 4; @help_window.set_text(YEA::STEAL::GOLD_DESCRIPTION)
  848.     end
  849.   end
  850.   
  851. end # Window_StealList

  852. #==============================================================================
  853. # ■ Scene_Battle
  854. #==============================================================================

  855. class Scene_Battle < Scene_Base
  856.   
  857.   #--------------------------------------------------------------------------
  858.   # alias method: on_skill_ok
  859.   #--------------------------------------------------------------------------
  860.   alias scene_battle_create_enemy_window_steal create_enemy_window
  861.   def create_enemy_window
  862.     scene_battle_create_enemy_window_steal
  863.     create_steallist_window
  864.   end
  865.   
  866.   #--------------------------------------------------------------------------
  867.   # alias method: on_skill_ok
  868.   #--------------------------------------------------------------------------
  869.   def create_steallist_window
  870.     wy = @help_window.height
  871.     @steallist_window = Window_StealList.new(@enemy_window)
  872.     @steallist_window.help_window = @help_window
  873.     @steallist_window.set_handler(:ok,     method(:on_steal_ok))
  874.     @steallist_window.set_handler(:cancel, method(:on_steal_cancel))
  875.   end
  876.   
  877.   #--------------------------------------------------------------------------
  878.   # alias method: on_enemy_ok
  879.   #--------------------------------------------------------------------------
  880.   alias scene_battle_on_enemy_ok_steal on_enemy_ok
  881.   def on_enemy_ok
  882.     if show_steal_window?
  883.       activate_steal_window
  884.     else
  885.       scene_battle_on_enemy_ok_steal
  886.     end
  887.   end
  888.   
  889.   #--------------------------------------------------------------------------
  890.   # new method: activate_steal_window
  891.   #--------------------------------------------------------------------------
  892.   def activate_steal_window
  893.     @steallist_window.refresh
  894.     if $imported["YEA-BattleEngine"]
  895.       @skill_window.hide
  896.       @item_window.hide
  897.       @status_aid_window.hide
  898.       @help_window.show
  899.     else
  900.       @info_viewport.visible = false
  901.       @enemy_window.hide
  902.     end
  903.   end
  904.   
  905.   #--------------------------------------------------------------------------
  906.   # new method: show_steal_window?
  907.   #--------------------------------------------------------------------------
  908.   def show_steal_window?
  909.     if @item_window.visible
  910.       $game_temp.steal_skill = @item_window.item
  911.     elsif @skill_window.visible
  912.       $game_temp.steal_skill = @skill_window.item
  913.     else
  914.       return false
  915.     end
  916.     return false if $game_temp.steal_skill.for_friend?
  917.     return false unless $game_temp.steal_skill.need_selection?
  918.     return $game_temp.steal_skill.steal_type == :snatch
  919.   end
  920.   
  921.   #--------------------------------------------------------------------------
  922.   # new method: on_steal_ok
  923.   #--------------------------------------------------------------------------
  924.   def on_steal_ok
  925.     $game_temp.snatch_target[BattleManager.actor] = @steallist_window.item
  926.     show_hidden_steal_windows
  927.     scene_battle_on_enemy_ok_steal
  928.   end
  929.   
  930.   #--------------------------------------------------------------------------
  931.   # new method: on_steal_cancel
  932.   #--------------------------------------------------------------------------
  933.   def on_steal_cancel
  934.     show_hidden_steal_windows
  935.     @enemy_window.show
  936.     @enemy_window.activate
  937.   end
  938.   
  939.   #--------------------------------------------------------------------------
  940.   # new method: show_hidden_steal_windows
  941.   #--------------------------------------------------------------------------
  942.   def show_hidden_steal_windows
  943.     @steallist_window.hide
  944.     if $imported["YEA-BattleEngine"]
  945.       @status_aid_window.show
  946.       @item_window.show if @actor_command_window.current_symbol == :item
  947.       @skill_window.show if @actor_command_window.current_symbol == :skill
  948.     else
  949.       @info_viewport.visible = true
  950.     end
  951.   end
  952.   
  953.   #--------------------------------------------------------------------------
  954.   # alias method: apply_item_effects
  955.   #--------------------------------------------------------------------------
  956.   alias scene_battle_apply_item_effects_steal apply_item_effects
  957.   def apply_item_effects(target, item)
  958.     scene_battle_apply_item_effects_steal(target, item)
  959.     apply_steal_results(target, item)
  960.   end
  961.   
  962.   #--------------------------------------------------------------------------
  963.   # new method: apply_steal_results
  964.   #--------------------------------------------------------------------------
  965.   def apply_steal_results(target, item)
  966.     return if target.actor?
  967.     return if item.steal_type.nil?
  968.     if target.stealable_items.empty?
  969.       fmt = YEA::STEAL::STEAL_EMPTY_TEXT
  970.       text = sprintf(fmt, target.name)
  971.     elsif target.result.stolen_item.nil?
  972.       fmt = YEA::STEAL::STEAL_FAIL_TEXT
  973.       text = sprintf(fmt, @subject.name)
  974.     else
  975.       fmt = YEA::STEAL::STEAL_SUCCESS_TEXT
  976.       actor = @subject.name
  977.       item = stolen_item_text(target)
  978.       enemy = target.name
  979.       text = sprintf(fmt, actor, item, enemy)
  980.     end
  981.     @log_window.add_text(text)
  982.     3.times do @log_window.wait end
  983.     @log_window.back_one
  984.   end
  985.   
  986.   #--------------------------------------------------------------------------
  987.   # new method: stolen_item_text
  988.   #--------------------------------------------------------------------------
  989.   def stolen_item_text(target)
  990.     stolen_item = target.result.stolen_item
  991.     target.remove_stealable_item(stolen_item)
  992.     case stolen_item.kind
  993.     when 1 # Item
  994.       YEA::STEAL::STEAL_ITEM_SFX.play
  995.       item = $data_items[stolen_item.data_id]
  996.     when 2 # Weapon
  997.       YEA::STEAL::STEAL_WEAPON_SFX.play
  998.       item = $data_weapons[stolen_item.data_id]
  999.     when 3 # Armour
  1000.       YEA::STEAL::STEAL_ARMOUR_SFX.play
  1001.       item = $data_armors[stolen_item.data_id]
  1002.     when 4 # Gold
  1003.       YEA::STEAL::STEAL_GOLD_SFX.play
  1004.       $game_party.gain_gold(stolen_item.data_id)
  1005.       fmt = "\ei[%d]%s%s"
  1006.       value = stolen_item.data_id.group
  1007.       return sprintf(fmt, Icon.steal_gold, value, Vocab.currency_unit)
  1008.     end
  1009.     $game_party.gain_item(item, 1)
  1010.     text = sprintf("\ei[%d]%s", item.icon_index, item.name)
  1011.     return text
  1012.   end
  1013.   
  1014. end # Scene_Battle

  1015. #==============================================================================
  1016. #
  1017. # ▼ End of File
  1018. #
  1019. #==============================================================================
复制代码
代码能复制吗
作者: 300英雄    时间: 2015-10-5 12:20
原来是用代码才能复制啊一直用引用搞得麻烦
作者: 百里_飞柳    时间: 2015-10-5 15:03
脚本里面不是有使用说明么……
而且你复制了这么多次干嘛?编辑掉吧
作者: 汪明杰    时间: 2015-10-5 22:35
看成了盗取别人脚本的系统的我内心是不是有些阴暗
作者: 300英雄    时间: 2015-10-6 14:17
我想说这个脚本怎么用




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1