Project1
标题:
如何让菜单栏状态内显示特殊属性
[打印本页]
作者:
傲视群雄
时间:
2015-10-25 18:08
标题:
如何让菜单栏状态内显示特殊属性
360截图20151025180705546.png
(88.88 KB, 下载次数: 18)
下载附件
保存到相册
2015-10-25 18:07 上传
比如在这个位置显示暴击百分百 这类的
作者:
三途亚梦
时间:
2015-10-27 17:52
请善用一下论坛搜索,类似的问题有很多。
作者:
jianyulei
时间:
2015-10-28 11:13
#===============================================================================
# ■拡張ステータス画面セカンド for RGSS3 Ver0.75-α
# □作成者 kure
#===============================================================================
$kure_integrate_script = {} if $kure_integrate_script == nil
$kure_integrate_script[:ExStatus] = 100
p "拡張ステータス画面セカンド"
module KURE
module ExStatus
#初期設定
MAIN_MENU = [] ; SUB_MENU = [] ; VIEW_SUB_MENU = [] ; SUB_MENU[1] = []
FREE_SPACE = [] ; PROFILE = [] ; PROFILE2 = [] ; VIEW_Ex1 = [] ; VIEW_Ex2 = []
VIEW_ELEMENT = []
#描画方法の選択---------------------------------------------------------------
#各ステータスの表示方法
#VIEW_MODE(0=値を表示 1=補正値を表示)
VIEW_MODE = 0
#メニュー選択肢の設定---------------------------------------------------------
#メニューの設定
#MAIN_MENU[ID] = 表示名
MAIN_MENU[0] = "能力值" #(ID0)能力値
MAIN_MENU[1] = "基本情报" #(ID1)基本情報
MAIN_MENU[2] = "職業情報" #(ID2)職業履歴
MAIN_MENU[3] = "装备情报" #(ID3)装備情報
MAIN_MENU[4] = "プロフィール" #(ID4)プロフィール
#表示ページのIDリスト(選択肢に表示される項目)
VIEW_MAIN_MENU = [0,1,3]
#サブメニュー選択肢の設定-----------------------------------------------------
#基本情報(ID1)のサブメニュー設定-------------------------------------------
#SUB_MENU[1][ID] = 表示名
SUB_MENU[1][0] = "特征变化" #(ID0)アクター特徴
SUB_MENU[1][1] = "属性有効度" #(ID1)属性耐性
SUB_MENU[1][2] = "状态耐性" #(ID2)ステート耐性
SUB_MENU[1][3] = "習得中スキル" #(ID3)AP制スキル習得画面(未実装)
SUB_MENU[1][4] = "フリースペース" #(ID4)フリースペース
#サブメニューのページリスト(選択肢に表示される項目)
#VIEW_SUB_MENU[ID] = [サブメニューIDリスト]
VIEW_SUB_MENU[1] = [0,1,2]
#職業履歴(ID2)、装備情報(ID3)のサブメニューは自動的に作成されます。
#0ページ(能力値)--------------------------------------------------------
#VIEW_Ex1[ID] = ["表示名",表示切り替え]
#VIEW_Ex2[ID] = ["表示名",表示切り替え]
#表示名 … 追加能力値の表示名
#表示切り替え … (0=表示、1=非表示)
#追加能力値
VIEW_Ex1[0] = ["命中率",0] #(ID0)命中率
VIEW_Ex1[1] = ["回避率",0] #(ID1)回避率
VIEW_Ex1[2] = ["会心率",0] #(ID2)会心率
VIEW_Ex1[3] = ["会心回避率",0] #(ID3)会心回避率
VIEW_Ex1[4] = ["魔法回避率",0] #(ID4)魔法回避率
VIEW_Ex1[5] = ["魔法反射率",0] #(ID5)魔法反射率
VIEW_Ex1[6] = ["反撃率",0] #(ID6)反撃率
VIEW_Ex1[7] = ["HP再生率",0] #(ID7)HP再生率
VIEW_Ex1[8] = ["MP再生率",0] #(ID8)MP再生率
VIEW_Ex1[9] = ["TP再生率",0] #(ID9)TP再生率
#特殊能力値
VIEW_Ex2[0] = ["仇恨",0] #(ID0)狙われ率
VIEW_Ex2[1] = ["防御効果",0] #(ID1)防御効果率
VIEW_Ex2[2] = ["回复効果",0] #(ID2)回復効果率
VIEW_Ex2[3] = ["药的知识",0] #(ID3)薬の知識
VIEW_Ex2[4] = ["MP消費率",0] #(ID4)MP消費率
VIEW_Ex2[5] = ["TP获得率",0] #(ID5)TPチャージ率
VIEW_Ex2[6] = ["受物理伤害率",0] #(ID6)物理ダメージ率
VIEW_Ex2[7] = ["受魔法伤害率",0] #(ID7)魔法ダメージ率
VIEW_Ex2[8] = ["地形伤害率",1] #(ID8)床ダメージ率
VIEW_Ex2[9] = ["经验获得率",0] #(ID9)経験獲得率
#1-1ページ(属性有効度)---------------------------------------------------------
#属性有効度を表示する項目を属性IDで選択します
#VIEW_ELEMENT[表示順] = [属性ID, アイコンID]
#アイコンを使用しない場合はIDに 0 を設定してください
VIEW_ELEMENT[1] = [1, 0]
VIEW_ELEMENT[2] = [2, 0]
VIEW_ELEMENT[3] = [3, 0]
VIEW_ELEMENT[4] = [4, 0]
VIEW_ELEMENT[5] = [5, 0]
VIEW_ELEMENT[6] = [6, 0]
VIEW_ELEMENT[7] = [7, 0]
VIEW_ELEMENT[8] = [8, 0]
VIEW_ELEMENT[9] = [9, 0]
VIEW_ELEMENT[10] = [12, 0]
VIEW_ELEMENT[11] = [13, 0]
VIEW_ELEMENT[12] = [14, 0]
VIEW_ELEMENT[13] = [15, 0]
VIEW_ELEMENT[14] = [16, 0]
VIEW_ELEMENT[15] = [17, 0]
VIEW_ELEMENT[16] = [18, 0]
#1-2ページ目描画対応、ステート耐性の表示--------------------------------------
#ステート耐性を表示する項目をステートIDで選択します
VIEW_STATE = [0,1,2,3,4,5,6,7,8,10,12,13,14,15,17,21,22]
#1-4ページ対応、フリースペース-----------------------------------------------
#FREE_SPACE[アクターID] = [描画内容1行目,…]
#区切りはダブルクオテーション「"」ではなくシングルクオテーション「'」です
FREE_SPACE[1] = ['','','']
FREE_SPACE[2] = ['','','']
FREE_SPACE[3] = ['','','']
#3ページ目(装備情報)---------------------------------------------------------
#拡張ページの表示設定(装備品個別管理拡張)
#ID2 … 装備品のスロットアイテム
#ID3 … 装備品のシンボル
#VIEW_Ex3 = [表示するページのIDリスト]
VIEW_Ex3 = []
#4-1ページ目描画対応----------------------------------------------------------
#PROFILE_NUM = [アクター1の変数,アクター2の変数,…]
#アクターのプロフィール描画の切り替え用の変数を指定します。
#項目数はアクター数と同一にすること
PROFILE_NUM = [1,0,0,0,0,0,0,0,0,0]
#PROFILE[アクターID] = [
# 変数未設定又は0 [立ち絵設定,プロフィール内容1行目,…],
# 変数1 [立ち絵設定,プロフィール内容1行目,…],
# …
# ]
#顔グラフィックは「Picture」フォルダに入れておくこと
#
#立ち絵設定(1 = 表示する ,ファイル名 = 指定ピクチャを表示, nil = 表示しない)
#1を指定した場合、読み込まれる立ち絵ファイルのファイル名は「ファイル名-INDEX値です」
#例)
#『"Actor1"』のINDEX6番目のアクターの立ち絵ファイル名は『"Actor1-6"』とすること
#
#ファイル名で指定した場合は指定したファイル名を読み込みます。
#
#
#区切りはダブルクオテーション「"」ではなくシングルクオテーション「'」です
PROFILE[1] = [
[nil,
'変数未設定(=0)または0の時の描画です。',
''],
[nil,
'変数の値が1の時の描画です。',
'プロフィールを変数で切り替えるには',
'項目を追加してください']
]
PROFILE[2] = [
[nil,
'プロフィールの描画テストをしています',
'配列を使用して描画しているので、改行',
'したい場所で「,」で区切っていけばいいですね']
]
PROFILE[3] = [
[nil,
'顔文字を表示しない場合もテストしておきます。',
'nilを入れないと顔文字があると判断されるので',
'御注意を']
]
#4-2ページ目描画対応----------------------------------------------------------
#PROFILE_NUM2 = [アクター1の変数,アクター2の変数,…]
#アクターのプロフィール描画の切り替え用の変数を指定します。
#項目数はアクター数と同一にすること
PROFILE_NUM2 = [1,0,0,0,0,0,0,0,0,0]
#PROFILE2[アクターID] = [
# 変数未設定又は0 [プロフィール内容1行目,…],
# 変数1 [プロフィール内容1行目,…],
# …
# ]
PROFILE2[1] = [
['2ページ目の描画テストをしています']
]
end
end
#==============================================================================
# ■ RPG::Actor(追加定義)
#==============================================================================
class RPG::Actor < RPG::BaseItem
#--------------------------------------------------------------------------
# ◇ ステータス画面に表示する名前の定義(追加定義)
#--------------------------------------------------------------------------
def profile_name
@note.match(/<表示名\s?(.+?)\s?>/)
return @name unless $1
return $1
end
end
#==============================================================================
# ■ Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ★ 経験値リストの呼び出し(追加定義)
#--------------------------------------------------------------------------
def exp_list
@exp.to_a
end
#--------------------------------------------------------------------------
# ★ 指定IDの職業の経験値の取得
#--------------------------------------------------------------------------
def adv_exp(id)
@exp[id]
end
end
#==============================================================================
# ■ Scene_Status(再定義)
#==============================================================================
class Scene_Status < Scene_MenuBase
#--------------------------------------------------------------------------
# ● 開始処理
#--------------------------------------------------------------------------
def start
super
create_status_main_command
create_status_sub_command
create_draw_window
create_small_status_window
window_setup
end
#--------------------------------------------------------------------------
# ● メインコマンドウィンドウの作成
#--------------------------------------------------------------------------
def create_status_main_command
@main_command_window = Window_k_ExStatus_Main_Command.new(0,0)
@main_command_window.activate
@main_command_window.select(0)
@main_command_window.set_handler(:ok, method(:select_main_command))
@main_command_window.set_handler(:cancel, method(:return_scene))
@main_command_window.set_handler(:pagedown, method(:next_actor))
@main_command_window.set_handler(:pageup, method(:prev_actor))
end
#--------------------------------------------------------------------------
# ● サブコマンドウィンドウの作成
#--------------------------------------------------------------------------
def create_status_sub_command
x = 0
y = @main_command_window.height + 24
height = Graphics.height - @main_command_window.height - 24
@sub_command_window = Window_k_ExStatus_Sub_Menu_Command.new(x,y,height)
@sub_command_window.unselect
@sub_command_window.opacity = 0
@sub_command_window.z += 100
@sub_command_window.deactivate
@sub_command_window.set_handler(:cancel, method(:on_sub_command_cancel))
@sub_command_window.set_handler(:pagedown, method(:next_actor))
@sub_command_window.set_handler(:pageup, method(:prev_actor))
end
#--------------------------------------------------------------------------
# ● 描画領域ウィンドウの作成
#--------------------------------------------------------------------------
def create_draw_window
x = 0
y = @main_command_window.height
ww = Graphics.width
wy = Graphics.height - @main_command_window.height
@draw_window = Window_k_ExStatus_Draw.new(x,y,ww,wy)
@draw_window.refresh
end
#--------------------------------------------------------------------------
# ● キャラクターのスモールステータスウィンドウ作成
#--------------------------------------------------------------------------
def create_small_status_window
x = @main_command_window.width
y = 0
ww = Graphics.width - @main_command_window.width
height = @main_command_window.height
@status_window = Window_k_ExStatus_Small_Status.new(x,y,ww,height)
end
#--------------------------------------------------------------------------
# ● ウィンドウのセットアップ処理
#--------------------------------------------------------------------------
def window_setup
@main_command_window.sub_command_window = @sub_command_window
@main_command_window.draw_window = @draw_window
@sub_command_window.draw_window = @draw_window
end
#--------------------------------------------------------------------------
# ● メインコマンド→サブコマンド
#--------------------------------------------------------------------------
def select_main_command
case KURE::ExStatus::VIEW_MAIN_MENU[@main_command_window.index]
when 0,4
@main_command_window.activate
when 1,2,3
@main_command_window.deactivate
@sub_command_window.select(0)
@sub_command_window.activate
end
end
#--------------------------------------------------------------------------
# ● サブコマンド→メインコマンド
#--------------------------------------------------------------------------
def on_sub_command_cancel
@main_command_window.activate
@sub_command_window.select(0)
@sub_command_window.unselect
@sub_command_window.deactivate
end
#--------------------------------------------------------------------------
# ● アクターの切り替え
#--------------------------------------------------------------------------
def on_actor_change
@status_window.refresh
@draw_window.refresh
@sub_command_window.refresh
if @main_command_window.index > -1
@main_command_window.activate
end
if @sub_command_window.index > -1
@sub_command_window.activate
@main_command_window.deactivate
end
end
end
#==============================================================================
# ■ Window_k_ExStatus_Main_Command
#==============================================================================
class Window_k_ExStatus_Main_Command < Window_Command
attr_accessor :sub_command_window
attr_accessor :draw_window
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y)
end
#--------------------------------------------------------------------------
# ● ウィンドウ高さの取得
#--------------------------------------------------------------------------
def window_height
fitting_height(4)
end
#--------------------------------------------------------------------------
# ● →キーの処理
#--------------------------------------------------------------------------
def cursor_right(wrap = false)
@draw_window.draw_index(1) if @draw_window
end
#--------------------------------------------------------------------------
# ● ←キーの処理
#--------------------------------------------------------------------------
def cursor_left(wrap = false)
@draw_window.draw_index(-1) if @draw_window
end
#--------------------------------------------------------------------------
# ● カーソル位置の設定
#--------------------------------------------------------------------------
def index=(index)
@index = index
update_cursor
call_update_help
@sub_command_window.main_command_index = @index if @sub_command_window
@draw_window.draw_sub_command_index = 0 if @draw_window
@draw_window.main_command_index = @index if @draw_window
end
#--------------------------------------------------------------------------
# ● コマンドリストの作成
#--------------------------------------------------------------------------
def make_command_list
KURE::ExStatus::VIEW_MAIN_MENU.each{|id| add_command(KURE::ExStatus::MAIN_MENU[id], :ok)}
end
end
#==============================================================================
# ■ Window_k_ExStatus_Small_Status
#==============================================================================
class Window_k_ExStatus_Small_Status < Window_Base
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_reader :pending_index # 保留位置(並び替え用)
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x, y,width,height)
super(x, y, width, height)
refresh
end
#--------------------------------------------------------------------------
# ● 項目の描画
#--------------------------------------------------------------------------
def draw_status
@actor = $game_party.menu_actor
draw_actor_face(@actor, 0, 0)
draw_actor_name(@actor, 100, line_height * 0)
draw_actor_class(@actor, 220,line_height * 0)
draw_actor_icons(@actor, 100,line_height * 2)
draw_actor_level(@actor, 100,line_height * 1)
draw_actor_hp(@actor, 220,line_height * 1)
draw_actor_mp(@actor, 220,line_height * 2)
draw_exp_info(120,line_height * 3)
end
#--------------------------------------------------------------------------
# ◎ 経験値情報の描画(追加定義)
#--------------------------------------------------------------------------
def draw_exp_info(x, y)
s1 = @actor.max_level? ? "-------" : @actor.next_level_exp - @actor.exp
s_next = "Next"
change_color(system_color)
draw_text(x + 100, y , 45, line_height, s_next)
change_color(normal_color)
draw_text(x + 140, y , 85, line_height, s1, 2)
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_status
end
end
#==============================================================================
# ■ Window_k_ExStatus_Sub_Menu_Command
#==============================================================================
class Window_k_ExStatus_Sub_Menu_Command < Window_Command
attr_accessor :draw_window
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x, y,height)
@height = height
@main_command_index = 0
super(x, y)
end
#--------------------------------------------------------------------------
# ● ウィンドウ幅と高さの取得
#--------------------------------------------------------------------------
def window_width ; return 156 ; end
def window_height ; return @height ; end
#--------------------------------------------------------------------------
# ● カーソル位置の設定
#--------------------------------------------------------------------------
def index=(index)
@index = index
update_cursor
call_update_help
return if !@draw_window or @index < 0
@draw_window.sub_command_index = @index
@draw_window.draw_sub_command_index = 0
end
#--------------------------------------------------------------------------
# ● →キーの処理
#--------------------------------------------------------------------------
def cursor_right(wrap = false)
@draw_window.draw_sub_command_index(1) if @draw_window
end
#--------------------------------------------------------------------------
# ● ←キーの処理
#--------------------------------------------------------------------------
def cursor_left(wrap = false)
@draw_window.draw_sub_command_index(-1) if @draw_window
end
#--------------------------------------------------------------------------
# ● メインコマンドインデックスの設定
#--------------------------------------------------------------------------
def main_command_index=(main_command_index)
return if @main_command_index == main_command_index
@main_command_index = main_command_index
refresh
end
#--------------------------------------------------------------------------
# ● コマンドリストの作成
#--------------------------------------------------------------------------
def make_command_list
@actor = $game_party.menu_actor
case KURE::ExStatus::VIEW_MAIN_MENU[@main_command_index]
when 0 ; make_command_list_1
when 1 ; make_command_list_2
when 2 ; make_command_list_3
when 3 ; make_command_list_4
when 4 ; make_command_list_5
end
end
#--------------------------------------------------------------------------
# ● サブコマンド1の作成
#--------------------------------------------------------------------------
def make_command_list_1
end
#--------------------------------------------------------------------------
# ● サブコマンド2の作成
#--------------------------------------------------------------------------
def make_command_list_2
KURE::ExStatus::VIEW_SUB_MENU[1].each{|com| add_command(KURE::ExStatus::SUB_MENU[1][com], :ok)}
end
#--------------------------------------------------------------------------
# ● サブコマンド3の作成
#--------------------------------------------------------------------------
def make_command_list_3
add_command("職業情報", :ok)
add_command("職業履歴", :ok)
end
#--------------------------------------------------------------------------
# ● サブコマンド4の作成
#--------------------------------------------------------------------------
def make_command_list_4
@actor.equips.each{|com| text = com ? com.name : "" ; add_command(text, :ok)}
end
#--------------------------------------------------------------------------
# ● サブコマンド5の作成
#--------------------------------------------------------------------------
def make_command_list_5
end
end
#==============================================================================
# ■ Window_k_ExStatus_Draw
#==============================================================================
class Window_k_ExStatus_Draw < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super
@main_command_index = 0
@sub_command_index = 0
@draw_index = 0
@draw_sub_command_index = 0
@roop_call = 6
@draw_list = nil
end
#--------------------------------------------------------------------------
# ● メインコマンドインデックスの設定
#--------------------------------------------------------------------------
def main_command_index=(main_command_index)
return if @main_command_index == main_command_index
@main_command_index = main_command_index
refresh
end
#--------------------------------------------------------------------------
# ● サブコマンドインデックスの設定
#--------------------------------------------------------------------------
def sub_command_index=(sub_command_index)
return if @sub_command_index == sub_command_index
@sub_command_index = sub_command_index
end
#--------------------------------------------------------------------------
# ● 描画メインインデックスの設定
#--------------------------------------------------------------------------
def draw_index=(draw_index)
return if @draw_index == draw_index
@draw_index = draw_index
refresh
end
#--------------------------------------------------------------------------
# ● 描画サブインデックスの設定
#--------------------------------------------------------------------------
def draw_sub_command_index=(draw_sub_command_index)
@draw_sub_command_index = draw_sub_command_index
refresh
end
#--------------------------------------------------------------------------
# ● 描画メインインデックスの設定
#--------------------------------------------------------------------------
def draw_index(value)
@draw_index += value
refresh
end
#--------------------------------------------------------------------------
# ● 描画サブインデックスの設定
#--------------------------------------------------------------------------
def draw_sub_command_index(value)
@draw_sub_command_index += value
refresh
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
@actor = $game_party.menu_actor
contents.clear
case KURE::ExStatus::VIEW_MAIN_MENU[@main_command_index]
when 0 ; page_0_draw
when 1 ; page_1_draw
when 2 ; page_2_draw
when 3 ; page_3_draw
when 4 ; page_4_draw
end
end
#--------------------------------------------------------------------------
# ● 基本能力値(1-1ページの描画)
#--------------------------------------------------------------------------
def page_0_draw
last_font_size = contents.font.size
@draw_postion_xparam = 0
@draw_postion_sparam = 0
3.times{|index|
pos_x = 5 + index * ((contents.width - 5) / 3)
contents.font.size = last_font_size
case index
when 0 ; text = "基本能力"
when 1 ; text = "特殊能力"
when 2 ; text = "追加能力"
end
draw_gauge(pos_x ,0, ((contents.width - 5) / 3) - 15, 1, mp_gauge_color2,crisis_color)
draw_text(pos_x , 0, 160, line_height, text)
contents.font.size = 20
case index
when 0 ; 8.times {|i| draw_actor_param(@actor, pos_x, line_height * 1, i) }
when 1 ; 10.times {|i| draw_actor_param(@actor, pos_x, line_height * 1, i + 10) }
when 2 ; 10.times {|i| draw_actor_param(@actor, pos_x, line_height * 1, i + 20) }
end
}
contents.font.size = last_font_size
end
#--------------------------------------------------------------------------
# ● 能力値の描画(0ページの描画)
#--------------------------------------------------------------------------
def draw_actor_param(actor, x, y, param_id)
width = ((contents.width - 5) / 3) - 15
case param_id
when 0..7
draw_index = param_id
pos_y = y + contents.font.size * draw_index
change_color(system_color)
draw_text(x, pos_y, width, contents.font.size, Vocab::param(param_id))
change_color(normal_color)
draw_text(x, pos_y, width, contents.font.size, actor.param(param_id), 2)
when 10..19
xparam_id = param_id - 10
return if KURE::ExStatus::VIEW_Ex1[xparam_id][1] == 1
draw_index = @draw_postion_xparam
pos_y = y + contents.font.size * draw_index
@draw_postion_xparam += 1
value = (@actor.xparam(xparam_id) * 100).to_i
draw_str = draw_value_s(value, 0)
change_color(system_color)
draw_text(x, pos_y, width, contents.font.size, KURE::ExStatus::VIEW_Ex1[xparam_id][0])
change_color(normal_color)
draw_text(x, pos_y, width, contents.font.size, draw_str, 2)
when 20..29
sparam_id = param_id - 20
return if KURE::ExStatus::VIEW_Ex2[sparam_id][1] == 1
draw_index = @draw_postion_sparam
pos_y = y + contents.font.size * draw_index
@draw_postion_sparam += 1
value = (@actor.sparam(sparam_id) * 100).to_i
draw_str = draw_value_s(value, 100)
change_color(system_color)
draw_text(x, pos_y, width, contents.font.size, KURE::ExStatus::VIEW_Ex2[sparam_id][0])
change_color(normal_color)
draw_text(x, pos_y, width, contents.font.size, draw_str, 2)
end
end
#--------------------------------------------------------------------------
# ● 基本情報(1ページの描画)
#--------------------------------------------------------------------------
def page_1_draw
draw_gauge(0,0, 132, 1, mp_gauge_color2,crisis_color)
draw_text(0, 0, 132, line_height,KURE::ExStatus::MAIN_MENU[KURE::ExStatus::VIEW_MAIN_MENU[@main_command_index]])
case KURE::ExStatus::VIEW_SUB_MENU[1][@sub_command_index]
when 0 ; page_1_0_draw
when 1 ; page_1_1_draw
when 2 ; page_1_2_draw
when 3 ; page_1_3_draw
when 4 ; page_1_4_draw
when 5 ; page_1_5_draw
end
end
#--------------------------------------------------------------------------
# ● アクター特徴(1-0ページの描画)
#--------------------------------------------------------------------------
def page_1_0_draw
draw_gauge(140,0, contents.width - 140, 1, mp_gauge_color2,crisis_color)
draw_text(140, 0, 200, line_height, "特征变化")
last_font_size = contents.font.size
contents.font.size = 20
draw_list = get_feature_text(@actor)
max = draw_list.size.div(22)
max -= 1 if draw_list.size.modulo(22) == 0
@draw_sub_command_index = 0 if @draw_sub_command_index > max
@draw_sub_command_index = max if @draw_sub_command_index < 0
first = 0 + 22 * @draw_sub_command_index
last = [21 + 22 * @draw_sub_command_index, draw_list.size].min
draw_list[first..last].each_with_index{|text, index|
pos_x = 140 + index.modulo(2) * (((contents.width - 140)/ 2) - 5)
pos_y = line_height + contents.font.size * index.div(2)
draw_text(pos_x, pos_y, ((contents.width - 140) / 2) - 5, contents.font.size, text)
}
draw_text(140, contents.height - line_height, contents.width - 140, line_height, "← →:翻页( " + (@draw_sub_command_index + 1).to_s + " / " + (max + 1).to_s + ")",1)
contents.font.size = last_font_size
end
#--------------------------------------------------------------------------
# ● 属性有効度(1-1ページの描画)
#--------------------------------------------------------------------------
def page_1_1_draw
draw_gauge(140,0, contents.width - 140, 1, mp_gauge_color2,crisis_color)
draw_text(140, 0, 200, line_height, "属性有効度")
#1ページの最大描画数、ページ数を取得
elements = KURE::ExStatus::VIEW_ELEMENT.size
max_list = (((contents.height - 48) / line_height).to_i) * 2
max_page = (elements / max_list).to_i + 1
#ページ切り替えによる表示項目を取得
@draw_sub_command_index = 0 if @draw_sub_command_index > max_page - 1
@draw_sub_command_index = max_page - 1 if @draw_sub_command_index < 0
first_num = max_list * @draw_sub_command_index + 1
last_num = [(max_list * (@draw_sub_command_index + 1)), elements].min + 1
draw_actor_elements_regist(@actor, 140, line_height * 1, KURE::ExStatus::VIEW_ELEMENT[first_num..last_num])
draw_text(140, contents.height - line_height, contents.width - 140, line_height, "← →:翻页( " + (@draw_sub_command_index + 1).to_s + " / " + max_page.to_s + ")",1)
end
#--------------------------------------------------------------------------
# ● 属性有効度の描画(1-1ページの描画)
#--------------------------------------------------------------------------
def draw_actor_elements_regist(actor, x, y, list)
list.each_with_index{|block, index|
pos_x = x + ((contents.width - 140) / 2) * index.modulo(2)
pos_y = y + line_height * index.div(2)
name = $data_system.elements[block[0]]
icon_index = block[1]
value = draw_value_s((@actor.element_rate(block[0]) * 100).to_i, 100)
draw_icon(icon_index, pos_x, pos_y)
change_color(system_color)
draw_text(pos_x + 30, pos_y, 80, line_height, name)
change_color(normal_color)
draw_text(pos_x + 110, pos_y, ((contents.width - 140) / 2) - 120, line_height, value, 2)
}
end
#--------------------------------------------------------------------------
# ● ステート耐性(1-2ページの描画)
#--------------------------------------------------------------------------
def page_1_2_draw
draw_gauge(140,0, contents.width - 140, 1, mp_gauge_color2,crisis_color)
draw_text(140, 0, 200, line_height, "状态耐性")
#1ページの最大描画数、ページ数を取得
state = KURE::ExStatus::VIEW_STATE.size
max_list = (((contents.height - 48) / line_height).to_i) * 2
max_page = (state / max_list).to_i + 1
#ページ切り替えによる表示項目を取得
@draw_sub_command_index = 0 if @draw_sub_command_index > max_page - 1
@draw_sub_command_index = max_page - 1 if @draw_sub_command_index < 0
first_num = max_list * @draw_sub_command_index + 1
last_num = [(max_list * (@draw_sub_command_index + 1)), state].min + 1
draw_actor_state_regist(@actor, 140, line_height * 1, KURE::ExStatus::VIEW_STATE[first_num..last_num])
draw_text(140, contents.height - line_height, contents.width - 140, line_height, "← →:翻页( " + (@draw_sub_command_index + 1).to_s + " / " + max_page.to_s + ")",1)
end
#--------------------------------------------------------------------------
# ● ステート耐性の描画(1-2ページの描画)
#--------------------------------------------------------------------------
def draw_actor_state_regist(actor, x, y, list)
list.each_with_index{|id, index|
pos_x = x + ((contents.width - 140) / 2) * index.modulo(2)
pos_y = y + line_height * index.div(2)
name = $data_states[id].name
icon_index = $data_states[id].icon_index
value = draw_value_s((@actor.state_rate(id) * 100).to_i, 100)
value = "無効" if @actor.state_resist?(id)
draw_icon(icon_index, pos_x, pos_y)
change_color(system_color)
draw_text(pos_x + 30, pos_y, 80, line_height, name)
change_color(normal_color)
draw_text(pos_x + 110, pos_y, ((contents.width - 140) / 2) - 120, line_height, value, 2)
}
end
#--------------------------------------------------------------------------
# ● 習得中スキルリスト(1-3ページの描画)
#--------------------------------------------------------------------------
def page_1_3_draw
draw_gauge(140,0, contents.width - 140, 1, mp_gauge_color2,crisis_color)
draw_text(140, 0, 200, line_height, "習得中スキルリスト")
end
#--------------------------------------------------------------------------
# ● 個人能力リスト(1-4ページの描画)
#--------------------------------------------------------------------------
def page_1_4_draw
draw_gauge(140,0, contents.width - 140, 1, mp_gauge_color2,crisis_color)
draw_text(140, 0, 200, line_height, KURE::ExStatus::SUB_MENU[1][4])
draw_FREE_SPACE = KURE::ExStatus::FREE_SPACE[@actor.id]
return unless draw_FREE_SPACE
max = draw_FREE_SPACE.size.div(9)
max -= 1 if draw_FREE_SPACE.size.modulo(9) == 0
@draw_sub_command_index = 0 if @draw_sub_command_index > max
@draw_sub_command_index = max if @draw_sub_command_index < 0
first = 0 + 9 * @draw_sub_command_index
last = [8 + 9 * @draw_sub_command_index, draw_FREE_SPACE.size].min
draw_FREE_SPACE[first..last].each_with_index{|line, index| draw_text_ex(140, line_height * (index + 1), line)}
draw_text(140, contents.height - line_height, contents.width - 140, line_height, "← →:翻页( " + (@draw_sub_command_index + 1).to_s + " / " + (max + 1).to_s + ")",1)
end
#--------------------------------------------------------------------------
# ■ 職業履歴(2ページの描画)
#--------------------------------------------------------------------------
def page_2_draw
draw_gauge(0,0, 132, 1, mp_gauge_color2,crisis_color)
draw_text(0, 0, 126, line_height,KURE::ExStatus::MAIN_MENU[KURE::ExStatus::VIEW_MAIN_MENU[@main_command_index]])
draw_gauge(140,0, contents.width - 140, 1, mp_gauge_color2,crisis_color)
case @sub_command_index
when 0
draw_text(140, 0, 200, line_height, "職業情報")
draw_job_info(140,line_height * 1)
when 1
draw_text(140, 0, 200, line_height, "職業履歴")
draw_job_exp(140,line_height * 1)
end
end
#--------------------------------------------------------------------------
# ■ 職業情報の描画
#--------------------------------------------------------------------------
def draw_job_info(x,y)
class_list = [@actor.class_id]
if $kure_integrate_script[:multiclass]
list = @actor.adv_class_id.collect{|block| block[0] if block}
class_list += list
end
class_list.compact!
class_list.each_with_index{|id, index|
pos_y = y + (line_height * 2) * index
class_name = $data_classes[id].name
class_level = 1
while $data_classes[id].exp_for_level(class_level) <= @actor.adv_exp(id) do
class_level += 1
end
class_level -= 1
draw_text(x, pos_y, 300, contents.font.size, class_name + " Lv " + class_level.to_s)
need = $data_classes[id].exp_for_level(class_level + 1) - $data_classes[id].exp_for_level(class_level)
now = @actor.adv_exp(id) - $data_classes[id].exp_for_level(class_level)
rate = need != 0 ? now.to_f / need : 0
pos_y += line_height
draw_gauge(x + 20, pos_y, 170, rate, tp_gauge_color1, tp_gauge_color2)
change_color(system_color)
draw_text(x + 20, pos_y, 30, line_height, "EXP")
draw_current_and_max_values(x + 20, pos_y, 170, now, need, mp_color(@actor), normal_color)
change_color(system_color)
draw_text(x + 230, pos_y, 40, line_height, "Next")
change_color(normal_color)
draw_text(x + 240, pos_y, contents.width - (x + 250), line_height, (need - now).to_s, 2)
}
end
#--------------------------------------------------------------------------
# ■ 職業経験の描画
#--------------------------------------------------------------------------
def draw_job_exp(x,y)
last_font_size = contents.font.size
contents.font.size = 20
exp_list = @actor.exp_list
max = exp_list.size.div(22)
max -= 1 if exp_list.size.modulo(22) == 0
@draw_sub_command_index = 0 if @draw_sub_command_index > max
@draw_sub_command_index = max if @draw_sub_command_index < 0
first = 0 + 22 * @draw_sub_command_index
last = [21 + 22 * @draw_sub_command_index, exp_list.size].min
exp_list[first..last].each_with_index{|block, index|
pos_x = x + ((contents.width - 140) / 2) * index.modulo(2)
pos_y = y + contents.font.size * index.div(2)
class_name = $data_classes[block[0]].name
class_level = 1
while $data_classes[block[0]].exp_for_level(class_level) <= block[1] do
class_level += 1
end
class_level -= 1
if $kure_integrate_script[:multiclass]
list = @actor.adv_class_id.collect{|block| block[0] if block}
change_color(power_up_color) if block[0] == @actor.class_id or list.include?(block[0])
else
change_color(power_up_color) if block[0] == @actor.class_id
end
draw_text(pos_x, pos_y, (contents.width - 140) / 2 - 15, contents.font.size, class_name)
draw_text(pos_x, pos_y, (contents.width - 140) / 2 - 15, contents.font.size, "Lv " + class_level.to_s, 2)
change_color(normal_color)
}
draw_text(140, contents.height - line_height, contents.width - 140, line_height, "← →:翻页( " + (@draw_sub_command_index + 1).to_s + " / " + (max + 1).to_s + ")",1)
contents.font.size = last_font_size
end
#--------------------------------------------------------------------------
# ▲ 基本情報(3ページの描画)
#--------------------------------------------------------------------------
def page_3_draw
draw_gauge(0,0, 132, 1, mp_gauge_color2,crisis_color)
draw_text(0, 0, 126, line_height,KURE::ExStatus::MAIN_MENU[KURE::ExStatus::VIEW_MAIN_MENU[@main_command_index]])
#アイテム特徴のページ数を決定
item = @actor.equips[@sub_command_index]
if !@draw_list or @draw_list[0] != item
@draw_list = []
@draw_list[0] = item
@draw_list[1] = get_feature_text(item)
end
feature_page = @draw_list[1].size.div(22) + 1
feature_page -= 1 if @draw_list[1].size.modulo(22) == 0
f_page = [1] * feature_page
page_list = [0] + f_page + KURE::ExStatus::VIEW_Ex3
max = page_list.size - 1
@draw_sub_command_index = 0 if @draw_sub_command_index > max
@draw_sub_command_index = max if @draw_sub_command_index < 0
draw_gauge(140,0, contents.width - 140, 1, mp_gauge_color2,crisis_color)
case page_list[@draw_sub_command_index]
when 0
draw_text(140, 0, 200, line_height, "装备属性")
draw_equipments_status(140, line_height * 1, item)
when 1
draw_text(140, 0, 200, line_height, "装备特征")
draw_equipments_features(140,line_height * 1, @draw_list[1])
when 2
draw_text(140, 0, 200, line_height, "装備アイテムスロット")
draw_equipments_slot(140,line_height * 1, item)
when 3
draw_text(140, 0, 200, line_height, "装備アイテムシンボル")
draw_equipments_symbol(140,line_height * 1, item)
end
draw_text(140, contents.height - line_height, contents.width - 140, line_height, "← →:翻页( " + (@draw_sub_command_index + 1).to_s + " / " + page_list.size.to_s + ")",1)
end
#--------------------------------------------------------------------------
# ▲ 装備品の描画(3ページ目、INDEX0)
#--------------------------------------------------------------------------
def draw_equipments_status(x, y ,item)
return unless item
last_font_size = contents.font.size
contents.font.size = 20
#装備名を描画
draw_item_name(item, x, y)
y += line_height
8.times{|param_id|
pos_y = y + contents.font.size * param_id
change_color(system_color)
draw_text(x + 10, pos_y, (contents.width - x) / 2 - 50, contents.font.size, Vocab::param(param_id))
change_color(normal_color)
draw_text(x + 10, pos_y, (contents.width - x) / 2 - 50, contents.font.size, item.params[param_id], 2)
}
contents.font.size = last_font_size
end
#--------------------------------------------------------------------------
# ▲ 装備品の特徴(3ページ目、INDEX1)
#--------------------------------------------------------------------------
def draw_equipments_features(x, y, list)
last_font_size = contents.font.size
contents.font.size = 20
first = 0 + 22 * (@draw_sub_command_index - 1)
last = [21 + 22 * (@draw_sub_command_index - 1) , list.size].min
list[first..last].each_with_index{|text, index|
pos_x = 140 + index.modulo(2) * (((contents.width - 140)/ 2) - 5)
pos_y = line_height + contents.font.size * index.div(2)
draw_text(pos_x, pos_y, ((contents.width - 140) / 2) - 5, contents.font.size, text)
}
contents.font.size = last_font_size
end
#--------------------------------------------------------------------------
# ▲ 装備品のスロット(3ページ目、INDEX2)
#--------------------------------------------------------------------------
def draw_equipments_slot(x, y, item)
draw_equipments_slot_symbol(x, y, item, 2)
end
#--------------------------------------------------------------------------
# ▲ 装備品のシンボル(3ページ目、INDEX3)
#--------------------------------------------------------------------------
def draw_equipments_symbol(x, y, item)
draw_equipments_slot_symbol(x, y, item, 3)
end
#--------------------------------------------------------------------------
# ▲ 装備品のスロットやシンボル描画(INDEX2,3)
#--------------------------------------------------------------------------
def draw_equipments_slot_symbol(x, y, item, mode)
return unless $kure_integrate_script[:SortOut]
return unless item
#リストを取得
case mode
when 2 ; slot_list = item.slot_list ; slot_max_size = item.max_slot_number
when 3 ; slot_list = item.symbol_list.collect{|obj| obj[0] } ; slot_max_size = item.max_symbol_number
end
#描画
slot_max_size.times{|id|
case id
when 0..8
pos_y = y + line_height * id ; pos_x = x
when 9..18
pos_y = y + line_height * (id - 9)
pos_x = x + ((contents.width - x) / 2) - 10
end
draw_text(pos_x + 5, pos_y, 25, line_height, id + 1)
draw_item_name(slot_list[id], pos_x + 30, pos_y) if slot_list[id]
}
end
#--------------------------------------------------------------------------
# ★ プロフィール(4ページの描画)
#--------------------------------------------------------------------------
def page_4_draw
@draw_index = 0 if @draw_index > 1
@draw_index = 1 if @draw_index < 0
@draw_index = 0 if KURE::ExStatus::PROFILE2[@actor.id] == nil
case @draw_index
when 0
page_4_1_draw
draw_text(280, contents.height - line_height, contents.width - 280, line_height, "← →:翻页( 1 / 2 )",1) if KURE::ExStatus::PROFILE2[@actor.id] != nil
when 1
page_4_2_draw
draw_text(280, contents.height - line_height, contents.width - 280, line_height, "← →:翻页( 2 / 2 )",1)
end
end
#--------------------------------------------------------------------------
# ★ プロフィール(4-1ページの描画)
#--------------------------------------------------------------------------
def page_4_1_draw
draw_gauge(5,0, contents.width, 1, mp_gauge_color2,crisis_color)
draw_text(5, 0, 126, line_height, KURE::ExStatus::MAIN_MENU[KURE::ExStatus::VIEW_MAIN_MENU[@main_command_index]])
draw_text(150, 0, contents.width - 280, line_height, @actor.actor.profile_name)
draw_actor_nickname(@actor, contents.width - 150,0)
#描画内容を変数で判断
if KURE::ExStatus::PROFILE_NUM[@actor.id - 1] != 0
draw_profile = $game_variables[KURE::ExStatus::PROFILE_NUM[@actor.id - 1]]
else
draw_profile = 0
end
data = KURE::ExStatus::PROFILE[@actor.id]
#立ち絵グラフィックを設定
if data && data[draw_profile] && data[draw_profile].size != 0
#立ち絵の選択
if data[draw_profile][0] == 1
lastname = File.extname($game_actors[@actor.id].face_name)
basename = File.basename($game_actors[@actor.id].face_name, lastname)
bitmap = Cache.picture(basename + "-" + ($game_actors[@actor.id].face_index + 1).to_s + lastname)
draw_standpicture = 1
elsif data[draw_profile][0] != nil
bitmap = Cache.picture(data[draw_profile][0])
draw_standpicture = 1
else
draw_standpicture = 0
end
case draw_standpicture
when 0 ; profile_x = 0
when 1
self.contents.blt(0, contents.height - bitmap.rect.height + 24, bitmap, bitmap.rect)
profile_x = 280
end
#プロフィールを描画
for i in 1..data[draw_profile].size - 1
draw_text_ex(profile_x, line_height * i, data[draw_profile][i])
end
end
end
#--------------------------------------------------------------------------
# ● プロフィール(4-2ページの描画)
#--------------------------------------------------------------------------
def page_4_2_draw
draw_gauge(5,0, contents.width, 1, mp_gauge_color2,crisis_color)
draw_text(5, 0, 126, line_height, KURE::ExStatus::MAIN_MENU[KURE::ExStatus::VIEW_MAIN_MENU[@main_command_index]])
draw_text(150, 0, contents.width - 280, line_height, @actor.actor.profile_name)
draw_actor_nickname(@actor, contents.width - 150,0)
#描画内容を変数で判断
if KURE::ExStatus::PROFILE_NUM2[@actor.id - 1] != 0
draw_profile = $game_variables[KURE::ExStatus::PROFILE_NUM2[@actor.id - 1]]
else
draw_profile = 0
end
data = KURE::ExStatus::PROFILE2[@actor.id]
#プロフィールが設定されているかをチェックする
if data && data[draw_profile] && data[draw_profile].size != 0
data[draw_profile].each_with_index{|text, index| draw_text_ex(0, line_height * (index +1), text)}
end
end
#--------------------------------------------------------------------------
# ◎ 表示内容の設定(共通呼び出し項目)
#--------------------------------------------------------------------------
def draw_value_s(val,baseval)
return val.to_s + "%" if KURE::ExStatus::VIEW_MODE == 0
value = val - baseval
str = value > 0 ? "+" + value.to_s + "%" : value.to_s + "%"
return str
end
#--------------------------------------------------------------------------
# ◎ 特徴文字列の取得(共通呼び出し項目)
#--------------------------------------------------------------------------
def get_feature_text(item)
return [] unless item
return KURE.call_add_feature_txt(item) if $kure_integrate_script[:integrate]
return KURE.basic_actor_add_feature_txt(item)
end
end
#メモ欄の取得に関するスクリプト処理群-------------------------------------------
module KURE
#--------------------------------------------------------------------------
# ◎ 特徴の文字配列の呼び出し(基本)(共通呼び出し項目)
#--------------------------------------------------------------------------
def self.basic_actor_add_feature_txt(item)
return [] unless item
draw_txt = Array.new
#コードのID配列を取得
object = item.is_a?(Game_Actor) ? item.all_features : item.features
code_list = object.collect{|ft|
case ft.code
when 11,12,13,21,23,22,32,62,64
[ft.code, ft.data_id]
when 14,31,41,42,43,44,53,54,55,33,34,61
[ft.code, 0]
end
}
code_list.compact!
code_list.uniq!
#書きだし
code_list.each{|block|
case block[0]
when 14,31,41,42,43,44,53,54,55,62,64
data = features_set_data(item, block[0])
case block[0]
when 31 ; data.each{|id| draw_txt.push($data_system.elements[id] + "属性 ")}
when 14 ; data.each{|id| draw_txt.push($data_states[id].name + "無効 ")}
when 41 ; data.each{|id| draw_txt.push($data_system.skill_types[id] + ":可以使用 ")}
when 42 ; data.each{|id| draw_txt.push($data_system.skill_types[id] + ":不能使用 ")}
when 43 ; data.each{|id| draw_txt.push($data_skills[id].name + ":可以使用 ")}
when 44 ; data.each{|id| draw_txt.push($data_skills[id].name + ":不能使用 ")}
when 53 ; data.each{|id| draw_txt.push($data_system.terms.etypes[id] + "固定 ")}
when 54 ; data.each{|id| draw_txt.push($data_system.terms.etypes[id] + "封印 ")}
when 55 ; draw_txt.push("二刀流 ") if data.max == 1
when 62
case block[1]
when 0 ; draw_txt.push("自動戦闘 ")
when 1 ; draw_txt.push("自動防御 ")
when 2 ; draw_txt.push("自動献身 ")
when 3 ; draw_txt.push("TP持越 ")
end
when 64
case block[1]
when 0 ; draw_txt.push("遇敌率↓ ")
when 1 ; draw_txt.push("敌出现率0 ")
when 2 ; draw_txt.push("被先制无效 ")
when 3 ; draw_txt.push("先制率上升 ")
when 4 ; draw_txt.push("获得金钱2倍 ")
when 5 ; draw_txt.push("Drop率2倍 ")
end
end
when 11,12,13,21,23
data = (features_pi_data(item, block[0], block[1]) * 100).to_i
case block[0]
when 11 ; draw_txt.push($data_system.elements[block[1]] + "有効度" + data.to_s + "% ")
when 12 ; draw_txt.push(Vocab::param(block[1]) + "弱体有効度" + data.to_s + "% ")
when 13 ; draw_txt.push($data_states[block[1]].name + "有効度" + data.to_s + "% ")
when 21
data2 = data > 100 ? "+" + (data - 100).to_s : (data - 100).to_s
draw_txt.push(Vocab::param(block[1]) + data2 + "% ")
when 23
next if data == 100
case block[1]
when 0 ; draw_str = "仇恨"
when 1 ; draw_str = "防御効果"
when 2 ; draw_str = "回復効果"
when 3 ; draw_str = "药的知识"
when 4 ; draw_str = "MP消費率"
when 5 ; draw_str = "TP获得率"
when 6 ; draw_str = "被物理伤害"
when 7 ; draw_str = "被魔法伤害"
when 8 ; draw_str = "床Dmg"
when 9 ; draw_str = "经验值"
end
data2 = data > 100 ? "+" + (data - 100).to_s : (data - 100).to_s
draw_txt.push(draw_str + data2 + "% ")
end
when 22,32
data = (features_sum_data(item, block[0], block[1]) * 100).to_i
case block[0]
when 22
case block[1]
when 0 ; draw_str = "命中"
when 1 ; draw_str = "闪避"
when 2 ; draw_str = "暴击"
when 3 ; draw_str = "暴击闪避"
when 4 ; draw_str = "魔法闪避"
when 5 ; draw_str = "魔法反射"
when 6 ; draw_str = "反击"
when 7 ; draw_str = "HP再生"
when 8 ; draw_str = "MP再生"
when 9 ; draw_str = "TP再生"
end
data2 = data > 0 ? "+" + data.to_s : data.to_s
draw_txt.push(draw_str + data2 + "% ")
when 32
draw_txt.push($data_states[block[1]].name + "付与" + data.to_s + "% ")
end
when 33,34
data = features_sum_all_data(item, block[0])
case block[0]
when 33
next if data == 0
draw_txt.push("攻击速度增加") if data > 0
draw_txt.push("攻击速度减少") if data < 0
when 34
next if data == 0
draw_txt.push("攻击增加" + data.to_s + "回 ") if data > 0
draw_txt.push("攻击减少" + data.to_s + "回 ") if data < 0
end
when 61
data = features_data(item, 61).collect{|ft| (ft.value * 100).to_i}
data.each{|id| draw_txt.push("额外行动" + id.to_s + "% ")}
end
}
return draw_txt
end
#--------------------------------------------------------------------------
# ★ 特徴オブジェクトの配列取得(特徴コードを限定)(追加定義)
#--------------------------------------------------------------------------
def self.features_data(item, code)
object = item.is_a?(Game_Actor) ? item.all_features : item.features
object.select {|ft| ft.code == code }
end
#--------------------------------------------------------------------------
# ★ 特徴オブジェクトの配列取得(特徴コードとデータ ID を限定)(追加定義)
#--------------------------------------------------------------------------
def self.features_with_id_data(item, code, id)
object = item.is_a?(Game_Actor) ? item.all_features : item.features
object.select {|ft| ft.code == code && ft.data_id == id }
end
#--------------------------------------------------------------------------
# ★ 特徴値の総乗計算(追加定義)
#--------------------------------------------------------------------------
def self.features_pi_data(item, code, id)
features_with_id_data(item, code, id).inject(1.0) {|r, ft| r *= ft.value }
end
#--------------------------------------------------------------------------
# ★ 特徴値の総和計算(データ ID を指定)(追加定義)
#--------------------------------------------------------------------------
def self.features_sum_data(item, code, id)
features_with_id_data(item, code, id).inject(0.0) {|r, ft| r += ft.value }
end
#--------------------------------------------------------------------------
# ★ 特徴値の総和計算(データ ID は非指定)(追加定義)
#--------------------------------------------------------------------------
def self.features_sum_all_data(item, code)
features_data(item, code).inject(0.0) {|r, ft| r += ft.value }
end
#--------------------------------------------------------------------------
# ★ 特徴の集合和計算(追加定義)
#--------------------------------------------------------------------------
def self.features_set_data(item, code)
features_data(item, code).inject([]) {|r, ft| r |= [ft.data_id] }
end
end
复制代码
这是我工程里面扒下来的,你需要自己设置成自己想要的模式,否侧有报错的可能
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1