Project1

标题: 求一个用图片描绘的血条素材-附工程 [打印本页]

作者: zoeylau    时间: 2009-10-1 19:25
标题: 求一个用图片描绘的血条素材-附工程
本帖最后由 zoeylau 于 2009-10-3 22:10 编辑

之前我找了几个,  都是因为脚本内含有其他比如game battle之类的设置跟我的工程冲突了  
所以用不了    请大家给我一个  只描写 HP SP ,不要文字 不改其他设置的图片脚本吧  

PS`我是CP制战斗,非RTAB,非全动画
最好是那种比较直观的  用400  500的方法设置坐标的那种, 变量坐标我不太会改....

工程在19楼

谢谢大家~~~~~~祝大家节日快乐哦~!
作者: flzt5354    时间: 2009-10-2 08:18
给个我自己写的你吧- -
  1. def HP(actor,x,y,w=74,width=144)


  2.   #######血条@####  
  3.   @bitmap1 =Bitmap.new("Graphics/zhuangtai/HP")
  4.   [email protected] *actor.hp/actor.maxhp
  5.   @src_rect1 = Rect.new( 0, 0, w1, @bitmap1.height)
  6.   self.contents.blt(x+68,y+58,@bitmap1,@src_rect1)


  7.     # 计算描绘 MaxHP 所需的空间
  8.     #if width - 32 >= 108
  9.      # hp_x = x + width - 108
  10.       #flag = true
  11.     #elsif width - 32 >= 48
  12.       hp_x = x
  13.       flag = false
  14.     #end
  15.     # 描绘 HP
  16.    
  17.     self.contents.font.color = actor.hp == 0 ? knockout_color :
  18.     actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  19.    
  20.   
  21.     ##把括号后的2去掉,中间的两个数字也去掉,
  22.     self.contents.draw_number(hp_x, y, actor.hp.to_s)
  23.     #把draw_text改为draw_number就行了!!

  24.      
  25.     # 描绘 MaxHP
  26.     if flag
  27.       self.contents.font.color =normal_color
  28.       self.contents.draw_text(hp_x + 20, y+40, 12, 20, "/", 1)
  29.       
  30.       #把括号后的2去掉,中间的两个数字也去掉,
  31.       self.contents.draw_number(hp_x + 35, y, actor.maxhp.to_s)
  32.       #把draw_text改为draw_number就行了!!
  33.     end
  34. end

  35.   ####技能条######################
  36. def SP(actor,x,y,w=74,width=144)
  37.   @bitmap2 =Bitmap.new("Graphics/zhuangtai/SP")
  38.   [email protected] *actor.sp/actor.maxsp
  39.   @src_rect2 = Rect.new( 0, 0, w2, @bitmap2.height)
  40.   self.contents.blt(x+68,y+59,@bitmap2,@src_rect2)

  41.     # 计算描绘 MaxSP 所需的空间
  42.     #if width - 32 >= 108
  43.      # sp_x = x + width - 108
  44.       #flag = true
  45.     #elsif width - 32 >= 48
  46.       sp_x = x
  47.       flag = false
  48.     #end
  49.     # 描绘 SP
  50.    
  51.     self.contents.font.color = actor.sp == 0 ? knockout_color :
  52.       actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  53.      #把括号后的2去掉,中间的两个数字也去掉,
  54.      self.contents.draw_number(sp_x, y,  actor.sp.to_s )
  55.       #把draw_text改为draw_number就行了!!
  56.     # 描绘 MaxSP
  57.     if flag
  58.       self.contents.font.color = normal_color
  59.       self.contents.draw_text(sp_x + 20, y+41, 13, 20, "/", 1)
  60.        #把括号后的2去掉,中间的两个数字也去掉,
  61.     self.contents.draw_number(sp_x + 35, y,  actor.maxsp.to_s)
  62.       #把draw_text改为draw_number就行了!!
  63.     end
  64.   end
  65.   #########################################################
复制代码
在Window_BattleStatus
替换
  1. #--------------------------------------------------------------------------
  2.   # ● 刷新
  3.   #--------------------------------------------------------------------------
  4.   def refresh
  5.     self.contents.clear
  6.     @item_max = $game_party.actors.size
  7.     for i in 0...$game_party.actors.size
  8.       actor = $game_party.actors[i]
  9.       actor_x = i * 160 + 4
  10.       draw_actor_name(actor, actor_x+50, 56)
  11. ######################################################
  12.       HP(actor,actor_x,32)
  13.       SP(actor,actor_x,56)


  14. ########################################################
  15.       if @level_up_flags[i]
  16.         self.contents.font.color = normal_color
  17.         self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
  18.       else
  19.         draw_actor_state(actor, actor_x, 96)
  20.       end
  21.     end
  22.   end
复制代码

作者: joshua    时间: 2009-10-2 10:52
我的好像是替换window_base的,如果楼主用楼上的冲突的话....再联系我吧,我那个冲突不是很大....
作者: flzt5354    时间: 2009-10-2 10:55
我这个。。冲突的可能性小于1%。。。。
作者: joshua    时间: 2009-10-2 10:57
那我就不用麻烦了,不是吗:lol
作者: zoeylau    时间: 2009-10-2 12:35
我先试一下  不行的话LS的大大再发出来看看好嘛~  
   先谢谢2位·  节日快乐哦
作者: zoeylau    时间: 2009-10-2 13:02
不行···跟我的CP制御  267行 冲突了


#==============================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#===============================================================


# ———————————————————————————————

# ▼▲▼ XRXS_BP 1. CP制導入 ver..23 ▼▲▼
# by 桜雅 在土, 和希

#===================================================================
# □ カスタマイズポイント
#====================================================================
module XRXS_BP1
#
# 对齐方式。0:左 1:中央 2:右
#
ALIGN = 0
#
# 人数
#
MAX = 4
end
class Scene_Battle_CP
#
# 战斗速度
#
BATTLE_SPEED = 2.0
#
# 战斗开始的时候气槽百分比
#
START_CP_PERCENT = 100
end

class Scene_Battle

# 效果音效,可以自己添加
DATA_SYSTEM_COMMAND_UP_SE = ""

# 各项数值功能消耗的CP值
CP_COST_BASIC_ACTIONS = 0 # 基础共同
CP_COST_SKILL_ACTION = 65535 # 技能
CP_COST_ITEM_ACTION = 65535 # 物品
CP_COST_BASIC_ATTACK = 65535 # 攻撃
CP_COST_BASIC_GUARD = 32768 # 防御
CP_COST_BASIC_NOTHING = 65535 # 不做任何事情
CP_COST_BASIC_ESCAPE = 65535 # 逃跑
end

#============================================================
# --- XRXS.コマンドウィンドウ?コマンド追加機構 ---
#-----------------------------------------------------------
# Window_Commandクラスに add_command メソッドを追加します。
#=============================================================
module XRXS_Window_Command_Add_Command
#-------------------------------------------------
# ○ コマンドを追加
#----------------------------------------------------
def add_command(command)
# 初期化されていない場合、無効化判別用の配列 @disabled の初期化
#
if @disabled == nil
@disabled = []
end
if @commands.size != @disabled.size
for i in [email protected]
@disabled = false
end
end
#
# 追加
#
@commands.push(command)
@disabled.push(false)
@item_max = @commands.size
self.y -= 32
self.height += 32
self.contents.dispose
self.contents = nil
self.contents = Bitmap.new(self.width - 32, @item_max * 32)
refresh
for i in [email protected]
if @disabled
disable_item(i)
end
end
end
#-------------------------------------------------------
# ○ 項目の無効化
# index : 項目番号
#----------------------------------------------------
def disable_item(index)
if @disabled == nil
@disabled = []
end
@disabled[index] = true
draw_item(index, disabled_color)
end
end
class Window_Command < Window_Selectable
#------------------------------------------------------
# ○ インクルード
#------------------------------------------------
include XRXS_Window_Command_Add_Command
#---------------------------------------------------------
# ● 項目の無効化
# index : 項目番号
#------------------------------------------------------
def disable_item(index)
super
end
end
#==============================================================
# □ Scene_Battle_CP
#==============================================================
class Scene_Battle_CP
#----------------------------------------------------------
# ○ 公開インスタンス変数
#-------------------------------------------------------
attr_accessor :stop # CP加算ストップ
#-------------------------------------------------------------
# ○ オブジェクトの初期化
#-----------------------------------------------------------
def initialize
@battlers = []
@cancel = false
@stop = false
@agi_total = 0
# 配列 count_battlers を初期化
count_battlers = []
# エネミーを配列 count_battlers に追加
for enemy in $game_troop.enemies
count_battlers.push(enemy)
end
# アクターを配列 count_battlers に追加
for actor in $game_party.actors
count_battlers.push(actor)
end
for battler in count_battlers
@agi_total += battler.agi
end
for battler in count_battlers
battler.cp = [[65535 * START_CP_PERCENT * (rand(15) + 85) * 4 * battler.agi / @agi_total / 10000, 0].max, 65535].min
end
end
#---------------------------------------------------------------
# ○ CPカウントアップ
#--------------------------------------------------------------
def update
# ストップされているならリターン
return if @stop
#
for battler in $game_party.actors + $game_troop.enemies
# 行動出来なければ無視
if battler.dead? == true
battler.cp = 0
next
end
battler.cp = [[battler.cp + BATTLE_SPEED * 4096 * battler.agi / @agi_total, 0].max, 65535].min
end
end
#--------------------------------------------------------------
# ○ CPカウントの開始
#---------------------------------------------------------------
def stop
@cancel = true
if @cp_thread != nil then
@cp_thread.join
@cp_thread = nil
end
end
end

#===================================================================
# ■ Game_Battler
#=================================================================
class Game_Battler
attr_accessor :now_guarding # 現在防御中フラグ
attr_accessor :cp # 現在CP
attr_accessor :slip_state_update_ban # スリップ?ステート自動処理の禁止
#-------------------------------------------------------------
# ○ CP の変更
#------------------------------------------------------------
def cp=(p)
@cp = [[p, 0].max, 65535].min
end
#----------------------------------------------------------
# ● 防御中判定 [ 再定義 ]
#---------------------------------------------------------
def guarding?
return @now_guarding
end
#------------------------------------------------------------
# ● コマンド入力可能判定
#---------------------------------------------------------
alias xrxs_bp1_inputable? inputable?
def inputable?
bool = xrxs_bp1_inputable?
return (bool and (@cp >= 65535))
end
#------------------------------------------------------------
# ● ステート [スリップダメージ] 判定
#-------------------------------------------------------------
alias xrxs_bp1_slip_damage? slip_damage?
def slip_damage?
return false if @slip_state_update_ban
return xrxs_bp1_slip_damage?
end
#--------------------------------------------------------------
# ● ステート自然解除 (ターンごとに呼び出し)
#----------------------------------------------------------
alias xrxs_bp1_remove_states_auto remove_states_auto
def remove_states_auto
return if @slip_state_update_ban
xrxs_bp1_remove_states_auto
end
end
#==================================================================
# ■ Game_Actor
#==================================================================
class Game_Actor < Game_Battler
#---------------------------------------------------------
# ● セットアップ
#--------------------------------------------------------
alias xrxs_bp1_setup setup
def setup(actor_id)
xrxs_bp1_setup(actor_id)
@cp = 0
@now_guarding = false
@slip_state_update_ban = false
end
end
#===================================================================
# ■ Game_Enemy
#===================================================================
class Game_Enemy < Game_Battler
#-----------------------------------------------------------
# ● オブジェクト初期化
#----------------------------------------------------------
alias xrxs_bp1_initialize initialize
def initialize(troop_id, member_index)
xrxs_bp1_initialize(troop_id, member_index)
@cp = 0
@now_guarding = false
@slip_state_update_ban = false
end
end
#==================================================================
# ■ Window_BattleStatus
#==================================================================
class Window_BattleStatus < Window_Base
#---------------------------------------------------------
# ○ 公開インスタンス変数
#------------------------------------------------------------
attr_accessor :update_cp_only # CPメーターのみの更新
#------------------------------------------------------------
# ● オブジェクト初期化
#-------------------------------------------------------------
alias xrxs_bp1_initialize initialize
def initialize
@update_cp_only = false
xrxs_bp1_initialize
end
#------------------------------------------------------------
# ● リフレッシュ
#-------------------------------------------------------------
alias xrxs_bp1_refresh refresh
def refresh
unless @update_cp_only
xrxs_bp1_refresh
end
refresh_cp
end
#---------------------------------------------------------------
# ○ リフレッシュ(CPのみ)
#------------------------------------------------------------
def refresh_cp
for i in 0...$game_party.actors.size
actor = $game_party.actors
width = [self.width*3/4 / XRXS_BP1::MAX, 80].max
space = self.width / XRXS_BP1::MAX
case XRXS_BP1::ALIGN
when 0
actor_x = i * space + 4
when 1
actor_x = (space * ((XRXS_BP1::MAX - $game_party.actors.size)/2.0 + i)).floor
when 2
actor_x = (i + XRXS_BP1::MAX - $game_party.actors.size) * space + 4
end
actor_x += self.x
draw_actor_cp_meter(actor, actor_x, 96, width, 0)
end
end
#-----------------------------------------------------------
# ○ CPメーター の描画
#-------------------------------------------------------------
def draw_actor_cp_meter(actor, x, y, width = 156, type = 0)
self.contents.font.color = system_color
self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
if actor.cp == nil
actor.cp = 0
end
w = width * [actor.cp,65535].min / 65535
self.contents.fill_rect(x, y+28, w,1, Color.new(255, 255, 128, 255))#CP槽分条坐标颜色
self.contents.fill_rect(x, y+29, w,1, Color.new(255, 255, 0, 255))
self.contents.fill_rect(x, y+30, w,1, Color.new(192, 192, 0, 255))
self.contents.fill_rect(x, y+31, w,1, Color.new(128, 128, 0, 255))
end
end
#==================================================================
# ■ Scene_Battle
#==================================================================
class Scene_Battle
#------------------------------------------------------------
# ● フレーム更新
#---------------------------------------------------------------
alias xrxs_bp1_update update
def update
xrxs_bp1_update
# CP更新
@cp_thread.update
end
#------------------------------------------------------------
# ● バトル終了
# result : 結果 (0:勝利 1:敗北 2:逃走)
#-------------------------------------------------------------
alias xrxs_bp1_battle_end battle_end
def battle_end(result)
# CPカウントを停止する
@cp_thread.stop
# 呼び戻す
xrxs_bp1_battle_end(result)
end
#------------------------------------------------------------
# ● プレバトルフェーズ開始
#----------------------------------------------------------
alias xrxs_bp1_start_phase1 start_phase1
def start_phase1
@agi_total = 0
# CP加算を開始する
@cp_thread = Scene_Battle_CP.new
# インデックスを計算
@cp_escape_actor_command_index = @actor_command_window.height/32 - 1
# アクターコマンドウィンドウに追加
@actor_command_window.add_command("逃跑")
if !$game_temp.battle_can_escape
@actor_command_window.disable_item(@cp_escape_actor_command_index)
end
# 呼び戻す
xrxs_bp1_start_phase1
end
#---------------------------------------------------------------
# ● パーティコマンドフェーズ開始
#----------------------------------------------------------
alias xrxs_bp1_start_phase2 start_phase2
def start_phase2
xrxs_bp1_start_phase2
@party_command_window.active = false
@party_command_window.visible = false
# CP加算を再開する
@cp_thread.stop = false
# 次へ
start_phase3
end
#---------------------------------------------------------
# ● アクターコマンドウィンドウのセットアップ
#----------------------------------------------------------
alias xrxs_bp1_phase3_setup_command_window phase3_setup_command_window
def phase3_setup_command_window
# CPスレッドを一時停止する
@cp_thread.stop = true
# ウィンドウのCP更新
@status_window.refresh_cp
# @active_battlerの防御を解除
@active_battler.now_guarding = false
# 効果音の再生
Audio.se_play(DATA_SYSTEM_COMMAND_UP_SE) if DATA_SYSTEM_COMMAND_UP_SE != ""
# 呼び戻す
xrxs_bp1_phase3_setup_command_window
end
#---------------------------------------------------------
# ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド)
#--------------------------------------------------------
alias xrxs_bsp1_update_phase3_basic_command update_phase3_basic_command
def update_phase3_basic_command
# C ボタンが押された場合
if Input.trigger?(Input::C)
# アクターコマンドウィンドウのカーソル位置で分岐
case @actor_command_window.index
when @cp_escape_actor_command_index # 逃げる
if $game_temp.battle_can_escape
# 決定 SE を演奏
$game_system.se_play($data_system.decision_se)
# アクションを設定
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 4
# 次のアクターのコマンド入力へ
phase3_next_actor
else
# ブザー SE を演奏
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
xrxs_bsp1_update_phase3_basic_command
end
#-------------------------------------------------------------
# ● メインフェーズ開始
#-------------------------------------------------------------
alias xrxs_bp1_start_phase4 start_phase4
def start_phase4
# 呼び戻す
xrxs_bp1_start_phase4
# CPスレッドを一時停止する
unless @action_battlers.empty?
@cp_thread.stop = true
end
end
#-------------------------------------------------------
# ● 行動順序作成
#-------------------------------------------------------
alias xrxs_bp1_make_action_orders make_action_orders
def make_action_orders
xrxs_bp1_make_action_orders
# 全員のCPを確認
exclude_battler = []
for battler in @action_battlers
# CPが不足している場合は @action_battlers から除外する
if battler.cp < 65535
exclude_battler.push(battler)
end
end
@action_battlers -= exclude_battler
end
#-----------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
#------------------------------------------------------------
alias xrxs_bp1_update_phase4_step1 update_phase4_step1
def update_phase4_step1
# 初期化
@phase4_act_continuation = 0
# 勝敗判定
if judge
@cp_thread.stop
# 勝利または敗北の場合 : メソッド終了
return
end
# 未行動バトラー配列の先頭から取得
@active_battler = @action_battlers[0]
# ステータス更新をCPだけに限定。
@status_window.update_cp_only = true
# ステート更新を禁止。
@active_battler.slip_state_update_ban = true if @active_battler != nil
# 戻す
xrxs_bp1_update_phase4_step1
# @status_windowがリフレッシュされなかった場合は手動でリフレッシュ(CPのみ)
if @phase4_step != 2
# リフレッシュ
@status_window.refresh
# 軽量化:たったコレだけΣ(?w?
Graphics.frame_reset
end
# 禁止を解除
@status_window.update_cp_only = false
@active_battler.slip_state_update_ban = false if @active_battler != nil
end
#-------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
#----------------------------------------------------------
alias xrxs_bp1_update_phase4_step2 update_phase4_step2
def update_phase4_step2
# 強制アクションでなければ
unless @active_battler.current_action.forcing
# 制約が [敵を通常攻撃する] か [味方を通常攻撃する] の場合
if @active_battler.restriction == 2 or @active_battler.restriction == 3
# アクションに攻撃を設定
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 0
end
# 制約が [行動できない] の場合
if @active_battler.restriction == 4
# アクション強制対象のバトラーをクリア
$game_temp.forcing_battler = nil
if @phase4_act_continuation == 0 and @active_battler.cp >= 65535
# ステート自然解除
@active_battler.remove_states_auto
# CP消費
@active_battler.cp -= 65535
# ステータスウィンドウをリフレッシュ
@status_window.refresh
end
# ステップ 1 に移行
@phase4_step = 1
return
end
end
# アクションの種別で分岐
case @active_battler.current_action.kind
when 0
# 攻撃?防御?逃げる?何もしない時の共通消費CP
@active_battler.cp -= CP_COST_BASIC_ACTIONS if @phase4_act_continuation == 0
when 1
# スキル使用時の消費CP
@active_battler.cp -= CP_COST_SKILL_ACTION if @phase4_act_continuation == 0
when 2
# アイテム使用時の消費CP
@active_battler.cp -= CP_COST_ITEM_ACTION if @phase4_act_continuation == 0
end
# ステート自然解除
@active_battler.remove_states_auto
# 呼び戻す
xrxs_bp1_update_phase4_step2
end
#-----------------------------------------------------------
# ● 基本アクション 結果作成
#-----------------------------------------------------------
alias xrxs_bp1_make_basic_action_result make_basic_action_result
def make_basic_action_result
# 攻撃の場合
if @active_battler.current_action.basic == 0 and @phase4_act_continuation == 0
@active_battler.cp -= CP_COST_BASIC_ATTACK # 攻撃時のCP消費
end
# 防御の場合
if @active_battler.current_action.basic == 1 and @phase4_act_continuation == 0
@active_battler.cp -= CP_COST_BASIC_GUARD # 防御時のCP消費
# @active_battlerの防御をON
@active_battler.now_guarding = true
end
# 敵の逃げるの場合
if @active_battler.is_a?(Game_Enemy) and
@active_battler.current_action.basic == 2 and @phase4_act_continuation == 0
@active_battler.cp -= CP_COST_BASIC_ESCAPE # 逃走時のCP消費
end
# 何もしないの場合
if @active_battler.current_action.basic == 3 and @phase4_act_continuation == 0
@active_battler.cp -= CP_COST_BASIC_NOTHING # 何もしない時のCP消費
end
# 逃げるの場合
if @active_battler.current_action.basic == 4 and @phase4_act_continuation == 0
@active_battler.cp -= CP_COST_BASIC_ESCAPE # 逃走時のCP消費
# 逃走可能ではない場合
if $game_temp.battle_can_escape == false
# ブザー SE を演奏
$game_system.se_play($data_system.buzzer_se)
return
end
# 逃走処理
update_phase2_escape
return
end
# 呼び戻す
xrxs_bp1_make_basic_action_result
end
#-------------------------------------------------------------
# ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
#-----------------------------------------------------------
alias xrxs_bp1_update_phase4_step6 update_phase4_step6
def update_phase4_step6
# スリップダメージ
if @active_battler.hp > 0 and @active_battler.slip_damage?
@active_battler.slip_damage_effect
@active_battler.damage_pop = true
# ステータスウィンドウをリフレッシュ
@status_window.refresh
end
# 呼び戻す
xrxs_bp1_update_phase4_step6
end
end


#==============================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================
作者: joshua    时间: 2009-10-2 13:18
因为CP制战斗更改过Window_BattleStatus所以才会这样,把两个整合一下。

我的那个应该也是要改一下的......
作者: zoeylau    时间: 2009-10-2 13:20
  就是····整合不能啊...
帮帮我..
作者: joshua    时间: 2009-10-2 13:38
呃,这个脚本....我过去用过诶,也写了血条.....

可是好久好在,我爸刚刚把工程删掉........:dizzy:

一会还有事,如果等我回来还没人解决,我在来帮忙好了......

不好意思:L
作者: zoeylau    时间: 2009-10-2 13:48
好的  没关系   
假期游玩要小心   出门把妹要用心
作者: joshua    时间: 2009-10-2 13:52
# ————————————————————————————————————
# 本脚本来自www.66rpg.com,转载请保留此信息
# ————————————————————————————————————

# ▼▲▼ XRXS_BP 7. バトルステータス?クリアデザイン ver.1.03 ▼▲▼
# by 桜雅 在土

#==============================================================================
# ■ Window_BattleStatus
#==============================================================================
class Window_BattleStatus < Window_Base
  #--------------------------------------------------------------------------
  # ● 公開インスタンス変数
  #--------------------------------------------------------------------------
  attr_accessor :update_cp_only # CPメーターのみの更新
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  alias xrxs_bp7_initialize initialize
  def initialize
    # 初期化
    @previous_hp = []
    @previous_sp = []
    # 呼び戻す
    xrxs_bp7_initialize
    # ↓Full-Viewの場合は下二行の # を消してください。
    self.opacity = 160
    self.back_opacity = 160  
   
=begin   
   @hp = []
   for j in 0...$game_party.actors.size
     @hp[j] = $game_party.actors[j].hp
   end
   @refresh_flag = true
   refresh
=end   
   
   
  end
#★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
  def draw_battler_graphic(actor, x, y)
    battler=RPG::Cache.battler(actor.battler_name, actor.battler_hue)
    w = battler.width
    h = battler.height
    self.contents.blt(x-w/2, y-h+58, battler, Rect.new(0, 0, w,h),255)
    self.z = 20
  end
#★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★

  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  alias xrxs_bp7_refresh refresh
  def refresh
    # CPメーターの更新のみ の場合
    if @update_cp_only
      xrxs_bp7_refresh
      return
    end
    # 変更するものがない場合、飛ばす
    @item_max = $game_party.actors.size
    bool = false
    for i in 0...@item_max
      actor = $game_party.actors
      if (@previous_hp != actor.hp) or (@previous_sp != actor.sp)
        bool = true
      end
    end
    return if bool == false
    # 描写を開始
    self.contents.clear
    for i in 0...@item_max
      actor = $game_party.actors
      actor_x = i * 160 + 21
      # 歩行キャラグラフィックの描写
      draw_battler_graphic(actor, actor_x + 43, 200)
      # HP/SPメーターの描写
      
      
      draw_actor_hp_meter_line(actor, actor_x - 17, 82, 120, 10)
      
      
      draw_actor_sp_meter_line(actor, actor_x - 17, 98, 120, 10)
      # HP数値の描写
      self.contents.font.size = 18 # HP/SP数値の文字の大きさ
      self.contents.font.color = Color.new(0,0,0,192)
      self.contents.draw_text(actor_x, 72, 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, 70, 96, 24, actor.hp.to_s, 2)
      # SP数値の描写
      self.contents.font.color = Color.new(0,0,0,192)
      self.contents.draw_text(actor_x, 88, 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, 86, 96, 24, actor.sp.to_s, 2)
      # 用語「HP」と用語「SP」の描写
      self.contents.font.size = 18 # 用語「HP/SP」の文字の大きさ
      self.contents.font.color = Color.new(0,0,0,192)
      self.contents.draw_text(actor_x - 7, 74, 196, 24, $data_system.words.hp)
      self.contents.draw_text(actor_x - 7, 90, 196, 24, $data_system.words.sp)
      self.contents.font.color = system_color # 用語「HP/SP」の文字の色
      self.contents.draw_text(actor_x - 7, 72, 196, 24, $data_system.words.hp)
      self.contents.draw_text(actor_x - 7, 88, 196, 24, $data_system.words.sp)
      # ステートの描写
      draw_actor_state(actor, actor_x-20, 103) #X- 55
      # 描画角色姓名
      #draw_actor_name(actor, actor_x-17, 103)
      # 値を更新
      @previous_hp = actor.hp
      @previous_sp = actor.sp
    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 xrxs_bp7_draw_actor_name draw_actor_name
  def draw_actor_name(actor, x, y)
    xrxs_bp7_draw_actor_name(actor, x, y) #if @draw_ban != true
  end
  #--------------------------------------------------------------------------
  # ● ステートの描画
  #--------------------------------------------------------------------------
  alias xrxs_bp7_draw_actor_state draw_actor_state
  def draw_actor_state(actor, x, y, width = 120)
    xrxs_bp7_draw_actor_state(actor, x, y, width) if @draw_ban != true
  end
  #--------------------------------------------------------------------------
  # ● HP の描画
  #--------------------------------------------------------------------------
  alias xrxs_bp7_draw_actor_hp draw_actor_hp
  def draw_actor_hp(actor, x, y, width = 144)
    xrxs_bp7_draw_actor_hp(actor, x, y, width) if @draw_ban != true
  end
  #--------------------------------------------------------------------------
  # ● SP の描画
  #--------------------------------------------------------------------------
  alias xrxs_bp7_draw_actor_sp draw_actor_sp
  def draw_actor_sp(actor, x, y, width = 144)
    xrxs_bp7_draw_actor_sp(actor, x, y, width) if @draw_ban != true
  end
end
#==============================================================================
# ■ Scene_Battle
#==============================================================================
class Scene_Battle
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias xrxs_bp7_update update
  def update
    xrxs_bp7_update
    # メッセージウィンドウ表示中の場合
    if $game_temp.message_window_showing
      @status_window.update_cp_only = true      
    else
      @status_window.update_cp_only = false
    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

这个贴上试试,不行的话加我QQ;442698758  因为新论坛我不是很会用.......有的事情还得问问你...
作者: flzt5354    时间: 2009-10-2 14:01
本帖最后由 flzt5354 于 2009-10-2 14:11 编辑
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================


  4. # ————————————————————————————————————

  5. # ▼▲▼ XRXS_BP 1. CP制導入 ver..23 ▼▲▼
  6. # by 桜雅 在土, 和希

  7. #==============================================================================
  8. # □ カスタマイズポイント
  9. #==============================================================================
  10. module XRXS_BP1
  11. #
  12. # 对齐方式。0:左 1:中央 2:右
  13. #
  14. ALIGN = 0
  15. #
  16. # 人数
  17. #
  18. MAX = 4
  19. end
  20. class Scene_Battle_CP
  21. #
  22. # 战斗速度
  23. #
  24. BATTLE_SPEED = 0.4
  25. #
  26. # 战斗开始的时候气槽百分比
  27. #
  28. START_CP_PERCENT = 0
  29. end

  30. class Scene_Battle

  31. # 效果音效,可以自己添加
  32. DATA_SYSTEM_COMMAND_UP_SE = ""

  33. # 各项数值功能消耗的CP值
  34. CP_COST_BASIC_ACTIONS = 0 # 基础共同
  35. CP_COST_SKILL_ACTION = 65535 # 技能
  36. CP_COST_ITEM_ACTION = 65535 # 物品
  37. CP_COST_THROW_ACTION = 65535 # 投掷
  38. CP_COST_BASIC_ATTACK = 65535 # 攻撃
  39. CP_COST_BASIC_GUARD = 65535 # 防御
  40. CP_COST_BASIC_NOTHING = 65535 # 不做任何事情
  41. CP_COST_BASIC_ESCAPE = 65535 # 逃跑
  42. end

  43. #==============================================================================
  44. # --- XRXS.コマンドウィンドウ?コマンド追加機構 ---
  45. #------------------------------------------------------------------------------
  46. # Window_Commandクラスに add_command メソッドを追加します。
  47. #==============================================================================
  48. module XRXS_Window_Command_Add_Command
  49. #--------------------------------------------------------------------------
  50. # ○ コマンドを追加
  51. #--------------------------------------------------------------------------
  52. def add_command(command)
  53. # 初期化されていない場合、無効化判別用の配列 @disabled の初期化
  54. #
  55. if @disabled == nil
  56. @disabled = []
  57. end
  58. if @commands.size != @disabled.size
  59. for i in [email protected]
  60. @disabled[i] = false
  61. end
  62. end
  63. #
  64. # 追加
  65. #
  66. #@commands.push(command)
  67. @disabled.push(false)
  68. @item_max = @commands.size
  69. self.y -= 32
  70. self.height += 32
  71. self.contents.dispose
  72. self.contents = nil
  73. self.contents = Bitmap.new(self.width - 32, @item_max * 32)
  74. refresh
  75. for i in [email protected]
  76. if @disabled[i]
  77. disable_item(i)
  78. end
  79. end
  80. end
  81. #--------------------------------------------------------------------------
  82. # ○ 項目の無効化
  83. # index : 項目番号
  84. #--------------------------------------------------------------------------
  85. def disable_item(index)
  86. if @disabled == nil
  87. @disabled = []
  88. end
  89. @disabled[index] = true
  90. draw_item(index, disabled_color)
  91. end
  92. end
  93. class Window_Command < Window_Selectable
  94. #--------------------------------------------------------------------------
  95. # ○ インクルード
  96. #--------------------------------------------------------------------------
  97. include XRXS_Window_Command_Add_Command
  98. #--------------------------------------------------------------------------
  99. # ● 項目の無効化
  100. # index : 項目番号
  101. #--------------------------------------------------------------------------
  102. def disable_item(index)
  103. super
  104. end
  105. end
  106. #==============================================================================
  107. # □ Scene_Battle_CP
  108. #==============================================================================
  109. class Scene_Battle_CP
  110. #--------------------------------------------------------------------------
  111. # ○ 公開インスタンス変数
  112. #--------------------------------------------------------------------------
  113. attr_accessor :stop # CP加算ストップ
  114. #----------------------------------------------------------------------------
  115. # ○ オブジェクトの初期化
  116. #----------------------------------------------------------------------------
  117. def initialize
  118. @battlers = []
  119. @cancel = false
  120. @stop = false
  121. @agi_total = 0
  122. # 配列 count_battlers を初期化
  123. count_battlers = []
  124. # エネミーを配列 count_battlers に追加
  125. for enemy in $game_troop.enemies
  126. count_battlers.push(enemy)
  127. end
  128. # アクターを配列 count_battlers に追加
  129. for actor in $game_party.actors
  130. count_battlers.push(actor)
  131. end
  132. for battler in count_battlers
  133. @agi_total += battler.agi
  134. end
  135. for battler in count_battlers
  136. battler.cp = [[65535 * START_CP_PERCENT * (rand(15) + 85) * 4 * battler.agi / @agi_total / 10000, 0].max, 65535].min
  137. end
  138. end
  139. #----------------------------------------------------------------------------
  140. # ○ CPカウントアップ
  141. #----------------------------------------------------------------------------
  142. def update
  143. # ストップされているならリターン
  144. return if @stop
  145. #
  146. for battler in $game_party.actors + $game_troop.enemies
  147. # 行動出来なければ無視
  148. if battler.dead? == true
  149. battler.cp = 0
  150. next
  151. end
  152. battler.cp = [[battler.cp + BATTLE_SPEED * 4096 * battler.agi / @agi_total, 0].max, 65535].min
  153. end
  154. end
  155. #----------------------------------------------------------------------------
  156. # ○ CPカウントの開始
  157. #----------------------------------------------------------------------------
  158. def stop
  159. @cancel = true
  160. if @cp_thread != nil then
  161. @cp_thread.join
  162. @cp_thread = nil
  163. end
  164. end
  165. end

  166. #==============================================================================
  167. # ■ Game_Battler
  168. #==============================================================================
  169. class Game_Battler
  170. attr_accessor :now_guarding # 現在防御中フラグ
  171. attr_accessor :cp # 現在CP
  172. attr_accessor :slip_state_update_ban # スリップ?ステート自動処理の禁止
  173. #--------------------------------------------------------------------------
  174. # ○ CP の変更
  175. #--------------------------------------------------------------------------
  176. def cp=(p)
  177. @cp = [[p, 0].max, 65535].min
  178. end
  179. #--------------------------------------------------------------------------
  180. # ● 防御中判定 [ 再定義 ]
  181. #--------------------------------------------------------------------------
  182. def guarding?
  183. return @now_guarding
  184. end
  185. #--------------------------------------------------------------------------
  186. # ● コマンド入力可能判定
  187. #--------------------------------------------------------------------------
  188. alias xrxs_bp1_inputable? inputable?
  189. def inputable?
  190. bool = xrxs_bp1_inputable?
  191. return (bool and (@cp >= 65535))
  192. end
  193. #--------------------------------------------------------------------------
  194. # ● ステート自然解除 (ターンごとに呼び出し)
  195. #--------------------------------------------------------------------------
  196. alias xrxs_bp1_remove_states_auto remove_states_auto
  197. def remove_states_auto
  198.   return if @slip_state_update_ban
  199.   xrxs_bp1_remove_states_auto
  200. end
  201. end
  202. #==============================================================================
  203. # ■ Game_Actor
  204. #==============================================================================
  205. class Game_Actor < Game_Battler
  206. #--------------------------------------------------------------------------
  207. # ● セットアップ
  208. #--------------------------------------------------------------------------
  209. alias xrxs_bp1_setup setup
  210.   def setup(actor_id)
  211.     xrxs_bp1_setup(actor_id)
  212.     @cp = 0
  213.     @now_guarding = false
  214.     @slip_state_update_ban = false
  215.   end
  216. end
  217. #==============================================================================
  218. # ■ Game_Enemy
  219. #==============================================================================
  220. class Game_Enemy < Game_Battler
  221. #--------------------------------------------------------------------------
  222. # ● オブジェクト初期化
  223. #--------------------------------------------------------------------------
  224. alias xrxs_bp1_initialize initialize
  225.   def initialize(troop_id, member_index)
  226.     xrxs_bp1_initialize(troop_id, member_index)
  227.     @cp = 0
  228.     @now_guarding = false
  229.     @slip_state_update_ban = false
  230.   end
  231. end
  232. #==============================================================================
  233. # ■ Window_All
  234. #==============================================================================
  235. class Window_All < Window_Base
  236.   def initialize
  237.     #super(0,0,640,480)
  238.     #..........................................................................
  239.     @enemy_cp_sprite = []
  240.     @enemy_cp_sprite_back = []
  241.     @enemy_cp_sprite_count = []
  242.     for actor in $game_troop.enemies
  243.       next if !actor.exist?
  244.       @enemy_cp_sprite_count.push(actor.index)
  245.       @enemy_cp_sprite[actor.index] = Sprite.new
  246.       @enemy_cp_sprite[actor.index].bitmap = Bitmap.new("Graphics/system/battle/hmcp/sprite/" + actor.name)
  247.       @enemy_cp_sprite[actor.index].x = 430
  248.       @enemy_cp_sprite[actor.index].y = 25 + 11
  249.       @enemy_cp_sprite[actor.index].z = 102
  250.       @enemy_cp_sprite_back[actor.index] = Sprite.new
  251.       @enemy_cp_sprite_back[actor.index].bitmap = Bitmap.new("Graphics/system/battle/hmcp/cp_sprite")
  252.       @enemy_cp_sprite_back[actor.index].x = 430
  253.       @enemy_cp_sprite_back[actor.index].y = 25
  254.       @enemy_cp_sprite_back[actor.index].z = 102
  255.     end
  256.     refresh
  257.   end
  258.   def dispose
  259.     for actor_index in @enemy_cp_sprite_count
  260.       @enemy_cp_sprite[actor_index].bitmap.dispose
  261.       @enemy_cp_sprite[actor_index].dispose
  262.       @enemy_cp_sprite_back[actor_index].bitmap.dispose
  263.       @enemy_cp_sprite_back[actor_index].dispose
  264.     end
  265.   end
  266.   def refresh
  267.     for actor in $game_troop.enemies
  268.       next if !actor.exist?
  269.       if actor.cp == nil
  270.         actor.cp = 0
  271.       end
  272.       ############怪物图标CP坐标###############
  273.       #                                       #
  274.       #########################################
  275.       @enemy_cp_sprite[actor.index].x = 430 + actor.cp * 140 /65535
  276.       @enemy_cp_sprite_back[actor.index].x = 430 + actor.cp * 140 /65535
  277.       #########################################
  278.       #                                       #
  279.       #########################################
  280.     end
  281.   end
  282. end

  283. #==============================================================================
  284. # ■ Window_BattleStatus
  285. #==============================================================================
  286. class Window_BattleStatus < Window_Base
  287.   #--------------------------------------------------------------------------
  288.   # ○ 公開インスタンス変数
  289.   #--------------------------------------------------------------------------
  290.   attr_accessor :update_cp_only # CPメーターのみの更新
  291.   #--------------------------------------------------------------------------
  292.   # ● オブジェクト初期化
  293.   #--------------------------------------------------------------------------
  294.   alias xrxs_bp1_initialize initialize
  295.   def initialize
  296.     @update_cp_only = false
  297.     @wall = Window_All.new
  298.     xrxs_bp1_initialize
  299.    
  300.   end
  301.   def dispose
  302.     super
  303.     @wall.dispose
  304. #    @hp_bitmap.dispose
  305. #    @mp_bitmap.dispose
  306.     @cp_bitmap.dispose
  307.     @cp_back_bar.dispose
  308.     for actor in $game_party.actors
  309.       @actor_cp_sprite[actor.index].bitmap.dispose
  310.       @actor_cp_sprite[actor.index].dispose
  311.       @actor_cp_sprite_back[actor.index].bitmap.dispose
  312.       @actor_cp_sprite_back[actor.index].dispose
  313.     end
  314.     for actor_index in 1..$game_party.actors.size
  315.       @cp_output[actor_index].bitmap.dispose
  316.       @cp_output[actor_index].dispose
  317.     end
  318.   end
  319.   #--------------------------------------------------------------------------
  320.   # ● リフレッシュ
  321.   #--------------------------------------------------------------------------
  322.   alias xrxs_bp1_refresh refresh
  323.   def refresh
  324.     unless @update_cp_only
  325.       xrxs_bp1_refresh
  326.     end
  327.     refresh_cp
  328.     @wall.refresh
  329.   end
  330.   #--------------------------------------------------------------------------
  331.   # ○ リフレッシュ(CPのみ)
  332.   #--------------------------------------------------------------------------
  333.   def refresh_cp
  334.     #........................................................................
  335.     for actor in $game_party.actors
  336.       next if !actor.exist?
  337.       if actor.cp == nil
  338.         actor.cp = 0
  339.       end
  340.       ############猪脚图标CP坐标###############
  341.       #                                       #
  342.       #########################################
  343.       @actor_cp_sprite[actor.index].x = 430+ actor.cp * 140 /65535
  344.       @actor_cp_sprite_back[actor.index].x = 430+ actor.cp * 140 /65535
  345.       #########################################
  346.       #                                       #
  347.       #########################################

  348.     end
  349.     for i in 0...$game_party.actors.size
  350.       actor = $game_party.actors[i]
  351.       if actor.cp == nil
  352.         actor.cp = 0
  353.       end
  354.       @cp_output[i + 1].bitmap.clear
  355.       @cp_output[i + 1].bitmap.font.size = 11
  356.       @cp_output[i + 1].bitmap.font.name = "宋体"
  357.       @cp_output[i + 1].bitmap.font.color.set(50, 50, 50)
  358.       cp_height = actor.cp * @cp_bitmap.height / 65535
  359.       cp_rect = Rect.new(0, @cp_bitmap.height - cp_height, @cp_bitmap.width, cp_height)
  360.       @cp_output[i + 1].bitmap.blt(9, 6 + @cp_bitmap.height - cp_height, @cp_bitmap, cp_rect)
  361.     end
  362.     #........................................................................
  363.   end
  364. end
  365. #==============================================================================
  366. # ■ Scene_Battle
  367. #==============================================================================
  368. class Scene_Battle
  369. #--------------------------------------------------------------------------
  370. # ● フレーム更新
  371. #--------------------------------------------------------------------------
  372. alias xrxs_bp1_update update
  373. def update
  374. xrxs_bp1_update
  375. # CP更新
  376. @cp_thread.update
  377. end
  378. #--------------------------------------------------------------------------
  379. # ● バトル終了
  380. # result : 結果 (0:勝利 1:敗北 2:逃走)
  381. #--------------------------------------------------------------------------
  382. alias xrxs_bp1_battle_end battle_end
  383. def battle_end(result)
  384. # CPカウントを停止する
  385. @cp_thread.stop
  386. # 呼び戻す
  387. xrxs_bp1_battle_end(result)
  388. end
  389. #--------------------------------------------------------------------------
  390. # ● プレバトルフェーズ開始
  391. #--------------------------------------------------------------------------
  392. alias xrxs_bp1_start_phase1 start_phase1
  393. def start_phase1
  394. @agi_total = 0
  395. # CP加算を開始する
  396. @cp_thread = Scene_Battle_CP.new
  397. # インデックスを計算
  398. @cp_escape_actor_command_index = @actor_command_window.height/32 - 1
  399. # アクターコマンドウィンドウに追加
  400. #@actor_command_window.add_command("逃跑")
  401. if !$game_temp.battle_can_escape
  402. #@actor_command_window.disable_item(@cp_escape_actor_command_index)
  403. end
  404. # 呼び戻す
  405. xrxs_bp1_start_phase1
  406. end
  407. #--------------------------------------------------------------------------
  408. # ● パーティコマンドフェーズ開始
  409. #--------------------------------------------------------------------------
  410. alias xrxs_bp1_start_phase2 start_phase2
  411. def start_phase2
  412. xrxs_bp1_start_phase2
  413. @party_command_window.active = false
  414. @party_command_window.visible = false
  415. # CP加算を再開する
  416. @cp_thread.stop = false
  417. # 次へ
  418. start_phase3
  419. end
  420. #--------------------------------------------------------------------------
  421. # ● アクターコマンドウィンドウのセットアップ
  422. #--------------------------------------------------------------------------
  423. alias xrxs_bp1_phase3_setup_command_window phase3_setup_command_window
  424. def phase3_setup_command_window
  425. # CPスレッドを一時停止する
  426. @cp_thread.stop = true
  427. # ウィンドウのCP更新
  428. @status_window.refresh_cp
  429. # @active_battlerの防御を解除
  430. @active_battler.now_guarding = false
  431. # 効果音の再生
  432. Audio.se_play(DATA_SYSTEM_COMMAND_UP_SE) if DATA_SYSTEM_COMMAND_UP_SE != ""
  433. # 呼び戻す
  434. xrxs_bp1_phase3_setup_command_window
  435. end
  436. #--------------------------------------------------------------------------
  437. # ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド)
  438. #--------------------------------------------------------------------------
  439. alias xrxs_bsp1_update_phase3_basic_command update_phase3_basic_command
  440. def update_phase3_basic_command
  441. # C ボタンが押された場合
  442. if Input.trigger?(Input::C)
  443. # アクターコマンドウィンドウのカーソル位置で分岐
  444. case @actor_command_window.index
  445. when @cp_escape_actor_command_index # 逃げる
  446. if $game_temp.battle_can_escape
  447. # 決定 SE を演奏
  448. $game_system.se_play($data_system.decision_se)
  449. # アクションを設定
  450. @active_battler.current_action.kind = 0
  451. @active_battler.current_action.basic = 4
  452. # 次のアクターのコマンド入力へ
  453. end_atk(@active_battler.index)
  454. phase3_next_actor
  455. else
  456. # ブザー SE を演奏
  457. $game_system.se_play($data_system.buzzer_se)
  458. end
  459. return
  460. end
  461. end
  462. xrxs_bsp1_update_phase3_basic_command
  463. end
  464. #--------------------------------------------------------------------------
  465. # ● メインフェーズ開始
  466. #--------------------------------------------------------------------------
  467. alias xrxs_bp1_start_phase4 start_phase4
  468. def start_phase4
  469. # 呼び戻す
  470. xrxs_bp1_start_phase4
  471. # CPスレッドを一時停止する
  472. unless @action_battlers.empty?
  473. @cp_thread.stop = true
  474. end
  475. end
  476. #--------------------------------------------------------------------------
  477. # ● 行動順序作成
  478. #--------------------------------------------------------------------------
  479. alias xrxs_bp1_make_action_orders make_action_orders
  480. def make_action_orders
  481.   xrxs_bp1_make_action_orders
  482.   # 全員のCPを確認
  483.   exclude_battler = []
  484.   for battler in @action_battlers
  485.   # CPが不足している場合は @action_battlers から除外する
  486.     if battler.cp < 65535
  487.     exclude_battler.push(battler)
  488.     end
  489.   end
  490.   @action_battlers -= exclude_battler
  491. end
  492. #--------------------------------------------------------------------------
  493. # ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
  494. #--------------------------------------------------------------------------
  495. alias xrxs_bp1_update_phase4_step1 update_phase4_step1
  496. def update_phase4_step1
  497. # 初期化
  498. @phase4_act_continuation = 0
  499. # 勝敗判定
  500. if judge
  501. @cp_thread.stop
  502. # 勝利または敗北の場合 : メソッド終了
  503. return
  504. end
  505. # 未行動バトラー配列の先頭から取得
  506. @active_battler = @action_battlers[0]
  507. # ステータス更新をCPだけに限定。
  508. @status_window.update_cp_only = true
  509. # ステート更新を禁止。
  510. # 戻す
  511. xrxs_bp1_update_phase4_step1
  512. # @status_windowがリフレッシュされなかった場合は手動でリフレッシュ(CPのみ)
  513. if @phase4_step != 2
  514. # リフレッシュ
  515. @status_window.refresh
  516. # 軽量化:たったコレだけΣ(?w?
  517. Graphics.frame_reset
  518. end
  519. # 禁止を解除
  520. @status_window.update_cp_only = false
  521. end
  522. #--------------------------------------------------------------------------
  523. # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  524. #--------------------------------------------------------------------------
  525. alias xrxs_bp1_update_phase4_step2 update_phase4_step2
  526. def update_phase4_step2
  527. # 強制アクションでなければ
  528. unless @active_battler.current_action.forcing
  529. # 制約が [敵を通常攻撃する] か [味方を通常攻撃する] の場合
  530. if @active_battler.restriction == 2 or @active_battler.restriction == 3
  531. # アクションに攻撃を設定
  532. @active_battler.current_action.kind = 0
  533. @active_battler.current_action.basic = 0
  534. end
  535. # 制約が [行動できない] の場合
  536. if @active_battler.restriction == 4
  537. # アクション強制対象のバトラーをクリア
  538. $game_temp.forcing_battler = nil
  539. if @phase4_act_continuation == 0 and @active_battler.cp >= 65535
  540. # ステート自然解除
  541. @active_battler.remove_states_auto
  542. # CP消費
  543. @active_battler.cp -= 65535
  544. # ステータスウィンドウをリフレッシュ
  545. @status_window.refresh
  546. end
  547. # ステップ 1 に移行
  548. @phase4_step = 1
  549. return
  550. end
  551. end
  552. # アクションの種別で分岐
  553. case @active_battler.current_action.kind
  554. when 0
  555. # 攻撃?防御?逃げる?何もしない時の共通消費CP
  556. @active_battler.cp -= CP_COST_BASIC_ACTIONS if @phase4_act_continuation == 0
  557. when 1
  558. # スキル使用時の消費CP
  559. @active_battler.cp -= CP_COST_SKILL_ACTION if @phase4_act_continuation == 0
  560. when 2
  561. # アイテム使用時の消費CP
  562. @active_battler.cp -= CP_COST_ITEM_ACTION if @phase4_act_continuation == 0
  563. when 11
  564. @active_battler.cp -= CP_COST_THROW_ACTION if @phase4_act_continuation == 0
  565. end
  566. # ステート自然解除
  567. @active_battler.remove_states_auto
  568. # 呼び戻す
  569. xrxs_bp1_update_phase4_step2
  570. end
  571.   #--------------------------------------------------------------------------
  572.   # ● 基本アクション 結果作成
  573.   #--------------------------------------------------------------------------
  574.   alias xrxs_bp1_make_basic_action_result make_basic_action_result
  575.   def make_basic_action_result
  576.     # 攻撃の場合
  577.     if @active_battler.current_action.basic == 0 and @phase4_act_continuation == 0
  578.       @active_battler.cp -= CP_COST_BASIC_ATTACK # 攻撃時のCP消費
  579.     end
  580.     # 防御の場合
  581.     if @active_battler.current_action.basic == 1 and @phase4_act_continuation == 0
  582.       @active_battler.cp -= CP_COST_BASIC_GUARD # 防御時のCP消費
  583.       # @active_battlerの防御をON
  584.       @active_battler.now_guarding = true
  585.     end
  586.     # 敵の逃げるの場合
  587.     if @active_battler.is_a?(Game_Enemy) and
  588.       @active_battler.current_action.basic == 2 and @phase4_act_continuation == 0
  589.       @active_battler.cp -= CP_COST_BASIC_ESCAPE # 逃走時のCP消費
  590.     end
  591.     # 何もしないの場合
  592.     if @active_battler.current_action.basic == 3 and @phase4_act_continuation == 0
  593.       @active_battler.cp -= CP_COST_BASIC_NOTHING # 何もしない時のCP消費
  594.     end
  595.     # 逃げるの場合
  596.     if @active_battler.current_action.basic == 4 and @phase4_act_continuation == 0
  597.       @active_battler.cp -= CP_COST_BASIC_ESCAPE # 逃走時のCP消費
  598.       # 逃走可能ではない場合
  599.       if $game_temp.battle_can_escape == false
  600.         # ブザー SE を演奏
  601.         $game_system.se_play($data_system.buzzer_se)
  602.         return
  603.       end
  604.       # 逃走処理
  605.       update_phase2_escape
  606.       return
  607.     end
  608.     # 呼び戻す
  609.     xrxs_bp1_make_basic_action_result
  610.   end
  611. end


  612. #==============================================================================
  613. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  614. #==============================================================================  
复制代码
上面是外挂的。

下面是替换的
  1. #==============================================================================
  2. # ■ Window_BattleStatus
  3. #------------------------------------------------------------------------------
  4. #  显示战斗画面同伴状态的窗口。
  5. #==============================================================================

  6. class Window_BattleStatus < Window_Base
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #--------------------------------------------------------------------------
  10.   def initialize
  11.     super(0, 320, 640, 160)
  12.     self.contents = Bitmap.new(width - 32, height - 32)
  13.     self.z = 9999 #小改动
  14.     self.back_opacity = 50 #小改动  
  15.     @level_up_flags = [false, false, false, false]
  16.     self.opacity = 0
  17.     @cp_output = []
  18.     @cp_bitmap = RPG::Cache.picture("../system/battle/hmcp/cp_bar副本.png")
  19.    
  20.     @cp_output = []
  21.     @cp_back_bar = Sprite.new
  22.     @cp_back_bar.bitmap = Bitmap.new("Graphics/system/battle/hmcp/cp_back_bar")
  23.     @cp_back_bar.x = 380
  24.     @cp_back_bar.y = 10
  25.     @cp_back_bar.z = 101
  26.     @actor_cp_sprite = []
  27.     @actor_cp_sprite_back = []
  28.     for actor in $game_party.actors
  29.       @actor_cp_sprite[actor.index] = Sprite.new
  30.       @actor_cp_sprite[actor.index].bitmap = Bitmap.new("Graphics/system/battle/hmcp/sprite/" + actor.name)
  31.       @actor_cp_sprite[actor.index].x = 430
  32.       @actor_cp_sprite[actor.index].y = 25 - 20
  33.       @actor_cp_sprite[actor.index].z = 102
  34.       @actor_cp_sprite_back[actor.index] = Sprite.new
  35.       @actor_cp_sprite_back[actor.index].bitmap = Bitmap.new("Graphics/system/battle/hmcp/cp_sprite")
  36.       @actor_cp_sprite_back[actor.index].x = 430
  37.       @actor_cp_sprite_back[actor.index].y = 25
  38.       @actor_cp_sprite_back[actor.index].z = 102
  39.     end
  40.     for actor_index in 1..$game_party.actors.size
  41.       @cp_output[actor_index] = Sprite.new
  42.       @cp_output[actor_index].bitmap = Bitmap.new(133, 78)
  43. ########绿色气条的坐标###########################      
  44.       @cp_output[actor_index].x = 160 + (actor_index - 1) * 160
  45.       @cp_output[actor_index].y = 505 - 90 - 10
  46.       @cp_output[actor_index].z = self.z + 2
  47.       @cp_output[actor_index].bitmap.clear
  48.     end
  49.     refresh
  50.   end
  51. ####################################################  
  52.   
  53.   #--------------------------------------------------------------------------
  54.   # ● 释放
  55.   #--------------------------------------------------------------------------
  56.   def dispose
  57.     super
  58.     @cp_bitmap.bitmap.dispose
  59.     @cp_bitmap.dispose
  60.     for actor_index in 1..$game_party.actors.size
  61.       @cp_output[actor_index].bitmap.dispose
  62.       @cp_output[actor_index].dispose
  63.     end
  64.   end
  65.   #--------------------------------------------------------------------------
  66.   # ● 设置升级标志
  67.   #     actor_index : 角色索引
  68.   #--------------------------------------------------------------------------
  69.   def level_up(actor_index)
  70.     @level_up_flags[actor_index] = true
  71.   end
  72.   
  73.   #--------------------------------------------------------------------------
  74.   # ● 刷新
  75.   #--------------------------------------------------------------------------
  76.   def refresh
  77.     self.contents.clear
  78.     @item_max = $game_party.actors.size
  79.     for i in 0...$game_party.actors.size
  80.       actor = $game_party.actors[i]
  81.       actor_x = i * 160 + 4
  82.       draw_actor_name(actor, actor_x+50, 56)
  83. ######################################################
  84.       HP(actor,actor_x,32)
  85.       SP(actor,actor_x,56)


  86. ########################################################
  87.       if @level_up_flags[i]
  88.         self.contents.font.color = normal_color
  89.         self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
  90.       else
  91.         draw_actor_state(actor, actor_x, 96)
  92.       end
  93.     end
  94.   end
  95.   #--------------------------------------------------------------------------
  96.   # ● 刷新画面
  97.   #--------------------------------------------------------------------------
  98.   def update
  99.     super
  100.     # 主界面的不透明度下降
  101.     if $game_temp.battle_main_phase
  102.       self.contents_opacity -= 4 if self.contents_opacity > 191
  103.     else
  104.       self.contents_opacity += 4 if self.contents_opacity < 255
  105.     end
  106.   end
  107. end
复制代码

作者: joshua    时间: 2009-10-2 14:13
LS的姐姐,这个需要外挂图片吧,你也应该发上来
作者: flzt5354    时间: 2009-10-2 14:23
自己随便PS张=。=
作者: zoeylau    时间: 2009-10-2 23:37
12# joshua


这个是替换掉我原来的CP制御脚本来用吗?  貌似还是冲突了
作者: zoeylau    时间: 2009-10-2 23:52
本帖最后由 zoeylau 于 2009-10-3 00:28 编辑

13# flzt5354

啥意思··? 2个随便拿一个?   我都试了 还是不行啊··

附上工程达人帮忙看看吧~~
作者: flzt5354    时间: 2009-10-3 00:20
本帖最后由 flzt5354 于 2009-10-3 00:24 编辑

那不叫冲突=。=那叫缺少素材

千万别点我=。=,真的,真的别用鼠标点击我。。。Help~~
作者: zoeylau    时间: 2009-10-3 00:27
本帖最后由 zoeylau 于 2009-10-3 00:37 编辑

不是啊 我有贴图片进去  也不知道为什么 还是报错了   帮我看看吧··

测试工程.rar

3.89 MB, 下载次数: 84


作者: enter9009    时间: 2009-10-3 00:48
整合失败。。。
还是等他们帮你吧,偶闪!
作者: joshua    时间: 2009-10-3 15:31
不是替换,那个是个外挂.......
作者: joshua    时间: 2009-10-3 15:41
呃,用了你的工程,血条显示的不是很好吗?
作者: zoeylau    时间: 2009-10-3 17:31
我那个血条 是系统功能描绘的  不是用图片的啊··  
我想要个用图片的 这样我才能改界面..
作者: joshua    时间: 2009-10-3 18:36
哦,这样啊......那我就发我那个好嘞......先在你那里看冲突不
作者: zoeylau    时间: 2009-10-3 20:16
恩 ·?  哪一个~~?
作者: joshua    时间: 2009-10-3 20:25
不冲突,可只是把血条加上去了........不然你自己调吧.....
作者: joshua    时间: 2009-10-3 20:48
那个,我不想把东西发上来,所以,请留下你的邮箱吧.....
作者: zoeylau    时间: 2009-10-3 21:30
本帖最后由 zoeylau 于 2009-10-3 21:37 编辑

收到你的地址了  谢谢  很好了 无冲突

但是我不知道你把脚本加在哪里啦?
作者: joshua    时间: 2009-10-3 21:36
我把东西塞到网盘里了,地址用论坛短信发给你了
作者: zoeylau    时间: 2009-10-3 21:38
本帖最后由 zoeylau 于 2009-10-3 21:48 编辑

恩啊 收到啦~~  嘿嘿
血条的脚本的代码写在哪里了?  不知道在哪里改坐标
作者: joshua    时间: 2009-10-3 21:46
window_base里面,备注写了描绘战斗HP
作者: zoeylau    时间: 2009-10-3 21:50
nice···找到了····谢谢···
作者: joshua    时间: 2009-10-3 21:54
话说......

你有没有注意我那个排版时3人制战斗要改的很多.....
作者: zoeylau    时间: 2009-10-3 22:03
额?  什么意思···?没听明白··
作者: joshua    时间: 2009-10-3 22:06
就是我的战斗只能带入3个人.....第四个的话要重新排版.....

要派的东西还很多,可能有些麻烦,所以我才那个样子就丢给你的
作者: zoeylau    时间: 2009-10-3 22:10
是吗··· 那再说吧  今天病了 先不研究了
作者: joshua    时间: 2009-10-3 22:14
呵呵,不行再找我吧,不过可能会不在几天。

你是要做空轨同人吗?
作者: zoeylau    时间: 2009-10-3 23:43
好的~~没关系  这坑也不是几天能填完的·
我不是做空轨同人  只是喜欢这个界面  呵呵···




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1