Star Ocean Battle Arena
#1
Star Ocean Battle Arena
by SephirothSpawn
Last Updated: 12.25.05

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Description:
Lets you compete in Ranking Battles of Oponent Groups of your making. No need to make them in the database, just alter the contants, and the troops are created for you! Progressive Battling, so you can take your money and walk, or gamble it and coninue on in battle.

Instructions:
~ Insert the Code Above Main and Below Scene_Battle
~ Find the constants RANK_D - RANK_S.
This is where you will be making your battle troops.

In each constant, your troops are set like this:
Code:
[troop name, [member 1 id, member 2 id, ...] ]


You can make the constants however big you would like, and make however many monsters you can think of. Just mess around with it.

The Demo:

.zip   Star_Ocean_Battle_Arena.zip (Size: 209.72 KB / Downloads: 2)

The Code:
Code:
#==============================================================================
# Star Ocean Battle Arena
#==============================================================================
# SephirothSpawn
# Version 1
# 12.22.05
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log("Star Ocean Battle Arena", "SephirothSpawn", 1, "12.17.05")

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state("Star Ocean Battle Arena") == true

#==============================================================================
# ** Scene_BattleArena
#==============================================================================
class Scene_BattleArena
RANK_D = [
['Ghost * 3', [1, 1, 1] ], ['Basilisk *3', [2, 2, 2] ],
['Shagin * 2', [3, 3] ], ['Hell Hound * 2', [4, 4] ],
['King Kobold', [5] ] ]
RANK_C = [
['Cockatrice * 3', [6, 6, 6] ], ['Imp *3', [7, 7, 7] ],
['Angel * 2', [8, 8] ], ['Zombie * 2', [9, 9] ],
['Lamia', [10] ] ]
RANK_B = [
['Lizard Man * 3', [11, 11, 11] ], ['Cerebus *3', [12, 12, 12] ],
['Goblin * 2', [13, 13] ], ['Harpy * 2', [14, 14] ],
['Gargoyle', [15] ] ]
RANK_A = [
['Archangel * 3', [16, 16, 16] ], ['Skeleton *3', [17, 17, 17] ],
['Hydra * 3', [18, 18, 18] ], ['Krakan * 3', [19, 19, 19] ],
['Griffon * 2', [20, 20] ], ['Orge * 2', [21, 21] ],
['Wyvern *2', [22, 22] ],['Demon * 2', [23, 23] ],
['Cherub', [24] ], ['Lich', [25] ] ]
RANK_S = [
['Quetzacoatel', [26]], ['Leviathan', [27]],
['Behemoth', [28]], ['Troll', [29]],
['Goruda', [30]], ['Diablos', [31]],
['Seraphim', [32] ] ]
TROOPS = [RANK_D, RANK_C, RANK_B, RANK_A, RANK_S]
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Memorize map BGM and stop BGM
$game_temp.map_bgm = $game_system.playing_bgm
$game_system.bgm_stop
# Play battle BGM
$game_system.bgm_play(RPG::AudioFile.new('042-Dungeon08'))
# Background
@sprite_set = Spriteset_Map.new
# Help Window
@help_window = Window_Help.new
@help_window.y = - 64
@help_window.opacity = 200
# Gold Window
@gold_window = Window_Gold.new
@gold_window.x, @gold_window.y = 640, 80
@gold_window.opacity = 200
# Stores Objects
@objects = [@sprite_set, @help_window, @gold_window]
# Checks if Returning from Arena Battle
if $game_temp.arena_battle
# Proceeds to Returning Setup
main_return_setup
else
# Proceeds to Main Setup
main_main_setup
end
# Execute transition
Graphics.transition
# Main loop
while $scene == self
# Update game screen
Graphics.update
# Update input information
Input.update
# Updates Objects
@objects.each {|x| x.update}
# Frame update
update
end
# Prepare for transition
Graphics.freeze
# Disposes Objects
@objects.each {|object| object.dispose}
# Plays MAP Bgm
if $scene.is_a?(Scene_Map)
$game_system.bgm_play($game_temp.map_bgm)
end
end
#--------------------------------------------------------------------------
# * Returning Setup
#--------------------------------------------------------------------------
def main_return_setup
# Clears Flag
$game_temp.arena_battle = false
# Stores Troop Name & Deletes From Data Troops
@troop_name = $data_troops.pop.name
# Current Prize
current_prize = $game_temp.arena_prize
# Determines if Won or Lost
if $game_temp.arena_win
rank = TROOPS[$game_temp.arena_progress[0]]
if $game_temp.arena_progress[1] == rank.size
# Set Help Text
@help_window.set_text("Completed Rank", 1)
# Restores Actors
unless $temp_actors.empty?
$game_party.actors = $temp_actors
end
# Gain Gold
$game_party.gain_gold($game_temp.arena_prize)
# Proceeds to Continue Phase
@phase, @exit = 99, false
return
else
# Set Help Text
@help_window.set_text("#{@troop_name} Defeated !!! Do You want to Continue?", 1)
# Continue Window
@continue_window = Window_Command.new(576, ["Yes (Try for #{current_prize * 2})",
"Leave (Take your #{current_prize} and walk)"])
@continue_window.x, @continue_window.y = 32, 480
@continue_window.opacity = 200
# Adds to Objects
@objects.push(@continue_window)
end
# Proceeds to Continue Phase
@phase = 3
else
# Set Help Text
@help_window.set_text('You Lost', 1)
# Clears Arena Battle Flags
$game_temp.arena_progress = [0, 0]
$game_temp.arena_battle = false
# Proceeds to Exit Phase
@phase, @exit = 99, false
end
end
#--------------------------------------------------------------------------
# * Main Setup
#--------------------------------------------------------------------------
def main_main_setup
# Battle Type Window
@battle_type_window = Window_Command.new(200, ['Single Battle', 'Team Battle'])
@battle_type_window.x, @battle_type_window.y = - 200, 368
@battle_type_window.opacity = 200
@battle_type_window.active = false
# Individual Actors Window
actors = []
$game_party.actors.each {|actor| actors << actor.name}
@actors_window = Window_Command.new(200, actors)
@actors_window.x, @actors_window.y = 648, 432 - (actors.size * 32) #X - 424
@actors_window.opacity = 200
@actors_window.active = false
# Ranking Window
@ranks_window = Window_Command.new(576, [
'Rank D: Beginner Battles (100 G)', 'Rank C: Novice Battles (250 G)',
'Rank B: Advanced Battles (500 G)', 'Rank A: Expert Battles (1000 G)',
'Rank S: Master Battles (5000 G)'])
@ranks_window.x, @ranks_window.y = 32, - 192
@ranks_window.opacity = 200
@ranks_window.active = false
# Adds To Objects Array
@objects.push(@battle_type_window, @actors_window, @ranks_window)
# Sets Phase to Main
@phase = 0
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
case @phase
# For New Battles
when 0 # Battle Type Select
@help_window.set_text('What Type of Battle Would you like to Compete in?' , 1)
select_battle_type
when 1 # Select Actor (if Single Battle)
@help_window.set_text('Which Actor Shall Compete?' , 1)
select_battle_actor
when 2 # Select Battling Rank
@help_window.set_text('Which Rank shall you Compete In?' , 1)
select_battle_rank
# For Continuing Battles
when 3 # Select Continue or Quit
select_battle_continue
# For Proceeding to Battle or Exiting
when 4 # Battle Engaging
@help_window.set_text('Starting Battle... ... ... ... ...', 1)
start_new_Battle
when 99 # Exit Battle Arena
exit_battle_arena
end
end
#--------------------------------------------------------------------------
# * Frame Update : Select Battle Type
#--------------------------------------------------------------------------
def select_battle_type
# Activates Battle Type Window
@battle_type_window.active = true
# Fades In Windows
@help_window.y += 8 if @help_window.y < 0
@gold_window.x -= 16 if @gold_window.x > 464
@battle_type_window.x += 24 if @battle_type_window.x < 16
# Fades Out Windows
@actors_window.x += 16 if @actors_window.x < 648
@ranks_window.y -= 32 if @ranks_window.y > - 192
# If B is Pressed
if Input.trigger?(Input::cool.gif
# Plays Cancel SE
$game_system.se_play($data_system.cancel_se)
# Disables Battle Type Window
@battle_type_window.active = false
# Sets Help Text
@help_window.set_text('Fine. Come Again', 1)
# Exit Phase Setup
@phase, @exit = 99, false
end
# If C is Pressed
if Input.trigger?(Input::C)
# Plays Decision SE
$game_system.se_play($data_system.decision_se)
# Deactivates Window
@battle_type_window.active = false
case @battle_type_window.index
when 0 # Single Battle
$temp_actors = $game_party.actors.dup
@type, @phase = 'Single', 1
when 1
$temp_actors = []
@type, @phase = 'Team', 2
end
end
end
#--------------------------------------------------------------------------
# * Frame Update : Select Actor
#--------------------------------------------------------------------------
def select_battle_actor
# Activates Actors Window
@actors_window.active = true
# Fades In Windows
@help_window.y += 8 if @help_window.y < 0
@gold_window.x -= 16 if @gold_window.x > 464
@battle_type_window.x += 24 if @battle_type_window.x < 16
@actors_window.x -= 16 if @actors_window.x > 424
# Fades Out Windows
@ranks_window.y -= 32 if @ranks_window.y > - 192
# If B is Pressed
if Input.trigger?(Input::cool.gif
# Plays Cancel SE
$game_system.se_play($data_system.cancel_se)
# Disables Actors Window
@actors_window.active = false
# Restore Actors
$game_party.actors = $temp_actors
# Battle Type Window Phase
@phase = 0
end
# If C is Pressed
if Input.trigger?(Input::C)
# Plays Decision SE
$game_system.se_play($data_system.decision_se)
# Deactivates Window
@actors_window.active = false
# Removes Actors
$game_party.actors = [$temp_actors[@actors_window.index]]
# Proceeds to Battle Rank Selection
@phase = 2
end
end
#--------------------------------------------------------------------------
# * Frame Update : Select Actor
#--------------------------------------------------------------------------
def select_battle_rank
# Actives Ranks Window
@ranks_window.active = true
# Fades In Windows
@help_window.y += 8 if @help_window.y < 0
@gold_window.x -= 16 if @gold_window.x > 464
@ranks_window.y += 16 if @ranks_window.y < 160
# Fades Out Windows
@battle_type_window.x -= 12 if @battle_type_window.x > - 200
@actors_window.x += 16 if @actors_window.x < 648
# If B is Pressed
if Input.trigger?(Input::cool.gif
# Plays Cancel SE
$game_system.se_play($data_system.cancel_se)
# Disables Ranks Window
@ranks_window.active = false
# Moves to Previous Method
@phase = @type == 'Single' ? 1 : 0
end
# If C is Pressed
if Input.trigger?(Input::C)
# Gets Cost
case @ranks_window.index
when 0
cost = 100
when 1
cost = 250
when 2
cost = 500
when 3
cost = 1000
when 4
cost = 5000
end
# Checks to Make Sure You have enough Money
if $game_party.gold < cost
# Plays Buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Plays Decision SE
$game_system.se_play($data_system.decision_se)
# Disables Ranks Window
@ranks_window.active = false
# Deletes Gold
$game_party.lose_gold(cost)
# Sets Rank
$game_temp.arena_progress = [@ranks_window.index, 0]
# Sets Prize
$game_temp.arena_prize = cost / 2
# Procees to New Battle Phase
@phase = 4
end
end
#--------------------------------------------------------------------------
# * Frame Update : Continue Battle
#--------------------------------------------------------------------------
def select_battle_continue
# Fades In Help Window
@help_window.y += 8 if @help_window.y < 0
# Fades In Gold Window
@gold_window.x -= 16 if @gold_window.x > 464
# Fades In Continue Window
@continue_window.y -= 16 if $game_temp.arena_win && @continue_window.y > 160
# If C is pressed
if Input.trigger?(Input::C)
# Continue
if @continue_window.index == 0
if @help_window.y >= 0 && @gold_window.x <= 464 && @continue_window.y <= 160
# Proceeds to Start Battle Phase
@phase = 4
end
else
# Gain Gold
$game_party.gain_gold($game_temp.arena_prize)
# Proceeds to Exit Scene Phase
@phase, @exit = 99, true
# Restores Actors
unless $temp_actors.empty?
$game_party.actors = $temp_actors
end
end
end
end
#--------------------------------------------------------------------------
# * Frame Update : Start New Battle
#--------------------------------------------------------------------------
def start_new_Battle
# Sets Up Enemy Troop
troop = TROOPS[$game_temp.arena_progress[0]][$game_temp.arena_progress[1]]
set_troop_setup(troop[0], troop[1])
# Set Arena Battle Flag
$game_temp.arena_battle = true
# Set it so You can't escape
$game_temp.battle_can_escape = false
# Set it so You can't lose
$game_temp.battle_can_lose = true
# Fades Out Windows
@gold_window.x += 10 if @gold_window.x < 640
# Exit Phase
@phase, @exit = 99, true
end
#--------------------------------------------------------------------------
# * Frame Update : Exit Arena
#--------------------------------------------------------------------------
def exit_battle_arena
# Fades in Help Window
if @exit == false
@help_window.y += 4 if @help_window.y < 0
end
# Varaible for exit scene
exit = true
# Fades Out Help Window
unless $game_temp.arena_battle
unless @help_window == nil
if @help_window.y > - 64 && @exit
exit = false
@help_window.y -= 4
end
end
end
# Fades Out Gold Window
unless @gold_window == nil
if @gold_window.x < 640
exit = false
@gold_window.x += 10
end
end
# Fades Out Battle Type Window
unless @battle_type_window == nil
if @battle_type_window.x > - 200
exit = false
@battle_type_window.x -= 12
end
end
# Fades Out Actors Window
unless @actors_window == nil
if @actors_window.x < 648
exit = false
@actors_window.x += 16
end
end
# Fades Out Ranks Window
unless @ranks_window == nil
if @ranks_window.y > - 192
exit = false
@ranks_window.y -= 16
end
end
# Fades Out Continue Window
unless @continue_window == nil
if @continue_window.y < 640
exit = false
@continue_window.y += 16
end
end
# If Button is Pressed
if Input.trigger?(Input::cool.gif or Input.trigger?(Input::C)
@exit = true
end
if @exit && exit
# Proceeds to Next Scene
$scene = $game_temp.arena_battle ? Scene_Battle.new : Scene_Map.new
end
end
#--------------------------------------------------------------------------
# * Troop Setup (and Battle Information)
#--------------------------------------------------------------------------
def set_troop_setup(name = 'Troop', enemies = [1], battleback = $game_map.battleback_name)
# Creates New Troop
troop = RPG::Troop.new
# Gives Troop Name
troop.name = name
# Adds Members into Troop
for i in 0...enemies.size
# Creates New Member
member = RPG::Troop::Member.new
# Sets Member ID
member.enemy_id = enemies[i]
# Sets Member Coordinates
member.x = (640 / (enemies.size + 1)) * (i + 1)
member.y = 300
# Adds Memeber to Troop Array
troop.members.push(member)
end
# Adds New Troop to Data Troops
$data_troops.push(troop)
# Sets Troop ID
$game_temp.battle_troop_id = $data_troops.size - 1
# Sets Battle Back
$game_map.battleback_name = battleback
end
end

#==============================================================================
# ** Game_Temp
#==============================================================================

class Game_Temp
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :arena_progress # Both Group and Opponent Level
attr_accessor :arena_prize
attr_accessor :arena_battle # Returns to Battle Arena after Battle
attr_accessor :arena_win
alias seph_battlearena_gametemp_init initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Old Initialize Method
seph_battlearena_gametemp_init
# Adds Battle Arena Variables
@arena_progress = [0, 0]
@arena_prize = 0
@arena_battle = false
@arena_win = false
end
end

#==============================================================================
# ** Game_Party
#==============================================================================

class Game_Party
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :actors
end

#==============================================================================
# ** Scene_Battle (part 1)
#==============================================================================

class Scene_Battle
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias seph_battlearena_scenebattle_battleend battle_end
#--------------------------------------------------------------------------
# * Battle Ends
# result : results (0:win 1:lose 2:escape)
#--------------------------------------------------------------------------
def battle_end(result)
if $game_temp.arena_battle
# Clear in battle flag
$game_temp.in_battle = false
# Clear entire party actions flag
$game_party.clear_actions
# Remove battle states
for actor in $game_party.actors
actor.remove_states_battle
end
# Clear enemies
$game_troop.enemies.clear
# Call battle callback
if $game_temp.battle_proc != nil
$game_temp.battle_proc.call(result)
$game_temp.battle_proc = nil
end
# If Win
if result == 0
$game_temp.arena_win = true
$game_temp.arena_progress[1] += 1
$game_temp.arena_prize *= 2
# If Lose
else
$game_temp.arena_win = false
end
# Proceeds to Battle Arena
$scene = Scene_BattleArena.new
return
end
# Old Battle End Method
seph_battlearena_scenebattle_battleend(result)
end
end

#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end

You don't need the SDK for this script. Just delete any lines that deal with the SDK. (9 - 17 & 560 563)

Thanks to Fallen_God13 for letting me post his Gift and share it with all.
Also thanks to Goldenshadow and dragonslayer for beta testing it.
}




Users browsing this thread: 2 Guest(s)