Advertisement
Dekita

$D13x ISPDS v1.3

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