Advertisement
Guest User

fixed

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