Advertisement
Dekita

$D13x Status Scene v1.1

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