#==============================================================================
# ** Game_Battler
#==============================================================================
Â
class Game_Battler
 #--------------------------------------------------------------------------
 # * Something weird was going on with this, but it should be 999 max
 #--------------------------------------------------------------------------
 def maxhp=(new_maxhp)
  @maxhp_plus += new_maxhp - self.maxhp
  @maxhp_plus = [[@maxhp_plus, -953].max, 953].min
  @hp = [@hp, self.maxhp].min
 end
 #--------------------------------------------------------------------------
 # * 999 max
 #--------------------------------------------------------------------------
 def maxmp=(new_maxmp)
  @maxmp_plus += new_maxmp - self.maxmp
  @maxmp_plus = [[@maxmp_plus, -999].max, 999].min
  @mp = [@mp, self.maxmp].min
 end
 #--------------------------------------------------------------------------
 # * 999 max
 #--------------------------------------------------------------------------
 def maxmp
  return [[base_maxmp + @maxmp_plus, 0].max, 999].min
 end
 #--------------------------------------------------------------------------
 # * As far as I remember I haven't edited this
 #--------------------------------------------------------------------------
 def hp=(hp)
  @hp = [[hp, maxhp].min, 0].max
  if @hp == 0 and not state?(1) and not @immortal
   add_state(1)         # Add incapacitated (state #1)
   @added_states.push(1)
  elsif @hp > 0 and state?(1)
   remove_state(1)       # Remove incapacitated (state #1)
   @removed_states.push(1)
  end
 end
 #--------------------------------------------------------------------------
 # * Change MP
 #   mp : new MP
 #--------------------------------------------------------------------------
 def mp=(mp)
  @mp = [[mp, 999].min, 0].max
  if state?(2) and $game_temp.in_battle
   # Don't do anything.
  elsif @mp >= maxmp and not state?(1)
   # If FP has exceeded FP limit
   @added_states.push(2)
   add_state(2)        Â
  elsif @mp < (maxmp - (maxmp / 3)) and state?(2) or !$game_temp.in_battle and @mp < maxmp
   # If FP is les than 60% FP limit or under limit outside of battle
   remove_state(2)      Â
   @removed_states.push(2)
  end
 end
end
#==============================================================================
# ** Game_Enemy
#==============================================================================
Â
class Game_Enemy < Game_Battler
 alias originit initialize
 #--------------------------------------------------------------------------
 # * Randomises initial enemy MP
 #--------------------------------------------------------------------------
 def initialize(index, enemy_id)
  originit(index, enemy_id)
  @mp = rand(0 + 8)
 end
end
Â
#==============================================================================
# ** Window_Skill
#==============================================================================
Â
class Window_Skill < Window_Selectable
 #--------------------------------------------------------------------------
 # * All skills to be used even at 0 FP
 #--------------------------------------------------------------------------
 def draw_item(index)
  rect = item_rect(index)
  self.contents.clear_rect(rect)
  skill = @data[index]
  if skill != nil
   rect.width -= 4
   # All skills are enabled #enabled = @actor.skill_can_use?(skill)
   draw_item_name(skill, rect.x, rect.y)
   self.contents.draw_text(rect, @actor.calc_mp_cost(skill), 2)
  end
 end
end
Â
#==============================================================================
# ** Scene_Battle
#==============================================================================
Â
class Scene_Battle < Scene_Base
 #--------------------------------------------------------------------------
 # * Makes skills add FP rather than subtract it
 #--------------------------------------------------------------------------
 def execute_action_skill
  skill = @active_battler.action.skill
  text = @active_battler.name + skill.message1
  @message_window.add_instant_text(text)
  unless skill.message2.empty?
   wait(10)
   @message_window.add_instant_text(skill.message2)
  end
  targets = @active_battler.action.make_targets
  display_animation(targets, skill.animation_id)
  #
  @active_battler.mp += @active_battler.calc_mp_cost(skill)
  #
  $game_temp.common_event_id = skill.common_event_id
  for target in targets
   target.skill_effect(@active_battler, skill)
   display_action_effects(target, skill)
  end
 end
end
#==============================================================================
# Â ** Jaabi Script Configurations
#==============================================================================
Â
# I kept forgetting where these were! D:<
Â
module Jaabi
 #--------------------------------------------------------------------------
 # * Constants
 #--------------------------------------------------------------------------
 CBSSTATX = 145
 CBSSTATY = 312
 CBSBATTLERX = CBSSTATX + 141
 CBSBATTLERY = CBSSTATY + 98
end
#==============================================================================
# ★RGSS2
# STR11a_XP風ãƒãƒˆãƒ«#ãƒãƒˆãƒ©ãƒ¼ v1.3 08/03/02
# サãƒãƒ¼ãƒˆï¼šhttp://otsu.cool.ne.jp/strcatyou/
# ・戦闘画é¢ã«XP風ã«ãƒãƒˆãƒ©ãƒ¼ã‚’表示。
#  →Battlersフォルダã«ã€
#  "アクターã®ãƒ•ェイスグラフィック"+"_"+"フェイスインデックス"ã¨
#  åŒåã®ãƒ•ァイルをインãƒãƒ¼ãƒˆã—ã¦ãŠãå¿…è¦ãŒã‚りã¾ã™ã€‚
# (例)
# ファイスグラフィックåãŒface00ã€
# フェイスインデックスãŒ5ã®å ´åˆã€
# ファイルå㯠"face00_5" ã¨ãªã‚Šã¾ã™ã€‚
#
#  □フェイスインデックスã®å‰²ã‚Šå½“ã¦å›³
#  ï¼ï¼‘23
#  4567
#
# ・基準ä½ç½®ãŒç”»é¢ã®ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³ã®åº§æ¨™è£œæ•´æ©Ÿèƒ½ãŒå®Ÿè£…ã•れã¾ã—ãŸã€‚
# ãƒ»ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³ã‚¹ãƒ”ãƒ¼ãƒ‰èª¿æ•´æ©Ÿèƒ½è¿½åŠ ã€‚
# ・従æ¥ã®ã‚ˆã†ã«ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦è¡¨ç¤ºãŒå¯èƒ½ã«ã€‚
#
#------------------------------------------------------------------------------
#
# æ›´æ–°å±¥æ´
# ◇1.2→1.3
# ãƒãƒˆãƒ©ãƒ¼ã‚°ãƒ©ãƒ•ィックãŒãƒ•ã‚§ã‚¤ã‚¹æƒ…å ±ã¨é€£å‹•ã›ãšå¤‰æ›´ã§ããªã„ãƒã‚°ã‚’ä¿®æ£
# ◇1.1f→1.2
# ãƒãƒˆãƒ©ãƒ¼åº§æ¨™ã®ä½ç½®å¤‰æ›´
# ◇1.1→1.1f
# フラッシュã®å‡¦ç†ã‚’入れ忘れã¦ã„ãŸã®ã‚’ä¿®æ£
#
#==============================================================================
# â– STRRGSS2(è¨å®šç®‡æ‰€)
#==============================================================================
module STRRGSS2
 # 基準ä½ç½®ãŒç”»é¢ã®ã‚¢ãƒ‹ãƒ¡ãƒ¼ã‚·ãƒ§ãƒ³ã®åº§æ¨™ä¿®æ£ã€€true = 有効 false = 無効
 BT_ANIME = true
 # è£œæ•´ãŒæœ‰åйãªå ´åˆã®Y座標修æ£
 BT_ANIME_SY = 128
 # アニメスピード 1 ä»¥ä¸Šã®æ•´æ•°ã€€(å‚考) 2ã§2å€é€Ÿã€4ã§æ¨™æº–速
 ANIME_SPEED = 3
Â
 # アクターãƒãƒƒã‚¯ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’表示
 ABWINDOW = false
 # ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã®æ–¹å¼ã€€0 = ウィンドウスã‚ン 1 = グラデーション
 ABW_TYPE = 0
 # ウィンドウ矩形
 ABW_RECT = Rect.new(0, 0, 330, 128)
 # ウィンドウã®åº§æ¨™
 ABW_X = Jaabi::CBSBATTLERX
 ABW_Y = 416 - 100
 # ウィンドウ幅
 ABW_W = 330
 ABW_H = 128
 # グラデーションã®ã‚«ãƒ©ãƒ¼ã€€[上,下]
 ABW_C = [Color.new(0,0,0,0), Color.new(0,0,0,160)]
 @a_back_sprite = Sprite.new(@viewport1)
end
#==============================================================================
# â– Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
 # ãƒãƒˆãƒ©ãƒ¼ã‚°ãƒ©ãƒ•ィックを表示
 A_BATTLER = true # falseã«ã™ã‚‹ã¨ç”»åƒã‚’用æ„ã—ãªãã¦ã‚‚動作ã™ã‚‹ã‚ˆã†ã«ãªã‚Šã¾ã™
 # ãƒãƒˆãƒ©ãƒ¼X座標修æ£
 A_BATTLER_SX = 214
 # ãƒãƒˆãƒ©ãƒ¼åº§æ¨™
 # Z座標
 SCREEN_Z = 120
 def set_b_xy(id)
  w = 330 / 3#$game_party.members.size
  # X座標
  x = (330 / 2) - ((3 - 1) * (w / 2))
  m = $game_party.actors
  x += (m.index(id) * w) + A_BATTLER_SX
  @screen_x = x
  # Y座標
  @screen_y = Jaabi::CBSBATTLERY
 end
 #--------------------------------------------------------------------------
 # ◠公開インスタンス変数
 #--------------------------------------------------------------------------
 attr_accessor :screen_x         # ãƒãƒˆãƒ«ç”»é¢ X 座標
 attr_accessor :screen_y         # ãƒãƒˆãƒ«ç”»é¢ Y 座標
 #--------------------------------------------------------------------------
 # â— ãƒãƒˆãƒ«ç”»é¢ Z 座標ã®å–å¾—
 #--------------------------------------------------------------------------
 def screen_z
  set_b_xy(@actor_id)
  return SCREEN_Z
 end
 #--------------------------------------------------------------------------
 # ★ エイリアス
 #--------------------------------------------------------------------------
 alias setup_str11 setup
 def setup(actor_id)
  setup_str11(actor_id)
  @screen_x = 0
  @screen_y = 0
  @battler_name = @face_name + "_" + @face_index.to_s
  @battler_name = "" unless A_BATTLER
 end
 #--------------------------------------------------------------------------
 # ★ グラフィックã®å¤‰æ›´(v1.3)
 #--------------------------------------------------------------------------
 alias set_graphic_str11 set_graphic
 def set_graphic(character_name, character_index, face_name, face_index)
  set_graphic_str11(character_name, character_index, face_name, face_index)
  @battler_name = @face_name + "_" + @face_index.to_s
  @battler_name = "" unless A_BATTLER
 end
 #--------------------------------------------------------------------------
 # ★ å†å®šç¾©
 #--------------------------------------------------------------------------
 def use_sprite?
  return true # 使ã†
 end
end
#==============================================================================
# â– Sprite_Battler
#==============================================================================
Â
class Sprite_Battler < Sprite_Base
 #--------------------------------------------------------------------------
 # â— æ–°ã—ã„エフェクトã®è¨å®š
 #--------------------------------------------------------------------------
 alias setup_new_effect_str11a setup_new_effect
 def setup_new_effect
  if @battler.white_flash
   @effect_type = WHITEN
   @effect_duration = 16
   @battler.white_flash = false
  end
  if @battler.animation_id != 0
   animation = $data_animations[@battler.animation_id]
   mirror = @battler.animation_mirror
   sy = @battler.animation_sy
   start_animation(animation, mirror, sy)
   @battler.animation_id = 0
   @battler.animation_sy = 0
  end
  setup_new_effect_str11a
 end
end
#==============================================================================
# â– Sprite_Base
#==============================================================================
class Sprite_Base < Sprite
 # è§£åƒåº¦
 DISPLAY_W = 400
 DISPLAY_H = 416
 #--------------------------------------------------------------------------
 # ★ å†å®šç¾©ã®åµ
 #--------------------------------------------------------------------------
 def update
  super
  if @animation != nil
   @animation_duration -= 1
   if @animation_duration % STRRGSS2::ANIME_SPEED == 0
    update_animation
   end
  end
  @@animations.clear
 end
 alias start_animation_str11a start_animation
 def start_animation(animation, mirror = false, sy = 0)
  start_animation_str11a(animation, mirror)
  if @animation.position == 3
   if viewport == nil
    @animation_ox = DISPLAY_W / 2
    @animation_oy = (DISPLAY_H / 2) + sy
   else
    @animation_ox = viewport.rect.width / 2
    @animation_oy = (viewport.rect.height / 2) + sy
   end
  end
  @animation_duration = @animation.frame_max * STRRGSS2::ANIME_SPEED + 1
 end
 def update_animation
  if @animation_duration > 0
   frame_index = @animation.frame_max - (@animation_duration + (STRRGSS2::ANIME_SPEED-1)) / STRRGSS2::ANIME_SPEED
   animation_set_sprites(@animation.frames[frame_index])
   for timing in @animation.timings
    if timing.frame == frame_index
     animation_process_timing(timing)
    end
   end
  else
   dispose_animation
  end
 end
 def animation_process_timing(timing)
  timing.se.play
  case timing.flash_scope
  when 1
   self.flash(timing.flash_color, timing.flash_duration * STRRGSS2::ANIME_SPEED)
  when 2
   if viewport != nil
    viewport.flash(timing.flash_color, timing.flash_duration * STRRGSS2::ANIME_SPEED)
   end
  when 3
   self.flash(nil, timing.flash_duration * STRRGSS2::ANIME_SPEED)
  end
 end
end
#==============================================================================
# â– Spriteset_Battle
#==============================================================================
class Spriteset_Battle
 #--------------------------------------------------------------------------
 # ◠アクタースプライトã®ä½œæˆ
 #--------------------------------------------------------------------------
 def create_actors
  @actor_sprites = []
  for actor in $game_party.members.reverse
   @actor_sprites.push(Sprite_Battler.new(@viewport1, actor))
  end
  # アクターãƒãƒƒã‚¯ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦
  if STRRGSS2::ABW_TYPE == 1
   @a_back_sprite = Sprite.new(@viewport1)
   c = STRRGSS2::ABW_C
   rect = STRRGSS2::ABW_RECT
   v = true
   bitmap = Bitmap.new(STRRGSS2::ABW_W, STRRGSS2::ABW_H)
   bitmap.gradient_fill_rect(rect, c[0], c[1], v)
   @a_back_sprite.bitmap = bitmap
   @a_back_sprite.x = STRRGSS2::ABW_X
   @a_back_sprite.y = STRRGSS2::ABW_Y
  else
   rect = STRRGSS2::ABW_RECT
   x = STRRGSS2::ABW_X + rect.x
   y = STRRGSS2::ABW_Y + rect.y
   @a_back_sprite = Window_Base.new(x, y, rect.width, rect.height)
   @a_back_sprite.viewport = @viewport1
  end
  @a_back_sprite.z = 100
  @a_back_sprite.visible = STRRGSS2::ABWINDOW
 end
 #--------------------------------------------------------------------------
 # â— ã‚¢ã‚¯ã‚¿ãƒ¼ã‚¹ãƒ—ãƒ©ã‚¤ãƒˆã®æ›´æ–°
 #--------------------------------------------------------------------------
 def update_actors
  for sprite in @actor_sprites
   sprite.update
  end
 end
 #--------------------------------------------------------------------------
 # ◠アクタースプライトã®è§£æ”¾
 #--------------------------------------------------------------------------
 def dispose_actors
  for sprite in @actor_sprites
   sprite.dispose
  end
  if STRRGSS2::ABW_TYPE == 1
   @a_back_sprite.bitmap.dispose
  end
  @a_back_sprite.dispose
 end
end
#==============================================================================
# â– Game_Battler
#==============================================================================
class Game_Battler
 #--------------------------------------------------------------------------
 # ◠公開インスタンス変数
 #--------------------------------------------------------------------------
 attr_accessor :animation_sy
 #--------------------------------------------------------------------------
 # ★ エイリアス
 #--------------------------------------------------------------------------
 alias clear_sprite_effects_str11a clear_sprite_effects
 def clear_sprite_effects
  clear_sprite_effects_str11a
  @animation_sy = 0
 end
end
#==============================================================================
# â– Game_Party
#==============================================================================
class Game_Party < Game_Unit
 #--------------------------------------------------------------------------
 # ◠公開インスタンス変数
 #--------------------------------------------------------------------------
 attr_reader  :actors
end
#==============================================================================
# â– Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
 #--------------------------------------------------------------------------
 # ★ å†å®šç¾©
 #--------------------------------------------------------------------------
 def display_attack_animation(targets)
  if @active_battler.is_a?(Game_Enemy)
   #Sound.play_enemy_attack
   #wait(15, true)
   display_normal_animation(targets, 1)
  else
   aid1 = @active_battler.atk_animation_id
   aid2 = @active_battler.atk_animation_id2
   display_normal_animation(targets, aid1, false)
   display_normal_animation(targets, aid2, true)
  end
  wait_for_animation
 end
 #--------------------------------------------------------------------------
 # ◠通常アニメーションã®è¡¨ç¤º
 #   targets    : 対象者ã®é…列
 #   animation_id : アニメーション ID
 #   mirror    : å·¦å³å転
 #--------------------------------------------------------------------------
 def display_normal_animation(targets, animation_id, mirror = false)
  animation = $data_animations[animation_id]
  if animation != nil
   to_screen = (animation.position == 3)    # ä½ç½®ãŒã€Œç”»é¢ã€ã‹ï¼Ÿ
   for target in targets.uniq
    target.animation_id = animation_id
    target.animation_mirror = mirror
    if target.is_a?(Game_Actor) and to_screen and STRRGSS2::BT_ANIME
     target.animation_sy = STRRGSS2::BT_ANIME_SY
    end
    wait(20, true) unless to_screen      # å˜ä½“用ãªã‚‰ã‚¦ã‚§ã‚¤ãƒˆ
   end
   wait(20, true) if to_screen         # 全体用ãªã‚‰ã‚¦ã‚§ã‚¤ãƒˆ
  end
 end
end
Â
Â
Â
#==============================================================================
# ★RGSS2
# STR11c_XP風ãƒãƒˆãƒ«#メイン v2.1 08/04/18
# サãƒãƒ¼ãƒˆï¼šhttp://strcatyou.u-abel.net/
# ãƒ»æœ¬æ ¼çš„ã«ãƒãƒˆãƒ«ãƒ¬ã‚¤ã‚¢ã‚¦ãƒˆã‚’2000+XP化。
#  ã¨ã«ã‹ã色々変化ã—ã¾ã™ã€‚
# ・ターゲット指定用ã®ã‚«ãƒ¼ã‚½ãƒ«ã‚°ãƒ©ãƒ•ィックを
#  Systemã«ã‚¤ãƒ³ãƒãƒ¼ãƒˆã—ã¦ãŠãå¿…è¦ãŒã‚りã¾ã™ã€‚
# Â è¦æ ¼ã¯  幅 = 一コマã®å¹…*アニメ数
#      高㕠= 一コマã®é«˜ã•*3
#  一列目ã«ã‚¢ã‚¯ã‚¿ãƒ¼ã‚³ãƒžãƒ³ãƒ‰æ™‚ã®ã‚«ãƒ¼ã‚½ãƒ«ã€
#  ニ列目ã«ã‚¢ã‚¯ã‚¿ãƒ¼é¸æŠžæ™‚ã®ã‚«ãƒ¼ã‚½ãƒ«ã€
#  三列目ã«ã‚¨ãƒãƒŸãƒ¼é¸æŠžæ™‚ã®ã‚«ãƒ¼ã‚½ãƒ«
#
# ・STR11aã¨STR11bã¨STR11dをセットã§ã©ã†ãžã€‚
#
# ※ATBã¨ä½µç”¨ã™ã‚‹å ´åˆã¯ã€è¨å®šç®‡æ‰€ã®
#  AUTO_C(ã‚ªãƒ¼ãƒˆã‚³ãƒžãƒ³ãƒ‰è¿½åŠ )ã®å€¤ã‚’å¿…ãš false ã«ã—ã¦ãã ã•ã„。
#
#------------------------------------------------------------------------------
#
# æ›´æ–°å±¥æ´
# ◇2.0→2.1
# アクターコマンドを横並ã³ã«ã™ã‚‹ã¨æˆ¦é—˜æ™‚ã«å¼·åˆ¶çµ‚了ã—ã¦ã—ã¾ã†ãƒã‚°ã‚’ä¿®æ£
# ◇1.9→2.0
# ★メジャーãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚¢ãƒƒãƒ—
# STR33(アクティブタイムãƒãƒˆãƒ«)ã«å¯¾å¿œ
#  ※併用ã™ã‚‹å ´åˆã¯åˆ¥é€”併用パッãƒã‚’å°Žå…¥ã™ã‚‹å¿…è¦ãŒã‚りã¾ã™
# アクターコマンドã®å‡¦ç†ã‚’冿§‹ç¯‰
# →KGCã•ã‚“ã®å€‹åˆ¥æˆ¦é—˜ã‚³ãƒžãƒ³ãƒ‰ã«ä¸€å¿œå¯¾å¿œ
#  (アクターコマンドã¯å¿…ãšç¸¦ä¸¦ã³ã§ã€å€‹åˆ¥æˆ¦é—˜ã‚³ãƒžãƒ³ãƒ‰ã®ä½ç½®ã¯STR11より上ã«é…ç½®)
# ターゲット指定ã®ã‚«ãƒ¼ã‚½ãƒ«ç§»å‹•ã®ä»•様改善
# etc...
#
#==============================================================================
# â– STRRGSS2(è¨å®šç®‡æ‰€)
#==============================================================================
module STRRGSS2
 # レベルアップ時ã®SE ("ファイルå", ボリューム, ピッãƒ)
 LEVELUP_SE = RPG::SE.new("Flash2", 80, 100)
 LEVELUP_T  = "LEVEL UP!" # レベルアップãƒãƒƒãƒ—ã®æ–‡å—列
 #
 TR_STATE_W = 144     # ターゲットåå‰è¡¨ç¤ºæ¬„ã®ã‚¹ãƒ†ãƒ¼ãƒˆæ¨ªå¹…
 SHAKE    = true     # 被ダメージ時ã®ã‚·ã‚§ã‚¤ã‚¯ã‚’æ¢ã‚ã‚‹
 #
 ST_SX    = Jaabi::CBSSTATX     # ステータスã®X座標修æ£
 ST_SY    = 0     # ステータスã®Y座標修æ£
 ST_WIDTH  = 130      # ステータス横幅
 ST_NAME   = true    # ステータスã«åå‰ã‚’表示ã™ã‚‹
 #
 ACOMMAND_W = false    # アクターコマンドを横並ã³ã«å¤‰æ›´
 PCOMMAND_W = false     # パーティコマンドを横並ã³ã«å¤‰æ›´
 PCOMMAND_R = [0,0,332,1] # パーティコマンド[X座標, Y座標, å¹…, æ–‡å—æƒãˆ]
 #
 AUTOC    = false    # オートコマンド追åŠ
 C_AUTO   = false     # アクター別コマンド入力ä¸ã«æŒ‡å®šãƒœã‚¿ãƒ³ã§ã‚ªãƒ¼ãƒˆ
 V_AUTO   = "AUTO"   # オートコマンドã®åç§°
 C_AUTO_KEY = Input::A   # オートボタン Cã€B以外
end
class Sprite_BattleCursor < Sprite
 CURSOR   = "Cursor"   # カーソルグラフィックã®ãƒ•ァイルå
 WAIT    = 8      # カーソルアニメスピード 値ãŒå°ã•ã„ã»ã©æ—©ã„
 SPEED    = 1      # カーソル移動スピード  値ãŒå°ã•ã„ã»ã©æ—©ã„
 CW     = 32      # 1コマã®å¹…
 CH     = 32      # 1コマã®é«˜ã•
end
class Window_BattleStatus < Window_Selectable
 # ãƒãƒˆãƒ«ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹åº§æ¨™
 def set_xy
  @x = []
  @y = []
  for i in 0...3#$game_party.members.size
   w = 330 / 3#$game_party.members.size
   x = (330 / 2) - ((3 - 1) * (w / 2))
   x += (i * w)
   @x[i] = x + STRRGSS2::ST_SX
   @y[i] = Jaabi::CBSSTATY
  end
 end
end
#==============================================================================
# â– Sprite_BattleCursor
#==============================================================================
class Sprite_BattleCursor < Sprite
 #--------------------------------------------------------------------------
 # ◠公開インスタンス変数
 #--------------------------------------------------------------------------
 attr_accessor :xx
 attr_accessor :yy
 attr_accessor :type
 #--------------------------------------------------------------------------
 # â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
 #--------------------------------------------------------------------------
 def initialize(viewport)
  super(viewport)
  self.bitmap = Cache.system(CURSOR)
  self.src_rect.set(0, 0, CW, CH)
  self.ox = CW / 2
  self.oy = CH / 2
  @wait = WAIT
  self.x = 0
  self.y = 406
  self.z += 25
  @xx = self.x
  @yy = self.y
  @type = 0
 end
 #--------------------------------------------------------------------------
 # ◠解放
 #--------------------------------------------------------------------------
 def dispose
  if self.bitmap != nil
   self.bitmap.dispose
  end
  super
 end
 #--------------------------------------------------------------------------
 # ◠フレーム更新
 #--------------------------------------------------------------------------
 def update
  super
  s = (SPEED - 1)
  self.x = (((self.x * s) + @xx) / SPEED)+1
  self.y = ((self.y * s) + @yy) / SPEED
  @wait -= 1
  return if @wait > 0
  @wait = WAIT
  self.src_rect.x += CW
  self.src_rect.x = 0 if (self.bitmap.width <= self.src_rect.x)
  self.src_rect.y = CH * @type
 end
end
#==============================================================================
# â– Sprite_Battler
#==============================================================================
class Sprite_Battler < Sprite_Base
 alias update_str11c update
 def update
  update_str11c
  if (@battler != nil and @battler.cursor_flash and
    not @battler.dead? and @effect_duration <= 32)
   @battler.white_flash = true
  end
 end
end
#==============================================================================
# â– Spriteset_Battle
#==============================================================================
class Spriteset_Battle
 #--------------------------------------------------------------------------
 # ★ エイリアス
 #--------------------------------------------------------------------------
 alias update_viewports_str11c update_viewports
 def update_viewports
  update_viewports_str11c
  @viewport1.ox = 0 if STRRGSS2::SHAKE
 end
end
#==============================================================================
# â– Game_Battler
#==============================================================================
class Game_Battler
 #--------------------------------------------------------------------------
 # ◠公開インスタンス変数
 #--------------------------------------------------------------------------
 attr_accessor :cursor_flash
 #--------------------------------------------------------------------------
 # ★ エイリアス
 #--------------------------------------------------------------------------
 alias clear_sprite_effects_str11 clear_sprite_effects
 def clear_sprite_effects
  clear_sprite_effects_str11
  @cursor_flash = false
 end
end
#==============================================================================
# â– Window_PartyCommand
#==============================================================================
class Window_PartyCommand < Window_Command
 #--------------------------------------------------------------------------
 # ★ å†å®šç¾©
 #--------------------------------------------------------------------------
 def initialize
  s1 = Vocab::fight
  s2 = Vocab::escape
  w = STRRGSS2::PCOMMAND_R[2]
  cl = 1
  if STRRGSS2::PCOMMAND_W
   cl = 2
   cl += 1 if STRRGSS2::AUTOC
  end
  if STRRGSS2::AUTOC
   super(w, [s1, STRRGSS2::V_AUTO, s2], cl, 0)
   draw_item(0, true)
   draw_item(1, true)
   draw_item(2, $game_troop.can_escape)
  else
   super(w, [s1, s2], cl, 0)
   draw_item(0, true)
   draw_item(1, $game_troop.can_escape)
  end
  self.x = STRRGSS2::PCOMMAND_R[0]
  self.y = STRRGSS2::PCOMMAND_R[1]
  self.active = false
 end
 #--------------------------------------------------------------------------
 # â— é …ç›®ã®æç”»
 #   index  : é …ç›®ç•ªå·
 #   enabled : 有効フラグ。false ã®ã¨ãåŠé€æ˜Žã§æç”»
 #--------------------------------------------------------------------------
 def draw_item(index, enabled = true)
  rect = item_rect(index)
  rect.x += 4
  rect.width -= 8
  self.contents.clear_rect(rect)
  self.contents.font.color = normal_color
  self.contents.font.color.alpha = enabled ? 255 : 128
  self.contents.draw_text(rect, @commands[index], STRRGSS2::PCOMMAND_R[3])
 end
 def update
  super
  self.visible = self.active
 end
end
Â
#==============================================================================
# â– Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Selectable
 #--------------------------------------------------------------------------
 # ★ エイリアス
 #--------------------------------------------------------------------------
 alias initialize_str11c initialize
 def initialize(f = false)
  @f = f
  @lvuppop = []
  set_xy
  @s_sprite = []
  @s_party = []
  @s_lv = []
  @opacity = 0
  initialize_str11c
  self.contents.dispose
  self.contents = Bitmap.new(STRRGSS2::ST_WIDTH, height - 32)
  self.back_opacity = 0
  self.opacity = 0
  @column_max = $game_party.actors.size
 end
 #--------------------------------------------------------------------------
 # ◠リフレッシュ
 #--------------------------------------------------------------------------
 def refresh
  self.contents.clear
  @item_max = $game_party.members.size
  for i in 0...@item_max
   draw_item(i)
  end
  update
 end
 #--------------------------------------------------------------------------
 # ★ å†å®šç¾©
 #--------------------------------------------------------------------------
 def draw_item(index)
  return unless @f
  rect = item_rect(index)
  rect.x = 0
  rect.y = 0
  #rect.width -= 8
  rect.height = 150
  self.contents.clear_rect(rect)
  self.contents.font.color = normal_color
  actor = $game_party.members[index]
  draw_actor_bback(rect.x - 2, rect.y - 2)
  rect.x = 24
  rect.y = 18
  draw_actor_name(actor, rect.x, rect.y + 16)
  w = STRRGSS2::ST_WIDTH
  draw_actor_state(actor, rect.x + 59, rect.y + 14, 24)
  draw_actor_hp(actor, rect.x, rect.y + 72 - 34, 1)
  draw_actor_mp(actor, rect.x, rect.y + 72 - 20, 1)
Â
  @s_sprite[index] = Sprite.new if @s_sprite[index] == nil
  @s_sprite[index].bitmap = self.contents.clone
  @s_sprite[index].x = @x[index] + 4
  @s_sprite[index].y = @y[index]
  @s_sprite[index].opacity = @opacity
  @s_lv[index] = actor.level
  @s_party[index] = [actor.name, actor.hp, actor.maxhp,
            actor.mp, actor.maxmp, actor.states,]
  self.contents.clear
 end
 def update
  super
  return unless @f
  for i in 0...@s_sprite.size
   @s_sprite[i].opacity = @opacity
  end
  @opacity += 8
  for i in 0...@s_sprite.size
   a = $game_party.members[i]
   m = @s_party[i]
   if (a.level > @s_lv[i])
    STRRGSS2::LEVELUP_SE.play
    tx = STRRGSS2::LEVELUP_T
    @lvuppop.push(Sprite_PopUpText.new(a.screen_x,a.screen_y + 32,[tx], 0, 36))
    @s_lv[i] = a.level
   end
   if (a.name != m[0]) or (a.hp != m[1]) or (a.mp != m[3]) or
    (a.states != m[5]) or (a.maxhp != m[2]) or (a.maxmp != m[4])
    @s_sprite[i].bitmap.dispose
    draw_item(i)
   end
  end
 end
 def dispose   Â
  super
  return unless @f
  for i in [email=0...@lvuppop.size]0...@lvuppop.size[/email]
   @lvuppop[i].dispose if @lvuppop[i] != nil
  end
  @lvuppop = nil
  for i in 0...@s_sprite.size
   @s_sprite[i].bitmap.dispose
   @s_sprite[i].dispose
  end
 end
 def item_rect(index)
  rect = Rect.new(0, 0, 0, 0)
  return rect
 end
 #--------------------------------------------------------------------------
 # ◠カーソルをå³ã«ç§»å‹•
 #--------------------------------------------------------------------------
 def cursor_right(wrap = false)
  if @column_max >= 2
   @index = (@index + 1) % @item_max
  end
 end
 #--------------------------------------------------------------------------
 # ◠カーソルを左ã«ç§»å‹•
 #--------------------------------------------------------------------------
 def cursor_left(wrap = false)
  if @column_max >= 2
   @index = (@index - 1 + @item_max) % @item_max
  end
 end
end
#==============================================================================
# â– Window_TargetEnemy
#==============================================================================
class Window_TargetEnemy < Window_Command
 #--------------------------------------------------------------------------
 # ◠カーソルをå³ã«ç§»å‹•
 #--------------------------------------------------------------------------
 def cursor_right(wrap = false)
  if @column_max >= 2
   @index = (@index + 1) % @item_max
  end
 end
 #--------------------------------------------------------------------------
 # ◠カーソルを左ã«ç§»å‹•
 #--------------------------------------------------------------------------
 def cursor_left(wrap = false)
  if @column_max >= 2
   @index = (@index - 1 + @item_max) % @item_max
  end
 end
 #--------------------------------------------------------------------------
 # ★ å†å®šç¾©
 #--------------------------------------------------------------------------
 def initialize
  commands = []
  @enemies = []
  for enemy in $game_troop.members
   next unless enemy.exist?
   commands.push(enemy.name)
   @enemies.push(enemy)
  end
  super(416, commands, 8, 1)
  self.z = -100
  self.back_opacity = 0
  self.opacity = 0
  self.contents_opacity = 0
 end
end
if STRRGSS2::AUTOC
#==============================================================================
# â– Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
 #--------------------------------------------------------------------------
 # ★ å†å®šç¾©
 #--------------------------------------------------------------------------
 def next_actor
  loop do
   if @actor_index == $game_party.members.size-1
    start_main
    return
   end
   @status_window.index = @actor_index += 1
   @active_battler = $game_party.members[@actor_index]
   if @active_battler.auto_battle or @autobattle
    @active_battler.make_action
    next
   end
   break if @active_battler.inputable?
  end
  start_actor_command_selection
 end
 def update_party_command_selection
  if Input.trigger?(Input::C)
   case @party_command_window.index
   when 0  # 戦ã†
    Sound.play_decision
    @status_window.index = @actor_index = -1
    @autobattle = false
    next_actor
   when 1  # オート
    Sound.play_decision
    @status_window.index = @actor_index = -1
    @autobattle = true
    next_actor
   when 2  # 逃ã’ã‚‹
    if $game_troop.can_escape == false
     Sound.play_buzzer
     return
    end
    Sound.play_decision
    process_escape
   end
  end
 end
end
#
end
#==============================================================================
# â– Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
 #--------------------------------------------------------------------------
 # ★ エイリアス
 #--------------------------------------------------------------------------
 alias update_actor_command_selection_str07_11 update_actor_command_selection
 def update_actor_command_selection
  update_actor_command_selection_str07_11
  if not Input.trigger?(Input::C) and not Input.trigger?(Input::B) and
    Input.trigger?(STRRGSS2::C_AUTO_KEY) and STRRGSS2::C_AUTO
   actor_autobattle
  end
 end
 #--------------------------------------------------------------------------
 # ★ 追åŠ
 #--------------------------------------------------------------------------
 def actor_autobattle
  Sound.play_decision
  @active_battler.make_action if @active_battler != nil
  update_strbtflash
  next_actor
 end
 #--------------------------------------------------------------------------
 # ★ エイリアス(v1.4ä¿®æ£ç®‡æ‰€)
 #--------------------------------------------------------------------------
 alias start_str11c start
 def start
  update_strbtflash
  # é…列記憶
  @str_member = $game_party.members.clone
  @trid = -1
  start_str11c
 end
 alias terminate_str11c terminate
 def terminate
  @cursor.bitmap.dispose
  @cursor.dispose
  terminate_str11c
 end
 alias process_battle_event_str11c process_battle_event
 def process_battle_event
  process_battle_event_str11c
  # パーティメンãƒãƒ¼ã«å¤‰æ›´ãŒã‚ã£ãŸå ´åˆã€
  # ステータス・ãƒãƒˆãƒ©ãƒ¼ã‚’作り直ã—
  if @str_member != $game_party.members
   @str_member = $game_party.members.clone
   @spriteset.dispose_actors
   @spriteset.create_actors
   @status_window.dispose
   @status_window = Window_BattleStatus.new(true)
   @status_window.x = 0
   @status_window.y = 416 - 128
  end
 end
 alias process_escape_str11c process_escape
 def process_escape
  @party_command_window.visible = false
  process_escape_str11c
 end
 alias update_party_command_selection_str11c update_party_command_selection
 def update_party_command_selection
  update_strbtflash
  update_party_command_selection_str11c
 end
 #--------------------------------------------------------------------------
 # ◠フレーム更新
 #--------------------------------------------------------------------------
 alias update_str11 update
 def update
  update_xpstbt_cursor
  update_str11
 end
 def update_xpstbt_cursor
  for i in $game_party.members
   i.cursor_flash = false
  end
  if @status_window.index != -1
   update_strbtflash
   m = $game_party.actors
   a = $game_actors[m[@status_window.index]]
   a.cursor_flash = true
  end
  if @target_enemy_window != nil
   update_strbtflash
   m = @target_enemy_window.enemy
   a = $game_troop.members[m.index]
   a.cursor_flash = true
   @cursor.type = 2
   @cursor.xx = a.screen_x
   @cursor.yy = a.screen_y
   @cursor.update
   @cursor.visible = true
   text = a.name
   if @trid != a.index
    @trid = a.index
    @en_help_window.set_text(text, 1)
    x = @en_help_window.width - 32 - STRRGSS2::TR_STATE_W
    @en_help_window.draw_actor_state(a, x, 0, STRRGSS2::TR_STATE_W)
   end
  elsif @target_actor_window != nil
   update_strbtflash
   m = $game_party.actors
   a = $game_actors[m[@target_actor_window.index]]
   a.cursor_flash = true
   @cursor.type = 1
   @cursor.xx = a.screen_x
   @cursor.yy = a.screen_y - 16
   @cursor.update
   @cursor.visible = true
   text = a.name
   if @trid != a.id
    @trid = a.id
    @en_help_window.set_text(text, 1)
    x = @en_help_window.width - 32 - STRRGSS2::TR_STATE_W
    @en_help_window.draw_actor_state(a, x, 0, STRRGSS2::TR_STATE_W)
   end
  elsif @status_window.index != -1
   m = $game_party.actors
   a = $game_actors[m[@status_window.index]]
   @cursor.type = 0
   @cursor.xx = a.screen_x
   @cursor.yy = a.screen_y - 8
   @cursor.update
   @cursor.visible = true
  else
   @cursor.type = -1
   @cursor.xx = 544 / 2
   @cursor.yy = 416 / 2
   @cursor.visible = false
  end
 end
 def update_strbtflash
  for i in $game_party.members + $game_troop.members
   i.cursor_flash = false
  end
 end
 alias update_basic_str11c update_basic
 def update_basic(m = false)
  update_basic_str11c(m)
  @status_window.update
 end
 #--------------------------------------------------------------------------
 # â— æƒ…å ±è¡¨ç¤ºãƒ“ãƒ¥ãƒ¼ãƒãƒ¼ãƒˆã®ä½œæˆ
 #--------------------------------------------------------------------------
 def create_info_viewport
  # 何も無ã„
  @info_viewport = Viewport.new(0, 0, 32, 32)
  @info_viewport.z = 100
  # ステータス
  @status_window = Window_BattleStatus.new(true)
  @status_window.x = 0
  @status_window.y = 416 - 128
  # パーティコマンド
  @party_command_window = Window_PartyCommand.new
  @party_command_window.visible = false
  # アクターコマンド
  @actor_command_window = Window_ActorCommand.new
  @actor_command_window.visible = false
  # カーソル
  @cursor = Sprite_BattleCursor.new(nil)
  @cursor.visible = false
  #
  @info_viewport.visible = false
 end
 #--------------------------------------------------------------------------
 # â— æƒ…å ±è¡¨ç¤ºãƒ“ãƒ¥ãƒ¼ãƒãƒ¼ãƒˆã®æ›´æ–°
 #--------------------------------------------------------------------------
 def update_info_viewport
  @party_command_window.update
  @actor_command_window.update
 end
 #--------------------------------------------------------------------------
 # ◠対象敵ã‚ãƒ£ãƒ©é¸æŠžã®é–‹å§‹
 #--------------------------------------------------------------------------
 alias start_target_enemy_selection_str11 start_target_enemy_selection
 def start_target_enemy_selection
  strtrhelp_start
  start_target_enemy_selection_str11
 end
 #--------------------------------------------------------------------------
 # ◠対象敵ã‚ãƒ£ãƒ©é¸æŠžã®çµ‚了
 #--------------------------------------------------------------------------
 alias end_target_enemy_selection_str11 end_target_enemy_selection
 def end_target_enemy_selection
  for i in $game_troop.members
   i.cursor_flash = false
  end
  strtrhelp_end
  end_target_enemy_selection_str11
 end
 #--------------------------------------------------------------------------
 # â— å¯¾è±¡ã‚¢ã‚¯ã‚¿ãƒ¼å¯¾è±¡é¸æŠžã®é–‹å§‹
 #--------------------------------------------------------------------------
 alias start_target_actor_selection_str11 start_target_actor_selection
 def start_target_actor_selection
  strtrhelp_start
  start_target_actor_selection_str11
 end
 #--------------------------------------------------------------------------
 # â— å¯¾è±¡ã‚¢ã‚¯ã‚¿ãƒ¼é¸æŠžã®çµ‚了
 #--------------------------------------------------------------------------
 alias end_target_actor_selection_str11 end_target_actor_selection
 def end_target_actor_selection
  for i in $game_party.members
   i.cursor_flash = false
  end
  strtrhelp_end
  end_target_actor_selection_str11
 end
 #--------------------------------------------------------------------------
 # ★ 追åŠ
 #--------------------------------------------------------------------------
 def strtrhelp_start
  @trid = -1
  @en_help_window = Window_Help.new
  @help_window.visible = false if @help_window != nil
  @skill_window.visible = false if @skill_window != nil
 end
 def strtrhelp_end
  @trid = -1
  @en_help_window.dispose
  @help_window.visible = true if @help_window != nil
  @skill_window.visible = true if @skill_window != nil
 end
end
#==============================================================================
# ★RGSS2
# STR11d_XP風ãƒãƒˆãƒ«#ダメージãƒãƒƒãƒ—アップ v2.1a 08/05/02
# サãƒãƒ¼ãƒˆï¼šhttp://strcatyou.u-abel.net/
#
# ・ãƒãƒˆãƒ©ãƒ¼ã«ãƒ€ãƒ¡ãƒ¼ã‚¸ãƒ»ã‚¹ãƒ†ãƒ¼ãƒˆã®å¤‰åŒ–ç‰ã®ãƒãƒƒãƒ—アップãŒ
#  出るよã†ã«ãªã‚Šã¾ã™ã€‚
# ・数å—ãƒãƒƒãƒ—アップã«ç”»åƒã‚’使用ã™ã‚‹ã“ã¨ãŒå‡ºæ¥ã¾ã™ã€‚
#  使用ã™ã‚‹æ•°å—グラフィックã¯Systemã«ã‚¤ãƒ³ãƒãƒ¼ãƒˆã—ã¦ãã ã•ã„。
#
#  <è¦æ ¼>
#ã€€ã€€ä¸¦ã¹æ–¹ 0123456789
#    幅 = æ•°å—一コマã®å¹… * 10
#   高㕠= æ•°å—一コマã®é«˜ã• * 4
#  一列目ã«é€šå¸¸ã®æ•°å—ã€
#  ニ列目ã«å›žå¾©ç”¨æ•°å—ã€
#  三列目ã«MPダメージ用数å—ã€
#  四列目ã«ã‚¯ãƒªãƒ†ã‚£ã‚«ãƒ«ç”¨æ•°å— をé…ç½®ã—ã¾ã™ã€‚
#
#------------------------------------------------------------------------------
#
# æ›´æ–°å±¥æ´
#
# ◇2.1→2.1a
# HPå¸åŽã®ãƒãƒƒãƒ—アップ文å—ãŒé–“é•ã£ã¦ã„るミスを修æ£
# ◇2.0→2.1
# レベルアップ時ã«ã‚¨ãƒ©ãƒ¼ãŒå‡ºã‚‹ãƒã‚°ã‚’ä¿®æ£
# ◇1.2s→2.0
# ★メジャーãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚¢ãƒƒãƒ—
# ãƒãƒƒãƒ—ã‚¢ãƒƒãƒ—ã‚¹ãƒ—ãƒ©ã‚¤ãƒˆã®æŒ™å‹•ã‚’ã»ã¼å…¨ã¦å¤‰æ›´
# →ãƒã‚¦ãƒ³ãƒ‰æ©Ÿèƒ½è¿½åŠ ã€è¨å®šç®‡æ‰€ã®ç°¡ç•¥åŒ–
# スリップダメージ/自動回復ã®ãƒãƒƒãƒ—アップã«å¯¾å¿œ
# 0ダメージãŒãƒãƒƒãƒ—アップã•れãªã„仕様ã¯å»ƒæ¢ã«ãªã‚Šã¾ã—ãŸã€‚
#
#==============================================================================
class Scene_Battle < Scene_Base
 # â– ãƒãƒƒãƒ—アップテã‚スト定数
 MISS = "Miss!"    # ミス
 EVAD = "Evaded!"   # 回é¿
 FAIL = "Failed!"   # 失敗
 CRIT = "Critical!"  # クリティカル
 HPDR = "HP-Drain"   # HPドレイン
 MPDR = "MP-Drain"   # MPドレイン
 MPDA = "MP-Damage"  # MPダメージ
 MPRE = "MP-Recovery" # MP回復
 V_SLIP = false # スリップダメージ/自動回復をãƒãƒƒãƒ—アップã—ãªã„
 V_EVAD = false # 回é¿ã‚’ãƒãƒƒãƒ—アップã—ãªã„
 V_FAIL = true  # 失敗をãƒãƒƒãƒ—アップã—ãªã„
 V_STAT = true # ステートã®å¤‰åŒ–ã‚’ãƒãƒƒãƒ—アップã—ãªã„
end
class Sprite_PopUpText < Sprite
 # ■サイズ
 DMPP_FSIZE = 32  # ダメージãƒãƒƒãƒ—アップã®ã‚µã‚¤ã‚º
 TXPP_FSIZE = 20  # æ–‡å—ãƒãƒƒãƒ—アップã®ã‚µã‚¤ã‚º
 TXPP_SY   = 16  # æ–‡å—ãƒãƒƒãƒ—アップã®Y座標修æ£
 # â– æ•°å—1コマã‚ãŸã‚Šã®ã‚µã‚¤ã‚º(pixel)
 NW = 16  # æ•°å—æ¨ªå¹… グラフィックを指定ã™ã‚‹å ´åˆã¯ ã‚°ãƒ©ãƒ•ã‚£ãƒƒã‚¯ã®æ¨ªå¹… / 10
 NH = 28  # æ•°å—縦幅 グラフィックを指定ã™ã‚‹å ´åˆã¯ グラフィックã®ç¸¦å¹… / 4
 # â– æ•°å—グラフィックファイルå 指定ã—ãªã„å ´åˆã¯ ""
 FONTFILE = "" # "Btskin_n02"
 # ■フォント
 FONT  = ["Sugo"]            # æ•°å—フォント
 TFONT = ["Sugo"] # æ–‡å—フォント
 # ■フォントカラー
 # 通常         ä¸ã®è‰²  /   ç¸ã®è‰²
 COLOR0 = [Color.new(255,255,255), Color.new(16,16,16)]
 # 回復
 COLOR1 = [Color.new(128,255,192), Color.new(16,16,16)]
 # MPダメージ
 COLOR2 = [Color.new(255,128,224), Color.new(16,16,16)]
 # クリティカル
 COLOR3 = [Color.new(255,224,128), Color.new(192,0,0)]
 # ■動力
 GRAV  = 0.5  # é‡åŠ›(ã“ã®å€¤ãŒé«˜ã„ã»ã©æ—©ãè½ä¸‹ã™ã‚‹)
 JUMP  = 4.0  # 上昇力(ã“ã®å€¤ãŒé«˜ã„ã»ã©ä¸Šã«ä¸ŠãŒã‚‹)
 BU_Y  = 48   # 縦ãƒã‚¦ãƒ³ãƒ‰ä½ç½®(ãƒãƒƒãƒ—アップä½ç½®ãŒåŸºæº–)
 BUND  = 5   # 縦ãƒã‚¦ãƒ³ãƒ‰ã•ã›ã‚‹æœ€å¤§å›žæ•°
 LRMV  = 2   # å·¦å³ã®ç§»å‹•ã®ãƒãƒ©ã¤ã(ランダム)
 LRBW  = true  # ç”»é¢å·¦å³ç«¯ã§ãƒã‚¦ãƒ³ãƒ‰ã™ã‚‹
 M_OP  = 40   # 逿˜ŽåŒ–開始フレーム数
 OP_S  = 16   # 逿˜Žåº¦å¤‰åŒ–スピード
end
#==============================================================================
# â– Bitmap
#==============================================================================
class Bitmap
 #--------------------------------------------------------------------------
 # â— æ–‡å—ç¸å–りæç”»
 #--------------------------------------------------------------------------
 def draw_text_f(x, y, width, height, str, align = 0, color = Color.new(64,32,128))
  shadow = self.font.shadow
  b_color = self.font.color.dup
  font.shadow = false
  font.color = color
  draw_text(x + 1, y, width, height, str, align)
  draw_text(x - 1, y, width, height, str, align)
  draw_text(x, y + 1, width, height, str, align)
  draw_text(x, y - 1, width, height, str, align)
  font.color = b_color
  draw_text(x, y, width, height, str, align)
  font.shadow = shadow
 end
 def draw_text_f_rect(r, str, align = 0, color = Color.new(64,32,128))
  draw_text_f(r.x, r.y, r.width, r.height, str, align = 0, color)
 end
end
#==============================================================================
# â– Sprite_PopUpText
#==============================================================================
class Sprite_PopUpText < Sprite
 #--------------------------------------------------------------------------
 # â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
 #--------------------------------------------------------------------------
 def initialize(x, y, pop = [""], flag = 0, viewport = nil, delay = 0)
  n_cache if $game_temp.bp_numcache == nil
  size = DMPP_FSIZE
  if viewport.is_a?(Numeric)
   size = viewport
   viewport = nil
  end
  # スプライトè¨å®š
  super(viewport)
  self.bitmap = Bitmap.new(128, pop.size * (size + 4))
  self.ox = self.bitmap.width / 2
  self.oy = self.bitmap.height / 2
  self.x = x
  self.y = y - 56
  self.z += 20
  self.opacity = 255
  # 回復判定
  for i in 0...pop.size
   if pop[i].is_a?(Numeric) and pop[i] < 0
    pop[i] = pop[i].abs
    flag = 1
   end
  end
  # フラグ 0 = 通常 1 = 回復 2 = MPダメージ 3 = クリティカル
  case flag
  when 0;color = COLOR0
  when 1;color = COLOR1
  when 2;color = COLOR2
  when 3;color = COLOR3
  end
  # æç”»
  self.bitmap.font.color = color[0]
  for i in 0...pop.size
   if pop[i].is_a?(Numeric)
    number(pop[i], size * i, flag)
   else
    self.bitmap.font.name = TFONT
    self.bitmap.font.size = TXPP_FSIZE
    sy = TXPP_SY
    h = TXPP_FSIZE
    self.bitmap.draw_text_f(0, (size * i) + sy, 128, h, pop[i], 1, color[1])
   end
  end
  # 動力è¨å®š
  @delay = delay
  @rx = self.x
  @lrmove = (-LRMV * 10 + rand((LRMV*20)+1))/10.0
  @jump = JUMP
  @yuka = self.y + BU_Y
  @bound = BUND
  @count = 0
  self.visible = false if @delay > 0
 end
 #--------------------------------------------------------------------------
 # ◠解放
 #--------------------------------------------------------------------------
 def dispose
  self.bitmap.dispose if self.bitmap != nil
  super
 end
 #--------------------------------------------------------------------------
 # ◠フレーム更新
 #--------------------------------------------------------------------------
 def update
  if @delay > 0
   @delay -= 1
   return
  end
  self.visible = true
  self.x = @rx;@rx += @lrmove
  self.y -= @jump
  @jump -= GRAV
  self.opacity -= OP_S if @count >= M_OP
  # 縦ãƒã‚¦ãƒ³ãƒ‰
  if self.y >= @yuka
   self.y = @yuka
   if @bound > 0
    @jump = -@jump / 3 * 2
    @jump -= 1
    @jump = @lrmove = 0 if @jump.truncate <= 1
    @bound -= 1
   else
    @jump = @lrmove = 0
   end
  end
  # 横ãƒã‚¦ãƒ³ãƒ‰
  if LRBW
   if @rx <= 0
    @rx = 1
    @lrmove = -@lrmove
   elsif @rx >= 544
    @rx = 543
    @lrmove = -@lrmove
   end
  end
  # æ›´æ–°ã‚«ã‚¦ãƒ³ãƒˆåŠ ç®—
  @count += 1
  dispose if (self.opacity == 0)
 end
 #--------------------------------------------------------------------------
 # â— æ•°å—ã‚ャッシュ作æˆ/確ä¿
 #--------------------------------------------------------------------------
 def n_cache
  if FONTFILE == ""
   c = [COLOR0, COLOR1, COLOR2, COLOR3]
   $game_temp.bp_numcache = Bitmap.new(NW * 10, NH * 4)
   $game_temp.bp_numcache.font.size = NH
   $game_temp.bp_numcache.font.name = FONT
   for f in 0...c.size
    $game_temp.bp_numcache.font.color = c[f][0]
    fc = c[f][1]
    for i in 0..9
     $game_temp.bp_numcache.draw_text_f(i * NW, f * NH, NW, NH, i, 1, fc)
    end
   end
  else
   $game_temp.bp_numcache = Cache.system(FONTFILE)
  end
 end
 #--------------------------------------------------------------------------
 # â— æ•°å—æç”»
 #--------------------------------------------------------------------------
 def number(n, y, c)
  n = (n.to_s).split('')
  for i in 0...n.size
   n[i] = n[i].to_i
  end
  x = (self.bitmap.width / 2) - ((NW * n.size) / 2)
  rect = Rect.new(0 ,0, NW, NH)
  rect.y = c * NH
  for i in n
   rect.x = i * NW
   self.bitmap.blt(x, y, $game_temp.bp_numcache, rect)
   x += NW
  end
 end
end
#==============================================================================
# â– Game_Temp
#==============================================================================
class Game_Temp
 #--------------------------------------------------------------------------
 # ◠公開インスタンス変数
 #--------------------------------------------------------------------------
 attr_accessor :bp_numcache
 #--------------------------------------------------------------------------
 # â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
 #--------------------------------------------------------------------------
 alias initialize_str11d initialize
 def initialize
  initialize_str11d
  @bp_numcache = nil
 end
end
#==============================================================================
# â– Game_Battler
#==============================================================================
class Game_Battler
 #--------------------------------------------------------------------------
 # ◠公開インスタンス変数
 #--------------------------------------------------------------------------
 def hppopup
  @hppopup = [] if @hppopup == nil
  @hppopup
 end
 def hppopup=(a)
  @hppopup = a
 end
 #--------------------------------------------------------------------------
 # â— ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆåˆæœŸåŒ–
 #--------------------------------------------------------------------------
 alias initialize_str11d initialize
 def initialize
  @hppopup = []
  initialize_str11d
 end
 #--------------------------------------------------------------------------
 # ◠行動効果ã®ä¿æŒç”¨å¤‰æ•°ã‚’クリア
 #--------------------------------------------------------------------------
 alias clear_action_results_str11d clear_action_results
 def clear_action_results
  @hppopup = []
  clear_action_results_str11d
 end
 #--------------------------------------------------------------------------
 # ◠スリップダメージã®åŠ¹æžœé©ç”¨
 #--------------------------------------------------------------------------
 alias slip_damage_effect_str11d slip_damage_effect
 def slip_damage_effect
  ar_hp = self.hp
  slip_damage_effect_str11d
  @hppopup.push(ar_hp - self.hp) if ar_hp != self.hp
 end
end
#==============================================================================
# â– Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
 #--------------------------------------------------------------------------
 # ◠自動回復ã®å®Ÿè¡Œ (ターン終了時ã«å‘¼ã³å‡ºã—)
 #--------------------------------------------------------------------------
 alias do_auto_recovery_str11d do_auto_recovery
 def do_auto_recovery
  ar_hp = self.hp
  do_auto_recovery_str11d
  @hppopup.push(ar_hp - self.hp) if ar_hp != self.hp
 end
end
#==============================================================================
# â– Scene_Battle
#==============================================================================
class Scene_Battle < Scene_Base
 #--------------------------------------------------------------------------
 # ★ エイリアス
 #--------------------------------------------------------------------------
 alias start_str11d start
 def start
  @popup = []
  start_str11d
 end
 alias terminate_str11d terminate
 def terminate
  for i in [email=0...@popup.size]0...@popup.size[/email]
   @popup[i].dispose if @popup[i] != nil
  end
  @popup = nil
  terminate_str11d
 end
 alias update_basic_str11d update_basic
 def update_basic(main = false)
  update_basic_str11d(main)
  for i in [email=0...@popup.size]0...@popup.size[/email]
   if @popup[i] != nil
    @popup[i].update
    @popup.delete_at(i) if @popup[i].disposed?
   end
  end
 end
 #--------------------------------------------------------------------------
 # â— ãƒãƒˆãƒ«ã‚¤ãƒ™ãƒ³ãƒˆã®å‡¦ç†
 #--------------------------------------------------------------------------
 alias process_battle_event_str11d process_battle_event
 def process_battle_event
  slippopup unless V_SLIP
  process_battle_event_str11d
 end
 #--------------------------------------------------------------------------
 # ◠スリップダメージã®ãƒãƒƒãƒ—アップ
 #--------------------------------------------------------------------------
 def slippopup
  for i in $game_party.members + $game_troop.members
   if i.hppopup.size > 0
    for p in i.hppopup
     array = [p]
     @popup.push(Sprite_PopUpText.new(i.screen_x, i.screen_y, array))
    end
    i.hppopup.clear
   end
  end
 end
 #--------------------------------------------------------------------------
 # ◠ミスã®è¡¨ç¤º
 #--------------------------------------------------------------------------
 alias display_miss_str11d display_miss
 def display_miss(target, obj = nil)
  t = target
  tx = MISS
  @popup.push(Sprite_PopUpText.new(t.screen_x,t.screen_y,[tx]))
  display_miss_str11d(target, obj)
 end
 #--------------------------------------------------------------------------
 # ◠回é¿ã®è¡¨ç¤º
 #--------------------------------------------------------------------------
 alias display_evasion_str11d display_evasion
 def display_evasion(target, obj = nil)
  unless V_EVAD
   t = target
   tx = EVAD
   @popup.push(Sprite_PopUpText.new(t.screen_x,t.screen_y,[tx]))
  end
  display_evasion_str11d(target, obj)
 end
 #--------------------------------------------------------------------------
 # ◠HP ダメージ表示
 #--------------------------------------------------------------------------
 alias display_hp_damage_str11d display_hp_damage
 def display_hp_damage(target, obj = nil)
  t = target
  c = 0
  if target.hp_damage == 0         # ノーダメージ
   return if obj != nil and obj.damage_to_mp
   return if obj != nil and obj.base_damage == 0
   array = [t.hp_damage]
   if target.critical
    array.unshift(CRIT);c = 3
   end
   @popup.push(Sprite_PopUpText.new(t.screen_x, t.screen_y, array,c))
  elsif target.absorbed          # å¸åŽ
   array = [HPDR ,t.hp_damage]
   @popup.push(Sprite_PopUpText.new(t.screen_x, t.screen_y, array))
  elsif target.hp_damage > 0        # ダメージ
   array = [t.hp_damage]
   if target.critical
    array.unshift(CRIT);c = 3
   end
   @popup.push(Sprite_PopUpText.new(t.screen_x, t.screen_y, array, c))
  else                   # 回復
   array = [t.hp_damage]
   if target.critical
    array.unshift(CRIT);c = 3
   end
   @popup.push(Sprite_PopUpText.new(t.screen_x, t.screen_y, array,c))
  end
  # å‘¼ã³æˆ»ã—
  display_hp_damage_str11d(target, obj)
 end
 #--------------------------------------------------------------------------
 # ◠MP ダメージ表示
 #--------------------------------------------------------------------------
 alias display_mp_damage_str11d display_mp_damage
 def display_mp_damage(target, obj = nil)
  return if target.dead?
  return if target.mp_damage == 0
  t = target
  if target.absorbed            # å¸åŽ
   array = [MPDR ,t.mp_damage]
   @popup.push(Sprite_PopUpText.new(t.screen_x, t.screen_y, array, 2))
  elsif target.mp_damage > 0        # ダメージ
   array = [MPDA, t.mp_damage]
   @popup.push(Sprite_PopUpText.new(t.screen_x, t.screen_y, array, 2))
  else                   # 回復
   array = [MPRE, t.mp_damage]
   @popup.push(Sprite_PopUpText.new(t.screen_x, t.screen_y, array, 1))
  end
  # å‘¼ã³æˆ»ã—
  display_mp_damage_str11d(target, obj)
 end
#=begin
 #--------------------------------------------------------------------------
 # â— ä»˜åŠ ã•れãŸã‚¹ãƒ†ãƒ¼ãƒˆã®è¡¨ç¤º
 #--------------------------------------------------------------------------
 alias display_added_states_str11d display_added_states
 def display_added_states(target, obj = nil)
  unless V_STAT
   t = target
   tx = ""
   delay = 0
   for state in t.added_states
    tx = state.name if state.id != 1
    @popup.push(Sprite_PopUpText.new(t.screen_x,t.screen_y,[tx], 0, nil, delay))
    delay += 24
   end
  end
  # å‘¼ã³æˆ»ã—
  display_added_states_str11d(target, obj)
 end
#=end
 #--------------------------------------------------------------------------
 # ◠解除ã•れãŸã‚¹ãƒ†ãƒ¼ãƒˆã®è¡¨ç¤º
 #--------------------------------------------------------------------------
 alias display_removed_states_str11d display_removed_states
 def display_removed_states(target, obj = nil)
  unless V_STAT
   t = target
   delay = 0
   for state in t.removed_states
    tx = state.name
    @popup.push(Sprite_PopUpText.new(t.screen_x,t.screen_y,[tx], 1, nil, delay))
    delay += 24
   end
  end
  # å‘¼ã³æˆ»ã—
  display_removed_states_str11d(target, obj)
 end
 #--------------------------------------------------------------------------
 # ◠失敗ã®è¡¨ç¤º
 #--------------------------------------------------------------------------
 alias display_failure_str11d display_failure
 def display_failure(target, obj)
  unless V_FAIL
   t = target
   tx = FAIL
   @popup.push(Sprite_PopUpText.new(t.screen_x,t.screen_y,[tx]))
  end
  # å‘¼ã³æˆ»ã—
  display_failure_str11d(target, obj)
 end
end
class Scene_Battle < Scene_Base
 alias oldbstart start
 #--------------------------------------------------------------------------
 # * Start processing
 #--------------------------------------------------------------------------
 def start
  oldbstart
  @message_window.y = 0
  @message_window.opacity = 0
 end
end
Â
  @action_battlers = []
  @action_battlers += $game_party.members
  @action_battlers += $game_troop.members
  for i in 0..@action_battlers
     @check_battler = @action_battlers[i]
  @check_battler[i].mp += 1 unless @active_battler[i]
  end
Â