mrbubble

KGC_EnemyGuide + Yanfly New Battle Stats Patch (DEX, RES, DU

Aug 25th, 2011
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 4.91 KB | None | 0 0
  1. #==============================================================================
  2. # KGC_EnemyGuide + Yanfly New Battle Stats Patch (DEX, RES, DUR, and LUK)
  3. # v0.1 (August 24, 2011)
  4. # By Mr. Bubble
  5. #==============================================================================
  6. # Installation: Insert this patch into its own page below KGC Enemy Guide in
  7. #               your script editor.
  8. #------------------------------------------------------------------------------
  9. # This patch allows you to show an enemy's Yanfly stats in KGC Enemy Guide.
  10. # No customization is required in this script. Just install it.
  11. #
  12. # This is a *very* badly made patch. If anyone wants to clean it up or make a
  13. # better one, feel free to.
  14. #==============================================================================
  15.  
  16. #==============================================================================
  17. #------------------------------------------------------------------------------
  18. #------- Do not edit below this point unless you know what you're doing -------
  19. #------------------------------------------------------------------------------
  20. #==============================================================================
  21.  
  22.  
  23. class Window_EnemyGuideStatus < Window_Base
  24.   def draw_parameter2(dx, dy)
  25.     # ATK ~ AGI
  26.     param = {}
  27.     if KGC::Commands.enemy_defeated?(enemy.id)
  28.       param[:atk]   = enemy.atk
  29.       param[:def]   = enemy.def
  30.       param[:spi]   = enemy.spi
  31.       param[:agi]   = enemy.agi
  32.       # Enemy DEX
  33.       if $imported["BattlerStatDEX"] || $imported["DEX Stat"]
  34.         param[:dex] = enemy.dex
  35.       end
  36.       # Enemy RES
  37.       if $imported["BattlerStatRES"] || $imported["RES Stat"]
  38.         param[:res] = enemy.res
  39.       end
  40.       # Enemy DUR
  41.       if $imported["ClassStatDUR"]
  42.         param[:dur] = enemy.base_dur
  43.       end
  44.       # Enemy LUK
  45.       if $imported["ClassStatLUK"]
  46.         param[:luk] = enemy.base_luk
  47.       end
  48.     else
  49.       param[:atk] = param[:def] = param[:spi] = param[:agi] =
  50.         KGC::EnemyGuide::UNDEFEATED_PARAMETER
  51.       # Enemy DEX
  52.       if $imported["BattlerStatDEX"] || $imported["DEX Stat"]
  53.         param[:dex] = KGC::EnemyGuide::UNDEFEATED_PARAMETER
  54.       end
  55.       # Enemy RES
  56.       if $imported["BattlerStatRES"] || $imported["RES Stat"]
  57.         param[:res] = KGC::EnemyGuide::UNDEFEATED_PARAMETER
  58.       end
  59.       # Enemy DUR
  60.       if $imported["ClassStatDUR"]
  61.         param[:dur] = KGC::EnemyGuide::UNDEFEATED_PARAMETER
  62.       end
  63.       # Enemy LUK
  64.       if $imported["ClassStatLUK"]
  65.         param[:luk] = KGC::EnemyGuide::UNDEFEATED_PARAMETER
  66.       end
  67.     end
  68.     dw = (width - 32) / 2
  69.     dw = (width - 32) / 3 if param.size > 4
  70.     dw = (width - 32) / 4 if param.size > 6
  71.     self.contents.font.color = system_color
  72.     self.contents.draw_text(dx,      dy,       80, WLH, Vocab.atk)
  73.     self.contents.draw_text(dx + dw, dy,       80, WLH, Vocab.def)
  74.     self.contents.draw_text(dx,      dy + WLH, 80, WLH, Vocab.spi)
  75.     self.contents.draw_text(dx + dw, dy + WLH, 80, WLH, Vocab.agi)
  76.    
  77.     if $imported["BattlerStatRES"] || $imported["RES Stat"]
  78.       res_dw = 2
  79.       self.contents.draw_text(dx + dw * res_dw, dy,       80, WLH, Vocab.res)
  80.     end
  81.    
  82.     if $imported["BattlerStatDEX"] || $imported["DEX Stat"]
  83.       dex_dw = 2
  84.       self.contents.draw_text(dx + dw * dex_dw, dy + WLH, 80, WLH, Vocab.dex)
  85.     end
  86.    
  87.     if $imported["ClassStatDUR"]
  88.       if param.size > 6
  89.         dur_dw = 3
  90.       else
  91.         dur_dw = 2
  92.       end
  93.       self.contents.draw_text(dx + dw * dur_dw, dy,       80, WLH, Vocab.dur)
  94.     end
  95.    
  96.     if $imported["ClassStatLUK"]
  97.       if param.size > 6
  98.         luk_dw = 3
  99.       else
  100.         luk_dw = 2
  101.       end
  102.       self.contents.draw_text(dx + dw * luk_dw, dy + WLH, 80, WLH, Vocab.luk)
  103.     end
  104.    
  105.     if param.size > 6
  106.       dx += (80 / 4)
  107.     elsif param.size > 4
  108.       dx += (80 / 2)
  109.     else
  110.       dx += 80
  111.     end
  112.    
  113.     self.contents.font.color = normal_color
  114.     self.contents.draw_text(dx,      dy,       48, WLH, param[:atk], 2)
  115.     self.contents.draw_text(dx + dw, dy,       48, WLH, param[:def], 2)
  116.     self.contents.draw_text(dx     , dy + WLH, 48, WLH, param[:spi], 2)
  117.     self.contents.draw_text(dx + dw, dy + WLH, 48, WLH, param[:agi], 2)
  118.    
  119.     if $imported["BattlerStatRES"] || $imported["RES Stat"]
  120.       self.contents.draw_text(dx + dw * res_dw, dy,       48, WLH, param[:res], 2)
  121.     end
  122.    
  123.     if $imported["BattlerStatDEX"] || $imported["DEX Stat"]
  124.       self.contents.draw_text(dx + dw * dex_dw, dy + WLH, 48, WLH, param[:dex], 2)
  125.     end
  126.    
  127.     if $imported["ClassStatDUR"]
  128.       self.contents.draw_text(dx + dw * dur_dw, dy,       48, WLH, param[:dur], 2)
  129.     end
  130.    
  131.     if $imported["ClassStatLUK"]
  132.       self.contents.draw_text(dx + dw * luk_dw, dy + WLH, 48, WLH, param[:luk], 2)
  133.     end
  134.    
  135.     return dy + WLH * 2
  136.   end
  137.  
  138. end # class Window_EnemyGuideStatus < Window_Base
Advertisement
Add Comment
Please, Sign In to add comment