Advertisement
Dekita

$D13x CORE 1.5

Apr 2nd, 2013
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.22 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - CORE
  5. # -- Author : Dekita
  6. # -- Version : 1.5
  7. # -- Level : Easy
  8. # -- Requires : N/A
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:CORE] = true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # o1/o4/2o13 - Added More Keyboard Keys,
  21. # ^- :F1, :F2, :F3, :F4, :F5, :F6, :F7, :F8, :F9, :F10, :F11, :F12
  22. # ^- :N_0, :N_1, :N_2, :N_3, :N_4, :N_5, :N_6, :N_7, :N_8, :N_9,
  23. # ^- :ADD, :MUL, :SUB, :DIV, :DECI, :TAB, :BACK, :ENTER, :CAPS,
  24. # ^- :SPACE, :ESC, :ALT
  25. # 29/o3/2o13 - Added More Keyboard Keys,(Left/Right CTRL)
  26. # 28/o3/2o13 - Improved Customisation Layout,
  27. # - Removed Some Methods,
  28. # - Improved Keyboard Code,
  29. # 27/o3/2o13 - Added Keyboard Control,
  30. # 26/o3/2o13 - Compatibility, (Status Scene)
  31. # - Update, (Icons w/Hue)
  32. # 18/03/2013 - Compatibility, (Skill Scene)
  33. # 23/o2/2o13 - Started, Finished,
  34. #
  35. #===============================================================================
  36. # ☆ Introduction
  37. #-------------------------------------------------------------------------------
  38. # This script simply holds some information and methods used by some other
  39. # scripts in the $D13x system.
  40. # Current Features:
  41. # Fonts,
  42. # Color,
  43. # Vocab,
  44. # Keyboard Control,
  45. # Icons (w/Hue)...
  46. #
  47. # Place above all other $D13x Scripts.
  48. #
  49. #===============================================================================
  50. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  51. #===============================================================================
  52. # 1. You MUST give credit to "Dekita" !!
  53. # 2. You are NOT allowed to repost this script.(or modified versions)
  54. # 3. You are NOT allowed to convert this script.
  55. # 4. You are NOT allowed to use this script for Commercial games.
  56. # 5. ENJOY!
  57. #
  58. # "FINE PRINT"
  59. # By using this script you hereby agree to the above terms and conditions,
  60. # if any violation of the above terms occurs "legal action" may be taken.
  61. # Not understanding the above terms and conditions does NOT mean that
  62. # they do not apply to you.
  63. # If you wish to discuss the terms and conditions in further detail you can
  64. # contact me at http://dekitarpg.wordpress.com/ or DekitaRPG@gmail.com
  65. #
  66. #===============================================================================
  67. # ☆ Instructions
  68. #-------------------------------------------------------------------------------
  69. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  70. # Place Above ALL Other $D13x Scripts.
  71. #
  72. #===============================================================================
  73. # ☆ Notetags
  74. # For use with Weapons / Armors
  75. #-------------------------------------------------------------------------------
  76. # <tcol: red, grn, blu>
  77. # use this notetag to change the color of the items text shown in some of my
  78. # scenes.
  79. #
  80. #===============================================================================
  81. # ☆ HELP
  82. #-------------------------------------------------------------------------------
  83. # Heres a list of :key_symbols ( for use in scripts that require this one )
  84. # F KEYS
  85. # :F1, :F2, :F3, :F4, :F5, :F6, :F7, :F8, :F9, :F10, :F11, :F12
  86. # NUMBER KEYS
  87. # :_1, :_2, :_3, :_4, :_5, :_6, :_7, :_8, :_9, :_0
  88. # LETTERS
  89. # :A, :B, :C, :D, :E, :F, :G, :H, :I, :J, :K, :L, :M, :N,
  90. # :O, :P, :Q, :R, :S, :T, :U, :V, :W, :X, :Y, :Z
  91. # NUM PAD
  92. # :N_0, :N_1, :N_2, :N_3, :N_4, :N_5, :N_6, :N_7, :N_8, :N_9,
  93. # :ADD, :MUL, :SUB, :DIV, :DECI
  94. # ARROWS
  95. # :LEFT, :RIGHT, :UP, :DOWN
  96. # OTHER
  97. # :SHIFT, :LSHIFT, :RSHIFT, :TAB, :PAUSE, :CTRL, :L_CTRL, :R_CTRL,
  98. # :BACK, :ENTER, :CAPS, :SPACE, :ESC, :ALT
  99. #
  100. # To Disable A Key, Make Symbol = :NONE,
  101. #
  102. #===============================================================================
  103. module Text_Color
  104. #===============================================================================
  105. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  106. # ☆ Color Settings
  107. #-----------------------------------------------------------------------------
  108. # You can use these colors in any of my scripts that offer color customisation.
  109. # simply put Text_Color::THE_COLOR_YOU_WANT as the setting.
  110. # eg.
  111. # Text_Color::Pure_White
  112. #-----------------------------------------------------------------------------
  113. # White's
  114. Pure_White = Color.new(255,255,255)
  115. White = Color.new(222,222,222)
  116. Grey = Color.new(111,111,111)
  117. Black = Color.new(0 ,0 ,0 )
  118. #-----------------------------------------------------------------------------
  119. # Yellow's
  120. Yellow = Color.new(255,255,0)
  121. Gold = Color.new(212,212,64)
  122. Orange = Color.new(255,182,0)
  123. Deep_Orange = Color.new(212,64,0)
  124. Dirt_Orange = Color.new(182,64,0)
  125. Brown = Color.new(128,32,0)
  126. #-----------------------------------------------------------------------------
  127. # Red's
  128. Red = Color.new(251,111,111)
  129. Deep_Red = Color.new(222,60,60)
  130. Pure_Red = Color.new(255,0,0)
  131. Pink = Color.new(255,0,255)
  132. Dark_Pink = Color.new(182,0,156)
  133. #-----------------------------------------------------------------------------
  134. # Blue's
  135. Sky_Blue = Color.new(0,182,255)
  136. Light_Blue = Color.new(64,128,255)
  137. Dark_Blue = Color.new(32,64,255)
  138. Purple = Color.new(182,64,255)
  139. Magenta = Color.new(156,156,255)
  140. #-----------------------------------------------------------------------------
  141. # Green's
  142. Green = Color.new(111,251,111)
  143. Candy_Green = Color.new(0,255,0)
  144. Dirty_Green = Color.new(128,182,0)
  145. Khaki_Green = Color.new(111,156,64)
  146. Turquoise = Color.new(0,255,182)
  147. #-----------------------------------------------------------------------------
  148. # Sets the default equipment text color
  149. Default_Equip_Color = White
  150.  
  151. end #===========================================================================
  152. module General
  153. #==============================================================================
  154. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  155. # ☆ General Settings
  156. #-----------------------------------------------------------------------------
  157. # these settings are usined for visual scripts of mine, such as status screen.
  158. Fonts = ["VL Gothic"]
  159. Font_Size = 18
  160. Font_Bold = false
  161. #-----------------------------------------------------------------------------
  162. # Gauges = [ Color 1 , Color 2 ]
  163. Hp_Colors = [ Text_Color::Dirt_Orange , Text_Color::Gold ]
  164. Mp_Colors = [ Text_Color::Dark_Blue , Text_Color::Sky_Blue ]
  165. Tp_Colors = [ Text_Color::Grey , Text_Color::Pure_Red ]
  166. Exp_Color = [ Text_Color::Deep_Red , Text_Color::Dark_Pink ]
  167. #-----------------------------------------------------------------------------
  168. # Show TP as a percentage ?
  169. # Only works in scripts i have written :p
  170. Show_Tp_As_Perc = false
  171.  
  172. end #===========================================================================
  173. module Vocab
  174. #===============================================================================
  175. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  176. # ☆ Vocabulary Settings
  177. #-----------------------------------------------------------------------------
  178. # This is where you would adjust the common vocab used in some of my scripts.
  179. #-----------------------------------------------------------------------------
  180. # Parameters
  181. def self.param(param_id)
  182. case param_id
  183. when 0 then "Max HP" # "Health"
  184. when 1 then "Max MP" # "Will"
  185. when 2 then "Physical Attack" # "Attack"
  186. when 3 then "Physical Resist" # "Defence"
  187. when 4 then "Magical Attack" # "Magic"
  188. when 5 then "Magical Resist" # "Aura"
  189. when 6 then "Agility" # "Speed"
  190. when 7 then "Luck" # "Luck"
  191. end
  192. end
  193. #-----------------------------------------------------------------------------
  194. # Tp vocab
  195. Tp = "Rage"
  196. #-----------------------------------------------------------------------------
  197. # X - Parameters
  198. def self.x_param(x_param_id)
  199. case x_param_id
  200. when 0 then "Accuracy"
  201. when 1 then "Evasion"
  202. when 2 then "Critical"
  203. when 3 then "Crit Eva"
  204. when 4 then "Mag Eva"
  205. when 5 then "Mag Ref"
  206. when 6 then "Counter"
  207. when 7 then "HP Regen"
  208. when 8 then "MP Regen"
  209. when 9 then "TP Regen"
  210. end
  211. end
  212. #-----------------------------------------------------------------------------
  213. # S - Parameters
  214. def self.s_param(s_param_id)
  215. case s_param_id
  216. when 0 then "Aggro"
  217. when 1 then "Guard"
  218. when 2 then "Recovery"
  219. when 3 then "Medicine"#Pharmacology
  220. when 4 then "MP Cost"
  221. when 5 then "TP Charge"
  222. when 6 then "P DMG Taken"
  223. when 7 then "M DMG Taken"
  224. when 8 then "Floor DMG"
  225. when 9 then "Exp Rate"
  226. end
  227. end
  228. #-----------------------------------------------------------------------------
  229. # Specials
  230. def self.specials(id)
  231. case id
  232. when 0 then "Auto-Fight"
  233. when 1 then "Guard"
  234. when 2 then "Substitue"
  235. when 3 then "Preserve TP"
  236. end
  237. end
  238. #-----------------------------------------------------------------------------
  239. # Collapse Type
  240. def self.collapse_type(id)
  241. case id
  242. when 0 then "Boss"
  243. when 1 then "Instant"
  244. when 2 then "No Vanish"
  245. end
  246. end
  247. #-----------------------------------------------------------------------------
  248. # Party Ability
  249. def self.party_ability(id)
  250. case id
  251. when 0 then "Encounter ½"
  252. when 1 then "Encounter NA"
  253. when 2 then "No Surprise"
  254. when 3 then "Pre-Emptive +"
  255. when 4 then "Gold Double"
  256. when 5 then "Double Drops"
  257. end
  258. end
  259. #-----------------------------------------------------------------------------
  260. # Various Statistics
  261. Attack_Speed = "Atk Speed"
  262. Attack_Times = "Atks Per Turn" # "APT"
  263. Skill_Type = "Skillset"
  264. Skill = "Skills"
  265. Equip_Type = "Equipable"
  266. Action_Times = "Action Time"
  267. Fixed = "Fixed "
  268. Sealed = "Sealed "
  269. Slot_Type = "Slot Type"
  270. Dual_Slot = "Dual Wield"
  271. One__Slot = "Single"
  272. #####################
  273. # CUSTOMISATION END #
  274. end #####################
  275. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  276. # #
  277. # http://dekitarpg.wordpress.com/ #
  278. # #
  279. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  280. # The following code is protected under the 2013 Dekita Data Protection Act. #
  281. # Ie. The “Do Not Fucking Look” Law. #
  282. # Breaking This One And Only Rule May Result In The Following Side Effects : #
  283. # Eyes Bleeding, Nightmares, Severe Head Ache's AND A Scratch On Your Knee :p #
  284. # That is all ! #
  285. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  286.  
  287. #===============================================================================
  288. class Object
  289. #===============================================================================
  290. #-------------------------------------------------------------------------
  291. # rand_between
  292. #-------------------------------------------------------------------------
  293. def rand_between(min, max)
  294. min + rand(max - min + 1)
  295. end
  296.  
  297. end
  298.  
  299. #===============================================================================
  300. class Numeric
  301. #===============================================================================
  302. #---------------------------------------------------------------------------
  303. # To Float (with limited digits after decimal point)
  304. #---------------------------------------------------------------------------
  305. def to_flim(limit = 5, saftey = "0")
  306. str = self.to_f.to_s + saftey
  307. new_str = ""
  308. limit.times do |i|
  309. break if new_str =~ /[0-9].[0-9][0-9]/
  310. break if str[i] == nil
  311. new_str += str[i]
  312. end
  313. return new_str
  314. end
  315. #---------------------------------------------------------------------------
  316. # To A Percentage Of (num)
  317. #---------------------------------------------------------------------------
  318. def perc_of(num)
  319. self.to_f / num.to_f * 100.0
  320. end
  321. #---------------------------------------------------------------------------
  322. # Even ?
  323. #---------------------------------------------------------------------------
  324. def even?
  325. e = self.to_s
  326. e[e.size] == ("0"||"2"||"4"||"6"||"8")
  327. end
  328. #---------------------------------------------------------------------------
  329. # 0dd?
  330. #---------------------------------------------------------------------------
  331. def odd?
  332. o = self.to_s
  333. o[o.size] == ("1"||"3"||"5"||"7"||"9")
  334. end
  335.  
  336. end
  337.  
  338. #===============================================================================
  339. module Keys
  340. #===============================================================================
  341. #---------------------------------------------------------------------------
  342. # Win32API Information
  343. #---------------------------------------------------------------------------
  344. def self.w ; Win32API ; end
  345. def self.u ; "user32" ; end
  346. def self.i ; "i" ; end
  347. def self.gk ; "GetKeyState" ; end
  348. def self.ga ; "GetAsyncKeyState" ; end
  349. #---------------------------------------------------------------------------
  350. # Key Settings
  351. #---------------------------------------------------------------------------
  352. Key={
  353. # F's
  354. :F1 => 0x70, :F2 => 0x71, :F3 => 0x72, :F4 => 0x73, :F5 => 0x74,
  355. :F6 => 0x75, :F7 => 0x76, :F8 => 0x77, :F9 => 0x78, :F10 => 0x7a,
  356. :F11 => 0x7b, :F12 => 0x7c,
  357. # Numbers
  358. :_0 => 0x30,:_1 => 0x31,:_2 => 0x32,:_3 => 0x33,:_4 => 0x34,
  359. :_5 => 0x35,:_6 => 0x36,:_7 => 0x37,:_8 => 0x38,:_9 => 0x39,
  360. # Letters
  361. :A => 0x41,:B => 0x42,:C => 0x43,:D => 0x44,:E => 0x45,:F => 0x46,:G => 0x47,
  362. :H => 0x48,:I => 0x49,:J => 0x4A,:K => 0x4B,:L => 0x4C,:M => 0x4D,:N => 0x4E,
  363. :O => 0x4F,:P => 0x50,:Q => 0x51,:R => 0x52,:S => 0x53,:T => 0x54,:U => 0x55,
  364. :V => 0x56,:W => 0x57,:X => 0x58,:Y => 0x59,:Z => 0x5A,
  365. # NumPad
  366. :N_0 => 0x60, :N_1 => 0x61, :N_2 => 0x62, :N_3 => 0x63, :N_4 => 0x64,
  367. :N_5 => 0x65, :N_6 => 0x66, :N_7 => 0x67, :N_8 => 0x68, :N_9 => 0x69,
  368. :ADD => 0x6b, :MUL => 0x6a, :SUB => 0x6d, :DIV => 0x6f, :DECI => 0x6e,
  369. # Arrows
  370. :LEFT => 0x25, :RIGHT => 0x27, :UP => 0x26, :DOWN => 0x28,
  371. # Other
  372. :SHIFT => 0x10, :LSHIFT => 0xa0, :RSHIFT => 0xa1, :TAB => 0x09,
  373. :PAUSE => 0x13, :L_CTRL => 0xa2, :R_CTRL => 0xa3, :CTRL => 0x11,
  374. :BACK => 0x08, :ENTER => 0x0D, :CAPS => 0x14, :SPACE => 0x20,
  375. :ESC => 0x1B, :ALT => 0x12,
  376. } # << End Key {}
  377. #---------------------------------------------------------------------------
  378. # Constants
  379. #---------------------------------------------------------------------------
  380. KS = w.new(u,gk,[i],i)
  381. AK = w.new(u,ga,[i],i)
  382. #---------------------------------------------------------------------------
  383. # Variables
  384. #---------------------------------------------------------------------------
  385. @triggers = Array.new(256, false)
  386. @presses = Array.new(256, false)
  387. @repeats = Array.new(256, false)
  388. #---------------------------------------------------------------------------
  389. # Key Got Triggered?
  390. #---------------------------------------------------------------------------
  391. def self.trigger?(key)
  392. return if key.nil?
  393. return @triggers[key]
  394. end
  395. #---------------------------------------------------------------------------
  396. # Key Being Pressed Currently ?
  397. #---------------------------------------------------------------------------
  398. def self.press?(key)
  399. return if key.nil?
  400. return @presses[key]
  401. end
  402. #---------------------------------------------------------------------------
  403. # Key Being Held Down?
  404. #---------------------------------------------------------------------------
  405. def self.repeat?(key)
  406. return if key.nil?
  407. return @repeats[key]
  408. end
  409. #---------------------------------------------------------------------------
  410. # Update All Keys
  411. #---------------------------------------------------------------------------
  412. def self.update
  413. Key.each do |key|
  414. akey = AK.call(key[1])
  415. ktri = KS.call(key[1])
  416. @presses[ key[1]] = (akey != 0) ? true : false
  417. @triggers[key[1]] = (akey != 0) ? true : false
  418. @repeats[ key[1]] = (ktri == 1) ? true : false
  419. end
  420. end
  421.  
  422. end
  423.  
  424. #===============================================================================
  425. module Input
  426. #===============================================================================
  427. #---------------------------------------------------------------------------
  428. # Alias List
  429. #---------------------------------------------------------------------------
  430. class << self
  431. alias :update_sD13x_Keys :update
  432. end
  433. #---------------------------------------------------------------------------
  434. # Update $D13x Keys
  435. #---------------------------------------------------------------------------
  436. def self.update(*args)
  437. update_sD13x_Keys(*args)
  438. Keys.update
  439. end
  440.  
  441. end
  442.  
  443. #===============================================================================
  444. module Cache
  445. #===============================================================================
  446. #--------------------------------------------------------------------------
  447. # * Get System Graphic
  448. #--------------------------------------------------------------------------
  449. def self.icon(filename = "IconSet", hue = 0)
  450. load_bitmap("Graphics/System/", filename, hue)
  451. end
  452.  
  453. end
  454.  
  455. #===============================================================================
  456. module DataManager
  457. #===============================================================================
  458. #---------------------------------------------------------------------------
  459. # Alias List
  460. #---------------------------------------------------------------------------
  461. class << self
  462. alias :lbd_unique_shits :load_database
  463. end
  464. #---------------------------------------------------------------------------
  465. # Load Database (alias)
  466. #---------------------------------------------------------------------------
  467. def self.load_database
  468. lbd_unique_shits
  469. loa_unique_shits
  470. end
  471. #---------------------------------------------------------------------------
  472. # Load Unique Shit
  473. #---------------------------------------------------------------------------
  474. def self.loa_unique_shits
  475. classes = [$data_weapons, $data_armors , $data_items , $data_skills ,
  476. $data_actors , $data_classes, $data_enemies, $data_states ]
  477. for g in classes
  478. for o in g
  479. next if o == nil
  480. o.load_unique_shit
  481. end
  482. end
  483. end
  484.  
  485. end # << DataManager
  486.  
  487. #===============================================================================
  488. class RPG::BaseItem
  489. #===============================================================================
  490. #--------------------------------------------------------------------------
  491. # Pi Variables
  492. #--------------------------------------------------------------------------
  493. attr_accessor :item_disp_color
  494. #--------------------------------------------------------------------------
  495. # Loads Unique Shit
  496. #--------------------------------------------------------------------------
  497. def load_unique_shit
  498. load_item_color
  499. # << For use in Child Classes
  500. end
  501. #---------------------------------------------------------------------------
  502. # Load Item Text Color
  503. #---------------------------------------------------------------------------
  504. def load_item_color
  505. @item_disp_color = Text_Color::Default_Equip_Color
  506. if self.note.match(/<tcol:(.*),(.*),(.*)>/i)
  507. @item_disp_color = Color.new($1.to_i,$2.to_i,$3.to_i)
  508. end
  509. end
  510. #--------------------------------------------------------------------------
  511. # Returns features for item filtered by code (credits Tsukihime)
  512. #--------------------------------------------------------------------------
  513. def feature_val(code)
  514. self.features.select {|ft| ft.code == code}
  515. end
  516. #--------------------------------------------------------------------------
  517. # Returns features for item filtered by code and data ID (credits Tsukihime)
  518. #--------------------------------------------------------------------------
  519. def feature_val_with_id(code, data_id)
  520. self.features.select {|ft| ft.code == code && ft.data_id == data_id}
  521. end
  522. #--------------------------------------------------------------------------
  523. # Returns sum of all features for item, by code and data ID (credits Tsukihime)
  524. #--------------------------------------------------------------------------
  525. def features_sum(code, data_id)
  526. feature_val_with_id(code, data_id).inject(0.0) {|r, ft| r += ft.value }
  527. end
  528. #--------------------------------------------------------------------------
  529. # Returns features pi
  530. #--------------------------------------------------------------------------
  531. def features_pi(code, data_id)
  532. feature_val_with_id(code, data_id).inject(1.0) {|r, ft| r *= ft.value }
  533. end
  534. #--------------------------------------------------------------------------
  535. # Calculate Set Sum of Features
  536. #--------------------------------------------------------------------------
  537. def features_set(code)
  538. feature_val(code).inject([]) {|r, ft| r |= [ft.data_id] }
  539. end
  540.  
  541. end # << RPG::BaseItem
  542.  
  543. #==============================================================================
  544. class Window_Base < Window
  545. #==============================================================================
  546. #--------------------------------------------------------------------------
  547. # Draw Gauge (w/height)
  548. #--------------------------------------------------------------------------
  549. def draw_deki_gauge(gx, gy, gw, gh, rate, color1, color2)
  550. empty_gauge_color = Color.new(0,0,0,128)
  551. fill_w = [(gw * rate).to_i, gw].min
  552. gauge_h = gh
  553. gauge_y = gy + line_height - 2 - gauge_h
  554. contents.fill_rect(gx, gauge_y, gw, gauge_h, empty_gauge_color)
  555. contents.gradient_fill_rect(gx, gauge_y, fill_w, gauge_h, color1, color2)
  556. end
  557. #--------------------------------------------------------------------------
  558. # Draw Hp
  559. #--------------------------------------------------------------------------
  560. def draw_de_hp(x, y, wid = nil)
  561. wid = self.width/2 - (standard_padding*2) if wid == nil
  562. rate = @actor.hp_rate
  563. color1 = General::Hp_Colors[0]
  564. color2 = General::Hp_Colors[1]
  565. draw_deki_gauge(x, y, wid-x-2, 2, rate, color1, color2)
  566. draw_text(x, y, wid, line_height, Vocab::param(0))
  567. draw_text(x, y, wid-x-2, line_height, "#{@actor.hp}/#{@actor.mhp}",2)
  568. end
  569. #--------------------------------------------------------------------------
  570. # Draw Mp
  571. #--------------------------------------------------------------------------
  572. def draw_de_mp(x, y, wid = nil)
  573. wid = self.width/2 - (standard_padding*2) if wid == nil
  574. rate = @actor.mp_rate
  575. color1 = General::Mp_Colors[0]
  576. color2 = General::Mp_Colors[1]
  577. draw_deki_gauge(x, y, wid-x-2, 2, rate, color1, color2)
  578. draw_text(x, y, wid, line_height, Vocab::param(1))
  579. draw_text(x, y, wid-x-2, line_height, "#{@actor.mp}/#{@actor.mmp}",2)
  580. end
  581. #--------------------------------------------------------------------------
  582. # Draw Tp
  583. #--------------------------------------------------------------------------
  584. def draw_de_tp(x, y, wid = nil)
  585. wid = self.width/2 - (standard_padding*2) if wid == nil
  586. rate = @actor.tp / 100
  587. color1 = General::Tp_Colors[0]
  588. color2 = General::Tp_Colors[1]
  589. draw_deki_gauge(x, y, wid-x-2, 2, rate, color1, color2)
  590. draw_text(x, y, wid, line_height, Vocab::Tp)
  591. text = "#{(@actor.tp).to_i}/100"
  592. text = "#{(@actor.tp.perc_of(100)).to_flim}%" if General::Show_Tp_As_Perc
  593. draw_text(x, y, wid-x-2, line_height, text,2)
  594. end
  595. #--------------------------------------------------------------------------
  596. # Draw Exp (w/gauge)
  597. #--------------------------------------------------------------------------
  598. def draw_de_xp(x, y, gauge = true)
  599. s1 = @actor.current_level_exp
  600. s2 = @actor.next_level_exp
  601. s1_g = @actor.exp - @actor.current_level_exp
  602. s2_g = @actor.next_level_exp - @actor.current_level_exp
  603. wid = self.width/2 - (standard_padding*2)
  604. wid_b = self.width/2 - (standard_padding)
  605. rate = (s1_g).to_f / (s2_g)
  606. color1 = General::Exp_Color[0]
  607. color2 = General::Exp_Color[1]
  608. draw_deki_gauge(wid_b, y, wid-x-2, 2, rate, color1, color2) if gauge
  609. draw_text(wid_b, y, wid, line_height, "Exp:")
  610. draw_text(wid_b, y, wid-x-2, line_height, "#{s1}/#{s2}",2)
  611. end
  612. #--------------------------------------------------------------------------
  613. # Draw Icon (w/Hue)
  614. #--------------------------------------------------------------------------
  615. def draw_de_icon(icon_index, x, y, hue = 0, enabled = true)
  616. bitmap = Cache.icon("IconSet",hue)
  617. rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  618. contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  619. end
  620.  
  621. end
  622.  
  623. #==============================================================================
  624. class Deki_Help < Window_Base
  625. #==============================================================================
  626. #--------------------------------------------------------------------------
  627. # Object Initialization
  628. #--------------------------------------------------------------------------
  629. def initialize(line_number = 2)
  630. super(0, 0, Graphics.width/4*3, fitting_height(line_number))
  631. @item = nil
  632. end
  633. #--------------------------------------------------------------------------
  634. # Set Text
  635. #--------------------------------------------------------------------------
  636. def set_text(text)
  637. if text != @text
  638. @text = text
  639. refresh
  640. end
  641. end
  642. #--------------------------------------------------------------------------
  643. # Clear
  644. #--------------------------------------------------------------------------
  645. def clear
  646. set_text("")
  647. end
  648. #--------------------------------------------------------------------------
  649. # Set Item , item : Skills and items etc.
  650. #--------------------------------------------------------------------------
  651. def set_item(item)
  652. return if @item == item
  653. @item = item
  654. refresh
  655. set_text(item ? item.description : "")
  656. end
  657. #--------------------------------------------------------------------------
  658. # Refresh
  659. #--------------------------------------------------------------------------
  660. def refresh
  661. contents.clear
  662. draw_text_ex(4, 0, @text)
  663. end
  664. #--------------------------------------------------------------------------
  665. # Reset Font Settings
  666. #--------------------------------------------------------------------------
  667. def reset_font_settings
  668. change_color(normal_color)
  669. self.contents.font.name = General::Fonts
  670. self.contents.font.size = General::Font_Size
  671. self.contents.font.bold = General::Font_Bold
  672. end
  673.  
  674. end
  675.  
  676. #==============================================================================#
  677. # http://dekitarpg.wordpress.com/ #
  678. #==============================================================================#
  679. end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement