Project1

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

作者: 禺谷皓月    时间: 2014-6-25 11:31
标题: 水面动态倒影,求解
代码复制
  1.  
& {/ z; }) Q, X, |2 M1 f- q
这个代码怎么用啊,有大神知道吗。我从国外找的。
- |; ?! B4 F: W( n" J( r8 A+ yhttp://galvs-scripts.com/2013/02/21/character-effects/
: q2 y& J; ?  [是关于动态倒影的
作者: 禺谷皓月    时间: 2014-6-25 11:32
  1. #------------------------------------------------------------------------------#
    $ h- L1 ~8 q0 J2 ~  j8 X
  2. #  Galv's Character Effects
    9 V0 g7 D4 s! c* k5 z- V, U4 ?5 y
  3. #------------------------------------------------------------------------------#' L+ Z7 F2 K0 Z2 Q
  4. #  For: RPGMAKER VX ACE0 j6 a) e4 \9 j4 S+ J* z( I
  5. #  Version 2.1
    " n/ t5 s8 \) b
  6. #------------------------------------------------------------------------------#
    - h3 Y! W) B, `
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows
    0 }4 P; K+ _/ p+ V2 m
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects6 B. b) w' i; G- ]
  9. #                           - Fixed shadow facing bug% Q8 h* o, o/ ]* b! U( o* g: i
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows
    5 \, Y; _1 \; o1 {5 G
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows
    " E5 I, X# @" T8 N5 Y! g
  12. #  2013-02-22 - Version 1.7 - bug fixes
    9 _  e" ]7 k$ C, W
  13. #  2013-02-22 - Version 1.6 - added icon effect
    & z3 R. o6 t8 r; U( }- z& ~
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps; z6 V7 H) i( U5 U% x& M
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles* a% S6 z* H$ W3 T' G7 R- [
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks# d. Z1 n$ r. R
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)
    3 u2 D0 L  z5 i1 G# B  d. W
  18. #  2013-02-21 - Version 1.1 - updated flicker effect
    3 }: G! r+ C" D
  19. #  2013-02-21 - Version 1.0 - release
    4 S2 w% L4 {- X2 z. m6 p
  20. #------------------------------------------------------------------------------#
    " Q# f1 D! X0 w: t9 ]# b
  21. #  This script was made to provide some additional effects for characters such; B7 @# b* L& i1 d& ?5 d0 h
  22. #  as events, followers and the player on the map.9 E! x0 ~3 n$ M( r- U( w
  23. #  Currently it includes:1 \$ n6 n- Y; h. z+ t( p
  24. #
    ) g9 M+ S9 u. s* E
  25. #  Shadows
    # G7 g9 Q. T+ J
  26. #  Shadows that appear under player and events in a directions depending on6 S+ k8 U7 e2 O- ^* s
  27. #  a light source that you choose.7 c: p# y0 C. n: S+ a, P
  28. #
    $ Q; n, {, _% W1 H9 z
  29. #  Parallax Reflect
    ' w$ |/ k/ t! b/ w( m' T/ P
  30. #  Reflections that appear on the parallax layer for events and actors to be9 h/ G# J) s3 `! E' e# N2 r
  31. #  used for things like reflections in the water or glass floor etc. To get6 _' H6 o1 O4 m! v
  32. #  effects like the demo, you need to edit the charset graphic to make the water' s2 g# v( a7 R7 P, m! \: x- ~
  33. #  partially transparent.5 x. w% d$ N7 M; u3 R8 i
  34. #
    / V2 q  p7 j8 [. r
  35. #  Parallax Mirrors! E6 H# w1 G1 d) M
  36. #  Much like reflect but are instead actors and event are reflected in a mirror
    " x2 O3 ]9 \# o  k, }
  37. #  on a wall designated by a region. Both mirror and reflect effects can be
    0 O+ d+ W+ k5 \0 s7 K6 a. D8 }
  38. #  changed so actors and events can use different charsets for their reflections5 ~& m# d! M. w3 k
  39. #- l$ [# n! q6 f, w; B
  40. #------------------------------------------------------------------------------#; ^0 w! K$ q$ G- K
  41.   
    2 t5 j6 K" d: ^  W: H6 |

  42. 1 x6 L. d0 J; U4 E# ]6 g" B0 [9 V
  43. #------------------------------------------------------------------------------#1 b+ T& j/ I# i2 L) ^* h
  44. #  NEW - First event command as a COMMENT* Y+ E& r  F% d' `9 _7 S9 T
  45. #------------------------------------------------------------------------------#
      s4 A; c' E2 H6 A5 l, Q) i
  46. #  You can add a comment as the first event command on an event page to set if
    $ z2 ^* Z3 v; l( q$ m
  47. #  that event has an icon, shadow or reflection active. The tags to use are
    % X, ^# p8 P9 e' F2 P3 R
  48. #  below, all must be on the same line in the comment.3 ?$ f, N- _- D6 E8 C( `1 F; Y
  49. #
      Z% a! a% x* {- G" x
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)9 o5 v! B6 a# P6 T& ?
  51. # <shadow>           # set the event to display a shadow
    . v8 Q* k0 P4 G6 m+ a( b
  52. # <reflect>          # set the event to display reflections+ q$ y. r0 H; c) s9 x
  53. #( G6 e6 B! e* Y8 W5 n: m9 Y9 [! @
  54. #------------------------------------------------------------------------------#
    ! F' f3 O* }9 l+ |' Q3 a/ W
  55. #  EXAMPLE:! d, c5 I, c# Z3 M
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event5 P# U: o/ Y& @- F9 W$ q3 H  ]
  57. #------------------------------------------------------------------------------#
    $ t2 h3 i# E, Z- x! r5 O0 v/ G! g
  58. ! Q2 K  G; k0 x

  59. ( M( G8 n  S4 c- n, Q
  60. #------------------------------------------------------------------------------#: V. f1 b" k" o3 D
  61. #  SCRIPT CALLS:+ F( [. b$ \, T4 \1 ]( b
  62. #------------------------------------------------------------------------------#
    8 F: g; j) H4 I* X5 ~- P
  63. #
    # A1 N" F8 R# x) h  V
  64. #  char_effects(x,x,x,status)
    % _7 ]3 s' k2 G/ b
  65. #
    5 o2 _" \; H% B8 y
  66. #------------------------------------------------------------------------------#$ |% W: A; _4 l3 f1 _
  67. #  # each effect can be true or false to enable/disable them during the game.: x6 K& i8 Z/ p! a$ v
  68. #  # you can change multiples of effects at once, x being the effect number5 b, O) @3 Y) n  @, T
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons$ w; ]' Q! t# Z4 R) H1 b
  70. #------------------------------------------------------------------------------#/ e' _3 B" O# R9 v4 y1 B/ P
  71. #  EXAMPLES:
    - `/ P; K. u, M
  72. #  char_effects(0,true)              # turn reflections on
    5 d) ^8 d; D/ ~% R) [4 z2 f0 W! H3 a
  73. #  char_effects(0,2,true)            # turn reflections and mirror on6 X% o0 J0 t9 a/ w3 M
  74. #  char_effects(1,3,false)           # turn shadows and icons off, F& C2 D) K0 X
  75. #------------------------------------------------------------------------------#; i6 ^; ]4 K" y4 k/ k4 w
  76. #
    ; o; i$ X, z2 ?+ g- {
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset; `+ W5 s, f, G
  78. #, ]: A/ ^5 w' ?3 P. I7 Q
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset
    ' V. J4 W2 x4 v! x  P. W
  80. #6 j6 |0 V. _4 Q8 X) P! p( `
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset
    1 r3 X/ q! c9 W3 O* G2 @
  82. #* N7 f- A5 V- c( g  s; W8 `" ^
  83. #------------------------------------------------------------------------------#6 R5 Q! Z+ U" r. V
  84. #  EXAMPLES:
    # q0 T/ y3 p$ M% V1 \4 P
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite
    4 c& P0 h8 R7 p0 H7 }. b
  86. #                                    # in position 2 of "Actor2" charset., Y3 a7 Y, K0 z, Q' p0 E! U
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of) H8 M( U$ i  n8 e
  88. #                                    # "Actor4" charset.* \( d: c. b- H6 n) o
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of
      V" V7 v( K5 L; P4 k7 G* [
  90. #                                    # "Vehicle" charset." K) V% k" \- A3 t7 Q
  91. #------------------------------------------------------------------------------#1 K$ H1 }# W' \9 p7 s8 H( ^
  92.   
    # d: _" @. T, _  T
  93. #------------------------------------------------------------------------------#
    5 M% y& h5 P6 m# f& X: _
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS
    ! m$ w3 |  l2 Y* Z! G1 O' i1 P( x
  95. #------------------------------------------------------------------------------#4 h( c/ D4 u- [  [
  96. #
    * \7 y* ~1 X! b6 [
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off' Q' y: x1 p7 D2 r* ]3 m( |
  98. #                          # use this to specify for mirror and reflect.
    4 V% w) ?; M; Z* I8 G
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change
    - j1 U9 d% J( E: x
  100. #                          # to change all events use :all
    + J7 G. R4 D4 R( W0 Z( Y
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make
    ' u' w* K$ Y' G! h: R( K2 ?
  102. #                          # it 0 for no icon./ g. M, V9 d( i) _
  103. #
    . p+ h3 L. R1 C6 |% G( H9 o
  104. #------------------------------------------------------------------------------#: k. @; a, M) z  @7 e  |2 W; O; r8 \
  105. #  EXAMPLES:
    # q5 s  \7 }, z. m
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON$ i: V- [, S8 D* r' X' `
  107. #  shadow(1,false)         # Turn event 1 shadow OFF4 j4 ~. D$ f8 c+ u1 b- ~
  108. #  reflect(:all,true)      # Turn all event reflections ON: Y* A. S  @$ j) z
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear2 N! i3 Z4 J% w( A
  110. #
      d( J2 |3 R+ v5 `/ k; Z! f
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering
    , `& U3 z9 \3 M, f" o: i( W5 T
  112. #        a map. This is a design decision to try to keep lag to a minimum. You# ^& W$ a0 u' f; _  Z: u5 U
  113. #        should use these effects sparingly and only activate them on events
    ! G4 Z) M5 O1 N9 j% ?" [$ x
  114. #        that require them.
    , Y' i/ b1 c9 c" @5 Z
  115. #------------------------------------------------------------------------------#
    " r+ a! `' c1 E: @  _' T
  116.   
    . F, o: H3 C' B" w' ?8 i" B6 o
  117. #------------------------------------------------------------------------------#
    & i# f% p  v4 B8 d' d+ u
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES
    6 S9 k9 R* A: n; Y! U+ b4 W) y
  119. #------------------------------------------------------------------------------#2 x5 M4 @3 f' u) A- X" m3 Y
  120. #* Q, x0 C- Y3 D* z) w
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default
    . x6 F+ c. _+ i
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off 0 a- b8 k+ G% c( A
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.2 l  A5 p) A' ]
  124. #
    ( [$ L" W3 A. E* [+ V
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects
    " C. \/ D. _) d0 A# x: u) T
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.
    + t3 X+ Q5 p" r3 d6 L+ x# x0 K
  127. #  v_icon(x,x,x,icon_id): `$ f4 b1 |8 f: U9 X$ y
  128. #0 M+ i& e9 L: P! J8 t. G% U: B
  129. #------------------------------------------------------------------------------#$ r# }( R  L( ?4 i/ F
  130.   ! F7 t. f+ S3 m0 [$ \2 s( }4 f
  131. #------------------------------------------------------------------------------#
    ' V% _, D( O3 p, @5 ^. ^  L- l8 B) j
  132. #  SCRIPT CALLS for shadow options5 x7 J7 ^) m' O
  133. #------------------------------------------------------------------------------#
    : T1 N+ g4 i  J! Y
  134. #
    : k+ k& E* r6 y, W" W  Q
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the 9 C6 v" H' O% \# J' G' N2 B/ z0 |8 P5 J
  136. #                              # light source number you wish to change (for
    8 D" R& n6 y' f# s; N
  137. #                              # more than one). These are reset on map change., A7 w; \$ T6 G. }4 \8 f* G$ v. w0 v
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.# M. ^; g5 R7 f/ e% j4 p; U, P# E
  139. #                              # This will need to be in parallel process if you& S2 B' x% W. ^* W. J
  140. #                              # want it to be a moving light.1 L9 A3 H5 U2 ?5 v- G; |- \& l
  141. #
    : M+ F+ B# H" n; @/ V
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below) v3 P6 `" O$ Z- q' [
  143. #
    ( E0 O: K' B) G4 i0 J# h
  144. #    # intensity = opacity when standing next to the light source (255 is black)' ~% s1 M7 [; B# U: z+ i
  145. #    # fade = amount shadow becomes more transparent the further away you are.
    1 H) z& }  Z6 y" G+ J: G
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.
    / X+ x7 _0 W/ S1 t9 E! h8 ]
  147. #. j3 B& J2 P9 `2 v7 S
  148. #------------------------------------------------------------------------------#
    ( v0 n, M& ?7 k: k0 O( J2 ?* h; Z
  149. #  EXAMPLE:$ Y0 {5 u; T5 E& B0 v
  150. #  shadow_options(80,10,false)    # This is the default setting.! L: {' _4 _3 W: f
  151. #------------------------------------------------------------------------------#
    ( H) r- o3 r: f& [( E4 f! K
  152.   
    1 L4 |4 t$ B" ]" m$ G
  153. #------------------------------------------------------------------------------#$ e; R6 x. P* x# @
  154. #  SCRIPT CALLS for reflect options
    / b2 A5 [5 D( h, K: }5 R5 _
  155. #------------------------------------------------------------------------------#
    $ b8 U$ {9 @; A4 Z$ c
  156. #
    $ }: N! z6 N9 u
  157. #  reflect_options(wave_pwr)
    ' U2 x# D7 i5 ~" d
  158. #
    + ?( T  }# P$ [: j9 ^
  159. #    # wave_pwr = how strong the wave movement is. 0 is off) Q2 r. X& C, a. b9 b7 Y8 f6 `
  160. #" B1 S8 y3 l! _9 H5 w6 O+ ?, T2 z
  161. #------------------------------------------------------------------------------#3 u) G3 \* Z) e' H7 f0 h
  162. #  EXAMPLE:
    5 h& b% \% ~/ W- g3 D2 t' C: U$ ]
  163. #  reflect_options(1) # Turn wave power to 17 G8 O5 i5 F& E% H$ P* U6 y
  164. #------------------------------------------------------------------------------#' Y1 I1 u3 k8 }; g! R' q
  165.   7 y+ L3 b9 }. w/ Z
  166.   
    " ^2 _( [$ l/ H& |
  167. #------------------------------------------------------------------------------#
    & E: b2 v: H( J! p  A$ [1 N: k
  168. #  NOTETAG for ACTORS
    ( z0 Q" D# I7 T* a
  169. #------------------------------------------------------------------------------#
    . X# `" r# K# c& N% Q+ ]
  170. #
    . ]( G+ R) w2 {2 d5 X6 t
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)
    / l2 G: R/ A/ k, f
  172. #
    ; g7 p* S- k  R5 @0 x
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections; ^& W1 P5 X& o7 j3 |
  174. #                                  # and use the character in position 'pos'' y& w9 s! l) x& [
  175. #" q/ b0 \# a6 U0 f! L
  176. #------------------------------------------------------------------------------#
    : p; z. x" F' y- a$ Y: l
  177. #  EXAMPLES:/ F: w$ c8 P! O9 T  u3 P
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset( P" }' s7 [2 J  e
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset6 D0 p; M  ?# q) `9 y) [+ n
  180. #------------------------------------------------------------------------------#
      V) B! H# P" |2 E5 e
  181.   
    ) j, N* [) G+ \- f+ a) a" w
  182.   
    % c) B3 b9 X8 l) Y) s) [
  183. ($imported ||= {})["Galv_Character_Effects"] = true
    ' d. `3 g5 Z( K, s7 s
  184. module Galv_CEffects
    ; h6 I) W8 |+ q' ~9 K5 `
  185.   
    0 S2 }5 q. L3 X- I
  186. #------------------------------------------------------------------------------#  
    - l* u  h# }  {5 }
  187. #  SETUP OPTIONS
    1 d2 H7 ~& B& d% B! x
  188. #------------------------------------------------------------------------------#4 y) t7 f7 c3 e$ \! P/ V
  189.   
    - M0 m+ o7 a: S4 k4 k  m
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the2 Q3 r0 G  c! I  C. I' A
  191.                         # region on the wall you want to make reflective (and+ R: l4 P: j9 ^/ I2 E
  192.                         # then use tiles/mapping that make the parallax visible)/ ^- R8 Q* d5 I1 t; b$ r3 Z
  193.   
    ' w% H& [2 `2 i# ?5 n
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters
    / Y5 k9 A$ U4 t; r
  195.    
    0 k- g1 |) P  c7 S+ \( Q- t/ W( U
  196.   REFLECT_Z = -10       # Z level of reflections
    5 @. }( K0 o) s/ p) F- ^2 y0 ~
  197.   SHADOW_Z = 0          # Z level of shadows1 F, N; m/ j" _% ^4 S, Y5 {
  198.   
    % `2 a( ^8 `! s- m( Z4 c
  199. #------------------------------------------------------------------------------#  
    / s* E2 P8 |1 x: j/ R( @% Z5 n/ h
  200. #  END SETUP OPTIONS
    7 V" K3 D% ]( h$ d1 l, x/ _
  201. #------------------------------------------------------------------------------#' a1 k$ A$ ~. b. l; E# u& W* |
  202. end
    % d9 q2 m$ C, E1 f4 n% g3 s
  203.   
    ; O$ k9 M& X$ x$ ]
  204.   
    , V8 w6 f' g- K; e$ a
  205. " \4 u1 f; f) ]. M6 J) a
  206. : i* n- v) N9 V- W
  207. class Game_Map
    7 n. ^4 X) Y8 t5 B* Y
  208.   def do_icons(refresh = true)
    . F- j8 {2 ~8 l# k+ J! b( K+ m6 ~# D
  209.     @events.values.each { |e|
      o4 M: n0 W" B) L
  210.       next if !e.list
    . V: N8 [- ]+ @& D! L
  211.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/7 g9 a7 {8 m) Z( d" ]* u* z
  212.         e.icon = $1.to_i
    . W2 [2 y% g1 A7 m( e
  213.         e.icon_offset = [$2.to_i,$3.to_i]+ Y% G' E  l7 o. O" m$ k
  214.       else3 u1 B1 q, X" U) h5 S8 Z' M
  215.         e.icon = 08 Q( C2 e) H# A, O# g
  216.         e.icon_offset = [0,0]! o, R. V6 {: U9 v
  217.       end
    3 H! U% U. s  u. k& x
  218.     }2 n; Q' `. w6 c$ ]1 S5 X4 @8 p
  219.     SceneManager.scene.spriteset.refresh_effects if refresh
    # y  k& g& a9 }7 Y4 c* j- y
  220.   end
    7 G/ z, K/ m* W6 j+ \. T: J
  221.    7 a7 r& h9 h3 o) y7 X1 i
  222.    + {# o2 L7 h2 m
  223.   def do_shadows(refresh = true)
    / O( s+ D, e: ^' ~: o
  224.     @events.values.each { |e|3 z4 {  O; L  j
  225.       next if !e.list
    + I, b" {: |& I$ M% H
  226.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/4 ^1 B' V, Q- c. f$ A- X" H" P
  227.         e.shadow = true
    ; S  `! q- V. p/ X: j& T
  228.       else, A3 w; A+ j3 @  l  B
  229.         e.shadow = false
    0 C2 V* n$ k$ d8 M
  230.       end
    8 g6 r+ x- H6 H& {8 r( j) l
  231.     }
    8 J6 H; g6 l3 t
  232.     SceneManager.scene.spriteset.refresh_effects if refresh+ K- _, Y5 S7 ]" B
  233.   end$ \( S2 O! O6 \3 Y& i
  234.    
    5 ?4 B6 U& o+ b/ W3 U) z
  235.   def do_reflects(refresh = true)
    : v; F  U$ Q3 E4 q
  236.     @events.values.each { |e|5 g+ L9 I4 `6 [! l1 h
  237.       next if !e.list
    1 M# [" x& v8 G7 L. Y( p
  238.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>/" L( A. P: b! k3 v% U
  239.         e.reflect = true
    * J! j' H& A! z! n) A
  240.       else
    . P3 {3 X8 W) Z+ R' o
  241.         e.reflect = false
    3 x1 q8 H. R! j* F) f
  242.       end
    % f1 v6 o: Z5 ^& C. S0 h4 B
  243.     }
    % J& T% a; N9 ~6 c3 g0 Y
  244.     SceneManager.scene.spriteset.refresh_effects if refresh
    $ I7 a9 V2 Y  L  I( w1 {
  245.   end! o% _, {/ u6 r, g8 }& H
  246.    
    4 _& j" e, F' k' B+ s5 j
  247.   def do_all_chareffects
    % W5 I) u" c* b* `1 U
  248.     do_icons(false)& o* l9 M. M; f% @+ O" t
  249.     do_shadows(false); j* m& H! B8 p) _! Y% Z
  250.     do_reflects(false)' G2 A4 y/ `- Q9 Z; Q
  251.   end
    7 }0 z* n  b7 E" r6 e! d$ a2 `6 z' Y
  252.    ) x' D& p4 e2 m' i- E
  253. end # Game_Map
    4 h' I( y# {. U; Z9 o* H' l

  254. 4 g& \- a) _9 G+ Y$ d7 v: `6 M# g

  255. : e. l  r% B. Y. I9 n# P3 V

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

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




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