Help - Search - Members - Calendar
Full Version: KGC_EquipLearnSkill
RPG RPG Revolution Forums > Scripting > Script Development and Support > RGSS
A Better Bard
Hello all, I apologize if this has been answered - I searched the forum and couldn't find any results relating to XP.

I'm using KFC_EquipLearnSkill script, but for whatever reason I can't get it to actually give me any skills. I'm more familiar with the VX version of the script where you set up variables via weapon and skill notes, but I have not a clue how to get the XP one to function. Here is the script:

script XP
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ ◆ スキル習得装備 - KGC_EquipLearnSkill ◆
#_/ ◇ Last update : 2008/09/06 ◇
#_/----------------------------------------------------------------------------
#_/ スキルを習得する装備品を作成します。
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

#==============================================================================
# ★ カスタマイズ項目 ★
#==============================================================================

module KGC
# ◆習得スキルID省略時、判定に使用する能力値
# 0:腕力+ 1:器用さ+ 2:素早さ+ 3:魔力+
ELS_SKILL_ID_PARAM = 0
# ◆APのデフォルト値
# 所持APを指定しなかったエネミーのAP。
ELS_AP_DEFAULT = 1
# ◆装備しただけでは習得しない
# true にすると、APが溜まるまでスキルを使用できない。
ELS_NEED_AP_FULL = false

# ◆スキル習得に必要なAP
# 配列の添字がスキルIDと対応。
# (指定しなかったスキルは、APを溜めても習得不可能)
ELS_NEED_AP = []

ELS_NEED_AP[32] = 70
ELS_NEED_AP[1] = 1
# ↑<例>ID:32 のスキル習得に必要なAPを 70 に設定

# ◆APビューア(獲得AP一覧)を使用
ELS_USE_AP_VIEWER = true
# ◆マスター(完全習得)したスキルのAP欄
ELS_MASTER_SKILL = "- MASTER -"
# ◆獲得APが 0 のスキルもAPビューアに表示
ELS_SHOW_AP0_SKILL = false

# ◆除外武器配列
# 配列の添字がアクターIDと対応。
# 習得装備から除外する武器IDを配列に格納。
ELS_EXCLUDE_WEAPONS = []
# ELS_EXCLUDE_WEAPONS[1] = [50, 70]
# ↑<例>アルシェスは、武器ID 50 と 70 のスキルを習得できない。
# ◆除外防具配列
# 指定方法は↑と同じ。
ELS_EXCLUDE_ARMORS = []
# ◆除外スキル配列
# 配列の添字がアクターIDと対応。
# 装備では習得不可能にするスキルIDを配列に格納。
ELS_EXCLUDE_SKILLS = []
# ELS_EXCLUDE_SKILLS[1] = [30]
# ↑<例>アルシェスは、スキルID 30 を装備品で習得することはできない。
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
☆★☆★☆★☆★☆★☆★

$imported = {} if $imported == nil
$imported["EquipLearnSkill"] = true

if $game_special_elements == nil
$game_special_elements = {}
$data_system = load_data("Data/System.rxdata")
end
# スキル習得装備属性
$game_special_elements["equip_skill"] = /スキル(?:習|修)得装備(\d+)?(AP[+])?/i

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
☆★☆★☆★☆★☆★☆★

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

class RPG::Enemy
#--------------------------------------------------------------------------
# ● 名前取得
#--------------------------------------------------------------------------
alias name_KGC_EquipLearnSkill name unless $@
def name
return name_KGC_EquipLearnSkill.gsub(/\[.*\]/) {""}
end
#--------------------------------------------------------------------------
# ● オリジナル名取得
#--------------------------------------------------------------------------
def original_name
return @name
end
#--------------------------------------------------------------------------
# ● 所持AP取得
#--------------------------------------------------------------------------
def has_ap
return (original_name =~ /\[AP\s*(\d+)\]/i) ? $1.to_i : KGC::ELS_AP_DEFAULT
end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● AP 取得
# id : スキルID
#--------------------------------------------------------------------------
def ap(id)
@ap = [] if @ap == nil
@ap[id] = 0 if @ap[id] == nil
return @ap[id]
end
#--------------------------------------------------------------------------
# ● AP 加算
# id : スキルID
# value : 加算量
#--------------------------------------------------------------------------
def add_ap(id, value)
@ap = [] if @ap == nil
@ap[id] = 0 if @ap[id] == nil
@ap[id] += value
end
#--------------------------------------------------------------------------
# ● 習得スキル取得
#--------------------------------------------------------------------------
alias skills_KGC_EquipLearnSkill skills
def skills
# 全習得スキルを返す
return (skills_KGC_EquipLearnSkill | get_equip_learn_skills).sort
end
#--------------------------------------------------------------------------
# ● 習得済みスキルのみを取得
#--------------------------------------------------------------------------
if method_defined?(:learned_skills) && !defined?(LEARNED_SKILLS_KGC_ELS)
alias learned_skills_KGC_EquipLearnSkill learned_skills
else
LEARNED_SKILLS_KGC_ELS = true
end
def learned_skills
# 習得済みスキルを取得
return_skills = nil
if defined?(LEARNED_SKILLS_KGC_ELS)
return_skills = @skills
else
return_skills = learned_skills_KGC_EquipLearnSkill
end
# AP蓄積済みスキルを追加
return (return_skills | get_full_ap_skills).sort
end
#--------------------------------------------------------------------------
# ● AP蓄積済みのスキルを取得
#--------------------------------------------------------------------------
def get_full_ap_skills
return_skills = []
(1...$data_skills.size).each { |i|
if ap_full?(i)
return_skills << i
end
}
return return_skills
end
#--------------------------------------------------------------------------
# ● 装備品習得スキル取得
#--------------------------------------------------------------------------
def get_equip_learn_skills(all = false)
return_skills = []
# 装備品を取得
weapons = self.equip_weapon_list
armors = self.equip_armor_list
# 装備品から習得スキルを取得
return_skills |=
get_equipment_skills(weapons, all) | get_equipment_skills(armors, all)
# AP蓄積済みスキルを追加
return (return_skills | get_full_ap_skills).sort
end
#--------------------------------------------------------------------------
# ● AP蓄積済み判定
#--------------------------------------------------------------------------
def ap_full?(skill_id)
return KGC::ELS_NEED_AP[skill_id] != nil &&
self.ap(skill_id) >= KGC::ELS_NEED_AP[skill_id]
end
unless $imported["EquipExtension"]
#--------------------------------------------------------------------------
# ● 武器リスト取得
#--------------------------------------------------------------------------
def equip_weapon_list
return [$data_weapons[@weapon_id]]
end
#--------------------------------------------------------------------------
# ● 防具リスト取得
#--------------------------------------------------------------------------
def equip_armor_list
armors = []
(1...5).each { |i|
armors << $data_armors[eval("@armor#{i}_id")]
}
return armors.compact
end
end
#--------------------------------------------------------------------------
# ● 装備品の習得スキル取得
# equipments : 判定装備リスト
#--------------------------------------------------------------------------
def get_equipment_skills(equipments, all = false)
return_skills = []
equipments.each { |equipment|
if els_can_learn?(equipment)
case equipment
when RPG::Weapon
elements = equipment.element_set
when RPG::Armor
elements = equipment.guard_element_set
end
# 習得スキルを判定
elements.each { |element|
if $game_special_elements["equip_skill"] =~
$data_system.elements[element]
els_id = ($1 == nil ? get_equip_skill_id(equipment) : $1.to_i)
if KGC::ELS_EXCLUDE_SKILLS[self.id] == nil ||
!KGC::ELS_EXCLUDE_SKILLS[self.id].include?(els_id)
if !all && KGC::ELS_NEED_AP_FULL
if KGC::ELS_NEED_AP[els_id] == nil || ap_full?(els_id)
return_skills << els_id
end
else
return_skills << els_id
end
end
end
}
end
}
return return_skills
end
#--------------------------------------------------------------------------
# ● 装備品の習得スキルID取得
# equipment : 判定装備
#--------------------------------------------------------------------------
def get_equip_skill_id(equipment)
case KGC::ELS_SKILL_ID_PARAM
when 0
els_id = equipment.str_plus
when 1
els_id = equipment.dex_plus
when 2
els_id = equipment.agi_plus
when 3
els_id = equipment.int_plus
end
return els_id
end
private :get_equip_skill_id
#--------------------------------------------------------------------------
# ● 習得可否判定
# equipment : 判定装備
#--------------------------------------------------------------------------
def els_can_learn?(equipment)
case equipment
when RPG::Weapon
if KGC::ELS_EXCLUDE_WEAPONS[self.id] == nil ||
!KGC::ELS_EXCLUDE_WEAPONS[self.id].include?(equipment.id)
return true
end
when RPG::Armor
if KGC::ELS_EXCLUDE_ARMORS[self.id] == nil ||
!KGC::ELS_EXCLUDE_ARMORS[self.id].include?(equipment.id)
return true
end
end
return false
end
#--------------------------------------------------------------------------
# ● スキルの使用可能判定
# skill_id : スキル ID
#--------------------------------------------------------------------------
def skill_can_use?(skill_id)
return super
end
#--------------------------------------------------------------------------
# ● スキルの習得済み判定
# skill_id : スキル ID
#--------------------------------------------------------------------------
def skill_learn?(skill_id)
return skills.include?(skill_id)
end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
☆★☆★☆★☆★☆★☆★

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

class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ● 所持AP取得
#--------------------------------------------------------------------------
def has_ap
return $data_enemies[@enemy_id].has_ap
end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Window_StatusAP
#------------------------------------------------------------------------------
#  ステータス画面でAP情報を表示するウィンドウです。
#==============================================================================

if KGC::ELS_USE_AP_VIEWER
class Window_StatusAP < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# actor : アクター
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 0, 640, 480)
self.back_opacity = 224
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
count = 0
(1...$data_skills.size).each { |i|
if show_skill?(i)
count += 1
end
}
self.contents = Bitmap.new(608, 32 * count + 32)
# AP情報描画
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 256, 32, "スキル", 1)
self.contents.draw_text(256, 0, 160, 32, "取得AP/必要AP")
return if KGC::ELS_NEED_AP.size == 0
y = 32
(1...$data_skills.size).each { |i|
unless show_skill?(i)
next
end
skill = $data_skills[i]
self.contents.font.color = normal_color
icon = RPG::Cache.icon(skill.icon_name)
self.contents.blt(4, y + 4, icon, icon.rect)
self.contents.draw_text(32, y, 224, 32, skill.name)
if @actor.ap(i) < KGC::ELS_NEED_AP[i]
self.contents.font.color = normal_color
self.contents.draw_text(256, y, 160, 32,
sprintf("%6d/%6d", @actor.ap(i), KGC::ELS_NEED_AP[i]))
else
self.contents.font.color = text_color(6)
self.contents.draw_text(256, y, 160, 32, KGC::ELS_MASTER_SKILL)
end
y += 32
}
end
#--------------------------------------------------------------------------
# ● スキルを表示するか判定
#--------------------------------------------------------------------------
def show_skill?(skill_id)
result = KGC::ELS_NEED_AP[skill_id] != nil
if !KGC::ELS_SHOW_AP0_SKILL && result
result &= @actor.ap(skill_id) > 0
end
return result
end
end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
☆★☆★☆★☆★☆★☆★


#==============================================================================
# ■ Scene_Status
#==============================================================================

if KGC::ELS_USE_AP_VIEWER
class Scene_Status
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# actor_index : アクターインデックス
#--------------------------------------------------------------------------
alias initialize_KGC_EquipLearnSkill initialize
def initialize(actor_index = 0, equip_index = 0)
initialize_KGC_EquipLearnSkill(actor_index, equip_index)

@view_ap = false
end
#--------------------------------------------------------------------------
# ● メイン処理
#--------------------------------------------------------------------------
alias main_KGC_EquipLearnSkill main
def main
# アクターを取得
@actor = $game_party.actors[@actor_index]
# APビューアを作成
@ap_window = Window_StatusAP.new(@actor)
@ap_window.z = 2000
@ap_window.visible = false

main_KGC_EquipLearnSkill

@ap_window.dispose
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias update_KGC_EquipLearnSkill update
def update
@ap_window.update
# A ボタンが押された場合
if Input.trigger?(Input::A)
# カーソル SE を演奏
$game_system.se_play($data_system.cursor_se)
# ウィンドウ切り替え
Graphics.freeze
@view_ap = !@view_ap
@ap_window.visible = @ap_window.active = @view_ap
Graphics.transition
return
end
# C ボタンが押された場合
if Input.trigger?(Input::C) && $imported["StatusAlter"]
@view_ap = false
@ap_window.visible = @ap_window.active = false
end
if @ap_window.active
# スクロール最大位置を計算
scroll_max = [@ap_window.contents.height - (@ap_window.height - 32), 0].max
if Input.repeat?(Input::UP)
@ap_window.oy = [@ap_window.oy - 32, 0].max
elsif Input.repeat?(Input::DOWN)
@ap_window.oy = [@ap_window.oy + 32, scroll_max].min
elsif Input.repeat?(Input::L)
@ap_window.oy = [@ap_window.oy - (@ap_window.height - 32), 0].max
elsif Input.repeat?(Input::R)
@ap_window.oy = [@ap_window.oy + (@ap_window.height - 32), scroll_max].min
end
end

update_KGC_EquipLearnSkill
end
end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Scene_Battle (分割定義 2)
#==============================================================================

class Scene_Battle
#--------------------------------------------------------------------------
# ● アフターバトルフェーズ開始
#--------------------------------------------------------------------------
alias start_phase5_KGC_EquipLearnSkill start_phase5
def start_phase5
start_phase5_KGC_EquipLearnSkill

# AP獲得処理(経験値を獲得できない場合は無視)
actors = $game_party.actors.find_all { |actor|
actor.exist? && !actor.cant_get_exp?
}
@got_ap = 0
$game_troop.enemies.each { |enemy|
unless enemy.hidden
@got_ap += enemy.has_ap
end
}
actors.each { |actor|
skills = actor.get_equip_learn_skills(true)
skills.each { |i|
actor.add_ap(i, @got_ap)
}
}
end
end


So I would assume after killing one enemy, I would gain 1 AP, which would grant me the [1] skill (which for example is cure). Unfortunately, after killing an enemy, I don't receive any AP nor get any skills. Can anyone help me get this thing working?

Here is VX version of the script for reference:

script VX
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#_/ ◆ Equipment Skills System - KGC_EquipLearnSkill ◆ VX ◆
#_/ ◇ Last Update: 2008/02/10 ◇
#_/ ◆ Translation by Mr. Anonymous ◆
#_/ ◆ KGC Site: ◆
#_/ ◆ http://ytomy.sakura.ne.jp/
#_/ ◆ Translator's Blog: ◆
#_/ ◆ http://mraprojects.wordpress.com
#_/-----------------------------------------------------------------------------
#_/ This script allows you to assign skills that can be "learned" by equipping
#_/ designated equipment. Everytime the party defeats an enemy, they recieve
#_/ TP (Training Points) that go toward mastering a skill. Once a skill is
#_/ mastered (with the default setting of NEED_FULL_AP = true), that skill is
#_/ learned. This system is much like the one in Final Fantasy Tactics Advance.
#_/=============================================================================
#_/ ◆ Instructions For Usage ◆
#_/ To make use of these functions, you must insert the desired tag into the
#_/ "Notes" box located in the specified section of the database.
#_/ <learnskill> is for equipment, <needTP> is for Skills, and <TP> for enemies.
#_/ For example, you want the Club to supply the Dual Attack skill and be
#_/ mastered at 20 TP. You would locate the Club in the weapons tab of the
#_/ database and insert <learnskill 1>. Then, you'd locate Dual Attack in
#_/ the Skills tab of the database and insert <needTP 20>. Simple, effective.
#_/
#_/ Key: n = Number
#_/ SkillID = The ID number of the desired skill in the skills database
#_/ Amount = The desired amount of TP.
#_/
#_/ <learnskill SkillID>
#_/ Assigns the given skill to the designated equipment for the actor to use.
#_/
#_/ <needTP Amount>
#_/ Assigns a specified amount of TP the actor must aquire in order to master
#_/ the skill.
#_/ <TP Amount>
#_/ Assigns a specified amount of TP earned from defeating the enemy.
#_/
#_/
#_/ ◆ Script Commands ◆
#_/ These commands are used in "Script" function in the third page of event
#_/ commands under "Advanced".
#_/
#_/ * gain_actor_ap(ActorID, AP Amount, show)
#_/ Allows you to give an actor a specified amount of AP.
#_/ "Show" is a toggle. If set to true, if the skill is mastered, it will
#_/ display the "Skill Mastered" screen. (Ex. gain_actor_ap (1, 50, true))
#_/
#_/ * change_actor_ap(ActorID, SkillID, AP Amount)
#_/ Allows you to modify the amount of AP a specified skill has.
#_/ (Ex. change_actor_ap (1, 3, 100)
#_/
#_/ * call_ap_viewer(index: ActorID)
#_/ This calls the AP Viewer screen. If you exclude (index:), the first
#_/ actor in the index is automatically called.
#_/ Note: To use this properly, Ex. call_ap_viewer(index: 2) would pull up
#_/ the AP Viewer screen for the second actor.
#_/
#_/ [Further, please see "Equipment Exclusion" and "Skills Exclusion" located]
#_/ [near the bottom of the Customize block for more control. ]
#_/
#_/=============================================================================
#_/ Installation: Install above KCG_SkillCPSystem, if you use that script.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_

$data_system = load_data("Data/System.rvdata") if $data_system == nil

#==============================================================================#
# ★ Customization ★ #
#==============================================================================#

module KGC
module EquipLearnSkill
# Note: To avoid confusion with the KCG_DistributeParameter script, I use TP
# (Training Point) as the default abbreviation. KGC uses AP.
# ◆ AP Name ◆
# This allows you to change the abbreviation of AP.
VOCAB_AP = "TP"
# ◆ AP Default Value ◆
# This allows you to change the default value of AP gained by an enemy when
# not manually specified using the <TP n> tag.
DEFAULT_AP = 1
# ◆ Skill Use Mastery ◆
# This toggle allows you to change whether a skill is usable when AP hasn't
# been maxed out.
# true = Skill cannot be used until the skill has been mastered.
# false = Skills are usable regardless of AP amount, however, when the item
# that provides that skill is unequipped, the skill is removed.
NEED_FULL_AP = true

# ◆ AP Result Screen Aquisition Display ◆
# The allows you to change the AP aquired message for battle results.
# %s : aquired AP amount
VOCAB_RESULT_OBTAIN_AP = "Aquired %s #{VOCAB_AP}!"
# ◆ Display message when skill is mastered on results screen
# (beginning of message).
# %s : Actor Name
VOCAB_RESULT_MASTER_SKILL = "%s"
# ◆ Display message when skill mastered on results screen.
# (ending of message)
# %s : Name of mastered skill
VOCAB_RESULT_MASTER_SKILL_NAME = "Learned %s!"

# ◆ Command Menu ◆
# This toggle adds the "AP Viewer" (Training Skills) selection to the main
# command menu.
USE_MENU_AP_VIEWER_COMMAND = false
# ◆ Text of the Equip Skills selection on the main command window.
# Could also be written: VOCAB_MENU_AP_VIEWER = "#{VOCAB_AP} Skills"
VOCAB_MENU_AP_VIEWER = "View TP"

# ◆ AP Viewer Screen ◆
# Mastered AP skills column display.
VOCAB_MASTER_SKILL = " - MASTER - "
# This toggle shows/hides skills that have 0 AP.
# This also evidently affects the skill's usability, though untested.
# true = show
# false = Hide
SHOW_ZERO_AP_SKILL = true
# This toggle allows you to hide the name of a skill if the skill has 0 AP.
# true = mask the skill name
# false = unmask the skill name
MASK_ZERO_AP_SKILL_NAME = true
# This allows you to change the text of a 0 AP masked skill.
# (When MASK_ZERO_AP_SKILL_NAME = true)
ZERO_AP_NAME_MASK = "Unavailable"
# This toggle allows you to mask the text displayed in the "Help" (topmost)
# window of a skill that has 0 AP.
# true = mask the skill's help text
# false = display the text normally
HIDE_ZERO_AP_SKILL_HELP = true
# This allows you to change the text displayed in the "Help" (topmost) window
# of a skill that has 0 AP. (When HIDE_ZERO_AP_SKILL_HELP = true)
ZERO_AP_SKILL_HELP = "This skill is unavailable."

# ◆ Equipment Exclusion ◆
# The following lines make it possible for a specified actor to not gain
# skills granted by certain Weapons and Armors.
# The subscript of the array (The [] brackets) cooresponds to the Actor ID.
EXCLUDE_WEAPONS = [] # Weapons
EXCLUDE_ARMORS = [] # Armor
# Example:
# ActorID:1 WeaponID:50 and 70
# EXCLUDE_WEAPONS[1] = [50, 70]
# Ralph cannot aquire the skills given by the weapon of WeaponID 50 and 70.

# ◆ Skills Exclusion ◆
# The following line makes it possible for a specified actor to not gain
# certain skills provided by any equipment that may normally grant them.
# The subscript of the array (The [] brackets) cooresponds to the Actor ID.
EXCLUDE_SKILLS = []
# Example:
# ActorID:1 SkillID:30
# EXCLUDE_SKILLS[1] = [30]
# Ralph cannot aquire the skill in SkillID 30 granted by any equipped goods.

# ◆ Call AP Viewer from the Skills Window ◆
# This allows you to change what key/button is pressed on the skills window
# to shift to the AP Viewer window.
# When set to nil, this is disabled. ( CALL_EQUIPSKILLKEY = Input::nil )
# Note: Currently this only works with KGC_CategorizeSkill
# I'll revise this later so you may do so without that script.
# I also need to add a couple more methods to this anyhow.
CALL_APVIEWERKEY = Input::Z
# ◆ Call Skills Window from the AP Viewer ◆
# This allows you to change what key/button is pressed on the AP Viewer
# to shift to the skills window.
# When set to nil, this is disabled. ( CALL_SKILLSKEY = Input::nil )
CALL_SKILLSKEY = Input::Y
end
end

# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
# Unless you know what you're doing, it's best not to alter anything beyond #
# this point, as this only affects the tags used for "Notes" in database. #
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * #
# Whatever word(s) are after the separator ( | ) in the following lines are
# what are used to determine what is searched for in the "Notes" section.

$imported = {} if $imported == nil
$imported["EquipLearnSkill"] = true

module KGC::EquipLearnSkill
# Regular exp​ressions Defined
module Regexp
# Base Item Module
module BaseItem
# Learn Skill tag string
LEARN_SKILL = /<(?:LEARN_SKILL|learnskill)[ ]*(\d+(?:[ ]*,[ ]*\d+)*)>/i
end

# Base Skill Module
module Skill
# Need AP tag string
NEED_AP = /<(?:NEED_AP|needTP)[ ]*(\d+)>/i
end

# Base Enemy Module
module Enemy
# AP given tag string
AP = /<TP[ ]*(\d+)>/i
end
end
end

#==============================================================================
# □ KGC::Commands
#==============================================================================

module KGC::Commands
module_function
#--------------------------------------------------------------------------
# ○ AP の獲得
# actor_id : アクター ID
# ap : 獲得 AP
# show : マスター表示フラグ
#--------------------------------------------------------------------------
def gain_actor_ap(actor_id, ap, show = false)
$game_actors[actor_id].gain_ap(ap, show)
end
#--------------------------------------------------------------------------
# ○ AP の変更
# actor_id : アクター ID
# skill_id : スキル ID
# ap : AP
#--------------------------------------------------------------------------
def change_actor_ap(actor_id, skill_id, ap)
skill = $data_skills[skill_id]
return if skill == nil
$game_actors[actor_id].change_ap(skill, ap)
end
#--------------------------------------------------------------------------
# ○ AP ビューアの呼び出し
# actor_index : アクターインデックス
#--------------------------------------------------------------------------
def call_ap_viewer(actor_index = 0)
return if $game_temp.in_battle
$game_temp.next_scene = :ap_viewer
$game_temp.next_scene_actor_index = actor_index
end
end

class Game_Interpreter
include KGC::Commands
end

#==============================================================================
# ■ Vocab
#==============================================================================

module Vocab
# 戦闘終了メッセージ
ObtainAP = KGC::EquipLearnSkill::VOCAB_RESULT_OBTAIN_AP
ResultFullAPSkill = KGC::EquipLearnSkill::VOCAB_RESULT_MASTER_SKILL
ResultFullAPSkillName = KGC::EquipLearnSkill::VOCAB_RESULT_MASTER_SKILL_NAME

# AP
def self.ap
return KGC::EquipLearnSkill::VOCAB_AP
end

# マスターしたスキル
def self.full_ap_skill
return KGC::EquipLearnSkill::VOCAB_MASTER_SKILL
end

# AP ビューア
def self.ap_viewer
return KGC::EquipLearnSkill::VOCAB_MENU_AP_VIEWER
end
end

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

class RPG::BaseItem
#--------------------------------------------------------------------------
# ○ スキル習得装備のキャッシュ生成
#--------------------------------------------------------------------------
def create_equip_learn_skill_cache
@__learn_skills = []

self.note.split(/[\r\n]+/).each { |line|
case line
when KGC::EquipLearnSkill::Regexp::BaseItem::LEARN_SKILL # スキル習得
$1.scan(/\d+/).each { |num|
skill_id = num.to_i
# 存在するスキルならリストに加える
@__learn_skills << skill_id if $data_skills[skill_id] != nil
}
end
}
end
#--------------------------------------------------------------------------
# ○ 習得するスキル ID の配列
#--------------------------------------------------------------------------
def learn_skills
create_equip_learn_skill_cache if @__learn_skills == nil
return @__learn_skills
end
end

#==============================================================================
# ■ RPG::Skill
#==============================================================================

class RPG::Skill < RPG::UsableItem
#--------------------------------------------------------------------------
# ○ クラス変数
#--------------------------------------------------------------------------
@@__masked_name =
KGC::EquipLearnSkill::ZERO_AP_NAME_MASK # マスク名
@@__expand_masked_name = false # マスク名拡張表示フラグ

if @@__expand_masked_name != nil
@@__expand_masked_name = (@@__masked_name.scan(/./).size == 1)
end
#--------------------------------------------------------------------------
# ○ スキル習得装備のキャッシュ生成
#--------------------------------------------------------------------------
def create_equip_learn_skill_cache
@__need_ap = 0

self.note.split(/[\r\n]+/).each { |line|
case line
when KGC::EquipLearnSkill::Regexp::Skill::NEED_AP # 必要 AP
@__need_ap = $1.to_i
end
}
end
#--------------------------------------------------------------------------
# ○ マスク名
#--------------------------------------------------------------------------
def masked_name
if KGC::EquipLearnSkill::MASK_ZERO_AP_SKILL_NAME
if @@__expand_masked_name
# マスク名を拡張して表示
return @@__masked_name * self.name.scan(/./).size
else
return @@__masked_name
end
else
return self.name
end
end
#--------------------------------------------------------------------------
# ○ 習得に必要な AP
#--------------------------------------------------------------------------
def need_ap
create_equip_learn_skill_cache if @__need_ap == nil
return @__need_ap
end
end

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

class RPG::Enemy
#--------------------------------------------------------------------------
# ○ スキル習得装備のキャッシュ生成
#--------------------------------------------------------------------------
def create_equip_learn_skill_cache
@__ap = KGC::EquipLearnSkill::DEFAULT_AP

self.note.split(/[\r\n]+/).each { |line|
case line
when KGC::EquipLearnSkill::Regexp::Enemy::AP # 所持 AP
@__ap = $1.to_i
end
}
end
#--------------------------------------------------------------------------
# ○ 所持 AP
#--------------------------------------------------------------------------
def ap
create_equip_learn_skill_cache if @__ap == nil
return @__ap
end
end

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

unless $imported["CustomMenuCommand"]
class Game_Temp
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :next_scene_actor_index # 次のシーンのアクターインデックス
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias initialize_KGC_EquipLearnSkill initialize
def initialize
initialize_KGC_EquipLearnSkill

@next_scene_actor_index = 0
end
end
end

#==============================================================================
# ■ Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ● セットアップ
# actor_id : アクター ID
#--------------------------------------------------------------------------
alias setup_KGC_EquipLearnSkill setup
def setup(actor_id)
setup_KGC_EquipLearnSkill(actor_id)

@skill_ap = []
end
#--------------------------------------------------------------------------
# ○ 指定スキルの AP 取得
# skill_id : スキル ID
#--------------------------------------------------------------------------
def skill_ap(skill_id)
@skill_ap = [] if @skill_ap == nil
return (@skill_ap[skill_id] != nil ? @skill_ap[skill_id] : 0)
end
#--------------------------------------------------------------------------
# ○ AP 変更
# skill : スキル
# ap : 新しい AP
#--------------------------------------------------------------------------
def change_ap(skill, ap)
@skill_ap = [] if @skill_ap == nil
@skill_ap[skill.id] = [[ap, skill.need_ap].min, 0].max
end
#--------------------------------------------------------------------------
# ○ マスターしたスキルの表示
# new_skills : 新しくマスターしたスキルの配列
#--------------------------------------------------------------------------
def display_full_ap_skills(new_skills)
$game_message.new_page
text = sprintf(Vocab::ResultFullAPSkill, name)
$game_message.texts.push(text)
new_skills.each { |skill|
text = sprintf(Vocab::ResultFullAPSkillName, skill.name)
$game_message.texts.push(text)
}
end
#--------------------------------------------------------------------------
# ○ AP 獲得
# ap : AP の増加量
# show : マスタースキル表示フラグ
#--------------------------------------------------------------------------
def gain_ap(ap, show)
last_full_ap_skills = full_ap_skills

# 装備品により習得しているスキルに AP を加算
equipment_skills(true).each { |skill|
change_ap(skill, skill_ap(skill.id) + ap)
}

# マスターしたスキルを表示
if show && last_full_ap_skills != full_ap_skills
display_full_ap_skills(full_ap_skills - last_full_ap_skills)
end
end
#--------------------------------------------------------------------------
# ● スキルオブジェクトの配列取得
#--------------------------------------------------------------------------
alias skills_KGC_EquipLearnSkill skills
def skills
result = skills_KGC_EquipLearnSkill

# 装備品と AP 蓄積済みのスキルを追加
additional_skills = equipment_skills | full_ap_skills
return (result | additional_skills).sort! { |a, b| a.id <=> b.id }
end
#--------------------------------------------------------------------------
# ○ 装備品の習得スキル取得
# all : 使用不可能なスキルも含める
#--------------------------------------------------------------------------
def equipment_skills(all = false)
result = []
equips.compact.each { |item|
next if exclude_learnable_equipment?(item) # 除外装備なら無視

item.learn_skills.each { |i|
skill = $data_skills[i]
next if exclude_equipment_skill?(skill) # 除外スキルなら無視
if !all && KGC::EquipLearnSkill::NEED_FULL_AP # 要蓄積の場合
next unless ap_full?(skill) # 未達成なら無視
end
result << skill
}
}
return result
end
#--------------------------------------------------------------------------
# ○ スキル習得装備除外判定
# item : 判定装備
#--------------------------------------------------------------------------
def exclude_learnable_equipment?(item)
case item
when RPG::Weapon # 武器
# 除外武器に含まれている場合
if KGC::EquipLearnSkill::EXCLUDE_WEAPONS[id] != nil &&
KGC::EquipLearnSkill::EXCLUDE_WEAPONS[id].include?(item.id)
return true
end
when RPG::Armor # 防具
# 除外防具に含まれている場合
if KGC::EquipLearnSkill::EXCLUDE_ARMORS[id] != nil &&
KGC::EquipLearnSkill::EXCLUDE_ARMORS[id].include?(item.id)
return true
end
else # 装備品以外
return true
end

return false
end
#--------------------------------------------------------------------------
# ○ 装備品による習得スキル除外判定
# skill : スキル
#--------------------------------------------------------------------------
def exclude_equipment_skill?(skill)
# 自身が除外されている場合
if KGC::EquipLearnSkill::EXCLUDE_SKILLS[id] != nil &&
KGC::EquipLearnSkill::EXCLUDE_SKILLS[id].include?(skill.id)
return true
end

return false
end
#--------------------------------------------------------------------------
# ○ AP 蓄積済みのスキルを取得
#--------------------------------------------------------------------------
def full_ap_skills
result = []
(1...$data_skills.size).each { |i|
skill = $data_skills[i]
result << skill if ap_full?(skill) && !exclude_equipment_skill?(skill)
}
return result
end
#--------------------------------------------------------------------------
# ○ AP 蓄積可能なスキルを取得
#--------------------------------------------------------------------------
def can_gain_ap_skills
result = []
equips.compact.each { |item|
next if exclude_learnable_equipment?(item) # 除外装備なら無視

item.learn_skills.each { |i|
skill = $data_skills[i]
next if exclude_equipment_skill?(skill) # 除外スキルなら無視
result << skill
}
}
return (result - full_ap_skills) # マスターしたものを除く
end
#--------------------------------------------------------------------------
# ○ AP 蓄積済み判定
# skill : スキル
#--------------------------------------------------------------------------
def ap_full?(skill)
return false if skill == nil # スキルが存在しない
return false if skill.need_ap == 0 # 必要 AP が 0
return false if @skills.include?(skill.id) # 習得済み

return (skill_ap(skill.id) >= skill.need_ap)
end
#--------------------------------------------------------------------------
# ● スキルの使用可能判定
# skill : スキル
#--------------------------------------------------------------------------
def skill_can_use?(skill)
return super
end
end

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

class Game_Enemy < Game_Battler
#--------------------------------------------------------------------------
# ○ AP の取得
#--------------------------------------------------------------------------
def ap
return enemy.ap
end
end

#==============================================================================
# ■ Game_Troop
#==============================================================================

class Game_Troop < Game_Unit
#--------------------------------------------------------------------------
# ○ AP の合計計算
#--------------------------------------------------------------------------
def ap_total
ap = 0
for enemy in dead_members
ap += enemy.ap unless enemy.hidden
end
return ap
end
end

#==============================================================================
# ■ Window_Command
#==============================================================================

class Window_Command < Window_Selectable
unless method_defined?(:add_command)
#--------------------------------------------------------------------------
# ○ コマンドを追加
# 追加した位置を返す
#--------------------------------------------------------------------------
def add_command(command)
@commands << command
@item_max = @commands.size
item_index = @item_max - 1
refresh_command
draw_item(item_index)
return item_index
end
#--------------------------------------------------------------------------
# ○ コマンドをリフレッシュ
#--------------------------------------------------------------------------
def refresh_command
buf = self.contents.clone
self.height = [self.height, row_max * WLH + 32].max
create_contents
self.contents.blt(0, 0, buf, buf.rect)
buf.dispose
end
#--------------------------------------------------------------------------
# ○ コマンドを挿入
#--------------------------------------------------------------------------
def insert_command(index, command)
@commands.insert(index, command)
@item_max = @commands.size
refresh_command
refresh
end
#--------------------------------------------------------------------------
# ○ コマンドを削除
#--------------------------------------------------------------------------
def remove_command(command)
@commands.delete(command)
@item_max = @commands.size
refresh
end
end
end

#==============================================================================
# □ Window_APViewer
#------------------------------------------------------------------------------
#  AP ビューアでスキルを表示するウィンドウです。
#==============================================================================

class Window_APViewer < Window_Selectable
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# x : ウィンドウの X 座標
# y : ウィンドウの Y 座標
# width : ウィンドウの幅
# height : ウィンドウの高さ
# actor : アクター
#--------------------------------------------------------------------------
def initialize(x, y, width, height, actor)
super(x, y, width, height)
@actor = actor
@can_gain_ap_skills = []
self.index = 0
refresh
end
#--------------------------------------------------------------------------
# ○ スキルの取得
#--------------------------------------------------------------------------
def skill
return @data[self.index]
end
#--------------------------------------------------------------------------
# ○ リフレッシュ
#--------------------------------------------------------------------------
def refresh
@data = []
@can_gain_ap_skills = @actor.can_gain_ap_skills
equipment_skills = @actor.equipment_skills(true)

(1...$data_skills.size).each { |i|
skill = $data_skills[i]
next if skill.need_ap == 0
unless KGC::EquipLearnSkill::SHOW_ZERO_AP_SKILL
# AP が 0 、かつ装備品で習得していないものは無視
if @actor.skill_ap(skill.id) == 0 && !equipment_skills.include?(skill)
next
end
end
@data.push(skill)
}
@item_max = @data.size
create_contents
@item_max.times { |i| draw_item(i) }
end
#--------------------------------------------------------------------------
# ○ 項目の描画
# index : 項目番号
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
skill = @data[index]
if skill != nil
rect.width -= 4
draw_item_name(skill, rect.x, rect.y, enable?(skill))
if @actor.ap_full?(skill) || @actor.skill_learn?(skill)
# マスター
text = Vocab.full_ap_skill
else
# AP 蓄積中
text = sprintf("%s %4d/%4d",
Vocab.ap, @actor.skill_ap(skill.id), skill.need_ap)
end
# AP を描画
self.contents.font.color = normal_color
self.contents.draw_text(rect, text, 2)
end
end
#--------------------------------------------------------------------------
# ○ スキルを有効状態で表示するかどうか
# skill : スキル
#--------------------------------------------------------------------------
def enable?(skill)
return true if @actor.skill_learn?(skill) # 習得済み
return true if @actor.ap_full?(skill) # マスター
return true if @can_gain_ap_skills.include?(skill) # AP 蓄積可能

return false
end
#--------------------------------------------------------------------------
# ○ スキルをマスクなしで表示するかどうか
# skill : スキル
#--------------------------------------------------------------------------
def no_mask?(skill)
return true if @actor.skill_learn?(skill) # 習得済み
return true if @actor.skill_ap(skill.id) > 0 # AP が 1 以上
return true if @can_gain_ap_skills.include?(skill) # AP 蓄積可能

return false
end
#--------------------------------------------------------------------------
# ● アイテム名の描画
# item : アイテム (スキル、武器、防具でも可)
# x : 描画先 X 座標
# y : 描画先 Y 座標
# enabled : 有効フラグ。false のとき半透明で描画
#--------------------------------------------------------------------------
def draw_item_name(item, x, y, enabled = true)
draw_icon(item.icon_index, x, y, enabled)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
self.contents.draw_text(x + 24, y, 172, WLH,
no_mask?(item) ? item.name : item.masked_name)
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
super
return unless self.active

if Input.repeat?(Input::RIGHT)
cursor_pagedown
elsif Input.repeat?(Input::LEFT)
cursor_pageup
end
end
#--------------------------------------------------------------------------
# ● ヘルプテキスト更新
#--------------------------------------------------------------------------
def update_help
if KGC::EquipLearnSkill::HIDE_ZERO_AP_SKILL_HELP && !no_mask?(skill)
@help_window.set_text(KGC::EquipLearnSkill::ZERO_AP_SKILL_HELP)
else
@help_window.set_text(skill == nil ? "" : skill.description)
end
end
end

#==============================================================================
# ■ Scene_Map
#==============================================================================

class Scene_Map < Scene_Base
#--------------------------------------------------------------------------
# ● 画面切り替えの実行
#--------------------------------------------------------------------------
alias update_scene_change_KGC_EquipLearnSkill update_scene_change
def update_scene_change
return if $game_player.moving? # プレイヤーの移動中?

if $game_temp.next_scene == :ap_viewer
call_ap_viewer
return
end

update_scene_change_KGC_EquipLearnSkill
end
#--------------------------------------------------------------------------
# ○ AP ビューアへの切り替え
#--------------------------------------------------------------------------
def call_ap_viewer
$game_temp.next_scene = nil
$scene = Scene_APViewer.new($game_temp.next_scene_actor_index,
0, Scene_APViewer::HOST_MAP)
end
end

#==============================================================================
# ■ Scene_Menu
#==============================================================================

class Scene_Menu < Scene_Base
if KGC::EquipLearnSkill::USE_MENU_AP_VIEWER_COMMAND
#--------------------------------------------------------------------------
# ● コマンドウィンドウの作成
#--------------------------------------------------------------------------
alias create_command_window_KGC_EquipLearnSkill create_command_window
def create_command_window
create_command_window_KGC_EquipLearnSkill

return if $imported["CustomMenuCommand"]

@__command_ap_viewer_index = @command_window.add_command(Vocab.ap_viewer)
if @command_window.oy > 0
@command_window.oy -= Window_Base::WLH
end
@command_window.index = @menu_index
end
end
#--------------------------------------------------------------------------
# ● コマンド選択の更新
#--------------------------------------------------------------------------
alias update_command_selection_KGC_EquipLearnSkill update_command_selection
def update_command_selection
call_ap_viewer_flag = false
if Input.trigger?(Input::C)
case @command_window.index
when @__command_ap_viewer_index # AP ビューア
call_ap_viewer_flag = true
end
end

# AP ビューアに移行
if call_ap_viewer_flag
if $game_party.members.size == 0
Sound.play_buzzer
return
end
Sound.play_decision
start_actor_selection
return
end

update_command_selection_KGC_EquipLearnSkill
end
#--------------------------------------------------------------------------
# ● アクター選択の更新
#--------------------------------------------------------------------------
alias update_actor_selection_KGC_EquipLearnSkill update_actor_selection
def update_actor_selection
if Input.trigger?(Input::C)
$game_party.last_actor_index = @status_window.index
Sound.play_decision
case @command_window.index
when @__command_ap_viewer_index # AP ビューア
$scene = Scene_APViewer.new(@status_window.index,
@__command_ap_viewer_index, Scene_APViewer::HOST_MENU)
return
end
end

update_actor_selection_KGC_EquipLearnSkill
end
end

#==============================================================================
# □ Scene_APViewer
#------------------------------------------------------------------------------
# AP ビューアの処理を行うクラスです。
#==============================================================================

class Scene_APViewer < Scene_Base
HOST_MENU = 0
HOST_MAP = 1
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# actor_index : アクターインデックス
# menu_index : コマンドのカーソル初期位置
# host_scene : 呼び出し元 (0..メニュー 1..マップ)
#--------------------------------------------------------------------------
def initialize(actor_index = 0, menu_index = 0, host_scene = HOST_MENU)
@actor_index = actor_index
@menu_index = menu_index
@host_scene = host_scene
end
#--------------------------------------------------------------------------
# ● 開始処理
#--------------------------------------------------------------------------
def start
super
create_menu_background
@actor = $game_party.members[@actor_index]
@help_window = Window_Help.new
if $imported["HelpExtension"]
@help_window.row_max = KGC::HelpExtension::ROW_MAX
end
@status_window = Window_SkillStatus.new(0, @help_window.height, @actor)
dy = @help_window.height + @status_window.height
@skill_window = Window_APViewer.new(0, dy,
Graphics.width, Graphics.height - dy, @actor)
@skill_window.help_window = @help_window
end
#--------------------------------------------------------------------------
# ● 終了処理
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@help_window.dispose
@status_window.dispose
@skill_window.dispose
end
#--------------------------------------------------------------------------
# ○ 元の画面へ戻る
#--------------------------------------------------------------------------
def return_scene
case @host_scene
when HOST_MENU
$scene = Scene_Menu.new(@menu_index)
when HOST_MAP
$scene = Scene_Map.new
end
end
#--------------------------------------------------------------------------
# ○ 次のアクターの画面に切り替え
#--------------------------------------------------------------------------
def next_actor
@actor_index += 1
@actor_index %= $game_party.members.size
$scene = Scene_APViewer.new(@actor_index, @menu_index, @host_scene)
end
#--------------------------------------------------------------------------
# ○ 前のアクターの画面に切り替え
#--------------------------------------------------------------------------
def prev_actor
@actor_index += $game_party.members.size - 1
@actor_index %= $game_party.members.size
$scene = Scene_APViewer.new(@actor_index, @menu_index, @host_scene)
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
super
update_menu_background
@help_window.update
@skill_window.update
@status_window.update
if @skill_window.active
update_skill_selection
end
end
#--------------------------------------------------------------------------
# ○ スキル選択の更新
#--------------------------------------------------------------------------
def update_skill_selection
if Input.trigger?(Input::cool.gif
Sound.play_cancel
return_scene
elsif Input.trigger?(Input::R)
Sound.play_cursor
next_actor
elsif Input.trigger?(Input::L)
Sound.play_cursor
prev_actor
elsif KGC::EquipLearnSkill::CALL_SKILLSKEY != nil &&
Input.trigger?(KGC::EquipLearnSkill::CALL_SKILLSKEY)
Sound.play_decision
$scene = Scene_Skill.new(@actor_index)
end
end
end

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

class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ● メッセージ表示が終わるまでウェイト
#--------------------------------------------------------------------------
alias wait_for_message_KGC_EquipLearnSkill wait_for_message
def wait_for_message
return if @ignore_wait_for_message # メッセージ終了までのウェイトを無視

wait_for_message_KGC_EquipLearnSkill
end
#--------------------------------------------------------------------------
# ● 獲得した経験値とお金の表示
#--------------------------------------------------------------------------
alias display_exp_and_gold_KGC_EquipLearnSkill display_exp_and_gold
def display_exp_and_gold
@ignore_wait_for_message = true

display_exp_and_gold_KGC_EquipLearnSkill

display_ap
@ignore_wait_for_message = false
wait_for_message
end
#--------------------------------------------------------------------------
# ● レベルアップの表示
#--------------------------------------------------------------------------
alias display_level_up_KGC_EquipLearnSkill display_level_up
def display_level_up
display_level_up_KGC_EquipLearnSkill

display_master_equipment_skill
end
#--------------------------------------------------------------------------
# ○ 獲得 AP の表示
#--------------------------------------------------------------------------
def display_ap
ap = $game_troop.ap_total
if ap > 0
text = sprintf(Vocab::ObtainAP, ap)
$game_message.texts.push('\.' + text)
end
wait_for_message
end
#--------------------------------------------------------------------------
# ○ マスターしたスキルの表示
#--------------------------------------------------------------------------
def display_master_equipment_skill
ap = $game_troop.ap_total
$game_party.existing_members.each { |actor|
last_skills = actor.skills
actor.gain_ap(ap, true)
}
wait_for_message
end
end

#==============================================================================
# ■ Scene_Skill
#==============================================================================
# Added by Mr. Anonymous
#==============================================================================
if $imported["CategorizeSkill"]
class Scene_Skill < Scene_Base
#--------------------------------------------------------------------------
#  Update Actor
#--------------------------------------------------------------------------
alias update_category_selection_KGC_EquipLearnSkill update_category_selection
def update_category_selection
if KGC::EquipLearnSkill::CALL_APVIEWERKEY != nil &&
Input.trigger?(KGC::EquipLearnSkill::CALL_APVIEWERKEY)
Sound.play_decision
$scene = Scene_APViewer.new(@actor_index)
end
update_category_selection_KGC_EquipLearnSkill
end
end
end
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#_/ The original untranslated version of this script can be found here:
# http://f44.aaa.livedoor.jp/~ytomy/tkool/rp...equip_extension
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_



Thanks for the help!


Extra Bonus Question: Is there any scripts that function more like the VX version of this script, where I can individually assign skills to weapons, rather than just general 'AP -> skills'?
Turkwise
From what I can tell (keep in mind I'm VERY rusty at regular expressions) you want to add, for example "AP 1" at the end of the enemy's name. (or "AP 2" "AP 65" or whatever you want)

Actually, you can put it wherever you want. In the middle if you'd like. It shouldn't show up in-game.

Hope that helps.

EDIT: Oh you may need brackets. Like " [AP 1] Enemy Name"
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.