Project1

标题: 请问是否有办法增加热键? [打印本页]

作者: timmyyayaya    时间: 2012-3-25 00:10
标题: 请问是否有办法增加热键?
本帖最后由 774559263 于 2012-6-8 19:46 编辑 # ~+ T2 G2 L1 r. ~  F5 o. M

5 @+ f* b% j4 {" U. y5 A: l$ r* }* q之前虽然有在板上问过,不过还是不清楚该如何设置,' D& c8 O/ U3 o" Y- b5 w* k
不知道有没有人在国外找到XAS的增加热键脚本,或是知道该怎么去写RGSS。
  Y/ Q0 {, N% f; b9 P! C
作者: ML4455739    时间: 2012-3-25 10:58
本帖最后由 ML4455739 于 2012-3-25 10:59 编辑 ) U% H! t/ m! y6 L- J' v0 \3 D

2 n. K0 k- ^4 \# IXAS在国内外都算不冷不热的东西,开发热度不强0 \+ Y2 B6 l! g( F& A$ b- u
照LZ所说增加按键就至少需要考虑两个方面
7 U: a9 |# S3 Y! w. h  Z& D& C一是按键数量(全键盘解决可能)二是右下角的UI等。
# V) y( H5 s8 F1 b7 h+ }0 {. g) r. n) s2 P0 \% e  w2 s
附:LZ的3.91我也没下过,不知道是不是汉化的反正结构很奇怪一定是
作者: timmyyayaya    时间: 2012-3-25 12:14
XAS的结构大家说都很怪,6 Q) l+ x' i, {
我是想让右下角的UI热键多一些,  f" M; T1 {& c( Z( \) o: g
原本是一个技能、一个物品,
* K/ x2 n. F) x7 a' \* w变成8个技能/物品。
作者: ML4455739    时间: 2012-3-25 12:40
方法肯定是有,只是这是大工程,没什么人会愿意去做。
作者: timmyyayaya    时间: 2012-3-31 09:53
在下找到了这个脚本,不过套上去有些地方会出错,
  h& m9 H/ E- j: B& \不知道有人能帮忙看一下吗?
  1. #===============================================================================
    4 M. ^, L* f, j" C
  2. # XAS - Hot Key HUD: N& U1 M4 n- n9 U7 n3 t" b/ X* g- _3 x
  3. #===============================================================================9 d7 \0 C- g' M. e0 @1 W
  4. # By Mr_Wiggles
    ' B, w! o) I5 J% w
  5. # Version 1.3
    " r9 `( |3 A2 t+ z! S" _, I
  6. # 7/6/10
    ; b% t9 y% j- L& L$ O" L
  7. #-------------------------------------------------------------------------------- P, c! j2 V2 Z- F
  8. # Instructions:. S9 G$ R5 B$ r; D* Q0 u
  9. #  Fill in the constants bellow, paste this script above main and bellow XAS in
    - |- K. X5 _6 S/ r
  10. #  your script data base. BE SURE TO SET TO THE RIGHT XAS VERSION!!
    ( q" ~; g" ^3 k
  11. # , Z2 l6 e$ ~8 ^1 a. d0 x) C
  12. #  Place the "Hot_Keys_HUD" picture file into your game directory
    6 w7 e2 C6 D+ V& k
  13. #  Graphics/Pictures folder.
    / q. O- o7 p" l3 ~
  14. #-------------------------------------------------------------------------------
    2 c: I  d& s; s3 X* ^+ d) [
  15. # Directions of Use:
    / h. w* X. B0 `- J1 N, q8 K
  16. #  Simple just press a number key (1 - 5) when the quick skill or item menu is
    " _, l' x0 M* e# q2 n! F7 c/ i( {# n
  17. #  Showing.1 D% s' ~$ G8 h  |' Y
  18. #===============================================================================1 `$ q5 `0 y  M& r' N+ g
  19. HUD_X = 0 # X pos of HUD
    4 P* x8 u9 q( G1 U! y8 @
  20. HUD_Y = 0 # Y pos of HUD3 b3 C5 {2 x6 [$ G  q  A
  21. 0 r" c$ D1 a1 E( b4 ^  u; n3 A9 W
  22. # Set true  if XAS 3.7f
    2 v( k( D% _, d$ ]% A
  23. # set false if XAS 3.6( V9 l8 V2 u5 A# v, ^& _6 `
  24. XASVER_37 = true
    5 B4 Q2 k: _5 L9 C
  25. 7 |+ V* y3 y0 v9 x, J0 o: \/ C
  26. #===============================================================================3 r' r' p/ x* E: N$ c+ |
  27. # Numkeys Module* P5 H5 v7 H& |. {: A( ~. M; D) {) ?
  28. #===============================================================================2 M8 v" e: M- c' j; N  _
  29. module Input! ^+ k" W5 b* A/ Q  \5 B
  30.   Numkey = {1 => 1049, 2 => 1050, 3 => 1051, 4 => 1052, 5 => 1053}1 j5 L( x8 x% s+ M7 W& ^
  31.   class << self
    + ~4 K& X: f  K! @& c: c
  32.     Key = Win32API.new('user32','GetAsyncKeyState',['i'],'i')3 w; p* c5 h, D, T7 x" `8 h
  33.    
    2 l7 ]# l# z6 A+ ?" ~* f3 s
  34.     def testkey(key)* [% t5 X' _" w; E+ O
  35.       Key.call(key) & 0x01 == 1
    * l( ~" Y. K9 z& p  c3 N% O
  36.     end
    : {) V) z6 k( }) n: c  {8 X
  37.    
    # p. p3 w8 K5 j; w* G8 x7 [' q7 m7 @
  38.     alias hud_key_update update7 i* z# o( L4 @, r+ B& N
  39.     def update
    # W1 L5 A4 i, M+ E/ c0 K4 s7 Y
  40.       hud_key_update$ Z6 D4 \5 p4 q# [  s) r
  41.       @pressed = []
    4 y7 s: w) h, F$ \/ v% Q" y
  42.       for key in Numkey.values
    % U3 ]" Q8 n: O8 F6 @, V
  43.         key -= 1000& ]# ]! E5 d9 t8 h2 p
  44.         @pressed.push(key) if testkey(key)8 g/ a# E6 N0 ^) f9 N" a# f, k
  45.       end
    $ H% ?0 A6 Q$ k, e+ X5 y" U5 ?
  46.     end
    ! v' X% H( l% |- j) G1 i1 C
  47.     * `/ Y) d$ s% }0 S) v- _
  48.     def pressed?(key)
    : k8 J, W: r# O5 u* E5 D2 ]" {
  49.       key -= 1000
    ; o1 B5 _1 P, V* D# ]2 f# S
  50.       @pressed = [] if @pressed.nil?# a1 S( }4 k$ c; m( m
  51.       return true if @pressed.include?(key)
    0 i/ C8 E' [: o! Q) w2 z
  52.       return false3 H; q5 G/ n1 P  J: Y- k
  53.     end
    ; r" h: `" A6 V6 @$ I: q1 |
  54.    
    ( W9 Y+ G( O& I  ^9 m  h  f6 Q
  55.     alias hud_key_press? press?
    & F  U, r: k2 t( W. m8 P. v
  56.     def press?(key)5 O/ p/ k4 p7 `( {4 C
  57.       return pressed?(key) if key.to_f > 1000
    - [* Q6 X- I' _2 R- \
  58.       hud_key_press?(key)2 G2 ]  g' P  ?
  59.     end  s$ f# {' ?: D- l2 J
  60.   end
    + N! H. h+ }6 X7 q( J$ E
  61. end
    & e; v8 q4 n0 o1 D1 F+ v% ~
  62. + _* T9 _) P; }( t; u
  63. #===============================================================================2 m2 Y5 C) B& \
  64. # Game Player
    5 r: h, @% b: i$ e
  65. #===============================================================================9 E  s6 I+ O" f' n; V- G# D* H: k5 X0 T
  66. class Game_Player < Game_Character
    " a$ e8 a5 V$ U$ o$ z# E' ^- k0 O
  67.   attr_accessor :hud_equip
    9 ]% S& W) U0 ^3 @) ?
  68.   
    7 C0 \9 e; f' T
  69.   alias hot_key_hud_init initialize
    5 H) O9 f  J2 X& D$ ]7 S% b
  70.   def initialize8 i& A7 z# W2 B8 q
  71.     hot_key_hud_init
    # o- u2 }! W" S7 I
  72.     @hud_equip = []1 X; o+ j" j& ~  m" y5 P1 z
  73.   end
    ( H( S% z' {7 G- }' |+ n
  74.   
    ) j8 S9 o: p9 s7 t; q
  75.   def equip_item_to_hud(n, item)
    $ F) g8 d5 q, X0 h
  76.     if item.nil?
    ; M* @& z. r! X3 k' X7 y- m4 a+ z5 L& y
  77.       $game_system.se_play($data_system.buzzer_se)2 m' }! t" }0 [  J- A
  78.       return. c' |8 N" J8 G. J
  79.     end% b% V4 [; f$ Z5 Z. f. L! g3 N# C+ z! I
  80.     $game_system.se_play($data_system.decision_se)
    / e; z/ \+ h! X0 t7 @2 C7 O
  81.     @hud_equip[@hud_equip.index(item)] = nil if @hud_equip.include?(item)
    . s9 q1 b9 V5 O) s
  82.     @hud_equip[n] = item# O* w" r$ J7 J& t8 k3 `
  83.   end. k5 Z1 t( L; ?* {; s, z
  84. end
    7 l* Z3 {! {( a: k3 h
  85. ) E) Y6 n5 Y6 l. M6 b; h) R8 ^
  86. #===============================================================================
    * l5 v; P. D. H- J) }# W
  87. # Quick Skill Window
    3 J7 K. [2 O3 x* s* w
  88. #===============================================================================
    " ], }7 p: x* v1 _/ k9 r' |
  89. if XASVER_37 == false
    7 K% u' T) M; C: G
  90.   class Xas_Scene_Skill& Z+ R# p5 N- d
  91.     alias hud_quick_menu_main main1 w0 f$ y* o2 o, f. q6 H
  92.     def main
      W2 T6 \/ h0 ?. l0 H
  93.       @hot_key_hud = Hot_Key_HUD.new
    9 f9 T, w- g; s& z7 l& N; h
  94.       hud_quick_menu_main
    ( O1 `. n+ C9 c8 R: s" n8 ^$ o
  95.       @hot_key_hud.dispose1 y8 ~& ^! w& J
  96.     end
    6 b7 [: B2 C6 G1 n# q
  97.    
    2 M* h7 Z5 A  y. x% v- L/ K! ^
  98.     alias hotkey_hud_qucik_menu_update update, i, y4 C6 O% f0 @& U5 {
  99.     def update0 Q+ y* ?% R  [1 k9 k! }
  100.       hotkey_hud_qucik_menu_update
    5 }! x  l% q4 L4 i( r) u& v8 ]
  101.       # Hot Key num 1
    , a) @7 t5 V4 G3 U; r0 d) Z
  102.       if Input.press?(Input::Numkey[1])! @5 |$ u6 z: B5 O. b
  103.         $game_player.equip_item_to_hud(0, @skill_window.skill)
    ) j9 c9 F5 y9 ]# Z5 k( P6 u9 R* M( }
  104.       # Hot Key num 2
    5 F4 M5 y, l% G
  105.       elsif Input.press?(Input::Numkey[2])
    9 a1 _" R5 e, H# Q; ~) i( x# ]6 G! f
  106.         $game_player.equip_item_to_hud(1, @skill_window.skill)
    " `4 J) R. \9 y8 A0 P. \% Z' J1 P) S
  107.       # Hot Key num 31 W! g5 L7 W2 I
  108.       elsif Input.press?(Input::Numkey[3])
    5 [8 u8 o) d, o, k* g
  109.         $game_player.equip_item_to_hud(2, @skill_window.skill)3 r  |" ^* d( [+ O4 T4 n
  110.       # Hot Key num 4
    8 x/ b' }8 ?; b6 b* K9 `7 Y
  111.       elsif Input.press?(Input::Numkey[4])
    8 x5 s; L* B0 y7 ~
  112.         $game_player.equip_item_to_hud(3, @skill_window.skill)2 \  Z# }+ M7 M  |- {: K0 Q
  113.       # Hot Key num 5  {4 p+ W- a6 t2 z$ t- r! H, C+ V
  114.       elsif Input.press?(Input::Numkey[5])
    - Z2 H( K$ K* B
  115.         $game_player.equip_item_to_hud(4, @skill_window.skill)2 H( q. C5 p! y* i0 c
  116.       end
    ' k* e1 g0 M; i/ r: G6 Z, m8 {# K
  117.       @hot_key_hud.update
    - F4 o1 g- j7 \3 ^7 A$ N7 G4 R; z
  118.     end3 K0 ?. D( S6 ^' F
  119.   end. p+ j3 P8 d( e, Y
  120. else
    3 ]2 F4 m7 m+ T0 I8 T0 ^% C
  121.   class Quick_Menu_Skill4 a: y, P6 g/ g( k+ r; T- |. c
  122.     alias hud_quick_menu_main main2 J" }! y0 d. u0 y; \) x" G( \6 t
  123.     def main
    % a& c/ b# N% U& |1 R* l- t- L" a
  124.       @hot_key_hud = Hot_Key_HUD.new* K: i' ?8 [/ K# b0 h/ w# l5 U
  125.       hud_quick_menu_main; ]2 `+ g! X* j7 ~
  126.       @hot_key_hud.dispose6 k. q  ?+ H, @  b+ L' x9 \/ S) O2 t
  127.     end
    0 |, ^& N9 D0 f% z  R" v7 b
  128.     9 p" p5 e; b# E& A" z
  129.     alias hotkey_hud_qucik_menu_update update
    6 W9 M* {' T. Q* u: N# s: N
  130.     def update+ g" @4 o( T, S6 i
  131.       hotkey_hud_qucik_menu_update
    . S7 d* h* L* Q! I7 S8 o, R; A
  132.       # Hot Key num 1* B+ w6 u' l9 m5 ?& I" @) @
  133.       if Input.press?(Input::Numkey[1])
    . O. e+ l& P& r  P/ j
  134.         $game_player.equip_item_to_hud(0, @skill_window.skill)
    7 v4 Z5 h; A5 s) c8 ~* o' e1 B
  135.       # Hot Key num 21 A8 G1 X; h+ d  p
  136.       elsif Input.press?(Input::Numkey[2])6 E2 R0 K6 C4 t! _# c; d, S& k
  137.         $game_player.equip_item_to_hud(1, @skill_window.skill)6 X7 f. m* n. h& q3 t
  138.       # Hot Key num 3
    9 L' Z7 F0 i' c: m$ B1 `- U$ P
  139.       elsif Input.press?(Input::Numkey[3])
    + s+ f3 B) A- q
  140.         $game_player.equip_item_to_hud(2, @skill_window.skill). B" r$ d2 e8 I
  141.       # Hot Key num 4
    ! p. p+ ^7 L. q
  142.       elsif Input.press?(Input::Numkey[4])
    2 R" ?8 N* n8 I, P
  143.         $game_player.equip_item_to_hud(3, @skill_window.skill)
    1 V+ g* o/ w$ N/ \8 x
  144.       # Hot Key num 56 V' k0 c0 m  ^
  145.       elsif Input.press?(Input::Numkey[5])1 b5 d* t5 C& M, |" q4 a
  146.         $game_player.equip_item_to_hud(4, @skill_window.skill)3 |& D5 i7 q/ p4 e. f
  147.       end1 z$ n) ~3 u' s) f
  148.       @hot_key_hud.update
    6 a5 P) s; j8 M2 ?& i, k1 Z1 t
  149.     end
    ' n  A% ?  ?; v6 z# x- Y# f. J
  150.   end
    ) T. w8 e* e! Z; h) B3 F
  151. end
    ( y% |* L& ?" v- q
  152. ( C0 m, \) W3 |
  153. #===============================================================================
    9 }# [; q  Y$ [6 j$ H! Q
  154. # Quick Item Window, I5 l. k$ y* y: v% S
  155. #===============================================================================
    4 `- O4 L4 H+ W& `
  156. if XASVER_37 == false
    7 z2 U; L9 p+ U3 U, \# C. q  G( V
  157.   class Xas_Scene_Item# t6 X: u& X# b7 H$ B
  158.     alias hud_quick_menu_main main4 l* F9 l) ~' Y: `- p0 |( A: u6 Y8 H
  159.     def main8 M' d: }6 F# r/ R
  160.       @hot_key_hud = Hot_Key_HUD.new, ?; [" [; `; V7 x0 A
  161.       hud_quick_menu_main) g# q# e6 k3 `- I6 g1 o) V
  162.       @hot_key_hud.dispose6 {  ]3 ?9 d* {; ?1 R
  163.     end
    ) y2 X) Q# }5 s$ r
  164.    
    * \; V  |, A0 m3 l
  165.     alias hud_key_update update
    9 v9 ~& H9 Y/ a' t1 s, c8 b4 C$ `
  166.     def update1 I1 b2 [. |$ P" b
  167.       hud_key_update
    * ~* i; F% o& }6 m5 }7 j. @
  168.       # Hot Key num 1+ V& O4 J# v- W, E/ i& f* s; t$ @
  169.       if Input.press?(Input::Numkey[1])
    ( o3 d  C7 c2 f: s* x& d; G9 K
  170.         $game_player.equip_item_to_hud(0, @item_window.item)( t# o  U2 d9 A! ]+ Q6 x
  171.       # Hot Key num 2
    . _$ `5 o& @3 h  I) U1 P
  172.       elsif Input.press?(Input::Numkey[2])3 Z) K0 C9 C. f
  173.         $game_player.equip_item_to_hud(1, @item_window.item)4 C$ L/ H3 w7 ]2 n4 s; n/ P
  174.       # Hot Key num 35 A- W& I  X; F, n4 X9 \
  175.       elsif Input.press?(Input::Numkey[3])! A9 S9 l+ [' X" H3 g$ V( c
  176.         $game_player.equip_item_to_hud(2, @item_window.item)' H' \4 V$ u5 M* G' n
  177.       # Hot Key num 4
    % ?, H: |. m% W( t9 k0 o$ L
  178.       elsif Input.press?(Input::Numkey[4])% K. C2 Z4 @! m# W
  179.         $game_player.equip_item_to_hud(3, @item_window.item)) L  H7 S- U. G0 t! h+ c/ s" ]# f
  180.       # Hot Key num 5
    1 ?0 W" d5 w' m8 I3 W7 `; k
  181.       elsif Input.press?(Input::Numkey[5])2 r% W) s( [$ y5 P8 d% {) n
  182.         $game_player.equip_item_to_hud(4, @item_window.item)
    2 W! B& B/ e" h  i8 E2 O2 b* l
  183.       end3 x  c3 d( Z4 E9 O6 O, o2 h3 y' v
  184.       @hot_key_hud.update( k/ G/ K) M& G: p' n2 t! r
  185.     end# ]  ]1 t* R* V3 H  w3 U
  186.   end/ D. p7 y. Y0 a
  187. else1 E+ y  u; |0 Z1 V: V
  188.   class Quick_Menu_Item+ w1 x; _  p6 U8 |0 x
  189.     alias hud_quick_menu_main main
    ) [" H- B$ M8 q# R# S
  190.     def main
    5 m5 ^9 ]7 g2 g! @8 N9 y
  191.       @hot_key_hud = Hot_Key_HUD.new
    ( @# y' z2 w8 i: h# O
  192.       hud_quick_menu_main9 w8 F& c+ w3 W* P! f. C& t
  193.       @hot_key_hud.dispose' Z0 R( t7 F! E' e5 [  ]
  194.     end+ G! o" m8 \" K: G/ O! l
  195.    
      ^) I/ s( z( e0 e  D7 P
  196.     alias hud_key_update update8 ?' h2 u/ t3 ^' x8 ?
  197.     def update! u2 V5 v% a. o
  198.       hud_key_update
    ( a8 Z8 z+ F/ V9 I
  199.       # Hot Key num 1
    & c! D# R8 o; T
  200.       if Input.press?(Input::Numkey[1])5 f, g; S" }9 h! q. {( Z+ T
  201.         $game_player.equip_item_to_hud(0, @item_window.item)
    ( _& l2 T4 Y6 p9 A
  202.       # Hot Key num 2$ y& e3 D+ I! X8 ?( h3 d% x
  203.       elsif Input.press?(Input::Numkey[2])
    ( {* W, K9 o. @2 r2 r5 X
  204.         $game_player.equip_item_to_hud(1, @item_window.item)( X) ~! `! _2 E; }
  205.       # Hot Key num 37 H+ W  ?, t# V$ P7 F6 V3 ^2 e. a0 i
  206.       elsif Input.press?(Input::Numkey[3])
    / w+ a4 x6 @# F) {$ @9 R* B& i8 I
  207.         $game_player.equip_item_to_hud(2, @item_window.item)
    . q2 O$ Z/ H4 Q% z8 x
  208.       # Hot Key num 4
    2 S! |( t: _% u9 m0 Q) O/ U
  209.       elsif Input.press?(Input::Numkey[4])
    3 a# c3 Q2 D* T% S3 z" o
  210.         $game_player.equip_item_to_hud(3, @item_window.item)
    + W6 X7 y- L7 g, l2 f( P
  211.       # Hot Key num 5
    1 D5 u2 o# i; j! N* X1 A
  212.       elsif Input.press?(Input::Numkey[5])# X0 ~; A/ B8 ^* C; k
  213.         $game_player.equip_item_to_hud(4, @item_window.item); ^" J. d0 P. @2 q) k' l1 w, N
  214.       end
    7 f3 C2 |* A9 m5 J+ ~
  215.       @hot_key_hud.update8 A4 V9 o/ z* H; ?' u
  216.     end  w1 w5 ?# K6 {" X' [( p
  217.   end& a& b: M* a# E8 A8 s
  218. end5 @7 m6 R& M3 ~& O0 k  O4 `" O
  219. ' O7 _  D7 t" p7 S
  220. #===============================================================================
    ' l& Q( b$ }' ]! D) ^& t1 ]( F
  221. # HUD Window
    , j/ D7 }/ E7 \( \$ u. R) ^- c. P
  222. #===============================================================================1 L- O* A' D4 p
  223. class Hot_Key_HUD < Window_Base
    + m( X8 X0 m6 H& R  M
  224.   def initialize(x = HUD_X - 10, y = HUD_Y - 15)
    $ p1 j$ a  {! @. E( b) X8 X) v
  225.     super(x, y, 220, 80)4 d. n$ B! K  L! b4 {+ O
  226.     self.contents = Bitmap.new(width - 32, height - 32)3 t) Q; U0 t  r5 z' M
  227.     self.opacity = 0$ }( I- e& d& L$ Q# N' m
  228.     @actor = $game_party.actors[0]
    % R& U& r7 X" h% o) [' m/ ?% ^
  229.     refresh* H% R" D" y7 e6 Z3 H6 n9 T. D
  230.   end1 W( \. O9 S5 a2 }
  231. 3 ~' E( t4 o' r0 s3 L% N7 _  ]0 d
  232.   def refresh, N0 w" C2 Z  e4 H6 V
  233.     self.contents.clear) J- j7 E- C; G; K% x
  234.     bitmap = RPG::Cache.picture("Hot_Keys_HUD"), b3 @& R5 s- P. w" K& O- Z
  235.     self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 160, 32))7 Q) R7 z1 W) ?* N- w5 d" Y# k
  236.     for i in 0..4# `  O) ?: t* b+ Z+ x
  237.       x = 32 * i + 4$ c+ [3 y, I; k4 }; n4 v* |
  238.       item = $game_player.hud_equip[i]
    0 h: z- l' y8 E3 c; q4 T: @  r
  239.       next if item.nil?  n  H; U, v- X6 e
  240.       if item.is_a?(RPG::Weapon), e1 @0 Y: l  F- T
  241.         item = nil if $game_party.weapon_number(item.id) == 0 and
    8 o" D! O, A1 |( t% w/ R
  242.           @actor.weapon_id != item.id5 y5 f, x* {% `& W+ h! }1 Q4 \
  243.       elsif item.is_a?(RPG::Armor)
    : B$ U; z8 q' `. ~3 u1 w! _; d
  244.         item = nil if $game_party.armor_number(item.id) == 0 and ! G  {5 t% |- Q# s, K- ]# J* f4 C$ O5 x
  245.           @actor.armor1_id != item.id) r( s8 Y& |2 j$ K/ W$ ]8 k
  246.       elsif item.is_a?(RPG::Item)% \, a" _8 X2 f
  247.         item = nil if $game_party.item_number(item.id) == 0 or6 O' ], n% v1 V' y* f
  248.           !$game_party.item_can_use?(item.id)
      h3 U6 Z# a( D, t3 `% I
  249.       end
    , R8 q& w# g9 W: W
  250.       bitmap = RPG::Cache.icon(item.icon_name)! J$ A8 a: d) N% k
  251.       self.contents.blt(x, 4, bitmap, Rect.new(0, 0, 24, 24))- z/ B5 q. [0 O! {9 X
  252.     end
    " H' A: j& m% [
  253.   end, w4 l, I7 O# H  z
  254.   * Z( G) J. ]2 f0 v4 u# _
  255.   def equip(item)
    0 h* a+ f9 l$ }  H
  256.     if item.nil?5 K5 p1 e% O4 B7 E- z; _
  257.       $game_system.se_play($data_system.buzzer_se)2 y; V- d) E2 c3 }1 w
  258.       return% {; d) @7 b, i/ G
  259.     end  M& Q! L' y6 J  K; H
  260.     if item.is_a?(RPG::Skill): M) L6 S% E- D# Q
  261.       if [email protected]_can_use?(item.id)
    1 G* q) j* ]& G- ?, l
  262.         $game_system.se_play($data_system.buzzer_se)
    " q2 s7 o! k. L+ `$ O
  263.         return
    - z. P1 @* }% ]+ Y0 t; U
  264.       end
    / i  _9 H1 H/ U. H' b
  265.       $game_system.xas_skill_id = item.id5 B2 p2 s4 t/ U+ g, }$ L0 c# ]
  266.     elsif item.is_a?(RPG::Weapon)
    " Z2 k4 x6 k4 q& d( u
  267.       @actor.equip(0, item.id). `4 y- u" k/ ?9 u  g
  268.     elsif item.is_a?(RPG::Armor)( P; g3 T# c8 N7 ^4 O! l
  269.       @actor.equip(1, item.id)
      V4 O  V! q* q# Z. \9 g0 \
  270.     elsif item.is_a?(RPG::Item)
    5 H4 y- P7 q' Q3 B, B& I1 f, S5 w
  271.       item_tool_id = XAS::XASITEM_ID[item.id]" B0 c" o  @' E. U: ?, v' X
  272.       if item_tool_id != nil
    - h) s! d; T$ ^5 A0 I
  273.         unless $game_party.item_can_use?(item.id)
    ' L( Z7 f% e2 |7 I1 K
  274.           $game_system.se_play($data_system.buzzer_se)
    * L1 A6 v$ x" R
  275.           return
    / X% b( J* u" U: S
  276.         end( K( S# Q5 ?& E" P2 |
  277.         $game_system.xas_item_id = item.id8 o: z8 ^/ \2 ?# P
  278.       end
    " B1 J) M7 _# L8 b
  279.     end. y( i9 q; o5 g0 b" `; j& j7 c5 D
  280.     $game_system.se_play($data_system.equip_se)( q( ?; l3 ?3 s* F! P# H" o
  281.   end8 s8 `$ M3 d- p  L& r3 l
  282.   
    ; I/ P' I. P) ?2 A6 F
  283.   def update
    # M2 F9 Y; V4 U; `/ n: _( f
  284.     @actor = $game_party.actors[0]* B4 V$ d% y% o3 T
  285.     @hot_keys = $game_player.hud_equip
    ' k! k; o+ I% G/ `, f4 v4 E
  286.     refresh
    ! Q0 b9 N8 i/ J( r- l
  287.     return if !$scene.is_a?(Scene_Map)
    5 \. Y8 w* F0 `
  288.     if Input.press?(Input::Numkey[1])
    0 s7 K- D# o# E# c5 j5 d2 q
  289.       equip($game_player.hud_equip[0])
    ' s' i; W( m$ e. C; D& u8 E
  290.     elsif Input.press?(Input::Numkey[2])  i# r  B0 p. X! I
  291.       equip($game_player.hud_equip[1])7 @, L9 L. t" i7 \! C7 S
  292.     elsif Input.press?(Input::Numkey[3])
      m  I$ O# ]5 J& f6 B7 o5 G
  293.       equip($game_player.hud_equip[2]) 9 r5 A# s9 y! z5 f/ Y- t
  294.     elsif Input.press?(Input::Numkey[4])7 E; e- K- {( P( A4 a
  295.       equip($game_player.hud_equip[3])
    ) L. C" t1 G" ]4 f
  296.     elsif Input.press?(Input::Numkey[5])% Z8 }) ~7 r+ f/ _' `! x' a! C
  297.       equip($game_player.hud_equip[4])
    . }2 ~( O& w9 }; L( p
  298.     end5 }* Z  ~1 E# L6 j$ r$ d
  299.   end
    8 b. v2 @! I) |& r: R5 F
  300. end8 p/ [% L' J8 `& {8 o- S/ y

  301. * g( d2 `" R" C7 k% d5 Y
  302. #===============================================================================
    1 v4 m7 X+ k+ N! J" W$ J" `
  303. # Scene Map
    # N; L( f' I0 n
  304. #===============================================================================
    # t" r8 P. T! Z1 T6 Z  i- M
  305. class Scene_Map
    " z1 d1 U7 M, N8 M3 V# [- A( z
  306.   alias hot_key_hud_init main6 s0 l  R1 T: K1 l  P" }/ w
  307.   def main
    ( O  T7 f8 A1 @, E* D
  308.     @hot_key_hud = Hot_Key_HUD.new( Y& p/ Z2 I$ R  g$ L% F9 t' Y# V
  309.     @hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH]) H& `1 q* ~$ k  Z* P3 s- |
  310.     hot_key_hud_init
    + y: V1 m/ M% k4 T9 R
  311.     @hot_key_hud.dispose
    3 K' N* h- f# N% V4 C% E9 w+ ~0 f
  312.   end
    5 B; E% N" B. R& v
  313.   
    : A4 @! r7 {$ h0 B& q3 M1 a1 I
  314.   alias hot_key_hud_update update) ?8 `" B  r8 _8 N: E8 G
  315.   def update  k3 M& `- g+ g8 H% [. Y
  316.     hot_key_hud_update5 Y3 H/ w8 c; y
  317.     @hot_key_hud.update0 v+ s( s5 W( ?- F' t8 W
  318.     @hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH]
    0 V6 f, L, T% I$ h7 v' R1 @
  319.     @hot_key_hud.update if !$game_switches[XAS_HUDDISABLE_HUD_SWITCH]1 Y( n2 U- Y/ B. x
  320.   end8 l- `5 k+ @  x
  321. end
复制代码

作者: ML4455739    时间: 2012-3-31 20:23
本帖最后由 ML4455739 于 2012-3-31 20:23 编辑
9 U& n' o. A- z$ `) ?, f5 v
6 B- p! F( `: {( ~问题是什么?应该不会是缺失文件吧?.....  k4 ]+ Y4 d% u$ V: f8 W
# m; z5 t( S" p) V' _
有关XAS_HUDDISABLE_HUD_SWITCH的我看了一下,0 Z! Y5 {  c8 y3 a- S
因为没下过脚本所提及的XAS版本不清楚内部结构,; S& ~4 {+ H+ X6 h5 Y& A

4 N: u9 ~( q  D. q7 E这个可能是XAS版本不同或者是个非独立的脚本,即以下两种出错可能
$ C+ h- g, m' ~) t- @1.本脚本只适用于XAS 3.7f版本或 XAS 3.6版本
. t* M( x/ @/ \2.这个脚本是从别的完整游戏中提取的,需要其他相关脚本的支持
作者: timmyyayaya    时间: 2012-4-4 15:19
版本确实是不一样,7 Z0 v' S; S: K& {, v( D
跳出的错误讯息- I( e8 W, h  q. I
这行item = $game_player.hud_equip[i]
2 V9 [& \7 H7 |) F8 cNoMethodError undefined method `[]’ for nil:Class 4 D  P( O9 X: B3 h! j( e5 E3 c
是否有办法整合呢?
作者: ML4455739    时间: 2012-4-4 15:49
本帖最后由 ML4455739 于 2012-4-4 15:50 编辑
, A- t5 ~- c7 q8 l3 S
5 j& U* d$ R2 W- _- H3.91我不清楚用了哪些脚本想整合起来很困难。。
% X# `  c' D+ O0 h& A先在238行上面加上
  1. p $game_player.hud_equip
复制代码
看返回些啥,如果是nil的话,估计是75~82行出了问题。
作者: ML4455739    时间: 2012-4-4 15:58
timmyyayaya 发表于 2012-4-4 15:19
/ Q; c* A% r" z, W版本确实是不一样,( z, @8 M& Y& R9 T
跳出的错误讯息+ o% A! R7 D" a
这行item = $game_player.hud_equip
, @3 e, N; r8 ~1 [
顺便一下,我使用默认XAS 3.82的,经过微调可以直接使用,且功效完全正常。
作者: ML4455739    时间: 2012-4-5 20:12
本帖最后由 ML4455739 于 2012-4-5 20:13 编辑
; s3 i& k) k1 J2 q2 ~7 {8 A! A4 z8 m
82行的
  1. @hud_equip[n] = item
复制代码
加一行变为:
  1. 0 _. h  b; |- B6 E' @6 q" n3 S
  2. p @hud_equip;p n;p item
    4 ?4 q2 M, u% E7 `
  3. @hud_equip[n] = item
复制代码
会弹出三个框,再次检验其返回值,若有任何一个是nil,
' h$ [1 j  \; A/ E. j8 j根据测试得出的结论,肯定是冲突了。" U% e! P9 y5 o$ l* B" Q
$ d8 i6 P+ K$ b' T* `1 ]( [
请LZ有耐心,如果不发工程的话,想整合脚本需要不少步骤多次检验。
作者: ML4455739    时间: 2012-4-6 20:29
本帖最后由 ML4455739 于 2012-4-6 20:31 编辑
0 l+ ]5 I, b9 ^/ C3 U
0 n3 Q3 Q' ?7 S5 i1 m! q: @1 H本来一开始没发现这个问题我就很疑惑的,
- Y5 E" ^; H7 h" d, |+ ~现在XAS_HUDDISABLE_HUD_SWITCH终于出现了!
  1. HUD_X = 0 # X pos of HUD8 o8 J% s7 h2 r( J" {+ D0 ~
  2. HUD_Y = 0 # Y pos of HUD
复制代码
20行附近有这个吧,在这下面加一行:
  1. XAS_HUDDISABLE_HUD_SWITCH = 5
复制代码
实质是通过5号开关决定热键启用。" Q4 q4 E7 m+ {' v0 b) B5 r
+ E2 l8 V, R7 a2 N6 s
再看看还有没有其他问题。
作者: timmyyayaya    时间: 2012-4-13 09:51
有了新的热键接口,旧的热键图标和功能是不是要拿掉?
作者: ML4455739    时间: 2012-4-13 20:35
这个是扩展而不是替换
' L' B, f/ @' ]! a/ U7 _/ C1 ?7 V+ Y按W打开Extra Skill后按字母键盘上方的数字即可使用。
作者: timmyyayaya    时间: 2012-4-14 13:49
竟然是这样的使用方式…1 [9 ^9 m3 b- z/ B5 d. ~3 F
没有办法直接按该热键就放技能吗?
作者: ML4455739    时间: 2012-4-14 18:27
本帖最后由 ML4455739 于 2012-4-14 20:02 编辑
9 [( [" K- @$ U4 ?+ v3 n
1 v0 R6 l! C. i  r5 l1 \/ }" R/ X在Extra Skill里按1~5是设置' ^4 U8 f) d. Q/ ^% _5 R) q
设置好后回到地图按1~5就是……切换。
0 h3 Z( v! x) ^& _% T% I; S$ R: R. y1 K% X6 J
请问是要改成直接使用吗?9 ?; p5 c5 f! u( H4 h9 S1 \+ Q
[line]4[/line]& Q6 h- |+ t5 z3 R
那就用这个吧、记得改XAS_HUDDISABLE_HUD_SWITCH。+ V! \; T" ^+ ~8 W$ F0 }* K
RUBY 代码复制
  1. #===============================================================================
  2. # XAS - Hot Key HUD
  3. #===============================================================================
  4. # By Mr_Wiggles
  5. # Version 1.3
  6. # 7/6/10
  7. #-------------------------------------------------------------------------------
  8. # Instructions:
  9. #  Fill in the constants bellow, paste this script above main and bellow XAS in
  10. #  your script data base. BE SURE TO SET TO THE RIGHT XAS VERSION!!
  11. #
  12. #  Place the "Hot_Keys_HUD" picture file into your game directory
  13. #  Graphics/Pictures folder.
  14. #-------------------------------------------------------------------------------
  15. # Directions of Use:
  16. #  Simple just press a number key (1 - 5) when the quick skill or item menu is
  17. #  Showing.
  18. #===============================================================================
  19. HUD_X = 0 # X pos of HUD
  20. HUD_Y = 0 # Y pos of HUD
  21. XAS_HUDDISABLE_HUD_SWITCH = 1
  22.  
  23. # Set true  if XAS 3.7f
  24. # set false if XAS 3.6
  25. XASVER_37 = true
  26.  
  27. #===============================================================================
  28. # Numkeys Module
  29. #===============================================================================
  30. module Input
  31.   Numkey = {1 => 1049, 2 => 1050, 3 => 1051, 4 => 1052, 5 => 1053}
  32.   class << self
  33.     Key = Win32API.new('user32','GetAsyncKeyState',['i'],'i')
  34.  
  35.     def testkey(key)
  36.       Key.call(key) & 0x01 == 1
  37.     end
  38.  
  39.     alias hud_key_update update
  40.     def update
  41.       hud_key_update
  42.       @pressed = []
  43.       for key in Numkey.values
  44.         key -= 1000
  45.         @pressed.push(key) if testkey(key)
  46.       end
  47.     end
  48.  
  49.     def pressed?(key)
  50.       key -= 1000
  51.       @pressed = [] if @pressed.nil?
  52.       return true if @pressed.include?(key)
  53.       return false
  54.     end
  55.  
  56.     alias hud_key_press? press?
  57.     def press?(key)
  58.       return pressed?(key) if key.to_f > 1000
  59.       hud_key_press?(key)
  60.     end
  61.   end
  62. end
  63.  
  64. #===============================================================================
  65. # Game Player
  66. #===============================================================================
  67. class Game_Player < Game_Character
  68.   attr_accessor :hud_equip
  69.   attr_accessor :hud_item_id
  70.   attr_accessor :hud_skill_id
  71.  
  72.   alias hot_key_hud_init initialize
  73.   def initialize
  74.     hot_key_hud_init
  75.     @hud_equip = []
  76.     @hud_item_id = []
  77.     @hud_skill_id = []
  78.   end
  79.  
  80.   def equip_item_to_hud(n, item)
  81.     if item.nil?
  82.       $game_system.se_play($data_system.buzzer_se)
  83.       return
  84.     end
  85.     $game_system.se_play($data_system.decision_se)
  86.     @hud_equip[@hud_equip.index(item)] = nil if @hud_equip.include?(item)
  87.     @hud_equip[n] = item
  88.     @hud_item_id[n] = XAS::XASITEM_ID[item.id]
  89.     @hud_skill_id[n] = item.id
  90.   end
  91. end
  92.  
  93. #===============================================================================
  94. # Quick Skill Window
  95. #===============================================================================
  96. if XASVER_37 == false
  97.   class Xas_Scene_Skill
  98.     alias hud_quick_menu_main main
  99.     def main
  100.       @hot_key_hud = Hot_Key_HUD.new
  101.       hud_quick_menu_main
  102.       @hot_key_hud.dispose
  103.     end
  104.  
  105.     alias hotkey_hud_qucik_menu_update update
  106.     def update
  107.       hotkey_hud_qucik_menu_update
  108.       # Hot Key num 1
  109.       if Input.press?(Input::Numkey[1])
  110.         $game_player.equip_item_to_hud(0, @skill_window.skill)
  111.       # Hot Key num 2
  112.       elsif Input.press?(Input::Numkey[2])
  113.         $game_player.equip_item_to_hud(1, @skill_window.skill)
  114.       # Hot Key num 3
  115.       elsif Input.press?(Input::Numkey[3])
  116.         $game_player.equip_item_to_hud(2, @skill_window.skill)
  117.       # Hot Key num 4
  118.       elsif Input.press?(Input::Numkey[4])
  119.         $game_player.equip_item_to_hud(3, @skill_window.skill)
  120.       # Hot Key num 5
  121.       elsif Input.press?(Input::Numkey[5])
  122.         $game_player.equip_item_to_hud(4, @skill_window.skill)
  123.       end
  124.       @hot_key_hud.update
  125.     end
  126.   end
  127. else
  128.   class Quick_Menu_Skill
  129.     alias hud_quick_menu_main main
  130.     def main
  131.       @hot_key_hud = Hot_Key_HUD.new
  132.       hud_quick_menu_main
  133.       @hot_key_hud.dispose
  134.     end
  135.  
  136.     alias hotkey_hud_qucik_menu_update update
  137.     def update
  138.       hotkey_hud_qucik_menu_update
  139.       # Hot Key num 1
  140.       if Input.press?(Input::Numkey[1])
  141.         $game_player.equip_item_to_hud(0, @skill_window.skill)
  142.       # Hot Key num 2
  143.       elsif Input.press?(Input::Numkey[2])
  144.         $game_player.equip_item_to_hud(1, @skill_window.skill)
  145.       # Hot Key num 3
  146.       elsif Input.press?(Input::Numkey[3])
  147.         $game_player.equip_item_to_hud(2, @skill_window.skill)
  148.       # Hot Key num 4
  149.       elsif Input.press?(Input::Numkey[4])
  150.         $game_player.equip_item_to_hud(3, @skill_window.skill)
  151.       # Hot Key num 5
  152.       elsif Input.press?(Input::Numkey[5])
  153.         $game_player.equip_item_to_hud(4, @skill_window.skill)
  154.       end
  155.       @hot_key_hud.update
  156.     end
  157.   end
  158. end
  159.  
  160. #===============================================================================
  161. # Quick Item Window
  162. #===============================================================================
  163. if XASVER_37 == false
  164.   class Xas_Scene_Item
  165.     alias hud_quick_menu_main main
  166.     def main
  167.       @hot_key_hud = Hot_Key_HUD.new
  168.       hud_quick_menu_main
  169.       @hot_key_hud.dispose
  170.     end
  171.  
  172.     alias hud_key_update update
  173.     def update
  174.       hud_key_update
  175.       # Hot Key num 1
  176.       if Input.press?(Input::Numkey[1])
  177.         $game_player.equip_item_to_hud(0, @item_window.item)
  178.       # Hot Key num 2
  179.       elsif Input.press?(Input::Numkey[2])
  180.         $game_player.equip_item_to_hud(1, @item_window.item)
  181.       # Hot Key num 3
  182.       elsif Input.press?(Input::Numkey[3])
  183.         $game_player.equip_item_to_hud(2, @item_window.item)
  184.       # Hot Key num 4
  185.       elsif Input.press?(Input::Numkey[4])
  186.         $game_player.equip_item_to_hud(3, @item_window.item)
  187.       # Hot Key num 5
  188.       elsif Input.press?(Input::Numkey[5])
  189.         $game_player.equip_item_to_hud(4, @item_window.item)
  190.       end
  191.       @hot_key_hud.update
  192.     end
  193.   end
  194. else
  195.   class Quick_Menu_Item
  196.     alias hud_quick_menu_main main
  197.     def main
  198.       @hot_key_hud = Hot_Key_HUD.new
  199.       hud_quick_menu_main
  200.       @hot_key_hud.dispose
  201.     end
  202.  
  203.     alias hud_key_update update
  204.     def update
  205.       hud_key_update
  206.       # Hot Key num 1
  207.       if Input.press?(Input::Numkey[1])
  208.         $game_player.equip_item_to_hud(0, @item_window.item)
  209.       # Hot Key num 2
  210.       elsif Input.press?(Input::Numkey[2])
  211.         $game_player.equip_item_to_hud(1, @item_window.item)
  212.       # Hot Key num 3
  213.       elsif Input.press?(Input::Numkey[3])
  214.         $game_player.equip_item_to_hud(2, @item_window.item)
  215.       # Hot Key num 4
  216.       elsif Input.press?(Input::Numkey[4])
  217.         $game_player.equip_item_to_hud(3, @item_window.item)
  218.       # Hot Key num 5
  219.       elsif Input.press?(Input::Numkey[5])
  220.         $game_player.equip_item_to_hud(4, @item_window.item)
  221.       end
  222.       @hot_key_hud.update
  223.     end
  224.   end
  225. end
  226.  
  227. #===============================================================================
  228. # HUD Window
  229. #===============================================================================
  230. class Hot_Key_HUD < Window_Base
  231.   def initialize(x = HUD_X - 10, y = HUD_Y - 15)
  232.     super(x, y, 220, 80)
  233.     self.contents = Bitmap.new(width - 32, height - 32)
  234.     self.opacity = 0
  235.     @actor = $game_party.actors[0]
  236.     refresh
  237.   end
  238.  
  239.   def refresh
  240.     self.contents.clear
  241.     bitmap = RPG::Cache.picture("Hot_Keys_HUD")
  242.     self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 160, 32))
  243.     for i in 0..4
  244.       x = 32 * i + 4
  245.       item = $game_player.hud_equip[i]
  246.       next if item.nil?
  247.       if item.is_a?(RPG::Weapon)
  248.         item = nil if $game_party.weapon_number(item.id) == 0 and
  249.           @actor.weapon_id != item.id
  250.       elsif item.is_a?(RPG::Armor)
  251.         item = nil if $game_party.armor_number(item.id) == 0 and
  252.           @actor.armor1_id != item.id
  253.       elsif item.is_a?(RPG::Item)
  254.         item = nil if $game_party.item_number(item.id) == 0 or
  255.           !$game_party.item_can_use?(item.id)
  256.       end
  257.       bitmap = RPG::Cache.icon(item.icon_name)
  258.       self.contents.blt(x, 4, bitmap, Rect.new(0, 0, 24, 24))
  259.     end
  260.   end
  261.  
  262.   def equip(item)
  263.     if item.nil?
  264.       $game_system.se_play($data_system.buzzer_se)
  265.       return
  266.     end
  267.     if item.is_a?(RPG::Skill)
  268.       if !@actor.skill_can_use?(item.id)
  269.         $game_system.se_play($data_system.buzzer_se)
  270.         return
  271.       end
  272.       #$game_system.xas_skill_id = item.id
  273.       @item_type = false
  274.     elsif item.is_a?(RPG::Weapon)
  275.       @actor.equip(0, item.id)
  276.     elsif item.is_a?(RPG::Armor)
  277.       @actor.equip(1, item.id)
  278.     elsif item.is_a?(RPG::Item)
  279.       item_tool_id = XAS::XASITEM_ID[item.id]
  280.       if item_tool_id != nil
  281.         unless $game_party.item_can_use?(item.id)
  282.           $game_system.se_play($data_system.buzzer_se)
  283.           return
  284.         end
  285.         #$game_system.xas_item_id = item.id
  286.         @item_type = true
  287.       end
  288.     end
  289.     #$game_system.se_play($data_system.equip_se)
  290.   end
  291.  
  292.   def use_hud_item(i)
  293.     if @item_type
  294.     $game_temp.force_action_id = $game_player.hud_item_id[i]
  295.     else
  296.     $game_temp.force_action_id = $game_player.hud_skill_id[i]
  297.     end
  298.   end
  299.  
  300.   def update
  301.     @actor = $game_party.actors[0]
  302.     @hot_keys = $game_player.hud_equip
  303.     refresh
  304.     return if !$scene.is_a?(Scene_Map)
  305.     if Input.press?(Input::Numkey[1])
  306.       equip($game_player.hud_equip[0])
  307.       use_hud_item(0)
  308.     elsif Input.press?(Input::Numkey[2])
  309.       equip($game_player.hud_equip[1])
  310.       use_hud_item(1)
  311.     elsif Input.press?(Input::Numkey[3])
  312.       equip($game_player.hud_equip[2])
  313.       use_hud_item(2)
  314.     elsif Input.press?(Input::Numkey[4])
  315.       equip($game_player.hud_equip[3])
  316.       use_hud_item(3)
  317.     elsif Input.press?(Input::Numkey[5])
  318.       equip($game_player.hud_equip[4])
  319.       use_hud_item(4)
  320.     end
  321.   end
  322. end
  323.  
  324. #===============================================================================
  325. # Scene Map
  326. #===============================================================================
  327. class Scene_Map
  328.   alias hot_key_hud_init main
  329.   def main
  330.     @hot_key_hud = Hot_Key_HUD.new
  331.     @hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH]
  332.     hot_key_hud_init
  333.     @hot_key_hud.dispose
  334.   end
  335.  
  336.   alias hot_key_hud_update update
  337.   def update
  338.     hot_key_hud_update
  339.     @hot_key_hud.update
  340.     @hot_key_hud.visible = !$game_switches[XAS_HUDDISABLE_HUD_SWITCH]
  341.     @hot_key_hud.update if !$game_switches[XAS_HUDDISABLE_HUD_SWITCH]
  342.   end
  343. end

作者: timmyyayaya    时间: 2012-4-15 02:02
感谢,这样技能就可以直接施放了!
# a- \+ S: t: H7 g5 V  I' l7 f不过,我发现使用这些热键施放技能,
$ D" J+ a, t9 K' C2 q% q# Z2 O  }- H原本有咏唱时间的技能,会变成瞬发技能
作者: ML4455739    时间: 2012-4-15 07:39
本帖最后由 ML4455739 于 2012-4-15 16:47 编辑 5 C+ T8 q0 J1 b* W; T0 U

7 A. T0 S9 x# i. J此楼已废。
作者: timmyyayaya    时间: 2012-4-15 15:24
只找到def use_hud_item(i)1 I8 p6 P: f% h' y
其他都没有
作者: ML4455739    时间: 2012-4-15 15:27
看来是版本的差异了,
: Z: M9 c! X: i# f& }6 H我用的苦逼的XAS3.82。得,我找3.91去
作者: timmyyayaya    时间: 2012-4-15 15:59
一樣都沒有...
  t+ @0 N" @5 D% ^! q' a我用的是15楼的- [9 r2 i' [( K  k6 G- w
15楼的腳本找不到
  n7 o" H0 _. r8 o
作者: timmyyayaya    时间: 2012-4-15 16:36
刚才修完以后,一进入游戏角色就向后跳跃,接着就卡住不能动弹了,
  U9 t3 }/ ]; b! I" O; b9 {要修的地方应该都没修错。
作者: ML4455739    时间: 2012-4-15 16:55
本帖最后由 ML4455739 于 2012-4-15 16:57 编辑 . d% v4 p( X3 w+ u  S
class Game_Player < Game_Character # A4 \7 U1 X7 y1 c3 w$ B/ C  z
#--------------------------------------------------------------------------) P6 A: E7 W/ @, F
# ● Update Command
9 G5 I/ V. \( k  J5 I! `$ T #--------------------------------------------------------------------------  
- ?3 i5 j0 N" o. l9 z& l def update_command
- M1 y( h- g5 a1 N8 q
在XAS - Battler 1的140行左右找到这一段吧,
% m' i" G8 W4 g, s' c8 B% N9 d% A$ z在def update_command上方加俩个
  1.     @hothey_skill = (Input.trigger?(XAS_COMMAND::SKILL_ACTION) or $command_skill != 0)
    & `1 K) q: T1 W, z" `! N$ y, G
  2.   @hothey_item = (Input.trigger?(XAS_COMMAND::ITEM_ACTION) or $command_item != 0)9 u8 C+ r7 e# E

  3. 2 o* `' b" Z3 Q3 z. m% ]4 `
复制代码
然后替换elsif的条件,附近差不多改成这个样子:
  1. class Game_Player < Game_Character 5 X' t7 q2 L, t
  2.     i) W  p& k! b! l: E+ A
  3.     @hothey_skill = (Input.trigger?(XAS_COMMAND::SKILL_ACTION) or $command_skill != 0)
    3 H0 |4 u! r0 o( \$ W7 J2 s
  4.   @hothey_item = (Input.trigger?(XAS_COMMAND::ITEM_ACTION) or $command_item != 0)/ I* C0 d9 H# u; E% ~& M3 n2 Z
  5. ! \0 C+ q! {& `9 p# a% R
  6.   
    : i5 \) v# i0 m. H0 n1 Z
  7. #--------------------------------------------------------------------------
    7 R# Z3 ~( @: G6 J
  8. # ● Update Command* h! e, O7 h2 N3 g  d. T5 }% q
  9. #--------------------------------------------------------------------------  8 v" q' y; _* d- r8 w1 }: }' \
  10. def update_command
    ) v- x& d9 i. m, g$ R" U* s
  11.      if Input.trigger?(XAS_COMMAND::ATTACK_ACTION1)   
    + r8 P0 r1 ~3 ^5 p
  12.         active_attack #ATTACK   
    : `1 f- Y- a& o0 x
  13.      elsif @hothey_skill
    7 g, M# U' z* g) f6 x0 \, k
  14.         active_skill  #SKILL: W# r) J) w, `
  15.      elsif Input.trigger?(XAS_COMMAND::ATTACK_ACTION2)
    + v  I* i1 V$ ]5 Q4 E
  16.         active_shield #SHIELD
    " _7 v- t# j# O
  17.      elsif @hothey_item
      l1 w2 J" u. ?/ \+ ^: e; U
  18.         active_item   #ITEM" R9 o1 i3 s. J3 z0 v  Y* e
  19.      elsif Input.trigger?(XAS_COMMAND::DASH_BUTTON)  
    % e" F) h" A( Z7 V
  20.         active_dodge  #DODGE7 b  O, D) l3 j+ g' r1 a$ n) ~
  21.      elsif Input.trigger?(XAS_COMMAND::SKILL_CHANGE)  F4 U- r% h" b3 \
  22.         if $game_system.quick_menu and can_call_menu? #Quik Menu Skill   
    , }% k, M+ O, [4 V/ ^& H
  23.            $scene = Quick_Menu_Skill.new
    $ A) h6 w7 e: e& k! p# s) d
复制代码
再试一下。3.91的这种结构对我这种脚本风实在苦手……
作者: timmyyayaya    时间: 2012-4-15 17:05
本帖最后由 timmyyayaya 于 2012-4-15 17:32 编辑
5 X' p8 \3 r1 [; O" R
+ K2 A( I( i/ z+ \( R所以目前XAS - Battler 1是修正成这样,游戏中不会向后跳了,
& y1 A- L5 Y4 ?) X# `" V不过热键装上去后,发不出技能?
5 G. x( a: P) m& P8 W是因为我原本15楼的修正拿掉的关系吗?
$ G$ E+ x! V: |5 j1 ?还是15楼的脚本已经不需要?
作者: ML4455739    时间: 2012-4-15 17:13
= =理论派吃亏了……/ o9 X8 ^3 Y5 T( w
3 a! j" e& N+ a1 @9 G# `
LZ你看这样行不,只复制个Data里的Scripts.rxdata文件给我,4 H3 F* A8 ?, e- M
我想这样直接些,一点点看着改的话要浪费很多时间。
作者: timmyyayaya    时间: 2012-4-15 17:29
本帖最后由 timmyyayaya 于 2012-4-15 20:46 编辑
& L6 l# q# g1 j
3 Q: V+ z* r4 a: Q! i8 U好的
作者: ML4455739    时间: 2012-4-15 18:26
RUBY 代码复制
  1. # ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■
  2. #===============================================================================
  3. # BATTLER / SENSOR RANGE / PLAYER COMMANDS / ENEMY COMMANDS
  4. #===============================================================================
  5. # ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■
  6.  
  7.  
  8.  
  9.  
  10. #===============================================================================
  11. # ■ SENSOR  
  12. #===============================================================================
  13. module XRXS_EnemySensor
  14.  
  15. #--------------------------------------------------------------------------
  16. # ● Update Sensor
  17. #--------------------------------------------------------------------------
  18. def update_sensor
  19.      return if self.dead? or self.erased or self.tool_id > 0
  20.      if self.battler.is_a?(Game_Actor)
  21.         enemy_sensor = 4
  22.      else
  23.         enemy_sensor =  XAS_BA_ENEMY::ENEMY_SENSOR[self.battler.id]
  24.      end  
  25.      if self.battler != nil and self.battler.sensor_range > 0  
  26.         @sensor_range = enemy_sensor  
  27.      else  
  28.        @sensor_range = $game_variables[XAS_BA_ENEMY::DEFAULT_ENEMY_SENSOR_VARIABLE_ID]
  29.      end     
  30.     @sensor_range = -1 if self.battler != nil and cancel_sensor?   
  31.     distance = ($game_player.x - self.x).abs + ($game_player.y - self.y).abs
  32.     enable   = (distance <= @sensor_range)
  33.     key = [$game_map.map_id, self.id, XAS_BA::SENSOR_SELF_SWITCH]
  34.     last_enable = $game_self_switches[key]
  35.     last_enable = false if last_enable == nil
  36.     if enable
  37.        self.range_type = 0
  38.     else  
  39.        self.range_type = 1
  40.     end      
  41.     if enable != last_enable
  42.        self.action_times = 0
  43.        $game_self_switches[key] = enable
  44.        attack_off if self.battler != nil
  45.        self.refresh
  46.     end
  47.   end
  48.  
  49. #--------------------------------------------------------------------------
  50. # ● Cancel Sensor
  51. #--------------------------------------------------------------------------
  52. def cancel_sensor?
  53.      return true if @actor == nil
  54.      return true if self.knockbacking?
  55.      return true if self.throw_active
  56.      return true if self.battler.e_passive
  57.      return true if self.battler.stop
  58.      return true if self.battler.state_sleep
  59.      if self.battler.sensor_range < 15
  60.         return true if self.battler.state_cancel_sensor
  61.         return true if $game_player.battler.state_cancel_sensor
  62.      end
  63.      return false
  64. end
  65. end   
  66.  
  67. #===============================================================================
  68. # ■ Game_Event
  69. #===============================================================================
  70. class Game_Event < Game_Character
  71.   include XRXS_EnemySensor
  72. end
  73.  
  74.  
  75.  
  76.  
  77.  
  78. #===============================================================================
  79. # ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■
  80. # CT METER
  81. # ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■
  82. #===============================================================================
  83.  
  84. #===============================================================================
  85. # ■ GAME_PLAYER
  86. #===============================================================================
  87. class Game_Player < Game_Character
  88.  
  89. #--------------------------------------------------------------------------
  90. # ● Update CT Meter Speed
  91. #--------------------------------------------------------------------------
  92.   def update_ct_meter_speed
  93.       return if $game_switches[XAS::CT_DISABLE_SWITCH]
  94.       if self.battler.state_ctdown
  95.          ct_meter_limit = XAS::CT_METER_SPEED * XAS::CT_POWER  
  96.       else
  97.          ct_meter_limit = XAS::CT_METER_SPEED      
  98.       end   
  99.       $game_system.action_meter_refresh += 1
  100.       $game_system.action_meter_refresh = 0 if $game_system.action_meter_refresh > ct_meter_limit   
  101.       if self.battler.state_ctup
  102.          ct_speed_down = 1
  103.          ct_speed_up = XAS::CT_POWER
  104.          ct_speed_up = 0 if $game_temp.xas_charge_time > 5
  105.       elsif self.battler.state_ctdown
  106.          ct_speed_down = XAS::CT_POWER
  107.          ct_speed_up = 1      
  108.          ct_speed_up = 0 if $game_temp.xas_charge_time > 5
  109.       else
  110.          ct_speed_down = 1
  111.          ct_speed_up = 1
  112.          ct_speed_up = 0 if $game_temp.xas_charge_time > 5
  113.        end         
  114.        if Input.press?(XAS_COMMAND::DASH_BUTTON) or can_shield?(0)           
  115.            if $game_system.action_meter_refresh == 0
  116.               $game_system.action_meter -= ct_speed_down if $game_player.action == nil
  117.            end
  118.        else   
  119.            if $game_system.action_meter_refresh == 0 and not can_shield?(1)
  120.               $game_system.action_meter += ct_speed_up
  121.            end
  122.        end
  123.   end   
  124.  
  125. end   
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133. # ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■
  134. #===============================================================================
  135. # COMMAND
  136. #===============================================================================
  137. # ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■
  138.  
  139. class Game_Player < Game_Character
  140. #--------------------------------------------------------------------------
  141. # ● Update Command
  142. #--------------------------------------------------------------------------  
  143. def update_command
  144.      if Input.trigger?(XAS_COMMAND::ATTACK_ACTION1)   
  145.         active_attack #ATTACK   
  146.      elsif Input.trigger?(XAS_COMMAND::SKILL_ACTION) or $command_skill != 0
  147.         active_skill  #SKILL
  148.      elsif Input.trigger?(XAS_COMMAND::ATTACK_ACTION2)
  149.         active_shield #SHIELD
  150.      elsif Input.trigger?(XAS_COMMAND::ITEM_ACTION) or $command_item != 0
  151.         active_item   #ITEM
  152.      elsif Input.trigger?(XAS_COMMAND::DASH_BUTTON)  
  153.         active_dodge  #DODGE
  154.      elsif Input.trigger?(XAS_COMMAND::SKILL_CHANGE)
  155.         if $game_system.quick_menu and can_call_menu? #Quik Menu Skill   
  156.            $scene = Quick_Menu_Skill.new
  157.         else
  158.            active_change_skill #Change Skill   
  159.         end  
  160.      elsif Input.trigger?(XAS_COMMAND::ITEM_CHANGE)
  161.         if $game_system.quick_menu and can_call_menu?   
  162.            $scene = Quick_Menu_Item.new #Quik Menu Item     
  163.         else
  164.            active_change_item  #Change Item   
  165.         end  
  166.      end        
  167. end   
  168.  
  169. #--------------------------------------------------------------------------
  170. # ● Can Action
  171. #--------------------------------------------------------------------------
  172.   def can_action?
  173.      return false if self.action != nil
  174.      return false if self.knockbacking?
  175.      return false if $game_temp.xas_charge_time >= 10
  176.      return false if $game_temp.cast_time > 0
  177.      return false if jumping?
  178.      return false if $game_switches[XAS_COMMAND::COMMAND_DISABLE_SWITCH] == true
  179.      return false if $game_temp.lock_command
  180.      return false if $game_system.fly
  181.      return false if @swimming
  182.      return false if @pickup_lock
  183.      return false if @pickup_lock_time > 0      
  184.      return false if terrain_tag == XAS::FALL_TERRAIN and @fall_safe_time == 0
  185.      return false if terrain_tag == XAS::SLIP_TERRAIN      
  186.      return false unless $game_temp.hook_x == 0 and $game_temp.hook_y == 0     
  187.      return true
  188.   end
  189.  
  190. #--------------------------------------------------------------------------
  191. # ● Check Combo
  192. #--------------------------------------------------------------------------
  193.   def check_combo(action_id,type)
  194.       combo_id = Database_Bullet::LINK_ACTION_ID[action_id]      
  195.       return false if combo_id == 0
  196.       combo_time = Database_Bullet::SUFLAGS[action_id] + XAS_SKILL::COMBO_TIME   
  197.       case type
  198.          when 1 #Attack
  199.               $game_temp.xas_combo_attack_id = combo_id
  200.               $game_temp.xas_combo_attack_time = combo_time
  201.               $game_temp.xas_combo_skill_id = 0
  202.               $game_temp.xas_combo_skill_time = 0
  203.               $game_temp.xas_combo_item_id = 0
  204.               $game_temp.xas_combo_item_time = 0        
  205.          when 2 #Skill
  206.               $game_temp.xas_combo_attack_id = 0
  207.               $game_temp.xas_combo_attack_time = 0
  208.               $game_temp.xas_combo_skill_id = combo_id
  209.               $game_temp.xas_combo_skill_time = combo_time
  210.               $game_temp.xas_combo_item_id = 0
  211.               $game_temp.xas_combo_item_time = 0            
  212.          when 3 #Item
  213.               $game_temp.xas_combo_attack_id = 0
  214.               $game_temp.xas_combo_attack_time = 0
  215.               $game_temp.xas_combo_skill_id = 0
  216.               $game_temp.xas_combo_skill_time = 0
  217.               $game_temp.xas_combo_item_id = combo_id
  218.               $game_temp.xas_combo_item_time = combo_time           
  219.       end         
  220.   end   
  221.  
  222. #--------------------------------------------------------------------------
  223. # ● Cast Action ?
  224. #--------------------------------------------------------------------------
  225.   def cast_action?(action_id,type)
  226.       cast_time = Database_Bullet::PLAYER_CAST_TIME[action_id]
  227.       return false if cast_time <= 0
  228.       return false if $game_temp.cast_skill_id != 0
  229.       return false if $game_temp.force_action_now_id != 0 or $game_temp.force_action_id != 0
  230.       $game_temp.cast_type = type
  231.       skill_id = action_id
  232.       skill    = skill_id == nil ? nil : $data_skills[skill_id]
  233.       sp_cost  = skill.sp_cost         
  234.       if @actor.sp >= skill.sp_cost
  235.          $game_player.animation_id = XAS_SKILL::DEFAULT_CAST_ANIMATION_ID         
  236.       end
  237.       $game_temp.cast_skill_id = action_id
  238.       $game_temp.cast_time = 10 * cast_time
  239.       return true      
  240.   end
  241.  
  242. #--------------------------------------------------------------------------
  243. # ● Can Target?
  244. #--------------------------------------------------------------------------
  245. def update_shoot_on_target
  246.      return if $game_temp.xas_target_time == 0
  247.      return if $game_temp.xas_target_shoot_id == 0
  248.      return if $game_temp.xas_target_x == 0 and $game_temp.xas_target_y == 0   
  249.      $game_temp.xas_target_time -= 1
  250.      if $game_temp.xas_target_time == 0
  251.         self.shoot($game_temp.xas_target_shoot_id)
  252.         $game_temp.xas_target_shoot_id = 0
  253.      end   
  254. end
  255.  
  256. #--------------------------------------------------------------------------
  257. # ● XAS - Button SKILL
  258. #--------------------------------------------------------------------------
  259.   def active_skill
  260.       type = 2
  261.       if seal_state?(type)   
  262.          seal_text
  263.          return
  264.       end
  265.       if $game_temp.xas_combo_skill_time > 0
  266.          action_id = $game_temp.xas_combo_skill_id
  267.        else
  268.          if $command_skill != 0
  269.          action_id = $command_skill;$command_skill = 0
  270.          else
  271.          action_id = $game_system.xas_skill_id
  272.          end
  273.        end
  274.  
  275.       return false unless check_action_exist?(action_id)      
  276.       check_combo(action_id,type)
  277.       return if cast_action?(action_id,type)  
  278.       self.shoot(action_id)
  279.   end  
  280.  
  281. #--------------------------------------------------------------------------
  282. # ● XAS - Button Attack
  283. #--------------------------------------------------------------------------
  284.   def active_attack
  285.       type = 1
  286.       if seal_state?(type)   
  287.          seal_text
  288.          return
  289.       end      
  290.       if $game_temp.xas_combo_attack_time > 0
  291.          action_id = $game_temp.xas_combo_attack_id
  292.       else
  293.          action_id = $game_system.xas_action_slash_id
  294.        end
  295.       return false unless check_action_exist?(action_id)      
  296.       check_combo(action_id,type)
  297.       return if cast_action?(action_id,type)  
  298.       self.shoot(action_id)   
  299.   end  
  300.  
  301. #--------------------------------------------------------------------------
  302. # ● XAS - Button Shield
  303. #--------------------------------------------------------------------------
  304.   def active_shield
  305.       type = 1
  306.       if seal_state?(type)   
  307.          seal_text
  308.          return
  309.       end            
  310.       action_id = $game_system.xas_action_slash_id2
  311.       return false unless check_action_exist?(action_id)     
  312.       return if cast_action?(action_id,type)      
  313.       self.shoot(action_id)      
  314.       $game_temp.clear_setting3
  315.   end
  316.  
  317. #--------------------------------------------------------------------------
  318. # ● XAS - Button Item
  319. #--------------------------------------------------------------------------
  320.   def active_item
  321.       type = 3
  322.       return if ($mog_rgss_xas_extra_skill != nil and Input.press?(Input::L))
  323.       if seal_state?(type)   
  324.          seal_text
  325.          return
  326.       end         
  327.       if $game_temp.xas_combo_item_time > 0
  328.           action_id = $game_temp.xas_combo_item_id
  329.         else
  330.           if $command_item != 0
  331.             action_id = $command_item;$command_item = 0
  332.           else
  333.             action_id = item_tool_id = XAS::XASITEM_ID[$game_system.xas_item_id]            
  334.           end
  335.         end
  336.       return false unless check_action_exist?(action_id)     
  337.       check_combo(action_id,type)
  338.       return if cast_action?(action_id,type)   
  339.       self.shoot(action_id)
  340.   end  
  341.  
  342. #--------------------------------------------------------------------------
  343. # ● XAS - Dodge Efect
  344. #------------------------------------------------ --------------------------
  345. def dodge_effect
  346.      jump(0,0)
  347.      @need_refresh_pose = true
  348.      $game_temp.dodge_time_real = 15
  349.      $game_temp.lock_command = true
  350.      $game_system.se_play(XAS::SE_DODGE)
  351.      $game_system.action_meter -= XAS::DODGE_COST
  352.      $game_player.animation_id = XAS::DODGE_ANIMATION_ID     
  353.      power = XAS::DODGE_RANGE      
  354.      power.times do
  355.          move_backward
  356.      end
  357. end  
  358.  
  359. #--------------------------------------------------------------------------
  360. # ● XAS - DODGE
  361. #--------------------------------------------------------------------------
  362. def active_dodge   
  363.      return if XAS::DODGE_SYSTEM == false
  364.      return if $game_switches[XAS::CT_DISABLE_SWITCH]
  365.      if $game_temp.dodge_time > 0
  366.         if $game_system.action_meter > XAS::DASH_ACTIVE_PERC      
  367.            dodge_effect  
  368.         else
  369.            $game_system.se_play($data_system.buzzer_se)      
  370.         end
  371.         $game_temp.clear_setting2         
  372.      else  
  373.         $game_temp.dodge_time = 15
  374.         $game_temp.dodge = true         
  375.      end  
  376. end
  377.  
  378. #--------------------------------------------------------------------------
  379. # ● XAS - CAST TIME
  380. #--------------------------------------------------------------------------
  381. def update_release_cast_action
  382.     if $game_temp.cast_time == 0 and $game_temp.cast_skill_id != 0
  383.        if seal_state?($game_temp.cast_type)   
  384.           seal_text
  385.           return
  386.        end            
  387.        action_id = $game_temp.cast_skill_id
  388.        force_move = Database_Bullet::FORCE_MOVE[action_id]   
  389.        @actor.hit_it = 1 if force_move != nil
  390.        self.shoot(action_id)
  391.  
  392.        $game_temp.clear_setting2   
  393.      end  
  394. end  
  395.  
  396. #--------------------------------------------------------------------------
  397. # ● XAS - Change Skill
  398. #--------------------------------------------------------------------------
  399.   def active_change_skill
  400.       @data = []         
  401.       for i in [email]0...@actor.skills.size[/email]
  402.          skill = $data_skills[@actor.skills[i]]
  403.          if skill != nil
  404.             @data.push(skill)
  405.          end
  406.       end
  407.       if skill == nil
  408.          $game_system.se_play($data_system.buzzer_se)  
  409.          return  
  410.       end
  411.       $game_system.xas_skill_index += 1
  412.       if $game_system.xas_skill_index == @data.size
  413.          $game_system.xas_skill_index = 0  
  414.       end
  415.       skill = @data[$game_system.xas_skill_index]
  416.       skill_action = skill.id
  417.       $game_system.xas_skill_id = skill.id
  418.       $game_system.se_play($data_system.cursor_se)
  419.   end
  420.  
  421. #--------------------------------------------------------------------------
  422. # ● XAS - Change Item
  423. #--------------------------------------------------------------------------  
  424.   def active_change_item
  425.       @data2 = []
  426.       for i in 1...$data_items.size
  427.           if $game_party.item_number(i) > 0 and $game_party.item_can_use?(i)
  428.              @data2.push($data_items[i])
  429.           end
  430.       end         
  431.       item = @data2[$game_system.xas_item_index]
  432.       if item == nil
  433.          $game_system.se_play($data_system.buzzer_se)  
  434.          return  
  435.       end
  436.       $game_system.xas_item_index += 1
  437.       if $game_system.xas_item_index == @data2.size
  438.          $game_system.xas_item_index = 0  
  439.       end
  440.       item = @data2[$game_system.xas_item_index]
  441.       item_action = item.id
  442.       $game_system.xas_item_id = item.id
  443.       $game_system.se_play($data_system.cursor_se)
  444.   end
  445.  
  446. #--------------------------------------------------------------------------
  447. # ● XAS - Force_Action_Now
  448. #--------------------------------------------------------------------------
  449. def update_force_action
  450.     if $game_temp.force_action_now_id != 0 and not
  451.        (self.knockbacking? or @actor.state_sleep or @actor.stop)  
  452.        if seal_state?(0)  
  453.           seal_text
  454.           return false
  455.        end   
  456.        action_id = $game_temp.force_action_now_id
  457.        self.shoot(action_id)
  458.      elsif self.action == nil and $game_temp.force_action_id != 0  and not
  459.        (self.knockbacking? or @actor.state_sleep or @actor.stop)  
  460.        if seal_state?(0)  
  461.           seal_text
  462.           return false
  463.        end  
  464.        action_id = $game_temp.force_action_id
  465.        self.shoot(action_id)
  466.     end   
  467. end  
  468.  
  469. #--------------------------------------------------------------------------
  470. # ● Can Charge?
  471. #--------------------------------------------------------------------------
  472. def can_charge?
  473.     return false if $game_temp.cast_time > 0
  474.     return false if seal_state?(0)   
  475.     return false if $game_switches[XAS_COMMAND::COMMAND_DISABLE_SWITCH]
  476.     return false if @wp_tool_id == nil
  477.     return false if @pickup_lock
  478.     return false if @swimming     
  479.     return true
  480. end
  481.  
  482. #--------------------------------------------------------------------------
  483. # ● XAS - CHARGE
  484. #--------------------------------------------------------------------------
  485. def update_charge_button
  486.   unless self.action != nil or self.knockbacking?           
  487.   if Input.press?(XAS_COMMAND::SKILL_CHARGE) and can_charge?     
  488.      if $game_temp.xas_charge_time > 10
  489.         if MOG::FIXED_DIRECTION_SKILL.include?(@wp_tool_id)
  490.            @direction_fix = true  
  491.            @action_move_speed = -1
  492.         else
  493.            @action_move_speed = 0
  494.         end         
  495.      end
  496.      @wp_tool_time = WEP_CHARGE_TIME[@wp_id]
  497.      if @wp_tool_time != nil
  498.         $game_temp.xas_charge_time += @wp_tool_time if $game_temp.xas_charge_time < 100
  499.         $game_temp.xas_anime_loop += @wp_tool_time
  500.         $game_temp.xas_anime_loop2 += @wp_tool_time
  501.         loop = 40 * @wp_tool_time
  502.      else
  503.         $game_temp.xas_charge_time += DEFAULT_CHARGE_TIME if $game_temp.xas_charge_time < 100   
  504.         $game_temp.xas_anime_loop += DEFAULT_CHARGE_TIME  
  505.         $game_temp.xas_anime_loop2 += DEFAULT_CHARGE_TIME  
  506.         loop = 40 * DEFAULT_CHARGE_TIME
  507.      end  
  508.      if $game_temp.xas_anime_loop > loop
  509.         if $game_temp.xas_anime_loop2 >= 100
  510.            $game_player.animation_id = XAS_FULL_ANIME
  511.         else
  512.            $game_player.animation_id = XAS_CHARGE_ANIME
  513.         end
  514.         $game_temp.xas_anime_loop = 0
  515.      end   
  516.   else
  517.      reset_charge_mode(true)
  518.   end         
  519. end
  520. end
  521.  
  522. #--------------------------------------------------------------------------
  523. # ● Release Charge Update
  524. #--------------------------------------------------------------------------
  525.   def update_release_charge  
  526.     if $game_temp.xas_charge_time >= 100 and not Input.press?(XAS_COMMAND::SKILL_CHARGE)
  527.        unless self.action != nil or self.knockbacking?
  528.          action_id = @wp_tool_id if @wp_tool_id != nil
  529.          return if action_id == nil or action_id == 0  
  530.          if seal_state?(1)
  531.             seal_text
  532.             reset_charge_mode
  533.             return
  534.          end   
  535.          self.shoot(action_id) if action_id != nil  
  536.        end
  537.        $game_temp.clear_setting2
  538.        reset_charge_mode
  539.     end
  540.   end
  541.  
  542. #--------------------------------------------------------------------------
  543. # ● Reset Charge Mode
  544. #--------------------------------------------------------------------------
  545.   def reset_charge_mode(max = false)
  546.       return if $game_temp.xas_charge_time == 0
  547.       if max
  548.          $game_temp.xas_charge_time = 0 if $game_temp.xas_charge_time < 100
  549.       else
  550.          $game_temp.xas_charge_time = 0
  551.       end
  552.       $game_temp.xas_anime_loop2 = 0
  553.       $game_temp.xas_anime_loop = 0
  554.       @action_move_speed = 0
  555.       @direction_fix = false
  556.       @need_refresh_pose = true if @pose_type == "Charge"     
  557.   end
  558.  
  559.  
  560. #--------------------------------------------------------------------------
  561. # ● Shield Direction
  562. #--------------------------------------------------------------------------  
  563. def update_shield_direction
  564.      if $data_skills[self.action.id].element_set.include?($data_system.elements.index(XAS_ELEMENT::SHIELD_EFFECT))        
  565.         if self.battler.state_confuse
  566.             turn_reverse_direction     
  567.         else
  568.             turn_normal_direction      
  569.         end
  570.      end     
  571. end  
  572.  
  573. #--------------------------------------------------------------------------
  574. # ● Turn_normal_direction
  575. #--------------------------------------------------------------------------   
  576. def turn_normal_direction
  577.      if Input.press?(Input::UP)
  578.         turn_up
  579.      elsif Input.press?(Input::DOWN)
  580.         turn_down
  581.      elsif Input.press?(Input::RIGHT)
  582.         turn_right
  583.      elsif Input.press?(Input::LEFT)
  584.         turn_left
  585.      end   
  586. end
  587.  
  588. #--------------------------------------------------------------------------
  589. # ● Turn_reverse_direction
  590. #--------------------------------------------------------------------------
  591. def turn_reverse_direction
  592.      if Input.press?(Input::UP)
  593.         turn_down
  594.      elsif Input.press?(Input::DOWN)
  595.         turn_up
  596.      elsif Input.press?(Input::RIGHT)
  597.         turn_left
  598.      elsif Input.press?(Input::LEFT)
  599.         turn_right
  600.      end
  601. end
  602.  
  603. #--------------------------------------------------------------------------
  604. # ● Direction Fix Update
  605. #--------------------------------------------------------------------------
  606.   def update_direction_fix
  607.       if $game_temp.xas_combo_attack_time > 15 or
  608.          $game_temp.xas_combo_skill_time > 15 or
  609.          $game_temp.xas_combo_item_time > 15 or
  610.          $game_temp.xas_charge_time > 10 and MOG::FIXED_DIRECTION_SKILL.include?(@wp_tool_id)
  611.          @direction_fix = true
  612.       else  
  613.          @direction_fix = false
  614.       end  
  615.   end  
  616.  
  617. #--------------------------------------------------------------------------
  618. # ● Check Equipment ID
  619. #--------------------------------------------------------------------------
  620.   def update_check_equipment_id
  621.       if @wp_id != @actor.weapon_id  
  622.          @wp_id = @actor.weapon_id
  623.          @wp_tool_id = WEP_CHARGE_ID[@wp_id]
  624.          @wp_tool_time = WEP_CHARGE_TIME[@wp_id]   
  625.          @weapon_tool_id = XAS_SKILL::WEAPON_ID_TOOL[@wp_id]
  626.          $game_system.xas_action_slash_id = @weapon_tool_id
  627.       end
  628.       if @armor_id != @actor.armor1_id  
  629.          @armor_id = @actor.armor1_id
  630.          @armor_tool_id = XAS_SKILL::SHIELD_ID_TOOL[@armor_id]
  631.          $game_system.xas_action_slash_id2 = @armor_tool_id        
  632.       end
  633.   end
  634.  
  635. #--------------------------------------------------------------------------
  636. # ● Pressed Button
  637. #--------------------------------------------------------------------------  
  638. def pressed_button?
  639.      return false if self.knockbacking?
  640.      return false if $game_system.map_interpreter.running?
  641.      return false if @pickup_lock
  642.      return true if Input.press?(XAS_COMMAND::ATTACK_ACTION1)
  643.      return true if Input.press?(XAS_COMMAND::ATTACK_ACTION2)
  644.      return true if Input.press?(XAS_COMMAND::ITEM_ACTION)
  645.      return true if Input.press?(XAS_COMMAND::SKILL_ACTION)
  646.      return true if Input.press?(XAS_COMMAND::DASH_BUTTON)
  647.      return false
  648. end
  649.  
  650. #--------------------------------------------------------------------------
  651. # ● Trigger Button
  652. #--------------------------------------------------------------------------  
  653. def trigger_button?
  654.      return true if Input.trigger?(XAS_COMMAND::ATTACK_ACTION1)
  655.      return true if Input.trigger?(XAS_COMMAND::ATTACK_ACTION2)
  656.      return true if Input.trigger?(XAS_COMMAND::ITEM_ACTION)
  657.      return true if Input.trigger?(XAS_COMMAND::SKILL_ACTION)
  658.      return true if Input.trigger?(XAS_COMMAND::DASH_BUTTON)
  659.      return false
  660. end
  661.  
  662. #--------------------------------------------------------------------------
  663. # ● Pressed Check
  664. #--------------------------------------------------------------------------
  665. def update_pressed_check
  666.     if pressed_button?
  667.        $game_temp.pressed_attack = true
  668.        $game_temp.pressed_attack = false if trigger_button?
  669.     else  
  670.        $game_temp.pressed_attack = false  
  671.     end  
  672. end  
  673.  
  674.   #--------------------------------------------------------------------------
  675.   # ● Call Menu
  676.   #--------------------------------------------------------------------------   
  677.   def can_call_menu?
  678.       return false if $game_temp.slow_motion > 0
  679.       return true      
  680.   end   
  681.  
  682. end   
  683.  
  684. #===============================================================================
  685. # ■ Game_Character
  686. #===============================================================================
  687. class Game_Character  
  688. #--------------------------------------------------------------------------
  689. # ● Passable Hookshot
  690. #--------------------------------------------------------------------------  
  691.   def passable_hookshot?(x, y, d)
  692.     new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
  693.     new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
  694.     unless $game_map.valid?(new_x, new_y)
  695.       return false
  696.     end
  697.     if @through
  698.       return true
  699.     end
  700.     for event in $game_map.events.values
  701.       if event.x == new_x and event.y == new_y
  702.         if event.character_name == ""
  703.            return true
  704.         end         
  705.         unless event.through
  706.           if self != $game_player
  707.             return false
  708.           end
  709.           if event.character_name != ""
  710.             return false
  711.           end
  712.         end
  713.       end
  714.     end
  715.     if $game_player.x == new_x and $game_player.y == new_y
  716.       unless $game_player.through
  717.         if @character_name != ""
  718.           return false
  719.         end
  720.       end
  721.     end
  722.     return true
  723.   end
  724.  
  725. end  
  726.  
  727. #===============================================================================
  728. # ■ Scene_Save
  729. #===============================================================================
  730. class Scene_Save
  731.  
  732. #--------------------------------------------------------------------------
  733. # ● update   
  734. #--------------------------------------------------------------------------   
  735. alias xas_background_on_decision on_decision
  736. def on_decision(filename)
  737.      if $game_temp.background_effect_time > 0   
  738.         $game_temp.background_effect_time = 0
  739.         $game_map.panorama_name = $game_temp.pre_panorama_name
  740.         $game_map.panorama_hue = $game_temp.pre_panorama_hue
  741.       end        
  742.       xas_background_on_decision(filename)
  743. end  
  744. end
  745.  
  746.  
  747.  
  748.  
  749.  
  750. #===============================================================================
  751. # ■ XAS_ACTION
  752. #===============================================================================
  753. module XAS_ACTION
  754.  
  755. #===============================================================================
  756. # ■ Battler Commands
  757. #===============================================================================
  758.  
  759. #--------------------------------------------------------------------------
  760. # ● Anime
  761. #--------------------------------------------------------------------------
  762.   def anime(anime_id)
  763.       self.animation_id = anime_id   
  764.   end
  765.  
  766. #--------------------------------------------------------------------------
  767. # ● Anime D
  768. #--------------------------------------------------------------------------
  769.   def anime_d(u,d,l,r)
  770.       if @direction == 2
  771.          self.animation_id = d   
  772.       elsif @direction == 8
  773.          self.animation_id = u
  774.       elsif @direction == 4
  775.          self.animation_id = l
  776.       elsif @direction == 6
  777.          self.animation_id = r      
  778.       end  
  779.   end     
  780.  
  781. #--------------------------------------------------------------------------
  782. # ● Invunerable
  783. #--------------------------------------------------------------------------
  784.   def invunerable
  785.       return unless check_battler_exist?
  786.       self.battler.no_damage = true
  787.   end
  788.  
  789. #--------------------------------------------------------------------------
  790. # ● Vunerable
  791. #--------------------------------------------------------------------------
  792.   def vunerable
  793.       return unless check_battler_exist?
  794.       self.battler.no_damage = false
  795.   end
  796.  
  797. #--------------------------------------------------------------------------
  798. # ● Text
  799. #--------------------------------------------------------------------------
  800.   def text(tx,perc)
  801.       return unless check_battler_exist?
  802.       if rand(100) <= perc
  803.         self.battler.damage = tx.to_s
  804.         self.battler.damage_pop = true
  805.       end
  806.   end
  807.  
  808. #--------------------------------------------------------------------------
  809. # ● Zoom
  810. #--------------------------------------------------------------------------
  811.   def zoom(x,y)
  812.       return unless check_battler_exist?
  813.       self.battler.zoomx = x
  814.       self.battler.zoomy = y
  815.   end  
  816.  
  817. #--------------------------------------------------------------------------
  818. # ● Zoom fast
  819. #--------------------------------------------------------------------------
  820.   def fastzoom(valor)
  821.       return unless check_battler_exist?  
  822.       self.battler.zoom_fast = valor
  823.   end
  824. #--------------------------------------------------------------------------
  825. # ● Self Damage
  826. #--------------------------------------------------------------------------
  827.   def selfdamage(damage,perc)
  828.       return unless check_battler_exist?
  829.       if rand(100) <= perc
  830.          self.battler.damage = damage.to_i
  831.          self.battler.damage_pop = true              
  832.          self.battler.hp -= damage
  833.          if self.battler.hp <= 0
  834.             self.battler.gain_exp_act = false   
  835.          end
  836.       end
  837.   end
  838.  
  839. #--------------------------------------------------------------------------
  840. # ● Add State
  841. #--------------------------------------------------------------------------
  842.   def addstate(states_id,perc)
  843.       return unless check_battler_exist?
  844.       if rand(100) <= perc
  845.          self.battler.add_state(states_id)
  846.       end
  847.   end  
  848.  
  849. #--------------------------------------------------------------------------
  850. # ● Counter ON
  851. #--------------------------------------------------------------------------
  852.   def counter_on
  853.       return unless check_battler_exist?
  854.       self.battler.counter_on = true
  855.   end
  856.  
  857. #--------------------------------------------------------------------------
  858. # ● Counter Off
  859. #--------------------------------------------------------------------------
  860.   def counter_off
  861.       return unless check_battler_exist?
  862.       self.battler.counter_on = false
  863.   end  
  864.  
  865. #--------------------------------------------------------------------------
  866. # ● LowHP Add State
  867. #--------------------------------------------------------------------------
  868.   def lowhp_addstate(states_id,perc)
  869.       return unless check_battler_exist?
  870.       lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
  871.       if rand(100) <= perc
  872.          if self.battler.hp <= lowhp
  873.             self.battler.add_state(states_id)
  874.          end
  875.       end
  876.   end
  877.  
  878. #--------------------------------------------------------------------------
  879. # ● LowHP Remove State
  880. #--------------------------------------------------------------------------
  881.   def lowhp_removestate(states_id,perc)
  882.       return unless check_battler_exist?
  883.       lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
  884.       if rand(100) <= perc
  885.          if self.battler.hp <= lowhp
  886.             self.battler.remove_state(states_id)
  887.          end
  888.       end
  889.   end  
  890.  
  891. #--------------------------------------------------------------------------
  892. # ● Remove State
  893. #--------------------------------------------------------------------------
  894.   def removestate(states_id,perc)
  895.       return unless check_battler_exist?
  896.       if rand(100) <= perc
  897.         self.battler.remove_state(states_id)
  898.       end
  899.   end   
  900.  
  901. #--------------------------------------------------------------------------
  902. # ● Recover All
  903. #--------------------------------------------------------------------------
  904.   def recoverall(per)
  905.       return unless check_battler_exist?
  906.       self.battler.damage = "Recover"
  907.       self.battler.damage_pop = true
  908.       self.battler.recover_all
  909.   end
  910.  
  911. #--------------------------------------------------------------------------
  912. # ● LowHP Recover All
  913. #--------------------------------------------------------------------------
  914. def lowhp_recoverall(per)
  915.     return unless check_battler_exist?
  916.     lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
  917.     if self.battler.hp <= lowhp
  918.         self.battler.damage = "Recover"
  919.         self.battler.damage_pop = true
  920.         self.battler.recover_all
  921.     end
  922.   end   
  923.  
  924. #--------------------------------------------------------------------------
  925. # ● Low HP Anime
  926. #--------------------------------------------------------------------------
  927.   def lowhp_anime(anime_id)
  928.       return unless check_battler_exist?
  929.       lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
  930.       if self.battler.hp <= lowhp  
  931.          self.animation_id = anime_id         
  932.       end
  933.   end  
  934.  
  935. #--------------------------------------------------------------------------
  936. # ● HP Anime
  937. #--------------------------------------------------------------------------
  938.   def hp_anime(anime_id1,anime_id2)
  939.       return unless check_battler_exist?
  940.       lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
  941.       if self.battler.hp > lowhp
  942.           self.animation_id = anime_id1
  943.       else
  944.           self.animation_id = anime_id2     
  945.       end
  946.   end  
  947.  
  948. #--------------------------------------------------------------------------
  949. # ● Speed
  950. #--------------------------------------------------------------------------
  951.   def speed(x)
  952.       @base_move_speed = x
  953.   end
  954.  
  955. #--------------------------------------------------------------------------
  956. # ● Freq
  957. #--------------------------------------------------------------------------  
  958.   def freq(x)
  959.       @move_frequency = x
  960.   end
  961. #--------------------------------------------------------------------------
  962. # ● LowHP Speed
  963. #--------------------------------------------------------------------------
  964.   def lowhp_speed(x)
  965.       lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
  966.       if self.battler.hp <= lowhp
  967.          @move_speed = x
  968.       end
  969.   end
  970.  
  971. #--------------------------------------------------------------------------
  972. # ● HP Speed
  973. #--------------------------------------------------------------------------
  974.   def hp_speed(x1,x2)
  975.       lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
  976.       if self.battler.hp > lowhp     
  977.          @move_speed = x1     
  978.       else
  979.          @move_speed = x2
  980.       end
  981.   end   
  982.  
  983. #--------------------------------------------------------------------------
  984. # ● LowHP Switch
  985. #--------------------------------------------------------------------------
  986.   def lowhp_switch(x,on)
  987.     return unless check_battler_exist?
  988.     lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
  989.     if self.battler.hp <= lowhp
  990.       $game_switches[x] = on
  991.       $game_map.need_refresh = true if $game_map.need_refresh == false
  992.       self.refresh
  993.     end
  994.   end   
  995.  
  996. #--------------------------------------------------------------------------
  997. # ● Hero LowHP Switch
  998. #--------------------------------------------------------------------------
  999.   def hero_lowhp_switch(x,on)
  1000.       actor = $game_party.actors[0]
  1001.       lowhp = actor.maxhp * XAS_BA_ENEMY::LOWHP / 100
  1002.       if actor.hp <= lowhp     
  1003.           $game_switches[x] = on
  1004.           $game_map.need_refresh = true if $game_map.need_refresh == false
  1005.           self.refresh
  1006.       end
  1007.   end
  1008.  
  1009. #--------------------------------------------------------------------------
  1010. # ● Dual Switch
  1011. #--------------------------------------------------------------------------
  1012.   def dual_switch(a,b,perc)
  1013.      if rand(100) <= perc
  1014.        if $game_switches[a] == true
  1015.           $game_switches[a] = false
  1016.           $game_switches[b] = true
  1017.        else
  1018.           $game_switches[a] = true
  1019.           $game_switches[b] = false
  1020.        end
  1021.      end
  1022.      self.refresh
  1023.      $game_map.need_refresh = true if $game_map.need_refresh == false
  1024.   end     
  1025.  
  1026. #--------------------------------------------------------------------------
  1027. # ● Hero Level Switch
  1028. #--------------------------------------------------------------------------
  1029.   def hero_level_switch(x,level,on)
  1030.       actor = $game_party.actors[0]
  1031.       if actor.level >= level
  1032.           $game_switches[x] = on
  1033.           $game_map.need_refresh = true if $game_map.need_refresh == false
  1034.       end
  1035.   end   
  1036.  
  1037. #--------------------------------------------------------------------------
  1038. # ● Hero HP Anime
  1039. #--------------------------------------------------------------------------
  1040.   def hero_hp_anime(anime_id1,anime_id2)
  1041.       actor = $game_party.actors[0]
  1042.       lowhp = actor.maxhp * XAS_BA_ENEMY::LOWHP / 100
  1043.       if actor.hp > lowhp  
  1044.          self.animation_id = anime_id1   
  1045.       else
  1046.          self.animation_id = anime_id2      
  1047.       end
  1048.   end     
  1049.  
  1050. #--------------------------------------------------------------------------
  1051. # ● Hero Level Anime
  1052. #--------------------------------------------------------------------------
  1053.   def hero_level_anime(anime_id1,anime_id2,level)
  1054.       actor = $game_party.actors[0]
  1055.       if actor.level >= level     
  1056.          self.animation_id = anime_id1   
  1057.       else
  1058.          self.animation_id = anime_id2      
  1059.       end
  1060.   end      
  1061.  
  1062. #--------------------------------------------------------------------------
  1063. # ● Hero Level Speed
  1064. #--------------------------------------------------------------------------
  1065.   def hero_level_speed(x1,x2,level)
  1066.       actor = $game_party.actors[0]
  1067.       if actor.level >= level      
  1068.          @move_speed = x1     
  1069.       else
  1070.          @move_speed = x2
  1071.       end         
  1072.   end
  1073.  
  1074. #--------------------------------------------------------------------------
  1075. # ● Hero HP Switch
  1076. #--------------------------------------------------------------------------
  1077.   def hero_hp_switch(x,on)
  1078.       actor = $game_party.actors[0]
  1079.       lowhp = actor.maxhp * XAS_BA_ENEMY::LOWHP / 100
  1080.       if actor.hp > lowhp   
  1081.           $game_switches[x] = on   
  1082.           $game_map.need_refresh = true
  1083.       else
  1084.          if on == true
  1085.           $game_switches[x] = false
  1086.          else  
  1087.           $game_switches[x] = true
  1088.          end  
  1089.          $game_map.need_refresh = true if $game_map.need_refresh == false
  1090.       end
  1091.     end         
  1092.  
  1093. #--------------------------------------------------------------------------
  1094. # ● Hero Level Shoot
  1095. #--------------------------------------------------------------------------
  1096.   def hero_level_shoot(x1,x2,level,perc)
  1097.       if rand(100) <= perc
  1098.         actor = $game_party.actors[0]
  1099.         if  actor.level >= level   
  1100.            shoot(x1)
  1101.         else
  1102.            shoot(x2)
  1103.         end
  1104.       end
  1105. end        
  1106.  
  1107. #--------------------------------------------------------------------------
  1108. # ● Hero Level Escape
  1109. #--------------------------------------------------------------------------
  1110.   def hero_level_escape(level,perc)
  1111.       return unless check_battler_exist?
  1112.       if rand(100) <= perc
  1113.         actor = $game_party.actors[0]
  1114.         if actor.level >= level
  1115.             self.battler.no_damage = true
  1116.             self.battler.damage = "Escape"
  1117.             self.battler.damage_pop = true
  1118.             self.collapse_done = true
  1119.             $game_system.se_play($data_system.escape_se)
  1120.         end
  1121.       end
  1122.     end     
  1123.  
  1124. #--------------------------------------------------------------------------
  1125. # ● HP Switch
  1126. #--------------------------------------------------------------------------
  1127.   def hp_switch(x,on)
  1128.       return unless check_battler_exist?
  1129.       lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
  1130.       if self.battler.hp > lowhp   
  1131.           $game_switches[x] = on   
  1132.           $game_map.need_refresh = true
  1133.       else
  1134.          if on == true
  1135.           $game_switches[x] = false
  1136.          else  
  1137.           $game_switches[x] = true
  1138.          end  
  1139.          $game_map.need_refresh = true if $game_map.need_refresh == false
  1140.       end
  1141.   end   
  1142.  
  1143. #--------------------------------------------------------------------------
  1144. # ● Escape
  1145. #--------------------------------------------------------------------------
  1146.   def escape(perc)
  1147.       return unless check_battler_exist?
  1148.       if rand(100) <= perc
  1149.          self.battler.damage = XAS_ABS_SETUP::ESCAPE_TEXT
  1150.          self.battler.damage_pop = true
  1151.          self.collapse_done = true
  1152.          $game_system.se_play($data_system.escape_se)
  1153.          self.erase
  1154.       end
  1155.   end   
  1156.  
  1157. #--------------------------------------------------------------------------
  1158. # ● LowHP Escape
  1159. #--------------------------------------------------------------------------
  1160.   def lowhp_escape(perc)
  1161.       return unless check_battler_exist?
  1162.       if rand(100) <= perc
  1163.         lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
  1164.         if self.battler.hp <= lowhp     
  1165.             self.battler.damage = XAS_ABS_SETUP::ESCAPE_TEXT
  1166.             self.battler.damage_pop = true
  1167.             self.collapse_done = true
  1168.             $game_system.se_play($data_system.escape_se)
  1169.         end
  1170.       end
  1171.   end      
  1172.  
  1173. #--------------------------------------------------------------------------
  1174. # ● Shoot Chance
  1175. #--------------------------------------------------------------------------
  1176.   def shoot_chance(action_id,perc)
  1177.       if rand(100) <= perc
  1178.          shoot(action_id)
  1179.       end
  1180. end  
  1181.  
  1182. #--------------------------------------------------------------------------
  1183. # ● Jump Org
  1184. #--------------------------------------------------------------------------
  1185.   def jump_org
  1186.       range_x = org_x - self.x
  1187.       range_y = org_y - self.y
  1188.       jump(range_x,range_y)
  1189.   end      
  1190.  
  1191. #--------------------------------------------------------------------------
  1192. # ● Org Here
  1193. #--------------------------------------------------------------------------
  1194.   def org_here
  1195.       self.org_x = self.x
  1196.       self.org_y = self.y
  1197.   end      
  1198.  
  1199. #--------------------------------------------------------------------------
  1200. # ● Jump Near
  1201. #--------------------------------------------------------------------------
  1202.   def jump_near
  1203.       if $game_player.x > self.x and
  1204.          $game_player.y > self.y
  1205.          range_x = $game_player.x - self.x   
  1206.          range_y = -1 + $game_player.y - self.y
  1207.       elsif $game_player.x < self.x and
  1208.          $game_player.y < self.y
  1209.          range_x = $game_player.x - self.x   
  1210.          range_y = 1 + $game_player.y - self.y         
  1211.       elsif $game_player.x > self.x and
  1212.          $game_player.y < self.y
  1213.          range_x = $game_player.x - self.x   
  1214.          range_y = 1 + $game_player.y - self.y            
  1215.       elsif $game_player.x < self.x and
  1216.          $game_player.y > self.y
  1217.          range_x = $game_player.x - self.x   
  1218.          range_y = -1 + $game_player.y - self.y   
  1219.       elsif $game_player.x < self.x and
  1220.          $game_player.y == self.y
  1221.          range_x = 1 + $game_player.x - self.x   
  1222.          range_y = $game_player.y - self.y            
  1223.       elsif $game_player.x > self.x and
  1224.          $game_player.y == self.y
  1225.          range_x = -1 + $game_player.x - self.x   
  1226.          range_y = $game_player.y - self.y     
  1227.       elsif $game_player.x == self.x and
  1228.          $game_player.y > self.y
  1229.          range_x = $game_player.x - self.x   
  1230.          range_y = -1 + $game_player.y - self.y            
  1231.       elsif $game_player.x == self.x and
  1232.          $game_player.y < self.y
  1233.          range_x = $game_player.x - self.x   
  1234.          range_y = 1 + $game_player.y - self.y            
  1235.      else
  1236.          range_x = 0
  1237.          range_y = 0     
  1238.  
  1239.       end
  1240.          jump(range_x,range_y) unless range_y == 0 and range_x == 0      
  1241.   end  
  1242.  
  1243. #--------------------------------------------------------------------------
  1244. # ● Lowhp Shoot
  1245. #--------------------------------------------------------------------------
  1246.   def lowhp_shoot(action_id,perc)
  1247.       return unless check_battler_exist?
  1248.       if rand(100) <= perc
  1249.         lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
  1250.         if self.battler.hp <= lowhp
  1251.           shoot(action_id)
  1252.         end
  1253.       end   
  1254.   end      
  1255.  
  1256. #--------------------------------------------------------------------------
  1257. # ● Fatal Shoot
  1258. #--------------------------------------------------------------------------
  1259.   def fatal_shoot(action_id,perc)
  1260.       return unless check_battler_exist?
  1261.       if rand(100) <= perc
  1262.           shoot(action_id)
  1263.           self.battler.damage = self.battler.hp
  1264.           self.battler.damage_pop = true
  1265.           self.battler.gain_exp_act = false
  1266.           self.battler.hp -= self.battler.hp
  1267.       end
  1268.   end  
  1269.  
  1270. #--------------------------------------------------------------------------
  1271. # ● Lowhp Fatal Shoot
  1272. #--------------------------------------------------------------------------
  1273.   def lowhp_fatal_shoot(action_id,perc)
  1274.       return unless check_battler_exist?
  1275.       lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
  1276.       if self.battler.hp <= lowhp     
  1277.           if rand(100) <= perc
  1278.             shoot(action_id)
  1279.             self.battler.damage = self.battler.hp
  1280.             self.battler.damage_pop = true
  1281.             self.battler.gain_exp_act = false
  1282.             self.battler.hp -= self.battler.hp
  1283.           end
  1284.       end
  1285.   end   
  1286.  
  1287. #--------------------------------------------------------------------------
  1288. # ● HP Shoot
  1289. #--------------------------------------------------------------------------
  1290.   def hp_shoot(hp_high,hp_low,perc)
  1291.     return unless check_battler_exist?
  1292.     if rand(100) <= perc
  1293.       lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
  1294.       if self.battler.hp >= lowhp
  1295.         shoot(hp_high)
  1296.       else
  1297.         shoot(hp_low)
  1298.       end
  1299.     end
  1300.   end
  1301.  
  1302. #--------------------------------------------------------------------------
  1303. # ● Hero LOWHP Shoot
  1304. #--------------------------------------------------------------------------
  1305.   def hero_lowhp_shoot(x,perc)
  1306.       actor = $game_party.actors[0]
  1307.       if rand(100) <= perc
  1308.         lowhp = actor.maxhp * XAS_BA_ENEMY::LOWHP / 100
  1309.         if actor.hp <= lowhp
  1310.            shoot(x)      
  1311.         end
  1312.       end
  1313.   end
  1314.  
  1315. #--------------------------------------------------------------------------
  1316. # ● Hero HP Shoot
  1317. #--------------------------------------------------------------------------
  1318.   def hero_hp_shoot(hp_high,hp_low,perc)
  1319.     actor = $game_party.actors[0]
  1320.     if rand(100) <= perc
  1321.        lowhp = actor.maxhp * XAS_BA_ENEMY::LOWHP / 100
  1322.        if actor.hp > lowhp
  1323.           shoot(hp_high)  
  1324.        else   
  1325.           shoot(hp_low)         
  1326.        end
  1327.     end
  1328.   end  
  1329.  
  1330. #--------------------------------------------------------------------------
  1331. # ● Lowhp Rand Shoot
  1332. #--------------------------------------------------------------------------
  1333.   def lowhp_rand_shoot(a,b,c,d,e)   
  1334.       attack_off
  1335.       lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
  1336.       if self.battler.hp <= lowhp
  1337.       case rand(5)
  1338.          when 0
  1339.            if a == 0
  1340.            attack_on
  1341.            else
  1342.            shoot(a)
  1343.            end
  1344.          when 1      
  1345.            if b == 0
  1346.            attack_on
  1347.            else
  1348.            shoot(b)
  1349.            end   
  1350.          when 2
  1351.            if c == 0
  1352.            attack_on
  1353.            else
  1354.            shoot(c)
  1355.            end
  1356.          when 3      
  1357.            if d == 0
  1358.            attack_on
  1359.            else
  1360.            shoot(d)
  1361.            end  
  1362.          when 4      
  1363.            if e == 0
  1364.            attack_on
  1365.            else
  1366.            shoot(e)
  1367.            end            
  1368.          end   
  1369.       end
  1370.   end  
  1371.  
  1372. #--------------------------------------------------------------------------
  1373. # ● Rand Shoot
  1374. #--------------------------------------------------------------------------
  1375.   def rand_shoot(a,b,c,d,e)   
  1376.       attack_off
  1377.       case rand(5)
  1378.          when 0
  1379.            if a == 0
  1380.            attack_on
  1381.            else
  1382.            shoot(a)
  1383.            end
  1384.          when 1      
  1385.            if b == 0
  1386.            attack_on
  1387.            else
  1388.            shoot(b)
  1389.            end   
  1390.          when 2
  1391.            if c == 0
  1392.            attack_on
  1393.            else
  1394.            shoot(c)
  1395.            end
  1396.          when 3      
  1397.            if d == 0
  1398.            attack_on
  1399.            else
  1400.            shoot(d)
  1401.            end  
  1402.          when 4      
  1403.            if e == 0
  1404.            attack_on
  1405.            else
  1406.            shoot(e)
  1407.            end            
  1408.        end   
  1409.   end  
  1410.  
  1411. end  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418. #===============================================================================
  1419. # ■ Game_Enemy
  1420. #===============================================================================
  1421. class Game_Battler
  1422.  
  1423.     attr_accessor :e_object               
  1424.     attr_accessor :e_item
  1425.     attr_accessor :e_ignore_hero_shield
  1426.     attr_accessor :e_knockback_disable
  1427.     attr_accessor :e_jump_hit_disable
  1428.     attr_accessor :e_breath_effect
  1429.     attr_accessor :e_zoom_in_effect
  1430.     attr_accessor :e_zoom_out_effect
  1431.     attr_accessor :e_only_blow
  1432.     attr_accessor :e_passive
  1433.     attr_accessor :e_drain
  1434.     attr_accessor :e_sp_damage
  1435. #--------------------------------------------------------------------------
  1436. # ● Initialize
  1437. #--------------------------------------------------------------------------
  1438. alias xas_enemy_parameter_initialize initialize
  1439. def initialize
  1440.      xas_enemy_parameter_initialize
  1441.      @e_object = false               
  1442.      @e_item = false           
  1443.      @e_ignore_hero_shield = false           
  1444.      @e_knockback_disable = false           
  1445.      @e_jump_hit_disable = false           
  1446.      @e_breath_effect = false           
  1447.      @e_zoom_in_effect = false           
  1448.      @e_zoom_out_effect = false   
  1449.      @e_only_blow = false
  1450.      @e_passive = false
  1451.      @e_drain = false
  1452.      @e_sp_damage = false   
  1453. end
  1454. end
  1455.  
  1456. #===============================================================================
  1457. # ■ Game_Enemy
  1458. #===============================================================================
  1459. class Game_Enemy < Game_Battler
  1460.  
  1461. #--------------------------------------------------------------------------
  1462. # ● Initialize
  1463. #--------------------------------------------------------------------------
  1464. alias xas_enemy_initialize initialize
  1465. def initialize(troop_id, member_index)
  1466.      xas_enemy_initialize(troop_id, member_index)
  1467.      for i in 1...$data_system.elements.size
  1468.        if $data_enemies[@enemy_id].element_ranks[i] != 3           
  1469.        @e_object = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_OBJECT)
  1470.        @e_item = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_ITEM)               
  1471.        @e_ignore_hero_shield = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_IGNORE_HERO_SHIELD)               
  1472.        @e_knockback_disable = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_KNOCKBACK_DISABLE)                  
  1473.        @e_jump_hit_disable = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_JUMP_HIT_DISABLE)            
  1474.        @e_breath_effect = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_BREATH_EFFECT)               
  1475.        @e_zoom_in_effect = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_ZOOM_IN_EFFECT)               
  1476.        @e_zoom_out_effect = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_ZOOM_OUT_EFFECT)                 
  1477.        @e_zoom_out_effect = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_ONLY_BLOW_TOUCH)                 
  1478.        @e_passive = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_PASSIVE)                 
  1479.        @e_drain = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_DRAIN)                 
  1480.        @e_sp_damage = true if $data_system.elements[i].index(ENEMY_ELEMENT::ENEMY_SP_DAMAGE)                 
  1481.        end
  1482.      end
  1483.      self.gain_exp_act = true     
  1484. end  
  1485. end  
  1486.  
  1487. #===============================================================================
  1488. # Game_Player
  1489. #===============================================================================
  1490. class Game_Player < Game_Character
  1491.   include XRXS_BattlerAttachment
  1492.  
  1493. #--------------------------------------------------------------------------
  1494. # ● Battler
  1495. #--------------------------------------------------------------------------
  1496.   def battler
  1497.     return $game_party.actors[0]
  1498.   end
  1499.  
  1500. #--------------------------------------------------------------------------
  1501. # ● Defeat Process
  1502. #--------------------------------------------------------------------------
  1503.   def defeat_process
  1504.     super  
  1505.     if RPG_FileTest.character_exist?(@actor.character_name + "_HIT")
  1506.        @character_name = @actor.character_name + "_HIT"
  1507.     end      
  1508.     if XAS_BA::AUTOGAMEOVER == true
  1509.       if self.collapse_done         
  1510.          $scene = Scene_Gameover.new rescue nil
  1511.       end
  1512.     else   
  1513.       $game_switches[XAS_BA::GAMEOVER_SWITCH_ID] = true
  1514.       $game_map.refresh
  1515.     end
  1516.   end
  1517. end
  1518.  
  1519. #===============================================================================
  1520. # ■ Game Event
  1521. #===============================================================================
  1522. class Game_Event < Game_Character
  1523.   include XRXS_BattlerAttachment
  1524.  
  1525. #--------------------------------------------------------------------------
  1526. # ● Battler
  1527. #--------------------------------------------------------------------------
  1528.   def battler
  1529.     return @battler
  1530.   end
  1531.  
  1532. #--------------------------------------------------------------------------
  1533. # ● Refresh
  1534. #--------------------------------------------------------------------------
  1535.   alias xrxs64c_refresh refresh
  1536.   def refresh
  1537.     xrxs64c_refresh
  1538.     self.battler_recheck
  1539.   end
  1540.  
  1541. #--------------------------------------------------------------------------
  1542. # ● Battler Recheck
  1543. #--------------------------------------------------------------------------
  1544.   def battler_recheck
  1545.     return if @battler != nil
  1546.     if @page == nil
  1547.       return
  1548.     end
  1549.     if self.event_name =~ /<Actor>/      
  1550.        actor = $game_party.actors[0]
  1551.        @battler = Game_Actor.new(actor.id)
  1552.        return
  1553.     else
  1554.        @enemy_id = 0
  1555.        if self.event_name =~ /<Enemy(\d+)>/i
  1556.           @enemy_id = $1.to_i   
  1557.        end   
  1558.        if @enemy_id == 0
  1559.           return
  1560.        end
  1561.     end  
  1562.     troop_id     = -1
  1563.     member_index = -1
  1564.     for troop in $data_troops
  1565.       next if troop == nil
  1566.       for enemy in troop.members
  1567.         if enemy.enemy_id == @enemy_id
  1568.           troop_id     = $data_troops.index(troop)
  1569.           member_index = troop.members.index(enemy)
  1570.           break
  1571.         end
  1572.       end
  1573.     end
  1574.     if troop_id != -1 and member_index != -1
  1575.        @battler = Game_Enemy.new(troop_id, member_index)
  1576.     end
  1577.   end
  1578.  
  1579. #--------------------------------------------------------------------------
  1580. # ● Enemy Id
  1581. #--------------------------------------------------------------------------
  1582.   def enemy_id
  1583.     self.battler
  1584.     return @enemy_id
  1585.   end
  1586.  
  1587. #--------------------------------------------------------------------------
  1588. # ● update_gained_exp_gold
  1589. #--------------------------------------------------------------------------   
  1590. def update_defeated
  1591.      return if self.battler == nil
  1592.      if self.battler.dead? and self.battler.defeated == false
  1593.         self.battler.defeated = true
  1594.         defeated_effect      
  1595.      end  
  1596. end  
  1597.  
  1598. #--------------------------------------------------------------------------
  1599. # ● Defeated Effect  
  1600. #--------------------------------------------------------------------------  
  1601. def defeated_effect  
  1602.      self.through = true
  1603.      last_attack = XAS_BA_ENEMY::ENEMY_FINAL_ATTACK[self.battler.id]
  1604.      self.battler.last_attack_time = 15 if last_attack != nil  
  1605.      unless self.tool_id > 0 or self.battler.e_item
  1606.          @actor.exp += self.battler.exp
  1607.          $game_party.gain_gold(self.battler.gold)
  1608.      end
  1609.      id = XAS_BA::DEFEAT_NUMBER_ID
  1610.      $game_variables[id] += 1 if id != 0
  1611.      jumpa(0,0,20) if XAS_BA_ENEMY::COLLAPSE_JUMP == true     
  1612.      switch_id = XAS_BA_ENEMY::DEFEAT_SWITCH_IDS[self.battler.id]
  1613.      if switch_id != nil
  1614.         $game_switches[switch_id] = true
  1615.         $game_map.refresh
  1616.       end
  1617. end   
  1618.  
  1619.  
  1620.  
  1621. #--------------------------------------------------------------------------
  1622. # ● Treasure Dispose
  1623. #--------------------------------------------------------------------------
  1624. def treasure_dispose
  1625.      if self.battler == nil and self.is_a?(Game_Event)
  1626.         if self.treasure_time > 0 and
  1627.            self.treasure_time -= 1
  1628.            if self.alwaly_on_target_id != 0
  1629.               self.zoom_x = 1.00
  1630.            elsif self.treasure_time < 100
  1631.               self.zoom_x -= 0.01 if self.zoom_x > 0.01
  1632.               $game_map.remove_token(self) if self.treasure_time == 0
  1633.            end
  1634.         end
  1635.      end  
  1636. end
  1637.  
  1638. #--------------------------------------------------------------------------
  1639. # ● Hit Reaction ON
  1640. #--------------------------------------------------------------------------
  1641.   def hit_reaction_on
  1642.       return unless check_battler_exist?   
  1643.       self.hit_reaction = true
  1644.   end  
  1645.  
  1646. #--------------------------------------------------------------------------
  1647. # ● Hit Reaction Off
  1648. #--------------------------------------------------------------------------
  1649.   def hit_reaction_off
  1650.       return unless check_battler_exist?   
  1651.       self.hit_reaction = false
  1652.   end  
  1653.  
  1654. #--------------------------------------------------------------------------
  1655. # ● Hp Hit Reaction
  1656. #--------------------------------------------------------------------------
  1657.   def hp_hit_reaction(on)
  1658.       return unless check_battler_exist?   
  1659.       lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
  1660.       if self.battler.hp > lowhp   
  1661.       self.hit_reaction = on
  1662.       else
  1663.       if on == true
  1664.       self.hit_reaction = false
  1665.       else
  1666.       self.hit_reaction = true
  1667.       end
  1668.       end  
  1669.   end        
  1670.  
  1671. #--------------------------------------------------------------------------
  1672. # ● Hero Level Hit Reaction
  1673. #--------------------------------------------------------------------------
  1674.   def hero_level_hit_reaction(level,on)
  1675.       return unless check_battler_exist?   
  1676.       actor = $game_party.actors[0]
  1677.       if  actor.level >= level   
  1678.       self.hit_reaction = on
  1679.       else
  1680.       if on == true
  1681.       self.hit_reaction = false
  1682.       else
  1683.       self.hit_reaction = true
  1684.       end
  1685.       end  
  1686.   end            
  1687.  
  1688. #--------------------------------------------------------------------------
  1689. # ● Shield Enable!
  1690. #--------------------------------------------------------------------------
  1691.   def shield_enable!
  1692.       return unless check_battler_exist?   
  1693.       @shield_disable = nil
  1694.       self.battler.shield_active = true
  1695.   end
  1696.  
  1697. #--------------------------------------------------------------------------
  1698. # ● Shield Disable!
  1699. #--------------------------------------------------------------------------
  1700.   def shield_disable!
  1701.       return unless check_battler_exist?   
  1702.       @shield_disable = true
  1703.       self.battler.shield_active = false
  1704.   end  
  1705.  
  1706. #--------------------------------------------------------------------------
  1707. # ● LowHP Shield
  1708. #--------------------------------------------------------------------------
  1709.   def lowhp_shield(on)
  1710.       return unless check_battler_exist?   
  1711.       lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
  1712.       if on == true
  1713.       @shield_disable = true
  1714.       elsif on == false
  1715.       @shield_disable = nil
  1716.       end
  1717.   end      
  1718.  
  1719. #--------------------------------------------------------------------------
  1720. # ● Hero HP Shield
  1721. #--------------------------------------------------------------------------
  1722.   def hp_shield(on)
  1723.       return unless check_battler_exist?   
  1724.       lowhp = self.battler.maxhp * XAS_BA_ENEMY::LOWHP / 100
  1725.       if self.battler.hp > lowhp
  1726.         if on == true
  1727.         @shield_disable = nil
  1728.         else
  1729.         @shield_disable = true
  1730.         end
  1731.       else
  1732.         if on == true
  1733.         @shield_disable = true
  1734.         else
  1735.         @shield_disable = nil
  1736.         end           
  1737.       end
  1738.   end   
  1739.  
  1740. #--------------------------------------------------------------------------
  1741. # ● Hero Level Shield
  1742. #--------------------------------------------------------------------------
  1743.   def hero_level_shield(level,on)
  1744.       return unless check_battler_exist?   
  1745.       actor = $game_party.actors[0]
  1746.       if  actor.level >= level        
  1747.         if on == true
  1748.         @shield_disable = nil
  1749.         else
  1750.         @shield_disable = true
  1751.         end         
  1752.       else
  1753.         if on == true
  1754.         @shield_disable = true
  1755.         else
  1756.         @shield_disable = nil
  1757.         end        
  1758.       end
  1759.   end   
  1760.  
  1761. #--------------------------------------------------------------------------
  1762. # ● Shield Directions
  1763. #--------------------------------------------------------------------------
  1764.   def shield_directions
  1765.       if self.battler.auto_action
  1766.          set = @shield_disable ? [] : [2,4,6,8]
  1767.       else
  1768.          set = @shield_disable ? [] : XAS_BA_ENEMY::SHILED_DIRECTIONS[self.enemy_id]
  1769.       end  
  1770.       set = [] if set == nil
  1771.       return set
  1772.   end
  1773.  
  1774. #--------------------------------------------------------------------------
  1775. # ● Shield Actions
  1776. #--------------------------------------------------------------------------
  1777.   def shield_actions
  1778.       set = XAS_BA_ENEMY::SHILED_ACTIONS[self.enemy_id]
  1779.       set = [] if set == nil
  1780.       return set
  1781.   end
  1782.  
  1783. #--------------------------------------------------------------------------
  1784. # ● Knock Back Disable
  1785. #--------------------------------------------------------------------------
  1786.   def knock_back_disable
  1787.     return self.battler.e_knockback_disable
  1788.   end
  1789.  
  1790. #--------------------------------------------------------------------------
  1791. # ● Body Size
  1792. #--------------------------------------------------------------------------
  1793.   def body_size
  1794.     return XAS_BA_ENEMY::BODY_SQUARE[self.enemy_id].to_i
  1795.   end
  1796.  
  1797. #--------------------------------------------------------------------------
  1798. # ● Defeat Process
  1799. #--------------------------------------------------------------------------
  1800.   def defeat_process
  1801.     super
  1802.     enemy_defeat_process(self.battler)
  1803.   end
  1804. end
  1805.  
  1806. #===============================================================================
  1807. # ■ Game Event
  1808. #===============================================================================
  1809. class Game_Event < Game_Character
  1810.   attr_reader   :collision_attack  
  1811.  
  1812. #--------------------------------------------------------------------------
  1813. # ● Attack ON
  1814. #--------------------------------------------------------------------------
  1815.   def attack_on
  1816.       return unless check_battler_exist?   
  1817.       if seal_state?(1)
  1818.          seal_text
  1819.          @collision_attack = false
  1820.          return
  1821.        end
  1822.        @collision_attack = true
  1823.        self.animation_id = self.battler.animation1_id
  1824.        name = @page.graphic.character_name  + "_ACT"
  1825.        if RPG_FileTest.character_exist?(name)
  1826.           @character_name = name
  1827.        end
  1828.        self.refresh
  1829.   end
  1830.  
  1831. #--------------------------------------------------------------------------
  1832. # ● Attack Off
  1833. #--------------------------------------------------------------------------
  1834.   def attack_off
  1835.       return unless check_battler_exist?   
  1836.       @collision_attack = false   
  1837.       return if @page == nil
  1838.       @character_name = @page.graphic.character_name
  1839.       self.refresh
  1840.   end
  1841. end
  1842.  
  1843.  
  1844. #===============================================================================
  1845. # ■ Game_Player
  1846. #===============================================================================
  1847. class Game_Player < Game_Character
  1848.  
  1849. #--------------------------------------------------------------------------
  1850. # ● Can Touch Damage
  1851. #--------------------------------------------------------------------------  
  1852. def can_touch_damage?(event)
  1853.      return false if event.erased
  1854.      return false if event.battler.dead?
  1855.      return false if event.knockbacking?
  1856.      return false if event.battler.stop
  1857.      return false if event.battler.state_sleep   
  1858.      return true
  1859. end
  1860.  
  1861. #--------------------------------------------------------------------------
  1862. # ● Check Event Trigger Touch
  1863. #--------------------------------------------------------------------------
  1864.   alias xrxs64c_check_event_trigger_touch check_event_trigger_touch
  1865.   def check_event_trigger_touch(x, y)
  1866.     xrxs64c_check_event_trigger_touch(x, y)
  1867.     if $game_system.map_interpreter.running?
  1868.       return
  1869.     end
  1870.     for event in $game_map.events.values
  1871.       next unless event.collision_attack
  1872.       unless [1,2].include?(event.trigger)
  1873.         if event.battler != nil and event.x == x and event.y == y and
  1874.            can_touch_damage?(event)
  1875.            $game_player.attack_effect(event)
  1876.         end
  1877.       end
  1878.     end
  1879.   end
  1880. end
  1881.  
  1882. #===============================================================================
  1883. # ■ Game_Event
  1884. #===============================================================================
  1885. class Game_Event < Game_Character
  1886.  
  1887. #--------------------------------------------------------------------------
  1888. # ● Check Event Trigger Touch
  1889. #--------------------------------------------------------------------------
  1890.   alias xrxs64c_check_event_trigger_touch check_event_trigger_touch
  1891.   def check_event_trigger_touch(x, y)
  1892.     xrxs64c_check_event_trigger_touch(x, y)
  1893.     if $game_system.map_interpreter.running?
  1894.       return
  1895.     end
  1896.     return unless self.collision_attack
  1897.     if self.battler != nil and x == $game_player.x and y == $game_player.y
  1898.       $game_player.attack_effect(self)
  1899.     end
  1900.   end
  1901. end
  1902.  
  1903. #===============================================================================
  1904. # ■ XAS_BA_BATTLEEVENT_NONPREEMPT
  1905. #===============================================================================
  1906. module XAS_BA_BATTLEEVENT_NONPREEMPT
  1907.  
  1908. #--------------------------------------------------------------------------
  1909. # Update
  1910. #--------------------------------------------------------------------------
  1911.   def update
  1912.     return if self.battler != nil and $game_system.map_interpreter.running?
  1913.     super
  1914.   end  
  1915. end
  1916.  
  1917. #===============================================================================
  1918. # ■ Game_Event
  1919. #===============================================================================
  1920. class Game_Event < Game_Character
  1921.   include XAS_BA_BATTLEEVENT_NONPREEMPT
  1922. end
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929. #===============================================================================
  1930. # ■ Game_Character
  1931. #===============================================================================
  1932. class Game_Character
  1933.  
  1934. #--------------------------------------------------------------------------
  1935. # ● Blow
  1936. #--------------------------------------------------------------------------
  1937. def blow(d, power = 1)
  1938.     if self.move_route_forcing and $game_system.map_interpreter.running?
  1939.        return
  1940.     end   
  1941.     @need_refresh_pose = true
  1942.     @pose_type_old = " X "   
  1943.     @knock_back_prespeed = @move_speed if @knock_back_prespeed == nil
  1944.     return if self.knock_back_disable
  1945.     reset_pickup if self.battler.is_a?(Game_Actor)
  1946.     power.times do
  1947.       if passable?(self.x, self.y, d)
  1948.          @x += ([3,6,9].include?(d) ? 1 : [1,4,7].include?(d) ? -1 : 0)
  1949.          @y += ([1,2,3].include?(d) ? 1 : [7,8,9].include?(d) ? -1 : 0)
  1950.       end
  1951.     end
  1952.     if self.battler.is_a?(Game_Enemy)   
  1953.        enemy_knock_duration = XAS_BA_ENEMY::INVICIBLE_DURATION_ENEMY[enemy_id]
  1954.        if enemy_knock_duration != nil
  1955.           @knock_back_duration = enemy_knock_duration
  1956.        else
  1957.           @knock_back_duration = XAS_BA_ENEMY::DEFAULT_INVICIBLE_DURATION_ENEMY   
  1958.        end      
  1959.     else
  1960.        @knock_back_duration = XAS_BA::KNOCK_BACK_DURATION_HERO
  1961.        jump(0,0) if XAS_BA::JUMP_HIT_HERO and self.action == nil
  1962.     end   
  1963.     @move_speed = XAS_BA::KNOCK_BACK_SPEED
  1964. end  
  1965.  
  1966. #--------------------------------------------------------------------------
  1967. # ● knockbacking?
  1968. #--------------------------------------------------------------------------
  1969. def knockbacking?
  1970.    return @knock_back_duration != nil
  1971. end
  1972.  
  1973. #--------------------------------------------------------------------------
  1974. # ● Collapsing?
  1975. #--------------------------------------------------------------------------
  1976. def collapsing?
  1977.    return self.collapse_duration.to_i > 0
  1978. end
  1979.  
  1980. #--------------------------------------------------------------------------
  1981. # ● update_text_popup
  1982. #--------------------------------------------------------------------------      
  1983. def update_after_text_popup
  1984.      return if self.battler.after_damage_pop_time == 0
  1985.      self.battler.after_damage_pop_time -= 1
  1986.      display_damage(self.battler.after_damage_pop) if self.battler.after_damage_pop_time == 0
  1987. end
  1988.  
  1989. #--------------------------------------------------------------------------
  1990. # ● update after animation
  1991. #--------------------------------------------------------------------------      
  1992. def update_after_animation
  1993.      return if self.battler.after_animation_time == 0
  1994.      self.battler.after_animation_time -= 1
  1995.      self.animation_id = self.battler.after_animation_id if self.battler.after_animation_time == 0
  1996. end  
  1997.  
  1998. #--------------------------------------------------------------------------
  1999. # ● update knockbacking
  2000. #--------------------------------------------------------------------------      
  2001. def update_knockbacking
  2002.      @knock_back_duration = 5 if self.battler.state_sleep
  2003.      return unless self.knockbacking?
  2004.      return if self.battler.stop
  2005.      @pattern = 0 unless @direction_fix
  2006.      @knock_back_duration -= 1 unless self.throw_active
  2007.      update_knockbacksprite
  2008.      if @knock_back_duration <= 0
  2009.         @knock_back_duration = nil
  2010.         @knock_back_prespeed = nil
  2011.         if self.is_a?(Game_Event)
  2012.            @pose_type = ""
  2013.            @pose_type_old = @pose_type
  2014.            @character_name = @page.graphic.character_name
  2015.            self.refresh
  2016.         end
  2017.      end
  2018. end
  2019.  
  2020. #--------------------------------------------------------------------------
  2021. # ● Update Knockback Sprite
  2022. #--------------------------------------------------------------------------   
  2023. def update_knockbacksprite
  2024.      return if @pose_type == "Refresh"
  2025.      return if self.is_a?(Game_Player)
  2026.      @pose_type = "Refresh"
  2027.      name = @page.graphic.character_name  + "_HIT"
  2028.      if RPG_FileTest.character_exist?(name)
  2029.         @character_name = name
  2030.         self.refresh
  2031.      end      
  2032. end
  2033.  
  2034. #--------------------------------------------------------------------------
  2035. # ● Seal State
  2036. #--------------------------------------------------------------------------   
  2037. def seal_state?(type)
  2038.      case type
  2039.      when 0 #Mute
  2040.         return true if self.battler.state_mute
  2041.      when 1 #Seal Attack
  2042.         return true if self.battler.state_mute
  2043.         return true if self.battler.state_seal_attack
  2044.      when 2 #Seal Skill
  2045.         return true if self.battler.state_mute
  2046.         return true if self.battler.state_berserk        
  2047.         return true if self.battler.state_seal_skill
  2048.      when 3 #Seal Item
  2049.         return true if self.battler.state_mute
  2050.         return true if self.battler.state_berserk        
  2051.         return true if self.battler.state_seal_item
  2052.      end
  2053.      return false
  2054. end   
  2055.  
  2056. #--------------------------------------------------------------------------
  2057. # ● Seal Text
  2058. #--------------------------------------------------------------------------
  2059.   def seal_text
  2060.       self.battler.damage = XAS::SEALED_TEXT
  2061.       self.battler.damage_pop = true   
  2062.       $game_system.se_play(XAS::SEALED_SE)
  2063.       $game_temp.clear_setting2 if self.battler.is_a?(Game_Actor)
  2064.   end
  2065.  
  2066. end
  2067. #===============================================================================
  2068. # ■ XAS_DamageStop
  2069. #===============================================================================
  2070. module XAS_DamageStop
  2071.  
  2072.   #--------------------------------------------------------------------------
  2073.   # ● Actiong?
  2074.   #--------------------------------------------------------------------------
  2075.   def acting?
  2076.     return (super or self.knockbacking? or self.collapsing?)
  2077.   end
  2078. end
  2079.  
  2080. #===============================================================================
  2081. # ■ Game_Player
  2082. #===============================================================================
  2083. class Game_Player < Game_Character
  2084.   include XAS_DamageStop
  2085. end
  2086.  
  2087. #===============================================================================
  2088. # ■ Game_Event
  2089. #===============================================================================
  2090. class Game_Event < Game_Character
  2091.   include XAS_DamageStop
  2092. end
  2093.  
  2094. #===============================================================================
  2095. # ■ Game_Map
  2096. #===============================================================================
  2097. class Game_Map
  2098.  
  2099.   #--------------------------------------------------------------------------
  2100.   # ● Starting?
  2101.   #--------------------------------------------------------------------------
  2102.   def starting?
  2103.     if $game_system.map_interpreter.running?
  2104.       return true
  2105.     end
  2106.     for event in $game_map.events.values
  2107.       return true if event.starting
  2108.     end
  2109.     return false
  2110.   end
  2111. end
  2112.  
  2113. #===============================================================================
  2114. # ■ Interpreter
  2115. #===============================================================================
  2116. module XAS_ACTION
  2117.  
  2118.   #--------------------------------------------------------------------------
  2119.   # ● Xas Z Shoot Bullet
  2120.   #--------------------------------------------------------------------------
  2121.   alias xas_z_shoot_bullet shoot_bullet
  2122.   def shoot_bullet(action_id)
  2123.     bullet_token = xas_z_shoot_bullet(action_id)
  2124.     return bullet_token
  2125.   end
  2126. end
  2127.  
  2128. #===============================================================================
  2129. # ■ Sprite_Battler Fix
  2130. #===============================================================================
  2131. class Sprite_Battler < RPG::Sprite
  2132. alias xas_damage_update update
  2133.  
  2134. #--------------------------------------------------------------------------
  2135. # ● Update
  2136. #--------------------------------------------------------------------------
  2137.    def update
  2138.     super
  2139.     if @battler_visible
  2140.        if @battler.damage_pop
  2141.         damage(@battler.damage, @battler.critical,@battler.state,@battler.item)
  2142.         @battler.damage = nil
  2143.         @battler.critical = false
  2144.         @battler.damage_pop = false
  2145.       end
  2146.     end  
  2147.     xas_damage_update
  2148.    end
  2149. end
! Z5 {4 }+ }8 \$ p. O1 s0 |
应该没有问题的才对,替换XAS - Battler 1试下吧,
1 p  R, b: W; r7 r. d/ ~我这里完全是正常的。
作者: hys111111    时间: 2012-4-15 19:19
本帖最后由 hys111111 于 2012-4-15 19:19 编辑 2 N3 U, _* T7 J# L: D
. e4 u. ]5 L: {& F
我试验过,全键盘和XAS脚本无冲突,为什么不直接放全键盘脚本进去就行了?
作者: timmyyayaya    时间: 2012-4-15 20:48
本帖最后由 timmyyayaya 于 2012-4-15 20:48 编辑 : @9 m1 y$ R  q  P$ r' a; b8 R; h/ E

0 N& i/ Q9 }! l$ n401行
  1.       for i in [email][email protected][/email]
复制代码
發生SyntaxError
作者: ML4455739    时间: 2012-4-15 21:09
看到email我就疼了,DZ这论坛系统真心奇葩+ D4 m  U0 W& a4 Y
[email protected]
" W) i  v, F  B3 f, n: ~) M& d这行改回
  1. for i in [email protected]
复制代码
就行了
作者: timmyyayaya    时间: 2012-4-15 21:17
感谢您细心的修正,目前好像没有问题了,3 D0 B2 `: W3 P& ]0 T7 V# n
若有其他问题再询问,我试着改按键看看,超感谢!
/ P' z) q5 E; Z$ b; ~/ A- _/ n! X  g' R% ^+ _

作者: ML4455739    时间: 2012-4-15 21:19
恩。
( `  e: L( f+ V" ]( r4 u7 M我测试的时候发现了一个问题,
% C  U6 @% S5 d2 i1 `就是热键装备好了的物品一旦用尽就会报错,
" c; g( y# T0 d, U7 M想办法看怎么修复。
作者: timmyyayaya    时间: 2012-5-20 18:25
ML4455739 发表于 2012-4-15 21:19 5 S3 q$ u$ i* G
恩。( E8 `# e/ s9 G6 V, {' K
我测试的时候发现了一个问题,
- O' n$ }3 d# N* i$ N1 G/ {( u就是热键装备好了的物品一旦用尽就会报错,

) y0 s  r8 a' h! [$ ]% q: v+ E嗯…这个问题有解决了吗?4 o! f6 n* a8 X0 A; E  y6 K

8 j( \8 F8 @% A; L4 a% V另外,想请教一下,原本的XAS – Menus不需要使用了想移除掉,
  G& R: H# C# Y, l  y- t但是Hot Key HUD好像还是会使用到QUICK MENU,
4 D, [5 k% t& ^# ^" {  V, z9 F不知道该怎么修改会比较好?
作者: ML4455739    时间: 2012-5-20 18:42
很抱歉,个人技术不力……
5 T" d* z6 Q/ j; B0 t0 l) P2 G253~255行怎么都发挥不出应有的效果7 i4 N/ G; [8 y: R
这个热键和QuickMenu几乎是捆绑式的,要想分开很难,
' i: F4 [: m9 c再者分开的话又需要设计一个Scene了,可能的话还是留着吧。' j& t0 k0 `# B! d

, W7 g! ]$ ^0 v5 g7 C6 y这群组里的关注度很少,orz还是发主区里去更容易得到帮助。
作者: timmyyayaya    时间: 2012-5-20 19:01
ML4455739 发表于 2012-5-20 18:42 : I0 x% A& n3 W* j+ Q
很抱歉,个人技术不力……1 o* C5 M% m- \
253~255行怎么都发挥不出应有的效果
2 q: z8 I5 L1 t' ~这个热键和QuickMenu几乎是捆绑式的,要想分 ...
/ e  N) E$ i8 l1 K( Q+ A
不知道是不是能拔除QuickMenu,热键的设置都必须从选单里去设定?/ P& I2 L1 F  ]: x& U
! R, z# q. m) i! `2 c6 Q; {  \) @
RPG Maker XP那里发问XAS相关的问题,有时候都没有人响应…{:2_271:}




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