Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # ☆ $D13x - CORE
- # -- Author : Dekita
- # -- Version : 1.2
- # -- Level : Easy
- # -- Requires : N/A
- # -- Engine : RPG Maker VX Ace.
- #
- #===============================================================================
- # ☆ Import
- #-------------------------------------------------------------------------------
- $D13x={}if$D13x==nil
- $D13x[:CORE] = true
- #===============================================================================
- # ☆ Updates
- #-------------------------------------------------------------------------------
- # D /M /Y
- # 26/o3/2o13 - Compatibility, (Status Scene)
- # 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, things like fonts, color, vocab..
- #
- # 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
- #-------------------------------------------------------------------------------
- # <tcol: red, grn, blu>
- # use this notetag to change the color of the text shown in some of my
- # scenes.
- #
- #===============================================================================
- module Text_Color
- #===============================================================================
- # White's
- Pure_White = Color.new(255,255,255)
- White = Color.new(222,222,222)
- Grey = Color.new(111,111,111)
- # 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)
- 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)
- Default_Equip_Color = White
- end
- #==============================================================================
- module General
- #==============================================================================
- Fonts = ["VL Gothic"]
- Font_Size = 18
- Font_Bold = false
- # Gauge = [ Color 1 , Color 2 ]
- Hp_Colors = [ Text_Color::Dirt_Orange , Text_Color::Gold ]
- Mp_Colors = [ Text_Color::Dark_Blue , Text_Color::Sky_Blue ]
- Exp_Color = [ Text_Color::White , Text_Color::Deep_Red ]
- end
- #==============================================================================
- module Vocab
- #==============================================================================
- # Parameters ( overwrite )
- 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
- # X - Parameters ( new )
- 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 ( new )
- 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
- Attack_Speed = "Atk Speed"
- Attack_Times = "Atks Per Turn"#"APT"
- Skill_Type = "Skillset"
- Skill = "Skills"
- Equip_Type = "Equipable"
- Action_Times = "Action Time"
- # Specials ( new )
- 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 ( new )
- def self.collapse_type(id)
- case id
- when 0 then "Boss"
- when 1 then "Instant"
- when 2 then "No Vanish"
- end
- end
- # Party Ability ( new )
- 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
- Fixed = "Fixed "
- Sealed = "Sealed "
- Slot_Type = "Slot Type"
- Dual_Slot = "Dual Wield"
- One__Slot = "Single"
- # Vocab for Statistic Control Script
- LevelDown = "%s has fell back to %s %s!"
- ForgetSkill = "%s's requirements are no longer met!"
- #####################
- # 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 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
- #--------------------------------------------------------------------------
- # Loads Unique Shit
- #--------------------------------------------------------------------------
- def load_unique_shit
- 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 # << RPG::BaseItem
- #==============================================================================
- 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 = self.width/2 - (standard_padding*2)
- rate = @actor.hp_rate
- color1 = General::Hp_Colors[0]
- color2 = General::Hp_Colors[1]
- draw_text(x, y, wid, line_height, Vocab::param(0))
- draw_text(x, y, wid-x-2, line_height, "#{@actor.hp}/#{@actor.mhp}",2)
- draw_deki_gauge(x, y, wid-x-2, 3, rate, color1, color2)
- end
- #--------------------------------------------------------------------------
- # Draw Mp
- #--------------------------------------------------------------------------
- def draw_de_mp(x, y)
- wid = self.width/2 - (standard_padding*2)
- rate = @actor.mp_rate
- color1 = General::Mp_Colors[0]
- color2 = General::Mp_Colors[1]
- draw_text(x, y, wid, line_height, Vocab::param(1))
- draw_text(x, y, wid-x-2, line_height, "#{@actor.mp}/#{@actor.mmp}",2)
- draw_deki_gauge(x, y, wid-x-2, 3, rate, color1, color2)
- 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_text(wid_b, y, wid, line_height, "Exp:")
- draw_text(wid_b, y, wid-x-2, line_height, "#{s1}/#{s2}",2)
- draw_deki_gauge(wid_b, y, wid-x-2, 3, rate, color1, color2) if gauge
- 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/ #
- #==============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement