Advertisement
Dekita

$D13x - ISPDS v1.0

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