Project1
标题: 求人修改我的脚本. [打印本页]
作者: Ranger 时间: 2012-7-13 14:58
标题: 求人修改我的脚本.
本帖最后由 Ranger 于 2012-7-13 15:04 编辑
- #==============================================================================
- # ■ Window_Status
- #------------------------------------------------------------------------------
- # 显示状态画面、完全规格的状态窗口。 BY懒De说
- #==============================================================================
- class Window_Status < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(100, 50, 220, 380)
- self.contents = Bitmap.new(width - 32, height - 32)
- @actor = actor
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
-
- #draw_actor_graphic(@actor, 80, 80)
- draw_actor_name(@actor, 4, 0)
- draw_actor_level(@actor, 4, 32)
- draw_actor_state(@actor, 100, 0)
- draw_actor_hp(@actor, 0, 90, 172)
- draw_actor_sp(@actor, 0, 120, 172)
- draw_actor_exp(@actor, 0, 320, 172)
- draw_actor_parameter(@actor, 0, 160, 3)
- draw_actor_parameter(@actor, 0, 200, 1)
- draw_actor_parameter(@actor, 0, 240, 4)
- draw_actor_parameter(@actor, 0, 280, 5)
-
- self.contents.font.color = system_color
- self.contents.draw_text(110, 30, 30, 32, "人气")
- self.contents.draw_text(160, 30, 30, 32, $game_variables[30].to_s)
- self.contents.draw_text(110, 60, 30, 32, "贡献")
- self.contents.draw_text(160, 60, 30, 32, $game_variables[31].to_s)
- self.contents.draw_text(0, 60, 30, 32, "门派:")
- #所加门派
- ##############################################
- case $game_variables[12]
- when 0
- self.contents.draw_text(30, 60, 60, 32, "无")
- when 1
- self.contents.draw_text(30, 60, 60, 32, "神龙教")
- when 2
- self.contents.draw_text(30, 60, 60, 32, "华山派")
- when 3
- self.contents.draw_text(30, 60, 60, 32, "逍遥派")
- when 4
- self.contents.draw_text(30, 60, 60, 32, "南少林")
- when 5
- self.contents.draw_text(30, 60, 60, 32, "华山派")
- when 6
- self.contents.draw_text(30, 60, 60, 32, "三清寺")
- when 7
- self.contents.draw_text(30, 60, 60, 32, "青城派")
- end
- ##########################################
- end
- def dummy
- self.contents.font.color = system_color
- self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
- self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
- self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
- self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
- self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
- draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
- draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
- draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
- draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
- draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
- end
- end
复制代码 这个脚本的draw_actor_exp(@actor, 0, 320, 172)有问题,后来我看了,原来在画出经验调的时候出问题,如果把这里删掉,显示的时候虽正常,但是经验调就没有了,然后背景全是黑的.求修改啊,还有配合以下脚本才可以
- # ————————————————————————————————————
- # 本脚本来自www.66rpg.com,转载请保留此信息
- # ————————————————————————————————————
- # HP/SP/EXPゲージ表示スクリプト Ver 1.00
- # 配布元・サポートURL
- # http://members.jcom.home.ne.jp/cogwheel/
- #==============================================================================
- # ■ 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
- #==============================================================================
- # ■ Window_Base
- #------------------------------------------------------------------------------
- # ゲーム中のすべてのウィンドウのスーパークラスです。
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ● HP ゲージの描画
- #--------------------------------------------------------------------------
- # オリジナルのHP描画を draw_actor_hp_original と名前変更
- alias :draw_actor_hp_original :draw_actor_hp
- def draw_actor_hp(actor, x, y, width = 144)
- # 変数rateに 現在のHP/MHPを代入
- if actor.maxhp != 0
- rate = actor.hp.to_f / actor.maxhp
- else
- rate = 0
- 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 - 24 * rate, 80 * rate, 14 * rate, 192)
- color6 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 192)
- # 変数spに描画するゲージの幅を代入
- if actor.maxhp != 0
- hp = (width + plus_width) * actor.hp * rate_width / 100 / actor.maxhp
- else
- hp = 0
- end
- # ゲージの描画
- gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
- width, plus_width + width * rate_width / 100,
- height, hp, align1, align2, align3,
- color1, color2, color3, color4, color5, color6, grade1, grade2)
- # オリジナルのHP描画処理を呼び出し
- draw_actor_hp_original(actor, x, y, width)
- end
- #--------------------------------------------------------------------------
- # ● SP ゲージの描画
- #--------------------------------------------------------------------------
- # オリジナルのSP描画を draw_actor_sp_original と名前変更
- alias :draw_actor_sp_original :draw_actor_sp
- def draw_actor_sp(actor, x, y, width = 144)
- # 変数rateに 現在のSP/MSPを代入
- if actor.maxsp != 0
- rate = actor.sp.to_f / actor.maxsp
- 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(0, 64, 0, 192)
- color5 = Color.new(14 * rate, 80 - 24 * rate, 80 * rate, 192)
- color6 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192)
- # 変数spに描画するゲージの幅を代入
- if actor.maxsp != 0
- sp = (width + plus_width) * actor.sp * rate_width / 100 / actor.maxsp
- else
- sp = (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, sp, align1, align2, align3,
- color1, color2, color3, color4, color5, color6, grade1, grade2)
- # オリジナルのSP描画処理を呼び出し
- draw_actor_sp_original(actor, x, y, width)
- end
- #--------------------------------------------------------------------------
- # ● EXP ゲージの描画
- #--------------------------------------------------------------------------
- # オリジナルのEXP描画を draw_actor_sp_original と名前変更 #修改的地方
- alias :draw_actor_exp_original :draw_actor_exp #□
- # alias :draw_actor_exp_original :draw_actor_exp_zj #■ 空心方块为原脚本
-
- def draw_actor_exp(actor, x, y, width = 600)
- # 変数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
复制代码