Advertisement
WCouillard

RGSS3: Final Fantasy Style Battle Log v2.05 [RMVXA]

Dec 5th, 2012
9,188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 63.39 KB | None | 0 0
  1. # ╔══════════════════════════════════════════════════════╤═══════╤════════════╗
  2. # ║ Final Fantasy Style Battle Log                       │ v2.05 │   (3/2/20) ║
  3. # ╠══════════════════════════════════════════════════════╧═══════╧════════════╣
  4. # ║ Author  : Coolie                                                          ║
  5. # ║ Thanks  : KilloZapIt (Kayzee), Swish, Keith Brewer                        ║
  6. # ║ E-Mail  : cooliebk18@yahoo.com                                            ║
  7. # ║ Website : http://twitch.tv/CoolieBK18                                     ║
  8. # ╠═══════════════════════════════════════════════════════════════════════════╣
  9. # ║ ABOUT                                                                     ║
  10. # ╠═══════════════════════════════════════════════════════════════════════════╣
  11. # ║ This script changes the behavior of the battle log window to act as the   ║
  12. # ║ Battle Log window in a Final Fantasy game would.                          ║
  13. # ╠═══════════════════════════════════════════════════════════════════════════╣
  14. # ║ TERMS OF USE                                                              ║
  15. # ╠═══════════════════════════════════════════════════════════════════════════╣
  16. # ║ ► Do not edit the script's header or comments.                            ║
  17. # ║ ► Free to use in commercial projects as long as proper credit is given to ║
  18. # ║   ALL the names individually in the above header.                         ║
  19. # ╠═══════════════════════════════════════════════════════════════════════════╣
  20. # ║ FEATURES                                                                  ║
  21. # ╠═══════════════════════════════════════════════════════════════════════════╣
  22. # ║ ► Removes the black background behind the default Battle Log window.      ║
  23. # ║ ► Custom opacity for the Battle Log window.                               ║
  24. # ║ ► Text alignment settings for the Battle Log window.                      ║
  25. # ║ ► Automatically hide the Battle Log window when a skill has no message    ║
  26. # ║   text                                                                    ║
  27. # ║ ► Width and alignment settings for the Battle Log window.                 ║
  28. # ║ ► Automatically adjust alignment when skill has no icon (icon ID 0)       ║
  29. # ║ ► Option to use different windowskin suffixes for skills used by actors   ║
  30. # ║   or enemies, respectively.                                               ║
  31. # ╠═══════════════════════════════════════════════════════════════════════════╣
  32. # ║ KNOWN ISSUES                                                              ║
  33. # ╠═══════════════════════════════════════════════════════════════════════════╣
  34. # ║ ► This script is intended to be used alongside a Damage Popup script,     ║
  35. # ║   such as the ones made by Yanfly or Victor Sant. Using it by itself will ║
  36. # ║   only take effect on skill and item names and messages, and all other    ║
  37. # ║   messages will not appear in the default way that VXA processes them.    ║
  38. # ║                                                                           ║
  39. # ║   I wrote this script out of a personal need for it. It overwrites most   ║
  40. # ║   methods set in Window_BattleLog. If you have other scripts that also do ║
  41. # ║   this, there will be incompatability between them. Alternately, if you   ║
  42. # ║   are using other scripts which alias Window_BattleLog methods, you may   ║
  43. # ║   want to place this script ABOVE those and hope for the best, lol.       ║
  44. # ║                                                                           ║
  45. # ║   Enjoy!                                                                  ║
  46. # ║                                                                           ║
  47. # ╠═══════════════════════════════════════════════════════════════════════════╣
  48. # ║ CHANGE LOG                                                                ║
  49. # ╠═════════════════════════════════════════════════════════════════╤═════════╣
  50. # ║ ■ March 2, 2020     : Cleaned up redundant code, fixed bug      │ (v2.05) ║
  51. # ║                       where Battle Log still showed a blank     │         ║
  52. # ║                       icon (icon ID 0)                          │         ║
  53. # ╟─────────────────────────────────────────────────────────────────┼─────────╢
  54. # ║ ■ May 3, 2015       : Suffixes for Windowskin settings          │ (v2.04) ║
  55. # ╟─────────────────────────────────────────────────────────────────┼─────────╢
  56. # ║ ■ December 12, 2014 : Bugfixes (battle sounds playing again)    │ (v2.03) ║
  57. # ╟─────────────────────────────────────────────────────────────────┼─────────╢
  58. # ║ ■ December 11, 2014 : Bugfixes (y offset text positioning)      │ (v2.02) ║
  59. # ╟─────────────────────────────────────────────────────────────────┼─────────╢
  60. # ║ ■ December 11, 2014 : Bugfixes (blank window fix)               │ (v2.01) ║
  61. # ╟─────────────────────────────────────────────────────────────────┼─────────╢
  62. # ║ ■ December 10, 2014 : Almost a full rewrite. Needless features  │ (v2.00) ║
  63. # ║                       removed. Some new ones added. Skill and   │         ║
  64. # ║                       Item icons displaying now.                │         ║
  65. # ╟─────────────────────────────────────────────────────────────────┼─────────╢
  66. # ║ ■ October 31, 2014  : New option to use different windowskins   │ (v1.04) ║
  67. # ║                       for actor and enemy attacks               │         ║
  68. # ╟─────────────────────────────────────────────────────────────────┼─────────╢
  69. # ║ ■ August 15, 2013   : Bugfixes.                                 │ (v1.03) ║
  70. # ╟─────────────────────────────────────────────────────────────────┼─────────╢
  71. # ║ ■ December 12, 2012 : Font options added. (then removed lul)    │ (v1.02) ║
  72. # ╟─────────────────────────────────────────────────────────────────┼─────────╢
  73. # ║ ■ December 06, 2012 : Width and Window alignment options added. │ (v1.01) ║
  74. # ║                       Show Name option added.                   │         ║
  75. # ╟─────────────────────────────────────────────────────────────────┼─────────╢
  76. # ║ ■ December 05, 2012 : Initial release.                          │ (v1.00) ║
  77. # ╠═════════════════════════════════════════════════════════════════╧═════════╣
  78. # ║ NEXT VERSION                                                              ║
  79. # ╠═══════════════════════════════════════════════════════════════════════════╣
  80. # ║ ■ TBA                                                                     ║
  81. # ╠═══════════════════════════════════════════════════════════════════════════╣
  82. # ║ OVERWRITTEN METHODS                                                       ║
  83. # ╠═══════════════════════════════════════════════════════════════════════════╣
  84. # ║   This script overwrites several methods in Window_BattleLog.             ║
  85. # ╟───────────────────────────────────────────────────────────────────────────╢
  86. # ║ ■ class Window_BattleLog < Window_Selectable                              ║
  87. # ║    ► def initialize                                                       ║
  88. # ║    ► def window_width                                                     ║
  89. # ║    ► def max_line_number                                                  ║
  90. # ║    ► def create_back_bitmap                                               ║
  91. # ║    ► def create_back_sprite                                               ║
  92. # ║    ► def dispose_back_bitmap                                              ║
  93. # ║    ► def dispose_back_sprite                                              ║
  94. # ║    ► def last_text                                                        ║
  95. # ║    ► def draw_background                                                  ║
  96. # ║    ► def back_color                                                       ║
  97. # ║    ► def clear                                                            ║
  98. # ║    ► def display_affected_status                                          ║
  99. # ║    ► def display_critical                                                 ║
  100. # ║    ► def display_miss                                                     ║
  101. # ║    ► def display_failure                                                  ║
  102. # ║    ► def display_counterattack                                            ║
  103. # ║    ► def display_reflection                                               ║
  104. # ║    ► def display_substitute                                               ║
  105. # ║    ► def display_hp_damage                                                ║
  106. # ║    ► def display_mp_damage                                                ║
  107. # ║    ► def display_tp_damage                                                ║
  108. # ║► def display_use_item                                                     ║
  109. # ╠═══════════════════════════════════════════════════════════════════════════╣
  110. # ║ NEW METHODS                                                               ║
  111. # ╠═══════════════════════════════════════════════════════════════════════════╣
  112. # ║   There are several new methods added to Window_BattleLog.                ║
  113. # ╟───────────────────────────────────────────────────────────────────────────╢
  114. # ║ ■ class Window_BattleLog < Window_Selectable                              ║
  115. # ║    ► def window_left_position                                             ║
  116. # ║    ► def window_center_position                                           ║
  117. # ║    ► def window_right_position                                            ║
  118. # ║    ► def y_offset                                                         ║
  119. # ║    ► def item_name_width(item)                                            ║
  120. # ║    ► def skill_name_width(item)                                           ║
  121. # ║    ► def draw_skill_name(item, x, y, enabled, width)                      ║
  122. # ║    ► def draw_items_name(item, x, y, enabled, width)                      ║
  123. # ╠═══════════════════════════════════════════════════════════════════════════╣
  124. # ║ INSTRUCTIONS                                                              ║
  125. # ╠═══════════════════════════════════════════════════════════════════════════╣
  126. # ║ Simply paste this script anywhere above the Main Process script and below ║
  127. # ║ the "Materials" section.                                                  ║
  128. # ║                                                                           ║
  129. # ║ NOTE: When setting the "use" message in the database for a skill, it is   ║
  130. # ║       important to remember that the Actor name or Enemy name is OMITTED. ║
  131. # ║       It's usually a good idea just to input the skill's name in the      ║
  132. # ║       "use" message dialogue box. The skill/item icon is shown with the   ║
  133. # ║       skill/item name. This is what will determine the text displayed     ║
  134. # ║       You can name the skill in the database whatever you want, and the   ║
  135. # ║       script will display the icon and whatever is in the message box.    ║
  136. # ║                                                                           ║
  137. # ║ Example: Just input "Fire" instead of "casts Fire!"                       ║
  138. # ║                                                                           ║
  139. # ║ NOTE: You can also show a custom message, by using the second message box ║
  140. # ║       in the database for skills. Simply write whatever you want in that  ║
  141. # ║       box, and the skill/item icon will not be shown. Your new custom     ║
  142. # ║       message will display instead.                                       ║
  143. # ║                                                                           ║
  144. # ║ Example: "Precious light, be our armor to protect us! Protect!"           ║
  145. # ╠═══════════════════════════════════════════════════════════════════════════╣
  146. # ║ IMPORT SETTING                                                            ║
  147. # ╚═══════════════════════════════════════════════════════════════════════════╝
  148. $imported = {} if $imported.nil?             # Do not edit
  149. $imported["WC-FFStyleBattleLog_2.00"] = true # Do not edit
  150. # ╔═══════════════════════════════════════════════════════════════════════════╗
  151. # ║ CUSTOMIZATION MODULE                                                      ║
  152. # ╚═══════════════════════════════════════════════════════════════════════════╝
  153. module COOLIE
  154.   module LOG
  155. # ╔═══════════════════════════════════════════════════════════════════════════╗
  156. # ║ Set window width (in pixels)                                              ║
  157. # ╚═══════════════════════════════════════════════════════════════════════════╝
  158.     WINDOW_WIDTH = 640
  159. # ╔═══════════════════════════════════════════════════════════════════════════╗
  160. # ║ Set window Y offset (in pixels; can be negative)                          ║
  161. # ╚═══════════════════════════════════════════════════════════════════════════╝
  162.     WINDOW_Y_OFFSET = 0
  163. # ╔═══════════════════════════════════════════════════════════════════════════╗
  164. # ║ Set window alignment (0 = Left, 1 = Center, 2 = Right)                    ║
  165. # ╚═══════════════════════════════════════════════════════════════════════════╝
  166.     WINDOW_ALIGN = 1
  167. # ╔═══════════════════════════════════════════════════════════════════════════╗
  168. # ║ Set name usage (true/false = show/do not show actor names)                ║
  169. # ╚═══════════════════════════════════════════════════════════════════════════╝
  170.     USE_NAME = true
  171. # ╔═══════════════════════════════════════════════════════════════════════════╗
  172. # ║ Set windowskin opacity (0-255)                                            ║
  173. # ╚═══════════════════════════════════════════════════════════════════════════╝
  174.     WSKIN_OPACITY = 255
  175. # ╔═══════════════════════════════════════════════════════════════════════════╗
  176. # ║ Set windowskin back opacity (0-255)                                       ║
  177. # ╚═══════════════════════════════════════════════════════════════════════════╝
  178.     WSKIN_BACK_OPACITY = 255
  179. # ╔═══════════════════════════════════════════════════════════════════════════╗
  180. # ║ Set windowskin suffix used for actor skills/items                         ║
  181. # ╚═══════════════════════════════════════════════════════════════════════════╝
  182.     WSKIN_ACTOR = ""                   # Leave as "" to use default skin
  183. # ╔═══════════════════════════════════════════════════════════════════════════╗
  184. # ║ Set windowskin suffix used for enemy skills/items                         ║
  185. # ╚═══════════════════════════════════════════════════════════════════════════╝
  186.     WSKIN_ENEMY = "_Enemy"             # Leave as "" to use default skin
  187.  
  188.   end # module LOG
  189. end # module COOLIE
  190.  
  191. # ╔═══════════════════════════════════════════════════════════════════════════╗
  192. # ║ WINDOW_BASE                                                               ║
  193. # ╚═══════════════════════════════════════════════════════════════════════════╝
  194. class Window_Base
  195. # ╔═══════════════════════════════════════════════════════════════════════════╗
  196. # ║ Object Initialization                                                     ║
  197. # ╚═══════════════════════════════════════════════════════════════════════════╝
  198.   alias wc_battlelog_initialize initialize
  199.   def initialize(*args, &block)
  200.     wc_battlelog_initialize(*args, &block)
  201.     self.windowskin = Cache.system($game_system.windowskin)
  202.     @wskin = $game_system.windowskin
  203.   end
  204. end
  205.  
  206. # ╔═══════════════════════════════════════════════════════════════════════════╗
  207. # ║ WINDOW_BATTLELOG                                                          ║
  208. # ╚═══════════════════════════════════════════════════════════════════════════╝
  209. class Window_BattleLog < Window_Selectable
  210. # ╔═══════════════════════════════════════════════════════════════════════════╗
  211. # ║ Object Initialization                                                     ║
  212. # ╚═══════════════════════════════════════════════════════════════════════════╝
  213.   def initialize
  214.     case COOLIE::LOG::WINDOW_ALIGN
  215.       when 0 # Left Aligned
  216.         super(window_left_position, y_offset, window_width, window_height)
  217.       when 1 # Center Aligned
  218.         super(window_center_position, y_offset, window_width, window_height)
  219.       when 2 # Right Aligned
  220.         super(window_right_position, y_offset, window_width, window_height)
  221.       end
  222.     self.z -= 10
  223.     self.opacity = 0
  224.     @lines = []
  225.     @num_wait = 0
  226.     create_back_bitmap
  227.     create_back_sprite
  228.     refresh
  229.   end
  230. # ╔═══════════════════════════════════════════════════════════════════════════╗
  231. # ║ Get Window Width                                                          ║
  232. # ╚═══════════════════════════════════════════════════════════════════════════╝
  233.   def window_width
  234.     COOLIE::LOG::WINDOW_WIDTH
  235.   end
  236. # ╔═══════════════════════════════════════════════════════════════════════════╗
  237. # ║ Get Window Y Offset                                                       ║
  238. # ╚═══════════════════════════════════════════════════════════════════════════╝
  239.   def y_offset
  240.     return COOLIE::LOG::WINDOW_Y_OFFSET
  241.   end
  242. # ╔═══════════════════════════════════════════════════════════════════════════╗
  243. # ║ Get Maximum Number of Lines                                               ║
  244. # ╚═══════════════════════════════════════════════════════════════════════════╝
  245.   def max_line_number
  246.     return 1
  247.   end
  248. # ╔═══════════════════════════════════════════════════════════════════════════╗
  249. # ║ Create Background Bitmap                                                  ║
  250. # ╚═══════════════════════════════════════════════════════════════════════════╝
  251.   def create_back_bitmap
  252.   end
  253. # ╔═══════════════════════════════════════════════════════════════════════════╗
  254. # ║ Create Background Sprite                                                  ║
  255. # ╚═══════════════════════════════════════════════════════════════════════════╝
  256.   def create_back_sprite
  257.   end
  258. # ╔═══════════════════════════════════════════════════════════════════════════╗
  259. # ║ Free Background Bitmap                                                    ║
  260. # ╚═══════════════════════════════════════════════════════════════════════════╝
  261.   def dispose_back_bitmap
  262.   end
  263. # ╔═══════════════════════════════════════════════════════════════════════════╗
  264. # ║ Free Background Sprite                                                    ║
  265. # ╚═══════════════════════════════════════════════════════════════════════════╝
  266.   def dispose_back_sprite
  267.   end
  268. # ╔═══════════════════════════════════════════════════════════════════════════╗
  269. # ║ Last Text                                                                 ║
  270. # ╚═══════════════════════════════════════════════════════════════════════════╝
  271.   def last_text
  272.   end
  273. # ╔═══════════════════════════════════════════════════════════════════════════╗
  274. # ║ Draw_Background                                                           ║
  275. # ╚═══════════════════════════════════════════════════════════════════════════╝
  276.   def draw_background
  277.   end
  278. # ╔═══════════════════════════════════════════════════════════════════════════╗
  279. # ║ Get Background Color                                                      ║
  280. # ╚═══════════════════════════════════════════════════════════════════════════╝
  281.   def back_color
  282.   end
  283. # ╔═══════════════════════════════════════════════════════════════════════════╗
  284. # ║ Clear                                                                     ║
  285. # ╚═══════════════════════════════════════════════════════════════════════════╝
  286.   def clear
  287.     @num_wait = 0
  288.     @lines.clear
  289.     self.opacity = 0
  290.     self.back_opacity = 0
  291.     refresh
  292.   end
  293. # ╔═══════════════════════════════════════════════════════════════════════════╗
  294. # ║ Display Affected Status                                                   ║
  295. # ╚═══════════════════════════════════════════════════════════════════════════╝
  296.   def display_affected_status(target, item)
  297.   end
  298. # ╔═══════════════════════════════════════════════════════════════════════════╗
  299. # ║ Display Counterattack                                                     ║
  300. # ╚═══════════════════════════════════════════════════════════════════════════╝
  301.   def display_counter(target, item)
  302.     Sound.play_evasion
  303.     clear
  304.   end
  305. # ╔═══════════════════════════════════════════════════════════════════════════╗
  306. # ║ Display Reflection                                                        ║
  307. # ╚═══════════════════════════════════════════════════════════════════════════╝
  308.   def display_reflection(target, item)
  309.     Sound.play_reflection
  310.     clear
  311.   end
  312. # ╔═══════════════════════════════════════════════════════════════════════════╗
  313. # ║ Display Substitute                                                        ║
  314. # ╚═══════════════════════════════════════════════════════════════════════════╝
  315.   def display_substitute(substitute, target)
  316.   end
  317. # ╔═══════════════════════════════════════════════════════════════════════════╗
  318. # ║ Display Action Results                                                    ║
  319. # ╚═══════════════════════════════════════════════════════════════════════════╝
  320.   def display_action_results(target, item)
  321.     if target.result.used
  322.       display_damage(target, item)
  323.     end
  324.   end
  325. # ╔═══════════════════════════════════════════════════════════════════════════╗
  326. # ║ Display Failure                                                           ║
  327. # ╚═══════════════════════════════════════════════════════════════════════════╝
  328.   def display_failure(target, item)
  329.     if target.result.hit? && !target.result.success
  330.     end
  331.   end
  332. # ╔═══════════════════════════════════════════════════════════════════════════╗
  333. # ║ Display Critical Hit                                                      ║
  334. # ╚═══════════════════════════════════════════════════════════════════════════╝
  335.   def display_critical(target, item)
  336.     if target.result.critical
  337.     end
  338.   end
  339. # ╔═══════════════════════════════════════════════════════════════════════════╗
  340. # ║ Display Miss                                                              ║
  341. # ╚═══════════════════════════════════════════════════════════════════════════╝
  342.   def display_miss(target, item)
  343.     if !item || item.physical?
  344.       Sound.play_miss
  345.     end
  346.   end
  347. # ╔═══════════════════════════════════════════════════════════════════════════╗
  348. # ║ Display Evasion                                                           ║
  349. # ╚═══════════════════════════════════════════════════════════════════════════╝
  350.   def display_evasion(target, item)
  351.     if !item || item.physical?
  352.       Sound.play_evasion
  353.     else
  354.       Sound.play_magic_evasion
  355.     end
  356.   end
  357. # ╔═══════════════════════════════════════════════════════════════════════════╗
  358. # ║ Display HP Damage                                                         ║
  359. # ╚═══════════════════════════════════════════════════════════════════════════╝
  360.   def display_hp_damage(target, item)
  361.     return if target.result.hp_damage == 0 && item && !item.damage.to_hp?
  362.     if target.result.hp_damage > 0 && target.result.hp_drain == 0
  363.       target.perform_damage_effect
  364.     end
  365.     Sound.play_recovery if target.result.hp_damage < 0
  366.   end
  367. # ╔═══════════════════════════════════════════════════════════════════════════╗
  368. # ║ Display MP Damage                                                         ║
  369. # ╚═══════════════════════════════════════════════════════════════════════════╝
  370.   def display_mp_damage(target, item)
  371.     return if target.dead? || target.result.mp_damage == 0
  372.     Sound.play_recovery if target.result.mp_damage < 0
  373.   end
  374. # ╔═══════════════════════════════════════════════════════════════════════════╗
  375. # ║ Display TP Damage                                                         ║
  376. # ╚═══════════════════════════════════════════════════════════════════════════╝
  377.   def display_tp_damage(target, item)
  378.     return if target.dead? || target.result.tp_damage == 0
  379.     Sound.play_recovery if target.result.tp_damage < 0
  380.   end
  381. # ╔═══════════════════════════════════════════════════════════════════════════╗
  382. # ║ Get Window Left Position                                     [NEW METHOD] ║
  383. # ╚═══════════════════════════════════════════════════════════════════════════╝
  384.   def window_left_position
  385.     return 0
  386.   end
  387. # ╔═══════════════════════════════════════════════════════════════════════════╗
  388. # ║ Get Window Center Position                                   [NEW METHOD] ║
  389. # ╚═══════════════════════════════════════════════════════════════════════════╝
  390.   def window_center_position
  391.     return Graphics.width / 2 - window_width / 2
  392.   end
  393. # ╔═══════════════════════════════════════════════════════════════════════════╗
  394. # ║ Get Window Right Position                                    [NEW METHOD] ║
  395. # ╚═══════════════════════════════════════════════════════════════════════════╝
  396.   def window_right_position
  397.     return Graphics.width - window_width
  398.   end
  399. # ╔═══════════════════════════════════════════════════════════════════════════╗
  400. # ║ Draw Skill Name                                              [NEW METHOD] ║
  401. # ╚═══════════════════════════════════════════════════════════════════════════╝
  402.   def draw_skill_name(item, x, y, enabled = true, width = 172)
  403.     return unless item
  404.     change_color(normal_color, enabled)
  405.     if item.icon_index == 0
  406.       draw_text(x, 0, width, line_height, item.message1)
  407.     else
  408.       draw_icon(item.icon_index, x, 0, enabled)
  409.       draw_text(x + 24, 0, width, line_height, item.message1)
  410.     end
  411.   end
  412. # ╔═══════════════════════════════════════════════════════════════════════════╗
  413. # ║ Draw Item Name                                               [NEW METHOD] ║
  414. # ╚═══════════════════════════════════════════════════════════════════════════╝
  415.   def draw_items_name(item, x, y, enabled = true, width = 172)
  416.     return unless item
  417.     change_color(normal_color, enabled)
  418.     if item.icon_index == 0
  419.       draw_text(x, 0, width, line_height, item.name)
  420.     else
  421.       draw_icon(item.icon_index, x, 0, enabled)
  422.       draw_text(x + 24, 0, width, line_height, item.name)
  423.     end
  424.   end
  425. # ╔═══════════════════════════════════════════════════════════════════════════╗
  426. # ║ Skill Name Width                                             [NEW METHOD] ║
  427. # ╚═══════════════════════════════════════════════════════════════════════════╝
  428.   def skill_name_width(item)
  429.     size = text_size(item.message1).width
  430.     size += 24 if item.icon_index <= 0
  431.     return size
  432.   end
  433. # ╔═══════════════════════════════════════════════════════════════════════════╗
  434. # ║ Item Name Width                                              [NEW METHOD] ║
  435. # ╚═══════════════════════════════════════════════════════════════════════════╝
  436.   def item_name_width(item)
  437.     size = text_size(item.name).width
  438.     size += 24 if item.icon_index <= 0
  439.     return size
  440.   end
  441. # ╔═══════════════════════════════════════════════════════════════════════════╗
  442. # ║ Display Skill/Item Use                                                    ║
  443. # ╚═══════════════════════════════════════════════════════════════════════════╝
  444.   def display_use_item(subject, item)
  445.     # Do not show message if skill message1 has no text
  446.     if item.is_a?(RPG::Skill) && item.message1.empty?
  447.       return
  448.     end # if item.is_a?
  449.     # Set windowskin based on user (actor or enemy)
  450.     if subject.is_a?(Game_Enemy)
  451.       self.windowskin = Cache.system($game_system.windowskin + COOLIE::LOG::WSKIN_ENEMY.to_s)
  452.     else
  453.       self.windowskin = Cache.system($game_system.windowskin + COOLIE::LOG::WSKIN_ACTOR.to_s)
  454.     end
  455.     self.opacity = COOLIE::LOG::WSKIN_OPACITY
  456.     self.back_opacity = COOLIE::LOG::WSKIN_BACK_OPACITY
  457.     # Handle display of Window, Opacity, Icons and Text
  458.     if item.is_a?(RPG::Skill) && !item.message1.empty? # For Skills
  459.       ix = (window_width / 2) - (skill_name_width(item) / 2)
  460.       if item.icon_index > 0
  461.         ix -= 36
  462.       else
  463.         ix = ix
  464.       end
  465.       draw_skill_name(item, ix, y, enabled = true)
  466.     elsif item.is_a?(RPG::Item) # For items
  467.       ix = (window_width / 2) - (item_name_width(item) / 2)
  468.       if item.icon_index > 0
  469.         ix -= 36
  470.       else
  471.         ix = ix
  472.       end
  473.       draw_items_name(item, ix, y, enabled = true)
  474.     else # Failsafe
  475.       draw_text(0, 0, window_width - 24, line_height, item.name, 1)
  476.       wait
  477.     end
  478.     reset_font_settings
  479.   end
  480. # ╔═══════════════════════════════════════════════════════════════════════════╗
  481. # ║ End of Script                                                             ║
  482. # ╚═══════════════════════════════════════════════════════════════════════════╝
  483. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement