查看: 1506|回复: 2

水面动态倒影,求解

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

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

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

×
[code][/code]
: H6 i' k/ N/ ]0 P$ Y" }# p这个代码怎么用啊,有大神知道吗。我从国外找的。
4 V, ?2 |0 H' e4 o2 B% chttp://galvs-scripts.com/2013/02/21/character-effects/
& t; L* f2 @( O9 ?2 N是关于动态倒影的
梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
回帖
4
 楼主| 发表于 2014-6-25 11:32:43 | 显示全部楼层
  1. #------------------------------------------------------------------------------#
    + Q9 L' l' y7 @! X% W2 z5 ^
  2. #  Galv's Character Effects0 N) W5 i/ O( O& m( l- y
  3. #------------------------------------------------------------------------------#
    " d# M. r, P  w& a7 I! n
  4. #  For: RPGMAKER VX ACE# g& v' A0 d" ^
  5. #  Version 2.1  p+ m8 p, j9 t
  6. #------------------------------------------------------------------------------#5 b# S8 i7 z. m% G# _% e
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows% ]+ P% u7 i+ I9 |1 ]4 ?9 [* ?# N
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects4 A4 c  b1 c, m- Q9 S
  9. #                           - Fixed shadow facing bug
    # B' w0 l$ i' F. I( D
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows
    8 T$ J: F9 y7 X9 T7 v
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows
    - x; s. J' N% V5 L) W' Q, w& ~
  12. #  2013-02-22 - Version 1.7 - bug fixes& c/ X' E* k8 |: Z
  13. #  2013-02-22 - Version 1.6 - added icon effect
    ' ~4 B& ^) G6 h: B
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps; j4 W, i* I& Z# {: F! f2 z
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles
    ( b/ w9 l" p! ?
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks
    4 e/ z/ W2 I% K
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)
    ) J/ j% y/ t8 ?- \+ V& E+ Q- q' {
  18. #  2013-02-21 - Version 1.1 - updated flicker effect
    3 R- U( z! g' d" x
  19. #  2013-02-21 - Version 1.0 - release
    ) a' V0 d) I" t
  20. #------------------------------------------------------------------------------#
    5 t" F1 s3 a; j. u4 U1 v; v2 ?
  21. #  This script was made to provide some additional effects for characters such* k) L  W" O  A( Y2 b; r
  22. #  as events, followers and the player on the map.
    / M5 P! W3 x( Y) P& b" X
  23. #  Currently it includes:% c" a& i! H8 ]
  24. #' x. q' e. W1 e, e; y9 C
  25. #  Shadows
    5 V* u, O# R9 L' A' B
  26. #  Shadows that appear under player and events in a directions depending on
      w$ P9 Z, u' z9 e1 k
  27. #  a light source that you choose.3 A4 A8 v2 ~7 l- i5 V' I" e
  28. #4 o! f' {4 y5 |* J! \: \
  29. #  Parallax Reflect
    5 x' x" O* y2 U8 F- |2 n  S
  30. #  Reflections that appear on the parallax layer for events and actors to be4 W) H  C" E. B' |
  31. #  used for things like reflections in the water or glass floor etc. To get% M# R" |) |2 d. R/ J# h8 A
  32. #  effects like the demo, you need to edit the charset graphic to make the water
    5 ^# v4 F. G) ^% ^
  33. #  partially transparent.* G1 ~) v. K' L( _) q. X+ z5 W
  34. #4 H- T, U/ H& P, S
  35. #  Parallax Mirrors8 v8 v* R* p$ |5 P5 K$ j& r
  36. #  Much like reflect but are instead actors and event are reflected in a mirror( w8 R. g1 D, a( s" @" N+ _2 b
  37. #  on a wall designated by a region. Both mirror and reflect effects can be$ r9 b- }( W2 l  l! }4 L* H5 o
  38. #  changed so actors and events can use different charsets for their reflections
    1 q. l) a3 A3 {( l
  39. #
    4 S, _- t, Z' ^
  40. #------------------------------------------------------------------------------#
    & i1 Z& {/ f, R
  41.   
    , {8 q0 x! V) ~) I

  42. 3 L2 V- O. @: o+ q2 C+ |
  43. #------------------------------------------------------------------------------#
    ( r5 [0 v( r7 X/ l1 Z1 r; k
  44. #  NEW - First event command as a COMMENT
    6 ]9 ]" I6 A) N8 _* O
  45. #------------------------------------------------------------------------------#
    % @, R! ^. K: _$ o5 \
  46. #  You can add a comment as the first event command on an event page to set if
    3 O) Y; H% W/ }( A1 m$ {
  47. #  that event has an icon, shadow or reflection active. The tags to use are2 z/ i3 A3 ]' t: G( K
  48. #  below, all must be on the same line in the comment.
    ( V' {6 s  R" a' o2 w6 k
  49. #
    $ T( D5 A1 c7 g( T+ O, Z
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)
    1 o9 t9 ~5 t- {# |0 Y/ x
  51. # <shadow>           # set the event to display a shadow0 d6 C* x/ M2 E7 Z: H
  52. # <reflect>          # set the event to display reflections6 w0 q$ @6 G# f, Z# d& V' L
  53. #
    ) L# d& x8 s: c0 t' X  n0 J
  54. #------------------------------------------------------------------------------#2 y2 V' X& F: Q" I: y. G
  55. #  EXAMPLE:$ Z" s& W' f% a
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event" l2 s1 i* }7 M) p; q
  57. #------------------------------------------------------------------------------#: X1 M  F/ f/ D0 S, I& T& e
  58. 9 k* y( c/ _1 u% t5 G+ K

  59. $ b0 _! v$ u# m7 Y2 g* z& E% [9 r9 [
  60. #------------------------------------------------------------------------------#: C: Q3 R9 X- k5 V8 A
  61. #  SCRIPT CALLS:
    4 T, J7 y0 D6 q- j  l
  62. #------------------------------------------------------------------------------## U: x6 `5 H' Q: U& K! w& f
  63. #. u/ G6 o/ M8 c) |6 O3 ^, V: B0 \4 i
  64. #  char_effects(x,x,x,status). q  g: p7 F; I0 Z/ ~! a
  65. #
    1 I' P. Z, i- r5 t9 a2 B
  66. #------------------------------------------------------------------------------## e1 t( L7 p) m- W
  67. #  # each effect can be true or false to enable/disable them during the game.9 c$ Z" {8 W# _2 a$ _1 F, U
  68. #  # you can change multiples of effects at once, x being the effect number
    , l- M4 b! ~/ Z6 ]
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons
    * V: p6 N) E% ^1 T9 l
  70. #------------------------------------------------------------------------------#/ Z: I/ Q# H0 g& i' n& B7 l+ q
  71. #  EXAMPLES:! e8 v- j0 s  \; w) W
  72. #  char_effects(0,true)              # turn reflections on& p6 |: v2 o* @' V4 p/ F! B! c5 M
  73. #  char_effects(0,2,true)            # turn reflections and mirror on& A7 f% U" C( |' ]) M# t3 r3 I7 w
  74. #  char_effects(1,3,false)           # turn shadows and icons off
    4 ]$ }2 O3 T, z
  75. #------------------------------------------------------------------------------#
    % D: L7 w% A5 ~$ o* j& K# w
  76. #
    * ?; r2 E' T' r6 e/ N
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset
    % v% f  y7 C% B1 P/ l3 @
  78. #
    ! n& V2 K2 u  y/ C
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset
    " s" T: c5 K  X4 e& U
  80. #8 x2 }# r& C6 y/ @6 i+ y
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset
    4 ^* v1 r2 h+ V7 B% s# K6 b
  82. #6 y8 Q5 R, j" T6 f
  83. #------------------------------------------------------------------------------#) h" Q% G; G$ o9 @
  84. #  EXAMPLES:, r! W% V7 ^) N
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite( Z  J1 q+ I1 _( T( W  y2 E$ }9 f3 ?. B" O
  86. #                                    # in position 2 of "Actor2" charset.
    " @  {1 e/ o+ f; r
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of
    : x& ?2 M4 s' k' m$ c
  88. #                                    # "Actor4" charset.
    3 I& ]% Q, U: I0 j6 O
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of
    7 x  ?4 ^% Q0 o* }
  90. #                                    # "Vehicle" charset.3 d# l2 @; |  }0 K+ [
  91. #------------------------------------------------------------------------------#
    % P0 D; k. S! S
  92.   8 h* J( W  w' i: E4 Q& M3 E& b2 e
  93. #------------------------------------------------------------------------------#- v: w( n  g" k
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS
    $ j4 `. D+ X: q8 b
  95. #------------------------------------------------------------------------------#: ^9 ?+ u3 a; u4 r+ L
  96. #
    4 ~! a9 Z: T) [1 J: z
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off; s" Q6 T* |+ t, e; s- w9 |
  98. #                          # use this to specify for mirror and reflect.  o. N& U$ ~/ s
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change, M1 `: S2 ]' E! A. z  R
  100. #                          # to change all events use :all, r7 p+ g9 i! I6 q( r& P% A
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make4 p, e0 I  C6 g8 c+ O, M
  102. #                          # it 0 for no icon.
    : X- l; e) c6 J  k$ F
  103. #' Y" s4 H) ?% ]. Y& n
  104. #------------------------------------------------------------------------------#) P  H' I/ z  N& C5 h" ~
  105. #  EXAMPLES:
      P3 S$ o! \* K0 H+ T
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON
    ( n, g# R( z$ a# ?& \  q
  107. #  shadow(1,false)         # Turn event 1 shadow OFF
    / i# g4 {, T& l" z. K7 k
  108. #  reflect(:all,true)      # Turn all event reflections ON9 F1 [: V0 S7 R
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear
    5 T' J& M  V; w0 A9 w% F
  110. #5 A/ Z% |/ H# \2 C+ W8 l& `+ q
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering
    1 b+ C# \$ T) N" ~: N2 a
  112. #        a map. This is a design decision to try to keep lag to a minimum. You. u/ n% m: H& f
  113. #        should use these effects sparingly and only activate them on events
    . r0 \" l% v- p4 e3 n1 X
  114. #        that require them.8 U5 d6 k5 U, m1 X
  115. #------------------------------------------------------------------------------#
    6 T# T3 J2 q/ P/ @
  116.   7 q$ ?: c* Q% G5 b
  117. #------------------------------------------------------------------------------#
    ; G' q* X! c0 j& r5 q
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES
    ! r- f2 m2 ?9 l- _! [' y, A/ j8 q
  119. #------------------------------------------------------------------------------#
    5 o+ f1 p: k! l! Z
  120. #
      _) N+ d2 r, x- F; Y
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default " t3 ^: c1 V/ V' E
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off 0 l3 ^0 e! o. ]3 Z
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.
    6 M0 y& ?* e& m' M. V+ E0 q
  124. #- k/ j' W8 r# z7 y1 i+ X
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects# q4 S+ E% z# W% ^) ?& \
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.
    3 {9 j4 x  S- r5 K$ r
  127. #  v_icon(x,x,x,icon_id)+ {6 Q( N5 A7 e3 F5 b* S& _
  128. #
    2 h% U9 Y# z, U, n
  129. #------------------------------------------------------------------------------#% ~) ]1 E1 N; I  Q% P
  130.   0 w, h7 H% K! @% h$ [# W$ W8 W" Z8 f& h
  131. #------------------------------------------------------------------------------#) x+ J0 v" I* `
  132. #  SCRIPT CALLS for shadow options
    8 Z# q4 X# `1 e) V& u- m$ C) P
  133. #------------------------------------------------------------------------------#$ ]* C- C1 K+ n9 @7 L3 a& A
  134. #
    ' [$ V/ ]* {) Z& A; C" @
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the ) S& z  k- t$ Y/ d9 P7 c7 H# R
  136. #                              # light source number you wish to change (for
    9 a" X) G- g* [: Q+ C
  137. #                              # more than one). These are reset on map change.
    : {* o! u: R* I9 U( V+ f
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.
    : K: G+ [  j/ Q6 y* `6 G
  139. #                              # This will need to be in parallel process if you3 a4 G( M9 R6 S% {" R
  140. #                              # want it to be a moving light.( l+ A) Y# }3 s7 F; C
  141. #
    2 S- ~, B) ^- B8 x
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below# ^2 c' d  ~( T; w8 U
  143. #  t1 U( c+ m* R, P  \
  144. #    # intensity = opacity when standing next to the light source (255 is black)
    ( r3 S0 ~  D  J* ]* d
  145. #    # fade = amount shadow becomes more transparent the further away you are.
    * V6 a. a( H0 g: G: Z5 E
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.9 y2 {2 u6 O1 O7 H3 l$ X
  147. #
    " {5 Y# w; _6 e: ]# B; H/ g
  148. #------------------------------------------------------------------------------#
    " _2 `  c8 O- R
  149. #  EXAMPLE:/ J! t8 y$ r/ z7 d) Y4 g
  150. #  shadow_options(80,10,false)    # This is the default setting.5 O4 V* ^1 I+ g9 U5 N' v8 q
  151. #------------------------------------------------------------------------------#. B& R0 W" a& v+ Z6 d1 z
  152.   
    & c9 O& P: B' q) r+ Q4 f
  153. #------------------------------------------------------------------------------#; T) O. b. h+ G3 U& b; a5 j
  154. #  SCRIPT CALLS for reflect options
    ( y( }  R9 P2 W9 O$ k9 u
  155. #------------------------------------------------------------------------------#! f9 ]( i& g$ l+ O8 e6 f
  156. #" m6 ]" Y4 k* Q1 i9 r# S
  157. #  reflect_options(wave_pwr)
    . O, \9 E5 z! e) `3 `4 @
  158. #
    . Z6 f3 P' v: b: Z5 ]" R
  159. #    # wave_pwr = how strong the wave movement is. 0 is off% X, Y7 n+ f% m0 ~4 y2 n( |0 p) r
  160. #
    ' _, m; }; V) E; j9 b' d5 q
  161. #------------------------------------------------------------------------------#+ V4 T7 D1 V  v( h
  162. #  EXAMPLE:
    5 w( Z% Z# N  u5 f
  163. #  reflect_options(1) # Turn wave power to 1' V9 m) |; x% y* z, _
  164. #------------------------------------------------------------------------------#2 c; _6 z! L5 P- U7 o
  165.   
    " k" Q. g, e" @
  166.   
    : M7 Y& Z5 K! @
  167. #------------------------------------------------------------------------------#
    ' ?2 R7 z5 a: e* @1 @" x9 N
  168. #  NOTETAG for ACTORS0 B" E5 c9 _: l7 C% V
  169. #------------------------------------------------------------------------------#1 B+ }) F  R! `  d! @- z
  170. #
    7 ?0 O5 z' V' _5 M9 t. E
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)
    % M. y0 z3 i  H6 S: m2 n
  172. #2 {' r# _) l. C, Q  D2 |  k
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections
    ( d- S% m! ^/ |+ k. i/ _" ?# O2 o
  174. #                                  # and use the character in position 'pos'2 R9 j2 W$ q: K2 u9 q
  175. #: y4 }$ g! k, @1 G# P
  176. #------------------------------------------------------------------------------#) n; S; `! l& u4 \- W& F/ W
  177. #  EXAMPLES:
    7 e3 k0 B/ A2 r; A7 ~. C+ b. o
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset1 r7 m9 M0 K; k; @
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset
    ; i3 {  V, @' B/ Z0 e6 ]: `
  180. #------------------------------------------------------------------------------#0 d2 g4 A, [, C! H$ J0 e6 v5 L, J
  181.   + q5 Y7 {; d0 C  l2 y
  182.   , P: \: i$ l+ L6 r
  183. ($imported ||= {})["Galv_Character_Effects"] = true
    * t1 s, ?  N7 ?, _( M$ I
  184. module Galv_CEffects4 ?# A: u/ D; i5 F: a8 i6 I
  185.   & f/ V1 E+ o8 D' m$ Z# c
  186. #------------------------------------------------------------------------------#  6 X2 s# r& h* e' e; B8 e" {; u7 w, H
  187. #  SETUP OPTIONS6 O& X4 w) K, U  {8 b
  188. #------------------------------------------------------------------------------#& D, D" o9 }! ?+ ?! L: b
  189.   
    1 h, R+ F' V; D" u+ g
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the' ?( M' ]# @% M
  191.                         # region on the wall you want to make reflective (and: I8 p& S7 O" h! n7 o0 w9 X  B4 X
  192.                         # then use tiles/mapping that make the parallax visible)& }, i* V) W9 b! B- F. e* t
  193.   
    / \) I, [- W! X, E
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters0 q! ?. \( y/ o8 }' Y7 K
  195.    
    . J1 d: D& g: n2 M0 G7 D
  196.   REFLECT_Z = -10       # Z level of reflections
    4 j3 H( V& Z8 c' ^
  197.   SHADOW_Z = 0          # Z level of shadows6 p0 F! B4 ?. l/ c
  198.   ' |1 s' ]( D1 Y, T) N
  199. #------------------------------------------------------------------------------#  ; r2 K; }  S, ?% ]
  200. #  END SETUP OPTIONS. I. X: c4 x0 G/ b* u2 p
  201. #------------------------------------------------------------------------------#
    ( k$ m7 K$ ?+ ]5 T6 j
  202. end/ E" x% s" U! V. z3 c
  203.   
    ' V  s# l' h2 s/ J
  204.   
    % a7 N" z) s$ E/ N* w* o
  205. ! x1 c1 M+ [+ i; @8 @& ^
  206. 7 Q+ a/ y2 d- O1 E; W( _
  207. class Game_Map$ V, x0 N9 \  z/ O4 Z" e; k% _) _
  208.   def do_icons(refresh = true)0 {, o: a( j. z+ I
  209.     @events.values.each { |e|0 D. ^/ c( o1 q9 r; X1 T
  210.       next if !e.list
    7 C7 a$ O2 w( _2 d. R  J" {% l2 G2 l
  211.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/
    2 i  y/ h( u/ J! Q- o
  212.         e.icon = $1.to_i! y& M0 e! f: ^# L, {7 Q" m
  213.         e.icon_offset = [$2.to_i,$3.to_i]
    4 f, g. c: O; H1 i3 W( _& M
  214.       else
    1 T( \! b6 {. X' S+ y7 Q+ A- A3 g
  215.         e.icon = 0
    4 v+ M4 Y" |$ p" y
  216.         e.icon_offset = [0,0]8 k, Z; q7 @+ y
  217.       end+ b7 z2 N0 K2 D3 I# J6 w% g
  218.     }
    . j9 @2 r  N$ I3 A  }  }
  219.     SceneManager.scene.spriteset.refresh_effects if refresh
    8 F* r" H  I$ ]! U
  220.   end
    % F# F7 C8 C4 S( j/ E2 n  m
  221.    3 C* W3 f2 @9 ~/ N$ q4 i
  222.    ) }2 f1 K! r2 M' b" n* U9 N
  223.   def do_shadows(refresh = true)
    3 [7 v1 u* B4 o( k' v
  224.     @events.values.each { |e|
    8 U6 R0 w! \! A' u) ]
  225.       next if !e.list. z; ?3 e% f/ l5 {& I; a. B+ d
  226.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/
    ' T+ a: f  A! c0 l9 `" Z+ B0 v
  227.         e.shadow = true, a& R2 q' ^9 `+ \
  228.       else) t1 t6 p9 w3 g1 H' o( q
  229.         e.shadow = false, x* @: u9 C4 F. Y; }
  230.       end. H+ X6 }2 ]* t) E% H
  231.     }
    $ X  m: y5 T# z% u/ _0 G6 ]
  232.     SceneManager.scene.spriteset.refresh_effects if refresh! \$ V& h# ~; P4 z
  233.   end. T( L8 a. u) D8 z1 b
  234.    
    - A1 f' O( V: \+ \4 d# b. q
  235.   def do_reflects(refresh = true)2 Y) z# q" j; V* B+ g7 E3 @
  236.     @events.values.each { |e|% {/ F) `1 Y9 Y
  237.       next if !e.list3 h- V: A4 B+ {5 H: b& y
  238.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>/  c0 h) H" m& [7 V$ P1 L4 {( T
  239.         e.reflect = true
    7 N+ m/ C" E. m) |
  240.       else
    5 e3 s# h/ {1 Z7 x- b" u
  241.         e.reflect = false
    & J1 K4 a' L" Y5 V/ |6 k
  242.       end3 a  ?4 S8 I! I
  243.     }
    : J2 _. o3 `' w+ A: U
  244.     SceneManager.scene.spriteset.refresh_effects if refresh, D4 G0 Y$ q+ k
  245.   end
    ' l: i. [1 J7 u9 }8 r$ A* x
  246.    
    : O- ^  O$ G* b) Q* f
  247.   def do_all_chareffects. T6 z! h; X! _7 Z0 c: ]* F
  248.     do_icons(false)
    6 h, I# X# O' W$ G! l
  249.     do_shadows(false)
    $ I: u5 `2 @9 }5 J, k7 j, F/ m
  250.     do_reflects(false)/ ?1 U2 X9 P. o: b" d' Q1 P
  251.   end6 B. _% y) E  Y" B1 t5 C8 l
  252.    - N. F+ l1 @: l
  253. end # Game_Map
    ( S1 H6 W6 b' j* s) L! t+ F

  254. * S' }* A( D' m4 K& h/ ?& d

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

使用道具 举报

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

使用道具 举报

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

在本发帖返回顶部