Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if true # << Make true to use this script, false to disable.
- #===============================================================================
- #
- # ☆ $D13x - CORE
- # -- Author : Dekita
- # -- Version : 2.1
- # -- Level : Easy
- # -- Requires : N/A
- # -- Engine : RPG Maker VX Ace.
- #
- #===============================================================================
- # ☆ Import
- #-------------------------------------------------------------------------------
- $D13x={}if$D13x==nil
- $D13x[:CORE] = true
- #===============================================================================
- # ☆ Updates
- #-------------------------------------------------------------------------------
- # D /M /Y
- # o3/o6/2o13 - Bugfix, (Exp Showing incorrect info),
- # 27/o5/2o13 - Added $game_party.alive_battle_members Method
- # 22/o5/2o13 - Small Bugfix, (fixed max tp gauge bug)
- # o4/o5/2o13 - Small Update, (added @database_id)
- # 18/o4/2o13 - Bugfixx, (tp gauge),
- # - Added PrtSc Key,
- # o4/o4/2o13 - Added more keyboard keys,
- # ^- :S_Colon, :Equal, :Comma, :Minus, :Period, :F_Slash, :HASH,
- # ^- :L_Sqr_Brack, :B_Slash, :R_Sqr_Brack, :S_Quote,
- # o3/o4/2o13 - Fixed Keys.trigger? method
- # - Added Keys.release? method
- # o1/o4/2o13 - Added More Keyboard Keys,
- # ^- :F1, :F2, :F3, :F4, :F5, :F6, :F7, :F8, :F9, :F10, :F11, :F12
- # ^- :N_0, :N_1, :N_2, :N_3, :N_4, :N_5, :N_6, :N_7, :N_8, :N_9,
- # ^- :ADD, :MUL, :SUB, :DIV, :DECI, :TAB, :BACK, :ENTER, :CAPS,
- # ^- :SPACE, :ESC, :ALT
- # 29/o3/2o13 - Added More Keyboard Keys,(Left/Right CTRL)
- # 28/o3/2o13 - Improved Customisation Layout,
- # - Removed Some Methods,
- # - Improved Keyboard Code,
- # 27/o3/2o13 - Added Keyboard Control,
- # 26/o3/2o13 - Compatibility, (Status Scene)
- # - Update, (Icons w/Hue)
- # 18/03/2013 - Compatibility, (Skill Scene)
- # 23/o2/2o13 - Started, Finished,
- #
- #===============================================================================
- # ☆ Introduction
- #-------------------------------------------------------------------------------
- # This script simply holds some information and methods used by some other
- # scripts in the $D13x system.
- # Current Features:
- # Fonts,
- # Color,
- # Vocab,
- # Keyboard Control,
- # Icons (w/Hue)...
- #
- # Place above all other $D13x Scripts.
- #
- #===============================================================================
- # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
- #===============================================================================
- # 1. You MUST give credit to "Dekita" !!
- # 2. You are NOT allowed to repost this script.(or modified versions)
- # 3. You are NOT allowed to convert this script.
- # 4. You are NOT allowed to use this script for Commercial games.
- # 5. ENJOY!
- #
- # "FINE PRINT"
- # By using this script you hereby agree to the above terms and conditions,
- # if any violation of the above terms occurs "legal action" may be taken.
- # Not understanding the above terms and conditions does NOT mean that
- # they do not apply to you.
- # If you wish to discuss the terms and conditions in further detail you can
- # contact me at http://dekitarpg.wordpress.com/ or DekitaRPG@gmail.com
- #
- #===============================================================================
- # ☆ Instructions
- #-------------------------------------------------------------------------------
- # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
- # Place Above ALL Other $D13x Scripts.
- #
- #===============================================================================
- # ☆ Notetags
- # For use with Weapons / Armors
- #-------------------------------------------------------------------------------
- # <tcol: red, grn, blu>
- # use this notetag to change the color of the items text shown in some of my
- # scenes.
- #
- #===============================================================================
- # ☆ HELP
- #-------------------------------------------------------------------------------
- # Heres a list of :key_symbols ( for use in scripts that require this one )
- # F KEYS
- # :F1, :F2, :F3, :F4, :F5, :F6, :F7, :F8, :F9, :F10, :F11, :F12
- # NUMBER KEYS
- # :_1, :_2, :_3, :_4, :_5, :_6, :_7, :_8, :_9, :_0
- # LETTERS
- # :A, :B, :C, :D, :E, :F, :G, :H, :I, :J, :K, :L, :M, :N,
- # :O, :P, :Q, :R, :S, :T, :U, :V, :W, :X, :Y, :Z
- # NUM PAD
- # :N_0, :N_1, :N_2, :N_3, :N_4, :N_5, :N_6, :N_7, :N_8, :N_9,
- # :ADD, :MUL, :SUB, :DIV, :DECI
- # ARROWS
- # :LEFT, :RIGHT, :UP, :DOWN
- # OTHER
- # :SHIFT, :LSHIFT, :RSHIFT, :TAB, :PAUSE, :CTRL, :L_CTRL, :R_CTRL,
- # :BACK, :ENTER, :CAPS, :SPACE, :ESC, :ALT
- # :S_Colon, :Equal, :Comma, :Minus, :Period, :F_Slash, :HASH, :L_Sqr_Brack
- # :B_Slash, :R_Sqr_Brack, :S_Quote,
- #
- # To Disable A Key, Make Symbol = :NONE,
- #
- #===============================================================================
- # ☆ For Scripters
- #-------------------------------------------------------------------------------
- # You can use any of the keys above in your own scripts, simply change the
- # default Input.press? / Input.trigger? / Input.repeat? methods with the
- # equivalent new method :
- # Keys.press?(KEY)
- # Keys.repeat?(KEY)
- # Keys.trigger?(KEY)
- # Keys.release?(KEY)
- # KEY should be either the keys 'virtual key code' or you can reference
- # the Keys module like so...
- # Keys.press?( Keys::Key[:SYMBOL] )
- # Keys.repeat?( Keys::Key[:SYMBOL] )
- # Keys.trigger?( Keys::Key[:SYMBOL] )
- # Keys.release?( Keys::Key[:SYMBOL] )
- #
- # Keys.press?
- # ^- will be triggered if the key is being pressed down
- # Keys.repeat?
- # ^- will be triggered if the key is in the "on" state (caps lock ect)
- # Keys.trigger?
- # ^- will be triggered when they key is first pressed
- # Keys.release?(KEY)
- # ^- will be triggered when they key is de-pressed (let go)
- #
- #===============================================================================
- module Text_Color
- #===============================================================================
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # ☆ Color Settings
- #-----------------------------------------------------------------------------
- # You can use these colors in any of my scripts that offer color customisation.
- # simply put Text_Color::THE_COLOR_YOU_WANT as the setting.
- # eg.
- # Text_Color::Pure_White
- #-----------------------------------------------------------------------------
- # White's
- Pure_White = Color.new(255,255,255)
- White = Color.new(222,222,222)
- Grey = Color.new(111,111,111)
- Black = Color.new(0 ,0 ,0 )
- #-----------------------------------------------------------------------------
- # Yellow's
- Yellow = Color.new(255,255,0)
- Gold = Color.new(212,212,64)
- Orange = Color.new(255,182,0)
- Deep_Orange = Color.new(212,64,0)
- Dirt_Orange = Color.new(182,64,0)
- Brown = Color.new(128,32,0)
- #-----------------------------------------------------------------------------
- # Red's
- Red = Color.new(251,111,111)
- Deep_Red = Color.new(222,60,60)
- Pure_Red = Color.new(255,0,0)
- Pink = Color.new(255,0,255)
- Dark_Pink = Color.new(182,0,156)
- #-----------------------------------------------------------------------------
- # Blue's
- Sky_Blue = Color.new(0,182,255)
- Light_Blue = Color.new(64,128,255)
- Dark_Blue = Color.new(32,64,255)
- Purple = Color.new(182,64,255)
- Magenta = Color.new(156,156,255)
- #-----------------------------------------------------------------------------
- # Green's
- Green = Color.new(111,251,111)
- Candy_Green = Color.new(0,255,0)
- Dirty_Green = Color.new(128,182,0)
- Khaki_Green = Color.new(111,156,64)
- Turquoise = Color.new(0,255,182)
- #-----------------------------------------------------------------------------
- # Sets the default equipment text color
- Default_Equip_Color = White
- end #===========================================================================
- module General
- #===============================================================================
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # ☆ General Settings
- #-----------------------------------------------------------------------------
- # these settings are usined for visual scripts of mine, such as status screen.
- Fonts = ["VL Gothic"]
- Font_Size = 18
- Font_Bold = false
- #-----------------------------------------------------------------------------
- # Gauges = [ Color 1 , Color 2 ]
- Hp_Colors = [ Text_Color::Dirt_Orange , Text_Color::Gold ]
- Mp_Colors = [ Text_Color::Dark_Blue , Text_Color::Sky_Blue ]
- Tp_Colors = [ Text_Color::Grey , Text_Color::Pure_Red ]
- Exp_Color = [ Text_Color::Deep_Red , Text_Color::Dark_Pink ]
- #-----------------------------------------------------------------------------
- # Show TP as a percentage ?
- # Only works in scripts i have written :p
- Show_Tp_As_Perc = false
- end #===========================================================================
- module Vocab
- #===============================================================================
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # ☆ Vocabulary Settings
- #-----------------------------------------------------------------------------
- # This is where you would adjust the common vocab used in some of my scripts.
- #-----------------------------------------------------------------------------
- # Parameters
- def self.param(param_id)
- case param_id
- when 0 then "Max HP" # "Health"
- when 1 then "Max MP" # "Will"
- when 2 then "Physical Attack" # "Attack"
- when 3 then "Physical Resist" # "Defence"
- when 4 then "Magical Attack" # "Magic"
- when 5 then "Magical Resist" # "Aura"
- when 6 then "Agility" # "Speed"
- when 7 then "Luck" # "Luck"
- end
- end
- #-----------------------------------------------------------------------------
- # Tp vocab
- Tp = "Rage"
- #-----------------------------------------------------------------------------
- # X - Parameters
- def self.x_param(x_param_id)
- case x_param_id
- when 0 then "Accuracy"
- when 1 then "Evasion"
- when 2 then "Critical"
- when 3 then "Crit Eva"
- when 4 then "Mag Eva"
- when 5 then "Mag Ref"
- when 6 then "Counter"
- when 7 then "HP Regen"
- when 8 then "MP Regen"
- when 9 then "TP Regen"
- end
- end
- #-----------------------------------------------------------------------------
- # S - Parameters
- def self.s_param(s_param_id)
- case s_param_id
- when 0 then "Aggro"
- when 1 then "Guard"
- when 2 then "Recovery"
- when 3 then "Medicine"#Pharmacology
- when 4 then "MP Cost"
- when 5 then "TP Charge"
- when 6 then "P DMG Taken"
- when 7 then "M DMG Taken"
- when 8 then "Floor DMG"
- when 9 then "Exp Rate"
- end
- end
- #-----------------------------------------------------------------------------
- # Specials
- def self.specials(id)
- case id
- when 0 then "Auto-Fight"
- when 1 then "Guard"
- when 2 then "Substitue"
- when 3 then "Preserve TP"
- end
- end
- #-----------------------------------------------------------------------------
- # Collapse Type
- def self.collapse_type(id)
- case id
- when 0 then "Boss"
- when 1 then "Instant"
- when 2 then "No Vanish"
- end
- end
- #-----------------------------------------------------------------------------
- # Party Ability
- def self.party_ability(id)
- case id
- when 0 then "Encounter ½"
- when 1 then "Encounter NA"
- when 2 then "No Surprise"
- when 3 then "Pre-Emptive +"
- when 4 then "Gold Double"
- when 5 then "Double Drops"
- end
- end
- #-----------------------------------------------------------------------------
- # Various Statistics
- Attack_Speed = "Atk Speed"
- Attack_Times = "Atks Per Turn" # "APT"
- Skill_Type = "Skillset"
- Skill = "Skills"
- Equip_Type = "Equipable"
- Action_Times = "Action Time"
- Fixed = "Fixed "
- Sealed = "Sealed "
- Slot_Type = "Slot Type"
- Dual_Slot = "Dual Wield"
- One__Slot = "Single"
- #####################
- # CUSTOMISATION END #
- end #####################
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- # #
- # http://dekitarpg.wordpress.com/ #
- # #
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- # The following code is protected under the 2013 Dekita Data Protection Act. #
- # Ie. The “Do Not Fucking Look” Law. #
- # Breaking This One And Only Rule May Result In The Following Side Effects : #
- # Eyes Bleeding, Nightmares, Severe Head Ache's AND A Scratch On Your Knee :p #
- # That is all ! #
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- class Object
- #===============================================================================
- #-------------------------------------------------------------------------
- # rand_between
- #-------------------------------------------------------------------------
- def rand_between(min, max)
- min + rand(max - min + 1)
- end
- end
- #===============================================================================
- class Numeric
- #===============================================================================
- #---------------------------------------------------------------------------
- # To Float (with limited digits after decimal point)
- #---------------------------------------------------------------------------
- def to_flim(limit = 5, saftey = "0")
- str = self.to_f.to_s + saftey
- new_str = ""
- limit.times do |i|
- break if new_str =~ /[0-9].[0-9][0-9]/
- break if str[i] == nil
- new_str += str[i]
- end
- return new_str
- end
- #---------------------------------------------------------------------------
- # To A Percentage Of (num)
- #---------------------------------------------------------------------------
- def perc_of(num)
- self.to_f / num.to_f * 100.0
- end
- #---------------------------------------------------------------------------
- # Even ?
- #---------------------------------------------------------------------------
- def even?
- e = self.to_s
- e[e.size] == ("0"||"2"||"4"||"6"||"8")
- end
- #---------------------------------------------------------------------------
- # 0dd?
- #---------------------------------------------------------------------------
- def odd?
- o = self.to_s
- o[o.size] == ("1"||"3"||"5"||"7"||"9")
- end
- end
- #===============================================================================
- module Keys
- #===============================================================================
- #---------------------------------------------------------------------------
- # Win32API Information
- #---------------------------------------------------------------------------
- def self.w ; Win32API ; end
- def self.u ; "user32" ; end
- def self.i ; "i" ; end
- def self.gk ; "GetKeyState" ; end
- def self.ga ; "GetAsyncKeyState" ; end
- #---------------------------------------------------------------------------
- # Key Settings
- #---------------------------------------------------------------------------
- Key={
- # Func's
- :F1 => 0x70,:F2 => 0x71,:F3 => 0x72,:F4 => 0x73,:F5 => 0x74,:F6 => 0x75,
- :F7 => 0x76,:F8 => 0x77,:F9 => 0x78,:F10 => 0x7a,:F11 => 0x7b,:F12 => 0x7c,
- # Numbers
- :_0 => 0x30,:_1 => 0x31,:_2 => 0x32,:_3 => 0x33,:_4 => 0x34,
- :_5 => 0x35,:_6 => 0x36,:_7 => 0x37,:_8 => 0x38,:_9 => 0x39,
- # Letters
- :A => 0x41,:B => 0x42,:C => 0x43,:D => 0x44,:E => 0x45,:F => 0x46,:G => 0x47,
- :H => 0x48,:I => 0x49,:J => 0x4A,:K => 0x4B,:L => 0x4C,:M => 0x4D,:N => 0x4E,
- :O => 0x4F,:P => 0x50,:Q => 0x51,:R => 0x52,:S => 0x53,:T => 0x54,:U => 0x55,
- :V => 0x56,:W => 0x57,:X => 0x58,:Y => 0x59,:Z => 0x5A,
- # NumPad
- :N_0 => 0x60, :N_1 => 0x61, :N_2 => 0x62, :N_3 => 0x63, :N_4 => 0x64,
- :N_5 => 0x65, :N_6 => 0x66, :N_7 => 0x67, :N_8 => 0x68, :N_9 => 0x69,
- :ADD => 0x6b, :MUL => 0x6a, :SUB => 0x6d, :DIV => 0x6f, :DECI => 0x6e,
- # Arrows
- :LEFT => 0x25, :RIGHT => 0x27, :UP => 0x26, :DOWN => 0x28,
- # Symbols
- :S_Colon => 0xBA, :Equal => 0xBB, :Comma => 0xBC, :Minus => 0xBD,
- :Period => 0xBE, :F_Slash => 0xBF, :HASH => 0xDE, :L_Sqr_Brack => 0xDB,
- :B_Slash => 0xDC, :R_Sqr_Brack => 0xDD, :S_Quote => 0xC0,
- # Other
- :SHIFT => 0x10, :LSHIFT => 0xa0, :RSHIFT => 0xa1, :TAB => 0x09,
- :PAUSE => 0x13, :L_CTRL => 0xa2, :R_CTRL => 0xa3, :CTRL => 0x11,
- :BACK => 0x08, :ENTER => 0x0D, :CAPS => 0x14, :SPACE => 0x20,
- :ESC => 0x1B, :ALT => 0x12, :PrtSc => 0x2c,
- } # << End Key {}
- #---------------------------------------------------------------------------
- # Constants
- #---------------------------------------------------------------------------
- KS = w.new(u,gk,[i],i)
- AK = w.new(u,ga,[i],i)
- #---------------------------------------------------------------------------
- # Variables
- #---------------------------------------------------------------------------
- @trigger = Array.new(256) { false }
- @presses = Array.new(256) { false }
- @release = Array.new(256) { false }
- @repeats = Array.new(256) { false }
- #---------------------------------------------------------------------------
- # Update All Key's State's
- #---------------------------------------------------------------------------
- def self.update
- @trigger = Array.new(256) { false }
- @release = Array.new(256) { false }
- Key.each do |key|
- akey = AK.call(key[1])
- ktri = KS.call(key[1])
- @trigger[ key[1] ] = true if ((!@presses[key[1]]) && (akey != 0))
- @release[ key[1] ] = true if (( @presses[key[1]]) && (akey == 0))
- @presses[ key[1] ] = (akey != 0) ? true : false
- @repeats[ key[1] ] = (ktri == 1) ? true : false
- end
- end
- #---------------------------------------------------------------------------
- # Key Got Triggered? [ inital key press ]
- #---------------------------------------------------------------------------
- def self.trigger?(key)
- return if key.nil?
- return @trigger[key]
- end
- #---------------------------------------------------------------------------
- # Key Got Released? [ inital key depress ]
- #---------------------------------------------------------------------------
- def self.release?(key)
- return if key.nil?
- return @release[key]
- end
- #---------------------------------------------------------------------------
- # Key Being Pressed Currently ?
- #---------------------------------------------------------------------------
- def self.press?(key)
- return if key.nil?
- return @presses[key]
- end
- #---------------------------------------------------------------------------
- # Key Turned On? [Caps Lock, Num Lock, ect..]
- #---------------------------------------------------------------------------
- def self.repeat?(key)
- return if key.nil?
- return @repeats[key]
- end
- end
- #===============================================================================
- module Input
- #===============================================================================
- #---------------------------------------------------------------------------
- # Alias List
- #---------------------------------------------------------------------------
- class << self
- alias :update_sD13x_Keys :update
- end
- #---------------------------------------------------------------------------
- # Update $D13x Keys
- #---------------------------------------------------------------------------
- def self.update(*args)
- update_sD13x_Keys(*args)
- Keys.update
- end
- end
- #===============================================================================
- module Cache
- #===============================================================================
- #--------------------------------------------------------------------------
- # * Get System Graphic
- #--------------------------------------------------------------------------
- def self.icon(filename = "IconSet", hue = 0)
- load_bitmap("Graphics/System/", filename, hue)
- end
- end
- #===============================================================================
- module DataManager
- #===============================================================================
- #---------------------------------------------------------------------------
- # Alias List
- #---------------------------------------------------------------------------
- class << self
- alias :lbd_unique_shits :load_database
- end
- #---------------------------------------------------------------------------
- # Load Database (alias)
- #---------------------------------------------------------------------------
- def self.load_database
- lbd_unique_shits
- loa_unique_shits
- end
- #---------------------------------------------------------------------------
- # Load Unique Shit
- #---------------------------------------------------------------------------
- def self.loa_unique_shits
- classes = [$data_weapons, $data_armors , $data_items , $data_skills ,
- $data_actors , $data_classes, $data_enemies, $data_states ]
- for g in classes
- for o in g
- next if o == nil
- o.load_unique_shit
- end
- end
- end
- end # << DataManager
- #===============================================================================
- class RPG::BaseItem
- #===============================================================================
- #--------------------------------------------------------------------------
- # Pi Variables
- #--------------------------------------------------------------------------
- attr_accessor :item_disp_color
- attr_accessor :database_id
- #--------------------------------------------------------------------------
- # Loads Unique Shit
- #--------------------------------------------------------------------------
- def load_unique_shit
- @database_id = @id
- load_item_color
- # << For use in Child Classes
- end
- #---------------------------------------------------------------------------
- # Load Item Text Color
- #---------------------------------------------------------------------------
- def load_item_color
- @item_disp_color = Text_Color::Default_Equip_Color
- if self.note.match(/<tcol:(.*),(.*),(.*)>/i)
- @item_disp_color = Color.new($1.to_i,$2.to_i,$3.to_i)
- end
- end
- #--------------------------------------------------------------------------
- # Returns features for item filtered by code (credits Tsukihime)
- #--------------------------------------------------------------------------
- def feature_val(code)
- self.features.select {|ft| ft.code == code}
- end
- #--------------------------------------------------------------------------
- # Returns features for item filtered by code and data ID (credits Tsukihime)
- #--------------------------------------------------------------------------
- def feature_val_with_id(code, data_id)
- self.features.select {|ft| ft.code == code && ft.data_id == data_id}
- end
- #--------------------------------------------------------------------------
- # Returns sum of all features for item, by code and data ID (credits Tsukihime)
- #--------------------------------------------------------------------------
- def features_sum(code, data_id)
- feature_val_with_id(code, data_id).inject(0.0) {|r, ft| r += ft.value }
- end
- #--------------------------------------------------------------------------
- # Returns features pi
- #--------------------------------------------------------------------------
- def features_pi(code, data_id)
- feature_val_with_id(code, data_id).inject(1.0) {|r, ft| r *= ft.value }
- end
- #--------------------------------------------------------------------------
- # Calculate Set Sum of Features
- #--------------------------------------------------------------------------
- def features_set(code)
- feature_val(code).inject([]) {|r, ft| r |= [ft.data_id] }
- end
- end
- #==============================================================================
- class Game_Party < Game_Unit
- #==============================================================================
- #-----------------------------------------------------------------------------
- # Get Battle Members
- #-----------------------------------------------------------------------------
- def alive_battle_members
- all_members[0, max_battle_members].select {|a| a.exist? && a.hp > 0 }
- end
- end
- #==============================================================================
- class Window_Base < Window
- #==============================================================================
- #--------------------------------------------------------------------------
- # Draw Gauge (w/height)
- #--------------------------------------------------------------------------
- def draw_deki_gauge(gx, gy, gw, gh, rate, color1, color2)
- empty_gauge_color = Color.new(0,0,0,128)
- fill_w = [(gw * rate).to_i, gw].min
- gauge_h = gh
- gauge_y = gy + line_height - 2 - gauge_h
- contents.fill_rect(gx, gauge_y, gw, gauge_h, empty_gauge_color)
- contents.gradient_fill_rect(gx, gauge_y, fill_w, gauge_h, color1, color2)
- end
- #--------------------------------------------------------------------------
- # Draw Hp
- #--------------------------------------------------------------------------
- def draw_de_hp(x, y, wid = nil)
- wid = self.width/2 - (standard_padding*2) if wid == nil
- rate = @actor.hp_rate
- color1 = General::Hp_Colors[0]
- color2 = General::Hp_Colors[1]
- draw_deki_gauge(x, y, wid-x-2, 2, rate, color1, color2)
- draw_text(x+4, y, wid, line_height, Vocab::param(0))
- draw_text(x, y, wid-x-6, line_height, "#{@actor.hp}/#{@actor.mhp}",2)
- end
- #--------------------------------------------------------------------------
- # Draw Mp
- #--------------------------------------------------------------------------
- def draw_de_mp(x, y, wid = nil)
- wid = self.width/2 - (standard_padding*2) if wid == nil
- rate = @actor.mp_rate
- color1 = General::Mp_Colors[0]
- color2 = General::Mp_Colors[1]
- draw_deki_gauge(x, y, wid-x-2, 2, rate, color1, color2)
- draw_text(x+4, y, wid, line_height, Vocab::param(1))
- draw_text(x, y, wid-x-6, line_height, "#{@actor.mp}/#{@actor.mmp}",2)
- end
- #--------------------------------------------------------------------------
- # Draw Tp
- #--------------------------------------------------------------------------
- def draw_de_tp(x, y, wid = nil)
- wid = self.width/2 - (standard_padding*2) if wid == nil
- rate = @actor.tp.to_i.to_f / @actor.max_tp.to_i
- color1 = General::Tp_Colors[0]
- color2 = General::Tp_Colors[1]
- draw_deki_gauge(x, y, wid-x-2, 2, rate, color1, color2)
- draw_text(x+4, y, wid, line_height, Vocab::Tp)
- text = "#{(@actor.tp).to_i}/#{@actor.max_tp.to_i}"
- text = "#{(@actor.tp.perc_of(@actor.max_tp)).to_flim}%" if General::Show_Tp_As_Perc
- draw_text(x, y, wid-x-6, line_height, text,2)
- end
- #--------------------------------------------------------------------------
- # Draw Exp (w/gauge)
- #--------------------------------------------------------------------------
- def draw_de_xp(x, y, gauge = true)
- s1 = @actor.current_level_exp
- s2 = @actor.next_level_exp
- s1_g = @actor.exp - @actor.current_level_exp
- s2_g = @actor.next_level_exp - @actor.current_level_exp
- wid = self.width/2 - (standard_padding*2)
- wid_b = self.width/2 - (standard_padding)
- rate = (s1_g).to_f / (s2_g)
- color1 = General::Exp_Color[0]
- color2 = General::Exp_Color[1]
- draw_deki_gauge(wid_b, y, wid-x-2, 2, rate, color1, color2) if gauge
- draw_text(wid_b+4, y, wid, line_height, "Exp:")
- draw_text(wid_b, y, wid-x-2, line_height, "#{@actor.exp}/#{s2}",2)
- end
- #--------------------------------------------------------------------------
- # Draw Icon (w/Hue)
- #--------------------------------------------------------------------------
- def draw_de_icon(icon_index, x, y, hue = 0, enabled = true)
- bitmap = Cache.icon("IconSet",hue)
- rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
- contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
- end
- end
- #==============================================================================
- class Deki_Help < Window_Base
- #==============================================================================
- #--------------------------------------------------------------------------
- # Object Initialization
- #--------------------------------------------------------------------------
- def initialize(line_number = 2)
- super(0, 0, Graphics.width/4*3, fitting_height(line_number))
- @item = nil
- end
- #--------------------------------------------------------------------------
- # Set Text
- #--------------------------------------------------------------------------
- def set_text(text)
- if text != @text
- @text = text
- refresh
- end
- end
- #--------------------------------------------------------------------------
- # Clear
- #--------------------------------------------------------------------------
- def clear
- set_text("")
- end
- #--------------------------------------------------------------------------
- # Set Item , item : Skills and items etc.
- #--------------------------------------------------------------------------
- def set_item(item)
- return if @item == item
- @item = item
- refresh
- set_text(item ? item.description : "")
- end
- #--------------------------------------------------------------------------
- # Refresh
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- draw_text_ex(4, 0, @text)
- end
- #--------------------------------------------------------------------------
- # Reset Font Settings
- #--------------------------------------------------------------------------
- def reset_font_settings
- change_color(normal_color)
- self.contents.font.name = General::Fonts
- self.contents.font.size = General::Font_Size
- self.contents.font.bold = General::Font_Bold
- end
- end
- #==============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #==============================================================================#
- end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement