Guest User

Untitled

a guest
Dec 2nd, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 274.73 KB | None | 0 0
  1. =begin
  2. ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  3. ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  4. ■■ X A S - Xiderwong Action System (For Advanced Users)
  5. ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  6. ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  7.  
  8. X - Xiderowng
  9. A - Action
  10. S - System
  11.  
  12. Created by XIDEROWNG (XMS / XRXS / ちいさな本屋 / 森穂(もりほ)
  13. http://xrxs.at-ninja.jp/
  14.  
  15. #===============================================================================
  16. # ■ TERMS OF USE
  17. #===============================================================================
  18.  
  19. English
  20.  
  21. - You need to give credits to Xiderowng.
  22. - You need to link the official Xiderowng website.
  23. http://xrxs.at-ninja.jp/
  24.  
  25. Português
  26.  
  27. > Termos de uso <
  28. - Você precisa dar os creditos para o Xiderowg.
  29. - Você precisa divulgar a página oficial do Xiderowg.
  30. http://xrxs.at-ninja.jp/
  31.  
  32.  
  33. #===============================================================================
  34. # ■ XAS Hero Edition ACE (Ver Experimental 0.5 - 2012 / 01 / 04)
  35. #===============================================================================
  36.  
  37. Updates for XAS Hero Edtion.
  38. http://www.atelier-rgss.com/
  39.  
  40. XAS Tutorials.
  41. http://xasabs.wordpress.com/
  42.  
  43. #===============================================================================
  44. # ■ Caracteristicas (MAIN FEATURES)
  45. #===============================================================================
  46. Sistema de batalha ativa no mapa (ou) e de interação com o cenário.
  47.  
  48. #===============================================================================
  49. # ■ Histórico
  50. #===============================================================================
  51. (V 0.5)
  52. - introdução inicial do XAS Hero Edition para o Rpg Maker VX ACE.
  53. - Versão de teste para correção de bugs, glitches e teste de performance.
  54. =end
  55.  
  56.  
  57.  
  58. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  59. # XAS - SETUP
  60. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  61. #===============================================================================
  62. # ■ XAS SYSTEN SETTING
  63. #===============================================================================
  64. # Disable one of the systems below if you have any problem
  65. # compatibility with other systems of script, performance problem or
  66. # if you do not want to use any of the following systems
  67. #-------------------------------------------------------------------------------
  68. module XAS_SYSTEM
  69. # Enable the battle system, leave it as false if you want to use only the
  70. # system tools (Interaction scenario)
  71. # If you want to disable the battle system in the game use the command
  72. # below.
  73. #
  74. # $game_system.xas_battle = X
  75. # true or false
  76. #
  77. BATTLE_SYSTEM = false
  78. #Enable the display of damage(Sprite).
  79. DAMAGE_POP = false #Miredit
  80. # Enable the system pose stock.
  81. CHARACTER_POSE_NAME = true
  82. # Enable the system sprites
  83. CHARACTER_SPRITE_EFFECTS = true
  84. # Enable the system dash advanced to the XAS.
  85. DASH_SYSTEM = true
  86. # Enable the system to diagonal player.
  87. PLAYER_DIAGONAL_MOVEMENT = false
  88. # Enable the diagonal system for the event
  89. EVENT_DIAGONAL_MOVEMENT = true
  90. # Enable the system conditions for battler.
  91. STATE_SYSTEM = true
  92. # Definition of the map that will be the events of the tools.
  93. ACTION_TEMPLATE_MAP_ID = 1
  94. # Setting the variable ID representing ID tool,
  95. # This ID is used to create interactive events with the tools.
  96. HIT_ID = 3
  97. end
  98.  
  99. #===============================================================================
  100. # ■ XAS BUTTON SETTING
  101. #===============================================================================
  102. module XAS_BUTTON
  103. #Defining the attack button.
  104. ACTION_1_BUTTON = Input::SHIFT #Input::SHIFT #:R1, Used to be Input::SHIFT
  105. #Defining Button settings hell.
  106. ACTION_2_BUTTON = :L2 #Input::C #: Used to be :L2
  107. #Defining button skill
  108. SKILL_BUTTON = :R2 #Input::Z
  109. #Defining item button.
  110. ITEM_BUTTON = :Y #Input::Y
  111. #Defining the run button.
  112. DASH_BUTTON = Input::A
  113. #Defining button to change leader.
  114. CHANGE_LEADER_BUTTON = :L3 #Input::R
  115. #
  116. #Activate the attack button.
  117. ENABLE_ACTION_1_BUTTON = true
  118. #Activate the button shield.
  119. ENABLE_ACTION_2_BUTTON = true #gotta map this to controller!
  120. #Activate the button skill.
  121. ENABLE_SKILL_BUTTON = true
  122. #Activate the button item.
  123. ENABLE_ITEM_BUTTON = true
  124. #Enable the run button.
  125. ENABLE_DASH_BUTTON = false
  126. #Activate Enable button to change leader.
  127. ENABLE_CHANGE_LEADER_BUTTON = true
  128. end
  129.  
  130. #===============================================================================
  131. # ■ WORD SETTING
  132. #===============================================================================
  133. # Definition of terms used in XAS
  134. #-------------------------------------------------------------------------------
  135. module XAS_WORD
  136. # Activate the words.
  137. ENABLE_WORD = false
  138. # Word used when the battler uses the defense system.
  139. GUARD = "Guard"
  140. # Word used when you do not have enough MP to use the skill.
  141. NO_MP = "No MP"
  142. # Word used when you do not have the ability to activate item.
  143. NO_ITEM = "No Item"
  144. # Word used when the character level increases.
  145. LEVEL_UP = "Level Up"
  146. # Word used when the character is sealed with the actions.
  147. SEAL = "Sealed!"
  148. # Word used when the character is invincible.
  149. INVINCIBLE = "Invincible!"
  150. # Word used to define experience.
  151. EXP = "Exp"
  152. #Word used when the target dodges the attack.
  153. EVADED = "Evaded!"
  154. # Word used when the battler misses the attack.
  155. MISSED = "Missed!"
  156. # Word used when the counter is enabled.
  157. COUNTER = "Counter"
  158. # Word used when the ability is reflected.
  159. REFLECT = "Reflected"
  160. end
  161.  
  162. #===============================================================================
  163. # ■ XAS DAMAGE POP
  164. #===============================================================================
  165. #System definition sprites damage.
  166. #-------------------------------------------------------------------------------
  167. module XAS_DAMAGE_POP
  168. # Source definition.
  169. DAMAGE_FONT_NAME = "Chantelli Antiqua"
  170. # Setting the font size.
  171. DAMAGE_FONT_SIZE = 20
  172. # Enable bold font.
  173. DAMAGE_FONT_BOLD = true
  174. # Enable italic font.
  175. DAMAGE_FONT_ITALIC = true
  176. #Enable Zoom in damage when critical damage.
  177. DAMAGE_CRITICAL_ZOOM = true
  178. #Display the amount of experience and money.
  179. DAMAGE_EXP_GOLD_POP = false
  180. #Enables Item Drops
  181. XAS_ITEMDROP = true
  182. # Display the name of the condition (States).
  183. DAMAGE_STATE_POP = false
  184. #Display the name of the item to get on the battlefield.
  185. DAMAGE_ITEM_POP = false
  186. # Setting the default font color.
  187. DAMAGE_DEFAULT_FONT_COLOR = Color.new(255, 255, 255)
  188. # Setting the color of the background.
  189. DAMAGE_EXP_FONT_COLOR = Color.new(0, 255, 100)
  190. # Setting the Color of Money (Gold).
  191. DAMAGE_GOLD_FONT_COLOR = Color.new(255, 255, 50)
  192. # Setting the color of the item.
  193. DAMAGE_ITEM_FONT_COLOR = Color.new(55, 55, 250)
  194. end
  195.  
  196. #===============================================================================
  197. # ■ SOUND SETTING
  198. #===============================================================================
  199. # Setting the system sounds XAS.
  200. #-------------------------------------------------------------------------------
  201. module XAS_SOUND
  202. #Sound runs to pick up the item.
  203. ITEM_DROP = "Key"
  204. #Sound level up to the run
  205. LEVEL_UP = "Chime1"
  206. #Sound played when no item or mp enough.
  207. ACTION_COST = "Cursor1"
  208. end
  209.  
  210. #===============================================================================
  211. # ■ ANIMATION SETTING
  212. #===============================================================================
  213. # System definition animations XAS.
  214. # If you do not want to use the animations, sets the value to 0 (Zero).
  215. #-------------------------------------------------------------------------------
  216. module XAS_ANIMATION
  217. # Animation when the defense system is activated.
  218. GUARD_ANIMATION_ID = 185
  219. #Animation when the leader is replaced.
  220. CHANGE_LEADER_ANIMATION_ID = 135
  221. # Animation when the battler hit the target condition invincible.
  222. INVINCIBLE_ANIMATION_ID = 185 #110
  223. #Animation when the battler using the system charge weapon.
  224. CHARGE_ANIMATION1_ID = 155
  225. # Animation of the battler after the gun is loaded.
  226. CHARGE_ANIMATION2_ID = 123
  227. # Animation displayed when loading the skills.
  228. CAST_TIME_ANIMATION_ID = 120
  229. # Speed ​​of the animations loop.
  230. LOOP_ANIMATIONS_SPEED = 60
  231. # Animation to reflect
  232. REFLECT_ANIMATION_ID = 128
  233. end
  234.  
  235. #===============================================================================
  236. # ■ GENERAL BATTLER SETTING
  237. #===============================================================================
  238. # General definition of the battle system of the XAS.
  239. #-------------------------------------------------------------------------------
  240. module XAS_BA
  241. #Time to turn power button change leader.
  242. CHANGE_LEADER_WAIT_TIME = 10
  243. #Leave a hud visible when starting the game.
  244. #You can enable or disable the hud using the code below
  245. # $game_system.hud_visible = true
  246. HUD_VISIBLE_AT_STARTUP = false
  247. # Setting the Switch page shares short.
  248. SENSOR_SELF_SWITCH = "D"
  249. # Definition of the variable that defines the area to activate the default page
  250. # actions short.
  251. DEFAULT_SENSOR_RANGE_VARIABLE_ID = 4
  252. # Time standard fallback (lockout) the battler.
  253. DEFAULT_KNOCK_BACK_DURATION = 30
  254. # Enable sprite shaking when the battler is in retreat.
  255. KNOCKBACKING_SHAKE = false
  256. # Basic speed movement
  257. BASE_MOVE_SPEED = 4.2
  258. # Extra speed when the battler is running.
  259. DASH_MOVE_SPEED = 0.6
  260. # Return the position of 4 directions after position diagonally.
  261. DIAGONAL_DURATION_ENABLE = false
  262. #Time to return the position of 4 directions.
  263. DIAGONAL_DURATION = 0
  264. #Definition of how the experience is divided between allies.
  265. # 0 - EXP only for who killed the enemy.
  266. # 1 - EXP is distributed to the group, the full value of exp.
  267. # 2 - EXP is divided by the number of the group and distributed to all.
  268. EXP_TYPE = 0
  269. # Setting the time to remove the treasure map.
  270. TREASURE_ERASE_TIME = 5 #used to be 5
  271. # Enable animation fade in treasure.
  272. FADE_TREASURE_SPRITE = true
  273. # Enable animation levitation in treasure.
  274. FLOAT_TREASURE_SPRITE = true
  275. # Secure the balloon position independent from the actual height of the sprite.
  276. FIX_BALLOON_POSITION = true
  277. # When the balloon is fixed.
  278. BALLOON_HEIGHT = 64
  279. end
  280.  
  281. #===============================================================================
  282. # ■ ENEMY SETTING
  283. #===============================================================================
  284.  
  285. module XAS_BA_ENEMY
  286. ENEMY_OBJECT = "E Object"
  287. ENEMY_ITEM = "E Item"
  288. # Definition of what skills the enemy will be invulnerablel.
  289. #
  290. # INVUNERABLE_ACTIONS = { A=>[B,B,B,B], A=>[B,B,B,B], ...}
  291. # A - ID the enemy.
  292. # B - ID the ability.
  293. #68 is to disable the Monsterball from oneshotting things!
  294. INVUNERABLE_ACTIONS = {
  295. 1=>[68],
  296. 2=>[68],
  297. 3=>[68],
  298. 4=>[68],
  299. 5=>[68],
  300. 6=>[68],
  301. 7=>[68],
  302. 8=>[68],
  303. 9=>[68],
  304. 10=>[68],
  305. 11=>[68],
  306. #12 can be killed with Quencher only (and southern boomerang)
  307. 12=>[1,2,3,4,5,6,7,11,12,13,14,15,16,17,18,19,20,21,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,70,71,72,73,74,75,76,77,78,79,80,81,82,82,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,107,108,109,110,111,112],
  308. 13=>[68],
  309. 14=>[68],
  310. 15=>[68],
  311. 16=>[68],
  312. 17=>[68],
  313. 18=>[68],
  314. #19 can be captured/killed with Pokéball only
  315. 19=>[1,2,3,4,5,6,7,11,12,13,14,15,16,17,18,19,20,21,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,69,70,71,72,73,74,75,76,77,78,79,80,81,82,82,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112],
  316. 20=>[68],
  317. #21 can be captured/killed with Pokéball only
  318. 21=>[1,2,3,4,5,6,7,11,12,13,14,15,16,17,18,19,20,21,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,69,70,71,72,73,74,75,76,77,78,79,80,81,82,82,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112],
  319. 22=>[68],
  320. 23=>[68],
  321. 24=>[68],
  322. 25=>[68],
  323. 26=>[68],
  324. 27=>[68],
  325. 28=>[68],
  326. 29=>[68],
  327. 30=>[68],
  328. 31=>[68],
  329. 32=>[68],
  330. 33=>[68],
  331. 34=>[68],
  332. 35=>[68],
  333. #36 can be killed with Quencher only (and southern boomerang)
  334. 36=>[1,2,3,4,5,6,7,11,12,13,14,15,16,17,18,19,20,21,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,70,71,72,73,74,75,76,77,78,79,80,81,82,82,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,107,108,109,110,111,112],
  335. 37=>[68],
  336. 38=>[68],
  337. 39=>[68],
  338. 40=>[68],
  339. 41=>[68],
  340. 42=>[68],
  341. 43=>[68],
  342. 44=>[68],
  343. 45=>[68],
  344. 46=>[68],
  345. 47=>[68],
  346. 48=>[68],
  347. 49=>[68],
  348. 50=>[68],
  349. 51=>[68],
  350. 52=>[68],
  351. 53=>[68],
  352. 54=>[68],
  353. 55=>[68],
  354. 56=>[68],
  355. 57=>[68],
  356. 58=>[68],
  357. 59=>[68],
  358. 60=>[68],
  359. 51=>[68],
  360. 52=>[68],
  361. 53=>[68],
  362. 54=>[68],
  363. 55=>[68],
  364. 56=>[68],
  365. 57=>[68],
  366. 58=>[68],
  367. 59=>[68],
  368. 60=>[68],
  369. 51=>[68],
  370. 52=>[68],
  371. 53=>[68],
  372. 64=>[1,2,3,4,5,6,7,11,12,13,14,15,16,17,18,19,20,21,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,70,71,72,73,74,75,76,77,78,79,80,81,82,82,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,107,108,109,110,111,112],
  373. 65=>[68],
  374. 66=>[68],
  375. 67=>[68],
  376. 68=>[68],
  377. 69=>[68],
  378. 70=>[68],
  379. 71=>[68],
  380. 72=>[68],
  381. 73=>[68],
  382. }
  383.  
  384. # Definition of the directions that the enemy will be invulnerable.
  385. # GUARD_DIRECTIONS = { A=>[B], A=>[B,B,B,B], ...}
  386. # A - ID the enemy
  387. # B - Directions of Invulnerability.
  388. # -> 2 = below. -> 4 = left.
  389. # -> 6 = right. -> 8 = above.
  390. GUARD_DIRECTIONS = {
  391. }
  392. # Definition of skills Counter Attack
  393. #
  394. # COUNTER_ATTACK = { A=>[B,B,B,B], A=>[B,B,B,B], ...}
  395. COUNTER_ATTACK = {
  396. }
  397.  
  398. end
  399.  
  400.  
  401. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  402. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  403. #■ INITIALIZE
  404. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  405. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  406.  
  407.  
  408. #===============================================================================
  409. # ■ Game_Temp
  410. #===============================================================================
  411. class Game_Temp
  412. attr_accessor :change_leader_wait_time
  413. attr_accessor :reset_battler_time
  414. attr_accessor :tool_event
  415. attr_accessor :animation_garbage
  416.  
  417. #--------------------------------------------------------------------------
  418. # ● Initialize
  419. #--------------------------------------------------------------------------
  420. alias xas_initialize initialize
  421. def initialize
  422. @change_leader_wait_time = 0
  423. @reset_battler_time = 0
  424. @tool_event = nil
  425. @animation_garbage = []
  426. xas_initialize
  427. end
  428.  
  429. end
  430.  
  431. #===============================================================================
  432. # ■ Game_System
  433. #===============================================================================
  434. class Game_System
  435. attr_accessor :tools_on_map
  436. attr_accessor :old_interpreter_running
  437. attr_accessor :hud_visible
  438. attr_accessor :enable_hud
  439. attr_accessor :command_enable
  440. attr_accessor :pre_leader_id
  441. attr_accessor :xas_battle
  442. #--------------------------------------------------------------------------
  443. # ● Initialize
  444. #--------------------------------------------------------------------------
  445. alias x_initialize initialize
  446. def initialize
  447. @tools_on_map = []
  448. @old_interpreter_running = false
  449. @hud_visible = XAS_BA::HUD_VISIBLE_AT_STARTUP
  450. @enable_hud = false
  451. @command_enable = true
  452. @pre_leader_id = 0
  453. @xas_battle = XAS_SYSTEM::BATTLE_SYSTEM
  454. x_initialize
  455. end
  456. end
  457.  
  458. #===============================================================================
  459. # ■ Game_Battler
  460. #===============================================================================
  461. class Game_Battler
  462. attr_accessor :e_object #MirEditBlood
  463. attr_accessor :e_item #MirEditBlood
  464.  
  465.  
  466. attr_accessor :damage_pop
  467. attr_accessor :damage
  468. attr_accessor :damage_type
  469. attr_accessor :critical
  470. attr_accessor :invunerable_duration
  471. attr_accessor :shield
  472. attr_accessor :invunerable_actions
  473. attr_accessor :guard_directions
  474. attr_accessor :guard
  475. attr_accessor :invunerable
  476. attr_accessor :x_combo
  477. attr_accessor :cast_action
  478. attr_accessor :defeated
  479. attr_accessor :death_zoom_effect
  480. attr_accessor :counter_action
  481. attr_accessor :knockback_duration
  482. attr_accessor :hp_damage
  483. attr_accessor :mp_damage
  484.  
  485. #--------------------------------------------------------------------------
  486. # ● Initialize
  487. #--------------------------------------------------------------------------
  488. alias x_initialize initialize
  489. def initialize
  490. @e_object = false #MirEditBlood
  491. @e_item = false #MirEditBlood
  492.  
  493. @damage = 0
  494. @damage_pop = false
  495. @damage_type = 0
  496. @critical = false
  497. @invunerable_duration = 0
  498. @shield = false
  499. @invunerable_actions = []
  500. @guard_directions = []
  501. @guard = true
  502. @invunerable = false
  503. @x_combo = [0,-1,0]
  504. @defeated = false
  505. @death_zoom_effect = 0
  506. @cast_action = [0,0,0,0,0]
  507. @counter_action = [0,0,true]
  508. @knockback_duration = XAS_BA::DEFAULT_KNOCK_BACK_DURATION
  509. x_initialize
  510. end
  511.  
  512. #--------------------------------------------------------------------------
  513. # ● Add Invunerable Actions
  514. #--------------------------------------------------------------------------
  515. def add_inv(action_id = 0)
  516. return if action_id == nil or action_id <= 0
  517. return if @invunerable_actions.include?(action_id)
  518. @invunerable_actions.push(action_id)
  519. end
  520.  
  521. #--------------------------------------------------------------------------
  522. # ● Remove Invunerable Actions
  523. #--------------------------------------------------------------------------
  524. def remove_inv(action_id = 0)
  525. return if action_id == nil or action_id <= 0
  526. return unless @invunerable_actions.include?(action_id)
  527. @invunerable_actions.delete(action_id)
  528. end
  529.  
  530. #--------------------------------------------------------------------------
  531. # ● Add Guard Directions
  532. #--------------------------------------------------------------------------
  533. def add_guard_dir(direction = 0)
  534. return if direction == nil or direction <= 0
  535. return if @guard_directions.include?(direction)
  536. @guard_directions.push(direction)
  537. end
  538.  
  539. #--------------------------------------------------------------------------
  540. # ● Remove Guard Directions
  541. #--------------------------------------------------------------------------
  542. def remove_guard_dir(direction = 0)
  543. return if direction == nil or direction <= 0
  544. return unless @guard_directions.include?(direction)
  545. @guard_directions.delete(direction)
  546. end
  547.  
  548. end
  549.  
  550. #===============================================================================
  551. # ■ Game Actor
  552. #===============================================================================
  553. class Game_Actor < Game_Battler
  554.  
  555. attr_accessor :x_action1_id
  556. attr_accessor :x_action2_id
  557. attr_accessor :skill_id
  558. attr_accessor :x_item_id
  559. attr_accessor :x_charge_action
  560. attr_accessor :old_equipment_id
  561. attr_accessor :item_id
  562. attr_accessor :old_level
  563. attr_reader :actor_id
  564.  
  565. #--------------------------------------------------------------------------
  566. # ● Setup
  567. #--------------------------------------------------------------------------
  568. alias x_setup setup
  569. def setup(actor_id)
  570. @x_action1_id = 0
  571. @x_action2_id = 0
  572. @skill_id = 0
  573. @x_item_id = 0
  574. @item_id = 0
  575. @x_charge_action = [0,0,0,0]
  576. @old_level = @level
  577. @old_equipment_id = [0,0,0,0,0]
  578. x_setup(actor_id)
  579. end
  580.  
  581. #--------------------------------------------------------------------------
  582. # ● Display Level Up
  583. #--------------------------------------------------------------------------
  584. alias x_display_level_up display_level_up
  585. def display_level_up(new_skills)
  586. return unless $game_party.in_battle
  587. x_display_level_up(new_skills)
  588. end
  589.  
  590. end
  591.  
  592. #===============================================================================
  593. # ■ Character
  594. #===============================================================================
  595. class Game_Character < Game_CharacterBase
  596.  
  597. attr_accessor :tool_id
  598. attr_accessor :tool_effect
  599. attr_accessor :target
  600. attr_accessor :target2
  601. attr_accessor :old_x
  602. attr_accessor :old_y
  603. attr_accessor :pre_x
  604. attr_accessor :pre_y
  605. attr_accessor :temp_id
  606. attr_accessor :angle
  607. attr_accessor :force_action_times
  608. attr_accessor :force_action
  609. attr_accessor :move_frequency
  610. attr_accessor :move_speed
  611. attr_accessor :direction_fix
  612. attr_accessor :walk_anime
  613. attr_accessor :step_anime
  614. attr_accessor :x
  615. attr_accessor :y
  616. attr_accessor :pattern
  617. attr_accessor :pattern_count
  618. attr_accessor :jump_count
  619. attr_accessor :jump_peak
  620. attr_accessor :dash_active
  621. attr_accessor :direction
  622. attr_accessor :through
  623. attr_accessor :bush_depth
  624. attr_accessor :blend_type
  625. attr_accessor :priority_type
  626. attr_accessor :jump_count
  627. attr_accessor :zoom_x
  628. attr_accessor :zoom_y
  629. attr_accessor :stop
  630. attr_accessor :force_update
  631. attr_accessor :treasure_time
  632. attr_accessor :treasure_float
  633. attr_accessor :can_update
  634. attr_accessor :pre_move_speed
  635. attr_accessor :knock_back_duration
  636. attr_accessor :orig_pos_x
  637. attr_accessor :orig_pos_y
  638. attr_accessor :shoot_time
  639. #--------------------------------------------------------------------------
  640. # ● Initialize
  641. #--------------------------------------------------------------------------
  642. alias x_initialize initialize
  643. def initialize
  644. x_initialize
  645. @tool_id = 0
  646. @tool_effect = ""
  647. @target = false
  648. @target2 = nil
  649. @old_x = @x
  650. @old_y = @y
  651. @pre_x = @x
  652. @pre_y = @y
  653. @orig_pos_x = @x
  654. @orig_pos_y = @y
  655. @angle = 0
  656. @force_action_times = 0
  657. @force_action = ""
  658. @dash_active = false
  659. @zoom_x = 1.00
  660. @zoom_y = 1.00
  661. @stop = false
  662. @force_update = false
  663. @treasure_time = 0
  664. @treasure_float = [0,0,0,0]
  665. @can_update = true
  666. @temp_id = 0
  667. @pre_move_speed = @move_speed
  668. @shoot_time = [0,0]
  669. end
  670.  
  671. #--------------------------------------------------------------------------
  672. # ● Invunerable
  673. #--------------------------------------------------------------------------
  674. def invunerable(enable = false)
  675. return if @battler == nil or @battler.dead?
  676. @battler.invunerable = enable
  677. end
  678.  
  679. #--------------------------------------------------------------------------
  680. # ● Fast Breath
  681. #--------------------------------------------------------------------------
  682. def fast_breath(enable = true)
  683. return if @battler == nil or @battler.dead?
  684. @battler.fast_breath_effect = enable
  685. end
  686. end
  687.  
  688. #===============================================================================
  689. # ■ Game_Event
  690. #===============================================================================
  691. class Game_Event < Game_Character
  692. attr_accessor :target
  693. attr_reader :name
  694. attr_accessor :collision_attack
  695.  
  696. #--------------------------------------------------------------------------
  697. # ● Object
  698. #--------------------------------------------------------------------------
  699. alias x_event_initialize initialize
  700. def initialize(map_id, event)
  701. x_event_initialize(map_id, event)
  702. @collision_attack = false
  703. if @event.name =~ /<O(\d+)>/i
  704. @opacity = $1.to_i
  705. end
  706. if @event.name =~ /<B(\d+)>/i
  707. @blend_type = $1.to_i
  708. end
  709. end
  710.  
  711. #--------------------------------------------------------------------------
  712. # ● Erase
  713. #--------------------------------------------------------------------------
  714. alias x_event_erase erase
  715. def erase
  716. if self.tool_id > 0
  717. $game_system.tools_on_map.delete(self.tool_id)
  718. end
  719. x_event_erase
  720. end
  721.  
  722. #--------------------------------------------------------------------------
  723. # ● Event Name
  724. #--------------------------------------------------------------------------
  725. def name
  726. return @event.name
  727. end
  728.  
  729. end
  730.  
  731. #===============================================================================
  732. # ■ Game Followers
  733. #===============================================================================
  734. class Game_Followers
  735.  
  736. #--------------------------------------------------------------------------
  737. # ● Initialize
  738. #--------------------------------------------------------------------------
  739. alias x_party_initialize initialize
  740. def initialize(leader)
  741. x_party_initialize(leader)
  742. if $xas_party_system == nil
  743. @visible = false
  744. end
  745. end
  746. end
  747.  
  748. #===============================================================================
  749. # ■ Game Map
  750. #===============================================================================
  751. class Game_Map
  752.  
  753. #--------------------------------------------------------------------------
  754. # ● Setup
  755. #--------------------------------------------------------------------------
  756. alias x_initial_setup setup
  757. def setup(map_id)
  758. x_initial_setup(map_id)
  759. xas_initial_setup(map_id)
  760. end
  761.  
  762. #--------------------------------------------------------------------------
  763. # ● XAS Initial Setup
  764. #--------------------------------------------------------------------------
  765. def xas_initial_setup(map_id)
  766. for actor in $game_party.members
  767. setup_initial_members(actor)
  768. end
  769. end
  770.  
  771. #--------------------------------------------------------------------------
  772. # ● Setup Initial Membes
  773. #--------------------------------------------------------------------------
  774. def setup_initial_members(actor)
  775.  
  776. end
  777. end
  778.  
  779.  
  780. #==============================================================================
  781. # ■ Scene_Map
  782. #==============================================================================
  783. class Scene_Map < Scene_Base
  784.  
  785. #--------------------------------------------------------------------------
  786. # ● Call Menu
  787. #--------------------------------------------------------------------------
  788. alias x_call_menu call_menu
  789. def call_menu
  790. return if $game_player.action != nil
  791. $game_player.reset_charge_temp
  792. x_call_menu
  793. end
  794.  
  795. end
  796. #===============================================================================
  797. # ■ Scene_Refresh
  798. #===============================================================================
  799. class Scene_Refresh
  800.  
  801. #--------------------------------------------------------------------------
  802. # ● Main
  803. #--------------------------------------------------------------------------
  804. def main
  805. SceneManager.call(Scene_Map)
  806. end
  807. end
  808.  
  809. #==============================================================================
  810. # ■ Game_Player
  811. #==============================================================================
  812. class Game_Player < Game_Character
  813.  
  814. #--------------------------------------------------------------------------
  815. # ● Leader Changed
  816. #--------------------------------------------------------------------------
  817. def leader_changed?(actor)
  818. if $game_party.members[0] == nil
  819. return true if actor != nil
  820. elsif $game_party.members[0] != nil
  821. return true if actor == nil
  822. return true if actor.actor_id != $game_party.members[0].actor_id
  823. end
  824. return false
  825. end
  826.  
  827. end
  828. $xas = true
  829.  
  830.  
  831. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  832. #■ MOVEMENT - DIAGONAL MOVEMENT
  833. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  834.  
  835.  
  836. #===============================================================================
  837. # ■ Game Character
  838. #===============================================================================
  839. class Game_CharacterBase
  840.  
  841. #--------------------------------------------------------------------------
  842. # ● Set Direction
  843. #--------------------------------------------------------------------------
  844. alias diagonal_set_direction set_direction
  845. def set_direction(d)
  846. diagonal_set_direction(d)
  847. @diagonal_direction = 0
  848. reset_diagonal
  849. end
  850. end
  851.  
  852. #===============================================================================
  853. # ■ Game Character
  854. #===============================================================================
  855. class Game_Character < Game_CharacterBase
  856.  
  857. attr_accessor :diagonal
  858. attr_accessor :diagonal_direction
  859. attr_accessor :sprite_angle_enable
  860. attr_accessor :diagonal_time
  861.  
  862. #--------------------------------------------------------------------------
  863. # ● Initialize
  864. #--------------------------------------------------------------------------
  865. alias diagonal_initialize initialize
  866. def initialize
  867. diagonal_initialize
  868. if XAS_SYSTEM::EVENT_DIAGONAL_MOVEMENT
  869. @diagonal = true
  870. else
  871. @diagonal = false
  872. end
  873. @diagonal_direction = 0
  874. @sprite_angle_enable = false
  875. @diagonal_time = 0
  876. end
  877.  
  878. #--------------------------------------------------------------------------
  879. # ● Reset Diagonal
  880. #--------------------------------------------------------------------------
  881. def reset_diagonal
  882. return if @direction_fix
  883. return if @diagonal == false
  884. @diagonal_direction = 0
  885. @diagonal_time = 0
  886. @angle = 0 if @sprite_angle_enable
  887. end
  888.  
  889. #--------------------------------------------------------------------------
  890. # ● Enable Diagonal
  891. #--------------------------------------------------------------------------
  892. def enable_diagonal(dir = 0)
  893. return if @direction_fix
  894. return if @diagonal == false
  895. return if dir == 0
  896. @diagonal_direction = dir
  897. @diagonal_time = XAS_BA::DIAGONAL_DURATION
  898. @angle = 315 if @sprite_angle_enable
  899. end
  900.  
  901. #--------------------------------------------------------------------------
  902. # ● Turn Upper Right
  903. #--------------------------------------------------------------------------
  904. def turn_upper_right
  905. enable_diagonal(9)
  906. @direction = 8 unless @direction_fix
  907. end
  908.  
  909. #--------------------------------------------------------------------------
  910. # ● Turn Upper Left
  911. #--------------------------------------------------------------------------
  912. def turn_upper_left
  913. enable_diagonal(7)
  914. @direction = 4 unless @direction_fix
  915. end
  916.  
  917. #--------------------------------------------------------------------------
  918. # ● Turn Lower Right
  919. #--------------------------------------------------------------------------
  920. def turn_lower_right
  921. enable_diagonal(3)
  922. @direction = 6 unless @direction_fix
  923. end
  924.  
  925. #--------------------------------------------------------------------------
  926. # ● Turn Lower Left
  927. #--------------------------------------------------------------------------
  928. def turn_lower_left
  929. enable_diagonal(1)
  930. @direction = 2 unless @direction_fix
  931. end
  932.  
  933. #--------------------------------------------------------------------------
  934. # ● Move forward
  935. #--------------------------------------------------------------------------
  936. alias diagonal_move_forward move_forward
  937. def move_forward
  938. return if move_forward_diagonal?
  939. diagonal_move_forward
  940. end
  941.  
  942. #--------------------------------------------------------------------------
  943. # ● Move forward Diagonal?
  944. #--------------------------------------------------------------------------
  945. def move_forward_diagonal?
  946. return false if @diagonal == false
  947. if @diagonal_direction != 0
  948. case @diagonal_direction
  949. when 1 #Lower Left
  950. move_diagonal(4, 2)
  951. @direction = 2
  952. when 3 #Lower Right
  953. move_diagonal(6, 2)
  954. @direction = 6
  955. when 7 #Upper Left
  956. move_diagonal(4, 8)
  957. @direction = 4
  958. when 9 #Upper Right
  959. move_diagonal(6, 8)
  960. @direction = 8
  961. end
  962. enable_diagonal(@diagonal_direction)
  963. return true
  964. end
  965. return false
  966. end
  967.  
  968. #--------------------------------------------------------------------------
  969. # ● Move Backward
  970. #--------------------------------------------------------------------------
  971. alias diagonal_move_backward move_backward
  972. def move_backward
  973. return if move_backward_diagonal?
  974. diagonal_move_backward
  975. end
  976.  
  977. #--------------------------------------------------------------------------
  978. # ● Move Backward Diagonal?
  979. #--------------------------------------------------------------------------
  980. def move_backward_diagonal?
  981. return false if @diagonal == false
  982. if @diagonal_direction != 0
  983. last_direction_fix = @direction_fix
  984. @direction_fix = true
  985. case @diagonal_direction
  986. when 1
  987. move_diagonal(6, 8)
  988. @direction = 6
  989. when 3
  990. move_diagonal(4, 8)
  991. @direction = 4
  992. when 7
  993. move_diagonal(6, 2)
  994. @direction = 6
  995. when 9
  996. move_diagonal(4, 2)
  997. @direction = 2
  998. end
  999. enable_diagonal(@diagonal_direction)
  1000. @direction_fix = last_direction_fix
  1001. return true
  1002. end
  1003. return false
  1004. end
  1005.  
  1006. #--------------------------------------------------------------------------
  1007. # ● Turn Toward Player
  1008. #--------------------------------------------------------------------------
  1009. alias turn_toward_player_diagonal turn_toward_player
  1010. def turn_toward_player
  1011. if @diagonal
  1012. diagonal_turn_toward_player
  1013. return
  1014. end
  1015. turn_toward_player_diagonal
  1016. end
  1017.  
  1018. #--------------------------------------------------------------------------
  1019. # ● Diagonal Turn Toward Player
  1020. #--------------------------------------------------------------------------
  1021. def diagonal_turn_toward_player
  1022. sx = distance_x_from($game_player.x)
  1023. sy = distance_y_from($game_player.y)
  1024. sd = sx.abs - sy.abs
  1025. sdx = sd.abs - sx.abs
  1026. sdy = sd.abs - sy.abs
  1027. return if sx == 0 and sy == 0
  1028. #Turn Upper Right
  1029. if sx < 0 and sy > 0
  1030. if sx.abs > sy.abs and sdx.abs < sd.abs
  1031. set_direction(6)
  1032. elsif sx.abs < sy.abs and sdy.abs < sd.abs
  1033. set_direction(8)
  1034. else
  1035. turn_upper_right
  1036. end
  1037. enable_diagonal(9)
  1038. #Turn Upper Left
  1039. elsif sx > 0 and sy > 0
  1040. if sx.abs > sy.abs and sdx.abs < sd.abs
  1041. set_direction(4)
  1042. elsif sx.abs < sy.abs and sdy.abs < sd.abs
  1043. set_direction(8)
  1044. else
  1045. set_direction(4)
  1046. turn_upper_left
  1047. end
  1048. enable_diagonal(7)
  1049. #Turn Lower Left
  1050. elsif sx > 0 and sy < 0
  1051. if sx.abs > sy.abs and sdx.abs < sd.abs
  1052. set_direction(4)
  1053. elsif sx.abs < sy.abs and sdy.abs < sd.abs
  1054. set_direction(2)
  1055. else
  1056. turn_lower_left
  1057. end
  1058. enable_diagonal(1)
  1059. #Turn Lower Right
  1060. elsif sx < 0 and sy < 0
  1061. if sx.abs > sy.abs and sdx.abs < sd.abs
  1062. set_direction(6)
  1063. elsif sx.abs < sy.abs and sdy.abs < sd.abs
  1064. set_direction(2)
  1065. else
  1066. turn_lower_right
  1067. end
  1068. enable_diagonal(3)
  1069. elsif sx < 0
  1070. set_direction(6)
  1071. elsif sx > 0
  1072. set_direction(4)
  1073. elsif sy > 0
  1074. set_direction(8)
  1075. elsif sy < 0
  1076. set_direction(2)
  1077. end
  1078.  
  1079. end
  1080.  
  1081. #--------------------------------------------------------------------------
  1082. # ● Move toward Player
  1083. #--------------------------------------------------------------------------
  1084. alias move_toward_player_diagonal move_toward_player
  1085. def move_toward_player
  1086. if @diagonal
  1087. diagonal_move_toward_player
  1088. return
  1089. end
  1090. move_toward_player_diagonal
  1091. end
  1092.  
  1093. #--------------------------------------------------------------------------
  1094. # ● Diagonal Move Toward Player
  1095. #--------------------------------------------------------------------------
  1096. def diagonal_move_toward_player
  1097. sx = distance_x_from($game_player.x)
  1098. sy = distance_y_from($game_player.y)
  1099. if sx == 0 and sy == 0
  1100. return
  1101. end
  1102. abs_sx = sx.abs
  1103. abs_sy = sy.abs
  1104. if abs_sx == abs_sy
  1105. rand(2) == 0 ? abs_sx += 1 : abs_sy += 1
  1106. end
  1107. if abs_sx
  1108. if sx < 0 and sy > 0
  1109. move_diagonal(6, 8)
  1110. move_random unless moving?
  1111. enable_diagonal(9)
  1112. elsif sx > 0 and sy > 0
  1113. move_diagonal(4, 8)
  1114. move_random unless moving?
  1115. enable_diagonal(7)
  1116. elsif sx > 0 and sy < 0
  1117. move_diagonal(4, 2)
  1118. move_random unless moving?
  1119. enable_diagonal(1)
  1120. elsif sx < 0 and sy < 0
  1121. move_diagonal(6, 2)
  1122. move_random unless moving?
  1123. enable_diagonal(3)
  1124. elsif sx < 0
  1125. move_straight(6)
  1126. elsif sx > 0
  1127. move_straight(4)
  1128. elsif sy > 0
  1129. move_straight(8)
  1130. elsif sy < 0
  1131. move_straight(2)
  1132. end
  1133. if abs_sx != 1 and abs_sy != 1
  1134. move_random unless moving?
  1135. end
  1136. end
  1137. end
  1138.  
  1139. #--------------------------------------------------------------------------
  1140. # ● turn_right_45
  1141. #--------------------------------------------------------------------------
  1142. def turn_right_45
  1143. if @diagonal and @diagonal_direction != 0
  1144. case @diagonal_direction
  1145. when 1; set_direction(4)
  1146. when 3; set_direction(2)
  1147. when 7; set_direction(8)
  1148. when 9; set_direction(6)
  1149. end
  1150. else
  1151. case @direction
  1152. when 2; turn_lower_left
  1153. when 4; turn_upper_left
  1154. when 6; turn_lower_right
  1155. when 8; turn_upper_right
  1156. end
  1157. end
  1158. end
  1159.  
  1160. #--------------------------------------------------------------------------
  1161. # ● turn_left_45
  1162. #--------------------------------------------------------------------------
  1163. def turn_left_45
  1164. if @diagonal and @diagonal_direction != 0
  1165. case @diagonal_direction
  1166. when 1; set_direction(2)
  1167. when 3; set_direction(6)
  1168. when 7; set_direction(4)
  1169. when 9; set_direction(8)
  1170. end
  1171. else
  1172. case @direction
  1173. when 2; turn_lower_right
  1174. when 4; turn_lower_left
  1175. when 6; turn_upper_right
  1176. when 8; turn_upper_left
  1177. end
  1178. end
  1179. end
  1180.  
  1181. #--------------------------------------------------------------------------
  1182. # ● turn_right_90
  1183. #--------------------------------------------------------------------------
  1184. alias diagonal_turn_right_90 turn_right_90
  1185. def turn_right_90
  1186. if @diagonal and @diagonal_direction != 0
  1187. turn_diagonal_right_90
  1188. return
  1189. end
  1190. diagonal_turn_right_90
  1191. end
  1192.  
  1193. #--------------------------------------------------------------------------
  1194. # ● turn_diagonal_right_90
  1195. #--------------------------------------------------------------------------
  1196. def turn_diagonal_right_90
  1197. case @diagonal_direction
  1198. when 1; turn_upper_left
  1199. when 3; turn_lower_left
  1200. when 7; turn_upper_right
  1201. when 9; turn_lower_right
  1202. end
  1203. end
  1204.  
  1205. #--------------------------------------------------------------------------
  1206. # ● turn_left_90
  1207. #--------------------------------------------------------------------------
  1208. alias diagonal_turn_left_90 turn_left_90
  1209. def turn_left_90
  1210. if @diagonal and @diagonal_direction != 0
  1211. turn_diagonal_left_90
  1212. return
  1213. end
  1214. diagonal_turn_left_90
  1215. end
  1216.  
  1217. #--------------------------------------------------------------------------
  1218. # ● turn_diagonal_left_90
  1219. #--------------------------------------------------------------------------
  1220. def turn_diagonal_left_90
  1221. case @diagonal_direction
  1222. when 1; turn_lower_right
  1223. when 3; turn_upper_right
  1224. when 7; turn_lower_left
  1225. when 9; turn_upper_left
  1226. end
  1227. end
  1228.  
  1229. #--------------------------------------------------------------------------
  1230. # ● diagonal_turn_180
  1231. #--------------------------------------------------------------------------
  1232. alias diagonal_turn_180 turn_180
  1233. def turn_180
  1234. if @diagonal and @diagonal_direction != 0
  1235. turn_diagonal_180
  1236. return
  1237. end
  1238. diagonal_turn_180
  1239. end
  1240.  
  1241. #--------------------------------------------------------------------------
  1242. # ● turn_diagonal_180
  1243. #--------------------------------------------------------------------------
  1244. def turn_diagonal_180
  1245. case @diagonal_direction
  1246. when 1; turn_upper_right
  1247. when 3; turn_upper_left
  1248. when 7; turn_lower_right
  1249. when 9; turn_lower_left
  1250. end
  1251. end
  1252.  
  1253. #--------------------------------------------------------------------------
  1254. # ● turn_random
  1255. #--------------------------------------------------------------------------
  1256. alias diagonal_turn_random turn_random
  1257. def turn_random
  1258. if @diagonal
  1259. turn_diagonal_random
  1260. return
  1261. end
  1262. diagonal_turn_random
  1263. end
  1264.  
  1265. #--------------------------------------------------------------------------
  1266. # ● turn_diagonal_random
  1267. #--------------------------------------------------------------------------
  1268. def turn_diagonal_random
  1269. case rand(8)
  1270. when 0; set_direction(8)
  1271. when 1; set_direction(6)
  1272. when 2; set_direction(4)
  1273. when 3; set_direction(2)
  1274. when 4; turn_lower_left
  1275. when 5; turn_lower_right
  1276. when 6; turn_upper_left
  1277. when 7; turn_upper_right
  1278. end
  1279. end
  1280.  
  1281. end
  1282.  
  1283. #===============================================================================
  1284. # ■ Game_Player
  1285. #===============================================================================
  1286. class Game_Player < Game_Character
  1287.  
  1288. #--------------------------------------------------------------------------
  1289. # ● Move By Input
  1290. #--------------------------------------------------------------------------
  1291. alias diagonal_move_by_input move_by_input
  1292. def move_by_input
  1293. if XAS_SYSTEM::PLAYER_DIAGONAL_MOVEMENT
  1294. player_diagonal_move_by_input
  1295. update_sprite_diagonal
  1296. update_return_direction
  1297. return
  1298. end
  1299. diagonal_move_by_input
  1300. end
  1301.  
  1302. #--------------------------------------------------------------------------
  1303. # ● Update Sprite Diagonal
  1304. #--------------------------------------------------------------------------
  1305. def update_sprite_diagonal
  1306. return if @diagonal_direction == 0
  1307. return if self.action != nil
  1308. return if @dash_active
  1309. #make_pose("_Diagonal", 2) #Disabled Miredit
  1310. end
  1311.  
  1312. #--------------------------------------------------------------------------
  1313. # ● Update Return Direction
  1314. #--------------------------------------------------------------------------
  1315. def update_return_direction
  1316. return if XAS_BA::DIAGONAL_DURATION_ENABLE == false
  1317. return if @diagonal_time == 0
  1318. return if moving? or @stop
  1319. @diagonal_time -= 1
  1320. @diagonal_direction = 0 if @diagonal_time == 0
  1321. end
  1322.  
  1323. #--------------------------------------------------------------------------
  1324. # ● Player Diagonal Move By Input
  1325. #--------------------------------------------------------------------------
  1326. def player_diagonal_move_by_input
  1327. return unless movable?
  1328. return if $game_map.interpreter.running?
  1329. case Input.dir8
  1330. when 1
  1331. move_diagonal(4, 2)
  1332. unless moving?
  1333. move_straight(4)
  1334. move_straight(2)
  1335. end
  1336. @diagonal_direction = 1
  1337. when 2; move_straight(2)
  1338. when 3
  1339. move_diagonal(6, 2)
  1340. unless moving?
  1341. move_straight(6)
  1342. move_straight(2)
  1343. end
  1344. @diagonal_direction = 3
  1345. when 4; move_straight(4)
  1346. when 6; move_straight(6)
  1347. when 7
  1348. move_diagonal(4, 8)
  1349. unless moving?
  1350. move_straight(4)
  1351. move_straight(8)
  1352. end
  1353. @diagonal_direction = 7
  1354. when 8; move_straight(8)
  1355. when 9
  1356. move_diagonal(6, 8)
  1357. unless moving?
  1358. move_straight(6)
  1359. move_straight(8)
  1360. end
  1361. @diagonal_direction = 9
  1362. end
  1363. end
  1364.  
  1365. end
  1366.  
  1367.  
  1368. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  1369. #■ MOVEMENT - FORCE ACTION
  1370. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  1371.  
  1372.  
  1373. #===============================================================================
  1374. # ■ Game Character
  1375. #===============================================================================
  1376. class Game_Character < Game_CharacterBase
  1377.  
  1378. #--------------------------------------------------------------------------
  1379. # ● moving 2?
  1380. #--------------------------------------------------------------------------
  1381. def moving2?
  1382. @real_x != @x || @real_y != @y
  1383. end
  1384.  
  1385. #--------------------------------------------------------------------------
  1386. # ● Can Force Action?
  1387. #--------------------------------------------------------------------------
  1388. def can_force_action?
  1389. return false if @force_action_times == 0
  1390. return false if self.moving2?
  1391. return false if self.jumping?
  1392. return false if self.knockbacking?
  1393. return false if self.stop
  1394. return true
  1395. end
  1396.  
  1397. #--------------------------------------------------------------------------
  1398. # ● Update Force Action
  1399. #--------------------------------------------------------------------------
  1400. def update_force_action
  1401. @force_action_times -= 1
  1402. execute_force_action
  1403. execute_force_action_tool_effect if @tool_id > 0 and @tool_effect != ""
  1404. reset_auto_action if @force_action_times == 0
  1405. end
  1406.  
  1407. #--------------------------------------------------------------------------
  1408. # ● Execute Force Action
  1409. #--------------------------------------------------------------------------
  1410. def execute_force_action
  1411. case @force_action
  1412. when "Forward"
  1413. move_forward
  1414. when "Backward"
  1415. move_backward
  1416. when "Toward Player"
  1417. move_toward_player
  1418. when "Move Left"
  1419. move_straight(4)
  1420. when "Move Right"
  1421. move_straight(6)
  1422. when "Move Up"
  1423. move_straight(8)
  1424. when "Move Down"
  1425. move_straight(2)
  1426. when "All Shoot"
  1427. if self.action != nil
  1428. turn_right_45
  1429. self.shoot(self.action.id) unless @force_action_times == 0
  1430. end
  1431. when "Four Shoot"
  1432. if self.action != nil
  1433. turn_right_90
  1434. self.shoot(self.action.id) unless @force_action_times == 0
  1435. end
  1436. when "Three Shoot"
  1437. if self.action != nil
  1438. case @force_action_times
  1439. when 2
  1440. turn_right_45
  1441. when 1
  1442. turn_left_90
  1443. when 0
  1444. turn_right_45
  1445. end
  1446. self.shoot(self.action.id) unless @force_action_times == 0
  1447. end
  1448. when "Two Shoot"
  1449. if self.action != nil
  1450. turn_180
  1451. self.shoot(self.action.id) unless @force_action_times == 0
  1452. end
  1453. end
  1454. end
  1455.  
  1456. #--------------------------------------------------------------------------
  1457. # ● Execute Force Action Tool Effect
  1458. #--------------------------------------------------------------------------
  1459. def execute_force_action_tool_effect
  1460. action_effect_during_move
  1461. action_effect_after_move if @force_action_times == 0
  1462. end
  1463.  
  1464. #--------------------------------------------------------------------------
  1465. # ● Auto Action Effect During Move
  1466. #--------------------------------------------------------------------------
  1467. def reset_auto_action
  1468. @force_action = ""
  1469. @force_action_times = 0
  1470. @anime_count = 0
  1471. end
  1472.  
  1473. #--------------------------------------------------------------------------
  1474. # ● Action Effect During Move
  1475. #--------------------------------------------------------------------------
  1476. def action_effect_during_move
  1477. if @tool_effect == "Boomerang" and @force_action == "Toward Player"
  1478. if @x == $game_player.x and @y == $game_player.y
  1479. self.action.duration = 15
  1480. @force_action_times = 0
  1481. @force_action_type = ""
  1482. end
  1483. end
  1484. end
  1485.  
  1486. #--------------------------------------------------------------------------
  1487. # ● Action Effect After Move
  1488. #--------------------------------------------------------------------------
  1489. def action_effect_after_move
  1490. if @tool_effect == "Boomerang"
  1491. @force_action_times = 30
  1492. @force_action = "Toward Player"
  1493. @move_frequency = 6
  1494. @move_speed = 5.5
  1495. end
  1496. end
  1497.  
  1498. end
  1499.  
  1500.  
  1501. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  1502. #■ MOVEMENT - EXTRA MOVEMENT
  1503. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  1504.  
  1505.  
  1506. #===============================================================================
  1507. # ■ Game Character
  1508. #===============================================================================
  1509. class Game_Character < Game_CharacterBase
  1510.  
  1511. #--------------------------------------------------------------------------
  1512. # ● Check XY
  1513. #--------------------------------------------------------------------------
  1514. def check_xy
  1515. @pre_x = @x
  1516. @pre_y = @y
  1517. end
  1518.  
  1519. #--------------------------------------------------------------------------
  1520. # ● Turn Reverse
  1521. #--------------------------------------------------------------------------
  1522. def turn_reverse(dir)
  1523. case dir
  1524. when 2; set_direction(8)
  1525. when 4; set_direction(6)
  1526. when 6; set_direction(4)
  1527. when 8; set_direction(2)
  1528. end
  1529. end
  1530.  
  1531. #--------------------------------------------------------------------------
  1532. # ● Org Here
  1533. #--------------------------------------------------------------------------
  1534. def org_here
  1535. @orig_pos_x = @x
  1536. @orig_pos_y = @y
  1537. end
  1538.  
  1539. #--------------------------------------------------------------------------
  1540. # ● return_org
  1541. #--------------------------------------------------------------------------
  1542. def return_org(type = 0)
  1543. if type == 1
  1544. moveto(@orig_pos_x,@orig_pos_x)
  1545. else
  1546. jump(0,0)
  1547. end
  1548. @x = @orig_pos_x
  1549. @y = @orig_pos_y
  1550. end
  1551.  
  1552. #--------------------------------------------------------------------------
  1553. # ● Dual Switch
  1554. #--------------------------------------------------------------------------
  1555. def dual_switch(switch_on, switch_off,percentage = 100)
  1556. enable_per = rand(100)
  1557. if enable_per <= percentage
  1558. $game_switches[switch_on] = true
  1559. $game_switches[switch_off] = false
  1560. $game_map.need_refresh = true
  1561. end
  1562. end
  1563.  
  1564. #--------------------------------------------------------------------------
  1565. # ● Move Forward 2
  1566. #--------------------------------------------------------------------------
  1567. def move_forward2
  1568. return if moving2?
  1569. move_forward
  1570. end
  1571.  
  1572. #--------------------------------------------------------------------------
  1573. # ● Bounce Direction
  1574. #--------------------------------------------------------------------------
  1575. def bounce_direction
  1576. @diagonal = true
  1577. turn_random
  1578. end
  1579.  
  1580. #--------------------------------------------------------------------------
  1581. # ● Turn_back
  1582. #--------------------------------------------------------------------------
  1583. def turn_back
  1584. if @diagonal_direction != 0
  1585. case @diagonal_direction
  1586. when 1
  1587. turn_upper_right
  1588. when 3
  1589. turn_upper_left
  1590. when 7
  1591. turn_lower_right
  1592. when 9
  1593. turn_lower_left
  1594. end
  1595. else
  1596. case @direction
  1597. when 8; set_direction(2) #Used to be 8
  1598. when 6; set_direction(4) #@direction = 6#move_straight(6)#Miredit
  1599. when 4; set_direction(6) #Used to be 4
  1600. when 2; set_direction(8) #Used to be 2
  1601. end
  1602. end
  1603. end
  1604.  
  1605. #--------------------------------------------------------------------------
  1606. # ● Jump_high
  1607. #--------------------------------------------------------------------------
  1608. def jump_high(x_plus,y_plus,high = 10)
  1609. @x += x_plus
  1610. @y += y_plus
  1611. distance = Math.sqrt(x_plus * x_plus + y_plus * y_plus).round
  1612. @jump_peak = high + distance - @move_speed
  1613. @jump_count = @jump_peak * 2
  1614. @stop_count = 0
  1615. straighten
  1616. end
  1617.  
  1618. #--------------------------------------------------------------------------
  1619. # ● Passable Temp
  1620. #--------------------------------------------------------------------------
  1621. def passable_temp_id?(x, y)
  1622. return false unless $game_map.valid?(x, y)
  1623. return true if @through or debug_through?
  1624. return false unless map_passable?(x, y,@direction)
  1625. return false if collide_with_characters_temp_id?(x, y)
  1626. return true
  1627. end
  1628.  
  1629. #--------------------------------------------------------------------------
  1630. # ● Collide With Characters
  1631. #--------------------------------------------------------------------------
  1632. def collide_with_characters_temp_id?(x, y)
  1633. for event in $game_map.events_xy(x, y)
  1634. unless event.through or event.battler != nil
  1635. return true if self.is_a?(Game_Event)
  1636. return true if event.priority_type >= 1
  1637. end
  1638. end
  1639. return false
  1640. end
  1641.  
  1642. #--------------------------------------------------------------------------
  1643. # ● Force Move Route
  1644. #--------------------------------------------------------------------------
  1645. alias x_force_move_route force_move_route
  1646. def force_move_route(move_route)
  1647. if self.battler != nil and self.is_a?(Game_Event)
  1648. return
  1649. end
  1650. x_force_move_route(move_route)
  1651. end
  1652. end
  1653.  
  1654.  
  1655. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  1656. #■ MOVEMENT - PLAYER COMMANDS
  1657. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  1658.  
  1659.  
  1660. #==============================================================================
  1661. # ■ Game_Player
  1662. #==============================================================================
  1663. class Game_Player < Game_Character
  1664. include XAS_BUTTON
  1665.  
  1666. #--------------------------------------------------------------------------
  1667. # ● Update Action Command
  1668. #--------------------------------------------------------------------------
  1669. def update_action_command
  1670. update_check_battler_equipment if can_check_battler_equipment?
  1671. update_dash_button
  1672. update_auto_target_shoot
  1673. update_combo_time
  1674. update_action_1_button
  1675. update_action_2_button
  1676. update_skill_button
  1677. update_item_button
  1678. update_change_leader_button
  1679. update_charge_button
  1680. end
  1681.  
  1682. #--------------------------------------------------------------------------
  1683. # ● Can Use Command?
  1684. #--------------------------------------------------------------------------
  1685. def can_use_command?
  1686. return false if $game_map.interpreter.running?
  1687. return false if $game_message.visible
  1688. return false if self.battler == nil
  1689. return false if self.action != nil
  1690. return false if self.knockbacking?
  1691. return false if @stop
  1692. return true
  1693. end
  1694.  
  1695. #--------------------------------------------------------------------------
  1696. # ● Update Check Battler Equipment
  1697. #--------------------------------------------------------------------------
  1698. def update_check_battler_equipment
  1699.  
  1700. end
  1701.  
  1702. #--------------------------------------------------------------------------
  1703. # ● Can Check Battler Equipment
  1704. #--------------------------------------------------------------------------
  1705. def can_check_battler_equipment?
  1706. if self.battler.old_equipment_id[0] != self.battler.equips[0] or
  1707. self.battler.old_equipment_id[1] != self.battler.equips[1] or
  1708. self.battler.old_equipment_id[2] != self.battler.equips[2] or
  1709. self.battler.old_equipment_id[3] != self.battler.equips[3] or
  1710. self.battler.old_equipment_id[4] != self.battler.equips[4]
  1711. self.battler.old_equipment_id[0] = self.battler.equips[0]
  1712. self.battler.old_equipment_id[1] = self.battler.equips[1]
  1713. self.battler.old_equipment_id[2] = self.battler.equips[2]
  1714. self.battler.old_equipment_id[3] = self.battler.equips[3]
  1715. self.battler.old_equipment_id[4] = self.battler.equips[4]
  1716. return true
  1717. end
  1718. return false
  1719. end
  1720.  
  1721. #--------------------------------------------------------------------------
  1722. # ● Update Charge Button
  1723. #--------------------------------------------------------------------------
  1724. def update_charge_button
  1725. return unless can_charge_command?
  1726. if Input.press?(PadConfig.attackR1) and ENABLE_ACTION_1_BUTTON
  1727. update_charge_effect(0)
  1728. reset_charge_temp if Input.trigger?(PadConfig.skillbuttonR2) and ENABLE_ACTION_2_BUTTON
  1729. elsif Input.trigger?(PadConfig.skillbuttonR2)
  1730. update_charge_effect(1)
  1731. reset_charge_temp if Input.trigger?(PadConfig.attackR1)
  1732. else
  1733. if self.battler.x_charge_action[2] >= self.battler.x_charge_action[1]
  1734. self.shoot(self.battler.x_charge_action[0])
  1735. end
  1736. reset_charge_temp
  1737. end
  1738. end
  1739.  
  1740. #--------------------------------------------------------------------------
  1741. # ● Update Charge Effect
  1742. #--------------------------------------------------------------------------
  1743. def update_charge_effect(type)
  1744. if self.battler.x_charge_action[2] == 0
  1745. return unless equipped_charge_action?(type)
  1746. end
  1747. if self.battler.x_charge_action[2] < self.battler.x_charge_action[1]
  1748. self.battler.x_charge_action[2] += 1
  1749. end
  1750. self.battler.x_charge_action[3] += 1
  1751. if self.battler.x_charge_action[3] > XAS_ANIMATION::LOOP_ANIMATIONS_SPEED
  1752. self.battler.x_charge_action[3] = 0
  1753. if self.battler.x_charge_action[2] < self.battler.x_charge_action[1]
  1754. self.animation_id = XAS_ANIMATION::CHARGE_ANIMATION1_ID
  1755. else
  1756. self.animation_id = XAS_ANIMATION::CHARGE_ANIMATION2_ID
  1757. end
  1758. end
  1759. end
  1760.  
  1761. #--------------------------------------------------------------------------
  1762. # ● Equipped Charge Action
  1763. #--------------------------------------------------------------------------
  1764. def equipped_charge_action?(type)
  1765. case type
  1766. when 0
  1767. weapon = self.battler.equips[0]
  1768. when 1
  1769. weapon = self.battler.equips[1]
  1770. end
  1771. if weapon == nil
  1772. return false
  1773. reset_charge_temp
  1774. end
  1775. if weapon.note =~ /<Charge Action = (\d+) - (\d+)>/
  1776. self.battler.x_charge_action[0] = $1.to_i rescue 0#Skill ID
  1777. self.battler.x_charge_action[1] = $2.to_i rescue 0#Max Time
  1778. self.battler.x_charge_action[2] = 0#Current Time
  1779. self.battler.x_charge_action[3] = 0#Loop Anime Time
  1780. return true
  1781. end
  1782. return false
  1783. reset_charge_temp
  1784. end
  1785.  
  1786. #--------------------------------------------------------------------------
  1787. # ● Update Combo Time
  1788. #--------------------------------------------------------------------------
  1789. def update_combo_time
  1790. return if self.battler.x_combo[2] == 0
  1791. self.battler.x_combo[2] -= 1
  1792. if self.battler.x_combo[2] == 0
  1793. self.battler.x_combo[0] = 0
  1794. self.battler.x_combo[1] = -1
  1795. end
  1796. end
  1797.  
  1798. #--------------------------------------------------------------------------
  1799. # ● Can Use Weapon Command?
  1800. #--------------------------------------------------------------------------
  1801. def can_use_weapon_command?
  1802. return false if $game_system.command_enable == false
  1803. return false unless ENABLE_ACTION_1_BUTTON
  1804. return false if self.battler.shield
  1805. return false if self.battler.cast_action[4] > 0
  1806. return false if self.battler.x_charge_action[2] > 0
  1807. return true
  1808. end
  1809.  
  1810. #--------------------------------------------------------------------------
  1811. # ● Can Use Shield Command?
  1812. #--------------------------------------------------------------------------
  1813. def can_use_shield_command?
  1814. return false if $game_system.command_enable == false
  1815. return false unless ENABLE_ACTION_2_BUTTON
  1816. return false if self.battler.equips[1] == nil
  1817. return false if self.battler.equips[1].id == 0
  1818. return false if self.battler.cast_action[4] > 0
  1819. return false if self.battler.x_charge_action[2] > 0
  1820. return true
  1821. end
  1822.  
  1823. #--------------------------------------------------------------------------
  1824. # ● Can Use Skill Command?
  1825. #--------------------------------------------------------------------------
  1826. def can_use_skill_command?
  1827. return false if $game_system.command_enable == false
  1828. return false unless ENABLE_SKILL_BUTTON
  1829. return false if self.battler.shield
  1830. return false if self.battler.cast_action[4] > 0
  1831. return false if self.battler.x_charge_action[2] > 0
  1832. return true
  1833. end
  1834.  
  1835. #--------------------------------------------------------------------------
  1836. # ● Can Use Item Command?
  1837. #--------------------------------------------------------------------------
  1838. def can_use_item_command?
  1839. return false if $game_system.command_enable == false
  1840. return false unless ENABLE_ITEM_BUTTON
  1841. return false if self.battler.shield
  1842. return false if self.battler.cast_action[4] > 0
  1843. return false if self.battler.x_charge_action[2] > 0
  1844. return true
  1845. end
  1846.  
  1847. #--------------------------------------------------------------------------
  1848. # ● Can Charge Command
  1849. #--------------------------------------------------------------------------
  1850. def can_charge_command?
  1851. return false if $game_system.command_enable == false
  1852. return false if self.battler.cast_action[4] > 0
  1853. return false if self.battler.shield
  1854. return true
  1855. end
  1856.  
  1857. #--------------------------------------------------------------------------
  1858. # ● Can Use Change Leader Command?
  1859. #--------------------------------------------------------------------------
  1860. def can_use_change_leader_command?
  1861. return false unless ENABLE_CHANGE_LEADER_BUTTON
  1862. return false if self.battler.shield
  1863. return false if self.battler.cast_action[4] > 0
  1864. return false if self.battler.x_charge_action[2] > 0
  1865. return false if $game_temp.change_leader_wait_time > 0
  1866. return true
  1867. end
  1868.  
  1869. #--------------------------------------------------------------------------
  1870. # ● State_Seal Command
  1871. #--------------------------------------------------------------------------
  1872. def state_seal_command?(type)
  1873. seal = false
  1874. case type
  1875. when 0
  1876. seal = true if self.battler.state_mute
  1877. seal = true if self.battler.state_seal_attack
  1878. when 1
  1879. seal = true if self.battler.state_mute
  1880. seal = true if self.battler.state_seal_attack
  1881. when 2
  1882. seal = true if self.battler.state_mute
  1883. seal = true if self.battler.state_seal_skill
  1884. when 3
  1885. seal = true if self.battler.state_mute
  1886. seal = true if self.battler.state_seal_item
  1887. end
  1888. if seal
  1889. seal_effect
  1890. return true
  1891. end
  1892. return false
  1893. end
  1894.  
  1895. #--------------------------------------------------------------------------
  1896. # ● Check Equipped Action
  1897. #--------------------------------------------------------------------------
  1898. def check_equipped_action(command_type)
  1899. case command_type
  1900. when 0 # Weapon 1
  1901. weapon = self.battler.equips[0]
  1902. if weapon == nil
  1903. self.battler.x_action1_id = 0
  1904. return
  1905. end
  1906. weapon.note =~ /<Action ID = (\d+)>/
  1907. action_id = $1.to_i
  1908. action_id = 0 if action_id == nil
  1909. self.battler.x_action1_id = action_id
  1910. when 1 # Weapon 2
  1911. weapon = self.battler.equips[1]
  1912. if weapon == nil
  1913. self.battler.x_action2_id = 0
  1914. return
  1915. end
  1916. weapon.note =~ /<Action ID = (\d+)>/
  1917. action_id = $1.to_i
  1918. action_id = 0 if action_id == nil
  1919. self.battler.x_action2_id = action_id
  1920. when 2 # Skill
  1921.  
  1922. when 3 # Item
  1923. item_id = $data_items[self.battler.item_id]
  1924. if item_id == nil
  1925. self.battler.x_item_id = 0
  1926. return
  1927. end
  1928. item_id.note =~ /<Action ID = (\d+)>/
  1929. action_id = $1.to_i
  1930. action_id = 0 if action_id == nil
  1931. self.battler.x_item_id = action_id
  1932. end
  1933. end
  1934.  
  1935. #--------------------------------------------------------------------------
  1936. # ● Execute Combo
  1937. #--------------------------------------------------------------------------
  1938. def execute_combo?(type)
  1939. if type == self.battler.x_combo[1] and self.battler.x_combo[0] != 0
  1940. return if state_seal_command?(type)
  1941. self.shoot(self.battler.x_combo[0])
  1942. self.battler.x_combo[1] = type
  1943. return true
  1944. end
  1945. self.battler.x_combo[0] = 0
  1946. self.battler.x_combo[1] = type
  1947. self.battler.x_combo[2] = 0
  1948. return false
  1949. end
  1950.  
  1951. #--------------------------------------------------------------------------
  1952. # ● Update Change Leader Button
  1953. #--------------------------------------------------------------------------
  1954. def update_change_leader_button
  1955. if Input.trigger?(PadConfig.changeleader)
  1956. return unless can_use_change_leader_command?
  1957. change_leader
  1958. end
  1959. end
  1960.  
  1961. #--------------------------------------------------------------------------
  1962. # ● Update Action 1 Button
  1963. #--------------------------------------------------------------------------
  1964. def update_action_1_button
  1965. if Input.trigger?(PadConfig.attackR1)
  1966. type = 0
  1967. return unless can_use_weapon_command?
  1968. return if execute_combo?(type)
  1969. check_equipped_action(type)
  1970. action_id = self.battler.x_action1_id
  1971. return if action_id == 0
  1972. return if state_seal_command?(type)
  1973. self.shoot(action_id)
  1974. end
  1975. end
  1976.  
  1977. #--------------------------------------------------------------------------
  1978. # ● Update Action 2 Button
  1979. #--------------------------------------------------------------------------
  1980. def update_action_2_button
  1981. if WolfPad.plugged_in?
  1982. if Input.trigger?(Input::C) #miredit
  1983. if self.battler.equips[1].is_a?(RPG::Weapon)
  1984. type = 1
  1985. return unless can_use_weapon_command?
  1986. return if execute_combo?(type)
  1987. check_equipped_action(type)
  1988. action_id = self.battler.x_action2_id
  1989. return if action_id == 0
  1990. return if state_seal_command?(type)
  1991. self.shoot(action_id)
  1992. return
  1993. end
  1994. end
  1995. else
  1996. if Input.trigger?(ACTION_2_BUTTON) #miredit
  1997. if self.battler.equips[1].is_a?(RPG::Weapon)
  1998. type = 1
  1999. return unless can_use_weapon_command?
  2000. return if execute_combo?(type)
  2001. check_equipped_action(type)
  2002. action_id = self.battler.x_action2_id
  2003. return if action_id == 0
  2004. return if state_seal_command?(type)
  2005. self.shoot(action_id)
  2006. return
  2007. end
  2008. end
  2009. end
  2010. update_shield_button
  2011. end
  2012.  
  2013. #--------------------------------------------------------------------------
  2014. # ● Update Shield Button
  2015. #--------------------------------------------------------------------------
  2016. def update_shield_button
  2017. if WolfPad.plugged_in?
  2018. if Input.press?(ACTION_2_BUTTON)
  2019. if self.battler.ct < 30
  2020. self.battler.shield = false
  2021. else
  2022. if can_use_shield_command?
  2023. unless self.battler.shield
  2024. shield = self.battler.equips[1]
  2025. if shield.note =~ /<Action>/
  2026. make_pose("_Shd01%(4)", 2) #hardcoded ftw! MIREdit $1.to_s
  2027. else
  2028. self.battler.shield = false
  2029. return
  2030. end
  2031. end
  2032. self.x_pose_duration = 2
  2033. self.battler.shield = true
  2034. update_shield_diretion_button
  2035. else
  2036. self.battler.shield = false
  2037. end
  2038. end
  2039. else
  2040. self.battler.shield = false
  2041. end
  2042. else
  2043. if Input.press?(Input::C)
  2044. if self.battler.ct < 30
  2045. self.battler.shield = false
  2046. else
  2047. if can_use_shield_command?
  2048. unless self.battler.shield
  2049. shield = self.battler.equips[1]
  2050. if shield.note =~ /<Action>/
  2051. make_pose("_Shd01%(4)", 2) #hardcoded ftw! MIREdit $1.to_s
  2052. else
  2053. self.battler.shield = false
  2054. return
  2055. end
  2056. end
  2057. self.x_pose_duration = 2
  2058. self.battler.shield = true
  2059. update_shield_diretion_button
  2060. else
  2061. self.battler.shield = false
  2062. end
  2063. end
  2064. else
  2065. self.battler.shield = false
  2066. end
  2067. end
  2068. end
  2069.  
  2070. #--------------------------------------------------------------------------
  2071. # ● update_shield_direction_button
  2072. #--------------------------------------------------------------------------
  2073. def update_shield_diretion_button
  2074. return if @direction_fix
  2075. case Input.dir4
  2076. when 2; set_direction(2)
  2077. when 4; set_direction(4)
  2078. when 6; set_direction(6)
  2079. when 8; set_direction(8)
  2080. end
  2081. end
  2082.  
  2083. #--------------------------------------------------------------------------
  2084. # ● Update Skill Button
  2085. #--------------------------------------------------------------------------
  2086. def update_skill_button
  2087. if Input.trigger?(PadConfig.skillbuttonR2)
  2088. type = 2
  2089. return unless can_use_skill_command?
  2090. return if execute_combo?(type)
  2091. check_equipped_action(type)
  2092. action_id = self.battler.skill_id
  2093. return if action_id == 0
  2094. return if state_seal_command?(type)
  2095. self.shoot(action_id)
  2096. end
  2097. end
  2098.  
  2099. #--------------------------------------------------------------------------
  2100. # ● Update Item Button
  2101. #--------------------------------------------------------------------------
  2102. def update_item_button
  2103. if Input.trigger?(PadConfig.triangle)
  2104. type = 3
  2105. return unless can_use_item_command?
  2106. return if execute_combo?(type)
  2107. check_equipped_action(type)
  2108. action_id = self.battler.x_item_id
  2109. return if action_id == 0
  2110. return if state_seal_command?(type)
  2111. self.shoot(action_id)
  2112. end
  2113. end
  2114.  
  2115. #--------------------------------------------------------------------------
  2116. # ● Update Auto Target Shoot
  2117. #--------------------------------------------------------------------------
  2118. def update_auto_target_shoot
  2119. return if $game_temp.xas_target_time == 0
  2120. return if $game_temp.xas_target_shoot_id == 0
  2121. return if $game_temp.xas_target_x == 0 and $game_temp.xas_target_y == 0
  2122. $game_temp.xas_target_time -= 1
  2123. if $game_temp.xas_target_time == 0
  2124. self.shoot($game_temp.xas_target_shoot_id)
  2125. $game_temp.xas_target_shoot_id = 0
  2126. end
  2127. end
  2128.  
  2129. #--------------------------------------------------------------------------
  2130. # ● Dash?
  2131. #--------------------------------------------------------------------------
  2132. alias x_dash dash?
  2133. def dash?
  2134. return false if XAS_SYSTEM::DASH_SYSTEM
  2135. x_dash
  2136. end
  2137.  
  2138. #--------------------------------------------------------------------------
  2139. # ● Can Dash?
  2140. #--------------------------------------------------------------------------
  2141. def can_dash?
  2142. return false unless XAS_BUTTON::ENABLE_DASH_BUTTON
  2143. return false if self.battler.shield
  2144. return true if Input.press?(XAS_BUTTON::DASH_BUTTON)
  2145. @dash_active = false
  2146. return false
  2147. end
  2148.  
  2149. #--------------------------------------------------------------------------
  2150. # ● Update Dash Command
  2151. #--------------------------------------------------------------------------
  2152. def update_dash_button
  2153. return unless can_dash?
  2154. @dash_active = true
  2155. @anime_count -= 0.5 if moving?
  2156. update_dash_sprite_name
  2157. end
  2158.  
  2159. #--------------------------------------------------------------------------
  2160. # ● Update Dash Sprite Name
  2161. #--------------------------------------------------------------------------
  2162. def update_dash_sprite_name
  2163. make_pose("_Dash", 2)
  2164. end
  2165.  
  2166. end
  2167.  
  2168.  
  2169. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  2170. #■ TOOL - INITIALIZE
  2171. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  2172.  
  2173.  
  2174. #===============================================================================
  2175. # ■ Game_Map
  2176. #===============================================================================
  2177. class Game_Map
  2178.  
  2179. attr_accessor :need_refresh_token
  2180.  
  2181. #--------------------------------------------------------------------------
  2182. # ● need_add_tokens
  2183. #--------------------------------------------------------------------------
  2184. def need_add_tokens
  2185. @need_add_tokens = [] if @need_add_tokens == nil
  2186. return @need_add_tokens
  2187. end
  2188.  
  2189. #--------------------------------------------------------------------------
  2190. # ● need_remove_tokens
  2191. #--------------------------------------------------------------------------
  2192. def need_remove_tokens
  2193. @need_remove_tokens = [] if @need_remove_tokens == nil
  2194. return @need_remove_tokens
  2195. end
  2196.  
  2197. #--------------------------------------------------------------------------
  2198. # ● add_token
  2199. #--------------------------------------------------------------------------
  2200. def add_token(token_event)
  2201. $game_temp.tool_event = [] if $game_temp.tool_event == nil
  2202. $game_temp.tool_event.push(token_event)
  2203. self.need_add_tokens.push(token_event)
  2204. self.need_refresh_token = true
  2205. end
  2206.  
  2207. #--------------------------------------------------------------------------
  2208. # ● remove_token
  2209. #--------------------------------------------------------------------------
  2210. def remove_token(token_event)
  2211. @events.delete(token_event.id)
  2212. self.need_remove_tokens.push(token_event)
  2213. self.need_refresh_token = true
  2214. end
  2215.  
  2216. #--------------------------------------------------------------------------
  2217. # ● clear_tokens
  2218. #--------------------------------------------------------------------------
  2219. def clear_tokens
  2220. $game_system.tools_on_map.clear
  2221. $game_system.tools_on_map = []
  2222. for event in @events.values.dup
  2223. remove_token(event) if event.is_a?(Token_Event)
  2224. end
  2225. channels = ["A", "B", "C", "D"]
  2226. for id in 1001..(token_id_shift - 1)
  2227. for a in channels
  2228. key = [self.map_id, id, a]
  2229. $game_self_switches.delete(key)
  2230. end
  2231. end
  2232. clear_token_id
  2233. end
  2234.  
  2235. #--------------------------------------------------------------------------
  2236. # ● Update
  2237. #--------------------------------------------------------------------------
  2238. alias x_temp_tool_hash_update update
  2239. def update(main = false)
  2240. x_temp_tool_hash_update(main)
  2241. update_add_tool_hash
  2242. end
  2243.  
  2244. #--------------------------------------------------------------------------
  2245. # ● Update Add Toll Hash
  2246. #--------------------------------------------------------------------------
  2247. def update_add_tool_hash
  2248. return if $game_temp.tool_event == nil
  2249. for i in $game_temp.tool_event
  2250. $game_map.events[i.id] = i
  2251. execute_tool_effects_hash(i)
  2252. end
  2253. $game_temp.tool_event.clear
  2254. $game_temp.tool_event = nil
  2255. end
  2256.  
  2257. #--------------------------------------------------------------------------
  2258. # ● Execute Toll Effects Hash
  2259. #--------------------------------------------------------------------------
  2260. def execute_tool_effects_hash(i)
  2261.  
  2262. end
  2263. end
  2264.  
  2265. #===============================================================================
  2266. # ■ Game_SelfSwitches
  2267. #===============================================================================
  2268. class Game_SelfSwitches
  2269. def delete(key)
  2270. @data.delete(key)
  2271. end
  2272. end
  2273.  
  2274. #===============================================================================
  2275. # ■ Game_Map
  2276. #===============================================================================
  2277. class Game_Map
  2278.  
  2279. attr_accessor :token_id
  2280.  
  2281. #--------------------------------------------------------------------------
  2282. # ● token_id_shift
  2283. #--------------------------------------------------------------------------
  2284. def token_id_shift
  2285. @token_id = 1000 if @token_id == nil
  2286. @token_id += 1
  2287. return @token_id
  2288. end
  2289.  
  2290. #--------------------------------------------------------------------------
  2291. # ● clear_token_id
  2292. #--------------------------------------------------------------------------
  2293. def clear_token_id
  2294. @token_id = nil
  2295. end
  2296. end
  2297.  
  2298. #===============================================================================
  2299. # ■ XRXS_CTS_RefreshToken
  2300. #===============================================================================
  2301. module XRXS_CTS_RefreshToken
  2302.  
  2303. #--------------------------------------------------------------------------
  2304. # ● refresh_token
  2305. #--------------------------------------------------------------------------
  2306. def refresh_token
  2307. for event in $game_map.need_add_tokens
  2308. @character_sprites.push(Sprite_Character.new(@viewport1, event))
  2309. end
  2310. $game_map.need_add_tokens.clear
  2311. for sprite in @character_sprites.dup
  2312. if $game_map.need_remove_tokens.empty?
  2313. break
  2314. end
  2315. if $game_map.need_remove_tokens.delete(sprite.character)
  2316. @character_sprites.delete(sprite)
  2317. sprite.dispose
  2318. end
  2319. end
  2320. $game_map.need_refresh_token = false
  2321. end
  2322. end
  2323.  
  2324. #===============================================================================
  2325. # ■ Spriteset_Map
  2326. #===============================================================================
  2327. class Spriteset_Map
  2328. include XRXS_CTS_RefreshToken
  2329.  
  2330. #--------------------------------------------------------------------------
  2331. # ● Initialize
  2332. #--------------------------------------------------------------------------
  2333. alias x_smap_initialize initialize
  2334. def initialize
  2335. setup_start
  2336. x_smap_initialize
  2337. end
  2338.  
  2339. #--------------------------------------------------------------------------
  2340. # ● Setup Start
  2341. #--------------------------------------------------------------------------
  2342. def setup_start
  2343. $game_player.reset_old_level(true)
  2344. end
  2345.  
  2346. end
  2347.  
  2348. #===============================================================================
  2349. # ■ Game_Player
  2350. #===============================================================================
  2351. class Game_Player < Game_Character
  2352.  
  2353. #--------------------------------------------------------------------------
  2354. # ● x_reserve_transfer
  2355. #--------------------------------------------------------------------------
  2356. alias x_reserve_transfer reserve_transfer
  2357. def reserve_transfer(map_id, x, y, direction)
  2358. $game_map.clear_tokens
  2359. if $game_temp.tool_event != nil
  2360. $game_temp.tool_event.clear
  2361. $game_temp.tool_event = nil
  2362. end
  2363. x_reserve_transfer(map_id, x, y, direction)
  2364. end
  2365.  
  2366. end
  2367.  
  2368. #===============================================================================
  2369. # ■ Token_Event
  2370. #===============================================================================
  2371. class Token_Event < Game_Event
  2372.  
  2373. #--------------------------------------------------------------------------
  2374. # ● Token_Event
  2375. #--------------------------------------------------------------------------
  2376. def initialize(map_id, event)
  2377. event.id = $game_map.token_id_shift
  2378. super
  2379. end
  2380.  
  2381. #--------------------------------------------------------------------------
  2382. # ● erase
  2383. #--------------------------------------------------------------------------
  2384. def erase
  2385. super
  2386. $game_map.remove_token(self)
  2387. end
  2388. end
  2389.  
  2390.  
  2391. #===============================================================================
  2392. # ■ XRXS_ActionTemplate
  2393. #===============================================================================
  2394. module XRXS_ActionTemplate
  2395. map_id = XAS_SYSTEM::ACTION_TEMPLATE_MAP_ID
  2396. map = load_data(sprintf("Data/Map%03d.rvdata2", map_id))
  2397. @@events = map.events
  2398. end
  2399.  
  2400. #===============================================================================
  2401. # ■ Token_Event
  2402. #===============================================================================
  2403. class Token_Event < Game_Event
  2404. include XRXS_ActionTemplate
  2405. end
  2406.  
  2407. #===============================================================================
  2408. # ■ Game_Temp
  2409. #===============================================================================
  2410. class Game_Temp
  2411. attr_accessor :active_token
  2412. end
  2413.  
  2414.  
  2415.  
  2416. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  2417. #■ TOOL - SHOOT COMMAND
  2418. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  2419.  
  2420.  
  2421. #===============================================================================
  2422. # ■ XAS ACTION
  2423. #===============================================================================
  2424. module XAS_ACTION
  2425. attr_reader :action
  2426. attr_reader :erased
  2427.  
  2428. #--------------------------------------------------------------------------
  2429. # ● shoot
  2430. #--------------------------------------------------------------------------
  2431. def shoot(action_id = 0)
  2432. return if action_id == 0
  2433. skill = $data_skills[action_id]
  2434. return unless can_shoot?(skill)
  2435. execute_user_effects(skill)
  2436. execute_call_event(action_id)
  2437. self.action_attachment(action_id)
  2438. execute_set_pose(action_id)
  2439. end
  2440.  
  2441. #--------------------------------------------------------------------------
  2442. # ● Can Shoot
  2443. #--------------------------------------------------------------------------
  2444. def can_shoot?(skill)
  2445. if self.battler == nil and self.tool_id > 0
  2446. @battler = self.action.user.battler
  2447. end
  2448. return false if self.battler == nil
  2449. return false if skill == nil
  2450. return true if ignore_can_shoot?(skill)
  2451. enough_cost = true
  2452. return false if tools_on_map?(skill.id)
  2453. if self.battler.state_mute
  2454. seal_effect
  2455. return false
  2456. end
  2457. if self.battler.cast_action[4].between?(1,self.battler.cast_action[1] -1)
  2458. return false
  2459. end
  2460. return false if check_cast_action?(skill)
  2461. return false if check_auto_target_select?(skill)
  2462. unless enough_skill_cost?(skill)
  2463. anim(172) #Mir edit
  2464. #Audio.se_play("Audio/SE/" + XAS_SOUND::ACTION_COST , 100, 100) Mir Edit
  2465. return false
  2466. end
  2467. return true
  2468. end
  2469.  
  2470. #--------------------------------------------------------------------------
  2471. # ● Ignore Can Shoot?
  2472. #--------------------------------------------------------------------------
  2473. def ignore_can_shoot?(skill)
  2474. return false
  2475. end
  2476.  
  2477. #--------------------------------------------------------------------------
  2478. # ● Tools on Map
  2479. #--------------------------------------------------------------------------
  2480. def tools_on_map?(skill_id)
  2481. return true if $game_system.tools_on_map.include?(skill_id)
  2482. return false
  2483. end
  2484.  
  2485. #--------------------------------------------------------------------------
  2486. # ● Check Cast Action
  2487. #--------------------------------------------------------------------------
  2488. def check_cast_action?(skill)
  2489. if self.battler.cast_action[0] != 0
  2490. self.battler.cast_action[0] = 0
  2491. self.battler.cast_action[1] = 0
  2492. self.battler.cast_action[2] = 0
  2493. self.battler.cast_action[3] = 0
  2494. self.battler.cast_action[4] = 0
  2495. return false
  2496. end
  2497. if skill.note =~ /<Cast Time = (\d+)>/ and
  2498. $game_temp.xas_target_shoot_id == 0 and
  2499. self.force_action_times == 0
  2500. self.battler.cast_action[0] = skill.id
  2501. self.battler.cast_action[1] = $1.to_i rescue 0
  2502. self.battler.cast_action[2] = XAS_ANIMATION::CAST_TIME_ANIMATION_ID
  2503. self.battler.cast_action[3] = 0
  2504. self.battler.cast_action[4] = 0
  2505. self.animation_id = self.battler.cast_action[2]
  2506. return true
  2507. end
  2508. return false
  2509. end
  2510.  
  2511. #--------------------------------------------------------------------------
  2512. # ● Check Auto Target Select
  2513. #--------------------------------------------------------------------------
  2514. def check_auto_target_select?(skill)
  2515. return false if self.is_a?(Game_Event)
  2516. if skill.note =~ /<Auto Target>/
  2517. if $game_temp.xas_target_shoot_id == 0
  2518. $game_temp.xas_target_shoot_id = skill.id
  2519. $game_map.check_events_on_screen
  2520. SceneManager.call(Scene_Target_Select)
  2521. return true
  2522. end
  2523. end
  2524. return false
  2525. end
  2526.  
  2527. #--------------------------------------------------------------------------
  2528. # ● enough_skill_cost?
  2529. #--------------------------------------------------------------------------
  2530. def enough_skill_cost?(skill)
  2531. return false unless enough_mp_cost?(skill)
  2532. return false unless enough_item_cost?(skill)
  2533. return true
  2534. end
  2535.  
  2536. #--------------------------------------------------------------------------
  2537. # ● Enough MP Cost
  2538. #--------------------------------------------------------------------------
  2539. def enough_mp_cost?(skill)
  2540. if @force_action_times > 0
  2541. return true if @force_action == "All Shoot"
  2542. return true if @force_action == "Four Shoot"
  2543. return true if @force_action == "Three Shoot"
  2544. return true if @force_action == "Two Shoot"
  2545. end
  2546. if self.battler.mp < skill.mp_cost
  2547. self.battler.damage = XAS_WORD::NO_MP
  2548. self.battler.damage_pop = true
  2549. return false
  2550. else
  2551. self.battler.mp -= skill.mp_cost
  2552. return true
  2553. end
  2554. return true
  2555. end
  2556.  
  2557. #--------------------------------------------------------------------------
  2558. # ● Enough MP Cost
  2559. #--------------------------------------------------------------------------
  2560. def enough_item_cost?(skill)
  2561. return true if self.battler.is_a?(Game_Enemy)
  2562. if @force_action_times > 0
  2563. return true if @force_action == "All Shoot"
  2564. return true if @force_action == "Four Shoot"
  2565. return true if @force_action == "Three Shoot"
  2566. return true if @force_action == "Two Shoot"
  2567. end
  2568. skill.note =~ /<Item Cost = (\d+)>/
  2569. item_id = $1.to_i
  2570. if item_id != nil and item_id != 0
  2571. item_cost = $data_items[item_id]
  2572. number = $game_party.item_number(item_cost)
  2573. if number == 0 or number == nil
  2574. self.battler.damage = XAS_WORD::NO_ITEM
  2575. self.battler.damage_pop = true
  2576. return false
  2577. else
  2578. $game_party.lose_item(item_cost, 1, false)
  2579. return true
  2580. end
  2581. end
  2582. return true
  2583. end
  2584.  
  2585. #--------------------------------------------------------------------------
  2586. # ● Execute User Effects
  2587. #--------------------------------------------------------------------------
  2588. def execute_user_effects(skill)
  2589. self.battler.shield = false
  2590. #Animation
  2591. if skill.note =~ /<Cast Ani = (\d+)>/
  2592. ani_id = $1.to_i
  2593. if ani_id != nil
  2594. self.animation_id = ani_id
  2595. end
  2596. end
  2597. unless @force_action_times > 0
  2598. #All Directions
  2599. if skill.note =~ /<All Directions>/
  2600. @force_action = "All Shoot"
  2601. @force_action_times = 8
  2602. elsif skill.note =~ /<Four Directions>/
  2603. @force_action = "Four Shoot"
  2604. @force_action_times = 4
  2605. elsif skill.note =~ /<Three Directions>/
  2606. @force_action = "Three Shoot"
  2607. @force_action_times = 3
  2608. elsif skill.note =~ /<Two Directions>/
  2609. @force_action = "Two Shoot"
  2610. @force_action_times = 2
  2611. end
  2612. end
  2613. end
  2614.  
  2615. #--------------------------------------------------------------------------
  2616. # ● Execute Set Pose
  2617. #--------------------------------------------------------------------------
  2618. def execute_set_pose(action_id)
  2619. @action.duration = @action.sunflag
  2620. make_pose(@action.self_motion, @action.sunflag )
  2621. @pattern = 0
  2622. @pattern_count = 0
  2623. @step_anime = true
  2624. @self_motion = nil
  2625. self.need_refresh = true if self.is_a?(Game_Player)
  2626. end
  2627.  
  2628. #--------------------------------------------------------------------------
  2629. # ● execute_call_event
  2630. #--------------------------------------------------------------------------
  2631. def execute_call_event(action_id)
  2632. bullet_token = Token_Bullet.new(self, action_id)
  2633. $game_map.add_token(bullet_token)
  2634. return bullet_token
  2635. end
  2636.  
  2637. #--------------------------------------------------------------------------
  2638. # ● action_attachment
  2639. #--------------------------------------------------------------------------
  2640. def action_attachment(action_id)
  2641. @action = Game_Action_XAS.new(self, action_id)
  2642. @action.attachment(action_id)
  2643. end
  2644.  
  2645. end
  2646.  
  2647.  
  2648. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  2649. #■ TOOL - SHOOT SETTING
  2650. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  2651.  
  2652.  
  2653. #===============================================================================
  2654. # ■ Game_Action_XAS
  2655. #===============================================================================
  2656. class Game_Action_XAS
  2657.  
  2658. attr_accessor :user
  2659. attr_accessor :id
  2660. attr_accessor :attack_id
  2661. attr_accessor :attack_range
  2662. attr_accessor :attack_range_type
  2663. attr_accessor :hit_events
  2664. attr_accessor :now_count
  2665. attr_accessor :pre_now_count
  2666. attr_accessor :duration
  2667. attr_accessor :blow_power
  2668. attr_accessor :piercing
  2669. attr_accessor :ignore_knockback_invincible
  2670. attr_accessor :target_invunerable_duration
  2671. attr_accessor :multi_hit
  2672. attr_accessor :ally_damage
  2673. attr_accessor :all_damage
  2674. attr_accessor :sunflag
  2675. attr_accessor :self_motion
  2676. attr_accessor :second_animation_id
  2677. attr_accessor :third_animation_id
  2678. attr_accessor :attack_range_type
  2679. attr_accessor :attack_range_plan
  2680. attr_accessor :blow_power
  2681. attr_accessor :ignore_guard
  2682. attr_accessor :user_invincible
  2683. attr_accessor :short_range
  2684. attr_accessor :first_impact_time
  2685. attr_accessor :animation_time
  2686. attr_accessor :duration
  2687. attr_accessor :item_cost
  2688. attr_accessor :hit_shake
  2689. attr_accessor :hit_hold_target
  2690. attr_accessor :hit_bounce
  2691. attr_accessor :sticky
  2692. attr_accessor :reflectable
  2693. attr_accessor :can_reflect
  2694. attr_accessor :attack_id_plan
  2695. attr_accessor :hit_action
  2696. attr_accessor :fake_id
  2697. attr_accessor :impact
  2698.  
  2699. #--------------------------------------------------------------------------
  2700. # ● initialize
  2701. #--------------------------------------------------------------------------
  2702. def initialize(user, action_id)
  2703. @user = user
  2704. @id = action_id
  2705. @now_count = 0
  2706. @duration = nil
  2707. @attack_id = 0
  2708. @attack_range = 0
  2709. @hit_events = []
  2710. @blow_power = 0
  2711. @skill = $data_skills[action_id]
  2712. @ignore_knockback_invincible = false
  2713. @multi_hit = false
  2714. @piercing = false
  2715. @all_damage = false
  2716. @ally_damage = false
  2717. @ignore_guard = false
  2718. @sunflag = 10
  2719. @duration = 10
  2720. @self_motion = ""
  2721. @attack_range_type = 1
  2722. @attack_range_plan = 1
  2723. @blow_power = 1
  2724. @first_impact_time = 0
  2725. @animation_time = []
  2726. @target_invunerable_duration = 10
  2727. @second_animation_id = 0
  2728. @third_animation_id = 0
  2729. @user_invincible = false
  2730. @short_range = false
  2731. @item_cost = 0
  2732. @hit_shake = false
  2733. @hit_hold_target = false
  2734. @hit_bounce = false
  2735. @sticky = false
  2736. @reflectable = false
  2737. @can_reflect = false
  2738. @hit_action = 0
  2739. @fake_id = false
  2740. @impact = true
  2741. end
  2742.  
  2743. #--------------------------------------------------------------------------
  2744. # ● attachment
  2745. #--------------------------------------------------------------------------
  2746. def attachment(action_id)
  2747. @attack_id_plan = [action_id]
  2748. if @skill.note =~ /<Sunflag = (\d+)>/
  2749. @sunflag = $1.to_i
  2750. end
  2751. if @skill.note =~ /<Duration = (\d+)>/
  2752. @duration = $1.to_i
  2753. end
  2754. if @skill.note =~ /<Pose = (\S+)>/
  2755. @self_motion = $1.to_s
  2756. end
  2757. if @skill.note =~ /<Area = (\w+)>/
  2758. case $1
  2759. when "CROSS"
  2760. area = 7
  2761. when "WALL"
  2762. area = 6
  2763. when "FRONTRHOMBUS"
  2764. area = 5
  2765. when "FRONTSQUARE"
  2766. area = 4
  2767. when "LINE"
  2768. area = 3
  2769. when "SQUARE"
  2770. area = 2
  2771. else
  2772. area = 1
  2773. end
  2774. @attack_range_type = area
  2775. end
  2776. if @skill.note =~ /<Range = (\d+)>/
  2777. @attack_range_plan = [$1.to_i]
  2778. end
  2779. if @skill.note =~ /<Blow Power = (\d+)>/
  2780. @blow_power = $1.to_i
  2781. end
  2782. if @skill.note =~ /<Impact Time = (\d+)>/
  2783. @first_impact_time = $1.to_i
  2784.  
  2785. end
  2786. if @skill.note =~ /<Animation Time = (\d+) - (\d+)>/
  2787. @animation_time[0] = $1.to_i
  2788. @animation_time[1] = $2.to_i
  2789. end
  2790. if @skill.note =~ /<Target Invunerable = (\d+)>/
  2791. @target_invunerable_duration = $1.to_i
  2792. end
  2793. if @skill.note =~ /<Tool Hit Ani = (\d+)>/
  2794. @second_animation_id = $1.to_i
  2795. end
  2796. if @skill.note =~ /<User Hit Ani = (\d+)>/
  2797. @third_animation_id = $1.to_i
  2798. end
  2799. if @skill.note =~ /<Item Cost = (\d+)>/
  2800. @item_cost = $1.to_i
  2801. end
  2802. if @skill.note =~ /<Link Action ID = (\d+)>/
  2803. if user.battler != nil
  2804. user.battler.x_combo[0] = $1.to_i
  2805. user.battler.x_combo[2] = @sunflag + 20
  2806. end
  2807. else
  2808. if user.battler != nil
  2809. user.battler.x_combo[0] = 0
  2810. user.battler.x_combo[1] = 0
  2811. user.battler.x_combo[2] = 0
  2812. end
  2813. end
  2814. if @skill.note =~ /<Hit Action ID = (\d+)>/
  2815. @hit_action = $1.to_i
  2816. end
  2817. if @skill.note =~ /<Ignore Knockback>/
  2818. @ignore_knockback_invincible = true
  2819. end
  2820. if @skill.note =~ /<Multi Hit>/
  2821. @multi_hit = true
  2822. end
  2823. if @skill.note =~ /<Piercing>/
  2824. @piercing = true
  2825. end
  2826. if @skill.note =~ /<All Damage>/
  2827. @all_damage = true
  2828. end
  2829. if @skill.note =~ /<Ally Damage>/
  2830. @ally_damage = true
  2831. end
  2832. if @skill.note =~ /<User Invincible>/
  2833. @user_invincible = true
  2834. end
  2835. if @skill.note =~ /<Ignore Guard>/
  2836. @ignore_guard = true
  2837. end
  2838. if @skill.note =~ /<One Action>/
  2839. unless $game_system.tools_on_map.include?(action_id)
  2840. $game_system.tools_on_map.push(action_id)
  2841. end
  2842. end
  2843. if @skill.note =~ /<Shake>/
  2844. @hit_shake = true
  2845. end
  2846. if @skill.note =~ /<User Range>/
  2847. @short_range = true
  2848. end
  2849. if @skill.note =~ /<Hit Hold Target>/
  2850. @hit_hold_target = true
  2851. end
  2852. if @skill.note =~ /<Hit Sticky Target>/
  2853. @sticky = true
  2854. end
  2855. if @skill.note =~ /<Hit Bounce Direction>/
  2856. @hit_bounce = true
  2857. end
  2858. if @skill.note =~ /<Reflectable>/
  2859. @reflectable = true
  2860. end
  2861. if @skill.note =~ /<Can Reflect>/
  2862. @can_reflect = true
  2863. end
  2864. if @skill.note =~ /<Disable Hit>/
  2865. @impact = false
  2866. end
  2867. @sunflag = 1 if @sunflag <= 0
  2868. end
  2869.  
  2870. #--------------------------------------------------------------------------
  2871. # ● update
  2872. #--------------------------------------------------------------------------
  2873. def update
  2874. @first_impact_time -= 1 if @first_impact_time > 0
  2875. if @attack_id_plan != nil
  2876. id = @attack_id_plan[@now_count]
  2877. unless id.nil?
  2878. @attack_id = id
  2879. @hit_events.clear
  2880. @hit_events.push(self.user) unless @all_damage or @ally_damage
  2881. end
  2882. end
  2883. if @attack_range_plan != nil
  2884. range = @attack_range_plan[@now_count]
  2885. @attack_range = range unless range.nil?
  2886. end
  2887. @now_count += 1
  2888. end
  2889.  
  2890. #--------------------------------------------------------------------------
  2891. # ● done?
  2892. #--------------------------------------------------------------------------
  2893. def done?
  2894. return (self.duration.to_i > 0 and self.now_count >= self.duration)
  2895. end
  2896. end
  2897.  
  2898. #===============================================================================
  2899. # ■ Token_Bullet
  2900. #===============================================================================
  2901. class Token_Bullet < Token_Event
  2902. include XRXS_ActionTemplate
  2903. #--------------------------------------------------------------------------
  2904. # ● initialize
  2905. #--------------------------------------------------------------------------
  2906. def initialize(user, action_id)
  2907. event_id = action_id
  2908. skill = $data_skills[action_id]
  2909. if skill.note =~ /<Event ID = (\d+)>/
  2910. event_id = $1.to_i
  2911. end
  2912. original_event = @@events[event_id]
  2913. if original_event == nil
  2914. msgbox("There's no Event ID " + event_id.to_s + " on Tool Map!")
  2915. SceneManager.exit
  2916. return
  2917. end
  2918. event = original_event.dup
  2919. event.x = user.x
  2920. event.y = user.y
  2921. pre_direction = event.pages[0].graphic.direction
  2922. event.pages[0].graphic.direction = user.direction
  2923. @character_name = event.pages[0].graphic
  2924. super($game_map.map_id, event)
  2925. self.action_attachment(action_id)
  2926. self.tool_id = action_id
  2927. self.diagonal = false
  2928. self.diagonal_direction = 0
  2929. self.sprite_angle_enable = false
  2930. @action.user = user
  2931. @remain_for_an_act = @action.duration.is_a?(Numeric)
  2932. check_tool_effects(user,skill,pre_direction)
  2933. end
  2934.  
  2935. #--------------------------------------------------------------------------
  2936. # ● update
  2937. #--------------------------------------------------------------------------
  2938. def update
  2939. super
  2940. if @action == nil and @remain_for_an_act
  2941. erase
  2942. $game_system.tools_on_map.delete(self.tool_id)
  2943. end
  2944. check_event_trigger_attack
  2945. end
  2946. end
  2947.  
  2948. #===============================================================================
  2949. # ■ Game Player
  2950. #===============================================================================
  2951. class Game_Player < Game_Character
  2952. attr_accessor :need_refresh
  2953. end
  2954.  
  2955. #===============================================================================
  2956. # ■ Token_Bullet
  2957. #===============================================================================
  2958. class Token_Bullet < Token_Event
  2959.  
  2960. #--------------------------------------------------------------------------
  2961. # ● Check Tool Effects
  2962. #--------------------------------------------------------------------------
  2963. def check_tool_effects(user,skill,pre_direction)
  2964. if @action.ally_damage or @action.all_damage
  2965. user.battler.invunerable_duration = 0
  2966. end
  2967. # Force Update Out Screen
  2968. if user.battler.sensor_range >= 15 or
  2969. skill.note =~ /<Update Out Screen>/
  2970. self.force_update = true
  2971. end
  2972. #Diagonal Effect
  2973. if skill.note =~ /<Diagonal>/ or
  2974. skill.note =~ /<All Direction>/ or
  2975. skill.note =~ /<Three Direction>/
  2976. self.diagonal = true
  2977. self.diagonal_direction = user.diagonal_direction
  2978. self.sprite_angle_enable = true
  2979. user.diagonal_time = XAS_BA::DIAGONAL_DURATION if user.diagonal_direction != 0
  2980. user.diagonal = true if user.tool_id > 0
  2981. end
  2982. #Auto Target
  2983. if skill.note =~ /<Auto Target>/
  2984. if user.is_a?(Game_Event)
  2985. self.moveto($game_player.x, $game_player.y)
  2986. else
  2987. moveto($game_temp.xas_target_x, $game_temp.xas_target_y)
  2988. $game_temp.xas_target_x = 0
  2989. $game_temp.xas_target_y = 0
  2990. $game_temp.xas_target_time = 0
  2991. $game_temp.xas_target_shoot_id = 0
  2992. end
  2993. end
  2994. #Barrier
  2995. if skill.note =~ /<Barrier>/
  2996. self.tool_effect = "Barrier"
  2997. end
  2998. #Boomerang
  2999. if skill.note =~ /<Boomerang = (\d+)>/
  3000. self.tool_effect = "Boomerang"
  3001. self.action.duration = 1000
  3002. self.diagonal = true
  3003. self.diagonal_direction = user.diagonal_direction
  3004. self.force_update = true
  3005. @move_frequency = 6
  3006. @move_speed = 5
  3007. @direction_fix = false
  3008. @walk_anime = true
  3009. @step_anime = true
  3010. @force_action = "Forward"
  3011. @force_action_times = $1.to_i
  3012. end
  3013.  
  3014. end
  3015. end
  3016.  
  3017.  
  3018.  
  3019. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  3020. #■ TOOL - AREA
  3021. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  3022.  
  3023.  
  3024. #===============================================================================
  3025. # ■ XAS ACTION
  3026. #===============================================================================
  3027. module XAS_ACTION
  3028.  
  3029. #--------------------------------------------------------------------------
  3030. # ● action_update
  3031. #--------------------------------------------------------------------------
  3032. def action_update
  3033. return unless @action.is_a?(Game_Action_XAS)
  3034. if @action.animation_time != [] and
  3035. @action.animation_time[0] == @action.now_count
  3036. animation_id = @action.animation_time[1]
  3037. unless self.is_a?(Game_Player) or self.tool_id == 0
  3038. self.animation_id = animation_id
  3039. end
  3040. end
  3041. @action.update
  3042. end
  3043.  
  3044. #--------------------------------------------------------------------------
  3045. # ● Can Impact Target
  3046. #--------------------------------------------------------------------------
  3047. def can_impact_target?
  3048. return false if @action.nil?
  3049. return false if @action.attack_id == 0
  3050. return false if @action.first_impact_time > 0
  3051. return false if @action.impact == false
  3052. return false if self.jumping?
  3053. return true
  3054. end
  3055.  
  3056. #--------------------------------------------------------------------------
  3057. # ● check_event_trigger_attack
  3058. #--------------------------------------------------------------------------
  3059. def check_event_trigger_attack()
  3060. return unless can_impact_target?
  3061. hit_check = false
  3062. range = @action.attack_range
  3063. hit = []
  3064. targets = [$game_player] + $game_map.events.values
  3065. for event in targets
  3066. next if event == self or
  3067. @action.hit_events.include?(event) or event.erased
  3068. body_size = event.body_size
  3069. event_center_x = event.x
  3070. event_center_y = event.y - body_size
  3071. if @action.short_range
  3072. dx = event_center_x - $game_player.x
  3073. dy = event_center_y - $game_player.y
  3074. else
  3075. dx = event_center_x - self.x
  3076. dy = event_center_y - self.y
  3077. end
  3078. dx = (dx >= 0 ? [dx - body_size, 0].max : [dx + body_size, 0].min)
  3079. dy = (dy >= 0 ? [dy - body_size, 0].max : [dy + body_size, 0].min)
  3080. hit_check = true if in_range?(dx,dy,event,range)
  3081.  
  3082. hit.push(event) if hit_check
  3083. hit_check = false
  3084. end
  3085. for event in hit
  3086. $game_map.screen.start_shake(rand(2), 5, rand(10)) #MirEdit Shake
  3087. if event.action_effect(self, self.action.attack_id)
  3088. hit_check = true
  3089. #MirEdit
  3090. $game_switches[13] = true
  3091. end
  3092. if event.action_effect_page(self, self.action.attack_id) #used to return only self MirEdit
  3093. hit_check = true
  3094. end
  3095. @action.hit_events.push(event) unless @action.multi_hit
  3096. end
  3097. if hit_check
  3098. $game_temp.active_token = self
  3099. end
  3100. end
  3101.  
  3102. #--------------------------------------------------------------------------
  3103. # ● In Range?
  3104. #--------------------------------------------------------------------------
  3105. def in_range?(dx,dy,event,range)
  3106. case @action.attack_range_type
  3107. when 1 #RHOMBUS
  3108. return true if (dx.abs + dy.abs <= range)
  3109. when 2 #SQUARE
  3110. return true if (dx.abs <= range and dy.abs <= range)
  3111. when 3 #LINE
  3112. case self.direction
  3113. when 2
  3114. return true if (dx == 0 and dy >= 0 and dy <= range)
  3115. when 8
  3116. return true if (dx == 0 and dy <= 0 and dy >= -range)
  3117. when 6
  3118. return true if (dy == 0 and dx >= 0 and dx <= range)
  3119. when 4
  3120. return true if (dy == 0 and dx <= 0 and dx >= -range)
  3121. end
  3122. when 4 #FRONT SQUARE
  3123. case self.direction
  3124. when 2
  3125. return true if (dx.abs <= range and dy >= 0 and dy.abs <= range)
  3126. when 4
  3127. return true if (dx.abs <= range and dx <= 0 and dy.abs <= range)
  3128. when 6
  3129. return true if (dx.abs <= range and dx >= 0 and dy.abs <= range)
  3130. when 8
  3131. return true if (dx.abs <= range and dy <= 0 and dy.abs <= range)
  3132. end
  3133. when 5 #FRONT RHOMBUS
  3134. case self.direction
  3135. when 2
  3136. return true if (dx.abs + dy.abs <= range and dy >= 0)
  3137. when 8
  3138. return true if (dx.abs + dy.abs <= range and dy <= 0)
  3139. when 6
  3140. return true if (dx.abs + dy.abs <= range and dx >= 0)
  3141. when 4
  3142. return true if (dx.abs + dy.abs <= range and dx <= 0)
  3143. end
  3144. when 6 #WALL
  3145. case self.direction
  3146. when 2
  3147. return true if (dx.abs <= range and dy == 0 )
  3148. when 4
  3149. return true if (dy.abs <= range and dx == 0)
  3150. when 6
  3151. return true if (dy.abs <= range and dx == 0)
  3152. when 8
  3153. return true if (dx.abs <= range and dy == 0)
  3154. end
  3155. when 7 #CROSS
  3156. return true if (dx.abs <= range and dy == 0)
  3157. return true if (dy.abs <= range and dx == 0)
  3158. end
  3159. return false
  3160. end
  3161.  
  3162. #--------------------------------------------------------------------------
  3163. # ● action_effect Page
  3164. #--------------------------------------------------------------------------
  3165. def action_effect_page(attacker, attack_id)
  3166. return false unless self.is_a?(Game_Event)
  3167. # return false if attacker.action.fake_id
  3168. if attacker.action != nil
  3169. check_auto_effect_page(attacker, attack_id)
  3170. check_reflectable_skills(attacker, attack_id)
  3171. end
  3172. for page in @event.pages
  3173. if page.condition.variable_valid #and
  3174. #page.condition.variable_id == XAS_SYSTEM::HIT_ID #and #used to have nothing MirEdit
  3175. #page.condition.variable_value == attack_id
  3176. self.reaction_valid_attack_id = attack_id
  3177. self.refresh
  3178. @trigger = 0
  3179. self.start
  3180. return true
  3181. end
  3182. end
  3183. return false
  3184. end
  3185.  
  3186. #--------------------------------------------------------------------------
  3187. # ● Check Reflectable Skills
  3188. #--------------------------------------------------------------------------
  3189. def check_reflectable_skills(attacker, attack_id)
  3190. return if self.tool_id == 0
  3191. return unless self.action.reflectable
  3192. return unless attacker.action.can_reflect
  3193. self.action.user = attacker.action.user
  3194. self.action.hit_events = []
  3195. self.turn_back
  3196. end
  3197.  
  3198. #--------------------------------------------------------------------------
  3199. # ● Check Auto Effect Page
  3200. #--------------------------------------------------------------------------
  3201. def check_auto_effect_page(attacker, attack_id)
  3202. if self.treasure_time > 0
  3203. if can_hit_take_treasure?(attacker, attack_id)
  3204. execute_take_treasure(attacker, attack_id)
  3205. elsif self.temp_id == 0 and can_hold_treasure?(attacker, attack_id)
  3206. execute_hold_treasure(attacker, attack_id)
  3207. end
  3208. end
  3209. end
  3210.  
  3211. #--------------------------------------------------------------------------
  3212. # ● Can Hit Take Treasure
  3213. #--------------------------------------------------------------------------
  3214. def can_hit_take_treasure?(attacker, attack_id)
  3215. return true if attacker.action.short_range
  3216. return false
  3217. end
  3218.  
  3219. #--------------------------------------------------------------------------
  3220. # ● Can Hold Treasure?
  3221. #--------------------------------------------------------------------------
  3222. def can_hold_treasure?(attacker, attack_id)
  3223. return true if attacker.tool_effect == "Boomerang"
  3224. return false
  3225. end
  3226.  
  3227. #--------------------------------------------------------------------------
  3228. # ● Execute Hold Treasure
  3229. #--------------------------------------------------------------------------
  3230. def execute_hold_treasure(attacker, attack_id)
  3231. tr_time = (100 + XAS_BA::TREASURE_ERASE_TIME * 60) - 20
  3232. return if self.treasure_time > tr_time
  3233. self.temp_id = attacker.id
  3234. end
  3235.  
  3236. #--------------------------------------------------------------------------
  3237. # ● Execute Take Treasure
  3238. #--------------------------------------------------------------------------
  3239. def execute_take_treasure(attacker, attack_id)
  3240. tr_time = (100 + XAS_BA::TREASURE_ERASE_TIME * 60) - 20
  3241. return if self.treasure_time > tr_time
  3242. self.x = $game_player.x
  3243. self.y = $game_player.y
  3244. end
  3245.  
  3246. #--------------------------------------------------------------------------
  3247. # ● body_size
  3248. #--------------------------------------------------------------------------
  3249. def body_size
  3250. return 0
  3251. end
  3252.  
  3253. #--------------------------------------------------------------------------
  3254. # ● action_clear
  3255. #--------------------------------------------------------------------------
  3256. def action_clear
  3257. @action = nil
  3258. @step_anime = false
  3259. end
  3260. end
  3261.  
  3262. #===============================================================================
  3263. # ■ Game_Character
  3264. #===============================================================================
  3265. class Game_Character < Game_CharacterBase
  3266. include XAS_ACTION
  3267. end
  3268.  
  3269. #===============================================================================
  3270. # ■ Game_Event
  3271. #===============================================================================
  3272. class Game_Event < Game_Character
  3273.  
  3274. #--------------------------------------------------------------------------
  3275. # * Refresh
  3276. #--------------------------------------------------------------------------
  3277. alias x_conditions_met conditions_met?
  3278. def conditions_met?(page)
  3279. c = page.condition
  3280. if c.variable_valid
  3281. if c.variable_id == XAS_SYSTEM::HIT_ID and
  3282. c.variable_value == self.reaction_valid_attack_id
  3283. return true
  3284. end
  3285. end
  3286. x_conditions_met(page)
  3287. end
  3288.  
  3289. end
  3290.  
  3291. #===============================================================================
  3292. # ■ XAS_Dispose
  3293. #===============================================================================
  3294. module XAS_Dispose
  3295.  
  3296. #--------------------------------------------------------------------------
  3297. # ● update
  3298. #--------------------------------------------------------------------------
  3299. def update
  3300. action_update
  3301. super
  3302. if @action.is_a?(Game_Action_XAS) and @action.done?
  3303. self.action_clear
  3304. end
  3305. end
  3306. end
  3307.  
  3308. #===============================================================================
  3309. # ■ Game_Player
  3310. #===============================================================================
  3311. class Game_Player < Game_Character
  3312. include XAS_Dispose
  3313. end
  3314.  
  3315. #===============================================================================
  3316. # ■ Game_Event
  3317. #===============================================================================
  3318. class Game_Event < Game_Character
  3319. include XAS_Dispose
  3320. end
  3321.  
  3322. #===============================================================================
  3323. # ■ XAS_StopToAction
  3324. #===============================================================================
  3325. module XAS_StopToAction
  3326.  
  3327. #--------------------------------------------------------------------------
  3328. # ● acting?
  3329. #--------------------------------------------------------------------------
  3330. def acting?
  3331. return false if self.battler == nil
  3332. return true if self.battler.shield
  3333. return true if self.action != nil
  3334. return false
  3335. end
  3336.  
  3337. #--------------------------------------------------------------------------
  3338. # ● moving?
  3339. #--------------------------------------------------------------------------
  3340. def moving?
  3341. return (super or self.acting? or self.stop)
  3342. end
  3343.  
  3344. end
  3345.  
  3346. #===============================================================================
  3347. # ■ Game_Player
  3348. #===============================================================================
  3349. class Game_Player < Game_Character
  3350. include XAS_StopToAction
  3351. end
  3352.  
  3353. #===============================================================================
  3354. # ■ Game_Event
  3355. #===============================================================================
  3356. class Game_Event < Game_Character
  3357. attr_accessor :reaction_valid_attack_id
  3358. end
  3359.  
  3360.  
  3361. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  3362. #■ TOOL - HIT EFFECT
  3363. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  3364.  
  3365.  
  3366. #===============================================================================
  3367. # ■ XRXS_BattlerAttachment
  3368. #==============================================================================
  3369. module XRXS_BattlerAttachment
  3370.  
  3371. #--------------------------------------------------------------------------
  3372. # ● Can Hit Base?
  3373. #--------------------------------------------------------------------------
  3374. def can_hit_base?(bullet, action_id)
  3375. return false unless $game_system.xas_battle
  3376. return false if self.battler == nil
  3377. return false if bullet == nil
  3378. return false if action_id == nil or action_id <= 0
  3379. return false if self.can_update == false
  3380. return true
  3381. end
  3382.  
  3383. #--------------------------------------------------------------------------
  3384. # ● Action Effect
  3385. #--------------------------------------------------------------------------
  3386. def action_effect(bullet, action_id)
  3387. return unless can_hit_base?(bullet, action_id)
  3388. skill = $data_skills[action_id]
  3389. user = bullet.action.user
  3390. attacker = (user == nil ? nil : user.battler)
  3391. tar_invu = bullet.action.target_invunerable_duration
  3392. #CAN HIT?
  3393. return unless action_can_hit_target?(bullet, user, skill,tar_invu)
  3394. #REFLECT STATE
  3395. return if reflect_state?(bullet, skill)
  3396. #SHIELD
  3397. if target_shield_enabled?(attacker, skill, bullet)
  3398. execute_guard_effect(user, skill, bullet, tar_invu)
  3399. return
  3400. end
  3401. #INVUNERABLE ACTIONS
  3402. if target_invunerable_actions?(user, skill, bullet)
  3403. execute_guard_effect(user, skill, bullet, tar_invu, false)
  3404. return
  3405. end
  3406. #GUARD DIRECTIONS
  3407. if target_guard_directions?(user, skill, bullet)
  3408. execute_guard_effect(user, skill, bullet, tar_invu)
  3409. return
  3410. end
  3411. execute_hit_effect(attacker,skill, bullet , user, tar_invu )
  3412. if self.is_a?(Game_Player)
  3413. self.need_refresh = true
  3414. end
  3415. end
  3416.  
  3417. #--------------------------------------------------------------------------
  3418. # ● Reflect State?
  3419. #--------------------------------------------------------------------------
  3420. def reflect_state?(bullet, skill)
  3421. if bullet.action.reflectable and self.battler.state_reflect
  3422. if skill.note =~ /<Auto Target>/
  3423. bullet.moveto(bullet.action.user.x,bullet.action.user.y)
  3424. else
  3425. bullet.turn_back
  3426. end
  3427. bullet.action.user = self
  3428. bullet.action.hit_events = []
  3429. bullet.turn_back
  3430. # bullet.jump(0,0)
  3431. bullet.turn_back
  3432. self.battler.damage = XAS_WORD::REFLECT
  3433. self.battler.damage_pop = true
  3434. self.animation_id = XAS_ANIMATION::REFLECT_ANIMATION_ID
  3435. self.battler.invunerable_duration = 20
  3436. return true
  3437. end
  3438. return false
  3439. end
  3440.  
  3441. #--------------------------------------------------------------------------
  3442. # ● Target Guard Directions?
  3443. #--------------------------------------------------------------------------
  3444. def target_guard_directions?(user, skill, bullet)
  3445. return false if self.battler.guard == false
  3446. return false if bullet.action.ignore_guard
  3447. if self.battler.guard_directions.include?(2) and
  3448. ((self.direction == 2 and bullet.direction == 8) or
  3449. (self.direction == 8 and bullet.direction == 2) or
  3450. (self.direction == 6 and bullet.direction == 4) or
  3451. (self.direction == 4 and bullet.direction == 6))
  3452. return true
  3453. elsif self.battler.guard_directions.include?(8) and
  3454. ((self.direction == 8 and bullet.direction == 8) or
  3455. (self.direction == 2 and bullet.direction == 2) or
  3456. (self.direction == 6 and bullet.direction == 6) or
  3457. (self.direction == 4 and bullet.direction == 4))
  3458. return true
  3459. elsif self.battler.guard_directions.include?(4) and
  3460. ((self.direction == 2 and bullet.direction == 4) or
  3461. (self.direction == 8 and bullet.direction == 6) or
  3462. (self.direction == 6 and bullet.direction == 2) or
  3463. (self.direction == 4 and bullet.direction == 8))
  3464. return true
  3465. elsif self.battler.guard_directions.include?(6) and
  3466. ((self.direction == 2 and bullet.direction == 6) or
  3467. (self.direction == 8 and bullet.direction == 4) or
  3468. (self.direction == 6 and bullet.direction == 8) or
  3469. (self.direction == 4 and bullet.direction == 2))
  3470. return true
  3471. end
  3472. return false
  3473. end
  3474.  
  3475. #--------------------------------------------------------------------------
  3476. # ● Target Invunerable Actions?
  3477. #--------------------------------------------------------------------------
  3478. def target_invunerable_actions?(user, skill, bullet)
  3479. return true if self.battler.invunerable_actions.include?(skill.id)
  3480. return false
  3481. end
  3482.  
  3483. #--------------------------------------------------------------------------
  3484. # ● Shoot Target Shield
  3485. #--------------------------------------------------------------------------
  3486. def shoot_target_shield?(bullet,user, skill)
  3487. return false unless self.battler.shield
  3488. return false if bullet.action.ignore_guard
  3489. return true if face_direction?(bullet)
  3490. return false
  3491. end
  3492.  
  3493. #--------------------------------------------------------------------------
  3494. # ● Action can hit target?
  3495. #--------------------------------------------------------------------------
  3496. def action_can_hit_target?(bullet, user, skill,tar_invu)
  3497. if user == nil
  3498. return false
  3499. end
  3500. if self.battler.invunerable
  3501. return false
  3502. end
  3503. if self.battler.dead?
  3504. return false
  3505. end
  3506. if self.battler.invunerable_duration > 0
  3507. return false
  3508. end
  3509. if @knock_back_duration != nil
  3510. return false unless bullet.action.ignore_knockback_invincible
  3511. end
  3512. if bullet.action.first_impact_time > 0
  3513. return false
  3514. end
  3515. if self.action != nil and self.action.user_invincible
  3516. unless self.action.ally_damage and bullet.action.user == self.action.user
  3517. return false
  3518. end
  3519. end
  3520. unless bullet.action.all_damage
  3521. if bullet.action.ally_damage
  3522. if user.battler.is_a?(Game_Actor)
  3523. return false if self.battler.is_a?(Game_Enemy)
  3524. elsif user.battler.is_a?(Game_Enemy)
  3525. return false if self.battler.is_a?(Game_Actor)
  3526. end
  3527. else
  3528. if user.battler.is_a?(Game_Actor)
  3529. return false if self.battler.is_a?(Game_Actor)
  3530. elsif user.battler.is_a?(Game_Enemy)
  3531. return false if self.battler.is_a?(Game_Enemy)
  3532. end
  3533. end
  3534. end
  3535. return false if target_state_invunerable?(tar_invu)
  3536. #return false if target_reflect_action?(bullet, user)
  3537. return true
  3538. end
  3539.  
  3540. #--------------------------------------------------------------------------
  3541. # ● Target Relfect Action
  3542. #--------------------------------------------------------------------------
  3543. def target_reflect_action?(bullet, user)
  3544. return false unless bullet.action.reflectable
  3545. for i in $game_map.events.values
  3546. if i.tool_id > 0 and i.action.can_reflect and
  3547. i.tool_effect == "Barrier"# and i.action.user.battler.is_a?(self.battler)
  3548. bullet.action.user = self
  3549. bullet.action.hit_events = []
  3550. bullet.turn_back
  3551. return true
  3552. break
  3553. end
  3554. end
  3555. return false
  3556. end
  3557.  
  3558. #--------------------------------------------------------------------------
  3559. # ● Target State Invunerable
  3560. #--------------------------------------------------------------------------
  3561. def target_state_invunerable?(tar_invu)
  3562. if self.battler.state_invunerable
  3563. self.battler.damage = XAS_WORD::INVINCIBLE
  3564. self.battler.damage_pop = true
  3565. self.animation_id = XAS_ANIMATION::INVINCIBLE_ANIMATION_ID
  3566. self.battler.invunerable_duration = tar_invu
  3567. return true
  3568. end
  3569. return false
  3570. end
  3571.  
  3572. #--------------------------------------------------------------------------
  3573. # ● Execute Hit Effect
  3574. #--------------------------------------------------------------------------
  3575. def execute_hit_effect(attacker,skill, bullet , user, tar_invu)
  3576. shoot_effect_before_damage(skill, bullet, user)
  3577. execute_battler_skill_effect(attacker ,skill, user)
  3578. # if target_missed?(attacker) #MirEditNoMisses
  3579. # self.battler.invunerable_duration = 30
  3580. # return
  3581. # end
  3582. execute_damage_pop(attacker,skill)
  3583. shoot_effect_after_damage(skill, bullet, user) if can_damage_after_effect?
  3584. execute_state_effect(skill, user, bullet)
  3585. bullet.action.duration = 1 if remove_tool_after_hit?(skill, bullet, user)
  3586. self.battler.invunerable_duration = tar_invu
  3587. execute_blow_effect(skill,bullet) if can_blow_effect?
  3588. execute_animation(skill, bullet, user)
  3589. execute_tool_effects(skill, bullet , user)
  3590. end
  3591.  
  3592. #--------------------------------------------------------------------------
  3593. # ● Execute Tool Effects
  3594. #--------------------------------------------------------------------------
  3595. def execute_tool_effects(skill, bullet , user)
  3596. execute_sticky_effect(skill, bullet, user)
  3597. execute_bounce_effect(skill, bullet, user)
  3598. execute_hit_action_effect(skill, bullet, user)
  3599. end
  3600.  
  3601. #--------------------------------------------------------------------------
  3602. # ● Remove Tool After Hit?
  3603. #--------------------------------------------------------------------------
  3604. def remove_tool_after_hit?(skill, bullet, user)
  3605. return true if bullet.action.piercing == false
  3606. return false
  3607. end
  3608.  
  3609. #--------------------------------------------------------------------------
  3610. # ● Execute Battler Skill Effect
  3611. #--------------------------------------------------------------------------
  3612. def execute_battler_skill_effect(attacker ,skill, user)
  3613. self.battler.item_apply(attacker, skill)
  3614. end
  3615.  
  3616. #--------------------------------------------------------------------------
  3617. # ● Target Missed?
  3618. #--------------------------------------------------------------------------
  3619. def target_missed?(attacker)
  3620. if self.battler.result.missed
  3621. self.battler.damage = XAS_WORD::MISSED
  3622. self.battler.damage_pop = true
  3623. return true
  3624. end
  3625. if self.battler.result.evaded
  3626. self.battler.damage = XAS_WORD::EVADED
  3627. self.battler.damage_pop = true
  3628. return true
  3629. end
  3630. return false
  3631. end
  3632. #--------------------------------------------------------------------------
  3633. # ● Shoot Effect Before Damage
  3634. #--------------------------------------------------------------------------
  3635. def shoot_effect_before_damage(skill, bullet, user)
  3636. end
  3637.  
  3638. #--------------------------------------------------------------------------
  3639. # ● Shoot Effect After Damage
  3640. #--------------------------------------------------------------------------
  3641. def shoot_effect_after_damage(skill, bullet, user)
  3642. check_counter_attack(skill)
  3643. self.battler.passive = false
  3644. end
  3645.  
  3646. #--------------------------------------------------------------------------
  3647. # ● Shoot Effect After Damage
  3648. #--------------------------------------------------------------------------
  3649. def check_counter_attack(skill)
  3650. return if self.battler.is_a?(Game_Actor)
  3651. return if self.battler.counter_action[2] == false
  3652. return if self.battler.counter_action[1] > 0
  3653. counter = XAS_BA_ENEMY::COUNTER_ATTACK[self.battler.enemy_id]
  3654. if counter != nil
  3655. counter_action_id = counter[rand(counter.size)]
  3656. self.battler.counter_action[0] = counter_action_id
  3657. self.battler.counter_action[1] = 15
  3658. end
  3659. end
  3660.  
  3661. #--------------------------------------------------------------------------
  3662. # ● Execute Bounce Effect
  3663. #--------------------------------------------------------------------------
  3664. def execute_bounce_effect(skill, bullet, user)
  3665. return false if bullet.action.hit_bounce == false
  3666. bullet.bounce_direction
  3667. end
  3668.  
  3669. #--------------------------------------------------------------------------
  3670. # ● Execute Stick Effect
  3671. #--------------------------------------------------------------------------
  3672. def execute_sticky_effect(skill, bullet, user)
  3673. return unless bullet.action.sticky
  3674. return if bullet.temp_id != 0
  3675. bullet.pre_move_speed = bullet.move_speed
  3676. bullet.temp_id = self.id
  3677. end
  3678.  
  3679. #--------------------------------------------------------------------------
  3680. # ● Execute Hit Action Effect
  3681. #--------------------------------------------------------------------------
  3682. def execute_hit_action_effect(skill, bullet, user)
  3683. return if bullet.action.hit_action == 0
  3684. self.battler.invunerable_duration = 1
  3685. bullet.shoot(bullet.action.hit_action)
  3686. bullet.action.duration = 9
  3687. bullet.action.multi_hit = false
  3688. bullet.character_name = ""
  3689. bullet.x_pose_duration = 0
  3690. bullet.x_pose_name = ""
  3691. bullet.x_pose_original_name = ""
  3692. end
  3693.  
  3694. #--------------------------------------------------------------------------
  3695. # ● Can Damage Effect
  3696. #--------------------------------------------------------------------------
  3697. def can_damage_after_effect?
  3698. return false if self.battler.damage == nil
  3699. return false unless self.battler.damage.is_a?(Numeric)
  3700. return true
  3701. end
  3702.  
  3703. #--------------------------------------------------------------------------
  3704. # ● Execute State Effect
  3705. #--------------------------------------------------------------------------
  3706. def execute_state_effect(skill, user, bullet)
  3707. if user.battler.states.size != 0
  3708. for i in user.battler.states
  3709. execute_state_effect_user(skill, user, bullet,i)
  3710. end
  3711. end
  3712. if self.battler.states.size != 0
  3713. for i in self.battler.states
  3714. execute_state_effect_target(skill, user, bullet,i)
  3715. end
  3716. end
  3717. end
  3718.  
  3719. #--------------------------------------------------------------------------
  3720. # ● Execute State Effect User
  3721. #--------------------------------------------------------------------------
  3722. def execute_state_effect_user(skill, user, bullet,i)
  3723.  
  3724. end
  3725.  
  3726. #--------------------------------------------------------------------------
  3727. # ● Execute State Target
  3728. #--------------------------------------------------------------------------
  3729. def execute_state_effect_target(skill, user, bullet,i)
  3730. #Sleep
  3731. if self.battler.damage.is_a?(Numeric) and self.battler.damage > 0
  3732. if i.note =~ /<Sleep>/
  3733. self.battler.remove_state(i.id)
  3734. end
  3735. end
  3736. end
  3737.  
  3738. #--------------------------------------------------------------------------
  3739. # ● Execute Blow Effect
  3740. #--------------------------------------------------------------------------
  3741. def execute_blow_effect(skill,bullet)
  3742. if bullet.action.hit_hold_target and self.temp_id == 0
  3743. self.temp_id = bullet.id
  3744. self.pre_move_speed = self.move_speed
  3745. self.moveto(bullet.x, bullet.y)
  3746. end
  3747. $game_map.screen.start_shake(5, 5, 60) if bullet.action.hit_shake
  3748. p = bullet.action.blow_power.to_i
  3749. d = bullet.direction
  3750. return if self.battler.damage.to_i <= 0
  3751. return if p < 0
  3752. self.blow(d, p)
  3753. end
  3754.  
  3755. #--------------------------------------------------------------------------
  3756. # ● Execute Animation
  3757. #--------------------------------------------------------------------------
  3758. def execute_animation(skill, bullet, user)
  3759. self.animation_id = skill.animation_id
  3760. tool_animation = bullet.action.second_animation_id
  3761. user_animation = bullet.action.third_animation_id
  3762. bullet.animation_id = tool_animation if tool_animation != 0
  3763. user.animation_id = user_animation if user_animation != 0
  3764. end
  3765.  
  3766. #--------------------------------------------------------------------------
  3767. # ● Knock Back Disable
  3768. #--------------------------------------------------------------------------
  3769. def knock_back_disable
  3770. return false
  3771. end
  3772.  
  3773. #--------------------------------------------------------------------------
  3774. # ● Dead?
  3775. #--------------------------------------------------------------------------
  3776. def dead?
  3777. return self.battler == nil ? false : self.battler.dead?
  3778. end
  3779.  
  3780. end
  3781.  
  3782.  
  3783. #===============================================================================
  3784. # ■ XRXS_BattlerAttachment
  3785. #==============================================================================
  3786. module XRXS_BattlerAttachment
  3787.  
  3788. #--------------------------------------------------------------------------
  3789. # ● Shoot Target Shield
  3790. #--------------------------------------------------------------------------
  3791. def target_shield_enabled?(attacker, skill, bullet)
  3792. return false unless self.battler.shield
  3793. if bullet != nil
  3794. return false if bullet.action.ignore_guard
  3795. return true if face_direction?(bullet)
  3796. else
  3797. return false if attacker.battler.ignore_guard
  3798. return true if face_direction?(attacker)
  3799. end
  3800. return false
  3801. end
  3802.  
  3803. #--------------------------------------------------------------------------
  3804. # ● Can Blow Effect
  3805. #--------------------------------------------------------------------------
  3806. def can_blow_effect?
  3807. return false if self.battler.no_knockback
  3808. return false if $game_map.interpreter.running?
  3809. return true
  3810. end
  3811.  
  3812. #--------------------------------------------------------------------------
  3813. # ● Execute Guard Effect
  3814. #--------------------------------------------------------------------------
  3815. def execute_guard_effect(attacker, skill, bullet, inv, erase_bullet = true)
  3816. self.battler.invunerable_duration = inv
  3817. damage_pop(XAS_WORD::GUARD)
  3818. guard_animation_id = XAS_ANIMATION::GUARD_ANIMATION_ID
  3819. self.animation_id = guard_animation_id if guard_animation_id != 0
  3820. if bullet != nil
  3821. bullet.erase if erase_bullet
  3822. else
  3823. blow_reverse(attacker) unless attacker.battler.no_knockback
  3824. end
  3825. end
  3826.  
  3827. #--------------------------------------------------------------------------
  3828. # ● Blow Reverse
  3829. #--------------------------------------------------------------------------
  3830. def blow_reverse(attacker)
  3831. return if attacker.battler.no_knockback
  3832. case attacker.direction
  3833. when 2
  3834. d = 8
  3835. when 4
  3836. d = 6
  3837. when 6
  3838. d = 4
  3839. when 8
  3840. d = 2
  3841. end
  3842. attacker.jump(0,0)
  3843. attacker.blow(d,1)
  3844. end
  3845.  
  3846. #--------------------------------------------------------------------------
  3847. # ● Can Attack Effect
  3848. #--------------------------------------------------------------------------
  3849. def damage_pop(text)
  3850. return unless XAS_WORD::ENABLE_WORD
  3851. self.battler.damage = text
  3852. self.battler.damage_pop = true
  3853. end
  3854.  
  3855. #--------------------------------------------------------------------------
  3856. # ● Shd Direction?
  3857. #--------------------------------------------------------------------------
  3858. def face_direction?(attacker)
  3859. target = self.direction
  3860. case target
  3861. when 2
  3862. return true if attacker.direction == 8
  3863. when 4
  3864. return true if attacker.direction == 6
  3865. when 6
  3866. return true if attacker.direction == 4
  3867. when 8
  3868. return true if attacker.direction == 2
  3869. end
  3870. return false
  3871. end
  3872.  
  3873. #--------------------------------------------------------------------------
  3874. # ● Execute Damage Pop
  3875. #--------------------------------------------------------------------------
  3876. def execute_damage_pop(attacker,skill = nil)
  3877. if skill != nil
  3878. return if skill.note =~ /<No Damage Pop>/
  3879. if skill.damage.to_mp?
  3880. dam = self.battler.result.mp_damage
  3881. self.battler.damage_type = "Mp"
  3882. elsif skill.damage.to_hp?
  3883. dam = self.battler.result.hp_damage
  3884. #$game_variables[190] = self.battler.result.hp_damage #dam
  3885. self.battler.damage_type = "Critical" if self.battler.result.critical
  3886. end
  3887. if dam != nil
  3888. if skill.damage.drain? or skill.damage.drain?
  3889. attacker.damage = -dam
  3890. attacker.damage_type = self.battler.damage_type
  3891. attacker.damage_pop = true
  3892. end
  3893. self.battler.damage = dam
  3894. self.battler.damage_pop = true
  3895. end
  3896. else
  3897. if self.battler.result.hp_damage != nil
  3898. self.battler.damage = self.battler.result.hp_damage
  3899. self.battler.damage_type = "Critical" if self.battler.result.critical
  3900. self.battler.damage_pop = true
  3901. end
  3902. end
  3903. end
  3904.  
  3905. end
  3906.  
  3907.  
  3908.  
  3909. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  3910. #■ TOOL - EQUIP
  3911. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  3912.  
  3913.  
  3914. #==============================================================================
  3915. # ■ Window Skill List
  3916. #==============================================================================
  3917. class Window_SkillList < Window_Selectable
  3918.  
  3919. #--------------------------------------------------------------------------
  3920. # ● Process OK
  3921. #--------------------------------------------------------------------------
  3922. alias x_skill_process_ok process_ok
  3923. def process_ok
  3924. return if can_equip_skill_action?
  3925. x_skill_process_ok
  3926. end
  3927.  
  3928. #--------------------------------------------------------------------------
  3929. # ● Can Equip Skill Action
  3930. #--------------------------------------------------------------------------
  3931. def can_equip_skill_action?
  3932. return false if $game_party.in_battle
  3933. skill = @data[index]
  3934. if skill != nil and skill.note =~ /<Duration = (\d+)>/
  3935. @actor.skill_id = skill.id
  3936. Sound.play_equip
  3937. return true
  3938. end
  3939. return false
  3940. end
  3941.  
  3942. end
  3943.  
  3944. #==============================================================================
  3945. # ■ Window Item List
  3946. #==============================================================================
  3947. class Window_ItemList < Window_Selectable
  3948.  
  3949. #--------------------------------------------------------------------------
  3950. # ● Process OK
  3951. #--------------------------------------------------------------------------
  3952. alias x_item_process_ok process_ok
  3953. def process_ok
  3954. return if can_equip_item_action?
  3955. x_item_process_ok
  3956. end
  3957.  
  3958. #--------------------------------------------------------------------------
  3959. # ● Can Equip Item Action
  3960. #--------------------------------------------------------------------------
  3961. def can_equip_item_action?
  3962. return false if $game_party.in_battle
  3963. item = @data[index]
  3964. if item != nil and item.is_a?(RPG::Item) and
  3965. item.note =~ /<Action ID = (\d+)>/
  3966. actor = $game_party.members[0]
  3967. actor.item_id = item.id
  3968. Sound.play_equip
  3969. return true
  3970. end
  3971. return false
  3972. end
  3973.  
  3974. end
  3975.  
  3976.  
  3977.  
  3978. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  3979. #■ BATTLER - INITIALIZE
  3980. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  3981.  
  3982.  
  3983. #===============================================================================
  3984. # ■ Game Character
  3985. #==============================================================================
  3986. class Game_Character < Game_CharacterBase
  3987.  
  3988. #--------------------------------------------------------------------------
  3989. # ● Update Battler
  3990. #--------------------------------------------------------------------------
  3991. def update_battler
  3992. update_battler_pose
  3993. update_battler_parameters
  3994. update_battler_stop_movement
  3995. update_battler_knockbacking
  3996. update_battler_counter_action
  3997. unless self.battler.hp == 0
  3998. update_battler_cast_action
  3999. update_battler_move_speed if can_update_battler_move_speed?
  4000. update_battler_states_effect
  4001. update_battler_attacking
  4002. else
  4003. update_battler_defeat_process
  4004. end
  4005. end
  4006.  
  4007. end
  4008.  
  4009.  
  4010. #===============================================================================
  4011. # ■ Game Player
  4012. #===============================================================================
  4013. class Game_Player < Game_Character
  4014. include XRXS_BattlerAttachment
  4015.  
  4016. #--------------------------------------------------------------------------
  4017. # ● Battler
  4018. #--------------------------------------------------------------------------
  4019. def battler
  4020. return $game_party.members[0]
  4021. end
  4022.  
  4023. #--------------------------------------------------------------------------
  4024. # ● Refresh Interpreter Effect
  4025. #--------------------------------------------------------------------------
  4026. def refresh_interpreter_effect
  4027. $game_system.old_interpreter_running = $game_map.interpreter.running?
  4028. if $game_system.old_interpreter_running
  4029. $game_temp.reset_battler_time = 60 * 4
  4030. end
  4031. reset_battler_setting
  4032. end
  4033.  
  4034. #--------------------------------------------------------------------------
  4035. # ● Update Battler Setting Time
  4036. #--------------------------------------------------------------------------
  4037. def update_reset_battler_setting_time
  4038. return if $game_temp.reset_battler_time == 0
  4039. $game_temp.reset_battler_time -= 1
  4040. reset_battler_setting_running if $game_temp.reset_battler_time == 0
  4041. end
  4042.  
  4043. #--------------------------------------------------------------------------
  4044. # ● Update Battler Setting
  4045. #--------------------------------------------------------------------------
  4046. def reset_battler_setting
  4047. reset_player_parameters
  4048. for ally in $game_party.members
  4049. reset_members_parameters(ally)
  4050. end
  4051. for enemy in $game_map.events.values
  4052. reset_enemies_parameters(enemy) if enemy.battler != nil
  4053. end
  4054. $game_map.need_refresh = true
  4055. end
  4056.  
  4057. #--------------------------------------------------------------------------
  4058. # ● Update Battler Setting Running
  4059. #--------------------------------------------------------------------------
  4060. def reset_battler_setting_running
  4061. reset_player_parameters_running
  4062. for ally in $game_party.members
  4063. reset_members_parameters_running(ally)
  4064. end
  4065. for enemy in $game_map.events.values
  4066. reset_enemies_parameters(enemy) if enemy.battler != nil
  4067. end
  4068. $game_map.need_refresh = true
  4069. end
  4070.  
  4071. #--------------------------------------------------------------------------
  4072. # ● Reset Enemies Parameters
  4073. #--------------------------------------------------------------------------
  4074. def reset_enemies_parameters(enemy)
  4075. enemy.battler.cast_action[0] = 0
  4076. enemy.battler.cast_action[1] = 0
  4077. enemy.battler.cast_action[2] = 0
  4078. enemy.battler.cast_action[3] = 0
  4079. enemy.battler.cast_action[4] = 0
  4080. enemy.battler.counter_action[0] = 0
  4081. enemy.battler.counter_action[1] = 0
  4082. enemy.battler.counter_action[2] = true
  4083. enemy.battler.invunerable_duration = 0
  4084. enemy.knock_back_duration = nil
  4085. end
  4086.  
  4087. #--------------------------------------------------------------------------
  4088. # ● Reset Members Parameters
  4089. #--------------------------------------------------------------------------
  4090. def reset_members_parameters(ally)
  4091. ally.old_level = ally.level
  4092. ally.shield = false
  4093. ally.x_charge_action[0] = 0
  4094. ally.x_charge_action[1] = 0
  4095. ally.x_charge_action[2] = 0
  4096. ally.x_charge_action[3] = 0
  4097. ally.cast_action[0] = 0
  4098. ally.cast_action[1] = 0
  4099. ally.cast_action[2] = 0
  4100. ally.cast_action[3] = 0
  4101. ally.cast_action[4] = 0
  4102. ally.counter_action[0] = 0
  4103. ally.counter_action[1] = 0
  4104. ally.counter_action[2] = true
  4105. ally.invunerable_duration = 0
  4106. end
  4107.  
  4108. #--------------------------------------------------------------------------
  4109. # ● Reset Player Parameters
  4110. #--------------------------------------------------------------------------
  4111. def reset_player_parameters
  4112. make_pose("", 1) unless $game_player.action != nil
  4113. $game_temp.xas_target_time = 0
  4114. $game_temp.xas_target_shoot_id = 0
  4115. $game_temp.xas_target_x = 0
  4116. @knock_back_duration = nil
  4117. @dash_active = false
  4118. end
  4119.  
  4120.  
  4121. #--------------------------------------------------------------------------
  4122. # ● Reset Members Parameters Running
  4123. #--------------------------------------------------------------------------
  4124. def reset_members_parameters_running(ally)
  4125. ally.old_level = ally.level
  4126. ally.shield = false
  4127. unless ally.x_charge_action[1] > 0
  4128. ally.x_charge_action[0] = 0
  4129. ally.x_charge_action[1] = 0
  4130. ally.x_charge_action[2] = 0
  4131. ally.x_charge_action[3] = 0
  4132. end
  4133. unless ally.cast_action[1] > 0
  4134. ally.cast_action[0] = 0
  4135. ally.cast_action[1] = 0
  4136. ally.cast_action[2] = 0
  4137. ally.cast_action[3] = 0
  4138. ally.cast_action[4] = 0
  4139. end
  4140. ally.counter_action[0] = 0
  4141. ally.counter_action[1] = 0
  4142. ally.counter_action[2] = true
  4143. ally.invunerable_duration = 0
  4144. end
  4145.  
  4146. #--------------------------------------------------------------------------
  4147. # ● Reset Player Parameters Running
  4148. #--------------------------------------------------------------------------
  4149. def reset_player_parameters_running
  4150. $game_temp.xas_target_time = 0
  4151. $game_temp.xas_target_shoot_id = 0
  4152. $game_temp.xas_target_x = 0
  4153. @knock_back_duration = nil
  4154. @dash_active = false
  4155. end
  4156.  
  4157. end
  4158.  
  4159. #===============================================================================
  4160. # ■ Game Follower
  4161. #===============================================================================
  4162. class Game_Follower < Game_Character
  4163. include XRXS_BattlerAttachment
  4164.  
  4165. #--------------------------------------------------------------------------
  4166. # ● Battler
  4167. #--------------------------------------------------------------------------
  4168. def battler
  4169. return $game_party.members[@member_index]
  4170. end
  4171. end
  4172.  
  4173. #===============================================================================
  4174. # ■ Game Follower
  4175. #===============================================================================
  4176. class Game_Followers
  4177. include XRXS_BattlerAttachment
  4178.  
  4179. #--------------------------------------------------------------------------
  4180. # ● Battler
  4181. #--------------------------------------------------------------------------
  4182. def battler
  4183. return $game_party.members[@member_index]
  4184. end
  4185. end
  4186. #===============================================================================
  4187. # ■ Game_Vehicle
  4188. #===============================================================================
  4189. class Game_Vehicle < Game_Character
  4190. include XRXS_BattlerAttachment
  4191. attr_reader :collision_attack
  4192.  
  4193. #--------------------------------------------------------------------------
  4194. # ● Battler
  4195. #--------------------------------------------------------------------------
  4196. def battler
  4197. return @battler
  4198. end
  4199. end
  4200.  
  4201. #===============================================================================
  4202. # ■ Game Event
  4203. #===============================================================================
  4204. class Game_Event < Game_Character
  4205.  
  4206. include XRXS_BattlerAttachment
  4207.  
  4208. #--------------------------------------------------------------------------
  4209. # ● Battler
  4210. #--------------------------------------------------------------------------
  4211. def battler
  4212. return @battler
  4213. end
  4214.  
  4215. #--------------------------------------------------------------------------
  4216. # ● Battler?
  4217. #--------------------------------------------------------------------------
  4218. def battler?
  4219. return false if self.erased
  4220. return false if self.battler == nil
  4221. return false if self.dead?
  4222. return false if self.battler.no_damage_pop
  4223. return false if self.battler.invunerable
  4224. return true
  4225. end
  4226.  
  4227. #--------------------------------------------------------------------------
  4228. # ● Refresh
  4229. #--------------------------------------------------------------------------
  4230. alias xrxs64c_refresh refresh
  4231. def refresh
  4232. xrxs64c_refresh
  4233. self.battler_recheck
  4234. end
  4235.  
  4236. #--------------------------------------------------------------------------
  4237. # ● Battler Recheck
  4238. #--------------------------------------------------------------------------
  4239. def battler_recheck
  4240. return if @battler != nil
  4241. return if @page == nil
  4242. if self.name =~ /<Actor>/
  4243. actor = $game_party.members[0]
  4244. @battler = Game_Actor.new(actor.id)
  4245. return
  4246. else
  4247. @enemy_id = 0
  4248. if self.name =~ /<Enemy(\d+)>/i
  4249. @enemy_id = $1.to_i
  4250. end
  4251. return if @enemy_id <= 0
  4252. @battler = Game_Enemy.new(1, @enemy_id)
  4253. self.force_update = true if self.battler.sensor_range >= 15
  4254. end
  4255. end
  4256.  
  4257. #--------------------------------------------------------------------------
  4258. # ● Battler Recheck
  4259. #--------------------------------------------------------------------------
  4260. def enemy_id
  4261. return @enemy_id
  4262. end
  4263.  
  4264. #--------------------------------------------------------------------------
  4265. # ● body_size
  4266. #--------------------------------------------------------------------------
  4267. def body_size
  4268. if self.battler != nil
  4269. return self.battler.body_size
  4270. else
  4271. return 0
  4272. end
  4273. end
  4274.  
  4275. end
  4276.  
  4277.  
  4278. #===============================================================================
  4279. # ■ Game_Battler
  4280. #===============================================================================
  4281. class Game_Battler
  4282. attr_accessor :sensor_range
  4283. attr_accessor :body_size
  4284. attr_accessor :breath_effect
  4285. attr_accessor :breath_duration
  4286. attr_accessor :fast_breath_effect
  4287. attr_accessor :no_knockback
  4288. attr_accessor :passive
  4289. attr_accessor :attack_animation_id
  4290. attr_accessor :ignore_guard
  4291. attr_accessor :no_damage_pop
  4292.  
  4293. #--------------------------------------------------------------------------
  4294. # ● Initialize
  4295. #--------------------------------------------------------------------------
  4296. alias x_e_initialize initialize
  4297. def initialize
  4298. x_e_initialize
  4299. @sensor_range = 4
  4300. @body_size = 0
  4301. @breath_effect = false
  4302. @breath_duration = 0
  4303. @fast_breath_effect = false
  4304. @no_knockback = false
  4305. @passive = false
  4306. @attack_animation_id = 0
  4307. @ignore_guard = false
  4308. @no_damage_pop = false
  4309. end
  4310. end
  4311.  
  4312. #MIREDIT PlayerBreath
  4313. #class Game_Actor < Game_Battler
  4314. #
  4315. # def setup_actor_note()
  4316. # if $data_actors =~ /<Breath Effect>/
  4317. # @breath_effect = true
  4318. # end
  4319. # end
  4320. #end
  4321. #MIREDIT PlayerBreath
  4322.  
  4323. #===============================================================================
  4324. # ■ Game_Enemy
  4325. #===============================================================================
  4326. class Game_Enemy < Game_Battler
  4327.  
  4328. #--------------------------------------------------------------------------
  4329. # ● Initialize
  4330. #--------------------------------------------------------------------------
  4331. alias x_e2_initialize initialize
  4332. def initialize(index, enemy_id)
  4333. for i in 1...$data_system.elements.size #MirEditBlood
  4334. @e_object = true if $data_system.elements[i].index(XAS_BA_ENEMY::ENEMY_OBJECT) #MirEditBlood
  4335. @e_item = true if $data_system.elements[i].index(XAS_BA_ENEMY::ENEMY_ITEM) #MirEditBlood
  4336. end #MirEditBlood
  4337. x_e2_initialize(index, enemy_id)
  4338. enemy = $data_enemies[@enemy_id]
  4339. setup_enemy_note(enemy)
  4340. end
  4341.  
  4342. #--------------------------------------------------------------------------
  4343. # ● Setup X Note Elements
  4344. #--------------------------------------------------------------------------
  4345. def setup_enemy_note(enemy)
  4346. if enemy.note =~ /<Sensor Range = (\d+)>/
  4347. @sensor_range = $1.to_i
  4348. end
  4349. if enemy.note =~ /<Body Size = (\d+)>/
  4350. @body_size = $1.to_i
  4351. end
  4352. if enemy.note =~ /<Attack Animation = (\d+)>/
  4353. @attack_animation_id = $1.to_i
  4354. end
  4355. if enemy.note =~ /<Death Zoom = (\d+)>/
  4356. @death_zoom_effect = $1.to_i
  4357. end
  4358. if enemy.note =~ /<Enemy Type = (\d+)>/
  4359. @enemy_type = $1.to_i
  4360. end
  4361. if enemy.note =~ /<Knockback Duration = (\d+)>/
  4362. @knockback_duration = $1.to_i
  4363. end
  4364. if enemy.note =~ /<Ignore Guard>/
  4365. @ignore_shield = true
  4366. end
  4367. if enemy.note =~ /<Invunerable>/
  4368. @invunerable = true
  4369. end
  4370. if enemy.note =~ /<Breath Effect>/
  4371. @breath_effect = true
  4372. end
  4373. if enemy.note =~ /<Knockback Disable>/
  4374. @no_knockback = true
  4375. end
  4376. if enemy.note =~ /<Passive>/
  4377. @passive = true
  4378. end
  4379. if enemy.note =~ /<No Damage Pop>/
  4380. @no_damage_pop = true
  4381. end
  4382. invunerable_actions_ids = XAS_BA_ENEMY::INVUNERABLE_ACTIONS[@enemy_id]
  4383. if invunerable_actions_ids != nil
  4384. @invunerable_actions = invunerable_actions_ids
  4385. end
  4386. guard_directions_ids = XAS_BA_ENEMY::GUARD_DIRECTIONS[@enemy_id]
  4387. if guard_directions_ids != nil
  4388. @guard_directions = guard_directions_ids
  4389. end
  4390. end
  4391.  
  4392.  
  4393. end
  4394.  
  4395.  
  4396. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  4397. #■ BATTLER - EVENT SENSOR
  4398. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  4399.  
  4400.  
  4401. #===============================================================================
  4402. # ■ XRXS_Enemy_Sensor
  4403. #===============================================================================
  4404. module XRXS_EnemySensor
  4405.  
  4406. #--------------------------------------------------------------------------
  4407. # ● Update Sensor
  4408. #--------------------------------------------------------------------------
  4409. def update_sensor
  4410. if self.battler != nil and self.battler.sensor_range > 0
  4411. if $game_actors[1].equips.include?($data_armors[4]) || $game_actors[1].equips.include?($data_armors[14]) && $game_actors[1].equips.include?($data_armors[11])
  4412. sensor_area = self.battler.sensor_range-8
  4413. elsif $game_actors[1].equips.include?($data_armors[4]) || $game_actors[1].equips.include?($data_armors[12])
  4414. sensor_area = self.battler.sensor_range-3
  4415. elsif $game_actors[1].equips.include?($data_armors[11])
  4416. sensor_area = self.battler.sensor_range-5
  4417. else
  4418. sensor_area = self.battler.sensor_range
  4419. end #MirEditSensor
  4420.  
  4421. else
  4422. sensor_area = $game_variables[XAS_BA::DEFAULT_SENSOR_RANGE_VARIABLE_ID]
  4423. end
  4424. sensor_area = -1 if cancel_sensor?
  4425. distance = ($game_player.x - self.x).abs + ($game_player.y - self.y).abs
  4426. enable = (distance <= sensor_area)
  4427. key = [$game_map.map_id, self.id, XAS_BA::SENSOR_SELF_SWITCH]
  4428. last_enable = $game_self_switches[key]
  4429. last_enable = false if last_enable == nil
  4430. if enable != last_enable
  4431. touch_attack(false)
  4432. @collision_attack = false
  4433. @pattern = 0
  4434. @pattern_count = 0
  4435. $game_self_switches[key] = enable
  4436. self.refresh
  4437. end
  4438. end
  4439.  
  4440. #--------------------------------------------------------------------------
  4441. # ● Can Update Sensor
  4442. #--------------------------------------------------------------------------
  4443. def can_update_sensor?
  4444. return false if @sensor_enable == false
  4445. return false if self.dead?
  4446. return false if self.erased
  4447. return false if self.stop
  4448. return false if self.knockbacking?
  4449. return true
  4450. end
  4451.  
  4452. #--------------------------------------------------------------------------
  4453. # ● refresh_sensor
  4454. #--------------------------------------------------------------------------
  4455. def refresh_sensor
  4456. touch_attack(false)
  4457. key = [$game_map.map_id, self.id, XAS_BA::SENSOR_SELF_SWITCH]
  4458. $game_self_switches[key] = false
  4459. @pattern = 0
  4460. @pattern_count = 0
  4461. self.refresh
  4462. end
  4463.  
  4464. #--------------------------------------------------------------------------
  4465. # ● Cancel Sensor
  4466. #--------------------------------------------------------------------------
  4467. def cancel_sensor?
  4468. return false if self.battler == nil
  4469. return true if self.battler.passive
  4470. return false
  4471. end
  4472.  
  4473. end
  4474.  
  4475. #===============================================================================
  4476. # ■ Game Event
  4477. #===============================================================================
  4478. class Game_Event < Game_Character
  4479.  
  4480. attr_accessor :sensor_enable
  4481.  
  4482. #--------------------------------------------------------------------------
  4483. # ● Initialize
  4484. #--------------------------------------------------------------------------
  4485. alias x_sensor_initialize initialize
  4486. def initialize(map_id, event)
  4487. @sensor_enable = false
  4488. x_sensor_initialize(map_id, event)
  4489. end
  4490.  
  4491. #--------------------------------------------------------------------------
  4492. # ● Conditions Met
  4493. #--------------------------------------------------------------------------
  4494. alias x_sensor_conditions_met conditions_met?
  4495. def conditions_met?(page)
  4496. c = page.condition
  4497. if c.self_switch_ch == XAS_BA::SENSOR_SELF_SWITCH
  4498. @sensor_enable = true
  4499. end
  4500. x_sensor_conditions_met(page)
  4501. end
  4502. end
  4503.  
  4504. #===============================================================================
  4505. # ■ Game Event
  4506. #===============================================================================
  4507. class Game_Character < Game_CharacterBase
  4508. include XRXS_EnemySensor
  4509. end
  4510.  
  4511. #===============================================================================
  4512. # ■ Game Character
  4513. #===============================================================================
  4514. class Game_Character < Game_CharacterBase
  4515. attr_writer :opacity
  4516. end
  4517.  
  4518.  
  4519.  
  4520. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  4521. #■ BATTLER - ACTION
  4522. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  4523.  
  4524.  
  4525. #===============================================================================
  4526. # ■ Game Character
  4527. #==============================================================================
  4528. class Game_Character < Game_CharacterBase
  4529.  
  4530. #--------------------------------------------------------------------------
  4531. # ● Can Update Battler Move Speed
  4532. #--------------------------------------------------------------------------
  4533. def can_update_battler_move_speed?
  4534. return false if @temp_id > 0
  4535. return false if moving?
  4536. return true
  4537. end
  4538.  
  4539. #--------------------------------------------------------------------------
  4540. # ● Can Update Battler?
  4541. #--------------------------------------------------------------------------
  4542. def can_update_battler?
  4543. return false unless $game_system.xas_battle
  4544. return false if self.battler == nil
  4545. return false unless party_system?
  4546. return true
  4547. end
  4548.  
  4549. #--------------------------------------------------------------------------
  4550. # ● Party System
  4551. #--------------------------------------------------------------------------
  4552. def party_system?
  4553. return false if self.battler == nil
  4554. if $xas_party_system == nil and self.battler.is_a?(Game_Actor)
  4555. return false if self.battler.actor_id != $game_party.members[0].actor_id
  4556. end
  4557. return true
  4558. end
  4559.  
  4560. #--------------------------------------------------------------------------
  4561. # ● Reset Battler Temp
  4562. #--------------------------------------------------------------------------
  4563. def reset_battler_temp
  4564. reset_cast_temp
  4565. reset_charge_temp
  4566. end
  4567.  
  4568. #--------------------------------------------------------------------------
  4569. # ● Reset Charge Temp
  4570. #--------------------------------------------------------------------------
  4571. def reset_charge_temp
  4572. return if self.battler == nil
  4573. return if self.battler.is_a?(Game_Enemy)
  4574. self.battler.x_charge_action[0] = 0
  4575. self.battler.x_charge_action[1] = 0
  4576. self.battler.x_charge_action[2] = 0
  4577. self.battler.x_charge_action[3] = 0
  4578. end
  4579.  
  4580. #--------------------------------------------------------------------------
  4581. # ● Reset Battler Temp
  4582. #--------------------------------------------------------------------------
  4583. def reset_cast_temp
  4584. return if self.battler == nil
  4585. self.battler.cast_action[0] = 0
  4586. self.battler.cast_action[1] = 0
  4587. self.battler.cast_action[2] = 0
  4588. self.battler.cast_action[3] = 0
  4589. self.battler.cast_action[4] = 0
  4590. end
  4591.  
  4592. #--------------------------------------------------------------------------
  4593. # ● update_battler_parameters
  4594. #--------------------------------------------------------------------------
  4595. def update_battler_parameters
  4596. @stop_count = -1 if can_stop_battler?
  4597. self.battler.invunerable_duration -= 1 if self.battler.invunerable_duration > 0
  4598. unless @stop
  4599. @knock_back_duration = 30 if @temp_id > 0
  4600. end
  4601. end
  4602.  
  4603. #--------------------------------------------------------------------------
  4604. # ● Can Stop Battler
  4605. #--------------------------------------------------------------------------
  4606. def can_stop_battler?
  4607. return false if self.is_a?(Game_Player)
  4608. return true if self.knockbacking?
  4609. return true if self.dead?
  4610. return true if self.stop
  4611. return false
  4612. end
  4613.  
  4614. #--------------------------------------------------------------------------
  4615. # ● Update Battler Counter Action
  4616. #--------------------------------------------------------------------------
  4617. def update_battler_counter_action
  4618. return if self.battler.counter_action[1] == 0
  4619. self.battler.counter_action[1] -= 1
  4620. if self.battler.counter_action[1] == 0
  4621. turn_toward_player
  4622. self.battler.damage = XAS_WORD::COUNTER
  4623. self.battler.damage_pop = true
  4624. self.shoot(self.battler.counter_action[0])
  4625. self.battler.counter_action[0] = 0
  4626. end
  4627. end
  4628.  
  4629. #--------------------------------------------------------------------------
  4630. # ● Update Cast Action
  4631. #--------------------------------------------------------------------------
  4632. def update_battler_cast_action
  4633. return unless can_update_cast_action?
  4634. self.battler.cast_action[3] += 1
  4635. if self.battler.cast_action[3] > XAS_ANIMATION::LOOP_ANIMATIONS_SPEED
  4636. self.battler.cast_action[3] = 0
  4637. self.animation_id = self.battler.cast_action[2]
  4638. end
  4639. self.battler.cast_action[4] += 1
  4640. if self.battler.cast_action[4] >= self.battler.cast_action[1]
  4641. self.shoot(self.battler.cast_action[0])
  4642. end
  4643. end
  4644.  
  4645. #--------------------------------------------------------------------------
  4646. # ● Can Update Cast Action
  4647. #--------------------------------------------------------------------------
  4648. def can_update_cast_action?
  4649. return false if self.battler.cast_action[1] == 0
  4650. return false if @stop
  4651. return true
  4652. end
  4653.  
  4654. #--------------------------------------------------------------------------
  4655. # ● Can Blow Effect
  4656. #--------------------------------------------------------------------------
  4657. def can_blow?
  4658. return false if self.stop and not self.battler.state_sleep
  4659. return false if self.battler.no_knockback
  4660. return false if self.is_a?(Game_Player) and self.action != nil
  4661. return true
  4662. end
  4663.  
  4664. #--------------------------------------------------------------------------
  4665. # ● Blow Effect
  4666. #--------------------------------------------------------------------------
  4667. def blow(d, power = 1)
  4668. return unless can_blow?
  4669. jump(0,0)
  4670. self.battler.invunerable_duration = 30 if self.battler.invunerable_duration <= 0
  4671. if self.is_a?(Game_Event)
  4672. @collision_attack = false
  4673. end
  4674. @knock_back_duration = self.battler.knockback_duration
  4675. refresh_sensor if self.is_a?(Game_Event)
  4676. pre_direction = self.direction
  4677. pre_direction_fix = self.direction_fix
  4678. self.turn_reverse(d)
  4679. self.direction_fix = true
  4680. power.times do
  4681. case d
  4682. when 2; @y += 1 if passable?(@x, @y, d)
  4683. when 4; @x -= 1 if passable?(@x, @y, d)
  4684. when 6; @x += 1 if passable?(@x, @y, d)
  4685. when 8; @y -= 1 if passable?(@x, @y, d)
  4686. end
  4687. end
  4688. self.direction_fix = pre_direction_fix
  4689. self.direction = pre_direction
  4690. end
  4691.  
  4692. #--------------------------------------------------------------------------
  4693. # ● Can Stop Battler Movement
  4694. #--------------------------------------------------------------------------
  4695. def can_stop_battler_movement?
  4696. return false if self.dead?
  4697. return true if self.battler.state_sleep
  4698. return true if self.battler.state_stop
  4699. return false
  4700. end
  4701.  
  4702. #--------------------------------------------------------------------------
  4703. # ● Impact
  4704. #--------------------------------------------------------------------------
  4705. def impact(enable = true)
  4706. return if self.tool_id == 0
  4707. return if self.action == nil
  4708. self.action.impact = enable
  4709. end
  4710.  
  4711. #--------------------------------------------------------------------------
  4712. # ● Update Battler Stop Movement
  4713. #--------------------------------------------------------------------------
  4714. def update_battler_stop_movement
  4715. unless can_stop_battler_movement?
  4716. @stop = false
  4717. return
  4718. end
  4719. @knock_back_duration = nil
  4720. @stop = true
  4721. @step_anime = false
  4722. reset_battler_temp
  4723. if self.battler.state_sleep
  4724. make_pose("_Hit", 2)
  4725. else
  4726. make_pose("", 2)
  4727. end
  4728. if self.is_a?(Game_Event)
  4729. @collision_attack = false
  4730. end
  4731. end
  4732.  
  4733. #--------------------------------------------------------------------------
  4734. # ● Update Attacking
  4735. #--------------------------------------------------------------------------
  4736. def update_battler_attacking
  4737. return unless can_update_attacking?
  4738. make_pose("_Atk", 2)
  4739. end
  4740.  
  4741. #--------------------------------------------------------------------------
  4742. # ● Can Update Attacking
  4743. #--------------------------------------------------------------------------
  4744. def can_update_attacking?
  4745. return false if self.battler.is_a?(Game_Actor)
  4746. return false if @collision_attack == false
  4747. return true
  4748. end
  4749.  
  4750. #--------------------------------------------------------------------------
  4751. # ● Update Battler Knobacking
  4752. #--------------------------------------------------------------------------
  4753. def update_battler_knockbacking
  4754. return unless self.knockbacking?
  4755. @pattern = 0
  4756. @knock_back_duration -= 1 if can_remove_knockback?
  4757. make_pose("_Hit", 2)
  4758. if self.is_a?(Game_Event)
  4759. @collision_attack = false
  4760. end
  4761. if @knock_back_duration <= 0
  4762. @knock_back_duration = nil
  4763. make_pose("", 0)
  4764. touch_attack(false) if self.is_a?(Game_Event)
  4765. @character_name = @x_pose_original_name
  4766. end
  4767. end
  4768.  
  4769. #--------------------------------------------------------------------------
  4770. # ● Can Remove Knockback
  4771. #--------------------------------------------------------------------------
  4772. def can_remove_knockback?
  4773. return true
  4774. end
  4775.  
  4776. #--------------------------------------------------------------------------
  4777. # ● knockbacking?
  4778. #--------------------------------------------------------------------------
  4779. def knockbacking?
  4780. return false if self.battler == nil
  4781. return false if @stop
  4782. return true if @knock_back_duration != nil
  4783. return false
  4784. end
  4785.  
  4786. #--------------------------------------------------------------------------
  4787. # ● collapsing?
  4788. #--------------------------------------------------------------------------
  4789. def collapsing?
  4790. return self.collapse_duration.to_i > 0
  4791. end
  4792.  
  4793. #--------------------------------------------------------------------------
  4794. # ● Seal Effect
  4795. #--------------------------------------------------------------------------
  4796. def seal_effect
  4797. Sound.play_buzzer
  4798. if XAS_WORD::ENABLE_WORD
  4799. self.battler.damage = XAS_WORD::SEAL
  4800. self.battler.damage_pop = true
  4801. end
  4802. end
  4803.  
  4804. end
  4805.  
  4806. #===============================================================================
  4807. # ■ XAS_DamageStop
  4808. #===============================================================================
  4809. module XAS_DamageStop
  4810.  
  4811. #--------------------------------------------------------------------------
  4812. # ● Acting
  4813. #--------------------------------------------------------------------------
  4814. def acting?
  4815. return (super or self.knockbacking? or self.collapsing? or self.stop)
  4816. end
  4817. end
  4818.  
  4819. #===============================================================================
  4820. # ■ Game_Player
  4821. #===============================================================================
  4822. class Game_Player < Game_Character
  4823. include XAS_DamageStop
  4824. end
  4825.  
  4826. #===============================================================================
  4827. # ■ Game_Event
  4828. #===============================================================================
  4829. class Game_Event < Game_Character
  4830. include XAS_DamageStop
  4831. end
  4832.  
  4833.  
  4834.  
  4835. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  4836. #■ BATTLER - TOUCH EFFECT
  4837. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  4838.  
  4839.  
  4840. #===============================================================================
  4841. # ■ XRXS_BattlerAttachment
  4842. #==============================================================================
  4843. module XRXS_BattlerAttachment
  4844.  
  4845. #--------------------------------------------------------------------------
  4846. # ● Attack Effect
  4847. #--------------------------------------------------------------------------
  4848. def attack_effect(attacker)
  4849. return false unless $game_system.xas_battle
  4850. return if self.battler == nil or attacker == nil
  4851. return unless can_attack_effect?(attacker)
  4852. if target_shield_enabled?(attacker, nil, nil)
  4853. execute_guard_effect(attacker, nil, nil, 30)
  4854. return
  4855. end
  4856. execute_attack_effect(attacker)
  4857. end
  4858.  
  4859. #--------------------------------------------------------------------------
  4860. # ● Can Attack Effect
  4861. #--------------------------------------------------------------------------
  4862. def can_attack_effect?(attacker)
  4863. return false if self.can_update == false
  4864. return false if @knock_back_duration != nil
  4865. return false if attacker.stop
  4866. return false if self.battler.invunerable
  4867. return false if self.battler.invunerable_duration > 0
  4868. return false if self.action != nil and self.action.user_invincible
  4869. return false if seal_attack?(attacker.battler)
  4870. return false if target_state_invunerable?(30)
  4871. return true
  4872. end
  4873.  
  4874. #--------------------------------------------------------------------------
  4875. # ● Attack Target Shield
  4876. #--------------------------------------------------------------------------
  4877. def attack_target_shield?(attacker)
  4878. return false if attacker.battler.ignore_shield
  4879. return false unless self.battler.shield
  4880. return true if face_direction?(attacker)
  4881. return false
  4882. end
  4883.  
  4884. #--------------------------------------------------------------------------
  4885. # ● Seal Attack?
  4886. #--------------------------------------------------------------------------
  4887. def seal_attack?(attacker)
  4888. if attacker.state_seal_attack or attacker.state_mute
  4889. attacker.damage = XAS_WORD::SEAL
  4890. attacker.damage_pop = true
  4891. self.battler.invunerable_duration = 30
  4892. return true
  4893. end
  4894. return false
  4895. end
  4896.  
  4897. #--------------------------------------------------------------------------
  4898. # ● Execute Attack Damage
  4899. #--------------------------------------------------------------------------
  4900. def execute_attack_damage(attacker)
  4901. #if self.battler.agi > (rand(attacker.battler.agi) * 2)
  4902. # self.battler.result.missed = true
  4903. # return
  4904. #end
  4905. damage = ((attacker.battler.atk * 4) - (self.battler.def * 2)).truncate
  4906. damage = 0 if damage < 0
  4907. self.battler.result.hp_damage = damage
  4908. #self.battler.result.critical
  4909. self.battler.hp -= damage.abs
  4910.  
  4911. end
  4912.  
  4913. #--------------------------------------------------------------------------
  4914. # ● Execute Attack Effect
  4915. #--------------------------------------------------------------------------
  4916. def execute_attack_effect(attacker)
  4917. execute_attack_effect_before_damage(attacker)
  4918. execute_attack_damage(attacker)
  4919. # if target_missed?(attacker) #Miredit NOMisses
  4920. # self.battler.invunerable_duration = 30
  4921. # return
  4922. # end
  4923. execute_damage_pop(attacker)
  4924. execute_attack_effect_after_damage(attacker) if can_check_after_attack_effect?(attacker)
  4925. execute_state_effect(nil, attacker, nil)
  4926. self.battler.invunerable_duration = 20 + XAS_BA::DEFAULT_KNOCK_BACK_DURATION
  4927. if attacker.battler.attack_animation_id != 0
  4928. self.animation_id = attacker.battler.attack_animation_id
  4929. end
  4930. if self.battler.damage.to_i > 0
  4931. self.blow(attacker.direction, 1) if can_blow_effect?
  4932. end
  4933. if self.is_a?(Game_Player)
  4934. self.need_refresh = true
  4935. end
  4936. end
  4937.  
  4938. #--------------------------------------------------------------------------
  4939. # ● Can Check After Attack Effect?
  4940. #--------------------------------------------------------------------------
  4941. def can_check_after_attack_effect?(attacker)
  4942. return false unless self.battler.damage.is_a?(Numeric)
  4943. return true
  4944. end
  4945.  
  4946. #--------------------------------------------------------------------------
  4947. # ● Execute Attack Effect Before Damage
  4948. #--------------------------------------------------------------------------
  4949. def execute_attack_effect_before_damage(attacker)
  4950.  
  4951. end
  4952.  
  4953. #--------------------------------------------------------------------------
  4954. # ● Execute Attack Effect After Damage
  4955. #--------------------------------------------------------------------------
  4956. def execute_attack_effect_after_damage(attacker)
  4957.  
  4958. end
  4959.  
  4960. end
  4961.  
  4962. #===============================================================================
  4963. # ■ Game Player
  4964. #===============================================================================
  4965. class Game_Player < Game_Character
  4966. #--------------------------------------------------------------------------
  4967. # ● Check Event Trigger Touch
  4968. #--------------------------------------------------------------------------
  4969. alias xrxs64c_check_event_trigger_touch check_event_trigger_touch
  4970. def check_event_trigger_touch(x, y)
  4971. xrxs64c_check_event_trigger_touch(x, y)
  4972. if $game_map.interpreter.running?
  4973. return
  4974. end
  4975. for event in $game_map.events.values
  4976. next unless event.collision_attack
  4977. unless [1,2].include?(event.trigger)
  4978. if event.battler != nil and event.x == x and event.y == y
  4979. $game_player.attack_effect(event)
  4980. end
  4981. end
  4982. end
  4983. end
  4984. end
  4985.  
  4986. #===============================================================================
  4987. # ■ Game Event
  4988. #===============================================================================
  4989. class Game_Event < Game_Character
  4990.  
  4991. #--------------------------------------------------------------------------
  4992. # ● Check Event Trigger Touch
  4993. #--------------------------------------------------------------------------
  4994. alias xrxs64c_check_event_trigger_touch check_event_trigger_touch
  4995. def check_event_trigger_touch(x, y)
  4996. xrxs64c_check_event_trigger_touch(x, y)
  4997. if $game_map.interpreter.running?
  4998. return
  4999. end
  5000. return unless self.collision_attack
  5001. if self.battler != nil and x == $game_player.x and y == $game_player.y
  5002. $game_player.attack_effect(self)
  5003. end
  5004. end
  5005. end
  5006.  
  5007.  
  5008.  
  5009. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  5010. #■ BATTLER - MOVE SPEED
  5011. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  5012.  
  5013.  
  5014. #==============================================================================
  5015. # ■ Game_Character
  5016. #==============================================================================
  5017. class Game_Character < Game_CharacterBase
  5018.  
  5019. include XAS_BA
  5020. attr_accessor :base_move_speed
  5021. attr_accessor :dash_move_speed
  5022. attr_accessor :move_speed
  5023.  
  5024. #--------------------------------------------------------------------------
  5025. # ● Initialize
  5026. #--------------------------------------------------------------------------
  5027. alias x_move_speed_initialize initialize
  5028. def initialize
  5029. @base_move_speed = BASE_MOVE_SPEED
  5030. @dash_move_speed = 0
  5031. x_move_speed_initialize
  5032. end
  5033.  
  5034. #--------------------------------------------------------------------------
  5035. # ● update_battler_move_speed
  5036. #--------------------------------------------------------------------------
  5037. def update_battler_move_speed
  5038. @dash_move_speed = @dash_active ? DASH_MOVE_SPEED : 0
  5039. sp1 = @base_move_speed
  5040. sp2 = @dash_move_speed
  5041. sp3 = self.battler.state_move_speed
  5042. @move_speed = (sp1 + sp2 + sp3)
  5043. end
  5044.  
  5045. #--------------------------------------------------------------------------
  5046. # ● Update Animation
  5047. #--------------------------------------------------------------------------
  5048. def update_animation
  5049. super
  5050. update_force_move_routine_move
  5051. end
  5052.  
  5053. #--------------------------------------------------------------------------
  5054. # ● Update Force Move Routine Move
  5055. #--------------------------------------------------------------------------
  5056. def update_force_move_routine_move
  5057. return if @force_action == ""
  5058. return if @move_route == nil
  5059. command = @move_route.list[@move_route_index]
  5060. return if command == nil
  5061. if command.code == ROUTE_PLAY_SE
  5062. params = command.parameters
  5063. params[0].play
  5064. advance_move_route_index
  5065. end
  5066. end
  5067.  
  5068. #--------------------------------------------------------------------------
  5069. # ● Update Routine Move
  5070. #--------------------------------------------------------------------------
  5071. alias x_update_routine_move update_routine_move
  5072. def update_routine_move
  5073. return if @force_action_times > 0
  5074. x_update_routine_move
  5075. end
  5076.  
  5077. #--------------------------------------------------------------------------
  5078. # ● Can Cancel Move Type Custom
  5079. #--------------------------------------------------------------------------
  5080. alias x_move_speed_process_move_command process_move_command
  5081. def process_move_command(command)
  5082. return if can_cancel_move_type_custom?(command)
  5083. params = command.parameters
  5084. x_move_speed_process_move_command(command)
  5085. if command.code == ROUTE_CHANGE_SPEED and @battler != nil and
  5086. self.is_a?(Game_Event)
  5087. @base_move_speed = params[0]
  5088. end
  5089. end
  5090.  
  5091. #--------------------------------------------------------------------------
  5092. # ● Can Cancel Move Type Custom
  5093. #--------------------------------------------------------------------------
  5094. def can_cancel_move_type_custom?(command)
  5095. return true if command == nil
  5096. return true if @force_action_times > 0
  5097. return false
  5098. end
  5099.  
  5100. end
  5101.  
  5102.  
  5103. #==============================================================================
  5104. # ■ Game_Event
  5105. #==============================================================================
  5106. class Game_Event < Game_Character
  5107.  
  5108. #--------------------------------------------------------------------------
  5109. # ● Initialize
  5110. #--------------------------------------------------------------------------
  5111. alias x_move_speed_event_initialize initialize
  5112. def initialize(map_id, event)
  5113. x_move_speed_event_initialize(map_id, event)
  5114. refresh_move_speed
  5115. end
  5116.  
  5117. #--------------------------------------------------------------------------
  5118. # ● Refresh Move Speed
  5119. #--------------------------------------------------------------------------
  5120. def refresh_move_speed
  5121. return if @page == nil
  5122. @base_move_speed = @page.move_speed
  5123. end
  5124.  
  5125. #--------------------------------------------------------------------------
  5126. # ● Setup Page
  5127. #--------------------------------------------------------------------------
  5128. alias x_move_speed_setup_page setup_page
  5129. def setup_page(new_page)
  5130. x_move_speed_setup_page(new_page)
  5131. refresh_move_speed
  5132. end
  5133.  
  5134. end
  5135.  
  5136.  
  5137. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  5138. #■ BATTLER - STATES
  5139. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  5140.  
  5141.  
  5142. #==============================================================================
  5143. # ■ Game_Battler
  5144. #==============================================================================
  5145. class Game_Battler
  5146.  
  5147. attr_accessor :state_move_speed
  5148. attr_accessor :state_stop
  5149. attr_accessor :state_loop_effect_time
  5150. attr_accessor :state_loop_speed
  5151. attr_accessor :state_duration
  5152. attr_accessor :state_string
  5153. attr_accessor :state_string_time
  5154. attr_accessor :state_stop
  5155. attr_accessor :state_slow
  5156. attr_accessor :state_sleep
  5157. attr_accessor :state_invunerable
  5158. attr_accessor :state_fast
  5159. attr_accessor :state_mute
  5160. attr_accessor :state_seal_attack
  5161. attr_accessor :state_seal_skill
  5162. attr_accessor :state_seal_item
  5163. attr_accessor :state_reflect
  5164.  
  5165. #--------------------------------------------------------------------------
  5166. # ● Initialize
  5167. #--------------------------------------------------------------------------
  5168. alias x_state_initialize initialize
  5169. def initialize
  5170. @state_move_speed = 0
  5171. @state_duration = []
  5172. @state_loop_effect_time = []
  5173. @state_loop_speed = []
  5174. @state_string = ""
  5175. @state_string_time = 0
  5176. @state_stop = false
  5177. @state_sleep = false
  5178. @state_invunerable = false
  5179. @state_slow = false
  5180. @state_fast = false
  5181. @state_mute = false
  5182. @state_seal_attack = false
  5183. @state_seal_skill = false
  5184. @state_seal_item = false
  5185. @state_reflect = false
  5186. x_state_initialize
  5187. end
  5188.  
  5189. #--------------------------------------------------------------------------
  5190. # ● Add State
  5191. #--------------------------------------------------------------------------
  5192. alias x_add_state add_state
  5193. def add_state(state_id)
  5194. unless @states.include?(state_id)
  5195. state = $data_states[state_id]
  5196. xas_add_state(state)
  5197. end
  5198. x_add_state(state_id)
  5199. end
  5200.  
  5201. #--------------------------------------------------------------------------
  5202. # ● Xas Add State
  5203. #--------------------------------------------------------------------------
  5204. def xas_add_state(state)
  5205. @state_duration[state.id] = 60 * $data_states[state.id].min_turns
  5206. @state_loop_effect_time[state.id] = 0
  5207. @state_loop_speed[state.id] = $data_states[state.id].max_turns
  5208. execute_damage_state(state,0)
  5209. end
  5210.  
  5211. #--------------------------------------------------------------------------
  5212. # ● Remove State
  5213. #--------------------------------------------------------------------------
  5214. alias x_remove_state remove_state
  5215. def remove_state(state_id)
  5216. if state?(state_id)
  5217. state = $data_states[state_id]
  5218. xas_remove_state(state)
  5219. end
  5220. x_remove_state(state_id)
  5221. end
  5222.  
  5223. #--------------------------------------------------------------------------
  5224. # ● XAS Remove State
  5225. #--------------------------------------------------------------------------
  5226. def xas_remove_state(state)
  5227. @state_duration.delete(state.id)
  5228. @state_loop_effect_time.delete(state.id)
  5229. @state_loop_speed.delete(state.id)
  5230. execute_damage_state(state,1)
  5231. end
  5232.  
  5233. #--------------------------------------------------------------------------
  5234. # ● Execute_Damage_State
  5235. #--------------------------------------------------------------------------
  5236. def execute_damage_state(state,type)
  5237. return unless XAS_DAMAGE_POP::DAMAGE_STATE_POP
  5238. return unless XAS_WORD::ENABLE_WORD
  5239. return if state == nil or state.id == 1
  5240. case type
  5241. when 0
  5242. damage = "+ " + state.name.to_s
  5243. when 1
  5244. damage = "- " + state.name.to_s
  5245. end
  5246. @state_string = damage
  5247. @state_string_time = 30
  5248. end
  5249.  
  5250. end
  5251.  
  5252. #==============================================================================
  5253. # ■ Game_Character
  5254. #==============================================================================
  5255. class Game_Character < Game_CharacterBase
  5256.  
  5257. #--------------------------------------------------------------------------
  5258. # ● Update Battler States Effect
  5259. #--------------------------------------------------------------------------
  5260. def update_battler_states_effect
  5261. return unless XAS_SYSTEM::STATE_SYSTEM
  5262. update_state_string_pop
  5263. update_pre_state_setup
  5264. return unless can_update_states_effect?
  5265. for i in self.battler.states
  5266. state = $data_states[i.id]
  5267. if state == nil or self.battler.state_duration[state.id] == nil or
  5268. self.battler.state_loop_effect_time[state.id] == nil or
  5269. self.battler.state_loop_speed[state.id] == nil
  5270. self.battler.remove_state(state.id)
  5271. next
  5272. return
  5273. end
  5274. update_state_abs_effects(state)
  5275. update_state_loop(state)
  5276. update_remove_state(state)
  5277. end
  5278.  
  5279. end
  5280.  
  5281. #--------------------------------------------------------------------------
  5282. # ● Update Pre State Setup
  5283. #--------------------------------------------------------------------------
  5284. def update_pre_state_setup
  5285. self.battler.state_stop = false
  5286. self.battler.state_slow = false
  5287. self.battler.state_fast = false
  5288. self.battler.state_mute = false
  5289. self.battler.state_sleep = false
  5290. self.battler.state_invunerable = false
  5291. self.battler.state_seal_attack = false
  5292. self.battler.state_seal_skill = false
  5293. self.battler.state_seal_item = false
  5294. self.battler.state_reflect = false
  5295. self.battler.state_move_speed = 0
  5296. end
  5297.  
  5298. #--------------------------------------------------------------------------
  5299. # ● Update Pre State Setup
  5300. #--------------------------------------------------------------------------
  5301. def update_state_abs_effects(state)
  5302. if state.note =~ /<Stop>/
  5303. self.battler.state_stop = true
  5304. end
  5305. if state.note =~ /<Slow>/
  5306. self.battler.state_slow = true
  5307. self.battler.state_move_speed = -1.5
  5308. end
  5309. if state.note =~ /<Fast>/
  5310. self.battler.state_fast = true
  5311. self.battler.state_move_speed = 0.5 #used to be 1.0 MirEdit
  5312. end
  5313. if self.battler.state_fast and
  5314. self.battler.state_slow
  5315. self.battler.state_move_speed = 0
  5316. end
  5317. if state.note =~ /<Mute>/
  5318. self.battler.state_mute = true
  5319. end
  5320. if state.note =~ /<Sleep>/
  5321. self.battler.state_sleep = true
  5322. end
  5323. if state.note =~ /<Invincible>/
  5324. self.battler.state_invunerable = true
  5325. end
  5326. if state.note =~ /<Seal Attack>/
  5327. self.battler.state_seal_attack = true
  5328. end
  5329. if state.note =~ /<Seal Skill>/
  5330. self.battler.state_seal_skill = true
  5331. end
  5332. if state.note =~ /<Seal Item>/
  5333. self.battler.state_seal_item = true
  5334. end
  5335. if state.note =~ /<Reflect>/
  5336. self.battler.state_reflect = true
  5337. end
  5338. end
  5339.  
  5340. #--------------------------------------------------------------------------
  5341. # ● Update State Loop
  5342. #--------------------------------------------------------------------------
  5343. def update_state_loop(state)
  5344. self.battler.state_loop_effect_time[state.id] += 1
  5345. if self.battler.state_loop_effect_time[state.id] > self.battler.state_loop_speed[state.id]
  5346. self.battler.state_loop_effect_time[state.id] = 0
  5347. if state.note =~ /<Animation ID = (\d+)>/
  5348. state_anime = $1.to_i
  5349. if state_anime != nil
  5350. self.animation_id = state_anime
  5351. end
  5352. end
  5353. execute_states_effects(state)
  5354. end
  5355. end
  5356.  
  5357. #--------------------------------------------------------------------------
  5358. # ● Execute States Effect
  5359. #--------------------------------------------------------------------------
  5360. def execute_states_effects(state)
  5361. if state.note =~ /<Slip Damage = (\S+)>/
  5362. execute_state_slip_damage($1.to_i)
  5363. end
  5364. end
  5365.  
  5366. #--------------------------------------------------------------------------
  5367. # ● Execute States Slip Damage
  5368. #--------------------------------------------------------------------------
  5369. def execute_state_slip_damage(damage)
  5370. damage = 1 if damage == nil
  5371. damage_slip = self.battler.mhp * damage / 100
  5372. self.battler.hp -= damage_slip
  5373. self.battler.damage = damage_slip
  5374. self.battler.damage_pop = true
  5375. end
  5376.  
  5377. #--------------------------------------------------------------------------
  5378. # ● Update Remove State
  5379. #--------------------------------------------------------------------------
  5380. def update_remove_state(state)
  5381. self.battler.state_duration[state.id] -= 1
  5382. if self.battler.state_duration[state.id] <= 0
  5383. self.battler.remove_state(state.id)
  5384. end
  5385. end
  5386.  
  5387. #--------------------------------------------------------------------------
  5388. # ● Can Update States Effect
  5389. #--------------------------------------------------------------------------
  5390. def can_update_states_effect?
  5391. return false if self.dead?
  5392. return false if self.battler.states == nil
  5393. return false if self.battler.states.size == 0
  5394. return false if self.battler.state_duration == []
  5395. return true
  5396. end
  5397.  
  5398. #--------------------------------------------------------------------------
  5399. # ● Update State String Pop
  5400. #--------------------------------------------------------------------------
  5401. def update_state_string_pop
  5402. return false if self.battler.state_string_time == 0
  5403. self.battler.state_string_time -= 1
  5404. if self.battler.state_string_time == 0
  5405. self.battler.damage = self.battler.state_string
  5406. self.battler.damage_pop = true
  5407. self.battler.state_string = ""
  5408. end
  5409. end
  5410. end
  5411.  
  5412. #==============================================================================
  5413. # ■ Game_Party
  5414. #==============================================================================
  5415. class Game_Party < Game_Unit
  5416.  
  5417. #--------------------------------------------------------------------------
  5418. # ● On Player Walk
  5419. #--------------------------------------------------------------------------
  5420. alias x_state_on_player_walk on_player_walk
  5421. def on_player_walk
  5422. return if XAS_SYSTEM::STATE_SYSTEM
  5423. x_state_on_player_walk
  5424. end
  5425.  
  5426. end
  5427.  
  5428.  
  5429.  
  5430. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  5431. #■ BATTLER - EVENT COMMANDS
  5432. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  5433.  
  5434.  
  5435. #===============================================================================
  5436. # ■ Game Event
  5437. #===============================================================================
  5438. class Game_Event < Game_Character
  5439.  
  5440. #--------------------------------------------------------------------------
  5441. # ● Shoot Chance
  5442. #--------------------------------------------------------------------------
  5443. def shoot_chance(action_id,perc)
  5444. return if self.battler == nil
  5445. if perc >= rand(100)
  5446. shoot(action_id)
  5447. end
  5448. end
  5449.  
  5450. #--------------------------------------------------------------------------
  5451. # ● Guard
  5452. #--------------------------------------------------------------------------
  5453. def guard(enable)
  5454. return if self.battler == nil
  5455. self.battler.guard = enable
  5456. end
  5457.  
  5458. #--------------------------------------------------------------------------
  5459. # ● Touch Attack
  5460. #--------------------------------------------------------------------------
  5461. def touch_attack(enable)
  5462. return if self.battler == nil
  5463. return if seal_attack?(self.battler)
  5464. @collision_attack = enable
  5465. @pattern = 0
  5466. @pattern_count = 0
  5467. end
  5468.  
  5469. #--------------------------------------------------------------------------
  5470. # ● Counter
  5471. #--------------------------------------------------------------------------
  5472. def counter(enable)
  5473. return if self.battler == nil
  5474. self.battler.counter_action[2] = enable
  5475. end
  5476.  
  5477. #--------------------------------------------------------------------------
  5478. # ● Rand Shoot
  5479. #--------------------------------------------------------------------------
  5480. def rand_shoot(random_id = [])
  5481. return if self.battler == nil
  5482. return if random_id == []
  5483. action_id = random_id[rand(random_id.size)]
  5484. self.shoot(action_id)
  5485. end
  5486.  
  5487. end
  5488.  
  5489.  
  5490.  
  5491. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  5492. #■ BATTLER - DEFEAT PROCESS
  5493. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  5494.  
  5495. #===============================================================================
  5496. # ■ Scene Base
  5497. #===============================================================================
  5498. class Scene_Base
  5499.  
  5500. #--------------------------------------------------------------------------
  5501. # ● Check Gameover
  5502. #--------------------------------------------------------------------------
  5503. def check_gameover
  5504. return unless $game_party.in_battle
  5505. SceneManager.goto(Scene_Gameover) if $game_party.all_dead?
  5506. end
  5507. end
  5508.  
  5509. #===============================================================================
  5510. # ■ Game Character
  5511. #===============================================================================
  5512. class Game_Character < Game_CharacterBase
  5513. attr_accessor :collapse_duration
  5514. attr_accessor :battler_visible
  5515. attr_writer :opacity
  5516.  
  5517. #--------------------------------------------------------------------------
  5518. # ● Initialize
  5519. #--------------------------------------------------------------------------
  5520. alias x_collapse_initialize initialize
  5521. def initialize
  5522. @collapse_duration = 0
  5523. x_collapse_initialize
  5524. end
  5525.  
  5526. end
  5527.  
  5528. #===============================================================================
  5529. # ■ XAS_BA_BATTLEEVENT_NONPREEMPT
  5530. #==============================================================================
  5531. module XAS_BA_BATTLEEVENT_NONPREEMPT
  5532.  
  5533. #--------------------------------------------------------------------------
  5534. # ● Update
  5535. #--------------------------------------------------------------------------
  5536. def update
  5537. return if self.battler != nil and $game_map.interpreter.running?
  5538. super
  5539. end
  5540. end
  5541.  
  5542. #===============================================================================
  5543. # ■ Game Event
  5544. #==============================================================================
  5545. class Game_Event < Game_Character
  5546. include XAS_BA_BATTLEEVENT_NONPREEMPT
  5547. end
  5548.  
  5549. #===============================================================================
  5550. # ■ Game Character
  5551. #===============================================================================
  5552. class Game_Character < Game_CharacterBase
  5553.  
  5554. #--------------------------------------------------------------------------
  5555. # ● Update Battler Defeat Process
  5556. #--------------------------------------------------------------------------
  5557. def update_battler_defeat_process
  5558. execute_enemy_defeated_process if can_check_enemy_defeated?
  5559. execute_actor_defeated_process if can_check_actor_defeated?
  5560. end
  5561.  
  5562. #--------------------------------------------------------------------------
  5563. # ● Can Check Enemy Defeated?
  5564. #--------------------------------------------------------------------------
  5565. def can_check_enemy_defeated?
  5566. return false if self.battler.is_a?(Game_Actor)
  5567. return false if self.battler.defeated
  5568. return true
  5569. end
  5570.  
  5571. #--------------------------------------------------------------------------
  5572. # ● Can Check Actor Defeated?
  5573. #--------------------------------------------------------------------------
  5574. def can_check_actor_defeated?
  5575. return false if self.battler.is_a?(Game_Enemy)
  5576. return false if self.battler.defeated
  5577. return false if $game_party.members[0].hp > 0
  5578. return false if @collapse_duration > 0
  5579. return true
  5580. end
  5581.  
  5582. #--------------------------------------------------------------------------
  5583. # ● Execute Actor Defeated Process
  5584. #--------------------------------------------------------------------------
  5585. def execute_actor_defeated_process
  5586. erase_actor_tools_on_map
  5587. if $game_party.all_dead? and not self.battler.defeated
  5588. self.battler.defeated = true
  5589. self.collapse_duration = 10 #used to be 30
  5590. self.knock_back_duration = 161
  5591. reset_battler_temp
  5592. else
  5593. $game_temp.change_leader_wait_time = 0
  5594. $game_player.change_leader
  5595. end
  5596. end
  5597.  
  5598. #--------------------------------------------------------------------------
  5599. # ● Erase Tools on Map
  5600. #--------------------------------------------------------------------------
  5601. def erase_actor_tools_on_map
  5602. for event in $game_map.events.values
  5603. if event.tool_id > 0 and event.action.user.is_a?(Game_Player)
  5604. event.erase
  5605. end
  5606. end
  5607. end
  5608.  
  5609. #--------------------------------------------------------------------------
  5610. # ● Execute Enemy Defeaed Process
  5611. #--------------------------------------------------------------------------
  5612. def execute_enemy_defeated_process
  5613. self.battler.defeated = true
  5614. self.through = true
  5615. @knock_back_duration = 121
  5616. enemy = $data_enemies[self.battler.enemy_id]
  5617. @collapse_duration = 30 #Then 30 #Used to be 120
  5618. execute_gain_exp_gold(enemy)
  5619. execute_active_switch(enemy)
  5620. execute_active_self_switch(enemy)
  5621. execute_defeated_animation(enemy)
  5622. execute_defeated_sound_effect(enemy)
  5623. execute_final_shoot(enemy)
  5624. end
  5625.  
  5626. #SelfSwitchActivation - MirEdit
  5627. def execute_active_self_switch(enemy)
  5628. enemy.note =~ /<Active Self Switch = (\d+)>/
  5629.  
  5630. sswitch_id = $1.to_i
  5631.  
  5632. if sswitch_id != nil
  5633. if sswitch_id == 1
  5634. $game_self_switches[[$game_map.map_id, self.id, "A"]] = true
  5635. $game_map.need_refresh = true
  5636.  
  5637. elsif sswitch_id == 2
  5638.  
  5639. $game_self_switches[[$game_map.map_id, self.id, "B"]] = true
  5640. $game_map.need_refresh = true
  5641.  
  5642. elsif sswitch_id == 3
  5643.  
  5644. $game_self_switches[[$game_map.map_id, self.id, "C"]] = true
  5645. $game_map.need_refresh = true
  5646. end
  5647. end
  5648. end
  5649.  
  5650. #--------------------------------------------------------------------------
  5651. # ● Execute Defeated Sound Effect
  5652. #--------------------------------------------------------------------------
  5653. def execute_defeated_sound_effect(enemy)
  5654. #MIR DEFEAT SOUND CHANGE!
  5655. return if self.battler.no_damage_pop
  5656. Sound.play_enemy_collapse
  5657. end
  5658.  
  5659. #--------------------------------------------------------------------------
  5660. # ● Execute Final Shoot
  5661. #--------------------------------------------------------------------------
  5662. def execute_final_shoot(enemy)
  5663. enemy.note =~ /<Final Action ID = (\d+)>/
  5664. action_id = $1.to_i
  5665. return if action_id == nil
  5666. self.shoot(action_id)
  5667. end
  5668.  
  5669. #--------------------------------------------------------------------------
  5670. # ● Execute Gain Exp Gold
  5671. #--------------------------------------------------------------------------
  5672. def execute_gain_exp_gold(enemy)
  5673. exp = self.battler.exp
  5674. case XAS_BA::EXP_TYPE
  5675. when 0
  5676. actor = $game_party.members[0]
  5677. actor.gain_exp(exp)
  5678. when 1
  5679. for i in 0...$game_party.members.size
  5680. actor = $game_party.members[i]
  5681. actor.gain_exp(exp)
  5682. end
  5683. when 2
  5684. exp = exp / $game_party.members.size
  5685. for i in 0...$game_party.members.size
  5686. actor = $game_party.members[i]
  5687. actor.gain_exp(exp)
  5688. end
  5689. end
  5690. $game_party.gain_gold(self.battler.gold)
  5691. end
  5692.  
  5693. #--------------------------------------------------------------------------
  5694. # ● Execute_Active Switch
  5695. #--------------------------------------------------------------------------
  5696. def execute_active_switch(enemy)
  5697. enemy.note =~ /<Active Switch = (\d+)>/
  5698. switch_id = $1.to_i
  5699. if switch_id != nil
  5700. $game_switches[switch_id] = true
  5701. $game_map.need_refresh = true
  5702. end
  5703. end
  5704.  
  5705. #--------------------------------------------------------------------------
  5706. # ● Execute Defeated Animation
  5707. #--------------------------------------------------------------------------
  5708. def execute_defeated_animation(enemy)
  5709. enemy.note =~ /<Defeated Animation = (\d+)>/
  5710. anime_id = $1.to_i
  5711. if anime_id != nil
  5712. self.animation_id = anime_id
  5713. end
  5714. end
  5715.  
  5716. end
  5717.  
  5718. #===============================================================================
  5719. # ■ Game Player
  5720. #===============================================================================
  5721. class Game_Player < Game_Character
  5722.  
  5723. #--------------------------------------------------------------------------
  5724. # ● Reset Old Level
  5725. #--------------------------------------------------------------------------
  5726. def reset_old_level(trans = false)
  5727. for actor in $game_party.members
  5728. actor.old_level = actor.level
  5729. end
  5730. end
  5731.  
  5732. #--------------------------------------------------------------------------
  5733. # ● Change Leader
  5734. #--------------------------------------------------------------------------
  5735. def change_leader
  5736. return if $game_party.members.size <= 1
  5737. reset_battler_temp
  5738. current_leader_id = $game_party.members[0].id
  5739. for i in 1..$game_party.members.size
  5740. pre_leader = $game_party.members[0].id
  5741. $game_party.remove_actor(pre_leader)
  5742. $game_party.add_actor(pre_leader)
  5743. if $game_party.members[0].hp > 0
  5744. execute_change_leader_effect unless current_leader_id == $game_party.members[0].id
  5745. break
  5746. end
  5747. end
  5748. end
  5749.  
  5750. #--------------------------------------------------------------------------
  5751. # ● Exeute Change leader Effect
  5752. #--------------------------------------------------------------------------
  5753. def execute_change_leader_effect
  5754. actor = $game_party.members[0]
  5755. actor.invunerable_duration = XAS_BA::CHANGE_LEADER_WAIT_TIME
  5756. actor.damage = nil
  5757. actor.damage_pop = false
  5758. actor.critical = false
  5759. @knock_back_duration = nil
  5760. if self.action != nil
  5761. self.action.duration = 1
  5762. end
  5763. @force_action_times = 0
  5764. @force_action_type = ""
  5765. reset_old_level(true)
  5766. @x_pose_original_name = @character_name
  5767. update_battler_pose
  5768. $game_map.need_refresh = true
  5769. self.animation_id = XAS_ANIMATION::CHANGE_LEADER_ANIMATION_ID
  5770. $game_temp.change_leader_wait_time = XAS_BA::CHANGE_LEADER_WAIT_TIME
  5771. end
  5772.  
  5773. #--------------------------------------------------------------------------
  5774. # ● Check Actor Level
  5775. #--------------------------------------------------------------------------
  5776. def check_actor_level
  5777. return if $game_party.in_battle
  5778. return if self.battler == nil
  5779. return if self.battler.old_level == self.battler.level
  5780. reset_old_level(false)
  5781. if self.battler.level > 1
  5782. Audio.se_play("Audio/SE/" + XAS_SOUND::LEVEL_UP , 100, 100)
  5783. if XAS_WORD::ENABLE_WORD
  5784. $game_player.battler.damage = XAS_WORD::LEVEL_UP
  5785. $game_player.battler.damage_pop = true
  5786. end
  5787. end
  5788. $game_player.need_refresh = true
  5789. end
  5790. end
  5791.  
  5792. #===============================================================================
  5793. # ■ Game Party
  5794. #===============================================================================
  5795. class Game_Party < Game_Unit
  5796.  
  5797. #--------------------------------------------------------------------------
  5798. # ● Setup Starting Members
  5799. #--------------------------------------------------------------------------
  5800. alias x_old_level_setup_starting_members setup_starting_members
  5801. def setup_starting_members
  5802. x_old_level_setup_starting_members
  5803. for actor in $game_party.members
  5804. actor.old_level = actor.level
  5805. end
  5806. end
  5807.  
  5808. end
  5809.  
  5810. #===============================================================================
  5811. # ■ Sprite Character
  5812. #==============================================================================
  5813. class Sprite_Character < Sprite_Base
  5814.  
  5815. #--------------------------------------------------------------------------
  5816. # ● Update Collapse Effects
  5817. #--------------------------------------------------------------------------
  5818. def update_collaspse_effects
  5819. update_collapse_duration
  5820. return unless can_collapse_effects?
  5821. update_collpase_zoom_effects
  5822. update_exp_gold_pop
  5823. end
  5824.  
  5825. #--------------------------------------------------------------------------
  5826. # ● Can Collapse Effects
  5827. #--------------------------------------------------------------------------
  5828. def can_collapse_effects?
  5829. return false if @character.battler.is_a?(Game_Actor)
  5830. return false unless @character.dead?
  5831. return false if @character.erased
  5832. return true
  5833. end
  5834.  
  5835. #--------------------------------------------------------------------------
  5836. # ● Update Exp Gold Pop
  5837. #--------------------------------------------------------------------------
  5838. def update_exp_gold_pop
  5839. return unless XAS_DAMAGE_POP::XAS_ITEMDROP
  5840. exp_pop = @character.battler.exp
  5841. case @character.collapse_duration
  5842. when 15
  5843. enemy = $data_enemies[@character.battler.enemy_id]
  5844. @character.make_treasure(enemy)
  5845. when 10
  5846. if exp_pop != 0
  5847. #word = XAS_WORD::EXP
  5848. #@character.battler.damage = word + " " + exp_pop.to_s
  5849. #@character.battler.damage_pop = true
  5850. #@character.battler.damage_type = "Exp"
  5851. end
  5852. when 5
  5853. if gold_pop != 0
  5854. #word = $data_system.currency_unit
  5855. #@character.battler.damage = word + " " + gold_pop.to_s
  5856. #@character.battler.damage_pop = true
  5857. #@character.battler.damage_type = "Gold"
  5858. end
  5859. end
  5860. end
  5861.  
  5862. #--------------------------------------------------------------------------
  5863. # ● Update Collapse Duration
  5864. #--------------------------------------------------------------------------
  5865. def update_collapse_duration
  5866. @character.collapse_duration -= 1
  5867. @character.opacity -= 2
  5868. if @character.collapse_duration <= 0
  5869. if @character.battler.is_a?(Game_Actor)
  5870. SceneManager.goto(Scene_Gameover)
  5871. return
  5872. end
  5873. self.visible = false
  5874. @character.opacity = 0
  5875. @character.erase
  5876. end
  5877. end
  5878.  
  5879. #--------------------------------------------------------------------------
  5880. # ● Update Collapse Zoom Effects
  5881. #--------------------------------------------------------------------------
  5882. def update_collpase_zoom_effects
  5883. case @character.battler.death_zoom_effect
  5884. when 1
  5885. @character.zoom_y += 0.05
  5886. @character.zoom_x -= 0.01
  5887. when 2
  5888. @character.zoom_y -= 0.01
  5889. @character.zoom_x += 0.03
  5890. when 3
  5891. @character.zoom_y += 0.03
  5892. @character.zoom_x += 0.03
  5893. when 4
  5894. @character.zoom_y -= 0.005
  5895. @character.zoom_x -= 0.005
  5896. when 5
  5897. case @character.collapse_duration
  5898. when 60..120
  5899. @character.zoom_y -= 0.01
  5900. @character.zoom_x += 0.06
  5901. when 0..59
  5902. @character.zoom_y += 0.2
  5903. @character.zoom_x -= 0.1
  5904. end
  5905. end
  5906. end
  5907.  
  5908. end
  5909.  
  5910.  
  5911.  
  5912. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  5913. #■ BATTLER - TREASURE
  5914. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  5915.  
  5916.  
  5917. #===============================================================================
  5918. # ■ XAS_BA_Item_Drop
  5919. #==============================================================================
  5920. module XAS_BA_ItemDrop
  5921.  
  5922. #--------------------------------------------------------------------------
  5923. # ● Defeat Process
  5924. #--------------------------------------------------------------------------
  5925. def make_treasure(enemy)
  5926. treasure = nil
  5927. return unless $game_player.passable?(self.x,self.y,0)
  5928. for di in enemy.drop_items
  5929. next if di.kind == 0
  5930. next if rand(di.denominator) != 0
  5931. if di.kind == 1
  5932. treasure = $data_items[di.data_id]
  5933. tr_id = treasure.id
  5934. elsif di.kind == 2
  5935. treasure = $data_weapons[di.data_id]
  5936. tr_id = treasure.id
  5937. elsif di.kind == 3
  5938. treasure = $data_armors[di.data_id]
  5939. tr_id = treasure.id
  5940. end
  5941. break if treasure != nil
  5942. end
  5943. if treasure != nil
  5944. command = RPG::MoveCommand.new
  5945. command.code = 14
  5946. command.parameters = [0,0]
  5947. route = RPG::MoveRoute.new
  5948. route.repeat = false
  5949. route.list = [command, RPG::MoveCommand.new]
  5950. page = RPG::Event::Page.new
  5951. page.move_type = 3
  5952. page.move_route = route
  5953. page.move_frequency = 6
  5954. page.priority_type = 1
  5955. page.trigger = 1
  5956. page.through = true
  5957. event = RPG::Event.new(self.x, self.y)
  5958. event.pages = [page]
  5959. event = RPG::Event.new(self.x, self.y)
  5960. token = Token_Event.new($game_map.map_id, event)
  5961. token.icon_name = treasure.icon_index
  5962. token.treasure = [di.kind,tr_id]
  5963. token.treasure_time = 120 + XAS_BA::TREASURE_ERASE_TIME * 60
  5964. token.jump_high(0,0,20)
  5965. token.force_update = true
  5966. token.move_speed = 6
  5967. $game_map.add_token(token)
  5968. end
  5969. end
  5970. end
  5971.  
  5972. #===============================================================================
  5973. # ■ Game Event
  5974. #===============================================================================
  5975. class Game_Event < Game_Character
  5976. include XAS_BA_ItemDrop
  5977.  
  5978. #--------------------------------------------------------------------------
  5979. # ● Update Treasure Duration
  5980. #--------------------------------------------------------------------------
  5981. def update_treasure_duration
  5982. return if @treasure_time == 0
  5983. @treasure_time -= 1
  5984. self.erase if @treasure_time == 0
  5985. end
  5986.  
  5987. end
  5988.  
  5989. #===============================================================================
  5990. # ■ Game Character
  5991. #==============================================================================
  5992. class Game_Character < Game_CharacterBase
  5993. attr_accessor :icon_name
  5994. attr_accessor :treasure
  5995. end
  5996.  
  5997. #===============================================================================
  5998. # ■ Game Character
  5999. #==============================================================================
  6000. class Sprite_Character < Sprite_Base
  6001.  
  6002. #--------------------------------------------------------------------------
  6003. # ● Update
  6004. #--------------------------------------------------------------------------
  6005. alias xrxs_charactericon_update update
  6006. def update
  6007. xrxs_charactericon_update
  6008. if @character.icon_name != nil
  6009. self.bitmap = Cache.system("Iconset")
  6010. self.src_rect.set(@character.icon_name % 16 * 24, @character.icon_name / 16 * 24, 24, 24)
  6011. self.ox = 12
  6012. self.oy = 24
  6013. end
  6014. end
  6015. end
  6016.  
  6017. #===============================================================================
  6018. # ■ Game Player
  6019. #==============================================================================
  6020. class Game_Player < Game_Character
  6021.  
  6022. #--------------------------------------------------------------------------
  6023. # ● Check Event Trigger Here
  6024. #--------------------------------------------------------------------------
  6025. alias treasure_check_event_trigger_here check_event_trigger_here
  6026. def check_event_trigger_here(triggers)
  6027. return false if $game_map.interpreter.running?
  6028. check_treasure_here
  6029. treasure_check_event_trigger_here(triggers)
  6030. end
  6031.  
  6032. #--------------------------------------------------------------------------
  6033. # ● check_treasure_here
  6034. #--------------------------------------------------------------------------
  6035. def check_treasure_here
  6036. for event in $game_map.events_xy(@x, @y)
  6037. if event.treasure != nil
  6038. name_pop = true
  6039. case event.treasure[0]
  6040. when 1
  6041. item = $data_items[event.treasure[1]]
  6042. if can_execute_field_item_effect?(item)
  6043. name_pop = false
  6044. else
  6045. $game_party.gain_item(item, 1)
  6046. end
  6047. $game_map.need_refresh = true
  6048. when 2
  6049. item = $data_weapons[event.treasure[1]]
  6050. $game_party.gain_item($data_weapons[event.treasure[1]], 1,false)
  6051. when 3
  6052. item = $data_armors[event.treasure[1]]
  6053. $game_party.gain_item(item, 1,false)
  6054. end
  6055. Audio.se_play("Audio/SE/" + XAS_SOUND::ITEM_DROP , 100, 100)
  6056. event.erase
  6057. if item != nil
  6058. if item.note =~ /<Drop Animation = (\d+)>/
  6059. self.animation_id = $1.to_i
  6060. end
  6061. if XAS_DAMAGE_POP::DAMAGE_ITEM_POP and name_pop
  6062. self.battler.damage = item.name.to_s
  6063. self.battler.damage_pop = true
  6064. self.battler.damage_type = "Item"
  6065. end
  6066. end
  6067. end
  6068. end
  6069. end
  6070.  
  6071. #--------------------------------------------------------------------------
  6072. # ● Can Execute Field Item Effect
  6073. #--------------------------------------------------------------------------
  6074. def can_execute_field_item_effect?(item)
  6075. if item.note =~ /<Drop HP Damage = (\S+)>/
  6076. damage = $1.to_i
  6077. damage2 = damage * self.battler.mhp / 100
  6078. self.battler.damage = damage2
  6079. self.battler.damage_pop = true
  6080. self.battler.hp -= damage2
  6081. return true
  6082. end
  6083. if item.note =~ /<Drop MP Damage = (\S+)>/
  6084. damage = $1.to_i
  6085. damage2 = damage * self.battler.mmp / 100
  6086. self.battler.mp -= damage2
  6087. self.battler.damage_type = "Mp"
  6088. self.battler.damage = damage2
  6089. self.battler.damage_pop = true
  6090. return true
  6091. end
  6092. if item.note =~ /<Drop Gold = (\d+)>/
  6093. gold = $1.to_i
  6094. damage = $data_system.terms.gold + " " + gold.to_s
  6095. self.battler.damage = damage
  6096. self.battler.damage_pop = true
  6097. $game_party.gain_gold(gold)
  6098. return true
  6099. end
  6100. return false
  6101. end
  6102. end
  6103.  
  6104.  
  6105.  
  6106. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  6107. #■ SPRITE - POSE (Character Name)
  6108. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  6109.  
  6110.  
  6111. #===============================================================================
  6112. # ■ Game_Character
  6113. #===============================================================================
  6114. class Game_Character < Game_CharacterBase
  6115.  
  6116. attr_accessor :x_pose_duration
  6117. attr_accessor :x_pose_name
  6118. attr_accessor :x_pose_original_name
  6119. attr_accessor :character_name
  6120.  
  6121. #-----------------------------------------------------------------------------
  6122. # ● Initialize
  6123. #-----------------------------------------------------------------------------
  6124. alias x_pose_initialize initialize
  6125. def initialize
  6126. x_pose_initialize
  6127. @x_pose_duration = 0
  6128. @x_pose_name = ""
  6129. @x_pose_original_name = @character_name
  6130. end
  6131.  
  6132. #-----------------------------------------------------------------------------
  6133. # ● Update
  6134. #-----------------------------------------------------------------------------
  6135. def make_pose(sufix, pose_duration)
  6136. return if @x_pose_original_name == ""
  6137. @x_pose_name = sufix
  6138. @x_pose_duration = pose_duration
  6139. end
  6140.  
  6141. #-----------------------------------------------------------------------------
  6142. # ● Update Pose
  6143. #-----------------------------------------------------------------------------
  6144. def update_battler_pose
  6145. return false unless XAS_SYSTEM::CHARACTER_POSE_NAME
  6146. if @x_pose_duration == 0
  6147. @x_pose_original_name = @character_name
  6148. return
  6149. else
  6150. @x_pose_duration -= 1
  6151. @character_name = @x_pose_original_name + @x_pose_name
  6152. if @x_pose_duration == 0
  6153. @character_name = @x_pose_original_name
  6154. @x_pose_name = ""
  6155. end
  6156. end
  6157. unless jumping?
  6158. @jump_count = 0
  6159. @jump_peak = 0
  6160. end
  6161. end
  6162.  
  6163. #-----------------------------------------------------------------------------
  6164. # ● Set Graphic
  6165. #-----------------------------------------------------------------------------
  6166. alias x_pose_set_graphic set_graphic
  6167. def set_graphic(character_name, character_index)
  6168. x_pose_set_graphic(character_name, character_index)
  6169. @x_pose_original_name = @character_name
  6170. @x_pose_duration = 0
  6171. @x_pose_name = "" #Miredit
  6172. end
  6173.  
  6174. end
  6175.  
  6176.  
  6177. #===============================================================================
  6178. # ■ Game_Interpreter
  6179. #===============================================================================
  6180. class Game_Interpreter
  6181.  
  6182. #-----------------------------------------------------------------------------
  6183. # ● Command_322
  6184. #-----------------------------------------------------------------------------
  6185. alias x_pose_command_322 command_322
  6186. def command_322
  6187. x_pose_command_322
  6188. actor = $game_actors[@params[0]]
  6189. if actor != nil
  6190. $game_player.x_pose_duration = 0
  6191. $game_player.x_pose_original_name = @params[1]
  6192. end
  6193. end
  6194.  
  6195. end
  6196.  
  6197. #===============================================================================
  6198. # ■ RPG_FileTest
  6199. #===============================================================================
  6200. module RPG_FileTest
  6201.  
  6202. #--------------------------------------------------------------------------
  6203. # ● RPG_FileTest.character_exist?
  6204. #--------------------------------------------------------------------------
  6205. def RPG_FileTest.character_exist?(filename)
  6206. return Cache.character(filename) rescue return false
  6207. end
  6208.  
  6209. #--------------------------------------------------------------------------
  6210. # ● RPG_FileTest.system_exist?
  6211. #--------------------------------------------------------------------------
  6212. def RPG_FileTest.system_exist?(filename)
  6213. return Cache.system(filename) rescue return false
  6214. end
  6215.  
  6216. end
  6217.  
  6218. #===============================================================================
  6219. # ■ Sprite_Character
  6220. #===============================================================================
  6221. class Sprite_Character < Sprite_Base
  6222.  
  6223. #--------------------------------------------------------------------------
  6224. # ● X Pose Update
  6225. #--------------------------------------------------------------------------
  6226. alias x_pose_update_bitmap update_bitmap
  6227. def update_bitmap
  6228. check_file_exist
  6229. x_pose_update_bitmap
  6230. end
  6231.  
  6232. #--------------------------------------------------------------------------
  6233. # ● Check File Exist
  6234. #--------------------------------------------------------------------------
  6235. def check_file_exist
  6236. return if @character_name == @character.character_name
  6237. unless RPG_FileTest.character_exist?(@character.character_name)
  6238. @character.character_name = @character.x_pose_original_name
  6239. @character.x_pose_duration = 0
  6240. @character.x_pose_name = ""
  6241. end
  6242. end
  6243.  
  6244. end
  6245.  
  6246.  
  6247.  
  6248.  
  6249.  
  6250. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  6251. #■ SPRITE - DAMAGE SPRITE
  6252. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  6253.  
  6254.  
  6255. #===============================================================================
  6256. # ■ XRXS_DAMAGE_OFFSET
  6257. #===============================================================================
  6258. module XRXS_DAMAGE_OFFSET
  6259.  
  6260. #--------------------------------------------------------------------------
  6261. # ● Update
  6262. #--------------------------------------------------------------------------
  6263. def update
  6264. super
  6265. @damage_sprites = [] if @damage_sprites.nil?
  6266. for damage_sprite in @damage_sprites
  6267. damage_sprite.x = self.x
  6268. damage_sprite.y = self.y
  6269. end
  6270. end
  6271. end
  6272.  
  6273. #===============================================================================
  6274. # ■ Sprite_Character
  6275. #===============================================================================
  6276. class Sprite_Character < Sprite_Base
  6277. include XRXS_DAMAGE_OFFSET
  6278. end
  6279.  
  6280.  
  6281. #==============================================================================
  6282. # ■ Sprite Base
  6283. #==============================================================================
  6284. class Sprite_Base < Sprite
  6285. include XAS_DAMAGE_POP
  6286. #--------------------------------------------------------------------------
  6287. # ● Initialize
  6288. #--------------------------------------------------------------------------
  6289. alias x_damage_pop_initialize initialize
  6290. def initialize(viewport = nil)
  6291. @_damage_duration = 0
  6292. x_damage_pop_initialize(viewport)
  6293. end
  6294.  
  6295. #--------------------------------------------------------------------------
  6296. # ● Damage
  6297. #--------------------------------------------------------------------------
  6298. def damage(value, type = "")
  6299. dispose_damage
  6300. @damage_ox = 0
  6301. @damage_type = type
  6302. # NUMBER PICTURE
  6303. if value.is_a?(Numeric)
  6304. bitmap_number_image = Cache.system("XAS_Damage_Number")
  6305. bitmap_im_cw = bitmap_number_image.width / 10
  6306. bitmap_im_ch = bitmap_number_image.height / 5
  6307. bitmap = Bitmap.new(bitmap_number_image.width,(bitmap_im_ch * 2) + 5)
  6308. bitmap_number_text = value.to_s.split(//)
  6309. center_x = (((2 + bitmap_number_text.size) * bitmap_im_cw) / 2)
  6310. # Damage Color
  6311. if value >= 0
  6312. if @damage_type == "Critical"
  6313. h = bitmap_im_ch * 2
  6314. h2 = bitmap_im_ch * 4
  6315. $game_map.screen.start_shake(5, 5, 60)
  6316. elsif @damage_type == "Mp"
  6317. h = bitmap_im_ch * 0
  6318. h2 = bitmap_im_ch * 3
  6319. else
  6320. h = 0
  6321. end
  6322. f = 0
  6323. else # Recover Color
  6324. h = bitmap_im_ch
  6325. h2 = bitmap_im_ch * 3 if @damage_type == "Mp"
  6326. f = 1
  6327. end
  6328. for r in f..bitmap_number_text.size - 1
  6329. bitmap_number_abs = bitmap_number_text[r].to_i
  6330. bitmap_src_rect = Rect.new(bitmap_im_cw * bitmap_number_abs, h, bitmap_im_cw, bitmap_im_ch)
  6331. bitmap.blt(center_x + (bitmap_im_cw * r), bitmap_im_ch + 5, bitmap_number_image, bitmap_src_rect)
  6332. end
  6333. ex = (bitmap_im_cw / 2) * (bitmap_number_text.size + f)
  6334. @damage_ox = (bitmap_number_image.width - (bitmap_number_image.width / 2) - ex) - center_x
  6335. # Add Extra String (MP / Critical)
  6336. if h2 != nil
  6337. string_x = (center_x - (bitmap_number_image.width / 2) + (bitmap_im_cw / 2) * bitmap_number_text.size)
  6338. bitmap_src_rect = Rect.new(0, h2, bitmap_number_image.width, bitmap_im_ch)
  6339. bitmap.blt(string_x , 0, bitmap_number_image, bitmap_src_rect)
  6340. end
  6341. bitmap_number_image.dispose
  6342. else
  6343. #TEXT STRING
  6344. damage_string = value.to_s
  6345. bitmap = Bitmap.new(160, 48)
  6346. bitmap.font.name = DAMAGE_FONT_NAME
  6347. bitmap.font.size = DAMAGE_FONT_SIZE
  6348. bitmap.font.bold = DAMAGE_FONT_BOLD
  6349. bitmap.font.italic = DAMAGE_FONT_ITALIC
  6350. bitmap.font.color = Color.new(0,0,0)
  6351. bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
  6352. case @damage_type
  6353. when "Exp"; string_color = DAMAGE_EXP_FONT_COLOR
  6354. when "Gold"; string_color = DAMAGE_GOLD_FONT_COLOR
  6355. when "Item"; string_color = DAMAGE_ITEM_FONT_COLOR
  6356. else
  6357. string_color = DAMAGE_DEFAULT_FONT_COLOR
  6358. end
  6359. bitmap.font.color = string_color
  6360. bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
  6361. end
  6362. @_damage_sprite = ::Sprite.new(self.viewport)
  6363. @_damage_sprite.bitmap = bitmap
  6364. @_damage_sprite.ox = 80
  6365. @_damage_sprite.oy = 20
  6366. @_damage_sprite.x = self.x + @damage_ox
  6367. @_damage_sprite.y = self.y - self.oy / 2
  6368. @_damage_sprite.z = 3000
  6369. @_damage_duration = 60
  6370. end
  6371.  
  6372. #--------------------------------------------------------------------------
  6373. # ● Dispose Damage
  6374. #--------------------------------------------------------------------------
  6375. def dispose_damage
  6376. if @_damage_sprite != nil
  6377. @_damage_sprite.bitmap.dispose
  6378. @_damage_sprite.dispose
  6379. @_damage_sprite = nil
  6380. @_damage_duration = 0
  6381. end
  6382. end
  6383.  
  6384. #--------------------------------------------------------------------------
  6385. # ● Dispose
  6386. #--------------------------------------------------------------------------
  6387. alias x_damage_dispose dispose
  6388. def dispose
  6389. dispose_damage
  6390. x_damage_dispose
  6391. end
  6392.  
  6393. #--------------------------------------------------------------------------
  6394. # ● Update
  6395. #--------------------------------------------------------------------------
  6396. alias x_damage_pop_update update
  6397. def update
  6398. if @_damage_duration > 0
  6399. @_damage_duration -= 1
  6400. if @_damage_duration == 0
  6401. dispose_damage
  6402. end
  6403. end
  6404. x_damage_pop_update
  6405. end
  6406.  
  6407. end
  6408.  
  6409. #===============================================================================
  6410. # ■ XRXS DAMAGE
  6411. #===============================================================================
  6412. module XRXS_DAMAGE
  6413.  
  6414. #--------------------------------------------------------------------------
  6415. # ● Damage X Init Velocity
  6416. #--------------------------------------------------------------------------
  6417. def damage_x_init_velocity
  6418. return 0.2 * (rand(5) - 2)
  6419. end
  6420.  
  6421. #--------------------------------------------------------------------------
  6422. # ● Damage Y Init Velocity
  6423. #--------------------------------------------------------------------------
  6424. def damage_y_init_velocity
  6425. return 9
  6426. end
  6427.  
  6428. #--------------------------------------------------------------------------
  6429. # ● Update
  6430. #--------------------------------------------------------------------------
  6431. def update
  6432. super
  6433. @damage_sprites = [] if @damage_sprites.nil?
  6434. @damage_durations = [] if @damage_durations.nil?
  6435. if @_damage_sprite != nil and @_damage_sprite.visible
  6436. if @damage_ox != nil
  6437. dam_ox = @damage_ox
  6438. else
  6439. dam_ox = 0
  6440. end
  6441. if @damage_type != nil
  6442. dam_type = @damage_type
  6443. end
  6444. x = damage_x_init_velocity
  6445. y = damage_y_init_velocity
  6446. d = @_damage_duration
  6447. @damage_sprites.push(Sprite_Damage.new(@_damage_sprite, x, y, d,dam_ox,dam_type))
  6448. @_damage_sprite.visible = false
  6449. end
  6450. for damage_sprite in @damage_sprites
  6451. damage_sprite.update
  6452. end
  6453. for i in 0...@damage_sprites.size
  6454. @damage_sprites[i] = nil if @damage_sprites[i].disposed?
  6455. end
  6456. @damage_sprites.compact!
  6457. end
  6458. def dispose
  6459. super
  6460. if @damage_sprites != nil
  6461. for damage_sprite in @damage_sprites
  6462. damage_sprite.dispose
  6463. end
  6464. end
  6465. end
  6466. end
  6467.  
  6468. #===============================================================================
  6469. # ■ RPG Sprite
  6470. #===============================================================================
  6471. class Sprite_Base < Sprite
  6472. include XRXS_DAMAGE
  6473. end
  6474.  
  6475. #===============================================================================
  6476. # ■ Sprite Damage
  6477. #===============================================================================
  6478. class Sprite_Damage < Sprite
  6479.  
  6480. #--------------------------------------------------------------------------
  6481. # ● Initialize
  6482. #--------------------------------------------------------------------------
  6483. def initialize(sprite, init_x_speed, init_y_speed, duration,dam_ox,dam_type = nil)
  6484. super(nil)
  6485. self.bitmap = sprite.bitmap.dup unless sprite.bitmap.nil?
  6486. self.opacity = sprite.opacity
  6487. self.x = sprite.x
  6488. self.y = sprite.y
  6489. self.z = sprite.z
  6490. self.ox = sprite.ox - dam_ox
  6491. self.oy = sprite.oy
  6492. @now_x_speed = init_x_speed
  6493. @now_y_speed = init_y_speed
  6494. @potential_x_energy = 0.0
  6495. @potential_y_energy = 0.0
  6496. @duration = duration
  6497. @dam_type = dam_type
  6498. @dam_type = "" if dam_type == nil
  6499. end
  6500.  
  6501. #--------------------------------------------------------------------------
  6502. # ● Update
  6503. #--------------------------------------------------------------------------
  6504. def update
  6505. super
  6506. if XAS_DAMAGE_POP::DAMAGE_CRITICAL_ZOOM
  6507. if @dam_type != "Critical"
  6508. update_normal_popup
  6509. else
  6510. update_critical_effect
  6511. end
  6512. else
  6513. update_normal_popup
  6514. end
  6515. @duration -= 1
  6516. if @duration == 0
  6517. self.dispose
  6518. end
  6519. end
  6520.  
  6521. #--------------------------------------------------------------------------
  6522. # ● update_critical_effect
  6523. #--------------------------------------------------------------------------
  6524. def update_critical_effect
  6525. case @duration
  6526. when 40..60
  6527. self.zoom_x += 0.1
  6528. self.zoom_y += 0.1
  6529. else
  6530. if self.zoom_x > 0.1
  6531. self.zoom_x -= 0.1
  6532. self.zoom_y -= 0.1
  6533. end
  6534. end
  6535. end
  6536.  
  6537. #--------------------------------------------------------------------------
  6538. # ● update_normal_popup
  6539. #--------------------------------------------------------------------------
  6540. def update_normal_popup
  6541. self.opacity -= 25 if @duration <= 10
  6542. n = self.oy + @now_y_speed
  6543. if n <= 0
  6544. @now_y_speed *= -1
  6545. @now_y_speed /= 2
  6546. @now_x_speed /= 2
  6547. end
  6548. self.oy = [n, 0].max
  6549. @potential_y_energy += 0.58
  6550. speed = @potential_y_energy.floor
  6551. @now_y_speed -= speed
  6552. @potential_y_energy -= speed
  6553. @potential_x_energy += @now_x_speed
  6554. speed = @potential_x_energy.floor
  6555. self.ox += speed
  6556. @potential_x_energy -= speed
  6557. end
  6558.  
  6559. end
  6560.  
  6561.  
  6562.  
  6563. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  6564. #■ SPRITE - SPRITE EFFECTS
  6565. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  6566.  
  6567.  
  6568. #==============================================================================
  6569. # ■ Sprite Base
  6570. #==============================================================================
  6571. class Sprite_Base < Sprite
  6572.  
  6573. #--------------------------------------------------------------------------
  6574. # ● Animation Set Sprite
  6575. #--------------------------------------------------------------------------
  6576. def animation_set_sprites(frame)
  6577. cell_data = frame.cell_data
  6578. @ani_sprites.each_with_index do |sprite, i|
  6579. next unless sprite
  6580. pattern = cell_data[i, 0]
  6581. if !pattern || pattern < 0
  6582. sprite.visible = false
  6583. next
  6584. end
  6585. sprite.bitmap = pattern < 100 ? @ani_bitmap1 : @ani_bitmap2
  6586. sprite.visible = true
  6587. sprite.src_rect.set(pattern % 5 * 192,
  6588. pattern % 100 / 5 * 192, 192, 192)
  6589. if @ani_mirror
  6590. cx = cell_data[i, 1]
  6591. sprite.angle = (360 - cell_data[i, 4])
  6592. sprite.mirror = (cell_data[i, 5] == 0)
  6593. else
  6594. cx = cell_data[i, 1]
  6595. sprite.angle = cell_data[i, 4]
  6596. sprite.mirror = (cell_data[i, 5] == 1)
  6597. end
  6598. cy = cell_data[i, 2]
  6599. sprite.z = self.z + 300 + i
  6600. sprite.ox = 96
  6601. sprite.oy = 96
  6602. sprite.zoom_x = cell_data[i, 3] / 100.0
  6603. sprite.zoom_y = cell_data[i, 3] / 100.0
  6604. sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  6605. sprite.blend_type = cell_data[i, 7]
  6606. case @animation.position
  6607. when 0
  6608. sprite.x = self.x + cx
  6609. sprite.y = self.y + cy - (height / 2)
  6610. when 1
  6611. sprite.x = self.x + cx
  6612. sprite.y = self.y + cy
  6613. when 2
  6614. sprite.x = self.x + cx
  6615. sprite.y = self.y + cy + (height / 2)
  6616. when 3
  6617. sprite.x = (544 / 2) + cx
  6618. sprite.y = (416 / 2) + cy
  6619. end
  6620.  
  6621.  
  6622. end
  6623. end
  6624.  
  6625. #--------------------------------------------------------------------------
  6626. # ● Dispose Animation
  6627. #--------------------------------------------------------------------------
  6628. def dispose_animation
  6629. $game_temp.animation_garbage = [] if $game_temp.animation_garbage == nil
  6630. if @ani_bitmap1
  6631. @@_reference_count[@ani_bitmap1] -= 1
  6632. if @@_reference_count[@ani_bitmap1] == 0
  6633. $game_temp.animation_garbage.push(@ani_bitmap1)
  6634. end
  6635. end
  6636. if @ani_bitmap2
  6637. @@_reference_count[@ani_bitmap2] -= 1
  6638. if @@_reference_count[@ani_bitmap2] == 0
  6639. $game_temp.animation_garbage.push(@ani_bitmap2)
  6640. end
  6641. end
  6642. if @ani_sprites
  6643. @ani_sprites.each {|sprite| sprite.dispose }
  6644. @ani_sprites = nil
  6645. @animation = nil
  6646. end
  6647. @ani_bitmap1 = nil
  6648. @ani_bitmap2 = nil
  6649. end
  6650.  
  6651. end
  6652.  
  6653. #==============================================================================
  6654. # ■ Scene_Base
  6655. #==============================================================================
  6656. class Game_Map
  6657.  
  6658. #--------------------------------------------------------------------------
  6659. # ● Setup
  6660. #--------------------------------------------------------------------------
  6661. alias animation_garbage_setup setup
  6662. def setup(map_id)
  6663. animation_garbage_setup(map_id)
  6664. dispose_animation_garbage
  6665. end
  6666.  
  6667. #--------------------------------------------------------------------------
  6668. # ● Dispose Animation Garbage
  6669. #--------------------------------------------------------------------------
  6670. def dispose_animation_garbage
  6671. return if $game_temp.animation_garbage == nil
  6672. for animation in $game_temp.animation_garbage
  6673. animation.dispose
  6674. end
  6675. $game_temp.animation_garbage = nil
  6676. end
  6677.  
  6678. end
  6679.  
  6680. #==============================================================================
  6681. # ■ Scene_Base
  6682. #==============================================================================
  6683. class Scene_Base
  6684.  
  6685. #--------------------------------------------------------------------------
  6686. # ● Scene Changing?
  6687. #--------------------------------------------------------------------------
  6688. alias animation_garbage_scene_changing scene_changing?
  6689. def scene_changing?
  6690. $game_map.dispose_animation_garbage if SceneManager.scene != self
  6691. animation_garbage_scene_changing
  6692. end
  6693.  
  6694. end
  6695.  
  6696.  
  6697. #class Game_CharacterBase
  6698. #class Game_CharacterBase
  6699. # attr_reader :loop_animation # animation loops
  6700. # attr_accessor :start_frame # animation start frame
  6701. #
  6702. # alias shaz_ra_init_public_members init_public_members
  6703. # def init_public_members
  6704. # shaz_ra_init_public_members
  6705. # @loop_animation = false
  6706. # @start_frame = 1
  6707. # end
  6708. # def start_anim_loop(anim_id, start_frame = 1)
  6709. # @loop_animation = true
  6710. # @animation_id = anim_id
  6711. # @start_frame = start_frame
  6712. # end
  6713. # def end_anim_loop
  6714. # @loop_animation = false
  6715. # end
  6716. #end
  6717.  
  6718. #===============================================================================
  6719. # ■ Sprite_Character
  6720. #===============================================================================
  6721. class Sprite_Character < Sprite_Base
  6722. include XAS_SYSTEM
  6723.  
  6724. #--------------------------------------------------------------------------
  6725. # ● Setup New Effect
  6726. #--------------------------------------------------------------------------
  6727.  
  6728. def setup_new_effect
  6729. if @character.animation_id > 0
  6730. animation = $data_animations[@character.animation_id]
  6731. start_animation(animation)
  6732.  
  6733. @character.animation_id = 0
  6734. end
  6735. if !@balloon_sprite && @character.balloon_id > 0
  6736. @balloon_id = @character.balloon_id
  6737. start_balloon
  6738. end
  6739. end
  6740.  
  6741. #--------------------------------------------------------------------------
  6742. # ● Can Update X Effects
  6743. #--------------------------------------------------------------------------
  6744. def can_update_x_effects?
  6745. return false unless CHARACTER_SPRITE_EFFECTS
  6746. return false if @character.erased
  6747. return false if @character.transparent == true
  6748. return true
  6749. end
  6750. #--------------------------------------------------------------------------
  6751. # ● Can Damage Pop Base
  6752. #--------------------------------------------------------------------------
  6753. def can_damage_pop_base?
  6754. return false unless $game_system.xas_battle
  6755. return false if XAS_SYSTEM::DAMAGE_POP == false
  6756. return false if @character.battler == nil
  6757. return false if @character.battler.no_damage_pop
  6758. return false if @character.battler.damage_pop != true
  6759. return true
  6760. end
  6761.  
  6762.  
  6763. #--------------------------------------------------------------------------
  6764. # ● Execute Damage Pop
  6765. #--------------------------------------------------------------------------
  6766. def execute_damage_pop
  6767. damage(@character.battler.damage, @character.battler.damage_type)
  6768. @character.battler.damage = nil
  6769. @character.battler.critical = false
  6770. @character.battler.damage_pop = false
  6771. @character.battler.damage_type = ""
  6772. end
  6773.  
  6774. #--------------------------------------------------------------------------
  6775. # ● Update X Effects
  6776. #--------------------------------------------------------------------------
  6777. def update_x_effects
  6778. update_collaspse_effects if @character.collapse_duration > 0
  6779. update_sprite_position
  6780. update_angle
  6781. update_zoom
  6782. end
  6783.  
  6784. #--------------------------------------------------------------------------
  6785. # ● Update Angle
  6786. #--------------------------------------------------------------------------
  6787. def update_angle
  6788. return if @character.angle == self.angle
  6789. self.angle = @character.angle
  6790. end
  6791.  
  6792. #--------------------------------------------------------------------------
  6793. # ● Update Zoom
  6794. #--------------------------------------------------------------------------
  6795. def update_zoom
  6796. update_treasure_effect
  6797. update_breath_effect if can_breath_effect?
  6798. self.zoom_x = @character.zoom_x
  6799. self.zoom_y = @character.zoom_y
  6800. end
  6801.  
  6802. #--------------------------------------------------------------------------
  6803. # ● Update Treasure_effect
  6804. #--------------------------------------------------------------------------
  6805. def update_treasure_effect
  6806. return if @character.treasure_time == 0
  6807. update_treasure_fade_effect
  6808. update_treasure_float_effect
  6809. end
  6810.  
  6811. #--------------------------------------------------------------------------
  6812. # ● update_treasure_fade_effect
  6813. #--------------------------------------------------------------------------
  6814. def update_treasure_fade_effect
  6815. return unless XAS_BA::FADE_TREASURE_SPRITE
  6816. return if @character.treasure_time > 100
  6817. return if @character.zoom_x < 0.01
  6818. @character.zoom_x -= 0.01
  6819. if @character.temp_id > 0
  6820. @character.zoom_x = 1.00
  6821. @character.treasure_time = 120 + XAS_BA::TREASURE_ERASE_TIME * 60
  6822. end
  6823. end
  6824.  
  6825. #--------------------------------------------------------------------------
  6826. # ● Update Treasure Float Effect
  6827. #--------------------------------------------------------------------------
  6828. def update_treasure_float_effect
  6829. return unless XAS_BA::FLOAT_TREASURE_SPRITE
  6830. return if self.character.jumping?
  6831. self.character.treasure_float[2] += 1
  6832. if self.character.treasure_float[2] > 1
  6833. self.character.treasure_float[2] = 0
  6834. self.character.treasure_float[1] += 1
  6835. case self.character.treasure_float[1]
  6836. when 1..15
  6837. self.character.treasure_float[0] -= 1
  6838. when 16..30
  6839. self.character.treasure_float[0] += 1
  6840. else
  6841. self.character.treasure_float[0] = 0
  6842. self.character.treasure_float[1] = 0
  6843. end
  6844. end
  6845. self.y += self.character.treasure_float[0]
  6846. end
  6847.  
  6848. #--------------------------------------------------------------------------
  6849. # ● Can Breath Effect?
  6850. #--------------------------------------------------------------------------
  6851. def can_breath_effect?
  6852. return false if @character.battler == nil
  6853. return false if @character.battler.breath_effect == false
  6854. return false if @character.battler.hp == 0
  6855. return false if @character.stop and not @character.battler.state_sleep
  6856. return true
  6857. end
  6858.  
  6859. #--------------------------------------------------------------------------
  6860. # ● Update Breath Effect
  6861. #--------------------------------------------------------------------------
  6862. def update_breath_effect
  6863. if @character.battler.fast_breath_effect
  6864. zoom_speed = 3
  6865. zoom_power_x = 0.006
  6866. zoom_power_y = 0.006
  6867. else
  6868. zoom_speed = 1
  6869. zoom_power_x = 0
  6870. zoom_power_y = 0.002
  6871. end
  6872. @character.battler.breath_duration += zoom_speed
  6873. case @character.battler.breath_duration
  6874. when 1..30
  6875. @character.zoom_x += zoom_power_x
  6876. @character.zoom_y += zoom_power_y
  6877. when 31..60
  6878. @character.zoom_x -= zoom_power_x
  6879. @character.zoom_y -= zoom_power_y
  6880. else
  6881. @character.battler.breath_duration = 0
  6882. @character.zoom_x = 1.00
  6883. @character.zoom_y = 1.00
  6884. end
  6885. end
  6886.  
  6887. #--------------------------------------------------------------------------
  6888. # ● Update Sprite Position
  6889. #--------------------------------------------------------------------------
  6890. alias x_set_character_bitmap set_character_bitmap
  6891. def set_character_bitmap
  6892. @py = nil
  6893. x_set_character_bitmap
  6894. if @character_name[/\((\d+)\)/]
  6895. @py = $1.to_i
  6896. end
  6897. end
  6898.  
  6899. #--------------------------------------------------------------------------
  6900. # ● Update Sprite Position
  6901. #--------------------------------------------------------------------------
  6902. def update_sprite_position
  6903. if @character.tool_id > 0
  6904. if @character.tool_effect == "Barrier"
  6905. unless @character.action == nil
  6906. bullet_user = @character.action.user
  6907. self.x = bullet_user.screen_x
  6908. self.y = bullet_user.screen_y
  6909. @character.x = bullet_user.x
  6910. @character.y = bullet_user.y
  6911. @character.direction = bullet_user.direction
  6912. end
  6913. end
  6914. end
  6915. update_hold_target
  6916. if @py != nil
  6917. self.y += @py
  6918. end
  6919. if @character.angle == 315 and @cw != nil
  6920. self.x -= (@cw / 3)
  6921. self.y -= (@ch / 6)
  6922. end
  6923. if XAS_BA::KNOCKBACKING_SHAKE
  6924. if self.character.knockbacking?
  6925. self.x = self.x + rand(5) unless self.character.dead?
  6926. end
  6927. end
  6928. end
  6929.  
  6930. #--------------------------------------------------------------------------
  6931. # ● Update X Effects
  6932. #--------------------------------------------------------------------------
  6933. def update_hold_target
  6934. return if @character.temp_id == 0
  6935. target = $game_map.events[@character.temp_id]
  6936. if target == nil or target.erased
  6937. @character.temp_id = 0
  6938. @character.move_speed = @character.pre_move_speed
  6939. check_character_above_player(target)
  6940. else
  6941. self.x = target.screen_x
  6942. self.y = target.screen_y
  6943. self.character.x = target.x
  6944. self.character.y = target.y
  6945. self.character.move_speed = target.move_speed
  6946. self.character.direction = target.direction unless self.character.direction_fix
  6947. check_character_above_player(target)
  6948. end
  6949. end
  6950.  
  6951. #--------------------------------------------------------------------------
  6952. # ● Check Chacracter Above Player
  6953. #--------------------------------------------------------------------------
  6954. def check_character_above_player(target)
  6955. return if @character.is_a?(Game_Player)
  6956. return if @character.battler == nil
  6957. if (@character.x == $game_player.x and
  6958. @character.y == $game_player.y) or
  6959. not @character.passable_temp_id?(@character.x,@character.y)
  6960. @character.temp_id = 0
  6961. @character.move_speed = @character.pre_move_speed
  6962. case @character.direction
  6963. when 2; @character.y -= 1
  6964. when 4; @character.x += 1
  6965. when 6; @character.x -= 1
  6966. when 8; @character.y += 1
  6967. end
  6968. end
  6969. end
  6970.  
  6971. #--------------------------------------------------------------------------
  6972. # ● Update_balloon
  6973. #--------------------------------------------------------------------------
  6974. if XAS_BA::FIX_BALLOON_POSITION
  6975. def update_balloon
  6976. if @balloon_duration > 0
  6977. @balloon_duration -= 1
  6978. if @balloon_duration > 0
  6979. @balloon_sprite.x = x
  6980. @balloon_sprite.y = y - XAS_BA::BALLOON_HEIGHT
  6981. @balloon_sprite.z = z + 200
  6982. sx = balloon_frame_index * 32
  6983. sy = (@balloon_id - 1) * 32
  6984. @balloon_sprite.src_rect.set(sx, sy, 32, 32)
  6985. else
  6986. end_balloon
  6987. end
  6988. end
  6989. end
  6990. end
  6991.  
  6992. end
  6993.  
  6994. #==============================================================================
  6995. # ■ Game_Event
  6996. #==============================================================================
  6997. class Game_Event < Game_Character
  6998.  
  6999. #--------------------------------------------------------------------------
  7000. # ● Near The Screen
  7001. #--------------------------------------------------------------------------
  7002. alias x_near_the_screen near_the_screen?
  7003. def near_the_screen?(dx = 12, dy = 8) #Mir edit, used to be 12 and 8
  7004. return true if can_update_out_screen?
  7005. x_near_the_screen(dx, dy)
  7006. end
  7007.  
  7008. #--------------------------------------------------------------------------
  7009. # ● Can Update Out Screen
  7010. #--------------------------------------------------------------------------
  7011. def can_update_out_screen?
  7012. return true if self.force_update
  7013. return false
  7014. end
  7015.  
  7016. end
  7017.  
  7018. #==============================================================================
  7019. # ■ Spriteset Map
  7020. #==============================================================================
  7021. class Spriteset_Map
  7022.  
  7023. #--------------------------------------------------------------------------
  7024. # ● Can Refresh Hud
  7025. #--------------------------------------------------------------------------
  7026. alias x_pre_leader_id_initialize initialize
  7027. def initialize
  7028. if $game_party.members[0] != nil
  7029. $game_system.pre_leader_id = $game_party.members[0].actor_id
  7030. else
  7031. $game_system.pre_leader_id = nil
  7032. end
  7033. x_pre_leader_id_initialize
  7034. end
  7035.  
  7036. #--------------------------------------------------------------------------
  7037. # ● Can Refresh Hud
  7038. #--------------------------------------------------------------------------
  7039. def can_refresh_hud?
  7040. if $game_party.members[0] == nil
  7041. return true if $game_system.pre_leader_id != nil
  7042. elsif $game_party.members[0] != nil
  7043. return true if $game_system.pre_leader_id == nil
  7044. return true if $game_system.pre_leader_id != $game_party.members[0].actor_id
  7045. end
  7046. return false
  7047. end
  7048.  
  7049. #--------------------------------------------------------------------------
  7050. # ● update
  7051. #--------------------------------------------------------------------------
  7052. def refresh_hud
  7053. $game_system.pre_leader_id = $game_party.members[0].actor_id
  7054. end
  7055.  
  7056. #--------------------------------------------------------------------------
  7057. # ● Update Hud Visible
  7058. #--------------------------------------------------------------------------
  7059. def update_hud_visible
  7060. if hud_visible?
  7061. $game_system.enable_hud = true
  7062. else
  7063. $game_system.enable_hud = false
  7064. end
  7065. end
  7066.  
  7067. #--------------------------------------------------------------------------
  7068. # ● Hud Visible?
  7069. #--------------------------------------------------------------------------
  7070. def hud_visible?
  7071. return false if $game_system.hud_visible == false
  7072. return false if $game_message.visible
  7073. return true
  7074. end
  7075.  
  7076. end
  7077.  
  7078.  
  7079.  
  7080. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  7081. #■ MISC - SCENE TARGET SELECT
  7082. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  7083.  
  7084.  
  7085. #==============================================================================
  7086. # ■ Game_Temp
  7087. #==============================================================================
  7088. class Game_Temp
  7089. attr_accessor :xas_target_x
  7090. attr_accessor :xas_target_y
  7091. attr_accessor :xas_target_time
  7092. attr_accessor :xas_target_shoot_id
  7093.  
  7094. #--------------------------------------------------------------------------
  7095. # ● Initialize
  7096. #--------------------------------------------------------------------------
  7097. alias xas_target_initialize initialize
  7098. def initialize
  7099. xas_target_initialize
  7100. @xas_target_x = 0
  7101. @xas_target_y = 0
  7102. @xas_target_time = 0
  7103. @xas_target_shoot_id = 0
  7104. end
  7105.  
  7106. end
  7107.  
  7108. #==============================================================================
  7109. # ■ Game_Map
  7110. #==============================================================================
  7111. class Game_Map
  7112.  
  7113. attr_accessor :pre_display_x
  7114. attr_accessor :pre_display_y
  7115. attr_accessor :pre_real_display_x
  7116. attr_accessor :pre_real_display_y
  7117.  
  7118. #--------------------------------------------------------------------------
  7119. # * Object Initialization
  7120. #--------------------------------------------------------------------------
  7121. alias x_map_initialize initialize
  7122. def initialize
  7123. x_map_initialize
  7124. @pre_display_x = @display_x - 1
  7125. @pre_display_y = @display_y - 1
  7126. end
  7127.  
  7128. #--------------------------------------------------------------------------
  7129. # ● Screen Scrolled?
  7130. #--------------------------------------------------------------------------
  7131. def screen_scrolled?
  7132. if @pre_display_x != @display_x or
  7133. @pre_display_y != @display_y
  7134. @pre_display_x = @display_x
  7135. @pre_display_y = @display_y
  7136. return true
  7137. end
  7138. return false
  7139. end
  7140.  
  7141. #--------------------------------------------------------------------------
  7142. # ● Event On Screen
  7143. #--------------------------------------------------------------------------
  7144. def event_on_screen?(event)
  7145. event.target = false
  7146. px = ($game_map.display_x).truncate
  7147. py = ($game_map.display_y).truncate
  7148. distance_x = event.x - px
  7149. distance_y = event.y - py
  7150. if distance_x.between?(0, 16) and
  7151. distance_y.between?(0, 12)
  7152. event.target = true
  7153. end
  7154. end
  7155.  
  7156. #--------------------------------------------------------------------------
  7157. # ● Check Event on Screen
  7158. #--------------------------------------------------------------------------
  7159. def check_events_on_screen
  7160. for i in $game_map.events.values
  7161. event_on_screen?(i)
  7162. end
  7163. end
  7164.  
  7165. end
  7166. #==============================================================================
  7167. # ■ Scene Target Select
  7168. #==============================================================================
  7169. class Scene_Target_Select
  7170.  
  7171. #--------------------------------------------------------------------------
  7172. # ● Main
  7173. #--------------------------------------------------------------------------
  7174. def main
  7175. $game_temp.xas_target_x = 0
  7176. $game_temp.xas_target_y = 0
  7177. $game_temp.xas_target_time = 0
  7178. @new_x = $game_player.screen_x
  7179. @new_y = $game_player.screen_y
  7180. @index_max = -1
  7181. @target_index = 0
  7182. @spriteset = Spriteset_Map.new
  7183. @text_string = ""
  7184. @fy = 0
  7185. @fy_time = 0
  7186. for event in $game_map.events.values
  7187. if event.target and event.battler?
  7188. @index_max += 1
  7189. end
  7190. end
  7191. Sound.play_equip
  7192. if @index_max == -1
  7193. cancel_select
  7194. else
  7195. create_layout
  7196. create_layout_skill
  7197. create_cusrsor
  7198. create_text
  7199. create_skill_name
  7200. select_target(0)
  7201. end
  7202. Graphics.transition(0)
  7203. loop do
  7204. Graphics.update
  7205. Input.update
  7206. update
  7207. break if SceneManager.scene != self
  7208. end
  7209. dispose
  7210. end
  7211. #--------------------------------------------------------------------------
  7212. # ● Create Layout
  7213. #--------------------------------------------------------------------------
  7214. def create_layout
  7215. @layout_1 = Plane.new
  7216. @layout_1.bitmap = Cache.system("XAS_Target_Layout1")
  7217. @layout_1.z = 10100
  7218. @layout_1.opacity = 255
  7219. end
  7220.  
  7221. #--------------------------------------------------------------------------
  7222. # ● Create Layout
  7223. #--------------------------------------------------------------------------
  7224. def create_layout_skill
  7225. @skill_layout = Sprite.new
  7226. @skill_layout.bitmap = Cache.system("XAS_Active_Help")
  7227. @skill_layout.z = 10101
  7228. @skill_layout.x = -100
  7229. @skill_layout.y = 32
  7230. @skill_layout.opacity = 0
  7231. end
  7232.  
  7233. #--------------------------------------------------------------------------
  7234. # ● Create Cursor
  7235. #--------------------------------------------------------------------------
  7236. def create_cusrsor
  7237. @cursor = Sprite.new
  7238. @cursor.bitmap = Cache.system("XAS_Cursor")
  7239. @cursor.z = 10105
  7240. @cursor.x = @new_x
  7241. @cursor.y = @new_y
  7242. @cursor.opacity = 255
  7243. @cursor.visible = true
  7244. end
  7245.  
  7246. #--------------------------------------------------------------------------
  7247. # ● Create Text
  7248. #--------------------------------------------------------------------------
  7249. def create_text
  7250. @text = Sprite.new
  7251. @text.bitmap = Bitmap.new(200,40)
  7252. @text.z = 10102
  7253. @text.bitmap.font.size = 20
  7254. @text.bitmap.font.bold = true
  7255. @text.bitmap.font.name = "Georgia"
  7256. @text.bitmap.draw_text(0, 0, 200, 40, @text_string.to_s,1)
  7257. @text.opacity = 255
  7258. @text.x = @new_x
  7259. @text.y = @new_y
  7260. end
  7261.  
  7262. #--------------------------------------------------------------------------
  7263. # ● Create Text
  7264. #--------------------------------------------------------------------------
  7265. def create_skill_name
  7266. @skill_name = Plane.new
  7267. @skill_name.bitmap = Bitmap.new(640,480)
  7268. @skill_name.z = 10103
  7269. @skill_name.bitmap.font.size = 20
  7270. @skill_name.bitmap.font.bold = true
  7271. @skill_name.bitmap.font.name = "Georgia"
  7272. @skill_name.oy = -40
  7273. skill = $data_skills[$game_temp.xas_target_shoot_id]
  7274. skill_text = skill.name.to_s + " - " + skill.description.to_s
  7275. @skill_name.bitmap.draw_text(0, 0, 640, 40, skill_text,1)
  7276. @skill_name.opacity = 0
  7277. end
  7278.  
  7279. #--------------------------------------------------------------------------
  7280. # ● Dispose
  7281. #--------------------------------------------------------------------------
  7282. def dispose
  7283. Graphics.freeze
  7284. @spriteset.dispose
  7285. if @cursor != nil
  7286. @cursor.bitmap.dispose
  7287. @cursor.dispose
  7288. @text.bitmap.dispose
  7289. @text.dispose
  7290. @skill_layout.bitmap.dispose
  7291. @skill_layout.dispose
  7292. @skill_name.bitmap.dispose
  7293. @skill_name.dispose
  7294. @layout_1.bitmap.dispose
  7295. @layout_1.dispose
  7296. end
  7297. end
  7298.  
  7299. #--------------------------------------------------------------------------
  7300. # ● Update
  7301. #--------------------------------------------------------------------------
  7302. def update
  7303. return if @index_max == -1
  7304. @spriteset.update
  7305. update_cursor_slide
  7306. update_layout_slide
  7307. update_targe_select
  7308. end
  7309.  
  7310. #--------------------------------------------------------------------------
  7311. # ● Update Layout Slide
  7312. #--------------------------------------------------------------------------
  7313. def update_layout_slide
  7314. @layout_1.ox += 3
  7315. if @skill_layout.x < 0
  7316. @skill_layout.x += 10
  7317. @skill_layout.opacity += 25
  7318. @skill_name.opacity += 25
  7319. else
  7320. @skill_layout.x = 0
  7321. @skill_layout.opacity = 255
  7322. @skill_name.opacity = 255
  7323. @skill_name.ox -= 3
  7324. end
  7325. end
  7326.  
  7327. #--------------------------------------------------------------------------
  7328. # ● Refresh Text
  7329. #--------------------------------------------------------------------------
  7330. def refresh_text
  7331. @text.bitmap.clear
  7332. @text.bitmap.draw_text(0, 0, 200, 40, @text_string.to_s,1)
  7333. end
  7334.  
  7335. #--------------------------------------------------------------------------
  7336. # ● Update Cursor Slide
  7337. #--------------------------------------------------------------------------
  7338. def update_cursor_slide
  7339. @speed_x = [[(@cursor.x - @new_x / 60), 1].max, 60].min
  7340. @speed_y = [[(@cursor.y - @new_y / 60), 1].max, 60].min
  7341. if @cursor.x > @new_x
  7342. @cursor.x -= @speed_x.abs
  7343. @cursor.x = @new_x if @cursor.x < @new_x
  7344. elsif @cursor.x < @new_x
  7345. @cursor.x += @speed_x.abs
  7346. @cursor.x = @new_x if @cursor.x > @new_x
  7347. end
  7348.  
  7349. if @cursor.y > @new_y
  7350. @cursor.y -= @speed_y.abs
  7351. @cursor.y = @new_y if @cursor.y < @new_y
  7352. elsif @cursor.y < @new_y
  7353. @cursor.y += @speed_y.abs
  7354. @cursor.y = @new_y if @cursor.y > @new_y
  7355. end
  7356. @text.x = - 85 + @cursor.x
  7357. @text.y = 20 + @cursor.y
  7358. if @fy_time > 25
  7359. @fy += 1
  7360. elsif @fy_time > 0
  7361. @fy -= 1
  7362. else
  7363. @fy = 0
  7364. @fy_time = 50
  7365. end
  7366. @fy_time -= 1
  7367. @cursor.oy = @fy
  7368.  
  7369. end
  7370.  
  7371. #--------------------------------------------------------------------------
  7372. # ● Select Target(type)
  7373. #--------------------------------------------------------------------------
  7374. def select_target(type)
  7375. return if @index_max < 0
  7376. check_index
  7377. valor = 0
  7378. for event in $game_map.events.values
  7379. if event.target and event.battler? #Mir Edit use event.target array to get specific enemies?
  7380. if valor == @target_index
  7381. @new_x = event.screen_x - 10
  7382. @new_y = event.screen_y
  7383. @text_string = event.battler.name
  7384. $game_temp.xas_target_x = event.x
  7385. $game_temp.xas_target_y = event.y
  7386. $game_temp.xas_target_time = 1
  7387. end
  7388. valor += 1
  7389. end
  7390. end
  7391. refresh_text
  7392. end
  7393.  
  7394. #--------------------------------------------------------------------------
  7395. # ● Cancel Select
  7396. #--------------------------------------------------------------------------
  7397. def cancel_select
  7398. Sound.play_buzzer
  7399. $game_temp.xas_target_x = 0
  7400. $game_temp.xas_target_y = 0
  7401. $game_temp.xas_target_time = 0
  7402. $game_temp.xas_target_shoot_id = 0
  7403. SceneManager.call(Scene_Map)
  7404. end
  7405.  
  7406. #--------------------------------------------------------------------------
  7407. # ● Update Target Select
  7408. #--------------------------------------------------------------------------
  7409. def update_targe_select
  7410. if Input.trigger?(Input::B)
  7411. cancel_select
  7412. elsif Input.trigger?(Input::DOWN) or Input.trigger?(Input::RIGHT)
  7413. @target_index += 1
  7414. select_target(0)
  7415. Sound.play_cursor
  7416. elsif Input.trigger?(Input::UP) or Input.trigger?(Input::LEFT)
  7417. @target_index -= 1
  7418. select_target(1)
  7419. Sound.play_cursor
  7420. elsif Input.trigger?(Input::X) #Used to be C
  7421. Sound.play_ok
  7422. SceneManager.call(Scene_Map)
  7423. end
  7424. end
  7425.  
  7426. #--------------------------------------------------------------------------
  7427. # ● Check Index
  7428. #--------------------------------------------------------------------------
  7429. def check_index
  7430. if @target_index > @index_max
  7431. @target_index = 0
  7432. end
  7433. if @target_index < 0
  7434. @target_index = @index_max
  7435. end
  7436. end
  7437.  
  7438. end
  7439.  
  7440.  
  7441. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  7442. #■ MISC - MAIN UPDATE
  7443. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  7444.  
  7445. #===============================================================================
  7446. # ■ Spriteset_Map
  7447. #===============================================================================
  7448. class Spriteset_Map
  7449.  
  7450. #--------------------------------------------------------------------------
  7451. # ● update
  7452. #--------------------------------------------------------------------------
  7453. alias xas_main_update update
  7454. def update
  7455. xas_main_update
  7456. update_xas_spriteset_map
  7457. end
  7458.  
  7459. #--------------------------------------------------------------------------
  7460. # ● Update XAS Spriteset Map
  7461. #--------------------------------------------------------------------------
  7462. def update_xas_spriteset_map
  7463. refresh_token if $game_map.need_refresh_token
  7464. refresh_hud if can_refresh_hud?
  7465. update_hud_visible
  7466. end
  7467. end
  7468.  
  7469.  
  7470. #===============================================================================
  7471. # ■ Sprite_Character
  7472. #===============================================================================
  7473. class Sprite_Character < Sprite_Base
  7474.  
  7475. #--------------------------------------------------------------------------
  7476. # ● Update
  7477. #--------------------------------------------------------------------------
  7478. alias x_update update
  7479. def update
  7480. x_update
  7481. execute_damage_pop if can_damage_pop_base?
  7482. update_x_effects if can_update_x_effects?
  7483. end
  7484.  
  7485. end
  7486.  
  7487. #===============================================================================
  7488. # ■ Game Character
  7489. #===============================================================================
  7490. class Game_Character < Game_CharacterBase
  7491.  
  7492. #--------------------------------------------------------------------------
  7493. # ● Update
  7494. #--------------------------------------------------------------------------
  7495. alias x_main_update update
  7496. def update
  7497. update_character_before_movement
  7498. x_main_update
  7499. update_character_after_movement
  7500. end
  7501.  
  7502. #--------------------------------------------------------------------------
  7503. # ● Update Character Before Movement
  7504. #--------------------------------------------------------------------------
  7505. def update_character_before_movement
  7506. check_xy
  7507. update_force_action if can_force_action?
  7508. end
  7509.  
  7510. #--------------------------------------------------------------------------
  7511. # ● Update Character After Movement
  7512. #--------------------------------------------------------------------------
  7513. def update_character_after_movement
  7514. update_battler if can_update_battler?
  7515. end
  7516.  
  7517. end
  7518.  
  7519. #===============================================================================
  7520. # ■ Game Event
  7521. #===============================================================================
  7522. class Game_Event < Game_Character
  7523.  
  7524. #--------------------------------------------------------------------------
  7525. # ● Update
  7526. #--------------------------------------------------------------------------
  7527. alias x_main_event_update update
  7528. def update
  7529. update_event_before_movement
  7530. x_main_event_update
  7531. update_event_after_movement
  7532. end
  7533.  
  7534. #--------------------------------------------------------------------------
  7535. # ● Update Event Before Movement
  7536. #--------------------------------------------------------------------------
  7537. def update_event_before_movement
  7538. update_sensor if can_update_sensor?
  7539. update_treasure_duration
  7540. end
  7541.  
  7542. #--------------------------------------------------------------------------
  7543. # ● Update Event After Movement
  7544. #--------------------------------------------------------------------------
  7545. def update_event_after_movement
  7546.  
  7547. end
  7548.  
  7549. end
  7550.  
  7551. #===============================================================================
  7552. # ■ Game Player
  7553. #===============================================================================
  7554. class Game_Player < Game_Character
  7555.  
  7556. #--------------------------------------------------------------------------
  7557. # ● Update
  7558. #--------------------------------------------------------------------------
  7559. alias x_main_player_update update
  7560. def update
  7561. update_player_before_movement if party_system?
  7562. x_main_player_update
  7563. update_player_after_movement if party_system?
  7564. end
  7565.  
  7566. #--------------------------------------------------------------------------
  7567. # ● Update Player Before Movement
  7568. #--------------------------------------------------------------------------
  7569. def update_player_before_movement
  7570. check_actor_level
  7571. update_reset_battler_setting_time
  7572. if $game_system.old_interpreter_running != $game_map.interpreter.running?
  7573. refresh_interpreter_effect
  7574. end
  7575. end
  7576.  
  7577. #--------------------------------------------------------------------------
  7578. # ● Update Player after Movement
  7579. #--------------------------------------------------------------------------
  7580. def update_player_after_movement
  7581. update_action_command if can_use_command?
  7582. $game_temp.change_leader_wait_time -= 1 if $game_temp.change_leader_wait_time > 0
  7583. end
  7584.  
  7585. end
Advertisement
Add Comment
Please, Sign In to add comment