查看: 1558|回复: 2

水面动态倒影,求解

[复制链接]
梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
回帖
4
发表于 2014-6-25 11:31:39 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
[code][/code]* n$ H9 ?6 G" U7 g5 P) v
这个代码怎么用啊,有大神知道吗。我从国外找的。" J# s/ z! _: k, K" m
http://galvs-scripts.com/2013/02/21/character-effects/. [' g, Q3 I/ t* t
是关于动态倒影的
梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
回帖
4
 楼主| 发表于 2014-6-25 11:32:43 | 显示全部楼层
  1. #------------------------------------------------------------------------------#
    8 |1 w3 I; w- l* `/ ~4 {. V
  2. #  Galv's Character Effects
    # a' V$ x4 o7 L! b
  3. #------------------------------------------------------------------------------#
    5 A- Z. H& ~, p! A% L% X
  4. #  For: RPGMAKER VX ACE: J  J% r. s+ S  Y7 k
  5. #  Version 2.1
    ) j" d$ x' N3 F* V2 j/ r$ u8 p6 \! t' U
  6. #------------------------------------------------------------------------------#
    ) q8 c; Q% e2 N" u0 `# ^' V
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows9 A6 [  O: x8 s/ n# `0 R
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects
    5 i  U: x, D+ z9 K- W$ }+ |
  9. #                           - Fixed shadow facing bug
    ; M7 t5 }! E. S, W
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows4 r% a  o. d& d8 e' f
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows
    7 p8 j$ F+ a4 u4 o; z
  12. #  2013-02-22 - Version 1.7 - bug fixes
    * s% i& R7 x9 V# c+ b; z5 p
  13. #  2013-02-22 - Version 1.6 - added icon effect
    & j6 H4 }' Q. C) m8 x  q5 n1 C
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps7 \( J& u0 E8 t8 w4 L/ z8 m+ |0 Z
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles
    # b0 Z: m9 o; }) D- i* o$ t6 s
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks
    " |: q: T; n4 Q3 \* x
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)" a# G+ f) Y/ g: j- t
  18. #  2013-02-21 - Version 1.1 - updated flicker effect) Z2 i/ E4 a7 T, l9 x& I
  19. #  2013-02-21 - Version 1.0 - release
    ; ^; p3 P5 C9 k& X
  20. #------------------------------------------------------------------------------#, A% a. ~1 F4 V3 a7 R
  21. #  This script was made to provide some additional effects for characters such1 B+ Z: n7 M5 p5 g5 H) t) b( g! @5 L: O
  22. #  as events, followers and the player on the map.0 T! |. u, A2 t1 _
  23. #  Currently it includes:7 |5 q) g2 I8 b2 A! t+ e0 \
  24. #/ @8 T+ N7 l- C; `1 X
  25. #  Shadows# f  N# t/ p7 }1 Y* F
  26. #  Shadows that appear under player and events in a directions depending on) C1 [3 }3 ?; V. ?- K8 g
  27. #  a light source that you choose.
    $ F; H" k/ T' }# i
  28. #( p7 e) m) [0 m# K! o" q) t+ Q- {" Y
  29. #  Parallax Reflect
    5 _9 d. B9 T5 N5 ^/ l2 _
  30. #  Reflections that appear on the parallax layer for events and actors to be
    ' l3 f& I, d- B( a( ]1 U% k
  31. #  used for things like reflections in the water or glass floor etc. To get
    9 A. R" e- J4 [: P2 W8 ^& G% S
  32. #  effects like the demo, you need to edit the charset graphic to make the water5 E" R! n/ C8 \8 n$ S/ `% [
  33. #  partially transparent.
    8 ]: O9 \7 S) r! o/ J
  34. #" U1 \4 j- s9 ~" W; f7 L/ r
  35. #  Parallax Mirrors8 `% @; D; i2 E, n1 _' |
  36. #  Much like reflect but are instead actors and event are reflected in a mirror
    % G. x5 S9 n6 f8 k
  37. #  on a wall designated by a region. Both mirror and reflect effects can be
    $ p- B' \4 p( R! I; p5 m6 {
  38. #  changed so actors and events can use different charsets for their reflections+ t1 g1 M: Y' r  \! I
  39. #) ?- ^* i: H2 y4 ^
  40. #------------------------------------------------------------------------------#
    0 h! P# x/ ?  |2 V
  41.   
    & X7 [7 c" j3 |& ~, v

  42. 0 U/ c# J( H  J$ {# T4 s
  43. #------------------------------------------------------------------------------#
    1 i4 n" @# b8 l
  44. #  NEW - First event command as a COMMENT
      g: `) v$ }+ l% W+ f' w* G
  45. #------------------------------------------------------------------------------#
    " h  L+ A) d7 |. U6 c1 g' {! s
  46. #  You can add a comment as the first event command on an event page to set if
    * `( h! g, J1 w( O6 h
  47. #  that event has an icon, shadow or reflection active. The tags to use are
    2 {2 e+ o  j1 D& ]0 Y* x% X# v) |
  48. #  below, all must be on the same line in the comment.0 r/ H% Q0 d/ H; R3 H' a
  49. #* v# Y; V7 u, A$ G9 v
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)
    , r, p6 S" M& @
  51. # <shadow>           # set the event to display a shadow) y$ k5 u+ ^! S+ M7 _. i& j
  52. # <reflect>          # set the event to display reflections, u- G2 a2 a% c% U# ?% A: k) i. o
  53. #
    6 |; d" u0 }2 L+ p6 T  A
  54. #------------------------------------------------------------------------------#
    ( v: T9 E1 `1 E
  55. #  EXAMPLE:
      I- ]5 B$ `" l
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event+ I( \! a! x( x" G) x( Y
  57. #------------------------------------------------------------------------------#
    4 Q3 O# K0 X$ p3 G% p3 ?+ o/ @# {
  58. 5 ?9 n) X6 s/ N; j/ H/ ^- E, @. l
  59. 5 r3 a- m8 i: J/ k+ V0 O6 C
  60. #------------------------------------------------------------------------------#
    7 D) U) W2 W" f9 W% }5 v0 X  u
  61. #  SCRIPT CALLS:
    1 Z% P# h" N" ~$ k
  62. #------------------------------------------------------------------------------#
    + b: l2 e3 ^. p: o. K2 o
  63. #% M& U1 c$ g$ \2 Z& E1 r4 @
  64. #  char_effects(x,x,x,status)
    . f  t* m+ V1 }
  65. #6 s  ]3 ?. F, S8 j: x! F5 }
  66. #------------------------------------------------------------------------------#
    ) S/ y# A2 v) P2 s& y4 i
  67. #  # each effect can be true or false to enable/disable them during the game.
    7 U1 }- Q+ X' ?
  68. #  # you can change multiples of effects at once, x being the effect number/ l1 T% ?" O3 e
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons
    ; v$ ~- T0 f6 J  D1 z  `3 P* v
  70. #------------------------------------------------------------------------------#0 K# K! b( {2 N! e2 E8 T5 r4 i, n; j
  71. #  EXAMPLES:
    : W( |: i" M6 ?0 v+ `( _2 |
  72. #  char_effects(0,true)              # turn reflections on" m4 x9 k' t4 V1 F
  73. #  char_effects(0,2,true)            # turn reflections and mirror on
    9 X  P. c7 s9 X" z- R+ Z
  74. #  char_effects(1,3,false)           # turn shadows and icons off
    0 Z* {4 O% T! {9 `
  75. #------------------------------------------------------------------------------#/ ^- o+ Z  d( z, J, J5 {  ~
  76. #( N: b" x8 Q& b! ?
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset
    7 m4 r7 ~* s1 {4 @3 }4 Q
  78. #
    7 r' A- q% I8 }" A9 `
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset
    3 Y$ j. D: E4 V2 d5 r% j
  80. #
    . B/ t: d3 s$ F2 u8 j
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset
    ) l- R) x+ R, D% F- m( c0 e5 H
  82. #" u$ K. I. z. u; w6 p. H
  83. #------------------------------------------------------------------------------#
    ) ^' {  r% H/ Z. Z
  84. #  EXAMPLES:; R! O9 b- H' c5 a' ^, z% X
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite
    ' C& l$ Y" ^7 @: P2 x/ K& j
  86. #                                    # in position 2 of "Actor2" charset.
    , @2 M) q  g$ e1 U5 S
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of' J2 z4 Y4 Y1 i7 N$ Q0 v- u
  88. #                                    # "Actor4" charset.) n' m, d, ?7 b' f. j- L; Y
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of7 Z1 I+ K$ k! E7 o0 r& Q
  90. #                                    # "Vehicle" charset." x% |  m1 |# i3 J; p0 p
  91. #------------------------------------------------------------------------------#
    1 P! C0 P9 E6 B) j# r' I2 A  v
  92.   
    6 c+ j+ Y0 K3 b4 u$ S2 g2 Z+ o
  93. #------------------------------------------------------------------------------#' V3 N* z; s1 l5 G- e: g) X
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS
    2 }2 x( a2 Y3 ^+ J/ Q, _  a
  95. #------------------------------------------------------------------------------#
    ; ^9 p2 P' g8 K; F0 w
  96. #' U. d' V. H! `2 C
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off" C3 f" B" G9 d1 h0 P, B% q7 S
  98. #                          # use this to specify for mirror and reflect.
    1 P9 ~7 i3 C. T) o; E; U
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change
    & ?- Z+ |3 ~) p; }  M
  100. #                          # to change all events use :all
    * A5 {+ {" ]$ U, u! ~" K- B
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make
    % C3 {2 q9 \6 W5 T( t3 s5 C5 K
  102. #                          # it 0 for no icon.
    # n4 j; ?" U' q0 b) t# p5 Y  d
  103. #+ ?' }. v# s; j- Q8 b7 h
  104. #------------------------------------------------------------------------------#9 n! ?% s& V% @3 |0 v
  105. #  EXAMPLES:1 O- d/ b! q# R  o% g. M& K
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON
    3 ]4 p- A/ n1 [
  107. #  shadow(1,false)         # Turn event 1 shadow OFF
    6 T3 }( g) D" x3 F' W3 C7 I- i
  108. #  reflect(:all,true)      # Turn all event reflections ON5 p# P: Z3 r0 D& W
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear
    8 I) m+ m" L+ S3 \& {: m
  110. #
      V/ B5 J! }. O5 ~" n
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering2 C1 V5 v% S& b0 |: x1 e
  112. #        a map. This is a design decision to try to keep lag to a minimum. You3 H4 ~' p$ K8 T0 s) \6 l8 C
  113. #        should use these effects sparingly and only activate them on events
    ( O' \- n) _9 c, h* l/ t7 z4 `% r. v
  114. #        that require them.
    5 h: H2 ?9 t+ M8 k! x$ w
  115. #------------------------------------------------------------------------------#" v0 p( a* K' l1 g/ S
  116.   * h. w: |, d/ H' |
  117. #------------------------------------------------------------------------------#
    : C& e9 ^6 F; g" w' o3 l, u4 j
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES
    . r4 q( @8 @; k+ w
  119. #------------------------------------------------------------------------------#
    6 D9 U* \" R6 L; I; e: E- Y
  120. #
    , I; [- c3 x1 U3 i0 S. ~, Y
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default + x9 Z% V+ ]+ i; [, D7 p9 F
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off
    " ^; |' P  b! m* c" p. ^
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.
    9 f. e' X3 f1 `; U, M% H' F
  124. #
    # l* K& ~+ U- [% K
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects9 J' c* O- m1 z% K
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.7 e: y$ g4 D& W4 A# U
  127. #  v_icon(x,x,x,icon_id)
    2 C$ I" C  _; r" m
  128. #
    $ d2 Z6 q; J$ g8 e9 D% D
  129. #------------------------------------------------------------------------------#
    : V$ K8 [% i- ~/ h
  130.   
    0 ~& F% `! p' {% o3 ~' O
  131. #------------------------------------------------------------------------------#& H& l- x. i+ _) T& N3 h3 D* _
  132. #  SCRIPT CALLS for shadow options4 H" m" Y% l1 W- T
  133. #------------------------------------------------------------------------------#' D" w  A* H% k0 K# v/ |$ [+ q" R
  134. #$ C3 u) c+ {1 e* ^
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the 0 {, R3 s- I% ~* `4 _2 K$ y
  136. #                              # light source number you wish to change (for8 |0 Y' g" `7 @  y$ Z, T
  137. #                              # more than one). These are reset on map change.
    4 E+ a( r; F; h, Q/ ~1 n7 [
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.+ b0 ]+ a- ]7 N& T) c! L( g
  139. #                              # This will need to be in parallel process if you
    ; _4 c( A# u( y& k; y/ t  L
  140. #                              # want it to be a moving light.1 A, \6 U# i" g+ b- w5 i
  141. #7 Y7 O2 w5 ]" @! X3 g! m
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below
    # ^1 C4 y5 ]0 N% h5 X" m# @
  143. #. V$ S' @- j! Q8 }6 @) X: ~
  144. #    # intensity = opacity when standing next to the light source (255 is black)+ Y" O2 R1 D. I9 v; X9 Y7 w
  145. #    # fade = amount shadow becomes more transparent the further away you are.( ~7 @/ k) H6 T4 Y0 l3 A+ ^7 W
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.
    + T3 i) t5 ]  O
  147. #' R& j7 l/ X4 ~/ _6 q* u; W  a
  148. #------------------------------------------------------------------------------#
    1 M# P$ d1 |8 _- A/ a; m- V
  149. #  EXAMPLE:
    2 Z; d4 j, K3 \4 G4 Y8 Q
  150. #  shadow_options(80,10,false)    # This is the default setting.
    3 y& W# h/ K+ T, Y$ y! m8 g
  151. #------------------------------------------------------------------------------#- r8 I$ a" J; _# \% W
  152.   & U2 ?7 m. C6 a5 C
  153. #------------------------------------------------------------------------------#6 ^+ Q/ }5 e& I; J
  154. #  SCRIPT CALLS for reflect options
    8 }; `4 F+ H0 a2 n- D& x; Q
  155. #------------------------------------------------------------------------------#- l3 o! [+ K7 [# \( {
  156. #
    - |; v3 X! i) d$ J' I/ \
  157. #  reflect_options(wave_pwr)
    4 T( D9 M2 c1 Q6 `1 c$ }
  158. #
    4 ^! X8 c. F9 w# o+ y/ x+ C
  159. #    # wave_pwr = how strong the wave movement is. 0 is off' }' l7 ?2 U+ M- r$ Y: d% p5 K8 G" l
  160. #& v" P6 O1 |# Y! k) K
  161. #------------------------------------------------------------------------------#6 t( b' \/ S3 d. Z
  162. #  EXAMPLE:
    : ~# i6 u7 h. w! p5 \0 R
  163. #  reflect_options(1) # Turn wave power to 1. R+ S6 g) [! n+ g
  164. #------------------------------------------------------------------------------#
    ( x' n) R# j& {& R: T( C
  165.   
    % k% C  R: K$ x: Q8 x( ]
  166.   
    7 A% n4 G7 O3 c  e- t3 y- m
  167. #------------------------------------------------------------------------------#- l4 g8 @+ L4 G  R
  168. #  NOTETAG for ACTORS5 n$ I+ f. r& K7 h( t# ~
  169. #------------------------------------------------------------------------------## N" m5 k+ R% r9 x, g3 `
  170. #
    # v' Q: Z" k8 W: w6 ~
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)
    / h. j/ J+ [6 B7 k" N7 s
  172. #
    ) S0 \" f3 ?3 P3 c
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections
    " W' O. i0 m: X% S
  174. #                                  # and use the character in position 'pos'
    0 e" n( [; {. G4 h, U9 m0 G8 m
  175. #
    9 G. R2 |/ x7 R$ L0 O
  176. #------------------------------------------------------------------------------#( F+ a. W6 z2 D& o4 ~9 c
  177. #  EXAMPLES:
      \$ c: N( l& R- d, a
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset' p$ j; ]" S: B9 }
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset
    1 U$ l! b, Y% {; V
  180. #------------------------------------------------------------------------------#
    0 g$ C5 M0 ]4 A: p1 i: c% s
  181.     b8 Z0 `- v  Z7 W* J- f
  182.   6 j* l# e, b$ {# X2 x" }
  183. ($imported ||= {})["Galv_Character_Effects"] = true+ G+ S( Y3 W/ s
  184. module Galv_CEffects
    / e0 b7 q8 C5 l
  185.   
    $ ~; \/ ^, G/ k& h
  186. #------------------------------------------------------------------------------#  0 X. h2 ~& K, {7 ^& H
  187. #  SETUP OPTIONS
    % i* p0 K- w* e) s& _
  188. #------------------------------------------------------------------------------#
    3 r6 j1 T6 Z% p' C5 I
  189.   : g4 h0 @! v. N0 c2 H
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the2 b+ g( k+ C; d4 l
  191.                         # region on the wall you want to make reflective (and
    # ]% u! c% K- `' w& Y
  192.                         # then use tiles/mapping that make the parallax visible)( h! k6 X  q3 w4 l2 Y6 y
  193.   ; Q* `' n5 A# w6 M: ]) b
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters* Z3 V# e& I" x% q) Q2 b
  195.     7 ?9 `2 Q9 _! \6 k- h
  196.   REFLECT_Z = -10       # Z level of reflections+ J2 T- L. O  g& v- l
  197.   SHADOW_Z = 0          # Z level of shadows
    , h4 k  w6 V" _3 ?6 E7 b
  198.   / n# ~4 i, V: E
  199. #------------------------------------------------------------------------------#  
    & @& E4 P) c8 B5 u7 ?* |: d
  200. #  END SETUP OPTIONS; R$ k8 p! J& o  i. W
  201. #------------------------------------------------------------------------------#
    ! K6 i! s. ?% g3 h; w5 y; O) r
  202. end7 E9 z4 c6 N$ Y6 c$ i9 H
  203.   
    0 u3 f1 D( b% z/ k. z2 q/ l
  204.   
    1 p6 U$ x2 o% h1 q0 G  z! D5 ^; f
  205. - h" k( S5 I; Q9 E! h+ h0 P
  206. 6 e" Z. k" ^* Y# a: ~
  207. class Game_Map
    # G. B8 E# [9 g
  208.   def do_icons(refresh = true)0 r. Y* m8 e( d
  209.     @events.values.each { |e|2 T2 I( S8 b0 P) k" s" j4 |- b. V  S
  210.       next if !e.list2 Y: G8 `4 o& l- R. ^
  211.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/" ~+ H$ }5 \- x! \  a/ l" p
  212.         e.icon = $1.to_i
    ( x' J7 t5 d& G  o# B% c% p) g
  213.         e.icon_offset = [$2.to_i,$3.to_i]
    3 n) q0 E! y2 R; m1 g/ C
  214.       else0 m1 e0 y% q6 D* y4 E: u8 }) J
  215.         e.icon = 0
    + X" x1 }3 o" r2 J& `6 Z2 q) _5 L; u
  216.         e.icon_offset = [0,0]4 k  K0 [( V3 E$ u. r, J9 c, K
  217.       end0 W8 d: b- C! C) O9 c2 i  z
  218.     }
    $ F6 A4 J2 i7 @( ^( S
  219.     SceneManager.scene.spriteset.refresh_effects if refresh
    $ ~; c# x' d% e: _
  220.   end% a7 L* u# A0 x
  221.    # b5 Y( ]. n+ |! x: c! b  O
  222.    
    % A( U& `. I6 {" z
  223.   def do_shadows(refresh = true)7 y% ]; x  P& S% s* l
  224.     @events.values.each { |e|
    2 m) i8 r7 x/ w2 _1 M4 e
  225.       next if !e.list
    ; w4 y  p" \3 E  }" B% x1 R
  226.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/
    , G1 a3 u" ?' \9 ~* l: A8 o+ E  ]
  227.         e.shadow = true, B3 U; F. X) d/ `) r
  228.       else: I  c3 c$ c  D' t
  229.         e.shadow = false. _7 n/ l6 R( o5 ~, ~9 i
  230.       end
    % p0 b" H  n- R1 [- o) g( b
  231.     }
    ' w4 t/ C" s* ]1 |* `, B+ ?% a$ ?
  232.     SceneManager.scene.spriteset.refresh_effects if refresh: O( n! ?- R, s& E. g9 ~
  233.   end0 R  d" f" g5 M  Z6 g& a: u
  234.    2 `# {8 `) S! b. R- X, A6 i
  235.   def do_reflects(refresh = true)9 r) a" n8 R1 t0 o7 Y5 M
  236.     @events.values.each { |e|$ P8 N+ u4 ?% P# z2 V& ~: E
  237.       next if !e.list. R: u  r6 g$ F5 d+ H/ [7 E
  238.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>// _3 L  X( |, U% a/ O5 x
  239.         e.reflect = true
    5 B4 a- n9 L3 _/ X" m8 S. [: }
  240.       else
    1 r3 W- q" j3 S
  241.         e.reflect = false
    ' C; `4 \! O4 t" u2 G- Z
  242.       end/ P5 L6 K' q: B3 B
  243.     }
    , o) O0 U$ h% ]* q# w+ M# m
  244.     SceneManager.scene.spriteset.refresh_effects if refresh( Q$ J, Y1 o* [2 M8 c8 ]
  245.   end
    9 Q9 |, U4 q' K- x3 M
  246.    7 u# G  I1 }. w$ c2 r  l6 F3 Y
  247.   def do_all_chareffects8 m6 l3 {1 `) _: X9 @+ F
  248.     do_icons(false)! z! d; N. N1 Y* a
  249.     do_shadows(false)4 ~) l: A8 i, [6 U' s
  250.     do_reflects(false); W% m- ?  R5 w7 B8 ~
  251.   end
    6 s* e  r) A- \
  252.    9 j7 u# P# h3 U. o4 X
  253. end # Game_Map7 v# B0 L$ P3 i+ N7 R1 U

  254. # s( r, Y+ o4 ?. z0 u) `

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

使用道具 举报

梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
回帖
4
 楼主| 发表于 2014-6-25 11:35:49 | 显示全部楼层
记得口袋妖怪的池塘是有倒影的
回复

使用道具 举报

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本发帖返回顶部