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

Project1

 找回密码
 注册会员
搜索
查看: 1687|回复: 5
打印 上一主题 下一主题

[已经解决] CP制如何调节敌人的CP条位置?

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
75 小时
注册时间
2010-10-11
帖子
275
跳转到指定楼层
1
发表于 2011-11-7 23:42:12 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 miracl 于 2011-11-7 23:42 编辑
  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 = 2.0
  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_BASIC_ATTACK = 65535 # 攻撃
  38. CP_COST_BASIC_GUARD = 32768 # 防御
  39. CP_COST_BASIC_NOTHING = 65535 # 不做任何事情
  40. CP_COST_BASIC_ESCAPE = 65535 # 逃跑
  41. end

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

  165. #==============================================================================
  166. # ■ Game_Battler
  167. #==============================================================================
  168. class Game_Battler
  169. attr_accessor :now_guarding # 現在防御中フラグ
  170. attr_accessor :cp # 現在CP
  171. attr_accessor :slip_state_update_ban # スリップ?ステート自動処理の禁止
  172. #--------------------------------------------------------------------------
  173. # ○ CP の変更
  174. #--------------------------------------------------------------------------
  175. def cp=(p)
  176. @cp = [[p, 0].max, 65535].min
  177. end
  178. #--------------------------------------------------------------------------
  179. # ● 防御中判定 [ 再定義 ]
  180. #--------------------------------------------------------------------------
  181. def guarding?
  182. return @now_guarding
  183. end
  184. #--------------------------------------------------------------------------
  185. # ● コマンド入力可能判定
  186. #--------------------------------------------------------------------------
  187. alias xrxs_bp1_inputable? inputable?
  188. def inputable?
  189. bool = xrxs_bp1_inputable?
  190. return (bool and (@cp >= 65535))
  191. end
  192. #--------------------------------------------------------------------------
  193. # ● ステート [スリップダメージ] 判定
  194. #--------------------------------------------------------------------------
  195. alias xrxs_bp1_slip_damage? slip_damage?
  196. def slip_damage?
  197. return false if @slip_state_update_ban
  198. return xrxs_bp1_slip_damage?
  199. end
  200. #--------------------------------------------------------------------------
  201. # ● ステート自然解除 (ターンごとに呼び出し)
  202. #--------------------------------------------------------------------------
  203. alias xrxs_bp1_remove_states_auto remove_states_auto
  204. def remove_states_auto
  205. return if @slip_state_update_ban
  206. xrxs_bp1_remove_states_auto
  207. end
  208. end
  209. #==============================================================================
  210. # ■ Game_Actor
  211. #==============================================================================
  212. class Game_Actor < Game_Battler
  213. #--------------------------------------------------------------------------
  214. # ● セットアップ
  215. #--------------------------------------------------------------------------
  216. alias xrxs_bp1_setup setup
  217. def setup(actor_id)
  218. xrxs_bp1_setup(actor_id)
  219. @cp = 0
  220. @now_guarding = false
  221. @slip_state_update_ban = false
  222. end
  223. end
  224. #==============================================================================
  225. # ■ Game_Enemy
  226. #==============================================================================
  227. class Game_Enemy < Game_Battler
  228. #--------------------------------------------------------------------------
  229. # ● オブジェクト初期化
  230. #--------------------------------------------------------------------------
  231. alias xrxs_bp1_initialize initialize
  232. def initialize(troop_id, member_index)
  233. xrxs_bp1_initialize(troop_id, member_index)
  234. @cp = 0
  235. @now_guarding = false
  236. @slip_state_update_ban = false
  237. end
  238. end

  239. class Window_All < Window_Base
  240.   def initialize
  241.     super(0,0,640,480)
  242.     self.opacity = 0
  243.     self.contents = Bitmap.new(width - 32, height - 32)
  244.     refresh
  245.   end
  246.   def refresh
  247.     self.contents.clear
  248.     for actor in $game_troop.enemies
  249.       next if !actor.exist?
  250.       draw_actor_cp_meter(actor, actor.screen_x-50, actor.screen_y-50, 60, 0)
  251.     end
  252.   end
  253.   #--------------------------------------------------------------------------
  254.   # ○ CPメーター の描画
  255.   #--------------------------------------------------------------------------
  256.   def draw_actor_cp_meter(actor, x, y, width = 156, type = 0)
  257.     self.contents.font.color = system_color
  258.     self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
  259.     if actor.cp == nil
  260.       actor.cp = 0
  261.     end
  262.     w = width * [actor.cp,65535].min / 65535
  263.     self.contents.fill_rect(x, y+28, w,1, Color.new(255, 255, 128, 255))
  264.     self.contents.fill_rect(x, y+29, w,1, Color.new(255, 255, 0, 255))
  265.     self.contents.fill_rect(x, y+30, w,1, Color.new(192, 192, 0, 255))
  266.     self.contents.fill_rect(x, y+31, w,1, Color.new(128, 128, 0, 255))
  267.   end  
  268. end

  269. #==============================================================================
  270. # ■ Window_BattleStatus
  271. #==============================================================================
  272. class Window_BattleStatus < Window_Base
  273.   #--------------------------------------------------------------------------
  274.   # ○ 公開インスタンス変数
  275.   #--------------------------------------------------------------------------
  276.   attr_accessor :update_cp_only # CPメーターのみの更新
  277.   #--------------------------------------------------------------------------
  278.   # ● オブジェクト初期化
  279.   #--------------------------------------------------------------------------
  280.   alias xrxs_bp1_initialize initialize
  281.   def initialize
  282.     @update_cp_only = false
  283.     @wall = Window_All.new
  284.     xrxs_bp1_initialize
  285.   end
  286.   def dispose
  287.     super
  288.     @wall.dispose
  289.   end
  290.   #--------------------------------------------------------------------------
  291.   # ● リフレッシュ
  292.   #--------------------------------------------------------------------------
  293.   alias xrxs_bp1_refresh refresh
  294.   def refresh
  295.     unless @update_cp_only
  296.       xrxs_bp1_refresh
  297.     end
  298.     refresh_cp
  299.     @wall.refresh
  300.   end
  301.   #--------------------------------------------------------------------------
  302.   # ○ リフレッシュ(CPのみ)
  303.   #--------------------------------------------------------------------------
  304.   def refresh_cp
  305.     for i in 0...$game_party.actors.size
  306.     actor = $game_party.actors[i]
  307.     width = [self.width*3/4 / XRXS_BP1::MAX, 80].max
  308.     space = self.width / XRXS_BP1::MAX
  309.     case XRXS_BP1::ALIGN
  310.     when 0
  311.       actor_x = i * space + 4
  312.     when 1
  313.       actor_x = (space * ((XRXS_BP1::MAX - $game_party.actors.size)/2.0 + i)).floor
  314.     when 2
  315.       actor_x = (i + XRXS_BP1::MAX - $game_party.actors.size) * space + 4
  316.     end
  317.       actor_x += self.x
  318.       draw_actor_cp_meter(actor, actor_x, 96, width, 0)
  319.     end
  320.   end
  321.   #--------------------------------------------------------------------------
  322.   # ○ CPメーター の描画
  323.   #--------------------------------------------------------------------------
  324.   def draw_actor_cp_meter(actor, x, y, width = 156, type = 0)
  325.     self.contents.font.color = system_color
  326.     self.contents.fill_rect(x-1, y+27, width+2,6, Color.new(0, 0, 0, 255))
  327.     if actor.cp == nil
  328.       actor.cp = 0
  329.     end
  330.     w = width * [actor.cp,65535].min / 65535
  331.     self.contents.fill_rect(x, y+28, w,1, Color.new(255, 255, 128, 255))
  332.     self.contents.fill_rect(x, y+29, w,1, Color.new(255, 255, 0, 255))
  333.     self.contents.fill_rect(x, y+30, w,1, Color.new(192, 192, 0, 255))
  334.     self.contents.fill_rect(x, y+31, w,1, Color.new(128, 128, 0, 255))
  335.   end
  336. end
  337. #==============================================================================
  338. # ■ Scene_Battle
  339. #==============================================================================
  340. class Scene_Battle
  341. #--------------------------------------------------------------------------
  342. # ● フレーム更新
  343. #--------------------------------------------------------------------------
  344. alias xrxs_bp1_update update
  345. def update
  346. xrxs_bp1_update
  347. # CP更新
  348. @cp_thread.update
  349. end
  350. #--------------------------------------------------------------------------
  351. # ● バトル終了
  352. # result : 結果 (0:勝利 1:敗北 2:逃走)
  353. #--------------------------------------------------------------------------
  354. alias xrxs_bp1_battle_end battle_end
  355. def battle_end(result)
  356. # CPカウントを停止する
  357. @cp_thread.stop
  358. # 呼び戻す
  359. xrxs_bp1_battle_end(result)
  360. end
  361. #--------------------------------------------------------------------------
  362. # ● プレバトルフェーズ開始
  363. #--------------------------------------------------------------------------
  364. alias xrxs_bp1_start_phase1 start_phase1
  365. def start_phase1
  366. @agi_total = 0
  367. # CP加算を開始する
  368. @cp_thread = Scene_Battle_CP.new
  369. # インデックスを計算
  370. @cp_escape_actor_command_index = @actor_command_window.height/32 - 1
  371. # アクターコマンドウィンドウに追加
  372. @actor_command_window.add_command("逃跑")
  373. if !$game_temp.battle_can_escape
  374. @actor_command_window.disable_item(@cp_escape_actor_command_index)
  375. end
  376. # 呼び戻す
  377. xrxs_bp1_start_phase1
  378. end
  379. #--------------------------------------------------------------------------
  380. # ● パーティコマンドフェーズ開始
  381. #--------------------------------------------------------------------------
  382. alias xrxs_bp1_start_phase2 start_phase2
  383. def start_phase2
  384. xrxs_bp1_start_phase2
  385. @party_command_window.active = false
  386. @party_command_window.visible = false
  387. # CP加算を再開する
  388. @cp_thread.stop = false
  389. # 次へ
  390. start_phase3
  391. end
  392. #--------------------------------------------------------------------------
  393. # ● アクターコマンドウィンドウのセットアップ
  394. #--------------------------------------------------------------------------
  395. alias xrxs_bp1_phase3_setup_command_window phase3_setup_command_window
  396. def phase3_setup_command_window
  397. # CPスレッドを一時停止する
  398. @cp_thread.stop = true
  399. # ウィンドウのCP更新
  400. @status_window.refresh_cp
  401. # @active_battlerの防御を解除
  402. @active_battler.now_guarding = false
  403. # 効果音の再生
  404. Audio.se_play(DATA_SYSTEM_COMMAND_UP_SE) if DATA_SYSTEM_COMMAND_UP_SE != ""
  405. # 呼び戻す
  406. xrxs_bp1_phase3_setup_command_window
  407. end
  408. #--------------------------------------------------------------------------
  409. # ● フレーム更新 (アクターコマンドフェーズ : 基本コマンド)
  410. #--------------------------------------------------------------------------
  411. alias xrxs_bsp1_update_phase3_basic_command update_phase3_basic_command
  412. def update_phase3_basic_command
  413. # C ボタンが押された場合
  414. if Input.trigger?(Input::C)
  415. # アクターコマンドウィンドウのカーソル位置で分岐
  416. case @actor_command_window.index
  417. when @cp_escape_actor_command_index # 逃げる
  418. if $game_temp.battle_can_escape
  419. # 決定 SE を演奏
  420. $game_system.se_play($data_system.decision_se)
  421. # アクションを設定
  422. @active_battler.current_action.kind = 0
  423. @active_battler.current_action.basic = 4
  424. # 次のアクターのコマンド入力へ
  425. phase3_next_actor
  426. else
  427. # ブザー SE を演奏
  428. $game_system.se_play($data_system.buzzer_se)
  429. end
  430. return
  431. end
  432. end
  433. xrxs_bsp1_update_phase3_basic_command
  434. end
  435. #--------------------------------------------------------------------------
  436. # ● メインフェーズ開始
  437. #--------------------------------------------------------------------------
  438. alias xrxs_bp1_start_phase4 start_phase4
  439. def start_phase4
  440. # 呼び戻す
  441. xrxs_bp1_start_phase4
  442. # CPスレッドを一時停止する
  443. unless @action_battlers.empty?
  444. @cp_thread.stop = true
  445. end
  446. end
  447. #--------------------------------------------------------------------------
  448. # ● 行動順序作成
  449. #--------------------------------------------------------------------------
  450. alias xrxs_bp1_make_action_orders make_action_orders
  451. def make_action_orders
  452. xrxs_bp1_make_action_orders
  453. # 全員のCPを確認
  454. exclude_battler = []
  455. for battler in @action_battlers
  456. # CPが不足している場合は @action_battlers から除外する
  457. if battler.cp < 65535
  458. exclude_battler.push(battler)
  459. end
  460. end
  461. @action_battlers -= exclude_battler
  462. end
  463. #--------------------------------------------------------------------------
  464. # ● フレーム更新 (メインフェーズ ステップ 1 : アクション準備)
  465. #--------------------------------------------------------------------------
  466. alias xrxs_bp1_update_phase4_step1 update_phase4_step1
  467. def update_phase4_step1
  468. # 初期化
  469. @phase4_act_continuation = 0
  470. # 勝敗判定
  471. if judge
  472. @cp_thread.stop
  473. # 勝利または敗北の場合 : メソッド終了
  474. return
  475. end
  476. # 未行動バトラー配列の先頭から取得
  477. @active_battler = @action_battlers[0]
  478. # ステータス更新をCPだけに限定。
  479. @status_window.update_cp_only = true
  480. # ステート更新を禁止。
  481. @active_battler.slip_state_update_ban = true if @active_battler != nil
  482. # 戻す
  483. xrxs_bp1_update_phase4_step1
  484. # @status_windowがリフレッシュされなかった場合は手動でリフレッシュ(CPのみ)
  485. if @phase4_step != 2
  486. # リフレッシュ
  487. @status_window.refresh
  488. # 軽量化:たったコレだけΣ(?w?
  489. Graphics.frame_reset
  490. end
  491. # 禁止を解除
  492. @status_window.update_cp_only = false
  493. @active_battler.slip_state_update_ban = false if @active_battler != nil
  494. end
  495. #--------------------------------------------------------------------------
  496. # ● フレーム更新 (メインフェーズ ステップ 2 : アクション開始)
  497. #--------------------------------------------------------------------------
  498. alias xrxs_bp1_update_phase4_step2 update_phase4_step2
  499. def update_phase4_step2
  500. # 強制アクションでなければ
  501. unless @active_battler.current_action.forcing
  502. # 制約が [敵を通常攻撃する] か [味方を通常攻撃する] の場合
  503. if @active_battler.restriction == 2 or @active_battler.restriction == 3
  504. # アクションに攻撃を設定
  505. @active_battler.current_action.kind = 0
  506. @active_battler.current_action.basic = 0
  507. end
  508. # 制約が [行動できない] の場合
  509. if @active_battler.restriction == 4
  510. # アクション強制対象のバトラーをクリア
  511. $game_temp.forcing_battler = nil
  512. if @phase4_act_continuation == 0 and @active_battler.cp >= 65535
  513. # ステート自然解除
  514. @active_battler.remove_states_auto
  515. # CP消費
  516. @active_battler.cp -= 65535
  517. # ステータスウィンドウをリフレッシュ
  518. @status_window.refresh
  519. end
  520. # ステップ 1 に移行
  521. @phase4_step = 1
  522. return
  523. end
  524. end
  525. # アクションの種別で分岐
  526. case @active_battler.current_action.kind
  527. when 0
  528. # 攻撃?防御?逃げる?何もしない時の共通消費CP
  529. @active_battler.cp -= CP_COST_BASIC_ACTIONS if @phase4_act_continuation == 0
  530. when 1
  531. # スキル使用時の消費CP
  532. @active_battler.cp -= CP_COST_SKILL_ACTION if @phase4_act_continuation == 0
  533. when 2
  534. # アイテム使用時の消費CP
  535. @active_battler.cp -= CP_COST_ITEM_ACTION if @phase4_act_continuation == 0
  536. end
  537. # ステート自然解除
  538. @active_battler.remove_states_auto
  539. # 呼び戻す
  540. xrxs_bp1_update_phase4_step2
  541. end
  542.   #--------------------------------------------------------------------------
  543.   # ● 基本アクション 結果作成
  544.   #--------------------------------------------------------------------------
  545.   alias xrxs_bp1_make_basic_action_result make_basic_action_result
  546.   def make_basic_action_result
  547.     # 攻撃の場合
  548.     if @active_battler.current_action.basic == 0 and @phase4_act_continuation == 0
  549.       @active_battler.cp -= CP_COST_BASIC_ATTACK # 攻撃時のCP消費
  550.     end
  551.     # 防御の場合
  552.     if @active_battler.current_action.basic == 1 and @phase4_act_continuation == 0
  553.       @active_battler.cp -= CP_COST_BASIC_GUARD # 防御時のCP消費
  554.       # @active_battlerの防御をON
  555.       @active_battler.now_guarding = true
  556.     end
  557.     # 敵の逃げるの場合
  558.     if @active_battler.is_a?(Game_Enemy) and
  559.       @active_battler.current_action.basic == 2 and @phase4_act_continuation == 0
  560.       @active_battler.cp -= CP_COST_BASIC_ESCAPE # 逃走時のCP消費
  561.     end
  562.     # 何もしないの場合
  563.     if @active_battler.current_action.basic == 3 and @phase4_act_continuation == 0
  564.       @active_battler.cp -= CP_COST_BASIC_NOTHING # 何もしない時のCP消費
  565.     end
  566.     # 逃げるの場合
  567.     if @active_battler.current_action.basic == 4 and @phase4_act_continuation == 0
  568.       @active_battler.cp -= CP_COST_BASIC_ESCAPE # 逃走時のCP消費
  569.       # 逃走可能ではない場合
  570.       if $game_temp.battle_can_escape == false
  571.         # ブザー SE を演奏
  572.         $game_system.se_play($data_system.buzzer_se)
  573.         return
  574.       end
  575.       # 逃走処理
  576.       update_phase2_escape
  577.       return
  578.     end
  579.     # 呼び戻す
  580.     xrxs_bp1_make_basic_action_result
  581.   end
  582.   #--------------------------------------------------------------------------
  583.   # ● フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
  584.   #--------------------------------------------------------------------------
  585.   alias xrxs_bp1_update_phase4_step6 update_phase4_step6
  586.   def update_phase4_step6
  587.     # スリップダメージ
  588.     if @active_battler.hp > 0 and @active_battler.slip_damage?
  589.       @active_battler.slip_damage_effect
  590.       @active_battler.damage_pop = true
  591.       # ステータスウィンドウをリフレッシュ
  592.       @status_window.refresh
  593.     end
  594.     # 呼び戻す
  595.     xrxs_bp1_update_phase4_step6
  596.   end
  597. end


  598. #==============================================================================
  599. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  600. #==============================================================================  
复制代码
我是菜鸟横版+CP制,刚进入战斗时,CP条还在敌人脚下,一到我的回合之后条都在敌人的身上了。谁帮我改下,估计是我以前改错了什么- -!
重新制作,我就是个渣渣,嗯嗯……

Lv3.寻梦者

梦石
0
星屑
1419
在线时间
512 小时
注册时间
2007-2-22
帖子
46
2
发表于 2011-11-8 08:33:26 手机端发表。 | 只看该作者
脚本里有坐标的四个数,你改改
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
75 小时
注册时间
2010-10-11
帖子
275
3
 楼主| 发表于 2011-11-8 10:25:55 | 只看该作者
ccwkgg 发表于 2011-11-8 08:33
脚本里有坐标的四个数,你改改

额,没找到啊,能发下行数么?
我已经会如何更改玩家的CP……但是敌人的还是不会改,
重新制作,我就是个渣渣,嗯嗯……
回复

使用道具 举报

Lv4.逐梦者

梦石
3
星屑
6420
在线时间
1131 小时
注册时间
2007-12-26
帖子
2402
4
发表于 2011-11-8 12:42:01 | 只看该作者
搜索 ○ CPメーター の描画

比如你要把敌人的CP条向右平移100,就这么改:

#--------------------------------------------------------------------------
  # ○ 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+100, 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+100, y+28, w,1, Color.new(255, 255, 128, 255))
    self.contents.fill_rect(x+100, y+29, w,1, Color.new(255, 255, 0, 255))
    self.contents.fill_rect(x+100, y+30, w,1, Color.new(192, 192, 0, 255))
    self.contents.fill_rect(x+100, y+31, w,1, Color.new(128, 128, 0, 255))
  end  
end
囡囚囨囚囨図囨囧
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
75 小时
注册时间
2010-10-11
帖子
275
5
 楼主| 发表于 2011-11-8 19:59:45 | 只看该作者
幻耶 发表于 2011-11-8 12:42
搜索 ○ CPメーター の描画

比如你要把敌人的CP条向右平移100,就这么改:

呃,先感谢下楼上,但是你的方法我试过了,只能改变玩家的CP条,可能是我说的不够清楚,我这次截个图……
重新制作,我就是个渣渣,嗯嗯……
回复

使用道具 举报

Lv4.逐梦者

梦石
3
星屑
6420
在线时间
1131 小时
注册时间
2007-12-26
帖子
2402
6
发表于 2011-11-8 20:16:25 | 只看该作者
miracl 发表于 2011-11-8 19:59
呃,先感谢下楼上,但是你的方法我试过了,只能改变玩家的CP条,可能是我说的不够清楚,我这次截个图…… ...

你开个新工程放进这个脚本就知道了,这脚本有两个 # ○ CPメーター の描画 部分,第一个是敌人的,第二个是角色的

点评

原来有2个,我一粗心没注意,搞定了,谢谢~  发表于 2011-11-8 20:51
囡囚囨囚囨図囨囧
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-25 21:35

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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