设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
楼主: zoeylau
打印 上一主题 下一主题

[已经解决] 求一个用图片描绘的血条素材-附工程

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
73
在线时间
24 小时
注册时间
2008-8-4
帖子
113
11
 楼主| 发表于 2009-10-2 13:48:47 | 只看该作者
好的  没关系   
假期游玩要小心   出门把妹要用心
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
1 小时
注册时间
2007-8-18
帖子
701
12
发表于 2009-10-2 13:52:08 | 只看该作者
# ————————————————————————————————————
# 本脚本来自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  因为新论坛我不是很会用.......有的事情还得问问你...
笑天下谁是敌手,问千年谁主沉浮
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
18 小时
注册时间
2009-7-25
帖子
411
13
发表于 2009-10-2 14:01:18 | 只看该作者
本帖最后由 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
复制代码
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
1 小时
注册时间
2007-8-18
帖子
701
14
发表于 2009-10-2 14:13:47 | 只看该作者
LS的姐姐,这个需要外挂图片吧,你也应该发上来
笑天下谁是敌手,问千年谁主沉浮
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
18 小时
注册时间
2009-7-25
帖子
411
15
发表于 2009-10-2 14:23:51 | 只看该作者
自己随便PS张=。=
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
73
在线时间
24 小时
注册时间
2008-8-4
帖子
113
16
 楼主| 发表于 2009-10-2 23:37:31 | 只看该作者
12# joshua


这个是替换掉我原来的CP制御脚本来用吗?  貌似还是冲突了
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
73
在线时间
24 小时
注册时间
2008-8-4
帖子
113
17
 楼主| 发表于 2009-10-2 23:52:41 | 只看该作者
本帖最后由 zoeylau 于 2009-10-3 00:28 编辑

13# flzt5354

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

附上工程达人帮忙看看吧~~
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
18 小时
注册时间
2009-7-25
帖子
411
18
发表于 2009-10-3 00:20:09 | 只看该作者
本帖最后由 flzt5354 于 2009-10-3 00:24 编辑

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

千万别点我=。=,真的,真的别用鼠标点击我。。。Help~~
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
73
在线时间
24 小时
注册时间
2008-8-4
帖子
113
19
 楼主| 发表于 2009-10-3 00:27:24 | 只看该作者
本帖最后由 zoeylau 于 2009-10-3 00:37 编辑

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

测试工程.rar

3.89 MB, 下载次数: 84

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
0 小时
注册时间
2009-4-7
帖子
341
20
发表于 2009-10-3 00:48:47 | 只看该作者
整合失败。。。
还是等他们帮你吧,偶闪!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-28 06:19

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表