pigu_6

Yanfly|Ace Status Menu

Nov 24th, 2012
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.47 KB | None | 0 0
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Ace Status Menu v1.01
  4. # -- Last Updated: 2011.12.26
  5. # -- Level: Normal
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================
  9.  
  10. $imported = {} if $imported.nil?
  11. $imported["YEA-StatusMenu"] = true
  12.  
  13. #==============================================================================
  14. # ▼ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2011.12.26 - Compatibility Update: Rename Actor
  17. # 2011.12.23 - Started Script and Finished.
  18. #
  19. #==============================================================================
  20. # ▼ Introduction
  21. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  22. # This script changes the status screen completely to something the player can
  23. # interact with more and be able to view actor data with more clarity. The
  24. # player is able to view the general information for an actor (parameters and
  25. # experience), a parameters bar graph, the various hidden extra parameters
  26. # (named properties in the script), and a customizable biography for the actor.
  27. # Also with this script, biographies can be changed at any time using a script
  28. # call to add more of a personal touch to characters.
  29. #
  30. #==============================================================================
  31. # ▼ Instructions
  32. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  33. # To install this script, open up your script editor and copy/paste this script
  34. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  35. #
  36. # -----------------------------------------------------------------------------
  37. # Script Calls - These commands are used with script calls.
  38. # -----------------------------------------------------------------------------
  39. # $game_actors[x].description = string
  40. # Changes the biography description for actor x to that of the string. Use \n
  41. # to designate linebreaks in the string. If you wish to use text codes, write
  42. # them in the strings as \\n[2] or \\c[3] to make them work properly.
  43. #
  44. #==============================================================================
  45. # ▼ Compatibility
  46. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  47. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  48. # it will run with RPG Maker VX without adjusting.
  49. #
  50. #==============================================================================
  51.  
  52. module YEA
  53. module STATUS
  54.  
  55. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  56. # - Command Window Settings -
  57. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  58. # This section adjusts the commands that appear in the command window used
  59. # for the status screen. Rearrange the commands, add new ones, remove them
  60. # as you see fit.
  61. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  62. COMMANDS =[ # The order at which the menu items are shown.
  63. # [ :command, "Display"],
  64. [ :general, "General"],
  65. [ :parameters, "Parameters"],
  66. [ :properties, "Properties"],
  67. # [ :custom1, "Skills"],
  68. # [ :custom2, "Equipment"],
  69. # [ :custom3, "Class"],
  70. [ :biography, "Biography"],
  71. [ :rename, "Rename"], # Requires YEA - Rename Actor
  72. [ :retitle, "Retitle"], # Requires YEA - Rename Actor
  73. ] # Do not remove this.
  74.  
  75. #--------------------------------------------------------------------------
  76. # - Status Custom Commands -
  77. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  78. # For those who use scripts to that may produce unique effects for the
  79. # status menu, use this hash to manage the custom commands for the Status
  80. # Command Window. You can disable certain commands or prevent them from
  81. # appearing by using switches. If you don't wish to bind them to a switch,
  82. # set the proper switch to 0 for it to have no impact.
  83. #--------------------------------------------------------------------------
  84. CUSTOM_STATUS_COMMANDS ={
  85. # :command => [EnableSwitch, ShowSwitch, Handler Method, Window Draw],
  86. :custom1 => [ 0, 0, :command_name1, :draw_custom1],
  87. :custom2 => [ 0, 0, :command_name2, :draw_custom2],
  88. :custom3 => [ 0, 0, :command_name3, :draw_custom3],
  89. } # Do not remove this.
  90.  
  91. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  92. # - General Window Settings -
  93. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  94. # These settings adjust the way the general window visually appears.
  95. # Not many changes need to be done here other than vocab changes.
  96. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  97. PARAMETERS_VOCAB = "Parameters" # Title used for Parameters.
  98. EXPERIENCE_VOCAB = "Experience" # Title used for Experience.
  99. NEXT_TOTAL_VOCAB = "Next %s Total EXP" # Label used for total experience.
  100.  
  101. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  102. # - Parameters Window Settings -
  103. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  104. # These settings adjust the way the parameters window visually appears.
  105. # Each of the stats have a non-window colour. Adjust them as you see fit.
  106. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  107. PARAM_COLOUR ={
  108. # ParamID => [:stat, Colour1, Colour2 ],
  109. 2 => [ :atk, Color.new(225, 100, 100), Color.new(240, 150, 150)],
  110. 3 => [ :def, Color.new(250, 150, 30), Color.new(250, 180, 100)],
  111. 4 => [ :mat, Color.new( 70, 140, 200), Color.new(135, 180, 230)],
  112. 5 => [ :mdf, Color.new(135, 130, 190), Color.new(170, 160, 220)],
  113. 6 => [ :agi, Color.new( 60, 180, 80), Color.new(120, 200, 120)],
  114. 7 => [ :luk, Color.new(255, 240, 100), Color.new(255, 250, 200)],
  115. } # Do not remove this.
  116.  
  117. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  118. # - Properties Window Settings -
  119. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  120. # These settings adjust the way the properties window visually appears.
  121. # The properties have abbreviations, but leaving them as such makes things
  122. # confusing (as it's sometimes hard to figure out what the abbreviations
  123. # mean). Change the way the appear, whether or not they appear, and what
  124. # order they will appear in.
  125. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  126. PROPERTIES_FONT_SIZE = 16 # Font size used for properties.
  127.  
  128. # These are the properties that appear in column 1.
  129. PROPERTIES_COLUMN1 =[
  130. [:hit, "Hit Rate"],
  131. [:eva, "Evasion"],
  132. [:cri, "Critical Hit"],
  133. [:cev, "Critical Evade"],
  134. [:mev, "Magic Evasion"],
  135. [:mrf, "Magic Reflect"],
  136. [:cnt, "Counter Rate"],
  137. [:tgr, "Target Rate"],
  138. ] # Do not remove this.
  139.  
  140. # These are the properties that appear in column 2.
  141. PROPERTIES_COLUMN2 =[
  142. [:hrg, "HP Regen"],
  143. [:mrg, "MP Regen"],
  144. [:trg, "TP Regen"],
  145. [:rec, "Recovery"],
  146. [:grd, "Guard Rate"],
  147. [:pha, "Item Boost"],
  148. [:exr, "EXP Rate"],
  149. [:tcr, "TP Charge"],
  150. ] # Do not remove this.
  151.  
  152. # These are the properties that appear in column 3.
  153. PROPERTIES_COLUMN3 =[
  154. [:hcr, "HP Cost Rate"], # Requires YEA - Skill Cost Manager
  155. [:mcr, "MP Cost Rate"],
  156. [:tcr, "TP Cost Rate"], # Requires YEA - Skill Cost Manager
  157. [:cdr, "Cooldown Rate"], # Requires YEA - Skill Restrictions
  158. [:wur, "Warmup Rate"], # Requires YEA - Skill Restrictions
  159. [:pdr, "Physical Damage"],
  160. [:mdr, "Magical Damage"],
  161. [:fdr, "Floor Damage"],
  162. ] # Do not remove this.
  163.  
  164. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  165. # - Biography Window Settings -
  166. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  167. # These settings adjust the way the biography appears including the title
  168. # used at the top, the font size, and whatnot.
  169. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  170. BIOGRAPHY_NICKNAME_TEXT = "%s the %s" # How the nickname will appear.
  171. BIOGRAPHY_NICKNAME_SIZE = 32 # Size of the font used.
  172.  
  173. end # STATUS
  174. end # YEA
  175.  
  176. #==============================================================================
  177. # ▼ Editting anything past this point may potentially result in causing
  178. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  179. # halitosis so edit at your own risk.
  180. #==============================================================================
  181.  
  182. #==============================================================================
  183. # ■ Numeric
  184. #==============================================================================
  185.  
  186. class Numeric
  187.  
  188. #--------------------------------------------------------------------------
  189. # new method: group_digits
  190. #--------------------------------------------------------------------------
  191. unless $imported["YEA-CoreEngine"]
  192. def group; return self.to_s; end
  193. end # $imported["YEA-CoreEngine"]
  194.  
  195. end # Numeric
  196.  
  197. #==============================================================================
  198. # ■ Game_Temp
  199. #==============================================================================
  200.  
  201. class Game_Temp
  202.  
  203. #--------------------------------------------------------------------------
  204. # public instance variables
  205. #--------------------------------------------------------------------------
  206. attr_accessor :scene_status_index
  207. attr_accessor :scene_status_oy
  208.  
  209. end # Game_Temp
  210.  
  211. #==============================================================================
  212. # ■ Game_Actor
  213. #==============================================================================
  214.  
  215. class Game_Actor < Game_Battler
  216.  
  217. #--------------------------------------------------------------------------
  218. # new method: description=
  219. #--------------------------------------------------------------------------
  220. def description=(text)
  221. @description = text
  222. end
  223.  
  224. #--------------------------------------------------------------------------
  225. # overwrite method: description
  226. #--------------------------------------------------------------------------
  227. def description
  228. return @description unless @description.nil?
  229. return actor.description
  230. end
  231.  
  232. end # Game_Actor
  233.  
  234. #==============================================================================
  235. # ■ Window_StatusCommand
  236. #==============================================================================
  237.  
  238. class Window_StatusCommand < Window_Command
  239.  
  240. #--------------------------------------------------------------------------
  241. # public instance variables
  242. #--------------------------------------------------------------------------
  243. attr_accessor :item_window
  244.  
  245. #--------------------------------------------------------------------------
  246. # initialize
  247. #--------------------------------------------------------------------------
  248. def initialize(dx, dy)
  249. super(dx, dy)
  250. @actor = nil
  251. end
  252.  
  253. #--------------------------------------------------------------------------
  254. # window_width
  255. #--------------------------------------------------------------------------
  256. def window_width; return 160; end
  257.  
  258. #--------------------------------------------------------------------------
  259. # actor=
  260. #--------------------------------------------------------------------------
  261. def actor=(actor)
  262. return if @actor == actor
  263. @actor = actor
  264. refresh
  265. end
  266.  
  267. #--------------------------------------------------------------------------
  268. # visible_line_number
  269. #--------------------------------------------------------------------------
  270. def visible_line_number; return 4; end
  271.  
  272. #--------------------------------------------------------------------------
  273. # ok_enabled?
  274. #--------------------------------------------------------------------------
  275. def ok_enabled?
  276. return handle?(current_symbol)
  277. end
  278.  
  279. #--------------------------------------------------------------------------
  280. # make_command_list
  281. #--------------------------------------------------------------------------
  282. def make_command_list
  283. return unless @actor
  284. for command in YEA::STATUS::COMMANDS
  285. case command[0]
  286. #--- Default ---
  287. when :general, :parameters, :properties, :biography
  288. add_command(command[1], command[0])
  289. #--- Yanfly Engine Ace ---
  290. when :rename
  291. next unless $imported["YEA-RenameActor"]
  292. add_command(command[1], command[0], @actor.rename_allow?)
  293. when :retitle
  294. next unless $imported["YEA-RenameActor"]
  295. add_command(command[1], command[0], @actor.retitle_allow?)
  296. #--- Custom Commands ---
  297. else
  298. process_custom_command(command)
  299. end
  300. end
  301. if !$game_temp.scene_status_index.nil?
  302. select($game_temp.scene_status_index)
  303. self.oy = $game_temp.scene_status_oy
  304. end
  305. $game_temp.scene_status_index = nil
  306. $game_temp.scene_status_oy = nil
  307. end
  308.  
  309. #--------------------------------------------------------------------------
  310. # process_ok
  311. #--------------------------------------------------------------------------
  312. def process_ok
  313. $game_temp.scene_status_index = index
  314. $game_temp.scene_status_oy = self.oy
  315. super
  316. end
  317.  
  318. #--------------------------------------------------------------------------
  319. # process_custom_command
  320. #--------------------------------------------------------------------------
  321. def process_custom_command(command)
  322. return unless YEA::STATUS::CUSTOM_STATUS_COMMANDS.include?(command[0])
  323. show = YEA::STATUS::CUSTOM_STATUS_COMMANDS[command[0]][1]
  324. continue = show <= 0 ? true : $game_switches[show]
  325. return unless continue
  326. text = command[1]
  327. switch = YEA::STATUS::CUSTOM_STATUS_COMMANDS[command[0]][0]
  328. enabled = switch <= 0 ? true : $game_switches[switch]
  329. add_command(text, command[0], enabled)
  330. end
  331.  
  332. #--------------------------------------------------------------------------
  333. # update
  334. #--------------------------------------------------------------------------
  335. def update
  336. super
  337. update_item_window
  338. end
  339.  
  340. #--------------------------------------------------------------------------
  341. # update_item_window
  342. #--------------------------------------------------------------------------
  343. def update_item_window
  344. return if @item_window.nil?
  345. return if @current_index == current_symbol
  346. @current_index = current_symbol
  347. @item_window.refresh
  348. end
  349.  
  350. #--------------------------------------------------------------------------
  351. # item_window=
  352. #--------------------------------------------------------------------------
  353. def item_window=(window)
  354. @item_window = window
  355. update
  356. end
  357.  
  358. #--------------------------------------------------------------------------
  359. # update_help
  360. #--------------------------------------------------------------------------
  361. def update_help
  362. return if @actor.nil?
  363. @help_window.set_text(@actor.actor.description)
  364. end
  365.  
  366. end # Window_StatusCommand
  367.  
  368. #==============================================================================
  369. # ■ Window_StatusActor
  370. #==============================================================================
  371.  
  372. class Window_StatusActor < Window_Base
  373.  
  374. #--------------------------------------------------------------------------
  375. # initialize
  376. #--------------------------------------------------------------------------
  377. def initialize(dx, dy)
  378. super(dx, dy, window_width, fitting_height(4))
  379. @actor = nil
  380. end
  381.  
  382. #--------------------------------------------------------------------------
  383. # window_width
  384. #--------------------------------------------------------------------------
  385. def window_width; return Graphics.width - 160; end
  386.  
  387. #--------------------------------------------------------------------------
  388. # actor=
  389. #--------------------------------------------------------------------------
  390. def actor=(actor)
  391. return if @actor == actor
  392. @actor = actor
  393. refresh
  394. end
  395.  
  396. #--------------------------------------------------------------------------
  397. # refresh
  398. #--------------------------------------------------------------------------
  399. def refresh
  400. contents.clear
  401. return unless @actor
  402. draw_actor_face(@actor, 0, 0)
  403. draw_actor_simple_status(@actor, 108, line_height / 2)
  404. end
  405.  
  406. end # Window_StatusActor
  407.  
  408. #==============================================================================
  409. # ■ Window_StatusItem
  410. #==============================================================================
  411.  
  412. class Window_StatusItem < Window_Base
  413.  
  414. #--------------------------------------------------------------------------
  415. # initialize
  416. #--------------------------------------------------------------------------
  417. def initialize(dx, dy, command_window)
  418. super(dx, dy, Graphics.width, Graphics.height - dy)
  419. @command_window = command_window
  420. @actor = nil
  421. refresh
  422. end
  423.  
  424. #--------------------------------------------------------------------------
  425. # actor=
  426. #--------------------------------------------------------------------------
  427. def actor=(actor)
  428. return if @actor == actor
  429. @actor = actor
  430. refresh
  431. end
  432.  
  433. #--------------------------------------------------------------------------
  434. # refresh
  435. #--------------------------------------------------------------------------
  436. def refresh
  437. contents.clear
  438. reset_font_settings
  439. return unless @actor
  440. draw_window_contents
  441. end
  442.  
  443. #--------------------------------------------------------------------------
  444. # draw_window_contents
  445. #--------------------------------------------------------------------------
  446. def draw_window_contents
  447. case @command_window.current_symbol
  448. when :general
  449. draw_actor_general
  450. when :parameters
  451. draw_parameter_graph
  452. when :properties
  453. draw_properties_list
  454. when :biography, :rename, :retitle
  455. draw_actor_biography
  456. else
  457. draw_custom
  458. end
  459. end
  460.  
  461. #--------------------------------------------------------------------------
  462. # draw_actor_general
  463. #--------------------------------------------------------------------------
  464. def draw_actor_general
  465. change_color(system_color)
  466. text = YEA::STATUS::PARAMETERS_VOCAB
  467. draw_text(0, 0, contents.width/2, line_height, text, 1)
  468. text = YEA::STATUS::EXPERIENCE_VOCAB
  469. draw_text(contents.width/2, 0, contents.width/2, line_height, text, 1)
  470. draw_general_parameters
  471. draw_general_experience
  472. end
  473.  
  474. #--------------------------------------------------------------------------
  475. # draw_general_parameters
  476. #--------------------------------------------------------------------------
  477. def draw_general_parameters
  478. dx = 24
  479. dy = line_height / 2
  480. draw_actor_level(dx, line_height*1+dy, contents.width/2 - 24)
  481. draw_actor_param(0, dx, line_height*2+dy, contents.width/2 - 24)
  482. draw_actor_param(1, dx, line_height*3+dy, contents.width/2 - 24)
  483. draw_actor_param(2, dx, line_height*4+dy, contents.width/4 - 12)
  484. draw_actor_param(4, dx, line_height*5+dy, contents.width/4 - 12)
  485. draw_actor_param(6, dx, line_height*6+dy, contents.width/4 - 12)
  486. dx += contents.width/4 - 12
  487. draw_actor_param(3, dx, line_height*4+dy, contents.width/4 - 12)
  488. draw_actor_param(5, dx, line_height*5+dy, contents.width/4 - 12)
  489. draw_actor_param(7, dx, line_height*6+dy, contents.width/4 - 12)
  490. end
  491.  
  492. #--------------------------------------------------------------------------
  493. # draw_actor_level
  494. #--------------------------------------------------------------------------
  495. def draw_actor_level(dx, dy, dw)
  496. colour = Color.new(0, 0, 0, translucent_alpha/2)
  497. rect = Rect.new(dx+1, dy+1, dw-2, line_height-2)
  498. contents.fill_rect(rect, colour)
  499. change_color(system_color)
  500. draw_text(dx+4, dy, dw-8, line_height, Vocab::level)
  501. change_color(normal_color)
  502. draw_text(dx+4, dy, dw-8, line_height, @actor.level.group, 2)
  503. end
  504.  
  505. #--------------------------------------------------------------------------
  506. # draw_actor_param
  507. #--------------------------------------------------------------------------
  508. def draw_actor_param(param_id, dx, dy, dw)
  509. colour = Color.new(0, 0, 0, translucent_alpha/2)
  510. rect = Rect.new(dx+1, dy+1, dw-2, line_height-2)
  511. contents.fill_rect(rect, colour)
  512. change_color(system_color)
  513. draw_text(dx+4, dy, dw-8, line_height, Vocab::param(param_id))
  514. change_color(normal_color)
  515. draw_text(dx+4, dy, dw-8, line_height, @actor.param(param_id).group, 2)
  516. end
  517.  
  518. #--------------------------------------------------------------------------
  519. # draw_general_experience
  520. #--------------------------------------------------------------------------
  521. def draw_general_experience
  522. if @actor.max_level?
  523. s1 = @actor.exp.group
  524. s2 = "-------"
  525. s3 = "-------"
  526. else
  527. s1 = @actor.exp.group
  528. s2 = (@actor.next_level_exp - @actor.exp).group
  529. s3 = @actor.next_level_exp.group
  530. end
  531. s_next = sprintf(Vocab::ExpNext, Vocab::level)
  532. total_next_text = sprintf(YEA::STATUS::NEXT_TOTAL_VOCAB, Vocab::level)
  533. change_color(system_color)
  534. dx = contents.width/2 + 12
  535. dy = line_height * 3 / 2
  536. dw = contents.width/2 - 36
  537. draw_text(dx, dy + line_height * 0, dw, line_height, Vocab::ExpTotal)
  538. draw_text(dx, dy + line_height * 2, dw, line_height, s_next)
  539. draw_text(dx, dy + line_height * 4, dw, line_height, total_next_text)
  540. change_color(normal_color)
  541. draw_text(dx, dy + line_height * 1, dw, line_height, s1, 2)
  542. draw_text(dx, dy + line_height * 3, dw, line_height, s2, 2)
  543. draw_text(dx, dy + line_height * 5, dw, line_height, s3, 2)
  544. end
  545.  
  546. #--------------------------------------------------------------------------
  547. # draw_parameter_graph
  548. #--------------------------------------------------------------------------
  549. def draw_parameter_graph
  550. draw_parameter_title
  551. dy = line_height * 3/2
  552. maximum = 1
  553. minimum = @actor.param_max(2)
  554. for i in 2..7
  555. maximum = [@actor.param(i), maximum].max
  556. minimum = [@actor.param(i), minimum].min
  557. end
  558. maximum += minimum * 0.33 unless maximum == minimum
  559. for i in 2..7
  560. rate = calculate_rate(maximum, minimum, i)
  561. dy = line_height * i - line_height/2
  562. draw_param_gauge(i, dy, rate)
  563. change_color(system_color)
  564. draw_text(28, dy, contents.width - 56, line_height, Vocab::param(i))
  565. dw = (contents.width - 48) * rate - 8
  566. change_color(normal_color)
  567. draw_text(28, dy, dw, line_height, @actor.param(i).group, 2)
  568. end
  569. end
  570.  
  571. #--------------------------------------------------------------------------
  572. # calculate_rate
  573. #--------------------------------------------------------------------------
  574. def calculate_rate(maximum, minimum, param_id)
  575. return 1.0 if maximum == minimum
  576. rate = (@actor.param(param_id).to_f - minimum) / (maximum - minimum).to_f
  577. rate *= 0.67
  578. rate += 0.33
  579. return rate
  580. end
  581.  
  582. #--------------------------------------------------------------------------
  583. # draw_param_gauge
  584. #--------------------------------------------------------------------------
  585. def draw_param_gauge(param_id, dy, rate)
  586. dw = contents.width - 48
  587. colour1 = param_gauge1(param_id)
  588. colour2 = param_gauge2(param_id)
  589. draw_gauge(24, dy, dw, rate, colour1, colour2)
  590. end
  591.  
  592. #--------------------------------------------------------------------------
  593. # param_gauge1
  594. #--------------------------------------------------------------------------
  595. def param_gauge1(param_id)
  596. return YEA::STATUS::PARAM_COLOUR[param_id][1]
  597. end
  598.  
  599. #--------------------------------------------------------------------------
  600. # param_gauge2
  601. #--------------------------------------------------------------------------
  602. def param_gauge2(param_id)
  603. return YEA::STATUS::PARAM_COLOUR[param_id][2]
  604. end
  605.  
  606. #--------------------------------------------------------------------------
  607. # draw_parameter_title
  608. #--------------------------------------------------------------------------
  609. def draw_parameter_title
  610. colour = Color.new(0, 0, 0, translucent_alpha/2)
  611. rect = Rect.new(0, 0, contents.width, contents.height)
  612. contents.fill_rect(rect, colour)
  613. change_color(system_color)
  614. text = YEA::STATUS::PARAMETERS_VOCAB
  615. draw_text(0, line_height/3, contents.width, line_height, text, 1)
  616. end
  617.  
  618. #--------------------------------------------------------------------------
  619. # draw_properties_list
  620. #--------------------------------------------------------------------------
  621. def draw_properties_list
  622. contents.font.size = YEA::STATUS::PROPERTIES_FONT_SIZE
  623. draw_properties_column1
  624. draw_properties_column2
  625. draw_properties_column3
  626. reset_font_settings
  627. end
  628.  
  629. #--------------------------------------------------------------------------
  630. # draw_properties_column1
  631. #--------------------------------------------------------------------------
  632. def draw_properties_column1
  633. dx = 24
  634. dw = (contents.width - 24) / 3 - 24
  635. dy = 0
  636. for property in YEA::STATUS::PROPERTIES_COLUMN1
  637. dy = draw_property(property, dx, dy, dw)
  638. end
  639. end
  640.  
  641. #--------------------------------------------------------------------------
  642. # draw_properties_column2
  643. #--------------------------------------------------------------------------
  644. def draw_properties_column2
  645. dx = 24 + (contents.width - 24) / 3
  646. dw = (contents.width - 24) / 3 - 24
  647. dy = 0
  648. for property in YEA::STATUS::PROPERTIES_COLUMN2
  649. dy = draw_property(property, dx, dy, dw)
  650. end
  651. end
  652.  
  653. #--------------------------------------------------------------------------
  654. # draw_properties_column3
  655. #--------------------------------------------------------------------------
  656. def draw_properties_column3
  657. dx = 24 + (contents.width - 24) / 3 * 2
  658. dw = (contents.width - 24) / 3 - 24
  659. dy = 0
  660. for property in YEA::STATUS::PROPERTIES_COLUMN3
  661. dy = draw_property(property, dx, dy, dw)
  662. end
  663. end
  664.  
  665. #--------------------------------------------------------------------------
  666. # draw_property
  667. #--------------------------------------------------------------------------
  668. def draw_property(property, dx, dy, dw)
  669. case property[0]
  670. #---
  671. when :hit
  672. fmt = "%1.2f%%"
  673. value = sprintf(fmt, @actor.hit * 100)
  674. when :eva
  675. fmt = "%1.2f%%"
  676. value = sprintf(fmt, @actor.eva * 100)
  677. when :cri
  678. fmt = "%1.2f%%"
  679. value = sprintf(fmt, @actor.cri * 100)
  680. when :cev
  681. fmt = "%1.2f%%"
  682. value = sprintf(fmt, @actor.cev * 100)
  683. when :mev
  684. fmt = "%1.2f%%"
  685. value = sprintf(fmt, @actor.mev * 100)
  686. when :mrf
  687. fmt = "%1.2f%%"
  688. value = sprintf(fmt, @actor.mrf * 100)
  689. when :cnt
  690. fmt = "%1.2f%%"
  691. value = sprintf(fmt, @actor.cnt * 100)
  692. when :hrg
  693. fmt = "%1.2f%%"
  694. value = sprintf(fmt, @actor.hrg * 100)
  695. when :mrg
  696. fmt = "%1.2f%%"
  697. value = sprintf(fmt, @actor.mrg * 100)
  698. when :trg
  699. fmt = "%1.2f%%"
  700. value = sprintf(fmt, @actor.trg * 100)
  701. when :tgr
  702. fmt = "%1.2f%%"
  703. value = sprintf(fmt, @actor.tgr * 100)
  704. when :grd
  705. fmt = "%1.2f%%"
  706. value = sprintf(fmt, @actor.grd * 100)
  707. when :rec
  708. fmt = "%1.2f%%"
  709. value = sprintf(fmt, @actor.rec * 100)
  710. when :pha
  711. fmt = "%1.2f%%"
  712. value = sprintf(fmt, @actor.pha * 100)
  713. when :mcr
  714. fmt = "%1.2f%%"
  715. value = sprintf(fmt, @actor.mcr * 100)
  716. when :tcr
  717. fmt = "%1.2f%%"
  718. value = sprintf(fmt, @actor.tcr * 100)
  719. when :pdr
  720. fmt = "%1.2f%%"
  721. value = sprintf(fmt, @actor.pdr * 100)
  722. when :mdr
  723. fmt = "%1.2f%%"
  724. value = sprintf(fmt, @actor.mdr * 100)
  725. when :fdr
  726. fmt = "%1.2f%%"
  727. value = sprintf(fmt, @actor.fdr * 100)
  728. when :exr
  729. fmt = "%1.2f%%"
  730. value = sprintf(fmt, @actor.exr * 100)
  731. when :hcr
  732. return dy unless $imported["YEA-SkillCostManager"]
  733. fmt = "%1.2f%%"
  734. value = sprintf(fmt, @actor.hcr * 100)
  735. when :tcr
  736. return dy unless $imported["YEA-SkillCostManager"]
  737. fmt = "%1.2f%%"
  738. value = sprintf(fmt, @actor.tcr * 100)
  739. when :gcr
  740. return dy unless $imported["YEA-SkillCostManager"]
  741. fmt = "%1.2f%%"
  742. value = sprintf(fmt, @actor.gcr * 100)
  743. when :cdr
  744. return dy unless $imported["YEA-SkillRestrictions"]
  745. fmt = "%1.2f%%"
  746. value = sprintf(fmt, @actor.cdr * 100)
  747. when :wur
  748. return dy unless $imported["YEA-SkillRestrictions"]
  749. fmt = "%1.2f%%"
  750. value = sprintf(fmt, @actor.wur * 100)
  751. #---
  752. else; return dy
  753. end
  754. colour = Color.new(0, 0, 0, translucent_alpha/2)
  755. rect = Rect.new(dx+1, dy+1, dw-2, line_height-2)
  756. contents.fill_rect(rect, colour)
  757. change_color(system_color)
  758. draw_text(dx+4, dy, dw-8, line_height, property[1], 0)
  759. change_color(normal_color)
  760. draw_text(dx+4, dy, dw-8, line_height, value, 2)
  761. return dy + line_height
  762. end
  763.  
  764. #--------------------------------------------------------------------------
  765. # draw_actor_biography
  766. #--------------------------------------------------------------------------
  767. def draw_actor_biography
  768. fmt = YEA::STATUS::BIOGRAPHY_NICKNAME_TEXT
  769. text = sprintf(fmt, @actor.name, @actor.nickname)
  770. contents.font.size = YEA::STATUS::BIOGRAPHY_NICKNAME_SIZE
  771. draw_text(0, 0, contents.width, line_height*2, text, 1)
  772. reset_font_settings
  773. draw_text_ex(24, line_height*2, @actor.description)
  774. end
  775.  
  776. #--------------------------------------------------------------------------
  777. # draw_custom
  778. #--------------------------------------------------------------------------
  779. def draw_custom
  780. current_symbol = @command_window.current_symbol
  781. return unless YEA::STATUS::CUSTOM_STATUS_COMMANDS.include?(current_symbol)
  782. method(YEA::STATUS::CUSTOM_STATUS_COMMANDS[current_symbol][3]).call
  783. end
  784.  
  785. #--------------------------------------------------------------------------
  786. # draw_custom1
  787. #--------------------------------------------------------------------------
  788. def draw_custom1
  789. dx = 0; dy = 0
  790. for skill in @actor.skills
  791. next if skill.nil?
  792. next unless @actor.added_skill_types.include?(skill.stype_id)
  793. draw_item_name(skill, dx, dy)
  794. dx = dx == contents.width / 2 + 16 ? 0 : contents.width / 2 + 16
  795. dy += line_height if dx == 0
  796. return if dy + line_height > contents.height
  797. end
  798. end
  799.  
  800. #--------------------------------------------------------------------------
  801. # draw_custom2
  802. #--------------------------------------------------------------------------
  803. def draw_custom2
  804. dx = 4; dy = 0; slot_id = 0
  805. for equip in @actor.equips
  806. change_color(system_color)
  807. text = Vocab.etype(@actor.equip_slots[slot_id])
  808. draw_text(dx, dy, contents.width - dx, line_height, text)
  809. reset_font_settings
  810. draw_item_name(equip, dx+92, dy) unless equip.nil?
  811. slot_id += 1
  812. dy += line_height
  813. break if dy + line_height > contents.height
  814. end
  815. dw = Graphics.width * 2 / 5 - 24
  816. dx = contents.width - dw; dy = 0
  817. param_id = 0
  818. 8.times do
  819. colour = Color.new(0, 0, 0, translucent_alpha/2)
  820. rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  821. contents.fill_rect(rect, colour)
  822. size = $imported["YEA-AceEquipEngine"] ? YEA::EQUIP::STATUS_FONT_SIZE : 20
  823. contents.font.size = size
  824. change_color(system_color)
  825. draw_text(dx+4, dy, dw, line_height, Vocab::param(param_id))
  826. change_color(normal_color)
  827. dwa = (Graphics.width * 2 / 5 - 2) / 2
  828. draw_text(dx, dy, dwa, line_height, @actor.param(param_id).group, 2)
  829. reset_font_settings
  830. change_color(system_color)
  831. draw_text(dx + dwa, dy, 22, line_height, "→", 1)
  832. param_id += 1
  833. dy += line_height
  834. break if dy + line_height > contents.height
  835. end
  836. end
  837.  
  838. #--------------------------------------------------------------------------
  839. # draw_custom3
  840. #--------------------------------------------------------------------------
  841. def draw_custom3
  842. return unless $imported["YEA-ClassSystem"]
  843. data = []
  844. for class_id in YEA::CLASS_SYSTEM::CLASS_ORDER
  845. next if $data_classes[class_id].nil?
  846. item = $data_classes[class_id]
  847. next unless @actor.unlocked_classes.include?(item.id) or
  848. YEA::CLASS_SYSTEM::DEFAULT_UNLOCKS.include?(item.id)
  849. data.push(item)
  850. end
  851. dx = 0; dy = 0; class_index = 0
  852. for class_id in data
  853. item = data[class_index]
  854. reset_font_settings
  855. if item == @actor.class
  856. change_color(text_color(YEA::CLASS_SYSTEM::CURRENT_CLASS_COLOUR))
  857. elsif item == @actor.subclass
  858. change_color(text_color(YEA::CLASS_SYSTEM::SUBCLASS_COLOUR))
  859. else
  860. change_color(normal_color)
  861. end
  862. icon = item.icon_index
  863. draw_icon(icon, dx, dy)
  864. text = item.name
  865. draw_text(24, dy, contents.width-24, line_height, text)
  866. next if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
  867. level = @actor.class_level(item.id)
  868. contents.font.size = YEA::CLASS_SYSTEM::LEVEL_FONT_SIZE
  869. text = sprintf(YEA::CLASS_SYSTEM::CLASS_LEVEL, level.group)
  870. dwa = contents.width - (Graphics.width * 2 / 5 - 24) - 28
  871. draw_text(dx, dy, dwa, line_height, text, 2)
  872. class_index += 1
  873. dy += line_height
  874. break if dy + line_height > contents.height
  875. end
  876. dw = Graphics.width * 2 / 5 - 24
  877. dx = contents.width - dw; dy = 0
  878. param_id = 0
  879. 8.times do
  880. colour = Color.new(0, 0, 0, translucent_alpha/2)
  881. rect = Rect.new(dx+1, dy+1, dw - 2, line_height - 2)
  882. contents.fill_rect(rect, colour)
  883. contents.font.size = YEA::CLASS_SYSTEM::PARAM_FONT_SIZE
  884. change_color(system_color)
  885. draw_text(dx+4, dy, dw, line_height, Vocab::param(param_id))
  886. change_color(normal_color)
  887. dwa = (Graphics.width * 2 / 5 - 2) / 2
  888. draw_text(dx, dy, dwa, line_height, @actor.param(param_id).group, 2)
  889. reset_font_settings
  890. change_color(system_color)
  891. draw_text(dx + dwa, dy, 22, line_height, "→", 1)
  892. param_id += 1
  893. dy += line_height
  894. break if dy + line_height > contents.height
  895. end
  896. end
  897.  
  898. end # Window_StatusItem
  899.  
  900. #==============================================================================
  901. # ■ Scene_Status
  902. #==============================================================================
  903.  
  904. class Scene_Status < Scene_MenuBase
  905.  
  906. #--------------------------------------------------------------------------
  907. # start
  908. #--------------------------------------------------------------------------
  909. def start
  910. super
  911. create_help_window
  912. create_command_window
  913. create_status_window
  914. create_item_window
  915. relocate_windows
  916. end
  917.  
  918. #--------------------------------------------------------------------------
  919. # create_command_window
  920. #--------------------------------------------------------------------------
  921. def create_command_window
  922. wy = @help_window.height
  923. @command_window = Window_StatusCommand.new(0, wy)
  924. @command_window.viewport = @viewport
  925. @command_window.actor = @actor
  926. @command_window.help_window = @help_window
  927. @command_window.set_handler(:cancel, method(:return_scene))
  928. @command_window.set_handler(:pagedown, method(:next_actor))
  929. @command_window.set_handler(:pageup, method(:prev_actor))
  930. process_custom_status_commands
  931. end
  932.  
  933. #--------------------------------------------------------------------------
  934. # process_custom_status_commands
  935. #--------------------------------------------------------------------------
  936. def process_custom_status_commands
  937. for command in YEA::STATUS::COMMANDS
  938. next unless YEA::STATUS::CUSTOM_STATUS_COMMANDS.include?(command[0])
  939. called_method = YEA::STATUS::CUSTOM_STATUS_COMMANDS[command[0]][2]
  940. @command_window.set_handler(command[0], method(called_method))
  941. end
  942. end
  943.  
  944. #--------------------------------------------------------------------------
  945. # create_status_window
  946. #--------------------------------------------------------------------------
  947. def create_status_window
  948. wy = @help_window.height
  949. @status_window = Window_StatusActor.new(@command_window.width, wy)
  950. @status_window.viewport = @viewport
  951. @status_window.actor = @actor
  952. end
  953.  
  954. #--------------------------------------------------------------------------
  955. # create_item_window
  956. #--------------------------------------------------------------------------
  957. def create_item_window
  958. dy = @command_window.y + @command_window.height
  959. @item_window = Window_StatusItem.new(0, dy, @command_window)
  960. @item_window.viewport = @viewport
  961. @item_window.actor = @actor
  962. @command_window.item_window = @item_window
  963. end
  964.  
  965. #--------------------------------------------------------------------------
  966. # relocate_windows
  967. #--------------------------------------------------------------------------
  968. def relocate_windows
  969. return unless $imported["YEA-AceMenuEngine"]
  970. case Menu.help_window_location
  971. when 0 # Top
  972. @help_window.y = 0
  973. @command_window.y = @help_window.height
  974. @item_window.y = @command_window.y + @command_window.height
  975. when 1 # Middle
  976. @command_window.y = 0
  977. @help_window.y = @command_window.height
  978. @item_window.y = @help_window.y + @help_window.height
  979. else # Bottom
  980. @command_window.y = 0
  981. @item_window.y = @command_window.height
  982. @help_window.y = @item_window.y + @item_window.height
  983. end
  984. @status_window.y = @command_window.y
  985. end
  986.  
  987. #--------------------------------------------------------------------------
  988. # on_actor_change
  989. #--------------------------------------------------------------------------
  990. def on_actor_change
  991. @command_window.actor = @actor
  992. @status_window.actor = @actor
  993. @item_window.actor = @actor
  994. @command_window.activate
  995. end
  996.  
  997. #--------------------------------------------------------------------------
  998. # new method: command_name1
  999. #--------------------------------------------------------------------------
  1000. def command_name1
  1001. SceneManager.call(Scene_Skill)
  1002. end
  1003.  
  1004. #--------------------------------------------------------------------------
  1005. # new method: command_name2
  1006. #--------------------------------------------------------------------------
  1007. def command_name2
  1008. SceneManager.call(Scene_Equip)
  1009. end
  1010.  
  1011. #--------------------------------------------------------------------------
  1012. # new method: command_name3
  1013. #--------------------------------------------------------------------------
  1014. def command_name3
  1015. unless $imported["YEA-ClassSystem"]
  1016. @command_window.activate
  1017. return
  1018. end
  1019. SceneManager.call(Scene_Class)
  1020. end
  1021.  
  1022. end # Scene_Status
  1023.  
  1024. #==============================================================================
  1025. #
  1026. # ▼ End of File
  1027. #
  1028. #==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment