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

Project1

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

水面动态倒影,求解

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

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

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

x
代码复制
  1.  

8 W2 y/ |8 K& \3 z+ D9 |5 R: `这个代码怎么用啊,有大神知道吗。我从国外找的。9 i6 c; k9 T# c, ~( G. c
http://galvs-scripts.com/2013/02/21/character-effects/
/ N& o+ J( H' b5 x  k5 O是关于动态倒影的
梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
帖子
7
2
 楼主| 发表于 2014-6-25 11:32:43 | 只看该作者
  1. #------------------------------------------------------------------------------#
    " m1 @4 v/ @8 G( p
  2. #  Galv's Character Effects
    ! j9 i, |* r  Q7 z
  3. #------------------------------------------------------------------------------#" g2 e0 V! X. |
  4. #  For: RPGMAKER VX ACE5 a. E' [& F' X' p* g, c- P
  5. #  Version 2.1
    5 X' s3 k6 F- Y
  6. #------------------------------------------------------------------------------#
    " ~8 _9 c) \% ?1 g* V
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows
    & M7 f! K. W3 `1 Z0 a  @7 t$ Q
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects
    - Y. [7 v/ m6 y+ F5 \5 |2 U7 p7 a
  9. #                           - Fixed shadow facing bug+ q2 U! l5 D, f$ O, x) d1 g
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows3 M  A- C' ~$ h5 W7 ?( Y/ X3 ?
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows! L, ^$ E( ]& p! f3 ?9 P
  12. #  2013-02-22 - Version 1.7 - bug fixes
    . h# v3 D9 i+ \' `% E
  13. #  2013-02-22 - Version 1.6 - added icon effect
    0 g/ K3 ?- k* U$ x) f
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps
    0 j; I/ ~6 |: q$ z: Z! M; s
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles! d0 O0 E4 ~' m, J4 r
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks, h5 D& r# F. t% S
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)  d- B# O9 V% M+ w# A0 c( m$ E
  18. #  2013-02-21 - Version 1.1 - updated flicker effect
    : o5 w0 ^( P0 N" \4 f" H
  19. #  2013-02-21 - Version 1.0 - release
    ( _8 @, c! B! Z0 e( Y
  20. #------------------------------------------------------------------------------#8 k. `( Z/ _% ?5 H5 |/ r
  21. #  This script was made to provide some additional effects for characters such( S8 p  t+ i% R2 ^. v
  22. #  as events, followers and the player on the map.' i- ?3 H4 X& ~# q# k
  23. #  Currently it includes:2 U0 |- C" P: b$ s7 W! Z' z
  24. #9 B2 S$ Q2 g3 h$ e* D
  25. #  Shadows/ B# `; {8 ~. ^; r- C! \
  26. #  Shadows that appear under player and events in a directions depending on
    2 Z  M* x5 D9 ^# @9 G5 c
  27. #  a light source that you choose.: M* |3 N& M  v9 }
  28. #
    * R( Z6 s2 l& c( a+ l5 K
  29. #  Parallax Reflect" _/ b/ ?' y2 ^" u0 Z* ]# X& W
  30. #  Reflections that appear on the parallax layer for events and actors to be# X( i+ F( s, a% N9 k! ?7 `5 y
  31. #  used for things like reflections in the water or glass floor etc. To get
    # s, T  w( w1 D& z# m1 |
  32. #  effects like the demo, you need to edit the charset graphic to make the water) B3 B  E; z4 N9 ~
  33. #  partially transparent.  G. r# [& ?1 T( X( F( e
  34. #
    ( @  M- _4 \) x5 y" ^
  35. #  Parallax Mirrors: r" [! {, S5 S3 q; y* K
  36. #  Much like reflect but are instead actors and event are reflected in a mirror
    8 t. t  e  \. r
  37. #  on a wall designated by a region. Both mirror and reflect effects can be
    " F4 u" s6 w% O6 [& ?2 [- U
  38. #  changed so actors and events can use different charsets for their reflections
    : w& C) B+ r4 S& ^* Q
  39. #% ?% H5 U% e1 b$ B/ t  Q9 j7 ]
  40. #------------------------------------------------------------------------------#6 B9 T4 }5 m2 u: U
  41.   : `' {; ^- D1 L1 e. S! f
  42. * {# I& v& w) H, J0 E+ r
  43. #------------------------------------------------------------------------------#
    - S' N% P7 O- x
  44. #  NEW - First event command as a COMMENT
    ; N7 r, E; c9 M. p3 [6 Q( F; Q
  45. #------------------------------------------------------------------------------#. X* G. j+ v8 _/ q: w# D
  46. #  You can add a comment as the first event command on an event page to set if
    ) K( i5 U. l% G  l7 N" }' o
  47. #  that event has an icon, shadow or reflection active. The tags to use are
    - A) G  Y( p& \9 ~% ^
  48. #  below, all must be on the same line in the comment.& H' N" z9 d9 d* \# c
  49. #/ A% F, n2 j7 \. o8 s. u' ~
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)
    . n1 P: m- @, b
  51. # <shadow>           # set the event to display a shadow, |0 l/ `* D+ q( ]/ w( T% D3 q
  52. # <reflect>          # set the event to display reflections2 J, K" {  z8 p
  53. #
    ! B+ W$ p- r$ I2 Y4 J
  54. #------------------------------------------------------------------------------#
    - s8 k. Z' J' L0 T& |$ B6 |
  55. #  EXAMPLE:0 F# Z+ m3 `: o& w- B& h# ~
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event+ i8 j' f$ Q+ U' }: P- B) G4 k
  57. #------------------------------------------------------------------------------#. ?6 ^; E; e, ~2 g5 C
  58. 0 K4 J1 W( E9 e& C- e% Q; c. P' m

  59. & t( D8 [" M9 B9 Q' {6 r* ?% X
  60. #------------------------------------------------------------------------------#& h& a( b8 E. Q$ j% Q/ x1 g+ m
  61. #  SCRIPT CALLS:
    . q  g" f% L% M
  62. #------------------------------------------------------------------------------#' w3 u! H6 O. }% ?3 z1 b
  63. #5 y* i% Z% j1 w; o- z1 f
  64. #  char_effects(x,x,x,status)
    $ R+ u, @' a1 e2 l/ S
  65. #
    " u' `, O: g' H7 p7 g
  66. #------------------------------------------------------------------------------#
    6 c4 `" W& X  X9 D. o
  67. #  # each effect can be true or false to enable/disable them during the game.
    9 P; R1 B) z2 ?" R  R, [) y
  68. #  # you can change multiples of effects at once, x being the effect number
    / t# N- H6 v2 a% P+ }/ X
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons
    - \( P7 g* y& Y$ D/ r! r4 C
  70. #------------------------------------------------------------------------------#+ A2 ^/ V* E/ `8 \
  71. #  EXAMPLES:# h+ m1 ]: F" s) b
  72. #  char_effects(0,true)              # turn reflections on/ O" d( L; S4 _2 F, O/ m* h
  73. #  char_effects(0,2,true)            # turn reflections and mirror on
    8 A% `% g6 T- f  g
  74. #  char_effects(1,3,false)           # turn shadows and icons off; I9 `+ E$ m6 a' q; }
  75. #------------------------------------------------------------------------------#5 {( n  l6 {! S" H$ C$ j  \1 C
  76. #5 O4 F, g0 }3 o9 R' Y( I' Z# h8 [: T
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset
    " y, j' A; V' h/ B5 d
  78. #
    8 T6 M$ t1 h( `  s, O
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset
      b0 i, \% s4 w4 c) q2 N
  80. #
    7 P5 L2 d' i9 d) i- m; k' t
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset
    6 u' m! s" X, F% U
  82. #
    ' {3 h) G0 E2 r+ b; n' e
  83. #------------------------------------------------------------------------------#
    ; S# |) S) B5 N8 j* F" l
  84. #  EXAMPLES:
    " Z. C4 _) a& ]& o" I6 a
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite+ d! d9 l1 w. S' D& U5 q1 \
  86. #                                    # in position 2 of "Actor2" charset.
    1 y* b4 j, _3 v- [
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of
    ! N- k, N1 f" z" X/ }+ N
  88. #                                    # "Actor4" charset.( B; ~! O: S' h; @3 @% E: p
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of+ z7 d7 s/ o3 G5 U7 y+ F
  90. #                                    # "Vehicle" charset.
    ; \2 ~; l: C/ h7 B1 y% s7 z% U
  91. #------------------------------------------------------------------------------#
    ( L0 O: b( X+ s7 L( ~
  92.   ) f3 K& d9 q- w2 ]
  93. #------------------------------------------------------------------------------#$ p4 b' Y% i% _1 N) [0 ?
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS
    0 X, ^# `1 `6 {; ?" _
  95. #------------------------------------------------------------------------------#( \  X( q/ K6 `% l# k: L+ h
  96. #6 F3 c6 d+ M) T3 Q* s: r8 j
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off
    7 u3 u% ?5 R1 ^7 C0 B/ p
  98. #                          # use this to specify for mirror and reflect.
    9 M+ T" J0 _8 J1 ]) Y. v  ]
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change- F9 L! ]/ l' n
  100. #                          # to change all events use :all/ K2 M& f3 Z7 @* q; m- T' L
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make
    6 Y0 p7 `3 f6 H$ h9 f' u+ W
  102. #                          # it 0 for no icon.
    7 @; e9 d+ e0 H
  103. #2 |! S5 a. f$ ?9 o" D/ p/ N* c
  104. #------------------------------------------------------------------------------#- [0 ~& q" d1 H* p( |
  105. #  EXAMPLES:+ l& j- D- z* u8 x
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON) X7 D( C' x7 {5 W9 g5 f
  107. #  shadow(1,false)         # Turn event 1 shadow OFF# s; w, a: {9 b# \! `3 V2 j5 A
  108. #  reflect(:all,true)      # Turn all event reflections ON+ I; F. m0 z2 ^  F
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear
      q4 {/ l# [7 k; K2 J, u3 g2 l# y
  110. #- r5 V0 T7 ~. W
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering
    2 Z2 w9 \' ]" q6 _3 A' I( ~  K5 w
  112. #        a map. This is a design decision to try to keep lag to a minimum. You  q: R/ O4 U1 k( T
  113. #        should use these effects sparingly and only activate them on events
    1 q6 }, |+ z5 g7 n% `& D
  114. #        that require them.
    8 ~+ v3 E3 P: x: D. g) N
  115. #------------------------------------------------------------------------------#8 N* O3 L  A6 X6 ]* z5 y
  116.     P% v- j$ ^! v" J7 s% E' L
  117. #------------------------------------------------------------------------------#* J/ G1 ], K8 d
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES
    5 S6 q" J  G' p
  119. #------------------------------------------------------------------------------#3 K/ e) S& C- n5 F. t' Z
  120. #
    ! \6 {! W7 Y  P3 n
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default 4 n3 W9 X# f4 g' I
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off
    # e4 f5 z' C) W, D/ r
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.
    / U' S3 _: Y, c) {& u; r  Q6 {
  124. #* X/ H% t: P3 w% B1 s, Z  O$ n# u% y
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects
    , E  M5 ]! ?; i+ s1 A
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.9 T$ ^9 V5 }0 G6 F; c9 d/ P
  127. #  v_icon(x,x,x,icon_id)
    # U; }6 F  n. B3 ~$ e1 o/ `9 [
  128. #
    2 n1 F) b$ ]- K. k4 d# G+ f
  129. #------------------------------------------------------------------------------#" z# n% G: }; [4 P2 ?3 R
  130.   
    ' M; U) g/ O9 p! K1 ?& B; h
  131. #------------------------------------------------------------------------------#" k" z8 p7 t% E) w& F* [
  132. #  SCRIPT CALLS for shadow options
    + x+ s9 t3 r% [5 N& j  _
  133. #------------------------------------------------------------------------------#
    4 \" [% ^# ]+ k$ {: }/ B
  134. ## J# |1 G; a3 }  O
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the $ j; s3 `% Y4 b6 u; K! j! o. E
  136. #                              # light source number you wish to change (for2 y& Q/ B& h: t$ [# Q& h
  137. #                              # more than one). These are reset on map change.! d  n+ a) u! u7 u% x4 I
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.
    ; }1 c$ E3 z  N2 c: P
  139. #                              # This will need to be in parallel process if you
    ; w/ c( G8 R' L" v  G
  140. #                              # want it to be a moving light.
    & N2 v. ^, e) P' S# y5 F) m
  141. #
    : `* i$ w, w( {& Z
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below0 c3 }" P* K1 H$ m5 \% W. ?
  143. #) k3 h. y" M9 U( @6 v' \! J( T
  144. #    # intensity = opacity when standing next to the light source (255 is black)4 c9 u7 y: Z# \9 }" l
  145. #    # fade = amount shadow becomes more transparent the further away you are.
    , h( ?( O5 E# N6 P! o
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.- I; b/ g6 O9 \0 U
  147. ## R+ @+ w# P2 |1 n/ k1 m1 P: N
  148. #------------------------------------------------------------------------------#/ f1 u3 q* R  U+ [
  149. #  EXAMPLE:; [8 ?; t6 ~* D+ x4 a: P* Y
  150. #  shadow_options(80,10,false)    # This is the default setting.
    2 F* `9 k! M9 M8 |
  151. #------------------------------------------------------------------------------#
    1 Y! [7 `0 \/ F3 w/ G7 x) R$ C
  152.   . V1 \5 ^, A( Z% h9 y, r
  153. #------------------------------------------------------------------------------#
    9 {; Q1 x* Y' H$ U: O7 E6 P
  154. #  SCRIPT CALLS for reflect options& a- n% p7 L0 v" s* W
  155. #------------------------------------------------------------------------------#
      Y/ u/ h, X9 F! n+ l
  156. #6 @* N8 h6 h% k2 d: u
  157. #  reflect_options(wave_pwr) 5 h- p; P$ b$ h" {  I
  158. #
    9 {8 Q% Q3 [( D& x9 G
  159. #    # wave_pwr = how strong the wave movement is. 0 is off
    - ~  s" c5 g5 D5 x
  160. #- g6 F8 F' Q  V0 C- _
  161. #------------------------------------------------------------------------------#+ r% W% v# M  D9 y0 l
  162. #  EXAMPLE:8 u+ i9 b% {9 b9 R
  163. #  reflect_options(1) # Turn wave power to 1
    " `( Y+ N* h) T! L
  164. #------------------------------------------------------------------------------#
    , n1 }1 L3 d2 Q
  165.   
    + n5 N% m$ m/ W% y. J: ~! t
  166.   " H8 P: l% S& k
  167. #------------------------------------------------------------------------------#' l" ^4 [9 m* D+ h0 E8 M& k
  168. #  NOTETAG for ACTORS
    # y/ U4 F! R9 {4 S8 E
  169. #------------------------------------------------------------------------------#, G* e( K& I. R: l  ^+ G  H
  170. #$ {0 v+ C& z2 H4 s1 k
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)
    9 _$ K4 G% ?# J1 O4 b
  172. #9 V7 l* y% H3 D% k4 N- h
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections
    7 z" C1 t, h  J+ \0 H
  174. #                                  # and use the character in position 'pos'
    ; p5 `: T% w5 R; D- ^9 f/ U' @
  175. #
    ! ^5 s  W( [5 g0 s# h( h2 m
  176. #------------------------------------------------------------------------------#8 y: l; k  B! ^( x" }# N
  177. #  EXAMPLES:1 M  ^3 R* ]; \: c& R' T: ~
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset
    , c1 L5 ?7 m$ S  J% _
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset0 J6 W- R- r  t- a4 F9 g) t
  180. #------------------------------------------------------------------------------#
    ; H$ K* Y% N% F" L! W' `9 q! J1 @; Z
  181.   
    8 _1 q! [$ j: O5 }7 D% C4 U
  182.   ) ~: @- z) h( k4 l: J
  183. ($imported ||= {})["Galv_Character_Effects"] = true' E* t4 N/ Q, J9 N
  184. module Galv_CEffects$ i6 K3 z& x  \0 s$ t3 V
  185.   
    6 F8 r. S( O) t6 K: I4 _% m
  186. #------------------------------------------------------------------------------#  
    % p6 F8 g- m, ^9 I+ K
  187. #  SETUP OPTIONS
    ) B8 s* m9 Z, a; }
  188. #------------------------------------------------------------------------------#: b/ n8 \7 w! S$ \- }0 {
  189.   
    2 F% @/ V$ o8 [. Q+ k
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the" z  J8 R! v+ s# j
  191.                         # region on the wall you want to make reflective (and" m, D7 l" _4 {! Y, i7 [
  192.                         # then use tiles/mapping that make the parallax visible)
    " H) J* t' T9 D  x: t& R
  193.   
    # M2 I5 D, E- r3 A
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters
    + @, a" v6 q) s5 {9 F  T
  195.    
    1 {% v- V" u& c
  196.   REFLECT_Z = -10       # Z level of reflections7 c( h1 l- u' t8 R6 {
  197.   SHADOW_Z = 0          # Z level of shadows
    : E3 J9 }! j( \" j& q% w- d- w/ V
  198.   
    $ D0 F1 c( I( ~4 ]
  199. #------------------------------------------------------------------------------#  
    & d! Z& _; n, z; k, y) |% p7 G
  200. #  END SETUP OPTIONS
    ! u. k# ~8 `8 `" D& o
  201. #------------------------------------------------------------------------------#: o) @- ^( p/ t" y, o
  202. end3 W; Q( w+ p/ `, P; p
  203.   
    & Z& H  I8 d3 Q; v& g7 R0 j
  204.   
    2 q. K0 n" W3 ?

  205. , R8 d3 ]) U9 }$ s0 y* w
  206. / ^( [% R- v0 E2 v4 }
  207. class Game_Map
    . V7 u, J0 l  x3 o+ ?2 v
  208.   def do_icons(refresh = true)
    ! m+ f% U" k6 N( q) z) F
  209.     @events.values.each { |e|1 @9 i  B+ e6 _8 h" R
  210.       next if !e.list
    - M4 E# _* U0 F+ D( A9 d
  211.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/- \- N1 S5 C) q, l0 N
  212.         e.icon = $1.to_i
    7 ]# {0 m. Y4 ]% R: ~$ ~
  213.         e.icon_offset = [$2.to_i,$3.to_i]( ]. Q: Q" D# P
  214.       else6 r6 Y( Y  b8 P  y* Z
  215.         e.icon = 0
    7 h; X* ~" n6 z4 U% h. `( V
  216.         e.icon_offset = [0,0]
    ; E: T8 j1 ]) l8 l+ D" c
  217.       end* b9 B( i! |$ b( V  F- W1 ~
  218.     }4 g4 r2 Q  C% A. y3 f
  219.     SceneManager.scene.spriteset.refresh_effects if refresh
    9 A. \; J( U  {) J; P
  220.   end7 h" ]! ?1 g3 t! I' [9 I
  221.    6 m: }9 m" c, M+ U% [2 H! j
  222.    
    # L0 @! O; p$ E9 y; a
  223.   def do_shadows(refresh = true)9 k, [3 M% n8 f2 q# L# o
  224.     @events.values.each { |e|$ f" p% N: \$ @/ F7 ?
  225.       next if !e.list
    1 k+ E5 {3 D; e1 O
  226.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/
      {4 m; l6 R+ i* T$ S; o+ ^. C
  227.         e.shadow = true
    ! }* T3 V1 k# z2 v  a8 l
  228.       else
    3 q' S1 W/ b/ d! s1 q
  229.         e.shadow = false3 c/ P& }, W1 z& F# G3 k
  230.       end9 K) |1 `3 A/ {1 J1 ^6 h9 g
  231.     }
    / e: P& W2 ^# U; v! A( a
  232.     SceneManager.scene.spriteset.refresh_effects if refresh
      v" l6 P1 {$ c4 c& D* _" j) U
  233.   end
    5 A  O( a$ [/ Q4 ]! u0 O
  234.    " e  R" e8 T4 O8 m
  235.   def do_reflects(refresh = true)/ [+ i( u* ]8 t0 l
  236.     @events.values.each { |e|
    9 A4 |! D. M" x# ^
  237.       next if !e.list
    " z: T" c4 S  _, o0 l* ~! r+ H! s
  238.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>/. R8 V) v' p; Z1 z6 z
  239.         e.reflect = true
    + K* {" V) C0 K/ v
  240.       else7 L! i$ q* e3 B( f0 Q4 f- O
  241.         e.reflect = false
    7 G; l% G& R, o8 T! I5 a' _
  242.       end& V* w' N  v; j9 ?/ O# P+ F" N
  243.     }( T0 O, T8 D1 M
  244.     SceneManager.scene.spriteset.refresh_effects if refresh9 u3 X( c1 ?! `: Q* g
  245.   end: Y& ?- m; {- }1 c
  246.    " z! V6 X7 p  D* I5 s5 m  Z9 F
  247.   def do_all_chareffects0 a$ [1 q" u9 ]( V
  248.     do_icons(false)
    $ v  D! o9 l) A
  249.     do_shadows(false)
    / k* |2 B9 k: O, `! r) E  H+ N- }
  250.     do_reflects(false)
    8 }" U3 t4 x2 M5 M- Z9 h
  251.   end! p' H* N% b' F3 r: x
  252.    
    : H9 ~8 W. A0 J
  253. end # Game_Map9 R( k& L/ }1 L1 ?9 U- h+ ~2 K* v

  254. ; u5 I# z/ `$ ~9 r1 T  |

  255.   }' b4 M9 D$ k

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

使用道具 举报

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

使用道具 举报

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

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

GMT+8, 2025-5-9 04:15

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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