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

Project1

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

水面动态倒影,求解

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

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

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

x
代码复制
  1.  

; \. Q" [4 G( [& ?$ Z9 k" C9 ~这个代码怎么用啊,有大神知道吗。我从国外找的。/ J7 ?! W: q9 l% \( @
http://galvs-scripts.com/2013/02/21/character-effects/
  ?3 U! C. \- ]是关于动态倒影的
梦石
0
星屑
50
在线时间
21 小时
注册时间
2014-6-25
帖子
7
2
 楼主| 发表于 2014-6-25 11:32:43 | 只看该作者
  1. #------------------------------------------------------------------------------#
    8 }$ K% {0 A3 Y4 i
  2. #  Galv's Character Effects4 Y4 j7 ^% g$ F4 i
  3. #------------------------------------------------------------------------------#5 n, h# x7 x* v) ?5 {3 d
  4. #  For: RPGMAKER VX ACE4 P0 B- n% X8 a) i; L  ^
  5. #  Version 2.1' O7 O  H: [. q- L% ^9 D
  6. #------------------------------------------------------------------------------#
    + W, D+ @* Y) _1 j) w
  7. #  2014-01-16 - Version 2.1 - Fixed double balloon/animation bug with shadows
    ; ~- k: M' k0 A! C, x% e% g4 b
  8. #  2013-12-07 - Version 2.0 - Added comments to more easily add event effects3 B& b5 h  f) A5 x- N
  9. #                           - Fixed shadow facing bug
    $ \/ x5 w  P1 m* i/ `4 s' G
  10. #  2013-02-24 - Version 1.9 - added z level option for reflection and shadows5 J; m3 Y8 z* \
  11. #  2013-02-23 - Version 1.8 - added multiple light sources for shadows& X1 z2 U/ R9 Q3 ^. m& ^
  12. #  2013-02-22 - Version 1.7 - bug fixes$ U# n. g8 ^6 t
  13. #  2013-02-22 - Version 1.6 - added icon effect8 F, g9 T" H; t) U$ q4 N" N( j& G
  14. #  2013-02-22 - Version 1.5 - fixed mirror bug on large maps
    4 H* N$ ]9 C6 z* B2 V, N
  15. #  2013-02-22 - Version 1.4 - added effects to vehicles: J) f1 j5 c( o
  16. #  2013-02-21 - Version 1.3 - fixed jump reflection and other minor tweaks
    : M1 ~  F3 W  j! f' v4 n+ o
  17. #  2013-02-21 - Version 1.2 - bug with less than 4 actors (oops)
    $ E4 [+ z( s" y) f# U1 ~
  18. #  2013-02-21 - Version 1.1 - updated flicker effect
    $ ~6 N, J1 D1 w+ S) O8 F' p
  19. #  2013-02-21 - Version 1.0 - release; O4 s% x0 q9 ^! M- T
  20. #------------------------------------------------------------------------------#0 L" T, k, w  L  W$ a3 n
  21. #  This script was made to provide some additional effects for characters such
    % x+ T1 v( j' {: I4 H: r7 X
  22. #  as events, followers and the player on the map.
    7 Y) C0 A, O$ C" C+ e) s* H
  23. #  Currently it includes:8 @& {! F  ~- s" t, g6 e! [$ @
  24. #
    3 p, n1 f0 T2 J1 m3 K7 k, H0 i
  25. #  Shadows* N" _1 o9 h# D( ~! w9 |+ G. z0 u
  26. #  Shadows that appear under player and events in a directions depending on$ S, R, a% {1 Q
  27. #  a light source that you choose.
      T- W9 f9 e- y2 Z
  28. #0 r! n5 d2 l0 B3 @3 B$ ]
  29. #  Parallax Reflect; m+ Z! ?# W. ~" v4 K+ M3 ?! s
  30. #  Reflections that appear on the parallax layer for events and actors to be' O1 c  @# v# q, P1 w3 V" R" A1 ?
  31. #  used for things like reflections in the water or glass floor etc. To get
    ! }8 T0 H/ {2 [7 T% ?, N) b
  32. #  effects like the demo, you need to edit the charset graphic to make the water
    " g! ]* [0 e2 \
  33. #  partially transparent.
    ! J- l" O/ z! r
  34. #
    & _, |' n8 L8 Q. V/ G6 L
  35. #  Parallax Mirrors5 j0 N8 x$ P4 e
  36. #  Much like reflect but are instead actors and event are reflected in a mirror9 ?! s! s# ^/ ]% M% e: a
  37. #  on a wall designated by a region. Both mirror and reflect effects can be
    0 z8 o( Y0 `; ^
  38. #  changed so actors and events can use different charsets for their reflections
    2 L4 n4 r% P6 m' W  M9 U
  39. #
    8 T+ o  E' q* z. ^4 I" S) `
  40. #------------------------------------------------------------------------------#) b2 p; \6 q8 z0 F6 B
  41.   
    4 P& {' V5 H' q# N6 _
  42. 6 k5 _7 e* H7 Z  ^( L
  43. #------------------------------------------------------------------------------#
    : q% I& U' @- u. E
  44. #  NEW - First event command as a COMMENT
    . B$ v" O  G+ D$ |8 x0 w" _
  45. #------------------------------------------------------------------------------#2 N4 h- a  I! E8 R# K8 W! v+ B' b
  46. #  You can add a comment as the first event command on an event page to set if
    . _2 I' P2 ^$ P% z1 K
  47. #  that event has an icon, shadow or reflection active. The tags to use are! F- N! q& {" h1 d4 u4 ]( \% n
  48. #  below, all must be on the same line in the comment./ l* i/ S, v: d
  49. #& Y. I  G( i5 J- \- t1 |
  50. # <icon:id,x,y>      # set the event to display an icon (x,y position offset)9 n- b, f- ^* a
  51. # <shadow>           # set the event to display a shadow
    # |1 q/ b  G( [9 g5 J/ E: `
  52. # <reflect>          # set the event to display reflections+ @" H8 ]) _  l/ ?6 L9 f$ }) m
  53. #3 r% @# Y9 M% |* Z! ?( u, @
  54. #------------------------------------------------------------------------------#
    + \' u0 r' v7 [; x
  55. #  EXAMPLE:
    , M1 H( }6 c+ [% l# |5 Q
  56. # <icon:1,0,0><shadow><reflect>    # to show reflect, shadow and icon 1 on event
    " E: S* y, z. Q" D2 e: y- m8 T& C
  57. #------------------------------------------------------------------------------#/ P4 k1 q2 Y$ }  ]8 `+ s
  58. " e- F$ s0 u, ~" [0 d6 Y+ A8 {
  59. 5 Z% j6 I0 [+ ?6 O" b5 r: v
  60. #------------------------------------------------------------------------------#
    1 @6 |! J& S1 u
  61. #  SCRIPT CALLS:
    + @5 U4 v0 p' n1 A2 c4 |- l
  62. #------------------------------------------------------------------------------#! y, @3 K9 V1 C* }
  63. #
    0 O- W& y+ C3 g$ N" |% m4 O# @
  64. #  char_effects(x,x,x,status)
    ' ~/ e& Z+ d  s# \% a( E; s) [
  65. #
    & v/ u1 R# `8 ]; m# N* m
  66. #------------------------------------------------------------------------------#- V( e3 u: Q4 V2 k, q! Y" t& G" [
  67. #  # each effect can be true or false to enable/disable them during the game.( Q) A2 z3 N% B4 @
  68. #  # you can change multiples of effects at once, x being the effect number
    - m& r0 [5 R# [4 W
  69. #  # 0 = reflect    1 = shadows    2 = mirror    3 = icons
    8 X7 G1 q% K# ]: c* T) q- z
  70. #------------------------------------------------------------------------------#
    # Y1 m* T  @5 t  L) _; H- ~
  71. #  EXAMPLES:4 b% N( S' z+ d
  72. #  char_effects(0,true)              # turn reflections on9 r3 M* y' C0 Q
  73. #  char_effects(0,2,true)            # turn reflections and mirror on
    ) E) Y% b$ G# V4 Y; N' v& L
  74. #  char_effects(1,3,false)           # turn shadows and icons off/ L  b0 m7 A. \+ _. _; `0 R" `
  75. #------------------------------------------------------------------------------#
    ! r# n! S8 G6 u7 [8 C+ {$ k
  76. #
    ; o  u  f# |0 H+ l; Y8 B/ h
  77. #  reflect_sprite(actor_id,filename,pos)    # Change actor's reflect charset
    7 v/ e6 \  q! A6 M( U. E2 t
  78. #, Y" M' Y- `9 q/ \  X/ S2 A
  79. #  reflect_esprite(event_id,filename,pos)   # Change event's reflect charset5 E* D4 _" J9 K3 i; y
  80. #& b5 B- _2 Z$ E6 N; x1 q6 n. y1 ~- b4 s
  81. #  reflect_vsprite(vehicle_id,filename,pos) # Change vehicle's reflect charset
    . K$ ~# K9 L! t: y0 t$ {8 ~
  82. #) e+ G0 ~& Y! P+ A( B+ v9 E% \
  83. #------------------------------------------------------------------------------#" l% h% V' k9 D  C
  84. #  EXAMPLES:5 B; U4 C; z" p
  85. #  reflect_sprite(1,"Actor2",2)      # change actor 1's charset to use sprite
    ! Z# G1 w1 Q" v' G$ j* |2 j' v
  86. #                                    # in position 2 of "Actor2" charset.5 ]1 r6 q$ l- Q, j4 _: Y3 Z6 i
  87. #  reflect_esprite(3,"Actor4",5)     # event 3 will use sprite in position 5 of0 g/ ^( W* l2 Q9 w4 Z" T& R
  88. #                                    # "Actor4" charset.
    * v6 |$ E  ]4 M1 E, N
  89. #  reflect_vsprite(1,"Vehicle",5)    # Ship will use sprite in position 5 of0 V1 K/ L5 E6 [2 l: q8 Y3 f
  90. #                                    # "Vehicle" charset.& P- \% {, p0 ?. a1 _
  91. #------------------------------------------------------------------------------#8 J' y  l6 N! l7 `8 K+ S
  92.   ; G) I" ~6 {. t8 S& Y
  93. #------------------------------------------------------------------------------#4 a1 x2 N( [$ I, H
  94. #  SCRIPT CALLS to turn effects ON or OFF for chosen EVENTS4 o: s3 ?* v5 h2 Z
  95. #------------------------------------------------------------------------------#6 n- @. l: Z7 m) q) K: s# k
  96. #. ?. t% o1 p& @+ T
  97. #  reflect(x,x,x,status)   # status can be true or false to turn on or off
    . p2 {3 o1 U, I5 v0 x) R6 j4 A
  98. #                          # use this to specify for mirror and reflect.! |; Y& g5 Q( p  |0 v
  99. #  shadow(x,x,x,status)    # where x is the event ids you want to change1 T. \7 V% _+ L+ H  ^1 M4 v# [. m
  100. #                          # to change all events use :all
    5 x  v1 S' y" x4 }  L
  101. #  icon(x,x,x,icon_id)     # set which icon id to appear above character. Make  B6 k% u9 m) k! T
  102. #                          # it 0 for no icon.
    5 {/ q5 [" g8 w1 d
  103. #
    % B: l! o) e0 O4 O/ }8 U2 J
  104. #------------------------------------------------------------------------------#7 v7 x. u0 S3 l4 ^# k0 z5 Q
  105. #  EXAMPLES:
    9 o$ p5 ^5 E  D
  106. #  reflect(14,17,3,1,true) # Turn events 14, 17, 3 and 1 reflections ON
    % i: b8 s" U* [
  107. #  shadow(1,false)         # Turn event 1 shadow OFF7 Z' q6 D) X6 F; R8 k
  108. #  reflect(:all,true)      # Turn all event reflections ON2 v' z. j3 _) u8 y2 w
  109. #  icon(1,2,3,4,38)        # Events 1,2,3 and 4 will have icon 38 appear6 ^, V; n1 _% Y% j
  110. #- _* ?- Z2 W& {$ C# h
  111. #  NOTE: All events will default to NO shadows and NO reflections when entering
    * H+ v6 M' k) `5 s
  112. #        a map. This is a design decision to try to keep lag to a minimum. You
    2 [+ |* t( |7 z) F
  113. #        should use these effects sparingly and only activate them on events% M8 X  {1 O( L! |
  114. #        that require them.8 K* [5 s2 ]* T* ~9 W' I4 t, w
  115. #------------------------------------------------------------------------------#
    ( b& g) y/ w# w! b2 T
  116.   
    , m6 _, {8 d' J
  117. #------------------------------------------------------------------------------#
    1 N# G: A" [5 [
  118. #  SCRIPT CALLS to turn effects ON or OFF for ACTORS and VEHICLES
    $ p6 W; b- n" }5 y/ ^( G
  119. #------------------------------------------------------------------------------#
    % M% _( {- A+ Y! t: ~
  120. #
    - t: U2 X; r/ I) ]
  121. #  actor_reflect(actor_id,status)  # reflections and shadows are ON by default * u3 D4 s3 u- l. b+ C3 b7 W' y
  122. #  actor_shadow(actor_id,status)   # for actors and vehicles. Turning them off
    ; A; j6 H8 q5 r+ Q, q" {# l' C* Y6 Y% d, j
  123. #  actor_icon(actor_id,icon_id)    # or on will permanently change them.
    8 w' a& e9 ]- \7 X/ W
  124. #
    & S& L( l+ ~0 J* q, f$ I
  125. #  v_reflect(x,x,x,status)    # use these v_ calls for changing vehicle effects8 n: u4 r5 T1 I
  126. #  v_shadow(x,x,x,status)     # on and off for vehicles.
    + K! B7 G; H3 r/ u  D1 i# d  ~. P
  127. #  v_icon(x,x,x,icon_id)
    7 I6 s! Z* G" P! R( @
  128. #+ E+ P/ A- K) w. u( N8 `' G9 F
  129. #------------------------------------------------------------------------------#( D7 o( p/ E. ~& A; N
  130.   
    . U. n- K# _7 _
  131. #------------------------------------------------------------------------------#
    : T1 v4 e, b3 ^! E; V+ e6 d
  132. #  SCRIPT CALLS for shadow options
    3 H% _+ r& {0 L8 j+ \/ p( N
  133. #------------------------------------------------------------------------------#
    ' P: B' D- D0 {, T
  134. #: E% Y5 J+ W+ K( O4 }! m5 i  }+ e
  135. #  shadow_source(x,y,id)       # set the x,y location for the light. id is the
    # J& [" z7 ^/ v
  136. #                              # light source number you wish to change (for& x5 C) s6 |0 y5 H3 y: n1 v; _6 [
  137. #                              # more than one). These are reset on map change.6 O8 k. x& k+ ]: y$ B9 O
  138. #  shadow_source(event_id,id)  # use an event's x,y location for the light.. p, i) p) Y, m3 a7 ?0 Q
  139. #                              # This will need to be in parallel process if you
    ) ~3 s& b- \* D  N$ @
  140. #                              # want it to be a moving light.
    9 P; V0 m% a" P! G0 \1 d! R: \
  141. #
    + P2 F0 s) N( L- @
  142. #  shadow_options(intensity,fade,flicker)    # descriptions below9 j( m: n) E6 P2 X- E, e* Y# I
  143. #2 A2 e2 P' m) I) a  L
  144. #    # intensity = opacity when standing next to the light source (255 is black)5 l% i2 }$ @  L! c, j5 H; q, M8 j
  145. #    # fade = amount shadow becomes more transparent the further away you are.: P: `! |8 N9 }5 u$ l- G
  146. #    # flicker = true or false. Shadows will flicker as if being cast by fire.5 X4 z& R( F* |0 x$ {' |
  147. #
    9 \: r% k4 K) T* Y0 F
  148. #------------------------------------------------------------------------------#
    ' X* q3 v4 B5 t/ W0 J* _
  149. #  EXAMPLE:" z5 b3 [& ^0 [1 ^- Y7 R
  150. #  shadow_options(80,10,false)    # This is the default setting.
    : ^1 m+ t- ?# i3 |( Q. `, ~7 W: d
  151. #------------------------------------------------------------------------------#- @# C. j% l% A4 T. u; S9 q
  152.   - P. K- e" e/ t
  153. #------------------------------------------------------------------------------#; v8 [0 x: M# v0 U: B
  154. #  SCRIPT CALLS for reflect options  \' H1 k/ g5 N7 b
  155. #------------------------------------------------------------------------------#
    & S8 Y7 Z0 m5 N9 \/ h2 M5 q( H
  156. #0 |; @5 ]% J& ]% Q9 R; \( O3 p
  157. #  reflect_options(wave_pwr) , d7 d1 n( ^, k  I) p6 C* u
  158. #9 ^, n, n3 Y! u: E
  159. #    # wave_pwr = how strong the wave movement is. 0 is off! i  n9 u) d5 T# h' ?
  160. #
    & E7 x+ M" V6 S  ~
  161. #------------------------------------------------------------------------------#
    * P! |- m" x9 P: p' }
  162. #  EXAMPLE:
    9 D' V8 ~: }1 O$ w9 O& |
  163. #  reflect_options(1) # Turn wave power to 1
    + c& w% k2 ?8 E6 J& a
  164. #------------------------------------------------------------------------------#
    8 O9 K4 E" {4 V$ k
  165.   
    2 r9 O! T) c' d4 Q) o
  166.   ' S2 z  B2 A$ m) ]9 y. [: ]2 A
  167. #------------------------------------------------------------------------------#
    * O( ~5 ]0 O' g! u" y* q8 \8 ?2 m
  168. #  NOTETAG for ACTORS( G5 }4 i" c% T6 A
  169. #------------------------------------------------------------------------------#
    1 x: {3 O/ n  E. [7 u
  170. #. Z* \5 K, s" P) l" j2 \& c
  171. #  <no_reflect>    # Actor will not have a reflection (for vampires of course!)
    / `( c/ |4 `  ~' z  G, H
  172. #
    * q! b' c2 ^9 l
  173. #  <reflect_sprite: FileName,pos>  # Actor will use this charset for reflections) p9 T- }4 m* M4 l. B
  174. #                                  # and use the character in position 'pos'
    6 Y6 g* r$ ]' H
  175. #& R9 D# L7 `- D# b6 E9 _" }% F
  176. #------------------------------------------------------------------------------#
    % D  o  ]6 r& N/ ^' f
  177. #  EXAMPLES:
    ! v. B0 \* l" i! e7 W% j. {( W
  178. #  <reflect_sprite: Actor2,0>    # The first character from Actor2 charset, G6 h( H6 Q2 s5 J& n1 q( q
  179. #  <reflect_sprite: Actor3,7>    # The last character from Actor2 charset& V' F3 ]9 z+ v! w; [- @
  180. #------------------------------------------------------------------------------#
    9 m* z/ U; [4 B) v+ r
  181.   
    ! L) |+ q; A9 }
  182.   
    ) s& f: Q& b1 L: O
  183. ($imported ||= {})["Galv_Character_Effects"] = true+ A9 \" W/ I7 M1 K8 M
  184. module Galv_CEffects
      r+ E- {2 {+ \3 q' E9 ^
  185.   " W: z4 v) N0 {! T; r
  186. #------------------------------------------------------------------------------#  4 E* K# Z% |3 f+ J3 I" o
  187. #  SETUP OPTIONS
    " t1 I3 k" T/ Z9 x- X' n, B2 u
  188. #------------------------------------------------------------------------------#
    ( S1 m5 w* S; ^, O9 Z6 w' p9 m
  189.   
    # ~& O0 z) V4 W$ {2 _/ _
  190.   MIRROR_REGION = 1     # Region ID used to determine mirror walls. Paint the) I2 j* W! G' v- N0 e# V+ p: d$ m2 X
  191.                         # region on the wall you want to make reflective (and
    / `. r* W* C: B3 n( b
  192.                         # then use tiles/mapping that make the parallax visible)
    0 ~$ J7 C4 u, a8 U0 u* e- M
  193.   
    * M* |9 h( \$ \. U# w
  194.   ICON_OFFSET = -60     # Y offset for icons that are displayed above characters
      g9 _5 G# ^0 ^: C' O
  195.       }3 n' u4 E+ v, X5 K6 b! j
  196.   REFLECT_Z = -10       # Z level of reflections0 F% N, x. b. w5 M# l1 b
  197.   SHADOW_Z = 0          # Z level of shadows5 e' I8 v# s' W* y
  198.   / w8 L, A/ g6 M& R0 D0 K
  199. #------------------------------------------------------------------------------#  
    2 y3 t1 ~' R( e. w9 _$ d3 U
  200. #  END SETUP OPTIONS. A  g% c  _& ~! r6 h% c9 o
  201. #------------------------------------------------------------------------------#* @! p! u2 s) ]4 j. u
  202. end
    3 _  g$ P" B$ i+ x( h* C& o: z% y
  203.   
    8 m6 c6 ]# B. p4 g1 x1 B6 v
  204.   
      b% _3 F. R$ [, w
  205. ; e0 E0 F9 y, G+ H0 o# \

  206. 1 F3 b, o5 x* ?/ L
  207. class Game_Map( w  i( {# Z% s
  208.   def do_icons(refresh = true)
    + P& A, P0 v: Z/ L* K
  209.     @events.values.each { |e|; I2 i' s7 Q2 k0 Y3 K
  210.       next if !e.list) H& a; y& y6 ~3 b& ]
  211.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<icon:(.*),(.*),(.*)>/
    " U5 c- l3 Z  x# l
  212.         e.icon = $1.to_i
    " P% n* O# g; L0 X  w! @
  213.         e.icon_offset = [$2.to_i,$3.to_i]) I/ c! c# y  X0 m1 O6 q) a, o
  214.       else
    - q+ ?5 I' }( \
  215.         e.icon = 0
    5 }7 |5 u( ]- u& {, i" w
  216.         e.icon_offset = [0,0]
    : p! b2 H4 \9 x+ \- R3 _/ P
  217.       end
    + ?. D5 s) m6 {( J8 O1 Y6 ^
  218.     }% \5 i, g7 L/ h0 e/ q6 C$ |
  219.     SceneManager.scene.spriteset.refresh_effects if refresh0 I' S+ n/ T) `* O) r3 M
  220.   end3 J' Y& ^& Q- |
  221.    
    , A" O( x7 r$ p5 p  Y4 Z! {! ?
  222.    
    6 v, A) g7 y, j0 l2 ?
  223.   def do_shadows(refresh = true)
    ( Q4 _& ]! `  `- \  @
  224.     @events.values.each { |e|
    * C: Q  b* S- M
  225.       next if !e.list4 j6 J, c9 E0 `9 a6 A$ q# L
  226.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<shadow>/
    + w5 k, \1 I2 r
  227.         e.shadow = true+ Z0 U  _3 z5 \' v  E
  228.       else
    2 R( t" t7 N1 }2 g  h+ v
  229.         e.shadow = false
    - i# {$ M; y- v
  230.       end
    " o% z1 @! C+ K7 o1 r0 U
  231.     }
    5 H+ i+ B' L7 d  V; o9 d
  232.     SceneManager.scene.spriteset.refresh_effects if refresh
    / d+ w, I" o6 {0 \
  233.   end
    ' H- `/ ~6 r1 T) y# K2 p
  234.    
    - L) o; `0 z/ `) }+ {
  235.   def do_reflects(refresh = true)
    7 j0 j' s& X5 J% I7 ~
  236.     @events.values.each { |e|
    / U7 V1 c4 u0 V5 \% ?: l6 b4 M
  237.       next if !e.list
    4 r2 R5 h5 a/ O& a! o9 T2 z$ j
  238.       if e.list[0].code == 108 && e.list[0].parameters[0] =~ /<reflect>/1 g! G7 j/ @7 T  x: v
  239.         e.reflect = true
    4 G! }5 E4 d3 H
  240.       else% N* g2 S+ H0 s" z, l
  241.         e.reflect = false# X# m* e, i- r" c$ `, ]6 P9 i
  242.       end5 b- C0 W. x9 P; w
  243.     }
    * [( A+ y& B% `. F$ ]( ?4 {' v. c
  244.     SceneManager.scene.spriteset.refresh_effects if refresh: }5 U& c' p. r  Q0 \- G7 u9 _' g
  245.   end
    $ E" ]& N- V" a: B: L" W$ G
  246.    
    " W0 p' T' ]; d' ~5 V- ]" C1 g6 @- W5 @
  247.   def do_all_chareffects
    % S: X0 b1 z: Z6 I  H
  248.     do_icons(false)
    6 M+ h- I$ [3 S6 V# [
  249.     do_shadows(false)2 j8 `/ H3 y# c3 r( @  H& S* A
  250.     do_reflects(false)' V$ u$ T, Z% b" H, l
  251.   end
    " G" @$ V2 H& t
  252.    
    5 H0 j; b. x0 t
  253. end # Game_Map0 C; s- m' N- ?' Z" j' i  n
  254. . ^9 S7 `8 X# ^& P

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

使用道具 举报

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

使用道具 举报

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

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

GMT+8, 2025-7-20 15:29

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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