Project1

标题: XAS中文说明 技能篇(一) [打印本页]

作者: wuchangdao55    时间: 2013-7-23 15:47
标题: XAS中文说明 技能篇(一)
本帖最后由 Sion 于 2013-10-27 12:02 编辑

最近发现蛮多人喜欢XAS的,就把自己的一些使用心得分享一下吧!

还有本人不推荐新人去搞这个系统,要不然你会很蛋疼的!
系统范例就不发了,记得好像有一个集合贴,可以搜一下!

---------------------我是分割线吗?---------------------------------------------------
<Piercing>
技能攻击判断,技能都要填上。
<Ally Damage>无差别攻击,设置回复技能必须项,
<User Invincible>使用技能时将无敌.
<Auto Target>选择性技能设置,设置之后施放技能可以选择画面内的任何一个目标!
注意: Auto Target> Ally Damage> Piercing
<Disable Hit>关闭技能的直击中效果,可以设置技能飞行一定距离时爆炸的效果,要配合TOOL事件设置!
<Reflectable>这个嘛,<Disable Hit>搞在一起时就OK!
<Sunflag = X>技能攻击间隔,X基本为1;数值越大间隔越久。
<Duration = X>技能生命周期,X基本为30,设置多断攻击与射程的重要项.要配合TOOL事件的设置.
<Multi Hit>多断攻击判断,必须配合<Duration = X>,生命周期太小就不会有多断攻击效果.
配合<Sunflag = X>,可实现一段时间内的多次攻击:比如<Duration = 50>,<Sunflag = 1>,那么技能就会在5秒内发生5次攻击.
<Cast Time = X>技能充能时间
<Item Cost = X>技能消耗物品,X为物品ID.
<Impact Time = X>技能重新装填时间(技能CD).
<Shake>施放技能时将产生画面震动效果.
<Pose = _at>施放技能时的动画,_at为行走图后缀。
<Area = X>技能效果范围(注意:必须为大写)
SQUARE RHOMBUS

LINE FRONTSQUARE

FRONTRHOMBUS WALL

CROSS

<Range = X>技能范围(1OK了)
<Range = 1> <Range = 2>

<Blow Power = X>技能力度,数值越大敌人被吹飞的驱离就越远,建议1-10之间.
(敌人设置<Knockback Disable>之后将无效)

<Target Invunerable = X>敌人受攻击之后的无敌时间.

<Diagonal>技能八方向设定.
<X Directions>技能方向设定,要设定<Diagonal>本项才生效!
<All Directions>全方向
<Four Directions>四方向
<Three Directions>三方向
<Two Directions>二方向

OK主要的都是这些,还有个别的没啥用处的就不不说了!!

下一将说明技能设置与TOOL MAP的关联!
---------------------------------------我就是分割线---------------------------------------------------------------------
由于VA 的XAS系统官方一直都是1.0,所以有很多BUG!
比如物品关联技能时不能扔也不能卖,EXP经验条不正常递增!
本人小小的优化了下!
喜欢的就拿走吧!
RUBY 代码复制
  1. =begin
  2. ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  3. ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  4. ■■ X A S - Xiderwong Action System (For Advanced Users)
  5. ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  6. ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  7. ----改动3860 4850 5673 5626----------
  8. X - Xiderowng
  9. A - Action
  10. S - System
  11.  
  12. Created by XIDEROWNG (XMS / XRXS / ちいさな本屋 / 森穂(もりほ)
  13. [url=http://xrxs.at-ninja.jp/]http://xrxs.at-ninja.jp/[/url]
  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. [url=http://xrxs.at-ninja.jp/]http://xrxs.at-ninja.jp/[/url]
  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. [url=http://xrxs.at-ninja.jp/]http://xrxs.at-ninja.jp/[/url]
  31.  
  32.  
  33. #===============================================================================
  34. # ■ XAS Hero Edition ACE (Ver Experimental 0.5 - 2012 / 01 / 04)
  35. #===============================================================================
  36.  
  37. Updates for XAS Hero Edtion.
  38. [url=http://www.atelier-rgss.com/]http://www.atelier-rgss.com/[/url]
  39.  
  40. XAS Tutorials.
  41. [url=http://xasabs.wordpress.com/]http://xasabs.wordpress.com/[/url]
  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. # Desative um dos sistemas abaixo caso você tiver algum problema de
  65. # compatibilidade com outros sistemas de script, problema de performance ou
  66. # caso n?o quiser usar algum dos sistemas abaixo
  67. #-------------------------------------------------------------------------------
  68. module XAS_SYSTEM
  69. # Ativar o sistema de batalha, deixe como false se desejar usar apenas o
  70. # sistema de ferramentas (Intera??o com o cenário)
  71. # Caso queira desativar o sistema de batalha durante o jogo use o comando
  72. # abaixo.
  73. #
  74. # $game_system.xas_battle = X
  75. #
  76. BATTLE_SYSTEM = true
  77. # Ativar a exibi??o de dano (Sprite).
  78. DAMAGE_POP = true
  79. # Ativar o sistema de pose de a??es.
  80. CHARACTER_POSE_NAME = true
  81. # Ativar o sistema de sprites
  82. CHARACTER_SPRITE_EFFECTS = true
  83. # Ativar o sistema de dash avan?ado para o XAS.
  84. DASH_SYSTEM = true
  85. # Ativar o sistema de diagonal para o player.
  86. PLAYER_DIAGONAL_MOVEMENT = true
  87. # Ativar o sistema de diagonal para o evento
  88. EVENT_DIAGONAL_MOVEMENT = true
  89. # Ativar o sistema de condi??es para o battler.
  90. STATE_SYSTEM = true
  91. # Defini??o do mapa que ficar?o os eventos das ferramentas.
  92. ACTION_TEMPLATE_MAP_ID = 1
  93. # Defini??o da ID da variável que corresponde a ID da ferramenta,
  94. # Essa ID serve para criar eventos interativos com as ferramentas.
  95. HIT_ID = 3
  96. end
  97.  
  98. #===============================================================================
  99. # ■ XAS BUTTON SETTING
  100. #===============================================================================
  101. module XAS_BUTTON
  102. #Defini??o do bot?o de ataque.
  103. ACTION_1_BUTTON = Input::C
  104. #Defini??o do bot?o do escudo.
  105. ACTION_2_BUTTON = Input::X
  106. #Defini??o do bot?o de habildiade
  107. SKILL_BUTTON = Input::Z
  108. #Defini??o do bot?o do item.
  109. ITEM_BUTTON = Input::Y
  110. #Defini??o do bot?o de correr.
  111. DASH_BUTTON = Input::A
  112. #Defini??o do bot?o de mudar de lider.
  113. CHANGE_LEADER_BUTTON = Input::R
  114. #Ativar o bot?o de ataque.
  115. ENABLE_ACTION_1_BUTTON = true
  116. #Ativar o bot?o de escudo.
  117. ENABLE_ACTION_2_BUTTON = true #
  118. #Ativar o bot?o de habilidade.
  119. ENABLE_SKILL_BUTTON = true
  120. #Ativar o bot?o de item.
  121. ENABLE_ITEM_BUTTON = true
  122. #Ativar o bot?o de corrida.
  123. ENABLE_DASH_BUTTON = false #
  124. #Ativar o bot?o de mudar de lider.
  125. ENABLE_CHANGE_LEADER_BUTTON = true
  126. end
  127.  
  128. #===============================================================================
  129. # ■ WORD SETTING
  130. #===============================================================================
  131. # Defini??o das palavras usadas no XAS
  132. #-------------------------------------------------------------------------------
  133. module XAS_WORD
  134. # Ativar as palavras.
  135. ENABLE_WORD = true
  136. # Palavra usada quando o battler usa o sistema de defesa.
  137. GUARD = "Guard"
  138. # Palavra usada quando n?o tem MP o suficiênte para usar a habilidade.
  139. NO_MP = "SP不足"
  140. # Palavra usada quando n?o tem item para ativar a habilidade.
  141. NO_ITEM = "缺少物品"
  142. # Palavra usada quando o personagem aumenta de nível.
  143. LEVEL_UP = "等级上升了"
  144. # Palavra usada quando o personagem está com as a??es seladas.
  145. SEAL = "Sealed!"
  146. # Palavra usada quando o personagem está invencível.
  147. INVINCIBLE = "Invincible!"
  148. # Palavra usada para definir experiência.
  149. EXP = "经验值"
  150. # Palavra usada quando o alvo se esquiva do ataque.
  151. EVADED = "Evaded!"
  152. # Palavra usada quando o battler erra o ataque.
  153. MISSED = "MISS"
  154. # Palavra usada quando o counter é ativado.
  155. COUNTER = "Counter"
  156. # Palavra usada quando a habilidade é refletida.
  157. REFLECT = "Reflected"
  158. end
  159.  
  160. #===============================================================================
  161. # ■ XAS DAMAGE POP
  162. #===============================================================================
  163. # Defini??o do sistema de sprites de dano.
  164. #-------------------------------------------------------------------------------
  165. module XAS_DAMAGE_POP
  166. # Defni??o da fonte.
  167. DAMAGE_FONT_NAME = "黑体"
  168. # Defini??o do tamanho da fonte.
  169. DAMAGE_FONT_SIZE = 14
  170. # Ativar a fonte em bold.
  171. DAMAGE_FONT_BOLD = true
  172. # Ativar a fonte em itálico.
  173. DAMAGE_FONT_ITALIC = true
  174. # Ativar o Zoom no dano quando é dano crítico.
  175. DAMAGE_CRITICAL_ZOOM = true
  176. # Apresentar a quantidade de experiência e dinheiro.
  177. DAMAGE_EXP_GOLD_POP = true
  178. # Apresentar o nome da condi??o(States).
  179. DAMAGE_STATE_POP = true
  180. # Apresentar o nome do item ao pegar no campo de batalha.
  181. DAMAGE_ITEM_POP = true
  182. # Defini??o da cor padr?o da fonte.
  183. DAMAGE_DEFAULT_FONT_COLOR = Color.new(255, 90, 120)
  184. # Defini??o da cor da experiência.
  185. DAMAGE_EXP_FONT_COLOR = Color.new(0, 255, 100)
  186. # Defini??o da cor do dinheiro (Gold).
  187. DAMAGE_GOLD_FONT_COLOR = Color.new(255, 255, 50)
  188. # Defini??o da cor do item.
  189. DAMAGE_ITEM_FONT_COLOR = Color.new(255, 100, 20)
  190. end
  191.  
  192. #===============================================================================
  193. # ■ SOUND SETTING
  194. #===============================================================================
  195. # Defini??o do sistema de sons do XAS.
  196. #-------------------------------------------------------------------------------
  197. module XAS_SOUND
  198. #Som executado ao pegar o item.
  199. ITEM_DROP = "Equip2"
  200. #Som executado ao fazer level up
  201. LEVEL_UP = "powerup"
  202. #Som executado quando n?o tem item ou mp o suficiente.
  203. ACTION_COST = "Cursor1"
  204. end
  205.  
  206. #===============================================================================
  207. # ■ ANIMATION SETTING
  208. #===============================================================================
  209. # Defini??o do sistema de anima??es do XAS.
  210. # Caso n?o quiser usar as anima??es, defina o valor como 0 (Zero).
  211. #-------------------------------------------------------------------------------
  212. module XAS_ANIMATION
  213. # Anima??o quando o sistema de defesa é ativado.
  214. GUARD_ANIMATION_ID = 127
  215. # Anima??o quando o lider é trocado.
  216. CHANGE_LEADER_ANIMATION_ID = 135
  217. # Anima??o quando o battler acerta o alvo em condi??o invencível.
  218. INVINCIBLE_ANIMATION_ID = 36
  219. # Anima??o quando o battler estiver usando o sistema de charge weapon.
  220. CHARGE_ANIMATION1_ID = 155
  221. # Anima??o do battler após a arma estiver carregada.
  222. CHARGE_ANIMATION2_ID = 123
  223. # Anima??o apresentada durante o carregamento das habilidades.
  224. CAST_TIME_ANIMATION_ID = 120
  225. # Velocidade do loop das anima??es.
  226. LOOP_ANIMATIONS_SPEED = 60
  227. # Anima??o de refletir
  228. REFLECT_ANIMATION_ID = 128
  229. end
  230.  
  231. #===============================================================================
  232. # ■ GENERAL BATTLER SETTING
  233. #===============================================================================
  234. # Defini??o geral do sistema de batalha do XAS.
  235. #-------------------------------------------------------------------------------
  236. module XAS_BA
  237. #Tempo para poder ativar o bot?o de mudar de lider.
  238. CHANGE_LEADER_WAIT_TIME = 10
  239. #Deixar a hud visivel ao come?ar o jogo.
  240. #Você pode ativar ou desativar a hud usando o código abaixo
  241. # $game_system.hud_visible = true
  242. HUD_VISIBLE_AT_STARTUP = false
  243. # Defini??o da Switch da página de a??es de curta distancia.
  244. SENSOR_SELF_SWITCH = "D"
  245. # Defini??o da variável que define a area padr?o para ativar a página de
  246. # a??es de curta distancia.
  247. DEFAULT_SENSOR_RANGE_VARIABLE_ID = 4
  248. # Tempo padr?o do recuo (lockout) do battler.
  249. DEFAULT_KNOCK_BACK_DURATION = 10
  250. # Ativar sprite tremendo quando o battler está em recuo.
  251. KNOCKBACKING_SHAKE = false
  252. # Velocidade básica de movimento
  253. #BASE_MOVE_SPEED = 4.2
  254. # Velocidade extra quando o battler estiver correndo.
  255. # DASH_MOVE_SPEED = 0.6
  256. # Retornar na posi??o de 4 dire??es após algum tempo na posi??o na diagonal.
  257. DIAGONAL_DURATION_ENABLE = true
  258. # Tempo para retornar na posi??o de 4 dire??es.
  259. DIAGONAL_DURATION = 15
  260. # Defini??o do modo como a experiência é dividida entre os aliados.
  261. # 0 - EXP somente para quem matou o inimigo.
  262. # 1 - EXP é repartido para o grupo, exp no valor integral.
  263. # 2 - EXP é divido pelo numero do grupo e repartido para todos.
  264. EXP_TYPE = 2
  265. # Defini??o do tempo para remover o tesouro do mapa.
  266. TREASURE_ERASE_TIME = 5
  267. # Ativar a anima??o de fade no tesouro.
  268. FADE_TREASURE_SPRITE = true
  269. # Ativar a anima??o de levita??o no tesouro.
  270. FLOAT_TREASURE_SPRITE = true
  271. # Fixar a posi??o do bal?o independente da altura real do sprite.
  272. FIX_BALLOON_POSITION = true
  273. # Altura que o bal?o será fixado.
  274. BALLOON_HEIGHT = 32
  275. end
  276.  
  277. #===============================================================================
  278. # ■ ENEMY SETTING
  279. #===============================================================================
  280.  
  281. module XAS_BA_ENEMY
  282. # Defini??o de quais habilidades o inimigo será invunerável.
  283. #
  284. # INVUNERABLE_ACTIONS = { A=>[B,B,B,B], A=>[B,B,B,B], ...}
  285. # A - ID do inimigo.
  286. # B - ID da habilidade.
  287. INVUNERABLE_ACTIONS = {
  288. 6=>[39,40,41,42,43],
  289. 7=>[24,25,26,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],
  290. #8=>[1,2,3,4,5,6,7,11,12,13,14,15,16,17,18,19,20,21,24,25,26],
  291. 8=>[69],
  292. 9=>[39,40,41,42,43],
  293. 10=>[39,40,41,42,43],
  294. 11=>[39,40,41,42,43],
  295. 20=>[39,40,41,42,43,80,81,82,83,84,85,86,87,88,89]
  296. }
  297. # Defini??o das dire??es que o inimigo será invunerável.
  298. # GUARD_DIRECTIONS = { A=>[B], A=>[B,B,B,B], ...}
  299. # A - ID do inimigo
  300. # B - Dire??es de Invulnerabilidade.
  301. # -> 2 = Abaixo. -> 4 = Esquerda.
  302. # -> 6 = Direita. -> 8 = Acima.
  303. GUARD_DIRECTIONS = {
  304. }
  305. # Defini??o das habilidades de Counter Attack
  306. #
  307. # COUNTER_ATTACK = { A=>[B,B,B,B], A=>[B,B,B,B], ...}
  308. COUNTER_ATTACK = {
  309. }
  310.  
  311. end
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  321. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  322. #■ INITIALIZE
  323. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  324. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  325.  
  326.  
  327. #===============================================================================
  328. # ■ Game_Temp
  329. #===============================================================================
  330. class Game_Temp
  331. attr_accessor :change_leader_wait_time
  332. attr_accessor :reset_battler_time
  333. attr_accessor :tool_event
  334. attr_accessor :animation_garbage
  335.  
  336. #--------------------------------------------------------------------------
  337. # ● Initialize
  338. #--------------------------------------------------------------------------
  339. alias xas_initialize initialize
  340. def initialize
  341. @change_leader_wait_time = 0
  342. @reset_battler_time = 0
  343. @tool_event = nil
  344. @animation_garbage = []
  345. xas_initialize
  346. end
  347.  
  348. end
  349.  
  350. #===============================================================================
  351. # ■ Game_System
  352. #===============================================================================
  353. class Game_System
  354. attr_accessor :tools_on_map
  355. attr_accessor :old_interpreter_running
  356. attr_accessor :hud_visible
  357. attr_accessor :enable_hud
  358. attr_accessor :command_enable
  359. attr_accessor :pre_leader_id
  360. attr_accessor :xas_battle
  361. #--------------------------------------------------------------------------
  362. # ● Initialize
  363. #--------------------------------------------------------------------------
  364. alias x_initialize initialize
  365. def initialize
  366. @tools_on_map = []
  367. @old_interpreter_running = false
  368. @hud_visible = XAS_BA::HUD_VISIBLE_AT_STARTUP
  369. @enable_hud = false
  370. @command_enable = true
  371. @pre_leader_id = 0
  372. @xas_battle = XAS_SYSTEM::BATTLE_SYSTEM
  373. x_initialize
  374. end
  375. end
  376.  
  377. #===============================================================================
  378. # ■ Game_Battler
  379. #===============================================================================
  380. class Game_Battler
  381. attr_accessor :damage_pop
  382. attr_accessor :damage
  383. attr_accessor :damage_type
  384. attr_accessor :critical
  385. attr_accessor :invunerable_duration
  386. attr_accessor :shield
  387. attr_accessor :invunerable_actions
  388. attr_accessor :guard_directions
  389. attr_accessor :guard
  390. attr_accessor :invunerable
  391. attr_accessor :x_combo
  392. attr_accessor :cast_action
  393. attr_accessor :defeated
  394. attr_accessor :death_zoom_effect
  395. attr_accessor :counter_action
  396. attr_accessor :knockback_duration
  397. attr_accessor :hp_damage
  398. attr_accessor :mp_damage
  399.  
  400. #--------------------------------------------------------------------------
  401. # ● Initialize
  402. #--------------------------------------------------------------------------
  403. alias x_initialize initialize
  404. def initialize
  405. @damage = 0
  406. @damage_pop = false
  407. @damage_type = 0
  408. @critical = false
  409. @invunerable_duration = 0
  410. @shield = false
  411. @invunerable_actions = []
  412. @guard_directions = []
  413. @guard = true
  414. @invunerable = false
  415. @x_combo = [0,-1,0]
  416. @defeated = false
  417. @death_zoom_effect = 0
  418. @cast_action = [0,0,0,0,0]
  419. @counter_action = [0,0,true]
  420. @knockback_duration = XAS_BA::DEFAULT_KNOCK_BACK_DURATION
  421. x_initialize
  422. end
  423.  
  424. #--------------------------------------------------------------------------
  425. # ● Add Invunerable Actions
  426. #--------------------------------------------------------------------------
  427. def add_inv(action_id = 0)
  428. return if action_id == nil or action_id <= 0
  429. return if @invunerable_actions.include?(action_id)
  430. @invunerable_actions.push(action_id)
  431. end
  432.  
  433. #--------------------------------------------------------------------------
  434. # ● Remove Invunerable Actions
  435. #--------------------------------------------------------------------------
  436. def remove_inv(action_id = 0)
  437. return if action_id == nil or action_id <= 0
  438. return unless @invunerable_actions.include?(action_id)
  439. @invunerable_actions.delete(action_id)
  440. end
  441.  
  442. #--------------------------------------------------------------------------
  443. # ● Add Guard Directions
  444. #--------------------------------------------------------------------------
  445. def add_guard_dir(direction = 0)
  446. return if direction == nil or direction <= 0
  447. return if @guard_directions.include?(direction)
  448. @guard_directions.push(direction)
  449. end
  450.  
  451. #--------------------------------------------------------------------------
  452. # ● Remove Guard Directions
  453. #--------------------------------------------------------------------------
  454. def remove_guard_dir(direction = 0)
  455. return if direction == nil or direction <= 0
  456. return unless @guard_directions.include?(direction)
  457. @guard_directions.delete(direction)
  458. end
  459.  
  460. end
  461.  
  462. #===============================================================================
  463. # ■ Game Actor
  464. #===============================================================================
  465. class Game_Actor < Game_Battler
  466.  
  467. attr_accessor :x_action1_id
  468. attr_accessor :x_action2_id
  469. attr_accessor :skill_id
  470. attr_accessor :x_item_id
  471. attr_accessor :x_charge_action
  472. attr_accessor :old_equipment_id
  473. attr_accessor :item_id
  474. attr_accessor :old_level
  475. attr_reader :actor_id
  476.  
  477. #--------------------------------------------------------------------------
  478. # ● Setup
  479. #--------------------------------------------------------------------------
  480. alias x_setup setup
  481. def setup(actor_id)
  482. @x_action1_id = 0
  483. @x_action2_id = 0
  484. @skill_id = 0
  485. @x_item_id = 0
  486. @item_id = 0
  487. @x_charge_action = [0,0,0,0]
  488. @old_level = @level
  489. @old_equipment_id = [0,0,0,0,0]
  490. x_setup(actor_id)
  491. end
  492.  
  493. #--------------------------------------------------------------------------
  494. # ● Display Level Up
  495. #--------------------------------------------------------------------------
  496. alias x_display_level_up display_level_up
  497. def display_level_up(new_skills)
  498. return unless $game_party.in_battle
  499. x_display_level_up(new_skills)
  500. end
  501.  
  502. end
  503.  
  504. #===============================================================================
  505. # ■ Character
  506. #===============================================================================
  507. class Game_Character < Game_CharacterBase
  508.  
  509. attr_accessor :tool_id
  510. attr_accessor :tool_effect
  511. attr_accessor :target
  512. attr_accessor :target2
  513. attr_accessor :old_x
  514. attr_accessor :old_y
  515. attr_accessor :pre_x
  516. attr_accessor :pre_y
  517. attr_accessor :temp_id
  518. attr_accessor :angle
  519. attr_accessor :force_action_times
  520. attr_accessor :force_action
  521. attr_accessor :move_frequency
  522. attr_accessor :move_speed
  523. attr_accessor :direction_fix
  524. attr_accessor :walk_anime
  525. attr_accessor :step_anime
  526. attr_accessor :x
  527. attr_accessor :y
  528. attr_accessor :pattern
  529. attr_accessor :pattern_count
  530. attr_accessor :jump_count
  531. attr_accessor :jump_peak
  532. attr_accessor :dash_active
  533. attr_accessor :direction
  534. attr_accessor :through
  535. attr_accessor :bush_depth
  536. attr_accessor :blend_type
  537. attr_accessor :priority_type
  538. attr_accessor :jump_count
  539. attr_accessor :zoom_x
  540. attr_accessor :zoom_y
  541. attr_accessor :stop
  542. attr_accessor :force_update
  543. attr_accessor :treasure_time
  544. attr_accessor :treasure_float
  545. attr_accessor :can_update
  546. attr_accessor :pre_move_speed
  547. attr_accessor :knock_back_duration
  548. attr_accessor :orig_pos_x
  549. attr_accessor :orig_pos_y
  550. attr_accessor :shoot_time
  551. #--------------------------------------------------------------------------
  552. # ● Initialize
  553. #--------------------------------------------------------------------------
  554. alias x_initialize initialize
  555. def initialize
  556. x_initialize
  557. @tool_id = 0
  558. @tool_effect = ""
  559. @target = false
  560. @target2 = nil
  561. @old_x = @x
  562. @old_y = @y
  563. @pre_x = @x
  564. @pre_y = @y
  565. @orig_pos_x = @x
  566. @orig_pos_y = @y
  567. [url=home.php?mod=space&uid=124954]@Angle[/url] = 0
  568. @force_action_times = 0
  569. @force_action = ""
  570. @dash_active = false
  571. @zoom_x = 1.00
  572. @zoom_y = 1.00
  573. [url=home.php?mod=space&uid=76426]@stop[/url] = false
  574. @force_update = false
  575. @treasure_time = 0
  576. @treasure_float = [0,0,0,0]
  577. @can_update = true
  578. @temp_id = 0
  579. @pre_move_speed = @move_speed
  580. @shoot_time = [0,0]
  581. end
  582.  
  583. #--------------------------------------------------------------------------
  584. # ● Invunerable
  585. #--------------------------------------------------------------------------
  586. def invunerable(enable = false)
  587. return if [url=home.php?mod=space&uid=133701]@battler[/url] == nil or @battler.dead?
  588. @battler.invunerable = enable
  589. end
  590.  
  591. #--------------------------------------------------------------------------
  592. # ● Fast Breath
  593. #--------------------------------------------------------------------------
  594. def fast_breath(enable = true)
  595. return if [url=home.php?mod=space&uid=133701]@battler[/url] == nil or @battler.dead?
  596. @battler.fast_breath_effect = enable
  597. end
  598. end
  599.  
  600. #===============================================================================
  601. # ■ Game_Event
  602. #===============================================================================
  603. class Game_Event < Game_Character
  604. attr_accessor :target
  605. attr_reader :name
  606. attr_accessor :collision_attack
  607.  
  608. #--------------------------------------------------------------------------
  609. # ● Object
  610. #--------------------------------------------------------------------------
  611. alias x_event_initialize initialize
  612. def initialize(map_id, event)
  613. x_event_initialize(map_id, event)
  614. @collision_attack = false
  615. if @event.name =~ /<O(\d+)>/i
  616. [url=home.php?mod=space&uid=316553]@opacity[/url] = $1.to_i
  617. end
  618. if @event.name =~ /<B(\d+)>/i
  619. @blend_type = $1.to_i
  620. end
  621. end
  622.  
  623. #--------------------------------------------------------------------------
  624. # ● Erase
  625. #--------------------------------------------------------------------------
  626. alias x_event_erase erase
  627. def erase
  628. if self.tool_id > 0
  629. $game_system.tools_on_map.delete(self.tool_id)
  630. end
  631. x_event_erase
  632. end
  633.  
  634. #--------------------------------------------------------------------------
  635. # ● Event Name
  636. #--------------------------------------------------------------------------
  637. def name
  638. return @event.name
  639. end
  640.  
  641. end
  642.  
  643. #===============================================================================
  644. # ■ Game Followers
  645. #===============================================================================
  646. class Game_Followers
  647.  
  648. #--------------------------------------------------------------------------
  649. # ● Initialize
  650. #--------------------------------------------------------------------------
  651. alias x_party_initialize initialize
  652. def initialize(leader)
  653. x_party_initialize(leader)
  654. if $xas_party_system == nil
  655. @visible = false
  656. end
  657. end
  658. end
  659.  
  660. #===============================================================================
  661. # ■ Game Map
  662. #===============================================================================
  663. class Game_Map
  664.  
  665. #--------------------------------------------------------------------------
  666. # ● Setup
  667. #--------------------------------------------------------------------------
  668. alias x_initial_setup setup
  669. def setup(map_id)
  670. x_initial_setup(map_id)
  671. xas_initial_setup(map_id)
  672. end
  673.  
  674. #--------------------------------------------------------------------------
  675. # ● XAS Initial Setup
  676. #--------------------------------------------------------------------------
  677. def xas_initial_setup(map_id)
  678. for actor in $game_party.members
  679. setup_initial_members(actor)
  680. end
  681. end
  682.  
  683. #--------------------------------------------------------------------------
  684. # ● Setup Initial Membes
  685. #--------------------------------------------------------------------------
  686. def setup_initial_members(actor)
  687.  
  688. end
  689. end
  690.  
  691.  
  692. #==============================================================================
  693. # ■ Scene_Map
  694. #==============================================================================
  695. class Scene_Map < Scene_Base
  696.  
  697. #--------------------------------------------------------------------------
  698. # ● Call Menu
  699. #--------------------------------------------------------------------------
  700. alias x_call_menu call_menu
  701. def call_menu
  702. return if $game_player.action != nil
  703. $game_player.reset_charge_temp
  704. x_call_menu
  705. end
  706.  
  707. end
  708. #===============================================================================
  709. # ■ Scene_Refresh
  710. #===============================================================================
  711. class Scene_Refresh
  712.  
  713. #--------------------------------------------------------------------------
  714. # ● Main
  715. #--------------------------------------------------------------------------
  716. def main
  717. SceneManager.call(Scene_Map)
  718. end
  719. end
  720.  
  721. #==============================================================================
  722. # ■ Game_Player
  723. #==============================================================================
  724. class Game_Player < Game_Character
  725.  
  726. #--------------------------------------------------------------------------
  727. # ● Leader Changed
  728. #--------------------------------------------------------------------------
  729. def leader_changed?(actor)
  730. if $game_party.members[0] == nil
  731. return true if actor != nil
  732. elsif $game_party.members[0] != nil
  733. return true if actor == nil
  734. return true if actor.actor_id != $game_party.members[0].actor_id
  735. end
  736. return false
  737. end
  738.  
  739. end
  740. $xas = true
  741.  
  742.  
  743. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  744. #■ MOVEMENT - DIAGONAL MOVEMENT
  745. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  746.  
  747.  
  748. #===============================================================================
  749. # ■ Game Character
  750. #===============================================================================
  751. class Game_CharacterBase
  752.  
  753. #--------------------------------------------------------------------------
  754. # ● Set Direction
  755. #--------------------------------------------------------------------------
  756. alias diagonal_set_direction set_direction
  757. def set_direction(d)
  758. diagonal_set_direction(d)
  759. @diagonal_direction = 0
  760. reset_diagonal
  761. end
  762.  
  763. end
  764.  
  765. #===============================================================================
  766. # ■ Game Character
  767. #===============================================================================
  768. class Game_Character < Game_CharacterBase
  769.  
  770. attr_accessor :diagonal
  771. attr_accessor :diagonal_direction
  772. attr_accessor :sprite_angle_enable
  773. attr_accessor :diagonal_time
  774.  
  775. #--------------------------------------------------------------------------
  776. # ● Initialize
  777. #--------------------------------------------------------------------------
  778. alias diagonal_initialize initialize
  779. def initialize
  780. diagonal_initialize
  781. if XAS_SYSTEM::EVENT_DIAGONAL_MOVEMENT
  782. @diagonal = true
  783. else
  784. @diagonal = false
  785. end
  786. @diagonal_direction = 0
  787. @sprite_angle_enable = false
  788. @diagonal_time = 0
  789. end
  790.  
  791. #--------------------------------------------------------------------------
  792. # ● Reset Diagonal
  793. #--------------------------------------------------------------------------
  794. def reset_diagonal
  795. return if @direction_fix
  796. return if @diagonal == false
  797. @diagonal_direction = 0
  798. @diagonal_time = 0
  799. [url=home.php?mod=space&uid=124954]@Angle[/url] = 0 if @sprite_angle_enable
  800. end
  801.  
  802. #--------------------------------------------------------------------------
  803. # ● Enable Diagonal
  804. #--------------------------------------------------------------------------
  805. def enable_diagonal(dir = 0)
  806. return if @direction_fix
  807. return if @diagonal == false
  808. return if dir == 0
  809. @diagonal_direction = dir
  810. @diagonal_time = XAS_BA::DIAGONAL_DURATION
  811. [url=home.php?mod=space&uid=124954]@Angle[/url] = 315 if @sprite_angle_enable
  812. end
  813.  
  814. #--------------------------------------------------------------------------
  815. # ● Turn Upper Right
  816. #--------------------------------------------------------------------------
  817. def turn_upper_right
  818. enable_diagonal(9)
  819. @direction = 8 unless @direction_fix
  820. end
  821.  
  822. #--------------------------------------------------------------------------
  823. # ● Turn Upper Left
  824. #--------------------------------------------------------------------------
  825. def turn_upper_left
  826. enable_diagonal(7)
  827. @direction = 4 unless @direction_fix
  828. end
  829.  
  830. #--------------------------------------------------------------------------
  831. # ● Turn Lower Right
  832. #--------------------------------------------------------------------------
  833. def turn_lower_right
  834. enable_diagonal(3)
  835. @direction = 6 unless @direction_fix
  836. end
  837.  
  838. #--------------------------------------------------------------------------
  839. # ● Turn Lower Left
  840. #--------------------------------------------------------------------------
  841. def turn_lower_left
  842. enable_diagonal(1)
  843. @direction = 2 unless @direction_fix
  844. end
  845.  
  846. #--------------------------------------------------------------------------
  847. # ● Move forward
  848. #--------------------------------------------------------------------------
  849. alias diagonal_move_forward move_forward
  850. def move_forward
  851. return if move_forward_diagonal?
  852. diagonal_move_forward
  853. end
  854.  
  855. #--------------------------------------------------------------------------
  856. # ● Move forward Diagonal?
  857. #--------------------------------------------------------------------------
  858. def move_forward_diagonal?
  859. return false if @diagonal == false
  860. if @diagonal_direction != 0
  861. case @diagonal_direction
  862. when 1 #Lower Left
  863. move_diagonal(4, 2)
  864. @direction = 2
  865. when 3 #Lower Right
  866. move_diagonal(6, 2)
  867. @direction = 6
  868. when 7 #Upper Left
  869. move_diagonal(4, 8)
  870. @direction = 4
  871. when 9 #Upper Right
  872. move_diagonal(6, 8)
  873. @direction = 8
  874. end
  875. enable_diagonal(@diagonal_direction)
  876. return true
  877. end
  878. return false
  879. end
  880.  
  881. #--------------------------------------------------------------------------
  882. # ● Move Backward
  883. #--------------------------------------------------------------------------
  884. alias diagonal_move_backward move_backward
  885. def move_backward
  886. return if move_backward_diagonal?
  887. diagonal_move_backward
  888. end
  889.  
  890. #--------------------------------------------------------------------------
  891. # ● Move Backward Diagonal?
  892. #--------------------------------------------------------------------------
  893. def move_backward_diagonal?
  894. return false if @diagonal == false
  895. if @diagonal_direction != 0
  896. last_direction_fix = @direction_fix
  897. @direction_fix = true
  898. case @diagonal_direction
  899. when 1
  900. move_diagonal(6, 8)
  901. @direction = 6
  902. when 3
  903. move_diagonal(4, 8)
  904. @direction = 4
  905. when 7
  906. move_diagonal(6, 2)
  907. @direction = 6
  908. when 9
  909. move_diagonal(4, 2)
  910. @direction = 2
  911. end
  912. enable_diagonal(@diagonal_direction)
  913. @direction_fix = last_direction_fix
  914. return true
  915. end
  916. return false
  917. end
  918.  
  919. #--------------------------------------------------------------------------
  920. # ● Turn Toward Player
  921. #--------------------------------------------------------------------------
  922. alias turn_toward_player_diagonal turn_toward_player
  923. def turn_toward_player
  924. if @diagonal
  925. diagonal_turn_toward_player
  926. return
  927. end
  928. turn_toward_player_diagonal
  929. end
  930.  
  931. #--------------------------------------------------------------------------
  932. # ● Diagonal Turn Toward Player
  933. #--------------------------------------------------------------------------
  934. def diagonal_turn_toward_player
  935. sx = distance_x_from($game_player.x)
  936. sy = distance_y_from($game_player.y)
  937. sd = sx.abs - sy.abs
  938. sdx = sd.abs - sx.abs
  939. sdy = sd.abs - sy.abs
  940. return if sx == 0 and sy == 0
  941. #Turn Upper Right
  942. if sx < 0 and sy > 0
  943. if sx.abs > sy.abs and sdx.abs < sd.abs
  944. set_direction(6)
  945. elsif sx.abs < sy.abs and sdy.abs < sd.abs
  946. set_direction(8)
  947. else
  948. turn_upper_right
  949. end
  950. enable_diagonal(9)
  951. #Turn Upper Left
  952. elsif sx > 0 and sy > 0
  953. if sx.abs > sy.abs and sdx.abs < sd.abs
  954. set_direction(4)
  955. elsif sx.abs < sy.abs and sdy.abs < sd.abs
  956. set_direction(8)
  957. else
  958. set_direction(4)
  959. turn_upper_left
  960. end
  961. enable_diagonal(7)
  962. #Turn Lower Left
  963. elsif sx > 0 and sy < 0
  964. if sx.abs > sy.abs and sdx.abs < sd.abs
  965. set_direction(4)
  966. elsif sx.abs < sy.abs and sdy.abs < sd.abs
  967. set_direction(2)
  968. else
  969. turn_lower_left
  970. end
  971. enable_diagonal(1)
  972. #Turn Lower Right
  973. elsif sx < 0 and sy < 0
  974. if sx.abs > sy.abs and sdx.abs < sd.abs
  975. set_direction(6)
  976. elsif sx.abs < sy.abs and sdy.abs < sd.abs
  977. set_direction(2)
  978. else
  979. turn_lower_right
  980. end
  981. enable_diagonal(3)
  982. elsif sx < 0
  983. set_direction(6)
  984. elsif sx > 0
  985. set_direction(4)
  986. elsif sy > 0
  987. set_direction(8)
  988. elsif sy < 0
  989. set_direction(2)
  990. end
  991.  
  992. end
  993.  
  994. #--------------------------------------------------------------------------
  995. # ● Move toward Player
  996. #--------------------------------------------------------------------------
  997. alias move_toward_player_diagonal move_toward_player
  998. def move_toward_player
  999. if @diagonal
  1000. diagonal_move_toward_player
  1001. return
  1002. end
  1003. move_toward_player_diagonal
  1004. end
  1005.  
  1006. #--------------------------------------------------------------------------
  1007. # ● Diagonal Move Toward Player
  1008. #--------------------------------------------------------------------------
  1009. def diagonal_move_toward_player
  1010. sx = distance_x_from($game_player.x)
  1011. sy = distance_y_from($game_player.y)
  1012. if sx == 0 and sy == 0
  1013. return
  1014. end
  1015. abs_sx = sx.abs
  1016. abs_sy = sy.abs
  1017. if abs_sx == abs_sy
  1018. rand(2) == 0 ? abs_sx += 1 : abs_sy += 1
  1019. end
  1020. if abs_sx
  1021. if sx < 0 and sy > 0
  1022. move_diagonal(6, 8)
  1023. move_random unless moving?
  1024. enable_diagonal(9)
  1025. elsif sx > 0 and sy > 0
  1026. move_diagonal(4, 8)
  1027. move_random unless moving?
  1028. enable_diagonal(7)
  1029. elsif sx > 0 and sy < 0
  1030. move_diagonal(4, 2)
  1031. move_random unless moving?
  1032. enable_diagonal(1)
  1033. elsif sx < 0 and sy < 0
  1034. move_diagonal(6, 2)
  1035. move_random unless moving?
  1036. enable_diagonal(3)
  1037. elsif sx < 0
  1038. move_straight(6)
  1039. elsif sx > 0
  1040. move_straight(4)
  1041. elsif sy > 0
  1042. move_straight(8)
  1043. elsif sy < 0
  1044. move_straight(2)
  1045. end
  1046. if abs_sx != 1 and abs_sy != 1
  1047. move_random unless moving?
  1048. end
  1049. end
  1050. end
  1051.  
  1052. #--------------------------------------------------------------------------
  1053. # ● turn_right_45
  1054. #--------------------------------------------------------------------------
  1055. def turn_right_45
  1056. if @diagonal and @diagonal_direction != 0
  1057. case @diagonal_direction
  1058. when 1; set_direction(4)
  1059. when 3; set_direction(2)
  1060. when 7; set_direction(8)
  1061. when 9; set_direction(6)
  1062. end
  1063. else
  1064. case @direction
  1065. when 2; turn_lower_left
  1066. when 4; turn_upper_left
  1067. when 6; turn_lower_right
  1068. when 8; turn_upper_right
  1069. end
  1070. end
  1071. end
  1072.  
  1073. #--------------------------------------------------------------------------
  1074. # ● turn_left_45
  1075. #--------------------------------------------------------------------------
  1076. def turn_left_45
  1077. if @diagonal and @diagonal_direction != 0
  1078. case @diagonal_direction
  1079. when 1; set_direction(2)
  1080. when 3; set_direction(6)
  1081. when 7; set_direction(4)
  1082. when 9; set_direction(8)
  1083. end
  1084. else
  1085. case @direction
  1086. when 2; turn_lower_right
  1087. when 4; turn_lower_left
  1088. when 6; turn_upper_right
  1089. when 8; turn_upper_left
  1090. end
  1091. end
  1092. end
  1093.  
  1094. #--------------------------------------------------------------------------
  1095. # ● turn_right_90
  1096. #--------------------------------------------------------------------------
  1097. alias diagonal_turn_right_90 turn_right_90
  1098. def turn_right_90
  1099. if @diagonal and @diagonal_direction != 0
  1100. turn_diagonal_right_90
  1101. return
  1102. end
  1103. diagonal_turn_right_90
  1104. end
  1105.  
  1106. #--------------------------------------------------------------------------
  1107. # ● turn_diagonal_right_90
  1108. #--------------------------------------------------------------------------
  1109. def turn_diagonal_right_90
  1110. case @diagonal_direction
  1111. when 1; turn_upper_left
  1112. when 3; turn_lower_left
  1113. when 7; turn_upper_right
  1114. when 9; turn_lower_right
  1115. end
  1116. end
  1117.  
  1118. #--------------------------------------------------------------------------
  1119. # ● turn_left_90
  1120. #--------------------------------------------------------------------------
  1121. alias diagonal_turn_left_90 turn_left_90
  1122. def turn_left_90
  1123. if @diagonal and @diagonal_direction != 0
  1124. turn_diagonal_left_90
  1125. return
  1126. end
  1127. diagonal_turn_left_90
  1128. end
  1129.  
  1130. #--------------------------------------------------------------------------
  1131. # ● turn_diagonal_left_90
  1132. #--------------------------------------------------------------------------
  1133. def turn_diagonal_left_90
  1134. case @diagonal_direction
  1135. when 1; turn_lower_right
  1136. when 3; turn_upper_right
  1137. when 7; turn_lower_left
  1138. when 9; turn_upper_left
  1139. end
  1140. end
  1141.  
  1142. #--------------------------------------------------------------------------
  1143. # ● diagonal_turn_180
  1144. #--------------------------------------------------------------------------
  1145. alias diagonal_turn_180 turn_180
  1146. def turn_180
  1147. if @diagonal and @diagonal_direction != 0
  1148. turn_diagonal_180
  1149. return
  1150. end
  1151. diagonal_turn_180
  1152. end
  1153.  
  1154. #--------------------------------------------------------------------------
  1155. # ● turn_diagonal_180
  1156. #--------------------------------------------------------------------------
  1157. def turn_diagonal_180
  1158. case @diagonal_direction
  1159. when 1; turn_upper_right
  1160. when 3; turn_upper_left
  1161. when 7; turn_lower_right
  1162. when 9; turn_lower_left
  1163. end
  1164. end
  1165.  
  1166. #--------------------------------------------------------------------------
  1167. # ● turn_random
  1168. #--------------------------------------------------------------------------
  1169. alias diagonal_turn_random turn_random
  1170. def turn_random
  1171. if @diagonal
  1172. turn_diagonal_random
  1173. return
  1174. end
  1175. diagonal_turn_random
  1176. end
  1177.  
  1178. #--------------------------------------------------------------------------
  1179. # ● turn_diagonal_random
  1180. #--------------------------------------------------------------------------
  1181. def turn_diagonal_random
  1182. case rand(8)
  1183. when 0; set_direction(8)
  1184. when 1; set_direction(6)
  1185. when 2; set_direction(4)
  1186. when 3; set_direction(2)
  1187. when 4; turn_lower_left
  1188. when 5; turn_lower_right
  1189. when 6; turn_upper_left
  1190. when 7; turn_upper_right
  1191. end
  1192. end
  1193.  
  1194. end
  1195.  
  1196. #===============================================================================
  1197. # ■ Game_Player
  1198. #===============================================================================
  1199. class Game_Player < Game_Character
  1200.  
  1201. #--------------------------------------------------------------------------
  1202. # ● Move By Input
  1203. #--------------------------------------------------------------------------
  1204. alias diagonal_move_by_input move_by_input
  1205. def move_by_input
  1206. if XAS_SYSTEM::PLAYER_DIAGONAL_MOVEMENT
  1207. player_diagonal_move_by_input
  1208. # update_sprite_diagonal
  1209. update_return_direction
  1210. return
  1211. end
  1212. diagonal_move_by_input
  1213. end
  1214.  
  1215. #--------------------------------------------------------------------------
  1216. # ● Update Sprite Diagonal
  1217. #--------------------------------------------------------------------------
  1218. def update_sprite_diagonal
  1219. return if @diagonal_direction == 0
  1220. return if self.action != nil
  1221. return if @dash_active
  1222. make_pose("_Diagonal", 2)
  1223. end
  1224.  
  1225. #--------------------------------------------------------------------------
  1226. # ● Update Return Direction
  1227. #--------------------------------------------------------------------------
  1228. def update_return_direction
  1229. return if XAS_BA::DIAGONAL_DURATION_ENABLE == false
  1230. return if @diagonal_time == 0
  1231. return if moving? or @stop
  1232. @diagonal_time -= 1
  1233. @diagonal_direction = 0 if @diagonal_time == 0
  1234. end
  1235.  
  1236. #--------------------------------------------------------------------------
  1237. # ● Player Diagonal Move By Input
  1238. #--------------------------------------------------------------------------
  1239. def player_diagonal_move_by_input
  1240. return unless movable?
  1241. return if $game_map.interpreter.running?
  1242. case Input.dir8
  1243. when 1
  1244. move_diagonal(4, 2)
  1245. unless moving?
  1246. move_straight(4)
  1247. move_straight(2)
  1248. end
  1249. @diagonal_direction = 1
  1250. when 2; move_straight(2)
  1251. when 3
  1252. move_diagonal(6, 2)
  1253. unless moving?
  1254. move_straight(6)
  1255. move_straight(2)
  1256. end
  1257. @diagonal_direction = 3
  1258. when 4; move_straight(4)
  1259. when 6; move_straight(6)
  1260. when 7
  1261. move_diagonal(4, 8)
  1262. unless moving?
  1263. move_straight(4)
  1264. move_straight(8)
  1265. end
  1266. @diagonal_direction = 7
  1267. when 8; move_straight(8)
  1268. when 9
  1269. move_diagonal(6, 8)
  1270. unless moving?
  1271. move_straight(6)
  1272. move_straight(8)
  1273. end
  1274. @diagonal_direction = 9
  1275. end
  1276. end
  1277.  
  1278. end
  1279.  
  1280.  
  1281. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  1282. #■ MOVEMENT - FORCE ACTION
  1283. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  1284.  
  1285.  
  1286. #===============================================================================
  1287. # ■ Game Character
  1288. #===============================================================================
  1289. class Game_Character < Game_CharacterBase
  1290.  
  1291. #--------------------------------------------------------------------------
  1292. # ● moving 2?
  1293. #--------------------------------------------------------------------------
  1294. def moving2?
  1295. @real_x != @x || @real_y != @y
  1296. end
  1297.  
  1298. #--------------------------------------------------------------------------
  1299. # ● Can Force Action?
  1300. #--------------------------------------------------------------------------
  1301. def can_force_action?
  1302. return false if @force_action_times == 0
  1303. return false if self.moving2?
  1304. return false if self.jumping?
  1305. return false if self.knockbacking?
  1306. return false if self.stop
  1307. return true
  1308. end
  1309.  
  1310. #--------------------------------------------------------------------------
  1311. # ● Update Force Action
  1312. #--------------------------------------------------------------------------
  1313. def update_force_action
  1314. @force_action_times -= 1
  1315. execute_force_action
  1316. execute_force_action_tool_effect if @tool_id > 0 and @tool_effect != ""
  1317. reset_auto_action if @force_action_times == 0
  1318. end
  1319.  
  1320. #--------------------------------------------------------------------------
  1321. # ● Execute Force Action
  1322. #--------------------------------------------------------------------------
  1323. def execute_force_action
  1324. case @force_action
  1325. when "Forward"
  1326. move_forward
  1327. when "Backward"
  1328. move_backward
  1329. when "Toward Player"
  1330. move_toward_player
  1331. when "Move Left"
  1332. move_straight(4)
  1333. when "Move Right"
  1334. move_straight(6)
  1335. when "Move Up"
  1336. move_straight(8)
  1337. when "Move Down"
  1338. move_straight(2)
  1339. when "All Shoot"
  1340. if self.action != nil
  1341. turn_right_45
  1342. self.shoot(self.action.id) unless @force_action_times == 0
  1343. end
  1344. when "Four Shoot"
  1345. if self.action != nil
  1346. turn_right_90
  1347. self.shoot(self.action.id) unless @force_action_times == 0
  1348. end
  1349. when "Three Shoot"
  1350. if self.action != nil
  1351. case @force_action_times
  1352. when 2
  1353. turn_right_45
  1354. when 1
  1355. turn_left_90
  1356. when 0
  1357. turn_right_45
  1358. end
  1359. self.shoot(self.action.id) unless @force_action_times == 0
  1360. end
  1361. when "Two Shoot"
  1362. if self.action != nil
  1363. turn_180
  1364. self.shoot(self.action.id) unless @force_action_times == 0
  1365. end
  1366. end
  1367. end
  1368.  
  1369. #--------------------------------------------------------------------------
  1370. # ● Execute Force Action Tool Effect
  1371. #--------------------------------------------------------------------------
  1372. def execute_force_action_tool_effect
  1373. action_effect_during_move
  1374. action_effect_after_move if @force_action_times == 0
  1375. end
  1376.  
  1377. #--------------------------------------------------------------------------
  1378. # ● Auto Action Effect During Move
  1379. #--------------------------------------------------------------------------
  1380. def reset_auto_action
  1381. @force_action = ""
  1382. @force_action_times = 0
  1383. @anime_count = 0
  1384. end
  1385.  
  1386. #--------------------------------------------------------------------------
  1387. # ● Action Effect During Move
  1388. #--------------------------------------------------------------------------
  1389. def action_effect_during_move
  1390. if @tool_effect == "Boomerang" and @force_action == "Toward Player"
  1391. if @x == $game_player.x and @y == $game_player.y
  1392. self.action.duration = 15
  1393. @force_action_times = 0
  1394. @force_action_type = ""
  1395. end
  1396. end
  1397. end
  1398.  
  1399. #--------------------------------------------------------------------------
  1400. # ● Action Effect After Move
  1401. #--------------------------------------------------------------------------
  1402. def action_effect_after_move
  1403. if @tool_effect == "Boomerang"
  1404. @force_action_times = 30
  1405. @force_action = "Toward Player"
  1406. @move_frequency = 6
  1407. @move_speed = 5.5
  1408. end
  1409. end
  1410.  
  1411. end
  1412.  
  1413.  
  1414. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  1415. #■ MOVEMENT - EXTRA MOVEMENT
  1416. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  1417.  
  1418.  
  1419. #===============================================================================
  1420. # ■ Game Character
  1421. #===============================================================================
  1422. class Game_Character < Game_CharacterBase
  1423.  
  1424. #--------------------------------------------------------------------------
  1425. # ● Check XY
  1426. #--------------------------------------------------------------------------
  1427. def check_xy
  1428. @pre_x = @x
  1429. @pre_y = @y
  1430. end
  1431.  
  1432. #--------------------------------------------------------------------------
  1433. # ● Turn Reverse
  1434. #--------------------------------------------------------------------------
  1435. def turn_reverse(dir)
  1436. case dir
  1437. when 2; set_direction(8)
  1438. when 4; set_direction(6)
  1439. when 6; set_direction(4)
  1440. when 8; set_direction(2)
  1441. end
  1442. end
  1443.  
  1444. #--------------------------------------------------------------------------
  1445. # ● Org Here
  1446. #--------------------------------------------------------------------------
  1447. def org_here
  1448. @orig_pos_x = @x
  1449. @orig_pos_y = @y
  1450. end
  1451.  
  1452. #--------------------------------------------------------------------------
  1453. # ● return_org
  1454. #--------------------------------------------------------------------------
  1455. def return_org(type = 0)
  1456. if type == 1
  1457. moveto(@orig_pos_x,@orig_pos_x)
  1458. else
  1459. jump(0,0)
  1460. end
  1461. @x = @orig_pos_x
  1462. @y = @orig_pos_y
  1463. end
  1464.  
  1465. #--------------------------------------------------------------------------
  1466. # ● Dual Switch
  1467. #--------------------------------------------------------------------------
  1468. def dual_switch(switch_on, switch_off,percentage = 100)
  1469. enable_per = rand(100)
  1470. if enable_per <= percentage
  1471. $game_switches[switch_on] = true
  1472. $game_switches[switch_off] = false
  1473. $game_map.need_refresh = true
  1474. end
  1475. end
  1476.  
  1477. #--------------------------------------------------------------------------
  1478. # ● Move Forward 2
  1479. #--------------------------------------------------------------------------
  1480. def move_forward2
  1481. return if moving2?
  1482. move_forward
  1483. end
  1484.  
  1485. #--------------------------------------------------------------------------
  1486. # ● Bounce Direction
  1487. #--------------------------------------------------------------------------
  1488. def bounce_direction
  1489. @diagonal = true
  1490. turn_random
  1491. end
  1492.  
  1493. #--------------------------------------------------------------------------
  1494. # ● Turn_back
  1495. #--------------------------------------------------------------------------
  1496. def turn_back
  1497. if @diagonal_direction != 0
  1498. case @diagonal_direction
  1499. when 1
  1500. turn_upper_right
  1501. when 3
  1502. turn_upper_left
  1503. when 7
  1504. turn_lower_right
  1505. when 9
  1506. turn_lower_left
  1507. end
  1508. else
  1509. case @direction
  1510. when 2; set_direction(8)
  1511. when 4; @direction = 6#move_straight(6)#set_direction(6)
  1512. when 6; set_direction(4)
  1513. when 8; set_direction(2)
  1514. end
  1515. end
  1516. end
  1517.  
  1518. #--------------------------------------------------------------------------
  1519. # ● Jump_high
  1520. #--------------------------------------------------------------------------
  1521. def jump_high(x_plus,y_plus,high = 10)
  1522. @x += x_plus
  1523. @y += y_plus
  1524. distance = Math.sqrt(x_plus * x_plus + y_plus * y_plus).round
  1525. @jump_peak = high + distance - @move_speed
  1526. @jump_count = @jump_peak * 2
  1527. @stop_count = 0
  1528. straighten
  1529. end
  1530.  
  1531. #--------------------------------------------------------------------------
  1532. # ● Passable Temp
  1533. #--------------------------------------------------------------------------
  1534. def passable_temp_id?(x, y)
  1535. return false unless $game_map.valid?(x, y)
  1536. return true if @through or debug_through?
  1537. return false unless map_passable?(x, y,@direction)
  1538. return false if collide_with_characters_temp_id?(x, y)
  1539. return true
  1540. end
  1541.  
  1542. #--------------------------------------------------------------------------
  1543. # ● Collide With Characters
  1544. #--------------------------------------------------------------------------
  1545. def collide_with_characters_temp_id?(x, y)
  1546. for event in $game_map.events_xy(x, y)
  1547. unless event.through or event.battler != nil
  1548. return true if self.is_a?(Game_Event)
  1549. return true if event.priority_type >= 1
  1550. end
  1551. end
  1552. return false
  1553. end
  1554.  
  1555. #--------------------------------------------------------------------------
  1556. # ● Force Move Route
  1557. #--------------------------------------------------------------------------
  1558. alias x_force_move_route force_move_route
  1559. def force_move_route(move_route)
  1560. if self.battler != nil and self.is_a?(Game_Event)
  1561. return
  1562. end
  1563. x_force_move_route(move_route)
  1564. end
  1565. end
  1566.  
  1567.  
  1568. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  1569. #■ MOVEMENT - PLAYER COMMANDS
  1570. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  1571.  
  1572.  
  1573. #==============================================================================
  1574. # ■ Game_Player
  1575. #==============================================================================
  1576. class Game_Player < Game_Character
  1577. include XAS_BUTTON
  1578.  
  1579. #--------------------------------------------------------------------------
  1580. # ● Update Action Command
  1581. #--------------------------------------------------------------------------
  1582. def update_action_command
  1583. update_check_battler_equipment if can_check_battler_equipment?
  1584. update_dash_button
  1585. update_auto_target_shoot
  1586. update_combo_time
  1587. update_action_1_button
  1588. update_action_2_button
  1589. update_skill_button
  1590. update_item_button
  1591. update_change_leader_button
  1592. update_charge_button
  1593. end
  1594.  
  1595. #--------------------------------------------------------------------------
  1596. # ● Can Use Command?
  1597. #--------------------------------------------------------------------------
  1598. def can_use_command?
  1599. return false if $game_map.interpreter.running?
  1600. return false if $game_message.visible
  1601. return false if self.battler == nil
  1602. return false if self.action != nil
  1603. return false if self.knockbacking?
  1604. return false if @stop
  1605. return true
  1606. end
  1607.  
  1608. #--------------------------------------------------------------------------
  1609. # ● Update Check Battler Equipment
  1610. #--------------------------------------------------------------------------
  1611. def update_check_battler_equipment
  1612.  
  1613. end
  1614.  
  1615. #--------------------------------------------------------------------------
  1616. # ● Can Check Battler Equipment
  1617. #--------------------------------------------------------------------------
  1618. def can_check_battler_equipment?
  1619. if self.battler.old_equipment_id[0] != self.battler.equips[0] or
  1620. self.battler.old_equipment_id[1] != self.battler.equips[1] or
  1621. self.battler.old_equipment_id[2] != self.battler.equips[2] or
  1622. self.battler.old_equipment_id[3] != self.battler.equips[3] or
  1623. self.battler.old_equipment_id[4] != self.battler.equips[4]
  1624. self.battler.old_equipment_id[0] = self.battler.equips[0]
  1625. self.battler.old_equipment_id[1] = self.battler.equips[1]
  1626. self.battler.old_equipment_id[2] = self.battler.equips[2]
  1627. self.battler.old_equipment_id[3] = self.battler.equips[3]
  1628. self.battler.old_equipment_id[4] = self.battler.equips[4]
  1629. return true
  1630. end
  1631. return false
  1632. end
  1633.  
  1634. #--------------------------------------------------------------------------
  1635. # ● Update Charge Button
  1636. #--------------------------------------------------------------------------
  1637. def update_charge_button
  1638. return unless can_charge_command?
  1639. if Input.press?(ACTION_1_BUTTON) and ENABLE_ACTION_1_BUTTON
  1640. update_charge_effect(0)
  1641. reset_charge_temp if Input.press?(ACTION_2_BUTTON) and ENABLE_ACTION_2_BUTTON
  1642. elsif Input.press?(ACTION_2_BUTTON)
  1643. update_charge_effect(1)
  1644. reset_charge_temp if Input.press?(ACTION_1_BUTTON)
  1645. else
  1646. if self.battler.x_charge_action[2] >= self.battler.x_charge_action[1]
  1647. self.shoot(self.battler.x_charge_action[0])
  1648. end
  1649. reset_charge_temp
  1650. end
  1651. end
  1652.  
  1653. #--------------------------------------------------------------------------
  1654. # ● Update Charge Effect
  1655. #--------------------------------------------------------------------------
  1656. def update_charge_effect(type)
  1657. if self.battler.x_charge_action[2] == 0
  1658. return unless equipped_charge_action?(type)
  1659. end
  1660. if self.battler.x_charge_action[2] < self.battler.x_charge_action[1]
  1661. self.battler.x_charge_action[2] += 1
  1662. end
  1663. self.battler.x_charge_action[3] += 1
  1664. if self.battler.x_charge_action[3] > XAS_ANIMATION::LOOP_ANIMATIONS_SPEED
  1665. self.battler.x_charge_action[3] = 0
  1666. if self.battler.x_charge_action[2] < self.battler.x_charge_action[1]
  1667. self.animation_id = XAS_ANIMATION::CHARGE_ANIMATION1_ID
  1668. else
  1669. self.animation_id = XAS_ANIMATION::CHARGE_ANIMATION2_ID
  1670. end
  1671. end
  1672. end
  1673.  
  1674. #--------------------------------------------------------------------------
  1675. # ● Equipped Charge Action
  1676. #--------------------------------------------------------------------------
  1677. def equipped_charge_action?(type)
  1678. case type
  1679. when 0
  1680. weapon = self.battler.equips[0]
  1681. when 1
  1682. weapon = self.battler.equips[1]
  1683. end
  1684. if weapon == nil
  1685. return false
  1686. reset_charge_temp
  1687. end
  1688. if weapon.note =~ /<Charge Action = (\d+) - (\d+)>/
  1689. self.battler.x_charge_action[0] = $1.to_i rescue 0#Skill ID
  1690. self.battler.x_charge_action[1] = $2.to_i rescue 0#Max Time
  1691. self.battler.x_charge_action[2] = 0#Current Time
  1692. self.battler.x_charge_action[3] = 0#Loop Anime Time
  1693. return true
  1694. end
  1695. return false
  1696. reset_charge_temp
  1697. end
  1698.  
  1699. #--------------------------------------------------------------------------
  1700. # ● Update Combo Time
  1701. #--------------------------------------------------------------------------
  1702. def update_combo_time
  1703. return if self.battler.x_combo[2] == 0
  1704. self.battler.x_combo[2] -= 1
  1705. if self.battler.x_combo[2] == 0
  1706. self.battler.x_combo[0] = 0
  1707. self.battler.x_combo[1] = -1
  1708. end
  1709. end
  1710.  
  1711. #--------------------------------------------------------------------------
  1712. # ● Can Use Weapon Command?
  1713. #--------------------------------------------------------------------------
  1714. def can_use_weapon_command?
  1715. return false if $game_system.command_enable == false
  1716. return false unless ENABLE_ACTION_1_BUTTON
  1717. return false if self.battler.shield
  1718. return false if self.battler.cast_action[4] > 0
  1719. return false if self.battler.x_charge_action[2] > 0
  1720. return true
  1721. end
  1722.  
  1723. #--------------------------------------------------------------------------
  1724. # ● Can Use Shield Command?
  1725. #--------------------------------------------------------------------------
  1726. def can_use_shield_command?
  1727. return false if $game_system.command_enable == false
  1728. return false unless ENABLE_ACTION_2_BUTTON
  1729. return false if self.battler.equips[1] == nil
  1730. return false if self.battler.equips[1].id == 0
  1731. return false if self.battler.cast_action[4] > 0
  1732. return false if self.battler.x_charge_action[2] > 0
  1733. return true
  1734. end
  1735.  
  1736. #--------------------------------------------------------------------------
  1737. # ● Can Use Skill Command?
  1738. #--------------------------------------------------------------------------
  1739. def can_use_skill_command?
  1740. return false if $game_system.command_enable == false
  1741. return false unless ENABLE_SKILL_BUTTON
  1742. return false if self.battler.shield
  1743. return false if self.battler.cast_action[4] > 0
  1744. return false if self.battler.x_charge_action[2] > 0
  1745. return true
  1746. end
  1747.  
  1748. #--------------------------------------------------------------------------
  1749. # ● Can Use Item Command?
  1750. #--------------------------------------------------------------------------
  1751. def can_use_item_command?
  1752. return false if $game_system.command_enable == false
  1753. return false unless ENABLE_ITEM_BUTTON
  1754. return false if self.battler.shield
  1755. return false if self.battler.cast_action[4] > 0
  1756. return false if self.battler.x_charge_action[2] > 0
  1757. return true
  1758. end
  1759.  
  1760. #--------------------------------------------------------------------------
  1761. # ● Can Charge Command
  1762. #--------------------------------------------------------------------------
  1763. def can_charge_command?
  1764. return false if $game_system.command_enable == false
  1765. return false if self.battler.cast_action[4] > 0
  1766. return false if self.battler.shield
  1767. return true
  1768. end
  1769.  
  1770. #--------------------------------------------------------------------------
  1771. # ● Can Use Change Leader Command?
  1772. #--------------------------------------------------------------------------
  1773. def can_use_change_leader_command?
  1774. return false unless ENABLE_CHANGE_LEADER_BUTTON
  1775. return false if self.battler.shield
  1776. return false if self.battler.cast_action[4] > 0
  1777. return false if self.battler.x_charge_action[2] > 0
  1778. return false if $game_temp.change_leader_wait_time > 0
  1779. return true
  1780. end
  1781.  
  1782. #--------------------------------------------------------------------------
  1783. # ● State_Seal Command
  1784. #--------------------------------------------------------------------------
  1785. def state_seal_command?(type)
  1786. seal = false
  1787. case type
  1788. when 0
  1789. seal = true if self.battler.state_mute
  1790. seal = true if self.battler.state_seal_attack
  1791. when 1
  1792. seal = true if self.battler.state_mute
  1793. seal = true if self.battler.state_seal_attack
  1794. when 2
  1795. seal = true if self.battler.state_mute
  1796. seal = true if self.battler.state_seal_skill
  1797. when 3
  1798. seal = true if self.battler.state_mute
  1799. seal = true if self.battler.state_seal_item
  1800. end
  1801. if seal
  1802. seal_effect
  1803. return true
  1804. end
  1805. return false
  1806. end
  1807.  
  1808. #--------------------------------------------------------------------------
  1809. # ● Check Equipped Action
  1810. #--------------------------------------------------------------------------
  1811. def check_equipped_action(command_type)
  1812. case command_type
  1813. when 0 # Weapon 1
  1814. weapon = self.battler.equips[0]
  1815. if weapon == nil
  1816. self.battler.x_action1_id = 0
  1817. return
  1818. end
  1819. weapon.note =~ /<Action ID = (\d+)>/
  1820. action_id = $1.to_i
  1821. action_id = 0 if action_id == nil
  1822. self.battler.x_action1_id = action_id
  1823. when 1 # Weapon 2
  1824. weapon = self.battler.equips[1]
  1825. if weapon == nil
  1826. self.battler.x_action2_id = 0
  1827. return
  1828. end
  1829. weapon.note =~ /<Action ID = (\d+)>/
  1830. action_id = $1.to_i
  1831. action_id = 0 if action_id == nil
  1832. self.battler.x_action2_id = action_id
  1833. when 2 # Skill
  1834.  
  1835. when 3 # Item
  1836. item_id = $data_items[self.battler.item_id]
  1837. if item_id == nil
  1838. self.battler.x_item_id = 0
  1839. return
  1840. end
  1841. item_id.note =~ /<Action ID = (\d+)>/
  1842. action_id = $1.to_i
  1843. action_id = 0 if action_id == nil
  1844. self.battler.x_item_id = action_id
  1845. end
  1846. end
  1847.  
  1848. #--------------------------------------------------------------------------
  1849. # ● Execute Combo
  1850. #--------------------------------------------------------------------------
  1851. def execute_combo?(type)
  1852. if type == self.battler.x_combo[1] and self.battler.x_combo[0] != 0
  1853. return if state_seal_command?(type)
  1854. self.shoot(self.battler.x_combo[0])
  1855. self.battler.x_combo[1] = type
  1856. return true
  1857. end
  1858. self.battler.x_combo[0] = 0
  1859. self.battler.x_combo[1] = type
  1860. self.battler.x_combo[2] = 0
  1861. return false
  1862. end
  1863.  
  1864. #--------------------------------------------------------------------------
  1865. # ● Update Change Leader Button
  1866. #--------------------------------------------------------------------------
  1867. def update_change_leader_button
  1868. if Input.trigger?(CHANGE_LEADER_BUTTON)
  1869. return unless can_use_change_leader_command?
  1870. change_leader
  1871. end
  1872. end
  1873.  
  1874. #--------------------------------------------------------------------------
  1875. # ● Update Action 1 Button
  1876. #--------------------------------------------------------------------------
  1877. def update_action_1_button
  1878. if Input.trigger?(ACTION_1_BUTTON)
  1879. type = 0
  1880. return unless can_use_weapon_command?
  1881. return if execute_combo?(type)
  1882. check_equipped_action(type)
  1883. action_id = self.battler.x_action1_id
  1884. return if action_id == 0
  1885. return if state_seal_command?(type)
  1886. self.shoot(action_id)
  1887. end
  1888. end
  1889.  
  1890. #--------------------------------------------------------------------------
  1891. # ● Update Action 2 Button
  1892. #--------------------------------------------------------------------------
  1893. def update_action_2_button
  1894. if Input.trigger?(ACTION_2_BUTTON)
  1895. if self.battler.equips[1].is_a?(RPG::Weapon)
  1896. type = 1
  1897. return unless can_use_weapon_command?
  1898. return if execute_combo?(type)
  1899. check_equipped_action(type)
  1900. action_id = self.battler.x_action2_id
  1901. return if action_id == 0
  1902. return if state_seal_command?(type)
  1903. self.shoot(action_id)
  1904. return
  1905. end
  1906. end
  1907. update_shield_button
  1908. end
  1909.  
  1910. #--------------------------------------------------------------------------
  1911. # ● Update Shield Button
  1912. #--------------------------------------------------------------------------
  1913. def update_shield_button
  1914. if Input.press?(ACTION_2_BUTTON)
  1915. if can_use_shield_command?
  1916. unless self.battler.shield
  1917. shield = self.battler.equips[1]
  1918. if shield.note =~ /<Action>/
  1919. if shield.note =~ /<Pose = (\w+)>/
  1920. make_pose($1.to_s, 2)
  1921. end
  1922. else
  1923. self.battler.shield = false
  1924. return
  1925. end
  1926. end
  1927. self.x_pose_duration = 2
  1928. self.battler.shield = true
  1929. update_shield_diretion_button
  1930. else
  1931. self.battler.shield = false
  1932. end
  1933. else
  1934. self.battler.shield = false
  1935. end
  1936. end
  1937.  
  1938. #--------------------------------------------------------------------------
  1939. # ● update_shield_direction_button
  1940. #--------------------------------------------------------------------------
  1941. def update_shield_diretion_button
  1942. return if @direction_fix
  1943. case Input.dir4
  1944. when 2; set_direction(2)
  1945. when 4; set_direction(4)
  1946. when 6; set_direction(6)
  1947. when 8; set_direction(8)
  1948. end
  1949. end
  1950.  
  1951. #--------------------------------------------------------------------------
  1952. # ● Update Skill Button
  1953. #--------------------------------------------------------------------------
  1954. def update_skill_button
  1955. if Input.trigger?(SKILL_BUTTON)
  1956. type = 2
  1957. return unless can_use_skill_command?
  1958. return if execute_combo?(type)
  1959. check_equipped_action(type)
  1960. action_id = self.battler.skill_id
  1961. return if action_id == 0
  1962. return if state_seal_command?(type)
  1963. self.shoot(action_id)
  1964. end
  1965. end
  1966.  
  1967. #--------------------------------------------------------------------------
  1968. # ● Update Item Button
  1969. #--------------------------------------------------------------------------
  1970. def update_item_button
  1971. if Input.trigger?(ITEM_BUTTON)
  1972. type = 3
  1973. return unless can_use_item_command?
  1974. return if execute_combo?(type)
  1975. check_equipped_action(type)
  1976. action_id = self.battler.x_item_id
  1977. return if action_id == 0
  1978. return if state_seal_command?(type)
  1979. self.shoot(action_id)
  1980. end
  1981. end
  1982.  
  1983. #--------------------------------------------------------------------------
  1984. # ● Update Auto Target Shoot
  1985. #--------------------------------------------------------------------------
  1986. def update_auto_target_shoot
  1987. return if $game_temp.xas_target_time == 0
  1988. return if $game_temp.xas_target_shoot_id == 0
  1989. return if $game_temp.xas_target_x == 0 and $game_temp.xas_target_y == 0
  1990. $game_temp.xas_target_time -= 1
  1991. if $game_temp.xas_target_time == 0
  1992. self.shoot($game_temp.xas_target_shoot_id)
  1993. $game_temp.xas_target_shoot_id = 0
  1994. end
  1995. end
  1996.  
  1997. #--------------------------------------------------------------------------
  1998. # ● Dash?
  1999. #--------------------------------------------------------------------------
  2000. alias x_dash dash?
  2001. def dash?
  2002. return false if XAS_SYSTEM::DASH_SYSTEM
  2003. x_dash
  2004. end
  2005.  
  2006. #--------------------------------------------------------------------------
  2007. # ● Can Dash?
  2008. #--------------------------------------------------------------------------
  2009. def can_dash?
  2010. return false unless XAS_BUTTON::ENABLE_DASH_BUTTON
  2011. return false if self.battler.shield
  2012. return true if Input.press?(XAS_BUTTON::DASH_BUTTON)
  2013. @dash_active = false
  2014. return false
  2015. end
  2016.  
  2017. #--------------------------------------------------------------------------
  2018. # ● Update Dash Command
  2019. #--------------------------------------------------------------------------
  2020. def update_dash_button
  2021. return unless can_dash?
  2022. @dash_active = true
  2023. @anime_count -= 0.5 if moving?
  2024. update_dash_sprite_name
  2025. end
  2026.  
  2027. #--------------------------------------------------------------------------
  2028. # ● Update Dash Sprite Name
  2029. #--------------------------------------------------------------------------
  2030. def update_dash_sprite_name
  2031. make_pose("_Dash", 2)
  2032. end
  2033.  
  2034. end
  2035.  
  2036.  
  2037. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  2038. #■ TOOL - INITIALIZE
  2039. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  2040.  
  2041.  
  2042. #===============================================================================
  2043. # ■ Game_Map
  2044. #===============================================================================
  2045. class Game_Map
  2046.  
  2047. attr_accessor :need_refresh_token
  2048.  
  2049. #--------------------------------------------------------------------------
  2050. # ● need_add_tokens
  2051. #--------------------------------------------------------------------------
  2052. def need_add_tokens
  2053. @need_add_tokens = [] if @need_add_tokens == nil
  2054. return @need_add_tokens
  2055. end
  2056.  
  2057. #--------------------------------------------------------------------------
  2058. # ● need_remove_tokens
  2059. #--------------------------------------------------------------------------
  2060. def need_remove_tokens
  2061. @need_remove_tokens = [] if @need_remove_tokens == nil
  2062. return @need_remove_tokens
  2063. end
  2064.  
  2065. #--------------------------------------------------------------------------
  2066. # ● add_token
  2067. #--------------------------------------------------------------------------
  2068. def add_token(token_event)
  2069. $game_temp.tool_event = [] if $game_temp.tool_event == nil
  2070. $game_temp.tool_event.push(token_event)
  2071. self.need_add_tokens.push(token_event)
  2072. self.need_refresh_token = true
  2073. end
  2074.  
  2075. #--------------------------------------------------------------------------
  2076. # ● remove_token
  2077. #--------------------------------------------------------------------------
  2078. def remove_token(token_event)
  2079. @events.delete(token_event.id)
  2080. self.need_remove_tokens.push(token_event)
  2081. self.need_refresh_token = true
  2082. end
  2083.  
  2084. #--------------------------------------------------------------------------
  2085. # ● clear_tokens
  2086. #--------------------------------------------------------------------------
  2087. def clear_tokens
  2088. $game_system.tools_on_map.clear
  2089. $game_system.tools_on_map = []
  2090. for event in @events.values.dup
  2091. remove_token(event) if event.is_a?(Token_Event)
  2092. end
  2093. channels = ["A", "B", "C", "D"]
  2094. for id in 1001..(token_id_shift - 1)
  2095. for a in channels
  2096. key = [self.map_id, id, a]
  2097. $game_self_switches.delete(key)
  2098. end
  2099. end
  2100. clear_token_id
  2101. end
  2102.  
  2103. #--------------------------------------------------------------------------
  2104. # ● Update
  2105. #--------------------------------------------------------------------------
  2106. alias x_temp_tool_hash_update update
  2107. def update(main = false)
  2108. x_temp_tool_hash_update(main)
  2109. update_add_tool_hash
  2110. end
  2111.  
  2112. #--------------------------------------------------------------------------
  2113. # ● Update Add Toll Hash
  2114. #--------------------------------------------------------------------------
  2115. def update_add_tool_hash
  2116. return if $game_temp.tool_event == nil
  2117. for i in $game_temp.tool_event
  2118. $game_map.events[i.id] = i
  2119. execute_tool_effects_hash(i)
  2120. end
  2121. $game_temp.tool_event.clear
  2122. $game_temp.tool_event = nil
  2123. end
  2124.  
  2125. #--------------------------------------------------------------------------
  2126. # ● Execute Toll Effects Hash
  2127. #--------------------------------------------------------------------------
  2128. def execute_tool_effects_hash(i)
  2129.  
  2130. end
  2131. end
  2132.  
  2133. #===============================================================================
  2134. # ■ Game_SelfSwitches
  2135. #===============================================================================
  2136. class Game_SelfSwitches
  2137. def delete(key)
  2138. @data.delete(key)
  2139. end
  2140. end
  2141.  
  2142. #===============================================================================
  2143. # ■ Game_Map
  2144. #===============================================================================
  2145. class Game_Map
  2146.  
  2147. attr_accessor :token_id
  2148.  
  2149. #--------------------------------------------------------------------------
  2150. # ● token_id_shift
  2151. #--------------------------------------------------------------------------
  2152. def token_id_shift
  2153. @token_id = 1000 if @token_id == nil
  2154. @token_id += 1
  2155. return @token_id
  2156. end
  2157.  
  2158. #--------------------------------------------------------------------------
  2159. # ● clear_token_id
  2160. #--------------------------------------------------------------------------
  2161. def clear_token_id
  2162. @token_id = nil
  2163. end
  2164. end
  2165.  
  2166. #===============================================================================
  2167. # ■ XRXS_CTS_RefreshToken
  2168. #===============================================================================
  2169. module XRXS_CTS_RefreshToken
  2170.  
  2171. #--------------------------------------------------------------------------
  2172. # ● refresh_token
  2173. #--------------------------------------------------------------------------
  2174. def refresh_token
  2175. for event in $game_map.need_add_tokens
  2176. @character_sprites.push(Sprite_Character.new(@viewport1, event))
  2177. end
  2178. $game_map.need_add_tokens.clear
  2179. for sprite in @character_sprites.dup
  2180. if $game_map.need_remove_tokens.empty?
  2181. break
  2182. end
  2183. if $game_map.need_remove_tokens.delete(sprite.character)
  2184. @character_sprites.delete(sprite)
  2185. sprite.dispose
  2186. end
  2187. end
  2188. $game_map.need_refresh_token = false
  2189. end
  2190. end
  2191.  
  2192. #===============================================================================
  2193. # ■ Spriteset_Map
  2194. #===============================================================================
  2195. class Spriteset_Map
  2196. include XRXS_CTS_RefreshToken
  2197.  
  2198. #--------------------------------------------------------------------------
  2199. # ● Initialize
  2200. #--------------------------------------------------------------------------
  2201. alias x_smap_initialize initialize
  2202. def initialize
  2203. setup_start
  2204. x_smap_initialize
  2205. end
  2206.  
  2207. #--------------------------------------------------------------------------
  2208. # ● Setup Start
  2209. #--------------------------------------------------------------------------
  2210. def setup_start
  2211. $game_player.reset_old_level(true)
  2212. end
  2213.  
  2214. end
  2215.  
  2216. #===============================================================================
  2217. # ■ Game_Player
  2218. #===============================================================================
  2219. class Game_Player < Game_Character
  2220.  
  2221. #--------------------------------------------------------------------------
  2222. # ● x_reserve_transfer
  2223. #--------------------------------------------------------------------------
  2224. alias x_reserve_transfer reserve_transfer
  2225. def reserve_transfer(map_id, x, y, direction)
  2226. $game_map.clear_tokens
  2227. if $game_temp.tool_event != nil
  2228. $game_temp.tool_event.clear
  2229. $game_temp.tool_event = nil
  2230. end
  2231. x_reserve_transfer(map_id, x, y, direction)
  2232. end
  2233.  
  2234. end
  2235.  
  2236. #===============================================================================
  2237. # ■ Token_Event
  2238. #===============================================================================
  2239. class Token_Event < Game_Event
  2240.  
  2241. #--------------------------------------------------------------------------
  2242. # ● Token_Event
  2243. #--------------------------------------------------------------------------
  2244. def initialize(map_id, event)
  2245. event.id = $game_map.token_id_shift
  2246. super
  2247. end
  2248.  
  2249. #--------------------------------------------------------------------------
  2250. # ● erase
  2251. #--------------------------------------------------------------------------
  2252. def erase
  2253. super
  2254. $game_map.remove_token(self)
  2255. end
  2256. end
  2257.  
  2258.  
  2259. #===============================================================================
  2260. # ■ XRXS_ActionTemplate
  2261. #===============================================================================
  2262. module XRXS_ActionTemplate
  2263. map_id = XAS_SYSTEM::ACTION_TEMPLATE_MAP_ID
  2264. map = load_data(sprintf("Data/Map%03d.rvdata2", map_id))
  2265. @@events = map.events
  2266. end
  2267.  
  2268. #===============================================================================
  2269. # ■ Token_Event
  2270. #===============================================================================
  2271. class Token_Event < Game_Event
  2272. include XRXS_ActionTemplate
  2273. end
  2274.  
  2275. #===============================================================================
  2276. # ■ Game_Temp
  2277. #===============================================================================
  2278. class Game_Temp
  2279. attr_accessor :active_token
  2280. end
  2281.  
  2282.  
  2283.  
  2284. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  2285. #■ TOOL - SHOOT COMMAND
  2286. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  2287.  
  2288.  
  2289. #===============================================================================
  2290. # ■ XAS ACTION
  2291. #===============================================================================
  2292. module XAS_ACTION
  2293. attr_reader :action
  2294. attr_reader :erased
  2295.  
  2296. #--------------------------------------------------------------------------
  2297. # ● shoot
  2298. #--------------------------------------------------------------------------
  2299. def shoot(action_id = 0)
  2300. return if action_id == 0
  2301. skill = $data_skills[action_id]
  2302. return unless can_shoot?(skill)
  2303. execute_user_effects(skill)
  2304. execute_call_event(action_id)
  2305. self.action_attachment(action_id)
  2306. execute_set_pose(action_id)
  2307. end
  2308.  
  2309. #--------------------------------------------------------------------------
  2310. # ● Can Shoot
  2311. #--------------------------------------------------------------------------
  2312. def can_shoot?(skill)
  2313. if self.battler == nil and self.tool_id > 0
  2314. @battler = self.action.user.battler
  2315. end
  2316. return false if self.battler == nil
  2317. return false if skill == nil
  2318. return true if ignore_can_shoot?(skill)
  2319. enough_cost = true
  2320. return false if tools_on_map?(skill.id)
  2321. if self.battler.state_mute
  2322. seal_effect
  2323. return false
  2324. end
  2325. if self.battler.cast_action[4].between?(1,self.battler.cast_action[1] -1)
  2326. return false
  2327. end
  2328. return false if check_cast_action?(skill)
  2329. return false if check_auto_target_select?(skill)
  2330. unless enough_skill_cost?(skill)
  2331. Audio.se_play("Audio/SE/" + XAS_SOUND::ACTION_COST , 100, 100)
  2332. return false
  2333. end
  2334. return true
  2335. end
  2336.  
  2337. #--------------------------------------------------------------------------
  2338. # ● Ignore Can Shoot?
  2339. #--------------------------------------------------------------------------
  2340. def ignore_can_shoot?(skill)
  2341. return false
  2342. end
  2343.  
  2344. #--------------------------------------------------------------------------
  2345. # ● Tools on Map
  2346. #--------------------------------------------------------------------------
  2347. def tools_on_map?(skill_id)
  2348. return true if $game_system.tools_on_map.include?(skill_id)
  2349. return false
  2350. end
  2351.  
  2352. #--------------------------------------------------------------------------
  2353. # ● Check Cast Action
  2354. #--------------------------------------------------------------------------
  2355. def check_cast_action?(skill)
  2356. if self.battler.cast_action[0] != 0
  2357. self.battler.cast_action[0] = 0
  2358. self.battler.cast_action[1] = 0
  2359. self.battler.cast_action[2] = 0
  2360. self.battler.cast_action[3] = 0
  2361. self.battler.cast_action[4] = 0
  2362. return false
  2363. end
  2364. if skill.note =~ /<Cast Time = (\d+)>/ and
  2365. $game_temp.xas_target_shoot_id == 0 and
  2366. self.force_action_times == 0
  2367. self.battler.cast_action[0] = skill.id
  2368. self.battler.cast_action[1] = $1.to_i rescue 0
  2369. self.battler.cast_action[2] = XAS_ANIMATION::CAST_TIME_ANIMATION_ID
  2370. self.battler.cast_action[3] = 0
  2371. self.battler.cast_action[4] = 0
  2372. self.animation_id = self.battler.cast_action[2]
  2373. return true
  2374. end
  2375. return false
  2376. end
  2377.  
  2378. #--------------------------------------------------------------------------
  2379. # ● Check Auto Target Select
  2380. #--------------------------------------------------------------------------
  2381. def check_auto_target_select?(skill)
  2382. return false if self.is_a?(Game_Event)
  2383. if skill.note =~ /<Auto Target>/
  2384. if $game_temp.xas_target_shoot_id == 0
  2385. $game_temp.xas_target_shoot_id = skill.id
  2386. $game_map.check_events_on_screen
  2387. SceneManager.call(Scene_Target_Select)
  2388. return true
  2389. end
  2390. end
  2391. return false
  2392. end
  2393.  
  2394. #--------------------------------------------------------------------------
  2395. # ● enough_skill_cost?
  2396. #--------------------------------------------------------------------------
  2397. def enough_skill_cost?(skill)
  2398. return false unless enough_mp_cost?(skill)
  2399. return false unless enough_item_cost?(skill)
  2400. return true
  2401. end
  2402.  
  2403. #--------------------------------------------------------------------------
  2404. # ● Enough MP Cost
  2405. #--------------------------------------------------------------------------
  2406. def enough_mp_cost?(skill)
  2407. if @force_action_times > 0
  2408. return true if @force_action == "All Shoot"
  2409. return true if @force_action == "Four Shoot"
  2410. return true if @force_action == "Three Shoot"
  2411. return true if @force_action == "Two Shoot"
  2412. end
  2413. if self.battler.mp < skill.mp_cost
  2414. self.battler.damage = XAS_WORD::NO_MP
  2415. self.battler.damage_pop = true
  2416. return false
  2417. else
  2418. self.battler.mp -= skill.mp_cost
  2419. return true
  2420. end
  2421. return true
  2422. end
  2423.  
  2424. #--------------------------------------------------------------------------
  2425. # ● Enough MP Cost
  2426. #--------------------------------------------------------------------------
  2427. def enough_item_cost?(skill)
  2428. return true if self.battler.is_a?(Game_Enemy)
  2429. if @force_action_times > 0
  2430. return true if @force_action == "All Shoot"
  2431. return true if @force_action == "Four Shoot"
  2432. return true if @force_action == "Three Shoot"
  2433. return true if @force_action == "Two Shoot"
  2434. end
  2435. skill.note =~ /<Item Cost = (\d+)>/
  2436. item_id = $1.to_i
  2437. if item_id != nil and item_id != 0
  2438. item_cost = $data_items[item_id]
  2439. number = $game_party.item_number(item_cost)
  2440. if number == 0 or number == nil
  2441. self.battler.damage = XAS_WORD::NO_ITEM
  2442. self.battler.damage_pop = true
  2443. return false
  2444. else
  2445. $game_party.lose_item(item_cost, 1, false)
  2446. return true
  2447. end
  2448. end
  2449. return true
  2450. end
  2451.  
  2452. #--------------------------------------------------------------------------
  2453. # ● Execute User Effects
  2454. #--------------------------------------------------------------------------
  2455. def execute_user_effects(skill)
  2456. self.battler.shield = false
  2457. #Animation
  2458. if skill.note =~ /<Cast Ani = (\d+)>/
  2459. ani_id = $1.to_i
  2460. if ani_id != nil
  2461. self.animation_id = ani_id
  2462. end
  2463. end
  2464. unless @force_action_times > 0
  2465. #All Directions
  2466. if skill.note =~ /<All Directions>/
  2467. @force_action = "All Shoot"
  2468. @force_action_times = 8
  2469. elsif skill.note =~ /<Four Directions>/
  2470. @force_action = "Four Shoot"
  2471. @force_action_times = 4
  2472. elsif skill.note =~ /<Three Directions>/
  2473. @force_action = "Three Shoot"
  2474. @force_action_times = 3
  2475. elsif skill.note =~ /<Two Directions>/
  2476. @force_action = "Two Shoot"
  2477. @force_action_times = 2
  2478. end
  2479. end
  2480. end
  2481.  
  2482. #--------------------------------------------------------------------------
  2483. # ● Execute Set Pose
  2484. #--------------------------------------------------------------------------
  2485. def execute_set_pose(action_id)
  2486. @action.duration = @action.sunflag
  2487. make_pose(@action.self_motion, @action.sunflag )
  2488. @pattern = 0
  2489. @pattern_count = 0
  2490. @step_anime = true
  2491. @self_motion = nil
  2492. self.need_refresh = true if self.is_a?(Game_Player)
  2493. end
  2494.  
  2495. #--------------------------------------------------------------------------
  2496. # ● execute_call_event
  2497. #--------------------------------------------------------------------------
  2498. def execute_call_event(action_id)
  2499. bullet_token = Token_Bullet.new(self, action_id)
  2500. $game_map.add_token(bullet_token)
  2501. return bullet_token
  2502. end
  2503.  
  2504. #--------------------------------------------------------------------------
  2505. # ● action_attachment
  2506. #--------------------------------------------------------------------------
  2507. def action_attachment(action_id)
  2508. @action = Game_Action_XAS.new(self, action_id)
  2509. @action.attachment(action_id)
  2510. end
  2511.  
  2512. end
  2513.  
  2514.  
  2515. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  2516. #■ TOOL - SHOOT SETTING
  2517. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  2518.  
  2519.  
  2520. #===============================================================================
  2521. # ■ Game_Action_XAS
  2522. #===============================================================================
  2523. class Game_Action_XAS
  2524.  
  2525. attr_accessor :user
  2526. attr_accessor :id
  2527. attr_accessor :attack_id
  2528. attr_accessor :attack_range
  2529. attr_accessor :attack_range_type
  2530. attr_accessor :hit_events
  2531. attr_accessor :now_count
  2532. attr_accessor :pre_now_count
  2533. attr_accessor :duration
  2534. attr_accessor :blow_power
  2535. attr_accessor :piercing
  2536. attr_accessor :ignore_knockback_invincible
  2537. attr_accessor :target_invunerable_duration
  2538. attr_accessor :multi_hit
  2539. attr_accessor :ally_damage
  2540. attr_accessor :all_damage
  2541. attr_accessor :sunflag
  2542. attr_accessor :self_motion
  2543. attr_accessor :second_animation_id
  2544. attr_accessor :third_animation_id
  2545. attr_accessor :attack_range_type
  2546. attr_accessor :attack_range_plan
  2547. attr_accessor :blow_power
  2548. attr_accessor :ignore_guard
  2549. attr_accessor :user_invincible
  2550. attr_accessor :short_range
  2551. attr_accessor :first_impact_time
  2552. attr_accessor :animation_time
  2553. attr_accessor :duration
  2554. attr_accessor :item_cost
  2555. attr_accessor :hit_shake
  2556. attr_accessor :hit_hold_target
  2557. attr_accessor :hit_bounce
  2558. attr_accessor :sticky
  2559. attr_accessor :reflectable
  2560. attr_accessor :can_reflect
  2561. attr_accessor :attack_id_plan
  2562. attr_accessor :hit_action
  2563. attr_accessor :fake_id
  2564. attr_accessor :impact
  2565.  
  2566. #--------------------------------------------------------------------------
  2567. # ● initialize
  2568. #--------------------------------------------------------------------------
  2569. def initialize(user, action_id)
  2570. @user = user
  2571. @id = action_id
  2572. @now_count = 0
  2573. @duration = nil
  2574. @attack_id = 0
  2575. @attack_range = 0
  2576. @hit_events = []
  2577. @blow_power = 0
  2578. @skill = $data_skills[action_id]
  2579. @ignore_knockback_invincible = false
  2580. @multi_hit = false
  2581. @piercing = false
  2582. @all_damage = false
  2583. @ally_damage = false
  2584. @ignore_guard = false
  2585. @sunflag = 10
  2586. @duration = 10
  2587. @self_motion = ""
  2588. @attack_range_type = 1
  2589. @attack_range_plan = 1
  2590. @blow_power = 1
  2591. @first_impact_time = 0
  2592. @animation_time = []
  2593. @target_invunerable_duration = 10
  2594. @second_animation_id = 0
  2595. @third_animation_id = 0
  2596. @user_invincible = false
  2597. @short_range = false
  2598. @item_cost = 0
  2599. @hit_shake = false
  2600. @hit_hold_target = false
  2601. @hit_bounce = false
  2602. @sticky = false
  2603. @reflectable = false
  2604. @can_reflect = false
  2605. @hit_action = 0
  2606. @fake_id = false
  2607. @impact = true
  2608. end
  2609.  
  2610. #--------------------------------------------------------------------------
  2611. # ● attachment
  2612. #--------------------------------------------------------------------------
  2613. def attachment(action_id)
  2614. @attack_id_plan = [action_id]
  2615. if @skill.note =~ /<Sunflag = (\d+)>/
  2616. @sunflag = $1.to_i
  2617. end
  2618. if @skill.note =~ /<Duration = (\d+)>/
  2619. @duration = $1.to_i
  2620. end
  2621. if @skill.note =~ /<Pose = (\S+)>/
  2622. @self_motion = $1.to_s
  2623. end
  2624. if @skill.note =~ /<Area = (\w+)>/
  2625. case $1
  2626. when "CROSS"
  2627. area = 7
  2628. when "WALL"
  2629. area = 6
  2630. when "FRONTRHOMBUS"
  2631. area = 5
  2632. when "FRONTSQUARE"
  2633. area = 4
  2634. when "LINE"
  2635. area = 3
  2636. when "SQUARE"
  2637. area = 2
  2638. else
  2639. area = 1
  2640. end
  2641. @attack_range_type = area
  2642. end
  2643. if @skill.note =~ /<Range = (\d+)>/
  2644. @attack_range_plan = [$1.to_i]
  2645. end
  2646. if @skill.note =~ /<Blow Power = (\d+)>/
  2647. @blow_power = $1.to_i
  2648. end
  2649. if @skill.note =~ /<Impact Time = (\d+)>/
  2650. @first_impact_time = $1.to_i
  2651.  
  2652. end
  2653. if @skill.note =~ /<Animation Time = (\d+) - (\d+)>/
  2654. @animation_time[0] = $1.to_i
  2655. @animation_time[1] = $2.to_i
  2656. end
  2657. if @skill.note =~ /<Target Invunerable = (\d+)>/
  2658. @target_invunerable_duration = $1.to_i
  2659. end
  2660. if @skill.note =~ /<Tool Hit Ani = (\d+)>/
  2661. @second_animation_id = $1.to_i
  2662. end
  2663. if @skill.note =~ /<User Hit Ani = (\d+)>/
  2664. @third_animation_id = $1.to_i
  2665. end
  2666. if @skill.note =~ /<Item Cost = (\d+)>/
  2667. @item_cost = $1.to_i
  2668. end
  2669. if @skill.note =~ /<Link Action ID = (\d+)>/
  2670. if user.battler != nil
  2671. user.battler.x_combo[0] = $1.to_i
  2672. user.battler.x_combo[2] = @sunflag + 20
  2673. end
  2674. else
  2675. if user.battler != nil
  2676. user.battler.x_combo[0] = 0
  2677. user.battler.x_combo[1] = 0
  2678. user.battler.x_combo[2] = 0
  2679. end
  2680. end
  2681. if @skill.note =~ /<Hit Action ID = (\d+)>/
  2682. @hit_action = $1.to_i
  2683. end
  2684. if @skill.note =~ /<Ignore Knockback>/
  2685. @ignore_knockback_invincible = true
  2686. end
  2687. if @skill.note =~ /<Multi Hit>/
  2688. @multi_hit = true
  2689. end
  2690. if @skill.note =~ /<Piercing>/
  2691. @piercing = true
  2692. end
  2693. if @skill.note =~ /<All Damage>/
  2694. @all_damage = true
  2695. end
  2696. if @skill.note =~ /<Ally Damage>/
  2697. @ally_damage = true
  2698. end
  2699. if @skill.note =~ /<User Invincible>/
  2700. @user_invincible = true
  2701. end
  2702. if @skill.note =~ /<Ignore Guard>/
  2703. @ignore_guard = true
  2704. end
  2705. if @skill.note =~ /<One Action>/
  2706. unless $game_system.tools_on_map.include?(action_id)
  2707. $game_system.tools_on_map.push(action_id)
  2708. end
  2709. end
  2710. if @skill.note =~ /<Shake>/
  2711. @hit_shake = true
  2712. end
  2713. if @skill.note =~ /<User Range>/
  2714. @short_range = true
  2715. end
  2716. if @skill.note =~ /<Hit Hold Target>/
  2717. @hit_hold_target = true
  2718. end
  2719. if @skill.note =~ /<Hit Sticky Target>/
  2720. @sticky = true
  2721. end
  2722. if @skill.note =~ /<Hit Bounce Direction>/
  2723. @hit_bounce = true
  2724. end
  2725. if @skill.note =~ /<Reflectable>/
  2726. @reflectable = true
  2727. end
  2728. if @skill.note =~ /<Can Reflect>/
  2729. @can_reflect = true
  2730. end
  2731. if @skill.note =~ /<Disable Hit>/
  2732. @impact = false
  2733. end
  2734. @sunflag = 1 if @sunflag <= 0
  2735. end
  2736.  
  2737. #--------------------------------------------------------------------------
  2738. # ● update
  2739. #--------------------------------------------------------------------------
  2740. def update
  2741. @first_impact_time -= 1 if @first_impact_time > 0
  2742. if @attack_id_plan != nil
  2743. id = @attack_id_plan[@now_count]
  2744. unless id.nil?
  2745. @attack_id = id
  2746. @hit_events.clear
  2747. @hit_events.push(self.user) unless @all_damage or @ally_damage
  2748. end
  2749. end
  2750. if @attack_range_plan != nil
  2751. range = @attack_range_plan[@now_count]
  2752. @attack_range = range unless range.nil?
  2753. end
  2754. @now_count += 1
  2755. end
  2756.  
  2757. #--------------------------------------------------------------------------
  2758. # ● done?
  2759. #--------------------------------------------------------------------------
  2760. def done?
  2761. return (self.duration.to_i > 0 and self.now_count >= self.duration)
  2762. end
  2763. end
  2764.  
  2765. #===============================================================================
  2766. # ■ Token_Bullet
  2767. #===============================================================================
  2768. class Token_Bullet < Token_Event
  2769. include XRXS_ActionTemplate
  2770. #--------------------------------------------------------------------------
  2771. # ● initialize
  2772. #--------------------------------------------------------------------------
  2773. def initialize(user, action_id)
  2774. event_id = action_id
  2775. skill = $data_skills[action_id]
  2776. if skill.note =~ /<Event ID = (\d+)>/
  2777. event_id = $1.to_i
  2778. end
  2779. original_event = @@events[event_id]
  2780. if original_event == nil
  2781. msgbox("There's no Event ID " + event_id.to_s + " on Tool Map!")
  2782. SceneManager.exit
  2783. return
  2784. end
  2785. event = original_event.dup
  2786. event.x = user.x
  2787. event.y = user.y
  2788. pre_direction = event.pages[0].graphic.direction
  2789. event.pages[0].graphic.direction = user.direction
  2790. @character_name = event.pages[0].graphic
  2791. super($game_map.map_id, event)
  2792. self.action_attachment(action_id)
  2793. self.tool_id = action_id
  2794. self.diagonal = false
  2795. self.diagonal_direction = 0
  2796. self.sprite_angle_enable = false
  2797. @action.user = user
  2798. @remain_for_an_act = @action.duration.is_a?(Numeric)
  2799. check_tool_effects(user,skill,pre_direction)
  2800. end
  2801.  
  2802. #--------------------------------------------------------------------------
  2803. # ● update
  2804. #--------------------------------------------------------------------------
  2805. def update
  2806. super
  2807. if @action == nil and @remain_for_an_act
  2808. erase
  2809. $game_system.tools_on_map.delete(self.tool_id)
  2810. end
  2811. check_event_trigger_attack
  2812. end
  2813. end
  2814.  
  2815. #===============================================================================
  2816. # ■ Game Player
  2817. #===============================================================================
  2818. class Game_Player < Game_Character
  2819. attr_accessor :need_refresh
  2820. end
  2821.  
  2822. #===============================================================================
  2823. # ■ Token_Bullet
  2824. #===============================================================================
  2825. class Token_Bullet < Token_Event
  2826.  
  2827. #--------------------------------------------------------------------------
  2828. # ● Check Tool Effects
  2829. #--------------------------------------------------------------------------
  2830. def check_tool_effects(user,skill,pre_direction)
  2831. if @action.ally_damage or @action.all_damage
  2832. user.battler.invunerable_duration = 0
  2833. end
  2834. # Force Update Out Screen
  2835. if user.battler.sensor_range >= 15 or
  2836. skill.note =~ /<Update Out Screen>/
  2837. self.force_update = true
  2838. end
  2839. #Diagonal Effect
  2840. if skill.note =~ /<Diagonal>/ or
  2841. skill.note =~ /<All Direction>/ or
  2842. skill.note =~ /<Three Direction>/
  2843. self.diagonal = true
  2844. self.diagonal_direction = user.diagonal_direction
  2845. self.sprite_angle_enable = true
  2846. user.diagonal_time = XAS_BA::DIAGONAL_DURATION if user.diagonal_direction != 0
  2847. user.diagonal = true if user.tool_id > 0
  2848. end
  2849. #Auto Target
  2850. if skill.note =~ /<Auto Target>/
  2851. if user.is_a?(Game_Event)
  2852. self.moveto($game_player.x, $game_player.y)
  2853. else
  2854. moveto($game_temp.xas_target_x, $game_temp.xas_target_y)
  2855. $game_temp.xas_target_x = 0
  2856. $game_temp.xas_target_y = 0
  2857. $game_temp.xas_target_time = 0
  2858. $game_temp.xas_target_shoot_id = 0
  2859. end
  2860. end
  2861. #Barrier
  2862. if skill.note =~ /<Barrier>/
  2863. self.tool_effect = "Barrier"
  2864. end
  2865. #Boomerang
  2866. if skill.note =~ /<Boomerang = (\d+)>/
  2867. self.tool_effect = "Boomerang"
  2868. self.action.duration = 1000
  2869. self.diagonal = true
  2870. self.diagonal_direction = user.diagonal_direction
  2871. self.force_update = true
  2872. @move_frequency = 6
  2873. @move_speed = 5
  2874. @direction_fix = false
  2875. @walk_anime = true
  2876. @step_anime = true
  2877. @force_action = "Forward"
  2878. @force_action_times = $1.to_i
  2879. end
  2880.  
  2881. end
  2882. end
  2883.  
  2884.  
  2885.  
  2886. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  2887. #■ TOOL - AREA
  2888. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  2889.  
  2890.  
  2891. #===============================================================================
  2892. # ■ XAS ACTION
  2893. #===============================================================================
  2894. module XAS_ACTION
  2895.  
  2896. #--------------------------------------------------------------------------
  2897. # ● action_update
  2898. #--------------------------------------------------------------------------
  2899. def action_update
  2900. return unless @action.is_a?(Game_Action_XAS)
  2901. if @action.animation_time != [] and
  2902. @action.animation_time[0] == @action.now_count
  2903. animation_id = @action.animation_time[1]
  2904. unless self.is_a?(Game_Player) or self.tool_id == 0
  2905. self.animation_id = animation_id
  2906. end
  2907. end
  2908. @action.update
  2909. end
  2910.  
  2911. #--------------------------------------------------------------------------
  2912. # ● Can Impact Target
  2913. #--------------------------------------------------------------------------
  2914. def can_impact_target?
  2915. return false if @action.nil?
  2916. return false if @action.attack_id == 0
  2917. return false if @action.first_impact_time > 0
  2918. return false if @action.impact == false
  2919. return false if self.jumping?
  2920. return true
  2921. end
  2922.  
  2923. #--------------------------------------------------------------------------
  2924. # ● check_event_trigger_attack
  2925. #--------------------------------------------------------------------------
  2926. def check_event_trigger_attack()
  2927. return unless can_impact_target?
  2928. hit_check = false
  2929. range = @action.attack_range
  2930. hit = []
  2931. targets = [$game_player] + $game_map.events.values
  2932. for event in targets
  2933. next if event == self or
  2934. @action.hit_events.include?(event) or event.erased
  2935. body_size = event.body_size
  2936. event_center_x = event.x
  2937. event_center_y = event.y - body_size
  2938. if @action.short_range
  2939. dx = event_center_x - $game_player.x
  2940. dy = event_center_y - $game_player.y
  2941. else
  2942. dx = event_center_x - self.x
  2943. dy = event_center_y - self.y
  2944. end
  2945. dx = (dx >= 0 ? [dx - body_size, 0].max : [dx + body_size, 0].min)
  2946. dy = (dy >= 0 ? [dy - body_size, 0].max : [dy + body_size, 0].min)
  2947. hit_check = true if in_range?(dx,dy,event,range)
  2948. hit.push(event) if hit_check
  2949. hit_check = false
  2950. end
  2951. for event in hit
  2952. if event.action_effect(self, self.action.attack_id)
  2953. hit_check = true
  2954. end
  2955. if event.action_effect_page(self, self.action.attack_id)
  2956. hit_check = true
  2957. end
  2958. @action.hit_events.push(event) unless @action.multi_hit
  2959. end
  2960. if hit_check
  2961. $game_temp.active_token = self
  2962. end
  2963. end
  2964.  
  2965. #--------------------------------------------------------------------------
  2966. # ● In Range?
  2967. #--------------------------------------------------------------------------
  2968. def in_range?(dx,dy,event,range)
  2969. case @action.attack_range_type
  2970. when 1 #RHOMBUS
  2971. return true if (dx.abs + dy.abs <= range)
  2972. when 2 #SQUARE
  2973. return true if (dx.abs <= range and dy.abs <= range)
  2974. when 3 #LINE
  2975. case self.direction
  2976. when 2
  2977. return true if (dx == 0 and dy >= 0 and dy <= range)
  2978. when 8
  2979. return true if (dx == 0 and dy <= 0 and dy >= -range)
  2980. when 6
  2981. return true if (dy == 0 and dx >= 0 and dx <= range)
  2982. when 4
  2983. return true if (dy == 0 and dx <= 0 and dx >= -range)
  2984. end
  2985. when 4 #FRONT SQUARE
  2986. case self.direction
  2987. when 2
  2988. return true if (dx.abs <= range and dy >= 0 and dy.abs <= range)
  2989. when 4
  2990. return true if (dx.abs <= range and dx <= 0 and dy.abs <= range)
  2991. when 6
  2992. return true if (dx.abs <= range and dx >= 0 and dy.abs <= range)
  2993. when 8
  2994. return true if (dx.abs <= range and dy <= 0 and dy.abs <= range)
  2995. end
  2996. when 5 #FRONT RHOMBUS
  2997. case self.direction
  2998. when 2
  2999. return true if (dx.abs + dy.abs <= range and dy >= 0)
  3000. when 8
  3001. return true if (dx.abs + dy.abs <= range and dy <= 0)
  3002. when 6
  3003. return true if (dx.abs + dy.abs <= range and dx >= 0)
  3004. when 4
  3005. return true if (dx.abs + dy.abs <= range and dx <= 0)
  3006. end
  3007. when 6 #WALL
  3008. case self.direction
  3009. when 2
  3010. return true if (dx.abs <= range and dy == 0 )
  3011. when 4
  3012. return true if (dy.abs <= range and dx == 0)
  3013. when 6
  3014. return true if (dy.abs <= range and dx == 0)
  3015. when 8
  3016. return true if (dx.abs <= range and dy == 0)
  3017. end
  3018. when 7 #CROSS
  3019. return true if (dx.abs <= range and dy == 0)
  3020. return true if (dy.abs <= range and dx == 0)
  3021. end
  3022. return false
  3023. end
  3024.  
  3025. #--------------------------------------------------------------------------
  3026. # ● action_effect Page
  3027. #--------------------------------------------------------------------------
  3028. def action_effect_page(attacker, attack_id)
  3029. return false unless self.is_a?(Game_Event)
  3030. return false if attacker.action.fake_id
  3031. if attacker.action != nil
  3032. check_auto_effect_page(attacker, attack_id)
  3033. check_reflectable_skills(attacker, attack_id)
  3034. end
  3035. for page in @event.pages
  3036. if page.condition.variable_valid and
  3037. page.condition.variable_id == XAS_SYSTEM::HIT_ID and
  3038. page.condition.variable_value == attack_id
  3039. self.reaction_valid_attack_id = attack_id
  3040. self.refresh
  3041. @trigger = 0
  3042. self.start
  3043. return true
  3044. end
  3045. end
  3046. return false
  3047. end
  3048.  
  3049. #--------------------------------------------------------------------------
  3050. # ● Check Reflectable Skills
  3051. #--------------------------------------------------------------------------
  3052. def check_reflectable_skills(attacker, attack_id)
  3053. return if self.tool_id == 0
  3054. return unless self.action.reflectable
  3055. return unless attacker.action.can_reflect
  3056. self.action.user = attacker.action.user
  3057. self.action.hit_events = []
  3058. self.turn_back
  3059. end
  3060.  
  3061. #--------------------------------------------------------------------------
  3062. # ● Check Auto Effect Page
  3063. #--------------------------------------------------------------------------
  3064. def check_auto_effect_page(attacker, attack_id)
  3065. if self.treasure_time > 0
  3066. if can_hit_take_treasure?(attacker, attack_id)
  3067. execute_take_treasure(attacker, attack_id)
  3068. elsif self.temp_id == 0 and can_hold_treasure?(attacker, attack_id)
  3069. execute_hold_treasure(attacker, attack_id)
  3070. end
  3071. end
  3072. end
  3073.  
  3074. #--------------------------------------------------------------------------
  3075. # ● Can Hit Take Treasure
  3076. #--------------------------------------------------------------------------
  3077. def can_hit_take_treasure?(attacker, attack_id)
  3078. return true if attacker.action.short_range
  3079. return false
  3080. end
  3081.  
  3082. #--------------------------------------------------------------------------
  3083. # ● Can Hold Treasure?
  3084. #--------------------------------------------------------------------------
  3085. def can_hold_treasure?(attacker, attack_id)
  3086. return true if attacker.tool_effect == "Boomerang"
  3087. return false
  3088. end
  3089.  
  3090. #--------------------------------------------------------------------------
  3091. # ● Execute Hold Treasure
  3092. #--------------------------------------------------------------------------
  3093. def execute_hold_treasure(attacker, attack_id)
  3094. tr_time = (100 + XAS_BA::TREASURE_ERASE_TIME * 60) - 20
  3095. return if self.treasure_time > tr_time
  3096. self.temp_id = attacker.id
  3097. end
  3098.  
  3099. #--------------------------------------------------------------------------
  3100. # ● Execute Take Treasure
  3101. #--------------------------------------------------------------------------
  3102. def execute_take_treasure(attacker, attack_id)
  3103. tr_time = (100 + XAS_BA::TREASURE_ERASE_TIME * 60) - 20
  3104. return if self.treasure_time > tr_time
  3105. self.x = $game_player.x
  3106. self.y = $game_player.y
  3107. end
  3108.  
  3109. #--------------------------------------------------------------------------
  3110. # ● body_size
  3111. #--------------------------------------------------------------------------
  3112. def body_size
  3113. return 0
  3114. end
  3115.  
  3116. #--------------------------------------------------------------------------
  3117. # ● action_clear
  3118. #--------------------------------------------------------------------------
  3119. def action_clear
  3120. @action = nil
  3121. @step_anime = false
  3122. end
  3123. end
  3124.  
  3125. #===============================================================================
  3126. # ■ Game_Character
  3127. #===============================================================================
  3128. class Game_Character < Game_CharacterBase
  3129. include XAS_ACTION
  3130. end
  3131.  
  3132. #===============================================================================
  3133. # ■ Game_Event
  3134. #===============================================================================
  3135. class Game_Event < Game_Character
  3136.  
  3137. #--------------------------------------------------------------------------
  3138. # * Refresh
  3139. #--------------------------------------------------------------------------
  3140. alias x_conditions_met conditions_met?
  3141. def conditions_met?(page)
  3142. c = page.condition
  3143. if c.variable_valid
  3144. if c.variable_id == XAS_SYSTEM::HIT_ID and
  3145. c.variable_value == self.reaction_valid_attack_id
  3146. return true
  3147. end
  3148. end
  3149. x_conditions_met(page)
  3150. end
  3151.  
  3152. end
  3153.  
  3154. #===============================================================================
  3155. # ■ XAS_Dispose
  3156. #===============================================================================
  3157. module XAS_Dispose
  3158.  
  3159. #--------------------------------------------------------------------------
  3160. # ● update
  3161. #--------------------------------------------------------------------------
  3162. def update
  3163. action_update
  3164. super
  3165. if @action.is_a?(Game_Action_XAS) and @action.done?
  3166. self.action_clear
  3167. end
  3168. end
  3169. end
  3170.  
  3171. #===============================================================================
  3172. # ■ Game_Player
  3173. #===============================================================================
  3174. class Game_Player < Game_Character
  3175. include XAS_Dispose
  3176. end
  3177.  
  3178. #===============================================================================
  3179. # ■ Game_Event
  3180. #===============================================================================
  3181. class Game_Event < Game_Character
  3182. include XAS_Dispose
  3183. end
  3184.  
  3185. #===============================================================================
  3186. # ■ XAS_StopToAction
  3187. #===============================================================================
  3188. module XAS_StopToAction
  3189.  
  3190. #--------------------------------------------------------------------------
  3191. # ● acting?
  3192. #--------------------------------------------------------------------------
  3193. def acting?
  3194. return false if self.battler == nil
  3195. return true if self.battler.shield
  3196. return true if self.action != nil
  3197. return false
  3198. end
  3199.  
  3200. #--------------------------------------------------------------------------
  3201. # ● moving?
  3202. #--------------------------------------------------------------------------
  3203. def moving?
  3204. return (super or self.acting? or self.stop)
  3205. end
  3206.  
  3207. end
  3208.  
  3209. #===============================================================================
  3210. # ■ Game_Player
  3211. #===============================================================================
  3212. class Game_Player < Game_Character
  3213. include XAS_StopToAction
  3214. end
  3215.  
  3216. #===============================================================================
  3217. # ■ Game_Event
  3218. #===============================================================================
  3219. class Game_Event < Game_Character
  3220. attr_accessor :reaction_valid_attack_id
  3221. end
  3222.  
  3223.  
  3224. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  3225. #■ TOOL - HIT EFFECT
  3226. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  3227.  
  3228.  
  3229. #===============================================================================
  3230. # ■ XRXS_BattlerAttachment
  3231. #==============================================================================
  3232. module XRXS_BattlerAttachment
  3233.  
  3234. #--------------------------------------------------------------------------
  3235. # ● Can Hit Base?
  3236. #--------------------------------------------------------------------------
  3237. def can_hit_base?(bullet, action_id)
  3238. return false unless $game_system.xas_battle
  3239. return false if self.battler == nil
  3240. return false if bullet == nil
  3241. return false if action_id == nil or action_id <= 0
  3242. return false if self.can_update == false
  3243. return true
  3244. end
  3245.  
  3246. #--------------------------------------------------------------------------
  3247. # ● Action Effect
  3248. #--------------------------------------------------------------------------
  3249. def action_effect(bullet, action_id)
  3250. return unless can_hit_base?(bullet, action_id)
  3251. skill = $data_skills[action_id]
  3252. user = bullet.action.user
  3253. attacker = (user == nil ? nil : user.battler)
  3254. tar_invu = bullet.action.target_invunerable_duration
  3255. #CAN HIT?
  3256. return unless action_can_hit_target?(bullet, user, skill,tar_invu)
  3257. #REFLECT STATE
  3258. return if reflect_state?(bullet, skill)
  3259. #SHIELD
  3260. if target_shield_enabled?(attacker, skill, bullet)
  3261. execute_guard_effect(user, skill, bullet, tar_invu)
  3262. return
  3263. end
  3264. #INVUNERABLE ACTIONS
  3265. if target_invunerable_actions?(user, skill, bullet)
  3266. execute_guard_effect(user, skill, bullet, tar_invu, false)
  3267. return
  3268. end
  3269. #GUARD DIRECTIONS
  3270. if target_guard_directions?(user, skill, bullet)
  3271. execute_guard_effect(user, skill, bullet, tar_invu)
  3272. return
  3273. end
  3274. execute_hit_effect(attacker,skill, bullet , user, tar_invu )
  3275. if self.is_a?(Game_Player)
  3276. self.need_refresh = true
  3277. end
  3278. end
  3279.  
  3280. #--------------------------------------------------------------------------
  3281. # ● Reflect State?
  3282. #--------------------------------------------------------------------------
  3283. def reflect_state?(bullet, skill)
  3284. if bullet.action.reflectable and self.battler.state_reflect
  3285. if skill.note =~ /<Auto Target>/
  3286. bullet.moveto(bullet.action.user.x,bullet.action.user.y)
  3287. else
  3288. bullet.turn_back
  3289. end
  3290. bullet.action.user = self
  3291. bullet.action.hit_events = []
  3292. bullet.turn_back
  3293. # bullet.jump(0,0)
  3294. bullet.turn_back
  3295. self.battler.damage = XAS_WORD::REFLECT
  3296. self.battler.damage_pop = true
  3297. self.animation_id = XAS_ANIMATION::REFLECT_ANIMATION_ID
  3298. self.battler.invunerable_duration = 20
  3299. return true
  3300. end
  3301. return false
  3302. end
  3303.  
  3304. #--------------------------------------------------------------------------
  3305. # ● Target Guard Directions?
  3306. #--------------------------------------------------------------------------
  3307. def target_guard_directions?(user, skill, bullet)
  3308. return false if self.battler.guard == false
  3309. return false if bullet.action.ignore_guard
  3310. if self.battler.guard_directions.include?(2) and
  3311. ((self.direction == 2 and bullet.direction == 8) or
  3312. (self.direction == 8 and bullet.direction == 2) or
  3313. (self.direction == 6 and bullet.direction == 4) or
  3314. (self.direction == 4 and bullet.direction == 6))
  3315. return true
  3316. elsif self.battler.guard_directions.include?(8) and
  3317. ((self.direction == 8 and bullet.direction == 8) or
  3318. (self.direction == 2 and bullet.direction == 2) or
  3319. (self.direction == 6 and bullet.direction == 6) or
  3320. (self.direction == 4 and bullet.direction == 4))
  3321. return true
  3322. elsif self.battler.guard_directions.include?(4) and
  3323. ((self.direction == 2 and bullet.direction == 4) or
  3324. (self.direction == 8 and bullet.direction == 6) or
  3325. (self.direction == 6 and bullet.direction == 2) or
  3326. (self.direction == 4 and bullet.direction == 8))
  3327. return true
  3328. elsif self.battler.guard_directions.include?(6) and
  3329. ((self.direction == 2 and bullet.direction == 6) or
  3330. (self.direction == 8 and bullet.direction == 4) or
  3331. (self.direction == 6 and bullet.direction == 8) or
  3332. (self.direction == 4 and bullet.direction == 2))
  3333. return true
  3334. end
  3335. return false
  3336. end
  3337.  
  3338. #--------------------------------------------------------------------------
  3339. # ● Target Invunerable Actions?
  3340. #--------------------------------------------------------------------------
  3341. def target_invunerable_actions?(user, skill, bullet)
  3342. return true if self.battler.invunerable_actions.include?(skill.id)
  3343. return false
  3344. end
  3345.  
  3346. #--------------------------------------------------------------------------
  3347. # ● Shoot Target Shield
  3348. #--------------------------------------------------------------------------
  3349. def shoot_target_shield?(bullet,user, skill)
  3350. return false unless self.battler.shield
  3351. return false if bullet.action.ignore_guard
  3352. return true if face_direction?(bullet)
  3353. return false
  3354. end
  3355.  
  3356. #--------------------------------------------------------------------------
  3357. # ● Action can hit target?
  3358. #--------------------------------------------------------------------------
  3359. def action_can_hit_target?(bullet, user, skill,tar_invu)
  3360. if user == nil
  3361. return false
  3362. end
  3363. if self.battler.invunerable
  3364. return false
  3365. end
  3366. if self.battler.dead?
  3367. return false
  3368. end
  3369. if self.battler.invunerable_duration > 0
  3370. return false
  3371. end
  3372. if @knock_back_duration != nil
  3373. return false unless bullet.action.ignore_knockback_invincible
  3374. end
  3375. if bullet.action.first_impact_time > 0
  3376. return false
  3377. end
  3378. if self.action != nil and self.action.user_invincible
  3379. unless self.action.ally_damage and bullet.action.user == self.action.user
  3380. return false
  3381. end
  3382. end
  3383. unless bullet.action.all_damage
  3384. if bullet.action.ally_damage
  3385. if user.battler.is_a?(Game_Actor)
  3386. return false if self.battler.is_a?(Game_Enemy)
  3387. elsif user.battler.is_a?(Game_Enemy)
  3388. return false if self.battler.is_a?(Game_Actor)
  3389. end
  3390. else
  3391. if user.battler.is_a?(Game_Actor)
  3392. return false if self.battler.is_a?(Game_Actor)
  3393. elsif user.battler.is_a?(Game_Enemy)
  3394. return false if self.battler.is_a?(Game_Enemy)
  3395. end
  3396. end
  3397. end
  3398. return false if target_state_invunerable?(tar_invu)
  3399. #return false if target_reflect_action?(bullet, user)
  3400. return true
  3401. end
  3402.  
  3403. #--------------------------------------------------------------------------
  3404. # ● Target Relfect Action
  3405. #--------------------------------------------------------------------------
  3406. def target_reflect_action?(bullet, user)
  3407. return false unless bullet.action.reflectable
  3408. for i in $game_map.events.values
  3409. if i.tool_id > 0 and i.action.can_reflect and
  3410. i.tool_effect == "Barrier"# and i.action.user.battler.is_a?(self.battler)
  3411. bullet.action.user = self
  3412. bullet.action.hit_events = []
  3413. bullet.turn_back
  3414. return true
  3415. break
  3416. end
  3417. end
  3418. return false
  3419. end
  3420.  
  3421. #--------------------------------------------------------------------------
  3422. # ● Target State Invunerable
  3423. #--------------------------------------------------------------------------
  3424. def target_state_invunerable?(tar_invu)
  3425. if self.battler.state_invunerable
  3426. self.battler.damage = XAS_WORD::INVINCIBLE
  3427. self.battler.damage_pop = true
  3428. self.animation_id = XAS_ANIMATION::INVINCIBLE_ANIMATION_ID
  3429. self.battler.invunerable_duration = tar_invu
  3430. return true
  3431. end
  3432. return false
  3433. end
  3434.  
  3435. #--------------------------------------------------------------------------
  3436. # ● Execute Hit Effect
  3437. #--------------------------------------------------------------------------
  3438. def execute_hit_effect(attacker,skill, bullet , user, tar_invu)
  3439. shoot_effect_before_damage(skill, bullet, user)
  3440. execute_battler_skill_effect(attacker ,skill, user)
  3441. if target_missed?(attacker)
  3442. self.battler.invunerable_duration = 30
  3443. return
  3444. end
  3445. execute_damage_pop(attacker,skill)
  3446. shoot_effect_after_damage(skill, bullet, user) if can_damage_after_effect?
  3447. execute_state_effect(skill, user, bullet)
  3448. bullet.action.duration = 1 if remove_tool_after_hit?(skill, bullet, user)
  3449. self.battler.invunerable_duration = tar_invu
  3450. execute_blow_effect(skill,bullet) if can_blow_effect?
  3451. execute_animation(skill, bullet, user)
  3452. execute_tool_effects(skill, bullet , user)
  3453. end
  3454.  
  3455. #--------------------------------------------------------------------------
  3456. # ● Execute Tool Effects
  3457. #--------------------------------------------------------------------------
  3458. def execute_tool_effects(skill, bullet , user)
  3459. execute_sticky_effect(skill, bullet, user)
  3460. execute_bounce_effect(skill, bullet, user)
  3461. execute_hit_action_effect(skill, bullet, user)
  3462. end
  3463.  
  3464. #--------------------------------------------------------------------------
  3465. # ● Remove Tool After Hit?
  3466. #--------------------------------------------------------------------------
  3467. def remove_tool_after_hit?(skill, bullet, user)
  3468. return true if bullet.action.piercing == false
  3469. return false
  3470. end
  3471.  
  3472. #--------------------------------------------------------------------------
  3473. # ● Execute Battler Skill Effect
  3474. #--------------------------------------------------------------------------
  3475. def execute_battler_skill_effect(attacker ,skill, user)
  3476. self.battler.item_apply(attacker, skill)
  3477. end
  3478.  
  3479. #--------------------------------------------------------------------------
  3480. # ● Target Missed?
  3481. #--------------------------------------------------------------------------
  3482. def target_missed?(attacker)
  3483. if self.battler.result.missed
  3484. self.battler.damage = XAS_WORD::MISSED
  3485. self.battler.damage_pop = true
  3486. return true
  3487. end
  3488. if self.battler.result.evaded
  3489. self.battler.damage = XAS_WORD::EVADED
  3490. self.battler.damage_pop = true
  3491. return true
  3492. end
  3493. return false
  3494. end
  3495. #--------------------------------------------------------------------------
  3496. # ● Shoot Effect Before Damage
  3497. #--------------------------------------------------------------------------
  3498. def shoot_effect_before_damage(skill, bullet, user)
  3499. end
  3500.  
  3501. #--------------------------------------------------------------------------
  3502. # ● Shoot Effect After Damage
  3503. #--------------------------------------------------------------------------
  3504. def shoot_effect_after_damage(skill, bullet, user)
  3505. check_counter_attack(skill)
  3506. self.battler.passive = false
  3507. end
  3508.  
  3509. #--------------------------------------------------------------------------
  3510. # ● Shoot Effect After Damage
  3511. #--------------------------------------------------------------------------
  3512. def check_counter_attack(skill)
  3513. return if self.battler.is_a?(Game_Actor)
  3514. return if self.battler.counter_action[2] == false
  3515. return if self.battler.counter_action[1] > 0
  3516. counter = XAS_BA_ENEMY::COUNTER_ATTACK[self.battler.enemy_id]
  3517. if counter != nil
  3518. counter_action_id = counter[rand(counter.size)]
  3519. self.battler.counter_action[0] = counter_action_id
  3520. self.battler.counter_action[1] = 15
  3521. end
  3522. end
  3523.  
  3524. #--------------------------------------------------------------------------
  3525. # ● Execute Bounce Effect
  3526. #--------------------------------------------------------------------------
  3527. def execute_bounce_effect(skill, bullet, user)
  3528. return false if bullet.action.hit_bounce == false
  3529. bullet.bounce_direction
  3530. end
  3531.  
  3532. #--------------------------------------------------------------------------
  3533. # ● Execute Stick Effect
  3534. #--------------------------------------------------------------------------
  3535. def execute_sticky_effect(skill, bullet, user)
  3536. return unless bullet.action.sticky
  3537. return if bullet.temp_id != 0
  3538. bullet.pre_move_speed = bullet.move_speed
  3539. bullet.temp_id = self.id
  3540. end
  3541.  
  3542. #--------------------------------------------------------------------------
  3543. # ● Execute Hit Action Effect
  3544. #--------------------------------------------------------------------------
  3545. def execute_hit_action_effect(skill, bullet, user)
  3546. return if bullet.action.hit_action == 0
  3547. self.battler.invunerable_duration = 1
  3548. bullet.shoot(bullet.action.hit_action)
  3549. bullet.action.duration = 9
  3550. bullet.action.multi_hit = false
  3551. bullet.character_name = ""
  3552. bullet.x_pose_duration = 0
  3553. bullet.x_pose_name = ""
  3554. bullet.x_pose_original_name = ""
  3555. end
  3556.  
  3557. #--------------------------------------------------------------------------
  3558. # ● Can Damage Effect
  3559. #--------------------------------------------------------------------------
  3560. def can_damage_after_effect?
  3561. return false if self.battler.damage == nil
  3562. return false unless self.battler.damage.is_a?(Numeric)
  3563. return true
  3564. end
  3565.  
  3566. #--------------------------------------------------------------------------
  3567. # ● Execute State Effect
  3568. #--------------------------------------------------------------------------
  3569. def execute_state_effect(skill, user, bullet)
  3570. if user.battler.states.size != 0
  3571. for i in user.battler.states
  3572. execute_state_effect_user(skill, user, bullet,i)
  3573. end
  3574. end
  3575. if self.battler.states.size != 0
  3576. for i in self.battler.states
  3577. execute_state_effect_target(skill, user, bullet,i)
  3578. end
  3579. end
  3580. end
  3581.  
  3582. #--------------------------------------------------------------------------
  3583. # ● Execute State Effect User
  3584. #--------------------------------------------------------------------------
  3585. def execute_state_effect_user(skill, user, bullet,i)
  3586.  
  3587. end
  3588.  
  3589. #--------------------------------------------------------------------------
  3590. # ● Execute State Target
  3591. #--------------------------------------------------------------------------
  3592. def execute_state_effect_target(skill, user, bullet,i)
  3593. #Sleep
  3594. if self.battler.damage.is_a?(Numeric) and self.battler.damage > 0
  3595. if i.note =~ /<Sleep>/
  3596. self.battler.remove_state(i.id)
  3597. end
  3598. end
  3599. end
  3600.  
  3601. #--------------------------------------------------------------------------
  3602. # ● Execute Blow Effect
  3603. #--------------------------------------------------------------------------
  3604. def execute_blow_effect(skill,bullet)
  3605. if bullet.action.hit_hold_target and self.temp_id == 0
  3606. self.temp_id = bullet.id
  3607. self.pre_move_speed = self.move_speed
  3608. self.moveto(bullet.x, bullet.y)
  3609. end
  3610. $game_map.screen.start_shake(5, 5, 60) if bullet.action.hit_shake
  3611. p = bullet.action.blow_power.to_i
  3612. d = bullet.direction
  3613. return if self.battler.damage.to_i <= 0
  3614. return if p < 0
  3615. self.blow(d, p)
  3616. end
  3617.  
  3618. #--------------------------------------------------------------------------
  3619. # ● Execute Animation
  3620. #--------------------------------------------------------------------------
  3621. def execute_animation(skill, bullet, user)
  3622. self.animation_id = skill.animation_id
  3623. tool_animation = bullet.action.second_animation_id
  3624. user_animation = bullet.action.third_animation_id
  3625. bullet.animation_id = tool_animation if tool_animation != 0
  3626. user.animation_id = user_animation if user_animation != 0
  3627. end
  3628.  
  3629. #--------------------------------------------------------------------------
  3630. # ● Knock Back Disable
  3631. #--------------------------------------------------------------------------
  3632. def knock_back_disable
  3633. return false
  3634. end
  3635.  
  3636. #--------------------------------------------------------------------------
  3637. # ● Dead?
  3638. #--------------------------------------------------------------------------
  3639. def dead?
  3640. return self.battler == nil ? false : self.battler.dead?
  3641. end
  3642.  
  3643. end
  3644.  
  3645.  
  3646. #===============================================================================
  3647. # ■ XRXS_BattlerAttachment
  3648. #==============================================================================
  3649. module XRXS_BattlerAttachment
  3650.  
  3651. #--------------------------------------------------------------------------
  3652. # ● Shoot Target Shield
  3653. #--------------------------------------------------------------------------
  3654. def target_shield_enabled?(attacker, skill, bullet)
  3655. return false unless self.battler.shield
  3656. if bullet != nil
  3657. return false if bullet.action.ignore_guard
  3658. return true if face_direction?(bullet)
  3659. else
  3660. return false if attacker.battler.ignore_guard
  3661. return true if face_direction?(attacker)
  3662. end
  3663. return false
  3664. end
  3665.  
  3666. #--------------------------------------------------------------------------
  3667. # ● Can Blow Effect
  3668. #--------------------------------------------------------------------------
  3669. def can_blow_effect?
  3670. return false if self.battler.no_knockback
  3671. return false if $game_map.interpreter.running?
  3672. return true
  3673. end
  3674.  
  3675. #--------------------------------------------------------------------------
  3676. # ● Execute Guard Effect
  3677. #--------------------------------------------------------------------------
  3678. def execute_guard_effect(attacker, skill, bullet, inv, erase_bullet = true)
  3679. self.battler.invunerable_duration = inv
  3680. damage_pop(XAS_WORD::GUARD)
  3681. guard_animation_id = XAS_ANIMATION::GUARD_ANIMATION_ID
  3682. self.animation_id = guard_animation_id if guard_animation_id != 0
  3683. if bullet != nil
  3684. bullet.erase if erase_bullet
  3685. else
  3686. blow_reverse(attacker) unless attacker.battler.no_knockback
  3687. end
  3688. end
  3689.  
  3690. #--------------------------------------------------------------------------
  3691. # ● Blow Reverse
  3692. #--------------------------------------------------------------------------
  3693. def blow_reverse(attacker)
  3694. return if attacker.battler.no_knockback
  3695. case attacker.direction
  3696. when 2
  3697. d = 8
  3698. when 4
  3699. d = 6
  3700. when 6
  3701. d = 4
  3702. when 8
  3703. d = 2
  3704. end
  3705. attacker.jump(0,0)
  3706. attacker.blow(d,1)
  3707. end
  3708.  
  3709. #--------------------------------------------------------------------------
  3710. # ● Can Attack Effect
  3711. #--------------------------------------------------------------------------
  3712. def damage_pop(text)
  3713. return unless XAS_WORD::ENABLE_WORD
  3714. self.battler.damage = text
  3715. self.battler.damage_pop = true
  3716. end
  3717.  
  3718. #--------------------------------------------------------------------------
  3719. # ● Shd Direction?
  3720. #--------------------------------------------------------------------------
  3721. def face_direction?(attacker)
  3722. target = self.direction
  3723. case target
  3724. when 2
  3725. return true if attacker.direction == 8
  3726. when 4
  3727. return true if attacker.direction == 6
  3728. when 6
  3729. return true if attacker.direction == 4
  3730. when 8
  3731. return true if attacker.direction == 2
  3732. end
  3733. return false
  3734. end
  3735.  
  3736. #--------------------------------------------------------------------------
  3737. # ● Execute Damage Pop
  3738. #--------------------------------------------------------------------------
  3739. def execute_damage_pop(attacker,skill = nil)
  3740. if skill != nil
  3741. return if skill.note =~ /<No Damage Pop>/
  3742. if skill.damage.to_mp?
  3743. dam = self.battler.result.mp_damage
  3744. self.battler.damage_type = "Mp"
  3745. elsif skill.damage.to_hp?
  3746. dam = self.battler.result.hp_damage
  3747. self.battler.damage_type = "Critical" if self.battler.result.critical
  3748. end
  3749. if dam != nil
  3750. if skill.damage.drain? or skill.damage.drain?
  3751. attacker.damage = -dam
  3752. attacker.damage_type = self.battler.damage_type
  3753. attacker.damage_pop = true
  3754. end
  3755. self.battler.damage = dam
  3756. self.battler.damage_pop = true
  3757. end
  3758. else
  3759. if self.battler.result.hp_damage != nil
  3760. self.battler.damage = self.battler.result.hp_damage
  3761. self.battler.damage_type = "Critical" if self.battler.result.critical
  3762. self.battler.damage_pop = true
  3763. end
  3764. end
  3765. end
  3766.  
  3767. end
  3768.  
  3769.  
  3770.  
  3771. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  3772. #■ TOOL - EQUIP
  3773. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  3774.  
  3775.  
  3776. #==============================================================================
  3777. # ■ Window Skill List
  3778. #==============================================================================
  3779. class Window_SkillList < Window_Selectable
  3780.  
  3781. #--------------------------------------------------------------------------
  3782. # ● Process OK
  3783. #--------------------------------------------------------------------------
  3784. alias x_skill_process_ok process_ok
  3785. def process_ok
  3786. return if can_equip_skill_action?
  3787. x_skill_process_ok
  3788. end
  3789.  
  3790. #--------------------------------------------------------------------------
  3791. # ● Can Equip Skill Action
  3792. #--------------------------------------------------------------------------
  3793. def can_equip_skill_action?
  3794. return false if $game_party.in_battle
  3795. skill = @data[index]
  3796. if skill != nil and skill.note =~ /<Duration = (\d+)>/
  3797. @actor.skill_id = skill.id
  3798. Sound.play_equip
  3799. return true
  3800. end
  3801. return false
  3802. end
  3803.  
  3804. end
  3805. #-----以下为冗余代码
  3806. #==============================================================================
  3807. # ■ Window Item List
  3808. #~ #==============================================================================
  3809. #~ class Window_ItemList < Window_Selectable
  3810. #~
  3811. #~ #--------------------------------------------------------------------------
  3812. #~ # ● Process OK
  3813. #~ #--------------------------------------------------------------------------
  3814. #~ alias x_item_process_ok process_ok
  3815. #~ def process_ok
  3816. #~ return if can_equip_item_action?
  3817. #~ x_item_process_ok
  3818. #~ end
  3819.  
  3820. #~ #--------------------------------------------------------------------------
  3821. #~ # ● Can Equip Item Action
  3822. #~ #--------------------------------------------------------------------------
  3823. #~ def can_equip_item_action?
  3824. #~ return false if $game_party.in_battle
  3825. #~ item = @data[index]
  3826. #~ if item != nil and item.is_a?(RPG::Item) and
  3827. #~ item.note =~ /<Action ID = (\d+)>/
  3828. #~ actor = $game_party.members[0]
  3829. #~ actor.item_id = item.id
  3830. #~ Sound.play_equip
  3831. #~ return true
  3832. #~ end
  3833. #~ return false
  3834. #~ end
  3835. #~
  3836. #~ end
  3837. #------------------------------------------
  3838.  
  3839.  
  3840. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  3841. #■ BATTLER - INITIALIZE
  3842. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  3843.  
  3844.  
  3845. #===============================================================================
  3846. # ■ Game Character
  3847. #==============================================================================
  3848. class Game_Character < Game_CharacterBase
  3849.  
  3850. #--------------------------------------------------------------------------
  3851. # ● Update Battler
  3852. #--------------------------------------------------------------------------
  3853. def update_battler
  3854. update_battler_pose
  3855. update_battler_parameters
  3856. update_battler_stop_movement
  3857. update_battler_knockbacking
  3858. update_battler_counter_action
  3859. unless self.battler.hp == 0
  3860. update_battler_cast_action
  3861. # update_battler_move_speed if can_update_battler_move_speed?
  3862. update_battler_states_effect
  3863. update_battler_attacking
  3864. else
  3865. update_battler_defeat_process
  3866. end
  3867. end
  3868.  
  3869. end
  3870.  
  3871. #===============================================================================
  3872. # ■ Game Player
  3873. #===============================================================================
  3874. class Game_Player < Game_Character
  3875. include XRXS_BattlerAttachment
  3876.  
  3877. #--------------------------------------------------------------------------
  3878. # ● Battler
  3879. #--------------------------------------------------------------------------
  3880. def battler
  3881. return $game_party.members[0]
  3882. end
  3883.  
  3884. #--------------------------------------------------------------------------
  3885. # ● Refresh Interpreter Effect
  3886. #--------------------------------------------------------------------------
  3887. def refresh_interpreter_effect
  3888. $game_system.old_interpreter_running = $game_map.interpreter.running?
  3889. if $game_system.old_interpreter_running
  3890. $game_temp.reset_battler_time = 60 * 4
  3891. end
  3892. reset_battler_setting
  3893. end
  3894.  
  3895. #--------------------------------------------------------------------------
  3896. # ● Update Battler Setting Time
  3897. #--------------------------------------------------------------------------
  3898. def update_reset_battler_setting_time
  3899. return if $game_temp.reset_battler_time == 0
  3900. $game_temp.reset_battler_time -= 1
  3901. reset_battler_setting_running if $game_temp.reset_battler_time == 0
  3902. end
  3903.  
  3904. #--------------------------------------------------------------------------
  3905. # ● Update Battler Setting
  3906. #--------------------------------------------------------------------------
  3907. def reset_battler_setting
  3908. reset_player_parameters
  3909. for ally in $game_party.members
  3910. reset_members_parameters(ally)
  3911. end
  3912. for enemy in $game_map.events.values
  3913. reset_enemies_parameters(enemy) if enemy.battler != nil
  3914. end
  3915. $game_map.need_refresh = true
  3916. end
  3917.  
  3918. #--------------------------------------------------------------------------
  3919. # ● Update Battler Setting Running
  3920. #--------------------------------------------------------------------------
  3921. def reset_battler_setting_running
  3922. reset_player_parameters_running
  3923. for ally in $game_party.members
  3924. reset_members_parameters_running(ally)
  3925. end
  3926. for enemy in $game_map.events.values
  3927. reset_enemies_parameters(enemy) if enemy.battler != nil
  3928. end
  3929. $game_map.need_refresh = true
  3930. end
  3931.  
  3932. #--------------------------------------------------------------------------
  3933. # ● Reset Enemies Parameters
  3934. #--------------------------------------------------------------------------
  3935. def reset_enemies_parameters(enemy)
  3936. enemy.battler.cast_action[0] = 0
  3937. enemy.battler.cast_action[1] = 0
  3938. enemy.battler.cast_action[2] = 0
  3939. enemy.battler.cast_action[3] = 0
  3940. enemy.battler.cast_action[4] = 0
  3941. enemy.battler.counter_action[0] = 0
  3942. enemy.battler.counter_action[1] = 0
  3943. enemy.battler.counter_action[2] = true
  3944. enemy.battler.invunerable_duration = 0
  3945. enemy.knock_back_duration = nil
  3946. end
  3947.  
  3948. #--------------------------------------------------------------------------
  3949. # ● Reset Members Parameters
  3950. #--------------------------------------------------------------------------
  3951. def reset_members_parameters(ally)
  3952. ally.old_level = ally.level
  3953. ally.shield = false
  3954. ally.x_charge_action[0] = 0
  3955. ally.x_charge_action[1] = 0
  3956. ally.x_charge_action[2] = 0
  3957. ally.x_charge_action[3] = 0
  3958. ally.cast_action[0] = 0
  3959. ally.cast_action[1] = 0
  3960. ally.cast_action[2] = 0
  3961. ally.cast_action[3] = 0
  3962. ally.cast_action[4] = 0
  3963. ally.counter_action[0] = 0
  3964. ally.counter_action[1] = 0
  3965. ally.counter_action[2] = true
  3966. ally.invunerable_duration = 0
  3967. end
  3968.  
  3969. #--------------------------------------------------------------------------
  3970. # ● Reset Player Parameters
  3971. #--------------------------------------------------------------------------
  3972. def reset_player_parameters
  3973. make_pose("", 1) unless $game_player.action != nil
  3974. $game_temp.xas_target_time = 0
  3975. $game_temp.xas_target_shoot_id = 0
  3976. $game_temp.xas_target_x = 0
  3977. @knock_back_duration = nil
  3978. @dash_active = false
  3979. end
  3980.  
  3981.  
  3982. #--------------------------------------------------------------------------
  3983. # ● Reset Members Parameters Running
  3984. #--------------------------------------------------------------------------
  3985. def reset_members_parameters_running(ally)
  3986. ally.old_level = ally.level
  3987. ally.shield = false
  3988. unless ally.x_charge_action[1] > 0
  3989. ally.x_charge_action[0] = 0
  3990. ally.x_charge_action[1] = 0
  3991. ally.x_charge_action[2] = 0
  3992. ally.x_charge_action[3] = 0
  3993. end
  3994. unless ally.cast_action[1] > 0
  3995. ally.cast_action[0] = 0
  3996. ally.cast_action[1] = 0
  3997. ally.cast_action[2] = 0
  3998. ally.cast_action[3] = 0
  3999. ally.cast_action[4] = 0
  4000. end
  4001. ally.counter_action[0] = 0
  4002. ally.counter_action[1] = 0
  4003. ally.counter_action[2] = true
  4004. ally.invunerable_duration = 0
  4005. end
  4006.  
  4007. #--------------------------------------------------------------------------
  4008. # ● Reset Player Parameters Running
  4009. #--------------------------------------------------------------------------
  4010. def reset_player_parameters_running
  4011. $game_temp.xas_target_time = 0
  4012. $game_temp.xas_target_shoot_id = 0
  4013. $game_temp.xas_target_x = 0
  4014. @knock_back_duration = nil
  4015. @dash_active = false
  4016. end
  4017.  
  4018. end
  4019.  
  4020. #===============================================================================
  4021. # ■ Game Follower
  4022. #===============================================================================
  4023. class Game_Follower < Game_Character
  4024. include XRXS_BattlerAttachment
  4025.  
  4026. #--------------------------------------------------------------------------
  4027. # ● Battler
  4028. #--------------------------------------------------------------------------
  4029. def battler
  4030. return $game_party.members[@member_index]
  4031. end
  4032. end
  4033.  
  4034. #===============================================================================
  4035. # ■ Game Follower
  4036. #===============================================================================
  4037. class Game_Followers
  4038. include XRXS_BattlerAttachment
  4039.  
  4040. #--------------------------------------------------------------------------
  4041. # ● Battler
  4042. #--------------------------------------------------------------------------
  4043. def battler
  4044. return $game_party.members[@member_index]
  4045. end
  4046. end
  4047. #===============================================================================
  4048. # ■ Game_Vehicle
  4049. #===============================================================================
  4050. class Game_Vehicle < Game_Character
  4051. include XRXS_BattlerAttachment
  4052. attr_reader :collision_attack
  4053.  
  4054. #--------------------------------------------------------------------------
  4055. # ● Battler
  4056. #--------------------------------------------------------------------------
  4057. def battler
  4058. return @battler
  4059. end
  4060. end
  4061.  
  4062. #===============================================================================
  4063. # ■ Game Event
  4064. #===============================================================================
  4065. class Game_Event < Game_Character
  4066.  
  4067. include XRXS_BattlerAttachment
  4068.  
  4069. #--------------------------------------------------------------------------
  4070. # ● Battler
  4071. #--------------------------------------------------------------------------
  4072. def battler
  4073. return @battler
  4074. end
  4075.  
  4076. #--------------------------------------------------------------------------
  4077. # ● Battler?
  4078. #--------------------------------------------------------------------------
  4079. def battler?
  4080. return false if self.erased
  4081. return false if self.battler == nil
  4082. return false if self.dead?
  4083. return false if self.battler.no_damage_pop
  4084. return false if self.battler.invunerable
  4085. return true
  4086. end
  4087.  
  4088. #--------------------------------------------------------------------------
  4089. # ● Refresh
  4090. #--------------------------------------------------------------------------
  4091. alias xrxs64c_refresh refresh
  4092. def refresh
  4093. xrxs64c_refresh
  4094. self.battler_recheck
  4095. end
  4096.  
  4097. #--------------------------------------------------------------------------
  4098. # ● Battler Recheck
  4099. #--------------------------------------------------------------------------
  4100. def battler_recheck
  4101. return if @battler != nil
  4102. return if @page == nil
  4103. if self.name =~ /<Actor>/
  4104. actor = $game_party.members[0]
  4105. @battler = Game_Actor.new(actor.id)
  4106. return
  4107. else
  4108. @enemy_id = 0
  4109. if self.name =~ /<Enemy(\d+)>/i
  4110. @enemy_id = $1.to_i
  4111. end
  4112. return if @enemy_id <= 0
  4113. @battler = Game_Enemy.new(1, @enemy_id)
  4114. self.force_update = true if self.battler.sensor_range >= 15
  4115. end
  4116. end
  4117.  
  4118. #--------------------------------------------------------------------------
  4119. # ● Battler Recheck
  4120. #--------------------------------------------------------------------------
  4121. def enemy_id
  4122. return @enemy_id
  4123. end
  4124.  
  4125. #--------------------------------------------------------------------------
  4126. # ● body_size
  4127. #--------------------------------------------------------------------------
  4128. def body_size
  4129. if self.battler != nil
  4130. return self.battler.body_size
  4131. else
  4132. return 0
  4133. end
  4134. end
  4135.  
  4136. end
  4137.  
  4138.  
  4139. #===============================================================================
  4140. # ■ Game_Battler
  4141. #===============================================================================
  4142. class Game_Battler
  4143. attr_accessor :sensor_range
  4144. attr_accessor :body_size
  4145. attr_accessor :breath_effect
  4146. attr_accessor :breath_duration
  4147. attr_accessor :fast_breath_effect
  4148. attr_accessor :no_knockback
  4149. attr_accessor :passive
  4150. attr_accessor :attack_animation_id
  4151. attr_accessor :ignore_guard
  4152. attr_accessor :no_damage_pop
  4153.  
  4154. #--------------------------------------------------------------------------
  4155. # ● Initialize
  4156. #--------------------------------------------------------------------------
  4157. alias x_e_initialize initialize
  4158. def initialize
  4159. x_e_initialize
  4160. @sensor_range = 4
  4161. @body_size = 0
  4162. @breath_effect = false
  4163. @breath_duration = 0
  4164. @fast_breath_effect = false
  4165. @no_knockback = false
  4166. @passive = false
  4167. @attack_animation_id = 0
  4168. @ignore_guard = false
  4169. @no_damage_pop = false
  4170. end
  4171. end
  4172.  
  4173. #===============================================================================
  4174. # ■ Game_Enemy
  4175. #===============================================================================
  4176. class Game_Enemy < Game_Battler
  4177.  
  4178. #--------------------------------------------------------------------------
  4179. # ● Initialize
  4180. #--------------------------------------------------------------------------
  4181. alias x_e2_initialize initialize
  4182. def initialize(index, enemy_id)
  4183. x_e2_initialize(index, enemy_id)
  4184. enemy = $data_enemies[@enemy_id]
  4185. setup_enemy_note(enemy)
  4186. end
  4187.  
  4188. #--------------------------------------------------------------------------
  4189. # ● Setup X Note Elements
  4190. #--------------------------------------------------------------------------
  4191. def setup_enemy_note(enemy)
  4192. if enemy.note =~ /<Sensor Range = (\d+)>/
  4193. @sensor_range = $1.to_i
  4194. end
  4195. if enemy.note =~ /<Body Size = (\d+)>/
  4196. @body_size = $1.to_i
  4197. end
  4198. if enemy.note =~ /<Attack Animation = (\d+)>/
  4199. @attack_animation_id = $1.to_i
  4200. end
  4201. if enemy.note =~ /<Death Zoom = (\d+)>/
  4202. @death_zoom_effect = $1.to_i
  4203. end
  4204. if enemy.note =~ /<Knockback Duration = (\d+)>/
  4205. @knockback_duration = $1.to_i
  4206. end
  4207. if enemy.note =~ /<Ignore Guard>/
  4208. @ignore_shield = true
  4209. end
  4210. if enemy.note =~ /<Invunerable>/
  4211. @invunerable = true
  4212. end
  4213. if enemy.note =~ /
  4214. /
  4215. @breath_effect = true
  4216. end
  4217. if enemy.note =~ /<Knockback Disable>/
  4218. @no_knockback = true
  4219. end
  4220. if enemy.note =~ /<Passive>/
  4221. @passive = true
  4222. end
  4223. if enemy.note =~ /<No Damage Pop>/
  4224. @no_damage_pop = true
  4225. end
  4226. invunerable_actions_ids = XAS_BA_ENEMY::INVUNERABLE_ACTIONS[@enemy_id]
  4227. if invunerable_actions_ids != nil
  4228. @invunerable_actions = invunerable_actions_ids
  4229. end
  4230. guard_directions_ids = XAS_BA_ENEMY::GUARD_DIRECTIONS[@enemy_id]
  4231. if guard_directions_ids != nil
  4232. @guard_directions = guard_directions_ids
  4233. end
  4234. end
  4235.  
  4236.  
  4237. end
  4238.  
  4239.  
  4240. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  4241. #■ BATTLER - EVENT SENSOR
  4242. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  4243.  
  4244.  
  4245. #===============================================================================
  4246. # ■ XRXS_Enemy_Sensor
  4247. #===============================================================================
  4248. module XRXS_EnemySensor
  4249.  
  4250. #--------------------------------------------------------------------------
  4251. # ● Update Sensor
  4252. #--------------------------------------------------------------------------
  4253. def update_sensor
  4254. if self.battler != nil and self.battler.sensor_range > 0
  4255. sensor_area = self.battler.sensor_range
  4256. else
  4257. sensor_area = $game_variables[XAS_BA::DEFAULT_SENSOR_RANGE_VARIABLE_ID]
  4258. end
  4259. sensor_area = -1 if cancel_sensor?
  4260. distance = ($game_player.x - self.x).abs + ($game_player.y - self.y).abs
  4261. enable = (distance <= sensor_area)
  4262. key = [$game_map.map_id, self.id, XAS_BA::SENSOR_SELF_SWITCH]
  4263. last_enable = $game_self_switches[key]
  4264. last_enable = false if last_enable == nil
  4265. if enable != last_enable
  4266. touch_attack(false)
  4267. @collision_attack = false
  4268. @pattern = 0
  4269. @pattern_count = 0
  4270. $game_self_switches[key] = enable
  4271. self.refresh
  4272. end
  4273. end
  4274.  
  4275. #--------------------------------------------------------------------------
  4276. # ● Can Update Sensor
  4277. #--------------------------------------------------------------------------
  4278. def can_update_sensor?
  4279. return false if @sensor_enable == false
  4280. return false if self.dead?
  4281. return false if self.erased
  4282. return false if self.stop
  4283. return false if self.knockbacking?
  4284. return true
  4285. end
  4286.  
  4287. #--------------------------------------------------------------------------
  4288. # ● refresh_sensor
  4289. #--------------------------------------------------------------------------
  4290. def refresh_sensor
  4291. touch_attack(false)
  4292. key = [$game_map.map_id, self.id, XAS_BA::SENSOR_SELF_SWITCH]
  4293. $game_self_switches[key] = false
  4294. @pattern = 0
  4295. @pattern_count = 0
  4296. self.refresh
  4297. end
  4298.  
  4299. #--------------------------------------------------------------------------
  4300. # ● Cancel Sensor
  4301. #--------------------------------------------------------------------------
  4302. def cancel_sensor?
  4303. return false if self.battler == nil
  4304. return true if self.battler.passive
  4305. return false
  4306. end
  4307.  
  4308. end
  4309.  
  4310. #===============================================================================
  4311. # ■ Game Event
  4312. #===============================================================================
  4313. class Game_Event < Game_Character
  4314.  
  4315. attr_accessor :sensor_enable
  4316.  
  4317. #--------------------------------------------------------------------------
  4318. # ● Initialize
  4319. #--------------------------------------------------------------------------
  4320. alias x_sensor_initialize initialize
  4321. def initialize(map_id, event)
  4322. @sensor_enable = false
  4323. x_sensor_initialize(map_id, event)
  4324. end
  4325.  
  4326. #--------------------------------------------------------------------------
  4327. # ● Conditions Met
  4328. #--------------------------------------------------------------------------
  4329. alias x_sensor_conditions_met conditions_met?
  4330. def conditions_met?(page)
  4331. c = page.condition
  4332. if c.self_switch_ch == XAS_BA::SENSOR_SELF_SWITCH
  4333. @sensor_enable = true
  4334. end
  4335. x_sensor_conditions_met(page)
  4336. end
  4337. end
  4338.  
  4339. #===============================================================================
  4340. # ■ Game Event
  4341. #===============================================================================
  4342. class Game_Character < Game_CharacterBase
  4343. include XRXS_EnemySensor
  4344. end
  4345.  
  4346. #===============================================================================
  4347. # ■ Game Character
  4348. #===============================================================================
  4349. class Game_Character < Game_CharacterBase
  4350. attr_writer :opacity
  4351. end
  4352.  
  4353.  
  4354.  
  4355. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  4356. #■ BATTLER - ACTION
  4357. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  4358.  
  4359.  
  4360. #===============================================================================
  4361. # ■ Game Character
  4362. #==============================================================================
  4363. class Game_Character < Game_CharacterBase
  4364.  
  4365. #--------------------------------------------------------------------------
  4366. # ● Can Update Battler Move Speed
  4367. #--------------------------------------------------------------------------
  4368. def can_update_battler_move_speed?
  4369. return false if @temp_id > 0
  4370. return false if moving?
  4371. return true
  4372. end
  4373.  
  4374. #--------------------------------------------------------------------------
  4375. # ● Can Update Battler?
  4376. #--------------------------------------------------------------------------
  4377. def can_update_battler?
  4378. return false unless $game_system.xas_battle
  4379. return false if self.battler == nil
  4380. return false unless party_system?
  4381. return true
  4382. end
  4383.  
  4384. #--------------------------------------------------------------------------
  4385. # ● Party System
  4386. #--------------------------------------------------------------------------
  4387. def party_system?
  4388. return false if self.battler == nil
  4389. if $xas_party_system == nil and self.battler.is_a?(Game_Actor)
  4390. return false if self.battler.actor_id != $game_party.members[0].actor_id
  4391. end
  4392. return true
  4393. end
  4394.  
  4395. #--------------------------------------------------------------------------
  4396. # ● Reset Battler Temp
  4397. #--------------------------------------------------------------------------
  4398. def reset_battler_temp
  4399. reset_cast_temp
  4400. reset_charge_temp
  4401. end
  4402.  
  4403. #--------------------------------------------------------------------------
  4404. # ● Reset Charge Temp
  4405. #--------------------------------------------------------------------------
  4406. def reset_charge_temp
  4407. return if self.battler == nil
  4408. return if self.battler.is_a?(Game_Enemy)
  4409. self.battler.x_charge_action[0] = 0
  4410. self.battler.x_charge_action[1] = 0
  4411. self.battler.x_charge_action[2] = 0
  4412. self.battler.x_charge_action[3] = 0
  4413. end
  4414.  
  4415. #--------------------------------------------------------------------------
  4416. # ● Reset Battler Temp
  4417. #--------------------------------------------------------------------------
  4418. def reset_cast_temp
  4419. return if self.battler == nil
  4420. self.battler.cast_action[0] = 0
  4421. self.battler.cast_action[1] = 0
  4422. self.battler.cast_action[2] = 0
  4423. self.battler.cast_action[3] = 0
  4424. self.battler.cast_action[4] = 0
  4425. end
  4426.  
  4427. #--------------------------------------------------------------------------
  4428. # ● update_battler_parameters
  4429. #--------------------------------------------------------------------------
  4430. def update_battler_parameters
  4431. @stop_count = -1 if can_stop_battler?
  4432. self.battler.invunerable_duration -= 1 if self.battler.invunerable_duration > 0
  4433. unless @stop
  4434. @knock_back_duration = 30 if @temp_id > 0
  4435. end
  4436. end
  4437.  
  4438. #--------------------------------------------------------------------------
  4439. # ● Can Stop Battler
  4440. #--------------------------------------------------------------------------
  4441. def can_stop_battler?
  4442. return false if self.is_a?(Game_Player)
  4443. return true if self.knockbacking?
  4444. return true if self.dead?
  4445. return true if self.stop
  4446. return false
  4447. end
  4448.  
  4449. #--------------------------------------------------------------------------
  4450. # ● Update Battler Counter Action
  4451. #--------------------------------------------------------------------------
  4452. def update_battler_counter_action
  4453. return if self.battler.counter_action[1] == 0
  4454. self.battler.counter_action[1] -= 1
  4455. if self.battler.counter_action[1] == 0
  4456. turn_toward_player
  4457. self.battler.damage = XAS_WORD::COUNTER
  4458. self.battler.damage_pop = true
  4459. self.shoot(self.battler.counter_action[0])
  4460. self.battler.counter_action[0] = 0
  4461. end
  4462. end
  4463.  
  4464. #--------------------------------------------------------------------------
  4465. # ● Update Cast Action
  4466. #--------------------------------------------------------------------------
  4467. def update_battler_cast_action
  4468. return unless can_update_cast_action?
  4469. self.battler.cast_action[3] += 1
  4470. if self.battler.cast_action[3] > XAS_ANIMATION::LOOP_ANIMATIONS_SPEED
  4471. self.battler.cast_action[3] = 0
  4472. self.animation_id = self.battler.cast_action[2]
  4473. end
  4474. self.battler.cast_action[4] += 1
  4475. if self.battler.cast_action[4] >= self.battler.cast_action[1]
  4476. self.shoot(self.battler.cast_action[0])
  4477. end
  4478. end
  4479.  
  4480. #--------------------------------------------------------------------------
  4481. # ● Can Update Cast Action
  4482. #--------------------------------------------------------------------------
  4483. def can_update_cast_action?
  4484. return false if self.battler.cast_action[1] == 0
  4485. return false if @stop
  4486. return true
  4487. end
  4488.  
  4489. #--------------------------------------------------------------------------
  4490. # ● Can Blow Effect
  4491. #--------------------------------------------------------------------------
  4492. def can_blow?
  4493. return false if self.stop and not self.battler.state_sleep
  4494. return false if self.battler.no_knockback
  4495. return false if self.is_a?(Game_Player) and self.action != nil
  4496. return true
  4497. end
  4498.  
  4499. #--------------------------------------------------------------------------
  4500. # ● Blow Effect
  4501. #--------------------------------------------------------------------------
  4502. def blow(d, power = 1)
  4503. return unless can_blow?
  4504. jump(0,0)
  4505. self.battler.invunerable_duration = 30 if self.battler.invunerable_duration <= 0
  4506. if self.is_a?(Game_Event)
  4507. @collision_attack = false
  4508. end
  4509. @knock_back_duration = self.battler.knockback_duration
  4510. refresh_sensor if self.is_a?(Game_Event)
  4511. pre_direction = self.direction
  4512. pre_direction_fix = self.direction_fix
  4513. self.turn_reverse(d)
  4514. self.direction_fix = true
  4515. power.times do
  4516. case d
  4517. when 2; @y += 1 if passable?(@x, @y, d)
  4518. when 4; @x -= 1 if passable?(@x, @y, d)
  4519. when 6; @x += 1 if passable?(@x, @y, d)
  4520. when 8; @y -= 1 if passable?(@x, @y, d)
  4521. end
  4522. end
  4523. self.direction_fix = pre_direction_fix
  4524. self.direction = pre_direction
  4525. end
  4526.  
  4527. #--------------------------------------------------------------------------
  4528. # ● Can Stop Battler Movement
  4529. #--------------------------------------------------------------------------
  4530. def can_stop_battler_movement?
  4531. return false if self.dead?
  4532. return true if self.battler.state_sleep
  4533. return true if self.battler.state_stop
  4534. return false
  4535. end
  4536.  
  4537. #--------------------------------------------------------------------------
  4538. # ● Impact
  4539. #--------------------------------------------------------------------------
  4540. def impact(enable = true)
  4541. return if self.tool_id == 0
  4542. return if self.action == nil
  4543. self.action.impact = enable
  4544. end
  4545.  
  4546. #--------------------------------------------------------------------------
  4547. # ● Update Battler Stop Movement
  4548. #--------------------------------------------------------------------------
  4549. def update_battler_stop_movement
  4550. unless can_stop_battler_movement?
  4551. [url=home.php?mod=space&uid=76426]@stop[/url] = false
  4552. return
  4553. end
  4554. @knock_back_duration = nil
  4555. @stop = true
  4556. @step_anime = false
  4557. reset_battler_temp
  4558. if self.battler.state_sleep
  4559. make_pose("_Hit", 2)
  4560. else
  4561. make_pose("", 2)
  4562. end
  4563. if self.is_a?(Game_Event)
  4564. @collision_attack = false
  4565. end
  4566. end
  4567.  
  4568. #--------------------------------------------------------------------------
  4569. # ● Update Attacking
  4570. #--------------------------------------------------------------------------
  4571. def update_battler_attacking
  4572. return unless can_update_attacking?
  4573. make_pose("_Atk", 2)
  4574. end
  4575.  
  4576. #--------------------------------------------------------------------------
  4577. # ● Can Update Attacking
  4578. #--------------------------------------------------------------------------
  4579. def can_update_attacking?
  4580. return false if self.battler.is_a?(Game_Actor)
  4581. return false if @collision_attack == false
  4582. return true
  4583. end
  4584.  
  4585. #--------------------------------------------------------------------------
  4586. # ● Update Battler Knobacking
  4587. #--------------------------------------------------------------------------
  4588. def update_battler_knockbacking
  4589. return unless self.knockbacking?
  4590. @pattern = 0
  4591. @knock_back_duration -= 1 if can_remove_knockback?
  4592. make_pose("_Hit", 2)
  4593. if self.is_a?(Game_Event)
  4594. @collision_attack = false
  4595. end
  4596. if @knock_back_duration <= 0
  4597. @knock_back_duration = nil
  4598. make_pose("", 0)
  4599. touch_attack(false) if self.is_a?(Game_Event)
  4600. @character_name = @x_pose_original_name
  4601. end
  4602. end
  4603.  
  4604. #--------------------------------------------------------------------------
  4605. # ● Can Remove Knockback
  4606. #--------------------------------------------------------------------------
  4607. def can_remove_knockback?
  4608. return true
  4609. end
  4610.  
  4611. #--------------------------------------------------------------------------
  4612. # ● knockbacking?
  4613. #--------------------------------------------------------------------------
  4614. def knockbacking?
  4615. return false if self.battler == nil
  4616. return false if @stop
  4617. return true if @knock_back_duration != nil
  4618. return false
  4619. end
  4620.  
  4621. #--------------------------------------------------------------------------
  4622. # ● collapsing?
  4623. #--------------------------------------------------------------------------
  4624. def collapsing?
  4625. return self.collapse_duration.to_i > 0
  4626. end
  4627.  
  4628. #--------------------------------------------------------------------------
  4629. # ● Seal Effect
  4630. #--------------------------------------------------------------------------
  4631. def seal_effect
  4632. Sound.play_buzzer
  4633. if XAS_WORD::ENABLE_WORD
  4634. self.battler.damage = XAS_WORD::SEAL
  4635. self.battler.damage_pop = true
  4636. end
  4637. end
  4638.  
  4639. end
  4640.  
  4641. #===============================================================================
  4642. # ■ XAS_DamageStop
  4643. #===============================================================================
  4644. module XAS_DamageStop
  4645.  
  4646. #--------------------------------------------------------------------------
  4647. # ● Acting
  4648. #--------------------------------------------------------------------------
  4649. def acting?
  4650. return (super or self.knockbacking? or self.collapsing? or self.stop)
  4651. end
  4652. end
  4653.  
  4654. #===============================================================================
  4655. # ■ Game_Player
  4656. #===============================================================================
  4657. class Game_Player < Game_Character
  4658. include XAS_DamageStop
  4659. end
  4660.  
  4661. #===============================================================================
  4662. # ■ Game_Event
  4663. #===============================================================================
  4664. class Game_Event < Game_Character
  4665. include XAS_DamageStop
  4666. end
  4667.  
  4668.  
  4669.  
  4670. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  4671. #■ BATTLER - TOUCH EFFECT
  4672. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  4673.  
  4674.  
  4675. #===============================================================================
  4676. # ■ XRXS_BattlerAttachment
  4677. #==============================================================================
  4678. module XRXS_BattlerAttachment
  4679.  
  4680. #--------------------------------------------------------------------------
  4681. # ● Attack Effect
  4682. #--------------------------------------------------------------------------
  4683. def attack_effect(attacker)
  4684. return false unless $game_system.xas_battle
  4685. return if self.battler == nil or attacker == nil
  4686. return unless can_attack_effect?(attacker)
  4687. if target_shield_enabled?(attacker, nil, nil)
  4688. execute_guard_effect(attacker, nil, nil, 30)
  4689. return
  4690. end
  4691. execute_attack_effect(attacker)
  4692. end
  4693.  
  4694. #--------------------------------------------------------------------------
  4695. # ● Can Attack Effect
  4696. #--------------------------------------------------------------------------
  4697. def can_attack_effect?(attacker)
  4698. return false if self.can_update == false
  4699. return false if @knock_back_duration != nil
  4700. return false if attacker.stop
  4701. return false if self.battler.invunerable
  4702. return false if self.battler.invunerable_duration > 0
  4703. return false if self.action != nil and self.action.user_invincible
  4704. return false if seal_attack?(attacker.battler)
  4705. return false if target_state_invunerable?(30)
  4706. return true
  4707. end
  4708.  
  4709. #--------------------------------------------------------------------------
  4710. # ● Attack Target Shield
  4711. #--------------------------------------------------------------------------
  4712. def attack_target_shield?(attacker)
  4713. return false if attacker.battler.ignore_shield
  4714. return false unless self.battler.shield
  4715. return true if face_direction?(attacker)
  4716. return false
  4717. end
  4718.  
  4719. #--------------------------------------------------------------------------
  4720. # ● Seal Attack?
  4721. #--------------------------------------------------------------------------
  4722. def seal_attack?(attacker)
  4723. if attacker.state_seal_attack or attacker.state_mute
  4724. attacker.damage = XAS_WORD::SEAL
  4725. attacker.damage_pop = true
  4726. self.battler.invunerable_duration = 30
  4727. return true
  4728. end
  4729. return false
  4730. end
  4731.  
  4732. #--------------------------------------------------------------------------
  4733. # ● Execute Attack Damage
  4734. #--------------------------------------------------------------------------
  4735. def execute_attack_damage(attacker)
  4736. #if self.battler.agi > (rand(attacker.battler.agi) * 2)
  4737. # self.battler.result.missed = true
  4738. # return
  4739. #end
  4740. damage = ((attacker.battler.atk * 4) - (self.battler.def * 2)).truncate
  4741. damage = 0 if damage < 0
  4742. self.battler.result.hp_damage = damage
  4743. #self.battler.result.critical
  4744. self.battler.hp -= damage.abs
  4745. end
  4746.  
  4747. #--------------------------------------------------------------------------
  4748. # ● Execute Attack Effect
  4749. #--------------------------------------------------------------------------
  4750. def execute_attack_effect(attacker)
  4751. execute_attack_effect_before_damage(attacker)
  4752. execute_attack_damage(attacker)
  4753. if target_missed?(attacker)
  4754. self.battler.invunerable_duration = 30
  4755. return
  4756. end
  4757. execute_damage_pop(attacker)
  4758. execute_attack_effect_after_damage(attacker) if can_check_after_attack_effect?(attacker)
  4759. execute_state_effect(nil, attacker, nil)
  4760. self.battler.invunerable_duration = 20 + XAS_BA::DEFAULT_KNOCK_BACK_DURATION
  4761. if attacker.battler.attack_animation_id != 0
  4762. self.animation_id = attacker.battler.attack_animation_id
  4763. end
  4764. if self.battler.damage.to_i > 0
  4765. self.blow(attacker.direction, 1) if can_blow_effect?
  4766. end
  4767. if self.is_a?(Game_Player)
  4768. self.need_refresh = true
  4769. end
  4770. end
  4771.  
  4772. #--------------------------------------------------------------------------
  4773. # ● Can Check After Attack Effect?
  4774. #--------------------------------------------------------------------------
  4775. def can_check_after_attack_effect?(attacker)
  4776. return false unless self.battler.damage.is_a?(Numeric)
  4777. return true
  4778. end
  4779.  
  4780. #--------------------------------------------------------------------------
  4781. # ● Execute Attack Effect Before Damage
  4782. #--------------------------------------------------------------------------
  4783. def execute_attack_effect_before_damage(attacker)
  4784.  
  4785. end
  4786.  
  4787. #--------------------------------------------------------------------------
  4788. # ● Execute Attack Effect After Damage
  4789. #--------------------------------------------------------------------------
  4790. def execute_attack_effect_after_damage(attacker)
  4791.  
  4792. end
  4793.  
  4794. end
  4795.  
  4796. #===============================================================================
  4797. # ■ Game Player
  4798. #===============================================================================
  4799. class Game_Player < Game_Character
  4800. #--------------------------------------------------------------------------
  4801. # ● Check Event Trigger Touch
  4802. #--------------------------------------------------------------------------
  4803. alias xrxs64c_check_event_trigger_touch check_event_trigger_touch
  4804. def check_event_trigger_touch(x, y)
  4805. xrxs64c_check_event_trigger_touch(x, y)
  4806. if $game_map.interpreter.running?
  4807. return
  4808. end
  4809. for event in $game_map.events.values
  4810. next unless event.collision_attack
  4811. unless [1,2].include?(event.trigger)
  4812. if event.battler != nil and event.x == x and event.y == y
  4813. $game_player.attack_effect(event)
  4814. end
  4815. end
  4816. end
  4817. end
  4818. end
  4819.  
  4820. #===============================================================================
  4821. # ■ Game Event
  4822. #===============================================================================
  4823. class Game_Event < Game_Character
  4824.  
  4825. #--------------------------------------------------------------------------
  4826. # ● Check Event Trigger Touch
  4827. #--------------------------------------------------------------------------
  4828. alias xrxs64c_check_event_trigger_touch check_event_trigger_touch
  4829. def check_event_trigger_touch(x, y)
  4830. xrxs64c_check_event_trigger_touch(x, y)
  4831. if $game_map.interpreter.running?
  4832. return
  4833. end
  4834. return unless self.collision_attack
  4835. if self.battler != nil and x == $game_player.x and y == $game_player.y
  4836. $game_player.attack_effect(self)
  4837. end
  4838. end
  4839. end
  4840.  
  4841.  
  4842.  
  4843. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  4844. #■ BATTLER - MOVE SPEED
  4845. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  4846.  
  4847.  
  4848. #==============================================================================
  4849. # ■ Game_Character
  4850. #==============================================================================
  4851. class Game_Character < Game_CharacterBase
  4852.  
  4853. include XAS_BA
  4854. attr_accessor :base_move_speed
  4855. attr_accessor :dash_move_speed
  4856. attr_accessor :move_speed
  4857.  
  4858. #~ #--------------------------------------------------------------------------
  4859. #~ # ● Initialize
  4860. #~ #--------------------------------------------------------------------------
  4861. #~ alias x_move_speed_initialize initialize
  4862. #~ def initialize
  4863. #~ @base_move_speed = BASE_MOVE_SPEED
  4864. #~ @dash_move_speed = 0
  4865. #~ x_move_speed_initialize
  4866. #~ end
  4867. #~
  4868. #~ #--------------------------------------------------------------------------
  4869. #~ # ● update_battler_move_speed
  4870. #~ #--------------------------------------------------------------------------
  4871. #~ def update_battler_move_speed
  4872. #~ @dash_move_speed = @dash_active ? DASH_MOVE_SPEED : 0
  4873. #~ sp1 = @base_move_speed
  4874. #~ sp2 = @dash_move_speed
  4875. #~ sp3 = self.battler.state_move_speed
  4876. #~ @move_speed = (sp1 + sp2 + sp3)
  4877. #~ end
  4878. #~
  4879. #~ #--------------------------------------------------------------------------
  4880. #~ # ● Update Animation
  4881. #~ #--------------------------------------------------------------------------
  4882. #~ def update_animation
  4883. #~ super
  4884. #~ update_force_move_routine_move
  4885. #~ end
  4886. #~
  4887. #~ #--------------------------------------------------------------------------
  4888. #~ # ● Update Force Move Routine Move
  4889. #~ #--------------------------------------------------------------------------
  4890. #~ def update_force_move_routine_move
  4891. #~ return if @force_action == ""
  4892. #~ return if @move_route == nil
  4893. #~ command = @move_route.list[@move_route_index]
  4894. #~ return if command == nil
  4895. #~ if command.code == ROUTE_PLAY_SE
  4896. #~ params = command.parameters
  4897. #~ params[0].play
  4898. #~ advance_move_route_index
  4899. #~ end
  4900. #~ end
  4901. #~
  4902. #~ #--------------------------------------------------------------------------
  4903. #~ # ● Update Routine Move
  4904. #~ #--------------------------------------------------------------------------
  4905. #~ alias x_update_routine_move update_routine_move
  4906. #~ def update_routine_move
  4907. #~ return if @force_action_times > 0
  4908. #~ x_update_routine_move
  4909. #~ end
  4910. #~
  4911. #~ #--------------------------------------------------------------------------
  4912. #~ # ● Can Cancel Move Type Custom
  4913. #~ #--------------------------------------------------------------------------
  4914. #~ alias x_move_speed_process_move_command process_move_command
  4915. #~ def process_move_command(command)
  4916. #~ return if can_cancel_move_type_custom?(command)
  4917. #~ params = command.parameters
  4918. #~ x_move_speed_process_move_command(command)
  4919. #~ if command.code == ROUTE_CHANGE_SPEED and @battler != nil and
  4920. #~ self.is_a?(Game_Event)
  4921. #~ @base_move_speed = params[0]
  4922. #~ end
  4923. #~ end
  4924. #~
  4925. #~ #--------------------------------------------------------------------------
  4926. #~ # ● Can Cancel Move Type Custom
  4927. #~ #--------------------------------------------------------------------------
  4928. #~ def can_cancel_move_type_custom?(command)
  4929. #~ return true if command == nil
  4930. #~ return true if @force_action_times > 0
  4931. #~ return false
  4932. end
  4933. #~
  4934.  
  4935.  
  4936.  
  4937. #==============================================================================
  4938. # ■ Game_Event
  4939. #==============================================================================
  4940. class Game_Event < Game_Character
  4941.  
  4942. #--------------------------------------------------------------------------
  4943. # ● Initialize
  4944. #--------------------------------------------------------------------------
  4945. alias x_move_speed_event_initialize initialize
  4946. def initialize(map_id, event)
  4947. x_move_speed_event_initialize(map_id, event)
  4948. refresh_move_speed
  4949. end
  4950.  
  4951. #--------------------------------------------------------------------------
  4952. # ● Refresh Move Speed
  4953. #--------------------------------------------------------------------------
  4954. def refresh_move_speed
  4955. return if @page == nil
  4956. @base_move_speed = @page.move_speed
  4957. end
  4958.  
  4959. #--------------------------------------------------------------------------
  4960. # ● Setup Page
  4961. #--------------------------------------------------------------------------
  4962. alias x_move_speed_setup_page setup_page
  4963. def setup_page(new_page)
  4964. x_move_speed_setup_page(new_page)
  4965. refresh_move_speed
  4966. end
  4967.  
  4968. end
  4969.  
  4970.  
  4971. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  4972. #■ BATTLER - STATES
  4973. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  4974.  
  4975.  
  4976. #==============================================================================
  4977. # ■ Game_Battler
  4978. #==============================================================================
  4979. class Game_Battler
  4980.  
  4981. attr_accessor :state_move_speed
  4982. attr_accessor :state_stop
  4983. attr_accessor :state_loop_effect_time
  4984. attr_accessor :state_loop_speed
  4985. attr_accessor :state_duration
  4986. attr_accessor :state_string
  4987. attr_accessor :state_string_time
  4988. attr_accessor :state_stop
  4989. attr_accessor :state_slow
  4990. attr_accessor :state_sleep
  4991. attr_accessor :state_invunerable
  4992. attr_accessor :state_fast
  4993. attr_accessor :state_mute
  4994. attr_accessor :state_seal_attack
  4995. attr_accessor :state_seal_skill
  4996. attr_accessor :state_seal_item
  4997. attr_accessor :state_reflect
  4998.  
  4999. #--------------------------------------------------------------------------
  5000. # ● Initialize
  5001. #--------------------------------------------------------------------------
  5002. alias x_state_initialize initialize
  5003. def initialize
  5004. @state_move_speed = 0
  5005. @state_duration = []
  5006. @state_loop_effect_time = []
  5007. @state_loop_speed = []
  5008. @state_string = ""
  5009. @state_string_time = 0
  5010. @state_stop = false
  5011. @state_sleep = false
  5012. @state_invunerable = false
  5013. @state_slow = false
  5014. @state_fast = false
  5015. @state_mute = false
  5016. @state_seal_attack = false
  5017. @state_seal_skill = false
  5018. @state_seal_item = false
  5019. @state_reflect = false
  5020. x_state_initialize
  5021. end
  5022.  
  5023. #--------------------------------------------------------------------------
  5024. # ● Add State
  5025. #--------------------------------------------------------------------------
  5026. alias x_add_state add_state
  5027. def add_state(state_id)
  5028. unless @states.include?(state_id)
  5029. state = $data_states[state_id]
  5030. xas_add_state(state)
  5031. end
  5032. x_add_state(state_id)
  5033. end
  5034.  
  5035. #--------------------------------------------------------------------------
  5036. # ● Xas Add State
  5037. #--------------------------------------------------------------------------
  5038. def xas_add_state(state)
  5039. @state_duration[state.id] = 60 * $data_states[state.id].min_turns
  5040. @state_loop_effect_time[state.id] = 0
  5041. @state_loop_speed[state.id] = $data_states[state.id].max_turns
  5042. execute_damage_state(state,0)
  5043. end
  5044.  
  5045. #--------------------------------------------------------------------------
  5046. # ● Remove State
  5047. #--------------------------------------------------------------------------
  5048. alias x_remove_state remove_state
  5049. def remove_state(state_id)
  5050. if state?(state_id)
  5051. state = $data_states[state_id]
  5052. xas_remove_state(state)
  5053. end
  5054. x_remove_state(state_id)
  5055. end
  5056.  
  5057. #--------------------------------------------------------------------------
  5058. # ● XAS Remove State
  5059. #--------------------------------------------------------------------------
  5060. def xas_remove_state(state)
  5061. @state_duration.delete(state.id)
  5062. @state_loop_effect_time.delete(state.id)
  5063. @state_loop_speed.delete(state.id)
  5064. execute_damage_state(state,1)
  5065. end
  5066.  
  5067. #--------------------------------------------------------------------------
  5068. # ● Execute_Damage_State
  5069. #--------------------------------------------------------------------------
  5070. def execute_damage_state(state,type)
  5071. return unless XAS_DAMAGE_POP::DAMAGE_STATE_POP
  5072. return unless XAS_WORD::ENABLE_WORD
  5073. return if state == nil or state.id == 1
  5074. case type
  5075. when 0
  5076. damage = "+ " + state.name.to_s
  5077. when 1
  5078. damage = "- " + state.name.to_s
  5079. end
  5080. @state_string = damage
  5081. @state_string_time = 30
  5082. end
  5083.  
  5084. end
  5085.  
  5086. #==============================================================================
  5087. # ■ Game_Character
  5088. #==============================================================================
  5089. class Game_Character < Game_CharacterBase
  5090.  
  5091. #--------------------------------------------------------------------------
  5092. # ● Update Battler States Effect
  5093. #--------------------------------------------------------------------------
  5094. def update_battler_states_effect
  5095. return unless XAS_SYSTEM::STATE_SYSTEM
  5096. update_state_string_pop
  5097. update_pre_state_setup
  5098. return unless can_update_states_effect?
  5099. for i in self.battler.states
  5100. state = $data_states[i.id]
  5101. if state == nil or self.battler.state_duration[state.id] == nil or
  5102. self.battler.state_loop_effect_time[state.id] == nil or
  5103. self.battler.state_loop_speed[state.id] == nil
  5104. self.battler.remove_state(state.id)
  5105. next
  5106. return
  5107. end
  5108. update_state_abs_effects(state)
  5109. update_state_loop(state)
  5110. update_remove_state(state)
  5111. end
  5112.  
  5113. end
  5114.  
  5115. #--------------------------------------------------------------------------
  5116. # ● Update Pre State Setup
  5117. #--------------------------------------------------------------------------
  5118. def update_pre_state_setup
  5119. self.battler.state_stop = false
  5120. self.battler.state_slow = false
  5121. self.battler.state_fast = false
  5122. self.battler.state_mute = false
  5123. self.battler.state_sleep = false
  5124. self.battler.state_invunerable = false
  5125. self.battler.state_seal_attack = false
  5126. self.battler.state_seal_skill = false
  5127. self.battler.state_seal_item = false
  5128. self.battler.state_reflect = false
  5129. self.battler.state_move_speed = 0
  5130. end
  5131.  
  5132. #--------------------------------------------------------------------------
  5133. # ● Update Pre State Setup
  5134. #--------------------------------------------------------------------------
  5135. def update_state_abs_effects(state)
  5136. if state.note =~ /<Stop>/
  5137. self.battler.state_stop = true
  5138. end
  5139. if state.note =~ /<Slow>/
  5140. self.battler.state_slow = true
  5141. self.battler.state_move_speed = -1.5
  5142. end
  5143. if state.note =~ /<Fast>/
  5144. self.battler.state_fast = true
  5145. self.battler.state_move_speed = 1
  5146. end
  5147. if self.battler.state_fast and
  5148. self.battler.state_slow
  5149. self.battler.state_move_speed = 0
  5150. end
  5151. if state.note =~ /<Mute>/
  5152. self.battler.state_mute = true
  5153. end
  5154. if state.note =~ /<Sleep>/
  5155. self.battler.state_sleep = true
  5156. end
  5157. if state.note =~ /<Invincible>/
  5158. self.battler.state_invunerable = true
  5159. end
  5160. if state.note =~ /<Seal Attack>/
  5161. self.battler.state_seal_attack = true
  5162. end
  5163. if state.note =~ /<Seal Skill>/
  5164. self.battler.state_seal_skill = true
  5165. end
  5166. if state.note =~ /<Seal Item>/
  5167. self.battler.state_seal_item = true
  5168. end
  5169. if state.note =~ /<Reflect>/
  5170. self.battler.state_reflect = true
  5171. end
  5172. end
  5173.  
  5174. #--------------------------------------------------------------------------
  5175. # ● Update State Loop
  5176. #--------------------------------------------------------------------------
  5177. def update_state_loop(state)
  5178. self.battler.state_loop_effect_time[state.id] += 1
  5179. if self.battler.state_loop_effect_time[state.id] > self.battler.state_loop_speed[state.id]
  5180. self.battler.state_loop_effect_time[state.id] = 0
  5181. if state.note =~ /<Animation ID = (\d+)>/
  5182. state_anime = $1.to_i
  5183. if state_anime != nil
  5184. self.animation_id = state_anime
  5185. end
  5186. end
  5187. execute_states_effects(state)
  5188. end
  5189. end
  5190.  
  5191. #--------------------------------------------------------------------------
  5192. # ● Execute States Effect
  5193. #--------------------------------------------------------------------------
  5194. def execute_states_effects(state)
  5195. if state.note =~ /<Slip Damage = (\S+)>/
  5196. execute_state_slip_damage($1.to_i)
  5197. end
  5198. end
  5199.  
  5200. #--------------------------------------------------------------------------
  5201. # ● Execute States Slip Damage
  5202. #--------------------------------------------------------------------------
  5203. def execute_state_slip_damage(damage)
  5204. damage = 1 if damage == nil
  5205. #damage_slip = self.battler.mhp * damage / 100
  5206. damage_slip = damage
  5207. self.battler.hp -= damage_slip
  5208. self.battler.damage = damage_slip
  5209. self.battler.damage_pop = true
  5210. end
  5211.  
  5212. #--------------------------------------------------------------------------
  5213. # ● Update Remove State
  5214. #--------------------------------------------------------------------------
  5215. def update_remove_state(state)
  5216. self.battler.state_duration[state.id] -= 1
  5217. if self.battler.state_duration[state.id] <= 0
  5218. self.battler.remove_state(state.id)
  5219. end
  5220. end
  5221.  
  5222. #--------------------------------------------------------------------------
  5223. # ● Can Update States Effect
  5224. #--------------------------------------------------------------------------
  5225. def can_update_states_effect?
  5226. return false if self.dead?
  5227. return false if self.battler.states == nil
  5228. return false if self.battler.states.size == 0
  5229. return false if self.battler.state_duration == []
  5230. return true
  5231. end
  5232.  
  5233. #--------------------------------------------------------------------------
  5234. # ● Update State String Pop
  5235. #--------------------------------------------------------------------------
  5236. def update_state_string_pop
  5237. return false if self.battler.state_string_time == 0
  5238. self.battler.state_string_time -= 1
  5239. if self.battler.state_string_time == 0
  5240. self.battler.damage = self.battler.state_string
  5241. self.battler.damage_pop = true
  5242. self.battler.state_string = ""
  5243. end
  5244. end
  5245. end
  5246.  
  5247. #==============================================================================
  5248. # ■ Game_Party
  5249. #==============================================================================
  5250. class Game_Party < Game_Unit
  5251.  
  5252. #--------------------------------------------------------------------------
  5253. # ● On Player Walk
  5254. #--------------------------------------------------------------------------
  5255. alias x_state_on_player_walk on_player_walk
  5256. def on_player_walk
  5257. return if XAS_SYSTEM::STATE_SYSTEM
  5258. x_state_on_player_walk
  5259. end
  5260.  
  5261. end
  5262.  
  5263.  
  5264.  
  5265. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  5266. #■ BATTLER - EVENT COMMANDS
  5267. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  5268.  
  5269.  
  5270. #===============================================================================
  5271. # ■ Game Event
  5272. #===============================================================================
  5273. class Game_Event < Game_Character
  5274.  
  5275. #--------------------------------------------------------------------------
  5276. # ● Shoot Chance
  5277. #--------------------------------------------------------------------------
  5278. def shoot_chance(action_id,perc)
  5279. return if self.battler == nil
  5280. if perc >= rand(100)
  5281. shoot(action_id)
  5282. end
  5283. end
  5284.  
  5285. #--------------------------------------------------------------------------
  5286. # ● Guard
  5287. #--------------------------------------------------------------------------
  5288. def guard(enable)
  5289. return if self.battler == nil
  5290. self.battler.guard = enable
  5291. end
  5292.  
  5293. #--------------------------------------------------------------------------
  5294. # ● Touch Attack
  5295. #--------------------------------------------------------------------------
  5296. def touch_attack(enable)
  5297. return if self.battler == nil
  5298. return if seal_attack?(self.battler)
  5299. @collision_attack = enable
  5300. @pattern = 0
  5301. @pattern_count = 0
  5302. end
  5303.  
  5304. #--------------------------------------------------------------------------
  5305. # ● Counter
  5306. #--------------------------------------------------------------------------
  5307. def counter(enable)
  5308. return if self.battler == nil
  5309. self.battler.counter_action[2] = enable
  5310. end
  5311.  
  5312. #--------------------------------------------------------------------------
  5313. # ● Rand Shoot
  5314. #--------------------------------------------------------------------------
  5315. def rand_shoot(random_id = [])
  5316. return if self.battler == nil
  5317. return if random_id == []
  5318. action_id = random_id[rand(random_id.size)]
  5319. self.shoot(action_id)
  5320. end
  5321.  
  5322. end
  5323.  
  5324.  
  5325.  
  5326. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  5327. #■ BATTLER - DEFEAT PROCESS
  5328. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  5329.  
  5330. #===============================================================================
  5331. # ■ Scene Base
  5332. #===============================================================================
  5333. class Scene_Base
  5334.  
  5335. #--------------------------------------------------------------------------
  5336. # ● Check Gameover
  5337. #--------------------------------------------------------------------------
  5338. def check_gameover
  5339. return unless $game_party.in_battle
  5340. SceneManager.goto(Scene_Gameover) if $game_party.all_dead?
  5341. end
  5342. end
  5343.  
  5344. #===============================================================================
  5345. # ■ Game Character
  5346. #===============================================================================
  5347. class Game_Character < Game_CharacterBase
  5348. attr_accessor :collapse_duration
  5349. attr_accessor :battler_visible
  5350. attr_writer :opacity
  5351.  
  5352. #--------------------------------------------------------------------------
  5353. # ● Initialize
  5354. #--------------------------------------------------------------------------
  5355. alias x_collapse_initialize initialize
  5356. def initialize
  5357. @collapse_duration = 0
  5358. x_collapse_initialize
  5359. end
  5360.  
  5361. end
  5362.  
  5363. #===============================================================================
  5364. # ■ XAS_BA_BATTLEEVENT_NONPREEMPT
  5365. #==============================================================================
  5366. module XAS_BA_BATTLEEVENT_NONPREEMPT
  5367.  
  5368. #--------------------------------------------------------------------------
  5369. # ● Update
  5370. #--------------------------------------------------------------------------
  5371. def update
  5372. return if self.battler != nil and $game_map.interpreter.running?
  5373. super
  5374. end
  5375. end
  5376.  
  5377. #===============================================================================
  5378. # ■ Game Event
  5379. #==============================================================================
  5380. class Game_Event < Game_Character
  5381. include XAS_BA_BATTLEEVENT_NONPREEMPT
  5382. end
  5383.  
  5384. #===============================================================================
  5385. # ■ Game Character
  5386. #===============================================================================
  5387. class Game_Character < Game_CharacterBase
  5388.  
  5389. #--------------------------------------------------------------------------
  5390. # ● Update Battler Defeat Process
  5391. #--------------------------------------------------------------------------
  5392. def update_battler_defeat_process
  5393. execute_enemy_defeated_process if can_check_enemy_defeated?
  5394. execute_actor_defeated_process if can_check_actor_defeated?
  5395. end
  5396.  
  5397. #--------------------------------------------------------------------------
  5398. # ● Can Check Enemy Defeated?
  5399. #--------------------------------------------------------------------------
  5400. def can_check_enemy_defeated?
  5401. return false if self.battler.is_a?(Game_Actor)
  5402. return false if self.battler.defeated
  5403. return true
  5404. end
  5405.  
  5406. #--------------------------------------------------------------------------
  5407. # ● Can Check Actor Defeated?
  5408. #--------------------------------------------------------------------------
  5409. def can_check_actor_defeated?
  5410. return false if self.battler.is_a?(Game_Enemy)
  5411. return false if self.battler.defeated
  5412. return false if $game_party.members[0].hp > 0
  5413. return false if @collapse_duration > 0
  5414. return true
  5415. end
  5416.  
  5417. #--------------------------------------------------------------------------
  5418. # ● Execute Actor Defeated Process
  5419. #--------------------------------------------------------------------------
  5420. def execute_actor_defeated_process
  5421. erase_actor_tools_on_map
  5422. if $game_party.all_dead? and not self.battler.defeated
  5423. self.battler.defeated = true
  5424. self.collapse_duration = 120
  5425. self.knock_back_duration = 161
  5426. reset_battler_temp
  5427. else
  5428. $game_temp.change_leader_wait_time = 0
  5429. $game_player.change_leader
  5430. end
  5431. end
  5432.  
  5433. #--------------------------------------------------------------------------
  5434. # ● Erase Tools on Map
  5435. #--------------------------------------------------------------------------
  5436. def erase_actor_tools_on_map
  5437. for event in $game_map.events.values
  5438. if event.tool_id > 0 and event.action.user.is_a?(Game_Player)
  5439. event.erase
  5440. end
  5441. end
  5442. end
  5443.  
  5444. #--------------------------------------------------------------------------
  5445. # ● Execute Enemy Defeaed Process
  5446. #--------------------------------------------------------------------------
  5447. def execute_enemy_defeated_process
  5448. self.battler.defeated = true
  5449. self.through = true
  5450. @knock_back_duration = 121
  5451. enemy = $data_enemies[self.battler.enemy_id]
  5452. @collapse_duration = 120
  5453. execute_gain_exp_gold(enemy)
  5454. execute_active_switch(enemy)
  5455. execute_defeated_animation(enemy)
  5456. execute_defeated_sound_effect(enemy)
  5457. execute_final_shoot(enemy)
  5458. end
  5459.  
  5460. #--------------------------------------------------------------------------
  5461. # ● Execute Defeated Sound Effect
  5462. #--------------------------------------------------------------------------
  5463. def execute_defeated_sound_effect(enemy)
  5464. return if self.battler.no_damage_pop
  5465. Sound.play_enemy_collapse
  5466. end
  5467.  
  5468. #--------------------------------------------------------------------------
  5469. # ● Execute Final Shoot
  5470. #--------------------------------------------------------------------------
  5471. def execute_final_shoot(enemy)
  5472. enemy.note =~ /<Final Action ID = (\d+)>/
  5473. action_id = $1.to_i
  5474. return if action_id == nil
  5475. self.shoot(action_id)
  5476. end
  5477.  
  5478. #--------------------------------------------------------------------------
  5479. # ● Execute Gain Exp Gold
  5480. #--------------------------------------------------------------------------
  5481. def execute_gain_exp_gold(enemy)
  5482. exp = self.battler.exp
  5483. case XAS_BA::EXP_TYPE
  5484. when 0
  5485. actor = $game_party.members[0]
  5486. actor.gain_exp(exp)
  5487. when 1
  5488. for i in 0...$game_party.members.size
  5489. actor = $game_party.members[i]
  5490. actor.gain_exp(exp)
  5491. end
  5492. when 2
  5493. exp = exp / $game_party.members.size
  5494. for i in 0...$game_party.members.size
  5495. actor = $game_party.members[i]
  5496. actor.gain_exp(exp)
  5497. end
  5498. end
  5499. $game_party.gain_gold(self.battler.gold)
  5500. end
  5501.  
  5502. #--------------------------------------------------------------------------
  5503. # ● Execute_Active Switch
  5504. #--------------------------------------------------------------------------
  5505. def execute_active_switch(enemy)
  5506. enemy.note =~ /<Active Switch = (\d+)>/
  5507. switch_id = $1.to_i
  5508. if switch_id != nil
  5509. $game_switches[switch_id] = true
  5510. $game_map.need_refresh = true
  5511. end
  5512. end
  5513.  
  5514. #--------------------------------------------------------------------------
  5515. # ● Execute Defeated Animation
  5516. #--------------------------------------------------------------------------
  5517. def execute_defeated_animation(enemy)
  5518. enemy.note =~ /<Defeated Animation = (\d+)>/
  5519. anime_id = $1.to_i
  5520. if anime_id != nil
  5521. self.animation_id = anime_id
  5522. end
  5523. end
  5524.  
  5525. end
  5526.  
  5527. #===============================================================================
  5528. # ■ Game Player
  5529. #===============================================================================
  5530. class Game_Player < Game_Character
  5531.  
  5532. #--------------------------------------------------------------------------
  5533. # ● Reset Old Level
  5534. #--------------------------------------------------------------------------
  5535. def reset_old_level(trans = false)
  5536. for actor in $game_party.members
  5537. actor.old_level = actor.level
  5538. end
  5539. end
  5540.  
  5541. #--------------------------------------------------------------------------
  5542. # ● Change Leader
  5543. #--------------------------------------------------------------------------
  5544. def change_leader
  5545. return if $game_party.members.size <= 1
  5546. reset_battler_temp
  5547. current_leader_id = $game_party.members[0].id
  5548. for i in 1..$game_party.members.size
  5549. pre_leader = $game_party.members[0].id
  5550. $game_party.remove_actor(pre_leader)
  5551. $game_party.add_actor(pre_leader)
  5552. if $game_party.members[0].hp > 0
  5553. execute_change_leader_effect unless current_leader_id == $game_party.members[0].id
  5554. break
  5555. end
  5556. end
  5557. end
  5558.  
  5559. #--------------------------------------------------------------------------
  5560. # ● Exeute Change leader Effect
  5561. #--------------------------------------------------------------------------
  5562. def execute_change_leader_effect
  5563. actor = $game_party.members[0]
  5564. actor.invunerable_duration = XAS_BA::CHANGE_LEADER_WAIT_TIME
  5565. actor.damage = nil
  5566. actor.damage_pop = false
  5567. actor.critical = false
  5568. @knock_back_duration = nil
  5569. if self.action != nil
  5570. self.action.duration = 1
  5571. end
  5572. @force_action_times = 0
  5573. @force_action_type = ""
  5574. reset_old_level(true)
  5575. @x_pose_original_name = @character_name
  5576. update_battler_pose
  5577. $game_map.need_refresh = true
  5578. self.animation_id = XAS_ANIMATION::CHANGE_LEADER_ANIMATION_ID
  5579. $game_temp.change_leader_wait_time = XAS_BA::CHANGE_LEADER_WAIT_TIME
  5580. end
  5581.  
  5582. #--------------------------------------------------------------------------
  5583. # ● Check Actor Level
  5584. #--------------------------------------------------------------------------
  5585. def check_actor_level
  5586. return if $game_party.in_battle
  5587. return if self.battler == nil
  5588. return if self.battler.old_level == self.battler.level
  5589. reset_old_level(false)
  5590. if self.battler.level > 1
  5591. Audio.se_play("Audio/SE/" + XAS_SOUND::LEVEL_UP , 100, 100)
  5592. if XAS_WORD::ENABLE_WORD
  5593. $game_player.battler.damage = XAS_WORD::LEVEL_UP
  5594. $game_player.battler.damage_pop = true
  5595. end
  5596. end
  5597. $game_player.need_refresh = true
  5598. end
  5599. end
  5600.  
  5601. #===============================================================================
  5602. # ■ Game Party
  5603. #===============================================================================
  5604. class Game_Party < Game_Unit
  5605.  
  5606. #--------------------------------------------------------------------------
  5607. # ● Setup Starting Members
  5608. #--------------------------------------------------------------------------
  5609. alias x_old_level_setup_starting_members setup_starting_members
  5610. def setup_starting_members
  5611. x_old_level_setup_starting_members
  5612. for actor in $game_party.members
  5613. actor.old_level = actor.level
  5614. end
  5615. end
  5616.  
  5617. end
  5618.  
  5619. #===============================================================================
  5620. # ■ Sprite Character
  5621. #==============================================================================
  5622. class Sprite_Character < Sprite_Base
  5623.  
  5624. #--------------------------------------------------------------------------
  5625. # ● Update Collapse Effects
  5626. #--------------------------------------------------------------------------
  5627. def update_collaspse_effects
  5628. update_collapse_duration
  5629. return unless can_collapse_effects?
  5630. update_collpase_zoom_effects
  5631. update_exp_gold_pop
  5632. end
  5633.  
  5634. #--------------------------------------------------------------------------
  5635. # ● Can Collapse Effects
  5636. #--------------------------------------------------------------------------
  5637. def can_collapse_effects?
  5638. return false if @character.battler.is_a?(Game_Actor)
  5639. return false unless @character.dead?
  5640. return false if @character.erased
  5641. return true
  5642. end
  5643.  
  5644. #--------------------------------------------------------------------------
  5645. # ● Update Exp Gold Pop
  5646. #--------------------------------------------------------------------------
  5647. def update_exp_gold_pop
  5648. return unless XAS_DAMAGE_POP::DAMAGE_EXP_GOLD_POP
  5649. exp_pop = @character.battler.exp
  5650. gold_pop =@character.battler.gold
  5651. case @character.collapse_duration
  5652. when 110
  5653. enemy = $data_enemies[@character.battler.enemy_id]
  5654. @character.make_treasure(enemy)
  5655. when 80
  5656. if exp_pop != 0
  5657. word = XAS_WORD::EXP
  5658. @character.battler.damage = word + " " + exp_pop.to_s
  5659. @character.battler.damage_pop = true
  5660. @character.battler.damage_type = "Exp"
  5661. end
  5662. when 40
  5663. if gold_pop != 0
  5664. word = $data_system.currency_unit
  5665. @character.battler.damage = word + " " + gold_pop.to_s
  5666. @character.battler.damage_pop = true
  5667. @character.battler.damage_type = "Gold"
  5668. end
  5669. end
  5670. end
  5671.  
  5672. #~ #--------------------------------------------------------------------------
  5673. #~ # ● Update Collapse Duration
  5674. #~ #--------------------------------------------------------------------------
  5675. def update_collapse_duration
  5676. @character.collapse_duration -= 1
  5677. @character.opacity -= 2
  5678. if @character.collapse_duration <= 0
  5679. if @character.battler.is_a?(Game_Actor)
  5680. SceneManager.goto(Scene_Gameover)
  5681. return
  5682. end
  5683. self.visible = false
  5684. @character.opacity = 0
  5685. @character.erase
  5686. end
  5687. end
  5688.  
  5689. #--------------------------------------------------------------------------
  5690. # ● Update Collapse Zoom Effects
  5691. #--------------------------------------------------------------------------
  5692. def update_collpase_zoom_effects
  5693. case @character.battler.death_zoom_effect
  5694. when 1
  5695. @character.zoom_y += 0.05
  5696. @character.zoom_x -= 0.01
  5697. when 2
  5698. @character.zoom_y -= 0.01
  5699. @character.zoom_x += 0.03
  5700. when 3
  5701. @character.zoom_y += 0.03
  5702. @character.zoom_x += 0.03
  5703. when 4
  5704. @character.zoom_y -= 0.005
  5705. @character.zoom_x -= 0.005
  5706. when 5
  5707. case @character.collapse_duration
  5708. when 60..120
  5709. @character.zoom_y -= 0.01
  5710. @character.zoom_x += 0.06
  5711. when 0..59
  5712. @character.zoom_y += 0.2
  5713. @character.zoom_x -= 0.1
  5714. end
  5715. end
  5716. end
  5717.  
  5718. end
  5719.  
  5720.  
  5721.  
  5722. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  5723. #■ BATTLER - TREASURE
  5724. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  5725.  
  5726.  
  5727. #===============================================================================
  5728. # ■ XAS_BA_Item_Drop
  5729. #==============================================================================
  5730. module XAS_BA_ItemDrop
  5731.  
  5732. #--------------------------------------------------------------------------
  5733. # ● Defeat Process
  5734. #--------------------------------------------------------------------------
  5735. def make_treasure(enemy)
  5736. treasure = nil
  5737. return unless $game_player.passable?(self.x,self.y,0)
  5738. for di in enemy.drop_items
  5739. next if di.kind == 0
  5740. next if rand(di.denominator) != 0
  5741. if di.kind == 1
  5742. treasure = $data_items[di.data_id]
  5743. tr_id = treasure.id
  5744. elsif di.kind == 2
  5745. treasure = $data_weapons[di.data_id]
  5746. tr_id = treasure.id
  5747. elsif di.kind == 3
  5748. treasure = $data_armors[di.data_id]
  5749. tr_id = treasure.id
  5750. end
  5751. break if treasure != nil
  5752. end
  5753. if treasure != nil
  5754. command = RPG::MoveCommand.new
  5755. command.code = 14
  5756. command.parameters = [0,0]
  5757. route = RPG::MoveRoute.new
  5758. route.repeat = false
  5759. route.list = [command, RPG::MoveCommand.new]
  5760. page = RPG::Event::Page.new
  5761. page.move_type = 3
  5762. page.move_route = route
  5763. page.move_frequency = 6
  5764. page.priority_type = 1
  5765. page.trigger = 1
  5766. page.through = true
  5767. event = RPG::Event.new(self.x, self.y)
  5768. event.pages = [page]
  5769. event = RPG::Event.new(self.x, self.y)
  5770. token = Token_Event.new($game_map.map_id, event)
  5771. token.icon_name = treasure.icon_index
  5772. token.treasure = [di.kind,tr_id]
  5773. token.treasure_time = 120 + XAS_BA::TREASURE_ERASE_TIME * 60
  5774. token.jump_high(0,0,20)
  5775. token.force_update = true
  5776. token.move_speed = 6
  5777. $game_map.add_token(token)
  5778. end
  5779. end
  5780. end
  5781.  
  5782. #===============================================================================
  5783. # ■ Game Event
  5784. #===============================================================================
  5785. class Game_Event < Game_Character
  5786. include XAS_BA_ItemDrop
  5787.  
  5788. #--------------------------------------------------------------------------
  5789. # ● Update Treasure Duration
  5790. #--------------------------------------------------------------------------
  5791. def update_treasure_duration
  5792. return if @treasure_time == 0
  5793. @treasure_time -= 1
  5794. self.erase if @treasure_time == 0
  5795. end
  5796.  
  5797. end
  5798.  
  5799. #===============================================================================
  5800. # ■ Game Character
  5801. #==============================================================================
  5802. class Game_Character < Game_CharacterBase
  5803. attr_accessor :icon_name
  5804. attr_accessor :treasure
  5805. end
  5806.  
  5807. #===============================================================================
  5808. # ■ Game Character
  5809. #==============================================================================
  5810. class Sprite_Character < Sprite_Base
  5811.  
  5812. #--------------------------------------------------------------------------
  5813. # ● Update
  5814. #--------------------------------------------------------------------------
  5815. alias xrxs_charactericon_update update
  5816. def update
  5817. xrxs_charactericon_update
  5818. if @character.icon_name != nil
  5819. self.bitmap = Cache.system("Iconset")
  5820. self.src_rect.set(@character.icon_name % 16 * 24, @character.icon_name / 16 * 24, 24, 24)
  5821. self.ox = 12
  5822. self.oy = 24
  5823. end
  5824. end
  5825. end
  5826.  
  5827. #===============================================================================
  5828. # ■ Game Player
  5829. #==============================================================================
  5830. class Game_Player < Game_Character
  5831.  
  5832. #--------------------------------------------------------------------------
  5833. # ● Check Event Trigger Here
  5834. #--------------------------------------------------------------------------
  5835. alias treasure_check_event_trigger_here check_event_trigger_here
  5836. def check_event_trigger_here(triggers)
  5837. return false if $game_map.interpreter.running?
  5838. check_treasure_here
  5839. treasure_check_event_trigger_here(triggers)
  5840. end
  5841.  
  5842. #--------------------------------------------------------------------------
  5843. # ● check_treasure_here
  5844. #--------------------------------------------------------------------------
  5845. def check_treasure_here
  5846. for event in $game_map.events_xy(@x, @y)
  5847. if event.treasure != nil
  5848. name_pop = true
  5849. case event.treasure[0]
  5850. when 1
  5851. item = $data_items[event.treasure[1]]
  5852. if can_execute_field_item_effect?(item)
  5853. name_pop = false
  5854. else
  5855. $game_party.gain_item(item, 1)
  5856. end
  5857. $game_map.need_refresh = true
  5858. when 2
  5859. item = $data_weapons[event.treasure[1]]
  5860. $game_party.gain_item($data_weapons[event.treasure[1]], 1,false)
  5861. when 3
  5862. item = $data_armors[event.treasure[1]]
  5863. $game_party.gain_item(item, 1,false)
  5864. end
  5865. Audio.se_play("Audio/SE/" + XAS_SOUND::ITEM_DROP , 100, 100)
  5866. event.erase
  5867. if item != nil
  5868. if item.note =~ /<Drop Animation = (\d+)>/
  5869. self.animation_id = $1.to_i
  5870. end
  5871. if XAS_DAMAGE_POP::DAMAGE_ITEM_POP and name_pop
  5872. self.battler.damage = item.name.to_s
  5873. self.battler.damage_pop = true
  5874. self.battler.damage_type = "Item"
  5875. end
  5876. end
  5877. end
  5878. end
  5879. end
  5880.  
  5881. #--------------------------------------------------------------------------
  5882. # ● Can Execute Field Item Effect
  5883. #--------------------------------------------------------------------------
  5884. def can_execute_field_item_effect?(item)
  5885. if item.note =~ /<Drop HP Damage = (\S+)>/
  5886. damage = $1.to_i
  5887. damage2 = damage * self.battler.mhp / 100
  5888. self.battler.damage = damage2
  5889. self.battler.damage_pop = true
  5890. self.battler.hp -= damage2
  5891. return true
  5892. end
  5893. if item.note =~ /<Drop MP Damage = (\S+)>/
  5894. damage = $1.to_i
  5895. damage2 = damage * self.battler.mmp / 100
  5896. self.battler.mp -= damage2
  5897. self.battler.damage_type = "Mp"
  5898. self.battler.damage = damage2
  5899. self.battler.damage_pop = true
  5900. return true
  5901. end
  5902. if item.note =~ /<Drop Gold = (\d+)>/
  5903. gold = $1.to_i
  5904. damage = $data_system.terms.gold + " " + gold.to_s
  5905. self.battler.damage = damage
  5906. self.battler.damage_pop = true
  5907. $game_party.gain_gold(gold)
  5908. return true
  5909. end
  5910. return false
  5911. end
  5912. end
  5913.  
  5914.  
  5915.  
  5916. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  5917. #■ SPRITE - POSE (Character Name)
  5918. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  5919.  
  5920.  
  5921. #===============================================================================
  5922. # ■ Game_Character
  5923. #===============================================================================
  5924. class Game_Character < Game_CharacterBase
  5925.  
  5926. attr_accessor :x_pose_duration
  5927. attr_accessor :x_pose_name
  5928. attr_accessor :x_pose_original_name
  5929. attr_accessor :character_name
  5930.  
  5931. #-----------------------------------------------------------------------------
  5932. # ● Initialize
  5933. #-----------------------------------------------------------------------------
  5934. alias x_pose_initialize initialize
  5935. def initialize
  5936. x_pose_initialize
  5937. @x_pose_duration = 0
  5938. @x_pose_name = ""
  5939. @x_pose_original_name = @character_name
  5940. end
  5941.  
  5942. #-----------------------------------------------------------------------------
  5943. # ● Update
  5944. #-----------------------------------------------------------------------------
  5945. def make_pose(sufix, pose_duration)
  5946. return if @x_pose_original_name == ""
  5947. @x_pose_name = sufix
  5948. @x_pose_duration = pose_duration
  5949. end
  5950.  
  5951. #-----------------------------------------------------------------------------
  5952. # ● Update Pose
  5953. #-----------------------------------------------------------------------------
  5954. def update_battler_pose
  5955. return false unless XAS_SYSTEM::CHARACTER_POSE_NAME
  5956. if @x_pose_duration == 0
  5957. @x_pose_original_name = @character_name
  5958. return
  5959. else
  5960. @x_pose_duration -= 1
  5961. @character_name = @x_pose_original_name + @x_pose_name
  5962. if @x_pose_duration == 0
  5963. @character_name = @x_pose_original_name
  5964. @x_pose_name = ""
  5965. end
  5966. end
  5967. unless jumping?
  5968. @jump_count = 0
  5969. @jump_peak = 0
  5970. end
  5971. end
  5972.  
  5973. #-----------------------------------------------------------------------------
  5974. # ● Set Graphic
  5975. #-----------------------------------------------------------------------------
  5976. alias x_pose_set_graphic set_graphic
  5977. def set_graphic(character_name, character_index)
  5978. x_pose_set_graphic(character_name, character_index)
  5979. @x_pose_original_name = @character_name
  5980. @x_pose_duration = 0
  5981. @x_pose_name = ""
  5982. end
  5983.  
  5984. end
  5985.  
  5986.  
  5987. #===============================================================================
  5988. # ■ Game_Interpreter
  5989. #===============================================================================
  5990. class Game_Interpreter
  5991.  
  5992. #-----------------------------------------------------------------------------
  5993. # ● Command_322
  5994. #-----------------------------------------------------------------------------
  5995. alias x_pose_command_322 command_322
  5996. def command_322
  5997. x_pose_command_322
  5998. actor = $game_actors[@params[0]]
  5999. if actor != nil
  6000. $game_player.x_pose_duration = 0
  6001. $game_player.x_pose_original_name = @params[1]
  6002. end
  6003. end
  6004.  
  6005. end
  6006.  
  6007. #===============================================================================
  6008. # ■ RPG_FileTest
  6009. #===============================================================================
  6010. module RPG_FileTest
  6011.  
  6012. #--------------------------------------------------------------------------
  6013. # ● RPG_FileTest.character_exist?
  6014. #--------------------------------------------------------------------------
  6015. def RPG_FileTest.character_exist?(filename)
  6016. return Cache.character(filename) rescue return false
  6017. end
  6018.  
  6019. #--------------------------------------------------------------------------
  6020. # ● RPG_FileTest.system_exist?
  6021. #--------------------------------------------------------------------------
  6022. def RPG_FileTest.system_exist?(filename)
  6023. return Cache.system(filename) rescue return false
  6024. end
  6025.  
  6026. end
  6027.  
  6028. #===============================================================================
  6029. # ■ Sprite_Character
  6030. #===============================================================================
  6031. class Sprite_Character < Sprite_Base
  6032.  
  6033. #--------------------------------------------------------------------------
  6034. # ● X Pose Update
  6035. #--------------------------------------------------------------------------
  6036. alias x_pose_update_bitmap update_bitmap
  6037. def update_bitmap
  6038. check_file_exist
  6039. x_pose_update_bitmap
  6040. end
  6041.  
  6042. #--------------------------------------------------------------------------
  6043. # ● Check File Exist
  6044. #--------------------------------------------------------------------------
  6045. def check_file_exist
  6046. return if @character_name == @character.character_name
  6047. unless RPG_FileTest.character_exist?(@character.character_name)
  6048. @character.character_name = @character.x_pose_original_name
  6049. @character.x_pose_duration = 0
  6050. @character.x_pose_name = ""
  6051. end
  6052. end
  6053.  
  6054. end
  6055.  
  6056.  
  6057.  
  6058.  
  6059.  
  6060. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  6061. #■ SPRITE - DAMAGE SPRITE
  6062. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  6063.  
  6064.  
  6065. #===============================================================================
  6066. # ■ XRXS_DAMAGE_OFFSET
  6067. #===============================================================================
  6068. module XRXS_DAMAGE_OFFSET
  6069.  
  6070. #--------------------------------------------------------------------------
  6071. # ● Update
  6072. #--------------------------------------------------------------------------
  6073. def update
  6074. super
  6075. @damage_sprites = [] if @damage_sprites.nil?
  6076. for damage_sprite in @damage_sprites
  6077. damage_sprite.x = self.x
  6078. damage_sprite.y = self.y
  6079. end
  6080. end
  6081. end
  6082.  
  6083. #===============================================================================
  6084. # ■ Sprite_Character
  6085. #===============================================================================
  6086. class Sprite_Character < Sprite_Base
  6087. include XRXS_DAMAGE_OFFSET
  6088. end
  6089.  
  6090.  
  6091. #==============================================================================
  6092. # ■ Sprite Base
  6093. #==============================================================================
  6094. class Sprite_Base < Sprite
  6095. include XAS_DAMAGE_POP
  6096. #--------------------------------------------------------------------------
  6097. # ● Initialize
  6098. #--------------------------------------------------------------------------
  6099. alias x_damage_pop_initialize initialize
  6100. def initialize(viewport = nil)
  6101. @_damage_duration = 0
  6102. x_damage_pop_initialize(viewport)
  6103. end
  6104.  
  6105. #--------------------------------------------------------------------------
  6106. # ● Damage
  6107. #--------------------------------------------------------------------------
  6108. def damage(value, type = "")
  6109. dispose_damage
  6110. @damage_ox = 0
  6111. @damage_type = type
  6112. # NUMBER PICTURE
  6113. if value.is_a?(Numeric)
  6114. bitmap_number_image = Cache.system("XAS_Damage_Number")
  6115. bitmap_im_cw = bitmap_number_image.width / 10
  6116. bitmap_im_ch = bitmap_number_image.height / 5
  6117. bitmap = Bitmap.new(bitmap_number_image.width,(bitmap_im_ch * 2) + 5)
  6118. bitmap_number_text = value.to_s.split(//)
  6119. center_x = (((2 + bitmap_number_text.size) * bitmap_im_cw) / 2)
  6120. # Damage Color
  6121. if value >= 0
  6122. if @damage_type == "Critical"
  6123. h = bitmap_im_ch * 2
  6124. h2 = bitmap_im_ch * 4
  6125. $game_map.screen.start_shake(5, 1, 5)
  6126. elsif @damage_type == "Mp"
  6127. h = bitmap_im_ch * 0
  6128. h2 = bitmap_im_ch * 3
  6129. else
  6130. h = 0
  6131. end
  6132. f = 0
  6133. else # Recover Color
  6134. h = bitmap_im_ch
  6135. h2 = bitmap_im_ch * 3 if @damage_type == "Mp"
  6136. f = 1
  6137. end
  6138. for r in f..bitmap_number_text.size - 1
  6139. bitmap_number_abs = bitmap_number_text[r].to_i
  6140. bitmap_src_rect = Rect.new(bitmap_im_cw * bitmap_number_abs, h, bitmap_im_cw, bitmap_im_ch)
  6141. bitmap.blt(center_x + (bitmap_im_cw * r), bitmap_im_ch + 5, bitmap_number_image, bitmap_src_rect)
  6142. end
  6143. ex = (bitmap_im_cw / 2) * (bitmap_number_text.size + f)
  6144. @damage_ox = (bitmap_number_image.width - (bitmap_number_image.width / 2) - ex) - center_x
  6145. # Add Extra String (MP / Critical)
  6146. if h2 != nil
  6147. string_x = (center_x - (bitmap_number_image.width / 2) + (bitmap_im_cw / 2) * bitmap_number_text.size)
  6148. bitmap_src_rect = Rect.new(0, h2, bitmap_number_image.width, bitmap_im_ch)
  6149. bitmap.blt(string_x , 0, bitmap_number_image, bitmap_src_rect)
  6150. end
  6151. bitmap_number_image.dispose
  6152. else
  6153. #TEXT STRING
  6154. damage_string = value.to_s
  6155. bitmap = Bitmap.new(160, 48)
  6156. bitmap.font.name = DAMAGE_FONT_NAME
  6157. bitmap.font.size = DAMAGE_FONT_SIZE
  6158. bitmap.font.bold = DAMAGE_FONT_BOLD
  6159. bitmap.font.italic = DAMAGE_FONT_ITALIC
  6160. bitmap.font.color = Color.new(0,0,0)
  6161. bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
  6162. case @damage_type
  6163. when "Exp"; string_color = DAMAGE_EXP_FONT_COLOR
  6164. when "Gold"; string_color = DAMAGE_GOLD_FONT_COLOR
  6165. when "Item"; string_color = DAMAGE_ITEM_FONT_COLOR
  6166. else
  6167. string_color = DAMAGE_DEFAULT_FONT_COLOR
  6168. end
  6169. bitmap.font.color = string_color
  6170. bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
  6171. end
  6172. @_damage_sprite = ::Sprite.new(self.viewport)
  6173. @_damage_sprite.bitmap = bitmap
  6174. @_damage_sprite.ox = 100
  6175. @_damage_sprite.oy = 40
  6176. @_damage_sprite.x = self.x + @damage_ox
  6177. @_damage_sprite.y = self.y - self.oy / 2
  6178. @_damage_sprite.z = 5000
  6179. @_damage_duration = 60
  6180. end
  6181.  
  6182. #--------------------------------------------------------------------------
  6183. # ● Dispose Damage
  6184. #--------------------------------------------------------------------------
  6185. def dispose_damage
  6186. if @_damage_sprite != nil
  6187. @_damage_sprite.bitmap.dispose
  6188. @_damage_sprite.dispose
  6189. @_damage_sprite = nil
  6190. @_damage_duration = 0
  6191. end
  6192. end
  6193.  
  6194. #--------------------------------------------------------------------------
  6195. # ● Dispose
  6196. #--------------------------------------------------------------------------
  6197. alias x_damage_dispose dispose
  6198. def dispose
  6199. dispose_damage
  6200. x_damage_dispose
  6201. end
  6202.  
  6203. #--------------------------------------------------------------------------
  6204. # ● Update
  6205. #--------------------------------------------------------------------------
  6206. alias x_damage_pop_update update
  6207. def update
  6208. if @_damage_duration > 0
  6209. @_damage_duration -= 1
  6210. if @_damage_duration == 0
  6211. dispose_damage
  6212. end
  6213. end
  6214. x_damage_pop_update
  6215. end
  6216.  
  6217. end
  6218.  
  6219. #===============================================================================
  6220. # ■ XRXS DAMAGE
  6221. #===============================================================================
  6222. module XRXS_DAMAGE
  6223.  
  6224. #--------------------------------------------------------------------------
  6225. # ● Damage X Init Velocity
  6226. #--------------------------------------------------------------------------
  6227. def damage_x_init_velocity
  6228. return 0.2 * (rand(5) - 2)
  6229. end
  6230.  
  6231. #--------------------------------------------------------------------------
  6232. # ● Damage Y Init Velocity
  6233. #--------------------------------------------------------------------------
  6234. def damage_y_init_velocity
  6235. return 9
  6236. end
  6237.  
  6238. #--------------------------------------------------------------------------
  6239. # ● Update
  6240. #--------------------------------------------------------------------------
  6241. def update
  6242. super
  6243. @damage_sprites = [] if @damage_sprites.nil?
  6244. @damage_durations = [] if @damage_durations.nil?
  6245. if @_damage_sprite != nil and @_damage_sprite.visible
  6246. if @damage_ox != nil
  6247. dam_ox = @damage_ox
  6248. else
  6249. dam_ox = 0
  6250. end
  6251. if @damage_type != nil
  6252. dam_type = @damage_type
  6253. end
  6254. x = damage_x_init_velocity
  6255. y = damage_y_init_velocity
  6256. d = @_damage_duration
  6257. @damage_sprites.push(Sprite_Damage.new(@_damage_sprite, x, y, d,dam_ox,dam_type))
  6258. @_damage_sprite.visible = false
  6259. end
  6260. for damage_sprite in @damage_sprites
  6261. damage_sprite.update
  6262. end
  6263. for i in [url=mailto:0...@damage_sprites.size]0...@damage_sprites.size[/url]
  6264. @damage_sprites[i] = nil if @damage_sprites[i].disposed?
  6265. end
  6266. @damage_sprites.compact!
  6267. end
  6268. def dispose
  6269. super
  6270. if @damage_sprites != nil
  6271. for damage_sprite in @damage_sprites
  6272. damage_sprite.dispose
  6273. end
  6274. end
  6275. end
  6276. end
  6277.  
  6278. #===============================================================================
  6279. # ■ RPG Sprite
  6280. #===============================================================================
  6281. class Sprite_Base < Sprite
  6282. include XRXS_DAMAGE
  6283. end
  6284.  
  6285. #===============================================================================
  6286. # ■ Sprite Damage
  6287. #===============================================================================
  6288. class Sprite_Damage < Sprite
  6289.  
  6290. #--------------------------------------------------------------------------
  6291. # ● Initialize
  6292. #--------------------------------------------------------------------------
  6293. def initialize(sprite, init_x_speed, init_y_speed, duration,dam_ox,dam_type = nil)
  6294. super(nil)
  6295. self.bitmap = sprite.bitmap.dup unless sprite.bitmap.nil?
  6296. self.opacity = sprite.opacity
  6297. self.x = sprite.x
  6298. self.y = sprite.y
  6299. self.z = sprite.z
  6300. self.ox = sprite.ox - dam_ox
  6301. self.oy = sprite.oy
  6302. @now_x_speed = init_x_speed
  6303. @now_y_speed = init_y_speed
  6304. @potential_x_energy = 0.0
  6305. @potential_y_energy = 0.0
  6306. @duration = duration
  6307. @dam_type = dam_type
  6308. @dam_type = "" if dam_type == nil
  6309. end
  6310.  
  6311. #--------------------------------------------------------------------------
  6312. # ● Update
  6313. #--------------------------------------------------------------------------
  6314. def update
  6315. super
  6316. if XAS_DAMAGE_POP::DAMAGE_CRITICAL_ZOOM
  6317. if @dam_type != "Critical"
  6318. update_normal_popup
  6319. else
  6320. update_critical_effect
  6321. end
  6322. else
  6323. update_normal_popup
  6324. end
  6325. @duration -= 1
  6326. if @duration == 0
  6327. self.dispose
  6328. end
  6329. end
  6330.  
  6331. #--------------------------------------------------------------------------
  6332. # ● update_critical_effect
  6333. #--------------------------------------------------------------------------
  6334. def update_critical_effect
  6335. case @duration
  6336. when 40..60
  6337. self.zoom_x += 0.1
  6338. self.zoom_y += 0.1
  6339. else
  6340. if self.zoom_x > 0.1
  6341. self.zoom_x -= 0.1
  6342. self.zoom_y -= 0.1
  6343. end
  6344. end
  6345. end
  6346.  
  6347. #--------------------------------------------------------------------------
  6348. # ● update_normal_popup
  6349. #--------------------------------------------------------------------------
  6350. def update_normal_popup
  6351. self.opacity -= 25 if @duration <= 10
  6352. n = self.oy + @now_y_speed
  6353. if n <= 0
  6354. @now_y_speed *= -1
  6355. @now_y_speed /= 2
  6356. @now_x_speed /= 2
  6357. end
  6358. self.oy = [n, 0].max
  6359. @potential_y_energy += 0.58
  6360. speed = @potential_y_energy.floor
  6361. @now_y_speed -= speed
  6362. @potential_y_energy -= speed
  6363. @potential_x_energy += @now_x_speed
  6364. speed = @potential_x_energy.floor
  6365. self.ox += speed
  6366. @potential_x_energy -= speed
  6367. end
  6368.  
  6369. end
  6370.  
  6371.  
  6372.  
  6373. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  6374. #■ SPRITE - SPRITE EFFECTS
  6375. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  6376.  
  6377.  
  6378. #==============================================================================
  6379. # ■ Sprite Base
  6380. #==============================================================================
  6381. class Sprite_Base < Sprite
  6382.  
  6383. #--------------------------------------------------------------------------
  6384. # ● Animation Set Sprite
  6385. #--------------------------------------------------------------------------
  6386. def animation_set_sprites(frame)
  6387. cell_data = frame.cell_data
  6388. @ani_sprites.each_with_index do |sprite, i|
  6389. next unless sprite
  6390. pattern = cell_data[i, 0]
  6391. if !pattern || pattern < 0
  6392. sprite.visible = false
  6393. next
  6394. end
  6395. sprite.bitmap = pattern < 100 ? @ani_bitmap1 : @ani_bitmap2
  6396. sprite.visible = true
  6397. sprite.src_rect.set(pattern % 5 * 192,
  6398. pattern % 100 / 5 * 192, 192, 192)
  6399. if @ani_mirror
  6400. cx = cell_data[i, 1]
  6401. sprite.angle = (360 - cell_data[i, 4])
  6402. sprite.mirror = (cell_data[i, 5] == 0)
  6403. else
  6404. cx = cell_data[i, 1]
  6405. sprite.angle = cell_data[i, 4]
  6406. sprite.mirror = (cell_data[i, 5] == 1)
  6407. end
  6408. cy = cell_data[i, 2]
  6409. sprite.z = self.z + 300 + i
  6410. sprite.ox = 96
  6411. sprite.oy = 96
  6412. sprite.zoom_x = cell_data[i, 3] / 100.0
  6413. sprite.zoom_y = cell_data[i, 3] / 100.0
  6414. sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  6415. sprite.blend_type = cell_data[i, 7]
  6416. case @animation.position
  6417. when 0
  6418. sprite.x = self.x + cx
  6419. sprite.y = self.y + cy - (height / 2)
  6420. when 1
  6421. sprite.x = self.x + cx
  6422. sprite.y = self.y + cy
  6423. when 2
  6424. sprite.x = self.x + cx
  6425. sprite.y = self.y + cy + (height / 2)
  6426. when 3
  6427. sprite.x = (544 / 2) + cx
  6428. sprite.y = (416 / 2) + cy
  6429. end
  6430.  
  6431.  
  6432. end
  6433. end
  6434.  
  6435. #--------------------------------------------------------------------------
  6436. # ● Dispose Animation
  6437. #--------------------------------------------------------------------------
  6438. def dispose_animation
  6439. $game_temp.animation_garbage = [] if $game_temp.animation_garbage == nil
  6440. if @ani_bitmap1
  6441. @@_reference_count[@ani_bitmap1] -= 1
  6442. if @@_reference_count[@ani_bitmap1] == 0
  6443. $game_temp.animation_garbage.push(@ani_bitmap1)
  6444. end
  6445. end
  6446. if @ani_bitmap2
  6447. @@_reference_count[@ani_bitmap2] -= 1
  6448. if @@_reference_count[@ani_bitmap2] == 0
  6449. $game_temp.animation_garbage.push(@ani_bitmap2)
  6450. end
  6451. end
  6452. if @ani_sprites
  6453. @ani_sprites.each {|sprite| sprite.dispose }
  6454. @ani_sprites = nil
  6455. @animation = nil
  6456. end
  6457. @ani_bitmap1 = nil
  6458. @ani_bitmap2 = nil
  6459. end
  6460.  
  6461. end
  6462.  
  6463. #==============================================================================
  6464. # ■ Scene_Base
  6465. #==============================================================================
  6466. class Game_Map
  6467.  
  6468. #--------------------------------------------------------------------------
  6469. # ● Setup
  6470. #--------------------------------------------------------------------------
  6471. alias animation_garbage_setup setup
  6472. def setup(map_id)
  6473. animation_garbage_setup(map_id)
  6474. dispose_animation_garbage
  6475. end
  6476.  
  6477. #--------------------------------------------------------------------------
  6478. # ● Dispose Animation Garbage
  6479. #--------------------------------------------------------------------------
  6480. def dispose_animation_garbage
  6481. return if $game_temp.animation_garbage == nil
  6482. for animation in $game_temp.animation_garbage
  6483. animation.dispose
  6484. end
  6485. $game_temp.animation_garbage = nil
  6486. end
  6487.  
  6488. end
  6489.  
  6490. #==============================================================================
  6491. # ■ Scene_Base
  6492. #==============================================================================
  6493. class Scene_Base
  6494.  
  6495. #--------------------------------------------------------------------------
  6496. # ● Scene Changing?
  6497. #--------------------------------------------------------------------------
  6498. alias animation_garbage_scene_changing scene_changing?
  6499. def scene_changing?
  6500. $game_map.dispose_animation_garbage if SceneManager.scene != self
  6501. animation_garbage_scene_changing
  6502. end
  6503.  
  6504. end
  6505.  
  6506. #===============================================================================
  6507. # ■ Sprite_Character
  6508. #===============================================================================
  6509. class Sprite_Character < Sprite_Base
  6510. include XAS_SYSTEM
  6511.  
  6512. #--------------------------------------------------------------------------
  6513. # ● Setup New Effect
  6514. #--------------------------------------------------------------------------
  6515. def setup_new_effect
  6516. if @character.animation_id > 0
  6517. animation = $data_animations[@character.animation_id]
  6518. start_animation(animation)
  6519. @character.animation_id = 0
  6520. end
  6521. if !@balloon_sprite && @character.balloon_id > 0
  6522. @balloon_id = @character.balloon_id
  6523. start_balloon
  6524. end
  6525. end
  6526.  
  6527. #--------------------------------------------------------------------------
  6528. # ● Can Update X Effects
  6529. #--------------------------------------------------------------------------
  6530. def can_update_x_effects?
  6531. return false unless CHARACTER_SPRITE_EFFECTS
  6532. return false if @character.erased
  6533. return false if @character.transparent == true
  6534. return true
  6535. end
  6536. #--------------------------------------------------------------------------
  6537. # ● Can Damage Pop Base
  6538. #--------------------------------------------------------------------------
  6539. def can_damage_pop_base?
  6540. return false unless $game_system.xas_battle
  6541. return false if XAS_SYSTEM::DAMAGE_POP == false
  6542. return false if @character.battler == nil
  6543. return false if @character.battler.no_damage_pop
  6544. return false if @character.battler.damage_pop != true
  6545. return true
  6546. end
  6547.  
  6548.  
  6549. #--------------------------------------------------------------------------
  6550. # ● Execute Damage Pop
  6551. #--------------------------------------------------------------------------
  6552. def execute_damage_pop
  6553. damage(@character.battler.damage, @character.battler.damage_type)
  6554. @character.battler.damage = nil
  6555. @character.battler.critical = false
  6556. @character.battler.damage_pop = false
  6557. @character.battler.damage_type = ""
  6558. end
  6559.  
  6560. #--------------------------------------------------------------------------
  6561. # ● Update X Effects
  6562. #--------------------------------------------------------------------------
  6563. def update_x_effects
  6564. update_collaspse_effects if @character.collapse_duration > 0
  6565. update_sprite_position
  6566. update_angle
  6567. update_zoom
  6568. end
  6569.  
  6570. #--------------------------------------------------------------------------
  6571. # ● Update Angle
  6572. #--------------------------------------------------------------------------
  6573. def update_angle
  6574. return if @character.angle == self.angle
  6575. self.angle = @character.angle
  6576. end
  6577.  
  6578. #--------------------------------------------------------------------------
  6579. # ● Update Zoom
  6580. #--------------------------------------------------------------------------
  6581. def update_zoom
  6582. update_treasure_effect
  6583. update_breath_effect if can_breath_effect?
  6584. self.zoom_x = @character.zoom_x
  6585. self.zoom_y = @character.zoom_y
  6586. end
  6587.  
  6588. #--------------------------------------------------------------------------
  6589. # ● Update Treasure_effect
  6590. #--------------------------------------------------------------------------
  6591. def update_treasure_effect
  6592. return if @character.treasure_time == 0
  6593. update_treasure_fade_effect
  6594. update_treasure_float_effect
  6595. end
  6596.  
  6597. #--------------------------------------------------------------------------
  6598. # ● update_treasure_fade_effect
  6599. #--------------------------------------------------------------------------
  6600. def update_treasure_fade_effect
  6601. return unless XAS_BA::FADE_TREASURE_SPRITE
  6602. return if @character.treasure_time > 100
  6603. return if @character.zoom_x < 0.01
  6604. @character.zoom_x -= 0.01
  6605. if @character.temp_id > 0
  6606. @character.zoom_x = 1.00
  6607. @character.treasure_time = 120 + XAS_BA::TREASURE_ERASE_TIME * 60
  6608. end
  6609. end
  6610.  
  6611. #--------------------------------------------------------------------------
  6612. # ● Update Treasure Float Effect
  6613. #--------------------------------------------------------------------------
  6614. def update_treasure_float_effect
  6615. return unless XAS_BA::FLOAT_TREASURE_SPRITE
  6616. return if self.character.jumping?
  6617. self.character.treasure_float[2] += 1
  6618. if self.character.treasure_float[2] > 1
  6619. self.character.treasure_float[2] = 0
  6620. self.character.treasure_float[1] += 1
  6621. case self.character.treasure_float[1]
  6622. when 1..15
  6623. self.character.treasure_float[0] -= 1
  6624. when 16..30
  6625. self.character.treasure_float[0] += 1
  6626. else
  6627. self.character.treasure_float[0] = 0
  6628. self.character.treasure_float[1] = 0
  6629. end
  6630. end
  6631. self.y += self.character.treasure_float[0]
  6632. end
  6633.  
  6634. #--------------------------------------------------------------------------
  6635. # ● Can Breath Effect?
  6636. #--------------------------------------------------------------------------
  6637. def can_breath_effect?
  6638. return false if @character.battler == nil
  6639. return false if @character.battler.breath_effect == false
  6640. return false if @character.battler.hp == 0
  6641. return false if @character.stop and not @character.battler.state_sleep
  6642. return true
  6643. end
  6644.  
  6645. #--------------------------------------------------------------------------
  6646. # ● Update Breath Effect
  6647. #--------------------------------------------------------------------------
  6648. def update_breath_effect
  6649. if @character.battler.fast_breath_effect
  6650. zoom_speed = 3
  6651. zoom_power_x = 0.006
  6652. zoom_power_y = 0.006
  6653. else
  6654. zoom_speed = 1
  6655. zoom_power_x = 0
  6656. zoom_power_y = 0.002
  6657. end
  6658. @character.battler.breath_duration += zoom_speed
  6659. case @character.battler.breath_duration
  6660. when 1..30
  6661. @character.zoom_x += zoom_power_x
  6662. @character.zoom_y += zoom_power_y
  6663. when 31..60
  6664. @character.zoom_x -= zoom_power_x
  6665. @character.zoom_y -= zoom_power_y
  6666. else
  6667. @character.battler.breath_duration = 0
  6668. @character.zoom_x = 1.00
  6669. @character.zoom_y = 1.00
  6670. end
  6671. end
  6672.  
  6673. #--------------------------------------------------------------------------
  6674. # ● Update Sprite Position
  6675. #--------------------------------------------------------------------------
  6676. alias x_set_character_bitmap set_character_bitmap
  6677. def set_character_bitmap
  6678. @py = nil
  6679. x_set_character_bitmap
  6680. if @character_name[/\((\d+)\)/]
  6681. @py = $1.to_i
  6682. end
  6683. end
  6684.  
  6685. #--------------------------------------------------------------------------
  6686. # ● Update Sprite Position
  6687. #--------------------------------------------------------------------------
  6688. def update_sprite_position
  6689. if @character.tool_id > 0
  6690. if @character.tool_effect == "Barrier"
  6691. unless @character.action == nil
  6692. bullet_user = @character.action.user
  6693. self.x = bullet_user.screen_x
  6694. self.y = bullet_user.screen_y
  6695. @character.x = bullet_user.x
  6696. @character.y = bullet_user.y
  6697. @character.direction = bullet_user.direction
  6698. end
  6699. end
  6700. end
  6701. update_hold_target
  6702. if @py != nil
  6703. self.y += @py
  6704. end
  6705. if @character.angle == 315 and @cw != nil
  6706. self.x -= (@cw / 3)
  6707. self.y -= (@ch / 6)
  6708. end
  6709. if XAS_BA::KNOCKBACKING_SHAKE
  6710. if self.character.knockbacking?
  6711. self.x = self.x + rand(5) unless self.character.dead?
  6712. end
  6713. end
  6714. end
  6715.  
  6716. #--------------------------------------------------------------------------
  6717. # ● Update X Effects
  6718. #--------------------------------------------------------------------------
  6719. def update_hold_target
  6720. return if @character.temp_id == 0
  6721. target = $game_map.events[@character.temp_id]
  6722. if target == nil or target.erased
  6723. @character.temp_id = 0
  6724. @character.move_speed = @character.pre_move_speed
  6725. check_character_above_player(target)
  6726. else
  6727. self.x = target.screen_x
  6728. self.y = target.screen_y
  6729. self.character.x = target.x
  6730. self.character.y = target.y
  6731. self.character.move_speed = target.move_speed
  6732. self.character.direction = target.direction unless self.character.direction_fix
  6733. check_character_above_player(target)
  6734. end
  6735. end
  6736.  
  6737. #--------------------------------------------------------------------------
  6738. # ● Check Chacracter Above Player
  6739. #--------------------------------------------------------------------------
  6740. def check_character_above_player(target)
  6741. return if @character.is_a?(Game_Player)
  6742. return if @character.battler == nil
  6743. if (@character.x == $game_player.x and
  6744. @character.y == $game_player.y) or
  6745. not @character.passable_temp_id?(@character.x,@character.y)
  6746. @character.temp_id = 0
  6747. @character.move_speed = @character.pre_move_speed
  6748. case @character.direction
  6749. when 2; @character.y -= 1
  6750. when 4; @character.x += 1
  6751. when 6; @character.x -= 1
  6752. when 8; @character.y += 1
  6753. end
  6754. end
  6755. end
  6756.  
  6757. #--------------------------------------------------------------------------
  6758. # ● Update_balloon
  6759. #--------------------------------------------------------------------------
  6760. if XAS_BA::FIX_BALLOON_POSITION
  6761. def update_balloon
  6762. if @balloon_duration > 0
  6763. @balloon_duration -= 1
  6764. if @balloon_duration > 0
  6765. @balloon_sprite.x = x
  6766. @balloon_sprite.y = y - XAS_BA::BALLOON_HEIGHT
  6767. @balloon_sprite.z = z + 200
  6768. sx = balloon_frame_index * 32
  6769. sy = (@balloon_id - 1) * 32
  6770. @balloon_sprite.src_rect.set(sx, sy, 32, 32)
  6771. else
  6772. end_balloon
  6773. end
  6774. end
  6775. end
  6776. end
  6777.  
  6778. end
  6779.  
  6780. #==============================================================================
  6781. # ■ Game_Event
  6782. #==============================================================================
  6783. class Game_Event < Game_Character
  6784.  
  6785. #--------------------------------------------------------------------------
  6786. # ● Near The Screen
  6787. #--------------------------------------------------------------------------
  6788. alias x_near_the_screen near_the_screen?
  6789. def near_the_screen?(dx = 12, dy = 8)
  6790. return true if can_update_out_screen?
  6791. x_near_the_screen(dx, dy)
  6792. end
  6793.  
  6794. #--------------------------------------------------------------------------
  6795. # ● Can Update Out Screen
  6796. #--------------------------------------------------------------------------
  6797. def can_update_out_screen?
  6798. return true if self.force_update
  6799. return false
  6800. end
  6801.  
  6802. end
  6803.  
  6804. #==============================================================================
  6805. # ■ Spriteset Map
  6806. #==============================================================================
  6807. class Spriteset_Map
  6808.  
  6809. #--------------------------------------------------------------------------
  6810. # ● Can Refresh Hud
  6811. #--------------------------------------------------------------------------
  6812. alias x_pre_leader_id_initialize initialize
  6813. def initialize
  6814. if $game_party.members[0] != nil
  6815. $game_system.pre_leader_id = $game_party.members[0].actor_id
  6816. else
  6817. $game_system.pre_leader_id = nil
  6818. end
  6819. x_pre_leader_id_initialize
  6820. end
  6821.  
  6822. #--------------------------------------------------------------------------
  6823. # ● Can Refresh Hud
  6824. #--------------------------------------------------------------------------
  6825. def can_refresh_hud?
  6826. if $game_party.members[0] == nil
  6827. return true if $game_system.pre_leader_id != nil
  6828. elsif $game_party.members[0] != nil
  6829. return true if $game_system.pre_leader_id == nil
  6830. return true if $game_system.pre_leader_id != $game_party.members[0].actor_id
  6831. end
  6832. return false
  6833. end
  6834.  
  6835. #--------------------------------------------------------------------------
  6836. # ● update
  6837. #--------------------------------------------------------------------------
  6838. def refresh_hud
  6839. $game_system.pre_leader_id = $game_party.members[0].actor_id
  6840. end
  6841.  
  6842. #--------------------------------------------------------------------------
  6843. # ● Update Hud Visible
  6844. #--------------------------------------------------------------------------
  6845. def update_hud_visible
  6846. if hud_visible?
  6847. $game_system.enable_hud = true
  6848. else
  6849. $game_system.enable_hud = false
  6850. end
  6851. end
  6852.  
  6853. #--------------------------------------------------------------------------
  6854. # ● Hud Visible?
  6855. #--------------------------------------------------------------------------
  6856. def hud_visible?
  6857. return false if $game_system.hud_visible == false
  6858. return false if $game_message.visible
  6859. return true
  6860. end
  6861.  
  6862. end
  6863.  
  6864.  
  6865.  
  6866. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  6867. #■ MISC - SCENE TARGET SELECT
  6868. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  6869.  
  6870.  
  6871. #==============================================================================
  6872. # ■ Game_Temp
  6873. #==============================================================================
  6874. class Game_Temp
  6875. attr_accessor :xas_target_x
  6876. attr_accessor :xas_target_y
  6877. attr_accessor :xas_target_time
  6878. attr_accessor :xas_target_shoot_id
  6879.  
  6880. #--------------------------------------------------------------------------
  6881. # ● Initialize
  6882. #--------------------------------------------------------------------------
  6883. alias xas_target_initialize initialize
  6884. def initialize
  6885. xas_target_initialize
  6886. @xas_target_x = 0
  6887. @xas_target_y = 0
  6888. @xas_target_time = 0
  6889. @xas_target_shoot_id = 0
  6890. end
  6891.  
  6892. end
  6893.  
  6894. #==============================================================================
  6895. # ■ Game_Map
  6896. #==============================================================================
  6897. class Game_Map
  6898.  
  6899. attr_accessor :pre_display_x
  6900. attr_accessor :pre_display_y
  6901. attr_accessor :pre_real_display_x
  6902. attr_accessor :pre_real_display_y
  6903.  
  6904. #--------------------------------------------------------------------------
  6905. # * Object Initialization
  6906. #--------------------------------------------------------------------------
  6907. alias x_map_initialize initialize
  6908. def initialize
  6909. x_map_initialize
  6910. @pre_display_x = @display_x - 1
  6911. @pre_display_y = @display_y - 1
  6912. end
  6913.  
  6914. #--------------------------------------------------------------------------
  6915. # ● Screen Scrolled?
  6916. #--------------------------------------------------------------------------
  6917. def screen_scrolled?
  6918. if @pre_display_x != @display_x or
  6919. @pre_display_y != @display_y
  6920. @pre_display_x = @display_x
  6921. @pre_display_y = @display_y
  6922. return true
  6923. end
  6924. return false
  6925. end
  6926.  
  6927. #--------------------------------------------------------------------------
  6928. # ● Event On Screen
  6929. #--------------------------------------------------------------------------
  6930. def event_on_screen?(event)
  6931. event.target = false
  6932. px = ($game_map.display_x).truncate
  6933. py = ($game_map.display_y).truncate
  6934. distance_x = event.x - px
  6935. distance_y = event.y - py
  6936. if distance_x.between?(0, 16) and
  6937. distance_y.between?(0, 12)
  6938. event.target = true
  6939. end
  6940. end
  6941.  
  6942. #--------------------------------------------------------------------------
  6943. # ● Check Event on Screen
  6944. #--------------------------------------------------------------------------
  6945. def check_events_on_screen
  6946. for i in $game_map.events.values
  6947. event_on_screen?(i)
  6948. end
  6949. end
  6950.  
  6951. end
  6952. #==============================================================================
  6953. # ■ Scene Target Select
  6954. #==============================================================================
  6955. class Scene_Target_Select
  6956.  
  6957. #--------------------------------------------------------------------------
  6958. # ● Main
  6959. #--------------------------------------------------------------------------
  6960. def main
  6961. $game_temp.xas_target_x = 0
  6962. $game_temp.xas_target_y = 0
  6963. $game_temp.xas_target_time = 0
  6964. @new_x = $game_player.screen_x
  6965. @new_y = $game_player.screen_y
  6966. @index_max = -1
  6967. @target_index = 0
  6968. @spriteset = Spriteset_Map.new
  6969. @text_string = ""
  6970. @fy = 0
  6971. @fy_time = 0
  6972. for event in $game_map.events.values
  6973. if event.target and event.battler?
  6974. @index_max += 1
  6975. end
  6976. end
  6977. Sound.play_equip
  6978. if @index_max == -1
  6979. cancel_select
  6980. else
  6981. create_layout
  6982. create_layout_skill
  6983. create_cusrsor
  6984. create_text
  6985. create_skill_name
  6986. select_target(0)
  6987. end
  6988. Graphics.transition(0)
  6989. loop do
  6990. Graphics.update
  6991. Input.update
  6992. update
  6993. break if SceneManager.scene != self
  6994. end
  6995. dispose
  6996. end
  6997. #--------------------------------------------------------------------------
  6998. # ● Create Layout
  6999. #--------------------------------------------------------------------------
  7000. def create_layout
  7001. @layout_1 = Plane.new
  7002. @layout_1.bitmap = Cache.system("XAS_Target_Layout1")
  7003. @layout_1.z = 10100
  7004. @layout_1.opacity = 255
  7005. end
  7006.  
  7007. #--------------------------------------------------------------------------
  7008. # ● Create Layout
  7009. #--------------------------------------------------------------------------
  7010. def create_layout_skill
  7011. @skill_layout = Sprite.new
  7012. @skill_layout.bitmap = Cache.system("XAS_Active_Help")
  7013. @skill_layout.z = 10101
  7014. @skill_layout.x = -100
  7015. @skill_layout.y = 32
  7016. @skill_layout.opacity = 0
  7017. end
  7018.  
  7019. #--------------------------------------------------------------------------
  7020. # ● Create Cursor
  7021. #--------------------------------------------------------------------------
  7022. def create_cusrsor
  7023. @cursor = Sprite.new
  7024. @cursor.bitmap = Cache.system("XAS_Cursor")
  7025. @cursor.z = 10105
  7026. @cursor.x = @new_x
  7027. @cursor.y = @new_y
  7028. @cursor.opacity = 255
  7029. @cursor.visible = true
  7030. end
  7031.  
  7032. #--------------------------------------------------------------------------
  7033. # ● Create Text
  7034. #--------------------------------------------------------------------------
  7035. def create_text
  7036. @text = Sprite.new
  7037. @text.bitmap = Bitmap.new(200,40)
  7038. @text.z = 10102
  7039. @text.bitmap.font.size = 20
  7040. @text.bitmap.font.bold = true
  7041. @text.bitmap.font.name = "Georgia"
  7042. @text.bitmap.draw_text(0, 0, 200, 40, @text_string.to_s,1)
  7043. @text.opacity = 255
  7044. @text.x = @new_x
  7045. @text.y = @new_y
  7046. end
  7047.  
  7048. #--------------------------------------------------------------------------
  7049. # ● Create Text
  7050. #--------------------------------------------------------------------------
  7051. def create_skill_name
  7052. @skill_name = Plane.new
  7053. @skill_name.bitmap = Bitmap.new(640,480)
  7054. @skill_name.z = 10103
  7055. @skill_name.bitmap.font.size = 20
  7056. @skill_name.bitmap.font.bold = true
  7057. @skill_name.bitmap.font.name = "Georgia"
  7058. @skill_name.oy = -40
  7059. skill = $data_skills[$game_temp.xas_target_shoot_id]
  7060. skill_text = skill.name.to_s + " - " + skill.description.to_s
  7061. @skill_name.bitmap.draw_text(0, 0, 640, 40, skill_text,1)
  7062. @skill_name.opacity = 0
  7063. end
  7064.  
  7065. #--------------------------------------------------------------------------
  7066. # ● Dispose
  7067. #--------------------------------------------------------------------------
  7068. def dispose
  7069. Graphics.freeze
  7070. @spriteset.dispose
  7071. if @cursor != nil
  7072. @cursor.bitmap.dispose
  7073. @cursor.dispose
  7074. @text.bitmap.dispose
  7075. @text.dispose
  7076. @skill_layout.bitmap.dispose
  7077. @skill_layout.dispose
  7078. @skill_name.bitmap.dispose
  7079. @skill_name.dispose
  7080. @layout_1.bitmap.dispose
  7081. @layout_1.dispose
  7082. end
  7083. end
  7084.  
  7085. #--------------------------------------------------------------------------
  7086. # ● Update
  7087. #--------------------------------------------------------------------------
  7088. def update
  7089. return if @index_max == -1
  7090. @spriteset.update
  7091. update_cursor_slide
  7092. update_layout_slide
  7093. update_targe_select
  7094. end
  7095.  
  7096. #--------------------------------------------------------------------------
  7097. # ● Update Layout Slide
  7098. #--------------------------------------------------------------------------
  7099. def update_layout_slide
  7100. @layout_1.ox += 3
  7101. if @skill_layout.x < 0
  7102. @skill_layout.x += 10
  7103. @skill_layout.opacity += 25
  7104. @skill_name.opacity += 25
  7105. else
  7106. @skill_layout.x = 0
  7107. @skill_layout.opacity = 255
  7108. @skill_name.opacity = 255
  7109. @skill_name.ox -= 3
  7110. end
  7111. end
  7112.  
  7113. #--------------------------------------------------------------------------
  7114. # ● Refresh Text
  7115. #--------------------------------------------------------------------------
  7116. def refresh_text
  7117. @text.bitmap.clear
  7118. @text.bitmap.draw_text(0, 0, 200, 40, @text_string.to_s,1)
  7119. end
  7120.  
  7121. #--------------------------------------------------------------------------
  7122. # ● Update Cursor Slide
  7123. #--------------------------------------------------------------------------
  7124. def update_cursor_slide
  7125. @speed_x = [[(@cursor.x - @new_x / 60), 1].max, 60].min
  7126. @speed_y = [[(@cursor.y - @new_y / 60), 1].max, 60].min
  7127. if @cursor.x > @new_x
  7128. @cursor.x -= @speed_x.abs
  7129. @cursor.x = @new_x if @cursor.x < @new_x
  7130. elsif @cursor.x < @new_x
  7131. @cursor.x += @speed_x.abs
  7132. @cursor.x = @new_x if @cursor.x > @new_x
  7133. end
  7134.  
  7135. if @cursor.y > @new_y
  7136. @cursor.y -= @speed_y.abs
  7137. @cursor.y = @new_y if @cursor.y < @new_y
  7138. elsif @cursor.y < @new_y
  7139. @cursor.y += @speed_y.abs
  7140. @cursor.y = @new_y if @cursor.y > @new_y
  7141. end
  7142. @text.x = - 85 + @cursor.x
  7143. @text.y = 20 + @cursor.y
  7144. if @fy_time > 25
  7145. @fy += 1
  7146. elsif @fy_time > 0
  7147. @fy -= 1
  7148. else
  7149. @fy = 0
  7150. @fy_time = 50
  7151. end
  7152. @fy_time -= 1
  7153. @cursor.oy = @fy
  7154.  
  7155. end
  7156.  
  7157. #--------------------------------------------------------------------------
  7158. # ● Select Target(type)
  7159. #--------------------------------------------------------------------------
  7160. def select_target(type)
  7161. return if @index_max < 0
  7162. check_index
  7163. valor = 0
  7164. for event in $game_map.events.values
  7165. if event.target and event.battler?
  7166. if valor == @target_index
  7167. @new_x = event.screen_x - 10
  7168. @new_y = event.screen_y
  7169. @text_string = event.battler.name
  7170. $game_temp.xas_target_x = event.x
  7171. $game_temp.xas_target_y = event.y
  7172. $game_temp.xas_target_time = 1
  7173. end
  7174. valor += 1
  7175. end
  7176. end
  7177. refresh_text
  7178. end
  7179.  
  7180. #--------------------------------------------------------------------------
  7181. # ● Cancel Select
  7182. #--------------------------------------------------------------------------
  7183. def cancel_select
  7184. Sound.play_buzzer
  7185. $game_temp.xas_target_x = 0
  7186. $game_temp.xas_target_y = 0
  7187. $game_temp.xas_target_time = 0
  7188. $game_temp.xas_target_shoot_id = 0
  7189. SceneManager.call(Scene_Map)
  7190. end
  7191.  
  7192. #--------------------------------------------------------------------------
  7193. # ● Update Target Select
  7194. #--------------------------------------------------------------------------
  7195. def update_targe_select
  7196. if Input.trigger?(Input::B)
  7197. cancel_select
  7198. elsif Input.trigger?(Input::DOWN) or Input.trigger?(Input::RIGHT)
  7199. @target_index += 1
  7200. select_target(0)
  7201. Sound.play_cursor
  7202. elsif Input.trigger?(Input::UP) or Input.trigger?(Input::LEFT)
  7203. @target_index -= 1
  7204. select_target(1)
  7205. Sound.play_cursor
  7206. elsif Input.trigger?(Input::C)
  7207. Sound.play_ok
  7208. SceneManager.call(Scene_Map)
  7209. end
  7210. end
  7211.  
  7212. #--------------------------------------------------------------------------
  7213. # ● Check Index
  7214. #--------------------------------------------------------------------------
  7215. def check_index
  7216. if @target_index > @index_max
  7217. @target_index = 0
  7218. end
  7219. if @target_index < 0
  7220. @target_index = @index_max
  7221. end
  7222. end
  7223.  
  7224. end
  7225.  
  7226.  
  7227. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  7228. #■ MISC - MAIN UPDATE
  7229. #■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
  7230.  
  7231. #===============================================================================
  7232. # ■ Spriteset_Map
  7233. #===============================================================================
  7234. class Spriteset_Map
  7235.  
  7236. #--------------------------------------------------------------------------
  7237. # ● update
  7238. #--------------------------------------------------------------------------
  7239. alias xas_main_update update
  7240. def update
  7241. xas_main_update
  7242. update_xas_spriteset_map
  7243. end
  7244.  
  7245. #--------------------------------------------------------------------------
  7246. # ● Update XAS Spriteset Map
  7247. #--------------------------------------------------------------------------
  7248. def update_xas_spriteset_map
  7249. refresh_token if $game_map.need_refresh_token
  7250. refresh_hud if can_refresh_hud?
  7251. update_hud_visible
  7252. end
  7253. end
  7254.  
  7255.  
  7256. #===============================================================================
  7257. # ■ Sprite_Character
  7258. #===============================================================================
  7259. class Sprite_Character < Sprite_Base
  7260.  
  7261. #--------------------------------------------------------------------------
  7262. # ● Update
  7263. #--------------------------------------------------------------------------
  7264. alias x_update update
  7265. def update
  7266. x_update
  7267. execute_damage_pop if can_damage_pop_base?
  7268. update_x_effects if can_update_x_effects?
  7269. end
  7270.  
  7271. end
  7272.  
  7273. #===============================================================================
  7274. # ■ Game Character
  7275. #===============================================================================
  7276. class Game_Character < Game_CharacterBase
  7277.  
  7278. #--------------------------------------------------------------------------
  7279. # ● Update
  7280. #--------------------------------------------------------------------------
  7281. alias x_main_update update
  7282. def update
  7283. update_character_before_movement
  7284. x_main_update
  7285. update_character_after_movement
  7286. end
  7287.  
  7288. #--------------------------------------------------------------------------
  7289. # ● Update Character Before Movement
  7290. #--------------------------------------------------------------------------
  7291. def update_character_before_movement
  7292. check_xy
  7293. update_force_action if can_force_action?
  7294. end
  7295.  
  7296. #--------------------------------------------------------------------------
  7297. # ● Update Character After Movement
  7298. #--------------------------------------------------------------------------
  7299. def update_character_after_movement
  7300. update_battler if can_update_battler?
  7301. end
  7302.  
  7303. end
  7304.  
  7305. #===============================================================================
  7306. # ■ Game Event
  7307. #===============================================================================
  7308. class Game_Event < Game_Character
  7309.  
  7310. #--------------------------------------------------------------------------
  7311. # ● Update
  7312. #--------------------------------------------------------------------------
  7313. alias x_main_event_update update
  7314. def update
  7315. update_event_before_movement
  7316. x_main_event_update
  7317. update_event_after_movement
  7318. end
  7319.  
  7320. #--------------------------------------------------------------------------
  7321. # ● Update Event Before Movement
  7322. #--------------------------------------------------------------------------
  7323. def update_event_before_movement
  7324. update_sensor if can_update_sensor?
  7325. update_treasure_duration
  7326. end
  7327.  
  7328. #--------------------------------------------------------------------------
  7329. # ● Update Event After Movement
  7330. #--------------------------------------------------------------------------
  7331. def update_event_after_movement
  7332.  
  7333. end
  7334.  
  7335. end
  7336.  
  7337. #===============================================================================
  7338. # ■ Game Player
  7339. #===============================================================================
  7340. class Game_Player < Game_Character
  7341.  
  7342. #--------------------------------------------------------------------------
  7343. # ● Update
  7344. #--------------------------------------------------------------------------
  7345. alias x_main_player_update update
  7346. def update
  7347. update_player_before_movement if party_system?
  7348. x_main_player_update
  7349. update_player_after_movement if party_system?
  7350. end
  7351.  
  7352. #--------------------------------------------------------------------------
  7353. # ● Update Player Before Movement
  7354. #--------------------------------------------------------------------------
  7355. def update_player_before_movement
  7356. check_actor_level
  7357. update_reset_battler_setting_time
  7358. if $game_system.old_interpreter_running != $game_map.interpreter.running?
  7359. refresh_interpreter_effect
  7360. end
  7361. end
  7362.  
  7363. #--------------------------------------------------------------------------
  7364. # ● Update Player after Movement
  7365. #--------------------------------------------------------------------------
  7366. def update_player_after_movement
  7367. update_action_command if can_use_command?
  7368. $game_temp.change_leader_wait_time -= 1 if $game_temp.change_leader_wait_time > 0
  7369. end
  7370.  
  7371. end

作者: end55rpg    时间: 2013-7-23 17:03
这是神马东西7000多行?
作者: 漫漫人生路    时间: 2013-7-23 18:19
{:2_262:}话说,会继续讲解XAS的使用说明吗?

作者: 星小彩    时间: 2013-7-23 19:01
那个。带URL的部分是啥米?全都出错。
作者: 雷欧亦炫    时间: 2013-10-27 10:40
有连载吗?
作者: tan12345    时间: 2013-10-27 10:49
好东西,求继续汉化共享。
作者: cdwqing    时间: 2016-4-19 14:26
如何把八方向行走变成四方向行走
作者: Vortur    时间: 2016-4-19 16:46
就是要着个!!!!!!
作者: cdwqing    时间: 2016-4-19 19:47
cdwqing 发表于 2016-4-19 14:26
如何把八方向行走变成四方向行走

谢谢,大侠能说具体点吗,在哪一行,我找不到。{:2_257:}
作者: cdwqing    时间: 2016-4-19 19:50
cdwqing 发表于 2016-4-19 14:26
如何把八方向行走变成四方向行走

谢谢,大侠能说具体点吗,在哪一行,我找不到。{:2_257:}
作者: duzine    时间: 2016-4-20 03:05
發現這是墳墓帖
索性一起問了

如何把被XAS關閉的火車列隊叫出來?




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1