#@ƒƒjƒ…[‰ü‘¢ƒXƒNƒŠƒvƒg Ver 1.03
# ”z•zŒ³EƒTƒ|[ƒgURL traduit par ferrox
# http://members.jcom.home.ne.jp/cogwheel/
#==============================================================================
# ¡ Game_Actor
#------------------------------------------------------------------------------
# @ƒAƒNƒ^[‚ðˆµ‚¤ƒNƒ‰ƒX‚Å‚·B‚±‚̃Nƒ‰ƒX‚Í Game_Actors ƒNƒ‰ƒX ($game_actors)
# ‚Ì“à•”‚ÅŽg—p‚³‚êAGame_Party ƒNƒ‰ƒX ($game_party) ‚
‚ç‚àŽQÆ‚³‚ê‚Ü‚·B
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# œ ƒoƒgƒ‹‰æ–Ê X À•W‚̎擾
#--------------------------------------------------------------------------
alias :screen_x_original :screen_x
def screen_x
# ƒp[ƒeƒB“à‚Ì•À‚ч‚
‚ç X À•W‚ðŒvŽZ‚µ‚Ä•Ô‚·
if $game_temp.in_battle
return screen_x_original
else
if self.index != nil
return (self.index / 2 + 1) * 128 + (self.index % 2) * 264
else
return 0
end
end
end
#--------------------------------------------------------------------------
# œ ƒoƒgƒ‹‰æ–Ê Y À•W‚̎擾
#--------------------------------------------------------------------------
alias :screen_y_original :screen_y
def screen_y
if $game_temp.in_battle
return screen_y_original
else
return 360 +(self.index / 2) * 104
end
end
end
#==============================================================================
# ¡ Window_Help
#------------------------------------------------------------------------------
# @ƒXƒLƒ‹‚âƒAƒCƒeƒ€‚Ìà–¾AƒAƒNƒ^[‚̃Xƒe[ƒ^ƒX‚È‚Ç‚ð•\Ž¦‚·‚éƒEƒBƒ“ƒhƒE‚Å‚·B
#==============================================================================
class Window_Help2 < Window_Base
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
#--------------------------------------------------------------------------
def initialize
super(20, 42, 600, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.z = 6110
self.back_opacity = 192
end
#--------------------------------------------------------------------------
# œ ƒeƒLƒXƒgÝ’è
# text : ƒEƒBƒ“ƒhƒE‚É•\Ž¦‚·‚镶Žš—ñ
# align : ƒAƒ‰ƒCƒ“ƒƒ“ƒg (0..¶‘µ‚¦A1..’†‰›‘µ‚¦A2..‰E‘µ‚¦)
#--------------------------------------------------------------------------
def set_text(text, align = 0)
# ƒeƒLƒXƒg‚ƃAƒ‰ƒCƒ“ƒƒ“ƒg‚Ì‚È‚‚Æ‚àˆê•û‚ª‘O‰ñ‚ƈá‚Á‚Ä‚¢‚éê‡
if text != @text or align != @align
# ƒeƒLƒXƒg‚ðÄ•`‰æ
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
@text = text
@align = align
@actor = nil
end
self.visible = true
end
#--------------------------------------------------------------------------
# œ ƒAƒNƒ^[Ý’è
# actor : ƒXƒe[ƒ^ƒX‚ð•\Ž¦‚·‚éƒAƒNƒ^[
#--------------------------------------------------------------------------
def set_actor(actor)
if actor != @actor
self.contents.clear
draw_actor_name(actor, 0, 0)
draw_actor_state(actor, 144, 0, 100)
draw_actor_hp(@actor, 256, 0)
draw_actor_sp(@actor, 424, 0)
@actor = actor
@text = nil
self.visible = true
end
end
#--------------------------------------------------------------------------
# œ ƒGƒlƒ~[Ý’è
# enemy : –¼‘O‚ƃXƒe[ƒg‚ð•\Ž¦‚·‚éƒGƒlƒ~[
#--------------------------------------------------------------------------
def set_enemy(enemy)
text = enemy.name
state_text = make_battler_state_text(enemy, 112, false)
if state_text != ""
text += " " + state_text
end
set_text(text, 1)
end
end
#==============================================================================
# ¡ Window_Base
#------------------------------------------------------------------------------
# @ƒQ[ƒ€’†‚Ì‚·‚ׂẴEƒBƒ“ƒhƒE‚̃X[ƒp[ƒNƒ‰ƒX‚Å‚·B
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# œ –¼‘O‚Ì•`‰æ
# actor : ƒAƒNƒ^[
# x : •`‰ææ X À•W
# y : •`‰ææ Y À•W
#--------------------------------------------------------------------------
def draw_actor_name(actor, x, y)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 120, 32, actor.name)
end
#--------------------------------------------------------------------------
# œ ƒNƒ‰ƒX‚Ì•`‰æ
# actor : ƒAƒNƒ^[
# x : •`‰ææ X À•W
# y : •`‰ææ Y À•W
#--------------------------------------------------------------------------
def draw_actor_class(actor, x, y)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 120, 32, actor.class_name)
end
#--------------------------------------------------------------------------
# œ ƒOƒ‰ƒtƒBƒbƒN‚Ì•`‰æ
# actor : ƒAƒNƒ^[
# x : •`‰ææ X À•W
# y : •`‰ææ Y À•W
#--------------------------------------------------------------------------
def draw_actor_battler(actor, x, y)
bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
cw = bitmap.width / 2
ch = bitmap.height
self.contents.blt(x - cw, y - ch, bitmap, bitmap.rect, 208)
end
#--------------------------------------------------------------------------
# œ ƒAƒCƒeƒ€–¼‚Ì•`‰æ
# item : ƒAƒCƒeƒ€
# x : •`‰ææ X À•W
# y : •`‰ææ Y À•W
#--------------------------------------------------------------------------
def draw_item_name(item, x, y, width = 240)
if item == nil
return
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, width - 28, 32, item.name)
end
end
#==============================================================================
# ¡ Window_Command2
#------------------------------------------------------------------------------
# @ˆê”Ê“I‚ȃRƒ}ƒ“ƒh‘I‘ð‚ðs‚¤ƒEƒBƒ“ƒhƒE‚Å‚·B
#==============================================================================
class Window_MenuCommand < Window_Selectable
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
# width : ƒEƒBƒ“ƒhƒE‚Ì•
# commands : ƒRƒ}ƒ“ƒh•¶Žš—ñ‚Ì”z—ñ
#--------------------------------------------------------------------------
def initialize(width, commands)
# ƒRƒ}ƒ“ƒh‚̌”‚
‚çƒEƒBƒ“ƒhƒE‚Ì‚‚³‚ðŽZo
super(0, 0, width, 160)
@item_max = commands.size
@commands = commands
@column_max = 2
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# œ ƒŠƒtƒŒƒbƒVƒ…
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i, normal_color)
end
end
#--------------------------------------------------------------------------
# œ ƒJ[ƒ\ƒ‹‚Ì‹éŒ`XV
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set((index % 2) * 128, 32 * (index / 2), 128, 32)
end
end
#--------------------------------------------------------------------------
# œ €–Ú‚Ì•`‰æ
# index : €–Ú”Ô†
# color : •¶ŽšF
#--------------------------------------------------------------------------
def draw_item(index, color)
self.contents.font.color = color
rect = Rect.new(4 + (index % 2) * 128, 32 * (index / 2), 128, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(rect, @commands[index])
end
#--------------------------------------------------------------------------
# œ €–Ú‚Ì–³Œø‰»
# index : €–Ú”Ô†
#--------------------------------------------------------------------------
def disable_item(index)
draw_item(index, disabled_color)
end
end
#==============================================================================
# ¡ Window_MenuStatus
#------------------------------------------------------------------------------
# @ƒƒjƒ…[‰æ–ʂŃp[ƒeƒBƒƒ“ƒo[‚̃Xƒe[ƒ^ƒX‚ð•\Ž¦‚·‚éƒEƒBƒ“ƒhƒE‚Å‚·B
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# œ ŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï”
#--------------------------------------------------------------------------
attr_accessor :out_window # Œ»ƒEƒBƒ“ƒhƒE
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
#--------------------------------------------------------------------------
def initialize
super(40, 0, 560, 480)
self.z = 6100
self.opacity = 0
self.back_opacity = 0
@out_window = Window_Base.new(40, 220, 560, 240)
@out_window.z = 6100
@out_window.back_opacity = 192
@column_max = 2
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# œ ‰ð•ú
#--------------------------------------------------------------------------
def dispose
@out_window.dispose
super
end
#--------------------------------------------------------------------------
# œ ƒŠƒtƒŒƒbƒVƒ…
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = (i % 2) * 264
y = (i / 2) * 104 + 220
actor = $game_party.actors[i]
draw_actor_battler(actor, x + (2 - i / 2) * 88, y + 104)
draw_actor_name(actor, x + 12, y)
draw_actor_class(actor, x + 132, y)
draw_actor_level(actor, x + 12, y + 24)
draw_actor_state(actor, x + 12, y + 48, 100)
draw_actor_exp(actor, x + 30, y + 72)
draw_actor_hp(actor, x + 108, y + 24)
draw_actor_sp(actor, x + 108, y + 48)
end
end
#--------------------------------------------------------------------------
# œ ƒJ[ƒ\ƒ‹‚Ì‹éŒ`XV
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
if @index == -2
self.cursor_rect.set(0, 220, 528, 208)
elsif @index < -2
self.cursor_rect.set(((@index + 10) % 2) * 264,
((@index + 10) / 2) * 104 + 220, 264, 104)
else
self.cursor_rect.empty
end
else
self.cursor_rect.set((@index % 2) * 264, (@index / 2) * 104 + 220,
264, 104)
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV
#--------------------------------------------------------------------------
def update
@out_window.update
super
end
end
#==============================================================================
# ¡ Scene_Menu
#------------------------------------------------------------------------------
# @ƒƒjƒ…[‰æ–ʂ̈—‚ðs‚¤ƒNƒ‰ƒX‚Å‚·B
#==============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# œ ŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï”
#--------------------------------------------------------------------------
attr_accessor :menu # Œ»ƒEƒBƒ“ƒhƒE
attr_accessor :command_window # ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE
attr_accessor :status_window # ƒ^[ƒQƒbƒgƒEƒBƒ“ƒhƒE
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
# menu_index : ƒRƒ}ƒ“ƒh‚̃J[ƒ\ƒ‹‰ŠúˆÊ’u
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# œ ƒƒCƒ“ˆ—
#--------------------------------------------------------------------------
def main
# ƒXƒvƒ‰ƒCƒgƒZƒbƒg‚ðì¬
@spriteset = Spriteset_Map.new
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ðì¬
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Statut"
s5 = "Sauvegarder"
s6 = "Charger"
s7 = "Quitter"
@command_window = Window_MenuCommand.new(288, [s1, s2, s3, s4, s5, s6, s7])
@command_window.index = @menu_index
@command_window.x = 40
@command_window.y = 20
@command_window.z = 6100
@command_window.back_opacity = 192
# ƒp[ƒeƒBl”‚ª 0 l‚Ìê‡
if $game_party.actors.size == 0
# ƒAƒCƒeƒ€AƒXƒLƒ‹A‘•”õAƒXƒe[ƒ^ƒX‚𖳌ø‰»
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
# ƒZ[ƒu‹ÖŽ~‚Ìê‡
if $game_system.save_disabled
# ƒZ[ƒu‚𖳌ø‚É‚·‚é
@command_window.disable_item(4)
end
# ƒS[ƒ‹ƒhƒEƒBƒ“ƒhƒE‚ðì¬
@gold_window = Window_Gold.new
@gold_window.x = 440
@gold_window.y = 20
@gold_window.z = 6100
@gold_window.back_opacity = 192
# ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðì¬
@status_window = Window_MenuStatus.new
@menu = nil
# ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“ŽÀs
Graphics.transition
# ƒƒCƒ“ƒ‹[ƒv
loop do
# ƒQ[ƒ€‰æ–Ê‚ðXV
Graphics.update
# “ü—Íî•ñ‚ðXV
Input.update
# ƒtƒŒ[ƒ€XV
update
if @menu != nil
@menu.update
end
# ‰æ–Ê‚ªØ‚è‘Ö‚í‚Á‚½‚烋[ƒv‚ð’†’f
if $scene != self
break
end
end
# ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“€”õ
Graphics.freeze
# ƒXƒvƒ‰ƒCƒgƒZƒbƒg‚ð‰ð•ú
@spriteset.dispose
# ƒEƒBƒ“ƒhƒE‚ð‰ð•ú
@command_window.dispose
@gold_window.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV
#--------------------------------------------------------------------------
def update
# ƒEƒBƒ“ƒhƒE‚ðXV
@command_window.update
@gold_window.update
@status_window.update
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡: update_command ‚ðŒÄ‚Ô
if @command_window.active and @menu == nil
update_command
return
end
# ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡: update_status ‚ðŒÄ‚Ô
if @status_window.active and @menu == nil
update_status
return
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡)
#--------------------------------------------------------------------------
def update_command
# B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::B)
# ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cancel_se)
# ƒ}ƒbƒv‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene = Scene_Map.new
return
end
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
# ƒp[ƒeƒBl”‚ª 0 l‚ÅAƒZ[ƒuAƒQ[ƒ€I—¹ˆÈŠO‚̃Rƒ}ƒ“ƒh‚Ìê‡
if $game_party.actors.size == 0 and @command_window.index < 4
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚̃J[ƒ\ƒ‹ˆÊ’u‚Å•ªŠò
case @command_window.index
when 0 # ƒAƒCƒeƒ€
Input.update
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒAƒCƒeƒ€‰æ–Ê‚ÉØ‚è‘Ö‚¦
@menu = Scene_Item.new
when 1 # ƒXƒLƒ‹
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðƒAƒNƒeƒBƒu‚É‚·‚é
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2 # ‘•”õ
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðƒAƒNƒeƒBƒu‚É‚·‚é
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3 # ƒXƒe[ƒ^ƒX
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðƒAƒNƒeƒBƒu‚É‚·‚é
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 4 # ƒZ[ƒu
# ƒZ[ƒu‹ÖŽ~‚Ìê‡
if $game_system.save_disabled
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
Input.update
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒZ[ƒu‰æ–Ê‚ÉØ‚è‘Ö‚¦
@menu = Scene_Save.new
when 5 # ƒ[ƒh
Input.update
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒZ[ƒu‰æ–Ê‚ÉØ‚è‘Ö‚¦
@menu = Scene_Load.new
when 6 # ƒQ[ƒ€I—¹
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒQ[ƒ€I—¹‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene = Scene_End.new
end
return
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡)
#--------------------------------------------------------------------------
def update_status
# B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::B)
# ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cancel_se)
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ðƒAƒNƒeƒBƒu‚É‚·‚é
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
# ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚̃J[ƒ\ƒ‹ˆÊ’u‚Å•ªŠò
case @command_window.index
when 1 # ƒXƒLƒ‹
# ‚±‚̃AƒNƒ^[‚Ìs“
§ŒÀ‚ª 2 ˆÈã‚Ìê‡
if $game_party.actors[@status_window.index].restriction >= 2
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
Input.update
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒXƒLƒ‹‰æ–Ê‚ÉØ‚è‘Ö‚¦
@menu = Scene_Skill.new(@status_window.index)
when 2 # ‘•”õ
Input.update
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ‘•”õ‰æ–Ê‚ÉØ‚è‘Ö‚¦
@menu = Scene_Equip.new(@status_window.index)
when 3 # ƒXƒe[ƒ^ƒX
Input.update
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒXƒe[ƒ^ƒX‰æ–Ê‚ÉØ‚è‘Ö‚¦
@menu = Scene_Status.new(@status_window.index)
end
return
end
end
end
#==============================================================================
# ¡ Window_Item
#------------------------------------------------------------------------------
# @ƒAƒCƒeƒ€‰æ–ÊAƒoƒgƒ‹‰æ–Ê‚ÅAŠŽƒAƒCƒeƒ€‚̈ꗗ‚ð•\Ž¦‚·‚éƒEƒBƒ“ƒhƒE‚Å‚·B
#==============================================================================
class Window_Item < Window_Selectable
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
#--------------------------------------------------------------------------
def initialize
super(20, 106, 600, 320)
self.index = 0
self.back_opacity = 192
@column_max = 2
# 퓬’†‚Ìꇂ̓EƒBƒ“ƒhƒE‚ð‰æ–Ê’†‰›‚ÖˆÚ“
‚µA”¼“§–¾‚É‚·‚é
if $game_temp.in_battle
self.x = 0
self.y = 64
self.width = 640
self.height = 256
else
self.z = 6110
end
refresh
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
if $game_temp.in_battle
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
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 + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
else
x = 4 + index % 2 * 284
y = index / 2 * 32
rect = Rect.new(x, y, 280, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
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, 208, 32, item.name, 0)
self.contents.draw_text(x + 236, y, 16, 32, ":", 1)
self.contents.draw_text(x + 252, y, 24, 32, number.to_s, 2)
end
end
#--------------------------------------------------------------------------
# œ ƒJ[ƒ\ƒ‹‚Ì‹éŒ`XV
#--------------------------------------------------------------------------
def update_cursor_rect
if $game_temp.in_battle
super
else
# Œ»Ý‚Ìs‚ðŽæ“¾
row = @index / @column_max
# Œ»Ý‚Ìs‚ªA•\Ž¦‚³‚ê‚Ä‚¢‚é擪‚Ìs‚æ‚è‘O‚Ìê‡
if row < self.top_row
# Œ»Ý‚Ìs‚ªæ“ª‚É‚È‚é‚悤‚ɃXƒNƒ[ƒ‹
self.top_row = row
end
# Œ»Ý‚Ìs‚ªA•\Ž¦‚³‚ê‚Ä‚¢‚éÅŒã”ö‚Ìs‚æ‚èŒã‚ë‚Ìê‡
if row > self.top_row + (self.page_row_max - 1)
# Œ»Ý‚Ìs‚ªÅŒã”ö‚É‚È‚é‚悤‚ɃXƒNƒ[ƒ‹
self.top_row = row - (self.page_row_max - 1)
end
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set((index % 2) * 284,
@index / @column_max * 32 - self.oy, 284, 32)
end
end
end
end
#==============================================================================
# ¡ Scene_Item
#------------------------------------------------------------------------------
# @ƒAƒCƒeƒ€‰æ–ʂ̈—‚ðs‚¤ƒNƒ‰ƒX‚Å‚·B
#==============================================================================
class Scene_Item
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
#--------------------------------------------------------------------------
def initialize
# ƒwƒ‹ƒvƒEƒBƒ“ƒhƒEAƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚ðì¬
@help_window = Window_Help2.new
@item_window = Window_Item.new
# ƒwƒ‹ƒvƒEƒBƒ“ƒhƒE‚ðŠÖ˜A•t‚¯
@item_window.help_window = @help_window
$scene.command_window.active = false
end
#--------------------------------------------------------------------------
# œ ‰ð•ú
#--------------------------------------------------------------------------
def dispose
# ƒEƒBƒ“ƒhƒE‚ð‰ð•ú
@help_window.dispose
@item_window.dispose
$scene.menu = nil
$scene.command_window.active = true
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV
#--------------------------------------------------------------------------
def update
# ƒEƒBƒ“ƒhƒE‚ðXV
@help_window.update
@item_window.update
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡: update_item ‚ðŒÄ‚Ô
if @item_window.active
update_item
return
end
# ƒ^[ƒQƒbƒgƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡: update_target ‚ðŒÄ‚Ô
if $scene.status_window.active
update_target
return
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡)
#--------------------------------------------------------------------------
def update_item
# B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::B)
# ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cancel_se)
dispose
return
end
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚ÅŒ»Ý‘I‘ð‚³‚ê‚Ä‚¢‚éƒf[ƒ^‚ðŽæ“¾
@item = @item_window.item
# Žg—pƒAƒCƒeƒ€‚Å‚Í‚È‚¢ê‡
unless @item.is_a?(RPG::Item)
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
# Žg—p‚Å‚«‚È‚¢ê‡
unless $game_party.item_can_use?(@item.id)
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# Œø‰Ê”͈͂ª–¡•û‚Ìê‡
if @item.scope >= 3
# ƒ^[ƒQƒbƒgƒEƒBƒ“ƒhƒE‚ðƒAƒNƒeƒBƒu‰»
@item_window.active = false
$scene.status_window.z = 6120
$scene.status_window.out_window.z = 6120
$scene.status_window.active = true
# Œø‰Ê”ÍˆÍ (’P‘Ì/‘S‘Ì) ‚ɉž‚¶‚ăJ[ƒ\ƒ‹ˆÊ’u‚ðÝ’è
if @item.scope == 4 || @item.scope == 6
$scene.status_window.index = -2
else
$scene.status_window.index = 0
end
# Œø‰Ê”͈͂ª–¡•ûˆÈŠO‚Ìê‡
else
# ƒRƒ‚ƒ“ƒCƒxƒ“ƒg ID ‚ª—LŒø‚Ìê‡
if @item.common_event_id > 0
# ƒRƒ‚ƒ“ƒCƒxƒ“ƒgŒÄ‚Ño‚µ—\–ñ
$game_temp.common_event_id = @item.common_event_id
# ƒAƒCƒeƒ€‚ÌŽg—pŽž SE ‚ð‰‰‘t
$game_system.se_play(@item.menu_se)
# Á–Õ•i‚Ìê‡
if @item.consumable
# Žg—p‚µ‚½ƒAƒCƒeƒ€‚ð 1 Œ¸‚ç‚·
$game_party.lose_item(@item.id, 1)
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚Ì€–Ú‚ðÄ•`‰æ
@item_window.draw_item(@item_window.index)
end
# ƒ}ƒbƒv‰æ–Ê‚ÉØ‚è‘Ö‚¦
dispose
$scene = Scene_Map.new
return
end
end
return
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒ^[ƒQƒbƒgƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡)
#--------------------------------------------------------------------------
def update_target
# B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::B)
# ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cancel_se)
# ƒAƒCƒeƒ€Ø‚ê‚È‚Ç‚ÅŽg—p‚Å‚«‚È‚‚È‚Á‚½ê‡
unless $game_party.item_can_use?(@item.id)
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚Ì“à—e‚ðÄì¬
@item_window.refresh
end
# ƒ^[ƒQƒbƒgƒEƒBƒ“ƒhƒE‚ðÁ‹Ž
@item_window.active = true
$scene.status_window.index = -1
$scene.status_window.z = 6100
$scene.status_window.out_window.z = 6100
$scene.status_window.active = false
return
end
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
# ƒAƒCƒeƒ€‚ðŽg‚¢Ø‚Á‚½ê‡
if $game_party.item_number(@item.id) == 0
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
# ƒ^[ƒQƒbƒg‚ª‘S‘Ì‚Ìê‡
if $scene.status_window.index < 0
# ƒp[ƒeƒB‘S‘̂ɃAƒCƒeƒ€‚ÌŽg—pŒø‰Ê‚ð“K—p
used = false
for i in $game_party.actors
used |= i.item_effect(@item)
end
end
# ƒ^[ƒQƒbƒg‚ª’P‘Ì‚Ìê‡
if $scene.status_window.index >= 0
# ƒ^[ƒQƒbƒg‚̃AƒNƒ^[‚ɃAƒCƒeƒ€‚ÌŽg—pŒø‰Ê‚ð“K—p
target = $game_party.actors[$scene.status_window.index]
used = target.item_effect(@item)
end
# ƒAƒCƒeƒ€‚ðŽg‚Á‚½ê‡
if used
# ƒAƒCƒeƒ€‚ÌŽg—pŽž SE ‚ð‰‰‘t
$game_system.se_play(@item.menu_se)
# Á–Õ•i‚Ìê‡
if @item.consumable
# Žg—p‚µ‚½ƒAƒCƒeƒ€‚ð 1 Œ¸‚ç‚·
$game_party.lose_item(@item.id, 1)
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚Ì€–Ú‚ðÄ•`‰æ
@item_window.draw_item(@item_window.index)
end
# ƒ^[ƒQƒbƒgƒEƒBƒ“ƒhƒE‚Ì“à—e‚ðÄì¬
$scene.status_window.refresh
# ‘S–Å‚Ìê‡
if $game_party.all_dead?
# ƒQ[ƒ€ƒI[ƒo[‰æ–Ê‚ÉØ‚è‘Ö‚¦
dispose
$scene = Scene_Gameover.new
return
end
# ƒRƒ‚ƒ“ƒCƒxƒ“ƒg ID ‚ª—LŒø‚Ìê‡
if @item.common_event_id > 0
# ƒRƒ‚ƒ“ƒCƒxƒ“ƒgŒÄ‚Ño‚µ—\–ñ
$game_temp.common_event_id = @item.common_event_id
# ƒ}ƒbƒv‰æ–Ê‚ÉØ‚è‘Ö‚¦
dispose
$scene = Scene_Map.new
return
end
end
# ƒAƒCƒeƒ€‚ðŽg‚í‚È‚
‚Á‚½ê‡
unless used
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
end
#==============================================================================
# ¡ Window_SkillStatus
#------------------------------------------------------------------------------
# @ƒXƒLƒ‹‰æ–Ê‚ÅAƒXƒLƒ‹Žg—pŽÒ‚̃Xƒe[ƒ^ƒX‚ð•\Ž¦‚·‚éƒEƒBƒ“ƒhƒE‚Å‚·B
#==============================================================================
class Window_SkillStatus < Window_Base
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
# actor : ƒAƒNƒ^[
#--------------------------------------------------------------------------
def initialize(actor)
super(20, 106, 600, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.z = 6110
self.back_opacity = 192
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# œ ƒŠƒtƒŒƒbƒVƒ…
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
draw_actor_state(@actor, 148, 0, 100)
draw_actor_hp(@actor, 260, 0)
draw_actor_sp(@actor, 420, 0)
end
end
#==============================================================================
# ¡ Window_Skill
#------------------------------------------------------------------------------
# @ƒXƒLƒ‹‰æ–ÊAƒoƒgƒ‹‰æ–Ê‚ÅAŽg—p‚Å‚«‚éƒXƒLƒ‹‚̈ꗗ‚ð•\Ž¦‚·‚éƒEƒBƒ“ƒhƒE‚Å‚·B
#==============================================================================
class Window_Skill < Window_Selectable
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
# actor : ƒAƒNƒ^[
#--------------------------------------------------------------------------
def initialize(actor)
super(20, 170, 600, 256)
self.back_opacity = 192
self.index = 0
@actor = actor
@column_max = 2
# 퓬’†‚Ìꇂ̓EƒBƒ“ƒhƒE‚ð‰æ–Ê’†‰›‚ÖˆÚ“
‚µA”¼“§–¾‚É‚·‚é
if $game_temp.in_battle
self.x = 0
self.y = 64
self.width = 640
self.height = 256
else
self.z = 6110
end
refresh
end
#--------------------------------------------------------------------------
# œ €–Ú‚Ì•`‰æ
# index : €–Ú”Ô†
#--------------------------------------------------------------------------
def draw_item(index)
skill = @data[index]
if @actor.skill_can_use?(skill.id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
if $game_temp.in_battle
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.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, 204, 32, skill.name, 0)
self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2)
else
x = 4 + index % 2 * 284
y = index / 2 * 32
rect = Rect.new(x, y, 280, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.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, 200, 32, skill.name, 0)
self.contents.draw_text(x + 228, y, 48, 32, skill.sp_cost.to_s, 2)
end
end
#--------------------------------------------------------------------------
# œ ƒwƒ‹ƒvƒeƒLƒXƒgXV
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.skill == nil ? "" : self.skill.description)
end
#--------------------------------------------------------------------------
# œ ƒJ[ƒ\ƒ‹‚Ì‹éŒ`XV
#--------------------------------------------------------------------------
def update_cursor_rect
if $game_temp.in_battle
super
else
# Œ»Ý‚Ìs‚ðŽæ“¾
row = @index / @column_max
# Œ»Ý‚Ìs‚ªA•\Ž¦‚³‚ê‚Ä‚¢‚é擪‚Ìs‚æ‚è‘O‚Ìê‡
if row < self.top_row
# Œ»Ý‚Ìs‚ªæ“ª‚É‚È‚é‚悤‚ɃXƒNƒ[ƒ‹
self.top_row = row
end
# Œ»Ý‚Ìs‚ªA•\Ž¦‚³‚ê‚Ä‚¢‚éÅŒã”ö‚Ìs‚æ‚èŒã‚ë‚Ìê‡
if row > self.top_row + (self.page_row_max - 1)
# Œ»Ý‚Ìs‚ªÅŒã”ö‚É‚È‚é‚悤‚ɃXƒNƒ[ƒ‹
self.top_row = row - (self.page_row_max - 1)
end
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set((index % 2) * 284,
@index / @column_max * 32 - self.oy, 284, 32)
end
end
end
end
#==============================================================================
# ¡ Scene_Skill
#------------------------------------------------------------------------------
# @ƒXƒLƒ‹‰æ–ʂ̈—‚ðs‚¤ƒNƒ‰ƒX‚Å‚·B
#==============================================================================
class Scene_Skill
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
# actor_index : ƒAƒNƒ^[ƒCƒ“ƒfƒbƒNƒX
#--------------------------------------------------------------------------
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
# ƒAƒNƒ^[‚ðŽæ“¾
@actor = $game_party.actors[@actor_index]
# ƒwƒ‹ƒvƒEƒBƒ“ƒhƒEAƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒEAƒXƒLƒ‹ƒEƒBƒ“ƒhƒE‚ðì¬
@help_window = Window_Help2.new
@status_window = Window_SkillStatus.new(@actor)
@skill_window = Window_Skill.new(@actor)
@skill_window.z = 6110
@skill_window.back_opacity = 160
# ƒwƒ‹ƒvƒEƒBƒ“ƒhƒE‚ðŠÖ˜A•t‚¯
@skill_window.help_window = @help_window
$scene.command_window.active = false
$scene.status_window.active = false
end
#--------------------------------------------------------------------------
# œ ‰ð•ú
#--------------------------------------------------------------------------
def dispose
# ƒEƒBƒ“ƒhƒE‚ð‰ð•ú
@help_window.dispose
@status_window.dispose
@skill_window.dispose
$scene.menu = nil
$scene.status_window.index = -1
$scene.command_window.active = true
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV
#--------------------------------------------------------------------------
def update
# ƒEƒBƒ“ƒhƒE‚ðXV
@help_window.update
@status_window.update
@skill_window.update
# ƒXƒLƒ‹ƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡: update_skill ‚ðŒÄ‚Ô
if @skill_window.active
update_skill
return
end
# ƒ^[ƒQƒbƒgƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡: update_target ‚ðŒÄ‚Ô
if $scene.status_window.active
update_target
return
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒXƒLƒ‹ƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡)
#--------------------------------------------------------------------------
def update_skill
# B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::B)
# ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cancel_se)
# ƒƒjƒ…[‰æ–Ê‚ÉØ‚è‘Ö‚¦
dispose
return
end
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
# ƒXƒLƒ‹ƒEƒBƒ“ƒhƒE‚ÅŒ»Ý‘I‘ð‚³‚ê‚Ä‚¢‚éƒf[ƒ^‚ðŽæ“¾
@skill = @skill_window.skill
# Žg—p‚Å‚«‚È‚¢ê‡
if @skill == nil or not @actor.skill_can_use?(@skill.id)
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
# Œˆ’è SE ‚ð‰‰‘t
$game_system.se_play($data_system.decision_se)
# Œø‰Ê”͈͂ª–¡•û‚Ìê‡
if @skill.scope >= 3
# ƒ^[ƒQƒbƒgƒEƒBƒ“ƒhƒE‚ðƒAƒNƒeƒBƒu‰»
@skill_window.active = false
$scene.status_window.z = 6120
$scene.status_window.out_window.z = 6120
$scene.status_window.active = true
# Œø‰Ê”ÍˆÍ (’P‘Ì/‘S‘Ì) ‚ɉž‚¶‚ăJ[ƒ\ƒ‹ˆÊ’u‚ðÝ’è
if @skill.scope == 4 || @skill.scope == 6
$scene.status_window.index = -2
elsif @skill.scope == 7
$scene.status_window.index = @actor_index - 10
else
$scene.status_window.index = 0
end
# Œø‰Ê”͈͂ª–¡•ûˆÈŠO‚Ìê‡
else
# ƒRƒ‚ƒ“ƒCƒxƒ“ƒg ID ‚ª—LŒø‚Ìê‡
if @skill.common_event_id > 0
# ƒRƒ‚ƒ“ƒCƒxƒ“ƒgŒÄ‚Ño‚µ—\–ñ
$game_temp.common_event_id = @skill.common_event_id
# ƒXƒLƒ‹‚ÌŽg—pŽž SE ‚ð‰‰‘t
$game_system.se_play(@skill.menu_se)
# SP Á”ï
@actor.sp -= @skill.sp_cost
# ŠeƒEƒBƒ“ƒhƒE‚Ì“à—e‚ðÄì¬
@status_window.refresh
@skill_window.refresh
$scene.status_window.refresh
# ƒ}ƒbƒv‰æ–Ê‚ÉØ‚è‘Ö‚¦
dispose
$scene = Scene_Map.new
return
end
end
return
end
# R ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::R)
# ƒJ[ƒ\ƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cursor_se)
# ŽŸ‚̃AƒNƒ^[‚Ö
@actor_index += 1
@actor_index %= $game_party.actors.size
@actor = $game_party.actors[@actor_index]
dispose
$scene.status_window.index = @actor.index
$scene.menu = Scene_Skill.new(@actor.index)
return
end
# L ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::L)
# ƒJ[ƒ\ƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cursor_se)
# ‘O‚̃AƒNƒ^[‚Ö
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
@actor = $game_party.actors[@actor_index]
dispose
$scene.status_window.index = @actor.index
$scene.menu = Scene_Skill.new(@actor.index)
return
end
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒ^[ƒQƒbƒgƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡)
#--------------------------------------------------------------------------
def update_target
# B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::B)
# ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cancel_se)
# ƒ^[ƒQƒbƒgƒEƒBƒ“ƒhƒE‚ðÁ‹Ž
@skill_window.active = true
$scene.status_window.index = @actor.index
$scene.status_window.z = 6100
$scene.status_window.out_window.z = 6100
$scene.status_window.active = false
return
end
# C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::C)
# SP Ø‚ê‚È‚Ç‚ÅŽg—p‚Å‚«‚È‚‚È‚Á‚½ê‡
unless @actor.skill_can_use?(@skill.id)
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
# ƒ^[ƒQƒbƒg‚ª‘S‘Ì‚Ìê‡
if $scene.status_window.index == -2
# ƒp[ƒeƒB‘S‘̂ɃXƒLƒ‹‚ÌŽg—pŒø‰Ê‚ð“K—p
used = false
for i in $game_party.actors
used |= i.skill_effect(@actor, @skill)
end
end
# ƒ^[ƒQƒbƒg‚ªŽg—pŽÒ‚Ìê‡
if $scene.status_window.index < -2
# ƒ^[ƒQƒbƒg‚̃AƒNƒ^[‚ɃXƒLƒ‹‚ÌŽg—pŒø‰Ê‚ð“K—p
target = $game_party.actors[$scene.status_window.index + 10]
used = target.skill_effect(@actor, @skill)
end
# ƒ^[ƒQƒbƒg‚ª’P‘Ì‚Ìê‡
if $scene.status_window.index >= 0
# ƒ^[ƒQƒbƒg‚̃AƒNƒ^[‚ɃXƒLƒ‹‚ÌŽg—pŒø‰Ê‚ð“K—p
target = $game_party.actors[$scene.status_window.index]
used = target.skill_effect(@actor, @skill)
end
# ƒXƒLƒ‹‚ðŽg‚Á‚½ê‡
if used
# ƒXƒLƒ‹‚ÌŽg—pŽž SE ‚ð‰‰‘t
$game_system.se_play(@skill.menu_se)
# SP Á”ï
@actor.sp -= @skill.sp_cost
# ŠeƒEƒBƒ“ƒhƒE‚Ì“à—e‚ðÄì¬
@status_window.refresh
@skill_window.refresh
$scene.status_window.refresh
# ‘S–Å‚Ìê‡
if $game_party.all_dead?
# ƒQ[ƒ€ƒI[ƒo[‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene = Scene_Gameover.new
return
end
# ƒRƒ‚ƒ“ƒCƒxƒ“ƒg ID ‚ª—LŒø‚Ìê‡
if @skill.common_event_id > 0
# ƒRƒ‚ƒ“ƒCƒxƒ“ƒgŒÄ‚Ño‚µ—\–ñ
$game_temp.common_event_id = @skill.common_event_id
# ƒ}ƒbƒv‰æ–Ê‚ÉØ‚è‘Ö‚¦
dispose
$scene = Scene_Map.new
return
end
end
# ƒXƒLƒ‹‚ðŽg‚í‚È‚
‚Á‚½ê‡
unless used
# ƒuƒU[ SE ‚ð‰‰‘t
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
end
#==============================================================================
# ¡ Window_Status
#------------------------------------------------------------------------------
# @ƒXƒe[ƒ^ƒX‰æ–Ê‚Å•\Ž¦‚·‚éAƒtƒ‹Žd—l‚̃Xƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚Å‚·B
#==============================================================================
class Window_Status < Window_Base
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
# actor : ƒAƒNƒ^[
#--------------------------------------------------------------------------
def initialize(actor)
super(20, 40, 600, 400)
self.z = 6110
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 192
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# œ ƒŠƒtƒŒƒbƒVƒ…
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_graphic(@actor, 44, 96)
draw_actor_battler(@actor, 426, 368)
draw_actor_name(@actor, 24, 0)
draw_actor_class(@actor, 24 + 144, 0)
draw_actor_level(@actor, 320, 16)
draw_actor_state(@actor, 320, 48)
draw_actor_hp(@actor, 68, 32, 172)
draw_actor_sp(@actor, 68, 64, 172)
draw_actor_parameter(@actor, 68, 112, 0)
draw_actor_parameter(@actor, 68, 144, 1)
draw_actor_parameter(@actor, 68, 176, 2)
draw_actor_parameter(@actor, 68, 224, 3)
draw_actor_parameter(@actor, 68, 256, 4)
draw_actor_parameter(@actor, 68, 288, 5)
draw_actor_parameter(@actor, 68, 320, 6)
self.contents.font.color = system_color
self.contents.draw_text(304, 96, 80, 32, "EXP")
self.contents.draw_text(304, 128, 80, 32, "NEXT")
self.contents.font.color = normal_color
self.contents.draw_text(304 + 80, 96, 84, 32, @actor.exp_s, 2)
self.contents.draw_text(304 + 80, 128, 84, 32, @actor.next_rest_exp_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(304, 176, 96, 32, "‘•”õ")
draw_item_name($data_weapons[@actor.weapon_id], 304 + 16, 208)
draw_item_name($data_armors[@actor.armor1_id], 304 + 16, 240)
draw_item_name($data_armors[@actor.armor2_id], 304 + 16, 272)
draw_item_name($data_armors[@actor.armor3_id], 304 + 16, 304)
draw_item_name($data_armors[@actor.armor4_id], 304 + 16, 336)
end
end
#==============================================================================
# ¡ Scene_Status
#------------------------------------------------------------------------------
# @ƒXƒe[ƒ^ƒX‰æ–ʂ̈—‚ðs‚¤ƒNƒ‰ƒX‚Å‚·B
#==============================================================================
class Scene_Status
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
# actor_index : ƒAƒNƒ^[ƒCƒ“ƒfƒbƒNƒX
#--------------------------------------------------------------------------
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
# ƒAƒNƒ^[‚ðŽæ“¾
@actor = $game_party.actors[@actor_index]
# ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðì¬
@status_window = Window_Status.new(@actor)
$scene.command_window.active = false
$scene.status_window.active = false
end
#--------------------------------------------------------------------------
# œ ‰ð•ú
#--------------------------------------------------------------------------
def dispose
# ƒEƒBƒ“ƒhƒE‚ð‰ð•ú
@status_window.dispose
$scene.menu = nil
$scene.status_window.index = -1
$scene.command_window.active = true
end
#--------------------------------------------------------------------------
# œ ƒtƒŒ[ƒ€XV
#--------------------------------------------------------------------------
def update
# B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::B)
# ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cancel_se)
# ƒƒjƒ…[‰æ–Ê‚ÉØ‚è‘Ö‚¦
dispose
return
end
# R ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::RIGHT) or Input.trigger?(Input::R)
# ƒJ[ƒ\ƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cursor_se)
# ŽŸ‚̃AƒNƒ^[‚Ö
@actor_index += 1
@actor_index %= $game_party.actors.size
@actor = $game_party.actors[@actor_index]
dispose
# •Ê‚̃Xƒe[ƒ^ƒX‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene.status_window.index = @actor.index
$scene.menu = Scene_Status.new(@actor.index)
return
end
# L ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡
if Input.trigger?(Input::LEFT) or Input.trigger?(Input::L)
# ƒJ[ƒ\ƒ‹ SE ‚ð‰‰‘t
$game_system.se_play($data_system.cursor_se)
# ‘O‚̃AƒNƒ^[‚Ö
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
@actor = $game_party.actors[@actor_index]
dispose
# •Ê‚̃Xƒe[ƒ^ƒX‰æ–Ê‚ÉØ‚è‘Ö‚¦
$scene.status_window.index = @actor.index
$scene.menu = Scene_Status.new(@actor.index)
return
end
end
end
#==============================================================================
# ¡ Window_EquipLeft
#------------------------------------------------------------------------------
# @‘•”õ‰æ–Ê‚ÅAƒAƒNƒ^[‚̃pƒ‰ƒ[ƒ^•Ï‰»‚ð•\Ž¦‚·‚éƒEƒBƒ“ƒhƒE‚Å‚·B
#==============================================================================
class Window_EquipLeft < Window_Base
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
# actor : ƒAƒNƒ^[
#--------------------------------------------------------------------------
def initialize(actor)
super(20, 106, 264, 192)
self.z = 6110
self.back_opacity = 192
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# œ ƒŠƒtƒŒƒbƒVƒ…
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_graphic(@actor, 28, 64)
draw_actor_name(@actor, 52, 0)
draw_actor_level(@actor, 68, 32)
draw_actor_parameter(@actor, 4, 64, 0)
draw_actor_parameter(@actor, 4, 96, 1)
draw_actor_parameter(@actor, 4, 128, 2)
if @new_atk != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 64, 40, 32, "¨", 1)
self.contents.font.color = normal_color
self.contents.draw_text(192, 64, 36, 32, @new_atk.to_s, 2)
end
if @new_pdef != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 96, 40, 32, "¨", 1)
self.contents.font.color = normal_color
self.contents.draw_text(192, 96, 36, 32, @new_pdef.to_s, 2)
end
if @new_mdef != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 128, 40, 32, "¨", 1)
self.contents.font.color = normal_color
self.contents.draw_text(192, 128, 36, 32, @new_mdef.to_s, 2)
end
end
end
#==============================================================================
# ¡ Window_EquipRight
#------------------------------------------------------------------------------
# @‘•”õ‰æ–Ê‚ÅAƒAƒNƒ^[‚ªŒ»Ý‘•”õ‚µ‚Ä‚¢‚éƒAƒCƒeƒ€‚ð•\Ž¦‚·‚éƒEƒBƒ“ƒhƒE‚Å‚·B
#==============================================================================
class Window_EquipRight < Window_Selectable
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
# actor : ƒAƒNƒ^[
#--------------------------------------------------------------------------
def initialize(actor)
super(284, 106, 336, 192)
self.z = 6110
self.back_opacity = 192
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# œ ƒŠƒtƒŒƒbƒVƒ…
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@data = []
@data.push($data_weapons[@actor.weapon_id])
@data.push($data_armors[@actor.armor1_id])
@data.push($data_armors[@actor.armor2_id])
@data.push($data_armors[@actor.armor3_id])
@data.push($data_armors[@actor.armor4_id])
@item_max = @data.size
self.contents.font.color = system_color
self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
self.contents.draw_text(5, 32 * 4, 92, 32, $data_system.words.armor4)
draw_item_name(@data[0], 92, 32 * 0, 202)
draw_item_name(@data[1], 92, 32 * 1, 202)
draw_item_name(@data[2], 92, 32 * 2, 202)
draw_item_name(@data[3], 92, 32 * 3, 202)
draw_item_name(@data[4], 92, 32 * 4, 202)
end
end
#==============================================================================
# ¡ Window_EquipItem
#------------------------------------------------------------------------------
# @‘•”õ‰æ–Ê‚ÅA‘•”õ•ÏX‚ÌŒó•â‚Æ‚È‚éƒAƒCƒeƒ€‚̈ꗗ‚ð•\Ž¦‚·‚éƒEƒBƒ“ƒhƒE‚Å‚·B
#==============================================================================
class Window_EquipItem < Window_Selectable
#--------------------------------------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šú‰»
# actor : ƒAƒNƒ^[
# equip_type : ‘•”õ•”ˆÊ (0`3)
#--------------------------------------------------------------------------
def initialize(actor, equip_type)
super(20, 298, 600, 128)
self.z = 6110
self.back_opacity = 192
@actor = actor
@equip_type = equip_type
@column_max = 2
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# œ €–Ú‚Ì•`‰æ
# index : €–Ú”Ô†
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
x = 4 + index % 2 * 281
y = index / 2 * 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, 208, 32, item.name, 0)
self.contents.draw_text(x + 236, y, 16, 32, ":", 1)
self.contents.draw_text(x + 252, y, 24, 32, number.to_s, 2)
end
#--------------------------------------------------------------------------
# œ ƒJ[ƒ\ƒ‹‚Ì‹éŒ`XV
#--------------------------------------------------------------------------