Ogłoszenie 

Uwaga! To forum jest w trybie offline.
Wszelką pomoc uzyskasz pod adresem
forum.ultimateam.pl


Administracja Forum


Poprzedni temat «» Następny temat
Powtarzanie Przegranej Walki
Autor Wiadomość
The Big Master 




Preferowany:
RPG Maker XP

Pomógł: 6 razy
Dołączył: 19 Gru 2012
Posty: 81
Skąd: Masz taki nr. IQ ?
Wysłany: Sob 19 Sty, 2013 09:22
Powtarzanie Przegranej Walki
~ SG Battle Retry ~


Krótki opis:
Pozwala nam powtórzyć przegrana bitwę, powtórzenie jest dobrowolne.

Autor:
sandgolem

Kompatybilność:
RPG Maker XP

Skrypt:
Spoiler:

Kod:
#======================================================================
# ** SG Battle Retry
#==========================================================================
# Script feito por sandgolem
# Traduzido por Fael000 - Membro da Jogos RPG
#==========================================================================

module SG
BattleRetryCommands = ['Spróbuj Ponownie','Exit']
BattleRetryDisableSwitch = 14
end

#==========================================================================
# Este script permite que você quando perder uma batalha você possa
# reinicia-la, ou seja, tentar de novo.
#==========================================================================

if Object.const_defined?('SDK')
SDK.log('SG Battle Retry', 'sandgolem', 6, '15.01.08')
@sg_battleretry_disabled = true if !SDK.enabled?('SG Battle Retry')
end

if !@sg_battleretry_disabled
#--------------------------------------------------------------------------

class Interpreter
alias_method :sg_battleretry_interp601, :command_601
def command_601
if $sg_retrywon
@branch[@list[@index].indent] = 0
$sg_retrywon = nil
end
return sg_battleretry_interp601
end

alias_method :sg_battleretry_interp602, :command_602
def command_602
if $game_temp.battle_can_escape && $sg_retryescaped
@branch[@list[@index].indent] = 1
$sg_retryescaped = nil
end
return sg_battleretry_interp602
end
end

# class Game_System; attr_accessor :playing_bgm; end
class Game_Temp; attr_accessor :battle_music_playing; end

class Scene_Map
alias_method :sg_battleretry_callbattle, :call_battle
def call_battle
sg_battleretry_callbattle
$game_temp.battle_music_playing = $game_system.playing_bgm.clone
end
end

class Scene_Save < Scene_File
def sg_write_retrysave_data
file = File.open('Data/retry.sg', 'wb')
write_save_data(file)
file.close
end
end

class Scene_Load < Scene_File
def sg_read_retrysave_data
file = File.open('Data/retry.sg', 'rb')
read_save_data(file)
file.close
end
end

class Scene_Battle
alias_method :sg_battleretry_main, :main
def main
$sg_retryescaped = nil
$sg_retrywon = nil
if !$game_switches[SG::BattleRetryDisableSwitch]
if !$sg_battleretry_inbattle && !$game_temp.battle_can_lose
$sg_battleretry_inbattle = $game_temp
sg_scene_save_temp = Scene_Save.new
sg_scene_save_temp.sg_write_retrysave_data
end
end
sg_battleretry_main
if !$scene.is_a?(Scene_Gameover)
File.delete('Data/retry.sg') if FileTest.exist?('Data/retry.sg')
$sg_battleretry_inbattle = nil
end
end

alias_method :sg_battleretry_battleend, :battle_end
def battle_end(result)
$sg_retrywon = true if result == 0
$sg_retryescaped = true if result == 1
sg_battleretry_battleend(result)
end
end

class Scene_Gameover
alias_method :sg_battleretry_gameovermain, :main
def main
if $sg_battleretry_inbattle
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.gameover($data_system.gameover_name)
$game_system.bgm_stop
$game_system.me_play($data_system.gameover_me)
Graphics.transition(90)
@command_window = Window_Command.new(192,SG::BattleRetryCommands)
@command_window.back_opacity = 160
@command_window.x = 320 - @command_window.width / 2
@command_window.y = 288
loop do
Graphics.update
Input.update
sg_retry_update
if $scene != self
break
end
end
@command_window.dispose
Graphics.freeze
@sprite.bitmap.dispose
@sprite.dispose
Graphics.transition(30)
Graphics.freeze
else
sg_battleretry_gameovermain
end
end

def sg_retry_update
@command_window.update
if Input.trigger?(Input::C)
case @command_window.index
when 0
sg_scene_save_temp = Scene_Load.new
sg_scene_save_temp.sg_read_retrysave_data
$game_temp = $sg_battleretry_inbattle
$game_temp.gameover = nil
$game_system.bgm_play($game_temp.battle_music_playing)
$scene = Scene_Battle.new
when 1
File.delete('Data/retry.sg') if FileTest.exist?('Data/retry.sg')
$sg_battleretry_inbattle = nil
$scene = Scene_Title.new
end
end
end
end

#--------------------------------------------------------------------------
end


Dodatkowe informacje:
Skrypt Wkleić w Edytorze Skryptów nad main.
________________________
Siema

Gość, Jeżeli ci Pomogłem, możesz mi dać .
_______________________________________________________________
Niestety, padł mi komp z Projektami, więc przez pewien czas niestety nici z Projektów :C
 
 
 
Wyświetl posty z ostatnich:   
Odpowiedz do tematu
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
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

Powered by phpBB modified by Przemo © 2003 phpBB Group | Template Klam by Ayene