RPGツクールXP/VX用のRGSS素材です。
一部英語版対応です。
(A few materials can be used for English RPG MAKER XP/VX.)
競合率はルファーの独断と偏見なのでたまにハズレます。
↑スクリーンショット (クリックで拡大)
#==============================================================================
# ■ スキル/アイテム画面に詳細ウィンドウ
#------------------------------------------------------------------------------
# メニューでのスキル/アイテム画面に詳細ウィンドウを付加するスクリプトです。
# (C) ルファー
# WebSite https://tkoolerlufar.pages.dev/
#==============================================================================
=begin
=対応RGSS
1
=他の素材との競合の可能性
!!! メニュー表示改造系素材と99.609375%の確率で競合
=導入方法
Scene_Skill より下に新セクションを作成して、このプログラムをそこにコピーする
=設定の変更方法。
項目の説明を見て目的の項目を探し、
半角の「=」の右に値を入れます。
半角の二重引用符("←これ)の中に任意の文字列を入力してください。
二重引用符の中の文字列は全角でも構いません。
=項目の説明。
* アイテム無しのメッセージ
・・・アイテムを持ってないときに表示するメッセージです。
* スキル無しのメッセージ
・・・スキルを覚えていないときに表示するメッセージです。
* 用語 (不明)
・・・コモンイベントが設定されていて、詳細を特定できない場合に使う
文字列を指定します。
* 用語 (種別)
・・・「種別」に使う文字列を指定します。
* 用語 (種別>物理)
・・・種別の「物理」に使う文字列を指定します。
* 用語 (種別>魔法)
・・・種別の「魔法」に使う文字列を指定します。
* 用語 (使用可能時)
・・・「使用可能時」に使う文字列を指定します。
* 用語 (使用可能時>常時)
・・・使用可能時の「常時」に使う文字列を指定します。
* 用語 (使用可能時>バトルのみ)
・・・使用可能時の「バトルのみ」に使う文字列を指定します。
* 用語 (使用可能時>メニューのみ)
・・・使用可能時の「メニューのみ」に使う文字列を指定します。
* 用語 (使用可能時>使用不可)
・・・使用可能時の「使用不可」に使う文字列を指定します。
* 用語 (効果範囲)
・・・「効果範囲」に使う文字列を指定します。
* 用語 (効果範囲>なし)
・・・効果範囲の「なし」に使う文字列を指定します。
* 用語 (効果範囲>敵単体)
・・・効果範囲の「敵単体」に使う文字列を指定します。
* 用語 (効果範囲>敵全体)
・・・効果範囲の「敵全体」に使う文字列を指定します。
* 用語 (効果範囲>味方単体)
・・・効果範囲の「味方単体」に使う文字列を指定します。
* 用語 (効果範囲>味方全体)
・・・効果範囲の「味方全体」に使う文字列を指定します。
* 用語 (効果範囲>使用者)
・・・効果範囲の「使用者」に使う文字列を指定します。
* 用語 (消耗)
・・・「消耗」に使う文字列を指定します。
* 用語 (消耗>する)
・・・消耗する場合に表示する文字列を指定します。
* 用語 (消耗>しない)
・・・消耗しない場合に表示する文字列を指定します。
* 用語 (回復量)
・・・「回復量」に使う文字列を指定します。
* 用語 (パラメータ上昇)
・・・「パラメータ上昇」に使う文字列を指定します。
* 用語 (パラメータ上昇>なし)
・・・パラメータ上昇が無い場合に表示する文字列を指定します。
* 用語 (Max)
・・・「MaxHP」「MaxSP」の「Max」にあたる文字列を指定します。
* 用語 (分散度)
・・・「分散度」に使う文字列を指定します。
* 用語 (物防/魔防/避修>なし)
・・・物理防御/魔法防御/回避修正の「なし」に使う文字列を指定します。
* 用語 (能力>変化なし)
・・・能力の「変化なし」に使う文字列を指定します。
* 用語 (能力>上昇)
・・・能力の「上昇」に使う文字列を指定します。
* 用語 (能力>低下)
・・・能力の「低下」に使う文字列を指定します。
* 用語 (回避修正)
・・・「回避修正」に使う文字列を指定します。
* 用語 (威力)
・・・「威力」に使う文字列を指定します。
=更新履歴
2009/05/12 名前変更
2007/02/03 いやもうバグがひどすぎてアレだったので修正
2007/11/13 使い物にならないようなバグを修正
2007/10/12 隠れ分類「召喚」を廃止
2007/10/09 公開
=再定義しているメソッド
Window_Item#initialize (エイリアス使用)
Window_Skill#initialize (エイリアス使用)
Scene_Item#main (エイリアス使用)
Scene_Item#update_item (エイリアス使用)
Scene_Skill#main (エイリアス使用)
Scene_Skill#update_skill (エイリアス使用)
=新規定義しているメソッド
なし
=end
#----------------------------------------------------------------------------
# ◆ Lufar モジュール
#----------------------------------------------------------------------------
module Lufar
#--------------------------------------------------------------------------
# ◆ 素材ユーザーによる設定項目 (実体は定数)
#--------------------------------------------------------------------------
SIEXP_NO_ITEM = "何も持っていません" # アイテム無しのメッセージ
SIEXP_NO_SKILL = "何も覚えていません" # スキル無しのメッセージ
SIEXP_UNKNOWN = "不明" # 用語 (不明)
SIEXP_KIND = "種別" # 用語 (種別)
SIEXP_KIND_PHYSICAL = "物理" # 用語 (種別>物理)
SIEXP_KIND_MAGICAL = "魔法" # 用語 (種別>魔法)
SIEXP_OCCASION = "使用可能時" # 用語 (使用可能時)
SIEXP_NORMAL = "常時" # 用語 (使用可能時>常時)
SIEXP_ONLYBATTLE = "バトルのみ" # 用語 (使用可能時>バトルのみ)
SIEXP_ONLYMENU = "メニューのみ" # 用語 (使用可能時>メニューのみ)
SIEXP_UNUSABLE = "使用不可" # 用語 (使用可能時>使用不可)
SIEXP_SCOPE = "効果範囲" # 用語 (効果範囲)
SIEXP_SCOPE_NOT = "なし" # 用語 (効果範囲>なし)
SIEXP_SCOPE_SE = "敵単体" # 用語 (効果範囲>敵単体)
SIEXP_SCOPE_AE = "敵全体" # 用語 (効果範囲>敵全体)
SIEXP_SCOPE_SA = "味方単体" # 用語 (効果範囲>味方単体)
SIEXP_SCOPE_AA = "味方全体" # 用語 (効果範囲>味方全体)
SIEXP_SCOPE_USER = "使用者" # 用語 (効果範囲>使用者)
SIEXP_CONSUMABLE = "消耗" # 用語 (消耗)
SIEXP_CONSUME = "する" # 用語 (消耗>する)
SIEXP_DONTCONSUME = "しない" # 用語 (消耗>しない)
SIEXP_RECOVER = " 回復量" # 用語 (回復量)
SIEXP_PARAMPTS = "パラメータ上昇" # 用語 (パラメータ上昇)
SIEXP_PARAMPTS_NOT = "なし" # 用語 (パラメータ上昇>なし)
SIEXP_MAX = "Max" # 用語 (Max)
SIEXP_VARIANCE = "分散度" # 用語 (分散度)
SIEXP_DEFEVA_NOT = "なし" # 用語 (物防/魔防/避修>なし)
SIEXP_ABI_NOT = "変化なし" # 用語 (能力>変化なし)
SIEXP_ABI_UP = "上昇" # 用語 (能力>上昇)
SIEXP_ABI_DOWN = "低下" # 用語 (能力>低下)
SIEXP_EVA = "回避修正" # 用語 (回避修正)
SIEXP_POWER = "威力" # 用語 (威力)
end
#----------------------------------------------------------------------------
# ◆ Window_Item クラス
#----------------------------------------------------------------------------
class Window_Item < Window_Selectable
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias lfr1_old_init initialize
def initialize
lfr1_old_init
self.height = 256
end
end
#----------------------------------------------------------------------------
# ◆ Window_ItemDetail クラス
#----------------------------------------------------------------------------
class Window_ItemDetail < Window_Base
include(Lufar)
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :item
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(i)
super(0, 320, 640, 160)
self.contents = Bitmap.new(width - 32, height - 32)
self.item = i
end
#--------------------------------------------------------------------------
# ● アイテムの設定
#--------------------------------------------------------------------------
def item=(i)
@item = i
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
if @item.nil?
self.contents.draw_text(self.contents.rect, SIEXP_NO_ITEM, 1)
return
end
if @item.is_a?(RPG::Item)
self.contents.draw_text(0, 0, 304, 32, sprintf("%s:%s",
SIEXP_KIND, $data_system.words.item))
self.contents.draw_text(304, 0, 304, 32, sprintf("%s:%s",
SIEXP_OCCASION, occasion_str))
self.contents.draw_text(0, 32, 304, 32, sprintf("%s:%s",
SIEXP_SCOPE, scope_str))
self.contents.draw_text(304, 32, 304, 32, sprintf("%s:%s",
SIEXP_CONSUMABLE,
@item.consumable ? SIEXP_CONSUME : SIEXP_DONTCONSUME))
self.contents.draw_text(0, 64, 304, 32, sprintf("%s%s:%s",
$data_system.words.hp, SIEXP_RECOVER, recover_hp_str))
self.contents.draw_text(304, 64, 304, 32, sprintf("%s%s:%s",
$data_system.words.sp, SIEXP_RECOVER, recover_sp_str))
self.contents.draw_text(0, 96, 304, 32, sprintf("%s:%s",
SIEXP_PARAMPTS, parameter_str))
self.contents.draw_text(304, 96, 304, 32, sprintf("%s:%s",
SIEXP_VARIANCE, "#{@item.variance}%"))
elsif @item.is_a?(RPG::Weapon)
self.contents.draw_text(0, 0, 304, 32, "#{SIEXP_KIND}:" +
$data_system.words.weapon)
self.contents.draw_text(304, 0, 304, 32, sprintf("%s:%d",
$data_system.words.atk, @item.atk))
self.contents.draw_text(0, 32, 304, 32, "#{$data_system.words.pdef}:" +
(@item.pdef != 0 ? @item.pdef.to_s : SIEXP_DEFEVA_NOT))
self.contents.draw_text(304, 32, 304, 32, "#{$data_system.words.mdef}:" +
(@item.mdef != 0 ? @item.mdef.to_s : SIEXP_DEFEVA_NOT))
self.contents.draw_text(0, 64, 304, 32, "#{$data_system.words.str}:" +
(@item.str_plus < 0 ? "#{@item.str_plus.abs}#{SIEXP_ABI_DOWN}" :
@item.str_plus == 0 ? SIEXP_ABI_NOT :
"#{@item.str_plus }#{SIEXP_ABI_UP}"))
self.contents.draw_text(304, 64, 304, 32, "#{$data_system.words.dex}:" +
(@item.dex_plus < 0 ? "#{@item.dex_plus.abs}#{SIEXP_ABI_DOWN}" :
@item.dex_plus == 0 ? SIEXP_ABI_NOT :
"#{@item.dex_plus }#{SIEXP_ABI_UP}"))
self.contents.draw_text(0, 96, 304, 32, "#{$data_system.words.agi}:" +
(@item.agi_plus < 0 ? "#{@item.agi_plus.abs}#{SIEXP_ABI_DOWN}" :
@item.agi_plus == 0 ? SIEXP_ABI_NOT :
"#{@item.agi_plus }#{SIEXP_ABI_UP}"))
self.contents.draw_text(304, 96, 304, 32, "#{$data_system.words.int}:" +
(@item.int_plus < 0 ? "#{@item.int_plus.abs}#{SIEXP_ABI_DOWN}" :
@item.int_plus == 0 ? SIEXP_ABI_NOT :
"#{@item.int_plus }#{SIEXP_ABI_UP}"))
elsif @item.is_a?(RPG::Armor)
self.contents.draw_text(0, 0, 304, 32, "#{SIEXP_KIND}:" +
eval("$data_system.words.armor#{@item.kind + 1}"))
self.contents.draw_text(304, 0, 304, 32, "#{$data_system.words.pdef}:" +
(@item.pdef != 0 ? "#{@item.pdef}" : SIEXP_DEFEVA_NOT))
self.contents.draw_text(0, 32, 304, 32, "#{$data_system.words.mdef}:" +
(@item.mdef != 0 ? "#{@item.mdef}" : SIEXP_DEFEVA_NOT))
self.contents.draw_text(304, 32, 304, 32, "#{SIEXP_EVA}:" +
(@item.eva == 0 ? SIEXP_DEFEVA_NOT : sprintf("%+d", @item.eva)))
self.contents.draw_text(0, 64, 304, 32, "#{$data_system.words.str}:" +
(@item.str_plus < 0 ? "#{@item.str_plus.abs}#{SIEXP_ABI_DOWN}" :
@item.str_plus == 0 ? SIEXP_ABI_NOT :
"#{@item.str_plus }#{SIEXP_ABI_UP}"))
self.contents.draw_text(304, 64, 304, 32, "#{$data_system.words.dex}:" +
(@item.dex_plus < 0 ? "#{@item.dex_plus.abs}#{SIEXP_ABI_DOWN}" :
@item.dex_plus == 0 ? SIEXP_ABI_NOT :
"#{@item.dex_plus }#{SIEXP_ABI_UP}"))
self.contents.draw_text(0, 96, 304, 32, "#{$data_system.words.agi}:" +
(@item.agi_plus < 0 ? "#{@item.agi_plus.abs}#{SIEXP_ABI_DOWN}" :
@item.agi_plus == 0 ? SIEXP_ABI_NOT :
"#{@item.agi_plus }#{SIEXP_ABI_UP}"))
self.contents.draw_text(304, 96, 304, 32, "#{$data_system.words.int}:" +
(@item.int_plus < 0 ? "#{@item.int_plus.abs}#{SIEXP_ABI_DOWN}" :
@item.int_plus == 0 ? SIEXP_ABI_NOT :
"#{@item.int_plus }#{SIEXP_ABI_UP}"))
end
end
#--------------------------------------------------------------------------
# ● 効果範囲文字列を取得
#--------------------------------------------------------------------------
def scope_str
return SIEXP_UNKNOWN if @item.common_event_id > 0
return case @item.scope
when 0 then SIEXP_SCOPE_NOT
when 1 then SIEXP_SCOPE_SE
when 2 then SIEXP_SCOPE_AE
when 3 then SIEXP_SCOPE_SA
when 4 then SIEXP_SCOPE_AA
when 5 then "#{SIEXP_SCOPE_SA} (#{$data_system.words.hp} 0)"
when 6 then "#{SIEXP_SCOPE_AA} (#{$data_system.words.hp} 0)"
when 7 then SIEXP_SCOPE_USER
end
end
#--------------------------------------------------------------------------
# ● 使用可能時文字列を取得
#--------------------------------------------------------------------------
def occasion_str
return case @item.occasion
when 0 then SIEXP_NORMAL
when 1 then SIEXP_ONLYBATTLE
when 2 then SIEXP_ONLYMENU
when 3 then SIEXP_UNUSABLE
end
end
#--------------------------------------------------------------------------
# ● パラメータ上昇量文字列を取得
#--------------------------------------------------------------------------
def parameter_str
return SIEXP_UNKNOWN if @item.common_event_id > 0
case @item.parameter_type
when 0
return SIEXP_PARAMPTS_NOT
when 1
return sprintf("%s%s+%d", SIEXP_MAX, $data_system.words.hp,
@item.parameter_points)
when 2
return sprintf("%s%s+%d", SIEXP_MAX, $data_system.words.sp,
@item.parameter_points)
when 3
return sprintf("%s+%d", $data_system.words.str, @item.parameter_points)
when 4
return sprintf("%s+%d", $data_system.words.dex, @item.parameter_points)
when 5
return sprintf("%s+%d", $data_system.words.agi, @item.parameter_points)
when 6
return sprintf("%s+%d", $data_system.words.int, @item.parameter_points)
end
end
#--------------------------------------------------------------------------
# ● HP 回復量文字列を取得
#--------------------------------------------------------------------------
def recover_hp_str
return SIEXP_UNKNOWN if @item.common_event_id > 0
value = @item.recover_hp_rate != 0 ? "#{@item.recover_hp_rate}%" : ""
if value.empty? or @item.recover_hp != 0
value.concat(sprintf("%#{value.empty? ? '' : '+'}d", @item.recover_hp))
end
return value
end
#--------------------------------------------------------------------------
# ● SP 回復量文字列を取得
#--------------------------------------------------------------------------
def recover_sp_str
return SIEXP_UNKNOWN if @item.common_event_id > 0
value = @item.recover_sp_rate != 0 ? "#{@item.recover_sp_rate}%" : ""
if value.empty? or @item.recover_sp != 0
value.concat(sprintf("%#{value.empty? ? '' : '+'}d", @item.recover_sp))
end
return value
end
end
#----------------------------------------------------------------------------
# ◆ Window_Skill クラス
#----------------------------------------------------------------------------
class Window_Skill < Window_Selectable
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# actor : アクター
#--------------------------------------------------------------------------
alias lfr1_old_init initialize
def initialize(actor)
lfr1_old_init(actor)
self.height = 256
end
end
#---------------------------------------------------------------------------
# ◆ Window_SkillDetail クラス
#----------------------------------------------------------------------------
class Window_SkillDetail < Window_Base
include(Lufar)
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :skill
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(sk)
super(0, 384, 640, 96)
self.contents = Bitmap.new(width - 32, height - 32)
self.skill = sk
end
#--------------------------------------------------------------------------
# ● スキルの設定
#--------------------------------------------------------------------------
def skill=(sk)
@skill = sk
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
if @skill.nil?
self.contents.draw_text(self.contents.rect, SIEXP_NO_SKILL, 1)
return
end
self.contents.draw_text(0, 0, 304, 32, sprintf("%s:%s",
SIEXP_KIND, kind_str))
self.contents.draw_text(304, 0, 304, 32, sprintf("%s:%s",
SIEXP_OCCASION, occasion_str))
self.contents.draw_text(0, 32, 304, 32, sprintf("%s:%s",
SIEXP_SCOPE, scope_str))
self.contents.draw_text(304, 32, 304, 32, sprintf("%s:%s", SIEXP_POWER,
@skill.common_event_id > 0 ? SIEXP_UNKNOWN : @skill.power.to_s))
end
#--------------------------------------------------------------------------
# ● 種別文字列を取得
#--------------------------------------------------------------------------
def kind_str
return SIEXP_UNKNOWN if @skill.common_event_id > 0
return @skill.atk_f > 0 ? SIEXP_KIND_PHYSICAL : SIEXP_KIND_MAGICAL
end
#--------------------------------------------------------------------------
# ● 効果範囲文字列を取得
#--------------------------------------------------------------------------
def scope_str
return SIEXP_UNKNOWN if @skill.common_event_id > 0
return case @skill.scope
when 0 then SIEXP_SCOPE_NOT
when 1 then SIEXP_SCOPE_SE
when 2 then SIEXP_SCOPE_AE
when 3 then SIEXP_SCOPE_SA
when 4 then SIEXP_SCOPE_AA
when 5 then "#{SIEXP_SCOPE_SA} (#{$data_system.words.hp} 0)"
when 6 then "#{SIEXP_SCOPE_AA} (#{$data_system.words.hp} 0)"
when 7 then SIEXP_SCOPE_USER
end
end
#--------------------------------------------------------------------------
# ● 使用可能時文字列を取得
#--------------------------------------------------------------------------
def occasion_str
return case @skill.occasion
when 0 then SIEXP_NORMAL
when 1 then SIEXP_ONLYBATTLE
when 2 then SIEXP_ONLYMENU
when 3 then SIEXP_UNUSABLE
end
end
end
#----------------------------------------------------------------------------
# ◆ Scene_Item クラス
#----------------------------------------------------------------------------
class Scene_Item
#--------------------------------------------------------------------------
# ● メイン処理
#--------------------------------------------------------------------------
alias lfr1_old_main main
def main
@explain_window = Window_ItemDetail.new(nil)
for i in 1...$data_items.size
if $game_party.item_number(i) > 0
@explain_window.item = $data_items[i]
break
end
end
lfr1_old_main
@explain_window.dispose
end
#--------------------------------------------------------------------------
# ● フレーム更新 (アイテムウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
alias lfr1_old_udit update_item
def update_item
lfr1_old_udit
if @explain_window.item != @item_window.item
@explain_window.item = @item_window.item
end
end
end
#----------------------------------------------------------------------------
# ◆ Scene_Skill クラス
#----------------------------------------------------------------------------
class Scene_Skill
#--------------------------------------------------------------------------
# ● メイン処理
#--------------------------------------------------------------------------
alias lfr1_old_main main
def main
@explain_window = Window_SkillDetail.new(
$game_party.actors[@actor_index].skills.size > 0 ?
$data_skills[$game_party.actors[@actor_index].skills[0]] :
nil
)
lfr1_old_main
@explain_window.dispose
end
#--------------------------------------------------------------------------
# ● フレーム更新 (スキルウィンドウがアクティブの場合)
#--------------------------------------------------------------------------
alias lfr1_old_udsk update_skill
def update_skill
lfr1_old_udsk
if @explain_window.skill != @skill_window.skill
@explain_window.skill = @skill_window.skill
end
end
end
戻る