I need the custom command script for the RMVX that's compatible with the Limit Break/Overdrive script
this one to be exact...
but if its in the scripts already when you open a new proj, where is it?
ok thanks
this one to be exact...
Code:
1. #==============================================================================
2. # ** Limit Breaks / Overdrives
3. #------------------------------------------------------------------------------
4. # © Dargor, 2009
5. # 20/02/09
6. # Version 1.4
7. #------------------------------------------------------------------------------
8. # VERSION HISTORY:
9. # - 1.0 (16/02/09), Initial release
10. # - 1.1 (18/02/09), Added an Actors constant in the configuration module
11. # - 1.2 (18/02/09), Skills can now be flagged as Limits with a note that
12. # - 1.3 (18/02/09), Fixed a bug with wrong limit mode being displayed in the
13. # Limit Status window
14. # - 1.4 (20/02/09), Fixed a bug with the "Sufferer" Mode
15. #------------------------------------------------------------------------------
16. # INTRODUCTION:
17. # This script is a replica of FF7 "Limit Breaks" and FF10 "Overdrives".
18. # It includes all 17 Overdrive Modes with their original increment formulas.
19. # Since Limits and Overdrives are similar, both are supported in this script
20. # and are described as follow:
21. # - Limit Break: An overdrive with its mode permanently set to "Stoic"
22. # without the possibility of modifying it.
23. # - Overdrive: A Limit Break with the possibility of having 17 different
24. # gauge increment modes.
25. #------------------------------------------------------------------------------
26. # INSTRUCTIONS:
27. # 1) Place this script ABOVE Main and BELOW the Custom Commands script
28. # 2) Edit the vocabulary and constants in the Limit_Break module
29. #------------------------------------------------------------------------------
30. # NOTES:
31. # - This script requires the Custom Commands script
32. #
33. # - This script includes all 17 Overdrive Modes from FF10
34. # Here's the list of the modes in the format ID) Name: Description
35. # 0) Stoic: Take damage from an enemy
36. # 1) Warrior: Deal damage to an enemy
37. # 2) Healer: Heal an ally
38. # 3) Comrad: Ally takes damage
39. # 4) Slayer: Kill an enemy
40. # 5) Victor: Win a battle alive
41. # 6) Tactician: Inflict a negative state on an enemy
42. # 7) Hero: Kill an enemy with a critical hit
43. # 8) Ally: Turn reaches self
44. # 9) Daredevil: Turn reaches self in the crisis (near death) state
45. # 10) Solo: Fight alone
46. # 11) Coward: Run away from battles
47. # 12) Dancer: Evade an enemy attack
48. # 13) Rook: Reduce or nullify an enemy elemental/state attack
49. # 14) Sufferer: Get inflicted by a negative state from an enemy
50. # 15) Victim: Get affected by a negative state whe turn reach self
51. # 16) Avenger: Enemy kills an ally
52. #==============================================================================
53.
54. # Vocabulary
55. Vocab::Limit = 'Limit'
56. Vocab::LimitCommand = 'LIMIT!'
57. Vocab::LimitReady = "%s's limit gauge is fully charged!"
58. Vocab::Mode = 'Mode'
59. Vocab::ModeLearn = "%s learned the overdrive mode \\C[17]%s\\C[0]!"
60.
61. #==============================================================================
62. # ** Limit Break Configuration Module
63. #==============================================================================
64.
65. module Limit_Break
66. # Skill ID of Limits
67. Limits = [2,3,4,5]
68. # Note Tag. If this tag appears in a skill note, this skill is flagged as a limit
69. # An alternative to the above method.
70. Skill_Tag = '[Limit]'
71. # Actors with the Limit command
72. Actors = [1,2]
73. # Limit Battle Command Index
74. # SYNTAX: { Actor_ID => index }
75. Command_Index = { }
76. Command_Index.default = 0
77. # Actor Maximum amount of LP (Limit Points)
78. # This is the maximum number of LP an actor needs to have in order to use Limits
79. # SYNTAX: { Actor_ID => value }
80. LP_Max = { }
81. LP_Max.default = 100
82. # Limit Mode Names
83. Mode_Names = [
84. 'Stoic',
85. 'Warrior',
86. 'Healer',
87. 'Comrad',
88. 'Slayer',
89. 'Victor',
90. 'Tactician',
91. 'Hero',
92. 'Ally',
93. 'Daredevil',
94. 'Solo',
95. 'Coward',
96. 'Dancer',
97. 'Rook',
98. 'Sufferer',
99. 'Victim',
100. 'Avenger'
101. ]
102. # Limit Mode Descriptions
103. Mode_Descriptions = [
104. 'Receive damage from enemy',
105. 'Deal damage to enemy',
106. 'Healing HP of an ally',
107. 'Ally hit by an enemy',
108. 'Destroying an enemy',
109. 'Win a battle as an included member',
110. 'Inflict negative status on an enemy',
111. 'Destroying an enemy with a critical hit',
112. 'Turn reaches self',
113. 'Turn reaches self when near death',
114. 'Fight alone',
115. 'Escaping from a battle',
116. 'Evading an enemy attack',
117. 'Reduce or nullify an enemy status/element attack',
118. 'Hit by negative status from an enemy',
119. 'Turn reaches self under negative status effects',
120. 'Enemy kill ally'
121. ]
122. # Limit Mode Gauge Increment Formulas
123. Mode_Increment = [
124. "((@hp_damage.to_f * 30.0) / self.maxhp.to_f).ceil",
125. "((@hp_damage.to_f * 10.0) / @estimated_hp_damage.to_f).ceil",
126. "((@hp_damage.abs.to_f * 16.0) / self.maxhp.to_f).ceil",
127. "((@hp_damage.to_f * 20.0) / self.maxhp.to_f).ceil",
128. "20 * (member.maxlp / 100)",
129. "20 * (user.maxlp / 100)",
130. "16 * (user.maxlp / 100)",
131. "20 * (user.maxlp / 100)",
132. "4 * (@active_battler.maxlp / 100)",
133. "16 * (@active_battler.maxlp / 100)",
134. "16 * (@active_battler.maxlp / 100)",
135. "10 * (member.maxlp / 100)",
136. "16 * (target.maxlp / 100)",
137. "10 * (self.maxlp / 100)",
138. "16 * (user.maxlp / 100)",
139. "16 * (@active_battler.maxlp / 100)",
140. "30 * (user.maxlp / 100)"
141. ]
142. # Limit Modes Learning Rate
143. # This is the number if times an actor must meet modes requitement in order to
144. # gain this mode.
145. # SYNTAX: { Mode_ID => { Actor_ID => value } }
146. # NOTE: If a mode is not defined or a value is not specified for an actor,
147. # the mode is automatically available.
148. Mode_Learn_Rate = {
149. 1 => {1 => 1, 2 => 100, 3 => 100, 4 => 100,
150. 5 => 100, 6 => 100, 7 => 100, 8 => 100,}
151. }
152. Mode_Learn_Rate.default = 0
153. # Limit gauge color 1
154. Gauge_Color1 = 28
155. # Limit gauge color 2
156. Gauge_Color2 = 29
157. # Negative States
158. Negative_States = [2,3,4,5,6,7,8]
159. # SE played when the limit gauge is full
160. Limit_SE = 'Chime2'
161. # Have the limit menu in the main menu?
162. Limit_Menu = true
163. # Index of the Limit command in the main menu?
164. Menu_Index = 3
165. # Is Mode selection enabled?
166. Mode_Enabled = true
167. end
168.
169. #==============================================================================
170. # ** Sound
171. #------------------------------------------------------------------------------
172. # This module plays sound effects. It obtains sound effects specified in the
173. # database from $data_system, and plays them.
174. #==============================================================================
175.
176. module Sound
177. # Limit
178. def self.play_limit
179. se = RPG::SE.new(Limit_Break::Limit_SE)
180. se.play
181. end
182. end
183.
184. #==============================================================================
185. # ** RPG::Skill
186. #==============================================================================
187.
188. class RPG::Skill < RPG::UsableItem
189. #--------------------------------------------------------------------------
190. # * Is this skill a Limit?
191. #--------------------------------------------------------------------------
192. def limit?
193. note_tag = @note.downcase.include?(Limit_Break::Skill_Tag.downcase)
194. if Limit_Break::Limits.include?(@id) or note_tag
195. return true
196. else
197. return false
198. end
199. end
200. end
201.
202. #==============================================================================
203. # ** Game_System
204. #------------------------------------------------------------------------------
205. # This class handles system-related data. Also manages vehicles and BGM, etc.
206. # The instance of this class is referenced by $game_system.
207. #==============================================================================
208.
209. class Game_System
210. #--------------------------------------------------------------------------
211. # * Alias Listing
212. #--------------------------------------------------------------------------
213. alias dargor_vx_limit_break_system_initialize initialize
214. #--------------------------------------------------------------------------
215. # * Object Initialization
216. #--------------------------------------------------------------------------
217. def initialize
218. # The Usual
219. dargor_vx_limit_break_system_initialize
220. # Add Limit command to the main menu
221. if Limit_Break::Limit_Menu
222. add_menu_command(Limit_Break::Menu_Index, Vocab::Limit)
223. end
224. end
225. end
226.
227. #==============================================================================
228. # ** Game_Actor
229. #------------------------------------------------------------------------------
230. # This class handles actors. It's used within the Game_Actors class
231. # ($game_actors) and referenced by the Game_Party class ($game_party).
232. #==============================================================================
233.
234. class Game_Actor
235. #--------------------------------------------------------------------------
236. # * Public Instance Variables
237. #--------------------------------------------------------------------------
238. attr_accessor :limit_mode
239. attr_accessor :limit_modes
240. attr_accessor :added_modes
241. attr_accessor :lp
242. #--------------------------------------------------------------------------
243. # * Alias Listing
244. #--------------------------------------------------------------------------
245. alias dargor_vx_limit_break_actor_setup setup
246. alias dargor_vx_limit_break_actor_skill_can_use? skill_can_use?
247. #--------------------------------------------------------------------------
248. # * Setup
249. # actor_id : actor ID
250. #--------------------------------------------------------------------------
251. def setup(actor_id)
252. dargor_vx_limit_break_actor_setup(actor_id)
253. @lp = 0 # How much the limit bar is filled
254. @limit_mode = 0 # ID of the limit (or overdrive) mode
255. @limit_modes = [0] # Limit modes available
256. @limit_modes_rate = {} # Learning progression of limit modes
257. @limit_modes_rate_max = {} # Max value to learn limit modes
258. @added_modes = [] # Limit Modes newly added
259. setup_limit_modes_rate # Setup limit modes learning variables
260. end
261. #--------------------------------------------------------------------------
262. # * Setup Limit Modes Rate
263. #--------------------------------------------------------------------------
264. def setup_limit_modes_rate
265. # Cycle through all Limit modes
266. for mode_id in [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]
267. # Set initial limit mode rate to 0
268. @limit_modes_rate[mode_id] = 0
269. # Set maximum limit mode rate
270. if Limit_Break::Mode_Learn_Rate[mode_id].nil?
271. value = Limit_Break::Mode_Learn_Rate.default
272. elsif Limit_Break::Mode_Learn_Rate[mode_id][self.id].nil?
273. value = Limit_Break::Mode_Learn_Rate.default
274. else
275. value = Limit_Break::Mode_Learn_Rate[mode_id][self.id]
276. end
277. @limit_modes_rate_max[mode_id] = value
278. # Gain limit mode if maximum rate is 0
279. if value == 0
280. gain_limit_mode(mode_id)
281. end
282. end
283. end
284. #--------------------------------------------------------------------------
285. # * Determine Usable Skills
286. # skill : skill
287. #--------------------------------------------------------------------------
288. def skill_can_use?(skill)
289. # Set a limit break as enabled in the Limit Menu
290. if Limit_Break::Limits.include?(skill.id) && skill_learn?(skill)
291. return true
292. end
293. # The usual
294. dargor_vx_limit_break_actor_skill_can_use?(skill)
295. end
296. #--------------------------------------------------------------------------
297. # * Determine Usable Limits
298. # skill_id : skill ID
299. #--------------------------------------------------------------------------
300. def limit_can_use?
301. return Limit_Break::Actors.include?(@actor_id)
302. end
303. #--------------------------------------------------------------------------
304. # * Determine Limit Command Access
305. #--------------------------------------------------------------------------
306. def limit_ready?
307. return @lp == maxlp
308. end
309. #--------------------------------------------------------------------------
310. # * Max LP
311. #--------------------------------------------------------------------------
312. def maxlp
313. result = Limit_Break::LP_Max[@actor_id]
314. result = Limit_Break::LP_Max.default if result.nil?
315. return result
316. end
317. #--------------------------------------------------------------------------
318. # * Gain LP
319. #--------------------------------------------------------------------------
320. def gain_lp(lp)
321. last_lp = @lp
322. @lp = [[@lp + lp, maxlp].min, 0].max
323. # Play Limit SE when lp reaches max
324. if @lp == maxlp && last_lp != maxlp
325. Sound.play_limit
326. end
327. end
328. #--------------------------------------------------------------------------
329. # * Gain a Limit Mode
330. # mode_id : mode ID
331. #--------------------------------------------------------------------------
332. def gain_limit_mode(mode_id)
333. unless @limit_modes.include?(mode_id)
334. @limit_modes << mode_id
335. # Add mode to newly added modes list if the mode is not available
336. unless @limit_modes_rate_max[mode_id] == 0
337. @added_modes << mode_id
338. end
339. end
340. @limit_modes.sort!
341. end
342. #--------------------------------------------------------------------------
343. # * Lose a Limit Mode
344. # mode_id : mode ID
345. #--------------------------------------------------------------------------
346. def lose_limit_mode(mode_id)
347. @limit_modes.delete!(mode_id)
348. @limit_modes.sort!
349. end
350. #--------------------------------------------------------------------------
351. # * Increase Limit Mode Learning Rate
352. # mode_id : mode ID
353. # value : value
354. #--------------------------------------------------------------------------
355. def increase_mode_rate(mode_id, value=1)
356. @limit_modes_rate[mode_id] += value
357. # Gain Limit Mode
358. if @limit_modes_rate[mode_id] >= @limit_modes_rate_max[mode_id]
359. gain_limit_mode(mode_id)
360. end
361. end
362. #--------------------------------------------------------------------------
363. # * Decrease Limit Mode Learning Rate
364. # mode_id : mode ID
365. # value : value (automatically turned to Negative Integer)
366. #--------------------------------------------------------------------------
367. def decrease_mode_rate(mode_id, value=1)
368. increase_mode_rate(mode_id, -value)
369. end
370. #--------------------------------------------------------------------------
371. # * Determine Near Incapacitation
372. #--------------------------------------------------------------------------
373. def crisis?
374. return self.hp < self.maxhp / 4
375. end
376. #--------------------------------------------------------------------------
377. # * Determine Element Nullification
378. # element_id : element ID
379. #--------------------------------------------------------------------------
380. def nullify_element?(element_id)
381. return element_rate(element_id) == 0
382. end
383. end
384.
385. #==============================================================================
386. # ** Game_Battler
387. #------------------------------------------------------------------------------
388. # This class deals with battlers. It's used as a superclass of the Game_Actor
389. # and Game_Enemy classes.
390. #==============================================================================
391.
392. class Game_Battler
393. #--------------------------------------------------------------------------
394. # * Public Instance Variables
395. #--------------------------------------------------------------------------
396. attr_reader :estimated_hp_damage
397. #--------------------------------------------------------------------------
398. # * Alias Listing
399. #--------------------------------------------------------------------------
400. alias dargor_vx_limit_break_battler_initialize initialize
401. alias dargor_vx_limit_break_battler_execute_damage execute_damage
402. alias dargor_vx_limit_break_battler_skill_effect skill_effect
403. alias dargor_vx_limit_break_battler_make_attack_damage_value make_attack_damage_value
404. alias dargor_vx_limit_break_battler_make_obj_damage_value make_obj_damage_value
405. alias dargor_vx_limit_break_battler_apply_state_changes apply_state_changes
406. #--------------------------------------------------------------------------
407. # * Object Initialization
408. #--------------------------------------------------------------------------
409. def initialize
410. @estimated_hp_damage = 0
411. # The usual
412. dargor_vx_limit_break_battler_initialize
413. end
414. #--------------------------------------------------------------------------
415. # * Estimation of Damage From Normal Attack
416. # attacker : Attacker
417. # The results are substituted for @hp_damage
418. # Does not take defense into conssideration
419. #--------------------------------------------------------------------------
420. def estimated_attack_damage_value(attacker)
421. damage = attacker.atk * 4 # base calculation
422. damage = 0 if damage < 0 # if negative, make 0
423. damage *= elements_max_rate(attacker.element_set) # elemental adjustment
424. damage /= 100
425. if damage == 0 # if damage is 0,
426. damage = rand(2) # half of the time, 1 dmg
427. elsif damage > 0 # a positive number?
428. @critical = (rand(100) < attacker.cri) # critical hit?
429. @critical = false if prevent_critical # criticals prevented?
430. damage *= 3 if @critical # critical adjustment
431. @critical = false
432. end
433. damage = apply_variance(damage, 20) # variance
434. return damage # damage HP
435. end
436. #--------------------------------------------------------------------------
437. # * Damage Reflection
438. # user : User of skill or item
439. # @hp_damage, @mp_damage, or @absorbed must be calculated before this
440. # method is called.
441. #--------------------------------------------------------------------------
442. def execute_damage(user)
443. @estimated_hp_damage = estimated_attack_damage_value(user)
444. # The usual
445. dargor_vx_limit_break_battler_execute_damage(user)
446. # If "Stoic"
447. if actor? && @hp_damage > 0
448. if self.limit_mode == 0
449. formula = Limit_Break::Mode_Increment[0]
450. result = eval(formula)
451. self.gain_lp(result)
452. end
453. self.increase_mode_rate(0)
454. end
455. # If "Warrior"
456. if !actor? && user.actor? && @hp_damage > 0
457. if user.limit_mode == 1
458. formula = Limit_Break::Mode_Increment[1]
459. result = eval(formula)
460. user.gain_lp(result)
461. end
462. user.increase_mode_rate(1)
463. end
464. # If "Healer"
465. if actor? && user.actor? && @hp_damage < 0
466. if user.limit_mode == 2
467. formula = Limit_Break::Mode_Increment[2]
468. result = eval(formula)
469. user.gain_lp(result)
470. end
471. user.increase_mode_rate(2)
472. end
473. # If "Comrad"
474. if actor? && @hp_damage > 0
475. for member in $game_party.members
476. next if member == self
477. if member.limit_mode == 3
478. formula = Limit_Break::Mode_Increment[3]
479. result = eval(formula)
480. member.gain_lp(result)
481. end
482. member.increase_mode_rate(3)
483. end
484. end
485. # If "Slayer"
486. if !actor? && self.dead? && user.actor?
487. if user.limit_mode == 4
488. formula = Limit_Break::Mode_Increment[4]
489. result = eval(formula)
490. user.gain_lp(result)
491. end
492. user.increase_mode_rate(4)
493. end
494. # If "Hero"
495. if !actor? && self.dead? && @critical && user.actor?
496. if user.limit_mode == 7
497. formula = Limit_Break::Mode_Increment[7]
498. result = eval(formula)
499. user.gain_lp(result)
500. end
501. user.increase_mode_rate(7)
502. end
503. # If "Avenger"
504. if actor? && self.dead? && !user.actor?
505. for member in $game_party.members
506. next if member == self
507. if user.limit_mode == 16
508. formula = Limit_Break::Mode_Increment[16]
509. result = eval(formula)
510. user.gain_lp(result)
511. end
512. user.increase_mode_rate(16)
513. end
514. end
515. end
516. #--------------------------------------------------------------------------
517. # * Apply Skill Effects
518. # user : Skill user
519. # skill : skill
520. #--------------------------------------------------------------------------
521. def skill_effect(user, skill)
522. # The usual
523. dargor_vx_limit_break_battler_skill_effect(user, skill)
524. # If "Tactician"
525. if !actor? && user.actor?
526. for state_id in Limit_Break::Negative_States
527. if @added_states.include?(state_id)
528. if user.limit_mode == 6
529. formula = Limit_Break::Mode_Increment[6]
530. result = eval(formula)
531. user.gain_lp(result)
532. end
533. user.increase_mode_rate(6)
534. end
535. end
536. end
537. # If "Sufferer"
538. if actor? && !user.actor?
539. for state_id in Limit_Break::Negative_States
540. if @added_states.include?(state_id)
541. if self.limit_mode == 14
542. formula = Limit_Break::Mode_Increment[14]
543. result = eval(formula)
544. self.gain_lp(result)
545. end
546. self.increase_mode_rate(14)
547. end
548. end
549. end
550. end
551. #--------------------------------------------------------------------------
552. # * Calculation of Damage From Normal Attack
553. # attacker : Attacker
554. # The results are substituted for @hp_damage
555. #--------------------------------------------------------------------------
556. def make_attack_damage_value(attacker)
557. # The usual
558. dargor_vx_limit_break_battler_make_attack_damage_value(attacker)
559. # If "Rook" (for Elements)
560. max_rate = elements_max_rate(attacker.element_set)
561. if actor? && max_rate < 100
562. if self.limit_mode == 13
563. formula = Limit_Break::Mode_Increment[13]
564. result = eval(formula)
565. target.gain_lp(result)
566. end
567. target.increase_mode_rate(13)
568. end
569. end
570. #--------------------------------------------------------------------------
571. # * Calculation of Damage Caused by Skills or Items
572. # user : User of skill or item
573. # obj : Skill or item (for normal attacks, this is nil)
574. # The results are substituted for @hp_damage or @mp_damage.
575. #--------------------------------------------------------------------------
576. def make_obj_damage_value(user, obj)
577. # The usual
578. dargor_vx_limit_break_battler_make_obj_damage_value(user, obj)
579. # If "Rook" (for Elements)
580. max_rate = elements_max_rate(obj.element_set)
581. if actor? && max_rate < 100
582. if self.limit_mode == 13
583. formula = Limit_Break::Mode_Increment[13]
584. result = eval(formula)
585. target.gain_lp(result)
586. end
587. target.increase_mode_rate(13)
588. end
589. end
590. #--------------------------------------------------------------------------
591. # * Apply State Changes
592. # obj : Skill, item, or attacker
593. #--------------------------------------------------------------------------
594. def apply_state_changes(obj)
595. plus = obj.plus_state_set
596. # If "Rook" (for States)
597. if actor?
598. for state_id in plus
599. if state_resist?(state_id) && Limit_Break::Negative_States.include?(state_id)
600. if self.limit_mode == 13
601. formula = Limit_Break::Mode_Increment[13]
602. result = eval(formula)
603. target.gain_lp(result)
604. end
605. target.increase_mode_rate(13)
606. end
607. end
608. end
609. # The usual
610. dargor_vx_limit_break_battler_apply_state_changes(obj)
611. end
612. end
613.
614. #==============================================================================
615. # ** Window_Base
616. #------------------------------------------------------------------------------
617. # This is a superclass of all windows in the game.
618. #==============================================================================
619.
620. class Window_Base < Window
621. #--------------------------------------------------------------------------
622. # * Alias Listing
623. #--------------------------------------------------------------------------
624. alias dargor_vx_limit_break_window_base_draw_actor_name draw_actor_name
625. #--------------------------------------------------------------------------
626. # * Draw Name
627. # actor : actor
628. # x : draw spot x-coordinate
629. # y : draw spot y-coordinate
630. #--------------------------------------------------------------------------
631. def draw_actor_name(actor, x, y)
632. unless $scene.is_a?(Scene_Status) or $scene.is_a?(Scene_File) or
633. $scene.is_a?(Scene_Limit)
634. draw_actor_limit_gauge(actor, x, y, 112)
635. end
636. dargor_vx_limit_break_window_base_draw_actor_name(actor, x, y)
637. end
638. #--------------------------------------------------------------------------
639. # * Draw Limit Gauge
640. # actor : actor
641. # x : draw spot x-coordinate
642. # y : draw spot y-coordinate
643. # width : Width
644. #--------------------------------------------------------------------------
645. def draw_actor_limit_gauge(actor, x, y, width = 120)
646. gw = width * actor.lp / actor.maxlp
647. gc1 = text_color(Limit_Break::Gauge_Color1)
648. gc2 = text_color(Limit_Break::Gauge_Color2)
649. self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
650. self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
651. end
652. #--------------------------------------------------------------------------
653. # * Draw Actor Limit
654. #--------------------------------------------------------------------------
655. def draw_actor_limit(actor, x, y)
656. draw_actor_limit_gauge(actor, x, y)
657. self.contents.font.color = system_color
658. self.contents.draw_text(x,y,120,WLH,Vocab::Limit)
659. end
660. #--------------------------------------------------------------------------
661. # * Draw Actor Limit Mode
662. #--------------------------------------------------------------------------
663. def draw_actor_limit_mode(actor, x, y)
664. self.contents.font.color = normal_color
665. mode = Limit_Break::Mode_Names[actor.limit_mode]
666. self.contents.draw_text(x,y,120,WLH,mode)
667. end
668. end
669.
670. #==============================================================================
671. # ** Window_Status
672. #------------------------------------------------------------------------------
673. # This window displays full status specs on the status screen.
674. #==============================================================================
675.
676. class Window_Status < Window_Base
677. #--------------------------------------------------------------------------
678. # * Alias Listing
679. #--------------------------------------------------------------------------
680. alias dargor_vx_limit_break_window_status_draw_basic_info draw_basic_info
681. #--------------------------------------------------------------------------
682. # * Draw Basic Information
683. # x : Draw spot X coordinate
684. # y : Draw spot Y coordinate
685. #--------------------------------------------------------------------------
686. def draw_basic_info(x, y)
687. # The usual
688. dargor_vx_limit_break_window_status_draw_basic_info(x,y)
689. # Draw actor limit gauge
690. draw_actor_limit(@actor, x, y + WLH * 4)
691. end
692. end
693.
694. #==============================================================================
695. # ** Window_Limit
696. #------------------------------------------------------------------------------
697. # This window displays a list of usable limits on the limit screen, etc.
698. #==============================================================================
699.
700. class Window_Limit < Window_Skill
701. #--------------------------------------------------------------------------
702. # * Refresh
703. #--------------------------------------------------------------------------
704. def refresh
705. @data = []
706. for skill in @actor.skills
707. @data.push(skill) if skill.limit?
708. if skill.id == @actor.last_skill_id
709. self.index = @data.size - 1
710. end
711. end
712. @item_max = @data.size
713. create_contents
714. for i in 0...@item_max
715. draw_item(i)
716. end
717. end
718. end
719.
720. #==============================================================================
721. # ** Window_LimitStatus
722. #------------------------------------------------------------------------------
723. # This window displays actor status on the limit screen, etc.
724. #==============================================================================
725.
726. class Window_LimitStatus < Window_Base
727. #--------------------------------------------------------------------------
728. # * Object Initialization
729. #--------------------------------------------------------------------------
730. def initialize(actor)
731. super(0,56,544,56)
732. @actor = actor
733. refresh
734. end
735. #--------------------------------------------------------------------------
736. # * Refresh
737. #--------------------------------------------------------------------------
738. def refresh
739. self.contents.clear
740. return if @actor.nil?
741. draw_actor_name(@actor, 4, 0)
742. draw_actor_limit(@actor, 192, 0)
743. draw_actor_limit_mode(@actor, 336, 0)
744. end
745. end
746.
747. #==============================================================================
748. # ** Window_LimitMode
749. #------------------------------------------------------------------------------
750. # This window displays a list of usable limit modes on the limit screen, etc.
751. #==============================================================================
752.
753. class Window_LimitMode < Window_Selectable
754. #--------------------------------------------------------------------------
755. # * Object Initialization
756. #--------------------------------------------------------------------------
757. def initialize(actor)
758. super(0, 112, 544, 304)
759. @actor = actor
760. @item_max = @actor.limit_modes.size
761. @column_max = 2
762. @mode_id = @actor.limit_mode
763. self.index = 0
764. refresh
765. end
766. #--------------------------------------------------------------------------
767. # * Selected Limit Mode Description
768. #--------------------------------------------------------------------------
769. def description
770. return Limit_Break::Mode_Descriptions[@actor.limit_modes[self.index]]
771. end
772. #--------------------------------------------------------------------------
773. # * Refresh
774. #--------------------------------------------------------------------------
775. def refresh
776. self.contents.clear
777. for i in 0...@item_max
778. rect = item_rect(i)
779. if @mode_id == @actor.limit_modes[i]
780. self.contents.font.color = text_color(29)
781. else
782. self.contents.font.color = normal_color
783. end
784. mode_id = @actor.limit_modes[i]
785. self.contents.draw_text(rect, Limit_Break::Mode_Names[mode_id])
786. end
787. end
788. #--------------------------------------------------------------------------
789. # * Select Limit Mode
790. #--------------------------------------------------------------------------
791. def select_mode
792. @mode_id = @actor.limit_modes[self.index]
793. @actor.limit_mode = @mode_id
794. refresh
795. end
796. #--------------------------------------------------------------------------
797. # * Update Help Text
798. #--------------------------------------------------------------------------
799. def update_help
800. @help_window.set_text(description == nil ? "" : description)
801. end
802. end
803.
804. #==============================================================================
805. # ** Scene_Limit
806. #------------------------------------------------------------------------------
807. # This class performs the limit screen processing.
808. #==============================================================================
809.
810. class Scene_Limit < Scene_Base
811. #--------------------------------------------------------------------------
812. # * Object Initialization
813. # actor_index : actor index
814. #--------------------------------------------------------------------------
815. def initialize(actor_index = 0)
816. @actor_index = actor_index
817. end
818. #--------------------------------------------------------------------------
819. # * Start Processing
820. #--------------------------------------------------------------------------
821. def start
822. create_menu_background
823. @actor = $game_party.members[@actor_index]
824. @help_window = Window_Help.new
825. @mode_window = Window_LimitMode.new(@actor)
826. @mode_window.help_window = @help_window
827. @mode_window.visible = false
828. @mode_window.active = false
829. @limit_window = Window_Limit.new(0, 112, 544, 304, @actor)
830. @limit_window.help_window = @help_window
831. @status_window = Window_LimitStatus.new(@actor)
832. @command_window = Window_Command.new(544,[Vocab::Limit, Vocab::Mode], 2)
833. @command_window.active = false
834. @command_window.visible = false
835. end
836. #--------------------------------------------------------------------------
837. # * Termination processing
838. #--------------------------------------------------------------------------
839. def terminate
840. dispose_menu_background
841. @command_window.dispose
842. @limit_window.dispose
843. @mode_window.dispose
844. @status_window.dispose
845. @help_window.dispose
846. end
847. #--------------------------------------------------------------------------
848. # * Frame Update
849. #--------------------------------------------------------------------------
850. def update
851. super
852. @command_window.update
853. @limit_window.update
854. @mode_window.update
855. @status_window.update
856. @help_window.update
857. if @command_window.active
858. update_command_selection
859. return
860. end
861. if @limit_window.active
862. update_limit_selection
863. return
864. end
865. if @mode_window.active
866. update_mode_selection
867. return
868. end
869. end
870. #--------------------------------------------------------------------------
871. # * Frame Update (Command Selection)
872. #--------------------------------------------------------------------------
873. def update_command_selection
874. if Input.trigger?(Input::B)
875. Sound.play_cancel
876. index = $game_system.menu_commands.index(Vocab::Limit)
877. $scene = Scene_Menu.new(index)
878. return
879. end
880. if Input.trigger?(Input::C)
881. Sound.play_decision
882. case @command_window.index
883. when 0
884. @limit_window.active = true
885. @limit_window.visible = true
886. @help_window.active = true
887. @help_window.visible = true
888. @mode_window.active = false
889. @mode_window.visible = false
890. @command_window.active = false
891. @command_window.visible = false
892. when 1
893. @mode_window.active = true
894. @mode_window.visible = true
895. @help_window.active = true
896. @help_window.visible = true
897. @limit_window.active = false
898. @limit_window.visible = false
899. @command_window.active = false
900. @command_window.visible = false
901. end
902. end
903. end
904. #--------------------------------------------------------------------------
905. # * Frame Update (Limit Selection)
906. #--------------------------------------------------------------------------
907. def update_limit_selection
908. if Input.trigger?(Input::B)
909. Sound.play_cancel
910. if Limit_Break::Mode_Enabled
911. @limit_window.active = false
912. @command_window.visible = true
913. @command_window.active = true
914. @help_window.active = false
915. @help_window.visible = false
916. else
917. index = $game_system.menu_commands.index(Vocab::Limit)
918. $scene = Scene_Menu.new(index)
919. end
920. return
921. end
922. end
923. #--------------------------------------------------------------------------
924. # * Frame Update (Mode Selection)
925. #--------------------------------------------------------------------------
926. def update_mode_selection
927. if Input.trigger?(Input::B)
928. Sound.play_cancel
929. @mode_window.active = false
930. @command_window.visible = true
931. @command_window.active = true
932. @help_window.active = false
933. @help_window.visible = false
934. return
935. end
936. if Input.trigger?(Input::C)
937. Sound.play_decision
938. @mode_window.select_mode
939. @status_window.refresh
940. end
941. end
942. end
943.
944. #==============================================================================
945. # ** Scene_Menu
946. #------------------------------------------------------------------------------
947. # This class performs the menu screen processing.
948. #==============================================================================
949.
950. class Scene_Menu < Scene_Base
951. #--------------------------------------------------------------------------
952. # * Alias Listing
953. #--------------------------------------------------------------------------
954. alias dargor_vx_limit_break_menu_update_command_selection update_command_selection
955. alias dargor_vx_limit_break_menu_update_actor_selection update_actor_selection
956. #--------------------------------------------------------------------------
957. # * Update Command Selection
958. #--------------------------------------------------------------------------
959. def update_command_selection
960. # The usual
961. dargor_vx_limit_break_menu_update_command_selection
962. # Limit Selection
963. if Input.trigger?(Input::C)
964. case @command_window.selection
965. when Vocab::Limit
966. start_actor_selection
967. return
968. end
969. end
970. end
971. #--------------------------------------------------------------------------
972. # * Update Actor Selection
973. #--------------------------------------------------------------------------
974. def update_actor_selection
975. # The usual
976. dargor_vx_limit_break_menu_update_actor_selection
977. # Limit Selection
978. if Input.trigger?(Input::C)
979. $game_party.last_actor_index = @status_window.index
980. Sound.play_decision
981. case @command_window.selection
982. when Vocab::Limit
983. $scene = Scene_Limit.new(@status_window.index)
984. end
985. end
986. end
987. end
988.
989. #==============================================================================
990. # ** Scene_Battle
991. #------------------------------------------------------------------------------
992. # This class performs battle screen processing.
993. #==============================================================================
994.
995. class Scene_Battle < Scene_Base
996. #--------------------------------------------------------------------------
997. # * Alias Listing
998. #--------------------------------------------------------------------------
999. alias dargor_vx_limit_break_battle_start_actor_command_selection start_actor_command_selection
1000. alias dargor_vx_limit_break_battle_update_actor_command_selection update_actor_command_selection
1001. alias dargor_vx_limit_break_battle_next_actor next_actor
1002. alias dargor_vx_limit_break_battle_prior_actor prior_actor
1003. alias dargor_vx_limit_break_battle_battle_end battle_end
1004. alias dargor_vx_limit_break_battle_display_evasion display_evasion
1005. alias dargor_vx_limit_break_battle_execute_action_skill execute_action_skill
1006. alias dargor_vx_limit_break_battle_display_level_up display_level_up
1007. #--------------------------------------------------------------------------
1008. # * Start Actor Command Selection
1009. #--------------------------------------------------------------------------
1010. def start_actor_command_selection
1011. # Add the Limit command if actor's limit gauge is full
1012. if @active_battler.limit_ready? && @active_battler.limit_can_use?
1013. index = Limit_Break::Command_Index[@active_battler.id]
1014. @active_battler.add_command(index, Vocab::LimitCommand)
1015. else
1016. @active_battler.remove_command(Vocab::LimitCommand)
1017. end
1018. # The usual
1019. dargor_vx_limit_break_battle_start_actor_command_selection
1020. end
1021. #--------------------------------------------------------------------------
1022. # * Update Actor Command Selection
1023. #--------------------------------------------------------------------------
1024. def update_actor_command_selection
1025. # The usual
1026. dargor_vx_limit_break_battle_update_actor_command_selection
1027. # Limit selection
1028. if Input.trigger?(Input::C)
1029. case @actor_command_window.selection
1030. when @active_battler.class.command_name(Vocab::LimitCommand)
1031. start_limit_selection
1032. return
1033. end
1034. end
1035. end
1036. #--------------------------------------------------------------------------
1037. # * Go to Command Input for Next Actor
1038. #--------------------------------------------------------------------------
1039. def next_actor
1040. # The usual
1041. dargor_vx_limit_break_battle_next_actor
1042. # If "Ally", "Daredevil", "Alone" or "Victim"
1043. if @active_battler != nil
1044. @active_battler.increase_mode_rate(8)
1045. # Ally or Daredevil
1046. if [8, 9].include?(@active_battler.limit_mode)
1047. # Gain LP when turn reach actor
1048. formula_id = @active_battler.crisis? ? 9 : 8
1049. formula = Limit_Break::Mode_Increment[formula_id]
1050. result = eval(formula)
1051. @active_battler.gain_lp(result)
1052. end
1053. # Alone
1054. alone = true
1055. for member in $game_party.members
1056. next if member == @active_battler
1057. alone &&= member.dead?
1058. end
1059. if alone
1060. @active_battler.increase_mode_rate(10)
1061. end
1062. if @active_battler.limit_mode == 10 && alone
1063. # Gain LP when turn reach actor
1064. formula = Limit_Break::Mode_Increment[10]
1065. result = eval(formula)
1066. @active_battler.gain_lp(result)
1067. end
1068. # Victim
1069. victim = false
1070. for state_id in Limit_Break::Negative_States
1071. if @active_battler.state?(state_id)
1072. victim = true
1073. end
1074. end
1075. if victim
1076. @active_battler.increase_mode_rate(15)
1077. end
1078. if @active_battler.limit_mode == 15 && victim
1079. formula = Limit_Break::Mode_Increment[15]
1080. result = eval(formula)
1081. @active_battler.gain_lp(result)
1082. end
1083. end
1084. @status_window.refresh
1085. end
1086. #--------------------------------------------------------------------------
1087. # * Go to Command Input of Previous Actor
1088. #--------------------------------------------------------------------------
1089. def prior_actor
1090. # If "Ally", "Daredevil", "Alone" or "Victim"
1091. if @active_battler != nil
1092. @active_battler.increase_mode_rate(8)
1093. # Ally or Daredevil
1094. if [8, 9].include?(@active_battler.limit_mode)
1095. # Gain LP when turn reach actor
1096. formula_id = @active_battler.crisis? ? 9 : 8
1097. formula = Limit_Break::Mode_Increment[formula_id]
1098. result = eval(formula)
1099. @active_battler.gain_lp(-result)
1100. end
1101. # Alone
1102. alone = true
1103. for member in $game_party.members
1104. next if member == @active_battler
1105. alone &&= member.dead?
1106. end
1107. if alone
1108. @active_battler.increase_mode_rate(10)
1109. end
1110. if @active_battler.limit_mode == 10 && alone
1111. # Gain LP when turn reach actor
1112. formula = Limit_Break::Mode_Increment[10]
1113. result = eval(formula)
1114. @active_battler.gain_lp(-result)
1115. end
1116. # Victim
1117. victim = false
1118. for state_id in Limit_Break::Negative_States
1119. if @active_battler.state?(state_id)
1120. victim = true
1121. end
1122. end
1123. if victim
1124. @active_battler.increase_mode_rate(15)
1125. end
1126. if @active_battler.limit_mode == 15 && victim
1127. formula = Limit_Break::Mode_Increment[15]
1128. result = eval(formula)
1129. @active_battler.gain_lp(-result)
1130. end
1131. end
1132. @status_window.refresh
1133. # The usual
1134. dargor_vx_limit_break_battle_prior_actor
1135. end
1136. #--------------------------------------------------------------------------
1137. # * End Battle
1138. # result : Results (0: win, 1: escape, 2:lose)
1139. #--------------------------------------------------------------------------
1140. def battle_end(result)
1141. # If "Victor"
1142. if result == 0
1143. for member in $game_party.members
1144. next if member.dead?
1145. if member.limit_mode == 5
1146. formula = Limit_Break::Mode_Increment[5]
1147. result = eval(formula)
1148. member.gain_lp(result)
1149. end
1150. member.increase_mode_rate(5)
1151. end
1152. end
1153. # If "Coward"
1154. if result == 1
1155. for member in $game_party.members
1156. next if member.dead?
1157. if member.limit_mode == 11
1158. formula = Limit_Break::Mode_Increment[11]
1159. result = eval(formula)
1160. member.gain_lp(result)
1161. end
1162. member.increase_mode_rate(11)
1163. end
1164. end
1165. # The usual
1166. dargor_vx_limit_break_battle_battle_end(result)
1167. end
1168. #--------------------------------------------------------------------------
1169. # * Show Escape
1170. # target : Target
1171. # obj : Skill or item
1172. #--------------------------------------------------------------------------
1173. def display_evasion(target, obj = nil)
1174. # If "Dancer"
1175. if target.actor?
1176. if target.limit_mode == 12
1177. formula = Limit_Break::Mode_Increment[12]
1178. result = eval(formula)
1179. target.gain_lp(result)
1180. end
1181. target.increase_mode_rate(12)
1182. end
1183. # The usual
1184. dargor_vx_limit_break_battle_display_evasion(target, obj)
1185. end
1186. #--------------------------------------------------------------------------
1187. # * Start Skill Selection
1188. #--------------------------------------------------------------------------
1189. def start_limit_selection
1190. @help_window = Window_Help.new
1191. @skill_window = Window_Limit.new(0, 56, 544, 232, @active_battler)
1192. @skill_window.help_window = @help_window
1193. @actor_command_window.active = false
1194. end
1195. #--------------------------------------------------------------------------
1196. # * Execute Battle Action: Skill
1197. #--------------------------------------------------------------------------
1198. def execute_action_skill
1199. skill = @active_battler.action.skill
1200. # If executing a Limit
1201. if @active_battler.actor? && @active_battler.limit_ready? &&
1202. Limit_Break::Limits.include?(skill.id)
1203. @active_battler.remove_command(Vocab::LimitCommand)
1204. @active_battler.lp = 0
1205. end
1206. # The usual
1207. dargor_vx_limit_break_battle_execute_action_skill
1208. end
1209. #--------------------------------------------------------------------------
1210. # * Display Level Up
1211. #--------------------------------------------------------------------------
1212. def display_level_up
1213. # The usual
1214. dargor_vx_limit_break_battle_display_level_up
1215. # Display new limit modes
1216. display_new_limit_modes
1217. end
1218. #--------------------------------------------------------------------------
1219. # * Display Level Up
1220. #--------------------------------------------------------------------------
1221. def display_new_limit_modes
1222. for member in $game_party.members
1223. for mode_id in member.added_modes
1224. mode_name = Limit_Break::Mode_Names[mode_id]
1225. text = sprintf(Vocab::ModeLearn, member.name, mode_name)
1226. $game_message.texts.push(text)
1227. end
1228. member.added_modes.clear
1229. wait_for_message
1230. end
1231. wait_for_message
1232. end
1233. end
1234.
ok thanks