查看: 1700|回复: 2

[已经解决] 两个外站脚本出错,求指引

[复制链接]
梦石
0
星屑
724
在线时间
685 小时
注册时间
2009-5-29
回帖
332
发表于 2012-12-26 23:28:46 | 显示全部楼层 |阅读模式

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

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

×
用了两个外站脚本:

第一个是被动效果:

[pre lang="ruby" line="1"]=begin
==============================================================================
** FP Passive Effects
Author: Tsukihime
Date: May 31, 2012
------------------------------------------------------------------------------
** Change log
May 31, 2012
   - added some support for enemy passive states
May 20, 2012
   - fixed a bug where parameter features were not being added
May 18, 2012
   - Added support for "no floor damage"
May 17, 2012
   - Added support for passive states
   - Added support for nickname changes
May 16, 2012
   - Added support for atk states
   
May 14, 2012
   -Initial release
------------------------------------------------------------------------------
This script adds passive effects
Currently it is used by the Select Skill system
to add passive effects to passive skills

The general syntax for passive effects is
   <fp:pe [type] [value]>
   
Where type is one of
   stype  (add/seal skill type)
   skill  (add/seal skill)
   wtype  (weapon type)
   atype  (armor type)
   etype  (equip type)
   party  (party feature)
   special (special feature)
   tile   (tile feature)
   state  (state ID)
   
The type can also be one of the 28 parameters, like
mhp, mmp, atk, or def

Do not use percent signs. Use multiplication if you
need percentages.
==============================================================================
=end
$imported = {} if $imported.nil?
$imported["FP_PassiveEffects"] = true
#==============================================================================
# ** Extended configuration. Mainly for vocabulary. Try not to change any
# contants
#==============================================================================
module Feature_Plus
  module Passive_Effect
  
    # default features. Same as defined in Game_BattlerBase
    FEATURE_ELEMENT_RATE  = 11              # Element Rate
    FEATURE_DEBUFF_RATE   = 12              # Debuff Rate
    FEATURE_STATE_RATE    = 13              # State Rate
    FEATURE_STATE_RESIST  = 14              # State Resist
    FEATURE_PARAM         = 21              # Parameter
    FEATURE_XPARAM        = 22              # Ex-Parameter
    FEATURE_SPARAM        = 23              # Sp-Parameter
    FEATURE_ATK_ELEMENT   = 31              # Atk Element
    FEATURE_ATK_STATE     = 32              # Atk State
    FEATURE_ATK_SPEED     = 33              # Atk Speed
    FEATURE_ATK_TIMES     = 34              # Atk Times+
    FEATURE_STYPE_ADD     = 41              # Add Skill Type
    FEATURE_STYPE_SEAL    = 42              # Disable Skill Type
    FEATURE_SKILL_ADD     = 43              # Add Skill
    FEATURE_SKILL_SEAL    = 44              # Disable Skill
    FEATURE_EQUIP_WTYPE   = 51              # Equip Weapon
    FEATURE_EQUIP_ATYPE   = 52              # Equip Armor
    FEATURE_EQUIP_FIX     = 53              # Lock Equip  
    FEATURE_EQUIP_SEAL    = 54              # Seal Equip
    FEATURE_SLOT_TYPE     = 55              # Slot Type
    FEATURE_ACTION_PLUS   = 61              # Action Times+
    FEATURE_SPECIAL_FLAG  = 62              # Special Flag
    FEATURE_COLLAPSE_TYPE = 63              # Collapse Effect
    FEATURE_PARTY_ABILITY = 64              # Party Ability
   
    # Custom features
    FEATURE_PARAM_BONUS   = 24 # default parameter bonus just multiplies...
    FEATURE_SEAL_WTYPE    = 56
    FEATURE_SEAL_ATYPE    = 57
    FEATURE_PASSIVE_STATE = 105
    FEATURE_NICKNAME_CHANGE = 106
    FEATURE_TILE_EFFECT = 108
   
    Elements ={   "physical" => 0,
                  "absorb"   => 1,
                  "fire"     => 2,
                  "ice"      => 3,
                  "thunder"  => 4,
                  "water"    => 5,
                  "earth"    => 6,
                  "wind"     => 7,
                  "holy"     => 8,
                  "dark"     => 9
              }
  
    Param_List = { "mhp"    => 0,
                   "mmp"    => 1,
                   "atk"    => 2,
                   "def"    => 3,
                   "mat"    => 4,
                   "mdf"    => 5,
                   "agi"    => 6,
                   "luk"    => 7
                }
    XParam_List = {"hit"    => 0,
                   "eva"    => 1,
                   "cri"    => 2,
                   "cev"    => 3,
                   "mev"    => 4,
                   "mrf"    => 5,
                   "cnt"    => 6,
                   "hrg"    => 7,
                   "mrg"    => 8,
                   "trg"    => 9
                  }
                  
    SParam_List = { "tgr"   => 0,
                    "grd"   => 1,
                    "rec"   => 2,
                    "pha"   => 3,
                    "mcr"   => 4,
                    "tcr"   => 5,
                    "pdr"   => 6,
                    "mdr"   => 7,
                    "fdr"   => 8,
                    "exr"   => 9
                  }
                  
    Passive_Table =
    { "enchalf"  => 0,          #half encounter rate
      "encnone"  => 1,          #zero encounter rate
      "noback"   => 2,          #no surprise attacks (enemy attacks first)
      "preemp"   => 3,          #raise pre-emptive rate
      "goldrate" => 4,          #doubles gold drop
      "droprate" => 5,          #doubles item droprate
                     
      "auto"  => 0,             # auto battle
      "guard" => 1,             # always guard?
      "sub"   => 2,             # substitute, not sure
      "tp"    => 3,             # preserve TP
      
      "nodmg" => 0              # no damage from damage tiles
     }
                  
    Feature_Table =
    {"+stype"  => FEATURE_STYPE_ADD,
     "+skill"  => FEATURE_SKILL_ADD,
     "+wtype"  => FEATURE_EQUIP_WTYPE,
     "+atype"  => FEATURE_EQUIP_ATYPE,
     "party"   => FEATURE_PARTY_ABILITY,
     "special" => FEATURE_SPECIAL_FLAG,
     "tile"    => FEATURE_TILE_EFFECT,
     
     
     # Sealing features
     "-stype" => FEATURE_STYPE_SEAL,
     "-skill" => FEATURE_SKILL_SEAL,
     "-etype" => FEATURE_EQUIP_SEAL
    }
     
    # regex
    Passive_Param = /<fp:pe:?\s*(\w+)\s*(.*)>/i
    Passive_Feature = /<fp:pe:?\s*(\w*)\s*(\w*)\s*>/i
    Passive_Nickname = /<fp:pe:?\s*title\s*(.*)>/i
    Passive_Mod_Skill = /<fp:pe:?\s*skill\s*([+-])\s*(\d+)\s*>/i
    Passive_Mod_Stype = /<fp:pe:?\s*stype\s*([+-])\s*(\d+)\s*>/i
    Passive_Mod_Wtype = /<fp:pe:?\s*wtype\s*([+-])\s*(\d+)\s*>/i
    Passive_Mod_Atype = /<fp:pe:?\s*atype\s*([+-])\s*(\d+)\s*>/i
   
    Passive_Atk_State = /<fp:pe:?\s*astate\s*(\d+)\s*>/i
    Passive_State = /<fp:pe:?\s*state\s*(\d+)\s*>/i
    Passive_Tile = /fp:pe:?\s*tile\s*(\d+)\s*>/i
     
    def add_param_feature(features, param, value)
      list = [Param_List, XParam_List, SParam_List].select {|list| list.include?(param)}[0]
      return unless list
      data_id = list[param]
      code = FEATURE_PARAM_BONUS if list == Param_List
      code = FEATURE_XPARAM if list == XParam_List
      code = FEATURE_SPARAM if list == SParam_List
      return unless data_id
      features << RPG::BaseItem::Feature.new(code, data_id, value)
    end
   
    def add_op_feature(features, op, cmd)
      code = Feature_Table[op << cmd]
      return unless code
      features << RPG::BaseItem::Feature.new(code, data_id)
    end
   
    def add_passive_feature(features, cmd, value)
      code = Feature_Table[cmd]
      data_id = Passive_Table[value]
      if not code
        add_param_feature(features, cmd, value)
      else
        features << RPG::BaseItem::Feature.new(code, data_id)
      end
    end
   
    def add_passive_state(features, data_id)
      code = FEATURE_PASSIVE_STATE
      features << RPG::BaseItem::Feature.new(code, data_id)
    end
   
    def add_nickname_feature(features, value)
      code = FEATURE_NICKNAME_CHANGE
      features << RPG::BaseItem::Feature.new(code, 0, value)
    end
   
    def add_value_feature(features, code, data_id, value=0)
      features << RPG::BaseItem::Feature.new(code, data_id, value)
    end
   
    def add_atk_state_feature(state_id)
      code = FEATURE_ATK_STATE
      data_id = state_id
      return unless data_id
      add_feature(code, data_id, 100)
    end
  end
end

module RPG
  class BaseItem
    include Feature_Plus::Passive_Effect
   
    alias :fp_pe_init_rpg_baseitems :initialize
    def initialize
      fp_pe_init_rpg_baseitems
      load_notetags_passive_effects
    end      
   
    def load_notetags_passive_effects
      self.note.split(/[\r\n]+/).each do |line|
        case line
        when Passive_Mod_Skill
        when Passive_Mod_Stype
        when Passive_Mod_Wtype
        when Passive_Mod_Atype
          #format: [+/-, ID]
          add_op_feature(@features, $1, $2.to_i)
        when Passive_Atk_State
          feature = add_atk_state_feature($1.to_i)
          @features << feature unless feature.nil?
        when Passive_State
          add_passive_state(@features, $1.to_i)
        when Passive_Nickname
          add_nickname_feature(@features, $1)
        when Passive_Feature
          add_passive_feature(@features, $1.downcase, $2)
        when Passive_Param
          #format: [param, formula]
          add_param_feature(@features, $1.downcase, $2)
        end
      end
    end  
  end
end

module DataManager
  
  class << self
    alias fp_pe_load_database load_database
    alias fp_pe_init init
  end
  
  def self.init
    fp_pe_init
    load_notetags_passive_effects
  end
  
  def self.load_database
    fp_pe_load_database
    if $BTEST
      load_notetags_passive_effects
    end
  end
   
  def self.load_notetags_passive_effects
    groups = [$data_skills, $data_items, $data_weapons, $data_armors,
              $data_actors, $data_classes, $data_states, $data_enemies]
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_notetags_passive_effects
      end
    end
  end
end

class Game_BattlerBase
  include Feature_Plus::Passive_Effect
  
  alias :fp_pe_initialize_bbase :initialize
  def initialize
    @passive_states = []
    fp_pe_initialize_bbase
  end
  
  alias :fp_pe_refresh_bbase :refresh
  def refresh
    refresh_passive_states
    fp_pe_refresh_bbase
  end
  
  def refresh_passive_states
    @passive_states = features_set(FEATURE_PASSIVE_STATE)
    @passive_states.each do |state_id|
      p state_id
      add_state(state_id)
    end
  end
  
  # A special feature sum that calls eval
  def eval_features_sum(code, id, a)
    features_with_id(code, id).inject(0.0) {|r, ft|
    r += eval(ft.value) rescue 0 }
  end
  
  def get_passive_param(param_id)
    eval_features_sum(FEATURE_PARAM_BONUS, param_id, self)
  end
  
  def get_nickname
    nicknames = features_with_id(FEATURE_NICKNAME_CHANGE, 0)
    return "" if nicknames.empty?
    return nicknames[0].value
  end
end

class Game_Battler < Game_BattlerBase
  def clear_param_plus
    super
    @passive_params = [0] * 8
  end
  
  def update_passive_params
    8.times do |i|
      @passive_params = get_passive_param(i)
    end
  end

  def param_plus(param_id)
    @passive_params[param_id] + super
  end
end

class Game_Actor < Game_Battler
  
  alias fe_actor_initialize initialize
  def initialize(actor_id)
    fe_actor_initialize(actor_id)
    refresh
  end
  
  alias fe_actor_refresh refresh
  def refresh
    update_passive_params
    update_nickname
    fe_actor_refresh
  end
  
  def update_nickname
    new_nick = get_nickname
    @nickname = new_nick.empty? ? actor.nickname : new_nick
  end
  
  # don't show message for passive states
  def show_added_states
    @result.added_state_objects.each do |state|
      $game_message.add(name + state.message1) unless state.message1.empty? || @passive_states.include?(state.id)
    end
  end
  
  def no_floor_damage?
    !features_with_id(FEATURE_TILE_EFFECT, 0).empty?
  end
  
  alias fp_pe_execute_floor_damage execute_floor_damage
  def execute_floor_damage
    return if no_floor_damage?
    fp_pe_execute_floor_damage
  end
  
  #what limits
  def param_max(param_id)
    return 9999999
  end
end

class Game_Enemy
  
  alias :fp_pe_make_enemy_actions :make_actions
  def make_actions
    refresh_passive_states
    fp_pe_make_enemy_actions
  end
end[/pre]

第二个是技能选择:

[pre lang="ruby" line="1"]=begin
==============================================================================
** Skill Select System
Author: Tsukihime
Date: Aug 7, 2012
------------------------------------------------------------------------------
** Change log
Aug 7
   -changed skill sets to store skill ID's rather than skill objects,
    because the objects themselves are not the same when the game reloads
Jul 22
   -fixed bug where drawing skill cost crashed
   -fixed bug where skill slots were not updated upon level
May 29
   -fixed bug where $import variables were not initialized
May 27
   -fixed a bug where passive skill effects weren't working
May 24
   -refactored code, removed unnecessary window definitions
   -Initialized all RPG classes
May 18, 2012
   -Added compatibility for Monster Hunter script so recruited enemies
    have skillpoints and skill slots
   -added skill icons
May 17, 2012
   -added more "skill_conditions_met?" requirements
   -added extra refresh calls when skills are assigned/unassigned
   -fixed major bug where checking for free slots on the actor
    was not performed correctly
May 14, 2012
   -added support for skillpoint growth formulas
   -separated passive effects code to another script
   -fixed bug where added/removed skills were not
    updated on access to battle setup sceene
   -added passive support for all parameters
   -added passive support for party features
   -added passive support for special features
   -added passive support for adding/sealing skill types
   -added passive support for adding/sealing skills
   -added passive support for adding weapon/armor types
May 8
   -added simple passive effects for base parameters
   -fixed a small bug where test battle crashes
   -added option to turn off skillpoint system
   -added skillpoint system
   -added skillpoint cost for skills
   -switched to notetags for "active" or "passive" skills
   -"normal" skills do not need to be assigned by default
May 7, 2012
   -initialize release
------------------------------------------------------------------------------
This script changes the default skill system by
allowing players to only select a certain number
of skills that they can bring into battle.

In this system, there are three "selection types"
for skills

   1 - "normal" skills
   2 - "active" skills
   3 - "passive" skills
   
To specify a select type, tag the skill with

    <select: type>
   
Normal skills are the default select type for skills.
They can be used in battle as long as you have learned it
   
Active skills are skills that require you to equip
in order to use in battle.

Passive skills are skills whose effects will be activated
as long as the skill is equipped.

The battle setup menu is accessed through the menu.

The skills are grouped by skill type, and the equipped
skills are displayed on the left. The top window shows the
active skills, while the bottom window shows the passive
skills.

If you have skill slots available, you can select a skill
by selecting it from the main skill list. To remove it
from the list, just select it again. Equipping a skill
requires a certain amount of skill points, and you can
only equip a skill if you have enough skill points.

You can use the left-key or right-key move
between the battle skill lists and your main skill list.

Selecting any of the skills in your battle skill list will
remove them from the list. While you're at the active
skill list, you can press pageup or pagedown to scroll
between the passive skill list.

The max number of skills from either category is limited
by the max number of skills for your particular actor.
The max number of skills may grow depending on your
actor's level, specified by the amounts you write in
each actor's noteboxes.

The syntax for this is
   <max active>
   1:1, 5:2, 10:3
   16:4
   23:5
   </max active>

The same applies for passive skills; simply replace "active"
with "passive".

You define the skillpoint cost for each skill and the skill select type
through the Skills tab in the database.

<select: active> - specifies the selection type
<sp: 2> - specifies the skillpoint cost

To define the actor's skillpoint growth, you add the following
tag to the actor
    <SP: level*3>
   
To indicate that the amount of skillpoints received at each level
is three times the current level. You will need to use the exact
word "level" if you want to refer to the actor's level.

In order to set up passive skills, you must tag your skills with the
appropriate passive effects defined in FP: Passive Effects script,
and then make sure that your skill is tagged as a passive select type.
==============================================================================
=end
$imported = {} if $imported.nil?
$imported["Tsuki_SkillSelect"] = true
#==============================================================================
# ** Configuration
#==============================================================================
module Tsuki
  module Battle_Skill
    Command_Name = "Battle Skills"
    Handler = :battle_skill
    Enabled = true
    Access = true
   
    #toggle whether skill points should be used
    Use_SkillPoint_System = true
    Use_SkillLimit_System = true
   
    # Number of skill sets you can have. Currently only one supported
    Num_Skillsets = 5
   
    # Select type names #
    # normal does not require assignment to use in battle
    Normal_Name = "Normal"
   
    # these require assignment to use in battle
    Active_Name = "Active"
    Passive_Name = "Passive"
   
    # Number of skillpoints you can have at most
    Skillpoint_Limit = 9999
    Skillpoint_Growth = "level + 30"
   
    # The color that is used to highlight selected skills
    Selected_Color = Color.new(255, 215, 0, 255)
    Skillpoint_Color = Color.new(255, 128, 0, 255)
   
   
    # skill regex
    Select_Type = /<select\s*:\s*([^,]*)>/i
    Skillpoint_Cost = /<sp\s*:\s*([^,]*)>/i
   
    # actor regex
    Max_Active_On = /<(?:MAX_ACTIVE|max active)>/i
    Max_Active_Off = /<\/(?:MAX_ACTIVE|max active)>/i
    Max_Passive_On = /<(?:MAX_PASSIVE|max passive)>/i
    Max_Passive_Off = /<\/(?:MAX_PASSIVE|max passive)>/i
    Level_Value = /(\d+):\s*(\d+),*/
    Skillpoint_Growth = /<SP:?\s*(.+)>/
  end
end

#==============================================================================
# ** Rest of the script
#==============================================================================

#==============================================================================
# ** RPG::Skill
#------------------------------------------------------------------------------
#  Add skillpoint cost and selection type to Skill objects
#==============================================================================

module RPG
  class Skill < UsableItem
    include Tsuki::Battle_Skill
   
    attr_accessor :select_type
    attr_accessor :skillpoint_cost
   
    alias :th_skill_select_init_rpg_skill :initialize
    def initialize
      th_skill_select_init_rpg_skill
      load_notetags_skill_select
    end
   
    def skillpoint_cost
      return @skillpoint_cost unless @skillpoint_cost.nil?
      load_notetags_skill_select
      return @skillpoint_cost
    end
   
    def select_type
      return @select_type unless @select_type.nil?
      load_notetags_skill_select
      return @select_type
    end
   
    def load_notetags_skill_select
      @skillpoint_cost = 0
      @select_type = Normal_Name
      self.note.split(/[\r\n]+/).each do |line|
        case line
        when Select_Type
          case $1.upcase
          when Active_Name.upcase
            @select_type = Active_Name
          when Passive_Name.upcase
            @select_type = Passive_Name
          end
        when Skillpoint_Cost
          @skillpoint_cost = $1.to_i
        end
      end
    end  
  end

  class Actor < BaseItem
    include Tsuki::Battle_Skill
   
    attr_accessor :active_skill_levels
    attr_accessor :passive_skill_levels
    attr_accessor :skillpoint_growth
   
    alias :th_skill_select_init_rpg_actor :initialize
    def initialize
      th_skill_select_init_rpg_actor
      load_notetags_skill_select
    end
   
    def load_notetags_skill_select
      @active_skill_levels = {}
      @passive_skill_levels = {}
      @skillpoint_growth = ""
      self.note.split(/[\r\n]+/).each do |line|
        case line
        when Skillpoint_Growth
          @skillpoint_growth = $1
        when Max_Active_On
          @max_active_on = true
        when Max_Active_Off
          @max_active_on = false
        when Max_Passive_On
          @max_passive_on = true
        when Max_Active_Off
          @max_passive_on = false
        when Level_Value
          next unless @max_active_on || @max_passive_on
          line.scan(Level_Value).each do |match|
            level = match[0].to_i
            value = match[1].to_i
            if @max_active_on
              @active_skill_levels[level] = value
            elsif @max_passive_on
              @passive_skill_levels[level] = value
            end
          end
        end
      end
    end
  end
  
  class Enemy < BaseItem
    include Tsuki::Battle_Skill
   
    attr_accessor :active_skill_levels
    attr_accessor :passive_skill_levels
    attr_accessor :skillpoint_growth
   
    alias :th_skill_select_init_rpg_enemy :initialize
    def initialize
      th_skill_select_init_rpg_enemy
      load_notetags_skill_select
    end
   
    def load_notetags_skill_select
      @active_skill_levels = {}
      @passive_skill_levels = {}
      @skillpoint_growth = ""
      self.note.split(/[\r\n]+/).each do |line|
        case line
        when Skillpoint_Growth
          @skillpoint_growth = $1
        when Max_Active_On
          @max_active_on = true
        when Max_Active_Off
          @max_active_on = false
        when Max_Passive_On
          @max_passive_on = true
        when Max_Active_Off
          @max_passive_on = false
        when Level_Value
          next unless @max_active_on || @max_passive_on
          line.scan(Level_Value).each do |match|
            level = match[0].to_i
            value = match[1].to_i
            if @max_active_on
              @active_skill_levels[level] = value
            elsif @max_passive_on
              @passive_skill_levels[level] = value
            end
          end
        end
      end
    end
  end
end

#==============================================================================
# ** DataManager
#------------------------------------------------------------------------------
#  Initialize custom notetags
#==============================================================================

module DataManager
  
  class << self
    alias tsuki_skill_select_load_database load_database
    alias tsuki_skill_select_init init
  end
  
  def self.init
    tsuki_skill_select_init
    load_notetags_skill_select
  end
  
  def self.load_database
    tsuki_skill_select_load_database
    if $BTEST
      load_notetags_skill_select
    end
  end
   
  def self.load_notetags_skill_select
    groups = [$data_actors, $data_enemies]
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_notetags_skill_select
      end
    end
  end
end

#==============================================================================
# ** Game_Skillset
#------------------------------------------------------------------------------
# A Skill Set object. This stores a set of skills that the actor
# is currently using
#==============================================================================

class Game_Skillset
  
  attr_reader :id
  def initialize(index)
    @id = index + 1
    @skills = {}
    setup
    update_cost
  end
  
  def setup
    @skills[Tsuki::Battle_Skill::Passive_Name] = []
    @skills[Tsuki::Battle_Skill::Active_Name] = []
  end
  
  def [](type)
    @skills[type] ||= []
  end
  
  def include?(skill)
    @skills[skill.select_type].include?(skill.id)
  end
  
  def add_skill(skill)
    @skills[skill.select_type] = [] if @skills[skill.select_type].nil?
    @skills[skill.select_type] << skill.id
    update_cost
  end
  
  def remove_skill(skill)
    index = @skills[skill.select_type].index(skill.id)
    if index
      @skills[skill.select_type].delete_at(index)
      update_cost
    end
  end
  
  def update_skills(learned_skills)
    @skills[Tsuki::Battle_Skill::Passive_Name] = @skills[Tsuki::Battle_Skill::Passive_Name].select{|skill| learned_skills.include?(skill.id)}
    update_cost
  end
  
  def passive_skills
    @skills[Tsuki::Battle_Skill::Passive_Name]
  end
  
  def active_skills
    @skills[Tsuki::Battle_Skill::Active_Name]
  end
  
  def update_cost
    @total_cost = 0
    skills.each do |skill|
      @total_cost += skill.skillpoint_cost
    end
  end
  
  def skills
    @skills.values.flatten.collect {|id| $data_skills[id]}
  end
  
  def cost
    @total_cost
  end
  
  def size
    @skills.size
  end
end

#==============================================================================
# ** Game_Skillsets
#------------------------------------------------------------------------------
# This class holds a set of skills that the actor has. It manages skill sets
# such as returning the current set and switching the current set
#==============================================================================
class Game_Skillsets
  
  attr_accessor :current
  def initialize
    @data = []
    @current = 0
    setup_skillsets
  end
  
  def num_skillsets
    Tsuki::Battle_Skill::Num_Skillsets
  end
  
  def setup_skillsets
    num_skillsets.times do |i|
      @data << Game_Skillset.new(i)
    end
  end
  
  def next_skillset
    @current = [@current + 1, num_skillsets - 1].min
  end
  
  def prev_skillset
    @current = [0, @current - 1].max
  end
  
  def [](index)
    @data[index]
  end
  
  def current_skillset
    @data[@current]
  end
end

#==============================================================================
# ** Game_BattlerBase
#------------------------------------------------------------------------------
# Initialize skill parameter effects
#==============================================================================

class Game_BattlerBase
  include Tsuki::Battle_Skill

  alias tsuki_skill_select_bbase_initialize initialize
  def initialize
    tsuki_skill_select_bbase_initialize
    @skillsets = Game_Skillsets.new
  end
end

#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#
#==============================================================================
  
class Game_Actor < Game_Battler
  include Tsuki::Battle_Skill
  
  attr_accessor :battle_skills        #list of skills for use in battle
  attr_accessor :max_active_skills    #number of active skills actor can have
  attr_accessor :max_passive_skills   #number of passive skills actor can have
  attr_accessor :max_skillpoints
  attr_accessor :current_skillpoints
  attr_accessor :current_skillset
  
  alias tsuki_battleSkill_actor_setup setup
  def setup(actor_id)
    tsuki_battleSkill_actor_setup(actor_id)
    @skillsets = Game_Skillsets.new
    @max_active_skills = 1
    @max_passive_skills = 1
    @active_skill_levels = actor.active_skill_levels ? actor.active_skill_levels : {}
    @passive_skill_levels = actor.passive_skill_levels ? actor.passive_skill_levels : {}
    @sp_formula = actor.skillpoint_growth
    @max_skillpoints = calculate_skillpoints
    @current_skillpoints = @max_skillpoints
    set_max_active
    set_max_passive
  end
  
  alias tsuki_skill_select_actor_features feature_objects
  def feature_objects
    current_skillset.passive_skills + tsuki_skill_select_actor_features
  end

  def skill_conditions_met?(skill)
    (skill.select_type == Normal_Name || current_skillset.active_skills.include?(skill.id)) && super
  end
   
  def current_skillset
    return unless @skillsets
    @skillsets.current_skillset
  end
  
  def set_max_active
    active = 1
    @active_skill_levels.each do |level, value|
      active = value if @level >= level
    end
    @max_active_skills = active
  end
   
  def set_max_passive
    passive = 1
    @passive_skill_levels.each do |level, value|
      passive = value if @level >= level
    end
    @max_passive_skills = passive
  end
  
  def gain_passive_slot
    @max_passive_skills
  end
  
  def gain_active_slot
  end
   
  #already maxed out
  def skillset_exceeded?(select_type)
    case select_type
    when Tsuki::Battle_Skill::Active_Name
      current_skillset[select_type].size >= @max_active_skills
    when Tsuki::Battle_Skill::Passive_Name
      current_skillset[select_type].size >= @max_passive_skills
    end
  end
  
  def enough_skillpoints?(skill)
    skill.skillpoint_cost <= @current_skillpoints
  end
  
  #check if we can assign the skill
  def can_assign?(skill)
    return true unless Tsuki::Battle_Skill::Use_SkillLimit_System
    return false unless skill
    return false if current_skillset.skills.include?(skill)
    return false if skillset_exceeded?(skill.select_type)
    return false unless enough_skillpoints?(skill)
    return true
  end
  
  def assign_skill(skill)
    current_skillset.add_skill(skill) if can_assign?(skill)
    update_skillset
    update_skillpoints
    refresh
  end
  
  def unassign_skill(skill)
    current_skillset.remove_skill(skill)
    update_skillset
    update_skillpoints
    refresh
  end
  
  def update_skillset
    current_skillset.update_skills(@skills | added_skills)
  end
  
  def skillpoint_limit
    Tsuki::Battle_Skill::Skillpoint_Limit
  end
  
  def calculate_skillpoints(level=self.level)
    [Kernel.eval(@sp_formula), 0].max rescue 0
  end
  
  def gain_skillpoints(val)
    @max_skillpoints = [[@max_skillpoints + val, skillpoint_limit].min, 0].max
    update_skillpoints
  end
  
  def lose_skillpoints(val)
    gain_skillpoints(-val)
  end
  
  def update_skillpoints   
    @current_skillpoints = [@max_skillpoints - current_skillset.cost, 0].max
  end
  
  def next_skillset
    @skillsets.next_skillset
    update_skillpoints
  end
  
  def prev_skillset
    @skillsets.prev_skillset
    update_skillpoints
  end
  
  def update_skill_slots
    set_max_active
    set_max_passive
  end

  #add skillpoints when actor levels up
  alias tsuki_skill_select_level_up level_up
  def level_up
    tsuki_skill_select_level_up
    gain_skillpoints(calculate_skillpoints)
    update_skill_slots
  end
  
  #lose skillpoints when actor levels down
  alias tsuki_skill_select_level_down level_down
  def level_down
    tsuki_skill_select_level_down
    lose_skillpoints(calculate_skillpoints(self.level + 1))
    update_skill_slots
  end
end

#==============================================================================
# ** Update menu scene to add option and add some flags to game system
#==============================================================================

class Game_System
  attr_accessor :battleskill_disabled
  attr_accessor :battleskill_noshow
  
  alias tsuki_skill_select_system_initialize initialize
  def initialize
    tsuki_skill_select_system_initialize
    @battleskill_disabled = false
    @battleskill_noshow = false
  end
end

#==============================================================================
# ** Game_Interpreter
#------------------------------------------------------------------------------
# Convenience methods for the interpreter
#==============================================================================

class Game_Interpreter
  
  def enable_skill_select
    $game_system.battleskill_disabled = false
  end
  
  def disable_skill_select
    $game_system.battleskill_disabled = true
  end
  
  def show_skill_select
    $game_system.battleskill_noshow = false
  end
  
  def hide_skill_select
    $game_system.battleskill_noshow = true
  end
  
  def gain_sp(index, val)
    $game_party.all_members[index].gain_skillpoints(val)
  end
  
  def lose_sp(index, val)
    $game_party.all_members[index].lose_skillpoints(val)
  end
end

class Window_MenuCommand < Window_Command
  #--------------------------------------------------------------------------
  # * Add menu command to List
  #--------------------------------------------------------------------------
  alias tsuki_skill_select_commands add_main_commands
  def add_main_commands
    tsuki_skill_select_commands
    if !$game_system.battleskill_noshow
      add_command(Tsuki::Battle_Skill::Command_Name, Tsuki::Battle_Skill::Handler, !$game_system.battleskill_disabled)
    end
  end
end

class Scene_Menu < Scene_MenuBase
  #--------------------------------------------------------------------------
  # * Add menu handler
  #--------------------------------------------------------------------------
  alias tsuki_skill_select_command_window create_command_window
  def create_command_window
    tsuki_skill_select_command_window
    if !$game_system.battleskill_disabled
      @command_window.set_handler(Tsuki::Battle_Skill::Handler, method(:command_personal))
    end
  end
  
  alias tsuki_skill_select_personal_ok on_personal_ok
  def on_personal_ok
    case @command_window.current_symbol
    when Tsuki::Battle_Skill::Handler
      SceneManager.call(Scene_Skill_Select)
    end
    tsuki_skill_select_personal_ok
  end
end

class Window_battleSkillHelp < Window_Base
  
  def initialize(x, y, width, height)
    super(x, y, width, height)
  end
  #--------------------------------------------------------------------------
  # * Set Text
  #--------------------------------------------------------------------------
  def set_text(text)
    if text != @text
      @text = text
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # * Clear
  #--------------------------------------------------------------------------
  def clear
    set_text("")
  end
  #--------------------------------------------------------------------------
  # * Set Item
  #     item : Skills and items etc.
  #--------------------------------------------------------------------------
  def set_item(item)
    set_text(item ? item.description : "")
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_text_ex(4, 0, @text)
  end
end

#Displays actor info
class Window_battleSkillStatus < Window_Base
  
  def initialize(x, y, width, height)
    super(x, y, width, height)
    @actor = nil
  end
  
  def skillpoints_enabled?
    Tsuki::Battle_Skill::Use_SkillPoint_System
  end
  #--------------------------------------------------------------------------
  # * Set Actor
  #--------------------------------------------------------------------------
  def actor=(actor)
    return if @actor == actor
    @actor = actor
    @actor.update_skillset
    @actor.update_skillpoints
    refresh
    self.oy = 0
  end
  
  def draw_skillset_number
    return unless @actor
    set_id = @actor.current_skillset.id
    set_name = "Set %d" %set_id
    text_width = text_size(set_name).width
    change_color(normal_color)
    draw_text(130 - text_width, 10, width, line_height, set_name)
  end
  
  def draw_skillpoints
    return unless @actor
    text_width = text_size(@actor.current_skillpoints).width
    change_color(Tsuki::Battle_Skill::Skillpoint_Color)
    draw_text(130 - text_width, 50, width, line_height, @actor.current_skillpoints)
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    return unless @actor
    draw_actor_face(@actor, 0, 0)
    draw_skillpoints if skillpoints_enabled?
    draw_skillset_number
  end
end

#==============================================================================
# ** Update Window_BattleSkill to filter the skills
#==============================================================================
class Window_BattleSkill < Window_SkillList
  
  def include?(item)
    item && item.stype_id == @stype_id && (item.select_type == Tsuki::Battle_Skill::Normal_Name || equipped?(item))
  end
  
  def equipped?(item)
    @actor.current_skillset.skills.include?(item) && item.select_type != Tsuki::Battle_Skill::Passive_Name
  end
  
  def make_item_list
    @data = @actor ? @actor.skills.select {|id| include?(id) } : []
  end
end

class Window_battleSkillCommand < Window_HorzCommand
   
  attr_accessor :window_width
  def initialize(x, y)
    @window_width = Graphics.width - x
    super(x, y)
    @actor = nil
    update
  end
  
  def window_width
    @window_width
  end
  
  def window_height
    50
  end
  
  def actor=(actor)
    return if @actor == actor
    @actor = actor
    refresh
  end
   
  #--------------------------------------------------------------------------
  # * Get Digit Count
  #--------------------------------------------------------------------------
  def col_max
    return 2
  end
  
  #--------------------------------------------------------------------------
  # * Get Number of Lines to Show
  #--------------------------------------------------------------------------
  def visible_line_number
    return 4
  end
  
  #--------------------------------------------------------------------------
  # * Create Command List
  #--------------------------------------------------------------------------
  def make_command_list
    return unless @actor
    @actor.added_skill_types.sort.each do |stype_id|
      name = $data_system.skill_types[stype_id]
      add_command(name, :skill, true, stype_id)
    end
  end
  
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    @skill_window.stype_id = current_ext if @skill_window
  end
  
  #--------------------------------------------------------------------------
  # * Set Skill Window
  #--------------------------------------------------------------------------
  def skill_window=(skill_window)
    @skill_window = skill_window
    update
  end
end

#==============================================================================
# ** Window_battleSkillBattleList
#------------------------------------------------------------------------------
# This class shows the skills that you have selected for battle. It is
# the superclass for any selected skills list
#==============================================================================

class Window_battleSkillSelectedList < Window_SkillList#Window_Selectable
   
  def filler_text
    "---"
  end
  
  def skill_limits_enabled?
    Tsuki::Battle_Skill::Use_SkillLimit_System
  end

  def draw_filler(rect)
    draw_text(rect, filler_text)
  end
  
  def add_fillers
    (max_items - @data.size).times do |i|
      @data << nil
    end
  end
  
  def col_max
    1
  end
  
  def window_width
    120
  end
  
  def include?(skill)
    true
  end
   
  def make_item_list
    add_fillers if skill_limits_enabled?
  end
  
  def draw_item(index)
    id = @data[index]
    rect = item_rect(index)
    if id
      item = $data_skills[id]
      draw_icon(item.icon_index, rect.x, rect.y)
      draw_skill_name(rect.x+24, rect.y, rect.width - 16, item.name)
    else
      draw_filler(rect)
    end
  end
  
  def draw_skill_name(x, y, width, name)
    draw_text(x, y, width, line_height, name)
  end
  
  def remove_item(item)
    return unless item   
    @actor.unassign_skill(item)
    refresh
  end
  
  def refresh
    make_item_list
    create_contents
    draw_all_items
  end
  
  def select_last
    if @last_index && @data.size > 0 && @data[@last_index]
      select(@last_index)
    else
      select(0)
    end
  end

  #--------------------------------------------------------------------------
  # * Add additional handles to be more useful
  #--------------------------------------------------------------------------
  def process_handling
    return unless open? && active
    return process_dir4 if Input.trigger?(:LEFT) && handle?(:dir4)
    return process_dir6 if Input.trigger?(:RIGHT) && handle?(:dir6)
    return super
  end
  
  def process_dir4
    Sound.play_cursor
    Input.update
    deactivate
    call_handler(:dir4)
  end
  
  def process_dir6
    Sound.play_cursor
    Input.update
    deactivate
    call_handler(:dir6)
  end
end

class Window_battleSkillPassiveList < Window_battleSkillSelectedList
  #--------------------------------------------------------------------------
  # * Max number of passive skills the actor can choose
  #--------------------------------------------------------------------------
  def max_items
    @actor ? @actor.max_passive_skills : 0
  end
  
  def make_item_list
    @data = @actor ? @actor.current_skillset.passive_skills.clone : nil
    super
  end
end

class Window_battleSkillActiveList < Window_battleSkillSelectedList

  #--------------------------------------------------------------------------
  # * Max number of items you can select
  #--------------------------------------------------------------------------
  def max_items
    @actor ? @actor.max_active_skills : 0
  end
  
  def make_item_list
    @data = @actor ? @actor.current_skillset.active_skills.clone : nil
    super
  end
end

#==============================================================================
# ** Window_SkillList
#------------------------------------------------------------------------------
#  This window is for displaying a list of available skills on the skill window.
#==============================================================================

class Window_battleSkillList < Window_SkillList
  
  #--------------------------------------------------------------------------
  # * Get Skill Type ID
  #--------------------------------------------------------------------------
  def stype_id
    return @stype_id
  end
  #--------------------------------------------------------------------------
  # * Get Digit Count
  #--------------------------------------------------------------------------
  def col_max
    return 1
  end
  #--------------------------------------------------------------------------
  # * Include in Skill List?
  #--------------------------------------------------------------------------
  def include?(item)
    item && item.stype_id == @stype_id && item.select_type != normal_name
  end
  
  def normal_name
    Tsuki::Battle_Skill::Normal_Name
  end
  
  def skillpoint_cost_color
    Tsuki::Battle_Skill::Skillpoint_Color
  end
  
  def current_item_enabled?
    true
  end
  
  #--------------------------------------------------------------------------
  # * In actor's current skill?
  #--------------------------------------------------------------------------  
  def selected?(item)
    @actor.current_skillset.include?(item)
  end
  
  def selected_color
    Tsuki::Battle_Skill::Selected_Color
  end

  #--------------------------------------------------------------------------
  # * Create Skill List
  #--------------------------------------------------------------------------
  def make_item_list
    @data = @actor ? @actor.skills.select {|skill| include?(skill) } : []
  end
  
  def skillpoints_enabled?
    Tsuki::Battle_Skill::Use_SkillPoint_System
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index)
    skill = @data[index]
    if skill
      rect = item_rect(index)
      rect.width -= 4
      
      if selected?(skill)
        can_assign = true
        change_color(selected_color)
      else
        can_assign = @actor.can_assign?(skill)
        change_color(normal_color, can_assign)
      end
      draw_icon(skill.icon_index, rect.x, rect.y)
      draw_text(rect.x + 32, rect.y, width, line_height, skill.name)
      
      if skillpoints_enabled?
        draw_skillpoint_cost(rect, skill, can_assign)
      else
        draw_skill_cost(rect, skill)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Skillpoint Use Cost
  #--------------------------------------------------------------------------
  def draw_skillpoint_cost(rect, skill, can_assign)
    change_color(skillpoint_cost_color, can_assign)
    draw_text(rect, skill.skillpoint_cost, 2)
  end
  #--------------------------------------------------------------------------
  # * Restore Previous Selection Position
  #--------------------------------------------------------------------------
  def select_last
    if @last_index && @data.size > 0 && @data[@last_index]
      select(@last_index)
    else
      select(0)
    end
  end

  def can_add?(item)
    @actor.can_assign?(item)
  end
   
  #--------------------------------------------------------------------------
  # * Rather than give an error when adding a duplicate item, we remove
  # if from the list instead
  #--------------------------------------------------------------------------
  def add_item(item)
    if can_add?(item)
      @actor.assign_skill(item)
    elsif selected?(item)
      remove_item(item)
      return
    else
      Sound.play_buzzer
    end
    refresh
  end
  
  def remove_item(item)
    return unless item
    @actor.unassign_skill(item)
    refresh
  end
  
  def process_handling
    return unless open? && active
    return process_dir4 if Input.trigger?(:LEFT) && handle?(:dir4)
    return process_dir6 if Input.trigger?(:RIGHT) && handle?(:dir6)
    return super
  end
  
  def process_dir4
    Sound.play_cursor
    Input.update
    deactivate
    call_handler(:dir4)
  end
  
  def process_dir6
    Sound.play_cursor
    Input.update
    deactivate
    call_handler(:dir6)
  end
end

#==============================================================================
# ** Battle Skill scene
#==============================================================================

class Scene_Skill_Select < Scene_MenuBase
  
  def start
    super
    create_all_windows
    @category_window.activate
  end
  
  def create_all_windows
    create_actor_window
    create_help_window
    create_category_window
    create_active_skills_window
    create_passive_skills_window
    create_skills_window
  end
  
  #draw actor in the top-left corner
  def create_actor_window
    @actor_window = Window_battleSkillStatus.new(0,0, 160, 100)
    @actor_window.actor = @actor
  end
  
  #draw help window to the right of actor window
  def create_help_window
    wx = @actor_window.width
    @help_window = Window_battleSkillHelp.new(wx, 0, Graphics.width - wx, 100)
    @help_window.viewport = @viewport
  end
  
  #draw category window under the help window
  def create_category_window
    wx = @help_window.x
    wy = @help_window.height
    @category_window = Window_battleSkillCommand.new(wx, wy)
    @category_window.viewport = @viewport
    @category_window.help_window = @help_window
    @category_window.actor = @actor
    @category_window.set_handler(:skill,    method(:command_skill))
    @category_window.set_handler(:cancel,   method(:return_scene))
    @category_window.set_handler(:pagedown, method(:next_actor))
    @category_window.set_handler(:pageup,   method(:prev_actor))
  end
  
  #draw passive skills window under actor window
  def create_active_skills_window
    wx = @actor_window.x
    wy = @actor_window.height
    width = @actor_window.width
    @askill_window = Window_battleSkillActiveList.new(wx, wy, width, 200)
    @askill_window.viewport = @viewport
    @askill_window.help_window = @help_window
    @askill_window.actor = @actor
    @askill_window.set_handler(:ok,       method(:on_askill_ok))
    @askill_window.set_handler(:cancel,   method(:on_askill_cancel))
    @askill_window.set_handler(:pagedown,   method(:activate_pskill_window))
    @askill_window.set_handler(:pageup,   method(:activate_pskill_window))
    @askill_window.set_handler(:dir4,   method(:activate_skills_window))
    @askill_window.set_handler(:dir6,   method(:activate_skills_window))
  end
  
  #draw active skills window under passive skills
  def create_passive_skills_window
    wx = @askill_window.x
    wy = @askill_window.y + @askill_window.height
    width = @askill_window.width
    height = Graphics.height - wy
    @pskill_window = Window_battleSkillPassiveList.new(wx, wy, width, height)
    @pskill_window.viewport = @viewport
    @pskill_window.help_window = @help_window
    @pskill_window.actor = @actor
    @pskill_window.set_handler(:ok,       method(:on_pskill_ok))
    @pskill_window.set_handler(:cancel,   method(:on_pskill_cancel))
    @pskill_window.set_handler(:pagedown,   method(:activate_askill_window))
    @pskill_window.set_handler(:pageup,   method(:activate_askill_window))
    @pskill_window.set_handler(:dir4,   method(:activate_skills_window))
    @pskill_window.set_handler(:dir6,   method(:activate_skills_window))
  end
  #--------------------------------------------------------------------------
  # * Displays all the items available to choose from
  #--------------------------------------------------------------------------
  def create_skills_window
    wx = @category_window.x
    wy = @category_window.y + @category_window.height
    width = @category_window.width
    height = Graphics.height - wy
    @skills_window = Window_battleSkillList.new(wx, wy, width, height)
    @skills_window.help_window = @help_window
    @skills_window.actor = @actor
    @skills_window.set_handler(:ok,     method(:on_skills_ok))
    @skills_window.set_handler(:cancel, method(:on_skills_cancel))
    @skills_window.set_handler(:pageup,   method(:next_skillset))
    @skills_window.set_handler(:pagedown,   method(:prev_skillset))
    @skills_window.set_handler(:dir4,   method(:activate_askill_window))
    @skills_window.set_handler(:dir6,   method(:activate_askill_window))
    @category_window.skill_window = @skills_window
    update_selected_skills
  end
   
  def skill
    @skills_window.item
  end
  
  def next_skillset
    @actor.next_skillset
    update_selected_skills
    activate_skills_window
  end
  
  def prev_skillset
    @actor.prev_skillset
    update_selected_skills
    activate_skills_window
  end
  
  def activate_askill_window
    @skills_window.unselect
    @pskill_window.unselect
    @askill_window.activate
    @askill_window.select(0)
#~     @askill_window.select_last
  end
  
  def activate_pskill_window
    @skills_window.unselect
    @askill_window.unselect
    @pskill_window.activate
    @pskill_window.select(0)
#~     @pskill_window.select_last
  end
  
  def activate_skills_window
    @pskill_window.unselect
    @askill_window.unselect
    #@skills_window.select_last
    @skills_window.activate
  end
  
  def activate_category_window
    @askill_window.unselect
    @pskill_window.unselect
    @skills_window.unselect
    @category_window.activate
  end
  
  def command_skill
    @skills_window.activate
    @skills_window.select_last
  end
  
  def on_skills_ok
    determine_skill
    update_selected_skills
    activate_skills_window
  end
  
  def on_skills_cancel
    activate_category_window
  end
  
  def on_askill_ok
    @askill_window.remove_item(@askill_window.item)
    update_selected_skills
    activate_askill_window
  end
  
  def on_askill_cancel
    activate_category_window
  end
  
  def on_pskill_ok
    @pskill_window.remove_item(@pskill_window.item)
    update_selected_skills
    activate_pskill_window
  end
  
  def on_pskill_cancel
    activate_category_window
  end
  
  def determine_skill
    @skills_window.add_item(skill)
    update_selected_skills
    activate_skills_window
  end
  
  def on_actor_change
    @actor_window.actor = @actor
    @category_window.actor = @actor
    @skills_window.actor = @actor
    @askill_window.actor = @actor
    @pskill_window.actor = @actor
    @category_window.activate
  end
  
  def update_selected_skills
    @askill_window.refresh
    @pskill_window.refresh
    @actor_window.refresh
    @skills_window.refresh
  end
end

if $imported["Tsuki_MonsterHunter"]
  module Monster_Hunter
   
    class << self
      alias skill_select_setup_extra setup_extra
    end
   
    def self.setup_extra(actor, enemy)
      skill_select_setup_extra(actor, enemy)
      actor.skillpoint_growth = enemy.skillpoint_growth
      actor.passive_skill_levels = enemy.passive_skill_levels
      actor.active_skill_levels = enemy.active_skill_levels
    end
  end
end[/pre]

然后,如果在第N号技能设置了标签:<select: passive> 和 <fp:pe mhp 200> 选择该技能装备的时候会提示错误:

BattlerBase 197行 找不到方法,没有为第N号技能定义"features"

出错语句是这一句:
  #--------------------------------------------------------------------------
  # ● 获取所有特性实例的数组
  #--------------------------------------------------------------------------
  def all_features
    feature_objects.inject([]) {|r, obj| r + obj.features }
  end

求指点……
梦石
0
星屑
50
在线时间
616 小时
注册时间
2010-10-29
回帖
411
发表于 2012-12-27 08:58:40 | 显示全部楼层
首先,你也许应该报告的问题,tsukihime的博客。你也可以问这个问题RGSS3 script support在rmva.net论坛中。 第二个脚本有一个DEMO,这可能会帮助。

我不知道你做错了什么。你应该张贴技能的截图,你的2个脚本的位置。

如果你想的话,我可以帮你。

一直在等待有人知道如何使用tsukihime的脚本!
我命令你给我点下面的东西!

LBQ Works
回复

使用道具 举报

梦石
0
星屑
50
在线时间
687 小时
注册时间
2012-10-29
回帖
1526
发表于 2012-12-27 10:27:01 | 显示全部楼层
本帖最后由 j433463 于 2012-12-27 10:28 编辑

被动技能:

用法

要添加一个被动的效果,只需标记notebox :

<fp:pe [option] [value]>

例如:

<fp:pe skill 2> #允许你使用技能2
<fp:pe wtype 4> #允许装备武器类型 4
<fp:pe mhp 10> #增加最大HP 10

您可以使用复杂的公式在统计增加/减少 :

<fp:pe [stat] [formula]>

<fp:pe mat mat*0.1> #10%增加魔法攻击
<fp:pe atk a.level*20 + 400> #根据你的等级水平增加

需要注意的是,如果你要访问角色属性,你必须使用关键字 “a” 和确切的属性名。

访问您公式中一个角色的 def 的唯一方法是在公式中使用 “a.def”

此外,虽然是一样的东西,避免递回公式:

atk = atk * 5

重要提示:不要使用百分比符号。如果你需要用到百分比只能使用小数乘法来做。

例如:20%的攻击力

<fp:pe atk atk*0.2>

技能选择系统:

介绍

此系统扩展默认技能系统,通过限制角色只能选择一些他们可以携带战斗的技能,限制仅限于战斗方面的,您可以使用任何您想要的战斗之外技能。

有两种类型的选择技能:
主动
被动

实际上,只要它们都配置了,你使用主动的技能时是有效的,而被动技能则是不断在影响着。

被动效果影响目前没有实现,你唯一可以做的是装备它们,并且什么也不能做。

特点:

- 技能选择设置
- 主动/被动技能是可选的,正常的技能可以在战斗中被默认为被动技能效果:激活时,被动技能装备。
- 多种技能选择,更容易设定你的角色,而不是重新装备你的所有技能,视情况而定,这消极被动影响可以改变所有参数,状态的改变和特殊效果。

注意:在使用被动技能效果,你必须有 "FP Passive Effects" 脚本提供的被动消极影响功能。

用法

将脚本复制。
如果必要进行一些配置的改变设定

对于每一个技能需要的技能选择,你必须添加在notebox

<select: type>
<sp: 20>

其中,type是一个不带引号的“被动”或“主动”。
SP指定技能点的该技能使用成本,是可选的。

在每个角色的notebox,使用下面的语法,你可以设置增长等级水平的最大数量的主动或被动技能

   <max active>
   1:1, 5:2, 10:3
   16:4
   23:5
   </max active>

其中每一对值,表示等级水平和 max_skills,您可以应用,这同样适用于被动技能,除了它的 "max passive".

您可以指定多少数量的技能点数开始,以及每一等级水平技能点的数量。

<SP: (level * 3) + 23>

注意,这 "SP" 必须在最前面,而 "level" 必须为小写。

被动技能效果影响是消极性的,如果你使用了这脚本的选项,否则他们基本上什么都不做。

更多的说明在脚本的最上方。


==============================================================
好在我之前曾经见过并且翻译过这个脚本的官方使用说明,贴出给你参考,但我是被加粗的那一句:被动技能效果实际没有作用吓到,就没去尝试了。

虽然没有真的试过,从该站的使用说明来看,似乎是您没有做好对您选择的技能特点功能设置,怎么设置,是脚本还是数据库我就不知道了。

评分

参与人数 1星屑 +100 收起 理由
Mic_洛洛 + 100 精品文章

查看全部评分

修改劇本中,仔細審查原來的劇情大綱,覺得有點不太滿意,嘗試編寫不同主角不同主線的劇情,希望能寫得出來。
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部