~Site
Accueil
Forum
Admin

~Base de scripts
Scripts de base
Scripts Menu
Scripts Combat
Scripts Systθme
Scripts Modifiιs

Scripts de Base
Game_Temp
Game_System
Game_Switches
Game_Variables
Game_SelfSwitches
Game_Screen
Game_Picture
Game_Battler 1
Game_Battler 2
Game_Battler 3
Game_BattleAction
Game_Actor
Game_Enemy
Game_Actors
Game_Party
Game_Troop
Game_Map
Game_CommonEvent
Game_Character 1
Game_Character 2
Game_Character 3
Game_Event
Game_Player
Sprite_Character
Sprite_Battler
Sprite_Picture
Sprite_Timer
Spriteset_Map
Spriteset_Battle
Window_Base
Window_Selectable
Window_Command
Window_Help
Window_Gold
Window_PlayTime
Window_Steps
Window_MenuStatus
Window_Item
Window_Skill
Window_SkillStatus
Window_Target
Window_EquipLeft
Window_EquipRight
Window_EquipItem
Window_Status
Window_SaveFile
Window_ShopCommand
Window_ShopBuy
Window_ShopSell
Window_ShopNumber
Window_ShopStatus
Window_NameEdit
Window_NameInput
Window_InputNumber
Window_Message
Window_PartyCommand
Window_BattleStatus
Window_BattleResult
Window_DebugLeft
Window_DebugRight
Window_Dataset
Arrow_Base
Arrow_Enemy
Arrow_Actor
Interpreter 1
Interpreter 2
Interpreter 3
Interpreter 4
Interpreter 5
Interpreter 6
Interpreter 7
Scene_Title
Scene_Map
Scene_Menu
Scene_Item
Scene_Skill
Scene_Equip
Scene_Status
Scene_File
Scene_Save
Scene_Load
Scene_End
Scene_Battle 1
Scene_Battle 2
Scene_Battle 3
Scene_Battle 4
Scene_Shop
Scene_Name
Scene_Gameover
Scene_Debug
Main


Scene_Equip ::: postι le 2006-02-16 @ 10:23:00
Auteur: Yukihiro matsumoto

#============================================
# ‘ Scene_Equip
#----------------------------------------------
# @‘•”υ‰ζ–ʂ̏ˆ—‚πs‚€ƒNƒ‰ƒX‚Ε‚·B
#============================================

class Scene_Equip
#------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šϊ‰»
# actor_index : ƒAƒNƒ^[ƒCƒ“ƒfƒbƒNƒX
# equip_index : ‘•”υƒCƒ“ƒfƒbƒNƒX
#------------------------------------------
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
@equip_index = equip_index
end
#------------------------------------------
# œ ƒƒCƒ“ˆ—
#------------------------------------------
def main
# ƒAƒNƒ^[‚πŽζ“Ύ
@actor = $game_party.actors[@actor_index]
# ƒEƒBƒ“ƒhƒE‚πμ¬
@help_window = Window_Help.new
@left_window = Window_EquipLeft.new(@actor)
@right_window = Window_EquipRight.new(@actor)
@item_window1 = Window_EquipItem.new(@actor, 0)
@item_window2 = Window_EquipItem.new(@actor, 1)
@item_window3 = Window_EquipItem.new(@actor, 2)
@item_window4 = Window_EquipItem.new(@actor, 3)
@item_window5 = Window_EquipItem.new(@actor, 4)
# ƒwƒ‹ƒvƒEƒBƒ“ƒhƒE‚πŠΦ˜A•t‚―
@right_window.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
# ƒJ[ƒƒ‹ˆΚ’u‚πέ’θ
@right_window.index = @equip_index
refresh
# ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“Žΐs
Graphics.transition
# ƒƒCƒ“ƒ‹[ƒv
loop do
# ƒQ[ƒ€‰ζ–Κ‚πXV
Graphics.update
# “ό—͏ξ•ρ‚πXV
Input.update
# ƒtƒŒ[ƒ€XV
update
# ‰ζ–Κ‚ͺΨ‚θ‘Φ‚ν‚Α‚½‚烋[ƒv‚π’†’f
if $scene != self
break
end
end
# ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“€”υ
Graphics.freeze
# ƒEƒBƒ“ƒhƒE‚π‰π•ϊ
@help_window.dispose
@left_window.dispose
@right_window.dispose
@item_window1.dispose
@item_window2.dispose
@item_window3.dispose
@item_window4.dispose
@item_window5.dispose
end
#------------------------------------------
# œ ƒŠƒtƒŒƒbƒVƒ…
#------------------------------------------
def refresh
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚Μ‰ΒŽ‹σ‘Ԑݒθ
@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)
# Œ»έ‘•”υ’†‚ΜƒAƒCƒeƒ€‚πŽζ“Ύ
item1 = @right_window.item
# Œ»έ‚ΜƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚π @item_window ‚ɐݒθ
case @right_window.index
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
# ƒ‰ƒCƒgƒEƒBƒ“ƒhƒE‚ͺƒAƒNƒeƒBƒu‚̏ꍇ
if @right_window.active
# ‘•”υ•ύXŒγ‚Μƒpƒ‰ƒ[ƒ^‚πΑ‹Ž
@left_window.set_new_parameters(nil, nil, nil)
end
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚ͺƒAƒNƒeƒBƒu‚̏ꍇ
if @item_window.active
# Œ»έ‘I‘𒆂̃AƒCƒeƒ€‚πŽζ“Ύ
item2 = @item_window.item
# ‘•”υ‚π•ύX
last_hp = @actor.hp
last_sp = @actor.sp
@actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)
# ‘•”υ•ύXŒγ‚Μƒpƒ‰ƒ[ƒ^‚πŽζ“Ύ
new_atk = @actor.atk
new_pdef = @actor.pdef
new_mdef = @actor.mdef
# ‘•”υ‚π–ί‚·
@actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
@actor.hp = last_hp
@actor.sp = last_sp
# ƒŒƒtƒgƒEƒBƒ“ƒhƒE‚Ι•`‰ζ
@left_window.set_new_parameters(new_atk, new_pdef, new_mdef)
end
end
#------------------------------------------
# œ ƒtƒŒ[ƒ€XV
#------------------------------------------
def update
# ƒEƒBƒ“ƒhƒE‚πXV
@left_window.update
@right_window.update
@item_window.update
refresh
# ƒ‰ƒCƒgƒEƒBƒ“ƒhƒE‚ͺƒAƒNƒeƒBƒu‚̏ꍇ: update_right ‚πŒΔ‚Τ
if @right_window.active
update_right
return
end
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚ͺƒAƒNƒeƒBƒu‚̏ꍇ: update_item ‚πŒΔ‚Τ
if @item_window.active
update_item
return
end
end
#------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒ‰ƒCƒgƒEƒBƒ“ƒhƒE‚ͺƒAƒNƒeƒBƒu‚̏ꍇ)
#------------------------------------------
def update_right
# B ƒ{ƒ^ƒ“‚ͺ‰Ÿ‚³‚κ‚½κ‡
if Input.trigger?(Input::B)
# ƒLƒƒƒ“ƒZƒ‹ SE ‚π‰‰‘t
$game_system.se_play($data_system.cancel_se)
# ƒƒjƒ…[‰ζ–ʂɐ؂θ‘Φ‚¦
$scene = Scene_Menu.new(2)
return
end
# C ƒ{ƒ^ƒ“‚ͺ‰Ÿ‚³‚κ‚½κ‡
if Input.trigger?(Input::C)
# ‘•”υŒΕ’θ‚̏ꍇ
if @actor.equip_fix?(@right_window.index)
# ƒuƒU[ SE ‚π‰‰‘t
$game_system.se_play($data_system.buzzer_se)
return
end
# Œˆ’θ SE ‚π‰‰‘t
$game_system.se_play($data_system.decision_se)
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚πƒAƒNƒeƒBƒu‰»
@right_window.active = false
@item_window.active = true
@item_window.index = 0
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
# •Κ‚Μ‘•”υ‰ζ–ʂɐ؂θ‘Φ‚¦
$scene = Scene_Equip.new(@actor_index, @right_window.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
# •Κ‚Μ‘•”υ‰ζ–ʂɐ؂θ‘Φ‚¦
$scene = Scene_Equip.new(@actor_index, @right_window.index)
return
end
end
#------------------------------------------
# œ ƒtƒŒ[ƒ€XV (ƒ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)
# ƒ‰ƒCƒgƒEƒBƒ“ƒhƒE‚πƒAƒNƒeƒBƒu‰»
@right_window.active = true
@item_window.active = false
@item_window.index = -1
return
end
# C ƒ{ƒ^ƒ“‚ͺ‰Ÿ‚³‚κ‚½κ‡
if Input.trigger?(Input::C)
# ‘•”υ SE ‚π‰‰‘t
$game_system.se_play($data_system.equip_se)
# ƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚ΕŒ»έ‘I‘π‚³‚κ‚Δ‚’‚ιƒf[ƒ^‚πŽζ“Ύ
item = @item_window.item
# ‘•”υ‚π•ύX
@actor.equip(@right_window.index, item == nil ? 0 : item.id)
# ƒ‰ƒCƒgƒEƒBƒ“ƒhƒE‚πƒAƒNƒeƒBƒu‰»
@right_window.active = true
@item_window.active = false
@item_window.index = -1
# ƒ‰ƒCƒgƒEƒBƒ“ƒhƒEAƒAƒCƒeƒ€ƒEƒBƒ“ƒhƒE‚Μ“ΰ—e‚πΔμ¬
@right_window.refresh
@item_window.refresh
return
end
end
end
Design By RaZ © Watery Build 2005