赞 | 0 |
VIP | 0 |
好人卡 | 1 |
积分 | 2 |
经验 | 2085 |
最后登录 | 2013-8-20 |
在线时间 | 37 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 205
- 在线时间
- 37 小时
- 注册时间
- 2010-10-26
- 帖子
- 16
|
可以试试这个脚本~~~~
效果图:
- #=============================================================================
- #================================卡通血条=====================================
- #=============================================================================
- #脚本功能:用来看的吧……提示HP,SP的“去值”,方便于选择恢复物品,特技用……
- #不用该提示可以关掉,下面是开关号,不想用我设的开关号就自己设吧。
- HP_SWITCHE = 1 #HP去值显现开关ID
- SP_SWITCHE = 2 #SP去值显现开关ID
- #以下是HP,SP这就个字的颜色修改,不想用我设的话就自己改下,可能得到特殊效果……
- #“HP”字符串颜色
- HP_COLOR = Color.new(224,106,187,255)
- #“SP”字符串颜色
- SP_COLOR = Color.new(5,214,202,255)
- #血条长度
- HP_XT = 130
- #魔条长度
- SP_XT = 130
- #底色选择&改变&自定义
- #HP/SP底色也就是那条橘黄true/橘色 false/黑色
- #使用方法:想用黑色做底的话直接把下面的true改为false
- HP_YELLOW_BACK = true #true/false
- SP_YELLOW_BACK = true #true/false
- #底色自定义说明:自定义的话先把上面的true改为false才有效,然后把#后去掉在对相应
- #修改,可以打开PS或window图画工具做参考~
- HP_ZDYCOLOR = #Color.new(r,g,b,255)
- SP_ZDYCOLOR = #Color.new(红,绿,蓝,255)
- #===============================================================================
- class Window_Base < Window
- @@color1 = Color.new(212, 37, 62, 255)
- @@color2 = Color.new(0, 0, 0, 255)
- alias :draw_actor_hp_original :draw_actor_hp
- def draw_actor_hp(actor,x,y,w=HP_XT,width = 144)
- self.contents.fill_rect(x-2,y+16,w+4,16,Color.new(255,255,255,255))
- self.contents.fill_rect(x-1,y+17,w+2,14,Color.new(0,0,0,255))
- if HP_YELLOW_BACK == true
- self.contents.fill_rect(x,y+18,w,13,Color.new(217,168,0,255))
- else
- self.contents.fill_rect(x,y+18,w,13,(HP_ZDYCOLOR or @@color2))
- end
- w1 = w * actor.hp/actor.maxhp
- self.contents.fill_rect(x,y+18,w1,1,Color.new(250,155,155,255))
- self.contents.fill_rect(x,y+19,w1,1,Color.new(250,120,120,255))
- self.contents.fill_rect(x,y+20,w1,1,Color.new(250,90,85,255))
- self.contents.fill_rect(x,y+21,w1,1,Color.new(250,60,55,255))
- self.contents.fill_rect(x,y+22,w1,1,Color.new(250,35,30,255))
- self.contents.fill_rect(x,y+23,w1,1,Color.new(250,10,5,255))
- self.contents.fill_rect(x,y+24,w1,1,Color.new(250,10,5,255))
- self.contents.fill_rect(x,y+25,w1,1,Color.new(250,10,5,255))
- self.contents.fill_rect(x,y+26,w1,1,Color.new(250,35,30,255))
- self.contents.fill_rect(x,y+27,w1,1,Color.new(250,60,55,255))
- self.contents.fill_rect(x,y+28,w1,1,Color.new(250,90,85,255))
- self.contents.fill_rect(x,y+29,w1,1,Color.new(250,120,120,255))
- self.contents.fill_rect(x,y+30,w1,1,Color.new(250,155,155,255))
- b = actor.maxhp - actor.hp
- i = x + w1
- self.contents.font.size = 17
- if actor.hp <= 0
- self.contents.font.color = Color.new(105,106,107,255)
- self.contents.draw_text(i,y+9,w1+50,30,"死亡" )
- end
- if $game_switches[HP_SWITCHE] == true
- if b > 0
- self.contents.font.color = @@color1
- if actor.hp > 0
- self.contents.draw_text(i,y+9,w1+50,30,"-" + b.to_s)
- end
- end
- end
- self.contents.font.size = 20
- self.contents.font.color = HP_COLOR
- self.contents.draw_text(x, y-8, 32, 32, $data_system.words.hp)
- if width - 32 >= 108
- hp_x = x + width - 108
- flag = true
- elsif width - 32 >= 48
- hp_x = x + width - 48
- flag = false
- end
- self.contents.font.size = 17
- 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-8, 40, 32, actor.hp.to_s, 2)
- if flag
- self.contents.font.color = normal_color
- #self.contents.draw_text(hp_x + 30, y-8, 12, 32, "/", 1)
- #self.contents.draw_text(hp_x + 40, y-8, 48, 32, actor.maxhp.to_s)
- end
- self.contents.font.size = 20
- end
- alias :draw_actor_sp_original :draw_actor_sp
- def draw_actor_sp(actor,x,y,w=SP_XT, width = 144)
- self.contents.fill_rect(x-2,y+16,w+4,16,Color.new(255,255,255,255))
- self.contents.fill_rect(x-1,y+17,w+2,14,Color.new(0,0,0,255))
- if SP_YELLOW_BACK == true
- self.contents.fill_rect(x,y+18,w,13,Color.new(217,168,0,255))
- else
- self.contents.fill_rect(x,y+18,w,13,(SP_ZDYCOLOR or @@color2))
- end
- w1 = w * actor.sp/actor.maxsp
- self.contents.fill_rect(x,y+18,w1,1,Color.new(0,110,205,255))
- self.contents.fill_rect(x,y+19,w1,1,Color.new(0,130,225,255))
- self.contents.fill_rect(x,y+20,w1,1,Color.new(0,150,235,255))
- self.contents.fill_rect(x,y+21,w1,1,Color.new(0,170,240,255))
- self.contents.fill_rect(x,y+22,w1,1,Color.new(0,180,245,255))
- self.contents.fill_rect(x,y+23,w1,1,Color.new(0,180,250,255))
- self.contents.fill_rect(x,y+24,w1,1,Color.new(0,180,255,255))
- self.contents.fill_rect(x,y+25,w1,1,Color.new(0,180,250,255))
- self.contents.fill_rect(x,y+26,w1,1,Color.new(0,180,245,255))
- self.contents.fill_rect(x,y+27,w1,1,Color.new(0,170,240,255))
- self.contents.fill_rect(x,y+28,w1,1,Color.new(0,150,235,255))
- self.contents.fill_rect(x,y+29,w1,1,Color.new(0,130,225,255))
- self.contents.fill_rect(x,y+30,w1,1,Color.new(0,110,205,255))
- b = actor.maxsp - actor.sp
- i = x + w1
- self.contents.font.size = 17
- if $game_switches[SP_SWITCHE] == true
- if b > 0
- self.contents.font.color = @@color1
- self.contents.draw_text(i,y+9,w1+50,30,"-" + b.to_s)
- else
- end
- end
- self.contents.font.size = 20
- self.contents.font.color = SP_COLOR
- self.contents.draw_text(x, y-8, 32, 32, $data_system.words.sp)
- if width - 32 >= 108
- sp_x = x + width - 108
- flag = true
- elsif width - 32 >= 48
- sp_x = x + width - 48
- flag = false
- end
- self.contents.font.size = 17
- 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-8, 40, 32, actor.sp.to_s, 2)
- if flag
- self.contents.font.color = normal_color
- #self.contents.draw_text(sp_x + 30, y-8, 12, 32, "/", 1)
- #self.contents.draw_text(sp_x + 40, y-8, 48, 32, actor.maxsp.to_s)
- end
- self.contents.font.size = 20
- end
- end
- #==============================================================================
- # ■ Game_Actor
- #------------------------------------------------------------------------------
- # アクターを扱うクラスです。このクラスは Game_Actors クラス ($game_actors)
- # の内部で使用され、Game_Party クラス ($game_party) からも参照されます。
- #==============================================================================
- class Game_Actor < Game_Battler
- def now_exp
- return @exp - @exp_list[@level]
- end
- def next_exp
- return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
- end
- end
- #==============================================================================
- #经验条
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ● EXP ゲージの描画
- #--------------------------------------------------------------------------
- # オリジナルのEXP描画を draw_actor_sp_original と名前変更
- alias :draw_actor_exp_original :draw_actor_exp
- def draw_actor_exp(actor, x, y, width = 204)
- # 変数rateに 現在のexp/nextexpを代入
- if actor.next_exp != 0
- rate = actor.now_exp.to_f / actor.next_exp
- else
- rate = 1
- end
- # plus_x:X座標の位置補正 rate_x:X座標の位置補正(%) plus_y:Y座標の位置補正
- # plus_width:幅の補正 rate_width:幅の補正(%) height:縦幅
- # align1:描画タイプ1 0:左詰め 1:中央揃え 2:右詰め
- # align2:描画タイプ2 0:上詰め 1:中央揃え 2:下詰め
- # align3:ゲージタイプ 0:左詰め 1:右詰め
- plus_x = 0
- rate_x = 0
- plus_y = 25
- plus_width = 0
- rate_width = 100
- height = 10
- align1 = 1
- align2 = 2
- align3 = 0
- # グラデーション設定 grade1:空ゲージ grade2:実ゲージ
- # (0:横にグラデーション 1:縦にグラデーション 2:斜めにグラデーション(激重))
- grade1 = 1
- grade2 = 0
- # 色設定。color1:外枠,color2:中枠
- # color3:空ゲージダークカラー,color4:空ゲージライトカラー
- # color5:実ゲージダークカラー,color6:実ゲージライトカラー
- color1 = Color.new(0, 0, 0, 192)
- color2 = Color.new(255, 255, 192, 192)
- color3 = Color.new(0, 0, 0, 192)
- color4 = Color.new(64, 0, 0, 192)
- color5 = Color.new(80 * rate, 80 - 80 * rate ** 2, 80 - 80 * rate, 192)
- color6 = Color.new(240 * rate, 240 - 240 * rate ** 2, 240 - 240 * rate, 192)
- # 変数expに描画するゲージの幅を代入
- if actor.next_exp != 0
- exp = (width + plus_width) * actor.now_exp * rate_width /
- 100 / actor.next_exp
- else
- exp = (width + plus_width) * rate_width / 100
- end
- # ゲージの描画
- gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
- width, plus_width + width * rate_width / 100,
- height, exp, align1, align2, align3,
- color1, color2, color3, color4, color5, color6, grade1, grade2)
- # オリジナルのEXP描画処理を呼び出し
- draw_actor_exp_original(actor, x, y)
- end
- #--------------------------------------------------------------------------
- # ● ゲージの描画
- #--------------------------------------------------------------------------
- def gauge_rect(x, y, rect_width, width, height, gauge, align1, align2, align3,
- color1, color2, color3, color4, color5, color6, grade1, grade2)
- case align1
- when 1
- x += (rect_width - width) / 2
- when 2
- x += rect_width - width
- end
- case align2
- when 1
- y -= height / 2
- when 2
- y -= height
- end
- # 枠描画
- self.contents.fill_rect(x, y, width, height, color1)
- self.contents.fill_rect(x + 1, y + 1, width - 2, height - 2, color2)
- if align3 == 0
- if grade1 == 2
- grade1 = 3
- end
- if grade2 == 2
- grade2 = 3
- end
- end
- if (align3 == 1 and grade1 == 0) or grade1 > 0
- color = color3
- color3 = color4
- color4 = color
- end
- if (align3 == 1 and grade2 == 0) or grade2 > 0
- color = color5
- color5 = color6
- color6 = color
- end
- # 空ゲージの描画
- self.contents.gradation_rect(x + 2, y + 2, width - 4, height - 4,
- color3, color4, grade1)
- if align3 == 1
- x += width - gauge
- end
- # 実ゲージの描画
- self.contents.gradation_rect(x + 2, y + 2, gauge - 4, height - 4,
- color5, color6, grade2)
- end
- end
- #------------------------------------------------------------------------------
- # Bitmapクラスに新たな機能を追加します。
- #==============================================================================
- class Bitmap
- #--------------------------------------------------------------------------
- # ● 矩形をグラデーション表示
- # color1 : スタートカラー
- # color2 : エンドカラー
- # align : 0:横にグラデーション
- # 1:縦にグラデーション
- # 2:斜めにグラデーション(激重につき注意)
- #--------------------------------------------------------------------------
- def gradation_rect(x, y, width, height, color1, color2, align = 0)
- if align == 0
- for i in x...x + width
- red = color1.red + (color2.red - color1.red) * (i - x) / (width - 1)
- green = color1.green +
- (color2.green - color1.green) * (i - x) / (width - 1)
- blue = color1.blue +
- (color2.blue - color1.blue) * (i - x) / (width - 1)
- alpha = color1.alpha +
- (color2.alpha - color1.alpha) * (i - x) / (width - 1)
- color = Color.new(red, green, blue, alpha)
- fill_rect(i, y, 1, height, color)
- end
- elsif align == 1
- for i in y...y + height
- red = color1.red +
- (color2.red - color1.red) * (i - y) / (height - 1)
- green = color1.green +
- (color2.green - color1.green) * (i - y) / (height - 1)
- blue = color1.blue +
- (color2.blue - color1.blue) * (i - y) / (height - 1)
- alpha = color1.alpha +
- (color2.alpha - color1.alpha) * (i - y) / (height - 1)
- color = Color.new(red, green, blue, alpha)
- fill_rect(x, i, width, 1, color)
- end
- elsif align == 2
- for i in x...x + width
- for j in y...y + height
- red = color1.red + (color2.red - color1.red) *
- ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
- green = color1.green + (color2.green - color1.green) *
- ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
- blue = color1.blue + (color2.blue - color1.blue) *
- ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
- alpha = color1.alpha + (color2.alpha - color1.alpha) *
- ((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
- color = Color.new(red, green, blue, alpha)
- set_pixel(i, j, color)
- end
- end
- elsif align == 3
- for i in x...x + width
- for j in y...y + height
- red = color1.red + (color2.red - color1.red) *
- ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
- green = color1.green + (color2.green - color1.green) *
- ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
- blue = color1.blue + (color2.blue - color1.blue) *
- ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
- alpha = color1.alpha + (color2.alpha - color1.alpha) *
- ((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
- color = Color.new(red, green, blue, alpha)
- set_pixel(i, j, color)
- end
- end
- end
- end
- end
复制代码 |
|