Pomógł: 16 razy Dołączył: 05 Lis 2009 Posty: 359 Skąd: spytaj innych
Wysłany: Czw 01 Lip, 2010 07:36
Potwierdzenie komend walki
Przed atakiem bohaterów jest przegląd ich działań. Można wznowić turę. Skrypt jest sprawdzony i działa z Ring Menu podczas walki.
Oto on:
Spoiler:
Kod:
#===============================================================================
# Battle Action Confirmation v1.2
# by Deriru
# dla ultimaforum.pl - przesłał pakitos
# PLEASE GIVE CREDIT IF USED!
#
#-------------------------------------------------------------------------------
# What this script does:
# -It adds a confirmation window where you finalize your decision on your
# battler's actions. Their given actions are also displayed at the window.
#-------------------------------------------------------------------------------
# History:
#
# v1.2: Added Dead Action (if character is Incapacitated)
#
# v1.1: Added Auto Action (if character is Auto Battle)
#
# v1.0: Initial release
#-------------------------------------------------------------------------------
# Setup Options:
# NOTHING: Sets the action label if there is no action that cannot be done.
# CONFASK: The text displayed at the confirmation window.
# ALIGN: Alignment of the text. (0 = left, 1 = center, 2 = right)
# WIDTH: The width of the window.
#-------------------------------------------------------------------------------
# Setup Start!
#-------------------------------------------------------------------------------
module Deriru
module ActConf
AUTO = "Automatycznie"
DEAD = "Leżę"
NOTHING = "Brak"
CONFASK = "Wykonać rozkazy?"
ALIGN = 1
WIDTH = 300
end
end
#-------------------------------------------------------------------------------
# Setup End!
# DO NOT TOUCH THE PARTS BELOW IF YOU DON'T KNOW WHAT YOU'RE DOING!
#===============================================================================
class Game_Party < Game_Unit
def everyone_auto?
auto = true
for actor in members
auto = false unless actor.auto_battle
end
return auto
end
def refresh
self.contents.clear
self.contents.draw_text(0,0, self.width - 32, WLH, Deriru::ActConf::CONFASK, Deriru::ActConf::ALIGN)
for i in 0..$game_party.members.size - 1 do
self.contents.draw_text(0, WLH * (i + 1), self.width - 32, WLH, @actions[i], Deriru::ActConf::ALIGN)
end
end
#--------------------------------------------------------------------------
# * Go to Command Input for Next Actor (override)
#--------------------------------------------------------------------------
def next_actor
loop do
if @actor_index == $game_party.members.size-1
ask_confirmation
return
end
@status_window.index = @actor_index += 1
@active_battler = $game_party.members[@actor_index]
if @active_battler.auto_battle
@active_battler.make_action
next
end
break if @active_battler.inputable?
end
start_actor_command_selection
end
def update_confirmation_selection
@infoconfirm.update
if Input.trigger?(Input::B)
Sound.play_cancel
end_confirmation
@status_window.index = @actor_index = 0
unless $game_party.everyone_auto?
for i in $game_party.members do
if i.auto_battle
@status_window.index = @actor_index += 1
@active_battler = $game_party.members[@actor_index]
else
break
end
end
start_actor_command_selection
else
@active_battler = $game_party.members.first
start_party_command_selection
end
elsif Input.trigger?(Input::C)
if @infoconfirm.index == 0
Sound.play_decision
end_confirmation
start_main
else
Sound.play_decision
end_confirmation
@status_window.index = @actor_index = 0
unless $game_party.everyone_auto?
for i in $game_party.members do
if i.auto_battle
@status_window.index = @actor_index += 1
@active_battler = $game_party.members[@actor_index]
else
break
end
end
start_actor_command_selection
else
@active_battler = $game_party.members.first
start_party_command_selection
end
end
end
end
#--------------------------------------------------------------------------
# * Frame Update (override)
#--------------------------------------------------------------------------
def update
super
update_basic(true)
update_info_viewport # Update information viewport
if $game_message.visible
@info_viewport.visible = false
@message_window.visible = true
end
unless $game_message.visible # Unless displaying a message
return if judge_win_loss # Determine win/loss results
update_scene_change
#======== added if statement ====
if @infoconfirm.active == true
update_confirmation_selection
#================================
elsif @target_enemy_window != nil
update_target_enemy_selection # Select target enemy
elsif @target_actor_window != nil
update_target_actor_selection # Select target actor
elsif @skill_window != nil
update_skill_selection # Select skill
elsif @item_window != nil
update_item_selection # Select item
elsif @party_command_window.active
update_party_command_selection # Select party command
elsif @actor_command_window.active
update_actor_command_selection # Select actor command
else
process_battle_event # Battle event processing
process_action # Battle action
process_battle_event # Battle event processing
end
end
end
end
________________________ po co to kopiujesz? ;d
Spoiler:
Fakty:
1.Widzisz mój podpis
2.Jesteś w internecie
3.Czytasz
4.Siedzisz przy komputerze
5.Jesteś na UltimaForum
6.Twój nick to Gość
kiedys tu bylo fajniej... coz gospoda rma forever
chwala tym ktorzy nadal robia w 2k
bardzo fajny skrypt - szczególnie cieszy mnie iż działa z ring menu gdyż właśnie tego systemu walki używam w swojej gierce
a screena nie trudno sobie wyobrazić - po wykonaniu akcji pojawia się pytanie czy wykonać np atak przez xxx na yyy gdzie xxx to postać którą owy atak wykonujemy, a yyy to cel danej postaci! (oczywiście w grze nie pisze "xxx" czy "yyy" tylko nazwa danej postaci )
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach Nie możesz załączać plików na tym forum Możesz ściągać załączniki na tym forum