Project1

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

作者: 禺谷皓月    时间: 2014-6-25 11:31
标题: 水面动态倒影,求解
代码复制
  1.  
; b, @. [0 H- Y+ P
这个代码怎么用啊,有大神知道吗。我从国外找的。
6 [8 q( i2 i. {5 }( G$ `. S1 Bhttp://galvs-scripts.com/2013/02/21/character-effects/7 t- L7 G. c) _/ X8 }) T9 g
是关于动态倒影的
作者: 禺谷皓月    时间: 2014-6-25 11:32
  1. #------------------------------------------------------------------------------#
      X, F7 M1 H+ _/ |3 I
  2. #  Galv's Character Effects5 f- B/ g* \! e
  3. #------------------------------------------------------------------------------#
    7 }% @: P3 W1 G3 J7 l4 p/ W) u
  4. #  For: RPGMAKER VX ACE
    & G: Z' y. ~1 y- E: F' }
  5. #  Version 2.1& @2 T, i& A  E* P, p1 `
  6. #------------------------------------------------------------------------------## o6 f. o/ @; Z4 S
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows
    $ X' C1 ^  H! T
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects7 s( E! i6 Z. I+ B, v
  9. #                           - Fixed shadow facing bug
    3 e4 Z: B- i! X9 ^3 ?
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows& C) a- p0 h6 Z9 p* P9 C7 Q
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows. M& N: }8 J4 L, n7 `" V1 D
  12. #  2013-02-22 - Version 1.7 - bug fixes
    ! I, L, a( e9 }2 Q  n3 o  W8 S& J
  13. #  2013-02-22 - Version 1.6 - added icon effect
    % Z, E; U# x5 B8 T7 G  }9 P, R+ p
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps, Z3 [6 A* C5 H- K( U! [  D2 ^" M
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles
    . N) Y- D3 e' m) X! [
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks
    4 k9 u' Y" c5 E, O
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)
    & a; e1 @/ [9 W! R
  18. #  2013-02-21 - Version 1.1 - updated flicker effect
    + `" h# a2 a$ o  U5 D, o9 X
  19. #  2013-02-21 - Version 1.0 - release8 e- \5 [* a( c1 w' ?
  20. #------------------------------------------------------------------------------#
    9 O8 W3 T9 z; N0 ~$ @/ u+ |
  21. #  This script was made to provide some additional effects for characters such- q1 o5 @1 o$ v' x6 A
  22. #  as events, followers and the player on the map.
    " \! H, m5 n. ~* r/ g
  23. #  Currently it includes:
    & X: G; ?9 k7 x5 }
  24. #
    0 o& T7 S  E6 V9 l3 n
  25. #  Shadows
    ( Y: a/ p4 r$ w; o- L, k. G6 k
  26. #  Shadows that appear under player and events in a directions depending on
    1 \1 [6 c$ p2 k
  27. #  a light source that you choose.8 d( u& ]# F" l, ?2 K  u
  28. #
    / T3 y: _4 h+ l2 J) U! c
  29. #  Parallax Reflect& M4 S4 ?9 v4 P' v* Y. C6 l3 {0 Z
  30. #  Reflections that appear on the parallax layer for events and actors to be& D7 m( j0 \" s( ?+ Y* k( L
  31. #  used for things like reflections in the water or glass floor etc. To get' K0 \- _1 r1 T4 B& y' M
  32. #  effects like the demo, you need to edit the charset graphic to make the water
    3 K( B# C% \7 Z
  33. #  partially transparent." R2 ^1 P) _* x8 g3 z6 B
  34. #
    5 u4 \! p: Y1 P: ?, v
  35. #  Parallax Mirrors
    , ?; _, C: u# Z( D7 I
  36. #  Much like reflect but are instead actors and event are reflected in a mirror/ _! t7 S8 j* A/ w9 n( z7 o; O
  37. #  on a wall designated by a region. Both mirror and reflect effects can be2 ]0 |) q5 S1 {/ c" ?
  38. #  changed so actors and events can use different charsets for their reflections
    , L" Q) l! p+ Z: ?4 o# G# r3 J
  39. #
    1 c2 u. T/ C8 N5 }8 c
  40. #------------------------------------------------------------------------------#
    / J; r# U/ [& S* ?
  41.   
    4 s. h5 N8 n' S) x+ i6 S% ]
  42. - {- Q3 u+ o+ n
  43. #------------------------------------------------------------------------------#) p9 b$ N' w8 q1 G6 P
  44. #  NEW - First event command as a COMMENT. K) R4 t: b. `
  45. #------------------------------------------------------------------------------#
    4 h0 I- O8 r  d4 ~
  46. #  You can add a comment as the first event command on an event page to set if
    / i3 {; g' d6 l
  47. #  that event has an icon, shadow or reflection active. The tags to use are
    1 @' _  q8 |/ \) \; F
  48. #  below, all must be on the same line in the comment.
    2 e" l& u, _/ F2 }6 N1 K0 e
  49. #
    # h- ^/ z* F7 j7 _/ D4 U
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)5 d, C% R% D3 U* F& p' z
  51. # <shadow>           # set the event to display a shadow% A; y/ V' L  P' C! J4 _6 Y
  52. # <reflect>          # set the event to display reflections- r  X; U2 n! b  F/ z! Y8 s
  53. #
    , [2 N& |/ M- ~$ M" J' ~
  54. #------------------------------------------------------------------------------#8 g) r5 @; i, J1 ?2 _0 Q5 `
  55. #  EXAMPLE:
    + ]: w2 f$ Y& \1 X6 y' |
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event
    , n! K3 h& V: _& T& k
  57. #------------------------------------------------------------------------------#' \( ^% g/ o: z" H0 {% L5 ]4 \

  58. 0 n6 w/ }4 w0 o, e+ b+ p* d+ |
  59. / S+ {  F+ g' W+ r# @7 C* `
  60. #------------------------------------------------------------------------------#
    ( E) r+ X0 y: z- w2 k5 q
  61. #  SCRIPT CALLS:9 J% \$ g% E4 |# b# d
  62. #------------------------------------------------------------------------------#
    9 H/ x- q( ~& |3 r2 ?2 t% Y; f* S
  63. #
    * _% c3 @1 Y' _# T6 c
  64. #  char_effects(x,x,x,status)
    7 C% s2 S, |6 s- S5 j
  65. #
    7 X+ o9 `) P2 m2 }" j6 H
  66. #------------------------------------------------------------------------------#* ?: Z" N! U* [9 D$ y) H$ r
  67. #  # each effect can be true or false to enable/disable them during the game.9 }7 x: |5 u  N/ m
  68. #  # you can change multiples of effects at once, x being the effect number  L( {4 ^' ?. u+ \7 k
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons
    " e, L) E& m9 x1 q2 @& h$ t
  70. #------------------------------------------------------------------------------#4 n. J8 S2 C/ F  g( g
  71. #  EXAMPLES:* M1 V% z& A7 N5 U4 Y9 j
  72. #  char_effects(0,true)              # turn reflections on
    9 j/ N/ k" ]( V$ ]( F2 p7 M8 y% W5 n1 N
  73. #  char_effects(0,2,true)            # turn reflections and mirror on
    / O) y& }" z. |2 G# R  R* S( w% G
  74. #  char_effects(1,3,false)           # turn shadows and icons off5 O& d9 \9 `9 _, T# Y2 z6 K2 ]
  75. #------------------------------------------------------------------------------#6 M. |# z9 Z+ v2 p
  76. #
    & t+ n% V& s0 p' |) d6 O# t, U
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset
    ( A* o0 ?9 L! a
  78. #
    $ v& m4 S" u& _, F) M4 M
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset
    & B1 I# u8 o0 {6 P' I8 G
  80. #& I; ^3 Q$ \1 u! F# _
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset  E% C2 [/ T# C( U" A
  82. #. K4 _" @; T/ m8 f6 B# L
  83. #------------------------------------------------------------------------------#
    , N8 U, |! O; ~& F& x
  84. #  EXAMPLES:
    $ @. A" |% x7 f: P
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite
    9 [% @! f. s3 T! x4 U! J# N$ n2 w
  86. #                                    # in position 2 of "Actor2" charset.
    ! R, u9 V0 h4 Y1 h/ b
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of
    2 i& H9 F( a. n( R& Y7 d
  88. #                                    # "Actor4" charset.
    $ |9 D: y8 o) `( {; Y! M# b9 S$ N7 ^
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of& `2 y; m) _/ X3 C; K
  90. #                                    # "Vehicle" charset.8 W% r: V$ ?% C5 B' d5 {
  91. #------------------------------------------------------------------------------#6 G0 z7 i( c+ E1 \
  92.   
    : t6 @: X% D$ @/ A1 D8 z& Y
  93. #------------------------------------------------------------------------------#
    / i9 _& G  n! d# f
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS
    ) C' ]5 Y/ x0 L/ W  [
  95. #------------------------------------------------------------------------------#/ y& ~( d, K" l" A/ n7 O) V
  96. #
    8 P8 |9 A3 e# |- N3 O0 ?% H) f& r
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off
    - E& }; w2 a5 t
  98. #                          # use this to specify for mirror and reflect.9 I7 _% O# j! v% d
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change" O! {" r4 Z7 }& R, m' J0 r+ p+ o+ V+ p! P
  100. #                          # to change all events use :all
    $ q& a  I9 a: `% X3 Z( f* V
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make
    0 Q# r( K* [1 X# S& U  o- y
  102. #                          # it 0 for no icon.+ ]7 }: d. y0 ?9 E" {; p5 O. e
  103. #2 R/ ^* T0 X1 e2 O' e6 M/ y5 e
  104. #------------------------------------------------------------------------------#
    # c1 G' o  J  H- o& Y) G% o
  105. #  EXAMPLES:/ Z% ~/ `) P" z' i, ?9 G
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON3 H0 Q+ _  K2 g2 Y/ O
  107. #  shadow(1,false)         # Turn event 1 shadow OFF$ S" y) D" E* M: w6 z
  108. #  reflect(:all,true)      # Turn all event reflections ON7 r. [- ^+ {6 D9 g4 i
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear
    - X+ |+ b4 R- u! c! f* V# Q9 q9 [
  110. #
    ; |/ E( d, p7 j4 R8 O- ]
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering2 m& P+ |0 y, [) Z9 V5 f
  112. #        a map. This is a design decision to try to keep lag to a minimum. You& k7 v& A0 ?/ _* |' o$ {" p1 g
  113. #        should use these effects sparingly and only activate them on events' ?3 I, d6 U( L- ~- C+ V. y/ k4 N
  114. #        that require them.
    7 o% o! J9 P& Q+ A) s$ N
  115. #------------------------------------------------------------------------------#
    6 w+ g3 n0 o+ S4 n- X/ Z
  116.   ( ?6 P; @2 z: l
  117. #------------------------------------------------------------------------------#
    + f$ ]6 `" _" y. t) y* O8 _
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES
    9 r: y8 e- u7 w
  119. #------------------------------------------------------------------------------#
    ! Z9 L: H/ Q2 \0 G+ T* I7 C
  120. #& }& V, q' K* t$ S3 D
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default - W) t1 i- |2 x: ^
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off
    . j4 y5 J* U: ]* \" R# V
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.
    6 Z6 E. R5 H9 o& X
  124. #
    ( i9 W/ w- J; b( D
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects0 m4 I6 A; R# `# f
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.9 G2 L& |# P9 o6 R1 B6 t
  127. #  v_icon(x,x,x,icon_id): i) S7 e; P0 U% T- u6 T+ y$ t3 T
  128. #6 w4 k* M5 c  }$ P  {
  129. #------------------------------------------------------------------------------#
    ( T/ O, y3 J. Q
  130.   
    : p( a0 V7 h" s- T/ V* _
  131. #------------------------------------------------------------------------------#
      S; j7 `  ^! F/ O2 {) i" C
  132. #  SCRIPT CALLS for shadow options: `& S! K9 t8 [$ T. G% P4 Z$ |; T
  133. #------------------------------------------------------------------------------#+ A# E) \" Y* ~9 v
  134. #
    2 S0 {3 w% T; K( l7 l5 }8 K
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the ! b1 _$ n7 U9 E, L
  136. #                              # light source number you wish to change (for
    " I. D  b( a$ n5 I& F1 J0 X
  137. #                              # more than one). These are reset on map change.
    . ?2 `4 W; s3 |# p/ v0 g
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.' c; j4 a* t2 e7 |$ H- N  l
  139. #                              # This will need to be in parallel process if you7 k, W* K% Y; R  s
  140. #                              # want it to be a moving light.
      Z5 f+ @# F2 t  C; o0 v. C
  141. #4 z) ?8 h+ C; x/ Q# D! s' K; B
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below' I8 J4 s  ~8 N# A. }
  143. #
    0 S! Q" K9 j% d( t8 S  [, E
  144. #    # intensity = opacity when standing next to the light source (255 is black)8 c$ _" I! U0 \; X! O2 E
  145. #    # fade = amount shadow becomes more transparent the further away you are.6 J; K1 O3 }! w* H6 X" i
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.
    ! @  d3 ]' K% P! _: t1 J' A
  147. #; K9 S) o0 y8 R( `5 z, C7 |! l
  148. #------------------------------------------------------------------------------#" E3 _' H' V: Y0 l2 G
  149. #  EXAMPLE:
    : k6 N/ J9 L/ d; Q" l
  150. #  shadow_options(80,10,false)    # This is the default setting.
    6 `; a( Q. x, _0 x- L
  151. #------------------------------------------------------------------------------#
    0 L# V/ C7 A9 {& E* d/ Y9 X9 b1 B- w# g
  152.   + _) J- x* s8 m' P
  153. #------------------------------------------------------------------------------#
    9 t- J! r' s+ v  ]. |6 n, u
  154. #  SCRIPT CALLS for reflect options
    & P& _- G$ X) \& z6 s
  155. #------------------------------------------------------------------------------#5 G1 [/ a1 w6 I
  156. #0 K( N2 ~0 v, B5 c
  157. #  reflect_options(wave_pwr)
    + q, ]( |  Y8 p+ {/ n; b2 J$ o
  158. #
    * [6 C# f2 A% ]$ ?6 |
  159. #    # wave_pwr = how strong the wave movement is. 0 is off
    5 M! ~; @3 L5 b) @7 n  W
  160. #
    ! Y4 @8 B3 w7 K. n$ p; I  s, w0 ?
  161. #------------------------------------------------------------------------------#" ?6 P) H/ ], s. O5 h% W( o4 h
  162. #  EXAMPLE:
    2 V# t5 l. }2 h( N/ b
  163. #  reflect_options(1) # Turn wave power to 1
    5 z2 w1 h" O, G5 R
  164. #------------------------------------------------------------------------------#
    . n; Z$ r7 S$ l+ L8 C" G; u( W
  165.   . w& b& Z# N! f4 E; `1 Y' I
  166.   
    % i5 R5 ^0 ^8 m  y8 G4 i
  167. #------------------------------------------------------------------------------#% Y2 [6 e2 W$ K. l9 |# Q
  168. #  NOTETAG for ACTORS( e5 {' k& `3 ~/ X: m. o9 g5 G
  169. #------------------------------------------------------------------------------#6 R) n8 f9 b! S+ X
  170. #
    , O6 s" ], m3 E3 t
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)0 x1 `# p4 U7 u
  172. #
    / [  }. p! ~' H& ?1 i# j
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections8 {; [2 k9 l; a; g) S
  174. #                                  # and use the character in position 'pos'
      v! i6 ?* J, b% x% ^6 Y
  175. #( p% h. D9 n9 \* I6 G
  176. #------------------------------------------------------------------------------#' e1 w: Q9 F! {) ]: ^2 h
  177. #  EXAMPLES:* y1 p. B# T& g" f  _
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset
    - u% G* c+ @) A) {. \
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset
    2 f3 R" c5 Z. {$ g1 Y! `
  180. #------------------------------------------------------------------------------#
    # G8 k! h1 @5 K5 F8 a  x
  181.   
    3 s. @$ M7 n+ B+ D) b3 {
  182.   1 I2 M6 L( \3 k
  183. ($imported ||= {})["Galv_Character_Effects"] = true
    - G- D' |! O8 H! p$ B' M
  184. module Galv_CEffects
    7 Q( d. E8 z* Q9 `
  185.   
    % g4 n2 D2 B8 X: k1 L! E
  186. #------------------------------------------------------------------------------#  
    ! Q) e( U; i# F2 z9 q7 r
  187. #  SETUP OPTIONS
    ; p& s6 l) u& g1 N
  188. #------------------------------------------------------------------------------#
      |: Y3 Q9 y4 x
  189.   # w2 _' J4 M1 _- V: u! |
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the6 M( g- s8 y- X. m
  191.                         # region on the wall you want to make reflective (and
    " b% I. y% u3 T5 U) A8 ^
  192.                         # then use tiles/mapping that make the parallax visible)" Y# z- X' u; R, b
  193.   
    7 T5 ^, C# V- R4 ]3 b1 A! _2 m0 n
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters5 X- `* I* u$ v% O/ m
  195.    
    8 V6 \: {: r. M5 R/ e; M7 M- i$ Y. V
  196.   REFLECT_Z = -10       # Z level of reflections
    * ~7 y2 u! M0 C$ R
  197.   SHADOW_Z = 0          # Z level of shadows
    3 S# d" _8 J. T( B1 D% h
  198.   
    $ }  D6 j# W' @" I
  199. #------------------------------------------------------------------------------#  0 s" q! n$ N' i4 _; s
  200. #  END SETUP OPTIONS/ e7 l4 l2 o  g) X
  201. #------------------------------------------------------------------------------#5 I5 K9 @$ S; `- V8 |
  202. end
    $ |" a1 `' _# n" k
  203.   
    + z9 k" e6 p( {+ K) ~
  204.   
    ! X) D  w9 J1 ]' P  L3 E/ Y+ `
  205. ' h3 f. a& m& `# p

  206. , V6 ~0 F3 l: v4 I. F: h. k" K
  207. class Game_Map
    0 D% C( e- S0 ~3 B/ f* `# k
  208.   def do_icons(refresh = true)
    / ^! }5 \5 G) c5 u% V% ]
  209.     @events.values.each { |e|
    3 ]. K- y7 C$ Q' l
  210.       next if !e.list/ {3 d0 ~0 `+ y! t) o
  211.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/+ e- n/ X+ k3 b) W! k' {$ u
  212.         e.icon = $1.to_i
    " B3 R1 Q4 q1 P  `6 b$ D3 J( [
  213.         e.icon_offset = [$2.to_i,$3.to_i]
    # |" |) e- v/ I
  214.       else
    . G) f. v2 A* @; ]' m& a
  215.         e.icon = 0$ w/ Q  ^6 H; L1 v1 t1 Z' F
  216.         e.icon_offset = [0,0]
    6 z0 c$ i$ M* ?6 l
  217.       end
    . S' A3 l5 L/ z/ B" }. H
  218.     }8 i4 w0 `# P6 `1 R% R# y9 i3 b
  219.     SceneManager.scene.spriteset.refresh_effects if refresh
    , O. I- G. n$ X/ {4 }* a, J
  220.   end
    : D! l5 V1 ?& G6 u0 X! w
  221.    
    9 I4 v/ v/ u! ]. B: ]( _
  222.    
    $ ]1 ?1 r7 ~: W' A" F
  223.   def do_shadows(refresh = true)- E! O# j" I# i6 e- F# p" o' F- X
  224.     @events.values.each { |e|
    * w" I# ^9 H6 P# s+ q3 y; {) O
  225.       next if !e.list
      T9 {. S! w' D( d& V1 n: D
  226.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/2 n( M6 w9 j& n) ]
  227.         e.shadow = true
    " {, Q" H. {- u; [
  228.       else
    5 a9 n4 J) G1 L+ N9 d: z. j! f
  229.         e.shadow = false
    ' A( I/ v9 t1 X6 e, c( U9 {
  230.       end5 d/ q/ A. \  P! {! r+ [$ T
  231.     }
    9 o2 n  u6 }4 ~; p4 o* w  a
  232.     SceneManager.scene.spriteset.refresh_effects if refresh4 T. W. O5 @1 f" k
  233.   end. H7 S" A* Y0 ^' i7 t0 W0 w
  234.    3 m4 w2 F, j: H* b0 f$ b
  235.   def do_reflects(refresh = true)
    # y6 w& b3 {# N* Q
  236.     @events.values.each { |e|0 D5 `' S. U7 m4 P/ Y% e( r) _
  237.       next if !e.list
    " \7 A8 t! c6 b7 ^
  238.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>/
    ; |6 Q4 d: c9 r" C- x1 C
  239.         e.reflect = true  T" b* ^! `$ E
  240.       else
    * h( o4 P1 B" U( m" P
  241.         e.reflect = false! l% k5 ^: C; O- k
  242.       end
    8 t6 w9 [$ M" l% ~# c6 D8 _: }
  243.     }
    & S6 Y( \3 N) s" n. i) e
  244.     SceneManager.scene.spriteset.refresh_effects if refresh" t1 M, t& f- E! a
  245.   end1 U+ F' _2 S1 x, @; ~
  246.    ) g2 l) W3 ^9 g8 |% C) C; ^
  247.   def do_all_chareffects
    # |; J/ o. e2 D
  248.     do_icons(false)
    & C% k- U8 S, H7 Q) z" |% U5 w+ L
  249.     do_shadows(false)' B7 N# D- Z. k* E' j9 F4 f
  250.     do_reflects(false)
    2 S  c/ |/ g9 R! n3 b2 M
  251.   end7 J' Z6 R" Y+ c) ]
  252.    
    1 v) s" x6 l9 q! h6 l) Y
  253. end # Game_Map9 F4 e- T% ]. K6 S3 X2 `
  254. 0 s" m( ?1 K$ B+ i. ]8 q; l; J

  255. . R* `, x* [/ N8 n+ g

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

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




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