Advertisement
Dekita

$D13x Status Scene 1.3

May 16th, 2013
562
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.18 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Status Scene
  5. # -- Author : Dekita
  6. # -- Version : 1.3
  7. # -- Level : Easy / Normal
  8. # -- Requires : $D13x Core v 1.3+
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:Status_Scene]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # o5/o5/2o13 - Compatibility, (Equip Sets)
  21. # 27/o3/2o13 - Added Icons w/Hue,
  22. # - Bugfix, (crash when no equip)
  23. # 26/o3/2o13 - Started, Finished,
  24. #
  25. #===============================================================================
  26. # ☆ Introduction
  27. #-------------------------------------------------------------------------------
  28. # This script simply allows more control over the status screen, as well as
  29. # shows pretty colors for each equipment item / statistic :p
  30. #
  31. #===============================================================================
  32. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  33. #===============================================================================
  34. # 1. You MUST give credit to "Dekita" !!
  35. # 2. You are NOT allowed to repost this script.(or modified versions)
  36. # 3. You are NOT allowed to convert this script.
  37. # 4. You are NOT allowed to use this script for Commercial games.
  38. # 5. ENJOY!
  39. #
  40. # "FINE PRINT"
  41. # By using this script you hereby agree to the above terms and conditions,
  42. # if any violation of the above terms occurs "legal action" may be taken.
  43. # Not understanding the above terms and conditions does NOT mean that
  44. # they do not apply to you.
  45. # If you wish to discuss the terms and conditions in further detail you can
  46. # contact me at http://dekitarpg.wordpress.com/
  47. #
  48. #===============================================================================
  49. # ☆ Instructions
  50. #-------------------------------------------------------------------------------
  51. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  52. # Place Under My $D13x - Core Script.
  53. #
  54. #===============================================================================
  55. # ☆ HELP
  56. #-------------------------------------------------------------------------------
  57. # PARAMS : # XPARAMS : # SPARAMS : #
  58. # stat = id # stat = id # stat = id #
  59. # mhp = 0 # hit = 0 # tgr = 0 #
  60. # mmp = 1 # eva = 1 # grd = 1 #
  61. # atk = 2 # cri = 2 # rec = 2 #
  62. # def = 3 # cev = 3 # pha = 3 #
  63. # mat = 4 # mev = 4 # mcr = 4 #
  64. # mdf = 5 # mrf = 5 # tcr = 5 #
  65. # agi = 6 # cnt = 6 # pdr = 6 #
  66. # luk = 7 # hrg = 7 # mdr = 7 #
  67. # # mrg = 8 # fdr = 8 #
  68. # # trg = 9 # exr = 9 #
  69. #-------------------------------------------------------------------------------
  70. # Also, element id numbers can be found in the database.
  71. #===============================================================================
  72. module Status_Scene
  73. #===============================================================================
  74.  
  75. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  76. # ☆ Command Settings
  77. #--------------------------------------------------------------------------
  78. # This is where you would adjust how many pages you see.
  79. # If you wish to display less pages, simply put a # before the line
  80. Commands=[
  81. [:page_1, "I"],
  82. [:page_2, "II"],
  83. [:page_3, "III"],
  84. [:page_4, "IV"],
  85. [:page_5, "V"],
  86. ] # << Keep
  87.  
  88. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  89. # ☆ Page Settings
  90. #--------------------------------------------------------------------------
  91. # This is where you adjust what information is shown on each page
  92. # the options are :
  93. # [:header, "FOR DISPLAYING TEXT LIKE THIS" , icon, hue],
  94. # [:param, param_id, Text_Color, icon, hue],
  95. # [:x_param, xparam_id, Text_Color, icon, hue],
  96. # [:s_param, sparam_id, Text_Color, icon, hue],
  97. # [:atk_ele, element_id, Text_Color, icon, hue],
  98. # [:def_ele, element_id, Text_Color, icon, hue],
  99. # NOTE :
  100. # If icon is 0 the text will be positioned where the icon would have been.
  101. Values_Colored = true
  102.  
  103. Use_Icons = true
  104.  
  105. Info={
  106. :page_1=>[
  107. [:header, "Parameter Info :", Text_Color::White,0,0],
  108. [:param, 0, Text_Color::White, 10, 200],
  109. [:param, 1, Text_Color::White, 10, 0],
  110. [:param, 2, Text_Color::White, 116, 0],
  111. [:param, 3, Text_Color::White, 510,280],
  112. [:param, 4, Text_Color::White, 116,120],
  113. [:param, 5, Text_Color::White, 13, 120],
  114. [:param, 6, Text_Color::White, 12, 280],
  115. [:param, 7, Text_Color::White, 125, 0],
  116. ],
  117. :page_2=>[
  118. [:header, "xParameter Info :", Text_Color::White,0,0],
  119. [:x_param, 0, Text_Color::White, 11, 0],
  120. [:x_param, 1, Text_Color::White, 12, 0],
  121. [:x_param, 2, Text_Color::White, 113, 0],
  122. [:x_param, 3, Text_Color::White, 114, 0],
  123. [:x_param, 4, Text_Color::White, 15, 0],
  124. # [:x_param, 5, Text_Color::White, 14, 0],
  125. # [:x_param, 6, Text_Color::White,200, 0],
  126. [:x_param, 7, Text_Color::White, 10,200],
  127. [:x_param, 8, Text_Color::White, 10, 0],
  128. [:x_param, 9, Text_Color::White, 14, 0],
  129. ],
  130. :page_3=>[
  131. [:header, "sParameter Info :", Text_Color::White,0,0],
  132. [:s_param, 0, Text_Color::White, 9, 0],
  133. [:s_param, 1, Text_Color::White, 139, 0],
  134. [:s_param, 2, Text_Color::White, 112, 0],
  135. [:s_param, 3, Text_Color::White, 215,260],
  136. [:s_param, 4, Text_Color::White, 117, 0],
  137. [:s_param, 5, Text_Color::White, 119, 0],
  138. [:s_param, 6, Text_Color::White, 160, 0],
  139. [:s_param, 7, Text_Color::White, 160,120],
  140. # [:s_param, 8, Text_Color::White, 25, 0],
  141. # [:s_param, 9, Text_Color::White, 26, 0],
  142. ],
  143. :page_4=>[
  144. [:header, "Outbound Elemental Damage :", Text_Color::White,0,0],
  145. [:atk_ele, 3, Text_Color::Deep_Red, 104, 0],
  146. [:atk_ele, 4, Text_Color::Dark_Blue, 105, 0],
  147. [:atk_ele, 5, Text_Color::Yellow, 106, 0],
  148. [:atk_ele, 6, Text_Color::Sky_Blue, 107, 0],
  149. [:atk_ele, 7, Text_Color::Brown, 108, 0],
  150. [:atk_ele, 8, Text_Color::Candy_Green, 109, 0],
  151. [:atk_ele, 9, Text_Color::Pure_White, 110, 0],
  152. [:atk_ele, 10, Text_Color::Grey, 111, 0],
  153. ],
  154. :page_5=>[
  155. [:header, "Inbound Elemental Damage :", Text_Color::White,0,0],
  156. [:def_ele, 3, Text_Color::Deep_Red, 104, 0],
  157. [:def_ele, 4, Text_Color::Dark_Blue, 105, 0],
  158. [:def_ele, 5, Text_Color::Yellow, 106, 0],
  159. [:def_ele, 6, Text_Color::Sky_Blue, 107, 0],
  160. [:def_ele, 7, Text_Color::Brown, 108, 0],
  161. [:def_ele, 8, Text_Color::Candy_Green, 109, 0],
  162. [:def_ele, 9, Text_Color::Pure_White, 110, 0],
  163. [:def_ele, 10, Text_Color::Grey, 111, 0],
  164. ],
  165. } # << End Page's Settings
  166.  
  167. end #####################
  168. # CUSTOMISATION END #
  169. #####################
  170. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  171. # #
  172. # http://dekitarpg.wordpress.com/ #
  173. # #
  174. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  175. #===============================================================================#
  176. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  177. # YES?\.\. #
  178. # OMG, REALLY? \| #
  179. # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
  180. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  181. #===============================================================================#
  182. class Window_StatusCommand < Window_Command
  183. #===============================================================================
  184. #--------------------------------------------------------------------------
  185. # Get Window Width
  186. #--------------------------------------------------------------------------
  187. def window_width
  188. return Graphics.width / 4
  189. end
  190. #--------------------------------------------------------------------------
  191. # Get Number of Lines to Show
  192. #--------------------------------------------------------------------------
  193. def visible_line_number
  194. return 2
  195. end
  196. #--------------------------------------------------------------------------
  197. # Set/Get Alignment
  198. #--------------------------------------------------------------------------
  199. def alignment
  200. return 1
  201. end
  202. #--------------------------------------------------------------------------
  203. # Create Command List
  204. #--------------------------------------------------------------------------
  205. def make_command_list
  206. for command in Status_Scene::Commands
  207. add_command(command[1], command[0])
  208. end
  209. end
  210. #--------------------------------------------------------------------------
  211. # Draws Items
  212. #--------------------------------------------------------------------------
  213. def draw_item(index)
  214. self.contents.font.name = General::Fonts
  215. self.contents.font.size = General::Font_Size
  216. self.contents.font.bold = General::Font_Bold
  217. draw_text(item_rect_for_text(index), command_name(index), 1)
  218. end
  219.  
  220. end
  221.  
  222. #===============================================================================
  223. class Window_Status < Window_Selectable
  224. #===============================================================================
  225. #--------------------------------------------------------------------------
  226. # Object Initialization
  227. #--------------------------------------------------------------------------
  228. def initialize(actor, y)
  229. super(0, y, Graphics.width, 104)
  230. @actor = actor
  231. refresh
  232. end
  233. #--------------------------------------------------------------------------
  234. # Line Height
  235. #--------------------------------------------------------------------------
  236. def line_height
  237. return 22
  238. end
  239. #--------------------------------------------------------------------------
  240. # Window Padding
  241. #--------------------------------------------------------------------------
  242. def standard_padding
  243. return 8
  244. end
  245. #--------------------------------------------------------------------------
  246. # Do Refresh
  247. #--------------------------------------------------------------------------
  248. def refresh
  249. contents.clear
  250. return unless @actor
  251. if !General::Fonts.include?(self.contents.font.name)
  252. self.contents.font.name = General::Fonts
  253. end
  254. if self.contents.font.size != General::Font_Size
  255. self.contents.font.size = General::Font_Size
  256. end
  257. if self.contents.font.bold != General::Font_Bold
  258. self.contents.font.bold = General::Font_Bold
  259. end
  260. draw_actor_face(@actor,0,-2,enabled = true)
  261. draw_names
  262. draw_de_hp(100, line_height * 1)
  263. draw_de_mp(100, line_height * 2)
  264. draw_de_tp(100, line_height * 3)
  265. draw_de_xp(0, line_height * 3)
  266. end
  267. #--------------------------------------------------------------------------
  268. # Draw Names ( and Lv )
  269. #--------------------------------------------------------------------------
  270. def draw_names
  271. x = self.width/2-(standard_padding)
  272. y = line_height
  273. nx = self.width/2 - (standard_padding*2)
  274. namtxt = "Name: #{@actor.name}"
  275. draw_text(100, 0, nx, line_height, namtxt)
  276. nictxt = "Nickname: #{@actor.nickname}"
  277. draw_text(x, 0, nx, line_height, nictxt)
  278. sttxt = "Status:"
  279. draw_text(x, y*1, nx, line_height, sttxt)
  280. draw_actor_icons(@actor, x+52, line_height * 1 - 2, nx-52)
  281. lvtxt = "Lv #{@actor.level} #{@actor.class.name}"
  282. draw_text(x, y*2, nx, line_height, lvtxt)
  283. end
  284.  
  285. end
  286.  
  287. #===============================================================================
  288. class Window_Status_II < Window_Selectable
  289. #===============================================================================
  290. #--------------------------------------------------------------------------
  291. # * Object Initialization
  292. #--------------------------------------------------------------------------
  293. def initialize(actor, y)
  294. super(0, y, Graphics.width, Graphics.height-y)
  295. @page = nil
  296. @actor = actor
  297. refresh
  298. self.opacity = 0
  299. end
  300. #--------------------------------------------------------------------------
  301. # Set Actor
  302. #--------------------------------------------------------------------------
  303. def actor=(actor)
  304. return if @actor == actor
  305. @actor = actor
  306. refresh
  307. end
  308. #--------------------------------------------------------------------------
  309. # Set Page
  310. #--------------------------------------------------------------------------
  311. def page=(page)
  312. return if @page == page
  313. @page = page
  314. refresh
  315. end
  316. #--------------------------------------------------------------------------
  317. # Refresh
  318. #--------------------------------------------------------------------------
  319. def refresh
  320. contents.clear
  321. freshen
  322. draw_status_inf if @page
  323. end
  324. #--------------------------------------------------------------------------
  325. # Draw Status Page Info
  326. #--------------------------------------------------------------------------
  327. def draw_status_inf
  328. draw_equipments(4, 0)
  329. x = self.width/2 - (standard_padding)
  330. y = 0
  331. for info in Status_Scene::Info[@page]
  332. case info[0]
  333. when :header then y = draw_header(x,y,info[1],info[2],info[3],info[4])
  334. when :param then y = draw_parameters(x,y,info[1],info[2],info[3],info[4])
  335. when :x_param then y = draw_xparameters(x,y,info[1],info[2],info[3],info[4])
  336. when :s_param then y = draw_sparameters(x,y,info[1],info[2],info[3],info[4])
  337. when :atk_ele
  338. next unless $D13x[:Elems_Control]
  339. y = draw_atk_eles(x,y,info[1],info[2],info[3],info[4])
  340. when :def_ele
  341. next unless $D13x[:Elems_Control]
  342. y = draw_def_eles(x,y,info[1],info[2],info[3],info[4])
  343. end
  344. end
  345. end
  346. #--------------------------------------------------------------------------
  347. # Refresh Fonts
  348. #--------------------------------------------------------------------------
  349. def freshen
  350. if !General::Fonts.include?(self.contents.font.name)
  351. self.contents.font.name = General::Fonts
  352. end
  353. if self.contents.font.size != General::Font_Size
  354. self.contents.font.size = General::Font_Size
  355. end
  356. if self.contents.font.bold != General::Font_Bold
  357. self.contents.font.bold = General::Font_Bold
  358. end
  359. end
  360.  
  361. def draw_stat_icons(icon, x, y, hue, enabled = true)
  362. return x unless Status_Scene::Use_Icons
  363. return x unless icon != 0
  364. draw_de_icon(icon, x, y, hue, enabled)
  365. return x += 26
  366. end
  367. #--------------------------------------------------------------------------
  368. # Draw Parameters
  369. #--------------------------------------------------------------------------
  370. def draw_parameters(x,y,i,col,icon,hue)
  371. x = draw_stat_icons(icon, x, y, hue, all_icons_enable?)
  372. text = "#{Vocab::param(i)}"
  373. change_color(col)
  374. draw_text(x, y, wid, line_height, text)
  375. change_color(Text_Color::White) unless Status_Scene::Values_Colored
  376. val = sprintf("%s", @actor.param(i))
  377. draw_text(x+110, y, wid, line_height, val)
  378. return y += line_height
  379. end
  380. #--------------------------------------------------------------------------
  381. # Draw Header
  382. #--------------------------------------------------------------------------
  383. def draw_header(x,y,i,col,icon,hue)
  384. x = draw_stat_icons(icon, x, y, hue, all_icons_enable?)
  385. change_color(col)
  386. draw_text(x, y, wid, line_height, i.to_s)
  387. return y += line_height
  388. end
  389. #--------------------------------------------------------------------------
  390. # Draw x Parameters
  391. #--------------------------------------------------------------------------
  392. def draw_xparameters(x,y,i,col,icon,hue)
  393. x = draw_stat_icons(icon, x, y, hue, all_icons_enable?)
  394. text = "#{Vocab::x_param(i)}"
  395. change_color(col)
  396. draw_text(x, y, wid, line_height, text)
  397. change_color(Text_Color::White) unless Status_Scene::Values_Colored
  398. val = sprintf("%1.2f%%", @actor.xparam(i)*100)
  399. draw_text(x+110, y, wid, line_height, val)
  400. return y += line_height
  401. end
  402. #--------------------------------------------------------------------------
  403. # Draw sParameters
  404. #--------------------------------------------------------------------------
  405. def draw_sparameters(x,y,i,col,icon,hue)
  406. x = draw_stat_icons(icon, x, y, hue, all_icons_enable?)
  407. text = "#{Vocab::s_param(i)}"
  408. change_color(col)
  409. draw_text(x, y, wid, line_height, text)
  410. val = sprintf("%1.2f%%", @actor.sparam(i)*100)
  411. change_color(Text_Color::White) unless Status_Scene::Values_Colored
  412. draw_text(x+110, y, wid, line_height, val)
  413. return y += line_height
  414. end
  415. #--------------------------------------------------------------------------
  416. # Draw Attack Elements
  417. #--------------------------------------------------------------------------
  418. def draw_atk_eles(x,y,i,col,icon,hue)
  419. x = draw_stat_icons(icon, x, y, hue, all_icons_enable?)
  420. text = "#{$data_system.elements[i]}"
  421. change_color(col)
  422. draw_text(x, y, wid, line_height, text)
  423. val = sprintf("%1.2f%%", @actor.atk_element_rate(i)*100)
  424. change_color(Text_Color::White) unless Status_Scene::Values_Colored
  425. draw_text(x+110, y, wid, line_height, val)
  426. return y += line_height
  427. end
  428. #--------------------------------------------------------------------------
  429. # Draw Defence Elements
  430. #--------------------------------------------------------------------------
  431. def draw_def_eles(x,y,i,col,icon,hue)
  432. x = draw_stat_icons(icon, x, y, hue,all_icons_enable?)
  433. text = "#{$data_system.elements[i]}"
  434. change_color(col)
  435. draw_text(x, y, wid, line_height, text)
  436. val = sprintf("%1.2f%%", @actor.element_rate(i)*100)
  437. change_color(Text_Color::White) unless Status_Scene::Values_Colored
  438. draw_text(x+110, y, wid, line_height, val)
  439. return y += line_height
  440. end
  441. #--------------------------------------------------------------------------
  442. # Define wid
  443. #--------------------------------------------------------------------------
  444. def wid
  445. self.width/2-(standard_padding)
  446. end
  447. #--------------------------------------------------------------------------
  448. # Draw Equipment
  449. #--------------------------------------------------------------------------
  450. def draw_equipments(x, y)
  451. @actor.equips.each_with_index do |item, i|
  452. change_color(Text_Color::White)
  453. text = "#{Vocab::etype(@actor.equip_slots[i])}"
  454. draw_text(x, y + (line_height * i), wid, line_height, text)
  455. next unless item
  456. change_color(item.item_disp_color)
  457. draw_de_icon(item.icon_index,x+56,y+(line_height*i),0,true)
  458. draw_text(x+80, y + (line_height * i), wid, line_height, item.name)
  459. end
  460. end
  461. #--------------------------------------------------------------------------
  462. # Enable ALL Icons (make opacity = 255)
  463. #--------------------------------------------------------------------------
  464. def all_icons_enable?
  465. return true
  466. end
  467.  
  468. end
  469.  
  470. #===============================================================================
  471. class Window_Status_BLANK < Window_Selectable
  472. #===============================================================================
  473. #--------------------------------------------------------------------------
  474. # Object Initialization
  475. #--------------------------------------------------------------------------
  476. def initialize( y)
  477. super(0, y, Graphics.width, Graphics.height-y)
  478. refresh
  479. end
  480.  
  481. end
  482.  
  483. #===============================================================================
  484. class Scene_Status < Scene_MenuBase
  485. #===============================================================================
  486. #--------------------------------------------------------------------------
  487. # Start Processing
  488. #--------------------------------------------------------------------------
  489. def start
  490. super
  491. create_help_window
  492. create_command_window
  493. create_status_window
  494. make_eqp_set_wind if $D13x[:Equip_Sets]
  495. update_windows
  496. end
  497. #--------------------------------------------------------------------------
  498. # Create Halp Window
  499. #--------------------------------------------------------------------------
  500. def create_help_window
  501. @help_window = Deki_Help.new
  502. @help_window.viewport = @viewport
  503. @help_window.x = Graphics.width / 4
  504. end
  505. #--------------------------------------------------------------------------
  506. # Create Status Window
  507. #--------------------------------------------------------------------------
  508. def create_status_window
  509. y = @help_window.height
  510. @status_window = Window_Status.new(@actor, y)
  511. y = @status_window.y + @status_window.height
  512. @blank_window = Window_Status_BLANK.new(y)
  513. @status_window_II = Window_Status_II.new(@actor, y)
  514. end
  515. #--------------------------------------------------------------------------
  516. # Create Command Window
  517. #--------------------------------------------------------------------------
  518. def create_command_window
  519. @command_window = Window_StatusCommand.new(0,0)
  520. @command_window.set_handler(:cancel, method(:return_scene))
  521. @command_window.set_handler(:pagedown, method(:next_actor))
  522. @command_window.set_handler(:pageup, method(:prev_actor))
  523. @command_window.activate
  524. end
  525. #--------------------------------------------------------------------------
  526. # Change Actors
  527. #--------------------------------------------------------------------------
  528. def on_actor_change
  529. @status_window.actor = @actor
  530. @status_window_II.actor = @actor
  531. @command_window.activate
  532. change_equip_wind_actor if $D13x[:Equip_Sets]
  533. end
  534. #--------------------------------------------------------------------------
  535. # Update
  536. #--------------------------------------------------------------------------
  537. def update
  538. super
  539. update_windows
  540. update_eqp_set if $D13x[:Equip_Sets]
  541. end
  542. #--------------------------------------------------------------------------
  543. # Update windows
  544. #--------------------------------------------------------------------------
  545. def update_windows
  546. @status_window_II.page = @command_window.current_symbol
  547. @help_window.set_text(@actor.description) if @actor
  548. end
  549.  
  550. end
  551.  
  552. #==============================================================================#
  553. # http://dekitarpg.wordpress.com/ #
  554. #==============================================================================#
  555. end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement