Project1

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

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

, g' Z' B6 v9 Y) o/ ?2 p这个代码怎么用啊,有大神知道吗。我从国外找的。
+ R& S7 N% R- Hhttp://galvs-scripts.com/2013/02/21/character-effects/
+ \. G9 \* C* M3 J8 \是关于动态倒影的
作者: 禺谷皓月    时间: 2014-6-25 11:32
  1. #------------------------------------------------------------------------------#
    6 j! ?9 P7 o1 E5 G8 x# P
  2. #  Galv's Character Effects: M0 F; E% R, s: W
  3. #------------------------------------------------------------------------------#
    " K+ y9 n  H4 H9 n4 K, D' l
  4. #  For: RPGMAKER VX ACE
    / @9 I' \, f/ N4 S! v
  5. #  Version 2.17 [& O4 u1 k6 d6 a
  6. #------------------------------------------------------------------------------#* s* r6 b4 i0 A# O
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows
    . ?2 V& C1 _5 N3 d
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects. L; V( r1 q/ D# L6 I
  9. #                           - Fixed shadow facing bug
    : T2 i' T8 t2 [, R, r4 j2 Z# C: g# c- H
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows+ M6 X" n7 e3 D; W; {, }
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows$ U( o0 [& _# X4 L
  12. #  2013-02-22 - Version 1.7 - bug fixes7 C/ y+ X1 A& }- G, c5 w5 N5 G
  13. #  2013-02-22 - Version 1.6 - added icon effect
    + s, q- ]$ {, |
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps
    ' c$ O( z2 k4 k0 ]4 ^0 q% F
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles
    . {+ Y; s8 b8 A! i7 H5 G+ X1 W% w6 L: S
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks& `; T) {4 {, C& W
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)
    8 j1 N" r  u3 i' U+ o# h
  18. #  2013-02-21 - Version 1.1 - updated flicker effect) _# t" a2 V1 N' x4 v
  19. #  2013-02-21 - Version 1.0 - release
    9 @8 M6 I) j2 [% b" Z# X: ^
  20. #------------------------------------------------------------------------------#/ u) ^9 l4 b3 O8 P2 c
  21. #  This script was made to provide some additional effects for characters such
    $ ~. M& q6 p: D7 }( _: A. S
  22. #  as events, followers and the player on the map.* K" ~5 R" E; d8 S6 S/ W
  23. #  Currently it includes:
    + |7 Q. c" r3 ?1 F
  24. #' x# D4 L. e; [5 x& x0 _7 i
  25. #  Shadows
    # R3 o" Z0 J( h  e+ g+ ~) a) x
  26. #  Shadows that appear under player and events in a directions depending on
    $ _6 {5 B" E7 ], X) N
  27. #  a light source that you choose.8 S) k, z6 m# W% o9 Z% ], i' Z: V
  28. #6 v! ]( ]) ]' B* D4 a: |& q
  29. #  Parallax Reflect, [6 q& }% R2 @. d. Q9 t# d
  30. #  Reflections that appear on the parallax layer for events and actors to be
    / j1 f3 t9 L0 N7 i, `3 G
  31. #  used for things like reflections in the water or glass floor etc. To get: E* W. X3 {$ l
  32. #  effects like the demo, you need to edit the charset graphic to make the water
    & n+ p6 @. |: h0 T
  33. #  partially transparent.
    ) \- C( V3 _5 R5 ^, _, l) F- @
  34. #0 T0 Y' R7 f  v. L8 h: d
  35. #  Parallax Mirrors: N( V! Z$ z- A: y1 q  e0 W" _
  36. #  Much like reflect but are instead actors and event are reflected in a mirror1 Q! @1 A8 H$ M* Z
  37. #  on a wall designated by a region. Both mirror and reflect effects can be
    # n& M5 h4 ~; ?6 F* z, F
  38. #  changed so actors and events can use different charsets for their reflections
    7 o$ P( c# a7 v% p) v$ t( u# n
  39. #
    ( Q1 \/ l/ E  N& `2 f
  40. #------------------------------------------------------------------------------#
    * s( `5 K4 C  I6 a# d: x3 e
  41.   
    4 s; X" f$ B: S6 H
  42. 8 a( O1 b" T0 F2 m! g  C
  43. #------------------------------------------------------------------------------#
    7 d- G" V5 o. b% G* r
  44. #  NEW - First event command as a COMMENT/ l' }- f) D) n8 b- V2 B7 R
  45. #------------------------------------------------------------------------------#' o, E* }; {6 I& o1 J9 C* G1 a1 N7 |
  46. #  You can add a comment as the first event command on an event page to set if2 ?  {0 O/ q/ V4 E: r8 G
  47. #  that event has an icon, shadow or reflection active. The tags to use are
    7 V6 Z' T* i* O0 C" s/ {3 G
  48. #  below, all must be on the same line in the comment.
    6 _1 t5 n# N; G& ^; y$ A: J+ }
  49. #
    $ E& n+ @; N/ ^( ~0 q. v$ Q; B
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)# h8 M- R' B0 f/ ?3 o) k
  51. # <shadow>           # set the event to display a shadow( [: Z' m8 a3 m$ v: o& a' e
  52. # <reflect>          # set the event to display reflections* V3 c0 k, u! |$ j; Q; O* k' t
  53. #
    ' b7 z2 A1 c5 L! c
  54. #------------------------------------------------------------------------------#
    , E& Y; m3 S1 Q$ K" u2 p
  55. #  EXAMPLE:
    8 U. \5 G$ m2 {' L3 Y' |
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event
    . m& D' T! B' d4 \( ~4 d
  57. #------------------------------------------------------------------------------#3 X0 e1 p5 f9 n% e" O

  58. 2 O1 {. y+ l* x$ c
  59. - F0 x! t( ~5 M2 ?
  60. #------------------------------------------------------------------------------#
    6 Q7 V0 f0 M& g, ?4 p; a& V
  61. #  SCRIPT CALLS:
    ' M$ D* `6 m/ M1 M& x3 f/ I
  62. #------------------------------------------------------------------------------#  L$ G$ e# s* w" I! N$ Q4 I
  63. #7 S) B9 \8 p- g
  64. #  char_effects(x,x,x,status): K0 q( U9 `" Z$ G* ~/ D$ x, W* v
  65. #* _5 r3 l# M5 g& i
  66. #------------------------------------------------------------------------------#3 x6 v. Y' S0 a- \. b
  67. #  # each effect can be true or false to enable/disable them during the game.) }% t8 `9 u' E: p$ Q6 J; J, |) k
  68. #  # you can change multiples of effects at once, x being the effect number$ \+ Y7 r) C! {! Y; ^
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons
    ' m+ J/ j: d$ Z
  70. #------------------------------------------------------------------------------#- X* ^( A$ {+ H" G- F. D% N
  71. #  EXAMPLES:
    : H- d! ?' v* |! u7 c! M
  72. #  char_effects(0,true)              # turn reflections on/ C, t  b4 u' c  r$ s
  73. #  char_effects(0,2,true)            # turn reflections and mirror on4 J* e1 D6 P; t* C% q5 \
  74. #  char_effects(1,3,false)           # turn shadows and icons off
    . C4 [1 @. g8 B' R; W  y
  75. #------------------------------------------------------------------------------#; F1 K6 L8 N- M
  76. #. h; j* O6 L9 u9 G& N1 z
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset: I0 P! k: q/ K: V1 |. Z# x
  78. #: r( M  k5 h5 v2 x) b4 o: P
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset
    3 T4 s7 U+ b. a" y5 B7 y  M
  80. #" d( X; {" L% e
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset$ [# F& f  i7 A  E* ?
  82. #& r0 y+ y8 i9 x& n3 }) d
  83. #------------------------------------------------------------------------------#
    , w. e4 _! t5 b# C) a
  84. #  EXAMPLES:: o4 ?, o7 V/ N7 |8 @( T
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite; v" c3 |! m4 q
  86. #                                    # in position 2 of "Actor2" charset.0 I( i  v; o7 l9 U0 A
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of3 f" g( ?2 w: b. L# o' G# L
  88. #                                    # "Actor4" charset.
    . m. p3 l  x7 Q, L4 M
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of3 L! I1 b, z3 q7 l2 I
  90. #                                    # "Vehicle" charset.7 b+ D: h" c! H
  91. #------------------------------------------------------------------------------#
    % |6 o2 |/ Y% I5 B( @) o2 O! R/ }
  92.   
    / s3 Q# x# e2 n
  93. #------------------------------------------------------------------------------#+ L7 q. ?* C+ l- q
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS
    1 G6 b2 r* v% V% U1 }
  95. #------------------------------------------------------------------------------#$ [! e' k; |9 D: N5 `+ f; Y
  96. #/ d: s$ N# v9 j2 r& c
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off$ S9 L9 @& q- f) i& q1 p* k
  98. #                          # use this to specify for mirror and reflect.1 L* x! @% P, j* \/ `8 a
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change. z0 d3 U: ^& J* Z0 K/ q# ~
  100. #                          # to change all events use :all
    6 y( @5 K; Q- l! G
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make+ r. O7 b$ J+ ~5 s/ p, Q' J
  102. #                          # it 0 for no icon.
    % S( P* L8 W9 q$ }: p) w9 w$ y- b1 s
  103. #
    8 {6 z! D5 u0 U4 q2 u
  104. #------------------------------------------------------------------------------#
    5 R6 i, _- n& h) N) f& v
  105. #  EXAMPLES:& c8 w1 {3 r- `4 `/ T8 A/ ]# b
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON
    / w$ C1 V; D5 Q2 ^1 O6 G; x( J
  107. #  shadow(1,false)         # Turn event 1 shadow OFF
    ' h. ~4 s9 G, p5 p" a. Q1 ]5 t0 u
  108. #  reflect(:all,true)      # Turn all event reflections ON
    $ E, e# |2 i6 H4 ?; O% }
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear$ V4 F$ [9 G0 J+ q) x7 B
  110. #+ t, B5 ?6 D4 ]* K, n% ^8 B7 R
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering
    & ~0 t) _- T# h) X' w0 S
  112. #        a map. This is a design decision to try to keep lag to a minimum. You: J/ c  ?; |5 C1 l1 B* Q$ E/ H
  113. #        should use these effects sparingly and only activate them on events
    ' o$ B. @) J* N) R
  114. #        that require them.' S; U8 [4 O# e
  115. #------------------------------------------------------------------------------#
    8 Z' d. @. R0 ]+ |: D2 ~
  116.   ' V/ y( U$ k1 u& V8 [( D0 l
  117. #------------------------------------------------------------------------------#
    6 _' e+ n% C" Z  R
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES- g- p8 v" L: T5 Z1 y
  119. #------------------------------------------------------------------------------#
    9 R* W" D& a. A5 G% B
  120. #
    - S/ D) X% Z' z* V6 _4 p$ Q3 B1 R
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default ' i! X) C  ]; Q, J6 {
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off
    % m6 T) w% N+ h+ S/ C3 r
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.
    - G* F* d& l& ^: I$ Z; W$ M
  124. #
    7 ?$ m9 s/ ?+ }. r7 i( ?% e* G. q4 D; }
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects
    ; [; ]' O$ h. _6 _# S! U
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.3 F2 h1 `9 a$ J9 C; _
  127. #  v_icon(x,x,x,icon_id)1 J: |& O# `6 x! Y
  128. #
    0 I) H; e( J9 A, \/ b
  129. #------------------------------------------------------------------------------#
    6 T" K; ?9 J9 v- H& k
  130.   
    8 a+ E4 o$ i9 j0 F2 k
  131. #------------------------------------------------------------------------------#
    . u: N; a+ D7 t% v' \! G
  132. #  SCRIPT CALLS for shadow options8 z$ o3 T7 h9 T. |
  133. #------------------------------------------------------------------------------#% R7 L4 ~. h9 J% _& b
  134. #- |; V! u& C. w
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the 0 r) a/ F" ~9 v/ Z
  136. #                              # light source number you wish to change (for
      S" @) r9 z+ v. T, t& m
  137. #                              # more than one). These are reset on map change.
    / O$ [% L9 W- q( I
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.
    0 ?$ {% k2 X( F& P
  139. #                              # This will need to be in parallel process if you
    * G; _. |/ R6 e; l* L  ?. c& s
  140. #                              # want it to be a moving light.( r3 m2 J) u+ A9 F8 i& F
  141. #
    # `$ U5 g& a5 M
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below
    # t' s* g/ O5 m% p& M$ J7 ^
  143. #
    3 J) A- p4 N2 x3 W
  144. #    # intensity = opacity when standing next to the light source (255 is black)
    : U# p" s. N/ r6 J% T9 y8 e
  145. #    # fade = amount shadow becomes more transparent the further away you are.
    3 _, b& b& Q: h1 h
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.
    1 G7 e" ]# h# H" L
  147. #
    . A/ F2 W& o  ]. ?4 ~0 |
  148. #------------------------------------------------------------------------------#0 O9 ^9 x. d7 r& G
  149. #  EXAMPLE:$ V/ B! j9 }. O
  150. #  shadow_options(80,10,false)    # This is the default setting.+ J' H5 @' i! x% _1 z+ X
  151. #------------------------------------------------------------------------------#* y1 q2 W2 M* U# S' n! N6 Y
  152.   
    ) w: |2 K" q& s8 `
  153. #------------------------------------------------------------------------------#" `$ P/ i+ o8 m/ V" p* }3 ?& {
  154. #  SCRIPT CALLS for reflect options
    , m8 v; N; N8 v4 `* i: Q! C9 K$ ~2 U
  155. #------------------------------------------------------------------------------#
    ; I, h' P0 Q/ D: b% ?
  156. #
    4 a+ B8 o3 V' i( X; r* D
  157. #  reflect_options(wave_pwr) # F$ z7 Q& V" j, m# B; I2 j
  158. #6 n2 e- H. f& r, e. k
  159. #    # wave_pwr = how strong the wave movement is. 0 is off2 A! A: ]2 {7 j1 d. V+ `2 ]
  160. #8 i( `8 d0 ?/ \9 r- d" [
  161. #------------------------------------------------------------------------------#' q; y9 B# _, |( t
  162. #  EXAMPLE:: |$ y: v' y& V$ n8 m$ Q
  163. #  reflect_options(1) # Turn wave power to 1" V* _* H: X9 _$ R1 a4 D) k7 s% j
  164. #------------------------------------------------------------------------------#8 D1 h" w/ \5 t
  165.   * t) P$ |- W6 D2 ^( n+ K* O5 i
  166.   
    ; }( c2 ^0 {9 y+ F+ b
  167. #------------------------------------------------------------------------------#
      F* V/ h' Z- e) X6 h" p
  168. #  NOTETAG for ACTORS
    ! k6 n; O; A! D
  169. #------------------------------------------------------------------------------#
    ) @" V- Z3 w& `; n) b4 \. P
  170. #8 V0 p& g, T7 |. g, F6 P
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)# `1 ?, M+ H" i5 Y" m
  172. #: |* e$ W$ Q! ?6 j
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections, [& e0 X* ]# r% W8 j& g; g
  174. #                                  # and use the character in position 'pos'5 C0 B& B; p& o8 @
  175. #9 v3 P9 `8 t5 K0 D
  176. #------------------------------------------------------------------------------#
    ) a4 b4 e6 w! s6 P( _0 `' ~
  177. #  EXAMPLES:6 p5 W. _) A+ L, Y2 D3 P7 z$ N
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset
    8 \( n, |/ Q# \
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset
      {4 h; ?% I  p. e3 W
  180. #------------------------------------------------------------------------------#
    , _; Q1 R# E$ _+ a% p
  181.   8 B' Y; k# ~6 m# R/ h
  182.   ; E3 e0 z2 w- I3 E$ T/ {* D; ?" G
  183. ($imported ||= {})["Galv_Character_Effects"] = true0 P; }' n2 E2 R" `3 `% C1 N7 p
  184. module Galv_CEffects9 x5 S& ^* m/ r, e3 F7 \+ i2 p
  185.   
    0 t2 W% M( b" u0 m" Y9 |6 b
  186. #------------------------------------------------------------------------------#  
    5 b# x) e5 Y% ^
  187. #  SETUP OPTIONS
    9 V# D; p( I+ P
  188. #------------------------------------------------------------------------------#
    7 Q  g0 i: r3 E: }' q6 h, G
  189.   4 A& y9 [0 @9 Z0 a, a' {
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the
    3 f$ o9 @- _$ d. U2 \; m0 ]
  191.                         # region on the wall you want to make reflective (and# j- b9 S6 c- ]
  192.                         # then use tiles/mapping that make the parallax visible)
    & x/ \7 o% O2 z) ?1 L
  193.   
    & U/ D% Q; Z9 e+ k8 X
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters& Y, E4 M9 S$ v6 J: k/ T
  195.     4 _+ }6 B  u8 e* f
  196.   REFLECT_Z = -10       # Z level of reflections
    6 A& H  ^+ I5 r% g1 ?
  197.   SHADOW_Z = 0          # Z level of shadows
    / Y' e# q1 M( q. [
  198.   
    : s6 Z) K  O+ j! a' p
  199. #------------------------------------------------------------------------------#  
    6 Y8 ~6 j+ r1 t) ^0 z  B% p
  200. #  END SETUP OPTIONS, D; B: O" @" m
  201. #------------------------------------------------------------------------------#4 k2 u1 h( ^* A
  202. end
    2 \9 Y, _8 r' d
  203.   $ L6 v$ \# ?. d# v" y) U
  204.   " m0 r: m, j; X5 Y# ]
  205.   G  f& b; u* A) n# [

  206. " m* R! [9 Q4 [
  207. class Game_Map0 x9 c$ k6 D" ]) `
  208.   def do_icons(refresh = true)6 T/ E: \; W4 X9 m/ \% ^# V
  209.     @events.values.each { |e|
    ( l0 O0 I2 J" o- }
  210.       next if !e.list) ^% ~8 f2 ?: O7 `! n9 F* F5 j! c6 Z
  211.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/
    : O  E8 T# K3 l* E6 l1 Z' Q% k$ L
  212.         e.icon = $1.to_i
    " C0 p+ q- P8 d8 M" D
  213.         e.icon_offset = [$2.to_i,$3.to_i]
    3 H* r1 X! a. `' c% ]
  214.       else5 A% E- ^, ]) q, o
  215.         e.icon = 0$ ?9 a4 K: Z( T% D3 T7 D
  216.         e.icon_offset = [0,0]# d; l% e' C* T: ]" j
  217.       end
    & S4 l3 }. Z6 P: |
  218.     }
    : }; e9 |% k: r. W
  219.     SceneManager.scene.spriteset.refresh_effects if refresh. \! h% v! e& Q1 G1 A$ q# j7 O
  220.   end
    ) y; |/ B( N0 h" P* d" A: w
  221.    
      D6 y7 J, }0 n  B: V& M0 P
  222.    
    " h" M( f' q3 n/ }! e  m
  223.   def do_shadows(refresh = true), p+ ]  b4 J# O/ ?
  224.     @events.values.each { |e|
    8 S( n: ?" F8 i2 c+ m
  225.       next if !e.list
    # w# p. ], R4 P! D; [6 q6 v
  226.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/* P, ]5 N9 {' x, t; w
  227.         e.shadow = true
    ( E+ G( j9 N( R- S6 K
  228.       else7 T# s5 [% ]- j" }+ R/ ?% D
  229.         e.shadow = false
    * e) J5 a& U6 p' v* k
  230.       end
    ; D$ Q! i' P- x. s: l
  231.     }. _, b" G( O) T1 }
  232.     SceneManager.scene.spriteset.refresh_effects if refresh
    0 q, `' s0 p$ |0 @0 Z
  233.   end, n& c( j5 ^' j1 h
  234.    ) W  R" R% s7 k
  235.   def do_reflects(refresh = true)
    + H8 \; @9 D( f7 }: W0 e
  236.     @events.values.each { |e|! C% o# z! m, b! V; Q
  237.       next if !e.list
    ) ]* P% }8 \, ^$ e0 d" r4 Z
  238.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>/
    1 E+ ?9 z1 k& N# U6 [
  239.         e.reflect = true
    4 W8 T$ M9 B5 y# X; A, l5 p
  240.       else
    ' g! v2 V( A+ E1 b
  241.         e.reflect = false
    + E2 G$ G' n3 A7 V/ ^
  242.       end/ ?& O& j& S8 q$ g2 M& \
  243.     }
    % e8 C; H/ N  ^( J" O
  244.     SceneManager.scene.spriteset.refresh_effects if refresh/ s( G+ ~! x7 T9 g9 C' y
  245.   end
    + o2 \8 ?8 a4 i$ U0 g
  246.    1 W9 a4 v2 i$ ^+ I1 q
  247.   def do_all_chareffects
    ( e$ o0 C3 C9 m/ U
  248.     do_icons(false)
    $ h+ ]  w4 W% M9 Y4 Y0 U5 L
  249.     do_shadows(false)
    - l/ u1 T  m( {' `% O  P6 _. |# U
  250.     do_reflects(false)1 \% q5 Q( t" M9 h
  251.   end
    . ~% Y, E  }/ r& L
  252.    * e; J0 X% M9 C/ E. y2 Y
  253. end # Game_Map
    9 q) {/ y' B" F# }- c# u
  254.   d! h3 o) U; j( H2 C
  255. 4 t- |$ i1 D8 K# y; |- \% r* i

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

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




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