Project1

标题: 水面动态倒影,求解 [打印本页]

作者: 禺谷皓月    时间: 2014-6-25 11:31
标题: 水面动态倒影,求解
代码复制
  1.  

( M& |8 V5 ]. w这个代码怎么用啊,有大神知道吗。我从国外找的。
9 g# _& N# G3 k) ^http://galvs-scripts.com/2013/02/21/character-effects/
( q0 S! ]7 i0 b6 l$ D是关于动态倒影的
作者: 禺谷皓月    时间: 2014-6-25 11:32
  1. #------------------------------------------------------------------------------#1 v' x8 M' H0 {: ?
  2. #  Galv's Character Effects
    2 Z: A5 ?# N# f
  3. #------------------------------------------------------------------------------#0 p3 X. ~; H# r) X1 C% k
  4. #  For: RPGMAKER VX ACE: ~  G5 U3 ?. i0 ~4 V% T9 s: h
  5. #  Version 2.1
    , W6 J7 u, k9 y) ~( x/ U  m3 a
  6. #------------------------------------------------------------------------------#
    ! f1 l  _: d. |9 I: |
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows
    : l0 M. E0 ], Z  @! H
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects- ]/ T% Q- y% X- X! }# q
  9. #                           - Fixed shadow facing bug$ w. |2 m# w% H- u& y* R" a3 I
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows
      U+ a5 x6 G$ }7 d, |; P9 B! |
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows
    $ S4 R" h: \% s; L, N/ G
  12. #  2013-02-22 - Version 1.7 - bug fixes
    * m0 M" Z1 F, c2 t" L" T
  13. #  2013-02-22 - Version 1.6 - added icon effect
    8 S9 }) B' e4 [. D9 @' U$ Y0 [( \
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps
    3 }6 u+ W6 u3 |: @% \# i! U! {: f3 j
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles# x( I$ b$ [% R: [$ a4 {; b% M
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks
    % k- A. w7 `+ E
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)
    . U+ u. b0 {' m. ~( S/ [6 t$ q
  18. #  2013-02-21 - Version 1.1 - updated flicker effect
    8 ]- J* ^) z/ \+ k' |: g8 ?
  19. #  2013-02-21 - Version 1.0 - release$ W$ H2 x. y7 @+ A0 J( k* u( R
  20. #------------------------------------------------------------------------------#
    1 o+ z6 t+ ]& _& T. E4 d! a, k
  21. #  This script was made to provide some additional effects for characters such& j2 J3 |4 H" W9 G# w" e
  22. #  as events, followers and the player on the map.: C, I. e! m' ]4 p& ^9 g0 w
  23. #  Currently it includes:
    ! e* h" J2 _/ s
  24. #
    1 B- m1 Y' N! l& G. b- F' j8 O
  25. #  Shadows/ d6 X3 j& l" g- S/ P- Y+ W$ ^, d
  26. #  Shadows that appear under player and events in a directions depending on
    ( l1 C5 @3 p6 C% [8 c( }& b
  27. #  a light source that you choose.
    ! Z7 L) k' P1 P& I, B- }) t2 l
  28. #
    ; P2 B4 t. z# i" H
  29. #  Parallax Reflect
    7 K3 m2 u' b: q4 H
  30. #  Reflections that appear on the parallax layer for events and actors to be# M: z5 f, M. {( h( }5 s4 t
  31. #  used for things like reflections in the water or glass floor etc. To get
    % D  W+ T2 C- k1 b( m: Q
  32. #  effects like the demo, you need to edit the charset graphic to make the water$ O0 C0 _& L6 r- R! b  M0 M6 Z
  33. #  partially transparent.% F& Q( f3 d0 j" P) z  ^" U
  34. #
    ; s+ q% A, ^3 D; X1 G, V
  35. #  Parallax Mirrors" \& v1 O& l1 i9 B
  36. #  Much like reflect but are instead actors and event are reflected in a mirror
    + R& x, |1 Z) B7 P% o& \0 b3 S
  37. #  on a wall designated by a region. Both mirror and reflect effects can be- ?' T, }2 p+ L" w! |& i( U4 I
  38. #  changed so actors and events can use different charsets for their reflections
    ( v" R2 X$ N- g7 d) \' h
  39. ## N/ l& {* t( n) c. J
  40. #------------------------------------------------------------------------------#
    4 A( |. p" [4 E- y1 T9 q+ @
  41.   
    ( X& u' _* J; R+ D4 Q" ~

  42. 4 h% J5 B8 J8 t3 ^( l/ Q
  43. #------------------------------------------------------------------------------#5 \  z4 p* t6 w" b+ @: \
  44. #  NEW - First event command as a COMMENT
      `: r9 i" A! G% N4 N! W
  45. #------------------------------------------------------------------------------#+ W. r( I9 t$ L. e2 j0 Q
  46. #  You can add a comment as the first event command on an event page to set if
    $ i2 h6 S5 c* l- O
  47. #  that event has an icon, shadow or reflection active. The tags to use are2 S+ k2 r2 k3 P" t: L# {
  48. #  below, all must be on the same line in the comment.
    # [0 H3 Y. ?/ \* d/ @& _
  49. #. }( `' B( S  _' I- [6 B) R
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)
    # ^& Y  n9 Y0 }, r/ ~, _
  51. # <shadow>           # set the event to display a shadow
    2 [8 Y/ K! N2 E  T
  52. # <reflect>          # set the event to display reflections
    1 a  m8 d# F: o# i! T! Z: c- Y
  53. #, l1 [- O" x+ F" k
  54. #------------------------------------------------------------------------------#0 T0 k, T) P8 O5 w6 ~) U. q
  55. #  EXAMPLE:4 P, B! y! Q+ h
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event( v4 {" Z$ u# t) _! H; [$ ~
  57. #------------------------------------------------------------------------------#& x% j* O3 L  z( }" C. X0 c

  58. & W4 E" H- i& [" t0 `

  59. " j4 m* {7 I$ e) @) _; ~6 H1 O0 w
  60. #------------------------------------------------------------------------------#  d. _) n# P$ H
  61. #  SCRIPT CALLS:
    ; A6 E+ X1 Z6 K4 I4 e
  62. #------------------------------------------------------------------------------## a, a/ c. F0 @( L& E8 F: v
  63. #6 `4 d1 x- u- r/ n* l
  64. #  char_effects(x,x,x,status), w) j( d. f; r0 @
  65. #8 R& |1 H1 K  P& v) a! |( U8 L
  66. #------------------------------------------------------------------------------#
    0 d4 E- s9 s/ b2 h( t8 P4 i4 L
  67. #  # each effect can be true or false to enable/disable them during the game.) v& S7 r+ D8 Q  ^
  68. #  # you can change multiples of effects at once, x being the effect number
    " e- a0 t  X/ z9 X
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons* {+ c! c- z; x5 y' u( c
  70. #------------------------------------------------------------------------------#
    1 J# S! D. w" X4 i, B
  71. #  EXAMPLES:* n+ _  A( O- G; N3 A0 X7 u9 D8 y
  72. #  char_effects(0,true)              # turn reflections on
    : h6 E9 |, v$ n% _: d0 ?6 ^
  73. #  char_effects(0,2,true)            # turn reflections and mirror on$ [2 v9 x& b: n. y! Z# W) J8 n
  74. #  char_effects(1,3,false)           # turn shadows and icons off+ H0 f9 i" h% v' F9 _  ]
  75. #------------------------------------------------------------------------------#1 s* J$ _7 b2 m7 a
  76. #  K) f' C7 q0 O( M; z
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset
    . t. M  q3 m& @3 b9 D( w
  78. #1 m7 _) K% _7 ~* p. l( o! P: [1 y# t
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset) N4 G' q0 J" D
  80. #6 @4 K" {6 i7 i
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset% s8 O4 G+ {2 R
  82. #
    % Q% `2 v* R5 j4 F9 r* S$ |
  83. #------------------------------------------------------------------------------#
    8 c& ?8 V, a! a- `  I! }, t" I
  84. #  EXAMPLES:
    & {; X" \4 A' u( _
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite5 y/ X( }! l9 W$ d% n6 G
  86. #                                    # in position 2 of "Actor2" charset.' n" B* ]2 {2 c# t  y7 ^: Z
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of
    0 w. F  n- O- w1 ]! q
  88. #                                    # "Actor4" charset.* z) X- i3 w3 y& w. F/ i# Q
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of1 p4 W9 T- w0 |* C3 M. P6 j9 q9 Y$ b3 R
  90. #                                    # "Vehicle" charset.
    & a  F: i  r: o& `8 q$ S! V
  91. #------------------------------------------------------------------------------#
    ( s, s' V; ?; H1 O/ q
  92.   
    ; t+ _: a$ M: o" o$ V7 e1 K
  93. #------------------------------------------------------------------------------#. f8 J  C" I- a/ O
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS7 s' E3 \' `1 j
  95. #------------------------------------------------------------------------------#
    3 [) w! F: S( R) O! @
  96. #& l0 p2 z  W8 v
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off
    2 I+ i  }# A( ?! }' l+ K
  98. #                          # use this to specify for mirror and reflect.! p7 u/ O' N. E7 C
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change$ T! q$ {4 g7 ^9 L6 d6 j6 q
  100. #                          # to change all events use :all
    ' M" b- o' r, K& h8 V+ x
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make
    6 D4 N2 @0 @4 ?
  102. #                          # it 0 for no icon.( @: p* r: g, Q. d, ~
  103. #
    + O/ l+ k; |/ U1 f& B) ?
  104. #------------------------------------------------------------------------------#
    8 Z) W% ~5 W& [' [+ s
  105. #  EXAMPLES:  p/ ]8 i& ?( }+ {
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON7 ~( ^/ V" M' r4 u! E
  107. #  shadow(1,false)         # Turn event 1 shadow OFF  K$ A$ s; ~) X2 J, g- A
  108. #  reflect(:all,true)      # Turn all event reflections ON! m8 J9 K1 X/ {% K# d! ?
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear* ~+ `" s7 D2 ^( B
  110. #
    . T( V. J4 |9 f5 f6 P4 a9 j
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering
    $ n5 T& T; w# S" K4 k1 n4 Z
  112. #        a map. This is a design decision to try to keep lag to a minimum. You
      i- J5 o% f, X" Q+ x& Q/ n+ Z
  113. #        should use these effects sparingly and only activate them on events# u5 a/ ^4 q2 h8 j: T3 @2 z- c5 F: Q
  114. #        that require them.8 m" S  f  [& c/ V6 J
  115. #------------------------------------------------------------------------------#+ A8 k' A2 O1 Q8 A3 v- M
  116.   
    " D: c$ r0 C- V0 W
  117. #------------------------------------------------------------------------------#5 G6 z9 ~$ l" A2 ]/ L! ^$ c
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES
    3 T5 S1 b! f8 X* R4 ^
  119. #------------------------------------------------------------------------------#3 M3 y' o# A  m/ ?) [
  120. #7 D  B/ I/ N; R' w6 J7 H
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default
    , t+ V" o7 }2 A! Q$ g
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off * l3 R2 N$ J# D/ N6 L  ^
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.
    * ]1 a1 ^3 L) t5 h- E5 i2 X# M. b
  124. #, H+ u# I4 H1 n- l% l* b' r( p
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects
    / \2 L, j, `' M9 Q
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.3 h* t- R% D: n
  127. #  v_icon(x,x,x,icon_id)+ ~7 B9 C( H8 g5 k6 A* u: m
  128. #6 U2 A0 e9 g- ]
  129. #------------------------------------------------------------------------------#  B( T' y% n/ j7 o4 j' v
  130.   
    : _& d% ?( Y8 }3 q8 @- P6 j
  131. #------------------------------------------------------------------------------#0 k+ @1 r' @) W! S$ i
  132. #  SCRIPT CALLS for shadow options/ H" i  P8 e& T; n! I& n
  133. #------------------------------------------------------------------------------#4 J9 K, u. N) z1 K0 f2 J
  134. #
    , N# i# X2 p8 F
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the
    + k8 M! _; O, k' c+ c/ n. c
  136. #                              # light source number you wish to change (for5 q$ z+ c6 i: C% U
  137. #                              # more than one). These are reset on map change.( ]8 {. O7 c! L" f1 M5 ?
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.' A5 u0 J9 Z- h" k' K2 `, ^
  139. #                              # This will need to be in parallel process if you
    . u) V3 F+ R- Y' b5 O
  140. #                              # want it to be a moving light.
    ' A8 k) T# [& ]4 E$ l
  141. #2 o# @& ]* x/ E0 ]6 k* n
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below2 l3 l! ]2 c. ^2 v
  143. #3 X! y; i% D2 I- o1 C
  144. #    # intensity = opacity when standing next to the light source (255 is black)
    5 |/ j9 w; r1 m" s
  145. #    # fade = amount shadow becomes more transparent the further away you are.% V6 K5 a2 I9 E5 J+ Z4 Q
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.+ n. v1 W* J+ W# F" B! [( i8 U
  147. #/ A* a$ |8 \5 x+ F) w, j- O0 t. b
  148. #------------------------------------------------------------------------------#
    3 i+ [* t# o) R2 j3 {/ f
  149. #  EXAMPLE:
    5 n- k$ C  R2 Z( `. G; X
  150. #  shadow_options(80,10,false)    # This is the default setting.
    ! O) d9 g6 f' H
  151. #------------------------------------------------------------------------------#
    & q4 i/ ^8 M3 W
  152.   ! R* \) x9 a1 ?
  153. #------------------------------------------------------------------------------#
    5 _% Y! L5 x; X4 j2 a
  154. #  SCRIPT CALLS for reflect options
    $ {' O6 A- e; W3 D% g: D: J
  155. #------------------------------------------------------------------------------#
    " s* b) s; ]- O# N
  156. #- Q% L$ @9 R8 _6 ^
  157. #  reflect_options(wave_pwr) 6 Y8 Q, S% R0 @: `+ t
  158. #4 |2 M* N/ u  p- y- o$ P
  159. #    # wave_pwr = how strong the wave movement is. 0 is off3 A# {2 s7 N, d0 k! H1 f8 N" ?
  160. #
    " I* {0 e/ U; Q' h* R" m& E! S9 Q
  161. #------------------------------------------------------------------------------#
    4 c1 V, q* u# T% o; G: B
  162. #  EXAMPLE:
    4 C1 \2 J5 ?: l
  163. #  reflect_options(1) # Turn wave power to 11 o" N$ x3 z3 E1 f6 m
  164. #------------------------------------------------------------------------------#, ?1 W5 y: W+ H$ O+ E
  165.   ! K$ h5 C! s8 b2 ~
  166.   , x1 x0 Z% [0 {6 }
  167. #------------------------------------------------------------------------------#; v- i) T( o; }, K6 D8 F
  168. #  NOTETAG for ACTORS) Q# c( Z. ^- l  H% s5 U! p( |
  169. #------------------------------------------------------------------------------#4 A) @. `/ [' `* Z- q3 i
  170. #  M- D  j# v/ l
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)
    ' {# W8 i! x: V; H0 L( M) ^
  172. #
    $ K, n9 i% C7 h5 T
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections$ J- W- `. h$ R
  174. #                                  # and use the character in position 'pos'
    $ `: U$ c9 ~2 w9 C3 k
  175. #, f5 L" p+ k* x- T4 J
  176. #------------------------------------------------------------------------------#7 O" m9 T6 q2 M; Z4 _/ j
  177. #  EXAMPLES:
    * h  H* p5 |$ K8 Q: _, M
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset9 N0 ^9 C- l+ a9 c: y
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset2 d4 p, n) Z1 a5 E) V* \
  180. #------------------------------------------------------------------------------#' C( d7 E) Z. A9 m: P
  181.   1 H+ y( i' D# q5 t( R. @
  182.   
    ; n9 k9 r0 e- o; j& ^  g0 L9 j4 [
  183. ($imported ||= {})["Galv_Character_Effects"] = true
    5 U' z! y- f& @  D
  184. module Galv_CEffects
    . W% K. N1 p. f% G# L
  185.   
    ! }$ a' X" P! q9 ]$ p
  186. #------------------------------------------------------------------------------#  $ H9 m# b' a6 K8 H! L
  187. #  SETUP OPTIONS
    & g$ R. M0 B. V3 m  b" h( A' Q
  188. #------------------------------------------------------------------------------#! L! L5 E/ ~9 e) x
  189.   ! U# m# C3 B* m2 F
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the- k6 a. Z/ `' C4 N! f: B( V+ _
  191.                         # region on the wall you want to make reflective (and* _- f; ]6 X8 ]5 k+ v% ?
  192.                         # then use tiles/mapping that make the parallax visible)
    ( H, T3 V+ y, J" I& R  A( W9 A$ p
  193.   " K% d: S4 w9 D1 q
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters* t* U3 ~9 `1 D, b, E* u( M- n
  195.    
    - o* e' O# o* S4 W" C
  196.   REFLECT_Z = -10       # Z level of reflections- r3 }4 s) `6 i1 R
  197.   SHADOW_Z = 0          # Z level of shadows, z( u% R/ Y$ U- G! U
  198.   
    0 y' Y2 `, C3 Q0 Q+ _3 f! d( R& i  x
  199. #------------------------------------------------------------------------------#  ( O8 L; x5 K' b5 e4 E
  200. #  END SETUP OPTIONS
    : W' `% a$ B8 @; T. W
  201. #------------------------------------------------------------------------------#
    ; \1 `" q0 q! n' t* _
  202. end( B9 `+ q( r3 ^  ~" W* [! Q6 z, L4 H$ ^) k
  203.   
    5 z$ c1 ?2 G) C' j/ [9 O2 U
  204.   ' T: E5 y7 F" s: p
  205. ) X! d* J0 Q9 d$ k
  206. # f3 R. z  e6 B3 J8 G) K" e
  207. class Game_Map
    ' c9 s! M$ w) w
  208.   def do_icons(refresh = true); A) u, [/ A0 A1 n' J6 H! ~
  209.     @events.values.each { |e|" `8 p' f- h6 [( Y% J. r
  210.       next if !e.list/ c, \* f5 `8 p6 I& i0 h
  211.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/+ Q2 E* \3 e1 s, g3 v2 W
  212.         e.icon = $1.to_i
    4 e6 S% }, ~: [; T$ G8 n( A
  213.         e.icon_offset = [$2.to_i,$3.to_i]4 h  a/ L* ]1 }& Q- Q, B
  214.       else1 v! v7 T" X. A1 N( g
  215.         e.icon = 0
    ; [1 j! G+ B0 S# f4 H" x
  216.         e.icon_offset = [0,0]' m) ]8 y# q  J$ Z" d3 L
  217.       end
      A# d8 f$ J0 Q3 d& j4 n
  218.     }
    1 L  T- |2 k# }/ ^5 Q" v
  219.     SceneManager.scene.spriteset.refresh_effects if refresh
    0 h$ f9 @/ J' g) f( ^) a
  220.   end
    9 D8 k: _( o2 b1 y6 e# V& K* [
  221.    
    8 Y( ?% I9 K& c3 q% {
  222.    ' x. [( j* E3 f% e
  223.   def do_shadows(refresh = true)9 t! W" C( Y1 i% g8 ?1 z7 \
  224.     @events.values.each { |e|
    8 q1 G- u( ^* k. o
  225.       next if !e.list" \7 O! o! d% Z! d' K0 _' Q
  226.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/' F( W. }2 b6 d7 N) I8 X) y
  227.         e.shadow = true
    8 z8 `+ n5 d8 J! _/ W& Z' Y
  228.       else0 [7 e9 {- k* n- V5 d7 d* Z
  229.         e.shadow = false1 @% m( @4 R# w9 g0 p
  230.       end6 Z. W" s6 x. Z% M8 b: n: z6 d( [
  231.     }2 ?/ \7 M$ @& Z& r
  232.     SceneManager.scene.spriteset.refresh_effects if refresh
    % s4 n4 Z+ p9 w% }6 \9 t. C" |" g
  233.   end" _/ }' j" t0 h& |
  234.    8 b0 d' }, S$ D$ [- ]
  235.   def do_reflects(refresh = true)  z2 N9 I, g" i6 K. `, Z# z" g
  236.     @events.values.each { |e|
    5 b7 _* x* V9 f( t$ ]2 X
  237.       next if !e.list
    5 @3 I3 `0 o3 m
  238.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>/7 O7 g  v' U# m3 Z
  239.         e.reflect = true  B* Y, l- D8 r( c1 {
  240.       else
    - @. W% Z7 t% C
  241.         e.reflect = false# W( e) G' l. @
  242.       end( `+ o% T" G* ]5 _' E6 m4 B
  243.     }) v' ]$ Z. ~- u  l+ I- q9 B
  244.     SceneManager.scene.spriteset.refresh_effects if refresh
    9 D8 `* x, y5 [# g* `  N. f- T
  245.   end. |) r3 x  I" c% k2 H1 D) L
  246.    
    ) [/ s% M7 n0 h; X
  247.   def do_all_chareffects
    5 h% d  x* e! z' G
  248.     do_icons(false)( V& c& B; m' a
  249.     do_shadows(false)
    , ^: T5 ~+ u" w$ ~) i2 r2 T. X
  250.     do_reflects(false)$ w3 V7 d$ F% Z4 `( h
  251.   end
    , g$ x: A- e* T. U  w2 n5 M9 @3 S
  252.    
    % n8 B! y4 c" k4 R8 b. U
  253. end # Game_Map+ B) h% U, n7 [& J
  254. / T3 N; D, P% u8 t- O5 L

  255. 9 ~" p, v+ ], c- {% ?. I: _

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

作者: 禺谷皓月    时间: 2014-6-25 11:35
记得口袋妖怪的池塘是有倒影的




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