cooldoode325

Yami's Battle Symphony

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