Show enemy buffs/debuffs

Draw

Veteran
Veteran
Joined
Oct 11, 2015
Messages
83
Reaction score
1
First Language
French
Primarily Uses
Hello again !


In Rm Vx Ace, by default you can see buffs/debuffs icons next actors name, but you can't with enemy names.


It could be an efficient way to track enemy buffs/debuffs. I've searched in Window_BattleEnemy, but I can't find a way to do that.


#==============================================================================
# ■ Window_BattleEnemy
#------------------------------------------------------------------------------
#  バトル画面で、行動対象の敵キャラを選択するウィンドウです。
#==============================================================================

class Window_BattleEnemy < Window_Selectable
#--------------------------------------------------------------------------
# ● オブジェクト初期化
# info_viewport : 情報表示用ビューポート
#--------------------------------------------------------------------------
def initialize(info_viewport)
super(0, info_viewport.rect.y, window_width, fitting_height(4))
refresh
self.visible = false
@info_viewport = info_viewport
end
#--------------------------------------------------------------------------
# ● ウィンドウ幅の取得
#--------------------------------------------------------------------------
def window_width
Graphics.width - 128
end
#--------------------------------------------------------------------------
# ● 桁数の取得
#--------------------------------------------------------------------------
def col_max
return 1
end
#--------------------------------------------------------------------------
# ● 項目数の取得
#--------------------------------------------------------------------------
def item_max
$game_troop.alive_members.size
end
#--------------------------------------------------------------------------
# ● 敵キャラオブジェクト取得
#--------------------------------------------------------------------------
def enemy
$game_troop.alive_members[@index]
end
#--------------------------------------------------------------------------
# ● 項目の描画
#--------------------------------------------------------------------------
def draw_item(index)
change_color(normal_color)
name = $game_troop.alive_members[index].name
draw_text(item_rect_for_text(index), name)
end
#--------------------------------------------------------------------------
# ● ウィンドウの表示
#--------------------------------------------------------------------------
def show
if @info_viewport
width_remain = Graphics.width - width
self.x = width_remain
@info_viewport.rect.width = width_remain
select(0)
end
super
end
#--------------------------------------------------------------------------
# ● ウィンドウの非表示
#--------------------------------------------------------------------------
def hide
@info_viewport.rect.width = Graphics.width if @info_viewport
super
end
end


Here's a picture to explain : 


http://hpics.li/50f768d


That's all, if someone finds out.
 
Joined
Jul 17, 2015
Messages
586
Reaction score
316
First Language
English
Primarily Uses
Code:
class Window_BattleEnemy < Window_Selectable
  #--------------------------------------------------------------------------
  # * Overwrite "draw_item"; displays state icons for enemies
  #--------------------------------------------------------------------------
  def draw_item(index)
    change_color(normal_color)
    name = $game_troop.alive_members[index].name
    draw_text(item_rect_for_text(index), name)
    rectx = item_rect_for_text(index).x + item_rect_for_text(index).width - 48
    recty = item_rect_for_text(index).y
    draw_actor_icons($game_troop.alive_members[index], rectx, recty, 48)
  end
end
Edit: Alias method (in case of incompatibility)

Code:
class Window_BattleEnemy < Window_Selectable
  #--------------------------------------------------------------------------
  # * Alias "draw_item"
  #--------------------------------------------------------------------------
  alias draw_enemy draw_item
  def draw_item(index)
    draw_enemy(index)
    rectx = item_rect_for_text(index).x + item_rect_for_text(index).width - 48
    recty = item_rect_for_text(index).y
    draw_actor_icons($game_troop.alive_members[index], rectx, recty, 48)
  end
end
 
Last edited by a moderator:

Draw

Veteran
Veteran
Joined
Oct 11, 2015
Messages
83
Reaction score
1
First Language
French
Primarily Uses
Code:
class Window_BattleEnemy < Window_Selectable
  #--------------------------------------------------------------------------
  # * Overwrite "draw_item"; displays state icons for enemies
  #--------------------------------------------------------------------------
  def draw_item(index)
    change_color(normal_color)
    name = $game_troop.alive_members[index].name
    draw_text(item_rect_for_text(index), name)
    rectx = item_rect_for_text(index).x + item_rect_for_text(index).width - 48
    recty = item_rect_for_text(index).y
    draw_actor_icons($game_troop.alive_members[index], rectx, recty, 48)
  end
end
Edit: Alias method (in case of incompatibility)

Code:
class Window_BattleEnemy < Window_Selectable
  #--------------------------------------------------------------------------
  # * Alias "draw_item"
  #--------------------------------------------------------------------------
  alias draw_enemy draw_item
  def draw_item(index)
    draw_enemy(index)
    rectx = item_rect_for_text(index).x + item_rect_for_text(index).width - 48
    recty = item_rect_for_text(index).y
    draw_actor_icons($game_troop.alive_members[index], rectx, recty, 48)
  end
end


It works fine, thank you !
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,049
Messages
1,018,546
Members
137,835
Latest member
yetisteven
Top