Advertisement
Dekita

$D13x Status Scene v1.0

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