Project1

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

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

+ i1 s  ^" [9 x0 s3 T3 M这个代码怎么用啊,有大神知道吗。我从国外找的。
: A/ p; \  ?3 F* |- vhttp://galvs-scripts.com/2013/02/21/character-effects/
, v, q/ q' B+ g% b* P* H& `是关于动态倒影的
作者: 禺谷皓月    时间: 2014-6-25 11:32
  1. #------------------------------------------------------------------------------#
    # l5 C# f: k: l! |' D4 b9 S
  2. #  Galv's Character Effects
    - D; X6 U( q' L2 l8 G0 j9 q8 F
  3. #------------------------------------------------------------------------------#* T) Z- S1 \# T
  4. #  For: RPGMAKER VX ACE! _; ?0 U6 V( _5 O, y1 Y# V
  5. #  Version 2.1  Q$ j6 o4 T9 g6 U$ y
  6. #------------------------------------------------------------------------------#' u; b- {/ h2 W% j) V9 H
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows
      f0 k; u" u' ~' q: C" B
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects
    & k( n) K& [  o) _- @
  9. #                           - Fixed shadow facing bug" r! z, ~! }2 H- z0 m3 |4 \- K
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows
    , k5 U  M/ j# _7 Q5 f) ]7 C) J1 f1 ?% @
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows/ g' M& x4 v# J# x& N- Z
  12. #  2013-02-22 - Version 1.7 - bug fixes
    1 ^5 x- a8 T  k! e) r4 z
  13. #  2013-02-22 - Version 1.6 - added icon effect
      S5 v* {" {. s$ T$ c) k) i+ t* u8 X
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps
    ! M- ]) \) }3 f, p3 {
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles6 f+ D6 H6 X9 I: w( e. u
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks9 f8 N  N( l' z1 v5 b$ K
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)
    : W( W% J( k9 Y7 n  q
  18. #  2013-02-21 - Version 1.1 - updated flicker effect& C& L7 O: c1 e% T8 B7 B
  19. #  2013-02-21 - Version 1.0 - release' E: d; Q) Y+ i( d7 x4 C
  20. #------------------------------------------------------------------------------#3 p  a% o' ~2 ^* [4 \% k" F
  21. #  This script was made to provide some additional effects for characters such$ `' C% ]" s3 |; ^# G
  22. #  as events, followers and the player on the map.9 T; V, ~' Y2 Q$ u" L
  23. #  Currently it includes:6 u+ l/ i5 H1 S: X7 C2 U9 d
  24. #
    " ]0 E! T. j  A) E; G
  25. #  Shadows
    , U$ ]+ w- W; T$ w
  26. #  Shadows that appear under player and events in a directions depending on/ P4 [$ f, g5 e0 Y4 h) \
  27. #  a light source that you choose.
      F# m7 v) d+ P1 z) K
  28. #! S5 N% I9 m& e, K3 }3 k8 u' B) g
  29. #  Parallax Reflect
    ( a" E1 G6 ~5 w) G) A
  30. #  Reflections that appear on the parallax layer for events and actors to be
    7 G; I- P) `& k/ F1 O2 I, y
  31. #  used for things like reflections in the water or glass floor etc. To get. E. f3 y5 N' Q+ L' g
  32. #  effects like the demo, you need to edit the charset graphic to make the water, P, P  P8 `" T' q2 E. J/ m1 u
  33. #  partially transparent.4 k6 T& ^+ U8 ~& o5 ^: A% ?8 H3 I
  34. #
      p" R% M. u; _
  35. #  Parallax Mirrors
    + L/ M9 b8 P6 a$ y, ^# x3 @
  36. #  Much like reflect but are instead actors and event are reflected in a mirror/ v6 I& J* {, I! c8 i) N( X
  37. #  on a wall designated by a region. Both mirror and reflect effects can be; [5 Z- Y* Y1 S
  38. #  changed so actors and events can use different charsets for their reflections
    $ [4 T7 O$ B3 v, R; a( l4 T, |' J
  39. #& y- d+ e" e) ?) e! j
  40. #------------------------------------------------------------------------------#
    5 r; b( Y6 ?! C( v! V- r& @
  41.   7 F7 D2 q9 u! y. o: |9 o6 t( r
  42. 7 i  H+ Z5 W) X3 [+ d# ?* v9 m
  43. #------------------------------------------------------------------------------#
    $ Q/ x* X4 I5 B/ o
  44. #  NEW - First event command as a COMMENT0 d: W" S9 Q8 G! W5 ]
  45. #------------------------------------------------------------------------------#
    " _& |  ^; h2 U) P# J0 w
  46. #  You can add a comment as the first event command on an event page to set if0 I, {& J$ P% q, ~$ J/ m6 X: U9 p
  47. #  that event has an icon, shadow or reflection active. The tags to use are. U3 c& a6 k. w, z% {% b; C1 R
  48. #  below, all must be on the same line in the comment.& ^/ T+ H( g2 B
  49. ## N, b% C8 X# c& e+ M
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)
    8 e6 R4 g- u$ x/ I
  51. # <shadow>           # set the event to display a shadow; R+ z- O4 }; v/ C
  52. # <reflect>          # set the event to display reflections- g- S, N4 G& D$ T2 p
  53. #
    / I# H/ k& G+ ~& k9 f# m1 I  f% U0 t
  54. #------------------------------------------------------------------------------#
    . \6 w- Z& n! K; X. A/ c6 j
  55. #  EXAMPLE:
    4 z0 ]: G# P9 u# S: X
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event
    0 C6 ]) ~) M% ]. T3 ?
  57. #------------------------------------------------------------------------------#1 g/ J8 a) F  S) C# a/ U
  58. ' w& o7 C( Z$ q8 ~7 b
  59. & ?# l9 ?" n0 c2 J$ P6 }% N
  60. #------------------------------------------------------------------------------#
    8 w3 L4 `$ }+ v" B" v' K" B
  61. #  SCRIPT CALLS:$ O+ A/ _& V$ c0 |' }/ J
  62. #------------------------------------------------------------------------------#2 m, D/ o8 W2 P! Z  n! P
  63. #
    % q( z5 r* f9 d' p% e! S
  64. #  char_effects(x,x,x,status)
    $ r  o6 Z) W$ E" L/ p
  65. #
    . V$ u3 p' m! }9 A
  66. #------------------------------------------------------------------------------#2 D* p" V4 i) [9 D0 o5 L$ x2 f
  67. #  # each effect can be true or false to enable/disable them during the game.
      A1 x1 ?/ [! L( G. R
  68. #  # you can change multiples of effects at once, x being the effect number6 H/ [/ P' s6 g: N
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons* A& d8 |7 R5 ]
  70. #------------------------------------------------------------------------------#! G3 S5 Y" h3 ]: f/ c. V
  71. #  EXAMPLES:
    2 i# n: P' Y$ s! \9 a, O4 Z! K
  72. #  char_effects(0,true)              # turn reflections on
    ) Y0 t2 H/ x  F
  73. #  char_effects(0,2,true)            # turn reflections and mirror on
    : z3 x0 p! f6 B8 a+ C% @5 t8 P9 D
  74. #  char_effects(1,3,false)           # turn shadows and icons off
    ! ~- m( v; R. z, ~4 [6 E, i
  75. #------------------------------------------------------------------------------#
      _7 V- X+ d% q2 R2 ~) M$ G
  76. #  F, t2 y1 ^6 Z( d! @# q! V6 v: m
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset
    " n2 R( q7 M, c1 P5 b" |/ [
  78. #
    ' t- H" W% V" q2 n; c, F
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset9 J; w& [2 N3 {
  80. #
    6 N  x# T( j0 r  v' q* Z6 }# H
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset
    6 a" M: r( M; C! |" l
  82. #3 _7 x+ t7 A1 W( U/ m/ @* [: f/ B
  83. #------------------------------------------------------------------------------#7 F8 q$ z" Y/ y0 v2 P) N5 p
  84. #  EXAMPLES:
    ( O' A5 V8 U; @( u
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite
    & b1 o7 H5 y+ L& _- z
  86. #                                    # in position 2 of "Actor2" charset.+ N7 `% [- s& z
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of
    5 y1 u" O! V0 y; b- F2 j
  88. #                                    # "Actor4" charset.2 L0 X0 {6 f- B, Z
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of
    ; G: m6 G6 {( w/ I# y4 K
  90. #                                    # "Vehicle" charset., m+ q, j2 z$ L( \- m" n  \
  91. #------------------------------------------------------------------------------#
    * g" E  M$ C& J9 p- ]$ }4 D5 c, W" j
  92.   . c( u. J/ v% D9 q9 I9 G) X
  93. #------------------------------------------------------------------------------#& q/ O" M7 H. u" n
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS# `; \" u4 `  x5 r9 y
  95. #------------------------------------------------------------------------------#
    8 x9 k  G8 I) A% m% ]
  96. #
    ) @# s: n7 I8 U8 C
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off9 c, o/ b8 c9 Q: P/ ^/ J+ I3 J; k
  98. #                          # use this to specify for mirror and reflect.
      F( b. Q4 X; V
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change
    1 l- }. t/ D: [6 S: Y/ V# }$ k
  100. #                          # to change all events use :all+ `4 T/ b$ y. t$ I, A
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make
      Y, W$ N5 P5 y5 X
  102. #                          # it 0 for no icon.
    + [2 g4 J3 p1 [! y1 Q# k
  103. #
    ' U% N3 @5 T/ v. t
  104. #------------------------------------------------------------------------------#
    % I* k0 X% Y1 f* a
  105. #  EXAMPLES:# O) m# S0 ]/ t
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON6 p" D3 C" S) a2 V  o
  107. #  shadow(1,false)         # Turn event 1 shadow OFF
    . Y! @6 E$ W8 _
  108. #  reflect(:all,true)      # Turn all event reflections ON
    . L- O$ e! Z* T/ c9 e' M% O/ [
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear
    # m4 ]5 [* g3 P6 w' v  I( a( Y
  110. #4 v# M$ [- |* Y4 S# R; h
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering
    + s4 x$ F( k8 g% E( n, v
  112. #        a map. This is a design decision to try to keep lag to a minimum. You
    6 f& |2 s& S. f- W
  113. #        should use these effects sparingly and only activate them on events
    : m8 N, S8 ?9 t. W+ c
  114. #        that require them.7 D4 n* W6 e1 S
  115. #------------------------------------------------------------------------------#* D" R8 U! E8 O( Y, E
  116.   2 n1 u- m$ J2 C- N
  117. #------------------------------------------------------------------------------#: }7 B' |2 o" t
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES
    ) e+ I- V  e) C% d
  119. #------------------------------------------------------------------------------#
    4 |8 d% Q3 _& W8 [; r0 x
  120. #/ v  Q. @& @, _" P! R; P0 p. y+ A7 o6 M
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default
    ( L+ U/ r. z) s# _
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off
    6 k# D( i  s4 ~. s; w6 i
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.
    6 K+ q6 r3 B6 Y
  124. #! j3 d9 I' o2 V+ P4 l
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects
    ; {/ b# R# b+ m: b) {
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.
    7 U' x: s( w, e
  127. #  v_icon(x,x,x,icon_id)4 H5 c! j$ N9 X
  128. #
    : a! q1 k# j* e( |0 e% {" i
  129. #------------------------------------------------------------------------------#* m3 r8 y/ A0 h. d' Y
  130.   / p, c& [, @( x5 M+ o
  131. #------------------------------------------------------------------------------#' x( \/ D) J; w9 d0 @2 F; p/ ~/ j( K
  132. #  SCRIPT CALLS for shadow options
    ! V% L( p5 G) e& k- i! K
  133. #------------------------------------------------------------------------------#
    0 {! S: Q3 T8 E  j* c( {5 U2 s
  134. #
    4 Y# H% e# ^3 O( u: Y* h; z1 h
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the 9 ]) A# X( w2 [+ T
  136. #                              # light source number you wish to change (for  ~% F. i/ N1 _  w- `% B, [8 Z# Z3 P
  137. #                              # more than one). These are reset on map change.& l& J& e( m2 t( L$ C  s3 F
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.
    , N5 ?" J% \& Y* y) v6 L
  139. #                              # This will need to be in parallel process if you! [! b5 g4 B) Q6 O! {
  140. #                              # want it to be a moving light.( b- U! d6 J, I3 [6 i
  141. #9 C8 `2 J# E& q
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below. o7 q3 e4 A/ K
  143. #
    & M: w" T' y' k7 ^9 W
  144. #    # intensity = opacity when standing next to the light source (255 is black)
    , Q+ D" ?0 n( \  E
  145. #    # fade = amount shadow becomes more transparent the further away you are.! }3 @# Q& w# n# Q( G' m" `3 E
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.
    + J# u( B8 g% Q4 {$ u
  147. #; k9 G6 _& Y) E( S( Y& a
  148. #------------------------------------------------------------------------------#. O" ~" z* L; t8 y8 @
  149. #  EXAMPLE:
    ! U: ~0 `6 o. }  ^1 V
  150. #  shadow_options(80,10,false)    # This is the default setting.* Z9 `/ {4 ?8 Y* f5 E9 I' S
  151. #------------------------------------------------------------------------------#
    5 [& C1 a( P& u: Y- ?
  152.   
    7 i( B2 d' H' }! h
  153. #------------------------------------------------------------------------------#0 S1 n& P  n/ ]
  154. #  SCRIPT CALLS for reflect options* x$ b, T7 c" X! ~
  155. #------------------------------------------------------------------------------#
    7 ~% P8 J7 w6 T- ~
  156. #
    8 G( e+ e" e, c7 O
  157. #  reflect_options(wave_pwr) / o7 t' D9 M1 o5 i4 I
  158. #  c' O! I- x3 \7 y9 g$ Z3 \- e
  159. #    # wave_pwr = how strong the wave movement is. 0 is off! {# i& @$ z2 [7 d5 o. c
  160. #
    4 g/ _& ?& x" n% R0 m- o& Y# {% B6 ^
  161. #------------------------------------------------------------------------------#/ S$ Q7 A3 P8 N' Z8 I/ C# y; K
  162. #  EXAMPLE:
    . f1 P3 u' G* c  x
  163. #  reflect_options(1) # Turn wave power to 1; K7 m) C1 x. E) v5 l
  164. #------------------------------------------------------------------------------#3 d% n6 u7 N3 O# x3 K
  165.   + H& h0 A  d" p# Q) P
  166.   
    6 {" r( }( E! M7 X
  167. #------------------------------------------------------------------------------#& K4 P! [$ g2 Z0 ~! T
  168. #  NOTETAG for ACTORS* ~; o6 z* v% }# N4 S5 ?
  169. #------------------------------------------------------------------------------#. p" t2 b( r: E1 R6 S
  170. #
    8 d7 I+ u% {) D) P3 |) F0 \
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)
    # r# i7 i, c! t8 O0 m. x3 o
  172. #
    / X$ a/ l7 }" h
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections8 r7 h5 p1 T' u0 U& [+ j) h
  174. #                                  # and use the character in position 'pos': X1 w8 R) R# z
  175. #. `0 u+ v( d0 a8 @3 q
  176. #------------------------------------------------------------------------------#
    4 U$ o0 k4 S5 U- R; `; S
  177. #  EXAMPLES:
    " ]* c7 f( T! W" a; w  u
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset
    , N# \5 @/ H0 V$ \3 a
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset" D" K6 H+ u" z. D
  180. #------------------------------------------------------------------------------#
    ; x* k4 \% Q0 a9 \! Z
  181.   
    9 _# ]5 W9 F6 X! T! t6 C
  182.   
    + j& ~& }# Z+ r# S' z' w; ~2 C9 S
  183. ($imported ||= {})["Galv_Character_Effects"] = true3 V5 [0 E# d2 P! V4 B6 {
  184. module Galv_CEffects
    5 j  O( O* I+ g3 \, i( M8 E" }
  185.   $ g- P1 }+ \6 {+ @- e
  186. #------------------------------------------------------------------------------#  
    9 A: d  ~& v' j+ y- g% i! v
  187. #  SETUP OPTIONS. M: ?( _, q) S9 q
  188. #------------------------------------------------------------------------------#
    1 q( N. |$ M+ U9 Q0 Y
  189.   % P' R3 K0 j/ _9 K, D
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the
    # R6 k2 \! t6 f/ n  d
  191.                         # region on the wall you want to make reflective (and
    $ }% C" g* D3 t+ b( D
  192.                         # then use tiles/mapping that make the parallax visible)
    2 P& ^9 [8 k- Z* F
  193.   
    * E. v* M. y1 D) _: ~: J
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters
    5 Z0 Q* I! H2 u1 K0 T* @6 L
  195.    
    & K/ q' d0 N- M6 d5 m
  196.   REFLECT_Z = -10       # Z level of reflections
    ; O7 D2 v+ _0 ^4 Q1 ]
  197.   SHADOW_Z = 0          # Z level of shadows$ ]6 ^( `, O4 h" }6 j
  198.   
    % a5 b' j2 o' @
  199. #------------------------------------------------------------------------------#  
    5 `& l# Z% v6 k4 h/ z. v+ _9 w
  200. #  END SETUP OPTIONS
    : J+ a) f% [% C( p% a; S
  201. #------------------------------------------------------------------------------#, d% |; Q7 d; P7 C- m+ Z3 y
  202. end
    7 u9 \% @! {3 m
  203.   2 J6 B4 E' N% n0 U( ?
  204.   4 \9 s) E0 W+ `6 }
  205. ; [: ^5 l' I% |. @) u

  206. % j/ v# m7 P: A, {7 P$ S
  207. class Game_Map
    ' I. V& y+ B1 A
  208.   def do_icons(refresh = true)
    , c% V1 B: H( c6 c  O! \: N
  209.     @events.values.each { |e|
    ; y- N3 A  s5 H, T" i+ {& B
  210.       next if !e.list
    $ [9 P, R: {1 t' |" w# A
  211.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/# F) r1 v  o6 O9 A
  212.         e.icon = $1.to_i7 m! A5 q2 n9 ?" h% v& v' A9 U
  213.         e.icon_offset = [$2.to_i,$3.to_i]
    1 g9 {7 T! H; J; P3 e. ?7 s7 B# _2 e! v
  214.       else
    . O$ x( C( ]4 {5 I- S6 ~) ?
  215.         e.icon = 0( b2 G1 p# [# p! m# p
  216.         e.icon_offset = [0,0]
    : g" Y+ W" l, `) Y# }
  217.       end
    * }. C9 v1 v/ b+ ]  x; O/ s2 U* n
  218.     }
    6 U4 n. A. S* h+ V- U0 S7 H
  219.     SceneManager.scene.spriteset.refresh_effects if refresh
    . w! i' v: y. U! I( |
  220.   end
    & @' m" }- ?" c# S3 v% R
  221.    
    & Y& n% o: q+ b: {6 ^  S7 V. ?
  222.      b" i; l4 a2 z1 U0 ^
  223.   def do_shadows(refresh = true)
    3 O: G- Q$ w* m+ A, s+ X
  224.     @events.values.each { |e|. K$ s9 K1 ^/ a
  225.       next if !e.list
    1 \3 O- k/ h" N) [6 G& r
  226.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/' C; {3 L5 ~$ ^+ L$ ?% G
  227.         e.shadow = true3 V$ F3 G  `1 P
  228.       else8 ^+ s3 \9 d3 G
  229.         e.shadow = false) Z: _1 Z+ h! B' n
  230.       end
    . \4 U# w# y, D8 d: G! f
  231.     }8 _+ L+ @2 g1 ^- u# O3 E
  232.     SceneManager.scene.spriteset.refresh_effects if refresh$ R  w/ c3 q3 X  z
  233.   end
      ^: f' d4 }) T, u2 W
  234.    ' u' c6 Y# d& z" g: l6 r, N
  235.   def do_reflects(refresh = true)0 C% E4 C% P3 @; _6 H
  236.     @events.values.each { |e|
    / t( `, V6 w9 U9 E' G
  237.       next if !e.list% f$ U, c% W  |* ?) Y8 t5 Z
  238.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>/
    * [+ X3 C6 F; `! k' F
  239.         e.reflect = true8 @, D2 u. u5 {: L& Z; B
  240.       else
    + j% o0 r( I8 E+ m4 t
  241.         e.reflect = false+ C0 `# w! U0 ^) r& e# z1 s
  242.       end2 A$ e7 h. ^3 H" v# S2 ~
  243.     }- \* S: c3 P3 R- G, E
  244.     SceneManager.scene.spriteset.refresh_effects if refresh
    ' ^, Z6 c6 ^4 s7 Z
  245.   end! z$ o1 H6 K( L/ m! w5 ~. y
  246.    
    0 m) W) z7 J7 [4 M0 Z
  247.   def do_all_chareffects: U! X6 Z9 `2 \% M+ W8 Z
  248.     do_icons(false)
    1 ~3 n! {6 M- f" ~
  249.     do_shadows(false)
    % N0 [8 O0 ^5 Y# a: @* M
  250.     do_reflects(false)3 w8 Y: n7 D& K$ ], r
  251.   end  k( r. a! f" S
  252.    ' x. x6 h4 t3 |( @: n( H/ B/ {
  253. end # Game_Map
    1 f( Z& k$ `2 y+ X! p6 S: [
  254. $ `- q9 D3 B: U' @

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

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




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