Project1
标题:
求个VA用敌人状态图标显示脚本
[打印本页]
作者:
空の翼
时间:
2012-1-23 20:17
标题:
求个VA用敌人状态图标显示脚本
本帖最后由 空の翼 于 2012-1-25 14:10 编辑
这个是VX用的状态图标显示脚本,求哪位大大好心帮忙改成VA用的。{:nm_4:}
或者直接给个能显示敌人状态图标的脚本也行~(就是在选择目标时候在敌人名字后面显示当前状态图标的那种)
#==============================================================================
# ■ module n01
#------------------------------------------------------------------------------
# HP Gauge and State Indicator Add-on Ver1.1
#
# Do not use this add-on with the ATB. It is already built into the ATB.
#==============================================================================
module N01
# Display the state of the selected battler.
WORD_STATE_DISPLAY = true
# Name to display when there is no abnormal state.
WORD_NORMAL_STATE = "正常"
# Displays the HP gauge of the selected battler.
HP_DISPLAY = true
# Displays the HP gauge of selected actors.
ACTOR_DISPLAY = true
# Do not display the HP gauge and states for the following enemies:
ENEMY_NON_DISPLAY = [] # ex.[1,2,3]
# Do not display the following states ID as abnormal:
STATE_NON_DISPLAY = [] # ex.[1,2,3]
end
#-------------------------------設定ここまで-----------------------------------
#==============================================================================
# ■ Window_Help
#------------------------------------------------------------------------------
# スキルやアイテムの説明、アクターのステータスなどを表示するウィンドウです。
#==============================================================================
class Window_Help < Window_Base
#--------------------------------------------------------------------------
# ● テキスト設定
#--------------------------------------------------------------------------
def set_text_n01add(member)
self.contents.clear
self.contents.font.color = normal_color
if !member.actor? && N01::ENEMY_NON_DISPLAY.include?(member.enemy_id)
return self.contents.draw_text(4, 0, self.width - 40, WLH, member.name, 1)
elsif member.actor? && !N01::ACTOR_DISPLAY
return self.contents.draw_text(4, 0, self.width - 40, WLH, member.name, 1)
end
if N01::WORD_STATE_DISPLAY && N01::HP_DISPLAY
self.contents.draw_text(0, 0, 180, WLH, member.name, 1)
i = 0
for state in member.states
i += 1
draw_icon(state.icon_index,i * 24 + 160,0)
end
elsif N01::WORD_STATE_DISPLAY
text = member.name + " ["
for state in member.states
next if N01::STATE_NON_DISPLAY.include?(state.id)
text += " " if text != member.name + " ["
text += state.name
end
text += N01::WORD_NORMAL_STATE if text == member.name + " ["
text += "]"
text = "" if text == "[]"
self.contents.draw_text(4, 0, self.width - 40, WLH, text, 1)
elsif N01::HP_DISPLAY
self.contents.draw_text(4, 0, 240, WLH, member.name, 1)
draw_actor_hp(member, 262, 0, 120)
draw_actor_mp(member, 478, 0, 100)
end
end
end
#==============================================================================
# ■ Scene_Battle
#------------------------------------------------------------------------------
# バトル画面の処理を行うクラスです。
#==============================================================================
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ● ターゲット選択の開始
#--------------------------------------------------------------------------
def start_target_selection(actor = false)
members = $game_party.members if actor
members = $game_troop.members unless actor
# カーソルスプライトの作成
@cursor = Sprite.new
@cursor.bitmap = Cache.character("cursor")
@cursor.src_rect.set(0, 0, 32, 32)
@cursor_flame = 0
@cursor.x = -200
@cursor.y = -200
@cursor.ox = @cursor.width
@cursor.oy = @cursor.height
# ターゲット名を表示するヘルプウインドウを作成
@help_window.visible = false if @help_window != nil
@help_window2 = Window_Help.new if @help_window2 == nil
# 不要なウインドウを消す
@actor_command_window.active = false
@skill_window.visible = false if @skill_window != nil
@item_window.visible = false if @item_window != nil
# 存在しているターゲットで最も番号の低い対象を最初に指すように
@index = 0
@max_index = members.size - 1
# アクターは戦闘不能者でもターゲットできるようにエネミーと区別
unless actor
members.size.times do
break if members[@index].exist?
@index += 1
end
end
@help_window2.set_text_n01add(members[@index])
select_member(actor)
end
#--------------------------------------------------------------------------
# ● カーソルを前に移動
#--------------------------------------------------------------------------
def cursor_up(members, actor)
Sound.play_cursor
members.size.times do
@index += members.size - 1
@index %= members.size
break if actor
break if members[@index].exist?
end
@help_window2.set_text_n01add(members[@index])
end
#--------------------------------------------------------------------------
# ● カーソルを次に移動
#--------------------------------------------------------------------------
def cursor_down(members, actor)
Sound.play_cursor
members.size.times do
@index += 1
@index %= members.size
break if actor
break if members[@index].exist? && !actor
end
@help_window2.set_text_n01add(members[@index])
end
end
复制代码
作者:
柳柳
时间:
2012-1-24 18:20
class Window_BattleEnemy < Window_Selectable
alias orial_draw_item draw_item
def draw_item(index)
orial_draw_item(index)
e = $game_troop.alive_members[index]
rt = item_rect_for_text(index)
icons = e.state_icons + e.buff_icons
icons.delete_if{|n| icons.index(n) >= 5}
icons.each_with_index {|n, i| draw_icon(n, rt.x + rt.width - 22 - i * 24, rt.y) }
end
end
复制代码
就行了。支持显示5个,好像5个有点太多了,把那个 >= 5改为3、4什么的可能好一点。
范例工程点此下载
作者:
空の翼
时间:
2012-1-25 14:09
本帖最后由 空の翼 于 2012-1-25 14:23 编辑
柳柳 发表于 2012-1-24 18:20
就行了。支持显示5个,好像5个有点太多了,把那个 >= 5改为3、4什么的可能好一点。
范例工程点此下载
非常感谢柳柳大大~~XD
话说自己的状态栏只是显示两个呢,感觉太少呢= =
作者:
紫菜豆腐煲
时间:
2012-7-18 14:02
本帖最后由 紫菜豆腐煲 于 2012-7-19 04:42 编辑
@柳柳
柳大,能否把一行显示2个敌人改成一行1个呢?这样的话可以多显示
我自己找到了Window_BattleEnemy的
#--------------------------------------------------------------------------
# ● 获取列数
#--------------------------------------------------------------------------
def col_max
return 2 end
复制代码
改为
#--------------------------------------------------------------------------
# ● 获取列数
#--------------------------------------------------------------------------
def col_max
return 1
end
复制代码
作者:
newface
时间:
2012-11-25 17:34
不知道能不能改在敌人战斗图的脚下显示?
作者:
我為了下載
时间:
2012-11-28 00:22
不知道能不能再加个血条....
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1