Guest User

Untitled

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