设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1214|回复: 2
打印 上一主题 下一主题

水面动态倒影,求解

[复制链接]
梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
帖子
7
跳转到指定楼层
1
发表于 2014-6-25 11:31:39 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
代码复制
  1.  
6 U, p  j2 ~: ^2 ?) R! E* X; ^7 z
这个代码怎么用啊,有大神知道吗。我从国外找的。; y& }1 R7 m0 ]$ Y0 N
http://galvs-scripts.com/2013/02/21/character-effects/5 c# `( U1 v9 v
是关于动态倒影的
梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
帖子
7
2
 楼主| 发表于 2014-6-25 11:32:43 | 只看该作者
  1. #------------------------------------------------------------------------------#
    0 v7 T2 b/ P. [' G3 x' x- U) J
  2. #  Galv's Character Effects
    : E0 z  a$ e  [: H2 m% m1 D" Z
  3. #------------------------------------------------------------------------------#
    ! O' j+ ?7 A2 h5 v
  4. #  For: RPGMAKER VX ACE- {5 W4 g# ?+ W% e6 ?
  5. #  Version 2.1
    " g4 S' b- N: y% a, R
  6. #------------------------------------------------------------------------------#
    " }) r0 N+ u" m7 _! y' j$ b# q
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows( b2 d4 Y$ U' P7 j
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects
    & U3 \  Y) P1 U4 D9 |0 Y
  9. #                           - Fixed shadow facing bug% u' J: d8 G- i2 K/ X5 ^8 `7 [
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows
    6 x. i  t) M5 I4 C" |8 M% m
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows
    & ^3 r5 M" O! i- C! K* h
  12. #  2013-02-22 - Version 1.7 - bug fixes  V2 B4 y, f' w' `7 m& g6 o: O
  13. #  2013-02-22 - Version 1.6 - added icon effect8 f1 @0 V- j( P4 i& V# u
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps: r  U3 m4 \" }$ C% d2 V
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles
    ) P# D, e; r' B# i3 S" M
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks
    ; K2 o6 d# d5 u+ P# p- ^
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)- ?8 l8 B- W4 U9 z
  18. #  2013-02-21 - Version 1.1 - updated flicker effect
    ! f, y! y# X8 \; G: x
  19. #  2013-02-21 - Version 1.0 - release% z% e5 R( \$ S2 M/ ~( E/ }
  20. #------------------------------------------------------------------------------#
    9 {* h5 O* |! U
  21. #  This script was made to provide some additional effects for characters such, b! g2 O$ r# Y2 H! Z- ]% u& c
  22. #  as events, followers and the player on the map.
    4 u: N/ U' x5 d/ |. y( y" R
  23. #  Currently it includes:  Z1 C8 b0 a& M
  24. #
    7 b  e% i+ r( G, o
  25. #  Shadows
    * v: H+ J8 V2 i) R0 p2 ?+ s
  26. #  Shadows that appear under player and events in a directions depending on
    # j4 }: R0 u$ K% F
  27. #  a light source that you choose.7 ~3 J5 U" ^6 @+ r/ ^! @; I
  28. #
    7 [* M4 q. e5 c' G& _  c" X
  29. #  Parallax Reflect4 a+ N5 H9 T; e5 g( f! D. z
  30. #  Reflections that appear on the parallax layer for events and actors to be
    " s5 V- g- d( l5 T- U
  31. #  used for things like reflections in the water or glass floor etc. To get! B& r. i! s1 C) u
  32. #  effects like the demo, you need to edit the charset graphic to make the water8 @# |/ g- c3 M* @3 @$ H
  33. #  partially transparent.
    3 W6 h4 e3 o6 ]# |. {4 }/ A" P8 R
  34. #3 p8 o+ P; {: v9 m- D$ L
  35. #  Parallax Mirrors% ^" J' h# d* i! i9 G  B  S1 U4 j
  36. #  Much like reflect but are instead actors and event are reflected in a mirror
    $ b; O( U! K4 n8 n2 S
  37. #  on a wall designated by a region. Both mirror and reflect effects can be, E$ v% o$ R# I0 V: g. o
  38. #  changed so actors and events can use different charsets for their reflections
    / _4 K* Z+ l  o: S9 Z
  39. #
    - E- x: b0 ^: s- y( r* C% `
  40. #------------------------------------------------------------------------------#
    9 v* J5 ^/ ?  I/ N! A/ m
  41.   % D( k% K, b) X) X6 R: o* s

  42. * b; {. S8 O! N7 {8 Y  o& M% ^' b  F
  43. #------------------------------------------------------------------------------#
    # I. ?7 Y0 X" K; T- F! c5 {
  44. #  NEW - First event command as a COMMENT
    . y* z3 E) ?. i8 ?. n) ~  m4 o
  45. #------------------------------------------------------------------------------#
    7 H4 @) j8 d" A$ T- q0 \" V1 Z! T
  46. #  You can add a comment as the first event command on an event page to set if
    ! G. A5 F3 J- t+ O5 i
  47. #  that event has an icon, shadow or reflection active. The tags to use are  h& @) O+ g: P+ C$ z+ D
  48. #  below, all must be on the same line in the comment.
    ' R4 c# [9 y; ~" C0 w; m: n
  49. #
    ! b: X/ G" v" j* W# B% f+ l
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)! A/ K1 L6 g- i' s) P3 Y
  51. # <shadow>           # set the event to display a shadow
      e- N. v" J7 m' ^' L$ u0 B" o
  52. # <reflect>          # set the event to display reflections7 I  z( I  C+ F- k# b. G/ p5 ~/ B
  53. #: |+ f) b( w7 y( S! _4 q
  54. #------------------------------------------------------------------------------#$ ?$ g+ Z8 o6 r8 A$ [$ e, |
  55. #  EXAMPLE:
      R6 C9 `# r: Z0 I/ M' r
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event$ @: ]" n, u$ h
  57. #------------------------------------------------------------------------------#
    ' ^: Y! D; U+ b6 L# i# P8 W
  58. / Y$ K) M" x' w8 N
  59. 1 u+ q, O' H) l/ e0 K
  60. #------------------------------------------------------------------------------#* X; m! O# ~% ^. z: C
  61. #  SCRIPT CALLS:3 z6 K3 X/ y4 Q9 F, k
  62. #------------------------------------------------------------------------------#) t1 W0 j8 X& V0 [+ [. J
  63. #* B2 @" s# O  R4 q+ R
  64. #  char_effects(x,x,x,status)- _, d( i9 p7 f5 h2 Y) @, w! ?
  65. #! [! J/ S( p  k3 P
  66. #------------------------------------------------------------------------------## f' J$ B( w. |* j7 R1 |
  67. #  # each effect can be true or false to enable/disable them during the game.1 u8 x. @) o" M& Q2 U+ _3 H2 C
  68. #  # you can change multiples of effects at once, x being the effect number$ [) L2 M. v! I+ t$ T% j. p# Y5 i8 I
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons7 y+ ~( f2 \' O1 U; Q- q
  70. #------------------------------------------------------------------------------#
    0 |2 Q. ]0 U8 z( \; D
  71. #  EXAMPLES:
    & m( T% Q+ C) `  ]& O
  72. #  char_effects(0,true)              # turn reflections on/ ^9 m& e: Z( s8 I
  73. #  char_effects(0,2,true)            # turn reflections and mirror on! K- i8 l% K9 D, R0 [
  74. #  char_effects(1,3,false)           # turn shadows and icons off: j4 M0 u( C# q0 g$ b3 ~
  75. #------------------------------------------------------------------------------#
      R5 u2 I7 g+ a( T3 a3 N; M
  76. #2 b( E: o& W* r" e
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset" x* x& O5 k; [' o
  78. #
    " S( T! t9 b* I3 h. b
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset- ?7 C! a+ X) S, w! k' ]% I1 X* U' R. ?
  80. #7 p" {: V3 u1 b$ {9 J& C1 j
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset" ^, K) F6 ~' ^3 \" h
  82. #: d/ o' C" h6 x. l$ [2 a
  83. #------------------------------------------------------------------------------#
    ( h8 P2 e7 L! s1 S4 O
  84. #  EXAMPLES:' z) x+ W! L( K& a3 U
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite
      O+ q2 |0 i$ N
  86. #                                    # in position 2 of "Actor2" charset.# b* |, t; E' d+ I4 l& G4 A- p1 b/ Q
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of
    . R  `/ N4 s/ c5 ~
  88. #                                    # "Actor4" charset.
      g0 w8 v$ c+ h0 G4 ?
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of. M2 O# a  N$ \5 U" Z
  90. #                                    # "Vehicle" charset.' C! J' _; r* |/ q4 N, |; Q
  91. #------------------------------------------------------------------------------#% S8 a9 Y" K" `# i. t/ j, ?$ I  \9 k
  92.   
    4 l8 V, G7 ~8 B' C! I
  93. #------------------------------------------------------------------------------#- R8 p3 p0 |# t; g9 t& |8 g' u
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS
    2 u5 X; `8 E8 F" o
  95. #------------------------------------------------------------------------------#
    * b: R$ l/ N  }9 a, [9 Y. D1 D
  96. #
    ' \' L+ a+ s. ^2 a5 z- t
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off) i3 K& n) p. c3 H* M2 G7 ?
  98. #                          # use this to specify for mirror and reflect.: G* U( y1 D% V: X
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change
    6 y: ~# u9 U+ @3 _. e
  100. #                          # to change all events use :all8 G# Q# w% m: L0 G  A, B1 n
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make, J2 H( p" e' w, A+ z
  102. #                          # it 0 for no icon.
    ( {' Q- c" W3 b6 \
  103. #
    2 Y0 b9 x% [/ C
  104. #------------------------------------------------------------------------------#' o( ]/ t$ V3 V  ~" b* Y( p) E- ~
  105. #  EXAMPLES:) d3 N$ Q: G; V$ v
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON
    - W* ^  i" M1 r- a1 m
  107. #  shadow(1,false)         # Turn event 1 shadow OFF; d4 }3 ]$ F3 u/ ?
  108. #  reflect(:all,true)      # Turn all event reflections ON
    : T3 A, S* }4 ~0 ^
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear
    # b1 p8 f0 T, u
  110. #8 i0 |3 L/ O; y: B9 A9 w+ Z
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering9 a3 ~; r/ E0 g9 x- r+ V* K
  112. #        a map. This is a design decision to try to keep lag to a minimum. You
    5 B8 p( Z' G' @- i, z3 g: C; o, n+ C
  113. #        should use these effects sparingly and only activate them on events
    " b# V" G' ?7 Z& h% |" u) S! p
  114. #        that require them.
    $ n; A( X4 X9 H0 U1 D
  115. #------------------------------------------------------------------------------#- F' P& D6 \6 o0 Z3 V, A8 A1 B
  116.   & Q1 g, T! F( T& l% M9 p2 x9 r
  117. #------------------------------------------------------------------------------#
    8 {, [. L4 Y- k: o  w! D9 d
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES) H% d# E2 B  v: i2 T/ G
  119. #------------------------------------------------------------------------------#: K# a  z- O; g) c9 a$ i9 y
  120. #! H3 g/ f' L* Q, y
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default
    ' |$ Y9 W" j  N4 g% X
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off
    % a* d; _" z# n6 |/ A9 M  c' n
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.0 r' t- g7 G1 T$ m8 C& J- @
  124. #7 f- [; m, q. }, d; W, X3 j
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects$ r4 g, p/ q+ {$ l4 a
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.5 P. X0 q) j. M
  127. #  v_icon(x,x,x,icon_id)
    % q; a7 B$ ?- x9 J: x
  128. #, ~! q$ W, O1 ]( O* K
  129. #------------------------------------------------------------------------------#9 M' s; N% l8 L  g1 F7 K
  130.   
    ) a' }# O  x: m& y8 K+ f
  131. #------------------------------------------------------------------------------#; i0 S, s+ }2 L* }' [
  132. #  SCRIPT CALLS for shadow options, h: i4 v% X) o" K
  133. #------------------------------------------------------------------------------#
    6 i2 ?+ N  m0 S8 ]
  134. #3 [4 n, Y! X0 m! q1 z
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the ) b) B. H  S* Q* C, I$ s! l7 S/ T
  136. #                              # light source number you wish to change (for1 c. F# j6 C+ v) {' ^5 C  K* j
  137. #                              # more than one). These are reset on map change.5 [' K& F5 c% B6 h4 L- H2 s
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light., N- R  j( e: \
  139. #                              # This will need to be in parallel process if you
    1 @1 a+ w1 D8 J+ Y
  140. #                              # want it to be a moving light.
    7 q1 ]$ W( X/ W" B$ }
  141. #7 L. U. B; T: {9 q+ O
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below
    3 S' B  t7 H. I0 o
  143. #
    8 g. W2 N  w/ L3 t! P
  144. #    # intensity = opacity when standing next to the light source (255 is black)
    5 o3 Z! M* f7 s2 V' _& `* R
  145. #    # fade = amount shadow becomes more transparent the further away you are.  `3 ~; O8 ^8 t& Y, a# R
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.) l6 d* m" x3 a, m9 ~
  147. #
    4 y$ `. S2 R% y4 k5 K
  148. #------------------------------------------------------------------------------#
    ! h' q& a+ S2 d0 n; c
  149. #  EXAMPLE:
    / O' @$ ~/ U: S
  150. #  shadow_options(80,10,false)    # This is the default setting.
    3 h' ?% d) W3 z9 h# \& i; m
  151. #------------------------------------------------------------------------------#; x9 M# N, u; z% }8 h/ d* z" i
  152.   
    ; _6 Z5 I; m- K
  153. #------------------------------------------------------------------------------#5 Q0 w: ~, h% M5 h
  154. #  SCRIPT CALLS for reflect options( p$ c3 x/ s) c$ w  a" J
  155. #------------------------------------------------------------------------------#
    ( o; h8 I* D$ t1 D" W
  156. #: g+ ?( i- L1 @/ d
  157. #  reflect_options(wave_pwr)
    - T- B% W7 I, Z7 [/ e# J0 I
  158. #
    , c( l) d- i, v3 m/ z
  159. #    # wave_pwr = how strong the wave movement is. 0 is off
    ) T; V  ?" ]% H, `; B1 G1 ^
  160. #
    2 A$ M5 E0 h7 O( M
  161. #------------------------------------------------------------------------------#- M# R: O$ F" K9 a" S
  162. #  EXAMPLE:& |! s  x8 q+ W/ @: I
  163. #  reflect_options(1) # Turn wave power to 19 e5 C' N0 C. M1 o) x2 u
  164. #------------------------------------------------------------------------------#
    ! v- p5 i# A7 W
  165.   
    ' H; I3 O- M* u, ^; S: v( {9 u
  166.   
    * R0 \% J0 }+ E' P$ l9 k4 a% z1 n
  167. #------------------------------------------------------------------------------#
    $ f! q" e4 W( k. r5 w( y4 o
  168. #  NOTETAG for ACTORS
    3 h9 L1 \8 L1 u
  169. #------------------------------------------------------------------------------#
    0 }: e4 l2 Y2 x* c
  170. #- Q& x" N+ d- N  u  J. D
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)3 N1 U. j$ I" W+ L( B8 s1 m
  172. #
    & h5 s0 k9 t9 H4 c% H
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections- E9 x3 e8 B* S
  174. #                                  # and use the character in position 'pos'
    7 w0 {5 F2 t" V& n0 u+ @$ c
  175. #
    7 z. i$ b( E4 }+ K
  176. #------------------------------------------------------------------------------#& n6 `" F; P2 }6 N5 z) M6 _
  177. #  EXAMPLES:) N: t3 v4 v- w
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset
    2 K7 v( }% O4 E; \; T( V
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset
    # C; O) _) a" m% N
  180. #------------------------------------------------------------------------------#
    ; ?, e: q" j' B3 S! |
  181.   
    + F( G7 U0 E0 z1 Q0 e
  182.   ' A- [/ x/ Z% o1 L3 E* \' t
  183. ($imported ||= {})["Galv_Character_Effects"] = true
      J: f, p" t/ F1 R$ j8 K, S( a& y
  184. module Galv_CEffects
    ' Z  j/ M+ X. E
  185.   
    3 {; R  y" E! f
  186. #------------------------------------------------------------------------------#  1 z7 a% D+ x* Y+ P/ `( t
  187. #  SETUP OPTIONS
    ! C% {0 _# c  c$ V: {
  188. #------------------------------------------------------------------------------#
    % ^1 ~0 O2 i+ n% V9 \( {
  189.   
    # Y" C% `* d) T
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the
    5 Q6 `5 @3 H. G& L
  191.                         # region on the wall you want to make reflective (and. H8 z( j) a$ e* O5 M: }$ z* u+ e
  192.                         # then use tiles/mapping that make the parallax visible)$ C- Z4 x2 ^+ J
  193.   
    ! F2 A" Y& e' X
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters) O. u3 o, o. G1 C+ S1 O/ |
  195.     8 k$ Y* G) u$ o4 E1 I
  196.   REFLECT_Z = -10       # Z level of reflections
    + K; c/ `' V3 {, ]( p
  197.   SHADOW_Z = 0          # Z level of shadows
    ' `/ {: C( U0 V3 o+ e( ]- B( j
  198.   ; m( o; N0 G1 l" z
  199. #------------------------------------------------------------------------------#  
    ' E& l7 R6 L# ~. p1 x$ ?
  200. #  END SETUP OPTIONS
    : m1 J0 L9 @  O4 _# q' ~" v( y; o
  201. #------------------------------------------------------------------------------#% X. Z6 H9 {$ p) n6 K2 u
  202. end$ y, N! [' g6 N  H% Y
  203.   5 Y& X) Z" R* N' v+ O" i
  204.   ' f* B( c! t- _
  205. 0 e2 |" o7 j9 O; b7 F
  206. ) S0 [2 G+ k' ?. L6 M
  207. class Game_Map4 D0 \' G* |! J( J- B' J
  208.   def do_icons(refresh = true)3 x! G, D( p+ F9 T) |7 p
  209.     @events.values.each { |e|
    ( o2 `' K. h$ M- \
  210.       next if !e.list
    5 w) P0 ]5 j* P) g0 b. s2 R
  211.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/
      F; F5 J7 S! A5 S+ t
  212.         e.icon = $1.to_i
    2 q# m9 Q  B& a5 ~
  213.         e.icon_offset = [$2.to_i,$3.to_i]" g, }5 K" T/ X" h
  214.       else
    . G6 M6 @* b& p: K" a& M( Y8 \
  215.         e.icon = 02 f" }& l1 z4 W9 k* A; S
  216.         e.icon_offset = [0,0]) g. A' m% |+ Q
  217.       end
    - \1 B' H& z! n- q2 l
  218.     }
    1 Y8 l* B! F2 G7 a6 E
  219.     SceneManager.scene.spriteset.refresh_effects if refresh
    # H; u& `0 v' f. b
  220.   end1 F4 t+ |4 i4 W) |9 J
  221.    ; X+ l0 R$ Z- ?
  222.    
    8 {! Y* l+ V0 }1 @- k! y
  223.   def do_shadows(refresh = true)
    - `8 I4 k. g& m% u, \' {
  224.     @events.values.each { |e|
    0 s5 N3 v# I, ~& }+ N  H
  225.       next if !e.list/ R* c7 k: t& N& A% K
  226.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/
    1 @1 w# G. }0 e& B1 o/ B
  227.         e.shadow = true
    " k2 G6 i9 Y0 F% |$ h8 I+ E! `
  228.       else
    , m. |. {0 F0 a  ?1 r# y' V
  229.         e.shadow = false
    3 }. D+ O" o. r" k
  230.       end
    % @. O3 `+ ~: V8 q7 z7 x% z5 q, H6 N
  231.     }
    * _8 Y2 {  f/ A' k  h1 n
  232.     SceneManager.scene.spriteset.refresh_effects if refresh
    ( a: {: X) y; ?" o2 y8 d/ z' k' u
  233.   end
    8 f7 p* N! _9 t
  234.    
    ( Q% H0 C6 c( q2 z! n+ r( p
  235.   def do_reflects(refresh = true)6 v7 z# Y, @3 M4 c# t5 ]
  236.     @events.values.each { |e|
    . F" T# `5 r# ?) N
  237.       next if !e.list
    0 L' v# ~1 ~( A7 J! p# m
  238.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>/# z" o" d/ ]% I
  239.         e.reflect = true
    2 Q7 v- f  A, }1 L4 n' }$ F) ^2 b
  240.       else: L3 [3 O9 |, s+ n7 i! M
  241.         e.reflect = false
    . \! M% w+ V2 x0 q; q
  242.       end9 O: Q) P6 w" t
  243.     }
    4 `& r$ a2 _9 m, w, p$ R) O
  244.     SceneManager.scene.spriteset.refresh_effects if refresh
    - R1 @# k* M2 r! Z: m
  245.   end
    2 p, O) S) ?/ `+ ^& ^0 t
  246.    4 R: q7 y% g) c# t
  247.   def do_all_chareffects
    , Z0 ]. a- W, D. i# T4 ]$ y
  248.     do_icons(false); T' B' x2 a* y9 M! Z7 G3 V
  249.     do_shadows(false)
    $ e0 w6 J/ o( ]( C# z
  250.     do_reflects(false)
    : j6 D+ }! H+ F
  251.   end) T& T* c3 }) p- q0 p7 Q5 r
  252.    
    . s6 b/ t; ]3 a3 U3 a  B/ X
  253. end # Game_Map
    9 i* @$ @9 k; E7 y2 j
  254. ; _$ N( m$ g  o2 J) ?9 f

  255. $ E2 H. K9 W2 ]

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

使用道具 举报

梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
帖子
7
3
 楼主| 发表于 2014-6-25 11:35:49 | 只看该作者
记得口袋妖怪的池塘是有倒影的
回复 支持 反对

使用道具 举报

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2025-7-5 03:04

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表