Project1

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

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

9 R2 A) t4 N' C" v8 _! R6 y; D5 J这个代码怎么用啊,有大神知道吗。我从国外找的。
( M$ K: n& b: G) ^http://galvs-scripts.com/2013/02/21/character-effects/
; Q% t/ A4 D% A3 j1 ^  j, d是关于动态倒影的
作者: 禺谷皓月    时间: 2014-6-25 11:32
  1. #------------------------------------------------------------------------------#; O1 Z" g. P: t( }2 O
  2. #  Galv's Character Effects* s3 ~7 s: |0 v' J
  3. #------------------------------------------------------------------------------#$ _8 r' \+ D( C( H$ _! P7 S$ E
  4. #  For: RPGMAKER VX ACE$ I4 F' `/ X# V) {. b
  5. #  Version 2.1
    ( }0 H$ U3 K3 l6 L! [3 Z
  6. #------------------------------------------------------------------------------#
    # h6 ^8 ^8 S# }  A# i, N
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows
    6 Z# M- M0 ?$ S7 S: }
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects2 Z7 E3 z* X# g/ n* l
  9. #                           - Fixed shadow facing bug
    7 [0 T, |& Z8 J1 C. ]
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows% E/ m  M! W' R
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows
    6 y5 k& l  b  U* Y$ u
  12. #  2013-02-22 - Version 1.7 - bug fixes
    : G, x4 X$ c- ?2 _2 `% p7 b4 E
  13. #  2013-02-22 - Version 1.6 - added icon effect5 K) N1 F6 U9 P: y. s3 u  d, T
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps
    5 w2 m3 b; g) I" j# J8 I
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles6 n( p' y+ C& _4 Q
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks: b7 n& a* f! n  ?+ e
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)2 A1 e3 @( L, u. c' ^9 I& V+ Q& L
  18. #  2013-02-21 - Version 1.1 - updated flicker effect
    , [6 H3 ?! Z* |6 d
  19. #  2013-02-21 - Version 1.0 - release
    5 a+ ~' H; O' f, R8 B
  20. #------------------------------------------------------------------------------#; ^3 C5 q3 r' ~5 v+ \
  21. #  This script was made to provide some additional effects for characters such1 G3 g( E8 C, q- ?1 F
  22. #  as events, followers and the player on the map.
    - M- a. C" q$ D
  23. #  Currently it includes:' }. b! o3 Z5 i
  24. #, [3 F( {/ U" d& o
  25. #  Shadows
    ! P; g! D# k4 G$ S
  26. #  Shadows that appear under player and events in a directions depending on7 P5 G, M" Q: g
  27. #  a light source that you choose.
    1 r9 \" h6 ?$ \8 W. Z6 I# K3 E
  28. #. u5 Z) C1 U. D2 `$ Z+ T8 {8 a9 k
  29. #  Parallax Reflect
    9 }* Q/ l9 R+ W  E) t
  30. #  Reflections that appear on the parallax layer for events and actors to be
    ' I; K3 t; }/ h) d
  31. #  used for things like reflections in the water or glass floor etc. To get
    ' F6 l- m7 k2 w# P
  32. #  effects like the demo, you need to edit the charset graphic to make the water+ w; x) J# y0 {$ Y
  33. #  partially transparent.
    ; Y  L$ T8 c; \0 r
  34. #% o# j  s$ E8 V! w
  35. #  Parallax Mirrors. d/ f+ ?! e& v5 k9 O
  36. #  Much like reflect but are instead actors and event are reflected in a mirror( Y. ?3 D6 n; L$ m9 S
  37. #  on a wall designated by a region. Both mirror and reflect effects can be' s( r  w: r! y: P. D/ x0 ~
  38. #  changed so actors and events can use different charsets for their reflections, f- u* x1 J' `4 `( {' M/ {4 l; w
  39. #  U4 a8 _8 H$ H/ |4 A* ?
  40. #------------------------------------------------------------------------------#
    + {, g. J! @5 l5 Z& _4 C
  41.   " x; `, ]; q( I2 Y* k. E  U9 ]

  42. . t3 p5 N. x& P# f& ^2 z
  43. #------------------------------------------------------------------------------#4 R' Q4 z7 ~. [6 {& u/ {, ?
  44. #  NEW - First event command as a COMMENT
    ) X- N' }$ D+ X* j0 r6 }
  45. #------------------------------------------------------------------------------#
    ( V' X/ @, e& q) t# L+ Q; G  p
  46. #  You can add a comment as the first event command on an event page to set if
    # C# M2 }5 K! l# {; T) U
  47. #  that event has an icon, shadow or reflection active. The tags to use are
    # f0 C+ s3 [5 L! k* `
  48. #  below, all must be on the same line in the comment.0 B+ S/ b5 ]1 j7 q2 T
  49. #- g$ Y. k4 {+ M+ O- @! [  d7 b1 C
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)2 p" Z) V, T9 u% c0 Z
  51. # <shadow>           # set the event to display a shadow
    8 D8 e: d6 @( x0 y7 E
  52. # <reflect>          # set the event to display reflections1 e! a. J9 m. W0 k
  53. #
    % r' S0 }8 c/ r, R
  54. #------------------------------------------------------------------------------#
    9 u0 @* ^6 I8 N
  55. #  EXAMPLE:
    6 O5 n$ z1 X% L* ~+ c" u
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event
    $ V; ?9 k2 o7 W8 l- l. i  M& g
  57. #------------------------------------------------------------------------------#, B$ f# x+ Z, f( \, T  M3 ^5 d* s

  58. + H# c" |# R& Y

  59. - x( M# Y( P" {
  60. #------------------------------------------------------------------------------#
    # s9 p4 A$ p9 T7 F# B
  61. #  SCRIPT CALLS:( q- l/ O, r5 o
  62. #------------------------------------------------------------------------------#
    % ^; p0 ?0 r% Z; t$ [/ D6 [. T# z
  63. #
    ; Y1 U2 n( I! Y  R1 t; B
  64. #  char_effects(x,x,x,status)5 J0 o6 I7 O' R# V! Q
  65. #
      K- U1 f( q, M: `1 U2 u: i
  66. #------------------------------------------------------------------------------#6 H! \) \3 y/ |4 u
  67. #  # each effect can be true or false to enable/disable them during the game.5 s$ |( i( B, e5 S/ c0 `- M" |
  68. #  # you can change multiples of effects at once, x being the effect number1 F/ F4 a' S* }' T0 |
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons
    + a. V! }! {! m' b  O
  70. #------------------------------------------------------------------------------#6 {: N8 h* p$ C/ D  t% E0 B
  71. #  EXAMPLES:
    6 K/ e2 p0 \6 A; Y8 n6 X( _
  72. #  char_effects(0,true)              # turn reflections on- {* J9 U- D( |3 {- G, ?! J/ u
  73. #  char_effects(0,2,true)            # turn reflections and mirror on
    % K8 ?9 e* U; @
  74. #  char_effects(1,3,false)           # turn shadows and icons off
    , J0 g( V% Z1 M0 I. I$ M
  75. #------------------------------------------------------------------------------#
    - j1 E# ^" p$ G  k# `9 `) K- m
  76. #
    - c" A- o$ G8 w& u/ ?1 ^" J
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset8 @$ h+ C. V! z$ T1 ~
  78. #
    # K5 g/ P: I" R
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset
    : [5 w, t4 C6 _) q8 v
  80. #3 g. }' c+ G; q( w
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset) E6 U# Z; z. R4 z# E3 s# K
  82. #
    % O( T& s( `* _' r) D6 n8 s
  83. #------------------------------------------------------------------------------#. l* H3 N& T' w3 K7 E- f
  84. #  EXAMPLES:
    % U% @4 W% Q9 G, Q3 ~
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite9 @$ B7 G2 I9 M  u$ m6 w4 ]
  86. #                                    # in position 2 of "Actor2" charset.
    ! z' u9 J; f0 J& H, }
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of
    . H& [2 M* c6 h* U
  88. #                                    # "Actor4" charset.( y3 v' B0 i  ^8 g
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of
    7 P: [% q1 R1 a. |" U0 E
  90. #                                    # "Vehicle" charset.
    3 n  a4 q* D* W' b: I
  91. #------------------------------------------------------------------------------#
    * x* m3 M6 X, B! k- R" F' N# ]8 I
  92.   + k" }0 c+ j2 l/ Q" ~
  93. #------------------------------------------------------------------------------#
    4 N/ L  b: ^' y+ E
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS2 \; e9 r; f+ ?  f( f1 ]. n8 I
  95. #------------------------------------------------------------------------------#! M1 ?& Z6 Q. Y$ h  T2 ?
  96. #+ E: N- y; J% A" w- P6 p3 Q
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off
    6 m9 o. ^& k! y# x0 \% l
  98. #                          # use this to specify for mirror and reflect.( P* M$ z9 p: {$ b6 \
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change" j! E* u& r  u2 R
  100. #                          # to change all events use :all
    + D- f8 {! u! n2 W# E! O% x
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make$ [7 C  _, M5 H; N8 C
  102. #                          # it 0 for no icon.
    5 D+ p* n% M2 l# T+ L
  103. #+ ~0 V( N2 |+ n7 k* ~
  104. #------------------------------------------------------------------------------#% Z% d, [% e/ |
  105. #  EXAMPLES:. y6 ~; S- i% h. ~/ Z
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON- W& p' [5 @0 m2 N
  107. #  shadow(1,false)         # Turn event 1 shadow OFF5 A2 f5 A5 V- q; U% w0 d7 q& z2 O
  108. #  reflect(:all,true)      # Turn all event reflections ON6 ]& R, J1 |  p8 E, R) y
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear
    2 h' R" \  @, o/ V' a# x# ~
  110. #
    7 G! v- B! R) Y: U
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering/ _: M7 `3 h" E* R! j
  112. #        a map. This is a design decision to try to keep lag to a minimum. You! V& K+ \: m2 h
  113. #        should use these effects sparingly and only activate them on events
    7 j4 w. u/ u6 b( m
  114. #        that require them.
    / T  R% H) p- r9 W$ h+ o# |! K& l
  115. #------------------------------------------------------------------------------#
    ' w& E9 }+ i5 B' j. @
  116.   
    8 o: p7 A4 W7 v. I  a+ B
  117. #------------------------------------------------------------------------------## P5 P2 H' h; J
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES1 N" c, ^. T& M+ ?3 n9 {! V" B8 ?
  119. #------------------------------------------------------------------------------#' \) ], N4 E- S# p
  120. #
    " o6 G  x0 e6 z& h
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default 3 m4 @7 {& U$ q% E
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off
    % n7 u( Y8 H6 S; Z
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.
    ) S- B  I2 ~) [( l3 |% p
  124. #
    ( {* F( [& J& e% M( t) e, |) w
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects
    / Z+ Z2 S: [- x& v& d2 ^
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles./ c: }5 w) B& A- O- G
  127. #  v_icon(x,x,x,icon_id)
    4 F5 M4 }: o& G6 _
  128. #9 o3 V9 C3 h( v; _
  129. #------------------------------------------------------------------------------#& s0 s; Z7 R2 D' G; b3 F9 e( |! g8 t
  130.   
    ! _3 n* t, [3 ], N6 z" {% k
  131. #------------------------------------------------------------------------------## c" y3 R4 _  {% ?" Y: X2 a9 q& J( G9 p
  132. #  SCRIPT CALLS for shadow options0 Y* w! R- ~  E/ k  r) K
  133. #------------------------------------------------------------------------------#7 e/ j5 T  z; v4 {
  134. #
    : |: z% B6 |6 ]7 C" ?
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the
    ! p$ ?$ W, a% s7 H' D
  136. #                              # light source number you wish to change (for2 {, O4 {) T& B6 ^
  137. #                              # more than one). These are reset on map change.% H* r! ~+ {7 x# r
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.
    ! `* p% E/ x4 t
  139. #                              # This will need to be in parallel process if you6 l/ y  {! [; M+ Y% [
  140. #                              # want it to be a moving light.
    ; U+ y# ~* ]: H7 v$ u' `
  141. #5 W% X! b" B9 k5 T
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below
    + _' z2 @8 R" \; Q6 x4 s1 B* d  K! s
  143. #% |+ @' D+ `( G( h
  144. #    # intensity = opacity when standing next to the light source (255 is black)- B9 O: n7 o% N% D- W: u" G9 N
  145. #    # fade = amount shadow becomes more transparent the further away you are.& j6 E1 n4 {+ J) ~& h
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.) A0 G5 C0 k! k4 v$ q( X# k
  147. #
    ! R. {! J2 ^0 H+ U+ Q
  148. #------------------------------------------------------------------------------#) E7 ^% P  n, d6 `3 ^
  149. #  EXAMPLE:
    # `( _' f" ^6 R$ m9 M2 T
  150. #  shadow_options(80,10,false)    # This is the default setting.
    . ^* \8 f7 @1 P
  151. #------------------------------------------------------------------------------#
      B% a9 a8 M3 Z
  152.   
      N' b' M  U  p+ j
  153. #------------------------------------------------------------------------------#
    , _# w; `* V% X2 T% G1 W; d
  154. #  SCRIPT CALLS for reflect options
    / `7 ?5 S% o4 V( C3 w& F
  155. #------------------------------------------------------------------------------#2 q  ?- b6 L: x' n/ l
  156. #* c6 M0 Q3 k4 o7 m7 D
  157. #  reflect_options(wave_pwr) , V% b; d5 r2 Z
  158. #
    . O& q  U5 D5 v& `, z' B
  159. #    # wave_pwr = how strong the wave movement is. 0 is off/ o' l$ Z, P; M# S
  160. #
    ; ?: R& ^& X2 ^  d# I
  161. #------------------------------------------------------------------------------#
    3 U4 R" [8 d  `: z& Y  y
  162. #  EXAMPLE:7 J( v% k" P3 y$ L
  163. #  reflect_options(1) # Turn wave power to 1  R  ]5 o; |& z3 P8 B' |
  164. #------------------------------------------------------------------------------#4 Q+ G, j' ?. n1 A1 m
  165.   
    1 a+ j/ y# F+ q% i5 M1 t% @; z5 B$ V
  166.   
    + A% s6 S% F, |6 L( \! C
  167. #------------------------------------------------------------------------------#. B% v. t$ f' H+ Z
  168. #  NOTETAG for ACTORS
    ( y- ]+ A9 x7 g0 M
  169. #------------------------------------------------------------------------------#$ G% w* Q' ?5 [5 N% v* Y! y
  170. #
    3 [8 e7 Z- ?* T- G' b" G3 ?
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)
    & Q9 Q: b8 w/ E8 b9 ~
  172. #
    3 e6 i* B3 q2 V& r
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections
    0 M# r4 H- i0 S( g* e( {
  174. #                                  # and use the character in position 'pos'  i+ H) i" j" E( h
  175. #( M# Z5 t6 Y8 s" H; O
  176. #------------------------------------------------------------------------------#( o2 P6 ^9 U& }  ^
  177. #  EXAMPLES:  V1 B# |; J9 d% a1 S: A
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset
    2 V( S; S- t( {
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset8 Y# c3 q- a0 h
  180. #------------------------------------------------------------------------------#0 k. J- r: |( N* N6 t- f
  181.   
    1 I8 H& @6 C" r; S. b/ n
  182.   
    ! D" V, N  E8 j$ E6 _) W/ K( Q! s
  183. ($imported ||= {})["Galv_Character_Effects"] = true
    - `5 |0 M3 D; t
  184. module Galv_CEffects
    - {9 D8 `+ |5 H7 P+ s( E( l- X
  185.   
    ) ~6 q7 `( N6 U0 x( M, A) D3 h1 J
  186. #------------------------------------------------------------------------------#  8 ?: z0 b9 J3 `! m
  187. #  SETUP OPTIONS/ F7 i. z! N. g, K$ k
  188. #------------------------------------------------------------------------------#
      X. U/ d  v& i" O2 A
  189.   
    % y1 l* D" F% k  e/ U/ F+ B' Z6 X
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the
    8 K6 @# O- R2 b. d. z" _: p2 @5 w% {
  191.                         # region on the wall you want to make reflective (and8 R/ F2 Z+ b4 M% J0 @
  192.                         # then use tiles/mapping that make the parallax visible)
      p3 v8 g- `) H( i
  193.   8 J! o9 _9 ]' J
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters
    & H( k8 R7 ~; j  k9 h
  195.     0 V8 a1 w& k8 A9 G$ _5 M
  196.   REFLECT_Z = -10       # Z level of reflections4 k( \. D8 _! L; H' m7 Y+ }
  197.   SHADOW_Z = 0          # Z level of shadows2 R# |$ E& {8 O4 D+ m! g+ |
  198.   
    ; b1 h' ]" m2 ]# S; p; j/ D
  199. #------------------------------------------------------------------------------#  
    6 T/ W5 {5 _0 }2 `' V9 H5 c. w
  200. #  END SETUP OPTIONS
    + s" c- M4 A; |2 w! |; Y) h% v
  201. #------------------------------------------------------------------------------#- r0 T$ t( |5 \( G# n7 i6 i$ G
  202. end
    , [! r, B$ {3 o9 _1 Q4 t/ L
  203.   8 b' H0 V" E! a* B2 g+ |- G/ P6 v
  204.   
    / C( c4 V1 M6 r+ K' s& L0 ^

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

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




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