if true # << Make true to use this script, false to disable. #=============================================================================== # # ☆ $D13x - Insane Stat Point Distribution System # -- Author : Dekita # -- Version : 1.2 # -- Level : Hard / Insane # -- Requires : $D13x Core v2.0+ # : You, To Read ALL Instructions CAREFULLY !! # -- Engine : RPG Maker VX Ace. # #=============================================================================== # ☆ Import #------------------------------------------------------------------------------- $D13x={}if$D13x==nil $D13x[:ISPDS] = true #=============================================================================== # ☆ Updates #------------------------------------------------------------------------------- # D /M /Y # 18/06/2o13 - Bugfixx, (Enemy HP/MP Increase) # 31/o5/2o13 - Added More Help Info For Script Calls, # - Added .reset_some_points(STAT_ID, VALUE) Script Call, # 29/o5/2o13 - Finished Script, (v1.0) # - Slight Reposition of HP/MP/TP/EXP Gauges, # - Added Menu Customisation, # 28/o5/2o13 - Bugfix, (Changing Class Not Re-Calculating Stat Values) # - Compatibility, (WindowSkins && Scene BGs) # - Added IBox Window, # 22/o5/2o13 - Added Max Limit For Each Stat, # - Improved Windows Display, # - Compatibility, (TP Control) # 21/o5/2o13 - Finished Advanced Features, # - Compatibility, (Atk/Def Lv) # 19/o5/2o13 - Beta Phase Begin, (v0.9) # - Finished Script Base, # 1o/o4/2o13 - Started, # #=============================================================================== # ☆ Instructions !! #------------------------------------------------------------------------------- # Place Below >> # " ▼ Materials " # " $D13x Statistic Control " # " $D13x Elements Control " # " $D13x Max TP Control " # " $D13x Atk | Def Lvls " # Place Above >> # " ▼ Main " # " $D13x Equipment Sets " # " $D13x Learn Skill Reqs " # " $D13x Equip Reqs " # # Placing these script in this order will prevent bugs / faults / FPS drop. # # This script will NOT work without at least 1 of the following scripts... # $D13x - Statistic Control v1.5+ - Enables Param/s-Param/x-Param's Distribution # $D13x - Elements Control v1.0+ - Enables Atk/Def Elements Distribution # $D13x - Max TP Control v1.0+ - Enables Max TP Distribution. # $D13x - Atk | Def Levels v1.0+ - Enables Atk/Def Level Distribution # You can use all of the above scripts in conjunction with each other # # Please Note : This list could be updated at any time !! # #=============================================================================== # ☆ Introduction #------------------------------------------------------------------------------- # I have a dream... # I dream of a game where my characters growth is in my control... # A game where my choices mean everything... # Where a slight mistake can mean the end of all life... # I dream of a game that i can design my own character, while playing... # A game that i can customize my character to suit my playing style... # That not only allows creativity, but rewards it... # I dream... # Of a game... # Made by this script... # # This script allows the creation of MULTIPLE HIGHLY UNIQUE && DYNAMIC # Stat Distribution Systems... # It not only provides you with new "parent" stats, that control ANY other # statistics, it actually allows you to then distribute them !! # # EASILY set up a basic distribution system. # ELEMENT DISTRIBUTION SYSTEM ? Look No Further !! # Distribute Maximum TP with ease.. # Set up your very own unique distribution system with no scripting knowledge !! # ( Requires ability to read instructions ) # #=============================================================================== # ☆ Features #------------------------------------------------------------------------------- # - UNLIMITED New Parent Stats that give you control over ALL other stats. # - Multiple ways to modify ALL of your newly created stats. # - Use your new stats in SKILL FORMULA's and CONDITIONAL BRANCHES. # - HIGHLY Informative Distribution Screen (Fully Customisable). # - Multiple Growth Set-ups (each actor can grow differently). # ^- Each Growth Set-up can have a completetly unique setup # Than an other, things like name, cost, stat changes... # - Highly Complex && Unique Stat Handling System (FULLY LAG FREE) # - Easily Distribute All Statistics (listed below) # ^- Params << Requires $D13x Statistic Control. # ^- x-Params << Requires $D13x Statistic Control. # ^- s-Params << Requires $D13x Statistic Control. # ^- Attack Elements << Requires $D13x Elements Control. # ^- Defence Elements << Requires $D13x Elements Control. # ^- Atk | Def Levels << Requires $D13x Atk | Def Level. # ^- Max TP Limit << Requires $D13x Max TP Control. # - Spend DP (distribution points), Gold and even Exp to gain stats. # - A Smile On Your Face ( Money Back Guarantee !! ) # # And If That Was'nt Enough... # you can pair this script with multiple scripts from the $D13x Engine... # # - Skill Levels # ^- Give a parent stat to a skill and the value will increase # using the skill levels DMG Multi. # # - Dev Stat Lv Up Distribution # ^- ability to distribute your new parent stats via level up # (could be used for actors who cannot access distribution screen) # # - Equipment Sets # ^- Control new parent stats as a set bonus for an equipment set. # # - Learn Skill Requirements # ^- Use new parent stats as skill learning requirements. # # - Equipment Requirements # ^- Use new parent stats as requirements for equipping equipment. # # NOTE: # If using Exp to increase statistics, you are only able to use the actors # "spare exp", spare exp is the exp you have gained above the required # exp for your current level, but is still below the required exp for next level. # This means that your actor cannot decrease their level distributing stats. # #=============================================================================== # ★☆★☆★☆★☆★☆★☆★☆★ 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/ # #=============================================================================== # ☆ Script Calls #------------------------------------------------------------------------------- # $game_actors[ACTOR_ID].add_spds_stats(STAT_ID, VALUE) # $game_actors[ACTOR_ID].sub_spds_stats(STAT_ID, VALUE) # $game_actors[ACTOR_ID].div_spds_stats(STAT_ID, VALUE) # $game_actors[ACTOR_ID].mul_spds_stats(STAT_ID, VALUE) # $game_actors[ACTOR_ID].mod_spds_stats(STAT_ID, VALUE) # ^- Script calls to change parent stat values # # There is also a third arguement for all the above script calls, # it is a boolean arguement to determine if the player should be refreshed. # eg.. $game_actors[1].add_spds_stats(0, 5, false) # this is very helpfull for maintaining FPS when adding LOTS of stats.. # The default to this arguemet is true. # If you don't understand what this mean, just disregard this information :) # #------------------------------------------------------------------------------- # $game_actors[ACTOR_ID].parent_stat(STAT_ID) # ^- Script call to check the value of a parent stat. # #------------------------------------------------------------------------------- # $game_actors[ACTOR_ID].get_total_spds_stats # ^- Script call to check the total value of all parent stats. # #------------------------------------------------------------------------------- # $game_actors[ACTOR_ID].gain_points(VALUE) # $game_actors[ACTOR_ID].reduce_points(VALUE) # ^- Script calls to change available distribution points # #------------------------------------------------------------------------------- # $game_actors[ACTOR_ID].points # ^- Script call to check the value of available distribution points. # #------------------------------------------------------------------------------- # $game_actors[ACTOR_ID].reset_all_points(false) # $game_actors[ACTOR_ID].reset_all_points(true) # $game_actors[ACTOR_ID].reset_all_points # ^- Script calls to reset all used distribution points, # if arguement is false points will not be returned. # if true then all spent points will be returned. # Default arguement is true. # NOTE: Does Not Support Gold && Exp Cost Formulas. # #------------------------------------------------------------------------------- # $game_actors[ACTOR_ID].reset_some_points(STAT_ID, VALUE) # ^- Same as above but only reduces points from STAT_ID by VALUE and then # returns the spent points. # NOTE: Does Not Support Gold && Exp Cost Formulas. # #------------------------------------------------------------------------------- # $game_actors[ACTOR_ID].change_spds_set_id_to(STAT_SET_ID) # ^- Script call to change Distribution Set ID # #------------------------------------------------------------------------------- # ACTOR_ID = The database id for the actor # STAT_ID = The id of the parent stat you wish to increase # VALUE = The value to change this stat # STAT_SET_ID = The id of the distribution stat set to change to. # #=============================================================================== # ☆ Notetags ( default ) #------------------------------------------------------------------------------- # # Replace X with the SPDS::Stat_Set id for that actor / class / enemy # #------------------------------------------------------------------------------- # # Replace X with the value for an actors initial available distribution points. # Alternativley, give this notetag to enemies and X distribution points # will be evenly devided between each alive battle member :) # #------------------------------------------------------------------------------- # # Give this notetag to actors who should not be taken to distribution screen # on level up.. eg, actor's that the player has no control over... # Temporary party members and the like.. # #------------------------------------------------------------------------------- # # Use this notetag to increase parent stats. # give to actors, classes, enemies, equipment, skills, states... # STAT_ID = The id of the parent stat you wish to increase # VALUE = The value to change this stat # #------------------------------------------------------------------------------- # # Use this notetag to increase ALL parent stats by VALUE. # give to actors, classes, enemies, equipment, skills, states... # #------------------------------------------------------------------------------- # # give to actors, classes, enemies, equipment, skills, states... # STAT_ID = The id of the parent stat whose max value you wish to increase # VALUE = The value to change the maximum value this stat can reach # #=============================================================================== # ☆ VERY Helpfull Info #------------------------------------------------------------------------------- # Q - What is the basis for a distribution system ? # A - The ability to add / remove statistics. # Although when you increase a stat, lets say Vitality (for example) # it may "increase" hp (along with other stats) but it DOES NOT actually # increase the HP parameter... # You may be thinking "Of course it does !!". # And you would be right... In most cases... # This script IS NOT most cases... # Instead of adding a PERMANENT stat, like most distribution systems, # this script instead adds 1 to a counter, ie a parent stat. # It then calculates how much each stat (params ect..) should increase # for each counter. # eg. if the counter (parent stat) was 5 and that parent # stat is set to increase hp by 10, the actor would get 50 (10 * 5) # TEMPORARILTY added to the stat. # This calculation gets done so frequently it has no effect on miscalulations. # # This method also provides MANY benefits compared to "Less Qualified" # Distribution systems... # # By Calculating stats this way it allows for more dynamic distribution. # For Example... # Actor 1 has 50 vit (parent stat 0) # Actor 1 is Class 1 # Class 1 Has 1 base MHP # Class 1 Has Stat_Set id 0 # Stat_Set id 0's vit modifies MHP by 10 # Actor 1's MHP Becomes 501 (1 + (50 * 10)) # Actor 1 Changes to Class 2 # Class 2 Has 1 base MHP # Class 2 Has SPDS::Stat_Set id 1 # Stat_Set id 1's vit modifies MHP by 5 # Actor 1's MHP Becomes 251 (1 + (50 * 5)) # # Another Advantage is that if you give equips/skills/states # parent stats, their stats will change accordingly based against # the actor/enemies' parent stat values, this of course means that... # if Actor 1 & 2 both have THE SAME equip but DIFFERENT Stat_Set's # Then the equip item will recognize that and only modify the params # based on the actors Stat_Set. # #=============================================================================== # ☆ Statistic Help #------------------------------------------------------------------------------- # PARAMS : # XPARAMS : # SPARAMS : # # stat = id # stat = id # stat = id # # mhp = 0 # hit = 0 # tgr = 0 # # mmp = 1 # eva = 1 # grd = 1 # # atk = 2 # cri = 2 # rec = 2 # # def = 3 # cev = 3 # pha = 3 # # mat = 4 # mev = 4 # mcr = 4 # # mdf = 5 # mrf = 5 # tcr = 5 # # agi = 6 # cnt = 6 # pdr = 6 # # luk = 7 # hrg = 7 # mdr = 7 # # # mrg = 8 # fdr = 8 # # # trg = 9 # exr = 9 # #------------------------------------------------------------------------------- # Remember : # All Params work with integer values, eg. 1, 5, 123, 653, 198123 # Atk | Def Levels && Max TP also work with integer values. # All x/s-Params work with float values, eg. 1.0, 0.5, 0.1, 0.05, 0.01 # 1.0 = 100%, 0.01 = 1%, # Atk | Def Elements also work using percentage values (floats). # #=============================================================================== module SPDS #=============================================================================== Stat_Set={} # << Keep #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # ☆ General Settings #----------------------------------------------------------------------------- # Format = [:cmnd , 'Name'], Main_Commands =[ [:spend, 'Distribute'], [:exit, 'Leave'], ] #----------------------------------------------------------------------------- # Max Amount Of Parent Stats Allowed, # Parent Stat id begin at 0, if the max was 4 their id's would be # 0, 1, 2 & 3 << always remember this. # If you try to access a parent stat that is higher than the max stat # you will get error messages ! Max_Parent_Stats = 8 #----------------------------------------------------------------------------- # Number of visible distribution commands shown in distribution selection # window. Visible_Distribution_Commands = 9 #----------------------------------------------------------------------------- # Finish Command Vocab, Format = ["Command Name", "Help Text"] Finish_Data = ['Finish', "Return To Command Window."] #----------------------------------------------------------------------------- # Allow Finish Command To Be Visible ? (distribution command window) Allow_Finish = true #----------------------------------------------------------------------------- # Vocab Used For Changes Header. Changes_Vocab = "Changes:" #----------------------------------------------------------------------------- # Vocab Used When No Future Change Will Happen (shown in Changes Window) No_Change_Vocab = "-" #----------------------------------------------------------------------------- # Distribution Points Vocab DP_Vocab = ["DP: ", "Distribution Points"] #----------------------------------------------------------------------------- # Max Distribution Points Max_Points = 999 #----------------------------------------------------------------------------- # Vocab for when distribution points are gained from an enemy. # NOTE: points gained will be divided between ALIVE BATTLE MEMBERS !! Gain_Pts_Vocab = "%s Has Gained %s %s." #----------------------------------------------------------------------------- # Here is where you change the menu settings for the distribution scene, # the format = [Visible?, "VOCAB", Switch] # make visible true to add a new distribute command to the main menu, # change the vocab to suit your needs. # Switch is the id of the switch to disable/enable the menu command # leave 0 to always enable command. Menu_Info = [true, "Distribute", 0] #----------------------------------------------------------------------------- # Show distribution screen automatically when actor levels ? Show_Screen = false #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # ☆ Page Settings #----------------------------------------------------------------------------- # This is where you adjust what information is shown on each page # the options are : # [:header, "FOR DISPLAYING TEXT LIKE THIS" , icon, hue], # [:param, param_id, Text_Color, icon, hue], # [:x_param, xparam_id, Text_Color, icon, hue], # [:s_param, sparam_id, Text_Color, icon, hue], # [:atk_ele, element_id, Text_Color, icon, hue], # [:def_ele, element_id, Text_Color, icon, hue], # [:atk_lev, not used, Text_Color, icon, hue], # [:def_lev, not used, Text_Color, icon, hue], # [:tp_info, not used, Text_Color, icon, hue], # NOTE : # If icon is 0 the text will be positioned where the icon would have been. # Use Left + Right to switch pages #----------------------------------------------------------------------------- # Values have same coloring as main text ? Values_Colored = true #----------------------------------------------------------------------------- # Show Icons ? Use_Icons = true #----------------------------------------------------------------------------- # Page Turn Audio Settings , Format = ["Sound\\File\\Name", Volume, Pitch] Page_Turn_Noise = ["Audio\\SE\\Book1", 80, "80+rand(50)"] #----------------------------------------------------------------------------- # Begin Info Hash. See Above for Detailed Instructions.. Info={ :page_1=>[ [:header, "Parameter Info :", Text_Color::White,0,0], [:param, 0, Text_Color::White, 10, 200], [:param, 1, Text_Color::White, 10, 0], [:tp_info, 7, Text_Color::White, 10, 0], [:param, 2, Text_Color::White, 116, 0], [:param, 3, Text_Color::White, 510,280], [:param, 4, Text_Color::White, 116,120], [:param, 5, Text_Color::White, 13, 120], [:param, 6, Text_Color::White, 12, 280], ], :page_2=>[ [:header, "xParameter Info :", Text_Color::White,0,0], [:x_param, 0, Text_Color::White, 11, 0], [:x_param, 1, Text_Color::White, 12, 0], [:x_param, 2, Text_Color::White, 113, 0], [:x_param, 3, Text_Color::White, 114, 0], [:x_param, 4, Text_Color::White, 15, 0], [:x_param, 7, Text_Color::White, 10,200], [:x_param, 8, Text_Color::White, 10, 0], [:x_param, 9, Text_Color::White, 14, 0], ], :page_3=>[ [:header, "sParameter Info :", Text_Color::White,0,0], [:s_param, 0, Text_Color::White, 9, 0], [:s_param, 1, Text_Color::White, 139, 0], [:s_param, 2, Text_Color::White, 112, 0], [:s_param, 3, Text_Color::White, 215,260], [:s_param, 4, Text_Color::White, 117, 0], [:s_param, 5, Text_Color::White, 119, 0], [:s_param, 6, Text_Color::White, 160, 0], [:s_param, 7, Text_Color::White, 160,120], ], :page_4=>[ [:header, "Outbound Elemental Damage :", Text_Color::White,0,0], [:atk_ele, 3, Text_Color::Deep_Red, 104, 0], [:atk_ele, 4, Text_Color::Dark_Blue, 105, 0], [:atk_ele, 5, Text_Color::Yellow, 106, 0], [:atk_ele, 6, Text_Color::Sky_Blue, 107, 0], [:atk_ele, 7, Text_Color::Brown, 108, 0], [:atk_ele, 8, Text_Color::Candy_Green, 109, 0], [:atk_ele, 9, Text_Color::Pure_White, 110, 0], [:atk_ele, 10, Text_Color::Grey, 111, 0], ], :page_5=>[ [:header, "Inbound Elemental Damage :", Text_Color::White,0,0], [:def_ele, 3, Text_Color::Deep_Red, 104, 0], [:def_ele, 4, Text_Color::Dark_Blue, 105, 0], [:def_ele, 5, Text_Color::Yellow, 106, 0], [:def_ele, 6, Text_Color::Sky_Blue, 107, 0], [:def_ele, 7, Text_Color::Brown, 108, 0], [:def_ele, 8, Text_Color::Candy_Green, 109, 0], [:def_ele, 9, Text_Color::Pure_White, 110, 0], [:def_ele, 10, Text_Color::Grey, 111, 0], ], :page_6=>[ [:header, "Extra Stats :", Text_Color::White,0,0], [:param, 7, Text_Color::White, 125, 0], [:x_param, 5, Text_Color::White, 14, 0], [:x_param, 6, Text_Color::White,200, 0], [:s_param, 8, Text_Color::White, 25, 0], [:s_param, 9, Text_Color::White, 26, 0], [:atk_lev, 3, Text_Color::Deep_Red , 104, 0], [:def_lev, 4, Text_Color::Dark_Blue, 105, 0], ], } # << End Page's Settings #----------------------------------------------------------------------------- # Max Pages To Show, Never Have Below 1. Max_Pages = 6 #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # ☆ Info-Box Settings #----------------------------------------------------------------------------- # the info box is a small box located in the bottom left of the distribution # screen. It can ony be seen if there are less than 9 visible commands. # :info=>[ icon, hue, "Text" ], IBox={ # :time => [ 280, 0, "Time :"], :gold => [ 361, 0, "Gold :"], :exp => [ 362, 180, "Spare Exp :"], :pts => [ 363, 90, "DP:"] } #----------------------------------------------------------------------------- # If :time is being shown make this setting = true # this will make the time be refreshed each second. # By default it is false to reduce system power usage. Showing_Time = false #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # ☆ Distribution Settings Begin #----------------------------------------------------------------------------- # :pts_on_lv = How many points are gained on level up. # :extra_pts = Extra Points Gained. # :xtra_p_lv = [Array of levels that :extra_pts are gained on]. # STAT ID = {Hash of information for this stat}. # ^- :name = The name displayed on distribution screen. # ^- :icon = [icon_id, hue, enable] # ^- :help = "Help Window Text Settings" # ^- :cost = [:type, "cost formula"] # ^- [:points, "1"], # ^- [:gold, "10"], # ^- [:exp, "(@level * 4) / (parent_stat(0)/100).to_i"[, # ^- ### NOTE: :gold && :exp Costs are in Beta Phase !! ### # ^- :limit= > Max Value This Stat Can Reach (before other modifications). # ^- :mods = [Array of information storing this stats statistic mods] # ^- [:add_param , id, value], # ^- [:sub_param , id, value], # ^- [:div_param , id, value], # ^- [:mul_param , id, value], # ^- [:mod_param , id, value], # ^- [:add_xparam , id, value], # ^- [:sub_xparam , id, value], # ^- [:div_xparam , id, value], # ^- [:mul_xparam , id, value], # ^- [:mod_xparam , id, value], # ^- [:add_sparam , id, value], # ^- [:sub_sparam , id, value], # ^- [:div_sparam , id, value], # ^- [:mul_sparam , id, value], # ^- [:mod_sparam , id, value], # ^- [:add_atk_ele , id, value], # ^- [:sub_atk_ele , id, value], # ^- [:div_atk_ele , id, value], # ^- [:mul_atk_ele , id, value], # ^- [:mod_atk_ele , id, value], # ^- [:add_def_ele , id, value], # ^- [:sub_def_ele , id, value], # ^- [:div_def_ele , id, value], # ^- [:mul_def_ele , id, value], # ^- [:mod_def_ele , id, value], # ^- [:add_atl , value], # ^- [:sub_atl , value], # ^- [:div_atl , value], # ^- [:mul_atl , value], # ^- [:mod_atl , value], # ^- [:add_dfl , value], # ^- [:sub_dfl , value], # ^- [:div_dfl , value], # ^- [:mul_dfl , value], # ^- [:mod_dfl , value], # ^- [:add_mtp , value], # ^- [:sub_mtp , value], # ^- [:div_mtp , value], # ^- [:mul_mtp , value], # ^- [:mod_mtp , value], #----------------------------------------------------------------------------- # ☆ Distribution Setup 0 Begin #----------------------------------------------------------------------------- Stat_Set[0]={# << Begin :pts_on_lv => 1, :extra_pts => 5, :xtra_p_lv => [10,25,50,100], 0=>{ :name => "Vitality", :icon => [1, 0, true], :help => "Increases Vitality.", :cost => [:points, "1"], :limit => 255, :mods =>[ [:add_param , 0, 9.5], [:add_param , 3, 0.4], [:add_param , 5, 0.4], [:add_xparam, 3, 0.001], [:add_xparam, 7, 0.0005], [:add_sparam, 0, 0.013], [:add_sparam, 1, 0.013], [:add_sparam, 6, -0.00025], [:add_sparam, 7, -0.00025], # [:add_dfl , 0.5], ], }, 1=>{ :name => "Strength", :icon => [2, 0, true], :help => "Increases Strength.", :cost => [:points, "1"], :limit => 255, :mods =>[ [:add_param , 2, 1.2], [:add_param , 3, 0.6], [:add_param , 4, -0.01], [:add_param , 5, -0.01], [:add_param , 7, 0.1], [:add_xparam, 6, 0.0005], [:add_sparam, 0, 0.0009], [:add_sparam, 1, 0.005], [:add_sparam, 6, -0.002], # [:add_atl , 0.25], ], }, 2=>{ :name => "Dexterity", :icon => [3, 0, true], :help => "Increases Dexterity.", :cost => [:points, "1"], :limit => 255, :mods =>[ [:add_param , 6, 1.2], [:add_param , 7, 0.6], [:add_xparam, 0, 0.005], [:add_xparam, 1, 0.0005], [:add_xparam, 2, 0.001], [:add_xparam, 3, 0.0005], [:add_xparam, 4, 0.00025], [:add_xparam, 6, 0.0002], [:add_xparam, 9, 0.0005], [:add_sparam, 5, -0.0025], ], }, 3=>{ :name => "Magic", :icon => [4, 0, true], :help => "Increases Magic.", :cost => [:points, "1"], :limit => 255, :mods =>[ [:add_param , 1, 9.5], [:add_param , 2, -0.01], [:add_param , 3, -0.01], [:add_param , 4, 1.2], [:add_param , 5, 0.6], [:add_param , 7, 0.1], [:add_xparam, 4, 0.001], [:add_xparam, 8, 0.0005], [:add_sparam, 1, -0.004], [:add_sparam, 4, -0.0025], [:add_sparam, 7, -0.002], # [:add_atl , 0.25], ], }, }# << End Stat_Set[0] #----------------------------------------------------------------------------- # ☆ Distribution Setup 0 End #----------------------------------------------------------------------------- # ☆ Distribution Setup 1 Begin #----------------------------------------------------------------------------- Stat_Set[1]={# << Begin :pts_on_lv => 1, :extra_pts => 5, :xtra_p_lv => [5,10,15,20], 0=>{ :name => "Ifrit", :icon => [104, 0, true], :help => "Pray To The Fire God Ifrit To Increase Bond.", :cost => [:points, "parent_stat(0)+1"], :limit => 105, :mods =>[ [:add_atk_ele, 3, 0.01], [:add_atk_ele, 4, -0.01], [:add_def_ele, 3, -0.01], [:add_def_ele, 4, 0.01], ], }, 1=>{ :name => "Shiva", :icon => [105, 0, true], :help => "Pray To The Ice Goddess Shiva To Increase Bond.", :cost => [:points, "parent_stat(1)+1"], :limit => 105, :mods =>[ [:add_atk_ele, 3, -0.01], [:add_atk_ele, 4, 0.01], [:add_def_ele, 3, 0.01], [:add_def_ele, 4, -0.01], ], }, 2=>{ :name => "Ramuh", :icon => [106, 0, true], :help => "Pray To The Thunder God Ramuh To Increase Bond.", :cost => [:points, "parent_stat(2)+1"], :limit => 105, :mods =>[ [:add_atk_ele, 5, 0.01], [:add_atk_ele, 6, -0.01], [:add_def_ele, 5, -0.01], [:add_def_ele, 6, 0.01], ], }, 3=>{ :name => "Levithon", :icon => [107, 0, true], :help => "Pray To The Water God Levithon To Increase Bond.", :cost => [:points, "parent_stat(3)+1"], :limit => 105, :mods =>[ [:add_atk_ele, 5, -0.01], [:add_atk_ele, 6, 0.01], [:add_def_ele, 5, 0.01], [:add_def_ele, 6, -0.01], ], }, 4=>{ :name => "Titan", :icon => [108, 0, true], :help => "Pray To The Earth God Titan To Increase Bond.", :cost => [:points, "parent_stat(4)+1"], :limit => 105, :mods =>[ [:add_atk_ele, 7, 0.01], [:add_atk_ele, 8, -0.01], [:add_def_ele, 7, -0.01], [:add_def_ele, 8, 0.01], ], }, 5=>{ :name => "Bahamut", :icon => [109, 0, true], :help => "Pray To The Wind God Bahamut To Increase Bond.", :cost => [:points, "parent_stat(5)+1"], :limit => 105, :mods =>[ [:add_atk_ele, 7, -0.01], [:add_atk_ele, 8, 0.01], [:add_def_ele, 7, 0.01], [:add_def_ele, 8, -0.01], ], }, 6=>{ :name => "Ashura", :icon => [110, 0, true], :help => "Pray To The Holy Goddess Ashura To Increase Bond.", :cost => [:points, "parent_stat(6)+1"], :limit => 105, :mods =>[ [:add_atk_ele, 9, 0.01], [:add_atk_ele, 10, -0.01], [:add_def_ele, 9, -0.01], [:add_def_ele, 10, 0.01], [:add_dfl , 1], ], }, 7=>{ :name => "Hades", :icon => [111, 0, true], :help => "Pray To The Dark God Hades To Increase Bond.", :cost => [:points, "parent_stat(7)+1"], :limit => 105, :mods =>[ [:add_atk_ele, 9, -0.01], [:add_atk_ele, 10, 0.01], [:add_def_ele, 9, 0.01], [:add_def_ele, 10, -0.01], [:add_atl , 1], ], }, }# << End Stat_Set[1] #----------------------------------------------------------------------------- # ☆ Distribution Setup 1 end #----------------------------------------------------------------------------- # You can add more Stat_Set[id] below this point.. # Remember to follow the hash layout perfectly or you will encounter errors # if you make a mistake, delete your stat set and try again... # I DO NOT want to be harrassed by questions of how to make a good setup # i have given examples, use them to your advantage.. #----------------------------------------------------------------------------- # Default Stat_Set[ id ] used for all actors / classes / enemies Default_Stat_Set = 0 #----------------------------------------------------------------------------- # Initial Distribution Points For ALL Actors. Initial_Points = 0 #----------------------------------------------------------------------------- # ☆ Notetag Settings #----------------------------------------------------------------------------- Notes={ :SPDS_SET => //i, :INIT_DPs => //i, :NO_SPDS => //i, :SPDS_STAT => //i, :ALL_STATS => //i, :SPDS_MAXX => //i, } #----------------------------------------------------------------------------- # This option only works if using my $D13x Scene Backgrounds Script. # The background folder is set in the Scene BackGrounds script. #----------------------------------------------------------------------------- BGs=[ # ['NAME' , x, y, x scroll, y scroll, z, hue, init opac, max opac], ['Sunbeam_Overlay_by ShinGamix',0,0, 0, 0, 1, 0, 105, 255], ['ShinGamox_by ShinGamix',0,0, 0, 0, 1, 0, 105, 245], ['Fog_By_hyde' , 100, 100, 2, -2, 1, 0, 74, 155], ['$Dekita_II' , 0, 0, 1, 1, 2, 0, 0, 255], ]# << end #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # ☆ Window Settings #----------------------------------------------------------------------------- # This is where you set the windowskin for each window. # Simply put a # at the start of lines you want to keep the default # NOTE : This setting requires $D13x Window Skins Script. # The windowskin folder is set in the WindowSkins script also. #----------------------------------------------------------------------------- Skins={ # << KEEP !! # :window type => ["Skin Name" , hue, opacity] :main_command => ["PWI_Style_Blu", 0, 225], :spds_command => ["PWI_Style_Blu", 0, 225], :spds_help => ["PWI_Style_Blu", 0, 225], :main_status => ["PWI_Style_Blu", 0, 225], :dist_status => ["PWI_Style_Blu", 0, 225], :ibox_window => ["PWI_Style_Blu", 0, 225], } # << Keep ##################### # CUSTOMISATION END # end ##################### #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★# # # # http://dekitarpg.wordpress.com/ # # # #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆# #===============================================================================# # ARE YOU MODIFYING BEYOND THIS POINT? \.\. # # YES?\.\. # # OMG, REALLY? \| # # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. # # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. # #===============================================================================# module SPDS ; Commands = [] ; Max_Parent_Stats.times { |i| Commands << i } ; end #=============================================================================== module DataManager #=============================================================================== #--------------------------------------------------------------------------- # Alias List #--------------------------------------------------------------------------- class << self alias :lbd__SPDS :load_database end #--------------------------------------------------------------------------- # Load Database (alias) #--------------------------------------------------------------------------- def self.load_database lbd__SPDS loa_SPDS end #--------------------------------------------------------------------------- # Load Unique Shit #--------------------------------------------------------------------------- def self.loa_SPDS 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__SPDS end end end end # DataManager #=============================================================================== module BattleManager #=============================================================================== #----------------------------------------------------------------------------- # Alias Lust #----------------------------------------------------------------------------- class << self alias :gain_disti_pts :gain_exp end #----------------------------------------------------------------------------- # EXP Acquisition and Level Up Display #----------------------------------------------------------------------------- def self.gain_exp gain_disti_pts gained = ($game_troop.disti_total / $game_party.alive_battle_members.size) vocab = SPDS::Gain_Pts_Vocab dp_voc = SPDS::DP_Vocab[1] if gained > 0 for actor in $game_party.alive_battle_members actor.gain_points(gained) text = sprintf(vocab, actor.name, gained, dp_voc) $game_message.add('\.' + text) end end wait_for_message end end #=============================================================================== class RPG::BaseItem #=============================================================================== #----------------------------------------------------------------------------- # Pi Variables #----------------------------------------------------------------------------- attr_accessor :_SPDS_SET_ID_ attr_accessor :init_SPDS_points attr_accessor :can_distribute attr_accessor :spds_stats attr_accessor :spds_stats_limit #----------------------------------------------------------------------------- # Alias List #----------------------------------------------------------------------------- def load__SPDS @can_distribute = true @spds_stats = [0] * SPDS::Commands.size @spds_stats_limit = [0] * SPDS::Commands.size @_SPDS_SET_ID_ = SPDS::Default_Stat_Set @init_SPDS_points = self.is_a?(RPG::Actor) ? SPDS::Initial_Points : 0 self.note.split(/[\r\n]+/).each do |line| case line when SPDS::Notes[:SPDS_SET ] then @_SPDS_SET_ID_ = $1.to_i when SPDS::Notes[:INIT_DPs ] then @init_SPDS_points = $1.to_i when SPDS::Notes[:NO_SPDS ] then @can_distribute = false when SPDS::Notes[:SPDS_STAT] then @spds_stats[$1.to_i] = $2.to_i when SPDS::Notes[:SPDS_MAXX] then @spds_stats_limit[$1.to_i] = $2.to_i when SPDS::Notes[:ALL_STATS] then SPDS::Commands.each {|i| @spds_stats[i] = $1.to_i } end end end end #=============================================================================== class Game_BattlerBase #=============================================================================== #----------------------------------------------------------------------------- # ISPDS Feature Code (For Parent Stats) #----------------------------------------------------------------------------- FEATURE_ISPDS = 2013 #----------------------------------------------------------------------------- # Alias List #----------------------------------------------------------------------------- alias :ispds_init_GB :initialize alias :spds_fis_refresh :refresh alias :parp_spds_plus :param_plus alias :xparp_spds_plus :xparam_plus if $D13x[:Stats_Control] alias :sparp_spds_plus :sparam_plus if $D13x[:Stats_Control] alias :def_ele_plus_spds :def_ele_plus if $D13x[:Elems_Control] alias :atk_ele_plus_spds :atk_ele_plus if $D13x[:Elems_Control] alias :at_dfl_plus_mods_spds :atl_dfl_plus if $D13x[:Atk_Def_Lvs] alias :mtp_plus_ispds :max_tp_plus if $D13x[:TP_Control] #----------------------------------------------------------------------------- # Initialize #----------------------------------------------------------------------------- def initialize(*args, &block) @spds_stats_prefix = [0] * gdecoms.size setup_spds_set_info clear_spds_stats ispds_init_GB(*args, &block) end #----------------------------------------------------------------------------- # Get The Commands #----------------------------------------------------------------------------- def gdecoms return SPDS::Commands end #----------------------------------------------------------------------------- # Initialize SPDS System ++ (Default) #----------------------------------------------------------------------------- def setup_spds_set_info @spds_set = SPDS::Default_Stat_Set get_stat_val_for__RPG_Items end #----------------------------------------------------------------------------- # Get SPDS Set Info #----------------------------------------------------------------------------- def spds_set return SPDS::Stat_Set[@spds_set] end #----------------------------------------------------------------------------- # Get SPDS Stat Value #----------------------------------------------------------------------------- def get_stat_val_for__RPG_Items init_spds_stats_RPG_Fix gdecoms.each do |stat| next unless spds_set[stat] spds_set[stat][:mods].each do |mod| case mod[0] # << reg-Params when :add_param then @param_per_stat[stat][mod[1]] += mod[2] when :sub_param then @param_per_stat[stat][mod[1]] -= mod[2] when :div_param then @param_per_stat[stat][mod[1]] /= mod[2] when :mul_param then @param_per_stat[stat][mod[1]] *= mod[2] when :mod_param then @param_per_stat[stat][mod[1]] %= mod[2] # << x-Params when :add_xparam then @xparam_per_stat[stat][mod[1]] += mod[2] when :sub_xparam then @xparam_per_stat[stat][mod[1]] -= mod[2] when :div_xparam then @xparam_per_stat[stat][mod[1]] /= mod[2] when :mul_xparam then @xparam_per_stat[stat][mod[1]] *= mod[2] when :mod_xparam then @xparam_per_stat[stat][mod[1]] %= mod[2] # << s-Params when :add_sparam then @sparam_per_stat[stat][mod[1]] += mod[2] when :sub_sparam then @sparam_per_stat[stat][mod[1]] -= mod[2] when :div_sparam then @sparam_per_stat[stat][mod[1]] /= mod[2] when :mul_sparam then @sparam_per_stat[stat][mod[1]] *= mod[2] when :mod_sparam then @sparam_per_stat[stat][mod[1]] %= mod[2] # << Attack Elements when :add_atk_ele then @atk_ele_per_stat[stat][mod[1]] += mod[2] when :sub_atk_ele then @atk_ele_per_stat[stat][mod[1]] -= mod[2] when :div_atk_ele then @atk_ele_per_stat[stat][mod[1]] /= mod[2] when :mul_atk_ele then @atk_ele_per_stat[stat][mod[1]] *= mod[2] when :mod_atk_ele then @atk_ele_per_stat[stat][mod[1]] %= mod[2] # << Defence Elements when :add_def_ele then @def_ele_per_stat[stat][mod[1]] += mod[2] when :sub_def_ele then @def_ele_per_stat[stat][mod[1]] -= mod[2] when :div_def_ele then @def_ele_per_stat[stat][mod[1]] /= mod[2] when :mul_def_ele then @def_ele_per_stat[stat][mod[1]] *= mod[2] when :mod_def_ele then @def_ele_per_stat[stat][mod[1]] %= mod[2] # << Attack Level when :add_atl then @atl_dfl_per_stat[stat][0] += mod[1] when :sub_atl then @atl_dfl_per_stat[stat][0] -= mod[1] when :div_atl then @atl_dfl_per_stat[stat][0] /= mod[1] when :mul_atl then @atl_dfl_per_stat[stat][0] *= mod[1] when :mod_atl then @atl_dfl_per_stat[stat][0] %= mod[1] # << Defence Level when :add_dfl then @atl_dfl_per_stat[stat][1] += mod[1] when :sub_dfl then @atl_dfl_per_stat[stat][1] -= mod[1] when :div_dfl then @atl_dfl_per_stat[stat][1] /= mod[1] when :mul_dfl then @atl_dfl_per_stat[stat][1] *= mod[1] when :mod_dfl then @atl_dfl_per_stat[stat][1] %= mod[1] # << Max TP when :add_mtp then @max_tp_per_stat[stat] += mod[1] when :sub_mtp then @max_tp_per_stat[stat] -= mod[1] when :div_mtp then @max_tp_per_stat[stat] /= mod[1] when :mul_mtp then @max_tp_per_stat[stat] *= mod[1] when :mod_mtp then @max_tp_per_stat[stat] %= mod[1] end end end end #----------------------------------------------------------------------------- # Initialize SPDS Stats FPS Fix #----------------------------------------------------------------------------- def init_spds_stats_RPG_Fix @param_per_stat = {} @xparam_per_stat = {} @sparam_per_stat = {} @atk_ele_per_stat = {} @def_ele_per_stat = {} @atl_dfl_per_stat = {} @tp_max_per_stat = {} gdecoms.each do |stat| @tp_max_per_stat [stat] = 0 @atl_dfl_per_stat [stat] = [0] * 2 @param_per_stat [stat] = [0] * 8 @xparam_per_stat [stat] = [0] * 10 @sparam_per_stat [stat] = [0] * 10 @atk_ele_per_stat [stat] = [0] * $data_system.elements.size @def_ele_per_stat [stat] = [0] * $data_system.elements.size end end #----------------------------------------------------------------------------- # Get SPDS Stats #----------------------------------------------------------------------------- def spds_stats(id) base = (features_sum(FEATURE_ISPDS, id) + spds_plus(id)) esab = [[base, spds_stats_max(id)].min, 0].max @spds_stats_prefix[id] = esab.to_i @spds_stats_prefix[id] end #----------------------------------------------------------------------------- # Get SPDS Stats Max #----------------------------------------------------------------------------- def spds_stats_max(id) base = spds_set[id][:limit] rescue 0 return base end #----------------------------------------------------------------------------- # Get SPDS Stats #----------------------------------------------------------------------------- def parent_stat(id) return @spds_stats_prefix[id] end #----------------------------------------------------------------------------- # Get SPDS Stats Plus #----------------------------------------------------------------------------- def spds_plus(id) @spds_stats[id] end #----------------------------------------------------------------------------- # Clear SPDS Stats Plus #----------------------------------------------------------------------------- def clear_spds_stats @spds_stats = [0] * gdecoms.size end #----------------------------------------------------------------------------- # Add SPDS Stats #----------------------------------------------------------------------------- def add_spds_stats(id, value, ref = true) @spds_stats[id] += value refresh if ref end #----------------------------------------------------------------------------- # Sub SPDS Stats #----------------------------------------------------------------------------- def sub_spds_stats(id, value, ref = true) @spds_stats[id] -= value refresh if ref end #----------------------------------------------------------------------------- # Div SPDS Stats #----------------------------------------------------------------------------- def div_spds_stats(id, value, ref = true) @spds_stats[id] /= value refresh if ref end #----------------------------------------------------------------------------- # Mul SPDS Stats #----------------------------------------------------------------------------- def mul_spds_stats(id, value, ref = true) @spds_stats[id] *= value refresh if ref end #----------------------------------------------------------------------------- # Mod SPDS Stats #----------------------------------------------------------------------------- def mod_spds_stats(id, value, ref = true) @spds_stats[id] %= value refresh if ref end #----------------------------------------------------------------------------- # Refresh #----------------------------------------------------------------------------- def refresh gdecoms.each { |i| spds_stats(i) } spds_fis_refresh end #----------------------------------------------------------------------------- # Param Plus #----------------------------------------------------------------------------- def param_plus(param_id) base = parp_spds_plus(param_id) SPDS::Commands.each do |i| base += (@param_per_stat[gdecoms[i]][param_id]*@spds_stats_prefix[i]) end base.to_i end if $D13x[:Stats_Control] #--------------------------------------------------------------------------- # x-Param Plus #--------------------------------------------------------------------------- def xparam_plus(xparam_id) base = xparp_spds_plus(xparam_id) SPDS::Commands.each do |i| base += (@xparam_per_stat[gdecoms[i]][xparam_id]*@spds_stats_prefix[i]) end base.to_f end #--------------------------------------------------------------------------- # s-Param Plus #--------------------------------------------------------------------------- def sparam_plus(sparam_id) base = sparp_spds_plus(sparam_id) SPDS::Commands.each do |i| base += (@sparam_per_stat[gdecoms[i]][sparam_id]*@spds_stats_prefix[i]) end base.to_f end end # if $D13x[:Stats_Control] if $D13x[:Elems_Control] #--------------------------------------------------------------------------- # Defence Element Plus #--------------------------------------------------------------------------- def def_ele_plus(element_id) base = def_ele_plus_spds(element_id) SPDS::Commands.each do |i| base += (@def_ele_per_stat[gdecoms[i]][element_id]*@spds_stats_prefix[i]) end base.to_f end #--------------------------------------------------------------------------- # Attack Element Plus #--------------------------------------------------------------------------- def atk_ele_plus(element_id) base = atk_ele_plus_spds(element_id) SPDS::Commands.each do |i| base += (@atk_ele_per_stat[gdecoms[i]][element_id]*@spds_stats_prefix[i]) end base.to_f end end # if $D13x[:Elems_Control] if $D13x[:Atk_Def_Lvs] #--------------------------------------------------------------------------- # Atk Lv | Def Lv ++ #--------------------------------------------------------------------------- def atl_dfl_plus(id) base = at_dfl_plus_mods_spds(id) SPDS::Commands.each do |i| base += (@atl_dfl_per_stat[gdecoms[i]][id]*@spds_stats_prefix[i]) end base.to_i end end # if $D13x[:Atk_Def_Lvs] if $D13x[:TP_Control] #--------------------------------------------------------------------------- # Max TP Plus #--------------------------------------------------------------------------- def max_tp_plus base = mtp_plus_ispds SPDS::Commands.each do |i| base += (@tp_max_per_stat[gdecoms[i]]*@spds_stats_prefix[i]) end base.to_i end end end # Game_BattlerBase #=============================================================================== class Game_Actor < Game_Battler #=============================================================================== #----------------------------------------------------------------------------- # Pi Variables #----------------------------------------------------------------------------- attr_reader :points attr_reader :SPDSFLAG #----------------------------------------------------------------------------- # Alias List #----------------------------------------------------------------------------- alias :sD13x_SPDS_init :initialize alias :lev_up_SPDS :level_up alias :change_SPDS_class :change_class #----------------------------------------------------------------------------- # Initialization #----------------------------------------------------------------------------- def initialize(actor_id) sD13x_SPDS_init(actor_id) init_SPDS refresh recover_all end #----------------------------------------------------------------------------- # Initialize SPDS System #----------------------------------------------------------------------------- def init_SPDS @points = actor.init_SPDS_points @SPDSFLAG = false setup_spds_set_info_overwrite end #----------------------------------------------------------------------------- # Initialize SPDS System ++ (from super) #----------------------------------------------------------------------------- def setup_spds_set_info_overwrite act = actor._SPDS_SET_ID_ cla = self.class._SPDS_SET_ID_ @spds_set = SPDS::Default_Stat_Set @spds_set = cla if cla != SPDS::Default_Stat_Set @spds_set = act if act != SPDS::Default_Stat_Set get_stat_val_for__RPG_Items end #----------------------------------------------------------------------------- # Change_SPDS_Set_ID #----------------------------------------------------------------------------- def change_spds_set_id_to(id) return if SPDS::Stat_Set[id] == nil @spds_set = id get_stat_val_for__RPG_Items end #-------------------------------------------------------------------------- # Change Class | keep_exp: Keep EXP #-------------------------------------------------------------------------- def change_class(class_id, keep_exp = false) old_cla = @class_id change_SPDS_class(class_id, keep_exp) setup_spds_set_info_overwrite if old_cla != @class_id end #----------------------------------------------------------------------------- # Level Up #----------------------------------------------------------------------------- def level_up lev_up_SPDS on_lv_SPDS end #----------------------------------------------------------------------------- # Level Up SPDS #----------------------------------------------------------------------------- def on_lv_SPDS return unless can_distribute? @points += spds_set[:pts_on_lv] @points += spds_set[:extra_pts] if spds_set[:xtra_p_lv].include?(@level) @SPDSFLAG = true if @points > 0 end #----------------------------------------------------------------------------- # Can Distribute Stats? #----------------------------------------------------------------------------- def can_distribute? return actor.can_distribute end #----------------------------------------------------------------------------- # Reset SPDSFLAG #----------------------------------------------------------------------------- def reset_SPDSFLAG @SPDSFLAG = false end #----------------------------------------------------------------------------- # Do SPDS Stat Modifications <><> #----------------------------------------------------------------------------- def spds_stat_mods(mods,spds_stat_id,does_cost = true) @spds_stats[spds_stat_id] += 1 cost = get_point_cost(mods[:cost][1]) return refresh unless does_cost case mods[:cost][0] when :points then reduce_points(cost) when :gold then $game_party.gain_gold(-cost) when :exp then reduce_spds_exp(cost) end refresh end #----------------------------------------------------------------------------- # Reduce Points #----------------------------------------------------------------------------- def reduce_points(val) @points -= val @points = 0 if @points < 0 end #----------------------------------------------------------------------------- # Reset All Points #----------------------------------------------------------------------------- def reset_all_points(pts_bk = true) old_pts = get_total_spds_stats clear_spds_stats new_pts = get_total_spds_stats gain_points(old_pts-new_pts) if ((old_pts > new_pts) && (pts_bk)) end #----------------------------------------------------------------------------- # Reset Some Points #----------------------------------------------------------------------------- def reset_some_points(stat_id, points, pts_bk = true) old_pts = parent_stat(stat_id) sub_spds_stats(stat_id, points) new_pts = parent_stat(stat_id) gain_points(old_pts-new_pts) if ((old_pts > new_pts) && (pts_bk)) end #----------------------------------------------------------------------------- # Gain Points #----------------------------------------------------------------------------- def gain_points(val) @points += val @points = SPDS::Max_Points if @points > SPDS::Max_Points end #----------------------------------------------------------------------------- # Reduce SPDS Exp #----------------------------------------------------------------------------- def reduce_spds_exp(val) gain_exp(-val) end #----------------------------------------------------------------------------- # Get Spendable Exp #----------------------------------------------------------------------------- def spendable_exp exp - current_level_exp end #----------------------------------------------------------------------------- # Get Points Cost #----------------------------------------------------------------------------- def get_point_cost(string) return [eval(string), 1].max.to_i rescue 0 end #----------------------------------------------------------------------------- # Get Total SPDS Stats #----------------------------------------------------------------------------- def get_total_spds_stats(base = 0) gdecoms.each { |i| base += parent_stat(i) } return base end #----------------------------------------------------------------------------- # SPDS Plus #----------------------------------------------------------------------------- def spds_plus(id) base = super(id) base += actor.spds_stats[id] base += self.class.spds_stats[id] base += equips.compact.inject(0) {|r, i| r += i.spds_stats[id] } base += states.compact.inject(0) {|r, i| r += i.spds_stats[id] } if $D13x[:Skill_Lv] base += skills.compact.inject(0) {|r, i| r += (i.spds_stats[id]* Skill_Levels::Exp_Set[i.exp_set][@skills_lv[i.id]][2] ).to_f} else base += skills.compact.inject(0) {|r, i| r += i.spds_stats[id] } end base end #----------------------------------------------------------------------------- # Get SPDS Stats Max #----------------------------------------------------------------------------- def spds_stats_max(id) base = super(id) base += actor.spds_stats_limit[id] base += self.class.spds_stats_limit[id] base += equips.compact.inject(0) {|r, i| r += i.spds_stats_limit[id] } base += states.compact.inject(0) {|r, i| r += i.spds_stats_limit[id] } if $D13x[:Skill_Lv] base += skills.compact.inject(0) {|r, i| r += (i.spds_stats_limit[id]* Skill_Levels::Exp_Set[i.exp_set][@skills_lv[i.id]][2] ).to_f} else base += skills.compact.inject(0) {|r, i| r += i.spds_stats_limit[id] } end base end end #=============================================================================== class Game_Enemy < Game_Battler #=============================================================================== #----------------------------------------------------------------------------- # Alias List #----------------------------------------------------------------------------- alias :sD13x_SPDS_init :initialize #----------------------------------------------------------------------------- # Initialization #----------------------------------------------------------------------------- def initialize(index, enemy_id) sD13x_SPDS_init(index, enemy_id) setup_spds_set_info_overwrite refresh recover_all end #----------------------------------------------------------------------------- # Get Distribution Points #----------------------------------------------------------------------------- def disti_pts enemy.init_SPDS_points end #----------------------------------------------------------------------------- # Initialize SPDS System ++ (from super) #----------------------------------------------------------------------------- def setup_spds_set_info_overwrite @spds_set = SPDS::Default_Stat_Set @spds_set = enemy._SPDS_SET_ID_ if enemy._SPDS_SET_ID_ != @spds_set get_stat_val_for__RPG_Items end #----------------------------------------------------------------------------- # SPDS Plus #----------------------------------------------------------------------------- def spds_plus(id) base = super(id) base += enemy.spds_stats[id] base += states.compact.inject(0) {|r, i| r += i.spds_stats[id] } base end #----------------------------------------------------------------------------- # Get SPDS Stats Max #----------------------------------------------------------------------------- def spds_stats_max(id) base = super(id) base += enemy.spds_stats_limit[id] base += states.compact.inject(0) {|r, i| r += i.spds_stats_limit[id] } base end end #=============================================================================== class Game_Troop < Game_Unit #=============================================================================== #----------------------------------------------------------------------------- # Calculate Distribution Points Gain Total #----------------------------------------------------------------------------- def disti_total dead_members.inject(0) {|r, enemy| r += enemy.disti_pts } end end #=============================================================================== class Game_Party < Game_Unit #=============================================================================== #----------------------------------------------------------------------------- # Check if member needs to be taken to distribution screen. #----------------------------------------------------------------------------- def check_need_spds? return nil unless SPDS::Show_Screen alive_battle_members.each do |a| next unless a.SPDSFLAG a.reset_SPDSFLAG return a end return nil end end #=============================================================================== class Window_MenuCommand < Window_Command #=============================================================================== #----------------------------------------------------------------------------- # Alias List #----------------------------------------------------------------------------- alias :add_spds_menu_command :add_original_commands #----------------------------------------------------------------------------- # For Adding Original Commands #----------------------------------------------------------------------------- def add_original_commands add_spds_menu_command add_command(SPDS::Main_Commands[0][1], :distribute, can_distribute) end #----------------------------------------------------------------------------- # Add Distribution Command #----------------------------------------------------------------------------- def add_distribute_command return unless SPDS::Menu_Info[0] add_command(SPDS::Menu_Info[2], :distribute, can_distribute) end #----------------------------------------------------------------------------- # Can Enable Distribution ? #----------------------------------------------------------------------------- def can_distribute return $game_switches[SPDS::Menu_Info[2]] if SPDS::Menu_Info[2] != 0 return true end end #=============================================================================== class Window_SPDSCommand < Window_Command #=============================================================================== #----------------------------------------------------------------------------- # Get Window Width #----------------------------------------------------------------------------- def window_width return Graphics.width / 4 end #----------------------------------------------------------------------------- # Get Number of Lines to Show #----------------------------------------------------------------------------- def visible_line_number return 2 end #----------------------------------------------------------------------------- # Set/Get Alignment #----------------------------------------------------------------------------- def alignment return 1 end #----------------------------------------------------------------------------- # Create Command List #----------------------------------------------------------------------------- def make_command_list for command in SPDS::Main_Commands add_command(command[1], command[0]) end end #----------------------------------------------------------------------------- # Draws Items #----------------------------------------------------------------------------- def draw_item(index) self.contents.font.name = General::Fonts self.contents.font.size = General::Font_Size self.contents.font.bold = General::Font_Bold draw_text(item_rect_for_text(index), command_name(index), 1) end end #=============================================================================== class Window_SPDS_DistributeCommand < Window_Command #=============================================================================== #----------------------------------------------------------------------------- # Pi Variables #----------------------------------------------------------------------------- attr_reader :actor #----------------------------------------------------------------------------- # Initialize #----------------------------------------------------------------------------- def initialize(x, y) @dey = y @actor = $game_party.menu_actor super(x, y) deactivate @index = -1 end #----------------------------------------------------------------------------- # Set Actor #----------------------------------------------------------------------------- def actor=(actor) return if @actor == actor @actor = actor refresh end #----------------------------------------------------------------------------- # Get Window Width #----------------------------------------------------------------------------- def window_width return Graphics.width / 3 end #----------------------------------------------------------------------------- # Get Window Height #----------------------------------------------------------------------------- def window_height return (line_height*(SPDS::Visible_Distribution_Commands+1)) end #----------------------------------------------------------------------------- # Create Command List #----------------------------------------------------------------------------- def make_command_list return unless @actor ind = 0 for command in SPDS::Commands next unless @actor.spds_set[command] set = @actor.spds_set[command] cost = @actor.get_point_cost(set[:cost][1]) enab = can_enable_spend?(set[:cost][0], cost, ind) add_command(set[:name], :spend_pts, enab, set) ind += 1 end return unless SPDS::Allow_Finish add_command(SPDS::Finish_Data[0], :end_distribute,true, {}) end #----------------------------------------------------------------------------- # Draws Items #----------------------------------------------------------------------------- def draw_item(index) change_color(normal_color, command_enabled?(index)) self.contents.font.name = General::Fonts self.contents.font.size = General::Font_Size self.contents.font.bold = General::Font_Bold rect = item_rect_for_text(index) icon = command_icon(index) contents.fill_rect(rect.x-2,rect.y+1,rect.width+4,rect.height-2,Color.new(0,0,0,64)) if command_name(index) == SPDS::Finish_Data[0] draw_text(rect, command_name(index), 1) else draw_de_icon(icon[0], rect.x, rect.y, icon[1], icon[2]) rect.x += 25 draw_text(rect, command_name(index), 0) rect.x -= 28 change_color(normal_color) draw_text(rect, @actor.spds_stats(index).to_s, 2) end end #----------------------------------------------------------------------------- # Get Command Icon #----------------------------------------------------------------------------- def command_icon(index) @list[index][:ext][:icon] end #----------------------------------------------------------------------------- # Get Command Icon #----------------------------------------------------------------------------- def get_command_help text = @actor.spds_set[SPDS::Commands[@index]][:help] rescue nil return SPDS::Finish_Data[1] unless text data = @actor.spds_set[SPDS::Commands[@index]] cost = @actor.get_point_cost(data[:cost][1]) add_cost_info_to_help(cost, data[:cost][0], text) end #----------------------------------------------------------------------------- # Add Cost Info to Help Window #----------------------------------------------------------------------------- def add_cost_info_to_help(cost, data, text) curr = @actor.parent_stat (@index) maxx = @actor.spds_stats_max(@index) text += "\nCost: --" if curr >= maxx case data when :points then text += "\nCost: #{cost} #{SPDS::DP_Vocab[1]}" when :gold then text += "\nCost: #{cost} Gold" when :exp then text += "\nCost: #{cost} Exp Points" end ;return text end #----------------------------------------------------------------------------- # Can Enable Buy Stat ? #----------------------------------------------------------------------------- def can_enable_spend?(type, cost, id) return false if (@actor.parent_stat(id) >= @actor.spds_stats_max(id)) return false if (@actor.spendable_exp < cost) && (type == :exp ) return false if (@actor.points < cost) && (type == :points ) return false if ($game_party.gold < cost) && (type == :gold ) return true end end #=============================================================================== class Window_SPDSCommandII < Window_Command #=============================================================================== #----------------------------------------------------------------------------- # Get Window Width #----------------------------------------------------------------------------- def window_width return 0 end #----------------------------------------------------------------------------- # Create Command List #----------------------------------------------------------------------------- def make_command_list for command in SPDS::Info add_command("", command[0]) end end #----------------------------------------------------------------------------- # Get Page ID #----------------------------------------------------------------------------- def get_page_id i = 0 for command in SPDS::Info return command[0] if i == index i += 1 end return :page_1 end end #=============================================================================== class Window_StatusSPDS < Window_Selectable #=============================================================================== #----------------------------------------------------------------------------- # Initialization #----------------------------------------------------------------------------- def initialize(actor, y) super(0, y, Graphics.width, 104) @actor = actor refresh end #----------------------------------------------------------------------------- # Line Height #----------------------------------------------------------------------------- def line_height return 22 end #----------------------------------------------------------------------------- # Window Padding #----------------------------------------------------------------------------- def standard_padding return 8 end #----------------------------------------------------------------------------- # Set Actor #----------------------------------------------------------------------------- def actor=(actor) return unless @actor != actor @actor = actor refresh end #----------------------------------------------------------------------------- # Do Refresh #----------------------------------------------------------------------------- def refresh contents.clear return unless @actor if !General::Fonts.include?(self.contents.font.name) self.contents.font.name = General::Fonts end if self.contents.font.size != General::Font_Size self.contents.font.size = General::Font_Size end if self.contents.font.bold != General::Font_Bold self.contents.font.bold = General::Font_Bold end draw_actor_face(@actor,0,-2,enabled = true) draw_names draw_infonshit end #----------------------------------------------------------------------------- # Draw Info And Shit #----------------------------------------------------------------------------- def draw_infonshit x = 104 y = line_height w = self.width/2 - (standard_padding*2) draw_info_box(x,y * 1,w-100) draw_de_hp(x,y*1,w+6) draw_info_box(x,y * 2,w-100) draw_de_mp(x,y*2,w+6) draw_info_box(x,y * 3,w-100) draw_de_tp(x,y*3,w+6) end #----------------------------------------------------------------------------- # Draw Names ( and Lv ) #----------------------------------------------------------------------------- def draw_names x = self.width/2-(standard_padding)+4 y = line_height nx = self.width/2 - (standard_padding*2) # << Name draw_info_box(104,0,nx-100) namtxt = "Name:" draw_text(108, 0, nx, line_height, namtxt) draw_text(108, 0, nx-108, line_height, @actor.name.to_s, 2) # << NickName draw_info_box(x,0,nx) nictxt = "Nickname:" draw_text(x+4, 0, nx, line_height, nictxt) draw_text(x, 0, nx-4, line_height, @actor.nickname.to_s, 2) draw_info_box(x,y*1,nx) sttxt = "Status:" draw_text(x+4, y*1, nx, line_height, sttxt) draw_actor_icons(@actor, x+52, line_height * 1 - 2, nx-52) draw_info_box(x,y*2,nx/3*2-2) lvtxt = "Lv #{@actor.level} #{@actor.class.name}" draw_text(x+4, y*2, nx, line_height, lvtxt) draw_info_box(x+(nx/3*2),y*2,nx/3) draw_text(x+(nx/3*2)+4, y*2, nx/3, line_height, SPDS::DP_Vocab[0]) draw_text(x+(nx/3*2), y*2, nx/3-4, line_height, "#{@actor.points}", 2) draw_info_box(x,y*3,nx) draw_de_xp(x, y * 3) end #----------------------------------------------------------------------------- # Draw Info Box #----------------------------------------------------------------------------- def draw_info_box(x,y,w) contents.fill_rect(x,y+1,w,line_height-2,Color.new(0,0,0,64)) 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(x, y, wid, 2, rate, color1, color2) if gauge draw_text(x+4, y, wid, line_height, "Exp:") draw_text(x, y, wid-4, line_height, "#{s1}/#{s2}",2) end end #=============================================================================== class Window_SPDSStatus < Window_Selectable #=============================================================================== #----------------------------------------------------------------------------- # Initialization #----------------------------------------------------------------------------- def initialize(actor, y) @dewid = Graphics.width/3*2 - (Graphics.width / 4) + 20 super(Graphics.width/3, y, @dewid, Graphics.height-y) @just_startingg = true self.opacity = 0 @actor = actor @page = nil refresh end #----------------------------------------------------------------------------- # Set Actor #----------------------------------------------------------------------------- def actor=(actor) return if @actor == actor @actor = actor refresh end #----------------------------------------------------------------------------- # Set Page #----------------------------------------------------------------------------- def page=(page) return if @page == page @page = page sound = SPDS::Page_Turn_Noise Audio.se_play(sound[0], sound[1], eval(sound[2])) if !@just_startingg @just_startingg = false if @just_startingg refresh end #----------------------------------------------------------------------------- # Refresh #----------------------------------------------------------------------------- def refresh contents.clear freshen draw_status_inf if @page end #----------------------------------------------------------------------------- # Refresh Fonts #----------------------------------------------------------------------------- def freshen if !General::Fonts.include?(self.contents.font.name) self.contents.font.name = General::Fonts end if self.contents.font.size != General::Font_Size self.contents.font.size = General::Font_Size end if self.contents.font.bold != General::Font_Bold self.contents.font.bold = General::Font_Bold end end #----------------------------------------------------------------------------- # Draw Stat Icons #----------------------------------------------------------------------------- def draw_stat_icons(icon, x, y, hue, enabled = true) return x+4 unless SPDS::Use_Icons return x+4 unless icon != 0 draw_de_icon(icon, x, y, hue, enabled) return x += 25 end #----------------------------------------------------------------------------- # Draw Parameters #----------------------------------------------------------------------------- def draw_parameters(x,y,i,col,icon,hue) contents.fill_rect(x,y+1,wid,line_height-2,Color.new(0,0,0,64)) x = draw_stat_icons(icon, x, y, hue, all_icons_enable?) text = "#{Vocab::param(i)}" change_color(col) draw_text(x, y, wid, line_height, text) change_color(Text_Color::White) unless SPDS::Values_Colored val = sprintf("%s", @actor.param(i)) draw_text(x, y, wid-34, line_height, val, 2) return y += line_height end #----------------------------------------------------------------------------- # Draw Header #----------------------------------------------------------------------------- def draw_header(x,y,i,col,icon,hue) contents.fill_rect(x,y+1,wid,line_height-2,Color.new(0,0,0,64)) x = draw_stat_icons(icon, x, y, hue, all_icons_enable?) change_color(col) w = self.width - (standard_padding * 2 ) draw_text(x, y, w, line_height, i.to_s, 0) return y += line_height end #----------------------------------------------------------------------------- # Draw x Parameters #----------------------------------------------------------------------------- def draw_xparameters(x,y,i,col,icon,hue) contents.fill_rect(x,y+1,wid,line_height-2,Color.new(0,0,0,64)) x = draw_stat_icons(icon, x, y, hue, all_icons_enable?) text = "#{Vocab::x_param(i)}" change_color(col) draw_text(x, y, wid, line_height, text) change_color(Text_Color::White) unless SPDS::Values_Colored val = sprintf("%1.2f%%", @actor.xparam(i)*100) draw_text(x, y, wid-34, line_height, val, 2) return y += line_height end #----------------------------------------------------------------------------- # Draw sParameters #----------------------------------------------------------------------------- def draw_sparameters(x,y,i,col,icon,hue) contents.fill_rect(x,y+1,wid,line_height-2,Color.new(0,0,0,64)) x = draw_stat_icons(icon, x, y, hue, all_icons_enable?) text = "#{Vocab::s_param(i)}" change_color(col) draw_text(x, y, wid, line_height, text) val = sprintf("%1.2f%%", @actor.sparam(i)*100) change_color(Text_Color::White) unless SPDS::Values_Colored draw_text(x, y, wid-34, line_height, val, 2) return y += line_height end #----------------------------------------------------------------------------- # Draw Attack Elements #----------------------------------------------------------------------------- def draw_atk_eles(x,y,i,col,icon,hue) contents.fill_rect(x,y+1,wid,line_height-2,Color.new(0,0,0,64)) x = draw_stat_icons(icon, x, y, hue, all_icons_enable?) text = "#{$data_system.elements[i]}" change_color(col) draw_text(x, y, wid, line_height, text) val = sprintf("%1.2f%%", @actor.atk_element_rate(i)*100) change_color(Text_Color::White) unless SPDS::Values_Colored draw_text(x, y, wid-34, line_height, val, 2) return y += line_height end #----------------------------------------------------------------------------- # Draw Defence Elements #----------------------------------------------------------------------------- def draw_def_eles(x,y,i,col,icon,hue) contents.fill_rect(x,y+1,wid,line_height-2,Color.new(0,0,0,64)) x = draw_stat_icons(icon, x, y, hue,all_icons_enable?) text = "#{$data_system.elements[i]}" change_color(col) draw_text(x, y, wid, line_height, text) val = sprintf("%1.2f%%", @actor.element_rate(i)*100) change_color(Text_Color::White) unless SPDS::Values_Colored draw_text(x, y, wid-34, line_height, val, 2) return y += line_height end #----------------------------------------------------------------------------- # Define wid #----------------------------------------------------------------------------- def wid self.width-(standard_padding*2) end #----------------------------------------------------------------------------- # Enable ALL Icons (make opacity = 255) #----------------------------------------------------------------------------- def all_icons_enable? return true end #----------------------------------------------------------------------------- # Draw Status Page Info #----------------------------------------------------------------------------- def draw_status_inf x = 0 ; y = 0 for info in SPDS::Info[@page] case info[0] when :header then y = draw_header(x,y,info[1],info[2],info[3],info[4]) when :param then y = draw_parameters(x,y,info[1],info[2],info[3],info[4]) when :x_param then y = draw_xparameters(x,y,info[1],info[2],info[3],info[4]) when :s_param then y = draw_sparameters(x,y,info[1],info[2],info[3],info[4]) when :atk_ele next unless $D13x[:Elems_Control] y = draw_atk_eles(x,y,info[1],info[2],info[3],info[4]) when :def_ele next unless $D13x[:Elems_Control] y = draw_def_eles(x,y,info[1],info[2],info[3],info[4]) when :atk_lev next unless $D13x[:Atk_Def_Lvs] y = draw_atk_level(x,y,info[1],info[2],info[3],info[4]) when :def_lev next unless $D13x[:Atk_Def_Lvs] y = draw_def_level(x,y,info[1],info[2],info[3],info[4]) when :tp_info next unless $D13x[:TP_Control] y = draw_tp_info(x,y,info[1],info[2],info[3],info[4]) end end end #----------------------------------------------------------------------------- # Draw Attack Level #----------------------------------------------------------------------------- def draw_atk_level(x,y,i,col,icon,hue) contents.fill_rect(x,y+1,wid,line_height-2,Color.new(0,0,0,64)) x = draw_stat_icons(icon, x, y, hue,all_icons_enable?) text = Atl_Dfl::Atl_Name change_color(col) draw_text(x, y, wid, line_height, text) val = sprintf("%s", @actor.atl.to_i) change_color(Text_Color::White) unless SPDS::Values_Colored draw_text(x, y, wid-34, line_height, val, 2) return y += line_height end #----------------------------------------------------------------------------- # Draw Defence Level #----------------------------------------------------------------------------- def draw_def_level(x,y,i,col,icon,hue) contents.fill_rect(x,y+1,wid,line_height-2,Color.new(0,0,0,64)) x = draw_stat_icons(icon, x, y, hue,all_icons_enable?) text = Atl_Dfl::Dfl_Name change_color(col) draw_text(x, y, wid, line_height, text) val = sprintf("%s", @actor.dfl.to_i) change_color(Text_Color::White) unless SPDS::Values_Colored draw_text(x, y, wid-34, line_height, val, 2) return y += line_height end #----------------------------------------------------------------------------- # Draw TP Info #----------------------------------------------------------------------------- def draw_tp_info(x,y,i,col,icon,hue) contents.fill_rect(x,y+1,wid,line_height-2,Color.new(0,0,0,64)) x = draw_stat_icons(icon, x, y, hue,all_icons_enable?) text = Vocab::Tp change_color(col) draw_text(x, y, wid, line_height, text) val = sprintf("%s", @actor.maximum_tp.to_i) change_color(Text_Color::White) unless SPDS::Values_Colored draw_text(x, y, wid-34, line_height, val, 2) return y += line_height end end #=============================================================================== class Window_SPDSStatusCHANGES < Window_Selectable #=============================================================================== #----------------------------------------------------------------------------- # Initialization #----------------------------------------------------------------------------- def initialize(actor, y) super(Graphics.width/4*3, y, Graphics.width/4, Graphics.height-y) @page = nil @actor = actor @temp_actor = Marshal.load(Marshal.dump(@actor)) @dis_window = nil self.opacity = 0 refresh end #----------------------------------------------------------------------------- # Set Actor #----------------------------------------------------------------------------- def actor=(actor) return if @actor == actor @actor = actor @temp_actor = Marshal.load(Marshal.dump(@actor)) refresh end #----------------------------------------------------------------------------- # Set Dis Window #----------------------------------------------------------------------------- def dis_window=(window) return if @dis_window == window @dis_window = window refresh end #----------------------------------------------------------------------------- # Get Future Stats #----------------------------------------------------------------------------- def future_stat return unless @dis_window @temp_actor = Marshal.load(Marshal.dump(@actor)) spds = @actor.spds_set page = SPDS::Commands[@dis_window.index] @temp_actor.spds_stat_mods(spds[page],@dis_window.index) if @dis_window.index >= 0 refresh end #----------------------------------------------------------------------------- # Get No Stats #----------------------------------------------------------------------------- def show_no_stats return unless @dis_window @temp_actor = Marshal.load(Marshal.dump(@actor)) refresh end #----------------------------------------------------------------------------- # Set Page #----------------------------------------------------------------------------- def page=(page) return if @page == page @page = page refresh end #----------------------------------------------------------------------------- # Refresh #----------------------------------------------------------------------------- def refresh contents.clear freshen draw_status_inf if @page end #----------------------------------------------------------------------------- # Refresh Fonts #----------------------------------------------------------------------------- def freshen if !General::Fonts.include?(self.contents.font.name) self.contents.font.name = General::Fonts end if self.contents.font.size != General::Font_Size self.contents.font.size = General::Font_Size end if self.contents.font.bold != General::Font_Bold self.contents.font.bold = General::Font_Bold end end #----------------------------------------------------------------------------- # Draw Parameters #----------------------------------------------------------------------------- def draw_parameters(x,y,i,col,icon,hue) contents.fill_rect(x,y+1,wid,line_height-2,Color.new(0,0,0,64)) change_color(col) change_color(Text_Color::White) unless SPDS::Values_Colored stat = @temp_actor.param(i) - @actor.param(i) if stat < 0 val = sprintf("%s", stat) elsif stat > 0 val = sprintf("+%s", stat) else val = SPDS::No_Change_Vocab end draw_text(x, y, wid, line_height, val, 1) return y += line_height end #----------------------------------------------------------------------------- # Draw Header #----------------------------------------------------------------------------- def draw_header(x,y,i,col,icon,hue) contents.fill_rect(x,y+1,wid,line_height-2,Color.new(0,0,0,64)) change_color(col) w = self.width - (standard_padding * 2 ) draw_text(x, y, w, line_height, SPDS::Changes_Vocab, 1) return y += line_height end #----------------------------------------------------------------------------- # Draw x Parameters #----------------------------------------------------------------------------- def draw_xparameters(x,y,i,col,icon,hue) contents.fill_rect(x,y+1,wid,line_height-2,Color.new(0,0,0,64)) change_color(col) change_color(Text_Color::White) unless SPDS::Values_Colored stat = @temp_actor.xparam(i) - @actor.xparam(i) if stat < 0 val = sprintf("%1.2f%%", stat*100) elsif stat > 0 val = sprintf("+%1.2f%%", stat*100) else val = SPDS::No_Change_Vocab end draw_text(x, y, wid, line_height, val, 1) return y += line_height end #----------------------------------------------------------------------------- # Draw sParameters #----------------------------------------------------------------------------- def draw_sparameters(x,y,i,col,icon,hue) contents.fill_rect(x,y+1,wid,line_height-2,Color.new(0,0,0,64)) change_color(col) stat = @temp_actor.sparam(i) - @actor.sparam(i) if stat < 0 val = sprintf("%1.2f%%", stat*100) elsif stat > 0 val = sprintf("+%1.2f%%", stat*100) else val = SPDS::No_Change_Vocab end change_color(Text_Color::White) unless SPDS::Values_Colored draw_text(x, y, wid, line_height, val, 1) return y += line_height end #----------------------------------------------------------------------------- # Draw Attack Elements #----------------------------------------------------------------------------- def draw_atk_eles(x,y,i,col,icon,hue) contents.fill_rect(x,y+1,wid,line_height-2,Color.new(0,0,0,64)) change_color(col) stat = @temp_actor.atk_element_rate(i) - @actor.atk_element_rate(i) if stat < 0 val = sprintf("%1.2f%%", stat*100) elsif stat > 0 val = sprintf("+%1.2f%%", stat*100) else val = SPDS::No_Change_Vocab end change_color(Text_Color::White) unless SPDS::Values_Colored draw_text(x, y, wid, line_height, val, 1) return y += line_height end #----------------------------------------------------------------------------- # Draw Defence Elements #----------------------------------------------------------------------------- def draw_def_eles(x,y,i,col,icon,hue) contents.fill_rect(x,y+1,wid,line_height-2,Color.new(0,0,0,64)) change_color(col) stat = @temp_actor.element_rate(i) - @actor.element_rate(i) if stat < 0 val = sprintf("%1.2f%%", stat*100) elsif stat > 0 val = sprintf("+%1.2f%%", stat*100) else val = SPDS::No_Change_Vocab end change_color(Text_Color::White) unless SPDS::Values_Colored draw_text(x, y, wid, line_height, val, 1) return y += line_height end #----------------------------------------------------------------------------- # Define wid #----------------------------------------------------------------------------- def wid self.width-(standard_padding*2) end #----------------------------------------------------------------------------- # Draw Status Page Info #----------------------------------------------------------------------------- def draw_status_inf x = 0 ; y = 0 for info in SPDS::Info[@page] case info[0] when :header then y = draw_header(x,y,info[1],info[2],info[3],info[4]) when :param then y = draw_parameters(x,y,info[1],info[2],info[3],info[4]) when :x_param then y = draw_xparameters(x,y,info[1],info[2],info[3],info[4]) when :s_param then y = draw_sparameters(x,y,info[1],info[2],info[3],info[4]) when :atk_ele next unless $D13x[:Elems_Control] y = draw_atk_eles(x,y,info[1],info[2],info[3],info[4]) when :def_ele next unless $D13x[:Elems_Control] y = draw_def_eles(x,y,info[1],info[2],info[3],info[4]) when :atk_lev next unless $D13x[:Atk_Def_Lvs] y = draw_atk_level(x,y,info[1],info[2],info[3],info[4]) when :def_lev next unless $D13x[:Atk_Def_Lvs] y = draw_def_level(x,y,info[1],info[2],info[3],info[4]) when :tp_info next unless $D13x[:TP_Control] y = draw_tp_info(x,y,info[1],info[2],info[3],info[4]) end end end #----------------------------------------------------------------------------- # Draw Attack Level #----------------------------------------------------------------------------- def draw_atk_level(x,y,i,col,icon,hue) contents.fill_rect(x,y+1,wid,line_height-2,Color.new(0,0,0,64)) change_color(col) stat = @temp_actor.atl - @actor.atl if stat < 0 val = "#{stat.to_i}" elsif stat > 0 val = "+#{stat.to_i}" else val = SPDS::No_Change_Vocab end change_color(Text_Color::White) unless SPDS::Values_Colored draw_text(x, y, wid, line_height, val, 1) return y += line_height end #----------------------------------------------------------------------------- # Draw Defence Level #----------------------------------------------------------------------------- def draw_def_level(x,y,i,col,icon,hue) contents.fill_rect(x,y+1,wid,line_height-2,Color.new(0,0,0,64)) change_color(col) stat = @temp_actor.dfl - @actor.dfl if stat < 0 val = "#{stat.to_i}" elsif stat > 0 val = "+#{stat.to_i}" else val = SPDS::No_Change_Vocab end change_color(Text_Color::White) unless SPDS::Values_Colored draw_text(x, y, wid, line_height, val, 1) return y += line_height end #----------------------------------------------------------------------------- # Draw TP Info #----------------------------------------------------------------------------- def draw_tp_info(x,y,i,col,icon,hue) contents.fill_rect(x,y+1,wid,line_height-2,Color.new(0,0,0,64)) change_color(col) stat = @temp_actor.max_tp - @actor.max_tp if stat < 0 val = "#{stat.to_i}" elsif stat > 0 val = "+#{stat.to_i}" else val = SPDS::No_Change_Vocab end change_color(Text_Color::White) unless SPDS::Values_Colored draw_text(x, y, wid, line_height, val, 1) return y += line_height end end #=============================================================================== class Window_SPDS_Blank < Window_Selectable #=============================================================================== #----------------------------------------------------------------------------- # Initialization #----------------------------------------------------------------------------- def initialize(y) super(Graphics.width/3, y, Graphics.width/3*2+1, Graphics.height - y) refresh end end #=============================================================================== class Window_SPDS_Gold_n_Time < Window_Base #=============================================================================== #----------------------------------------------------------------------------- # Object Initialization #----------------------------------------------------------------------------- def initialize(y,actor) @actor = actor super(0, y, Graphics.width/3, Graphics.height-y) refresh end #----------------------------------------------------------------------------- # Set Actor #----------------------------------------------------------------------------- def actor=(actor) return unless @actor != actor @actor = actor refresh end #----------------------------------------------------------------------------- # Refresh #----------------------------------------------------------------------------- def refresh contents.clear drAW_DE_INFO end #----------------------------------------------------------------------------- # Draw The Info #----------------------------------------------------------------------------- def drAW_DE_INFO y = 0 SPDS::IBox.each do |halp| case halp[0] when :gold then y = draw_degol(y,halp[1]) when :time then y = draw_detim(y,halp[1]) when :exp then y = draw_deexp(y,halp[1]) when :pts then y = draw_depts(y,halp[1]) end end end #----------------------------------------------------------------------------- # Draw The Gold #----------------------------------------------------------------------------- def draw_degol(y,halp) x = get_de_x(halp[0]) contents.fill_rect(0,y+1,wid,line_height-2,Color.new(0,0,0,64)) draw_de_icon(halp[0],0,y,halp[1], true) if halp[0] > 0 draw_text(x,y,wid,line_height, halp[2]) draw_text(0,y,wid-4,line_height, $game_party.gold.to_i ,2) return y += line_height end #----------------------------------------------------------------------------- # Draw The Time #----------------------------------------------------------------------------- def draw_detim(y,halp) t = Time.now x = get_de_x(halp[0]) contents.fill_rect(0,y+1,wid,line_height-2,Color.new(0,0,0,64)) draw_de_icon(halp[0],0,y,halp[1], true) if halp[0] > 0 text = "#{t.strftime("%H")}:#{t.strftime("%M")}:#{t.strftime("%S")}" draw_text(x,y,wid,line_height, halp[2]) draw_text(0,y,wid-4,line_height, text, 2) return y += line_height end #----------------------------------------------------------------------------- # Draw The Exp #----------------------------------------------------------------------------- def draw_deexp(y,halp) return y unless @actor x = get_de_x(halp[0]) contents.fill_rect(0,y+1,wid,line_height-2,Color.new(0,0,0,64)) draw_de_icon(halp[0],0,y,halp[1], true) if halp[0] > 0 text = "#{@actor.spendable_exp}" draw_text(x,y,wid,line_height, halp[2]) draw_text(0,y,wid-4,line_height, text, 2) return y += line_height end #----------------------------------------------------------------------------- # Draw The Points #----------------------------------------------------------------------------- def draw_depts(y,halp) return y unless @actor x = get_de_x(halp[0]) contents.fill_rect(0,y+1,wid,line_height-2,Color.new(0,0,0,64)) draw_de_icon(halp[0],0,y,halp[1], true) if halp[0] > 0 text = "#{@actor.points}" draw_text(x,y,wid,line_height, halp[2]) draw_text(0,y,wid-4,line_height, text, 2) return y += line_height end #----------------------------------------------------------------------------- # Get Width #----------------------------------------------------------------------------- def wid self.width - (standard_padding*2) end #----------------------------------------------------------------------------- # Get x Position #----------------------------------------------------------------------------- def get_de_x(icon) return 0 if icon <= 0 return 25 end end #=============================================================================== class Scene_Map < Scene_Base #=============================================================================== #----------------------------------------------------------------------------- # Alias List #----------------------------------------------------------------------------- alias :updat_SPDSFLAG :update_scene #----------------------------------------------------------------------------- # Update Scene Transition #----------------------------------------------------------------------------- def update_scene updat_SPDSFLAG start_SPDS unless scene_changing? end #----------------------------------------------------------------------------- # Update Scene Transition (To SPDS) #----------------------------------------------------------------------------- def start_SPDS actor = $game_party.check_need_spds? if actor != nil SceneManager.call(Scene_SPDS) SceneManager.scene.prepare(actor) end end end #=============================================================================== class Scene_Menu < Scene_MenuBase #=============================================================================== #----------------------------------------------------------------------------- # Alias List #----------------------------------------------------------------------------- alias :spdsmenu_create_command_window :create_command_window alias :opok_spds_SM :on_personal_ok #----------------------------------------------------------------------------- # Create Command Window #----------------------------------------------------------------------------- def create_command_window spdsmenu_create_command_window @command_window.set_handler(:distribute, method(:command_personal)) end #----------------------------------------------------------------------------- # On Personal Ok #----------------------------------------------------------------------------- def on_personal_ok opok_spds_SM call_distriute if @command_window.current_symbol == :distribute end #----------------------------------------------------------------------------- # Call SPDS Scene #----------------------------------------------------------------------------- def call_distriute actor = $game_party.members[@status_window.index] return @command_window.activate if !actor.can_distribute? SceneManager.call(Scene_SPDS) SceneManager.scene.prepare(actor) end end #=============================================================================== class Scene_SPDS < Scene_MenuBase #=============================================================================== #----------------------------------------------------------------------------- # Prepare #----------------------------------------------------------------------------- def prepare(actor) @real_actor = actor @actor = @real_actor end #----------------------------------------------------------------------------- # Start Processing #----------------------------------------------------------------------------- def start super @actor = @real_actor create_command_window create_help_window create_SPDS_window create_distribute_list make_ibox_window update_windows end #----------------------------------------------------------------------------- # Create Command Window #----------------------------------------------------------------------------- def create_command_window @command_window = Window_SPDSCommand.new(0,0) @command_window.set_handler(:cancel, method(:return_scene)) @command_window.set_handler(:pagedown, method(:next_actor)) @command_window.set_handler(:pageup, method(:prev_actor)) @command_window.set_handler(:pageup, method(:prev_actor)) @command_window.set_handler(:spend, method(:spend_pts)) @command_window.set_handler(:exit, method(:return_scene)) @fake_command_window = Window_SPDSCommandII.new(0,0) @fake_command_window.deactivate end #----------------------------------------------------------------------------- # Create Halp Window #----------------------------------------------------------------------------- def create_help_window @help_window = Deki_Help.new @help_window.viewport = @viewport @help_window.x = Graphics.width / 4 end #----------------------------------------------------------------------------- # Create SPDS Window #----------------------------------------------------------------------------- def create_SPDS_window y = @help_window.height @status_window = Window_StatusSPDS.new(@actor, y) y = (@status_window.y+@status_window.height) @blank_window = Window_SPDS_Blank.new(y) @SPDS_window = Window_SPDSStatus.new(@actor, y) end #----------------------------------------------------------------------------- # Create Distribution List #----------------------------------------------------------------------------- def create_distribute_list y = @status_window.y + @status_window.height @dis_window = Window_SPDS_DistributeCommand.new(0,y) @dis_window.set_handler(:spend_pts, method(:spend_dis_point)) @dis_window.set_handler(:end_distribute, method(:cancel_spend)) @dis_window.set_handler(:cancel, method(:cancel_spend)) @dis_window.actor = @actor if @actor @dis_window.index = -1 # << Changes Window @temp_act_SPDS_Window = Window_SPDSStatusCHANGES.new(@actor, y) @temp_act_SPDS_Window.dis_window = @dis_window end #----------------------------------------------------------------------------- # Make IBox Window #----------------------------------------------------------------------------- def make_ibox_window y = @status_window.y+@status_window.height+@dis_window.height @gold_time_wind = Window_SPDS_Gold_n_Time.new(y,@actor) @ibox_time = Time.now.sec end #----------------------------------------------------------------------------- # Change Actors #----------------------------------------------------------------------------- def on_actor_change @temp_act_SPDS_Window.actor = @actor @gold_time_wind.actor = @actor @status_window.actor = @actor @SPDS_window.actor = @actor @dis_window.actor = @actor @command_window.activate end #----------------------------------------------------------------------------- # Spend Points #----------------------------------------------------------------------------- def spend_pts @command_window.deactivate @command_window.index = -1 @dis_window.activate @dis_window.index = 0 @temp_act_SPDS_Window.future_stat end #----------------------------------------------------------------------------- # Cancel Spend Points #----------------------------------------------------------------------------- def cancel_spend @dis_window.deactivate @dis_window.index = -1 @temp_act_SPDS_Window.future_stat @command_window.activate @command_window.index = 0 end #----------------------------------------------------------------------------- # Confirm Spend Points #----------------------------------------------------------------------------- def spend_dis_point spds = @actor.spds_set page = SPDS::Commands[@dis_window.index] @actor.spds_stat_mods(spds[page],@dis_window.index) @temp_act_SPDS_Window.future_stat @gold_time_wind.refresh @SPDS_window.refresh @status_window.refresh @dis_window.refresh @dis_window.activate end #----------------------------------------------------------------------------- # Update #----------------------------------------------------------------------------- def update super update_windows update_gold_n_time end #----------------------------------------------------------------------------- # Update windows #----------------------------------------------------------------------------- def update_windows update_fake_command @SPDS_window.page = @fake_command_window.get_page_id @temp_act_SPDS_Window.page = @fake_command_window.get_page_id if @dis_window.active @help_window.set_text(@dis_window.get_command_help) if @dis_window.current_symbol == :end_distribute @temp_act_SPDS_Window.show_no_stats end else @help_window.set_text(@actor.description) if @actor end update_dis_window end #----------------------------------------------------------------------------- # Update Fake Command Window #----------------------------------------------------------------------------- def update_fake_command max_page = SPDS::Max_Pages-1 if Input.trigger?(:RIGHT) @fake_command_window.index += 1 if @fake_command_window.index <= max_page end if Input.trigger?(:LEFT) @fake_command_window.index -= 1 if @fake_command_window.index >= 0 end @fake_command_window.index = 0 if @fake_command_window.index > max_page @fake_command_window.index = max_page if @fake_command_window.index < 0 end #----------------------------------------------------------------------------- # Update dis Window #----------------------------------------------------------------------------- def update_dis_window return unless @dis_window.active return unless @dis_window.current_symbol != :end_distribute return unless Input.trigger?(:DOWN) || Input.trigger?(:UP) @temp_act_SPDS_Window.future_stat end #----------------------------------------------------------------------------- # Update Gold / Time Window #----------------------------------------------------------------------------- def update_gold_n_time return unless SPDS::Showing_Time return unless @ibox_time != Time.now.sec @gold_time_wind.refresh @ibox_time = Time.now.sec end #----------------------------------------------------------------------------- # Create Backgrounds #----------------------------------------------------------------------------- def get_all_bgs return unless $D13x[:Scene_BGs] @bg_set = SPDS::BGs end end #==============================================================================# # http://dekitarpg.wordpress.com/ # #==============================================================================# end # if true # << Make true to use this script, false to disable.