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

Project1

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

[已经解决] 有点难度的-创新-战斗中替换候补队员!!先感谢!

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1035
在线时间
423 小时
注册时间
2010-12-26
帖子
337
跳转到指定楼层
1
发表于 2012-8-10 08:31:24 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 358429534 于 2012-8-11 07:05 编辑

回合制战斗中通过技能可无限次更改替补队员。全队员死亡不结束游戏,而是替补队员上场继续,全替补死亡才结束游戏。若死亡队员为第一位置,战斗开始,直接使用替补队员往上推战斗(若1死亡,2未死亡3为替补,战斗时1无视,2移到1,3移到2以此类推)!战斗结束队员位置保持未战斗前的位置。出场的且未死亡,都平分经验与金钱。


参考脚本
换人-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1

A1バトル共通スクリプト
  1. # ===========================================================================
  2. # ◆ A1 Scripts ◆
  3. # A1バトル共通スクリプト(RGSS3)
  4. #
  5. # バージョン : 1.23 (2012/01/27)
  6. # 作者 : A1
  7. # ---------------------------------------------------------------------------
  8. # 更新履歴   :2012/01/18 Ver1.00 リリース
  9. # 2012/01/21 Ver1.10 装備拡張対応
  10. # 2012/01/21 Ver1.10 メンバー加入時の不具合を修正
  11. # 2012/01/21 Ver1.10 メンバー加入時に既にパーティに居るさい何もしないように修正
  12. # 2012/01/24 Ver1.20 スキル拡張対応
  13. # 2012/01/24 Ver1.21 Window_BattleActorの不具合を修正
  14. # 2012/01/26 Ver1.22 Window_BattleSkillの不具合を修正
  15. # 2012/01/27 Ver1.23 戦闘行動がない際の不具合を修正
  16. # ---------------------------------------------------------------------------
  17. # 設置場所
  18. #  A1共通スクリプトより下
  19. # 一部再定義メソッドがあるため、なるべく上の方
  20. #
  21. # 必要スクリプト
  22. # A1共通スクリプトVer4.30以上
  23. #==============================================================================
  24. $imported = {} if $imported == nil
  25. if $imported["A1_Common_Script"]
  26. $imported["A1_BattleCommonScript"] = true
  27. old_common_script("A1バトル共通スクリプト", "4.30") if common_version < 4.30
  28. #==============================================================================
  29. # ■ Window_Base
  30. #------------------------------------------------------------------------------
  31. #  ゲーム中の全てのウィンドウのスーパークラスです。
  32. #==============================================================================

  33. class Window_Base < Window
  34. #--------------------------------------------------------------------------
  35. # ○ メソッドの定義
  36. #--------------------------------------------------------------------------
  37. def define_method(method, symbol)
  38. @method ||= {}
  39. @method[symbol] = method
  40. end
  41. #--------------------------------------------------------------------------
  42. # ○ メソッドのコール
  43. #--------------------------------------------------------------------------
  44. def call_method(symbol, *args)
  45. @method ||= {}
  46. @method[symbol].call(*args) if @method[symbol]
  47. end
  48. #--------------------------------------------------------------------------
  49. # ○ 顔グラフィックの描画(解放なし)
  50. #--------------------------------------------------------------------------
  51. def draw_face_no_dispose(face_name, face_index, x, y, enabled = true)
  52. bitmap = Cache.face(face_name)
  53. rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, 96, 96)
  54. contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  55. end
  56. #--------------------------------------------------------------------------
  57. # ○ 背景の描画
  58. #--------------------------------------------------------------------------
  59. def draw_background(rect)
  60. temp_rect = rect.clone
  61. temp_rect.width /= 2
  62. contents.gradient_fill_rect(temp_rect, back_color2, back_color1)
  63. temp_rect.x = temp_rect.width
  64. contents.gradient_fill_rect(temp_rect, back_color1, back_color2)
  65. end
  66. #--------------------------------------------------------------------------
  67. # ○ 背景色 1 の取得
  68. #--------------------------------------------------------------------------
  69. def back_color1
  70. Color.new(0, 0, 0, 192)
  71. end
  72. #--------------------------------------------------------------------------
  73. # ○ 背景色 2 の取得
  74. #--------------------------------------------------------------------------
  75. def back_color2
  76. Color.new(0, 0, 0, 0)
  77. end
  78. end
  79. #==============================================================================
  80. # ■ Window_Help
  81. #------------------------------------------------------------------------------
  82. #  スキルやアイテムの説明、アクターのステータスなどを表示するウィンドウです。
  83. #==============================================================================

  84. class Window_Help < Window_Base
  85. #--------------------------------------------------------------------------
  86. # ○ センターにテキストを描画
  87. #--------------------------------------------------------------------------
  88. def draw_center_text(text)
  89. contents.clear
  90. draw_text(0, 0, contents.width, line_height, text, 1)
  91. end
  92. end
  93. #==============================================================================
  94. # ■ Window_BattleActor
  95. #------------------------------------------------------------------------------
  96. #  バトル画面で、行動対象のアクターを選択するウィンドウです。
  97. #==============================================================================

  98. class Window_BattleActor < Window_BattleStatus
  99. #--------------------------------------------------------------------------
  100. # ★ ウィンドウの表示
  101. #--------------------------------------------------------------------------
  102. def show
  103. setup_remain if @info_viewport
  104. self.visible = true
  105. refresh
  106. open
  107. self
  108. end
  109. #--------------------------------------------------------------------------
  110. # ★ ウィンドウの非表示
  111. #--------------------------------------------------------------------------
  112. def hide
  113. close
  114. @info_viewport.rect.width = Graphics.width if @info_viewport
  115. call_method(:select_actor_end)
  116. end
  117. #--------------------------------------------------------------------------
  118. # ○ フレーム更新
  119. #--------------------------------------------------------------------------
  120. def update
  121. return update_basic unless self.visible
  122. super
  123. self.visible = false if self.openness == 0
  124. end
  125. #--------------------------------------------------------------------------
  126. # ○ フレーム更新(基本)
  127. #--------------------------------------------------------------------------
  128. def update_basic
  129. process_cursor_move
  130. process_handling
  131. end
  132. #--------------------------------------------------------------------------
  133. # ○ 項目の選択
  134. #--------------------------------------------------------------------------
  135. def select(index)
  136. super
  137. call_method(:select_actor, index)
  138. end
  139. #--------------------------------------------------------------------------
  140. # ○ ウィンドウの調整
  141. #--------------------------------------------------------------------------
  142. def setup_remain
  143. width_remain = Graphics.width - width
  144. self.x = width_remain
  145. @info_viewport.rect.width = width_remain
  146. select(0)
  147. end
  148. end
  149. #==============================================================================
  150. # ■ Window_BattleEnemy
  151. #------------------------------------------------------------------------------
  152. #  バトル画面で、行動対象の敵キャラを選択するウィンドウです。
  153. #==============================================================================

  154. class Window_BattleEnemy < Window_Selectable
  155. #--------------------------------------------------------------------------
  156. # ★ ウィンドウの表示
  157. #--------------------------------------------------------------------------
  158. def show
  159. setup_remain if @info_viewport
  160. self.visible = true
  161. open
  162. self
  163. end
  164. #--------------------------------------------------------------------------
  165. # ★ ウィンドウの非表示
  166. #--------------------------------------------------------------------------
  167. def hide
  168. close
  169. @info_viewport.rect.width = Graphics.width if @info_viewport
  170. call_method(:select_enemy_end)
  171. end
  172. #--------------------------------------------------------------------------
  173. # ○ フレーム更新
  174. #--------------------------------------------------------------------------
  175. def update
  176. return update_basic unless self.visible
  177. super
  178. self.visible = false if self.openness == 0
  179. end
  180. #--------------------------------------------------------------------------
  181. # ○ フレーム更新(基本)
  182. #--------------------------------------------------------------------------
  183. def update_basic
  184. process_cursor_move
  185. process_handling
  186. end
  187. #--------------------------------------------------------------------------
  188. # ○ 項目の選択
  189. #--------------------------------------------------------------------------
  190. def select(index)
  191. super
  192. call_method(:select_enemy, index)
  193. end
  194. #--------------------------------------------------------------------------
  195. # ○ ウィンドウの調整
  196. #--------------------------------------------------------------------------
  197. def setup_remain
  198. width_remain = Graphics.width - width
  199. self.x = width_remain
  200. @info_viewport.rect.width = width_remain
  201. select(0)
  202. end
  203. end
  204. #==============================================================================
  205. # ■ Window_BattleSkill
  206. #------------------------------------------------------------------------------
  207. #  バトル画面で、使用するスキルを選択するウィンドウです。
  208. #==============================================================================

  209. class Window_BattleSkill < Window_SkillList
  210. #--------------------------------------------------------------------------
  211. # ☆ オブジェクト初期化
  212. # info_viewport : 情報表示用ビューポート
  213. #--------------------------------------------------------------------------
  214. alias a1_psw_wbs_initialize initialize
  215. def initialize(help_window, info_viewport)
  216. a1_psw_wbs_initialize(help_window, info_viewport)
  217. self.openness = 0
  218. self.visible = true
  219. @help_window.openness = 0
  220. @help_window.visible = true
  221. end
  222. #--------------------------------------------------------------------------
  223. # ○ 高さを変える
  224. #--------------------------------------------------------------------------
  225. def resize_height(base_y)
  226. self.height = base_y - self.y
  227. create_contents
  228. end
  229. #--------------------------------------------------------------------------
  230. # ★ ウィンドウの表示
  231. #--------------------------------------------------------------------------
  232. def show
  233. self.visible = true
  234. @help_window.visible = true
  235. select_last
  236. open
  237. @help_window.open
  238. self
  239. end
  240. #--------------------------------------------------------------------------
  241. # ★ ウィンドウの非表示
  242. #--------------------------------------------------------------------------
  243. def hide
  244. close
  245. @help_window.close
  246. @info_viewport.rect.width = Graphics.width if @info_viewport
  247. call_method(:skill_item_window_hide)
  248. end
  249. #--------------------------------------------------------------------------
  250. # ○ オープン
  251. #--------------------------------------------------------------------------
  252. def open
  253. self.visible = true
  254. call_method(:skill_item_window_show)
  255. super
  256. end
  257. #--------------------------------------------------------------------------
  258. # ○ アクティブ化
  259. #--------------------------------------------------------------------------
  260. def activate
  261. open
  262. @help_window.open
  263. super
  264. end
  265. end
  266. #==============================================================================
  267. # ■ Window_BattleItem
  268. #------------------------------------------------------------------------------
  269. #  バトル画面で、使用するアイテムを選択するウィンドウです。
  270. #==============================================================================

  271. class Window_BattleItem < Window_ItemList
  272. #--------------------------------------------------------------------------
  273. # ☆ オブジェクト初期化
  274. # info_viewport : 情報表示用ビューポート
  275. #--------------------------------------------------------------------------
  276. alias a1_battle_common_wbi_initialize initialize
  277. def initialize(help_window, info_viewport)
  278. a1_battle_common_wbi_initialize(help_window, info_viewport)
  279. self.openness = 0
  280. self.visible = true
  281. @help_window.openness = 0
  282. @help_window.visible = true
  283. end
  284. #--------------------------------------------------------------------------
  285. # ○ 高さを変える
  286. #--------------------------------------------------------------------------
  287. def resize_height(base_y)
  288. self.height = base_y - self.y
  289. create_contents
  290. end
  291. #--------------------------------------------------------------------------
  292. # ★ ウィンドウの表示
  293. #--------------------------------------------------------------------------
  294. def show
  295. self.visible = true
  296. @help_window.visible = true
  297. select_last
  298. open
  299. @help_window.open
  300. self
  301. end
  302. #--------------------------------------------------------------------------
  303. # ★ ウィンドウの非表示
  304. #--------------------------------------------------------------------------
  305. def hide
  306. close
  307. @help_window.close
  308. call_method(:skill_item_window_hide)
  309. end
  310. #--------------------------------------------------------------------------
  311. # ○ オープン
  312. #--------------------------------------------------------------------------
  313. def open
  314. self.visible = true
  315. call_method(:skill_item_window_show)
  316. super
  317. end
  318. #--------------------------------------------------------------------------
  319. # ○ アクティブ化
  320. #--------------------------------------------------------------------------
  321. def activate
  322. open
  323. @help_window.open
  324. super
  325. end
  326. #--------------------------------------------------------------------------
  327. # ○ フレーム更新
  328. #--------------------------------------------------------------------------
  329. def update
  330. return unless self.visible
  331. super
  332. self.visible = false if self.openness == 0
  333. end
  334. end
  335. #==============================================================================
  336. # ■ Window_ActorCommand
  337. #------------------------------------------------------------------------------
  338. #  バトル画面で、アクターの行動を選択するウィンドウです。
  339. #==============================================================================

  340. class Window_ActorCommand < Window_Command
  341. #--------------------------------------------------------------------------
  342. # ☆ セットアップ
  343. #--------------------------------------------------------------------------
  344. alias a1_battle_common_wac_setup setup
  345. def setup(actor)
  346. call_method(:actor_command_setup, actor)
  347. a1_battle_common_wac_setup(actor)
  348. end
  349. #--------------------------------------------------------------------------
  350. # ○ ウィンドウのアクティブ化
  351. #--------------------------------------------------------------------------
  352. def activate
  353. open
  354. super
  355. end
  356. #--------------------------------------------------------------------------
  357. # ○ オープン
  358. #--------------------------------------------------------------------------
  359. def open
  360. call_method(:actor_command_open)
  361. super
  362. end
  363. #--------------------------------------------------------------------------
  364. # ○ クローズ
  365. #--------------------------------------------------------------------------
  366. def close
  367. call_method(:actor_command_close)
  368. super
  369. end
  370. end
  371. #==============================================================================
  372. # ■ Window_BattleStatus
  373. #------------------------------------------------------------------------------
  374. #  バトル画面で、パーティメンバーのステータスを表示するウィンドウです。
  375. #==============================================================================

  376. class Window_BattleStatus < Window_Selectable
  377. #--------------------------------------------------------------------------
  378. # ☆ リフレッシュ
  379. #--------------------------------------------------------------------------
  380. alias a1_battle_common_wbs_refresh refresh
  381. def refresh
  382. call_method(:refresh_statsu_window)
  383. return unless self.visible
  384. a1_battle_common_wbs_refresh
  385. end
  386. #--------------------------------------------------------------------------
  387. # ○ ウィンドウを開く
  388. #--------------------------------------------------------------------------
  389. def open
  390. super
  391. call_method(:open_status_window)
  392. end
  393. #--------------------------------------------------------------------------
  394. # ○ ウィンドウを閉じる
  395. #--------------------------------------------------------------------------
  396. def close
  397. super
  398. call_method(:close_status_window)
  399. end
  400. #--------------------------------------------------------------------------
  401. # ○ 項目の選択
  402. #--------------------------------------------------------------------------
  403. def select(index)
  404. super
  405. call_method(:select_status_window, index)
  406. end
  407. #--------------------------------------------------------------------------
  408. # ○ フレーム更新
  409. #--------------------------------------------------------------------------
  410. def update
  411. call_method(:update_status_window)
  412. return unless self.visible
  413. super
  414. end
  415. #--------------------------------------------------------------------------
  416. # ○ 解放
  417. #--------------------------------------------------------------------------
  418. def dispose
  419. super
  420. call_method(:dispose_status_window)
  421. end
  422. end
  423. #==============================================================================
  424. # ■ Window_PersonalStatus
  425. #==============================================================================

  426. class Window_PersonalStatus < Window_Base
  427. #--------------------------------------------------------------------------
  428. # ○ オブジェクト初期化
  429. #--------------------------------------------------------------------------
  430. def initialize(x, y, opacity = 0)
  431. super(x, y, Graphics.width / 2, 120)
  432. self.opacity = opacity
  433. self.openness = 0
  434. @actor = nil
  435. end
  436. #--------------------------------------------------------------------------
  437. # ○ アクターの設定
  438. #--------------------------------------------------------------------------
  439. def actor=(actor)
  440. @actor = actor
  441. refresh
  442. end
  443. #--------------------------------------------------------------------------
  444. # ○ リフレッシュ
  445. #--------------------------------------------------------------------------
  446. def refresh
  447. contents.clear
  448. draw_face(@actor.face_name, @actor.face_index, 0, 0)
  449. draw_text(116, line_height * 0, contents.width, line_height, @actor.name)
  450. draw_actor_level(@actor, 116, 0 + line_height * 1)
  451. draw_actor_icons(@actor, 180, 0 + line_height * 1)
  452. draw_actor_hp(@actor, 116, 0 + line_height * 2, 128)
  453. draw_actor_mp(@actor, 116, 0 + line_height * 3, 60)
  454. draw_actor_tp(@actor, 184, 0 + line_height * 3, 60) if $data_system.opt_display_tp
  455. end
  456. #--------------------------------------------------------------------------
  457. # ○ フレーム更新
  458. #--------------------------------------------------------------------------
  459. def update
  460. return unless self.visible
  461. super
  462. self.visible = false if self.openness == 0
  463. end
  464. #--------------------------------------------------------------------------
  465. # ○ オープン
  466. #--------------------------------------------------------------------------
  467. def open
  468. self.visible = true
  469. super
  470. end
  471. #--------------------------------------------------------------------------
  472. # ○ 顔グラフィックの描画
  473. #--------------------------------------------------------------------------
  474. def draw_face(face_name, face_index, x, y, enabled = true)
  475. draw_face_no_dispose(face_name, face_index, x, y, enabled)
  476. end
  477. end
  478. #==============================================================================
  479. # ■ RPG::Enemy
  480. #==============================================================================

  481. class RPG::Enemy < RPG::BaseItem
  482. #--------------------------------------------------------------------------
  483. # ○ 初期装備
  484. #--------------------------------------------------------------------------
  485. def equips
  486. @equips ||= [0,0,0,0,0]
  487. @equips[0] ||= $a1_common.note_data_one(self.note, "エネミー武器", 0)
  488. return @equips
  489. end
  490. end
  491. #==============================================================================
  492. # ■ Game_Enemy
  493. #------------------------------------------------------------------------------
  494. #  敵キャラを扱うクラスです。このクラスは Game_Troop クラス($game_troop)の
  495. # 内部で使用されます。
  496. #==============================================================================

  497. class Game_Enemy < Game_Battler
  498. #--------------------------------------------------------------------------
  499. # ☆ オブジェクト初期化
  500. #--------------------------------------------------------------------------
  501. alias a1_battle_common_ge_initialize initialize
  502. def initialize(index, enemy_id)
  503. @equips = []
  504. a1_battle_common_ge_initialize(index, enemy_id)
  505. init_equips(enemy.equips)
  506. end
  507. end
  508. #==============================================================================
  509. # ■ Game_Actor
  510. #------------------------------------------------------------------------------
  511. #  アクターを扱うクラスです。このクラスは Game_Actors クラス($game_actors)
  512. # の内部で使用され、Game_Party クラス($game_party)からも参照されます。
  513. #==============================================================================

  514. class Game_Actor < Game_Battler
  515. #--------------------------------------------------------------------------
  516. # ★ 装備品の初期化
  517. # equips : 初期装備の配列
  518. #--------------------------------------------------------------------------
  519. def init_equips(equips)
  520. super
  521. end
  522. #--------------------------------------------------------------------------
  523. # ★ 装備タイプからスロット ID に変換(空きを優先)
  524. #--------------------------------------------------------------------------
  525. def empty_slot(etype_id)
  526. super
  527. end
  528. #--------------------------------------------------------------------------
  529. # ★ 装備タイプからスロット ID のリストに変換
  530. #--------------------------------------------------------------------------
  531. def slot_list(etype_id)
  532. super
  533. end
  534. #--------------------------------------------------------------------------
  535. # ★ エディタで設定されたインデックスを装備タイプ ID に変換
  536. #--------------------------------------------------------------------------
  537. def index_to_etype_id(index)
  538. super
  539. end
  540. #--------------------------------------------------------------------------
  541. # ★ 装備スロットの配列を取得
  542. #--------------------------------------------------------------------------
  543. def equip_slots
  544. super
  545. end
  546. #--------------------------------------------------------------------------
  547. # ★ 装備品オブジェクトの配列取得
  548. #--------------------------------------------------------------------------
  549. def equips
  550. super
  551. end
  552. #--------------------------------------------------------------------------
  553. # ★ 武器オブジェクトの配列取得
  554. #--------------------------------------------------------------------------
  555. def weapons
  556. super
  557. end
  558. #--------------------------------------------------------------------------
  559. # ★ 通常能力値の加算値取得
  560. #--------------------------------------------------------------------------
  561. def param_plus(param_id)
  562. super
  563. end
  564. #--------------------------------------------------------------------------
  565. # ☆ 通常攻撃 アニメーション ID の取得
  566. #--------------------------------------------------------------------------
  567. alias a1_battle_common_ga_atk_animation_id1 atk_animation_id1
  568. def atk_animation_id1
  569. return a1_battle_common_ga_atk_animation_id1 if !@current_weapon || @current_weapon.is_a?(Array)
  570. @current_weapon.animation_id
  571. end
  572. #--------------------------------------------------------------------------
  573. # ☆ 通常攻撃 アニメーション ID の取得(二刀流:武器2)
  574. #--------------------------------------------------------------------------
  575. alias a1_battle_common_ga_atk_animation_id2 atk_animation_id2
  576. def atk_animation_id2
  577. return a1_battle_common_ga_atk_animation_id2 if !@current_weapon || @current_weapon.is_a?(Array)
  578. @current_weapon.animation_id
  579. end
  580. #--------------------------------------------------------------------------
  581. # ○ 装備タイプ名を取得
  582. #--------------------------------------------------------------------------
  583. def e_type_name(item)
  584. return $data_system.weapon_types[item.wtype_id] if item.is_a?(RPG::Weapon)
  585. return $data_system.armor_types[item.atype_id] if item.is_a?(RPG::Armor)
  586. end
  587. end
  588. #==============================================================================
  589. # ■ Game_BattlerBase
  590. #------------------------------------------------------------------------------
  591. #  バトラーを扱う基本のクラスです。主に能力値計算のメソッドを含んでいます。こ
  592. # のクラスは Game_Battler クラスのスーパークラスとして使用されます。
  593. #==============================================================================

  594. class Game_BattlerBase
  595. #--------------------------------------------------------------------------
  596. # ○ 二刀流?
  597. #--------------------------------------------------------------------------
  598. def two_sword_style?
  599. weapons[0] && weapons[1]
  600. end
  601. #--------------------------------------------------------------------------
  602. # ○ バトラーオブジェクト取得
  603. #--------------------------------------------------------------------------
  604. def battler
  605. return actor if self.actor?
  606. return enemy
  607. end
  608. end
  609. #==============================================================================
  610. # ■ Game_Battler
  611. #------------------------------------------------------------------------------
  612. #  スプライトや行動に関するメソッドを追加したバトラーのクラスです。このクラス
  613. # は Game_Actor クラスと Game_Enemy クラスのスーパークラスとして使用されます。
  614. #==============================================================================

  615. class Game_Battler < Game_BattlerBase
  616. #--------------------------------------------------------------------------
  617. # ○ 公開インスタンス変数
  618. #--------------------------------------------------------------------------
  619. attr_accessor :current_weapon
  620. attr_accessor :current_main
  621. #--------------------------------------------------------------------------
  622. # ○ 装備品の初期化
  623. # equips : 初期装備の配列
  624. #--------------------------------------------------------------------------
  625. def init_equips(equips)
  626. @equips = Array.new(equip_slots.size) { Game_BaseItem.new }
  627. equips.each_with_index do |item_id, i|
  628. etype_id = index_to_etype_id(i)
  629. slot_id = empty_slot(etype_id)
  630. @equips[slot_id].set_equip(etype_id == 0, item_id) if slot_id
  631. end
  632. refresh
  633. end
  634. #--------------------------------------------------------------------------
  635. # ○ 装備タイプからスロット ID に変換(空きを優先)
  636. #--------------------------------------------------------------------------
  637. def empty_slot(etype_id)
  638. list = slot_list(etype_id)
  639. list.find {|i| @equips[i].is_nil? } || list[0]
  640. end
  641. #--------------------------------------------------------------------------
  642. # ○ 装備タイプからスロット ID のリストに変換
  643. #--------------------------------------------------------------------------
  644. def slot_list(etype_id)
  645. result = []
  646. equip_slots.each_with_index {|e, i| result.push(i) if e == etype_id }
  647. result
  648. end
  649. #--------------------------------------------------------------------------
  650. # ○ エディタで設定されたインデックスを装備タイプ ID に変換
  651. #--------------------------------------------------------------------------
  652. def index_to_etype_id(index)
  653. index == 1 && dual_wield? ? 0 : index
  654. end
  655. #--------------------------------------------------------------------------
  656. # ○ 装備スロットの配列を取得
  657. #--------------------------------------------------------------------------
  658. def equip_slots
  659. return [0,0,2,3,4] if dual_wield? # 二刀流
  660. return [0,1,2,3,4] # 通常
  661. end
  662. #--------------------------------------------------------------------------
  663. # ○ 装備品オブジェクトの配列取得
  664. #--------------------------------------------------------------------------
  665. def equips
  666. @equips.collect {|item| item.object }
  667. end
  668. #--------------------------------------------------------------------------
  669. # ○ 武器オブジェクトの配列取得
  670. #--------------------------------------------------------------------------
  671. def weapons
  672. @equips.select {|item| item.is_weapon? }.collect {|item| item.object }
  673. end
  674. #--------------------------------------------------------------------------
  675. # ○ 通常能力値の加算値取得
  676. #--------------------------------------------------------------------------
  677. def param_plus(param_id)
  678. equips.compact.inject(super) {|r, item| r += item.params[param_id] + ex_item_params(item, param_id) }
  679. end
  680. #--------------------------------------------------------------------------
  681. # ○ アイテムにかける追加要素
  682. #--------------------------------------------------------------------------
  683. def ex_item_params(item, param_id)
  684. return 0
  685. end
  686. #--------------------------------------------------------------------------
  687. # ○ スキルを取得
  688. #--------------------------------------------------------------------------
  689. def skill(skill_id)
  690. $data_skills[skill_id]
  691. end
  692. end
  693. #==============================================================================
  694. # ■ Game_Party
  695. #------------------------------------------------------------------------------
  696. #  パーティを扱うクラスです。所持金やアイテムなどの情報が含まれます。このクラ
  697. # スのインスタンスは $game_party で参照されます。
  698. #==============================================================================

  699. class Game_Party < Game_Unit
  700. #--------------------------------------------------------------------------
  701. # ☆ アクターを加える
  702. #--------------------------------------------------------------------------
  703. alias a1_battle_common_gp_add_actor add_actor
  704. def add_actor(actor_id)
  705. return a1_battle_common_gp_add_actor(actor_id) unless in_battle
  706. return if @actors.include?(actor_id)
  707. prev_add_actor(battle_members)
  708. insert_actor(actor_id)
  709. post_add_actor($game_actors[actor_id])
  710. end
  711. #--------------------------------------------------------------------------
  712. # ○ アクターを加える
  713. #--------------------------------------------------------------------------
  714. def insert_actor(actor_id)
  715. @new_index = @remove_member_index ? @remove_member_index[0] : @actors.size
  716. @actors.insert(@new_index, actor_id) unless @actors.include?(actor_id)
  717. $game_player.refresh
  718. $game_map.need_refresh = true
  719. return unless @remove_member_index
  720. @remove_member_index.delete_at(0)
  721. @remove_member_index = nil if @remove_member_index.empty?
  722. end
  723. #--------------------------------------------------------------------------
  724. # ○ アクターを加えたIndexを取得
  725. #--------------------------------------------------------------------------
  726. def new_index
  727. @new_index
  728. end
  729. #--------------------------------------------------------------------------
  730. # ○ アクターを加える前処理
  731. #--------------------------------------------------------------------------
  732. def prev_add_actor(members)
  733. BattleManager.call_method(:prev_add_battler, members)
  734. end
  735. #--------------------------------------------------------------------------
  736. # ○ アクターを加えた後処理
  737. #--------------------------------------------------------------------------
  738. def post_add_actor(member)
  739. BattleManager.call_method(:post_add_battler, member)
  740. end
  741. #--------------------------------------------------------------------------
  742. # ☆ アクターを外す
  743. #--------------------------------------------------------------------------
  744. alias a1_battle_common_gp_remove_actor remove_actor
  745. def remove_actor(actor_id)
  746. prev_remove_actor($game_actors[actor_id]) if in_battle
  747. a1_battle_common_gp_remove_actor(actor_id)
  748. post_remove_actor if in_battle
  749. end
  750. #--------------------------------------------------------------------------
  751. # ○ アクターを外す前処理
  752. #--------------------------------------------------------------------------
  753. def prev_remove_actor(member)
  754. @remove_member_index ||= []
  755. @remove_member_index.push(member.index)
  756. BattleManager.call_method(:prev_remove_battler, member)
  757. end
  758. #--------------------------------------------------------------------------
  759. # ○ アクターを外した後処理
  760. #--------------------------------------------------------------------------
  761. def post_remove_actor
  762. BattleManager.call_method(:post_remove_battler)
  763. end
  764. end
  765. #==============================================================================
  766. # ■ BattleManager
  767. #------------------------------------------------------------------------------
  768. #  戦闘の進行を管理するモジュールです。
  769. #==============================================================================

  770. module BattleManager
  771. #--------------------------------------------------------------------------
  772. # ○ エイリアス用特異メソッド
  773. #--------------------------------------------------------------------------
  774. class << self
  775. alias :a1_battle_common_bm_turn_end :turn_end
  776. alias :a1_battle_common_bm_turn_start :turn_start
  777. alias :a1_battle_common_bm_battle_end :battle_end
  778. end
  779. #--------------------------------------------------------------------------
  780. # ☆ ターン開始
  781. #--------------------------------------------------------------------------
  782. def self.turn_start
  783. @turn_end_wait = 0
  784. a1_battle_common_bm_turn_start
  785. end
  786. #--------------------------------------------------------------------------
  787. # ☆ ターン終了
  788. #--------------------------------------------------------------------------
  789. def self.turn_end
  790. call_method(:wait, @turn_end_wait) if @turn_end_wait > 0
  791. @turn_end_wait = 0
  792. a1_battle_common_bm_turn_end
  793. end
  794. #--------------------------------------------------------------------------
  795. # ○ メソッドの設定
  796. #--------------------------------------------------------------------------
  797. def self.define_method(method, symbol)
  798. @method ||= {}
  799. @method[symbol] = method
  800. end
  801. #--------------------------------------------------------------------------
  802. # ○ メソッドのコール
  803. #--------------------------------------------------------------------------
  804. def self.call_method(symbol, *args)
  805. @method[symbol].call(*args) if @method[symbol]
  806. end
  807. #--------------------------------------------------------------------------
  808. # ○ ターン終了後ウェイト設定
  809. #--------------------------------------------------------------------------
  810. def self.turn_end_wait=(flame)
  811. @turn_end_wait = flame if @turn_end_wait < flame || flame == 0
  812. end
  813. #--------------------------------------------------------------------------
  814. # ☆ 戦闘終了
  815. # result : 結果(0:勝利 1:逃走 2:敗北)
  816. #--------------------------------------------------------------------------
  817. def self.battle_end(result)
  818. call_method(:battle_end, result)
  819. a1_battle_common_bm_battle_end(result)
  820. end
  821. end
  822. #==============================================================================
  823. # ■ Game_Action
  824. #------------------------------------------------------------------------------
  825. #  戦闘行動を扱うクラスです。このクラスは Game_Battler クラスの内部で使用され
  826. # ます。
  827. #==============================================================================

  828. class Game_Action
  829. #--------------------------------------------------------------------------
  830. # ☆ ターゲットの配列作成
  831. #--------------------------------------------------------------------------
  832. alias a1_battle_common_gac_make_targets make_targets
  833. def make_targets
  834. @targets ||= pre_make_targets
  835. return @targets
  836. end
  837. #--------------------------------------------------------------------------
  838. # ○ ターゲットの配列先行作成
  839. #--------------------------------------------------------------------------
  840. def pre_make_targets
  841. @targets = a1_battle_common_gac_make_targets
  842. end
  843. #--------------------------------------------------------------------------
  844. # ○ ターゲットの配列を取得
  845. #--------------------------------------------------------------------------
  846. def targets
  847. @targets.compact
  848. end
  849. #--------------------------------------------------------------------------
  850. # ○ ターゲットの配列をクリア
  851. #--------------------------------------------------------------------------
  852. def clear_targets
  853. @targets = nil
  854. end
  855. end
  856. #==============================================================================
  857. # ■ Scene_Battle
  858. #------------------------------------------------------------------------------
  859. #  バトル画面の処理を行うクラスです。
  860. #==============================================================================

  861. class Scene_Battle < Scene_Base
  862. #--------------------------------------------------------------------------
  863. # ☆ 開始処理
  864. #--------------------------------------------------------------------------
  865. alias a1_battle_common_sb_start start
  866. def start
  867. a1_battle_common_sb_start
  868. define_battle_manager_method
  869. end
  870. #--------------------------------------------------------------------------
  871. # ○ バトルマネージャメソッドの定義
  872. #--------------------------------------------------------------------------
  873. def define_battle_manager_method
  874. BattleManager.define_method(method(:wait), :wait)
  875. BattleManager.define_method(method(:post_add_battler), :post_add_battler)
  876. BattleManager.define_method(method(:post_remove_battler), :post_remove_battler)
  877. BattleManager.define_method(method(:prev_remove_battler), :prev_remove_battler)
  878. BattleManager.define_method(method(:prev_add_battler), :prev_add_battler)
  879. BattleManager.define_method(method(:process_victory), :process_victory)
  880. BattleManager.define_method(method(:battle_end), :battle_end)
  881. end
  882. #--------------------------------------------------------------------------
  883. # ☆ ステータスウィンドウの作成
  884. #--------------------------------------------------------------------------
  885. alias a1_battle_common_sb_create_status_window create_status_window
  886. def create_status_window
  887. a1_battle_common_sb_create_status_window
  888. post_create_status_window
  889. define_status_window_method
  890. end
  891. #--------------------------------------------------------------------------
  892. # ○ ステータスウィンドウ作成の後処理
  893. #--------------------------------------------------------------------------
  894. def post_create_status_window
  895. end
  896. #--------------------------------------------------------------------------
  897. # ○ ステータスウィンドウメソッドの定義
  898. #--------------------------------------------------------------------------
  899. def define_status_window_method
  900. @status_window.define_method(method(:refresh_statsu_window), :refresh_statsu_window)
  901. @status_window.define_method(method(:close_status_window), :close_status_window)
  902. @status_window.define_method(method(:open_status_window), :open_status_window)
  903. @status_window.define_method(method(:select_status_window), :select_status_window)
  904. @status_window.define_method(method(:update_status_window), :update_status_window)
  905. @status_window.define_method(method(:dispose_status_window), :dispose_status_window)
  906. end
  907. #--------------------------------------------------------------------------
  908. # ○ ステータスウィンドウがリフレッシュされた時の処理
  909. #--------------------------------------------------------------------------
  910. def refresh_statsu_window
  911. end
  912. #--------------------------------------------------------------------------
  913. # ○ ステータスウィンドウがクローズされた時の処理
  914. #--------------------------------------------------------------------------
  915. def close_status_window
  916. end
  917. #--------------------------------------------------------------------------
  918. # ○ ステータスウィンドウがオープンされた時の処理
  919. #--------------------------------------------------------------------------
  920. def open_status_window
  921. end
  922. #--------------------------------------------------------------------------
  923. # ○ ステータスウィンドウがセレクトされた時の処理
  924. #--------------------------------------------------------------------------
  925. def select_status_window(index)
  926. end
  927. #--------------------------------------------------------------------------
  928. # ○ ステータスウィンドウが更新された時の処理
  929. #--------------------------------------------------------------------------
  930. def update_status_window
  931. end
  932. #--------------------------------------------------------------------------
  933. # ○ ステータスウィンドウが解放された時の処理
  934. #--------------------------------------------------------------------------
  935. def dispose_status_window
  936. end
  937. #--------------------------------------------------------------------------
  938. # ☆ 情報表示ビューポートの作成
  939. #--------------------------------------------------------------------------
  940. alias a1_battle_common_sb_create_info_viewport create_info_viewport
  941. def create_info_viewport
  942. a1_battle_common_sb_create_info_viewport
  943. post_create_info_viewport
  944. end
  945. #--------------------------------------------------------------------------
  946. # ○ 情報表示ビューポート作成の後処理
  947. #--------------------------------------------------------------------------
  948. def post_create_info_viewport
  949. end
  950. #--------------------------------------------------------------------------
  951. # ☆ スキルウィンドウの作成
  952. #--------------------------------------------------------------------------
  953. alias a1_battle_common_sb_create_skill_window create_skill_window
  954. def create_skill_window
  955. a1_battle_common_sb_create_skill_window
  956. post_create_skill_window
  957. define_skill_window_method
  958. end
  959. #--------------------------------------------------------------------------
  960. # ○ スキルウィンドウ作成の後処理
  961. #--------------------------------------------------------------------------
  962. def post_create_skill_window
  963. end
  964. #--------------------------------------------------------------------------
  965. # ○ スキルウィンドウメソッドの定義
  966. #--------------------------------------------------------------------------
  967. def define_skill_window_method
  968. @skill_window.define_method(method(:skill_item_window_show), :skill_item_window_show)
  969. @skill_window.define_method(method(:skill_item_window_hide), :skill_item_window_hide)
  970. end
  971. #--------------------------------------------------------------------------
  972. # ☆ アイテムウィンドウの作成
  973. #--------------------------------------------------------------------------
  974. alias a1_battle_common_sb_create_item_window create_item_window
  975. def create_item_window
  976. a1_battle_common_sb_create_item_window
  977. post_create_item_window
  978. define_item_window_method
  979. end
  980. #--------------------------------------------------------------------------
  981. # ○ アイテムウィンドウ作成の後処理
  982. #--------------------------------------------------------------------------
  983. def post_create_item_window
  984. end
  985. #--------------------------------------------------------------------------
  986. # ○ アイテムウィンドウメソッドの定義
  987. #--------------------------------------------------------------------------
  988. def define_item_window_method
  989. @item_window.define_method(method(:skill_item_window_show), :skill_item_window_show)
  990. @item_window.define_method(method(:skill_item_window_hide), :skill_item_window_hide)
  991. end
  992. #--------------------------------------------------------------------------
  993. # ○ スキル/アイテムウィンドウが表示された時の処理
  994. #--------------------------------------------------------------------------
  995. def skill_item_window_show
  996. end
  997. #--------------------------------------------------------------------------
  998. # ○ スキル/アイテムウィンドウが非表示になった時の処理
  999. #--------------------------------------------------------------------------
  1000. def skill_item_window_hide
  1001. end
  1002. #--------------------------------------------------------------------------
  1003. # ☆ パーティコマンドウィンドウの作成
  1004. #--------------------------------------------------------------------------
  1005. alias a1_battle_common_sb_create_party_command_window create_party_command_window
  1006. def create_party_command_window
  1007. a1_battle_common_sb_create_party_command_window
  1008. post_create_party_command_window
  1009. define_party_command_window_method
  1010. define_party_command_window_handle
  1011. end
  1012. #--------------------------------------------------------------------------
  1013. # ○ パーティコマンドウィンドウ作成の後処理
  1014. #--------------------------------------------------------------------------
  1015. def post_create_party_command_window
  1016. end
  1017. #--------------------------------------------------------------------------
  1018. # ○ パーティコマンドウィンドウメソッドの定義
  1019. #--------------------------------------------------------------------------
  1020. def define_party_command_window_method
  1021. end
  1022. #--------------------------------------------------------------------------
  1023. # ○ パーティコマンドウィンドウハンドルの定義
  1024. #--------------------------------------------------------------------------
  1025. def define_party_command_window_handle
  1026. end
  1027. #--------------------------------------------------------------------------
  1028. # ☆ アクターウィンドウの作成
  1029. #--------------------------------------------------------------------------
  1030. alias a1_battle_common_sb_create_actor_window create_actor_window
  1031. def create_actor_window
  1032. a1_battle_common_sb_create_actor_window
  1033. post_create_actor_window
  1034. define_actor_window_method
  1035. end
  1036. #--------------------------------------------------------------------------
  1037. # ○ アクターウィンドウ作成の後処理
  1038. #--------------------------------------------------------------------------
  1039. def post_create_actor_window
  1040. end
  1041. #--------------------------------------------------------------------------
  1042. # ○ アクターウィンドウメソッドの定義
  1043. #--------------------------------------------------------------------------
  1044. def define_actor_window_method
  1045. @actor_window.define_method(method(:select_actor), :select_actor)
  1046. @actor_window.define_method(method(:select_actor_end), :select_actor_end)
  1047. end
  1048. #--------------------------------------------------------------------------
  1049. # ○ アクターウィンドウをセレクトした時の処理
  1050. #--------------------------------------------------------------------------
  1051. def select_actor(index)
  1052. end
  1053. #--------------------------------------------------------------------------
  1054. # ○ アクターウィンドウをセレクト終了した時の処理
  1055. #--------------------------------------------------------------------------
  1056. def select_actor_end
  1057. end
  1058. #--------------------------------------------------------------------------
  1059. # ☆ 敵キャラウィンドウの作成
  1060. #--------------------------------------------------------------------------
  1061. alias a1_battle_common_sb_create_enemy_window create_enemy_window
  1062. def create_enemy_window
  1063. a1_battle_common_sb_create_enemy_window
  1064. post_create_enemy_window
  1065. define_enemy_window_method
  1066. end
  1067. #--------------------------------------------------------------------------
  1068. # ○ 敵キャラウィンドウ作成の後処理
  1069. #--------------------------------------------------------------------------
  1070. def post_create_enemy_window
  1071. end
  1072. #--------------------------------------------------------------------------
  1073. # ○ 敵キャラウィンドウメソッドの定義
  1074. #--------------------------------------------------------------------------
  1075. def define_enemy_window_method
  1076. @enemy_window.define_method(method(:select_enemy), :select_enemy)
  1077. @enemy_window.define_method(method(:select_enemy_end) ,:select_enemy_end)
  1078. end
  1079. #--------------------------------------------------------------------------
  1080. # ○ 敵キャラウィンドウをセレクトした時の処理
  1081. #--------------------------------------------------------------------------
  1082. def select_enemy(index)
  1083. end
  1084. #--------------------------------------------------------------------------
  1085. # ○ 敵キャラウィンドウをセレクト終了した時の処理
  1086. #--------------------------------------------------------------------------
  1087. def select_enemy_end
  1088. end
  1089. #--------------------------------------------------------------------------
  1090. # ☆ アクターコマンドウィンドウの作成
  1091. #--------------------------------------------------------------------------
  1092. alias a1_battle_common_sb_start_create_actor_command_window create_actor_command_window
  1093. def create_actor_command_window
  1094. a1_battle_common_sb_start_create_actor_command_window
  1095. post_create_actor_command_window
  1096. define_actor_command_handle
  1097. define_actor_command_window
  1098. end
  1099. #--------------------------------------------------------------------------
  1100. # ○ アクターコマンドウィンドウ作成の後処理
  1101. #--------------------------------------------------------------------------
  1102. def post_create_actor_command_window
  1103. end
  1104. #--------------------------------------------------------------------------
  1105. # ○ アクターコマンドウィンドウメソッドの定義
  1106. #--------------------------------------------------------------------------
  1107. def define_actor_command_window
  1108. @actor_command_window.define_method(method(:actor_command_open), :actor_command_open)
  1109. @actor_command_window.define_method(method(:actor_command_close), :actor_command_close)
  1110. @actor_command_window.define_method(method(:actor_command_setup), :actor_command_setup)
  1111. end
  1112. #--------------------------------------------------------------------------
  1113. # ○ アクターコマンドウィンドウハンドルの定義
  1114. #--------------------------------------------------------------------------
  1115. def define_actor_command_handle
  1116. end
  1117. #--------------------------------------------------------------------------
  1118. # ○ アクターコマンドウィンドウがオープンした時の処理
  1119. #--------------------------------------------------------------------------
  1120. def actor_command_open
  1121. end
  1122. #--------------------------------------------------------------------------
  1123. # ○ アクターコマンドウィンドウがクローズした時の処理
  1124. #--------------------------------------------------------------------------
  1125. def actor_command_close
  1126. end
  1127. #--------------------------------------------------------------------------
  1128. # ○ アクターコマンドウィンドウのセットアップ時の処理
  1129. #--------------------------------------------------------------------------
  1130. def actor_command_setup(actor)
  1131. end
  1132. #--------------------------------------------------------------------------
  1133. # ☆ パーティコマンド選択の開始
  1134. #--------------------------------------------------------------------------
  1135. alias a1_battle_common_sb_start_party_command_selection start_party_command_selection
  1136. def start_party_command_selection
  1137. prev_start_party_command_selection
  1138. a1_battle_common_sb_start_party_command_selection
  1139. post_start_party_command_selection
  1140. end
  1141. #--------------------------------------------------------------------------
  1142. # ○ パーティコマンド選択の開始の前処理
  1143. #--------------------------------------------------------------------------
  1144. def prev_start_party_command_selection
  1145. end
  1146. #--------------------------------------------------------------------------
  1147. # ○ パーティコマンド選択の開始の後処理
  1148. #--------------------------------------------------------------------------
  1149. def post_start_party_command_selection
  1150. end
  1151. #--------------------------------------------------------------------------
  1152. # ☆ 次のコマンド入力へ
  1153. #--------------------------------------------------------------------------
  1154. alias a1_battle_common_sb_next_command next_command
  1155. def next_command
  1156. prev_next_command
  1157. a1_battle_common_sb_next_command
  1158. post_next_command
  1159. end
  1160. #--------------------------------------------------------------------------
  1161. # ○ 次のコマンド入力への前処理
  1162. #--------------------------------------------------------------------------
  1163. def prev_next_command
  1164. end
  1165. #--------------------------------------------------------------------------
  1166. # ○ 次のコマンド入力への後処理
  1167. #--------------------------------------------------------------------------
  1168. def post_next_command
  1169. end
  1170. #--------------------------------------------------------------------------
  1171. # ☆ 前のコマンド入力へ
  1172. #--------------------------------------------------------------------------
  1173. alias a1_battle_common_sb_prior_command prior_command
  1174. def prior_command
  1175. prev_prior_command
  1176. a1_battle_common_sb_prior_command
  1177. post_prior_command
  1178. end
  1179. #--------------------------------------------------------------------------
  1180. # ○ 前のコマンド入力への前処理
  1181. #--------------------------------------------------------------------------
  1182. def prev_prior_command
  1183. end
  1184. #--------------------------------------------------------------------------
  1185. # ○ 前のコマンド入力への後処理
  1186. #--------------------------------------------------------------------------
  1187. def post_prior_command
  1188. end
  1189. #--------------------------------------------------------------------------
  1190. # ☆ ターン開始
  1191. #--------------------------------------------------------------------------
  1192. alias a1_battle_common_sb_turn_start turn_start
  1193. def turn_start
  1194. prev_turn_start
  1195. a1_battle_common_sb_turn_start
  1196. post_turn_start
  1197. end
  1198. #--------------------------------------------------------------------------
  1199. # ○ ターン開始の前処理
  1200. #--------------------------------------------------------------------------
  1201. def prev_turn_start
  1202. end
  1203. #--------------------------------------------------------------------------
  1204. # ○ ターン開始の後処理
  1205. #--------------------------------------------------------------------------
  1206. def post_turn_start
  1207. end
  1208. #--------------------------------------------------------------------------
  1209. # ☆ ターン終了
  1210. #--------------------------------------------------------------------------
  1211. alias a1_battle_common_sb_turn_end turn_end
  1212. def turn_end
  1213. prev_turn_end
  1214. a1_battle_common_sb_turn_end
  1215. post_turn_end
  1216. end
  1217. #--------------------------------------------------------------------------
  1218. # ○ ターン終了の前処理
  1219. #--------------------------------------------------------------------------
  1220. def prev_turn_end
  1221. end
  1222. #--------------------------------------------------------------------------
  1223. # ○ ターン終了の後処理
  1224. #--------------------------------------------------------------------------
  1225. def post_turn_end
  1226. end
  1227. #--------------------------------------------------------------------------
  1228. # ○ ウィンドウが閉じるまでウェイト
  1229. #--------------------------------------------------------------------------
  1230. def wait_fot_window_close(window)
  1231. update_basic while window.close?
  1232. end
  1233. #--------------------------------------------------------------------------
  1234. # ○ アクターのバトルメンバー取得
  1235. #--------------------------------------------------------------------------
  1236. def battle_members
  1237. @party_battle_members ||= $game_party.battle_members
  1238. return @party_battle_members
  1239. end
  1240. #--------------------------------------------------------------------------
  1241. # ○ バトルメンバーの追加の前処理
  1242. #--------------------------------------------------------------------------
  1243. def prev_add_battler(members)
  1244. end
  1245. #--------------------------------------------------------------------------
  1246. # ○ バトルメンバーの追加後の処理
  1247. #--------------------------------------------------------------------------
  1248. def post_add_battler(member)
  1249. @party_battle_members = $game_party.battle_members
  1250. end
  1251. #--------------------------------------------------------------------------
  1252. # ○ バトルメンバー削除の前処理
  1253. #--------------------------------------------------------------------------
  1254. def prev_remove_battler(member)
  1255. end
  1256. #--------------------------------------------------------------------------
  1257. # ○ バトルメンバーの削除後の処理
  1258. #--------------------------------------------------------------------------
  1259. def post_remove_battler
  1260. @party_battle_members = $game_party.battle_members
  1261. end
  1262. #--------------------------------------------------------------------------
  1263. # ☆ 戦闘行動の実行
  1264. #--------------------------------------------------------------------------
  1265. alias a1_battle_common_sb_execute_action execute_action
  1266. def execute_action
  1267. prev_execute_action
  1268. a1_battle_common_sb_execute_action
  1269. post_execute_action
  1270. end
  1271. #--------------------------------------------------------------------------
  1272. # ○ 戦闘行動の実行の前処理
  1273. #--------------------------------------------------------------------------
  1274. def prev_execute_action
  1275. @subject.current_action.pre_make_targets
  1276. end
  1277. #--------------------------------------------------------------------------
  1278. # ○ 戦闘行動の実行の後処理
  1279. #--------------------------------------------------------------------------
  1280. def post_execute_action
  1281. @subject.current_action.clear_targets if @subject.current_action
  1282. end
  1283. #--------------------------------------------------------------------------
  1284. # ☆ スキル/アイテムの使用
  1285. #--------------------------------------------------------------------------
  1286. alias a1_battle_common_sb_use_item use_item
  1287. def use_item
  1288. prev_use_item
  1289. a1_battle_common_sb_use_item
  1290. post_use_item
  1291. end
  1292. #--------------------------------------------------------------------------
  1293. # ○ スキル/アイテムの使用の前処理
  1294. #--------------------------------------------------------------------------
  1295. def prev_use_item
  1296. end
  1297. #--------------------------------------------------------------------------
  1298. # ○ スキル/アイテムの使用の後処理
  1299. #--------------------------------------------------------------------------
  1300. def post_use_item
  1301. end
  1302. #--------------------------------------------------------------------------
  1303. # ○ 勝利の処理
  1304. #--------------------------------------------------------------------------
  1305. def process_victory
  1306. end
  1307. #--------------------------------------------------------------------------
  1308. # ○ 戦闘終了
  1309. #--------------------------------------------------------------------------
  1310. def battle_end(result)
  1311. $game_party.all_members.each {|member| init_member_battle_end(member) }
  1312. end
  1313. #--------------------------------------------------------------------------
  1314. # ○ 戦闘終了時のメンバー初期化
  1315. #--------------------------------------------------------------------------
  1316. def init_member_battle_end(member)
  1317. member.current_weapon = nil
  1318. member.current_main = nil
  1319. end
  1320. end
  1321. end

复制代码
スクリプト本体
  1. #===========================================================================
  2. # ◆ A1 Scripts ◆
  3. # 戦闘中入れ替え(RGSS3)
  4. #
  5. # バージョン : 1.00 (2012/01/18)
  6. # 作者 : A1
  7. # URL     : http://a1tktk.web.fc2.com/
  8. #---------------------------------------------------------------------------
  9. # 機能:
  10. # ・戦闘中にメンバーを入れ替えます
  11. #---------------------------------------------------------------------------
  12. # 更新履歴   :2012/01/18 Ver1.00 リリース
  13. #---------------------------------------------------------------------------
  14. # 設置場所
  15. # A1バトル共通スクリプト以下
  16. #
  17. # 必要スクリプト
  18. # A1バトル共通スクリプト
  19. #---------------------------------------------------------------------------
  20. # 使い方
  21. # 導入することで適用されます
  22. #==============================================================================
  23. $imported ||= {}
  24. if $imported["A1_BattleCommonScript"]
  25. $imported["A1_ChangeMember"] = true
  26. old_common_script("戦闘中入れ替え", "3.90") if common_version < 3.90
  27. #==============================================================================
  28. # ■ Window_PartyCommand
  29. #==============================================================================

  30. class Window_MemberChange < Window_Selectable
  31. #--------------------------------------------------------------------------
  32. # ○ オブジェクト初期化
  33. #--------------------------------------------------------------------------
  34. def initialize
  35. @form_actor_window = Window_PersonalStatus.new(0, Graphics.height - 120, 255)
  36. @to_actor_window = Window_PersonalStatus.new(Graphics.width / 2, Graphics.height - 120, 255)
  37. setup_members
  38. width = @battle_members.size * 48 + standard_padding * 2
  39. height = (@all_members.size / @battle_members.size.to_f).ceil * 48 + standard_padding * 2 + 36
  40. super((Graphics.width - width) / 2, (Graphics.height - height) / 2, width, height)
  41. self.y = Graphics.height - @form_actor_window.height - height if self.y + height > Graphics.height - @form_actor_window.height
  42. self.index = 0
  43. @from_actor = -1
  44. self.openness = 0
  45. end
  46. #--------------------------------------------------------------------------
  47. # ○ アクティブ化
  48. #--------------------------------------------------------------------------
  49. def activate
  50. super
  51. refresh
  52. @form_actor_window.actor = @all_members[self.index]
  53. end
  54. #--------------------------------------------------------------------------
  55. # ○ メンバーのセットアップ
  56. #--------------------------------------------------------------------------
  57. def setup_members
  58. @all_members = $game_party.all_members
  59. @battle_members = $game_party.battle_members
  60. end
  61. #--------------------------------------------------------------------------
  62. # ○ 項目の選択
  63. #--------------------------------------------------------------------------
  64. def select(index)
  65. super
  66. @form_actor_window.actor = @all_members[self.index] if @from_actor == -1
  67. @to_actor_window.actor = @all_members[self.index] if @from_actor >= 0
  68. end
  69. #--------------------------------------------------------------------------
  70. # ○ 項目数の取得
  71. #--------------------------------------------------------------------------
  72. def item_max
  73. @all_members.size
  74. end
  75. #--------------------------------------------------------------------------
  76. # ○ 桁数の取得
  77. #--------------------------------------------------------------------------
  78. def col_max
  79. @battle_members.size
  80. end
  81. #--------------------------------------------------------------------------
  82. # ○ リフレッシュ
  83. #--------------------------------------------------------------------------
  84. def refresh
  85. super
  86. draw_horz_line(52)
  87. end
  88. #--------------------------------------------------------------------------
  89. # ○ 水平線の描画
  90. #--------------------------------------------------------------------------
  91. def draw_horz_line(y)
  92. line_y = y + line_height / 2 - 1
  93. contents.fill_rect(0, line_y, contents_width, 2, line_color)
  94. end
  95. #--------------------------------------------------------------------------
  96. # ○ 水平線の色を取得
  97. #--------------------------------------------------------------------------
  98. def line_color
  99. color = normal_color
  100. color.alpha = 128
  101. color
  102. end
  103. #--------------------------------------------------------------------------
  104. # ○ 項目の描画
  105. #--------------------------------------------------------------------------
  106. def draw_item(index)
  107. c_name = member(index).character_name
  108. c_index = member(index).character_index
  109. rect = item_rect(index)
  110. draw_character(c_name, c_index, rect.x + 24, rect.y + 40)
  111. end
  112. #--------------------------------------------------------------------------
  113. # ○ 項目を描画する矩形の取得
  114. #--------------------------------------------------------------------------
  115. def item_rect(index)
  116. rect = Rect.new
  117. rect.width = item_width
  118. rect.height = item_height
  119. rect.x = index % col_max * item_width
  120. rect.y = index / col_max * item_height
  121. rect.y += 24 if index > @battle_members.size - 1
  122. rect
  123. end
  124. #--------------------------------------------------------------------------
  125. # ○ 項目の幅を取得
  126. #--------------------------------------------------------------------------
  127. def item_width
  128. return 48
  129. end
  130. #--------------------------------------------------------------------------
  131. # ○ 項目の高さを取得
  132. #--------------------------------------------------------------------------
  133. def item_height
  134. return 48
  135. end
  136. #--------------------------------------------------------------------------
  137. # ○ ウィンドウ内容の高さを計算
  138. #--------------------------------------------------------------------------
  139. def contents_height
  140. row_max * item_height + 24
  141. end
  142. #--------------------------------------------------------------------------
  143. # ○ 下端パディングの更新
  144. #--------------------------------------------------------------------------
  145. def update_padding_bottom
  146. surplus = (height - standard_padding * 2) % item_height - 24
  147. self.padding_bottom = padding + surplus
  148. end
  149. #--------------------------------------------------------------------------
  150. # ○ メンバーの取得
  151. #--------------------------------------------------------------------------
  152. def member(index)
  153. @all_members[index]
  154. end
  155. #--------------------------------------------------------------------------
  156. # ○ 決定処理の有効状態を取得
  157. #--------------------------------------------------------------------------
  158. def ok_enabled?
  159. return true
  160. end
  161. #--------------------------------------------------------------------------
  162. # ○ 決定ボタンが押されたときの処理
  163. #--------------------------------------------------------------------------
  164. def process_ok
  165. Sound.play_ok
  166. Input.update
  167. return select_start_to_actor if @from_actor == -1
  168. return call_cancel_handler if @from_actor == self.index
  169. change_member if @from_actor >= 0
  170. post_change_member
  171. end
  172. #--------------------------------------------------------------------------
  173. # ○ メンバー入れ替え
  174. #--------------------------------------------------------------------------
  175. def change_member
  176. $game_party.swap_order(@from_actor, self.index)
  177. end
  178. #--------------------------------------------------------------------------
  179. # ○ メンバー入れ替え後の処理
  180. #--------------------------------------------------------------------------
  181. def post_change_member
  182. setup_members
  183. self.index = @from_actor
  184. @form_actor_window.actor = @all_members[self.index]
  185. @from_actor = -1
  186. @to_actor_window.close
  187. refresh
  188. end
  189. #--------------------------------------------------------------------------
  190. # ○ 入れ替え先のアクター選択開始
  191. #--------------------------------------------------------------------------
  192. def select_start_to_actor
  193. @from_actor = self.index
  194. @to_actor_window.open
  195. self.index = self.index < @battle_members.size ? @battle_members.size : 0
  196. @to_actor_window.actor = @all_members[self.index]
  197. end
  198. #--------------------------------------------------------------------------
  199. # ○ 入れ替え元のアクター
  200. #--------------------------------------------------------------------------
  201. def from_actor
  202. @from_actor
  203. end
  204. #--------------------------------------------------------------------------
  205. # ○ オープン
  206. #--------------------------------------------------------------------------
  207. def open
  208. super
  209. @form_actor_window.open
  210. end
  211. #--------------------------------------------------------------------------
  212. # ○ キャンセルハンドラの呼び出し
  213. #--------------------------------------------------------------------------
  214. def call_cancel_handler
  215. super if @from_actor == -1
  216. @from_actor = -1
  217. @to_actor_window.close
  218. @form_actor_window.actor = @all_members[self.index]
  219. activate
  220. end
  221. #--------------------------------------------------------------------------
  222. # ○ クローズ
  223. #--------------------------------------------------------------------------
  224. def close
  225. super
  226. @form_actor_window.close
  227. @to_actor_window.close
  228. end
  229. #--------------------------------------------------------------------------
  230. # ○ フレーム更新
  231. #--------------------------------------------------------------------------
  232. def update
  233. super
  234. @form_actor_window.update
  235. @to_actor_window.update
  236. end
  237. #--------------------------------------------------------------------------
  238. # ○ 解放
  239. #--------------------------------------------------------------------------
  240. def dispose
  241. super
  242. @form_actor_window.dispose
  243. @to_actor_window.dispose
  244. end
  245. end
  246. #==============================================================================
  247. # ■ Window_PartyCommand
  248. #------------------------------------------------------------------------------
  249. #  バトル画面で、戦うか逃げるかを選択するウィンドウです。
  250. #==============================================================================

  251. class Window_PartyCommand < Window_Command
  252. #--------------------------------------------------------------------------
  253. # ☆ コマンドリストの作成
  254. #--------------------------------------------------------------------------
  255. alias a1_cbm_wpc_make_command_list make_command_list
  256. def make_command_list
  257. a1_cbm_wpc_make_command_list
  258. add_command("入れ替え", :member_change, $game_party.all_members.size > $game_party.max_battle_members)
  259. end
  260. end
  261. #==============================================================================
  262. # ■ Scene_Battle
  263. #------------------------------------------------------------------------------
  264. #  バトル画面の処理を行うクラスです。
  265. #==============================================================================

  266. class Scene_Battle < Scene_Base
  267. #--------------------------------------------------------------------------
  268. # ☆ 全ウィンドウの作成
  269. #--------------------------------------------------------------------------
  270. alias a1_cbm_wpc_create_all_windows create_all_windows
  271. def create_all_windows
  272. a1_cbm_wpc_create_all_windows
  273. create_member_change_window
  274. end
  275. #--------------------------------------------------------------------------
  276. # ○ 入れ替えウィンドウの作成
  277. #--------------------------------------------------------------------------
  278. def create_member_change_window
  279. @window_member_change = Window_MemberChange.new
  280. @window_member_change.set_handler(:cancel, method(:on_member_change_cancel))
  281. end
  282. #--------------------------------------------------------------------------
  283. # ☆ パーティコマンドウィンドウハンドルの定義
  284. #--------------------------------------------------------------------------
  285. alias a1_cbm_sb_define_party_command_window_handle define_party_command_window_handle
  286. def define_party_command_window_handle
  287. a1_cbm_sb_define_party_command_window_handle
  288. @party_command_window.set_handler(:member_change, method(:command_member_change))
  289. end
  290. #--------------------------------------------------------------------------
  291. # ○ 入れ替え
  292. #--------------------------------------------------------------------------
  293. def command_member_change
  294. @prev_battle_members = $game_party.battle_members
  295. @status_window.close
  296. @party_command_window.close
  297. @window_member_change.open
  298. @window_member_change.activate
  299. end
  300. #--------------------------------------------------------------------------
  301. # ○ 変更したメンバーを取得
  302. #--------------------------------------------------------------------------
  303. def change_diss_members(ret = [])
  304. $game_party.battle_members.each_with_index {|member, i| ret.push(member) if member != @prev_battle_members[i] }
  305. return ret
  306. end
  307. #--------------------------------------------------------------------------
  308. # ○ メンバーチェンジ[キャンセル]
  309. #--------------------------------------------------------------------------
  310. def on_member_change_cancel
  311. @party_command_window.activate
  312. @status_window.refresh
  313. @status_window.open
  314. @party_command_window.open
  315. @window_member_change.close
  316. change_diss_members.each {|member| member.make_actions }
  317. @party_battle_members = $game_party.battle_members
  318. end
  319. end
  320. end

复制代码
摘自《暗悲传》
某人
天啊!我无骂无打怎么这么多的狗,每天都要来咬我呢?......天理何在
某人
在路上看到了许多行人说道我眼前怎么全是无肺黑心肝在行走呢?
某人
有时被整的实在是受不了,很想杀狗,看看他们的心脏是黑的吗?
某人
我很喜欢黑夜与下雨,或许我只能在虚拟世界能过上一般人的生活......
某人
无论别人无良心骂我,诅咒死,刻意整蛊......希望能坚持活着!要永远记住那些人的奸诈嘴脸!
某人
又有谁能出来主持公道呢?谁能理解你,谁能站出来说句话.....他是无辜又悲苦......这真是无聊的故事吗?

Lv3.寻梦者

梦石
0
星屑
1035
在线时间
423 小时
注册时间
2010-12-26
帖子
337
2
 楼主| 发表于 2012-8-10 08:34:42 | 只看该作者
换人脚本2


  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Party System Add-On: Command Party v1.01
  4. # -- Last Updated: 2012.01.10
  5. # -- Level: Easy, Normal
  6. # -- Requires: YEA - Party System v1.00+
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-CommandParty"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.01.10 - Compatibility Update: Ace Battle Engine v1.15+
  15. # 2011.12.13 - Started Script and Finished.
  16. #
  17. #==============================================================================
  18. # ▼ Introduction
  19. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  20. # An add-on to the Yanfly Engine Ace - Party System script. This script allows
  21. # the player to change party members during the middle of battle from the
  22. # Party Command Window (the Fight/Escape window).
  23. # 允许战斗中更换队员
  24. #==============================================================================
  25. # ▼ Instructions
  26. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  27. # To install this script, open up your script editor and copy/paste this script
  28. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  29. #
  30. # Note, if you do not give your player access to the party formation menu
  31. # available in the Party System script, this script will disable itself.
  32. #
  33. #==============================================================================
  34. # ▼ Compatibility
  35. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  36. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  37. # it will run with RPG Maker VX without adjusting.
  38. #
  39. # This script requires Yanfly Engine Ace - Party System v1.00+.
  40. #
  41. #==============================================================================

  42. module YEA
  43.   module COMMAND_PARTY
  44.    
  45.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  46.     # - Command Party Settings -
  47.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  48.     # This is just how the text appears visually in battle for your party and
  49.     # how often the can change party in battle. Furthermore, there's two
  50.     # switches that may be enabled or disabled to add the command to the
  51.     # game. Adjust it as you see fit. Set the switches to 0 to not use them.
  52.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  53.     COMMAND_TEXT   = "队列"    # Text used for the command.
  54.     PARTY_COOLDOWN = 2          # Turns that must pass between each change.
  55.     SHOW_SWITCH    = 0          # If switch is on, show command. 0 to disable.
  56.     ENABLE_SWITCH  = 0          # If switch is on, enable command. 0 to disable.
  57.    
  58.   end # COMMAND_PARTY
  59. end # YEA

  60. #==============================================================================
  61. # ▼ Editting anything past this point may potentially result in causing
  62. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  63. # halitosis so edit at your own risk.
  64. #==============================================================================

  65. if $imported["YEA-PartySystem"]

  66. #==============================================================================
  67. # ■ SceneManager
  68. #==============================================================================

  69. module SceneManager
  70.   
  71.   #--------------------------------------------------------------------------
  72.   # new method: self.force_recall
  73.   #--------------------------------------------------------------------------
  74.   def self.force_recall(scene_class)
  75.     @scene = scene_class
  76.   end
  77.   
  78. end # SceneManager

  79. #==============================================================================
  80. # ■ Game_Unit
  81. #==============================================================================

  82. class Game_Unit
  83.   
  84.   #--------------------------------------------------------------------------
  85.   # alias method: on_battle_start
  86.   #--------------------------------------------------------------------------
  87.   alias game_unit_on_battle_start_cpt on_battle_start
  88.   def on_battle_start
  89.     game_unit_on_battle_start_cpt
  90.     reset_party_cooldown
  91.   end
  92.   
  93.   #--------------------------------------------------------------------------
  94.   # new method: reset_party_cooldown
  95.   #--------------------------------------------------------------------------
  96.   def reset_party_cooldown
  97.     @party_cooldown = 0
  98.   end
  99.   
  100.   #--------------------------------------------------------------------------
  101.   # new method: update_party_cooldown
  102.   #--------------------------------------------------------------------------
  103.   def update_party_cooldown
  104.     reset_party_cooldown if @party_cooldown.nil?
  105.     @party_cooldown = [@party_cooldown - 1, 0].max
  106.   end
  107.   
  108.   #--------------------------------------------------------------------------
  109.   # new method: battle_party_change?
  110.   #--------------------------------------------------------------------------
  111.   def battle_party_change?
  112.     switch = YEA::COMMAND_PARTY::ENABLE_SWITCH
  113.     enabled = switch <= 0 ? true : $game_switches[switch]
  114.     return false unless enabled
  115.     reset_party_cooldown if @party_cooldown.nil?
  116.     return @party_cooldown <= 0
  117.   end
  118.   
  119.   #--------------------------------------------------------------------------
  120.   # new method: set_party_cooldown
  121.   #--------------------------------------------------------------------------
  122.   def set_party_cooldown
  123.     @party_cooldown = YEA::COMMAND_PARTY::PARTY_COOLDOWN
  124.   end
  125.   
  126.   #--------------------------------------------------------------------------
  127.   # alias method: on_battle_end
  128.   #--------------------------------------------------------------------------
  129.   alias game_unit_on_battle_end_cpt on_battle_end
  130.   def on_battle_end
  131.     game_unit_on_battle_end_cpt
  132.     reset_party_cooldown
  133.   end
  134.   
  135. end # Game_Unit

  136. #==============================================================================
  137. # ■ Window_PartyCommand
  138. #==============================================================================

  139. class Window_PartyCommand < Window_Command
  140.   
  141.   #--------------------------------------------------------------------------
  142.   # alias method: make_command_list
  143.   #--------------------------------------------------------------------------
  144.   alias window_partycommand_make_command_list_cpt make_command_list
  145.   def make_command_list
  146.     window_partycommand_make_command_list_cpt
  147.     return if $imported["YEA-BattleCommandList"]
  148.     add_party_command
  149.   end
  150.   
  151.   #--------------------------------------------------------------------------
  152.   # new method: add_party_command
  153.   #--------------------------------------------------------------------------
  154.   def add_party_command
  155.     return unless YEA::PARTY::ENABLE_MENU
  156.     show = YEA::COMMAND_PARTY::SHOW_SWITCH
  157.     continue = show == 0 ? true : $game_switches[show]
  158.     continue = false if $game_party.all_members.size < 2
  159.     return unless continue
  160.     text = YEA::COMMAND_PARTY::COMMAND_TEXT
  161.     add_command(text, :party, $game_party.battle_party_change?)
  162.   end
  163.   
  164. end # Window_PartyCommand

  165. #==============================================================================
  166. # ■ Scene_Battle
  167. #==============================================================================

  168. class Scene_Battle < Scene_Base
  169.   
  170.   #--------------------------------------------------------------------------
  171.   # alias method: create_party_command_window
  172.   #--------------------------------------------------------------------------
  173.   alias create_party_command_window_cpt create_party_command_window
  174.   def create_party_command_window
  175.     create_party_command_window_cpt
  176.     @party_command_window.set_handler(:party, method(:command_party))
  177.   end
  178.   
  179.   #--------------------------------------------------------------------------
  180.   # new method: command_party
  181.   #--------------------------------------------------------------------------
  182.   def command_party
  183.     Graphics.freeze
  184.     @info_viewport.visible = false
  185.     hide_extra_gauges if $imported["YEA-BattleEngine"]
  186.     SceneManager.snapshot_for_background
  187.     previous_party = $game_party.battle_members.clone
  188.     index = @party_command_window.index
  189.     oy = @party_command_window.oy
  190.     #---
  191.     SceneManager.call(Scene_Party)
  192.     SceneManager.scene.main
  193.     SceneManager.force_recall(self)
  194.     #---
  195.     show_extra_gauges if $imported["YEA-BattleEngine"]
  196.     if previous_party != $game_party.battle_members
  197.       $game_party.make_actions
  198.       $game_party.set_party_cooldown
  199.     end
  200.     @info_viewport.visible = true
  201.     @status_window.refresh
  202.     @party_command_window.setup
  203.     @party_command_window.select(index)
  204.     @party_command_window.oy = oy
  205.     perform_transition
  206.   end
  207.   
  208.   #--------------------------------------------------------------------------
  209.   # alias method: turn_end
  210.   #--------------------------------------------------------------------------
  211.   alias scene_battle_turn_end_cpt turn_end
  212.   def turn_end
  213.     scene_battle_turn_end_cpt
  214.     return if $imported["YEA-BattleEngine"]
  215.     update_party_cooldowns
  216.   end
  217.   
  218.   #--------------------------------------------------------------------------
  219.   # new method: update_party_cooldowns
  220.   #--------------------------------------------------------------------------
  221.   def update_party_cooldowns
  222.     $game_party.update_party_cooldown
  223.     $game_troop.update_party_cooldown
  224.   end
  225.   
  226. end # Scene_Battle
  227. end # $imported["YEA-PartySystem"]

  228. #==============================================================================
  229. #
  230. # ▼ End of File
  231. #
  232. #==============================================================================
复制代码


------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Party System v1.08
  4. # -- Last Updated: 2012.01.23
  5. # -- Level: Normal
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-PartySystem"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.01.23 - Bug fixed: Party members are now rearranged when newly added.
  15. # 2012.01.14 - New Feature: Maximum Battle Members Variable added.
  16. # 2012.01.07 - Bug fixed: Error with removing members.
  17. # 2012.01.05 - Bug fixed: Escape skill/item effects no longer counts as death.
  18. # 2011.12.26 - Compatibility Update: New Game+
  19. # 2011.12.17 - Updated Spriteset_Battle to have updated sprite counts.
  20. # 2011.12.13 - Updated to provide better visual display when more than 5 pieces
  21. #              of equipment are equipped on an actor at a time.
  22. # 2011.12.05 - Added functionality to display faces in the Party Select Window.
  23. #            - Fixed bug that doesn't refresh the caterpillar when new members
  24. #              join the party.
  25. # 2011.12.04 - Started Script and Finished.
  26. #
  27. #==============================================================================
  28. # ▼ Introduction
  29. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  30. # RPG Maker VX Ace comes with a very nice party system. However, changing the
  31. # maximum number of members isn't possible without the aid of a script. This
  32. # script enables you the ability to change the maximum number of party members,
  33. # change EXP rates, and/or open up a separate party menu (if desired). In
  34. # addition to that, you can lock the position of actors within a party and
  35. # require other actors to be in the active party before continuing.
  36. #
  37. #==============================================================================
  38. # ▼ Instructions
  39. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  40. # To install this script, open up your script editor and copy/paste this script
  41. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  42. #
  43. # -----------------------------------------------------------------------------
  44. # 脚本命令语句 - These commands are used with script calls.
  45. # -----------------------------------------------------------------------------
  46. # *IMPORTANT* These script calls require the new party menu to be enabled to
  47. # use them. Otherwise, nothing will happen.
  48. #
  49. # lock_actor(x)      锁定X角色在队伍中的位置
  50. # unlock_actor(x)
  51. # This will lock actor x in its current position in the party if the actor is
  52. # in the current party. The actor is unable to switch position and must remain
  53. # in that position until the lock is removed. Use the unlock script call to
  54. # remove the locked status. This script requires the actor to have joined and
  55. # in the current party before the script call will work.
  56. #
  57. # require_actor(x)   需要X角色参战
  58. # unrequire_actor(x)
  59. # This will cause the party to require actor x in order to continue. If the
  60. # actor isn't in the current party but is in the reserve party, the party menu
  61. # will open up and prompt the player to add the required actor into the party
  62. # before being able to continue. This script call will not function unless the
  63. # specific actor has joined the party, whether it is in the current or reserve.
  64. #
  65. # call_party_menu    打开队伍菜单
  66. # This will open up the party menu. This script call requires for the party
  67. # menu to be enabled to use.
  68. #
  69. #==============================================================================
  70. # ▼ Compatibility
  71. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  72. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  73. # it will run with RPG Maker VX without adjusting.
  74. #
  75. #==============================================================================

  76. module YEA
  77.   module PARTY
  78.    
  79.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  80.     # - General Party Settings -
  81.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  82.     # In this section, you can adjust the general party settings for your game
  83.     # such as the maximum amount of members and whatnot, the EXP rate for
  84.     # party members in the reserve, etc.
  85.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  86.     MAX_BATTLE_MEMBERS   = 5      # 最大参战人员. Default: 4
  87.     SPLIT_EXP            = false  # 平分经验?Splits EXP with more members in the party.
  88.     RESERVE_EXP_RATE     = 0.50   # 休息人员的经验获得率Reserve EXP Rate. Default: 1.00
  89.    
  90.     # If you wish to be able to change the maximum number of battle members
  91.     # during the middle of your game, set this constant to a variable ID. If
  92.     # that variable ID is a number greater than 0, that variable will determine
  93.     # the current maximum number of battle members. Be cautious about using
  94.     # this during battle.
  95.     MAX_MEMBERS_VARIABLE = 0  #设置游戏中改变最大参战人员的变量
  96.    
  97.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  98.     # - Party Menu Settings -
  99.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  100.     # This section contains various menu settings for those who wish to use a
  101.     # menu separate for the party system. Here, adjust the menu command order,
  102.     # icons used, and other settings.
  103.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  104.     ENABLE_MENU = true   # Enables party menu. Default: false
  105.     COMMANDS =[          # The order at which the menu items are shown.
  106.     # [:command,  "Display"],
  107.       [ :change,  "更换",],
  108.       [ :remove,  "移除",],
  109.       [ :revert,  "还原",],
  110.       [ :finish,  "完成",],
  111.     ] # Do not remove this.
  112.     COMMAND_ALIGN    = 1     # 0:左对齐, 1:Center Align, 2:Right Align
  113.    
  114.     # These settings here are used for the upper right window: the Party Select
  115.     # window where the player selects a member to swap out or remove.
  116.     PARTY_FONT_SIZE  = 20    # Font size used for party member names.
  117.     LOCK_FIRST_ACTOR = false # Lock the first actor by default?
  118.     LOCKED_ICON      = 125   # Icon used for locked members.
  119.     REQUIRED_ICON    = 126   # Icon used for required members.
  120.     EMPTY_TEXT = "-Empty-"   # Text used when a member isn't present.
  121.     DISPLAY_FACE     = false # Display faces instead of sprites?
  122.    
  123.     # These settings here are used for the lower left window: the Party List
  124.     # window where the player selects a member to replace.
  125.     REMOVE_ICON      = 185          # Icon used for removing members.
  126.     REMOVE_TEXT      = "-Remove-"   # Text used for remove member command.
  127.     ACTOR_Y_BUFFER   = 12           # Amount the actor graphic be adjusted by.
  128.    
  129.     # These settings here are used for the lower right window: the Party Status
  130.     # window where info about a selected actor is shown.
  131.     NO_DATA         = "- No Data -" # Text used for when no actor is shown.
  132.     IN_PARTY_COLOUR = 6             # Text colour used for in party members.
  133.     STAT_FONT_SIZE  = 20            # Font size used for stats.
  134.     EQUIP_TEXT      = "Equipment"   # Text used to display equipment.
  135.    
  136.   end # PARTY
  137. end # YEA

  138. #==============================================================================
  139. # ▼ Editting anything past this point may potentially result in causing
  140. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  141. # halitosis so edit at your own risk.
  142. #==============================================================================

  143. #==============================================================================
  144. # ■ Icon
  145. #==============================================================================

  146. module Icon
  147.   
  148.   #--------------------------------------------------------------------------
  149.   # self.locked_party
  150.   #--------------------------------------------------------------------------
  151.   def self.locked_party; return YEA::PARTY::LOCKED_ICON; end
  152.   
  153.   #--------------------------------------------------------------------------
  154.   # self.required_party
  155.   #--------------------------------------------------------------------------
  156.   def self.required_party; return YEA::PARTY::REQUIRED_ICON; end
  157.   
  158.   #--------------------------------------------------------------------------
  159.   # self.remove_party
  160.   #--------------------------------------------------------------------------
  161.   def self.remove_party; return YEA::PARTY::REMOVE_ICON; end
  162.    
  163. end # Icon

  164. #==============================================================================
  165. # ■ Variable
  166. #==============================================================================

  167. module Variable
  168.   
  169.   #--------------------------------------------------------------------------
  170.   # self.max_battle_members
  171.   #--------------------------------------------------------------------------
  172.   def self.max_battle_members
  173.     default = YEA::PARTY::MAX_BATTLE_MEMBERS
  174.     return default if YEA::PARTY::MAX_MEMBERS_VARIABLE <= 0
  175.     return default if $game_variables[YEA::PARTY::MAX_MEMBERS_VARIABLE] <= 0
  176.     return $game_variables[YEA::PARTY::MAX_MEMBERS_VARIABLE]
  177.   end
  178.   
  179. end # Variable

  180. #==============================================================================
  181. # ■ Numeric
  182. #==============================================================================

  183. class Numeric
  184.   
  185.   #--------------------------------------------------------------------------
  186.   # new method: group_digits
  187.   #--------------------------------------------------------------------------
  188.   unless $imported["YEA-CoreEngine"]
  189.   def group; return self.to_s; end
  190.   end # $imported["YEA-CoreEngine"]
  191.    
  192. end # Numeric

  193. #==============================================================================
  194. # ■ Game_Actor
  195. #==============================================================================

  196. class Game_Actor < Game_Battler
  197.   
  198.   #--------------------------------------------------------------------------
  199.   # public instance variables
  200.   #--------------------------------------------------------------------------
  201.   attr_accessor :locked
  202.   attr_accessor :required
  203.   
  204.   #--------------------------------------------------------------------------
  205.   # alias method: setup
  206.   #--------------------------------------------------------------------------
  207.   alias game_actor_setup_ps setup
  208.   def setup(actor_id)
  209.     game_actor_setup_ps(actor_id)
  210.     @locked = false
  211.     @required = false
  212.   end
  213.   
  214.   #--------------------------------------------------------------------------
  215.   # overwrite method: final_exp_rate
  216.   #--------------------------------------------------------------------------
  217.   def final_exp_rate
  218.     n = exr * (battle_member? ? 1 : reserve_members_exp_rate)
  219.     if $game_party.in_battle
  220.       n /= [$game_party.battle_members.size, 1].max if YEA::PARTY::SPLIT_EXP
  221.     end
  222.     return n
  223.   end
  224.   
  225.   #--------------------------------------------------------------------------
  226.   # overwrite method: reserve_members_exp_rate
  227.   #--------------------------------------------------------------------------
  228.   def reserve_members_exp_rate
  229.     $data_system.opt_extra_exp ? YEA::PARTY::RESERVE_EXP_RATE : 0
  230.   end
  231.   
  232. end # Game_Actor

  233. #==============================================================================
  234. # ■ Game_Party
  235. #==============================================================================

  236. class Game_Party < Game_Unit
  237.   
  238.   #--------------------------------------------------------------------------
  239.   # public instance variables
  240.   #--------------------------------------------------------------------------
  241.   attr_accessor :battle_members_array
  242.   
  243.   #--------------------------------------------------------------------------
  244.   # alias method: initialize
  245.   #--------------------------------------------------------------------------
  246.   alias game_party_initialize_ps initialize
  247.   def initialize
  248.     game_party_initialize_ps
  249.     @battle_members_array = nil
  250.   end
  251.   
  252.   #--------------------------------------------------------------------------
  253.   # overwrite method: max_battle_members
  254.   #--------------------------------------------------------------------------
  255.   def max_battle_members; return Variable.max_battle_members; end
  256.   
  257.   #--------------------------------------------------------------------------
  258.   # alias method: setup_starting_members
  259.   #--------------------------------------------------------------------------
  260.   alias setup_starting_members_ps setup_starting_members
  261.   def setup_starting_members
  262.     setup_starting_members_ps
  263.     initialize_battle_members
  264.     return unless YEA::PARTY::LOCK_FIRST_ACTOR
  265.     return if members[0].nil?
  266.     members[0].locked = true
  267.   end
  268.   
  269.   #--------------------------------------------------------------------------
  270.   # alias method: setup_battle_test_members
  271.   #--------------------------------------------------------------------------
  272.   alias setup_battle_test_members_ps setup_battle_test_members
  273.   def setup_battle_test_members
  274.     setup_battle_test_members_ps
  275.     return unless YEA::PARTY::LOCK_FIRST_ACTOR
  276.     return if members[0].nil?
  277.     members[0].locked = true
  278.   end
  279.   
  280.   #--------------------------------------------------------------------------
  281.   # overwrite method: battle_members
  282.   #--------------------------------------------------------------------------
  283.   def battle_members
  284.     initialize_battle_members if initialize_battle_members?
  285.     array = []
  286.     for actor_id in @battle_members_array
  287.       break if array.size > max_battle_members
  288.       next if actor_id.nil?
  289.       next if $game_actors[actor_id].nil?
  290.       next unless $game_actors[actor_id].exist?
  291.       array.push($game_actors[actor_id])
  292.     end
  293.     return array
  294.   end
  295.   
  296.   #--------------------------------------------------------------------------
  297.   # new method: initialize_battle_members?
  298.   #--------------------------------------------------------------------------
  299.   def initialize_battle_members?
  300.     return true if @battle_members_array.nil?
  301.     return @battle_members_array.size != max_battle_members
  302.   end
  303.   
  304.   #--------------------------------------------------------------------------
  305.   # new method: initialize_battle_members
  306.   #--------------------------------------------------------------------------
  307.   def initialize_battle_members
  308.     @battle_members_array = []
  309.     for i in 0...max_battle_members
  310.       @battle_members_array.push(@actors[i]) unless @actors[i].nil?
  311.       @battle_members_array.push(0) if @actors[i].nil?
  312.     end
  313.     $game_player.refresh
  314.   end
  315.   
  316.   #--------------------------------------------------------------------------
  317.   # alias method: add_actor
  318.   #--------------------------------------------------------------------------
  319.   alias game_party_add_actor_ps add_actor
  320.   def add_actor(actor_id)
  321.     game_party_add_actor_ps(actor_id)
  322.     return if @battle_members_array.include?(actor_id)
  323.     return unless @battle_members_array.include?(0)
  324.     index = @battle_members_array.index(0)
  325.     @battle_members_array[index] = actor_id
  326.     $game_player.refresh
  327.     $game_map.need_refresh = true
  328.     rearrange_actors
  329.   end
  330.   
  331.   #--------------------------------------------------------------------------
  332.   # alias method: remove_actor
  333.   #--------------------------------------------------------------------------
  334.   alias game_party_remove_actor_ps remove_actor
  335.   def remove_actor(actor_id)
  336.     game_party_remove_actor_ps(actor_id)
  337.     return unless @battle_members_array.include?(actor_id)
  338.     index = @battle_members_array.index(actor_id)
  339.     @battle_members_array[index] = 0
  340.     $game_player.refresh
  341.     $game_map.need_refresh = true
  342.     rearrange_actors
  343.   end
  344.   
  345.   #--------------------------------------------------------------------------
  346.   # new method: rearrange_actors
  347.   #--------------------------------------------------------------------------
  348.   def rearrange_actors
  349.     initialize_battle_members if @battle_members_array.nil?
  350.     array = []
  351.     for actor_id in @battle_members_array
  352.       next if [0, nil].include?(actor_id)
  353.       next if $game_actors[actor_id].nil?
  354.       array.push(actor_id)
  355.     end
  356.     for actor_id in @actors
  357.       next if array.include?(actor_id)
  358.       next if $game_actors[actor_id].nil?
  359.       array.push(actor_id)
  360.     end
  361.     @actors = array
  362.   end
  363.   
  364. end # Game_Party

  365. #==============================================================================
  366. # ■ Game_Interpreter
  367. #==============================================================================

  368. class Game_Interpreter
  369.   
  370.   #--------------------------------------------------------------------------
  371.   # new method: lock_actor
  372.   #--------------------------------------------------------------------------
  373.   def lock_actor(actor_id)
  374.     return unless YEA::PARTY::ENABLE_MENU
  375.     actor = $game_actors[actor_id]
  376.     return unless $game_party.battle_members.include?(actor.id)
  377.     actor.locked = true
  378.   end
  379.   
  380.   #--------------------------------------------------------------------------
  381.   # new method: unlock_actor
  382.   #--------------------------------------------------------------------------
  383.   def unlock_actor(actor_id)
  384.     return unless YEA::PARTY::ENABLE_MENU
  385.     actor = $game_actors[actor_id]
  386.     return unless $game_party.battle_members.include?(actor.id)
  387.     actor.locked = false
  388.   end
  389.   
  390.   #--------------------------------------------------------------------------
  391.   # new method: require_actor
  392.   #--------------------------------------------------------------------------
  393.   def require_actor(actor_id)
  394.     return unless YEA::PARTY::ENABLE_MENU
  395.     return if $game_system.formation_disabled
  396.     actor = $game_actors[actor_id]
  397.     return unless $game_party.all_members.include?(actor)
  398.     actor.required = true
  399.     call_party_menu unless $game_party.battle_members.include?(actor)
  400.   end
  401.   
  402.   #--------------------------------------------------------------------------
  403.   # new method: unrequire_actor
  404.   #--------------------------------------------------------------------------
  405.   def unrequire_actor(actor_id)
  406.     return unless YEA::PARTY::ENABLE_MENU
  407.     return if $game_system.formation_disabled
  408.     actor = $game_actors[actor_id]
  409.     return unless $game_party.all_members.include?(actor)
  410.     actor.required = false
  411.     call_party_menu unless $game_party.battle_members.include?(actor)
  412.   end
  413.   
  414.   #--------------------------------------------------------------------------
  415.   # new method: call_party_menu
  416.   #--------------------------------------------------------------------------
  417.   def call_party_menu
  418.     return unless YEA::PARTY::ENABLE_MENU
  419.     return if $game_system.formation_disabled
  420.     SceneManager.call(Scene_Party)
  421.   end
  422.   
  423. end # Game_Interpreter

  424. #==============================================================================
  425. # ■ Spriteset_Battle
  426. #==============================================================================

  427. class Spriteset_Battle
  428.   
  429.   #--------------------------------------------------------------------------
  430.   # overwrite method: create_actors
  431.   #--------------------------------------------------------------------------
  432.   def create_actors
  433.     total = $game_party.max_battle_members
  434.     @actor_sprites = Array.new(total) { Sprite_Battler.new(@viewport1) }
  435.   end
  436.   
  437. end # Spriteset_Battle

  438. #==============================================================================
  439. # ■ Window_PartyMenuCommand
  440. #==============================================================================

  441. class Window_PartyMenuCommand < Window_Command
  442.   
  443.   #--------------------------------------------------------------------------
  444.   # window_width
  445.   #--------------------------------------------------------------------------
  446.   def window_width; return 160; end
  447.   
  448.   #--------------------------------------------------------------------------
  449.   # visible_line_number
  450.   #--------------------------------------------------------------------------
  451.   def visible_line_number; 4; end
  452.   
  453.   #--------------------------------------------------------------------------
  454.   # alignment
  455.   #--------------------------------------------------------------------------
  456.   def alignment
  457.     return Menu.command_window_align if $imported["YEA-AceMenuEngine"]
  458.     return YEA::PARTY::COMMAND_ALIGN
  459.   end
  460.   
  461.   #--------------------------------------------------------------------------
  462.   # scene
  463.   #--------------------------------------------------------------------------
  464.   def scene; return SceneManager.scene; end
  465.   
  466.   #--------------------------------------------------------------------------
  467.   # make_command_list
  468.   #--------------------------------------------------------------------------
  469.   def make_command_list
  470.     for command in YEA::PARTY::COMMANDS
  471.       case command[0]
  472.       when :change, :remove, :revert
  473.         add_command(command[1], command[0])
  474.       when :finish
  475.         add_command(command[1], command[0], enable_cancel?)
  476.       else; next
  477.       end
  478.     end
  479.   end
  480.   
  481.   #--------------------------------------------------------------------------
  482.   # process_cancel
  483.   #--------------------------------------------------------------------------
  484.   def process_cancel
  485.     unless enable_cancel?
  486.       Sound.play_buzzer
  487.       return
  488.     end
  489.     super
  490.   end
  491.   
  492.   #--------------------------------------------------------------------------
  493.   # in_party?
  494.   #--------------------------------------------------------------------------
  495.   def in_party?(actor)
  496.     return $game_party.battle_members.include?(actor)
  497.   end
  498.   
  499.   #--------------------------------------------------------------------------
  500.   # enable_cancel?
  501.   #--------------------------------------------------------------------------
  502.   def enable_cancel?
  503.     return false if $game_party.battle_members.size <= 0
  504.     for actor in $game_party.all_members
  505.       next if in_party?(actor)
  506.       return false if actor.required
  507.       return false if actor.locked
  508.     end
  509.     return true
  510.   end
  511.   
  512. end # Window_PartyMenuCommand

  513. #==============================================================================
  514. # ■ Window_PartySelect
  515. #==============================================================================

  516. class Window_PartySelect < Window_Selectable
  517.   
  518.   #--------------------------------------------------------------------------
  519.   # initialize
  520.   #-------------------------------------------------------------------------
  521.   def initialize(command_window)
  522.     @command_window = command_window
  523.     super(160, 0, window_width, fitting_height(visible_line_number))
  524.     select(0)
  525.     deactivate
  526.     refresh
  527.   end
  528.   
  529.   #--------------------------------------------------------------------------
  530.   # col_max
  531.   #--------------------------------------------------------------------------
  532.   def col_max; return $game_party.max_battle_members; end
  533.   
  534.   #--------------------------------------------------------------------------
  535.   # item_max
  536.   #--------------------------------------------------------------------------
  537.   def item_max; return $game_party.max_battle_members; end
  538.   
  539.   #--------------------------------------------------------------------------
  540.   # window_width
  541.   #--------------------------------------------------------------------------
  542.   def window_width; return Graphics.width - 160; end
  543.   
  544.   #--------------------------------------------------------------------------
  545.   # visible_line_number
  546.   #--------------------------------------------------------------------------
  547.   def visible_line_number; 4; end
  548.   
  549.   #--------------------------------------------------------------------------
  550.   # item_rect
  551.   #--------------------------------------------------------------------------
  552.   def item_rect(index)
  553.     rect = Rect.new
  554.     rect.width = contents.width / item_max
  555.     rect.height = contents.height
  556.     rect.x = index * rect.width
  557.     rect.y = 0
  558.     return rect
  559.   end
  560.   
  561.   #--------------------------------------------------------------------------
  562.   # refresh
  563.   #--------------------------------------------------------------------------
  564.   def refresh
  565.     make_item_list
  566.     create_contents
  567.     draw_all_items
  568.   end
  569.   
  570.   #--------------------------------------------------------------------------
  571.   # make_item_list
  572.   #--------------------------------------------------------------------------
  573.   def make_item_list
  574.     @data = $game_party.battle_members_array.clone
  575.   end
  576.   
  577.   #--------------------------------------------------------------------------
  578.   # draw_item
  579.   #--------------------------------------------------------------------------
  580.   def draw_item(index)
  581.     actor = $game_actors[@data[index]]
  582.     rect = item_rect(index)
  583.     if actor.nil?
  584.       draw_empty(rect.clone)
  585.       return
  586.     end
  587.     dx = rect.width / 2
  588.     dy = rect.height - 16
  589.     draw_actor_face(actor, rect.x, rect.y) if display_face?
  590.     draw_actor_graphic(actor, rect.x + dx, rect.y + dy) unless display_face?
  591.     draw_actor_name(actor, rect)
  592.     draw_locked_icon(actor, rect)
  593.     draw_required_icon(actor, rect)
  594.   end
  595.   
  596.   #--------------------------------------------------------------------------
  597.   # display_face?
  598.   #--------------------------------------------------------------------------
  599.   def display_face?
  600.     return YEA::PARTY::DISPLAY_FACE
  601.   end
  602.   
  603.   #--------------------------------------------------------------------------
  604.   # draw_empty
  605.   #--------------------------------------------------------------------------
  606.   def draw_empty(rect)
  607.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  608.     rect.x += 2
  609.     rect.y += 2
  610.     rect.width -= 4
  611.     rect.height -= 4
  612.     contents.fill_rect(rect, colour)
  613.     reset_font_settings
  614.     change_color(system_color)
  615.     text = YEA::PARTY::EMPTY_TEXT
  616.     draw_text(rect, text, 1)
  617.     reset_font_settings
  618.   end
  619.   
  620.   #--------------------------------------------------------------------------
  621.   # draw_actor_name
  622.   #--------------------------------------------------------------------------
  623.   def draw_actor_name(actor, rect)
  624.     contents.font.size = YEA::PARTY::PARTY_FONT_SIZE
  625.     change_color(normal_color, actor.exist?)
  626.     draw_text(rect.x+4, rect.y, rect.width-8, line_height, actor.name, 1)
  627.   end
  628.   
  629.   #--------------------------------------------------------------------------
  630.   # draw_face
  631.   #--------------------------------------------------------------------------
  632.   def draw_face(face_name, face_index, dx, dy, enabled = true)
  633.     bitmap = Cache.face(face_name)
  634.     dw = [96, item_rect(0).width-4].min
  635.     rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, dw, 92)
  636.     contents.blt(dx+2, dy+2, bitmap, rect, enabled ? 255 : translucent_alpha)
  637.     bitmap.dispose
  638.   end
  639.   
  640.   #--------------------------------------------------------------------------
  641.   # draw_locked_icon
  642.   #--------------------------------------------------------------------------
  643.   def draw_locked_icon(actor, rect)
  644.     return unless actor_locked?(actor)
  645.     draw_icon(Icon.locked_party, rect.x+rect.width-26, rect.height - 26)
  646.   end
  647.   
  648.   #--------------------------------------------------------------------------
  649.   # draw_required_icon
  650.   #--------------------------------------------------------------------------
  651.   def draw_required_icon(actor, rect)
  652.     return if actor_locked?(actor)
  653.     return unless actor_required?(actor)
  654.     draw_icon(Icon.required_party, rect.x+rect.width-26, rect.height - 26)
  655.   end
  656.   
  657.   #--------------------------------------------------------------------------
  658.   # actor_locked?
  659.   #--------------------------------------------------------------------------
  660.   def actor_locked?(actor); return actor.locked; end
  661.   
  662.   #--------------------------------------------------------------------------
  663.   # actor_required?
  664.   #--------------------------------------------------------------------------
  665.   def actor_required?(actor)
  666.     return false if actor.locked
  667.     return actor.required
  668.   end
  669.   
  670.   #--------------------------------------------------------------------------
  671.   # current_item_enabled?
  672.   #--------------------------------------------------------------------------
  673.   def current_item_enabled?; enable?(@data[index]); end
  674.   
  675.   #--------------------------------------------------------------------------
  676.   # enable?
  677.   #--------------------------------------------------------------------------
  678.   def enable?(item)
  679.     case @command_window.current_symbol
  680.     when :change
  681.       return true if item.nil?
  682.       return true if item == 0
  683.     when :remove
  684.       return false if item.nil?
  685.       return false if item == 0
  686.     end
  687.     actor = $game_actors[item]
  688.     return false if actor.locked
  689.     return false if actor.required
  690.     return true
  691.   end
  692.   
  693.   #--------------------------------------------------------------------------
  694.   # process_handling
  695.   #--------------------------------------------------------------------------
  696.   def process_handling
  697.     return unless open? && active
  698.     return process_ok       if ok_enabled?        && Input.trigger?(:C)
  699.     return process_cancel   if cancel_enabled?    && Input.trigger?(:B)
  700.     return process_pagedown if handle?(:pagedown) && Input.repeat?(:R)
  701.     return process_pageup   if handle?(:pageup)   && Input.repeat?(:L)
  702.   end
  703.   
  704.   #--------------------------------------------------------------------------
  705.   # cur_actor
  706.   #--------------------------------------------------------------------------
  707.   def cur_actor
  708.     actor_id = @data[index]
  709.     return $game_actors[actor_id]
  710.   end
  711.   
  712.   #--------------------------------------------------------------------------
  713.   # prev_actor
  714.   #--------------------------------------------------------------------------
  715.   def prev_actor
  716.     id = index == 0 ? @data.size - 1 : index - 1
  717.     actor_id = @data[id]
  718.     return $game_actors[actor_id]
  719.   end
  720.   
  721.   #--------------------------------------------------------------------------
  722.   # next_actor
  723.   #--------------------------------------------------------------------------
  724.   def next_actor
  725.     id = index == @data.size - 1 ? 0 : index + 1
  726.     actor_id = @data[id]
  727.     return $game_actors[actor_id]
  728.   end
  729.   
  730.   #--------------------------------------------------------------------------
  731.   # process_pageup
  732.   #--------------------------------------------------------------------------
  733.   def process_pageup
  734.     allow = true
  735.     allow = false if !prev_actor.nil? && prev_actor.locked
  736.     allow = false if !cur_actor.nil? && cur_actor.locked
  737.     Sound.play_buzzer unless allow
  738.     if allow
  739.       super
  740.       activate
  741.       select(index == 0 ? @data.size - 1 : index - 1)
  742.     end
  743.   end
  744.   
  745.   #--------------------------------------------------------------------------
  746.   # process_pagedown
  747.   #--------------------------------------------------------------------------
  748.   def process_pagedown
  749.     allow = true
  750.     allow = false if !next_actor.nil? && next_actor.locked
  751.     allow = false if !cur_actor.nil? && cur_actor.locked
  752.     Sound.play_buzzer unless allow
  753.     if allow
  754.       super
  755.       activate
  756.       select(index == @data.size - 1 ? 0 : index + 1)
  757.     end
  758.   end
  759.   
  760.   #--------------------------------------------------------------------------
  761.   # item
  762.   #--------------------------------------------------------------------------
  763.   def item; return @data[index]; end
  764.   
  765. end # Window_PartySelect

  766. #==============================================================================
  767. # ■ Window_PartyList
  768. #==============================================================================

  769. class Window_PartyList < Window_Selectable
  770.   
  771.   #--------------------------------------------------------------------------
  772.   # initialize
  773.   #-------------------------------------------------------------------------
  774.   def initialize(party_window)
  775.     super(0, fitting_height(4), window_width, window_height)
  776.     @party_window = party_window
  777.     select(1)
  778.     deactivate
  779.     refresh
  780.   end
  781.   
  782.   #--------------------------------------------------------------------------
  783.   # window_width
  784.   #--------------------------------------------------------------------------
  785.   def window_width; return 200; end
  786.   
  787.   #--------------------------------------------------------------------------
  788.   # window_height
  789.   #--------------------------------------------------------------------------
  790.   def window_height; return Graphics.height - fitting_height(4); end
  791.   
  792.   #--------------------------------------------------------------------------
  793.   # item_max
  794.   #--------------------------------------------------------------------------
  795.   def item_max; return @data ? @data.size : 1; end
  796.   
  797.   #--------------------------------------------------------------------------
  798.   # refresh
  799.   #--------------------------------------------------------------------------
  800.   def refresh
  801.     make_item_list
  802.     create_contents
  803.     draw_all_items
  804.   end
  805.   
  806.   #--------------------------------------------------------------------------
  807.   # make_item_list
  808.   #--------------------------------------------------------------------------
  809.   def make_item_list
  810.     @data = [0]
  811.     for member in $game_party.all_members
  812.       next if member.nil?
  813.       @data.push(member.id)
  814.     end
  815.     @data.push(0)
  816.   end
  817.   
  818.   #--------------------------------------------------------------------------
  819.   # draw_item
  820.   #--------------------------------------------------------------------------
  821.   def draw_item(index)
  822.     clear_item(index)
  823.     rect = item_rect(index)
  824.     if @data[index] == 0
  825.       draw_remove(rect)
  826.       return
  827.     end
  828.     actor = $game_actors[@data[index]]
  829.     draw_actor(actor, rect)
  830.     draw_actor_locked(actor, rect)
  831.     draw_actor_required(actor, rect)
  832.   end
  833.   
  834.   #--------------------------------------------------------------------------
  835.   # draw_remove
  836.   #--------------------------------------------------------------------------
  837.   def draw_remove(rect)
  838.     reset_font_settings
  839.     draw_icon(Icon.remove_party, rect.x+4, rect.y)
  840.     text = YEA::PARTY::REMOVE_TEXT
  841.     draw_text(rect.x+32, rect.y, rect.width-32, line_height, text)
  842.   end
  843.   
  844.   #--------------------------------------------------------------------------
  845.   # draw_actor
  846.   #--------------------------------------------------------------------------
  847.   def draw_actor(actor, rect)
  848.     buffer = YEA::PARTY::ACTOR_Y_BUFFER
  849.     draw_actor_graphic(actor, rect.x + 16, rect.y + rect.height + buffer)
  850.     text = actor.name
  851.     change_color(list_colour(actor), enabled?(actor))
  852.     draw_text(rect.x+32, rect.y, rect.width-32, line_height, text)
  853.   end
  854.   
  855.   #--------------------------------------------------------------------------
  856.   # list_colour
  857.   #--------------------------------------------------------------------------
  858.   def list_colour(actor)
  859.     return text_color(YEA::PARTY::IN_PARTY_COLOUR) if in_party?(actor)
  860.     return normal_color
  861.   end
  862.   
  863.   #--------------------------------------------------------------------------
  864.   # draw_actor_locked
  865.   #--------------------------------------------------------------------------
  866.   def draw_actor_locked(actor, rect)
  867.     return unless actor.locked
  868.     draw_icon(Icon.locked_party, rect.width-24, rect.y)
  869.   end
  870.   
  871.   #--------------------------------------------------------------------------
  872.   # draw_actor_required
  873.   #--------------------------------------------------------------------------
  874.   def draw_actor_required(actor, rect)
  875.     return if actor.locked
  876.     return unless actor.required
  877.     draw_icon(Icon.required_party, rect.width-24, rect.y)
  878.   end
  879.   
  880.   #--------------------------------------------------------------------------
  881.   # enabled?
  882.   #--------------------------------------------------------------------------
  883.   def enabled?(actor)
  884.     return false if actor.locked
  885.     return false if actor.required && in_party?(actor)
  886.     return actor.exist?
  887.   end
  888.   
  889.   #--------------------------------------------------------------------------
  890.   # in_party?
  891.   #--------------------------------------------------------------------------
  892.   def in_party?(actor); return $game_party.battle_members.include?(actor); end
  893.   
  894.   #--------------------------------------------------------------------------
  895.   # current_item_enabled?
  896.   #--------------------------------------------------------------------------
  897.   def current_item_enabled?
  898.     actor = $game_actors[item]
  899.     replace = $game_actors[@party_window.item]
  900.     unless actor.nil?
  901.       return false if actor.locked && in_party?(actor)
  902.       return false if actor.required && in_party?(actor)
  903.     end
  904.     return true if replace.nil?
  905.     return false if replace.locked
  906.     return false if replace.required
  907.     return true if actor.nil?
  908.     return actor.exist?
  909.   end
  910.   
  911.   #--------------------------------------------------------------------------
  912.   # item
  913.   #--------------------------------------------------------------------------
  914.   def item; return @data[index]; end
  915.   
  916. end # Window_PartyList

  917. #==============================================================================
  918. # ** Window_PartyStatus
  919. #==============================================================================

  920. class Window_PartyStatus < Window_Base
  921.   
  922.   #--------------------------------------------------------------------------
  923.   # initialize
  924.   #--------------------------------------------------------------------------
  925.   def initialize(party_window, list_window)
  926.     super(200, fitting_height(4), window_width, window_height)
  927.     @party_window = party_window
  928.     @list_window = list_window
  929.     @actor = active_actor
  930.     refresh
  931.   end
  932.   
  933.   #--------------------------------------------------------------------------
  934.   # window_width
  935.   #--------------------------------------------------------------------------
  936.   def window_width; Graphics.width - 200; end
  937.   
  938.   #--------------------------------------------------------------------------
  939.   # window_height
  940.   #--------------------------------------------------------------------------
  941.   def window_height; Graphics.height - fitting_height(4); end
  942.   
  943.   #--------------------------------------------------------------------------
  944.   # update
  945.   #--------------------------------------------------------------------------
  946.   def update
  947.     super
  948.     refresh if @actor != active_actor
  949.   end
  950.   
  951.   #--------------------------------------------------------------------------
  952.   # active_actor
  953.   #--------------------------------------------------------------------------
  954.   def active_actor
  955.     if @list_window.active
  956.       actor = @list_window.item
  957.     else
  958.       actor = @party_window.item
  959.     end
  960.     return nil if [0, nil].include?(actor)
  961.     return actor
  962.   end
  963.   
  964.   #--------------------------------------------------------------------------
  965.   # refresh
  966.   #--------------------------------------------------------------------------
  967.   def refresh
  968.     contents.clear
  969.     @actor = active_actor
  970.     reset_font_settings
  971.     if @actor.nil?
  972.       draw_nil_actor
  973.       return
  974.     end
  975.     actor = $game_actors[@actor]
  976.     draw_actor_face(actor, 0, 0)
  977.     draw_actor_name(actor, 108, 0)
  978.     draw_actor_class(actor, 228, 0, contents.width-232)
  979.     draw_actor_level(actor, 108, line_height)
  980.     draw_actor_icons(actor, 228, line_height, contents.width-232)
  981.     draw_actor_hp(actor, 108, line_height*2, contents.width-112)
  982.     draw_actor_mp(actor, 108, line_height*3, contents.width-112)
  983.     draw_actor_parameters(actor, 0, line_height*4 + line_height/2)
  984.     draw_equipments(actor, contents.width/2, line_height*4 + line_height/2)
  985.   end
  986.   
  987.   #--------------------------------------------------------------------------
  988.   # draw_nil_actor
  989.   #--------------------------------------------------------------------------
  990.   def draw_nil_actor
  991.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  992.     rect = Rect.new(0, 0, contents.width, contents.height)
  993.     contents.fill_rect(rect, colour)
  994.     change_color(system_color)
  995.     text = YEA::PARTY::NO_DATA
  996.     draw_text(rect, text, 1)
  997.   end
  998.   
  999.   #--------------------------------------------------------------------------
  1000.   # draw_actor_parameters
  1001.   #--------------------------------------------------------------------------
  1002.   def draw_actor_parameters(actor, dx, dy)
  1003.     dw = contents.width/2 - 4
  1004.     rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  1005.     contents.font.size = YEA::PARTY::STAT_FONT_SIZE
  1006.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  1007.     array = [:atk, :def, :mat, :mdf, :agi, :luk]
  1008.     cx = 4
  1009.     for stat in array
  1010.       case stat
  1011.       when :atk
  1012.         param = Vocab::param(2)
  1013.         value = actor.atk.group
  1014.       when :def
  1015.         param = Vocab::param(3)
  1016.         value = actor.def.group
  1017.       when :mat
  1018.         param = Vocab::param(4)
  1019.         value = actor.mat.group
  1020.       when :mdf
  1021.         param = Vocab::param(5)
  1022.         value = actor.mdf.group
  1023.       when :agi
  1024.         param = Vocab::param(6)
  1025.         value = actor.agi.group
  1026.       when :luk
  1027.         param = Vocab::param(7)
  1028.         value = actor.luk.group
  1029.       else; next
  1030.       end
  1031.       contents.fill_rect(rect, colour)
  1032.       change_color(system_color)
  1033.       draw_text(rect.x + cx, rect.y, rect.width-cx*2, line_height, param, 0)
  1034.       change_color(normal_color)
  1035.       draw_text(rect.x + cx, rect.y, rect.width-cx*2, line_height, value, 2)
  1036.       rect.y += line_height
  1037.     end
  1038.     reset_font_settings
  1039.   end
  1040.   
  1041.   #--------------------------------------------------------------------------
  1042.   # draw_equipments
  1043.   #--------------------------------------------------------------------------
  1044.   def draw_equipments(actor, dx, dy)
  1045.     text = YEA::PARTY::EQUIP_TEXT
  1046.     change_color(system_color)
  1047.     draw_text(dx, dy, contents.width - dx, line_height, text, 1)
  1048.     dy += line_height
  1049.     if actor.equips.size <= 5
  1050.       actor.equips.each_with_index do |item, i|
  1051.         draw_item_name(item, dx, dy + line_height * i)
  1052.       end
  1053.     else
  1054.       orig_x = dx
  1055.       actor.equips.each_with_index do |item, i|
  1056.         next if item.nil?
  1057.         draw_icon(item.icon_index, dx, dy)
  1058.         dy += line_height if dx + 48 > contents.width
  1059.         dx = dx + 48 > contents.width ? orig_x : dx + 24
  1060.       end
  1061.     end
  1062.   end
  1063.   
  1064. end # Window_PartyStatus

  1065. #==============================================================================
  1066. # ■ Scene_Menu
  1067. #==============================================================================

  1068. class Scene_Menu < Scene_MenuBase
  1069.   
  1070.   #--------------------------------------------------------------------------
  1071.   # overwrite method: command_formation
  1072.   #--------------------------------------------------------------------------
  1073.   if YEA::PARTY::ENABLE_MENU
  1074.   def command_formation
  1075.     SceneManager.call(Scene_Party)
  1076.   end
  1077.   end # YEA::PARTY::ENABLE_MENU
  1078.   
  1079. end # Scene_Menu

  1080. #==============================================================================
  1081. # ■ Scene_Party
  1082. #==============================================================================

  1083. class Scene_Party < Scene_MenuBase
  1084.   
  1085.   #--------------------------------------------------------------------------
  1086.   # start
  1087.   #--------------------------------------------------------------------------
  1088.   def start
  1089.     super
  1090.     @former_party = $game_party.battle_members_array.clone
  1091.     create_command_window
  1092.     create_party_window
  1093.     create_list_window
  1094.     create_status_window
  1095.   end
  1096.   
  1097.   #--------------------------------------------------------------------------
  1098.   # create_command_window
  1099.   #--------------------------------------------------------------------------
  1100.   def create_command_window
  1101.     @command_window = Window_PartyMenuCommand.new(0, 0)
  1102.     @command_window.set_handler(:change, method(:adjust_members))
  1103.     @command_window.set_handler(:remove, method(:adjust_members))
  1104.     @command_window.set_handler(:revert, method(:revert_party))
  1105.     @command_window.set_handler(:finish, method(:return_scene))
  1106.     @command_window.set_handler(:cancel, method(:return_scene))
  1107.   end
  1108.   
  1109.   #--------------------------------------------------------------------------
  1110.   # create_party_window
  1111.   #--------------------------------------------------------------------------
  1112.   def create_party_window
  1113.     @party_window = Window_PartySelect.new(@command_window)
  1114.     @party_window.set_handler(:ok,       method(:on_party_ok))
  1115.     @party_window.set_handler(:cancel,   method(:on_party_cancel))
  1116.     @party_window.set_handler(:pageup,   method(:on_party_pageup))
  1117.     @party_window.set_handler(:pagedown, method(:on_party_pagedown))
  1118.   end
  1119.   
  1120.   #--------------------------------------------------------------------------
  1121.   # create_list_window
  1122.   #--------------------------------------------------------------------------
  1123.   def create_list_window
  1124.     @list_window = Window_PartyList.new(@party_window)
  1125.     @list_window.set_handler(:ok,     method(:on_list_ok))
  1126.     @list_window.set_handler(:cancel, method(:on_list_cancel))
  1127.   end
  1128.   
  1129.   #--------------------------------------------------------------------------
  1130.   # create_status_window
  1131.   #--------------------------------------------------------------------------
  1132.   def create_status_window
  1133.     @status_window = Window_PartyStatus.new(@party_window, @list_window)
  1134.   end
  1135.   
  1136.   #--------------------------------------------------------------------------
  1137.   # adjust_members
  1138.   #--------------------------------------------------------------------------
  1139.   def adjust_members
  1140.     @party_window.activate
  1141.   end
  1142.   
  1143.   #--------------------------------------------------------------------------
  1144.   # window_refresh
  1145.   #--------------------------------------------------------------------------
  1146.   def window_refresh
  1147.     $game_party.rearrange_actors
  1148.     @command_window.refresh
  1149.     @party_window.refresh
  1150.     @list_window.refresh
  1151.     $game_player.refresh
  1152.     $game_map.need_refresh = true
  1153.   end
  1154.   
  1155.   #--------------------------------------------------------------------------
  1156.   # revert_party
  1157.   #--------------------------------------------------------------------------
  1158.   def revert_party
  1159.     @command_window.activate
  1160.     $game_party.battle_members_array = @former_party.clone
  1161.     window_refresh
  1162.   end
  1163.   
  1164.   #--------------------------------------------------------------------------
  1165.   # on_party_ok
  1166.   #--------------------------------------------------------------------------
  1167.   def on_party_ok
  1168.     case @command_window.current_symbol
  1169.     when :change
  1170.       @list_window.activate
  1171.     when :remove
  1172.       index = @party_window.index
  1173.       actor = $game_actors[$game_party.battle_members_array[index]]
  1174.       Sound.play_equip
  1175.       $game_party.battle_members_array[index] = 0
  1176.       window_refresh
  1177.       @party_window.activate
  1178.     end
  1179.   end
  1180.   
  1181.   #--------------------------------------------------------------------------
  1182.   # on_party_cancel
  1183.   #--------------------------------------------------------------------------
  1184.   def on_party_cancel
  1185.     @command_window.activate
  1186.   end
  1187.   
  1188.   #--------------------------------------------------------------------------
  1189.   # on_party_pageup
  1190.   #--------------------------------------------------------------------------
  1191.   def on_party_pageup
  1192.     Sound.play_equip
  1193.     actor_id1 = @party_window.item
  1194.     actor_id2 = @party_window.prev_actor.nil? ? 0 : @party_window.prev_actor.id
  1195.     max = @party_window.item_max-1
  1196.     index1 = @party_window.index
  1197.     index2 = @party_window.index == 0 ? max : index1-1
  1198.     $game_party.battle_members_array[index1] = actor_id2
  1199.     $game_party.battle_members_array[index2] = actor_id1
  1200.     window_refresh
  1201.   end
  1202.   
  1203.   #--------------------------------------------------------------------------
  1204.   # on_party_pagedown
  1205.   #--------------------------------------------------------------------------
  1206.   def on_party_pagedown
  1207.     Sound.play_equip
  1208.     actor_id1 = @party_window.item
  1209.     actor_id2 = @party_window.next_actor.nil? ? 0 : @party_window.next_actor.id
  1210.     max = @party_window.item_max-1
  1211.     index1 = @party_window.index
  1212.     index2 = @party_window.index == max ? 0 : index1+1
  1213.     $game_party.battle_members_array[index1] = actor_id2
  1214.     $game_party.battle_members_array[index2] = actor_id1
  1215.     window_refresh
  1216.   end
  1217.   
  1218.   #--------------------------------------------------------------------------
  1219.   # on_list_cancel
  1220.   #--------------------------------------------------------------------------
  1221.   def on_list_cancel
  1222.     @party_window.activate
  1223.   end
  1224.   
  1225.   #--------------------------------------------------------------------------
  1226.   # on_list_ok
  1227.   #--------------------------------------------------------------------------
  1228.   def on_list_ok
  1229.     Sound.play_equip
  1230.     replace = $game_actors[@party_window.item]
  1231.     actor = $game_actors[@list_window.item]
  1232.     index1 = @party_window.index
  1233.     actor_id1 = actor.nil? ? 0 : actor.id
  1234.     if actor.nil?
  1235.       $game_party.battle_members_array[index1] = 0
  1236.       window_refresh
  1237.       @party_window.activate
  1238.       return
  1239.     end
  1240.     actor_id2 = replace.nil? ? 0 : replace.id
  1241.     if $game_party.battle_members_array.include?(actor_id1)
  1242.       index2 = $game_party.battle_members_array.index(actor_id1)
  1243.       $game_party.battle_members_array[index2] = actor_id2
  1244.     end
  1245.     $game_party.battle_members_array[index1] = actor_id1
  1246.     window_refresh
  1247.     @party_window.activate
  1248.   end
  1249.   
  1250. end # Scene_Party

  1251. #==============================================================================
  1252. #
  1253. # ▼ End of File
  1254. #
  1255. #==============================================================================
复制代码
摘自《暗悲传》
某人
天啊!我无骂无打怎么这么多的狗,每天都要来咬我呢?......天理何在
某人
在路上看到了许多行人说道我眼前怎么全是无肺黑心肝在行走呢?
某人
有时被整的实在是受不了,很想杀狗,看看他们的心脏是黑的吗?
某人
我很喜欢黑夜与下雨,或许我只能在虚拟世界能过上一般人的生活......
某人
无论别人无良心骂我,诅咒死,刻意整蛊......希望能坚持活着!要永远记住那些人的奸诈嘴脸!
某人
又有谁能出来主持公道呢?谁能理解你,谁能站出来说句话.....他是无辜又悲苦......这真是无聊的故事吗?
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1035
在线时间
423 小时
注册时间
2010-12-26
帖子
337
3
 楼主| 发表于 2012-8-10 08:41:43 | 只看该作者
本帖最后由 358429534 于 2012-8-11 06:51 编辑

解决上面问题............
摘自《暗悲传》
某人
天啊!我无骂无打怎么这么多的狗,每天都要来咬我呢?......天理何在
某人
在路上看到了许多行人说道我眼前怎么全是无肺黑心肝在行走呢?
某人
有时被整的实在是受不了,很想杀狗,看看他们的心脏是黑的吗?
某人
我很喜欢黑夜与下雨,或许我只能在虚拟世界能过上一般人的生活......
某人
无论别人无良心骂我,诅咒死,刻意整蛊......希望能坚持活着!要永远记住那些人的奸诈嘴脸!
某人
又有谁能出来主持公道呢?谁能理解你,谁能站出来说句话.....他是无辜又悲苦......这真是无聊的故事吗?
回复

使用道具 举报

Lv1.梦旅人

◇无限的妄想者◇

梦石
0
星屑
50
在线时间
1441 小时
注册时间
2012-7-14
帖子
2339
4
发表于 2012-8-10 21:07:22 | 只看该作者
能力有限,只能弄最后一个,脚本83~96行改为:
  1. #==============================================================================
  2. # ■ Window_PartyCommand
  3. #==============================================================================
  4. class Window_PartyCommand
  5.   #--------------------------------------------------------------------------
  6.   # ● コマンドリストの作成
  7.   #--------------------------------------------------------------------------
  8.   alias tmatbtl_window_partycommand_make_command_list make_command_list
  9.   def make_command_list
  10.     tmatbtl_window_partycommand_make_command_list
  11.     enough=true if $game_party.gold >= 100*$game_party.highest_level
  12.     add_command(Vocab::AutoBattle,   :auto,enough)
  13.     add_command(Vocab::RepeatBattle, :repeat,enough)
  14.   end
  15. end
复制代码
151~179行最后两个函数添加调用公共事件。
  1.   #--------------------------------------------------------------------------
  2.   # ○ コマンド[オート]
  3.   #--------------------------------------------------------------------------
  4.   def command_auto
  5.       $game_temp.reserve_common_event(1) #新加行
  6.       $game_party.members.each do |actor|
  7.       actor.make_auto_battle_actions if actor.inputable?
  8.       end
  9.       @party_command_window.deactivate
  10.       turn_start
  11.   end
  12.   #--------------------------------------------------------------------------
  13.   # ○ コマンド[リピート]
  14.   #--------------------------------------------------------------------------
  15.   def command_repeat
  16.     $game_temp.reserve_common_event(1) # 新加行
  17.     $game_party.members.each_with_index do |actor, i|
  18.       next unless actor.inputable?
  19.       actor.actions.clear
  20.       if !$game_temp.repeat_commands[i] || $game_temp.repeat_commands[i].empty?
  21.         $game_temp.repeat_commands[i] =
  22.           [Game_Action.new(actor).set_attack.evaluate]
  23.       end
  24.       $game_temp.repeat_commands[i].each do |action|
  25.         actor.actions.push(action.clone)
  26.         actor.actions[actor.actions.size - 1].set_attack unless action.valid?
  27.       end
  28.     end
  29.     @party_command_window.deactivate
  30.     turn_start
  31.   end  
复制代码
最后设置公共事件如下:


很纠结地完成了需求……然后表示真心无力弄其他的脚本了。
实在抱歉你要求的系统修改对我来说难度太大,应该说我根本做不到,只是简单的弄一下这个就累死了……
嗯,希望这份修改能对你有些帮助。(你那个招标我无力接单,不用再跟我说了,真的……)

评分

参与人数 1梦石 +2 收起 理由
迷糊的安安 + 2 认可答案 附赠66RPG提供的精美好人卡一张^^.

查看全部评分


————————————————————————————————————
新坑Dreamoon酝酿中,预计短篇⑨完工发布。
————————————————————————————————————
如何调戏橙光文字的 高级UI 系列教程:  鉴赏页制作篇背包系统制作篇
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1035
在线时间
423 小时
注册时间
2010-12-26
帖子
337
5
 楼主| 发表于 2012-8-11 09:53:05 | 只看该作者
幻想中的鸡蛋 发表于 2012-8-10 21:07
能力有限,只能弄最后一个,脚本83~96行改为:151~179行最后两个函数添加调用公共事件。最后设置公共事件如 ...

过几天我冲VIP转账给你吧!这帖就不结贴了!
我代表全国人民感谢你的劳苦付出!辛苦了!
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-3 16:18

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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