Advertisement
Dekita

$D13x Atl/Dfl v1.0

May 21st, 2013
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.77 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Attack | Defence Levels
  5. # -- Author : Dekita
  6. # -- Version : 1.0
  7. # -- Level : Easy / Normal
  8. # -- Requires : N/A
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:Atk_Def_Lvs]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # 20/o5/2o13 - Complete Rewrite Of Old Script, (Moved to $D13x Engine v1.0)
  21. # 21/10/2o12 - Finished v1.4, (Perfect Atl & Dfl(old script))
  22. #
  23. #===============================================================================
  24. # ☆ Introduction
  25. #-------------------------------------------------------------------------------
  26. # This script is a replica of a feature from an MMORPG called PWi.
  27. # You now have two new stats, atl (attack lv) and dfl (defence lv).
  28. #
  29. # For every 1 atl (Attack Level) you have above your targets dfl (Defence Level)
  30. # you will deal 1% more damage.
  31. #
  32. # For every 1 dfl (Defence Level) you have above your targets atl (Attack Level)
  33. # you will take 1% less damage.
  34. # The same rule applies for actor and enemies.
  35. #
  36. # You can increase your Atk Lv / Def Lv a number of different ways,
  37. # via notetags, script calls && other scripts (like my distribution system).
  38. #
  39. #===============================================================================
  40. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  41. #===============================================================================
  42. # 1. You MUST give credit to "Dekita" !!
  43. # 2. You are NOT allowed to repost this script.(or modified versions)
  44. # 3. You are NOT allowed to convert this script.
  45. # 4. You are NOT allowed to use this script for Commercial games.
  46. # 5. ENJOY!
  47. #
  48. # "FINE PRINT"
  49. # By using this script you hereby agree to the above terms and conditions,
  50. # if any violation of the above terms occurs "legal action" may be taken.
  51. # Not understanding the above terms and conditions does NOT mean that
  52. # they do not apply to you.
  53. # If you wish to discuss the terms and conditions in further detail you can
  54. # contact me at http://dekitarpg.wordpress.com/
  55. #
  56. #===============================================================================
  57. # ☆ Instructions
  58. #-------------------------------------------------------------------------------
  59. # Place Below >>
  60. # " ▼ Materials "
  61. # " $D13x Statistic Control "
  62. # " $D13x Elements Control "
  63. #
  64. # Place Above >>
  65. # " ▼ Main "
  66. # " $D13x Equipment Sets"
  67. # " $D13x Dev Stat Lvl Up Distribution"
  68. # " $D13x Learn Skill Reqs "
  69. # " $D13x Equip Reqs"
  70. #
  71. # Placing this script in this order will prevent bugs / faults / FPS drop.
  72. # NONE of the above scripts are required for this script to work !!
  73. #
  74. #===============================================================================
  75. # ☆ Notetags ( default )
  76. # For : Weapons / Armors / Enemies / Actors / Classes / States / Skills / Items
  77. #-------------------------------------------------------------------------------
  78. # <atl: value>
  79. # <dfl: value>
  80. # use these notetags to increase the atl / dfl of an item, eg. give to an equip
  81. # for it to increase a stat when equipped..
  82. #
  83. # <max atl: value>
  84. # <max dfl: value>
  85. # use these notetags to increase the MAX atl / dfl of an item,
  86. # eg. give to an skill for it to increase the max atl / dfl when learned..
  87. #
  88. # <no atl>
  89. # <no dfl>
  90. # use these notetag to change whether atl or dfl can be ignored, eg. if actor
  91. # (or enemy) has a state that has <no atl> attack level modification will not
  92. # happen.
  93. #
  94. #-------------------------------------------------------------------------------
  95. # All Increases and Decreases are stacked, using the following calculation ..
  96. # Base + Actor(or Enemy) + Class(if actor) + Equipment(if actor) + States +
  97. # Skills that modify stats or max stats (ie passive skills) (if actor)
  98. #
  99. #===============================================================================
  100. # ☆ Script Calls
  101. #-------------------------------------------------------------------------------
  102. # $game_actor[ACTOR_ID].add_atl(VALUE)
  103. # $game_actor[ACTOR_ID].sub_atl(VALUE)
  104. # $game_actor[ACTOR_ID].div_atl(VALUE)
  105. # $game_actor[ACTOR_ID].mul_atl(VALUE)
  106. # $game_actor[ACTOR_ID].mod_atl(VALUE)
  107. # ^- Script calls to control Attack Level
  108. #
  109. # $game_actor[ACTOR_ID].add_dfl(VALUE)
  110. # $game_actor[ACTOR_ID].sub_dfl(VALUE)
  111. # $game_actor[ACTOR_ID].div_dfl(VALUE)
  112. # $game_actor[ACTOR_ID].mul_dfl(VALUE)
  113. # $game_actor[ACTOR_ID].mod_dfl(VALUE)
  114. # ^- Script calls to control Defence Level
  115. #
  116. # these are the calculatons for each control type
  117. # add : current stat += value
  118. # sub : current stat -= value
  119. # div : current stat /= value
  120. # mul : current stat *= value
  121. # mod : current stat %= value
  122. #
  123. # These script calls modify the Actor value, other items remain in the same order.
  124. #
  125. #===============================================================================
  126. # ☆ HELP
  127. #-------------------------------------------------------------------------------
  128. # You can use atl and dfl in your skilll formulas and conditional branches...
  129. # Here is an example for a skill formula
  130. # [(a.atk+a.atl*2) - (b.def+b.dfl*1.5), 0].min
  131. #
  132. # Here is an example for a conditional branch
  133. # $game_actors[ACTOR_ID].atl > 5
  134. # ^- Checks if actor (ACTOR_ID) has atl to a value greater than 5
  135. #
  136. # $game_actors[ACTOR_ID].atl <= 5
  137. # ^- Checks if actor (ACTOR_ID) has atl to a value lower than or equal to 5
  138. #
  139. #===============================================================================
  140. module Atl_Dfl
  141. #===============================================================================
  142.  
  143. Atl_Name = "Attack Lv"
  144. Dfl_Name = "Defence Lv"
  145.  
  146. # Limits = [ min , max ]
  147. Atl_Limits = [ 0 , 99 ]
  148. Dfl_Limits = [ 0 , 99 ]
  149.  
  150. Notes={
  151. :atk_lvl => /<atl:(.*)>/i,
  152. :def_lvl => /<dfl:(.*)>/i,
  153. :no_atk_ => /<no atl>/i,
  154. :no_atk_ => /<no dfl>/i,
  155. :max_atk => /<max atl:(.*)>/i,
  156. :max_def => /<max dfl:(.*)>/i,
  157. }
  158. #####################
  159. # CUSTOMISATION END #
  160. end #####################
  161. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  162. # #
  163. # http://dekitarpg.wordpress.com/ #
  164. # #
  165. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  166. #===============================================================================#
  167. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  168. # YES?\.\. #
  169. # OMG, REALLY? \| #
  170. # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
  171. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  172. #===============================================================================#
  173. module DataManager
  174. #===============================================================================
  175. #-----------------------------------------------------------------------------
  176. # Alias List
  177. #-----------------------------------------------------------------------------
  178. class <<self
  179. alias :ldb_atk_level :load_database
  180. end
  181. #-----------------------------------------------------------------------------
  182. # Load Database
  183. #-----------------------------------------------------------------------------
  184. def self.load_database
  185. ldb_atk_level
  186. loa_atk_level
  187. end
  188. #-----------------------------------------------------------------------------
  189. # Load Attack Level
  190. #-----------------------------------------------------------------------------
  191. def self.loa_atk_level
  192. classes = [$data_weapons, $data_armors , $data_items , $data_skills ,
  193. $data_actors , $data_classes, $data_enemies, $data_states ]
  194. for g in classes
  195. for o in g
  196. next if o == nil
  197. o.load_attack_level
  198. end
  199. end
  200. end
  201.  
  202. end
  203.  
  204. #===============================================================================
  205. class RPG::BaseItem
  206. #===============================================================================
  207. #-----------------------------------------------------------------------------
  208. # Pi Variables
  209. #-----------------------------------------------------------------------------
  210. attr_accessor :atk_level
  211. attr_accessor :def_level
  212. attr_accessor :atk_level_limit
  213. attr_accessor :def_level_limit
  214. attr_accessor :ignore_atl
  215. attr_accessor :ignore_dfl
  216. #-----------------------------------------------------------------------------
  217. # Load Attack Level
  218. #-----------------------------------------------------------------------------
  219. def load_attack_level
  220. @atk_level = 0
  221. @def_level = 0
  222. @ignore_atl = false
  223. @ignore_dfl = false
  224. @atk_level_limit = 0
  225. @def_level_limit = 0
  226. self.note.split(/[\r\n]+/).each do |line|
  227. case line
  228. when Atl_Dfl::Notes[:atk_lvl] then @atk_level = $1.to_i
  229. when Atl_Dfl::Notes[:def_lvl] then @def_level = $1.to_i
  230. when Atl_Dfl::Notes[:no_atk_] then @ignore_atl = true
  231. when Atl_Dfl::Notes[:no_def_] then @ignore_dfl = true
  232. when Atl_Dfl::Notes[:max_atk] then @atk_level_limit = $1.to_i
  233. when Atl_Dfl::Notes[:max_def] then @def_level_limit = $1.to_i
  234. end
  235. end
  236. end
  237.  
  238. end
  239.  
  240. #===============================================================================
  241. class RPG::Weapon < RPG::EquipItem
  242. #===============================================================================
  243. #-----------------------------------------------------------------------------
  244. # Alias List
  245. #-----------------------------------------------------------------------------
  246. alias :atk_level_perf :performance
  247. #-----------------------------------------------------------------------------
  248. # Performance
  249. #-----------------------------------------------------------------------------
  250. def performance
  251. atk_level_perf + atk_levl_performance
  252. end
  253. #-----------------------------------------------------------------------------
  254. # Attack Level Performance
  255. #-----------------------------------------------------------------------------
  256. def atk_levl_performance
  257. @atk_level + @def_level * 10
  258. end
  259.  
  260. end
  261.  
  262. #===============================================================================
  263. class RPG::Armor < RPG::EquipItem
  264. #===============================================================================
  265. #-----------------------------------------------------------------------------
  266. # Alias List
  267. #-----------------------------------------------------------------------------
  268. alias :atk_level_perf :performance
  269. #-----------------------------------------------------------------------------
  270. # Performance
  271. #-----------------------------------------------------------------------------
  272. def performance
  273. atk_level_perf + atk_levl_performance
  274. end
  275. #-----------------------------------------------------------------------------
  276. # Attack Level Performance
  277. #-----------------------------------------------------------------------------
  278. def atk_levl_performance
  279. @atk_level + @def_level * 10
  280. end
  281.  
  282. end
  283.  
  284. #===============================================================================
  285. class Game_BattlerBase
  286. #===============================================================================
  287. #-----------------------------------------------------------------------------
  288. # Constants
  289. #-----------------------------------------------------------------------------
  290. F_atk_level = 19052013
  291. #-----------------------------------------------------------------------------
  292. # Alias List
  293. #-----------------------------------------------------------------------------
  294. alias :init_atk_level :initialize
  295. #-----------------------------------------------------------------------------
  296. # Initialize
  297. #-----------------------------------------------------------------------------
  298. def initialize(*args, &block)
  299. @atl_dfl_prefix = [0] * 2
  300. clear_atl_dfl_plus
  301. init_atk_level(*args, &block)
  302. end
  303. #-----------------------------------------------------------------------------
  304. # Atk Lv | Def Lv
  305. #-----------------------------------------------------------------------------
  306. def atl ; atl_dfl(0) ; end
  307. def dfl ; atl_dfl(1) ; end
  308. #-----------------------------------------------------------------------------
  309. # Atk Lv | Def Lv Min
  310. #-----------------------------------------------------------------------------
  311. def atl_dfl_min(id)
  312. return Atl_Dfl::Atl_Limits[0] if id == 0
  313. return Atl_Dfl::Dfl_Limits[0] if id == 1
  314. return 0
  315. end
  316. #-----------------------------------------------------------------------------
  317. # Atk Lv | Def Lv Max
  318. #-----------------------------------------------------------------------------
  319. def atl_dfl_max(id)
  320. return Atl_Dfl::Atl_Limits[1] if id == 0
  321. return Atl_Dfl::Dfl_Limits[1] if id == 1
  322. return 0
  323. end
  324. #-----------------------------------------------------------------------------
  325. # Atk Lv | Def Lv
  326. #-----------------------------------------------------------------------------
  327. def atl_dfl(id)
  328. valu = features_sum(F_atk_level, id) + atl_dfl_plus(id)
  329. newv = [[valu, atl_dfl_max(id)].min, atl_dfl_min(id)].max.to_i
  330. @atl_dfl_prefix[id] = newv
  331. @atl_dfl_prefix[id]
  332. end
  333. #-----------------------------------------------------------------------------
  334. # Atk Lv | Def Lv ++
  335. #-----------------------------------------------------------------------------
  336. def atl_dfl_plus(id)
  337. @atl_dfl_plus[id]
  338. end
  339. #-----------------------------------------------------------------------------
  340. # Clear Atk Lv | Def Lv
  341. #-----------------------------------------------------------------------------
  342. def clear_atl_dfl_plus
  343. @atl_dfl_plus = [0] * 2
  344. end
  345. #-----------------------------------------------------------------------------
  346. # Add Atk Lv
  347. #-----------------------------------------------------------------------------
  348. def add_atl(value, ref = true)
  349. @atl_dfl_plus[0] += value
  350. refresh if ref
  351. end
  352. #-----------------------------------------------------------------------------
  353. # Sub Atk Lv
  354. #-----------------------------------------------------------------------------
  355. def sub_atl(value, ref = true)
  356. @atl_dfl_plus[0] -= value
  357. refresh if ref
  358. end
  359. #-----------------------------------------------------------------------------
  360. # Div Atk Lv
  361. #-----------------------------------------------------------------------------
  362. def div_atl(value, ref = true)
  363. @atl_dfl_plus[0] /= value
  364. refresh if ref
  365. end
  366. #-----------------------------------------------------------------------------
  367. # Mul Atk Lv
  368. #-----------------------------------------------------------------------------
  369. def mul_atl(value, ref = true)
  370. @atl_dfl_plus[0] *= value
  371. refresh if ref
  372. end
  373. #-----------------------------------------------------------------------------
  374. # Mod Atk Lv
  375. #-----------------------------------------------------------------------------
  376. def mod_atl(value, ref = true)
  377. @atl_dfl_plus[0] %= value
  378. refresh if ref
  379. end
  380. #-----------------------------------------------------------------------------
  381. # Add Dfl Lv
  382. #-----------------------------------------------------------------------------
  383. def add_dfl(value, ref = true)
  384. @atl_dfl_plus[1] += value
  385. refresh if ref
  386. end
  387. #-----------------------------------------------------------------------------
  388. # Sub Dfl Lv
  389. #-----------------------------------------------------------------------------
  390. def sub_dfl(value, ref = true)
  391. @atl_dfl_plus[1] -= value
  392. refresh if ref
  393. end
  394. #-----------------------------------------------------------------------------
  395. # Div Dfl Lv
  396. #-----------------------------------------------------------------------------
  397. def div_dfl(value, ref = true)
  398. @atl_dfl_plus[1] /= value
  399. refresh if ref
  400. end
  401. #-----------------------------------------------------------------------------
  402. # Mul Dfl Lv
  403. #-----------------------------------------------------------------------------
  404. def mul_dfl(value, ref = true)
  405. @atl_dfl_plus[1] *= value
  406. refresh if ref
  407. end
  408. #-----------------------------------------------------------------------------
  409. # Mod Dfl Lv
  410. #-----------------------------------------------------------------------------
  411. def mod_dfl(value, ref = true)
  412. @atl_dfl_plus[1] %= value
  413. refresh if ref
  414. end
  415.  
  416. end # Game_BattlerBase
  417.  
  418. #===============================================================================
  419. class Game_Battler < Game_BattlerBase
  420. #===============================================================================
  421. #-----------------------------------------------------------------------------
  422. # Alias List
  423. #-----------------------------------------------------------------------------
  424. alias :dflandatlmdv :make_damage_value
  425. alias :atlanddflapplyguard :apply_guard
  426. #-----------------------------------------------------------------------------
  427. # Make Damage Value
  428. #-----------------------------------------------------------------------------
  429. def make_damage_value(user, item)
  430. @temp_atl_dfl_mod_for_user = user
  431. @temp_atl_dfl_mod_for_item = item
  432. dflandatlmdv(user, item)
  433. end
  434. #-----------------------------------------------------------------------------
  435. # Apply Guard
  436. #-----------------------------------------------------------------------------
  437. def apply_guard(damage)
  438. newd = (atlanddflapplyguard(damage)*apply_atl_dfl_mod)
  439. newd
  440. end
  441. #-----------------------------------------------------------------------------
  442. # Apply Atk Lv || Def Lv Damage Mod
  443. #-----------------------------------------------------------------------------
  444. def apply_atl_dfl_mod
  445. user = @temp_atl_dfl_mod_for_user
  446. item = @temp_atl_dfl_mod_for_item
  447. atlval = ((100 + user.atl) * 0.01)
  448. atlval = 1 if user.can_ignore_atl || item.ignore_atl
  449. dflval = (1.0 - (dfl * 0.01))
  450. dflval = 1 if user.can_ignore_dfl || item.ignore_dfl
  451. newdam = (atlval*dflval)
  452. newdam
  453. end
  454.  
  455. end
  456.  
  457. #===============================================================================
  458. class Game_Actor < Game_Battler
  459. #===============================================================================
  460. #-----------------------------------------------------------------------------
  461. # Can Ignore ATL Mod
  462. #-----------------------------------------------------------------------------
  463. def can_ignore_atl
  464. return true if actor.ignore_atl
  465. return true if self.class.ignore_atl
  466. equips.each do |e|
  467. next unless e
  468. return true if e.ignore_atl
  469. end
  470. states.each do |st|
  471. next unless st
  472. return true if st.ignore_atl
  473. end
  474. skills.each do |sk|
  475. next unless sk
  476. return true if sk.ignore_atl
  477. end
  478. return false
  479. end
  480. #-----------------------------------------------------------------------------
  481. # Can Ignore DFL Mod
  482. #-----------------------------------------------------------------------------
  483. def can_ignore_dfl
  484. return true if actor.ignore_dfl
  485. return true if self.class.ignore_dfl
  486. equips.each do |e|
  487. next unless e
  488. return true if e.ignore_dfl
  489. end
  490. states.each do |st|
  491. next unless st
  492. return true if st.ignore_dfl
  493. end
  494. skills.each do |sk|
  495. next unless sk
  496. return true if sk.ignore_dfl
  497. end
  498. return false
  499. end
  500. #-----------------------------------------------------------------------------
  501. # Atk Lv | Def Lv ++
  502. #-----------------------------------------------------------------------------
  503. def atl_dfl_plus(id)
  504. base = super
  505. base += atl_level_plus_mods if id == 0
  506. base += dfl_level_plus_mods if id == 1
  507. base
  508. end
  509. #-----------------------------------------------------------------------------
  510. # Atk Lv ++ Modifications
  511. #-----------------------------------------------------------------------------
  512. def atl_level_plus_mods
  513. base = 0
  514. base += actor.atk_level
  515. base += self.class.atk_level
  516. base += equips.compact.inject(0) {|r, i| r += i.atk_level }
  517. base += states.compact.inject(0) {|r, i| r += i.atk_level }
  518. if $D13x[:Skill_Lv]
  519. base += skills.compact.inject(0) {|r, i| r += (i.atk_level*
  520. Skill_Levels::Exp_Set[i.exp_set][@skills_lv[i.id]][2] ).to_i}
  521. else
  522. base += skills.compact.inject(0) {|r, i| r += i.atk_level }
  523. end
  524. base
  525. end
  526. #-----------------------------------------------------------------------------
  527. # Def Lv ++ Modifications
  528. #-----------------------------------------------------------------------------
  529. def dfl_level_plus_mods
  530. base = 0
  531. base += actor.def_level
  532. base += self.class.def_level
  533. base += equips.compact.inject(0) {|r, i| r += i.def_level }
  534. base += states.compact.inject(0) {|r, i| r += i.def_level }
  535. if $D13x[:Skill_Lv]
  536. base += skills.compact.inject(0) {|r, i| r += (i.def_level*
  537. Skill_Levels::Exp_Set[i.exp_set][@skills_lv[i.id]][2] ).to_i}
  538. else
  539. base += skills.compact.inject(0) {|r, i| r += i.def_level }
  540. end
  541. base
  542. end
  543. #-----------------------------------------------------------------------------
  544. # Atk Lv | Def Lv Max
  545. #-----------------------------------------------------------------------------
  546. def atl_dfl_max(id)
  547. base = super
  548. case id
  549. when 0 then base += calc_atl_mods_max
  550. when 1 then base += calc_dfl_mods_max
  551. end
  552. base
  553. end
  554. #-----------------------------------------------------------------------------
  555. # Calculate Atk Lv Max
  556. #-----------------------------------------------------------------------------
  557. def calc_atl_mods_max
  558. base = actor.atk_level_limit
  559. base += self.class.atk_level_limit
  560. base += equips.compact.inject(0) {|r, i| r += i.atk_level_limit }
  561. base += states.compact.inject(0) {|r, i| r += i.atk_level_limit }
  562. if $D13x[:Skill_Lv]
  563. base += skills.compact.inject(0) {|r, i| r += (i.atk_level_limit*
  564. Skill_Levels::Exp_Set[i.exp_set][@skills_lv[i.id]][2] ).to_i}
  565. else
  566. base += skills.compact.inject(0) {|r, i| r += i.atk_level_limit }
  567. end
  568. base
  569. end
  570. #-----------------------------------------------------------------------------
  571. # Calculate Def Lv Max
  572. #-----------------------------------------------------------------------------
  573. def calc_dfl_mods_max
  574. base = actor.def_level_limit
  575. base += self.class.def_level_limit
  576. base += equips.compact.inject(0) {|r, i| r += i.def_level_limit }
  577. base += states.compact.inject(0) {|r, i| r += i.def_level_limit }
  578. if $D13x[:Skill_Lv]
  579. base += skills.compact.inject(0) {|r, i| r += (i.def_level_limit*
  580. Skill_Levels::Exp_Set[i.exp_set][@skills_lv[i.id]][2] ).to_i}
  581. else
  582. base += skills.compact.inject(0) {|r, i| r += i.def_level_limit }
  583. end
  584. base
  585. end
  586.  
  587. end
  588.  
  589. #===============================================================================
  590. class Game_Enemy < Game_Battler
  591. #===============================================================================
  592. #-----------------------------------------------------------------------------
  593. # Can Ignore ATL Mod
  594. #-----------------------------------------------------------------------------
  595. def can_ignore_atl
  596. return true if enemy.ignore_atl
  597. states.each do |st|
  598. next unless st
  599. return true if st.ignore_atl
  600. end
  601. return false
  602. end
  603. #-----------------------------------------------------------------------------
  604. # Can Ignore DFL Mod
  605. #-----------------------------------------------------------------------------
  606. def can_ignore_dfl
  607. return true if enemy.ignore_dfl
  608. states.each do |st|
  609. next unless st
  610. return true if st.ignore_dfl
  611. end
  612. return false
  613. end
  614. #-----------------------------------------------------------------------------
  615. # Atk Lv | Def Lv ++
  616. #-----------------------------------------------------------------------------
  617. def atl_dfl_plus(id)
  618. base = super
  619. base += atl_level_plus_mods if id == 0
  620. base += dfl_level_plus_mods if id == 1
  621. base
  622. end
  623. #-----------------------------------------------------------------------------
  624. # Atk Lv ++ Modifications
  625. #-----------------------------------------------------------------------------
  626. def atl_level_plus_mods
  627. base = 0
  628. base += enemy.atk_level
  629. base += states.compact.inject(0) {|r, i| r += i.atk_level }
  630. base
  631. end
  632. #-----------------------------------------------------------------------------
  633. # Def Lv ++ Modifications
  634. #-----------------------------------------------------------------------------
  635. def dfl_level_plus_mods
  636. base = 0
  637. base += enemy.def_level
  638. base += states.compact.inject(0) {|r, i| r += i.def_level }
  639. base
  640. end
  641. #-----------------------------------------------------------------------------
  642. # Atk Lv | Def Lv Max
  643. #-----------------------------------------------------------------------------
  644. def atl_dfl_max(id)
  645. base = super
  646. case id
  647. when 0 then base += calc_atl_mods_max
  648. when 1 then base += calc_dfl_mods_max
  649. end
  650. base
  651. end
  652. #-----------------------------------------------------------------------------
  653. # Calculate Atk Lv Max
  654. #-----------------------------------------------------------------------------
  655. def calc_atl_mods_max
  656. base = enemy.atk_level_limit
  657. base += states.compact.inject(0) {|r, i| r += i.atk_level_limit }
  658. base
  659. end
  660. #-----------------------------------------------------------------------------
  661. # Calculate Def Lv Max
  662. #-----------------------------------------------------------------------------
  663. def calc_dfl_mods_max
  664. base = enemy.def_level_limit
  665. base += states.compact.inject(0) {|r, i| r += i.def_level_limit }
  666. base
  667. end
  668.  
  669. end
  670.  
  671. #==============================================================================#
  672. # http://dekitarpg.wordpress.com/ #
  673. #==============================================================================#
  674. end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement