Advertisement
Dekita

Atl Dfl 1.4

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