Project1

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

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

. n  a' e. W* n1 U; T9 L这个代码怎么用啊,有大神知道吗。我从国外找的。# r  Y$ ~* C2 d) x) d$ i
http://galvs-scripts.com/2013/02/21/character-effects/
# O; C3 L* i- C. k* a; _是关于动态倒影的
作者: 禺谷皓月    时间: 2014-6-25 11:32
  1. #------------------------------------------------------------------------------#
    - o( i/ O/ Y; v: B* \+ b1 u' i# p
  2. #  Galv's Character Effects
    ) X4 y: s. X/ {3 F+ I. L
  3. #------------------------------------------------------------------------------#6 n$ @7 Z, R5 a+ p3 n
  4. #  For: RPGMAKER VX ACE5 }7 f+ h6 f2 T9 p
  5. #  Version 2.1
    $ t% q0 V: p4 S* G
  6. #------------------------------------------------------------------------------#
    1 P, p% u% P* m8 A0 q6 _' i7 y% Q
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows
    7 }0 v; Y5 u0 j& b, J+ T4 J/ k
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects
    - j, `- e+ @* i9 a
  9. #                           - Fixed shadow facing bug
    0 N! I8 c0 B& {/ h
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows
    7 \/ w  A- r9 e2 M+ P
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows
    . b5 Q( u2 M% x9 z) \4 ^
  12. #  2013-02-22 - Version 1.7 - bug fixes
    / {9 B: i2 q( p
  13. #  2013-02-22 - Version 1.6 - added icon effect/ F; A3 z+ l7 V5 L
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps
    1 O, N4 _8 f% w9 g
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles3 |% Z2 M! H3 y8 X
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks
    / q# M8 f. Y, I* q! V; }
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)
    & c  H. e& h( _( L4 }& k" w
  18. #  2013-02-21 - Version 1.1 - updated flicker effect2 H% ?' Y" A0 n" }' t
  19. #  2013-02-21 - Version 1.0 - release
    : x5 {8 R  D" u$ q9 t0 B
  20. #------------------------------------------------------------------------------#/ [, `3 e9 h! _/ r9 f6 E
  21. #  This script was made to provide some additional effects for characters such3 {" Z# Z; T  M0 \0 ~( [6 s; r3 o6 W
  22. #  as events, followers and the player on the map.$ ]  a9 x% l. [' {; c- l
  23. #  Currently it includes:
    & J; g& \9 |/ l" H
  24. #7 Q% u: s* W2 c9 q
  25. #  Shadows& C* _6 W0 X% G6 n
  26. #  Shadows that appear under player and events in a directions depending on: X( I& B; A) W3 [/ c- ^
  27. #  a light source that you choose.% m' j) p. _+ i& n8 g- L9 |# M
  28. #+ E% \: E, F. ^  p: B$ @
  29. #  Parallax Reflect
    1 N5 a- p' U$ p
  30. #  Reflections that appear on the parallax layer for events and actors to be
    4 [& q" X. X3 I  X. l6 q! B1 @
  31. #  used for things like reflections in the water or glass floor etc. To get
    / L, v! L$ D: f! O7 o1 O& A# Z
  32. #  effects like the demo, you need to edit the charset graphic to make the water8 j7 c4 v2 W# ?" |7 O3 t9 i
  33. #  partially transparent./ l: D, L/ \7 [3 Q2 I6 H. r2 z  R
  34. #
    " @( S; v1 g% p9 o, V6 x7 D
  35. #  Parallax Mirrors6 g: F# U/ z% s. W# ]% o; n+ w
  36. #  Much like reflect but are instead actors and event are reflected in a mirror
    6 O2 H* f- \9 V! E9 k) B
  37. #  on a wall designated by a region. Both mirror and reflect effects can be0 W" y! j) E2 I+ _/ C$ j6 E
  38. #  changed so actors and events can use different charsets for their reflections8 C; |9 t8 O, e; b# a0 N1 w, v
  39. #
      C( w. E6 [) V
  40. #------------------------------------------------------------------------------#" ~) ?3 C* X' v' O5 i
  41.   
    : h& W, r% ]) l1 V. S

  42. $ r( v* |" q( y) c+ b; `
  43. #------------------------------------------------------------------------------#
    + L. H2 Z0 A( c/ }! \# M
  44. #  NEW - First event command as a COMMENT; A  {; }3 t! Z, f' ?# w! ?9 F
  45. #------------------------------------------------------------------------------#
      N6 |5 {' X4 D4 S
  46. #  You can add a comment as the first event command on an event page to set if
    4 e6 o$ }* G! o1 D+ y& i
  47. #  that event has an icon, shadow or reflection active. The tags to use are
    0 v/ U2 r9 F6 ]1 U
  48. #  below, all must be on the same line in the comment.
    , Q! v( [" \6 T* L
  49. #
    : F, P0 M- N, C% z( H$ N( V  D
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)
    ' d6 x! Z* Z, u+ j" [1 B, D
  51. # <shadow>           # set the event to display a shadow+ [) x) k& ~0 g: F+ ^3 i
  52. # <reflect>          # set the event to display reflections
    2 H2 J0 U1 R. g4 `! n) \
  53. #
    + K9 h+ b' c) T' s. v. M6 x6 @4 o
  54. #------------------------------------------------------------------------------#3 R" [! N! L6 c9 \+ q  {: q: q
  55. #  EXAMPLE:
    ( c% O( b! B- Z0 A, M! H  q
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event
    % m' w" Z0 c2 l( F) q7 l5 q3 L; _
  57. #------------------------------------------------------------------------------#7 O. t' ]9 \7 r

  58. ; h6 r: j7 e# p3 C9 B$ g7 n$ j

  59. 4 X1 T- m( m2 j& g  T
  60. #------------------------------------------------------------------------------#
    1 Y9 R. p6 C4 S1 N& `  p
  61. #  SCRIPT CALLS:/ T# v2 n! M2 H' I# y( o( S0 B+ Y
  62. #------------------------------------------------------------------------------#
    , ?% b& T2 z" q) J
  63. #5 p% r5 g& |! B% t+ P* @
  64. #  char_effects(x,x,x,status)
    ) S3 F- A8 `4 q3 l# h& R3 N, E* S
  65. #* S2 A5 m8 }; a/ v
  66. #------------------------------------------------------------------------------#1 ]5 c) d/ {; z% e
  67. #  # each effect can be true or false to enable/disable them during the game.9 j) _4 e+ O; c4 I
  68. #  # you can change multiples of effects at once, x being the effect number
    8 I" L( S3 E8 G# O( t! {
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons5 w% J' h' e; U$ |4 P% h4 R) J2 M
  70. #------------------------------------------------------------------------------#
    ( [9 [3 W- |" Z( v3 l& C8 o
  71. #  EXAMPLES:. J( z" Y8 v( O/ @8 f, T8 ]/ j
  72. #  char_effects(0,true)              # turn reflections on3 o" a! J5 {$ O# P$ y# o5 K
  73. #  char_effects(0,2,true)            # turn reflections and mirror on
    8 h* v0 J4 K; A1 j* w4 Y
  74. #  char_effects(1,3,false)           # turn shadows and icons off
    * Q8 F9 g  C) a4 |: }  d# U/ a6 s
  75. #------------------------------------------------------------------------------#
    ; x" n# Q! R* d: n# ^# x* g" y6 Q: V
  76. #
    4 s: ?: e8 q5 E3 M
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset0 K% L! r% w! l2 s, o0 r
  78. #  M- K, n9 q' Y" }  m/ }& P
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset& p4 n2 ?# ~1 j; |3 m
  80. #. P6 L* L4 i4 @4 l/ v
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset, _" B1 H, C* ]6 X) R& L. S3 d
  82. #
    % ^8 L8 P4 x% M: F) a8 M
  83. #------------------------------------------------------------------------------#
    - O- T! r7 `, N( v* U% w3 P7 M
  84. #  EXAMPLES:" }8 d+ C  f; q5 A- k5 m
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite
    , s$ z9 @6 x$ b' H" R, q8 S2 P
  86. #                                    # in position 2 of "Actor2" charset.
    4 Y- _& X; O; e& l4 p1 S# E/ b
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of
    # k7 G. O& C; l
  88. #                                    # "Actor4" charset.
      T$ b# @- J9 d  K- X; o
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of
    8 c3 g5 L  {3 @; A  b
  90. #                                    # "Vehicle" charset.' S0 W9 C8 j/ N/ Z6 O
  91. #------------------------------------------------------------------------------#0 X; ?- J& C2 H  e# O- F
  92.   
    + I; g9 D1 ~1 b' c0 [. t; C4 \
  93. #------------------------------------------------------------------------------#0 S5 T, Z* s$ F( v( h
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS7 Y2 U! B! |( k
  95. #------------------------------------------------------------------------------#
    8 m/ j# S+ f: g2 l0 E4 L
  96. #8 [$ N% _0 _! H' ?# F
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off
    , @9 z  |% s/ u
  98. #                          # use this to specify for mirror and reflect.+ g; Q2 e7 ~4 v) x, m2 e) H
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change
    ! [* P9 }! @; m4 S
  100. #                          # to change all events use :all! ~: O4 K% {8 m  B& |
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make
    ! q& N( a% @  y
  102. #                          # it 0 for no icon.4 j* ^) S# u- f. I7 a9 {
  103. #
    $ i! r4 S6 R* ?/ A0 c- f2 D
  104. #------------------------------------------------------------------------------#
    ( N$ G) Q- m( x2 X6 T5 n! Y
  105. #  EXAMPLES:
    6 }# F7 r. f( w
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON
    1 C0 _) w& p. z* O
  107. #  shadow(1,false)         # Turn event 1 shadow OFF1 g# M# o. ^! Z1 h; `/ L
  108. #  reflect(:all,true)      # Turn all event reflections ON, L" f% j, Z; V& n
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear( l- z5 l8 u' W- T' @* n
  110. #; i$ A4 J( `" O& ^) \( b
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering
    $ ?% c1 j* Y) R# l3 M2 g6 [
  112. #        a map. This is a design decision to try to keep lag to a minimum. You* l2 u: l. @+ K( S+ f) s
  113. #        should use these effects sparingly and only activate them on events. P9 W$ b  P4 K8 G6 i
  114. #        that require them.
    : b5 G# P" R) J. n/ W, N, B( e
  115. #------------------------------------------------------------------------------#
    : S5 p6 m3 f$ g" n/ k- e) Z, r3 |
  116.   ' D2 z# M2 d- X
  117. #------------------------------------------------------------------------------#
    7 F1 ]! D1 p7 e
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES
    2 ^  S1 p( [  r9 l
  119. #------------------------------------------------------------------------------## e$ M, e% o! w
  120. #+ j5 L4 @* r# z+ z0 j- Z/ @' `7 j
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default # k5 v) b/ ?7 F
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off
    9 d* T0 A! V9 E% p8 P
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.
    / c; a6 W! \1 X3 X% \2 X! M
  124. ## a6 C: y: v  N# G
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects* {) ?% |4 C/ m: p4 f: Q
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.% K7 w8 ]) a( [5 s; [% M5 a
  127. #  v_icon(x,x,x,icon_id)
    . V) m$ J5 C' _  j1 k4 T
  128. #
    # D" s5 `! y& U2 b( b5 a3 Y
  129. #------------------------------------------------------------------------------#0 e; w% a- r8 b! o6 u
  130.   
    * r& ?1 F% f3 v$ ^3 l
  131. #------------------------------------------------------------------------------#
    * e: m, v9 p6 h0 [5 X+ Q; a: F
  132. #  SCRIPT CALLS for shadow options
    , o4 q7 n2 }2 R$ o, q. j( E
  133. #------------------------------------------------------------------------------#
    2 l: _% a& w( s1 D
  134. #
    0 W% k0 h) h, r. M
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the 1 t6 m4 E. j& o) K/ ~
  136. #                              # light source number you wish to change (for' W) D1 x1 J, v1 W; L
  137. #                              # more than one). These are reset on map change.+ Y: {8 ?- f& K! c7 N+ j
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.
    8 {8 y2 \% H) D0 s
  139. #                              # This will need to be in parallel process if you
    8 [1 @9 I$ U' o$ l5 ?
  140. #                              # want it to be a moving light.
    $ O, G/ {) d4 g2 t* h* V/ u# L
  141. #! F; \& Q+ p: ]( }1 I4 {8 ?  e" a( Z( `
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below
      u5 u6 @9 g8 k$ r$ W* l6 V3 I
  143. #
    3 q: }, C  C# N; {) u6 w: j
  144. #    # intensity = opacity when standing next to the light source (255 is black)- B2 a& @: n# a
  145. #    # fade = amount shadow becomes more transparent the further away you are.% j: E# i* h1 b
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.
    8 G# J* i  r; s9 U; W/ w1 W3 M
  147. #
    ; g8 \4 [! k9 D( E
  148. #------------------------------------------------------------------------------#
    , }7 N/ b1 m0 Q/ r2 F0 G- M9 U
  149. #  EXAMPLE:
    0 {# R' [: u$ ]4 M+ I) W
  150. #  shadow_options(80,10,false)    # This is the default setting.
    , k/ Y9 h7 G; q& u7 B3 r
  151. #------------------------------------------------------------------------------#
    ! @& O$ V. k2 r  L7 B3 f( F
  152.   & [# g1 o6 S6 @7 p* Q
  153. #------------------------------------------------------------------------------#+ T7 ?9 Y1 e0 E7 v; Z+ g7 n; v+ f1 p
  154. #  SCRIPT CALLS for reflect options& D1 O7 k( n; N& [; P
  155. #------------------------------------------------------------------------------#
    7 }9 i, M5 J" B
  156. #
    . ~7 \) ^0 W. Y
  157. #  reflect_options(wave_pwr)
    : j$ g: j1 ?3 [" M. \: h5 j, q
  158. #
    - h0 C/ i3 Q6 l- T7 B" y
  159. #    # wave_pwr = how strong the wave movement is. 0 is off
    * C* m8 ]6 h7 Z9 g: O
  160. #
    # w: q' `5 ~& D) s
  161. #------------------------------------------------------------------------------#
    * o" K5 G$ K# r# {# d& x6 [
  162. #  EXAMPLE:
    $ N7 j: }4 D+ f- R
  163. #  reflect_options(1) # Turn wave power to 14 o  m# }; L. l* Y9 @
  164. #------------------------------------------------------------------------------#& }9 s3 b7 ]/ F0 D5 I4 u
  165.   
    8 d" P8 C6 T( ~4 I
  166.   
    : ?) R! P" P/ N* t
  167. #------------------------------------------------------------------------------#) M3 W) x& L7 X8 s- g6 U
  168. #  NOTETAG for ACTORS0 U9 W- B; y- X8 L  j
  169. #------------------------------------------------------------------------------#2 t. L% U& Y" B, M
  170. #
    ' d' Y: x# V9 J) l' ]
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)  L; o- X% k+ |: p" a6 _8 C
  172. #
    0 p  d( P: j" ?8 W* y6 r
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections" N% W/ }! W+ ]; \% Z
  174. #                                  # and use the character in position 'pos'! k" G+ ?% u1 }0 r5 K1 x  w/ T
  175. #) u# l+ D5 x( B# l$ o2 l  u1 q
  176. #------------------------------------------------------------------------------#
    : L) e6 d* Q1 o$ s  x1 {) U- a+ }
  177. #  EXAMPLES:
    " Z) \+ j# U- {
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset; d" a- ]4 b. d/ Q' h6 w/ K6 ~
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset; d9 U; j. ~+ O2 H- M3 ^
  180. #------------------------------------------------------------------------------#
    ! ~4 h! |) |) a3 ]+ m$ q6 s) E( ]
  181.   1 J  p9 k% o# f, d: Y
  182.   1 ?! z; V6 x. D7 {6 I  F
  183. ($imported ||= {})["Galv_Character_Effects"] = true
    2 M1 L1 I7 D4 _2 R0 a
  184. module Galv_CEffects
    * f/ E4 v  [4 C# o; ^7 k* @
  185.   
    # H% B% S" H4 z* J' D( L
  186. #------------------------------------------------------------------------------#  
    ( M' G" F1 w, j: c) u
  187. #  SETUP OPTIONS' m" t- z2 A, }. g
  188. #------------------------------------------------------------------------------#
    - f' ]! j8 ]# T1 H6 s2 d
  189.   / f- A' Z: h5 \8 y. g4 l/ {
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the
    # n/ u' ]% |) `
  191.                         # region on the wall you want to make reflective (and
    0 b' a3 l- |; `* P5 @# ]
  192.                         # then use tiles/mapping that make the parallax visible)8 a/ o9 R& H" H+ }- ?, @) N
  193.   ( H, p+ e/ J- y5 Q7 T% i: r+ S+ y
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters7 }4 y7 O. @, s) t
  195.     $ z. F& n2 @- l3 O! E
  196.   REFLECT_Z = -10       # Z level of reflections
    % r2 X/ m% U$ x
  197.   SHADOW_Z = 0          # Z level of shadows" r1 C( U/ }7 O  y* N
  198.   
    , T3 L2 A3 J. s! `/ j4 \, p
  199. #------------------------------------------------------------------------------#  - E/ a2 X# q2 |. ~$ W1 [
  200. #  END SETUP OPTIONS
    ' n9 R% E- b; S% m: T
  201. #------------------------------------------------------------------------------#
    & q0 H- N0 ~* w1 l1 k
  202. end
    * y0 F6 \, c9 e: g
  203.   . q$ W- L5 t& x. j7 a; m* [
  204.   ' m- t7 u9 R0 Z9 J/ g

  205. % x% f, x6 k  Q2 e9 \1 e
  206. $ N3 u' |: a" X: T% w0 S! Y. T
  207. class Game_Map
    7 C% F6 `. \' ~) a) A0 q
  208.   def do_icons(refresh = true)) y$ g; X" c; C4 p4 l
  209.     @events.values.each { |e|
    4 f. l  M. o; A4 W: l0 A
  210.       next if !e.list
    - g* B; x( r7 v' {7 s& s3 p
  211.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/* I/ q) s. @6 A  X
  212.         e.icon = $1.to_i
    / |5 Q6 ?% K# ^+ W- P  V% q
  213.         e.icon_offset = [$2.to_i,$3.to_i]3 W! L: q. l) c' }) }) C
  214.       else
    # [( U0 t* x. B7 h
  215.         e.icon = 0
    # C' t8 t/ i2 c: p/ h( a2 Y& Y, R
  216.         e.icon_offset = [0,0]! K( ~( O! T# x+ |9 m+ L6 a# X! Z  X
  217.       end
    7 P  F9 G' W- b: c% A& T
  218.     }& C  O& K3 s; ^5 S: P( O8 _0 U
  219.     SceneManager.scene.spriteset.refresh_effects if refresh
    8 e8 W' o# W: [0 r7 `
  220.   end
    " }0 J# D4 u; e$ ]3 G* q
  221.    
    # C! Y7 O* J" f% L0 W0 V
  222.    % o0 R- o$ [4 y' Y  E% u
  223.   def do_shadows(refresh = true)
    " _& {- q; K# Z6 R
  224.     @events.values.each { |e|# e3 o2 M3 y  C7 {$ N7 I
  225.       next if !e.list% M3 R6 A" k, k+ x0 y+ D5 v
  226.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/3 G/ T" k& j6 H* W- O/ B1 l4 T
  227.         e.shadow = true6 N# K; g1 E4 p# D! R( u
  228.       else0 v( }9 ]$ V4 k
  229.         e.shadow = false
    6 ?, @3 m9 t2 K0 S5 O
  230.       end1 u. p! k% U3 C% ]- w7 S
  231.     }
    - ?& m5 }4 E0 @2 k; m  i
  232.     SceneManager.scene.spriteset.refresh_effects if refresh" `6 _. f; c6 G# r1 ]# J; {+ e
  233.   end
    $ G' D, B* B5 y* y
  234.    
    ) Q# O1 L0 o$ t0 H% H$ p; y$ S
  235.   def do_reflects(refresh = true)' y) e% _* s' _5 H% i! X1 u& l" V
  236.     @events.values.each { |e|/ x( F/ [9 ~+ Z# ]$ J; T$ D
  237.       next if !e.list
    0 n2 A7 u) k6 N' U" n! O6 M5 |
  238.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>/
    7 q, S& Y- T1 f9 i: j  \1 D
  239.         e.reflect = true( v. k: B4 `: f# J& T8 P
  240.       else
    5 |, d( D4 W" N
  241.         e.reflect = false
    . ~! m/ h; G* o
  242.       end" m! k8 x" p/ Y8 E9 W% M
  243.     }
    # }4 r3 B+ S3 i( i$ X/ H
  244.     SceneManager.scene.spriteset.refresh_effects if refresh
    6 a( z) D  W. O0 s2 Y  U4 `1 H
  245.   end/ @; \8 p. u- i; q" r1 @
  246.    
    2 ~- X0 G) k8 @  M2 `) w
  247.   def do_all_chareffects- v  `3 E# r1 c2 w" I$ R
  248.     do_icons(false)
    8 v4 R- B9 Z3 o2 r1 b1 ~. G
  249.     do_shadows(false)# I& l( ?: c& u9 n+ J7 f- R
  250.     do_reflects(false)% k) G4 E* `2 Q
  251.   end/ V+ {8 l& Y! `; o5 `6 H0 J
  252.    
    & B# S  P  R% C7 k- a
  253. end # Game_Map
    2 L5 c/ p8 [/ [$ L( ?* z7 d: ?, b7 J

  254. * h/ C3 r% m7 _: A( `: ]3 x; r

  255. ( J! E: _" h2 R/ F9 z) t

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

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




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