~Site
Accueil
Forum
Admin

~Base de scripts
Scripts de base
Scripts Menu
Scripts Combat
Scripts Systme
Scripts Modifis

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_Battle 4 ::: post le 2006-02-16 @ 10:27:00
Auteur: Yukihiro matsumoto

#============================================
# Scene_Battle (ָx 4)
#----------------------------------------------
# Хȥ뻭΄IФ饹Ǥ
#============================================

class Scene_Battle
#------------------------------------------
# ᥤե`_ʼ
#------------------------------------------
def start_phase4
# ե` 4
@phase = 4
# `
$game_temp.battle_turn += 1
# Хȥ륤٥Ȥȫک`
for index in 0...$data_troops[@troop_id].pages.size
# ٥ȥک`ȡ
page = $data_troops[@troop_id].pages[index]
# Υک`Υѥ [`] Έ
if page.span == 1
# gМgߥե饰򥯥ꥢ
$game_temp.battle_event_flags[index] = false
end
end
# `xk״BO
@actor_index = -1
@active_battler = nil
# ѩ`ƥޥɥɥЄ
@party_command_window.active = false
@party_command_window.visible = false
# `ޥɥɥo
@actor_command_window.active = false
@actor_command_window.visible = false
# ᥤե`ե饰򥻥å
$game_temp.battle_main_phase = true
# ͥߩ`
for enemy in $game_troop.enemies
enemy.make_action
end
# Є
make_action_orders
# ƥå 1
@phase4_step = 1
end
#------------------------------------------
# Є
#------------------------------------------
def make_action_orders
# @action_battlers ڻ
@action_battlers = []
# ͥߩ` @action_battlers ׷
for enemy in $game_troop.enemies
@action_battlers.push(enemy)
end
# ` @action_battlers ׷
for actor in $game_party.actors
@action_battlers.push(actor)
end
# ȫTΥ󥹥ԩ`ɤQ
for battler in @action_battlers
battler.make_action_speed
end
# 󥹥ԩ`ɤδ󤭤혤ˁK椨
@action_battlers.sort! {|a,b|
b.current_action.speed - a.current_action.speed }
end
#------------------------------------------
# ե` (ᥤե`)
#------------------------------------------
def update_phase4
case @phase4_step
when 1
update_phase4_step1
when 2
update_phase4_step2
when 3
update_phase4_step3
when 4
update_phase4_step4
when 5
update_phase4_step5
when 6
update_phase4_step6
end
end
#------------------------------------------
# ե` (ᥤե` ƥå 1 : ʂ)
#------------------------------------------
def update_phase4_step1
# إץɥL
@help_window.visible = false
# ٔж
if judge
# ޤϔΈ : ᥽åɽK
return
end
# ƤƤХȥ`ڤʤ
if $game_temp.forcing_battler == nil
# Хȥ륤٥Ȥ򥻥åȥå
setup_battle_event
# Хȥ륤٥ȌgФΈ
if $game_system.battle_interpreter.running?
return
end
end
# ƤƤХȥ`ڤ
if $game_temp.forcing_battler != nil
# ^׷ӤޤƄ
@action_battlers.delete($game_temp.forcing_battler)
@action_battlers.unshift($game_temp.forcing_battler)
end
# δЄӥХȥ`ڤʤ (ȫTЄӤ)
if @action_battlers.size == 0
# ѩ`ƥޥɥե`_ʼ
start_phase2
return
end
# ˥` ID ӥ󥤥٥ ID ڻ
@animation1_id = 0
@animation2_id = 0
@common_event_id = 0
# δЄӥХȥ`Ф^饷ե
@active_battler = @action_battlers.shift
# ǤˑL⤵Ƥ
if @active_battler.index == nil
return
end
# åץ`
if @active_battler.hp > 0 and @active_battler.slip_damage?
@active_battler.slip_damage_effect
@active_battler.damage_pop = true
end
# Ʃ`Ȼ
@active_battler.remove_states_auto
# Ʃ`ɥեå
@status_window.refresh
# ƥå 2
@phase4_step = 2
end
#------------------------------------------
# ե` (ᥤե` ƥå 2 : _ʼ)
#------------------------------------------
def update_phase4_step2
# ƥǤʤ
unless @active_battler.current_action.forcing
# Ƽs [ͨĤ] [ζͨĤ] Έ
if @active_battler.restriction == 2 or @active_battler.restriction == 3
# ˹ĤO
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 0
end
# Ƽs [ЄӤǤʤ] Έ
if @active_battler.restriction == 4
# ƌΥХȥ`򥯥ꥢ
$game_temp.forcing_battler = nil
# ƥå 1
@phase4_step = 1
return
end
end
# Хȥ`򥯥ꥢ
@target_battlers = []
# ηNeǷ
case @active_battler.current_action.kind
when 0 #
make_basic_action_result
when 1 #
make_skill_action_result
when 2 # ƥ
make_item_action_result
end
# ƥå 3
if @phase4_step == 2
@phase4_step = 3
end
end
#------------------------------------------
# Y
#------------------------------------------
def make_basic_action_result
# ĤΈ
if @active_battler.current_action.basic == 0
# ˥` ID O
@animation1_id = @active_battler.animation1_id
@animation2_id = @active_battler.animation2_id
# ЄӂȥХȥ`ͥߩ`Έ
if @active_battler.is_a?(Game_Enemy)
if @active_battler.restriction == 3
target = $game_troop.random_target_enemy
elsif @active_battler.restriction == 2
target = $game_party.random_target_actor
else
index = @active_battler.current_action.target_index
target = $game_party.smooth_target_actor(index)
end
end
# ЄӂȥХȥ``Έ
if @active_battler.is_a?(Game_Actor)
if @active_battler.restriction == 3
target = $game_party.random_target_actor
elsif @active_battler.restriction == 2
target = $game_troop.random_target_enemy
else
index = @active_battler.current_action.target_index
target = $game_troop.smooth_target_enemy(index)
end
end
# ȥХȥ`ФO
@target_battlers = [target]
# ͨĤ΄m
for target in @target_battlers
target.attack_effect(@active_battler)
end
return
end
# Έ
if @active_battler.current_action.basic == 1
# إץɥ "" ʾ
@help_window.set_text($data_system.words.guard, 1)
return
end
# ӤΈ
if @active_battler.is_a?(Game_Enemy) and
@active_battler.current_action.basic == 2
# إץɥ "Ӥ" ʾ
@help_window.set_text("Escape", 1)
# Ӥ
@active_battler.escape
return
end
# Τ⤷ʤΈ
if @active_battler.current_action.basic == 3
# ƌΥХȥ`򥯥ꥢ
$game_temp.forcing_battler = nil
# ƥå 1
@phase4_step = 1
return
end
end
#------------------------------------------
# ޤϥƥΌȥХȥ`O
# scope : ޤϥƥ΄
#------------------------------------------
def set_target_battlers(scope)
# ЄӂȥХȥ`ͥߩ`Έ
if @active_battler.is_a?(Game_Enemy)
# Ƿ
case scope
when 1 # g
index = @active_battler.current_action.target_index
@target_battlers.push($game_party.smooth_target_actor(index))
when 2 # ȫ
for actor in $game_party.actors
if actor.exist?
@target_battlers.push(actor)
end
end
when 3 # ζg
index = @active_battler.current_action.target_index
@target_battlers.push($game_troop.smooth_target_enemy(index))
when 4 # ζȫ
for enemy in $game_troop.enemies
if enemy.exist?
@target_battlers.push(enemy)
end
end
when 5 # ζg (HP 0)
index = @active_battler.current_action.target_index
enemy = $game_troop.enemies[index]
if enemy != nil and enemy.hp0?
@target_battlers.push(enemy)
end
when 6 # ζȫ (HP 0)
for enemy in $game_troop.enemies
if enemy != nil and enemy.hp0?
@target_battlers.push(enemy)
end
end
when 7 # ʹ
@target_battlers.push(@active_battler)
end
end
# ЄӂȥХȥ``Έ
if @active_battler.is_a?(Game_Actor)
# Ƿ
case scope
when 1 # g
index = @active_battler.current_action.target_index
@target_battlers.push($game_troop.smooth_target_enemy(index))
when 2 # ȫ
for enemy in $game_troop.enemies
if enemy.exist?
@target_battlers.push(enemy)
end
end
when 3 # ζg
index = @active_battler.current_action.target_index
@target_battlers.push($game_party.smooth_target_actor(index))
when 4 # ζȫ
for actor in $game_party.actors
if actor.exist?
@target_battlers.push(actor)
end
end
when 5 # ζg (HP 0)
index = @active_battler.current_action.target_index
actor = $game_party.actors[index]
if actor != nil and actor.hp0?
@target_battlers.push(actor)
end
when 6 # ζȫ (HP 0)
for actor in $game_party.actors
if actor != nil and actor.hp0?
@target_battlers.push(actor)
end
end
when 7 # ʹ
@target_battlers.push(@active_battler)
end
end
end
#------------------------------------------
# 륢 Y
#------------------------------------------
def make_skill_action_result
# ȡ
@skill = $data_skills[@active_battler.current_action.skill_id]
# ƥǤʤ
unless @active_battler.current_action.forcing
# SP ФʤɤʹäǤʤʤä
unless @active_battler.skill_can_use?(@skill.id)
# ƌΥХȥ`򥯥ꥢ
$game_temp.forcing_battler = nil
# ƥå 1
@phase4_step = 1
return
end
end
# SP M
@active_battler.sp -= @skill.sp_cost
# Ʃ`ɥեå
@status_window.refresh
# إץɥ˥ʾ
@help_window.set_text(@skill.name, 1)
# ˥` ID O
@animation1_id = @skill.animation1_id
@animation2_id = @skill.animation2_id
# 󥤥٥ ID O
@common_event_id = @skill.common_event_id
# ȥХȥ`O
set_target_battlers(@skill.scope)
# ΄m
for target in @target_battlers
target.skill_effect(@active_battler, @skill)
end
end
#------------------------------------------
# ƥॢ Y
#------------------------------------------
def make_item_action_result
# ƥȡ
@item = $data_items[@active_battler.current_action.item_id]
# ƥФʤɤʹäǤʤʤä
unless $game_party.item_can_use?(@item.id)
# ƥå 1
@phase4_step = 1
return
end
# ƷΈ
if @item.consumable
# ʹäƥ 1 p餹
$game_party.lose_item(@item.id, 1)
end
# إץɥ˥ƥʾ
@help_window.set_text(@item.name, 1)
# ˥` ID O
@animation1_id = @item.animation1_id
@animation2_id = @item.animation2_id
# 󥤥٥ ID O
@common_event_id = @item.common_event_id
# Q
index = @active_battler.current_action.target_index
target = $game_party.smooth_target_actor(index)
# ȥХȥ`O
set_target_battlers(@item.scope)
# ƥ΄m
for target in @target_battlers
target.item_effect(@item)
end
end
#------------------------------------------
# ե` (ᥤե` ƥå 3 : Єӂȥ˥`)
#------------------------------------------
def update_phase4_step3
# Єӂȥ˥` (ID 0 ΈϤϰץեå)
if @animation1_id == 0
@active_battler.white_flash = true
else
@active_battler.animation_id = @animation1_id
@active_battler.animation_hit = true
end
# ƥå 4
@phase4_step = 4
end
#------------------------------------------
# ե` (ᥤե` ƥå 4 : ȥ˥`)
#------------------------------------------
def update_phase4_step4
# ȥ˥`
for target in @target_battlers
target.animation_id = @animation2_id
target.animation_hit = (target.damage != "Rat")
end
# ˥`Lˤ餺 8 ե`
@wait_count = 8
# ƥå 5
@phase4_step = 5
end
#------------------------------------------
# ե` (ᥤե` ƥå 5 : `ʾ)
#------------------------------------------
def update_phase4_step5
# إץɥL
@help_window.visible = false
# Ʃ`ɥեå
@status_window.refresh
# `ʾ
for target in @target_battlers
if target.damage != nil
target.damage_pop = true
end
end
# ƥå 6
@phase4_step = 6
end
#------------------------------------------
# ե` (ᥤե` ƥå 6 : եå)
#------------------------------------------
def update_phase4_step6
# ƌΥХȥ`򥯥ꥢ
$game_temp.forcing_battler = nil
# 󥤥٥ ID ЄΈ
if @common_event_id > 0
# ٥Ȥ򥻥åȥå
common_event = $data_common_events[@common_event_id]
$game_system.battle_interpreter.setup(common_event.list, 0)
end
# ƥå 1
@phase4_step = 1
end
end
Design By RaZ Watery Build 2005