cooldoode325

Battle Symphony

Apr 21st, 2014
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 124.50 KB | None | 0 0
  1. #==============================================================================
  2. #
  3. # ¥ Yami Engine Symphony - Battle Symphony
  4. # -- Version: 1.15 (2013.03.04)
  5. # -- Level: Easy, Normal, Hard, Very Hard
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================
  9.  
  10. $imported = {} if $imported.nil?
  11. $imported["YES-BattleSymphony"] = true
  12.  
  13. #==============================================================================
  14. # ¥ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2013.03.04 - Release Build 1.15.
  17. # 2013.02.07 - Release Build 1.14.
  18. # 2013.02.01 - Release Build 1.13.
  19. # 2013.01.12 - Release Build 1.12.
  20. # 2013.01.09 - Release Build 1.11.
  21. # 2013.01.03 - Release Build 1.10.
  22. # 2012.11.29 - Release Build 1.09.
  23. # 2012.11.29 - Release Build 1.08.
  24. # 2012.11.28 - Release Build 1.07.
  25. # 2012.11.25 - Release Build 1.06.
  26. # 2012.11.24 - Release Build 1.05.
  27. # 2012.11.16 - Release Build 1.04.
  28. # 2012.11.15 - Release Build 1.03.
  29. # 2012.11.12 - Release Build 1.02.
  30. # 2012.11.08 - Release Build 1.01.
  31. # 2012.10.20 - Finished Script.
  32. # 2012.07.01 - Started Script.
  33. #
  34. #==============================================================================
  35. # ¥ Introduction
  36. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  37. # Core Engine of Symphony. This script provides a complicated visual battle
  38. # which can be customized and many add-on awaited in the future.
  39. # -----------------------------------------------------------------------------
  40. # There are 8 Sections of Script:
  41. #
  42. # Section I. Basic Settings (S-01)
  43. # Section II. Default Actions (S-02)
  44. # Section III. AutoSymphony (S-03)
  45. # Section IV. Default Symphony Tags (S-04)
  46. # Section V. Imports Symphony Tags (S-05)
  47. # Section VI. Sprites Initialization (S-06)
  48. # Section VII. Icons Sprites Initialization (S-07)
  49. # Section VIII. Core Script (S-08)
  50. #
  51. # You can search these sections by the code next to them (S-xx).
  52. #
  53. #==============================================================================
  54. # ¥ Compatibility
  55. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  56. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  57. # it will run with RPG Maker VX without adjusting.
  58. #
  59. # To make this script work correctly with YEA - Battle Engine Ace, you have to
  60. # put this script under YEA - Battle Engine Ace.
  61. #
  62. #==============================================================================
  63. # ¥ Credits
  64. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  65. # Symphony Tags: Yanfly (From his Melody Tags).
  66. # Inspired: Yanfly, Nessiah, EvilEagles.
  67. # Testers: Many Guys in RPG Maker Community.
  68. # Many Descriptions: Yanfly (From his Yanfly Engine Melody)
  69. #
  70. #==============================================================================
  71.  
  72. #==============================================================================
  73. # Section I. Basic Settings (S-01)
  74. # -----------------------------------------------------------------------------
  75. # These are all basic requirements for running Battle Engine Symphony.
  76. # Please pay attention to those settings before you touch and read next
  77. # sections and add-ons.
  78. #==============================================================================
  79. module SYMPHONY
  80. module View
  81. # Set this to false to set Battle View to Empty.
  82. # All Sprites of actors as well as Icon (Weapon, Item...) will be hide.
  83. # All other Symphony Tags are still available.
  84. EMPTY_VIEW = false
  85.  
  86. # Set Party default Direction. For Number of Direction, check NumPad on the
  87. # Keyboard. Troop Direction will be opposited with Party Direction.
  88. PARTY_DIRECTION = 4
  89.  
  90. # Set Party default Location. If You have more than 4 Actors in Battle, You
  91. # have to add more index in the hash below.
  92. # For example: If you have 5 Actors, You will have to add default Location
  93. # for 5th Actor by adding: 4 => [Location X, Location Y],
  94. # (Don't forget the comma at the end of each line)
  95. ACTORS_POSITION = { # Begin.
  96. 0 => [384, 300],
  97. 1 => [444, 285],
  98. 2 => [444, 335],
  99. 3 => [524, 300],
  100. 4 => [428, 214],
  101. 5 => [472, 234],
  102. 6 => [428, 254],
  103. 7 => [472, 274],
  104.  
  105. } # End.
  106. end # View
  107. module Visual
  108. # Set this to false to disable Weapon Icon creating for non-charset Battlers.
  109. # Recommend not to enable this, unless You use a Battler which doesn't show
  110. # its own weapon in the Battler-set.
  111. WEAPON_ICON_NON_CHARSET = false
  112.  
  113. # Set this to true to disable auto Move Posing. When set this to false,
  114. # You can let the actor to change to any pose while moving.
  115. DISABLE_AUTO_MOVE_POSE = false
  116.  
  117. # Set this to true to enable shadow beneath battler.
  118. BATTLER_SHADOW = true
  119.  
  120. # Enemies default attack animation ID.
  121. # First Attack Animation and Second Attack Animation can be defined by
  122. # notetags <atk ani 1: x> and <atk ani 2: x> respectively.
  123. ENEMY_ATTACK_ANIMATION = 1
  124. end # Visual
  125. module Fixes
  126. # Set this to false to disable auto turn-off the immortal flag. Many people
  127. # forgot to turn-off immortal flag in an actions sequence, so the targets
  128. # remain alive even their HP reach zero.
  129. # Auto Turn-off Immortal will be push to Finish Actions.
  130. AUTO_IMMORTAL_OFF = true
  131. end # Fixes
  132. end # SYMPHONY
  133.  
  134. #==============================================================================
  135. # Section II. Default Actions (S-02)
  136. # -----------------------------------------------------------------------------
  137. # These are all Default Actions of Symphony. There are Magic Action,
  138. # Physical Action, Item Action and some Misc Actions. If You are really
  139. # good at Symphony Tags and want to customize all of these actions, please
  140. # pay attention here.
  141. # Note: You can use Symphony Tags in each skills so You don't have to check
  142. # this if these actions settings are good for You.
  143. #==============================================================================
  144. module SYMPHONY
  145. module DEFAULT_ACTIONS
  146.  
  147. #==========================================================================
  148. # Default Magic Actions
  149. # -------------------------------------------------------------------------
  150. # These are the default magic actions for all Magic Skills as well as Certain
  151. # hit Skills. Battlers will play these actions when use a Magic/Certain Hit
  152. # Skill unless You customize it with Symphony Tags.
  153. #==========================================================================
  154. MAGIC_SETUP =[
  155. ["MESSAGE"],
  156. ["MOVE USER", ["FORWARD", "WAIT"]],
  157. ["POSE", ["USER", "CAST"]],
  158. ["STANCE", ["USER", "CAST"]],
  159. ] # Do not remove this.
  160. MAGIC_WHOLE =[
  161. ["IMMORTAL", ["TARGETS", "TRUE"]],
  162. ["AUTO SYMPHONY", ["SKILL FULL"]],
  163. ] # Do not remove this.
  164. MAGIC_TARGET =[
  165. ] # Do not remove this.
  166. MAGIC_FOLLOW =[
  167. ["WAIT FOR MOVE"],
  168. ] # Do not remove this.
  169. MAGIC_FINISH =[
  170. ["IMMORTAL", ["TARGETS", "FALSE"]],
  171. ["AUTO SYMPHONY", ["RETURN ORIGIN"]],
  172. ["WAIT FOR MOVE"],
  173. ["WAIT", ["12", "SKIP"]],
  174. ] # Do not remove this.
  175.  
  176. #==========================================================================
  177. # Default Physical Actions
  178. # -------------------------------------------------------------------------
  179. # These are the default physical actions for all Physical Skills as well as
  180. # Normal Attack. Battlers will play these actions when use a Physical
  181. # Skill unless You customize it with Symphony Tags.
  182. #==========================================================================
  183. PHYSICAL_SETUP =[
  184. ["MESSAGE"],
  185. ["MOVE USER", ["FORWARD", "WAIT"]],
  186. ] # Do not remove this.
  187. PHYSICAL_WHOLE =[
  188. ] # Do not remove this.
  189. PHYSICAL_TARGET =[
  190. ["IMMORTAL", ["TARGETS", "TRUE"]],
  191. ["POSE", ["USER", "FORWARD"]],
  192. ["STANCE", ["USER", "FORWARD"]],
  193. ["MOVE USER", ["TARGET", "BODY", "WAIT"]],
  194. ["AUTO SYMPHONY", ["SINGLE SWING"]],
  195. ["AUTO SYMPHONY", ["SKILL FULL", "unless attack"]],
  196. ["AUTO SYMPHONY", ["ATTACK FULL", "if attack"]],
  197.  
  198. ] # Do not remove this.
  199. PHYSICAL_FOLLOW =[
  200. ["WAIT FOR MOVE"],
  201. ] # Do not remove this.
  202. PHYSICAL_FINISH =[
  203. ["IMMORTAL", ["TARGETS", "FALSE"]],
  204. ["ICON DELETE", ["USER", "WEAPON"]],
  205. ["AUTO SYMPHONY", ["RETURN ORIGIN"]],
  206. ["WAIT FOR MOVE"],
  207. ["WAIT", ["12", "SKIP"]],
  208. ] # Do not remove this.
  209.  
  210. #==========================================================================
  211. # Default Item Actions
  212. # -------------------------------------------------------------------------
  213. # These are the default item actions for all Items. Battlers will play these
  214. # actions when use an Item unless You customize it with Symphony Tags.
  215. #==========================================================================
  216. ITEM_SETUP =[
  217. ["MESSAGE"],
  218. ["MOVE USER", ["FORWARD", "WAIT"]],
  219. ["AUTO SYMPHONY", ["ITEM FLOAT"]],
  220. ] # Do not remove this.
  221. ITEM_WHOLE =[
  222. ["IMMORTAL", ["TARGETS", "TRUE"]],
  223. ["AUTO SYMPHONY", ["ITEM FULL"]],
  224. ] # Do not remove this.
  225. ITEM_TARGET =[
  226. ] # Do not remove this.
  227. ITEM_FOLLOW =[
  228. ["WAIT FOR MOVE"],
  229. ] # Do not remove this.
  230. ITEM_FINISH =[
  231. ["IMMORTAL", ["TARGETS", "FALSE"]],
  232. ["AUTO SYMPHONY", ["RETURN ORIGIN"]],
  233. ["WAIT FOR MOVE"],
  234. ["WAIT", ["12", "SKIP"]],
  235. ] # Do not remove this.
  236.  
  237. #==========================================================================
  238. # Critical Action
  239. # -------------------------------------------------------------------------
  240. # This is the critical action. This action will be played when a battler
  241. # scores a critical hit.
  242. #==========================================================================
  243. CRITICAL_ACTIONS =[
  244. ["SCREEN", ["FLASH", "30", "255", "255", "255"]],
  245. ] # Do not remove this.
  246.  
  247. #==========================================================================
  248. # Miss Action
  249. # -------------------------------------------------------------------------
  250. # This is the miss action. This action will be played when a battler attacks
  251. # miss.
  252. #==========================================================================
  253. MISS_ACTIONS =[
  254. ["POSE", ["TARGET", "EVADE"]],
  255. ] # Do not remove this.
  256.  
  257. #==========================================================================
  258. # Evade Action
  259. # -------------------------------------------------------------------------
  260. # This is the evade action. This action will be played when a battler evades.
  261. #==========================================================================
  262. EVADE_ACTIONS =[
  263. ["POSE", ["TARGET", "EVADE"]],
  264. ] # Do not remove this.
  265.  
  266. #==========================================================================
  267. # Fail Action
  268. # -------------------------------------------------------------------------
  269. # This is the fail action. This action will be played when a battler fails
  270. # on casting skill.
  271. #==========================================================================
  272. FAIL_ACTIONS =[
  273.  
  274. ] # Do not remove this.
  275.  
  276. #==========================================================================
  277. # Damaged Action
  278. # -------------------------------------------------------------------------
  279. # This is the damaged action. This action will be played when a battler is
  280. # damaged.
  281. #==========================================================================
  282. DAMAGED_ACTION = [
  283. ["POSE", ["TARGET", "DAMAGE"]],
  284. ["STANCE", ["TARGET", "STRUCK"]],
  285. ] # Do not remove this.
  286.  
  287. #==========================================================================
  288. # Counter Action
  289. # -------------------------------------------------------------------------
  290. # This is the counter action. This action will be played when a battler
  291. # counters an attack.
  292. #==========================================================================
  293. COUNTER_ACTION = [
  294. ["MOVE COUNTER SUBJECT", ["FORWARD", "WAIT"]],
  295. ["AUTO SYMPHONY", ["SINGLE SWING COUNTER"]],
  296. ["AUTO SYMPHONY", ["SKILL FULL COUNTER"]],
  297. ["ICON DELETE", ["COUNTER SUBJECT", "WEAPON"]],
  298. ["POSE", ["COUNTER SUBJECT", "BREAK"]],
  299. ["STANCE", ["COUNTER SUBJECT", "BREAK"]],
  300. ] # Do not remove this.
  301.  
  302. #==========================================================================
  303. # Reflect Action
  304. # -------------------------------------------------------------------------
  305. # This is the reflect action. This action will be played when a battler
  306. # reflects a magic.
  307. #==========================================================================
  308. REFLECT_ACTION = [
  309. ["MOVE REFLECT SUBJECT", ["FORWARD", "WAIT"]],
  310. ["POSE", ["REFLECT SUBJECT", "CAST"]],
  311. ["STANCE", ["REFLECT SUBJECT", "CAST"]],
  312. ["AUTO SYMPHONY", ["SKILL FULL COUNTER"]],
  313. ["POSE", ["REFLECT SUBJECT", "BREAK"]],
  314. ["STANCE", ["REFLECT SUBJECT", "BREAK"]],
  315. ] # Do not remove this.
  316.  
  317. end # DEFAULT_ACTIONS
  318. end # SYMPHONY
  319.  
  320. #==============================================================================
  321. # Section III. AutoSymphony (S-03)
  322. # -----------------------------------------------------------------------------
  323. # These are all Settings of AutoSymphony. You can make a sequence of Actions
  324. # and Symphony Tags and reuse it with a single tag: AutoSymphony.
  325. #==============================================================================
  326. module SYMPHONY
  327. AUTO_SYMPHONY = { # Start
  328. # "Key" => [Symphony Sequence],
  329.  
  330. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  331. # autosymphony: return origin
  332. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  333. # This AutoSymphony returns the active battler and all of its targets back
  334. # to their original locations. Used often at the end of a skill, item,
  335. # or any other action sequence.
  336. # --- WARNING --- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  337. # This is a default-used AutoSymphony. Do not remove this.
  338. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  339. "RETURN ORIGIN" => [
  340. ["STANCE", ["USER", "ORIGIN"]],
  341. ["MOVE USER", ["ORIGIN", "WAIT"]],
  342. ["POSE", ["USER", "BREAK"]],
  343. ["MOVE EVERYTHING", ["ORIGIN"]],
  344. ], # end RETURN ORIGIN
  345.  
  346. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  347. # autosymphony: single swing
  348. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  349. # This causes the active battler to perform a single-handed weapon swing
  350. # downwards.
  351. # --- WARNING --- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  352. # This is a default-used AutoSymphony. Do not remove this.
  353. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  354. "SINGLE SWING" => [
  355. ["ICON CREATE", ["USER", "WEAPON"]],
  356. ["ICON", ["USER", "WEAPON", "SWING"]],
  357. ["POSE", ["USER", "2H SWING"]],
  358. ["STANCE", ["USER", "ATTACK"]],
  359. ], # end SINGLE SWING
  360.  
  361. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  362. # autosymphony: single swing counter
  363. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  364. # This causes the countering battler to perform a single-handed weapon
  365. # swing downwards.
  366. # --- WARNING --- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  367. # This is a default-used AutoSymphony. Do not remove this.
  368. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  369. "SINGLE SWING COUNTER" => [
  370. ["ICON CREATE", ["COUNTER SUBJECT", "WEAPON"]],
  371. ["ICON", ["COUNTER SUBJECT", "WEAPON", "SWING"]],
  372. ["POSE", ["COUNTER SUBJECT", "2H SWING"]],
  373. ["STANCE", ["USER", "ATTACK"]],
  374. ], # end SINGLE SWING COUNTER
  375.  
  376. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  377. # autosymphony: item float
  378. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  379. # This causes the active battler to enter a "Cast" stance to make the
  380. # active battler appear to throw the item upward. The icon of the item
  381. # is then created and floats upward.
  382. # --- WARNING --- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  383. # This is a default-used AutoSymphony. Do not remove this.
  384. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  385. "ITEM FLOAT" => [
  386. ["POSE", ["USER", "CAST"]],
  387. ["STANCE", ["USER", "ITEM"]],
  388. ["ICON CREATE", ["USER", "ITEM"]],
  389. ["ICON", ["USER", "ITEM", "FLOAT", "WAIT"]],
  390. ], # end ITEM FLOAT
  391.  
  392. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  393. # autosymphony: attack full
  394. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  395. # This triggers the full course for an attack effect. Attack's animation
  396. # plays and waits until it ends. The damage, status changes, and anything
  397. # else the attack may do to the target. Once the attack effect is over,
  398. # the target is sent sliding backwards a little bit.
  399. # --- WARNING --- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  400. # This is a default-used AutoSymphony. Do not remove this.
  401. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  402. "ATTACK FULL" => [
  403. ["ATTACK EFFECT", ["COUNTER CHECK"]],
  404. ["ATTACK ANIMATION", ["WAIT"]],
  405. ["ATTACK EFFECT", ["WHOLE"]],
  406. ["MOVE TARGETS", ["BACKWARD"]],
  407. ], # end ATTACK FULL
  408.  
  409. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  410. # autosymphony: skill full
  411. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  412. # This trigger the full course for a skill's effect. The skill animation
  413. # plays and waits to the end. The damage, status changes, and anything
  414. # else the skill may do to the target. Once the skill effect is over, the
  415. # target is sent sliding backwards a little bit.
  416. # --- WARNING --- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  417. # This is a default-used AutoSymphony. Do not remove this.
  418. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  419. "SKILL FULL" => [
  420. ["SKILL EFFECT", ["COUNTER CHECK"]],
  421. ["SKILL EFFECT", ["REFLECT CHECK"]],
  422. ["SKILL ANIMATION", ["WAIT"]],
  423. ["SKILL EFFECT", ["WHOLE"]],
  424. ["MOVE TARGETS", ["BACKWARD", "unless skill.for_friend?"]],
  425. ], # end SKILL FULL
  426.  
  427. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  428. # autosymphony: skill full counter
  429. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  430. # This trigger the full course for a skill's effect. The skill animation
  431. # plays and waits to the end. The damage, status changes, and anything
  432. # else the skill may do to the target. Once the skill effect is over, the
  433. # target is sent sliding backwards a little bit.
  434. # This trigger is used in countering/reflecting skill.
  435. # --- WARNING --- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  436. # This is a default-used AutoSymphony. Do not remove this.
  437. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  438. "SKILL FULL COUNTER" => [
  439. ["ATTACK ANIMATION", ["TARGETS", "WAIT", "if attack"]],
  440. ["SKILL ANIMATION", ["TARGETS", "WAIT", "unless attack"]],
  441. ["SKILL EFFECT", ["WHOLE"]],
  442. ["MOVE TARGETS", ["BACKWARD", "unless skill.for_friend?"]],
  443. ], # end SKILL FULL COUNTER
  444.  
  445. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  446. # autosymphony: item full
  447. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  448. # This triggers the full course for an item's effect. The item animation
  449. # plays and waits to the end. The damage, status changes, and anything
  450. # else the item may do to the target. Once the skill effect is over, the
  451. # target is sent sliding backwards a little bit.
  452. # --- WARNING --- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  453. # This is a default-used AutoSymphony. Do not remove this.
  454. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  455. "ITEM FULL" => [
  456. ["SKILL EFFECT", ["COUNTER CHECK"]],
  457. ["SKILL EFFECT", ["REFLECT CHECK", "unless skill.for_all?"]],
  458. ["SKILL ANIMATION", ["WAIT"]],
  459. ["ICON", ["USER", "ITEM", "FADE OUT", "WAIT"]],
  460. ["ICON DELETE", ["USER", "ITEM"]],
  461. ["SKILL EFFECT", ["WHOLE"]],
  462. ["MOVE TARGETS", ["BACKWARD", "unless item.for_friend?"]],
  463. ], # end ITEM FULL
  464.  
  465. } # Do not remove this.
  466. end # SYMPHONY
  467.  
  468. #==============================================================================
  469. # Section IV. Default Symphony Tags (S-04)
  470. # -----------------------------------------------------------------------------
  471. # These are all Default Symphony Tags. They define actions that will be played
  472. # when the tags are called. All these tags are optimized for the best
  473. # performance through testings.
  474. # -----------------------------------------------------------------------------
  475. # Do not edit anything below here unless You have read carefully the Tutorial
  476. # at Creating and Editing Symphony Tags.
  477. #==============================================================================
  478. #==============================================================================
  479. # ¡ Scene_Battle - Defines Tags Names
  480. #==============================================================================
  481. class Scene_Battle < Scene_Base
  482.  
  483. #--------------------------------------------------------------------------
  484. # new method: perform_actions_list
  485. #--------------------------------------------------------------------------
  486. def perform_actions_list(actions, targets)
  487. #--- Create Formers ---
  488. former_action = @action
  489. former_values = (@action_values != nil) ? @action_values.clone : nil
  490. former_targets = (@action_targets != nil) ? @action_targets.clone : nil
  491. former_item = (@scene_item != nil) ? @scene_item.clone : nil
  492. #--- Create Current ---
  493. @action_targets = targets
  494. actions.each { |action|
  495. @action = action[0].upcase; @action_values = action[1]
  496. @action_values.each { |s| s.upcase! if s.is_a?(String) } if @action_values
  497. break unless SceneManager.scene_is?(Scene_Battle)
  498. break if @subject && @subject.dead?
  499. next unless action_condition_met
  500. case @action.upcase
  501.  
  502. when /ANIMATION[ ](\d+)|SKILL ANIMATION|ATTACK ANIMATION|ANIMATION/i
  503. action_animation
  504.  
  505. when /ATTACK EFFECT|SKILL EFFECT/i
  506. action_skill_effect
  507.  
  508. when /AUTO SYMPHONY|AUTOSYMPHONY/i
  509. action_autosymphony
  510.  
  511. when /ICON CREATE|CREATE ICON/i
  512. action_create_icon
  513.  
  514. when /ICON DELETE|DELETE ICON/i
  515. action_delete_icon
  516.  
  517. when "ICON", "ICON EFFECT"
  518. action_icon_effect
  519.  
  520. when /ICON THROW[ ](.*)/i
  521. action_icon_throw
  522.  
  523. when /IF[ ](.+)/i
  524. action_condition
  525.  
  526. when /JUMP[ ](.*)/i
  527. action_move
  528.  
  529. when /MESSAGE/i
  530. action_message
  531.  
  532. when /MOVE[ ](.*)/i
  533. action_move
  534.  
  535. when /IMMORTAL/i
  536. action_immortal
  537.  
  538. when /POSE/i
  539. action_pose
  540.  
  541. when /STANCE/i
  542. action_stance
  543.  
  544. when /UNLESS[ ](.+)/i
  545. action_condition
  546.  
  547. when /TELEPORT[ ](.*)/i
  548. action_move
  549.  
  550. when "WAIT", "WAIT SKIP", "WAIT FOR ANIMATION", "WAIT FOR MOVE",
  551. "WAIT FOR MOVEMENT", "ANI WAIT"
  552. action_wait
  553.  
  554. else
  555. imported_symphony
  556. end
  557. }
  558. #--- Release Formers ---
  559. @action = former_action
  560. @action_values = former_values
  561. @action_targets = former_targets
  562. @scene_item = former_item
  563. end
  564.  
  565. end # Scene_Battle
  566. #==============================================================================
  567. # ¡ Scene_Battle - Defines Tags Actions
  568. #==============================================================================
  569. class Scene_Battle < Scene_Base
  570.  
  571. #--------------------------------------------------------------------------
  572. # new method: action_condition_met
  573. #--------------------------------------------------------------------------
  574. def action_condition_met
  575. target = @action_targets[0]
  576. targets = @action_targets
  577. user = @subject
  578. skill = item = @scene_item
  579. attack = false
  580. if @counter_subject || (user.current_action && user.current_action.attack?)
  581. attack = true
  582. end
  583. weapons = user.weapons if user.actor?
  584. @action_condition ||= []
  585. @action_condition.pop if @action.upcase == "END"
  586. if @action_condition.size > 0
  587. @action_condition.each { |action_condition|
  588. action_condition =~ /(IF|UNLESS)[ ](.+)/i
  589. condition_type = $1.upcase
  590. condition_value = $2.downcase
  591. #---
  592. if condition_type == "IF"
  593. return false unless eval(condition_value)
  594. elsif condition_type == "UNLESS"
  595. return false if eval(condition_value)
  596. end
  597. }
  598. end
  599. if @action_values
  600. @action_values.each { |value|
  601. case value
  602. when /IF[ ](.*)/i
  603. eval("return false unless " + $1.to_s.downcase)
  604. when /UNLESS[ ](.*)/i
  605. eval("return false if " + $1.to_s.downcase)
  606. end
  607. }
  608. end
  609. return true
  610. end
  611.  
  612. #--------------------------------------------------------------------------
  613. # new method: get_action_mains
  614. #--------------------------------------------------------------------------
  615. def get_action_mains
  616. result = []
  617. case @action.upcase
  618. when /(?:USER)/i
  619. result.push(@subject) if @subject
  620. when /(?:TARGET|TARGETS)/i
  621. result = @action_targets
  622. when /(?:COUNTER SUBJECT)/i
  623. result = [@counter_subject]
  624. when /(?:REFLECT SUBJECT)/i
  625. result = [@reflect_subject]
  626. when /(?:ACTORS|PARTY|ACTORS LIVING)/i
  627. result = $game_party.alive_members
  628. when /(?:ALL ACTORS|ACTORS ALL)/i
  629. result = $game_party.battle_members
  630. when /(?:ACTORS NOT USER|PARTY NOT USER)/i
  631. result = $game_party.alive_members
  632. result.delete(@subject) if @subject
  633. when /(?:ENEMIES|TROOP|ENEMIES LIVING)/i
  634. result = $game_troop.alive_members
  635. when /(?:ALL ENEMIES|ENEMIES ALL)/i
  636. result = $game_troop.battle_members
  637. when /(?:ENEMIES NOT USER|ENEMIES NOT USER)/i
  638. result = $game_troop.alive_members
  639. result.delete(@subject) if @subject
  640. when /ACTOR[ ](\d+)/i
  641. result.push($game_party.battle_members[$1.to_i])
  642. when /ENEMY[ ](\d+)/i
  643. result.push($game_troop.battle_members[$1.to_i])
  644. when /(?:EVERYTHING|EVERYBODY)/i
  645. result = $game_party.alive_members + $game_troop.alive_members
  646. when /(?:EVERYTHING NOT USER|EVERYBODY NOT USER)/i
  647. result = $game_party.alive_members + $game_troop.alive_members
  648. result.delete(@subject) if @subject
  649. when /(?:ALLIES|FRIENDS)/i
  650. result = @subject.friends_unit.alive_members if @subject
  651. when /(?:OPPONENTS|RIVALS)/i
  652. result = @subject.opponents_unit.alive_members if @subject
  653. when /(?:FRIENDS NOT USER)/i
  654. if @subject
  655. result = @subject.friends_unit.alive_members
  656. result.delete(@subject)
  657. end
  658. when /(?:FOCUS)/i
  659. result = @action_targets
  660. result.push(@subject) if @subject
  661. when /(?:NOT FOCUS|NON FOCUS)/i
  662. result = $game_party.alive_members + $game_troop.alive_members
  663. result -= @action_targets
  664. result.delete(@subject) if @subject
  665. else;
  666. end
  667. return result.compact
  668. end
  669.  
  670. #--------------------------------------------------------------------------
  671. # new method: get_action_targets
  672. #--------------------------------------------------------------------------
  673. def get_action_targets
  674. result = []
  675. @action_values.reverse.each { |value|
  676. next if value.nil?
  677. case value.upcase
  678. when /(?:USER)/i
  679. result.push(@subject) if @subject
  680. when /(?:TARGET|TARGETS)/i
  681. result = @action_targets
  682. when /(?:COUNTER SUBJECT)/i
  683. result = [@counter_subject]
  684. when /(?:REFLECT SUBJECT)/i
  685. result = [@reflect_subject]
  686. when /(?:ACTORS|PARTY|ACTORS LIVING)/i
  687. result = $game_party.alive_members
  688. when /(?:ALL ACTORS|ACTORS ALL)/i
  689. result = $game_party.battle_members
  690. when /(?:ACTORS NOT USER|PARTY NOT USER)/i
  691. result = $game_party.alive_members
  692. result.delete(@subject) if @subject
  693. when /(?:ENEMIES|TROOP|ENEMIES LIVING)/i
  694. result = $game_troop.alive_members
  695. when /(?:ALL ENEMIES|ENEMIES ALL)/i
  696. result = $game_troop.battle_members
  697. when /(?:ENEMIES NOT USER|ENEMIES NOT USER)/i
  698. result = $game_troop.alive_members
  699. result.delete(@subject) if @subject
  700. when /ACTOR[ ](\d+)/i
  701. result.push($game_party.battle_members[$1.to_i])
  702. when /ENEMY[ ](\d+)/i
  703. result.push($game_troop.battle_members[$1.to_i])
  704. when /(?:EVERYTHING|EVERYBODY)/i
  705. result = $game_party.alive_members + $game_troop.alive_members
  706. when /(?:EVERYTHING NOT USER|EVERYBODY NOT USER)/i
  707. result = $game_party.alive_members + $game_troop.alive_members
  708. result.delete(@subject) if @subject
  709. when /(?:ALLIES|FRIENDS)/i
  710. result = @subject.friends_unit.alive_members if @subject
  711. when /(?:OPPONENTS|RIVALS)/i
  712. result = @subject.opponents_unit.alive_members if @subject
  713. when /(?:FRIENDS NOT USER)/i
  714. if @subject
  715. result = @subject.friends_unit.alive_members
  716. result.delete(@subject)
  717. end
  718. when /(?:NOT FOCUS|NON FOCUS)/i
  719. result = $game_party.alive_members + $game_troop.alive_members
  720. result -= @action_targets
  721. result.delete(@subject)
  722. when /(?:FOCUS)/i
  723. result = @action_targets
  724. result.push(@subject) if @subject
  725. else;
  726. end
  727. }
  728. return result.compact
  729. end
  730.  
  731. #--------------------------------------------------------------------------
  732. # new method: action_animation
  733. #--------------------------------------------------------------------------
  734. def action_animation
  735. targets = get_action_targets
  736. targets = @action_targets if ["SKILL ANIMATION", "ATTACK ANIMATION"].include?(@action.upcase)
  737. return if targets.size == 0
  738. #---
  739. case @action.upcase
  740. when /ANIMATION[ ](\d+)/i
  741. animation_id = [$1.to_i]
  742. when "SKILL ANIMATION", "ANIMATION"
  743. return unless @subject.current_action.item
  744. animation_id = [@subject.current_action.item.animation_id]
  745. when "ATTACK ANIMATION"
  746. animation_id = [@subject.atk_animation_id1]
  747. animation_id = [@subject.atk_animation_id2] if @subject.atk_animation_id2 > 0 && @action_values[1].to_i == 2
  748. when "LAST ANIMATION"
  749. animation_id = [@last_animation_id]
  750. end
  751. mirror = true if @action_values.include?("MIRROR")
  752. #---
  753. animation_id = [@subject.atk_animation_id1] if animation_id == [-1]
  754. #---
  755. ani_count = 0
  756. animation_id.each { |id|
  757. wait_for_animation if ani_count > 0
  758. mirror = !mirror if ani_count > 0
  759. animation = $data_animations[id]
  760. #---
  761. return unless animation
  762. if animation.to_screen?; targets[0].animation_id = id; end
  763. if !animation.to_screen?
  764. targets.each {|target| target.animation_id = id}
  765. end
  766. targets.each {|target| target.animation_mirror = mirror}
  767. ani_count += 1
  768. }
  769. @last_animation_id = animation_id[0]
  770. return unless @action_values.include?("WAIT")
  771. wait_for_animation
  772. end
  773.  
  774. #--------------------------------------------------------------------------
  775. # new method: action_skill_effect
  776. #--------------------------------------------------------------------------
  777. def action_skill_effect
  778. return unless @subject
  779. return unless @subject.alive?
  780. return unless @subject.current_action.item
  781. targets = @action_targets.uniq
  782. item = @subject.current_action.item
  783. #---
  784. if @action_values.include?("CLEAR")
  785. targets.each { |target| target.result.set_calc; target.result.clear }
  786. return
  787. end
  788. #---
  789. if @action_values.include?("COUNTER CHECK")
  790. targets.each { |target| target.result.set_counter }
  791. return
  792. elsif @action_values.include?("REFLECT CHECK")
  793. targets.each { |target| target.result.set_reflection }
  794. return
  795. end
  796. #---
  797. array = []
  798. array.push("calc") if @action_values.include?("CALC")
  799. array = ["perfect"] if @action_values.include?("PERFECT")
  800. @action_values.each {|value| array.push(value.downcase) unless ["PERFECT", "CALC"].include?(value)}
  801. array = ["calc", "dmg", "effect"] if @action_values.include?("WHOLE") || @action_values.size == 0
  802. #---
  803. targets.each {|target|
  804. target.result.clear_bes_flag
  805. array.each {|value| str = "target.result.set_#{value}"; eval(str)}
  806. item.repeats.times { invoke_item(target, item) }
  807. target.result.clear_change_target
  808. }
  809. end
  810.  
  811. #--------------------------------------------------------------------------
  812. # new method: action_autosymphony
  813. #--------------------------------------------------------------------------
  814. def action_autosymphony
  815. key = @action_values[0].to_s.upcase
  816. return unless SYMPHONY::AUTO_SYMPHONY.include?(key)
  817. actions_list = SYMPHONY::AUTO_SYMPHONY[key]
  818. perform_actions_list(actions_list, @action_targets)
  819. end
  820.  
  821. #--------------------------------------------------------------------------
  822. # new method: action_create_icon
  823. #--------------------------------------------------------------------------
  824. def action_create_icon
  825. targets = get_action_targets
  826. return if targets.size == 0
  827. return if SYMPHONY::View::EMPTY_VIEW
  828. #---
  829. case @action_values[1]
  830. when "WEAPON", "WEAPON1"
  831. symbol = :weapon1
  832. attachment = :hand1
  833. when "WEAPON2"
  834. symbol = :weapon2
  835. attachment = :hand2
  836. when "SHIELD"
  837. symbol = :shield
  838. attachment = :shield
  839. when "ITEM"
  840. symbol = :item
  841. attachment = :middle
  842. else
  843. symbol = @action_values[1]
  844. attachment = :middle
  845. end
  846. #---
  847. case @action_values[2]
  848. when "HAND", "HAND1"
  849. attachment = :hand1
  850. when "HAND2", "SHIELD"
  851. attachment = :hand2
  852. when "ITEM"
  853. attachment = :item
  854. when "MIDDLE", "BODY"
  855. attachment = :middle
  856. when "TOP", "HEAD"
  857. attachment = :top
  858. when "BOTTOM", "FEET", "BASE"
  859. attachment = :base
  860. end
  861. #---
  862. targets.each { |target|
  863. next if target.sprite.nil?
  864. next if !target.use_charset? && !SYMPHONY::Visual::WEAPON_ICON_NON_CHARSET && [:weapon1, :weapon2].include?(symbol)
  865. target.create_icon(symbol, @action_values[3].to_i)
  866. next if target.icons[symbol].nil?
  867. target.icons[symbol].set_origin(attachment)
  868. }
  869. end
  870.  
  871. #--------------------------------------------------------------------------
  872. # new method: action_delete_icon
  873. #--------------------------------------------------------------------------
  874. def action_delete_icon
  875. targets = get_action_targets
  876. return if targets.size == 0
  877. #---
  878. case @action_values[1]
  879. when "WEAPON", "WEAPON1"
  880. symbol = :weapon1
  881. when "WEAPON2"
  882. symbol = :weapon2
  883. when "SHIELD"
  884. symbol = :shield
  885. when "ITEM"
  886. symbol = :item
  887. else
  888. symbol = @action_values[1]
  889. end
  890. #---
  891. targets.each { |target| target.delete_icon(symbol) }
  892. end
  893.  
  894. #--------------------------------------------------------------------------
  895. # new method: action_icon_effect
  896. #--------------------------------------------------------------------------
  897. def action_icon_effect
  898. targets = get_action_targets
  899. return if targets.size == 0
  900. #---
  901. case @action_values[1]
  902. when "WEAPON", "WEAPON1"
  903. symbol = :weapon1
  904. when "WEAPON2"
  905. symbol = :weapon2
  906. when "SHIELD"
  907. symbol = :shield
  908. when "ITEM"
  909. symbol = :item
  910. else
  911. symbol = @action_values[1]
  912. end
  913. #---
  914. targets.each { |target|
  915. icon = target.icons[symbol]
  916. next if icon.nil?
  917. total_frames = 8
  918. case @action_values[2]
  919. when "ANGLE"
  920. angle = @action_values[3].to_i
  921. icon.set_angle(angle)
  922. when "ROTATE", "REROTATE"
  923. angle = @action_values[3].to_i
  924. angle = -angle if @action_values[2] == "REROTATE"
  925. total_frames = @action_values[4].to_i
  926. total_frames = 8 if total_frames == 0
  927. icon.create_angle(angle, total_frames)
  928. when /ANIMATION[ ](\d+)/i
  929. animation = $1.to_i
  930. if $data_animations[animation].nil?; return; end
  931. total_frames = $data_animations[animation].frame_max
  932. total_frames *= 4 unless $imported["YEA-CoreEngine"]
  933. total_frames *= YEA::CORE::ANIMATION_RATE if $imported["YEA-CoreEngine"]
  934. icon.start_animation($data_animations[animation])
  935. when /MOVE_X[ ](\d+)/i
  936. move_x = $1.to_i
  937. total_frames = @action_values[3].to_i
  938. total_frames = 8 if total_frames == 0
  939. icon.create_movement(move_x, icon.y, total_frames)
  940. when /MOVE_Y[ ](\d+)/i
  941. move_y = $1.to_i
  942. total_frames = @action_values[3].to_i
  943. total_frames = 8 if total_frames == 0
  944. icon.create_movement(icon.x, move_y, total_frames)
  945. when /CUR_X[ ]([\-]?\d+)/i
  946. move_x = icon.x + $1.to_i
  947. total_frames = @action_values[3].to_i
  948. total_frames = 8 if total_frames == 0
  949. icon.create_movement(move_x, icon.y, total_frames)
  950. when /CUR_Y[ ]([\-]?\d+)/i
  951. move_y = icon.y + $1.to_i
  952. total_frames = @action_values[3].to_i
  953. total_frames = 8 if total_frames == 0
  954. icon.create_movement(icon.x, move_y, total_frames)
  955. when "FADE IN"
  956. total_frames = @action_values[3].to_i
  957. total_frames = 8 if total_frames == 0
  958. rate = Integer(256.0/total_frames)
  959. icon.set_fade(rate)
  960. when "FADE OUT"
  961. total_frames = @action_values[3].to_i
  962. total_frames = 8 if total_frames == 0
  963. rate = Integer(256.0/total_frames)
  964. icon.set_fade(-rate)
  965. when "FLOAT"
  966. total_frames = @action_values[3].to_i
  967. total_frames = 24 if total_frames == 0
  968. icon.create_move_direction(8, total_frames, total_frames)
  969. when "SWING"
  970. total_frames = 10
  971. icon.set_angle(0)
  972. icon.create_angle(90, total_frames)
  973. when "UPSWING"
  974. total_frames = 10
  975. icon.set_angle(90)
  976. icon.create_angle(0, total_frames)
  977. when "STAB", "THRUST"
  978. total_frames = 8
  979. direction = Direction.direction(target.pose)
  980. direction = Direction.opposite(direction) if target.sprite.mirror
  981. case direction
  982. when 8
  983. icon_direction = 8
  984. icon.set_angle(-45)
  985. when 4
  986. icon_direction = 4
  987. icon.set_angle(45)
  988. when 6
  989. icon_direction = 6
  990. icon.set_angle(-135)
  991. when 2
  992. icon_direction = 2
  993. icon.set_angle(135)
  994. end
  995. icon.create_move_direction(Direction.opposite(icon_direction), 40, 1)
  996. icon.update
  997. icon.create_move_direction(icon_direction, 32, total_frames)
  998. when "CLAW"
  999. total_frames = 8
  1000. direction = Direction.direction(target.pose)
  1001. direction = Direction.opposite(direction) if target.sprite.mirror
  1002. case direction
  1003. when 8
  1004. icon_direction = 7
  1005. back_direction = 3
  1006. when 4
  1007. icon_direction = 1
  1008. back_direction = 9
  1009. when 6
  1010. icon_direction = 3
  1011. back_direction = 7
  1012. when 2
  1013. icon_direction = 9
  1014. back_direction = 1
  1015. end
  1016. icon.create_move_direction(back_direction, 32, 1)
  1017. icon.update
  1018. icon.create_move_direction(icon_direction, 52, total_frames)
  1019. end
  1020. #---
  1021. if @action_values.include?("WAIT")
  1022. update_basic while icon.effecting?
  1023. end
  1024. }
  1025. end
  1026.  
  1027. #--------------------------------------------------------------------------
  1028. # new method: action_icon_throw
  1029. #--------------------------------------------------------------------------
  1030. def action_icon_throw
  1031. mains = get_action_mains
  1032. targets = get_action_targets
  1033. return if mains.size == 0
  1034. #---
  1035. case @action_values[1]
  1036. when "WEAPON", "WEAPON1"
  1037. symbol = :weapon1
  1038. when "WEAPON2"
  1039. symbol = :weapon2
  1040. when "SHIELD"
  1041. symbol = :shield
  1042. when "ITEM"
  1043. symbol = :item
  1044. else
  1045. symbol = @action_values[1]
  1046. end
  1047. #---
  1048. mains.each { |main|
  1049. icon = main.icons[symbol]
  1050. next if icon.nil?
  1051. total_frames = @action_values[3].to_i
  1052. total_frames = 12 if total_frames <= 0
  1053. arc = @action_values[2].to_f
  1054. #---
  1055. targets.each { |target|
  1056. move_x = target.screen_x
  1057. move_y = target.screen_y - target.sprite.height / 2
  1058. icon.create_movement(move_x, move_y, total_frames)
  1059. icon.create_arc(arc)
  1060. if @action_values.include?("WAIT")
  1061. update_basic while icon.effecting?
  1062. end
  1063. }
  1064. }
  1065. end
  1066.  
  1067. #--------------------------------------------------------------------------
  1068. # new method: action_condition
  1069. #--------------------------------------------------------------------------
  1070. def action_condition
  1071. @action_condition ||= []
  1072. @action_condition.push(@action.dup)
  1073. end
  1074.  
  1075. #--------------------------------------------------------------------------
  1076. # new method: action_message
  1077. #--------------------------------------------------------------------------
  1078. def action_message
  1079. user = @subject
  1080. return unless user
  1081. item = @subject.current_action.item
  1082. return unless item
  1083. @log_window.display_use_item(@subject, item)
  1084. end
  1085.  
  1086. #--------------------------------------------------------------------------
  1087. # new method: action_move
  1088. #--------------------------------------------------------------------------
  1089. def action_move
  1090. movers = get_action_mains
  1091. return unless movers.size > 0
  1092. return if SYMPHONY::View::EMPTY_VIEW
  1093. #--- Get Location ---
  1094. case @action_values[0]
  1095. #---
  1096. when "FORWARD", "BACKWARD"
  1097. distance = @action_values[1].to_i
  1098. distance = @action_values[0] == "FORWARD" ? 16 : 8 if distance <= 0
  1099. frames = @action_values[2].to_i
  1100. frames = 8 if frames <= 0
  1101. movers.each { |mover|
  1102. next unless mover.exist?
  1103. direction = mover.direction
  1104. destination_x = mover.screen_x
  1105. destination_y = mover.screen_y
  1106. case direction
  1107. when 1; move_x = distance / -2; move_y = distance / 2
  1108. when 2; move_x = distance * 0; move_y = distance * 1
  1109. when 3; move_x = distance / -2; move_y = distance / 2
  1110. when 4; move_x = distance * -1; move_y = distance * 0
  1111. when 6; move_x = distance * 1; move_y = distance * 0
  1112. when 7; move_x = distance / -2; move_y = distance / -2
  1113. when 8; move_x = distance * 0; move_y = distance * -1
  1114. when 9; move_x = distance / 2; move_y = distance / -2
  1115. else; return
  1116. end
  1117. destination_x += @action_values[0] == "FORWARD" ? move_x : - move_x
  1118. destination_y += @action_values[0] == "FORWARD" ? move_y : - move_y
  1119. mover.face_coordinate(destination_x, destination_y) unless @action_values[0] == "BACKWARD"
  1120. mover.create_movement(destination_x, destination_y, frames)
  1121. case @action.upcase
  1122. when /JUMP[ ](.*)/i
  1123. arc_scan = $1.scan(/(?:ARC)[ ](\d+)/i)
  1124. arc = $1.to_i
  1125. mover.create_jump(arc)
  1126. end
  1127. }
  1128. #---
  1129. when "ORIGIN", "RETURN"
  1130. frames = @action_values[1].to_i
  1131. frames = 20 if frames <= 0
  1132. movers.each { |mover|
  1133. next unless mover.exist?
  1134. destination_x = mover.origin_x
  1135. destination_y = mover.origin_y
  1136. next if destination_x == mover.screen_x && destination_y == mover.screen_y
  1137. if @action_values[0] == "ORIGIN"
  1138. mover.face_coordinate(destination_x, destination_y)
  1139. end
  1140. mover.create_movement(destination_x, destination_y, frames)
  1141. case @action.upcase
  1142. when /JUMP[ ](.*)/i
  1143. arc_scan = $1.scan(/(?:ARC)[ ](\d+)/i)
  1144. arc = $1.to_i
  1145. mover.create_jump(arc)
  1146. end
  1147. }
  1148. #---
  1149. when "TARGET", "TARGETS", "USER"
  1150. frames = @action_values[2].to_i
  1151. frames = 20 if frames <= 0
  1152. #---
  1153. case @action_values[0]
  1154. when "USER"
  1155. targets = [@subject]
  1156. when "TARGET", "TARGETS"
  1157. targets = @action_targets
  1158. end
  1159. #---
  1160. destination_x = destination_y = 0
  1161. case @action_values[1]
  1162. when "BASE", "FOOT", "FEET"
  1163. targets.each { |target|
  1164. destination_x += target.screen_x; destination_y += target.screen_y
  1165. side_l = target.screen_x - target.sprite.width/2
  1166. side_r = target.screen_x + target.sprite.width/2
  1167. side_u = target.screen_y - target.sprite.height
  1168. side_d = target.screen_y
  1169. movers.each { |mover|
  1170. next unless mover.exist?
  1171. if side_l > mover.origin_x
  1172. destination_x -= target.sprite.width/2
  1173. destination_x -= mover.sprite.width/2
  1174. elsif side_r < mover.origin_x
  1175. destination_x += target.sprite.width/2
  1176. destination_x += mover.sprite.width/2
  1177. elsif side_u > mover.origin_y - mover.sprite.height
  1178. destination_y -= target.sprite.height
  1179. elsif side_d < mover.origin_y - mover.sprite.height
  1180. destination_y += mover.sprite.height
  1181. end
  1182. }
  1183. }
  1184. #---
  1185. when "BODY", "MIDDLE", "MID"
  1186. targets.each { |target|
  1187. destination_x += target.screen_x
  1188. destination_y += target.screen_y - target.sprite.height / 2
  1189. side_l = target.screen_x - target.sprite.width/2
  1190. side_r = target.screen_x + target.sprite.width/2
  1191. side_u = target.screen_y - target.sprite.height
  1192. side_d = target.screen_y
  1193. movers.each { |mover|
  1194. next unless mover.exist?
  1195. if side_l > mover.origin_x
  1196. destination_x -= target.sprite.width/2
  1197. destination_x -= mover.sprite.width/2
  1198. elsif side_r < mover.origin_x
  1199. destination_x += target.sprite.width/2
  1200. destination_x += mover.sprite.width/2
  1201. elsif side_u > mover.origin_y - mover.sprite.height
  1202. destination_y -= target.sprite.height
  1203. elsif side_d < mover.origin_y - mover.sprite.height
  1204. destination_y += mover.sprite.height
  1205. end
  1206. destination_y += mover.sprite.height
  1207. destination_y -= mover.sprite.height/2
  1208. if $imported["BattleSymphony-8D"] && $imported["BattleSymphony-HB"]
  1209. destination_y += mover.sprite.height if mover.use_8d? && target.use_hb?
  1210. destination_y -= mover.sprite.height/4 if mover.use_hb? && target.use_8d?
  1211. end
  1212. }
  1213. }
  1214. #---
  1215. when "CENTER"
  1216. targets.each { |target|
  1217. destination_x += target.screen_x
  1218. destination_y += target.screen_y - target.sprite.height/2
  1219. }
  1220. #---
  1221. when "HEAD", "TOP"
  1222. targets.each { |target|
  1223. destination_x += target.screen_x
  1224. destination_y += target.screen_y - target.sprite.height
  1225. side_l = target.screen_x - target.sprite.width/2
  1226. side_r = target.screen_x + target.sprite.width/2
  1227. side_u = target.screen_y - target.sprite.height
  1228. side_d = target.screen_y
  1229. movers.each { |mover|
  1230. next unless mover.exist?
  1231. if side_l > mover.origin_x
  1232. destination_x -= target.sprite.width/2
  1233. destination_x -= mover.sprite.width/2
  1234. elsif side_r < mover.origin_x
  1235. destination_x += target.sprite.width/2
  1236. destination_x += mover.sprite.width/2
  1237. elsif side_u > mover.origin_y - mover.sprite.height
  1238. destination_y -= target.sprite.height
  1239. elsif side_d < mover.origin_y - mover.sprite.height
  1240. destination_y += mover.sprite.height
  1241. end
  1242. destination_y += mover.sprite.height
  1243. destination_y -= mover.sprite.height/2
  1244. if $imported["BattleSymphony-8D"] && $imported["BattleSymphony-HB"]
  1245. destination_y += mover.sprite.height if mover.use_8d? && target.use_hb?
  1246. destination_y -= mover.sprite.height/4 if mover.use_hb? && target.use_8d?
  1247. end
  1248. }
  1249. }
  1250. #---
  1251. when "BACK"
  1252. targets.each { |target|
  1253. destination_x += target.screen_x
  1254. destination_y += target.screen_y - target.sprite.height
  1255. side_l = target.screen_x - target.sprite.width/2
  1256. side_r = target.screen_x + target.sprite.width/2
  1257. side_u = target.screen_y - target.sprite.height
  1258. side_d = target.screen_y
  1259. movers.each { |mover|
  1260. next unless mover.exist?
  1261. if side_l > mover.origin_x
  1262. destination_x += target.sprite.width/2
  1263. destination_x += mover.sprite.width/2
  1264. elsif side_r < mover.origin_x
  1265. destination_x -= target.sprite.width/2
  1266. destination_x -= mover.sprite.width/2
  1267. elsif side_u > mover.origin_y - mover.sprite.height
  1268. destination_y -= target.sprite.height
  1269. elsif side_d < mover.origin_y - mover.sprite.height
  1270. destination_y += mover.sprite.height
  1271. end
  1272. destination_y += mover.sprite.height
  1273. destination_y -= mover.sprite.height/2
  1274. if $imported["BattleSymphony-8D"] && $imported["BattleSymphony-HB"]
  1275. destination_y += mover.sprite.height if mover.use_8d? && target.use_hb?
  1276. destination_y -= mover.sprite.height/4 if mover.use_hb? && target.use_8d?
  1277. end
  1278. }
  1279. }
  1280. #---
  1281. else
  1282. targets.each { |target|
  1283. destination_x += target.screen_x
  1284. destination_y += target.screen_y
  1285. }
  1286. end
  1287. #---
  1288. destination_x /= targets.size
  1289. destination_y /= targets.size
  1290. movers.each { |mover|
  1291. next unless mover.exist?
  1292. next if mover.screen_x == destination_x && mover.screen_y == destination_y
  1293. case @action.upcase
  1294. when /MOVE[ ](.*)/i
  1295. mover.face_coordinate(destination_x, destination_y)
  1296. mover.create_movement(destination_x, destination_y, frames)
  1297. when /TELEPORT[ ](.*)/i
  1298. mover.screen_x = destination_x
  1299. mover.screen_y = destination_y
  1300. when /JUMP[ ](.*)/i
  1301. arc_scan = $1.scan(/(?:ARC)[ ](\d+)/i)
  1302. arc = $1.to_i
  1303. mover.face_coordinate(destination_x, destination_y)
  1304. mover.create_movement(destination_x, destination_y, frames)
  1305. mover.create_jump(arc)
  1306. end
  1307. }
  1308. #---
  1309. end
  1310. #---
  1311. return unless @action_values.include?("WAIT")
  1312. wait_for_move
  1313. end
  1314.  
  1315. #--------------------------------------------------------------------------
  1316. # new method: action_immortal
  1317. #--------------------------------------------------------------------------
  1318. def action_immortal
  1319. targets = get_action_targets
  1320. return unless targets.size > 0
  1321. targets.each { |target|
  1322. next unless target.alive?
  1323. case @action_values[1].upcase
  1324. when "TRUE", "ON", "ENABLE"
  1325. target.immortal = true
  1326. when "OFF", "FALSE", "DISABLE"
  1327. target.immortal = false
  1328. target.refresh
  1329. perform_collapse_check(target)
  1330. end
  1331. }
  1332. end
  1333.  
  1334. #--------------------------------------------------------------------------
  1335. # new method: action_pose
  1336. #--------------------------------------------------------------------------
  1337. def action_pose
  1338. targets = get_action_targets
  1339. return unless targets.size > 0
  1340. #---
  1341. case @action_values[1]
  1342. when "BREAK", "CANCEL", "RESET", "NORMAL"
  1343. targets.each { |target| target.break_pose }
  1344. return
  1345. when "IDLE", "READY"
  1346. pose_key = :ready
  1347. when "DAMAGE", "DMG"
  1348. pose_key = :damage
  1349. when "PIYORI", "CRITICAL", "DAZED", "DAZE", "DIZZY"
  1350. pose_key = :critical
  1351. when "MARCH", "FORWARD"
  1352. pose_key = :marching
  1353. when "VICTORY", "POSE"
  1354. pose_key = :victory
  1355. when "EVADE", "DODGE"
  1356. pose_key = :dodge
  1357. when "DOWN", "DOWNED", "FALLEN"
  1358. pose_key = :fallen
  1359. when "2H", "2H SWING"
  1360. pose_key = :swing2h
  1361. when "1H", "1H SWING"
  1362. pose_key = :swing1h
  1363. when "2H REVERSE", "2H SWING REVERSE"
  1364. pose_key = :r2hswing
  1365. reverse_pose = true
  1366. when "1H REVERSE", "1H SWING REVERSE"
  1367. pose_key = :r1hswing
  1368. reverse_pose = true
  1369. when "CAST", "INVOKE", "ITEM", "MAGIC"
  1370. pose_key = :cast
  1371. when "CHANT", "CHANNEL", "CHARGE"
  1372. pose_key = :channeling
  1373. else; return
  1374. end
  1375. #---
  1376. return unless $imported["BattleSymphony-8D"]
  1377. #---
  1378. targets.each { |target|
  1379. next unless target.exist?
  1380. next unless target.use_8d?
  1381. target.pose = pose_key
  1382. target.force_pose = true
  1383. target.reverse_pose = reverse_pose
  1384. }
  1385. end
  1386.  
  1387. #--------------------------------------------------------------------------
  1388. # new method: action_stance
  1389. #--------------------------------------------------------------------------
  1390. def action_stance
  1391. targets = get_action_targets
  1392. return unless targets.size > 0
  1393. #---
  1394. case @action_values[1]
  1395. when "BREAK", "CANCEL", "RESET", "NORMAL"
  1396. targets.each { |target| target.break_pose }
  1397. return
  1398. when "IDLE", "READY"
  1399. pose_key = :idle
  1400. when "DAMAGE", "DMG", "STRUCK"
  1401. pose_key = :struck
  1402. when "PIYORI", "CRITICAL", "DAZED", "DAZE", "DIZZY", "WOOZY"
  1403. pose_key = :woozy
  1404. when "VICTORY"
  1405. pose_key = :victory
  1406. when "EVADE", "DODGE", "DEFEND"
  1407. pose_key = :defend
  1408. when "DOWN", "DOWNED", "FALLEN", "DEAD"
  1409. pose_key = :dead
  1410. when "SWING", "ATTACK", "SLASH"
  1411. pose_key = :attack
  1412. when "CAST", "INVOKE", "MAGIC"
  1413. pose_key = :magic
  1414. when "ITEM"
  1415. pose_key = :item
  1416. when "SKILL", "PHYSICAL"
  1417. pose_key = :skill
  1418. when "FORWARD", "MOVE", "TARGET"
  1419. pose_key = :advance
  1420. when "ORIGIN", "BACK", "RETREAT"
  1421. pose_key = :retreat
  1422. else; return
  1423. end
  1424. #---
  1425. return unless $imported["BattleSymphony-HB"]
  1426. #---
  1427. targets.each { |target|
  1428. next unless target.exist?
  1429. next unless target.use_hb?
  1430. target.pose = pose_key
  1431. target.force_pose = true
  1432. }
  1433. end
  1434.  
  1435. #--------------------------------------------------------------------------
  1436. # action_wait
  1437. #--------------------------------------------------------------------------
  1438. def action_wait
  1439. case @action
  1440. when "WAIT FOR ANIMATION"
  1441. wait_for_animation
  1442. return
  1443. when "WAIT FOR MOVE", "WAIT FOR MOVEMENT"
  1444. wait_for_move
  1445. return
  1446. end
  1447. frames = @action_values[0].to_i
  1448. frames *= $imported["YEA-CoreEngine"] ? YEA::CORE::ANIMATION_RATE : 4 if @action == "ANI WAIT"
  1449. skip = @action_values.include?("SKIP")
  1450. skip = true if @action == "WAIT SKIP"
  1451. skip ? wait(frames) : abs_wait(frames)
  1452. end
  1453.  
  1454. end # Scene_Battle
  1455.  
  1456. #==============================================================================
  1457. # Section V. Imports Symphony Tags (S-05)
  1458. # -----------------------------------------------------------------------------
  1459. # This section is the field for You to create your own Symphony Tags. Please
  1460. # read carefully the Tutorial at Creating Symphony Tags before touching this.
  1461. #==============================================================================
  1462. #==============================================================================
  1463. # ¡ Scene_Battle - Imported Symphony Configuration
  1464. #==============================================================================
  1465. class Scene_Battle < Scene_Base
  1466.  
  1467. #--------------------------------------------------------------------------
  1468. # new method: imported_symphony
  1469. #--------------------------------------------------------------------------
  1470. def imported_symphony
  1471. case @action.upcase
  1472.  
  1473. #--- Start Importing ---
  1474.  
  1475. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1476. # sample symphony
  1477. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1478. # This is the most basic sample, it will put a line which contains
  1479. # action name and action values in Console.
  1480. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  1481. when /SAMPLE SYMPHONY/i
  1482. action_sample_symphony
  1483.  
  1484. #--- End Importing ---
  1485. else
  1486. if SYMPHONY::AUTO_SYMPHONY.include?(@action.upcase)
  1487. @action_values = [@action.upcase]
  1488. @action = "AUTO SYMPHONY"
  1489. action_autosymphony
  1490. end
  1491. end
  1492. end
  1493.  
  1494. end # Scene_Battle
  1495. #==============================================================================
  1496. # ¡ Scene_Battle - Imported Symphony Actions
  1497. #==============================================================================
  1498. class Scene_Battle < Scene_Base
  1499.  
  1500. #--------------------------------------------------------------------------
  1501. # new method: action_sample_symphony
  1502. #--------------------------------------------------------------------------
  1503. def action_sample_symphony
  1504. str = "#{@action.upcase}: "
  1505. @action_values.each {|value| str += "#{value} "}
  1506. puts str
  1507. end
  1508.  
  1509. end # Scene_Battle
  1510.  
  1511. #==============================================================================
  1512. # Section VI. Sprites Initialization (S-06)
  1513. # -----------------------------------------------------------------------------
  1514. # This section is the first section of core script. It will Initializes and
  1515. # Creates Sprites for all Battlers and Maintains them.
  1516. # -----------------------------------------------------------------------------
  1517. # Do not touch below script unless You know what You do and How it works.
  1518. #==============================================================================
  1519. #==============================================================================
  1520. # ¡ Game_Battler
  1521. #==============================================================================
  1522.  
  1523. class Game_Battler < Game_BattlerBase
  1524.  
  1525. #--------------------------------------------------------------------------
  1526. # * Public Instance Variables
  1527. #--------------------------------------------------------------------------
  1528. attr_accessor :origin_x
  1529. attr_accessor :origin_y
  1530. attr_accessor :screen_x
  1531. attr_accessor :screen_y
  1532. attr_accessor :pose
  1533. attr_accessor :immortal
  1534. attr_accessor :icons
  1535. attr_accessor :direction
  1536. attr_accessor :force_pose
  1537. attr_accessor :reverse_pose
  1538.  
  1539. #--------------------------------------------------------------------------
  1540. # alias method: initialize
  1541. #--------------------------------------------------------------------------
  1542. alias bes_initialize initialize
  1543. def initialize
  1544. bes_initialize
  1545. @screen_x = 0
  1546. @screen_y = 0
  1547. #---
  1548. @move_x_rate = 0
  1549. @move_y_rate = 0
  1550. #---
  1551. @immortal = false
  1552. #---
  1553. @icons = {}
  1554. @force_pose = false
  1555. @reverse_pose = false
  1556. #---
  1557. @hp = 1 # Fix Change Party in Battle.
  1558. #---
  1559. @arc = 0
  1560. @parabola = {}
  1561. @f = 0
  1562. @arc_y = 0
  1563. end
  1564.  
  1565. #--------------------------------------------------------------------------
  1566. # new method: use_charset?
  1567. #--------------------------------------------------------------------------
  1568. def use_charset?
  1569. return false
  1570. end
  1571.  
  1572. #--------------------------------------------------------------------------
  1573. # new method: emptyview?
  1574. #--------------------------------------------------------------------------
  1575. def emptyview?
  1576. return SYMPHONY::View::EMPTY_VIEW
  1577. end
  1578.  
  1579. #--------------------------------------------------------------------------
  1580. # new method: battler
  1581. #--------------------------------------------------------------------------
  1582. def battler
  1583. self.actor? ? self.actor : self.enemy
  1584. end
  1585.  
  1586. #--------------------------------------------------------------------------
  1587. # new method: use_custom_charset?
  1588. #--------------------------------------------------------------------------
  1589. def use_custom_charset?
  1590. if $imported["BattleSymphony-8D"]; return true if use_8d?; end
  1591. if $imported["BattleSymphony-HB"]; return true if use_hb?; end
  1592. return false
  1593. end
  1594.  
  1595. #--------------------------------------------------------------------------
  1596. # new method: screen_z
  1597. #--------------------------------------------------------------------------
  1598. def screen_z
  1599. return 100
  1600. end
  1601.  
  1602. #--------------------------------------------------------------------------
  1603. # alias method: on_battle_start
  1604. #--------------------------------------------------------------------------
  1605. alias bes_on_battle_start on_battle_start
  1606. def on_battle_start
  1607. reset_position
  1608. #---
  1609. bes_on_battle_start
  1610. #---
  1611. return if self.actor? && !$game_party.battle_members.include?(self)
  1612. set_default_position
  1613. end
  1614.  
  1615. #--------------------------------------------------------------------------
  1616. # new method: set_default_position
  1617. #--------------------------------------------------------------------------
  1618. def set_default_position
  1619. @move_rate_x = 0
  1620. @move_rate_y = 0
  1621. #---
  1622. @destination_x = self.screen_x
  1623. @destination_y = self.screen_y
  1624. end
  1625.  
  1626. #--------------------------------------------------------------------------
  1627. # new method: correct_origin_position
  1628. #--------------------------------------------------------------------------
  1629. def correct_origin_position
  1630. # Compatible
  1631. end
  1632.  
  1633. #--------------------------------------------------------------------------
  1634. # new method: reset_position
  1635. #--------------------------------------------------------------------------
  1636. def reset_position
  1637. break_pose
  1638. end
  1639.  
  1640. #--------------------------------------------------------------------------
  1641. # new method: break_pose
  1642. #--------------------------------------------------------------------------
  1643. def break_pose
  1644. @direction = SYMPHONY::View::PARTY_DIRECTION
  1645. @direction = Direction.opposite(@direction) if self.enemy?
  1646. #---
  1647. @pose = Direction.pose(@direction)
  1648. #---
  1649. @force_pose = false
  1650. @reverse_pose = false
  1651. end
  1652.  
  1653. #--------------------------------------------------------------------------
  1654. # new method: pose=
  1655. #--------------------------------------------------------------------------
  1656. def pose=(pose)
  1657. @pose = pose
  1658. return if self.actor? && !$game_party.battle_members.include?(self)
  1659. self.sprite.correct_change_pose if SceneManager.scene.spriteset
  1660. end
  1661.  
  1662. #--------------------------------------------------------------------------
  1663. # new method: can_collapse?
  1664. #--------------------------------------------------------------------------
  1665. def can_collapse?
  1666. return false unless dead?
  1667. unless actor?
  1668. return false unless sprite.battler_visible
  1669. array = [:collapse, :boss_collapse, :instant_collapse]
  1670. return false if array.include?(sprite.effect_type)
  1671. end
  1672. return true
  1673. end
  1674.  
  1675. #--------------------------------------------------------------------------
  1676. # new method: weapons
  1677. #--------------------------------------------------------------------------
  1678. def weapons
  1679. return []
  1680. end
  1681.  
  1682. #--------------------------------------------------------------------------
  1683. # new method: equips
  1684. #--------------------------------------------------------------------------
  1685. def equips
  1686. return []
  1687. end
  1688.  
  1689. #--------------------------------------------------------------------------
  1690. # alias method: add_state
  1691. #--------------------------------------------------------------------------
  1692. alias bes_add_state add_state
  1693. def add_state(state_id)
  1694. bes_add_state(state_id)
  1695. #--- Fix Death pose ---
  1696. return unless SceneManager.scene_is?(Scene_Battle)
  1697. break_pose if state_id == death_state_id
  1698. end
  1699.  
  1700. end # Game_Battler
  1701.  
  1702. #==============================================================================
  1703. # ¡ Game_Actor
  1704. #==============================================================================
  1705.  
  1706. class Game_Actor < Game_Battler
  1707.  
  1708. #--------------------------------------------------------------------------
  1709. # overwrite method: use_sprite?
  1710. #--------------------------------------------------------------------------
  1711. def use_sprite?
  1712. return true
  1713. end
  1714.  
  1715. #--------------------------------------------------------------------------
  1716. # new method: use_charset?
  1717. #--------------------------------------------------------------------------
  1718. def use_charset?
  1719. return true
  1720. end
  1721.  
  1722. #--------------------------------------------------------------------------
  1723. # new method: set_default_position
  1724. #--------------------------------------------------------------------------
  1725. def set_default_position
  1726. super
  1727. return if @origin_x && @origin_y
  1728. return unless $game_party.battle_members.include?(self)
  1729. @origin_x = @screen_x = @destination_x = SYMPHONY::View::ACTORS_POSITION[index][0]
  1730. @origin_y = @screen_y = @destination_y = SYMPHONY::View::ACTORS_POSITION[index][1]
  1731. return unless emptyview?
  1732. @origin_x = @screen_x = @destination_x = self.screen_x
  1733. @origin_y = @screen_y = @destination_y = self.screen_y
  1734. end
  1735.  
  1736. #--------------------------------------------------------------------------
  1737. # new method: reset_position
  1738. #--------------------------------------------------------------------------
  1739. def reset_position
  1740. super
  1741. @origin_x = @origin_y = nil
  1742. end
  1743.  
  1744. #--------------------------------------------------------------------------
  1745. # alias method: screen_x
  1746. #--------------------------------------------------------------------------
  1747. alias bes_screen_x screen_x
  1748. def screen_x
  1749. emptyview? ? bes_screen_x : @screen_x
  1750. end
  1751.  
  1752. #--------------------------------------------------------------------------
  1753. # alias method: screen_y
  1754. #--------------------------------------------------------------------------
  1755. alias bes_screen_y screen_y
  1756. def screen_y
  1757. emptyview? ? bes_screen_y : @screen_y
  1758. end
  1759.  
  1760. #--------------------------------------------------------------------------
  1761. # new method: correct_origin_position
  1762. #--------------------------------------------------------------------------
  1763. def correct_origin_position
  1764. return if @origin_x && @origin_y
  1765. @origin_x = @screen_x = SYMPHONY::View::ACTORS_POSITION[index][0]
  1766. @origin_y = @screen_y = SYMPHONY::View::ACTORS_POSITION[index][1]
  1767. return unless emptyview?
  1768. @origin_x = @screen_x = @destination_x = self.screen_x
  1769. @origin_y = @screen_y = @destination_y = self.screen_y
  1770. end
  1771.  
  1772. #--------------------------------------------------------------------------
  1773. # new method: sprite
  1774. #--------------------------------------------------------------------------
  1775. def sprite
  1776. index = $game_party.battle_members.index(self)
  1777. return nil unless index
  1778. return nil unless SceneManager.scene_is?(Scene_Battle)
  1779. return SceneManager.scene.spriteset.actor_sprites[index]
  1780. end
  1781.  
  1782. #--------------------------------------------------------------------------
  1783. # overwrite method: perform_collapse_effect
  1784. #--------------------------------------------------------------------------
  1785. def perform_collapse_effect
  1786. if $game_party.in_battle
  1787. @sprite_effect_type = :collapse unless self.use_custom_charset?
  1788. Sound.play_actor_collapse
  1789. end
  1790. end
  1791.  
  1792. end # Game_Actor
  1793.  
  1794. #==============================================================================
  1795. # ¡ Game_Enemy
  1796. #==============================================================================
  1797.  
  1798. class Game_Enemy < Game_Battler
  1799.  
  1800. #--------------------------------------------------------------------------
  1801. # new method: correct_origin_position
  1802. #--------------------------------------------------------------------------
  1803. def correct_origin_position
  1804. @origin_x ||= @screen_x
  1805. @origin_y ||= @screen_y
  1806. end
  1807.  
  1808. #--------------------------------------------------------------------------
  1809. # new method: use_charset?
  1810. #--------------------------------------------------------------------------
  1811. def use_charset?
  1812. return super
  1813. end
  1814.  
  1815. #--------------------------------------------------------------------------
  1816. # new method: sprite
  1817. #--------------------------------------------------------------------------
  1818. def sprite
  1819. return nil unless SceneManager.scene_is?(Scene_Battle)
  1820. return SceneManager.scene.spriteset.enemy_sprites.reverse[self.index]
  1821. end
  1822.  
  1823. #--------------------------------------------------------------------------
  1824. # new method: atk_animation_id1
  1825. #--------------------------------------------------------------------------
  1826. def atk_animation_id1
  1827. return enemy.atk_animation_id1
  1828. end
  1829.  
  1830. #--------------------------------------------------------------------------
  1831. # new method: atk_animation_id2
  1832. #--------------------------------------------------------------------------
  1833. def atk_animation_id2
  1834. return enemy.atk_animation_id2
  1835. end
  1836.  
  1837. end # Game_Enemy
  1838.  
  1839. #==============================================================================
  1840. # ¡ Sprite_Battler
  1841. #==============================================================================
  1842.  
  1843. class Sprite_Battler < Sprite_Base
  1844.  
  1845. #--------------------------------------------------------------------------
  1846. # * Public Instance Variables
  1847. #--------------------------------------------------------------------------
  1848. attr_accessor :effect_type
  1849. attr_accessor :battler_visible
  1850.  
  1851. #--------------------------------------------------------------------------
  1852. # new method: pose
  1853. #--------------------------------------------------------------------------
  1854. alias bes_initialize initialize
  1855. def initialize(viewport, battler = nil)
  1856. bes_initialize(viewport, battler)
  1857. correct_change_pose if @battler
  1858. #---
  1859. self.visible = false if SYMPHONY::View::EMPTY_VIEW && (@battler.nil? || @battler.actor?)
  1860. #---
  1861. return if SYMPHONY::View::EMPTY_VIEW
  1862. #---
  1863. return unless SYMPHONY::Visual::BATTLER_SHADOW
  1864. #---
  1865. @charset_shadow = Sprite.new(viewport)
  1866. @charset_shadow.bitmap = Cache.system("Shadow")
  1867. @charset_shadow.ox = @charset_shadow.width / 2
  1868. @charset_shadow.oy = @charset_shadow.height
  1869. end
  1870.  
  1871. #--------------------------------------------------------------------------
  1872. # new method: pose
  1873. #--------------------------------------------------------------------------
  1874. def pose
  1875. @battler.pose
  1876. end
  1877.  
  1878. #--------------------------------------------------------------------------
  1879. # alias method: update
  1880. #--------------------------------------------------------------------------
  1881. alias bes_update update
  1882. def update
  1883. bes_update
  1884. #---
  1885. return if SYMPHONY::View::EMPTY_VIEW
  1886. #---
  1887. return unless SYMPHONY::Visual::BATTLER_SHADOW
  1888. #---
  1889. @charset_shadow.opacity = self.opacity
  1890. @charset_shadow.visible = self.visible
  1891. @charset_shadow.x = self.x + (self.mirror ? 0 : - 2)
  1892. @charset_shadow.y = self.y + 2
  1893. @charset_shadow.z = self.z - 1
  1894. #---
  1895. @charset_shadow.opacity = 0 if @battler.nil?
  1896. end
  1897.  
  1898. #--------------------------------------------------------------------------
  1899. # alias method: update_bitmap
  1900. #--------------------------------------------------------------------------
  1901. alias bes_update_bitmap update_bitmap
  1902. def update_bitmap
  1903. correct_change_pose if @timer.nil?
  1904. @battler.use_charset? ? update_charset : bes_update_bitmap
  1905. end
  1906.  
  1907. #--------------------------------------------------------------------------
  1908. # alias method: update_origin
  1909. #--------------------------------------------------------------------------
  1910. alias bes_update_origin update_origin
  1911. def update_origin
  1912. @battler.update_visual
  1913. @battler.use_charset? ? update_charset_origin : bes_update_origin
  1914. end
  1915.  
  1916. #--------------------------------------------------------------------------
  1917. # new method: update_charset
  1918. #--------------------------------------------------------------------------
  1919. def update_charset
  1920. @battler.set_default_position unless pose
  1921. #---
  1922. update_charset_bitmap
  1923. update_src_rect
  1924. end
  1925.  
  1926. #--------------------------------------------------------------------------
  1927. # new method: correct_change_pose
  1928. #--------------------------------------------------------------------------
  1929. def correct_change_pose
  1930. @pattern = 1
  1931. @timer = 15
  1932. @back_step = false
  1933. @last_pose = pose
  1934. end
  1935.  
  1936. #--------------------------------------------------------------------------
  1937. # new method: update_charset_origin
  1938. #--------------------------------------------------------------------------
  1939. def update_charset_origin
  1940. if bitmap
  1941. self.ox = @cw / 2
  1942. self.oy = @ch
  1943. end
  1944. end
  1945.  
  1946. #--------------------------------------------------------------------------
  1947. # new method: graphic_changed?
  1948. #--------------------------------------------------------------------------
  1949. def graphic_changed?
  1950. self.bitmap.nil? || @character_name != @battler.character_name ||
  1951. @character_index != @battler.character_index
  1952. end
  1953.  
  1954. #--------------------------------------------------------------------------
  1955. # new method: set_character_bitmap
  1956. #--------------------------------------------------------------------------
  1957. def set_character_bitmap
  1958. self.bitmap = Cache.character(@character_name)
  1959. sign = @character_name[/^[\!\$]./]
  1960. if sign && sign.include?('$')
  1961. @cw = bitmap.width / 3
  1962. @ch = bitmap.height / 4
  1963. else
  1964. @cw = bitmap.width / 12
  1965. @ch = bitmap.height / 8
  1966. end
  1967. end
  1968.  
  1969. #--------------------------------------------------------------------------
  1970. # new method: update_charset_bitmap
  1971. #--------------------------------------------------------------------------
  1972. def update_charset_bitmap
  1973. if graphic_changed?
  1974. @character_name = @battler.character_name
  1975. @character_index = @battler.character_index
  1976. set_character_bitmap
  1977. end
  1978. end
  1979.  
  1980. #--------------------------------------------------------------------------
  1981. # new method: update_src_rect
  1982. #--------------------------------------------------------------------------
  1983. def update_src_rect
  1984. @timer -= 1
  1985. if @battler.force_pose
  1986. array = []
  1987. array = Direction.index_8d(pose) if $imported["BattleSymphony-8D"] && @battler.use_8d?
  1988. if [email protected]_pose && @pattern < 2 && @timer <= 0
  1989. @pattern += 1
  1990. @timer = array[2].nil? ? 15 : array[2]
  1991. elsif @battler.reverse_pose && @pattern > 0 && @timer <= 0
  1992. @pattern -= 1
  1993. @timer = array[2].nil? ? 15 : array[2]
  1994. end
  1995. else
  1996. #--- Quick Fix
  1997. @pattern = 2 if @pattern > 2
  1998. @pattern = 0 if @pattern < 0
  1999. #--- End
  2000. if @timer <= 0
  2001. @pattern += @back_step ? -1 : 1
  2002. @back_step = true if @pattern >= 2
  2003. @back_step = false if @pattern <= 0
  2004. @timer = 15
  2005. end
  2006. end
  2007. #---
  2008. @battler.break_pose unless pose
  2009. direction = Direction.direction(pose)
  2010. character_index = @character_index
  2011. #---
  2012. if $imported["BattleSymphony-8D"] && @battler.use_8d?
  2013. array = Direction.index_8d(pose)
  2014. character_index = array[0]
  2015. direction = array[1]
  2016. end
  2017. sx = (character_index % 4 * 3 + @pattern) * @cw
  2018. sy = (character_index / 4 * 4 + (direction - 2) / 2) * @ch
  2019. self.src_rect.set(sx, sy, @cw, @ch)
  2020. end
  2021.  
  2022. #--------------------------------------------------------------------------
  2023. # overwrite method: revert_to_normal
  2024. #--------------------------------------------------------------------------
  2025. def revert_to_normal
  2026. self.blend_type = 0
  2027. self.color.set(0, 0, 0, 0)
  2028. self.opacity = 255
  2029. end
  2030.  
  2031. #--------------------------------------------------------------------------
  2032. # alias method: animation_set_sprites
  2033. # Make Animation Opacity independent of Sprite Opacity
  2034. #--------------------------------------------------------------------------
  2035. alias bes_animation_set_sprites animation_set_sprites
  2036. def animation_set_sprites(frame)
  2037. bes_animation_set_sprites(frame)
  2038. cell_data = frame.cell_data
  2039. @ani_sprites.each_with_index do |sprite, i|
  2040. next unless sprite
  2041. pattern = cell_data[i, 0]
  2042. if !pattern || pattern < 0
  2043. sprite.visible = false
  2044. next
  2045. end
  2046. sprite.opacity = cell_data[i, 6]
  2047. end
  2048. end
  2049.  
  2050. end # Sprite_Battler
  2051.  
  2052. #==============================================================================
  2053. # ¡ Spriteset_Battle
  2054. #==============================================================================
  2055.  
  2056. class Spriteset_Battle
  2057.  
  2058. #--------------------------------------------------------------------------
  2059. # public instance variables
  2060. #--------------------------------------------------------------------------
  2061. attr_accessor :actor_sprites
  2062. attr_accessor :enemy_sprites
  2063.  
  2064. #--------------------------------------------------------------------------
  2065. # overwrite method: create_actors
  2066. # Fixed Large Party.
  2067. #--------------------------------------------------------------------------
  2068. def create_actors
  2069. max_members = $game_party.max_battle_members
  2070. @actor_sprites = Array.new(max_members) { Sprite_Battler.new(@viewport1) }
  2071. end
  2072.  
  2073. #--------------------------------------------------------------------------
  2074. # overwrite method: update_actors
  2075. # Fixed Change Party.
  2076. #--------------------------------------------------------------------------
  2077. def update_actors
  2078. @actor_sprites.each_with_index do |sprite, i|
  2079. party_member = $game_party.battle_members[i]
  2080. if party_member != sprite.battler
  2081. sprite.battler = $game_party.battle_members[i]
  2082. #---
  2083. if party_member
  2084. party_member.reset_position
  2085. party_member.correct_origin_position
  2086. party_member.break_pose if party_member.dead?
  2087. end
  2088. sprite.init_visibility if sprite.battler && !sprite.battler.use_custom_charset?
  2089. end
  2090. sprite.update
  2091. end
  2092. end
  2093.  
  2094. end # Spriteset_Battle
  2095.  
  2096. #==============================================================================
  2097. # Section VII. Icons Sprites Initialization (S-07)
  2098. # -----------------------------------------------------------------------------
  2099. # This section is the second section of core script. It will Initializes and
  2100. # Creates Sprites for all Object like Weapons, Items and Maintains them.
  2101. # -----------------------------------------------------------------------------
  2102. # Do not touch below script unless You know what You do and How it works.
  2103. #==============================================================================
  2104. #==============================================================================
  2105. # ¡ Sprite_Object
  2106. #==============================================================================
  2107.  
  2108. class Sprite_Object < Sprite_Base
  2109.  
  2110. #--------------------------------------------------------------------------
  2111. # initialize
  2112. #--------------------------------------------------------------------------
  2113. def initialize(viewport = nil)
  2114. super(viewport)
  2115. #---
  2116. @dest_angle = 0
  2117. @dest_x = 0
  2118. @dest_y = 0
  2119. #---
  2120. @angle_rate = 0
  2121. @move_x_rate = 0
  2122. @move_y_rate = 0
  2123. @fade_rate = 0
  2124. #---
  2125. @arc = 0
  2126. @parabola = {}
  2127. @f = 0
  2128. @arc_y = 0
  2129. #---
  2130. @battler = nil
  2131. @offset_x = 0
  2132. @offset_y = 0
  2133. @offset_z = 0
  2134. @attach_x = 0
  2135. @attach_y = 0
  2136. @attachment = :middle
  2137. end
  2138.  
  2139. #--------------------------------------------------------------------------
  2140. # set_battler
  2141. #--------------------------------------------------------------------------
  2142. def set_battler(battler = nil)
  2143. @battler = battler
  2144. update
  2145. end
  2146.  
  2147. #--------------------------------------------------------------------------
  2148. # set_position
  2149. #--------------------------------------------------------------------------
  2150. def set_position(x, y)
  2151. @dest_x = self.x = x
  2152. @dest_y = self.y = y
  2153. end
  2154.  
  2155. #--------------------------------------------------------------------------
  2156. # set_angle
  2157. #--------------------------------------------------------------------------
  2158. def set_angle(angle)
  2159. @dest_angle = self.angle = angle
  2160. @dest_angle = self.angle = -angle if mirror_battler?
  2161. end
  2162.  
  2163. #--------------------------------------------------------------------------
  2164. # set_icon
  2165. #--------------------------------------------------------------------------
  2166. def set_icon(index)
  2167. return if index <= 0
  2168. bitmap = Cache.system("Iconset")
  2169. self.bitmap ||= bitmap
  2170. self.src_rect.set(index % 16 * 24, index / 16 * 24, 24, 24)
  2171. self.ox = self.oy = 12
  2172. end
  2173.  
  2174. #--------------------------------------------------------------------------
  2175. # set_origin
  2176. #--------------------------------------------------------------------------
  2177. def set_origin(type)
  2178. @offset_z = 2
  2179. @attachment = type
  2180. case type
  2181. when :item
  2182. self.ox = 12
  2183. self.oy = 12
  2184. @offset_y = [email protected]
  2185. @offset_x = [email protected] / 2
  2186. when :hand1
  2187. self.ox = 24
  2188. self.oy = 24
  2189. @attach_y = [email protected]/3
  2190. @attach_x = [email protected]/5
  2191. when :hand2
  2192. self.ox = 24
  2193. self.oy = 24
  2194. @attach_y = [email protected]/3
  2195. @attach_x = @battler.sprite.width/5
  2196. when :middle
  2197. self.ox = 12
  2198. self.oy = 12
  2199. @offset_y = [email protected]/2
  2200. when :top
  2201. self.ox = 12
  2202. self.oy = 24
  2203. @offset_y = [email protected]
  2204. when :base
  2205. self.ox = 12
  2206. self.oy = 24
  2207. end
  2208. self.y = @battler.screen_y + @attach_y + @offset_y + @arc_y
  2209. end
  2210.  
  2211. #--------------------------------------------------------------------------
  2212. # set_fade
  2213. #--------------------------------------------------------------------------
  2214. def set_fade(rate)
  2215. @fade_rate = rate
  2216. end
  2217.  
  2218. #--------------------------------------------------------------------------
  2219. # create_angle
  2220. #--------------------------------------------------------------------------
  2221. def create_angle(angle, frames = 8)
  2222. return if angle == self.angle
  2223. @dest_angle = angle
  2224. @dest_angle = - @dest_angle if mirror_battler?
  2225. frames = [frames, 1].max
  2226. @angle_rate = [(self.angle - @dest_angle).abs / frames, 2].max
  2227. end
  2228.  
  2229. #--------------------------------------------------------------------------
  2230. # create_arc
  2231. #--------------------------------------------------------------------------
  2232. def create_arc(arc)
  2233. @arc = arc
  2234. @parabola[:x] = 0
  2235. @parabola[:y0] = 0
  2236. @parabola[:y1] = @dest_y - self.y
  2237. @parabola[:h] = - (@parabola[:y0] + @arc * 5)
  2238. @parabola[:d] = (self.x - @dest_x).abs
  2239. end
  2240.  
  2241. #--------------------------------------------------------------------------
  2242. # create_movement
  2243. #--------------------------------------------------------------------------
  2244. def create_movement(destination_x, destination_y, frames = 12)
  2245. return if self.x == destination_x && self.y == destination_y
  2246. @arc = 0
  2247. @dest_x = destination_x
  2248. @dest_y = destination_y
  2249. frames = [frames, 1].max
  2250. @f = frames.to_f / 2
  2251. @move_x_rate = [(self.x - @dest_x).abs / frames, 2].max
  2252. @move_y_rate = [(self.y - @dest_y).abs / frames, 2].max
  2253. end
  2254.  
  2255. #--------------------------------------------------------------------------
  2256. # create_move_direction
  2257. #--------------------------------------------------------------------------
  2258. def create_move_direction(direction, distance, frames = 12)
  2259. case direction
  2260. when 1; move_x = distance / -2; move_y = distance / 2
  2261. when 2; move_x = distance * 0; move_y = distance * 1
  2262. when 3; move_x = distance / -2; move_y = distance / 2
  2263. when 4; move_x = distance * -1; move_y = distance * 0
  2264. when 6; move_x = distance * 1; move_y = distance * 0
  2265. when 7; move_x = distance / -2; move_y = distance / -2
  2266. when 8; move_x = distance * 0; move_y = distance * -1
  2267. when 9; move_x = distance / 2; move_y = distance / -2
  2268. else; return
  2269. end
  2270. #---
  2271. move_x += self.x
  2272. move_y += self.y
  2273. #---
  2274. create_movement(move_x, move_y, frames)
  2275. end
  2276.  
  2277. #--------------------------------------------------------------------------
  2278. # update
  2279. #--------------------------------------------------------------------------
  2280. def update
  2281. super
  2282. update_angle
  2283. @arc == 0 ? update_movement : update_arc
  2284. update_position
  2285. update_opacity
  2286. end
  2287.  
  2288. #--------------------------------------------------------------------------
  2289. # update_angle
  2290. #--------------------------------------------------------------------------
  2291. def update_angle
  2292. return if @angle_rate == 0
  2293. @angle_rate = 0 if self.angle == @dest_angle
  2294. value = [(self.angle - @dest_angle).abs, @angle_rate].min
  2295. self.angle += (@dest_angle > self.angle) ? value : -value
  2296. end
  2297.  
  2298. #--------------------------------------------------------------------------
  2299. # update_arc
  2300. #--------------------------------------------------------------------------
  2301. def update_arc
  2302. return unless [@move_x_rate, @move_y_rate].any? { |x| x != 0 }
  2303. #---
  2304. value = [(self.x - @dest_x).abs, @move_x_rate].min
  2305. @offset_x += (@dest_x > self.x) ? value : -value
  2306. @parabola[:x] += value
  2307. #---
  2308. if @dest_x == self.x
  2309. self.y = @dest_y
  2310. else
  2311. a = (2*(@parabola[:y0]+@parabola[:y1])-4*@parabola[:h])/(@parabola[:d]**2)
  2312. b = (@parabola[:y1]-@parabola[:y0]-a*(@parabola[:d]**2))/@parabola[:d]
  2313. @arc_y = a * @parabola[:x] * @parabola[:x] + b * @parabola[:x] + @parabola[:y0]
  2314. end
  2315. #---
  2316. @move_x_rate = 0 if self.x == @dest_x
  2317. @move_y_rate = 0 if self.y == @dest_y
  2318. end
  2319.  
  2320. #--------------------------------------------------------------------------
  2321. # update_movement
  2322. #--------------------------------------------------------------------------
  2323. def update_movement
  2324. return unless [@move_x_rate, @move_y_rate].any? { |x| x != 0 }
  2325. @move_x_rate = 0 if self.x == @dest_x
  2326. @move_y_rate = 0 if self.y == @dest_y
  2327. value = [(self.x - @dest_x).abs, @move_x_rate].min
  2328. @offset_x += (@dest_x > self.x) ? value : -value
  2329. value = [(self.y - @dest_y).abs, @move_y_rate].min
  2330. @offset_y += (@dest_y > self.y) ? value : -value
  2331. end
  2332.  
  2333. #--------------------------------------------------------------------------
  2334. # update_position
  2335. #--------------------------------------------------------------------------
  2336. def update_position
  2337. if @battler != nil
  2338. self.mirror = mirror_battler?
  2339. update_attachment(self.mirror)
  2340. attach_x = self.mirror ? -@attach_x : @attach_x
  2341. self.x = @battler.screen_x + attach_x + @offset_x
  2342. self.y = @battler.screen_y + @attach_y + @offset_y + @arc_y
  2343. self.z = @battler.screen_z + @offset_z
  2344. else
  2345. self.x = @offset_x
  2346. self.y = @offset_y
  2347. self.z = @offset_z
  2348. end
  2349. end
  2350.  
  2351. #--------------------------------------------------------------------------
  2352. # update_attachment
  2353. #--------------------------------------------------------------------------
  2354. def update_attachment(mirror = false)
  2355. case @attachment
  2356. when :hand1
  2357. self.ox = mirror ? 0 : 24
  2358. self.oy = 24
  2359. @attach_y = [email protected]/3
  2360. @attach_x = [email protected]/5
  2361. when :hand2
  2362. self.ox = mirror ? 0 : 24
  2363. self.oy = 24
  2364. @attach_y = [email protected]/3
  2365. @attach_x = @battler.sprite.width/5
  2366. else
  2367. @attach_x = 0
  2368. @attach_y = 0
  2369. end
  2370. end
  2371.  
  2372. #--------------------------------------------------------------------------
  2373. # update_attachment
  2374. #--------------------------------------------------------------------------
  2375. def update_opacity
  2376. self.opacity += @fade_rate
  2377. end
  2378.  
  2379. #--------------------------------------------------------------------------
  2380. # mirror_battler?
  2381. #--------------------------------------------------------------------------
  2382. def mirror_battler?
  2383. return false if @battler.sprite == nil
  2384. direction = Direction.direction(@battler.pose)
  2385. return true if [9, 6, 3].include?(direction)
  2386. return true if @battler.sprite.mirror
  2387. return false
  2388. end
  2389.  
  2390. #--------------------------------------------------------------------------
  2391. # effecting?
  2392. #--------------------------------------------------------------------------
  2393. def effecting?
  2394. [@angle_rate,@move_y_rate,@move_x_rate,@fade_rate].any? { |x| x > 0 }
  2395. end
  2396.  
  2397. end # Sprite_Object
  2398.  
  2399. #==============================================================================
  2400. # Section VIII. Core Script (S-08)
  2401. # -----------------------------------------------------------------------------
  2402. # This section is the most important section of Core SCript. It will Initialize
  2403. # Database as well as Symphony Tags and put them in actions.
  2404. # -----------------------------------------------------------------------------
  2405. # Do not touch below script unless You know what You do and How it works.
  2406. #==============================================================================
  2407. #==============================================================================
  2408. # ¡ Regular Expression
  2409. #==============================================================================
  2410.  
  2411. module REGEXP
  2412. module SYMPHONY
  2413. SETUP_ANI_ON = /<(?:SETUP_ACTION|setup action|setup)>/i
  2414. SETUP_ANI_OFF = /<\/(?:SETUP_ACTION|setup action|setup)>/i
  2415. WHOLE_ANI_ON = /<(?:WHOLE_ACTION|whole action|whole)>/i
  2416. WHOLE_ANI_OFF = /<\/(?:WHOLE_ACTION|whole action|whole)>/i
  2417. TARGET_ANI_ON = /<(?:TARGET_ACTION|target action|target)>/i
  2418. TARGET_ANI_OFF = /<\/(?:TARGET_ACTION|target action|target)>/i
  2419. FOLLOW_ANI_ON = /<(?:FOLLOW_ACTION|follow action|follow)>/i
  2420. FOLLOW_ANI_OFF = /<\/(?:FOLLOW_ACTION|follow action|follow)>/i
  2421. FINISH_ANI_ON = /<(?:FINISH_ACTION|finish action|finish)>/i
  2422. FINISH_ANI_OFF = /<\/(?:FINISH_ACTION|finish action|finish)>/i
  2423.  
  2424. SYMPHONY_TAG_NONE = /[ ]*(.*)/i
  2425. SYMPHONY_TAG_VALUES = /[ ]*(.*):[ ]*(.*)/i
  2426.  
  2427. ATK_ANI1 = /<(?:ATK_ANI_1|atk ani 1):[ ]*(\d+)>/i
  2428. ATK_ANI2 = /<(?:ATK_ANI_2|atk ani 2):[ ]*(\d+)>/i
  2429.  
  2430. end
  2431. end
  2432.  
  2433. # Scan values: /\w+[\s*\w+]*/i
  2434.  
  2435. #==============================================================================
  2436. # ¡ DataManager
  2437. #==============================================================================
  2438.  
  2439. module DataManager
  2440.  
  2441. #--------------------------------------------------------------------------
  2442. # alias method: load_database
  2443. #--------------------------------------------------------------------------
  2444. class <<self; alias load_database_bes load_database; end
  2445. def self.load_database
  2446. load_database_bes
  2447. load_notetags_bes
  2448. end
  2449.  
  2450. #--------------------------------------------------------------------------
  2451. # new method: load_notetags_bes
  2452. #--------------------------------------------------------------------------
  2453. def self.load_notetags_bes
  2454. groups = [$data_skills, $data_items, $data_weapons, $data_enemies]
  2455. groups.each { |group|
  2456. group.each { |obj|
  2457. next if obj.nil?
  2458. obj.battle_symphony_initialize
  2459. }
  2460. }
  2461. end
  2462.  
  2463. end # DataManager
  2464.  
  2465. #==============================================================================
  2466. # ¡ RPG::BaseItem
  2467. #==============================================================================
  2468.  
  2469. class RPG::BaseItem
  2470.  
  2471. #--------------------------------------------------------------------------
  2472. # * Public Instance Variables
  2473. #--------------------------------------------------------------------------
  2474. attr_accessor :setup_actions_list
  2475. attr_accessor :whole_actions_list
  2476. attr_accessor :target_actions_list
  2477. attr_accessor :follow_actions_list
  2478. attr_accessor :finish_actions_list
  2479. attr_accessor :atk_animation_id1
  2480. attr_accessor :atk_animation_id2
  2481.  
  2482. #--------------------------------------------------------------------------
  2483. # new method: battle_symphony_initialize
  2484. #--------------------------------------------------------------------------
  2485. def battle_symphony_initialize
  2486. create_default_animation
  2487. create_default_symphony
  2488. create_tags_symphony
  2489. end
  2490.  
  2491. #--------------------------------------------------------------------------
  2492. # new method: create_default_animation
  2493. #--------------------------------------------------------------------------
  2494. def create_default_animation
  2495. @atk_animation_id1 = SYMPHONY::Visual::ENEMY_ATTACK_ANIMATION
  2496. @atk_animation_id2 = 0
  2497. self.note.split(/[\r\n]+/).each { |line|
  2498. case line
  2499. when REGEXP::SYMPHONY::ATK_ANI1
  2500. @atk_animation_id1 = $1.to_i
  2501. when REGEXP::SYMPHONY::ATK_ANI2
  2502. @atk_animation_id2 = $1.to_i
  2503. end
  2504. }
  2505. end
  2506.  
  2507. #--------------------------------------------------------------------------
  2508. # new method: create_default_symphony
  2509. #--------------------------------------------------------------------------
  2510. def create_default_symphony
  2511. @setup_actions_list = []; @finish_actions_list = []
  2512. @whole_actions_list = []; @target_actions_list = []
  2513. @follow_actions_list = []
  2514. #---
  2515. if self.is_a?(RPG::Skill) and !self.physical?
  2516. @setup_actions_list = SYMPHONY::DEFAULT_ACTIONS::MAGIC_SETUP
  2517. @whole_actions_list = SYMPHONY::DEFAULT_ACTIONS::MAGIC_WHOLE
  2518. @target_actions_list = SYMPHONY::DEFAULT_ACTIONS::MAGIC_TARGET
  2519. @follow_actions_list = SYMPHONY::DEFAULT_ACTIONS::MAGIC_FOLLOW
  2520. @finish_actions_list = SYMPHONY::DEFAULT_ACTIONS::MAGIC_FINISH
  2521. return
  2522. elsif self.is_a?(RPG::Skill) and self.physical?
  2523. @setup_actions_list = SYMPHONY::DEFAULT_ACTIONS::PHYSICAL_SETUP
  2524. @whole_actions_list = SYMPHONY::DEFAULT_ACTIONS::PHYSICAL_WHOLE
  2525. @target_actions_list = SYMPHONY::DEFAULT_ACTIONS::PHYSICAL_TARGET
  2526. @follow_actions_list = SYMPHONY::DEFAULT_ACTIONS::PHYSICAL_FOLLOW
  2527. @finish_actions_list = SYMPHONY::DEFAULT_ACTIONS::PHYSICAL_FINISH
  2528. return
  2529. elsif self.is_a?(RPG::Item)
  2530. @setup_actions_list = SYMPHONY::DEFAULT_ACTIONS::ITEM_SETUP
  2531. @whole_actions_list = SYMPHONY::DEFAULT_ACTIONS::ITEM_WHOLE
  2532. @target_actions_list = SYMPHONY::DEFAULT_ACTIONS::ITEM_TARGET
  2533. @follow_actions_list = SYMPHONY::DEFAULT_ACTIONS::ITEM_FOLLOW
  2534. @finish_actions_list = SYMPHONY::DEFAULT_ACTIONS::ITEM_FINISH
  2535. return
  2536. end
  2537. end
  2538.  
  2539. #--------------------------------------------------------------------------
  2540. # new method: create_tags_symphony
  2541. #--------------------------------------------------------------------------
  2542. def create_tags_symphony
  2543. self.note.split(/[\r\n]+/).each { |line|
  2544. case line
  2545. when REGEXP::SYMPHONY::SETUP_ANI_ON
  2546. @symphony_tag = true
  2547. @setup_actions_list = []
  2548. @setup_action_flag = true
  2549. when REGEXP::SYMPHONY::SETUP_ANI_OFF
  2550. @symphony_tag = false
  2551. @setup_action_flag = false
  2552. when REGEXP::SYMPHONY::WHOLE_ANI_ON
  2553. @symphony_tag = true
  2554. @whole_actions_list = []
  2555. @whole_action_flag = true
  2556. when REGEXP::SYMPHONY::WHOLE_ANI_OFF
  2557. @symphony_tag = false
  2558. @whole_action_flag = false
  2559. when REGEXP::SYMPHONY::TARGET_ANI_ON
  2560. @symphony_tag = true
  2561. @target_actions_list = []
  2562. @target_action_flag = true
  2563. when REGEXP::SYMPHONY::TARGET_ANI_OFF
  2564. @symphony_tag = false
  2565. @target_action_flag = false
  2566. when REGEXP::SYMPHONY::FOLLOW_ANI_ON
  2567. @symphony_tag = true
  2568. @follow_actions_list = []
  2569. @follow_action_flag = true
  2570. when REGEXP::SYMPHONY::FOLLOW_ANI_OFF
  2571. @symphony_tag = false
  2572. @follow_action_flag = false
  2573. when REGEXP::SYMPHONY::FINISH_ANI_ON
  2574. @symphony_tag = true
  2575. @finish_actions_list = []
  2576. @finish_action_flag = true
  2577. when REGEXP::SYMPHONY::FINISH_ANI_OFF
  2578. @symphony_tag = false
  2579. @finish_action_flag = false
  2580. #---
  2581. else
  2582. next unless @symphony_tag
  2583. case line
  2584. when REGEXP::SYMPHONY::SYMPHONY_TAG_VALUES
  2585. action = $1
  2586. value = $2.scan(/[^, ]+[^,]*/i)
  2587. when REGEXP::SYMPHONY::SYMPHONY_TAG_NONE
  2588. action = $1
  2589. value = [nil]
  2590. else; next
  2591. end
  2592. array = [action, value]
  2593. if @setup_action_flag
  2594. @setup_actions_list.push(array)
  2595. elsif @whole_action_flag
  2596. @whole_actions_list.push(array)
  2597. elsif @target_action_flag
  2598. @target_actions_list.push(array)
  2599. elsif @follow_action_flag
  2600. @follow_actions_list.push(array)
  2601. elsif @finish_action_flag
  2602. @finish_actions_list.push(array)
  2603. end
  2604. end
  2605. }
  2606. end
  2607.  
  2608. #--------------------------------------------------------------------------
  2609. # new method: valid_actions?
  2610. #--------------------------------------------------------------------------
  2611. def valid_actions?(phase)
  2612. case phase
  2613. when :setup
  2614. return @setup_actions_list.size > 0
  2615. when :whole
  2616. return @whole_actions_list.size > 0
  2617. when :target
  2618. return @target_actions_list.size > 0
  2619. when :follow
  2620. return @follow_actions_list.size > 0
  2621. when :finish
  2622. return @finish_actions_list.size > 0
  2623. end
  2624. end
  2625.  
  2626. end # RPG::BaseItem
  2627.  
  2628. #==============================================================================
  2629. # ¡ Direction
  2630. #==============================================================================
  2631.  
  2632. module Direction
  2633.  
  2634. #--------------------------------------------------------------------------
  2635. # self.pose
  2636. #--------------------------------------------------------------------------
  2637. def self.pose(direction)
  2638. case direction
  2639. when 4; return :left
  2640. when 6; return :right
  2641. when 8; return :up
  2642. when 2; return :down
  2643. when 7; return :left
  2644. when 1; return :left
  2645. when 9; return :right
  2646. when 3; return :right
  2647. end
  2648. end
  2649.  
  2650. #--------------------------------------------------------------------------
  2651. # self.non8d_pose
  2652. #--------------------------------------------------------------------------
  2653. def self.non8d_pose(pose)
  2654. case pose
  2655. when :down_l; return :left
  2656. when :down_r; return :right
  2657. when :up_l; return :left
  2658. when :up_r; return :right
  2659. end
  2660. end
  2661.  
  2662. #--------------------------------------------------------------------------
  2663. # self.pose
  2664. #--------------------------------------------------------------------------
  2665. def self.direction(pose)
  2666. case pose
  2667. when :left; return 4
  2668. when :right; return 6
  2669. when :up; return 8
  2670. when :down; return 2
  2671. end
  2672. end
  2673.  
  2674. #--------------------------------------------------------------------------
  2675. # self.opposite
  2676. #--------------------------------------------------------------------------
  2677. def self.opposite(direction)
  2678. case direction
  2679. when 1; return 9
  2680. when 2; return 8
  2681. when 3; return 7
  2682. when 4; return 6
  2683. when 6; return 4
  2684. when 7; return 3
  2685. when 8; return 2
  2686. when 9; return 1
  2687. else; return direction
  2688. end
  2689. end
  2690.  
  2691. #--------------------------------------------------------------------------
  2692. # self.face_coordinate
  2693. #--------------------------------------------------------------------------
  2694. def self.face_coordinate(screen_x, screen_y, destination_x, destination_y)
  2695. x1 = Integer(screen_x)
  2696. x2 = Integer(destination_x)
  2697. y1 = Graphics.height - Integer(screen_y)
  2698. y2 = Graphics.height - Integer(destination_y)
  2699. return if x1 == x2 and y1 == y2
  2700. #---
  2701. angle = Integer(Math.atan2((y2-y1),(x2-x1)) * 1800 / Math::PI)
  2702. if (0..225) === angle or (-225..0) === angle
  2703. direction = 6
  2704. elsif (226..675) === angle
  2705. direction = 9
  2706. elsif (676..1125) === angle
  2707. direction = 8
  2708. elsif (1126..1575) === angle
  2709. direction = 7
  2710. elsif (1576..1800) === angle or (-1800..-1576) === angle
  2711. direction = 4
  2712. elsif (-1575..-1126) === angle
  2713. direction = 1
  2714. elsif (-1125..-676) === angle
  2715. direction = 2
  2716. elsif (-675..-226) === angle
  2717. direction = 3
  2718. end
  2719. return direction
  2720. end
  2721.  
  2722. end # Direction
  2723.  
  2724. #==============================================================================
  2725. # ¡ Game_ActionResult
  2726. #==============================================================================
  2727.  
  2728. class Game_ActionResult
  2729.  
  2730. #--------------------------------------------------------------------------
  2731. # alias method: clear_hit_flags
  2732. #--------------------------------------------------------------------------
  2733. alias bes_clear_hit_flags clear_hit_flags
  2734. def clear_hit_flags
  2735. return unless @calc
  2736. bes_clear_hit_flags
  2737. @temp_missed = @temp_evaded = @temp_critical = nil
  2738. end
  2739.  
  2740. #--------------------------------------------------------------------------
  2741. # new method: clear_bes_flag
  2742. #--------------------------------------------------------------------------
  2743. def clear_bes_flag
  2744. @perfect_hit = false
  2745. @calc = false
  2746. @dmg = false
  2747. @effect = false
  2748. end
  2749.  
  2750. #--------------------------------------------------------------------------
  2751. # new method: clear_change_target
  2752. #--------------------------------------------------------------------------
  2753. def clear_change_target
  2754. @check_counter = false
  2755. @check_reflection = false
  2756. end
  2757.  
  2758. #--------------------------------------------------------------------------
  2759. # new method: set_perfect
  2760. #--------------------------------------------------------------------------
  2761. def set_perfect
  2762. @perfect_hit = true
  2763. end
  2764.  
  2765. #--------------------------------------------------------------------------
  2766. # new method: set_calc
  2767. #--------------------------------------------------------------------------
  2768. def set_calc
  2769. @calc = true
  2770. end
  2771.  
  2772. #--------------------------------------------------------------------------
  2773. # new method: set_dmg
  2774. #--------------------------------------------------------------------------
  2775. def set_dmg
  2776. @dmg = true
  2777. end
  2778.  
  2779. #--------------------------------------------------------------------------
  2780. # new method: set_effect
  2781. #--------------------------------------------------------------------------
  2782. def set_effect
  2783. @effect = true
  2784. end
  2785.  
  2786. #--------------------------------------------------------------------------
  2787. # new method: set_counter
  2788. #--------------------------------------------------------------------------
  2789. def set_counter
  2790. @check_counter = true
  2791. end
  2792.  
  2793. #--------------------------------------------------------------------------
  2794. # new method: set_reflection
  2795. #--------------------------------------------------------------------------
  2796. def set_reflection
  2797. @check_reflection = true
  2798. end
  2799.  
  2800. #--------------------------------------------------------------------------
  2801. # new method: used=
  2802. #--------------------------------------------------------------------------
  2803. def evaded=(flag)
  2804. @evaded = @temp_evaded.nil? ? flag : @temp_evaded
  2805. end
  2806.  
  2807. #--------------------------------------------------------------------------
  2808. # new method: used=
  2809. #--------------------------------------------------------------------------
  2810. def critical=(flag)
  2811. @critical = @temp_critical.nil? ? flag : @temp_critical
  2812. end
  2813.  
  2814. #--------------------------------------------------------------------------
  2815. # new method: used=
  2816. #--------------------------------------------------------------------------
  2817. def misssed=(flag)
  2818. @missed = @temp_missed.nil? ? flag : @temp_missed
  2819. end
  2820.  
  2821. #--------------------------------------------------------------------------
  2822. # alias method: hit?
  2823. #--------------------------------------------------------------------------
  2824. alias bes_hit? hit?
  2825. def hit?
  2826. bes_hit? || (@used && @perfect_hit)
  2827. end
  2828.  
  2829. #--------------------------------------------------------------------------
  2830. # new method: dmg?
  2831. #--------------------------------------------------------------------------
  2832. def dmg?
  2833. @dmg || !SceneManager.scene_is?(Scene_Battle)
  2834. end
  2835.  
  2836. #--------------------------------------------------------------------------
  2837. # new method: effect?
  2838. #--------------------------------------------------------------------------
  2839. def effect?
  2840. @effect || !SceneManager.scene_is?(Scene_Battle)
  2841. end
  2842.  
  2843. #--------------------------------------------------------------------------
  2844. # new method: has_damage?
  2845. #--------------------------------------------------------------------------
  2846. def has_damage?
  2847. [@hp_damage, @mp_damage, @tp_damage].any? { |x| x > 0 }
  2848. end
  2849.  
  2850. #--------------------------------------------------------------------------
  2851. # new method: check_counter?
  2852. #--------------------------------------------------------------------------
  2853. def check_counter?
  2854. @check_counter
  2855. end
  2856.  
  2857. #--------------------------------------------------------------------------
  2858. # new method: check_reflection?
  2859. #--------------------------------------------------------------------------
  2860. def check_reflection?
  2861. @check_reflection
  2862. end
  2863.  
  2864. end # Game_ActionResult
  2865.  
  2866. #==============================================================================
  2867. # ¡ Game_Battler
  2868. #==============================================================================
  2869.  
  2870. class Game_Battler < Game_BattlerBase
  2871.  
  2872. #--------------------------------------------------------------------------
  2873. # new method: backup_actions
  2874. #--------------------------------------------------------------------------
  2875. def backup_actions
  2876. @backup_actions = @actions.dup if @actions
  2877. end
  2878.  
  2879. #--------------------------------------------------------------------------
  2880. # new method: restore_actions
  2881. #--------------------------------------------------------------------------
  2882. def restore_actions
  2883. @actions = @backup_actions.dup if @backup_actions
  2884. @backup_actions.clear
  2885. @backup_actions = nil
  2886. end
  2887.  
  2888. #--------------------------------------------------------------------------
  2889. # alias method: item_cnt
  2890. #--------------------------------------------------------------------------
  2891. alias bes_item_cnt item_cnt
  2892. def item_cnt(user, item)
  2893. return 0 unless @result.check_counter?
  2894. return bes_item_cnt(user, item)
  2895. end
  2896.  
  2897. #--------------------------------------------------------------------------
  2898. # alias method: item_mrf
  2899. #--------------------------------------------------------------------------
  2900. alias bes_item_mrf item_mrf
  2901. def item_mrf(user, item)
  2902. return 0 unless @result.check_reflection?
  2903. return 0 if @magic_reflection
  2904. return bes_item_mrf(user, item)
  2905. end
  2906.  
  2907. #--------------------------------------------------------------------------
  2908. # alias method: state_resist_set
  2909. #--------------------------------------------------------------------------
  2910. alias bes_state_resist_set state_resist_set
  2911. def state_resist_set
  2912. result = bes_state_resist_set
  2913. result += [death_state_id] if @immortal
  2914. result
  2915. end
  2916.  
  2917. #--------------------------------------------------------------------------
  2918. # alias method: execute_damage
  2919. #--------------------------------------------------------------------------
  2920. alias bes_execute_damage execute_damage
  2921. def execute_damage(user)
  2922. return unless @result.dmg?
  2923. bes_execute_damage(user)
  2924. end
  2925.  
  2926. #--------------------------------------------------------------------------
  2927. # alias method: make_damage_value
  2928. #--------------------------------------------------------------------------
  2929. alias bes_make_damage_value make_damage_value
  2930. def make_damage_value(user, item)
  2931. return unless @result.dmg?
  2932. bes_make_damage_value(user, item)
  2933. end
  2934.  
  2935. #--------------------------------------------------------------------------
  2936. # alias method: item_effect_apply
  2937. #--------------------------------------------------------------------------
  2938. alias bes_item_effect_apply item_effect_apply
  2939. def item_effect_apply(user, item, effect)
  2940. return unless @result.effect?
  2941. bes_item_effect_apply(user, item, effect)
  2942. end
  2943.  
  2944. #--------------------------------------------------------------------------
  2945. # alias method: item_user_effect
  2946. #--------------------------------------------------------------------------
  2947. alias bes_item_user_effect item_user_effect
  2948. def item_user_effect(user, item)
  2949. return unless @result.effect?
  2950. bes_item_user_effect(user, item)
  2951. end
  2952.  
  2953. #--------------------------------------------------------------------------
  2954. # alias method: make_miss_popups
  2955. #--------------------------------------------------------------------------
  2956. if $imported["YEA-BattleEngine"]
  2957. alias bes_make_miss_popups make_miss_popups
  2958. def make_miss_popups(user, item)
  2959. @result.restore_damage unless @result.effect?
  2960. bes_make_miss_popups(user, item)
  2961. unless @result.effect?
  2962. @result.store_damage
  2963. @result.clear_damage_values
  2964. end
  2965. end
  2966. end
  2967.  
  2968. #--------------------------------------------------------------------------
  2969. # new method: face_coordinate
  2970. #--------------------------------------------------------------------------
  2971. def face_coordinate(destination_x, destination_y)
  2972. direction = Direction.face_coordinate(self.screen_x, self.screen_y, destination_x, destination_y)
  2973. #direction = Direction.opposite(direction) if self.sprite.mirror
  2974. @direction = direction
  2975. return if $imported["BattleSymphony-HB"] && self.use_hb?
  2976. return if SYMPHONY::Visual::DISABLE_AUTO_MOVE_POSE && self.use_custom_charset?
  2977. @pose = Direction.pose(direction)
  2978. end
  2979.  
  2980. #--------------------------------------------------------------------------
  2981. # new method: create_movement
  2982. #--------------------------------------------------------------------------
  2983. def create_movement(destination_x, destination_y, frames = 12)
  2984. return if @screen_x == destination_x && @screen_y == destination_y
  2985. @destination_x = destination_x
  2986. @destination_y = destination_y
  2987. frames = [frames, 1].max
  2988. @f = frames.to_f / 2
  2989. @move_x_rate = [(@screen_x - @destination_x).abs / frames, 2].max
  2990. @move_y_rate = [(@screen_y - @destination_y).abs / frames, 2].max
  2991. end
  2992.  
  2993. #--------------------------------------------------------------------------
  2994. # new method: create_jump
  2995. #--------------------------------------------------------------------------
  2996. def create_jump(arc)
  2997. @arc = arc
  2998. @parabola[:x] = 0
  2999. @parabola[:y0] = 0
  3000. @parabola[:y1] = @destination_y - @screen_y
  3001. @parabola[:h] = - (@parabola[:y0] + @arc * 5)
  3002. @parabola[:d] = (@screen_x - @destination_x).abs
  3003. end
  3004.  
  3005. #--------------------------------------------------------------------------
  3006. # new method: create_icon
  3007. #--------------------------------------------------------------------------
  3008. def create_icon(symbol, icon_id = 0)
  3009. delete_icon(symbol)
  3010. #---
  3011. icon = Sprite_Object.new(self.sprite.viewport)
  3012. case symbol
  3013. when :weapon1
  3014. object = self.weapons[0]
  3015. icon_id = object.nil? ? nil : object.icon_index
  3016. when :weapon2
  3017. object = dual_wield? ? self.weapons[1] : nil
  3018. icon_id = object.nil? ? nil : object.icon_index
  3019. when :shield
  3020. object = dual_wield? ? nil : self.equips[1]
  3021. icon_id = object.nil? ? nil : object.icon_index
  3022. when :item
  3023. object = self.current_action.item
  3024. icon_id = object.nil? ? nil : object.icon_index
  3025. else; end
  3026. return if icon_id.nil? || icon_id <= 0
  3027. icon.set_icon(icon_id)
  3028. icon.set_battler(self)
  3029. #---
  3030. @icons[symbol] = icon
  3031. end
  3032.  
  3033. #--------------------------------------------------------------------------
  3034. # new method: delete_icon
  3035. #--------------------------------------------------------------------------
  3036. def delete_icon(symbol)
  3037. return unless @icons[symbol]
  3038. @icons[symbol].dispose
  3039. @icons.delete(symbol)
  3040. end
  3041.  
  3042. #--------------------------------------------------------------------------
  3043. # new method: clear_icons
  3044. #--------------------------------------------------------------------------
  3045. def clear_icons
  3046. @icons.each { |key, value|
  3047. value.dispose
  3048. @icons.delete(key)
  3049. }
  3050. end
  3051.  
  3052. #--------------------------------------------------------------------------
  3053. # new method: update_movement
  3054. #--------------------------------------------------------------------------
  3055. def update_movement
  3056. return unless self.is_moving?
  3057. @move_x_rate = 0 if @screen_x == @destination_x || @move_x_rate.nil?
  3058. @move_y_rate = 0 if @screen_y == @destination_y || @move_y_rate.nil?
  3059. value = [(@screen_x - @destination_x).abs, @move_x_rate].min
  3060. @screen_x += (@destination_x > @screen_x) ? value : -value
  3061. value = [(@screen_y - @destination_y).abs, @move_y_rate].min
  3062. @screen_y += (@destination_y > @screen_y) ? value : -value
  3063. end
  3064.  
  3065. #--------------------------------------------------------------------------
  3066. # new method: update_jump
  3067. #--------------------------------------------------------------------------
  3068. def update_jump
  3069. return unless self.is_moving?
  3070. #---
  3071. value = [(@screen_x - @destination_x).abs, @move_x_rate].min
  3072. @screen_x += (@destination_x > @screen_x) ? value : -value
  3073. @parabola[:x] += value
  3074. @screen_y -= @arc_y
  3075. #---
  3076. if @destination_x == @screen_x
  3077. @screen_y = @destination_y
  3078. @arc_y = 0
  3079. @arc = 0
  3080. else
  3081. a = (2.0*(@parabola[:y0]+@parabola[:y1])-4*@parabola[:h])/(@parabola[:d]**2)
  3082. b = (@parabola[:y1]-@parabola[:y0]-a*(@parabola[:d]**2))/@parabola[:d]
  3083. @arc_y = a * @parabola[:x] * @parabola[:x] + b * @parabola[:x] + @parabola[:y0]
  3084. end
  3085. #---
  3086. @screen_y += @arc_y
  3087. @move_x_rate = 0 if @screen_x == @destination_x
  3088. @move_y_rate = 0 if @screen_y == @destination_y
  3089. end
  3090.  
  3091. #--------------------------------------------------------------------------
  3092. # new method: update_icons
  3093. #--------------------------------------------------------------------------
  3094. def update_icons
  3095. @icons ||= {}
  3096. @icons.each_value { |value| value.update }
  3097. end
  3098.  
  3099. #--------------------------------------------------------------------------
  3100. # new method: update_visual
  3101. #--------------------------------------------------------------------------
  3102. def update_visual
  3103. return unless SceneManager.scene_is?(Scene_Battle)
  3104. return unless SceneManager.scene.spriteset
  3105. correct_origin_position
  3106. #---
  3107. @arc == 0 ? update_movement : update_jump
  3108. update_icons
  3109. end
  3110.  
  3111. #--------------------------------------------------------------------------
  3112. # new method: is_moving?
  3113. #--------------------------------------------------------------------------
  3114. def is_moving?
  3115. [@move_x_rate, @move_y_rate].any? { |x| x != 0 }
  3116. end
  3117.  
  3118. #--------------------------------------------------------------------------
  3119. # new method: is_moving?
  3120. #--------------------------------------------------------------------------
  3121. def dual_attack?
  3122. self.actor? && self.current_action.attack? && self.dual_wield? && self.weapons.size > 1
  3123. end
  3124.  
  3125. end # Game_Battler
  3126.  
  3127. #==============================================================================
  3128. # ¡ Sprite_Battler
  3129. #==============================================================================
  3130.  
  3131. class Sprite_Battler < Sprite_Base
  3132.  
  3133. #--------------------------------------------------------------------------
  3134. # new method: is_moving?
  3135. #--------------------------------------------------------------------------
  3136. def is_moving?
  3137. return unless @battler
  3138. @battler.is_moving?
  3139. end
  3140.  
  3141. end # Sprite_Battler
  3142.  
  3143. #==============================================================================
  3144. # ¡ Spriteset_Battle
  3145. #==============================================================================
  3146.  
  3147. class Spriteset_Battle
  3148.  
  3149. #--------------------------------------------------------------------------
  3150. # new method: is_moving?
  3151. #--------------------------------------------------------------------------
  3152. def is_moving?
  3153. self.battler_sprites.any? { |sprite| sprite.is_moving? }
  3154. end
  3155.  
  3156. end # Spriteset_Battle
  3157.  
  3158. #==============================================================================
  3159. # ¡ Window_BattleLog
  3160. #==============================================================================
  3161.  
  3162. class Window_BattleLog < Window_Selectable
  3163.  
  3164.  
  3165.  
  3166. end # Window_BattleLog
  3167.  
  3168. #==============================================================================
  3169. # ¡ Scene_Battle
  3170. #==============================================================================
  3171.  
  3172. class Scene_Battle < Scene_Base
  3173.  
  3174. #--------------------------------------------------------------------------
  3175. # overwrite method: use_item
  3176. #--------------------------------------------------------------------------
  3177. def use_item
  3178. @scene_item = item = @subject.current_action.item
  3179. targets = @subject.current_action.make_targets.compact
  3180. #---
  3181. attack = @subject.current_action.attack?
  3182. weapon = @subject.weapons[0]
  3183. w_action = attack && weapon
  3184. #---
  3185. targets = targets * 2 if attack && @subject.dual_attack?
  3186. #--- Setup Actions ---
  3187. actions_list = item.setup_actions_list
  3188. actions_list = weapon.setup_actions_list if w_action && weapon.valid_actions?(:setup)
  3189. perform_actions_list(actions_list, targets)
  3190. #--- Item Costs ---
  3191. @subject.use_item(item)
  3192. refresh_status
  3193. #--- YEA - Cast Animation
  3194. process_casting_animation if $imported["YEA-CastAnimations"]
  3195. #--- YEA - Lunatic Object
  3196. if $imported["YEA-LunaticObjects"]
  3197. lunatic_object_effect(:before, item, @subject, @subject)
  3198. end
  3199. #--- Whole Actions ---
  3200. actions_list = item.whole_actions_list
  3201. actions_list = weapon.whole_actions_list if w_action && weapon.valid_actions?(:whole)
  3202. perform_actions_list(actions_list, targets)
  3203. #--- Target Actions ---
  3204. actions_list = item.target_actions_list
  3205. actions_list = weapon.target_actions_list if w_action && weapon.valid_actions?(:target)
  3206. targets.each { |target|
  3207. next if target.dead?
  3208. perform_actions_list(actions_list, [target])
  3209. }
  3210. #--- Follow Actions ---
  3211. actions_list = item.follow_actions_list
  3212. actions_list = weapon.follow_actions_list if w_action && weapon.valid_actions?(:follow)
  3213. perform_actions_list(actions_list, targets)
  3214. #--- Finish Actions ---
  3215. actions_list = item.finish_actions_list
  3216. actions_list = weapon.finish_actions_list if w_action && weapon.valid_actions?(:finish)
  3217. immortal_flag = ["IMMORTAL", ["TARGETS", "FALSE"]]
  3218. if !actions_list.include?(immortal_flag)
  3219. if SYMPHONY::Fixes::AUTO_IMMORTAL_OFF
  3220. actions_list = [immortal_flag] + actions_list
  3221. end
  3222. end
  3223. perform_actions_list(actions_list, targets)
  3224. #--- YEA - Lunatic Object
  3225. if $imported["YEA-LunaticObjects"]
  3226. lunatic_object_effect(:after, item, @subject, @subject)
  3227. end
  3228. targets.each { |target|
  3229. next unless target.actor?
  3230. @status_window.draw_item(target.index)
  3231. }
  3232. end
  3233.  
  3234. #--------------------------------------------------------------------------
  3235. # alias method: invoke_item
  3236. #--------------------------------------------------------------------------
  3237. alias bes_invoke_item invoke_item
  3238. def invoke_item(target, item)
  3239. if $imported["YEA-TargetManager"]
  3240. target = alive_random_target(target, item) if item.for_random?
  3241. end
  3242. bes_invoke_item(target, item)
  3243. #--- Critical Actions ---
  3244. actions_list = SYMPHONY::DEFAULT_ACTIONS::CRITICAL_ACTIONS
  3245. perform_actions_list(actions_list, [target]) if target.result.critical
  3246. #--- Miss Actions ---
  3247. actions_list = SYMPHONY::DEFAULT_ACTIONS::MISS_ACTIONS
  3248. perform_actions_list(actions_list, [target]) if target.result.missed
  3249. #--- Evade Actions ---
  3250. actions_list = SYMPHONY::DEFAULT_ACTIONS::EVADE_ACTIONS
  3251. perform_actions_list(actions_list, [target]) if target.result.evaded
  3252. #--- Fail Actions ---
  3253. actions_list = SYMPHONY::DEFAULT_ACTIONS::FAIL_ACTIONS
  3254. perform_actions_list(actions_list, [target]) if !target.result.success
  3255. #--- Damaged Actions
  3256. actions_list = SYMPHONY::DEFAULT_ACTIONS::DAMAGED_ACTION
  3257. perform_actions_list(actions_list, [target]) if target.result.has_damage?
  3258. end
  3259.  
  3260. #--------------------------------------------------------------------------
  3261. # alias method: execute_action
  3262. #--------------------------------------------------------------------------
  3263. alias bes_execute_action execute_action
  3264. def execute_action
  3265. bes_execute_action
  3266. #--- Reset Flags ---
  3267. ($game_party.battle_members + $game_troop.members).each { |battler|
  3268. battler.result.set_calc; battler.result.clear
  3269. battler.clear_icons
  3270. battler.set_default_position
  3271. battler.break_pose
  3272. }
  3273. $game_troop.screen.clear_bes_ve if $imported["BattleSymphony-VisualEffect"]
  3274. @status_window.draw_item(@status_window.index)
  3275. end
  3276.  
  3277. #--------------------------------------------------------------------------
  3278. # overwrite method: invoke_counter_attack
  3279. #--------------------------------------------------------------------------
  3280. def invoke_counter_attack(target, item)
  3281. @log_window.display_counter(target, item)
  3282. last_subject = @subject
  3283. @counter_subject = target
  3284. @subject = target
  3285. #---
  3286. @subject.backup_actions
  3287. #---
  3288. @subject.make_actions
  3289. @subject.current_action.set_attack
  3290. #---
  3291. actions_list = SYMPHONY::DEFAULT_ACTIONS::COUNTER_ACTION
  3292. perform_actions_list(actions_list, [last_subject])
  3293. #---
  3294. @subject.clear_actions
  3295. @subject = last_subject
  3296. #---
  3297. @counter_subject.restore_actions
  3298. #---
  3299. @counter_subject = nil
  3300. @log_window.display_action_results(@subject, item)
  3301. refresh_status
  3302. perform_collapse_check(@subject)
  3303. perform_collapse_check(target)
  3304. end
  3305.  
  3306. #--------------------------------------------------------------------------
  3307. # overwrite method: invoke_magic_reflection
  3308. #--------------------------------------------------------------------------
  3309. def invoke_magic_reflection(target, item)
  3310. @subject.magic_reflection = true
  3311. @log_window.display_reflection(target, item)
  3312. last_subject = @subject
  3313. @reflect_subject = target
  3314. @subject = target
  3315. #---
  3316. @subject.backup_actions
  3317. #---
  3318. @subject.make_actions
  3319. if item.is_a?(RPG::Skill); @subject.current_action.set_skill(item.id)
  3320. else; @subject.current_action.set_item(item.id); end
  3321. #---
  3322. actions_list = SYMPHONY::DEFAULT_ACTIONS::REFLECT_ACTION
  3323. perform_actions_list(actions_list, [last_subject])
  3324. #---
  3325. @subject.clear_actions
  3326. @subject = last_subject
  3327. #---
  3328. @reflect_subject.restore_actions
  3329. #---
  3330. @reflect_subject = nil
  3331. @log_window.display_action_results(@subject, item)
  3332. refresh_status
  3333. perform_collapse_check(@subject)
  3334. perform_collapse_check(target)
  3335. @subject.magic_reflection = false
  3336. end
  3337.  
  3338. #--------------------------------------------------------------------------
  3339. # new method: wait_for_move
  3340. #--------------------------------------------------------------------------
  3341. def wait_for_move
  3342. update_for_wait
  3343. update_for_wait while @spriteset.is_moving?
  3344. end
  3345.  
  3346. #--------------------------------------------------------------------------
  3347. # new method: spriteset
  3348. #--------------------------------------------------------------------------
  3349. def spriteset
  3350. @spriteset
  3351. end
  3352.  
  3353. #--------------------------------------------------------------------------
  3354. # compatible overwrite method: separate_ani?
  3355. #--------------------------------------------------------------------------
  3356. if $imported["YEA-BattleEngine"]
  3357. def separate_ani?(target, item)
  3358. return false
  3359. end
  3360. end
  3361.  
  3362. #--------------------------------------------------------------------------
  3363. # new method: perform_collapse_check
  3364. #--------------------------------------------------------------------------
  3365. def perform_collapse_check(target)
  3366. target.perform_collapse_effect if target.can_collapse?
  3367. @log_window.wait_for_effect
  3368. end
  3369.  
  3370. #--------------------------------------------------------------------------
  3371. # overwrite method: create_log_window
  3372. #--------------------------------------------------------------------------
  3373. #~ def create_log_window
  3374. #~ @log_window = Window_BattleLog.new
  3375. #~ end
  3376.  
  3377. end # Scene_Battle
  3378.  
  3379. #===============================================================================
  3380. #
  3381. # END OF FILE
  3382. #
  3383. #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment