赞 | 4 |
VIP | 0 |
好人卡 | 0 |
积分 | 78 |
经验 | 15725 |
最后登录 | 2024-11-16 |
在线时间 | 1340 小时 |
Lv4.逐梦者
- 梦石
- 0
- 星屑
- 7777
- 在线时间
- 1340 小时
- 注册时间
- 2015-8-15
- 帖子
- 752
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 金芒芒 于 2022-11-15 15:40 编辑
#============================================================================== # Zenith RGSS4 エネミー残勢力表示 ver1.00 # by 水夜 # [url]http://zenith.ifdef.jp/[/url] #------------------------------------------------------------------------------ # 显示敌方剩余战斗力 #============================================================================== #============================================================================== # □ 常数设置 #============================================================================== module ZENITH32 # エネミー残勢力の表示?非表示を切り替えるスイッチのID(スイッチON時に非表示) #显示能源剩余势力?切换隐藏的开关的ID(开关接通时隐藏) E_SWITCH = 1 # 残勢力ゲージの長さ #残余力量规的长度 EG_WIDTH = 180 #宽度 # 残勢力ゲージの色#残余力量规的颜色 EG_COLOR = Color.new(255, 0, 0, 255) # 表示する文字列#要显示的字符串 EW_NAME = "敌方剩余战斗力" # 表示する文字列の色 EW_COLOR = Color.new(255, 255, 255, 255) end #============================================================================== # ■ Window_BattleStatus #============================================================================== class Window_BattleStatus < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- alias zenith32_initialize initialize def initialize # エネミー勢力スプライト作成#创建能源势力精灵 @enemy_force = Sprite.new # 敌军战斗力=精灵.new @enemy_force.bitmap = Bitmap.new(8 + ZENITH32::EG_WIDTH, 34) @enemy_force.x = 640 - (12 + ZENITH32::EG_WIDTH) @enemy_force.y = 62 @enemy_force.z = 50 # 呼び戻す zenith32_initialize end #-------------------------------------------------------------------------- # ● 解放 #-------------------------------------------------------------------------- alias zenith32_dispose dispose def dispose # エネミー勢力スプライト解放 @enemy_force.bitmap.dispose @enemy_force.dispose # 呼び戻す zenith32_dispose end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- alias zenith32_refresh refresh def refresh # 呼び戻す zenith32_refresh if $game_switches[ZENITH32::E_SWITCH] == false @enemy_force.visible = true @enemy_force.bitmap.clear x = 4 y = 4 width = ZENITH32::EG_WIDTH # 文字列を描画 @enemy_force.bitmap.font.size = 18 #字体大小 @enemy_force.bitmap.font.color = Color.new(0, 0, 0, 255) @enemy_force.bitmap.draw_text(x+1, y+1, width, 22, ZENITH32::EW_NAME) @enemy_force.bitmap.draw_text(x-1, y-1, width, 22, ZENITH32::EW_NAME) @enemy_force.bitmap.draw_text(x+1, y-1, width, 22, ZENITH32::EW_NAME) @enemy_force.bitmap.draw_text(x-1, y+1, width, 22, ZENITH32::EW_NAME) @enemy_force.bitmap.font.color = ZENITH32::EW_COLOR @enemy_force.bitmap.draw_text(x, y, width, 22, ZENITH32::EW_NAME) # エネミー勢力を描画 @item_max = $game_troop.enemies.size enemy_mh = 0 enemy_h = 0 for i in 0...@item_max enemy = $game_troop.enemies[i] enemy_mh += enemy.maxhp enemy_h += enemy.hp end @enemy_force.bitmap.fill_rect(x-1, y+24, width+2,5, Color.new(0, 0, 0, 150)) w = width * enemy_h / enemy_mh @enemy_force.bitmap.fill_rect(x+width-w, y+25, w,3, ZENITH32::EG_COLOR) else @enemy_force.visible = false end end end
#==============================================================================
# Zenith RGSS4 エネミー残勢力表示 ver1.00
# by 水夜
# [url]http://zenith.ifdef.jp/[/url]
#------------------------------------------------------------------------------
# 显示敌方剩余战斗力
#==============================================================================
#==============================================================================
# □ 常数设置
#==============================================================================
module ZENITH32
# エネミー残勢力の表示?非表示を切り替えるスイッチのID(スイッチON時に非表示)
#显示能源剩余势力?切换隐藏的开关的ID(开关接通时隐藏)
E_SWITCH = 1
# 残勢力ゲージの長さ #残余力量规的长度
EG_WIDTH = 180 #宽度
# 残勢力ゲージの色#残余力量规的颜色
EG_COLOR = Color.new(255, 0, 0, 255)
# 表示する文字列#要显示的字符串
EW_NAME = "敌方剩余战斗力"
# 表示する文字列の色
EW_COLOR = Color.new(255, 255, 255, 255)
end
#==============================================================================
# ■ Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias zenith32_initialize initialize
def initialize
# エネミー勢力スプライト作成#创建能源势力精灵
@enemy_force = Sprite.new # 敌军战斗力=精灵.new
@enemy_force.bitmap = Bitmap.new(8 + ZENITH32::EG_WIDTH, 34)
@enemy_force.x = 640 - (12 + ZENITH32::EG_WIDTH)
@enemy_force.y = 62
@enemy_force.z = 50
# 呼び戻す
zenith32_initialize
end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
alias zenith32_dispose dispose
def dispose
# エネミー勢力スプライト解放
@enemy_force.bitmap.dispose
@enemy_force.dispose
# 呼び戻す
zenith32_dispose
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
alias zenith32_refresh refresh
def refresh
# 呼び戻す
zenith32_refresh
if $game_switches[ZENITH32::E_SWITCH] == false
@enemy_force.visible = true
@enemy_force.bitmap.clear
x = 4
y = 4
width = ZENITH32::EG_WIDTH
# 文字列を描画
@enemy_force.bitmap.font.size = 18 #字体大小
@enemy_force.bitmap.font.color = Color.new(0, 0, 0, 255)
@enemy_force.bitmap.draw_text(x+1, y+1, width, 22, ZENITH32::EW_NAME)
@enemy_force.bitmap.draw_text(x-1, y-1, width, 22, ZENITH32::EW_NAME)
@enemy_force.bitmap.draw_text(x+1, y-1, width, 22, ZENITH32::EW_NAME)
@enemy_force.bitmap.draw_text(x-1, y+1, width, 22, ZENITH32::EW_NAME)
@enemy_force.bitmap.font.color = ZENITH32::EW_COLOR
@enemy_force.bitmap.draw_text(x, y, width, 22, ZENITH32::EW_NAME)
# エネミー勢力を描画
@item_max = $game_troop.enemies.size
enemy_mh = 0
enemy_h = 0
for i in 0...@item_max
enemy = $game_troop.enemies[i]
enemy_mh += enemy.maxhp
enemy_h += enemy.hp
end
@enemy_force.bitmap.fill_rect(x-1, y+24, width+2,5, Color.new(0, 0, 0, 150))
w = width * enemy_h / enemy_mh
@enemy_force.bitmap.fill_rect(x+width-w, y+25, w,3, ZENITH32::EG_COLOR)
else
@enemy_force.visible = false
end
end
end
|
|