pigu_6

Yami | Symphony Battle

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