Pomógł: 1 raz Dołączył: 20 Sie 2012 Posty: 51 Skąd: Włocławek
Wysłany: Sro 29 Sie, 2012 05:02
Lune Frontal Battle System
~ Lune Frontal Battle System ~
Krótki opis:
Świetny system walki, przeznaczony dla początkujących (Prawie nie trzeba edytować )
Ja osobiście uważam ten system za użyteczny i prawdopodobnie będę go używał w nadchodzącym projekcie(o nie, nie... projekt to TAJEMNICA )
Autor:
Raizen
Tłumaczenie:
Saskio
Kompatybilność:
RPG Maker VX Ace
Skrypt:
Spoiler:
Kod:
#=======================================================
# Lune Frontal Battle System
# Autor: Raizen
# Tłumaczenie: Saskio
# Specjalnie dla Ultimateam.pl
# Kompatybilne z: RMVXAce
#=======================================================
# Instrukcja:
# Plug n' play, wklej skrypt nad 'Main' w edytorze skryptów.
#=======================================================
# Konfiguracja
module Lune_Frontal_Battle
# Grafiki nieżywych bohaterów.
# Aby dodać nowe postacie, po prostu przepisz kod:
# DeadG[1] = "Monster1", Numerek jeden oznacza ID bohatera, a "Monster1" to
# grafika nieżywej postaci.
# Umiejętności na bliski dystans, pamiętaj: ID_1 jest normalnym atakiem,
# i to będzie uważane jako normalny atak.
Dist = [1, 3, 4, 10, 21, 80, 81, 85, 100]
# Bronie dystansowe
# Pamiętaj, te numerki to są ID KLASY, nie ID BRONI!!!
Weapdist = [6, 10]
# ID Animacji Użycia (np. potiona)
Castid = 43
# Czas animacji.
Casttime = 20
end
#==============================================================================
# ================== Nie edytuj dalej, chyba, że wiesz co robisz! ===========
#==============================================================================
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# Esta classe executa o processamento da tela de batalha.
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# * Aliasing
#--------------------------------------------------------------------------
alias lune_front_update update_basic
alias lune_front_start start
alias lune_front_start_actor_command start_actor_command_selection
alias lune_front_dispose dispose_spriteset
#--------------------------------------------------------------------------
# * Inicialização do processo
#--------------------------------------------------------------------------
def start
create_battlers
lune_front_start
end
#--------------------------------------------------------------------------
# * Atualização das tropas
#--------------------------------------------------------------------------
def update_basic
update_move_troops
lune_front_update
end
def move_actors_back(n)
for y in 0...$game_party.members.size
unless y == n
@bitmap[y].y += 2 if @bitmap[y].y <= 248
@distance_in_x = @bitmap[y].x - (100 + $game_party.members[y].index*110)
@bitmap[y].x -= @distance_in_x / 15
end
character_name = $game_party.members[y].character_name
if $game_party.members[y].dead?
@index[y] = 0
@bitmap[y].bitmap = Cache.character(Lune_Frontal_Battle::DeadG[$game_party.members[y].id]) if @bitmap[y].bitmap != Cache.character(Lune_Frontal_Battle::DeadG[$game_party.members[y].id])
else
@index[y] = $game_party.members[y].character_index
@bitmap[y].bitmap = Cache.character(character_name) if @bitmap[y].bitmap != Cache.character(character_name)
end
@pattern[y] = (@bitmap[y].y % 24) / 8
sx = (@index[y] % 4 * 3 + @pattern[y]) * @cw[y]
sy = (@index[y] / 4 * 4 + 6 / 2) * @ch[y]
@bitmap[y].src_rect.set(sx, sy, @cw[y], @ch[y])
@bitmap[y].opacity += 4 unless @bitmap[y].opacity >= 255
end
end
#--------------------------------------------------------------------------
# * Atualização dos movimentos dos personagens
#--------------------------------------------------------------------------
def update_move_troops
@startmove = nil if @party_command_window.active
pattern = 0
move_actors_front(@startmove, @target)
move_actors_back(@startmove)
end
#--------------------------------------------------------------------------
# * atualização do indice.
#--------------------------------------------------------------------------
def start_actor_command_selection
@startmove = BattleManager.actor.index
lune_front_start_actor_command
end
def dispose_spriteset
lune_front_dispose
for y in 0...$game_party.members.size
@bitmap[y].dispose
end
end
#--------------------------------------------------------------------------
# * atualização do indice no processamento.
#--------------------------------------------------------------------------
def process_action
return if scene_changing?
if !@subject || !@subject.current_action
@subject = BattleManager.next_subject
if @subject
@subject.actor? ? @startmove = @subject.index : @startmove = nil
end
end
return turn_end unless @subject
if @subject.current_action
@subject.current_action.prepare
if @subject.current_action.valid?
@status_window.open
execute_action
end
@subject.remove_current_action
end
process_action_end unless @subject.current_action
end
#--------------------------------------------------------------------------
# * animações de ataque
#--------------------------------------------------------------------------
def show_attack_animation(targets)
if @subject.actor?
show_normal_animation(targets, @subject.atk_animation_id1, false)
show_normal_animation(targets, @subject.atk_animation_id2, true)
else
show_monster_animation(targets, @subject.atk_animation_id1, false)
abs_wait_short
end
end
#--------------------------------------------------------------------------
# * Exibição da animação normal
# targets : lista dos alvos
# animation_id : ID da animação
# mirror : inversão
#--------------------------------------------------------------------------
def show_monster_animation(targets, animation_id, mirror = false)
animation_id = 1 if animation_id.nil?
animation = $data_animations[animation_id]
if animation
targets.each do |target|
@bitmap[target.index].opacity = 0
target.animation_id = animation_id
target.animation_mirror = mirror
abs_wait_short unless animation.to_screen?
end
abs_wait_short if animation.to_screen?
end
end
def show_normal_animation(targets, animation_id, mirror = false)
animation = $data_animations[animation_id]
if animation
onecast = true
targets.each do |target|
@target = target unless from_distance?
if !Lune_Frontal_Battle::Nocast.include?(@subject.current_action.item.id) and onecast
abs_wait(Lune_Frontal_Battle::Casttime)
@subject.animation_id = Lune_Frontal_Battle::Castid
onecast = false
abs_wait(30)
end
@bitmap[target.index].opacity = 0 if target.actor?
target.animation_id = animation_id
target.animation_mirror = mirror
abs_wait_short unless animation.to_screen?
end
abs_wait_short if animation.to_screen?
end
@target = nil
end
#--------------------------------------------------------------------------
# * verificação de ataque a distancia
#--------------------------------------------------------------------------
def from_distance?
return true unless @subject.actor?
return true if !Lune_Frontal_Battle::Dist.include?(@subject.current_action.item.id) and @subject.current_action.item.id != 1
return true if Lune_Frontal_Battle::Weapdist.include?(@subject.weapon_type)
return false
end
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# Esta classe gerencia os heróis. Ela é utilizada internamente pela classe
# Game_Actors ($game_actors). A instância desta classe é referenciada
# pela classe Game_Party ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Aliasing
#--------------------------------------------------------------------------
alias lune_frontal_initialize initialize
#--------------------------------------------------------------------------
# * Variáveis públicas
#--------------------------------------------------------------------------
attr_accessor :screen_x # posição x na tela do battler
attr_accessor :screen_y # posição y na tela do battler
attr_accessor :screen_z # posição z na tela do battler
#--------------------------------------------------------------------------
# * Inicialização do objeto
# actor_id : ID do herói
#--------------------------------------------------------------------------
def initialize(actor_id)
lune_frontal_initialize(actor_id)
@screen_x = 0
@screen_y = 0
@screen_z = 0
end
def weapon_type
weapons.any? {|weapon| return weapon.wtype_id }
end
def use_sprite?
return true
end
end
class Game_Enemy < Game_Battler
def atk_animation_id1
end
end
Screeny:
Spoiler:
Dodatkowe informacje: Instrukcja:
1.Wklej skrypt nad 'Main' w edytorze skryptów.
Skrypt nie potrzebuje żadnych dodatkowych grafik!
________________________ Praca uszlachetnia, lenistwo uszczęśliwia.
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