pigu_6

KGC Large Party

Apr 19th, 2013
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 95.02 KB | None | 0 0
  1. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
  2. #_/ —† Party Expansion & Formation - KGC_LargeParty —† VX —†
  3. #_/ —‡ Last Update: 2008/04/27 —‡
  4. #_/ —† Translation by Mr. Anonymous —†
  5. #_/-----------------------------------------------------------------------------
  6. #_/ This script allows you more control over the default "party" system by
  7. #_/ removing the limitation of only having four actors to a party. These
  8. #_/ extra actors may behave just as any other actor during battle. In addition
  9. #_/ you may also have "standby" actors, who can be swapped out with the
  10. #_/ current party via a "Party Formation" screen, which may optionally be
  11. #_/ added into the main menu panel, and/or even called from pressing
  12. #_/ a specified button while on the main menu.
  13. #_/-----------------------------------------------------------------------------
  14. #_/ —† 2008/04/27 UPDATE [KGC] —†
  15. #_/ Updated for KGC_CursorAnimation compatibility.
  16. #_/=============================================================================
  17. #_/ —† Instructions For Usage —†
  18. #_/ —† Script Commands —†
  19. #_/ These commands are used in "Script" function in the third page of event
  20. #_/ commands under "Advanced".
  21. #_/
  22. #_/ * call_partyform
  23. #_/ Calls the Party Formation screen.
  24. #_/
  25. #_/ * set_max_battle_member_count(Value)
  26. #_/ Allows you to manually set the maximum amount of actors in the active
  27. #_/ party, i.e. the amount of party members who may participate in battle.
  28. #_/
  29. #_/ * party_full?
  30. #_/ Used for Conditional Branches. This allows you to determine wether the
  31. #_/ active party is full in accordance to MAX_BATTLE_MEMBERS or the above
  32. #_/ manual statement of set_max_battle_member_count(Value).
  33. #_/
  34. #_/ * permit_partyform(true/false)
  35. #_/ Allows you to enable or disable the Party Formation screen on the main
  36. #_/ command menu. This also actives or deactivates PARTYFORM_SWITCH.
  37. #_/
  38. #_/ * fix_actor(ActorID, true/false)
  39. #_/ Allows you to fix or force an actor into remaining in the active party
  40. #_/ and not be switched out with a standby actor. If the true/false
  41. #_/ argument is omitted, the statement is automatically considered true.
  42. #_/
  43. #_/ * change_party_shift(index1, index2)
  44. #_/ This allows you to switch an actor in the position of index1 with the
  45. #_/ actor in the position of index2. This ignores the fix_actor function.
  46. #_/ Also of note is that the first actor in the party actually has an
  47. #_/ index of 0, second actor has an index of 1, and so on.
  48. #_/
  49. #_/ * sort_party_member(sort_type, true/false)
  50. #_/ This allows you to manually sort the actors by replacing sort_type with
  51. #_/ SORT_BY_ID, SORT_BY_NAME, or SORT_BY_LEVEL. If you set the second
  52. #_/ argument to true, the sorting order is reversed. If true, it is not.
  53. #_/ Also, if the second argument is omitted, it is automatically false.
  54. #_/
  55. #_/ * get_stand_by_member_ids
  56. #_/ This aquires the arrangement of the ActorIDs of the standby actors.
  57. #_/
  58. #_/ * stand_by_member?(ActorID)
  59. #_/ Used for Conditional Branches. This allows you to determine if the actor
  60. #_/ specified is a standby party member.
  61. #_/
  62. #_/ * add_battle_member(ActorID, index)
  63. #_/ Allows you to add an actor to the active party and place it in the
  64. #_/ desired position(index). If the second argument is omitted, the actor
  65. #_/ will automatically be placed at the end of the party. Also, if the
  66. #_/ active party is full, the actor will not be added.
  67. #_/
  68. #_/ * remove_battle_member(ActorID)
  69. #_/ Removes an actor from the active party. This cannot removed an actor
  70. #_/ who is fixed into place using fix_actor.
  71. #_/
  72. #_/ * remove_all_battle_member
  73. #_/ All actors other than fixed actors are removed from the active party.
  74. #_/ Note that this seems to unfix fixed characters, but not remove them.
  75. #_/ Also note that if there are no fixed actors, you must add a member
  76. #_/ back into the active party using add_battle_member BEFORE the player
  77. #_/ is allowed to open the menu or enter battle.
  78. #_/
  79. #_/ * random_launch
  80. #_/ Randomly sorts and replaces the active party with those from the standby
  81. #_/ party. Once again this does not effect fixed actors.
  82. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
  83. #_/ A special note from the translator: I'll be revising this translation for
  84. #_/ a more user-friendly approach and expanded functionality explainations
  85. #_/ when I have the time. If you don't understand something here now, fear not,
  86. #_/ as this is only a beta translation. As such, some things may be incorrect.
  87. #_/ however, it should work without a hitch, with the possible exception of
  88. #_/ SHOW_STAND_BY_MEMBER_NOT_IN_BATTLE, which I still cannot figure out.
  89. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
  90.  
  91. #==============================================================================#
  92. # ˜… Customization ˜… #
  93. #==============================================================================#
  94.  
  95. module KGC
  96. module LargeParty
  97. # —† Party Formation In-Game Switch —†
  98. # This allows you to assign an in-game Switch that allows you to enable or
  99. # disable the Party Formation screen on the main command menu.
  100. PARTYFORM_SWITCH = 3
  101. # —† Party Formation In-Game Switch (In Combat) —†
  102. # This allows you to assign an in-game Switch that allows you to enable or
  103. # disable the Party Formation screen during combat.
  104. BATTLE_PARTYFORM_SWITCH = 4
  105. # —† Default Party Formation Switch Activation Toggle —†
  106. # When "New Game" is selected, both party formation permission switches
  107. # automatically become active (ON) when this is set as true.
  108. DEFAULT_PARTYFORM_ENABLED = false
  109.  
  110. # —† Maximum Party Members (In Combat) —†
  111. # Allows you to choose how many actors may participate in a battle.
  112. MAX_BATTLE_MEMBERS = 4
  113. # —† The Party Members —†
  114. # Allows you to choose how many actors may be added to the party.
  115. # *Note: Game_Party::MAX_MEMBERS Is overwritten
  116. # When making this 100 or more, you'll receive an error.
  117. MAX_MEMBERS = 99
  118.  
  119. # —† Fixed Party Member Sorting —†
  120. # This toggle allows you to enable/disable automatic sorting of fixed(active)
  121. # party members.
  122. # true = Disable automatic sorting.
  123. # false = Enable automatic sorting.
  124. FORBID_CHANGE_SHIFT_FIXED = false
  125.  
  126. # Standby Members Background Color
  127. # Default: Color.new(0, 0, 0, 0)
  128. STAND_BY_COLOR = Color.new(0, 0, 0, 128)
  129. # —† Fixed Current Party Background Color
  130. FIXED_COLOR = Color.new(255, 128, 64, 96)
  131. # Background Color that shows when Members are selected.
  132. SELECTED_COLOR = Color.new(64, 255, 128, 128)
  133.  
  134. # —† Party Formation Command Menu Selection —†
  135. # This allows you to change the key/button pressed in the menu screen to
  136. # pull up the Party Formation screen without actually highlighting and
  137. # selecting the Party Formation option.
  138. # If this is set as nil, this function is disabled.
  139. MENU_PARTYFORM_BUTTON = Input::A
  140. # This toggle allows you to enable/disable the Party Formation option on the
  141. # main command window.
  142. # true = The option is enabled.
  143. # false = The option is removed.
  144. USE_MENU_PARTYFORM_COMMAND = false
  145. # This allows you to change the text displayed for the Party Formation option
  146. # in the main command window.
  147. VOCAB_MENU_PARTYFORM = "Party"
  148.  
  149. # This toggle allows you to enable/disable the Party Formation option while
  150. # in combat.
  151. # This option is added under the "Run" or "Escape" command.
  152. USE_BATTLE_PARTYFORM = false
  153. # This allows you to change the text displayed for the Party Formation option
  154. # while in combat under the "Run" or "Escape" command.
  155. VOCAB_BATTLE_PARTYFORM = "Party"
  156.  
  157. # —† Party Formation Screen Character Dimensions —†
  158. # This allows you to change the width and height of the actors' placemarkers
  159. # on the Party Formation Screen.
  160. # You can rewrite this [x, y] in accordance to the size of your actor's
  161. # walking graphic.
  162. PARTY_FORM_CHARACTER_SIZE = [40, 48]
  163. # This allows you to change the text of the empty slots in the Party
  164. # Formation Screen.
  165. BATTLE_MEMBER_BLANK_TEXT = "EMPTY"
  166. # —† Party Formation Screen Member Rows —†
  167. # This allows you to change the amount of rows that in the "Standby"
  168. # box.
  169. # Adjust this value to 1 if the status window protrudes beyond the screen.
  170. PARTY_MEMBER_WINDOW_ROW_MAX = 2
  171. # —† Current Party Member Display —†
  172. # This toggle allows you to show/hide the current party members in the
  173. # "Standby" box.
  174. # true = Show them! These will be greyed out.
  175. # false = Hide them.
  176. SHOW_BATTLE_MEMBER_IN_PARTY = false
  177. # This allows you to change the text displayed for empty slots on in the
  178. # "Current Party" box.
  179. PARTY_MEMBER_BLANK_TEXT = "-"
  180.  
  181. # —† Width of caption window on organization screen
  182. CAPTION_WINDOW_WIDTH = 192
  183. # —† Caption of combat member window on organization screen
  184. BATTLE_MEMBER_CAPTION = "Current Party"
  185.  
  186. if SHOW_BATTLE_MEMBER_IN_PARTY
  187. # This allows you to change the text that appears on top of the Party
  188. # Formation box.
  189. # (When SHOW_BATTLE_MEMBER_IN_PARTY = true)
  190. PARTY_MEMBER_CAPTION = "Party Formation"
  191. else
  192. # This allows you to change the text that appears on top of the Standby
  193. # box.
  194. # (When SHOW_BATTLE_MEMBER_IN_PARTY = false)
  195. PARTY_MEMBER_CAPTION = "Standby"
  196. end
  197.  
  198. # —† Width of Formation Confirmation Window —†
  199. CONFIRM_WINDOW_WIDTH = 160
  200. # —† Vocab Strings for Formation Confirmation Window —†
  201. # If the order of these commands are changed or something is removed, expect
  202. # an error.
  203. CONFIRM_WINDOW_COMMANDS = ["Done", "Cancel"]
  204.  
  205. # —† Equip Item Status Shop Scroll —†
  206. # This allows you to change the key/button HELD DOWN while using the Up and
  207. # Down keys to scroll the attribute bonuses window (to the right) to view
  208. # the each individual unit's attribute bonuses. KCG_HelpExtension is
  209. # required for this function to work properly.
  210. # If you set this to nil, this function is disabled.
  211. SHOP_STATUS_SCROLL_BUTTON = Input::A
  212.  
  213. # —† Standby Members Experience Gain Percentage —†
  214. # If you enter 500 in this, the actual EXP gained is 50.0%
  215. # You may also prevent standby units from gaining EXP by setting this is 0.
  216. STAND_BY_EXP_RATE = 500
  217. # —† Standby Members Level-Up Message —†
  218. # This toggle allows you to enable/disable the level-up messages displayed
  219. # for units on standby.
  220. # true = Show level-up messages for standby units.
  221. # false = Hide level-up messages for standby units.
  222. SHOW_STAND_BY_LEVEL_UP = true
  223. # —† Standby Members Combat Display —†
  224. # *Note: I cannot figure out what this actually does. It doesn't -seem- to
  225. # work as advertised, but I could be wrong. If anyone figures out what this
  226. # actually does, please let me know.
  227. # true : All members are displayed during combat.
  228. # false : Exchanged standby members are not shown.
  229. SHOW_STAND_BY_MEMBER_NOT_IN_BATTLE = false
  230. end
  231. end
  232.  
  233. $imported = {} if $imported == nil
  234. $imported["LargeParty"] = true
  235.  
  236. #==============================================================================
  237. # –¡ KGC::Commands
  238. #==============================================================================
  239.  
  240. module KGC::Commands
  241. # メンバーのソート形式
  242. SORT_BY_ID = 0 # IDé †
  243. SORT_BY_NAME = 1 # åå‰é †
  244. SORT_BY_LEVEL = 2 # ãƒ¬ãƒ™ãƒ«é †
  245.  
  246. module_function
  247. #--------------------------------------------------------------------------
  248. # —‹ パーティ編成画面の呼び出し
  249. #--------------------------------------------------------------------------
  250. def call_partyform
  251. return if $game_temp.in_battle
  252. $game_temp.next_scene = :partyform
  253. end
  254. #--------------------------------------------------------------------------
  255. # —‹ 戦闘メンバー最大数を設定
  256. # value : 人数 (çœç•¥ã—ãŸå ´åˆã¯ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆå€¤ã‚’ä½¿ç”¨)
  257. #--------------------------------------------------------------------------
  258. def set_max_battle_member_count(value = nil)
  259. $game_party.max_battle_member_count = value
  260. end
  261. #--------------------------------------------------------------------------
  262. # —‹ パーティ人数が一杯か
  263. #--------------------------------------------------------------------------
  264. def party_full?
  265. return $game_party.full?
  266. end
  267. #--------------------------------------------------------------------------
  268. # —‹ パーティ編成可否を設定
  269. # enabled : 有効フラグ (省略時 : true)
  270. #--------------------------------------------------------------------------
  271. def permit_partyform(enabled = true)
  272. $game_switches[KGC::LargeParty::PARTYFORM_SWITCH] = enabled
  273. end
  274. #--------------------------------------------------------------------------
  275. # —‹ 戦闘中のパーティ編成可否を設定
  276. # enabled : 有効フラグ (省略時 : true)
  277. #--------------------------------------------------------------------------
  278. def permit_battle_partyform(enabled = true)
  279. $game_switches[KGC::LargeParty::BATTLE_PARTYFORM_SWITCH] = enabled
  280. end
  281. #--------------------------------------------------------------------------
  282. # —‹ アクターの固定状態を設定
  283. # actor_id : アクター ID
  284. # fixed : 固定フラグ (省略時 : true)
  285. #--------------------------------------------------------------------------
  286. def fix_actor(actor_id, fixed = true)
  287. $game_party.fix_actor(actor_id, fixed)
  288. end
  289. #--------------------------------------------------------------------------
  290. # —‹ 並び替え
  291. # メンバーの index1 番目と index2 番目を入れ替える
  292. #--------------------------------------------------------------------------
  293. def change_party_shift(index1, index2)
  294. $game_party.change_shift(index1, index2)
  295. end
  296. #--------------------------------------------------------------------------
  297. # —‹ メンバー整列 (æ˜‡é †)
  298. # sort_type : ソート形式 (SORT_BY_xxx)
  299. # reverse : true ã ã¨é™é †
  300. #--------------------------------------------------------------------------
  301. def sort_party_member(sort_type = SORT_BY_ID, reverse = false)
  302. $game_party.sort_member(sort_type, reverse)
  303. end
  304. #--------------------------------------------------------------------------
  305. # —‹ 待機メンバーの ID を取得
  306. #--------------------------------------------------------------------------
  307. def get_stand_by_member_ids
  308. result = []
  309. $game_party.stand_by_members.each { |actor| result << actor.id }
  310. return result
  311. end
  312. #--------------------------------------------------------------------------
  313. # —‹ アクターが待機メンバーか
  314. # actor_id : アクター ID
  315. #--------------------------------------------------------------------------
  316. def stand_by_member?(actor_id)
  317. return get_stand_by_member_ids.include?(actor_id)
  318. end
  319. #--------------------------------------------------------------------------
  320. # —‹ ã‚¢ã‚¯ã‚¿ãƒ¼ã‚’æˆ¦é—˜ãƒ¡ãƒ³ãƒãƒ¼ã«åŠ ãˆã‚‹
  321. # actor_id : アクター ID
  322. # index : è¿½åŠ ä½ç½® (省略時は最後尾)
  323. #--------------------------------------------------------------------------
  324. def add_battle_member(actor_id, index = nil)
  325. $game_party.add_battle_member(actor_id, index)
  326. end
  327. #--------------------------------------------------------------------------
  328. # —‹ アクターを戦闘メンバーから外す
  329. # actor_id : アクター ID
  330. #--------------------------------------------------------------------------
  331. def remove_battle_member(actor_id)
  332. $game_party.remove_battle_member(actor_id)
  333. end
  334. #--------------------------------------------------------------------------
  335. # —‹ 固定アクター以外を戦闘メンバーから外す
  336. #--------------------------------------------------------------------------
  337. def remove_all_battle_member
  338. $game_party.all_members.each { |actor|
  339. $game_party.remove_battle_member(actor.id)
  340. }
  341. end
  342. #--------------------------------------------------------------------------
  343. # —‹ ランダム出撃
  344. #--------------------------------------------------------------------------
  345. def random_launch
  346. new_battle_members = $game_party.fixed_members
  347. candidates = $game_party.all_members - new_battle_members
  348. num = [$game_party.max_battle_member_count - new_battle_members.size,
  349. candidates.size].min
  350. return if num <= 0
  351.  
  352. # ランダムに選ぶ
  353. ary = (0...candidates.size).to_a.sort_by { rand }
  354. ary[0...num].each { |i| new_battle_members << candidates[i] }
  355. $game_party.set_battle_member(new_battle_members)
  356. end
  357. end
  358.  
  359. class Game_Interpreter
  360. include KGC::Commands
  361. end
  362.  
  363. # ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜…
  364.  
  365. #==============================================================================
  366. # – Vocab
  367. #==============================================================================
  368.  
  369. module Vocab
  370. # 「パーティ編成」コマンド名 (メニュー)
  371. def self.partyform
  372. return KGC::LargeParty::VOCAB_MENU_PARTYFORM
  373. end
  374.  
  375. # 「パーティ編成」コマンド名 (戦闘)
  376. def self.partyform_battle
  377. return KGC::LargeParty::VOCAB_BATTLE_PARTYFORM
  378. end
  379. end
  380.  
  381. # ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜…
  382.  
  383. #==============================================================================
  384. # – Game_Actor
  385. #==============================================================================
  386.  
  387. class Game_Actor < Game_Battler
  388. #--------------------------------------------------------------------------
  389. # —‹ パーティ内インデックス取得
  390. #--------------------------------------------------------------------------
  391. def party_index
  392. return $game_party.all_members.index(self)
  393. end
  394. #--------------------------------------------------------------------------
  395. # —‹ 戦闘メンバーか判定
  396. #--------------------------------------------------------------------------
  397. def battle_member?
  398. return $game_party.battle_members.include?(self)
  399. end
  400. #--------------------------------------------------------------------------
  401. # —‹ 固定メンバーか判定
  402. #--------------------------------------------------------------------------
  403. def fixed_member?
  404. return $game_party.fixed_members.include?(self)
  405. end
  406. end
  407.  
  408. # ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜…
  409.  
  410. #==============================================================================
  411. # – Game_Party
  412. #==============================================================================
  413.  
  414. class Game_Party
  415. #--------------------------------------------------------------------------
  416. # — 定数
  417. #--------------------------------------------------------------------------
  418. MAX_MEMBERS = KGC::LargeParty::MAX_MEMBERS # 最大パーティ人数
  419. #--------------------------------------------------------------------------
  420. # — オブジェクト初期化
  421. #--------------------------------------------------------------------------
  422. alias initialize_KGC_LargeParty initialize
  423. def initialize
  424. initialize_KGC_LargeParty
  425.  
  426. @max_battle_member_count = nil
  427. @battle_member_count = 0
  428. @fixed_actors = []
  429. end
  430. #--------------------------------------------------------------------------
  431. # —‹ 戦闘メンバー最大数取得
  432. #--------------------------------------------------------------------------
  433. def max_battle_member_count
  434. if @max_battle_member_count == nil
  435. return KGC::LargeParty::MAX_BATTLE_MEMBERS
  436. else
  437. return @max_battle_member_count
  438. end
  439. end
  440. #--------------------------------------------------------------------------
  441. # —‹ 戦闘メンバー最大数変更
  442. #--------------------------------------------------------------------------
  443. def max_battle_member_count=(value)
  444. if value.is_a?(Integer)
  445. value = [value, 1].max
  446. end
  447. @max_battle_member_count = value
  448. end
  449. #--------------------------------------------------------------------------
  450. # —‹ 戦闘メンバー数取得
  451. #--------------------------------------------------------------------------
  452. def battle_member_count
  453. if @battle_member_count == nil
  454. @battle_member_count = @actors.size
  455. end
  456. @battle_member_count =
  457. [@battle_member_count, @actors.size, max_battle_member_count].min
  458. return @battle_member_count
  459. end
  460. #--------------------------------------------------------------------------
  461. # —‹ 戦闘メンバー数設定
  462. #--------------------------------------------------------------------------
  463. def battle_member_count=(value)
  464. @battle_member_count = [[value, 0].max,
  465. @actors.size, max_battle_member_count].min
  466. end
  467. #--------------------------------------------------------------------------
  468. # — メンバーの取得
  469. #--------------------------------------------------------------------------
  470. alias members_KGC_LargeParty members
  471. def members
  472. if $game_temp.in_battle ||
  473. !KGC::LargeParty::SHOW_STAND_BY_MEMBER_NOT_IN_BATTLE
  474. return battle_members
  475. else
  476. return members_KGC_LargeParty
  477. end
  478. end
  479. #--------------------------------------------------------------------------
  480. # —‹ 全メンバーの取得
  481. #--------------------------------------------------------------------------
  482. def all_members
  483. return members_KGC_LargeParty
  484. end
  485. #--------------------------------------------------------------------------
  486. # —‹ 戦闘メンバーの取得
  487. #--------------------------------------------------------------------------
  488. def battle_members
  489. result = []
  490. battle_member_count.times { |i| result << $game_actors[@actors[i]] }
  491. return result
  492. end
  493. #--------------------------------------------------------------------------
  494. # —‹ 待機メンバーの取得
  495. #--------------------------------------------------------------------------
  496. def stand_by_members
  497. return (all_members - battle_members)
  498. end
  499. #--------------------------------------------------------------------------
  500. # —‹ 固定メンバーの取得
  501. #--------------------------------------------------------------------------
  502. def fixed_members
  503. result = []
  504. @fixed_actors.each { |i| result << $game_actors[i] }
  505. return result
  506. end
  507. #--------------------------------------------------------------------------
  508. # — 初期パーティのセットアップ
  509. #--------------------------------------------------------------------------
  510. alias setup_starting_members_KGC_LargeParty setup_starting_members
  511. def setup_starting_members
  512. setup_starting_members_KGC_LargeParty
  513.  
  514. self.battle_member_count = @actors.size
  515. end
  516. #--------------------------------------------------------------------------
  517. # — 戦闘テスト用パーティのセットアップ
  518. #--------------------------------------------------------------------------
  519. alias setup_battle_test_members_KGC_LargeParty setup_battle_test_members
  520. def setup_battle_test_members
  521. setup_battle_test_members_KGC_LargeParty
  522.  
  523. self.battle_member_count = @actors.size
  524. end
  525. #--------------------------------------------------------------------------
  526. # —‹ メンバーの新規設定
  527. # new_member : 新しいメンバー
  528. #--------------------------------------------------------------------------
  529. def set_member(new_member)
  530. @actors = []
  531. new_member.each { |actor| @actors << actor.id }
  532. end
  533. #--------------------------------------------------------------------------
  534. # —‹ 戦闘メンバーの新規設定
  535. # new_member : 新しい戦闘メンバー
  536. #--------------------------------------------------------------------------
  537. def set_battle_member(new_member)
  538. new_battle_member = []
  539. new_member.each { |actor|
  540. @actors.delete(actor.id)
  541. new_battle_member << actor.id
  542. }
  543. @actors = new_battle_member + @actors
  544. self.battle_member_count = new_member.size
  545. end
  546. #--------------------------------------------------------------------------
  547. # —‹ パーティ編成を許可しているか判定
  548. #--------------------------------------------------------------------------
  549. def partyform_enable?
  550. return $game_switches[KGC::LargeParty::PARTYFORM_SWITCH]
  551. end
  552. #--------------------------------------------------------------------------
  553. # —‹ 戦闘中のパーティ編成を許可しているか判定
  554. #--------------------------------------------------------------------------
  555. def battle_partyform_enable?
  556. return false unless partyform_enable?
  557. return $game_switches[KGC::LargeParty::BATTLE_PARTYFORM_SWITCH]
  558. end
  559. #--------------------------------------------------------------------------
  560. # —‹ メンバーが一杯か判定
  561. #--------------------------------------------------------------------------
  562. def full?
  563. return (@actors.size >= MAX_MEMBERS)
  564. end
  565. #--------------------------------------------------------------------------
  566. # —‹ 固定アクターか判定
  567. # actor_id : 判定するアクターの ID
  568. #--------------------------------------------------------------------------
  569. def actor_fixed?(actor_id)
  570. return @fixed_actors.include?(actor_id)
  571. end
  572. #--------------------------------------------------------------------------
  573. # — ã‚¢ã‚¯ã‚¿ãƒ¼ã‚’åŠ ãˆã‚‹
  574. # actor_id : アクター ID
  575. #--------------------------------------------------------------------------
  576. alias add_actor_KGC_LargeParty add_actor
  577. def add_actor(actor_id)
  578. last_size = @actors.size
  579.  
  580. add_actor_KGC_LargeParty(actor_id)
  581.  
  582. if last_size < @actors.size
  583. self.battle_member_count += 1
  584. end
  585. end
  586. #--------------------------------------------------------------------------
  587. # —‹ ã‚¢ã‚¯ã‚¿ãƒ¼ã‚’æˆ¦é—˜ãƒ¡ãƒ³ãƒãƒ¼ã«åŠ ãˆã‚‹
  588. # actor_id : アクター ID
  589. # index : è¿½åŠ ä½ç½® (省略時は最後尾)
  590. #--------------------------------------------------------------------------
  591. def add_battle_member(actor_id, index = nil)
  592. return unless @actors.include?(actor_id) # パーティにいない
  593. if index == nil
  594. return if battle_members.include?($game_actors[actor_id]) # 出撃済み
  595. return if battle_member_count == max_battle_member_count # 人数が最大
  596. index = battle_member_count
  597. end
  598.  
  599. @actors.delete(actor_id)
  600. @actors.insert(index, actor_id)
  601. self.battle_member_count += 1
  602. end
  603. #--------------------------------------------------------------------------
  604. # —‹ アクターを戦闘メンバーから外す
  605. # actor_id : アクター ID
  606. #--------------------------------------------------------------------------
  607. def remove_battle_member(actor_id)
  608. return unless @actors.include?(actor_id) # パーティにいない
  609. return if actor_fixed?(actor_id) # 固定済み
  610. return if stand_by_members.include?($game_actors[actor_id]) # 待機中
  611.  
  612. @actors.delete(actor_id)
  613. @actors.push(actor_id)
  614. self.battle_member_count -= 1
  615. end
  616. #--------------------------------------------------------------------------
  617. # —‹ アクターの固定状態を設定
  618. # actor_id : アクター ID
  619. # fixed : 固定フラグ (省略時 : false)
  620. #--------------------------------------------------------------------------
  621. def fix_actor(actor_id, fixed = false)
  622. return unless @actors.include?(actor_id) # パーティにいない
  623.  
  624. if fixed
  625. # 固定
  626. unless @fixed_actors.include?(actor_id)
  627. @fixed_actors << actor_id
  628. unless battle_members.include?($game_actors[actor_id])
  629. self.battle_member_count += 1
  630. end
  631. end
  632. # 強制出撃
  633. apply_force_launch
  634. else
  635. # 固定解除
  636. @fixed_actors.delete(actor_id)
  637. end
  638. $game_player.refresh
  639. end
  640. #--------------------------------------------------------------------------
  641. # —‹ 強制出撃適用
  642. #--------------------------------------------------------------------------
  643. def apply_force_launch
  644. while (fixed_members - battle_members).size > 0
  645. # 固定状態でないメンバーを適当に持ってきて入れ替え
  646. actor1 = stand_by_members.find { |a| @fixed_actors.include?(a.id) }
  647. actor2 = battle_members.reverse.find { |a| !@fixed_actors.include?(a.id) }
  648. index1 = @actors.index(actor1.id)
  649. index2 = @actors.index(actor2.id)
  650. @actors[index1], @actors[index2] = @actors[index2], @actors[index1]
  651.  
  652. # 戦闘メンバーが全員固定されたら戻る (無限ループ防止)
  653. all_fixed = true
  654. battle_members.each { |actor|
  655. unless actor.fixed_member?
  656. all_fixed = false
  657. break
  658. end
  659. }
  660. break if all_fixed
  661. end
  662. end
  663. #--------------------------------------------------------------------------
  664. # —‹ メンバー整列 (æ˜‡é †)
  665. # sort_type : ソート形式 (SORT_BY_xxx)
  666. # reverse : true ã ã¨é™é †
  667. #--------------------------------------------------------------------------
  668. def sort_member(sort_type = KGC::Commands::SORT_BY_ID,
  669. reverse = false)
  670. # バッファを準備
  671. b_actors = battle_members
  672. actors = all_members - b_actors
  673. f_actors = fixed_members
  674. # 固定キャラはソートしない
  675. if KGC::LargeParty::FORBID_CHANGE_SHIFT_FIXED
  676. actors -= f_actors
  677. b_actors -= f_actors
  678. end
  679.  
  680. # ソート
  681. case sort_type
  682. when KGC::Commands::SORT_BY_ID # IDé †
  683. actors.sort! { |a, b| a.id <=> b.id }
  684. b_actors.sort! { |a, b| a.id <=> b.id }
  685. when KGC::Commands::SORT_BY_NAME # åå‰é †
  686. actors.sort! { |a, b| a.name <=> b.name }
  687. b_actors.sort! { |a, b| a.name <=> b.name }
  688. when KGC::Commands::SORT_BY_LEVEL # ãƒ¬ãƒ™ãƒ«é †
  689. actors.sort! { |a, b| a.level <=> b.level }
  690. b_actors.sort! { |a, b| a.level <=> b.level }
  691. end
  692. # 反転
  693. if reverse
  694. actors.reverse!
  695. b_actors.reverse!
  696. end
  697.  
  698. # å›ºå®šã‚­ãƒ£ãƒ©ã‚’å…ˆé ­ã«æŒã£ã¦ãã‚‹
  699. if KGC::LargeParty::FORBID_CHANGE_SHIFT_FIXED
  700. actors = f_actors + actors
  701. b_actors = f_actors + b_actors
  702. end
  703.  
  704. # 復帰
  705. set_member(actors)
  706. set_battle_member(b_actors)
  707.  
  708. apply_force_launch
  709. $game_player.refresh
  710. end
  711. #--------------------------------------------------------------------------
  712. # —‹ 並び替え
  713. # 戦闘メンバーの index1 番目と index2 番目を入れ替える
  714. #--------------------------------------------------------------------------
  715. def change_shift(index1, index2)
  716. size = @actors.size
  717. if index1 >= size || index2 >= size
  718. return
  719. end
  720. buf = @actors[index1]
  721. @actors[index1] = @actors[index2]
  722. @actors[index2] = buf
  723. $game_player.refresh
  724. end
  725. #--------------------------------------------------------------------------
  726. # — 戦闘用ステートの解除 (戦闘終了時に呼び出し)
  727. #--------------------------------------------------------------------------
  728. def remove_states_battle
  729. for actor in all_members
  730. actor.remove_states_battle
  731. end
  732. end
  733. end
  734.  
  735. # ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜…
  736.  
  737. #==============================================================================
  738. # – Window_Command
  739. #==============================================================================
  740.  
  741. class Window_Command < Window_Selectable
  742. unless method_defined?(:add_command)
  743. #--------------------------------------------------------------------------
  744. # —‹ コマンドを追åŠ
  745. # è¿½åŠ ã—ãŸä½ç½®ã‚’è¿”ã™
  746. #--------------------------------------------------------------------------
  747. def add_command(command)
  748. @commands << command
  749. @item_max = @commands.size
  750. item_index = @item_max - 1
  751. refresh_command
  752. draw_item(item_index)
  753. return item_index
  754. end
  755. #--------------------------------------------------------------------------
  756. # —‹ コマンドをリフレッシュ
  757. #--------------------------------------------------------------------------
  758. def refresh_command
  759. buf = self.contents.clone
  760. self.height = [self.height, row_max * WLH + 32].max
  761. create_contents
  762. self.contents.blt(0, 0, buf, buf.rect)
  763. buf.dispose
  764. end
  765. #--------------------------------------------------------------------------
  766. # —‹ コマンドを挿入
  767. #--------------------------------------------------------------------------
  768. def insert_command(index, command)
  769. @commands.insert(index, command)
  770. @item_max = @commands.size
  771. refresh_command
  772. refresh
  773. end
  774. #--------------------------------------------------------------------------
  775. # —‹ コマンドを削除
  776. #--------------------------------------------------------------------------
  777. def remove_command(command)
  778. @commands.delete(command)
  779. @item_max = @commands.size
  780. refresh
  781. end
  782. end
  783. end
  784.  
  785. # ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜…
  786.  
  787. #==============================================================================
  788. # – Window_MenuStatus
  789. #==============================================================================
  790.  
  791. class Window_MenuStatus < Window_Selectable
  792. #--------------------------------------------------------------------------
  793. # — 定数
  794. #--------------------------------------------------------------------------
  795. STATUS_HEIGHT = 96 # ステータス一人分の高さ
  796. #--------------------------------------------------------------------------
  797. # — ウィンドウ内容の作成
  798. #--------------------------------------------------------------------------
  799. def create_contents
  800. self.contents.dispose
  801. self.contents = Bitmap.new(width - 32,
  802. [height - 32, row_max * STATUS_HEIGHT].max)
  803. end
  804. #--------------------------------------------------------------------------
  805. # — å…ˆé ­ã®è¡Œã®å–å¾—
  806. #--------------------------------------------------------------------------
  807. def top_row
  808. return self.oy / STATUS_HEIGHT
  809. end
  810. #--------------------------------------------------------------------------
  811. # — å…ˆé ­ã®è¡Œã®è¨­å®š
  812. # row : å…ˆé ­ã«è¡¨ç¤ºã™ã‚‹è¡Œ
  813. #--------------------------------------------------------------------------
  814. def top_row=(row)
  815. super(row)
  816. self.oy = self.oy / WLH * STATUS_HEIGHT
  817. end
  818. #--------------------------------------------------------------------------
  819. # — 1 ページに表示できる行数の取得
  820. #--------------------------------------------------------------------------
  821. def page_row_max
  822. return (self.height - 32) / STATUS_HEIGHT
  823. end
  824. #--------------------------------------------------------------------------
  825. # — é …ç›®ã‚’æç”»ã™ã‚‹çŸ©å½¢ã®å–å¾—
  826. # index : é …ç›®ç•ªå·
  827. #--------------------------------------------------------------------------
  828. def item_rect(index)
  829. rect = super(index)
  830. rect.height = STATUS_HEIGHT
  831. rect.y = index / @column_max * STATUS_HEIGHT
  832. return rect
  833. end
  834. #--------------------------------------------------------------------------
  835. # — リフレッシュ
  836. #--------------------------------------------------------------------------
  837. def refresh
  838. @item_max = $game_party.members.size
  839. create_contents
  840. fill_stand_by_background
  841. draw_member
  842. end
  843. #--------------------------------------------------------------------------
  844. # —‹ パーティメンバー描画
  845. #--------------------------------------------------------------------------
  846. def draw_member
  847. for actor in $game_party.members
  848. draw_actor_face(actor, 2, actor.party_index * 96 + 2, 92)
  849. x = 104
  850. y = actor.party_index * 96 + WLH / 2
  851. draw_actor_name(actor, x, y)
  852. draw_actor_class(actor, x + 120, y)
  853. draw_actor_level(actor, x, y + WLH * 1)
  854. draw_actor_state(actor, x, y + WLH * 2)
  855. draw_actor_hp(actor, x + 120, y + WLH * 1)
  856. draw_actor_mp(actor, x + 120, y + WLH * 2)
  857. end
  858. end
  859. #--------------------------------------------------------------------------
  860. # —‹ 待機メンバーの背景色を塗る
  861. #--------------------------------------------------------------------------
  862. def fill_stand_by_background
  863. color = KGC::LargeParty::STAND_BY_COLOR
  864. dy = STATUS_HEIGHT * $game_party.battle_members.size
  865. dh = STATUS_HEIGHT * $game_party.stand_by_members.size
  866. if dh > 0
  867. self.contents.fill_rect(0, dy, self.width - 32, dh, color)
  868. end
  869. end
  870. #--------------------------------------------------------------------------
  871. # — カーソルの更新
  872. #--------------------------------------------------------------------------
  873. def update_cursor
  874. if @index < 0 # カーソルなし
  875. self.cursor_rect.empty
  876. elsif @index < @item_max # 通常
  877. super
  878. elsif @index >= 100 # 自分
  879. self.cursor_rect.set(0, (@index - 100) * STATUS_HEIGHT,
  880. contents.width, STATUS_HEIGHT)
  881. else # 全体
  882. self.cursor_rect.set(0, 0, contents.width, @item_max * STATUS_HEIGHT)
  883. end
  884. end
  885. end
  886.  
  887. # ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜…
  888.  
  889. #==============================================================================
  890. # – Window_ShopStatus
  891. #==============================================================================
  892.  
  893. class Window_ShopStatus < Window_Base
  894. #--------------------------------------------------------------------------
  895. # — ウィンドウ内容の作成
  896. #--------------------------------------------------------------------------
  897. def create_contents
  898. self.contents.dispose
  899. self.contents = Bitmap.new(width - 32,
  900. WLH * ($game_party.members.size + 1) * 2)
  901. end
  902. end
  903.  
  904. # ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜…
  905.  
  906. #==============================================================================
  907. # – Window_BattleStatus
  908. #==============================================================================
  909.  
  910. class Window_BattleStatus < Window_Selectable
  911. #--------------------------------------------------------------------------
  912. # — ウィンドウ内容の作成
  913. #--------------------------------------------------------------------------
  914. def create_contents
  915. self.contents.dispose
  916. self.contents = Bitmap.new(width - 32,
  917. [WLH * $game_party.members.size, height - 32].max)
  918. end
  919. #--------------------------------------------------------------------------
  920. # — リフレッシュ
  921. #--------------------------------------------------------------------------
  922. alias refresh_KGC_LargeParty refresh
  923. def refresh
  924. create_contents
  925.  
  926. refresh_KGC_LargeParty
  927. end
  928. end
  929.  
  930. # ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜…
  931.  
  932. #==============================================================================
  933. # –¡ Window_PartyFormCaption
  934. #------------------------------------------------------------------------------
  935. #  パーティ編成画面でウィンドウのキャプションを表示するウィンドウです。
  936. #==============================================================================
  937.  
  938. class Window_PartyFormCaption < Window_Base
  939. #--------------------------------------------------------------------------
  940. # — オブジェクト初期化
  941. # caption : 表示するキャプション
  942. #--------------------------------------------------------------------------
  943. def initialize(caption = "")
  944. super(0, 0, KGC::LargeParty::CAPTION_WINDOW_WIDTH, WLH + 32)
  945. self.z = 1500
  946. @caption = caption
  947. refresh
  948. end
  949. #--------------------------------------------------------------------------
  950. # — リフレッシュ
  951. #--------------------------------------------------------------------------
  952. def refresh
  953. self.contents.clear
  954. self.contents.draw_text(0, 0, width - 32, WLH, @caption)
  955. end
  956. end
  957.  
  958. # ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜…
  959.  
  960. #==============================================================================
  961. # –¡ Window_PartyFormMember
  962. #------------------------------------------------------------------------------
  963. #  パーティ編成画面でメンバーを表示するウィンドウです。
  964. #==============================================================================
  965.  
  966. class Window_PartyFormMember < Window_Selectable
  967. #--------------------------------------------------------------------------
  968. # —‹ 定数
  969. #--------------------------------------------------------------------------
  970. DRAW_SIZE = KGC::LargeParty::PARTY_FORM_CHARACTER_SIZE
  971. #--------------------------------------------------------------------------
  972. # — 公開インスタンス変数
  973. #--------------------------------------------------------------------------
  974. attr_accessor :selected_index # 選択済みインデックス
  975. #--------------------------------------------------------------------------
  976. # — オブジェクト初期化
  977. # x : ウィンドウの X 座標
  978. # y : ウィンドウの Y 座標
  979. # width : ウィンドウの幅
  980. # height : ウィンドウの高さ
  981. # spacing : æ¨ªã«é …ç›®ãŒä¸¦ã¶ã¨ãã®ç©ºç™½ã®å¹…
  982. #--------------------------------------------------------------------------
  983. def initialize(x, y, width, height, spacing = 8)
  984. super(x, y, width, height, spacing)
  985. self.z = 1000
  986. end
  987. #--------------------------------------------------------------------------
  988. # — ウィンドウ内容の作成
  989. #--------------------------------------------------------------------------
  990. def create_contents
  991. self.contents.dispose
  992. self.contents = Bitmap.new(width - 32,
  993. [height - 32, row_max * DRAW_SIZE[1]].max)
  994. end
  995. #--------------------------------------------------------------------------
  996. # — å…ˆé ­ã®è¡Œã®å–å¾—
  997. #--------------------------------------------------------------------------
  998. def top_row
  999. return self.oy / DRAW_SIZE[1]
  1000. end
  1001. #--------------------------------------------------------------------------
  1002. # — å…ˆé ­ã®è¡Œã®è¨­å®š
  1003. # row : å…ˆé ­ã«è¡¨ç¤ºã™ã‚‹è¡Œ
  1004. #--------------------------------------------------------------------------
  1005. def top_row=(row)
  1006. super(row)
  1007. self.oy = self.oy / WLH * DRAW_SIZE[1]
  1008. end
  1009. #--------------------------------------------------------------------------
  1010. # — 1 ページに表示できる行数の取得
  1011. #--------------------------------------------------------------------------
  1012. def page_row_max
  1013. return (self.height - 32) / DRAW_SIZE[1]
  1014. end
  1015. #--------------------------------------------------------------------------
  1016. # — é …ç›®ã‚’æç”»ã™ã‚‹çŸ©å½¢ã®å–å¾—
  1017. # index : é …ç›®ç•ªå·
  1018. #--------------------------------------------------------------------------
  1019. def item_rect(index)
  1020. rect = super(index)
  1021. rect.width = DRAW_SIZE[0]
  1022. rect.height = DRAW_SIZE[1]
  1023. rect.y = index / @column_max * DRAW_SIZE[1]
  1024. return rect
  1025. end
  1026. #--------------------------------------------------------------------------
  1027. # —‹ 選択アクター取得
  1028. #--------------------------------------------------------------------------
  1029. def actor
  1030. return @actors[self.index]
  1031. end
  1032. #--------------------------------------------------------------------------
  1033. # — リフレッシュ
  1034. #--------------------------------------------------------------------------
  1035. def refresh
  1036. self.contents.clear
  1037. restore_member_list
  1038. draw_member
  1039. end
  1040. #--------------------------------------------------------------------------
  1041. # —‹ メンバーリスト修復
  1042. #--------------------------------------------------------------------------
  1043. def restore_member_list
  1044. # 継承先で定義
  1045. end
  1046. #--------------------------------------------------------------------------
  1047. # —‹ メンバー描画
  1048. #--------------------------------------------------------------------------
  1049. def draw_member
  1050. # 継承先で定義
  1051. end
  1052. #--------------------------------------------------------------------------
  1053. # —‹ 空欄アクター描画
  1054. # index : é …ç›®ç•ªå·
  1055. #--------------------------------------------------------------------------
  1056. def draw_empty_actor(index)
  1057. # 継承先で定義
  1058. end
  1059. #--------------------------------------------------------------------------
  1060. # —‹ 固定キャラ背景描画
  1061. # index : é …ç›®ç•ªå·
  1062. #--------------------------------------------------------------------------
  1063. def draw_fixed_back(index)
  1064. rect = item_rect(index)
  1065. self.contents.fill_rect(rect, KGC::LargeParty::FIXED_COLOR)
  1066. end
  1067. #--------------------------------------------------------------------------
  1068. # —‹ 選択中キャラ背景描画
  1069. # index : é …ç›®ç•ªå·
  1070. #--------------------------------------------------------------------------
  1071. def draw_selected_back(index)
  1072. rect = item_rect(index)
  1073. self.contents.fill_rect(rect, KGC::LargeParty::SELECTED_COLOR)
  1074. end
  1075. end
  1076.  
  1077. # ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜…
  1078.  
  1079. #==============================================================================
  1080. # –¡ Window_PartyFormBattleMember
  1081. #------------------------------------------------------------------------------
  1082. #  パーティ編成画面で戦闘メンバーを表示するウィンドウです。
  1083. #==============================================================================
  1084.  
  1085. class Window_PartyFormBattleMember < Window_PartyFormMember
  1086. #--------------------------------------------------------------------------
  1087. # — 公開インスタンス変数
  1088. #--------------------------------------------------------------------------
  1089. attr_accessor :selected_index # 選択済みインデックス
  1090. #--------------------------------------------------------------------------
  1091. # — オブジェクト初期化
  1092. #--------------------------------------------------------------------------
  1093. def initialize
  1094. super(0, 0, 64, DRAW_SIZE[1] + 32)
  1095. column_width = DRAW_SIZE[0] + @spacing
  1096. nw = [column_width * $game_party.max_battle_member_count + 32,
  1097. Graphics.width].min
  1098. self.width = nw
  1099.  
  1100. @item_max = $game_party.max_battle_member_count
  1101. @column_max = width / column_width
  1102. @selected_index = nil
  1103. create_contents
  1104. refresh
  1105. self.active = true
  1106. self.index = 0
  1107. end
  1108. #--------------------------------------------------------------------------
  1109. # —‹ メンバーリスト修復
  1110. #--------------------------------------------------------------------------
  1111. def restore_member_list
  1112. @actors = $game_party.battle_members
  1113. end
  1114. #--------------------------------------------------------------------------
  1115. # —‹ メンバー描画
  1116. #--------------------------------------------------------------------------
  1117. def draw_member
  1118. @item_max.times { |i|
  1119. actor = @actors[i]
  1120. if actor == nil
  1121. draw_empty_actor(i)
  1122. else
  1123. if i == @selected_index
  1124. draw_selected_back(i)
  1125. elsif $game_party.actor_fixed?(actor.id)
  1126. draw_fixed_back(i)
  1127. end
  1128. rect = item_rect(i)
  1129. draw_actor_graphic(actor,
  1130. rect.x + DRAW_SIZE[0] / 2,
  1131. rect.y + DRAW_SIZE[1] - 4)
  1132. end
  1133. }
  1134. end
  1135. #--------------------------------------------------------------------------
  1136. # —‹ 空欄アクター描画
  1137. # index : é …ç›®ç•ªå·
  1138. #--------------------------------------------------------------------------
  1139. def draw_empty_actor(index)
  1140. rect = item_rect(index)
  1141. self.contents.font.color = system_color
  1142. self.contents.draw_text(rect, KGC::LargeParty::BATTLE_MEMBER_BLANK_TEXT, 1)
  1143. self.contents.font.color = normal_color
  1144. end
  1145. end
  1146.  
  1147. # ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜…
  1148.  
  1149. #==============================================================================
  1150. # –¡ Window_PartyFormAllMember
  1151. #------------------------------------------------------------------------------
  1152. #  パーティ編成画面で全メンバーを表示するウィンドウです。
  1153. #==============================================================================
  1154.  
  1155. class Window_PartyFormAllMember < Window_PartyFormMember
  1156. #--------------------------------------------------------------------------
  1157. # — オブジェクト初期化
  1158. #--------------------------------------------------------------------------
  1159. def initialize
  1160. super(0, 0, 64, 64)
  1161. restore_member_list
  1162. @item_max = $game_party.all_members.size
  1163.  
  1164. # 各種サイズ計算
  1165. column_width = DRAW_SIZE[0] + @spacing
  1166. sw = [@item_max * column_width + 32, Graphics.width].min
  1167. @column_max = (sw - 32) / column_width
  1168. sh = ([@item_max - 1, 0].max / @column_max + 1) * DRAW_SIZE[1] + 32
  1169. sh = [sh, DRAW_SIZE[1] * KGC::LargeParty::PARTY_MEMBER_WINDOW_ROW_MAX + 32].min
  1170.  
  1171. # 座標・サイズ調整
  1172. self.y += DRAW_SIZE[1] + 32
  1173. self.width = sw
  1174. self.height = sh
  1175.  
  1176. create_contents
  1177. refresh
  1178. self.active = false
  1179. self.index = 0
  1180. end
  1181. #--------------------------------------------------------------------------
  1182. # —‹ 選択しているアクターのインデックス取得
  1183. #--------------------------------------------------------------------------
  1184. def actor_index
  1185. return @index_offset + self.index
  1186. end
  1187. #--------------------------------------------------------------------------
  1188. # —‹ メンバーリスト修復
  1189. #--------------------------------------------------------------------------
  1190. def restore_member_list
  1191. if KGC::LargeParty::SHOW_BATTLE_MEMBER_IN_PARTY
  1192. @actors = $game_party.all_members
  1193. @index_offset = 0
  1194. else
  1195. @actors = $game_party.stand_by_members
  1196. @index_offset = $game_party.battle_members.size
  1197. end
  1198. end
  1199. #--------------------------------------------------------------------------
  1200. # —‹ メンバー描画
  1201. #--------------------------------------------------------------------------
  1202. def draw_member
  1203. @item_max.times { |i|
  1204. actor = @actors[i]
  1205. if actor == nil
  1206. draw_empty_actor(i)
  1207. next
  1208. end
  1209.  
  1210. if $game_party.actor_fixed?(actor.id)
  1211. draw_fixed_back(i)
  1212. end
  1213. rect = item_rect(i)
  1214. opacity = ($game_party.battle_members.include?(actor) ? 96 : 255)
  1215. draw_actor_graphic(actor,
  1216. rect.x + DRAW_SIZE[0] / 2,
  1217. rect.y + DRAW_SIZE[1] - 4,
  1218. opacity)
  1219. }
  1220. end
  1221. #--------------------------------------------------------------------------
  1222. # — アクターの歩行グラフィック描画
  1223. # actor : アクター
  1224. # x : 描画先 X 座標
  1225. # y : 描画先 Y 座標
  1226. # opacity : 不透明度
  1227. #--------------------------------------------------------------------------
  1228. def draw_actor_graphic(actor, x, y, opacity = 255)
  1229. draw_character(actor.character_name, actor.character_index, x, y, opacity)
  1230. end
  1231. #--------------------------------------------------------------------------
  1232. # — 歩行グラフィックの描画
  1233. # character_name : 歩行グラフィック ファイル名
  1234. # character_index : 歩行グラフィック インデックス
  1235. # x : 描画先 X 座標
  1236. # y : 描画先 Y 座標
  1237. # opacity : 不透明度
  1238. #--------------------------------------------------------------------------
  1239. def draw_character(character_name, character_index, x, y, opacity = 255)
  1240. return if character_name == nil
  1241. bitmap = Cache.character(character_name)
  1242. sign = character_name[/^[\!\$]./]
  1243. if sign != nil and sign.include?('$')
  1244. cw = bitmap.width / 3
  1245. ch = bitmap.height / 4
  1246. else
  1247. cw = bitmap.width / 12
  1248. ch = bitmap.height / 8
  1249. end
  1250. n = character_index
  1251. src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
  1252. self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity)
  1253. end
  1254. #--------------------------------------------------------------------------
  1255. # —‹ 空欄アクター描画
  1256. # index : é …ç›®ç•ªå·
  1257. #--------------------------------------------------------------------------
  1258. def draw_empty_actor(index)
  1259. rect = item_rect(index)
  1260. self.contents.font.color = system_color
  1261. self.contents.draw_text(rect, KGC::LargeParty::PARTY_MEMBER_BLANK_TEXT, 1)
  1262. self.contents.font.color = normal_color
  1263. end
  1264. end
  1265.  
  1266. # ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜…
  1267.  
  1268. #==============================================================================
  1269. # –¡ Window_PartyFormStatus
  1270. #------------------------------------------------------------------------------
  1271. #  パーティ編成画面でアクターのステータスを表示するウィンドウです。
  1272. #==============================================================================
  1273.  
  1274. class Window_PartyFormStatus < Window_Base
  1275. #--------------------------------------------------------------------------
  1276. # — オブジェクト初期化
  1277. #--------------------------------------------------------------------------
  1278. def initialize
  1279. super(0, 0, 384, 128)
  1280. self.z = 1000
  1281. @actor = nil
  1282. refresh
  1283. end
  1284. #--------------------------------------------------------------------------
  1285. # —‹ アクター設定
  1286. #--------------------------------------------------------------------------
  1287. def set_actor(actor)
  1288. if @actor != actor
  1289. @actor = actor
  1290. refresh
  1291. end
  1292. end
  1293. #--------------------------------------------------------------------------
  1294. # — リフレッシュ
  1295. #--------------------------------------------------------------------------
  1296. def refresh
  1297. self.contents.clear
  1298. if @actor == nil
  1299. return
  1300. end
  1301.  
  1302. draw_actor_face(@actor, 0, 0)
  1303. dx = 104
  1304. draw_actor_name(@actor, dx, 0)
  1305. draw_actor_level(@actor, dx, WLH * 1)
  1306. draw_actor_hp(@actor, dx, WLH * 2)
  1307. draw_actor_mp(@actor, dx, WLH * 3)
  1308. 4.times { |i|
  1309. draw_actor_parameter(@actor, dx + 128, WLH * i, i, 120)
  1310. }
  1311. end
  1312. #--------------------------------------------------------------------------
  1313. # — 能力値の描画
  1314. # actor : アクター
  1315. # x : 描画先 X 座標
  1316. # y : 描画先 Y 座標
  1317. # type : 能力値の種類 (0~3)
  1318. # width : 描画幅
  1319. #--------------------------------------------------------------------------
  1320. def draw_actor_parameter(actor, x, y, type, width = 156)
  1321. case type
  1322. when 0
  1323. parameter_name = Vocab::atk
  1324. parameter_value = actor.atk
  1325. when 1
  1326. parameter_name = Vocab::def
  1327. parameter_value = actor.def
  1328. when 2
  1329. parameter_name = Vocab::spi
  1330. parameter_value = actor.spi
  1331. when 3
  1332. parameter_name = Vocab::agi
  1333. parameter_value = actor.agi
  1334. end
  1335. nw = width - 36
  1336. self.contents.font.color = system_color
  1337. self.contents.draw_text(x, y, nw, WLH, parameter_name)
  1338. self.contents.font.color = normal_color
  1339. self.contents.draw_text(x + nw, y, 36, WLH, parameter_value, 2)
  1340. end
  1341. end
  1342.  
  1343. # ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜…
  1344.  
  1345. #==============================================================================
  1346. # –¡ Window_PartyFormControl
  1347. #------------------------------------------------------------------------------
  1348. #  パーティ編成画面で操作方法を表示するウィンドウです。
  1349. #==============================================================================
  1350.  
  1351. class Window_PartyFormControl < Window_Base
  1352. #--------------------------------------------------------------------------
  1353. # —‹ 定数
  1354. #--------------------------------------------------------------------------
  1355. MODE_BATTLE_MEMBER = 0
  1356. MODE_SHIFT_CHANGE = 1
  1357. MODE_PARTY_MEMBER = 2
  1358. #--------------------------------------------------------------------------
  1359. # — オブジェクト初期化
  1360. #--------------------------------------------------------------------------
  1361. def initialize
  1362. super(0, 0, Graphics.width - 384, 128)
  1363. self.z = 1000
  1364. @mode = MODE_BATTLE_MEMBER
  1365. refresh
  1366. end
  1367. #--------------------------------------------------------------------------
  1368. # —‹ モード変更
  1369. #--------------------------------------------------------------------------
  1370. def mode=(value)
  1371. @mode = value
  1372. refresh
  1373. end
  1374. #--------------------------------------------------------------------------
  1375. # — リフレッシュ
  1376. #--------------------------------------------------------------------------
  1377. def refresh
  1378. self.contents.clear
  1379. case @mode
  1380. when MODE_BATTLE_MEMBER # 戦闘メンバー
  1381. buttons = [
  1382. "A: Switch",
  1383. "C: Standby",
  1384. "X: Return"
  1385. ]
  1386. when MODE_SHIFT_CHANGE # 並び替え
  1387. buttons = [
  1388. "C: Select",
  1389. "X: Return"
  1390. ]
  1391. when MODE_PARTY_MEMBER # パーティメンバー
  1392. buttons = [
  1393. "X: Return",
  1394. "C: Select"
  1395. ]
  1396. else
  1397. return
  1398. end
  1399.  
  1400. buttons.each_with_index { |c, i|
  1401. self.contents.draw_text(0, WLH * i, width - 32, WLH, c)
  1402. }
  1403. end
  1404. end
  1405.  
  1406. # ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜…
  1407.  
  1408. #==============================================================================
  1409. # – Scene_Title
  1410. #==============================================================================
  1411.  
  1412. class Scene_Title < Scene_Base
  1413. #--------------------------------------------------------------------------
  1414. # — 各種ゲームオブジェクトの作成
  1415. #--------------------------------------------------------------------------
  1416. alias create_game_objects_KGC_LargeParty create_game_objects
  1417. def create_game_objects
  1418. create_game_objects_KGC_LargeParty
  1419.  
  1420. if KGC::LargeParty::DEFAULT_PARTYFORM_ENABLED
  1421. $game_switches[KGC::LargeParty::PARTYFORM_SWITCH] = true
  1422. $game_switches[KGC::LargeParty::BATTLE_PARTYFORM_SWITCH] = true
  1423. end
  1424. end
  1425. end
  1426.  
  1427. # ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜…
  1428.  
  1429. #==============================================================================
  1430. # – Scene_Map
  1431. #==============================================================================
  1432.  
  1433. class Scene_Map < Scene_Base
  1434. #--------------------------------------------------------------------------
  1435. # — 画面切り替えの実行
  1436. #--------------------------------------------------------------------------
  1437. alias update_scene_change_KGC_LargeParty update_scene_change
  1438. def update_scene_change
  1439. return if $game_player.moving? # プレイヤーの移動中?
  1440.  
  1441. if $game_temp.next_scene == :partyform
  1442. call_partyform
  1443. return
  1444. end
  1445.  
  1446. update_scene_change_KGC_LargeParty
  1447. end
  1448. #--------------------------------------------------------------------------
  1449. # —‹ パーティ編成画面への切り替え
  1450. #--------------------------------------------------------------------------
  1451. def call_partyform
  1452. $game_temp.next_scene = nil
  1453. $scene = Scene_PartyForm.new(0, Scene_PartyForm::HOST_MAP)
  1454. end
  1455. end
  1456.  
  1457. # ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜…
  1458. =begin
  1459. #==============================================================================
  1460. # – Scene_Menu
  1461. #==============================================================================
  1462.  
  1463. class Scene_Menu < Scene_Base
  1464. if KGC::LargeParty::USE_MENU_PARTYFORM_COMMAND
  1465. #--------------------------------------------------------------------------
  1466. # — コマンドウィンドウの作成
  1467. #--------------------------------------------------------------------------
  1468. alias create_command_window_KGC_LargeParty create_command_window
  1469. def create_command_window
  1470. create_command_window_KGC_LargeParty
  1471.  
  1472. return if $imported["CustomMenuCommand"]
  1473.  
  1474. @__command_partyform_index =
  1475. @command_window.add_command(Vocab.partyform)
  1476. @command_window.draw_item(@__command_partyform_index,
  1477. $game_party.partyform_enable?)
  1478. if @command_window.oy > 0
  1479. @command_window.oy -= Window_Base::WLH
  1480. end
  1481. @command_window.index = @menu_index
  1482. end
  1483. end
  1484. #--------------------------------------------------------------------------
  1485. # — コマンド選択の更新
  1486. #--------------------------------------------------------------------------
  1487. alias update_command_selection_KGC_LargeParty update_command_selection
  1488. def update_command_selection
  1489. current_menu_index = @__command_partyform_index
  1490. call_partyform_flag = false
  1491.  
  1492. if Input.trigger?(Input::C)
  1493. case @command_window.index
  1494. when @__command_partyform_index # パーティ編成
  1495. call_partyform_flag = true
  1496. end
  1497. # パーティ編成ボタン押下
  1498. elsif KGC::LargeParty::MENU_PARTYFORM_BUTTON != nil &&
  1499. Input.trigger?(KGC::LargeParty::MENU_PARTYFORM_BUTTON)
  1500. call_partyform_flag = true
  1501. current_menu_index = @command_window.index if current_menu_index == nil
  1502. end
  1503.  
  1504. # パーティ編成画面に移行
  1505. if call_partyform_flag
  1506. if $game_party.members.size == 0 || !$game_party.partyform_enable?
  1507. Sound.play_buzzer
  1508. return
  1509. end
  1510. Sound.play_decision
  1511. $scene = Scene_PartyForm.new(current_menu_index)
  1512. return
  1513. end
  1514.  
  1515. update_command_selection_KGC_LargeParty
  1516. end
  1517. end
  1518.  
  1519. # ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜…
  1520. =end
  1521. #==============================================================================
  1522. # – Scene_Shop
  1523. #==============================================================================
  1524.  
  1525. unless $imported["HelpExtension"]
  1526. class Scene_Shop < Scene_Base
  1527. #--------------------------------------------------------------------------
  1528. # — フレーム更新
  1529. #--------------------------------------------------------------------------
  1530. alias udpate_KGC_LargeParty update
  1531. def update
  1532. # スクロール判定
  1533. if !@command_window.active &&
  1534. KGC::LargeParty::SHOP_STATUS_SCROLL_BUTTON != nil &&
  1535. Input.press?(KGC::LargeParty::SHOP_STATUS_SCROLL_BUTTON)
  1536. super
  1537. update_menu_background
  1538. update_scroll_status
  1539. return
  1540. else
  1541. @status_window.cursor_rect.empty
  1542. end
  1543.  
  1544. udpate_KGC_LargeParty
  1545. end
  1546. #--------------------------------------------------------------------------
  1547. # —‹ ステータスウィンドウのスクロール処理
  1548. #--------------------------------------------------------------------------
  1549. def update_scroll_status
  1550. # ステータスウィンドウにカーソルを表示
  1551. @status_window.cursor_rect.width = @status_window.contents.width
  1552. @status_window.cursor_rect.height = @status_window.height - 32
  1553. @status_window.update
  1554.  
  1555. if Input.press?(Input::UP)
  1556. @status_window.oy = [@status_window.oy - 4, 0].max
  1557. elsif Input.press?(Input::DOWN)
  1558. max_pos = [@status_window.contents.height -
  1559. (@status_window.height - 32), 0].max
  1560. @status_window.oy = [@status_window.oy + 4, max_pos].min
  1561. end
  1562. end
  1563. end
  1564. end
  1565.  
  1566. # ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜…
  1567.  
  1568. #==============================================================================
  1569. # –¡ Scene_PartyForm
  1570. #------------------------------------------------------------------------------
  1571. #  パーティ編成画面の処理を行うクラスです。
  1572. #==============================================================================
  1573.  
  1574. class Scene_PartyForm < Scene_Base
  1575. #--------------------------------------------------------------------------
  1576. # —‹ 定数
  1577. #--------------------------------------------------------------------------
  1578. CAPTION_OFFSET = 40 # キャプションウィンドウの位置補正
  1579. HOST_MENU = 0 # 呼び出し元 : メニュー
  1580. HOST_MAP = 1 # 呼び出し元 : マップ
  1581. HOST_BATTLE = 2 # 呼び出し元 : 戦闘
  1582. #--------------------------------------------------------------------------
  1583. # — オブジェクト初期化
  1584. # menu_index : コマンドのカーソル初期位置
  1585. # host_scene : 呼び出し元 (0..メニュー 1..マップ 2..戦闘)
  1586. #--------------------------------------------------------------------------
  1587. def initialize(menu_index = 0, host_scene = HOST_MENU)
  1588. @menu_index = menu_index
  1589. @host_scene = host_scene
  1590. end
  1591. #--------------------------------------------------------------------------
  1592. # — 開始処理
  1593. #--------------------------------------------------------------------------
  1594. def start
  1595. super
  1596. create_menu_background
  1597.  
  1598. create_windows
  1599. create_confirm_window
  1600. adjust_window_location
  1601.  
  1602. # 編成前のパーティを保存
  1603. @battle_actors = $game_party.battle_members.dup
  1604. @party_actors = $game_party.all_members.dup
  1605. end
  1606. #--------------------------------------------------------------------------
  1607. # —‹ ウィンドウの作成
  1608. #--------------------------------------------------------------------------
  1609. def create_windows
  1610. # 編成用ウィンドウを作成
  1611. @battle_member_window = Window_PartyFormBattleMember.new
  1612. @party_member_window = Window_PartyFormAllMember.new
  1613. @status_window = Window_PartyFormStatus.new
  1614. @status_window.set_actor(@battle_member_window.actor)
  1615.  
  1616. # その他のウィンドウを作成
  1617. @battle_member_caption_window =
  1618. Window_PartyFormCaption.new(KGC::LargeParty::BATTLE_MEMBER_CAPTION)
  1619. @party_member_caption_window =
  1620. Window_PartyFormCaption.new(KGC::LargeParty::PARTY_MEMBER_CAPTION)
  1621. @control_window = Window_PartyFormControl.new
  1622. end
  1623. #--------------------------------------------------------------------------
  1624. # —‹ 確認ウィンドウの作成
  1625. #--------------------------------------------------------------------------
  1626. def create_confirm_window
  1627. commands = KGC::LargeParty::CONFIRM_WINDOW_COMMANDS
  1628. @confirm_window =
  1629. Window_Command.new(KGC::LargeParty::CONFIRM_WINDOW_WIDTH, commands)
  1630. @confirm_window.index = 0
  1631. @confirm_window.x = (Graphics.width - @confirm_window.width) / 2
  1632. @confirm_window.y = (Graphics.height - @confirm_window.height) / 2
  1633. @confirm_window.z = 2000
  1634. @confirm_window.openness = 0
  1635. @confirm_window.active = false
  1636. end
  1637. #--------------------------------------------------------------------------
  1638. # —‹ ウィンドウの座標調整
  1639. #--------------------------------------------------------------------------
  1640. def adjust_window_location
  1641. # 基準座標を計算
  1642. base_x = [@battle_member_window.width, @party_member_window.width].max
  1643. base_x = [(Graphics.width - base_x) / 2, 0].max
  1644. base_y = @battle_member_window.height + @party_member_window.height +
  1645. @status_window.height + CAPTION_OFFSET * 2
  1646. base_y = [(Graphics.height - base_y) / 2, 0].max
  1647.  
  1648. # 編成用ウィンドウの座標をセット
  1649. @battle_member_window.x = base_x
  1650. @battle_member_window.y = base_y + CAPTION_OFFSET
  1651. @party_member_window.x = base_x
  1652. @party_member_window.y = @battle_member_window.y +
  1653. @battle_member_window.height + CAPTION_OFFSET
  1654. @status_window.x = 0
  1655. @status_window.y = @party_member_window.y + @party_member_window.height
  1656.  
  1657. # その他のウィンドウの座標をセット
  1658. @battle_member_caption_window.x = [base_x - 16, 0].max
  1659. @battle_member_caption_window.y = @battle_member_window.y - CAPTION_OFFSET
  1660. @party_member_caption_window.x = [base_x - 16, 0].max
  1661. @party_member_caption_window.y = @party_member_window.y - CAPTION_OFFSET
  1662. @control_window.x = @status_window.width
  1663. @control_window.y = @status_window.y
  1664. end
  1665. #--------------------------------------------------------------------------
  1666. # — 終了処理
  1667. #--------------------------------------------------------------------------
  1668. def terminate
  1669. super
  1670. dispose_menu_background
  1671. @battle_member_window.dispose
  1672. @party_member_window.dispose
  1673. @status_window.dispose
  1674. @battle_member_caption_window.dispose
  1675. @party_member_caption_window.dispose
  1676. @control_window.dispose
  1677. @confirm_window.dispose
  1678. end
  1679. #--------------------------------------------------------------------------
  1680. # — メニュー画面系の背景作成
  1681. #--------------------------------------------------------------------------
  1682. def create_menu_background
  1683. super
  1684. @menuback_sprite.z = 500
  1685. end
  1686. #--------------------------------------------------------------------------
  1687. # — 元の画面へ戻る
  1688. #--------------------------------------------------------------------------
  1689. def return_scene
  1690. case @host_scene
  1691. when HOST_MENU
  1692. $scene = Scene_Menu.new(@menu_index)
  1693. when HOST_MAP
  1694. $scene = Scene_Map.new
  1695. when HOST_BATTLE
  1696. $scene = Scene_Battle.new
  1697. end
  1698. $game_player.refresh
  1699. end
  1700. #--------------------------------------------------------------------------
  1701. # — フレーム更新
  1702. #--------------------------------------------------------------------------
  1703. def update
  1704. super
  1705. update_menu_background
  1706. update_window
  1707. if @battle_member_window.active
  1708. update_battle_member
  1709. elsif @party_member_window.active
  1710. update_party_member
  1711. elsif @confirm_window.active
  1712. update_confirm
  1713. end
  1714. end
  1715. #--------------------------------------------------------------------------
  1716. # —‹ ウィンドウ更新
  1717. #--------------------------------------------------------------------------
  1718. def update_window
  1719. @battle_member_window.update
  1720. @party_member_window.update
  1721. @status_window.update
  1722. @battle_member_caption_window.update
  1723. @party_member_caption_window.update
  1724. @control_window.update
  1725. @confirm_window.update
  1726. end
  1727. #--------------------------------------------------------------------------
  1728. # —‹ ウィンドウ再描画
  1729. #--------------------------------------------------------------------------
  1730. def refresh_window
  1731. @battle_member_window.refresh
  1732. @party_member_window.refresh
  1733. end
  1734. #--------------------------------------------------------------------------
  1735. # —‹ フレーム更新 (æˆ¦é—˜ãƒ¡ãƒ³ãƒãƒ¼ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ)
  1736. #--------------------------------------------------------------------------
  1737. def update_battle_member
  1738. @status_window.set_actor(@battle_member_window.actor)
  1739. if Input.trigger?(Input::A)
  1740. if @battle_member_window.selected_index == nil # 並び替え中でない
  1741. actor = @battle_member_window.actor
  1742. # ã‚¢ã‚¯ã‚¿ãƒ¼ã‚’å¤–ã›ãªã„å ´åˆ
  1743. if actor == nil || $game_party.actor_fixed?(actor.id)
  1744. Sound.play_buzzer
  1745. return
  1746. end
  1747. # アクターを外す
  1748. Sound.play_decision
  1749. actors = $game_party.battle_members
  1750. actors.delete_at(@battle_member_window.index)
  1751. $game_party.set_battle_member(actors)
  1752. refresh_window
  1753. end
  1754. elsif Input.trigger?(Input::B)
  1755. if @battle_member_window.selected_index == nil # 並び替え中でない
  1756. # 確認ウィンドウに切り替え
  1757. Sound.play_cancel
  1758. show_confirm_window
  1759. else # 並び替え中
  1760. # 並び替え解除
  1761. Sound.play_cancel
  1762. @battle_member_window.selected_index = nil
  1763. @battle_member_window.refresh
  1764. @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  1765. end
  1766. elsif Input.trigger?(Input::C)
  1767. if @battle_member_window.selected_index == nil # 並び替え中でない
  1768. actor = @battle_member_window.actor
  1769. # ã‚¢ã‚¯ã‚¿ãƒ¼ã‚’å¤–ã›ãªã„å ´åˆ
  1770. if actor != nil && $game_party.actor_fixed?(actor.id)
  1771. Sound.play_buzzer
  1772. return
  1773. end
  1774. # パーティメンバーウィンドウに切り替え
  1775. Sound.play_decision
  1776. @battle_member_window.active = false
  1777. @party_member_window.active = true
  1778. @control_window.mode = Window_PartyFormControl::MODE_PARTY_MEMBER
  1779. else # 並び替え中
  1780. unless can_change_shift?(@battle_member_window.actor)
  1781. Sound.play_buzzer
  1782. return
  1783. end
  1784. # 並び替え実行
  1785. Sound.play_decision
  1786. index1 = @battle_member_window.selected_index
  1787. index2 = @battle_member_window.index
  1788. change_shift(index1, index2)
  1789. @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  1790. end
  1791. elsif Input.trigger?(Input::X)
  1792. # ä¸¦ã³æ›¿ãˆä¸å¯èƒ½ãªå ´åˆ
  1793. unless can_change_shift?(@battle_member_window.actor)
  1794. Sound.play_buzzer
  1795. return
  1796. end
  1797. if @battle_member_window.selected_index == nil # 並び替え中でない
  1798. # 並び替え開始
  1799. Sound.play_decision
  1800. @battle_member_window.selected_index = @battle_member_window.index
  1801. @battle_member_window.refresh
  1802. @control_window.mode = Window_PartyFormControl::MODE_SHIFT_CHANGE
  1803. else # 並び替え中
  1804. # 並び替え実行
  1805. Sound.play_decision
  1806. index1 = @battle_member_window.selected_index
  1807. index2 = @battle_member_window.index
  1808. change_shift(index1, index2)
  1809. @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  1810. end
  1811. end
  1812. end
  1813. #--------------------------------------------------------------------------
  1814. # —‹ 並び替え可否判定
  1815. #--------------------------------------------------------------------------
  1816. def can_change_shift?(actor)
  1817. # é¸æŠžã—ãŸã‚¢ã‚¯ã‚¿ãƒ¼ãŒå­˜åœ¨ã—ãªã„ã€ã¾ãŸã¯ä¸¦ã³æ›¿ãˆä¸èƒ½ãªå ´åˆ
  1818. if actor == nil ||
  1819. (KGC::LargeParty::FORBID_CHANGE_SHIFT_FIXED &&
  1820. $game_party.actor_fixed?(actor.id))
  1821. return false
  1822. end
  1823. return true
  1824. end
  1825. #--------------------------------------------------------------------------
  1826. # —‹ 並び替え
  1827. #--------------------------------------------------------------------------
  1828. def change_shift(index1, index2)
  1829. # 位置を入れ替え
  1830. $game_party.change_shift(index1, index2)
  1831. # 選択済みインデックスをクリア
  1832. @battle_member_window.selected_index = nil
  1833. refresh_window
  1834. end
  1835. #--------------------------------------------------------------------------
  1836. # —‹ フレーム更新 (ãƒ‘ãƒ¼ãƒ†ã‚£ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ)
  1837. #--------------------------------------------------------------------------
  1838. def update_party_member
  1839. @status_window.set_actor(@party_member_window.actor)
  1840. if Input.trigger?(Input::B)
  1841. Sound.play_cancel
  1842. # 戦闘メンバーウィンドウに切り替え
  1843. @battle_member_window.active = true
  1844. @party_member_window.active = false
  1845. @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  1846. elsif Input.trigger?(Input::C)
  1847. actor = @party_member_window.actor
  1848. # ã‚¢ã‚¯ã‚¿ãƒ¼ãŒæˆ¦é—˜ãƒ¡ãƒ³ãƒãƒ¼ã«å«ã¾ã‚Œã‚‹å ´åˆ
  1849. if $game_party.battle_members.include?(actor)
  1850. Sound.play_buzzer
  1851. return
  1852. end
  1853. # アクターを入れ替え
  1854. Sound.play_decision
  1855. actors = $game_party.all_members
  1856. battle_actors = $game_party.battle_members
  1857. if @battle_member_window.actor != nil
  1858. actors[@party_member_window.actor_index] = @battle_member_window.actor
  1859. actors[@battle_member_window.index] = actor
  1860. $game_party.set_member(actors.compact)
  1861. end
  1862. battle_actors[@battle_member_window.index] = actor
  1863. $game_party.set_battle_member(battle_actors.compact)
  1864. refresh_window
  1865. # 戦闘メンバーウィンドウに切り替え
  1866. @battle_member_window.active = true
  1867. @party_member_window.active = false
  1868. @control_window.mode = Window_PartyFormControl::MODE_BATTLE_MEMBER
  1869. end
  1870. end
  1871. #--------------------------------------------------------------------------
  1872. # —‹ フレーム更新 (ç¢ºèªã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ)
  1873. #--------------------------------------------------------------------------
  1874. def update_confirm
  1875. if Input.trigger?(Input::B)
  1876. Sound.play_cancel
  1877. hide_confirm_window
  1878. elsif Input.trigger?(Input::C)
  1879. case @confirm_window.index
  1880. when 0 # 編成完了
  1881. # ãƒ‘ãƒ¼ãƒ†ã‚£ãŒç„¡åŠ¹ã®å ´åˆ
  1882. unless battle_member_valid?
  1883. Sound.play_buzzer
  1884. return
  1885. end
  1886. Sound.play_decision
  1887. return_scene
  1888. when 1 # 編成中断
  1889. Sound.play_decision
  1890. # パーティを編成前の状態に戻す
  1891. $game_party.set_member(@party_actors)
  1892. $game_party.set_battle_member(@battle_actors)
  1893. return_scene
  1894. when 2 # キャンセル
  1895. Sound.play_cancel
  1896. hide_confirm_window
  1897. end
  1898. end
  1899. end
  1900. #--------------------------------------------------------------------------
  1901. # —‹ 戦闘メンバー有効判定
  1902. #--------------------------------------------------------------------------
  1903. def battle_member_valid?
  1904. return false if $game_party.battle_members.size == 0 # 戦闘メンバーが空
  1905. $game_party.battle_members.each { |actor|
  1906. return true if actor.exist? # 生存者がいればOK
  1907. }
  1908. return false
  1909. end
  1910. #--------------------------------------------------------------------------
  1911. # —‹ 確認ウィンドウの表示
  1912. #--------------------------------------------------------------------------
  1913. def show_confirm_window
  1914. if @battle_member_window.active
  1915. @last_active_window = @battle_member_window
  1916. else
  1917. @last_active_window = @party_member_window
  1918. end
  1919. @battle_member_window.active = false
  1920. @party_member_window.active = false
  1921.  
  1922. @confirm_window.draw_item(0, battle_member_valid?)
  1923. @confirm_window.open
  1924. @confirm_window.active = true
  1925. end
  1926. #--------------------------------------------------------------------------
  1927. # —‹ 確認ウィンドウの非表示
  1928. #--------------------------------------------------------------------------
  1929. def hide_confirm_window
  1930. @confirm_window.active = false
  1931. @confirm_window.close
  1932. @last_active_window.active = true
  1933. end
  1934. end
  1935.  
  1936. # ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜… ˜† ˜…
  1937.  
  1938. #==============================================================================
  1939. # – Scene_Battle
  1940. #==============================================================================
  1941.  
  1942. class Scene_Battle < Scene_Base
  1943. #--------------------------------------------------------------------------
  1944. # — メッセージ表示が終わるまでウェイト
  1945. #--------------------------------------------------------------------------
  1946. alias wait_for_message_KGC_LargeParty wait_for_message
  1947. def wait_for_message
  1948. return if @ignore_wait_for_message # メッセージ終了までのウェイトを無視
  1949.  
  1950. wait_for_message_KGC_LargeParty
  1951. end
  1952. #--------------------------------------------------------------------------
  1953. # — レベルアップの表示
  1954. #--------------------------------------------------------------------------
  1955. alias display_level_up_KGC_LargeParty display_level_up
  1956. def display_level_up
  1957. @ignore_wait_for_message = true
  1958.  
  1959. display_level_up_KGC_LargeParty
  1960.  
  1961. exp = $game_troop.exp_total * KGC::LargeParty::STAND_BY_EXP_RATE / 1000
  1962. $game_party.stand_by_members.each { |actor|
  1963. if actor.exist?
  1964. actor.gain_exp(exp, KGC::LargeParty::SHOW_STAND_BY_LEVEL_UP)
  1965. end
  1966. }
  1967. @ignore_wait_for_message = false
  1968. wait_for_message
  1969. end
  1970. #--------------------------------------------------------------------------
  1971. # — パーティコマンド選択の開始
  1972. #--------------------------------------------------------------------------
  1973. alias start_party_command_selection_KGC_LargeParty start_party_command_selection
  1974. def start_party_command_selection
  1975. if $game_temp.in_battle
  1976. @status_window.index = 0
  1977. end
  1978.  
  1979. start_party_command_selection_KGC_LargeParty
  1980. end
  1981.  
  1982. if KGC::LargeParty::USE_BATTLE_PARTYFORM
  1983. #--------------------------------------------------------------------------
  1984. # — æƒ…å ±è¡¨ç¤ºãƒ“ãƒ¥ãƒ¼ãƒãƒ¼ãƒˆã®ä½œæˆ
  1985. #--------------------------------------------------------------------------
  1986. alias create_info_viewport_KGC_LargeParty create_info_viewport
  1987. def create_info_viewport
  1988. create_info_viewport_KGC_LargeParty
  1989.  
  1990. @__command_partyform_index =
  1991. @party_command_window.add_command(Vocab.partyform_battle)
  1992. @party_command_window.draw_item(@__command_partyform_index,
  1993. $game_party.battle_partyform_enable?)
  1994. end
  1995. #--------------------------------------------------------------------------
  1996. # — パーティコマンド選択の更新
  1997. #--------------------------------------------------------------------------
  1998. alias update_party_command_selection_KGC_LargeParty update_party_command_selection
  1999. def update_party_command_selection
  2000. if Input.trigger?(Input::C)
  2001. case @party_command_window.index
  2002. when @__command_partyform_index # パーティ編成
  2003. unless $game_party.battle_partyform_enable?
  2004. Sound.play_buzzer
  2005. return
  2006. end
  2007. Sound.play_decision
  2008. process_partyform
  2009. return
  2010. end
  2011. end
  2012.  
  2013. update_party_command_selection_KGC_LargeParty
  2014. end
  2015. #--------------------------------------------------------------------------
  2016. # —‹ パーティ編成の処理
  2017. #--------------------------------------------------------------------------
  2018. def process_partyform
  2019. Graphics.freeze
  2020. snapshot_for_background
  2021. $scene = Scene_PartyForm.new(0, Scene_PartyForm::HOST_BATTLE)
  2022. $scene.main
  2023. $scene = self
  2024. @status_window.refresh
  2025. perform_transition
  2026. end
  2027. end
  2028. end
  2029.  
  2030. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
  2031. #_/ The original untranslated version of this script can be found here:
  2032. # http://f44.aaa.livedoor.jp/~ytomy/tkool ... arge_party
  2033. #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
Add Comment
Please, Sign In to add comment