Advertisement
Dekita

$D13x ISPDS v1.1

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