Advertisement
Dekita

$D13x Status Scene v1.2

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