Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[Review] Fatigue System

Taylor

Sponsor

I am working on a battle system where MP is known as FP; or fatigue points. As a battler attacks (limited to skills) their FP increases, and eventually it goes over their limit (yes over MaxMP/FP) - and they collapse with exhaustion.

Yes. It's like the Phylomortis battle system, but I'm not planning to be insanely crazy about this system as much as RPG Advocate. This is purely for turn-flow and who can attack. I may make FP slightly effect damage, however because the FP limit can increase (giving the actor more energy) that means weaker, less energy consuming attacks with only become even more weak if your FP is high.

This is the current base of the system, including the management of the "Fatigue" state and a few other misc changes.
please don't use :< ... this is for my game
Code:
#==============================================================================

# ** 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

Right now I have one issue, the Fatigue state is added when a battler uses a skill that goes over their max, but the message "[BATTLER] became over exhausted!" does not play at the right time, or at all.
In the default battle system I found that the above message only occurred if the battler (tested with an actor) was attacked, as if the enemy was applying the state to them. What should happen is the message should appear during the attacker's own turn.

If it helps at all, I am also using modified versions of the XP-style battle scripts from http://strrgssvx.blog.shinobi.jp/ . Because the server hosting the scripts are down; here are my versions:
-----------------------------------------------------------------
My own Module. No comment on the comment. = w=
Code:
#==============================================================================

#  ** Jaabi Script Configurations

#==============================================================================

 

# I kept forgetting where these were! D:<

 

module Jaabi

  #--------------------------------------------------------------------------

  # * Constants

  #--------------------------------------------------------------------------

  CBSSTATX = 145

  CBSSTATY = 312

  CBSBATTLERX = CBSSTATX + 141

  CBSBATTLERY = CBSSTATY + 98

end
Battler Sprites
Code:
#==============================================================================

# ★RGSS2 

# STR11a_XP風バトル#バトラー v1.3 08/03/02

# サポート:http://otsu.cool.ne.jp/strcatyou/

# ・戦闘画面にXP風にバトラーを表示。

#  →Battlersフォルダに、

#  "アクターのフェイスグラフィック"+"_"+"フェイスインデックス"と

#  同名のファイルをインポートしておく必要があります。

# (例)

# ファイスグラフィック名がface00、

# フェイスインデックスが5の場合、

# ファイル名は "face00_5" となります。

#

#  □フェイスインデックスの割り当て図

#  0123

#  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

 

 

 
Stats
Code:
#==============================================================================

# ★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
Damage Pop. Contains edits that change how states are alerted, though disabled through V_STAT.
Code:
#==============================================================================

# ★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
Lastly something simple:
Code:
class Scene_Battle < Scene_Base

  alias oldbstart start

  #--------------------------------------------------------------------------

  # * Start processing

  #--------------------------------------------------------------------------

  def start

    oldbstart

    @message_window.y = 0

    @message_window.opacity = 0

  end

end
-----------------------------------------------------------------

Things to implement later: individual turns, rather than troop/party turns. If you saw my post in the Action Order script topic you'd probably be aware I've already tried messing with it. No luck yet. @ _@

One last question, how would I create a loop to edit the stats (specifically MP/FP) of all those in battle, but not the battler who just acted? This would be done at the end of turns.
Code:
 

    @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

 
This code based on make_action_order from Dargor's Action Order and what I've learnt from messing with Windows/lists. Either it's my pessimism, or I know that code won't work.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top