pigu_6

Yami | Kaduki 8D battler

Mar 8th, 2013
392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.72 KB | None | 0 0
  1. #==============================================================================
  2. #
  3. # ¥ Yami Engine Symphony - Add-on: 8D/Kaduki Battlers
  4. # -- Last Updated: 2013.02.01
  5. # -- Level: Nothing
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================
  9.  
  10. $imported = {} if $imported.nil?
  11. $imported["BattleSymphony-8D"] = true
  12.  
  13. #==============================================================================
  14. # ¥ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2013.02.01 - Adjust for Symphony v1.13.
  17. # 2012.10.20 - Finished Script.
  18. # 2012.07.01 - Started Script.
  19. #
  20. #==============================================================================
  21. # ¥ Compatibility
  22. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  23. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  24. # it will run with RPG Maker VX without adjusting.
  25. # Remember to put this script under Battle Symphony.
  26. #
  27. #==============================================================================
  28. # Down Down Left Down Dash Down Left Dash
  29. # Left Upper Left Left Dash Upper Left Dash
  30. # Right Down Right Right Dash Down Right Dash
  31. # Up Upper Right Up Dash Up Right Dash
  32. #
  33. # Ready/Idle Victory Pose 2H Swing
  34. # Damage Evade/Dodge 1H Swing
  35. # Dazed/Critical Dead 1-3 Cast/Use Item
  36. # Marching Downed/Fallen Channeling
  37. #==============================================================================
  38.  
  39. $imported = {} if $imported.nil?
  40. $imported["BattleSymphony-8D"] = true
  41.  
  42. #==============================================================================
  43. # ¡ Direction - Advanced Configuration
  44. #==============================================================================
  45.  
  46. module Direction
  47.  
  48. #--------------------------------------------------------------------------
  49. # self.index_8d
  50. #--------------------------------------------------------------------------
  51. def self.index_8d(pose)
  52. case pose
  53. # array = [index, direction, frames]
  54. # frames is optional, default is 15
  55. when :down
  56. array = [0, 2]
  57. when :left
  58. array = [0, 4]
  59. when :right
  60. array = [0, 6]
  61. when :up
  62. array = [0, 8]
  63. #---
  64. when :down_l
  65. array = [1, 2]
  66. when :up_l
  67. array = [1, 4]
  68. when :down_r
  69. array = [1, 6]
  70. when :up_l
  71. array = [1, 8]
  72. #---
  73. when :down_d
  74. array = [2, 2]
  75. when :left_d
  76. array = [2, 4]
  77. when :right_d
  78. array = [2, 6]
  79. when :up_d
  80. array = [2, 8]
  81. #---
  82. when :down_l_d
  83. array = [3, 2]
  84. when :up_l_d
  85. array = [3, 4]
  86. when :down_r_d
  87. array = [3, 6]
  88. when :up_l_d
  89. array = [3, 8]
  90. #--- Pose Creation ---
  91. when :ready
  92. array = [4, 2, 12]
  93. when :damage
  94. array = [4, 4, 10]
  95. when :critical
  96. array = [4, 6, 12]
  97. when :marching
  98. array = [4, 8, 12]
  99. #---
  100. when :victory
  101. array = [5, 2]
  102. when :dodge
  103. array = [5, 4, 5]
  104. when :dead
  105. array = [5, 6]
  106. when :fallen
  107. array = [5, 8]
  108. #---
  109. when :swing2h
  110. array = [6, 2, 6]
  111. when :r2hswing
  112. array = [6, 2, 6]
  113. when :swing1h
  114. array = [6, 4, 6]
  115. when :r1hswing
  116. array = [6, 4, 6]
  117. when :cast
  118. array = [6, 6, 6]
  119. when :channeling
  120. array = [6, 8, 8]
  121. else; array = [4, 2]
  122. end
  123. return array
  124. end
  125.  
  126. #--------------------------------------------------------------------------
  127. # self.auto_pose
  128. #--------------------------------------------------------------------------
  129. def self.auto_pose(battler)
  130. return :fallen if battler.dead?
  131. return :critical if battler.hp < battler.mhp / 4
  132. return :move if [7, 9, 1, 3].include?(SYMPHONY::View::PARTY_DIRECTION)
  133. return :ready
  134. end
  135.  
  136. end # Direction
  137.  
  138. #==============================================================================
  139. # ¡ BattleManager
  140. #==============================================================================
  141.  
  142. module BattleManager
  143.  
  144. #--------------------------------------------------------------------------
  145. # alias method: process_victory
  146. #--------------------------------------------------------------------------
  147. class <<self; alias bes_8d_process_victory process_victory; end
  148. def self.process_victory
  149. $game_party.alive_members.each { |battler| battler.force_pose_8d(:victory) }
  150. return bes_8d_process_victory
  151. end
  152.  
  153. #--------------------------------------------------------------------------
  154. # alias method: process_defeat
  155. #--------------------------------------------------------------------------
  156. class <<self; alias bes_8d_process_defeat process_defeat; end
  157. def self.process_defeat
  158. $game_troop.alive_members.each { |battler| battler.force_pose_8d(:victory) }
  159. return bes_8d_process_defeat
  160. end
  161.  
  162. end # BattleManager
  163.  
  164. #==============================================================================
  165. # ¡ Game_Battler
  166. #==============================================================================
  167.  
  168. class Game_Battler < Game_BattlerBase
  169.  
  170. #--------------------------------------------------------------------------
  171. # new method: use_8d?
  172. #--------------------------------------------------------------------------
  173. def use_8d?
  174. return @character_name =~ /(_8D)/i if use_charset?
  175. end
  176.  
  177. #--------------------------------------------------------------------------
  178. # alias method: set_default_position
  179. #--------------------------------------------------------------------------
  180. alias bes_8d_set_default_position set_default_position
  181. def set_default_position
  182. bes_8d_set_default_position
  183. set_8d_default_position if self.use_8d?
  184. end
  185.  
  186. #--------------------------------------------------------------------------
  187. # new method: set_8d_default_position
  188. #--------------------------------------------------------------------------
  189. def set_8d_default_position
  190. self.pose = Direction.auto_pose(self)
  191. end
  192.  
  193. #--------------------------------------------------------------------------
  194. # alias method: break_pose
  195. #--------------------------------------------------------------------------
  196. alias bes_8d_break_pose break_pose
  197. def break_pose
  198. bes_8d_break_pose
  199. break_pose_8d if self.use_8d?
  200. end
  201.  
  202. #--------------------------------------------------------------------------
  203. # new method: break_pose_8d
  204. #--------------------------------------------------------------------------
  205. def break_pose_8d
  206. @pose = Direction.auto_pose(self)
  207. #---
  208. return unless SceneManager.scene.spriteset
  209. return unless self.sprite
  210. @direction = SYMPHONY::View::PARTY_DIRECTION
  211. @direction = Direction.opposite(@direction) if self.enemy?
  212. self.sprite.mirror = [9, 6, 3].include?(@direction)
  213. #@direction = Direction.opposite(@direction) if self.sprite.mirror
  214. end
  215.  
  216. #--------------------------------------------------------------------------
  217. # new method: force_pose_8d
  218. #--------------------------------------------------------------------------
  219. def force_pose_8d(pose, reverse = false)
  220. return unless self.use_8d?
  221. return unless self.exist?
  222. #---
  223. self.break_pose
  224. self.pose = pose
  225. @reverse_pose = reverse
  226. @force_pose = true
  227. end
  228.  
  229. end # Game_Battler
  230.  
  231. #==============================================================================
  232. # ¡ Sprite_Battler
  233. #==============================================================================
  234.  
  235. class Sprite_Battler < Sprite_Base
  236.  
  237. #--------------------------------------------------------------------------
  238. # alias method: correct_change_pose
  239. #--------------------------------------------------------------------------
  240. alias bes_8d_correct_change_pose correct_change_pose
  241. def correct_change_pose
  242. bes_8d_correct_change_pose unless @battler.use_8d?
  243. correct_change_pose_8d if @battler.use_8d?
  244. end
  245.  
  246. #--------------------------------------------------------------------------
  247. # new method: correct_change_pose_8d
  248. #--------------------------------------------------------------------------
  249. def correct_change_pose_8d
  250. array = Direction.index_8d(pose)
  251. @pattern = array[0] > 3 ? (@battler.reverse_pose ? 2 : 0) : 1
  252. @timer = array[2].nil? ? 15 : array[2]
  253. @back_step = false
  254. @last_pose = pose
  255. end
  256.  
  257. end # Sprite_Battler
  258.  
  259. #===============================================================================
  260. #
  261. # END OF FILE
  262. #
  263. #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment