Project1

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

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

0 H: P( w( j3 [; `  |这个代码怎么用啊,有大神知道吗。我从国外找的。! G, y/ |* A2 U! ^% S# t; ]
http://galvs-scripts.com/2013/02/21/character-effects/" ~! g! _: D! N. V( @+ X
是关于动态倒影的
作者: 禺谷皓月    时间: 2014-6-25 11:32
  1. #------------------------------------------------------------------------------#4 T3 d1 C+ t) \. @1 m3 S/ w
  2. #  Galv's Character Effects# T( }! A- p$ [3 }# A! [6 F  o
  3. #------------------------------------------------------------------------------#
    : ]: Y, N* w' [" s& s. w
  4. #  For: RPGMAKER VX ACE! s; k. N% v! s. u
  5. #  Version 2.1
    $ |7 {& p1 F  B! ], N" m: Y1 o
  6. #------------------------------------------------------------------------------#: D, H3 E3 ?# X; m# U6 o
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows
    6 d: s3 s+ D2 h$ Y; X* {3 L
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects2 U2 l4 d6 J6 @9 U7 F. D( }0 W
  9. #                           - Fixed shadow facing bug
    1 _. h0 g5 P' D2 a7 {8 {2 J
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows: ]" B) r( a/ _0 @- t& U
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows
    : }! G* ?6 k# ^* B- {  I/ A
  12. #  2013-02-22 - Version 1.7 - bug fixes' G* d' H' R. F
  13. #  2013-02-22 - Version 1.6 - added icon effect
    ( }& {) f0 y9 K
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps( A& \$ _# ?% k% g9 _; [; A' U/ g# ]
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles
    # V& L; T/ c$ Z8 Q7 w, j
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks
    ( P+ V$ D( s1 N0 x- A- L1 u6 S: ]! Z
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)7 a, n. [* L' j, U; j
  18. #  2013-02-21 - Version 1.1 - updated flicker effect4 q2 y2 p) K. M4 m
  19. #  2013-02-21 - Version 1.0 - release
    . a/ N- A2 w4 R/ _: K% b
  20. #------------------------------------------------------------------------------#
    6 W+ ]4 a( P8 F$ Y8 S
  21. #  This script was made to provide some additional effects for characters such
    # H1 t* ~) n& `, y# U1 u
  22. #  as events, followers and the player on the map.
    * M9 M! o* A2 U- Q7 d. `) e5 D0 D5 @
  23. #  Currently it includes:* k8 F: I2 q; T% r, }, u
  24. #
    ; k9 Y3 [. p9 w* O. z
  25. #  Shadows
    % e) ^. k. J- R5 q
  26. #  Shadows that appear under player and events in a directions depending on' O& j( `6 y3 F$ L, c! |. ]
  27. #  a light source that you choose.
    5 u4 [; Z1 V( t( n& D
  28. #$ F  ?- r3 G: z/ @" y6 j
  29. #  Parallax Reflect
    6 ]! E" B( V; D% Z7 P2 |# k% J- B. Y
  30. #  Reflections that appear on the parallax layer for events and actors to be
    " ~" k' |5 r7 |3 H
  31. #  used for things like reflections in the water or glass floor etc. To get
    - g. D! R& ]% R: y# v; [" n
  32. #  effects like the demo, you need to edit the charset graphic to make the water! \9 k% l& B% n2 @2 [
  33. #  partially transparent.* B5 j! [7 L3 b" ^, |6 t2 E0 q
  34. #
      G  e/ U3 _, L$ H  L% f
  35. #  Parallax Mirrors
    & ~3 F- H% d% w
  36. #  Much like reflect but are instead actors and event are reflected in a mirror
    * z4 ]" ~; p- u4 Y  e0 z6 C
  37. #  on a wall designated by a region. Both mirror and reflect effects can be
    + b  [1 y. s& Y/ S( P0 {
  38. #  changed so actors and events can use different charsets for their reflections
    ; \7 O+ b# U  D. H& q
  39. #, P# [: S# I9 C1 f4 s$ U
  40. #------------------------------------------------------------------------------#! Y! M* h# j3 s2 G" {: h) ~
  41.   
    . j2 E5 i, B! w* o+ D8 y# d5 [; Z
  42. 8 n; p8 r8 s# P) L, K
  43. #------------------------------------------------------------------------------#
    4 d* e) r* N. j- H$ P
  44. #  NEW - First event command as a COMMENT$ s3 u& |( t: T& t7 V  U
  45. #------------------------------------------------------------------------------#9 Z' M  D6 z4 ?' m" W
  46. #  You can add a comment as the first event command on an event page to set if- X4 g* ~2 S0 G  x, f
  47. #  that event has an icon, shadow or reflection active. The tags to use are  k$ Y7 g9 ~% F! \0 @
  48. #  below, all must be on the same line in the comment.
    & _0 B& g' f8 D  Q. @
  49. #
      y# n- r+ t  J5 Z: q- u, R. |
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)% K4 |# w5 a1 P" d6 q
  51. # <shadow>           # set the event to display a shadow
    ! p0 u0 O) l3 t- Z; N: I3 j. N/ h, J" z
  52. # <reflect>          # set the event to display reflections
    % V5 C' R) m3 n' `( [) ^
  53. #
    ) A5 e3 X' x; `$ B  g
  54. #------------------------------------------------------------------------------#2 D  i" }8 G% @3 m$ p
  55. #  EXAMPLE:
    4 J9 C" R2 I  P5 P3 b1 X
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event* h2 B, l- a$ G# F
  57. #------------------------------------------------------------------------------#! R; O( O& {3 P; q" L* m

  58. 1 [+ e( I  o7 u! V6 ?! l3 R& z( e
  59.   n- L- B" ?/ i- T
  60. #------------------------------------------------------------------------------#
    : n. N! s" d' @, o
  61. #  SCRIPT CALLS:, {  R, Q! ?1 m
  62. #------------------------------------------------------------------------------#* ]6 ]: a. m# L; V5 h  z8 p
  63. #
    ) j+ |5 n2 ^* u( h' S
  64. #  char_effects(x,x,x,status)' y7 T& W  J( r6 S
  65. #
    - ]/ ?! A. Y+ y( w1 h  M
  66. #------------------------------------------------------------------------------#. H" O# N" B1 U5 g# f+ n# ^
  67. #  # each effect can be true or false to enable/disable them during the game.
    + A0 Q+ P3 E) ?% Y$ r8 ]- [' D, l
  68. #  # you can change multiples of effects at once, x being the effect number6 R) T9 X$ M8 S, n7 z
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons/ G0 g( C+ X6 w
  70. #------------------------------------------------------------------------------#$ d, J( c7 }" c  f$ n
  71. #  EXAMPLES:7 v( ]' ^/ W1 B( l3 x. a- F
  72. #  char_effects(0,true)              # turn reflections on
    ! y6 x/ r& @4 G$ K* z) L
  73. #  char_effects(0,2,true)            # turn reflections and mirror on, [/ C/ y0 W- \) v) }
  74. #  char_effects(1,3,false)           # turn shadows and icons off
    8 }3 M. f7 H0 {# R! v- N
  75. #------------------------------------------------------------------------------#* |  f, q- U# @% I( S  S
  76. #% V; A* [2 ?* ?/ I& ]
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset
    ( U% o* s3 k2 X4 p
  78. #& ^1 E9 \- a; ^. o5 p
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset. r  `: H; _, @. `! W8 R4 Z/ [
  80. #
      R9 O' W+ Q6 |# q& Q, P
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset
    2 o* i: j: l; e
  82. #
    4 i, b6 F3 ]1 L$ j: t
  83. #------------------------------------------------------------------------------#& v9 V+ _) j* s7 Y( U7 O, i
  84. #  EXAMPLES:0 y" M- W% v) I6 W  y
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite
    9 S% q. F' ?9 _- \9 X: {
  86. #                                    # in position 2 of "Actor2" charset.
    % [# S; m% ]9 i0 z
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of7 {. b. J" y5 ]
  88. #                                    # "Actor4" charset.. B& C, o3 T4 Q6 y% e
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of  G7 W( Z( [. T) C+ S% p
  90. #                                    # "Vehicle" charset.# @( J/ R, e, J8 @
  91. #------------------------------------------------------------------------------#
    1 P2 w8 _( N. t+ f% f2 ]( X2 n& l
  92.   
    : ~3 B1 b2 q1 o# _
  93. #------------------------------------------------------------------------------#
    - C) @9 s5 H1 s) b* @% Y) u' S
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS, _' q+ I2 ~+ p) m% u5 `, }0 [" Y
  95. #------------------------------------------------------------------------------#! {, a  w  e  j4 m( o
  96. #
    / f. n% _8 w2 Y- m, n
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off
    0 R' l* K8 O% t' M; ^
  98. #                          # use this to specify for mirror and reflect.
      x2 ^# b4 v2 Y- h- u1 y5 I5 b
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change
    9 J( x4 B6 @5 v
  100. #                          # to change all events use :all8 w, b- U* S9 v& v/ \
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make3 ]' B+ C' ~4 O9 a
  102. #                          # it 0 for no icon.
    8 p9 L6 [! O8 L
  103. #
    % B  O1 F) A( l' p8 Z
  104. #------------------------------------------------------------------------------#
    7 H( a8 [; y# B7 g8 X
  105. #  EXAMPLES:
    # o3 H1 ^1 _2 t
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON! e: |' U' \% D; G7 D! j) @; k
  107. #  shadow(1,false)         # Turn event 1 shadow OFF! v9 k2 }1 c- A7 I" e
  108. #  reflect(:all,true)      # Turn all event reflections ON% W. m, k/ e6 n/ g/ e% R
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear
    : P, L$ \( \- _' N8 P6 H) D
  110. #
    + K/ E. r$ B/ }' V4 _/ B
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering
    6 {6 ^+ D: a5 P% H: ~
  112. #        a map. This is a design decision to try to keep lag to a minimum. You( S; k9 s: l  a! }! c9 I) T
  113. #        should use these effects sparingly and only activate them on events
    * T# _0 r: i. \' }, Q
  114. #        that require them.
    0 j- C) H: U: `+ P" ?
  115. #------------------------------------------------------------------------------#  w7 \1 [: E4 ~4 t( y! `
  116.   
    / N% F2 f; {$ G; A0 F5 m
  117. #------------------------------------------------------------------------------#$ u) V3 P# X9 f, M/ ], F5 S
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES
    % A5 i$ H: Q3 y5 j
  119. #------------------------------------------------------------------------------#% j* u8 `, n. z8 z" X
  120. #
    ! F" o. ?& [! O  _$ b9 H
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default
    % D, P: o) q3 k( ^7 C6 p2 Z6 e
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off
    " _( w+ \9 {5 E$ h3 j2 b
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.
    8 j2 b- ?9 X0 {! V9 @
  124. #" q/ P6 i! k# x  K) T+ I
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects
    + b" j4 ^9 Q1 }0 N  F
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.
    ( x" q9 L- K1 }; k. ]. M, _
  127. #  v_icon(x,x,x,icon_id)3 _0 D/ A' R7 n0 ~
  128. #% S# W" a# X- N' H0 Z; t) u
  129. #------------------------------------------------------------------------------#- h4 T$ l( Q7 t6 D) l1 Q5 }
  130.   4 ]# N0 O: V# J) h0 s" U
  131. #------------------------------------------------------------------------------#
    - c2 E5 l; m+ E  A6 d% I
  132. #  SCRIPT CALLS for shadow options4 F4 G* e) C7 C4 a+ q! t* N$ T  q
  133. #------------------------------------------------------------------------------#
    # W$ v, ~5 `& J" \
  134. #9 G" z5 S/ K4 j, Q: B$ F
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the + f8 h3 U! b' d0 r; b3 f' U
  136. #                              # light source number you wish to change (for+ L; e6 }" o$ \$ l& s' S
  137. #                              # more than one). These are reset on map change.' m, ]' j, g. ]* S) M2 J& s
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.* T3 v. ~7 e9 K
  139. #                              # This will need to be in parallel process if you
    # i$ y6 P9 U0 d* e' O% D$ S9 @! u
  140. #                              # want it to be a moving light.
    : c/ }+ A/ G" I! h4 j2 K
  141. #! |8 v9 W: B8 Q( S: V$ F( |0 O
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below
    / v% y# X- }; n- G
  143. #; M8 |: {" H/ n4 ^3 A
  144. #    # intensity = opacity when standing next to the light source (255 is black)7 G! p9 ^& ^, m
  145. #    # fade = amount shadow becomes more transparent the further away you are.
    & i$ v6 T$ i" H& l# [
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.5 h" P# p8 W8 U& S7 I7 w0 y0 n# Z- H
  147. #
    + n/ N/ x% l( `% f' q0 W; L  |( O
  148. #------------------------------------------------------------------------------#* ~* D* y- T3 q5 k
  149. #  EXAMPLE:* n6 K& N" W( R4 m0 o5 S! D9 r
  150. #  shadow_options(80,10,false)    # This is the default setting.
    - @/ A/ w  Q; t) k) h
  151. #------------------------------------------------------------------------------#* I( L* Y) e6 {
  152.   - x. j, O3 O& M* \& L9 _, {2 ?
  153. #------------------------------------------------------------------------------#5 O) o- v0 `% ~- p' |" L: w# Q0 ^3 G
  154. #  SCRIPT CALLS for reflect options, y& y& w: ^. A& M9 o
  155. #------------------------------------------------------------------------------#+ N% m- [& G! F$ D3 m" I
  156. #6 o' j9 }4 q  h0 b  b* k, A9 [
  157. #  reflect_options(wave_pwr)
    7 l, B$ `0 X! y% J( I
  158. #+ _8 q7 `. b5 i+ ^- b* q. f& l
  159. #    # wave_pwr = how strong the wave movement is. 0 is off8 B1 u- O0 b  H+ c+ @$ @
  160. #
    , Z2 u3 G" u8 q& P, G8 G
  161. #------------------------------------------------------------------------------#, U: M2 [  L# D! r8 f6 I# d
  162. #  EXAMPLE:
    $ N. m7 _. t+ B2 v
  163. #  reflect_options(1) # Turn wave power to 18 n( P' p! D4 Y+ v5 k
  164. #------------------------------------------------------------------------------#
    ( \4 l% x6 A( {/ X7 P
  165.   
    5 R# {1 w3 Z) k; ^
  166.   " I8 P. z% y& v$ ^9 w9 B
  167. #------------------------------------------------------------------------------#6 E/ o5 f' q  t2 \1 E5 G) r
  168. #  NOTETAG for ACTORS
    6 [4 h$ F% j3 W1 P
  169. #------------------------------------------------------------------------------#
    3 Z! Y$ a! @, K8 X
  170. #
    9 I& g# e) I& b" H# A
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)
    " K% ]- r& I, O9 y
  172. #
    # V$ m7 b0 L' y! C, J, k
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections
    1 N- P* v* H) U* ~" f
  174. #                                  # and use the character in position 'pos'
    2 F# g7 p" g4 V8 C; j( u7 L
  175. #6 ]( x6 M! c" F( w
  176. #------------------------------------------------------------------------------#
    / J2 m5 u# x+ s  r
  177. #  EXAMPLES:8 I, z3 V* O! @/ }" u
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset# D' K5 u* {$ r& b# @5 X7 l
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset, l; v% \# T. Y% |1 H; }% m
  180. #------------------------------------------------------------------------------#' A( k% ]/ ?4 ?+ w6 @% V
  181.   $ P+ `3 s+ _# ]3 f" Z8 v* _
  182.   8 ~8 h7 N1 q) m. {. c: q! A
  183. ($imported ||= {})["Galv_Character_Effects"] = true
    7 k3 k+ S/ Q9 `
  184. module Galv_CEffects+ P6 g9 M# F0 @" T( E
  185.   
    % |8 r2 ]( o8 p0 J. @+ U6 t. C
  186. #------------------------------------------------------------------------------#  
    ' C7 F3 @6 w/ k
  187. #  SETUP OPTIONS
    / K: v/ W0 \2 }5 O8 A3 P
  188. #------------------------------------------------------------------------------#5 W/ M5 _+ l$ W6 D/ K
  189.   ; `0 T% J7 i  q( E% L5 P9 o
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the" X( Y  f" r! [6 Z
  191.                         # region on the wall you want to make reflective (and
    . O  a" b! R; D2 A9 L
  192.                         # then use tiles/mapping that make the parallax visible)
    9 Z  ^0 M5 j7 D. {
  193.   
    3 B/ D" s4 q( b0 c5 v2 u
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters
    8 W2 Z3 z$ h4 z' |3 O: B
  195.     % C4 `/ a  l1 z. U7 v/ [" C  K$ ^
  196.   REFLECT_Z = -10       # Z level of reflections. S& Q" c& h& _6 X6 U0 G' D
  197.   SHADOW_Z = 0          # Z level of shadows/ a+ K. d. V! l9 J  N* T" Y& V% B
  198.   5 f  M+ Y# @/ Q" L
  199. #------------------------------------------------------------------------------#  
    1 W+ r' y1 y& r' N
  200. #  END SETUP OPTIONS+ ~2 q% h9 z% [1 U, `4 G- k+ c
  201. #------------------------------------------------------------------------------#; T+ b2 V: w5 m6 _. |
  202. end$ r' ?8 I! ?' ^" A( @0 a
  203.   
    1 R4 W/ h. ?  b* L# L/ ~
  204.   $ r2 B1 t; O* e3 u
  205. + s0 v+ Q- {5 o3 ^7 A6 x; N6 ]

  206. ! K! x9 `" |/ E0 Y
  207. class Game_Map$ ], g9 M+ {% P( c+ N
  208.   def do_icons(refresh = true)
    % D( k; l7 i3 t6 j. }
  209.     @events.values.each { |e|2 Y4 U5 k5 S/ s8 m# J( \7 Z
  210.       next if !e.list
    6 P: l! N& W, {+ f
  211.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/
    1 h( E+ o+ R1 w
  212.         e.icon = $1.to_i% J4 i( X6 ^9 F& T
  213.         e.icon_offset = [$2.to_i,$3.to_i]* Q- ?+ V2 d& g- |# I- I# W" C
  214.       else+ ^* p1 W5 p" @7 g( m8 x
  215.         e.icon = 02 @! B. O$ M4 B' d% V
  216.         e.icon_offset = [0,0]+ R+ R" h2 K: A4 `8 s  r
  217.       end/ d: D6 E2 P$ `
  218.     }
    3 d) n# P( P+ o& j+ p
  219.     SceneManager.scene.spriteset.refresh_effects if refresh5 z& A  g  D) r: K0 C
  220.   end8 g! U) Q8 ^  N: k" z! s0 Z
  221.    
    7 `1 f3 \' p" C) K
  222.    
    ; }# ~6 ^% l& }& S: j7 H# [
  223.   def do_shadows(refresh = true)8 v. u$ D7 }2 ~, K, |7 {5 C
  224.     @events.values.each { |e|
    ( o1 B3 K( p$ s1 g
  225.       next if !e.list
    & b, F; z% Y6 E- u
  226.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/: q: l0 E4 c7 u9 N. r
  227.         e.shadow = true0 V$ q( k0 J9 q$ Q- f
  228.       else
    ! P$ i# s" X0 v. O, Y3 R
  229.         e.shadow = false8 z5 P; ?: U1 Y
  230.       end3 y: P/ F/ t7 @7 ]
  231.     }
    % Z; ?4 U- x$ z0 Q8 u' k
  232.     SceneManager.scene.spriteset.refresh_effects if refresh
    / E( b5 J, A- @0 h
  233.   end/ l6 r% f& i, v- A
  234.    ! n, {/ t$ s+ W8 G, q
  235.   def do_reflects(refresh = true)/ }$ ^- g, j& F4 E' \9 A
  236.     @events.values.each { |e|
    3 ~. o  m' j5 `
  237.       next if !e.list  T- b% X+ i$ [
  238.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>/
    . g4 z' H2 u' {  \0 c3 y7 @, {
  239.         e.reflect = true
    ! H' _- E7 ?* A2 ]# q& z/ E, d0 a
  240.       else1 o- V- \1 a7 T9 d, ?2 V7 ]7 o/ P
  241.         e.reflect = false
    9 {0 U. U% B+ b/ R1 K2 U. n/ Z
  242.       end
    1 D2 D) o2 z0 U" ]+ u
  243.     }, I; U. ~9 z, U. h! D$ D
  244.     SceneManager.scene.spriteset.refresh_effects if refresh
    3 \  A  N1 P4 T7 }- K) U
  245.   end
    $ e7 ^7 ]) e& x% o+ V
  246.    
    . l5 g6 f6 \. k) l! s
  247.   def do_all_chareffects3 P6 q3 l4 I9 j2 x# D
  248.     do_icons(false)
    1 [2 C' _2 e8 T1 O5 U
  249.     do_shadows(false)
    ( q+ j+ n. K; J
  250.     do_reflects(false)
    8 `$ B7 x! ~1 v& p% x) [
  251.   end
    $ o3 ]0 |" X) {6 K! p9 I, \
  252.    
    1 E( Y; [$ v  S8 R. }; Q& Y
  253. end # Game_Map$ |( y0 F! F2 u7 z8 I

  254. % c: [4 }- O' ^1 e

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

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




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