查看: 1557|回复: 2

水面动态倒影,求解

[复制链接]
梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
回帖
4
发表于 2014-6-25 11:31:39 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
[code][/code]
' F& v" Y. w. P" X' g- [这个代码怎么用啊,有大神知道吗。我从国外找的。. `3 w7 K# S! V& @" m3 |
http://galvs-scripts.com/2013/02/21/character-effects/
& g% h8 b6 R- Y5 l0 d是关于动态倒影的
梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
回帖
4
 楼主| 发表于 2014-6-25 11:32:43 | 显示全部楼层
  1. #------------------------------------------------------------------------------#( ~- \: c* t7 t. I. s
  2. #  Galv's Character Effects4 |8 e+ |7 l4 I" q! Y
  3. #------------------------------------------------------------------------------#, L, T* `' q. D* i; h$ e6 t
  4. #  For: RPGMAKER VX ACE0 B! H. `( E9 R; S& e( y1 F4 j0 i
  5. #  Version 2.1% C0 R/ Z9 o. c  d  ?0 I6 l
  6. #------------------------------------------------------------------------------#
    9 L& C5 e1 \( F7 Q, h! {' s2 Z% \$ J
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows* H  w2 B1 R7 W0 I, Z6 E
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects
    & v! U5 z2 \, P# u
  9. #                           - Fixed shadow facing bug, ^# P. \0 R9 {
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows
    4 ~8 Q5 l' \# f" U  X7 P
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows
    + }# _3 |" u: M, E8 J0 c
  12. #  2013-02-22 - Version 1.7 - bug fixes
    $ j- a) S, _# T% E
  13. #  2013-02-22 - Version 1.6 - added icon effect) I/ q" Z) G  v/ \
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps/ ^* h; q- y" ]7 D4 k8 ~
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles; s! W5 x# c& U$ Z
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks) G: U3 l# F9 W) G( X
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)/ ]8 \* j( M; \* X+ V% P1 K
  18. #  2013-02-21 - Version 1.1 - updated flicker effect' w3 ?0 f, u# d& o
  19. #  2013-02-21 - Version 1.0 - release: O  S8 ~6 D0 Y; O( h. }! R6 G
  20. #------------------------------------------------------------------------------#" O( w9 y$ Q4 H4 Y' d+ @
  21. #  This script was made to provide some additional effects for characters such# b! O' P2 C6 o! M7 p# \: k2 d
  22. #  as events, followers and the player on the map.0 o; P, t& ]$ Y' b$ i1 {
  23. #  Currently it includes:# i, w& m- y( D8 s9 e! u
  24. #6 ?2 y. h0 n7 @
  25. #  Shadows3 r# W3 |" R; p, G
  26. #  Shadows that appear under player and events in a directions depending on' ?; Y. n+ I, }. v9 H! n3 j0 J) M
  27. #  a light source that you choose." e/ s, h. ?/ J7 i, Y
  28. #
    , s  L5 C# A" ]- P, t
  29. #  Parallax Reflect
    4 J+ `# B* v( j9 m* o; j5 H
  30. #  Reflections that appear on the parallax layer for events and actors to be- h& t4 f+ U* \5 i) f
  31. #  used for things like reflections in the water or glass floor etc. To get' Y6 U' W& v. l- B2 I1 r1 Z2 \! q( J
  32. #  effects like the demo, you need to edit the charset graphic to make the water
    ' w8 A2 F- y. @. ~* `
  33. #  partially transparent.
    + I1 C7 H. \  I
  34. #+ A% x8 L  j) X- V3 I2 U
  35. #  Parallax Mirrors6 s+ z3 }3 P- V$ W  Y- x+ n
  36. #  Much like reflect but are instead actors and event are reflected in a mirror
      i6 w. _' j8 c1 h+ f2 j. x- c2 ?# T
  37. #  on a wall designated by a region. Both mirror and reflect effects can be
    ) L/ W6 K6 ^5 j# a5 s
  38. #  changed so actors and events can use different charsets for their reflections: M( N8 a4 p* j+ W4 X" ~
  39. #1 o2 e$ ^5 f% _$ Y9 j5 _  J
  40. #------------------------------------------------------------------------------#* v- ?- V3 ?) p- |7 u1 t4 _
  41.   
    2 R2 [  P3 @! _1 v3 x( Y# u7 V

  42. # t( y* G. x6 x* G# Y* S
  43. #------------------------------------------------------------------------------#- h& {0 L5 A3 ?
  44. #  NEW - First event command as a COMMENT  y5 R8 x9 W( f+ e  p: S
  45. #------------------------------------------------------------------------------#; `. n+ H9 N7 O4 n+ j
  46. #  You can add a comment as the first event command on an event page to set if
    * M2 I4 i2 m& ]$ p6 L' G
  47. #  that event has an icon, shadow or reflection active. The tags to use are
    ! J; w( |5 O# |( y0 S
  48. #  below, all must be on the same line in the comment.+ Q0 V# c; n+ \, M/ v7 H0 I0 t
  49. #, I& x8 I% O& }, o1 T5 z
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)$ ^) q" z: F7 J! J9 Q
  51. # <shadow>           # set the event to display a shadow# H' O$ X& {' _! o6 t
  52. # <reflect>          # set the event to display reflections
    7 w6 j7 d% ~- @3 W: Z7 o
  53. #- u+ N' s, f% Q/ C& V" u  k
  54. #------------------------------------------------------------------------------#
    8 N) ?9 h' N* C! l6 o" K! E2 b: h
  55. #  EXAMPLE:
    1 f  F: Y( Z( a  s2 d; g
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event1 N3 O/ O, P- _# R* W7 r
  57. #------------------------------------------------------------------------------#. o0 j( o. n. \0 Z" b" M

  58. - z; h3 U' H6 W, R: N

  59. ( y: B4 _9 U! c. `$ t
  60. #------------------------------------------------------------------------------#; f) m# X4 |: a
  61. #  SCRIPT CALLS:
    " b& P2 X# t- y6 B0 I" c
  62. #------------------------------------------------------------------------------#( X) G% I# G: R# M; U( Y: _- o
  63. #; ], [$ W2 S3 g: M/ H
  64. #  char_effects(x,x,x,status)$ Z1 u+ I# \9 c8 K/ P
  65. #
    5 G; ~! E1 L/ |& D0 V
  66. #------------------------------------------------------------------------------#
    6 {, w; T- S: a6 A3 e. |
  67. #  # each effect can be true or false to enable/disable them during the game.
    / z& t- K1 F7 n
  68. #  # you can change multiples of effects at once, x being the effect number  ?% o7 t+ R: E; W# a" @
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons! {% `2 G3 t" q) W2 q0 h* ?* p
  70. #------------------------------------------------------------------------------#
    ! Q- r/ ~" Y& q; F0 Z* T5 i4 ]$ D. R
  71. #  EXAMPLES:2 ~' q8 \/ K6 r6 [
  72. #  char_effects(0,true)              # turn reflections on
    / D* @( K2 A$ D) r( L( b
  73. #  char_effects(0,2,true)            # turn reflections and mirror on
    " ]- c- I; J! }5 z, s' s# I4 _
  74. #  char_effects(1,3,false)           # turn shadows and icons off
    & k3 b/ Q: r0 B6 e% i
  75. #------------------------------------------------------------------------------## H' |6 q/ i( \9 E( s
  76. #/ E, O% K2 I% {5 x
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset
    4 t* P- h, w, Y& W0 j- k9 N/ W8 Z/ O
  78. #
    + |8 T( [# a% W0 O: S: b% L
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset: t' T' e4 y+ {
  80. #
    , o; n; [5 n" C( R
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset7 r8 d$ s+ B& H& `  _! n
  82. #
    $ q% O# i2 O" h4 f! W8 k
  83. #------------------------------------------------------------------------------#
      I/ N" }: V* I& [6 I% I3 r
  84. #  EXAMPLES:' h2 u/ L1 O% }4 {' T9 n
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite
    ) v- z8 Z7 V! I* m+ E3 h* a' }  D
  86. #                                    # in position 2 of "Actor2" charset.7 W/ u2 e8 o! q5 |
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of" b( i( t( B3 H1 V4 O2 y
  88. #                                    # "Actor4" charset.
    $ @3 j! U; A0 w9 T$ A
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of) T9 Y3 J6 _" T6 X' K6 h8 H3 p7 K
  90. #                                    # "Vehicle" charset.5 ?* Y4 V1 y! P, f+ J
  91. #------------------------------------------------------------------------------#/ \0 J/ S1 X1 o, `( Q( a6 y
  92.   
    6 u4 ~* t# J* p# P
  93. #------------------------------------------------------------------------------#6 o0 ?: [5 _" P; f- B
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS  v% I  |& N$ a, x  B
  95. #------------------------------------------------------------------------------#
    0 a5 E/ o2 l3 [) e% v6 |: {0 U8 E- |
  96. #( Q" k$ r& T+ I; r
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off, X9 g7 i% v& q
  98. #                          # use this to specify for mirror and reflect.
    # E" c; S0 b% d. w7 z; `4 R% A8 A) n
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change8 I9 j0 [' a2 R1 }% J3 ^0 x
  100. #                          # to change all events use :all
    + M- x& e6 t' }* @
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make; J- E0 b0 T# W3 Z0 ^0 {
  102. #                          # it 0 for no icon.
    $ Z. z. ]- G* c' K
  103. #4 \$ ]& V4 W9 b* h  ]- `
  104. #------------------------------------------------------------------------------#
    4 S# ^; s4 U4 X% Z
  105. #  EXAMPLES:
    - |% }. j* a6 ~) T4 Z8 h
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON, b* c! y  R) `7 A
  107. #  shadow(1,false)         # Turn event 1 shadow OFF
    / h, q( S5 r( Z' \1 j6 K: @% M5 P
  108. #  reflect(:all,true)      # Turn all event reflections ON
    4 |/ w7 w2 M" l+ U* @$ d
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear) b& N/ V& Q* n2 Y8 D
  110. #
    ) l; ~5 d7 A$ T$ I+ J4 t
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering/ W% U6 K2 \! t4 B: \; o
  112. #        a map. This is a design decision to try to keep lag to a minimum. You: @9 J2 h7 t1 H+ t* }2 Z
  113. #        should use these effects sparingly and only activate them on events
    ( E3 O4 I* V6 \1 S: P, C; d% Y
  114. #        that require them.
    # S' [9 s/ G" C! J; _+ T
  115. #------------------------------------------------------------------------------#) @7 H* s4 L2 G: x
  116.   
    2 Z5 R3 D- s7 x! w) d8 J
  117. #------------------------------------------------------------------------------#1 c0 T+ o- L$ t: n6 P
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES
    + e' R# E! h8 l# j& Z
  119. #------------------------------------------------------------------------------#, ?+ L3 J; t# T  ~3 C9 v+ N& @4 f9 k
  120. #2 {, j) g/ d2 p8 J
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default
    : K+ D" j  L! R+ B1 ]! y
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off
    % G9 x1 k$ M; S7 }
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.& K8 ^0 y" i6 n* N
  124. #1 S% M- a# h) ]( Y
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects
    0 v0 s. m! o% J* Z
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.
    & H: ~( ?  M" z
  127. #  v_icon(x,x,x,icon_id)
    ( ~, x9 V0 V6 Y% P" j  P# y
  128. #  a0 I6 r2 B; X! G
  129. #------------------------------------------------------------------------------#1 r' j* h0 P$ q0 [
  130.     i) h2 ^& H. ^, V/ _2 ^7 a% g
  131. #------------------------------------------------------------------------------#
    ' F: N- h: d, G8 F
  132. #  SCRIPT CALLS for shadow options
    7 c5 h5 O& G* z
  133. #------------------------------------------------------------------------------#% E6 d% y+ q! N% g. x
  134. #1 I6 m, A9 @* P; q
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the . H, _8 i) [  f6 J, y; W
  136. #                              # light source number you wish to change (for
    . e5 E* O1 Y6 ?& t. Q) X
  137. #                              # more than one). These are reset on map change.- [1 d7 K4 V; e# Y. C9 Y
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light." ~% e0 [9 m0 R' H. R, c
  139. #                              # This will need to be in parallel process if you
    ' D6 n+ w' Q3 ~' V! l7 z7 C! y
  140. #                              # want it to be a moving light.* n/ }5 U5 Q! Y
  141. #
    1 v% Y7 b7 l' w. `, u7 m
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below
    , j. D' |& [* d( Q1 S0 V# V" `; c6 ?
  143. #
    / t% V0 B% f3 z( M
  144. #    # intensity = opacity when standing next to the light source (255 is black)
    & b. {* `$ U  e5 {1 H$ c) u
  145. #    # fade = amount shadow becomes more transparent the further away you are.
    9 t4 y+ N6 O% t
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.
    - [  `6 m2 w4 |! @. L
  147. #
    # J+ g. X6 C9 ]6 E; {+ x0 Q
  148. #------------------------------------------------------------------------------#
    ' D" X9 _7 g% ~; @
  149. #  EXAMPLE:
    2 ^& `- L/ |, q8 p6 k1 p
  150. #  shadow_options(80,10,false)    # This is the default setting.
    % g( D# T# U) p
  151. #------------------------------------------------------------------------------#
    1 F  e: T+ J* ~! r  _/ x) v& B0 G
  152.   
    , }/ O) G; |" L; ^" T1 E
  153. #------------------------------------------------------------------------------#) G. l2 R7 A) s. k! d, F
  154. #  SCRIPT CALLS for reflect options
    + l3 b3 [1 a2 H. U' c- N
  155. #------------------------------------------------------------------------------#
    / }/ `4 U, v6 o) N8 Z
  156. #3 @* H  C& y/ [
  157. #  reflect_options(wave_pwr)
    ' Q2 n  i1 n; O1 T7 H* J
  158. #" s9 _+ k6 W! V6 v" R8 C, w
  159. #    # wave_pwr = how strong the wave movement is. 0 is off
    , s; U$ f* t0 z5 m" h5 x
  160. #
    ) c0 M+ B; e7 V0 b! t
  161. #------------------------------------------------------------------------------#! k; p! x4 {) m, |6 @" `& r
  162. #  EXAMPLE:9 l0 |: ^) @; @, X* i
  163. #  reflect_options(1) # Turn wave power to 18 o) z& l, L' V+ K
  164. #------------------------------------------------------------------------------#+ W! q! h: }& u- H# G
  165.   ' x0 \+ k+ `; X6 G5 [
  166.   ; M9 ^, ]' o0 F1 b. i/ |- W
  167. #------------------------------------------------------------------------------#* D, ?0 D% B; E% `$ L3 i$ {( k
  168. #  NOTETAG for ACTORS3 l3 q! M8 [; w3 |% m
  169. #------------------------------------------------------------------------------#
    : I/ e7 {: x; Q$ G) v/ T( x9 i9 \
  170. #
      ]" `2 A, j" A5 ^( z3 T1 ~; ^
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)4 e7 x! m; v- V2 \% X4 ?9 e, t9 l' ^
  172. #
    ) r: W( ^' b' P1 d' Q2 E, ^- W
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections
    ! j: m& j4 v$ \
  174. #                                  # and use the character in position 'pos'
    6 q4 c  x( u  l/ P
  175. #
    0 V2 a& j7 J0 @( ?- t$ X
  176. #------------------------------------------------------------------------------#
    2 Y6 o4 D6 x. z; ?
  177. #  EXAMPLES:
    * \1 {9 T; Y7 z* E* f7 ]/ R
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset" _/ i& Q- ~$ L& ^# D. |8 t
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset
    - x" B- ~1 I$ z$ B( ?
  180. #------------------------------------------------------------------------------#
    4 f" B& A; P9 h( n5 T! j
  181.   
    : [) G( e1 p8 T  S1 a8 }( Z7 [5 _
  182.   $ l! D$ a; D) g0 W
  183. ($imported ||= {})["Galv_Character_Effects"] = true
    # m, t) X! K% k7 C  z
  184. module Galv_CEffects* q+ s6 O7 H8 Q& {; r5 L. p
  185.   
    1 o: U5 G* l; D5 Y4 g
  186. #------------------------------------------------------------------------------#  
    / B* T5 W  T* M5 |8 E9 }! r
  187. #  SETUP OPTIONS
    * ]; T0 f* S. ?( E# k( }
  188. #------------------------------------------------------------------------------#
    6 w( V* O# m8 A9 W
  189.   0 ]; q" G( T# g( E- Y
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the
    , H4 k5 l9 h, K& I, D! ^
  191.                         # region on the wall you want to make reflective (and
    . \, R* z* W/ f/ m% b9 g
  192.                         # then use tiles/mapping that make the parallax visible)$ f/ C" j) M. e
  193.   
    : L1 ^: s! g7 v0 q
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters" L, F5 p" R/ W( q" T* ^. {
  195.    
    - f2 z" B% `! M2 Y! I, Q! [
  196.   REFLECT_Z = -10       # Z level of reflections
    + s: d. I; B% B8 e3 `4 O
  197.   SHADOW_Z = 0          # Z level of shadows8 R4 y6 ^; }& H- f. E; x
  198.   
    5 U/ j$ C( @: f' }8 h, C
  199. #------------------------------------------------------------------------------#  
    ( v2 |& Z0 I! }- F) z: }& R
  200. #  END SETUP OPTIONS
    & t5 G  B! x$ R7 l$ a$ ?7 {/ N3 T
  201. #------------------------------------------------------------------------------#) [5 d& a; e! L) Z: q0 k
  202. end
    ( s6 Q7 [. w1 Q6 w3 y
  203.   ! U2 |1 ]9 _# H2 S; W2 ]$ n
  204.   5 R9 R: S* X% f6 V: w3 I% m

  205. 6 G+ V3 E, V/ V" L: c; t: x
  206. 8 P& F4 I& e9 S7 N
  207. class Game_Map. y5 l1 D% \" b+ A. Y
  208.   def do_icons(refresh = true)
    5 V" {" j; t* s
  209.     @events.values.each { |e|
    ! q% f  l/ X8 C
  210.       next if !e.list$ m' |  s5 @/ u9 l) F4 m- Q: |* u9 }
  211.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/
    8 E& o! u9 U' V& Y' [2 I
  212.         e.icon = $1.to_i0 L( y8 F: Q9 t# R8 t+ P
  213.         e.icon_offset = [$2.to_i,$3.to_i]
    * y( A4 @. N2 G- r
  214.       else
    6 @! m7 W& y$ F
  215.         e.icon = 0. M: S& ?* I0 v5 l+ S8 B* X
  216.         e.icon_offset = [0,0]' \& A( q; _' b1 \. A8 F* P
  217.       end
      y# Z4 r! F4 y& W
  218.     }8 G# I" j6 Q" I, j
  219.     SceneManager.scene.spriteset.refresh_effects if refresh
    - a* f) @0 I( O
  220.   end( m/ V' _: p2 f+ S/ d
  221.    
    & G/ d8 w3 V, S: ?
  222.    
    % S9 w  C2 q& T1 m  S$ c
  223.   def do_shadows(refresh = true)! j, H  r9 n2 z( D
  224.     @events.values.each { |e|! _7 J/ C# d5 t( Q" ~
  225.       next if !e.list' c- }3 a( @9 k) U+ m% A
  226.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/' \8 q; X) k5 M: S4 ?; a
  227.         e.shadow = true. C& o5 g/ C: [! T
  228.       else
    : A# Z' d& ?6 Z( w1 o% B. j
  229.         e.shadow = false/ d/ O: Y. Z" ~8 @) m7 |# Z
  230.       end
    7 ?6 k, N9 ]* q& B
  231.     }- f7 g$ O' g" `) C9 [2 Q
  232.     SceneManager.scene.spriteset.refresh_effects if refresh: n+ I+ J- M: p8 @1 _
  233.   end* G, G1 Q' Z1 O3 c
  234.    
    : M( {* f" D+ K# Y# B9 [
  235.   def do_reflects(refresh = true)
    9 U6 W& \, {/ B
  236.     @events.values.each { |e|# ?8 A6 K0 j8 h& M& @
  237.       next if !e.list& m$ {8 h0 s! N9 P+ q3 X: Y
  238.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>/5 {$ v3 C. K. V8 O" `" t, \
  239.         e.reflect = true
    ! [( h; L: G! q* B9 s
  240.       else
    3 Y- v4 \! U* n! [* E
  241.         e.reflect = false) b# r9 b9 x4 K; ]$ T
  242.       end* r! o+ ^5 Z# E
  243.     }9 Q! Y# c0 _0 ]7 y' s* z! ]6 h/ ]
  244.     SceneManager.scene.spriteset.refresh_effects if refresh/ l5 j8 F( ]! }5 [  j5 N: ]
  245.   end9 H" b3 U* ]; P6 M' j
  246.    % O% ~( {% z2 t5 ~* T( r* L2 M' [
  247.   def do_all_chareffects7 q3 V8 k0 d8 P5 v
  248.     do_icons(false)0 p6 M- \# }$ P6 W& N* ^3 g, {
  249.     do_shadows(false)
    ( [4 z, \; q! C
  250.     do_reflects(false)8 j1 e. D$ `+ I0 T' d9 r' {: ?8 b
  251.   end/ [- h( k( w7 \7 b0 @6 W% @: Z3 r, q1 O
  252.    " n: d2 Q7 @* R3 C" b+ {
  253. end # Game_Map
    6 y& {% `4 K* O! s2 A4 C' Q
  254. 6 E) ~  ?# l0 t7 S$ s) j; t

  255. 7 j3 }5 n+ b8 z

  256. ' M6 w! W/ n" r1 X9 |
  257.   
    . q% D  a8 w! o8 v3 n9 Q1 H
  258. class Game_Interpreter
    6 J% P0 K2 q, V5 r: p( g2 g
  259.    
    ! ?. C  ?) n) m9 a! q! Z( D
  260.   def remove_icon
    2 n) Z/ h: T: p$ M, M% F
  261.     icon(@event_id,0)& ]4 q! X. O' E& m
  262.   end
    # L& ]- a; _0 }
  263.   ! b$ h9 M/ S; n: C! _7 k
  264. #-----------------------------------#
    4 o* f7 @6 h$ \' e7 `2 j
  265. #  REFLECTIONS+ o3 A+ D. z$ ~# t& }* N2 N
  266. #-----------------------------------#
    9 B" t1 p$ X( r, _, U8 t
  267.   . n- g, f4 [, {- _- m
  268.   # Add/Remove Reflections from selected events
    5 T% M4 X  p0 c% b9 a! `, y: b! o! z
  269.   def reflect(*args,status)
    % _0 X* J$ y$ [2 F
  270.     char_ids = [*args]
    0 ]+ O- M- A) s* E4 B
  271.     if char_ids == [:all]
    4 `+ L0 ~: v/ ?4 L* t
  272.       $game_map.events.values.each { |e| e.reflect = status }/ B) l  ^$ M# f
  273.     else
    1 Z* n* e3 z7 d' V; L
  274.       char_ids.each {|c| $game_map.events[c].reflect = status }8 a/ u7 c6 i) r: `& R
  275.     end* |# u% I3 `* j2 |# R
  276.     SceneManager.scene.spriteset.refresh_effects4 H! F; [2 Y: Z4 B1 a5 l6 w
  277.   end
    5 }5 G* Q9 K9 t# e  C8 F# Q
  278.     ' n# \- [- p& }7 X) u  P3 T
  279.   # Change forever actor's reflect status
    8 \0 G3 Z0 {$ T3 \; [  t/ ^; S- I# D
  280.   def actor_reflect(actor_id,status)3 G. }; A+ o9 N, q
  281.     $game_actors[actor_id].reflect = status0 R: o3 l2 b! d6 J$ ]
  282.     $game_player.refresh
    4 i) j. F) x% B0 V0 g' C7 p) S* q
  283.   end/ {  H; v1 Q! |6 z" j. J0 _' h1 J
  284.    
    , B7 d- w' Z1 }; e! ~
  285.   # Change forever vehicle's reflect status
    & G8 d+ K% g3 k6 V7 r
  286.   def v_reflect(*args,status)
    0 @4 r8 T8 R6 P6 S5 ^
  287.     char_ids = [*args]
    : l1 e6 [( L0 K# Y) [& d! Q
  288.     if char_ids == [:all]- b' Z* T* O8 N, H1 i; Q
  289.       $game_map.vehicles.each { |v| v.reflect = status }
    # Z9 b4 ^1 f' `$ K
  290.     else
    ( T. }) U) D! Y, m; R% f7 L# q
  291.       char_ids.each { |v| $game_map.vehicles[v].reflect = status }8 O5 p, t, }  l$ t- x
  292.     end
    8 h% D: s* @4 Y
  293.     SceneManager.scene.spriteset.refresh_effects: a! B5 v3 r: ?$ Z. W
  294.   end
    & z: l4 h) W: e( {' H$ h" |
  295.   
    ' J3 G0 J8 U$ s- @7 U" v3 T; T
  296.   def reflect_options(*args)
    & g( C) g% S$ u+ n
  297.     $game_map.reflect_options = [*args]
    ) L2 c( K8 ~9 f( k8 Z- F
  298.     SceneManager.scene.spriteset.refresh_effects
    9 C! n( m0 I, k5 u: J/ I4 ?
  299.   end) k% Z9 }. [1 K# p& p  f/ M( M, h
  300.     ; J+ F1 h* ^% w6 K7 u4 O
  301.   # Actor reflect sprite change
    ' A' j. [/ c5 d$ i, U0 r
  302.   def reflect_sprite(actor_id,filename,pos)& v# K" U2 A- s/ e8 e( x1 G
  303.     $game_actors[actor_id].reflect_sprite = [filename,pos]: G/ W. k0 d2 z
  304.     $game_player.refresh9 x0 ^% @1 ]/ J! }. v7 Y$ I
  305.   end5 W; Q! L1 B  y9 g
  306.    
    # a5 [) ?0 z" b+ X5 Y+ |! e
  307.   # Event reflect sprite change) b/ ?6 {. k6 ]! W) ?
  308.   def reflect_esprite(event_id,filename,pos)
    * p; Y0 k. n/ M$ b
  309.     $game_map.events[event_id].reflect_sprite = [filename,pos]
    , }# D6 z$ E/ n9 A9 D
  310.     $game_map.events[event_id].reflect = true, c5 D; H' f; m+ |7 Q! A' C
  311.     SceneManager.scene.spriteset.refresh_characters6 D8 _4 A- }6 A7 _# m& A# v
  312.   end# v/ Q+ x! x0 l; m& `) T0 P
  313.    
    * O" c$ M7 m$ @; n; t
  314.   # Vehicle reflect sprite change
    ; ^8 m7 S5 i8 t. p$ p& Z
  315.   def reflect_vsprite(v_id,filename,pos)9 a; f, Y( Z/ f( W4 _& U/ [
  316.     $game_map.vehicles[v_id].reflect_sprite = [filename,pos]  V* Q- q/ t* y( Q
  317.     SceneManager.scene.spriteset.refresh_characters
      O- A, `4 Q% t
  318.   end' n" J! S( U3 K4 ~
  319.   " B0 V  Z1 G& ~; K
  320. #-----------------------------------#
    . S& S+ N  ^3 v' ~
  321. #  SHADOWS
    " W* ^4 S2 T/ C2 y0 u
  322. #-----------------------------------#
    , d/ ~$ w5 J. [" {- Z" r
  323.   % A+ i6 ?' l0 x, _+ C
  324.   # Add/Remove Shadows from selected characters+ {/ t2 O! ]7 C$ m, U' x. j/ b6 r
  325.   def shadow(*args,status)+ ~# p4 u0 J, N; @; x, k/ W& e
  326.     char_ids = [*args]
    & t# L( ?. u) G
  327.     if char_ids == [:all]
    5 z' ]% x9 e/ z- @) j
  328.       $game_map.events.values.each { |e| e.shadow = status }
    5 N8 J& y1 O) h5 S! t# a; X
  329.     else! f$ q  E; T1 _" f) b% J$ r. {
  330.       char_ids.each {|c| $game_map.events[c].shadow = status }3 Y& C; a5 `- [: k1 g4 s9 E
  331.     end" T* x1 B: J. P$ l' \$ W( ]* R
  332.     SceneManager.scene.spriteset.refresh_effects
    % ?3 f6 ~7 D9 m
  333.   end. R+ J- ^  M- r( H+ k  v* F  t
  334.     3 _, i) [9 y4 f2 X
  335.   # Change player and follower shadows9 }$ l6 b) @. S4 o/ I
  336.   def actor_shadows(status)9 D( ^9 j5 `' c) v* T
  337.     $game_player.shadow = status
    ) q' Z! z# s6 R$ @+ f6 i$ v
  338.     $game_player.followers.each { |f| f.shadow = status }7 O( G" E% E4 S0 n8 N+ ~& u
  339.     SceneManager.scene.spriteset.refresh_effects
    7 e4 c' ~& K* X# F' f& `! _; c
  340.   end
    * B- J- S! Q1 }& @& F% r6 C' X
  341.    
    2 g2 ?0 ^: M  _% ~% H1 F' h
  342.   # Change vehicle's shadow status, g8 K" s7 _7 J& W
  343.   def v_shadow(*args,status)4 ^! Z- {0 t. W
  344.     char_ids = [*args]7 b# ?( }5 W% ^5 X
  345.     if char_ids == [:all]
    2 z5 M+ B' u% h
  346.       $game_map.vehicles.each { |v| v.shadow = status }1 `5 [( g3 f. O% e
  347.     else1 t) v4 L9 a: l. k- a. j7 z5 B
  348.       char_ids.each { |v| $game_map.vehicles[v].shadow = status }7 n6 E7 f( q3 q' T& @9 @
  349.     end
    7 O6 K2 n0 {% {$ d
  350.     SceneManager.scene.spriteset.refresh_effects
    ! @& O% C2 ^/ f: E# Z' n
  351.   end
    9 k( n1 m# D" \) }- n: Q
  352.     - K5 l1 ?7 z# |: y( d; c+ k
  353.   def shadow_options(*args)
    $ h! F/ b) A" m1 N
  354.     $game_map.shadow_options = [*args]$ b( w; V! Z' y/ g
  355.     SceneManager.scene.spriteset.refresh_effects
    - U' k; L# {- M. [3 D# f, z. {2 X( x
  356.   end" @2 \8 h  Z3 i6 l
  357.   - P0 a# ]5 _: E3 J! O; B) @
  358.   def shadow_source(*args,shad_id)* k% y/ i/ Y2 ]+ r9 o; v; j% \% G1 ^
  359.     shadsource = [*args]1 Q  p- y4 c/ t5 _) [
  360.   $ F* E5 ?. F/ \) a  T7 e2 c3 ]
  361.     if shadsource.count == 1
    & ?  \" Q9 ^/ j" `8 N% y
  362.       $game_map.light_source[shad_id] = [$game_map.events[shadsource[0]].real_x,3 B0 u* g) T, G9 h% R
  363.         $game_map.events[shadsource[0]].real_y]
    * r0 M* b5 G3 l8 V) l* j; {
  364.     elsif shadsource.count > 1
    0 Y2 @/ k1 z% I' \# W; F$ G# G, V* Z6 C, }
  365.       $game_map.light_source[shad_id] = shadsource8 y- O" M5 j9 x) A$ c! J
  366.     else
    3 u* r- C) _7 ?7 d
  367.       $game_map.light_source = []$ ~. l3 k( x/ M$ n! q
  368.     end
    / l" l: Q3 @3 j; m% c9 |# e: b3 z
  369.   end* K4 F7 d* s9 H7 ~: G; e
  370.   
    8 g. O2 M( y5 B0 b- \9 R& i/ H
  371.   ( c1 U$ ^) ]$ S
  372. #-----------------------------------#
    # M* \/ R- i, C3 }
  373. #  ICONS7 T1 x: b4 V5 ]7 E; R
  374. #-----------------------------------#
    , U6 V' d- x" e3 V& v5 w& h3 ?
  375.   : Z& q# O3 Q# l2 |- s* H- h# v- O
  376.   # Add/Remove Icons from selected events' P2 }& [4 J3 n
  377.   def icon(*args,icon_id)
    ) Z, ^/ e; l& a. A  }. P! p
  378.     char_ids = [*args]3 _, K/ t, d' ]$ R; @# J" ~$ p1 C
  379.     if char_ids == [:all]
    1 [9 v- k, H8 q! V
  380.       $game_map.events.values.each { |e|
    ' k; u/ }" a6 `9 s5 Q8 V# c
  381.       if e.icon <= 08 ]: I3 |' u9 A6 F7 I1 t6 |
  382.         e.icon = nil
    / l2 ]$ E# G9 @8 f4 b
  383.       else
    : c; {! i& E9 D& @2 H; E
  384.         e.icon = icon_id* I# L5 U! s4 i6 W" T% G
  385.       end) [$ k+ V: f0 V+ M+ h
  386.     }& O) m( M: b. M# L; ]  e
  387.     else
    9 U9 h7 ?& ]. ^0 O& Z
  388.       char_ids.each {|c| $game_map.events[c].icon = icon_id }
    3 a$ M: q) ?; g2 e- M
  389.     end
    ' R1 Y  a1 R; I0 G, B
  390.     SceneManager.scene.spriteset.refresh_effects
    : J# y! F% T8 k$ K. l
  391.   end
    6 q# x3 v% X) ]2 X; ?* t6 V8 l
  392.     4 K0 }) r6 O! m3 Z5 g
  393.   # Change forever actor's icon- d8 J! S0 ]" S* Y- K2 O. t' x
  394.   def actor_icon(actor_id,icon_id)3 b4 O4 T2 c& e  J; ?% U! b% W
  395.     $game_actors[actor_id].icon = icon_id
    $ e/ Y5 d" K5 L& N1 Z) A5 X
  396.     $game_player.refresh
    ( l$ m- F5 d8 ~; M1 r
  397.   end
    ) s( P7 X# J, D, h: M
  398.    
    8 x8 Z5 s- |  d) Y& g  Q
  399.   # Change forever vehicle's icon  v. }; ~$ }3 J( w' o
  400.   def v_icon(*args,icon_id)! ^7 N% J( _, b7 h
  401.     char_ids = [*args]
    / ]7 v& v; @1 }% l; b. z: o9 o5 t
  402.     if char_ids == [:all]
    , f: q- O, u% L& f  L8 B5 I. m
  403.       $game_map.vehicles.each { |v| v.icon = icon_id }: A: o+ o5 M4 F  Y9 h- R* `$ A% I
  404.     else7 Y/ U4 K4 Z# ?( M
  405.       char_ids.each { |v| $game_map.vehicles[v].icon = icon_id }
    / z* d( |  q2 ^1 D+ o  l- ^* b# _
  406.     end
    ! D9 ]  V$ C  j0 F% ]  F2 l3 c5 ]
  407.     SceneManager.scene.spriteset.refresh_effects
    # H+ `, s- o% w! o/ e1 s9 v! x. `
  408.   end: t* e) |3 L  X
  409.   0 c% W9 r% Z# Y8 m
  410. #-----------------------------------#( V* R: o1 |: S* f! `
  411. #  GENERAL, _7 Y+ f4 K9 W( m/ S4 b' }
  412. #-----------------------------------#
    , d; n. _( n5 f8 V! M
  413.   " E5 S" E2 h& x9 d. k0 n: j
  414.   # Turn on/off effects" f3 O2 a% g7 o
  415.     # 0 = reflect
    " I% Q2 S$ ?/ @. |; x  R
  416.     # 1 = shadow
    + ?) G9 ~5 K0 f$ V
  417.     # 2 = mirror8 K: T7 Y# W* d$ F( a( C6 ~3 K6 n
  418.     # 3 = icon+ v. p5 z; T! ?$ ]2 E. a3 J
  419.       
    ; d4 y( S( @! @& A, [, W* j
  420.   def char_effects(*args,status)
    ( X+ `1 B; M. B+ `  ?* ~
  421.     [*args].each { |e| $game_map.char_effects[e] = status }
    8 {6 Q& U+ C) A4 e7 [. \( q. W) x
  422.     SceneManager.scene.spriteset.refresh_effects: ?/ d6 U% T0 Y+ L! j+ ?9 \" H
  423.   end: z) ]6 p9 [/ O% ?- `
  424.   
    % E' o+ L. Q1 ~* b0 k% ~3 \( [
  425.    
      T8 X0 @: g* w
  426. end # Game_Interpreter
    . B9 X3 V' J" S) v- |% H
  427.   
    : H) h1 T5 ?; V' L# D3 m" U7 g: Y
  428.   
    % _: @5 Z! P* [2 N% G' _
  429. #-------------------------------------------------------------------------------7 {2 b5 l! E( D6 h, u$ B$ t; [
  430. #  Spriteset_Map: i8 o' t* P3 F+ J" E
  431. #-------------------------------------------------------------------------------2 d7 l* L9 q; ^
  432.   
    8 u+ c" L" v! U, P
  433. class Spriteset_Map. @: U  a% _' C4 [( R
  434.   alias galv_reflect_sm_initialize initialize- T9 g0 h! @/ a
  435.   def initialize: |( X+ V2 \4 P3 ~
  436.     create_effects
    $ }) [. |; f* x: n; O9 g5 \
  437.     galv_reflect_sm_initialize
    . {, v1 M0 K$ ~2 W: x/ q1 H' o
  438.     refresh_characters
    # ]! D  p% s9 w* u8 j5 L5 ]( U, ?
  439.   end0 J3 `0 z* L+ x& I5 Y' L
  440.     * B% H/ t* j5 T5 Z, ~0 |
  441.   alias galv_reflect_sm_refresh_characters refresh_characters) H/ N1 ~4 w; d; R6 ~
  442.   def refresh_characters
    9 u  B; _; c, [+ p0 D- ~+ [  h+ K, s
  443.     galv_reflect_sm_refresh_characters
    + @1 X9 t6 A, f5 E+ @
  444.     create_effects! X  o( Z, B! Q! [: E5 \$ I
  445.   end
    ! G7 T% Z! b0 I/ k1 f
  446.    
    : u  L4 L- O; A- p3 y$ E+ u5 u! K* ^
  447.   def refresh_effects' E& N" w& R& G* @
  448.     dispose_effects! o1 K9 p4 y& G/ ~5 f- C
  449.     create_effects5 o& J6 q- e4 x
  450.   end
    % z2 K$ x  g, }
  451.    
    6 z: U0 C8 u+ {" c' }$ T9 i
  452.   def create_effects3 @: C. Z; ?8 F- l* Q4 b6 \- l
  453.     @shadow_sprites = []
    7 f8 Q4 O; a9 V
  454.     @reflect_sprites = []
    ( P8 G& I  J8 ~
  455.     @mirror_sprites = []2 J0 j  b, I9 X) e6 X/ j3 f# s, l
  456.     @icon_sprites = []
    8 U$ U0 N' O# Q6 B) H
  457.       + h+ a( G9 I& ]/ W! B# ^7 m/ w) ~
  458.     # Do reflections* F$ [2 e  w) t( M. \# t* ^, A
  459.     if $game_map.char_effects[0]- F$ E/ c/ x; a0 j: b4 |
  460.       $game_map.events.values.each { |e|, x! t" X: Q' i; T/ G
  461.         @reflect_sprites.push(Sprite_Reflect.new(@viewport1, e)) if e.reflect
    , J" A8 {% U4 M# D1 A( \
  462.       }8 p0 m# u' m' z) ~' }; p
  463.       $game_player.followers.each { |f|
    1 [. [# i  c) z4 O; n, R# B8 X7 L
  464.         @reflect_sprites.push(Sprite_Reflect.new(@viewport1, f)) if f.reflect
    " \" X; p/ k  o4 y
  465.       }% C8 r! c' H! B7 W$ O' j9 ?
  466.       if $game_player.reflect
    3 l0 \! Z$ @+ n3 ]
  467.         @reflect_sprites.push(Sprite_Reflect.new(@viewport1, $game_player))/ T" [& b1 v  {" T% ^+ w' C# l: [
  468.       end# _& r, ~6 @0 y
  469.       $game_map.vehicles.each { |v|
    9 j9 m7 M9 y  h5 t4 _" C  X/ I9 L
  470.         @reflect_sprites.push(Sprite_Reflect.new(@viewport1, v)) if v.reflect
      m  h/ f6 p6 ~' j- v8 I
  471.       }3 w6 s$ T9 L6 \' N3 i9 E
  472.     end
    , l. ?4 `3 V) T* Y$ k) g7 X
  473.       7 r2 c$ t7 [+ R" b
  474.     # Do mirrors
    ) o* ^- c7 ]/ |, O$ b6 q
  475.     if $game_map.char_effects[2]
    2 b* D6 f. ?: a% |  @
  476.       $game_map.events.values.each { |e|
    , P8 @6 L2 ~; Z: J$ O4 B
  477.         @mirror_sprites.push(Sprite_Mirror.new(@viewport1, e)) if e.reflect
    - U  ^4 S2 y/ N+ D5 \, s
  478.       }' ^0 A& R" f# f$ v+ u# [& ^% u
  479.       $game_player.followers.each { |f|
    ; G, G. q% A; d1 \
  480.         @mirror_sprites.push(Sprite_Mirror.new(@viewport1, f)) if f.reflect
    ( q! N/ L" `! f; H
  481.       }: S$ A9 x" ?+ n4 h  \
  482.       if $game_player.reflect# y# i% v1 a9 e( Y3 D/ E( t. t
  483.         @mirror_sprites.push(Sprite_Mirror.new(@viewport1, $game_player))4 }! c% u3 H' U0 W: j
  484.       end, f* |5 h' u% d
  485.       $game_map.vehicles.each { |v|
    # c" A/ h3 P! a
  486.         @mirror_sprites.push(Sprite_Mirror.new(@viewport1, v)) if v.reflect- b" j# X6 _$ ?7 C& I
  487.       }! j$ x% G2 A4 m& d5 x# c
  488.     end% \4 [" [' r  ~) x9 L
  489.       3 j4 Z; _. M& l4 o; I/ O7 C9 Y; L- ]
  490.     # Do Shadows3 @$ ~7 v5 T0 k. T7 a
  491.     if $game_map.char_effects[1]
    * ~0 Z% P( S5 ^: Y; ^
  492.       return if $game_map.light_source.empty?9 _1 [8 n3 o' w, H( I
  493.       $game_map.light_source.count.times { |s|2 C2 \  L' [* G  F
  494.         $game_map.events.values.each { |e|
    ) a  D3 @6 s* @& o0 t
  495.           @shadow_sprites.push(Sprite_Shadow.new(@viewport1, e, s)) if e.shadow
    2 a1 g5 t6 T6 j7 d: t
  496.         }
    ! |( G" Q" [' Q1 \! w) }! R
  497.         $game_player.followers.each { |f|
    9 Y/ L/ L% P) p, S
  498.           @shadow_sprites.push(Sprite_Shadow.new(@viewport1, f, s)) if f.shadow
    ( C- j7 B) g, M  T" @  V" i
  499.         }# }; q; e3 V- A, a. z) g
  500.         if $game_player.shadow: f9 A0 o3 v, i
  501.           @shadow_sprites.push(Sprite_Shadow.new(@viewport1, $game_player, s))
    4 }5 [- C! ^( T# |$ C8 g$ r, o# W
  502.         end
    % b6 ?. l* v: V: {5 k2 z/ R' W* p. H
  503.         $game_map.vehicles.each { |v|
    2 W/ @! C" f6 L% j
  504.           @shadow_sprites.push(Sprite_Shadow.new(@viewport1, v, s)) if v.shadow
    # k& \# S9 _6 ?6 F2 |; y0 _
  505.         }
      n! v3 s5 g* V6 M7 i7 ~9 M& W
  506.       }
    * d6 R1 b- t5 G( B$ E
  507.     end1 O* ^% ~2 C  }( u. ?" y2 [. k
  508.       + t! k8 [( c. ?+ ^6 S9 S0 u
  509.     # Do icons/ {" ?+ s! H6 L# f+ m8 o
  510.     if $game_map.char_effects[3]: i& _; x* ]( x9 R( D6 I( P/ o3 y
  511.       $game_map.events.values.each { |e|
    / i3 A" M6 e9 G7 F
  512.         @icon_sprites.push(Sprite_Icon.new(@viewport1, e)) if e.icon9 G5 G% G& Z, }2 a& e) w. C
  513.       }0 V) h* h- a9 r: L% C: B4 `
  514.       $game_player.followers.each { |f|
    ) @6 p1 `4 M3 Y- c! G) N
  515.         @icon_sprites.push(Sprite_Icon.new(@viewport1, f)) if f.icon. ^# N5 j% g7 E1 u/ ?
  516.       }" r0 l& y9 R. b' W5 }* M
  517.       if $game_player.icon7 j$ l3 Z2 ?+ o' G
  518.         @icon_sprites.push(Sprite_Icon.new(@viewport1, $game_player))6 U: x0 t, H6 P; A! n; x2 N; Q
  519.       end7 r# l, K0 a& s( e5 P# @  x
  520.       $game_map.vehicles.each { |v|& ]4 a+ x* \/ W2 N, w
  521.         @icon_sprites.push(Sprite_Icon.new(@viewport1, v)) if v.icon
    * z! q* O5 `6 _  F7 ]/ n: V5 @
  522.       }7 ^0 Y( O8 f5 M3 N, h% O
  523.     end
    , ~7 }2 P6 G; W# Q" q3 d
  524.   end
    , V2 u; k. |( t! P6 O* b8 E
  525.     * R6 M) Z' u& R
  526.   alias galv_reflect_sm_update update
    ' F/ H7 B/ v5 }" a
  527.   def update
    % m" ~0 X+ E/ z4 F# c
  528.     galv_reflect_sm_update+ ^5 ?8 T* O4 X( m0 |
  529.     @reflect_sprites.each {|s| s.update} if $game_map.char_effects[0]7 D0 Z( S4 M: G! o) W7 R
  530.     @mirror_sprites.each {|s| s.update} if $game_map.char_effects[2]
    ' H5 f5 }7 n& A* k3 K
  531.     @shadow_sprites.each {|s| s.update} if $game_map.char_effects[1]
      l2 L6 y" Y0 q7 y( u
  532.     @icon_sprites.each {|s| s.update} if $game_map.char_effects[3]- X9 y* \' \  {1 q5 D4 [, `$ f# y, M
  533.   end
    2 d( F; X" D* k. n. v
  534.   
    : T: o9 }3 }  n- }) X% ^
  535.   alias galv_reflect_sm_dispose_characters dispose_characters  q) y, w) X; l6 q
  536.   def dispose_characters' n4 f  b  _' \( }& W
  537.     galv_reflect_sm_dispose_characters
    : Z3 @- e3 k6 z  c  {) ~
  538.     dispose_effects
    4 r) n1 ^* A3 l! i/ s
  539.   end7 V4 N& d' i/ P8 L7 @
  540.     , [9 z8 O" t5 Z% _
  541.   def dispose_effects
    ) ?1 H, Y# v. w% X" M) m; M$ _' c
  542.     @reflect_sprites.each {|s| s.dispose}
    : D0 d! e$ [" z3 [) I( |, t$ K
  543.     @shadow_sprites.each {|s| s.dispose}
    3 P0 H" R/ X& H( O7 `
  544.     @mirror_sprites.each {|s| s.dispose}& h7 S9 J: u# s
  545.     @icon_sprites.each {|s| s.dispose}  v. `( ?' v2 `
  546.   end
    # y9 Q* R0 ], ~7 V) I3 P5 x
  547. end # Spriteset_Map0 a/ \# L: l' n& ~8 h
  548.   6 i$ {- |) J; B9 c) ~
  549.   8 ]  ~9 O2 u  i& ^& |$ U
  550. #-------------------------------------------------------------------------------
    % O& O% D7 ?! h6 b$ d4 i
  551. #  Sprite_Reflect
    8 C; \, a/ f( R" U) g0 y% d
  552. #-------------------------------------------------------------------------------( s; D3 N% i  o5 N
  553.   
    0 r$ m/ U4 S3 e
  554. class Sprite_Reflect < Sprite_Character
    % D$ r4 b. W' Z  G7 [7 P/ |* [* P
  555.   def initialize(viewport, character = nil)
    5 K! f# `# R2 S3 i9 {0 C4 p
  556.     super(viewport, character)1 V( L5 K) e! O6 z. H9 ~2 _: Z) i2 S
  557.   end
    ; O2 E6 }8 t- O; @5 R
  558.   
    ( W& g0 m0 Y8 I
  559.   def update
    ( t& Q0 Z! |- S, Y" Z2 u
  560.     super! f+ g* e' X) h6 I
  561.   end
    ! k; i5 ]8 z" m
  562.     ( f2 L; T! ^( _! \5 E7 x
  563.   def update_balloon; end
    2 x% d# X- \- z. t3 v; [  W) n2 d, D
  564.   def setup_new_effect; end
    1 J3 A  i! S/ Z1 z9 q2 O
  565.    
      t8 j- }3 h& w0 t: s
  566.   def set_character_bitmap
    ( V0 j# D9 S4 d* Y3 }  r4 P
  567.     if @character.reflect_sprite4 z: \7 \2 [. }2 a
  568.       self.bitmap = Cache.character(@character.reflect_sprite[0])
    8 D) V) _& j6 L. B
  569.     else
    - U/ b' ~0 R! U: Y
  570.       self.bitmap = Cache.character(@character_name)
    2 _! `0 U/ E. S
  571.     end
    + l. f- c4 j& J0 E( w) E4 T, {
  572.     self.mirror = true
    " Q  V% p, `) |/ B& m* o5 {0 w$ \
  573.     self.angle = 180
    # Z+ {% K0 Z# _+ c: Z5 i, }' z
  574.     self.opacity = 220' z. V4 P* K6 v' b# V5 I
  575.     self.z = Galv_CEffects::REFLECT_Z
    9 o& U- x! Y$ m" {: h2 _) b7 Q5 S3 t
  576.     self.wave_amp = $game_map.reflect_options[0]7 [" u% e# P+ k1 [. U; ]2 V
  577.       
    : `* G, A6 U6 z
  578.     sign = @character_name[/^[\!\$]./]9 o7 i. [' H/ _0 t9 {* \% R+ |
  579.     if sign && sign.include?(')3 k' B, U3 _8 R! T
  580.       @cw = bitmap.width / 3# C; n- S$ J( ]0 {6 a# U' S
  581.       @ch = bitmap.height / 45 M3 w4 I* |+ X2 t
  582.     else' O9 {1 F) s, g  `& V7 ~/ y
  583.       @cw = bitmap.width / 121 j' J; t5 c! s% n" A6 E
  584.       @ch = bitmap.height / 8
    ) g9 r9 h9 j) T8 r6 u
  585.     end# s: N% h" g8 E& F
  586.     self.ox = @cw / 2+ o, f  O( m5 y
  587.     self.oy = @ch
    4 M( q! [9 ~$ `$ s
  588.   end
    8 \( S; L. e, N& H* {+ T
  589.     L. f0 v$ T( @9 k5 M7 ~  |
  590.   def update_position
    6 K. h; W4 a/ `& K
  591.     self.x = @character.screen_x
    5 A3 o" c6 H, r2 E) R5 t' v4 B8 J
  592.     jump = @character.jumping? ? @character.jump_height * 2 : 05 A# y( k& C1 c1 Y% g
  593.     alt = @character.altitude ? @character.altitude * 2 : 0* w6 h$ j* [0 t) W+ @. P
  594.     self.y = @character.screen_y - 3 + jump + alt1 F$ b: \( s, O( }, V
  595.   end+ o1 A$ I$ \7 R" A7 m
  596.   
    5 k+ @3 L( y" H9 q% G
  597.   def update_other
      ]; |1 a3 u3 h" R# W7 `
  598.     self.blend_type = @character.blend_type' P4 ?( y# ?5 T# r) p9 j, Z
  599.     self.visible = !@character.transparent( h* x% W% U* S
  600.   end
    5 q& q( p: D1 u" M( J9 c: X% k
  601.     ; J2 ?3 q2 M" i' N- e
  602.   def update_src_rect) r$ x9 T% m, G0 L; y, H
  603.     if @character.reflect_sprite
    0 ?1 V/ p- v; X8 k
  604.       index = @character.reflect_sprite[1]" b  d# P: n3 L  N1 X! h
  605.     else
      U! u) `& e% ]7 D$ A
  606.       index = @character.character_index
    ' a1 z' J& l# u& X6 w7 m
  607.     end+ }) w. h. M3 ?6 ]' P: T. j8 h) \
  608.     pattern = @character.pattern < 3 ? @character.pattern : 1
    ( h; K% r/ _1 z; P
  609.     sx = (index % 4 * 3 + pattern) * @cw( Q' `6 J% E- P& _
  610.     sy = (index / 4 * 4 + (@character.direction - 2) / 2) * @ch0 z9 d" S' F3 n" \* b# M
  611.     self.src_rect.set(sx, sy, @cw, @ch); t0 A" B1 V7 m* l2 y
  612.   end
    % A" }; R6 a$ ^  U8 S
  613. end # Sprite_Reflect < Sprite_Character
    / r- R5 C6 w3 a# c! z
  614.   0 T2 R7 T: X! o; b- @0 V
  615.   % g7 e& d5 y7 D% Q/ I
  616. #-------------------------------------------------------------------------------
    : ]6 g* i9 J3 ]7 b3 x) d+ B
  617. #  Sprite_Mirror
    : {0 Y6 A4 Q( Z% q8 g
  618. #-------------------------------------------------------------------------------# q' ^& q$ w* i+ |
  619.   ) t( s, B" Z5 S6 T
  620. class Sprite_Mirror < Sprite_Character
    9 m# b0 g+ D3 P! B: X, S, [/ D
  621.   def initialize(viewport, character = nil)
      L3 c" n! ?) }
  622.     @distance = 0
    * Y: A- g# {. f- V
  623.     super(viewport, character)
    1 _3 L0 ]6 `8 m. c% f
  624.   end9 |# N$ e( E9 K: L; ?! K
  625.   
    * G: }, n- T) C' [
  626.   def update7 E3 L5 n' W0 I; F( ]
  627.     super
      ]# `& `' s5 }3 r, @
  628.   end
    & {- A' v) |5 X+ t6 o
  629.    
    * h5 m. C& C5 |4 f
  630.   def update_balloon; end& t/ ~& I% x  L* Q5 c% x+ P! A& g
  631.   def setup_new_effect; end8 Z# X; l- |# l( O
  632.    
    9 d3 I6 Q$ t0 s3 J/ p1 l8 |. I/ ]
  633.   def set_character_bitmap1 |+ N# a5 I% `- M4 f% j
  634.     if @character.reflect_sprite
    . y- r5 T5 U3 Y8 v4 I
  635.       self.bitmap = Cache.character(@character.reflect_sprite[0])' J( S  b3 I7 ]8 D% y6 R
  636.     else
    + }$ a/ @& N, S+ d+ ]
  637.       self.bitmap = Cache.character(@character_name)9 x; q. W7 p. \, v  g6 B; P  n
  638.     end. Z8 F& J8 a, }5 n
  639.     self.mirror = true
      I! r# p1 `; V: Z3 |5 b+ k2 ]% j9 ?
  640.     self.opacity = 255/ e0 X( A: f+ b3 \
  641.     self.z = Galv_CEffects::REFLECT_Z: X7 ~1 v7 S; o' M& A  E( J
  642.       
    1 ^' O2 _! A/ }$ j8 s) Q
  643.     sign = @character_name[/^[\!\$]./]- A3 O& V; Y' O% l0 n. {$ ^
  644.     if sign && sign.include?(')
    ( }  o. L8 |* z7 f! x
  645.       @cw = bitmap.width / 3+ y4 T9 `8 x/ z% [; D: G
  646.       @ch = bitmap.height / 4. L, @6 h# \7 P& y" q% o1 h7 B/ h/ O
  647.     else  ~9 o$ h  _2 n: x) Z
  648.       @cw = bitmap.width / 12
    - x3 j* s  b, d
  649.       @ch = bitmap.height / 8( f) w  G* G4 Q0 ^/ X7 ]0 P
  650.     end
    1 ^. U  @. L! j4 O9 _( X- ]
  651.     self.ox = @cw / 2" N7 ^& l  \+ z# y1 V. f7 k3 s$ g
  652.     self.oy = @ch) M, ?9 u2 Y! _4 u% s6 v, P9 ^
  653.   end) E1 g- O# {8 I
  654.   
    " \$ U# S8 `2 h1 n5 q
  655.   def update_src_rect' a* |6 G9 X- s4 p
  656.     if @character.reflect_sprite! ]0 n) N/ t- W3 A% H
  657.       index = @character.reflect_sprite[1]# g$ m! [( T# P* I! T) X, P. e
  658.     else0 y; i4 n. i+ T7 ]& v* S
  659.       index = @character.character_index
    - o/ a% M3 n# F- G# b/ J  V
  660.     end  H+ n$ W% e' e* A+ [% o) K
  661.     pattern = @character.pattern < 3 ? @character.pattern : 1/ e8 f8 @# e- j! a. ~
  662.     sx = (index % 4 * 3 + pattern) * @cw
    2 b/ _# ~& I1 I7 t0 \; s8 {$ ^3 l
  663.     sy = (index / 4 * 4 + (10 - @character.direction - 2) / 2) * @ch0 Z& i3 C2 {: W* n
  664.     self.src_rect.set(sx, sy, @cw, @ch)" T1 U+ I2 V# |5 F& E& P- Q: F/ }$ o
  665.   end% q/ A6 A! R7 b$ V
  666.     " v7 n, x/ Y: }; b( P) }
  667.   def get_mirror_y$ L4 e: g2 ]) ]
  668.     20.times {|i|
    * L5 B5 K6 h& a; B+ r: G
  669.       if $game_map.region_id(@character.x, @character.y - i) == Galv_CEffects::MIRROR_REGION& u2 d; v& u+ P
  670.         @distance = (i - 1) * 0.056 E5 D: G# Y' F0 Z7 D3 A' v
  671.         [url=home.php?mod=space&uid=502659]@DISPLAY[/url] = @character.y - i - $game_map.display_y + $game_map.height
    + o- x! G& l$ W8 E' Z' Z
  672.         self.opacity = 2556 M5 `$ r3 s# ]6 E& V5 U1 r) M2 W
  673.         return (@character.y - i + 1 - $game_map.display_y) * 32 - i * 4
    ' a# H) A: j1 E* u
  674.       end$ T# W" L* ^8 e) d# R& ~
  675.     }+ _8 k1 n5 ?2 _9 @2 S! |
  676.     self.opacity = 0
    9 V" b3 S9 t9 p  [1 I4 F
  677.     return @ch' x# k# f% D/ ~/ r* Y9 Y$ q0 z# |
  678.   end: z0 K' }7 J6 t/ l
  679.     ' @6 a  N( {$ {& f+ l( K! b2 _! l
  680.   def update_position
    # D; c; T8 G% a- o. a
  681.     self.x = @character.screen_x
    ' R, s- p2 A: u. @. h
  682.     self.y = get_mirror_y - 6' t% Q0 N$ T. [8 W3 p* f
  683.     self.zoom_x = 1 - @distance+ Q' t. w7 O* |* C+ O- X
  684.     self.zoom_y = 1 - @distance5 O7 l8 A% }; E( U
  685.   end
    & s& e7 C* G; Z) M
  686.   / {+ t* j7 `+ J: o" ~; g
  687.   def update_other# x, Q/ Q& Z& A# w: V
  688.     self.blend_type = @character.blend_type
    4 I5 E8 Q/ L( f* o5 a9 c+ j
  689.     self.visible = !@character.transparent$ q& `& R$ o; p5 f
  690.   end
    " h" M' o6 S" K, j
  691. end # Sprite_Mirror < Sprite_Character( h/ M: _2 f0 }; z' R
  692.   
    5 Z$ U0 B% P" m1 x5 [
  693.   
    % q& `& o! P( r2 t
  694. #-------------------------------------------------------------------------------
    ) K2 M- I) I( g
  695. #  Sprite_Shadow6 k: Y3 |: v5 }/ X/ a; X
  696. #-------------------------------------------------------------------------------1 ^+ y0 y( v2 q7 |
  697.   
    3 G) H# t( J, v3 Q! k( [7 P9 }. F7 o
  698. class Sprite_Shadow < Sprite_Character" C3 R. B# t" n6 R( S% x- N9 \3 }
  699.   def initialize(viewport, character = nil, source)
    8 X5 z1 d7 @: B. l' ^2 M2 \0 s
  700.     [url=home.php?mod=space&uid=14094]@flicker[/url] = 0
    5 C8 m6 y! ?, R
  701.     @famount = 0
    * F- H" z/ M/ W4 n2 M
  702.     @aamount = 06 v$ l6 ~, |9 q9 f! Z) o
  703.     [url=home.php?mod=space&uid=171370]@source[/url] = source3 I# b, J: q* ^$ `0 n% [: C
  704.     super(viewport, character)$ z/ E3 @( b; M& z8 U# S" A
  705.   end
    5 J( h6 k- X5 a$ c, i
  706.    , X) g  A5 m0 E  s2 K, ^' U
  707.   def update_balloon; end5 G' S$ T% B' T) v; z, v
  708.   def setup_new_effect; end
    - G! J) D' @% [! y. E8 k
  709.   8 [2 a; N) R9 `7 G8 y0 i
  710.   def update
    7 J' W$ r. r, O2 M4 d1 Q; F
  711.     super
    - K& v* i" U" K+ H
  712.     update_bitmap# D/ H4 v( @2 _0 `  p
  713.     update_src_rect
    1 u4 X# T) H$ g; s, R# E
  714.     update_position
    ; T5 J; h6 X' v: k
  715.     update_other5 t) d- N9 J- E5 K7 P' }
  716.     update_facing. R8 p/ R" P* {7 |% ~+ ?3 H" ]
  717.   end
    . y* S- Y5 O7 C3 ~; |, P
  718.    9 {* S) D9 S; a6 R) ^" N
  719.   def set_character_bitmap# K- _) w" o! E( }% ]& A( Z
  720.     self.bitmap = Cache.character(@character_name)
    8 Y  k2 J; ~. k
  721.      
    & h8 y' z( Y, S
  722.     self.color = Color.new(0, 0, 0, 255)+ h) M5 l+ I- i1 Q+ z$ N% X
  723.     self.z = Galv_CEffects::SHADOW_Z
    ' X+ k$ K+ g2 T( g+ y2 @
  724.     self.wave_amp = 1 if $game_map.shadow_options[2]
    ; K! A( \# }, s1 F& ?: @$ R& V
  725.     self.wave_speed = 1000
    & q. v/ V4 I6 n7 {+ x
  726.       - h; ?) e" H! \  w% M
  727.     sign = @character_name[/^[\!\$]./]
    / d" A0 |& t& e" s: |
  728.     if sign && sign.include?(')( ]* {8 _) D. c- i
  729.       @cw = bitmap.width / 3/ N$ _2 x, |  ]5 N
  730.       @ch = bitmap.height / 4
    2 Y( J+ T) \& a0 V9 F0 t
  731.     else1 `3 h2 ~& k) K' S4 j0 W4 T$ F) Z
  732.       @cw = bitmap.width / 12. r) |* n6 P# q' G9 C
  733.       @ch = bitmap.height / 8
    ; Y& C0 k3 V# B7 |+ [+ ~3 g; U& ]
  734.     end( u, M: W7 ?! e3 W, I  P8 O% e
  735.     self.ox = @cw / 25 j0 M, ]8 ^$ F+ A/ E# _
  736.     self.oy = @ch
    + Q9 Y! P8 Z% m% {+ t5 Z. ~, A7 p9 G1 w
  737.   end
    ( _8 V( {9 B1 O+ Y6 V. n
  738.   
    2 j' @: y* N' @5 b4 F1 b* S
  739.   def update_position
    9 m- q: j% x- z' z6 b5 Z
  740.     self.x = @character.screen_x
    ( q$ V4 \* {3 y7 B) W% W1 S
  741.     self.y = @character.screen_y - 10
    9 i- [4 W/ m# A. Q
  742.     get_angle9 ?2 F. ^# S- a" ]& G. @+ M0 O
  743.   end
    ; ^! [' V2 h/ Q6 D+ c  ?- n
  744.     / k3 l# I1 L4 i  ^
  745.   def get_angle
    ! Y8 \0 H- L( [9 y, |7 L
  746.     x = $game_map.light_source[@source][0] - @character.real_x: ?7 M/ b( H3 _& u+ x
  747.     y = $game_map.light_source[@source][1] - @character.real_y! T) N+ `2 I: ^7 v3 G7 l2 d% y1 r
  748.     self.opacity = $game_map.shadow_options[0] - * |. H1 e; q2 n" B' C3 g* _
  749.       Math::sqrt(x * x + y * y) * $game_map.shadow_options[1]
    8 b7 y. S8 {7 n1 l) U- W( L$ J4 X3 b
  750.       
    5 K0 ^- c. R* o
  751.     if x == 0 && y == 0 || self.opacity <= 0) u& r9 l+ z+ E+ W
  752.       self.opacity = 0
    7 q( h* Z% D- S8 F
  753.     else   K0 s" Q: ~6 m. F
  754.       self.angle = Math::atan2(x, y) * 180 / Math::PI + @aamount4 N* X( }0 h7 j/ j6 @5 e; N
  755.     end& [0 s  r& j$ e2 H; s+ P
  756.   end! o* ?* q! t& Y+ W) I2 L- X
  757.    # D! m" G( A" r4 D  g- _0 y
  758.   def update_facing; G4 b/ A$ K; y
  759.     if @character.y < $game_map.light_source[@source][1]
    & a; e5 d6 x* X; U1 N! |
  760.       self.mirror = false
    # h0 k: m/ i& E& Z
  761.     else1 Y9 H+ d) `: U: y
  762.       self.mirror = true: c/ V0 k- i8 J
  763.     end& E2 F; p4 s; S& _% l
  764.   end3 `* W" L3 Y! g. Z' s! T
  765.    
    % m# M% t' y+ @# j5 V
  766.   def update_other
    ' Z/ T3 |, [) R( c& H" E: \; t
  767.     self.blend_type = @character.blend_type
    " r' z/ A  \& B, G1 W
  768.     self.visible = !@character.transparent
    $ u0 t; q  o; z! X
  769.   end* A  b4 z% A/ D$ |# z5 X1 p, T
  770. end # Sprite_Shadow < Sprite_Character, `3 I2 b9 v2 h, q! s& v
  771.   # o/ M$ H' }+ Q2 b( k- c8 ~+ L
  772.   
    " C1 c: V7 H  C# M" Z
  773. #-------------------------------------------------------------------------------
    + f& b+ |5 m7 P6 o
  774. #  Sprite_Icon, [, w: x. g4 A
  775. #-------------------------------------------------------------------------------. k6 y  g9 i0 N6 e3 N+ \
  776.   ; a! p" W& N5 Y  T0 T
  777. class Sprite_Icon < Sprite_Character
    ) i# a6 }# W. Q! ^9 L! D: f& l
  778.   def initialize(viewport, character = nil)
    2 F$ T+ C% Z. E# S# R- q/ m
  779.     @icon_sprite ||= Sprite.new
    " N2 ~( K7 P7 G, G, @
  780.     @icon_sprite.bitmap ||= Cache.system("Iconset")% X; `: a) j4 ^. {! i8 J1 h+ b
  781.     @icon = nil
    4 a; i& |: `  c  p" \0 t5 g4 |
  782.     super(viewport, character)+ q0 `4 I3 d' f& W( u
  783.   end3 i, D( X1 Y) Q* {' r
  784.   
    6 U$ J, J0 G' j; M4 }: o1 ^
  785.   def dispose$ E7 A* ~7 k$ W$ {5 ^. B, f% k
  786.     super
    ' `- a' e+ X8 J: H+ V
  787.     if @icon_sprite
    9 ^6 R+ ]5 Q# O4 A
  788.       @icon_sprite.dispose2 Q* w9 W9 {& m" S! ~
  789.       @icon_sprite = nil2 o% S- O. m. y9 V. g: D; p: i
  790.     end
    # H. Q1 j' P2 M1 D; [/ }
  791.   end
    - A' I) t+ ~. R8 v7 [! y2 V
  792.    
    ! s9 }; Z+ ]* u- V  Z
  793.   def update
    ) [1 |8 o* \0 k! C+ a/ H- i
  794.     super
    ' D% \5 x% m' d: l/ l* T* p
  795.     update_icon5 u5 e. h% V( Z) W5 h
  796.   end6 T' I( N, N1 S! F* @7 p
  797.    
    ) a$ k$ Q1 O3 m) _) v& z
  798.   def update_icon2 b, n5 Y  R# I( c
  799.     return if !@character.icon2 }, k/ O1 N$ ^6 w% D3 O
  800.     draw_icon(@character.icon)
    , p  }) \9 g- I: z: z" T# c
  801.   end" ?% c( ~2 `, U1 v
  802.    
    2 \! B! t6 Y- N/ o
  803.   def draw_icon(icon_index)
    9 |& e( A9 M& C: L6 S
  804.     return if !@icon.nil?
    1 B- y. {9 V' U8 p# Q/ ^
  805.     rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    ! \9 K8 x5 ?' m( x' L
  806.     @icon_sprite.src_rect  = rect
    9 m( i! ^* z5 i/ A2 k9 u5 L
  807.     @icon = icon_index
    ! H, E* a% W, l% G0 H
  808.   end" @) s$ W9 X1 X
  809.    
    ( h* R8 Z2 d" `2 ?) u. X1 A
  810.   def update_position$ B, K8 t5 u# _& \! g4 M
  811.     @icon_sprite.x = @character.screen_x - 12& ~9 l8 X: w( U
  812.     @icon_sprite.y = @character.screen_y + Galv_CEffects::ICON_OFFSET
    4 P8 V* V0 P% S! d* j
  813.   end7 {4 `8 c7 J- L
  814.   
    " J( g; v# J3 ]& ^0 t
  815.   def update_other0 u0 v! x! p! N# D2 P
  816.     self.blend_type = @character.blend_type6 B% M; j1 l* u
  817.     @icon_sprite.visible = !@character.transparent. A8 x6 c0 Y3 W" W2 {
  818.   end% B2 o3 r6 N$ v/ ]* e
  819. end # Sprite_Icon < Sprite_Character! d4 [! @+ w: o
  820.   1 ]  v1 `3 m/ r4 B. I
  821.   
    * B1 S3 V, q2 K- v5 ~& o8 X" T
  822. #-------------------------------------------------------------------------------
    6 s7 |) v: i! T: U
  823. #  Other Stuff. d' P: \/ l0 |6 m
  824. #-------------------------------------------------------------------------------
    * z! T% s# H! _0 G
  825.   + F  d6 ~/ |% F" G/ G" d. u
  826.   5 l2 c" j3 B- Q6 s# l& p. J
  827. class Game_Character < Game_CharacterBase
    , V0 M8 M# H  Q- S5 a- `
  828.   attr_reader    :altitude7 S/ {+ X, q! B- [1 l% c2 i
  829.   attr_accessor  :reflect4 _0 `" T! [& f/ e  s
  830.   attr_accessor  :reflect_sprite
    2 n8 K  x9 _. L) P/ d2 w
  831.   attr_accessor  :shadow: e$ N, v  |, Y+ F
  832.   attr_accessor  :icon
    7 G0 N5 Q- U: _/ a2 l
  833.   attr_accessor  :icon_offset
    , Y; @4 |- Z$ i7 i2 m+ H2 @
  834. end; j5 U' g' a% J! f  x
  835.   
    " N; F! {* |7 \0 c" r( U4 o
  836.   
    $ ^; [- f6 T' l" e. [# o- V
  837. class Game_Event < Game_Character' t+ G0 ^3 |4 \& }
  838.   alias galv_reflect_ge_initialize initialize3 e$ @$ N- D/ u9 _+ [" ^
  839.   def initialize(map_id, event)3 Y7 v6 M1 X' M& Y2 X; }4 d
  840.     @reflect = false' J2 x4 f) e- b. P- t- H" C! \
  841.     [url=home.php?mod=space&uid=31758]@Shadow[/url] = false8 {3 `4 U2 n  K9 F$ I
  842.     @icon_offset = [0,0], |* Z# U% G6 k2 l
  843.     galv_reflect_ge_initialize(map_id, event)
    4 a& x( u2 L) K' K; ~" U. V
  844.   end
    9 Q$ C4 ~8 ~. ~5 Y+ m; E5 |8 f
  845. end # Game_Event < Game_Character
    4 X( I5 F" N2 Q6 Y
  846.   - ]! ~8 L( ]* y7 H% ^
  847.   7 }' R7 [9 r/ K6 ]
  848. class Game_Vehicle < Game_Character% d0 d' B- P! n& K! w$ ?& M* k0 S
  849.   attr_reader :map_id) m5 n4 {3 F9 q( E8 I  N$ G6 r
  850.     # R# K9 S5 l- ]
  851.   alias galv_reflect_gv_initialize initialize* g! G) v3 q3 ]( K( k
  852.   def initialize(type)  _+ E+ Z1 d' H+ ^9 e7 C
  853.     @reflect = true
    ( ?: ?/ n" S- _
  854.     @shadow = true# |0 a8 E& V% s7 o
  855.     @icon_offset = [0,0]
    " w' v' X* F  p( q8 }
  856.     galv_reflect_gv_initialize(type)
    " R% B7 f! p* e. B) \4 ~
  857.   end' O$ ~8 Z8 B: g  {( [  W3 u) D8 r
  858. end # Game_Vehicle < Game_Character* c* a0 a8 U! h
  859.   
    4 b9 [$ x1 D1 W
  860.   ) @$ E9 _8 ~$ M) Y8 e& z
  861. class Game_Follower < Game_Character& H) t4 ^7 i, j1 e( H& ~: b2 ^
  862.   alias galv_reflect_gf_initialize initialize
    2 R% `" i5 e) }; E3 \+ u% a1 E
  863.   def initialize(member_index, preceding_character)+ E" M5 f1 ~& i5 g8 Y5 x( F1 z  i
  864.     galv_reflect_gf_initialize(member_index, preceding_character)
    " W/ ]5 V9 |- A/ g2 e. T- i0 l, I; d2 T
  865.     @reflect = true3 {  ^+ u  l3 D( x& e* i
  866.     @shadow = true/ O- s- y" F+ w" Z' |8 R
  867.   end. X! K) A& s# r. I$ f
  868.     : e5 A& u7 @; `8 L6 r
  869.   alias galv_reflect_gf_refresh refresh" n3 Y& l( P$ ?2 F
  870.   def refresh4 u+ O! F+ B% b
  871.     galv_reflect_gf_refresh& v( h8 _) k: q! p
  872.     return if actor.nil?
    * A1 ?2 ~' Y7 Q  r  E2 ]
  873.     @reflect = actor.reflect
    ) w+ G" F7 \% d' k7 N2 }
  874.     @reflect_sprite = actor.reflect_sprite1 T; K4 c0 C2 b8 f! R( w4 f
  875.     @icon = actor.icon
    # R$ R# u! [9 s) d- L
  876.     if SceneManager.scene_is?(Scene_Map)
    $ V, h, s0 ]; ~+ ?& }6 x
  877.       SceneManager.scene.spriteset.refresh_effects
    6 K& s( S  i& x9 O3 |' \5 W4 ^
  878.     end4 F: h% H6 z7 `/ m6 T
  879.   end7 F' c- x; u) ^+ l2 ^7 [
  880. end # Game_Follower < Game_Character% W0 \* r  N: O) g! d/ F) ^. E& u" z
  881.   
    / ]6 G) S3 K7 M
  882.   * y: u9 {* C" q8 i/ z) v/ a) R
  883. class Game_Player < Game_Character6 |$ ^2 ]  u$ p
  884.   alias galv_reflect_gp_initialize initialize  L* P1 S( t8 F) @
  885.   def initialize- @2 h) V1 V. t0 p1 ?
  886.     galv_reflect_gp_initialize
    % [; Q' N+ W7 M/ E3 C( z8 a
  887.     @reflect = true7 f& i8 Y* \/ ~1 U! D0 O9 _
  888.     @shadow = true
    2 |, ?1 C6 B# y" d6 _+ J
  889.   end
    & e7 r' s( p! j4 z' i
  890.     : m! ^7 a3 d; @: F3 f& F
  891.   alias galv_reflect_gp_refresh refresh. @) ?+ p; X" ^, J+ A
  892.   def refresh
    - `& ~7 n. `+ _, x+ y  E9 f% }
  893.     galv_reflect_gp_refresh1 `; I$ N9 x6 W4 \) L4 Z( d
  894.     @reflect = actor.reflect
    , C& E4 l- k- b. K! O
  895.     @reflect_sprite = actor.reflect_sprite
    ' C+ w# V7 N) p- p8 U* R, q
  896.     @icon = actor.icon: S; P+ \2 \- l7 |* l
  897.     if SceneManager.scene_is?(Scene_Map)
    0 H% V* q9 J- n+ d, E
  898.       SceneManager.scene.spriteset.refresh_effects
    & S# k9 G+ B" `" w2 h( i$ }
  899.     end3 k% Y* Y2 C. D, R& j4 P6 r% `! v
  900.   end
    ) T/ h+ K- e7 @
  901. end # Game_Player < Game_Character
    $ H$ P+ ^0 @+ n* k) p  T, A
  902.   * X* c. z0 g0 X/ R9 U
  903.   
    ' X( {* @5 O/ p. \2 G) N; d7 Q
  904. class Scene_Map < Scene_Base
    8 V$ Z2 w) n6 A5 o2 i% @* K' @
  905.   attr_accessor :spriteset4 p: Q& m2 c( B! T5 b8 o; c) G
  906. end # Scene_Map
    " E+ ^5 \; L' U# N+ D
  907.   & B% k7 A; G4 O0 ?  I5 w* n
  908.   
    ; g; q% t- f, F
  909. class Game_Map
    4 x$ d+ n+ q& d% e$ b# D
  910.   attr_accessor :char_effects
    6 |( S* X% R. T
  911.   attr_accessor :light_source
    4 k8 `9 W" q3 ~  |2 e  o4 R
  912.   attr_accessor :shadow_options: D! g8 f' b+ x7 K( U* S+ H
  913.   attr_accessor :reflect_options# t$ v. A* f& P$ x/ L
  914.     6 P: }9 e, Y0 s  a
  915.   alias galv_reflect_game_map_initialize initialize+ ]- [, ]& _+ }4 b- `9 M
  916.   def initialize
    " R3 Y/ `, |9 n9 `; @
  917.     @light_source = []. a" `, C' i! G9 U7 i# _
  918.     @shadow_options = [80,10,false]5 p2 ]: y: c6 z4 j* H7 ]  M
  919.     @reflect_options = [0]
    3 |- u  N- x$ e; B- o: U
  920.     @char_effects = [false,false,false,false]9 ?& }, D  {+ b7 ]( q5 u' U
  921.     #[reflect,shadow,mirror,icon]
    5 M/ m; }; u7 J6 P6 y
  922.     galv_reflect_game_map_initialize
    7 r" h; b1 {, t+ P2 P. M$ o
  923.   end' J" w+ z& H+ }0 U- \- D  h* z
  924.    ( C$ X2 t7 Y3 [; [$ B0 \4 \, P+ A
  925.     # t" B+ r; X' z7 u; d" j
  926.   alias galv_reflect_game_map_setup setup
    ' l" f! ]# D2 M5 \  j$ J
  927.   def setup(map_id)1 {' r& i/ r# ?; i
  928.     galv_reflect_game_map_setup(map_id)
    # g+ M  _9 w9 {( o. D* [
  929.     reset_char_effects, D+ l  O; x4 |) C! K
  930.     do_all_chareffects
    4 ?! H2 w! g/ L* c7 A
  931.     if SceneManager.scene_is?(Scene_Map)/ t6 {% \& A& N/ L
  932.       SceneManager.scene.spriteset.refresh_effects2 _, O! I. p' F  ]
  933.     end
    : i- a( }' z) x
  934.   end
    , |, B& @9 m8 K: h0 c
  935.    
    6 v  t  ]) Y) |% D0 f( e. C  B
  936.   def reset_char_effects
    + a, L0 t- P- c6 u  @; `
  937.     @light_source = []
    ( i4 [8 r5 n6 T0 N4 y! h
  938.     @events.values.each { |e|
    + y+ W) M, e3 u1 B
  939.       e.reflect = false& V3 [, l2 L1 r* H
  940.       e.icon = nil }4 R  C# _2 |1 b8 w9 m) R
  941.   end0 u8 m0 Y) G( r% M4 \7 ?
  942. end # Game_Map
    * c/ i0 ^9 E, p, a9 ~5 ~* q0 l
  943.   4 z; S$ r; c4 G% w; V
  944.   
    7 F  w. U: O; e6 F! s( }9 Y
  945. class Game_Actor < Game_Battler
    # a! A/ P# _2 I" R
  946.   attr_accessor :reflect8 i# ]: y) R! R7 I& u$ ^
  947.   attr_accessor :reflect_sprite2 u2 z( I, i) X8 i4 M
  948.   attr_accessor :icon" r: Z. a0 V5 p7 |( p+ ?7 ]) B
  949.    
    5 R, U( C$ _8 O
  950.   alias galv_reflect_game_actor_initialize initialize
    - e" |8 A3 {& K0 s- I
  951.   def initialize(actor_id)
    # r( g2 w* E( }+ K
  952.     galv_reflect_game_actor_initialize(actor_id)
    & ~* c/ Z$ C" W- p; Q; ~
  953.     @reflect = $data_actors[actor_id].reflect
    * D+ Y2 s& e8 y  p
  954.     @reflect_sprite = $data_actors[actor_id].reflect_sprite
    # Z* ~  C% h- ]: A9 P9 f
  955.     @icon_offset = [0,0]; C. a! a2 g% u4 n( _* x. G
  956.   end
    ( h3 D* t& d5 z
  957. end # Game_Actor < Game_Battler5 h6 k. K0 p/ T8 v1 y& Q. ^
  958.   8 j- A8 J' S- ]- z, Z
  959.   
    2 T$ d5 l" \4 ^% |' C/ k
  960. class RPG::Actor
    6 K* z3 g+ E% ]# H" W, e8 L* _
  961.   def reflect_sprite6 g& K6 {, I% I
  962.     if @reflect_sprite.nil?/ x( N& T0 E) ^0 K8 I. ]8 j
  963.       if @note =~ /<reflect_sprite:[ ](.*),(.*)>/i
    . H* g0 z& @2 H( Z* v5 \
  964.         @reflect_sprite = [$1.to_s,$2.to_i]! ?1 ?, W, V- q" N9 v; i, y
  965.       else
    1 X2 [8 n9 c& S2 P* j+ j
  966.         @reflect_sprite = nil
    * Z* [, H( P0 I  z. O
  967.       end
    " W$ `/ A3 G% y& D; w1 V2 o
  968.     end
    : v4 i+ A0 Z9 K9 ]. t8 L9 N0 i8 M
  969.     @reflect_sprite$ c# V0 \" r5 B2 B1 T! ~/ M% V# G
  970.   end  @3 A; ^3 i0 {: l$ T; }9 p
  971.   def reflect" v0 y. _) _$ x
  972.     if @reflect.nil?7 H. N8 f: M  U1 l" }
  973.       if @note =~ /<no_reflect>/i' l0 i# {2 ]; {0 R8 C- o0 {& b$ o
  974.         @reflect = false
    , V  l1 d: o7 \7 c) J  j
  975.       else3 s8 R" _0 r; F) _/ S
  976.         @reflect = true
    5 I8 l8 [# v. O4 G( \: z
  977.       end: N1 Q- X. D4 O# i& s$ W
  978.     end
    ( C0 w; }: X6 T8 _4 U
  979.     @reflect
    % m: r9 ]- U! x2 T
  980.   end
    $ P) P) Y$ G2 [; k' D
  981. end # RPG::Actor) t: A* L, C6 a4 K+ a
复制代码
回复

使用道具 举报

梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
回帖
4
 楼主| 发表于 2014-6-25 11:35:49 | 显示全部楼层
记得口袋妖怪的池塘是有倒影的
回复

使用道具 举报

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本发帖返回顶部