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

Project1

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

[已经过期] 求去掉逃跑的脚本

[复制链接]
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2010-7-30
帖子
37
跳转到指定楼层
1
发表于 2010-8-11 09:09:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽

Lv1.梦旅人

梦石
0
星屑
50
在线时间
29 小时
注册时间
2010-7-5
帖子
483
2
发表于 2010-8-11 09:15:14 | 只看该作者
本帖最后由 BBBBB6 于 2010-8-11 09:24 编辑

请无视本楼.....

点评

你一口气连了6楼...准备大出血吧~~~~!  发表于 2010-8-11 12:34
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
29 小时
注册时间
2010-7-5
帖子
483
3
发表于 2010-8-11 09:16:53 | 只看该作者
啊勒勒???为什么混乱状态修改也加上去了!?请54混乱状态修改的部分...
我X!齐时战斗也放上去了!!!请54这个脚本吧......
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
29 小时
注册时间
2010-7-5
帖子
483
4
发表于 2010-8-11 09:20:25 | 只看该作者
卧槽!我发错了!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
29 小时
注册时间
2010-7-5
帖子
483
5
发表于 2010-8-11 09:23:45 | 只看该作者
楼主请无视2楼的脚本!!!不是那样改的@!!!!!!!!!!!!!!!!!!!!!!!!!!@#!@$@#%@#%
不过你用了也没关系,不会有冲突的......
其实有很多方法去掉那个的
回复 支持 反对

使用道具 举报

Lv1.梦旅人

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


  562. #==============================================================
  563. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  564. #==============================================================
复制代码
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
29 小时
注册时间
2010-7-5
帖子
483
7
发表于 2010-8-11 09:25:48 | 只看该作者
还有这个图标战斗也是去掉的
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================

  4. module Momo_IconCommand
  5.   # 图标名称设定
  6.   ATTACK_ICON_NAME = "B攻击" # 攻撃
  7.   SKILL_ICON_NAME = "B技能"   # 特技
  8.   GUARD_ICON_NAME = "B防御"  # 防御
  9.   ITEM_ICON_NAME = "B道具"     # 物品
  10.   ESCAPE_ICON_NAME = "B逃跑"  # 逃跑
  11.   # X坐标修正
  12.   X_PLUS = -50
  13.   # Y坐标修正
  14.   Y_PLUS = -60
  15.   # 选择时图标的动作
  16.   # 0:静止 1:放大
  17.   SELECT_TYPE = 1
  18.   # 闪烁时光芒的颜色
  19.   FLASH_COLOR = Color.new(255, 255, 255, 128)
  20.   # 闪烁时间
  21.   FLASH_DURATION = 10
  22.   # 闪烁间隔
  23.   FLASH_INTERVAL = 20
  24.   # 是否写出文字的名称
  25.   COM_NAME_DROW = true
  26.   # 文字名称是否移动
  27.   COM_NAME_MOVE = true
  28.   # 文字内容
  29.   ATTACK_NAME = "攻击"    # 攻击
  30.   SKILL_NAME = "技能"   # 特技
  31.   GUARD_NAME = "防御"     # 防御
  32.   ITEM_NAME = "物品"  # 物品
  33.   ESCAPE_NAME = "逃跑"  # 逃跑
  34.   # 文字颜色
  35.   COM_NAME_COLOR = Color.new(255, 255, 255, 255)
  36.   # 文字坐标修正
  37.   COM_NAME_X_PLUS = 0
  38.   COM_NAME_Y_PLUS = -30
  39. end

  40. class Window_CommandIcon < Window_Selectable
  41.   attr_accessor :last_index
  42.   #--------------------------------------------------------------------------
  43.   # ● オブジェクト初期化
  44.   #--------------------------------------------------------------------------
  45.   def initialize(x, y, commands)
  46.     super(x, y, 32, 32)
  47.     # ウィンドウスキンに空文字列を指定してウィンドウを描画しないようにする
  48.     self.windowskin = RPG::Cache.windowskin("")
  49.     @item_max = commands.size
  50.     @commands = commands
  51.     @column_max = commands.size
  52.     @index = 0
  53.     @last_index = nil
  54.     @name_sprite = nil
  55.     @sprite = []
  56.     refresh
  57.   end
  58.   def dispose
  59.     super
  60.     for sprite in @sprite
  61.       sprite.dispose unless sprite.nil?
  62.     end
  63.     @name_sprite.dispose unless @name_sprite.nil?
  64.   end
  65.   #--------------------------------------------------------------------------
  66.   # ● リフレッシュ
  67.   #--------------------------------------------------------------------------
  68.   def refresh
  69.     @name_sprite.dispose unless @name_sprite.nil?
  70.     for sprite in @sprite
  71.       sprite.dispose unless sprite.nil?
  72.     end
  73.     @name_sprite = nil
  74.     draw_com_name if Momo_IconCommand::COM_NAME_DROW
  75.     @sprite = []
  76.     for i in 0...@item_max
  77.       draw_item(i)
  78.     end
  79.   end
  80.   #--------------------------------------------------------------------------
  81.   # ● 項目の描画
  82.   #--------------------------------------------------------------------------
  83.   def draw_item(index)
  84.     @sprite[index] = Sprite_Icon.new(nil, @commands[index])
  85.     @sprite[index].z = self.z + 100##########################
  86.   end
  87.   def draw_com_name
  88.     @name_sprite = Sprite_Comm_Name.new(nil, get_com_name)
  89.    
  90.   end
  91.   
  92.   # 更新
  93.   def update
  94.     super
  95.     icon_update
  96.     com_name_update if Momo_IconCommand::COM_NAME_DROW
  97.     if move_index?
  98.       @last_index = self.index
  99.     end
  100.   end
  101.   # アイコンの更新
  102.   def icon_update
  103.     for i in [email protected]
  104.       @sprite[i].active = (self.index == i)
  105.       @sprite[i].x = self.x + i * 24
  106.       @sprite[i].y = self.y + 0
  107.       @sprite[i].z = (self.index == i) ? self.z + 2 : self.z + 1
  108.       @sprite[i].visible = self.visible
  109.       @sprite[i].update
  110.     end
  111.   end
  112.   # コマンドネームの更新
  113.   def com_name_update
  114.     if move_index?
  115.       @name_sprite.name = get_com_name
  116.     end
  117.     @name_sprite.x = self.x - 12 + Momo_IconCommand::COM_NAME_X_PLUS
  118.     @name_sprite.y = self.y - 40 + Momo_IconCommand::COM_NAME_Y_PLUS
  119.     @name_sprite.z = self.z + 1
  120.     @name_sprite.active = self.active
  121.     @name_sprite.visible = self.visible
  122.     @name_sprite.update
  123.   end
  124.   def get_com_name
  125.     make_name_set if @name_set.nil?
  126.     name = @name_set[self.index]
  127.     name = "" if name.nil?
  128.     return name
  129.   end
  130.   def make_name_set
  131.     @name_set = []
  132.     @name_set[0] = Momo_IconCommand::ATTACK_NAME
  133.     @name_set[1] = Momo_IconCommand::SKILL_NAME
  134.     @name_set[2] = Momo_IconCommand::GUARD_NAME
  135.     @name_set[3] = Momo_IconCommand::ITEM_NAME
  136.     @name_set[4] = Momo_IconCommand::ESCAPE_NAME
  137.   end
  138.   def move_index?
  139.     return self.index != @last_index
  140.   end
  141.   def need_reset
  142.     @name_sprite.need_reset = true if Momo_IconCommand::COM_NAME_DROW
  143.   end
  144. end

  145. # アイコン用スプライト
  146. class Sprite_Icon < Sprite
  147.   attr_accessor :active
  148.   attr_accessor :icon_name
  149.   #--------------------------------------------------------------------------
  150.   # ● オブジェクト初期化
  151.   #--------------------------------------------------------------------------
  152.   def initialize(viewport, icon_name)
  153.     super(viewport)
  154.     @icon_name = icon_name
  155.     @last_icon = @icon_name
  156.     @count = 0
  157.     self.bitmap = RPG::Cache.icon(@icon_name)
  158.     self.ox = self.bitmap.width / 2
  159.     self.oy = self.bitmap.height / 2
  160.     @active = false
  161.   end
  162.   #--------------------------------------------------------------------------
  163.   # ● 解放
  164.   #--------------------------------------------------------------------------
  165.   def dispose
  166.     if self.bitmap != nil
  167.       self.bitmap.dispose
  168.     end
  169.     super
  170.   end
  171.   #--------------------------------------------------------------------------
  172.   # ● フレーム更新
  173.   #--------------------------------------------------------------------------
  174.   def update
  175.     super
  176.     if @icon_name != @last_icon
  177.       @last_icon = @icon_name
  178.       self.bitmap = RPG::Cache.icon(@icon_name)
  179.     end
  180.     if @active
  181.       @count += 1
  182.       case Momo_IconCommand::SELECT_TYPE
  183.       when 0
  184.         icon_flash
  185.       when 1
  186.         icon_zoom
  187.       end
  188.       @count = 0 if @count == 20
  189.     else
  190.       icon_reset
  191.     end
  192.   end
  193.   def icon_flash
  194.     if @count % Momo_IconCommand::FLASH_INTERVAL == 0 or @count == 1
  195.       self.flash(Momo_IconCommand::FLASH_COLOR, Momo_IconCommand::FLASH_DURATION)
  196.     end
  197.   end
  198.   def icon_zoom
  199.     case @count
  200.     when 1..10
  201.       zoom = 1.0 + @count / 10.0
  202.     when 11..20
  203.       zoom = 2.0 - (@count - 10) / 10.0
  204.     end
  205.     self.zoom_x = zoom
  206.     self.zoom_y = zoom
  207.   end
  208.   def icon_reset
  209.     @count = 0
  210.     self.zoom_x = 1.0
  211.     self.zoom_y = 1.0
  212.   end
  213. end

  214. # コマンドネーム用スプライト
  215. class Sprite_Comm_Name < Sprite
  216.   attr_accessor :active
  217.   attr_accessor :name
  218.   attr_accessor :need_reset
  219.   #--------------------------------------------------------------------------
  220.   # ● オブジェクト初期化
  221.   #--------------------------------------------------------------------------
  222.   def initialize(viewport, name)
  223.     super(viewport)
  224.     @name = name
  225.     @last_name = nil
  226.     @count = 0
  227.     @x_plus = 0
  228.     @opa_plus = 0
  229.     @need_reset = false
  230.     @active = false
  231.     self.bitmap = Bitmap.new(160, 32)
  232.   end
  233.   #--------------------------------------------------------------------------
  234.   # ● 解放
  235.   #--------------------------------------------------------------------------
  236.   def dispose
  237.     if self.bitmap != nil
  238.       self.bitmap.dispose
  239.     end
  240.     super
  241.   end
  242.   #--------------------------------------------------------------------------
  243.   # ● フレーム更新
  244.   #--------------------------------------------------------------------------
  245.   def update
  246.     super
  247.     if @active
  248.       if need_reset?
  249.         @need_reset = false
  250.         @last_name = @name
  251.         text_reset
  252.       end
  253.       move_text if Momo_IconCommand::COM_NAME_MOVE
  254.     end
  255.   end
  256.   def move_text
  257.     @count += 1
  258.     @x_plus = [@count * 8, 80].min
  259.     self.x = self.x - 80 + @x_plus
  260.     self.opacity = @count * 25
  261.   end
  262.   def text_reset
  263.     @count = 0
  264.     @x_plus = 0
  265.     self.bitmap.clear
  266.     self.bitmap.font.color = Momo_IconCommand::COM_NAME_COLOR
  267.     self.bitmap.draw_text(0, 0, 160, 32, @name)
  268.   end
  269.   def need_reset?
  270.     return (@name != @last_name or @need_reset)
  271.   end
  272. end

  273. class Scene_Battle
  274.   #--------------------------------------------------------------------------
  275.   # ● プレバトルフェーズ開始
  276.   #--------------------------------------------------------------------------
  277.   alias scene_battle_icon_command_start_phase1 start_phase1
  278.   def start_phase1
  279.     com1 = Momo_IconCommand::ATTACK_ICON_NAME
  280.     com2 = Momo_IconCommand::SKILL_ICON_NAME
  281.     com3 = Momo_IconCommand::GUARD_ICON_NAME
  282.     com4 = Momo_IconCommand::ITEM_ICON_NAME
  283.     com5 = Momo_IconCommand::ESCAPE_ICON_NAME
  284.     @actor_command_window = Window_CommandIcon.new(0, 0, [com1, com2, com3, com4, com5])
  285.     @actor_command_window.y = 160
  286.     @actor_command_window.back_opacity = 160
  287.     @actor_command_window.active = false
  288.     @actor_command_window.visible = false
  289.     @actor_command_window.update
  290.     scene_battle_icon_command_start_phase1
  291.   end
  292.   #--------------------------------------------------------------------------
  293.   # ● アクターコマンドウィンドウのセットアップ
  294.   #--------------------------------------------------------------------------
  295.   alias scene_battle_icon_command_phase3_setup_command_window phase3_setup_command_window
  296.   def phase3_setup_command_window
  297.     scene_battle_icon_command_phase3_setup_command_window
  298.     # アクターコマンドウィンドウの位置を設定
  299.     @actor_command_window.x = command_window_actor_x(@actor_index)
  300.     @actor_command_window.y = command_window_actor_y(@actor_index)
  301.     @actor_command_window.need_reset
  302.   end
  303.   def command_window_actor_x(index)
  304.     $game_party.actors[index].screen_x + Momo_IconCommand::X_PLUS
  305.   end
  306.   def command_window_actor_y(index)
  307.     $game_party.actors[index].screen_y + Momo_IconCommand::Y_PLUS
  308.   end
  309. end

  310. #==============================================================================
  311. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  312. #==============================================================================
复制代码
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
29 小时
注册时间
2010-7-5
帖子
483
8
发表于 2010-8-11 09:26:13 | 只看该作者
还有RTAB也是去掉的
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2010-7-30
帖子
37
9
 楼主| 发表于 2010-8-11 09:44:01 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
29 小时
注册时间
2010-7-5
帖子
483
10
发表于 2010-8-11 09:46:27 | 只看该作者
那你就直接在Scene_Battle1里面看注释改咯
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-28 01:58

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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