These scripts were found during looking for certain Item window script. It was well known to some RMXP users, although its author or homepage was unknown to them. Anyway, finally I found it, but unfortunately the homepage(http://hartshorn-id.hp.infoseek.co.jp/index.html ) seemed to be abandoned for while.
1. Item Window
http://hartshorn-id.hp.infoseek.co.jp/material/item.html
This script provides 'simple' item grouping. To customize it, you have to edit some parts(like Harts_Window_ItemCommand, Harts_Window_ItemList). Since it has its own item grouping, it may not work well with item grouping scripts like KGC's or XRXS'.(perhaps, you can make it work with them, but I don't think you need to do it)
2. Equip Window
http://hartshorn-id.hp.infoseek.co.jp/material/equip.html
Like any other 'improved' equip window scripts, it shows actor's all status changes. But it has an additional feature: Equipment optimization(that means, you can equip yout strongest equipments only selecting one command).
This script would not work well with Equip-extend scripts(like KGC's, Guillaume777's.........).
3. Status Window
http://hartshorn-id.hp.infoseek.co.jp/material/status.html
To use this script, you should have gauge picture named 'bar.png'(see attachment).
[spoiler]
[code]
#==============================================================================
# â– Game_Actor
#------------------------------------------------------------------------------
#  アクターを扱ã†ã‚¯ãƒ©ã‚¹ã§ã™ã€‚å†å®šç¾©
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ◠次ã®ãƒ¬ãƒ™ãƒ«ã¾ã§ã® EXP ã®å‰²åˆå–å¾—
#--------------------------------------------------------------------------
def exp_rate
return @exp_list[@level+1] > 0 ? (@exp - @exp_list[@level]) * 100 / (@exp_list[@level+1] - @exp_list[@level]) : 100
end
end
#==============================================================================
# â– Harts_Window_StatusTitle
#------------------------------------------------------------------------------
#  アイテム画é¢ã§ã€ã‚¿ã‚¤ãƒˆãƒ«ã‚’表示ã™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã€‚
#==============================================================================
class Harts_Window_StatusTitle < Window_Base
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, "ステータス", 1)
end
end
#==============================================================================
# â– Harts_Window_StatusName
#------------------------------------------------------------------------------
#  ステータス画é¢ã§è¡¨ç¤ºã™ã‚‹ã€åå‰ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã™ã€‚
#==============================================================================
class Harts_Window_StatusName < Window_Base
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
# actor : アクター
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 0, 480, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
end
end
#==============================================================================
# â– Window_Status
#------------------------------------------------------------------------------
#  ステータス画é¢ã§è¡¨ç¤ºã™ã‚‹ã€ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã™ã€‚
#==============================================================================
class Harts_Window_Status < Window_Base
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
# actor : アクター
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 0, 640, 416)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# ãƒãƒˆãƒ©ãƒ¼ã‚°ãƒ©ãƒ•ィックãƒãƒ¼ãƒ‰
bitmap = RPG::Cache.battler(@actor.battler_name, @actor.battler_hue)
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(16, 0, bitmap, src_rect)
# ãƒãƒ¼ã‚°ãƒ©ãƒ•ィックãƒãƒ¼ãƒ‰
bar = Bitmap.new("./Graphics/Pictures/bar.png")
draw_actor_class(@actor, 4 + 144, 0)
draw_actor_level(@actor, 4 + 144, 32)
draw_actor_state(@actor, 4 + 144, 64)
hpbar = @actor.hp * 100 / @actor.maxhp
spbar = @actor.sp * 100 / @actor.maxsp
self.contents.blt(390, 107, bar, Rect.new(0, 0, 102, 6))
self.contents.blt(390, 139, bar, Rect.new(0, 0, 102, 6))
if hpbar < 25
self.contents.blt(391, 108, bar, Rect.new(0, 20, hpbar, 4))
elsif hpbar < 50
self.contents.blt(391, 108, bar, Rect.new(0, 16, hpbar, 4))
else
self.contents.blt(391, 108, bar, Rect.new(0, 12, hpbar, 4))
end
if spbar < 25
self.contents.blt(391, 140, bar, Rect.new(0, 20, spbar, 4))
elsif spbar < 50
self.contents.blt(391, 140, bar, Rect.new(0, 16, spbar, 4))
else
self.contents.blt(391, 140, bar, Rect.new(0, 12, spbar, 4))
end
draw_actor_hp(@actor, 320, 80, 172)
draw_actor_sp(@actor, 320, 112, 172)
strbar = @actor.str * 100 / 999
dexbar = @actor.dex * 100 / 999
agibar = @actor.agi * 100 / 999
intbar = @actor.int * 100 / 999
self.contents.blt(480, 176, bar, Rect.new(0, 0, 102, 6))
self.contents.blt(480, 208, bar, Rect.new(0, 0, 102, 6))
self.contents.blt(480, 240, bar, Rect.new(0, 0, 102, 6))
self.contents.blt(480, 272, bar, Rect.new(0, 0, 102, 6))
self.contents.blt(481, 177, bar, Rect.new(0, 24, strbar, 4))
self.contents.blt(481, 209, bar, Rect.new(0, 24, dexbar, 4))
self.contents.blt(481, 241, bar, Rect.new(0, 24, agibar, 4))
self.contents.blt(481, 273, bar, Rect.new(0, 24, intbar, 4))
draw_actor_parameter(@actor, 320, 288, 0)
draw_actor_parameter(@actor, 320, 320, 1)
draw_actor_parameter(@actor, 320, 352, 2)
draw_actor_parameter(@actor, 320, 160, 3)
draw_actor_parameter(@actor, 320, 192, 4)
draw_actor_parameter(@actor, 320, 224, 5)
draw_actor_parameter(@actor, 320, 256, 6)
self.contents.blt(320, 59, bar, Rect.new(0, 6, 202, 6))
self.contents.blt(321, 60, bar, Rect.new(0, 24, @actor.exp_rate * 2, 4))
self.contents.font.color = system_color
self.contents.draw_text(320, 0, 80, 32, "EXP")
self.contents.draw_text(320, 32, 80, 32, "NEXT")
self.contents.font.color = normal_color
self.contents.draw_text(320 + 80, 0, 84, 32, @actor.exp_s, 2)
self.contents.draw_text(320 + 80, 32, 84, 32, @actor.next_rest_exp_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(4, 192, 96, 32, "装備")
draw_item_name($data_weapons[@actor.weapon_id], 16, 224)
draw_item_name($data_armors[@actor.armor1_id], 16, 256)
draw_item_name($data_armors[@actor.armor2_id], 16, 288)
draw_item_name($data_armors[@actor.armor3_id], 16, 320)
draw_item_name($data_armors[@actor.armor4_id], 16, 352)
end
end
#==============================================================================
# â– Harts_Scene_Status
#------------------------------------------------------------------------------
#  ステータス画é¢ã®å‡¦ç†ã‚’行ã†ã‚¯ãƒ©ã‚¹ã§ã™ã€‚å†å®šç¾©
#==============================================================================
class Scene_Status
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
# actor_index : アクタ&#
1. Item Window
http://hartshorn-id.hp.infoseek.co.jp/material/item.html
This script provides 'simple' item grouping. To customize it, you have to edit some parts(like Harts_Window_ItemCommand, Harts_Window_ItemList). Since it has its own item grouping, it may not work well with item grouping scripts like KGC's or XRXS'.(perhaps, you can make it work with them, but I don't think you need to do it)
Content Hidden
Spoiler
#==============================================================================
# â– Harts_Window_ItemTitle
#------------------------------------------------------------------------------
#  アイテム画é¢ã§ã€ã‚¿ã‚¤ãƒˆãƒ«ã‚’表示ã™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã€‚
#==============================================================================
class Harts_Window_ItemTitle < Window_Base
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, $data_system.words.item, 1)
end
end
#==============================================================================
# â– Harts_Window_ItemCommand
#------------------------------------------------------------------------------
#  アイテムã®ç¨®åˆ¥é¸æŠžã‚’行ã†ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã™ã€‚
#==============================================================================
class Harts_Window_ItemCommand < Window_Selectable
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
super(0, 64, 160, 288)
self.contents = Bitmap.new(width - 32, height - 32)
@item_max = 8
@commands = ["ユーズアイテム", "ãƒãƒˆãƒ«ã‚¢ã‚¤ãƒ†ãƒ ", $data_system.words.weapon, $data_system.words.armor1, $data_system.words.armor2, $data_system.words.armor3, $data_system.words.armor4, "イベントアイテム"]
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
#--------------------------------------------------------------------------
# â— é …ç›®ã®æç”»
# index : é …ç›®ç•ªå·
# color : æ–‡å—色
#--------------------------------------------------------------------------
def draw_item(index, color)
self.contents.font.color = color
y = index * 32
self.contents.draw_text(4, y, 128, 32, @commands[index])
end
#--------------------------------------------------------------------------
# ◠ヘルプテã‚スト更新
#--------------------------------------------------------------------------
def update_help
case self.index
when 0
@text = @commands[0]
when 1
@text = @commands[1]
when 2
@text = @commands[2]
when 3
@text = @commands[3]
when 4
@text = @commands[4]
when 5
@text = @commands[5]
when 6
@text = @commands[6]
when 7
@text = @commands[7]
end
@help_window.set_text(@text)
end
end
#==============================================================================
# â– Window_Item
#------------------------------------------------------------------------------
#  アイテム画é¢ã§ã€æ‰€æŒã‚¢ã‚¤ãƒ†ãƒ ã®ä¸€è¦§ã‚’表示ã™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã™ã€‚
#==============================================================================
class Harts_Window_ItemList < Window_Selectable
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
super(160, 0, 480, 416)
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# ◠アイテムã®å–å¾—
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
end
#--------------------------------------------------------------------------
# ◠アイテム一覧è¨å®š
# command : é¸æŠžä¸ã®ã‚³ãƒžãƒ³ãƒ‰
#--------------------------------------------------------------------------
def set_item(command)
refresh
case command
when 0
for i in 1...$data_items.size
if ($data_items[i].occasion == 0 or $data_items[i].occasion == 2) and $game_party.item_number(i) > 0
@data.push($data_items[i])
end
end
when 1
for i in 1...$data_items.size
if ($data_items[i].occasion == 1 and $game_party.item_number(i) > 0)
@data.push($data_items[i])
end
end
when 2
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0
@data.push($data_weapons[i])
end
end
when 3
for i in 1...$data_armors.size
if $data_armors[i].kind == 0 and $game_party.armor_number(i) > 0
@data.push($data_armors[i])
end
end
when 4
for i in 1...$data_armors.size
if $data_armors[i].kind == 1 and $game_party.armor_number(i) > 0
@data.push($data_armors[i])
end
end
when 5
for i in 1...$data_armors.size
if $data_armors[i].kind == 2 and $game_party.armor_number(i) > 0
@data.push($data_armors[i])
end
end
when 6
for i in 1...$data_armors.size
if $data_armors[i].kind == 3 and $game_party.armor_number(i) > 0
@data.push($data_armors[i])
end
end
when 7
for i in 1...$data_items.size
if $data_items[i].occasion == 3 and $game_party.item_number(i) > 0
@data.push($data_items[i])
end
end
end
# é …ç›®æ•°ãŒ 0 ã§ãªã‘れã°ãƒ“ットマップを作æˆã—ã€å…¨é …目をæç”»
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.clear
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# ◠種類別アイテム数ã®å–å¾—
#--------------------------------------------------------------------------
def item_number
return @item_max
end
#--------------------------------------------------------------------------
# â— é …ç›®ã®æç”»
# index : é …ç›®ç•ªå·
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if item.is_a?(RPG::Item) and
$game_party.item_can_use?(item.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4
y = index * 32
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 400, y, 16, 32, ":", 1)
self.contents.draw_text(x + 416, y, 24, 32, number.to_s, 2)
end
#--------------------------------------------------------------------------
# ◠ヘルプテã‚スト更新
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
#==============================================================================
# â– Harts_Scene_Item
#------------------------------------------------------------------------------
#  アイテム画é¢ã®å‡¦ç†ã‚’行ã†ã‚¯ãƒ©ã‚¹ã§ã™ã€‚å†å®šç¾©
#==============================================================================
class Scene_Item
#--------------------------------------------------------------------------
# ◠メイン処ç†
#--------------------------------------------------------------------------
def main
# タイトルウィンドウを作æˆ
@itemtitle_window = Harts_Window_ItemTitle.new
#コマンドウィンドウを作æˆ
@itemcommand_window = Harts_Window_ItemCommand.new
@command_index = @itemcommand_window.index
#アイテムウィンドウを作æˆ
@itemlist_window = Harts_Window_ItemList.new
@itemlist_window.active = false
#ヘルプウィンドウを作æˆ
@help_window = Window_Help.new
@help_window.x = 0
@help_window.y = 416
# ヘルプウィンドウを関連付ã‘
@itemcommand_window.help_window = @help_window
@itemlist_window.help_window = @help_window
# ã‚¿ãƒ¼ã‚²ãƒƒãƒˆã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’ä½œæˆ (ä¸å¯è¦–・éžã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã«è¨å®š)
@target_window = Window_Target.new
@target_window.visible = false
@target_window.active = false
# アイテムウィンドウ内容表示
@itemlist_window.set_item(@command_index)
# トランジション実行
Graphics.transition
# メインループ
loop do
# ゲーム画é¢ã‚’æ›´æ–°
Graphics.update
# å…¥åŠ›æƒ…å ±ã‚’æ›´æ–°
Input.update
# フレーム更新
update
# ç”»é¢ãŒåˆ‡ã‚Šæ›¿ã‚ã£ãŸã‚‰ãƒ«ãƒ¼ãƒ—ã‚’ä¸æ–
if $scene != self
break
end
end
# トランジション準備
Graphics.freeze
# ウィンドウを解放
@itemtitle_window.dispose
@itemcommand_window.dispose
@itemlist_window.dispose
@help_window.dispose
@target_window.dispose
end
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
def update
# ウィンドウを更新
@itemtitle_window.update
@itemcommand_window.update
@itemlist_window.update
@help_window.update
@target_window.update
if @command_index != @itemcommand_window.index
@command_index = @itemcommand_window.index
@itemlist_window.set_item(@command_index)
end
# コマンドウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ: update_itemcommand を呼ã¶
if @itemcommand_window.active
update_itemcommand
return
end
# アイテムウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ: update_itemlist を呼ã¶
if @itemlist_window.active
update_itemlist
return
end
# ターゲットウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ: update_target を呼ã¶
if @target_window.active
update_target
return
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (コマンドウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ)
#--------------------------------------------------------------------------
def update_itemcommand
# B ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# メニュー画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Menu.new(0)
return
end
# C ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::C)
# é¸æŠžä¸ã®ã‚³ãƒžãƒ³ãƒ‰ã®ã‚¢ã‚¤ãƒ†ãƒ ãŒãªã„å ´åˆ
if @itemlist_window.item_number == 0
# ブザー SE ã‚’æ¼”å¥
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# アイテムウィンドウをアクティブã«ã™ã‚‹
@itemcommand_window.active = false
@itemlist_window.active = true
@itemlist_window.index = 0
return
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (アイテムウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ)
#--------------------------------------------------------------------------
def update_itemlist
# B ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# アイテムウィンドウをアクティブã«ã™ã‚‹
@itemcommand_window.active = true
@itemlist_window.active = false
@itemlist_window.index = 0
@itemcommand_window.index = @command_index
return
end
# C ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::C)
# アイテムウィンドウã§ç¾åœ¨é¸æŠžã•れã¦ã„るデータをå–å¾—
@item = @itemlist_window.item
# 使用アイテムã§ã¯ãªã„å ´åˆ
unless @item.is_a?(RPG::Item)
# ブザー SE ã‚’æ¼”å¥
$game_system.se_play($data_system.buzzer_se)
return
end
# 使用ã§ããªã„å ´åˆ
unless $game_party.item_can_use?(@item.id)
# ブザー SE ã‚’æ¼”å¥
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# 効果範囲ãŒå‘³æ–¹ã®å ´åˆ
if @item.scope >= 3
# ターゲットウィンドウをアクティブ化
@itemlist_window.active = false
@target_window.x = 304
@target_window.visible = true
@target_window.active = true
# 効果範囲 (å˜ä½“/全体) ã«å¿œã˜ã¦ã‚«ãƒ¼ã‚½ãƒ«ä½ç½®ã‚’è¨å®š
if @item.scope == 4 || @item.scope == 6
@target_window.index = -1
else
@target_window.index = 0
end
# 効果範囲ãŒå‘³æ–¹ä»¥å¤–ã®å ´åˆ
else
# コモンイベント ID ãŒæœ‰åйã®å ´åˆ
if @item.common_event_id > 0
# コモンイベント呼ã³å‡ºã—予約
$game_temp.common_event_id = @item.common_event_id
# アイテムã®ä½¿ç”¨æ™‚ SE ã‚’æ¼”å¥
$game_system.se_play(@item.menu_se)
# 消耗å“ã®å ´åˆ
if @item.consumable
# 使用ã—ãŸã‚¢ã‚¤ãƒ†ãƒ ã‚’ 1 減らã™
$game_party.lose_item(@item.id, 1)
# アイテムウィンドウã®é …ç›®ã‚’å†æç”»
@itemlist_window.draw_item(@itemlist_window.index)
end
# マップ画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Map.new
return
end
end
return
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (ターゲットウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ)
#--------------------------------------------------------------------------
def update_target
# B ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# アイテム切れãªã©ã§ä½¿ç”¨ã§ããªããªã£ãŸå ´åˆ
unless $game_party.item_can_use?(@item.id)
# アイテムウィンドウã®å†…容をå†ä½œæˆ
@itemlist_window.refresh
end
# ターゲットウィンドウを消去
@itemlist_window.active = true
@target_window.visible = false
@target_window.active = false
@itemlist_window.set_item(@command_index)
return
end
# C ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::C)
# アイテムを使ã„切ã£ãŸå ´åˆ
if $game_party.item_number(@item.id) == 0
# ブザー SE ã‚’æ¼”å¥
$game_system.se_play($data_system.buzzer_se)
return
end
# ターゲットãŒå…¨ä½“ã®å ´åˆ
if @target_window.index == -1
# パーティ全体ã«ã‚¢ã‚¤ãƒ†ãƒ ã®ä½¿ç”¨åŠ¹æžœã‚’é©ç”¨
used = false
for i in $game_party.actors
used |= i.item_effect(@item)
end
end
# ターゲットãŒå˜ä½“ã®å ´åˆ
if @target_window.index >= 0
# ターゲットã®ã‚¢ã‚¯ã‚¿ãƒ¼ã«ã‚¢ã‚¤ãƒ†ãƒ ã®ä½¿ç”¨åŠ¹æžœã‚’é©ç”¨
target = $game_party.actors[@target_window.index]
used = target.item_effect(@item)
end
# アイテムを使ã£ãŸå ´åˆ
if used
# アイテムã®ä½¿ç”¨æ™‚ SE ã‚’æ¼”å¥
$game_system.se_play(@item.menu_se)
# 消耗å“ã®å ´åˆ
if @item.consumable
# 使用ã—ãŸã‚¢ã‚¤ãƒ†ãƒ ã‚’ 1 減らã™
$game_party.lose_item(@item.id, 1)
# アイテムウィンドウã®é …ç›®ã‚’å†æç”»
@itemlist_window.draw_item(@itemlist_window.index)
@itemlist_window.set_item(@command_index)
end
# ターゲットウィンドウã®å†…容をå†ä½œæˆ
@target_window.refresh
# 全滅ã®å ´åˆ
if $game_party.all_dead?
# ゲームオーãƒãƒ¼ç”»é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Gameover.new
return
end
# コモンイベント ID ãŒæœ‰åйã®å ´åˆ
if @item.common_event_id > 0
# コモンイベント呼ã³å‡ºã—予約
$game_temp.common_event_id = @item.common_event_id
# マップ画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Map.new
return
end
end
# アイテムを使ã‚ãªã‹ã£ãŸå ´åˆ
unless used
# ブザー SE ã‚’æ¼”å¥
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
end
# â– Harts_Window_ItemTitle
#------------------------------------------------------------------------------
#  アイテム画é¢ã§ã€ã‚¿ã‚¤ãƒˆãƒ«ã‚’表示ã™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã€‚
#==============================================================================
class Harts_Window_ItemTitle < Window_Base
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, $data_system.words.item, 1)
end
end
#==============================================================================
# â– Harts_Window_ItemCommand
#------------------------------------------------------------------------------
#  アイテムã®ç¨®åˆ¥é¸æŠžã‚’行ã†ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã™ã€‚
#==============================================================================
class Harts_Window_ItemCommand < Window_Selectable
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
super(0, 64, 160, 288)
self.contents = Bitmap.new(width - 32, height - 32)
@item_max = 8
@commands = ["ユーズアイテム", "ãƒãƒˆãƒ«ã‚¢ã‚¤ãƒ†ãƒ ", $data_system.words.weapon, $data_system.words.armor1, $data_system.words.armor2, $data_system.words.armor3, $data_system.words.armor4, "イベントアイテム"]
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
#--------------------------------------------------------------------------
# â— é …ç›®ã®æç”»
# index : é …ç›®ç•ªå·
# color : æ–‡å—色
#--------------------------------------------------------------------------
def draw_item(index, color)
self.contents.font.color = color
y = index * 32
self.contents.draw_text(4, y, 128, 32, @commands[index])
end
#--------------------------------------------------------------------------
# ◠ヘルプテã‚スト更新
#--------------------------------------------------------------------------
def update_help
case self.index
when 0
@text = @commands[0]
when 1
@text = @commands[1]
when 2
@text = @commands[2]
when 3
@text = @commands[3]
when 4
@text = @commands[4]
when 5
@text = @commands[5]
when 6
@text = @commands[6]
when 7
@text = @commands[7]
end
@help_window.set_text(@text)
end
end
#==============================================================================
# â– Window_Item
#------------------------------------------------------------------------------
#  アイテム画é¢ã§ã€æ‰€æŒã‚¢ã‚¤ãƒ†ãƒ ã®ä¸€è¦§ã‚’表示ã™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã™ã€‚
#==============================================================================
class Harts_Window_ItemList < Window_Selectable
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
super(160, 0, 480, 416)
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# ◠アイテムã®å–å¾—
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
end
#--------------------------------------------------------------------------
# ◠アイテム一覧è¨å®š
# command : é¸æŠžä¸ã®ã‚³ãƒžãƒ³ãƒ‰
#--------------------------------------------------------------------------
def set_item(command)
refresh
case command
when 0
for i in 1...$data_items.size
if ($data_items[i].occasion == 0 or $data_items[i].occasion == 2) and $game_party.item_number(i) > 0
@data.push($data_items[i])
end
end
when 1
for i in 1...$data_items.size
if ($data_items[i].occasion == 1 and $game_party.item_number(i) > 0)
@data.push($data_items[i])
end
end
when 2
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0
@data.push($data_weapons[i])
end
end
when 3
for i in 1...$data_armors.size
if $data_armors[i].kind == 0 and $game_party.armor_number(i) > 0
@data.push($data_armors[i])
end
end
when 4
for i in 1...$data_armors.size
if $data_armors[i].kind == 1 and $game_party.armor_number(i) > 0
@data.push($data_armors[i])
end
end
when 5
for i in 1...$data_armors.size
if $data_armors[i].kind == 2 and $game_party.armor_number(i) > 0
@data.push($data_armors[i])
end
end
when 6
for i in 1...$data_armors.size
if $data_armors[i].kind == 3 and $game_party.armor_number(i) > 0
@data.push($data_armors[i])
end
end
when 7
for i in 1...$data_items.size
if $data_items[i].occasion == 3 and $game_party.item_number(i) > 0
@data.push($data_items[i])
end
end
end
# é …ç›®æ•°ãŒ 0 ã§ãªã‘れã°ãƒ“ットマップを作æˆã—ã€å…¨é …目をæç”»
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.clear
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# ◠種類別アイテム数ã®å–å¾—
#--------------------------------------------------------------------------
def item_number
return @item_max
end
#--------------------------------------------------------------------------
# â— é …ç›®ã®æç”»
# index : é …ç›®ç•ªå·
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if item.is_a?(RPG::Item) and
$game_party.item_can_use?(item.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4
y = index * 32
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 400, y, 16, 32, ":", 1)
self.contents.draw_text(x + 416, y, 24, 32, number.to_s, 2)
end
#--------------------------------------------------------------------------
# ◠ヘルプテã‚スト更新
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
#==============================================================================
# â– Harts_Scene_Item
#------------------------------------------------------------------------------
#  アイテム画é¢ã®å‡¦ç†ã‚’行ã†ã‚¯ãƒ©ã‚¹ã§ã™ã€‚å†å®šç¾©
#==============================================================================
class Scene_Item
#--------------------------------------------------------------------------
# ◠メイン処ç†
#--------------------------------------------------------------------------
def main
# タイトルウィンドウを作æˆ
@itemtitle_window = Harts_Window_ItemTitle.new
#コマンドウィンドウを作æˆ
@itemcommand_window = Harts_Window_ItemCommand.new
@command_index = @itemcommand_window.index
#アイテムウィンドウを作æˆ
@itemlist_window = Harts_Window_ItemList.new
@itemlist_window.active = false
#ヘルプウィンドウを作æˆ
@help_window = Window_Help.new
@help_window.x = 0
@help_window.y = 416
# ヘルプウィンドウを関連付ã‘
@itemcommand_window.help_window = @help_window
@itemlist_window.help_window = @help_window
# ã‚¿ãƒ¼ã‚²ãƒƒãƒˆã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’ä½œæˆ (ä¸å¯è¦–・éžã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã«è¨å®š)
@target_window = Window_Target.new
@target_window.visible = false
@target_window.active = false
# アイテムウィンドウ内容表示
@itemlist_window.set_item(@command_index)
# トランジション実行
Graphics.transition
# メインループ
loop do
# ゲーム画é¢ã‚’æ›´æ–°
Graphics.update
# å…¥åŠ›æƒ…å ±ã‚’æ›´æ–°
Input.update
# フレーム更新
update
# ç”»é¢ãŒåˆ‡ã‚Šæ›¿ã‚ã£ãŸã‚‰ãƒ«ãƒ¼ãƒ—ã‚’ä¸æ–
if $scene != self
break
end
end
# トランジション準備
Graphics.freeze
# ウィンドウを解放
@itemtitle_window.dispose
@itemcommand_window.dispose
@itemlist_window.dispose
@help_window.dispose
@target_window.dispose
end
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
def update
# ウィンドウを更新
@itemtitle_window.update
@itemcommand_window.update
@itemlist_window.update
@help_window.update
@target_window.update
if @command_index != @itemcommand_window.index
@command_index = @itemcommand_window.index
@itemlist_window.set_item(@command_index)
end
# コマンドウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ: update_itemcommand を呼ã¶
if @itemcommand_window.active
update_itemcommand
return
end
# アイテムウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ: update_itemlist を呼ã¶
if @itemlist_window.active
update_itemlist
return
end
# ターゲットウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ: update_target を呼ã¶
if @target_window.active
update_target
return
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (コマンドウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ)
#--------------------------------------------------------------------------
def update_itemcommand
# B ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# メニュー画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Menu.new(0)
return
end
# C ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::C)
# é¸æŠžä¸ã®ã‚³ãƒžãƒ³ãƒ‰ã®ã‚¢ã‚¤ãƒ†ãƒ ãŒãªã„å ´åˆ
if @itemlist_window.item_number == 0
# ブザー SE ã‚’æ¼”å¥
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# アイテムウィンドウをアクティブã«ã™ã‚‹
@itemcommand_window.active = false
@itemlist_window.active = true
@itemlist_window.index = 0
return
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (アイテムウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ)
#--------------------------------------------------------------------------
def update_itemlist
# B ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# アイテムウィンドウをアクティブã«ã™ã‚‹
@itemcommand_window.active = true
@itemlist_window.active = false
@itemlist_window.index = 0
@itemcommand_window.index = @command_index
return
end
# C ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::C)
# アイテムウィンドウã§ç¾åœ¨é¸æŠžã•れã¦ã„るデータをå–å¾—
@item = @itemlist_window.item
# 使用アイテムã§ã¯ãªã„å ´åˆ
unless @item.is_a?(RPG::Item)
# ブザー SE ã‚’æ¼”å¥
$game_system.se_play($data_system.buzzer_se)
return
end
# 使用ã§ããªã„å ´åˆ
unless $game_party.item_can_use?(@item.id)
# ブザー SE ã‚’æ¼”å¥
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# 効果範囲ãŒå‘³æ–¹ã®å ´åˆ
if @item.scope >= 3
# ターゲットウィンドウをアクティブ化
@itemlist_window.active = false
@target_window.x = 304
@target_window.visible = true
@target_window.active = true
# 効果範囲 (å˜ä½“/全体) ã«å¿œã˜ã¦ã‚«ãƒ¼ã‚½ãƒ«ä½ç½®ã‚’è¨å®š
if @item.scope == 4 || @item.scope == 6
@target_window.index = -1
else
@target_window.index = 0
end
# 効果範囲ãŒå‘³æ–¹ä»¥å¤–ã®å ´åˆ
else
# コモンイベント ID ãŒæœ‰åйã®å ´åˆ
if @item.common_event_id > 0
# コモンイベント呼ã³å‡ºã—予約
$game_temp.common_event_id = @item.common_event_id
# アイテムã®ä½¿ç”¨æ™‚ SE ã‚’æ¼”å¥
$game_system.se_play(@item.menu_se)
# 消耗å“ã®å ´åˆ
if @item.consumable
# 使用ã—ãŸã‚¢ã‚¤ãƒ†ãƒ ã‚’ 1 減らã™
$game_party.lose_item(@item.id, 1)
# アイテムウィンドウã®é …ç›®ã‚’å†æç”»
@itemlist_window.draw_item(@itemlist_window.index)
end
# マップ画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Map.new
return
end
end
return
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (ターゲットウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ)
#--------------------------------------------------------------------------
def update_target
# B ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# アイテム切れãªã©ã§ä½¿ç”¨ã§ããªããªã£ãŸå ´åˆ
unless $game_party.item_can_use?(@item.id)
# アイテムウィンドウã®å†…容をå†ä½œæˆ
@itemlist_window.refresh
end
# ターゲットウィンドウを消去
@itemlist_window.active = true
@target_window.visible = false
@target_window.active = false
@itemlist_window.set_item(@command_index)
return
end
# C ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::C)
# アイテムを使ã„切ã£ãŸå ´åˆ
if $game_party.item_number(@item.id) == 0
# ブザー SE ã‚’æ¼”å¥
$game_system.se_play($data_system.buzzer_se)
return
end
# ターゲットãŒå…¨ä½“ã®å ´åˆ
if @target_window.index == -1
# パーティ全体ã«ã‚¢ã‚¤ãƒ†ãƒ ã®ä½¿ç”¨åŠ¹æžœã‚’é©ç”¨
used = false
for i in $game_party.actors
used |= i.item_effect(@item)
end
end
# ターゲットãŒå˜ä½“ã®å ´åˆ
if @target_window.index >= 0
# ターゲットã®ã‚¢ã‚¯ã‚¿ãƒ¼ã«ã‚¢ã‚¤ãƒ†ãƒ ã®ä½¿ç”¨åŠ¹æžœã‚’é©ç”¨
target = $game_party.actors[@target_window.index]
used = target.item_effect(@item)
end
# アイテムを使ã£ãŸå ´åˆ
if used
# アイテムã®ä½¿ç”¨æ™‚ SE ã‚’æ¼”å¥
$game_system.se_play(@item.menu_se)
# 消耗å“ã®å ´åˆ
if @item.consumable
# 使用ã—ãŸã‚¢ã‚¤ãƒ†ãƒ ã‚’ 1 減らã™
$game_party.lose_item(@item.id, 1)
# アイテムウィンドウã®é …ç›®ã‚’å†æç”»
@itemlist_window.draw_item(@itemlist_window.index)
@itemlist_window.set_item(@command_index)
end
# ターゲットウィンドウã®å†…容をå†ä½œæˆ
@target_window.refresh
# 全滅ã®å ´åˆ
if $game_party.all_dead?
# ゲームオーãƒãƒ¼ç”»é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Gameover.new
return
end
# コモンイベント ID ãŒæœ‰åйã®å ´åˆ
if @item.common_event_id > 0
# コモンイベント呼ã³å‡ºã—予約
$game_temp.common_event_id = @item.common_event_id
# マップ画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Map.new
return
end
end
# アイテムを使ã‚ãªã‹ã£ãŸå ´åˆ
unless used
# ブザー SE ã‚’æ¼”å¥
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
end
Expand to see the code.
Content Hidden
Spoiler
http://hartshorn-id.hp.infoseek.co.jp/material/item1/item1.GIF[/IMG]
2. Equip Window
http://hartshorn-id.hp.infoseek.co.jp/material/equip.html
Like any other 'improved' equip window scripts, it shows actor's all status changes. But it has an additional feature: Equipment optimization(that means, you can equip yout strongest equipments only selecting one command).
Content Hidden
Spoiler
#==============================================================================
# â– Harts_Window_EquipTitle
#------------------------------------------------------------------------------
#  装備画é¢ã§ã€ã‚¿ã‚¤ãƒˆãƒ«ã‚’表示ã™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã€‚
#==============================================================================
class Harts_Window_EquipTitle < Window_Base
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, $data_system.words.equip, 1)
end
end
#==============================================================================
# â– Harts_Window_EquipCommand
#------------------------------------------------------------------------------
#  装備ã®é¸æŠžã‚’行ã†ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã™ã€‚
#==============================================================================
class Harts_Window_EquipCommand < Window_Selectable
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
super(160, 0, 480, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@item_max = 3
@column_max = 3
@commands = ["装備", "最強装備", "終ã‚ã‚‹"]
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
#--------------------------------------------------------------------------
# â— é …ç›®ã®æç”»
# index : é …ç›®ç•ªå·
# color : æ–‡å—色
#--------------------------------------------------------------------------
def draw_item(index, color)
self.contents.font.color = color
x = index * 160 + 4
self.contents.draw_text(x, 0, 128, 32, @commands[index], 1)
end
end
#==============================================================================
# â– Harts_Window_EquipItem
#------------------------------------------------------------------------------
#  装備画é¢ã§ã€è£…備変更ã®å€™è£œã¨ãªã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®ä¸€è¦§ã‚’表示ã™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã™ã€‚
#==============================================================================
class Harts_Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
# actor : アクター
# equip_type : è£…å‚™éƒ¨ä½ (0~3)
#--------------------------------------------------------------------------
def initialize(actor, equip_type)
super(272, 256, 368, 160)
@actor = actor
@equip_type = equip_type
@column_max = 1
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# ◠アイテムã®å–å¾—
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# ◠最強アイテムã®idå–å¾—
#--------------------------------------------------------------------------
def max_item_id
if @equip_type == 0
if @actor.weapon_id == 0
max = 0
else
max = $data_weapons[@actor.weapon_id].atk
end
elsif @equip_type == 1
if @actor.armor1_id == 0
max = 0
else
max = $data_armors[@actor.armor1_id].pdef
end
elsif @equip_type == 2
if @actor.armor2_id == 0
max = 0
else
max = $data_armors[@actor.armor2_id].pdef
end
elsif @equip_type == 3
if @actor.armor3_id == 0
max = 0
else
max = $data_armors[@actor.armor3_id].pdef
end
end
for i in [email protected]
if @equip_type == 0
if max <= $data_weapons[@data[i].id].atk
max = $data_weapons[@data[i].id].atk
item_id = @data[i].id
end
elsif @equip_type >= 1
if max <= $data_armors[@data[i].id].pdef
max = $data_armors[@data[i].id].pdef
item_id = @data[i].id
end
end
end
return item_id
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
# 装備å¯èƒ½ãªæ¦å™¨ã‚’追åŠ
if @equip_type == 0
weapon_set = $data_classes[@actor.class_id].weapon_set
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
@data.push($data_weapons[i])
end
end
end
# 装備å¯èƒ½ãªé˜²å…·ã‚’追åŠ
if @equip_type >= 1
armor_set = $data_classes[@actor.class_id].armor_set
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0 and armor_set.include?(i)
if $data_armors[i].kind == @equip_type-1
@data.push($data_armors[i])
end
end
end
end
# 空白を追åŠ
@data.push(nil)
# ビットマップを作æˆã—ã€å…¨é …目をæç”»
@item_max = @data.size
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max-1
draw_item(i)
end
end
#--------------------------------------------------------------------------
# â— é …ç›®ã®æç”»
# index : é …ç›®ç•ªå·
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
x = 4
y = index * 32
case item
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = normal_color
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 280, y, 16, 32, ":", 1)
self.contents.draw_text(x + 296, y, 24, 32, number.to_s, 2)
end
#--------------------------------------------------------------------------
# ◠ヘルプテã‚スト更新
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
#==============================================================================
# â– Harts_Window_EquipLeft
#------------------------------------------------------------------------------
#  装備画é¢ã§ã€ã‚¢ã‚¯ã‚¿ãƒ¼ã®ãƒ‘ラメータ変化を表示ã™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã™ã€‚
#==============================================================================
class Harts_Window_EquipLeft < Window_Base
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
# actor : アクター
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 64, 272, 352)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_graphic(@actor, 32, 64)
draw_actor_name(@actor, 4 + 96, 0)
draw_actor_level(@actor, 4 + 96, 32)
draw_actor_parameter(@actor, 4, 80, 0)
draw_actor_parameter(@actor, 4, 112, 1)
draw_actor_parameter(@actor, 4, 144, 2)
draw_actor_parameter(@actor, 4, 192, 3)
draw_actor_parameter(@actor, 4, 224, 4)
draw_actor_parameter(@actor, 4, 256, 5)
draw_actor_parameter(@actor, 4, 288, 6)
if @new_atk != nil and @new_atk != @actor.atk
if @new_atk > @actor.atk
self.contents.font.color = system_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 80, 40, 32, "→", 1)
self.contents.draw_text(200, 80, 36, 32, @new_atk.to_s, 2)
end
if @new_pdef != nil and @new_pdef != @actor.pdef
if @new_pdef > @actor.pdef
self.contents.font.color = system_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 112, 40, 32, "→", 1)
self.contents.draw_text(200, 112, 36, 32, @new_pdef.to_s, 2)
end
if @new_mdef != nil and @new_mdef != @actor.mdef
if @new_mdef > @actor.mdef
self.contents.font.color = system_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 144, 40, 32, "→", 1)
self.contents.draw_text(200, 144, 36, 32, @new_mdef.to_s, 2)
end
if @new_str != nil and @new_str != @actor.str
if @new_str > @actor.str
self.contents.font.color = system_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 192, 40, 32, "→", 1)
self.contents.draw_text(200, 192, 36, 32, @new_str.to_s, 2)
end
if @new_dex != nil and @new_dex != @actor.dex
if @new_dex > @actor.dex
self.contents.font.color = system_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 224, 40, 32, "→", 1)
self.contents.draw_text(200, 224, 36, 32, @new_dex.to_s, 2)
end
if @new_agi != nil and @new_agi != @actor.agi
if @new_agi > @actor.agi
self.contents.font.color = system_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 256, 40, 32, "→", 1)
self.contents.draw_text(200, 256, 36, 32, @new_agi.to_s, 2)
end
if @new_int != nil and @new_int != @actor.int
if @new_int > @actor.int
self.contents.font.color = system_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 288, 40, 32, "→", 1)
self.contents.draw_text(200, 288, 36, 32, @new_int.to_s, 2)
end
end
#--------------------------------------------------------------------------
# ◠装備変更後ã®ãƒ‘ラメータè¨å®š
# new_atk : è£…å‚™å¤‰æ›´å¾Œã®æ”»æ’ƒåŠ›
# new_pdef : 装備変更後ã®ç‰©ç†é˜²å¾¡
# new_mdef : 装備変更後ã®é”法防御
#--------------------------------------------------------------------------
def set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int)
if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef or @new_str != new_str or @new_dex != new_dex or @new_agi != new_agi or @new_int != new_int
@new_atk = new_atk
@new_pdef = new_pdef
@new_mdef = new_mdef
@new_str = new_str
@new_dex = new_dex
@new_agi = new_agi
@new_int = new_int
refresh
end
end
end
#==============================================================================
# â– Harts_Scene_Equip
#------------------------------------------------------------------------------
#  装備画é¢ã®å‡¦ç†ã‚’行ã†ã‚¯ãƒ©ã‚¹ã§ã™ã€‚
#==============================================================================
class Scene_Equip
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
# actor_index : アクターインデックス
# equip_index : 装備インデックス
#--------------------------------------------------------------------------
def initialize(actor_index = 0, equip_index = -1, command_index = 0, equip_active = false, command_active = true)
@actor_index = actor_index
@equip_index = equip_index
@command_index = command_index
@equip_active = equip_active
@command_active = command_active
end
#--------------------------------------------------------------------------
# ◠メイン処ç†
#--------------------------------------------------------------------------
def main
# アクターをå–å¾—
@actor = $game_party.actors[@actor_index]
# ウィンドウを作æˆ
@title_window = Harts_Window_EquipTitle.new
@command_window = Harts_Window_EquipCommand.new
@help_window = Window_Help.new
@help_window.y = 416
@left_window = Harts_Window_EquipLeft.new(@actor)
@right_window = Window_EquipRight.new(@actor)
@item_window0 = Harts_Window_EquipItem.new(@actor, -1)
@item_window1 = Harts_Window_EquipItem.new(@actor, 0)
@item_window2 = Harts_Window_EquipItem.new(@actor, 1)
@item_window3 = Harts_Window_EquipItem.new(@actor, 2)
@item_window4 = Harts_Window_EquipItem.new(@actor, 3)
@item_window5 = Harts_Window_EquipItem.new(@actor, 4)
# ヘルプウィンドウを関連付ã‘
@right_window.help_window = @help_window
@item_window0.help_window = @help_window
@item_window1.help_window = @help_window
@item_window2.help_window = @help_window
@item_window3.help_window = @help_window
@item_window4.help_window = @help_window
@item_window5.help_window = @help_window
# カーソルä½ç½®ã‚’è¨å®š
@command_window.index = @command_index
@right_window.index = @equip_index
# アクティブウィンドウをè¨å®š
@command_window.active = @command_active
@right_window.active = @equip_active
refresh
# トランジション実行
Graphics.transition
# メインループ
loop do
# ゲーム画é¢ã‚’æ›´æ–°
Graphics.update
# å…¥åŠ›æƒ…å ±ã‚’æ›´æ–°
Input.update
# フレーム更新
update
# ç”»é¢ãŒåˆ‡ã‚Šæ›¿ã‚ã£ãŸã‚‰ãƒ«ãƒ¼ãƒ—ã‚’ä¸æ–
if $scene != self
break
end
end
# トランジション準備
Graphics.freeze
# ウィンドウを解放
@title_window.dispose
@command_window.dispose
@help_window.dispose
@left_window.dispose
@right_window.dispose
@item_window0.dispose
@item_window1.dispose
@item_window2.dispose
@item_window3.dispose
@item_window4.dispose
@item_window5.dispose
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
# アイテムウィンドウã®å¯è¦–状態è¨å®š
@item_window0.visible = (@right_window.index == -1)
@item_window1.visible = (@right_window.index == 0)
@item_window2.visible = (@right_window.index == 1)
@item_window3.visible = (@right_window.index == 2)
@item_window4.visible = (@right_window.index == 3)
@item_window5.visible = (@right_window.index == 4)
# ç¾åœ¨è£…å‚™ä¸ã®ã‚¢ã‚¤ãƒ†ãƒ ã‚’å–å¾—
item1 = @right_window.item
# ç¾åœ¨ã®ã‚¢ã‚¤ãƒ†ãƒ ウィンドウを @item_window ã«è¨å®š
case @right_window.index
when -1
@item_window = @item_window0
when 0
@item_window = @item_window1
when 1
@item_window = @item_window2
when 2
@item_window = @item_window3
when 3
@item_window = @item_window4
when 4
@item_window = @item_window5
end
# ライトウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ
if @right_window.active
# 装備変更後ã®ãƒ‘ラメータを消去
@left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil)
end
# アイテムウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ
if @item_window.active
# ç¾åœ¨é¸æŠžä¸ã®ã‚¢ã‚¤ãƒ†ãƒ ã‚’å–å¾—
item2 = @item_window.item
# 装備を変更
last_hp = @actor.hp
last_sp = @actor.sp
@actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
# 装備変更後ã®ãƒ‘ラメータをå–å¾—
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
new_str = @actor.str
new_dex = @actor.dex
new_agi = @actor.agi
new_int = @actor.int
# 装備を戻ã™
@actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
@actor.hp = last_hp
@actor.sp = last_sp
# ãƒ¬ãƒ•ãƒˆã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã«æç”»
@left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int)
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
def update
# ウィンドウを更新
@title_window.update
@command_window.update
@left_window.update
@right_window.update
@item_window.update
refresh
# コマンドウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ: update_command を呼ã¶
if @command_window.active
update_command
return
end
# ライトウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ: update_right を呼ã¶
if @right_window.active
update_right
return
end
# アイテムウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ: update_item を呼ã¶
if @item_window.active
update_item
return
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (コマンドウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ)
#--------------------------------------------------------------------------
def update_command
# B ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# メニュー画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Menu.new(2)
return
end
# C ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::C)
case @command_window.index
# 装備ã®å ´åˆ
when 0
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# ライトウィンドウをアクティブ化
@right_window.active = true
@command_window.active = false
@right_window.index = 0
@command_window.index = -1
return
# 最強装備ã®å ´åˆã€€
when 1
# 装備 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.equip_se)
# 最強装備ã®å–å¾—
max_weapon_id = @item_window1.max_item_id
max_armor1_id = @item_window2.max_item_id
max_armor2_id = @item_window3.max_item_id
max_armor3_id = @item_window4.max_item_id
# 最強装備実行
@actor.equip(0, max_weapon_id)
@actor.equip(1, max_armor1_id)
@actor.equip(2, max_armor2_id)
@actor.equip(3, max_armor3_id)
# ライトウィンドウã€ã‚¢ã‚¤ãƒ†ãƒ ウィンドウã®å†…容をå†ä½œæˆ
@right_window.refresh
@left_window.refresh
@item_window1.refresh
@item_window2.refresh
@item_window3.refresh
@item_window4.refresh
return
#終ã‚ã‚‹ã®å ´åˆ
when 2
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# メニュー画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Menu.new(2)
return
end
end
# R ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::R)
# カーソル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cursor_se)
# 次ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã¸
@actor_index += 1
@actor_index %= $game_party.actors.size
# 別ã®è£…備画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Equip.new(@actor_index, @right_window.index, @command_window.index)
return
end
# L ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::L)
# カーソル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cursor_se)
# å‰ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã¸
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
# 別ã®è£…備画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Equip.new(@actor_index, @right_window.index, @command_window.index)
return
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (ライトウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ)
#--------------------------------------------------------------------------
def update_right
# B ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# コマンドウィンドウをアクティブ化
@right_window.active = false
@command_window.active = true
@right_window.index = -1
@command_window.index = 0
return
end
# C ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::C)
# 装備固定ã®å ´åˆ
if @actor.equip_fix?(@right_window.index)
# ブザー SE ã‚’æ¼”å¥
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# アイテムウィンドウをアクティブ化
@right_window.active = false
@item_window.active = true
@item_window.index = 0
return
end
# R ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::R)
# カーソル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cursor_se)
# 次ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã¸
@actor_index += 1
@actor_index %= $game_party.actors.size
# 別ã®è£…備画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Equip.new(@actor_index, @right_window.index, @command_window.index, true, false)
return
end
# L ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::L)
# カーソル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cursor_se)
# å‰ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã¸
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
# 別ã®è£…備画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Equip.new(@actor_index, @right_window.index, @command_window.index, true, false)
return
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (アイテムウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ)
#--------------------------------------------------------------------------
def update_item
# B ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# ライトウィンドウをアクティブ化
@right_window.active = true
@item_window.active = false
@item_window.index = -1
return
end
# C ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::C)
# 装備 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.equip_se)
# アイテムウィンドウã§ç¾åœ¨é¸æŠžã•れã¦ã„るデータをå–å¾—
item = @item_window.item
# 装備を変更
@actor.equip(@right_window.index, item == nil ? 0 : item.id)
# ライトウィンドウをアクティブ化
@right_window.active = true
@item_window.active = false
@item_window.index = -1
# ライトウィンドウã€ã‚¢ã‚¤ãƒ†ãƒ ウィンドウã®å†…容をå†ä½œæˆ
@right_window.refresh
@item_window.refresh
return
end
end
end
# â– Harts_Window_EquipTitle
#------------------------------------------------------------------------------
#  装備画é¢ã§ã€ã‚¿ã‚¤ãƒˆãƒ«ã‚’表示ã™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã€‚
#==============================================================================
class Harts_Window_EquipTitle < Window_Base
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, $data_system.words.equip, 1)
end
end
#==============================================================================
# â– Harts_Window_EquipCommand
#------------------------------------------------------------------------------
#  装備ã®é¸æŠžã‚’行ã†ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã™ã€‚
#==============================================================================
class Harts_Window_EquipCommand < Window_Selectable
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
super(160, 0, 480, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@item_max = 3
@column_max = 3
@commands = ["装備", "最強装備", "終ã‚ã‚‹"]
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
#--------------------------------------------------------------------------
# â— é …ç›®ã®æç”»
# index : é …ç›®ç•ªå·
# color : æ–‡å—色
#--------------------------------------------------------------------------
def draw_item(index, color)
self.contents.font.color = color
x = index * 160 + 4
self.contents.draw_text(x, 0, 128, 32, @commands[index], 1)
end
end
#==============================================================================
# â– Harts_Window_EquipItem
#------------------------------------------------------------------------------
#  装備画é¢ã§ã€è£…備変更ã®å€™è£œã¨ãªã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®ä¸€è¦§ã‚’表示ã™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã™ã€‚
#==============================================================================
class Harts_Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
# actor : アクター
# equip_type : è£…å‚™éƒ¨ä½ (0~3)
#--------------------------------------------------------------------------
def initialize(actor, equip_type)
super(272, 256, 368, 160)
@actor = actor
@equip_type = equip_type
@column_max = 1
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# ◠アイテムã®å–å¾—
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# ◠最強アイテムã®idå–å¾—
#--------------------------------------------------------------------------
def max_item_id
if @equip_type == 0
if @actor.weapon_id == 0
max = 0
else
max = $data_weapons[@actor.weapon_id].atk
end
elsif @equip_type == 1
if @actor.armor1_id == 0
max = 0
else
max = $data_armors[@actor.armor1_id].pdef
end
elsif @equip_type == 2
if @actor.armor2_id == 0
max = 0
else
max = $data_armors[@actor.armor2_id].pdef
end
elsif @equip_type == 3
if @actor.armor3_id == 0
max = 0
else
max = $data_armors[@actor.armor3_id].pdef
end
end
for i in [email protected]
if @equip_type == 0
if max <= $data_weapons[@data[i].id].atk
max = $data_weapons[@data[i].id].atk
item_id = @data[i].id
end
elsif @equip_type >= 1
if max <= $data_armors[@data[i].id].pdef
max = $data_armors[@data[i].id].pdef
item_id = @data[i].id
end
end
end
return item_id
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
# 装備å¯èƒ½ãªæ¦å™¨ã‚’追åŠ
if @equip_type == 0
weapon_set = $data_classes[@actor.class_id].weapon_set
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
@data.push($data_weapons[i])
end
end
end
# 装備å¯èƒ½ãªé˜²å…·ã‚’追åŠ
if @equip_type >= 1
armor_set = $data_classes[@actor.class_id].armor_set
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0 and armor_set.include?(i)
if $data_armors[i].kind == @equip_type-1
@data.push($data_armors[i])
end
end
end
end
# 空白を追åŠ
@data.push(nil)
# ビットマップを作æˆã—ã€å…¨é …目をæç”»
@item_max = @data.size
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max-1
draw_item(i)
end
end
#--------------------------------------------------------------------------
# â— é …ç›®ã®æç”»
# index : é …ç›®ç•ªå·
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
x = 4
y = index * 32
case item
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = normal_color
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 280, y, 16, 32, ":", 1)
self.contents.draw_text(x + 296, y, 24, 32, number.to_s, 2)
end
#--------------------------------------------------------------------------
# ◠ヘルプテã‚スト更新
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
#==============================================================================
# â– Harts_Window_EquipLeft
#------------------------------------------------------------------------------
#  装備画é¢ã§ã€ã‚¢ã‚¯ã‚¿ãƒ¼ã®ãƒ‘ラメータ変化を表示ã™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã™ã€‚
#==============================================================================
class Harts_Window_EquipLeft < Window_Base
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
# actor : アクター
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 64, 272, 352)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_graphic(@actor, 32, 64)
draw_actor_name(@actor, 4 + 96, 0)
draw_actor_level(@actor, 4 + 96, 32)
draw_actor_parameter(@actor, 4, 80, 0)
draw_actor_parameter(@actor, 4, 112, 1)
draw_actor_parameter(@actor, 4, 144, 2)
draw_actor_parameter(@actor, 4, 192, 3)
draw_actor_parameter(@actor, 4, 224, 4)
draw_actor_parameter(@actor, 4, 256, 5)
draw_actor_parameter(@actor, 4, 288, 6)
if @new_atk != nil and @new_atk != @actor.atk
if @new_atk > @actor.atk
self.contents.font.color = system_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 80, 40, 32, "→", 1)
self.contents.draw_text(200, 80, 36, 32, @new_atk.to_s, 2)
end
if @new_pdef != nil and @new_pdef != @actor.pdef
if @new_pdef > @actor.pdef
self.contents.font.color = system_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 112, 40, 32, "→", 1)
self.contents.draw_text(200, 112, 36, 32, @new_pdef.to_s, 2)
end
if @new_mdef != nil and @new_mdef != @actor.mdef
if @new_mdef > @actor.mdef
self.contents.font.color = system_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 144, 40, 32, "→", 1)
self.contents.draw_text(200, 144, 36, 32, @new_mdef.to_s, 2)
end
if @new_str != nil and @new_str != @actor.str
if @new_str > @actor.str
self.contents.font.color = system_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 192, 40, 32, "→", 1)
self.contents.draw_text(200, 192, 36, 32, @new_str.to_s, 2)
end
if @new_dex != nil and @new_dex != @actor.dex
if @new_dex > @actor.dex
self.contents.font.color = system_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 224, 40, 32, "→", 1)
self.contents.draw_text(200, 224, 36, 32, @new_dex.to_s, 2)
end
if @new_agi != nil and @new_agi != @actor.agi
if @new_agi > @actor.agi
self.contents.font.color = system_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 256, 40, 32, "→", 1)
self.contents.draw_text(200, 256, 36, 32, @new_agi.to_s, 2)
end
if @new_int != nil and @new_int != @actor.int
if @new_int > @actor.int
self.contents.font.color = system_color
else
self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 288, 40, 32, "→", 1)
self.contents.draw_text(200, 288, 36, 32, @new_int.to_s, 2)
end
end
#--------------------------------------------------------------------------
# ◠装備変更後ã®ãƒ‘ラメータè¨å®š
# new_atk : è£…å‚™å¤‰æ›´å¾Œã®æ”»æ’ƒåŠ›
# new_pdef : 装備変更後ã®ç‰©ç†é˜²å¾¡
# new_mdef : 装備変更後ã®é”法防御
#--------------------------------------------------------------------------
def set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int)
if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef or @new_str != new_str or @new_dex != new_dex or @new_agi != new_agi or @new_int != new_int
@new_atk = new_atk
@new_pdef = new_pdef
@new_mdef = new_mdef
@new_str = new_str
@new_dex = new_dex
@new_agi = new_agi
@new_int = new_int
refresh
end
end
end
#==============================================================================
# â– Harts_Scene_Equip
#------------------------------------------------------------------------------
#  装備画é¢ã®å‡¦ç†ã‚’行ã†ã‚¯ãƒ©ã‚¹ã§ã™ã€‚
#==============================================================================
class Scene_Equip
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
# actor_index : アクターインデックス
# equip_index : 装備インデックス
#--------------------------------------------------------------------------
def initialize(actor_index = 0, equip_index = -1, command_index = 0, equip_active = false, command_active = true)
@actor_index = actor_index
@equip_index = equip_index
@command_index = command_index
@equip_active = equip_active
@command_active = command_active
end
#--------------------------------------------------------------------------
# ◠メイン処ç†
#--------------------------------------------------------------------------
def main
# アクターをå–å¾—
@actor = $game_party.actors[@actor_index]
# ウィンドウを作æˆ
@title_window = Harts_Window_EquipTitle.new
@command_window = Harts_Window_EquipCommand.new
@help_window = Window_Help.new
@help_window.y = 416
@left_window = Harts_Window_EquipLeft.new(@actor)
@right_window = Window_EquipRight.new(@actor)
@item_window0 = Harts_Window_EquipItem.new(@actor, -1)
@item_window1 = Harts_Window_EquipItem.new(@actor, 0)
@item_window2 = Harts_Window_EquipItem.new(@actor, 1)
@item_window3 = Harts_Window_EquipItem.new(@actor, 2)
@item_window4 = Harts_Window_EquipItem.new(@actor, 3)
@item_window5 = Harts_Window_EquipItem.new(@actor, 4)
# ヘルプウィンドウを関連付ã‘
@right_window.help_window = @help_window
@item_window0.help_window = @help_window
@item_window1.help_window = @help_window
@item_window2.help_window = @help_window
@item_window3.help_window = @help_window
@item_window4.help_window = @help_window
@item_window5.help_window = @help_window
# カーソルä½ç½®ã‚’è¨å®š
@command_window.index = @command_index
@right_window.index = @equip_index
# アクティブウィンドウをè¨å®š
@command_window.active = @command_active
@right_window.active = @equip_active
refresh
# トランジション実行
Graphics.transition
# メインループ
loop do
# ゲーム画é¢ã‚’æ›´æ–°
Graphics.update
# å…¥åŠ›æƒ…å ±ã‚’æ›´æ–°
Input.update
# フレーム更新
update
# ç”»é¢ãŒåˆ‡ã‚Šæ›¿ã‚ã£ãŸã‚‰ãƒ«ãƒ¼ãƒ—ã‚’ä¸æ–
if $scene != self
break
end
end
# トランジション準備
Graphics.freeze
# ウィンドウを解放
@title_window.dispose
@command_window.dispose
@help_window.dispose
@left_window.dispose
@right_window.dispose
@item_window0.dispose
@item_window1.dispose
@item_window2.dispose
@item_window3.dispose
@item_window4.dispose
@item_window5.dispose
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
# アイテムウィンドウã®å¯è¦–状態è¨å®š
@item_window0.visible = (@right_window.index == -1)
@item_window1.visible = (@right_window.index == 0)
@item_window2.visible = (@right_window.index == 1)
@item_window3.visible = (@right_window.index == 2)
@item_window4.visible = (@right_window.index == 3)
@item_window5.visible = (@right_window.index == 4)
# ç¾åœ¨è£…å‚™ä¸ã®ã‚¢ã‚¤ãƒ†ãƒ ã‚’å–å¾—
item1 = @right_window.item
# ç¾åœ¨ã®ã‚¢ã‚¤ãƒ†ãƒ ウィンドウを @item_window ã«è¨å®š
case @right_window.index
when -1
@item_window = @item_window0
when 0
@item_window = @item_window1
when 1
@item_window = @item_window2
when 2
@item_window = @item_window3
when 3
@item_window = @item_window4
when 4
@item_window = @item_window5
end
# ライトウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ
if @right_window.active
# 装備変更後ã®ãƒ‘ラメータを消去
@left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil)
end
# アイテムウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ
if @item_window.active
# ç¾åœ¨é¸æŠžä¸ã®ã‚¢ã‚¤ãƒ†ãƒ ã‚’å–å¾—
item2 = @item_window.item
# 装備を変更
last_hp = @actor.hp
last_sp = @actor.sp
@actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
# 装備変更後ã®ãƒ‘ラメータをå–å¾—
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
new_str = @actor.str
new_dex = @actor.dex
new_agi = @actor.agi
new_int = @actor.int
# 装備を戻ã™
@actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
@actor.hp = last_hp
@actor.sp = last_sp
# ãƒ¬ãƒ•ãƒˆã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã«æç”»
@left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int)
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
def update
# ウィンドウを更新
@title_window.update
@command_window.update
@left_window.update
@right_window.update
@item_window.update
refresh
# コマンドウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ: update_command を呼ã¶
if @command_window.active
update_command
return
end
# ライトウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ: update_right を呼ã¶
if @right_window.active
update_right
return
end
# アイテムウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ: update_item を呼ã¶
if @item_window.active
update_item
return
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (コマンドウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ)
#--------------------------------------------------------------------------
def update_command
# B ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# メニュー画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Menu.new(2)
return
end
# C ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::C)
case @command_window.index
# 装備ã®å ´åˆ
when 0
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# ライトウィンドウをアクティブ化
@right_window.active = true
@command_window.active = false
@right_window.index = 0
@command_window.index = -1
return
# 最強装備ã®å ´åˆã€€
when 1
# 装備 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.equip_se)
# 最強装備ã®å–å¾—
max_weapon_id = @item_window1.max_item_id
max_armor1_id = @item_window2.max_item_id
max_armor2_id = @item_window3.max_item_id
max_armor3_id = @item_window4.max_item_id
# 最強装備実行
@actor.equip(0, max_weapon_id)
@actor.equip(1, max_armor1_id)
@actor.equip(2, max_armor2_id)
@actor.equip(3, max_armor3_id)
# ライトウィンドウã€ã‚¢ã‚¤ãƒ†ãƒ ウィンドウã®å†…容をå†ä½œæˆ
@right_window.refresh
@left_window.refresh
@item_window1.refresh
@item_window2.refresh
@item_window3.refresh
@item_window4.refresh
return
#終ã‚ã‚‹ã®å ´åˆ
when 2
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# メニュー画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Menu.new(2)
return
end
end
# R ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::R)
# カーソル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cursor_se)
# 次ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã¸
@actor_index += 1
@actor_index %= $game_party.actors.size
# 別ã®è£…備画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Equip.new(@actor_index, @right_window.index, @command_window.index)
return
end
# L ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::L)
# カーソル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cursor_se)
# å‰ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã¸
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
# 別ã®è£…備画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Equip.new(@actor_index, @right_window.index, @command_window.index)
return
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (ライトウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ)
#--------------------------------------------------------------------------
def update_right
# B ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# コマンドウィンドウをアクティブ化
@right_window.active = false
@command_window.active = true
@right_window.index = -1
@command_window.index = 0
return
end
# C ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::C)
# 装備固定ã®å ´åˆ
if @actor.equip_fix?(@right_window.index)
# ブザー SE ã‚’æ¼”å¥
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# アイテムウィンドウをアクティブ化
@right_window.active = false
@item_window.active = true
@item_window.index = 0
return
end
# R ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::R)
# カーソル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cursor_se)
# 次ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã¸
@actor_index += 1
@actor_index %= $game_party.actors.size
# 別ã®è£…備画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Equip.new(@actor_index, @right_window.index, @command_window.index, true, false)
return
end
# L ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::L)
# カーソル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cursor_se)
# å‰ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã¸
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
# 別ã®è£…備画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Equip.new(@actor_index, @right_window.index, @command_window.index, true, false)
return
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (アイテムウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ)
#--------------------------------------------------------------------------
def update_item
# B ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::B)
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# ライトウィンドウをアクティブ化
@right_window.active = true
@item_window.active = false
@item_window.index = -1
return
end
# C ãƒœã‚¿ãƒ³ãŒæŠ¼ã•れãŸå ´åˆ
if Input.trigger?(Input::C)
# 装備 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.equip_se)
# アイテムウィンドウã§ç¾åœ¨é¸æŠžã•れã¦ã„るデータをå–å¾—
item = @item_window.item
# 装備を変更
@actor.equip(@right_window.index, item == nil ? 0 : item.id)
# ライトウィンドウをアクティブ化
@right_window.active = true
@item_window.active = false
@item_window.index = -1
# ライトウィンドウã€ã‚¢ã‚¤ãƒ†ãƒ ウィンドウã®å†…容をå†ä½œæˆ
@right_window.refresh
@item_window.refresh
return
end
end
end
Expand to see the code.
Content Hidden
Spoiler
http://hartshorn-id.hp.infoseek.co.jp/material/equip1/equip1.GIF[/IMG]
This script would not work well with Equip-extend scripts(like KGC's, Guillaume777's.........).
3. Status Window
http://hartshorn-id.hp.infoseek.co.jp/material/status.html
To use this script, you should have gauge picture named 'bar.png'(see attachment).
[spoiler]
[code]
#==============================================================================
# â– Game_Actor
#------------------------------------------------------------------------------
#  アクターを扱ã†ã‚¯ãƒ©ã‚¹ã§ã™ã€‚å†å®šç¾©
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# ◠次ã®ãƒ¬ãƒ™ãƒ«ã¾ã§ã® EXP ã®å‰²åˆå–å¾—
#--------------------------------------------------------------------------
def exp_rate
return @exp_list[@level+1] > 0 ? (@exp - @exp_list[@level]) * 100 / (@exp_list[@level+1] - @exp_list[@level]) : 100
end
end
#==============================================================================
# â– Harts_Window_StatusTitle
#------------------------------------------------------------------------------
#  アイテム画é¢ã§ã€ã‚¿ã‚¤ãƒˆãƒ«ã‚’表示ã™ã‚‹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã€‚
#==============================================================================
class Harts_Window_StatusTitle < Window_Base
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, "ステータス", 1)
end
end
#==============================================================================
# â– Harts_Window_StatusName
#------------------------------------------------------------------------------
#  ステータス画é¢ã§è¡¨ç¤ºã™ã‚‹ã€åå‰ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã™ã€‚
#==============================================================================
class Harts_Window_StatusName < Window_Base
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
# actor : アクター
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 0, 480, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
end
end
#==============================================================================
# â– Window_Status
#------------------------------------------------------------------------------
#  ステータス画é¢ã§è¡¨ç¤ºã™ã‚‹ã€ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã§ã™ã€‚
#==============================================================================
class Harts_Window_Status < Window_Base
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
# actor : アクター
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 0, 640, 416)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# ◠リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# ãƒãƒˆãƒ©ãƒ¼ã‚°ãƒ©ãƒ•ィックãƒãƒ¼ãƒ‰
bitmap = RPG::Cache.battler(@actor.battler_name, @actor.battler_hue)
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(16, 0, bitmap, src_rect)
# ãƒãƒ¼ã‚°ãƒ©ãƒ•ィックãƒãƒ¼ãƒ‰
bar = Bitmap.new("./Graphics/Pictures/bar.png")
draw_actor_class(@actor, 4 + 144, 0)
draw_actor_level(@actor, 4 + 144, 32)
draw_actor_state(@actor, 4 + 144, 64)
hpbar = @actor.hp * 100 / @actor.maxhp
spbar = @actor.sp * 100 / @actor.maxsp
self.contents.blt(390, 107, bar, Rect.new(0, 0, 102, 6))
self.contents.blt(390, 139, bar, Rect.new(0, 0, 102, 6))
if hpbar < 25
self.contents.blt(391, 108, bar, Rect.new(0, 20, hpbar, 4))
elsif hpbar < 50
self.contents.blt(391, 108, bar, Rect.new(0, 16, hpbar, 4))
else
self.contents.blt(391, 108, bar, Rect.new(0, 12, hpbar, 4))
end
if spbar < 25
self.contents.blt(391, 140, bar, Rect.new(0, 20, spbar, 4))
elsif spbar < 50
self.contents.blt(391, 140, bar, Rect.new(0, 16, spbar, 4))
else
self.contents.blt(391, 140, bar, Rect.new(0, 12, spbar, 4))
end
draw_actor_hp(@actor, 320, 80, 172)
draw_actor_sp(@actor, 320, 112, 172)
strbar = @actor.str * 100 / 999
dexbar = @actor.dex * 100 / 999
agibar = @actor.agi * 100 / 999
intbar = @actor.int * 100 / 999
self.contents.blt(480, 176, bar, Rect.new(0, 0, 102, 6))
self.contents.blt(480, 208, bar, Rect.new(0, 0, 102, 6))
self.contents.blt(480, 240, bar, Rect.new(0, 0, 102, 6))
self.contents.blt(480, 272, bar, Rect.new(0, 0, 102, 6))
self.contents.blt(481, 177, bar, Rect.new(0, 24, strbar, 4))
self.contents.blt(481, 209, bar, Rect.new(0, 24, dexbar, 4))
self.contents.blt(481, 241, bar, Rect.new(0, 24, agibar, 4))
self.contents.blt(481, 273, bar, Rect.new(0, 24, intbar, 4))
draw_actor_parameter(@actor, 320, 288, 0)
draw_actor_parameter(@actor, 320, 320, 1)
draw_actor_parameter(@actor, 320, 352, 2)
draw_actor_parameter(@actor, 320, 160, 3)
draw_actor_parameter(@actor, 320, 192, 4)
draw_actor_parameter(@actor, 320, 224, 5)
draw_actor_parameter(@actor, 320, 256, 6)
self.contents.blt(320, 59, bar, Rect.new(0, 6, 202, 6))
self.contents.blt(321, 60, bar, Rect.new(0, 24, @actor.exp_rate * 2, 4))
self.contents.font.color = system_color
self.contents.draw_text(320, 0, 80, 32, "EXP")
self.contents.draw_text(320, 32, 80, 32, "NEXT")
self.contents.font.color = normal_color
self.contents.draw_text(320 + 80, 0, 84, 32, @actor.exp_s, 2)
self.contents.draw_text(320 + 80, 32, 84, 32, @actor.next_rest_exp_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(4, 192, 96, 32, "装備")
draw_item_name($data_weapons[@actor.weapon_id], 16, 224)
draw_item_name($data_armors[@actor.armor1_id], 16, 256)
draw_item_name($data_armors[@actor.armor2_id], 16, 288)
draw_item_name($data_armors[@actor.armor3_id], 16, 320)
draw_item_name($data_armors[@actor.armor4_id], 16, 352)
end
end
#==============================================================================
# â– Harts_Scene_Status
#------------------------------------------------------------------------------
#  ステータス画é¢ã®å‡¦ç†ã‚’行ã†ã‚¯ãƒ©ã‚¹ã§ã™ã€‚å†å®šç¾©
#==============================================================================
class Scene_Status
#--------------------------------------------------------------------------
# â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
# actor_index : アクタ&#