Advertisement
Dekita

$D13x - ISPDS v1.2

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