Dekita

ispds 1.5

Mar 29th, 2014
4,157
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Insane Stat Point Distribution System
  5. # -- Author : Dekita
  6. # -- Version : 1.5
  7. # -- Level : Hard / Insane
  8. # -- Requires : $D13x Core v2.0+
  9. # : You, To Read ALL Instructions CAREFULLY !!
  10. # -- Engine : RPG Maker VX Ace.
  11. #
  12. #===============================================================================
  13. # ☆ Import
  14. #-------------------------------------------------------------------------------
  15. $D13x={}if$D13x==nil
  16. $D13x[:ISPDS] = true
  17. #===============================================================================
  18. # ☆ Updates
  19. #-------------------------------------------------------------------------------
  20. # D /M /Y
  21. # 29/o3/2o14 - Use R/L Shift to change pages,
  22. # 17/o3/2o14 - HUGE Efficiency Update,
  23. # - Added Text Color for parent stat names,
  24. # 21/o2/2o14 - Bugfixx, (Max TP mods bug),
  25. # 18/06/2o13 - Bugfixx, (Enemy HP/MP Increase)
  26. # 31/o5/2o13 - Added More Help Info For Script Calls,
  27. # - Added .reset_some_points(STAT_ID, VALUE) Script Call,
  28. # 29/o5/2o13 - Finished Script, (v1.0)
  29. # - Slight Reposition of HP/MP/TP/EXP Gauges,
  30. # - Added Menu Customisation,
  31. # 28/o5/2o13 - Bugfix, (Changing Class Not Re-Calculating Stat Values)
  32. # - Compatibility, (WindowSkins && Scene BGs)
  33. # - Added IBox Window,
  34. # 22/o5/2o13 - Added Max Limit For Each Stat,
  35. # - Improved Windows Display,
  36. # - Compatibility, (TP Control)
  37. # 21/o5/2o13 - Finished Advanced Features,
  38. # - Compatibility, (Atk/Def Lv)
  39. # 19/o5/2o13 - Beta Phase Begin, (v0.9)
  40. # - Finished Script Base,
  41. # 1o/o4/2o13 - Started,
  42. #
  43. #===============================================================================
  44. # ☆ Instructions !!
  45. #-------------------------------------------------------------------------------
  46. # Place Below >>
  47. # " ▼ Materials "
  48. # " $D13x Statistic Control "
  49. # " $D13x Elements Control "
  50. # " $D13x Max TP Control "
  51. # " $D13x Atk | Def Lvls "
  52. # Place Above >>
  53. # " ▼ Main "
  54. # " $D13x Equipment Sets "
  55. # " $D13x Learn Skill Reqs "
  56. # " $D13x Equip Reqs "
  57. #
  58. # Placing these script in this order will prevent bugs / faults / FPS drop.
  59. #
  60. # This script will NOT work without at least 1 of the following scripts...
  61. # $D13x - Statistic Control v1.5+ - Enables Param/s-Param/x-Param's Distribution
  62. # $D13x - Elements Control v1.0+ - Enables Atk/Def Elements Distribution
  63. # $D13x - Max TP Control v1.0+ - Enables Max TP Distribution.
  64. # $D13x - Atk | Def Levels v1.0+ - Enables Atk/Def Level Distribution
  65. # You can use all of the above scripts in conjunction with each other
  66. #
  67. # Please Note : This list could be updated at any time !!
  68. #
  69. #===============================================================================
  70. # ☆ Introduction
  71. #-------------------------------------------------------------------------------
  72. # I have a dream...
  73. # I dream of a game where my characters growth is in my control...
  74. # A game where my choices mean everything...
  75. # Where a slight mistake can mean the end of all life...
  76. # I dream of a game that i can design my own character, while playing...
  77. # A game that i can customize my character to suit my playing style...
  78. # That not only allows creativity, but rewards it...
  79. # I dream...
  80. # Of a game...
  81. # Made by this script...
  82. #
  83. # This script allows the creation of MULTIPLE HIGHLY UNIQUE && DYNAMIC
  84. # Stat Distribution Systems...
  85. # It not only provides you with new "parent" stats, that control ANY other
  86. # statistics, it actually allows you to then distribute them !!
  87. #
  88. # EASILY set up a basic distribution system.
  89. # ELEMENT DISTRIBUTION SYSTEM ? Look No Further !!
  90. # Distribute Maximum TP with ease..
  91. # Set up your very own unique distribution system with no scripting knowledge !!
  92. # ( Requires ability to read instructions )
  93. #
  94. #===============================================================================
  95. # ☆ Features
  96. #-------------------------------------------------------------------------------
  97. # - UNLIMITED New Parent Stats that give you control over ALL other stats.
  98. # - Multiple ways to modify ALL of your newly created stats.
  99. # - Use your new stats in SKILL FORMULA's and CONDITIONAL BRANCHES.
  100. # - HIGHLY Informative Distribution Screen (Fully Customisable).
  101. # - Multiple Growth Set-ups (each actor can grow differently).
  102. # ^- Each Growth Set-up can have a completetly unique setup
  103. # Than an other, things like name, cost, stat changes...
  104. # - Highly Complex && Unique Stat Handling System (FULLY LAG FREE)
  105. # - Easily Distribute All Statistics (listed below)
  106. # ^- Params << Requires $D13x Statistic Control.
  107. # ^- x-Params << Requires $D13x Statistic Control.
  108. # ^- s-Params << Requires $D13x Statistic Control.
  109. # ^- Attack Elements << Requires $D13x Elements Control.
  110. # ^- Defence Elements << Requires $D13x Elements Control.
  111. # ^- Atk | Def Levels << Requires $D13x Atk | Def Level.
  112. # ^- Max TP Limit << Requires $D13x Max TP Control.
  113. # - Spend DP (distribution points), Gold and even Exp to gain stats.
  114. # - A Smile On Your Face ( Money Back Guarantee !! )
  115. #
  116. # And If That Was'nt Enough...
  117. # you can pair this script with multiple scripts from the $D13x Engine...
  118. #
  119. # - Skill Levels
  120. # ^- Give a parent stat to a skill and the value will increase
  121. # using the skill levels DMG Multi.
  122. #
  123. # - Dev Stat Lv Up Distribution
  124. # ^- ability to distribute your new parent stats via level up
  125. # (could be used for actors who cannot access distribution screen)
  126. #
  127. # - Equipment Sets
  128. # ^- Control new parent stats as a set bonus for an equipment set.
  129. #
  130. # - Learn Skill Requirements
  131. # ^- Use new parent stats as skill learning requirements.
  132. #
  133. # - Equipment Requirements
  134. # ^- Use new parent stats as requirements for equipping equipment.
  135. #
  136. # NOTE:
  137. # If using Exp to increase statistics, you are only able to use the actors
  138. # "spare exp", spare exp is the exp you have gained above the required
  139. # exp for your current level, but is still below the required exp for next level.
  140. # This means that your actor cannot decrease their level distributing stats.
  141. #
  142. #===============================================================================
  143. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  144. #===============================================================================
  145. # 1. You MUST give credit to "Dekita" !!
  146. # 2. You are NOT allowed to repost this script.(or modified versions)
  147. # 3. You are NOT allowed to convert this script.
  148. # 4. You are NOT allowed to use this script for Commercial games.
  149. # 5. ENJOY!
  150. #
  151. # "FINE PRINT"
  152. # By using this script you hereby agree to the above terms and conditions,
  153. # if any violation of the above terms occurs "legal action" may be taken.
  154. # Not understanding the above terms and conditions does NOT mean that
  155. # they do not apply to you.
  156. # If you wish to discuss the terms and conditions in further detail you can
  157. # contact me at http://dekitarpg.wordpress.com/
  158. #
  159. #===============================================================================
  160. # ☆ Script Calls
  161. #-------------------------------------------------------------------------------
  162. # $game_actors[ACTOR_ID].add_spds_stats(STAT_ID, VALUE)
  163. # $game_actors[ACTOR_ID].sub_spds_stats(STAT_ID, VALUE)
  164. # $game_actors[ACTOR_ID].div_spds_stats(STAT_ID, VALUE)
  165. # $game_actors[ACTOR_ID].mul_spds_stats(STAT_ID, VALUE)
  166. # $game_actors[ACTOR_ID].mod_spds_stats(STAT_ID, VALUE)
  167. # ^- Script calls to change parent stat values
  168. #
  169. # There is also a third arguement for all the above script calls,
  170. # it is a boolean arguement to determine if the player should be refreshed.
  171. # eg.. $game_actors[1].add_spds_stats(0, 5, false)
  172. # this is very helpfull for maintaining FPS when adding LOTS of stats..
  173. # The default to this arguemet is true.
  174. # If you don't understand what this mean, just disregard this information :)
  175. #
  176. #-------------------------------------------------------------------------------
  177. # $game_actors[ACTOR_ID].parent_stat(STAT_ID)
  178. # ^- Script call to check the value of a parent stat.
  179. #
  180. #-------------------------------------------------------------------------------
  181. # $game_actors[ACTOR_ID].get_total_spds_stats
  182. # ^- Script call to check the total value of all parent stats.
  183. #
  184. #-------------------------------------------------------------------------------
  185. # $game_actors[ACTOR_ID].gain_points(VALUE)
  186. # $game_actors[ACTOR_ID].reduce_points(VALUE)
  187. # ^- Script calls to change available distribution points
  188. #
  189. #-------------------------------------------------------------------------------
  190. # $game_actors[ACTOR_ID].points
  191. # ^- Script call to check the value of available distribution points.
  192. #
  193. #-------------------------------------------------------------------------------
  194. # $game_actors[ACTOR_ID].reset_all_points(false)
  195. # $game_actors[ACTOR_ID].reset_all_points(true)
  196. # $game_actors[ACTOR_ID].reset_all_points
  197. # ^- Script calls to reset all used distribution points,
  198. # if arguement is false points will not be returned.
  199. # if true then all spent points will be returned.
  200. # Default arguement is true.
  201. # NOTE: Does Not Support Gold && Exp Cost Formulas.
  202. #
  203. #-------------------------------------------------------------------------------
  204. # $game_actors[ACTOR_ID].reset_some_points(STAT_ID, VALUE)
  205. # ^- Same as above but only reduces points from STAT_ID by VALUE and then
  206. # returns the spent points.
  207. # NOTE: Does Not Support Gold && Exp Cost Formulas.
  208. #
  209. #-------------------------------------------------------------------------------
  210. # $game_actors[ACTOR_ID].change_spds_set_id_to(STAT_SET_ID)
  211. # ^- Script call to change Distribution Set ID
  212. #
  213. #-------------------------------------------------------------------------------
  214. # ACTOR_ID = The database id for the actor
  215. # STAT_ID = The id of the parent stat you wish to increase
  216. # VALUE = The value to change this stat
  217. # STAT_SET_ID = The id of the distribution stat set to change to.
  218. #
  219. #===============================================================================
  220. # ☆ Notetags ( default )
  221. #-------------------------------------------------------------------------------
  222. # <SPDS: X>
  223. # Replace X with the SPDS::Stat_Set id for that actor / class / enemy
  224. #
  225. #-------------------------------------------------------------------------------
  226. # <DPts: X>
  227. # Replace X with the value for an actors initial available distribution points.
  228. # Alternativley, give this notetag to enemies and X distribution points
  229. # will be evenly devided between each alive battle member :)
  230. #
  231. #-------------------------------------------------------------------------------
  232. # <no spds>
  233. # Give this notetag to actors who should not be taken to distribution screen
  234. # on level up.. eg, actor's that the player has no control over...
  235. # Temporary party members and the like..
  236. #
  237. #-------------------------------------------------------------------------------
  238. # <spds stat: STAT_ID, VALUE>
  239. # Use this notetag to increase parent stats.
  240. # give to actors, classes, enemies, equipment, skills, states...
  241. # STAT_ID = The id of the parent stat you wish to increase
  242. # VALUE = The value to change this stat
  243. #
  244. #-------------------------------------------------------------------------------
  245. # <all spds stat: VALUE>
  246. # Use this notetag to increase ALL parent stats by VALUE.
  247. # give to actors, classes, enemies, equipment, skills, states...
  248. #
  249. #-------------------------------------------------------------------------------
  250. # <spds stat limit: STAT_ID, VALUE>
  251. # give to actors, classes, enemies, equipment, skills, states...
  252. # STAT_ID = The id of the parent stat whose max value you wish to increase
  253. # VALUE = The value to change the maximum value this stat can reach
  254. #
  255. #===============================================================================
  256. # ☆ VERY Helpfull Info
  257. #-------------------------------------------------------------------------------
  258. # Q - What is the basis for a distribution system ?
  259. # A - The ability to add / remove statistics.
  260. # Although when you increase a stat, lets say Vitality (for example)
  261. # it may "increase" hp (along with other stats) but it DOES NOT actually
  262. # increase the HP parameter...
  263. # You may be thinking "Of course it does !!".
  264. # And you would be right... In most cases...
  265. # This script IS NOT most cases...
  266. # Instead of adding a PERMANENT stat, like most distribution systems,
  267. # this script instead adds 1 to a counter, ie a parent stat.
  268. # It then calculates how much each stat (params ect..) should increase
  269. # for each counter.
  270. # eg. if the counter (parent stat) was 5 and that parent
  271. # stat is set to increase hp by 10, the actor would get 50 (10 * 5)
  272. # TEMPORARILTY added to the stat.
  273. # This calculation gets done so frequently it has no effect on miscalulations.
  274. #
  275. # This method also provides MANY benefits compared to "Less Qualified"
  276. # Distribution systems...
  277. #
  278. # By Calculating stats this way it allows for more dynamic distribution.
  279. # For Example...
  280. # Actor 1 has 50 vit (parent stat 0)
  281. # Actor 1 is Class 1
  282. # Class 1 Has 1 base MHP
  283. # Class 1 Has Stat_Set id 0
  284. # Stat_Set id 0's vit modifies MHP by 10
  285. # Actor 1's MHP Becomes 501 (1 + (50 * 10))
  286. # Actor 1 Changes to Class 2
  287. # Class 2 Has 1 base MHP
  288. # Class 2 Has SPDS::Stat_Set id 1
  289. # Stat_Set id 1's vit modifies MHP by 5
  290. # Actor 1's MHP Becomes 251 (1 + (50 * 5))
  291. #
  292. # Another Advantage is that if you give equips/skills/states
  293. # parent stats, their stats will change accordingly based against
  294. # the actor/enemies' parent stat values, this of course means that...
  295. # if Actor 1 & 2 both have THE SAME equip but DIFFERENT Stat_Set's
  296. # Then the equip item will recognize that and only modify the params
  297. # based on the actors Stat_Set.
  298. #
  299. #===============================================================================
  300. # ☆ Statistic Help
  301. #-------------------------------------------------------------------------------
  302. # PARAMS : # XPARAMS : # SPARAMS : #
  303. # stat = id # stat = id # stat = id #
  304. # mhp = 0 # hit = 0 # tgr = 0 #
  305. # mmp = 1 # eva = 1 # grd = 1 #
  306. # atk = 2 # cri = 2 # rec = 2 #
  307. # def = 3 # cev = 3 # pha = 3 #
  308. # mat = 4 # mev = 4 # mcr = 4 #
  309. # mdf = 5 # mrf = 5 # tcr = 5 #
  310. # agi = 6 # cnt = 6 # pdr = 6 #
  311. # luk = 7 # hrg = 7 # mdr = 7 #
  312. # # mrg = 8 # fdr = 8 #
  313. # # trg = 9 # exr = 9 #
  314. #-------------------------------------------------------------------------------
  315. # Remember :
  316. # All Params work with integer values, eg. 1, 5, 123, 653, 198123
  317. # Atk | Def Levels && Max TP also work with integer values.
  318. # All x/s-Params work with float values, eg. 1.0, 0.5, 0.1, 0.05, 0.01
  319. # 1.0 = 100%, 0.01 = 1%,
  320. # Atk | Def Elements also work using percentage values (floats).
  321. #
  322. #===============================================================================
  323. module SPDS
  324. #===============================================================================
  325. Stat_Set={} # << Keep
  326. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  327. # ☆ General Settings
  328. #-----------------------------------------------------------------------------
  329. # Format = [:cmnd , 'Name'],
  330. Main_Commands =[
  331. [:spend, 'Distribute'],
  332. [:exit, 'Leave'],
  333. ]
  334. #-----------------------------------------------------------------------------
  335. # Max Amount Of Parent Stats Allowed,
  336. # Parent Stat id begin at 0, if the max was 4 their id's would be
  337. # 0, 1, 2 & 3 << always remember this.
  338. # If you try to access a parent stat that is higher than the max stat
  339. # you will get error messages !
  340. Max_Parent_Stats = 8
  341. #-----------------------------------------------------------------------------
  342. # Number of visible distribution commands shown in distribution selection
  343. # window.
  344. Visible_Distribution_Commands = 9
  345. #-----------------------------------------------------------------------------
  346. # Finish Command Vocab, Format = ["Command Name", "Help Text"]
  347. Finish_Data = ['Finish', "Return To Command Window."]
  348. #-----------------------------------------------------------------------------
  349. # Allow Finish Command To Be Visible ? (distribution command window)
  350. Allow_Finish = true
  351. #-----------------------------------------------------------------------------
  352. # Vocab Used For Changes Header.
  353. Changes_Vocab = "Changes:"
  354. #-----------------------------------------------------------------------------
  355. # Vocab Used When No Future Change Will Happen (shown in Changes Window)
  356. No_Change_Vocab = "-"
  357. #-----------------------------------------------------------------------------
  358. # Distribution Points Vocab
  359. DP_Vocab = ["DP: ", "Distribution Points"]
  360. #-----------------------------------------------------------------------------
  361. # Max Distribution Points
  362. Max_Points = 999
  363. #-----------------------------------------------------------------------------
  364. # Vocab for when distribution points are gained from an enemy.
  365. # NOTE: points gained will be divided between ALIVE BATTLE MEMBERS !!
  366. Gain_Pts_Vocab = "%s Has Gained %s %s."
  367. #-----------------------------------------------------------------------------
  368. # Here is where you change the menu settings for the distribution scene,
  369. # the format = [Visible?, "VOCAB", Switch]
  370. # make visible true to add a new distribute command to the main menu,
  371. # change the vocab to suit your needs.
  372. # Switch is the id of the switch to disable/enable the menu command
  373. # leave 0 to always enable command.
  374. Menu_Info = [true, "Distribute", 0]
  375. #-----------------------------------------------------------------------------
  376. # Show distribution screen automatically when actor levels ?
  377. Show_Screen = false
  378.  
  379. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  380. # ☆ Page Settings
  381. #-----------------------------------------------------------------------------
  382. # This is where you adjust what information is shown on each page
  383. # the options are :
  384. # [:header, "FOR DISPLAYING TEXT LIKE THIS" , icon, hue, alignment],
  385. # [:spds_stat, stat id],
  386. # [:param, param_id],
  387. # [:x_param, xparam_id],
  388. # [:s_param, sparam_id],
  389. # [:atk_ele, element_id],
  390. # [:def_ele, element_id],
  391. # [:atk_lev],
  392. # [:def_lev],
  393. # [:tp_info],
  394. # NOTE :
  395. # If icon is 0 the text will be positioned where the icon would have been.
  396. # Use Left + Right to switch pages
  397. #-----------------------------------------------------------------------------
  398. # Values have same coloring as main text ?
  399. Values_Colored = true
  400. #-----------------------------------------------------------------------------
  401. # Show Icons ?
  402. Use_Icons = true
  403. #-----------------------------------------------------------------------------
  404. # Page Turn Audio Settings , Format = ["Sound\\File\\Name", Volume, Pitch]
  405. Page_Turn_Noise = ["Audio\\SE\\Book1", 80, "80+rand(50)"]
  406. #-----------------------------------------------------------------------------
  407. # Begin Info Hash. See Above for Detailed Instructions..
  408. Info={
  409. :page_1=>[
  410. # [:header, "Parameter Info :", Text_Color::White,0,0,1],
  411. [:param, 0, Text_Color::White, 10, 200],
  412. [:param, 1, Text_Color::White, 10, 0],
  413. [:tp_info, 7, Text_Color::White, 10, 0],
  414. [:spds_stat, 0],
  415. [:spds_stat, 1],
  416. [:spds_stat, 2],
  417. [:spds_stat, 3],
  418. [:x_param, 7],
  419. [:x_param, 8],
  420. [:atk_lev],
  421. [:def_lev],
  422. ],
  423. :page_2=>[
  424. [:atk_lev],
  425. [:def_lev],
  426. [:param, 2],
  427. [:param, 3],
  428. [:s_param, 6],
  429. [:param, 4],
  430. [:param, 5],
  431. [:s_param, 7],
  432. [:s_param, 1],
  433. ],
  434. :page_3=>[
  435. [:x_param, 0],
  436. [:x_param, 2],
  437. [:x_param, 1],
  438. [:x_param, 3],
  439. [:x_param, 4],
  440. [:x_param, 5],
  441. [:x_param, 6],
  442. [:s_param, 2],
  443. [:s_param, 3],
  444. ],
  445. :page_4=>[
  446. [:atk_ele, 1],
  447. [:atk_ele, 3],
  448. [:atk_ele, 4],
  449. [:atk_ele, 5],
  450. [:atk_ele, 6],
  451. [:atk_ele, 7],
  452. [:atk_ele, 8],
  453. [:atk_ele, 9],
  454. [:atk_ele, 10],
  455. ],
  456. :page_5=>[
  457. [:def_ele, 1],
  458. [:def_ele, 3],
  459. [:def_ele, 4],
  460. [:def_ele, 5],
  461. [:def_ele, 6],
  462. [:def_ele, 7],
  463. [:def_ele, 8],
  464. [:def_ele, 9],
  465. [:def_ele, 10],
  466. ],
  467. :page_6=>[
  468. [:header, "Extra Stats", Text_Color::White,0,0,1],
  469. ],
  470. } # << End Page's Settings
  471. #-----------------------------------------------------------------------------
  472. # Max Pages To Show, Never Have Below 1.
  473. Max_Pages = 5
  474.  
  475. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  476. # ☆ Info-Box Settings
  477. #-----------------------------------------------------------------------------
  478. # the info box is a small box located in the bottom left of the distribution
  479. # screen. It can ony be seen if there are less than 9 visible commands.
  480. # :info=>[ icon, hue, "Text" ],
  481. IBox={
  482. :pts => [ 363, 90, "DP:"],
  483. :gold => [ 361, 0, "Gold :"],
  484. :time => [ 29 , 0, "Time :"],
  485. # :exp => [ 362, 180, "Spare Exp :"],
  486. }
  487. #-----------------------------------------------------------------------------
  488. # If :time is being shown make this setting = true
  489. # this will make the time be refreshed each second.
  490. # By default it is false to reduce system power usage.
  491. Showing_Time = false
  492.  
  493. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  494. # ☆ Distribution Settings Begin
  495. #-----------------------------------------------------------------------------
  496. # :pts_on_lv = How many points are gained on level up.
  497. # :extra_pts = Extra Points Gained.
  498. # :xtra_p_lv = [Array of levels that :extra_pts are gained on].
  499. # STAT ID = {Hash of information for this stat}.
  500. # ^- :name = The name displayed on distribution screen.
  501. # ^- :icon = [icon_id, hue, enable]
  502. # ^- :help = "Help Window Text Settings"
  503. # ^- :cost = [:type, "cost formula"]
  504. # ^- [:points, "1"],
  505. # ^- [:gold, "10"],
  506. # ^- [:exp, "(@level * 4) / (parent_stat(0)/100).to_i"],
  507. # ^- ### NOTE: :gold && :exp Costs are in Beta Phase !! ###
  508. # ^- :limit= > Max Value This Stat Can Reach (before other modifications).
  509. # ^- :mods = [Array of information storing this stats statistic mods]
  510. # ^- [:add_param , id, value],
  511. # ^- [:sub_param , id, value],
  512. # ^- [:div_param , id, value],
  513. # ^- [:mul_param , id, value],
  514. # ^- [:mod_param , id, value],
  515. # ^- [:add_xparam , id, value],
  516. # ^- [:sub_xparam , id, value],
  517. # ^- [:div_xparam , id, value],
  518. # ^- [:mul_xparam , id, value],
  519. # ^- [:mod_xparam , id, value],
  520. # ^- [:add_sparam , id, value],
  521. # ^- [:sub_sparam , id, value],
  522. # ^- [:div_sparam , id, value],
  523. # ^- [:mul_sparam , id, value],
  524. # ^- [:mod_sparam , id, value],
  525. # ^- [:add_atk_ele , id, value],
  526. # ^- [:sub_atk_ele , id, value],
  527. # ^- [:div_atk_ele , id, value],
  528. # ^- [:mul_atk_ele , id, value],
  529. # ^- [:mod_atk_ele , id, value],
  530. # ^- [:add_def_ele , id, value],
  531. # ^- [:sub_def_ele , id, value],
  532. # ^- [:div_def_ele , id, value],
  533. # ^- [:mul_def_ele , id, value],
  534. # ^- [:mod_def_ele , id, value],
  535. # ^- [:add_atl , value],
  536. # ^- [:sub_atl , value],
  537. # ^- [:div_atl , value],
  538. # ^- [:mul_atl , value],
  539. # ^- [:mod_atl , value],
  540. # ^- [:add_dfl , value],
  541. # ^- [:sub_dfl , value],
  542. # ^- [:div_dfl , value],
  543. # ^- [:mul_dfl , value],
  544. # ^- [:mod_dfl , value],
  545. # ^- [:add_mtp , value],
  546. # ^- [:sub_mtp , value],
  547. # ^- [:div_mtp , value],
  548. # ^- [:mul_mtp , value],
  549. # ^- [:mod_mtp , value],
  550. #-----------------------------------------------------------------------------
  551. # ☆ Distribution Setup 0 Begin
  552. #-----------------------------------------------------------------------------
  553. Stat_Set[0]={# << Begin
  554. :pts_on_lv => 1,
  555. :extra_pts => 5,
  556. :xtra_p_lv => [10,25,50,100],
  557. 0=>{
  558. :name => "Vitality",
  559. :icon => [101, 0, true],
  560. :text => Text_Color::White,
  561. :help => "Increases Vitality.",
  562. :cost => [:points, "1"],
  563. :limit => 255,
  564. :mods =>[
  565. [:add_param , 0, 9.5],
  566. [:add_param , 3, 0.4],
  567. [:add_param , 5, 0.4],
  568. [:add_xparam, 3, 0.001],
  569. [:add_xparam, 7, 0.0005],
  570. [:add_sparam, 0, 0.013],
  571. [:add_sparam, 1, 0.013],
  572. [:add_sparam, 6, -0.00025],
  573. [:add_sparam, 7, -0.00025],
  574. [:add_mtp , 105],
  575. ],
  576. },
  577. 1=>{
  578. :name => "Strength",
  579. :icon => [102, 0, true],
  580. :text => Text_Color::White,
  581. :help => "Increases Strength.",
  582. :cost => [:points, "1"],
  583. :limit => 255,
  584. :mods =>[
  585. [:add_param , 2, 1.2],
  586. [:add_param , 3, 0.6],
  587. [:add_param , 4, -0.01],
  588. [:add_param , 5, -0.01],
  589. [:add_param , 7, 0.1],
  590. [:add_xparam, 6, 0.0005],
  591. [:add_sparam, 0, 0.0009],
  592. [:add_sparam, 1, 0.005],
  593. [:add_sparam, 6, -0.002],
  594. # [:add_atl , 0.25],
  595. ],
  596. },
  597. 2=>{
  598. :name => "Dexterity",
  599. :icon => [103, 0, true],
  600. :text => Text_Color::White,
  601. :help => "Increases Dexterity.",
  602. :cost => [:points, "1"],
  603. :limit => 255,
  604. :mods =>[
  605. [:add_param , 6, 1.2],
  606. [:add_param , 7, 0.6],
  607. [:add_xparam, 0, 0.005],
  608. [:add_xparam, 1, 0.0005],
  609. [:add_xparam, 2, 0.001],
  610. [:add_xparam, 3, 0.0005],
  611. [:add_xparam, 4, 0.00025],
  612. [:add_xparam, 6, 0.0002],
  613. [:add_xparam, 9, 0.0005],
  614. [:add_sparam, 5, -0.0025],
  615. ],
  616. },
  617. 3=>{
  618. :name => "Magic",
  619. :icon => [104, 0, true],
  620. :text => Text_Color::White,
  621. :help => "Increases Magic.",
  622. :cost => [:points, "1"],
  623. :limit => 255,
  624. :mods =>[
  625. [:add_param , 1, 9.5],
  626. [:add_param , 2, -0.01],
  627. [:add_param , 3, -0.01],
  628. [:add_param , 4, 1.2],
  629. [:add_param , 5, 0.6],
  630. [:add_param , 7, 0.1],
  631. [:add_xparam, 4, 0.001],
  632. [:add_xparam, 8, 0.0005],
  633. [:add_sparam, 1, -0.004],
  634. [:add_sparam, 4, -0.0025],
  635. [:add_sparam, 7, -0.002],
  636. # [:add_atl , 0.25],
  637. ],
  638. },
  639. }# << End Stat_Set[0]
  640. #-----------------------------------------------------------------------------
  641. # ☆ Distribution Setup 0 End
  642. #-----------------------------------------------------------------------------
  643. # ☆ Distribution Setup 1 Begin
  644. #-----------------------------------------------------------------------------
  645. Stat_Set[1]={# << Begin
  646. :pts_on_lv => 1,
  647. :extra_pts => 5,
  648. :xtra_p_lv => [5,10,15,20],
  649. 0=>{
  650. :name => "Ifrit",
  651. :icon => [104, 0, true],
  652. :text => Text_Color::White,
  653. :help => "Pray To The Fire God Ifrit To Increase Bond.",
  654. :cost => [:points, "parent_stat(0)+1"],
  655. :limit => 105,
  656. :mods =>[
  657. [:add_atk_ele, 3, 0.01],
  658. [:add_atk_ele, 4, -0.01],
  659. [:add_def_ele, 3, -0.01],
  660. [:add_def_ele, 4, 0.01],
  661. ],
  662. },
  663. 1=>{
  664. :name => "Shiva",
  665. :icon => [105, 0, true],
  666. :text => Text_Color::White,
  667. :help => "Pray To The Ice Goddess Shiva To Increase Bond.",
  668. :cost => [:points, "parent_stat(1)+1"],
  669. :limit => 105,
  670. :mods =>[
  671. [:add_atk_ele, 3, -0.01],
  672. [:add_atk_ele, 4, 0.01],
  673. [:add_def_ele, 3, 0.01],
  674. [:add_def_ele, 4, -0.01],
  675. ],
  676. },
  677. 2=>{
  678. :name => "Ramuh",
  679. :icon => [106, 0, true],
  680. :text => Text_Color::White,
  681. :help => "Pray To The Thunder God Ramuh To Increase Bond.",
  682. :cost => [:points, "parent_stat(2)+1"],
  683. :limit => 105,
  684. :mods =>[
  685. [:add_atk_ele, 5, 0.01],
  686. [:add_atk_ele, 6, -0.01],
  687. [:add_def_ele, 5, -0.01],
  688. [:add_def_ele, 6, 0.01],
  689. ],
  690. },
  691. 3=>{
  692. :name => "Levithon",
  693. :icon => [107, 0, true],
  694. :text => Text_Color::White,
  695. :help => "Pray To The Water God Levithon To Increase Bond.",
  696. :cost => [:points, "parent_stat(3)+1"],
  697. :limit => 105,
  698. :mods =>[
  699. [:add_atk_ele, 5, -0.01],
  700. [:add_atk_ele, 6, 0.01],
  701. [:add_def_ele, 5, 0.01],
  702. [:add_def_ele, 6, -0.01],
  703. ],
  704. },
  705. 4=>{
  706. :name => "Titan",
  707. :icon => [108, 0, true],
  708. :text => Text_Color::White,
  709. :help => "Pray To The Earth God Titan To Increase Bond.",
  710. :cost => [:points, "parent_stat(4)+1"],
  711. :limit => 105,
  712. :mods =>[
  713. [:add_atk_ele, 7, 0.01],
  714. [:add_atk_ele, 8, -0.01],
  715. [:add_def_ele, 7, -0.01],
  716. [:add_def_ele, 8, 0.01],
  717. ],
  718. },
  719. 5=>{
  720. :name => "Bahamut",
  721. :icon => [109, 0, true],
  722. :text => Text_Color::White,
  723. :help => "Pray To The Wind God Bahamut To Increase Bond.",
  724. :cost => [:points, "parent_stat(5)+1"],
  725. :limit => 105,
  726. :mods =>[
  727. [:add_atk_ele, 7, -0.01],
  728. [:add_atk_ele, 8, 0.01],
  729. [:add_def_ele, 7, 0.01],
  730. [:add_def_ele, 8, -0.01],
  731. ],
  732. },
  733. 6=>{
  734. :name => "Ashura",
  735. :icon => [110, 0, true],
  736. :text => Text_Color::White,
  737. :help => "Pray To The Holy Goddess Ashura To Increase Bond.",
  738. :cost => [:points, "parent_stat(6)+1"],
  739. :limit => 105,
  740. :mods =>[
  741. [:add_atk_ele, 9, 0.01],
  742. [:add_atk_ele, 10, -0.01],
  743. [:add_def_ele, 9, -0.01],
  744. [:add_def_ele, 10, 0.01],
  745. [:add_dfl , 1],
  746. ],
  747. },
  748. 7=>{
  749. :name => "Hades",
  750. :icon => [111, 0, true],
  751. :text => Text_Color::White,
  752. :help => "Pray To The Dark God Hades To Increase Bond.",
  753. :cost => [:points, "parent_stat(7)+1"],
  754. :limit => 105,
  755. :mods =>[
  756. [:add_atk_ele, 9, -0.01],
  757. [:add_atk_ele, 10, 0.01],
  758. [:add_def_ele, 9, 0.01],
  759. [:add_def_ele, 10, -0.01],
  760. [:add_atl , 1],
  761. ],
  762. },
  763. }# << End Stat_Set[1]
  764. #-----------------------------------------------------------------------------
  765. # ☆ Distribution Setup 1 end
  766. #-----------------------------------------------------------------------------
  767. # You can add more Stat_Set[id] below this point..
  768. # Remember to follow the hash layout perfectly or you will encounter errors
  769. # if you make a mistake, delete your stat set and try again...
  770. # I DO NOT want to be harrassed by questions of how to make a good setup
  771. # i have given examples, use them to your advantage..
  772. #-----------------------------------------------------------------------------
  773. # Default Stat_Set[ id ] used for all actors / classes / enemies
  774. Default_Stat_Set = 0
  775. #-----------------------------------------------------------------------------
  776. # Initial Distribution Points For ALL Actors.
  777. Initial_Points = 5
  778.  
  779. #-----------------------------------------------------------------------------
  780. # ☆ Notetag Settings
  781. #-----------------------------------------------------------------------------
  782. Notes={
  783. :SPDS_SET => /<SPDS:(.*)>/i,
  784. :INIT_DPs => /<DPts:(.*)>/i,
  785. :NO_SPDS => /<no spds>/i,
  786. :SPDS_STAT => /<spds stat:(.*),(.*)>/i,
  787. :ALL_STATS => /<all spds stat:(.*)>/i,
  788. :SPDS_MAXX => /<spds stat limit:(.*),(.*)>/i,
  789. }
  790.  
  791. #-----------------------------------------------------------------------------
  792. # This option only works if using my $D13x Scene Backgrounds Script.
  793. # The background folder is set in the Scene BackGrounds script.
  794. #-----------------------------------------------------------------------------
  795. BGs=[
  796. # ['NAME' , x, y, x scroll, y scroll, z, hue, init opac, max opac],
  797. ['Sunbeam_Overlay_by ShinGamix',0,0, 0, 0, 1, 0, 105, 255],
  798. ['ShinGamox_by ShinGamix',0,0, 0, 0, 1, 0, 105, 245],
  799. ['Fog_By_hyde' , 100, 100, 2, -2, 1, 0, 74, 155],
  800. ['$Dekita_II' , 0, 0, 1, 1, 2, 0, 0, 255],
  801. ]# << end
  802.  
  803. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  804. # ☆ Window Settings
  805. #-----------------------------------------------------------------------------
  806. # This is where you set the windowskin for each window.
  807. # Simply put a # at the start of lines you want to keep the default
  808. # NOTE : This setting requires $D13x Window Skins Script.
  809. # The windowskin folder is set in the WindowSkins script also.
  810. #-----------------------------------------------------------------------------
  811. Skins={ # << KEEP !!
  812. # :window type => ["Skin Name" , hue, opacity]
  813. :main_command => ["PWI_Style_Blu", 0, 225],
  814. :spds_command => ["PWI_Style_Blu", 0, 225],
  815. :spds_help => ["PWI_Style_Blu", 0, 225],
  816. :main_status => ["PWI_Style_Blu", 0, 225],
  817. :dist_status => ["PWI_Style_Blu", 0, 225],
  818. :ibox_window => ["PWI_Style_Blu", 0, 225],
  819. } # << Keep
  820. #####################
  821. # CUSTOMISATION END #
  822. end #####################
  823. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  824. # #
  825. # http://dekitarpg.wordpress.com/ #
  826. # #
  827. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  828. #===============================================================================#
  829. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  830. # YES?\.\. #
  831. # OMG, REALLY? \| #
  832. # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
  833. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  834. #===============================================================================#
  835. module SPDS ; Commands = [] ; Max_Parent_Stats.times { |i| Commands << i } ; end
  836. #===============================================================================
  837. module Vocanicon
  838. #===============================================================================
  839. #-----------------------------------------------------------------------------
  840. #
  841. #-----------------------------------------------------------------------------
  842. def self.spds_stat(actor,i)
  843. set = actor.spds_set[i]
  844. [set[:name],set[:text],set[:icon][0],set[:icon][1]]
  845. end
  846. end
  847. #===============================================================================
  848. module DataManager
  849. #===============================================================================
  850. #---------------------------------------------------------------------------
  851. # Alias List
  852. #---------------------------------------------------------------------------
  853. class << self
  854. alias :lbd__SPDS :load_database
  855. end
  856. #---------------------------------------------------------------------------
  857. # Load Database (alias)
  858. #---------------------------------------------------------------------------
  859. def self.load_database
  860. lbd__SPDS
  861. loa_SPDS
  862. end
  863. #---------------------------------------------------------------------------
  864. # Load Unique Shit
  865. #---------------------------------------------------------------------------
  866. def self.loa_SPDS
  867. classes = [$data_weapons, $data_armors , $data_items , $data_skills ,
  868. $data_actors , $data_classes, $data_enemies, $data_states ]
  869. for g in classes
  870. for o in g
  871. next if o == nil
  872. o.load__SPDS
  873. end
  874. end
  875. end
  876. end # DataManager
  877. #===============================================================================
  878. module BattleManager
  879. #===============================================================================
  880. #-----------------------------------------------------------------------------
  881. # Alias Lust
  882. #-----------------------------------------------------------------------------
  883. class << self
  884. alias :gain_disti_pts :gain_exp
  885. end
  886. #-----------------------------------------------------------------------------
  887. # EXP Acquisition and Level Up Display
  888. #-----------------------------------------------------------------------------
  889. def self.gain_exp
  890. gain_disti_pts
  891. gained = ($game_troop.disti_total / $game_party.alive_battle_members.size)
  892. vocab = SPDS::Gain_Pts_Vocab
  893. dp_voc = SPDS::DP_Vocab[1]
  894. if gained > 0
  895. for actor in $game_party.alive_battle_members
  896. actor.gain_points(gained)
  897. text = sprintf(vocab, actor.name, gained, dp_voc)
  898. $game_message.add('\.' + text)
  899. end
  900. end
  901. wait_for_message
  902. end
  903. end
  904. #===============================================================================
  905. class RPG::BaseItem
  906. #===============================================================================
  907. #-----------------------------------------------------------------------------
  908. # Pi Variables
  909. #-----------------------------------------------------------------------------
  910. attr_accessor :_SPDS_SET_ID_
  911. attr_accessor :init_SPDS_points
  912. attr_accessor :can_distribute
  913. attr_accessor :spds_stats
  914. attr_accessor :spds_stats_limit
  915. #-----------------------------------------------------------------------------
  916. # Alias List
  917. #-----------------------------------------------------------------------------
  918. def load__SPDS
  919. @can_distribute = true
  920. @spds_stats = [0] * SPDS::Commands.size
  921. @spds_stats_limit = [0] * SPDS::Commands.size
  922. @_SPDS_SET_ID_ = SPDS::Default_Stat_Set
  923. @init_SPDS_points = self.is_a?(RPG::Actor) ? SPDS::Initial_Points : 0
  924. self.note.split(/[\r\n]+/).each do |line|
  925. case line
  926. when SPDS::Notes[:SPDS_SET ] then @_SPDS_SET_ID_ = $1.to_i
  927. when SPDS::Notes[:INIT_DPs ] then @init_SPDS_points = $1.to_i
  928. when SPDS::Notes[:NO_SPDS ] then @can_distribute = false
  929. when SPDS::Notes[:SPDS_STAT] then @spds_stats[$1.to_i] = $2.to_i
  930. when SPDS::Notes[:SPDS_MAXX] then @spds_stats_limit[$1.to_i] = $2.to_i
  931. when SPDS::Notes[:ALL_STATS] then SPDS::Commands.each {|i| @spds_stats[i] = $1.to_i }
  932. end
  933. end
  934. end
  935. end
  936. #===============================================================================
  937. class Game_BattlerBase
  938. #===============================================================================
  939. #-----------------------------------------------------------------------------
  940. # ISPDS Feature Code (For Parent Stats)
  941. #-----------------------------------------------------------------------------
  942. FEATURE_ISPDS = 2013
  943. #-----------------------------------------------------------------------------
  944. # Alias List
  945. #-----------------------------------------------------------------------------
  946. alias :ispds_init_GB :initialize
  947. alias :spds_fis_refresh :refresh
  948. alias :parp_spds_plus :param_plus
  949. alias :xparp_spds_plus :xparam_plus if $D13x[:Stats_Control]
  950. alias :sparp_spds_plus :sparam_plus if $D13x[:Stats_Control]
  951. alias :def_ele_plus_spds :def_ele_plus if $D13x[:Elems_Control]
  952. alias :atk_ele_plus_spds :atk_ele_plus if $D13x[:Elems_Control]
  953. alias :at_dfl_plus_mods_spds :atl_dfl_plus if $D13x[:Atk_Def_Lvs]
  954. alias :mtp_plus_ispds :max_tp_plus if $D13x[:TP_Control]
  955. #-----------------------------------------------------------------------------
  956. # Initialize
  957. #-----------------------------------------------------------------------------
  958. def initialize(*args, &block)
  959. @spds_stats_prefix = [0] * gdecoms.size
  960. setup_spds_set_info
  961. clear_spds_stats
  962. ispds_init_GB(*args, &block)
  963. end
  964. #-----------------------------------------------------------------------------
  965. # Get The Commands
  966. #-----------------------------------------------------------------------------
  967. def gdecoms
  968. return SPDS::Commands
  969. end
  970. #-----------------------------------------------------------------------------
  971. # Initialize SPDS System ++ (Default)
  972. #-----------------------------------------------------------------------------
  973. def setup_spds_set_info
  974. @spds_set = SPDS::Default_Stat_Set
  975. get_stat_val_for__RPG_Items
  976. end
  977. #-----------------------------------------------------------------------------
  978. # Get SPDS Set Info
  979. #-----------------------------------------------------------------------------
  980. def spds_set
  981. return SPDS::Stat_Set[@spds_set]
  982. end
  983. #-----------------------------------------------------------------------------
  984. # Get SPDS Stat Value
  985. #-----------------------------------------------------------------------------
  986. def get_stat_val_for__RPG_Items
  987. init_spds_stats_RPG_Fix
  988. gdecoms.each do |stat|
  989. next unless spds_set[stat]
  990. spds_set[stat][:mods].each do |mod|
  991. case mod[0]
  992. # << reg-Params
  993. when :add_param then @param_per_stat[stat][mod[1]] += mod[2]
  994. when :sub_param then @param_per_stat[stat][mod[1]] -= mod[2]
  995. when :div_param then @param_per_stat[stat][mod[1]] /= mod[2]
  996. when :mul_param then @param_per_stat[stat][mod[1]] *= mod[2]
  997. when :mod_param then @param_per_stat[stat][mod[1]] %= mod[2]
  998. # << x-Params
  999. when :add_xparam then @xparam_per_stat[stat][mod[1]] += mod[2]
  1000. when :sub_xparam then @xparam_per_stat[stat][mod[1]] -= mod[2]
  1001. when :div_xparam then @xparam_per_stat[stat][mod[1]] /= mod[2]
  1002. when :mul_xparam then @xparam_per_stat[stat][mod[1]] *= mod[2]
  1003. when :mod_xparam then @xparam_per_stat[stat][mod[1]] %= mod[2]
  1004. # << s-Params
  1005. when :add_sparam then @sparam_per_stat[stat][mod[1]] += mod[2]
  1006. when :sub_sparam then @sparam_per_stat[stat][mod[1]] -= mod[2]
  1007. when :div_sparam then @sparam_per_stat[stat][mod[1]] /= mod[2]
  1008. when :mul_sparam then @sparam_per_stat[stat][mod[1]] *= mod[2]
  1009. when :mod_sparam then @sparam_per_stat[stat][mod[1]] %= mod[2]
  1010. # << Attack Elements
  1011. when :add_atk_ele then @atk_ele_per_stat[stat][mod[1]] += mod[2]
  1012. when :sub_atk_ele then @atk_ele_per_stat[stat][mod[1]] -= mod[2]
  1013. when :div_atk_ele then @atk_ele_per_stat[stat][mod[1]] /= mod[2]
  1014. when :mul_atk_ele then @atk_ele_per_stat[stat][mod[1]] *= mod[2]
  1015. when :mod_atk_ele then @atk_ele_per_stat[stat][mod[1]] %= mod[2]
  1016. # << Defence Elements
  1017. when :add_def_ele then @def_ele_per_stat[stat][mod[1]] += mod[2]
  1018. when :sub_def_ele then @def_ele_per_stat[stat][mod[1]] -= mod[2]
  1019. when :div_def_ele then @def_ele_per_stat[stat][mod[1]] /= mod[2]
  1020. when :mul_def_ele then @def_ele_per_stat[stat][mod[1]] *= mod[2]
  1021. when :mod_def_ele then @def_ele_per_stat[stat][mod[1]] %= mod[2]
  1022. # << Attack Level
  1023. when :add_atl then @atl_dfl_per_stat[stat][0] += mod[1]
  1024. when :sub_atl then @atl_dfl_per_stat[stat][0] -= mod[1]
  1025. when :div_atl then @atl_dfl_per_stat[stat][0] /= mod[1]
  1026. when :mul_atl then @atl_dfl_per_stat[stat][0] *= mod[1]
  1027. when :mod_atl then @atl_dfl_per_stat[stat][0] %= mod[1]
  1028. # << Defence Level
  1029. when :add_dfl then @atl_dfl_per_stat[stat][1] += mod[1]
  1030. when :sub_dfl then @atl_dfl_per_stat[stat][1] -= mod[1]
  1031. when :div_dfl then @atl_dfl_per_stat[stat][1] /= mod[1]
  1032. when :mul_dfl then @atl_dfl_per_stat[stat][1] *= mod[1]
  1033. when :mod_dfl then @atl_dfl_per_stat[stat][1] %= mod[1]
  1034. # << Max TP
  1035. when :add_mtp then @tp_max_per_stat[stat] += mod[1]
  1036. when :sub_mtp then @tp_max_per_stat[stat] -= mod[1]
  1037. when :div_mtp then @tp_max_per_stat[stat] /= mod[1]
  1038. when :mul_mtp then @tp_max_per_stat[stat] *= mod[1]
  1039. when :mod_mtp then @tp_max_per_stat[stat] %= mod[1]
  1040. end
  1041. end
  1042. end
  1043. end
  1044. #-----------------------------------------------------------------------------
  1045. # Initialize SPDS Stats FPS Fix
  1046. #-----------------------------------------------------------------------------
  1047. def init_spds_stats_RPG_Fix
  1048. @param_per_stat = {}
  1049. @xparam_per_stat = {}
  1050. @sparam_per_stat = {}
  1051. @atk_ele_per_stat = {}
  1052. @def_ele_per_stat = {}
  1053. @atl_dfl_per_stat = {}
  1054. @tp_max_per_stat = {}
  1055. gdecoms.each do |stat|
  1056. @tp_max_per_stat [stat] = 0
  1057. @atl_dfl_per_stat [stat] = [0] * 2
  1058. @param_per_stat [stat] = [0] * 8
  1059. @xparam_per_stat [stat] = [0] * 10
  1060. @sparam_per_stat [stat] = [0] * 10
  1061. @atk_ele_per_stat [stat] = [0] * $data_system.elements.size
  1062. @def_ele_per_stat [stat] = [0] * $data_system.elements.size
  1063. end
  1064. end
  1065. #-----------------------------------------------------------------------------
  1066. # Get SPDS Stats
  1067. #-----------------------------------------------------------------------------
  1068. def spds_stats(id)
  1069. base = (features_sum(FEATURE_ISPDS, id) + spds_plus(id))
  1070. esab = [[base, spds_stats_max(id)].min, 0].max
  1071. @spds_stats_prefix[id] = esab.to_i
  1072. @spds_stats_prefix[id]
  1073. end
  1074. #-----------------------------------------------------------------------------
  1075. # Get SPDS Stats Max
  1076. #-----------------------------------------------------------------------------
  1077. def spds_stats_max(id)
  1078. base = spds_set[id][:limit] rescue 0
  1079. return base
  1080. end
  1081. #-----------------------------------------------------------------------------
  1082. # Get SPDS Stats
  1083. #-----------------------------------------------------------------------------
  1084. def parent_stat(id)
  1085. return @spds_stats_prefix[id]
  1086. end
  1087. #-----------------------------------------------------------------------------
  1088. # Get SPDS Stats Plus
  1089. #-----------------------------------------------------------------------------
  1090. def spds_plus(id)
  1091. @spds_stats[id]
  1092. end
  1093. #-----------------------------------------------------------------------------
  1094. # Clear SPDS Stats Plus
  1095. #-----------------------------------------------------------------------------
  1096. def clear_spds_stats
  1097. @spds_stats = [0] * gdecoms.size
  1098. end
  1099. #-----------------------------------------------------------------------------
  1100. # Add SPDS Stats
  1101. #-----------------------------------------------------------------------------
  1102. def add_spds_stats(id, value, ref = true)
  1103. @spds_stats[id] += value
  1104. refresh if ref
  1105. end
  1106. #-----------------------------------------------------------------------------
  1107. # Sub SPDS Stats
  1108. #-----------------------------------------------------------------------------
  1109. def sub_spds_stats(id, value, ref = true)
  1110. @spds_stats[id] -= value
  1111. refresh if ref
  1112. end
  1113. #-----------------------------------------------------------------------------
  1114. # Div SPDS Stats
  1115. #-----------------------------------------------------------------------------
  1116. def div_spds_stats(id, value, ref = true)
  1117. @spds_stats[id] /= value
  1118. refresh if ref
  1119. end
  1120. #-----------------------------------------------------------------------------
  1121. # Mul SPDS Stats
  1122. #-----------------------------------------------------------------------------
  1123. def mul_spds_stats(id, value, ref = true)
  1124. @spds_stats[id] *= value
  1125. refresh if ref
  1126. end
  1127. #-----------------------------------------------------------------------------
  1128. # Mod SPDS Stats
  1129. #-----------------------------------------------------------------------------
  1130. def mod_spds_stats(id, value, ref = true)
  1131. @spds_stats[id] %= value
  1132. refresh if ref
  1133. end
  1134. #-----------------------------------------------------------------------------
  1135. # Refresh
  1136. #-----------------------------------------------------------------------------
  1137. def refresh
  1138. gdecoms.each { |i| spds_stats(i) }
  1139. spds_fis_refresh
  1140. end
  1141. #-----------------------------------------------------------------------------
  1142. # Param Plus
  1143. #-----------------------------------------------------------------------------
  1144. def param_plus(param_id)
  1145. base = parp_spds_plus(param_id)
  1146. SPDS::Commands.each do |i|
  1147. base += (@param_per_stat[gdecoms[i]][param_id]*@spds_stats_prefix[i])
  1148. end
  1149. base.to_i
  1150. end
  1151. if $D13x[:Stats_Control]
  1152. #---------------------------------------------------------------------------
  1153. # x-Param Plus
  1154. #---------------------------------------------------------------------------
  1155. def xparam_plus(xparam_id)
  1156. base = xparp_spds_plus(xparam_id)
  1157. SPDS::Commands.each do |i|
  1158. base += (@xparam_per_stat[gdecoms[i]][xparam_id]*@spds_stats_prefix[i])
  1159. end
  1160. base.to_f
  1161. end
  1162. #---------------------------------------------------------------------------
  1163. # s-Param Plus
  1164. #---------------------------------------------------------------------------
  1165. def sparam_plus(sparam_id)
  1166. base = sparp_spds_plus(sparam_id)
  1167. SPDS::Commands.each do |i|
  1168. base += (@sparam_per_stat[gdecoms[i]][sparam_id]*@spds_stats_prefix[i])
  1169. end
  1170. base.to_f
  1171. end
  1172. end # if $D13x[:Stats_Control]
  1173. if $D13x[:Elems_Control]
  1174. #---------------------------------------------------------------------------
  1175. # Defence Element Plus
  1176. #---------------------------------------------------------------------------
  1177. def def_ele_plus(element_id)
  1178. base = def_ele_plus_spds(element_id)
  1179. SPDS::Commands.each do |i|
  1180. base += (@def_ele_per_stat[gdecoms[i]][element_id]*@spds_stats_prefix[i])
  1181. end
  1182. base.to_f
  1183. end
  1184. #---------------------------------------------------------------------------
  1185. # Attack Element Plus
  1186. #---------------------------------------------------------------------------
  1187. def atk_ele_plus(element_id)
  1188. base = atk_ele_plus_spds(element_id)
  1189. SPDS::Commands.each do |i|
  1190. base += (@atk_ele_per_stat[gdecoms[i]][element_id]*@spds_stats_prefix[i])
  1191. end
  1192. base.to_f
  1193. end
  1194. end # if $D13x[:Elems_Control]
  1195. if $D13x[:Atk_Def_Lvs]
  1196. #---------------------------------------------------------------------------
  1197. # Atk Lv | Def Lv ++
  1198. #---------------------------------------------------------------------------
  1199. def atl_dfl_plus(id)
  1200. base = at_dfl_plus_mods_spds(id)
  1201. SPDS::Commands.each do |i|
  1202. base += (@atl_dfl_per_stat[gdecoms[i]][id]*@spds_stats_prefix[i])
  1203. end
  1204. base.to_i
  1205. end
  1206. end # if $D13x[:Atk_Def_Lvs]
  1207. if $D13x[:TP_Control]
  1208. #---------------------------------------------------------------------------
  1209. # Max TP Plus
  1210. #---------------------------------------------------------------------------
  1211. def max_tp_plus
  1212. base = mtp_plus_ispds
  1213. SPDS::Commands.each do |i|
  1214. base += (@tp_max_per_stat[gdecoms[i]]*@spds_stats_prefix[i])
  1215. end
  1216. base.to_i
  1217. end
  1218. end
  1219. end # Game_BattlerBase
  1220. #===============================================================================
  1221. class Game_Actor < Game_Battler
  1222. #===============================================================================
  1223. #-----------------------------------------------------------------------------
  1224. # Pi Variables
  1225. #-----------------------------------------------------------------------------
  1226. attr_reader :points
  1227. attr_reader :SPDSFLAG
  1228. #-----------------------------------------------------------------------------
  1229. # Alias List
  1230. #-----------------------------------------------------------------------------
  1231. alias :sD13x_SPDS_init :initialize
  1232. alias :lev_up_SPDS :level_up
  1233. alias :change_SPDS_class :change_class
  1234. #-----------------------------------------------------------------------------
  1235. # Initialization
  1236. #-----------------------------------------------------------------------------
  1237. def initialize(actor_id)
  1238. sD13x_SPDS_init(actor_id)
  1239. init_SPDS
  1240. refresh
  1241. recover_all
  1242. end
  1243. #-----------------------------------------------------------------------------
  1244. # Initialize SPDS System
  1245. #-----------------------------------------------------------------------------
  1246. def init_SPDS
  1247. @points = actor.init_SPDS_points
  1248. @SPDSFLAG = false
  1249. setup_spds_set_info_overwrite
  1250. end
  1251. #-----------------------------------------------------------------------------
  1252. # Initialize SPDS System ++ (from super)
  1253. #-----------------------------------------------------------------------------
  1254. def setup_spds_set_info_overwrite
  1255. act = actor._SPDS_SET_ID_
  1256. cla = self.class._SPDS_SET_ID_
  1257. @spds_set = SPDS::Default_Stat_Set
  1258. @spds_set = cla if cla != SPDS::Default_Stat_Set
  1259. @spds_set = act if act != SPDS::Default_Stat_Set
  1260. get_stat_val_for__RPG_Items
  1261. end
  1262. #-----------------------------------------------------------------------------
  1263. # Change_SPDS_Set_ID
  1264. #-----------------------------------------------------------------------------
  1265. def change_spds_set_id_to(id)
  1266. return if SPDS::Stat_Set[id] == nil
  1267. @spds_set = id
  1268. get_stat_val_for__RPG_Items
  1269. end
  1270. #--------------------------------------------------------------------------
  1271. # Change Class | keep_exp: Keep EXP
  1272. #--------------------------------------------------------------------------
  1273. def change_class(class_id, keep_exp = false)
  1274. old_cla = @class_id
  1275. change_SPDS_class(class_id, keep_exp)
  1276. setup_spds_set_info_overwrite if old_cla != @class_id
  1277. end
  1278. #-----------------------------------------------------------------------------
  1279. # Level Up
  1280. #-----------------------------------------------------------------------------
  1281. def level_up
  1282. lev_up_SPDS
  1283. on_lv_SPDS
  1284. end
  1285. #-----------------------------------------------------------------------------
  1286. # Level Up SPDS
  1287. #-----------------------------------------------------------------------------
  1288. def on_lv_SPDS
  1289. return unless can_distribute?
  1290. @points += spds_set[:pts_on_lv]
  1291. @points += spds_set[:extra_pts] if spds_set[:xtra_p_lv].include?(@level)
  1292. @SPDSFLAG = true if @points > 0
  1293. end
  1294. #-----------------------------------------------------------------------------
  1295. # Can Distribute Stats?
  1296. #-----------------------------------------------------------------------------
  1297. def can_distribute?
  1298. return actor.can_distribute
  1299. end
  1300. #-----------------------------------------------------------------------------
  1301. # Reset SPDSFLAG
  1302. #-----------------------------------------------------------------------------
  1303. def reset_SPDSFLAG
  1304. @SPDSFLAG = false
  1305. end
  1306. #-----------------------------------------------------------------------------
  1307. # Do SPDS Stat Modifications <><>
  1308. #-----------------------------------------------------------------------------
  1309. def spds_stat_mods(mods,spds_stat_id,does_cost = true)
  1310. @spds_stats[spds_stat_id] += 1
  1311. cost = get_point_cost(mods[:cost][1])
  1312. return refresh unless does_cost
  1313. case mods[:cost][0]
  1314. when :points then reduce_points(cost)
  1315. when :gold then $game_party.gain_gold(-cost)
  1316. when :exp then reduce_spds_exp(cost)
  1317. end
  1318. refresh
  1319. end
  1320. #-----------------------------------------------------------------------------
  1321. # Reduce Points
  1322. #-----------------------------------------------------------------------------
  1323. def reduce_points(val)
  1324. @points -= val
  1325. @points = 0 if @points < 0
  1326. end
  1327. #-----------------------------------------------------------------------------
  1328. # Reset All Points
  1329. #-----------------------------------------------------------------------------
  1330. def reset_all_points(pts_bk = true)
  1331. old_pts = get_total_spds_stats
  1332. clear_spds_stats
  1333. new_pts = get_total_spds_stats
  1334. gain_points(old_pts-new_pts) if ((old_pts > new_pts) && (pts_bk))
  1335. end
  1336. #-----------------------------------------------------------------------------
  1337. # Reset Some Points
  1338. #-----------------------------------------------------------------------------
  1339. def reset_some_points(stat_id, points, pts_bk = true)
  1340. old_pts = parent_stat(stat_id)
  1341. sub_spds_stats(stat_id, points)
  1342. new_pts = parent_stat(stat_id)
  1343. gain_points(old_pts-new_pts) if ((old_pts > new_pts) && (pts_bk))
  1344. end
  1345. #-----------------------------------------------------------------------------
  1346. # Gain Points
  1347. #-----------------------------------------------------------------------------
  1348. def gain_points(val)
  1349. @points += val
  1350. @points = SPDS::Max_Points if @points > SPDS::Max_Points
  1351. end
  1352. #-----------------------------------------------------------------------------
  1353. # Reduce SPDS Exp
  1354. #-----------------------------------------------------------------------------
  1355. def reduce_spds_exp(val)
  1356. gain_exp(-val)
  1357. end
  1358. #-----------------------------------------------------------------------------
  1359. # Get Spendable Exp
  1360. #-----------------------------------------------------------------------------
  1361. def spendable_exp
  1362. exp - current_level_exp
  1363. end
  1364. #-----------------------------------------------------------------------------
  1365. # Get Points Cost
  1366. #-----------------------------------------------------------------------------
  1367. def get_point_cost(string)
  1368. return [eval(string), 1].max.to_i rescue 0
  1369. end
  1370. #-----------------------------------------------------------------------------
  1371. # Get Total SPDS Stats
  1372. #-----------------------------------------------------------------------------
  1373. def get_total_spds_stats(base = 0)
  1374. gdecoms.each { |i| base += parent_stat(i) }
  1375. return base
  1376. end
  1377. #-----------------------------------------------------------------------------
  1378. # SPDS Plus
  1379. #-----------------------------------------------------------------------------
  1380. def spds_plus(id)
  1381. base = super(id)
  1382. base += actor.spds_stats[id]
  1383. base += self.class.spds_stats[id]
  1384. base += equips.compact.inject(0) {|r, i| r += i.spds_stats[id] }
  1385. base += states.compact.inject(0) {|r, i| r += i.spds_stats[id] }
  1386. if $D13x[:Skill_Lv]
  1387. base += skills.compact.inject(0) {|r, i| r += (i.spds_stats[id]*
  1388. Skill_Levels::Exp_Set[i.exp_set][@skills_lv[i.id]][2] ).to_f}
  1389. else
  1390. base += skills.compact.inject(0) {|r, i| r += i.spds_stats[id] }
  1391. end
  1392. base
  1393. end
  1394. #-----------------------------------------------------------------------------
  1395. # Get SPDS Stats Max
  1396. #-----------------------------------------------------------------------------
  1397. def spds_stats_max(id)
  1398. base = super(id)
  1399. base += actor.spds_stats_limit[id]
  1400. base += self.class.spds_stats_limit[id]
  1401. base += equips.compact.inject(0) {|r, i| r += i.spds_stats_limit[id] }
  1402. base += states.compact.inject(0) {|r, i| r += i.spds_stats_limit[id] }
  1403. if $D13x[:Skill_Lv]
  1404. base += skills.compact.inject(0) {|r, i| r += (i.spds_stats_limit[id]*
  1405. Skill_Levels::Exp_Set[i.exp_set][@skills_lv[i.id]][2] ).to_f}
  1406. else
  1407. base += skills.compact.inject(0) {|r, i| r += i.spds_stats_limit[id] }
  1408. end
  1409. base
  1410. end
  1411. end
  1412. #===============================================================================
  1413. class Game_Enemy < Game_Battler
  1414. #===============================================================================
  1415. #-----------------------------------------------------------------------------
  1416. # Alias List
  1417. #-----------------------------------------------------------------------------
  1418. alias :sD13x_SPDS_init :initialize
  1419. #-----------------------------------------------------------------------------
  1420. # Initialization
  1421. #-----------------------------------------------------------------------------
  1422. def initialize(index, enemy_id)
  1423. sD13x_SPDS_init(index, enemy_id)
  1424. setup_spds_set_info_overwrite
  1425. refresh
  1426. recover_all
  1427. end
  1428. #-----------------------------------------------------------------------------
  1429. # Get Distribution Points
  1430. #-----------------------------------------------------------------------------
  1431. def disti_pts
  1432. enemy.init_SPDS_points
  1433. end
  1434. #-----------------------------------------------------------------------------
  1435. # Initialize SPDS System ++ (from super)
  1436. #-----------------------------------------------------------------------------
  1437. def setup_spds_set_info_overwrite
  1438. @spds_set = SPDS::Default_Stat_Set
  1439. @spds_set = enemy._SPDS_SET_ID_ if enemy._SPDS_SET_ID_ != @spds_set
  1440. get_stat_val_for__RPG_Items
  1441. end
  1442. #-----------------------------------------------------------------------------
  1443. # SPDS Plus
  1444. #-----------------------------------------------------------------------------
  1445. def spds_plus(id)
  1446. base = super(id)
  1447. base += enemy.spds_stats[id]
  1448. base += states.compact.inject(0) {|r, i| r += i.spds_stats[id] }
  1449. base
  1450. end
  1451. #-----------------------------------------------------------------------------
  1452. # Get SPDS Stats Max
  1453. #-----------------------------------------------------------------------------
  1454. def spds_stats_max(id)
  1455. base = super(id)
  1456. base += enemy.spds_stats_limit[id]
  1457. base += states.compact.inject(0) {|r, i| r += i.spds_stats_limit[id] }
  1458. base
  1459. end
  1460. end
  1461. #===============================================================================
  1462. class Game_Troop < Game_Unit
  1463. #===============================================================================
  1464. #-----------------------------------------------------------------------------
  1465. # Calculate Distribution Points Gain Total
  1466. #-----------------------------------------------------------------------------
  1467. def disti_total
  1468. dead_members.inject(0) {|r, enemy| r += enemy.disti_pts }
  1469. end
  1470. end
  1471. #===============================================================================
  1472. class Game_Party < Game_Unit
  1473. #===============================================================================
  1474. #-----------------------------------------------------------------------------
  1475. # Check if member needs to be taken to distribution screen.
  1476. #-----------------------------------------------------------------------------
  1477. def check_need_spds?
  1478. return nil unless SPDS::Show_Screen
  1479. alive_battle_members.each do |a|
  1480. next unless a.SPDSFLAG
  1481. a.reset_SPDSFLAG
  1482. return a
  1483. end
  1484. return nil
  1485. end
  1486. end
  1487. #===============================================================================
  1488. class Window_MenuCommand < Window_Command
  1489. #===============================================================================
  1490. #-----------------------------------------------------------------------------
  1491. # Alias List
  1492. #-----------------------------------------------------------------------------
  1493. alias :add_spds_menu_command :add_original_commands
  1494. #-----------------------------------------------------------------------------
  1495. # For Adding Original Commands
  1496. #-----------------------------------------------------------------------------
  1497. def add_original_commands
  1498. add_spds_menu_command
  1499. add_command(SPDS::Menu_Info[1], :distribute, can_distribute)
  1500. end
  1501. #-----------------------------------------------------------------------------
  1502. # Add Distribution Command
  1503. #-----------------------------------------------------------------------------
  1504. def add_distribute_command
  1505. return unless SPDS::Menu_Info[0]
  1506. add_command(SPDS::Menu_Info[1], :distribute, can_distribute)
  1507. end
  1508. #-----------------------------------------------------------------------------
  1509. # Can Enable Distribution ?
  1510. #-----------------------------------------------------------------------------
  1511. def can_distribute
  1512. return $game_switches[SPDS::Menu_Info[2]] if SPDS::Menu_Info[2] != 0
  1513. return true
  1514. end
  1515. end
  1516. #===============================================================================
  1517. class Window_SPDSCommand < Window_Command
  1518. #===============================================================================
  1519. #-----------------------------------------------------------------------------
  1520. # Get Window Width
  1521. #-----------------------------------------------------------------------------
  1522. def window_width
  1523. return Graphics.width / 4
  1524. end
  1525. #-----------------------------------------------------------------------------
  1526. # Get Number of Lines to Show
  1527. #-----------------------------------------------------------------------------
  1528. def visible_line_number
  1529. return 2
  1530. end
  1531. #-----------------------------------------------------------------------------
  1532. # Set/Get Alignment
  1533. #-----------------------------------------------------------------------------
  1534. def alignment
  1535. return 1
  1536. end
  1537. #-----------------------------------------------------------------------------
  1538. # Create Command List
  1539. #-----------------------------------------------------------------------------
  1540. def make_command_list
  1541. for command in SPDS::Main_Commands
  1542. add_command(command[1], command[0])
  1543. end
  1544. end
  1545. #-----------------------------------------------------------------------------
  1546. # Draws Items
  1547. #-----------------------------------------------------------------------------
  1548. def draw_item(index)
  1549. self.contents.font.name = General::Fonts
  1550. self.contents.font.size = General::Font_Size
  1551. self.contents.font.bold = General::Font_Bold
  1552. draw_text(item_rect_for_text(index), command_name(index), 1)
  1553. end
  1554. end
  1555. #===============================================================================
  1556. class Window_SPDS_DistributeCommand < Window_Command
  1557. #===============================================================================
  1558. #-----------------------------------------------------------------------------
  1559. # Pi Variables
  1560. #-----------------------------------------------------------------------------
  1561. attr_reader :actor
  1562. #-----------------------------------------------------------------------------
  1563. # Initialize
  1564. #-----------------------------------------------------------------------------
  1565. def initialize(x, y)
  1566. @dey = y
  1567. @actor = $game_party.menu_actor
  1568. super(x, y)
  1569. deactivate
  1570. @index = -1
  1571. end
  1572. #-----------------------------------------------------------------------------
  1573. # Set Actor
  1574. #-----------------------------------------------------------------------------
  1575. def actor=(actor)
  1576. return if @actor == actor
  1577. @actor = actor
  1578. refresh
  1579. end
  1580. #-----------------------------------------------------------------------------
  1581. # Get Window Width
  1582. #-----------------------------------------------------------------------------
  1583. def window_width
  1584. return Graphics.width / 3
  1585. end
  1586. #-----------------------------------------------------------------------------
  1587. # Get Window Height
  1588. #-----------------------------------------------------------------------------
  1589. def window_height
  1590. return (line_height*(SPDS::Visible_Distribution_Commands+1))
  1591. end
  1592. #-----------------------------------------------------------------------------
  1593. # Create Command List
  1594. #-----------------------------------------------------------------------------
  1595. def make_command_list
  1596. return unless @actor
  1597. ind = 0
  1598. for command in SPDS::Commands
  1599. next unless @actor.spds_set[command]
  1600. set = @actor.spds_set[command]
  1601. cost = @actor.get_point_cost(set[:cost][1])
  1602. enab = can_enable_spend?(set[:cost][0], cost, ind)
  1603. add_command(set[:name], :spend_pts, enab, set)
  1604. ind += 1
  1605. end
  1606. return unless SPDS::Allow_Finish
  1607. add_command(SPDS::Finish_Data[0], :end_distribute,true, {})
  1608. end
  1609. #-----------------------------------------------------------------------------
  1610. # Draws Items
  1611. #-----------------------------------------------------------------------------
  1612. def draw_item(index)
  1613. change_color(normal_color, command_enabled?(index))
  1614. self.contents.font.name = General::Fonts
  1615. self.contents.font.size = General::Font_Size
  1616. self.contents.font.bold = General::Font_Bold
  1617. rect = item_rect_for_text(index)
  1618. icon = command_icon(index)
  1619. contents.fill_rect(rect.x-2,rect.y+1,rect.width+4,rect.height-2,Color.new(0,0,0,64))
  1620. if command_name(index) == SPDS::Finish_Data[0]
  1621. draw_text(rect, command_name(index), 1)
  1622. else
  1623. draw_de_icon(icon[0], rect.x, rect.y, icon[1], icon[2])
  1624. rect.x += 25
  1625. draw_text(rect, command_name(index), 0)
  1626. rect.x -= 28
  1627. change_color(normal_color)
  1628. draw_text(rect, @actor.spds_stats(index).to_s, 2)
  1629. end
  1630. end
  1631. #-----------------------------------------------------------------------------
  1632. # Get Command Icon
  1633. #-----------------------------------------------------------------------------
  1634. def command_icon(index)
  1635. @list[index][:ext][:icon]
  1636. end
  1637. #-----------------------------------------------------------------------------
  1638. # Get Command Icon
  1639. #-----------------------------------------------------------------------------
  1640. def get_command_help
  1641. text = @actor.spds_set[SPDS::Commands[@index]][:help] rescue nil
  1642. return SPDS::Finish_Data[1] unless text
  1643. data = @actor.spds_set[SPDS::Commands[@index]]
  1644. cost = @actor.get_point_cost(data[:cost][1])
  1645. add_cost_info_to_help(cost, data[:cost][0], text)
  1646. end
  1647. #-----------------------------------------------------------------------------
  1648. # Add Cost Info to Help Window
  1649. #-----------------------------------------------------------------------------
  1650. def add_cost_info_to_help(cost, data, text)
  1651. curr = @actor.parent_stat (@index)
  1652. maxx = @actor.spds_stats_max(@index)
  1653. text += "\nCost: --" if curr >= maxx
  1654. case data
  1655. when :points then text += "\nCost: #{cost} #{SPDS::DP_Vocab[1]}"
  1656. when :gold then text += "\nCost: #{cost} Gold"
  1657. when :exp then text += "\nCost: #{cost} Exp Points"
  1658. end ;return text
  1659. end
  1660. #-----------------------------------------------------------------------------
  1661. # Can Enable Buy Stat ?
  1662. #-----------------------------------------------------------------------------
  1663. def can_enable_spend?(type, cost, id)
  1664. return false if (@actor.parent_stat(id) >= @actor.spds_stats_max(id))
  1665. return false if (@actor.spendable_exp < cost) && (type == :exp )
  1666. return false if (@actor.points < cost) && (type == :points )
  1667. return false if ($game_party.gold < cost) && (type == :gold )
  1668. return true
  1669. end
  1670. end
  1671. #===============================================================================
  1672. class Window_SPDSCommandII < Window_Command
  1673. #===============================================================================
  1674. #-----------------------------------------------------------------------------
  1675. # Get Window Width
  1676. #-----------------------------------------------------------------------------
  1677. def window_width
  1678. return 0
  1679. end
  1680. #-----------------------------------------------------------------------------
  1681. # Create Command List
  1682. #-----------------------------------------------------------------------------
  1683. def make_command_list
  1684. for command in SPDS::Info
  1685. add_command("", command[0])
  1686. end
  1687. end
  1688. #-----------------------------------------------------------------------------
  1689. # Get Page ID
  1690. #-----------------------------------------------------------------------------
  1691. def get_page_id
  1692. i = 0
  1693. for command in SPDS::Info
  1694. return command[0] if i == index
  1695. i += 1
  1696. end
  1697. return :page_1
  1698. end
  1699. end
  1700. #===============================================================================
  1701. class Window_StatusSPDS < Window_StatusDekita
  1702. #===============================================================================
  1703. #--------------------------------------------------------------------------
  1704. # Set Windowskin (overwrite from super)
  1705. #--------------------------------------------------------------------------
  1706. def set_the_skin
  1707. @skin = SPDS::Skins[:main_status]
  1708. end
  1709. end
  1710. #===============================================================================
  1711. class Window_SPDSStatus < Dekita_Core_Status
  1712. #===============================================================================
  1713. #-----------------------------------------------------------------------------
  1714. # Initialization
  1715. #-----------------------------------------------------------------------------
  1716. def initialize(actor,y)
  1717. x = Graphics.width/3
  1718. w = Graphics.width/3*2 - (Graphics.width / 4) + 20
  1719. h = Graphics.height-y
  1720. super(x, y, w, h, actor)
  1721. self.opacity = 0
  1722. end
  1723. #-----------------------------------------------------------------------------
  1724. # Get Setup Info
  1725. #-----------------------------------------------------------------------------
  1726. def setup_info
  1727. return SPDS::Info[@page]
  1728. end
  1729. end
  1730. #===============================================================================
  1731. class Window_SPDSStatusCHANGES < Dekita_Core_Status_Changes
  1732. #===============================================================================
  1733. #-----------------------------------------------------------------------------
  1734. # Initilize
  1735. #-----------------------------------------------------------------------------
  1736. def initialize(actor, y)
  1737. x = Graphics.width/4*3
  1738. w = Graphics.width/4
  1739. h = Graphics.height-y
  1740. super(x,y,w,h,actor)
  1741. self.opacity = 0
  1742. end
  1743. #-----------------------------------------------------------------------------
  1744. # Get Future Stats
  1745. #-----------------------------------------------------------------------------
  1746. def future_stat
  1747. return unless @dis_window
  1748. @temp_actor = Marshal.load(Marshal.dump(@actor))
  1749. spds = @actor.spds_set
  1750. page = SPDS::Commands[@dis_window.index]
  1751. @temp_actor.spds_stat_mods(spds[page],@dis_window.index) if @dis_window.index >= 0
  1752. refresh
  1753. end
  1754. #-----------------------------------------------------------------------------
  1755. # Get Setup Info
  1756. #-----------------------------------------------------------------------------
  1757. def setup_info
  1758. return SPDS::Info[@page]
  1759. end
  1760. #-----------------------------------------------------------------------------
  1761. # Draw Header
  1762. #-----------------------------------------------------------------------------
  1763. def draw_header(x,y,text,col,icon,hue,align)
  1764. draw_box(x, y)
  1765. # x = draw_stat_icons(icon, x, y, hue, all_icons_enable?)
  1766. change_color(col)
  1767. draw_text(x, y, wid, line_height, SPDS::Changes_Vocab, align)
  1768. return y += line_height
  1769. end
  1770. end
  1771. #===============================================================================
  1772. class Window_SPDS_Blank < Window_Selectable
  1773. #===============================================================================
  1774. #-----------------------------------------------------------------------------
  1775. # Initialization
  1776. #-----------------------------------------------------------------------------
  1777. def initialize(y)
  1778. super(Graphics.width/3, y, Graphics.width/3*2+1, Graphics.height - y)
  1779. refresh
  1780. end
  1781. end
  1782. #===============================================================================
  1783. class Window_SPDS_Gold_n_Time < Window_Base
  1784. #===============================================================================
  1785. #-----------------------------------------------------------------------------
  1786. # Object Initialization
  1787. #-----------------------------------------------------------------------------
  1788. def initialize(y,actor)
  1789. @actor = actor
  1790. super(0, y, Graphics.width/3, Graphics.height-y)
  1791. refresh
  1792. end
  1793. #-----------------------------------------------------------------------------
  1794. # Set Actor
  1795. #-----------------------------------------------------------------------------
  1796. def actor=(actor)
  1797. return unless @actor != actor
  1798. @actor = actor
  1799. refresh
  1800. end
  1801. #-----------------------------------------------------------------------------
  1802. # Refresh
  1803. #-----------------------------------------------------------------------------
  1804. def refresh
  1805. contents.clear
  1806. drAW_DE_INFO
  1807. end
  1808. #-----------------------------------------------------------------------------
  1809. # Draw The Info
  1810. #-----------------------------------------------------------------------------
  1811. def drAW_DE_INFO
  1812. y = 0
  1813. SPDS::IBox.each do |halp|
  1814. case halp[0]
  1815. when :gold then y = draw_degol(y,halp[1])
  1816. when :time then y = draw_detim(y,halp[1])
  1817. when :exp then y = draw_deexp(y,halp[1])
  1818. when :pts then y = draw_depts(y,halp[1])
  1819. end
  1820. end
  1821. end
  1822. #-----------------------------------------------------------------------------
  1823. # Draw The Gold
  1824. #-----------------------------------------------------------------------------
  1825. def draw_degol(y,halp)
  1826. x = get_de_x(halp[0])
  1827. contents.fill_rect(0,y+1,wid,line_height-2,Color.new(0,0,0,64))
  1828. draw_de_icon(halp[0],0,y,halp[1], true) if halp[0] > 0
  1829. draw_text(x,y,wid,line_height, halp[2])
  1830. draw_text(0,y,wid-4,line_height, $game_party.gold.to_i ,2)
  1831. return y += line_height
  1832. end
  1833. #-----------------------------------------------------------------------------
  1834. # Draw The Time
  1835. #-----------------------------------------------------------------------------
  1836. def draw_detim(y,halp)
  1837. t = Time.now
  1838. x = get_de_x(halp[0])
  1839. contents.fill_rect(0,y+1,wid,line_height-2,Color.new(0,0,0,64))
  1840. draw_de_icon(halp[0],0,y,halp[1], true) if halp[0] > 0
  1841. text = "#{t.strftime("%H")}:#{t.strftime("%M")}:#{t.strftime("%S")}"
  1842. draw_text(x,y,wid,line_height, halp[2])
  1843. draw_text(0,y,wid-4,line_height, text, 2)
  1844. return y += line_height
  1845. end
  1846. #-----------------------------------------------------------------------------
  1847. # Draw The Exp
  1848. #-----------------------------------------------------------------------------
  1849. def draw_deexp(y,halp)
  1850. return y unless @actor
  1851. x = get_de_x(halp[0])
  1852. contents.fill_rect(0,y+1,wid,line_height-2,Color.new(0,0,0,64))
  1853. draw_de_icon(halp[0],0,y,halp[1], true) if halp[0] > 0
  1854. text = "#{@actor.spendable_exp}"
  1855. draw_text(x,y,wid,line_height, halp[2])
  1856. draw_text(0,y,wid-4,line_height, text, 2)
  1857. return y += line_height
  1858. end
  1859. #-----------------------------------------------------------------------------
  1860. # Draw The Points
  1861. #-----------------------------------------------------------------------------
  1862. def draw_depts(y,halp)
  1863. return y unless @actor
  1864. x = get_de_x(halp[0])
  1865. contents.fill_rect(0,y+1,wid,line_height-2,Color.new(0,0,0,64))
  1866. draw_de_icon(halp[0],0,y,halp[1], true) if halp[0] > 0
  1867. text = "#{@actor.points}"
  1868. draw_text(x,y,wid,line_height, halp[2])
  1869. draw_text(0,y,wid-4,line_height, text, 2)
  1870. return y += line_height
  1871. end
  1872. #-----------------------------------------------------------------------------
  1873. # Get Width
  1874. #-----------------------------------------------------------------------------
  1875. def wid
  1876. self.width - (standard_padding*2)
  1877. end
  1878. #-----------------------------------------------------------------------------
  1879. # Get x Position
  1880. #-----------------------------------------------------------------------------
  1881. def get_de_x(icon)
  1882. return 0 if icon <= 0
  1883. return 25
  1884. end
  1885. end
  1886. #===============================================================================
  1887. class Scene_Map < Scene_Base
  1888. #===============================================================================
  1889. #-----------------------------------------------------------------------------
  1890. # Alias List
  1891. #-----------------------------------------------------------------------------
  1892. alias :updat_SPDSFLAG :update_scene
  1893. #-----------------------------------------------------------------------------
  1894. # Update Scene Transition
  1895. #-----------------------------------------------------------------------------
  1896. def update_scene
  1897. updat_SPDSFLAG
  1898. start_SPDS unless scene_changing?
  1899. end
  1900. #-----------------------------------------------------------------------------
  1901. # Update Scene Transition (To SPDS)
  1902. #-----------------------------------------------------------------------------
  1903. def start_SPDS
  1904. actor = $game_party.check_need_spds?
  1905. if actor != nil
  1906. SceneManager.call(Scene_SPDS)
  1907. SceneManager.scene.prepare(actor)
  1908. end
  1909. end
  1910. end
  1911. #===============================================================================
  1912. class Scene_Menu < Scene_MenuBase
  1913. #===============================================================================
  1914. #-----------------------------------------------------------------------------
  1915. # Alias List
  1916. #-----------------------------------------------------------------------------
  1917. alias :spdsmenu_create_command_window :create_command_window
  1918. alias :opok_spds_SM :on_personal_ok
  1919. #-----------------------------------------------------------------------------
  1920. # Create Command Window
  1921. #-----------------------------------------------------------------------------
  1922. def create_command_window
  1923. spdsmenu_create_command_window
  1924. @command_window.set_handler(:distribute, method(:command_personal))
  1925. end
  1926. #-----------------------------------------------------------------------------
  1927. # On Personal Ok
  1928. #-----------------------------------------------------------------------------
  1929. def on_personal_ok
  1930. opok_spds_SM
  1931. call_distriute if @command_window.current_symbol == :distribute
  1932. end
  1933. #-----------------------------------------------------------------------------
  1934. # Call SPDS Scene
  1935. #-----------------------------------------------------------------------------
  1936. def call_distriute
  1937. actor = $game_party.members[@status_window.index]
  1938. return @command_window.activate if !actor.can_distribute?
  1939. SceneManager.call(Scene_SPDS)
  1940. SceneManager.scene.prepare(actor)
  1941. end
  1942. end
  1943. #===============================================================================
  1944. class Scene_SPDS < Scene_MenuBase
  1945. #===============================================================================
  1946. #-----------------------------------------------------------------------------
  1947. # Prepare
  1948. #-----------------------------------------------------------------------------
  1949. def prepare(actor)
  1950. @real_actor = actor
  1951. @actor = @real_actor
  1952. end
  1953. #-----------------------------------------------------------------------------
  1954. # Start Processing
  1955. #-----------------------------------------------------------------------------
  1956. def start
  1957. super
  1958. @actor = @real_actor
  1959. create_command_window
  1960. create_help_window
  1961. create_SPDS_window
  1962. create_distribute_list
  1963. make_ibox_window
  1964. update_windows
  1965. end
  1966. #-----------------------------------------------------------------------------
  1967. # Create Command Window
  1968. #-----------------------------------------------------------------------------
  1969. def create_command_window
  1970. @command_window = Window_SPDSCommand.new(0,0)
  1971. @command_window.set_handler(:cancel, method(:return_scene))
  1972. @command_window.set_handler(:pagedown, method(:next_actor))
  1973. @command_window.set_handler(:pageup, method(:prev_actor))
  1974. @command_window.set_handler(:pageup, method(:prev_actor))
  1975. @command_window.set_handler(:spend, method(:spend_pts))
  1976. @command_window.set_handler(:exit, method(:return_scene))
  1977. @fake_command_window = Window_SPDSCommandII.new(0,0)
  1978. @fake_command_window.deactivate
  1979. end
  1980. #-----------------------------------------------------------------------------
  1981. # Create Halp Window
  1982. #-----------------------------------------------------------------------------
  1983. def create_help_window
  1984. @help_window = Deki_Help.new
  1985. @help_window.viewport = @viewport
  1986. @help_window.x = Graphics.width / 4
  1987. end
  1988. #-----------------------------------------------------------------------------
  1989. # Create SPDS Window
  1990. #-----------------------------------------------------------------------------
  1991. def create_SPDS_window
  1992. y = @help_window.height
  1993. @status_window = Window_StatusSPDS.new(@actor, y)
  1994. y = (@status_window.y+@status_window.height)
  1995. @blank_window = Window_SPDS_Blank.new(y)
  1996. @SPDS_window = Window_SPDSStatus.new(@actor, y)
  1997. end
  1998. #-----------------------------------------------------------------------------
  1999. # Create Distribution List
  2000. #-----------------------------------------------------------------------------
  2001. def create_distribute_list
  2002. y = @status_window.y + @status_window.height
  2003. @dis_window = Window_SPDS_DistributeCommand.new(0,y)
  2004. @dis_window.set_handler(:spend_pts, method(:spend_dis_point))
  2005. @dis_window.set_handler(:end_distribute, method(:cancel_spend))
  2006. @dis_window.set_handler(:cancel, method(:cancel_spend))
  2007. @dis_window.actor = @actor if @actor
  2008. @dis_window.index = -1
  2009. # << Changes Window
  2010. @temp_act_SPDS_Window = Window_SPDSStatusCHANGES.new(@actor, y)
  2011. @temp_act_SPDS_Window.dis_window = @dis_window
  2012. end
  2013. #-----------------------------------------------------------------------------
  2014. # Make IBox Window
  2015. #-----------------------------------------------------------------------------
  2016. def make_ibox_window
  2017. y = @status_window.y+@status_window.height+@dis_window.height
  2018. @gold_time_wind = Window_SPDS_Gold_n_Time.new(y,@actor)
  2019. @ibox_time = Time.now.sec
  2020. end
  2021. #-----------------------------------------------------------------------------
  2022. # Change Actors
  2023. #-----------------------------------------------------------------------------
  2024. def on_actor_change
  2025. @temp_act_SPDS_Window.actor = @actor
  2026. @gold_time_wind.actor = @actor
  2027. @status_window.actor = @actor
  2028. @SPDS_window.actor = @actor
  2029. @dis_window.actor = @actor
  2030. @command_window.activate
  2031. end
  2032. #-----------------------------------------------------------------------------
  2033. # Spend Points
  2034. #-----------------------------------------------------------------------------
  2035. def spend_pts
  2036. @command_window.deactivate
  2037. @command_window.index = -1
  2038. @dis_window.activate
  2039. @dis_window.index = 0
  2040. @temp_act_SPDS_Window.future_stat
  2041. end
  2042. #-----------------------------------------------------------------------------
  2043. # Cancel Spend Points
  2044. #-----------------------------------------------------------------------------
  2045. def cancel_spend
  2046. @dis_window.deactivate
  2047. @dis_window.index = -1
  2048. @temp_act_SPDS_Window.future_stat
  2049. @command_window.activate
  2050. @command_window.index = 0
  2051. end
  2052. #-----------------------------------------------------------------------------
  2053. # Confirm Spend Points
  2054. #-----------------------------------------------------------------------------
  2055. def spend_dis_point
  2056. spds = @actor.spds_set
  2057. page = SPDS::Commands[@dis_window.index]
  2058. @actor.spds_stat_mods(spds[page],@dis_window.index)
  2059. @temp_act_SPDS_Window.future_stat
  2060. @gold_time_wind.refresh
  2061. @SPDS_window.refresh
  2062. @status_window.refresh
  2063. @dis_window.refresh
  2064. @dis_window.activate
  2065. end
  2066. #-----------------------------------------------------------------------------
  2067. # Update
  2068. #-----------------------------------------------------------------------------
  2069. def update
  2070. super
  2071. update_windows
  2072. update_gold_n_time
  2073. end
  2074. #-----------------------------------------------------------------------------
  2075. # Update windows
  2076. #-----------------------------------------------------------------------------
  2077. def update_windows
  2078. update_fake_command
  2079. @SPDS_window.page = @fake_command_window.get_page_id
  2080. @temp_act_SPDS_Window.page = @fake_command_window.get_page_id
  2081. if @dis_window.active
  2082. @help_window.set_text(@dis_window.get_command_help)
  2083. if @dis_window.current_symbol == :end_distribute
  2084. @temp_act_SPDS_Window.show_no_stats
  2085. # @temp_act_SPDS_Window.page = nil
  2086. end
  2087. else
  2088. @help_window.set_text(@actor.description) if @actor
  2089. end
  2090. update_dis_window
  2091. end
  2092. #-----------------------------------------------------------------------------
  2093. # Update Fake Command Window
  2094. #-----------------------------------------------------------------------------
  2095. def update_fake_command
  2096. max_page = SPDS::Max_Pages-1
  2097. if Keys.trigger?(:RSHIFT)
  2098. @fake_command_window.index += 1 if @fake_command_window.index <= max_page
  2099. end
  2100. if Keys.trigger?(:LSHIFT)
  2101. @fake_command_window.index -= 1 if @fake_command_window.index >= 0
  2102. end
  2103. @fake_command_window.index = 0 if @fake_command_window.index > max_page
  2104. @fake_command_window.index = max_page if @fake_command_window.index < 0
  2105. end
  2106. #-----------------------------------------------------------------------------
  2107. # Update dis Window
  2108. #-----------------------------------------------------------------------------
  2109. def update_dis_window
  2110. return unless @dis_window.active
  2111. return unless @dis_window.current_symbol != :end_distribute
  2112. return unless Input.trigger?(:DOWN) || Input.trigger?(:UP)
  2113. @temp_act_SPDS_Window.future_stat
  2114. end
  2115. #-----------------------------------------------------------------------------
  2116. # Update Gold / Time Window
  2117. #-----------------------------------------------------------------------------
  2118. def update_gold_n_time
  2119. return unless SPDS::Showing_Time
  2120. return unless @ibox_time != Time.now.sec
  2121. @gold_time_wind.refresh
  2122. @ibox_time = Time.now.sec
  2123. end
  2124. #-----------------------------------------------------------------------------
  2125. # Create Backgrounds
  2126. #-----------------------------------------------------------------------------
  2127. def get_all_bgs
  2128. return unless $D13x[:Scene_BGs]
  2129. @bg_set = SPDS::BGs
  2130. end
  2131. end
  2132. #==============================================================================#
  2133. # http://dekitarpg.wordpress.com/ #
  2134. #==============================================================================#
  2135. end # if true # << Make true to use this script, false to disable.
RAW Paste Data