Advertisement
Dekita

ISPDS v1.4

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