Project1
标题:
谁帮我看看这个不长的脚本..
[打印本页]
作者:
雪_“‘
时间:
2010-7-1 21:20
标题:
谁帮我看看这个不长的脚本..
本帖最后由 雪_“‘ 于 2010-7-3 15:38 编辑
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
#增加显示血槽的功能 by KING
#◆◇◆◇◆-----XRXS54. マップ上で簡易ウィンドウ表示 ver1.0 -----◇◆◇◆◇
# by 刻宮
# 「ディフォルト機能 & 仕様」
# ・$WIN_2 = true。としても、スイッチがONでかつ、アクターが存在しなければ
# ウィンドウは表示されません。この3要素が揃った時にウィンドウを表示します。
# ・逆にこの要素が一つでも欠けるとウィンドウは自動的に非表示になります。
# ・ツクール開始時はスイッチはOFFなので、ONにしないと表示されません。
#------------------------------------------------------------------
# カスタマイズポイント
#(*存在しないスイッチを指定されるとエラーになります。)
#----------------------------------------------------------------
# 使用说明(66RPG提示:本脚本其实难度不是很高,建议学习RGSS略有心得
# 的人尝试自己编写一个同类功能窗口)
#----------------------------------------------------------------
WIN_1 = true # 是否使用1号窗口,true为使用,false为不使用
SWITVH_1 = 40 # 当此编号开关打开的时候窗口显示。如设置为40则40号开关打开,1号窗口显示
OPACITY_1 = 144 # 1号窗口透明度
X_1 = 0 # 1号窗口X坐标
Y_1 = 384 # 1号窗口Y坐标
$WIN_2 = true # 是否使用2号窗口,true为使用,false为不使用
SWITVH_2 = 41 # 当此编号开关打开的时候窗口显示。如设置为41则41号开关打开,2号窗口显示
OPACITY_2 = 144 # 2号窗口透明度
X_2 = 160 # 2号窗口X坐标
Y_2 = 384 # 2号窗口Y坐标
WIN_3 = true # 是否使用3号窗口,true为使用,false为不使用
SWITVH_3 = 42 # 当此编号开关打开的时候窗口显示。如设置为42则42号开关打开,3号窗口显示
OPACITY_3 = 144 # 3号窗口透明度
X_3 = 320 # 3号窗口X坐标
Y_3 = 384 # 3号窗口Y坐标
WIN_4 = true # 是否使用4号窗口,true为使用,false为不使用
SWITVH_4 = 43 # 当此编号开关打开的时候窗口显示。如设置为43则43号开关打开,4号窗口显示
OPACITY_4 = 144 # 4号窗口透明度
X_4 = 480 # 4号窗口X坐标
Y_4 = 384 # 4号窗口Y坐标
SET_SP = [true,true,true,true]# 决定各个窗口是否显示SP数值,true为显示,false为不显示。
OPTION = 44 # 决定在对话的时候是否让窗口隐藏的开关编号。
# 比如设置为44,则当44号开关打开,则在对话的时候窗口隐藏
# 否则窗口不隐藏。
#=========================================================================
# ■ Scene_Map
#=========================================================================
class Scene_Map
#---------------------------------------------------------------------
# ● フレーム更新
#---------------------------------------------------------------------
alias main_tokimiya main
def main
# 簡易ウィンドウ1を作成
@simple_window1 = Window_MapStatus.new(X_1,Y_1,0)
@simple_window1.opacity = OPACITY_1
@simple_window1.visible = $game_switches[SWITVH_1]
unless $game_party.actors.size > 0
@simple_window1.visible = false
end
# 簡易ウィンドウ2を作成
@simple_window2 = Window_MapStatus.new(X_2,Y_2,1)
@simple_window2.opacity = OPACITY_2
@simple_window2.visible = $game_switches[SWITVH_2]
unless $game_party.actors.size > 1
@simple_window2.visible = false
end
# 簡易ウィンドウ3を作成
@simple_window3 = Window_MapStatus.new(X_3,Y_3,2)
@simple_window3.opacity = OPACITY_3
@simple_window3.visible = $game_switches[SWITVH_3]
unless $game_party.actors.size > 2
@simple_window3.visible = false
end
# 簡易ウィンドウ4を作成
@simple_window4 = Window_MapStatus.new(X_4,Y_4,3)
@simple_window4.opacity = OPACITY_4
@simple_window4.visible = $game_switches[SWITVH_4]
unless $game_party.actors.size > 3
@simple_window4.visible = false
end
main_tokimiya # 旧メソッドの呼び出し
# 簡易ウィンドウの解放
@simple_window1.dispose
@simple_window2.dispose
@simple_window3.dispose
@simple_window4.dispose
end
#---------------------------------------------------------------------
# ● フレーム更新
#---------------------------------------------------------------------
alias update_tokimiya update
def update
update_tokimiya # 旧メソッドの呼び出し
# 以前のパラメーターと相違があれば、内容を更新する。
#
# ウィンドウ1の更新。
if WIN_1 == true and $game_party.actors.size > 0
# データの更新
actor = $game_party.actors[0]
factor_1 = @simple_window1.before_1[0] != actor.name
factor_2 = @simple_window1.before_1[1] != actor.hp
factor_3 = @simple_window1.before_1[2] != actor.sp
if factor_1 or factor_2 or factor_3
@simple_window1.before_1[0] = actor.name
@simple_window1.before_1[1] = actor.hp
@simple_window1.before_1[2] = actor.sp
@simple_window1.refresh(0)
end
# 非表示機能の実行
if @message_window.visible == true and $game_switches[OPTION] == true
@simple_window1.before_1[3] = false
@simple_window1.visible = false
elsif @simple_window1.before_1[3] != $game_switches[SWITVH_1]
@simple_window1.before_1[3] = $game_switches[SWITVH_1]
@simple_window1.visible = $game_switches[SWITVH_1]
end
end
# ウィンドウ2の更新。
if $WIN_2 == true and $game_party.actors.size > 1
# データの更新
actor = $game_party.actors[1]
factor_1 = @simple_window2.before_2[0] != actor.name
factor_2 = @simple_window2.before_2[1] != actor.hp
factor_3 = @simple_window2.before_2[2] != actor.sp
if factor_1 or factor_2 or factor_3
@simple_window2.before_2[0] = actor.name
@simple_window2.before_2[1] = actor.hp
@simple_window2.before_2[2] = actor.sp
@simple_window2.refresh(1)
# ウィンドウを強制的に生成
@simple_window2.before_2[3] = true
@simple_window2.visible = true
end
# 非表示機能の実行
if @message_window.visible == true and $game_switches[OPTION] == true
@simple_window2.before_2[3] = false
@simple_window2.visible = false
elsif @simple_window2.before_2[3] != $game_switches[SWITVH_2]
@simple_window2.before_2[3] = $game_switches[SWITVH_2]
@simple_window2.visible = $game_switches[SWITVH_2]
end
# アクターが存在しないのにウィンドウが表示されたままの場合。
elsif @simple_window2.visible == true and @simple_window2.before_2 != nil
# ウィンドウを消去。
@simple_window2.before_2[3] = false
@simple_window2.visible = false
end
# ウィンドウ3の更新。
if WIN_3 == true and $game_party.actors.size > 2
# データの更新
actor = $game_party.actors[2]
factor_1 = @simple_window3.before_3[0] != actor.name
factor_2 = @simple_window3.before_3[1] != actor.hp
factor_3 = @simple_window3.before_3[2] != actor.sp
if factor_1 or factor_2 or factor_3
@simple_window3.before_3[0] = actor.name
@simple_window3.before_3[1] = actor.hp
@simple_window3.before_3[2] = actor.sp
@simple_window3.refresh(2)
# ウィンドウを強制的に生成
@simple_window3.before_3[3] = true
@simple_window3.visible = true
end
# 非表示機能の実行
if @message_window.visible == true and $game_switches[OPTION] == true
@simple_window3.before_3[3] = false
@simple_window3.visible = false
elsif @simple_window3.before_3[3] != $game_switches[SWITVH_3]
@simple_window3.before_3[3] = $game_switches[SWITVH_3]
@simple_window3.visible = $game_switches[SWITVH_3]
end
# アクターが存在しないのにウィンドウが表示されたままの場合。
elsif @simple_window3.visible == true and @simple_window3.before_3 != nil
# ウィンドウを消去。
@simple_window3.before_3[3] = false
@simple_window3.visible = false
end
# ウィンドウ4の更新。
if WIN_4 == true and $game_party.actors.size > 3
# データの更新
actor = $game_party.actors[3]
factor_1 = @simple_window4.before_4[0] != actor.name
factor_2 = @simple_window4.before_4[1] != actor.hp
factor_3 = @simple_window4.before_4[2] != actor.sp
if factor_1 or factor_2 or factor_3
@simple_window4.before_4[0] = actor.name
@simple_window4.before_4[1] = actor.hp
@simple_window4.before_4[2] = actor.sp
@simple_window4.refresh(3)
# ウィンドウを強制的に生成
@simple_window4.before_4[3] = true
@simple_window4.visible = true
end
# 非表示機能の実行
if @message_window.visible == true and $game_switches[OPTION] == true
@simple_window4.before_4[3] = false
@simple_window4.visible = false
elsif @simple_window4.before_4[3] != $game_switches[SWITVH_4]
@simple_window4.before_4[3] = $game_switches[SWITVH_4]
@simple_window4.visible = $game_switches[SWITVH_4]
end
# アクターが存在しないのにウィンドウが表示されたままの場合。
elsif @simple_window4.visible == true and @simple_window4.before_4 != nil
# ウィンドウを消去。
@simple_window4.before_4[3] = false
@simple_window4.visible = false
end
end
end
#=========================================================================
# ■ Window_MapStatus,脚本来自www.66rpg.com,转载请注意说明
#=========================================================================
class Window_MapStatus < Window_Base
#--------------------------------------------------------------------------
# ○ 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :before_1 # 更新前のウィンドウ1のパラメーター
attr_accessor :before_2 # 更新前のウィンドウ2のパラメーター
attr_accessor :before_3 # 更新前のウィンドウ3のパラメーター
attr_accessor :before_4 # 更新前のウィンドウ4のパラメーター
#---------------------------------------------------------------------
# ● フレーム更新
#---------------------------------------------------------------------
def initialize(x,y,id)
super(x,y,160,96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.size = 18
@before_1=[]
@before_2=[]
@before_3=[]
@before_4=[]
# 現段階のアクターのパラメーターと可視状態を記憶。
data
# 項目の描画。
refresh(id)
end
#--------------------------------------------------------------------------
# ● 項目の描画
#--------------------------------------------------------------------------
def data
# アクター1の記憶(ただし、パーティが1名以上の場合)
if $game_party.actors.size > 0
actor = $game_party.actors[0]
@before_1 = [actor.name, actor.hp, actor.sp,true]
end
# アクター2の記憶(ただし、パーティが2名以上の場合)
if $game_party.actors.size > 1
actor = $game_party.actors[1]
@before_2 = [actor.name, actor.hp, actor.sp,true]
end
# アクター3の記憶(ただし、パーティが3名以上の場合)
if $game_party.actors.size > 2
actor = $game_party.actors[2]
@before_3 = [actor.name, actor.hp, actor.sp,true]
end
# アクター3の記憶(ただし、パーティが4名以上の場合)
if $game_party.actors.size > 3
actor = $game_party.actors[3]
@before_4 = [actor.name, actor.hp, actor.sp,true]
end
end
#--------------------------------------------------------------------------
# ● 項目の描画
#--------------------------------------------------------------------------
def refresh(id)
# 再描画のために一旦内容を破棄する
self.contents.clear
# 対応するアクターがいなければ、何もせずに終了する。
actor = $game_party.actors[id]
if actor == nil
return
end
# 名前の描画
draw_actor_name(actor, 0, -5)
# HPの描画
if SET_SP[id]
draw_actor_hp_custom(actor, 0, 18)
else
draw_actor_hp_custom(actor, 0, 28)
end
# SPの描画
if SET_SP[id]
draw_actor_sp_custom(actor, 0, 36)
end
end
#--------------------------------------------------------------------------
# ● HP の描画
# actor : アクター
# x : 描画先 X 座標
# y : 描画先 Y 座標
# width : 描画先の幅
#--------------------------------------------------------------------------
def draw_actor_hp_custom(actor, x, y, width = 144)
draw_actor_hp2222(actor, x, y+10, width = 100, height=8)#------------------血条显示----------------------
# 文字列 "HP" を描画
#self.contents.font.color = system_color
#self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
# MaxHP を描画するスペースがあるか計算
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
# HP を描画
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
#self.contents.draw_text(hp_x - 12, y, 48, 32, actor.hp.to_s, 2)
# MaxHP を描画
if flag
self.contents.font.color = normal_color
#self.contents.draw_text(hp_x + 48 - 12, y, 12, 32, "/", 1)
#self.contents.draw_text(hp_x + 60 - 12, y, 48, 32, actor.maxhp.to_s)
end
end
#--------------------------------------------------------------------------
# ● SP の描画
# actor : アクター
# x : 描画先 X 座標
# y : 描画先 Y 座標
# width : 描画先の幅
#--------------------------------------------------------------------------
def draw_actor_sp_custom(actor, x, y, width = 144)
draw_actor_sp2222(actor, x, y+10, width = 100, height=8)#------------------血条显示----------------------
# 文字列 "SP" を描画
#self.contents.font.color = system_color
#self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
# MaxSP を描画するスペースがあるか計算
if width - 32 >= 108
sp_x = x + width - 108
flag = true
elsif width - 32 >= 48
sp_x = x + width - 48
flag = false
end
# SP を描画
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
#self.contents.draw_text(sp_x - 12, y, 48, 32, actor.sp.to_s, 2)
# MaxSP を描画
if flag
self.contents.font.color = normal_color
#self.contents.draw_text(sp_x + 48 - 12, y, 12, 32, "/", 1)
#self.contents.draw_text(sp_x + 60 - 12, y, 48, 32, actor.maxsp.to_s)
end
end
end
#==============================================================================
# Window_Base
#==============================================================================
class Window_Base < Window
def draw_actor_hp2222(actor, x, y, width = 100, height=8)
y+=3
olx = x
oly = y
w = width * actor.hp / [actor.maxhp,1].max
hp_color_1 = Color.new(255, 0, 0, 192)
hp_color_2 = Color.new(255, 255, 0, 192)
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
x -= 1
y += (height/4).floor
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
x = olx
y = oly-14
# 描绘字符串 "HP"
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
# 计算描绘 MaxHP 所需的空间
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
# 描绘 HP
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
# 描绘 MaxHP
if flag
self.contents.font.color = normal_color
self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
end
end
def draw_actor_sp2222(actor, x, y, width = 100, height = 8)
y+=3
olx = x
oly = y
w = width * actor.sp / [actor.maxsp,1].max
hp_color_1 = Color.new( 0, 0, 255, 192)
hp_color_2 = Color.new( 0, 255, 255, 192)
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
x -= 1
y += (height/4).floor
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
x = olx
y = oly-14
# 描绘字符串 "SP"
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
# 计算描绘 MaxSP 所需的空间
if width - 32 >= 108
sp_x = x + width - 108
flag = true
elsif width - 32 >= 48
sp_x = x + width - 48
flag = false
end
# 描绘 SP
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
# 描绘 MaxSP
if flag
self.contents.font.color = normal_color
self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
end
end
#--------------------------------------------------------------------------
# ● ライン描画 by 桜雅 在土
#--------------------------------------------------------------------------
def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
# 描写距離の計算。大きめに直角時の長さ。
distance = (start_x - end_x).abs + (start_y - end_y).abs
# 描写開始
if end_color == start_color
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
if width == 1
self.contents.set_pixel(x, y, start_color)
else
self.contents.fill_rect(x, y, width, width, start_color)
end
end
else
for i in 0...$game_party.actors.size
y = i * 32+25
actor = $game_party.actors[i]
k = (actor.hp*100/actor.maxhp)
self.contents.fill_rect(0, y, 102,11, Color.new(0, 0, 0, 255))
self.contents.fill_rect(0+1, y+1, k,2, Color.new(192, 128, 128, 160))
self.contents.fill_rect(0+1, y+3, k,2, Color.new(255, 255, 55, 255))
self.contents.fill_rect(0+1, y+5, k, 2, Color.new(192, 192, 55, 255))
self.contents.fill_rect(0+1, y+7, k,2, Color.new(192, 128, 0, 160))
end
end
end
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
复制代码
这个脚本是地图显示HP SP的,但是为什么我用这个脚本显示不了SP?谁知道,另外,能不能把HP和SP在减少时渐渐减少,例如:角色被减50血,那HP的显示条就从现有的血慢慢减去50血..谢谢各位.....
作者:
猫猫~
时间:
2010-7-1 21:22
用这个
# ————————————————————————————————————
# 本脚本来自www.66rpg.com,转载请保留此信息
# ————————————————————————————————————
# ▼▲▼ XRXS_BP 7. バトルステータス?クリアデザイン ver.1.03 ▼▲▼
# by 桜雅 在土
#==============================================================================
# ■ Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :update_cp_only # CPメーターのみの更新
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias carol3_66rpg_initialize initialize
def initialize
@previous_hp = []
@previous_sp = []
carol3_66rpg_initialize
self.opacity = 160
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
alias carol3_66rpg_refresh refresh
def refresh
# CPメーターの更新のみ の場合
if @update_cp_only
carol3_66rpg_refresh
return
end
# 変更するものがない場合、飛ばす
@item_max = $game_party.actors.size
bool = false
for i in 0...@item_max
actor = $game_party.actors[i]
if (@previous_hp[i] != actor.hp) or (@previous_sp[i] != actor.sp)
bool = true
end
end
return if bool == false
# 描写を開始
self.contents.clear
for i in 0...@item_max
actor = $game_party.actors[i]
actor_x = i * 160 + 21
# 歩行キャラグラフィックの描写
draw_actor_graphic(actor, actor_x - 9, 116)
# HP/SPメーターの描写
draw_actor_hp_meter_line(actor, actor_x, 52, 96, 12)
draw_actor_sp_meter_line(actor, actor_x, 84, 96, 12)
# HP数値の描写
self.contents.font.size = 24 # HP/SP数値の文字の大きさ
self.contents.font.color = Color.new(0,0,0,192)
self.contents.draw_text(actor_x, 40, 96, 24, actor.hp.to_s, 2)
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(actor_x-2, 38, 96, 24, actor.hp.to_s, 2)
# SP数値の描写
self.contents.font.color = Color.new(0,0,0,192)
self.contents.draw_text(actor_x, 72, 96, 24, actor.sp.to_s, 2)
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(actor_x-2, 70, 96, 24, actor.sp.to_s, 2)
# 用語「HP」と用語「SP」の描写
self.contents.font.size = 18 # 用語「HP/SP」の文字の大きさ
draw_actor_name(actor,actor_x-12,0)
self.contents.font.color = Color.new(0,0,0,192)
self.contents.draw_text(actor_x+2, 32, 196, 24, $data_system.words.hp)
self.contents.draw_text(actor_x+2, 64, 196, 24, $data_system.words.sp)
self.contents.font.color = system_color # 用語「HP/SP」の文字の色
self.contents.draw_text(actor_x, 30, 196, 24, $data_system.words.hp)
self.contents.draw_text(actor_x, 62, 196, 24, $data_system.words.sp)
# ステートの描写
draw_actor_state(actor, actor_x, 100)
# 値を更新
@previous_hp[i] = actor.hp
@previous_hp[i] = actor.hp
end
end
end
#==============================================================================
# ■ Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● HPメーター の描画
#--------------------------------------------------------------------------
def draw_actor_hp_meter_line(actor, x, y, width = 156, height = 4)
w = width * actor.hp / actor.maxhp
hp_color_1 = Color.new(255, 0, 0, 192)
hp_color_2 = Color.new(255, 255, 0, 192)
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
x -= 1
y += (height/4).floor
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
end
#--------------------------------------------------------------------------
# ● SPメーター の描画
#--------------------------------------------------------------------------
def draw_actor_sp_meter_line(actor, x, y, width = 156, height = 4)
w = width * actor.sp / actor.maxsp
hp_color_1 = Color.new( 0, 0, 255, 192)
hp_color_2 = Color.new( 0, 255, 255, 192)
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
x -= 1
y += (height/4).floor
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
x -= 1
y += (height/4).ceil
self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
end
#--------------------------------------------------------------------------
# ● 名前の描画
#--------------------------------------------------------------------------
alias carol3_66rpg_draw_actor_name draw_actor_name
def draw_actor_name(actor, x, y)
carol3_66rpg_draw_actor_name(actor, x, y) if @draw_ban != true
end
#--------------------------------------------------------------------------
# ● ステートの描画
#--------------------------------------------------------------------------
alias carol3_66rpg_draw_actor_state draw_actor_state
def draw_actor_state(actor, x, y, width = 120)
carol3_66rpg_draw_actor_state(actor, x, y, width) if @draw_ban != true
end
#--------------------------------------------------------------------------
# ● HP の描画
#--------------------------------------------------------------------------
alias carol3_66rpg_draw_actor_hp draw_actor_hp
def draw_actor_hp(actor, x, y, width = 144)
carol3_66rpg_draw_actor_hp(actor, x, y, width) if @draw_ban != true
end
#--------------------------------------------------------------------------
# ● SP の描画
#--------------------------------------------------------------------------
alias carol3_66rpg_draw_actor_sp draw_actor_sp
def draw_actor_sp(actor, x, y, width = 144)
carol3_66rpg_draw_actor_sp(actor, x, y, width) if @draw_ban != true
end
end
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias carol3_66rpg_update update
def update
carol3_66rpg_update
# メッセージウィンドウ表示中の場合
if $game_temp.message_window_showing
@status_window.update_cp_only = true
@status_window.update_cp_only = false
else
end
end
end
#==============================================================================
# ◇ 外部ライブラリ
#==============================================================================
class Window_Base
#--------------------------------------------------------------------------
# ● ライン描画 軽量版 by 桜雅 在土
#--------------------------------------------------------------------------
def draw_lineght(start_x, start_y, end_x, end_y, start_color)
# 描写距離の計算。大きめに直角時の長さ。
distance = (start_x - end_x).abs + (start_y - end_y).abs
# 描写開始
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
self.contents.set_pixel(x, y, start_color)
end
end
#--------------------------------------------------------------------------
# ● ライン描画 by 桜雅 在土
#--------------------------------------------------------------------------
def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
# 描写距離の計算。大きめに直角時の長さ。
distance = (start_x - end_x).abs + (start_y - end_y).abs
# 描写開始
if end_color == start_color
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
if width == 1
self.contents.set_pixel(x, y, start_color)
else
self.contents.fill_rect(x, y, width, width, start_color)
end
end
else
for i in 1..distance
x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
r = start_color.red * (distance-i)/distance + end_color.red * i/distance
g = start_color.green * (distance-i)/distance + end_color.green * i/distance
b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
if width == 1
self.contents.set_pixel(x, y, Color.new(r, g, b, a))
else
self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))
end
end
end
end
end
复制代码
作者:
雪_“‘
时间:
2010-7-1 21:25
你那个跟我的一样........
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1