Guest User

Luna Engine - EXP Bar Addon

a guest
Feb 5th, 2017
420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.61 KB | None | 0 0
  1. #==============================================================================
  2. # ■ MenuLuna: EXP Bar Configuration
  3. #==============================================================================
  4.  
  5. module MenuLuna
  6. module MainMenu
  7. BATTLER_STATUS[:exp_bar] = {
  8. :enable => true, # Enable EXP Bars? True/False
  9. # -----------------------------------------------------------------
  10. # Offset Values refer to how much you want to nudge the window display
  11. # without affecting its base x, y and z.
  12. # -----------------------------------------------------------------
  13. :offset_x => 228,
  14. :offset_y => 55,
  15. :offset_z => 0,
  16. # -----------------------------------------------------------------
  17. # Type allows you to set the type of graphic you want to use.
  18. # 0 - Default bar; 1 - Custom bar; 2 - Custom animated bar.
  19. # -----------------------------------------------------------------
  20. :type => 0,
  21. :vertical => false,# Display vertically? True/False
  22. # Works for type 0 and 1.
  23. :ani_rate => 0.02, # Max is 1.00. Refers to animate speed/rate.
  24. #---
  25. :type_0 => {
  26. # -----------------------------------------------------------------
  27. # Set the color for the bar background. [R,G,B,A]
  28. # You can also use normal_color to use the default windowskin colors.
  29. # -----------------------------------------------------------------
  30. :back_color => [0, 0, 0, 255],
  31. # -----------------------------------------------------------------
  32. # color1 = refers to the first color of the gradient. ([R,G,B,A])
  33. # color2 = refers to the second color of the gradient. ([R,G,B,A])
  34. # normal_color refers to the color of your default windowskin.
  35. # -----------------------------------------------------------------
  36. :color1 => [7, 101, 58, 255],
  37. :color2 => [84, 194, 144, 255],
  38. # -----------------------------------------------------------------
  39. # Set the outline color for the name display. [R,G,B,A]
  40. # You can also use normal_color to use the default outline color.
  41. # -----------------------------------------------------------------
  42. :outline => [0, 0, 0, 255],
  43. :length => 220, # Width/Length of the bar.
  44. :height => 12, # Height of the bar.
  45.  
  46. # -----------------------------------------------------------------
  47. # This section allows you to customize the "EXP" Vocab display.
  48. # -----------------------------------------------------------------
  49. # -----------------------------------------------------------------
  50. # Offset Values refer to how much you want to nudge the window display
  51. # without affecting its base x, y and z.
  52. # -----------------------------------------------------------------
  53. :offset_x => 232,
  54. :offset_y => 32,
  55. :offset_z => 1,
  56. # -----------------------------------------------------------------
  57. # Set the color for the name display. [R,G,B,A]
  58. # You can also use normal_color to use the default font color.
  59. # -----------------------------------------------------------------
  60. :tcolor => [255, 255, 255, 255],
  61. # -----------------------------------------------------------------
  62. # Set the outline color for the name display. [R,G,B,A]
  63. # You can also use normal_color to use the default outline color.
  64. # -----------------------------------------------------------------
  65. :toutline => [0, 0, 0, 128],
  66. :bold => false, # Enable Bold? True/False
  67. :italic => false, # Enable Italic? True/False
  68. # -----------------------------------------------------------------
  69. # Set alignment settings.
  70. # 0 = Left/Default, 1 = Center, 2 = Right
  71. # -----------------------------------------------------------------
  72. :align => 0,
  73. :font => "VL Gothic", # Set Font type.
  74. :size => 24, # Set Font Size
  75. :text => "EXP", # Change "EXP" Vocab.
  76. },
  77. #---
  78. :type_1 => {
  79. :filename => "EXP_Bar", # Custom EXP Bar Filename.
  80. },
  81. #---
  82. :type_2 => {
  83. :filename => "Btskin_EXP", # Custom Frame-based EXP Bar Filename.
  84. :frames => 10, # Amount of animation frames.
  85. },
  86. } # End exp_bar.
  87. end
  88.  
  89. module ItemMenu
  90. BATTLER_STATUS[:exp_bar] = {
  91. :enable => false, # Enable EXP Bars? True/False
  92. # -----------------------------------------------------------------
  93. # Offset Values refer to how much you want to nudge the window display
  94. # without affecting its base x, y and z.
  95. # -----------------------------------------------------------------
  96. :offset_x => 228,
  97. :offset_y => 48,
  98. :offset_z => 0,
  99. # -----------------------------------------------------------------
  100. # Type allows you to set the type of graphic you want to use.
  101. # 0 - Default bar; 1 - Custom bar; 2 - Custom animated bar.
  102. # -----------------------------------------------------------------
  103. :type => 0,
  104. :vertical => false,# Display vertically? True/False
  105. # Works for type 0 and 1.
  106. :ani_rate => 0.02, # Max is 1.00. Refers to animate speed/rate.
  107. #---
  108. :type_0 => {
  109. # -----------------------------------------------------------------
  110. # Set the color for the bar background. [R,G,B,A]
  111. # You can also use normal_color to use the default windowskin colors.
  112. # -----------------------------------------------------------------
  113. :back_color => [0, 0, 0, 255],
  114. # -----------------------------------------------------------------
  115. # color1 = refers to the first color of the gradient. ([R,G,B,A])
  116. # color2 = refers to the second color of the gradient. ([R,G,B,A])
  117. # normal_color refers to the color of your default windowskin.
  118. # -----------------------------------------------------------------
  119. :color1 => [7, 101, 58, 255],
  120. :color2 => [84, 194, 144, 255],
  121. # -----------------------------------------------------------------
  122. # Set the outline color for the name display. [R,G,B,A]
  123. # You can also use normal_color to use the default outline color.
  124. # -----------------------------------------------------------------
  125. :outline => [0, 0, 0, 255],
  126. :length => 220, # Width/Length of the bar.
  127. :height => 12, # Height of the bar.
  128.  
  129. # -----------------------------------------------------------------
  130. # This section allows you to customize the "EXP" Vocab display.
  131. # -----------------------------------------------------------------
  132. # -----------------------------------------------------------------
  133. # Offset Values refer to how much you want to nudge the window display
  134. # without affecting its base x, y and z.
  135. # -----------------------------------------------------------------
  136. :offset_x => 232,
  137. :offset_y => 32,
  138. :offset_z => 1,
  139. # -----------------------------------------------------------------
  140. # Set the color for the name display. [R,G,B,A]
  141. # You can also use normal_color to use the default font color.
  142. # -----------------------------------------------------------------
  143. :tcolor => [255, 255, 255, 255],
  144. # -----------------------------------------------------------------
  145. # Set the outline color for the name display. [R,G,B,A]
  146. # You can also use normal_color to use the default outline color.
  147. # -----------------------------------------------------------------
  148. :toutline => [0, 0, 0, 128],
  149. :bold => false, # Enable Bold? True/False
  150. :italic => false, # Enable Italic? True/False
  151. # -----------------------------------------------------------------
  152. # Set alignment settings.
  153. # 0 = Left/Default, 1 = Center, 2 = Right
  154. # -----------------------------------------------------------------
  155. :align => 0,
  156. :font => "VL Gothic", # Set Font type.
  157. :size => 24, # Set Font Size
  158. :text => "EXP", # Change "EXP" Vocab.
  159. },
  160. #---
  161. :type_1 => {
  162. :filename => "EXP_Bar", # Custom EXP Bar Filename.
  163. },
  164. #---
  165. :type_2 => {
  166. :filename => "Btskin_EXP", # Custom Frame-based EXP Bar Filename.
  167. :frames => 10, # Amount of animation frames.
  168. },
  169. } # End exp_bar.
  170. end
  171.  
  172. module SkillMenu
  173. BATTLER_STATUS[:exp_bar] = {
  174. :enable => false, # Enable EXP Bars? True/False
  175. # -----------------------------------------------------------------
  176. # Offset Values refer to how much you want to nudge the window display
  177. # without affecting its base x, y and z.
  178. # -----------------------------------------------------------------
  179. :offset_x => 228,
  180. :offset_y => 48,
  181. :offset_z => 0,
  182. # -----------------------------------------------------------------
  183. # Type allows you to set the type of graphic you want to use.
  184. # 0 - Default bar; 1 - Custom bar; 2 - Custom animated bar.
  185. # -----------------------------------------------------------------
  186. :type => 0,
  187. :vertical => false,# Display vertically? True/False
  188. # Works for type 0 and 1.
  189. :ani_rate => 0.02, # Max is 1.00. Refers to animate speed/rate.
  190. #---
  191. :type_0 => {
  192. # -----------------------------------------------------------------
  193. # Set the color for the bar background. [R,G,B,A]
  194. # You can also use normal_color to use the default windowskin colors.
  195. # -----------------------------------------------------------------
  196. :back_color => [0, 0, 0, 255],
  197. # -----------------------------------------------------------------
  198. # color1 = refers to the first color of the gradient. ([R,G,B,A])
  199. # color2 = refers to the second color of the gradient. ([R,G,B,A])
  200. # normal_color refers to the color of your default windowskin.
  201. # -----------------------------------------------------------------
  202. :color1 => [7, 101, 58, 255],
  203. :color2 => [84, 194, 144, 255],
  204. # -----------------------------------------------------------------
  205. # Set the outline color for the name display. [R,G,B,A]
  206. # You can also use normal_color to use the default outline color.
  207. # -----------------------------------------------------------------
  208. :outline => [0, 0, 0, 255],
  209. :length => 220, # Width/Length of the bar.
  210. :height => 12, # Height of the bar.
  211.  
  212. # -----------------------------------------------------------------
  213. # This section allows you to customize the "EXP" Vocab display.
  214. # -----------------------------------------------------------------
  215. # -----------------------------------------------------------------
  216. # Offset Values refer to how much you want to nudge the window display
  217. # without affecting its base x, y and z.
  218. # -----------------------------------------------------------------
  219. :offset_x => 232,
  220. :offset_y => 32,
  221. :offset_z => 1,
  222. # -----------------------------------------------------------------
  223. # Set the color for the name display. [R,G,B,A]
  224. # You can also use normal_color to use the default font color.
  225. # -----------------------------------------------------------------
  226. :tcolor => [255, 255, 255, 255],
  227. # -----------------------------------------------------------------
  228. # Set the outline color for the name display. [R,G,B,A]
  229. # You can also use normal_color to use the default outline color.
  230. # -----------------------------------------------------------------
  231. :toutline => [0, 0, 0, 128],
  232. :bold => false, # Enable Bold? True/False
  233. :italic => false, # Enable Italic? True/False
  234. # -----------------------------------------------------------------
  235. # Set alignment settings.
  236. # 0 = Left/Default, 1 = Center, 2 = Right
  237. # -----------------------------------------------------------------
  238. :align => 0,
  239. :font => "VL Gothic", # Set Font type.
  240. :size => 24, # Set Font Size
  241. :text => "EXP", # Change "EXP" Vocab.
  242. },
  243. #---
  244. :type_1 => {
  245. :filename => "EXP_Bar", # Custom EXP Bar Filename.
  246. },
  247. #---
  248. :type_2 => {
  249. :filename => "Btskin_EXP", # Custom Frame-based EXP Bar Filename.
  250. :frames => 10, # Amount of animation frames.
  251. },
  252. } # End exp_bar.
  253.  
  254. CURRENT_ACTOR_STATUS[:exp_bar] = {
  255. :enable => true, # Enable EXP Bars? True/False
  256. # -----------------------------------------------------------------
  257. # Offset Values refer to how much you want to nudge the window display
  258. # without affecting its base x, y and z.
  259. # -----------------------------------------------------------------
  260. :offset_x => 228,
  261. :offset_y => 48,
  262. :offset_z => 0,
  263. # -----------------------------------------------------------------
  264. # Type allows you to set the type of graphic you want to use.
  265. # 0 - Default bar; 1 - Custom bar; 2 - Custom animated bar.
  266. # -----------------------------------------------------------------
  267. :type => 0,
  268. :vertical => false,# Display vertically? True/False
  269. # Works for type 0 and 1.
  270. :ani_rate => 0.02, # Max is 1.00. Refers to animate speed/rate.
  271. #---
  272. :type_0 => {
  273. # -----------------------------------------------------------------
  274. # Set the color for the bar background. [R,G,B,A]
  275. # You can also use normal_color to use the default windowskin colors.
  276. # -----------------------------------------------------------------
  277. :back_color => [0, 0, 0, 255],
  278. # -----------------------------------------------------------------
  279. # color1 = refers to the first color of the gradient. ([R,G,B,A])
  280. # color2 = refers to the second color of the gradient. ([R,G,B,A])
  281. # normal_color refers to the color of your default windowskin.
  282. # -----------------------------------------------------------------
  283. :color1 => [7, 101, 58, 255],
  284. :color2 => [84, 194, 144, 255],
  285. # -----------------------------------------------------------------
  286. # Set the outline color for the name display. [R,G,B,A]
  287. # You can also use normal_color to use the default outline color.
  288. # -----------------------------------------------------------------
  289. :outline => [0, 0, 0, 255],
  290. :length => 220, # Width/Length of the bar.
  291. :height => 12, # Height of the bar.
  292.  
  293. # -----------------------------------------------------------------
  294. # This section allows you to customize the "EXP" Vocab display.
  295. # -----------------------------------------------------------------
  296. # -----------------------------------------------------------------
  297. # Offset Values refer to how much you want to nudge the window display
  298. # without affecting its base x, y and z.
  299. # -----------------------------------------------------------------
  300. :offset_x => 232,
  301. :offset_y => 32,
  302. :offset_z => 1,
  303. # -----------------------------------------------------------------
  304. # Set the color for the name display. [R,G,B,A]
  305. # You can also use normal_color to use the default font color.
  306. # -----------------------------------------------------------------
  307. :tcolor => [255, 255, 255, 255],
  308. # -----------------------------------------------------------------
  309. # Set the outline color for the name display. [R,G,B,A]
  310. # You can also use normal_color to use the default outline color.
  311. # -----------------------------------------------------------------
  312. :toutline => [0, 0, 0, 128],
  313. :bold => false, # Enable Bold? True/False
  314. :italic => false, # Enable Italic? True/False
  315. # -----------------------------------------------------------------
  316. # Set alignment settings.
  317. # 0 = Left/Default, 1 = Center, 2 = Right
  318. # -----------------------------------------------------------------
  319. :align => 0,
  320. :font => "VL Gothic", # Set Font type.
  321. :size => 24, # Set Font Size
  322. :text => "EXP", # Change "EXP" Vocab.
  323. },
  324. #---
  325. :type_1 => {
  326. :filename => "EXP_Bar", # Custom EXP Bar Filename.
  327. },
  328. #---
  329. :type_2 => {
  330. :filename => "Btskin_EXP", # Custom Frame-based HP Bar Filename.
  331. :frames => 10, # Amount of animation frames.
  332. },
  333. } # End exp_bar.
  334. end
  335. end
  336.  
  337. #==============================================================================
  338. # ■ SpriteMenu_Bar
  339. #==============================================================================
  340.  
  341. class SpriteMenu_Bar < Sprite
  342.  
  343. #--------------------------------------------------------------------------
  344. # alias method: real_rate
  345. #--------------------------------------------------------------------------
  346. alias luna_exp_bar_real_rate real_rate
  347. def real_rate
  348. case @symbol
  349. when :exp_bar
  350. return exp_rate
  351. else
  352. return luna_exp_bar_real_rate
  353. end
  354. end
  355.  
  356. #--------------------------------------------------------------------------
  357. # exp_rate
  358. #--------------------------------------------------------------------------
  359. def exp_rate
  360. floor_exp = @battler.exp - @battler.current_level_exp
  361. ceil_exp = @battler.next_level_exp - @battler.current_level_exp
  362. return floor_exp.to_f / ceil_exp.to_f
  363. end
  364.  
  365. end # SpriteMenu_Bar
  366.  
  367. #==============================================================================
  368. # ■ Spriteset_MenuStatus
  369. #==============================================================================
  370.  
  371. class Spriteset_MenuStatus
  372.  
  373. #--------------------------------------------------------------------------
  374. # alias method: create_bars
  375. #--------------------------------------------------------------------------
  376. alias luna_exp_bar_create_bars create_bars
  377. def create_bars
  378. luna_exp_bar_create_bars
  379. exp_bar = SpriteMenu_Bar.new(@viewport, self, :exp_bar, @setting)
  380. @sprites.push(exp_bar)
  381. end
  382.  
  383. end # Spriteset_MenuStatus
Advertisement
Add Comment
Please, Sign In to add comment