Jump to content
Kirin

Saba Kan's Ao no Kiseki Battle System 0.28 (And Rokan's AT Bonus)

Recommended Posts

This script was not written by me! I simply translated it from Japanese and posted it here to share! Do NOT ask me for support, I'm not a scripter (I'll try, but most likely fail)!

 

And done. Now, the script I've painstakingly translated for you guys is:

 

Ao no Kiseki Custom Battle System

Version 0.28

by Saba Kan of

jzrma.jpg

 

プãƒãƒ¬ã‚¢ - PetitRare

 

Updated: 2012/01/21

 

Email asking for and being granted permission to translate and share:

 

kirinelf ã•ã‚“ã¸

 

ã‚ã–ã‚ã–メールã‚ã‚ŠãŒã¨ã†ã”ã–ã„ã¾ã™ã€‚

日本語ã§ã™ã¿ã¾ã›ã‚“。

 

ã‚‚ã¡ã‚ã‚“æ­“è¿Žã—ã¾ã™ã€ã©ã†ãžç¿»è¨³ãªã•ã£ã¦ãã ã•ã„。

 

> http://www.rpgmakervxace.net

> http://forums.rpgmakerweb.com

ãŠãŠï¼ã€€ã“ã‚Œã‹ã‚‰ã‚‚ãƒã‚§ãƒƒã‚¯ã•ã›ã¦ã„ãŸã ãã¾ã™ï¼

 

2012年3月26日21:42 Kirin:

> ã“ã‚“ã«ã¡ã¯ã€

>

> 僕ã¯è‹±èªžã®RPGVXAã®ã‚³ãƒƒãƒ ãƒ‹ãƒ†ã‚£ã‹ã‚‰ã®kirinelf ã§ã™ã€‚キリンã§å‘¼ã³ã¾ã™ã“ã¨

> ã‚‚ã„ã„ã§ã™ã€‚ã‚ã®ã€‚。。日本語ãŒã‚ã¾ã‚Šä¸Šæ‰‹ã§ã‚ã‚ã‚Šã¾ã›ã‚“ã§ã™ã‹ã‚‰ç”³ã—訳ã‚ã‚Š ã¾ã›ã‚“。よã‚ã—ããŠã­ãŒã„ã—ã¾ã™ï¼

>

> 今回ã®ãƒ¡ãƒ¼ãƒ«ã®ç†ç”±ã¯RPGVXAã®RGSS3スクリプトを翻訳ã—ãŸã„ã“ã¨ã§ã™ã€‚貴方様 ã®ã‚¹ã‚¯ãƒªãƒ—トを英語ã«ç¿»è¨³ã—ã¦ã‚‚ã„ã„ã§ã—ょã†ã‹ï¼Ÿã‚‚ã¡ã‚ã‚“

> 貴方様ã®è¨˜è¼‰ã‚‚ã‚ ã‚Šã¾ã™ã€‚自分を書ã„ãŸäº‹ã‚‚絶対言ã„ã¾ã›ã‚“。

>

> 僕ã®ç›®çš„ã¯é¢ç™½ãã†ãªã‚¹ã‚¯ãƒªãƒ—トを翻訳ã—ã¦ã€ã“ã®ã‚µã‚¤ãƒˆã«ã»ã‹ã®è‹±èªžã®ãƒ¦ãƒ¼ã‚µ ã¨åˆ†ã‹ã¡åˆã„ã¾ã™ï¼š

>

> http://www.rpgmakervxace.net

> http://forums.rpgmakerweb.com

>

> ãã®ã‚µã‚¤ãƒˆã¯è‹±èªžRPGVXAã®ä¸€ç•ªå¤§ãã„コッムニティã§ã™ã€‚

>

> ãŠè¿”事を根気よãã¦å¾…ã¦ã„ã¾ã™ã€‚

>

> kirinelf (キリン) より。

 

 

The above, translated:

 

To kirinelf:

 

Thank you for going out of your way to send an email to me.

Sorry for this being in Japanese.

 

Please be my guest and translate them as you wish.

 

> http://www.rpgmakervxace.net

> http://forums.rpgmakerweb.com

 

Oh! I'll be sure to check these sites from now on too!

 

2012年3月26日21:42 Kirin:

> Hello,

>

> I am kirinelf from the English speaking RMVXA community. You can call me Kirin.

> I'm not very good at Japanese, so I apologize for that. Pleased to make your acquaintance!

>

> The purpose of this email is to ask about translating RMVXA's RGSS3 scripts. Is it alright

> to translate your scripts into English? Of course, you will be credited. I will not claim

> to have written any of your scripts.

>

> My aim is to translate scripts I find interesting and to share them with the rest of the

> English speaking community, namely at these sites:

>

> http://www.rpgmakervxace.net

> http://forums.rpgmakerweb.com

>

> These sites are the largest English RMVXA communities.

>

> I will await your reply patiently.

>

> From kirinelf (Kirin)

 

 

So what does this script do? Well, the Legend of Heroes (Eiyuu no Kiseki) series is a very popular RPG series in Japan. This battle system mimics the RPG part of the system, being unable to fully contain the awesome of the sRPG elements of the original system (At least, that's what I like to believe). I won't link to my normal screenshots since it's hard to find the right parts to screenie, and it's 2:40am and I can't be bothered trying. Instead, here's a video:

 

 

Features

 

  • An order bar showing the order battlers will act in.
  • Able to specify delay and charge times for skills; have a long charge time but 0 delay, or a powerful skill that you can use immediately but has an insane delay, stuff like that.
  • Charges can also be used to have skills that place a state on certain people, so a little bit of creativity can go a long way.
  • Allows you to be able to interrupt skills that're being charged.
  • You can also deny the ability to interrupt skills with a simple tag.
  • States can have tags too!
  • Edit unit spacing and location along with the location of the entire order bar for a bit customization.
  • Subscripts allow you to have an escape command in battle, modify window appearances and have bonuses.

 

There really are quite a few features and setting up shenanigans that you need to be aware of, and for that reason I've included a How to Use text file I wrote up myself after experimenting with the demo that I hope will help you guys.

 

There are six scripts: A main script that handles the bulk of the processing, another main script that handles turn order, a third main script that handles design and aesthetics, and three sub scripts. The first sub script allows you to have an escape command. The second subscript modifies the windows a bit for more aesthetical changes. The third is a bonus script that's a little different: See below for details.

 

Without further ado, here're the scripts:

 

1. Main script #1: Main Battle System

 

#==============================================================================
# â–  Ao no Kiseki Custom Battle System 17_2
#   @version 0.28 12/03/08
#   @author Saba Kan
#   @translator kirinelf
#------------------------------------------------------------------------------
#  
# â–  Usage
#  ★★★★The skills numbered 001-010 in the database are needed.★★★★
#  Please copy them and edit those copies instead. 
#
#   Attack (001)   … Sets up charge times and delays for normal attacks.
#                    If <delay> and <charge> tags aren't specified in a skill,
#                    The values defined here will be used. 
#   Guard (002)    … The delay after guarding. 
#   Escape (003    … The delay after a failed escape. 
#   Battle Start (004) … The initial delay for each actor at the start of battle. 
#   Revive (005)   … The delay after being revived from death. 
#   Cancel (006)   … The delay after being interrupted.
#   Pre-emptive Strike (007) … The same as Battle Start, but used for
#                              preemptive strikes. 
#   Stop Movement(008) … The delay after recovering from a status effect
#                        that makes you unable to move. 
#
#  ★★★★Graphics Needed★★★★
#   Please copy the contents of "Graphics/System" folder into your own. 
#   Also, if you want to erase the targetting image when an enemy is
#   targetting an ally, please replace 'Target.png' with a transparent
#   image. 
#
# â–  Tags that can be placed in skill and item notetags. 
#   For more information, look at the sample skills. 
#   <delay> n  … The delay after using a skill.
#                (Time taken before you can act again).
#   <charge> n … How long it takes to charge/channel the skill before it's used. 
#   <chargemsg> string  … The message to show when the character 
#                         starts charging a skill. 
#                         Only used with a skill that has <charge>. 
#   <state> n     … 	ID of the state to be inflicted on the character 
#                     charging the skill. 
#                     Removed when the skill finishes charging and is used. 
#                     Only used with a skill that has <charge>. 
#   <statescope> string  …  The targets affected by the state. Can have two
#                           different strings: allenemies and allallies.
#                           Both can be used together.
#   <cancel>    	 … 	Allows this skill/item to interrupt enemy skills.
#   <cancelrate> n … 	When <cancel> is used in a notetag, this determines
#					            interruption rate. 100% rate when n = 100.
#   <nocancel>		 …  This skill can't be interrupted.
#   <slow> n 		   … 	This tag allows you to have skills that affect a actor's 
#                   	turn directly. 
#                     For example: '<slow> 5' moves the actor's turn 5 turns down.
# 					          Can be negative to speed up actors. 
#   <slowrate> n	 … 	When <slow> is used in a notetag, this determines
#                     delay rate. 100% rate when n = 100.
#
# â–  A summary of tags that can be placed in actor and enemy notetags. 
#   <nocancel> … This character can't be interrupted.
#   <noslow>  … This character can't be slowed. 
#
#==============================================================================
module Saba
 module Kiseki
   # Default enemy unit graphic if not defined in enemy notetag.
   DEFAULT_MONSTER_GRAPHIC_NAME = "Monster1"

   # Index number of the above. 
   DEFAULT_MONSTER_GRAPHIC_INDEX = 3

   # This sets the notetag to be used to define monster graphics. 
   # Enter like this in an enemy's notetag: 
  # <GRAPHIC_MARKER> <Filename> <index>
  # E.g. GRAPHIC Monster2 2
   GRAPHIC_MARKER = "GRAPHIC"

   # Influences the speed of actors. Please use an integer above 0. Percentage.
   # Default: 100, 1.2x Faster: 120, Half Speed: 50
   SPEED_INFLUENCE = 100 # %

   # Debug message display
   # Allows you to view the agility and speed correction values of the actors 
  # I think, from looking at the code, it prints out your characters' agility, 
  # then the relative speed for the battle or something. 
   DEBUG = false

   # Default skill preparation message.
   DEFAULT_PREPARE_MSG = "%s is preparing to use %s!"

   # Charging SE
   OPERATE_SE_FILE = "Audio/SE/Heal4"
   # Charging SE Volume
   OPERATE_SE_VOLUME = 80
   # Charging SE Pitch
   OPERATE_SE_PITCH = 150
 end
end

#=========================================================================
# Do not edit anything under this line unless you know what you're doing!
#=========================================================================

class Scene_Battle
 include Saba::Kiseki
 #--------------------------------------------------------------------------
 # ◠開始処ç†
 #--------------------------------------------------------------------------
 alias saba_kiseki_start start
 def start
   $game_party.clear_results
   calculate_battlers_speed
   OrderManager.init_unit
   saba_kiseki_start
 end
 #--------------------------------------------------------------------------
 # â—‹ ãƒãƒˆãƒ©ãƒ¼ã®é€Ÿåº¦å差値を求ã‚ã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def calculate_battlers_speed
   battlers = $game_party.battle_members + $game_troop.members

   total = 0.0
   for battler in battlers
     total += battler.agi
   end

   mean = total / battlers.size
   standard_deviation = 0.0

   for battler in battlers
     standard_deviation += (battler.agi - mean) * (battler.agi - mean)
   end

   standard_deviation /= battlers.size
   standard_deviation = Math.sqrt(standard_deviation)
   for battler in battlers
     if standard_deviation != 0
       battler.spd = ((battler.agi - mean) / standard_deviation) * 10
     else
       battler.spd = 0
     end
     battler.spd *= (SPEED_INFLUENCE / 100.0)
     battler.spd += 50
     msgbox battler.name + " Agi:" + battler.agi.to_s + " Speed:" + battler.spd.to_i.to_s if DEBUG
   end
 end
 #--------------------------------------------------------------------------
 # ◠パーティコマンドé¸æŠžã®é–‹å§‹
 #--------------------------------------------------------------------------
 def start_party_command_selection
   unless scene_changing?
     refresh_status
     @status_window.unselect
     @status_window.open
     BattleManager.input_start
     top_unit = OrderManager.top_unit
     top_unit.battler.on_turn_start 
     refresh_status

     @log_window.display_auto_affected_status(top_unit.battler)
     @log_window.wait_and_clear
     next_command
   end
 end
 #--------------------------------------------------------------------------
 # ◠フレーム更新
 #--------------------------------------------------------------------------
 alias saba_kiseki_battle_update_basic update_basic
 def update_basic
   saba_kiseki_battle_update_basic
   OrderManager.update
 end
 #--------------------------------------------------------------------------
 # ◠スキルウィンドウã®ä½œæˆ
 #--------------------------------------------------------------------------
 alias saba_kiseki_battle_create_skill_window create_skill_window
 def create_skill_window
   saba_kiseki_battle_create_skill_window
   @skill_window.set_handler(:change, method(:update_forecast))
 end
 #--------------------------------------------------------------------------
 # ◠アイテムウィンドウã®ä½œæˆ
 #--------------------------------------------------------------------------
 alias saba_kiseki_battle_create_item_window create_item_window
 def create_item_window
   saba_kiseki_battle_create_item_window
   @item_window.set_handler(:change, method(:update_forecast))
 end
 #--------------------------------------------------------------------------
 # ◠アクターコマンドウィンドウã®ä½œæˆ
 #--------------------------------------------------------------------------
 alias saba_kiseki_battle_create_actor_command_window create_actor_command_window
 def create_actor_command_window
   saba_kiseki_battle_create_actor_command_window
   @actor_command_window.set_handler(:change, method(:update_forecast))
 end
 #--------------------------------------------------------------------------
 # ◠アクターウィンドウã®ä½œæˆ
 #--------------------------------------------------------------------------
 alias saba_kiseki_battle_create_actor_window create_actor_window
 def create_actor_window
   saba_kiseki_battle_create_actor_window
   @actor_window.set_handler(:change, method(:update_selection))
 end
 #--------------------------------------------------------------------------
 # ◠敵キャラウィンドウã®ä½œæˆ
 #--------------------------------------------------------------------------
 alias saba_kiseki_battle_create_enemy_window create_enemy_window
 def create_enemy_window
   saba_kiseki_battle_create_enemy_window
   @enemy_window.set_handler(:change, method(:update_selection))
 end
 #--------------------------------------------------------------------------
 # â—‹ é¸æŠžçŠ¶æ…‹ã®æ›´æ–°
 #--------------------------------------------------------------------------
 def update_selection
   OrderManager.clear_selection
   OrderManager.select(@enemy_window.enemy) if @enemy_window.active
   OrderManager.select(@actor_window.actor) if @actor_window.active
 end
 #--------------------------------------------------------------------------
 # ○ 順番予測更新
 #--------------------------------------------------------------------------
 def update_forecast
   OrderManager.clear_selection
   actor = BattleManager.actor
   case @actor_command_window.current_symbol
     when :attack
       item = $data_skills[actor.attack_skill_id]
     when :guard
       item = $data_skills[actor.guard_skill_id]
     when :skill
       item = @skill_window.item if @skill_window.visible
     when :item
       item = @item_window.item if @item_window.visible
     when :escape
       item = $data_skills[3]
   end
   return OrderManager.remove_forecast_unit if item == nil
   update_forecast_item(item)
 end
 #--------------------------------------------------------------------------
 # â—‹ 指定ã®ã‚¢ã‚¤ãƒ†ãƒ ã®é †ç•ªäºˆæ¸¬æ›´æ–°
 #--------------------------------------------------------------------------
 def update_forecast_item(item)
   battler = OrderManager.top_unit.battler
   item = $data_skills[battler.attack_skill_id] if item == nil
   operate_time = item.operate_time(battler)
   unit = OrderManager.forecast_unit
   return if unit && unit.battler == battler && unit.usable_item == item

   OrderManager.remove_forecast_unit

   if operate_time > 0 && ! OrderManager.top_unit.operate
     if battler.state_operate_time == nil
       OrderManager.insert(battler, operate_time, true, item, true)
     else
       OrderManager.insert(battler, battler.state_operate_time, true, item, true)
     end
     OrderManager.show_targeted(battler) if battler.enemy?
   else
     if battler.state_stiff_time == nil
       stiff_time = item.stiff_time(battler)
       OrderManager.insert(battler, stiff_time, true, item)
     else
       OrderManager.insert(battler, battler.state_stiff_time, true, item)
     end
   end
 end
 #--------------------------------------------------------------------------
 # ◠ターン開始
 #--------------------------------------------------------------------------
 alias saba_kiski_battle_turn_start turn_start
 def turn_start
   OrderManager.clear_selection
   battler = OrderManager.top_unit.battler

   $game_troop.clear_results
   $game_party.clear_results

   if battler.current_action != nil
     item = battler.current_action.item
     update_forecast_item(item)
   else
     update_forecast_item($data_skills[8])
   end
   saba_kiski_battle_turn_start
   if item != nil && item.operate_time(battler) > 0 &&
      OrderManager.top_unit.operate != true
      play_operate_se
      refresh_status
     @log_window.display_prepare_item(battler, item)
   end
 end
 #--------------------------------------------------------------------------
 # â—‹ 駆動SEå†ç”Ÿ
 #--------------------------------------------------------------------------
 def play_operate_se
   Audio.se_play(OPERATE_SE_FILE, OPERATE_SE_VOLUME, OPERATE_SE_PITCH)
 end
 #--------------------------------------------------------------------------
 # ◠ターン終了
 #--------------------------------------------------------------------------
 def turn_end
   all_battle_members.each do |battler|
     battler.on_turn_end
     if battler.result.status_affected?
       refresh_status
       @log_window.display_auto_affected_status(battler)
       @log_window.wait_and_clear
     end
   end
   BattleManager.turn_end
   process_event
   start_party_command_selection
   calculate_battlers_speed
 end
 #--------------------------------------------------------------------------
 # ◠スキルï¼ã‚¢ã‚¤ãƒ†ãƒ ã®ä½¿ç”¨
 #--------------------------------------------------------------------------
 alias saba_kiski_battle_use_item use_item
 def use_item
   saba_kiski_battle_use_item
   return if @subject.current_action == nil
   targets = @subject.current_action.make_targets.compact
   targets.each do |target|
     delay = target.result.delay_count
     if delay != 0
       OrderManager.delay_order(target, delay) 
       #@log_window.display_delay(target, delay) 
     end
     unit = OrderManager.find_unit(target)
     if unit && unit.cancel?
       unit.battler.turn_count += 1
       OrderManager.cancel(unit)
     end
   end
 end
 #--------------------------------------------------------------------------
 # ◠戦闘行動終了時ã®å‡¦ç†
 #--------------------------------------------------------------------------
 alias saba_kiski_battle_process_action_end process_action_end
 def process_action_end
   OrderManager.update_delay_time
   if BattleManager.battle_end?
     OrderManager.remove_forecast_unit
   end
   saba_kiski_battle_process_action_end
 end
end

class Window_ActorCommand
 def cancel_enabled?
   return false
 end
end

class Spriteset_Battle
 #--------------------------------------------------------------------------
 # ◠オブジェクトåˆæœŸåŒ–
 #--------------------------------------------------------------------------
 alias saba_kiseki_battle_initialize initialize
 def initialize
   @battle_units = {}
   saba_kiseki_battle_initialize
   @viewport3.rect.height = Saba::Kiseki::ORDER_BAR_HEIGHT
   @kiseki_sprite = Spriteset_Kiseki.new(@viewport3)
 end
 #--------------------------------------------------------------------------
 # ◠フレーム更新
 #--------------------------------------------------------------------------
 alias saba_kiseki_battle_update update
 def update
   saba_kiseki_battle_update
   update_battle_unit
   @kiseki_sprite.update if @kiseki_sprite
 end
 #--------------------------------------------------------------------------
 # ○ ユニット更新
 #--------------------------------------------------------------------------
 def update_battle_unit
   remove_list = @battle_units.keys
   OrderManager.units.each do |unit|
     if @battle_units[unit] == nil
       @battle_units[unit] = Spriteset_BattleUnit.new(@viewport3, unit)
     else
       remove_list.delete(unit)
     end
     @battle_units[unit].update
   end
   remove_list.each { |unit|
     sprite = @battle_units[unit]
     sprite.dispose
     @battle_units.delete(unit)
   }
 end
 #--------------------------------------------------------------------------
 # ◠解放
 #--------------------------------------------------------------------------
 alias saba_kiseki_battle_dispose dispose
 def dispose
   @battle_units.values.each { |sprite| sprite.dispose }
   @kiseki_sprite.dispose
   saba_kiseki_battle_dispose
 end
end

class Window_Selectable
 #--------------------------------------------------------------------------
 # â— é …ç›®ã®é¸æŠž
 #--------------------------------------------------------------------------
 alias saba_kiseki_battle_select select
 def select(index)
   saba_kiseki_battle_select(index)
   call_handler(:change)
 end
 #--------------------------------------------------------------------------
 # ◠ウィンドウã®ã‚¢ã‚¯ãƒ†ã‚£ãƒ–化
 #--------------------------------------------------------------------------
 def activate
   super
   call_handler(:change)
   self
 end
end

class Game_ActionResult
 #--------------------------------------------------------------------------
 # ◠公開インスタンス変数
 #--------------------------------------------------------------------------
 attr_accessor :delay_count
 attr_accessor :cancel
 attr_accessor :fail_cancel
 attr_accessor :anti_cancel
 attr_accessor :fail_delay
 attr_accessor :anti_delay
 #--------------------------------------------------------------------------
 # ◠クリア
 #--------------------------------------------------------------------------
 alias saba_kiseki_battle_clear clear
 def clear
   saba_kiseki_battle_clear
   @delay_count = 0
   @cancel = false
   @fail_cancel = false
   @anti_cancel = false
   @fail_delay = false
   @anti_delay = false
 end
end

class Game_Battler
 #--------------------------------------------------------------------------
 # ◠公開インスタンス変数
 #--------------------------------------------------------------------------
 attr_accessor :spd
 attr_accessor :turn_count
 alias saba_kiseki_initialize initialize
 def initialize
   saba_kiseki_initialize
   @spd = 50
   @turn_count = 0
 end
 #--------------------------------------------------------------------------
 # ◠スキルï¼ã‚¢ã‚¤ãƒ†ãƒ ã®åŠ¹æžœé©ç”¨
 #--------------------------------------------------------------------------
 alias saba_kiseki_battle_item_apply item_apply
 def item_apply(user, item)
   saba_kiseki_battle_item_apply(user, item)
   return unless $game_party.in_battle
   if @result.hit?

     if user.actor? && item.is_a?(RPG::Skill) && item.id == 1
       # 通常攻撃
       total = 0
       cancel = false
       cancel_attack = false
       delay_attack = false

       user.weapons.each do |weapon|
         total += weapon.delay_count(user)
         delay_attack |= weapon.delay_attack?
         cancel |= weapon.cancel?
         cancel_attack |= weapon.cancel_attack?
       end
       @result.delay_count = total
       @result.cancel = cancel
     else
       @result.delay_count = item.delay_count(user)
       delay_attack = item.delay_attack?
       @result.cancel = item.cancel?
       cancel_attack = item.cancel_attack?
     end
     char = actor? ? actor : enemy
     @result.delay_count = 0 if char.anti_delay?
     if @result.delay_count > 0
       @result.delay_count = [@result.delay_count, OrderManager.max_delay_count(self)].min
     elsif @result.delay_count < 0
       @result.delay_count = [@result.delay_count, OrderManager.min_delay_count(self)].max
     elsif delay_attack
       if char.anti_delay?
         @result.anti_delay = true
       else
         @result.fail_delay = true
       end
     end

     unit = OrderManager.find_unit(self)

     if unit && unit.operate
       # 行動ä¸èƒ½ã«ã‚ˆã‚‹ã‚­ãƒ£ãƒ³ã‚»ãƒ«ãƒã‚§ãƒƒã‚¯
       if ! self.movable? || self.confusion?
         @result.cancel = true
       elsif char.anti_cancel? || unit.usable_item.anti_cancel?
         # キャンセルãŒç„¡åŠ¹åŒ–ã•ã‚ŒãŸ
         @result.anti_cancel = true if cancel_attack
         @result.cancel = false 
       elsif cancel_attack && ! @result.cancel
         # キャンセル失敗
         @result.fail_cancel = true
         @result.cancel = false 
       end

     else
       # ã‚‚ã¨ã‚‚ã¨æº–備中ã§ãªã„
       @result.cancel = false 
     end


     if self.dead?
       @result.anti_delay = false
       @result.fail_delay = false
       @result.delay_count = 0
       @result.cancel = false
       @result.anti_cancel = false
       @result.fail_cancel = false
     end

     @result.success = true if @result.delay_count != 0 || @result.cancel
   end
 end
 #--------------------------------------------------------------------------
 # â—‹ ターン開始処ç†
 #--------------------------------------------------------------------------
 def on_turn_start
   regenerate_all
   update_state_turns
   update_buff_turns
   remove_states_auto(2)
   remove_buffs_auto
   make_actions
 end
 #--------------------------------------------------------------------------
 # ◠ターン終了処ç†
 #--------------------------------------------------------------------------
 def on_turn_end
   @result.clear
 end
 #--------------------------------------------------------------------------
 # ◠戦闘行動終了時ã®å‡¦ç†
 #--------------------------------------------------------------------------
 def on_action_end
   @result.clear
   remove_states_auto(1)
   @turn_count += 1
 end
 #--------------------------------------------------------------------------
 # â—‹ ステートã«ã‚ˆã‚‹é§†å‹•æ™‚é–“ã‚’å–å¾—
 #--------------------------------------------------------------------------
 def state_operate_time
   n = nil
   states.reverse.each do |state|
     if state.operate_formula
       n = state.operate_time(self)
     end
   end
   return n
 end
 #--------------------------------------------------------------------------
 # â—‹ ステートã«ã‚ˆã‚‹ç¡¬ç›´æ™‚é–“ã‚’å–å¾—
 #--------------------------------------------------------------------------
 def state_stiff_time
   n = nil
   states.reverse.each do |state|
     if state.stiff_formula
       n = state.stiff_time(self)
     end
   end
   return n
 end
end

class << BattleManager
 #--------------------------------------------------------------------------
 # ◠次ã®ã‚³ãƒžãƒ³ãƒ‰å…¥åŠ›ã¸
 #--------------------------------------------------------------------------
 def next_command
   begin
     if !actor || !actor.next_command
       battler = OrderManager.top_unit.battler
       unless battler.actor?
         unless battler.current_action
           OrderManager.top_unit.usable_item = $data_skills[1]
           return false
         end
         OrderManager.top_unit.usable_item = battler.current_action.item
         return false 
       end
       return false if @actor_index == battler.index
       @actor_index = battler.index
       if OrderManager.top_unit.operate  # 発動
         OrderManager.top_unit.remove_operate_state
         battler.current_action.set_usable_item(OrderManager.top_unit.usable_item)
         return false 
       end
       return false if @actor_index >= $game_party.members.size
     end
   end until actor.inputable?
   return true
 end
 #--------------------------------------------------------------------------
 # ◠行動順åºã®ä½œæˆ
 #--------------------------------------------------------------------------
 def make_action_orders
   battler = OrderManager.top_unit.battler
   if battler.current_action == nil || battler.current_action.item == nil
     @action_battlers = [battler]
   elsif battler.current_action.item.operate_time(battler) > 0 &&
      OrderManager.top_unit.operate != true
     # 発動待ã¡
     OrderManager.top_unit.usable_item = battler.current_action.item
     OrderManager.top_unit.add_operate_state
     @action_battlers = []
   else
     @action_battlers = [battler]
   end
 end
 #--------------------------------------------------------------------------
 # ◠ターン終了
 #--------------------------------------------------------------------------
 alias saba_kiseki_battle_turn_end turn_end
 def turn_end
   saba_kiseki_battle_turn_end
   unit = OrderManager.top_unit
   OrderManager.clear_forecast
   OrderManager.update_top
 end
end


class Game_Enemy
 #--------------------------------------------------------------------------
 # ◠戦闘行動ã®ä½œæˆ
 #--------------------------------------------------------------------------
 alias saba_kiseki_battke_make_actions make_actions
 def make_actions
   # 発動待ã¡ã‚’上書ãã—ãªã„よã†ã«
   unit = OrderManager.find_unit(self)
   if unit && unit.operate
     return 
   end
   saba_kiseki_battke_make_actions
 end
 #--------------------------------------------------------------------------
 # ◠行動æ¡ä»¶åˆè‡´åˆ¤å®šï¼»ã‚¿ãƒ¼ãƒ³æ•°ï¼½
 #--------------------------------------------------------------------------
 def conditions_met_turns?(param1, param2)
   n = @turn_count
   #p name + " " + @turn_count.to_s
   if param2 == 0
     n == param1
   else
     n > 0 && n >= param1 && n % param2 == param1 % param2
   end
 end
end

class Game_Actor
 #--------------------------------------------------------------------------
 # ◠戦闘行動ã®ä½œæˆ
 #--------------------------------------------------------------------------
 alias saba_kiseki_battke_make_actions make_actions
 def make_actions
   # 発動待ã¡ã‚’上書ãã—ãªã„よã†ã«
   unit = OrderManager.find_unit(self)
   if unit && unit.operate
     return 
   end
   saba_kiseki_battke_make_actions
 end
end


class Window_BattleActor
 #--------------------------------------------------------------------------
 # â—‹ 味方キャラオブジェクトå–å¾—
 #--------------------------------------------------------------------------
 def actor
   $game_party.battle_members[@index]
 end
end

class << BattleManager
 attr_reader :preemptive
 attr_reader :surprise
 attr_reader :phase
 def battle_end?
   return true if $game_party.members.empty?
   return true if $game_party.all_dead?
   return true if $game_troop.all_dead?
   return true if aborting?
   return false
 end
end

class Game_Action
 #--------------------------------------------------------------------------
 # ◠公開インスタンス変数
 #--------------------------------------------------------------------------
 attr_accessor :targets
 attr_accessor :save_targets
 #--------------------------------------------------------------------------
 # ◠クリア
 #--------------------------------------------------------------------------
 alias saba_kiseki_battle_clear clear
 def clear
   saba_kiseki_battle_clear
   @targets = nil
   save_targets = false
 end
 #--------------------------------------------------------------------------
 # ◠ターゲットã®é…列作æˆ
 #--------------------------------------------------------------------------
 alias saba_kiseki_battle_make_targets make_targets
 def make_targets
   return @targets if @targets && @save_targets
   @targets = saba_kiseki_battle_make_targets
   return @targets
 end
 #--------------------------------------------------------------------------
 # ◠アイテムを設定
 #--------------------------------------------------------------------------
 def set_usable_item(item)
   @item.object = item
   self
 end
end

#==============================================================================
# â–  Game_BattleUnit
#------------------------------------------------------------------------------
#  画é¢ä¸Šã«è¡¨ç¤ºã•ã‚Œã‚‹ã‚³ãƒžã§ã™ã€‚
#==============================================================================
class Game_BattleUnit
 attr_accessor :battler
 attr_accessor :forecast
 attr_accessor :usable_item
 attr_accessor :operate
 attr_accessor :delay_time           # å¾…ã¡æ™‚é–“
 attr_accessor :delay_time_decimal   # å¾…ã¡æ™‚é–“ã®å°æ•°
 attr_accessor :x
 attr_accessor :dest_y
 attr_accessor :selected
 attr_accessor :targeted
 attr_reader :y
 #--------------------------------------------------------------------------
 # â—‹ オブジェクトをåˆæœŸåŒ–ã—ã¾ã™ã€‚
 #  init_battler ã“ã®ãƒ¦ãƒ‹ãƒƒãƒˆãŒè¡¨ã™ãƒãƒˆãƒ©ãƒ¼ã‚ªãƒ–ジェクト
 #  delay_time 行動ã¾ã§ã®å¾…ã¡æ™‚é–“
 #  forecast 行動ã®äºˆæƒ³ãƒ¦ãƒ‹ãƒƒãƒˆã‹ã©ã†ã‹ã®ãƒ•ãƒ©ã‚°
 #  skill スキルã®ç™ºå‹•å¾…ã¡ã‹ã©ã†ã‹ã®ãƒ•ãƒ©ã‚°
 #--------------------------------------------------------------------------
 def initialize(battler, delay_time, forecast = false, usable_item = nil, operate = false)
   @battler = battler
   @delay_time = delay_time
   @usable_item = usable_item
   @forecast = forecast
   @operate = operate
   @dest_x = 0
   @dest_y = 0
   @speed_y = 1
   @delay_time_decimal = 0
   @x = @dest_x
   @y = 0
   @targeted = false
   @selected = false
 end
 #--------------------------------------------------------------------------
 # ○ 座標を更新
 #--------------------------------------------------------------------------
 def update
   update_x
   update_y
 end
 #--------------------------------------------------------------------------
 # ○ x 座標を更新
 #--------------------------------------------------------------------------
 def update_x
   @x = @dest_x if (@dest_x - @x).abs < 4
   @x += 4 if @dest_x > @x
   @x -= 4 if @dest_x < @x
 end
 #--------------------------------------------------------------------------
 # ○ y 座標を更新
 #--------------------------------------------------------------------------
 def update_y
   if (@dest_y - @y).abs < 3
     @y = @dest_y
     @speed_y = 1
   else
     @speed_y = 3
   end
   @y += @speed_y if @dest_y > @y
   @y -= @speed_y if @dest_y < @y
 end
 #--------------------------------------------------------------------------
 # ○ キャンセル
 #--------------------------------------------------------------------------
 def cancel
   if @operate && @usable_item
     @operate = false
     remove_operate_state
     return true
   else
     return false
   end
 end
 #--------------------------------------------------------------------------
 # â—‹ キャンセルãƒã‚§ãƒƒã‚¯
 #--------------------------------------------------------------------------
 def cancel?
   return @battler.result.cancel
 end
 #--------------------------------------------------------------------------
 # â—‹ ä»–ã®ãƒ¦ãƒ‹ãƒƒãƒˆã¨å¾…ã¡æ™‚間を比較ã™ã‚‹ãŸã‚ã®å€¤ã‚’è¿”ã—ã¾ã™ã€‚
 #    ä»–ã®ãƒ¦ãƒ‹ãƒƒãƒˆåŒä¸€ã®å€¤ã ã¨ã€ã‚½ãƒ¼ãƒˆæ™‚ã«é †ç•ªãŒå…¥ã‚Œæ›¿ã‚ã‚‹ãŠãã‚ŒãŒã‚ã‚‹ã®ã§ã€
 #    ãƒãƒˆãƒ©ãƒ¼åˆ¥ã«è£œæ­£ã‚’掛ã‘ã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def delay_time_compare
   return -1 if @delay_time == 0 && @forecast #å³æ™‚効果
   return @delay_time * 10000 + delay_time_decimal
 end
 def delay_time_decimal
   return 4999 if @forecast
   return @delay_time_decimal
 end
 #--------------------------------------------------------------------------
 # â—‹ å¾…ã¡æ™‚間を設定
 #--------------------------------------------------------------------------
 def delay_time=(value)
   @delay_time = value.round
 end
 #--------------------------------------------------------------------------
 # ○ 順番を設定
 #--------------------------------------------------------------------------
 def index=(arg)
   @index = arg
   @dest_y = arg * Saba::Kiseki::UNIT_INTERVAL
   @dest_y += Saba::Kiseki::MARGIN_CURRENT_BOTTOM if @index > 0
   init_position if @x != 0
 end
 #--------------------------------------------------------------------------
 # â—‹ 座標をåˆæœŸåŒ–
 #--------------------------------------------------------------------------
 def init_position
   @y = @dest_y
 end
 #--------------------------------------------------------------------------
 # â—‹ å¾…ã¡æ™‚é–“ã«è‡ªå‹•ã§ã‹ã‹ã‚‹ã‚¹ãƒ†ãƒ¼ãƒˆã‚’設定
 #--------------------------------------------------------------------------
 def add_operate_state
   @usable_item.operate_states.each {|s|
     operate_state_targets.each { |b|
       b.add_state(s)
     }
   }
 end
 #--------------------------------------------------------------------------
 # â—‹ å¾…ã¡æ™‚é–“ã«è‡ªå‹•ã§ã‹ã‹ã‚‹ã‚¹ãƒ†ãƒ¼ãƒˆã‚’削除
 #--------------------------------------------------------------------------
 def remove_operate_state
   @usable_item.operate_states.each {|s| 
     operate_state_targets.each { |b|
       b.remove_state(s)
     }
   }
 end
 #--------------------------------------------------------------------------
 # â—‹ å¾…ã¡æ™‚é–“ã«è‡ªå‹•ã§ã‹ã‹ã‚‹ã‚¹ãƒ†ãƒ¼ãƒˆå¯¾è±¡ã‚’å–å¾—
 #--------------------------------------------------------------------------
 def operate_state_targets
   targets = []
   if @usable_item.operate_states_for_friends_all?
     targets += @battler.friends_unit.alive_members
   end 
   if @usable_item.operate_states_for_opponents_all?
     targets += @battler.opponents_unit.alive_members
   end
   targets = [@battler] if targets.empty?
   return targets
 end
 #--------------------------------------------------------------------------
 # â—‹ 攻撃対象をå–å¾—
 #--------------------------------------------------------------------------
 def targets
   return [] unless @operate
   battler.current_action.save_targets = true
   battler.current_action.make_targets
 end
end

class RPG::BaseItem
 #--------------------------------------------------------------------------
 # â—‹ 駆動時間ã®å–å¾—
 #--------------------------------------------------------------------------
 def operate_time(battler)
   operate_formula
   return 0 if @operate_formula == nil
   a = battler
   c = $game_variables
   return eval(@operate_formula).to_i
 end
 #--------------------------------------------------------------------------
 # â—‹ 駆動時間計算å¼ã®å–å¾—
 #--------------------------------------------------------------------------
 def operate_formula
   return @operate_formula if @get_operate_formula
   @get_operate_formula = true
   self.note.split(/[\r\n]+/).each do |line|
     if line.index("<charge>") == 0
       @operate_formula = line["<charge>".length..-1]
       return @operate_formula
     end
   end
   return nil if self.is_a?(RPG::State)
   @operate_formula = $data_skills[1].operate_formula
 end
 #--------------------------------------------------------------------------
 # â—‹ 硬直時間ã®å–å¾—
 #--------------------------------------------------------------------------
 def stiff_time(battler)
   stiff_formula
   return 0 if @stiff_formula == nil
   a = battler
   c = $game_variables
   return eval(@stiff_formula)
 end
 #--------------------------------------------------------------------------
 # â—‹ 硬直時間計算å¼ã®å–å¾—
 #--------------------------------------------------------------------------
 def stiff_formula
   return @stiff_formula if @get_stiff_formula
   @get_stiff_formula = true
   self.note.split(/[\r\n]+/).each do |line|
     if line.index("<delay>") == 0
       @stiff_formula = line["<delay>".length..-1]
       return @stiff_formula
     end
   end
   return nil if self.is_a?(RPG::State)
   @stiff_formula = $data_skills[1].stiff_formula
 end
 #--------------------------------------------------------------------------
 # â—‹ ディレイ攻撃ã‹ï¼Ÿ
 #--------------------------------------------------------------------------
 def delay_attack?
   return delay_formula != nil
 end
 #--------------------------------------------------------------------------
 # â—‹ ディレイ値ã®å–å¾—
 #--------------------------------------------------------------------------
 def delay_count(battler)
   delay_formula
   return 0 if @delay_formula == nil
   a = battler
   c = $game_variables
   ret = eval(@delay_formula)
   ret = 0 if rand(100)+1 > delay_percent(battler)
   return ret
 end
 #--------------------------------------------------------------------------
 # â—‹ ディレイ値計算å¼ã®å–å¾—
 #--------------------------------------------------------------------------
 def delay_formula
   return @delay_formula if @get_delay_formula
   @get_delay_formula = true
   self.note.split(/[\r\n]+/).each do |line|
     if line.index("<slow>") == 0
       @delay_formula = line["<slow>".length..-1]
       return @delay_formula
     end
     if line.index("<slow>") == 0
       @delay_formula = line["<slow>".length..-1]
       return @delay_formula
     end
   end
   @delay_formula = $data_skills[1].delay_formula
   return @delay_formula
 end
 #--------------------------------------------------------------------------
 # â—‹ ディレイ率ã®å–å¾—
 #--------------------------------------------------------------------------
 def delay_percent(battler)
   delay_percent_formula
   return 100 if @delay_percent_formula == nil
   a = battler
   c = $game_variables
   return eval(@delay_percent_formula)
 end
 #--------------------------------------------------------------------------
 # â—‹ ディレイ率計算å¼ã®å–å¾—
 #--------------------------------------------------------------------------
 def delay_percent_formula
   return @delay_percent_formula if @get_delay_percent_formula
   @get_delay_percent_formula = true
   self.note.split(/[\r\n]+/).each do |line|
     if line.index("<slowrate>") == 0
       @delay_percent_formula = line["<slowrate>".length..-1]
       return @delay_percent_formula
     end
   end
   return @delay_percent_formula
 end
 #--------------------------------------------------------------------------
 # â—‹ キャンセル攻撃ã‹ï¼Ÿ
 #--------------------------------------------------------------------------
 def cancel_attack?
   return note.include?("<cancel>")
 end
 #--------------------------------------------------------------------------
 # â—‹ キャンセル攻撃発動ã‹ï¼Ÿ
 #--------------------------------------------------------------------------
 def cancel?
   return false if rand(100)+1 >= cancel_percent
   return cancel_attack?
 end
 #--------------------------------------------------------------------------
 # â—‹ キャンセル率ã®å–å¾—
 #--------------------------------------------------------------------------
 def cancel_percent
   cancel_percent_formula
   return 100 if @cancel_percent_formula == nil
   c = $game_variables
   return eval(@cancel_percent_formula)
 end
 #--------------------------------------------------------------------------
 # â—‹ キャンセル率計算å¼ã®å–å¾—
 #--------------------------------------------------------------------------
 def cancel_percent_formula
   return @cancel_percent_formula if @get_cancel_percent_formula
   @get_cancel_percent_formula = true
   self.note.split(/[\r\n]+/).each do |line|
     if line.index("<cancelrate>") == 0
       @cancel_percent_formula = line["<cancelrate>".length..-1]
       return @cancel_percent_formula
     end
   end
   return @cancel_percent_formula
 end
 #--------------------------------------------------------------------------
 # â—‹ ディレイ無効ã‹ï¼Ÿ
 #--------------------------------------------------------------------------
 def anti_delay?
   return note.include?("<noslow>")
 end
 #--------------------------------------------------------------------------
 # â—‹ キャンセルä¸å¯ã‹ï¼Ÿ
 #--------------------------------------------------------------------------
 def anti_cancel?
   return note.include?("<nocancel>")
 end
 #--------------------------------------------------------------------------
 # â—‹ 駆動待ã¡ã«è‡ªå‹•ã§ã‹ã‹ã‚‹ã‚¹ãƒ†ãƒ¼ãƒˆãƒªã‚¹ãƒˆå–å¾—
 #--------------------------------------------------------------------------
 def operate_states
   return @operate_states if @operate_states
   self.note.split(/[\r\n]+/).each do |line|
     if line.index("<state>") == 0
       @operate_states = line["<state>".length..-1].split(",").collect { |s| s.to_i }
       return @operate_states
     end
   end
   @operate_states = []
   return @operate_states
 end
 #--------------------------------------------------------------------------
 # â—‹ 駆動待ã¡ã«è‡ªå‹•ã§ã‹ã‹ã‚‹ã‚¹ãƒ†ãƒ¼ãƒˆå¯¾è±¡ãŒå‘³æ–¹å…¨ä½“ã‚’å«ã‚€ã‹ï¼Ÿ
 #--------------------------------------------------------------------------
 def operate_states_for_opponents_all?
   self.note.split(/[\r\n]+/).each do |line|
     if line.index("<statescope>") == 0
       return line.include?("allenemies")
     end
   end
   return false
 end
 #--------------------------------------------------------------------------
 # â—‹ 駆動待ã¡ã«è‡ªå‹•ã§ã‹ã‹ã‚‹ã‚¹ãƒ†ãƒ¼ãƒˆå¯¾è±¡ãŒæ•µå…¨ä½“ã‚’å«ã‚€ã‹ï¼Ÿ
 #--------------------------------------------------------------------------
 def operate_states_for_friends_all?
   self.note.split(/[\r\n]+/).each do |line|
     if line.index("<statescope>") == 0
       return line.include?("allallies")
     end
   end
   return false
 end
 #--------------------------------------------------------------------------
 # â—‹ スキル準備メッセージå–å¾—
 #--------------------------------------------------------------------------
 def prepare_msg
   return @prepare_msg if @prepare_msg
   self.note.split(/[\r\n]+/).each do |line|
     if line.index("<chargemsg>") == 0
       @prepare_msg = line["<chargemsg>".length..-1]
       return @prepare_msg
     end
   end
   @prepare_msg = Saba::Kiseki::DEFAULT_PREPARE_MSG
   return @prepare_msg
 end
end

 

 

2. Main script #2: Turn Order Handler

 

#==============================================================================
# ■ Ao no Kiseki Custom Battle System 13_3 OrderManager
#   @version 0.23 12/01/28
#   @author Saba Kan
#   @translator kirinelf
#------------------------------------------------------------------------------
#  This is the module that handles the turn order.
#  No configuration needed.
#=========================================================================
# Do not edit anything under this line unless you know what you're doing!
#=========================================================================

module OrderManager

 #--------------------------------------------------------------------------
 # â—‹ オブジェクトåˆæœŸåŒ–
 #--------------------------------------------------------------------------
 def initialize
   init_unit
 end
 #--------------------------------------------------------------------------
 # â—‹ 先頭ã®ãƒ¦ãƒ‹ãƒƒãƒˆå–å¾—
 #--------------------------------------------------------------------------
 def self.top_unit
   return @top_unit
 end
 #--------------------------------------------------------------------------
 # â—‹ ユニットåˆæœŸåŒ–
 #--------------------------------------------------------------------------
 def self.init_unit
   @units = []
   for actor in $game_party.battle_members
     next if actor.dead?
     if BattleManager.preemptive
       delay_time = $data_skills[7].operate_time(actor)
     else
       delay_time = $data_skills[4].operate_time(actor)
     end
     @units.push(Game_BattleUnit.new(actor, delay_time))
   end
   for enemy in $game_troop.members
     if BattleManager.surprise
       delay_time = $data_skills[7].operate_time(enemy)
     else
       delay_time = $data_skills[4].operate_time(enemy)
     end
     @units.push(Game_BattleUnit.new(enemy, delay_time)) if enemy.alive?
   end
   sort
   update_top
   init_position
 end
 #--------------------------------------------------------------------------
 # â—‹ 座標をåˆæœŸåŒ–
 #--------------------------------------------------------------------------
 def self.init_position
   @top_unit.init_position
   @units.each { |unit| unit.init_position }
 end
 #--------------------------------------------------------------------------
 # ○ フレーム更新
 #--------------------------------------------------------------------------
 def self.update
   check_alive
   check_dead
   self.units.each { |unit| unit.update }
 end
 #--------------------------------------------------------------------------
 # â—‹ ãƒãƒˆãƒ©ãƒ¼ã®é…列を返ã—ã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def self.battlers
   @units.collect {|unit| unit.battler }.uniq
 end
 #--------------------------------------------------------------------------
 # â—‹ ユニットã®ç‚¹æ»…ã‚’åœæ­¢ã—ã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def self.clear_blink
   for unit in @units
     unit.blink = false
     unit.targeted = false
   end
 end
 #--------------------------------------------------------------------------
 # â—‹ 指定ã®ã‚­ãƒ£ãƒ©ã®æœ€å°ã•ã„ディレイコマ数をå–å¾—
 #--------------------------------------------------------------------------
 def self.min_delay_count(battler)
   unit = find_unit(battler)
   return -@units.index(unit)
 end
 #--------------------------------------------------------------------------
 # â—‹ 指定ã®ã‚­ãƒ£ãƒ©ã®æœ€å¤§ãƒ‡ã‚£ãƒ¬ã‚¤ã‚³ãƒžæ•°ã‚’å–å¾—
 #--------------------------------------------------------------------------
 def self.max_delay_count(battler)
   unit = find_unit(battler)
   return @units.size - @units.index(unit) - 1
 end
 #--------------------------------------------------------------------------
 # â—‹ 指定ã®ã‚­ãƒ£ãƒ©ã®å¾…ã¡æ™‚é–“ã«æŒ‡å®šã®å€¤ã‚’加ãˆã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def self.add_delay(battler, delay)
   unit = find_unit(battler)
   return unless unit
   unit.delay_time += delay if unit
   sort
   update_delay_time
 end
 #--------------------------------------------------------------------------
 # â—‹ 指定ã®ã‚­ãƒ£ãƒ©ã®ã‚¹ã‚­ãƒ«ç™ºå‹•å¾…ã¡ã‚’キャンセルã—ã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def self.cancel(unit)
   return false if unit == nil
   unit.cancel
   unit.delay_time = $data_skills[6].operate_time(unit.battler)
   sort
   update_delay_time
   return true
 end
 #--------------------------------------------------------------------------
 # â—‹ 先頭ユニットを削除ã—ã€æ¬¡ã®ãƒ¦ãƒ‹ãƒƒãƒˆã«å…¥ã‚Œæ›¿ãˆã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def self.update_top
   check_remove

   old = @top_unit
   @top_unit = @units[0]

   @units.delete(@top_unit)
   @top_unit.forecast = false
   @top_unit.delay_time_decimal = 99
   @units.each_with_index do |unit, i|
     unit.delay_time -= @top_unit.delay_time
     unit.forecast = false
   end
   @top_unit.delay_time = 0
   update_delay_time
 end
 #--------------------------------------------------------------------------
 # â—‹ 指定ã®ãƒãƒˆãƒ©ãƒ¼ã®ãƒ¦ãƒ‹ãƒƒãƒˆãŒå­˜åœ¨ã™ã‚‹ã‹ã‚’è¿”ã—ã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def self.contains?(battler)
   return find_unit(battler) != nil
 end
 #--------------------------------------------------------------------------
 # â—‹ ユニット内ã®ã‚­ãƒ£ãƒ©ã®æ­»äº¡ã‚’判定ã—ã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def self.check_dead
   for unit in @units.clone
     if  (unit.battler.dead? || unit.battler.hidden?)
       remove(unit.battler)
       next
     end
   end
 end
 #--------------------------------------------------------------------------
 # â—‹ ユニット内ã®æ­»äº¡ã—ãŸã‚­ãƒ£ãƒ©ã®å¾©æ´»ã‚’判定ã—ã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def self.check_alive
   for actor in $game_party.battle_members
     next if actor.dead?
     if find_unit(actor) == nil
       insert(actor, $data_skills[5].operate_time(actor))
     end
   end
   for actor in $game_troop.members
     next if actor.dead? || actor.hidden?
     if find_unit(actor) == nil
       insert(actor, $data_skills[5].operate_time(actor))
     end
   end
 end
 #--------------------------------------------------------------------------
 # â—‹ ユニット内ã®ãƒ‘ーティー抜ã‘を判定ã—ã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def self.check_remove
   for unit in @units.clone
    if unit.battler.actor?
       unless $game_party.battle_members.include?(unit.battler)
         remove(unit.battler)
         next
       end
     end
   end
 end
 #--------------------------------------------------------------------------
 # â—‹ 指定ã®ãƒãƒˆãƒ©ãƒ¼ã‚’ユニットã¨ã—ã¦è¿½åŠ ã—ã¾ã™ã€‚
 #  battler 追加ã™ã‚‹ãƒãƒˆãƒ©ãƒ¼
 #  delay_time å¾…ã¡æ™‚é–“
 #  forecast 行動順ã®äºˆæƒ³ãƒ¦ãƒ‹ãƒƒãƒˆã‹ã©ã†ã‹ã®ãƒ•ãƒ©ã‚°
 #  item å¾…ã¡æ™‚é–“ãŒå¿…è¦ãªã‚¢ã‚¤ãƒ†ãƒ 
 #--------------------------------------------------------------------------
 def self.insert(battler, delay_time, forecast = false, item = nil, operate = false)
   delay_time = delay_time.round
   unit = find_not_top_unit(battler)
   if unit
     update_unit(unit, delay_time, forecast, item, operate)
   else
     insert_new_unit(battler, delay_time, forecast, item, operate)
   end
   sort
   update_delay_time
 end
 #--------------------------------------------------------------------------
 # â—‹ ユニットã®çŠ¶æ…‹ã‚’æ›´æ–°
 #--------------------------------------------------------------------------
 def self.update_unit(unit, delay_time, forecast, item, operate)
   index = @units.index(unit)
   if forecast
     unit.delay_time = delay_time
   end
   unit.forecast = forecast
   unit.usable_item = item
   unit.operate = operate
 end
 #--------------------------------------------------------------------------
 # â—‹ æ–°ã—ã„ユニットを追加
 #--------------------------------------------------------------------------
 def self.insert_new_unit(battler, delay_time, forecast, item, operate)
   new_unit = Game_BattleUnit.new(battler, delay_time, forecast, item, operate)
   new_unit.x = Saba::Kiseki::INSERT_DISTANCE
   @units.push(new_unit)
 end
 #--------------------------------------------------------------------------
 # â—‹ å¾…ã¡æ™‚é–“ã‚’æ›´æ–°
 #--------------------------------------------------------------------------
 def self.update_delay_time
   @top_unit.index = 0 if @top_unit != nil
   @units.each_with_index do |unit, i|
     unit.index = i + 1
     unit.delay_time_decimal = i * 500 # é–“ã«ãƒ‡ã‚£ãƒ¬ã‚¤ã‚­ãƒ£ãƒ©ã‚’å·®ã—込むãŸã‚
   end
 end
 #--------------------------------------------------------------------------
 # â—‹ 先頭以外ã§æŒ‡å®šã®ãƒãƒˆãƒ©ãƒ¼ã‚’内部ã«æŒã¤ãƒ¦ãƒ‹ãƒƒãƒˆã‚’検索ã—ã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def self.find_not_top_unit(battler)
   return @units.reverse.select { |unit| unit.battler == battler}[0]
 end
 #--------------------------------------------------------------------------
 # â—‹ 指定ã®ãƒãƒˆãƒ©ãƒ¼ã‚’内部ã«æŒã¤ãƒ¦ãƒ‹ãƒƒãƒˆã‚’検索ã—ã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def self.find_unit(battler)
   return self.units.reverse.select { |unit| unit.battler == battler}[0]
 end
 #--------------------------------------------------------------------------
 # â—‹ 指定ã®ãƒãƒˆãƒ©ãƒ¼ã‚’内部ã«æŒã¤ãƒ¦ãƒ‹ãƒƒãƒˆã‚’削除ã—ã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def self.remove(battler)
   unit = find_unit(battler)
   return if unit == nil
   @units.delete(unit)
 end
 #--------------------------------------------------------------------------
 # â—‹ å…¨ã¦ã®ãƒ¦ãƒ‹ãƒƒãƒˆã‚’è¿”ã—ã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def self.units
   return ([@top_unit] + @units).compact
 end
 #--------------------------------------------------------------------------
 # â—‹ å…¨ã¦ã®ãƒ¦ãƒ‹ãƒƒãƒˆã‚’行動順ã«ä¸¦ã³æ›¿ãˆã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def self.sort
   @units.sort! { |a, b| a.delay_time_compare <=> b.delay_time_compare }
 end
 #--------------------------------------------------------------------------
 # â—‹ 指定ã®ãƒãƒˆãƒ©ãƒ¼ã‚’å«ã‚€ãƒ¦ãƒ‹ãƒƒãƒˆã‚’点滅
 #--------------------------------------------------------------------------
 def self.blink(battler, show_targeted = true)
   unit = find_unit(battler)
   return if unit == nil
   unit.blink = true
   show_target(battler) if show_targeted
 end
 #--------------------------------------------------------------------------
 # â—‹ 指定ã®ãƒãƒˆãƒ©ãƒ¼ã®æ”»æ’ƒç›®æ¨™ã‚’表示
 #--------------------------------------------------------------------------
 def self.show_target(battler)
   for unit in @units.reverse
     unit.targeted = battler.target?(unit.battler)
   end
 end
 #--------------------------------------------------------------------------
 # â—‹ 指定ã®ãƒãƒˆãƒ©ãƒ¼ã®é †ç•ªã‚’é…らã›ã‚‹ã€‚
 #--------------------------------------------------------------------------
 def self.delay_order(battler, value)
   unit = find_unit(battler)

   return unless unit

   if value > 0
     target = find_next_unit(unit, value)
     unit.delay_time_decimal = target.delay_time_decimal + 1 + unit.delay_time_decimal / 500
     unit.delay_time = target.delay_time 
   else
     target = find_prev_unit(unit, value)
     return if target == nil
     unit.delay_time = target.delay_time 
     unit.delay_time_decimal = target.delay_time_decimal - 1
   end
   sort
 end
 #--------------------------------------------------------------------------
 # â—‹ 指定ã®ãƒ¦ãƒ‹ãƒƒãƒˆã®value後ã‚ã®ãƒ¦ãƒ‹ãƒƒãƒˆã‚’è¿”ã™
 #    è¿”ã•ã‚Œã‚‹ãƒ¦ãƒ‹ãƒƒãƒˆã¯ delay_count ㌠0 ã®ã‚‚ã®ã«é™ã‚‹
 #--------------------------------------------------------------------------
 def self.find_next_unit(unit, value)
   index = @units.index(unit) + value
   begin
     target = @units[index]
     index += 1
     return last_unit if target == nil
   end while target.battler.result.delay_count != 0
   return target
 end
 #--------------------------------------------------------------------------
 # â—‹ 指定ã®ãƒ¦ãƒ‹ãƒƒãƒˆã®valueå‰ã®ãƒ¦ãƒ‹ãƒƒãƒˆã‚’è¿”ã™
 #    è¿”ã•ã‚Œã‚‹ãƒ¦ãƒ‹ãƒƒãƒˆã¯ delay_count ㌠0 ã®ã‚‚ã®ã«é™ã‚‹
 #--------------------------------------------------------------------------
 def self.find_prev_unit(unit, value)
   index = @units.index(unit) + value
   begin
     return top_unit if index < 0
     target = @units[index]
     index -= 1
     return top_unit if target == nil
   end while target.battler.result.delay_count != 0
   return target
 end
 #--------------------------------------------------------------------------
 # â—‹ 行動予想ã®ãƒžãƒ¼ã‚¯ã‚’削除
 #--------------------------------------------------------------------------
 def self.clear_forecast
   @units.each {|unit| unit.forecast = false }
 end
 #--------------------------------------------------------------------------
 # â—‹ 行動予想ã®ãƒ¦ãƒ‹ãƒƒãƒˆã‚’è¿”ã™
 #--------------------------------------------------------------------------
 def self.forecast_unit
   @units.each {|unit| return unit if unit.forecast }
   return nil
 end
 #--------------------------------------------------------------------------
 # â—‹ 行動予想ã®ãƒ¦ãƒ‹ãƒƒãƒˆã‚’削除
 #--------------------------------------------------------------------------
 def self.remove_forecast_unit
   @units.delete_if {|unit| unit.forecast }
   update_delay_time
 end
 #--------------------------------------------------------------------------
 # â—‹ 指定ã®ãƒ¦ãƒ‹ãƒƒãƒˆã‚’é¸æŠž
 #--------------------------------------------------------------------------
 def self.select(battler)
   clear_selection
   return unless find_unit(battler)
   find_unit(battler).selected = true
   show_targeted(battler)
 end
 #--------------------------------------------------------------------------
 # â—‹ 攻撃対象ã®ãƒ¦ãƒ‹ãƒƒãƒˆã‚’表示
 #--------------------------------------------------------------------------
 def self.show_targeted(battler)
   return if battler.actor?
   unit = find_unit(battler)
   return unless unit
   unit.targets.each do |b|
     next unless find_unit(
     find_unit(.targeted = true
   end
 end
 #--------------------------------------------------------------------------
 # â—‹ é¸æŠžçŠ¶æ…‹ã‚’クリア
 #--------------------------------------------------------------------------
 def self.clear_selection
   @top_unit.selected = false
   @top_unit.targeted = false
   @units.each {|unit| unit.selected = false; unit.targeted = false }
 end
 #--------------------------------------------------------------------------
 # â—‹ 一番最後ã®ãƒ¦ãƒ‹ãƒƒãƒˆã‚’è¿”ã—ã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def self.last_unit
   return @units[-1]
 end
end

 

 

3. Main script #3: Display Configuration

 

#==============================================================================
# ■ Ao no Kiseki Custom Battle System 13_2 Display Configuration
#   @version 0.22 12/01/27
#   @author Saba Kan
#   @translator kirinelf
#------------------------------------------------------------------------------
#  This is where you can edit the various display options.
#==============================================================================
module Saba
 module Kiseki
   # The number of pixels from the left border to place the order bar. 
   MARGIN_LEFT = 10

   # The number of pixels from the top border to place the order bar. 
   MARGIN_TOP = 10

   # Margins between the current active unit and the next unit in the order bar.
   MARGIN_CURRENT_BOTTOM = 10

   # Margins between units in the order bar.
   UNIT_INTERVAL = 32

   # Number of pixels to the right units are placed during turn order previews.
   INSERT_DISTANCE = 32

   # What to display on the order bar for delay during actor's turn.
   # 0: Shows the text: DELAY
   # 1: Clock Icon
   DELAY_DISPLAY_TYPE = 0

   # Height of the order bar in pixels.
   ORDER_BAR_HEIGHT = 460

   # Cancel Messages
   CANCEL_MSG         = "%s's %s has been interrupted!"
   FAIL_CANCEL_MSG    = "%s's %s hasn't been interrupted."
   ANTI_CANCEL_MSG    = "%s's %s can't be interrupted."

   # Delay Messages
   DELAY_ENEMY_MSG    =  "%s has been delayed %s turns!"
   DELAY_ACTOR_MSG    =  "%s has been delayed %s turns!"
   HASTE_ENEMY_MSG    =  "%s has sped up %s turns!"
   HASTE_ACTOR_MSG    =  "%s has sped up %s turns!"
   ANTI_DELAY_MSG     =  "%s can't be delayed."
   FAIL_DELAY_MSG     =  "%s wasn't delayed."
 end
end

#=========================================================================
# Do not edit anything under this line unless you know what you're doing!
#=========================================================================

#==============================================================================
# â–  Spriteset_BattleUnit
#------------------------------------------------------------------------------
#  画é¢å·¦ã®å¾…ã¡æ™‚é–“ãƒãƒ¼ä¸Šã«è¡¨ç¤ºã™ã‚‹ãƒ¦ãƒ‹ãƒƒãƒˆã§ã™
#==============================================================================

class Spriteset_BattleUnit
 include Saba::Kiseki

 TARGET_ENEMY_COLOR = Color.new(255, 0, 0, 255)
 TARGET_ACTOR_COLOR = Color.new(0, 0, 255, 255)
 #--------------------------------------------------------------------------
 # â—‹ オブジェクトåˆæœŸåŒ–
 #--------------------------------------------------------------------------
 def initialize(viewport, unit)
   super
   @viewport = viewport 
   @unit = unit
   @battler = unit.battler
   @forecast = false

   @layers = []

   create_bg_layer
   create_char_layer
   create_char_select_layer
   create_marker_layer
   create_targeted_layer
   create_arrow_layer
 end
 #--------------------------------------------------------------------------
 # â—‹ 背景レイヤã®ä½œæˆ
 #--------------------------------------------------------------------------
 def create_bg_layer
   @bg_layer = Sprite_Base.new(@viewport)
   @bg_layer.bitmap = Bitmap.new(64, 64)
   if @battler.actor?
     border = Cache.system("UnitBorder")
   else
     border = Cache.system("UnitBorder2")
   end
   @bg_layer.bitmap.blt(0, 0, border, border.rect)
   @bg_layer.z = 1

   @layers.push(@bg_layer)
 end
 #--------------------------------------------------------------------------
 # â—‹ キャラレイヤã®ä½œæˆ
 #--------------------------------------------------------------------------
 def create_char_layer
   @char_layer = Sprite_Base.new(@viewport)
   @char_layer.bitmap = Bitmap.new(32, 32)
   @char_layer.z = 2
   init_graphic
   draw_character(@char_layer, @graphic_name, @graphic_index)
   @layers.push(@char_layer)
 end
 #--------------------------------------------------------------------------
 # â—‹ キャラé¸æŠžãƒ¬ã‚¤ãƒ¤ã®ä½œæˆ
 #--------------------------------------------------------------------------
 def create_char_select_layer
   @char_select_layer = Sprite_Base.new(@viewport)
   @char_select_layer.bitmap = Bitmap.new(32, 32)
   @char_select_layer.z = 3
   draw_character(@char_select_layer, @graphic_name, @graphic_index)
   @char_select_layer.blend_type = 1
   if @battler.actor?
     @char_select_layer.color = TARGET_ACTOR_COLOR
   else
     @char_select_layer.color = TARGET_ENEMY_COLOR
   end
   @layers.push(@char_select_layer)
 end
 #--------------------------------------------------------------------------
 # â—‹ マーカーレイヤã®ä½œæˆ
 #--------------------------------------------------------------------------
 def create_marker_layer
   @marker_layer = Sprite_Base.new(@viewport)
   @marker_layer.bitmap = Bitmap.new(32, 32)
   @marker_layer.z = 4
   marker = Cache.system("ActionMarker")
   @marker_layer.bitmap.blt(0, 0, marker, marker.rect)
   @marker_layer.visible = false
   @layers.push(@marker_layer)
 end
 #--------------------------------------------------------------------------
 # â—‹ 駆動ã®å¯¾è±¡ãƒ¬ã‚¤ãƒ¤ã®ä½œæˆ
 #--------------------------------------------------------------------------
 def create_targeted_layer
   @targeted_layer = Sprite_Base.new(@viewport)
   @targeted_layer.bitmap = Bitmap.new(32, 32)
   @targeted_layer.z = 5
   marker = Cache.system("Targeted")
   @targeted_layer.bitmap.blt(0, 0, marker, marker.rect)
   @targeted_layer.visible = false
   @layers.push(@targeted_layer)
 end
 #--------------------------------------------------------------------------
 # â—‹ 矢å°ãƒ¬ã‚¤ãƒ¤ã®ä½œæˆ
 #--------------------------------------------------------------------------
 def create_arrow_layer
   @arrow_layer = Sprite_Base.new(@viewport)
   @arrow_layer.bitmap = Bitmap.new(64, 32)
   @arrow_layer.z = 6
   arrow = Cache.system("ForecastArrow")
   @arrow_layer.bitmap.blt(0, 0, arrow, arrow.rect)
   @layers.push(@arrow_layer)

   @arrow_index = 12
 end
 #--------------------------------------------------------------------------
 # ○ 解放
 #--------------------------------------------------------------------------
 def dispose
   @layers.each do |layer|
     layer.bitmap.dispose
     layer.dispose
   end

   @forecast_sprite.dispose if @forecast_sprite
 end
 #--------------------------------------------------------------------------
 # ○ フレーム更新
 #--------------------------------------------------------------------------
 def update
   x = @unit.x + MARGIN_LEFT
   y = @unit.y + MARGIN_TOP

   @layers.each do |layer|
     layer.x = x
     layer.y = y
     layer.update
   end

   @arrow_layer.x += @arrow_index
   @arrow_layer.visible = @unit.forecast
   @arrow_index -= 0.25
   @arrow_index = 12 if @arrow_index == 0

   @char_select_layer.visible = @unit.selected
   @marker_layer.visible = @unit.operate
   @targeted_layer.visible = @unit.targeted

   update_forecast
   update_opacity
 end
 #--------------------------------------------------------------------------
 # â—‹ 使用ã™ã‚‹ã‚°ãƒ©ãƒ•ã‚£ãƒƒã‚¯ã‚’決定ã—ã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def init_graphic
   if @battler.actor?
     @graphic_name = @battler.character_name
     @graphic_index = @battler.character_index
   else
     @graphic_name = enemy_graphic_name
     @graphic_index = enemy_graphic_index
   end
 end
 #--------------------------------------------------------------------------
 # ○ 行動予測を更新
 #--------------------------------------------------------------------------
 def update_forecast
   if @forecast_sprite
     @forecast_sprite.update 
     @forecast_sprite.visible = BattleManager.phase == :input
   end
   return if @forecast == @unit.forecast

   if @unit.forecast
     @forecast_sprite = Sprite_Forecast.new(@viewport, @unit)
   else
     @forecast_sprite.dispose
     @forecast_sprite = nil
   end
   @forecast = @unit.forecast
 end
 #--------------------------------------------------------------------------
 # â—‹ キャラクターグラフィックをæç”»ã—ã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def draw_character(layer, character_name, character_index)
   bitmap = Cache.character(character_name)
   sign = character_name[/^[\!\$]./]
   if sign && sign.include?('$')
     cw = bitmap.width / 3
     ch = bitmap.height / 4
   else
     cw = bitmap.width / 12
     ch = bitmap.height / 8
   end
   n = character_index
   src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
   layer.bitmap.blt(0, 0, bitmap, src_rect)
 end
 #--------------------------------------------------------------------------
 # â—‹ 行動待ã¡ãƒžãƒ¼ã‚«ãƒ¼ã‚’æç”»ã—ã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def draw_action_marker
   bitmap = Cache.system("ActionMarker")
   @char_layer.bitmap.blt(0, 0, bitmap, bitmap.rect)
 end
 #--------------------------------------------------------------------------
 # â—‹ é€æ˜Žåº¦ã‚’æ›´æ–°ã—ã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def update_opacity
   opacity  = 255 - @unit.x * 8
   @arrow_layer.opacity = opacity
   @bg_layer.opacity    = opacity
   @char_layer.opacity  = opacity
   @forecast_sprite.opacity    = opacity if @forecast_sprite
 end
 #--------------------------------------------------------------------------
 # â—‹ ãƒãƒˆãƒ©ãƒ¼ãŒæ•µã‚¨ãƒãƒŸãƒ¼ã®å ´åˆã€ä½¿ç”¨ã™ã‚‹ã‚°ãƒ©ãƒ•ã‚£ãƒƒã‚¯åã‚’åˆæœŸåŒ–ã—ã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def enemy_graphic_name
   marker = Saba::Kiseki::GRAPHIC_MARKER
   graphic = get_ex_value_with_index(@battler.enemy, marker, 0)
   if graphic == nil
     return Saba::Kiseki::DEFAULT_MONSTER_GRAPHIC_NAME
   else
     return graphic
   end
 end
 #--------------------------------------------------------------------------
 # â—‹ ãƒãƒˆãƒ©ãƒ¼ãŒæ•µã‚¨ãƒãƒŸãƒ¼ã®å ´åˆã€ä½¿ç”¨ã™ã‚‹ã‚°ãƒ©ãƒ•ã‚£ãƒƒã‚¯å†…ã®ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ã‚’åˆæœŸåŒ–ã—ã¾ã™ã€‚
 #--------------------------------------------------------------------------
 def enemy_graphic_index
   marker = Saba::Kiseki::GRAPHIC_MARKER
   index = get_ex_value_with_index(@battler.enemy, marker, 1)
   if index == nil
     return Saba::Kiseki::DEFAULT_MONSTER_GRAPHIC_INDEX
   else
     return index.to_i
   end
 end
 def get_ex_value_with_index(item, name, index)
   item.note.split(/[\r\n]+/).each do |line|
   elements = line.split(/\s+/)
     next if elements.size <= index + 1
     next unless elements[0] == name
     return elements[index + 1]
   end
   return nil
 end
end


#==============================================================================
# â–  Sprite_Forecast
#------------------------------------------------------------------------------
#  待ã¡æ™‚間表示ã§ã™ã€‚Delay XX ã¨ã„ã†ã‚ã‚Œ
#==============================================================================

class Sprite_Forecast < Sprite_Base
 include Saba::Kiseki
 #--------------------------------------------------------------------------
 # ◠オブジェクトåˆæœŸåŒ–
 #--------------------------------------------------------------------------
 def initialize(viewport, unit)
   super(viewport)
   @unit = unit
   self.bitmap = Bitmap.new(120, 50)
   @anime_index = 0
   @wait_count = 0
   refresh
   update
   self.z = 5
 end
 def refresh
   self.bitmap.clear

   if DELAY_DISPLAY_TYPE == 0
     delay = Cache.system("Delay")
     self.bitmap.font.size = 20
     self.bitmap.blt(0, 0, delay, delay.rect)
     self.bitmap.draw_text(41, 6, 58, 24, @unit.delay_time.to_s, 1)
   else
     delay = Cache.system("Delay2")
     self.bitmap.font.size = 20
     self.bitmap.blt(0, 0, delay, delay.rect)
     clock = Cache.system("icon_clock")
     x = @anime_index % 4 * clock.width / 4
     y = @anime_index / 4 * clock.height / 2

     rect = Rect.new(x, y, clock.width / 4, clock.height / 2)
     self.bitmap.blt(3, 3, clock, rect)
     self.bitmap.draw_text(14, 5, 58, 22, @unit.delay_time.to_s, 1)
   end
 end
 #--------------------------------------------------------------------------
 # ◠解放
 #--------------------------------------------------------------------------
 def dispose
   self.bitmap.dispose
   super
 end
 #--------------------------------------------------------------------------
 # ◠フレーム更新
 #--------------------------------------------------------------------------
 def update
   super
   self.x = @unit.x + Saba::Kiseki::MARGIN_LEFT + 45
   self.y = @unit.y + Saba::Kiseki::MARGIN_TOP
   next_anime
 end
 def next_anime
   @wait_count += 1
   if @wait_count > 6
     @anime_index += 1
     @anime_index = 0 if @anime_index == 8
     @wait_count = 0
     refresh
   end
 end
end



#==============================================================================
# â–  Spriteset_Kiseki
#------------------------------------------------------------------------------
#  待ã¡æ™‚é–“ãƒãƒ¼ã®èƒŒæ™¯ã‚„ã€å…ˆé ­ã‚­ãƒ£ãƒ©ã®æž ãªã©
#==============================================================================

class Spriteset_Kiseki
 include Saba::Kiseki
 #--------------------------------------------------------------------------
 # â—‹ オブジェクトåˆæœŸåŒ–
 #--------------------------------------------------------------------------
 def initialize(viewport)
   super
   @bg_layer = Sprite_Base.new(viewport)
   @bg_layer.bitmap = Cache.system("OrderLine")
   @bg_layer.z = 0
   @bg_layer.x = 10
   @bg_layer.src_rect.height = ORDER_BAR_HEIGHT

   @window_layer = Sprite_Base.new(viewport)
   @window_layer.bitmap = Cache.system("ActiveWindow")
   @window_layer.z = 7
   @window_layer.x = 2
   @window_layer.y = 3
 end
 #--------------------------------------------------------------------------
 # ○ 解放
 #--------------------------------------------------------------------------
 def dispose
   @bg_layer.dispose
   @window_layer.dispose
 end
 #--------------------------------------------------------------------------
 # ○ フレーム更新
 #--------------------------------------------------------------------------
 def update
   @bg_layer.update
   @window_layer.update
 end
end



class Window_BattleLog
 include Saba::Kiseki
   #--------------------------------------------------------------------------
 # ◠失敗ã®è¡¨ç¤º
 #--------------------------------------------------------------------------
 alias saba_kiseki_battle_display_failure display_failure
 def display_failure(target, item)
   if target.result.hit? && !target.result.success
     saba_kiseki_battle_display_failure(target, item)
   end
   display_cancel(target, item)
   display_delay(target, item)
 end
 #--------------------------------------------------------------------------
 # â—‹ アイテム準備ã®è¡¨ç¤º
 #--------------------------------------------------------------------------
 def display_prepare_item(target, item)
   text = sprintf(item.prepare_msg, target.name, item.name)
   add_text(text)
   wait
   wait
   wait
 end
 #--------------------------------------------------------------------------
 # â—‹ キャンセルã®è¡¨ç¤º
 #--------------------------------------------------------------------------
 def display_cancel(target, item)
   unit = OrderManager.find_unit(target)
   return unless unit
   usable_item = unit.usable_item
   return if usable_item == nil
   if target.result.cancel
     return unless CANCEL_MSG
     text = sprintf(CANCEL_MSG, target.name, usable_item.name)
     add_text(text)
     wait
   elsif target.result.fail_cancel
     return unless FAIL_CANCEL_MSG
     text = sprintf(FAIL_CANCEL_MSG, target.name, usable_item.name)
     add_text(text)
     wait
   elsif target.result.anti_cancel
     return unless ANTI_CANCEL_MSG
     text = sprintf(ANTI_CANCEL_MSG, target.name, usable_item.name)
     add_text(text)
     wait
   end
 end
 #--------------------------------------------------------------------------
 # â—‹ ディレイã®è¡¨ç¤º
 #--------------------------------------------------------------------------
 def display_delay(target, item)
   delay = target.result.delay_count
   if delay > 0
     if target.actor?
       return unless DELAY_ACTOR_MSG
       text = sprintf(DELAY_ACTOR_MSG, target.name, delay.to_s)
     else
       return unless DELAY_ENEMY_MSG
       text = sprintf(DELAY_ENEMY_MSG, target.name, delay.to_s)
     end
     add_text(text)
     wait
   elsif delay < 0
     if target.actor?
       return unless HASTE_ACTOR_MSG
       text = sprintf(HASTE_ACTOR_MSG, target.name, delay.abs.to_s)
     else
       return unless HASTE_ENEMY_MSG
       text = sprintf(HASTE_ENEMY_MSG, target.name, delay.abs.to_s)
     end
     add_text(text)
     wait
   elsif target.result.fail_delay
     return unless FAIL_DELAY_MSG
     text = sprintf(FAIL_DELAY_MSG, target.name)
     add_text(text)
     wait
   elsif target.result.anti_delay
     return unless ANTI_DELAY_MSG
     text = sprintf(ANTI_DELAY_MSG, target.name)
     add_text(text)
     wait
   end
 end
end

 

 

4. Sub script #1: Escape Command

 

#==============================================================================
# ■ Ao no Kiseki Custom Battle System 13_2 Escape Command
#   @version 1 12/01/27
#   @author Saba Kan
#   @translator kirinelf
#------------------------------------------------------------------------------
#  Adds the Escape command to the system. 
#  No configuration needed.
#=========================================================================
# Do not edit anything under this line unless you know what you're doing!
#=========================================================================

class Scene_Battle
 #--------------------------------------------------------------------------
 # ◠アクターコマンドウィンドウã®ä½œæˆ
 #--------------------------------------------------------------------------
 alias saba_kiseki_escape_create_actor_command_window create_actor_command_window
 def create_actor_command_window
   saba_kiseki_escape_create_actor_command_window
   @actor_command_window.set_handler(:escape, method(:command_escape))
 end
end

class Window_ActorCommand
 #--------------------------------------------------------------------------
 # ◠コマンドリストã®ä½œæˆ
 #--------------------------------------------------------------------------
 alias saba_kiseki_escape_make_command_list make_command_list
 def make_command_list
   saba_kiseki_escape_make_command_list
   add_command(Vocab::escape, :escape, BattleManager.can_escape?)
 end
end

 

 

5. sub script #2: Window Modification

 

#==============================================================================
# ■ Ao no Kiseki Custom Battle System 13_2 Window Size Adjustment
#   @version 1 12/01/27
#   @author Saba Kan
#   @translator kirinelf
#------------------------------------------------------------------------------
#  No configuration needed.
#=========================================================================
# Do not edit anything under this line unless you know what you're doing!
#=========================================================================

class Window_BattleLog < Window_Selectable
 #--------------------------------------------------------------------------
 # ◠オブジェクトåˆæœŸåŒ–
 #--------------------------------------------------------------------------
 def initialize
   super(80, 0, window_width - 80, window_height)
   self.z = 200
   self.opacity = 0
   @lines = []
   @num_wait = 0
   create_back_bitmap
   create_back_sprite
   refresh
 end
 #--------------------------------------------------------------------------
 # ◠背景ã®çŸ©å½¢ã‚’å–å¾—
 #--------------------------------------------------------------------------
 def back_rect
   Rect.new(80, padding, width, line_number * line_height)
 end
end

class Scene_Battle
 #--------------------------------------------------------------------------
 # ◠ヘルプウィンドウã®ä½œæˆ
 #--------------------------------------------------------------------------
 def create_help_window
   @help_window = Window_BattleHelp.new
   @help_window.visible = false
 end
end

class Window_BattleHelp < Window_Base
 #--------------------------------------------------------------------------
 # ◠オブジェクトåˆæœŸåŒ–
 #--------------------------------------------------------------------------
 def initialize(line_number = 2)
   super(160, 0, Graphics.width - 160, fitting_height(line_number))
 end
   #--------------------------------------------------------------------------
 # ◠テキスト設定
 #--------------------------------------------------------------------------
 def set_text(text)
   if text != @text
     @text = text
     refresh
   end
 end
 #--------------------------------------------------------------------------
 # ◠クリア
 #--------------------------------------------------------------------------
 def clear
   set_text("")
 end
 #--------------------------------------------------------------------------
 # ◠アイテム設定
 #     item : スキルã€ã‚¢ã‚¤ãƒ†ãƒ ç­‰
 #--------------------------------------------------------------------------
 def set_item(item)
   set_text(item ? item.description : "")
 end
 #--------------------------------------------------------------------------
 # ◠リフレッシュ
 #--------------------------------------------------------------------------
 def refresh
   contents.clear
   draw_text_ex(4, 0, @text)
 end
end

class Window_BattleSkill
 #--------------------------------------------------------------------------
 # ◠オブジェクトåˆæœŸåŒ–
 #     info_viewport : 情報表示用ビューãƒãƒ¼ãƒˆ
 #--------------------------------------------------------------------------
 def initialize(help_window, info_viewport)
   y = help_window.height + 4
   super(160, y, Graphics.width - 160, info_viewport.rect.y - y - 4)
   self.visible = false
   @help_window = help_window
   @info_viewport = info_viewport
 end
end

class Window_BattleItem
 #--------------------------------------------------------------------------
 # ◠オブジェクトåˆæœŸåŒ–
 #     info_viewport : 情報表示用ビューãƒãƒ¼ãƒˆ
 #--------------------------------------------------------------------------
 def initialize(help_window, info_viewport)
   y = help_window.height + 4
   super(160, y, Graphics.width - 160, info_viewport.rect.y - y - 4)
   self.visible = false
   @help_window = help_window
   @info_viewport = info_viewport
 end
end

 

 

6. Sub script #3: AT Bonus

 

Now, this is an interesting beast. This script is not by Saba Kan, but by Rokan. Here are his T&Cs in a spoiler, to prove that I'm allowed to do this:

 

Terms and Conditions on his site:

 

  • RGSS2: You must be a registered user of RPG Maker VX.
  • RGSS3: You must be a registered user of RPG Maker VX Ace.
  • Photos: Feel free to use as you please.
  • Modifications are allowed freely.
  • Redistribution of original materials is forbidden; allowed after modification.
  • I am not responsible for any damage or ill events that arise from using my materials.
  • Please backup your work before use.
  • Please read through all the instructions.
  • Free for commercial use.
  • Credits and reporting usages are not necessary.
  • No requests accepted.
  • All support and/or bug reports are to be done in public on my site.
  • Please use common sense.

 

Linkback:

att4iv.jpg

 

回想領域 - Kaisou-Ryouiki

Reflection Domain

 

Webmaster: Rokan

 

 

And here's the script:

 

 

=begin
     ★ Ao no Kiseki Custom Battle System - AT Bonus Plugin - ★

     Adds AT bonuses to the Ao no Kiseki Custom Battle System.
     Please place the Bonus graphics in the Graphics/System folder. 

     â— Bonuses â—======================================================
     There are nine possible bonuses, randomly selected. They are:

     --------------------------------------------------------------------
     Recover 10% HP at start of turn. 
     --------------------------------------------------------------------
     Recover 50% HP at start of turn. 
     --------------------------------------------------------------------
     Recover 10% MP at start of turn. 
     --------------------------------------------------------------------
     Recover 50% MP at start of turn. 
     --------------------------------------------------------------------
     Recover 10% TP at start of turn. 
     --------------------------------------------------------------------
     Recover 50% TP at start of turn. 
     --------------------------------------------------------------------
     Critical (All damage/healing effectiveness is multipled by 1.5)
     --------------------------------------------------------------------
     Perfect Guard (Cannot be damaged, Cannot be healed, No Cancel, State Immunity, No Slow)
     --------------------------------------------------------------------
     Rush (Act twice in a row)
     ====================================================================

     â— Note â—========================================================
     This script was developed for the Ao no Kiseki Custom Battle System. 
     Please contact PetitCure or Saba Kan for any queries regarding the system.
     ====================================================================

     ※ The Ao no Kiseki Custom Battle System is still a work in progress. 
         Therefore, this script may change or become obselete in the future. 

     ver0.11

     Last Update : 2012/01/24
     01/24 : Added Critical Bonus text.
     01/07 : Released to the public. 

     Made for Saba Kan of http://petitrare.com/blog/
     Written by Rokan of http://kaisou-ryouiki.sakura.ne.jp/
  Translated by kirinelf
=end

#===================================
#  â— Configuration Block
#===================================
module Rokan
module Kiseki_Plugin
 # The variable that determines the rate of activation of the bonuses. 
 BCV = 10

 #-----------------------------------------------------------------------------
 # The following section determines the activate rate of the bonuses.
 # If 0, that bonus will not activate. All rates are relative to each other.
 # Actual rate = (Rate)/(Total Rate)*100
 #
 # (For example. At BOP=0, there's a roughly 77% chance of there being no bonuses,
 #  about 4% chances of there being 10% heals of HP, MP and TP, and about 1.5% 
 # chances of Critical, Perfect Guard and Rush) (Total rate = 130, sum of all rates)
 #-----------------------------------------------------------------------------
 # Variable Value => 
 #   [No Bonus, 10% HP, 50% HP, 10% MP, 50% MP, 
 #                       10 TP, 50 TP, Critical, Perfect Guard, Rush],
 #-----------------------------------------------------------------------------
 BOP = { # No touchie.

   -1 => [  1,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    0 => [100,  5,  3,  5,  3,  5,  3,  2,  2,  2],
    1 => [ 90,  3,  0,  3,  0,  3,  0,  2,  0,  0],

    } # Do not remove this. 

 # Text that shows up when you get a critical bonus. 
 CriticalBonusText = "Critical Bonus!"
end
end

#=========================================================================
# Do not edit anything under this line unless you know what you're doing!
#=========================================================================

$rsi ||= {}
$rsi["空ã®è»Œè·¡_ATボーナス"] = true

class RPG::UsableItem
 #--------------------------------------------------------------------------
 # ◠駆動時間ã®å–å¾—
 #--------------------------------------------------------------------------
 alias _kiseki_bonus_operate_time operate_time
 def operate_time(battler)
   if BonusManager.rash?
     0
   else
     _kiseki_bonus_operate_time(battler)
   end
 end
 #--------------------------------------------------------------------------
 # ◠硬直時間ã®å–å¾—
 #--------------------------------------------------------------------------
 alias _kiseki_bonus_stiff_time stiff_time
 def stiff_time(battler)
   if BonusManager.rash?
     0
   else
     _kiseki_bonus_stiff_time(battler)
   end
 end
end

class << BattleManager
 #--------------------------------------------------------------------------
 # ◠セットアップ
 #--------------------------------------------------------------------------
 alias _kiseki_bonus_setup setup
 def setup(troop_id, can_escape = true, can_lose = false)
   _kiseki_bonus_setup(troop_id, can_escape, can_lose)
   setup_bonus
 end
 #--------------------------------------------------------------------------
 # ◠ボーナスã®ã‚»ãƒƒãƒˆã‚¢ãƒƒãƒ—
 #--------------------------------------------------------------------------
 def setup_bonus
   BonusManager.clear
   BonusManager.init_bonus
 end
end

class << OrderManager
 #--------------------------------------------------------------------------
 # ◠先頭ユニットを削除ã—ã€æ¬¡ã®ãƒ¦ãƒ‹ãƒƒãƒˆã«å…¥ã‚Œæ›¿ãˆã¾ã™ã€‚
 #--------------------------------------------------------------------------
 alias _kiseki_bonus_update_top update_top
 def update_top
   BonusManager.next_bonus
   _kiseki_bonus_update_top
 end
 #--------------------------------------------------------------------------
 # ◠指定ã®ãƒãƒˆãƒ©ãƒ¼ã®é †ç•ªã‚’é…らã›ã‚‹ã€‚
 #--------------------------------------------------------------------------
 alias _kiseki_bonus_delay_order delay_order
 def delay_order(battler, value)
   _kiseki_bonus_delay_order(battler, value) unless BonusManager.full_guard?
 end
end

module BonusManager
 module_function
 include Rokan::Kiseki_Plugin
 #--------------------------------------------------------------------------
 # ◠オブジェクトåˆæœŸåŒ–
 #--------------------------------------------------------------------------
 def init_manager
   @rate_list = []
   @bonus_list = []
   clear
 end
 #--------------------------------------------------------------------------
 # ◠クリア
 #--------------------------------------------------------------------------
 def clear
   @rate_list.clear
   @bonus_list.clear
   @sprites_listener = nil
 end
 #--------------------------------------------------------------------------
 # ◠クリティカル判定
 #--------------------------------------------------------------------------
 def critical?
   get_bonus == 6 && $game_party.in_battle
 end
 #--------------------------------------------------------------------------
 # ◠完全防御判定
 #--------------------------------------------------------------------------
 def full_guard?
   get_bonus == 7 && $game_party.in_battle
 end
 #--------------------------------------------------------------------------
 # ◠ラッシュ判定
 #--------------------------------------------------------------------------
 def rash?
   get_bonus == 8
 end
 #--------------------------------------------------------------------------
 # ◠アクティブãªãƒœãƒ¼ãƒŠã‚¹ã®å–å¾—
 #--------------------------------------------------------------------------
 def get_bonus
   @bonus_list[1]
 end
 #--------------------------------------------------------------------------
 # ◠インデックスを指定ã—ãŸãƒœãƒ¼ãƒŠã‚¹ã®å–å¾—
 #--------------------------------------------------------------------------
 def get_bonus_with_index(index)
   @bonus_list[index]
 end
 #--------------------------------------------------------------------------
 # â— æ–°ãŸã«è¿½åŠ ã™ã‚‹ãƒœãƒ¼ãƒŠã‚¹ã®å–å¾—
 #--------------------------------------------------------------------------
 def get_pop_bonus
   case rand(@rate_list[9].last)
   when @rate_list[0]; -1
   when @rate_list[1];  0
   when @rate_list[2];  1
   when @rate_list[3];  2
   when @rate_list[4];  3
   when @rate_list[5];  4
   when @rate_list[6];  5
   when @rate_list[7];  6
   when @rate_list[8];  7
   when @rate_list[9];  8
   else; -1
   end
 end
 #--------------------------------------------------------------------------
 # ◠ボーナスã®åˆæœŸåŒ–
 #--------------------------------------------------------------------------
 def init_bonus
   init_bonus_rate
   @bonus_list.clear
   10.times{@bonus_list << get_pop_bonus}
 end
 #--------------------------------------------------------------------------
 # ◠ボーナス発生確率ã®åˆæœŸåŒ–
 #--------------------------------------------------------------------------
 def init_bonus_rate
   @rate_list.clear
   first = last = 0
   BOP[$game_variables[bCV]].each_with_index{|value, index|
     last += value unless value.zero?
     @rate_list << Range.new(first, last)
     first = last
   }
 end
 #--------------------------------------------------------------------------
 # ◠ボーナスを進ã‚ã‚‹
 #--------------------------------------------------------------------------
 def next_bonus
   @bonus_list.shift
   @bonus_list << get_pop_bonus
   @sprites_listener.next_bonus if @sprites_listener
 end
 #--------------------------------------------------------------------------
 # ◠ボーナススプライトをå¯è¦–化ã™ã‚‹
 #--------------------------------------------------------------------------
 def sprites_listener=(obj)
   @sprites_listener = obj
 end
end
BonusManager.init_manager

class Game_ActionResult
 #--------------------------------------------------------------------------
 # ◠ダメージ値ã®ã‚¯ãƒªãƒ†ã‚£ã‚«ãƒ«è£œæ­£
 #--------------------------------------------------------------------------
 def critical_damage_values
   @hp_damage = (@hp_damage * 1.5).to_i
   @mp_damage = (@mp_damage * 1.5).to_i
   @hp_drain = (@hp_drain * 1.5).to_i
   @mp_drain = (@mp_drain * 1.5).to_i
 end
end

class Game_Battler
 #--------------------------------------------------------------------------
 # ◠ダメージã®å‡¦ç†
 #--------------------------------------------------------------------------
 alias _kiseki_bonus_execute_damage execute_damage
 def execute_damage(user)
   if BonusManager.critical?
     @result.critical_damage_values
   elsif BonusManager.full_guard?
     @result.clear_damage_values
     @result.cancel = false
   end
   _kiseki_bonus_execute_damage(user)
 end
 #--------------------------------------------------------------------------
 # ◠使用効果[HP 回復] ※å†å®šç¾©
 #--------------------------------------------------------------------------
 def item_effect_recover_hp(user, item, effect)
   value = (mhp * effect.value1 + effect.value2) * rec
   value *= user.pha if item.is_a?(RPG::Item)
   value *= 1.5 if BonusManager.critical? # 追加
   value = value.to_i
   @result.hp_damage -= value
   @result.success = true
   self.hp += value
 end
 #--------------------------------------------------------------------------
 # ◠使用効果[MP 回復] ※å†å®šç¾©
 #--------------------------------------------------------------------------
 def item_effect_recover_mp(user, item, effect)
   value = (mmp * effect.value1 + effect.value2) * rec
   value *= user.pha if item.is_a?(RPG::Item)
   value *= 1.5 if BonusManager.critical? # 追加
   value = value.to_i
   @result.mp_damage -= value
   @result.success = true if value != 0
   self.mp += value
 end
 #--------------------------------------------------------------------------
 # ◠使用効果[TP 増加] ※å†å®šç¾©
 #--------------------------------------------------------------------------
 def item_effect_gain_tp(user, item, effect)
   value = effect.value1.to_i
   value *= 1.5 if BonusManager.critical? # 追加
   @result.tp_damage -= value
   @result.success = true if value != 0
   self.tp += value
 end
 #--------------------------------------------------------------------------
 # ◠ステートã®ä»˜åŠ å¯èƒ½åˆ¤å®š
 #--------------------------------------------------------------------------
 alias _kiseki_bonus_state_addable? state_addable?
 def state_addable?(state_id)
   _kiseki_bonus_state_addable?(state_id) && !BonusManager.full_guard?
 end
 #--------------------------------------------------------------------------
 # ◠使用効果[ステート解除]
 #--------------------------------------------------------------------------
 alias _kiseki_bonus_item_effect_remove_state item_effect_remove_state
 def item_effect_remove_state(user, item, effect)
   _kiseki_bonus_item_effect_remove_state(user, item, effect) unless BonusManager.full_guard?
 end
 #--------------------------------------------------------------------------
 # ◠ボーナスã«ã‚ˆã‚‹å›žå¾©é©ç”¨
 #--------------------------------------------------------------------------
 def bonus_recover_effect
   @result.clear
   @result.used = (0..5).include?(BonusManager.get_bonus)
   case BonusManager.get_bonus
   when 0
     self.hp -= @result.hp_damage = -(mhp * 0.1).to_i
   when 1
     self.hp -= @result.hp_damage = -(mhp * 0.5).to_i
   when 2
     self.mp -= @result.mp_damage = -(mmp * 0.1).to_i
   when 3
     self.mp -= @result.mp_damage = -(mmp * 0.5).to_i
   when 4
     self.tp -= @result.tp_damage = -10
   when 5
     self.tp -= @result.tp_damage = -50
   end
 end
end

class Bonus < Sprite
 include Saba::Kiseki
 #--------------------------------------------------------------------------
 # ◠オブジェクトåˆæœŸåŒ–
 #--------------------------------------------------------------------------
 def initialize(viewport, index)
   super(viewport)
   @index = index
   set_bitmap unless @index.zero?
   if self.bitmap
     self.x = MARGIN_LEFT + 40
     self.y = set_new_y
     self.z = 4
     self.ox = self.bitmap.width / 2
     self.oy = self.bitmap.height
   end
   self.opacity = 0
 end
 #--------------------------------------------------------------------------
 # ◠ボーナスIDã®å–å¾—
 #--------------------------------------------------------------------------
 def get_bonus
   BonusManager.get_bonus_with_index(@index)
 end
 #--------------------------------------------------------------------------
 # ◠ビットマップã®ã‚»ãƒƒãƒˆ
 #--------------------------------------------------------------------------
 def set_bitmap
   case get_bonus
   when 0
     self.bitmap = Cache.system("AT_BONUS_HP10")
   when 1
     self.bitmap = Cache.system("AT_BONUS_HP50")
   when 2
     self.bitmap = Cache.system("AT_BONUS_MP10")
   when 3
     self.bitmap = Cache.system("AT_BONUS_MP50")
   when 4
     self.bitmap = Cache.system("AT_BONUS_TP10")
   when 5
     self.bitmap = Cache.system("AT_BONUS_TP50")
   when 6
     self.bitmap = Cache.system("AT_BONUS_CRI")
   when 7
     self.bitmap = Cache.system("AT_BONUS_DUARD")
   when 8
     self.bitmap = Cache.system("AT_BONUS_RASH")
   end
 end
 #--------------------------------------------------------------------------
 # ◠移動先㮠y 座標を設定
 #--------------------------------------------------------------------------
 def set_new_y
   @new_y = 32
   @new_y += MARGIN_CURRENT_BOTTOM if @index > 1
   @new_y += MARGIN_TOP + UNIT_INTERVAL * (@index-1)
 end
 #--------------------------------------------------------------------------
 # ◠フレーム更新
 #--------------------------------------------------------------------------
 def update
   if self.bitmap
     super
     update_x
     update_y
     update_z
     update_zoom
     update_opacity
   end
 end
 #--------------------------------------------------------------------------
 # â— x 座標ã®æ›´æ–°
 #--------------------------------------------------------------------------
 def update_x
 end
 #--------------------------------------------------------------------------
 # â— y 座標ã®æ›´æ–°
 #--------------------------------------------------------------------------
 def update_y
   if self.y != @new_y
     self.y = [self.y - ((@new_y - self.y).abs < 3 ? 1 : 3), @new_y].max
     flash_top_bonus if @index == 1 && self.y == @new_y
   end
 end
 #--------------------------------------------------------------------------
 # â— z 座標ã®æ›´æ–°
 #--------------------------------------------------------------------------
 def update_z
   self.z = @index > 1 ?  4 : 7
 end
 #--------------------------------------------------------------------------
 # ◠拡大率ã®æ›´æ–°
 #--------------------------------------------------------------------------
 def update_zoom
   if (get_bonus == -1 || @index.zero?) && !self.zoom_x.zero?
     self.zoom_x = self.zoom_y -= 0.05
   end
 end
 #--------------------------------------------------------------------------
 # â— é€æ˜Žåº¦ã®æ›´æ–°
 #--------------------------------------------------------------------------
 def update_opacity
   self.opacity += 12 if self.opacity != 255
 end
 #--------------------------------------------------------------------------
 # ◠ボーナスを進ã‚ã‚‹
 #--------------------------------------------------------------------------
 def next_bonus
   @index -= 1
   set_new_y unless @index.zero?
 end
 #--------------------------------------------------------------------------
 # ◠先頭ã«åˆ°é”ã—ãŸãƒœãƒ¼ãƒŠã‚¹ã‚’フラッシュã•ã›ã¦ã¿ã‚‹
 #--------------------------------------------------------------------------
 def flash_top_bonus
   flash(Color.new(255, 255, 255, 196), 40)
 end
end

class Bonus_Spriteset
 #--------------------------------------------------------------------------
 # ◠オブジェクトåˆæœŸåŒ–
 #--------------------------------------------------------------------------
 def initialize(viewport)
   @viewport = viewport
   create_bonus
 end
 #--------------------------------------------------------------------------
 # ◠ボーナススプライトã®ç”Ÿæˆ
 #--------------------------------------------------------------------------
 def create_bonus
   @bonus_sprites = []
   10.times{|i| @bonus_sprites << Bonus.new(@viewport, i)}
 end
 #--------------------------------------------------------------------------
 # ◠ボーナスを1ã¤é€²ã‚ã‚‹
 #--------------------------------------------------------------------------
 def next_bonus
   @bonus_sprites.shift.dispose
   @bonus_sprites.each{|bonus| bonus.next_bonus}
   @bonus_sprites << Bonus.new(@viewport, 8)
 end
 #--------------------------------------------------------------------------
 # ◠解放
 #--------------------------------------------------------------------------
 def dispose
   @bonus_sprites.each{|bonus| bonus.dispose}
 end
 #--------------------------------------------------------------------------
 # ◠フレーム更新
 #--------------------------------------------------------------------------
 def update
   @bonus_sprites.each{|bonus| bonus.update}
 end
end

class Spriteset_Battle
 #--------------------------------------------------------------------------
 # ◠オブジェクトåˆæœŸåŒ–
 #--------------------------------------------------------------------------
 alias _kiseki_bonus_initialize initialize
 def initialize
   _kiseki_bonus_initialize
   @bonus_spriteset = Bonus_Spriteset.new(@viewport3)
   BonusManager.sprites_listener = @bonus_spriteset
 end
 #--------------------------------------------------------------------------
 # ◠フレーム更新
 #--------------------------------------------------------------------------
 alias _kiseki_bonus_update update
 def update
   _kiseki_bonus_update
   @bonus_spriteset.update if @bonus_spriteset
 end
 #--------------------------------------------------------------------------
 # ◠解放
 #--------------------------------------------------------------------------
 alias _kiseki_bonus_dispose dispose
 def dispose
   _kiseki_bonus_dispose
   @bonus_spriteset.dispose
 end
end

class Window_BattleLog < Window_Selectable
 include Rokan::Kiseki_Plugin
 #--------------------------------------------------------------------------
 # ◠クリティカルヒットã®è¡¨ç¤º
 #--------------------------------------------------------------------------
 alias _kiseki_bonus_display_critical display_critical
 def display_critical(target, item)
   display_critical_bonus
   _kiseki_bonus_display_critical(target, item)
 end
 #--------------------------------------------------------------------------
 # ◠クリティカルボーナスã®è¡¨ç¤º
 #--------------------------------------------------------------------------
 def display_critical_bonus
   if BonusManager.critical?
     add_text(CriticalBonusText)
     wait
   end
 end
 #--------------------------------------------------------------------------
 # ◠ボーナスã«ã‚ˆã‚‹å›žå¾©çµæžœã®è¡¨ç¤º
 #--------------------------------------------------------------------------
 def display_bonus_recover(target)
   if target.result.used
     Sound.play_recovery
     last_line_number = line_number
     case BonusManager.get_bonus
     when 0..1
       add_text(target.result.hp_damage_text)
     when 2..3
       add_text(target.result.mp_damage_text)
     when 4..5
       add_text(target.result.tp_damage_text)
     end
     SceneManager.scene.refresh_status
     wait
     wait if line_number > last_line_number
     back_to(last_line_number)
   end
 end
end

class Scene_Battle < Scene_Base
 #--------------------------------------------------------------------------
 # ◠パーティコマンドé¸æŠžã®é–‹å§‹
 #--------------------------------------------------------------------------
 alias _kiseki_bonus_start_party_command_selection start_party_command_selection
 def start_party_command_selection
   battler = OrderManager.top_unit.battler
   battler.bonus_recover_effect
   @log_window.display_bonus_recover(battler)
   _kiseki_bonus_start_party_command_selection
 end
end

 

 

The script also requires a few images that need to be placed in the Graphics/System folder. This is a link to the images required for the script to run: [Link] I have also attached them to this post for easy access.

 

The demo can be found here: [Link] This is quite a simple script IF you know what you're doing, which takes a bit of playing around. So I've included a demo to save you the trouble of accidentally ruining your current project or having to start a new project just for this. Aren't I kind?

 

For those of you who can't be bothered downloading the demo, I'm including a copy of the documentation here.

 

How to Use

 

Place the three scripts in the order I've numbered them above Main and under Materials.

 

1 - This is a main script. It contains the bulk of the actual data involving the calculations, notetag readings, battler speeds and so on.

2 - This is a main script. It handles turn order.

3 - This is a main script. It's the eye candy script; modifies the positioning and spacing of the order bar as well as the information text that shows up.

4 - This is a sub script. It adds an escape command into the system.

5 - This is a sub script. It adjusts the window sizes of the battlelogs, help windows and so on to optimize space.

 

6 - This is a sub script made by a different scripter. It unlocks the trademark AT Bonuses of the system, allowing different bonuses to activate on different turns.

 

Place the images in the System folder into your Graphics/System folder.

(The images that start with AT_BONUS_ are needed only for sub script 6, Rokan's Ao no Kiseki Style AT Bonus script)

 

The setup is easy in theory. The only possibly confusing thing is if you're not too good at maths, since you can use various Ruby syntax and formulas for anything that has a number value. Here's how things work.

 

Note: I'll be referring to 'turns' and 'units' here. Each action uses up a turn, and each slot on the order bar is a unit. Fundamentally, they're the same, but whenever I refer to a unit, I mean the slots in the order bar and their order. Turns are overarching throughout the battle.

 

*******

Speed

*******

 

The core of an ATB is speed. It determines how often you can act, and is based on agility. This is how your speed is calculated (It's a little complicated) in the script:

 

battlers = $game_party.battle_members + $game_troop.members # Gets information of all the members in the battle.

 

total = 0.0 # (1)

for battler in battlers

total += battler.agi # (2)

end

 

mean = total / battlers.size # (3)

standard_deviation = 0.0 # (5)

 

for battler in battlers

standard_deviation += (battler.agi - mean) * (battler.agi - mean) # (5)

end

 

standard_deviation /= battlers.size # (6)

standard_deviation = Math.sqrt(standard_deviation) # (7)

for battler in battlers

if standard_deviation != 0

battler.spd = ((battler.agi - mean) / standard_deviation) * 10 # (8)

else

battler.spd = 0 # (9)

end

battler.spd *= (SPEED_INFLUENCE / 100.0) # (10)

battler.spd += 50 # (11)

 

1) First, we zero the total just to make sure there's no leftover data.

2) We then total up all the agility values of the battlers.

3) Said total is divided by the number of battlers to get the average agility value of all battlers.

4) We zero the std dev for the same reasons as in (1).

5) This is where things get a little complicated. Basically, it takes each individual battler's agility, subtracts the average agility of all battlers from it, squares the remainder, then adds all the results of the individual battlers together. That's your new std dev.

6) Back to simple stuff. Divide the new std dev by the number of battlers.

7) Simple square root of the calculation in (6).

8) If the new std dev isn't 0, we take the battler's agility and subtract the mean, then divide it by the std dev and multiply by 10.

9) If it's 0, then meh. It's 0.

10) This is where an option in the configuration block appears. SPEED_INFLUENCE defaults to 100 (So there's no change), but if it's 150, for example, you multiply the result by 1.5.

11) Finally, just in case you have a speed of 0, we chuck a free 50 on for you. Because we're kind.

 

This SHOULD mean that the minimum speed for any battler is 50, but if Debug is enabled, in the sample demo, the slimes and bat have speeds of under 0 (41 and 45 respectively). I'm not quite sure why this is. But meh, at least now you know how it's calculated.

 

Yes, I DID open an Excel file and go through all the calculations to see if I've got everything right. I have. >_>

 

For those of you not so inclined to go messing around in scripts, here's what the sample demo characters have:

 

Eric: Agi: 15 Speed: 50

Natalie: Agi: 28 Speed: 71

Terence: Agi: 15 Speed: 50

Slimes: Agi: 12 Speed: 41

Bat: Agi: 14 Speed: 45

 

Play around with them to get a good balanced battle speed.

 

*******

Delay (Skills, Items, States)

*******

 

This is pretty much the most important thing about this CBS (Aside from speed). As with most types of battle systems, doing certain actions have a certain delay before the actor can act again. Take for instance Final Fantasy X. You can visually see how your actions affect when you can next act. Using a normal attack for instance usually has a shorter delay, while using more powerful skills take longer before you can act again. Of course, speed is also taken into account, but eh. Details. This is where it all comes together.

 

The formula given for the default delay in the demo is this: < [(90 - a.spd) / 2, 5].max > What this means is that the default delay for a normal attack is < 90 - the speed of the attacker, then halved > or 5, whichever is higher. This means that the lowest your delay can ever go is 5. In the sample demo, for example, Eric and Terence have a normal attack delay of 20.

 

To assign a delay to a skill, simply place <delay> n in the notebox of a skill, where n is the formula/value of the delay. For example, the above default delay is located in the notebox of Skill #1: Attack as:

 

<delay> [(90 - a.spd) / 2, 5].max

 

Note that this tag can be used in states as well, in which case when the state is applied to a character, ALL of that character's skills take on the delay value placed in there. For example, having a state with <delay> 0 will cause that state to make any action the character does have no delay, essentially being able to act multiple times in succession (Unless skills with <charge> in them are used, see below).

 

Finally, this tag can also be used in Item noteboxes.

 

*******

Charge (Skills, Items, States)

*******

 

This battle system allows you to have skills that take time to charge. You can call it charging or channeling, really, it's the same in concept. Upon using a skill, the user gets knocked back a certain number of units on the order bar and a symbol pops up on their unit. When it's their turn again, they unleash the skill they've been charging. It's that simple. The notetag itself is about as simple. It's <charge> n, where 'n' is the number of units it takes for the user to charge up or finish channeling the skill. This does NOT take into account stuff like delays and hastes, so a skilled player can prevent enemy skills from executing by simply delaying the enemy and speeding up their party, squeezing in enough turns for their party to take out the enemy before they can execute their skill. As an example, a spell that takes 5 units to cast (5 turns assuming no delay/haste shenanigans are going on) will have the following notetag:

 

<charge> 5

 

This is the main reason I distinguish between units and turns. <charge> 5 makes the skill charge for 5 units, BUT it might take 10 turns before the actor can actually unleash the skill.

 

Nice and simple, no? What's NOT so simple is the array of options available for a simple <charge> n notetag. Well, it's still simple in theory, but meh. Basically, there are three options that can be placed in a notebox that has the <charge> n tag. These are:

 

<chargemsg> n ('n' is a string that pops up in the message log when the character begins charging the skill. Use %s to denote the actor's name.)

<state> n ('n' is the ID of the state that will be placed on the actor while charging the skill. For example, <state> 2 will poison the actor while charging.)

<statescope> n ('n' can be either 'allallies' or 'allenemies', or both by using <statescope> n n. This is used in conjunction with <state> to affect all allies, all enemies, or both.)

 

All three are optional.

 

What can they be used for? Many things. For example, you could have something like a heroic song that increases the offensive power of your entire team while it's being sung (charged). Using this example, here're the notetags:

 

<charge> 10 # The effect lasts for 10 turns, which is how long it takes to finish singing the song.

<chargemsg> %s starts singing a song of valor and honor! # This is the message that appears when the song starts.

<state> 21 # This is the ID of a state that increases ATK and MATK. It's not necessary to set up Removal Conditions, since it's removed when the song is done.

<statescope> allallies # This causes the effect to hit all allies, but no enemies.

 

Finally, under 'Using Messages' in the skill tab, I'll have:

 

(User Name)'s song ends! # This message appears after the charge time is over and the skill is used, but since the skill's usage is technically the charging bit, this is now the skill ending message.

 

And there you have it, a nice song that increases the offense of your party throughout its duration. You can use this to have bards in your game, for example. There is a sample skill called Silence Song in the demo that uses the same concept, in case you want to see it firsthand.

 

You can also place formulas in there. So mages with high MAT can channel spells faster than those with low MAT, for instance, with a formula like this:

 

<charge> [100-a.mat, 0].max

 

The above formula means that someone with 50 MAT will take 50 turns to channel the spell, while a mage with 80 will take 20 turns. It also has a maximum checker that will make the charge cost 0 turns if the number goes into the negatives.

 

It should also be noted that, like the <delay> tag, the <charge> tag can also be used within states. Having <charge> 0 in a state will cause anyone in that state to charge/channel any skill/spell instantly, which is good for Limit Breaks/Overdrives or a powerful late game skill.

 

*******

Cancel/Interruption (Skills, Items, Weapons)

*******

 

So you've got an enemy charging up a powerful skill. How do you stop it, aside from outright killing the git before it unleashes? By cancelling/interrupting it, of course. For the sake of consistency, I'll stick with interrupt since it sounds better. Cancel is used in the notetags though, since I thought it fit better (And it's easier to type. >_>). Usage of this tag is very, very simple. As in, there's no configuration for general use. Here's the tag:

 

<cancel>

 

That's it. Place that in a skill or weapon and that skill or weapon can now cancel enemy attacks. Nifty~

 

Say what? You want that boss to have a skill that cannot be cancelled? Well you sure ask a lot. Eh. Here're two optional tags that can be used:

 

<nocancel> (Place this in a skill notebox and it will be impossible to cancel that skill short of killing the bugger.)

<cancelrate> n ('n' is the percentage rate that the cancel is successful. For example, setting this to 50 means that the skill has a 50% chance of cancelling a skill that's being charged. This tag must be used in conjunction with <cancel>.)

 

*******

Slow (Skills, Items, Weapons, States)

*******

 

When you're dealing with stuff like speed and turn order, it's always fun to be able to speed up your allies and slow down your enemies. That's where the <slow> tag comes in. The usage is exactly the same as with the <charge> tag, except it works in Weapon noteboxes as well. Simply place an integer or a formula after the tag to be able to slow down the target of your spell by that number of units. For example:

 

<slow> 2

 

will slow down the target by 2 units, while

 

<slow> rand(3) + 1

 

will slow the target by 1-3 turns [rand(3) picks a random value between 0 and 2, since Ruby starts counting from 0].

 

Negative numbers will speed up the target, so

 

<slow> -1

 

will speed up the target by 1 unit.

 

Now, there are two optional notetags that can be used for this. They are:

 

<slowrate> n ('n' is the percentage rate that the slow is successful. For example, setting this to 50 means that the skill has a 50% chance of slowing an enemy. This tag must be used in conjunction with <slow> n.)

<noslow> (Placing this tag in an actor or enemy notebox will make that actor/enemy immune to the effects of slowing. This works for both positive and negative effects, so you can't speed 'em up either.)

 

*******

Graphics

*******

 

This is just a small side section on graphical usage within the script. The script uses the actor's sprite in the order bar to show which actor's in which unit. You can also specify a default monster graphic for when you don't specify one in lines 65 and 68 in the first main script. But having all those different mosters share the same icon is kinda... boring, no? Well, you can specify enemy sprites to use in the order bar with a simple line. Here it is (Note that it doesn't have the brackets that the other notetags do): GRAPHIC n x, where 'n' is the name of the filename with the monster graphic (Located in Graphics\Characters), and 'x' is the index of the monster. Refer to the following grid to see which area of the image corresponds to which index:

 

0 1 2 3

4 5 6 7

 

As an example and as can be seen in the demo, let's assign a custom icon to the slime. Here's the tag:

 

GRAPHIC Monster2 2

 

The slime's graphic can be found in the image file Monster2.png located inside the Graphics\Characters folder, and it's the third monster in the top row, which is an index number of 2.

 

*******

AT Bonus (by Rokan)

*******

 

The is a bonus script by Rokan of Kaisou-Ryouiki, whose terms and conditions allow me to post this after translating it (modifying it). The other two sub scripts and the three main scripts are all by Saba Kan of PetitRare, so this is a nice example of a scripter scripting a very nice add-on to a battle system created by another scripter.

 

The AT Bonus is a trademark symbol of the Eiyuu no Kiseki (Legend of Heroes) battle system. Basically, units on the order bar are randomly assigned a bonus that can range from healing to certain criticals and more, and when the unit reaches the top, whoever's turn it is gets that bonus. This is the second main reason I distinguish between units and turns. AT Bonuses do not move around the order bar; they are fixed to their unit and slowly move towards the top, upon which they grant their bonus.

 

This is the list of AT Bonuses available within the script:

 

Recover 10% HP at start of turn.

--------------------------------------------------------------------

Recover 50% HP at start of turn.

--------------------------------------------------------------------

Recover 10% MP at start of turn.

--------------------------------------------------------------------

Recover 50% MP at start of turn.

--------------------------------------------------------------------

Recover 10% TP at start of turn.

--------------------------------------------------------------------

Recover 50% TP at start of turn.

--------------------------------------------------------------------

Critical (All damage/healing effectiveness is multipled by 1.5)

--------------------------------------------------------------------

Perfect Guard (Cannot be damaged, Cannot be healed, No Cancel, State Immunity, No Slow)

--------------------------------------------------------------------

Rush (Act twice in a row)

 

Sadly, these bonuses are hard coded within the script, and are thus are unchangeable to those without sufficient knowledge of RGSS3. What IS changeable though are the rates at which these bonuses activate. This is defined in the configuration block at the top of the script in a hash array. There is also a variable assignment at line 55: This lets you change the Bonus rates mid-game. Here is an example array from the demo:

 

0 => [100, 5, 3, 5, 3, 5, 3, 2, 2, 2],

 

In order, the array goes like this:

 

<Variable Number from line 55> => [<Chance of nothing happening>, <Chance of 10% HP Recovery>, <Chance of 50% HP Recovery>, <Chance of 10% MP Recovery>, <Chance of 50% MP Recovery>, <Chance of 10% TP Recovery>, <Chance of 50% TP Recovery>, <Chance of Critical>, <Chance of Perfect Guard>, <Chance of Rush>],

 

Now, the chances are NOT percentages. To get the actual percentage chance of something happening, this is what you do: (Rate)/(Total Rate)*100 = Actual Rate. This means that:

 

Actual Rate of Nothing Happening = 100/(100+5+3+5+3+5+3+2+2+2)*100 = 100/130 * 100 = 0.77 * 100 = 77%

 

So with the example given, there's a roughly 77% chance of there being no bonuses, about 4% chances of there being 10% heals and 3% chances of 50% heals of HP, MP and TP, and about 1.5% chances of Critical, Perfect Guard and Rush when the Variable defined in line 55 (Default: 10) is 0 (Default).

 

Feel free to play around with the hash, have higher rates of getting Critical and a near impossible chance of getting Rush, eliminate Perfect Guard completely, or whatever you feel like. Those of you who fancy yourself scripters can try and modify the default settings, maybe make it so you can define more bounuses or something? xD The sky's the limit (If you know what to do)!

 

*******

End

*******

 

And that should be that! Think I've covered everything. It's not really all that hard. If there're any questions, feel free to pop me a line. I'm not a scripter though, so don't expect too much on that note, but I might be able to help you out with debugging and figuring out what's going on.

 

Kirin, out.

 

 

FAQ

Q: Where do I put these scripts?

A: Above Main, under Materials. You really only need the main scripts; the other three are just bonuses.

 

Q: How do I use this script?

A: Read the 'How to Use.txt' file included in the demo, or refer to the same section in my post above.

 

Q: Help! I'm getting an 'Unable to find file: Graphics/System/<Insert filename here>' error!

A: The hint is in the error. Download the images from either this link or from the attachment and place them in the proper folder.

 

Credit and Thanks

- Saba Kan, for making this script.

- Rokan, for making the AT Bonus script.

- Kirin (me), for translating this.

- Enterbrain, for once again making an awesome maker.

- Google Translate, for helping me with minor translations.

- The makers of the Rikai-chan addon for Mozilla and the Rikai-kun extension for Chrome, for giving us an awesome Japanese translator.

Ao no Kiseki CBS.zip

Share this post


Link to post
Share on other sites

Anything that affects the battle engine is incompatible. This will work with stuff like Display Victory Aftermath, Core Fixes, Encounter Rate Manager and so on, but will NOT work with Battle Command List, Ace Battle Engine, Active Chain Skills, Input Combo Skills and so on.

Share this post


Link to post
Share on other sites

If somebody uses an SBS system, is it compatible with this one? Will the thing on the left side still appear, and the battle menu is STR33G1, and the battle itself is not the front-view style as seen on the video?

Share this post


Link to post
Share on other sites

No, it won't be. This is a whole Custom Battle System, not a simple display changer that changes how the menus are shown, shows the turn order, yadda yadda. The thing on the left is part of the battle system, the order bar. What you're asking is the same thing as asking if Yanfly's Battle Engine Ace is compatible with Fomar's Standalone ATB/Stamina Based Battle System. The answer is no, in case you still don't get it.

 

But what you can do is change the display stuff. Things that only affect visuals, like Jet's Simple Side View script. STR33G1's Battle Status Window is compatible too, since it's just a menu.

 

Proof:

 

2jfden6.png

Edited by Kirin

Share this post


Link to post
Share on other sites

So Jet's SBS would work then? I'll have a try. Thanks for the screenshot.

EDIT:

So I only have to edit the Orderline and cut some parts of it, eh.

Edited by Rafael Black

Share this post


Link to post
Share on other sites

Hmmm, I seem to be having a problem combining this with Victors animated battlers. Everything works fine except the <slow> tag. It displays the message for it (Although with the incorrect amount of turns), but it doesn't actually delay the enemy. Is this a normal compatability issue between the two? Any ideas how to fix it?

Share this post


Link to post
Share on other sites

I'm having a problem with the escape command not working. I've copied the scripts and skills from the demo and no dice.

Edited by Wesker T02

Share this post


Link to post
Share on other sites

You can make as the monsters change the graphics by calling a string:

"<GRAPHIC_MARKER> <Filename> <index> Eg GRAPHIC Monster2 2"

to put in the Monster Box, if it is possibbile also put the characters in Actor Box to change their graphics only in battle?

 

Understood my request?

Share this post


Link to post
Share on other sites

Hey there,

 

I'm having an issue if anyone would like to help:
 

On line 365 of the second file (the one on turn orders) has an error saying that the "<" is unexpected, and a ")" is expected.

 

I don't know Ruby, but I don't think that it will accept the HTML img line as an argument for the find_unit function. I've commented out and made the img tag a string, and doing either one of those seems to have fixed the issue and can now start my game. I also could not find where the find_unit function was defined. Not that big of a deal it seems; all it seems to be is just adding a "cool.png", although that link is broken.

 

Other notes:

- Doubt this would have an effect as this isn't related to the battle system, but I'm using Yanfly's Ace Message System.

- Awesome system!

Share this post


Link to post
Share on other sites

I had that sae message pop on me.  I importanted the images three different times trying

to get this to work.  I even tried to visit the website that it suggested in the script.

 

The only other thing I can think of is if the file names downloaded wrong.

In another script I had to put spaces in my file names to get them to work.

Are there spaces between the file names?

 

ie. Should ActiveWindow be renamed Active Window?

 

Edit:

 

I just deleted the section in the script and it started to work.

 

Edit Edit:

 

Nope, now I have infinite turns.

Edited by kory_toombs

Share this post


Link to post
Share on other sites

This is such a great script. The only problem I'm having is that my character's agi (and thus "speed") seems to have no impact on the battle order. Using skills with lower Delays will change the battle order, but everytime using Delay 100 (my skill 1 Default) skills the turn order goes like this:

 

Actor 1: 38 agi

Actor 2: 999 agi

Monster 1, 2, and 3: 1 Agi

 

Anyway to have faster characters go more often using normal skills (Skill 1 Default)?

Edited by zenithzephyr

Share this post


Link to post
Share on other sites

The delay formula should include agility. A static delay will cause a fixed turn order, with 1 turn by each battler always in the same order.

Share this post


Link to post
Share on other sites

Could you go into more detail? The only section of the script that mentions agi is this:

 

def calculate_battlers_speed
    battlers = $game_party.battle_members + $game_troop.members
    
    total = 0.0
    for battler in battlers
      total += battler.agi
    end
    
    mean = total / battlers.size
    standard_deviation = 0.0

    for battler in battlers
      standard_deviation += (battler.agi - mean) * (battler.agi - mean)
    end
    
    standard_deviation /= battlers.size
    standard_deviation = Math.sqrt(standard_deviation)
    for battler in battlers
      if standard_deviation != 0
        battler.spd = ((battler.agi - mean) / standard_deviation) * 10
      else
        battler.spd = 0
      end
      battler.spd *= (SPEED_INFLUENCE / 100.0)
      battler.spd += 50
      msgbox battler.name + " Agi:" + battler.agi.to_s + " Speed:" + battler.spd.to_i.to_s if DEBUG
    end
  end

 

While this appears to place emphasis on Agi, it does not appear to do anything. Even at the start of the battle my battlers always go in party order, not Agi order. If Agi had any impact, my 999 agi battler would A ) go first and B ) "lap" the 1 agi monsters.

 

You mention a static delay will cause a fixed turn order. Is there a configuration I am missing?

Edited by zenithzephyr

Share this post


Link to post
Share on other sites

Hi, I might have an issue with the script. I'm trying to set the <charge> and <delay> on the normal attack. But for some reason, the enemy is always going first, even if my actor has more agility.

 

I'm using the formula that serves as an example and I put charge to 0.

Maybe I'm missing something.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted