Project1

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

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

& z3 G. c2 U: t: d) O$ H这个代码怎么用啊,有大神知道吗。我从国外找的。
! S; P5 Y. G& ghttp://galvs-scripts.com/2013/02/21/character-effects/
7 m+ ?9 M* x' i" g, v. h1 `' O是关于动态倒影的
作者: 禺谷皓月    时间: 2014-6-25 11:32
  1. #------------------------------------------------------------------------------#
    . l+ v# |' S: e
  2. #  Galv's Character Effects5 A% D: [! W* P* P' v5 O0 u
  3. #------------------------------------------------------------------------------#8 S0 k% t: m( \; C5 a6 O+ Q& X* v
  4. #  For: RPGMAKER VX ACE
    # _! b: f: _6 l% h
  5. #  Version 2.1# u4 S6 w" e9 R' C
  6. #------------------------------------------------------------------------------#  M; E; J  S9 S% O4 f
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows; X/ A: W3 C2 f7 t" X+ S
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects9 _7 ?+ u. Z. w3 a, X
  9. #                           - Fixed shadow facing bug+ f: A* R& [: I# P" J& b  D
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows
    ! ]0 F9 p* K+ v: u( z' n
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows
    7 H" I. A* \  f; C
  12. #  2013-02-22 - Version 1.7 - bug fixes! P- [3 W6 P. C# _6 L( y; a
  13. #  2013-02-22 - Version 1.6 - added icon effect
    0 q: p( C! @6 Q2 n. [( ^6 V* g
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps/ e- W6 f1 s/ q/ D/ `& J
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles/ x/ L, R5 i5 `( j; X% R) E
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks
    6 }1 h* V. r5 b3 ]# e
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)7 m' q2 p8 F1 S- e' Y" u( Z
  18. #  2013-02-21 - Version 1.1 - updated flicker effect
    ! v. [1 t( ?) g$ C7 `/ C  n4 t. z
  19. #  2013-02-21 - Version 1.0 - release
    % q) D7 N' {( _5 \
  20. #------------------------------------------------------------------------------#7 E" o# l5 m; o' F
  21. #  This script was made to provide some additional effects for characters such6 t9 Z+ J2 h; w; Q
  22. #  as events, followers and the player on the map.
    & O+ d' d+ l" O4 }& A! u  N8 Z
  23. #  Currently it includes:
    ( s, n. A2 h" Q" z% A7 q2 \
  24. #2 q0 E. q6 g5 q# v3 O
  25. #  Shadows
    / @+ o) ]1 ?4 ?! z3 v. t8 i
  26. #  Shadows that appear under player and events in a directions depending on3 S1 S  H2 q% @+ U  W, T  q9 f
  27. #  a light source that you choose.
    * [' E: W' j7 t5 Z& B
  28. ## t! @# g! P+ Q, @7 P% H8 F8 M9 F
  29. #  Parallax Reflect. c' b; x+ f) b3 m! N
  30. #  Reflections that appear on the parallax layer for events and actors to be; k/ X9 `# \. x: i
  31. #  used for things like reflections in the water or glass floor etc. To get
    $ f1 f% t# Q1 V9 v3 Q+ h
  32. #  effects like the demo, you need to edit the charset graphic to make the water. W# A# ?( V0 p/ k4 m( L- d& c
  33. #  partially transparent.
    ) e6 X# i' q# K7 E/ X7 ~
  34. #
    " s. v) I  r" e! _4 R
  35. #  Parallax Mirrors3 B$ g* [( r1 g7 Y( a8 U$ a$ T
  36. #  Much like reflect but are instead actors and event are reflected in a mirror* o6 A; S( I+ U9 S
  37. #  on a wall designated by a region. Both mirror and reflect effects can be
    ' O: w- q$ N' q" n
  38. #  changed so actors and events can use different charsets for their reflections
    7 `8 ~( T0 q! c
  39. #5 x! r4 v6 n4 K9 \/ K
  40. #------------------------------------------------------------------------------#
    ' h8 }8 W6 h+ `/ q3 K! A
  41.   5 q: G4 T1 M* M* |  Z
  42. / v8 ~1 a  a, j3 s
  43. #------------------------------------------------------------------------------#( j. a: h* k( `+ M) f5 X
  44. #  NEW - First event command as a COMMENT* b9 t+ `# \# B6 N7 W
  45. #------------------------------------------------------------------------------#
    # m+ B; x& K! t. W3 D/ ~
  46. #  You can add a comment as the first event command on an event page to set if: ?7 F$ N+ T$ n: H. Q* G
  47. #  that event has an icon, shadow or reflection active. The tags to use are. u, w, }; Y# w( e; p% r2 y  v# A0 t
  48. #  below, all must be on the same line in the comment.* }3 c- A; T1 k$ f+ j
  49. #
    $ |! c5 v/ N, {" o0 b; @
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)
    5 n% i- c0 N/ q- `
  51. # <shadow>           # set the event to display a shadow
    " N& t' O. }- D8 {' U
  52. # <reflect>          # set the event to display reflections4 {. s) C/ A' p. D8 x* T
  53. #0 ]' e# @$ {! k6 V
  54. #------------------------------------------------------------------------------#) d; j3 J1 ^: s- X8 ]
  55. #  EXAMPLE:
    5 @. c5 O1 [/ z; d2 H, C6 I% [" X
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event7 |' h9 b; Y+ F' N0 O1 r
  57. #------------------------------------------------------------------------------#6 ]. k1 t1 o8 P9 Z) C1 N( f* o3 {( R

  58. 3 U3 V! y/ \6 D# r' v

  59. * @; n4 _6 J8 F6 g
  60. #------------------------------------------------------------------------------#) W: Y+ U* y( B9 s) v- i
  61. #  SCRIPT CALLS:
      Z6 ?3 {) g5 T3 q+ D& o- A9 |
  62. #------------------------------------------------------------------------------#
    : @8 X/ L9 c8 M
  63. #
    8 q3 P# N2 d4 V! X! |0 A2 ^: n
  64. #  char_effects(x,x,x,status)
    0 o7 }( F- [( }2 z5 y. {
  65. #2 a  P- m6 q) d
  66. #------------------------------------------------------------------------------#
    - }7 R3 `5 R' t5 o+ K7 O" n8 V6 _
  67. #  # each effect can be true or false to enable/disable them during the game.
    ' `. K+ }; E- l2 x$ R
  68. #  # you can change multiples of effects at once, x being the effect number
      n. P. G8 ]3 @
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons
    8 [- Y9 ]$ A& m) L# T/ u
  70. #------------------------------------------------------------------------------#
    4 N8 V7 _6 }$ [5 k% y
  71. #  EXAMPLES:7 |$ B6 K7 V) \! V
  72. #  char_effects(0,true)              # turn reflections on! Q7 M' W$ E2 z: |- c
  73. #  char_effects(0,2,true)            # turn reflections and mirror on7 o6 @" [3 k6 R2 t5 k# z
  74. #  char_effects(1,3,false)           # turn shadows and icons off
    9 P% Q) N) |: _) `9 J$ G& P
  75. #------------------------------------------------------------------------------#$ w- k' k3 U; _+ X
  76. #! z* Q2 b) F. _
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset$ B( R) E3 ^( E+ P% @
  78. #% u2 ?, q# g8 Y' ~
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset3 T' m7 R) B. g) y* f# I+ i
  80. #/ C! D% ]' U2 H
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset
    ) j. N9 o* x- j8 i3 c( ]4 v
  82. #
    . G+ `# d% b+ k9 P, Y9 _: N) I* k! u
  83. #------------------------------------------------------------------------------#  e* ]" v0 T4 k
  84. #  EXAMPLES:0 F. |% n6 ^- p! z
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite
    1 \3 G7 ?1 T. w- L# ^. [8 q, h
  86. #                                    # in position 2 of "Actor2" charset.
    : V' L7 v6 Y) Z" S8 B1 g
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of
    , i1 O. D/ F5 `7 w9 K
  88. #                                    # "Actor4" charset.
    4 Y( k8 x0 \8 v, P- e
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of& c  n9 g* d8 Y2 ^
  90. #                                    # "Vehicle" charset.: A% b# u: T* h3 f! }: U0 m2 D
  91. #------------------------------------------------------------------------------#
    $ C1 V$ S& N. ]2 y8 A! E- L* j
  92.   . T5 u" \, C! r8 W3 X
  93. #------------------------------------------------------------------------------#, v( N0 b! G3 \$ ]- ]0 R) g1 M
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS+ U) X: P$ z: j! q  d
  95. #------------------------------------------------------------------------------#
    % U/ \) z2 n7 [  Q
  96. #
    2 e6 w! E( Z9 ]& [/ |( h
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off
    & ?. z# \7 Y; i$ r  d% o4 d
  98. #                          # use this to specify for mirror and reflect.
    6 F& H1 ?5 H' Q" P
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change% C  L+ e" W. O8 u
  100. #                          # to change all events use :all
    1 X  a- q, N% ^, B  o' U  k
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make
    $ ]$ G: J/ I( r$ [7 e7 ]
  102. #                          # it 0 for no icon.+ D: l5 _  ]/ a* H
  103. ## J9 ~1 o/ l1 t. h7 v- r& j
  104. #------------------------------------------------------------------------------#
    ( _, _4 ^: S) `$ X$ T4 y' ?
  105. #  EXAMPLES:
    % S, y! i2 N& x: e2 m- B" N" G; P
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON- M$ [4 v; ]! k+ d
  107. #  shadow(1,false)         # Turn event 1 shadow OFF4 P2 r7 g, N7 J7 T& k$ ~  O6 n: p
  108. #  reflect(:all,true)      # Turn all event reflections ON" b# G1 X) C! j
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear
    5 n) U% H: V; }9 @5 s3 |, I
  110. #7 a) l8 u8 |) c. o2 F
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering* P/ ^) P' K. I
  112. #        a map. This is a design decision to try to keep lag to a minimum. You
    : Z9 d+ S- g8 O7 t
  113. #        should use these effects sparingly and only activate them on events% A1 {$ H" W5 |# P
  114. #        that require them.
    + @' Z0 F3 J: X+ Z# L% X4 F
  115. #------------------------------------------------------------------------------#
    $ z0 p! M1 R& t$ N/ C
  116.   
    9 ~" e* u# j, t
  117. #------------------------------------------------------------------------------#' T6 e0 ^0 u" ?$ A& R  j
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES
    % I: Z7 W/ y3 ~* r6 q* S; c
  119. #------------------------------------------------------------------------------#
    & Q& x. N+ M# n, E% r% [
  120. #
    - Q. p6 T/ r! U6 D" O2 ^" A; |0 ^
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default
    0 b& K9 I! f2 d& E
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off
    / @5 Y! A  u9 @' D
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.
    4 Y. R7 h2 z  O: o" @5 U$ h4 q4 v1 Z
  124. #! \/ |. H" y& K) B: u8 B0 r1 r
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects4 y$ z+ p; t  Z" m2 V  b2 N
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.2 D% m0 p; D% d% K8 \1 W% N. g8 K
  127. #  v_icon(x,x,x,icon_id)6 w; H% u  z4 d  A, C. Q
  128. #: Q$ E9 Q& O* h
  129. #------------------------------------------------------------------------------#
    & k5 g3 `, d2 o
  130.   ( v/ C5 p1 f" d. D% i' J
  131. #------------------------------------------------------------------------------#
    - S+ A- f8 R+ T' d0 F4 F4 W
  132. #  SCRIPT CALLS for shadow options
    7 T' |1 v# m. {2 _
  133. #------------------------------------------------------------------------------#
    * j, @1 S0 t- T  T! B
  134. #$ M7 U) y$ c/ h6 W- Y* [: L( J/ Y
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the 7 G/ l' G- l% K  P. U' [" m4 r
  136. #                              # light source number you wish to change (for4 [+ @2 _5 y( ^
  137. #                              # more than one). These are reset on map change.
    4 e/ ?* e& q' _4 u7 H! o/ ^  E# |
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.+ k4 @3 [9 k8 a, Z& A
  139. #                              # This will need to be in parallel process if you
    % D$ f8 j: t8 B4 T- U8 R
  140. #                              # want it to be a moving light.* `# _2 x3 R' _# t  y0 m# u
  141. #
    % E+ h; B$ s% {- P/ P- J5 ~+ ~  `5 M. j- I
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below
      F. ?5 V3 F, a& q' y
  143. #
    2 a! r, @, a9 X0 E+ z
  144. #    # intensity = opacity when standing next to the light source (255 is black)% I  l' W& [5 o
  145. #    # fade = amount shadow becomes more transparent the further away you are.: ^+ p- ~0 Z' ]/ V: Z8 H
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.6 r% s# Z' |+ X9 U. l* `& a6 g
  147. #
    0 l& x) ~4 e( A1 q
  148. #------------------------------------------------------------------------------#8 ]# J$ O' \. ?
  149. #  EXAMPLE:! p# u- h6 f* ~! V' y! ^4 o8 n
  150. #  shadow_options(80,10,false)    # This is the default setting.3 L3 \+ _4 y* P/ T# B* q6 b! j
  151. #------------------------------------------------------------------------------#
    + ?& b; @% [4 d6 V5 m: ~0 W1 B9 [
  152.   
    3 Q0 I: y4 m3 m* E
  153. #------------------------------------------------------------------------------#$ S2 T2 }* Y4 V5 V
  154. #  SCRIPT CALLS for reflect options
    : x; D/ _) C1 G& ]. K! M' f/ W/ N* h& ?
  155. #------------------------------------------------------------------------------#- ]1 q- q! M  @; z& U0 P) S
  156. #9 q* X3 u' X) {- Z% @6 _
  157. #  reflect_options(wave_pwr)
    9 S( J  x* x3 D1 g! q- o* v2 u
  158. #
    " a, d+ u5 @  `8 ]5 g' b+ Y. S
  159. #    # wave_pwr = how strong the wave movement is. 0 is off
    $ b; Q- ^+ ~7 [$ ~
  160. #2 e7 d1 v: E3 k; s% C
  161. #------------------------------------------------------------------------------#
    7 T; Y0 ^( e9 K8 h* q
  162. #  EXAMPLE:* }/ ~9 S6 x* j/ z8 \
  163. #  reflect_options(1) # Turn wave power to 1
    , ~! O! _  p- A* z. f  I% X# {
  164. #------------------------------------------------------------------------------#4 H& \& Q# }; ~# Y& V
  165.   ) c4 y6 Q: O: G; A. ], E
  166.   + B( [5 ^* e6 I1 H, {) L
  167. #------------------------------------------------------------------------------#
    : _! B) l9 L' S! s
  168. #  NOTETAG for ACTORS; o- V% g  `7 U5 j
  169. #------------------------------------------------------------------------------#" M  q% B! P/ Z; P# g
  170. #
    ' n# B: j& q$ I" `7 ~( M
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)7 i  H2 m7 @' S9 f$ j$ l8 u- k
  172. #
    ) |- G7 {( G+ r3 r( b  Y0 V
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections" Z, D# [1 h1 E
  174. #                                  # and use the character in position 'pos'
    3 q4 P9 m. g" E9 q
  175. #
    # a6 K- T9 y1 O1 u0 y5 Q
  176. #------------------------------------------------------------------------------#
    ) h; J  q, R( @+ u' }
  177. #  EXAMPLES:
    5 z% v5 r( S; p6 R' C% c
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset
    ) A- K0 i3 D4 G4 @* G
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset; P: G8 X4 {: T9 ?2 o" z9 J
  180. #------------------------------------------------------------------------------#
    ( A3 ^2 a7 K, z4 Q- f# f4 M
  181.   ) N0 q& _$ b' f$ y
  182.   9 q1 f( [" r) z5 G" [
  183. ($imported ||= {})["Galv_Character_Effects"] = true
    $ ?% @: `% h9 S6 \! U& P/ i0 S
  184. module Galv_CEffects, H$ j) n  e5 t5 ~' j# u
  185.   " P* T1 J& u' u  @. G
  186. #------------------------------------------------------------------------------#  
    . b8 O' ?7 n+ O! m/ ]3 d6 E" a$ `
  187. #  SETUP OPTIONS: x7 U7 [+ O$ Q2 W
  188. #------------------------------------------------------------------------------#- \# ^- G. y( m; D/ N# n
  189.   
    7 C5 h7 _6 Z; G* @; s5 a( k
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the
    & w# B2 w" Y9 y: a) I6 R
  191.                         # region on the wall you want to make reflective (and5 Y) F: ?0 ]9 k; q
  192.                         # then use tiles/mapping that make the parallax visible)9 {) \1 G! E/ b( k- X( v! q5 e
  193.   
    $ W& A' J5 `$ L0 A' T
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters/ F0 [- C; @! Z" U4 p  b# z
  195.    
    3 m& n, D) z  b  A# S1 g2 x$ u
  196.   REFLECT_Z = -10       # Z level of reflections
    3 o9 E" d6 \1 m% ]" |0 n
  197.   SHADOW_Z = 0          # Z level of shadows/ P8 k6 K7 R! v
  198.   % ^& }& d0 u* P% _8 j5 l) Q
  199. #------------------------------------------------------------------------------#  
    % O% u/ r2 n: j% X! i
  200. #  END SETUP OPTIONS7 u/ P  @' p6 z8 Q
  201. #------------------------------------------------------------------------------#$ x* |$ S6 t! c7 {+ U
  202. end' x* b0 F/ f& |( D5 g& O
  203.   
    , V: O6 N3 ], n( u4 T
  204.   9 k/ F! m; x% f$ \1 w" n0 d
  205. - h1 L" O3 z0 l0 q+ q) c
  206. " A& m# P- y# i( A  Z
  207. class Game_Map
    ! |3 v8 t; }! |8 [
  208.   def do_icons(refresh = true)9 f4 @/ ?: ^: ?, m1 A" ?
  209.     @events.values.each { |e|' R; C4 [7 P7 }) X) i
  210.       next if !e.list4 c- S* V( v  i1 T
  211.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/
    2 ?  Q! v% g2 O  {! R; ?
  212.         e.icon = $1.to_i* k5 r! |' o: g5 [$ g
  213.         e.icon_offset = [$2.to_i,$3.to_i]
    4 V- @8 Y' Y3 w  s" ]# ?
  214.       else& T* [1 l+ x' J# G
  215.         e.icon = 0
      {7 _/ q. K6 n  Y. _4 r
  216.         e.icon_offset = [0,0]. P3 V& E  B/ T3 f
  217.       end
    ' o. L# }' O+ _( l
  218.     }4 H: w6 _- z9 @( E$ g1 @2 g
  219.     SceneManager.scene.spriteset.refresh_effects if refresh. \# n4 U: b  c3 r  u
  220.   end
    ! `) P* U8 g6 Y" R- s# A6 a
  221.    
      f) L* m1 D( k8 {3 x5 t  W! l
  222.    
    ( G. I* w& T9 ~: W
  223.   def do_shadows(refresh = true)
    ' k! [# |* z1 H3 k! X
  224.     @events.values.each { |e|& u) I6 p! g9 N5 m8 h" \
  225.       next if !e.list
    + q& T2 ^; k9 r' N8 s! t
  226.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/
    ' k4 J. d6 w* ~  x5 Z
  227.         e.shadow = true
    5 `# ^! m  g: C" p8 O/ B- H* Q
  228.       else
    & u" {# m* L8 o$ m7 d, ]
  229.         e.shadow = false$ A) G% s0 x- `( O5 W
  230.       end
    / }; i1 ~& Y1 ^# t% z( X  [8 n8 f
  231.     }: b; R. T, H# X
  232.     SceneManager.scene.spriteset.refresh_effects if refresh
    ; j& O; R; _0 M3 |
  233.   end
    8 \; P7 `5 m, q; o4 A
  234.    
    ( m$ Z6 Q8 M% z
  235.   def do_reflects(refresh = true)
    ! `" |; R- `; ^6 `) [9 b" Y' B
  236.     @events.values.each { |e|
    ) `0 D0 w0 [/ [# W# `) L
  237.       next if !e.list( X# Q  J3 q  j- Q$ H
  238.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>/
    ( n* p/ ^6 ]/ t# V* Q
  239.         e.reflect = true$ I3 y6 z: l4 o/ `/ h5 l% k
  240.       else$ R/ F3 V1 s# x+ f. J
  241.         e.reflect = false
    " _1 ]3 d( v9 K9 J3 o3 r8 x
  242.       end- Q+ U+ O# m) ^$ e. a
  243.     }
    & N& m- l& l$ w# K5 J4 w8 R
  244.     SceneManager.scene.spriteset.refresh_effects if refresh% b' {9 T  y1 s' z4 o
  245.   end+ ~9 S+ |1 N7 t  q- o0 P% o
  246.    4 U$ B4 Z6 M2 Z  m1 n  P
  247.   def do_all_chareffects  {" Z7 d/ r4 D# \- [/ D% C
  248.     do_icons(false)0 O1 f6 E6 k, _
  249.     do_shadows(false)
    & L9 m4 o  X+ C, A
  250.     do_reflects(false)
    % K1 Y, v8 v8 S
  251.   end* U' `: I3 t! T+ C' `7 ?: \+ ]/ u2 J9 \
  252.    
      t: U# z: b% C5 H
  253. end # Game_Map
    , ~+ Z2 P/ Q2 p) K

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

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




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