Advertisement
Guest User

Untitled

a guest
Dec 28th, 2012
988
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.95 KB | None | 0 0
  1. #==============================================================================
  2. #
  3. # ¥ Yanfly Engine Ace - Visual Battlers v1.01
  4. # -- Last Updated: 2012.07.24
  5. # -- Level: Easy
  6. # -- Requires: n/a
  7. #
  8. # ¥ Modified by:
  9. # -- Yami
  10. # -- Kread-Ex
  11. # -- Archeia_Nessiah
  12. #
  13. # - Barreytor's modded copy of the script
  14. # Includes:
  15. # - "Actors drop dead" quickfix
  16. # - "Actors stay still" quickfix with toggle
  17. #==============================================================================
  18.  
  19. $imported = {} if $imported.nil?
  20. $imported["YEA-VisualBattlers"] = true
  21.  
  22. #==============================================================================
  23. # ¥ Updates
  24. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  25. # 2012.12.18 - Added preset views and able to change direction in-game.
  26. # 2012.07.24 - Finished Script.
  27. # 2012.01.05 - Started Script.
  28. #
  29. #==============================================================================
  30. # ¥ Introduction
  31. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  32. # This script provides a visual for all actors by default charsets. The actions
  33. # and movements are alike Final Fantasy 1, only move forward and backward when
  34. # start and finish actions.
  35. #
  36. #==============================================================================
  37. # ¥ Instructions
  38. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  39. # To change the player direction in-game, use the snippet below in a script
  40. # call:
  41. #
  42. # $game_system.party_direction = n
  43. #
  44. # To install this script, open up your script editor and copy/paste this script
  45. # to an open slot below ¥ Materials but above ¥ Main. Remember to save.
  46. #
  47. #==============================================================================
  48. # ¥ Compatibility
  49. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  50. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  51. # it will run with RPG Maker VX without adjusting.
  52. #
  53. #==============================================================================
  54.  
  55. module YEA
  56. module VISUAL_BATTLERS
  57.  
  58. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  59. # - Party Location Setting -
  60. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  61. # These settings are adjusted for Party Location. Each Actor will have
  62. # coordinates calculated by below formula. There are two samples coordinates
  63. # below, change PARTY_DIRECTION to the base index you want to use.
  64. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  65. PARTY_DIRECTION = 6 # This direction is opposite from actual direction.
  66.  
  67. PARTY_LOCATION_BASE_COORDINATES ={
  68. # Index => [base_x, base_y, mod_x, mod_y],
  69. 2 => [ 250, 290, 40, 0], #UP
  70. 4 => [ 150, 280, 20, -20], #LEFT
  71. 3 => [ 460, 280, 30, -10], #RIGHT
  72. 6 => [ 440, 260, 20, 20], #DEFAULT RIGHT
  73. 8 => [ 260, 230, 40, 0], #DOWN
  74. } # Do not remove this.
  75.  
  76. PARTY_LOCATION_FORMULA_X = "base_x + index * mod_x"
  77. PARTY_LOCATION_FORMULA_Y = "base_y + index * mod_y"
  78.  
  79. ACTORS_WALK_WHEN_STILL = true
  80.  
  81. end # VISUAL_BATTLERS
  82. end # YEA
  83.  
  84. #==============================================================================
  85. # ¥ Editting anything past this point may potentially result in causing
  86. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  87. # halitosis so edit at your own risk.
  88. #==============================================================================
  89.  
  90. #==============================================================================
  91. # ? ¥ Direction
  92. #==============================================================================
  93.  
  94. module Direction
  95.  
  96. #--------------------------------------------------------------------------
  97. # self.correct
  98. #--------------------------------------------------------------------------
  99. def self.correct(direction)
  100. case direction
  101. when 1; return 4
  102. when 3; return 6
  103. when 7; return 4
  104. when 9; return 6
  105. else; return direction
  106. end
  107. end
  108.  
  109. #--------------------------------------------------------------------------
  110. # self.opposite
  111. #--------------------------------------------------------------------------
  112. def self.opposite(direction)
  113. case direction
  114. when 1; return 6
  115. when 2; return 8
  116. when 3; return 4
  117. when 4; return 6
  118. when 6; return 4
  119. when 7; return 6
  120. when 8; return 2
  121. when 9; return 4
  122. else; return direction
  123. end
  124. end
  125.  
  126. end # Direction
  127.  
  128. #==============================================================================
  129. # ? ¥ Game_System
  130. #==============================================================================
  131.  
  132. class Game_System; attr_accessor :party_direction; end
  133.  
  134. #==============================================================================
  135. # ? ¥ Game_BattleCharacter
  136. #==============================================================================
  137.  
  138. class Game_BattleCharacter < Game_Character
  139.  
  140. #--------------------------------------------------------------------------
  141. # initialize
  142. #--------------------------------------------------------------------------
  143. def initialize(actor)
  144. super()
  145. setup_actor(actor)
  146. @move_x_rate = 0
  147. @move_y_rate = 0
  148. end
  149.  
  150. #--------------------------------------------------------------------------
  151. # setup_actor
  152. #--------------------------------------------------------------------------
  153. def setup_actor(actor)
  154. @actor = actor
  155. @step_anime = true
  156. set_graphic(@actor.character_name, @actor.character_index)
  157. setup_coordinates
  158. dr = $game_system.party_direction || YEA::VISUAL_BATTLERS::PARTY_DIRECTION
  159. direction = Direction.opposite(dr)
  160. set_direction(Direction.correct(direction))
  161. end
  162.  
  163. #--------------------------------------------------------------------------
  164. # step_anime=
  165. #--------------------------------------------------------------------------
  166. def step_anime=(step_anime)
  167. @step_anime = step_anime
  168. end
  169.  
  170. #--------------------------------------------------------------------------
  171. # sprite=
  172. #--------------------------------------------------------------------------
  173. def sprite=(sprite)
  174. @sprite = sprite
  175. end
  176.  
  177. #--------------------------------------------------------------------------
  178. # setup_coordinates
  179. #--------------------------------------------------------------------------
  180. def setup_coordinates
  181. location = ($game_system.party_direction ||
  182. YEA::VISUAL_BATTLERS::PARTY_DIRECTION)
  183. base_x = YEA::VISUAL_BATTLERS::PARTY_LOCATION_BASE_COORDINATES[location][0]
  184. base_y = YEA::VISUAL_BATTLERS::PARTY_LOCATION_BASE_COORDINATES[location][1]
  185. mod_x = YEA::VISUAL_BATTLERS::PARTY_LOCATION_BASE_COORDINATES[location][2]
  186. mod_y = YEA::VISUAL_BATTLERS::PARTY_LOCATION_BASE_COORDINATES[location][3]
  187. @actor.screen_x = eval(YEA::VISUAL_BATTLERS::PARTY_LOCATION_FORMULA_X)
  188. @actor.screen_y = eval(YEA::VISUAL_BATTLERS::PARTY_LOCATION_FORMULA_Y)
  189. @actor.origin_x = @actor.screen_x
  190. @actor.origin_y = @actor.screen_y
  191. @actor.create_move_to(screen_x, screen_y, 1)
  192. end
  193.  
  194. #--------------------------------------------------------------------------
  195. # index
  196. #--------------------------------------------------------------------------
  197. def index
  198. return @actor.index
  199. end
  200.  
  201. #--------------------------------------------------------------------------
  202. # screen_x
  203. #--------------------------------------------------------------------------
  204. def screen_x
  205. return @actor.screen_x
  206. end
  207.  
  208. #--------------------------------------------------------------------------
  209. # screen_y
  210. #--------------------------------------------------------------------------
  211. def screen_y
  212. return @actor.screen_y
  213. end
  214.  
  215. #--------------------------------------------------------------------------
  216. # screen_z
  217. #--------------------------------------------------------------------------
  218. def screen_z
  219. return @actor.screen_z
  220. end
  221.  
  222. end # Game_BattleCharacter
  223.  
  224. #==============================================================================
  225. # ? ¥ Game_Battler
  226. #==============================================================================
  227.  
  228. class Game_Battler < Game_BattlerBase
  229.  
  230. #--------------------------------------------------------------------------
  231. # public instance variables
  232. #--------------------------------------------------------------------------
  233. attr_accessor :moved_back
  234. attr_accessor :origin_x
  235. attr_accessor :origin_y
  236. attr_accessor :screen_x
  237. attr_accessor :screen_y
  238. attr_accessor :started_turn
  239.  
  240. #--------------------------------------------------------------------------
  241. # alias method: execute_damage
  242. #--------------------------------------------------------------------------
  243. alias game_battler_execute_damage_vb execute_damage
  244. def execute_damage(user)
  245. game_battler_execute_damage_vb(user)
  246. if @result.hp_damage > 0
  247. move_backward(24, 6) unless @moved_back
  248. @moved_back = true
  249. end
  250. end
  251.  
  252. #--------------------------------------------------------------------------
  253. # face_opposing_party
  254. #--------------------------------------------------------------------------
  255. def face_opposing_party
  256. direction = ($game_system.party_direction ||
  257. YEA::VISUAL_BATTLERS::PARTY_DIRECTION)
  258. character.set_direction(Direction.correct(direction)) rescue 0
  259. end
  260.  
  261. #--------------------------------------------------------------------------
  262. # new method: face_coordinate
  263. #--------------------------------------------------------------------------
  264. def face_coordinate(destination_x, destination_y)
  265. x1 = Integer(@screen_x)
  266. x2 = Integer(destination_x)
  267. y1 = Graphics.height - Integer(@screen_y)
  268. y2 = Graphics.height - Integer(destination_y)
  269. return if x1 == x2 and y1 == y2
  270. #---
  271. angle = Integer(Math.atan2((y2-y1),(x2-x1)) * 1800 / Math::PI)
  272. if (0..225) === angle or (-225..0) === angle
  273. direction = 6
  274. elsif (226..675) === angle
  275. direction = 9
  276. elsif (676..1125) === angle
  277. direction = 8
  278. elsif (1126..1575) === angle
  279. direction = 7
  280. elsif (1576..1800) === angle or (-1800..-1576) === angle
  281. direction = 4
  282. elsif (-1575..-1126) === angle
  283. direction = 1
  284. elsif (-1125..-676) === angle
  285. direction = 2
  286. elsif (-675..-226) === angle
  287. direction = 3
  288. end
  289. #---
  290. character.set_direction(Direction.correct(direction)) rescue 0
  291. end
  292.  
  293. #--------------------------------------------------------------------------
  294. # create_move_to
  295. #--------------------------------------------------------------------------
  296. def create_move_to(destination_x, destination_y, frames = 6)
  297. @destination_x = destination_x
  298. @destination_y = destination_y
  299. frames = [frames, 1].max
  300. @move_x_rate = [(@screen_x - @destination_x).abs / frames, 2].max
  301. @move_y_rate = [(@screen_y - @destination_y).abs / frames, 2].max
  302. end
  303.  
  304. #--------------------------------------------------------------------------
  305. # update_move_to
  306. #--------------------------------------------------------------------------
  307. def update_move_to
  308. @move_x_rate = 0 if @screen_x == @destination_x || @move_x_rate.nil?
  309. @move_y_rate = 0 if @screen_y == @destination_y || @move_y_rate.nil?
  310. value = [(@screen_x - @destination_x).abs, @move_x_rate].min
  311. @screen_x += (@destination_x > @screen_x) ? value : -value
  312. value = [(@screen_y - @destination_y).abs, @move_y_rate].min
  313. @screen_y += (@destination_y > @screen_y) ? value : -value
  314. end
  315.  
  316. #--------------------------------------------------------------------------
  317. # move_forward
  318. #--------------------------------------------------------------------------
  319. def move_forward(distance = 24, frames = 6)
  320. direction = forward_direction
  321. move_direction(direction, distance, frames)
  322. end
  323.  
  324. #--------------------------------------------------------------------------
  325. # move_backward
  326. #--------------------------------------------------------------------------
  327. def move_backward(distance = 24, frames = 6)
  328. direction = Direction.opposite(forward_direction)
  329. move_direction(direction, distance, frames)
  330. end
  331.  
  332. #--------------------------------------------------------------------------
  333. # move_direction
  334. #--------------------------------------------------------------------------
  335. def move_direction(direction, distance = 24, frames = 6)
  336. case direction
  337. when 1; move_x = distance / -2; move_y = distance / 2
  338. when 2; move_x = distance * 0; move_y = distance * 1
  339. when 3; move_x = distance / -2; move_y = distance / 2
  340. when 4; move_x = distance * -1; move_y = distance * 0
  341. when 6; move_x = distance * 1; move_y = distance * 0
  342. when 7; move_x = distance / -2; move_y = distance / -2
  343. when 8; move_x = distance * 0; move_y = distance * -1
  344. when 9; move_x = distance / 2; move_y = distance / -2
  345. else; return
  346. end
  347. destination_x = @screen_x + move_x
  348. destination_y = @screen_y + move_y
  349. create_move_to(destination_x, destination_y, frames)
  350. end
  351.  
  352. #--------------------------------------------------------------------------
  353. # forward_direction
  354. #--------------------------------------------------------------------------
  355. def forward_direction
  356. return ($game_system.party_direction ||
  357. YEA::VISUAL_BATTLERS::PARTY_DIRECTION)
  358. end
  359.  
  360. #--------------------------------------------------------------------------
  361. # move_origin
  362. #--------------------------------------------------------------------------
  363. def move_origin
  364. create_move_to(@origin_x, @origin_y)
  365. face_coordinate(@origin_x, @origin_y)
  366. @moved_back = false
  367. end
  368.  
  369. #--------------------------------------------------------------------------
  370. # moving?
  371. #--------------------------------------------------------------------------
  372. def moving?
  373. return false if dead? || !exist?
  374. return @move_x_rate != 0 || @move_y_rate != 0
  375. end
  376.  
  377. end # Game_Battler
  378.  
  379. #==============================================================================
  380. # ? ¥ Game_Actor
  381. #==============================================================================
  382.  
  383. class Game_Actor < Game_Battler
  384.  
  385. #--------------------------------------------------------------------------
  386. # overwrite method: use_sprite?
  387. #--------------------------------------------------------------------------
  388. def use_sprite?
  389. return true
  390. end
  391.  
  392. #--------------------------------------------------------------------------
  393. # new method: screen_x
  394. #--------------------------------------------------------------------------
  395. def screen_x
  396. return @screen_x rescue 0
  397. end
  398.  
  399. #--------------------------------------------------------------------------
  400. # new method: screen_y
  401. #--------------------------------------------------------------------------
  402. def screen_y
  403. return @screen_y rescue 0
  404. end
  405.  
  406. #--------------------------------------------------------------------------
  407. # new method: screen_z
  408. #--------------------------------------------------------------------------
  409. def screen_z
  410. return 100
  411. end
  412.  
  413. #--------------------------------------------------------------------------
  414. # new method: sprite
  415. #--------------------------------------------------------------------------
  416. def sprite
  417. index = $game_party.battle_members.index(self)
  418. return SceneManager.scene.spriteset.actor_sprites[index]
  419. end
  420.  
  421. #--------------------------------------------------------------------------
  422. # new method: character
  423. #--------------------------------------------------------------------------
  424. def character
  425. return sprite.character_base
  426. end
  427.  
  428. #--------------------------------------------------------------------------
  429. # face_opposing_party
  430. #--------------------------------------------------------------------------
  431. def face_opposing_party
  432. dr = $game_system.party_direction || YEA::VISUAL_BATTLERS::PARTY_DIRECTION
  433. direction = Direction.opposite(dr)
  434. character.set_direction(Direction.correct(direction)) rescue 0
  435. end
  436.  
  437. #--------------------------------------------------------------------------
  438. # forward_direction
  439. #--------------------------------------------------------------------------
  440. def forward_direction
  441. return Direction.opposite(($game_system.party_direction ||
  442. YEA::VISUAL_BATTLERS::PARTY_DIRECTION))
  443. end
  444.  
  445. end # Game_Actor
  446.  
  447. #==============================================================================
  448. # ? ¥ Game_Enemy
  449. #==============================================================================
  450.  
  451. class Game_Enemy < Game_Battler
  452.  
  453. #--------------------------------------------------------------------------
  454. # new method: sprite
  455. #--------------------------------------------------------------------------
  456. def sprite
  457. return SceneManager.scene.spriteset.enemy_sprites.reverse[self.index]
  458. end
  459.  
  460. #--------------------------------------------------------------------------
  461. # new method: character
  462. #--------------------------------------------------------------------------
  463. def character
  464. return sprite
  465. end
  466.  
  467. end # Game_Enemy
  468.  
  469. #==============================================================================
  470. # ? ¥ Game_Troop
  471. #==============================================================================
  472.  
  473. class Game_Troop < Game_Unit
  474.  
  475. #--------------------------------------------------------------------------
  476. # alias method: setup
  477. #--------------------------------------------------------------------------
  478. alias game_troop_setup_vb setup
  479. def setup(troop_id)
  480. game_troop_setup_vb(troop_id)
  481. set_coordinates
  482. end
  483.  
  484. #--------------------------------------------------------------------------
  485. # new method: set_coordinates
  486. #--------------------------------------------------------------------------
  487. def set_coordinates
  488. for member in members
  489. member.origin_x = member.screen_x
  490. member.origin_y = member.screen_y
  491. member.create_move_to(member.screen_x, member.screen_y, 1)
  492. end
  493. end
  494.  
  495. end # Game_Troop
  496.  
  497. #==============================================================================
  498. # ? ¥ Sprite_Battler
  499. #==============================================================================
  500.  
  501. class Sprite_Battler < Sprite_Base
  502.  
  503. #--------------------------------------------------------------------------
  504. # public instance_variable
  505. #--------------------------------------------------------------------------
  506. attr_accessor :character_base
  507. attr_accessor :character_sprite
  508.  
  509. #--------------------------------------------------------------------------
  510. # alias method: dispose
  511. #--------------------------------------------------------------------------
  512. alias sprite_battler_dispose_vb dispose
  513. def dispose
  514. dispose_character_sprite
  515. sprite_battler_dispose_vb
  516. end
  517.  
  518. #--------------------------------------------------------------------------
  519. # new method: dispose_character_sprite
  520. #--------------------------------------------------------------------------
  521. def dispose_character_sprite
  522. @character_sprite.dispose unless @character_sprite.nil?
  523. end
  524.  
  525. #--------------------------------------------------------------------------
  526. # alias method: update
  527. #--------------------------------------------------------------------------
  528. alias sprite_battler_update_vb update
  529. def update
  530. sprite_battler_update_vb
  531. return if @battler.nil?
  532. update_move_to
  533. update_character_base
  534. update_character_sprite
  535. end
  536.  
  537. #--------------------------------------------------------------------------
  538. # new method: update_character_base
  539. #--------------------------------------------------------------------------
  540. def update_character_base
  541. return if @character_base.nil?
  542. @character_base.update
  543. end
  544.  
  545. #--------------------------------------------------------------------------
  546. # new method: update_character_sprite
  547. #--------------------------------------------------------------------------
  548. def update_character_sprite
  549. return if @character_sprite.nil?
  550. @character_sprite.update
  551. end
  552.  
  553. #--------------------------------------------------------------------------
  554. # new method: update_move_to
  555. #--------------------------------------------------------------------------
  556. def update_move_to
  557. @battler.update_move_to
  558. end
  559.  
  560. #--------------------------------------------------------------------------
  561. # new method: moving?
  562. #--------------------------------------------------------------------------
  563. def moving?
  564. return false if @battler.nil?
  565. return @battler.moving?
  566. end
  567.  
  568. end # Sprite_Battler
  569.  
  570. #==============================================================================
  571. # ? ¥ Sprite_BattleCharacter
  572. #==============================================================================
  573.  
  574. class Sprite_BattleCharacter < Sprite_Character
  575.  
  576. #--------------------------------------------------------------------------
  577. # initialize
  578. #--------------------------------------------------------------------------
  579. def initialize(viewport, character = nil)
  580. super(viewport, character)
  581. character.sprite = self
  582. end
  583.  
  584. end # Sprite_BattleCharacter
  585.  
  586. #==============================================================================
  587. # ? ¥ Spriteset_Battle
  588. #==============================================================================
  589.  
  590. class Spriteset_Battle
  591.  
  592. #--------------------------------------------------------------------------
  593. # public instance_variable
  594. #--------------------------------------------------------------------------
  595. attr_accessor :actor_sprites
  596. attr_accessor :enemy_sprites
  597.  
  598. #--------------------------------------------------------------------------
  599. # overwrite method: create_actors
  600. #--------------------------------------------------------------------------
  601. def create_actors
  602. total = $game_party.max_battle_members
  603. @current_party = $game_party.battle_members.clone
  604. @actor_sprites = Array.new(total) { Sprite_Battler.new(@viewport1) }
  605. for actor in $game_party.battle_members
  606. @actor_sprites[actor.index].battler = actor
  607. create_actor_sprite(actor)
  608. end
  609. end
  610.  
  611. #--------------------------------------------------------------------------
  612. # new method: create_actor_sprite
  613. #--------------------------------------------------------------------------
  614. def create_actor_sprite(actor)
  615. character = Game_BattleCharacter.new(actor)
  616. character_sprite = Sprite_BattleCharacter.new(@viewport1, character)
  617. @actor_sprites[actor.index].character_base = character
  618. @actor_sprites[actor.index].character_sprite = character_sprite
  619. actor.face_opposing_party
  620. end
  621.  
  622. #--------------------------------------------------------------------------
  623. # alias method: update_actors
  624. #--------------------------------------------------------------------------
  625. alias spriteset_battle_update_actors_vb update_actors
  626. def update_actors
  627. for actor in $game_party.battle_members
  628. if $game_party.battle_members[actor.index].death_state?
  629. @actor_sprites[actor.index].character_sprite.angle = -90
  630. @actor_sprites[actor.index].character_base.step_anime = false
  631. #
  632. elsif @actor_sprites[actor.index].battler.moving?
  633. @actor_sprites[actor.index].character_sprite.angle = 0
  634. @actor_sprites[actor.index].character_base.step_anime = true
  635. else
  636. @actor_sprites[actor.index].character_sprite.angle = 0
  637. @actor_sprites[actor.index].character_base.step_anime = YEA::VISUAL_BATTLERS::ACTORS_WALK_WHEN_STILL
  638. end
  639. end
  640. if @current_party != $game_party.battle_members
  641. dispose_actors
  642. create_actors
  643. end
  644. spriteset_battle_update_actors_vb
  645. end
  646.  
  647. #--------------------------------------------------------------------------
  648. # new method: moving?
  649. #--------------------------------------------------------------------------
  650. def moving?
  651. return battler_sprites.any? {|sprite| sprite.moving? }
  652. end
  653.  
  654. end # Spriteset_Battle
  655.  
  656. #==============================================================================
  657. # ? ¥ Scene_Battle
  658. #==============================================================================
  659.  
  660. class Scene_Battle < Scene_Base
  661.  
  662. #--------------------------------------------------------------------------
  663. # public instance variables
  664. #--------------------------------------------------------------------------
  665. attr_accessor :spriteset
  666.  
  667. #--------------------------------------------------------------------------
  668. # alias method: process_action_end
  669. #--------------------------------------------------------------------------
  670. alias scene_battle_process_action_end_vb process_action_end
  671. def process_action_end
  672. start_battler_move_origin
  673. scene_battle_process_action_end_vb
  674. end
  675.  
  676. #--------------------------------------------------------------------------
  677. # alias method: execute_action
  678. #--------------------------------------------------------------------------
  679. alias scene_battle_execute_action_vb execute_action
  680. def execute_action
  681. start_battler_move_forward
  682. scene_battle_execute_action_vb
  683. end
  684.  
  685. #--------------------------------------------------------------------------
  686. # new method: start_battler_move_forward
  687. #--------------------------------------------------------------------------
  688. def start_battler_move_forward
  689. return if @subject.started_turn
  690. @subject.started_turn = true
  691. @subject.move_forward
  692. wait_for_moving
  693. end
  694.  
  695. #--------------------------------------------------------------------------
  696. # new method: start_battler_move_origin
  697. #--------------------------------------------------------------------------
  698. def start_battler_move_origin
  699. @subject.started_turn = nil
  700. move_battlers_origin
  701. wait_for_moving
  702. @subject.face_opposing_party rescue 0
  703. end
  704.  
  705. #--------------------------------------------------------------------------
  706. # new method: move_battlers_origin
  707. #--------------------------------------------------------------------------
  708. def move_battlers_origin
  709. for member in all_battle_members
  710. next unless member.exist?
  711. next if member.dead?
  712. member.move_origin
  713. end
  714. end
  715.  
  716. #--------------------------------------------------------------------------
  717. # new method: wait_for_moving
  718. #--------------------------------------------------------------------------
  719. def wait_for_moving
  720. update_for_wait
  721. update_for_wait while @spriteset.moving?
  722. end
  723.  
  724. end # Scene_Battle
  725.  
  726. #==============================================================================
  727. #
  728. # ¥ End of File
  729. #
  730. #==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement