# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-# Soul Battle Core# Core Script for Battle for Soul Engine Ace# By: SoulPour777# Date Created: February 6, 2014 - 4:39PM# Description: # This holds all modules and methods to handle all Battle Scripts of Soul# Engine Ace. Without this, most of the scripts for Battle will not work.# Place this on top of all SEA Battle Scripts.# Version History:# Version 01 - Created the Battle Cursor and Ported Battle Battlers# Version 02 - Created the Soul_Battle_CommonEvents module# Version 03 - Created the SoulVarBattle for Variable Battles# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-$imported = {} if $imported.nil?$imported["Soul_Battle_Core"] = truemodule Soul_Battle_Core # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-# Soul Allow Battlers# This part holds all variables and image names for Actor Battlers Script.# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- module Soul_Allow_Battlers #============================================================================== # Start Of Configuration #============================================================================== # Actor battler array ACTOR_BATTLER = Array.new # ------------------ Positioning ------------------# BATTLER_PLACE_ON_CENTER = true #Places the Battlers on the Center BATTLER_MAXIMUM_PARTY = 5 # Default maximum number of party. BATTLER_VERTICAL_HEIGHT = 400 # Vertical height of battlers BATTLER_TRANSPARENT_OPTION = true # makes the battlers transparent before attacking option # ------------------ List of Actors ------------------# # Actor Number Filename, Hue (optional) # The Battler Images should be inside the Battlers folder. # ------------------ Add Your Actors ------------------# ACTOR_BATTLER[1] = ["Erin"] ACTOR_BATTLER[2] = ["Natalie"] ACTOR_BATTLER[3] = ["Terence"] ACTOR_BATTLER[4] = ["Ernest"] ACTOR_BATTLER[5] = ["Ryoma"] ACTOR_BATTLER[6] = ["Brenda"] ACTOR_BATTLER[7] = ["Rick"] ACTOR_BATTLER[8] = ["Maia"] # ------------------ ------------------# end # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-# module State Requirements# This part holds the functions for Skill State Req. Script.# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- module State_Requirements def self.required_state(skill) case skill.id # ------------------------------------------- # Configuration of Skills and States # Example: when 26 then return 2 # This means that, in order for Skill ID#26 (Heal) to be used, # the user must be Poisoned (State ID #2) # ------------------------------------------- #START EDITING HERE when 26 then return 2 when 44 then return 13 # To cast Quick Move --> state Hide must be applied when 21 then return 17 # To use Bodyslam --> state Ironbody must be applied end return end end # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-# Soul_Battle_CommonEvents# This part holds the variables needed to run Battle Common Events script.# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- module Soul_Battle_CommonEvents #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-== # Add Configuration Here: #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-== COMMON_EVENT_ON_BATLLE_ID = 1 #Common Event ID of running common event #during battle COMMAND_NAME = "Advantage" #Name of Command end# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-# Soul_Variable_Battle# This part holds the variables and some functions for the Variable Battle Script.# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-# Script Call:# Soul_Variable_Battle.pk_battle# ^ This will initiate a random troop battle.# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- module SoulVarBattle ENEMIES_ON_BATTLE = [1,2,3,4,5,6,7,8,9,10] #enemy id of all killers / crime busters ENEM_COUNTER = rand(ENEMIES_ON_BATTLE.size) #-------------------------------------------------------------------------- # * Battle #-------------------------------------------------------------------------- def self.pk_battle BattleManager.setup(ENEMIES_ON_BATTLE[ENEM_COUNTER], true, true) BattleManager.save_bgm_and_bgs #This is the method used for saving the map's BGM and BGS $game_player.make_encounter_count SceneManager.call(Scene_Battle) end end # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-# Advanced Calculations# This module holds all variables involving Damage Calculations in Battle.# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- module AdvancedCalculations OVERKILL_CRITICAL = [50, 150, 250, 350, 450] #Overkill Damage on Critical OVERKILL_CHANCE = rand(100) #Chance of Having an Overkill OVERKILL_OK = 75 end module StateBattle STATE_NUMBER = 2 # How many states are available to be inflicted? CHANCE_ROLL = 100 # variable for chance randomization IRONBODY = 17 #Iron Body State COUNTER_ATTACK = 18 #Counterattack State STATE_CHANCE = 100 # Chance of the state being inflicted. STATE_SW = 1 # Switch ID for the Effect to Work end # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-# SoulBattleCursor# This module holds the functions for the Battle Cursor Script.# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- module SoulBattleCursor CURSOR_POSITION = [-45, -150] CURSOR_NAME_POSITION = [-10, 35] CURSOR_Z = 0 def check_index_limit self.index = 0 if self.index >= item_max self.index = (item_max - 1) if self.index < 0 end #-------------------------------------------------------------------------- # ● Set Cursor Position Enemy #-------------------------------------------------------------------------- def set_cursor_position_enemy return if !self.active $game_temp.battle_cursor[0] = $game_troop.alive_members[self.index].screen_x + CURSOR_POSITION[0] rescue nil $game_temp.battle_cursor[1] = $game_troop.alive_members[self.index].screen_y + CURSOR_POSITION[1] rescue nil $game_temp.battle_cursor[3] = $game_troop.alive_members[self.index].name rescue nil $game_temp.battle_cursor = [0,0,false,0] if $game_temp.battle_cursor[0] == nil end #-------------------------------------------------------------------------- # ● Set Cursor Position Actor #-------------------------------------------------------------------------- def set_cursor_position_actor return if !self.active $game_temp.battle_cursor[0] = $game_party.members[self.index].screen_x + CURSOR_POSITION[0] rescue nil $game_temp.battle_cursor[1] = $game_party.members[self.index].screen_y + CURSOR_POSITION[1] rescue nil $game_temp.battle_cursor[3] = $game_party.members[self.index].name rescue nil $game_temp.battle_cursor = [0,0,false,0] if $game_temp.battle_cursor[0] == nil end #-------------------------------------------------------------------------- # ● Process Cursor Move #-------------------------------------------------------------------------- def process_cursor_move return unless cursor_movable? last_index = @index cursor_move_index(+1) if Input.repeat?
🙂DOWN) cursor_move_index(-1) if Input.repeat?
🙂UP) cursor_move_index(+1) if Input.repeat?
🙂RIGHT) cursor_move_index(-1) if Input.repeat?
🙂LEFT) if @index != last_index Sound.play_cursor end end #-------------------------------------------------------------------------- # ● Process Cursor Move Index #-------------------------------------------------------------------------- def cursor_move_index(value = 0) self.index += value check_index_limit end end end
Code:
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# Soul Engine Ace - Enhanced Battle Commands# Author: Soulpour777# Version 1.0# Description: Creates transparent windows for all Battle Commands and uses# pictures as background. The battle hud is also created to enhance battle# visibility for the game.# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# Features:#~ 1. Enhanced Battle Messaging#~ 2. Enhanced Window ActorCommand#~ 3. Enhanced Window PartyCommand#~ 4. Enhanced Window Battle, Skill, Enemy, Actor and Help#~ 5. Enhanced BattleManager Victory Processing# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# Terms of Use:# ALL SEA Scripts are bound to my terms of use. The script can not be used# for commercial projects without author's license.# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#~ For Commercial Use:# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#~ The script license is required to use the script commercially. This license means that I (SoulPour777) acknowledge the user on using my scripts in your project. This script license is issued per script use or per project. If the script is to be used on multiple projects, the user must pay for them separately.#~ Updates or Bug Fixes are accepted. These updates or bug fixes are also charged.#~ Credit SoulPour777 for the script on your project.#~ Preserve the Script Headers and Notes.#~ Requested Scripts has a higher price that the scripts that are already available on my website.# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#~ For Non-Commercial Use:# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#~ You are free to use the script on any non-commercial projects.#~ You are free to adapt the script. Any modifications are allowed as long as it is provided as a note on the script.#~ Credits to SoulPour777 for the script.#~ Preserve the Script Header.#~ Claiming the script as your own is prohibited.# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#==============================================================================# ** BattleManager#------------------------------------------------------------------------------# This module manages battle progress.#==============================================================================module BattleManager # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # Reposition Message # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= def self.battle_start $game_system.battle_count += 1 $game_party.on_battle_start $game_troop.on_battle_start $game_troop.enemy_names.each do |name| create_victory_image $game_message.background = 2 $game_message.position = 0 $game_message.add(sprintf("\n" + Vocab::Emerge, name)) end if @preemptive $game_message.add(sprintf("\n" + Vocab::Preemptive, $game_party.name)) elsif @surprise $game_message.add(sprintf("\n" + Vocab::Surprise, $game_party.name)) end wait_for_message dispose_victory_image end # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # Upgraded Process Victory Message # Added: Image Based Battle Message # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= def self.process_victory play_battle_end_me replay_bgm_and_bgs $game_message.background = 2 $game_message.position = 0 $game_message.add("\n" + sprintf(Vocab::Victory, $game_party.name)) create_victory_image display_exp gain_gold gain_drop_items gain_exp SceneManager.return dispose_victory_image dispose_background_status battle_end(0) return true end # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # Create Victory Image # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= def self.create_victory_image @victory_message = Sprite.new @victory_message.bitmap = Cache.system("battle_victory_message") @victory_message.x = 0 @victory_message.y = 0 @victory_message.opacity = 255 end # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # Dispose Victory Image # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= def self.dispose_victory_image @victory_message.bitmap.dispose @victory_message.dispose end # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # Create Background Status # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= def self.create_background_status @sprite = Sprite.new @sprite.bitmap = Cache.system("status_command") @sprite.x = 0 @sprite.y = 300 end # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # Dispose Background Status # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= def self.dispose_background_status @sprite.bitmap.dispose @sprite.dispose end # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # Create Item # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= def self.create_battle_item @battle_item = Sprite.new @battle_item.bitmap = Cache.system("Battle_ItemSelectActor") end # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # Dispose Battle Item # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= def self.dispose_battle_item @battle_item.bitmap.dispose @battle_item.dispose end # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # Create Enemy Command # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= def self.create_battle_enemy @battle_enemy = Sprite.new @battle_enemy.bitmap = Cache.system("Battle_ItemSelectEnemy") end # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # Dispose Enemy Command # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= def self.dispose_battle_enemy @battle_enemy.bitmap.dispose @battle_enemy.dispose end # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # Display Experience # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= def self.display_exp if $game_troop.exp_total > 0 text = sprintf(Vocab::ObtainExp, $game_troop.exp_total) $game_message.background = 2 $game_message.position = 0 $game_message.add('\.' + text) end end #-------------------------------------------------------------------------- # * Gold Acquisition and Display #-------------------------------------------------------------------------- def self.gain_gold if $game_troop.gold_total > 0 text = sprintf(Vocab::ObtainGold, $game_troop.gold_total) $game_message.background = 2 $game_message.position = 0 $game_message.add('\.' + text) $game_party.gain_gold($game_troop.gold_total) end wait_for_message end #-------------------------------------------------------------------------- # * Dropped Item Acquisition and Display #-------------------------------------------------------------------------- def self.gain_drop_items $game_troop.make_drop_items.each do |item| $game_party.gain_item(item, 1) $game_message.add(sprintf("\n" + Vocab::ObtainItem, item.name)) $game_message.background = 2 $game_message.position = 0 end wait_for_message endend# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# BattleCommand# ----------------------------------------------------------------------------# This module holds values for all transparency of the Window Commands# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=module BattleCommand STATUS_OPACITY = 0 INDEX_VALUE = 96 ITEM_WIDTH = 96 ITEM_RECT_Y = 0 PARTY_COMMAND_OPACITY = 0 ACTOR_COMMAND_OPACITY = 0 end#==============================================================================# ** Window_BattleActor#------------------------------------------------------------------------------# This window is for selecting an actor's action target on the battle screen.#==============================================================================class Window_BattleActor < Window_BattleStatus #-------------------------------------------------------------------------- # * Object Initialization # info_viewport : Viewport for displaying information #-------------------------------------------------------------------------- alias battle_actor_initialize initialize alias battle_actor_hide hide def initialize(info_viewport) battle_actor_initialize(info_viewport) self.opacity = 0 end #-------------------------------------------------------------------------- # * Show Window #-------------------------------------------------------------------------- def show if @info_viewport BattleManager.create_battle_item width_remain = Graphics.width - width self.x = width_remain @info_viewport.rect.width = width_remain select(0) end super end #-------------------------------------------------------------------------- # * Hide Window #-------------------------------------------------------------------------- def hide battle_actor_hide() BattleManager.dispose_battle_item end end#==============================================================================# ** Window_BattleEnemy#------------------------------------------------------------------------------# Window for selecting the enemy who is the action target on the battle# screen.#==============================================================================class Window_BattleEnemy < Window_Selectable #-------------------------------------------------------------------------- # * Object Initialization # info_viewport : Viewport for displaying information #-------------------------------------------------------------------------- # Alias Listings #-------------------------------------------------------------------------- alias battle_skill_hide hide alias battle_enemy_initialize initialize #-------------------------------------------------------------------------- def initialize(info_viewport) battle_enemy_initialize(info_viewport) self.opacity = 0 end #-------------------------------------------------------------------------- # * Show Window #-------------------------------------------------------------------------- def show if @info_viewport BattleManager.create_battle_enemy width_remain = Graphics.width - width self.x = width_remain @info_viewport.rect.width = width_remain select(0) end super end #-------------------------------------------------------------------------- # * Hide Window #-------------------------------------------------------------------------- def hide battle_skill_hide() BattleManager.dispose_battle_enemy end end#==============================================================================# ** Window_BattleSkill#------------------------------------------------------------------------------# This window is for selecting skills to use in the battle window.#==============================================================================class Window_BattleSkill < Window_SkillList #-------------------------------------------------------------------------- # * Object Initialization # info_viewport : Viewport for displaying information #-------------------------------------------------------------------------- alias battle_skill_initialize initialize def initialize(help_window, info_viewport) battle_skill_initialize(help_window, info_viewport) self.opacity = 0 end #-------------------------------------------------------------------------- # * Show Window #-------------------------------------------------------------------------- def show select_last @help_window.show super end #-------------------------------------------------------------------------- # * Hide Window #-------------------------------------------------------------------------- def hide @help_window.hide super end end#==============================================================================# ** Window_BattleItem#------------------------------------------------------------------------------# This window is for selecting items to use in the battle window.#==============================================================================class Window_BattleItem < Window_ItemList #-------------------------------------------------------------------------- # * Object Initialization # info_viewport : Viewport for displaying information #-------------------------------------------------------------------------- alias battle_item_initialize initialize def initialize(help_window, info_viewport) battle_item_initialize(help_window, info_viewport) self.opacity = 0 endend#==============================================================================# ** Window_BattleStatus#------------------------------------------------------------------------------# This window is for displaying the status of party members on the battle# screen.#==============================================================================class Window_BattleStatus < Window_Selectable # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # Alias Listings (initialize) # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= alias battle_status_init initialize # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # This is where the Battle Hud is created # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # Initialize # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= def initialize battle_status_init() self.opacity = BattleCommand::STATUS_OPACITY BattleManager.create_background_status endend#==============================================================================# ** Window_PartyCommand#------------------------------------------------------------------------------# This window is used to select whether to fight or escape on the battle# screen.#==============================================================================class Window_PartyCommand < Window_Command #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- alias party_command_initialize initialize def initialize party_command_initialize() self.opacity = BattleCommand::PARTY_COMMAND_OPACITY endend#==============================================================================# ** Window_ActorCommand#------------------------------------------------------------------------------# This window is for selecting an actor's action on the battle screen.#==============================================================================class Window_ActorCommand < Window_Command #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- alias actor_command_initialize initialize def initialize actor_command_initialize() self.opacity = BattleCommand::ACTOR_COMMAND_OPACITY endend#==============================================================================# ** Scene_Battle#------------------------------------------------------------------------------# This class performs battle screen processing.#==============================================================================class Scene_Battle < Scene_Base alias scene_battle_start start def start scene_battle_start() @help_window.opacity = 0 @help_window.y = 37 end end
I had a quick read through and noticed that there is scenarios set up for what happens when the player is victorious, but could not find anything to do with game over or losing. Not too sure if that is the actual problem though.